@agent-scope/cli 1.20.1 → 1.20.2

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/index.js CHANGED
@@ -440,6 +440,11 @@ var STYLE_ENTRY_CANDIDATES = [
440
440
  "index.css"
441
441
  ];
442
442
  var TAILWIND_IMPORT = /@import\s+["']tailwindcss["']\s*;?/;
443
+ function getElementClassNames(el) {
444
+ const className = el.className;
445
+ const raw = typeof className === "string" ? className : typeof className?.baseVal === "string" ? className.baseVal : el.getAttribute("class") ?? "";
446
+ return raw.split(/\s+/).filter(Boolean);
447
+ }
443
448
  var compilerCache = null;
444
449
  function getCachedBuild(cwd) {
445
450
  if (compilerCache !== null && resolve(compilerCache.cwd) === resolve(cwd)) {
@@ -660,8 +665,8 @@ async function renderComponent(filePath, componentName, props, viewportWidth, vi
660
665
  const classes = await page.evaluate(() => {
661
666
  const set = /* @__PURE__ */ new Set();
662
667
  document.querySelectorAll("[class]").forEach((el) => {
663
- for (const c of el.className.split(/\s+/)) {
664
- if (c) set.add(c);
668
+ for (const c of getElementClassNames(el)) {
669
+ set.add(c);
665
670
  }
666
671
  });
667
672
  return [...set];
@@ -4113,8 +4118,8 @@ function buildRenderer(filePath, componentName, viewportWidth, viewportHeight, g
4113
4118
  const classes = await page.evaluate(() => {
4114
4119
  const set = /* @__PURE__ */ new Set();
4115
4120
  document.querySelectorAll("[class]").forEach((el) => {
4116
- for (const c of el.className.split(/\s+/)) {
4117
- if (c) set.add(c);
4121
+ for (const c of getElementClassNames(el)) {
4122
+ set.add(c);
4118
4123
  }
4119
4124
  });
4120
4125
  return [...set];
@@ -4994,8 +4999,8 @@ async function renderComponent2(filePath, componentName, props, viewportWidth, v
4994
4999
  const classes = await page.evaluate(() => {
4995
5000
  const set = /* @__PURE__ */ new Set();
4996
5001
  document.querySelectorAll("[class]").forEach((el) => {
4997
- for (const c of el.className.split(/\s+/)) {
4998
- if (c) set.add(c);
5002
+ for (const c of getElementClassNames(el)) {
5003
+ set.add(c);
4999
5004
  }
5000
5005
  });
5001
5006
  return [...set];
@@ -5332,8 +5337,8 @@ async function renderComponent3(filePath, componentName, props, viewportWidth, v
5332
5337
  const classes = await page.evaluate(() => {
5333
5338
  const set = /* @__PURE__ */ new Set();
5334
5339
  document.querySelectorAll("[class]").forEach((el) => {
5335
- for (const c of el.className.split(/\s+/)) {
5336
- if (c) set.add(c);
5340
+ for (const c of getElementClassNames(el)) {
5341
+ set.add(c);
5337
5342
  }
5338
5343
  });
5339
5344
  return [...set];