foxact 0.2.32 → 0.2.34

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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
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,23 +69,77 @@
66
69
  "exports": {
67
70
  "./package.json": "./package.json",
68
71
  "./sizes.json": "./sizes.json",
69
- "./rem": {
70
- "types": "./rem/index.d.ts",
72
+ "./use-next-pathname": {
73
+ "types": "./use-next-pathname/index.d.ts",
71
74
  "import": {
72
- "types": "./rem/index.d.ts",
73
- "default": "./rem/index.mjs"
75
+ "types": "./use-next-pathname/index.d.ts",
76
+ "default": "./use-next-pathname/index.mjs"
74
77
  },
75
- "require": "./rem/index.cjs",
76
- "default": "./rem/index.js"
78
+ "require": "./use-next-pathname/index.cjs",
79
+ "default": "./use-next-pathname/index.js"
77
80
  },
78
- "./current-year": {
79
- "types": "./current-year/index.d.ts",
81
+ "./use-abortable-effect": {
82
+ "types": "./use-abortable-effect/index.d.ts",
80
83
  "import": {
81
- "types": "./current-year/index.d.ts",
82
- "default": "./current-year/index.mjs"
84
+ "types": "./use-abortable-effect/index.d.ts",
85
+ "default": "./use-abortable-effect/index.mjs"
83
86
  },
84
- "require": "./current-year/index.cjs",
85
- "default": "./current-year/index.js"
87
+ "require": "./use-abortable-effect/index.cjs",
88
+ "default": "./use-abortable-effect/index.js"
89
+ },
90
+ "./noop": {
91
+ "types": "./noop/index.d.ts",
92
+ "import": {
93
+ "types": "./noop/index.d.ts",
94
+ "default": "./noop/index.mjs"
95
+ },
96
+ "require": "./noop/index.cjs",
97
+ "default": "./noop/index.js"
98
+ },
99
+ "./use-singleton": {
100
+ "types": "./use-singleton/index.d.ts",
101
+ "import": {
102
+ "types": "./use-singleton/index.d.ts",
103
+ "default": "./use-singleton/index.mjs"
104
+ },
105
+ "require": "./use-singleton/index.cjs",
106
+ "default": "./use-singleton/index.js"
107
+ },
108
+ "./use-retimer": {
109
+ "types": "./use-retimer/index.d.ts",
110
+ "import": {
111
+ "types": "./use-retimer/index.d.ts",
112
+ "default": "./use-retimer/index.mjs"
113
+ },
114
+ "require": "./use-retimer/index.cjs",
115
+ "default": "./use-retimer/index.js"
116
+ },
117
+ "./use-url-hash-state": {
118
+ "types": "./use-url-hash-state/index.d.ts",
119
+ "import": {
120
+ "types": "./use-url-hash-state/index.d.ts",
121
+ "default": "./use-url-hash-state/index.mjs"
122
+ },
123
+ "require": "./use-url-hash-state/index.cjs",
124
+ "default": "./use-url-hash-state/index.js"
125
+ },
126
+ "./use-next-link": {
127
+ "types": "./use-next-link/index.d.ts",
128
+ "import": {
129
+ "types": "./use-next-link/index.d.ts",
130
+ "default": "./use-next-link/index.mjs"
131
+ },
132
+ "require": "./use-next-link/index.cjs",
133
+ "default": "./use-next-link/index.js"
134
+ },
135
+ "./invariant": {
136
+ "types": "./invariant/index.d.ts",
137
+ "import": {
138
+ "types": "./invariant/index.d.ts",
139
+ "default": "./invariant/index.mjs"
140
+ },
141
+ "require": "./invariant/index.cjs",
142
+ "default": "./invariant/index.js"
86
143
  },
87
144
  "./context-state": {
88
145
  "types": "./context-state/index.d.ts",
@@ -93,41 +150,32 @@
93
150
  "require": "./context-state/index.cjs",
94
151
  "default": "./context-state/index.js"
95
152
  },
96
- "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
97
- "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
98
- "import": {
99
- "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
100
- "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
101
- },
102
- "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
103
- "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
104
- },
105
- "./create-fixed-array": {
106
- "types": "./create-fixed-array/index.d.ts",
153
+ "./current-year": {
154
+ "types": "./current-year/index.d.ts",
107
155
  "import": {
108
- "types": "./create-fixed-array/index.d.ts",
109
- "default": "./create-fixed-array/index.mjs"
156
+ "types": "./current-year/index.d.ts",
157
+ "default": "./current-year/index.mjs"
110
158
  },
111
- "require": "./create-fixed-array/index.cjs",
112
- "default": "./create-fixed-array/index.js"
159
+ "require": "./current-year/index.cjs",
160
+ "default": "./current-year/index.js"
113
161
  },
114
- "./request-idle-callback": {
115
- "types": "./request-idle-callback/index.d.ts",
162
+ "./use": {
163
+ "types": "./use/index.d.ts",
116
164
  "import": {
117
- "types": "./request-idle-callback/index.d.ts",
118
- "default": "./request-idle-callback/index.mjs"
165
+ "types": "./use/index.d.ts",
166
+ "default": "./use/index.mjs"
119
167
  },
120
- "require": "./request-idle-callback/index.cjs",
121
- "default": "./request-idle-callback/index.js"
168
+ "require": "./use/index.cjs",
169
+ "default": "./use/index.js"
122
170
  },
123
- "./use-isomorphic-layout-effect": {
124
- "types": "./use-isomorphic-layout-effect/index.d.ts",
171
+ "./use-map": {
172
+ "types": "./use-map/index.d.ts",
125
173
  "import": {
126
- "types": "./use-isomorphic-layout-effect/index.d.ts",
127
- "default": "./use-isomorphic-layout-effect/index.mjs"
174
+ "types": "./use-map/index.d.ts",
175
+ "default": "./use-map/index.mjs"
128
176
  },
129
- "require": "./use-isomorphic-layout-effect/index.cjs",
130
- "default": "./use-isomorphic-layout-effect/index.js"
177
+ "require": "./use-map/index.cjs",
178
+ "default": "./use-map/index.js"
131
179
  },
132
180
  "./use-is-client": {
133
181
  "types": "./use-is-client/index.d.ts",
@@ -138,41 +186,41 @@
138
186
  "require": "./use-is-client/index.cjs",
139
187
  "default": "./use-is-client/index.js"
140
188
  },
141
- "./use-uncontrolled": {
142
- "types": "./use-uncontrolled/index.d.ts",
189
+ "./use-debounced-state": {
190
+ "types": "./use-debounced-state/index.d.ts",
143
191
  "import": {
144
- "types": "./use-uncontrolled/index.d.ts",
145
- "default": "./use-uncontrolled/index.mjs"
192
+ "types": "./use-debounced-state/index.d.ts",
193
+ "default": "./use-debounced-state/index.mjs"
146
194
  },
147
- "require": "./use-uncontrolled/index.cjs",
148
- "default": "./use-uncontrolled/index.js"
195
+ "require": "./use-debounced-state/index.cjs",
196
+ "default": "./use-debounced-state/index.js"
149
197
  },
150
- "./use-session-storage": {
151
- "types": "./use-session-storage/index.d.ts",
198
+ "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
199
+ "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
152
200
  "import": {
153
- "types": "./use-session-storage/index.d.ts",
154
- "default": "./use-session-storage/index.mjs"
201
+ "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
202
+ "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
155
203
  },
156
- "require": "./use-session-storage/index.cjs",
157
- "default": "./use-session-storage/index.js"
204
+ "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
205
+ "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
158
206
  },
159
- "./use-react-router-enable-concurrent-navigation": {
160
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
207
+ "./use-media-query": {
208
+ "types": "./use-media-query/index.d.ts",
161
209
  "import": {
162
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
163
- "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
210
+ "types": "./use-media-query/index.d.ts",
211
+ "default": "./use-media-query/index.mjs"
164
212
  },
165
- "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
166
- "default": "./use-react-router-enable-concurrent-navigation/index.js"
213
+ "require": "./use-media-query/index.cjs",
214
+ "default": "./use-media-query/index.js"
167
215
  },
168
- "./noop": {
169
- "types": "./noop/index.d.ts",
216
+ "./use-uncontrolled": {
217
+ "types": "./use-uncontrolled/index.d.ts",
170
218
  "import": {
171
- "types": "./noop/index.d.ts",
172
- "default": "./noop/index.mjs"
219
+ "types": "./use-uncontrolled/index.d.ts",
220
+ "default": "./use-uncontrolled/index.mjs"
173
221
  },
174
- "require": "./noop/index.cjs",
175
- "default": "./noop/index.js"
222
+ "require": "./use-uncontrolled/index.cjs",
223
+ "default": "./use-uncontrolled/index.js"
176
224
  },
177
225
  "./use-react-router-is-match": {
178
226
  "types": "./use-react-router-is-match/index.d.ts",
@@ -183,23 +231,32 @@
183
231
  "require": "./use-react-router-is-match/index.cjs",
184
232
  "default": "./use-react-router-is-match/index.js"
185
233
  },
186
- "./use-next-pathname": {
187
- "types": "./use-next-pathname/index.d.ts",
234
+ "./create-storage-hook": {
235
+ "types": "./create-storage-hook/index.d.ts",
188
236
  "import": {
189
- "types": "./use-next-pathname/index.d.ts",
190
- "default": "./use-next-pathname/index.mjs"
237
+ "types": "./create-storage-hook/index.d.ts",
238
+ "default": "./create-storage-hook/index.mjs"
191
239
  },
192
- "require": "./use-next-pathname/index.cjs",
193
- "default": "./use-next-pathname/index.js"
240
+ "require": "./create-storage-hook/index.cjs",
241
+ "default": "./create-storage-hook/index.js"
194
242
  },
195
- "./create-context-state": {
196
- "types": "./create-context-state/index.d.ts",
243
+ "./create-fixed-array": {
244
+ "types": "./create-fixed-array/index.d.ts",
197
245
  "import": {
198
- "types": "./create-context-state/index.d.ts",
199
- "default": "./create-context-state/index.mjs"
246
+ "types": "./create-fixed-array/index.d.ts",
247
+ "default": "./create-fixed-array/index.mjs"
200
248
  },
201
- "require": "./create-context-state/index.cjs",
202
- "default": "./create-context-state/index.js"
249
+ "require": "./create-fixed-array/index.cjs",
250
+ "default": "./create-fixed-array/index.js"
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"
203
260
  },
204
261
  "./use-clipboard": {
205
262
  "types": "./use-clipboard/index.d.ts",
@@ -210,23 +267,32 @@
210
267
  "require": "./use-clipboard/index.cjs",
211
268
  "default": "./use-clipboard/index.js"
212
269
  },
213
- "./use-singleton": {
214
- "types": "./use-singleton/index.d.ts",
270
+ "./compose-context-provider": {
271
+ "types": "./compose-context-provider/index.d.ts",
215
272
  "import": {
216
- "types": "./use-singleton/index.d.ts",
217
- "default": "./use-singleton/index.mjs"
273
+ "types": "./compose-context-provider/index.d.ts",
274
+ "default": "./compose-context-provider/index.mjs"
218
275
  },
219
- "require": "./use-singleton/index.cjs",
220
- "default": "./use-singleton/index.js"
276
+ "require": "./compose-context-provider/index.cjs",
277
+ "default": "./compose-context-provider/index.js"
221
278
  },
222
- "./use-map": {
223
- "types": "./use-map/index.d.ts",
279
+ "./request-idle-callback": {
280
+ "types": "./request-idle-callback/index.d.ts",
224
281
  "import": {
225
- "types": "./use-map/index.d.ts",
226
- "default": "./use-map/index.mjs"
282
+ "types": "./request-idle-callback/index.d.ts",
283
+ "default": "./request-idle-callback/index.mjs"
227
284
  },
228
- "require": "./use-map/index.cjs",
229
- "default": "./use-map/index.js"
285
+ "require": "./request-idle-callback/index.cjs",
286
+ "default": "./request-idle-callback/index.js"
287
+ },
288
+ "./use-isomorphic-layout-effect": {
289
+ "types": "./use-isomorphic-layout-effect/index.d.ts",
290
+ "import": {
291
+ "types": "./use-isomorphic-layout-effect/index.d.ts",
292
+ "default": "./use-isomorphic-layout-effect/index.mjs"
293
+ },
294
+ "require": "./use-isomorphic-layout-effect/index.cjs",
295
+ "default": "./use-isomorphic-layout-effect/index.js"
230
296
  },
231
297
  "./use-debounced-value": {
232
298
  "types": "./use-debounced-value/index.d.ts",
@@ -237,59 +303,14 @@
237
303
  "require": "./use-debounced-value/index.cjs",
238
304
  "default": "./use-debounced-value/index.js"
239
305
  },
240
- "./use-url-hash-state": {
241
- "types": "./use-url-hash-state/index.d.ts",
242
- "import": {
243
- "types": "./use-url-hash-state/index.d.ts",
244
- "default": "./use-url-hash-state/index.mjs"
245
- },
246
- "require": "./use-url-hash-state/index.cjs",
247
- "default": "./use-url-hash-state/index.js"
248
- },
249
- "./use-next-link": {
250
- "types": "./use-next-link/index.d.ts",
251
- "import": {
252
- "types": "./use-next-link/index.d.ts",
253
- "default": "./use-next-link/index.mjs"
254
- },
255
- "require": "./use-next-link/index.cjs",
256
- "default": "./use-next-link/index.js"
257
- },
258
- "./use": {
259
- "types": "./use/index.d.ts",
260
- "import": {
261
- "types": "./use/index.d.ts",
262
- "default": "./use/index.mjs"
263
- },
264
- "require": "./use/index.cjs",
265
- "default": "./use/index.js"
266
- },
267
- "./nullthrow": {
268
- "types": "./nullthrow/index.d.ts",
269
- "import": {
270
- "types": "./nullthrow/index.d.ts",
271
- "default": "./nullthrow/index.mjs"
272
- },
273
- "require": "./nullthrow/index.cjs",
274
- "default": "./nullthrow/index.js"
275
- },
276
- "./typescript-happy-forward-ref": {
277
- "types": "./typescript-happy-forward-ref/index.d.ts",
278
- "import": {
279
- "types": "./typescript-happy-forward-ref/index.d.ts",
280
- "default": "./typescript-happy-forward-ref/index.mjs"
281
- },
282
- "require": "./typescript-happy-forward-ref/index.cjs",
283
- "default": "./typescript-happy-forward-ref/index.js"
284
- },
285
- "./use-intersection": {
286
- "types": "./use-intersection/index.d.ts",
306
+ "./use-local-storage": {
307
+ "types": "./use-local-storage/index.d.ts",
287
308
  "import": {
288
- "types": "./use-intersection/index.d.ts",
289
- "default": "./use-intersection/index.mjs"
309
+ "types": "./use-local-storage/index.d.ts",
310
+ "default": "./use-local-storage/index.mjs"
290
311
  },
291
- "require": "./use-intersection/index.cjs",
292
- "default": "./use-intersection/index.js"
312
+ "require": "./use-local-storage/index.cjs",
313
+ "default": "./use-local-storage/index.js"
293
314
  },
294
315
  "./use-set": {
295
316
  "types": "./use-set/index.d.ts",
@@ -300,14 +321,14 @@
300
321
  "require": "./use-set/index.cjs",
301
322
  "default": "./use-set/index.js"
302
323
  },
303
- "./compose-context-provider": {
304
- "types": "./compose-context-provider/index.d.ts",
324
+ "./rem": {
325
+ "types": "./rem/index.d.ts",
305
326
  "import": {
306
- "types": "./compose-context-provider/index.d.ts",
307
- "default": "./compose-context-provider/index.mjs"
327
+ "types": "./rem/index.d.ts",
328
+ "default": "./rem/index.mjs"
308
329
  },
309
- "require": "./compose-context-provider/index.cjs",
310
- "default": "./compose-context-provider/index.js"
330
+ "require": "./rem/index.cjs",
331
+ "default": "./rem/index.js"
311
332
  },
312
333
  "./use-array": {
313
334
  "types": "./use-array/index.d.ts",
@@ -318,50 +339,41 @@
318
339
  "require": "./use-array/index.cjs",
319
340
  "default": "./use-array/index.js"
320
341
  },
321
- "./use-debounced-state": {
322
- "types": "./use-debounced-state/index.d.ts",
323
- "import": {
324
- "types": "./use-debounced-state/index.d.ts",
325
- "default": "./use-debounced-state/index.mjs"
326
- },
327
- "require": "./use-debounced-state/index.cjs",
328
- "default": "./use-debounced-state/index.js"
329
- },
330
- "./create-storage-hook": {
331
- "types": "./create-storage-hook/index.d.ts",
342
+ "./typescript-happy-forward-ref": {
343
+ "types": "./typescript-happy-forward-ref/index.d.ts",
332
344
  "import": {
333
- "types": "./create-storage-hook/index.d.ts",
334
- "default": "./create-storage-hook/index.mjs"
345
+ "types": "./typescript-happy-forward-ref/index.d.ts",
346
+ "default": "./typescript-happy-forward-ref/index.mjs"
335
347
  },
336
- "require": "./create-storage-hook/index.cjs",
337
- "default": "./create-storage-hook/index.js"
348
+ "require": "./typescript-happy-forward-ref/index.cjs",
349
+ "default": "./typescript-happy-forward-ref/index.js"
338
350
  },
339
- "./use-retimer": {
340
- "types": "./use-retimer/index.d.ts",
351
+ "./use-session-storage": {
352
+ "types": "./use-session-storage/index.d.ts",
341
353
  "import": {
342
- "types": "./use-retimer/index.d.ts",
343
- "default": "./use-retimer/index.mjs"
354
+ "types": "./use-session-storage/index.d.ts",
355
+ "default": "./use-session-storage/index.mjs"
344
356
  },
345
- "require": "./use-retimer/index.cjs",
346
- "default": "./use-retimer/index.js"
357
+ "require": "./use-session-storage/index.cjs",
358
+ "default": "./use-session-storage/index.js"
347
359
  },
348
- "./use-local-storage": {
349
- "types": "./use-local-storage/index.d.ts",
360
+ "./no-ssr": {
361
+ "types": "./no-ssr/index.d.ts",
350
362
  "import": {
351
- "types": "./use-local-storage/index.d.ts",
352
- "default": "./use-local-storage/index.mjs"
363
+ "types": "./no-ssr/index.d.ts",
364
+ "default": "./no-ssr/index.mjs"
353
365
  },
354
- "require": "./use-local-storage/index.cjs",
355
- "default": "./use-local-storage/index.js"
366
+ "require": "./no-ssr/index.cjs",
367
+ "default": "./no-ssr/index.js"
356
368
  },
357
- "./invariant": {
358
- "types": "./invariant/index.d.ts",
369
+ "./nullthrow": {
370
+ "types": "./nullthrow/index.d.ts",
359
371
  "import": {
360
- "types": "./invariant/index.d.ts",
361
- "default": "./invariant/index.mjs"
372
+ "types": "./nullthrow/index.d.ts",
373
+ "default": "./nullthrow/index.mjs"
362
374
  },
363
- "require": "./invariant/index.cjs",
364
- "default": "./invariant/index.js"
375
+ "require": "./nullthrow/index.cjs",
376
+ "default": "./nullthrow/index.js"
365
377
  },
366
378
  "./use-error-boundary": {
367
379
  "types": "./use-error-boundary/index.d.ts",
@@ -372,6 +384,24 @@
372
384
  "require": "./use-error-boundary/index.cjs",
373
385
  "default": "./use-error-boundary/index.js"
374
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
+ },
396
+ "./create-context-state": {
397
+ "types": "./create-context-state/index.d.ts",
398
+ "import": {
399
+ "types": "./create-context-state/index.d.ts",
400
+ "default": "./create-context-state/index.mjs"
401
+ },
402
+ "require": "./create-context-state/index.cjs",
403
+ "default": "./create-context-state/index.js"
404
+ },
375
405
  "./use-composition-input": {
376
406
  "types": "./use-composition-input/index.d.ts",
377
407
  "import": {
@@ -380,15 +410,6 @@
380
410
  },
381
411
  "require": "./use-composition-input/index.cjs",
382
412
  "default": "./use-composition-input/index.js"
383
- },
384
- "./no-ssr": {
385
- "types": "./no-ssr/index.d.ts",
386
- "import": {
387
- "types": "./no-ssr/index.d.ts",
388
- "default": "./no-ssr/index.mjs"
389
- },
390
- "require": "./no-ssr/index.cjs",
391
- "default": "./no-ssr/index.js"
392
413
  }
393
414
  }
394
415
  }
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":17335,"gzip":10571,"br":0},"exports":{"context-state":{"raw":377,"gzip":241,"br":207},"rem":{"raw":734,"gzip":380,"br":333},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":113},"use-is-client":{"raw":151,"gzip":142,"br":118},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"create-fixed-array":{"raw":100,"gzip":104,"br":89},"use-uncontrolled":{"raw":296,"gzip":227,"br":193},"use-session-storage":{"raw":316,"gzip":181,"br":152},"noop":{"raw":33,"gzip":53,"br":37},"use-react-router-enable-concurrent-navigation":{"raw":960,"gzip":470,"br":387},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":254},"create-context-state":{"raw":145,"gzip":116,"br":96},"use-next-pathname":{"raw":321,"gzip":236,"br":199},"use-singleton":{"raw":138,"gzip":129,"br":109},"use-react-router-is-match":{"raw":568,"gzip":371,"br":309},"current-year":{"raw":592,"gzip":400,"br":326},"use-debounced-value":{"raw":470,"gzip":309,"br":252},"use-clipboard":{"raw":1067,"gzip":611,"br":524},"use-map":{"raw":346,"gzip":244,"br":210},"use-url-hash-state":{"raw":1069,"gzip":612,"br":534},"use":{"raw":276,"gzip":182,"br":150},"nullthrow":{"raw":194,"gzip":167,"br":128},"use-set":{"raw":347,"gzip":240,"br":203},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-next-link":{"raw":1588,"gzip":845,"br":728},"compose-context-provider":{"raw":177,"gzip":155,"br":122},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-array":{"raw":329,"gzip":238,"br":199},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"invariant":{"raw":178,"gzip":156,"br":118},"use-error-boundary":{"raw":244,"gzip":196,"br":159},"use-retimer":{"raw":200,"gzip":165,"br":123},"use-composition-input":{"raw":454,"gzip":281,"br":238},"create-storage-hook":{"raw":2090,"gzip":890,"br":773},"no-ssr":{"raw":468,"gzip":318,"br":266}}}
1
+ {"total":{"raw":18275,"gzip":11149,"br":0},"exports":{"use-abortable-effect":{"raw":210,"gzip":166,"br":150},"use-next-pathname":{"raw":321,"gzip":236,"br":199},"noop":{"raw":33,"gzip":53,"br":37},"use-singleton":{"raw":138,"gzip":129,"br":109},"use-retimer":{"raw":200,"gzip":165,"br":123},"invariant":{"raw":178,"gzip":156,"br":118},"context-state":{"raw":377,"gzip":241,"br":207},"use-url-hash-state":{"raw":1069,"gzip":612,"br":534},"use":{"raw":276,"gzip":182,"br":150},"current-year":{"raw":592,"gzip":400,"br":326},"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-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":113},"create-storage-hook":{"raw":2090,"gzip":890,"br":773},"use-clipboard":{"raw":1067,"gzip":611,"br":524},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-debounced-value":{"raw":470,"gzip":309,"br":252},"use-set":{"raw":347,"gzip":240,"br":203},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"use-array":{"raw":329,"gzip":238,"br":199},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-session-storage":{"raw":316,"gzip":181,"br":152},"nullthrow":{"raw":194,"gzip":167,"br":128},"use-error-boundary":{"raw":244,"gzip":196,"br":159},"no-ssr":{"raw":468,"gzip":318,"br":266},"rem":{"raw":734,"gzip":380,"br":333},"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}}}
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");const r=(r,t)=>{e.useEffect(()=>{const e=new AbortController,t=r(e.signal);return()=>{e.abort(),null==t||t()}},t)};exports.useAbortableEffect=r,exports.useEffect=r;
@@ -0,0 +1,7 @@
1
+ import { EffectCallback, DependencyList } from 'react';
2
+
3
+ /** @see https://foxact.skk.moe/use-abortable-effect */
4
+ declare const useAbortableEffect: (callback: (signal: AbortSignal) => ReturnType<EffectCallback>, deps: DependencyList) => void;
5
+ declare const useEffect: (callback: (signal: AbortSignal) => ReturnType<EffectCallback>, deps: DependencyList) => void;
6
+
7
+ export { useAbortableEffect, useEffect };
@@ -0,0 +1 @@
1
+ "use strict";require("client-only");var e=require("react");const r=(r,t)=>{e.useEffect(()=>{const e=new AbortController,t=r(e.signal);return()=>{e.abort(),null==t||t()}},t)};exports.useAbortableEffect=r,exports.useEffect=r;
@@ -0,0 +1 @@
1
+ import"client-only";import{useEffect as t}from"react";const e=(e,o)=>{t(()=>{const t=new AbortController,o=e(t.signal);return()=>{t.abort(),null==o||o()}},o)},o=e;export{e as useAbortableEffect,o as useEffect};
@@ -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 };
@@ -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};