@robosophy/ui-vue 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vite.js CHANGED
@@ -1,9 +1,14 @@
1
- import { createHash as z } from "node:crypto";
2
- import { readFile as $, readdir as H } from "node:fs/promises";
3
- import { join as y, extname as v, sep as k } from "node:path";
4
- import { createRequire as I } from "node:module";
5
- import { fileURLToPath as L } from "node:url";
6
- const f = ["outlined", "rounded", "sharp"], p = "outlined", b = /^[a-z0-9_]+$/, S = /* @__PURE__ */ new Set([".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"]), T = /* @__PURE__ */ new Set([".git", "dist", "node_modules", "storybook-static"]), A = [
1
+ import { createHash } from "node:crypto";
2
+ import { readFile, readdir } from "node:fs/promises";
3
+ import { join, extname, sep } from "node:path";
4
+ import { createRequire } from "node:module";
5
+ import { fileURLToPath } from "node:url";
6
+ const families = ["outlined", "rounded", "sharp"];
7
+ const defaultFamily = "outlined";
8
+ const iconNamePattern = /^[a-z0-9_]+$/;
9
+ const sourceExtensions = /* @__PURE__ */ new Set([".js", ".jsx", ".mjs", ".ts", ".tsx", ".vue"]);
10
+ const skippedDirs = /* @__PURE__ */ new Set([".git", "dist", "node_modules", "storybook-static"]);
11
+ const internalIconNames = [
7
12
  "arrow_drop_down",
8
13
  "arrow_drop_up",
9
14
  "arrow_left",
@@ -11,128 +16,157 @@ const f = ["outlined", "rounded", "sharp"], p = "outlined", b = /^[a-z0-9_]+$/,
11
16
  "close",
12
17
  "login",
13
18
  "nest_eco_leaf"
14
- ], h = {
19
+ ];
20
+ const familyFontNames = {
15
21
  outlined: "Material Symbols Outlined Variable",
16
22
  rounded: "Material Symbols Rounded Variable",
17
23
  sharp: "Material Symbols Sharp Variable"
18
- }, R = {
24
+ };
25
+ const familyPackages = {
19
26
  outlined: "@fontsource-variable/material-symbols-outlined",
20
27
  rounded: "@fontsource-variable/material-symbols-rounded",
21
28
  sharp: "@fontsource-variable/material-symbols-sharp"
22
- }, D = {
29
+ };
30
+ const familyFontVariants = {
23
31
  outlined: "wght",
24
32
  rounded: "wght",
25
33
  sharp: "wght"
26
- }, j = "swap", U = !1, V = I(import.meta.url);
27
- function rt(t = {}) {
28
- let e, n = null, s = !1;
29
- async function o() {
30
- return s && n || (n = await C(e, t), s = !0), n;
34
+ };
35
+ const defaultFontDisplay = "swap";
36
+ const defaultPreload = false;
37
+ const require$1 = createRequire(import.meta.url);
38
+ function robosophyMaterialSymbols(options = {}) {
39
+ let config;
40
+ let cachedAssets = null;
41
+ let cacheValid = false;
42
+ async function getAssets() {
43
+ if (cacheValid && cachedAssets) return cachedAssets;
44
+ cachedAssets = await ensureGeneratedAssets(config, options);
45
+ cacheValid = true;
46
+ return cachedAssets;
31
47
  }
32
48
  return {
33
49
  name: "robosophy-material-symbols",
34
- async configResolved(a) {
35
- e = a;
50
+ async configResolved(resolvedConfig) {
51
+ config = resolvedConfig;
36
52
  },
37
53
  async transformIndexHtml() {
38
- const a = await o();
39
- return M(a, t);
54
+ const assets = await getAssets();
55
+ return buildMaterialSymbolsHtmlTags(assets, options);
40
56
  },
41
- configureServer(a) {
42
- a.watcher.on("all", (r, i) => {
43
- S.has(v(i)) && (s = !1);
44
- }), a.middlewares.use(async (r, i, c) => {
45
- if (!r.url?.startsWith("/@robosophy-material-symbols/")) {
46
- c();
57
+ configureServer(server) {
58
+ server.watcher.on("all", (_event, file) => {
59
+ if (sourceExtensions.has(extname(file))) {
60
+ cacheValid = false;
61
+ }
62
+ });
63
+ server.middlewares.use(async (request, response, next) => {
64
+ if (!request.url?.startsWith("/@robosophy-material-symbols/")) {
65
+ next();
47
66
  return;
48
67
  }
49
68
  try {
50
- const l = await o(), u = decodeURIComponent(
51
- r.url.replace("/@robosophy-material-symbols/", "").split("?")[0] ?? ""
69
+ const assets = await getAssets();
70
+ const fileName = decodeURIComponent(
71
+ request.url.replace("/@robosophy-material-symbols/", "").split("?")[0] ?? ""
52
72
  );
53
- if (u === "rs-material-symbols.css") {
54
- i.setHeader("Content-Type", "text/css; charset=utf-8"), i.end(l.css);
73
+ if (fileName === "rs-material-symbols.css") {
74
+ response.setHeader("Content-Type", "text/css; charset=utf-8");
75
+ response.end(assets.css);
55
76
  return;
56
77
  }
57
- const m = l.fonts.find((w) => w.fileName === u);
58
- if (m) {
59
- i.setHeader("Content-Type", "font/woff2"), i.end(m.source);
78
+ const font = assets.fonts.find((asset) => asset.fileName === fileName);
79
+ if (font) {
80
+ response.setHeader("Content-Type", "font/woff2");
81
+ response.end(font.source);
60
82
  return;
61
83
  }
62
- c();
63
- } catch (l) {
64
- c(l);
84
+ next();
85
+ } catch (error) {
86
+ next(error);
65
87
  }
66
88
  });
67
89
  },
68
- async generateBundle(a, r) {
69
- const i = await o();
70
- for (const c of i.fonts)
90
+ async generateBundle(_outputOptions, bundle) {
91
+ const assets = await getAssets();
92
+ for (const font of assets.fonts) {
71
93
  this.emitFile({
72
- fileName: `assets/${c.fileName}`,
73
- name: c.fileName,
74
- source: c.source,
94
+ fileName: `assets/${font.fileName}`,
95
+ name: font.fileName,
96
+ source: font.source,
75
97
  type: "asset"
76
98
  });
99
+ }
77
100
  this.emitFile({
78
101
  fileName: "assets/rs-material-symbols.css",
79
102
  name: "rs-material-symbols.css",
80
- source: i.css,
103
+ source: assets.css,
81
104
  type: "asset"
82
105
  });
83
106
  }
84
107
  };
85
108
  }
86
- async function C(t, e) {
87
- const n = await B(t, e), s = t.command === "serve", o = await G(n, s, t.base);
109
+ async function ensureGeneratedAssets(config, options) {
110
+ const usages = await collectMaterialSymbolUsages(config, options);
111
+ const devMode = config.command === "serve";
112
+ const fonts = await generateFontAssets(usages, devMode, config.base);
113
+ const css = buildMaterialSymbolsCss(
114
+ usages,
115
+ fonts,
116
+ devMode,
117
+ options.fontDisplay ?? defaultFontDisplay
118
+ );
88
119
  return {
89
- css: O(
90
- n,
91
- o,
92
- s,
93
- e.fontDisplay ?? j
94
- ),
95
- cssHref: s ? "/@robosophy-material-symbols/rs-material-symbols.css" : _(t.base, "assets/rs-material-symbols.css"),
96
- fonts: o
120
+ css,
121
+ cssHref: devMode ? "/@robosophy-material-symbols/rs-material-symbols.css" : withBase(config.base, "assets/rs-material-symbols.css"),
122
+ fonts
97
123
  };
98
124
  }
99
- async function B(t, e = {}) {
100
- const n = tt(), s = await X();
101
- if (s)
102
- for (const o of f)
103
- for (const a of s[o] ?? [])
104
- d(n, { family: o, name: a });
105
- else
106
- for (const o of A)
107
- for (const a of f)
108
- d(n, { family: a, name: o });
109
- for (const o of e.include ?? [])
110
- d(n, typeof o == "string" ? { family: p, name: o } : o);
111
- if (e.scan !== !1) {
112
- const o = e.roots ?? [y(t.root, "src")];
113
- for (const a of o)
114
- for (const r of await x(a)) {
115
- const i = await $(r, "utf8");
116
- K(i, n);
125
+ async function collectMaterialSymbolUsages(config, options = {}) {
126
+ const usages = createUsageMap();
127
+ const manifest = await loadIconManifest();
128
+ if (manifest) {
129
+ for (const family of families) {
130
+ for (const name of manifest[family] ?? []) {
131
+ addUsage(usages, { family, name });
132
+ }
133
+ }
134
+ } else {
135
+ for (const name of internalIconNames) {
136
+ for (const family of families) {
137
+ addUsage(usages, { family, name });
138
+ }
139
+ }
140
+ }
141
+ for (const icon of options.include ?? []) {
142
+ addUsage(usages, typeof icon === "string" ? { family: defaultFamily, name: icon } : icon);
143
+ }
144
+ if (options.scan !== false) {
145
+ const roots = options.roots ?? [join(config.root, "src")];
146
+ for (const root of roots) {
147
+ for (const filePath of await listSourceFiles(root)) {
148
+ const source = await readFile(filePath, "utf8");
149
+ collectFromSource(source, usages);
117
150
  }
151
+ }
118
152
  }
119
- return n;
153
+ return usages;
120
154
  }
121
- function O(t, e, n = !1, s = j) {
122
- const o = [];
123
- for (const r of e) {
124
- const i = n ? `/@robosophy-material-symbols/${r.fileName}` : `./${r.fileName}`;
125
- o.push(
155
+ function buildMaterialSymbolsCss(usages, fonts, devMode = false, fontDisplay = defaultFontDisplay) {
156
+ const lines = [];
157
+ for (const font of fonts) {
158
+ const fontUrl = devMode ? `/@robosophy-material-symbols/${font.fileName}` : `./${font.fileName}`;
159
+ lines.push(
126
160
  "@font-face {",
127
- ` font-family: "${h[r.family]}";`,
128
- ` font-display: ${s};`,
161
+ ` font-family: "${familyFontNames[font.family]}";`,
162
+ ` font-display: ${fontDisplay};`,
129
163
  " font-style: normal;",
130
164
  " font-weight: 100 700;",
131
- ` src: url("${i}") format("woff2-variations");`,
165
+ ` src: url("${fontUrl}") format("woff2-variations");`,
132
166
  "}"
133
167
  );
134
168
  }
135
- o.push(
169
+ lines.push(
136
170
  ".rs-icon {",
137
171
  " --rs-icon-color: currentColor;",
138
172
  " --rs-icon-fill: 0;",
@@ -144,7 +178,7 @@ function O(t, e, n = !1, s = j) {
144
178
  " color: var(--rs-icon-color);",
145
179
  " display: inline-flex;",
146
180
  " flex: 0 0 auto;",
147
- ` font-family: "${h.outlined}";`,
181
+ ` font-family: "${familyFontNames.outlined}";`,
148
182
  " font-size: var(--rs-icon-size);",
149
183
  " font-style: normal;",
150
184
  ' font-feature-settings: "liga";',
@@ -160,193 +194,231 @@ function O(t, e, n = !1, s = j) {
160
194
  " white-space: nowrap;",
161
195
  " word-wrap: normal;",
162
196
  "}",
163
- `.rs-icon--rounded { font-family: "${h.rounded}"; }`,
164
- `.rs-icon--sharp { font-family: "${h.sharp}"; }`,
197
+ `.rs-icon--rounded { font-family: "${familyFontNames.rounded}"; }`,
198
+ `.rs-icon--sharp { font-family: "${familyFontNames.sharp}"; }`,
165
199
  ".rs-icon--prime::before { content: var(--rs-icon-content); }"
166
200
  );
167
- const a = /* @__PURE__ */ new Set();
168
- for (const r of f)
169
- for (const i of t.get(r) ?? [])
170
- a.add(i);
171
- for (const r of [...a].sort())
172
- o.push(`.rs-icon-${r} { --rs-icon-content: "${r}"; }`);
173
- return `${o.join(`
174
- `)}
201
+ const names = /* @__PURE__ */ new Set();
202
+ for (const family of families) {
203
+ for (const name of usages.get(family) ?? []) {
204
+ names.add(name);
205
+ }
206
+ }
207
+ for (const name of [...names].sort()) {
208
+ lines.push(`.rs-icon-${name} { --rs-icon-content: "${name}"; }`);
209
+ }
210
+ return `${lines.join("\n")}
175
211
  `;
176
212
  }
177
- function M(t, e = {}) {
178
- const n = [];
179
- if (e.preload ?? U)
180
- for (const s of t.fonts)
181
- n.push({
213
+ function buildMaterialSymbolsHtmlTags(assets, options = {}) {
214
+ const tags = [];
215
+ if (options.preload ?? defaultPreload) {
216
+ for (const font of assets.fonts) {
217
+ tags.push({
182
218
  attrs: {
183
219
  as: "font",
184
220
  crossorigin: "",
185
- href: s.href,
221
+ href: font.href,
186
222
  rel: "preload",
187
223
  type: "font/woff2"
188
224
  },
189
225
  tag: "link",
190
226
  injectTo: "head"
191
227
  });
192
- return n.push({
228
+ }
229
+ }
230
+ tags.push({
193
231
  attrs: {
194
- href: t.cssHref,
232
+ href: assets.cssHref,
195
233
  rel: "stylesheet"
196
234
  },
197
235
  tag: "link",
198
236
  injectTo: "head"
199
- }), n;
237
+ });
238
+ return tags;
200
239
  }
201
- function it(t, e, n = {}) {
202
- const s = M(e, n).map(E).filter((o) => !t.includes(`href="${J(o)}"`));
203
- return s.length === 0 ? t : t.replace("</head>", `${s.map((o) => ` ${o}`).join(`
204
- `)}
240
+ function injectMaterialSymbolsHtmlLinks(html, assets, options = {}) {
241
+ const links = buildMaterialSymbolsHtmlTags(assets, options).map(formatHtmlLinkTag).filter((link) => !html.includes(`href="${getLinkHref(link)}"`));
242
+ return links.length === 0 ? html : html.replace("</head>", `${links.map((link) => ` ${link}`).join("\n")}
205
243
  </head>`);
206
244
  }
207
- async function G(t, e, n) {
208
- const s = (await import("subset-font")).default, o = [];
209
- for (const a of f) {
210
- const r = [...t.get(a) ?? []].sort();
211
- if (r.length === 0)
245
+ async function generateFontAssets(usages, devMode, base) {
246
+ const subsetFont = (await import("subset-font")).default;
247
+ const fonts = [];
248
+ for (const family of families) {
249
+ const names = [...usages.get(family) ?? []].sort();
250
+ if (names.length === 0) {
212
251
  continue;
213
- const i = W(a), c = await $(i), l = await s(c, r.join(" "), {
252
+ }
253
+ const sourcePath = resolveFontPath(family);
254
+ const source = await readFile(sourcePath);
255
+ const subset = await subsetFont(source, names.join(" "), {
214
256
  targetFormat: "woff2"
215
- }), u = z("sha256").update(l).digest("hex").slice(0, 8), m = `rs-material-symbols-${a}-${u}.woff2`;
216
- o.push({
217
- family: a,
218
- fileName: m,
219
- href: q(m, e, n),
220
- source: l
257
+ });
258
+ const hash = createHash("sha256").update(subset).digest("hex").slice(0, 8);
259
+ const fileName = `rs-material-symbols-${family}-${hash}.woff2`;
260
+ fonts.push({
261
+ family,
262
+ fileName,
263
+ href: fontHref(fileName, devMode, base),
264
+ source: subset
221
265
  });
222
266
  }
223
- return o;
267
+ return fonts;
224
268
  }
225
- function W(t) {
226
- return V.resolve(
227
- `${R[t]}/files/material-symbols-${t}-latin-${D[t]}-normal.woff2`
269
+ function resolveFontPath(family) {
270
+ return require$1.resolve(
271
+ `${familyPackages[family]}/files/material-symbols-${family}-latin-${familyFontVariants[family]}-normal.woff2`
228
272
  );
229
273
  }
230
- function q(t, e, n) {
231
- return e ? `/@robosophy-material-symbols/${t}` : _(n, `assets/${t}`);
274
+ function fontHref(fileName, devMode, base) {
275
+ return devMode ? `/@robosophy-material-symbols/${fileName}` : withBase(base, `assets/${fileName}`);
232
276
  }
233
- function E(t) {
234
- const e = Object.entries(t.attrs ?? {}).map(([n, s]) => s === "" ? n : `${n}="${s}"`).join(" ");
235
- return `<${t.tag}${e ? ` ${e}` : ""}>`;
277
+ function formatHtmlLinkTag(tag) {
278
+ const attrs = Object.entries(tag.attrs ?? {}).map(([name, value]) => value === "" ? name : `${name}="${value}"`).join(" ");
279
+ return `<${tag.tag}${attrs ? ` ${attrs}` : ""}>`;
236
280
  }
237
- function J(t) {
238
- return t.match(/\bhref="([^"]+)"/)?.[1] ?? "";
281
+ function getLinkHref(link) {
282
+ return link.match(/\bhref="([^"]+)"/)?.[1] ?? "";
239
283
  }
240
- function K(t, e) {
241
- const n = /<RsIcon\b([^>]*)>/g;
242
- let s;
243
- for (; s = n.exec(t); ) {
244
- const c = Q(s[1] ?? ""), l = c.name ?? c[":name"], u = c.family ?? c[":family"] ?? "";
245
- if (l) {
246
- const m = Z(u), w = Y(l);
247
- for (const P of m)
248
- for (const N of w)
249
- d(e, { family: P, name: N });
284
+ function collectFromSource(source, usages) {
285
+ const rsIconTagPattern = /<RsIcon\b([^>]*)>/g;
286
+ let tagMatch;
287
+ while (tagMatch = rsIconTagPattern.exec(source)) {
288
+ const attrs = parseStaticAttributes(tagMatch[1] ?? "");
289
+ const rawName = attrs.name ?? attrs[":name"];
290
+ const hasFamily = "family" in attrs || ":family" in attrs;
291
+ const rawFamily = attrs.family ?? attrs[":family"] ?? "";
292
+ if (rawName) {
293
+ const familyList = resolveFamilies(rawFamily, hasFamily);
294
+ const names = resolveNames(rawName);
295
+ for (const family of familyList) {
296
+ for (const name of names) {
297
+ addUsage(usages, { family, name });
298
+ }
299
+ }
250
300
  }
251
301
  }
252
- const o = /\brsPrimeIcon\(\s*["']([a-z0-9_]+)["'](?:\s*,\s*\{([^)]*)\})?/g;
253
- let a;
254
- for (; a = o.exec(t); ) {
255
- const c = g(a[2]?.match(/\bfamily\s*:\s*["'](\w+)["']/)?.[1]);
256
- d(e, {
257
- family: c ?? p,
258
- name: a[1] ?? ""
302
+ const primeHelperPattern = /\brsPrimeIcon\(\s*["']([a-z0-9_]+)["'](?:\s*,\s*\{([^)]*)\})?/g;
303
+ let helperMatch;
304
+ while (helperMatch = primeHelperPattern.exec(source)) {
305
+ const family = toFamily(helperMatch[2]?.match(/\bfamily\s*:\s*["'](\w+)["']/)?.[1]);
306
+ addUsage(usages, {
307
+ family: family ?? defaultFamily,
308
+ name: helperMatch[1] ?? ""
259
309
  });
260
310
  }
261
- const r = /\bicon\s*:\s*["']([a-z0-9_]+)["']/g;
262
- let i;
263
- for (; i = r.exec(t); )
264
- d(e, {
265
- family: p,
266
- name: i[1] ?? ""
311
+ const objectIconPattern = /\bicon\s*:\s*["']([a-z0-9_]+)["']/g;
312
+ let objectMatch;
313
+ while (objectMatch = objectIconPattern.exec(source)) {
314
+ addUsage(usages, {
315
+ family: defaultFamily,
316
+ name: objectMatch[1] ?? ""
267
317
  });
318
+ }
268
319
  }
269
- function Q(t) {
270
- const e = {}, n = /([:@\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
271
- let s;
272
- for (; s = n.exec(t); )
273
- e[s[1] ?? ""] = s[2] ?? s[3] ?? "";
274
- return e;
320
+ function parseStaticAttributes(source) {
321
+ const attrs = {};
322
+ const attrPattern = /([:@\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
323
+ let match;
324
+ while (match = attrPattern.exec(source)) {
325
+ attrs[match[1] ?? ""] = match[2] ?? match[3] ?? "";
326
+ }
327
+ return attrs;
275
328
  }
276
- function F(t) {
277
- return t.replace(/^['"](.+)['"]$/, "$1");
329
+ function unwrapStaticValue(value) {
330
+ return value.replace(/^['"](.+)['"]$/, "$1");
278
331
  }
279
- function d(t, e) {
280
- const n = e.family ?? p, s = e.name.trim();
281
- !f.includes(n) || !b.test(s) || t.get(n)?.add(s);
332
+ function addUsage(usages, icon) {
333
+ const family = icon.family ?? defaultFamily;
334
+ const name = icon.name.trim();
335
+ if (!families.includes(family) || !iconNamePattern.test(name)) {
336
+ return;
337
+ }
338
+ usages.get(family)?.add(name);
282
339
  }
283
- async function X() {
340
+ async function loadIconManifest() {
284
341
  try {
285
- const t = y(L(import.meta.url), ".."), e = y(t, "icon-manifest.json"), n = await $(e, "utf8");
286
- return JSON.parse(n);
342
+ const dir = join(fileURLToPath(import.meta.url), "..");
343
+ const manifestPath = join(dir, "icon-manifest.json");
344
+ const source = await readFile(manifestPath, "utf8");
345
+ return JSON.parse(source);
287
346
  } catch {
288
347
  return null;
289
348
  }
290
349
  }
291
- function g(t) {
292
- const e = t ? F(t) : "";
293
- return f.includes(e) ? e : void 0;
350
+ function toFamily(value) {
351
+ const normalized = value ? unwrapStaticValue(value) : "";
352
+ return families.includes(normalized) ? normalized : void 0;
294
353
  }
295
- function Y(t) {
296
- const e = /["']([a-z0-9_]+)["']/g;
297
- let n;
298
- const s = [];
299
- for (; n = e.exec(t); ) {
300
- const o = n[1] ?? "";
301
- b.test(o) && s.push(o);
354
+ function resolveNames(rawName) {
355
+ const stringLiterals = /["']([a-z0-9_]+)["']/g;
356
+ let strMatch;
357
+ const names = [];
358
+ while (strMatch = stringLiterals.exec(rawName)) {
359
+ const candidate = strMatch[1] ?? "";
360
+ if (iconNamePattern.test(candidate)) {
361
+ names.push(candidate);
362
+ }
302
363
  }
303
- if (s.length === 0) {
304
- const o = F(t);
305
- b.test(o) && s.push(o);
364
+ if (names.length === 0) {
365
+ const name = unwrapStaticValue(rawName);
366
+ if (iconNamePattern.test(name)) {
367
+ names.push(name);
368
+ }
306
369
  }
307
- return s;
370
+ return names;
308
371
  }
309
- function Z(t) {
310
- const e = g(t);
311
- if (e) return [e];
312
- const n = /["'](\w+)["']/g;
313
- let s;
314
- const o = /* @__PURE__ */ new Set();
315
- for (; s = n.exec(t); ) {
316
- const a = s[1] ?? "", r = g(a);
317
- r && o.add(r);
372
+ function resolveFamilies(rawFamily, hasFamily = true) {
373
+ const family = toFamily(rawFamily);
374
+ if (family) return [family];
375
+ const stringLiterals = /["'](\w+)["']/g;
376
+ let strMatch;
377
+ const found = /* @__PURE__ */ new Set();
378
+ while (strMatch = stringLiterals.exec(rawFamily)) {
379
+ const candidate = strMatch[1] ?? "";
380
+ const f = toFamily(candidate);
381
+ if (f) {
382
+ found.add(f);
383
+ }
318
384
  }
319
- return o.size > 0 ? [...o] : [...f];
385
+ if (found.size > 0) return [...found];
386
+ if (!hasFamily) return [defaultFamily];
387
+ return [...families];
320
388
  }
321
- function tt() {
322
- return new Map(f.map((t) => [t, /* @__PURE__ */ new Set()]));
389
+ function createUsageMap() {
390
+ return new Map(families.map((family) => [family, /* @__PURE__ */ new Set()]));
323
391
  }
324
- async function x(t) {
392
+ async function listSourceFiles(root) {
325
393
  try {
326
- const e = await H(t, { withFileTypes: !0 });
327
- return (await Promise.all(
328
- e.map(async (s) => {
329
- const o = y(t, s.name);
330
- return s.isDirectory() ? T.has(s.name) ? [] : x(o) : S.has(v(s.name)) ? [o] : [];
394
+ const entries = await readdir(root, { withFileTypes: true });
395
+ const files = await Promise.all(
396
+ entries.map(async (entry) => {
397
+ const path = join(root, entry.name);
398
+ if (entry.isDirectory()) {
399
+ return skippedDirs.has(entry.name) ? [] : listSourceFiles(path);
400
+ }
401
+ return sourceExtensions.has(extname(entry.name)) ? [path] : [];
331
402
  })
332
- )).flat();
403
+ );
404
+ return files.flat();
333
405
  } catch {
334
406
  return [];
335
407
  }
336
408
  }
337
- function _(t, e) {
338
- return `${t.endsWith("/") ? t : `${t}/`}${e}`.replaceAll(`${k}`, "/");
409
+ function withBase(base, path) {
410
+ const cleanBase = base.endsWith("/") ? base : `${base}/`;
411
+ return `${cleanBase}${path}`.replaceAll(`${sep}`, "/");
339
412
  }
340
- function ct(t) {
341
- return f.map((e) => `${e}: ${[...t.get(e) ?? []].sort().join(", ")}`).join(`
342
- `);
413
+ function formatDetectedMaterialSymbols(usages) {
414
+ return families.map((family) => `${family}: ${[...usages.get(family) ?? []].sort().join(", ")}`).join("\n");
343
415
  }
344
416
  export {
345
- O as buildMaterialSymbolsCss,
346
- M as buildMaterialSymbolsHtmlTags,
347
- B as collectMaterialSymbolUsages,
348
- ct as formatDetectedMaterialSymbols,
349
- it as injectMaterialSymbolsHtmlLinks,
350
- rt as robosophyMaterialSymbols
417
+ buildMaterialSymbolsCss,
418
+ buildMaterialSymbolsHtmlTags,
419
+ collectMaterialSymbolUsages,
420
+ formatDetectedMaterialSymbols,
421
+ injectMaterialSymbolsHtmlLinks,
422
+ robosophyMaterialSymbols
351
423
  };
352
424
  //# sourceMappingURL=vite.js.map