youiyoux 0.1.6 → 0.1.8

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 (74) hide show
  1. package/dist/chunks/{chunk-RHXBYN4W.js → chunk-3HON5Q5K.js} +20 -15
  2. package/dist/chunks/{chunk-XAO3LS7M.js → chunk-6GITMASZ.js} +1 -1
  3. package/dist/chunks/{chunk-W2KFNGQP.js → chunk-BARSW3JO.js} +947 -228
  4. package/dist/chunks/{chunk-5YVH6NHT.js → chunk-DCBF7QQY.js} +4 -4
  5. package/dist/chunks/{chunk-DP54SKL4.js → chunk-DWYDHVLZ.js} +87 -11
  6. package/dist/chunks/{chunk-5Y2MVIGH.js → chunk-F33PKGES.js} +2 -2
  7. package/dist/chunks/{chunk-VOSWAWKC.js → chunk-FLBRX6Y3.js} +94 -23
  8. package/dist/chunks/{chunk-S57F4CMN.js → chunk-HDJ2TOWZ.js} +1 -1
  9. package/dist/chunks/{chunk-BHJCAZXO.js → chunk-Y4IBE6WS.js} +3 -3
  10. package/dist/chunks/{src-URZDH3QH.js → src-BYNWPNRT.js} +13 -1
  11. package/dist/chunks/{src-7RRKYIAS.js → src-DPFJ4S2N.js} +2 -2
  12. package/dist/chunks/{src-VKQJF7KR.js → src-EUVBYTKY.js} +4 -4
  13. package/dist/chunks/{src-6HTTOVZ5.js → src-M3OJMCUE.js} +5 -3
  14. package/dist/chunks/{src-4VYLEZ3Z.js → src-PURAHRCR.js} +6 -2
  15. package/dist/chunks/{src-DZWWMUDR.js → src-YKPJ3PII.js} +6 -6
  16. package/dist/chunks/{src-YYI52B5R.js → src-ZG7JU6YJ.js} +2 -2
  17. package/dist/hub/assets/{CandidatePanel-CnbK4S0j.js → CandidatePanel-ZzbsyZo3.js} +1 -1
  18. package/dist/hub/assets/{CatalogScreen-B5OVL-AR.js → CatalogScreen-DDYlvOHy.js} +1 -1
  19. package/dist/hub/assets/{ChangesScreen-GwGqJwxN.js → ChangesScreen-C8_EyHgJ.js} +1 -1
  20. package/dist/hub/assets/{CheatSheet-BLSOq-xa.js → CheatSheet-DfcPiXdS.js} +1 -1
  21. package/dist/hub/assets/{CommandPalette-CAWQfdXJ.js → CommandPalette-DfFkDTVg.js} +1 -1
  22. package/dist/hub/assets/DiscoverScreen-D6NTgEgk.js +2 -0
  23. package/dist/hub/assets/{DraftEditor-yIDapXTs.js → DraftEditor-CUNGYbg0.js} +2 -2
  24. package/dist/hub/assets/{GapsScreen-DXZAlm6v.js → GapsScreen-CqedCj4z.js} +1 -1
  25. package/dist/hub/assets/{HomeScreen-CEpiVhOa.js → HomeScreen-CIj1QTkw.js} +1 -1
  26. package/dist/hub/assets/{InventoryScreen-CEG3Pmw_.js → InventoryScreen-CyvFXa2_.js} +1 -1
  27. package/dist/hub/assets/{LibraryScreen-IaVnxrX9.js → LibraryScreen-C4WU0f42.js} +1 -1
  28. package/dist/hub/assets/{Opened-DJyf4Hnj.js → Opened-CeRWkA7c.js} +1 -1
  29. package/dist/hub/assets/{Preview-C069zVMP.js → Preview-CgW-FMB7.js} +1 -1
  30. package/dist/hub/assets/{RuleDetail-B4g2-TRe.js → RuleDetail-BDhZ1gCd.js} +1 -1
  31. package/dist/hub/assets/{RulesScreen-CAaXIWjO.js → RulesScreen-D3rSo_z2.js} +1 -1
  32. package/dist/hub/assets/{ScreenImage-DcI7_G3O.js → ScreenImage-DLeA3nRh.js} +1 -1
  33. package/dist/hub/assets/{ScreensScreen-DwczCjZD.js → ScreensScreen-bGuFIyWj.js} +1 -1
  34. package/dist/hub/assets/{SearchField-DaCpNAj6.js → SearchField-DtEgq9-Q.js} +1 -1
  35. package/dist/hub/assets/{ServiceDown-Bv-BPXro.js → ServiceDown-Bn6AcA3J.js} +1 -1
  36. package/dist/hub/assets/{SpecimenCapture-DlsjshVE.js → SpecimenCapture-p6YErF5y.js} +1 -1
  37. package/dist/hub/assets/{Specimens-C-lHp7sr.js → Specimens-DuaE0WeO.js} +2 -2
  38. package/dist/hub/assets/{StackScreen-DkmELsqR.js → StackScreen-DHDulDng.js} +1 -1
  39. package/dist/hub/assets/{StubScreens-Bt7lWLVK.js → StubScreens-CmhVNX_Z.js} +1 -1
  40. package/dist/hub/assets/StyleScreen-LwTqfGID.js +1 -0
  41. package/dist/hub/assets/{Tabs-1QQDS0I6.js → Tabs-Cbh9BCKW.js} +1 -1
  42. package/dist/hub/assets/{TokenDetail-DvCw6GqC.js → TokenDetail-BICobLK1.js} +1 -1
  43. package/dist/hub/assets/{TokensScreen-DoENV8Xy.js → TokensScreen-CyTHn55q.js} +1 -1
  44. package/dist/hub/assets/WorkspaceScreen-uPWqfklh.js +1 -0
  45. package/dist/hub/assets/{client-D7whEyep.js → client-BXHiuV_w.js} +1 -1
  46. package/dist/hub/assets/color-C6bxX90C.js +1 -0
  47. package/dist/hub/assets/contrast-B-uhyF_b.js +1 -0
  48. package/dist/hub/assets/{discover-XjJEViwk.js → discover-CFhyKler.js} +1 -1
  49. package/dist/hub/assets/{dist-BYQYaPBV.js → dist-C6iTWL0b.js} +1 -1
  50. package/dist/hub/assets/{dist-Bk4srtDn.js → dist-DYNYuTjI.js} +1 -1
  51. package/dist/hub/assets/{dist-D0z7Bvsy.js → dist-VmEpVQjP.js} +1 -1
  52. package/dist/hub/assets/{family-tiles-CyTdy_cP.js → family-tiles-B8_onXUi.js} +1 -1
  53. package/dist/hub/assets/folder-tree-YghfTmlZ.js +1 -0
  54. package/dist/hub/assets/main-CfbpuT4Y.js +2 -0
  55. package/dist/hub/assets/{try-live-zX3CSd3P.js → try-live-CX04d2L2.js} +1 -1
  56. package/dist/hub/assets/values-cLekxBZj.js +1 -0
  57. package/dist/hub/assets/workflow-DbBdiOmA.js +1 -0
  58. package/dist/hub/index.html +2 -1
  59. package/dist/hub-previews.js +5 -5
  60. package/dist/hub-server.js +3 -3
  61. package/dist/hub-snapshot.js +9 -8
  62. package/dist/schema/youi.config.schema.json +4 -0
  63. package/dist/schema/youi.project.schema.json +1 -1
  64. package/dist/schema/youi.status.schema.json +306 -0
  65. package/dist/schema/youi.workspace.schema.json +31 -0
  66. package/dist/youi.js +6 -6
  67. package/dist/youiyoux.js +6 -6
  68. package/package.json +4 -4
  69. package/dist/hub/assets/DiscoverScreen-Tl_Z6mgY.js +0 -2
  70. package/dist/hub/assets/StyleScreen-tq1tbRBo.js +0 -1
  71. package/dist/hub/assets/contrast-BkNHUAPa.js +0 -1
  72. package/dist/hub/assets/main-B9CIkk5m.js +0 -2
  73. package/dist/hub/assets/values-DzxR_TlI.js +0 -1
  74. package/dist/hub/assets/workflow-jpV8wh-U.js +0 -1
