foxact 0.2.28 → 0.2.29
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.d.ts +2 -2
- package/create-storage-hook/index.js +1 -1
- package/create-storage-hook/index.mjs +1 -1
- package/current-year/index.cjs +2 -0
- package/current-year/index.d.ts +10 -0
- package/current-year/index.js +2 -0
- package/current-year/index.mjs +2 -0
- package/invariant/index.cjs +1 -1
- package/invariant/index.d.ts +1 -1
- package/invariant/index.js +1 -1
- package/invariant/index.mjs +1 -1
- package/nullthrow/index.cjs +1 -1
- package/nullthrow/index.js +1 -1
- package/nullthrow/index.mjs +1 -1
- package/package.json +30 -20
- package/rem/index.cjs +1 -1
- package/rem/index.d.ts +3 -3
- package/rem/index.js +1 -1
- package/rem/index.mjs +1 -1
- package/sizes.json +1 -1
- package/use-clipboard/index.cjs +1 -1
- package/use-clipboard/index.js +1 -1
- package/use-clipboard/index.mjs +1 -1
- package/use-react-router-enable-concurrent-navigation/index.cjs +1 -1
- package/use-react-router-enable-concurrent-navigation/index.js +1 -1
- package/use-react-router-enable-concurrent-navigation/index.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),o=require("../noop/index.cjs"),
|
|
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)!==null&&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])}};
|
|
@@ -5,8 +5,8 @@ type NotUndefined<T> = T extends undefined ? never : T;
|
|
|
5
5
|
type CustomStorageEvent = CustomEvent<string>;
|
|
6
6
|
declare global {
|
|
7
7
|
interface WindowEventMap {
|
|
8
|
-
'foxact-local-storage': CustomStorageEvent;
|
|
9
|
-
'foxact-session-storage': CustomStorageEvent;
|
|
8
|
+
'foxact-use-local-storage': CustomStorageEvent;
|
|
9
|
+
'foxact-use-session-storage': CustomStorageEvent;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
type Serializer<T> = (value: T) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),o=require("../noop/index.js"),
|
|
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)!==null&&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
|
|
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)!==null&&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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../use-isomorphic-layout-effect/index.cjs");require("client-only");var i=r.memo(function(i){let{defaultYear:n,...u}=i;"undefined"==typeof window&&void 0===n&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[o,a]=r.useState(n||new Date().getFullYear());return t.useIsomorphicLayoutEffect(()=>{a(new Date().getFullYear())},[]),e.jsx("span",{...u,children:o})});module.exports=i;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
interface CurrentYearProps extends React.ComponentProps<'span'> {
|
|
5
|
+
defaultYear?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function CopyrightYear({ defaultYear, ...restProps }: CurrentYearProps): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const _default: react.MemoExoticComponent<typeof CopyrightYear>;
|
|
9
|
+
|
|
10
|
+
export { _default as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
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");var i=r.memo(function(i){let{defaultYear:n,...u}=i;"undefined"==typeof window&&void 0===n&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[o,a]=r.useState(n||new Date().getFullYear());return t.useIsomorphicLayoutEffect(()=>{a(new Date().getFullYear())},[]),e.jsx("span",{...u,children:o})});module.exports=i;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{memo as r,useState as t}from"react";import{useIsomorphicLayoutEffect as n}from"../use-isomorphic-layout-effect/index.mjs";import"client-only";var i=r(function(r){let{defaultYear:i,...o}=r;"undefined"==typeof window&&void 0===i&&console.warn('[foxact/current-year] "defaultYear" is required during the server-side rendering.');const[a,d]=t(i||new Date().getFullYear());return n(()=>{d(new Date().getFullYear())},[]),e("span",{...o,children:a})});export{i as default};
|
package/invariant/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.invariant=function(n){
|
|
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/invariant/index.d.ts
CHANGED
package/invariant/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.invariant=function(n){
|
|
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/invariant/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function n(n){
|
|
1
|
+
function n(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)}export{n as invariant};
|
package/nullthrow/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.nullthrow=function(
|
|
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/nullthrow/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.nullthrow=function(
|
|
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/nullthrow/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=function(n){let
|
|
1
|
+
const n=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};export{n as nullthrow};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foxact",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.29",
|
|
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": {
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@latest",
|
|
50
50
|
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
|
|
51
51
|
"function-bind": "npm:@nolyfill/function-bind@latest",
|
|
52
|
-
"object.groupby": "npm:@nolyfill/object.groupby@latest"
|
|
52
|
+
"object.groupby": "npm:@nolyfill/object.groupby@latest",
|
|
53
|
+
"hasown": "npm:@nolyfill/hasown@latest"
|
|
53
54
|
},
|
|
54
55
|
"typeVersions": {
|
|
55
56
|
">=4.8": {
|
|
@@ -84,15 +85,6 @@
|
|
|
84
85
|
"require": "./use-uncontrolled/index.cjs",
|
|
85
86
|
"default": "./use-uncontrolled/index.js"
|
|
86
87
|
},
|
|
87
|
-
"./use-retimer": {
|
|
88
|
-
"types": "./use-retimer/index.d.ts",
|
|
89
|
-
"import": {
|
|
90
|
-
"types": "./use-retimer/index.d.ts",
|
|
91
|
-
"default": "./use-retimer/index.mjs"
|
|
92
|
-
},
|
|
93
|
-
"require": "./use-retimer/index.cjs",
|
|
94
|
-
"default": "./use-retimer/index.js"
|
|
95
|
-
},
|
|
96
88
|
"./use-error-boundary": {
|
|
97
89
|
"types": "./use-error-boundary/index.d.ts",
|
|
98
90
|
"import": {
|
|
@@ -111,6 +103,15 @@
|
|
|
111
103
|
"require": "./rem/index.cjs",
|
|
112
104
|
"default": "./rem/index.js"
|
|
113
105
|
},
|
|
106
|
+
"./use-retimer": {
|
|
107
|
+
"types": "./use-retimer/index.d.ts",
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./use-retimer/index.d.ts",
|
|
110
|
+
"default": "./use-retimer/index.mjs"
|
|
111
|
+
},
|
|
112
|
+
"require": "./use-retimer/index.cjs",
|
|
113
|
+
"default": "./use-retimer/index.js"
|
|
114
|
+
},
|
|
114
115
|
"./use-url-hash-state": {
|
|
115
116
|
"types": "./use-url-hash-state/index.d.ts",
|
|
116
117
|
"import": {
|
|
@@ -237,6 +238,15 @@
|
|
|
237
238
|
"require": "./no-ssr/index.cjs",
|
|
238
239
|
"default": "./no-ssr/index.js"
|
|
239
240
|
},
|
|
241
|
+
"./current-year": {
|
|
242
|
+
"types": "./current-year/index.d.ts",
|
|
243
|
+
"import": {
|
|
244
|
+
"types": "./current-year/index.d.ts",
|
|
245
|
+
"default": "./current-year/index.mjs"
|
|
246
|
+
},
|
|
247
|
+
"require": "./current-year/index.cjs",
|
|
248
|
+
"default": "./current-year/index.js"
|
|
249
|
+
},
|
|
240
250
|
"./create-fixed-array": {
|
|
241
251
|
"types": "./create-fixed-array/index.d.ts",
|
|
242
252
|
"import": {
|
|
@@ -264,15 +274,6 @@
|
|
|
264
274
|
"require": "./use-react-router-enable-concurrent-navigation/index.cjs",
|
|
265
275
|
"default": "./use-react-router-enable-concurrent-navigation/index.js"
|
|
266
276
|
},
|
|
267
|
-
"./use-composition-input": {
|
|
268
|
-
"types": "./use-composition-input/index.d.ts",
|
|
269
|
-
"import": {
|
|
270
|
-
"types": "./use-composition-input/index.d.ts",
|
|
271
|
-
"default": "./use-composition-input/index.mjs"
|
|
272
|
-
},
|
|
273
|
-
"require": "./use-composition-input/index.cjs",
|
|
274
|
-
"default": "./use-composition-input/index.js"
|
|
275
|
-
},
|
|
276
277
|
"./use-next-pathname": {
|
|
277
278
|
"types": "./use-next-pathname/index.d.ts",
|
|
278
279
|
"import": {
|
|
@@ -282,6 +283,15 @@
|
|
|
282
283
|
"require": "./use-next-pathname/index.cjs",
|
|
283
284
|
"default": "./use-next-pathname/index.js"
|
|
284
285
|
},
|
|
286
|
+
"./use-composition-input": {
|
|
287
|
+
"types": "./use-composition-input/index.d.ts",
|
|
288
|
+
"import": {
|
|
289
|
+
"types": "./use-composition-input/index.d.ts",
|
|
290
|
+
"default": "./use-composition-input/index.mjs"
|
|
291
|
+
},
|
|
292
|
+
"require": "./use-composition-input/index.cjs",
|
|
293
|
+
"default": "./use-composition-input/index.js"
|
|
294
|
+
},
|
|
285
295
|
"./use-session-storage": {
|
|
286
296
|
"types": "./use-session-storage/index.d.ts",
|
|
287
297
|
"import": {
|
package/rem/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n="16px";function
|
|
1
|
+
"use strict";const n="16px";function r(n,r){return"calc(".concat(n," * ").concat(r,")")}function e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function c(i){if(Array.isArray(i))return i.map(n=>c(n)).join(" ");if(0===i||"0"===i)return"0";if("number"==typeof i){const c="".concat(i/16).concat(e);return t&&t!==n?r(c,t):c}if(i.includes("calc(")||i.includes("var(")||i.includes("clamp("))return i;if(i.includes(" "))return i.split(" ").map(n=>c(n)).join(" ");if(i.includes(e))return t&&t!==n?r(i,t):i;const u=Number(i.replace("px",""));if(u==u){const c="".concat(u/16).concat(e);return t&&t!==n?r(c,t):c}return i}}const t=e("rem",n),c=e("rem","var(--mantine-scale)"),i=e("em");exports.em=i,exports.mantine_rem=c,exports.rem=t;
|
package/rem/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare const rem: (value: number | string) => string;
|
|
2
|
-
declare const mantine_rem: (value: number | string) => string;
|
|
3
|
-
declare const em: (value: number | string) => string;
|
|
1
|
+
declare const rem: (value: number | string | number[] | string[]) => string;
|
|
2
|
+
declare const mantine_rem: (value: number | string | number[] | string[]) => string;
|
|
3
|
+
declare const em: (value: number | string | number[] | string[]) => string;
|
|
4
4
|
|
|
5
5
|
export { em, mantine_rem, rem };
|
package/rem/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n="16px";function
|
|
1
|
+
"use strict";const n="16px";function r(n,r){return"calc(".concat(n," * ").concat(r,")")}function e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function c(i){if(Array.isArray(i))return i.map(n=>c(n)).join(" ");if(0===i||"0"===i)return"0";if("number"==typeof i){const c="".concat(i/16).concat(e);return t&&t!==n?r(c,t):c}if(i.includes("calc(")||i.includes("var(")||i.includes("clamp("))return i;if(i.includes(" "))return i.split(" ").map(n=>c(n)).join(" ");if(i.includes(e))return t&&t!==n?r(i,t):i;const u=Number(i.replace("px",""));if(u==u){const c="".concat(u/16).concat(e);return t&&t!==n?r(c,t):c}return i}}const t=e("rem",n),c=e("rem","var(--mantine-scale)"),i=e("em");exports.em=i,exports.mantine_rem=c,exports.rem=t;
|
package/rem/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const n="16px";function
|
|
1
|
+
const n="16px";function r(n,r){return"calc(".concat(n," * ").concat(r,")")}function c(c){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function t(i){if(Array.isArray(i))return i.map(n=>t(n)).join(" ");if(0===i||"0"===i)return"0";if("number"==typeof i){const t="".concat(i/16).concat(c);return e&&e!==n?r(t,e):t}if(i.includes("calc(")||i.includes("var(")||i.includes("clamp("))return i;if(i.includes(" "))return i.split(" ").map(n=>t(n)).join(" ");if(i.includes(c))return e&&e!==n?r(i,e):i;const u=Number(i.replace("px",""));if(u==u){const t="".concat(u/16).concat(c);return e&&e!==n?r(t,e):t}return i}}const e=c("rem",n),t=c("rem","var(--mantine-scale)"),i=c("em");export{i as em,t as mantine_rem,e as rem};
|
package/sizes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"total":{"raw":
|
|
1
|
+
{"total":{"raw":15590,"gzip":9630,"br":0},"exports":{"use-error-boundary":{"raw":244,"gzip":196,"br":159},"nullthrow":{"raw":194,"gzip":167,"br":128},"use-uncontrolled":{"raw":296,"gzip":227,"br":193},"use-retimer":{"raw":200,"gzip":165,"br":123},"use-is-client":{"raw":151,"gzip":142,"br":118},"rem":{"raw":734,"gzip":380,"br":333},"noop":{"raw":33,"gzip":53,"br":37},"use-debounced-state":{"raw":401,"gzip":280,"br":242},"use-url-hash-state":{"raw":1069,"gzip":613,"br":534},"use-set":{"raw":347,"gzip":240,"br":203},"typescript-happy-forward-ref":{"raw":119,"gzip":103,"br":80},"use-map":{"raw":346,"gzip":244,"br":210},"use":{"raw":276,"gzip":182,"br":150},"compose-context-provider":{"raw":164,"gzip":148,"br":114},"use-singleton":{"raw":138,"gzip":129,"br":109},"use-react-router-is-match":{"raw":568,"gzip":371,"br":309},"request-idle-callback":{"raw":410,"gzip":229,"br":175},"no-ssr":{"raw":389,"gzip":269,"br":228},"use-intersection":{"raw":1230,"gzip":649,"br":597},"create-fixed-array":{"raw":100,"gzip":104,"br":89},"current-year":{"raw":527,"gzip":358,"br":290},"use-next-pathname":{"raw":321,"gzip":236,"br":199},"use-clipboard":{"raw":1067,"gzip":611,"br":524},"use-composition-input":{"raw":454,"gzip":281,"br":238},"invariant":{"raw":178,"gzip":156,"br":118},"use-react-router-enable-concurrent-navigation":{"raw":960,"gzip":470,"br":387},"use-session-storage":{"raw":316,"gzip":181,"br":152},"use-debounced-value":{"raw":470,"gzip":309,"br":252},"use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired":{"raw":459,"gzip":325,"br":254},"context-state":{"raw":377,"gzip":241,"br":207},"create-context-state":{"raw":145,"gzip":116,"br":96},"use-local-storage":{"raw":310,"gzip":184,"br":157},"use-isomorphic-layout-effect":{"raw":178,"gzip":142,"br":113},"create-storage-hook":{"raw":2090,"gzip":891,"br":775},"use-array":{"raw":329,"gzip":238,"br":199}}}
|
package/use-clipboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.cjs"),t=require("../use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs");class a extends Error{}exports.UseClipboardError=a,exports.useClipboard=function(){let{timeout:o=1e3,usePromptAsFallback:l=!1,promptFallbackText:i="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[u,c]=e.useState(null),[s,d]=e.useState(!1),p=e.useRef(null),b=t.useStableHandler(n||r.noop),w=e.useCallback(e=>{p.current&&clearTimeout(p.current),e&&(p.current=window.setTimeout(()=>d(!1),o)),d(e)},[o]),y=e.useCallback(e=>{c(e),b(e)},[b]);return{copy:e.useCallback(async e=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(e),w(!0);else throw new a("[foxact]
|
|
1
|
+
"use strict";require("client-only");var e=require("react"),r=require("../noop/index.cjs"),t=require("../use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.cjs");class a extends Error{}exports.UseClipboardError=a,exports.useClipboard=function(){let{timeout:o=1e3,usePromptAsFallback:l=!1,promptFallbackText:i="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[u,c]=e.useState(null),[s,d]=e.useState(!1),p=e.useRef(null),b=t.useStableHandler(n||r.noop),w=e.useCallback(e=>{p.current&&clearTimeout(p.current),e&&(p.current=window.setTimeout(()=>d(!1),o)),d(e)},[o]),y=e.useCallback(e=>{c(e),b(e)},[b]);return{copy:e.useCallback(async e=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(e),w(!0);else throw new a("[foxact/use-clipboard] navigator.clipboard is not supported")}catch(r){if(l)try{window.prompt(i,e)}catch(e){y(e)}else y(r)}},[w,i,y,l]),reset:e.useCallback(()=>{d(!1),c(null),p.current&&clearTimeout(p.current)},[]),error:u,copied:s}};
|
package/use-clipboard/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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");class a extends Error{}exports.UseClipboardError=a,exports.useClipboard=function(){let{timeout:o=1e3,usePromptAsFallback:l=!1,promptFallbackText:i="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[u,c]=e.useState(null),[s,d]=e.useState(!1),p=e.useRef(null),b=t.useStableHandler(n||r.noop),w=e.useCallback(e=>{p.current&&clearTimeout(p.current),e&&(p.current=window.setTimeout(()=>d(!1),o)),d(e)},[o]),y=e.useCallback(e=>{c(e),b(e)},[b]);return{copy:e.useCallback(async e=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(e),w(!0);else throw new a("[foxact]
|
|
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");class a extends Error{}exports.UseClipboardError=a,exports.useClipboard=function(){let{timeout:o=1e3,usePromptAsFallback:l=!1,promptFallbackText:i="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[u,c]=e.useState(null),[s,d]=e.useState(!1),p=e.useRef(null),b=t.useStableHandler(n||r.noop),w=e.useCallback(e=>{p.current&&clearTimeout(p.current),e&&(p.current=window.setTimeout(()=>d(!1),o)),d(e)},[o]),y=e.useCallback(e=>{c(e),b(e)},[b]);return{copy:e.useCallback(async e=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(e),w(!0);else throw new a("[foxact/use-clipboard] navigator.clipboard is not supported")}catch(r){if(l)try{window.prompt(i,e)}catch(e){y(e)}else y(r)}},[w,i,y,l]),reset:e.useCallback(()=>{d(!1),c(null),p.current&&clearTimeout(p.current)},[]),error:u,copied:s}};
|
package/use-clipboard/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"client-only";import{useState as o,useRef as r,useCallback as e}from"react";import{noop as t}from"../noop/index.mjs";import{useStableHandler as i}from"../use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs";class a extends Error{}function l(){let{timeout:l=1e3,usePromptAsFallback:n=!1,promptFallbackText:c="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[p,s]=o(null),[d,m]=o(!1),w=r(null),y=i(u||t),b=e(o=>{w.current&&clearTimeout(w.current),o&&(w.current=window.setTimeout(()=>m(!1),l)),m(o)},[l]),f=e(o=>{s(o),y(o)},[y]);return{copy:e(async o=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(o),b(!0);else throw new a("[foxact]
|
|
1
|
+
import"client-only";import{useState as o,useRef as r,useCallback as e}from"react";import{noop as t}from"../noop/index.mjs";import{useStableHandler as i}from"../use-stable-handler-only-when-you-know-what-you-are-doing-or-you-will-be-fired/index.mjs";class a extends Error{}function l(){let{timeout:l=1e3,usePromptAsFallback:n=!1,promptFallbackText:c="Failed to copy to clipboard automatically, please manually copy the text below.",onCopyError:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[p,s]=o(null),[d,m]=o(!1),w=r(null),y=i(u||t),b=e(o=>{w.current&&clearTimeout(w.current),o&&(w.current=window.setTimeout(()=>m(!1),l)),m(o)},[l]),f=e(o=>{s(o),y(o)},[y]);return{copy:e(async o=>{try{if("clipboard"in navigator)await navigator.clipboard.writeText(o),b(!0);else throw new a("[foxact/use-clipboard] navigator.clipboard is not supported")}catch(r){if(n)try{window.prompt(c,o)}catch(o){f(o)}else f(r)}},[b,c,f,n]),reset:e(()=>{m(!1),s(null),w.current&&clearTimeout(w.current)},[]),error:p,copied:d}}export{a as UseClipboardError,l as useClipboard};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";require("client-only");var r=require("react"),e=require("react-router-dom");const t=()=>{const{navigator:t}=r.useContext(e.UNSAFE_NavigationContext);if(!t)throw TypeError("[foxact]
|
|
2
|
+
"use strict";require("client-only");var r=require("react"),e=require("react-router-dom");const 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=r=>{let{children:e}=r;return t(),e},exports.useReactRouterEnableConcurrentNavigation=t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";require("client-only");var r=require("react"),e=require("react-router-dom");const t=()=>{const{navigator:t}=r.useContext(e.UNSAFE_NavigationContext);if(!t)throw TypeError("[foxact]
|
|
2
|
+
"use strict";require("client-only");var r=require("react"),e=require("react-router-dom");const 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=r=>{let{children:e}=r;return t(),e},exports.useReactRouterEnableConcurrentNavigation=t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import"client-only";import{useContext as r,useEffect as e,startTransition as o}from"react";import{UNSAFE_NavigationContext as t}from"react-router-dom";const n=()=>{const{navigator:n}=r(t);if(!n)throw TypeError("[foxact]
|
|
2
|
+
import"client-only";import{useContext as r,useEffect as e,startTransition as o}from"react";import{UNSAFE_NavigationContext as t}from"react-router-dom";const n=()=>{const{navigator:n}=r(t);if(!n)throw TypeError("[foxact/use-react-router-enable-concurrent-navigation] must be used under <RouterProvider /> or a Router component (e.g. <BrowserRouter />)");e(()=>{const r=n.go.bind(n),e=n.push.bind(n),t=n.replace.bind(n);return n.go=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return o(()=>r.apply(n,t))},n.push=function(){for(var r=arguments.length,t=Array(r),a=0;a<r;a++)t[a]=arguments[a];return o(()=>e.apply(n,t))},n.replace=function(){for(var r=arguments.length,e=Array(r),a=0;a<r;a++)e[a]=arguments[a];return o(()=>t.apply(n,e))},()=>{n.go=r,n.push=e,n.replace=t}},[n])},a=r=>{let{children:e}=r;return n(),e};export{a as ReactRouterConcurrentNavigationProvider,n as useReactRouterEnableConcurrentNavigation};
|