asterui 0.11.0 → 0.12.1

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.
Files changed (303) hide show
  1. package/README.md +1 -103
  2. package/dist/components/Anchor.d.ts +45 -0
  3. package/dist/components/Diff.d.ts +12 -0
  4. package/dist/components/Form.d.ts +27 -2
  5. package/dist/components/Kbd.d.ts +8 -0
  6. package/dist/components/Radio.d.ts +7 -1
  7. package/dist/components/Status.d.ts +18 -0
  8. package/dist/components/TextRotate.d.ts +13 -0
  9. package/dist/index.d.ts +12 -2
  10. package/dist/index.js +210 -200
  11. package/dist/index.js.map +1 -1
  12. package/dist/index10.js +92 -30
  13. package/dist/index10.js.map +1 -1
  14. package/dist/index100.js +8 -5
  15. package/dist/index100.js.map +1 -1
  16. package/dist/index101.js +12 -41
  17. package/dist/index101.js.map +1 -1
  18. package/dist/index102.js +31 -2
  19. package/dist/index102.js.map +1 -1
  20. package/dist/index103.js +17 -6
  21. package/dist/index103.js.map +1 -1
  22. package/dist/index104.js +10788 -147
  23. package/dist/index104.js.map +1 -1
  24. package/dist/index105.js +5 -30
  25. package/dist/index105.js.map +1 -1
  26. package/dist/index106.js +39 -27
  27. package/dist/index106.js.map +1 -1
  28. package/dist/index108.js +6 -71
  29. package/dist/index108.js.map +1 -1
  30. package/dist/index109.js +147 -34
  31. package/dist/index109.js.map +1 -1
  32. package/dist/index11.js +28 -263
  33. package/dist/index11.js.map +1 -1
  34. package/dist/index110.js +28 -24
  35. package/dist/index110.js.map +1 -1
  36. package/dist/index111.js +28 -19
  37. package/dist/index111.js.map +1 -1
  38. package/dist/index112.js +2 -24
  39. package/dist/index112.js.map +1 -1
  40. package/dist/index113.js +71 -19
  41. package/dist/index113.js.map +1 -1
  42. package/dist/index114.js +33 -94
  43. package/dist/index114.js.map +1 -1
  44. package/dist/index115.js +24 -358
  45. package/dist/index115.js.map +1 -1
  46. package/dist/index116.js +19 -23
  47. package/dist/index116.js.map +1 -1
  48. package/dist/index117.js +22 -71
  49. package/dist/index117.js.map +1 -1
  50. package/dist/index118.js +17 -13
  51. package/dist/index118.js.map +1 -1
  52. package/dist/index119.js +91 -57
  53. package/dist/index119.js.map +1 -1
  54. package/dist/index12.js +259 -89
  55. package/dist/index12.js.map +1 -1
  56. package/dist/index120.js +357 -141
  57. package/dist/index120.js.map +1 -1
  58. package/dist/index121.js +25 -2
  59. package/dist/index121.js.map +1 -1
  60. package/dist/index122.js +70 -53
  61. package/dist/index122.js.map +1 -1
  62. package/dist/index123.js +16 -2
  63. package/dist/index123.js.map +1 -1
  64. package/dist/index124.js +66 -2
  65. package/dist/index124.js.map +1 -1
  66. package/dist/index125.js +144 -2
  67. package/dist/index125.js.map +1 -1
  68. package/dist/index126.js +2 -2
  69. package/dist/index127.js +56 -2
  70. package/dist/index127.js.map +1 -1
  71. package/dist/index13.js +90 -153
  72. package/dist/index13.js.map +1 -1
  73. package/dist/index130.js +2 -32
  74. package/dist/index130.js.map +1 -1
  75. package/dist/index132.js +2 -8
  76. package/dist/index132.js.map +1 -1
  77. package/dist/index133.js +2 -2
  78. package/dist/index134.js +2 -2
  79. package/dist/index135.js +2 -21
  80. package/dist/index135.js.map +1 -1
  81. package/dist/index136.js +32 -2
  82. package/dist/index136.js.map +1 -1
  83. package/dist/index137.js +2 -24
  84. package/dist/index137.js.map +1 -1
  85. package/dist/index138.js +7 -70
  86. package/dist/index138.js.map +1 -1
  87. package/dist/index139.js +2 -21
  88. package/dist/index139.js.map +1 -1
  89. package/dist/index14.js +154 -146
  90. package/dist/index14.js.map +1 -1
  91. package/dist/index140.js +2 -34
  92. package/dist/index140.js.map +1 -1
  93. package/dist/index141.js +20 -69
  94. package/dist/index141.js.map +1 -1
  95. package/dist/index142.js +2 -2
  96. package/dist/index143.js +24 -2
  97. package/dist/index143.js.map +1 -1
  98. package/dist/index144.js +70 -21
  99. package/dist/index144.js.map +1 -1
  100. package/dist/index145.js +21 -2
  101. package/dist/index145.js.map +1 -1
  102. package/dist/index146.js +34 -2
  103. package/dist/index146.js.map +1 -1
  104. package/dist/index147.js +70 -2
  105. package/dist/index147.js.map +1 -1
  106. package/dist/index148.js +2 -2
  107. package/dist/index149.js +21 -3
  108. package/dist/index149.js.map +1 -1
  109. package/dist/index15.js +150 -5
  110. package/dist/index15.js.map +1 -1
  111. package/dist/index150.js +5 -0
  112. package/dist/index150.js.map +1 -0
  113. package/dist/index151.js +5 -0
  114. package/dist/index151.js.map +1 -0
  115. package/dist/index152.js +5 -0
  116. package/dist/index152.js.map +1 -0
  117. package/dist/index153.js +5 -0
  118. package/dist/index153.js.map +1 -0
  119. package/dist/index154.js +7 -0
  120. package/dist/index154.js.map +1 -0
  121. package/dist/index16.js +5 -71
  122. package/dist/index16.js.map +1 -1
  123. package/dist/index17.js +71 -17
  124. package/dist/index17.js.map +1 -1
  125. package/dist/index18.js +15 -96
  126. package/dist/index18.js.map +1 -1
  127. package/dist/index19.js +89 -105
  128. package/dist/index19.js.map +1 -1
  129. package/dist/index20.js +107 -177
  130. package/dist/index20.js.map +1 -1
  131. package/dist/index21.js +181 -107
  132. package/dist/index21.js.map +1 -1
  133. package/dist/index22.js +107 -29
  134. package/dist/index22.js.map +1 -1
  135. package/dist/index23.js +19 -41
  136. package/dist/index23.js.map +1 -1
  137. package/dist/index24.js +31 -11
  138. package/dist/index24.js.map +1 -1
  139. package/dist/index25.js +41 -33
  140. package/dist/index25.js.map +1 -1
  141. package/dist/index26.js +12 -63
  142. package/dist/index26.js.map +1 -1
  143. package/dist/index27.js +33 -80
  144. package/dist/index27.js.map +1 -1
  145. package/dist/index28.js +63 -18
  146. package/dist/index28.js.map +1 -1
  147. package/dist/index29.js +78 -159
  148. package/dist/index29.js.map +1 -1
  149. package/dist/index3.js +96 -27
  150. package/dist/index3.js.map +1 -1
  151. package/dist/index30.js +16 -1080
  152. package/dist/index30.js.map +1 -1
  153. package/dist/index31.js +218 -16
  154. package/dist/index31.js.map +1 -1
  155. package/dist/index32.js +1081 -121
  156. package/dist/index32.js.map +1 -1
  157. package/dist/index33.js +17 -39
  158. package/dist/index33.js.map +1 -1
  159. package/dist/index34.js +121 -190
  160. package/dist/index34.js.map +1 -1
  161. package/dist/index35.js +37 -94
  162. package/dist/index35.js.map +1 -1
  163. package/dist/index36.js +186 -157
  164. package/dist/index36.js.map +1 -1
  165. package/dist/index37.js +89 -138
  166. package/dist/index37.js.map +1 -1
  167. package/dist/index38.js +161 -14
  168. package/dist/index38.js.map +1 -1
  169. package/dist/index39.js +146 -21
  170. package/dist/index39.js.map +1 -1
  171. package/dist/index4.js +26 -99
  172. package/dist/index4.js.map +1 -1
  173. package/dist/index40.js +12 -116
  174. package/dist/index40.js.map +1 -1
  175. package/dist/index41.js +18 -13
  176. package/dist/index41.js.map +1 -1
  177. package/dist/index42.js +21 -35
  178. package/dist/index42.js.map +1 -1
  179. package/dist/index43.js +117 -114
  180. package/dist/index43.js.map +1 -1
  181. package/dist/index44.js +13 -176
  182. package/dist/index44.js.map +1 -1
  183. package/dist/index45.js +34 -146
  184. package/dist/index45.js.map +1 -1
  185. package/dist/index46.js +116 -12
  186. package/dist/index46.js.map +1 -1
  187. package/dist/index47.js +176 -22
  188. package/dist/index47.js.map +1 -1
  189. package/dist/index48.js +147 -14
  190. package/dist/index48.js.map +1 -1
  191. package/dist/index49.js +10 -5
  192. package/dist/index49.js.map +1 -1
  193. package/dist/index5.js +100 -60
  194. package/dist/index5.js.map +1 -1
  195. package/dist/index50.js +21 -265
  196. package/dist/index50.js.map +1 -1
  197. package/dist/index51.js +10 -13
  198. package/dist/index51.js.map +1 -1
  199. package/dist/index52.js +7 -122
  200. package/dist/index52.js.map +1 -1
  201. package/dist/index53.js +262 -106
  202. package/dist/index53.js.map +1 -1
  203. package/dist/index54.js +14 -167
  204. package/dist/index54.js.map +1 -1
  205. package/dist/index55.js +121 -31
  206. package/dist/index55.js.map +1 -1
  207. package/dist/index56.js +107 -119
  208. package/dist/index56.js.map +1 -1
  209. package/dist/index57.js +161 -77
  210. package/dist/index57.js.map +1 -1
  211. package/dist/index58.js +31 -19
  212. package/dist/index58.js.map +1 -1
  213. package/dist/index59.js +117 -69
  214. package/dist/index59.js.map +1 -1
  215. package/dist/index6.js +61 -130
  216. package/dist/index6.js.map +1 -1
  217. package/dist/index60.js +82 -53
  218. package/dist/index60.js.map +1 -1
  219. package/dist/index61.js +19 -44
  220. package/dist/index61.js.map +1 -1
  221. package/dist/index62.js +70 -48
  222. package/dist/index62.js.map +1 -1
  223. package/dist/index63.js +55 -60
  224. package/dist/index63.js.map +1 -1
  225. package/dist/index64.js +39 -101
  226. package/dist/index64.js.map +1 -1
  227. package/dist/index65.js +52 -41
  228. package/dist/index65.js.map +1 -1
  229. package/dist/index66.js +58 -64
  230. package/dist/index66.js.map +1 -1
  231. package/dist/index67.js +105 -19
  232. package/dist/index67.js.map +1 -1
  233. package/dist/index68.js +41 -46
  234. package/dist/index68.js.map +1 -1
  235. package/dist/index69.js +63 -129
  236. package/dist/index69.js.map +1 -1
  237. package/dist/index7.js +130 -11
  238. package/dist/index7.js.map +1 -1
  239. package/dist/index70.js +19 -50
  240. package/dist/index70.js.map +1 -1
  241. package/dist/index71.js +46 -22
  242. package/dist/index71.js.map +1 -1
  243. package/dist/index72.js +134 -22
  244. package/dist/index72.js.map +1 -1
  245. package/dist/index73.js +51 -328
  246. package/dist/index73.js.map +1 -1
  247. package/dist/index74.js +19 -53
  248. package/dist/index74.js.map +1 -1
  249. package/dist/index75.js +31 -40
  250. package/dist/index75.js.map +1 -1
  251. package/dist/index76.js +22 -95
  252. package/dist/index76.js.map +1 -1
  253. package/dist/index77.js +311 -112
  254. package/dist/index77.js.map +1 -1
  255. package/dist/index78.js +52 -157
  256. package/dist/index78.js.map +1 -1
  257. package/dist/index79.js +40 -65
  258. package/dist/index79.js.map +1 -1
  259. package/dist/index8.js +11 -70
  260. package/dist/index8.js.map +1 -1
  261. package/dist/index80.js +23 -35
  262. package/dist/index80.js.map +1 -1
  263. package/dist/index81.js +88 -227
  264. package/dist/index81.js.map +1 -1
  265. package/dist/index82.js +130 -34
  266. package/dist/index82.js.map +1 -1
  267. package/dist/index83.js +153 -202
  268. package/dist/index83.js.map +1 -1
  269. package/dist/index84.js +61 -209
  270. package/dist/index84.js.map +1 -1
  271. package/dist/index85.js +34 -294
  272. package/dist/index85.js.map +1 -1
  273. package/dist/index86.js +228 -172
  274. package/dist/index86.js.map +1 -1
  275. package/dist/index87.js +32 -256
  276. package/dist/index87.js.map +1 -1
  277. package/dist/index88.js +208 -12
  278. package/dist/index88.js.map +1 -1
  279. package/dist/index89.js +209 -29
  280. package/dist/index89.js.map +1 -1
  281. package/dist/index9.js +69 -91
  282. package/dist/index9.js.map +1 -1
  283. package/dist/index90.js +294 -5
  284. package/dist/index90.js.map +1 -1
  285. package/dist/index91.js +176 -12
  286. package/dist/index91.js.map +1 -1
  287. package/dist/index92.js +256 -44
  288. package/dist/index92.js.map +1 -1
  289. package/dist/index93.js +13 -12
  290. package/dist/index93.js.map +1 -1
  291. package/dist/index94.js +32 -14
  292. package/dist/index94.js.map +1 -1
  293. package/dist/index95.js +5 -7
  294. package/dist/index95.js.map +1 -1
  295. package/dist/index96.js +13 -12
  296. package/dist/index96.js.map +1 -1
  297. package/dist/index97.js +42 -27
  298. package/dist/index97.js.map +1 -1
  299. package/dist/index98.js +11 -16
  300. package/dist/index98.js.map +1 -1
  301. package/dist/index99.js +12 -10790
  302. package/dist/index99.js.map +1 -1
  303. package/package.json +1 -1
