@skaldapp/monaco-sfc 1.1.52 → 1.1.53

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 +125 -65
  2. package/package.json +8 -8
@@ -18062,8 +18062,11 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports) => {
18062
18062
  const scope = ctx.scope();
18063
18063
  scope.declare("$event");
18064
18064
  yield* ctx.generateConditionGuards();
18065
- if (isSingleExpression(options.typescript, ast)) yield `return `;
18066
- yield* interpolation;
18065
+ if (isSingleExpression(options.typescript, ast)) {
18066
+ yield `return (`;
18067
+ yield* interpolation;
18068
+ yield `)`;
18069
+ } else yield* interpolation;
18067
18070
  yield utils_2.endOfLine;
18068
18071
  yield* scope.end();
18069
18072
  yield `}`;
@@ -18521,9 +18524,53 @@ var require_escaped = /* @__PURE__ */ __commonJSMin(((exports) => {
18521
18524
  //#endregion
18522
18525
  //#region node_modules/@vue/language-core/lib/codegen/template/styleScopedClasses.js
18523
18526
  var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
18527
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
18528
+ if (k2 === void 0) k2 = k;
18529
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18530
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
18531
+ enumerable: true,
18532
+ get: function() {
18533
+ return m[k];
18534
+ }
18535
+ };
18536
+ Object.defineProperty(o, k2, desc);
18537
+ }) : (function(o, m, k, k2) {
18538
+ if (k2 === void 0) k2 = k;
18539
+ o[k2] = m[k];
18540
+ }));
18541
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
18542
+ Object.defineProperty(o, "default", {
18543
+ enumerable: true,
18544
+ value: v
18545
+ });
18546
+ }) : function(o, v) {
18547
+ o["default"] = v;
18548
+ });
18549
+ var __importStar = exports && exports.__importStar || (function() {
18550
+ var ownKeys = function(o) {
18551
+ ownKeys = Object.getOwnPropertyNames || function(o) {
18552
+ var ar = [];
18553
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
18554
+ return ar;
18555
+ };
18556
+ return ownKeys(o);
18557
+ };
18558
+ return function(mod) {
18559
+ if (mod && mod.__esModule) return mod;
18560
+ var result = {};
18561
+ if (mod != null) {
18562
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
18563
+ }
18564
+ __setModuleDefault(result, mod);
18565
+ return result;
18566
+ };
18567
+ })();
18524
18568
  Object.defineProperty(exports, "__esModule", { value: true });
18525
18569
  exports.references = void 0;
18570
+ exports.generateStyleScopedClassReferences = generateStyleScopedClassReferences;
18526
18571
  exports.generateStyleScopedClassReference = generateStyleScopedClassReference;
18572
+ var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
18573
+ var shared_1 = require_shared$1();
18527
18574
  var codeFeatures_1 = require_codeFeatures();
18528
18575
  var names_1 = require_names();
18529
18576
  var utils_1 = require_utils$5();
@@ -18531,6 +18578,57 @@ var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
18531
18578
  var escaped_1 = require_escaped();
