@monimesl/dot-cli 1.0.0-beta.11 → 1.0.0-beta.13

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.js CHANGED
@@ -968,7 +968,7 @@ async function main(argv) {
968
968
  return runBuild(options);
969
969
  }
970
970
  async function serveLanguageServer() {
971
- const { serveStdio } = await import("./server-BhnO9_Zu.js");
971
+ const { serveStdio } = await import("./server-DPBM40xh.js");
972
972
  serveStdio();
973
973
  return new Promise(() => {});
974
974
  }
@@ -10599,10 +10599,14 @@ function valueCompletions(element, attribute, page, scope, components) {
10599
10599
  if (!component) return [];
10600
10600
  if (isEventProp(attribute) && component.events.includes(eventName(attribute))) return handlerCompletions(page);
10601
10601
  const type = component.props[attribute];
10602
- if (type && isWordsOr(type)) return [...type.words.map((value) => ({
10603
- label: value,
10604
- kind: import_main.CompletionItemKind.EnumMember
10605
- })), ...themeCompletions(type, attribute, page)];
10602
+ if (type && isWordsOr(type)) {
10603
+ const words = type.words.map((value) => ({
10604
+ label: value,
10605
+ kind: import_main.CompletionItemKind.EnumMember
10606
+ }));
10607
+ if (type.or === "themeVariant") return [...words, ...variantCompletions(type, element.tag, page)];
10608
+ return [...words, ...themeCompletions(type, attribute, page)];
10609
+ }
10606
10610
  if (Array.isArray(type)) return type.map((value) => ({
10607
10611
  label: value,
10608
10612
  kind: import_main.CompletionItemKind.EnumMember
@@ -10617,6 +10621,13 @@ function valueCompletions(element, attribute, page, scope, components) {
10617
10621
  }));
10618
10622
  return [];
10619
10623
  }
10624
+ function variantCompletions(type, tag, page) {
10625
+ return (page.theme?.variants[tag] ?? []).filter((name) => !type.words.includes(name)).map((name) => ({
10626
+ label: name,
10627
+ kind: import_main.CompletionItemKind.EnumMember,
10628
+ detail: "from the theme in dot.ts"
10629
+ }));
10630
+ }
10620
10631
  function themeCompletions(type, attribute, page) {
10621
10632
  const { theme } = page;
10622
10633
  if (!theme) return [];
@@ -10828,9 +10839,15 @@ function readThemeNames(text, file) {
10828
10839
  return {
10829
10840
  colors: namesIn(memberOf(memberOf(theme, "colors"), "custom")),
10830
10841
  gradients: namesIn(memberOf(theme, "gradients")),
10831
- icons: namesIn(memberOf(theme, "icons"))
10842
+ icons: namesIn(memberOf(theme, "icons")),
10843
+ variants: variantsIn(memberOf(theme, "components"))
10832
10844
  };
10833
10845
  }
10846
+ function variantsIn(components) {
10847
+ const variants = {};
10848
+ for (const component of namesIn(components)) variants[component] = namesIn(memberOf(memberOf(components, component), "variants"));
10849
+ return variants;
10850
+ }
10834
10851
  function dotOptions(source) {
10835
10852
  for (const statement of source.statements) if (ts.isExportAssignment(statement) && ts.isCallExpression(statement.expression)) {
10836
10853
  const [options] = statement.expression.arguments;
@@ -11354,4 +11371,4 @@ function serveStdio() {
11354
11371
  //#endregion
11355
11372
  export { serveStdio };
11356
11373
 
11357
- //# sourceMappingURL=server-BhnO9_Zu.js.map
11374
+ //# sourceMappingURL=server-DPBM40xh.js.map