foxact 0.2.42 → 0.2.44

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.
Files changed (62) hide show
  1. package/email-protection/index.cjs +2 -0
  2. package/email-protection/index.d.ts +27 -0
  3. package/email-protection/index.mjs +2 -0
  4. package/fetch-jsonp/index.cjs +1 -1
  5. package/fetch-jsonp/index.mjs +1 -1
  6. package/package.json +138 -120
  7. package/sizes.json +1 -1
  8. package/use-fast-click/index.cjs +1 -0
  9. package/use-fast-click/index.d.ts +5 -0
  10. package/use-fast-click/index.mjs +1 -0
  11. package/use-is-online/index.cjs +1 -1
  12. package/use-is-online/index.d.ts +1 -1
  13. package/use-is-online/index.mjs +1 -1
  14. package/use-next-link/index.cjs +1 -1
  15. package/use-next-link/index.mjs +1 -1
  16. package/compose-context-provider/index.js +0 -1
  17. package/context-state/index.js +0 -1
  18. package/create-context-state/index.js +0 -1
  19. package/create-fixed-array/index.js +0 -1
  20. package/create-local-storage-state/index.js +0 -1
  21. package/create-session-storage-state/index.js +0 -1
  22. package/create-storage-hook/index.js +0 -1
  23. package/create-storage-state-factory/index.js +0 -1
  24. package/current-year/index.js +0 -2
  25. package/fetch-jsonp/index.js +0 -1
  26. package/invariant/index.js +0 -1
  27. package/no-ssr/index.js +0 -1
  28. package/noop/index.js +0 -1
  29. package/nullthrow/index.js +0 -1
  30. package/rem/index.js +0 -1
  31. package/request-idle-callback/index.js +0 -1
  32. package/types/index.js +0 -1
  33. package/typescript-happy-forward-ref/index.js +0 -1
  34. package/use/index.js +0 -1
  35. package/use-abortable-effect/index.js +0 -1
  36. package/use-array/index.js +0 -1
  37. package/use-clipboard/index.js +0 -1
  38. package/use-component-will-receive-update/index.js +0 -1
  39. package/use-composition-input/index.js +0 -1
  40. package/use-debounced-state/index.js +0 -1
  41. package/use-debounced-value/index.js +0 -1
  42. package/use-error-boundary/index.js +0 -1
  43. package/use-intersection/index.js +0 -1
  44. package/use-is-client/index.js +0 -1
  45. package/use-is-online/index.js +0 -2
  46. package/use-isomorphic-layout-effect/index.js +0 -1
  47. package/use-local-storage/index.js +0 -1
  48. package/use-map/index.js +0 -1
  49. package/use-media-query/index.js +0 -2
  50. package/use-next-link/index.js +0 -1
  51. package/use-next-pathname/index.js +0 -1
  52. package/use-page-visibility/index.js +0 -2
  53. package/use-react-router-enable-concurrent-navigation/index.js +0 -2
  54. package/use-react-router-is-match/index.js +0 -1
  55. package/use-retimer/index.js +0 -1
  56. package/use-session-storage/index.js +0 -1
  57. package/use-set/index.js +0 -1
  58. package/use-singleton/index.js +0 -1
  59. package/use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js +0 -1
  60. package/use-typescript-happy-callback/index.js +0 -1
  61. package/use-uncontrolled/index.js +0 -1
  62. package/use-url-hash-state/index.js +0 -1
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ "use strict";var e=require("react"),t=require("../use-isomorphic-layout-effect/index.cjs");require("client-only");const o=e.memo(o=>{let{mailbox:r,domain:i}=o;const[c,s]=e.useState(()=>Math.random().toString(36).slice(2)+"[at]"+i.replace(/\./g,"[dot]"));return t.useIsomorphicLayoutEffect(()=>{s(r+"@"+i)},[i,r]),c});"production"!==process.env.NODE_ENV&&(o.displayName="EmailProtection"),exports.EmailProtection=o;
@@ -0,0 +1,27 @@
1
+ import * as react from 'react';
2
+
3
+ interface EmailProtectionProps {
4
+ /**
5
+ * The mailbox name.
6
+ * If the desired E-Mail addresses are "hello@example.com", then the mailbox name is "hello".
7
+ *
8
+ * By passing the mailbox name and domain separately, the scrapper won't be able to find the
9
+ * mail address even if they scan JavaScript files.
10
+ */
11
+ mailbox: string;
12
+ /**
13
+ * The domain name.
14
+ * If the desired E-Mail addresses are "hello@example.com", then the domain name is "example.com".
15
+ *
16
+ * By passing the mailbox name and domain separately, the scrapper won't be able to find the
17
+ * mail address even if they scan JavaScript files.
18
+ */
19
+ domain: string;
20
+ }
21
+ /**
22
+ * @see https://foxact.skk.moe/email-protection
23
+ *
24
+ */
25
+ declare const EmailProtection: react.MemoExoticComponent<({ mailbox, domain }: Readonly<EmailProtectionProps>) => React.ReactNode>;
26
+
27
+ export { EmailProtection };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{memo as o,useState as t}from"react";import{useIsomorphicLayoutEffect as e}from"../use-isomorphic-layout-effect/index.mjs";import"client-only";const r=o(o=>{let{mailbox:r,domain:i}=o;const[c,n]=t(()=>Math.random().toString(36).slice(2)+"[at]"+i.replace(/\./g,"[dot]"));return e(()=>{n(r+"@"+i)},[i,r]),c});"production"!==process.env.NODE_ENV&&(r.displayName="EmailProtection");export{r as EmailProtection};
@@ -1 +1 @@
1
- "use strict";const e="__foxact_jsonp_callbacks__SECRET_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED";exports.fetchJsonp=function(o){if("undefined"==typeof window)throw TypeError("fetchJsonp is only available in the browser");window[e]||Object.defineProperty(window,e,{value:{},writable:!0,configurable:!0,enumerable:!1});const n="$".concat(Date.now(),"_").concat(Math.random().toString().slice(2),"$"),t="window.".concat(e,".").concat(n);if(Object.prototype.hasOwnProperty.call(window[e],n))throw TypeError("Callback name conflict: ".concat(n));const r=o(t);return new Promise((o,t)=>{const c=document.createElement("script");c.src=r,c.async=!0;const a=()=>{c.removeEventListener("error",i),c.remove(),window[e][n]&&delete window[e][n]};function i(){a(),t(Error("Failed to load script: ".concat(r)))}c.addEventListener("error",i),window[e][n]=e=>{a(),o(e)},document.body.append(c)})};
1
+ "use strict";const e="__foxact_jsonp_callbacks__SECRET_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED";exports.fetchJsonp=function(o){if("undefined"==typeof window)throw TypeError("fetchJsonp is only available in the browser");window[e]||Object.defineProperty(window,e,{value:{},writable:!0,configurable:!0,enumerable:!1});const n="__".concat(Date.now(),"_").concat(Math.random().toString().slice(2),"__"),t="window.".concat(e,".").concat(n);if(Object.prototype.hasOwnProperty.call(window[e],n))throw TypeError("Callback name conflict: ".concat(n));const r=o(t);return new Promise((o,t)=>{const c=document.createElement("script");c.src=r,c.async=!0;const a=()=>{c.removeEventListener("error",i),c.remove(),window[e][n]&&delete window[e][n]};function i(){a(),t(Error("Failed to load script: ".concat(r)))}c.addEventListener("error",i),window[e][n]=e=>{a(),o(e)},document.body.append(c)})};
@@ -1 +1 @@
1
- const e="__foxact_jsonp_callbacks__SECRET_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED";function o(o){if("undefined"==typeof window)throw TypeError("fetchJsonp is only available in the browser");window[e]||Object.defineProperty(window,e,{value:{},writable:!0,configurable:!0,enumerable:!1});const n="$".concat(Date.now(),"_").concat(Math.random().toString().slice(2),"$"),t="window.".concat(e,".").concat(n);if(Object.prototype.hasOwnProperty.call(window[e],n))throw TypeError("Callback name conflict: ".concat(n));const r=o(t);return new Promise((o,t)=>{const c=document.createElement("script");c.src=r,c.async=!0;const a=()=>{c.removeEventListener("error",i),c.remove(),window[e][n]&&delete window[e][n]};function i(){a(),t(Error("Failed to load script: ".concat(r)))}c.addEventListener("error",i),window[e][n]=e=>{a(),o(e)},document.body.append(c)})}export{o as fetchJsonp};
1
+ const e="__foxact_jsonp_callbacks__SECRET_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED";function o(o){if("undefined"==typeof window)throw TypeError("fetchJsonp is only available in the browser");window[e]||Object.defineProperty(window,e,{value:{},writable:!0,configurable:!0,enumerable:!1});const n="__".concat(Date.now(),"_").concat(Math.random().toString().slice(2),"__"),t="window.".concat(e,".").concat(n);if(Object.prototype.hasOwnProperty.call(window[e],n))throw TypeError("Callback name conflict: ".concat(n));const r=o(t);return new Promise((o,t)=>{const c=document.createElement("script");c.src=r,c.async=!0;const a=()=>{c.removeEventListener("error",i),c.remove(),window[e][n]&&delete window[e][n]};function i(){a(),t(Error("Failed to load script: ".concat(r)))}c.addEventListener("error",i),window[e][n]=e=>{a(),o(e)},document.body.append(c)})}export{o as fetchJsonp};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foxact",
3
- "version": "0.2.42",
3
+ "version": "0.2.44",
4
4
  "description": "React Hooks/Utils done right. For browser, SSR, and React Server Components.",
