@skaldapp/monaco-sfc 1.1.39 → 1.1.41
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/vue.worker.js +286 -532
- package/package.json +6 -6
package/dist/vue.worker.js
CHANGED
|
@@ -9572,33 +9572,78 @@ var require_codeFeatures = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9572
9572
|
//#region node_modules/@vue/language-core/lib/codegen/names.js
|
|
9573
9573
|
var require_names = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9574
9574
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9575
|
-
exports.
|
|
9576
|
-
exports.
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9575
|
+
exports.names = void 0;
|
|
9576
|
+
exports.names = Object.fromEntries(Object.keys({
|
|
9577
|
+
base: "",
|
|
9578
|
+
export: "",
|
|
9579
|
+
components: "",
|
|
9580
|
+
componentsOption: "",
|
|
9581
|
+
ctx: "",
|
|
9582
|
+
defaultModels: "",
|
|
9583
|
+
defaults: "",
|
|
9584
|
+
directives: "",
|
|
9585
|
+
directivesOption: "",
|
|
9586
|
+
dollars: "",
|
|
9587
|
+
emit: "",
|
|
9588
|
+
exposed: "",
|
|
9589
|
+
intrinsics: "",
|
|
9590
|
+
modelEmit: "",
|
|
9591
|
+
props: "",
|
|
9592
|
+
propsOption: "",
|
|
9593
|
+
self: "",
|
|
9594
|
+
setup: "",
|
|
9595
|
+
slots: "",
|
|
9596
|
+
src: "",
|
|
9597
|
+
Emit: "",
|
|
9598
|
+
EmitProps: "",
|
|
9599
|
+
GlobalComponents: "",
|
|
9600
|
+
InheritedAttrs: "",
|
|
9601
|
+
LocalComponents: "",
|
|
9602
|
+
LocalDirectives: "",
|
|
9603
|
+
ModelEmit: "",
|
|
9604
|
+
ModelProps: "",
|
|
9605
|
+
Props: "",
|
|
9606
|
+
PublicProps: "",
|
|
9607
|
+
RootEl: "",
|
|
9608
|
+
SetupExposed: "",
|
|
9609
|
+
Slots: "",
|
|
9610
|
+
StyleModules: "",
|
|
9611
|
+
StyleScopedClasses: "",
|
|
9612
|
+
TemplateRefs: "",
|
|
9613
|
+
asFunctionalComponent0: "",
|
|
9614
|
+
asFunctionalComponent1: "",
|
|
9615
|
+
asFunctionalDirective: "",
|
|
9616
|
+
asFunctionalElement0: "",
|
|
9617
|
+
asFunctionalElement1: "",
|
|
9618
|
+
asFunctionalSlot: "",
|
|
9619
|
+
directiveBindingRestFields: "",
|
|
9620
|
+
functionalComponentArgsRest: "",
|
|
9621
|
+
tryAsConstant: "",
|
|
9622
|
+
vFor: "",
|
|
9623
|
+
vSlot: "",
|
|
9624
|
+
ConstructorOverloads: "",
|
|
9625
|
+
Elements: "",
|
|
9626
|
+
EmitsToProps: "",
|
|
9627
|
+
FunctionalComponent0: "",
|
|
9628
|
+
FunctionalComponent1: "",
|
|
9629
|
+
FunctionalComponentCtx: "",
|
|
9630
|
+
FunctionalComponentProps: "",
|
|
9631
|
+
IsAny: "",
|
|
9632
|
+
IsFunction: "",
|
|
9633
|
+
NormalizeComponentEvent: "",
|
|
9634
|
+
NormalizeEmits: "",
|
|
9635
|
+
OverloadUnion: "",
|
|
9636
|
+
OverloadUnionInner: "",
|
|
9637
|
+
PickNotAny: "",
|
|
9638
|
+
PrettifyGlobal: "",
|
|
9639
|
+
ResolveDirectives: "",
|
|
9640
|
+
ResolveEmits: "",
|
|
9641
|
+
ShortEmits: "",
|
|
9642
|
+
ShortEmitsToObject: "",
|
|
9643
|
+
SpreadMerge: "",
|
|
9644
|
+
UnionToIntersection: "",
|
|
9645
|
+
WithComponent: ""
|
|
9646
|
+
}).map((key) => [key, `__VLS_${key}`]));
|
|
9602
9647
|
}));
|
|
9603
9648
|
//#endregion
|
|
9604
9649
|
//#region node_modules/@vue/language-core/lib/codegen/utils/index.js
|
|
@@ -9771,7 +9816,7 @@ var shared_esm_bundler_exports = /* @__PURE__ */ __exportAll({
|
|
|
9771
9816
|
toTypeString: () => toTypeString
|
|
9772
9817
|
});
|
|
9773
9818
|
/**
|
|
9774
|
-
* @vue/shared v3.5.
|
|
9819
|
+
* @vue/shared v3.5.34
|
|
9775
9820
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9776
9821
|
* @license MIT
|
|
9777
9822
|
**/
|
|
@@ -15412,54 +15457,13 @@ var require_collectBindings = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15412
15457
|
//#endregion
|
|
15413
15458
|
//#region node_modules/@vue/language-core/lib/codegen/template/interpolation.js
|
|
15414
15459
|
var require_interpolation = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
15415
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
15416
|
-
if (k2 === void 0) k2 = k;
|
|
15417
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15418
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
15419
|
-
enumerable: true,
|
|
15420
|
-
get: function() {
|
|
15421
|
-
return m[k];
|
|
15422
|
-
}
|
|
15423
|
-
};
|
|
15424
|
-
Object.defineProperty(o, k2, desc);
|
|
15425
|
-
}) : (function(o, m, k, k2) {
|
|
15426
|
-
if (k2 === void 0) k2 = k;
|
|
15427
|
-
o[k2] = m[k];
|
|
15428
|
-
}));
|
|
15429
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
15430
|
-
Object.defineProperty(o, "default", {
|
|
15431
|
-
enumerable: true,
|
|
15432
|
-
value: v
|
|
15433
|
-
});
|
|
15434
|
-
}) : function(o, v) {
|
|
15435
|
-
o["default"] = v;
|
|
15436
|
-
});
|
|
15437
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
15438
|
-
var ownKeys = function(o) {
|
|
15439
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
15440
|
-
var ar = [];
|
|
15441
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
15442
|
-
return ar;
|
|
15443
|
-
};
|
|
15444
|
-
return ownKeys(o);
|
|
15445
|
-
};
|
|
15446
|
-
return function(mod) {
|
|
15447
|
-
if (mod && mod.__esModule) return mod;
|
|
15448
|
-
var result = {};
|
|
15449
|
-
if (mod != null) {
|
|
15450
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
15451
|
-
}
|
|
15452
|
-
__setModuleDefault(result, mod);
|
|
15453
|
-
return result;
|
|
15454
|
-
};
|
|
15455
|
-
})();
|
|
15456
15460
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15457
15461
|
exports.generateInterpolation = generateInterpolation;
|
|
15458
15462
|
var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
|
|
15459
15463
|
var collectBindings_1 = require_collectBindings();
|
|
15460
15464
|
var shared_2 = require_shared$2();
|
|
15461
15465
|
var codeFeatures_1 = require_codeFeatures();
|
|
15462
|
-
var
|
|
15466
|
+
var names_1 = require_names();
|
|
15463
15467
|
var utils_1 = require_utils$4();
|
|
15464
15468
|
var isLiteralWhitelisted = /* @__PURE__ */ (0, shared_1.makeMap)("true,false,null,this");
|
|
15465
15469
|
function* generateInterpolation({ typescript, setupRefs }, ctx, block, data, code, start, prefix = "", suffix = "") {
|
|
@@ -15514,10 +15518,10 @@ var require_interpolation = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15514
15518
|
offset,
|
|
15515
15519
|
"errorMappingOnly"
|
|
15516
15520
|
];
|
|
15517
|
-
if (ctx.dollarVars.has(name)) yield names.dollars;
|
|
15521
|
+
if (ctx.dollarVars.has(name)) yield names_1.names.dollars;
|
|
15518
15522
|
else {
|
|
15519
15523
|
ctx.recordComponentAccess(block.name, name, start - prefix.length + offset);
|
|
15520
|
-
yield names.ctx;
|
|
15524
|
+
yield names_1.names.ctx;
|
|
15521
15525
|
}
|
|
15522
15526
|
yield `.`;
|
|
15523
15527
|
yield [
|
|
@@ -15611,13 +15615,14 @@ var require_objectProperty = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15611
15615
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15612
15616
|
exports.generateObjectProperty = generateObjectProperty;
|
|
15613
15617
|
var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
|
|
15618
|
+
var names_1 = require_names();
|
|
15614
15619
|
var utils_1 = require_utils$4();
|
|
15615
15620
|
var boundary_1 = require_boundary();
|
|
15616
15621
|
var camelized_1 = require_camelized();
|
|
15617
15622
|
var stringLiteralKey_1 = require_stringLiteralKey();
|
|
15618
15623
|
var interpolation_1 = require_interpolation();
|
|
15619
15624
|
function* generateObjectProperty(options, ctx, code, offset, features, shouldCamelize = false, shouldBeConstant = false) {
|
|
15620
|
-
if (code.startsWith("[") && code.endsWith("]")) if (shouldBeConstant) yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, features, code.slice(1, -1), offset + 1, `[
|
|
15625
|
+
if (code.startsWith("[") && code.endsWith("]")) if (shouldBeConstant) yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, features, code.slice(1, -1), offset + 1, `[${names_1.names.tryAsConstant}(`, `)]`);
|
|
15621
15626
|
else yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, features, code, offset);
|
|
15622
15627
|
else if (shouldCamelize) if (utils_1.identifierRegex.test((0, shared_1.camelize)(code))) yield* (0, camelized_1.generateCamelized)(code, "template", offset, features);
|
|
15623
15628
|
else {
|
|
@@ -17905,6 +17910,7 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17905
17910
|
var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
|
|
17906
17911
|
var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
|
|
17907
17912
|
var codeFeatures_1 = require_codeFeatures();
|
|
17913
|
+
var names_1 = require_names();
|
|
17908
17914
|
var utils_1 = require_utils$4();
|
|
17909
17915
|
var boundary_1 = require_boundary();
|
|
17910
17916
|
var camelized_1 = require_camelized();
|
|
@@ -17914,7 +17920,7 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17914
17920
|
for (const prop of node.props) if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE && (prop.name === "on" && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic || options.vueCompilerOptions.strictVModel && prop.name === "model" && (!prop.arg || prop.arg.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic))) {
|
|
17915
17921
|
if (!emitsVar) {
|
|
17916
17922
|
emitsVar = ctx.getInternalVariable();
|
|
17917
|
-
yield `let ${emitsVar}!:
|
|
17923
|
+
yield `let ${emitsVar}!: ${names_1.names.ResolveEmits}<typeof ${componentOriginalVar}, typeof ${getCtxVar()}.emit>${utils_1.endOfLine}`;
|
|
17918
17924
|
}
|
|
17919
17925
|
let source = prop.arg?.loc.source ?? "model-value";
|
|
17920
17926
|
let start = prop.arg?.loc.start.offset;
|
|
@@ -17932,7 +17938,7 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17932
17938
|
const propName = (0, shared_1.camelize)(propPrefix + source);
|
|
17933
17939
|
const emitName = emitPrefix + source;
|
|
17934
17940
|
const camelizedEmitName = (0, shared_1.camelize)(emitName);
|
|
17935
|
-
yield `const ${ctx.getInternalVariable()}:
|
|
17941
|
+
yield `const ${ctx.getInternalVariable()}: ${names_1.names.NormalizeComponentEvent}<typeof ${getPropsVar()}, typeof ${emitsVar}, '${propName}', '${emitName}', '${camelizedEmitName}'> = (${utils_1.newLine}`;
|
|
17936
17942
|
if (prop.name === "on") {
|
|
17937
17943
|
yield `{ `;
|
|
17938
17944
|
yield* generateEventArg(options, source, start, emitPrefix.slice(0, -1), codeFeatures_1.codeFeatures.navigation);
|
|
@@ -18079,7 +18085,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18079
18085
|
var shared_2 = require_shared$2();
|
|
18080
18086
|
var codeFeatures_1 = require_codeFeatures();
|
|
18081
18087
|
var inlayHints_1 = require_inlayHints();
|
|
18082
|
-
var
|
|
18088
|
+
var names_1 = require_names();
|
|
18083
18089
|
var utils_1 = require_utils$4();
|
|
18084
18090
|
var boundary_1 = require_boundary();
|
|
18085
18091
|
var camelized_1 = require_camelized();
|
|
@@ -18150,7 +18156,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18150
18156
|
if (shouldSpread) yield ` }`;
|
|
18151
18157
|
yield `,${utils_1.newLine}`;
|
|
18152
18158
|
if (isComponent && prop.name === "model" && prop.modifiers.length) {
|
|
18153
|
-
const propertyName = prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION ? !prop.arg.isStatic ? `[
|
|
18159
|
+
const propertyName = prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION ? !prop.arg.isStatic ? `[${names_1.names.tryAsConstant}(\`\${${prop.arg.content}}Modifiers\`)]` : (0, shared_1.camelize)(propName) + `Modifiers` : `modelModifiers`;
|
|
18154
18160
|
yield* (0, elementDirectives_1.generateModifiers)(options, ctx, prop, propertyName);
|
|
18155
18161
|
yield utils_1.newLine;
|
|
18156
18162
|
}
|
|
@@ -18205,7 +18211,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18205
18211
|
yield `.value`;
|
|
18206
18212
|
} else {
|
|
18207
18213
|
ctx.recordComponentAccess("template", propVariableName, exp.loc.start.offset);
|
|
18208
|
-
yield names.ctx;
|
|
18214
|
+
yield names_1.names.ctx;
|
|
18209
18215
|
yield `.`;
|
|
18210
18216
|
yield* codes;
|
|
18211
18217
|
}
|
|
@@ -18309,7 +18315,7 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18309
18315
|
var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
|
|
18310
18316
|
var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
|
|
18311
18317
|
var codeFeatures_1 = require_codeFeatures();
|
|
18312
|
-
var
|
|
18318
|
+
var names_1 = require_names();
|
|
18313
18319
|
var utils_1 = require_utils$4();
|
|
18314
18320
|
var boundary_1 = require_boundary();
|
|
18315
18321
|
var camelized_1 = require_camelized();
|
|
@@ -18321,9 +18327,9 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18321
18327
|
for (const prop of node.props) {
|
|
18322
18328
|
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || prop.name === "slot" || prop.name === "on" || prop.name === "model" || prop.name === "bind") continue;
|
|
18323
18329
|
const token = yield* (0, boundary_1.startBoundary)("template", prop.loc.start.offset, codeFeatures_1.codeFeatures.verification);
|
|
18324
|
-
yield
|
|
18330
|
+
yield `${names_1.names.asFunctionalDirective}(`;
|
|
18325
18331
|
yield* generateIdentifier(options, ctx, prop);
|
|
18326
|
-
yield `, {} as import('${options.vueCompilerOptions.lib}').ObjectDirective)(null!, {
|
|
18332
|
+
yield `, {} as import('${options.vueCompilerOptions.lib}').ObjectDirective)(null!, { ...${names_1.names.directiveBindingRestFields}, `;
|
|
18327
18333
|
yield* generateArg(options, ctx, prop);
|
|
18328
18334
|
yield* generateModifiers(options, ctx, prop);
|
|
18329
18335
|
yield* generateValue(options, ctx, prop);
|
|
@@ -18336,7 +18342,7 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18336
18342
|
const rawName = "v-" + prop.name;
|
|
18337
18343
|
const startOffset = prop.loc.start.offset;
|
|
18338
18344
|
const token = yield* (0, boundary_1.startBoundary)("template", startOffset, codeFeatures_1.codeFeatures.verification);
|
|
18339
|
-
yield names.directives;
|
|
18345
|
+
yield names_1.names.directives;
|
|
18340
18346
|
yield `.`;
|
|
18341
18347
|
yield* (0, camelized_1.generateCamelized)(rawName, "template", prop.loc.start.offset, {
|
|
18342
18348
|
...codeFeatures_1.codeFeatures.withoutHighlightAndCompletion,
|
|
@@ -18440,6 +18446,7 @@ var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18440
18446
|
exports.references = void 0;
|
|
18441
18447
|
exports.generateStyleScopedClassReference = generateStyleScopedClassReference;
|
|
18442
18448
|
var codeFeatures_1 = require_codeFeatures();
|
|
18449
|
+
var names_1 = require_names();
|
|
18443
18450
|
var utils_1 = require_utils$4();
|
|
18444
18451
|
var boundary_1 = require_boundary();
|
|
18445
18452
|
var escaped_1 = require_escaped();
|
|
@@ -18447,7 +18454,7 @@ var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18447
18454
|
exports.references = /* @__PURE__ */ new WeakMap();
|
|
18448
18455
|
function* generateStyleScopedClassReference(block, className, offset, fullStart = offset) {
|
|
18449
18456
|
if (!className) {
|
|
18450
|
-
yield `/** @type {
|
|
18457
|
+
yield `/** @type {${names_1.names.StyleScopedClasses}['`;
|
|
18451
18458
|
yield [
|
|
18452
18459
|
"",
|
|
18453
18460
|
"template",
|
|
@@ -18463,7 +18470,7 @@ var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18463
18470
|
exports.references.set(block, [block.content, arr]);
|
|
18464
18471
|
arr.push([className, offset]);
|
|
18465
18472
|
} else cache[1].push([className, offset]);
|
|
18466
|
-
yield `/** @type {
|
|
18473
|
+
yield `/** @type {${names_1.names.StyleScopedClasses}[`;
|
|
18467
18474
|
const token = yield* (0, boundary_1.startBoundary)(block.name, fullStart, codeFeatures_1.codeFeatures.navigation);
|
|
18468
18475
|
yield `'`;
|
|
18469
18476
|
yield* (0, escaped_1.generateEscaped)(className, block.name, offset, codeFeatures_1.codeFeatures.navigationAndCompletion, classNameEscapeRegex);
|
|
@@ -18522,6 +18529,7 @@ var require_vSlot = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18522
18529
|
var muggle_string_1 = require_out$1();
|
|
18523
18530
|
var collectBindings_1 = require_collectBindings();
|
|
18524
18531
|
var codeFeatures_1 = require_codeFeatures();
|
|
18532
|
+
var names_1 = require_names();
|
|
18525
18533
|
var utils_1 = require_utils$4();
|
|
18526
18534
|
var boundary_1 = require_boundary();
|
|
18527
18535
|
var interpolation_1 = require_interpolation();
|
|
@@ -18590,7 +18598,7 @@ var require_vSlot = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18590
18598
|
} else types.push(null);
|
|
18591
18599
|
yield `const [`;
|
|
18592
18600
|
yield* interpolation;
|
|
18593
|
-
yield `] =
|
|
18601
|
+
yield `] = ${names_1.names.vSlot}(${slotVar}!`;
|
|
18594
18602
|
if (types.some((t) => t)) {
|
|
18595
18603
|
yield `, `;
|
|
18596
18604
|
const token = yield* (0, boundary_1.startBoundary)("template", exp.loc.start.offset, codeFeatures_1.codeFeatures.verification);
|
|
@@ -18659,7 +18667,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18659
18667
|
var shared_2 = require_shared$2();
|
|
18660
18668
|
var codeFeatures_1 = require_codeFeatures();
|
|
18661
18669
|
var inlayHints_1 = require_inlayHints();
|
|
18662
|
-
var
|
|
18670
|
+
var names_1 = require_names();
|
|
18663
18671
|
var utils_1 = require_utils$4();
|
|
18664
18672
|
var boundary_1 = require_boundary();
|
|
18665
18673
|
var camelized_1 = require_camelized();
|
|
@@ -18718,8 +18726,8 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18718
18726
|
}
|
|
18719
18727
|
yield utils_1.endOfLine;
|
|
18720
18728
|
} else {
|
|
18721
|
-
yield `let ${componentVar}!:
|
|
18722
|
-
yield originalNames.has(options.componentName) ? `, typeof ${names.
|
|
18729
|
+
yield `let ${componentVar}!: ${names_1.names.WithComponent}<'${tag}', ${names_1.names.LocalComponents}, ${names_1.names.GlobalComponents}`;
|
|
18730
|
+
yield originalNames.has(options.componentName) ? `, typeof ${names_1.names.export}` : `, void`;
|
|
18723
18731
|
for (const name of originalNames) yield `, '${name}'`;
|
|
18724
18732
|
yield `>[`;
|
|
18725
18733
|
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(tag, startTagOffset, {
|
|
@@ -18728,18 +18736,19 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18728
18736
|
});
|
|
18729
18737
|
yield `]${utils_1.endOfLine}`;
|
|
18730
18738
|
if (utils_1.identifierRegex.test((0, shared_1.camelize)(tag))) {
|
|
18731
|
-
yield `/** @ts-ignore @type {
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
yield ` | typeof ${names.components}.`;
|
|
18735
|
-
yield* (0, camelized_1.generateCamelized)(
|
|
18736
|
-
}
|
|
18737
|
-
if (endTagOffset !== void 0) {
|
|
18738
|
-
yield ` | typeof ${names.components}.`;
|
|
18739
|
-
yield* (0, camelized_1.generateCamelized)(tag, "template", endTagOffset, codeFeatures_1.codeFeatures.navigation);
|
|
18739
|
+
yield `/** @ts-ignore @type {`;
|
|
18740
|
+
for (const offset of [startTagOffset, endTagOffset]) {
|
|
18741
|
+
if (offset === void 0) continue;
|
|
18742
|
+
yield ` | typeof ${names_1.names.components}.`;
|
|
18743
|
+
yield* (0, camelized_1.generateCamelized)(tag, "template", offset, codeFeatures_1.codeFeatures.navigation);
|
|
18740
18744
|
if (tag[0] !== tag[0].toUpperCase()) {
|
|
18741
|
-
yield ` | typeof ${names.components}.`;
|
|
18742
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tag), "template",
|
|
18745
|
+
yield ` | typeof ${names_1.names.components}.`;
|
|
18746
|
+
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tag), "template", offset, codeFeatures_1.codeFeatures.navigation);
|
|
18747
|
+
}
|
|
18748
|
+
if (tag.includes("-")) {
|
|
18749
|
+
yield ` | typeof ${names_1.names.components}[`;
|
|
18750
|
+
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(tag, offset, codeFeatures_1.codeFeatures.navigation);
|
|
18751
|
+
yield `]`;
|
|
18743
18752
|
}
|
|
18744
18753
|
}
|
|
18745
18754
|
yield `} */${utils_1.newLine}`;
|
|
@@ -18759,16 +18768,16 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18759
18768
|
const failGeneratedExpressions = [];
|
|
18760
18769
|
const propCodes = [...(0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.checkUnknownProps, failGeneratedExpressions)];
|
|
18761
18770
|
const functionalVar = ctx.getInternalVariable();
|
|
18762
|
-
const
|
|
18771
|
+
const vnodeVar = ctx.getInternalVariable();
|
|
18763
18772
|
const ctxVar = ctx.getInternalVariable();
|
|
18764
18773
|
const propsVar = ctx.getInternalVariable();
|
|
18765
18774
|
yield `// @ts-ignore${utils_1.newLine}`;
|
|
18766
|
-
yield `const ${functionalVar} = ${options.vueCompilerOptions.checkUnknownProps ?
|
|
18775
|
+
yield `const ${functionalVar} = ${options.vueCompilerOptions.checkUnknownProps ? names_1.names.asFunctionalComponent0 : names_1.names.asFunctionalComponent1}(${componentVar}, new ${componentVar}({${utils_1.newLine}`;
|
|
18767
18776
|
yield (0, muggle_string_1.toString)(propCodes);
|
|
18768
18777
|
yield `}))${utils_1.endOfLine}`;
|
|
18769
18778
|
yield `const `;
|
|
18770
18779
|
const token = yield* (0, boundary_1.startBoundary)("template", node.loc.start.offset, codeFeatures_1.codeFeatures.doNotReportTs6133);
|
|
18771
|
-
yield
|
|
18780
|
+
yield vnodeVar;
|
|
18772
18781
|
yield (0, boundary_1.endBoundary)(token, node.loc.end.offset);
|
|
18773
18782
|
yield ` = ${functionalVar}`;
|
|
18774
18783
|
if (ctx.currentInfo.generic) {
|
|
@@ -18790,7 +18799,7 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18790
18799
|
yield* propCodes;
|
|
18791
18800
|
yield `}`;
|
|
18792
18801
|
yield (0, boundary_1.endBoundary)(token2, tagOffset + tag.length);
|
|
18793
|
-
yield `,
|
|
18802
|
+
yield `, ...${names_1.names.functionalComponentArgsRest}(${functionalVar}))${utils_1.endOfLine}`;
|
|
18794
18803
|
yield* generateFailedExpressions(options, ctx, failGeneratedExpressions);
|
|
18795
18804
|
yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, componentVar, getCtxVar, getPropsVar);
|
|
18796
18805
|
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
@@ -18811,18 +18820,18 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18811
18820
|
yield* generateStyleScopedClassReferences(options, node);
|
|
18812
18821
|
const slotDir = node.props.find((p) => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === "slot");
|
|
18813
18822
|
if (slotDir || node.children.length) yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir, getCtxVar());
|
|
18814
|
-
if (isCtxVarUsed) yield `var ${ctxVar}!:
|
|
18815
|
-
if (isPropsVarUsed) yield `var ${propsVar}!:
|
|
18823
|
+
if (isCtxVarUsed) yield `var ${ctxVar}!: ${names_1.names.FunctionalComponentCtx}<typeof ${componentVar}, typeof ${vnodeVar}>${utils_1.endOfLine}`;
|
|
18824
|
+
if (isPropsVarUsed) yield `var ${propsVar}!: ${names_1.names.FunctionalComponentProps}<typeof ${componentVar}, typeof ${vnodeVar}>${utils_1.endOfLine}`;
|
|
18816
18825
|
ctx.components.pop();
|
|
18817
18826
|
}
|
|
18818
18827
|
function* generateElement(options, ctx, node) {
|
|
18819
18828
|
const [startTagOffset, endTagOffset] = (0, shared_2.getElementTagOffsets)(node, options.template);
|
|
18820
18829
|
const failedPropExps = [];
|
|
18821
|
-
yield `${options.vueCompilerOptions.checkUnknownProps ?
|
|
18830
|
+
yield `${options.vueCompilerOptions.checkUnknownProps ? names_1.names.asFunctionalElement0 : names_1.names.asFunctionalElement1}(${names_1.names.intrinsics}`;
|
|
18822
18831
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, startTagOffset, codeFeatures_1.codeFeatures.withoutHighlightAndCompletion);
|
|
18823
18832
|
if (endTagOffset !== void 0) {
|
|
18824
18833
|
yield `, `;
|
|
18825
|
-
yield names.intrinsics;
|
|
18834
|
+
yield names_1.names.intrinsics;
|
|
18826
18835
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, endTagOffset, codeFeatures_1.codeFeatures.withoutHighlightAndCompletion);
|
|
18827
18836
|
}
|
|
18828
18837
|
yield `)(`;
|
|
@@ -18836,12 +18845,12 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18836
18845
|
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
18837
18846
|
const templateRef = getTemplateRef(node);
|
|
18838
18847
|
if (templateRef) {
|
|
18839
|
-
let typeExp =
|
|
18848
|
+
let typeExp = `${names_1.names.Elements}['${node.tag}']`;
|
|
18840
18849
|
if (ctx.inVFor) typeExp += `[]`;
|
|
18841
18850
|
ctx.addTemplateRef(templateRef[0], typeExp, templateRef[1]);
|
|
18842
18851
|
}
|
|
18843
|
-
if (ctx.singleRootNodes.has(node)) ctx.singleRootElTypes.add(
|
|
18844
|
-
if (hasVBindAttrs(options, ctx, node)) ctx.inheritedAttrVars.add(
|
|
18852
|
+
if (ctx.singleRootNodes.has(node)) ctx.singleRootElTypes.add(`${names_1.names.Elements}['${node.tag}']`);
|
|
18853
|
+
if (hasVBindAttrs(options, ctx, node)) ctx.inheritedAttrVars.add(`${names_1.names.intrinsics}.${node.tag}`);
|
|
18845
18854
|
yield* generateStyleScopedClassReferences(options, node);
|
|
18846
18855
|
for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child);
|
|
18847
18856
|
}
|
|
@@ -18959,7 +18968,7 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18959
18968
|
var shared_1 = require_shared$2();
|
|
18960
18969
|
var codeFeatures_1 = require_codeFeatures();
|
|
18961
18970
|
var inlayHints_1 = require_inlayHints();
|
|
18962
|
-
var
|
|
18971
|
+
var names_1 = require_names();
|
|
18963
18972
|
var utils_1 = require_utils$4();
|
|
18964
18973
|
var boundary_1 = require_boundary();
|
|
18965
18974
|
var elementProps_1 = require_elementProps();
|
|
@@ -18975,7 +18984,7 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18975
18984
|
if (prop.name === "bind" && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) return prop.arg.content === "name";
|
|
18976
18985
|
});
|
|
18977
18986
|
if (options.hasDefineSlots) {
|
|
18978
|
-
yield
|
|
18987
|
+
yield `${names_1.names.asFunctionalSlot}(`;
|
|
18979
18988
|
if (nameProp) {
|
|
18980
18989
|
let codes;
|
|
18981
18990
|
if (nameProp.type === CompilerDOM.NodeTypes.ATTRIBUTE && nameProp.value) {
|
|
@@ -18988,12 +18997,12 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18988
18997
|
];
|
|
18989
18998
|
else codes = [`['default']`];
|
|
18990
18999
|
const token = yield* (0, boundary_1.startBoundary)("template", nameProp.loc.start.offset, codeFeatures_1.codeFeatures.verification);
|
|
18991
|
-
yield options.slotsAssignName ?? names.slots;
|
|
19000
|
+
yield options.slotsAssignName ?? names_1.names.slots;
|
|
18992
19001
|
yield* codes;
|
|
18993
19002
|
yield (0, boundary_1.endBoundary)(token, nameProp.loc.end.offset);
|
|
18994
19003
|
} else {
|
|
18995
19004
|
const token = yield* (0, boundary_1.startBoundary)("template", startTagOffset, codeFeatures_1.codeFeatures.verification);
|
|
18996
|
-
yield `${options.slotsAssignName ?? names.slots}[`;
|
|
19005
|
+
yield `${options.slotsAssignName ?? names_1.names.slots}[`;
|
|
18997
19006
|
const token2 = yield* (0, boundary_1.startBoundary)("template", startTagOffset, codeFeatures_1.codeFeatures.verification);
|
|
18998
19007
|
yield `'default'`;
|
|
18999
19008
|
yield (0, boundary_1.endBoundary)(token2, startTagEndOffset);
|
|
@@ -19022,7 +19031,7 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19022
19031
|
const isShortHand = nameProp.arg?.loc.start.offset === nameProp.exp.loc.start.offset;
|
|
19023
19032
|
if (isShortHand) ctx.inlayHints.push((0, inlayHints_1.createVBindShorthandInlayHintInfo)(nameProp.exp.loc, "name"));
|
|
19024
19033
|
const expVar = ctx.getInternalVariable();
|
|
19025
|
-
yield `var ${expVar} =
|
|
19034
|
+
yield `var ${expVar} = ${names_1.names.tryAsConstant}(`;
|
|
19026
19035
|
yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, isShortHand ? codeFeatures_1.codeFeatures.withoutHighlightAndCompletion : codeFeatures_1.codeFeatures.all, nameProp.exp.content, nameProp.exp.loc.start.offset);
|
|
19027
19036
|
yield `)${utils_1.endOfLine}`;
|
|
19028
19037
|
ctx.dynamicSlots.push({
|
|
@@ -19089,6 +19098,7 @@ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19089
19098
|
var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
|
|
19090
19099
|
var collectBindings_1 = require_collectBindings();
|
|
19091
19100
|
var codeFeatures_1 = require_codeFeatures();
|
|
19101
|
+
var names_1 = require_names();
|
|
19092
19102
|
var utils_1 = require_utils$4();
|
|
19093
19103
|
var interpolation_1 = require_interpolation();
|
|
19094
19104
|
var templateChild_1 = require_templateChild();
|
|
@@ -19109,7 +19119,7 @@ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19109
19119
|
}
|
|
19110
19120
|
yield `] of `;
|
|
19111
19121
|
if (source.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
19112
|
-
yield
|
|
19122
|
+
yield `${names_1.names.vFor}(`;
|
|
19113
19123
|
yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, codeFeatures_1.codeFeatures.all, source.content, source.loc.start.offset, `(`, `)`);
|
|
19114
19124
|
yield `!)`;
|
|
19115
19125
|
} else yield `{} as any`;
|
|
@@ -19329,51 +19339,10 @@ var require_templateChild = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19329
19339
|
//#endregion
|
|
19330
19340
|
//#region node_modules/@vue/language-core/lib/codegen/template/index.js
|
|
19331
19341
|
var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
19332
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
19333
|
-
if (k2 === void 0) k2 = k;
|
|
19334
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19335
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
19336
|
-
enumerable: true,
|
|
19337
|
-
get: function() {
|
|
19338
|
-
return m[k];
|
|
19339
|
-
}
|
|
19340
|
-
};
|
|
19341
|
-
Object.defineProperty(o, k2, desc);
|
|
19342
|
-
}) : (function(o, m, k, k2) {
|
|
19343
|
-
if (k2 === void 0) k2 = k;
|
|
19344
|
-
o[k2] = m[k];
|
|
19345
|
-
}));
|
|
19346
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
19347
|
-
Object.defineProperty(o, "default", {
|
|
19348
|
-
enumerable: true,
|
|
19349
|
-
value: v
|
|
19350
|
-
});
|
|
19351
|
-
}) : function(o, v) {
|
|
19352
|
-
o["default"] = v;
|
|
19353
|
-
});
|
|
19354
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
19355
|
-
var ownKeys = function(o) {
|
|
19356
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
19357
|
-
var ar = [];
|
|
19358
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
19359
|
-
return ar;
|
|
19360
|
-
};
|
|
19361
|
-
return ownKeys(o);
|
|
19362
|
-
};
|
|
19363
|
-
return function(mod) {
|
|
19364
|
-
if (mod && mod.__esModule) return mod;
|
|
19365
|
-
var result = {};
|
|
19366
|
-
if (mod != null) {
|
|
19367
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
19368
|
-
}
|
|
19369
|
-
__setModuleDefault(result, mod);
|
|
19370
|
-
return result;
|
|
19371
|
-
};
|
|
19372
|
-
})();
|
|
19373
19342
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19374
19343
|
exports.generateTemplate = generate;
|
|
19375
19344
|
var codeFeatures_1 = require_codeFeatures();
|
|
19376
|
-
var
|
|
19345
|
+
var names_1 = require_names();
|
|
19377
19346
|
var utils_1 = require_utils$4();
|
|
19378
19347
|
var boundary_1 = require_boundary();
|
|
19379
19348
|
var context_1 = require_context$1();
|
|
@@ -19409,27 +19378,27 @@ var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19409
19378
|
yield* generateTemplateRefsType(options, ctx);
|
|
19410
19379
|
yield* generateRootElType(ctx);
|
|
19411
19380
|
if (ctx.dollarVars.size) {
|
|
19412
|
-
yield `var ${names.dollars}!: {${utils_1.newLine}`;
|
|
19413
|
-
if (ctx.dollarVars.has("$slots")) yield `$slots: ${ctx.generatedTypes.has(names.Slots) ? names.Slots : `{}`}${utils_1.endOfLine}`;
|
|
19381
|
+
yield `var ${names_1.names.dollars}!: {${utils_1.newLine}`;
|
|
19382
|
+
if (ctx.dollarVars.has("$slots")) yield `$slots: ${ctx.generatedTypes.has(names_1.names.Slots) ? names_1.names.Slots : `{}`}${utils_1.endOfLine}`;
|
|
19414
19383
|
if (ctx.dollarVars.has("$attrs")) {
|
|
19415
19384
|
yield `$attrs: import('${vueCompilerOptions.lib}').ComponentPublicInstance['$attrs']`;
|
|
19416
|
-
if (ctx.generatedTypes.has(names.InheritedAttrs)) yield ` & ${names.InheritedAttrs}`;
|
|
19385
|
+
if (ctx.generatedTypes.has(names_1.names.InheritedAttrs)) yield ` & ${names_1.names.InheritedAttrs}`;
|
|
19417
19386
|
yield utils_1.endOfLine;
|
|
19418
19387
|
}
|
|
19419
|
-
if (ctx.dollarVars.has("$refs")) yield `$refs: ${ctx.generatedTypes.has(names.TemplateRefs) ? names.TemplateRefs : `{}`}${utils_1.endOfLine}`;
|
|
19420
|
-
if (ctx.dollarVars.has("$el")) yield `$el: ${ctx.generatedTypes.has(names.RootEl) ? names.RootEl : `any`}${utils_1.endOfLine}`;
|
|
19388
|
+
if (ctx.dollarVars.has("$refs")) yield `$refs: ${ctx.generatedTypes.has(names_1.names.TemplateRefs) ? names_1.names.TemplateRefs : `{}`}${utils_1.endOfLine}`;
|
|
19389
|
+
if (ctx.dollarVars.has("$el")) yield `$el: ${ctx.generatedTypes.has(names_1.names.RootEl) ? names_1.names.RootEl : `any`}${utils_1.endOfLine}`;
|
|
19421
19390
|
yield `} & { [K in keyof import('${vueCompilerOptions.lib}').ComponentPublicInstance]: unknown }${utils_1.endOfLine}`;
|
|
19422
19391
|
}
|
|
19423
19392
|
yield* endScope();
|
|
19424
19393
|
}
|
|
19425
19394
|
function* generateSlotsType(options, ctx) {
|
|
19426
19395
|
if (options.hasDefineSlots) {
|
|
19427
|
-
ctx.generatedTypes.add(names.Slots);
|
|
19396
|
+
ctx.generatedTypes.add(names_1.names.Slots);
|
|
19428
19397
|
return;
|
|
19429
19398
|
}
|
|
19430
19399
|
if (!ctx.slots.length && !ctx.dynamicSlots.length) return;
|
|
19431
|
-
ctx.generatedTypes.add(names.Slots);
|
|
19432
|
-
yield `type ${names.Slots} = {}`;
|
|
19400
|
+
ctx.generatedTypes.add(names_1.names.Slots);
|
|
19401
|
+
yield `type ${names_1.names.Slots} = {}`;
|
|
19433
19402
|
for (const { expVar, propsVar } of ctx.dynamicSlots) yield `${utils_1.newLine}& { [K in NonNullable<typeof ${expVar}>]?: (props: typeof ${propsVar}) => any }`;
|
|
19434
19403
|
for (const slot of ctx.slots) {
|
|
19435
19404
|
yield `${utils_1.newLine}& { `;
|
|
@@ -19445,14 +19414,14 @@ var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19445
19414
|
}
|
|
19446
19415
|
function* generateInheritedAttrsType(ctx) {
|
|
19447
19416
|
if (!ctx.inheritedAttrVars.size) return;
|
|
19448
|
-
ctx.generatedTypes.add(names.InheritedAttrs);
|
|
19449
|
-
yield `type ${names.InheritedAttrs} = Partial<${[...ctx.inheritedAttrVars].map((name) => `typeof ${name}`).join(` & `)}>`;
|
|
19417
|
+
ctx.generatedTypes.add(names_1.names.InheritedAttrs);
|
|
19418
|
+
yield `type ${names_1.names.InheritedAttrs} = Partial<${[...ctx.inheritedAttrVars].map((name) => `typeof ${name}`).join(` & `)}>`;
|
|
19450
19419
|
yield utils_1.endOfLine;
|
|
19451
19420
|
}
|
|
19452
19421
|
function* generateTemplateRefsType(options, ctx) {
|
|
19453
19422
|
if (!ctx.templateRefs.size) return;
|
|
19454
|
-
ctx.generatedTypes.add(names.TemplateRefs);
|
|
19455
|
-
yield `type ${names.TemplateRefs} = {}`;
|
|
19423
|
+
ctx.generatedTypes.add(names_1.names.TemplateRefs);
|
|
19424
|
+
yield `type ${names_1.names.TemplateRefs} = {}`;
|
|
19456
19425
|
for (const [name, refs] of ctx.templateRefs) {
|
|
19457
19426
|
yield `${utils_1.newLine}& `;
|
|
19458
19427
|
if (refs.length >= 2) yield `(`;
|
|
@@ -19469,8 +19438,8 @@ var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19469
19438
|
}
|
|
19470
19439
|
function* generateRootElType(ctx) {
|
|
19471
19440
|
if (!ctx.singleRootElTypes.size || ctx.singleRootNodes.has(null)) return;
|
|
19472
|
-
ctx.generatedTypes.add(names.RootEl);
|
|
19473
|
-
yield `type ${names.RootEl} = `;
|
|
19441
|
+
ctx.generatedTypes.add(names_1.names.RootEl);
|
|
19442
|
+
yield `type ${names_1.names.RootEl} = `;
|
|
19474
19443
|
for (const type of ctx.singleRootElTypes) yield `${utils_1.newLine}| ${type}`;
|
|
19475
19444
|
yield utils_1.endOfLine;
|
|
19476
19445
|
}
|
|
@@ -20011,7 +19980,7 @@ var require_file_md = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20011
19980
|
},
|
|
20012
19981
|
parseSFC2(_fileName, languageId, content) {
|
|
20013
19982
|
if (languageId !== "markdown") return;
|
|
20014
|
-
content = content.replace(frontmatterReg, (match) => " ".repeat(match.length)).replace(codeblockReg, (match, quotes) => quotes + " ".repeat(match.length - quotes.length * 2) + quotes).replace(
|
|
19983
|
+
content = content.replace(frontmatterReg, (match) => " ".repeat(match.length)).replace(codeblockReg, (match, quotes) => quotes + " ".repeat(match.length - quotes.length * 2) + quotes).replace(latexBlockReg, (match, quotes) => quotes + " ".repeat(match.length - quotes.length * 2) + quotes).replace(scriptSetupReg, (match) => " ".repeat(match.length)).replace(codeSnippetImportReg, (match) => " ".repeat(match.length));
|
|
20015
19984
|
const codes = [];
|
|
20016
19985
|
for (const match of content.matchAll(sfcBlockReg)) {
|
|
20017
19986
|
const matchText = match[0];
|
|
@@ -20023,7 +19992,7 @@ var require_file_md = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20023
19992
|
codes.push("\n\n");
|
|
20024
19993
|
content = content.slice(0, match.index) + " ".repeat(matchText.length) + content.slice(match.index + matchText.length);
|
|
20025
19994
|
}
|
|
20026
|
-
content = content.replace(angleBracketReg, (match) => " ".repeat(match.length)).replace(linkReg, (match) => " ".repeat(match.length));
|
|
19995
|
+
content = content.replace(inlineCodeblockReg, (match) => `\`${" ".repeat(match.length - 2)}\``).replace(angleBracketReg, (match) => " ".repeat(match.length)).replace(linkReg, (match) => " ".repeat(match.length));
|
|
20027
19996
|
codes.push("<template>\n");
|
|
20028
19997
|
codes.push([
|
|
20029
19998
|
content,
|
|
@@ -21472,80 +21441,33 @@ var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21472
21441
|
//#endregion
|
|
21473
21442
|
//#region node_modules/@vue/language-core/lib/codegen/script/component.js
|
|
21474
21443
|
var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
21475
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
21476
|
-
if (k2 === void 0) k2 = k;
|
|
21477
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21478
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
21479
|
-
enumerable: true,
|
|
21480
|
-
get: function() {
|
|
21481
|
-
return m[k];
|
|
21482
|
-
}
|
|
21483
|
-
};
|
|
21484
|
-
Object.defineProperty(o, k2, desc);
|
|
21485
|
-
}) : (function(o, m, k, k2) {
|
|
21486
|
-
if (k2 === void 0) k2 = k;
|
|
21487
|
-
o[k2] = m[k];
|
|
21488
|
-
}));
|
|
21489
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
21490
|
-
Object.defineProperty(o, "default", {
|
|
21491
|
-
enumerable: true,
|
|
21492
|
-
value: v
|
|
21493
|
-
});
|
|
21494
|
-
}) : function(o, v) {
|
|
21495
|
-
o["default"] = v;
|
|
21496
|
-
});
|
|
21497
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
21498
|
-
var ownKeys = function(o) {
|
|
21499
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
21500
|
-
var ar = [];
|
|
21501
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
21502
|
-
return ar;
|
|
21503
|
-
};
|
|
21504
|
-
return ownKeys(o);
|
|
21505
|
-
};
|
|
21506
|
-
return function(mod) {
|
|
21507
|
-
if (mod && mod.__esModule) return mod;
|
|
21508
|
-
var result = {};
|
|
21509
|
-
if (mod != null) {
|
|
21510
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
21511
|
-
}
|
|
21512
|
-
__setModuleDefault(result, mod);
|
|
21513
|
-
return result;
|
|
21514
|
-
};
|
|
21515
|
-
})();
|
|
21516
21444
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21517
21445
|
exports.generateComponent = generateComponent;
|
|
21518
21446
|
var codeFeatures_1 = require_codeFeatures();
|
|
21519
|
-
var
|
|
21447
|
+
var names_1 = require_names();
|
|
21520
21448
|
var utils_1 = require_utils$4();
|
|
21521
21449
|
var merge_1 = require_merge();
|
|
21522
21450
|
function* generateComponent(options, ctx, scriptSetup, scriptSetupRanges) {
|
|
21523
21451
|
yield `(await import('${options.vueCompilerOptions.lib}')).defineComponent({${utils_1.newLine}`;
|
|
21524
|
-
|
|
21525
|
-
if (scriptSetupRanges.defineExpose) returns.push([names.exposed]);
|
|
21526
|
-
if (returns.length) {
|
|
21527
|
-
yield `setup: () => (`;
|
|
21528
|
-
yield* (0, merge_1.generateSpreadMerge)(returns);
|
|
21529
|
-
yield `),${utils_1.newLine}`;
|
|
21530
|
-
}
|
|
21452
|
+
if (scriptSetupRanges.defineExpose) yield `setup: () => ${names_1.names.exposed},${utils_1.newLine}`;
|
|
21531
21453
|
const emitOptionCodes = [...generateEmitsOption(options, scriptSetupRanges)];
|
|
21532
21454
|
yield* emitOptionCodes;
|
|
21533
21455
|
yield* generatePropsOption(options, ctx, scriptSetup, scriptSetupRanges, !!emitOptionCodes.length);
|
|
21534
|
-
if (options.vueCompilerOptions.target >= 3.5 && options.vueCompilerOptions.inferComponentDollarRefs && options.templateAndStyleTypes.has(names.TemplateRefs)) yield `__typeRefs: {} as ${names.TemplateRefs},${utils_1.newLine}`;
|
|
21535
|
-
if (options.vueCompilerOptions.target >= 3.5 && options.vueCompilerOptions.inferComponentDollarEl && options.templateAndStyleTypes.has(names.RootEl)) yield `__typeEl: {} as ${names.RootEl},${utils_1.newLine}`;
|
|
21456
|
+
if (options.vueCompilerOptions.target >= 3.5 && options.vueCompilerOptions.inferComponentDollarRefs && options.templateAndStyleTypes.has(names_1.names.TemplateRefs)) yield `__typeRefs: {} as ${names_1.names.TemplateRefs},${utils_1.newLine}`;
|
|
21457
|
+
if (options.vueCompilerOptions.target >= 3.5 && options.vueCompilerOptions.inferComponentDollarEl && options.templateAndStyleTypes.has(names_1.names.RootEl)) yield `__typeEl: {} as ${names_1.names.RootEl},${utils_1.newLine}`;
|
|
21536
21458
|
yield `})`;
|
|
21537
21459
|
}
|
|
21538
21460
|
function* generateEmitsOption(options, scriptSetupRanges) {
|
|
21539
21461
|
const optionCodes = [];
|
|
21540
21462
|
const typeOptionCodes = [];
|
|
21541
21463
|
if (scriptSetupRanges.defineModel.length) {
|
|
21542
|
-
optionCodes.push([`{} as
|
|
21543
|
-
typeOptionCodes.push([names.ModelEmit]);
|
|
21464
|
+
optionCodes.push([`{} as ${names_1.names.NormalizeEmits}<typeof ${names_1.names.modelEmit}>`]);
|
|
21465
|
+
typeOptionCodes.push([names_1.names.ModelEmit]);
|
|
21544
21466
|
}
|
|
21545
21467
|
if (scriptSetupRanges.defineEmits) {
|
|
21546
21468
|
const { name, typeArg, hasUnionTypeArg } = scriptSetupRanges.defineEmits;
|
|
21547
|
-
optionCodes.push([`{} as
|
|
21548
|
-
if (typeArg && !hasUnionTypeArg) typeOptionCodes.push([names.Emit]);
|
|
21469
|
+
optionCodes.push([`{} as ${names_1.names.NormalizeEmits}<typeof ${name ?? names_1.names.emit}>`]);
|
|
21470
|
+
if (typeArg && !hasUnionTypeArg) typeOptionCodes.push([names_1.names.Emit]);
|
|
21549
21471
|
else typeOptionCodes.length = 0;
|
|
21550
21472
|
}
|
|
21551
21473
|
if (options.vueCompilerOptions.target >= 3.5 && typeOptionCodes.length) {
|
|
@@ -21561,24 +21483,24 @@ var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21561
21483
|
function* generatePropsOption(options, ctx, scriptSetup, scriptSetupRanges, hasEmitsOption) {
|
|
21562
21484
|
const optionGenerates = [];
|
|
21563
21485
|
const typeOptionGenerates = [];
|
|
21564
|
-
if (options.templateAndStyleTypes.has(names.InheritedAttrs)) {
|
|
21565
|
-
const attrsType = hasEmitsOption ? `Omit<${names.InheritedAttrs}, keyof ${names.EmitProps}>` : names.InheritedAttrs;
|
|
21486
|
+
if (options.templateAndStyleTypes.has(names_1.names.InheritedAttrs)) {
|
|
21487
|
+
const attrsType = hasEmitsOption ? `Omit<${names_1.names.InheritedAttrs}, keyof ${names_1.names.EmitProps}>` : names_1.names.InheritedAttrs;
|
|
21566
21488
|
optionGenerates.push(function* () {
|
|
21567
|
-
const propsType =
|
|
21489
|
+
const propsType = `${names_1.names.PickNotAny}<${ctx.localTypes.OmitIndexSignature}<${attrsType}>, {}>`;
|
|
21568
21490
|
yield `{} as ${`${ctx.localTypes.TypePropsToOption}<${propsType}>`}`;
|
|
21569
21491
|
});
|
|
21570
21492
|
typeOptionGenerates.push(function* () {
|
|
21571
21493
|
yield `{} as ${attrsType}`;
|
|
21572
21494
|
});
|
|
21573
21495
|
}
|
|
21574
|
-
if (ctx.generatedTypes.has(names.PublicProps)) {
|
|
21496
|
+
if (ctx.generatedTypes.has(names_1.names.PublicProps)) {
|
|
21575
21497
|
if (options.vueCompilerOptions.target < 3.6) optionGenerates.push(function* () {
|
|
21576
|
-
let propsType = `${ctx.localTypes.TypePropsToOption}<${names.PublicProps}>`;
|
|
21577
|
-
if (scriptSetupRanges.withDefaults?.arg) propsType = `${ctx.localTypes.WithDefaults}<${propsType}, typeof ${names.defaults}>`;
|
|
21498
|
+
let propsType = `${ctx.localTypes.TypePropsToOption}<${names_1.names.PublicProps}>`;
|
|
21499
|
+
if (scriptSetupRanges.withDefaults?.arg) propsType = `${ctx.localTypes.WithDefaults}<${propsType}, typeof ${names_1.names.defaults}>`;
|
|
21578
21500
|
yield `{} as ${propsType}`;
|
|
21579
21501
|
});
|
|
21580
21502
|
typeOptionGenerates.push(function* () {
|
|
21581
|
-
yield `{} as ${names.PublicProps}`;
|
|
21503
|
+
yield `{} as ${names_1.names.PublicProps}`;
|
|
21582
21504
|
});
|
|
21583
21505
|
}
|
|
21584
21506
|
if (scriptSetupRanges.defineProps?.arg) {
|
|
@@ -21589,7 +21511,7 @@ var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21589
21511
|
const useTypeOption = options.vueCompilerOptions.target >= 3.5 && typeOptionGenerates.length;
|
|
21590
21512
|
const useOption = (!useTypeOption || scriptSetupRanges.withDefaults) && optionGenerates.length;
|
|
21591
21513
|
if (useTypeOption) {
|
|
21592
|
-
if (options.vueCompilerOptions.target >= 3.6 && scriptSetupRanges.withDefaults?.arg) yield `__defaults: ${names.defaults},${utils_1.newLine}`;
|
|
21514
|
+
if (options.vueCompilerOptions.target >= 3.6 && scriptSetupRanges.withDefaults?.arg) yield `__defaults: ${names_1.names.defaults},${utils_1.newLine}`;
|
|
21593
21515
|
yield `__typeProps: `;
|
|
21594
21516
|
yield* (0, merge_1.generateSpreadMerge)(typeOptionGenerates.map((g) => g()));
|
|
21595
21517
|
yield `,${utils_1.newLine}`;
|
|
@@ -21604,54 +21526,13 @@ var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21604
21526
|
//#endregion
|
|
21605
21527
|
//#region node_modules/@vue/language-core/lib/codegen/script/scriptSetup.js
|
|
21606
21528
|
var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
21607
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
21608
|
-
if (k2 === void 0) k2 = k;
|
|
21609
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21610
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
21611
|
-
enumerable: true,
|
|
21612
|
-
get: function() {
|
|
21613
|
-
return m[k];
|
|
21614
|
-
}
|
|
21615
|
-
};
|
|
21616
|
-
Object.defineProperty(o, k2, desc);
|
|
21617
|
-
}) : (function(o, m, k, k2) {
|
|
21618
|
-
if (k2 === void 0) k2 = k;
|
|
21619
|
-
o[k2] = m[k];
|
|
21620
|
-
}));
|
|
21621
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
21622
|
-
Object.defineProperty(o, "default", {
|
|
21623
|
-
enumerable: true,
|
|
21624
|
-
value: v
|
|
21625
|
-
});
|
|
21626
|
-
}) : function(o, v) {
|
|
21627
|
-
o["default"] = v;
|
|
21628
|
-
});
|
|
21629
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
21630
|
-
var ownKeys = function(o) {
|
|
21631
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
21632
|
-
var ar = [];
|
|
21633
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
21634
|
-
return ar;
|
|
21635
|
-
};
|
|
21636
|
-
return ownKeys(o);
|
|
21637
|
-
};
|
|
21638
|
-
return function(mod) {
|
|
21639
|
-
if (mod && mod.__esModule) return mod;
|
|
21640
|
-
var result = {};
|
|
21641
|
-
if (mod != null) {
|
|
21642
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
21643
|
-
}
|
|
21644
|
-
__setModuleDefault(result, mod);
|
|
21645
|
-
return result;
|
|
21646
|
-
};
|
|
21647
|
-
})();
|
|
21648
21529
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21649
21530
|
exports.generateScriptSetupImports = generateScriptSetupImports;
|
|
21650
21531
|
exports.generateGeneric = generateGeneric;
|
|
21651
21532
|
exports.generateSetupFunction = generateSetupFunction;
|
|
21652
21533
|
var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
|
|
21653
21534
|
var codeFeatures_1 = require_codeFeatures();
|
|
21654
|
-
var
|
|
21535
|
+
var names_1 = require_names();
|
|
21655
21536
|
var utils_1 = require_utils$4();
|
|
21656
21537
|
var boundary_1 = require_boundary();
|
|
21657
21538
|
var camelized_1 = require_camelized();
|
|
@@ -21678,84 +21559,84 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21678
21559
|
if (!generic.text.endsWith(`,`)) yield `,`;
|
|
21679
21560
|
yield `>`;
|
|
21680
21561
|
}
|
|
21681
|
-
yield `(${utils_1.newLine} ${names.props}: NonNullable<Awaited<typeof ${names.setup}>>['props'],${utils_1.newLine} ${names.ctx}?: ${ctx.localTypes.PrettifyLocal}<Pick<NonNullable<Awaited<typeof ${names.setup}>>, 'attrs' | 'emit' | 'slots'>>,${utils_1.newLine} ${names.exposed}?: NonNullable<Awaited<typeof ${names.setup}>>['expose'],${utils_1.newLine} ${names.setup} = (async () => {${utils_1.newLine}`;
|
|
21562
|
+
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}`;
|
|
21682
21563
|
yield* body;
|
|
21683
21564
|
const propTypes = [];
|
|
21684
21565
|
const emitTypes = [];
|
|
21685
21566
|
const { vueCompilerOptions } = options;
|
|
21686
|
-
if (ctx.generatedTypes.has(names.PublicProps)) propTypes.push(names.PublicProps);
|
|
21567
|
+
if (ctx.generatedTypes.has(names_1.names.PublicProps)) propTypes.push(names_1.names.PublicProps);
|
|
21687
21568
|
if (scriptSetupRanges.defineProps?.arg) {
|
|
21688
|
-
yield `const
|
|
21569
|
+
yield `const ${names_1.names.propsOption} = `;
|
|
21689
21570
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, scriptSetupRanges.defineProps.arg.start, scriptSetupRanges.defineProps.arg.end, codeFeatures_1.codeFeatures.navigation);
|
|
21690
21571
|
yield utils_1.endOfLine;
|
|
21691
|
-
propTypes.push(`import('${vueCompilerOptions.lib}').${vueCompilerOptions.target >= 3.3 ? `ExtractPublicPropTypes` : `ExtractPropTypes`}<typeof
|
|
21572
|
+
propTypes.push(`import('${vueCompilerOptions.lib}').${vueCompilerOptions.target >= 3.3 ? `ExtractPublicPropTypes` : `ExtractPropTypes`}<typeof ${names_1.names.propsOption}>`);
|
|
21692
21573
|
}
|
|
21693
|
-
if (scriptSetupRanges.defineEmits || scriptSetupRanges.defineModel.length) propTypes.push(names.EmitProps);
|
|
21694
|
-
if (options.templateAndStyleTypes.has(names.InheritedAttrs)) propTypes.push(names.InheritedAttrs);
|
|
21695
|
-
if (scriptSetupRanges.defineEmits) emitTypes.push(`typeof ${scriptSetupRanges.defineEmits.name ?? names.emit}`);
|
|
21696
|
-
if (scriptSetupRanges.defineModel.length) emitTypes.push(`typeof ${names.modelEmit}`);
|
|
21574
|
+
if (scriptSetupRanges.defineEmits || scriptSetupRanges.defineModel.length) propTypes.push(names_1.names.EmitProps);
|
|
21575
|
+
if (options.templateAndStyleTypes.has(names_1.names.InheritedAttrs)) propTypes.push(names_1.names.InheritedAttrs);
|
|
21576
|
+
if (scriptSetupRanges.defineEmits) emitTypes.push(`typeof ${scriptSetupRanges.defineEmits.name ?? names_1.names.emit}`);
|
|
21577
|
+
if (scriptSetupRanges.defineModel.length) emitTypes.push(`typeof ${names_1.names.modelEmit}`);
|
|
21697
21578
|
yield `return {} as {${utils_1.newLine}`;
|
|
21698
21579
|
yield ` props: `;
|
|
21699
21580
|
yield vueCompilerOptions.target >= 3.4 ? `import('${vueCompilerOptions.lib}').PublicProps` : vueCompilerOptions.target >= 3 ? `import('${vueCompilerOptions.lib}').VNodeProps & import('${vueCompilerOptions.lib}').AllowedComponentProps & import('${vueCompilerOptions.lib}').ComponentCustomProps` : `globalThis.JSX.IntrinsicAttributes`;
|
|
21700
21581
|
if (propTypes.length) yield ` & ${ctx.localTypes.PrettifyLocal}<${propTypes.join(` & `)}>`;
|
|
21701
21582
|
yield ` & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P } ? P : {})${utils_1.endOfLine}`;
|
|
21702
21583
|
yield ` expose: (exposed: `;
|
|
21703
|
-
yield scriptSetupRanges.defineExpose ? `import('${vueCompilerOptions.lib}').ShallowUnwrapRef<typeof ${names.exposed}>` : `{}`;
|
|
21704
|
-
if (options.vueCompilerOptions.inferComponentDollarRefs && options.templateAndStyleTypes.has(names.TemplateRefs)) yield ` & { $refs: ${names.TemplateRefs}; }`;
|
|
21705
|
-
if (options.vueCompilerOptions.inferComponentDollarEl && options.templateAndStyleTypes.has(names.RootEl)) yield ` & { $el: ${names.RootEl}; }`;
|
|
21584
|
+
yield scriptSetupRanges.defineExpose ? `import('${vueCompilerOptions.lib}').ShallowUnwrapRef<typeof ${names_1.names.exposed}>` : `{}`;
|
|
21585
|
+
if (options.vueCompilerOptions.inferComponentDollarRefs && options.templateAndStyleTypes.has(names_1.names.TemplateRefs)) yield ` & { $refs: ${names_1.names.TemplateRefs}; }`;
|
|
21586
|
+
if (options.vueCompilerOptions.inferComponentDollarEl && options.templateAndStyleTypes.has(names_1.names.RootEl)) yield ` & { $el: ${names_1.names.RootEl}; }`;
|
|
21706
21587
|
yield `) => void${utils_1.endOfLine}`;
|
|
21707
21588
|
yield ` attrs: any${utils_1.endOfLine}`;
|
|
21708
|
-
yield ` slots: ${hasSlotsType(options) ? names.Slots : `{}`}${utils_1.endOfLine}`;
|
|
21589
|
+
yield ` slots: ${hasSlotsType(options) ? names_1.names.Slots : `{}`}${utils_1.endOfLine}`;
|
|
21709
21590
|
yield ` emit: ${emitTypes.length ? emitTypes.join(` & `) : `{}`}${utils_1.endOfLine}`;
|
|
21710
21591
|
yield `}${utils_1.endOfLine}`;
|
|
21711
21592
|
yield `})(),${utils_1.newLine}`;
|
|
21712
|
-
yield `) => ({} as import('${vueCompilerOptions.lib}').VNode & { __ctx?: Awaited<typeof ${names.setup}> }))${utils_1.endOfLine}`;
|
|
21593
|
+
yield `) => ({} as import('${vueCompilerOptions.lib}').VNode & { __ctx?: Awaited<typeof ${names_1.names.setup}> }))${utils_1.endOfLine}`;
|
|
21713
21594
|
}
|
|
21714
21595
|
function* generateSetupFunction(options, ctx, scriptSetup, scriptSetupRanges, body, output) {
|
|
21715
21596
|
const transforms = [];
|
|
21716
21597
|
if (scriptSetupRanges.defineProps) {
|
|
21717
21598
|
const { name, statement, callExp, typeArg } = scriptSetupRanges.defineProps;
|
|
21718
21599
|
const _callExp = scriptSetupRanges.withDefaults?.callExp ?? callExp;
|
|
21719
|
-
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, _callExp, typeArg, name, names.props, names.Props));
|
|
21600
|
+
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, _callExp, typeArg, name, names_1.names.props, names_1.names.Props));
|
|
21720
21601
|
}
|
|
21721
21602
|
if (scriptSetupRanges.defineEmits) {
|
|
21722
21603
|
const { name, statement, callExp, typeArg } = scriptSetupRanges.defineEmits;
|
|
21723
|
-
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, callExp, typeArg, name, names.emit, names.Emit));
|
|
21604
|
+
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, callExp, typeArg, name, names_1.names.emit, names_1.names.Emit));
|
|
21724
21605
|
}
|
|
21725
21606
|
if (scriptSetupRanges.defineSlots) {
|
|
21726
21607
|
const { name, statement, callExp, typeArg } = scriptSetupRanges.defineSlots;
|
|
21727
|
-
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, callExp, typeArg, name, names.slots, names.Slots));
|
|
21608
|
+
transforms.push(...generateDefineWithTypeTransforms(scriptSetup, statement, callExp, typeArg, name, names_1.names.slots, names_1.names.Slots));
|
|
21728
21609
|
}
|
|
21729
21610
|
if (scriptSetupRanges.defineExpose) {
|
|
21730
21611
|
const { callExp, arg, typeArg } = scriptSetupRanges.defineExpose;
|
|
21731
21612
|
if (typeArg) transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21732
|
-
yield `let ${names.exposed}!: `;
|
|
21613
|
+
yield `let ${names_1.names.exposed}!: `;
|
|
21733
21614
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, typeArg.start, typeArg.end, codeFeatures_1.codeFeatures.all);
|
|
21734
21615
|
yield utils_1.endOfLine;
|
|
21735
21616
|
}), (0, transform_1.replace)(typeArg.start, typeArg.end, function* () {
|
|
21736
|
-
yield `typeof ${names.exposed}`;
|
|
21617
|
+
yield `typeof ${names_1.names.exposed}`;
|
|
21737
21618
|
}));
|
|
21738
21619
|
else if (arg) transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21739
|
-
yield `const ${names.exposed} = `;
|
|
21620
|
+
yield `const ${names_1.names.exposed} = `;
|
|
21740
21621
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, arg.start, arg.end, codeFeatures_1.codeFeatures.all);
|
|
21741
21622
|
yield utils_1.endOfLine;
|
|
21742
21623
|
}), (0, transform_1.replace)(arg.start, arg.end, function* () {
|
|
21743
|
-
yield
|
|
21624
|
+
yield names_1.names.exposed;
|
|
21744
21625
|
}));
|
|
21745
21626
|
else transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21746
|
-
yield `const ${names.exposed} = {}${utils_1.endOfLine}`;
|
|
21627
|
+
yield `const ${names_1.names.exposed} = {}${utils_1.endOfLine}`;
|
|
21747
21628
|
}));
|
|
21748
21629
|
}
|
|
21749
21630
|
if (options.vueCompilerOptions.inferTemplateDollarAttrs) for (const { callExp } of scriptSetupRanges.useAttrs) transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21750
21631
|
yield `(`;
|
|
21751
21632
|
}), (0, transform_1.insert)(callExp.end, function* () {
|
|
21752
|
-
yield ` as typeof ${names.dollars}.$attrs)`;
|
|
21633
|
+
yield ` as typeof ${names_1.names.dollars}.$attrs)`;
|
|
21753
21634
|
}));
|
|
21754
21635
|
for (const { callExp, exp, arg } of scriptSetupRanges.useCssModule) {
|
|
21755
21636
|
transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21756
21637
|
yield `(`;
|
|
21757
21638
|
}));
|
|
21758
|
-
const type = options.templateAndStyleTypes.has(names.StyleModules) ? names.StyleModules : `{}`;
|
|
21639
|
+
const type = options.templateAndStyleTypes.has(names_1.names.StyleModules) ? names_1.names.StyleModules : `{}`;
|
|
21759
21640
|
if (arg) transforms.push((0, transform_1.insert)(callExp.end, function* () {
|
|
21760
21641
|
yield ` as Omit<${type}, '$style'>[`;
|
|
21761
21642
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, arg.start, arg.end, codeFeatures_1.codeFeatures.withoutSemantic);
|
|
@@ -21774,7 +21655,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21774
21655
|
if (options.vueCompilerOptions.inferTemplateDollarSlots) for (const { callExp } of scriptSetupRanges.useSlots) transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
21775
21656
|
yield `(`;
|
|
21776
21657
|
}), (0, transform_1.insert)(callExp.end, function* () {
|
|
21777
|
-
yield ` as typeof ${names.dollars}.$slots)`;
|
|
21658
|
+
yield ` as typeof ${names_1.names.dollars}.$slots)`;
|
|
21778
21659
|
}));
|
|
21779
21660
|
for (const { callExp, arg } of scriptSetupRanges.useTemplateRef) {
|
|
21780
21661
|
transforms.push((0, transform_1.insert)(callExp.start, function* () {
|
|
@@ -21782,7 +21663,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21782
21663
|
}), (0, transform_1.insert)(callExp.end, function* () {
|
|
21783
21664
|
yield ` as Readonly<import('${options.vueCompilerOptions.lib}').ShallowRef<`;
|
|
21784
21665
|
if (arg) {
|
|
21785
|
-
yield names.TemplateRefs;
|
|
21666
|
+
yield names_1.names.TemplateRefs;
|
|
21786
21667
|
yield `[`;
|
|
21787
21668
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, arg.start, arg.end, codeFeatures_1.codeFeatures.withoutSemantic);
|
|
21788
21669
|
yield `]`;
|
|
@@ -21799,11 +21680,11 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21799
21680
|
yield* generatePublicProps(options, ctx, scriptSetup, scriptSetupRanges);
|
|
21800
21681
|
yield* body;
|
|
21801
21682
|
if (output) if (hasSlotsType(options)) {
|
|
21802
|
-
yield `const
|
|
21683
|
+
yield `const ${names_1.names.base} = `;
|
|
21803
21684
|
yield* (0, component_1.generateComponent)(options, ctx, scriptSetup, scriptSetupRanges);
|
|
21804
21685
|
yield utils_1.endOfLine;
|
|
21805
21686
|
yield* output;
|
|
21806
|
-
yield `{} as ${ctx.localTypes.WithSlots}<typeof
|
|
21687
|
+
yield `{} as ${ctx.localTypes.WithSlots}<typeof ${names_1.names.base}, ${names_1.names.Slots}>${utils_1.endOfLine}`;
|
|
21807
21688
|
} else {
|
|
21808
21689
|
yield* output;
|
|
21809
21690
|
yield* (0, component_1.generateComponent)(options, ctx, scriptSetup, scriptSetupRanges);
|
|
@@ -21863,21 +21744,21 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21863
21744
|
}
|
|
21864
21745
|
function* generatePublicProps(options, ctx, scriptSetup, scriptSetupRanges) {
|
|
21865
21746
|
if (scriptSetupRanges.defineProps?.typeArg && scriptSetupRanges.withDefaults?.arg) {
|
|
21866
|
-
yield `const ${names.defaults} = `;
|
|
21747
|
+
yield `const ${names_1.names.defaults} = `;
|
|
21867
21748
|
yield* (0, utils_1.generateSfcBlockSection)(scriptSetup, scriptSetupRanges.withDefaults.arg.start, scriptSetupRanges.withDefaults.arg.end, codeFeatures_1.codeFeatures.navigation);
|
|
21868
21749
|
yield utils_1.endOfLine;
|
|
21869
21750
|
}
|
|
21870
21751
|
const propTypes = [];
|
|
21871
|
-
if (options.vueCompilerOptions.jsxSlots && hasSlotsType(options)) propTypes.push(`${ctx.localTypes.PropsChildren}<${names.Slots}>`);
|
|
21872
|
-
if (scriptSetupRanges.defineProps?.typeArg) propTypes.push(names.Props);
|
|
21873
|
-
if (scriptSetupRanges.defineModel.length) propTypes.push(names.ModelProps);
|
|
21752
|
+
if (options.vueCompilerOptions.jsxSlots && hasSlotsType(options)) propTypes.push(`${ctx.localTypes.PropsChildren}<${names_1.names.Slots}>`);
|
|
21753
|
+
if (scriptSetupRanges.defineProps?.typeArg) propTypes.push(names_1.names.Props);
|
|
21754
|
+
if (scriptSetupRanges.defineModel.length) propTypes.push(names_1.names.ModelProps);
|
|
21874
21755
|
if (propTypes.length) {
|
|
21875
|
-
yield `type ${names.PublicProps} = ${propTypes.join(` & `)}${utils_1.endOfLine}`;
|
|
21876
|
-
ctx.generatedTypes.add(names.PublicProps);
|
|
21756
|
+
yield `type ${names_1.names.PublicProps} = ${propTypes.join(` & `)}${utils_1.endOfLine}`;
|
|
21757
|
+
ctx.generatedTypes.add(names_1.names.PublicProps);
|
|
21877
21758
|
}
|
|
21878
21759
|
}
|
|
21879
21760
|
function hasSlotsType(options) {
|
|
21880
|
-
return !!(options.scriptSetupRanges?.defineSlots || options.templateAndStyleTypes.has(names.Slots));
|
|
21761
|
+
return !!(options.scriptSetupRanges?.defineSlots || options.templateAndStyleTypes.has(names_1.names.Slots));
|
|
21881
21762
|
}
|
|
21882
21763
|
function* generateModels(scriptSetup, scriptSetupRanges) {
|
|
21883
21764
|
if (!scriptSetupRanges.defineModel.length) return;
|
|
@@ -21889,24 +21770,24 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21889
21770
|
let modelType;
|
|
21890
21771
|
if (defineModel.type) modelType = getRangeText(scriptSetup, defineModel.type);
|
|
21891
21772
|
else if (defineModel.runtimeType && defineModel.localName) modelType = `typeof ${getRangeText(scriptSetup, defineModel.localName)}['value']`;
|
|
21892
|
-
else if (defineModel.defaultValue && propName) modelType = `typeof ${names.defaultModels}['${propName}']`;
|
|
21773
|
+
else if (defineModel.defaultValue && propName) modelType = `typeof ${names_1.names.defaultModels}['${propName}']`;
|
|
21893
21774
|
else modelType = `any`;
|
|
21894
21775
|
if (defineModel.defaultValue) defaultCodes.push(`'${propName}': ${getRangeText(scriptSetup, defineModel.defaultValue)},${utils_1.newLine}`);
|
|
21895
21776
|
propCodes.push(generateModelProp(scriptSetup, defineModel, propName, modelType));
|
|
21896
21777
|
emitCodes.push(generateModelEmit(defineModel, propName, modelType));
|
|
21897
21778
|
}
|
|
21898
21779
|
if (defaultCodes.length) {
|
|
21899
|
-
yield `const ${names.defaultModels} = {${utils_1.newLine}`;
|
|
21780
|
+
yield `const ${names_1.names.defaultModels} = {${utils_1.newLine}`;
|
|
21900
21781
|
yield* defaultCodes;
|
|
21901
21782
|
yield `}${utils_1.endOfLine}`;
|
|
21902
21783
|
}
|
|
21903
|
-
yield `type ${names.ModelProps} = {${utils_1.newLine}`;
|
|
21784
|
+
yield `type ${names_1.names.ModelProps} = {${utils_1.newLine}`;
|
|
21904
21785
|
for (const codes of propCodes) yield* codes;
|
|
21905
21786
|
yield `}${utils_1.endOfLine}`;
|
|
21906
|
-
yield `type ${names.ModelEmit} = {${utils_1.newLine}`;
|
|
21787
|
+
yield `type ${names_1.names.ModelEmit} = {${utils_1.newLine}`;
|
|
21907
21788
|
for (const codes of emitCodes) yield* codes;
|
|
21908
21789
|
yield `}${utils_1.endOfLine}`;
|
|
21909
|
-
yield `let ${names.modelEmit}!:
|
|
21790
|
+
yield `let ${names_1.names.modelEmit}!: ${names_1.names.ShortEmits}<${names_1.names.ModelEmit}>${utils_1.endOfLine}`;
|
|
21910
21791
|
}
|
|
21911
21792
|
function* generateModelProp(scriptSetup, defineModel, propName, modelType) {
|
|
21912
21793
|
if (defineModel.comments) {
|
|
@@ -21933,51 +21814,10 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21933
21814
|
//#endregion
|
|
21934
21815
|
//#region node_modules/@vue/language-core/lib/codegen/script/template.js
|
|
21935
21816
|
var require_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
21936
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
21937
|
-
if (k2 === void 0) k2 = k;
|
|
21938
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21939
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
21940
|
-
enumerable: true,
|
|
21941
|
-
get: function() {
|
|
21942
|
-
return m[k];
|
|
21943
|
-
}
|
|
21944
|
-
};
|
|
21945
|
-
Object.defineProperty(o, k2, desc);
|
|
21946
|
-
}) : (function(o, m, k, k2) {
|
|
21947
|
-
if (k2 === void 0) k2 = k;
|
|
21948
|
-
o[k2] = m[k];
|
|
21949
|
-
}));
|
|
21950
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
21951
|
-
Object.defineProperty(o, "default", {
|
|
21952
|
-
enumerable: true,
|
|
21953
|
-
value: v
|
|
21954
|
-
});
|
|
21955
|
-
}) : function(o, v) {
|
|
21956
|
-
o["default"] = v;
|
|
21957
|
-
});
|
|
21958
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
21959
|
-
var ownKeys = function(o) {
|
|
21960
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
21961
|
-
var ar = [];
|
|
21962
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
21963
|
-
return ar;
|
|
21964
|
-
};
|
|
21965
|
-
return ownKeys(o);
|
|
21966
|
-
};
|
|
21967
|
-
return function(mod) {
|
|
21968
|
-
if (mod && mod.__esModule) return mod;
|
|
21969
|
-
var result = {};
|
|
21970
|
-
if (mod != null) {
|
|
21971
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
21972
|
-
}
|
|
21973
|
-
__setModuleDefault(result, mod);
|
|
21974
|
-
return result;
|
|
21975
|
-
};
|
|
21976
|
-
})();
|
|
21977
21817
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21978
21818
|
exports.generateTemplate = generateTemplate;
|
|
21979
21819
|
var codeFeatures_1 = require_codeFeatures();
|
|
21980
|
-
var
|
|
21820
|
+
var names_1 = require_names();
|
|
21981
21821
|
var utils_1 = require_utils$4();
|
|
21982
21822
|
var merge_1 = require_merge();
|
|
21983
21823
|
function* generateTemplate(options, ctx, selfType) {
|
|
@@ -21992,62 +21832,59 @@ var require_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
21992
21832
|
const emitTypes = [];
|
|
21993
21833
|
const propTypes = [];
|
|
21994
21834
|
if (vueCompilerOptions.petiteVueExtensions.some((ext) => fileName.endsWith(ext))) exps.push([`globalThis`]);
|
|
21995
|
-
if (selfType) exps.push([`{} as InstanceType<
|
|
21835
|
+
if (selfType) exps.push([`{} as InstanceType<${names_1.names.PickNotAny}<typeof ${selfType}, new () => {}>>`]);
|
|
21996
21836
|
else exps.push([`{} as import('${vueCompilerOptions.lib}').ComponentPublicInstance`]);
|
|
21997
|
-
if (templateAndStyleTypes.has(names.StyleModules)) exps.push([`{} as ${names.StyleModules}`]);
|
|
21998
|
-
if (scriptSetupRanges?.defineEmits) {
|
|
21999
|
-
|
|
22000
|
-
emitTypes.push(`typeof ${defineEmits.name ?? names.emit}`);
|
|
22001
|
-
}
|
|
22002
|
-
if (scriptSetupRanges?.defineModel.length) emitTypes.push(`typeof ${names.modelEmit}`);
|
|
21837
|
+
if (templateAndStyleTypes.has(names_1.names.StyleModules)) exps.push([`{} as ${names_1.names.StyleModules}`]);
|
|
21838
|
+
if (scriptSetupRanges?.defineEmits) emitTypes.push(`typeof ${scriptSetupRanges.defineEmits.name ?? names_1.names.emit}`);
|
|
21839
|
+
if (scriptSetupRanges?.defineModel.length) emitTypes.push(`typeof ${names_1.names.modelEmit}`);
|
|
22003
21840
|
if (emitTypes.length) {
|
|
22004
|
-
yield `type ${names.EmitProps} =
|
|
21841
|
+
yield `type ${names_1.names.EmitProps} = ${names_1.names.EmitsToProps}<${names_1.names.NormalizeEmits}<${emitTypes.join(` & `)}>>${utils_1.endOfLine}`;
|
|
22005
21842
|
exps.push([`{} as { $emit: ${emitTypes.join(` & `)} }`]);
|
|
22006
21843
|
}
|
|
22007
|
-
if (scriptSetupRanges?.defineProps) propTypes.push(`typeof ${scriptSetupRanges.defineProps.name ?? names.props}`);
|
|
22008
|
-
if (scriptSetupRanges?.defineModel.length) propTypes.push(names.ModelProps);
|
|
22009
|
-
if (emitTypes.length) propTypes.push(names.EmitProps);
|
|
21844
|
+
if (scriptSetupRanges?.defineProps) propTypes.push(`typeof ${scriptSetupRanges.defineProps.name ?? names_1.names.props}`);
|
|
21845
|
+
if (scriptSetupRanges?.defineModel.length) propTypes.push(names_1.names.ModelProps);
|
|
21846
|
+
if (emitTypes.length) propTypes.push(names_1.names.EmitProps);
|
|
22010
21847
|
if (propTypes.length) {
|
|
22011
21848
|
exps.push([`{} as { $props: ${propTypes.join(` & `)} }`]);
|
|
22012
21849
|
exps.push([`{} as ${propTypes.join(` & `)}`]);
|
|
22013
21850
|
}
|
|
22014
|
-
if (ctx.generatedTypes.has(names.SetupExposed)) exps.push([`{} as ${names.SetupExposed}`]);
|
|
22015
|
-
yield `const ${names.ctx} = `;
|
|
21851
|
+
if (ctx.generatedTypes.has(names_1.names.SetupExposed)) exps.push([`{} as ${names_1.names.SetupExposed}`]);
|
|
21852
|
+
yield `const ${names_1.names.ctx} = `;
|
|
22016
21853
|
yield* (0, merge_1.generateSpreadMerge)(exps);
|
|
22017
21854
|
yield utils_1.endOfLine;
|
|
22018
21855
|
}
|
|
22019
21856
|
function* generateTemplateComponents({ vueCompilerOptions, script, scriptRanges }, ctx) {
|
|
22020
21857
|
const types = [];
|
|
22021
|
-
if (ctx.generatedTypes.has(names.SetupExposed)) types.push(names.SetupExposed);
|
|
21858
|
+
if (ctx.generatedTypes.has(names_1.names.SetupExposed)) types.push(names_1.names.SetupExposed);
|
|
22022
21859
|
if (script && scriptRanges?.exportDefault?.options?.components) {
|
|
22023
21860
|
const { components } = scriptRanges.exportDefault.options;
|
|
22024
|
-
yield `const
|
|
21861
|
+
yield `const ${names_1.names.componentsOption} = `;
|
|
22025
21862
|
yield* (0, utils_1.generateSfcBlockSection)(script, components.start, components.end, codeFeatures_1.codeFeatures.navigation);
|
|
22026
21863
|
yield utils_1.endOfLine;
|
|
22027
|
-
types.push(`typeof
|
|
21864
|
+
types.push(`typeof ${names_1.names.componentsOption}`);
|
|
22028
21865
|
}
|
|
22029
|
-
yield `type
|
|
22030
|
-
yield `type
|
|
22031
|
-
yield `let ${names.components}!:
|
|
22032
|
-
yield `let ${names.intrinsics}!: ${vueCompilerOptions.target >= 3.3 ? `import('${vueCompilerOptions.lib}/jsx-runtime').JSX.IntrinsicElements` : `globalThis.JSX.IntrinsicElements`}${utils_1.endOfLine}`;
|
|
21866
|
+
yield `type ${names_1.names.LocalComponents} = ${types.length ? types.join(` & `) : `{}`}${utils_1.endOfLine}`;
|
|
21867
|
+
yield `type ${names_1.names.GlobalComponents} = ${vueCompilerOptions.target >= 3.5 ? `import('${vueCompilerOptions.lib}').GlobalComponents` : `import('${vueCompilerOptions.lib}').GlobalComponents & Pick<typeof import('${vueCompilerOptions.lib}'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>`}${utils_1.endOfLine}`;
|
|
21868
|
+
yield `let ${names_1.names.components}!: ${names_1.names.LocalComponents} & ${names_1.names.GlobalComponents}${utils_1.endOfLine}`;
|
|
21869
|
+
yield `let ${names_1.names.intrinsics}!: ${vueCompilerOptions.target >= 3.3 ? `import('${vueCompilerOptions.lib}/jsx-runtime').JSX.IntrinsicElements` : `globalThis.JSX.IntrinsicElements`}${utils_1.endOfLine}`;
|
|
22033
21870
|
}
|
|
22034
21871
|
function* generateTemplateDirectives({ vueCompilerOptions, script, scriptRanges }, ctx) {
|
|
22035
21872
|
const types = [];
|
|
22036
|
-
if (ctx.generatedTypes.has(names.SetupExposed)) types.push(names.SetupExposed);
|
|
21873
|
+
if (ctx.generatedTypes.has(names_1.names.SetupExposed)) types.push(names_1.names.SetupExposed);
|
|
22037
21874
|
if (script && scriptRanges?.exportDefault?.options?.directives) {
|
|
22038
21875
|
const { directives } = scriptRanges.exportDefault.options;
|
|
22039
|
-
yield `const
|
|
21876
|
+
yield `const ${names_1.names.directivesOption} = `;
|
|
22040
21877
|
yield* (0, utils_1.generateSfcBlockSection)(script, directives.start, directives.end, codeFeatures_1.codeFeatures.navigation);
|
|
22041
21878
|
yield utils_1.endOfLine;
|
|
22042
|
-
types.push(
|
|
21879
|
+
types.push(`${names_1.names.ResolveDirectives}<typeof ${names_1.names.directivesOption}>`);
|
|
22043
21880
|
}
|
|
22044
|
-
yield `type
|
|
22045
|
-
yield `let ${names.directives}!:
|
|
21881
|
+
yield `type ${names_1.names.LocalDirectives} = ${types.length ? types.join(` & `) : `{}`}${utils_1.endOfLine}`;
|
|
21882
|
+
yield `let ${names_1.names.directives}!: ${names_1.names.LocalDirectives} & import('${vueCompilerOptions.lib}').GlobalDirectives${utils_1.endOfLine}`;
|
|
22046
21883
|
}
|
|
22047
21884
|
function* generateSetupExposed({ vueCompilerOptions, exposed }, ctx) {
|
|
22048
21885
|
if (!exposed.size) return;
|
|
22049
|
-
ctx.generatedTypes.add(names.SetupExposed);
|
|
22050
|
-
yield `type ${names.SetupExposed} = import('${vueCompilerOptions.lib}').ShallowUnwrapRef<{${utils_1.newLine}`;
|
|
21886
|
+
ctx.generatedTypes.add(names_1.names.SetupExposed);
|
|
21887
|
+
yield `type ${names_1.names.SetupExposed} = import('${vueCompilerOptions.lib}').ShallowUnwrapRef<{${utils_1.newLine}`;
|
|
22051
21888
|
for (const bindingName of exposed) {
|
|
22052
21889
|
const token = Symbol(bindingName.length);
|
|
22053
21890
|
yield [
|
|
@@ -22117,13 +21954,13 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22117
21954
|
exports.generateScript = generate;
|
|
22118
21955
|
var path = __importStar(require_path_browserify());
|
|
22119
21956
|
var codeFeatures_1 = require_codeFeatures();
|
|
22120
|
-
var
|
|
21957
|
+
var names_1 = require_names();
|
|
22121
21958
|
var utils_1 = require_utils$4();
|
|
22122
21959
|
var boundary_1 = require_boundary();
|
|
22123
21960
|
var context_1 = require_context();
|
|
22124
21961
|
var scriptSetup_1 = require_scriptSetup$1();
|
|
22125
21962
|
var template_1 = require_template();
|
|
22126
|
-
var exportExpression = `{} as typeof ${names.
|
|
21963
|
+
var exportExpression = `{} as typeof ${names_1.names.export}`;
|
|
22127
21964
|
function generate(options) {
|
|
22128
21965
|
const ctx = (0, context_1.createScriptCodegenContext)(options);
|
|
22129
21966
|
const codeGenerator = generateWorker(options, ctx);
|
|
@@ -22139,7 +21976,7 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22139
21976
|
let src = script.src.text;
|
|
22140
21977
|
if (src.endsWith(".ts") && !src.endsWith(".d.ts")) src = src.slice(0, -3) + ".js";
|
|
22141
21978
|
else if (src.endsWith(".tsx")) src = src.slice(0, -4) + ".jsx";
|
|
22142
|
-
yield `import
|
|
21979
|
+
yield `import ${names_1.names.src} from `;
|
|
22143
21980
|
const token = yield* (0, boundary_1.startBoundary)("main", script.src.offset, {
|
|
22144
21981
|
...codeFeatures_1.codeFeatures.all,
|
|
22145
21982
|
...src !== script.src.text ? codeFeatures_1.codeFeatures.navigationWithoutRename : {}
|
|
@@ -22155,18 +21992,18 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22155
21992
|
yield `'`;
|
|
22156
21993
|
yield (0, boundary_1.endBoundary)(token, script.src.offset + script.src.text.length);
|
|
22157
21994
|
yield utils_1.endOfLine;
|
|
22158
|
-
yield `export default
|
|
22159
|
-
yield* (0, template_1.generateTemplate)(options, ctx,
|
|
21995
|
+
yield `export default ${names_1.names.src}${utils_1.endOfLine}`;
|
|
21996
|
+
yield* (0, template_1.generateTemplate)(options, ctx, names_1.names.src);
|
|
22160
21997
|
} else if (script && scriptRanges && scriptSetup && scriptSetupRanges) {
|
|
22161
21998
|
yield* (0, scriptSetup_1.generateScriptSetupImports)(scriptSetup, scriptSetupRanges);
|
|
22162
21999
|
let selfType;
|
|
22163
22000
|
const { exportDefault } = scriptRanges;
|
|
22164
|
-
if (exportDefault) yield* generateScriptWithExportDefault(ctx, script, scriptRanges, exportDefault, vueCompilerOptions, selfType =
|
|
22001
|
+
if (exportDefault) yield* generateScriptWithExportDefault(ctx, script, scriptRanges, exportDefault, vueCompilerOptions, selfType = names_1.names.self);
|
|
22165
22002
|
else {
|
|
22166
22003
|
yield* (0, utils_1.generateSfcBlockSection)(script, 0, script.content.length, codeFeatures_1.codeFeatures.all);
|
|
22167
22004
|
yield `export default ${exportExpression}${utils_1.endOfLine}`;
|
|
22168
22005
|
}
|
|
22169
|
-
yield* generateExportDeclareEqual(scriptSetup, names.
|
|
22006
|
+
yield* generateExportDeclareEqual(scriptSetup, names_1.names.export);
|
|
22170
22007
|
if (scriptSetup.generic) yield* (0, scriptSetup_1.generateGeneric)(options, ctx, scriptSetup, scriptSetupRanges, scriptSetup.generic, (0, scriptSetup_1.generateSetupFunction)(options, ctx, scriptSetup, scriptSetupRanges, (0, template_1.generateTemplate)(options, ctx, selfType)));
|
|
22171
22008
|
else {
|
|
22172
22009
|
yield `await (async () => {${utils_1.newLine}`;
|
|
@@ -22176,18 +22013,18 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22176
22013
|
} else if (scriptSetup && scriptSetupRanges) {
|
|
22177
22014
|
yield* (0, scriptSetup_1.generateScriptSetupImports)(scriptSetup, scriptSetupRanges);
|
|
22178
22015
|
if (scriptSetup.generic) {
|
|
22179
|
-
yield* generateExportDeclareEqual(scriptSetup, names.
|
|
22016
|
+
yield* generateExportDeclareEqual(scriptSetup, names_1.names.export);
|
|
22180
22017
|
yield* (0, scriptSetup_1.generateGeneric)(options, ctx, scriptSetup, scriptSetupRanges, scriptSetup.generic, (0, scriptSetup_1.generateSetupFunction)(options, ctx, scriptSetup, scriptSetupRanges, (0, template_1.generateTemplate)(options, ctx)));
|
|
22181
|
-
} else yield* (0, scriptSetup_1.generateSetupFunction)(options, ctx, scriptSetup, scriptSetupRanges, (0, template_1.generateTemplate)(options, ctx), generateExportDeclareEqual(scriptSetup, names.
|
|
22018
|
+
} else yield* (0, scriptSetup_1.generateSetupFunction)(options, ctx, scriptSetup, scriptSetupRanges, (0, template_1.generateTemplate)(options, ctx), generateExportDeclareEqual(scriptSetup, names_1.names.export));
|
|
22182
22019
|
yield `export default ${exportExpression}${utils_1.endOfLine}`;
|
|
22183
22020
|
} else if (script && scriptRanges) {
|
|
22184
22021
|
const { exportDefault } = scriptRanges;
|
|
22185
|
-
if (exportDefault) yield* generateScriptWithExportDefault(ctx, script, scriptRanges, exportDefault, vueCompilerOptions, names.
|
|
22022
|
+
if (exportDefault) yield* generateScriptWithExportDefault(ctx, script, scriptRanges, exportDefault, vueCompilerOptions, names_1.names.export, (0, template_1.generateTemplate)(options, ctx, names_1.names.export));
|
|
22186
22023
|
else {
|
|
22187
22024
|
yield* (0, utils_1.generateSfcBlockSection)(script, 0, script.content.length, codeFeatures_1.codeFeatures.all);
|
|
22188
|
-
yield* generateExportDeclareEqual(script, names.
|
|
22025
|
+
yield* generateExportDeclareEqual(script, names_1.names.export);
|
|
22189
22026
|
yield `(await import('${vueCompilerOptions.lib}')).defineComponent({})${utils_1.endOfLine}`;
|
|
22190
|
-
yield* (0, template_1.generateTemplate)(options, ctx, names.
|
|
22027
|
+
yield* (0, template_1.generateTemplate)(options, ctx, names_1.names.export);
|
|
22191
22028
|
yield `export default ${exportExpression}${utils_1.endOfLine}`;
|
|
22192
22029
|
}
|
|
22193
22030
|
}
|
|
@@ -22303,58 +22140,17 @@ var require_common$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22303
22140
|
//#endregion
|
|
22304
22141
|
//#region node_modules/@vue/language-core/lib/codegen/style/modules.js
|
|
22305
22142
|
var require_modules = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
22306
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
22307
|
-
if (k2 === void 0) k2 = k;
|
|
22308
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22309
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
22310
|
-
enumerable: true,
|
|
22311
|
-
get: function() {
|
|
22312
|
-
return m[k];
|
|
22313
|
-
}
|
|
22314
|
-
};
|
|
22315
|
-
Object.defineProperty(o, k2, desc);
|
|
22316
|
-
}) : (function(o, m, k, k2) {
|
|
22317
|
-
if (k2 === void 0) k2 = k;
|
|
22318
|
-
o[k2] = m[k];
|
|
22319
|
-
}));
|
|
22320
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
22321
|
-
Object.defineProperty(o, "default", {
|
|
22322
|
-
enumerable: true,
|
|
22323
|
-
value: v
|
|
22324
|
-
});
|
|
22325
|
-
}) : function(o, v) {
|
|
22326
|
-
o["default"] = v;
|
|
22327
|
-
});
|
|
22328
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
22329
|
-
var ownKeys = function(o) {
|
|
22330
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
22331
|
-
var ar = [];
|
|
22332
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22333
|
-
return ar;
|
|
22334
|
-
};
|
|
22335
|
-
return ownKeys(o);
|
|
22336
|
-
};
|
|
22337
|
-
return function(mod) {
|
|
22338
|
-
if (mod && mod.__esModule) return mod;
|
|
22339
|
-
var result = {};
|
|
22340
|
-
if (mod != null) {
|
|
22341
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
22342
|
-
}
|
|
22343
|
-
__setModuleDefault(result, mod);
|
|
22344
|
-
return result;
|
|
22345
|
-
};
|
|
22346
|
-
})();
|
|
22347
22143
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22348
22144
|
exports.generateStyleModules = generateStyleModules;
|
|
22349
22145
|
var codeFeatures_1 = require_codeFeatures();
|
|
22350
|
-
var
|
|
22146
|
+
var names_1 = require_names();
|
|
22351
22147
|
var utils_1 = require_utils$4();
|
|
22352
22148
|
var common_1 = require_common$2();
|
|
22353
22149
|
function* generateStyleModules({ styles, vueCompilerOptions }, ctx) {
|
|
22354
22150
|
const styleModules = styles.filter((style) => style.module);
|
|
22355
22151
|
if (!styleModules.length) return;
|
|
22356
|
-
ctx.generatedTypes.add(names.StyleModules);
|
|
22357
|
-
yield `type ${names.StyleModules} = {${utils_1.newLine}`;
|
|
22152
|
+
ctx.generatedTypes.add(names_1.names.StyleModules);
|
|
22153
|
+
yield `type ${names_1.names.StyleModules} = {${utils_1.newLine}`;
|
|
22358
22154
|
for (const style of styleModules) {
|
|
22359
22155
|
if (style.module === true) yield `$style`;
|
|
22360
22156
|
else {
|
|
@@ -22368,7 +22164,7 @@ var require_modules = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22368
22164
|
}
|
|
22369
22165
|
yield `: `;
|
|
22370
22166
|
if (!vueCompilerOptions.strictCssModules) yield `Record<string, string> & `;
|
|
22371
|
-
yield
|
|
22167
|
+
yield `${names_1.names.PrettifyGlobal}<{}`;
|
|
22372
22168
|
if (vueCompilerOptions.resolveStyleImports) yield* (0, common_1.generateStyleImports)(style);
|
|
22373
22169
|
for (const className of style.classNames) yield* (0, common_1.generateClassProperty)(style.name, className.text, className.offset, "string");
|
|
22374
22170
|
yield `>${utils_1.endOfLine}`;
|
|
@@ -22381,6 +22177,7 @@ var require_modules = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22381
22177
|
var require_scopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
22382
22178
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22383
22179
|
exports.generateStyleScopedClasses = generateStyleScopedClasses;
|
|
22180
|
+
var names_1 = require_names();
|
|
22384
22181
|
var styleScopedClasses_1 = require_styleScopedClasses();
|
|
22385
22182
|
var utils_1 = require_utils$4();
|
|
22386
22183
|
var common_1 = require_common$2();
|
|
@@ -22391,7 +22188,7 @@ var require_scopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22391
22188
|
if (!scopedStyles.length) return;
|
|
22392
22189
|
const visited = /* @__PURE__ */ new Set();
|
|
22393
22190
|
const deferredGenerations = [];
|
|
22394
|
-
yield `type
|
|
22191
|
+
yield `type ${names_1.names.StyleScopedClasses} = {}`;
|
|
22395
22192
|
for (const style of scopedStyles) {
|
|
22396
22193
|
if (resolveStyleImports) yield* (0, common_1.generateStyleImports)(style);
|
|
22397
22194
|
for (const className of style.classNames) if (!visited.has(className.text)) {
|
|
@@ -23036,16 +22833,11 @@ var require_vue_tsx = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23036
22833
|
allVars.add(name);
|
|
23037
22834
|
}
|
|
23038
22835
|
if (!allVars.size) return allVars;
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
for (const component of sfc.template?.ast?.components ?? []) {
|
|
23045
|
-
const testNames = new Set([(0, shared_1.camelize)(component), (0, shared_1.capitalize)((0, shared_1.camelize)(component))]);
|
|
23046
|
-
for (const testName of testNames) if (allVars.has(testName)) exposedNames.add(testName);
|
|
23047
|
-
}
|
|
23048
|
-
return exposedNames;
|
|
22836
|
+
return new Set([
|
|
22837
|
+
...getGeneratedTemplate()?.componentAccessMap.keys() ?? [],
|
|
22838
|
+
...getGeneratedStyle()?.componentAccessMap.keys() ?? [],
|
|
22839
|
+
...sfc.template?.ast?.components.flatMap((name) => [(0, shared_1.camelize)(name), (0, shared_1.capitalize)((0, shared_1.camelize)(name))]) ?? []
|
|
22840
|
+
].filter((name) => allVars.has(name)));
|
|
23049
22841
|
});
|
|
23050
22842
|
return {
|
|
23051
22843
|
getScriptRanges,
|
|
@@ -24095,36 +23887,9 @@ var require_language_core = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24095
23887
|
if (k2 === void 0) k2 = k;
|
|
24096
23888
|
o[k2] = m[k];
|
|
24097
23889
|
}));
|
|
24098
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
24099
|
-
Object.defineProperty(o, "default", {
|
|
24100
|
-
enumerable: true,
|
|
24101
|
-
value: v
|
|
24102
|
-
});
|
|
24103
|
-
}) : function(o, v) {
|
|
24104
|
-
o["default"] = v;
|
|
24105
|
-
});
|
|
24106
23890
|
var __exportStar = exports && exports.__exportStar || function(m, exports$7) {
|
|
24107
23891
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$7, p)) __createBinding(exports$7, m, p);
|
|
24108
23892
|
};
|
|
24109
|
-
var __importStar = exports && exports.__importStar || (function() {
|
|
24110
|
-
var ownKeys = function(o) {
|
|
24111
|
-
ownKeys = Object.getOwnPropertyNames || function(o) {
|
|
24112
|
-
var ar = [];
|
|
24113
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24114
|
-
return ar;
|
|
24115
|
-
};
|
|
24116
|
-
return ownKeys(o);
|
|
24117
|
-
};
|
|
24118
|
-
return function(mod) {
|
|
24119
|
-
if (mod && mod.__esModule) return mod;
|
|
24120
|
-
var result = {};
|
|
24121
|
-
if (mod != null) {
|
|
24122
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
24123
|
-
}
|
|
24124
|
-
__setModuleDefault(result, mod);
|
|
24125
|
-
return result;
|
|
24126
|
-
};
|
|
24127
|
-
})();
|
|
24128
23893
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24129
23894
|
exports.tsCodegen = exports.names = void 0;
|
|
24130
23895
|
__exportStar(require_template$1(), exports);
|
|
@@ -24139,7 +23904,13 @@ var require_language_core = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24139
23904
|
__exportStar(require_parseSfc(), exports);
|
|
24140
23905
|
__exportStar(require_shared$2(), exports);
|
|
24141
23906
|
__exportStar(require_virtualCode(), exports);
|
|
24142
|
-
|
|
23907
|
+
var names_1 = require_names();
|
|
23908
|
+
Object.defineProperty(exports, "names", {
|
|
23909
|
+
enumerable: true,
|
|
23910
|
+
get: function() {
|
|
23911
|
+
return names_1.names;
|
|
23912
|
+
}
|
|
23913
|
+
});
|
|
24143
23914
|
var vue_tsx_1 = require_vue_tsx();
|
|
24144
23915
|
Object.defineProperty(exports, "tsCodegen", {
|
|
24145
23916
|
enumerable: true,
|
|
@@ -84857,13 +84628,13 @@ var require_css = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
84857
84628
|
if (modulePathCache && baseUri.scheme === "file" && !ref.startsWith("./") && !ref.startsWith("../")) {
|
|
84858
84629
|
const map = modulePathCache;
|
|
84859
84630
|
if (!map.has(ref)) {
|
|
84860
|
-
const promise = resolveModuleName(baseUri.fsPath.replace(/\\/g, "/"), ref);
|
|
84631
|
+
const promise = resolveModuleName(baseUri.fsPath.replace(/\\/g, "/"), ref, true);
|
|
84861
84632
|
map.set(ref, promise);
|
|
84862
84633
|
if (promise instanceof Promise) promise.then((res) => map.set(ref, res));
|
|
84863
84634
|
}
|
|
84864
84635
|
const cached = modulePathCache.get(ref);
|
|
84865
84636
|
if (cached instanceof Promise) throw cached;
|
|
84866
|
-
if (cached) return cached;
|
|
84637
|
+
if (cached) return vscode_uri_1.URI.file(cached).toString();
|
|
84867
84638
|
}
|
|
84868
84639
|
return (0, volar_service_css_1.resolveReference)(ref, baseUri, context.env.workspaceFolders);
|
|
84869
84640
|
} };
|
|
@@ -112886,10 +112657,11 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
112886
112657
|
}
|
|
112887
112658
|
const cached = modulePathCache.get(ref);
|
|
112888
112659
|
if (cached instanceof Promise) throw cached;
|
|
112889
|
-
if (cached) return cached;
|
|
112660
|
+
if (cached) return vscode_uri_1.URI.file(cached).toString();
|
|
112890
112661
|
}
|
|
112891
112662
|
return (0, volar_service_html_1.resolveReference)(ref, baseUri, context.env.workspaceFolders);
|
|
112892
112663
|
} });
|
|
112664
|
+
const defaultHTMLProvider = html.getDefaultHTMLDataProvider();
|
|
112893
112665
|
const baseService = languageId === "jade" ? (0, volar_service_pug_1.create)({
|
|
112894
112666
|
useDefaultDataProvider: false,
|
|
112895
112667
|
getDocumentContext,
|
|
@@ -112939,28 +112711,7 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
112939
112711
|
const codegen = info && language_core_1.tsCodegen.get(info.root.sfc);
|
|
112940
112712
|
if (codegen) {
|
|
112941
112713
|
const componentNames = new Set([...codegen.getImportedComponents(), ...codegen.getSetupExposed()]);
|
|
112942
|
-
voidElements =
|
|
112943
|
-
"area",
|
|
112944
|
-
"base",
|
|
112945
|
-
"br",
|
|
112946
|
-
"col",
|
|
112947
|
-
"embed",
|
|
112948
|
-
"hr",
|
|
112949
|
-
"img",
|
|
112950
|
-
"input",
|
|
112951
|
-
"keygen",
|
|
112952
|
-
"link",
|
|
112953
|
-
"menuitem",
|
|
112954
|
-
"meta",
|
|
112955
|
-
"param",
|
|
112956
|
-
"source",
|
|
112957
|
-
"track",
|
|
112958
|
-
"wbr",
|
|
112959
|
-
"!doctype",
|
|
112960
|
-
"?xml",
|
|
112961
|
-
"basefont",
|
|
112962
|
-
"isindex"
|
|
112963
|
-
].filter((tag) => tag && !componentNames.has(tag) && !componentNames.has((0, shared_1.capitalize)((0, shared_1.camelize)(tag))));
|
|
112714
|
+
voidElements = defaultHTMLProvider.provideTags().filter((tag) => tag.void).map((tag) => tag.name).filter((tag) => !componentNames.has(tag) && !componentNames.has((0, shared_1.capitalize)(tag)));
|
|
112964
112715
|
}
|
|
112965
112716
|
return (0, htmlFormatter_1.format)(document, range, options, voidElements);
|
|
112966
112717
|
};
|
|
@@ -112972,7 +112723,7 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
112972
112723
|
const vModelModifiers = extractModelModifiers(modelData.globalAttributes);
|
|
112973
112724
|
const transformedItems = /* @__PURE__ */ new WeakSet();
|
|
112974
112725
|
const defaultHtmlTags = /* @__PURE__ */ new Map();
|
|
112975
|
-
for (const tag of
|
|
112726
|
+
for (const tag of defaultHTMLProvider.provideTags()) defaultHtmlTags.set(tag.name, tag);
|
|
112976
112727
|
let lastCompletionDocument;
|
|
112977
112728
|
return {
|
|
112978
112729
|
...baseServiceInstance,
|
|
@@ -113173,7 +112924,7 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
113173
112924
|
provideDocumentSymbols(document, token) {
|
|
113174
112925
|
if (document.languageId !== languageId) return;
|
|
113175
112926
|
if ((0, utils_1.resolveEmbeddedCode)(context, document.uri)?.code.id !== "template") return;
|
|
113176
|
-
updateExtraCustomData([
|
|
112927
|
+
updateExtraCustomData([defaultHTMLProvider]);
|
|
113177
112928
|
return baseServiceInstance.provideDocumentSymbols?.(document, token);
|
|
113178
112929
|
}
|
|
113179
112930
|
};
|
|
@@ -113680,17 +113431,12 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
113680
113431
|
case "getDefinitionAndBoundSpan": return getDefinitionAndBoundSpan(target[p]);
|
|
113681
113432
|
}
|
|
113682
113433
|
};
|
|
113683
|
-
return new Proxy(languageService, {
|
|
113684
|
-
|
|
113685
|
-
|
|
113686
|
-
|
|
113687
|
-
|
|
113688
|
-
|
|
113689
|
-
},
|
|
113690
|
-
set(target, p, value, receiver) {
|
|
113691
|
-
return Reflect.set(target, p, value, receiver);
|
|
113692
|
-
}
|
|
113693
|
-
});
|
|
113434
|
+
return new Proxy(languageService, { get(target, p, receiver) {
|
|
113435
|
+
if (!proxyCache.has(p)) proxyCache.set(p, getProxyMethod(target, p));
|
|
113436
|
+
const proxyMethod = proxyCache.get(p);
|
|
113437
|
+
if (proxyMethod) return proxyMethod;
|
|
113438
|
+
return Reflect.get(target, p, receiver);
|
|
113439
|
+
} });
|
|
113694
113440
|
function findReferences(findReferences) {
|
|
113695
113441
|
return (fileName, ...rest) => {
|
|
113696
113442
|
const result = findReferences(fileName, ...rest);
|
|
@@ -113971,10 +113717,10 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
113971
113717
|
node: components.node,
|
|
113972
113718
|
type: componentType
|
|
113973
113719
|
};
|
|
113974
|
-
} else if (getSelfComponentName(fileName) === (0, shared_1.capitalize)((0, shared_1.camelize)(tag))) return getVariableType(ts, checker, sourceFile, language_core_1.names.
|
|
113720
|
+
} else if (getSelfComponentName(fileName) === (0, shared_1.capitalize)((0, shared_1.camelize)(tag))) return getVariableType(ts, checker, sourceFile, language_core_1.names.export);
|
|
113975
113721
|
}
|
|
113976
113722
|
const selfName = getSelfComponentName(fileName);
|
|
113977
|
-
if (testNames.has(selfName)) return getVariableType(ts, checker, sourceFile, language_core_1.names.
|
|
113723
|
+
if (testNames.has(selfName)) return getVariableType(ts, checker, sourceFile, language_core_1.names.export);
|
|
113978
113724
|
}
|
|
113979
113725
|
function getSelfComponentName(fileName) {
|
|
113980
113726
|
const baseName = path.basename(fileName);
|
|
@@ -114633,9 +114379,9 @@ var require_componentMeta = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
114633
114379
|
}
|
|
114634
114380
|
function getName() {
|
|
114635
114381
|
let decl = componentNode;
|
|
114636
|
-
if (componentFile.text.slice(decl.pos, decl.end).includes(core.names.
|
|
114382
|
+
if (componentFile.text.slice(decl.pos, decl.end).includes(core.names.export)) ts.forEachChild(componentFile, (child2) => {
|
|
114637
114383
|
if (ts.isVariableStatement(child2)) {
|
|
114638
|
-
for (const { name, initializer } of child2.declarationList.declarations) if (name.getText() === core.names.
|
|
114384
|
+
for (const { name, initializer } of child2.declarationList.declarations) if (name.getText() === core.names.export && initializer) decl = initializer;
|
|
114639
114385
|
}
|
|
114640
114386
|
});
|
|
114641
114387
|
return core.parseOptionsFromExtression(ts, decl, componentFile)?.name?.node.text;
|
|
@@ -114794,17 +114540,25 @@ var require_isRefAtPosition = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
114794
114540
|
var require_resolveModuleName = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
114795
114541
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
114796
114542
|
exports.resolveModuleName = resolveModuleName;
|
|
114797
|
-
|
|
114543
|
+
var path_browserify_1 = require_path_browserify();
|
|
114544
|
+
function resolveModuleName(ts, languageServiceHost, fileName, moduleName, allowNonExistent) {
|
|
114798
114545
|
const compilerOptions = languageServiceHost.getCompilationSettings();
|
|
114799
114546
|
const ext = moduleName.split(".").pop();
|
|
114800
|
-
const
|
|
114547
|
+
const result = ts.resolveModuleName(moduleName, fileName, {
|
|
114801
114548
|
...compilerOptions,
|
|
114802
114549
|
allowArbitraryExtensions: true
|
|
114803
|
-
}, {
|
|
114804
|
-
|
|
114805
|
-
|
|
114806
|
-
|
|
114807
|
-
|
|
114550
|
+
}, {
|
|
114551
|
+
fileExists(fileName) {
|
|
114552
|
+
return languageServiceHost.fileExists(transformFileName(fileName, ext));
|
|
114553
|
+
},
|
|
114554
|
+
readFile: languageServiceHost.readFile.bind(languageServiceHost)
|
|
114555
|
+
});
|
|
114556
|
+
const resolved = result.resolvedModule?.resolvedFileName;
|
|
114557
|
+
if (resolved) return transformFileName(resolved, ext);
|
|
114558
|
+
if (allowNonExistent && "failedLookupLocations" in result) {
|
|
114559
|
+
const alternative = result.failedLookupLocations?.[0];
|
|
114560
|
+
if (alternative) return path_browserify_1.posix.join(alternative, "..", path_browserify_1.posix.basename(moduleName));
|
|
114561
|
+
}
|
|
114808
114562
|
}
|
|
114809
114563
|
function transformFileName(fileName, ext) {
|
|
114810
114564
|
if (ext && fileName.endsWith(`.d.${ext}.ts`)) return fileName.slice(0, -`.d.${ext}.ts`.length) + `.${ext}`;
|