@agimon-ai/po-style-system-tooling 0.2.14-alpha.37 → 0.2.14-alpha.38

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/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_stdio = require("./stdio-BjzSXqB5.cjs");
2
+ const require_stdio = require("./stdio-x6EuV64Q.cjs");
3
3
  let node_fs = require("node:fs");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_stdio.__toESM(node_path, 1);
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { B as log, F as DEFAULT_STYLE_SYSTEM_CONFIG, I as TailwindCSSClassesService, T as getAppDesignSystemConfig, V as STYLE_SYSTEM_TYPES, a as STYLE_SYSTEM_CLI_NAME, i as createServer$1, j as resolveStyleSystemThemePath, o as STYLE_SYSTEM_VERSION, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, y as getBundlerServiceFromConfig } from "./stdio-BnqtVQFh.mjs";
2
+ import { B as log, F as DEFAULT_STYLE_SYSTEM_CONFIG, I as TailwindCSSClassesService, T as getAppDesignSystemConfig, V as STYLE_SYSTEM_TYPES, a as STYLE_SYSTEM_CLI_NAME, i as createServer$1, j as resolveStyleSystemThemePath, o as STYLE_SYSTEM_VERSION, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, y as getBundlerServiceFromConfig } from "./stdio-B5wufO5-.mjs";
3
3
  import { promises } from "node:fs";
4
4
  import path, { join } from "node:path";
5
5
  import { z } from "zod";
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_stdio = require("./stdio-BjzSXqB5.cjs");
2
+ const require_stdio = require("./stdio-x6EuV64Q.cjs");
3
3
  let node_fs = require("node:fs");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_stdio.__toESM(node_path, 1);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as StyleSystemConfigLoader, B as log, C as launchBrowserWithFallback, D as hasStyleSystemProjectConfig, E as getSharedComponentTags, F as DEFAULT_STYLE_SYSTEM_CONFIG, I as TailwindCSSClassesService, L as BaseCSSClassesService, M as MAX_STYLE_SYSTEM_VIEWPORT_DIMENSION, N as StoriesIndexService, O as resetStyleSystemConfigCache, P as CSSClassesServiceFactory, R as TemplatesManagerService, S as BaseBundlerService, T as getAppDesignSystemConfig, V as STYLE_SYSTEM_TYPES, _ as createDefaultBundlerService, b as ViteReactNativeBundlerService, c as createStyleSystemModule, d as GetComponentVisualTool, f as GetCSSClassesTool, g as ThemeService, h as ComponentRendererService, i as createServer, j as resolveStyleSystemThemePath, k as resolveAppDesignSystemConfig, l as ListAppComponentsTool, m as GetUiComponentService, n as extractCustomTokenNames, p as ListThemesTool, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, u as ListSharedComponentsTool, v as getBundlerService, w as withRenderSlot, x as ViteReactBundlerService, y as getBundlerServiceFromConfig, z as isContained } from "./stdio-BnqtVQFh.mjs";
1
+ import { A as StyleSystemConfigLoader, B as log, C as launchBrowserWithFallback, D as hasStyleSystemProjectConfig, E as getSharedComponentTags, F as DEFAULT_STYLE_SYSTEM_CONFIG, I as TailwindCSSClassesService, L as BaseCSSClassesService, M as MAX_STYLE_SYSTEM_VIEWPORT_DIMENSION, N as StoriesIndexService, O as resetStyleSystemConfigCache, P as CSSClassesServiceFactory, R as TemplatesManagerService, S as BaseBundlerService, T as getAppDesignSystemConfig, V as STYLE_SYSTEM_TYPES, _ as createDefaultBundlerService, b as ViteReactNativeBundlerService, c as createStyleSystemModule, d as GetComponentVisualTool, f as GetCSSClassesTool, g as ThemeService, h as ComponentRendererService, i as createServer, j as resolveStyleSystemThemePath, k as resolveAppDesignSystemConfig, l as ListAppComponentsTool, m as GetUiComponentService, n as extractCustomTokenNames, p as ListThemesTool, r as generateRestrictedClassesConfig, s as createContainer, t as StdioTransportHandler, u as ListSharedComponentsTool, v as getBundlerService, w as withRenderSlot, x as ViteReactBundlerService, y as getBundlerServiceFromConfig, z as isContained } from "./stdio-B5wufO5-.mjs";
2
2
  import { promises } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -1591,14 +1591,30 @@ const VITE_ERROR_OVERLAY_SELECTOR = "vite-error-overlay";
