@skaldapp/monaco-sfc 1.1.57 → 1.1.58

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 (2) hide show
  1. package/dist/vue.worker.js +48 -27
  2. package/package.json +5 -5
@@ -22072,6 +22072,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
22072
22072
  function* generateGeneric(options, ctx, scriptSetup, scriptSetupRanges, generic, body) {
22073
22073
  yield `(`;
22074
22074
  if (typeof generic === "object") {
22075
+ const boundary = yield* boundary_1.Boundary.start("main", generic.offset, generic.offset + generic.text.length, codeFeatures_1.codeFeatures.verification);
22075
22076
  yield `<`;
22076
22077
  yield [
22077
22078
  generic.text,
@@ -22081,6 +22082,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
22081
22082
  ];
22082
22083
  if (!generic.text.endsWith(`,`)) yield `,`;
22083
22084
  yield `>`;
22085
+ yield boundary.end();
22084
22086
  }
22085
22087
  yield `(${utils_1.newLine} ${names_1.names.props}: NonNullable<Awaited<typeof ${names_1.names.setup}>>['props'],${utils_1.newLine} ${names_1.names.ctx}?: ${ctx.localTypes.PrettifyLocal}<Pick<NonNullable<Awaited<typeof ${names_1.names.setup}>>, 'attrs' | 'emit' | 'slots'>>,${utils_1.newLine} ${names_1.names.exposed}?: NonNullable<Awaited<typeof ${names_1.names.setup}>>['expose'],${utils_1.newLine} ${names_1.names.setup} = (async () => {${utils_1.newLine}`;
22086
22088
  yield* body;
@@ -86565,9 +86567,12 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
86565
86567
  const decoded = context.decodeEmbeddedDocumentUri(uri);
86566
86568
  if (!decoded) return;
86567
86569
  const sourceScript = context.language.scripts.get(decoded[0]);
86570
+ if (!sourceScript?.generated) return;
86571
+ const code = sourceScript.generated.embeddedCodes.get(decoded[1]);
86572
+ if (!code) return;
86568
86573
  return {
86569
86574
  script: sourceScript,
86570
- code: sourceScript.generated.embeddedCodes.get(decoded[1]),
86575
+ code,
86571
86576
  root: sourceScript.generated.root
86572
86577
  };
86573
86578
  }
@@ -114540,7 +114545,7 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
114540
114545
  const componentSet = new Set(components);
114541
114546
  if (!htmlCompletion) return;
114542
114547
  if (!hint) htmlCompletion.isIncomplete = true;
114543
- if (htmlCompletion.items[0]?.kind === 12) addDirectiveModifiers(htmlCompletion, htmlCompletion.items[0], document);
114548
+ if (htmlCompletion.items[0]?.kind === 12) addDirectiveModifiers(htmlCompletion, htmlCompletion.items[0], document, position);
114544
114549
  await resolveAutoImportPlaceholder(htmlCompletion, info);
114545
114550
  resolveComponentItemKinds(htmlCompletion);
114546
114551
  return htmlCompletion;
@@ -114922,33 +114927,41 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
114922
114927
  }
114923
114928
  return customData;
114924
114929
  }
