@vue/language-core 3.1.7 → 3.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 (44) hide show
  1. package/lib/codegen/globalTypes.js +1 -1
  2. package/lib/codegen/names.d.ts +0 -1
  3. package/lib/codegen/names.js +1 -2
  4. package/lib/codegen/script/component.js +1 -14
  5. package/lib/codegen/script/index.js +57 -51
  6. package/lib/codegen/script/src.d.ts +1 -0
  7. package/lib/codegen/script/src.js +17 -12
  8. package/lib/codegen/script/template.d.ts +1 -1
  9. package/lib/codegen/script/template.js +9 -24
  10. package/lib/codegen/style/classProperty.d.ts +2 -0
  11. package/lib/codegen/style/classProperty.js +18 -0
  12. package/lib/codegen/style/imports.d.ts +2 -0
  13. package/lib/codegen/style/imports.js +27 -0
  14. package/lib/codegen/style/index.d.ts +1 -4
  15. package/lib/codegen/template/context.d.ts +1 -4
  16. package/lib/codegen/template/context.js +2 -1
  17. package/lib/codegen/template/element.js +101 -155
  18. package/lib/codegen/template/elementChildren.d.ts +5 -0
  19. package/lib/codegen/template/elementChildren.js +12 -0
  20. package/lib/codegen/template/elementEvents.d.ts +1 -1
  21. package/lib/codegen/template/elementEvents.js +3 -3
  22. package/lib/codegen/template/index.d.ts +2 -5
  23. package/lib/codegen/template/templateChild.js +11 -15
  24. package/lib/codegen/template/vSlot.d.ts +1 -1
  25. package/lib/codegen/template/vSlot.js +14 -20
  26. package/lib/codegen/utils/index.js +4 -2
  27. package/lib/codegen/utils/wrapWith.d.ts +2 -0
  28. package/lib/codegen/utils/wrapWith.js +15 -0
  29. package/lib/parsers/scriptRanges.d.ts +2 -0
  30. package/lib/parsers/scriptRanges.js +2 -0
  31. package/lib/parsers/utils.js +3 -0
  32. package/lib/plugins/vue-script-js.js +1 -1
  33. package/lib/plugins/vue-tsx.d.ts +3 -4
  34. package/lib/virtualFile/computedEmbeddedCodes.d.ts +4 -0
  35. package/lib/virtualFile/computedEmbeddedCodes.js +262 -0
  36. package/lib/virtualFile/computedSfc.d.ts +6 -0
  37. package/lib/virtualFile/computedSfc.js +340 -0
  38. package/lib/virtualFile/computedVueSfc.d.ts +4 -0
  39. package/lib/virtualFile/computedVueSfc.js +41 -0
  40. package/lib/virtualFile/embeddedFile.d.ts +11 -0
  41. package/lib/virtualFile/embeddedFile.js +14 -0
  42. package/lib/virtualFile/vueFile.d.ts +24 -0
  43. package/lib/virtualFile/vueFile.js +49 -0
  44. package/package.json +2 -2
@@ -0,0 +1,24 @@
1
+ import type { CodeInformation, Mapping, VirtualCode } from '@volar/language-core';
2
+ import type * as ts from 'typescript';
3
+ import type { VueCompilerOptions, VueLanguagePluginReturn } from '../types';
4
+ import { computedSfc } from './computedSfc';
5
+ export declare class VueVirtualCode implements VirtualCode {
6
+ fileName: string;
7
+ languageId: string;
8
+ initSnapshot: ts.IScriptSnapshot;
9
+ vueCompilerOptions: VueCompilerOptions;
10
+ plugins: VueLanguagePluginReturn[];
11
+ ts: typeof import('typescript');
12
+ readonly id = "main";
13
+ readonly sfc: ReturnType<typeof computedSfc>;
14
+ private _snapshot;
15
+ private _vueSfc;
16
+ private _embeddedCodes;
17
+ private _mappings;
18
+ get snapshot(): ts.IScriptSnapshot;
19
+ get vueSfc(): import("@vue/compiler-sfc").SFCParseResult | undefined;
20
+ get embeddedCodes(): VirtualCode[];
21
+ get mappings(): Mapping<CodeInformation>[];
22
+ constructor(fileName: string, languageId: string, initSnapshot: ts.IScriptSnapshot, vueCompilerOptions: VueCompilerOptions, plugins: VueLanguagePluginReturn[], ts: typeof import('typescript'));
23
+ update(newSnapshot: ts.IScriptSnapshot): void;
24
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VueVirtualCode = void 0;
4
+ const alien_signals_1 = require("alien-signals");
5
+ const plugins_1 = require("../plugins");
6
+ const computedEmbeddedCodes_1 = require("./computedEmbeddedCodes");
7
+ const computedSfc_1 = require("./computedSfc");
8
+ const computedVueSfc_1 = require("./computedVueSfc");
9
+ class VueVirtualCode {
10
+ get snapshot() {
11
+ return this._snapshot();
12
+ }
13
+ get vueSfc() {
14
+ return this._vueSfc();
15
+ }
16
+ get embeddedCodes() {
17
+ return this._embeddedCodes();
18
+ }
19
+ get mappings() {
20
+ return this._mappings();
21
+ }
22
+ constructor(fileName, languageId, initSnapshot, vueCompilerOptions, plugins, ts) {
23
+ this.fileName = fileName;
24
+ this.languageId = languageId;
25
+ this.initSnapshot = initSnapshot;
26
+ this.vueCompilerOptions = vueCompilerOptions;
27
+ this.plugins = plugins;
28
+ this.ts = ts;
29
+ this.id = 'main';
30
+ this._snapshot = (0, alien_signals_1.signal)(initSnapshot);
31
+ this._vueSfc = (0, computedVueSfc_1.computedVueSfc)(this.plugins, this.fileName, this.languageId, this._snapshot);
32
+ this.sfc = (0, computedSfc_1.computedSfc)(this.ts, this.plugins, this.fileName, this._snapshot, this._vueSfc);
33
+ this._embeddedCodes = (0, computedEmbeddedCodes_1.computedEmbeddedCodes)(this.plugins, this.fileName, this.sfc);
34
+ this._mappings = (0, alien_signals_1.computed)(() => {
35
+ const snapshot = this._snapshot();
36
+ return [{
37
+ sourceOffsets: [0],
38
+ generatedOffsets: [0],
39
+ lengths: [snapshot.getLength()],
40
+ data: plugins_1.allCodeFeatures,
41
+ }];
42
+ });
43
+ }
44
+ update(newSnapshot) {
45
+ this._snapshot(newSnapshot);
46
+ }
47
+ }
48
+ exports.VueVirtualCode = VueVirtualCode;
49
+ //# sourceMappingURL=vueFile.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/language-core",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -36,5 +36,5 @@
36
36
  "optional": true
37
37
  }
38
38
  },
39
- "gitHead": "20dcd47c0cb4ce30e2c5e3ef1986ce297c218a06"
39
+ "gitHead": "0c9b66d0332698a1764fa56b64d47a6a30e81b47"
40
40
  }