@xwadex/fesd-next 0.3.4-10 → 0.3.4-11
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/dist/components/index.d.mts +2 -0
- package/dist/components/index.mjs +2 -0
- package/dist/components-DMsIAeFi.mjs +975 -0
- package/dist/components-DMsIAeFi.mjs.map +1 -0
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/index-1SzidEVJ.d.mts +213 -0
- package/dist/index-OVM4Yt0j.d.mts +169 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +5 -0
- package/dist/shadcns/index.d.mts +1332 -0
- package/dist/shadcns/index.mjs +2607 -0
- package/dist/shadcns/index.mjs.map +1 -0
- package/dist/types/{index.d.ts → index.d.mts} +10 -7
- package/dist/types/index.mjs +1 -0
- package/dist/utils/{index.d.ts → index.d.mts} +5 -3
- package/dist/utils/index.mjs +60 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +2 -3
- package/dist/components/index.d.ts +0 -186
- package/dist/components/index.js +0 -1211
- package/dist/components/index.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -68
- package/dist/hooks/index.js +0 -891
- package/dist/hooks/index.js.map +0 -1
- package/dist/index.d.ts +0 -55
- package/dist/index.js +0 -5036
- package/dist/index.js.map +0 -1
- package/dist/shadcns/index.d.ts +0 -490
- package/dist/shadcns/index.js +0 -3864
- package/dist/shadcns/index.js.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/useAnchors-BzgJT2J9.d.ts +0 -78
- package/dist/utils/index.js +0 -63
- package/dist/utils/index.js.map +0 -1
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as zustand from 'zustand';
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
|
-
import { Easing, AnimationPlaybackControlsWithThen } from 'motion/react';
|
|
4
|
-
import Lenis from 'lenis';
|
|
5
|
-
|
|
6
|
-
interface AnimateOptions {
|
|
7
|
-
duration?: number;
|
|
8
|
-
delay?: number;
|
|
9
|
-
ease?: Easing | Easing[] | undefined;
|
|
10
|
-
onScroll?: (lenis?: Lenis) => void;
|
|
11
|
-
onScrolling?: (value: number) => void;
|
|
12
|
-
onScrolled?: (lenis?: Lenis) => void;
|
|
13
|
-
}
|
|
14
|
-
interface AnchorOptions extends AnimateOptions {
|
|
15
|
-
anchor: string;
|
|
16
|
-
container?: string;
|
|
17
|
-
offseters?: string | string[];
|
|
18
|
-
direction?: "x" | "y";
|
|
19
|
-
align?: "start" | "center" | "end";
|
|
20
|
-
offset?: number;
|
|
21
|
-
}
|
|
22
|
-
interface ScrollOptions extends AnimateOptions {
|
|
23
|
-
controllerKey: string;
|
|
24
|
-
containerDom: HTMLElement | Window;
|
|
25
|
-
anchorScrollValue: {
|
|
26
|
-
left: number;
|
|
27
|
-
top: number;
|
|
28
|
-
};
|
|
29
|
-
containerScrollValue: {
|
|
30
|
-
left: number;
|
|
31
|
-
top: number;
|
|
32
|
-
};
|
|
33
|
-
direction?: AnchorOptions["direction"];
|
|
34
|
-
}
|
|
35
|
-
type AnimateController = AnimationPlaybackControlsWithThen;
|
|
36
|
-
interface AnchorsMethods {
|
|
37
|
-
registerAnchors: (name: string) => {
|
|
38
|
-
[key: string]: string | React.RefObject<null>;
|
|
39
|
-
ref: React.RefObject<null>;
|
|
40
|
-
};
|
|
41
|
-
registerOffseters: (name: string) => {
|
|
42
|
-
[key: string]: string | React.RefObject<null>;
|
|
43
|
-
ref: React.RefObject<null>;
|
|
44
|
-
};
|
|
45
|
-
setStores: (options: AnchorStoreOptions) => void;
|
|
46
|
-
getStores: () => AnchorsStores;
|
|
47
|
-
scrollToAnchor: (anchorOptions: AnchorOptions) => void;
|
|
48
|
-
}
|
|
49
|
-
declare function useAnchors(): AnchorsMethods;
|
|
50
|
-
interface RegistrationDatas {
|
|
51
|
-
key: keyof AnchorsStores;
|
|
52
|
-
name: string;
|
|
53
|
-
}
|
|
54
|
-
declare function useRegistration({ key, name }: RegistrationDatas): {
|
|
55
|
-
[x: string]: string | React$1.RefObject<null>;
|
|
56
|
-
ref: React$1.RefObject<null>;
|
|
57
|
-
};
|
|
58
|
-
declare function registerAnchors(name: string): {
|
|
59
|
-
[x: string]: string | React$1.RefObject<null>;
|
|
60
|
-
ref: React$1.RefObject<null>;
|
|
61
|
-
};
|
|
62
|
-
declare function registerOffseters(name: string): {
|
|
63
|
-
[x: string]: string | React$1.RefObject<null>;
|
|
64
|
-
ref: React$1.RefObject<null>;
|
|
65
|
-
};
|
|
66
|
-
interface AnchorsStores {
|
|
67
|
-
anchors: Map<string, HTMLElement | null>;
|
|
68
|
-
offseters: Map<string, HTMLElement | null>;
|
|
69
|
-
}
|
|
70
|
-
declare const useAnchorsStores: zustand.UseBoundStore<zustand.StoreApi<AnchorsStores>>;
|
|
71
|
-
declare const getAnchorsStores: () => AnchorsStores;
|
|
72
|
-
interface AnchorStoreOptions extends RegistrationDatas {
|
|
73
|
-
node: HTMLDivElement | null;
|
|
74
|
-
action: "add" | "remove";
|
|
75
|
-
}
|
|
76
|
-
declare const setAnchorsStore: (options: AnchorStoreOptions) => void;
|
|
77
|
-
|
|
78
|
-
export { type AnchorOptions as A, type RegistrationDatas as R, type ScrollOptions as S, type AnchorStoreOptions as a, type AnchorsMethods as b, type AnchorsStores as c, type AnimateController as d, type AnimateOptions as e, registerOffseters as f, getAnchorsStores as g, useAnchorsStores as h, useRegistration as i, registerAnchors as r, setAnchorsStore as s, useAnchors as u };
|
package/dist/utils/index.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { lock, clearBodyLocks } from 'tua-body-scroll-lock';
|
|
2
|
-
|
|
3
|
-
// src/utils/index.ts
|
|
4
|
-
var regexParse = (regexString, flags) => {
|
|
5
|
-
const regex = regexString.replace(/\\\\/g, "\\");
|
|
6
|
-
try {
|
|
7
|
-
return new RegExp(regex);
|
|
8
|
-
} catch (e) {
|
|
9
|
-
console.error("Invalid regular expression:", regexString, e);
|
|
10
|
-
return regexString;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
var regexReplaceEach = (currentValue, replace) => replace.reduce((current, regexs) => {
|
|
14
|
-
const regexPattern = regexParse(regexs.pattern, regexs.flags);
|
|
15
|
-
return regexPattern instanceof RegExp ? current.replace(regexPattern, "") : current;
|
|
16
|
-
}, currentValue);
|
|
17
|
-
var mediaRatio = (width, height) => Number(width) && Number(height) ? Math.round(height / width * 1e4) / 100 + "%" : "100%";
|
|
18
|
-
var sleep = (time) => new Promise((resolve) => {
|
|
19
|
-
let timer = setTimeout(() => {
|
|
20
|
-
clearTimeout(timer);
|
|
21
|
-
return resolve();
|
|
22
|
-
}, time);
|
|
23
|
-
});
|
|
24
|
-
var querySearchWord = (str) => str.trim().toLowerCase();
|
|
25
|
-
var lockBody = (active, stillScrollHTMLElement) => {
|
|
26
|
-
document.body.style.overflow = active ? "visible" : "";
|
|
27
|
-
active ? lock(stillScrollHTMLElement) : clearBodyLocks();
|
|
28
|
-
};
|
|
29
|
-
var mergeClassName = (...argements) => argements.toString().replace(/,/g, " ").replace(/\s+/g, " ").trim();
|
|
30
|
-
var getSearchParams = (searchParams) => {
|
|
31
|
-
const params = {};
|
|
32
|
-
searchParams.forEach((value, key) => {
|
|
33
|
-
params[key] = value;
|
|
34
|
-
});
|
|
35
|
-
return params;
|
|
36
|
-
};
|
|
37
|
-
var getDomTransTime = (target) => {
|
|
38
|
-
if (!target) return 0;
|
|
39
|
-
const computedStyle = window.getComputedStyle(target);
|
|
40
|
-
const parseTime = (timeStr) => {
|
|
41
|
-
timeStr = timeStr.trim();
|
|
42
|
-
if (timeStr.endsWith("ms")) return parseFloat(timeStr);
|
|
43
|
-
if (timeStr.endsWith("s")) return parseFloat(timeStr) * 1e3;
|
|
44
|
-
return 0;
|
|
45
|
-
};
|
|
46
|
-
const durations = computedStyle.transitionDuration.split(",").map(parseTime);
|
|
47
|
-
const delays = computedStyle.transitionDelay.split(",").map(parseTime);
|
|
48
|
-
const maxLength = Math.max(durations.length, delays.length);
|
|
49
|
-
return Math.max(
|
|
50
|
-
...Array.from({ length: maxLength }, (_, i) => (durations[i] || 0) + (delays[i] || 0))
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
var getURLSearchParams = (searchParams) => {
|
|
54
|
-
const params = {};
|
|
55
|
-
searchParams.forEach((value, key) => {
|
|
56
|
-
params[key] = value;
|
|
57
|
-
});
|
|
58
|
-
return new URLSearchParams({ ...params });
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { getDomTransTime, getSearchParams, getURLSearchParams, lockBody, mediaRatio, mergeClassName, querySearchWord, regexParse, regexReplaceEach, sleep };
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AACO,IAAM,UAAA,GAAa,CAAC,WAAA,EAAqB,KAAA,KAAoC;AACnF,EAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,OAAA,CAAQ,OAAA,EAAS,IAAI,CAAA;AAC/C,EAAA,IAAI;AACH,IAAA,OAAO,IAAI,OAAO,KAAK,CAAA;AAAA,EACxB,SAAS,CAAA,EAAG;AACX,IAAA,OAAA,CAAQ,KAAA,CAAM,6BAAA,EAA+B,WAAA,EAAa,CAAC,CAAA;AAC3D,IAAA,OAAO,WAAA;AAAA,EACR;AACD;AAEO,IAAM,gBAAA,GAAmB,CAC/B,YAAA,EACA,OAAA,KAEA,QAAQ,MAAA,CAAO,CAAC,SAAS,MAAA,KAAW;AACnC,EAAA,MAAM,YAAA,GAAe,UAAA,CAAW,MAAA,CAAO,OAAA,EAAS,OAAO,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gB,EAAE,GAAG,QAAQ,CAAA;AACzC","file":"index.js","sourcesContent":["import { lock, clearBodyLocks } from \"tua-body-scroll-lock\"\nexport const regexParse = (regexString: string, flags?: string): RegExp | String => {\n\tconst regex = regexString.replace(/\\\\\\\\/g, \"\\\\\")\n\ttry {\n\t\treturn new RegExp(regex)\n\t} catch (e) {\n\t\tconsole.error(\"Invalid regular expression:\", regexString, e)\n\t\treturn regexString\n\t}\n}\n\nexport const regexReplaceEach = (\n\tcurrentValue: string,\n\treplace: { pattern: string, flags?: string }[]\n): string =>\n\treplace.reduce((current, regexs) => {\n\t\tconst regexPattern = regexParse(regexs.pattern, regexs.flags)\n\t\treturn regexPattern instanceof RegExp\n\t\t\t? current.replace(regexPattern, \"\")\n\t\t\t: current\n\t}, currentValue)\n\nexport const mediaRatio = (width: number, height: number) =>\n\tNumber(width) && Number(height)\n\t\t? Math.round(height / width * 10000) / 100 + \"%\"\n\t\t: \"100%\"\n\nexport const sleep = (time: number) => new Promise<void>((resolve) => {\n\tlet timer = setTimeout(() => {\n\t\tclearTimeout(timer)\n\t\treturn resolve()\n\t}, time)\n})\n\nexport const querySearchWord = (str: string) => str.trim().toLowerCase()\n\nexport const lockBody = (\n\tactive: boolean,\n\tstillScrollHTMLElement?: HTMLElement | HTMLElement[] | null | undefined\n): void => {\n\tdocument.body.style.overflow = active ? \"visible\" : \"\"\n\tactive ? lock(stillScrollHTMLElement) : clearBodyLocks()\n}\n\nexport const mergeClassName = (...argements: (string | number | boolean)[]): string =>\n\targements.toString().replace(/,/g, \" \").replace(/\\s+/g, \" \").trim()\n\nexport const getSearchParams = (searchParams: URLSearchParams) => {\n\tconst params: any = {}\n\tsearchParams.forEach((value: any, key: any) => { params[key] = value })\n\treturn params\n}\n\n// export const getDomTransTime = (target: HTMLElement): number => {\n// const computedStyle = window.getComputedStyle(target)\n// const transNumber = (time: string) => {\n// if (time.endsWith(\"ms\")) return parseFloat(time)\n// if (time.endsWith(\"s\")) return parseFloat(time) * 1000\n// return 0\n// }\n// const durations = computedStyle.transitionDuration.split(',').map(transNumber)\n// const delays = computedStyle.transitionDelay.split(',').map(transNumber)\n// return Math.max(...durations.map((d, i) => d + (delays[i] || 0)))\n// }\n\nexport const getDomTransTime = (target: HTMLElement): number => {\n\tif (!target) return 0\n\n\tconst computedStyle = window.getComputedStyle(target)\n\n\tconst parseTime = (timeStr: string): number => {\n\t\ttimeStr = timeStr.trim()\n\t\tif (timeStr.endsWith(\"ms\")) return parseFloat(timeStr)\n\t\tif (timeStr.endsWith(\"s\")) return parseFloat(timeStr) * 1000\n\t\treturn 0\n\t}\n\n\tconst durations = computedStyle.transitionDuration.split(\",\").map(parseTime)\n\tconst delays = computedStyle.transitionDelay.split(\",\").map(parseTime)\n\tconst maxLength = Math.max(durations.length, delays.length)\n\n\treturn Math.max(\n\t\t...Array.from({ length: maxLength }, (_, i) => (durations[i] || 0) + (delays[i] || 0))\n\t)\n}\n\nexport const getURLSearchParams = (searchParams: URLSearchParams) => {\n\tconst params: any = {}\n\tsearchParams.forEach((value: any, key: any) => { params[key] = value })\n\treturn new URLSearchParams({ ...params })\n}\n\n"]}
|