@@ -12,12 +12,13 @@ import {
12
12
  import {
13
13
  buildTokens,
14
14
  cssValue,
15
+ cssVariable,
15
16
  parseCssColor,
16
17
  readRules,
17
18
  sameColor,
18
19
  splitTopLevel,
19
20
  tailwindTheme
20
- } from "./chunk-VOSWAWKC.js";
21
+ } from "./chunk-FLBRX6Y3.js";
21
22
  import {
22
23
  AST_GREP_LANGUAGES,
23
24
  BUILT_IN_CHECKS,
@@ -50,7 +51,7 @@ import {
50
51
  toPosix,
51
52
  unifiedDiff,
52
53
  writeFileAtomic
53
- } from "./chunk-DP54SKL4.js";
54
+ } from "./chunk-DWYDHVLZ.js";
54
55
 
55
56
  // ../scanner/src/parse.ts
56
57
  import { Lang, parseAsync } from "@ast-grep/napi";
@@ -764,11 +765,14 @@ async function loadProject(root, options = {}) {
764
765
  ...located.commit ? { designCommit: located.commit } : {}
765
766
  };
766
767
  }
768
+ function withFile(specifier, sourceFile) {
769
+ return specifier.replace("{file}", sourceFile ? posix.basename(sourceFile).replace(/\.[^.]+$/, "") : "<file>");
770
+ }
767
771
  async function isDirectory2(path) {
768
772
  return (await stat2(path).catch(() => null))?.isDirectory() ?? false;
769
773
  }