1591
1591
  const STORY_MOUNT_TIMEOUT_MS = 1e4;
1592
1592
  /**
1593
1593
  * Runs in the page (this package has no DOM types): resolves once web fonts and every image the
1594
- * story rendered have loaded (or failed), then two frames have painted.
1594
+ * story rendered have loaded (or failed), two frames have painted, and the layout stopped moving.
1595
1595
  */
1596
- const FONTS_IMAGES_AND_TWO_FRAMES = `Promise.all([
1596
+ const FONTS_IMAGES_AND_STILL_LAYOUT = `Promise.all([
1597
1597
  document.fonts.ready,
1598
1598
  ...Array.from(document.images, (image) =>
1599
1599
  image.complete ? null : new Promise((resolve) => { image.addEventListener('load', resolve, { once: true }); image.addEventListener('error', resolve, { once: true }); }),
1600
1600
  ),
1601
- ]).then(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve))))`;
1601
+ ]).then(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))).then(() => new Promise((resolve) => {
1602
+ const started = performance.now();
1603
+ let last = '';
1604
+ let still = 0;
1605
+ const frame = () => {
1606
+ let boxes = '';
1607
+ for (const element of document.querySelectorAll('body *')) {
1608
+ const box = element.getBoundingClientRect();
1609
+ if (box.width >= 64 && box.height >= 64) boxes += Math.round(box.x) + ',' + Math.round(box.y) + ',' + Math.round(box.width) + ',' + Math.round(box.height) + ';';
1610
+ }
1611
+ still = boxes === last ? still + 1 : 0;
1612
+ last = boxes;
1613
+ if (still >= 5 || performance.now() - started > 3000) resolve();
1614
+ else requestAnimationFrame(frame);
1615
+ };
1616
+ requestAnimationFrame(frame);
1617
+ }))`;
1602
1618
  /**
1603
1619
  * Attempts to launch a browser, trying multiple configurations in order of preference.
1604
1620
  * @returns Launched browser instance
@@ -1673,7 +1689,7 @@ async function takeScreenshot(options) {
1673
1689
  if (await page.waitForSelector(`${STORY_ROOT_SELECTOR} > *, ${VITE_ERROR_OVERLAY_SELECTOR}`, {
1674
1690
  state: "attached",
1675
1691
  timeout: STORY_MOUNT_TIMEOUT_MS
1676
- }).then(() => true).catch(() => false)) await page.evaluate(FONTS_IMAGES_AND_TWO_FRAMES);
1692
+ }).then(() => true).catch(() => false)) await page.evaluate(FONTS_IMAGES_AND_STILL_LAYOUT);
1677
1693
  if (waitTime > 0) await page.waitForTimeout(waitTime);
1678
1694
  const hasViteErrorOverlay = await page.locator(VITE_ERROR_OVERLAY_SELECTOR).count();
1679
1695
  const renderedChildCount = await page.locator(`${STORY_ROOT_SELECTOR} > *`).count();
@@ -4932,7 +4948,7 @@ function createContainer(options) {
4932
4948
  }
4933
4949
  //#endregion
4934
4950
  //#region package.json
4935
- var version = "0.2.14-alpha.37";
4951
+ var version = "0.2.14-alpha.38";
4936
4952
  //#endregion
4937
4953
  //#region src/metadata.ts
4938
4954
  const STYLE_SYSTEM_CLI_NAME = "style-system";
@@ -1619,14 +1619,30 @@ const VITE_ERROR_OVERLAY_SELECTOR = "vite-error-overlay";
1619
1619
  const STORY_MOUNT_TIMEOUT_MS = 1e4;
1620
1620
  /**
1621
1621
  * Runs in the page (this package has no DOM types): resolves once web fonts and every image the
1622
- * story rendered have loaded (or failed), then two frames have painted.
1622
+ * story rendered have loaded (or failed), two frames have painted, and the layout stopped moving.
1623
1623
  */
