foxact 0.2.30 → 0.2.32
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/create-storage-hook/index.cjs +1 -1
- package/create-storage-hook/index.js +1 -1
- package/create-storage-hook/index.mjs +1 -1
- package/no-ssr/index.cjs +1 -1
- package/no-ssr/index.d.ts +1 -1
- package/no-ssr/index.js +1 -1
- package/no-ssr/index.mjs +1 -1
- package/package.json +202 -194
- package/sizes.json +1 -1
- package/use-isomorphic-layout-effect/index.d.ts +3 -3
- package/use-next-link/index.cjs +1 -0
- package/use-next-link/index.d.ts +28 -0
- package/use-next-link/index.js +1 -0
- package/use-next-link/index.mjs +1 -0
- package/use-url-hash-state/index.cjs +1 -1
- package/use-url-hash-state/index.js +1 -1
- package/use-url-hash-state/index.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),o=require("../noop/index.cjs"),t=require("../use-isomorphic-layout-effect/index.cjs"),n=require("../no-ssr/index.cjs");const r=e=>"function"==typeof e,a=e=>e,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",c="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",s="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(c,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(c,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(c,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,c){var s;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=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]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==c?()=>y(c):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==c&&u(n,y(c))},[g,n,y,c]),[(s=null!=h?h:c)
|
|
1
|
+
"use strict";require("client-only");var e=require("react"),o=require("../noop/index.cjs"),t=require("../use-isomorphic-layout-effect/index.cjs"),n=require("../no-ssr/index.cjs");const r=e=>"function"==typeof e,a=e=>e,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",c="localStorage"===n?"foxact/use-local-storage":"foxact/use-session-storage",s="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(e,o)=>{try{window[n].setItem(e,o)}catch(e){console.warn("[".concat(c,"] Failed to set value to ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,d="undefined"!=typeof window?e=>{try{window[n].removeItem(e)}catch(e){console.warn("[".concat(c,"] Failed to remove value from ").concat(n,", it might be blocked"))}finally{s(e)}}:o.noop,w=e=>{if("undefined"==typeof window)return null;try{return window[n].getItem(e)}catch(e){return console.warn("[".concat(c,"] Failed to get value from ").concat(n,", it might be blocked")),null}};return{useStorage:function(n,c){var s;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=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]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==c?()=>y(c):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==c&&u(n,y(c))},[g,n,y,c]),[null!==(s=null!=h?h:c)&&void 0!==s?s:null,S]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
|
|
@@ -1 +1 @@
|
|
|
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,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?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(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)}}:o.noop,d="undefined"!=typeof window?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)}}:o.noop,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){var c;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=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]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==s?()=>y(s):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==s&&u(n,y(s))},[g,n,y,s]),[(c=null!=h?h:s)
|
|
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,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?e=>{window.dispatchEvent(new CustomEvent(l,{detail:e}))}:o.noop,u="undefined"!=typeof window?(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)}}:o.noop,d="undefined"!=typeof window?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)}}:o.noop,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){var c;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const v=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]),y=f.raw?a:f.serializer,g=f.raw?a:f.deserializer,m=void 0!==s?()=>y(s):i,p=e.useSyncExternalStore(v,()=>w(n),m),h=e.useMemo(()=>null===p?null:g(p),[p,g]),S=e.useCallback(e=>{try{const o=r(e)?e(null!=h?h:null):e;null===o?d(n):u(n,y(o))}catch(e){console.warn(e)}},[n,y,h]);return t.useIsomorphicLayoutEffect(()=>{null===w(n)&&void 0!==s&&u(n,y(s))},[g,n,y,s]),[null!==(c=null!=h?h:s)&&void 0!==c?c:null,S]},useSetStorage:(o,t)=>e.useCallback(e=>{try{null===e?d(o):u(o,t(e))}catch(e){console.warn(e)}},[o,t])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"client-only";import{useCallback as e,useSyncExternalStore as o,useMemo as t}from"react";import{noop as n}from"../noop/index.mjs";import{useIsomorphicLayoutEffect as r}from"../use-isomorphic-layout-effect/index.mjs";import{noSSRError as i}from"../no-ssr/index.mjs";const a=e=>"function"==typeof e,l=e=>e,c=()=>{throw i("useLocalStorage cannot be used on the server without a serverValue")};function s(i){const s="localStorage"===i?"foxact-use-local-storage":"foxact-use-session-storage",d="localStorage"===i?"foxact/use-local-storage":"foxact/use-session-storage",u="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(s,{detail:e}))}:n,w="undefined"!=typeof window?(e,o)=>{try{window[i].setItem(e,o)}catch(e){console.warn("[".concat(d,"] Failed to set value to ").concat(i,", it might be blocked"))}finally{u(e)}}:n,f="undefined"!=typeof window?e=>{try{window[i].removeItem(e)}catch(e){console.warn("[".concat(d,"] Failed to remove value from ").concat(i,", it might be blocked"))}finally{u(e)}}:n,m=e=>{if("undefined"==typeof window)return null;try{return window[i].getItem(e)}catch(e){return console.warn("[".concat(d,"] Failed to get value from ").concat(i,", it might be blocked")),null}};return{useStorage:function(i,d){var u;let v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const g=e(e=>{if("undefined"==typeof window)return n;const o=o=>{"key"in o&&o.key!==i||e()},t=o=>{o.detail===i&&e()};return window.addEventListener("storage",o),window.addEventListener(s,t),()=>{window.removeEventListener("storage",o),window.removeEventListener(s,t)}},[i]),y=v.raw?l:v.serializer,p=v.raw?l:v.deserializer,h=o(g,()=>m(i),void 0!==d?()=>y(d):c),S=t(()=>null===h?null:p(h),[h,p]),x=e(e=>{try{const o=a(e)?e(null!=S?S:null):e;null===o?f(i):w(i,y(o))}catch(e){console.warn(e)}},[i,y,S]);return r(()=>{null===m(i)&&void 0!==d&&w(i,y(d))},[p,i,y,d]),[(u=null!=S?S:d)
|
|
1
|
+
import"client-only";import{useCallback as e,useSyncExternalStore as o,useMemo as t}from"react";import{noop as n}from"../noop/index.mjs";import{useIsomorphicLayoutEffect as r}from"../use-isomorphic-layout-effect/index.mjs";import{noSSRError as i}from"../no-ssr/index.mjs";const a=e=>"function"==typeof e,l=e=>e,c=()=>{throw i("useLocalStorage cannot be used on the server without a serverValue")};function s(i){const s="localStorage"===i?"foxact-use-local-storage":"foxact-use-session-storage",d="localStorage"===i?"foxact/use-local-storage":"foxact/use-session-storage",u="undefined"!=typeof window?e=>{window.dispatchEvent(new CustomEvent(s,{detail:e}))}:n,w="undefined"!=typeof window?(e,o)=>{try{window[i].setItem(e,o)}catch(e){console.warn("[".concat(d,"] Failed to set value to ").concat(i,", it might be blocked"))}finally{u(e)}}:n,f="undefined"!=typeof window?e=>{try{window[i].removeItem(e)}catch(e){console.warn("[".concat(d,"] Failed to remove value from ").concat(i,", it might be blocked"))}finally{u(e)}}:n,m=e=>{if("undefined"==typeof window)return null;try{return window[i].getItem(e)}catch(e){return console.warn("[".concat(d,"] Failed to get value from ").concat(i,", it might be blocked")),null}};return{useStorage:function(i,d){var u;let v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:JSON.stringify,deserializer:JSON.parse};const g=e(e=>{if("undefined"==typeof window)return n;const o=o=>{"key"in o&&o.key!==i||e()},t=o=>{o.detail===i&&e()};return window.addEventListener("storage",o),window.addEventListener(s,t),()=>{window.removeEventListener("storage",o),window.removeEventListener(s,t)}},[i]),y=v.raw?l:v.serializer,p=v.raw?l:v.deserializer,h=o(g,()=>m(i),void 0!==d?()=>y(d):c),S=t(()=>null===h?null:p(h),[h,p]),x=e(e=>{try{const o=a(e)?e(null!=S?S:null):e;null===o?f(i):w(i,y(o))}catch(e){console.warn(e)}},[i,y,S]);return r(()=>{null===m(i)&&void 0!==d&&w(i,y(d))},[p,i,y,d]),[null!==(u=null!=S?S:d)&&void 0!==u?u:null,x]},useSetStorage:(o,t)=>e(e=>{try{null===e?f(o):w(o,t(e))}catch(e){console.warn(e)}},[o,t])}}export{s as createStorage};
|
package/no-ssr/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=r
|
|
1
|
+
"use strict";const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=function(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=r=>{if("undefined"==typeof window)throw e(r)},exports.noSSRError=e;
|
package/no-ssr/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @private */
|
|
2
|
-
declare const noSSRError: (errorMessage?: string) => Error;
|
|
2
|
+
declare const noSSRError: (errorMessage?: string | undefined, nextjsDigest?: string) => Error;
|
|
3
3
|
/** @see https://foxact.skk.moe/no-ssr */
|
|
4
4
|
declare const noSSR: (extraMessage?: string) => void;
|
|
5
5
|
|
package/no-ssr/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=r
|
|
1
|
+
"use strict";const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=function(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=r=>{if("undefined"==typeof window)throw e(r)},exports.noSSRError=e;
|
package/no-ssr/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=r
|
|
1
|
+
const r=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"),t=(null==r?void 0:r.writable)&&"number"==typeof r.value,e=function(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},o=r=>{if("undefined"==typeof window)throw e(r)};export{o as noSSR,e as noSSRError};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxact",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32",
|
|
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": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"client-only": "^0.0.1",
|
|
25
|
-
"rollup-preserve-directives": "^1.1.0",
|
|
26
25
|
"server-only": "^0.0.1"
|
|
27
26
|
},
|
|
28
27
|
"peerDependencies": {
|
|
@@ -67,59 +66,68 @@
|
|
|
67
66
|
"exports": {
|
|
68
67
|
"./package.json": "./package.json",
|
|
69
68
|
"./sizes.json": "./sizes.json",
|
|
70
|
-
"./
|
|
71
|
-
"types": "./
|
|
69
|
+
"./rem": {
|
|
70
|
+
"types": "./rem/index.d.ts",
|
|
72
71
|
"import": {
|
|
73
|
-
"types": "./
|
|
74
|
-
"default": "./
|
|
72
|
+
"types": "./rem/index.d.ts",
|
|
73
|
+
"default": "./rem/index.mjs"
|
|
75
74
|
},
|
|
76
|
-
"require": "./
|
|
77
|
-
"default": "./
|
|
75
|
+
"require": "./rem/index.cjs",
|
|
76
|
+
"default": "./rem/index.js"
|
|
78
77
|
},
|
|
79
|
-
"./
|
|
80
|
-
"types": "./
|
|
78
|
+
"./current-year": {
|
|
79
|
+
"types": "./current-year/index.d.ts",
|
|
81
80
|
"import": {
|
|
82
|
-
"types": "./
|
|
83
|
-
"default": "./
|
|
81
|
+
"types": "./current-year/index.d.ts",
|
|
82
|
+
"default": "./current-year/index.mjs"
|
|
84
83
|
},
|
|
85
|
-
"require": "./
|
|
86
|
-
"default": "./
|
|
84
|
+
"require": "./current-year/index.cjs",
|
|
85
|
+
"default": "./current-year/index.js"
|
|
87
86
|
},
|
|
88
|
-
"./
|
|
89
|
-
"types": "./
|
|
87
|
+
"./context-state": {
|
|
88
|
+
"types": "./context-state/index.d.ts",
|
|
90
89
|
"import": {
|
|
91
|
-
"types": "./
|
|
92
|
-
"default": "./
|
|
90
|
+
"types": "./context-state/index.d.ts",
|
|
91
|
+
"default": "./context-state/index.mjs"
|
|
93
92
|
},
|
|
94
|
-
"require": "./
|
|
95
|
-
"default": "./
|
|
93
|
+
"require": "./context-state/index.cjs",
|
|
94
|
+
"default": "./context-state/index.js"
|
|
96
95
|
},
|
|
97
|
-
"./use-
|
|
98
|
-
"types": "./use-
|
|
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",
|
|
99
98
|
"import": {
|
|
100
|
-
"types": "./use-
|
|
101
|
-
"default": "./use-
|
|
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"
|
|
102
101
|
},
|
|
103
|
-
"require": "./use-
|
|
104
|
-
"default": "./use-
|
|
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"
|
|
105
104
|
},
|
|
106
|
-
"./
|
|
107
|
-
"types": "./
|
|
105
|
+
"./create-fixed-array": {
|
|
106
|
+
"types": "./create-fixed-array/index.d.ts",
|
|
108
107
|
"import": {
|
|
109
|
-
"types": "./
|
|
110
|
-
"default": "./
|
|
108
|
+
"types": "./create-fixed-array/index.d.ts",
|
|
109
|
+
"default": "./create-fixed-array/index.mjs"
|
|
111
110
|
},
|
|
112
|
-
"require": "./
|
|
113
|
-
"default": "./
|
|
111
|
+
"require": "./create-fixed-array/index.cjs",
|
|
112
|
+
"default": "./create-fixed-array/index.js"
|
|
114
113
|
},
|
|
115
|
-
"./
|
|
116
|
-
"types": "./
|
|
114
|
+
"./request-idle-callback": {
|
|
115
|
+
"types": "./request-idle-callback/index.d.ts",
|
|
117
116
|
"import": {
|
|
118
|
-
"types": "./
|
|
119
|
-
"default": "./
|
|
117
|
+
"types": "./request-idle-callback/index.d.ts",
|
|
118
|
+
"default": "./request-idle-callback/index.mjs"
|
|
120
119
|
},
|
|
121
|
-
"require": "./
|
|
122
|
-
"default": "./
|
|
120
|
+
"require": "./request-idle-callback/index.cjs",
|
|
121
|
+
"default": "./request-idle-callback/index.js"
|
|
122
|
+
},
|
|
123
|
+
"./use-isomorphic-layout-effect": {
|
|
124
|
+
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
125
|
+
"import": {
|
|
126
|
+
"types": "./use-isomorphic-layout-effect/index.d.ts",
|
|
127
|
+
"default": "./use-isomorphic-layout-effect/index.mjs"
|
|
128
|
+
},
|
|
129
|
+
"require": "./use-isomorphic-layout-effect/index.cjs",
|
|
130
|
+
"default": "./use-isomorphic-layout-effect/index.js"
|
|
123
131
|
},
|
|
124
132
|
"./use-is-client": {
|
|
125
133
|
"types": "./use-is-client/index.d.ts",
|
|
@@ -130,68 +138,41 @@
|
|
|
130
138
|
"require": "./use-is-client/index.cjs",
|
|
131
139
|
"default": "./use-is-client/index.js"
|
|
132
140
|
},
|
|
133
|
-
"./use-
|
|
134
|
-
"types": "./use-
|
|
135
|
-
"import": {
|
|
136
|
-
"types": "./use-debounced-state/index.d.ts",
|
|
137
|
-
"default": "./use-debounced-state/index.mjs"
|
|
138
|
-
},
|
|
139
|
-
"require": "./use-debounced-state/index.cjs",
|
|
140
|
-
"default": "./use-debounced-state/index.js"
|
|
141
|
-
},
|
|
142
|
-
"./noop": {
|
|
143
|
-
"types": "./noop/index.d.ts",
|
|
144
|
-
"import": {
|
|
145
|
-
"types": "./noop/index.d.ts",
|
|
146
|
-
"default": "./noop/index.mjs"
|
|
147
|
-
},
|
|
148
|
-
"require": "./noop/index.cjs",
|
|
149
|
-
"default": "./noop/index.js"
|
|
150
|
-
},
|
|
151
|
-
"./use-set": {
|
|
152
|
-
"types": "./use-set/index.d.ts",
|
|
153
|
-
"import": {
|
|
154
|
-
"types": "./use-set/index.d.ts",
|
|
155
|
-
"default": "./use-set/index.mjs"
|
|
156
|
-
},
|
|
157
|
-
"require": "./use-set/index.cjs",
|
|
158
|
-
"default": "./use-set/index.js"
|
|
159
|
-
},
|
|
160
|
-
"./use-map": {
|
|
161
|
-
"types": "./use-map/index.d.ts",
|
|
141
|
+
"./use-uncontrolled": {
|
|
142
|
+
"types": "./use-uncontrolled/index.d.ts",
|
|
162
143
|
"import": {
|
|
163
|
-
"types": "./use-
|
|
164
|
-
"default": "./use-
|
|
144
|
+
"types": "./use-uncontrolled/index.d.ts",
|
|
145
|
+
"default": "./use-uncontrolled/index.mjs"
|
|
165
146
|
},
|
|
166
|
-
"require": "./use-
|
|
167
|
-
"default": "./use-
|
|
147
|
+
"require": "./use-uncontrolled/index.cjs",
|
|
148
|
+
"default": "./use-uncontrolled/index.js"
|
|
168
149
|
},
|
|
169
|
-
"./
|
|
170
|
-
"types": "./
|
|
150
|
+
"./use-session-storage": {
|
|
151
|
+
"types": "./use-session-storage/index.d.ts",
|
|
171
152
|
"import": {
|
|
172
|
-
"types": "./
|
|
173
|
-
"default": "./
|
|
153
|
+
"types": "./use-session-storage/index.d.ts",
|
|
154
|
+
"default": "./use-session-storage/index.mjs"
|
|
174
155
|
},
|
|
175
|
-
"require": "./
|
|
176
|
-
"default": "./
|
|
156
|
+
"require": "./use-session-storage/index.cjs",
|
|
157
|
+
"default": "./use-session-storage/index.js"
|
|
177
158
|
},
|
|
178
|
-
"./use": {
|
|
179
|
-
"types": "./use/index.d.ts",
|
|
159
|
+
"./use-react-router-enable-concurrent-navigation": {
|
|
160
|
+
"types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
|
|
180
161
|
"import": {
|
|
181
|
-
"types": "./use/index.d.ts",
|
|
182
|
-
"default": "./use/index.mjs"
|
|
162
|
+
"types": "./use-react-router-enable-concurrent-navigation/index.d.ts",
|
|
163
|
+
"default": "./use-react-router-enable-concurrent-navigation/index.mjs"
|
|
183
164
|
},
|
|
184
|
-
"require": "./use/index.cjs",
|
|
185
|
-
"default": "./use/index.js"
|
|
165
|
+
"require": "./use-react-router-enable-concurrent-navigation/index.cjs",
|
|
166
|
+
"default": "./use-react-router-enable-concurrent-navigation/index.js"
|
|
186
167
|
},
|
|
187
|
-
"./
|
|
188
|
-
"types": "./
|
|
168
|
+
"./noop": {
|
|
169
|
+
"types": "./noop/index.d.ts",
|
|
189
170
|
"import": {
|
|
190
|
-
"types": "./
|
|
191
|
-
"default": "./
|
|
171
|
+
"types": "./noop/index.d.ts",
|
|
172
|
+
"default": "./noop/index.mjs"
|
|
192
173
|
},
|
|
193
|
-
"require": "./
|
|
194
|
-
"default": "./
|
|
174
|
+
"require": "./noop/index.cjs",
|
|
175
|
+
"default": "./noop/index.js"
|
|
195
176
|
},
|
|
196
177
|
"./use-react-router-is-match": {
|
|
197
178
|
"types": "./use-react-router-is-match/index.d.ts",
|
|
@@ -202,14 +183,32 @@
|
|
|
202
183
|
"require": "./use-react-router-is-match/index.cjs",
|
|
203
184
|
"default": "./use-react-router-is-match/index.js"
|
|
204
185
|
},
|
|
205
|
-
"./
|
|
206
|
-
"types": "./
|
|
186
|
+
"./use-next-pathname": {
|
|
187
|
+
"types": "./use-next-pathname/index.d.ts",
|
|
207
188
|
"import": {
|
|
208
|
-
"types": "./
|
|
209
|
-
"default": "./
|
|
189
|
+
"types": "./use-next-pathname/index.d.ts",
|
|
190
|
+
"default": "./use-next-pathname/index.mjs"
|
|
210
191
|
},
|
|
211
|
-
"require": "./
|
|
212
|
-
"default": "./
|
|
192
|
+
"require": "./use-next-pathname/index.cjs",
|
|
193
|
+
"default": "./use-next-pathname/index.js"
|
|
194
|
+
},
|
|
195
|
+
"./create-context-state": {
|
|
196
|
+
"types": "./create-context-state/index.d.ts",
|
|
197
|
+
"import": {
|
|
198
|
+
"types": "./create-context-state/index.d.ts",
|
|
199
|
+
"default": "./create-context-state/index.mjs"
|
|
200
|
+
},
|
|
201
|
+
"require": "./create-context-state/index.cjs",
|
|
202
|
+
"default": "./create-context-state/index.js"
|
|
203
|
+
},
|
|
204
|
+
"./use-clipboard": {
|
|
205
|
+
"types": "./use-clipboard/index.d.ts",
|
|
206
|
+
"import": {
|
|
207
|
+
"types": "./use-clipboard/index.d.ts",
|
|
208
|
+
"default": "./use-clipboard/index.mjs"
|
|
209
|
+
},
|
|
210
|
+
"require": "./use-clipboard/index.cjs",
|
|
211
|
+
"default": "./use-clipboard/index.js"
|
|
213
212
|
},
|
|
214
213
|
"./use-singleton": {
|
|
215
214
|
"types": "./use-singleton/index.d.ts",
|
|
@@ -220,95 +219,113 @@
|
|
|
220
219
|
"require": "./use-singleton/index.cjs",
|
|
221
220
|
"default": "./use-singleton/index.js"
|
|
222
221
|
},
|
|
223
|
-
"./
|
|
224
|
-
"types": "./
|
|
222
|
+
"./use-map": {
|
|
223
|
+
"types": "./use-map/index.d.ts",
|
|
225
224
|
"import": {
|
|
226
|
-
"types": "./
|
|
227
|
-
"default": "./
|
|
225
|
+
"types": "./use-map/index.d.ts",
|
|
226
|
+
"default": "./use-map/index.mjs"
|
|
228
227
|
},
|
|
229
|
-
"require": "./
|
|
230
|
-
"default": "./
|
|
228
|
+
"require": "./use-map/index.cjs",
|
|
229
|
+
"default": "./use-map/index.js"
|
|
231
230
|
},
|
|
232
|
-
"./use-
|
|
233
|
-
"types": "./use-
|
|
231
|
+
"./use-debounced-value": {
|
|
232
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
234
233
|
"import": {
|
|
235
|
-
"types": "./use-
|
|
236
|
-
"default": "./use-
|
|
234
|
+
"types": "./use-debounced-value/index.d.ts",
|
|
235
|
+
"default": "./use-debounced-value/index.mjs"
|
|
237
236
|
},
|
|
238
|
-
"require": "./use-
|
|
239
|
-
"default": "./use-
|
|
237
|
+
"require": "./use-debounced-value/index.cjs",
|
|
238
|
+
"default": "./use-debounced-value/index.js"
|
|
240
239
|
},
|
|
241
|
-
"./
|
|
242
|
-
"types": "./
|
|
240
|
+
"./use-url-hash-state": {
|
|
241
|
+
"types": "./use-url-hash-state/index.d.ts",
|
|
243
242
|
"import": {
|
|
244
|
-
"types": "./
|
|
245
|
-
"default": "./
|
|
243
|
+
"types": "./use-url-hash-state/index.d.ts",
|
|
244
|
+
"default": "./use-url-hash-state/index.mjs"
|
|
246
245
|
},
|
|
247
|
-
"require": "./
|
|
248
|
-
"default": "./
|
|
246
|
+
"require": "./use-url-hash-state/index.cjs",
|
|
247
|
+
"default": "./use-url-hash-state/index.js"
|
|
249
248
|
},
|
|
250
|
-
"./
|
|
251
|
-
"types": "./
|
|
249
|
+
"./use-next-link": {
|
|
250
|
+
"types": "./use-next-link/index.d.ts",
|
|
252
251
|
"import": {
|
|
253
|
-
"types": "./
|
|
254
|
-
"default": "./
|
|
252
|
+
"types": "./use-next-link/index.d.ts",
|
|
253
|
+
"default": "./use-next-link/index.mjs"
|
|
255
254
|
},
|
|
256
|
-
"require": "./
|
|
257
|
-
"default": "./
|
|
255
|
+
"require": "./use-next-link/index.cjs",
|
|
256
|
+
"default": "./use-next-link/index.js"
|
|
258
257
|
},
|
|
259
|
-
"./use
|
|
260
|
-
"types": "./use
|
|
258
|
+
"./use": {
|
|
259
|
+
"types": "./use/index.d.ts",
|
|
261
260
|
"import": {
|
|
262
|
-
"types": "./use
|
|
263
|
-
"default": "./use
|
|
261
|
+
"types": "./use/index.d.ts",
|
|
262
|
+
"default": "./use/index.mjs"
|
|
264
263
|
},
|
|
265
|
-
"require": "./use
|
|
266
|
-
"default": "./use
|
|
264
|
+
"require": "./use/index.cjs",
|
|
265
|
+
"default": "./use/index.js"
|
|
267
266
|
},
|
|
268
|
-
"./
|
|
269
|
-
"types": "./
|
|
267
|
+
"./nullthrow": {
|
|
268
|
+
"types": "./nullthrow/index.d.ts",
|
|
270
269
|
"import": {
|
|
271
|
-
"types": "./
|
|
272
|
-
"default": "./
|
|
270
|
+
"types": "./nullthrow/index.d.ts",
|
|
271
|
+
"default": "./nullthrow/index.mjs"
|
|
273
272
|
},
|
|
274
|
-
"require": "./
|
|
275
|
-
"default": "./
|
|
273
|
+
"require": "./nullthrow/index.cjs",
|
|
274
|
+
"default": "./nullthrow/index.js"
|
|
276
275
|
},
|
|
277
|
-
"./
|
|
278
|
-
"types": "./
|
|
276
|
+
"./typescript-happy-forward-ref": {
|
|
277
|
+
"types": "./typescript-happy-forward-ref/index.d.ts",
|
|
279
278
|
"import": {
|
|
280
|
-
"types": "./
|
|
281
|
-
"default": "./
|
|
279
|
+
"types": "./typescript-happy-forward-ref/index.d.ts",
|
|
280
|
+
"default": "./typescript-happy-forward-ref/index.mjs"
|
|
282
281
|
},
|
|
283
|
-
"require": "./
|
|
284
|
-
"default": "./
|
|
282
|
+
"require": "./typescript-happy-forward-ref/index.cjs",
|
|
283
|
+
"default": "./typescript-happy-forward-ref/index.js"
|
|
285
284
|
},
|
|
286
|
-
"./use-
|
|
287
|
-
"types": "./use-
|
|
285
|
+
"./use-intersection": {
|
|
286
|
+
"types": "./use-intersection/index.d.ts",
|
|
288
287
|
"import": {
|
|
289
|
-
"types": "./use-
|
|
290
|
-
"default": "./use-
|
|
288
|
+
"types": "./use-intersection/index.d.ts",
|
|
289
|
+
"default": "./use-intersection/index.mjs"
|
|
291
290
|
},
|
|
292
|
-
"require": "./use-
|
|
293
|
-
"default": "./use-
|
|
291
|
+
"require": "./use-intersection/index.cjs",
|
|
292
|
+
"default": "./use-intersection/index.js"
|
|
294
293
|
},
|
|
295
|
-
"./use-
|
|
296
|
-
"types": "./use-
|
|
294
|
+
"./use-set": {
|
|
295
|
+
"types": "./use-set/index.d.ts",
|
|
297
296
|
"import": {
|
|
298
|
-
"types": "./use-
|
|
299
|
-
"default": "./use-
|
|
297
|
+
"types": "./use-set/index.d.ts",
|
|
298
|
+
"default": "./use-set/index.mjs"
|
|
300
299
|
},
|
|
301
|
-
"require": "./use-
|
|
302
|
-
"default": "./use-
|
|
300
|
+
"require": "./use-set/index.cjs",
|
|
301
|
+
"default": "./use-set/index.js"
|
|
303
302
|
},
|
|
304
|
-
"./
|
|
305
|
-
"types": "./
|
|
303
|
+
"./compose-context-provider": {
|
|
304
|
+
"types": "./compose-context-provider/index.d.ts",
|
|
306
305
|
"import": {
|
|
307
|
-
"types": "./
|
|
308
|
-
"default": "./
|
|
306
|
+
"types": "./compose-context-provider/index.d.ts",
|
|
307
|
+
"default": "./compose-context-provider/index.mjs"
|
|
309
308
|
},
|
|
310
|
-
"require": "./
|
|
311
|
-
"default": "./
|
|
309
|
+
"require": "./compose-context-provider/index.cjs",
|
|
310
|
+
"default": "./compose-context-provider/index.js"
|
|
311
|
+
},
|
|
312
|
+
"./use-array": {
|
|
313
|
+
"types": "./use-array/index.d.ts",
|
|
314
|
+
"import": {
|
|
315
|
+
"types": "./use-array/index.d.ts",
|
|
316
|
+
"default": "./use-array/index.mjs"
|
|
317
|
+
},
|
|
318
|
+
"require": "./use-array/index.cjs",
|
|
319
|
+
"default": "./use-array/index.js"
|
|
320
|
+
},
|
|
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"
|
|
312
329
|
},
|
|
313
330
|
"./create-storage-hook": {
|
|
314
331
|
"types": "./create-storage-hook/index.d.ts",
|
|
@@ -319,23 +336,14 @@
|
|
|
319
336
|
"require": "./create-storage-hook/index.cjs",
|
|
320
337
|
"default": "./create-storage-hook/index.js"
|
|
321
338
|
},
|
|
322
|
-
"./use-
|
|
323
|
-
"types": "./use-
|
|
324
|
-
"import": {
|
|
325
|
-
"types": "./use-debounced-value/index.d.ts",
|
|
326
|
-
"default": "./use-debounced-value/index.mjs"
|
|
327
|
-
},
|
|
328
|
-
"require": "./use-debounced-value/index.cjs",
|
|
329
|
-
"default": "./use-debounced-value/index.js"
|
|
330
|
-
},
|
|
331
|
-
"./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired": {
|
|
332
|
-
"types": "./use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.d.ts",
|
|
339
|
+
"./use-retimer": {
|
|
340
|
+
"types": "./use-retimer/index.d.ts",
|
|
333
341
|
"import": {
|
|
334
|
-
"types": "./use-
|
|
335
|
-
"default": "./use-
|
|
342
|
+
"types": "./use-retimer/index.d.ts",
|
|
343
|
+
"default": "./use-retimer/index.mjs"
|
|
336
344
|
},
|
|
337
|
-
"require": "./use-
|
|
338
|
-
"default": "./use-
|
|
345
|
+
"require": "./use-retimer/index.cjs",
|
|
346
|
+
"default": "./use-retimer/index.js"
|
|
339
347
|
},
|
|
340
348
|
"./use-local-storage": {
|
|
341
349
|
"types": "./use-local-storage/index.d.ts",
|
|
@@ -346,41 +354,41 @@
|
|
|
346
354
|
"require": "./use-local-storage/index.cjs",
|
|
347
355
|
"default": "./use-local-storage/index.js"
|
|
348
356
|
},
|
|
349
|
-
"./
|
|
350
|
-
"types": "./
|
|
357
|
+
"./invariant": {
|
|
358
|
+
"types": "./invariant/index.d.ts",
|
|
351
359
|
"import": {
|
|
352
|
-
"types": "./
|
|
353
|
-
"default": "./
|
|
360
|
+
"types": "./invariant/index.d.ts",
|
|
361
|
+
"default": "./invariant/index.mjs"
|
|
354
362
|
},
|
|
355
|
-
"require": "./
|
|
356
|
-
"default": "./
|
|
363
|
+
"require": "./invariant/index.cjs",
|
|
364
|
+
"default": "./invariant/index.js"
|
|
357
365
|
},
|
|
358
|
-
"./
|
|
359
|
-
"types": "./
|
|
366
|
+
"./use-error-boundary": {
|
|
367
|
+
"types": "./use-error-boundary/index.d.ts",
|
|
360
368
|
"import": {
|
|
361
|
-
"types": "./
|
|
362
|
-
"default": "./
|
|
369
|
+
"types": "./use-error-boundary/index.d.ts",
|
|
370
|
+
"default": "./use-error-boundary/index.mjs"
|
|
363
371
|
},
|
|
364
|
-
"require": "./
|
|
365
|
-
"default": "./
|
|
372
|
+
"require": "./use-error-boundary/index.cjs",
|
|
373
|
+
"default": "./use-error-boundary/index.js"
|
|
366
374
|
},
|
|
367
|
-
"./use-
|
|
368
|
-
"types": "./use-
|
|
375
|
+
"./use-composition-input": {
|
|
376
|
+
"types": "./use-composition-input/index.d.ts",
|
|
369
377
|
"import": {
|
|
370
|
-
"types": "./use-
|
|
371
|
-
"default": "./use-
|
|
378
|
+
"types": "./use-composition-input/index.d.ts",
|
|
379
|
+
"default": "./use-composition-input/index.mjs"
|
|
372
380
|
},
|
|
373
|
-
"require": "./use-
|
|
374
|
-
"default": "./use-
|
|
381
|
+
"require": "./use-composition-input/index.cjs",
|
|
382
|
+
"default": "./use-composition-input/index.js"
|
|
375
383
|
},
|
|
376
|
-
"./
|
|
377
|
-
"types": "./
|
|
384
|
+
"./no-ssr": {
|
|
385
|
+
"types": "./no-ssr/index.d.ts",
|
|
378
386
|
"import": {
|
|
379
|
-
"types": "./
|
|
380
|
-
"default": "./
|
|
387
|
+
"types": "./no-ssr/index.d.ts",
|
|
388
|
+
"default": "./no-ssr/index.mjs"
|
|
381
389
|
},
|
|
382
|
-
"require": "./
|
|
383
|
-
"default": "./
|
|
390
|
+
"require": "./no-ssr/index.cjs",
|
|
391
|
+
"default": "./no-ssr/index.js"
|
|
384
392
|
}
|
|
385
393
|
}
|
|
386
394
|
}
|
package/sizes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"total":{"raw":
|
|
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,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
2
2
|
|
|
3
3
|
/** @see https://foxact.skk.moe/use-isomorphic-layout-effect */
|
|
4
|
-
declare const useIsomorphicLayoutEffect: typeof
|
|
4
|
+
declare const useIsomorphicLayoutEffect: typeof useLayoutEffect$1;
|
|
5
5
|
/** @see https://foxact.skk.moe/use-isomorphic-layout-effect */
|
|
6
|
-
declare const useLayoutEffect: typeof
|
|
6
|
+
declare const useLayoutEffect: typeof useLayoutEffect$1;
|
|
7
7
|
|
|
8
8
|
export { useIsomorphicLayoutEffect, useLayoutEffect };
|
|
@@ -0,0 +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}]};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LinkProps } from 'next/link';
|
|
2
|
+
|
|
3
|
+
interface UrlObject {
|
|
4
|
+
auth?: string | null | undefined;
|
|
5
|
+
hash?: string | null | undefined;
|
|
6
|
+
host?: string | null | undefined;
|
|
7
|
+
hostname?: string | null | undefined;
|
|
8
|
+
href?: string | null | undefined;
|
|
9
|
+
pathname?: string | null | undefined;
|
|
10
|
+
protocol?: string | null | undefined;
|
|
11
|
+
search?: string | null | undefined;
|
|
12
|
+
slashes?: boolean | null | undefined;
|
|
13
|
+
port?: string | number | null | undefined;
|
|
14
|
+
query?: any;
|
|
15
|
+
}
|
|
16
|
+
interface UseNextLinkOptions extends Omit<LinkProps, 'as' | 'href' | 'legacyBehavior' | 'shallow' | 'passHref' | 'locale'> {
|
|
17
|
+
ref?: React.RefObject<HTMLAnchorElement> | React.RefCallback<HTMLAnchorElement> | null;
|
|
18
|
+
}
|
|
19
|
+
interface UseNextLinkReturnProps extends Partial<JSX.IntrinsicElements['a']> {
|
|
20
|
+
ref: React.RefCallback<HTMLAnchorElement>;
|
|
21
|
+
onTouchStart: React.TouchEventHandler<HTMLAnchorElement>;
|
|
22
|
+
onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>;
|
|
23
|
+
onClick: React.MouseEventHandler<HTMLAnchorElement>;
|
|
24
|
+
href?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const unstable_useNextLink: (hrefProp: string | UrlObject, { prefetch: prefetchProp, ref, onClick, onMouseEnter, onTouchStart, scroll: routerScroll, replace, ...restProps }: UseNextLinkOptions) => [isPending: boolean, linkProps: UseNextLinkReturnProps];
|
|
27
|
+
|
|
28
|
+
export { type UseNextLinkOptions, type UseNextLinkReturnProps, unstable_useNextLink };
|
|
@@ -0,0 +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}]};
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.cjs"),n=require("../no-ssr/index.cjs");const t=e=>e,a=(()=>{if("undefined"==typeof window)return e=>r.noop;let e=!1;const n=new Set,t=()=>{n.forEach(e=>e())};return r=>(n.add(r),e||(e=!0,window.addEventListener("hashchange",t)),()=>{n.delete(r)})})(),l=e=>"function"==typeof e,o=()=>{throw n.noSSRError("useUrlHashState cannot be used on the server without a serverValue")};exports.unstable_useUrlHashState=function(r,n){var s;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:t,deserializer:t};const u=i.raw?t:i.serializer,c=i.raw?t:i.deserializer,d=void 0!==n?()=>u(n):o,h=e.useSyncExternalStore(a,()=>new URLSearchParams(location.hash.slice(1)).get(r),d),w=e.useMemo(()=>null===h?null!=n?n:null:c(h),[n,c,h]),S=e.useCallback(e=>{const t=location.hash,a=new URLSearchParams(t.slice(1)),o=l(e)?e(w):e;o===n||null===o?a.delete(r):a.set(r,u(o));const s=a.toString();t!==s&&(location.hash=s)},[n,w,r,u]);return[(s=null!=w?w:n)
|
|
1
|
+
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.cjs"),n=require("../no-ssr/index.cjs");const t=e=>e,a=(()=>{if("undefined"==typeof window)return e=>r.noop;let e=!1;const n=new Set,t=()=>{n.forEach(e=>e())};return r=>(n.add(r),e||(e=!0,window.addEventListener("hashchange",t)),()=>{n.delete(r)})})(),l=e=>"function"==typeof e,o=()=>{throw n.noSSRError("useUrlHashState cannot be used on the server without a serverValue")};exports.unstable_useUrlHashState=function(r,n){var s;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:t,deserializer:t};const u=i.raw?t:i.serializer,c=i.raw?t:i.deserializer,d=void 0!==n?()=>u(n):o,h=e.useSyncExternalStore(a,()=>new URLSearchParams(location.hash.slice(1)).get(r),d),w=e.useMemo(()=>null===h?null!=n?n:null:c(h),[n,c,h]),S=e.useCallback(e=>{const t=location.hash,a=new URLSearchParams(t.slice(1)),o=l(e)?e(w):e;o===n||null===o?a.delete(r):a.set(r,u(o));const s=a.toString();t!==s&&(location.hash=s)},[n,w,r,u]);return[null!==(s=null!=w?w:n)&&void 0!==s?s:null,S]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.js"),n=require("../no-ssr/index.js");const t=e=>e,a=(()=>{if("undefined"==typeof window)return e=>r.noop;let e=!1;const n=new Set,t=()=>{n.forEach(e=>e())};return r=>(n.add(r),e||(e=!0,window.addEventListener("hashchange",t)),()=>{n.delete(r)})})(),l=e=>"function"==typeof e,o=()=>{throw n.noSSRError("useUrlHashState cannot be used on the server without a serverValue")};exports.unstable_useUrlHashState=function(r,n){var s;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:t,deserializer:t};const u=i.raw?t:i.serializer,c=i.raw?t:i.deserializer,d=void 0!==n?()=>u(n):o,h=e.useSyncExternalStore(a,()=>new URLSearchParams(location.hash.slice(1)).get(r),d),w=e.useMemo(()=>null===h?null!=n?n:null:c(h),[n,c,h]),S=e.useCallback(e=>{const t=location.hash,a=new URLSearchParams(t.slice(1)),o=l(e)?e(w):e;o===n||null===o?a.delete(r):a.set(r,u(o));const s=a.toString();t!==s&&(location.hash=s)},[n,w,r,u]);return[(s=null!=w?w:n)
|
|
1
|
+
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.js"),n=require("../no-ssr/index.js");const t=e=>e,a=(()=>{if("undefined"==typeof window)return e=>r.noop;let e=!1;const n=new Set,t=()=>{n.forEach(e=>e())};return r=>(n.add(r),e||(e=!0,window.addEventListener("hashchange",t)),()=>{n.delete(r)})})(),l=e=>"function"==typeof e,o=()=>{throw n.noSSRError("useUrlHashState cannot be used on the server without a serverValue")};exports.unstable_useUrlHashState=function(r,n){var s;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:t,deserializer:t};const u=i.raw?t:i.serializer,c=i.raw?t:i.deserializer,d=void 0!==n?()=>u(n):o,h=e.useSyncExternalStore(a,()=>new URLSearchParams(location.hash.slice(1)).get(r),d),w=e.useMemo(()=>null===h?null!=n?n:null:c(h),[n,c,h]),S=e.useCallback(e=>{const t=location.hash,a=new URLSearchParams(t.slice(1)),o=l(e)?e(w):e;o===n||null===o?a.delete(r):a.set(r,u(o));const s=a.toString();t!==s&&(location.hash=s)},[n,w,r,u]);return[null!==(s=null!=w?w:n)&&void 0!==s?s:null,S]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"client-only";import{useSyncExternalStore as e,useMemo as t,useCallback as n}from"react";import{noop as r}from"../noop/index.mjs";import{noSSRError as o}from"../no-ssr/index.mjs";const a=e=>e,l=(()=>{if("undefined"==typeof window)return e=>r;let e=!1;const t=new Set,n=()=>{t.forEach(e=>e())};return r=>(t.add(r),e||(e=!0,window.addEventListener("hashchange",n)),()=>{t.delete(r)})})(),s=e=>"function"==typeof e,i=()=>{throw o("useUrlHashState cannot be used on the server without a serverValue")};function u(r,o){var u;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:a,deserializer:a};const h=c.raw?a:c.serializer,d=c.raw?a:c.deserializer,m=e(l,()=>new URLSearchParams(location.hash.slice(1)).get(r),void 0!==o?()=>h(o):i),w=t(()=>null===m?null!=o?o:null:d(m),[o,d,m]),f=n(e=>{const t=location.hash,n=new URLSearchParams(t.slice(1)),a=s(e)?e(w):e;a===o||null===a?n.delete(r):n.set(r,h(a));const l=n.toString();t!==l&&(location.hash=l)},[o,w,r,h]);return[(u=null!=w?w:o)
|
|
1
|
+
import"client-only";import{useSyncExternalStore as e,useMemo as t,useCallback as n}from"react";import{noop as r}from"../noop/index.mjs";import{noSSRError as o}from"../no-ssr/index.mjs";const a=e=>e,l=(()=>{if("undefined"==typeof window)return e=>r;let e=!1;const t=new Set,n=()=>{t.forEach(e=>e())};return r=>(t.add(r),e||(e=!0,window.addEventListener("hashchange",n)),()=>{t.delete(r)})})(),s=e=>"function"==typeof e,i=()=>{throw o("useUrlHashState cannot be used on the server without a serverValue")};function u(r,o){var u;let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{serializer:a,deserializer:a};const h=c.raw?a:c.serializer,d=c.raw?a:c.deserializer,m=e(l,()=>new URLSearchParams(location.hash.slice(1)).get(r),void 0!==o?()=>h(o):i),w=t(()=>null===m?null!=o?o:null:d(m),[o,d,m]),f=n(e=>{const t=location.hash,n=new URLSearchParams(t.slice(1)),a=s(e)?e(w):e;a===o||null===a?n.delete(r):n.set(r,h(a));const l=n.toString();t!==l&&(location.hash=l)},[o,w,r,h]);return[null!==(u=null!=w?w:o)&&void 0!==u?u:null,f]}export{u as unstable_useUrlHashState};
|