18532
18579
  var classNameEscapeRE = /([\\'])/;
18533
18580
  exports.references = /* @__PURE__ */ new WeakMap();
18581
+ function* generateStyleScopedClassReferences({ template, typescript: ts }, node) {
18582
+ for (const prop of node.props) if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE && prop.name === "class" && prop.value) {
18583
+ const [text, start] = (0, shared_1.normalizeAttributeValue)(prop.value);
18584
+ for (const [className, offset] of forEachClassName(text)) yield* generateStyleScopedClassReference(template, className, start + offset);
18585
+ } else if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.content === "class") {
18586
+ const content = "(" + prop.exp.content + ")";
18587
+ const startOffset = prop.exp.loc.start.offset - 1;
18588
+ const ast = (0, utils_1.getTypeScriptAST)(ts, template, content);
18589
+ const literals = [];
18590
+ for (const node of (0, utils_1.forEachNode)(ts, ast)) {
18591
+ if (!ts.isExpressionStatement(node) || !ts.isParenthesizedExpression(node.expression)) continue;
18592
+ const { expression } = node.expression;
18593
+ if (ts.isStringLiteralLike(expression)) literals.push(expression);
18594
+ else if (ts.isArrayLiteralExpression(expression)) yield* walkArrayLiteral(expression);
18595
+ else if (ts.isObjectLiteralExpression(expression)) yield* walkObjectLiteral(expression);
18596
+ }
18597
+ for (const literal of literals) {
18598
+ const start = literal.end - literal.text.length - 1 + startOffset;
18599
+ for (const [className, offset] of forEachClassName(literal.text)) yield* generateStyleScopedClassReference(template, className, start + offset);
18600
+ }
18601
+ function* walkArrayLiteral(node) {
18602
+ const { elements } = node;
18603
+ for (const element of elements) if (ts.isStringLiteralLike(element)) literals.push(element);
18604
+ else if (ts.isObjectLiteralExpression(element)) yield* walkObjectLiteral(element);
18605
+ }
18606
+ function* walkObjectLiteral(node) {
18607
+ const { properties } = node;
18608
+ for (const property of properties) if (ts.isPropertyAssignment(property)) {
18609
+ const { name } = property;
18610
+ if (ts.isIdentifier(name)) {
18611
+ const text = (0, shared_1.getNodeText)(ts, name, ast);
18612
+ yield* generateStyleScopedClassReference(template, text, name.end - text.length + startOffset);
18613
+ } else if (ts.isStringLiteral(name)) literals.push(name);
18614
+ else if (ts.isComputedPropertyName(name)) {
18615
+ const { expression } = name;
18616
+ if (ts.isStringLiteralLike(expression)) literals.push(expression);
18617
+ }
18618
+ } else if (ts.isShorthandPropertyAssignment(property)) {
18619
+ const text = (0, shared_1.getNodeText)(ts, property.name, ast);
18620
+ yield* generateStyleScopedClassReference(template, text, property.name.end - text.length + startOffset);
18621
+ }
18622
+ }
18623
+ }
18624
+ }
18625
+ function* forEachClassName(content) {
18626
+ let offset = 0;
18627
+ for (const className of content.split(" ")) {
18628
+ yield [className, offset];
18629
+ offset += className.length + 1;
18630
+ }
18631
+ }
18534
18632
  function* generateStyleScopedClassReference(block, className, offset, fullStart = offset) {
18535
18633
  if (!className) {
18536
18634
  yield `/** @type {${names_1.names.StyleScopedClasses}['`;
@@ -18908,7 +19006,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
18908
19006
  yield `var ${restsVar} = ${names_1.names.omit}(${getPropsVar()}, {\n${propsStr}})${utils_1.endOfLine}`;
18909
19007
  ctx.inheritedAttrVars.add(restsVar);
18910
19008
  } else ctx.inheritedAttrVars.add(getPropsVar());
18911
- yield* generateStyleScopedClassReferences(options, node);
19009
+ yield* (0, styleScopedClasses_1.generateStyleScopedClassReferences)(options, node);
18912
19010
  const slotDir = node.props.find(CompilerDOM.isVSlot);
18913
19011
  if (slotDir || node.children.length) yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir, getCtxVar());
18914
19012
  if (isCtxVarUsed) yield `var ${ctxVar}!: ${names_1.names.ExtractComponentContext}<typeof ${componentVar}, typeof ${vnodeVar}>${utils_1.endOfLine}`;
@@ -18942,7 +19040,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
18942
19040
  }
18943
19041
  if (ctx.singleRootNodes.has(node)) ctx.singleRootElTypes.add(`${names_1.names.Elements}['${node.tag}']`);
18944
19042
  if (hasVBindAttrs(options, ctx, node)) ctx.inheritedAttrVars.add(`${names_1.names.intrinsics}.${node.tag}`);
18945
- yield* generateStyleScopedClassReferences(options, node);
19043
+ yield* (0, styleScopedClasses_1.generateStyleScopedClassReferences)(options, node);
18946
19044
  for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child);
