foxact 0.2.44 → 0.2.45
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/compose-context-provider/index.d.ts +5 -2
- package/context-state/index.cjs +1 -1
- package/context-state/index.d.ts +3 -1
- package/context-state/index.mjs +1 -1
- package/create-storage-hook/index.d.ts +2 -1
- package/create-storage-state-factory/index.d.ts +13 -2
- package/current-year/index.cjs +1 -1
- package/current-year/index.d.ts +3 -1
- package/current-year/index.mjs +1 -1
- package/is-safari/index.cjs +1 -0
- package/is-safari/index.d.ts +3 -0
- package/is-safari/index.mjs +1 -0
- package/noop/index.d.ts +2 -1
- package/open-new-tab/index.cjs +1 -0
- package/open-new-tab/index.d.ts +3 -0
- package/open-new-tab/index.mjs +1 -0
- package/package.json +92 -71
- package/sizes.json +1 -1
- package/typescript-happy-forward-ref/index.d.ts +2 -1
- package/use-abortable-effect/index.d.ts +5 -1
- package/use-composition-input/index.d.ts +2 -1
- package/use-error-boundary/index.cjs +1 -1
- package/use-error-boundary/index.mjs +1 -1
- package/use-fast-click/index.d.ts +2 -1
- package/use-local-storage/index.d.ts +9 -3
- package/use-next-link/index.d.ts +5 -2
- package/use-react-router-enable-concurrent-navigation/index.d.ts +3 -1
- package/use-react-router-is-match/index.d.ts +5 -1
- package/use-session-storage/index.d.ts +9 -3
- package/use-singleton/index.d.ts +2 -1
- package/use-uncontrolled/index.d.ts +1 -1
- package/use-url-hash-state/index.d.ts +2 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { Foxact } from '../types/index.js';
|
|
2
|
+
import type { Foxact } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
interface ContextComposeProviderProps extends Foxact.PropsWithChildren {
|
|
5
7
|
contexts: React.ReactElement[];
|
|
@@ -7,4 +9,5 @@ interface ContextComposeProviderProps extends Foxact.PropsWithChildren {
|
|
|
7
9
|
/** @see https://foxact.skk.moe/compose-context-provider */
|
|
8
10
|
declare const ComposeContextProvider: react.MemoExoticComponent<({ contexts, children }: ContextComposeProviderProps) => react.ReactNode>;
|
|
9
11
|
|
|
10
|
-
export { ComposeContextProvider
|
|
12
|
+
export { ComposeContextProvider };
|
|
13
|
+
export type { ContextComposeProviderProps };
|
package/context-state/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime");require("client-only");var t=require("react"),r=require("../noop/index.cjs");exports.createContextState=function(n){const o
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("client-only");var t=require("react"),r=require("../noop/index.cjs");exports.createContextState=function(n){const o=t.createContext(n),u=t.createContext(r.noop);return[r=>{let{children:c}=r;const[i,s]=t.useState(n);return e.jsx(o.Provider,{value:i,children:e.jsx(u.Provider,{value:s,children:c})})},()=>t.useContext(o),()=>t.useContext(u),o]};
|
package/context-state/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { Foxact } from '../types/index.js';
|
|
3
|
+
import type { Foxact } from '../types/index.js';
|
|
4
|
+
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
/** @see https://foxact.skk.moe/context-state */
|
|
6
8
|
declare function createContextState<T>(initialState: T): readonly [({ children }: Foxact.PropsWithChildren) => react_jsx_runtime.JSX.Element, () => T, () => react.Dispatch<react.SetStateAction<T>>, react.Context<T>];
|
package/context-state/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import"client-only";import{
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import"client-only";import{useContext as t,createContext as e,useState as o}from"react";import{noop as n}from"../noop/index.mjs";function i(i){const c=e(i),m=e(n);return[t=>{let{children:e}=t;const[n,l]=o(i);return r(c.Provider,{value:n,children:r(m.Provider,{value:l,children:e})})},()=>t(c),()=>t(m),c]}export{i as createContextState};
|
|
@@ -26,4 +26,5 @@ declare function createStorage(type: StorageType): {
|
|
|
26
26
|
useSetStorage: <T>(key: string, serializer: Serializer<T>) => (v: T | null) => void;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { createStorage };
|
|
30
|
+
export type { Deserializer, NotUndefined, Serializer, StateHookTuple, StorageType, UseStorageParserOption, UseStorageRawOption };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { StateHookTuple, StorageType,
|
|
1
|
+
import type { NotUndefined, StateHookTuple, StorageType, UseStorageParserOption, UseStorageRawOption } from '../create-storage-hook/index.js';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
2
12
|
|
|
3
13
|
type ValueHook<T> = () => T;
|
|
4
14
|
type SetValueHook<T> = () => (value: T) => void;
|
|
@@ -8,4 +18,5 @@ declare function createStorageStateFactory(type: StorageType): {
|
|
|
8
18
|
<T>(key: string, serverValue?: undefined, options?: UseStorageRawOption | UseStorageParserOption<T>): readonly [StateHook<T | null>, ValueHook<T | null>, SetValueHook<T | null>];
|
|
9
19
|
};
|
|
10
20
|
|
|
11
|
-
export {
|
|
21
|
+
export { createStorageStateFactory };
|
|
22
|
+
export type { SetValueHook, StateHook, ValueHook };
|
package/current-year/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../use-isomorphic-layout-effect/index.cjs");require("client-only");const n
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../use-isomorphic-layout-effect/index.cjs");require("client-only");const n=r.memo(n=>{let{defaultYear:i,...u}=n;"undefined"==typeof window&&void 0===i&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[s,a]=r.useState(i||new Date().getFullYear());return t.useIsomorphicLayoutEffect(()=>{a(new Date().getFullYear())},[]),e.jsx("span",{...u,children:s})});"production"!==process.env.NODE_ENV&&(n.displayName="CurrentYear"),exports.CurrentYear=n;
|
package/current-year/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { Foxact } from '../types/index.js';
|
|
3
|
+
import type { Foxact } from '../types/index.js';
|
|
4
|
+
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
interface CurrentYearProps extends Foxact.ComponentProps<'span'> {
|
|
6
8
|
defaultYear?: number;
|
package/current-year/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{memo as r,useState as t}from"react";import{useIsomorphicLayoutEffect as n}from"../use-isomorphic-layout-effect/index.mjs";import"client-only";const o
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{memo as r,useState as t}from"react";import{useIsomorphicLayoutEffect as n}from"../use-isomorphic-layout-effect/index.mjs";import"client-only";const o=r(r=>{let{defaultYear:o,...i}=r;"undefined"==typeof window&&void 0===o&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[a,s]=t(o||new Date().getFullYear());return n(()=>{s(new Date().getFullYear())},[]),e("span",{...i,children:a})});"production"!==process.env.NODE_ENV&&(o.displayName="CurrentYear");export{o as CurrentYear};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.isSafari=function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&!!(/version\/[\d._].*?safari/i.test(navigator.userAgent)||/mobile safari [\d._]+/i.test(navigator.userAgent))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return"undefined"!=typeof window&&"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&!!(/version\/[\d._].*?safari/i.test(navigator.userAgent)||/mobile safari [\d._]+/i.test(navigator.userAgent))}export{e as isSafari};
|
package/noop/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../is-safari/index.cjs");exports.openInNewTab=function(n){if("undefined"==typeof window)return;if(e.isSafari()){window.open(n,"_blank");return}const r=document.createElement("a");r.href=n,r.target="_blank",r.rel="noopener noreferrer",document.body.appendChild(r),r.click(),Promise.resolve().finally(()=>{r.remove()})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSafari as e}from"../is-safari/index.mjs";function n(n){if("undefined"==typeof window)return;if(e()){window.open(n,"_blank");return}const r=document.createElement("a");r.href=n,r.target="_blank",r.rel="noopener noreferrer",document.body.appendChild(r),r.click(),Promise.resolve().finally(()=>{r.remove()})}export{n as openInNewTab};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxact",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.45",
|
|
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,7 +32,7 @@
|
|
|
32
32
|
"optional": true
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"packageManager": "pnpm@
|
|
35
|
+
"packageManager": "pnpm@10.6.4",
|
|
36
36
|
"pnpm": {
|
|
37
37
|
"overrides": {
|
|
38
38
|
"array-includes": "npm:@nolyfill/array-includes@latest",
|
|
@@ -50,9 +50,12 @@
|
|
|
50
50
|
"object.groupby": "npm:@nolyfill/object.groupby@latest",
|
|
51
51
|
"object.hasown": "npm:@nolyfill/object.hasown@latest",
|
|
52
52
|
"object.values": "npm:@nolyfill/object.values@latest",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
}
|
|
53
|
+
"rollup": "$rollup",
|
|
54
|
+
"string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@latest"
|
|
55
|
+
},
|
|
56
|
+
"onlyBuiltDependencies": [
|
|
57
|
+
"@swc/core"
|
|
58
|
+
]
|
|
56
59
|
},
|
|
57
60
|
"typeVersions": {
|
|
58
61
|
">=4.8": {
|
|
@@ -105,24 +108,6 @@
|
|
|
105
108
|
"require": "./create-fixed-array/index.cjs",
|
|
106
109
|
"default": "./create-fixed-array/index.cjs"
|
|
107
110
|
},
|
|
108
|
-
"./create-session-storage-state": {
|
|
109
|
-
"types": "./create-session-storage-state/index.d.ts",
|
|
110
|
-
"import": {
|
|
111
|
-
"types": "./create-session-storage-state/index.d.ts",
|
|
112
|
-
"default": "./create-session-storage-state/index.mjs"
|
|
113
|
-
},
|
|
114
|
-
"require": "./create-session-storage-state/index.cjs",
|
|
115
|
-
"default": "./create-session-storage-state/index.cjs"
|
|
116
|
-
},
|
|
117
|
-
"./create-storage-hook": {
|
|
118
|
-
"types": "./create-storage-hook/index.d.ts",
|
|
119
|
-
"import": {
|
|
120
|
-
"types": "./create-storage-hook/index.d.ts",
|
|
121
|
-
"default": "./create-storage-hook/index.mjs"
|
|
122
|
-
},
|
|
123
|
-
"require": "./create-storage-hook/index.cjs",
|
|
124
|
-
"default": "./create-storage-hook/index.cjs"
|
|
125
|
-
},
|
|
126
111
|
"./create-local-storage-state": {
|
|
127
112
|
"types": "./create-local-storage-state/index.d.ts",
|
|
128
113
|
"import": {
|
|
@@ -132,6 +117,15 @@
|
|
|
132
117
|
"require": "./create-local-storage-state/index.cjs",
|
|
133
118
|
"default": "./create-local-storage-state/index.cjs"
|
|
134
119
|
},
|
|
120
|
+
"./create-session-storage-state": {
|
|
121
|
+
"types": "./create-session-storage-state/index.d.ts",
|
|
122
|
+
"import": {
|
|
123
|
+
"types": "./create-session-storage-state/index.d.ts",
|
|
124
|
+
"default": "./create-session-storage-state/index.mjs"
|
|
125
|
+
},
|
|
126
|
+
"require": "./create-session-storage-state/index.cjs",
|
|
127
|
+
"default": "./create-session-storage-state/index.cjs"
|
|
128
|
+
},
|
|
135
129
|
"./create-storage-state-factory": {
|
|
136
130
|
"types": "./create-storage-state-factory/index.d.ts",
|
|
137
131
|
"import": {
|
|
@@ -141,6 +135,15 @@
|
|
|
141
135
|
"require": "./create-storage-state-factory/index.cjs",
|
|
142
136
|
"default": "./create-storage-state-factory/index.cjs"
|
|
143
137
|
},
|
|
138
|
+
"./create-storage-hook": {
|
|
139
|
+
"types": "./create-storage-hook/index.d.ts",
|
|
140
|
+
"import": {
|
|
141
|
+
"types": "./create-storage-hook/index.d.ts",
|
|
142
|
+
"default": "./create-storage-hook/index.mjs"
|
|
143
|
+
},
|
|
144
|
+
"require": "./create-storage-hook/index.cjs",
|
|
145
|
+
"default": "./create-storage-hook/index.cjs"
|
|
146
|
+
},
|
|
144
147
|
"./current-year": {
|
|
145
148
|
"types": "./current-year/index.d.ts",
|
|
146
149
|
"import": {
|
|
@@ -159,14 +162,23 @@
|
|
|
159
162
|
"require": "./email-protection/index.cjs",
|
|
160
163
|
"default": "./email-protection/index.cjs"
|
|
161
164
|
},
|
|
162
|
-
"./
|
|
163
|
-
"types": "./
|
|
165
|
+
"./fetch-jsonp": {
|
|
166
|
+
"types": "./fetch-jsonp/index.d.ts",
|
|
164
167
|
"import": {
|
|
165
|
-
"types": "./
|
|
166
|
-
"default": "./
|
|
168
|
+
"types": "./fetch-jsonp/index.d.ts",
|
|
169
|
+
"default": "./fetch-jsonp/index.mjs"
|
|
167
170
|
},
|
|
168
|
-
"require": "./
|
|
169
|
-
"default": "./
|
|
171
|
+
"require": "./fetch-jsonp/index.cjs",
|
|
172
|
+
"default": "./fetch-jsonp/index.cjs"
|
|
173
|
+
},
|
|
174
|
+
"./is-safari": {
|
|
175
|
+
"types": "./is-safari/index.d.ts",
|
|
176
|
+
"import": {
|
|
177
|
+
"types": "./is-safari/index.d.ts",
|
|
178
|
+
"default": "./is-safari/index.mjs"
|
|
179
|
+
},
|
|
180
|
+
"require": "./is-safari/index.cjs",
|
|
181
|
+
"default": "./is-safari/index.cjs"
|
|
170
182
|
},
|
|
171
183
|
"./no-ssr": {
|
|
172
184
|
"types": "./no-ssr/index.d.ts",
|
|
@@ -177,6 +189,15 @@
|
|
|
177
189
|
"require": "./no-ssr/index.cjs",
|
|
178
190
|
"default": "./no-ssr/index.cjs"
|
|
179
191
|
},
|
|
192
|
+
"./invariant": {
|
|
193
|
+
"types": "./invariant/index.d.ts",
|
|
194
|
+
"import": {
|
|
195
|
+
"types": "./invariant/index.d.ts",
|
|
196
|
+
"default": "./invariant/index.mjs"
|
|
197
|
+
},
|
|
198
|
+
"require": "./invariant/index.cjs",
|
|
199
|
+
"default": "./invariant/index.cjs"
|
|
200
|
+
},
|
|
180
201
|
"./noop": {
|
|
181
202
|
"types": "./noop/index.d.ts",
|
|
182
203
|
"import": {
|
|
@@ -195,14 +216,14 @@
|
|
|
195
216
|
"require": "./nullthrow/index.cjs",
|
|
196
217
|
"default": "./nullthrow/index.cjs"
|
|
197
218
|
},
|
|
198
|
-
"./
|
|
199
|
-
"types": "./
|
|
219
|
+
"./open-new-tab": {
|
|
220
|
+
"types": "./open-new-tab/index.d.ts",
|
|
200
221
|
"import": {
|
|
201
|
-
"types": "./
|
|
202
|
-
"default": "./
|
|
222
|
+
"types": "./open-new-tab/index.d.ts",
|
|
223
|
+
"default": "./open-new-tab/index.mjs"
|
|
203
224
|
},
|
|
204
|
-
"require": "./
|
|
205
|
-
"default": "./
|
|
225
|
+
"require": "./open-new-tab/index.cjs",
|
|
226
|
+
"default": "./open-new-tab/index.cjs"
|
|
206
227
|
},
|
|
207
228
|
"./rem": {
|
|
208
229
|
"types": "./rem/index.d.ts",
|
|
@@ -267,15 +288,6 @@
|
|
|
267
288
|
"require": "./use-array/index.cjs",
|
|
268
289
|
"default": "./use-array/index.cjs"
|
|
269
290
|
},
|
|
270
|
-
"./use-clipboard": {
|
|
271
|
-
"types": "./use-clipboard/index.d.ts",
|
|
272
|
-
"import": {
|
|
273
|
-
"types": "./use-clipboard/index.d.ts",
|
|
274
|
-
"default": "./use-clipboard/index.mjs"
|
|
275
|
-
},
|
|
276
|
-
"require": "./use-clipboard/index.cjs",
|
|
277
|
-
"default": "./use-clipboard/index.cjs"
|
|
278
|
-
},
|
|
279
291
|
"./use-component-will-receive-update": {
|
|
280
292
|
"types": "./use-component-will-receive-update/index.d.ts",
|
|
281
293
|
"import": {
|
|
@@ -285,6 +297,15 @@
|
|
|
285
297
|
"require": "./use-component-will-receive-update/index.cjs",
|
|
286
298
|
"default": "./use-component-will-receive-update/index.cjs"
|
|
287
299
|
},
|
|
300
|
+
"./use-clipboard": {
|
|
301
|
+
"types": "./use-clipboard/index.d.ts",
|
|
302
|
+
"import": {
|
|
303
|
+
"types": "./use-clipboard/index.d.ts",
|
|
304
|
+
"default": "./use-clipboard/index.mjs"
|
|
305
|
+
},
|
|
306
|
+
"require": "./use-clipboard/index.cjs",
|
|
307
|
+
"default": "./use-clipboard/index.cjs"
|
|
308
|
+
},
|
|
288
309
|
"./use-composition-input": {
|
|
289
310
|
"types": "./use-composition-input/index.d.ts",
|
|
290
311
|
"import": {
|
|
@@ -294,6 +315,15 @@
|
|
|
294
315
|
"require": "./use-composition-input/index.cjs",
|
|
295
316
|
"default": "./use-composition-input/index.cjs"
|
|
296
317
|
},
|
|
318
|
+
"./use-debounced-state": {
|
|
319
|
+
"types": "./use-debounced-state/index.d.ts",
|
|
320
|
+
"import": {
|
|
321
|
+
"types": "./use-debounced-state/index.d.ts",
|
|
322
|
+
"default": "./use-debounced-state/index.mjs"
|
|
323
|
+
},
|
|
324
|
+
"require": "./use-debounced-state/index.cjs",
|
|
325
|
+
"default": "./use-debounced-state/index.cjs"
|
|
326
|
+
},
|
|
297
327
|
"./use-debounced-value": {
|
|
298
328
|
"types": "./use-debounced-value/index.d.ts",
|
|
299
329
|
"import": {
|
|
@@ -321,15 +351,6 @@
|
|
|
321
351
|
"require": "./use-fast-click/index.cjs",
|
|
322
352
|
"default": "./use-fast-click/index.cjs"
|
|
323
353
|
},
|
|
324
|
-
"./use-debounced-state": {
|
|
325
|
-
"types": "./use-debounced-state/index.d.ts",
|
|
326
|
-
"import": {
|
|
327
|
-
"types": "./use-debounced-state/index.d.ts",
|
|
328
|
-
"default": "./use-debounced-state/index.mjs"
|
|
329
|
-
},
|
|
330
|
-
"require": "./use-debounced-state/index.cjs",
|
|
331
|
-
"default": "./use-debounced-state/index.cjs"
|
|
332
|
-
},
|
|
333
354
|
"./use-intersection": {
|
|
334
355
|
"types": "./use-intersection/index.d.ts",
|
|
335
356
|
"import": {
|
|
@@ -375,15 +396,6 @@
|
|
|
375
396
|
"require": "./use-local-storage/index.cjs",
|
|
376
397
|
"default": "./use-local-storage/index.cjs"
|
|
377
398
|
},
|
|
378
|
-
"./use-media-query": {
|
|
379
|
-
"types": "./use-media-query/index.d.ts",
|
|
380
|
-
"import": {
|
|
381
|
-
"types": "./use-media-query/index.d.ts",
|
|
382
|
-
"default": "./use-media-query/index.mjs"
|
|
383
|
-
},
|
|
384
|
-
"require": "./use-media-query/index.cjs",
|
|
385
|
-
"default": "./use-media-query/index.cjs"
|
|
386
|
-
},
|
|
387
399
|
"./use-map": {
|
|
388
400
|
"types": "./use-map/index.d.ts",
|
|
389
401
|
"import": {
|
|
@@ -393,6 +405,15 @@
|
|
|
393
405
|
"require": "./use-map/index.cjs",
|
|
394
406
|
"default": "./use-map/index.cjs"
|
|
395
407
|
},
|
|
408
|
+
"./use-media-query": {
|
|
409
|
+
"types": "./use-media-query/index.d.ts",
|
|
410
|
+
"import": {
|
|
411
|
+
"types": "./use-media-query/index.d.ts",
|
|
412
|
+
"default": "./use-media-query/index.mjs"
|
|
413
|
+
},
|
|
414
|
+
"require": "./use-media-query/index.cjs",
|
|
415
|
+
"default": "./use-media-query/index.cjs"
|
|
416
|
+
},
|
|
396
417
|
"./use-next-link": {
|
|
397
418
|
"types": "./use-next-link/index.d.ts",
|
|
398
419
|
"import": {
|
|
@@ -447,15 +468,6 @@
|
|
|
447
468
|
"require": "./use-retimer/index.cjs",
|
|
448
469
|
"default": "./use-retimer/index.cjs"
|
|
449
470
|
},
|
|
450
|
-
"./use-session-storage": {
|
|
451
|
-
"types": "./use-session-storage/index.d.ts",
|
|
452
|
-
"import": {
|
|
453
|
-
"types": "./use-session-storage/index.d.ts",
|
|
454
|
-
"default": "./use-session-storage/index.mjs"
|
|
455
|
-
},
|
|
456
|
-
"require": "./use-session-storage/index.cjs",
|
|
457
|
-
"default": "./use-session-storage/index.cjs"
|
|
458
|
-
},
|
|
459
471
|
"./use-set": {
|
|
460
472
|
"types": "./use-set/index.d.ts",
|
|
461
473
|
"import": {
|
|
@@ -465,6 +477,15 @@
|
|
|
465
477
|
"require": "./use-set/index.cjs",
|
|
466
478
|
"default": "./use-set/index.cjs"
|
|
467
479
|
},
|
|
480
|
+
"./use-session-storage": {
|
|
481
|
+
"types": "./use-session-storage/index.d.ts",
|
|
482
|
+
"import": {
|
|
483
|
+
"types": "./use-session-storage/index.d.ts",
|
|
484
|
+
"default": "./use-session-storage/index.mjs"
|
|
485
|
+
},
|
|
486
|
+
"require": "./use-session-storage/index.cjs",
|
|
487
|
+
"default": "./use-session-storage/index.cjs"
|
|
488
|
+
},
|
|
468
489
|
"./use-singleton": {
|
|
469
490
|
"types": "./use-singleton/index.d.ts",
|
|
470
491
|
"import": {
|
package/sizes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"total":{"raw":
|
|
1
|
+
{"total":{"raw":23617,"gzip":14516,"br":0},"exports":{"compose-context-provider":{"raw":177,"gzip":155,"br":122},"create-context-state":{"raw":145,"gzip":116,"br":96},"context-state":{"raw":377,"gzip":241,"br":207},"create-local-storage-state":{"raw":328,"gzip":183,"br":154},"create-session-storage-state":{"raw":332,"gzip":182,"br":152},"create-fixed-array":{"raw":452,"gzip":282,"br":248},"create-storage-state-factory":{"raw":519,"gzip":309,"br":263},"current-year":{"raw":592,"gzip":400,"br":326},"email-protection":{"raw":426,"gzip":321,"br":272},"is-safari":{"raw":248,"gzip":164,"br":117},"fetch-jsonp":{"raw":875,"gzip":533,"br":418},"no-ssr":{"raw":474,"gzip":316,"br":260},"noop":{"raw":33,"gzip":53,"br":37},"create-storage-hook":{"raw":2073,"gzip":880,"br":764},"invariant":{"raw":178,"gzip":156,"br":118},"nullthrow":{"raw":187,"gzip":163,"br":121},"types":{"raw":0,"gzip":20,"br":1},"open-new-tab":{"raw":340,"gzip":258,"br":188},"use":{"raw":276,"gzip":182,"br":150},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"rem":{"raw":823,"gzip":395,"br":350},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"use-abortable-effect":{"raw":215,"gzip":170,"br":144},"use-array":{"raw":322,"gzip":236,"br":202},"use-component-will-receive-update":{"raw":216,"gzip":188,"br":154},"use-composition-input":{"raw":470,"gzip":286,"br":241},"use-error-boundary":{"raw":252,"gzip":195,"br":165},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-clipboard":{"raw":1177,"gzip":651,"br":552},"use-debounced-value":{"raw":524,"gzip":342,"br":286},"use-fast-click":{"raw":553,"gzip":364,"br":297},"use-is-client":{"raw":150,"gzip":145,"br":115},"use-is-online":{"raw":356,"gzip":212,"br":158},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":112},"use-map":{"raw":339,"gzip":243,"br":208},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-media-query":{"raw":738,"gzip":413,"br":332},"use-page-visibility":{"raw":290,"gzip":206,"br":154},"use-next-pathname":{"raw":314,"gzip":235,"br":203},"use-retimer":{"raw":199,"gzip":166,"br":127},"use-next-link":{"raw":1676,"gzip":872,"br":745},"use-set":{"raw":340,"gzip":238,"br":203},"use-react-router-enable-concurrent-navigation":{"raw":966,"gzip":470,"br":397},"use-singleton":{"raw":139,"gzip":130,"br":104},"use-react-router-is-match":{"raw":563,"gzip":372,"br":314},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-typescript-happy-callback":{"raw":107,"gzip":102,"br":77},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":249},"use-uncontrolled":{"raw":352,"gzip":258,"br":216},"use-url-hash-state":{"raw":1081,"gzip":620,"br":540}}}
|
|
@@ -6,4 +6,5 @@ declare const typeScriptHappyForwardRef: TypeScriptHappyForwardRef;
|
|
|
6
6
|
/** @see https://foxact.skk.moe/typescript-happy-forward-ref */
|
|
7
7
|
declare const typescriptHappyForwardRef: TypeScriptHappyForwardRef;
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { typeScriptHappyForwardRef, typescriptHappyForwardRef };
|
|
10
|
+
export type { TypeScriptHappyForwardRef };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { EffectCallback, DependencyList } from 'react';
|
|
1
|
+
import type { EffectCallback, DependencyList } from 'react';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
2
6
|
|
|
3
7
|
/** @see https://foxact.skk.moe/use-abortable-effect */
|
|
4
8
|
declare function useAbortableEffect(callback: (signal: AbortSignal) => ReturnType<EffectCallback>, deps: DependencyList): void;
|
|
@@ -8,4 +8,5 @@ interface UseCompositionInputReturn<T extends HTMLInputElement | HTMLTextAreaEle
|
|
|
8
8
|
/** @see https://foxact.skk.moe/use-composition-input */
|
|
9
9
|
declare function useCompositionInput<T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement>(cb: UseCompositionInputCallback): UseCompositionInputReturn<T>;
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { useCompositionInput };
|
|
12
|
+
export type { UseCompositionInputCallback, UseCompositionInputReturn, UseCompositionInputReturnKey };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var r=require("react");function t(r){return!
|
|
1
|
+
"use strict";require("client-only");var r=require("react");function t(r){return!1!==r&&null!=r}exports.useErrorBoundary=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[n,u]=r.useState(!1);if(t(e))throw e;if(t(n))throw n;return u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"client-only";import{useState as r}from"react";function t(r){return!
|
|
1
|
+
import"client-only";import{useState as r}from"react";function t(r){return!1!==r&&null!=r}function o(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[n,e]=r(!1);if(t(o))throw o;if(t(n))throw n;return e}export{o as useErrorBoundary};
|
|
@@ -2,4 +2,5 @@ type FastClickReturn<T extends HTMLDivElement | HTMLButtonElement> = Pick<React.
|
|
|
2
2
|
/** @see https://foxact.skk.moe/use-fast-click */
|
|
3
3
|
declare function useFastClick<T extends HTMLDivElement | HTMLButtonElement>(callback: React.MouseEventHandler<T>): FastClickReturn<T>;
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export { useFastClick };
|
|
6
|
+
export type { FastClickReturn };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { NotUndefined,
|
|
2
|
-
|
|
1
|
+
import { NotUndefined, StateHookTuple } from '../create-storage-hook/index.js';
|
|
2
|
+
import type { Serializer, Deserializer, UseStorageRawOption, UseStorageParserOption } from '../create-storage-hook/index.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
|
|
4
9
|
declare const useLocalStorage: {
|
|
5
10
|
<T>(key: string, serverValue: NotUndefined<T>, options?: UseStorageRawOption | UseStorageParserOption<T>): StateHookTuple<T>;
|
|
@@ -7,4 +12,5 @@ declare const useLocalStorage: {
|
|
|
7
12
|
};
|
|
8
13
|
declare const useSetLocalStorage: <T>(key: string, serializer: Serializer<T>) => (v: T | null) => void;
|
|
9
14
|
|
|
10
|
-
export {
|
|
15
|
+
export { useLocalStorage, useSetLocalStorage };
|
|
16
|
+
export type { Deserializer, Serializer, UseStorageParserOption as UseLocalStorageParserOption, UseStorageRawOption as UseLocalStorageRawOption };
|
package/use-next-link/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { LinkProps } from 'next/link';
|
|
1
|
+
import type { LinkProps } from 'next/link';
|
|
2
|
+
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
interface UrlObject {
|
|
4
6
|
auth?: string | null | undefined;
|
|
@@ -27,4 +29,5 @@ interface UseNextLinkReturnProps extends Partial<React.JSX.IntrinsicElements['a'
|
|
|
27
29
|
declare function useNextLink(hrefProp: string | UrlObject, { prefetch: prefetchProp, ref, onClick, onMouseEnter, onTouchStart, scroll: routerScroll, replace, ...restProps }: UseNextLinkOptions): [isPending: boolean, linkProps: UseNextLinkReturnProps];
|
|
28
30
|
declare const unstable_useNextLink: typeof useNextLink;
|
|
29
31
|
|
|
30
|
-
export {
|
|
32
|
+
export { unstable_useNextLink };
|
|
33
|
+
export type { UseNextLinkOptions, UseNextLinkReturnProps };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { Foxact } from '../types/index.js';
|
|
2
|
+
import type { Foxact } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
/** @see https://foxact.skk.moe/use-react-router-enable-concurrent-navigation */
|
|
5
7
|
declare function useReactRouterEnableConcurrentNavigation(): void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { NotUndefined,
|
|
2
|
-
|
|
1
|
+
import { NotUndefined, StateHookTuple } from '../create-storage-hook/index.js';
|
|
2
|
+
import type { Serializer, Deserializer, UseStorageRawOption, UseStorageParserOption } from '../create-storage-hook/index.js';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
|
|
4
9
|
declare const useSessionStorage: {
|
|
5
10
|
<T>(key: string, serverValue: NotUndefined<T>, options?: UseStorageRawOption | UseStorageParserOption<T>): StateHookTuple<T>;
|
|
@@ -7,4 +12,5 @@ declare const useSessionStorage: {
|
|
|
7
12
|
};
|
|
8
13
|
declare const useSetSessionStorage: <T>(key: string, serializer: Serializer<T>) => (v: T | null) => void;
|
|
9
14
|
|
|
10
|
-
export {
|
|
15
|
+
export { useSessionStorage, useSetSessionStorage };
|
|
16
|
+
export type { Deserializer, Serializer, UseStorageParserOption as UseSessionStorageParserOption, UseStorageRawOption as UseSessionStorageRawOption };
|
package/use-singleton/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ interface SingletonRefObject<T> {
|
|
|
4
4
|
/** @see https://foxact.skk.moe/use-singleton */
|
|
5
5
|
declare function useSingleton<T>(initializor: () => T): SingletonRefObject<T>;
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { useSingleton };
|
|
8
|
+
export type { SingletonRefObject };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
|
|
3
3
|
/** @see https://foxact.skk.moe/use-uncontrolled */
|
|
4
|
-
declare function useUncontrolled<T, E extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement = HTMLInputElement>(initialValue: T, transformValue?: (value: T) => T): readonly [T, () => void, react.RefObject<E>];
|
|
4
|
+
declare function useUncontrolled<T, E extends HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement = HTMLInputElement>(initialValue: T, transformValue?: (value: T) => T): readonly [T, () => void, react.RefObject<E | null>];
|
|
5
5
|
|
|
6
6
|
export { useUncontrolled };
|
|
@@ -12,4 +12,5 @@ interface UseUrlHashStateParserOption<T> {
|
|
|
12
12
|
/** @see https://foxact.skk.moe/use-url-hash-state */
|
|
13
13
|
declare function useUrlHashState<T>(key: string, defaultValue?: NotUndefined<T>, options?: UseUrlHashStateRawOption | UseUrlHashStateParserOption<T>): readonly [NonNullable<T> | null, (v: React.SetStateAction<T | null>) => void];
|
|
14
14
|
|
|
15
|
-
export {
|
|
15
|
+
export { useUrlHashState as unstable_useUrlHashState };
|
|
16
|
+
export type { Deserializer, Serializer, UseUrlHashStateParserOption, UseUrlHashStateRawOption };
|