5
5
  "homepage": "https://foxact.skk.moe",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "optional": true
33
33
  }
34
34
  },
35
- "packageManager": "pnpm@9.10.0",
35
+ "packageManager": "pnpm@9.14.4",
36
36
  "pnpm": {
37
37
  "overrides": {
38
38
  "array-includes": "npm:@nolyfill/array-includes@latest",
@@ -76,7 +76,7 @@
76
76
  "default": "./compose-context-provider/index.mjs"
77
77
  },
78
78
  "require": "./compose-context-provider/index.cjs",
79
- "default": "./compose-context-provider/index.js"
79
+ "default": "./compose-context-provider/index.cjs"
80
80
  },
81
81
  "./context-state": {
82
82
  "types": "./context-state/index.d.ts",
@@ -85,7 +85,7 @@
85
85
  "default": "./context-state/index.mjs"
86
86
  },
87
87
  "require": "./context-state/index.cjs",
88
- "default": "./context-state/index.js"
88
+ "default": "./context-state/index.cjs"
89
89
  },
90
90
  "./create-context-state": {
91
91
  "types": "./create-context-state/index.d.ts",
@@ -94,7 +94,7 @@
94
94
  "default": "./create-context-state/index.mjs"
95
95
  },
96
96
  "require": "./create-context-state/index.cjs",
97
- "default": "./create-context-state/index.js"
97
+ "default": "./create-context-state/index.cjs"
98
98
  },
99
99
  "./create-fixed-array": {
100
100
  "types": "./create-fixed-array/index.d.ts",
@@ -103,7 +103,7 @@
103
103
  "default": "./create-fixed-array/index.mjs"
104
104
  },
105
105
  "require": "./create-fixed-array/index.cjs",
106
- "default": "./create-fixed-array/index.js"
106
+ "default": "./create-fixed-array/index.cjs"
107
107
  },
108
108
  "./create-session-storage-state": {
109
109
  "types": "./create-session-storage-state/index.d.ts",
@@ -112,16 +112,7 @@
112
112
  "default": "./create-session-storage-state/index.mjs"
113
113
  },
114
114
  "require": "./create-session-storage-state/index.cjs",
115
- "default": "./create-session-storage-state/index.js"
116
- },
117
- "./create-local-storage-state": {
118
- "types": "./create-local-storage-state/index.d.ts",
119
- "import": {
120
- "types": "./create-local-storage-state/index.d.ts",
121
- "default": "./create-local-storage-state/index.mjs"
122
- },
123
- "require": "./create-local-storage-state/index.cjs",
124
- "default": "./create-local-storage-state/index.js"
115
+ "default": "./create-session-storage-state/index.cjs"
125
116
  },
126
117
  "./create-storage-hook": {
127
118
  "types": "./create-storage-hook/index.d.ts",
@@ -130,7 +121,16 @@
130
121
  "default": "./create-storage-hook/index.mjs"
131
122
  },
132
123
  "require": "./create-storage-hook/index.cjs",
133
- "default": "./create-storage-hook/index.js"
124
+ "default": "./create-storage-hook/index.cjs"
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.cjs"
134
134
  },
135
135
  "./create-storage-state-factory": {
136
136
  "types": "./create-storage-state-factory/index.d.ts",
@@ -139,7 +139,7 @@
139
139
  "default": "./create-storage-state-factory/index.mjs"
140
140
  },
141
141
  "require": "./create-storage-state-factory/index.cjs",
142
- "default": "./create-storage-state-factory/index.js"
142
+ "default": "./create-storage-state-factory/index.cjs"
143
143
  },
144
144
  "./current-year": {
145
145
  "types": "./current-year/index.d.ts",
@@ -148,16 +148,16 @@
148
148
  "default": "./current-year/index.mjs"
149
149
  },
150
150
  "require": "./current-year/index.cjs",
151
- "default": "./current-year/index.js"
151
+ "default": "./current-year/index.cjs"
152
152
  },
153
- "./fetch-jsonp": {
154
- "types": "./fetch-jsonp/index.d.ts",
153
+ "./email-protection": {
154
+ "types": "./email-protection/index.d.ts",
155
155
  "import": {
156
- "types": "./fetch-jsonp/index.d.ts",
157
- "default": "./fetch-jsonp/index.mjs"
156
+ "types": "./email-protection/index.d.ts",
157
+ "default": "./email-protection/index.mjs"
158
158
  },
159
- "require": "./fetch-jsonp/index.cjs",
160
- "default": "./fetch-jsonp/index.js"
159
+ "require": "./email-protection/index.cjs",
160
+ "default": "./email-protection/index.cjs"
161
161
  },
162
162
  "./invariant": {
163
163
  "types": "./invariant/index.d.ts",
@@ -166,7 +166,7 @@
166
166
  "default": "./invariant/index.mjs"
167
167
  },
168
168
  "require": "./invariant/index.cjs",
169
- "default": "./invariant/index.js"
169
+ "default": "./invariant/index.cjs"
170
170
  },
171
171
  "./no-ssr": {
172
172
  "types": "./no-ssr/index.d.ts",
@@ -175,7 +175,7 @@
175
175
  "default": "./no-ssr/index.mjs"
176
176
  },
177
177
  "require": "./no-ssr/index.cjs",
178
- "default": "./no-ssr/index.js"
178
+ "default": "./no-ssr/index.cjs"
179
179
  },
180
180
  "./noop": {
181
181
  "types": "./noop/index.d.ts",
@@ -184,16 +184,7 @@
184
184
  "default": "./noop/index.mjs"
185
185
  },
186
186
  "require": "./noop/index.cjs",
187
- "default": "./noop/index.js"
188
- },
189
- "./rem": {
190
- "types": "./rem/index.d.ts",
191
- "import": {
192
- "types": "./rem/index.d.ts",
193
- "default": "./rem/index.mjs"
194
- },
195
- "require": "./rem/index.cjs",
196
- "default": "./rem/index.js"
187
+ "default": "./noop/index.cjs"
197
188
  },
198
189
  "./nullthrow": {
199
190
  "types": "./nullthrow/index.d.ts",
@@ -202,16 +193,25 @@
202
193
  "default": "./nullthrow/index.mjs"
203
194
  },
204
195
  "require": "./nullthrow/index.cjs",
205
- "default": "./nullthrow/index.js"
196
+ "default": "./nullthrow/index.cjs"
206
197
  },
207
- "./types": {
208
- "types": "./types/index.d.ts",
198
+ "./fetch-jsonp": {
199
+ "types": "./fetch-jsonp/index.d.ts",
209
200
  "import": {
210
- "types": "./types/index.d.ts",
211
- "default": "./types/index.mjs"
201
+ "types": "./fetch-jsonp/index.d.ts",
202
+ "default": "./fetch-jsonp/index.mjs"
212
203
  },
213
- "require": "./types/index.cjs",
214
- "default": "./types/index.js"
204
+ "require": "./fetch-jsonp/index.cjs",
205
+ "default": "./fetch-jsonp/index.cjs"
206
+ },
207
+ "./rem": {
208
+ "types": "./rem/index.d.ts",
209
+ "import": {
210
+ "types": "./rem/index.d.ts",
211
+ "default": "./rem/index.mjs"
212
+ },
213
+ "require": "./rem/index.cjs",
214
+ "default": "./rem/index.cjs"
215
215
  },
216
216
  "./request-idle-callback": {
217
217
  "types": "./request-idle-callback/index.d.ts",
@@ -220,7 +220,16 @@
220
220
  "default": "./request-idle-callback/index.mjs"
221
221
  },
222
222
  "require": "./request-idle-callback/index.cjs",
223
- "default": "./request-idle-callback/index.js"
223
+ "default": "./request-idle-callback/index.cjs"
224
+ },
225
+ "./types": {
226
+ "types": "./types/index.d.ts",
227
+ "import": {
228
+ "types": "./types/index.d.ts",
229
+ "default": "./types/index.mjs"
230
+ },
231
+ "require": "./types/index.cjs",
232
+ "default": "./types/index.cjs"
224
233
  },