770
- function importSpecifier(config, fromFile) {
771
- if (config.importFrom) return config.importFrom;
774
+ function importSpecifier(config, fromFile, sourceFile) {
775
+ if (config.importFrom) return withFile(config.importFrom, sourceFile);
772
776
  if (!fromFile) return config.componentsDir;
773
777
  const path = posix.relative(posix.dirname(fromFile), config.componentsDir) || ".";
774
778
  return path.startsWith(".") ? path : `./${path}`;
@@ -785,7 +789,7 @@ function buildTokenIndex(tokens, output) {
785
789
  const mapped = new Set(Object.keys(output.tailwind.map));
786
790
  const entries = [...tailwindTheme(tokens, output)].sort(([a], [b]) => Number(!mapped.has(a)) - Number(!mapped.has(b)));
787
791
  for (const [key, entry] of entries) if (entry.token) themeKeys.set(entry.token, [...themeKeys.get(entry.token) ?? [], key]);
788
- return { prefix: output.cssVarPrefix, tokens, byVar: new Map(tokens.map((t) => [`--${output.cssVarPrefix}-${t.cssName}`, t])), themeKeys };
792
+ return { prefix: output.cssVarPrefix, tokens, byVar: new Map(tokens.map((t) => [cssVariable(output.cssVarPrefix, t.cssName), t])), themeKeys };
789
793
  }
790
794
  function isColor(value) {
791
795
  return typeof value === "object" && value !== null && "components" in value;
@@ -799,7 +803,7 @@ function colorSuggestion(literal3, index) {
799
803
  const matches = colorTokens(literal3, index);
800
804
  if (!matches) return void 0;
801
805
  if (matches.length === 0) return "no token has this value: pick the role it plays (system_get_tokens) or propose a token";
802
- const listed = matches.slice(0, 3).map((t) => `var(--${index.prefix}-${t.cssName}) (${t.id})`).join(" or ");
806
+ const listed = matches.slice(0, 3).map((t) => `var(${cssVariable(index.prefix, t.cssName)}) (${t.id})`).join(" or ");
803
807
  return `${listed}: same value, check it is the right role`;
804
808
  }
805
809
  function offsetToPosition(text, offset, start) {
@@ -811,7 +815,7 @@ function stringNodes(module) {
811
815
  return module.root.root().findAll({ rule: { any: [{ kind: "string" }, { kind: "template_string" }] } });
812
816
  }
813
817
  var HEX = /#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![0-9a-zA-Z_-])/g;
814
- var COLOR_FN = /\b(?:rgba?|hsla?)\(\s*-?[\d.]+[^)]*\)/g;
818
+ var COLOR_FN = /\b(?:rgba?|hsla?|oklch)\(\s*-?[\d.]+[^)]*\)/g;
815
819
  var NON_COLOR_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "to", "id", "htmlFor", "key", "name", "src", "action", "formAction", "aria-controls", "aria-describedby", "aria-labelledby"]);