18947
19045
  }
18948
19046
  function* generateFragment(options, ctx, node) {
@@ -18958,57 +19056,6 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
18958
19056
  }
18959
19057
  for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child);
18960
19058
  }
18961
- function* generateStyleScopedClassReferences({ template, typescript: ts }, node) {
18962
- for (const prop of node.props) if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE && prop.name === "class" && prop.value) {
18963
- const [text, start] = (0, shared_2.normalizeAttributeValue)(prop.value);
18964
- for (const [className, offset] of forEachClassName(text)) yield* (0, styleScopedClasses_1.generateStyleScopedClassReference)(template, className, start + offset);
18965
- } else if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.content === "class") {
18966
- const content = "(" + prop.exp.content + ")";
18967
- const startOffset = prop.exp.loc.start.offset - 1;
18968
- const ast = (0, utils_1.getTypeScriptAST)(ts, template, content);
18969
- const literals = [];
18970
- for (const node of (0, utils_1.forEachNode)(ts, ast)) {
18971
- if (!ts.isExpressionStatement(node) || !ts.isParenthesizedExpression(node.expression)) continue;
18972
- const { expression } = node.expression;
18973
- if (ts.isStringLiteralLike(expression)) literals.push(expression);
18974
- else if (ts.isArrayLiteralExpression(expression)) yield* walkArrayLiteral(expression);
18975
- else if (ts.isObjectLiteralExpression(expression)) yield* walkObjectLiteral(expression);
18976
- }
18977
- for (const literal of literals) {
18978
- const start = literal.end - literal.text.length - 1 + startOffset;
18979
- for (const [className, offset] of forEachClassName(literal.text)) yield* (0, styleScopedClasses_1.generateStyleScopedClassReference)(template, className, start + offset);
18980
- }
18981
- function* walkArrayLiteral(node) {
18982
- const { elements } = node;
18983
- for (const element of elements) if (ts.isStringLiteralLike(element)) literals.push(element);
18984
- else if (ts.isObjectLiteralExpression(element)) yield* walkObjectLiteral(element);
18985
- }
18986
- function* walkObjectLiteral(node) {
18987
- const { properties } = node;
18988
- for (const property of properties) if (ts.isPropertyAssignment(property)) {
18989
- const { name } = property;
18990
- if (ts.isIdentifier(name)) {
18991
- const text = (0, shared_2.getNodeText)(ts, name, ast);
18992
- yield* (0, styleScopedClasses_1.generateStyleScopedClassReference)(template, text, name.end - text.length + startOffset);
18993
- } else if (ts.isStringLiteral(name)) literals.push(name);
18994
- else if (ts.isComputedPropertyName(name)) {
18995
- const { expression } = name;
18996
- if (ts.isStringLiteralLike(expression)) literals.push(expression);
18997
- }
18998
- } else if (ts.isShorthandPropertyAssignment(property)) {
18999
- const text = (0, shared_2.getNodeText)(ts, property.name, ast);
19000
- yield* (0, styleScopedClasses_1.generateStyleScopedClassReference)(template, text, property.name.end - text.length + startOffset);
19001
- }
19002
- }
19003
- }
19004
- }
19005
- function* forEachClassName(content) {
19006
- let offset = 0;
19007
- for (const className of content.split(" ")) {
19008
- yield [className, offset];
19009
- offset += className.length + 1;
19010
- }
19011
- }
19012
19059
  function* generateFailedExpressions(options, ctx, failedPropExps) {
19013
19060
  for (const { node, prefix, suffix } of failedPropExps) {
19014
19061
  yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, codeFeatures_1.codeFeatures.all, node.loc.source, node.loc.start.offset, prefix, suffix);
@@ -22606,7 +22653,7 @@ var require_modules = /* @__PURE__ */ __commonJSMin(((exports) => {
22606
22653
  var names_1 = require_names();
22607
22654
  var utils_1 = require_utils$5();
22608
22655
  var common_1 = require_common$2();
22609
- function* generateStyleModules({ styles, vueCompilerOptions }, ctx) {
22656
+ function* generateStyleModules({ vueCompilerOptions, styles }, ctx) {
22610
22657
  const styleModules = styles.filter((style) => style.module);
22611
22658
  if (!styleModules.length) return;
22612
22659
  ctx.generatedTypes.add(names_1.names.StyleModules);
@@ -22641,23 +22688,24 @@ var require_scopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
22641
22688
  var styleScopedClasses_1 = require_styleScopedClasses();
22642
22689
  var utils_1 = require_utils$5();
22643
22690
  var common_1 = require_common$2();
22644
- function* generateStyleScopedClasses({ vueCompilerOptions, styles }) {
22691
+ function* generateStyleScopedClasses({ vueCompilerOptions, styles }, ctx) {
22645
22692
  const { resolveStyleClassNames, resolveStyleImports } = vueCompilerOptions;
22646
22693
  if (!resolveStyleClassNames) return;
22647
22694
  const scopedStyles = styles.filter((style) => resolveStyleClassNames === true || style.scoped);
22648
22695
  if (!scopedStyles.length) return;
22696
+ ctx.generatedTypes.add(names_1.names.StyleScopedClasses);
22649
22697
  const visited = /* @__PURE__ */ new Set();
22650
- const deferredGenerations = [];
22698
+ const deferredGenerates = [];
22651
22699
  yield `type ${names_1.names.StyleScopedClasses} = {}`;
22652
22700
  for (const style of scopedStyles) {
22653
22701
  if (resolveStyleImports) yield* (0, common_1.generateStyleImports)(style);
22654
22702
  for (const className of style.classNames) if (!visited.has(className.text)) {
22655
22703
  visited.add(className.text);
22656
22704
  yield* (0, common_1.generateClassProperty)(style.name, className.text, className.offset, "boolean");
22657
- } else deferredGenerations.push((0, styleScopedClasses_1.generateStyleScopedClassReference)(style, className.text.slice(1), className.offset + 1));
22705
+ } else deferredGenerates.push((0, styleScopedClasses_1.generateStyleScopedClassReference)(style, className.text.slice(1), className.offset + 1));
22658
22706
  }
22659
22707
  yield utils_1.endOfLine;
22660
- for (const generate of deferredGenerations) yield* generate;
22708
+ for (const generate of deferredGenerates) yield* generate;
22661
22709
  }
22662
22710
  }));
22663
22711
  //#endregion
@@ -22687,7 +22735,7 @@ var require_style = /* @__PURE__ */ __commonJSMin(((exports) => {
22687
22735
  function* generateWorker(options, ctx) {
22688
22736
  const scope = ctx.scope();
22689
22737
  scope.declare(...options.setupConsts);
22690
- yield* (0, scopedClasses_1.generateStyleScopedClasses)(options);
22738
+ yield* (0, scopedClasses_1.generateStyleScopedClasses)(options, ctx);
22691
22739
  yield* (0, modules_1.generateStyleModules)(options, ctx);
22692
22740
  yield* generateCssVars(options, ctx);
22693
22741
  yield* scope.end();
@@ -36213,7 +36261,9 @@ var init_cssNodes = __esmMin((() => {
36213
36261
  return NodeType.RatioValue;
36214
36262
  }
36215
36263
  };
36216
- _dot = ".".charCodeAt(0), _0$1 = "0".charCodeAt(0), _9$1 = "9".charCodeAt(0);
36264
+ _dot = ".".charCodeAt(0);
36265
+ _0$1 = "0".charCodeAt(0);
36266
+ _9$1 = "9".charCodeAt(0);
36217
36267
  NumericValue = class extends Node$1 {
36218
36268
  constructor(offset, length) {
36219
36269
  super(offset, length);
@@ -115408,7 +115458,8 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
115408
115458
  const globalKinds = /* @__PURE__ */ new Set([
115409
115459
  "var",
115410
115460
  "function",
115411
- "module"
115461
+ "module",
115462
+ "const"
115412
115463
  ]);
115413
115464
  const globalsOrKeywords = ts.Completions.SortText.GlobalsOrKeywords;
115414
115465
  const sortTexts = /* @__PURE__ */ new Set([
@@ -271922,7 +271973,9 @@ var import_directiveComment = require_directiveComment();
271922
271973
  var import_semantic = require_semantic();
271923
271974
  var import_api = require_api();
271924
271975
  init_esm();
271925
- var ctime = Date.now(), global$1 = "skaldapp", globalDeclarations = `declare global {
271976
+ var ctime = Date.now();
271977
+ var global$1 = "skaldapp";
271978
+ var globalDeclarations = `declare global {
271926
271979
  interface Window {
271927
271980
  __vue_app__: import("vue").App;
271928
271981
  }
@@ -271935,7 +271988,14 @@ declare module 'vue' {
271935
271988
  $id: string;
271936
271989
  }
271937
271990
  }
271938
- export {};`, mtime = ctime, npmFileSystem = (0, import_jsdelivr.createNpmFileSystem)(), semanticPlugin = (0, import_semantic.create)(import_typescript.default), size = globalDeclarations.length, type = 1, vueCompilerOptions = (0, import_language_core.getDefaultCompilerOptions)(), workspaceFolders = [URI$2.file("/")];
271991
+ export {};`;
271992
+ var mtime = ctime;
271993
+ var npmFileSystem = (0, import_jsdelivr.createNpmFileSystem)();
271994
+ var semanticPlugin = (0, import_semantic.create)(import_typescript.default);
271995
+ var size = globalDeclarations.length;
271996
+ var type = 1;
271997
+ var vueCompilerOptions = (0, import_language_core.getDefaultCompilerOptions)();
271998
+ var workspaceFolders = [URI$2.file("/")];
271939
271999
  var asFileName = ({ path }) => path, asUri = (fileName) => URI$2.file(fileName), create = (context) => {
271940
272000
  const pluginInstance = semanticPlugin.create(context), languageService = pluginInstance.provide["typescript/languageService"](), proxy = (0, import_common.postprocessLanguageService)(import_typescript.default, context.language, languageService, vueCompilerOptions, asUri), getCodeFixesAtPosition = proxy.getCodeFixesAtPosition.bind(proxy), getCompletionEntryDetails = proxy.getCompletionEntryDetails.bind(proxy), getCompletionsAtPosition = proxy.getCompletionsAtPosition.bind(proxy), getDefinitionAndBoundSpan = proxy.getDefinitionAndBoundSpan.bind(proxy), getQuickInfoAtPosition = proxy.getQuickInfoAtPosition.bind(proxy);
271941
272001
  pluginInstance.provide["typescript/languageService"] = () => ({
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.52",
4
+ "version": "1.1.53",
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.6",
58
- "@vue/language-service": "^3.3.6",
59
- "@vue/typescript-plugin": "^3.3.6",
57
+ "@vue/language-core": "^3.3.7",
58
+ "@vue/language-service": "^3.3.7",
59
+ "@vue/typescript-plugin": "^3.3.7",
60
60
  "monaco-editor": "0.52.2",
61
61
  "typescript": "^6.0.3",
62
62
  "volar-service-typescript": "^0.0.71",
@@ -65,12 +65,12 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@rollup/plugin-commonjs": "^29.0.3",
68
- "@skaldapp/configs": "^1.4.5",
68
+ "@skaldapp/configs": "^1.4.6",
69
69
  "@types/markdown-it": "^14.1.2",
70
- "@types/node": "^26.1.0",
71
- "eslint": "^10.6.0",
70
+ "@types/node": "^26.1.1",
71
+ "eslint": "^10.7.0",
72
72
  "jsonc-parser": "^3.3.1",
73
73
  "path-browserify": "^1.0.1",
74
- "vite": "^8.1.3"
74
+ "vite": "^8.1.4"
75
75
  }
76
76
  }