@tempots/beatui 0.83.5 → 0.86.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.
Files changed (66) hide show
  1. package/dist/beatui.css +861 -470
  2. package/dist/beatui.tailwind.css +861 -470
  3. package/dist/{index-C2_iX1um.cjs → index-4GQLcxme.cjs} +1 -1
  4. package/dist/{index-DiEcd7ZV.js → index-BFe-x3-z.js} +2 -2
  5. package/dist/index-BywbRDsb.cjs +1 -0
  6. package/dist/{index-Bm43lZqE.cjs → index-BzRuy4V1.cjs} +3 -3
  7. package/dist/{index-Di1_W_7Q.js → index-D2_J_-XS.js} +46 -45
  8. package/dist/{index-CEqc0H3v.js → index-DfJMDwSU.js} +1 -1
  9. package/dist/{index-CCMjK4fD.js → index-KNk3k6NI.js} +1 -1
  10. package/dist/{index-BS31JX7x.cjs → index-anrXec7K.cjs} +1 -1
  11. package/dist/{index-C32iUFIr.js → index-vzoI95E1.js} +3 -3
  12. package/dist/{index-BZYWyjM_.cjs → index-yMrXbIdg.cjs} +1 -1
  13. package/dist/index.cjs.js +4 -4
  14. package/dist/index.es.js +2175 -2166
  15. package/dist/json-schema/index.cjs.js +1 -1
  16. package/dist/json-schema/index.es.js +183 -196
  17. package/dist/json-structure/index.cjs.js +1 -1
  18. package/dist/json-structure/index.es.js +93 -93
  19. package/dist/lexical/index.cjs.js +2 -2
  20. package/dist/lexical/index.es.js +5 -5
  21. package/dist/lexical.css +79 -79
  22. package/dist/markdown/index.cjs.js +1 -1
  23. package/dist/markdown/index.es.js +1 -1
  24. package/dist/menu-De_-sGeb.cjs +1 -0
  25. package/dist/menu-Ui4lUPHM.js +373 -0
  26. package/dist/monaco/index.cjs.js +2 -2
  27. package/dist/monaco/index.es.js +2 -2
  28. package/dist/prosemirror/index.cjs.js +1 -1
  29. package/dist/prosemirror/index.es.js +1 -1
  30. package/dist/prosemirror.css +10 -10
  31. package/dist/styles-url-BSUFsmMD.cjs +1 -0
  32. package/dist/styles-url-BvcVGpBJ.js +4 -0
  33. package/dist/styles-url-BzPix7VR.cjs +1 -0
  34. package/dist/styles-url-CCopc5pG.js +4 -0
  35. package/dist/styles-url-CEDSZTyZ.cjs +1 -0
  36. package/dist/styles-url-CSXq0ZRz.js +4 -0
  37. package/dist/styles-url-DZhZ-9Bf.js +4 -0
  38. package/dist/styles-url-YAJ6Q1GS.cjs +1 -0
  39. package/dist/tailwind/preset.cjs.js +1 -1
  40. package/dist/tailwind/preset.es.js +18 -18
  41. package/dist/tailwind/vite-plugin.cjs.js +12 -15
  42. package/dist/tailwind/vite-plugin.es.js +178 -181
  43. package/dist/{theme-B5pmbvQ_.js → theme-BzpMLdvH.js} +6 -6
  44. package/dist/theme-DogY9oT1.cjs +1 -0
  45. package/dist/types/components/form/input/advanced-slider.d.ts +1 -1
  46. package/dist/types/components/form/input/combobox-input.d.ts +2 -0
  47. package/dist/types/components/form/input/combobox-tags-input.d.ts +3 -3
  48. package/dist/types/components/form/input/switch.d.ts +2 -1
  49. package/dist/types/components/theme/theme.d.ts +5 -4
  50. package/dist/types/tailwind/preset.d.ts +1 -1
  51. package/dist/widget-customization-B9Oc1bG4.cjs +1 -0
  52. package/dist/{widget-customization-0is7oTeP.js → widget-customization-Ct2eqKKR.js} +327 -360
  53. package/package.json +2 -2
  54. package/dist/index-DH37GTQj.cjs +0 -1
  55. package/dist/menu-CX72LaZ3.cjs +0 -1
  56. package/dist/menu-D_slbwl8.js +0 -374
  57. package/dist/styles-url-B3p8AqBy.cjs +0 -1
  58. package/dist/styles-url-COuz9fVH.js +0 -4
  59. package/dist/styles-url-CVCcF0ra.cjs +0 -1
  60. package/dist/styles-url-CZUL_YRT.cjs +0 -1
  61. package/dist/styles-url-CzNVxeM7.js +0 -4
  62. package/dist/styles-url-D8MjxiP-.cjs +0 -1
  63. package/dist/styles-url-DUdp56Ts.js +0 -4
  64. package/dist/styles-url-DpP5gepF.js +0 -4
  65. package/dist/theme-Dt6lCAvY.cjs +0 -1
  66. package/dist/widget-customization-B-LmxkPE.cjs +0 -1