225
234
  "./typescript-happy-forward-ref": {
226
235
  "types": "./typescript-happy-forward-ref/index.d.ts",
@@ -229,7 +238,7 @@
229
238
  "default": "./typescript-happy-forward-ref/index.mjs"
230
239
  },
231
240
  "require": "./typescript-happy-forward-ref/index.cjs",
232
- "default": "./typescript-happy-forward-ref/index.js"
241
+ "default": "./typescript-happy-forward-ref/index.cjs"
233
242
  },
234
243
  "./use": {
235
244
  "types": "./use/index.d.ts",
@@ -238,16 +247,7 @@
238
247
  "default": "./use/index.mjs"
239
248
  },
240
249
  "require": "./use/index.cjs",
241
- "default": "./use/index.js"
242
- },
243
- "./use-array": {
244
- "types": "./use-array/index.d.ts",
245
- "import": {
246
- "types": "./use-array/index.d.ts",
247
- "default": "./use-array/index.mjs"
248
- },
249
- "require": "./use-array/index.cjs",
250
- "default": "./use-array/index.js"
250
+ "default": "./use/index.cjs"
251
251
  },
252
252
  "./use-abortable-effect": {
253
253
  "types": "./use-abortable-effect/index.d.ts",
@@ -256,7 +256,16 @@
256
256
  "default": "./use-abortable-effect/index.mjs"
257
257
  },
258
258
  "require": "./use-abortable-effect/index.cjs",
259
- "default": "./use-abortable-effect/index.js"
259
+ "default": "./use-abortable-effect/index.cjs"
260
+ },
261
+ "./use-array": {
262
+ "types": "./use-array/index.d.ts",
263
+ "import": {
264
+ "types": "./use-array/index.d.ts",
265
+ "default": "./use-array/index.mjs"
266
+ },
267
+ "require": "./use-array/index.cjs",
268
+ "default": "./use-array/index.cjs"
260
269
  },
261
270
  "./use-clipboard": {
262
271
  "types": "./use-clipboard/index.d.ts",
@@ -265,7 +274,7 @@
265
274
  "default": "./use-clipboard/index.mjs"
266
275
  },
267
276
  "require": "./use-clipboard/index.cjs",
268
- "default": "./use-clipboard/index.js"
277
+ "default": "./use-clipboard/index.cjs"
269
278
  },
270
279
  "./use-component-will-receive-update": {
271
280
  "types": "./use-component-will-receive-update/index.d.ts",
@@ -274,7 +283,7 @@
274
283
  "default": "./use-component-will-receive-update/index.mjs"
275
284
  },
276
285
  "require": "./use-component-will-receive-update/index.cjs",
277
- "default": "./use-component-will-receive-update/index.js"
286
+ "default": "./use-component-will-receive-update/index.cjs"
278
287
  },
279
288
  "./use-composition-input": {
280
289
  "types": "./use-composition-input/index.d.ts",
@@ -283,16 +292,7 @@
283
292
  "default": "./use-composition-input/index.mjs"
284
293
  },
285
294
  "require": "./use-composition-input/index.cjs",
286
- "default": "./use-composition-input/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"
295
+ "default": "./use-composition-input/index.cjs"
296
296
  },
297
297
  "./use-debounced-value": {
298
298
  "types": "./use-debounced-value/index.d.ts",
@@ -301,7 +301,7 @@
301
301
  "default": "./use-debounced-value/index.mjs"
302
302
  },
303
303
  "require": "./use-debounced-value/index.cjs",
304
- "default": "./use-debounced-value/index.js"
304
+ "default": "./use-debounced-value/index.cjs"
305
305
  },
306
306
  "./use-error-boundary": {
307
307
  "types": "./use-error-boundary/index.d.ts",
@@ -310,16 +310,25 @@
310
310
  "default": "./use-error-boundary/index.mjs"
311
311
  },
312
312
  "require": "./use-error-boundary/index.cjs",
313
- "default": "./use-error-boundary/index.js"
313
+ "default": "./use-error-boundary/index.cjs"
314
314
  },
315
- "./use-is-client": {
316
- "types": "./use-is-client/index.d.ts",
315
+ "./use-fast-click": {
316
+ "types": "./use-fast-click/index.d.ts",
317
317
  "import": {
318
- "types": "./use-is-client/index.d.ts",
319
- "default": "./use-is-client/index.mjs"
318
+ "types": "./use-fast-click/index.d.ts",
319
+ "default": "./use-fast-click/index.mjs"
320
320
  },
321
- "require": "./use-is-client/index.cjs",
322
- "default": "./use-is-client/index.js"
321
+ "require": "./use-fast-click/index.cjs",
322
+ "default": "./use-fast-click/index.cjs"
323
+ },
324
+ "./use-debounced-state": {
325
+ "types": "./use-debounced-state/index.d.ts",
326
+ "import": {
327
+ "types": "./use-debounced-state/index.d.ts",
328
+ "default": "./use-debounced-state/index.mjs"
329
+ },
330
+ "require": "./use-debounced-state/index.cjs",
331
+ "default": "./use-debounced-state/index.cjs"
323
332
  },
324
333
  "./use-intersection": {
325
334
  "types": "./use-intersection/index.d.ts",
@@ -328,7 +337,16 @@
328
337
  "default": "./use-intersection/index.mjs"
329
338
  },
330
339
  "require": "./use-intersection/index.cjs",
331
- "default": "./use-intersection/index.js"
340
+ "default": "./use-intersection/index.cjs"
341
+ },
342
+ "./use-is-client": {
343
+ "types": "./use-is-client/index.d.ts",
344
+ "import": {
345
+ "types": "./use-is-client/index.d.ts",
346
+ "default": "./use-is-client/index.mjs"
347
+ },
348
+ "require": "./use-is-client/index.cjs",
349
+ "default": "./use-is-client/index.cjs"
332
350
  },
333
351
  "./use-is-online": {
334
352
  "types": "./use-is-online/index.d.ts",
@@ -337,7 +355,7 @@
337
355
  "default": "./use-is-online/index.mjs"
338
356
  },
339
357
  "require": "./use-is-online/index.cjs",
340
- "default": "./use-is-online/index.js"
358
+ "default": "./use-is-online/index.cjs"
341
359
  },
342
360
  "./use-isomorphic-layout-effect": {
343
361
  "types": "./use-isomorphic-layout-effect/index.d.ts",
@@ -346,7 +364,7 @@
346
364
  "default": "./use-isomorphic-layout-effect/index.mjs"
347
365
  },
348
366
  "require": "./use-isomorphic-layout-effect/index.cjs",
349
- "default": "./use-isomorphic-layout-effect/index.js"
367
+ "default": "./use-isomorphic-layout-effect/index.cjs"
350
368
  },
351
369
  "./use-local-storage": {
352
370
  "types": "./use-local-storage/index.d.ts",
@@ -355,16 +373,7 @@
355
373
  "default": "./use-local-storage/index.mjs"
356
374
  },
357
375
  "require": "./use-local-storage/index.cjs",
358
- "default": "./use-local-storage/index.js"
359
- },
360
- "./use-map": {
361
- "types": "./use-map/index.d.ts",
362
- "import": {
363
- "types": "./use-map/index.d.ts",
364
- "default": "./use-map/index.mjs"
365
- },
366
- "require": "./use-map/index.cjs",
367
- "default": "./use-map/index.js"
376
+ "default": "./use-local-storage/index.cjs"
368
377
  },
369
378
  "./use-media-query": {
370
379
  "types": "./use-media-query/index.d.ts",
@@ -373,7 +382,16 @@
373
382
  "default": "./use-media-query/index.mjs"
374
383
  },
375
384
  "require": "./use-media-query/index.cjs",
