asterui 0.12.26 → 0.12.28
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/Collapse.d.ts +40 -20
- package/dist/components/Descriptions.d.ts +35 -3
- package/dist/components/Empty.d.ts +10 -1
- package/dist/components/Image.d.ts +13 -1
- package/dist/components/List.d.ts +74 -8
- package/dist/components/Table.d.ts +64 -10
- package/dist/components/Timeline.d.ts +62 -7
- package/dist/index.d.ts +4 -6
- package/dist/index.js +148 -150
- package/dist/index.js.map +1 -1
- package/dist/index10.js +1 -1
- package/dist/index100.js +5 -32
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +13 -5
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +43 -11
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +11 -44
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +12 -10
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +7 -14
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +12 -7
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +29 -11
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +16 -29
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +31 -16
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +517 -30
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +45 -515
- package/dist/index111.js.map +1 -1
- package/dist/index18.js +105 -64
- package/dist/index18.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.js +127 -93
- package/dist/index23.js.map +1 -1
- package/dist/index39.js +162 -115
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +398 -40
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +132 -389
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +252 -91
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +143 -247
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +15 -154
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +17 -15
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +136 -16
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +118 -133
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +35 -13
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +34 -35
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +81 -34
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +166 -71
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +144 -167
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +11 -152
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +55 -10
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +12 -55
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +7 -14
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +333 -6
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -334
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +122 -47
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +108 -120
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +167 -107
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +29 -167
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +120 -30
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +80 -116
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +19 -85
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +73 -19
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +54 -71
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +44 -56
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +49 -42
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +121 -50
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +102 -118
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +72 -105
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +67 -73
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +19 -66
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +55 -18
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +251 -55
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -254
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -22
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +93 -30
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +626 -86
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +73 -322
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +39 -79
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +23 -40
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +207 -23
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +148 -199
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +152 -147
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +143 -156
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -65
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +234 -35
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +31 -231
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +210 -34
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +418 -187
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +686 -376
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +165 -738
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +253 -173
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +64 -256
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +121 -61
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +14 -126
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +31 -12
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Indicator.d.ts +0 -7
- package/dist/index112.js +0 -53
- package/dist/index112.js.map +0 -1
package/dist/index98.js
CHANGED
|
@@ -1,129 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (t) return t;
|
|
14
|
-
if (typeof window > "u") return r;
|
|
15
|
-
const i = getComputedStyle(document.documentElement).getPropertyValue("--bc").trim(), d = getComputedStyle(document.body).getPropertyValue("--bc").trim(), s = i || d;
|
|
16
|
-
return s ? `hsl(${s} / ${c})` : r;
|
|
17
|
-
}, M = (t, c) => {
|
|
18
|
-
const r = t?.fontSize ?? 16;
|
|
19
|
-
return {
|
|
20
|
-
color: c,
|
|
21
|
-
fontSize: r,
|
|
22
|
-
fontWeight: t?.fontWeight ?? 600,
|
|
23
|
-
fontStyle: t?.fontStyle ?? "normal",
|
|
24
|
-
fontFamily: t?.fontFamily ?? "sans-serif",
|
|
25
|
-
lineHeight: t?.lineHeight ?? r * 1.2
|
|
26
|
-
};
|
|
27
|
-
}, X = ({
|
|
28
|
-
children: t,
|
|
29
|
-
className: c = "",
|
|
30
|
-
style: r,
|
|
31
|
-
content: i,
|
|
32
|
-
image: d,
|
|
33
|
-
width: s = 120,
|
|
34
|
-
height: a = 64,
|
|
35
|
-
gap: g,
|
|
36
|
-
offset: m,
|
|
37
|
-
rotate: T = -22,
|
|
38
|
-
zIndex: W = 1e3,
|
|
39
|
-
font: S,
|
|
40
|
-
...A
|
|
41
|
-
}) => {
|
|
42
|
-
const [y, $] = V(null), u = g?.[0] ?? 120, f = g?.[1] ?? 120, B = m?.[0] ?? u / 2, F = m?.[1] ?? f / 2, E = P(
|
|
43
|
-
() => typeof i == "string" ? [i] : Array.isArray(i) ? i : [D],
|
|
44
|
-
[i]
|
|
45
|
-
), k = U(S?.color), l = P(
|
|
46
|
-
() => M(S, k),
|
|
47
|
-
[S, k]
|
|
48
|
-
), h = Math.PI / 180 * T, I = E.join("|");
|
|
49
|
-
Y(() => {
|
|
50
|
-
if (typeof window > "u") return;
|
|
51
|
-
let p = !1;
|
|
52
|
-
const n = window.devicePixelRatio || 1, w = s + u, C = a + f, v = document.createElement("canvas");
|
|
53
|
-
v.width = w * n, v.height = C * n;
|
|
54
|
-
const e = v.getContext("2d");
|
|
55
|
-
if (!e) return;
|
|
56
|
-
const L = () => {
|
|
57
|
-
const o = v.toDataURL();
|
|
58
|
-
p || $({ url: o, width: w, height: C });
|
|
59
|
-
}, N = () => {
|
|
60
|
-
e.save(), e.translate((u / 2 + s / 2) * n, (f / 2 + a / 2) * n), e.rotate(h), e.fillStyle = l.color, e.textAlign = "center", e.textBaseline = "middle", e.font = `${l.fontStyle} normal ${l.fontWeight} ${l.fontSize * n}px ${l.fontFamily}`;
|
|
61
|
-
const o = l.lineHeight * n, b = -((E.length - 1) * o) / 2;
|
|
62
|
-
E.forEach((x, j) => {
|
|
63
|
-
e.fillText(x, 0, b + j * o);
|
|
64
|
-
}), e.restore();
|
|
65
|
-
};
|
|
66
|
-
if (d) {
|
|
67
|
-
const o = new Image();
|
|
68
|
-
o.crossOrigin = "anonymous", o.referrerPolicy = "no-referrer";
|
|
69
|
-
const b = () => {
|
|
70
|
-
e.save(), e.translate((u / 2 + s / 2) * n, (f / 2 + a / 2) * n), e.rotate(h), e.drawImage(
|
|
71
|
-
o,
|
|
72
|
-
-s / 2 * n,
|
|
73
|
-
-a / 2 * n,
|
|
74
|
-
s * n,
|
|
75
|
-
a * n
|
|
76
|
-
), e.restore(), L();
|
|
77
|
-
}, x = () => {
|
|
78
|
-
p || $(null);
|
|
79
|
-
};
|
|
80
|
-
return o.addEventListener("load", b), o.addEventListener("error", x), o.src = d, () => {
|
|
81
|
-
p = !0, o.removeEventListener("load", b), o.removeEventListener("error", x);
|
|
82
|
-
};
|
|
83
|
-
} else
|
|
84
|
-
N(), L();
|
|
85
|
-
return () => {
|
|
86
|
-
p = !0;
|
|
87
|
-
};
|
|
88
|
-
}, [
|
|
89
|
-
l,
|
|
90
|
-
u,
|
|
91
|
-
f,
|
|
92
|
-
a,
|
|
93
|
-
d,
|
|
94
|
-
h,
|
|
95
|
-
I,
|
|
96
|
-
s
|
|
97
|
-
]);
|
|
98
|
-
const H = ["relative", c].filter(Boolean).join(" ");
|
|
99
|
-
return /* @__PURE__ */ z(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
className: H,
|
|
103
|
-
style: { position: r?.position ?? "relative", ...r },
|
|
104
|
-
...A,
|
|
105
|
-
children: [
|
|
106
|
-
t,
|
|
107
|
-
y && /* @__PURE__ */ R(
|
|
108
|
-
"div",
|
|
109
|
-
{
|
|
110
|
-
"aria-hidden": !0,
|
|
111
|
-
className: "pointer-events-none absolute inset-0",
|
|
112
|
-
style: {
|
|
113
|
-
zIndex: W,
|
|
114
|
-
backgroundImage: `url(${y.url})`,
|
|
115
|
-
backgroundRepeat: "repeat",
|
|
116
|
-
backgroundSize: `${y.width}px ${y.height}px`,
|
|
117
|
-
backgroundPosition: `${B}px ${F}px`
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
X.displayName = "Watermark";
|
|
1
|
+
import { jsx as v, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useBreakpoint as m } from "./index99.js";
|
|
3
|
+
function h({ children: f, above: o, below: r, at: s, between: e }) {
|
|
4
|
+
const { isAbove: d, isBelow: n, isAt: l, isBetween: u } = m();
|
|
5
|
+
let i = !1;
|
|
6
|
+
return o !== void 0 ? i = d(o) : r !== void 0 ? i = n(r) : s !== void 0 ? Array.isArray(s) ? i = s.some((t) => l(t)) : i = l(s) : e !== void 0 ? i = u(e[0], e[1]) : i = !0, i ? /* @__PURE__ */ v(A, { children: f }) : null;
|
|
7
|
+
}
|
|
8
|
+
function p({ children: f, above: o, below: r, at: s, between: e }) {
|
|
9
|
+
const { isAbove: d, isBelow: n, isAt: l, isBetween: u } = m();
|
|
10
|
+
let i = !1;
|
|
11
|
+
return o !== void 0 ? i = d(o) : r !== void 0 ? i = n(r) : s !== void 0 ? Array.isArray(s) ? i = s.some((t) => l(t)) : i = l(s) : e !== void 0 && (i = u(e[0], e[1])), i ? null : /* @__PURE__ */ v(A, { children: f });
|
|
12
|
+
}
|
|
126
13
|
export {
|
|
127
|
-
|
|
14
|
+
p as Hide,
|
|
15
|
+
h as Show
|
|
128
16
|
};
|
|
129
17
|
//# sourceMappingURL=index98.js.map
|
package/dist/index98.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index98.js","sources":["../src/components/Watermark.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from 'react'\n\nexport type WatermarkGap = [number, number]\nexport type WatermarkOffset = [number, number]\n\nexport interface WatermarkFontOptions {\n /** Text color for watermark content */\n color?: string\n /** Font size in pixels */\n fontSize?: number\n /** Font weight for watermark text */\n fontWeight?: number | 'normal' | 'bold' | 'bolder' | 'lighter'\n /** Font style for watermark text */\n fontStyle?: 'normal' | 'italic' | 'oblique'\n /** Font family for watermark text */\n fontFamily?: string\n /** Line height in pixels for multi-line content */\n lineHeight?: number\n}\n\nexport interface WatermarkProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content'> {\n /** Text to render inside the watermark; falls back to \"asterui\" */\n content?: string | string[]\n /** Image source (URL or base64) to render instead of text */\n image?: string\n /** Width of a single watermark tile in pixels */\n width?: number\n /** Height of a single watermark tile in pixels */\n height?: number\n /** Horizontal/vertical gap between watermarks in pixels */\n gap?: WatermarkGap\n /** Offset for the first watermark tile from the top-left corner */\n offset?: WatermarkOffset\n /** Rotation angle in degrees */\n rotate?: number\n /** z-index for the overlay layer */\n zIndex?: number\n /** Font settings for text watermarks */\n font?: WatermarkFontOptions\n /** Content to protect with the watermark */\n children?: React.ReactNode\n}\n\ntype WatermarkImage = {\n url: string\n width: number\n height: number\n}\n\nconst DEFAULT_CONTENT = 'asterui'\nconst DEFAULT_OPACITY = 0.22\n\nconst resolveThemeColor = (requested?: string, opacity = DEFAULT_OPACITY) => {\n const fallback = `rgba(0,0,0,${opacity})`\n\n if (requested && requested.includes('var(--bc')) {\n if (typeof window !== 'undefined') {\n const docBase = getComputedStyle(document.documentElement).getPropertyValue('--bc').trim()\n const bodyBase = getComputedStyle(document.body).getPropertyValue('--bc').trim()\n const base = docBase || bodyBase\n if (base) {\n return requested.replace(/var\\(--bc\\)/g, base)\n }\n }\n return fallback\n }\n\n if (requested) return requested\n\n if (typeof window === 'undefined') return fallback\n\n const docBase = getComputedStyle(document.documentElement).getPropertyValue('--bc').trim()\n const bodyBase = getComputedStyle(document.body).getPropertyValue('--bc').trim()\n const base = docBase || bodyBase\n\n return base ? `hsl(${base} / ${opacity})` : fallback\n}\n\nconst getFontSettings = (font: WatermarkFontOptions | undefined, resolvedColor: string) => {\n const fontSize = font?.fontSize ?? 16\n\n return {\n color: resolvedColor,\n fontSize,\n fontWeight: font?.fontWeight ?? 600,\n fontStyle: font?.fontStyle ?? 'normal',\n fontFamily: font?.fontFamily ?? 'sans-serif',\n lineHeight: font?.lineHeight ?? fontSize * 1.2,\n }\n}\n\nexport const Watermark: React.FC<WatermarkProps> = ({\n children,\n className = '',\n style,\n content,\n image,\n width = 120,\n height = 64,\n gap,\n offset,\n rotate = -22,\n zIndex = 1000,\n font,\n ...rest\n}) => {\n const [watermark, setWatermark] = useState<WatermarkImage | null>(null)\n\n const gapX = gap?.[0] ?? 120\n const gapY = gap?.[1] ?? 120\n const offsetX = offset?.[0] ?? gapX / 2\n const offsetY = offset?.[1] ?? gapY / 2\n const textLines = useMemo(\n () =>\n typeof content === 'string'\n ? [content]\n : Array.isArray(content)\n ? content\n : [DEFAULT_CONTENT],\n [content]\n )\n const resolvedColor = resolveThemeColor(font?.color)\n const fontSettings = useMemo(\n () => getFontSettings(font, resolvedColor),\n [font, resolvedColor]\n )\n const rotationInRadians = (Math.PI / 180) * rotate\n const textKey = textLines.join('|')\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n let cancelled = false\n const ratio = window.devicePixelRatio || 1\n const tileWidth = width + gapX\n const tileHeight = height + gapY\n const canvas = document.createElement('canvas')\n canvas.width = tileWidth * ratio\n canvas.height = tileHeight * ratio\n const ctx = canvas.getContext('2d')\n\n if (!ctx) return\n\n const commitWatermark = () => {\n const url = canvas.toDataURL()\n if (!cancelled) {\n setWatermark({ url, width: tileWidth, height: tileHeight })\n }\n }\n\n const drawText = () => {\n ctx.save()\n ctx.translate((gapX / 2 + width / 2) * ratio, (gapY / 2 + height / 2) * ratio)\n ctx.rotate(rotationInRadians)\n ctx.fillStyle = fontSettings.color\n ctx.textAlign = 'center'\n ctx.textBaseline = 'middle'\n ctx.font = `${fontSettings.fontStyle} normal ${fontSettings.fontWeight} ${fontSettings.fontSize * ratio}px ${fontSettings.fontFamily}`\n\n const lineHeight = fontSettings.lineHeight * ratio\n const startY = -((textLines.length - 1) * lineHeight) / 2\n\n textLines.forEach((line, index) => {\n ctx.fillText(line, 0, startY + index * lineHeight)\n })\n\n ctx.restore()\n }\n\n if (image) {\n const img = new Image()\n img.crossOrigin = 'anonymous'\n img.referrerPolicy = 'no-referrer'\n\n const handleLoad = () => {\n ctx.save()\n ctx.translate((gapX / 2 + width / 2) * ratio, (gapY / 2 + height / 2) * ratio)\n ctx.rotate(rotationInRadians)\n ctx.drawImage(\n img,\n (-width / 2) * ratio,\n (-height / 2) * ratio,\n width * ratio,\n height * ratio\n )\n ctx.restore()\n commitWatermark()\n }\n\n const handleError = () => {\n if (!cancelled) setWatermark(null)\n }\n\n img.addEventListener('load', handleLoad)\n img.addEventListener('error', handleError)\n img.src = image\n\n return () => {\n cancelled = true\n img.removeEventListener('load', handleLoad)\n img.removeEventListener('error', handleError)\n }\n } else {\n drawText()\n commitWatermark()\n }\n\n return () => {\n cancelled = true\n }\n }, [\n fontSettings,\n gapX,\n gapY,\n height,\n image,\n rotationInRadians,\n textKey,\n width,\n ])\n\n const classes = ['relative', className].filter(Boolean).join(' ')\n\n return (\n <div\n className={classes}\n style={{ position: style?.position ?? 'relative', ...style }}\n {...rest}\n >\n {children}\n {watermark && (\n <div\n aria-hidden\n className=\"pointer-events-none absolute inset-0\"\n style={{\n zIndex,\n backgroundImage: `url(${watermark.url})`,\n backgroundRepeat: 'repeat',\n backgroundSize: `${watermark.width}px ${watermark.height}px`,\n backgroundPosition: `${offsetX}px ${offsetY}px`,\n }}\n />\n )}\n </div>\n )\n}\n\nWatermark.displayName = 'Watermark'\n"],"names":["DEFAULT_CONTENT","DEFAULT_OPACITY","resolveThemeColor","requested","opacity","fallback","docBase","bodyBase","base","getFontSettings","font","resolvedColor","fontSize","Watermark","children","className","style","content","image","width","height","gap","offset","rotate","zIndex","rest","watermark","setWatermark","useState","gapX","gapY","offsetX","offsetY","textLines","useMemo","fontSettings","rotationInRadians","textKey","useEffect","cancelled","ratio","tileWidth","tileHeight","canvas","ctx","commitWatermark","url","drawText","lineHeight","startY","line","index","img","handleLoad","handleError","classes","jsxs","jsx"],"mappings":";;AAkDA,MAAMA,IAAkB,WAClBC,IAAkB,MAElBC,IAAoB,CAACC,GAAoBC,IAAUH,MAAoB;AAC3E,QAAMI,IAAW,cAAcD,CAAO;AAEtC,MAAID,KAAaA,EAAU,SAAS,UAAU,GAAG;AAC/C,QAAI,OAAO,SAAW,KAAa;AACjC,YAAMG,IAAU,iBAAiB,SAAS,eAAe,EAAE,iBAAiB,MAAM,EAAE,KAAA,GAC9EC,IAAW,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,MAAM,EAAE,KAAA,GACpEC,IAAOF,KAAWC;AACxB,UAAIC;AACF,eAAOL,EAAU,QAAQ,gBAAgBK,CAAI;AAAA,IAEjD;AACA,WAAOH;AAAA,EACT;AAEA,MAAIF,EAAW,QAAOA;AAEtB,MAAI,OAAO,SAAW,IAAa,QAAOE;AAE1C,QAAMC,IAAU,iBAAiB,SAAS,eAAe,EAAE,iBAAiB,MAAM,EAAE,KAAA,GAC9EC,IAAW,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,MAAM,EAAE,KAAA,GACpEC,IAAOF,KAAWC;AAExB,SAAOC,IAAO,OAAOA,CAAI,M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7C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEAnB,EAAU,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index98.js","sources":["../src/components/Responsive.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useBreakpoint, Breakpoint } from '../hooks/useBreakpoint'\n\nexport interface ShowProps {\n children: ReactNode\n above?: Breakpoint\n below?: Breakpoint\n at?: Breakpoint | Breakpoint[]\n between?: [Breakpoint, Breakpoint]\n}\n\nexport function Show({ children, above, below, at, between }: ShowProps): React.ReactElement | null {\n const { isAbove, isBelow, isAt, isBetween } = useBreakpoint()\n\n let shouldShow = false\n\n if (above !== undefined) {\n shouldShow = isAbove(above)\n } else if (below !== undefined) {\n shouldShow = isBelow(below)\n } else if (at !== undefined) {\n if (Array.isArray(at)) {\n shouldShow = at.some((bp) => isAt(bp))\n } else {\n shouldShow = isAt(at)\n }\n } else if (between !== undefined) {\n shouldShow = isBetween(between[0], between[1])\n } else {\n shouldShow = true\n }\n\n return shouldShow ? <>{children}</> : null\n}\n\nexport interface HideProps {\n children: ReactNode\n above?: Breakpoint\n below?: Breakpoint\n at?: Breakpoint | Breakpoint[]\n between?: [Breakpoint, Breakpoint]\n}\n\nexport function Hide({ children, above, below, at, between }: HideProps): React.ReactElement | null {\n const { isAbove, isBelow, isAt, isBetween } = useBreakpoint()\n\n let shouldHide = false\n\n if (above !== undefined) {\n shouldHide = isAbove(above)\n } else if (below !== undefined) {\n shouldHide = isBelow(below)\n } else if (at !== undefined) {\n if (Array.isArray(at)) {\n shouldHide = at.some((bp) => isAt(bp))\n } else {\n shouldHide = isAt(at)\n }\n } else if (between !== undefined) {\n shouldHide = isBetween(between[0], between[1])\n }\n\n return shouldHide ? null : <>{children}</>\n}\n"],"names":["Show","children","above","below","at","between","isAbove","isBelow","isAt","isBetween","useBreakpoint","shouldShow","bp","jsx","Fragment","Hide","shouldHide"],"mappings":";;AAWO,SAASA,EAAK,EAAE,UAAAC,GAA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-
|
|
1
|
+
import { useState as u, useEffect as f } from "react";
|
|
2
|
+
const t = {
|
|
3
|
+
sm: 640,
|
|
4
|
+
md: 768,
|
|
5
|
+
lg: 1024,
|
|
6
|
+
xl: 1280,
|
|
7
|
+
"2xl": 1536
|
|
8
|
+
}, s = ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
9
|
+
function l(e) {
|
|
10
|
+
return e >= t["2xl"] ? "2xl" : e >= t.xl ? "xl" : e >= t.lg ? "lg" : e >= t.md ? "md" : e >= t.sm ? "sm" : "xs";
|
|
7
11
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
function i(e, o) {
|
|
13
|
+
return s.indexOf(e) - s.indexOf(o);
|
|
14
|
+
}
|
|
15
|
+
function m() {
|
|
16
|
+
const [e, o] = u(
|
|
17
|
+
() => typeof window < "u" ? window.innerWidth : 1024
|
|
18
|
+
);
|
|
19
|
+
f(() => {
|
|
20
|
+
const n = () => o(window.innerWidth);
|
|
21
|
+
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
22
|
+
}, []);
|
|
23
|
+
const r = l(e);
|
|
24
|
+
return {
|
|
25
|
+
breakpoint: r,
|
|
26
|
+
width: e,
|
|
27
|
+
isAbove: (n) => i(r, n) >= 0,
|
|
28
|
+
isBelow: (n) => i(r, n) < 0,
|
|
29
|
+
isAt: (n) => r === n,
|
|
30
|
+
isBetween: (n, d) => i(r, n) >= 0 && i(r, d) <= 0
|
|
31
|
+
};
|
|
12
32
|
}
|
|
13
33
|
export {
|
|
14
|
-
|
|
15
|
-
h as Show
|
|
34
|
+
m as useBreakpoint
|
|
16
35
|
};
|
|
17
36
|
//# sourceMappingURL=index99.js.map
|
package/dist/index99.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index99.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index99.js","sources":["../src/hooks/useBreakpoint.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n\nconst breakpoints: Record<Breakpoint, number> = {\n xs: 0,\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536,\n}\n\nconst breakpointOrder: Breakpoint[] = ['xs', 'sm', 'md', 'lg', 'xl', '2xl']\n\nfunction getBreakpoint(width: number): Breakpoint {\n if (width >= breakpoints['2xl']) return '2xl'\n if (width >= breakpoints.xl) return 'xl'\n if (width >= breakpoints.lg) return 'lg'\n if (width >= breakpoints.md) return 'md'\n if (width >= breakpoints.sm) return 'sm'\n return 'xs'\n}\n\nfunction compareBreakpoints(a: Breakpoint, b: Breakpoint): number {\n return breakpointOrder.indexOf(a) - breakpointOrder.indexOf(b)\n}\n\nexport interface UseBreakpointReturn {\n breakpoint: Breakpoint\n width: number\n isAbove: (bp: Breakpoint) => boolean\n isBelow: (bp: Breakpoint) => boolean\n isAt: (bp: Breakpoint) => boolean\n isBetween: (min: Breakpoint, max: Breakpoint) => boolean\n}\n\nexport function useBreakpoint(): UseBreakpointReturn {\n const [width, setWidth] = useState(() =>\n typeof window !== 'undefined' ? window.innerWidth : 1024\n )\n\n useEffect(() => {\n const handleResize = () => setWidth(window.innerWidth)\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n\n const breakpoint = getBreakpoint(width)\n\n return {\n breakpoint,\n width,\n isAbove: (bp: Breakpoint) => compareBreakpoints(breakpoint, bp) >= 0,\n isBelow: (bp: Breakpoint) => compareBreakpoints(breakpoint, bp) < 0,\n isAt: (bp: Breakpoint) => breakpoint === bp,\n isBetween: (min: Breakpoint, max: Breakpoint) =>\n compareBreakpoints(breakpoint, min) >= 0 && compareBreakpoints(breakpoint, max) <= 0,\n }\n}\n"],"names":["breakpoints","breakpointOrder","getBreakpoint","width","compareBreakpoints","a","b","useBreakpoint","setWidth","useState","useEffect","handleResize","breakpoint","bp","min","max"],"mappings":";AAIA,MAAMA,IAA0C;AAAA,EAE9C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AACT,GAEMC,IAAgC,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAE1E,SAASC,EAAcC,GAA2B;AAChD,SAAIA,KAASH,EAAY,KAAK,IAAU,QACpCG,KAASH,EAAY,KAAW,OAChCG,KAASH,EAAY,KAAW,OAChCG,KAASH,EAAY,KAAW,OAChCG,KAASH,EAAY,KAAW,OAC7B;AACT;AAEA,SAASI,EAAmBC,GAAeC,GAAuB;AAChE,SAAOL,EAAgB,QAAQI,CAAC,IAAIJ,EAAgB,QAAQK,CAAC;AAC/D;AAWO,SAASC,IAAqC;AACnD,QAAM,CAACJ,GAAOK,CAAQ,IAAIC;AAAA,IAAS,MACjC,OAAO,SAAW,MAAc,OAAO,aAAa;AAAA,EAAA;AAGtD,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAe,MAAMH,EAAS,OAAO,UAAU;AAErD,kBAAO,iBAAiB,UAAUG,CAAY,GACvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAA,CAAE;AAEL,QAAMC,IAAaV,EAAcC,CAAK;AAEtC,SAAO;AAAA,IACL,YAAAS;AAAA,IACA,OAAAT;AAAA,IACA,SAAS,CAACU,MAAmBT,EAAmBQ,GAAYC,CAAE,KAAK;AAAA,IACnE,SAAS,CAACA,MAAmBT,EAAmBQ,GAAYC,CAAE,IAAI;AAAA,IAClE,MAAM,CAACA,MAAmBD,MAAeC;AAAA,IACzC,WAAW,CAACC,GAAiBC,MAC3BX,EAAmBQ,GAAYE,CAAG,KAAK,KAAKV,EAAmBQ,GAAYG,CAAG,KAAK;AAAA,EAAA;AAEzF;"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export type IndicatorPosition = 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
3
|
-
export interface IndicatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
position?: IndicatorPosition;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Indicator: React.FC<IndicatorProps>;
|
package/dist/index112.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
function T(n, l, e) {
|
|
2
|
-
let i = e.initialDeps ?? [], t, c = !0;
|
|
3
|
-
function h() {
|
|
4
|
-
var d, m, f;
|
|
5
|
-
let g;
|
|
6
|
-
e.key && ((d = e.debug) != null && d.call(e)) && (g = Date.now());
|
|
7
|
-
const o = n();
|
|
8
|
-
if (!(o.length !== i.length || o.some((r, a) => i[a] !== r)))
|
|
9
|
-
return t;
|
|
10
|
-
i = o;
|
|
11
|
-
let s;
|
|
12
|
-
if (e.key && ((m = e.debug) != null && m.call(e)) && (s = Date.now()), t = l(...o), e.key && ((f = e.debug) != null && f.call(e))) {
|
|
13
|
-
const r = Math.round((Date.now() - g) * 100) / 100, a = Math.round((Date.now() - s) * 100) / 100, b = a / 16, w = (u, D) => {
|
|
14
|
-
for (u = String(u); u.length < D; )
|
|
15
|
-
u = " " + u;
|
|
16
|
-
return u;
|
|
17
|
-
};
|
|
18
|
-
console.info(
|
|
19
|
-
`%c⏱ ${w(a, 5)} /${w(r, 5)} ms`,
|
|
20
|
-
`
|
|
21
|
-
font-size: .6rem;
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
color: hsl(${Math.max(
|
|
24
|
-
0,
|
|
25
|
-
Math.min(120 - 120 * b, 120)
|
|
26
|
-
)}deg 100% 31%);`,
|
|
27
|
-
e?.key
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
return e?.onChange && !(c && e.skipInitialOnChange) && e.onChange(t), c = !1, t;
|
|
31
|
-
}
|
|
32
|
-
return h.updateDeps = (d) => {
|
|
33
|
-
i = d;
|
|
34
|
-
}, h;
|
|
35
|
-
}
|
|
36
|
-
function k(n, l) {
|
|
37
|
-
if (n === void 0)
|
|
38
|
-
throw new Error("Unexpected undefined");
|
|
39
|
-
return n;
|
|
40
|
-
}
|
|
41
|
-
const y = (n, l) => Math.abs(n - l) < 1.01, C = (n, l, e) => {
|
|
42
|
-
let i;
|
|
43
|
-
return function(...t) {
|
|
44
|
-
n.clearTimeout(i), i = n.setTimeout(() => l.apply(this, t), e);
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export {
|
|
48
|
-
y as approxEqual,
|
|
49
|
-
C as debounce,
|
|
50
|
-
T as memo,
|
|
51
|
-
k as notUndefined
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=index112.js.map
|
package/dist/index112.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index112.js","sources":["../../../node_modules/.pnpm/@tanstack+virtual-core@3.13.13/node_modules/@tanstack/virtual-core/dist/esm/utils.js"],"sourcesContent":["function memo(getDeps, fn, opts) {\n let deps = opts.initialDeps ?? [];\n let result;\n let isInitial = true;\n function memoizedFunction() {\n var _a, _b, _c;\n let depTime;\n if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();\n const newDeps = getDeps();\n const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);\n if (!depsChanged) {\n return result;\n }\n deps = newDeps;\n let resultTime;\n if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();\n result = fn(...newDeps);\n if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;\n const resultFpsPercentage = resultEndTime / 16;\n const pad = (str, num) => {\n str = String(str);\n while (str.length < num) {\n str = \" \" + str;\n }\n return str;\n };\n console.info(\n `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(\n 0,\n Math.min(120 - 120 * resultFpsPercentage, 120)\n )}deg 100% 31%);`,\n opts == null ? void 0 : opts.key\n );\n }\n if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {\n opts.onChange(result);\n }\n isInitial = false;\n return result;\n }\n memoizedFunction.updateDeps = (newDeps) => {\n deps = newDeps;\n };\n return memoizedFunction;\n}\nfunction notUndefined(value, msg) {\n if (value === void 0) {\n throw new Error(`Unexpected undefined${msg ? `: ${msg}` : \"\"}`);\n } else {\n return value;\n }\n}\nconst approxEqual = (a, b) => Math.abs(a - b) < 1.01;\nconst debounce = (targetWindow, fn, ms) => {\n let timeoutId;\n return function(...args) {\n targetWindow.clearTimeout(timeoutId);\n timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);\n };\n};\nexport {\n approxEqual,\n debounce,\n memo,\n notUndefined\n};\n//# sourceMappingURL=utils.js.map\n"],"names":["memo","getDeps","fn","opts","deps","result","isInitial","memoizedFunction","_a","_b","_c","depTime","newDeps","dep","index","resultTime","depEndTime","resultEndTime","resultFpsPercentage","pad","str","num","notUndefined","value","msg","approxEqual","a","b","debounce","targetWindow","ms","timeoutId","args"],"mappings":"AAAA,SAASA,EAAKC,GAASC,GAAIC,GAAM;AAC/B,MAAIC,IAAOD,EAAK,eAAe,CAAA,GAC3BE,GACAC,IAAY;AAChB,WAASC,IAAmB;AAC1B,QAAIC,GAAIC,GAAIC;AACZ,QAAIC;AACJ,IAAIR,EAAK,SAASK,IAAKL,EAAK,UAAU,QAAgBK,EAAG,KAAKL,CAAI,OAAIQ,IAAU,KAAK,IAAG;AACxF,UAAMC,IAAUX,EAAO;AAEvB,QAAI,EADgBW,EAAQ,WAAWR,EAAK,UAAUQ,EAAQ,KAAK,CAACC,GAAKC,MAAUV,EAAKU,CAAK,MAAMD,CAAG;AAEpG,aAAOR;AAET,I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