816
820
  var CSS_VALUE_BEFORE = /(?:\d(?:px|rem|em|%)?|\b(?:solid|dashed|dotted|double|inset|transparent|currentColor))\s+$/;
817
821
  function hexInContext(text, index, match) {
@@ -856,7 +860,7 @@ function rawColorsInCss(module, index, isTokenSource) {
856
860
  const lineText = lines[declaration.line - 1] ?? "";
857
861
  const column = Math.max(1, lineText.indexOf(match[0]) + 1);
858
862
  const suggestion = colorSuggestion(match[0], index);
859
- findings.push({ file: module.file, line: declaration.line, column, text: `${declaration.property}: ${match[0]}`, message: `Raw colour ${match[0]} in ${declaration.property}; use var(--${index.prefix}-\u2026).`, ...suggestion ? { suggestion } : {} });
863
+ findings.push({ file: module.file, line: declaration.line, column, text: `${declaration.property}: ${match[0]}`, message: `Raw colour ${match[0]} in ${declaration.property}; use var(${cssVariable(index.prefix, "\u2026")}).`, ...suggestion ? { suggestion } : {} });
860
864
  }
861
865
  }
862
866
  }
@@ -952,7 +956,7 @@ function lookalikes(analysis, elements, config) {
952
956
  column: site.column,
953
957
  text: `<${site.local}>`,
954
958
  message: `${site.local} here is ${site.resolved}, not the design-system ${contract?.name ?? site.resembles}.`,
955
- suggestion: `import { ${contract?.name ?? site.local} } from "${importSpecifier(config, site.file)}"`
959
+ suggestion: `import { ${contract?.name ?? site.local} } from "${importSpecifier(config, site.file, contract?.source.file)}"`
956
960
  };
957
961
  });
958
962
  }
@@ -1701,7 +1705,7 @@ function resolveClasses(classes, tag, theme, rules) {
1701
1705
  }
1702
1706
 
1703
1707
  // ../scanner/src/drift.ts
1704
- var cssVar = (token, index) => `var(${[...index.byVar].find(([, t]) => t === token)?.[0] ?? `--${index.prefix}-${token.cssName}`})`;
1708
+ var cssVar = (token, index) => `var(${[...index.byVar].find(([, t]) => t === token)?.[0] ?? cssVariable(index.prefix, token.cssName)})`;
1705
1709
  var tokenList = (tokens) => tokens.slice(0, 3).map((t) => t.id).join(" or ");