376
- "default": "./use-media-query/index.js"
385
+ "default": "./use-media-query/index.cjs"
386
+ },
387
+ "./use-map": {
388
+ "types": "./use-map/index.d.ts",
389
+ "import": {
390
+ "types": "./use-map/index.d.ts",
391
+ "default": "./use-map/index.mjs"
392
+ },
393
+ "require": "./use-map/index.cjs",
394
+ "default": "./use-map/index.cjs"
377
395
  },
378
396
  "./use-next-link": {
379
397
  "types": "./use-next-link/index.d.ts",
@@ -382,7 +400,7 @@
382
400
  "default": "./use-next-link/index.mjs"
383
401
  },
384
402
  "require": "./use-next-link/index.cjs",
385
- "default": "./use-next-link/index.js"
403
+ "default": "./use-next-link/index.cjs"
386
404
  },
387
405
  "./use-next-pathname": {
388
406
  "types": "./use-next-pathname/index.d.ts",
@@ -391,7 +409,7 @@
391
409
  "default": "./use-next-pathname/index.mjs"
392
410
  },
393
411
  "require": "./use-next-pathname/index.cjs",
394
- "default": "./use-next-pathname/index.js"
412
+ "default": "./use-next-pathname/index.cjs"
395
413
  },
396
414
  "./use-page-visibility": {
397
415
  "types": "./use-page-visibility/index.d.ts",
@@ -400,7 +418,25 @@
400
418
  "default": "./use-page-visibility/index.mjs"
401
419
  },
402
420
  "require": "./use-page-visibility/index.cjs",
403
- "default": "./use-page-visibility/index.js"
421
+ "default": "./use-page-visibility/index.cjs"
422
+ },
423
+ "./use-react-router-enable-concurrent-navigation": {
424
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
425
+ "import": {
426
+ "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
427
+ "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
428
+ },
429
+ "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
430
+ "default": "./use-react-router-enable-concurrent-navigation/index.cjs"
431
+ },
432
+ "./use-react-router-is-match": {
433
+ "types": "./use-react-router-is-match/index.d.ts",
434
+ "import": {
435
+ "types": "./use-react-router-is-match/index.d.ts",
436
+ "default": "./use-react-router-is-match/index.mjs"
437
+ },
438
+ "require": "./use-react-router-is-match/index.cjs",
439
+ "default": "./use-react-router-is-match/index.cjs"
404
440
  },
405
441
  "./use-retimer": {
406
442
  "types": "./use-retimer/index.d.ts",
@@ -409,7 +445,7 @@
409
445
  "default": "./use-retimer/index.mjs"
410
446
  },
411
447
  "require": "./use-retimer/index.cjs",
412
- "default": "./use-retimer/index.js"
448
+ "default": "./use-retimer/index.cjs"
413
449
  },
414
450
  "./use-session-storage": {
415
451
  "types": "./use-session-storage/index.d.ts",
@@ -418,16 +454,7 @@
418
454
  "default": "./use-session-storage/index.mjs"
419
455
  },
420
456
  "require": "./use-session-storage/index.cjs",
421
- "default": "./use-session-storage/index.js"
422
- },
423
- "./use-react-router-is-match": {
424
- "types": "./use-react-router-is-match/index.d.ts",
425
- "import": {
426
- "types": "./use-react-router-is-match/index.d.ts",
427
- "default": "./use-react-router-is-match/index.mjs"
428
- },
429
- "require": "./use-react-router-is-match/index.cjs",
430
- "default": "./use-react-router-is-match/index.js"
457
+ "default": "./use-session-storage/index.cjs"
431
458
  },
432
459
  "./use-set": {
433
460
  "types": "./use-set/index.d.ts",
@@ -436,7 +463,7 @@
436
463
  "default": "./use-set/index.mjs"
437
464
  },
438
465
  "require": "./use-set/index.cjs",
439
- "default": "./use-set/index.js"
466
+ "default": "./use-set/index.cjs"
440
467
  },
441
468
  "./use-singleton": {
442
469
  "types": "./use-singleton/index.d.ts",
@@ -445,7 +472,7 @@
445
472
  "default": "./use-singleton/index.mjs"
446
473
  },
447
474
  "require": "./use-singleton/index.cjs",
448
- "default": "./use-singleton/index.js"
475
+ "default": "./use-singleton/index.cjs"
449
476
  },
450
477
  "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
451
478
  "types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
@@ -454,7 +481,7 @@
454
481
  "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs"
455
482
  },
456
483
  "require": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs",
457
- "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"
484
+ "default": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs"
458
485
  },
459
486
  "./use-typescript-happy-callback": {
460
487
  "types": "./use-typescript-happy-callback/index.d.ts",
@@ -463,7 +490,7 @@
463
490
  "default": "./use-typescript-happy-callback/index.mjs"
464
491
  },
465
492
  "require": "./use-typescript-happy-callback/index.cjs",
466
- "default": "./use-typescript-happy-callback/index.js"
493
+ "default": "./use-typescript-happy-callback/index.cjs"
467
494
  },
468
495
  "./use-uncontrolled": {
469
496
  "types": "./use-uncontrolled/index.d.ts",
@@ -472,7 +499,7 @@
472
499
  "default": "./use-uncontrolled/index.mjs"
473
500
  },
474
501
  "require": "./use-uncontrolled/index.cjs",
475
- "default": "./use-uncontrolled/index.js"
502
+ "default": "./use-uncontrolled/index.cjs"
476
503
  },
477
504
  "./use-url-hash-state": {
478
505
  "types": "./use-url-hash-state/index.d.ts",
@@ -481,16 +508,7 @@
481
508
  "default": "./use-url-hash-state/index.mjs"
482
509
  },
483
510
  "require": "./use-url-hash-state/index.cjs",
484
- "default": "./use-url-hash-state/index.js"
485
- },
486
- "./use-react-router-enable-concurrent-navigation": {
487
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
488
- "import": {
489
- "types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
490
- "default": "./use-react-router-enable-concurrent-navigation/index.mjs"
491
- },
492
- "require": "./use-react-router-enable-concurrent-navigation/index.cjs",
493
- "default": "./use-react-router-enable-concurrent-navigation/index.js"
511
+ "default": "./use-url-hash-state/index.cjs"
494
512
  }
495
513
  }
496
514
  }