@@ -1,74 +1,74 @@
1
1
  import S from "node:fs";
2
2
  import u from "node:path";
3
- import { g as V, a as H, b as J, c as Q, d as X } from "../index-Di1_W_7Q.js";
4
- import { mkdir as K, writeFile as D, readFile as Y } from "node:fs/promises";
5
- import { createHash as Z } from "node:crypto";
6
- const q = "https://fonts.googleapis.com/css2", N = "normal", ee = 400, M = "Mozilla/5.0 (compatible; BeatUI Tailwind Plugin; +https://tempots.com)";
7
- async function te(e) {
3
+ import { g as z, a as V, b as H, c as J, d as Q } from "../index-D2_J_-XS.js";
4
+ import { mkdir as X, writeFile as k, readFile as K } from "node:fs/promises";
5
+ import { createHash as Y } from "node:crypto";
6
+ const Z = "https://fonts.googleapis.com/css2", x = "normal", q = 400, D = "Mozilla/5.0 (compatible; BeatUI Tailwind Plugin; +https://tempots.com)";
7
+ async function ee(e) {
8
8
  const { projectRoot: s, requests: t, logger: r } = e;
9
9
  if (!t || t.length === 0)
10
10
  return null;
11
- const a = e.cacheDir ? u.resolve(e.cacheDir) : u.join(s, "node_modules", ".beatui", "google-fonts"), n = [], o = /* @__PURE__ */ new Map();
12
- await K(a, { recursive: !0 }).catch((g) => {
11
+ const a = e.cacheDir ? u.resolve(e.cacheDir) : u.join(s, "node_modules", ".beatui", "google-fonts"), n = [], d = /* @__PURE__ */ new Map();
12
+ await X(a, { recursive: !0 }).catch((g) => {
13
13
  r?.(`Unable to create BeatUI Google Fonts cache directory: ${g}`);
14
14
  });
15
15
  for (const g of t)
16
16
  try {
17
- const i = B(g), f = await se({
17
+ const i = M(g), l = await te({
18
18
  request: g,
19
19
  cssUrl: i,
20
20
  cacheRoot: a,
21
21
  logger: r
22
22
  });
23
- if (!f)
23
+ if (!l)
24
24
  continue;
25
- const p = await ie({
26
- cssText: f,
25
+ const y = await ie({
26
+ cssText: l,
27
27
  cacheRoot: a,
28
- assetMap: o,
28
+ assetMap: d,
29
29
  logger: r
30
30
  });
31
- n.push(p);
31
+ n.push(y);
32
32
  } catch (i) {
33
33
  r?.(
34
34
  `Unexpected error while downloading Google Font "${g.family}": ${String(i)}`
35
35
  );
36
36
  }
37
- return n.length === 0 || o.size === 0 ? null : {
37
+ return n.length === 0 || d.size === 0 ? null : {
38
38
  cssText: n.join(`
39
39
  `),
40
- assets: Array.from(o.values())
40
+ assets: Array.from(d.values())
41
41
  };
42
42
  }
43
- async function se({
43
+ async function te({
44
44
  request: e,
45
45
  cssUrl: s,
46
46
  cacheRoot: t,
47
47
  logger: r
48
48
  }) {
49
- const a = u.join(t, ne(e, s));
49
+ const a = u.join(t, se(e, s));
50
50
  try {
51
51
  const n = await fetch(s, {
52
52
  headers: {
53
- "User-Agent": M
53
+ "User-Agent": D
54
54
  }
55
55
  });
56
56
  if (!n.ok)
57
57
  throw new Error(
58
58
  `Failed to download Google Font CSS: ${n.status} ${n.statusText}`
59
59
  );
60
- const o = await n.text();
61
- return await D(a, o), o;
60
+ const d = await n.text();
61
+ return await k(a, d), d;
62
62
  } catch (n) {
63
63
  if (S.existsSync(a))
64
64
  try {
65
- const o = await Y(a, "utf8");
65
+ const d = await K(a, "utf8");
66
66
  return r?.(
67
67
  `Using cached Google Font CSS for ${e.family} because download failed.`
68
- ), o;
69
- } catch (o) {
68
+ ), d;
69
+ } catch (d) {
70
70
  r?.(
71
- `Failed to read cached Google Font CSS for ${e.family}: ${o}`
71
+ `Failed to read cached Google Font CSS for ${e.family}: ${d}`
72
72
  );
73
73
  }
74
74
  return r?.(
@@ -76,42 +76,42 @@ async function se({
76
76
  ), null;
77
77
  }
78
78
  }
79
- function ne(e, s) {
80
- const t = Z("sha1").update(s).digest("hex").slice(0, 10);
79
+ function se(e, s) {
80
+ const t = Y("sha1").update(s).digest("hex").slice(0, 10);
81
81
  return `${e.family.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-") || "font"}-${t}.css`;
82
82
  }
83
- function B(e) {
84
- const { family: s } = e, t = s.trim().replace(/\s+/g, " "), r = re(e.weights), a = ae(e.styles), n = new URLSearchParams();
85
- return n.append("family", oe(t, r, a)), e.display && n.append("display", e.display), e.subsets && e.subsets.length > 0 && n.append("subset", e.subsets.join(",")), e.text && n.append("text", e.text), `${q}?${n.toString()}`;
83
+ function M(e) {
84
+ const { family: s } = e, t = s.trim().replace(/\s+/g, " "), r = ne(e.weights), a = re(e.styles), n = new URLSearchParams();
85
+ return n.append("family", ae(t, r, a)), e.display && n.append("display", e.display), e.subsets && e.subsets.length > 0 && n.append("subset", e.subsets.join(",")), e.text && n.append("text", e.text), `${Z}?${n.toString()}`;
86
86
  }
87
- function re(e) {
87
+ function ne(e) {
88
88
  return !e || e.length === 0 ? [] : Array.from(new Set(e)).sort((s, t) => s - t);
89
89
  }
90
- function ae(e) {
90
+ function re(e) {
91
91
  if (!e || e.length === 0)
92
- return [N];
92
+ return [x];
93
93
  const s = Array.from(new Set(e)), t = s.includes("italic"), r = s.includes("normal");
94
- return !t && !r && s.push(N), s.sort((a, n) => a === n ? 0 : a === "normal" ? -1 : 1);
94
+ return !t && !r && s.push(x), s.sort((a, n) => a === n ? 0 : a === "normal" ? -1 : 1);
95
95
  }
96
- function oe(e, s, t) {
96
+ function ae(e, s, t) {
97
97
  if (s.length === 0 && t.every((i) => i === "normal"))
98
98
  return e;
99
- const r = t.includes("italic"), a = t.includes("normal"), n = s.length > 0 ? s : [ee];
99
+ const r = t.includes("italic"), a = t.includes("normal"), n = s.length > 0 ? s : [q];
100
100
  if (!r)
101
101
  return `${e}:wght@${n.join(";")}`;
102
- const o = /* @__PURE__ */ new Set();
102
+ const d = /* @__PURE__ */ new Set();
103
103
  a && n.forEach((i) => {
104
- o.add(`0,${i}`);
104
+ d.add(`0,${i}`);
105
105
  }), n.forEach((i) => {
106
- o.add(`1,${i}`);
106
+ d.add(`1,${i}`);
107
107
  });
108
- const g = Array.from(o).sort((i, f) => {
109
- const [p, v] = i.split(",").map(Number), [T, C] = f.split(",").map(Number);
110
- return p - T || v - C;
108
+ const g = Array.from(d).sort((i, l) => {
109
+ const [y, F] = i.split(",").map(Number), [T, v] = l.split(",").map(Number);
110
+ return y - T || F - v;
111
111
  });
112
112
  return `${e}:ital,wght@${g.join(";")}`;
113
113
  }
114
- const le = /url\(([^)]+)\)/g;
114
+ const oe = /url\(([^)]+)\)/g;
115
115
  async function ie({
116
116
  cssText: e,
117
117
  cacheRoot: s,
@@ -120,61 +120,61 @@ async function ie({
120
120
  }) {
121
121
  let a = e;
122
122
  const n = /* @__PURE__ */ new Set();
123
- let o;
124
- for (; (o = le.exec(e)) !== null; ) {
125
- const i = o[1].trim().replace(/^['"]|['"]$/g, "");
123
+ let d;
124
+ for (; (d = oe.exec(e)) !== null; ) {
125
+ const i = d[1].trim().replace(/^['"]|['"]$/g, "");
126
126
  i.startsWith("http") && n.add(i);
127
127
  }
128
128
  for (const g of n) {
129
- const i = await ce(g, s, t, r);
129
+ const i = await le(g, s, t, r);
130
130
  if (!i)
131
131
  continue;
132
- const f = g.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(`url\\((['"])${f}\\1\\)`, "g"), v = new RegExp(`url\\(${f}\\)`, "g");
133
- a = a.replace(p, `url(${i.placeholder})`), a = a.replace(v, `url(${i.placeholder})`);
132
+ const l = g.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), y = new RegExp(`url\\((['"])${l}\\1\\)`, "g"), F = new RegExp(`url\\(${l}\\)`, "g");
133
+ a = a.replace(y, `url(${i.placeholder})`), a = a.replace(F, `url(${i.placeholder})`);
134
134
  }
135
135
  return a;
136
136
  }
137
- async function ce(e, s, t, r) {
137
+ async function le(e, s, t, r) {
138
138
  const a = t.get(e);
139
139
  if (a)
140
140
  return a;
141
141
  let n;
142
142
  try {
143
- const f = new URL(e);
144
- n = u.basename(f.pathname);
145
- } catch (f) {
146
- return r?.(`Invalid Google Font URL skipped: ${e} (${f})`), null;
143
+ const l = new URL(e);
144
+ n = u.basename(l.pathname);
145
+ } catch (l) {
146
+ return r?.(`Invalid Google Font URL skipped: ${e} (${l})`), null;
147
147
  }
148
148
  if (!n)
149
149
  return r?.(`Unable to derive file name for Google Font URL: ${e}`), null;
150
- const o = u.join(s, n), g = `__BEATUI_GOOGLE_FONT_${t.size}__`;
151
- if (!S.existsSync(o))
150
+ const d = u.join(s, n), g = `__BEATUI_GOOGLE_FONT_${t.size}__`;
151
+ if (!S.existsSync(d))
152
152
  try {
153
- const f = await fetch(e, {
153
+ const l = await fetch(e, {
154
154
  headers: {
155
- "User-Agent": M
155
+ "User-Agent": D
156
156
  }
157
157
  });
158
- if (!f.ok)
158
+ if (!l.ok)
159
159
  return r?.(
160
- `Failed to download Google Font asset ${n}: ${f.status} ${f.statusText}`
160
+ `Failed to download Google Font asset ${n}: ${l.status} ${l.statusText}`
161
161
  ), null;
162
- const p = Buffer.from(await f.arrayBuffer());
163
- await D(o, p);
164
- } catch (f) {
162
+ const y = Buffer.from(await l.arrayBuffer());
163
+ await k(d, y);
164
+ } catch (l) {
165
165
  return r?.(
166
- `Unexpected error while downloading Google Font asset ${n}: ${String(f)}`
166
+ `Unexpected error while downloading Google Font asset ${n}: ${String(l)}`
167
167
  ), null;
168
168
  }
169
169
  const i = {
170
170
  url: e,
171
171
  fileName: n,
172
- localPath: o,
172
+ localPath: d,
173
173
  placeholder: g
174
174
  };
175
175
  return t.set(e, i), i;
176
176
  }
177
- function W(e) {
177
+ function B(e) {
178
178
  const s = typeof e == "string" ? new URL(e) : e;
179
179
  if (s.protocol !== "file:")
180
180
  throw new TypeError(`Expected file URL, received: ${s.href}`);
@@ -185,7 +185,7 @@ function W(e) {
185
185
  }
186
186
  return !r && t ? `//${t}${a}` : a;
187
187
  }
188
- const x = "@tempots/beatui/tailwind.css", y = "beatui.tailwind.css", b = u.dirname(W(import.meta.url)), k = ue(b) ?? b;
188
+ const L = "@tempots/beatui/tailwind.css", b = "beatui.tailwind.css", w = u.dirname(B(import.meta.url)), O = ce(w) ?? w;
189
189
  function j(e) {
190
190
  if (Object.keys(e).length === 0)
191
191
  return "";
@@ -197,7 +197,7 @@ function j(e) {
197
197
  return s += `}
198
198
  `, s;
199
199
  }
200
- function ue(e) {
200
+ function ce(e) {
201
201
  let s = e;
202
202
  const t = u.parse(s).root;
203
203
  for (; s && s !== t; ) {
@@ -212,29 +212,29 @@ function ue(e) {
212
212
  }
213
213
  return null;
214
214
  }
215
- function de(e) {
215
+ function ue(e) {
216
216
  if (e == null)
217
217
  return null;
218
218
  const s = typeof e == "string" ? e : e.id;
219
219
  if (!s)
220
220
  return null;
221
221
  const [t] = s.split("?");
222
- return t.startsWith("virtual:") || t.startsWith("\0") ? null : t.startsWith("/@fs/") ? decodeURIComponent(t.slice(4)) : t.startsWith("file://") ? W(t) : u.isAbsolute(t) ? t : null;
222
+ return t.startsWith("virtual:") || t.startsWith("\0") ? null : t.startsWith("/@fs/") ? decodeURIComponent(t.slice(4)) : t.startsWith("file://") ? B(t) : u.isAbsolute(t) ? t : null;
223
223
  }
224
- function fe(e) {
224
+ function de(e) {
225
225
  const s = /* @__PURE__ */ new Set([
226
- u.resolve(b, y),
227
- u.resolve(b, "../", y),
228
- u.resolve(b, "../../", y),
229
- u.resolve(b, "tailwind.css"),
230
- u.resolve(b, "../tailwind.css"),
231
- u.resolve(b, "../../tailwind.css"),
232
- u.resolve(b, "../styles/tailwind.css"),
233
- u.resolve(b, "../../styles/tailwind.css"),
234
- u.resolve(k, "dist", y),
235
- u.resolve(k, y),
236
- u.resolve(k, "tailwind.css"),
237
- u.resolve(k, "src/styles/tailwind.css"),
226
+ u.resolve(w, b),
227
+ u.resolve(w, "../", b),
228
+ u.resolve(w, "../../", b),
229
+ u.resolve(w, "tailwind.css"),
230
+ u.resolve(w, "../tailwind.css"),
231
+ u.resolve(w, "../../tailwind.css"),
232
+ u.resolve(w, "../styles/tailwind.css"),
233
+ u.resolve(w, "../../styles/tailwind.css"),
234
+ u.resolve(O, "dist", b),
235
+ u.resolve(O, b),
236
+ u.resolve(O, "tailwind.css"),
237
+ u.resolve(O, "src/styles/tailwind.css"),
238
238
  u.resolve(e, "node_modules/@tempots/beatui/tailwind.css")
239
239
  ]);
240
240
  for (const t of s)
@@ -242,16 +242,16 @@ function fe(e) {
242
242
  return t;
243
243
  return null;
244
244
  }
245
- function he(e) {
245
+ function fe(e) {
246
246
  return e ? Array.isArray(e) ? e : [e] : [];
247
247
  }
248
- function me(e, s) {
248
+ function he(e, s) {
249
249
  let t = e;
250
250
  for (const [r, a] of s)
251
251
  t = t.split(r).join(a);
252
252
  return t;
253
253
  }
254
- async function ge(e, s) {
254
+ async function me(e, s) {
255
255
  if (e == null || typeof e != "object")
256
256
  return null;
257
257
  const t = e.resolve;
@@ -263,12 +263,12 @@ async function ge(e, s) {
263
263
  return null;
264
264
  }
265
265
  }
266
- function $e(e = {}) {
266
+ function Se(e = {}) {
267
267
  let s = process.cwd();
268
- const t = e.injectCss !== !1, r = e.darkClass ?? "dark", a = e.rtlAttribute ?? "dir", n = e.rtlValue ?? "rtl";
269
- let o = "/";
270
- const i = e.semanticColors != null || e.semanticFonts != null || e.semanticRadii != null || e.semanticShadows != null || e.semanticMotion != null || e.semanticSpacing != null || e.semanticTextShadows != null ? j(
271
- V({
268
+ const t = e.injectCss !== !1, r = e.rtlAttribute ?? "dir", a = e.rtlValue ?? "rtl";
269
+ let n = "/";
270
+ const g = e.semanticColors != null || e.semanticFonts != null || e.semanticRadii != null || e.semanticShadows != null || e.semanticMotion != null || e.semanticSpacing != null || e.semanticTextShadows != null ? j(
271
+ z({
272
272
  colors: e.semanticColors,
273
273
  fonts: e.semanticFonts,
274
274
  radii: e.semanticRadii,
@@ -277,125 +277,125 @@ function $e(e = {}) {
277
277
  spacing: e.semanticSpacing,
278
278
  textShadows: e.semanticTextShadows
279
279
  })
280
- ) : "", f = e.fontFamilies ? j(
281
- H(e.fontFamilies)
282
- ) : "", p = {};
283
- e.baseSpacing && (p[J("base")] = e.baseSpacing), e.baseFontSize && (p[Q()] = e.baseFontSize), e.baseMotionDuration && (p[X("base")] = e.baseMotionDuration);
284
- const v = j(p), T = he(e.googleFonts);
285
- let C = "", E = [];
286
- const A = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), z = "/@beatui/google-fonts", U = [];
287
- let O = null, F = null, _ = !1;
280
+ ) : "", i = e.fontFamilies ? j(
281
+ V(e.fontFamilies)
282
+ ) : "", l = {};
283
+ e.baseSpacing && (l[H("base")] = e.baseSpacing), e.baseFontSize && (l[J()] = e.baseFontSize), e.baseMotionDuration && (l[Q("base")] = e.baseMotionDuration);
284
+ const y = j(l), F = fe(e.googleFonts);
285
+ let T = "", v = [];
286
+ const A = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), W = "/@beatui/google-fonts", E = [];
287
+ let G = null, C = null, _ = !1;
288
288
  const I = (h) => {
289
- const d = [
290
- v,
291
- i,
292
- f
289
+ const f = [
290
+ y,
291
+ g,
292
+ i
293
293
  ];
294
- return C && (h === "dev" ? d.push(
295
- me(C, A)
296
- ) : d.push(C)), d.filter((l) => l && l.length > 0).join(`
294
+ return T && (h === "dev" ? f.push(
295
+ he(T, A)
296
+ ) : f.push(T)), f.filter((o) => o && o.length > 0).join(`
297
297
  `);
298
298
  };
299
299
  return {
300
300
  name: "beatui-tailwind",
301
301
  enforce: "pre",
302
302
  async configResolved(h) {
303
- if (s = h.root, _ = h.command === "build", o = h.base && h.base !== "/" ? h.base.endsWith("/") ? h.base : `${h.base}/` : "/", t) {
304
- const l = await ge(
303
+ if (s = h.root, _ = h.command === "build", n = h.base && h.base !== "/" ? h.base.endsWith("/") ? h.base : `${h.base}/` : "/", t) {
304
+ const o = await me(
305
305
  this,
306
- x
306
+ L
307
307
  );
308
- F = de(l) ?? fe(s);
308
+ C = ue(o) ?? de(s);
309
309
  }
310
- const d = (l) => {
311
- this && typeof this.warn == "function" ? this.warn(l) : h.logger.warn(l);
310
+ const f = (o) => {
311
+ this && typeof this.warn == "function" ? this.warn(o) : h.logger.warn(o);
312
312
  };
313
- if (T.length > 0) {
314
- const l = Array.from(
313
+ if (F.length > 0) {
314
+ const o = Array.from(
315
315
  // eslint-disable-next-line tempots/require-async-signal-disposal -- This is an array, not a Signal
316
- new Set(T.map(B))
317
- ), c = await te({
316
+ new Set(F.map(M))
317
+ ), c = await ee({
318
318
  projectRoot: s,
319
- requests: T,
320
- logger: (m) => d(`[BeatUI] ${m}`)
319
+ requests: F,
320
+ logger: (m) => f(`[BeatUI] ${m}`)
321
321
  });
322
- if (C = c?.cssText ?? "", E = c?.assets ?? [], A.clear(), P.clear(), G.clear(), U.length = 0, E.length > 0)
323
- for (const m of E) {
324
- const w = `${z}/${m.fileName}`;
325
- A.set(m.placeholder, w), G.set(w, m.localPath);
322
+ if (T = c?.cssText ?? "", v = c?.assets ?? [], A.clear(), R.clear(), P.clear(), E.length = 0, v.length > 0)
323
+ for (const m of v) {
324
+ const p = `${W}/${m.fileName}`;
325
+ A.set(m.placeholder, p), P.set(p, m.localPath);
326
326
  }
327
327
  else
328
- U.push(...l);
328
+ E.push(...o);
329
329
  } else
330
- U.length = 0;
331
- t && !F && d(
330
+ E.length = 0;
331
+ t && !C && f(
332
332
  "[BeatUI] Unable to resolve @tempots/beatui/tailwind.css. CSS will not be auto-injected."
333
333
  );
334
334
  },
335
335
  configureServer(h) {
336
- !t || F == null || (h.middlewares.use((d, l, c) => {
337
- const m = d.method ?? "GET";
336
+ !t || C == null || (h.middlewares.use((f, o, c) => {
337
+ const m = f.method ?? "GET";
338
338
  if (!["GET", "HEAD"].includes(m)) {
339
339
  c();
340
340
  return;
341
341
  }
342
- const w = (d.url ?? "").split("?")[0];
342
+ const p = (f.url ?? "").split("?")[0];
343
343
  if (!new Set(
344
344
  [
345
- `/${y}`,
346
- o === "/" ? null : `${o}${y}`
345
+ `/${b}`,
346
+ n === "/" ? null : `${n}${b}`
347
347
  ].filter(($) => !!$)
348
- ).has(w)) {
348
+ ).has(p)) {
349
349
  c();
350
350
  return;
351
351
  }
352
- l.setHeader("Content-Type", "text/css");
352
+ o.setHeader("Content-Type", "text/css");
353
353
  try {
354
- let $ = S.readFileSync(F, "utf8");
355
- const L = I("dev");
356
- L && ($ += `
357
- ${L}`), l.end($);
354
+ let $ = S.readFileSync(C, "utf8");
355
+ const N = I("dev");
356
+ N && ($ += `
357
+ ${N}`), o.end($);
358
358
  } catch ($) {
359
359
  h.config.logger.error(
360
- `[BeatUI] Failed to stream ${x}: ${String($)}`
361
- ), l.statusCode = 500, l.end();
360
+ `[BeatUI] Failed to stream ${L}: ${String($)}`
361
+ ), o.statusCode = 500, o.end();
362
362
  }
363
- }), G.size > 0 && h.middlewares.use((d, l, c) => {
364
- const m = d.method ?? "GET";
363
+ }), P.size > 0 && h.middlewares.use((f, o, c) => {
364
+ const m = f.method ?? "GET";
365
365
  if (!["GET", "HEAD"].includes(m)) {
366
366
  c();
367
367
  return;
368
368
  }
369
- const w = (d.url ?? "").split("?")[0], R = w ? G.get(w) : void 0;
370
- if (!R) {
369
+ const p = (f.url ?? "").split("?")[0], U = p ? P.get(p) : void 0;
370
+ if (!U) {
371
371
  c();
372
372
  return;
373
373
  }
374
- l.setHeader("Content-Type", "font/woff2"), S.createReadStream(R).on("error", () => {
375
- l.statusCode = 500, l.end();
376
- }).pipe(l);
374
+ o.setHeader("Content-Type", "font/woff2"), S.createReadStream(U).on("error", () => {
375
+ o.statusCode = 500, o.end();
376
+ }).pipe(o);
377
377
  }));
378
378
  },
379
379
  buildStart() {
380
- if (!_ || !t || F == null) return;
381
- P.clear(), O = null;
382
- const h = F;
383
- let d = S.readFileSync(h, "utf8");
384
- const l = I("raw");
385
- if (l && (d += `
386
- ${l}`), O = this.emitFile({
380
+ if (!_ || !t || C == null) return;
381
+ R.clear(), G = null;
382
+ const h = C;
383
+ let f = S.readFileSync(h, "utf8");
384
+ const o = I("raw");
385
+ if (o && (f += `
386
+ ${o}`), G = this.emitFile({
387
387
  type: "asset",
388
- fileName: y,
389
- source: d
390
- }), E.length > 0)
391
- for (const c of E)
388
+ fileName: b,
389
+ source: f
390
+ }), v.length > 0)
391
+ for (const c of v)
392
392
  try {
393
- const m = S.readFileSync(c.localPath), w = this.emitFile({
393
+ const m = S.readFileSync(c.localPath), p = this.emitFile({
394
394
  type: "asset",
395
395
  name: `assets/${c.fileName}`,
396
396
  source: m
397
397
  });
398
- P.set(c.placeholder, w);
398
+ R.set(c.placeholder, p);
399
399
  } catch (m) {
400
400
  this.warn(
401
401
  `[BeatUI] Failed to include Google Font asset ${c.fileName}: ${String(
@@ -404,24 +404,24 @@ ${l}`), O = this.emitFile({
404
404
  );
405
405
  }
406
406
  },
407
- generateBundle(h, d) {
408
- if (!_ || !O)
407
+ generateBundle(h, f) {
408
+ if (!_ || !G)
409
409
  return;
410
- const l = this.getFileName(O), c = d[l];
410
+ const o = this.getFileName(G), c = f[o];
411
411
  if (!c || c.type !== "asset" || typeof c.source != "string")
412
412
  return;
413
413
  let m = c.source;
414
- for (const [w, R] of P) {
415
- const $ = this.getFileName(R);
416
- m = m.split(w).join($);
414
+ for (const [p, U] of R) {
415
+ const $ = this.getFileName(U);
416
+ m = m.split(p).join($);
417
417
  }
418
418
  c.source = m;
419
419
  },
420
420
  transformIndexHtml(h) {
421
- const d = [];
422
- if (t && F) {
423
- const c = o === "/" ? `/${y}` : `${o}${y}`;
424
- d.push({
421
+ const f = [];
422
+ if (t && C) {
423
+ const c = n === "/" ? `/${b}` : `${n}${b}`;
424
+ f.push({
425
425
  tag: "link",
426
426
  attrs: {
427
427
  rel: "stylesheet",
@@ -430,7 +430,7 @@ ${l}`), O = this.emitFile({
430
430
  injectTo: "head-prepend"
431
431
  });
432
432
  }
433
- U.length > 0 && d.push(
433
+ E.length > 0 && f.push(
434
434
  {
435
435
  tag: "link",
436
436
  attrs: {
@@ -448,7 +448,7 @@ ${l}`), O = this.emitFile({
448
448
  },
449
449
  injectTo: "head"
450
450
  },
451
- ...U.map((c) => ({
451
+ ...E.map((c) => ({
452
452
  tag: "link",
453
453
  attrs: {
454
454
  rel: "stylesheet",
@@ -458,17 +458,14 @@ ${l}`), O = this.emitFile({
458
458
  injectTo: "head"
459
459
  }))
460
460
  );
461
- const l = `
461
+ const o = `
462
462
  (() => {
463
463
  const apply = () => {
464
464
  const root = document.documentElement
465
465
  const target = document.body
466
466
  if (!target) return
467
- const hasDark = root.classList.contains('${r.replace(/'/g, "\\'")}')
468
- target.classList.toggle('b-dark', hasDark)
469
- target.classList.toggle('b-light', !hasDark)
470
- const dirValue = root.getAttribute('${a.replace(/'/g, "\\'")}')
471
- const isRtl = dirValue === '${n.replace(/'/g, "\\'")}'
467
+ const dirValue = root.getAttribute('${r.replace(/'/g, "\\'")}')
468
+ const isRtl = dirValue === '${a.replace(/'/g, "\\'")}'
472
469
  target.classList.toggle('b-rtl', isRtl)
473
470
  target.classList.toggle('b-ltr', !isRtl)
474
471
  }
@@ -480,20 +477,20 @@ ${l}`), O = this.emitFile({
480
477
  const observer = new MutationObserver(apply)
481
478
  observer.observe(document.documentElement, {
482
479
  attributes: true,
483
- attributeFilter: ['class', '${a.replace(/'/g, "\\'")}'],
480
+ attributeFilter: ['${r.replace(/'/g, "\\'")}'],
484
481
  })
485
482
  })();
486
483
  `;
487
- return d.push({
484
+ return f.push({
488
485
  tag: "script",
489
486
  attrs: { type: "module" },
490
- children: l,
487
+ children: o,
491
488
  injectTo: "body"
492
- }), { html: h, tags: d };
489
+ }), { html: h, tags: f };
493
490
  }
494
491
  };
495
492
  }
496
493
  export {
497
- $e as beatuiTailwindPlugin,
498
- $e as default
494
+ Se as beatuiTailwindPlugin,
495
+ Se as default
499
496
  };