1706
1710
  function utilityBefore(lineText, column) {
1707
1711
  return /(?:^|[\s"'`:])!?(-?[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)*)-\[$/.exec(lineText.slice(0, column - 1))?.[1] ?? null;
@@ -1729,7 +1733,7 @@ function arbitraryFindings(module, index, added) {
1729
1733
  const start = node2.range().start;
1730
1734
  for (const match of text.matchAll(ARBITRARY)) {
1731
1735
  const [whole, utility, value] = match;
1732
- if (value.startsWith("#") || /^(rgb|hsl)a?\(/.test(value)) continue;
1736
+ if (value.startsWith("#") || /^(?:(?:rgb|hsl)a?|oklch)\(/.test(value)) continue;
1733
1737
  const offset = match.index + whole.indexOf(`${utility}-[`);
1734
1738
  const at = offsetToPosition(text, offset, start);
1735
1739
  if (!added(module.file, at.line)) continue;
@@ -3354,7 +3358,7 @@ function tokenClosure(tokens, tokenId) {
3354
3358
  return reached;
3355
3359
  }
3356
3360
  function useNames(token, prefix, themeKeys) {
3357
- const variables = [`--${prefix}-${token.cssName}`, ...themeKeys.map((key) => `--${key}`)];
3361
+ const variables = [cssVariable(prefix, token.cssName), ...themeKeys.map((key) => `--${key}`)];
3358
3362
  const utilities = themeKeys.filter((key) => !key.includes("--")).flatMap((key) => {
3359
3363
  const [namespace, users] = UTILITIES.find(([ns]) => key.startsWith(`${ns}-`)) ?? [key.split("-")[0], [key.split("-")[0]]];
3360
3364
  const name = key.slice(namespace.length + 1);
@@ -3747,7 +3751,7 @@ function findContract2(project, query) {
3747
3751
  }
3748
3752
  function importLine(project, contract) {
3749
3753
  const names = [contract.source.export, ...contract.source.also].join(", ");
3750
- return `import { ${names} } from "${project.config.importFrom ?? `<relative path to ${project.config.componentsDir}>`}";`;
3754
+ return `import { ${names} } from "${project.config.importFrom ? withFile(project.config.importFrom, contract.source.file) : `<relative path to ${project.config.componentsDir}>`}";`;
3751
3755
  }
3752
3756
  var MAX_PROP_TEXT = 40;
3753
3757
  function formatProps(props, spread = false, keep) {
@@ -3887,7 +3891,7 @@ function tokenRows(tokens, group, limit = 60) {
3887
3891
  const dark = cssValue(t.type, t.dark);
3888
3892
  const key = tokens.themeKeys.get(t.id)?.[0];
3889
3893
  const utility = key ? utilityExample(key) : "";
3890
- return [t.id, `--${tokens.prefix}-${t.cssName}`, t.aliasOf ? `{${t.aliasOf}}` : light, dark === light || t.aliasOf ? "" : dark, utility];
3894
+ return [t.id, cssVariable(tokens.prefix, t.cssName), t.aliasOf ? `{${t.aliasOf}}` : light, dark === light || t.aliasOf ? "" : dark, utility];
3891
3895
  });
3892
3896
  return { columns: ["id", "cssVar", "light", "dark", "utility"], rows: rows.slice(0, limit), total: rows.length, truncated: rows.length > limit };
3893
3897
  }
@@ -7918,7 +7922,7 @@ var Eyes = class {
7918
7922
  }
7919
7923
  async open() {
7920
7924
  if (this.browser) return this.browser;
7921
- const { launchBrowser } = await import("./src-YYI52B5R.js");
7925
+ const { launchBrowser } = await import("./src-ZG7JU6YJ.js");
7922
7926
  try {
7923
7927
  this.browser = await launchBrowser(this.options.executablePath, { purpose: { what: "youiyoux render", command: "youiyoux render" }, ...this.options.download === false ? { download: false } : {}, ...this.options.log ? { log: this.options.log } : {} });
7924
7928
  } catch (error) {
@@ -8729,6 +8733,7 @@ export {
8729
8733
  ProjectRootError,
8730
8734
  ROOT_HINT,
8731
8735
  loadProject,
8736
+ withFile,
8732
8737
  importSpecifier,
8733
8738
  emptyRootProblem,
8734
8739
  buildTokenIndex,
@@ -8,7 +8,7 @@ import {
8
8
  sha256,
9
9
  shortHash,
10
10
  writeFileAtomic
11
- } from "./chunk-DP54SKL4.js";
11
+ } from "./chunk-DWYDHVLZ.js";
12
12
 
13
13
  // ../discover/src/aliases.ts
14
14
  var CONCEPTS = [