asterui 0.10.3 → 0.12.0
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/README.md +1 -100
- package/dist/components/Anchor.d.ts +45 -0
- package/dist/components/Diff.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/Segmented.d.ts +37 -0
- package/dist/components/TextRotate.d.ts +13 -0
- package/dist/components/Tour.d.ts +61 -0
- package/dist/hooks/useClickOutside.d.ts +17 -0
- package/dist/hooks/useClipboard.d.ts +20 -0
- package/dist/hooks/useDebounce.d.ts +18 -0
- package/dist/hooks/useDisclosure.d.ts +20 -0
- package/dist/hooks/useHover.d.ts +18 -0
- package/dist/hooks/useKeyPress.d.ts +40 -0
- package/dist/hooks/useLocalStorage.d.ts +12 -0
- package/dist/hooks/usePrevious.d.ts +15 -0
- package/dist/hooks/useWindowSize.d.ts +21 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +205 -174
- package/dist/index.js.map +1 -1
- package/dist/index10.js +92 -30
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +12 -20
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +29 -22
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +17 -19
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +10788 -95
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +5 -360
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +40 -23
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +2 -73
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +6 -15
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +147 -61
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +26 -140
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +28 -263
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +30 -2
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +2 -56
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +72 -2
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +39 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +26 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +21 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +24 -2
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +20 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +100 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +359 -31
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +259 -89
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +25 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +72 -7
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +16 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +66 -2
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +143 -20
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index126.js +55 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -71
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -21
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +2 -34
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +90 -153
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +2 -70
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index132.js +2 -2
- package/dist/index133.js +2 -22
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +2 -2
- package/dist/index135.js +32 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index137.js +8 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -4
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +5 -0
- package/dist/index139.js.map +1 -0
- package/dist/index14.js +154 -146
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +24 -0
- package/dist/index140.js.map +1 -0
- package/dist/index141.js +5 -0
- package/dist/index141.js.map +1 -0
- package/dist/index142.js +27 -0
- package/dist/index142.js.map +1 -0
- package/dist/index143.js +74 -0
- package/dist/index143.js.map +1 -0
- package/dist/index144.js +24 -0
- package/dist/index144.js.map +1 -0
- package/dist/index145.js +37 -0
- package/dist/index145.js.map +1 -0
- package/dist/index146.js +73 -0
- package/dist/index146.js.map +1 -0
- package/dist/index147.js +5 -0
- package/dist/index147.js.map +1 -0
- package/dist/index148.js +25 -0
- package/dist/index148.js.map +1 -0
- package/dist/index149.js +5 -0
- package/dist/index149.js.map +1 -0
- package/dist/index15.js +150 -5
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +5 -0
- package/dist/index150.js.map +1 -0
- package/dist/index151.js +5 -0
- package/dist/index151.js.map +1 -0
- package/dist/index152.js +5 -0
- package/dist/index152.js.map +1 -0
- package/dist/index153.js +7 -0
- package/dist/index153.js.map +1 -0
- package/dist/index16.js +5 -71
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +71 -17
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +15 -96
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +89 -105
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +107 -177
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +181 -107
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +107 -29
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +19 -41
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +31 -11
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +41 -33
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +12 -63
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +33 -80
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +63 -18
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +78 -159
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +96 -27
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +16 -1080
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +159 -16
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +1081 -121
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +17 -39
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +121 -190
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +37 -94
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +186 -157
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +89 -138
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +161 -14
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +146 -21
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +26 -99
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +12 -116
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +18 -13
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +21 -35
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +117 -114
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +13 -176
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +34 -146
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +116 -12
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +176 -22
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +147 -14
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +10 -5
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +100 -60
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +21 -265
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +10 -13
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +7 -122
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +262 -106
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +14 -167
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +121 -31
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +107 -119
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +161 -77
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +31 -19
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +117 -69
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +61 -130
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +82 -53
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +19 -44
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +70 -48
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +55 -60
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +39 -101
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +52 -41
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +62 -21
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +104 -43
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +41 -134
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +65 -49
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +130 -11
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +21 -22
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +46 -22
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +126 -321
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +52 -56
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +22 -40
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +22 -95
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +311 -112
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +52 -157
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +40 -65
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +23 -35
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +11 -70
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +92 -31
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +116 -196
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +155 -207
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +60 -290
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +34 -177
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +227 -251
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +34 -14
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +208 -31
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +206 -10786
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +295 -5
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +69 -91
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +172 -36
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +258 -2
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +13 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +32 -151
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +5 -29
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +12 -28
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +46 -2
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +12 -71
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +13 -37
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +7 -25
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index11.js
CHANGED
|
@@ -1,268 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"#efefef",
|
|
12
|
-
"#f3f3f3",
|
|
13
|
-
"#ffffff",
|
|
14
|
-
"#980000",
|
|
15
|
-
"#ff0000",
|
|
16
|
-
"#ff9900",
|
|
17
|
-
"#ffff00",
|
|
18
|
-
"#00ff00",
|
|
19
|
-
"#00ffff",
|
|
20
|
-
"#4a86e8",
|
|
21
|
-
"#0000ff",
|
|
22
|
-
"#9900ff",
|
|
23
|
-
"#ff00ff",
|
|
24
|
-
"#e6b8af",
|
|
25
|
-
"#f4cccc",
|
|
26
|
-
"#fce5cd",
|
|
27
|
-
"#fff2cc",
|
|
28
|
-
"#d9ead3",
|
|
29
|
-
"#d0e0e3",
|
|
30
|
-
"#c9daf8",
|
|
31
|
-
"#cfe2f3",
|
|
32
|
-
"#d9d2e9",
|
|
33
|
-
"#ead1dc",
|
|
34
|
-
"#dd7e6b",
|
|
35
|
-
"#ea9999",
|
|
36
|
-
"#f9cb9c",
|
|
37
|
-
"#ffe599",
|
|
38
|
-
"#b6d7a8",
|
|
39
|
-
"#a2c4c9",
|
|
40
|
-
"#a4c2f4",
|
|
41
|
-
"#9fc5e8",
|
|
42
|
-
"#b4a7d6",
|
|
43
|
-
"#d5a6bd",
|
|
44
|
-
"#cc4125",
|
|
45
|
-
"#e06666",
|
|
46
|
-
"#f6b26b",
|
|
47
|
-
"#ffd966",
|
|
48
|
-
"#93c47d",
|
|
49
|
-
"#76a5af",
|
|
50
|
-
"#6d9eeb",
|
|
51
|
-
"#6fa8dc",
|
|
52
|
-
"#8e7cc3",
|
|
53
|
-
"#c27ba0",
|
|
54
|
-
"#a61c00",
|
|
55
|
-
"#cc0000",
|
|
56
|
-
"#e69138",
|
|
57
|
-
"#f1c232",
|
|
58
|
-
"#6aa84f",
|
|
59
|
-
"#45818e",
|
|
60
|
-
"#3c78d8",
|
|
61
|
-
"#3d85c6",
|
|
62
|
-
"#674ea7",
|
|
63
|
-
"#a64d79",
|
|
64
|
-
"#85200c",
|
|
65
|
-
"#990000",
|
|
66
|
-
"#b45f06",
|
|
67
|
-
"#bf9000",
|
|
68
|
-
"#38761d",
|
|
69
|
-
"#134f5c",
|
|
70
|
-
"#1155cc",
|
|
71
|
-
"#0b5394",
|
|
72
|
-
"#351c75",
|
|
73
|
-
"#741b47",
|
|
74
|
-
"#5b0f00",
|
|
75
|
-
"#660000",
|
|
76
|
-
"#783f04",
|
|
77
|
-
"#7f6000",
|
|
78
|
-
"#274e13",
|
|
79
|
-
"#0c343d",
|
|
80
|
-
"#1c4587",
|
|
81
|
-
"#073763",
|
|
82
|
-
"#20124d",
|
|
83
|
-
"#4c1130"
|
|
84
|
-
];
|
|
85
|
-
function J(o, r, c) {
|
|
86
|
-
r /= 100, c /= 100;
|
|
87
|
-
const i = r * Math.min(c, 1 - c), a = (t) => {
|
|
88
|
-
const l = (t + o / 30) % 12, u = c - i * Math.max(Math.min(l - 3, 9 - l, 1), -1);
|
|
89
|
-
return Math.round(255 * u).toString(16).padStart(2, "0");
|
|
90
|
-
};
|
|
91
|
-
return `#${a(0)}${a(8)}${a(4)}`;
|
|
92
|
-
}
|
|
93
|
-
function w(o) {
|
|
94
|
-
const r = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);
|
|
95
|
-
if (!r) return { h: 0, s: 100, l: 50 };
|
|
96
|
-
let c = parseInt(r[1], 16) / 255, i = parseInt(r[2], 16) / 255, a = parseInt(r[3], 16) / 255;
|
|
97
|
-
const t = Math.max(c, i, a), l = Math.min(c, i, a);
|
|
98
|
-
let u = 0, f = 0;
|
|
99
|
-
const p = (t + l) / 2;
|
|
100
|
-
if (t !== l) {
|
|
101
|
-
const d = t - l;
|
|
102
|
-
switch (f = p > 0.5 ? d / (2 - t - l) : d / (t + l), t) {
|
|
103
|
-
case c:
|
|
104
|
-
u = ((i - a) / d + (i < a ? 6 : 0)) / 6;
|
|
105
|
-
break;
|
|
106
|
-
case i:
|
|
107
|
-
u = ((a - c) / d + 2) / 6;
|
|
108
|
-
break;
|
|
109
|
-
case a:
|
|
110
|
-
u = ((c - i) / d + 4) / 6;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return { h: Math.round(u * 360), s: Math.round(f * 100), l: Math.round(p * 100) };
|
|
115
|
-
}
|
|
116
|
-
function E(o) {
|
|
117
|
-
return /^#[0-9A-Fa-f]{6}$/.test(o);
|
|
118
|
-
}
|
|
119
|
-
function M(o) {
|
|
120
|
-
let r = o.trim();
|
|
121
|
-
return r.startsWith("#") || (r = "#" + r), r.toLowerCase();
|
|
122
|
-
}
|
|
123
|
-
function Z({
|
|
124
|
-
value: o = "#000000",
|
|
125
|
-
onChange: r,
|
|
126
|
-
mode: c = "both",
|
|
127
|
-
presets: i = G,
|
|
128
|
-
size: a = "md",
|
|
129
|
-
disabled: t = !1,
|
|
130
|
-
className: l = "",
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
const p = ({
|
|
3
|
+
message: l,
|
|
4
|
+
position: n = "start",
|
|
5
|
+
avatar: s,
|
|
6
|
+
avatarAlt: i = "",
|
|
7
|
+
header: e,
|
|
8
|
+
footer: t,
|
|
9
|
+
color: c,
|
|
10
|
+
className: h = "",
|
|
131
11
|
...u
|
|
132
|
-
}) {
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (!C.current || t) return;
|
|
149
|
-
const n = C.current.getBoundingClientRect(), s = Math.max(0, Math.min(1, (e - n.left) / n.width)), y = Math.round(s * 360);
|
|
150
|
-
g({ ...f, h: y });
|
|
151
|
-
}, [f, g, t]), P = (e) => {
|
|
152
|
-
t || (I(!0), L(e.clientX));
|
|
153
|
-
};
|
|
154
|
-
R(() => {
|
|
155
|
-
const e = (s) => {
|
|
156
|
-
$ ? S(s.clientX, s.clientY) : v && L(s.clientX);
|
|
157
|
-
}, n = () => {
|
|
158
|
-
H(!1), I(!1);
|
|
159
|
-
};
|
|
160
|
-
if ($ || v)
|
|
161
|
-
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), () => {
|
|
162
|
-
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n);
|
|
163
|
-
};
|
|
164
|
-
}, [$, v, S, L]);
|
|
165
|
-
const T = (e) => {
|
|
166
|
-
const n = e.target.value;
|
|
167
|
-
m(n);
|
|
168
|
-
const s = M(n);
|
|
169
|
-
E(s) && (p(w(s)), r?.(s));
|
|
170
|
-
}, Y = (e) => {
|
|
171
|
-
if (t) return;
|
|
172
|
-
const n = M(e);
|
|
173
|
-
p(w(n)), m(n), r?.(n);
|
|
174
|
-
}, b = {
|
|
175
|
-
xs: { panel: "w-32 h-32", hue: "h-3", swatch: "w-4 h-4", input: "input-xs" },
|
|
176
|
-
sm: { panel: "w-40 h-40", hue: "h-4", swatch: "w-5 h-5", input: "input-sm" },
|
|
177
|
-
md: { panel: "w-48 h-48", hue: "h-5", swatch: "w-6 h-6", input: "input-md" },
|
|
178
|
-
lg: { panel: "w-56 h-56", hue: "h-6", swatch: "w-7 h-7", input: "input-lg" }
|
|
179
|
-
}[a], F = c === "picker" || c === "both", j = c === "swatches" || c === "both", A = f.s / 100, B = 1 - f.l / 100, U = f.h / 360;
|
|
180
|
-
return /* @__PURE__ */ N("div", { className: `inline-flex flex-col gap-3 ${t ? "opacity-50 pointer-events-none" : ""} ${l}`, ...u, children: [
|
|
181
|
-
F && /* @__PURE__ */ N(q, { children: [
|
|
182
|
-
/* @__PURE__ */ h(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
ref: k,
|
|
186
|
-
className: `${b.panel} relative rounded cursor-crosshair select-none`,
|
|
187
|
-
style: {
|
|
188
|
-
background: `
|
|
189
|
-
linear-gradient(to top, #000, transparent),
|
|
190
|
-
linear-gradient(to right, #fff, hsl(${f.h}, 100%, 50%))
|
|
191
|
-
`
|
|
192
|
-
},
|
|
193
|
-
onMouseDown: X,
|
|
194
|
-
children: /* @__PURE__ */ h(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
className: "absolute w-4 h-4 border-2 border-white rounded-full shadow-md pointer-events-none",
|
|
198
|
-
style: {
|
|
199
|
-
left: `calc(${A * 100}% - 8px)`,
|
|
200
|
-
top: `calc(${B * 100}% - 8px)`,
|
|
201
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3)"
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
}
|
|
206
|
-
),
|
|
207
|
-
/* @__PURE__ */ h(
|
|
208
|
-
"div",
|
|
209
|
-
{
|
|
210
|
-
ref: C,
|
|
211
|
-
className: `${b.hue} w-full relative rounded cursor-pointer select-none`,
|
|
212
|
-
style: {
|
|
213
|
-
background: "linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"
|
|
214
|
-
},
|
|
215
|
-
onMouseDown: P,
|
|
216
|
-
children: /* @__PURE__ */ h(
|
|
217
|
-
"div",
|
|
218
|
-
{
|
|
219
|
-
className: "absolute top-1/2 w-3 h-full border-2 border-white rounded-sm shadow-md pointer-events-none",
|
|
220
|
-
style: {
|
|
221
|
-
left: `calc(${U * 100}% - 6px)`,
|
|
222
|
-
transform: "translateY(-50%)",
|
|
223
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3)"
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
)
|
|
227
|
-
}
|
|
228
|
-
),
|
|
229
|
-
/* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
|
|
230
|
-
/* @__PURE__ */ h(
|
|
231
|
-
"div",
|
|
232
|
-
{
|
|
233
|
-
className: "w-8 h-8 rounded border border-base-300 flex-shrink-0",
|
|
234
|
-
style: { backgroundColor: E(M(d)) ? M(d) : o }
|
|
235
|
-
}
|
|
236
|
-
),
|
|
237
|
-
/* @__PURE__ */ h(
|
|
238
|
-
"input",
|
|
239
|
-
{
|
|
240
|
-
type: "text",
|
|
241
|
-
value: d,
|
|
242
|
-
onChange: T,
|
|
243
|
-
className: `input input-bordered ${b.input} w-full font-mono uppercase`,
|
|
244
|
-
placeholder: "#000000",
|
|
245
|
-
maxLength: 7,
|
|
246
|
-
disabled: t
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
] })
|
|
250
|
-
] }),
|
|
251
|
-
j && /* @__PURE__ */ h("div", { className: "grid grid-cols-10 gap-1", children: i.map((e, n) => /* @__PURE__ */ h(
|
|
252
|
-
"button",
|
|
253
|
-
{
|
|
254
|
-
type: "button",
|
|
255
|
-
className: `${b.swatch} rounded border border-base-300 cursor-pointer hover:scale-110 transition-transform ${o.toLowerCase() === e.toLowerCase() ? "ring-2 ring-primary ring-offset-1" : ""}`,
|
|
256
|
-
style: { backgroundColor: e },
|
|
257
|
-
onClick: () => Y(e),
|
|
258
|
-
disabled: t,
|
|
259
|
-
"aria-label": `Select color ${e}`
|
|
260
|
-
},
|
|
261
|
-
`${e}-${n}`
|
|
262
|
-
)) })
|
|
12
|
+
}) => {
|
|
13
|
+
const d = n === "start" ? "chat-start" : "chat-end", r = {
|
|
14
|
+
primary: "chat-bubble-primary",
|
|
15
|
+
secondary: "chat-bubble-secondary",
|
|
16
|
+
accent: "chat-bubble-accent",
|
|
17
|
+
neutral: "chat-bubble-neutral",
|
|
18
|
+
info: "chat-bubble-info",
|
|
19
|
+
success: "chat-bubble-success",
|
|
20
|
+
warning: "chat-bubble-warning",
|
|
21
|
+
error: "chat-bubble-error"
|
|
22
|
+
}, b = ["chat-bubble"];
|
|
23
|
+
return c && r[c] && b.push(r[c]), /* @__PURE__ */ o("div", { className: `chat ${d} ${h}`, ...u, children: [
|
|
24
|
+
s && /* @__PURE__ */ a("div", { className: "chat-image avatar", children: /* @__PURE__ */ a("div", { className: "w-10 rounded-full", children: /* @__PURE__ */ a("img", { alt: i, src: s }) }) }),
|
|
25
|
+
e && /* @__PURE__ */ a("div", { className: "chat-header", children: e }),
|
|
26
|
+
/* @__PURE__ */ a("div", { className: b.join(" "), children: l }),
|
|
27
|
+
t && /* @__PURE__ */ a("div", { className: "chat-footer", children: t })
|
|
263
28
|
] });
|
|
264
|
-
}
|
|
29
|
+
};
|
|
265
30
|
export {
|
|
266
|
-
|
|
31
|
+
p as Chat
|
|
267
32
|
};
|
|
268
33
|
//# sourceMappingURL=index11.js.map
|
package/dist/index11.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index11.js","sources":["../src/components/ColorPicker.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from 'react'\n\nexport interface ColorPickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n value?: string\n onChange?: (color: string) => void\n mode?: 'swatches' | 'picker' | 'both'\n presets?: string[]\n size?: 'xs' | 'sm' | 'md' | 'lg'\n disabled?: boolean\n}\n\nconst DEFAULT_PRESETS = [\n '#000000', '#434343', '#666666', '#999999', '#b7b7b7', '#cccccc', '#d9d9d9', '#efefef', '#f3f3f3', '#ffffff',\n '#980000', '#ff0000', '#ff9900', '#ffff00', '#00ff00', '#00ffff', '#4a86e8', '#0000ff', '#9900ff', '#ff00ff',\n '#e6b8af', '#f4cccc', '#fce5cd', '#fff2cc', '#d9ead3', '#d0e0e3', '#c9daf8', '#cfe2f3', '#d9d2e9', '#ead1dc',\n '#dd7e6b', '#ea9999', '#f9cb9c', '#ffe599', '#b6d7a8', '#a2c4c9', '#a4c2f4', '#9fc5e8', '#b4a7d6', '#d5a6bd',\n '#cc4125', '#e06666', '#f6b26b', '#ffd966', '#93c47d', '#76a5af', '#6d9eeb', '#6fa8dc', '#8e7cc3', '#c27ba0',\n '#a61c00', '#cc0000', '#e69138', '#f1c232', '#6aa84f', '#45818e', '#3c78d8', '#3d85c6', '#674ea7', '#a64d79',\n '#85200c', '#990000', '#b45f06', '#bf9000', '#38761d', '#134f5c', '#1155cc', '#0b5394', '#351c75', '#741b47',\n '#5b0f00', '#660000', '#783f04', '#7f6000', '#274e13', '#0c343d', '#1c4587', '#073763', '#20124d', '#4c1130',\n]\n\n// Convert HSL to Hex\nfunction hslToHex(h: number, s: number, l: number): string {\n s /= 100\n l /= 100\n const a = s * Math.min(l, 1 - l)\n const f = (n: number) => {\n const k = (n + h / 30) % 12\n const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)\n return Math.round(255 * color).toString(16).padStart(2, '0')\n }\n return `#${f(0)}${f(8)}${f(4)}`\n}\n\n// Convert Hex to HSL\nfunction hexToHsl(hex: string): { h: number; s: number; l: number } {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\n if (!result) return { h: 0, s: 100, l: 50 }\n\n let r = parseInt(result[1], 16) / 255\n let g = parseInt(result[2], 16) / 255\n let b = parseInt(result[3], 16) / 255\n\n const max = Math.max(r, g, b)\n const min = Math.min(r, g, b)\n let h = 0\n let s = 0\n const l = (max + min) / 2\n\n if (max !== min) {\n const d = max - min\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\n switch (max) {\n case r:\n h = ((g - b) / d + (g < b ? 6 : 0)) / 6\n break\n case g:\n h = ((b - r) / d + 2) / 6\n break\n case b:\n h = ((r - g) / d + 4) / 6\n break\n }\n }\n\n return { h: Math.round(h * 360), s: Math.round(s * 100), l: Math.round(l * 100) }\n}\n\n// Validate hex color\nfunction isValidHex(hex: string): boolean {\n return /^#[0-9A-Fa-f]{6}$/.test(hex)\n}\n\n// Normalize hex (add # if missing, uppercase)\nfunction normalizeHex(hex: string): string {\n let normalized = hex.trim()\n if (!normalized.startsWith('#')) {\n normalized = '#' + normalized\n }\n return normalized.toLowerCase()\n}\n\nexport function ColorPicker({\n value = '#000000',\n onChange,\n mode = 'both',\n presets = DEFAULT_PRESETS,\n size = 'md',\n disabled = false,\n className = '',\n ...rest\n}: ColorPickerProps) {\n const [hsl, setHsl] = useState(() => hexToHsl(value))\n const [hexInput, setHexInput] = useState(value)\n const [isDraggingSL, setIsDraggingSL] = useState(false)\n const [isDraggingHue, setIsDraggingHue] = useState(false)\n const slPanelRef = useRef<HTMLDivElement>(null)\n const hueSliderRef = useRef<HTMLDivElement>(null)\n\n // Sync internal state when value prop changes\n useEffect(() => {\n if (isValidHex(value)) {\n setHsl(hexToHsl(value))\n setHexInput(value)\n }\n }, [value])\n\n const updateColor = useCallback((newHsl: { h: number; s: number; l: number }) => {\n setHsl(newHsl)\n const hex = hslToHex(newHsl.h, newHsl.s, newHsl.l)\n setHexInput(hex)\n onChange?.(hex)\n }, [onChange])\n\n // Saturation/Lightness panel handlers\n const handleSLChange = useCallback((clientX: number, clientY: number) => {\n if (!slPanelRef.current || disabled) return\n const rect = slPanelRef.current.getBoundingClientRect()\n const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width))\n const y = Math.max(0, Math.min(1, (clientY - rect.top) / rect.height))\n\n // Convert x,y to saturation and lightness\n // x = saturation (0-100), y = lightness (100-0)\n const s = Math.round(x * 100)\n const l = Math.round((1 - y) * 100)\n updateColor({ ...hsl, s, l })\n }, [hsl, updateColor, disabled])\n\n const handleSLMouseDown = (e: React.MouseEvent) => {\n if (disabled) return\n setIsDraggingSL(true)\n handleSLChange(e.clientX, e.clientY)\n }\n\n // Hue slider handlers\n const handleHueChange = useCallback((clientX: number) => {\n if (!hueSliderRef.current || disabled) return\n const rect = hueSliderRef.current.getBoundingClientRect()\n const x = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width))\n const h = Math.round(x * 360)\n updateColor({ ...hsl, h })\n }, [hsl, updateColor, disabled])\n\n const handleHueMouseDown = (e: React.MouseEvent) => {\n if (disabled) return\n setIsDraggingHue(true)\n handleHueChange(e.clientX)\n }\n\n // Global mouse handlers for dragging\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n if (isDraggingSL) {\n handleSLChange(e.clientX, e.clientY)\n } else if (isDraggingHue) {\n handleHueChange(e.clientX)\n }\n }\n\n const handleMouseUp = () => {\n setIsDraggingSL(false)\n setIsDraggingHue(false)\n }\n\n if (isDraggingSL || isDraggingHue) {\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n }\n }\n }, [isDraggingSL, isDraggingHue, handleSLChange, handleHueChange])\n\n // Hex input handler\n const handleHexChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value\n setHexInput(newValue)\n const normalized = normalizeHex(newValue)\n if (isValidHex(normalized)) {\n setHsl(hexToHsl(normalized))\n onChange?.(normalized)\n }\n }\n\n // Preset click handler\n const handlePresetClick = (color: string) => {\n if (disabled) return\n const normalized = normalizeHex(color)\n setHsl(hexToHsl(normalized))\n setHexInput(normalized)\n onChange?.(normalized)\n }\n\n // Size configurations\n const sizeConfig = {\n xs: { panel: 'w-32 h-32', hue: 'h-3', swatch: 'w-4 h-4', input: 'input-xs' },\n sm: { panel: 'w-40 h-40', hue: 'h-4', swatch: 'w-5 h-5', input: 'input-sm' },\n md: { panel: 'w-48 h-48', hue: 'h-5', swatch: 'w-6 h-6', input: 'input-md' },\n lg: { panel: 'w-56 h-56', hue: 'h-6', swatch: 'w-7 h-7', input: 'input-lg' },\n }\n\n const config = sizeConfig[size]\n const showPicker = mode === 'picker' || mode === 'both'\n const showSwatches = mode === 'swatches' || mode === 'both'\n\n // Calculate picker position\n const slX = hsl.s / 100\n const slY = 1 - hsl.l / 100\n const hueX = hsl.h / 360\n\n return (\n <div className={`inline-flex flex-col gap-3 ${disabled ? 'opacity-50 pointer-events-none' : ''} ${className}`} {...rest}>\n {showPicker && (\n <>\n {/* Saturation/Lightness Panel */}\n <div\n ref={slPanelRef}\n className={`${config.panel} relative rounded cursor-crosshair select-none`}\n style={{\n background: `\n linear-gradient(to top, #000, transparent),\n linear-gradient(to right, #fff, hsl(${hsl.h}, 100%, 50%))\n `,\n }}\n onMouseDown={handleSLMouseDown}\n >\n {/* Picker indicator */}\n <div\n className=\"absolute w-4 h-4 border-2 border-white rounded-full shadow-md pointer-events-none\"\n style={{\n left: `calc(${slX * 100}% - 8px)`,\n top: `calc(${slY * 100}% - 8px)`,\n boxShadow: '0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3)',\n }}\n />\n </div>\n\n {/* Hue Slider */}\n <div\n ref={hueSliderRef}\n className={`${config.hue} w-full relative rounded cursor-pointer select-none`}\n style={{\n background: 'linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)',\n }}\n onMouseDown={handleHueMouseDown}\n >\n {/* Hue indicator */}\n <div\n className=\"absolute top-1/2 w-3 h-full border-2 border-white rounded-sm shadow-md pointer-events-none\"\n style={{\n left: `calc(${hueX * 100}% - 6px)`,\n transform: 'translateY(-50%)',\n boxShadow: '0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3)',\n }}\n />\n </div>\n\n {/* Hex Input and Preview */}\n <div className=\"flex items-center gap-2\">\n <div\n className=\"w-8 h-8 rounded border border-base-300 flex-shrink-0\"\n style={{ backgroundColor: isValidHex(normalizeHex(hexInput)) ? normalizeHex(hexInput) : value }}\n />\n <input\n type=\"text\"\n value={hexInput}\n onChange={handleHexChange}\n className={`input input-bordered ${config.input} w-full font-mono uppercase`}\n placeholder=\"#000000\"\n maxLength={7}\n disabled={disabled}\n />\n </div>\n </>\n )}\n\n {showSwatches && (\n <div className=\"grid grid-cols-10 gap-1\">\n {presets.map((color, index) => (\n <button\n key={`${color}-${index}`}\n type=\"button\"\n className={`${config.swatch} rounded border border-base-300 cursor-pointer hover:scale-110 transition-transform ${\n value.toLowerCase() === color.toLowerCase() ? 'ring-2 ring-primary ring-offset-1' : ''\n }`}\n style={{ backgroundColor: color }}\n onClick={() => handlePresetClick(color)}\n disabled={disabled}\n aria-label={`Select color ${color}`}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["DEFAULT_PRESETS","hslToHex","h","s","l","a","f","n","k","color","hexToHsl","hex","result","r","g","b","max","min","isValidHex","normalizeHex","normalized","ColorPicker","value","onChange","mode","presets","size","disabled","className","rest","hsl","setHsl","useState","hexInput","setHexInput","isDraggingSL","setIsDraggingSL","isDraggingHue","setIsDraggingHue","slPanelRef","useRef","hueSliderRef","useEffect","updateColor","useCallback","newHsl","handleSLChange","clientX","clientY","rect","x","y","handleSLMouseDown","handleHueChange","handleHueMouseDown","handleMouseMove","e","handleMouseUp","handleHexChange","newValue","handlePresetClick","config","showPicker","showSwatches","slX","slY","hueX","jsxs","Fragment","jsx","index"],"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AA,YACZ,WAAW;AAAA,YACX,UAAAlC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAGDoC,uBACE,OAAA,EAAI,WAAU,2BACZ,UAAAtC,EAAQ,IAAI,CAAChB,GAAO6D,MACnB,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAK;AAAA,QACL,WAAW,GAAGR,EAAO,MAAM,uFACzBvC,EAAM,YAAA,MAAkBb,EAAM,YAAA,IAAgB,sCAAsC,EACtF;AAAA,QACA,OAAO,EAAE,iBAAiBA,EAAA;AAAA,QAC1B,SAAS,MAAMmD,EAAkBnD,CAAK;AAAA,QACtC,UAAAkB;AAAA,QACA,cAAY,gBAAgBlB,CAAK;AAAA,MAAA;AAAA,MAR5B,GAAGA,CAAK,IAAI6D,CAAK;AAAA,IAAA,CAUzB,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index11.js","sources":["../src/components/Chat.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface ChatProps extends React.HTMLAttributes<HTMLDivElement> {\n message: React.ReactNode\n position?: 'start' | 'end'\n avatar?: string\n avatarAlt?: string\n header?: React.ReactNode\n footer?: React.ReactNode\n color?: 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error'\n}\n\nexport const Chat: React.FC<ChatProps> = ({\n message,\n position = 'start',\n avatar,\n avatarAlt = '',\n header,\n footer,\n color,\n className = '',\n ...rest\n}) => {\n const positionClass = position === 'start' ? 'chat-start' : 'chat-end'\n\n const colorClasses: Record<string, string> = {\n primary: 'chat-bubble-primary',\n secondary: 'chat-bubble-secondary',\n accent: 'chat-bubble-accent',\n neutral: 'chat-bubble-neutral',\n info: 'chat-bubble-info',\n success: 'chat-bubble-success',\n warning: 'chat-bubble-warning',\n error: 'chat-bubble-error',\n }\n\n const bubbleClasses = ['chat-bubble']\n if (color && colorClasses[color]) {\n bubbleClasses.push(colorClasses[color])\n }\n\n return (\n <div className={`chat ${positionClass} ${className}`} {...rest}>\n {avatar && (\n <div className=\"chat-image avatar\">\n <div className=\"w-10 rounded-full\">\n <img alt={avatarAlt} src={avatar} />\n </div>\n </div>\n )}\n {header && <div className=\"chat-header\">{header}</div>}\n <div className={bubbleClasses.join(' ')}>{message}</div>\n {footer && <div className=\"chat-footer\">{footer}</div>}\n </div>\n )\n}\n"],"names":["Chat","message","position","avatar","avatarAlt","header","footer","color","className","rest","positionClass","colorClasses","bubbleClasses","jsxs","jsx"],"mappings":";AAYO,MAAMA,IAA4B,CAAC;AAAA,EACxC,SAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,QAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgBR,MAAa,UAAU,eAAe,YAEtDS,IAAuC;AAAA,IAC3C,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EAAA,GAGHC,IAAgB,CAAC,aAAa;AACpC,SAAIL,KAASI,EAAaJ,CAAK,KAC7BK,EAAc,KAAKD,EAAaJ,CAAK,CAAC,GAItC,gBAAAM,EAAC,SAAI,WAAW,QAAQH,CAAa,IAAIF,CAAS,IAAK,GAAGC,GACvD,UAAA;AAAA,IAAAN,KACC,gBAAAW,EAAC,OAAA,EAAI,WAAU,qBACb,4BAAC,OAAA,EAAI,WAAU,qBACb,UAAA,gBAAAA,EAAC,SAAI,KAAKV,GAAW,KAAKD,EAAA,CAAQ,GACpC,GACF;AAAA,IAEDE,KAAU,gBAAAS,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAT,GAAO;AAAA,sBAC/C,OAAA,EAAI,WAAWO,EAAc,KAAK,GAAG,GAAI,UAAAX,GAAQ;AAAA,IACjDK,KAAU,gBAAAQ,EAAC,OAAA,EAAI,WAAU,eAAe,UAAAR,EAAA,CAAO;AAAA,EAAA,GAClD;AAEJ;"}
|
package/dist/index110.js
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import { __exports as g } from "./index127.js";
|
|
2
|
+
import { __require as m } from "./index126.js";
|
|
3
|
+
var d;
|
|
4
|
+
function T() {
|
|
5
|
+
if (d) return g;
|
|
6
|
+
d = 1;
|
|
7
|
+
const p = m();
|
|
8
|
+
function u(n, r) {
|
|
9
|
+
const i = n.a / 255, e = r + '="' + n.hex + '"';
|
|
10
|
+
return i < 1 ? e + " " + r + '-opacity="' + i.toFixed(2).slice(1) + '"' : e;
|
|
11
|
+
}
|
|
12
|
+
function h(n, r, i) {
|
|
13
|
+
let e = n + r;
|
|
14
|
+
return typeof i < "u" && (e += " " + i), e;
|
|
15
|
+
}
|
|
16
|
+
function w(n, r, i) {
|
|
17
|
+
let e = "", o = 0, s = !1, c = 0;
|
|
18
|
+
for (let t = 0; t < n.length; t++) {
|
|
19
|
+
const l = Math.floor(t % r), f = Math.floor(t / r);
|
|
20
|
+
!l && !s && (s = !0), n[t] ? (c++, t > 0 && l > 0 && n[t - 1] || (e += s ? h("M", l + i, 0.5 + f + i) : h("m", o, 0), o = 0, s = !1), l + 1 < r && n[t + 1] || (e += h("h", c), c = 0)) : o++;
|
|
21
|
+
}
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
return g.render = function(r, i, e) {
|
|
25
|
+
const o = p.getOptions(i), s = r.modules.size, c = r.modules.data, t = s + o.margin * 2, l = o.color.light.a ? "<path " + u(o.color.light, "fill") + ' d="M0 0h' + t + "v" + t + 'H0z"/>' : "", f = "<path " + u(o.color.dark, "stroke") + ' d="' + w(c, s, o.margin) + '"/>', v = 'viewBox="0 0 ' + t + " " + t + '"', a = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + v + ' shape-rendering="crispEdges">' + l + f + `</svg>
|
|
26
|
+
`;
|
|
27
|
+
return typeof e == "function" && e(null, a), a;
|
|
28
|
+
}, g;
|
|
29
|
+
}
|
|
2
30
|
export {
|
|
3
|
-
|
|
31
|
+
T as __require
|
|
4
32
|
};
|
|
5
33
|
//# sourceMappingURL=index110.js.map
|
package/dist/index110.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index110.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index110.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n const path =\n '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n"],"names":["Utils","require$$0","getColorAttrib","color","attrib","alpha","str","svgCmd","cmd","x","y","qrToPath","data","size","margin","path","moveBy","newRow","lineLength","i","col","row","svgTag","qrData","options","cb","opts","qrcodesize","bg","viewBox"],"mappings":";;;;;;AAAA,QAAMA,IAAQC,EAAA;AAEd,WAASC,EAAgBC,GAAOC,GAAQ;AACtC,UAAMC,IAAQF,EAAM,IAAI,KAClBG,IAAMF,IAAS,OAAOD,EAAM,MAAM;AAExC,WAAOE,IAAQ,IACXC,IAAM,MAAMF,IAAS,eAAeC,EAAM,QAAQ,CAAC,EAAE,MAAM,CAAC,IAAI,MAChEC;AAAA,EACN;AAEA,WAASC,EAAQC,GAAKC,GAAGC,GAAG;AAC1B,QAAIJ,IAAME,IAAMC;AAChB,WAAI,OAAOC,IAAM,QAAaJ,KAAO,MAAMI,IAEpCJ;AAAA,EACT;AAEA,WAASK,EAAUC,GAAMC,GAAMC,GAAQ;AACrC,QAAIC,IAAO,IACPC,IAAS,GACTC,IAAS,IACTC,IAAa;AAEjB,aAASC,IAAI,GAAGA,IAAIP,EAAK,QAAQO,KAAK;AACpC,YAAMC,IAAM,KAAK,MAAMD,IAAIN,CAAI,GACzBQ,IAAM,KAAK,MAAMF,IAAIN,CAAI;AAE/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" && (n = n.toString()), typeof n != "string")
|
|
7
|
-
throw new Error("Color should be defined as hex string");
|
|
8
|
-
let e = n.slice().replace("#", "").split("");
|
|
9
|
-
if (e.length < 3 || e.length === 5 || e.length > 8)
|
|
10
|
-
throw new Error("Invalid hex color: " + n);
|
|
11
|
-
(e.length === 3 || e.length === 4) && (e = Array.prototype.concat.apply([], e.map(function(t) {
|
|
12
|
-
return [t, t];
|
|
13
|
-
}))), e.length === 6 && e.push("F", "F");
|
|
14
|
-
const r = parseInt(e.join(""), 16);
|
|
15
|
-
return {
|
|
16
|
-
r: r >> 24 & 255,
|
|
17
|
-
g: r >> 16 & 255,
|
|
18
|
-
b: r >> 8 & 255,
|
|
19
|
-
a: r & 255,
|
|
20
|
-
hex: "#" + e.slice(0, 6).join("")
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
l.getOptions = function(e) {
|
|
24
|
-
e || (e = {}), e.color || (e.color = {});
|
|
25
|
-
const r = typeof e.margin > "u" || e.margin === null || e.margin < 0 ? 4 : e.margin, t = e.width && e.width >= 21 ? e.width : void 0, f = e.scale || 4;
|
|
26
|
-
return {
|
|
27
|
-
width: t,
|
|
28
|
-
scale: t ? 4 : f,
|
|
29
|
-
margin: r,
|
|
30
|
-
color: {
|
|
31
|
-
dark: m(e.color.dark || "#000000ff"),
|
|
32
|
-
light: m(e.color.light || "#ffffffff")
|
|
33
|
-
},
|
|
34
|
-
type: e.type,
|
|
35
|
-
rendererOpts: e.rendererOpts || {}
|
|
36
|
-
};
|
|
37
|
-
}, l.getScale = function(e, r) {
|
|
38
|
-
return r.width && r.width >= e + r.margin * 2 ? r.width / (e + r.margin * 2) : r.scale;
|
|
39
|
-
}, l.getImageWidth = function(e, r) {
|
|
40
|
-
const t = l.getScale(e, r);
|
|
41
|
-
return Math.floor((e + r.margin * 2) * t);
|
|
42
|
-
}, l.qrToImageData = function(e, r, t) {
|
|
43
|
-
const f = r.modules.size, w = r.modules.data, d = l.getScale(f, t), g = Math.floor((f + t.margin * 2) * d), a = t.margin * d, y = [t.color.light, t.color.dark];
|
|
44
|
-
for (let i = 0; i < g; i++)
|
|
45
|
-
for (let c = 0; c < g; c++) {
|
|
46
|
-
let h = (i * g + c) * 4, o = t.color.light;
|
|
47
|
-
if (i >= a && c >= a && i < g - a && c < g - a) {
|
|
48
|
-
const b = Math.floor((i - a) / d), I = Math.floor((c - a) / d);
|
|
49
|
-
o = y[w[b * f + I] ? 1 : 0];
|
|
50
|
-
}
|
|
51
|
-
e[h++] = o.r, e[h++] = o.g, e[h++] = o.b, e[h] = o.a;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
})(u), u);
|
|
55
|
-
}
|
|
1
|
+
var r = {};
|
|
56
2
|
export {
|
|
57
|
-
|
|
3
|
+
r as __exports
|
|
58
4
|
};
|
|
59
5
|
//# sourceMappingURL=index111.js.map
|
package/dist/index111.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index111.js","sources":[
|
|
1
|
+
{"version":3,"file":"index111.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index112.js
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import { __exports as n } from "./index129.js";
|
|
2
|
+
var r;
|
|
3
|
+
function S() {
|
|
4
|
+
if (r) return n;
|
|
5
|
+
r = 1;
|
|
6
|
+
let e;
|
|
7
|
+
const i = [
|
|
8
|
+
0,
|
|
9
|
+
// Not used
|
|
10
|
+
26,
|
|
11
|
+
44,
|
|
12
|
+
70,
|
|
13
|
+
100,
|
|
14
|
+
134,
|
|
15
|
+
172,
|
|
16
|
+
196,
|
|
17
|
+
242,
|
|
18
|
+
292,
|
|
19
|
+
346,
|
|
20
|
+
404,
|
|
21
|
+
466,
|
|
22
|
+
532,
|
|
23
|
+
581,
|
|
24
|
+
655,
|
|
25
|
+
733,
|
|
26
|
+
815,
|
|
27
|
+
901,
|
|
28
|
+
991,
|
|
29
|
+
1085,
|
|
30
|
+
1156,
|
|
31
|
+
1258,
|
|
32
|
+
1364,
|
|
33
|
+
1474,
|
|
34
|
+
1588,
|
|
35
|
+
1706,
|
|
36
|
+
1828,
|
|
37
|
+
1921,
|
|
38
|
+
2051,
|
|
39
|
+
2185,
|
|
40
|
+
2323,
|
|
41
|
+
2465,
|
|
42
|
+
2611,
|
|
43
|
+
2761,
|
|
44
|
+
2876,
|
|
45
|
+
3034,
|
|
46
|
+
3196,
|
|
47
|
+
3362,
|
|
48
|
+
3532,
|
|
49
|
+
3706
|
|
50
|
+
];
|
|
51
|
+
return n.getSymbolSize = function(t) {
|
|
52
|
+
if (!t) throw new Error('"version" cannot be null or undefined');
|
|
53
|
+
if (t < 1 || t > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
54
|
+
return t * 4 + 17;
|
|
55
|
+
}, n.getSymbolTotalCodewords = function(t) {
|
|
56
|
+
return i[t];
|
|
57
|
+
}, n.getBCHDigit = function(o) {
|
|
58
|
+
let t = 0;
|
|
59
|
+
for (; o !== 0; )
|
|
60
|
+
t++, o >>>= 1;
|
|
61
|
+
return t;
|
|
62
|
+
}, n.setToSJISFunction = function(t) {
|
|
63
|
+
if (typeof t != "function")
|
|
64
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
65
|
+
e = t;
|
|
66
|
+
}, n.isKanjiModeEnabled = function() {
|
|
67
|
+
return typeof e < "u";
|
|
68
|
+
}, n.toSJIS = function(t) {
|
|
69
|
+
return e(t);
|
|
70
|
+
}, n;
|
|
71
|
+
}
|
|
2
72
|
export {
|
|
3
|
-
|
|
73
|
+
S as __require
|
|
4
74
|
};
|
|
5
75
|
//# sourceMappingURL=index112.js.map
|
package/dist/index112.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index112.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index112.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js"],"sourcesContent":["let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n"],"names":["toSJISFunction","CODEWORDS_COUNT","utils","version","data","digit","f","kanji"],"mappings":";;;;;AAAA,MAAIA;AACJ,QAAMC,IAAkB;AAAA,IACtB;AAAA;AAAA,IACA;AAAA,IAAI;AAAA,IAAI;AAAA,IAAI;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC1C;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC7C;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IACtD;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,EACxD;AAQA,SAAAC,EAAA,gBAAwB,SAAwBC,GAAS;AACvD,QAAI,CAACA,EAAS,OAAM,IAAI,MAAM,uCAAuC;AACrE,QAAIA,IAAU,KAAKA,IAAU,GAAI,OAAM,IAAI,MAAM,2CAA2C;AAC5F,WAAOA,IAAU,IAAI;AAAA,EACvB,GAQAD,EAAA,0BAAkC,SAAkCC,GAAS;AAC3E,WAAOF,EAAgBE,CAAO;AAAA,EAChC,GAQAD,EAAA,cAAsB,SAAUE,GAAM;AACpC,QAAIC,IAAQ;AAEZ,WAAOD,MAAS;AACd,MAAAC,KACAD,OAAU;AAGZ,WAAOC;AAAA,EACT,GAEAH,EAAA,oBAA4B,SAA4BI,GAAG;AACzD,QAAI,OAAOA,KAAM;AACf,YAAM,IAAI,MAAM,uCAAuC;AAGzD,IAAAN,IAAiBM;AAAA,EACnB,GAEAJ,EAAA,qBAA6B,WAAY;AACvC,WAAO,OAAOF,IAAmB;AAAA,EACnC,GAEAE,EAAA,SAAiB,SAAiBK,GAAO;AACvC,WAAOP,EAAeO,CAAK;AAAA,EAC7B;;","x_google_ignoreList":[0]}
|
package/dist/index113.js
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
import { __exports as t } from "./index130.js";
|
|
2
|
+
var e;
|
|
3
|
+
function f() {
|
|
4
|
+
return e ? t : (e = 1, (function(r) {
|
|
5
|
+
r.L = { bit: 1 }, r.M = { bit: 0 }, r.Q = { bit: 3 }, r.H = { bit: 2 };
|
|
6
|
+
function o(n) {
|
|
7
|
+
if (typeof n != "string")
|
|
8
|
+
throw new Error("Param is not a string");
|
|
9
|
+
switch (n.toLowerCase()) {
|
|
10
|
+
case "l":
|
|
11
|
+
case "low":
|
|
12
|
+
return r.L;
|
|
13
|
+
case "m":
|
|
14
|
+
case "medium":
|
|
15
|
+
return r.M;
|
|
16
|
+
case "q":
|
|
17
|
+
case "quartile":
|
|
18
|
+
return r.Q;
|
|
19
|
+
case "h":
|
|
20
|
+
case "high":
|
|
21
|
+
return r.H;
|
|
22
|
+
default:
|
|
23
|
+
throw new Error("Unknown EC Level: " + n);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
r.isValid = function(i) {
|
|
27
|
+
return i && typeof i.bit < "u" && i.bit >= 0 && i.bit < 4;
|
|
28
|
+
}, r.from = function(i, c) {
|
|
29
|
+
if (r.isValid(i))
|
|
30
|
+
return i;
|
|
31
|
+
try {
|
|
32
|
+
return o(i);
|
|
33
|
+
} catch {
|
|
34
|
+
return c;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
})(t), t);
|
|
38
|
+
}
|
|
2
39
|
export {
|
|
3
|
-
|
|
40
|
+
f as __require
|
|
4
41
|
};
|
|
5
42
|
//# sourceMappingURL=index113.js.map
|
package/dist/index113.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index113.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index113.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js"],"sourcesContent":["exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'l':\n case 'low':\n return exports.L\n\n case 'm':\n case 'medium':\n return exports.M\n\n case 'q':\n case 'quartile':\n return exports.Q\n\n case 'h':\n case 'high':\n return exports.H\n\n default:\n throw new Error('Unknown EC Level: ' + string)\n }\n}\n\nexports.isValid = function isValid (level) {\n return level && typeof level.bit !== 'undefined' &&\n level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n"],"names":["exports","fromString","string","level","value","defaultValue"],"mappings":";;;;AAAAA,IAAAA,EAAA,IAAY,EAAE,KAAK,EAAC,GACpBA,EAAA,IAAY,EAAE,KAAK,EAAC,GACpBA,EAAA,IAAY,EAAE,KAAK,EAAC,GACpBA,EAAA,IAAY,EAAE,KAAK,EAAC;AAEpB,aAASC,EAAYC,GAAQ;AAC3B,UAAI,OAAOA,KAAW;AACpB,cAAM,IAAI,MAAM,uBAAuB;AAKzC,cAFcA,EAAO,YAAW,GAEnB;AAAA,QACX,KAAK;AAAA,QACL,KAAK;AACH,iBAAOF,EAAQ;AAAA,QAEjB,KAAK;AAAA,QACL,KAAK;AACH,iBAAOA,EAAQ;AAAA,QAEjB,KAAK;AAAA,QACL,KAAK;AACH,iBAAOA,EAAQ;AAAA,QAEjB,KAAK;AAAA,QACL,KAAK;AACH,iBAAOA,EAAQ;AAAA,QAEjB;AACE,gBAAM,IAAI,MAAM,uBAAuBE,CAAM;AAAA,MACnD;AAAA,IACA;AAEAF,IAAAA,EAAA,UAAkB,SAAkBG,GAAO;AACzC,aAAOA,KAAS,OAAOA,EAAM,MAAQ,OACnCA,EAAM,OAAO,KAAKA,EAAM,MAAM;AAAA,IAClC,GAEAH,EAAA,OAAe,SAAeI,GAAOC,GAAc;AACjD,UAAIL,EAAQ,QAAQI,CAAK;AACvB,eAAOA;AAGT,UAAI;AACF,eAAOH,EAAWG,CAAK;AAAA,MAC3B,QAAc;AACV,eAAOC;AAAA,MACX;AAAA,IACA;AAAA;;","x_google_ignoreList":[0]}
|
package/dist/index114.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i, u;
|
|
2
|
+
function n() {
|
|
3
|
+
if (u) return i;
|
|
4
|
+
u = 1;
|
|
5
|
+
function r() {
|
|
6
|
+
this.buffer = [], this.length = 0;
|
|
7
|
+
}
|
|
8
|
+
return r.prototype = {
|
|
9
|
+
get: function(f) {
|
|
10
|
+
const t = Math.floor(f / 8);
|
|
11
|
+
return (this.buffer[t] >>> 7 - f % 8 & 1) === 1;
|
|
12
|
+
},
|
|
13
|
+
put: function(f, t) {
|
|
14
|
+
for (let e = 0; e < t; e++)
|
|
15
|
+
this.putBit((f >>> t - e - 1 & 1) === 1);
|
|
16
|
+
},
|
|
17
|
+
getLengthInBits: function() {
|
|
18
|
+
return this.length;
|
|
19
|
+
},
|
|
20
|
+
putBit: function(f) {
|
|
21
|
+
const t = Math.floor(this.length / 8);
|
|
22
|
+
this.buffer.length <= t && this.buffer.push(0), f && (this.buffer[t] |= 128 >>> this.length % 8), this.length++;
|
|
23
|
+
}
|
|
24
|
+
}, i = r, i;
|
|
25
|
+
}
|
|
2
26
|
export {
|
|
3
|
-
|
|
27
|
+
n as __require
|
|
4
28
|
};
|
|
5
29
|
//# sourceMappingURL=index114.js.map
|