foxact 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxact",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
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": {
|
|
@@ -52,15 +52,6 @@
|
|
|
52
52
|
"exports": {
|
|
53
53
|
"./package.json": "./package.json",
|
|
54
54
|
"./sizes.json": "./sizes.json",
|
|
55
|
-
"./breadcrumbs": {
|
|
56
|
-
"types": "./breadcrumbs/index.d.ts",
|
|
57
|
-
"import": {
|
|
58
|
-
"types": "./breadcrumbs/index.d.ts",
|
|
59
|
-
"default": "./breadcrumbs/index.mjs"
|
|
60
|
-
},
|
|
61
|
-
"require": "./breadcrumbs/index.cjs",
|
|
62
|
-
"default": "./breadcrumbs/index.cjs"
|
|
63
|
-
},
|
|
64
55
|
"./browser": {
|
|
65
56
|
"types": "./browser/index.d.ts",
|
|
66
57
|
"import": {
|
|
@@ -70,14 +61,14 @@
|
|
|
70
61
|
"require": "./browser/index.cjs",
|
|
71
62
|
"default": "./browser/index.cjs"
|
|
72
63
|
},
|
|
73
|
-
"./
|
|
74
|
-
"types": "./
|
|
64
|
+
"./breadcrumbs": {
|
|
65
|
+
"types": "./breadcrumbs/index.d.ts",
|
|
75
66
|
"import": {
|
|
76
|
-
"types": "./
|
|
77
|
-
"default": "./
|
|
67
|
+
"types": "./breadcrumbs/index.d.ts",
|
|
68
|
+
"default": "./breadcrumbs/index.mjs"
|
|
78
69
|
},
|
|
79
|
-
"require": "./
|
|
80
|
-
"default": "./
|
|
70
|
+
"require": "./breadcrumbs/index.cjs",
|
|
71
|
+
"default": "./breadcrumbs/index.cjs"
|
|
81
72
|
},
|
|
82
73
|
"./context-reducer": {
|
|
83
74
|
"types": "./context-reducer/index.d.ts",
|
|
@@ -88,14 +79,14 @@
|
|
|
88
79
|
"require": "./context-reducer/index.cjs",
|
|
89
80
|
"default": "./context-reducer/index.cjs"
|
|
90
81
|
},
|
|
91
|
-
"./
|
|
92
|
-
"types": "./
|
|
82
|
+
"./context-state": {
|
|
83
|
+
"types": "./context-state/index.d.ts",
|
|
93
84
|
"import": {
|
|
94
|
-
"types": "./
|
|
95
|
-
"default": "./
|
|
85
|
+
"types": "./context-state/index.d.ts",
|
|
86
|
+
"default": "./context-state/index.mjs"
|
|
96
87
|
},
|
|
97
|
-
"require": "./
|
|
98
|
-
"default": "./
|
|
88
|
+
"require": "./context-state/index.cjs",
|
|
89
|
+
"default": "./context-state/index.cjs"
|
|
99
90
|
},
|
|
100
91
|
"./create-breadcrumbs": {
|
|
101
92
|
"types": "./create-breadcrumbs/index.d.ts",
|
|
@@ -115,6 +106,15 @@
|
|
|
115
106
|
"require": "./create-context-reducer/index.cjs",
|
|
116
107
|
"default": "./create-context-reducer/index.cjs"
|
|
117
108
|
},
|
|
109
|
+
"./compose-context-provider": {
|
|
110
|
+
"types": "./compose-context-provider/index.d.ts",
|
|
111
|
+
"import": {
|
|
112
|
+
"types": "./compose-context-provider/index.d.ts",
|
|
113
|
+
"default": "./compose-context-provider/index.mjs"
|
|
114
|
+
},
|
|
115
|
+
"require": "./compose-context-provider/index.cjs",
|
|
116
|
+
"default": "./compose-context-provider/index.cjs"
|
|
117
|
+
},
|
|
118
118
|
"./create-context-state": {
|
|
119
119
|
"types": "./create-context-state/index.d.ts",
|
|
120
120
|
"import": {
|
|
@@ -133,14 +133,23 @@
|
|
|
133
133
|
"require": "./create-fixed-array/index.cjs",
|
|
134
134
|
"default": "./create-fixed-array/index.cjs"
|
|
135
135
|
},
|
|
136
|
-
"./create-
|
|
137
|
-
"types": "./create-
|
|
136
|
+
"./create-magic-portal": {
|
|
137
|
+
"types": "./create-magic-portal/index.d.ts",
|
|
138
138
|
"import": {
|
|
139
|
-
"types": "./create-
|
|
140
|
-
"default": "./create-
|
|
139
|
+
"types": "./create-magic-portal/index.d.ts",
|
|
140
|
+
"default": "./create-magic-portal/index.mjs"
|
|
141
141
|
},
|
|
142
|
-
"require": "./create-
|
|
143
|
-
"default": "./create-
|
|
142
|
+
"require": "./create-magic-portal/index.cjs",
|
|
143
|
+
"default": "./create-magic-portal/index.cjs"
|
|
144
|
+
},
|
|
145
|
+
"./create-session-storage-state": {
|
|
146
|
+
"types": "./create-session-storage-state/index.d.ts",
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./create-session-storage-state/index.d.ts",
|
|
149
|
+
"default": "./create-session-storage-state/index.mjs"
|
|
150
|
+
},
|
|
151
|
+
"require": "./create-session-storage-state/index.cjs",
|
|
152
|
+
"default": "./create-session-storage-state/index.cjs"
|
|
144
153
|
},
|
|
145
154
|
"./create-stackless-error": {
|
|
146
155
|
"types": "./create-stackless-error/index.d.ts",
|
|
@@ -151,14 +160,14 @@
|
|
|
151
160
|
"require": "./create-stackless-error/index.cjs",
|
|
152
161
|
"default": "./create-stackless-error/index.cjs"
|
|
153
162
|
},
|
|
154
|
-
"./create-storage-
|
|
155
|
-
"types": "./create-storage-
|
|
163
|
+
"./create-local-storage-state": {
|
|
164
|
+
"types": "./create-local-storage-state/index.d.ts",
|
|
156
165
|
"import": {
|
|
157
|
-
"types": "./create-storage-
|
|
158
|
-
"default": "./create-storage-
|
|
166
|
+
"types": "./create-local-storage-state/index.d.ts",
|
|
167
|
+
"default": "./create-local-storage-state/index.mjs"
|
|
159
168
|
},
|
|
160
|
-
"require": "./create-storage-
|
|
161
|
-
"default": "./create-storage-
|
|
169
|
+
"require": "./create-local-storage-state/index.cjs",
|
|
170
|
+
"default": "./create-local-storage-state/index.cjs"
|
|
162
171
|
},
|
|
163
172
|
"./create-storage-state-factory": {
|
|
164
173
|
"types": "./create-storage-state-factory/index.d.ts",
|
|
@@ -169,6 +178,15 @@
|
|
|
169
178
|
"require": "./create-storage-state-factory/index.cjs",
|
|
170
179
|
"default": "./create-storage-state-factory/index.cjs"
|
|
171
180
|
},
|
|
181
|
+
"./create-storage-hook": {
|
|
182
|
+
"types": "./create-storage-hook/index.d.ts",
|
|
183
|
+
"import": {
|
|
184
|
+
"types": "./create-storage-hook/index.d.ts",
|
|
185
|
+
"default": "./create-storage-hook/index.mjs"
|
|
186
|
+
},
|
|
187
|
+
"require": "./create-storage-hook/index.cjs",
|
|
188
|
+
"default": "./create-storage-hook/index.cjs"
|
|
189
|
+
},
|
|
172
190
|
"./current-year": {
|
|
173
191
|
"types": "./current-year/index.d.ts",
|
|
174
192
|
"import": {
|
|
@@ -178,14 +196,14 @@
|
|
|
178
196
|
"require": "./current-year/index.cjs",
|
|
179
197
|
"default": "./current-year/index.cjs"
|
|
180
198
|
},
|
|
181
|
-
"./
|
|
182
|
-
"types": "./
|
|
199
|
+
"./get-react-children": {
|
|
200
|
+
"types": "./get-react-children/index.d.ts",
|
|
183
201
|
"import": {
|
|
184
|
-
"types": "./
|
|
185
|
-
"default": "./
|
|
202
|
+
"types": "./get-react-children/index.d.ts",
|
|
203
|
+
"default": "./get-react-children/index.mjs"
|
|
186
204
|
},
|
|
187
|
-
"require": "./
|
|
188
|
-
"default": "./
|
|
205
|
+
"require": "./get-react-children/index.cjs",
|
|
206
|
+
"default": "./get-react-children/index.cjs"
|
|
189
207
|
},
|
|
190
208
|
"./fetch-jsonp": {
|
|
191
209
|
"types": "./fetch-jsonp/index.d.ts",
|
|
@@ -196,15 +214,6 @@
|
|
|
196
214
|
"require": "./fetch-jsonp/index.cjs",
|
|
197
215
|
"default": "./fetch-jsonp/index.cjs"
|
|
198
216
|
},
|
|
199
|
-
"./get-react-children": {
|
|
200
|
-
"types": "./get-react-children/index.d.ts",
|
|
201
|
-
"import": {
|
|
202
|
-
"types": "./get-react-children/index.d.ts",
|
|
203
|
-
"default": "./get-react-children/index.mjs"
|
|
204
|
-
},
|
|
205
|
-
"require": "./get-react-children/index.cjs",
|
|
206
|
-
"default": "./get-react-children/index.cjs"
|
|
207
|
-
},
|
|
208
217
|
"./get-single-react-children": {
|
|
209
218
|
"types": "./get-single-react-children/index.d.ts",
|
|
210
219
|
"import": {
|
|
@@ -214,6 +223,15 @@
|
|
|
214
223
|
"require": "./get-single-react-children/index.cjs",
|
|
215
224
|
"default": "./get-single-react-children/index.cjs"
|
|
216
225
|
},
|
|
226
|
+
"./invariant": {
|
|
227
|
+
"types": "./invariant/index.d.ts",
|
|
228
|
+
"import": {
|
|
229
|
+
"types": "./invariant/index.d.ts",
|
|
230
|
+
"default": "./invariant/index.mjs"
|
|
231
|
+
},
|
|
232
|
+
"require": "./invariant/index.cjs",
|
|
233
|
+
"default": "./invariant/index.cjs"
|
|
234
|
+
},
|
|
217
235
|
"./is-safari": {
|
|
218
236
|
"types": "./is-safari/index.d.ts",
|
|
219
237
|
"import": {
|
|
@@ -232,15 +250,6 @@
|
|
|
232
250
|
"require": "./magic-portal/index.cjs",
|
|
233
251
|
"default": "./magic-portal/index.cjs"
|
|
234
252
|
},
|
|
235
|
-
"./invariant": {
|
|
236
|
-
"types": "./invariant/index.d.ts",
|
|
237
|
-
"import": {
|
|
238
|
-
"types": "./invariant/index.d.ts",
|
|
239
|
-
"default": "./invariant/index.mjs"
|
|
240
|
-
},
|
|
241
|
-
"require": "./invariant/index.cjs",
|
|
242
|
-
"default": "./invariant/index.cjs"
|
|
243
|
-
},
|
|
244
253
|
"./merge-props": {
|
|
245
254
|
"types": "./merge-props/index.d.ts",
|
|
246
255
|
"import": {
|
|
@@ -277,15 +286,6 @@
|
|
|
277
286
|
"require": "./noop/index.cjs",
|
|
278
287
|
"default": "./noop/index.cjs"
|
|
279
288
|
},
|
|
280
|
-
"./noop-component": {
|
|
281
|
-
"types": "./noop-component/index.d.ts",
|
|
282
|
-
"import": {
|
|
283
|
-
"types": "./noop-component/index.d.ts",
|
|
284
|
-
"default": "./noop-component/index.mjs"
|
|
285
|
-
},
|
|
286
|
-
"require": "./noop-component/index.cjs",
|
|
287
|
-
"default": "./noop-component/index.cjs"
|
|
288
|
-
},
|
|
289
289
|
"./nullthrow": {
|
|
290
290
|
"types": "./nullthrow/index.d.ts",
|
|
291
291
|
"import": {
|
|
@@ -304,6 +304,15 @@
|
|
|
304
304
|
"require": "./open-new-tab/index.cjs",
|
|
305
305
|
"default": "./open-new-tab/index.cjs"
|
|
306
306
|
},
|
|
307
|
+
"./noop-component": {
|
|
308
|
+
"types": "./noop-component/index.d.ts",
|
|
309
|
+
"import": {
|
|
310
|
+
"types": "./noop-component/index.d.ts",
|
|
311
|
+
"default": "./noop-component/index.mjs"
|
|
312
|
+
},
|
|
313
|
+
"require": "./noop-component/index.cjs",
|
|
314
|
+
"default": "./noop-component/index.cjs"
|
|
315
|
+
},
|
|
307
316
|
"./polymorphic": {
|
|
308
317
|
"types": "./polymorphic/index.d.ts",
|
|
309
318
|
"import": {
|
|
@@ -340,15 +349,6 @@
|
|
|
340
349
|
"require": "./types/index.cjs",
|
|
341
350
|
"default": "./types/index.cjs"
|
|
342
351
|
},
|
|
343
|
-
"./use": {
|
|
344
|
-
"types": "./use/index.d.ts",
|
|
345
|
-
"import": {
|
|
346
|
-
"types": "./use/index.d.ts",
|
|
347
|
-
"default": "./use/index.mjs"
|
|
348
|
-
},
|
|
349
|
-
"require": "./use/index.cjs",
|
|
350
|
-
"default": "./use/index.cjs"
|
|
351
|
-
},
|
|
352
352
|
"./typescript-happy-forward-ref": {
|
|
353
353
|
"types": "./typescript-happy-forward-ref/index.d.ts",
|
|
354
354
|
"import": {
|
|
@@ -358,14 +358,14 @@
|
|
|
358
358
|
"require": "./typescript-happy-forward-ref/index.cjs",
|
|
359
359
|
"default": "./typescript-happy-forward-ref/index.cjs"
|
|
360
360
|
},
|
|
361
|
-
"./use
|
|
362
|
-
"types": "./use
|
|
361
|
+
"./use": {
|
|
362
|
+
"types": "./use/index.d.ts",
|
|
363
363
|
"import": {
|
|
364
|
-
"types": "./use
|
|
365
|
-
"default": "./use
|
|
364
|
+
"types": "./use/index.d.ts",
|
|
365
|
+
"default": "./use/index.mjs"
|
|
366
366
|
},
|
|
367
|
-
"require": "./use
|
|
368
|
-
"default": "./use
|
|
367
|
+
"require": "./use/index.cjs",
|
|
368
|
+
"default": "./use/index.cjs"
|
|
369
369
|
},
|
|
370
370
|
"./use-array": {
|
|
371
371
|
"types": "./use-array/index.d.ts",
|
|
@@ -376,6 +376,15 @@
|
|
|
376
376
|
"require": "./use-array/index.cjs",
|
|
377
377
|
"default": "./use-array/index.cjs"
|
|
378
378
|
},
|
|
379
|
+
"./use-abortable-effect": {
|
|
380
|
+
"types": "./use-abortable-effect/index.d.ts",
|
|
381
|
+
"import": {
|
|
382
|
+
"types": "./use-abortable-effect/index.d.ts",
|
|
383
|
+
"default": "./use-abortable-effect/index.mjs"
|
|
384
|
+
},
|
|
385
|
+
"require": "./use-abortable-effect/index.cjs",
|
|
386
|
+
"default": "./use-abortable-effect/index.cjs"
|
|
387
|
+
},
|
|
379
388
|
"./use-clipboard": {
|
|
380
389
|
"types": "./use-clipboard/index.d.ts",
|
|
381
390
|
"import": {
|
|
@@ -412,15 +421,6 @@
|
|
|
412
421
|
"require": "./use-debounced-state/index.cjs",
|
|
413
422
|
"default": "./use-debounced-state/index.cjs"
|
|
414
423
|
},
|
|
415
|
-
"./use-debounced-value": {
|
|
416
|
-
"types": "./use-debounced-value/index.d.ts",
|
|
417
|
-
"import": {
|
|
418
|
-
"types": "./use-debounced-value/index.d.ts",
|
|
419
|
-
"default": "./use-debounced-value/index.mjs"
|
|
420
|
-
},
|
|
421
|
-
"require": "./use-debounced-value/index.cjs",
|
|
422
|
-
"default": "./use-debounced-value/index.cjs"
|
|
423
|
-
},
|
|
424
424
|
"./use-error-boundary": {
|
|
425
425
|
"types": "./use-error-boundary/index.d.ts",
|
|
426
426
|
"import": {
|
|
@@ -430,14 +430,14 @@
|
|
|
430
430
|
"require": "./use-error-boundary/index.cjs",
|
|
431
431
|
"default": "./use-error-boundary/index.cjs"
|
|
432
432
|
},
|
|
433
|
-
"./use-
|
|
434
|
-
"types": "./use-
|
|
433
|
+
"./use-debounced-value": {
|
|
434
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
435
435
|
"import": {
|
|
436
|
-
"types": "./use-
|
|
437
|
-
"default": "./use-
|
|
436
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
437
|
+
"default": "./use-debounced-value/index.mjs"
|
|
438
438
|
},
|
|
439
|
-
"require": "./use-
|
|
440
|
-
"default": "./use-
|
|
439
|
+
"require": "./use-debounced-value/index.cjs",
|
|
440
|
+
"default": "./use-debounced-value/index.cjs"
|
|
441
441
|
},
|
|
442
442
|
"./use-fast-click": {
|
|
443
443
|
"types": "./use-fast-click/index.d.ts",
|
|
@@ -448,6 +448,15 @@
|
|
|
448
448
|
"require": "./use-fast-click/index.cjs",
|
|
449
449
|
"default": "./use-fast-click/index.cjs"
|
|
450
450
|
},
|
|
451
|
+
"./use-intersection": {
|
|
452
|
+
"types": "./use-intersection/index.d.ts",
|
|
453
|
+
"import": {
|
|
454
|
+
"types": "./use-intersection/index.d.ts",
|
|
455
|
+
"default": "./use-intersection/index.mjs"
|
|
456
|
+
},
|
|
457
|
+
"require": "./use-intersection/index.cjs",
|
|
458
|
+
"default": "./use-intersection/index.cjs"
|
|
459
|
+
},
|
|
451
460
|
"./use-is-client": {
|
|
452
461
|
"types": "./use-is-client/index.d.ts",
|
|
453
462
|
"import": {
|
|
@@ -466,15 +475,6 @@
|
|
|
466
475
|
"require": "./use-is-online/index.cjs",
|
|
467
476
|
"default": "./use-is-online/index.cjs"
|
|
468
477
|
},
|
|
469
|
-
"./use-isomorphic-layout-effect": {
|
|
470
|
-
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
471
|
-
"import": {
|
|
472
|
-
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
473
|
-
"default": "./use-isomorphic-layout-effect/index.mjs"
|
|
474
|
-
},
|
|
475
|
-
"require": "./use-isomorphic-layout-effect/index.cjs",
|
|
476
|
-
"default": "./use-isomorphic-layout-effect/index.cjs"
|
|
477
|
-
},
|
|
478
478
|
"./use-local-storage": {
|
|
479
479
|
"types": "./use-local-storage/index.d.ts",
|
|
480
480
|
"import": {
|
|
@@ -484,14 +484,23 @@
|
|
|
484
484
|
"require": "./use-local-storage/index.cjs",
|
|
485
485
|
"default": "./use-local-storage/index.cjs"
|
|
486
486
|
},
|
|
487
|
-
"./use-
|
|
488
|
-
"types": "./use-
|
|
487
|
+
"./use-isomorphic-layout-effect": {
|
|
488
|
+
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
489
489
|
"import": {
|
|
490
|
-
"types": "./use-
|
|
491
|
-
"default": "./use-
|
|
490
|
+
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
491
|
+
"default": "./use-isomorphic-layout-effect/index.mjs"
|
|
492
492
|
},
|
|
493
|
-
"require": "./use-
|
|
494
|
-
"default": "./use-
|
|
493
|
+
"require": "./use-isomorphic-layout-effect/index.cjs",
|
|
494
|
+
"default": "./use-isomorphic-layout-effect/index.cjs"
|
|
495
|
+
},
|
|
496
|
+
"./use-page-visibility": {
|
|
497
|
+
"types": "./use-page-visibility/index.d.ts",
|
|
498
|
+
"import": {
|
|
499
|
+
"types": "./use-page-visibility/index.d.ts",
|
|
500
|
+
"default": "./use-page-visibility/index.mjs"
|
|
501
|
+
},
|
|
502
|
+
"require": "./use-page-visibility/index.cjs",
|
|
503
|
+
"default": "./use-page-visibility/index.cjs"
|
|
495
504
|
},
|
|
496
505
|
"./use-media-query": {
|
|
497
506
|
"types": "./use-media-query/index.d.ts",
|
|
@@ -502,14 +511,14 @@
|
|
|
502
511
|
"require": "./use-media-query/index.cjs",
|
|
503
512
|
"default": "./use-media-query/index.cjs"
|
|
504
513
|
},
|
|
505
|
-
"./use-
|
|
506
|
-
"types": "./use-
|
|
514
|
+
"./use-map": {
|
|
515
|
+
"types": "./use-map/index.d.ts",
|
|
507
516
|
"import": {
|
|
508
|
-
"types": "./use-
|
|
509
|
-
"default": "./use-
|
|
517
|
+
"types": "./use-map/index.d.ts",
|
|
518
|
+
"default": "./use-map/index.mjs"
|
|
510
519
|
},
|
|
511
|
-
"require": "./use-
|
|
512
|
-
"default": "./use-
|
|
520
|
+
"require": "./use-map/index.cjs",
|
|
521
|
+
"default": "./use-map/index.cjs"
|
|
513
522
|
},
|
|
514
523
|
"./use-readonly-search-params": {
|
|
515
524
|
"types": "./use-readonly-search-params/index.d.ts",
|
|
@@ -520,15 +529,6 @@
|
|
|
520
529
|
"require": "./use-readonly-search-params/index.cjs",
|
|
521
530
|
"default": "./use-readonly-search-params/index.cjs"
|
|
522
531
|
},
|
|
523
|
-
"./use-resizing": {
|
|
524
|
-
"types": "./use-resizing/index.d.ts",
|
|
525
|
-
"import": {
|
|
526
|
-
"types": "./use-resizing/index.d.ts",
|
|
527
|
-
"default": "./use-resizing/index.mjs"
|
|
528
|
-
},
|
|
529
|
-
"require": "./use-resizing/index.cjs",
|
|
530
|
-
"default": "./use-resizing/index.cjs"
|
|
531
|
-
},
|
|
532
532
|
"./use-retimer": {
|
|
533
533
|
"types": "./use-retimer/index.d.ts",
|
|
534
534
|
"import": {
|
|
@@ -538,6 +538,15 @@
|
|
|
538
538
|
"require": "./use-retimer/index.cjs",
|
|
539
539
|
"default": "./use-retimer/index.cjs"
|
|
540
540
|
},
|
|
541
|
+
"./use-resizing": {
|
|
542
|
+
"types": "./use-resizing/index.d.ts",
|
|
543
|
+
"import": {
|
|
544
|
+
"types": "./use-resizing/index.d.ts",
|
|
545
|
+
"default": "./use-resizing/index.mjs"
|
|
546
|
+
},
|
|
547
|
+
"require": "./use-resizing/index.cjs",
|
|
548
|
+
"default": "./use-resizing/index.cjs"
|
|
549
|
+
},
|
|
541
550
|
"./use-session-storage": {
|
|
542
551
|
"types": "./use-session-storage/index.d.ts",
|
|
543
552
|
"import": {
|
|
@@ -556,15 +565,6 @@
|
|
|
556
565
|
"require": "./use-singleton/index.cjs",
|
|
557
566
|
"default": "./use-singleton/index.cjs"
|
|
558
567
|
},
|
|
559
|
-
"./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
|
|
560
|
-
"types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
|
|
561
|
-
"import": {
|
|
562
|
-
"types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
|
|
563
|
-
"default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
|
|
564
|
-
},
|
|
565
|
-
"require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
|
|
566
|
-
"default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs"
|
|
567
|
-
},
|
|
568
568
|
"./use-set": {
|
|
569
569
|
"types": "./use-set/index.d.ts",
|
|
570
570
|
"import": {
|
|
@@ -574,6 +574,15 @@
|
|
|
574
574
|
"require": "./use-set/index.cjs",
|
|
575
575
|
"default": "./use-set/index.cjs"
|
|
576
576
|
},
|
|
577
|
+
"./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
|
|
578
|
+
"types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
|
|
579
|
+
"import": {
|
|
580
|
+
"types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
|
|
581
|
+
"default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
|
|
582
|
+
},
|
|
583
|
+
"require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
|
|
584
|
+
"default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs"
|
|
585
|
+
},
|
|
577
586
|
"./use-state-with-deps": {
|
|
578
587
|
"types": "./use-state-with-deps/index.d.ts",
|
|
579
588
|
"import": {
|
|
@@ -609,15 +618,6 @@
|
|
|
609
618
|
},
|
|
610
619
|
"require": "./use-url-hash-state/index.cjs",
|
|
611
620
|
"default": "./use-url-hash-state/index.cjs"
|
|
612
|
-
},
|
|
613
|
-
"./create-magic-portal": {
|
|
614
|
-
"types": "./create-magic-portal/index.d.ts",
|
|
615
|
-
"import": {
|
|
616
|
-
"types": "./create-magic-portal/index.d.ts",
|
|
617
|
-
"default": "./create-magic-portal/index.mjs"
|
|
618
|
-
},
|
|
619
|
-
"require": "./create-magic-portal/index.cjs",
|
|
620
|
-
"default": "./create-magic-portal/index.cjs"
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
}
|
package/sizes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"total":{"raw":
|
|
1
|
+
{"total":{"raw":30280,"gzip":18326,"br":15438,"zstd":18374},"exports":{"browser":{"raw":686,"gzip":402,"br":333,"zstd":413},"create-context-reducer":{"raw":63,"gzip":74,"br":64,"zstd":72},"compose-context-provider":{"raw":177,"gzip":155,"br":122,"zstd":144},"create-breadcrumbs":{"raw":56,"gzip":68,"br":52,"zstd":65},"create-context-state":{"raw":59,"gzip":72,"br":59,"zstd":68},"create-magic-portal":{"raw":57,"gzip":71,"br":53,"zstd":66},"create-fixed-array":{"raw":452,"gzip":282,"br":248,"zstd":282},"context-reducer":{"raw":557,"gzip":332,"br":319,"zstd":336},"create-stackless-error":{"raw":278,"gzip":198,"br":162,"zstd":188},"create-session-storage-state":{"raw":173,"gzip":138,"br":108,"zstd":129},"create-local-storage-state":{"raw":169,"gzip":138,"br":111,"zstd":130},"create-storage-state-factory":{"raw":364,"gzip":248,"br":197,"zstd":243},"breadcrumbs":{"raw":879,"gzip":467,"br":395,"zstd":472},"current-year":{"raw":508,"gzip":348,"br":283,"zstd":349},"context-state":{"raw":402,"gzip":259,"br":218,"zstd":259},"get-single-react-children":{"raw":68,"gzip":80,"br":70,"zstd":77},"fetch-jsonp":{"raw":924,"gzip":570,"br":446,"zstd":576},"is-safari":{"raw":247,"gzip":175,"br":133,"zstd":169},"magic-portal":{"raw":1013,"gzip":517,"br":445,"zstd":526},"get-react-children":{"raw":568,"gzip":354,"br":284,"zstd":355},"merge-refs":{"raw":525,"gzip":280,"br":235,"zstd":278},"no-ssr":{"raw":381,"gzip":281,"br":236,"zstd":285},"create-storage-hook":{"raw":2418,"gzip":957,"br":835,"zstd":1000},"noop":{"raw":33,"gzip":53,"br":37,"zstd":42},"open-new-tab":{"raw":335,"gzip":255,"br":187,"zstd":255},"nullthrow":{"raw":187,"gzip":163,"br":121,"zstd":156},"merge-props":{"raw":1030,"gzip":559,"br":501,"zstd":577},"noop-component":{"raw":142,"gzip":130,"br":111,"zstd":119},"polymorphic":{"raw":284,"gzip":212,"br":180,"zstd":199},"types":{"raw":0,"gzip":20,"br":1,"zstd":9},"request-idle-callback":{"raw":392,"gzip":221,"br":171,"zstd":213},"use":{"raw":301,"gzip":200,"br":177,"zstd":193},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80,"zstd":91},"use-abortable-effect":{"raw":215,"gzip":170,"br":144,"zstd":166},"rem":{"raw":823,"gzip":395,"br":350,"zstd":402},"use-component-will-receive-update":{"raw":220,"gzip":190,"br":157,"zstd":179},"use-debounced-state":{"raw":401,"gzip":282,"br":244,"zstd":288},"invariant":{"raw":178,"gzip":156,"br":118,"zstd":149},"use-composition-input":{"raw":470,"gzip":286,"br":241,"zstd":296},"use-error-boundary":{"raw":252,"gzip":195,"br":165,"zstd":187},"use-debounced-value":{"raw":553,"gzip":358,"br":320,"zstd":360},"use-array":{"raw":334,"gzip":243,"br":206,"zstd":236},"use-clipboard":{"raw":2718,"gzip":1333,"br":1141,"zstd":1398},"use-local-storage":{"raw":192,"gzip":143,"br":114,"zstd":137},"use-intersection":{"raw":1363,"gzip":716,"br":654,"zstd":750},"use-is-client":{"raw":184,"gzip":158,"br":130,"zstd":149},"use-is-online":{"raw":288,"gzip":216,"br":196,"zstd":205},"use-page-visibility":{"raw":283,"gzip":211,"br":162,"zstd":203},"use-fast-click":{"raw":499,"gzip":350,"br":284,"zstd":355},"use-map":{"raw":384,"gzip":256,"br":220,"zstd":262},"use-media-query":{"raw":483,"gzip":322,"br":256,"zstd":325},"use-singleton":{"raw":149,"gzip":135,"br":116,"zstd":123},"use-resizing":{"raw":511,"gzip":334,"br":294,"zstd":342},"use-set":{"raw":368,"gzip":247,"br":211,"zstd":255},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":443,"gzip":320,"br":252,"zstd":320},"use-typescript-happy-callback":{"raw":107,"gzip":102,"br":77,"zstd":94},"use-state-with-deps":{"raw":747,"gzip":479,"br":418,"zstd":488},"use-isomorphic-layout-effect":{"raw":169,"gzip":137,"br":110,"zstd":127},"use-retimer":{"raw":194,"gzip":166,"br":127,"zstd":154},"use-session-storage":{"raw":198,"gzip":141,"br":118,"zstd":137},"use-uncontrolled":{"raw":388,"gzip":273,"br":230,"zstd":277},"use-url-hash-state":{"raw":1001,"gzip":572,"br":495,"zstd":582},"use-readonly-search-params":{"raw":2318,"gzip":1058,"br":914,"zstd":1092}}}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("event-target-bus/react"),t=require("../no-ssr/index.cjs"),n=require("react");class a extends Error{constructor(){var e;super("[foxact/use-readonly-search-params] Method unavailable on `ReadonlyURLSearchParams`"),(e="name")in this?Object.defineProperty(this,e,{value:"ReadonlyURLSearchParamsError",enumerable:!0,configurable:!0,writable:!0}):this[e]="ReadonlyURLSearchParamsError"}}class o extends URLSearchParams{append(){throw new a}delete(){throw new a}set(){throw new a}sort(){throw new a}}const s=r.createSyncExternalStoreSubscribe(()=>window,"popstate"),c=n.createContext({hasProvider:!1,subscribe:s});let u=0,i=null,l=null;function h(){return"u"<typeof window?new o:null!==l&&window.location.search===i?l:l=new o(i=window.location.search)}function d(){throw t.noSSRError('[foxact] useReadonlySearchParams cannot be used on the server without a "getServerDefaultValue" function')}exports.ReadonlySearchParamsProvider=function(r){let{children:t}=r;const a=n.useContext(c),o=n.useMemo(()=>(function(){const e=new Set;return{contextValue:{hasProvider:!0,subscribe:r=>{const t=s(r);return e.add(r),()=>{t(),e.delete(r)}}},notify:()=>e.forEach(e=>e())}})(),[]);return n.useEffect(()=>{if(a.hasProvider)return;if("production"!==process.env.NODE_ENV&&u>0)throw Error("[foxact/use-readonly-search-params] Multiple non-nested ReadonlySearchParamsProvider instances are mounted. Use a single top-level provider or nest them.");const e=function(e){const r=window.history,t=r.pushState,n=r.replaceState,a=function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];t.apply(this,n),e()},o=function(){for(var r=arguments.length,t=Array(r),a=0;a<r;a++)t[a]=arguments[a];n.apply(this,t),e()};return r.pushState=a,r.replaceState=o,()=>{r.pushState===a&&(r.pushState=t),r.replaceState===o&&(r.replaceState=n)}}(o.notify);return"production"!==process.env.NODE_ENV&&(u+=1),()=>{e(),"production"!==process.env.NODE_ENV&&(u-=1)}},[o,a.hasProvider]),e.jsx(c.Provider,{value:a.hasProvider?a:o.contextValue,children:t})},exports.ReadonlyURLSearchParams=o,exports.useReadonlySearchParams=function(e){const{subscribe:r}=n.useContext(c);return n.useSyncExternalStore(r,h,null==e?d:()=>{const r=e();return r instanceof o?r:new o(r)})};
|
|
@@ -8,7 +8,14 @@ declare class ReadonlyURLSearchParams extends URLSearchParams {
|
|
|
8
8
|
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://foxact.skk.moe/use-readonly-search-params */
|
|
9
9
|
sort(): never;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Opts descendant `useReadonlySearchParams` hooks into updates made through
|
|
13
|
+
* `history.pushState` and `history.replaceState`.
|
|
14
|
+
*
|
|
15
|
+
* @see https://foxact.skk.moe/use-readonly-search-params
|
|
16
|
+
*/
|
|
17
|
+
declare function ReadonlySearchParamsProvider({ children }: React.PropsWithChildren): React.ReactNode;
|
|
11
18
|
/** @see https://foxact.skk.moe/use-readonly-search-params */
|
|
12
19
|
declare function useReadonlySearchParams(getServerDefaultValue?: () => URLSearchParams | ReadonlyURLSearchParams): ReadonlyURLSearchParams;
|
|
13
20
|
|
|
14
|
-
export { ReadonlyURLSearchParams, useReadonlySearchParams };
|
|
21
|
+
export { ReadonlySearchParamsProvider, ReadonlyURLSearchParams, useReadonlySearchParams };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{createSyncExternalStoreSubscribe as r}from"event-target-bus/react";import{noSSRError as t}from"../no-ssr/index.mjs";import{useContext as n,useMemo as a,useEffect as o,useSyncExternalStore as s,createContext as c}from"react";class i extends Error{constructor(){var e;super("[foxact/use-readonly-search-params] Method unavailable on `ReadonlyURLSearchParams`"),(e="name")in this?Object.defineProperty(this,e,{value:"ReadonlyURLSearchParamsError",enumerable:!0,configurable:!0,writable:!0}):this[e]="ReadonlyURLSearchParamsError"}}class u extends URLSearchParams{append(){throw new i}delete(){throw new i}set(){throw new i}sort(){throw new i}}const l=r(()=>window,"popstate"),h=c({hasProvider:!1,subscribe:l});let d=0;function p(r){let{children:t}=r;const s=n(h),c=a(()=>(function(){const e=new Set;return{contextValue:{hasProvider:!0,subscribe:r=>{const t=l(r);return e.add(r),()=>{t(),e.delete(r)}}},notify:()=>e.forEach(e=>e())}})(),[]);return o(()=>{if(s.hasProvider)return;if("production"!==process.env.NODE_ENV&&d>0)throw Error("[foxact/use-readonly-search-params] Multiple non-nested ReadonlySearchParamsProvider instances are mounted. Use a single top-level provider or nest them.");const e=function(e){const r=window.history,t=r.pushState,n=r.replaceState,a=function(){for(var r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];t.apply(this,n),e()},o=function(){for(var r=arguments.length,t=Array(r),a=0;a<r;a++)t[a]=arguments[a];n.apply(this,t),e()};return r.pushState=a,r.replaceState=o,()=>{r.pushState===a&&(r.pushState=t),r.replaceState===o&&(r.replaceState=n)}}(c.notify);return"production"!==process.env.NODE_ENV&&(d+=1),()=>{e(),"production"!==process.env.NODE_ENV&&(d-=1)}},[c,s.hasProvider]),e(h.Provider,{value:s.hasProvider?s:c.contextValue,children:t})}let f=null,w=null;function m(){return"u"<typeof window?new u:null!==w&&window.location.search===f?w:w=new u(f=window.location.search)}function v(){throw t('[foxact] useReadonlySearchParams cannot be used on the server without a "getServerDefaultValue" function')}function y(e){const{subscribe:r}=n(h);return s(r,m,null==e?v:()=>{const r=e();return r instanceof u?r:new u(r)})}export{p as ReadonlySearchParamsProvider,u as ReadonlyURLSearchParams,y as useReadonlySearchParams};
|