package/sizes.json CHANGED
@@ -1 +1 @@
1
- {"total":{"raw":22047,"gzip":13435,"br":0},"exports":{"compose-context-provider":{"raw":177,"gzip":155,"br":122},"context-state":{"raw":429,"gzip":258,"br":218},"create-context-state":{"raw":145,"gzip":116,"br":96},"create-fixed-array":{"raw":452,"gzip":282,"br":248},"create-local-storage-state":{"raw":328,"gzip":183,"br":154},"create-session-storage-state":{"raw":332,"gzip":182,"br":152},"create-storage-state-factory":{"raw":519,"gzip":309,"br":263},"current-year":{"raw":618,"gzip":417,"br":339},"invariant":{"raw":178,"gzip":156,"br":118},"fetch-jsonp":{"raw":873,"gzip":537,"br":420},"noop":{"raw":33,"gzip":53,"br":37},"create-storage-hook":{"raw":2073,"gzip":880,"br":764},"types":{"raw":0,"gzip":20,"br":1},"no-ssr":{"raw":474,"gzip":316,"br":260},"nullthrow":{"raw":187,"gzip":163,"br":121},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"rem":{"raw":823,"gzip":395,"br":350},"use-array":{"raw":322,"gzip":236,"br":202},"use-abortable-effect":{"raw":215,"gzip":170,"br":144},"use":{"raw":276,"gzip":182,"br":150},"use-component-will-receive-update":{"raw":216,"gzip":188,"br":154},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-composition-input":{"raw":470,"gzip":286,"br":241},"use-debounced-value":{"raw":524,"gzip":342,"br":286},"use-clipboard":{"raw":1177,"gzip":651,"br":552},"use-is-client":{"raw":150,"gzip":145,"br":115},"use-error-boundary":{"raw":255,"gzip":198,"br":163},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":112},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-is-online":{"raw":335,"gzip":214,"br":160},"use-map":{"raw":339,"gzip":243,"br":208},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-next-pathname":{"raw":314,"gzip":235,"br":203},"use-media-query":{"raw":738,"gzip":413,"br":332},"use-page-visibility":{"raw":290,"gzip":206,"br":154},"use-retimer":{"raw":199,"gzip":166,"br":127},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-next-link":{"raw":1615,"gzip":855,"br":737},"use-typescript-happy-callback":{"raw":107,"gzip":102,"br":77},"use-set":{"raw":340,"gzip":238,"br":203},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":249},"use-react-router-is-match":{"raw":563,"gzip":372,"br":314},"use-uncontrolled":{"raw":352,"gzip":258,"br":216},"use-singleton":{"raw":139,"gzip":130,"br":104},"use-url-hash-state":{"raw":1081,"gzip":620,"br":540},"use-react-router-enable-concurrent-navigation":{"raw":966,"gzip":470,"br":397}}}
1
+ {"total":{"raw":23110,"gzip":14131,"br":0},"exports":{"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-context-state":{"raw":145,"gzip":116,"br":96},"create-session-storage-state":{"raw":332,"gzip":182,"br":152},"create-local-storage-state":{"raw":328,"gzip":183,"br":154},"invariant":{"raw":178,"gzip":156,"br":118},"create-storage-state-factory":{"raw":519,"gzip":309,"br":263},"current-year":{"raw":618,"gzip":417,"br":339},"noop":{"raw":33,"gzip":53,"br":37},"create-storage-hook":{"raw":2073,"gzip":880,"br":764},"no-ssr":{"raw":474,"gzip":316,"br":260},"types":{"raw":0,"gzip":20,"br":1},"fetch-jsonp":{"raw":875,"gzip":533,"br":418},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"nullthrow":{"raw":187,"gzip":163,"br":121},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"rem":{"raw":823,"gzip":395,"br":350},"use-abortable-effect":{"raw":215,"gzip":170,"br":144},"use":{"raw":276,"gzip":182,"br":150},"use-array":{"raw":322,"gzip":236,"br":202},"use-debounced-value":{"raw":524,"gzip":342,"br":286},"use-composition-input":{"raw":470,"gzip":286,"br":241},"use-component-will-receive-update":{"raw":216,"gzip":188,"br":154},"use-error-boundary":{"raw":255,"gzip":198,"br":163},"use-clipboard":{"raw":1177,"gzip":651,"br":552},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-fast-click":{"raw":553,"gzip":364,"br":297},"use-is-client":{"raw":150,"gzip":145,"br":115},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":112},"use-is-online":{"raw":356,"gzip":212,"br":158},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-intersection":{"raw":1230,"gzip":649,"br":597},"use-map":{"raw":339,"gzip":243,"br":208},"use-media-query":{"raw":738,"gzip":413,"br":332},"use-next-pathname":{"raw":314,"gzip":235,"br":203},"use-page-visibility":{"raw":290,"gzip":206,"br":154},"use-retimer":{"raw":199,"gzip":166,"br":127},"use-react-router-enable-concurrent-navigation":{"raw":966,"gzip":470,"br":397},"use-react-router-is-match":{"raw":563,"gzip":372,"br":314},"use-next-link":{"raw":1676,"gzip":872,"br":745},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-singleton":{"raw":139,"gzip":130,"br":104},"use-typescript-happy-callback":{"raw":107,"gzip":102,"br":77},"use-set":{"raw":340,"gzip":238,"br":203},"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},"email-protection":{"raw":426,"gzip":321,"br":272},"use-url-hash-state":{"raw":1081,"gzip":620,"br":540}}}
@@ -0,0 +1 @@
1
+ "use strict";var e=require("react"),n=require("../use-media-query/index.cjs");require("../no-ssr/index.cjs"),require("../noop/index.cjs"),exports.useFastClick=function(o){const s=e.useCallback(e=>{("mousedown"!==e.type||0===e.button)&&("development"!==process.env.NODE_ENV||e.currentTarget instanceof HTMLDivElement||e.currentTarget instanceof HTMLButtonElement||console.warn('[foxact/use-fast-click] You should only use "useFastClick" on <div /> or <button /> elements'),o(e))},[o]);return n.useMediaQuery("(pointer: coarse)",!1)?{onClick:s}:{onMouseDown:s}};
@@ -0,0 +1,5 @@
1
+ type FastClickReturn<T extends HTMLDivElement | HTMLButtonElement> = Pick<React.DOMAttributes<T>, 'onMouseDown' | 'onClick'>;
2
+ /** @see https://foxact.skk.moe/use-fast-click */
3
+ declare function useFastClick<T extends HTMLDivElement | HTMLButtonElement>(callback: React.MouseEventHandler<T>): FastClickReturn<T>;
4
+
5
+ export { type FastClickReturn, useFastClick };
@@ -0,0 +1 @@
1
+ import{useCallback as e}from"react";import{useMediaQuery as o}from"../use-media-query/index.mjs";import"../no-ssr/index.mjs";import"../noop/index.mjs";function n(n){const t=e(e=>{("mousedown"!==e.type||0===e.button)&&("development"!==process.env.NODE_ENV||e.currentTarget instanceof HTMLDivElement||e.currentTarget instanceof HTMLButtonElement||console.warn('[foxact/use-fast-click] You should only use "useFastClick" on <div /> or <button /> elements'),n(e))},[n]);return o("(pointer: coarse)",!1)?{onClick:t}:{onMouseDown:t}}export{n as useFastClick};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var e=require("react");const n=e=>(window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}),i=()=>"undefined"!=typeof window&&navigator.onLine;exports.useIsOnline=function(){return e.useSyncExternalStore(n,i,i)};
2
+ "use strict";var e=require("react");function n(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}function i(){return"undefined"!=typeof window&&navigator.onLine}exports.useIsOnline=function(){return e.useSyncExternalStore(n,i,i)};
@@ -1,4 +1,4 @@
1
1
  /** @see https://foxact.skk.moe/use-is-online */
2
- declare function useIsOnline(): unknown;
2
+ declare function useIsOnline(): boolean;
3
3
 
4
4
  export { useIsOnline };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useSyncExternalStore as n}from"react";const e=n=>(window.addEventListener("online",n),window.addEventListener("offline",n),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}),i=()=>"undefined"!=typeof window&&navigator.onLine;function o(){return n(e,i,i)}export{o as useIsOnline};
