foxact 0.2.33 → 0.2.35

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/README.md CHANGED
@@ -42,3 +42,9 @@ Every hook and util is isolated and side-effects free, eliminating unused code a
42
42
  Authored and maintained by Sukka with help from contributors ([list](https://github.com/SukkaW/foxact/graphs/contributors)).
43
43
 
44
44
  > [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Mastodon [@sukka@acg.mn](https://acg.mn/@sukka) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Keybase [@sukka](https://keybase.io/sukka)
45
+
46
+ <p align="center">
47
+ <a href="https://github.com/sponsors/SukkaW/">
48
+ <img src="https://sponsor.cdn.skk.moe/sponsors.svg"/>
49
+ </a>
50
+ </p>
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),o=require("../noop/index.cjs"),t=require("../use-isomorphic-layout-effect/index.cjs"),n=require("../no-ssr/index.cjs");const r=e=>"function"==typeof e,a=e=>e,i=()=>{throw n.noSSRError("useLocalStorage cannot be used on the server without a serverValue")};exports.createStorage=function(n){const l="localStorage"===n?"foxact-use-local-storage":"foxact-use-session-storage",c="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",s="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(c,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(c,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(c,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,c){var s;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=e.useCallback(e=>{if("undefined"==typeof window)return o.noop;const t=o=>{"key"in o&&o.key!==n||e()},r=o=>{o.detail===n&&e()};return window.addEventListener("storage",t),window.addEventListener(l,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l,r)}},[n]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==c?()=>y(c):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==c&&u(n,y(c))},[g,n,y,c]),[null!==(s=null!=h?h:c)&&void 0!==s?s:null,S]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
1
+ "use strict";require("client-only");var e=require("react"),o=require("../noop/index.cjs"),t=require("../use-isomorphic-layout-effect/index.cjs"),n=require("../no-ssr/index.cjs");const r=e=>"function"==typeof e,a=e=>e,i=()=>{throw n.noSSRError("useLocalStorage cannot be used on the server without a serverValue")};exports.createStorage=function(n){const l="localStorage"===n?"foxact-use-local-storage":"foxact-use-session-storage",c="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",s="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(c,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(c,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(c,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,c){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const f=e.useCallback(e=>{if("undefined"==typeof window)return o.noop;const t=o=>{"key"in o&&o.key!==n||e()},r=o=>{o.detail===n&&e()};return window.addEventListener("storage",t),window.addEventListener(l,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l,r)}},[n]),v=s.raw?a:s.serializer,y=s.raw?a:s.deserializer,g=void 0!==c?()=>v(c):i,m=e.useSyncExternalStore(f,()=>w(n),g),p=e.useMemo(()=>null===m?null:y(m),[m,y]),h=e.useCallback(e=>{try{const o=r(e)?e(null!=p?p:null):e;null===o?d(n):u(n,v(o))}catch(e){console.warn(e)}},[n,v,p]);return t.useLayoutEffect(()=>{null===w(n)&&void 0!==c&&u(n,v(c))},[y,n,v,c]),[null===p?void 0===c?null:c:p,h]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
@@ -20,8 +20,11 @@ interface UseStorageParserOption<T> {
20
20
  deserializer: Deserializer<T>;
21
21
  }
22
22
  declare function createStorage(type: StorageType): {
23
- useStorage: <T>(key: string, serverValue?: NotUndefined<T> | undefined, options?: UseStorageRawOption | UseStorageParserOption<T>) => readonly [NonNullable<T> | null, react.Dispatch<react.SetStateAction<T | null>>];
24
- useSetStorage: <T_1>(key: string, serializer: Serializer<T_1>) => (v: T_1 | null) => void;
23
+ useStorage: {
24
+ <T>(key: string, serverValue: NotUndefined<T>, options?: UseStorageRawOption | UseStorageParserOption<T>): readonly [T, React.Dispatch<React.SetStateAction<T | null>>];
25
+ <T_1>(key: string, serverValue?: undefined, options?: UseStorageRawOption | UseStorageParserOption<T_1> | undefined): readonly [T_1 | null, react.Dispatch<react.SetStateAction<T_1 | null>>];
26
+ };
27
+ useSetStorage: <T_2>(key: string, serializer: Serializer<T_2>) => (v: T_2 | null) => void;
25
28
  };
26
29
 
27
30
  export { type Deserializer, type Serializer, type UseStorageParserOption, type UseStorageRawOption, createStorage };
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),o=require("../noop/index.js"),t=require("../use-isomorphic-layout-effect/index.js"),n=require("../no-ssr/index.js");const r=e=>"function"==typeof e,a=e=>e,i=()=>{throw n.noSSRError("useLocalStorage cannot be used on the server without a serverValue")};exports.createStorage=function(n){const l="localStorage"===n?"foxact-use-local-storage":"foxact-use-session-storage",s="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",c="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(s,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{c(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(s,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{c(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(s,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,s){var c;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=e.useCallback(e=>{if("undefined"==typeof window)return o.noop;const t=o=>{"key"in o&&o.key!==n||e()},r=o=>{o.detail===n&&e()};return window.addEventListener("storage",t),window.addEventListener(l,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l,r)}},[n]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==s?()=>y(s):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==s&&u(n,y(s))},[g,n,y,s]),[null!==(c=null!=h?h:s)&&void 0!==c?c:null,S]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
1
+ "use strict";require("client-only");var e=require("react"),o=require("../noop/index.js"),t=require("../use-isomorphic-layout-effect/index.js"),n=require("../no-ssr/index.js");const r=e=>"function"==typeof e,a=e=>e,i=()=>{throw n.noSSRError("useLocalStorage cannot be used on the server without a serverValue")};exports.createStorage=function(n){const l="localStorage"===n?"foxact-use-local-storage":"foxact-use-session-storage",s="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",c="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(s,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{c(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(s,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{c(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(s,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,s){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const f=e.useCallback(e=>{if("undefined"==typeof window)return o.noop;const t=o=>{"key"in o&&o.key!==n||e()},r=o=>{o.detail===n&&e()};return window.addEventListener("storage",t),window.addEventListener(l,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l,r)}},[n]),v=c.raw?a:c.serializer,y=c.raw?a:c.deserializer,g=void 0!==s?()=>v(s):i,m=e.useSyncExternalStore(f,()=>w(n),g),p=e.useMemo(()=>null===m?null:y(m),[m,y]),h=e.useCallback(e=>{try{const o=r(e)?e(null!=p?p:null):e;null===o?d(n):u(n,v(o))}catch(e){console.warn(e)}},[n,v,p]);return t.useLayoutEffect(()=>{null===w(n)&&void 0!==s&&u(n,v(s))},[y,n,v,s]),[null===p?void 0===s?null:s:p,h]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
@@ -1 +1 @@
1
- import"client-only";import{useCallback as e,useSyncExternalStore as o,useMemo as t}from"react";import{noop as n}from"../noop/index.mjs";import{useIsomorphicLayoutEffect as r}from"../use-isomorphic-layout-effect/index.mjs";import{noSSRError as i}from"../no-ssr/index.mjs";const a=e=>"function"==typeof e,l=e=>e,c=()=>{throw i("useLocalStorage cannot be used on the server without a serverValue")};function s(i){const s="localStorage"===i?"foxact-use-local-storage":"foxact-use-session-storage",d="localStorage"===i?"foxact/use-local-storage":"foxact/use-session-storage",u="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(s,{detail:e}))}:n,w="undefined"!=typeof window?(e,o)=>{try{window[i].setItem(e,o)}catch(e){console.warn("[".concat(d,"] Failed to set value to ").concat(i,", it might be blocked"))}finally{u(e)}}:n,f="undefined"!=typeof window?e=>{try{window[i].removeItem(e)}catch(e){console.warn("[".concat(d,"] Failed to remove value from ").concat(i,", it might be blocked"))}finally{u(e)}}:n,m=e=>{if("undefined"==typeof window)return null;try{return window[i].getItem(e)}catch(e){return console.warn("[".concat(d,"] Failed to get value from ").concat(i,", it might be blocked")),null}};return{useStorage:function(i,d){var u;let v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const g=e(e=>{if("undefined"==typeof window)return n;const o=o=>{"key"in o&&o.key!==i||e()},t=o=>{o.detail===i&&e()};return window.addEventListener("storage",o),window.addEventListener(s,t),()=>{window.removeEventListener("storage",o),window.removeEventListener(s,t)}},[i]),y=v.raw?l:v.serializer,p=v.raw?l:v.deserializer,h=o(g,()=>m(i),void 0!==d?()=>y(d):c),S=t(()=>null===h?null:p(h),[h,p]),x=e(e=>{try{const o=a(e)?e(null!=S?S:null):e;null===o?f(i):w(i,y(o))}catch(e){console.warn(e)}},[i,y,S]);return r(()=>{null===m(i)&&void 0!==d&&w(i,y(d))},[p,i,y,d]),[null!==(u=null!=S?S:d)&&void 0!==u?u:null,x]},useSetStorage:(o,t)=>e(e=>{try{null===e?f(o):w(o,t(e))}catch(e){console.warn(e)}},[o,t])}}export{s as createStorage};
1
+ import"client-only";import{useCallback as e,useSyncExternalStore as o,useMemo as t}from"react";import{noop as n}from"../noop/index.mjs";import{useLayoutEffect as r}from"../use-isomorphic-layout-effect/index.mjs";import{noSSRError as i}from"../no-ssr/index.mjs";const a=e=>"function"==typeof e,l=e=>e,c=()=>{throw i("useLocalStorage cannot be used on the server without a serverValue")};function s(i){const s="localStorage"===i?"foxact-use-local-storage":"foxact-use-session-storage",d="localStorage"===i?"foxact/use-local-storage":"foxact/use-session-storage",u="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(s,{detail:e}))}:n,w="undefined"!=typeof window?(e,o)=>{try{window[i].setItem(e,o)}catch(e){console.warn("[".concat(d,"] Failed to set value to ").concat(i,", it might be blocked"))}finally{u(e)}}:n,f="undefined"!=typeof window?e=>{try{window[i].removeItem(e)}catch(e){console.warn("[".concat(d,"] Failed to remove value from ").concat(i,", it might be blocked"))}finally{u(e)}}:n,m=e=>{if("undefined"==typeof window)return null;try{return window[i].getItem(e)}catch(e){return console.warn("[".concat(d,"] Failed to get value from ").concat(i,", it might be blocked")),null}};return{useStorage:function(i,d){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const g=e(e=>{if("undefined"==typeof window)return n;const o=o=>{"key"in o&&o.key!==i||e()},t=o=>{o.detail===i&&e()};return window.addEventListener("storage",o),window.addEventListener(s,t),()=>{window.removeEventListener("storage",o),window.removeEventListener(s,t)}},[i]),v=u.raw?l:u.serializer,y=u.raw?l:u.deserializer,p=o(g,()=>m(i),void 0!==d?()=>v(d):c),h=t(()=>null===p?null:y(p),[p,y]),S=e(e=>{try{const o=a(e)?e(null!=h?h:null):e;null===o?f(i):w(i,v(o))}catch(e){console.warn(e)}},[i,v,h]);return r(()=>{null===m(i)&&void 0!==d&&w(i,v(d))},[y,i,v,d]),[null===h?void 0===d?null:d:h,S]},useSetStorage:(o,t)=>e(e=>{try{null===e?f(o):w(o,t(e))}catch(e){console.warn(e)}},[o,t])}}export{s as createStorage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "homepage": "https://foxact.skk.moe",
6
6
  "repository": {
@@ -32,24 +32,27 @@
32
32
  "optional": true
33
33
  }
34
34
  },
35
- "overrides": {
36
- "rollup": "$rollup",
37
- "array-includes": "npm:@nolyfill/array-includes@latest",
38
- "array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
39
- "array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
40
- "array.prototype.tosorted": "npm:@nolyfill/array.prototype.tosorted@latest",
41
- "has": "npm:@nolyfill/has@latest",
42
- "object.assign": "npm:@nolyfill/object.assign@latest",
43
- "object.entries": "npm:@nolyfill/object.entries@latest",
44
- "object.fromentries": "npm:@nolyfill/object.fromentries@latest",
45
- "object.hasown": "npm:@nolyfill/object.hasown@latest",
46
- "object.values": "npm:@nolyfill/object.values@latest",
47
- "string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@latest",
48
- "es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@latest",
49
- "array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
50
- "function-bind": "npm:@nolyfill/function-bind@latest",
51
- "object.groupby": "npm:@nolyfill/object.groupby@latest",
52
- "hasown": "npm:@nolyfill/hasown@latest"
35
+ "packageManager": "pnpm@9.1.4",
36
+ "pnpm": {
37
+ "overrides": {
38
+ "array-includes": "npm:@nolyfill/array-includes@latest",
39
+ "array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
40
+ "array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
41
+ "array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
42
+ "array.prototype.tosorted": "npm:@nolyfill/array.prototype.tosorted@latest",
43
+ "es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@latest",
44
+ "function-bind": "npm:@nolyfill/function-bind@latest",
45
+ "has": "npm:@nolyfill/has@latest",
46
+ "hasown": "npm:@nolyfill/hasown@latest",
47
+ "object.assign": "npm:@nolyfill/object.assign@latest",
48
+ "object.entries": "npm:@nolyfill/object.entries@latest",
49
+ "object.fromentries": "npm:@nolyfill/object.fromentries@latest",
50
+ "object.groupby": "npm:@nolyfill/object.groupby@latest",
51
+ "object.hasown": "npm:@nolyfill/object.hasown@latest",
52
+ "object.values": "npm:@nolyfill/object.values@latest",
53
+ "string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@latest",
54
+ "rollup": "$rollup"
55
+ }
53
56
  },
54
57
  "typeVersions": {
55
58
  ">=4.8": {
@@ -66,50 +69,14 @@
66
69
  "exports": {
67
70
  "./package.json": "./package.json",
68
71
  "./sizes.json": "./sizes.json",
69
- "./use-array": {
70
- "types": "./use-array/index.d.ts",
71
- "import": {
72
- "types": "./use-array/index.d.ts",
73
- "default": "./use-array/index.mjs"
74
- },
75
- "require": "./use-array/index.cjs",
76
- "default": "./use-array/index.js"
77
- },
78
- "./current-year": {
79
- "types": "./current-year/index.d.ts",
80
- "import": {
81
- "types": "./current-year/index.d.ts",
82
- "default": "./current-year/index.mjs"
83
- },
84
- "require": "./current-year/index.cjs",
85
- "default": "./current-year/index.js"
86
- },
87
- "./use-react-router-enable-concurrent-navigation": {
88
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
89
- "import": {
90
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
91
- "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
92
- },
93
- "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
94
- "default": "./use-react-router-enable-concurrent-navigation/index.js"
95
- },
96
- "./compose-context-provider": {
97
- "types": "./compose-context-provider/index.d.ts",
98
- "import": {
99
- "types": "./compose-context-provider/index.d.ts",
100
- "default": "./compose-context-provider/index.mjs"
101
- },
102
- "require": "./compose-context-provider/index.cjs",
103
- "default": "./compose-context-provider/index.js"
104
- },
105
- "./nullthrow": {
106
- "types": "./nullthrow/index.d.ts",
72
+ "./use-abortable-effect": {
73
+ "types": "./use-abortable-effect/index.d.ts",
107
74
  "import": {
108
- "types": "./nullthrow/index.d.ts",
109
- "default": "./nullthrow/index.mjs"
75
+ "types": "./use-abortable-effect/index.d.ts",
76
+ "default": "./use-abortable-effect/index.mjs"
110
77
  },
111
- "require": "./nullthrow/index.cjs",
112
- "default": "./nullthrow/index.js"
78
+ "require": "./use-abortable-effect/index.cjs",
79
+ "default": "./use-abortable-effect/index.js"
113
80
  },
114
81
  "./use-next-pathname": {
115
82
  "types": "./use-next-pathname/index.d.ts",
@@ -120,41 +87,14 @@
120
87
  "require": "./use-next-pathname/index.cjs",
121
88
  "default": "./use-next-pathname/index.js"
122
89
  },
123
- "./use-intersection": {
124
- "types": "./use-intersection/index.d.ts",
125
- "import": {
126
- "types": "./use-intersection/index.d.ts",
127
- "default": "./use-intersection/index.mjs"
128
- },
129
- "require": "./use-intersection/index.cjs",
130
- "default": "./use-intersection/index.js"
131
- },
132
- "./typescript-happy-forward-ref": {
133
- "types": "./typescript-happy-forward-ref/index.d.ts",
134
- "import": {
135
- "types": "./typescript-happy-forward-ref/index.d.ts",
136
- "default": "./typescript-happy-forward-ref/index.mjs"
137
- },
138
- "require": "./typescript-happy-forward-ref/index.cjs",
139
- "default": "./typescript-happy-forward-ref/index.js"
140
- },
141
- "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
142
- "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
143
- "import": {
144
- "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
145
- "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
146
- },
147
- "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
148
- "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
149
- },
150
- "./use-session-storage": {
151
- "types": "./use-session-storage/index.d.ts",
90
+ "./noop": {
91
+ "types": "./noop/index.d.ts",
152
92
  "import": {
153
- "types": "./use-session-storage/index.d.ts",
154
- "default": "./use-session-storage/index.mjs"
93
+ "types": "./noop/index.d.ts",
94
+ "default": "./noop/index.mjs"
155
95
  },
156
- "require": "./use-session-storage/index.cjs",
157
- "default": "./use-session-storage/index.js"
96
+ "require": "./noop/index.cjs",
97
+ "default": "./noop/index.js"
158
98
  },
159
99
  "./use-singleton": {
160
100
  "types": "./use-singleton/index.d.ts",
@@ -165,50 +105,41 @@
165
105
  "require": "./use-singleton/index.cjs",
166
106
  "default": "./use-singleton/index.js"
167
107
  },
168
- "./use-react-router-is-match": {
169
- "types": "./use-react-router-is-match/index.d.ts",
170
- "import": {
171
- "types": "./use-react-router-is-match/index.d.ts",
172
- "default": "./use-react-router-is-match/index.mjs"
173
- },
174
- "require": "./use-react-router-is-match/index.cjs",
175
- "default": "./use-react-router-is-match/index.js"
176
- },
177
- "./use-debounced-value": {
178
- "types": "./use-debounced-value/index.d.ts",
108
+ "./use-url-hash-state": {
109
+ "types": "./use-url-hash-state/index.d.ts",
179
110
  "import": {
180
- "types": "./use-debounced-value/index.d.ts",
181
- "default": "./use-debounced-value/index.mjs"
111
+ "types": "./use-url-hash-state/index.d.ts",
112
+ "default": "./use-url-hash-state/index.mjs"
182
113
  },
183
- "require": "./use-debounced-value/index.cjs",
184
- "default": "./use-debounced-value/index.js"
114
+ "require": "./use-url-hash-state/index.cjs",
115
+ "default": "./use-url-hash-state/index.js"
185
116
  },
186
- "./use-composition-input": {
187
- "types": "./use-composition-input/index.d.ts",
117
+ "./use-retimer": {
118
+ "types": "./use-retimer/index.d.ts",
188
119
  "import": {
189
- "types": "./use-composition-input/index.d.ts",
190
- "default": "./use-composition-input/index.mjs"
120
+ "types": "./use-retimer/index.d.ts",
121
+ "default": "./use-retimer/index.mjs"
191
122
  },
192
- "require": "./use-composition-input/index.cjs",
193
- "default": "./use-composition-input/index.js"
123
+ "require": "./use-retimer/index.cjs",
124
+ "default": "./use-retimer/index.js"
194
125
  },
195
- "./rem": {
196
- "types": "./rem/index.d.ts",
126
+ "./use-next-link": {
127
+ "types": "./use-next-link/index.d.ts",
197
128
  "import": {
198
- "types": "./rem/index.d.ts",
199
- "default": "./rem/index.mjs"
129
+ "types": "./use-next-link/index.d.ts",
130
+ "default": "./use-next-link/index.mjs"
200
131
  },
201
- "require": "./rem/index.cjs",
202
- "default": "./rem/index.js"
132
+ "require": "./use-next-link/index.cjs",
133
+ "default": "./use-next-link/index.js"
203
134
  },
204
- "./use-set": {
205
- "types": "./use-set/index.d.ts",
135
+ "./invariant": {
136
+ "types": "./invariant/index.d.ts",
206
137
  "import": {
207
- "types": "./use-set/index.d.ts",
208
- "default": "./use-set/index.mjs"
138
+ "types": "./invariant/index.d.ts",
139
+ "default": "./invariant/index.mjs"
209
140
  },
210
- "require": "./use-set/index.cjs",
211
- "default": "./use-set/index.js"
141
+ "require": "./invariant/index.cjs",
142
+ "default": "./invariant/index.js"
212
143
  },
213
144
  "./context-state": {
214
145
  "types": "./context-state/index.d.ts",
@@ -219,32 +150,14 @@
219
150
  "require": "./context-state/index.cjs",
220
151
  "default": "./context-state/index.js"
221
152
  },
222
- "./request-idle-callback": {
223
- "types": "./request-idle-callback/index.d.ts",
224
- "import": {
225
- "types": "./request-idle-callback/index.d.ts",
226
- "default": "./request-idle-callback/index.mjs"
227
- },
228
- "require": "./request-idle-callback/index.cjs",
229
- "default": "./request-idle-callback/index.js"
230
- },
231
- "./use-abortable-effect": {
232
- "types": "./use-abortable-effect/index.d.ts",
233
- "import": {
234
- "types": "./use-abortable-effect/index.d.ts",
235
- "default": "./use-abortable-effect/index.mjs"
236
- },
237
- "require": "./use-abortable-effect/index.cjs",
238
- "default": "./use-abortable-effect/index.js"
239
- },
240
- "./create-fixed-array": {
241
- "types": "./create-fixed-array/index.d.ts",
153
+ "./current-year": {
154
+ "types": "./current-year/index.d.ts",
242
155
  "import": {
243
- "types": "./create-fixed-array/index.d.ts",
244
- "default": "./create-fixed-array/index.mjs"
156
+ "types": "./current-year/index.d.ts",
157
+ "default": "./current-year/index.mjs"
245
158
  },
246
- "require": "./create-fixed-array/index.cjs",
247
- "default": "./create-fixed-array/index.js"
159
+ "require": "./current-year/index.cjs",
160
+ "default": "./current-year/index.js"
248
161
  },
249
162
  "./use": {
250
163
  "types": "./use/index.d.ts",
@@ -255,32 +168,23 @@
255
168
  "require": "./use/index.cjs",
256
169
  "default": "./use/index.js"
257
170
  },
258
- "./invariant": {
259
- "types": "./invariant/index.d.ts",
260
- "import": {
261
- "types": "./invariant/index.d.ts",
262
- "default": "./invariant/index.mjs"
263
- },
264
- "require": "./invariant/index.cjs",
265
- "default": "./invariant/index.js"
266
- },
267
- "./use-uncontrolled": {
268
- "types": "./use-uncontrolled/index.d.ts",
171
+ "./use-map": {
172
+ "types": "./use-map/index.d.ts",
269
173
  "import": {
270
- "types": "./use-uncontrolled/index.d.ts",
271
- "default": "./use-uncontrolled/index.mjs"
174
+ "types": "./use-map/index.d.ts",
175
+ "default": "./use-map/index.mjs"
272
176
  },
273
- "require": "./use-uncontrolled/index.cjs",
274
- "default": "./use-uncontrolled/index.js"
177
+ "require": "./use-map/index.cjs",
178
+ "default": "./use-map/index.js"
275
179
  },
276
- "./no-ssr": {
277
- "types": "./no-ssr/index.d.ts",
180
+ "./use-is-client": {
181
+ "types": "./use-is-client/index.d.ts",
278
182
  "import": {
279
- "types": "./no-ssr/index.d.ts",
280
- "default": "./no-ssr/index.mjs"
183
+ "types": "./use-is-client/index.d.ts",
184
+ "default": "./use-is-client/index.mjs"
281
185
  },
282
- "require": "./no-ssr/index.cjs",
283
- "default": "./no-ssr/index.js"
186
+ "require": "./use-is-client/index.cjs",
187
+ "default": "./use-is-client/index.js"
284
188
  },
285
189
  "./use-debounced-state": {
286
190
  "types": "./use-debounced-state/index.d.ts",
@@ -291,23 +195,50 @@
291
195
  "require": "./use-debounced-state/index.cjs",
292
196
  "default": "./use-debounced-state/index.js"
293
197
  },
294
- "./use-local-storage": {
295
- "types": "./use-local-storage/index.d.ts",
198
+ "./use-media-query": {
199
+ "types": "./use-media-query/index.d.ts",
296
200
  "import": {
297
- "types": "./use-local-storage/index.d.ts",
298
- "default": "./use-local-storage/index.mjs"
201
+ "types": "./use-media-query/index.d.ts",
202
+ "default": "./use-media-query/index.mjs"
299
203
  },
300
- "require": "./use-local-storage/index.cjs",
301
- "default": "./use-local-storage/index.js"
204
+ "require": "./use-media-query/index.cjs",
205
+ "default": "./use-media-query/index.js"
302
206
  },
303
- "./use-isomorphic-layout-effect": {
304
- "types": "./use-isomorphic-layout-effect/index.d.ts",
207
+ "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
208
+ "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
305
209
  "import": {
306
- "types": "./use-isomorphic-layout-effect/index.d.ts",
307
- "default": "./use-isomorphic-layout-effect/index.mjs"
210
+ "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
211
+ "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
308
212
  },
309
- "require": "./use-isomorphic-layout-effect/index.cjs",
310
- "default": "./use-isomorphic-layout-effect/index.js"
213
+ "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
214
+ "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
215
+ },
216
+ "./use-uncontrolled": {
217
+ "types": "./use-uncontrolled/index.d.ts",
218
+ "import": {
219
+ "types": "./use-uncontrolled/index.d.ts",
220
+ "default": "./use-uncontrolled/index.mjs"
221
+ },
222
+ "require": "./use-uncontrolled/index.cjs",
223
+ "default": "./use-uncontrolled/index.js"
224
+ },
225
+ "./use-react-router-is-match": {
226
+ "types": "./use-react-router-is-match/index.d.ts",
227
+ "import": {
228
+ "types": "./use-react-router-is-match/index.d.ts",
229
+ "default": "./use-react-router-is-match/index.mjs"
230
+ },
231
+ "require": "./use-react-router-is-match/index.cjs",
232
+ "default": "./use-react-router-is-match/index.js"
233
+ },
234
+ "./create-fixed-array": {
235
+ "types": "./create-fixed-array/index.d.ts",
236
+ "import": {
237
+ "types": "./create-fixed-array/index.d.ts",
238
+ "default": "./create-fixed-array/index.mjs"
239
+ },
240
+ "require": "./create-fixed-array/index.cjs",
241
+ "default": "./create-fixed-array/index.js"
311
242
  },
312
243
  "./create-storage-hook": {
313
244
  "types": "./create-storage-hook/index.d.ts",
@@ -318,6 +249,15 @@
318
249
  "require": "./create-storage-hook/index.cjs",
319
250
  "default": "./create-storage-hook/index.js"
320
251
  },
252
+ "./use-intersection": {
253
+ "types": "./use-intersection/index.d.ts",
254
+ "import": {
255
+ "types": "./use-intersection/index.d.ts",
256
+ "default": "./use-intersection/index.mjs"
257
+ },
258
+ "require": "./use-intersection/index.cjs",
259
+ "default": "./use-intersection/index.js"
260
+ },
321
261
  "./use-clipboard": {
322
262
  "types": "./use-clipboard/index.d.ts",
323
263
  "import": {
@@ -327,59 +267,113 @@
327
267
  "require": "./use-clipboard/index.cjs",
328
268
  "default": "./use-clipboard/index.js"
329
269
  },
330
- "./noop": {
331
- "types": "./noop/index.d.ts",
270
+ "./compose-context-provider": {
271
+ "types": "./compose-context-provider/index.d.ts",
332
272
  "import": {
333
- "types": "./noop/index.d.ts",
334
- "default": "./noop/index.mjs"
273
+ "types": "./compose-context-provider/index.d.ts",
274
+ "default": "./compose-context-provider/index.mjs"
335
275
  },
336
- "require": "./noop/index.cjs",
337
- "default": "./noop/index.js"
276
+ "require": "./compose-context-provider/index.cjs",
277
+ "default": "./compose-context-provider/index.js"
338
278
  },
339
- "./use-is-client": {
340
- "types": "./use-is-client/index.d.ts",
279
+ "./request-idle-callback": {
280
+ "types": "./request-idle-callback/index.d.ts",
341
281
  "import": {
342
- "types": "./use-is-client/index.d.ts",
343
- "default": "./use-is-client/index.mjs"
282
+ "types": "./request-idle-callback/index.d.ts",
283
+ "default": "./request-idle-callback/index.mjs"
344
284
  },
345
- "require": "./use-is-client/index.cjs",
346
- "default": "./use-is-client/index.js"
285
+ "require": "./request-idle-callback/index.cjs",
286
+ "default": "./request-idle-callback/index.js"
347
287
  },
348
- "./use-next-link": {
349
- "types": "./use-next-link/index.d.ts",
288
+ "./use-isomorphic-layout-effect": {
289
+ "types": "./use-isomorphic-layout-effect/index.d.ts",
350
290
  "import": {
351
- "types": "./use-next-link/index.d.ts",
352
- "default": "./use-next-link/index.mjs"
291
+ "types": "./use-isomorphic-layout-effect/index.d.ts",
292
+ "default": "./use-isomorphic-layout-effect/index.mjs"
353
293
  },
354
- "require": "./use-next-link/index.cjs",
355
- "default": "./use-next-link/index.js"
294
+ "require": "./use-isomorphic-layout-effect/index.cjs",
295
+ "default": "./use-isomorphic-layout-effect/index.js"
356
296
  },
357
- "./use-retimer": {
358
- "types": "./use-retimer/index.d.ts",
297
+ "./use-debounced-value": {
298
+ "types": "./use-debounced-value/index.d.ts",
359
299
  "import": {
360
- "types": "./use-retimer/index.d.ts",
361
- "default": "./use-retimer/index.mjs"
300
+ "types": "./use-debounced-value/index.d.ts",
301
+ "default": "./use-debounced-value/index.mjs"
362
302
  },
363
- "require": "./use-retimer/index.cjs",
364
- "default": "./use-retimer/index.js"
303
+ "require": "./use-debounced-value/index.cjs",
304
+ "default": "./use-debounced-value/index.js"
365
305
  },
366
- "./use-url-hash-state": {
367
- "types": "./use-url-hash-state/index.d.ts",
306
+ "./use-local-storage": {
307
+ "types": "./use-local-storage/index.d.ts",
368
308
  "import": {
369
- "types": "./use-url-hash-state/index.d.ts",
370
- "default": "./use-url-hash-state/index.mjs"
309
+ "types": "./use-local-storage/index.d.ts",
310
+ "default": "./use-local-storage/index.mjs"
371
311
  },
372
- "require": "./use-url-hash-state/index.cjs",
373
- "default": "./use-url-hash-state/index.js"
312
+ "require": "./use-local-storage/index.cjs",
313
+ "default": "./use-local-storage/index.js"
374
314
  },
375
- "./use-map": {
376
- "types": "./use-map/index.d.ts",
315
+ "./use-set": {
316
+ "types": "./use-set/index.d.ts",
377
317
  "import": {
378
- "types": "./use-map/index.d.ts",
379
- "default": "./use-map/index.mjs"
318
+ "types": "./use-set/index.d.ts",
319
+ "default": "./use-set/index.mjs"
380
320
  },
381
- "require": "./use-map/index.cjs",
382
- "default": "./use-map/index.js"
321
+ "require": "./use-set/index.cjs",
322
+ "default": "./use-set/index.js"
323
+ },
324
+ "./rem": {
325
+ "types": "./rem/index.d.ts",
326
+ "import": {
327
+ "types": "./rem/index.d.ts",
328
+ "default": "./rem/index.mjs"
329
+ },
330
+ "require": "./rem/index.cjs",
331
+ "default": "./rem/index.js"
332
+ },
333
+ "./use-array": {
334
+ "types": "./use-array/index.d.ts",
335
+ "import": {
336
+ "types": "./use-array/index.d.ts",
337
+ "default": "./use-array/index.mjs"
338
+ },
339
+ "require": "./use-array/index.cjs",
340
+ "default": "./use-array/index.js"
341
+ },
342
+ "./typescript-happy-forward-ref": {
343
+ "types": "./typescript-happy-forward-ref/index.d.ts",
344
+ "import": {
345
+ "types": "./typescript-happy-forward-ref/index.d.ts",
346
+ "default": "./typescript-happy-forward-ref/index.mjs"
347
+ },
348
+ "require": "./typescript-happy-forward-ref/index.cjs",
349
+ "default": "./typescript-happy-forward-ref/index.js"
350
+ },
351
+ "./use-session-storage": {
352
+ "types": "./use-session-storage/index.d.ts",
353
+ "import": {
354
+ "types": "./use-session-storage/index.d.ts",
355
+ "default": "./use-session-storage/index.mjs"
356
+ },
357
+ "require": "./use-session-storage/index.cjs",
358
+ "default": "./use-session-storage/index.js"
359
+ },
360
+ "./no-ssr": {
361
+ "types": "./no-ssr/index.d.ts",
362
+ "import": {
363
+ "types": "./no-ssr/index.d.ts",
364
+ "default": "./no-ssr/index.mjs"
365
+ },
366
+ "require": "./no-ssr/index.cjs",
367
+ "default": "./no-ssr/index.js"
368
+ },
369
+ "./nullthrow": {
370
+ "types": "./nullthrow/index.d.ts",
371
+ "import": {
372
+ "types": "./nullthrow/index.d.ts",
373
+ "default": "./nullthrow/index.mjs"
374
+ },
375
+ "require": "./nullthrow/index.cjs",
376
+ "default": "./nullthrow/index.js"
383
377
  },
384
378
  "./use-error-boundary": {
385
379
  "types": "./use-error-boundary/index.d.ts",
@@ -390,6 +384,15 @@
390
384
  "require": "./use-error-boundary/index.cjs",
391
385
  "default": "./use-error-boundary/index.js"
392
386
  },
387
+ "./use-react-router-enable-concurrent-navigation": {
388
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
389
+ "import": {
390
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
391
+ "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
392
+ },
393
+ "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
394
+ "default": "./use-react-router-enable-concurrent-navigation/index.js"
395
+ },
393
396
  "./create-context-state": {
394
397
  "types": "./create-context-state/index.d.ts",
395
398
  "import": {
@@ -398,6 +401,15 @@
398
401
  },
399
402
  "require": "./create-context-state/index.cjs",
400
403
  "default": "./create-context-state/index.js"
404
+ },
405
+ "./use-composition-input": {
406
+ "types": "./use-composition-input/index.d.ts",
407
+ "import": {
408
+ "types": "./use-composition-input/index.d.ts",
409
+ "default": "./use-composition-input/index.mjs"
410
+ },
411
+ "require": "./use-composition-input/index.cjs",
412
+ "default": "./use-composition-input/index.js"
401
413
  }
402
414
  }
403
415
  }
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":17545,"gzip":10737,"br":0},"exports":{"compose-context-provider":{"raw":177,"gzip":155,"br":122},"use-array":{"raw":329,"gzip":238,"br":199},"current-year":{"raw":592,"gzip":400,"br":326},"nullthrow":{"raw":194,"gzip":167,"br":128},"use-react-router-enable-concurrent-navigation":{"raw":960,"gzip":470,"br":387},"use-next-pathname":{"raw":321,"gzip":236,"br":199},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":254},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-singleton":{"raw":138,"gzip":129,"br":109},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-debounced-value":{"raw":470,"gzip":309,"br":252},"use-react-router-is-match":{"raw":568,"gzip":371,"br":309},"use-composition-input":{"raw":454,"gzip":281,"br":238},"use-set":{"raw":347,"gzip":240,"br":203},"rem":{"raw":734,"gzip":380,"br":333},"context-state":{"raw":377,"gzip":241,"br":207},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"create-fixed-array":{"raw":100,"gzip":104,"br":89},"use-abortable-effect":{"raw":210,"gzip":166,"br":150},"use":{"raw":276,"gzip":182,"br":150},"invariant":{"raw":178,"gzip":156,"br":118},"use-uncontrolled":{"raw":296,"gzip":227,"br":193},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"no-ssr":{"raw":468,"gzip":318,"br":266},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":113},"use-local-storage":{"raw":310,"gzip":184,"br":157},"noop":{"raw":33,"gzip":53,"br":37},"use-is-client":{"raw":151,"gzip":142,"br":118},"use-clipboard":{"raw":1067,"gzip":611,"br":524},"use-retimer":{"raw":200,"gzip":165,"br":123},"use-map":{"raw":346,"gzip":244,"br":210},"create-storage-hook":{"raw":2090,"gzip":890,"br":773},"create-context-state":{"raw":145,"gzip":116,"br":96},"use-error-boundary":{"raw":244,"gzip":196,"br":159},"use-url-hash-state":{"raw":1069,"gzip":612,"br":534},"use-next-link":{"raw":1588,"gzip":845,"br":728}}}
1
+ {"total":{"raw":18246,"gzip":11139,"br":0},"exports":{"noop":{"raw":33,"gzip":53,"br":37},"use-singleton":{"raw":138,"gzip":129,"br":109},"use-abortable-effect":{"raw":210,"gzip":166,"br":150},"use-next-pathname":{"raw":321,"gzip":236,"br":199},"use-retimer":{"raw":200,"gzip":165,"br":123},"invariant":{"raw":178,"gzip":156,"br":118},"use-url-hash-state":{"raw":1069,"gzip":612,"br":534},"context-state":{"raw":377,"gzip":241,"br":207},"current-year":{"raw":592,"gzip":400,"br":326},"use":{"raw":276,"gzip":182,"br":150},"use-next-link":{"raw":1600,"gzip":851,"br":730},"use-map":{"raw":346,"gzip":244,"br":210},"use-is-client":{"raw":151,"gzip":142,"br":118},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":254},"use-media-query":{"raw":718,"gzip":402,"br":334},"use-uncontrolled":{"raw":296,"gzip":227,"br":193},"create-fixed-array":{"raw":100,"gzip":104,"br":89},"use-react-router-is-match":{"raw":564,"gzip":373,"br":314},"compose-context-provider":{"raw":177,"gzip":155,"br":122},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-clipboard":{"raw":1067,"gzip":611,"br":524},"create-storage-hook":{"raw":2061,"gzip":880,"br":762},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":113},"use-debounced-value":{"raw":470,"gzip":309,"br":252},"use-local-storage":{"raw":310,"gzip":184,"br":157},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"use-set":{"raw":347,"gzip":240,"br":203},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-array":{"raw":329,"gzip":238,"br":199},"use-session-storage":{"raw":316,"gzip":181,"br":152},"rem":{"raw":734,"gzip":380,"br":333},"nullthrow":{"raw":194,"gzip":167,"br":128},"use-error-boundary":{"raw":244,"gzip":196,"br":159},"no-ssr":{"raw":468,"gzip":318,"br":266},"create-context-state":{"raw":145,"gzip":116,"br":96},"use-composition-input":{"raw":458,"gzip":283,"br":241},"use-react-router-enable-concurrent-navigation":{"raw":960,"gzip":470,"br":387}}}
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-singleton/index.cjs");exports.useCompositionInput=t=>{const u=r.useSingleton(()=>({c:!1,e:!1})),c=e.useCallback(e=>{if("value"in e.target){const r=e.target.value;u.current.c?u.current.e=!1:(t(r),u.current.e=!0)}},[t,u]),n=e.useCallback(()=>{u.current.c=!0,u.current.e=!1},[u]),s=e.useCallback(e=>{u.current.c=!1,u.current.e||c(e)},[u,c]);return{onChange:c,onCompositionStart:n,onCompositionEnd:s}};
1
+ "use strict";require("client-only");var e=require("react"),r=require("../use-singleton/index.cjs");const t=()=>({c:!1,e:!1});exports.useCompositionInput=c=>{const n=r.useSingleton(t),u=e.useCallback(e=>{if("value"in e.target){const r=e.target.value;n.current.c?n.current.e=!1:(c(r),n.current.e=!0)}},[c,n]),s=e.useCallback(()=>{n.current.c=!0,n.current.e=!1},[n]),a=e.useCallback(e=>{n.current.c=!1,n.current.e||u(e)},[n,u]);return{onChange:u,onCompositionStart:s,onCompositionEnd:a}};
@@ -1,7 +1,11 @@
1
1
  type UseCompositionInputCallback = (value: string) => void;
2
2
  type UseCompositionInputReturnKey = 'onChange' | 'onCompositionStart' | 'onCompositionEnd';
3
- type UseCompositionInputReturn = Pick<JSX.IntrinsicElements['input'], UseCompositionInputReturnKey>;
3
+ interface UseCompositionInputReturn<T extends HTMLInputElement | HTMLTextAreaElement> {
4
+ onChange: React.ChangeEventHandler<T>;
5
+ onCompositionStart: React.CompositionEventHandler<T>;
6
+ onCompositionEnd: React.CompositionEventHandler<T>;
7
+ }
4
8
  /** @see https://foxact.skk.moe/use-composition-input */
5
- declare const useCompositionInput: (cb: UseCompositionInputCallback) => UseCompositionInputReturn;
9
+ declare const useCompositionInput: <T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(cb: UseCompositionInputCallback) => UseCompositionInputReturn<T>;
6
10
 
7
11
  export { type UseCompositionInputCallback, type UseCompositionInputReturn, type UseCompositionInputReturnKey, useCompositionInput };
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-singleton/index.js");exports.useCompositionInput=t=>{const u=r.useSingleton(()=>({c:!1,e:!1})),n=e.useCallback(e=>{if("value"in e.target){const r=e.target.value;u.current.c?u.current.e=!1:(t(r),u.current.e=!0)}},[t,u]),c=e.useCallback(()=>{u.current.c=!0,u.current.e=!1},[u]),s=e.useCallback(e=>{u.current.c=!1,u.current.e||n(e)},[u,n]);return{onChange:n,onCompositionStart:c,onCompositionEnd:s}};
1
+ "use strict";require("client-only");var e=require("react"),r=require("../use-singleton/index.js");const t=()=>({c:!1,e:!1});exports.useCompositionInput=n=>{const u=r.useSingleton(t),c=e.useCallback(e=>{if("value"in e.target){const r=e.target.value;u.current.c?u.current.e=!1:(n(r),u.current.e=!0)}},[n,u]),s=e.useCallback(()=>{u.current.c=!0,u.current.e=!1},[u]),a=e.useCallback(e=>{u.current.c=!1,u.current.e||c(e)},[u,c]);return{onChange:c,onCompositionStart:s,onCompositionEnd:a}};
@@ -1 +1 @@
1
- import"client-only";import{useCallback as r}from"react";import{useSingleton as e}from"../use-singleton/index.mjs";const t=t=>{const n=e(()=>({c:!1,e:!1})),c=r(r=>{if("value"in r.target){const e=r.target.value;n.current.c?n.current.e=!1:(t(e),n.current.e=!0)}},[t,n]),o=r(()=>{n.current.c=!0,n.current.e=!1},[n]),u=r(r=>{n.current.c=!1,n.current.e||c(r)},[n,c]);return{onChange:c,onCompositionStart:o,onCompositionEnd:u}};export{t as useCompositionInput};
1
+ import"client-only";import{useCallback as r}from"react";import{useSingleton as e}from"../use-singleton/index.mjs";const t=()=>({c:!1,e:!1}),n=n=>{const c=e(t),o=r(r=>{if("value"in r.target){const e=r.target.value;c.current.c?c.current.e=!1:(n(e),c.current.e=!0)}},[n,c]),u=r(()=>{c.current.c=!0,c.current.e=!1},[c]),i=r(r=>{c.current.c=!1,c.current.e||o(r)},[c,o]);return{onChange:o,onCompositionStart:u,onCompositionEnd:i}};export{n as useCompositionInput};
@@ -1,8 +1,8 @@
1
- import { useLayoutEffect as useLayoutEffect$1 } from 'react';
1
+ import { useEffect } from 'react';
2
2
 
3
3
  /** @see https://foxact.skk.moe/use-isomorphic-layout-effect */
4
- declare const useIsomorphicLayoutEffect: typeof useLayoutEffect$1;
4
+ declare const useIsomorphicLayoutEffect: typeof useEffect;
5
5
  /** @see https://foxact.skk.moe/use-isomorphic-layout-effect */
6
- declare const useLayoutEffect: typeof useLayoutEffect$1;
6
+ declare const useLayoutEffect: typeof useEffect;
7
7
 
8
8
  export { useIsomorphicLayoutEffect, useLayoutEffect };
@@ -2,7 +2,10 @@ import * as react from 'react';
2
2
  import { UseStorageRawOption, UseStorageParserOption, Serializer } from '../create-storage-hook/index.js';
3
3
  export { Deserializer } from '../create-storage-hook/index.js';
4
4
 
5
- declare const useLocalStorage: <T>(key: string, serverValue?: (T extends undefined ? never : T) | undefined, options?: UseStorageRawOption | UseStorageParserOption<T>) => readonly [NonNullable<T> | null, react.Dispatch<react.SetStateAction<T | null>>];
5
+ declare const useLocalStorage: {
6
+ <T>(key: string, serverValue: T extends undefined ? never : T, options?: UseStorageRawOption | UseStorageParserOption<T> | undefined): readonly [T, react.Dispatch<react.SetStateAction<T | null>>];
7
+ <T_1>(key: string, serverValue?: undefined, options?: UseStorageRawOption | UseStorageParserOption<T_1> | undefined): readonly [T_1 | null, react.Dispatch<react.SetStateAction<T_1 | null>>];
8
+ };
6
9
  declare const useSetLocalStorage: <T>(key: string, serializer: Serializer<T>) => (v: T | null) => void;
7
10
 
8
11
  export { Serializer, UseStorageParserOption as UseLocalStorageParserOption, UseStorageRawOption as UseLocalStorageRawOption, useLocalStorage, useSetLocalStorage };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var e=require("../no-ssr/index.cjs"),n=require("../noop/index.cjs"),r=require("react");const t=new Map,o=(e,r)=>{if("undefined"==typeof window)return n.noop;const o=window.matchMedia(e),i=()=>{t.set(e,o.matches),r()};return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}},i=()=>{throw e.noSSRError("useMediaQuery cannot be used on the server without a serverValue")};exports.useMediaQuery=(e,n)=>{"undefined"==typeof window||t.has(e)||t.set(e,window.matchMedia(e).matches);const a=r.useCallback(n=>o(e,n),[e]);return r.useSyncExternalStore(a,()=>{var n;return"undefined"!=typeof window&&(null!==(n=t.get(e))&&void 0!==n?n:window.matchMedia(e).matches)},void 0!==n?()=>n:i)};
@@ -0,0 +1,4 @@
1
+ /** @see https://foxact.skk.moe/use-media-query */
2
+ declare const useMediaQuery: (mq: string, serverValue?: boolean | undefined) => boolean;
3
+
4
+ export { useMediaQuery };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var e=require("../no-ssr/index.js"),n=require("../noop/index.js"),r=require("react");const t=new Map,o=(e,r)=>{if("undefined"==typeof window)return n.noop;const o=window.matchMedia(e),i=()=>{t.set(e,o.matches),r()};return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}},i=()=>{throw e.noSSRError("useMediaQuery cannot be used on the server without a serverValue")};exports.useMediaQuery=(e,n)=>{"undefined"==typeof window||t.has(e)||t.set(e,window.matchMedia(e).matches);const a=r.useCallback(n=>o(e,n),[e]);return r.useSyncExternalStore(a,()=>{var n;return"undefined"!=typeof window&&(null!==(n=t.get(e))&&void 0!==n?n:window.matchMedia(e).matches)},void 0!==n?()=>n:i)};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{noSSRError as e}from"../no-ssr/index.mjs";import{noop as n}from"../noop/index.mjs";import{useCallback as t,useSyncExternalStore as o}from"react";const r=new Map,i=(e,t)=>{if("undefined"==typeof window)return n;const o=window.matchMedia(e),i=()=>{r.set(e,o.matches),t()};return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}},d=()=>{throw e("useMediaQuery cannot be used on the server without a serverValue")},a=(e,n)=>("undefined"==typeof window||r.has(e)||r.set(e,window.matchMedia(e).matches),o(t(n=>i(e,n),[e]),()=>{var n;return"undefined"!=typeof window&&(null!==(n=r.get(e))&&void 0!==n?n:window.matchMedia(e).matches)},void 0!==n?()=>n:d));export{a as useMediaQuery};
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("next/navigation"),r=require("next/dist/shared/lib/router/utils/format-url"),n=require("../use-intersection/index.cjs");require("../request-idle-callback/index.cjs");const o=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},s=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})};exports.unstable_useNextLink=(u,i)=>{let{prefetch:c,ref:l,onClick:a,onMouseEnter:f,onTouchStart:p,scroll:d=!0,replace:v=!1,...E}=i;process.env.NODE_ENV;const y=null==c?"auto":"full",N=!1!==c,h=t.useRouter(),[k,b]=e.useTransition(),[g,m,q]=n.useIntersection({rootMargin:"200px"}),x=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[_,C]=e.useState(x);return _!==x&&(C(x),q()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&m&&N&&s(h,x,{kind:y})},[y,m,N,x,h]),[k,{ref:e.useCallback(e=>{g(e),"function"==typeof l?l(e):l&&e&&(l.current=e)},[l,g]),onClick:e.useCallback(e=>{if("function"==typeof a&&a(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&o(e))&&(e.preventDefault(),b(()=>{h[v?"replace":"push"](x,{scroll:d})}))},[a,v,x,h,d]),onMouseEnter:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,f,N,x,h]),onTouchStart:e.useCallback(e=>{"function"==typeof p&&p(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,p,N,x,h]),...E}]};
1
+ "use strict";require("client-only");var e=require("react"),t=require("next/navigation"),r=require("next/dist/shared/lib/router/utils/format-url"),n=require("../use-intersection/index.cjs");require("../request-idle-callback/index.cjs");const o=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},s=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})};exports.unstable_useNextLink=(u,i)=>{let{prefetch:c,ref:l,onClick:a,onMouseEnter:f,onTouchStart:p,scroll:d=!0,replace:v=!1,...E}=i;process.env.NODE_ENV;const y=null==c?"auto":"full",N=!1!==c,h=t.useRouter(),[k,b]=e.useTransition(),[m,g,q]=n.useIntersection(e.useMemo(()=>({rootMargin:"200px"}),[])),x=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[_,C]=e.useState(x);return _!==x&&(C(x),q()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&g&&N&&s(h,x,{kind:y})},[y,g,N,x,h]),[k,{ref:e.useCallback(e=>{m(e),"function"==typeof l?l(e):l&&e&&(l.current=e)},[l,m]),onClick:e.useCallback(e=>{if("function"==typeof a&&a(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&o(e))&&(e.preventDefault(),b(()=>{h[v?"replace":"push"](x,{scroll:d})}))},[a,v,x,h,d]),onMouseEnter:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,f,N,x,h]),onTouchStart:e.useCallback(e=>{"function"==typeof p&&p(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,p,N,x,h]),...E}]};
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("next/navigation"),r=require("next/dist/shared/lib/router/utils/format-url"),n=require("../use-intersection/index.js");require("../request-idle-callback/index.js");const o=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},s=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})};exports.unstable_useNextLink=(u,i)=>{let{prefetch:c,ref:l,onClick:a,onMouseEnter:f,onTouchStart:p,scroll:d=!0,replace:v=!1,...E}=i;process.env.NODE_ENV;const y=null==c?"auto":"full",N=!1!==c,h=t.useRouter(),[k,b]=e.useTransition(),[g,m,q]=n.useIntersection({rootMargin:"200px"}),x=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[_,C]=e.useState(x);return _!==x&&(C(x),q()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&m&&N&&s(h,x,{kind:y})},[y,m,N,x,h]),[k,{ref:e.useCallback(e=>{g(e),"function"==typeof l?l(e):l&&e&&(l.current=e)},[l,g]),onClick:e.useCallback(e=>{if("function"==typeof a&&a(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&o(e))&&(e.preventDefault(),b(()=>{h[v?"replace":"push"](x,{scroll:d})}))},[a,v,x,h,d]),onMouseEnter:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,f,N,x,h]),onTouchStart:e.useCallback(e=>{"function"==typeof p&&p(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,p,N,x,h]),...E}]};
1
+ "use strict";require("client-only");var e=require("react"),t=require("next/navigation"),r=require("next/dist/shared/lib/router/utils/format-url"),n=require("../use-intersection/index.js");require("../request-idle-callback/index.js");const o=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},s=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})};exports.unstable_useNextLink=(u,i)=>{let{prefetch:c,ref:l,onClick:a,onMouseEnter:f,onTouchStart:p,scroll:d=!0,replace:v=!1,...E}=i;process.env.NODE_ENV;const y=null==c?"auto":"full",N=!1!==c,h=t.useRouter(),[k,b]=e.useTransition(),[m,g,q]=n.useIntersection(e.useMemo(()=>({rootMargin:"200px"}),[])),x=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[_,C]=e.useState(x);return _!==x&&(C(x),q()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&g&&N&&s(h,x,{kind:y})},[y,g,N,x,h]),[k,{ref:e.useCallback(e=>{m(e),"function"==typeof l?l(e):l&&e&&(l.current=e)},[l,m]),onClick:e.useCallback(e=>{if("function"==typeof a&&a(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&o(e))&&(e.preventDefault(),b(()=>{h[v?"replace":"push"](x,{scroll:d})}))},[a,v,x,h,d]),onMouseEnter:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,f,N,x,h]),onTouchStart:e.useCallback(e=>{"function"==typeof p&&p(e),"development"!==process.env.NODE_ENV&&N&&s(h,x,{kind:y})},[y,p,N,x,h]),...E}]};
@@ -1 +1 @@
1
- import"client-only";import{useTransition as e,useMemo as t,useState as r,useEffect as n,useCallback as o}from"react";import{useRouter as i}from"next/navigation";import{formatUrl as c}from"next/dist/shared/lib/router/utils/format-url";import{useIntersection as s}from"../use-intersection/index.mjs";import"../request-idle-callback/index.mjs";const p=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},l=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})},u=(u,f)=>{let{prefetch:a,ref:d,onClick:m,onMouseEnter:v,onTouchStart:E,scroll:y=!0,replace:N=!1,...h}=f;process.env.NODE_ENV;const g=null==a?"auto":"full",x=!1!==a,_=i(),[k,D]=e(),[w,O,V]=s({rootMargin:"200px"}),b=t(()=>"string"==typeof u?u:c(u),[u]),[K,T]=r(b);return K!==b&&(T(b),V()),n(()=>{"production"===process.env.NODE_ENV&&O&&x&&l(_,b,{kind:g})},[g,O,x,b,_]),[k,{ref:o(e=>{w(e),"function"==typeof d?d(e):d&&e&&(d.current=e)},[d,w]),onClick:o(e=>{if("function"==typeof m&&m(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&p(e))&&(e.preventDefault(),D(()=>{_[N?"replace":"push"](b,{scroll:y})}))},[m,N,b,_,y]),onMouseEnter:o(e=>{"function"==typeof v&&v(e),"development"!==process.env.NODE_ENV&&x&&l(_,b,{kind:g})},[g,v,x,b,_]),onTouchStart:o(e=>{"function"==typeof E&&E(e),"development"!==process.env.NODE_ENV&&x&&l(_,b,{kind:g})},[g,E,x,b,_]),...h}]};export{u as unstable_useNextLink};
1
+ import"client-only";import{useTransition as e,useMemo as t,useState as r,useEffect as n,useCallback as o}from"react";import{useRouter as i}from"next/navigation";import{formatUrl as c}from"next/dist/shared/lib/router/utils/format-url";import{useIntersection as s}from"../use-intersection/index.mjs";import"../request-idle-callback/index.mjs";const p=e=>{const t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which},l=(e,t,r)=>{"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})},u=(u,f)=>{let{prefetch:a,ref:d,onClick:m,onMouseEnter:v,onTouchStart:E,scroll:y=!0,replace:N=!1,...h}=f;process.env.NODE_ENV;const g=null==a?"auto":"full",x=!1!==a,_=i(),[k,D]=e(),[w,O,V]=s(t(()=>({rootMargin:"200px"}),[])),b=t(()=>"string"==typeof u?u:c(u),[u]),[K,T]=r(b);return K!==b&&(T(b),V()),n(()=>{"production"===process.env.NODE_ENV&&O&&x&&l(_,b,{kind:g})},[g,O,x,b,_]),[k,{ref:o(e=>{w(e),"function"==typeof d?d(e):d&&e&&(d.current=e)},[d,w]),onClick:o(e=>{if("function"==typeof m&&m(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&p(e))&&(e.preventDefault(),D(()=>{_[N?"replace":"push"](b,{scroll:y})}))},[m,N,b,_,y]),onMouseEnter:o(e=>{"function"==typeof v&&v(e),"development"!==process.env.NODE_ENV&&x&&l(_,b,{kind:g})},[g,v,x,b,_]),onTouchStart:o(e=>{"function"==typeof E&&E(e),"development"!==process.env.NODE_ENV&&x&&l(_,b,{kind:g})},[g,E,x,b,_]),...h}]};export{u as unstable_useNextLink};
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("react-router-dom");exports.useReactRouterIsMatch=function(r){let{relative:a,caseSensitive:o=!1,end:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:s}=t.useLocation(),{navigator:{encodeLocation:u}}=e.useContext(t.UNSAFE_NavigationContext),i=t.useResolvedPath(r,{relative:a});return e.useMemo(()=>{let e=s,t=u?u(i).pathname:i.pathname;return o||(e=e.toLowerCase(),t=t.toLowerCase()),e===t||!n&&e.startsWith(t)&&"/"===e.charAt(t.length)},[u,i,s,o,n])};
1
+ "use strict";require("client-only");var e=require("react"),t=require("react-router-dom");const r=e=>e;exports.useReactRouterIsMatch=function(o){let{relative:a,caseSensitive:n=!1,end:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:u}=t.useLocation(),{navigator:{encodeLocation:i=r}}=e.useContext(t.UNSAFE_NavigationContext),c=t.useResolvedPath(o,{relative:a});return e.useMemo(()=>{let e=u,t=i(c).pathname;return n||(e=e.toLowerCase(),t=t.toLowerCase()),e===t||!s&&e.startsWith(t)&&"/"===e.charAt(t.length)},[i,c,u,n,s])};
@@ -1,4 +1,4 @@
1
- import { To, RelativeRoutingType } from 'react-router-dom';
1
+ import { RelativeRoutingType } from 'react-router-dom';
2
2
 
3
3
  interface UseReactRouterIsMatchOption {
4
4
  relative?: RelativeRoutingType;
@@ -6,6 +6,6 @@ interface UseReactRouterIsMatchOption {
6
6
  end?: boolean;
7
7
  }
8
8
  /** @see https://foxact.skk.moe/use-react-router-is-match */
9
- declare const useReactRouterIsMatch: (to: To, { relative, caseSensitive, end }?: UseReactRouterIsMatchOption) => boolean;
9
+ declare const useReactRouterIsMatch: (to: To, { relative, caseSensitive, end }?: UseReactRouterIsMatchOption) => any;
10
10
 
11
11
  export { useReactRouterIsMatch };
@@ -1 +1 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("react-router-dom");exports.useReactRouterIsMatch=function(r){let{relative:a,caseSensitive:o=!1,end:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:s}=t.useLocation(),{navigator:{encodeLocation:u}}=e.useContext(t.UNSAFE_NavigationContext),i=t.useResolvedPath(r,{relative:a});return e.useMemo(()=>{let e=s,t=u?u(i).pathname:i.pathname;return o||(e=e.toLowerCase(),t=t.toLowerCase()),e===t||!n&&e.startsWith(t)&&"/"===e.charAt(t.length)},[u,i,s,o,n])};
1
+ "use strict";require("client-only");var e=require("react"),t=require("react-router-dom");const r=e=>e;exports.useReactRouterIsMatch=function(o){let{relative:a,caseSensitive:n=!1,end:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:u}=t.useLocation(),{navigator:{encodeLocation:i=r}}=e.useContext(t.UNSAFE_NavigationContext),c=t.useResolvedPath(o,{relative:a});return e.useMemo(()=>{let e=u,t=i(c).pathname;return n||(e=e.toLowerCase(),t=t.toLowerCase()),e===t||!s&&e.startsWith(t)&&"/"===e.charAt(t.length)},[i,c,u,n,s])};
@@ -1 +1 @@
1
- import"client-only";import{useContext as t,useMemo as e}from"react";import{useLocation as r,UNSAFE_NavigationContext as o,useResolvedPath as a}from"react-router-dom";const n=function(n){let{relative:c,caseSensitive:m=!1,end:h=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:i}=r(),{navigator:{encodeLocation:s}}=t(o),p=a(n,{relative:c});return e(()=>{let t=i,e=s?s(p).pathname:p.pathname;return m||(t=t.toLowerCase(),e=e.toLowerCase()),t===e||!h&&t.startsWith(e)&&"/"===t.charAt(e.length)},[s,p,i,m,h])};export{n as useReactRouterIsMatch};
1
+ import"client-only";import{useContext as t,useMemo as e}from"react";import{useLocation as r,UNSAFE_NavigationContext as o,useResolvedPath as a}from"react-router-dom";const n=t=>t,c=function(c){let{relative:i,caseSensitive:m=!1,end:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pathname:h}=r(),{navigator:{encodeLocation:l=n}}=t(o),p=a(c,{relative:i});return e(()=>{let t=h,e=l(p).pathname;return m||(t=t.toLowerCase(),e=e.toLowerCase()),t===e||!s&&t.startsWith(e)&&"/"===t.charAt(e.length)},[l,p,h,m,s])};export{c as useReactRouterIsMatch};
@@ -2,7 +2,10 @@ import * as react from 'react';
2
2
  import { UseStorageRawOption, UseStorageParserOption, Serializer } from '../create-storage-hook/index.js';
3
3
  export { Deserializer } from '../create-storage-hook/index.js';
4
4
 
5
- declare const useSessionStorage: <T>(key: string, serverValue?: (T extends undefined ? never : T) | undefined, options?: UseStorageRawOption | UseStorageParserOption<T>) => readonly [NonNullable<T> | null, react.Dispatch<react.SetStateAction<T | null>>];
5
+ declare const useSessionStorage: {
6
+ <T>(key: string, serverValue: T extends undefined ? never : T, options?: UseStorageRawOption | UseStorageParserOption<T> | undefined): readonly [T, react.Dispatch<react.SetStateAction<T | null>>];
7
+ <T_1>(key: string, serverValue?: undefined, options?: UseStorageRawOption | UseStorageParserOption<T_1> | undefined): readonly [T_1 | null, react.Dispatch<react.SetStateAction<T_1 | null>>];
8
+ };
6
9
  declare const useSetSessionStorage: <T>(key: string, serializer: Serializer<T>) => (v: T | null) => void;
7
10
 
8
11
  export { Serializer, UseStorageParserOption as UseSessionStorageParserOption, UseStorageRawOption as UseSessionStorageRawOption, useSessionStorage, useSetSessionStorage };