114925
- function addDirectiveModifiers(list, item, document) {
114930
+ function addDirectiveModifiers(list, item, document, position) {
114926
114931
  const replacement = getReplacement(item, document);
114927
- if (!replacement?.text.includes(".")) return;
114928
- const [text, ...modifiers] = replacement.text.split(".");
114929
- const isVOn = text.startsWith(DIRECTIVE_V_ON) || text.startsWith(V_ON_SHORTHAND) && text.length > 1;
114930
- const isVBind = text.startsWith(DIRECTIVE_V_BIND) || text.startsWith(V_BIND_SHORTHAND) && text.length > 1;
114931
- const isVModel = text.startsWith(DIRECTIVE_V_MODEL) || text === "v-model";
114932
- const currentModifiers = isVOn ? vOnModifiers : isVBind ? vBindModifiers : isVModel ? vModelModifiers : void 0;
114933
- if (!currentModifiers) return;
114934
- for (const modifier in currentModifiers) {
114935
- if (modifiers.includes(modifier)) continue;
114936
- const description = currentModifiers[modifier];
114937
- const insertText = text + modifiers.slice(0, -1).map((m) => "." + m).join("") + "." + modifier;
114938
- const newItem = {
114939
- label: modifier,
114940
- filterText: insertText,
114941
- documentation: {
114942
- kind: "markdown",
114943
- value: description
114944
- },
114945
- textEdit: {
114946
- range: replacement.textEdit.range,
114947
- newText: insertText
114948
- },
114949
- kind: 20
114932
+ if (!replacement?.text) return;
114933
+ const replacementStart = document.offsetAt(replacement.textEdit.range.start);
114934
+ const start = replacement.text.lastIndexOf(".", document.offsetAt(position) - replacementStart - 1) + 1;
114935
+ if (start === 0) return;
114936
+ const [text, ...existingModifiers] = replacement.text.split(".");
114937
+ let matchedModifiers;
114938
+ if (text.startsWith(DIRECTIVE_V_ON) || text.startsWith(V_ON_SHORTHAND) && text.length > 1) matchedModifiers = vOnModifiers;
114939
+ else if (text.startsWith(DIRECTIVE_V_BIND) || text.startsWith(V_BIND_SHORTHAND) && text.length > 1) matchedModifiers = vBindModifiers;
114940
+ else if (text.startsWith(DIRECTIVE_V_MODEL) || text === "v-model") matchedModifiers = vModelModifiers;
114941
+ if (matchedModifiers) {
114942
+ const nextModifierStart = replacement.text.indexOf(".", start);
114943
+ const end = nextModifierStart !== -1 ? nextModifierStart : replacement.text.length;
114944
+ const range = {
114945
+ start: document.positionAt(replacementStart + start),
114946
+ end: document.positionAt(replacementStart + end)
114950
114947
  };
114951
- list.items.push(newItem);
114948
+ const currentModifier = replacement.text.slice(start, end);
114949
+ for (const modifier in matchedModifiers) {
114950
+ if (existingModifiers.includes(modifier) && modifier !== currentModifier) continue;
114951
+ list.items.push({
114952
+ label: modifier,
114953
+ filterText: modifier,
114954
+ documentation: {
114955
+ kind: "markdown",
114956
+ value: matchedModifiers[modifier]
114957
+ },
114958
+ textEdit: {
114959
+ range,
114960
+ newText: modifier
114961
+ },
114962
+ kind: 20
114963
+ });
114964
+ }
114952
114965
  }
114953
114966
  }
114954
114967
  }
@@ -115977,6 +115990,14 @@ var require_schemaResolvers = /* @__PURE__ */ __commonJSMin(((exports) => {
115977
115990
  }
115978
115991
  };
115979
115992
  } else if (subtype.getCallSignatures().length === 1) return resolveCallbackSchema(subtype.getCallSignatures()[0]);
115993
+ else if (subtype.flags & ts.TypeFlags.EnumLiteral && subtype.isLiteral()) {
115994
+ const { value } = subtype;
115995
+ if (typeof value === "string" || typeof value === "number") return {
115996
+ kind: "literal",
115997
+ type,
115998
+ value: JSON.stringify(value)
115999
+ };
116000
+ }
115980
116001
  return type;
115981
116002
  }
115982
116003
  function getFullyQualifiedName(type) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package",
3
3
  "name": "@skaldapp/monaco-sfc",
4
- "version": "1.1.57",
4
+ "version": "1.1.58",
5
5
  "description": "A Monaco Editor language server for Vue Single File Components (SFC) providing syntax highlighting, IntelliSense, error detection, and more",
6
6
  "keywords": [
7
7
  "vue",
@@ -54,9 +54,9 @@
54
54
  "@remote-dom/polyfill": "^1.5.1",
55
55
  "@volar/jsdelivr": "^2.4.28",
56
56
  "@volar/monaco": "^2.4.28",
57
- "@vue/language-core": "^3.3.8",
58
- "@vue/language-service": "^3.3.8",
59
- "@vue/typescript-plugin": "^3.3.8",
57
+ "@vue/language-core": "^3.3.9",
58
+ "@vue/language-service": "^3.3.9",
59
+ "@vue/typescript-plugin": "^3.3.9",
60
60
  "monaco-editor": "0.52.2",
61
61
  "typescript": "^6.0.3",
62
62
  "volar-service-typescript": "^0.0.71",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@rollup/plugin-commonjs": "^29.0.3",
68
- "@skaldapp/configs": "^1.4.11",
68
+ "@skaldapp/configs": "^1.4.12",
69
69
  "@types/markdown-it": "^14.1.2",
70
70
  "@types/node": "^26.1.2",
71
71
  "eslint": "^10.8.0",