1624
- const FONTS_IMAGES_AND_TWO_FRAMES = `Promise.all([
1624
+ const FONTS_IMAGES_AND_STILL_LAYOUT = `Promise.all([
1625
1625
  document.fonts.ready,
1626
1626
  ...Array.from(document.images, (image) =>
1627
1627
  image.complete ? null : new Promise((resolve) => { image.addEventListener('load', resolve, { once: true }); image.addEventListener('error', resolve, { once: true }); }),
1628
1628
  ),
1629
- ]).then(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve))))`;
1629
+ ]).then(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))).then(() => new Promise((resolve) => {
1630
+ const started = performance.now();
1631
+ let last = '';
1632
+ let still = 0;
1633
+ const frame = () => {
1634
+ let boxes = '';
1635
+ for (const element of document.querySelectorAll('body *')) {
1636
+ const box = element.getBoundingClientRect();
1637
+ if (box.width >= 64 && box.height >= 64) boxes += Math.round(box.x) + ',' + Math.round(box.y) + ',' + Math.round(box.width) + ',' + Math.round(box.height) + ';';
1638
+ }
1639
+ still = boxes === last ? still + 1 : 0;
1640
+ last = boxes;
1641
+ if (still >= 5 || performance.now() - started > 3000) resolve();
1642
+ else requestAnimationFrame(frame);
1643
+ };
1644
+ requestAnimationFrame(frame);
1645
+ }))`;
1630
1646
  /**
1631
1647
  * Attempts to launch a browser, trying multiple configurations in order of preference.
1632
1648
  * @returns Launched browser instance
@@ -1701,7 +1717,7 @@ async function takeScreenshot(options) {
1701
1717
  if (await page.waitForSelector(`${STORY_ROOT_SELECTOR} > *, ${VITE_ERROR_OVERLAY_SELECTOR}`, {
1702
1718
  state: "attached",
1703
1719
  timeout: STORY_MOUNT_TIMEOUT_MS
1704
- }).then(() => true).catch(() => false)) await page.evaluate(FONTS_IMAGES_AND_TWO_FRAMES);
1720
+ }).then(() => true).catch(() => false)) await page.evaluate(FONTS_IMAGES_AND_STILL_LAYOUT);
1705
1721
  if (waitTime > 0) await page.waitForTimeout(waitTime);
1706
1722
  const hasViteErrorOverlay = await page.locator(VITE_ERROR_OVERLAY_SELECTOR).count();
1707
1723
  const renderedChildCount = await page.locator(`${STORY_ROOT_SELECTOR} > *`).count();
@@ -4960,7 +4976,7 @@ function createContainer(options) {
4960
4976
  }
4961
4977
  //#endregion
4962
4978
  //#region package.json
4963
- var version = "0.2.14-alpha.37";
4979
+ var version = "0.2.14-alpha.38";
4964
4980
  //#endregion
4965
4981
  //#region src/metadata.ts
4966
4982
  const STYLE_SYSTEM_CLI_NAME = "style-system";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-style-system-tooling",
3
- "version": "0.2.14-alpha.37",
3
+ "version": "0.2.14-alpha.38",
4
4
  "description": "MCP server for exploring themes, Tailwind CSS classes, and UI components from Storybook with standalone component rendering capabilities",
5
5
  "keywords": [
6
6
  "design-system",