2
+ import{useSyncExternalStore as n}from"react";function e(n){return window.addEventListener("online",n),window.addEventListener("offline",n),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}function i(){return"undefined"!=typeof window&&navigator.onLine}function o(){return n(e,i,i)}export{o as useIsOnline};
@@ -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");function o(e,t,r){"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})}require("../request-idle-callback/index.cjs"),exports.unstable_useNextLink=function(u,s){let{prefetch:i,ref:c,onClick:l,onMouseEnter:a,onTouchStart:f,scroll:p=!0,replace:d=!1,...v}=s;process.env.NODE_ENV;const E=null==i?"auto":"full",y=!1!==i,N=t.useRouter(),[h,k]=e.useTransition(),[b,m,g]=n.useIntersection(e.useMemo(()=>({rootMargin:"200px"}),[])),q=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[x,_]=e.useState(q);return x!==q&&(_(q),g()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&m&&y&&o(N,q,{kind:E})},[E,m,y,q,N]),[h,{ref:e.useCallback(e=>{b(e),"function"==typeof c?c(e):c&&e&&(c.current=e)},[c,b]),onClick:e.useCallback(e=>{if("function"==typeof l&&l(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&function(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}(e))&&(e.preventDefault(),k(()=>{N[d?"replace":"push"](q,{scroll:p})}))},[l,d,q,N,p]),onMouseEnter:e.useCallback(e=>{"function"==typeof a&&a(e),"development"!==process.env.NODE_ENV&&y&&o(N,q,{kind:E})},[E,a,y,q,N]),onTouchStart:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&y&&o(N,q,{kind:E})},[E,f,y,q,N]),...v}]};
1
+ "use strict";require("client-only");var e=require("react"),t=require("next/navigation"),n=require("next/dist/shared/lib/router/utils/format-url"),r=require("../use-intersection/index.cjs"),o=require("../use-component-will-receive-update/index.cjs");function u(e,t,n){"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,n)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})}require("../request-idle-callback/index.cjs"),exports.unstable_useNextLink=function(i,s){let{prefetch:c,ref:l,onClick:a,onMouseEnter:f,onTouchStart:p,scroll:d=!0,replace:v=!1,...E}=s;process.env.NODE_ENV;const y=null==c?"auto":"full",N=!1!==c,h=t.useRouter(),[k,m]=e.useTransition(),[b,q,x]=r.useIntersection(e.useMemo(()=>({rootMargin:"200px"}),[])),g=e.useMemo(()=>"string"==typeof i?i:n.formatUrl(i),[i]);return o.useComponentWillReceiveUpdate(x,[g]),e.useEffect(()=>{"production"===process.env.NODE_ENV&&q&&N&&u(h,g,{kind:y})},[y,q,N,g,h]),[k,{ref:e.useCallback(e=>{b(e),"function"==typeof l?l(e):l&&e&&(l.current=e)},[l,b]),onClick:e.useCallback(e=>{if("function"==typeof a&&a(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&function(e){const t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e))&&(e.preventDefault(),m(()=>{h[v?"replace":"push"](g,{scroll:d})}))},[a,v,g,h,d]),onMouseEnter:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&N&&u(h,g,{kind:y})},[y,f,N,g,h]),onTouchStart:e.useCallback(e=>{"function"==typeof p&&p(e),"development"!==process.env.NODE_ENV&&N&&u(h,g,{kind:y})},[y,p,N,g,h]),...E}]};
@@ -1 +1 @@
1
- import"client-only";import{useTransition as e,useMemo as t,useState as n,useEffect as o,useCallback as r}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";function u(e,t,n){"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,n)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})}const p=function(p,f){let{prefetch:l,ref:a,onClick:d,onMouseEnter:m,onTouchStart:v,scroll:E=!0,replace:y=!1,...N}=f;process.env.NODE_ENV;const h=null==l?"auto":"full",g=!1!==l,x=i(),[_,k]=e(),[D,w,O]=s(t(()=>({rootMargin:"200px"}),[])),V=t(()=>"string"==typeof p?p:c(p),[p]),[b,K]=n(V);return b!==V&&(K(V),O()),o(()=>{"production"===process.env.NODE_ENV&&w&&g&&u(x,V,{kind:h})},[h,w,g,V,x]),[_,{ref:r(e=>{D(e),"function"==typeof a?a(e):a&&e&&(a.current=e)},[a,D]),onClick:r(e=>{if("function"==typeof d&&d(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&function(e){const t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e))&&(e.preventDefault(),k(()=>{x[y?"replace":"push"](V,{scroll:E})}))},[d,y,V,x,E]),onMouseEnter:r(e=>{"function"==typeof m&&m(e),"development"!==process.env.NODE_ENV&&g&&u(x,V,{kind:h})},[h,m,g,V,x]),onTouchStart:r(e=>{"function"==typeof v&&v(e),"development"!==process.env.NODE_ENV&&g&&u(x,V,{kind:h})},[h,v,g,V,x]),...N}]};export{p as unstable_useNextLink};
1
+ import"client-only";import{useTransition as e,useMemo as t,useEffect as n,useCallback as o}from"react";import{useRouter as r}from"next/navigation";import{formatUrl as i}from"next/dist/shared/lib/router/utils/format-url";import{useIntersection as c}from"../use-intersection/index.mjs";import{useComponentWillReceiveUpdate as s}from"../use-component-will-receive-update/index.mjs";import"../request-idle-callback/index.mjs";function u(e,t,n){"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,n)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})}const p=function(p,l){let{prefetch:f,ref:a,onClick:d,onMouseEnter:m,onTouchStart:v,scroll:E=!0,replace:y=!1,...N}=l;process.env.NODE_ENV;const h=null==f?"auto":"full",x=!1!==f,g=r(),[_,k]=e(),[w,D,O]=c(t(()=>({rootMargin:"200px"}),[])),V=t(()=>"string"==typeof p?p:i(p),[p]);return s(O,[V]),n(()=>{"production"===process.env.NODE_ENV&&D&&x&&u(g,V,{kind:h})},[h,D,x,V,g]),[_,{ref:o(e=>{w(e),"function"==typeof a?a(e):a&&e&&(a.current=e)},[a,w]),onClick:o(e=>{if("function"==typeof d&&d(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&function(e){const t=e.currentTarget,n=t.getAttribute("target");return n&&"_self"!==n||t.download||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e))&&(e.preventDefault(),k(()=>{g[y?"replace":"push"](V,{scroll:E})}))},[d,y,V,g,E]),onMouseEnter:o(e=>{"function"==typeof m&&m(e),"development"!==process.env.NODE_ENV&&x&&u(g,V,{kind:h})},[h,m,x,V,g]),onTouchStart:o(e=>{"function"==typeof v&&v(e),"development"!==process.env.NODE_ENV&&x&&u(g,V,{kind:h})},[h,v,x,V,g]),...N}]};export{p as unstable_useNextLink};
@@ -1 +0,0 @@
1
- "use strict";var e=require("react");const r=e.memo(r=>{let{contexts:t,children:o}=r;return t.reduceRight((r,t)=>e.cloneElement(t,{children:r}),o)});exports.ComposeContextProvider=r;
@@ -1 +0,0 @@
1
- "use strict";var e=require("react/jsx-runtime");require("client-only");var t=require("react"),r=require("../noop/index.js");exports.createContextState=function(n){const o=/*#__PURE__*/t.createContext(n),u=/*#__PURE__*/t.createContext(r.noop);return[r=>{let{children:i}=r;const[c,s]=t.useState(n);return /*#__PURE__*/e.jsx(o.Provider,{value:c,children:/*#__PURE__*/e.jsx(u.Provider,{value:s,children:i})})},()=>t.useContext(o),()=>t.useContext(u),o]};
@@ -1 +0,0 @@
1
- "use strict";var e=require("../context-state/index.js");require("react/jsx-runtime"),require("client-only"),require("react"),require("../noop/index.js"),exports.createContextState=e.createContextState;
@@ -1 +0,0 @@
1
- "use strict";const e=new Map;function t(e){const t=Array.from(Array(e).keys());return"development"===process.env.NODE_ENV&&Object.freeze(t),t}function r(r){if(e.has(r))return e.get(r);const n=t(r);return e.set(r,n),n}const n=new Map;function o(e){let r,o;return n.has(e)&&(o=(r=n.get(e)).deref()),o||(r=new WeakRef(o=t(e)),n.set(e,r)),o}const s="function"==typeof WeakRef?o:r;exports.createFixedArray=s,exports.createFixedArrayWithGC=o,exports.createFixedArrayWithoutGC=r;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("../create-storage-state-factory/index.js");require("../create-storage-hook/index.js"),require("react"),require("../noop/index.js"),require("../use-isomorphic-layout-effect/index.js"),require("../no-ssr/index.js");const r=e.createStorageStateFactory("localStorage");exports.createLocalStorageState=r;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("../create-storage-state-factory/index.js");require("../create-storage-hook/index.js"),require("react"),require("../noop/index.js"),require("../use-isomorphic-layout-effect/index.js"),require("../no-ssr/index.js");const r=e.createStorageStateFactory("sessionStorage");exports.createSessionStorageState=r;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),o=require("../noop/index.js"),t=require("../use-isomorphic-layout-effect/index.js"),n=require("../no-ssr/index.js");const r=e=>"function"==typeof e,a=e=>e;function i(){throw n.noSSRError("useLocalStorage cannot be used on the server without a serverValue")}exports.createStorage=function(n){const l="localStorage"===n?"foxact-use-local-storage":"foxact-use-session-storage",s="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",c="undefined"==typeof window?o.noop:e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))},u="undefined"==typeof window?o.noop:(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(s,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{c(e)}},d="undefined"==typeof window?o.noop:e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(s,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{c(e)}},w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(s,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,s){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{raw:!1,serializer:JSON.stringify,deserializer:JSON.parse};const f=e.useCallback(e=>{if("undefined"==typeof window)return o.noop;const t=o=>{"key"in o&&o.key!==n||e()},r=o=>{o.detail===n&&e()};return window.addEventListener("storage",t),window.addEventListener(l,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(l,r)}},[n]),v=c.raw?a:c.serializer,y=c.raw?a:c.deserializer,g=void 0===s?i:()=>v(s),m=e.useSyncExternalStore(f,()=>w(n),g),p=e.useMemo(()=>null===m?null:y(m),[m,y]),h=e.useCallback(e=>{try{const o=r(e)?e(null!=p?p:null):e;null===o?d(n):u(n,v(o))}catch(e){console.warn(e)}},[n,v,p]);return t.useLayoutEffect(()=>{null===w(n)&&void 0!==s&&u(n,v(s))},[y,n,v,s]),[null===p?void 0===s?null:s:p,h]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("../create-storage-hook/index.js");require("client-only"),require("react"),require("../noop/index.js"),require("../use-isomorphic-layout-effect/index.js"),require("../no-ssr/index.js");const r=e=>e;exports.createStorageStateFactory=function(t){return function(i,o){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{raw:!1,serializer:JSON.stringify,deserializer:JSON.parse};const{useStorage:a,useSetStorage:n}=e.createStorage(t);return[()=>a(i,o,s),()=>a(i,o,s)[0],()=>n(i,s.raw?r:s.serializer)]}};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../use-isomorphic-layout-effect/index.js");require("client-only");const n=/*#__PURE__*/r.memo(n=>{let{defaultYear:i,...u}=n;"undefined"==typeof window&&void 0===i&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[s,a]=r.useState(i||new Date().getFullYear());return t.useIsomorphicLayoutEffect(()=>{a(new Date().getFullYear())},[]),/*#__PURE__*/e.jsx("span",{...u,children:s})});"production"!==process.env.NODE_ENV&&(n.displayName="CurrentYear"),exports.CurrentYear=n;
@@ -1 +0,0 @@
1
- "use strict";const e="__foxact_jsonp_callbacks__SECRET_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED";exports.fetchJsonp=function(o){if("undefined"==typeof window)throw TypeError("fetchJsonp is only available in the browser");window[e]||Object.defineProperty(window,e,{value:{},writable:!0,configurable:!0,enumerable:!1});const n="$".concat(Date.now(),"_").concat(Math.random().toString().slice(2),"$"),t="window.".concat(e,".").concat(n);if(Object.prototype.hasOwnProperty.call(window[e],n))throw TypeError("Callback name conflict: ".concat(n));const r=o(t);return new Promise((o,t)=>{const c=document.createElement("script");c.src=r,c.async=!0;const a=()=>{c.removeEventListener("error",i),c.remove(),window[e][n]&&delete window[e][n]};function i(){a(),t(Error("Failed to load script: ".concat(r)))}c.addEventListener("error",i),window[e][n]=e=>{a(),o(e)},document.body.append(c)})};
@@ -1 +0,0 @@
1
- "use strict";exports.invariant=function(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'[foxact/invariant] "value" is null or undefined';if(null==n)throw TypeError(i)};
package/no-ssr/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value;function e(r){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BAILOUT_TO_CLIENT_SIDE_RENDERING";const o=Error.stackTraceLimit;t&&(Error.stackTraceLimit=0);const i=Error(r);return t&&(Error.stackTraceLimit=o),i.digest=e,i.recoverableError="NO_SSR",i}exports.noSSR=function(r){if("undefined"==typeof window)throw e(r)},exports.noSSRError=e;
package/noop/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";exports.noop=()=>{};
@@ -1 +0,0 @@
1
- "use strict";exports.nullthrow=function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'[foxact/invariant] "value" is null or undefined';if(null==n)throw TypeError(r);return n};
package/rem/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const e="16px";function n(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r&&r!==e?"calc(".concat(n," * ").concat(r,")"):n}function r(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;return function c(i){if(Array.isArray(i))return i.map(c).join(" ");if(0===i||"0"===i)return"0";if("number"==typeof i)return n("".concat(i/t).concat(e),r);if(i.includes("calc(")||i.includes("var(")||i.includes("clamp("))return i;if(i.includes(" "))return i.split(" ").map(c).join(" ");if(i.includes(e))return n(i,r);const o=Number(i.replace("px",""));return o==o?n("".concat(o/t).concat(e),r):i}}const t=r("rem",e,16),c=r("rem","var(--mantine-scale)",16),i=r("em",e,16);exports.createConverter=r,exports.em=i,exports.mantine_rem=c,exports.rem=t;
@@ -1 +0,0 @@
1
- "use strict";const e="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(self)||function(e){const l=Date.now();return self.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-l))})},1)},l="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(self)||function(e){return clearTimeout(e)};exports.cancelIdleCallback=l,exports.requestIdleCallback=e;
package/types/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
@@ -1 +0,0 @@
1
- "use strict";var r=require("react");const e=r.forwardRef,p=r.forwardRef;exports.typeScriptHappyForwardRef=e,exports.typescriptHappyForwardRef=p;
package/use/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("react").use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}});exports.use=e;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");function 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;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useArray=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>[];const[t,c]=e.useState(r),l=e.useCallback(e=>c(r=>r.concat(e)),[]);return[t,l,e.useCallback(()=>c([]),[]),e.useCallback(e=>c(r=>{if(e>-1){const t=r.slice();return t.splice(e,1),t}return r}),[])]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../noop/index.js"),t=require("../use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.js"),a=require("../use-typescript-happy-callback/index.js");class o extends Error{constructor(e){super(e),this.name="UseClipboardError"}}exports.UseClipboardError=o,exports.useClipboard=function(){let{timeout:l=1e3,usePromptAsFallback:i=!1,promptFallbackText:n="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[s,c]=e.useState(null),[p,d]=e.useState(!1),b=e.useRef(null),y=t.useStableHandler(u||r.noop),w=a.useCallback(e=>{b.current&&clearTimeout(b.current),e&&(b.current=window.setTimeout(()=>d(!1),l)),d(e)},[l]),h=a.useCallback(e=>{c(e),y(e)},[y]);return{copy:a.useCallback(async e=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(e),w(!0);else throw new o("[foxact/use-clipboard] navigator.clipboard is not supported")}catch(r){if(i)try{window.prompt(n,e)}catch(e){h(e)}else h(r)}},[w,n,h,i]),reset:a.useCallback(()=>{d(!1),c(null),b.current&&clearTimeout(b.current)},[]),error:s,copied:p}};
@@ -1 +0,0 @@
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 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-singleton/index.js");function t(){return{c:!1,e:!1}}exports.useCompositionInput=function(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]),i=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:i,onCompositionEnd:s}};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-retimer/index.js");exports.useDebouncedState=function(t,u){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[s,i]=e.useState(t),c=e.useRef(!0),a=r.useRetimer();return[s,e.useCallback(e=>{c.current&&n?i(e):a(window.setTimeout(()=>{c.current=!0,i(e)},u)),c.current=!1},[n,a,u]),e.useCallback(e=>{a(),i(e)},[a])]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("../use-abortable-effect/index.js");exports.useDebouncedValue=function(r,u){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("function"==typeof r)throw TypeError("useDebouncedValue does not support function as value");const[o,c]=e.useState(r),i=e.useRef(!0);return t.useEffect(e=>{let t=null;return e.aborted||(n&&i.current?(i.current=!1,c(r)):t=window.setTimeout(()=>{i.current=!0,c(r)},u)),()=>{t&&window.clearTimeout(t)}},[r,n,u]),o};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var r=require("react");function t(r){return!(!1===r||null==r)}exports.useErrorBoundary=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[n,u]=r.useState(!1);if(t(e))throw e;if(t(n))throw n;return u};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),t=require("../request-idle-callback/index.js");const n="function"==typeof IntersectionObserver,r=new Map,o=[];exports.useIntersection=function(c){let{rootRef:i,rootMargin:s,disabled:u}=c;const[l,a]=e.useState(!1),f=e.useRef(null);e.useEffect(()=>{if(n){if(u||l)return;const e=f.current;if(null==e?void 0:e.tagName)return function(e,t,n){const{id:c,observer:i,elements:s}=function(e){let t;const n={root:e.root||null,margin:e.rootMargin||""},c=o.find(e=>e.root===n.root&&e.margin===n.margin);if(c&&(t=r.get(c)))return t;const i=new Map;return t={id:n,observer:new IntersectionObserver(e=>{e.forEach(e=>{const t=i.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e),elements:i},o.push(n),r.set(n,t),t}(n);return s.set(e,t),i.observe(e),function(){if(s.delete(e),i.unobserve(e),0===s.size){i.disconnect(),r.delete(c);const e=o.findIndex(e=>e.root===c.root&&e.margin===c.margin);e>-1&&o.splice(e,1)}}}(e,e=>e&&a(!0),{root:null==i?void 0:i.current,rootMargin:s})}if(!l){const e=t.requestIdleCallback(()=>a(!0));return()=>t.cancelIdleCallback(e)}},[u,s,i,l]);const d=e.useCallback(()=>{a(!1)},[]);return[e.useCallback(e=>{f.current=e},[]),l,d]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useIsClient=function(){const[t,r]=e.useState(!1);return e.useEffect(()=>{r(!0)},[]),t};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- "use strict";var e=require("react");const n=e=>(window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}),i=()=>"undefined"!=typeof window&&navigator.onLine;exports.useIsOnline=function(){return e.useSyncExternalStore(n,i,i)};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");const t="undefined"==typeof window?e.useEffect:e.useLayoutEffect;exports.useIsomorphicLayoutEffect=t,exports.useLayoutEffect=t;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("../create-storage-hook/index.js");require("react"),require("../noop/index.js"),require("../use-isomorphic-layout-effect/index.js"),require("../no-ssr/index.js");const{useStorage:r,useSetStorage:o}=e.createStorage("localStorage");exports.useLocalStorage=r,exports.useSetLocalStorage=o;
package/use-map/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useMap=function(){let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>new Map;const[t,l]=e.useState(a),s=e.useCallback((e,a)=>l(t=>(t.set(e,a),new Map(t))),[]),n=e.useCallback(e=>l(a=>a.has(e)?(a.delete(e),new Map(a)):a),[]);return[t,s,n,e.useCallback(()=>l(new Map),[]),e.useCallback(e=>l(e),[])]};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- "use strict";var e=require("../no-ssr/index.js"),n=require("../noop/index.js"),t=require("react");const r=new Map;function o(){throw e.noSSRError("useMediaQuery cannot be used on the server without a serverValue")}exports.useMediaQuery=function(e,i){"undefined"==typeof window||r.has(e)||r.set(e,window.matchMedia(e).matches);const a=t.useCallback(t=>(function(e,t){if("undefined"==typeof window)return n.noop;const o=window.matchMedia(e),i=()=>{r.set(e,o.matches),t()};return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}})(e,t),[e]);return t.useSyncExternalStore(a,()=>{var n;return"undefined"!=typeof window&&(null!==(n=r.get(e))&&void 0!==n?n:window.matchMedia(e).matches)},void 0===i?o:()=>i)};
@@ -1 +0,0 @@
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");function o(e,t,r){"undefined"!=typeof window&&Promise.resolve(e.prefetch(t,r)).catch(e=>{if("production"!==process.env.NODE_ENV)throw e})}require("../request-idle-callback/index.js"),exports.unstable_useNextLink=function(u,s){let{prefetch:i,ref:c,onClick:l,onMouseEnter:a,onTouchStart:f,scroll:p=!0,replace:d=!1,...v}=s;process.env.NODE_ENV;const E=null==i?"auto":"full",y=!1!==i,N=t.useRouter(),[h,k]=e.useTransition(),[b,m,g]=n.useIntersection(e.useMemo(()=>({rootMargin:"200px"}),[])),q=e.useMemo(()=>"string"==typeof u?u:r.formatUrl(u),[u]),[x,_]=e.useState(q);return x!==q&&(_(q),g()),e.useEffect(()=>{"production"===process.env.NODE_ENV&&m&&y&&o(N,q,{kind:E})},[E,m,y,q,N]),[h,{ref:e.useCallback(e=>{b(e),"function"==typeof c?c(e):c&&e&&(c.current=e)},[c,b]),onClick:e.useCallback(e=>{if("function"==typeof l&&l(e),e.defaultPrevented)return;const{nodeName:t}=e.currentTarget;!("A"===t.toUpperCase()&&function(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}(e))&&(e.preventDefault(),k(()=>{N[d?"replace":"push"](q,{scroll:p})}))},[l,d,q,N,p]),onMouseEnter:e.useCallback(e=>{"function"==typeof a&&a(e),"development"!==process.env.NODE_ENV&&y&&o(N,q,{kind:E})},[E,a,y,q,N]),onTouchStart:e.useCallback(e=>{"function"==typeof f&&f(e),"development"!==process.env.NODE_ENV&&y&&o(N,q,{kind:E})},[E,f,y,q,N]),...v}]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("next/router.js"),t=require("react");exports.useNextPathname=function(){let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{asPath:n}=e.useRouter();return t.useMemo(()=>{const e=n.split(/[#?]/)[0];return r?e.endsWith("/")?e:"".concat(e,"/"):e},[r,n])};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- "use strict";var e=require("react");const t=e=>(document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}),i=()=>"undefined"!=typeof document&&!document.hidden;exports.usePageVisibility=function(){return e.useSyncExternalStore(t,i,i)};
@@ -1,2 +0,0 @@
1
- 'use client';
2
- "use strict";require("client-only");var r=require("react"),e=require("react-router-dom");function t(){const{navigator:t}=r.useContext(e.UNSAFE_NavigationContext);if(!t)throw TypeError("[foxact/use-react-router-enable-concurrent-navigation] must be used under <RouterProvider /> or a Router component (e.g. <BrowserRouter />)");r.useEffect(()=>{const e=t.go.bind(t),n=t.push.bind(t),o=t.replace.bind(t);return t.go=function(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];return r.startTransition(()=>e.apply(t,o))},t.push=function(){for(var e=arguments.length,o=Array(e),a=0;a<e;a++)o[a]=arguments[a];return r.startTransition(()=>n.apply(t,o))},t.replace=function(){for(var e=arguments.length,n=Array(e),a=0;a<e;a++)n[a]=arguments[a];return r.startTransition(()=>o.apply(t,n))},()=>{t.go=e,t.push=n,t.replace=o}},[t])}exports.ReactRouterConcurrentNavigationProvider=function(r){let{children:e}=r;return t(),e},exports.useReactRouterEnableConcurrentNavigation=t;
@@ -1 +0,0 @@
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 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useRetimer=function(){const r=e.useRef();return e.useCallback(e=>{"number"==typeof r.current&&clearTimeout(r.current),r.current=e},[])};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("../create-storage-hook/index.js");require("react"),require("../noop/index.js"),require("../use-isomorphic-layout-effect/index.js"),require("../no-ssr/index.js");const{useStorage:r,useSetStorage:s}=e.createStorage("sessionStorage");exports.useSessionStorage=r,exports.useSetSessionStorage=s;
package/use-set/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useSet=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>new Set;const[a,l]=e.useState(t),s=e.useCallback(e=>l(t=>t.has(e)?t:new Set([...t,e])),[]),n=e.useCallback(e=>l(t=>t.has(e)?(t.delete(e),new Set(t)):t),[]);return[a,s,n,e.useCallback(()=>l(new Set),[]),e.useCallback(e=>l(e),[])]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react");exports.useSingleton=function(r){const t=e.useRef();return t.current||(t.current=r()),t};
@@ -1 +0,0 @@
1
- "use strict";var e=require("react");const t="undefined"==typeof window?e.useEffect:e.useInsertionEffect||e.useLayoutEffect;function n(){throw Error("foxact: the stablized handler cannot be invoked before the component has mounted.")}exports.useStableHandler=function(r){const o=e.useRef(n);return t(()=>{o.current=r},[r]),e.useCallback(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,o.current)(...t)},[])};
@@ -1 +0,0 @@
1
- "use strict";const e=require("react").useCallback;exports.useCallback=e,exports.useTypeScriptHappyCallback=e;
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),r=require("../use-typescript-happy-callback/index.js");const t=e=>e;exports.useUncontrolled=function(u){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;const n=e.useRef(null),[l,s]=e.useReducer((e,r)=>c(r),u);return[l,r.useCallback(()=>{n.current&&s(n.current.value)},[]),n]};
@@ -1 +0,0 @@
1
- "use strict";require("client-only");var e=require("react"),n=require("../noop/index.js"),r=require("../no-ssr/index.js");const t=e=>e,a=(()=>{if("undefined"==typeof window)return e=>n.noop;let e=!1;const r=new Set,t=()=>{r.forEach(e=>e())};return n=>(r.add(n),e||(e=!0,window.addEventListener("hashchange",t)),()=>{r.delete(n)})})(),o=e=>"function"==typeof e;function l(){throw r.noSSRError("useUrlHashState cannot be used on the server without a serverValue")}exports.unstable_useUrlHashState=function(n,r){var s;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{raw:!1,serializer:t,deserializer:t};const u=i.raw?t:i.serializer,c=i.raw?t:i.deserializer,d=void 0===r?l:()=>u(r),h=e.useSyncExternalStore(a,()=>new URLSearchParams(location.hash.slice(1)).get(n),d),w=e.useMemo(()=>null===h?null!=r?r:null:c(h),[r,c,h]),S=e.useCallback(e=>{const t=location.hash,a=new URLSearchParams(t.slice(1)),l=o(e)?e(w):e;l===r||null===l?a.delete(n):a.set(n,u(l));const s=a.toString();t!==s&&(location.hash=s)},[r,w,n,u]);return[null!==(s=null!=w?w:r)&&void 0!==s?s:null,S]};