package/dist/index11.js CHANGED
@@ -1,268 +1,33 @@
1
- import { jsxs as N, jsx as h, Fragment as q } from "react/jsx-runtime";
2
- import { useState as x, useRef as z, useEffect as R, useCallback as D } from "react";
3
- const G = [
4
- "#000000",
5
- "#434343",
6
- "#666666",
7
- "#999999",
8
- "#b7b7b7",
9
- "#cccccc",
10
- "#d9d9d9",
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 [f, p] = x(() => w(o)), [d, m] = x(o), [$, H] = x(!1), [v, I] = x(!1), k = z(null), C = z(null);
134
- R(() => {
135
- E(o) && (p(w(o)), m(o));
136
- }, [o]);
137
- const g = D((e) => {
138
- p(e);
139
- const n = J(e.h, e.s, e.l);
140
- m(n), r?.(n);
141
- }, [r]), S = D((e, n) => {
142
- if (!k.current || t) return;
143
- const s = k.current.getBoundingClientRect(), y = Math.max(0, Math.min(1, (e - s.left) / s.width)), V = Math.max(0, Math.min(1, (n - s.top) / s.height)), W = Math.round(y * 100), _ = Math.round((1 - V) * 100);
144
- g({ ...f, s: W, l: _ });
145
- }, [f, g, t]), X = (e) => {
146
- t || (H(!0), S(e.clientX, e.clientY));
147
- }, L = D((e) => {
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
- Z as ColorPicker
31
+ p as Chat
267
32
  };
268
33
  //# sourceMappingURL=index11.js.map
@@ -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"],"mappings":";;AAWA,MAAMA,IAAkB;AAAA,EACtB;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACnG;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EACnG;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;AAAA,EAAW;A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,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,29 +1,33 @@
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++;
1
+ import { __exports as a } from "./index126.js";
2
+ import { __require as h } from "./index127.js";
3
+ var p;
4
+ function C() {
5
+ return p ? a : (p = 1, (function(u) {
6
+ const f = h();
7
+ function m(d, r, e) {
8
+ d.clearRect(0, 0, r.width, r.height), r.style || (r.style = {}), r.height = e, r.width = e, r.style.height = e + "px", r.style.width = e + "px";
23
9
  }
24
- }, i = r, i;
10
+ function s() {
11
+ try {
12
+ return document.createElement("canvas");
13
+ } catch {
14
+ throw new Error("You need to specify a canvas element");
15
+ }
16
+ }
17
+ u.render = function(r, e, l) {
18
+ let t = l, n = e;
19
+ typeof t > "u" && (!e || !e.getContext) && (t = e, e = void 0), e || (n = s()), t = f.getOptions(t);
20
+ const i = f.getImageWidth(r.modules.size, t), o = n.getContext("2d"), g = o.createImageData(i, i);
21
+ return f.qrToImageData(g.data, r, t), m(o, n, i), o.putImageData(g, 0, 0), n;
22
+ }, u.renderToDataURL = function(r, e, l) {
23
+ let t = l;
24
+ typeof t > "u" && (!e || !e.getContext) && (t = e, e = void 0), t || (t = {});
25
+ const n = u.render(r, e, t), i = t.type || "image/png", o = t.rendererOpts || {};
26
+ return n.toDataURL(i, o.quality);
27
+ };
28
+ })(a), a);
25
29
  }
26
30
  export {
27
- n as __require
31
+ C as __require
28
32
  };
29
33
  //# sourceMappingURL=index110.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index110.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js"],"sourcesContent":["function BitBuffer () {\n this.buffer = []\n this.length = 0\n}\n\nBitBuffer.prototype = {\n\n get: function (index) {\n const bufIndex = Math.floor(index / 8)\n return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n },\n\n put: function (num, length) {\n for (let i = 0; i < length; i++) {\n this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n }\n },\n\n getLengthInBits: function () {\n return this.length\n },\n\n putBit: function (bit) {\n const bufIndex = Math.floor(this.length / 8)\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0)\n }\n\n if (bit) {\n this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n }\n\n this.length++\n }\n}\n\nmodule.exports = BitBuffer\n"],"names":["BitBuffer","index","bufIndex","num","length","i","bit","bitBuffer"],"mappings":";;;;AAAA,WAASA,IAAa;AACpB,SAAK,SAAS,CAAA,GACd,KAAK,SAAS;AAAA,EAChB;AAEA,SAAAA,EAAU,YAAY;AAAA,IAEpB,KAAK,SAAUC,GAAO;AACpB,YAAMC,IAAW,KAAK,MAAMD,IAAQ,CAAC;AACrC,cAAS,KAAK,OAAOC,CAAQ,MAAO,IAAID,IAAQ,IAAM,OAAO;AAAA,IACjE;AAAA,IAEE,KAAK,SAAUE,GAAKC,GAAQ;AAC1B,eAASC,IAAI,GAAGA,IAAID,GAAQC;AAC1B,aAAK,QAASF,MAASC,IAASC,IAAI,IAAM,OAAO,CAAC;AAAA,IAExD;AAAA,IAEE,iBAAiB,WAAY;AAC3B,aAAO,KAAK;AAAA,IAChB;AAAA,IAEE,QAAQ,SAAUC,GAAK;AACrB,YAAMJ,IAAW,KAAK,MAAM,KAAK,SAAS,CAAC;AAC3C,MAAI,KAAK,OAAO,UAAUA,KACxB,KAAK,OAAO,KAAK,CAAC,GAGhBI,MACF,KAAK,OAAOJ,CAAQ,KAAM,QAAU,KAAK,SAAS,IAGpD,KAAK;AAAA,IACT;AAAA,EACA,GAEAK,IAAiBP;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index110.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n"],"names":["Utils","require$$0","clearCanvas","ctx","canvas","size","getCanvasElement","exports","qrData","options","opts","canvasEl","image","type","rendererOpts"],"mappings":";;;;;AAAA,UAAMA,IAAQC,EAAA;AAEd,aAASC,EAAaC,GAAKC,GAAQC,GAAM;AACvC,MAAAF,EAAI,UAAU,GAAG,GAAGC,EAAO,OAAOA,EAAO,MAAM,GAE1CA,EAAO,UAAOA,EAAO,QAAQ,CAAA,IAClCA,EAAO,SAASC,GAChBD,EAAO,QAAQC,GACfD,EAAO,MAAM,SAASC,IAAO,MAC7BD,EAAO,MAAM,QAAQC,IAAO;AAAA,IAC9B;AAEA,aAASC,IAAoB;AAC3B,UAAI;AACF,eAAO,SAAS,cAAc,QAAQ;AAAA,MAC1C,QAAc;AACV,cAAM,IAAI,MAAM,sCAAsC;AAAA,MAC1D;AAAA,IACA;AAEAC,IAAAA,EAAA,SAAiB,SAAiBC,GAAQJ,GAAQK,GAAS;AACzD,UAAIC,IAAOD,GACPE,IAAWP;AAEf,MAAI,OAAOM,IAAS,QAAgB,CAACN,KAAU,CAACA,EAAO,gBACrDM,IAAON,GACPA,IAAS,SAGNA,MACHO,IAAWL,EAAgB,IAG7BI,IAAOV,EAAM,WAAWU,CAAI;AAC5B,YAAML,IAAOL,EAAM,cAAcQ,EAAO,QAAQ,MAAME,CAAI,GAEpDP,IAAMQ,EAAS,WAAW,IAAI,GAC9BC,IAAQT,EAAI,gBAAgBE,GAAMA,CAAI;AAC5C,aAAAL,EAAM,cAAcY,EAAM,MAAMJ,GAAQE,CAAI,GAE5CR,EAAYC,GAAKQ,GAAUN,CAAI,GAC/BF,EAAI,aAAaS,GAAO,GAAG,CAAC,GAErBD;AAAA,IACT,GAEAJ,EAAA,kBAA0B,SAA0BC,GAAQJ,GAAQK,GAAS;AAC3E,UAAIC,IAAOD;AAEX,MAAI,OAAOC,IAAS,QAAgB,CAACN,KAAU,CAACA,EAAO,gBACrDM,IAAON,GACPA,IAAS,SAGNM,MAAMA,IAAO,CAAA;AAElB,YAAMC,IAAWJ,EAAQ,OAAOC,GAAQJ,GAAQM,CAAI,GAE9CG,IAAOH,EAAK,QAAQ,aACpBI,IAAeJ,EAAK,gBAAgB,CAAA;AAE1C,aAAOC,EAAS,UAAUE,GAAMC,EAAa,OAAO;AAAA,IACtD;AAAA;;","x_google_ignoreList":[0]}
package/dist/index111.js CHANGED
@@ -1,24 +1,33 @@
1
- var n, s;
2
- function h() {
3
- if (s) return n;
4
- s = 1;
5
- function i(t) {
6
- if (!t || t < 1)
7
- throw new Error("BitMatrix size must be defined and greater than 0");
8
- this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
1
+ import { __exports as g } from "./index128.js";
2
+ import { __require as m } from "./index127.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;
9
11
  }
10
- return i.prototype.set = function(t, r, e, o) {
11
- const a = t * this.size + r;
12
- this.data[a] = e, o && (this.reservedBit[a] = !0);
13
- }, i.prototype.get = function(t, r) {
14
- return this.data[t * this.size + r];
15
- }, i.prototype.xor = function(t, r, e) {
16
- this.data[t * this.size + r] ^= e;
17
- }, i.prototype.isReserved = function(t, r) {
18
- return this.reservedBit[t * this.size + r];
19
- }, n = i, n;
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;
20
29
  }
21
30
  export {
22
- h as __require
31
+ T as __require
23
32
  };
24
33
  //# sourceMappingURL=index111.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index111.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js"],"sourcesContent":["/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n if (!size || size < 1) {\n throw new Error('BitMatrix size must be defined and greater than 0')\n }\n\n this.size = size\n this.data = new Uint8Array(size * size)\n this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n const index = row * this.size + col\n this.data[index] = value\n if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n"],"names":["BitMatrix","size","row","col","value","reserved","index","bitMatrix"],"mappings":";;;;AAKA,WAASA,EAAWC,GAAM;AACxB,QAAI,CAACA,KAAQA,IAAO;AAClB,YAAM,IAAI,MAAM,mDAAmD;AAGrE,SAAK,OAAOA,GACZ,KAAK,OAAO,IAAI,WAAWA,IAAOA,CAAI,GACtC,KAAK,cAAc,IAAI,WAAWA,IAAOA,CAAI;AAAA,EAC/C;AAWA,SAAAD,EAAU,UAAU,MAAM,SAAUE,GAAKC,GAAKC,GAAOC,GAAU;AAC7D,UAAMC,IAAQJ,IAAM,KAAK,OAAOC;AAChC,SAAK,KAAKG,CAAK,IAAIF,GACfC,MAAU,KAAK,YAAYC,CAAK,IAAI;AAAA,EAC1C,GASAN,EAAU,UAAU,MAAM,SAAUE,GAAKC,GAAK;AAC5C,WAAO,KAAK,KAAKD,IAAM,KAAK,OAAOC,CAAG;AAAA,EACxC,GAUAH,EAAU,UAAU,MAAM,SAAUE,GAAKC,GAAKC,GAAO;AACnD,SAAK,KAAKF,IAAM,KAAK,OAAOC,CAAG,KAAKC;AAAA,EACtC,GASAJ,EAAU,UAAU,aAAa,SAAUE,GAAKC,GAAK;AACnD,WAAO,KAAK,YAAYD,IAAM,KAAK,OAAOC,CAAG;AAAA,EAC/C,GAEAI,IAAiBP;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index111.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;AA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O,cAChBA,EAAG,MAAMH,CAAM,GAGVA;AAAA,EACT;;","x_google_ignoreList":[0]}
package/dist/index112.js CHANGED
@@ -1,27 +1,5 @@
1
- import { __exports as u } from "./index126.js";
2
- import { __require as a } from "./index108.js";
3
- var l;
4
- function p() {
5
- return l ? u : (l = 1, (function(s) {
6
- const c = a().getSymbolSize;
7
- s.getRowColCoords = function(r) {
8
- if (r === 1) return [];
9
- const i = Math.floor(r / 7) + 2, e = c(r), n = e === 145 ? 26 : Math.ceil((e - 13) / (2 * i - 2)) * 2, t = [e - 7];
10
- for (let o = 1; o < i - 1; o++)
11
- t[o] = t[o - 1] - n;
12
- return t.push(6), t.reverse();
13
- }, s.getPositions = function(r) {
14
- const i = [], e = s.getRowColCoords(r), n = e.length;
15
- for (let t = 0; t < n; t++)
16
- for (let o = 0; o < n; o++)
17
- t === 0 && o === 0 || // top-left
18
- t === 0 && o === n - 1 || // bottom-left
19
- t === n - 1 && o === 0 || i.push([e[t], e[o]]);
20
- return i;
21
- };
22
- })(u), u);
23
- }
1
+ var r = {};
24
2
  export {
25
- p as __require
3
+ r as __exports
26
4
  };
27
5
  //# sourceMappingURL=index112.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index112.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js"],"sourcesContent":["/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n if (version === 1) return []\n\n const posCount = Math.floor(version / 7) + 2\n const size = getSymbolSize(version)\n const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n const positions = [size - 7] // Last coord is always (size - 7)\n\n for (let i = 1; i < posCount - 1; i++) {\n positions[i] = positions[i - 1] - intervals\n }\n\n positions.push(6) // First coord is always 6\n\n return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const coords = []\n const pos = exports.getRowColCoords(version)\n const posLength = pos.length\n\n for (let i = 0; i < posLength; i++) {\n for (let j = 0; j < posLength; j++) {\n // Skip if position is occupied by finder patterns\n if ((i === 0 && j === 0) || // top-left\n (i === 0 && j === posLength - 1) || // bottom-left\n (i === posLength - 1 && j === 0)) { // top-right\n continue\n }\n\n coords.push([pos[i], pos[j]])\n }\n }\n\n return coords\n}\n"],"names":["getSymbolSize","require$$0","exports","version","posCount","size","intervals","positions","i","coords","pos","posLength","j"],"mappings":";;;;;AAUA,UAAMA,IAAgBC,IAAmB;AAgBzCC,IAAAA,EAAA,kBAA0B,SAA0BC,GAAS;AAC3D,UAAIA,MAAY,EAAG,QAAO,CAAA;AAE1B,YAAMC,IAAW,KAAK,MAAMD,IAAU,CAAC,IAAI,GACrCE,IAAOL,EAAcG,CAAO,GAC5BG,IAAYD,MAAS,MAAM,KAAK,KAAK,MAAMA,IAAO,OAAO,IAAID,IAAW,EAAE,IAAI,GAC9EG,IAAY,CAACF,IAAO,CAAC;AAE3B,eAASG,IAAI,GAAGA,IAAIJ,IAAW,GAAGI;AAChC,QAAAD,EAAUC,CAAC,IAAID,EAAUC,IAAI,CAAC,IAAIF;AAGpC,aAAAC,EAAU,KAAK,CAAC,GAETA,EAAU,QAAO;AAAA,IAC1B,GAsBAL,EAAA,eAAuB,SAAuBC,GAAS;AACrD,YAAMM,IAAS,CAAA,GACTC,IAAMR,EAAQ,gBAAgBC,CAAO,GACrCQ,IAAYD,EAAI;AAEtB,eAASF,IAAI,GAAGA,IAAIG,GAAWH;AAC7B,iBAASI,IAAI,GAAGA,IAAID,GAAWC;AAE7B,UAAKJ,MAAM,KAAKI,MAAM;AAAA,UACjBJ,MAAM,KAAKI,MAAMD,IAAY;AAAA,UAC7BH,MAAMG,IAAY,KAAKC,MAAM,KAIlCH,EAAO,KAAK,CAACC,EAAIF,CAAC,GAAGE,EAAIE,CAAC,CAAC,CAAC;AAIhC,aAAOH;AAAA,IACT;AAAA;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index112.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}