foxact 0.2.40 → 0.2.41

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.2.40",
3
+ "version": "0.2.41",
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": {
@@ -78,15 +78,6 @@
78
78
  "require": "./compose-context-provider/index.cjs",
79
79
  "default": "./compose-context-provider/index.js"
80
80
  },
81
- "./create-fixed-array": {
82
- "types": "./create-fixed-array/index.d.ts",
83
- "import": {
84
- "types": "./create-fixed-array/index.d.ts",
85
- "default": "./create-fixed-array/index.mjs"
86
- },
87
- "require": "./create-fixed-array/index.cjs",
88
- "default": "./create-fixed-array/index.js"
89
- },
90
81
  "./create-context-state": {
91
82
  "types": "./create-context-state/index.d.ts",
92
83
  "import": {
@@ -96,14 +87,23 @@
96
87
  "require": "./create-context-state/index.cjs",
97
88
  "default": "./create-context-state/index.js"
98
89
  },
99
- "./create-local-storage-state": {
100
- "types": "./create-local-storage-state/index.d.ts",
90
+ "./create-fixed-array": {
91
+ "types": "./create-fixed-array/index.d.ts",
101
92
  "import": {
102
- "types": "./create-local-storage-state/index.d.ts",
103
- "default": "./create-local-storage-state/index.mjs"
93
+ "types": "./create-fixed-array/index.d.ts",
94
+ "default": "./create-fixed-array/index.mjs"
104
95
  },
105
- "require": "./create-local-storage-state/index.cjs",
106
- "default": "./create-local-storage-state/index.js"
96
+ "require": "./create-fixed-array/index.cjs",
97
+ "default": "./create-fixed-array/index.js"
98
+ },
99
+ "./context-state": {
100
+ "types": "./context-state/index.d.ts",
101
+ "import": {
102
+ "types": "./context-state/index.d.ts",
103
+ "default": "./context-state/index.mjs"
104
+ },
105
+ "require": "./context-state/index.cjs",
106
+ "default": "./context-state/index.js"
107
107
  },
108
108
  "./create-session-storage-state": {
109
109
  "types": "./create-session-storage-state/index.d.ts",
@@ -123,6 +123,15 @@
123
123
  "require": "./create-storage-hook/index.cjs",
124
124
  "default": "./create-storage-hook/index.js"
125
125
  },
126
+ "./create-local-storage-state": {
127
+ "types": "./create-local-storage-state/index.d.ts",
128
+ "import": {
129
+ "types": "./create-local-storage-state/index.d.ts",
130
+ "default": "./create-local-storage-state/index.mjs"
131
+ },
132
+ "require": "./create-local-storage-state/index.cjs",
133
+ "default": "./create-local-storage-state/index.js"
134
+ },
126
135
  "./create-storage-state-factory": {
127
136
  "types": "./create-storage-state-factory/index.d.ts",
128
137
  "import": {
@@ -150,15 +159,6 @@
150
159
  "require": "./invariant/index.cjs",
151
160
  "default": "./invariant/index.js"
152
161
  },
153
- "./context-state": {
154
- "types": "./context-state/index.d.ts",
155
- "import": {
156
- "types": "./context-state/index.d.ts",
157
- "default": "./context-state/index.mjs"
158
- },
159
- "require": "./context-state/index.cjs",
160
- "default": "./context-state/index.js"
161
- },
162
162
  "./no-ssr": {
163
163
  "types": "./no-ssr/index.d.ts",
164
164
  "import": {
@@ -186,14 +186,14 @@
186
186
  "require": "./nullthrow/index.cjs",
187
187
  "default": "./nullthrow/index.js"
188
188
  },
189
- "./rem": {
190
- "types": "./rem/index.d.ts",
189
+ "./request-idle-callback": {
190
+ "types": "./request-idle-callback/index.d.ts",
191
191
  "import": {
192
- "types": "./rem/index.d.ts",
193
- "default": "./rem/index.mjs"
192
+ "types": "./request-idle-callback/index.d.ts",
193
+ "default": "./request-idle-callback/index.mjs"
194
194
  },
195
- "require": "./rem/index.cjs",
196
- "default": "./rem/index.js"
195
+ "require": "./request-idle-callback/index.cjs",
196
+ "default": "./request-idle-callback/index.js"
197
197
  },
198
198
  "./types": {
199
199
  "types": "./types/index.d.ts",
@@ -204,15 +204,6 @@
204
204
  "require": "./types/index.cjs",
205
205
  "default": "./types/index.js"
206
206
  },
207
- "./use": {
208
- "types": "./use/index.d.ts",
209
- "import": {
210
- "types": "./use/index.d.ts",
211
- "default": "./use/index.mjs"
212
- },
213
- "require": "./use/index.cjs",
214
- "default": "./use/index.js"
215
- },
216
207
  "./typescript-happy-forward-ref": {
217
208
  "types": "./typescript-happy-forward-ref/index.d.ts",
218
209
  "import": {
@@ -222,6 +213,15 @@
222
213
  "require": "./typescript-happy-forward-ref/index.cjs",
223
214
  "default": "./typescript-happy-forward-ref/index.js"
224
215
  },
216
+ "./use": {
217
+ "types": "./use/index.d.ts",
218
+ "import": {
219
+ "types": "./use/index.d.ts",
220
+ "default": "./use/index.mjs"
221
+ },
222
+ "require": "./use/index.cjs",
223
+ "default": "./use/index.js"
224
+ },
225
225
  "./use-abortable-effect": {
226
226
  "types": "./use-abortable-effect/index.d.ts",
227
227
  "import": {
@@ -240,15 +240,6 @@
240
240
  "require": "./use-array/index.cjs",
241
241
  "default": "./use-array/index.js"
242
242
  },
243
- "./use-component-will-receive-update": {
244
- "types": "./use-component-will-receive-update/index.d.ts",
245
- "import": {
246
- "types": "./use-component-will-receive-update/index.d.ts",
247
- "default": "./use-component-will-receive-update/index.mjs"
248
- },
249
- "require": "./use-component-will-receive-update/index.cjs",
250
- "default": "./use-component-will-receive-update/index.js"
251
- },
252
243
  "./use-clipboard": {
253
244
  "types": "./use-clipboard/index.d.ts",
254
245
  "import": {
@@ -258,23 +249,23 @@
258
249
  "require": "./use-clipboard/index.cjs",
259
250
  "default": "./use-clipboard/index.js"
260
251
  },
261
- "./request-idle-callback": {
262
- "types": "./request-idle-callback/index.d.ts",
252
+ "./rem": {
253
+ "types": "./rem/index.d.ts",
263
254
  "import": {
264
- "types": "./request-idle-callback/index.d.ts",
265
- "default": "./request-idle-callback/index.mjs"
255
+ "types": "./rem/index.d.ts",
256
+ "default": "./rem/index.mjs"
266
257
  },
267
- "require": "./request-idle-callback/index.cjs",
268
- "default": "./request-idle-callback/index.js"
258
+ "require": "./rem/index.cjs",
259
+ "default": "./rem/index.js"
269
260
  },
270
- "./use-debounced-state": {
271
- "types": "./use-debounced-state/index.d.ts",
261
+ "./use-component-will-receive-update": {
262
+ "types": "./use-component-will-receive-update/index.d.ts",
272
263
  "import": {
273
- "types": "./use-debounced-state/index.d.ts",
274
- "default": "./use-debounced-state/index.mjs"
264
+ "types": "./use-component-will-receive-update/index.d.ts",
265
+ "default": "./use-component-will-receive-update/index.mjs"
275
266
  },
276
- "require": "./use-debounced-state/index.cjs",
277
- "default": "./use-debounced-state/index.js"
267
+ "require": "./use-component-will-receive-update/index.cjs",
268
+ "default": "./use-component-will-receive-update/index.js"
278
269
  },
279
270
  "./use-composition-input": {
280
271
  "types": "./use-composition-input/index.d.ts",
@@ -285,6 +276,24 @@
285
276
  "require": "./use-composition-input/index.cjs",
286
277
  "default": "./use-composition-input/index.js"
287
278
  },
279
+ "./use-debounced-value": {
280
+ "types": "./use-debounced-value/index.d.ts",
281
+ "import": {
282
+ "types": "./use-debounced-value/index.d.ts",
283
+ "default": "./use-debounced-value/index.mjs"
284
+ },
285
+ "require": "./use-debounced-value/index.cjs",
286
+ "default": "./use-debounced-value/index.js"
287
+ },
288
+ "./use-debounced-state": {
289
+ "types": "./use-debounced-state/index.d.ts",
290
+ "import": {
291
+ "types": "./use-debounced-state/index.d.ts",
292
+ "default": "./use-debounced-state/index.mjs"
293
+ },
294
+ "require": "./use-debounced-state/index.cjs",
295
+ "default": "./use-debounced-state/index.js"
296
+ },
288
297
  "./use-error-boundary": {
289
298
  "types": "./use-error-boundary/index.d.ts",
290
299
  "import": {
@@ -294,14 +303,14 @@
294
303
  "require": "./use-error-boundary/index.cjs",
295
304
  "default": "./use-error-boundary/index.js"
296
305
  },
297
- "./use-debounced-value": {
298
- "types": "./use-debounced-value/index.d.ts",
306
+ "./use-intersection": {
307
+ "types": "./use-intersection/index.d.ts",
299
308
  "import": {
300
- "types": "./use-debounced-value/index.d.ts",
301
- "default": "./use-debounced-value/index.mjs"
309
+ "types": "./use-intersection/index.d.ts",
310
+ "default": "./use-intersection/index.mjs"
302
311
  },
303
- "require": "./use-debounced-value/index.cjs",
304
- "default": "./use-debounced-value/index.js"
312
+ "require": "./use-intersection/index.cjs",
313
+ "default": "./use-intersection/index.js"
305
314
  },
306
315
  "./use-is-client": {
307
316
  "types": "./use-is-client/index.d.ts",
@@ -321,15 +330,6 @@
321
330
  "require": "./use-is-online/index.cjs",
322
331
  "default": "./use-is-online/index.js"
323
332
  },
324
- "./use-intersection": {
325
- "types": "./use-intersection/index.d.ts",
326
- "import": {
327
- "types": "./use-intersection/index.d.ts",
328
- "default": "./use-intersection/index.mjs"
329
- },
330
- "require": "./use-intersection/index.cjs",
331
- "default": "./use-intersection/index.js"
332
- },
333
333
  "./use-isomorphic-layout-effect": {
334
334
  "types": "./use-isomorphic-layout-effect/index.d.ts",
335
335
  "import": {
@@ -339,15 +339,6 @@
339
339
  "require": "./use-isomorphic-layout-effect/index.cjs",
340
340
  "default": "./use-isomorphic-layout-effect/index.js"
341
341
  },
342
- "./use-local-storage": {
343
- "types": "./use-local-storage/index.d.ts",
344
- "import": {
345
- "types": "./use-local-storage/index.d.ts",
346
- "default": "./use-local-storage/index.mjs"
347
- },
348
- "require": "./use-local-storage/index.cjs",
349
- "default": "./use-local-storage/index.js"
350
- },
351
342
  "./use-map": {
352
343
  "types": "./use-map/index.d.ts",
353
344
  "import": {
@@ -357,6 +348,15 @@
357
348
  "require": "./use-map/index.cjs",
358
349
  "default": "./use-map/index.js"
359
350
  },
351
+ "./use-local-storage": {
352
+ "types": "./use-local-storage/index.d.ts",
353
+ "import": {
354
+ "types": "./use-local-storage/index.d.ts",
355
+ "default": "./use-local-storage/index.mjs"
356
+ },
357
+ "require": "./use-local-storage/index.cjs",
358
+ "default": "./use-local-storage/index.js"
359
+ },
360
360
  "./use-media-query": {
361
361
  "types": "./use-media-query/index.d.ts",
362
362
  "import": {
@@ -411,15 +411,6 @@
411
411
  "require": "./use-react-router-is-match/index.cjs",
412
412
  "default": "./use-react-router-is-match/index.js"
413
413
  },
414
- "./use-session-storage": {
415
- "types": "./use-session-storage/index.d.ts",
416
- "import": {
417
- "types": "./use-session-storage/index.d.ts",
418
- "default": "./use-session-storage/index.mjs"
419
- },
420
- "require": "./use-session-storage/index.cjs",
421
- "default": "./use-session-storage/index.js"
422
- },
423
414
  "./use-retimer": {
424
415
  "types": "./use-retimer/index.d.ts",
425
416
  "import": {
@@ -429,6 +420,15 @@
429
420
  "require": "./use-retimer/index.cjs",
430
421
  "default": "./use-retimer/index.js"
431
422
  },
423
+ "./use-session-storage": {
424
+ "types": "./use-session-storage/index.d.ts",
425
+ "import": {
426
+ "types": "./use-session-storage/index.d.ts",
427
+ "default": "./use-session-storage/index.mjs"
428
+ },
429
+ "require": "./use-session-storage/index.cjs",
430
+ "default": "./use-session-storage/index.js"
431
+ },
432
432
  "./use-singleton": {
433
433
  "types": "./use-singleton/index.d.ts",
434
434
  "import": {
@@ -465,15 +465,6 @@
465
465
  "require": "./use-typescript-happy-callback/index.cjs",
466
466
  "default": "./use-typescript-happy-callback/index.js"
467
467
  },
468
- "./use-uncontrolled": {
469
- "types": "./use-uncontrolled/index.d.ts",
470
- "import": {
471
- "types": "./use-uncontrolled/index.d.ts",
472
- "default": "./use-uncontrolled/index.mjs"
473
- },
474
- "require": "./use-uncontrolled/index.cjs",
475
- "default": "./use-uncontrolled/index.js"
476
- },
477
468
  "./use-url-hash-state": {
478
469
  "types": "./use-url-hash-state/index.d.ts",
479
470
  "import": {
@@ -482,6 +473,15 @@
482
473
  },
483
474
  "require": "./use-url-hash-state/index.cjs",
484
475
  "default": "./use-url-hash-state/index.js"
476
+ },
477
+ "./use-uncontrolled": {
478
+ "types": "./use-uncontrolled/index.d.ts",
479
+ "import": {
480
+ "types": "./use-uncontrolled/index.d.ts",
481
+ "default": "./use-uncontrolled/index.mjs"
482
+ },
483
+ "require": "./use-uncontrolled/index.cjs",
484
+ "default": "./use-uncontrolled/index.js"
485
485
  }
486
486
  }
487
487
  }
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":21165,"gzip":12891,"br":0},"exports":{"create-context-state":{"raw":145,"gzip":116,"br":96},"compose-context-provider":{"raw":177,"gzip":155,"br":122},"create-local-storage-state":{"raw":328,"gzip":183,"br":154},"create-fixed-array":{"raw":452,"gzip":282,"br":248},"create-session-storage-state":{"raw":332,"gzip":182,"br":152},"create-storage-state-factory":{"raw":519,"gzip":309,"br":263},"invariant":{"raw":178,"gzip":156,"br":118},"current-year":{"raw":618,"gzip":417,"br":339},"context-state":{"raw":429,"gzip":258,"br":218},"noop":{"raw":33,"gzip":53,"br":37},"no-ssr":{"raw":474,"gzip":316,"br":260},"types":{"raw":0,"gzip":20,"br":1},"nullthrow":{"raw":187,"gzip":163,"br":121},"create-storage-hook":{"raw":2073,"gzip":880,"br":764},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-abortable-effect":{"raw":215,"gzip":170,"br":144},"rem":{"raw":823,"gzip":395,"br":350},"use-array":{"raw":322,"gzip":236,"br":202},"use":{"raw":276,"gzip":182,"br":150},"use-component-will-receive-update":{"raw":207,"gzip":181,"br":153},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-composition-input":{"raw":470,"gzip":286,"br":241},"use-clipboard":{"raw":1177,"gzip":651,"br":552},"use-is-client":{"raw":150,"gzip":145,"br":115},"use-debounced-value":{"raw":524,"gzip":342,"br":286},"use-error-boundary":{"raw":255,"gzip":198,"br":163},"use-is-online":{"raw":335,"gzip":214,"br":160},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":112},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-map":{"raw":339,"gzip":243,"br":208},"use-next-pathname":{"raw":314,"gzip":235,"br":203},"use-page-visibility":{"raw":290,"gzip":206,"br":154},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-media-query":{"raw":738,"gzip":413,"br":332},"use-singleton":{"raw":139,"gzip":130,"br":104},"use-react-router-is-match":{"raw":563,"gzip":372,"br":314},"use-react-router-enable-concurrent-navigation":{"raw":966,"gzip":470,"br":397},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-next-link":{"raw":1615,"gzip":855,"br":737},"use-set":{"raw":340,"gzip":238,"br":203},"use-typescript-happy-callback":{"raw":107,"gzip":102,"br":77},"use-retimer":{"raw":199,"gzip":166,"br":127},"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}}}
1
+ {"total":{"raw":21174,"gzip":12898,"br":0},"exports":{"create-context-state":{"raw":145,"gzip":116,"br":96},"compose-context-provider":{"raw":177,"gzip":155,"br":122},"context-state":{"raw":429,"gzip":258,"br":218},"create-fixed-array":{"raw":452,"gzip":282,"br":248},"create-session-storage-state":{"raw":332,"gzip":182,"br":152},"create-local-storage-state":{"raw":328,"gzip":183,"br":154},"create-storage-state-factory":{"raw":519,"gzip":309,"br":263},"invariant":{"raw":178,"gzip":156,"br":118},"current-year":{"raw":618,"gzip":417,"br":339},"noop":{"raw":33,"gzip":53,"br":37},"types":{"raw":0,"gzip":20,"br":1},"no-ssr":{"raw":474,"gzip":316,"br":260},"create-storage-hook":{"raw":2073,"gzip":880,"br":764},"nullthrow":{"raw":187,"gzip":163,"br":121},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-abortable-effect":{"raw":215,"gzip":170,"br":144},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"use-array":{"raw":322,"gzip":236,"br":202},"use":{"raw":276,"gzip":182,"br":150},"use-component-will-receive-update":{"raw":216,"gzip":188,"br":154},"use-debounced-value":{"raw":524,"gzip":342,"br":286},"rem":{"raw":823,"gzip":395,"br":350},"use-clipboard":{"raw":1177,"gzip":651,"br":552},"use-composition-input":{"raw":470,"gzip":286,"br":241},"use-is-client":{"raw":150,"gzip":145,"br":115},"use-error-boundary":{"raw":255,"gzip":198,"br":163},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-is-online":{"raw":335,"gzip":214,"br":160},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":112},"use-map":{"raw":339,"gzip":243,"br":208},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-media-query":{"raw":738,"gzip":413,"br":332},"use-next-pathname":{"raw":314,"gzip":235,"br":203},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-page-visibility":{"raw":290,"gzip":206,"br":154},"use-react-router-is-match":{"raw":563,"gzip":372,"br":314},"use-retimer":{"raw":199,"gzip":166,"br":127},"use-next-link":{"raw":1615,"gzip":855,"br":737},"use-singleton":{"raw":139,"gzip":130,"br":104},"use-react-router-enable-concurrent-navigation":{"raw":966,"gzip":470,"br":397},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-set":{"raw":340,"gzip":238,"br":203},"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}}}
@@ -1 +1 @@
1
- "use strict";var e=require("react");exports.useComponentWillReceiveUpdate=function(t,n){n=[...n];const[l,r]=e.useState(n);let o=n.length!==l.length;for(let e=0;e<n.length&&!o;e+=1)l[e]!==n[e]&&(o=!0);o&&(r(n),t())};
1
+ "use strict";var e=require("react");exports.useComponentWillReceiveUpdate=function(t,n){n=[...n];const[r,l]=e.useState(n);let o=n.length!==r.length;for(let e=0;e<n.length&&!o;e+=1)r[e]!==n[e]&&(o=!0);return o&&(l(n),t()),o};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @see {https://foxact.skk.moe/use-component-will-receive-update}
3
3
  */
4
- declare function useComponentWillReceiveUpdate(callback: () => void, deps: readonly unknown[]): void;
4
+ declare function useComponentWillReceiveUpdate(callback: () => void, deps: readonly unknown[]): boolean;
5
5
 
6
6
  export { useComponentWillReceiveUpdate };
@@ -1 +1 @@
1
- "use strict";var e=require("react");exports.useComponentWillReceiveUpdate=function(t,n){n=[...n];const[l,r]=e.useState(n);let o=n.length!==l.length;for(let e=0;e<n.length&&!o;e+=1)l[e]!==n[e]&&(o=!0);o&&(r(n),t())};
1
+ "use strict";var e=require("react");exports.useComponentWillReceiveUpdate=function(t,n){n=[...n];const[r,l]=e.useState(n);let o=n.length!==r.length;for(let e=0;e<n.length&&!o;e+=1)r[e]!==n[e]&&(o=!0);return o&&(l(n),t()),o};
@@ -1 +1 @@
1
- import{useState as e}from"react";function t(t,n){const[o,l]=e(n=[...n]);let r=n.length!==o.length;for(let e=0;e<n.length&&!r;e+=1)o[e]!==n[e]&&(r=!0);r&&(l(n),t())}export{t as useComponentWillReceiveUpdate};
1
+ import{useState as e}from"react";function t(t,n){const[o,l]=e(n=[...n]);let r=n.length!==o.length;for(let e=0;e<n.length&&!r;e+=1)o[e]!==n[e]&&(r=!0);return r&&(l(n),t()),r}export{t as useComponentWillReceiveUpdate};