@vue/compiler-sfc 3.6.0-rc.11 → 3.6.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.cjs.js +30 -21
- package/dist/compiler-sfc.esm-browser.js +493 -187
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-rc.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-rc.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -352,8 +352,6 @@ const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math
|
|
|
352
352
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
353
353
|
const FORMATTING_TAGS = "a,b,big,code,em,font,i,nobr,s,small,strike,strong,tt,u";
|
|
354
354
|
const ALWAYS_CLOSE_TAGS = "title,style,script,noscript,template,object,table,button,textarea,select,iframe,fieldset,form,foreignObject,desc,mi,mo,mn,ms,mtext,annotation-xml";
|
|
355
|
-
const INLINE_TAGS = "a,abbr,acronym,b,bdi,bdo,big,br,button,canvas,cite,code,data,datalist,del,dfn,em,embed,i,iframe,img,input,ins,kbd,label,map,mark,meter,noscript,object,output,picture,progress,q,ruby,s,samp,script,select,small,span,strong,sub,sup,svg,textarea,time,u,tt,var,video";
|
|
356
|
-
const BLOCK_TAGS = "address,article,aside,blockquote,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,main,menu,nav,ol,p,pre,section,table,ul";
|
|
357
355
|
/**
|
|
358
356
|
* Compiler only.
|
|
359
357
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
@@ -384,16 +382,6 @@ const isFormattingTag = /*@__PURE__*/ makeMap(FORMATTING_TAGS);
|
|
|
384
382
|
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
385
383
|
*/
|
|
386
384
|
const isAlwaysCloseTag = /*@__PURE__*/ makeMap(ALWAYS_CLOSE_TAGS);
|
|
387
|
-
/**
|
|
388
|
-
* Compiler only.
|
|
389
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
390
|
-
*/
|
|
391
|
-
const isInlineTag = /*@__PURE__*/ makeMap(INLINE_TAGS);
|
|
392
|
-
/**
|
|
393
|
-
* Compiler only.
|
|
394
|
-
* Do NOT use in runtime code paths unless behind `__DEV__` flag.
|
|
395
|
-
*/
|
|
396
|
-
const isBlockTag = /*@__PURE__*/ makeMap(BLOCK_TAGS);
|
|
397
385
|
//#endregion
|
|
398
386
|
//#region packages/shared/src/domAttrConfig.ts
|
|
399
387
|
/**
|
|
@@ -405,9 +393,10 @@ const isBlockTag = /*@__PURE__*/ makeMap(BLOCK_TAGS);
|
|
|
405
393
|
* - ismap -> isMap
|
|
406
394
|
* - nomodule -> noModule
|
|
407
395
|
* - novalidate -> noValidate
|
|
396
|
+
* - playsinline -> playsInline
|
|
408
397
|
* - readonly -> readOnly
|
|
409
398
|
*/
|
|
410
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
399
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
411
400
|
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
412
401
|
/**
|
|
413
402
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
@@ -3626,7 +3615,7 @@ const errorMessages$1 = {
|
|
|
3626
3615
|
[41]: `v-model is missing expression.`,
|
|
3627
3616
|
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
3628
3617
|
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
3629
|
-
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
3618
|
+
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.\nFor props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
|
|
3630
3619
|
[45]: `v-model cannot be used on a const binding because it is not writable.`,
|
|
3631
3620
|
[46]: `Error parsing JavaScript expression: `,
|
|
3632
3621
|
[47]: `<KeepAlive> expects exactly one child component.`,
|
|
@@ -3638,7 +3627,7 @@ const errorMessages$1 = {
|
|
|
3638
3627
|
[54]: ``
|
|
3639
3628
|
};
|
|
3640
3629
|
//#endregion
|
|
3641
|
-
//#region node_modules/.pnpm/@babel+parser@7.29.
|
|
3630
|
+
//#region node_modules/.pnpm/@babel+parser@7.29.9/node_modules/@babel/parser/lib/index.js
|
|
3642
3631
|
var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3643
3632
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3644
3633
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
@@ -7072,10 +7061,10 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7072
7061
|
const arrows = [];
|
|
7073
7062
|
while (stack.length !== 0) {
|
|
7074
7063
|
const node = stack.pop();
|
|
7075
|
-
if (node.type === "ArrowFunctionExpression"
|
|
7064
|
+
if (node.type === "ArrowFunctionExpression") {
|
|
7076
7065
|
if (node.typeParameters || !node.returnType) this.finishArrowValidation(node);
|
|
7077
7066
|
else arrows.push(node);
|
|
7078
|
-
stack.push(node.body);
|
|
7067
|
+
if (node.body.type !== "BlockStatement") stack.push(node.body);
|
|
7079
7068
|
} else if (node.type === "ConditionalExpression") {
|
|
7080
7069
|
stack.push(node.consequent);
|
|
7081
7070
|
stack.push(node.alternate);
|
|
@@ -12865,6 +12854,9 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12865
12854
|
}
|
|
12866
12855
|
fillOptionalPropertiesForTSESLint(node) {
|
|
12867
12856
|
switch (node.type) {
|
|
12857
|
+
case "ImportDeclaration":
|
|
12858
|
+
node.phase != null || (node.phase = null);
|
|
12859
|
+
return;
|
|
12868
12860
|
case "ExpressionStatement":
|
|
12869
12861
|
node.directive != null || (node.directive = void 0);
|
|
12870
12862
|
return;
|
|
@@ -17936,7 +17928,7 @@ function createStructuralDirectiveTransform$1(name, fn) {
|
|
|
17936
17928
|
};
|
|
17937
17929
|
}
|
|
17938
17930
|
//#endregion
|
|
17939
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
17931
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64.js
|
|
17940
17932
|
var require_base64$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
17941
17933
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
17942
17934
|
/**
|
|
@@ -17970,7 +17962,7 @@ var require_base64$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17970
17962
|
};
|
|
17971
17963
|
}));
|
|
17972
17964
|
//#endregion
|
|
17973
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
17965
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/base64-vlq.js
|
|
17974
17966
|
var require_base64_vlq$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
17975
17967
|
var base64 = require_base64$1();
|
|
17976
17968
|
var VLQ_BASE_SHIFT = 5;
|
|
@@ -18035,7 +18027,7 @@ var require_base64_vlq$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18035
18027
|
};
|
|
18036
18028
|
}));
|
|
18037
18029
|
//#endregion
|
|
18038
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18030
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/util.js
|
|
18039
18031
|
var require_util$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18040
18032
|
/**
|
|
18041
18033
|
* This is a helper function for getting values from parameter/options
|
|
@@ -18382,7 +18374,7 @@ var require_util$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18382
18374
|
exports.computeSourceURL = computeSourceURL;
|
|
18383
18375
|
}));
|
|
18384
18376
|
//#endregion
|
|
18385
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18377
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/array-set.js
|
|
18386
18378
|
var require_array_set$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18387
18379
|
var util = require_util$2();
|
|
18388
18380
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -18476,7 +18468,7 @@ var require_array_set$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18476
18468
|
exports.ArraySet = ArraySet;
|
|
18477
18469
|
}));
|
|
18478
18470
|
//#endregion
|
|
18479
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18471
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/mapping-list.js
|
|
18480
18472
|
var require_mapping_list$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18481
18473
|
var util = require_util$2();
|
|
18482
18474
|
/**
|
|
@@ -18545,7 +18537,7 @@ var require_mapping_list$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18545
18537
|
exports.MappingList = MappingList;
|
|
18546
18538
|
}));
|
|
18547
18539
|
//#endregion
|
|
18548
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18540
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/source-map-generator.js
|
|
18549
18541
|
var require_source_map_generator$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18550
18542
|
var base64VLQ = require_base64_vlq$1();
|
|
18551
18543
|
var util = require_util$2();
|
|
@@ -18769,10 +18761,9 @@ var require_source_map_generator$1 = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
18769
18761
|
next = "";
|
|
18770
18762
|
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
18771
18763
|
previousGeneratedColumn = 0;
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
}
|
|
18764
|
+
var lineDelta = mapping.generatedLine - previousGeneratedLine;
|
|
18765
|
+
next += lineDelta === 1 ? ";" : ";".repeat(lineDelta);
|
|
18766
|
+
previousGeneratedLine = mapping.generatedLine;
|
|
18776
18767
|
} else if (i > 0) {
|
|
18777
18768
|
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
|
|
18778
18769
|
next += ",";
|
|
@@ -18829,7 +18820,7 @@ var require_source_map_generator$1 = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
18829
18820
|
exports.SourceMapGenerator = SourceMapGenerator;
|
|
18830
18821
|
}));
|
|
18831
18822
|
//#endregion
|
|
18832
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18823
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/binary-search.js
|
|
18833
18824
|
var require_binary_search$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18834
18825
|
exports.GREATEST_LOWER_BOUND = 1;
|
|
18835
18826
|
exports.LEAST_UPPER_BOUND = 2;
|
|
@@ -18890,7 +18881,7 @@ var require_binary_search$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18890
18881
|
};
|
|
18891
18882
|
}));
|
|
18892
18883
|
//#endregion
|
|
18893
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18884
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/quick-sort.js
|
|
18894
18885
|
var require_quick_sort$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18895
18886
|
function SortTemplate(comparator) {
|
|
18896
18887
|
/**
|
|
@@ -18953,6 +18944,14 @@ var require_quick_sort$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18953
18944
|
let template = SortTemplate.toString();
|
|
18954
18945
|
return new Function(`return ${template}`)()(comparator);
|
|
18955
18946
|
}
|
|
18947
|
+
let isEvalAllowed = (function() {
|
|
18948
|
+
try {
|
|
18949
|
+
new Function("return 0")();
|
|
18950
|
+
return true;
|
|
18951
|
+
} catch (_unused) {
|
|
18952
|
+
return false;
|
|
18953
|
+
}
|
|
18954
|
+
})();
|
|
18956
18955
|
/**
|
|
18957
18956
|
* Sort the given array in-place with the given comparator function.
|
|
18958
18957
|
*
|
|
@@ -18963,7 +18962,7 @@ var require_quick_sort$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18963
18962
|
*/
|
|
18964
18963
|
let sortCache = /* @__PURE__ */ new WeakMap();
|
|
18965
18964
|
exports.quickSort = function(ary, comparator, start = 0) {
|
|
18966
|
-
let doQuickSort = sortCache.get(comparator);
|
|
18965
|
+
let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
|
|
18967
18966
|
if (doQuickSort === void 0) {
|
|
18968
18967
|
doQuickSort = cloneSort(comparator);
|
|
18969
18968
|
sortCache.set(comparator, doQuickSort);
|
|
@@ -18972,13 +18971,14 @@ var require_quick_sort$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18972
18971
|
};
|
|
18973
18972
|
}));
|
|
18974
18973
|
//#endregion
|
|
18975
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
18974
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/source-map-consumer.js
|
|
18976
18975
|
var require_source_map_consumer$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18977
18976
|
var util = require_util$2();
|
|
18978
18977
|
var binarySearch = require_binary_search$1();
|
|
18979
18978
|
var ArraySet = require_array_set$1().ArraySet;
|
|
18980
18979
|
var base64VLQ = require_base64_vlq$1();
|
|
18981
18980
|
var quickSort = require_quick_sort$1().quickSort;
|
|
18981
|
+
var MAX_SECTION_OFFSET_LINE = 1e7;
|
|
18982
18982
|
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
18983
18983
|
var sourceMap = aSourceMap;
|
|
18984
18984
|
if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
@@ -19580,21 +19580,37 @@ var require_source_map_consumer$1 = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
19580
19580
|
line: -1,
|
|
19581
19581
|
column: 0
|
|
19582
19582
|
};
|
|
19583
|
+
var maxOffsetLine = 0;
|
|
19583
19584
|
this._sections = sections.map(function(s) {
|
|
19584
19585
|
if (s.url) throw new Error("Support for url field in sections not implemented.");
|
|
19585
19586
|
var offset = util.getArg(s, "offset");
|
|
19586
19587
|
var offsetLine = util.getArg(offset, "line");
|
|
19587
19588
|
var offsetColumn = util.getArg(offset, "column");
|
|
19589
|
+
if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) throw new Error("Section offset line and column must be non-negative integers.");
|
|
19590
|
+
if (offsetLine > MAX_SECTION_OFFSET_LINE) throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ".");
|
|
19588
19591
|
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
19589
19592
|
lastOffset = offset;
|
|
19593
|
+
var consumer = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL);
|
|
19594
|
+
var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
|
|
19595
|
+
if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) throw new Error("Section offset line must not exceed " + MAX_SECTION_OFFSET_LINE + ", including offsets of nested sections.");
|
|
19596
|
+
if (totalOffsetLine > maxOffsetLine) maxOffsetLine = totalOffsetLine;
|
|
19590
19597
|
return {
|
|
19591
19598
|
generatedOffset: {
|
|
19592
19599
|
generatedLine: offsetLine + 1,
|
|
19593
19600
|
generatedColumn: offsetColumn + 1
|
|
19594
19601
|
},
|
|
19595
|
-
consumer
|
|
19602
|
+
consumer
|
|
19596
19603
|
};
|
|
19597
19604
|
});
|
|
19605
|
+
this._maxOffsetLine = maxOffsetLine;
|
|
19606
|
+
}
|
|
19607
|
+
/**
|
|
19608
|
+
* Section offsets come from untrusted input and are used as line/column
|
|
19609
|
+
* numbers, so only accept non-negative safe integers (rejects NaN, Infinity,
|
|
19610
|
+
* strings, fractions, etc).
|
|
19611
|
+
*/
|
|
19612
|
+
function isValidOffset(aValue) {
|
|
19613
|
+
return typeof aValue === "number" && aValue >= 0 && aValue <= 9007199254740991 && Math.floor(aValue) === aValue;
|
|
19598
19614
|
}
|
|
19599
19615
|
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
19600
19616
|
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
@@ -19607,7 +19623,10 @@ var require_source_map_consumer$1 = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
19607
19623
|
*/
|
|
19608
19624
|
Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
|
|
19609
19625
|
var sources = [];
|
|
19610
|
-
for (var i = 0; i < this._sections.length; i++)
|
|
19626
|
+
for (var i = 0; i < this._sections.length; i++) {
|
|
19627
|
+
var sectionSources = this._sections[i].consumer.sources;
|
|
19628
|
+
for (var j = 0; j < sectionSources.length; j++) sources.push(sectionSources[j]);
|
|
19629
|
+
}
|
|
19611
19630
|
return sources;
|
|
19612
19631
|
} });
|
|
19613
19632
|
/**
|
|
@@ -19748,7 +19767,7 @@ var require_source_map_consumer$1 = /* @__PURE__ */ __commonJSMin(((exports) =>
|
|
|
19748
19767
|
exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
19749
19768
|
}));
|
|
19750
19769
|
//#endregion
|
|
19751
|
-
//#region node_modules/.pnpm/source-map-js@1.2.
|
|
19770
|
+
//#region node_modules/.pnpm/source-map-js@1.2.2/node_modules/source-map-js/lib/source-node.js
|
|
19752
19771
|
var require_source_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
19753
19772
|
var SourceMapGenerator = require_source_map_generator$1().SourceMapGenerator;
|
|
19754
19773
|
var util = require_util$2();
|
|
@@ -19814,6 +19833,10 @@ var require_source_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19814
19833
|
}
|
|
19815
19834
|
}
|
|
19816
19835
|
while (lastGeneratedLine < mapping.generatedLine) {
|
|
19836
|
+
if (remainingLinesIndex >= remainingLines.length) {
|
|
19837
|
+
lastGeneratedLine = mapping.generatedLine;
|
|
19838
|
+
break;
|
|
19839
|
+
}
|
|
19817
19840
|
node.add(shiftNextLine());
|
|
19818
19841
|
lastGeneratedLine++;
|
|
19819
19842
|
}
|
|
@@ -20945,7 +20968,11 @@ const transformFor = createStructuralDirectiveTransform$1("for", (node, dir, con
|
|
|
20945
20968
|
]),
|
|
20946
20969
|
createCompoundExpression([
|
|
20947
20970
|
`if (_cached && _cached.el`,
|
|
20948
|
-
...keyExp ? [
|
|
20971
|
+
...keyExp ? [
|
|
20972
|
+
` && _cached.key === (`,
|
|
20973
|
+
keyExp,
|
|
20974
|
+
`)`
|
|
20975
|
+
] : [],
|
|
20949
20976
|
` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
|
|
20950
20977
|
]),
|
|
20951
20978
|
createCompoundExpression([`const _item = `, childBlock]),
|
|
@@ -22343,7 +22370,7 @@ function stringifyNode(node, context) {
|
|
|
22343
22370
|
}
|
|
22344
22371
|
function stringifyElement(node, context) {
|
|
22345
22372
|
let res = `<${node.tag}`;
|
|
22346
|
-
let innerHTML =
|
|
22373
|
+
let innerHTML = void 0;
|
|
22347
22374
|
for (let i = 0; i < node.props.length; i++) {
|
|
22348
22375
|
const p = node.props[i];
|
|
22349
22376
|
if (p.type === 6) {
|
|
@@ -22365,13 +22392,15 @@ function stringifyElement(node, context) {
|
|
|
22365
22392
|
else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
|
|
22366
22393
|
res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
|
|
22367
22394
|
}
|
|
22368
|
-
} else if (p.name === "html")
|
|
22369
|
-
|
|
22395
|
+
} else if (p.name === "html") {
|
|
22396
|
+
var _evaluateConstant;
|
|
22397
|
+
innerHTML = (_evaluateConstant = evaluateConstant(p.exp)) !== null && _evaluateConstant !== void 0 ? _evaluateConstant : "";
|
|
22398
|
+
} else if (p.name === "text") innerHTML = escapeHtml(toDisplayString(evaluateConstant(p.exp)));
|
|
22370
22399
|
}
|
|
22371
22400
|
}
|
|
22372
22401
|
if (context.scopeId) res += ` ${context.scopeId}`;
|
|
22373
22402
|
res += `>`;
|
|
22374
|
-
if (innerHTML) res += innerHTML;
|
|
22403
|
+
if (innerHTML !== void 0) res += innerHTML;
|
|
22375
22404
|
else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
|
|
22376
22405
|
if (!isVoidTag(node.tag)) res += `</${node.tag}>`;
|
|
22377
22406
|
return res;
|
|
@@ -22778,7 +22807,11 @@ var src_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
22778
22807
|
walkIdentifiers: () => walkIdentifiers,
|
|
22779
22808
|
warnDeprecation: () => warnDeprecation
|
|
22780
22809
|
});
|
|
22781
|
-
const DOMNodeTransforms = [
|
|
22810
|
+
const DOMNodeTransforms = [
|
|
22811
|
+
transformStyle,
|
|
22812
|
+
transformTransition$1,
|
|
22813
|
+
...[validateHtmlNesting]
|
|
22814
|
+
];
|
|
22782
22815
|
const DOMDirectiveTransforms = {
|
|
22783
22816
|
cloak: noopDirectiveTransform,
|
|
22784
22817
|
html: transformVHtml$1,
|
|
@@ -25183,6 +25216,22 @@ function getBlockShape(block) {
|
|
|
25183
25216
|
if (root && root.operation && root.operation.type === 15) return 2;
|
|
25184
25217
|
return block.node.type === 1 && block.node.children.every((child) => child.type === 2 || child.type === 5) ? 2 : 1;
|
|
25185
25218
|
}
|
|
25219
|
+
/** the number of `v-if` / `v-else-if` nodes in the chain starting at `head` */
|
|
25220
|
+
function getIfChainLength(head) {
|
|
25221
|
+
let length = 1;
|
|
25222
|
+
let negative = head.negative;
|
|
25223
|
+
while (negative && negative.type === 15) {
|
|
25224
|
+
length++;
|
|
25225
|
+
negative = negative.negative;
|
|
25226
|
+
}
|
|
25227
|
+
return length;
|
|
25228
|
+
}
|
|
25229
|
+
function isLongIfChain(head) {
|
|
25230
|
+
return getIfChainLength(head) - 1 > 10;
|
|
25231
|
+
}
|
|
25232
|
+
function isSlotTemplate(node) {
|
|
25233
|
+
return node.type === 1 && isTemplateNode(node) && node.props.some(isVSlot);
|
|
25234
|
+
}
|
|
25186
25235
|
//#endregion
|
|
25187
25236
|
//#region packages/compiler-vapor/src/transform.ts
|
|
25188
25237
|
init_objectSpread2();
|
|
@@ -25214,11 +25263,14 @@ var TransformContext = class TransformContext {
|
|
|
25214
25263
|
this.isLastEffectiveChild = true;
|
|
25215
25264
|
this.isOnRightmostPath = true;
|
|
25216
25265
|
this.isSingleRoot = false;
|
|
25266
|
+
this.isSlotRoot = false;
|
|
25217
25267
|
this.templateCloseTags = void 0;
|
|
25218
25268
|
this.templateCloseBlocks = false;
|
|
25269
|
+
this.templateScope = 0;
|
|
25219
25270
|
this.globalId = 0;
|
|
25220
25271
|
this.nextIdMap = null;
|
|
25221
25272
|
this.ifIndex = 0;
|
|
25273
|
+
this.ifHeads = /* @__PURE__ */ new Map();
|
|
25222
25274
|
this.increaseId = () => {
|
|
25223
25275
|
const id = getNextId(this.nextIdMap, this.globalId);
|
|
25224
25276
|
this.globalId = getNextId(this.nextIdMap, id + 1);
|
|
@@ -25273,8 +25325,10 @@ var TransformContext = class TransformContext {
|
|
|
25273
25325
|
this.dynamic.flags |= 1;
|
|
25274
25326
|
return this.dynamic.id = this.increaseId();
|
|
25275
25327
|
}
|
|
25276
|
-
nextIfIndex() {
|
|
25277
|
-
|
|
25328
|
+
nextIfIndex(count = 1) {
|
|
25329
|
+
const index = this.ifIndex;
|
|
25330
|
+
this.ifIndex += count;
|
|
25331
|
+
return index;
|
|
25278
25332
|
}
|
|
25279
25333
|
getTemplateNamespace() {
|
|
25280
25334
|
return this.node.type === 1 ? this.node.ns : 0;
|
|
@@ -25349,6 +25403,7 @@ var TransformContext = class TransformContext {
|
|
|
25349
25403
|
const isLastEffectiveChild = childInfo.isLastEffectiveChild[index];
|
|
25350
25404
|
const isOnRightmostPath = this.isOnRightmostPath && isLastEffectiveChild;
|
|
25351
25405
|
const isSingleRoot = this.isSingleRootChild(childInfo);
|
|
25406
|
+
const isSlotRoot = this.isSlotRootChild(childInfo);
|
|
25352
25407
|
return Object.assign(Object.create(TransformContext.prototype), this, {
|
|
25353
25408
|
node,
|
|
25354
25409
|
parent: this,
|
|
@@ -25365,8 +25420,10 @@ var TransformContext = class TransformContext {
|
|
|
25365
25420
|
isLastEffectiveChild,
|
|
25366
25421
|
isOnRightmostPath,
|
|
25367
25422
|
isSingleRoot,
|
|
25423
|
+
isSlotRoot,
|
|
25368
25424
|
templateCloseTags: this.templateCloseTags,
|
|
25369
|
-
templateCloseBlocks: this.templateCloseBlocks
|
|
25425
|
+
templateCloseBlocks: this.templateCloseBlocks,
|
|
25426
|
+
templateScope: 0
|
|
25370
25427
|
});
|
|
25371
25428
|
}
|
|
25372
25429
|
shiftEffectBoundaries(index, dynamic = this.dynamic) {
|
|
@@ -25379,6 +25436,7 @@ var TransformContext = class TransformContext {
|
|
|
25379
25436
|
if (node.type !== 0 && node.type !== 1) return {
|
|
25380
25437
|
node,
|
|
25381
25438
|
hasSingleRootChild: true,
|
|
25439
|
+
hasSingleSlotRootChild: false,
|
|
25382
25440
|
isLastEffectiveChild: []
|
|
25383
25441
|
};
|
|
25384
25442
|
const cached = childContextInfoCache.get(this);
|
|
@@ -25390,18 +25448,29 @@ var TransformContext = class TransformContext {
|
|
|
25390
25448
|
isLastEffectiveChild[i] = !hasFollowingEffectiveChild;
|
|
25391
25449
|
if (!isComponentChild(children[i])) hasFollowingEffectiveChild = true;
|
|
25392
25450
|
}
|
|
25451
|
+
const hasSingleRoot = hasSingleRootChild(children);
|
|
25393
25452
|
const childInfo = {
|
|
25394
25453
|
node,
|
|
25395
|
-
hasSingleRootChild:
|
|
25454
|
+
hasSingleRootChild: hasSingleRoot,
|
|
25455
|
+
hasSingleSlotRootChild: node.type === 1 && node.tagType === 1 && !isBuiltInComponent(node.tag) && (children.some(isSlotTemplate) ? hasSingleRootChild(children.filter((child) => !isSlotTemplate(child))) : hasSingleRoot),
|
|
25396
25456
|
isLastEffectiveChild
|
|
25397
25457
|
};
|
|
25398
25458
|
childContextInfoCache.set(this, childInfo);
|
|
25399
25459
|
return childInfo;
|
|
25400
25460
|
}
|
|
25461
|
+
isSlotRootChild(childInfo) {
|
|
25462
|
+
const node = this.node;
|
|
25463
|
+
if (node.type !== 1) return false;
|
|
25464
|
+
if (node.tagType === 1) return childInfo.hasSingleSlotRootChild;
|
|
25465
|
+
return node.tagType === 3 && childInfo.hasSingleRootChild && (isSlotTemplate(node) || this.isSlotRoot && !findDir$1(node, "for"));
|
|
25466
|
+
}
|
|
25401
25467
|
isSingleRootChild(childInfo) {
|
|
25402
|
-
if (
|
|
25403
|
-
|
|
25404
|
-
|
|
25468
|
+
if (!childInfo.hasSingleRootChild) return false;
|
|
25469
|
+
const node = this.node;
|
|
25470
|
+
if (node.type === 0) return true;
|
|
25471
|
+
if (node.type !== 1 || !this.parent) return false;
|
|
25472
|
+
if (node.tagType === 3) return this.isSingleRoot && !findDir$1(node, "for");
|
|
25473
|
+
return isTransitionNode(node) || isKeepAliveTag(node.tag);
|
|
25405
25474
|
}
|
|
25406
25475
|
};
|
|
25407
25476
|
function hasSingleRootChild(children) {
|
|
@@ -25463,9 +25532,17 @@ function transform(node, options = {}) {
|
|
|
25463
25532
|
};
|
|
25464
25533
|
const context = new TransformContext(ir, node, options);
|
|
25465
25534
|
transformNode(context);
|
|
25535
|
+
finalizeIfChains(context);
|
|
25466
25536
|
ir.node.imports = context.imports;
|
|
25467
25537
|
return ir;
|
|
25468
25538
|
}
|
|
25539
|
+
function finalizeIfChains(context) {
|
|
25540
|
+
context.ifHeads.forEach((inVOnce, head) => {
|
|
25541
|
+
if (!isLongIfChain(head)) return;
|
|
25542
|
+
head.once = inVOnce;
|
|
25543
|
+
if (!inVOnce) head.index = context.nextIfIndex(Math.ceil((getIfChainLength(head) + 1) / 2));
|
|
25544
|
+
});
|
|
25545
|
+
}
|
|
25469
25546
|
function transformNode(context) {
|
|
25470
25547
|
let { node } = context;
|
|
25471
25548
|
const { nodeTransforms } = context.options;
|
|
@@ -25788,7 +25865,11 @@ function genIdentifier(raw, context, loc, assignment, id, parent, parentStack, s
|
|
|
25788
25865
|
-2,
|
|
25789
25866
|
loc
|
|
25790
25867
|
]];
|
|
25791
|
-
} else
|
|
25868
|
+
} else {
|
|
25869
|
+
const exp = genExpression(replacement, context, assignment);
|
|
25870
|
+
if (parent && parent.type === "ObjectProperty" && parent.shorthand) return [`${name}: `, ...exp];
|
|
25871
|
+
return exp;
|
|
25872
|
+
}
|
|
25792
25873
|
}
|
|
25793
25874
|
let prefix;
|
|
25794
25875
|
let type = bindingMetadata && bindingMetadata[raw];
|
|
@@ -26570,44 +26651,46 @@ function parseValueDestructure(value, context) {
|
|
|
26570
26651
|
walkFunctionParams(value.ast, (id) => bindings.add(id));
|
|
26571
26652
|
walkIdentifiers(value.ast, (id, _, parentStack) => {
|
|
26572
26653
|
if (bindings.has(id)) {
|
|
26573
|
-
|
|
26654
|
+
const steps = [];
|
|
26574
26655
|
let isDynamic = false;
|
|
26575
|
-
let helper;
|
|
26576
|
-
let helperArgs;
|
|
26577
26656
|
for (let i = 0; i < parentStack.length; i++) {
|
|
26578
26657
|
const parent = parentStack[i];
|
|
26579
26658
|
const child = parentStack[i + 1] || id;
|
|
26580
26659
|
if (parent.type === "ObjectProperty" && parent.value === child) {
|
|
26581
|
-
if (parent.key.type === "StringLiteral")
|
|
26660
|
+
if (parent.key.type === "StringLiteral") steps.push(`[${JSON.stringify(parent.key.value)}]`);
|
|
26582
26661
|
else if (parent.computed) {
|
|
26583
26662
|
isDynamic = true;
|
|
26584
|
-
|
|
26585
|
-
} else
|
|
26663
|
+
steps.push(`[${rawValue.slice(parent.key.start - 1, parent.key.end - 1)}]`);
|
|
26664
|
+
} else steps.push(`.${parent.key.name}`);
|
|
26586
26665
|
} else if (parent.type === "ArrayPattern") {
|
|
26587
26666
|
const index = parent.elements.indexOf(child);
|
|
26588
|
-
if (child.type === "RestElement")
|
|
26589
|
-
else
|
|
26667
|
+
if (child.type === "RestElement") steps.push(`.slice(${index})`);
|
|
26668
|
+
else steps.push(`[${index}]`);
|
|
26590
26669
|
} else if (parent.type === "ObjectPattern" && child.type === "RestElement") {
|
|
26591
|
-
helper = context.helper("getRestElement");
|
|
26592
|
-
|
|
26670
|
+
const helper = context.helper("getRestElement");
|
|
26671
|
+
const args = "[" + parent.properties.filter((p) => p.type === "ObjectProperty").map((p) => {
|
|
26593
26672
|
if (p.key.type === "StringLiteral") return JSON.stringify(p.key.value);
|
|
26594
26673
|
else if (p.computed) {
|
|
26595
26674
|
isDynamic = true;
|
|
26596
26675
|
return rawValue.slice(p.key.start - 1, p.key.end - 1);
|
|
26597
26676
|
} else return JSON.stringify(p.key.name);
|
|
26598
26677
|
}).join(", ") + "]";
|
|
26678
|
+
steps.push({
|
|
26679
|
+
helper,
|
|
26680
|
+
args
|
|
26681
|
+
});
|
|
26599
26682
|
}
|
|
26600
|
-
if (child.type === "AssignmentPattern" && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern" || parent.type === "ArrowFunctionExpression"
|
|
26683
|
+
if (child.type === "AssignmentPattern" && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern" || parent.type === "ArrowFunctionExpression")) {
|
|
26601
26684
|
isDynamic = true;
|
|
26602
|
-
|
|
26603
|
-
|
|
26685
|
+
steps.push({
|
|
26686
|
+
helper: context.helper("getDefaultValue"),
|
|
26687
|
+
args: `() => (${rawValue.slice(child.right.start - 1, child.right.end - 1)})`
|
|
26688
|
+
});
|
|
26604
26689
|
}
|
|
26605
26690
|
}
|
|
26606
26691
|
map.set(id.name, {
|
|
26607
|
-
|
|
26608
|
-
dynamic: isDynamic
|
|
26609
|
-
helper,
|
|
26610
|
-
helperArgs
|
|
26692
|
+
steps,
|
|
26693
|
+
dynamic: isDynamic
|
|
26611
26694
|
});
|
|
26612
26695
|
}
|
|
26613
26696
|
}, true);
|
|
@@ -26620,10 +26703,10 @@ function buildDestructureIdMap(idToPathMap, baseAccessor, plugins) {
|
|
|
26620
26703
|
idToPathMap.forEach((pathInfo, id) => {
|
|
26621
26704
|
let path = baseAccessor;
|
|
26622
26705
|
if (pathInfo) {
|
|
26623
|
-
|
|
26624
|
-
|
|
26625
|
-
idMap[
|
|
26626
|
-
path =
|
|
26706
|
+
for (const step of pathInfo.steps) if (typeof step === "string") path += step;
|
|
26707
|
+
else {
|
|
26708
|
+
idMap[step.helper] = null;
|
|
26709
|
+
path = `${step.helper}(${path}, ${step.args})`;
|
|
26627
26710
|
}
|
|
26628
26711
|
if (pathInfo.dynamic) {
|
|
26629
26712
|
const node = idMap[id] = createSimpleExpression(path);
|
|
@@ -26758,6 +26841,7 @@ function genSetHtml(oper, context) {
|
|
|
26758
26841
|
//#endregion
|
|
26759
26842
|
//#region packages/compiler-vapor/src/generators/if.ts
|
|
26760
26843
|
function genIf(oper, context, isNested = false) {
|
|
26844
|
+
if (!isNested && isLongIfChain(oper)) return genIfChain(oper, context);
|
|
26761
26845
|
const { helper } = context;
|
|
26762
26846
|
const { condition, positive, negative, once, slotRoot, index, blockShape } = oper;
|
|
26763
26847
|
const [frag, push] = buildCodeFragment();
|
|
@@ -26805,6 +26889,57 @@ function genBlockShapeName(flags) {
|
|
|
26805
26889
|
}
|
|
26806
26890
|
return "UNKNOWN";
|
|
26807
26891
|
}
|
|
26892
|
+
function genIfChain(oper, context) {
|
|
26893
|
+
const { helper } = context;
|
|
26894
|
+
const [frag, push] = buildCodeFragment();
|
|
26895
|
+
const selector = ["() => ", INDENT_START];
|
|
26896
|
+
const blocks = [];
|
|
26897
|
+
const branchFlags = [];
|
|
26898
|
+
let slotRoot = false;
|
|
26899
|
+
let node = oper;
|
|
26900
|
+
for (let i = 0;; i++) {
|
|
26901
|
+
if (i > 0) selector.push(NEWLINE, ": ");
|
|
26902
|
+
selector.push("(", ...genExpression(node.condition, context), `) ? ${i}`);
|
|
26903
|
+
blocks.push(genBlock(node.positive, context));
|
|
26904
|
+
branchFlags.push(node.blockShape & 35);
|
|
26905
|
+
if (node.slotRoot) slotRoot = true;
|
|
26906
|
+
const { negative } = node;
|
|
26907
|
+
if (negative && negative.type === 15) {
|
|
26908
|
+
node = negative;
|
|
26909
|
+
continue;
|
|
26910
|
+
}
|
|
26911
|
+
selector.push(NEWLINE, `: ${i + 1}`, INDENT_END);
|
|
26912
|
+
if (negative) blocks.push(genBlock(negative, context));
|
|
26913
|
+
branchFlags.push(node.blockShape >> 2 & 3 | (node.blockShape & 64 ? 32 : 0));
|
|
26914
|
+
break;
|
|
26915
|
+
}
|
|
26916
|
+
push(NEWLINE, `const n${oper.id} = `, ...genCall(helper("createIfChain"), selector, genMulti(DELIMITERS_ARRAY, ...blocks), genIfChainBranchFlags(branchFlags, blocks.length), genIfChainFlags(oper.once, slotRoot, oper.index)));
|
|
26917
|
+
return frag;
|
|
26918
|
+
}
|
|
26919
|
+
function genIfChainBranchFlags(branchFlags, blockCount) {
|
|
26920
|
+
if (branchFlags.every((flags, i) => flags === (i < blockCount ? 1 : 0))) return false;
|
|
26921
|
+
return genMulti(DELIMITERS_ARRAY, ...branchFlags.map((flags) => {
|
|
26922
|
+
const names = [genBlockShapeName(flags)];
|
|
26923
|
+
if (flags & 32) names.push("NO_SCOPE");
|
|
26924
|
+
return genFlags(flags, names);
|
|
26925
|
+
}));
|
|
26926
|
+
}
|
|
26927
|
+
function genIfChainFlags(once, slotRoot, index) {
|
|
26928
|
+
let flags = 0;
|
|
26929
|
+
const names = [];
|
|
26930
|
+
if (once) {
|
|
26931
|
+
flags |= 16;
|
|
26932
|
+
names.push("ONCE");
|
|
26933
|
+
} else {
|
|
26934
|
+
flags |= index + 1 << 8;
|
|
26935
|
+
names.push(`KEYED_INDEX_${index}`);
|
|
26936
|
+
}
|
|
26937
|
+
if (slotRoot) {
|
|
26938
|
+
flags |= 128;
|
|
26939
|
+
names.push("SLOT_ROOT");
|
|
26940
|
+
}
|
|
26941
|
+
return genFlags(flags, names);
|
|
26942
|
+
}
|
|
26808
26943
|
//#endregion
|
|
26809
26944
|
//#region packages/compiler-vapor/src/generators/prop.ts
|
|
26810
26945
|
const helpers = {
|
|
@@ -27217,7 +27352,7 @@ function genCreateComponent(operation, context) {
|
|
|
27217
27352
|
", "
|
|
27218
27353
|
], ...slotDeclarations) : [],
|
|
27219
27354
|
`const n${operation.id} = `,
|
|
27220
|
-
...genCall(isRuntimeDynamicComponent ? helper("createDynamicComponent") : operation.useCreateElement ? helper("createPlainElement") : useAssetComponentHelper ? helper("createAssetComponent") : operation.asset ? helper("createComponentWithFallback") : helper("createComponent"), tag, rawProps, rawSlots, isRuntimeDynamicComponent ? dynamicComponentFlags : root ? "true" :
|
|
27355
|
+
...genCall(isRuntimeDynamicComponent ? helper("createDynamicComponent") : operation.useCreateElement ? helper("createPlainElement") : useAssetComponentHelper ? helper("createAssetComponent") : operation.asset ? helper("createComponentWithFallback") : helper("createComponent"), tag, rawProps, rawSlots, isRuntimeDynamicComponent ? dynamicComponentFlags : root && (root === true ? "true" : genFlags(root, ["SLOT"])), isRuntimeDynamicComponent ? operation.key && [
|
|
27221
27356
|
"() => (",
|
|
27222
27357
|
...genExpression(operation.key, context),
|
|
27223
27358
|
")"
|
|
@@ -27250,9 +27385,12 @@ function genCreateComponent(operation, context) {
|
|
|
27250
27385
|
function genDynamicComponentFlags(root, once, slotRoot, ns) {
|
|
27251
27386
|
let flags = 0;
|
|
27252
27387
|
const names = [];
|
|
27253
|
-
if (root) {
|
|
27388
|
+
if (root === true) {
|
|
27254
27389
|
flags |= 1;
|
|
27255
27390
|
names.push("SINGLE_ROOT");
|
|
27391
|
+
} else if (root) {
|
|
27392
|
+
flags |= 32;
|
|
27393
|
+
names.push("SLOT_SINGLE_ROOT");
|
|
27256
27394
|
}
|
|
27257
27395
|
if (once) {
|
|
27258
27396
|
flags |= 2;
|
|
@@ -27643,7 +27781,6 @@ function genSlotFlags(flags) {
|
|
|
27643
27781
|
if (flags & 1) names.push("NO_SLOTTED");
|
|
27644
27782
|
if (flags & 2) names.push("ONCE");
|
|
27645
27783
|
if (flags & 4) names.push("FORWARDED");
|
|
27646
|
-
if (flags & 8) names.push("SHARED_FALLBACK");
|
|
27647
27784
|
return genFlags(flags, names);
|
|
27648
27785
|
}
|
|
27649
27786
|
//#endregion
|
|
@@ -28091,44 +28228,32 @@ function isVModelOperation(oper) {
|
|
|
28091
28228
|
function isVModelListener(oper, modelElements) {
|
|
28092
28229
|
return (oper.type === 7 || oper.type === 8 || oper.type === 4 && oper.listeners || oper.type === 3 && !oper.prop.modifier && isOn(oper.prop.key.content)) && modelElements.has(oper.element);
|
|
28093
28230
|
}
|
|
28094
|
-
function markSlotRootOperations(block, context
|
|
28231
|
+
function markSlotRootOperations(block, context) {
|
|
28095
28232
|
if (hasStableSlotRoot(block, context)) return;
|
|
28096
|
-
sharedFallback = sharedFallback || hasMultipleDynamicSlotRoots(block);
|
|
28097
28233
|
for (let i = 0; i < block.returns.length; i++) {
|
|
28098
28234
|
const child = findReturnedDynamic$1(block, block.returns[i]);
|
|
28099
28235
|
const operation = child && child.operation;
|
|
28100
28236
|
if (!operation) continue;
|
|
28101
|
-
if (operation.type === 15) markSlotRootIf(operation, context
|
|
28237
|
+
if (operation.type === 15) markSlotRootIf(operation, context);
|
|
28102
28238
|
else if (operation.type === 16) markSlotRootFor(operation, context);
|
|
28103
28239
|
else if (operation.type === 17) {
|
|
28104
28240
|
operation.slotRoot = true;
|
|
28105
|
-
markSlotRootOperations(operation.block, context
|
|
28241
|
+
markSlotRootOperations(operation.block, context);
|
|
28106
28242
|
} else if (operation.type === 12) markSlotRootComponent(operation);
|
|
28107
|
-
else if (operation.type === 13)
|
|
28108
|
-
operation.flags |= 4;
|
|
28109
|
-
if (sharedFallback) operation.flags |= 8;
|
|
28110
|
-
}
|
|
28243
|
+
else if (operation.type === 13) operation.flags |= 4;
|
|
28111
28244
|
}
|
|
28112
28245
|
}
|
|
28113
|
-
function markSlotRootIf(operation, context
|
|
28246
|
+
function markSlotRootIf(operation, context) {
|
|
28114
28247
|
if (!operation.once) operation.slotRoot = true;
|
|
28115
|
-
markSlotRootOperations(operation.positive, context
|
|
28248
|
+
markSlotRootOperations(operation.positive, context);
|
|
28116
28249
|
const negative = operation.negative;
|
|
28117
28250
|
if (!negative) return;
|
|
28118
|
-
if (negative.type === 15) markSlotRootIf(negative, context
|
|
28119
|
-
else markSlotRootOperations(negative, context
|
|
28251
|
+
if (negative.type === 15) markSlotRootIf(negative, context);
|
|
28252
|
+
else markSlotRootOperations(negative, context);
|
|
28120
28253
|
}
|
|
28121
28254
|
function markSlotRootFor(operation, context) {
|
|
28122
28255
|
if (!operation.once) operation.slotRoot = true;
|
|
28123
|
-
markSlotRootOperations(operation.render, context
|
|
28124
|
-
}
|
|
28125
|
-
function hasMultipleDynamicSlotRoots(block) {
|
|
28126
|
-
let count = 0;
|
|
28127
|
-
for (let i = 0; i < block.returns.length; i++) {
|
|
28128
|
-
const child = findReturnedDynamic$1(block, block.returns[i]);
|
|
28129
|
-
if (child && child.operation && ++count > 1) return true;
|
|
28130
|
-
}
|
|
28131
|
-
return false;
|
|
28256
|
+
markSlotRootOperations(operation.render, context);
|
|
28132
28257
|
}
|
|
28133
28258
|
function markSlotRootComponent(operation) {
|
|
28134
28259
|
if (!operation.once && operation.dynamic && !operation.dynamic.isStatic) operation.slotRoot = true;
|
|
@@ -28446,6 +28571,94 @@ function genAssetImports({ ir }) {
|
|
|
28446
28571
|
return imports;
|
|
28447
28572
|
}
|
|
28448
28573
|
//#endregion
|
|
28574
|
+
//#region packages/compiler-vapor/src/htmlNesting.ts
|
|
28575
|
+
const isPClosingTag = /*@__PURE__*/ makeMap("address,article,aside,blockquote,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,main,menu,nav,ol,p,pre,section,summary,table,ul");
|
|
28576
|
+
const isForeign = (ns) => ns !== 0;
|
|
28577
|
+
const isScopeBoundaryTag = /*@__PURE__*/ makeMap("caption,object,select,table,td,th");
|
|
28578
|
+
const isFormattingMarkerTag = /*@__PURE__*/ makeMap("caption,object,td,th");
|
|
28579
|
+
const isSpecialTag = /*@__PURE__*/ makeMap("address,area,article,aside,base,blockquote,body,br,button,caption,col,colgroup,dd,details,div,dl,dt,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,iframe,img,input,li,link,main,menu,meta,nav,noscript,object,ol,p,param,pre,script,section,select,source,style,summary,table,tbody,td,template,textarea,tfoot,th,thead,title,tr,track,ul,wbr");
|
|
28580
|
+
const endsListItemSearch = (tag) => isSpecialTag(tag) && tag !== "address" && tag !== "div" && tag !== "p";
|
|
28581
|
+
/**
|
|
28582
|
+
* End tags with handling of their own pop whatever is still open below them.
|
|
28583
|
+
* Any other end tag is ignored when it meets a special element on its way up
|
|
28584
|
+
* the stack, and a formatting end tag runs the adoption agency around one, so
|
|
28585
|
+
* under those an open special descendant has to close itself.
|
|
28586
|
+
*/
|
|
28587
|
+
const popsOpenDescendants = /*@__PURE__*/ makeMap("address,article,aside,blockquote,button,caption,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,h1,h2,h3,h4,h5,h6,header,hgroup,li,main,menu,nav,object,ol,p,pre,section,summary,table,tbody,td,tfoot,th,thead,tr,ul");
|
|
28588
|
+
/**
|
|
28589
|
+
* Html start tags that end foreign content: the parser pops the open svg or
|
|
28590
|
+
* mathml elements and inserts these in the html namespace, while vdom creates
|
|
28591
|
+
* them in the foreign namespace their ast node carries. Only at html
|
|
28592
|
+
* integration points (`foreignObject`, `mi`, ...) do html children stay.
|
|
28593
|
+
*/
|
|
28594
|
+
const isForeignBreakoutTag = /*@__PURE__*/ makeMap("b,blockquote,body,br,code,dd,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,head,hr,i,img,li,menu,meta,ol,p,pre,ruby,s,small,span,strong,sub,sup,table,u,ul,var");
|
|
28595
|
+
/**
|
|
28596
|
+
* Table parts whose text content other than whitespace the parser
|
|
28597
|
+
* foster-parents in front of the table.
|
|
28598
|
+
*/
|
|
28599
|
+
const isFosterParentingTag = /*@__PURE__*/ makeMap("colgroup,table,tbody,tfoot,thead,tr");
|
|
28600
|
+
const isImpliedEndTag = /*@__PURE__*/ makeMap("dd,dt,li,optgroup,option,p,rp,rt");
|
|
28601
|
+
/**
|
|
28602
|
+
* The scope the children of `tag` see, given the scope `tag` itself was
|
|
28603
|
+
* written in (0 when it starts a template).
|
|
28604
|
+
*/
|
|
28605
|
+
function enterOpenScope(scope, tag, ns) {
|
|
28606
|
+
if (isForeign(ns)) {
|
|
28607
|
+
scope &= -104;
|
|
28608
|
+
return scope;
|
|
28609
|
+
}
|
|
28610
|
+
if (isScopeBoundaryTag(tag)) scope &= -8;
|
|
28611
|
+
if (isFormattingMarkerTag(tag)) scope &= -9;
|
|
28612
|
+
if (endsListItemSearch(tag)) scope &= -97;
|
|
28613
|
+
switch (tag) {
|
|
28614
|
+
case "p": return scope | 1;
|
|
28615
|
+
case "button": return scope & -2 | 2;
|
|
28616
|
+
case "ruby": return scope | 4;
|
|
28617
|
+
case "a": return scope | 8;
|
|
28618
|
+
case "form": return scope | 16;
|
|
28619
|
+
case "li": return scope | 32;
|
|
28620
|
+
case "dd":
|
|
28621
|
+
case "dt": return scope | 64;
|
|
28622
|
+
}
|
|
28623
|
+
return scope;
|
|
28624
|
+
}
|
|
28625
|
+
/**
|
|
28626
|
+
* Whether the html parser places an element written under `parent` there, so
|
|
28627
|
+
* that both can share a template string. Two layers: `isValidHTMLNesting`
|
|
28628
|
+
* rejects what the parent itself cannot hold (table, row, select and raw-text
|
|
28629
|
+
* content models, void parents), `closesOpenAncestor` the start tags that end
|
|
28630
|
+
* an element still open above. The end-tag omission in transformElement
|
|
28631
|
+
* assumes only elements passing both share a template.
|
|
28632
|
+
*/
|
|
28633
|
+
function keepsInTemplate(tag, ns, parentTag, scope) {
|
|
28634
|
+
return isValidHTMLNesting(parentTag, tag) && !closesOpenAncestor(tag, ns, parentTag, scope);
|
|
28635
|
+
}
|
|
28636
|
+
/**
|
|
28637
|
+
* Whether the html parser, on the start tag of `tag`, closes an element that
|
|
28638
|
+
* is still open above it in the same template - the `<p>` of
|
|
28639
|
+
* `<p><span><div>`, the `<li>` of `<li><span><li>`, a link inside a link. The
|
|
28640
|
+
* element would then end up elsewhere than the compiler expects, so it has to
|
|
28641
|
+
* go into a template of its own. Transcribed from the "in body" insertion mode
|
|
28642
|
+
* of https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody
|
|
28643
|
+
* for the native html tags the compiler knows; `scope` is what the parent
|
|
28644
|
+
* leaves open (`enterOpenScope`).
|
|
28645
|
+
*/
|
|
28646
|
+
function closesOpenAncestor(tag, ns, parentTag, scope) {
|
|
28647
|
+
if (isForeign(ns)) return false;
|
|
28648
|
+
if (isPClosingTag(tag) && scope & 1) return true;
|
|
28649
|
+
switch (tag) {
|
|
28650
|
+
case "li": return !!(scope & 32);
|
|
28651
|
+
case "dd":
|
|
28652
|
+
case "dt": return !!(scope & 64);
|
|
28653
|
+
case "button": return !!(scope & 2);
|
|
28654
|
+
case "a": return !!(scope & 8);
|
|
28655
|
+
case "form": return !!(scope & 16);
|
|
28656
|
+
case "rt":
|
|
28657
|
+
case "rp": return !!(scope & 4) && isImpliedEndTag(parentTag);
|
|
28658
|
+
}
|
|
28659
|
+
return false;
|
|
28660
|
+
}
|
|
28661
|
+
//#endregion
|
|
28449
28662
|
//#region packages/compiler-vapor/src/transforms/vBind.ts
|
|
28450
28663
|
function normalizeBindShorthand(arg, context) {
|
|
28451
28664
|
if (arg.type !== 4 || !arg.isStatic) {
|
|
@@ -28615,7 +28828,7 @@ const transformElement = (node, context) => {
|
|
|
28615
28828
|
const staticKey = dynamicComponentKeys.has(node) ? void 0 : resolveStaticKey(node, context, isComponent);
|
|
28616
28829
|
const propsResult = buildProps(node, context, isComponent, isDynamicComponent, getEffectIndex);
|
|
28617
28830
|
const singleRoot = context.isSingleRoot;
|
|
28618
|
-
if (isComponent) transformComponentElement(node, propsResult, staticKey, singleRoot, context, isDynamicComponent, useCreateElement);
|
|
28831
|
+
if (isComponent) transformComponentElement(node, propsResult, staticKey, singleRoot || context.isSlotRoot && !useCreateElement && 2, context, isDynamicComponent, useCreateElement);
|
|
28619
28832
|
else transformNativeElement(node, propsResult, staticKey, singleRoot, context, getEffectIndex, context.root === context.effectiveParent || canOmitEndTag(node, context));
|
|
28620
28833
|
if (parentSlots) context.slots = parentSlots;
|
|
28621
28834
|
};
|
|
@@ -28624,7 +28837,7 @@ function canOmitEndTag(node, context) {
|
|
|
28624
28837
|
const { block, parent } = context;
|
|
28625
28838
|
if (!parent) return false;
|
|
28626
28839
|
if (block !== parent.block) return true;
|
|
28627
|
-
if (context.templateCloseTags && (context.templateCloseTags.has(node.tag) || context.templateCloseTags.has("form") || context.templateCloseTags.has("li") && (node.tag === "ul" || node.tag === "ol") || isAlwaysCloseTag(node.tag) || isFormattingTag(node.tag)) || context.templateCloseBlocks &&
|
|
28840
|
+
if (context.templateCloseTags && (context.templateCloseTags.has(node.tag) || context.templateCloseTags.has("form") || context.templateCloseTags.has("li") && (node.tag === "ul" || node.tag === "ol") || isAlwaysCloseTag(node.tag) || isFormattingTag(node.tag)) || context.templateCloseBlocks && isSpecialTag(node.tag)) return false;
|
|
28628
28841
|
if (isAlwaysCloseTag(node.tag) && !context.isOnRightmostPath) return false;
|
|
28629
28842
|
if (isFormattingTag(node.tag) || parent.node.type === 1 && (node.tag === parent.node.tag || parent.node.ns !== 0 && node.ns !== parent.node.ns)) return context.isOnRightmostPath;
|
|
28630
28843
|
return context.isLastEffectiveChild;
|
|
@@ -28632,9 +28845,8 @@ function canOmitEndTag(node, context) {
|
|
|
28632
28845
|
function getChildTemplateCloseState(context) {
|
|
28633
28846
|
const { node } = context;
|
|
28634
28847
|
if (node.type !== 1 || node.tagType !== 0 || shouldUseCreateElement(node, context)) return;
|
|
28635
|
-
const
|
|
28636
|
-
const
|
|
28637
|
-
const inheritedBlocks = inSameTemplateAsParent && context.templateCloseBlocks;
|
|
28848
|
+
const inheritedTags = context.templateCloseTags;
|
|
28849
|
+
const inheritedBlocks = context.templateCloseBlocks;
|
|
28638
28850
|
if (context.root === context.effectiveParent || canOmitEndTag(node, context) || isVoidTag(node.tag)) return inheritedTags || inheritedBlocks ? {
|
|
28639
28851
|
tags: inheritedTags,
|
|
28640
28852
|
blocks: inheritedBlocks
|
|
@@ -28643,20 +28855,23 @@ function getChildTemplateCloseState(context) {
|
|
|
28643
28855
|
tags.add(node.tag);
|
|
28644
28856
|
return {
|
|
28645
28857
|
tags,
|
|
28646
|
-
blocks:
|
|
28858
|
+
blocks: !popsOpenDescendants(node.tag)
|
|
28647
28859
|
};
|
|
28648
28860
|
}
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28861
|
+
/**
|
|
28862
|
+
* The parent whose template string the element would be written into: a
|
|
28863
|
+
* plain element in the same block that is not created with createElement.
|
|
28864
|
+
*/
|
|
28865
|
+
function getTemplateParent(context) {
|
|
28866
|
+
const { parent, block } = context;
|
|
28867
|
+
if (!parent || block !== parent.block) return;
|
|
28652
28868
|
const parentNode = parent.node;
|
|
28653
|
-
if (parentNode.type
|
|
28654
|
-
return !shouldUseCreateElement(parentNode, parent) && isValidHTMLNesting(parentNode.tag, node.tag);
|
|
28869
|
+
if (parentNode.type === 1 && parentNode.tagType === 0 && !shouldUseCreateElement(parentNode, parent)) return parent;
|
|
28655
28870
|
}
|
|
28656
|
-
function transformComponentElement(node, propsResult, staticKey,
|
|
28871
|
+
function transformComponentElement(node, propsResult, staticKey, root, context, isDynamicComponent, useCreateElement) {
|
|
28657
28872
|
const dynamicComponent = isDynamicComponent ? resolveDynamicComponent(node) : void 0;
|
|
28658
28873
|
let { tag } = node;
|
|
28659
|
-
let asset =
|
|
28874
|
+
let asset = !useCreateElement;
|
|
28660
28875
|
let slotScopeNamespace;
|
|
28661
28876
|
if (!dynamicComponent && !useCreateElement) {
|
|
28662
28877
|
const isProp = findProp(node, "is");
|
|
@@ -28704,7 +28919,7 @@ function transformComponentElement(node, propsResult, staticKey, singleRoot, con
|
|
|
28704
28919
|
slotScopeNamespace,
|
|
28705
28920
|
props,
|
|
28706
28921
|
asset,
|
|
28707
|
-
root
|
|
28922
|
+
root,
|
|
28708
28923
|
slots: [...context.slots],
|
|
28709
28924
|
once: context.inVOnce,
|
|
28710
28925
|
dynamic: dynamicComponent,
|
|
@@ -28869,7 +29084,7 @@ function transformNativeElement(node, propsResult, staticKey, singleRoot, contex
|
|
|
28869
29084
|
template += `>` + children;
|
|
28870
29085
|
if (!isVoidTag(tag) && !omitEndTag) template += `</${tag}>`;
|
|
28871
29086
|
context.templateRoot = singleRoot;
|
|
28872
|
-
if (context.parent && context.parent.node.type === 1 && !isValidHTMLNesting(context.parent.node.tag, tag)) {
|
|
29087
|
+
if (context.parent && context.parent.node.type === 1 && !isValidHTMLNesting(context.parent.node.tag, tag) || !(context.templateScope & 128) && getTemplateParent(context) !== void 0) {
|
|
28873
29088
|
context.reference();
|
|
28874
29089
|
context.dynamic.template = context.pushTemplate(template);
|
|
28875
29090
|
context.dynamic.flags |= 6;
|
|
@@ -29386,7 +29601,7 @@ function mergePropValues(existing, incoming) {
|
|
|
29386
29601
|
existing.values.push(...newValues);
|
|
29387
29602
|
}
|
|
29388
29603
|
function shouldUseCreateElement(node, context) {
|
|
29389
|
-
return context.options.isCustomElement(node.tag) || node.tagType === 0 && node.tag === "template";
|
|
29604
|
+
return context.options.isCustomElement(node.tag) || node.tagType === 0 && (node.tag === "template" || node.ns !== 0 && isForeignBreakoutTag(node.tag));
|
|
29390
29605
|
}
|
|
29391
29606
|
//#endregion
|
|
29392
29607
|
//#region packages/compiler-vapor/src/transforms/transformChildren.ts
|
|
@@ -29394,12 +29609,16 @@ const transformChildren = (node, context) => {
|
|
|
29394
29609
|
const isFragment = node.type === 0 || node.type === 1 && (node.tagType === 3 || node.tagType === 1);
|
|
29395
29610
|
if (!isFragment && node.type !== 1) return;
|
|
29396
29611
|
const useCreateElement = node.type === 1 && shouldUseCreateElement(node, context);
|
|
29397
|
-
const
|
|
29612
|
+
const hostsTemplate = node.type === 1 && node.tagType === 0 && !useCreateElement;
|
|
29613
|
+
const childTemplateCloseState = hostsTemplate ? getChildTemplateCloseState(context) : void 0;
|
|
29614
|
+
const childScope = hostsTemplate ? enterOpenScope(context.templateScope, node.tag, node.ns) : 0;
|
|
29398
29615
|
for (const [i, child] of node.children.entries()) {
|
|
29399
29616
|
const childContext = context.create(child, i);
|
|
29400
|
-
const isInSameTemplate =
|
|
29401
|
-
|
|
29402
|
-
childContext.
|
|
29617
|
+
const isInSameTemplate = hostsTemplate && child.type === 1 && child.tagType === 0 && keepsInTemplate(child.tag, child.ns, node.tag, childScope);
|
|
29618
|
+
const closeState = isInSameTemplate ? childTemplateCloseState : void 0;
|
|
29619
|
+
childContext.templateScope = isInSameTemplate ? childScope | 128 : 0;
|
|
29620
|
+
childContext.templateCloseTags = closeState && closeState.tags;
|
|
29621
|
+
childContext.templateCloseBlocks = !!closeState && closeState.blocks;
|
|
29403
29622
|
transformNode(childContext);
|
|
29404
29623
|
const childDynamic = childContext.dynamic;
|
|
29405
29624
|
const createsNode = isFragment || childContext.template !== "" || childDynamic.template != null || childDynamic.id !== void 0 || childDynamic.operation !== void 0 || childDynamic.hasDynamicChild === true;
|
|
@@ -29527,7 +29746,7 @@ const transformText = (node, context) => {
|
|
|
29527
29746
|
const createElementParent = parent && parent.type === 1 && shouldUseCreateElement(parent, context.parent);
|
|
29528
29747
|
const isRootText = !parent || parent.type === 0 || parent.type === 1 && (parent.tagType === 3 || parent.tagType === 1);
|
|
29529
29748
|
const isRawText = createElementParent || isRootText;
|
|
29530
|
-
if (
|
|
29749
|
+
if (needsTextNode(parent, node.content, isRawText)) {
|
|
29531
29750
|
materializeLiteralTextNode(createSimpleExpression(node.content, true, node.loc), context);
|
|
29532
29751
|
return;
|
|
29533
29752
|
}
|
|
@@ -29543,7 +29762,7 @@ function processInterpolation(context) {
|
|
|
29543
29762
|
const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
|
|
29544
29763
|
if (text !== null && parentNode.type !== 0 && (isElementChild || text !== "")) {
|
|
29545
29764
|
const isRawText = !isElementChild || parentNode.type === 1 && shouldUseCreateElement(parentNode, context.parent);
|
|
29546
|
-
if (
|
|
29765
|
+
if (needsTextNode(parentNode, text, isRawText)) {
|
|
29547
29766
|
materializeLiteralTextNode(createSimpleExpression(text, true, context.node.loc), context);
|
|
29548
29767
|
return;
|
|
29549
29768
|
}
|
|
@@ -29609,6 +29828,16 @@ function registerSyntheticTextChild(context, template, values) {
|
|
|
29609
29828
|
function processCreateElementTextContainer(children, context) {
|
|
29610
29829
|
registerSyntheticTextChild(context, "", processTextLikeChildren(children, context));
|
|
29611
29830
|
}
|
|
29831
|
+
/**
|
|
29832
|
+
* Text that cannot be written into a template string and is created
|
|
29833
|
+
* imperatively instead: unescaped text starting with "<" (the runtime only
|
|
29834
|
+
* turns a template into a text node when it does not start with "<", see
|
|
29835
|
+
* `template()` in runtime-vapor), and text other than ascii whitespace in a
|
|
29836
|
+
* table part, which the parser would move in front of the table.
|
|
29837
|
+
*/
|
|
29838
|
+
function needsTextNode(parent, text, isRawText) {
|
|
29839
|
+
return isRawText && text[0] === "<" || !!parent && parent.type === 1 && parent.ns === 0 && isFosterParentingTag(parent.tag) && !isAllWhitespace(text);
|
|
29840
|
+
}
|
|
29612
29841
|
function materializeLiteralTextNode(value, context) {
|
|
29613
29842
|
const id = context.reference();
|
|
29614
29843
|
context.dynamic.flags |= 6;
|
|
@@ -29973,7 +30202,7 @@ function processIf(node, dir, context) {
|
|
|
29973
30202
|
const [branch, onExit] = createIfBranch(node, context);
|
|
29974
30203
|
return () => {
|
|
29975
30204
|
onExit();
|
|
29976
|
-
|
|
30205
|
+
const operation = _objectSpread2(_objectSpread2({
|
|
29977
30206
|
type: 15,
|
|
29978
30207
|
id
|
|
29979
30208
|
}, context.effectBoundary()), {}, {
|
|
@@ -29983,6 +30212,8 @@ function processIf(node, dir, context) {
|
|
|
29983
30212
|
index: context.root.nextIfIndex(),
|
|
29984
30213
|
once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
|
|
29985
30214
|
});
|
|
30215
|
+
context.dynamic.operation = operation;
|
|
30216
|
+
context.root.ifHeads.set(operation, context.inVOnce);
|
|
29986
30217
|
};
|
|
29987
30218
|
} else {
|
|
29988
30219
|
const siblingIf = getSiblingIf(context, true);
|
|
@@ -29999,9 +30230,13 @@ function processIf(node, dir, context) {
|
|
|
29999
30230
|
context.options.onError(createCompilerError(30, node.loc));
|
|
30000
30231
|
return;
|
|
30001
30232
|
}
|
|
30233
|
+
const head = lastIfNode;
|
|
30002
30234
|
while (lastIfNode.negative && lastIfNode.negative.type === 15) lastIfNode = lastIfNode.negative;
|
|
30235
|
+
const parent = context.parent;
|
|
30236
|
+
context.inVOnce = parent.inVOnce && !isComponentNode(parent.node) || !!context.root.ifHeads.get(head);
|
|
30003
30237
|
if (dir.name === "else-if" && lastIfNode.negative) context.options.onError(createCompilerError(30, node.loc));
|
|
30004
30238
|
checkSameKey(node, context);
|
|
30239
|
+
if (!context.inVOnce) context.node = node = extend({}, node, { props: node.props.filter((prop) => prop.type !== 7 || prop.name !== "once") });
|
|
30005
30240
|
const comments = context.comment;
|
|
30006
30241
|
if (comments.length) {
|
|
30007
30242
|
if (!isInTransition(context)) {
|
|
@@ -30206,6 +30441,7 @@ const transformSlotOutlet = (node, context) => {
|
|
|
30206
30441
|
function createFallback(node, context) {
|
|
30207
30442
|
if (!node.children.length) return [];
|
|
30208
30443
|
context.isSingleRoot = false;
|
|
30444
|
+
context.isSlotRoot = false;
|
|
30209
30445
|
context.node = node = extend({}, node, {
|
|
30210
30446
|
type: 1,
|
|
30211
30447
|
tag: "template",
|
|
@@ -30234,11 +30470,11 @@ const transformVSlot = (node, context) => {
|
|
|
30234
30470
|
function transformComponentSlot(node, dir, context) {
|
|
30235
30471
|
const { children } = node;
|
|
30236
30472
|
const arg = dir && dir.arg;
|
|
30237
|
-
const hasTemplateSlots = children.some(
|
|
30473
|
+
const hasTemplateSlots = children.some(isSlotTemplate);
|
|
30238
30474
|
const isTransitionHost = isTransitionHostNode(node);
|
|
30239
30475
|
const emptyTextNodes = [];
|
|
30240
30476
|
const nonSlotTemplateChildren = children.filter((n) => {
|
|
30241
|
-
if (
|
|
30477
|
+
if (isSlotTemplate(n)) return false;
|
|
30242
30478
|
if (n.type === 3 && (hasTemplateSlots || isTransitionHost)) {
|
|
30243
30479
|
ignoreComment(n, context);
|
|
30244
30480
|
return false;
|
|
@@ -30362,9 +30598,6 @@ function isNonWhitespaceContent(node) {
|
|
|
30362
30598
|
if (node.type !== 2) return true;
|
|
30363
30599
|
return !!node.content.trim();
|
|
30364
30600
|
}
|
|
30365
|
-
function isSlotTemplateChild(node) {
|
|
30366
|
-
return node.type === 1 && isTemplateNode(node) && !!findDir(node, "slot", true);
|
|
30367
|
-
}
|
|
30368
30601
|
//#endregion
|
|
30369
30602
|
//#region packages/compiler-vapor/src/transforms/transformTransition.ts
|
|
30370
30603
|
const transformTransition = (node, context) => {
|
|
@@ -30477,6 +30710,7 @@ var src_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
30477
30710
|
//#region packages/compiler-ssr/src/runtimeHelpers.ts
|
|
30478
30711
|
const SSR_INTERPOLATE = Symbol(`ssrInterpolate`);
|
|
30479
30712
|
const SSR_RENDER_VNODE = Symbol(`ssrRenderVNode`);
|
|
30713
|
+
const SSR_RENDER_DYNAMIC_COMPONENT = Symbol(`ssrRenderDynamicComponent`);
|
|
30480
30714
|
const SSR_RENDER_COMPONENT = Symbol(`ssrRenderComponent`);
|
|
30481
30715
|
const SSR_RENDER_SLOT = Symbol(`ssrRenderSlot`);
|
|
30482
30716
|
const SSR_RENDER_SLOT_INNER = Symbol(`ssrRenderSlotInner`);
|
|
@@ -30497,6 +30731,7 @@ const SSR_GET_DIRECTIVE_PROPS = Symbol(`ssrGetDirectiveProps`);
|
|
|
30497
30731
|
const ssrHelpers = {
|
|
30498
30732
|
[SSR_INTERPOLATE]: `ssrInterpolate`,
|
|
30499
30733
|
[SSR_RENDER_VNODE]: `ssrRenderVNode`,
|
|
30734
|
+
[SSR_RENDER_DYNAMIC_COMPONENT]: `ssrRenderDynamicComponent`,
|
|
30500
30735
|
[SSR_RENDER_COMPONENT]: `ssrRenderComponent`,
|
|
30501
30736
|
[SSR_RENDER_SLOT]: `ssrRenderSlot`,
|
|
30502
30737
|
[SSR_RENDER_SLOT_INNER]: `ssrRenderSlotInner`,
|
|
@@ -30893,7 +31128,14 @@ const ssrTransformComponent = (node, context) => {
|
|
|
30893
31128
|
return fn;
|
|
30894
31129
|
};
|
|
30895
31130
|
const slots = node.children.length ? buildSlots(node, context, buildSSRSlotFn).slots : `null`;
|
|
30896
|
-
if (typeof component !== "string") node.ssrCodegenNode = createCallExpression(context.helper(
|
|
31131
|
+
if (typeof component !== "string" && rawOptionsMap.get(context.root).vapor) node.ssrCodegenNode = createCallExpression(context.helper(SSR_RENDER_DYNAMIC_COMPONENT), [
|
|
31132
|
+
`_push`,
|
|
31133
|
+
component,
|
|
31134
|
+
propsExp,
|
|
31135
|
+
slots,
|
|
31136
|
+
`_parent`
|
|
31137
|
+
]);
|
|
31138
|
+
else if (typeof component !== "string") node.ssrCodegenNode = createCallExpression(context.helper(SSR_RENDER_VNODE), [
|
|
30897
31139
|
`_push`,
|
|
30898
31140
|
createCallExpression(context.helper(CREATE_VNODE), [
|
|
30899
31141
|
component,
|
|
@@ -31545,10 +31787,10 @@ var require_picocolors_browser = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
31545
31787
|
module.exports.createColors = create;
|
|
31546
31788
|
}));
|
|
31547
31789
|
//#endregion
|
|
31548
|
-
//#region (ignored) node_modules/.pnpm/postcss@8.5.
|
|
31790
|
+
//#region (ignored) node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/terminal-highlight
|
|
31549
31791
|
var require_terminal_highlight = /* @__PURE__ */ __commonJSMin((() => {}));
|
|
31550
31792
|
//#endregion
|
|
31551
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
31793
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/css-syntax-error.js
|
|
31552
31794
|
var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31553
31795
|
let pico = require_picocolors_browser();
|
|
31554
31796
|
let terminalHighlight = require_terminal_highlight();
|
|
@@ -31625,16 +31867,9 @@ var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
31625
31867
|
CssSyntaxError.default = CssSyntaxError;
|
|
31626
31868
|
}));
|
|
31627
31869
|
//#endregion
|
|
31628
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
31870
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/stringifier.js
|
|
31629
31871
|
var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31630
|
-
const STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
31631
|
-
const COMMENT_OPEN = /(<)(!--)/g;
|
|
31632
31872
|
const AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/;
|
|
31633
|
-
function escapeHTMLInCSS(str) {
|
|
31634
|
-
if (typeof str !== "string") return str;
|
|
31635
|
-
if (!str.includes("<")) return str;
|
|
31636
|
-
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
31637
|
-
}
|
|
31638
31873
|
const DEFAULT_RAW = {
|
|
31639
31874
|
after: "\n",
|
|
31640
31875
|
beforeClose: "\n",
|
|
@@ -31663,7 +31898,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31663
31898
|
function isCustomProperty(node) {
|
|
31664
31899
|
if (!node.prop.startsWith("--")) return false;
|
|
31665
31900
|
let before = node.raws.before;
|
|
31666
|
-
return typeof before === "undefined" ||
|
|
31901
|
+
return typeof before === "undefined" || !/[^\s;]$/.test(before);
|
|
31667
31902
|
}
|
|
31668
31903
|
function pushBody(str, stack, node) {
|
|
31669
31904
|
let nodes = node.nodes;
|
|
@@ -31687,13 +31922,13 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31687
31922
|
}
|
|
31688
31923
|
function pushBlock(str, stack, node, start) {
|
|
31689
31924
|
let between = str.raw(node, "between", "beforeOpen");
|
|
31690
|
-
str.builder(
|
|
31925
|
+
str.builder(start + between + "{", node, "start");
|
|
31691
31926
|
let hasNodes = node.nodes && node.nodes.length;
|
|
31692
31927
|
let close = () => {
|
|
31693
31928
|
let after = hasNodes ? str.raw(node, "after") : str.raw(node, "after", "emptyBody");
|
|
31694
|
-
if (after) str.builder(
|
|
31929
|
+
if (after) str.builder(after);
|
|
31695
31930
|
str.builder("}", node, "end");
|
|
31696
|
-
if (node.type === "rule" && node.raws.ownSemicolon) str.builder(
|
|
31931
|
+
if (node.type === "rule" && node.raws.ownSemicolon) str.builder(node.raws.ownSemicolon, node, "end");
|
|
31697
31932
|
};
|
|
31698
31933
|
if (hasNodes) {
|
|
31699
31934
|
stack.push(close);
|
|
@@ -31709,7 +31944,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31709
31944
|
if (node.nodes) this.block(node, start);
|
|
31710
31945
|
else {
|
|
31711
31946
|
let end = (node.raws.between || "") + (semicolon ? ";" : "");
|
|
31712
|
-
this.builder(
|
|
31947
|
+
this.builder(start + end, node);
|
|
31713
31948
|
}
|
|
31714
31949
|
}
|
|
31715
31950
|
beforeAfter(node, detect) {
|
|
@@ -31732,13 +31967,13 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31732
31967
|
}
|
|
31733
31968
|
block(node, start) {
|
|
31734
31969
|
let between = this.raw(node, "between", "beforeOpen");
|
|
31735
|
-
this.builder(
|
|
31970
|
+
this.builder(start + between + "{", node, "start");
|
|
31736
31971
|
let after;
|
|
31737
31972
|
if (node.nodes && node.nodes.length) {
|
|
31738
31973
|
this.body(node);
|
|
31739
31974
|
after = this.raw(node, "after");
|
|
31740
31975
|
} else after = this.raw(node, "after", "emptyBody");
|
|
31741
|
-
if (after) this.builder(
|
|
31976
|
+
if (after) this.builder(after);
|
|
31742
31977
|
this.builder("}", node, "end");
|
|
31743
31978
|
}
|
|
31744
31979
|
body(node) {
|
|
@@ -31760,7 +31995,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31760
31995
|
}
|
|
31761
31996
|
let child = entry.node;
|
|
31762
31997
|
let before = this.raw(child, "before");
|
|
31763
|
-
if (before) this.builder(
|
|
31998
|
+
if (before) this.builder(before);
|
|
31764
31999
|
if (expandable && child.type === "rule") pushBlock(this, stack, child, this.rawValue(child, "selector"));
|
|
31765
32000
|
else if (expandable && child.type === "atrule" && child.nodes) pushBlock(this, stack, child, atruleStart(this, child));
|
|
31766
32001
|
else this.stringify(child, entry.semicolon);
|
|
@@ -31769,7 +32004,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31769
32004
|
comment(node) {
|
|
31770
32005
|
let left = this.raw(node, "left", "commentLeft");
|
|
31771
32006
|
let right = this.raw(node, "right", "commentRight");
|
|
31772
|
-
this.builder(
|
|
32007
|
+
this.builder("/*" + left + node.text + right + "*/", node);
|
|
31773
32008
|
}
|
|
31774
32009
|
decl(node, semicolon) {
|
|
31775
32010
|
let raws = node.raws;
|
|
@@ -31777,7 +32012,7 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31777
32012
|
let string = node.prop + between + this.rawValue(node, "value");
|
|
31778
32013
|
if (node.important) string += raws.important || " !important";
|
|
31779
32014
|
if (semicolon) string += ";";
|
|
31780
|
-
this.builder(
|
|
32015
|
+
this.builder(string, node);
|
|
31781
32016
|
}
|
|
31782
32017
|
document(node) {
|
|
31783
32018
|
this.body(node);
|
|
@@ -31928,17 +32163,13 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31928
32163
|
return value;
|
|
31929
32164
|
}
|
|
31930
32165
|
root(node) {
|
|
31931
|
-
if (node.source && node.source.input.hasBOM) this.builder("", node, "start");
|
|
32166
|
+
if (!(node.parent && node.parent.type === "document") && node.source && node.source.input.hasBOM) this.builder("", node, "start");
|
|
31932
32167
|
this.body(node);
|
|
31933
|
-
if (node.raws.after)
|
|
31934
|
-
let after = node.raws.after;
|
|
31935
|
-
let isDocument = node.parent && node.parent.type === "document";
|
|
31936
|
-
this.builder(isDocument ? after : escapeHTMLInCSS(after));
|
|
31937
|
-
}
|
|
32168
|
+
if (node.raws.after) this.builder(node.raws.after);
|
|
31938
32169
|
}
|
|
31939
32170
|
rule(node) {
|
|
31940
32171
|
this.block(node, this.rawValue(node, "selector"));
|
|
31941
|
-
if (node.raws.ownSemicolon) this.builder(
|
|
32172
|
+
if (node.raws.ownSemicolon) this.builder(node.raws.ownSemicolon, node, "end");
|
|
31942
32173
|
}
|
|
31943
32174
|
stringify(node, semicolon) {
|
|
31944
32175
|
/* c8 ignore start */
|
|
@@ -31951,23 +32182,62 @@ var require_stringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
31951
32182
|
Stringifier.default = Stringifier;
|
|
31952
32183
|
}));
|
|
31953
32184
|
//#endregion
|
|
31954
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32185
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/stringify.js
|
|
31955
32186
|
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31956
32187
|
let Stringifier = require_stringifier();
|
|
32188
|
+
const STYLE_TAG = /(<)(\/?style\b)/gi;
|
|
32189
|
+
const COMMENT_OPEN = /(<)(!--)/g;
|
|
32190
|
+
function escapeHTMLInCSS(str) {
|
|
32191
|
+
if (!str.includes("<")) return str;
|
|
32192
|
+
return str.replace(STYLE_TAG, "\\3c $2").replace(COMMENT_OPEN, "\\3c $2");
|
|
32193
|
+
}
|
|
32194
|
+
var SafeStringifier = class extends Stringifier {
|
|
32195
|
+
escapeHTML(node, print) {
|
|
32196
|
+
let builder = this.builder;
|
|
32197
|
+
let chunks, css;
|
|
32198
|
+
this.builder = (str, child, type) => {
|
|
32199
|
+
if (chunks) {
|
|
32200
|
+
css += str;
|
|
32201
|
+
chunks.push(str, child, type);
|
|
32202
|
+
} else if (str.includes("<")) {
|
|
32203
|
+
css = str;
|
|
32204
|
+
chunks = [
|
|
32205
|
+
str,
|
|
32206
|
+
child,
|
|
32207
|
+
type
|
|
32208
|
+
];
|
|
32209
|
+
} else builder(str, child, type);
|
|
32210
|
+
};
|
|
32211
|
+
print();
|
|
32212
|
+
this.builder = builder;
|
|
32213
|
+
if (!chunks) return;
|
|
32214
|
+
let escaped = escapeHTMLInCSS(css);
|
|
32215
|
+
if (escaped === css) for (let i = 0; i < chunks.length; i += 3) builder(chunks[i], chunks[i + 1], chunks[i + 2]);
|
|
32216
|
+
else builder(escaped, node);
|
|
32217
|
+
}
|
|
32218
|
+
root(node) {
|
|
32219
|
+
if (node.parent && node.parent.type === "document") {
|
|
32220
|
+
this.escapeHTML(node, () => this.body(node));
|
|
32221
|
+
if (node.raws.after) this.builder(node.raws.after);
|
|
32222
|
+
} else this.escapeHTML(node, () => super.root(node));
|
|
32223
|
+
}
|
|
32224
|
+
};
|
|
31957
32225
|
function stringify(node, builder) {
|
|
31958
|
-
new
|
|
32226
|
+
let str = new SafeStringifier(builder);
|
|
32227
|
+
if (node.type === "root" || node.type === "document") str.stringify(node);
|
|
32228
|
+
else str.escapeHTML(node, () => str.stringify(node));
|
|
31959
32229
|
}
|
|
31960
32230
|
module.exports = stringify;
|
|
31961
32231
|
stringify.default = stringify;
|
|
31962
32232
|
}));
|
|
31963
32233
|
//#endregion
|
|
31964
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32234
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/symbols.js
|
|
31965
32235
|
var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31966
32236
|
module.exports.isClean = Symbol("isClean");
|
|
31967
32237
|
module.exports.my = Symbol("my");
|
|
31968
32238
|
}));
|
|
31969
32239
|
//#endregion
|
|
31970
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32240
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/node.js
|
|
31971
32241
|
var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
31972
32242
|
let CssSyntaxError = require_css_syntax_error();
|
|
31973
32243
|
let Stringifier = require_stringifier();
|
|
@@ -32329,7 +32599,7 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32329
32599
|
Node.default = Node;
|
|
32330
32600
|
}));
|
|
32331
32601
|
//#endregion
|
|
32332
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32602
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/comment.js
|
|
32333
32603
|
var require_comment$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32334
32604
|
let Node = require_node$1();
|
|
32335
32605
|
var Comment = class extends Node {
|
|
@@ -32342,7 +32612,7 @@ var require_comment$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32342
32612
|
Comment.default = Comment;
|
|
32343
32613
|
}));
|
|
32344
32614
|
//#endregion
|
|
32345
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32615
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/declaration.js
|
|
32346
32616
|
var require_declaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32347
32617
|
init_objectSpread2();
|
|
32348
32618
|
let Node = require_node$1();
|
|
@@ -32360,7 +32630,7 @@ var require_declaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32360
32630
|
Declaration.default = Declaration;
|
|
32361
32631
|
}));
|
|
32362
32632
|
//#endregion
|
|
32363
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32633
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/container.js
|
|
32364
32634
|
var require_container$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32365
32635
|
let Comment = require_comment$1();
|
|
32366
32636
|
let Declaration = require_declaration();
|
|
@@ -32696,7 +32966,7 @@ var require_container$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32696
32966
|
}));
|
|
32697
32967
|
/* c8 ignore stop */
|
|
32698
32968
|
//#endregion
|
|
32699
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32969
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/at-rule.js
|
|
32700
32970
|
var require_at_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32701
32971
|
let Container = require_container$1();
|
|
32702
32972
|
var AtRule = class extends Container {
|
|
@@ -32718,7 +32988,7 @@ var require_at_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32718
32988
|
Container.registerAtRule(AtRule);
|
|
32719
32989
|
}));
|
|
32720
32990
|
//#endregion
|
|
32721
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
32991
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/document.js
|
|
32722
32992
|
var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32723
32993
|
init_objectSpread2();
|
|
32724
32994
|
let Container = require_container$1();
|
|
@@ -32792,10 +33062,10 @@ var require_non_secure = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32792
33062
|
};
|
|
32793
33063
|
}));
|
|
32794
33064
|
//#endregion
|
|
32795
|
-
//#region (ignored) node_modules/.pnpm/postcss@8.5.
|
|
33065
|
+
//#region (ignored) node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib
|
|
32796
33066
|
var require_lib = /* @__PURE__ */ __commonJSMin((() => {}));
|
|
32797
33067
|
//#endregion
|
|
32798
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33068
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/previous-map.js
|
|
32799
33069
|
var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32800
33070
|
init__polyfill_node_buffer();
|
|
32801
33071
|
let { existsSync, readFileSync, realpathSync } = (init__polyfill_node_fs(), __toCommonJS(_polyfill_node_fs_exports));
|
|
@@ -32909,7 +33179,7 @@ var require_previous_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32909
33179
|
PreviousMap.default = PreviousMap;
|
|
32910
33180
|
}));
|
|
32911
33181
|
//#endregion
|
|
32912
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33182
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/input.js
|
|
32913
33183
|
var require_input = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32914
33184
|
init_objectSpread2();
|
|
32915
33185
|
let { nanoid } = require_non_secure();
|
|
@@ -33109,7 +33379,7 @@ var require_input = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33109
33379
|
if (terminalHighlight && terminalHighlight.registerInput) terminalHighlight.registerInput(Input);
|
|
33110
33380
|
}));
|
|
33111
33381
|
//#endregion
|
|
33112
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33382
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/root.js
|
|
33113
33383
|
var require_root$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33114
33384
|
let Container = require_container$1();
|
|
33115
33385
|
let LazyResult;
|
|
@@ -33154,7 +33424,7 @@ var require_root$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33154
33424
|
Container.registerRoot(Root);
|
|
33155
33425
|
}));
|
|
33156
33426
|
//#endregion
|
|
33157
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33427
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/list.js
|
|
33158
33428
|
var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33159
33429
|
let list = {
|
|
33160
33430
|
comma(string) {
|
|
@@ -33176,7 +33446,18 @@ var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33176
33446
|
let inQuote = false;
|
|
33177
33447
|
let prevQuote = "";
|
|
33178
33448
|
let escape = false;
|
|
33179
|
-
|
|
33449
|
+
let inComment = false;
|
|
33450
|
+
for (let i = 0; i < string.length; i++) {
|
|
33451
|
+
let letter = string[i];
|
|
33452
|
+
if (inComment) {
|
|
33453
|
+
current += letter;
|
|
33454
|
+
if (letter === "*" && string[i + 1] === "/") {
|
|
33455
|
+
current += "/";
|
|
33456
|
+
i += 1;
|
|
33457
|
+
inComment = false;
|
|
33458
|
+
}
|
|
33459
|
+
continue;
|
|
33460
|
+
}
|
|
33180
33461
|
if (escape) escape = false;
|
|
33181
33462
|
else if (letter === "\\") escape = true;
|
|
33182
33463
|
else if (inQuote) {
|
|
@@ -33184,6 +33465,11 @@ var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33184
33465
|
} else if (letter === "\"" || letter === "'") {
|
|
33185
33466
|
inQuote = true;
|
|
33186
33467
|
prevQuote = letter;
|
|
33468
|
+
} else if (letter === "/" && string[i + 1] === "*") {
|
|
33469
|
+
current += "/*";
|
|
33470
|
+
i += 1;
|
|
33471
|
+
inComment = true;
|
|
33472
|
+
continue;
|
|
33187
33473
|
} else if (letter === "(") func += 1;
|
|
33188
33474
|
else if (letter === ")") {
|
|
33189
33475
|
if (func > 0) func -= 1;
|
|
@@ -33206,7 +33492,7 @@ var require_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33206
33492
|
list.default = list;
|
|
33207
33493
|
}));
|
|
33208
33494
|
//#endregion
|
|
33209
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33495
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/rule.js
|
|
33210
33496
|
var require_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33211
33497
|
let Container = require_container$1();
|
|
33212
33498
|
let list = require_list();
|
|
@@ -33230,7 +33516,7 @@ var require_rule = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33230
33516
|
Container.registerRule(Rule);
|
|
33231
33517
|
}));
|
|
33232
33518
|
//#endregion
|
|
33233
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33519
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/fromJSON.js
|
|
33234
33520
|
var require_fromJSON = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33235
33521
|
init_objectSpread2();
|
|
33236
33522
|
init_objectWithoutProperties();
|
|
@@ -33306,7 +33592,7 @@ var require_fromJSON = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33306
33592
|
fromJSON.default = fromJSON;
|
|
33307
33593
|
}));
|
|
33308
33594
|
//#endregion
|
|
33309
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33595
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/map-generator.js
|
|
33310
33596
|
var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33311
33597
|
init__polyfill_node_buffer();
|
|
33312
33598
|
let { dirname, relative, resolve, sep } = (init__polyfill_node_path(), __toCommonJS(_polyfill_node_path_exports));
|
|
@@ -33361,13 +33647,17 @@ var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
33361
33647
|
}
|
|
33362
33648
|
} else if (this.css) {
|
|
33363
33649
|
let annotation = "/*# sourceMappingURL=";
|
|
33650
|
+
let css = "";
|
|
33651
|
+
let cursor = 0;
|
|
33364
33652
|
let startIndex;
|
|
33365
|
-
while ((startIndex = this.css.
|
|
33653
|
+
while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) {
|
|
33366
33654
|
let endIndex = this.css.indexOf("*/", startIndex + 21);
|
|
33367
33655
|
if (endIndex === -1) break;
|
|
33368
|
-
while (startIndex >
|
|
33369
|
-
|
|
33656
|
+
while (startIndex > cursor && this.css[startIndex - 1] === "\n") startIndex--;
|
|
33657
|
+
css += this.css.slice(cursor, startIndex);
|
|
33658
|
+
cursor = endIndex + 2;
|
|
33370
33659
|
}
|
|
33660
|
+
if (cursor > 0) this.css = css + this.css.slice(cursor);
|
|
33371
33661
|
}
|
|
33372
33662
|
}
|
|
33373
33663
|
generate() {
|
|
@@ -33578,7 +33868,7 @@ var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
33578
33868
|
module.exports = MapGenerator;
|
|
33579
33869
|
}));
|
|
33580
33870
|
//#endregion
|
|
33581
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
33871
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/tokenize.js
|
|
33582
33872
|
var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33583
33873
|
const SINGLE_QUOTE = "'".charCodeAt(0);
|
|
33584
33874
|
const DOUBLE_QUOTE = "\"".charCodeAt(0);
|
|
@@ -33815,7 +34105,7 @@ var require_tokenize$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
33815
34105
|
};
|
|
33816
34106
|
}));
|
|
33817
34107
|
//#endregion
|
|
33818
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34108
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/parser.js
|
|
33819
34109
|
var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
33820
34110
|
let AtRule = require_at_rule();
|
|
33821
34111
|
let Comment = require_comment$1();
|
|
@@ -34189,6 +34479,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34189
34479
|
let token, type;
|
|
34190
34480
|
let length = tokens.length;
|
|
34191
34481
|
let value = "";
|
|
34482
|
+
let last = "";
|
|
34192
34483
|
let clean = true;
|
|
34193
34484
|
let next, prev;
|
|
34194
34485
|
for (let i = 0; i < length; i += 1) {
|
|
@@ -34199,10 +34490,16 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34199
34490
|
prev = tokens[i - 1] ? tokens[i - 1][0] : "empty";
|
|
34200
34491
|
next = tokens[i + 1] ? tokens[i + 1][0] : "empty";
|
|
34201
34492
|
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
|
|
34202
|
-
if (
|
|
34203
|
-
else
|
|
34493
|
+
if (last === ",") clean = false;
|
|
34494
|
+
else {
|
|
34495
|
+
value += token[1];
|
|
34496
|
+
last = token[1].slice(-1);
|
|
34497
|
+
}
|
|
34204
34498
|
} else clean = false;
|
|
34205
|
-
} else
|
|
34499
|
+
} else {
|
|
34500
|
+
value += token[1];
|
|
34501
|
+
last = token[1].slice(-1);
|
|
34502
|
+
}
|
|
34206
34503
|
}
|
|
34207
34504
|
if (!clean) {
|
|
34208
34505
|
let raw = tokens.reduce((all, i) => all + i[1], "");
|
|
@@ -34277,7 +34574,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34277
34574
|
module.exports = Parser;
|
|
34278
34575
|
}));
|
|
34279
34576
|
//#endregion
|
|
34280
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34577
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/parse.js
|
|
34281
34578
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34282
34579
|
let Container = require_container$1();
|
|
34283
34580
|
let Input = require_input();
|
|
@@ -34302,7 +34599,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34302
34599
|
Container.registerParse(parse);
|
|
34303
34600
|
}));
|
|
34304
34601
|
//#endregion
|
|
34305
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34602
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/warning.js
|
|
34306
34603
|
var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34307
34604
|
let Container = require_container$1();
|
|
34308
34605
|
let { my } = require_symbols();
|
|
@@ -34334,7 +34631,7 @@ var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34334
34631
|
Warning.default = Warning;
|
|
34335
34632
|
}));
|
|
34336
34633
|
//#endregion
|
|
34337
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34634
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/result.js
|
|
34338
34635
|
var require_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34339
34636
|
let Warning = require_warning();
|
|
34340
34637
|
var Result = class {
|
|
@@ -34368,7 +34665,7 @@ var require_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34368
34665
|
Result.default = Result;
|
|
34369
34666
|
}));
|
|
34370
34667
|
//#endregion
|
|
34371
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34668
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/warn-once.js
|
|
34372
34669
|
var require_warn_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34373
34670
|
let printed = {};
|
|
34374
34671
|
module.exports = function warnOnce(message) {
|
|
@@ -34378,7 +34675,7 @@ var require_warn_once = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34378
34675
|
};
|
|
34379
34676
|
}));
|
|
34380
34677
|
//#endregion
|
|
34381
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
34678
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/lazy-result.js
|
|
34382
34679
|
var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34383
34680
|
init_objectSpread2();
|
|
34384
34681
|
init_asyncToGenerator();
|
|
@@ -34846,7 +35143,7 @@ var require_lazy_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34846
35143
|
Document.registerLazyResult(LazyResult);
|
|
34847
35144
|
}));
|
|
34848
35145
|
//#endregion
|
|
34849
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
35146
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/no-work-result.js
|
|
34850
35147
|
var require_no_work_result = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34851
35148
|
let MapGenerator = require_map_generator();
|
|
34852
35149
|
let parse = require_parse();
|
|
@@ -34943,7 +35240,7 @@ var require_no_work_result = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
34943
35240
|
NoWorkResult.default = NoWorkResult;
|
|
34944
35241
|
}));
|
|
34945
35242
|
//#endregion
|
|
34946
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
35243
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/processor.js
|
|
34947
35244
|
var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34948
35245
|
let Document = require_document();
|
|
34949
35246
|
let LazyResult = require_lazy_result();
|
|
@@ -34951,7 +35248,7 @@ var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34951
35248
|
let Root = require_root$1();
|
|
34952
35249
|
var Processor = class {
|
|
34953
35250
|
constructor(plugins = []) {
|
|
34954
|
-
this.version = "8.5.
|
|
35251
|
+
this.version = "8.5.29";
|
|
34955
35252
|
this.plugins = this.normalize(plugins);
|
|
34956
35253
|
}
|
|
34957
35254
|
normalize(plugins) {
|
|
@@ -34982,7 +35279,7 @@ var require_processor$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
34982
35279
|
Document.registerProcessor(Processor);
|
|
34983
35280
|
}));
|
|
34984
35281
|
//#endregion
|
|
34985
|
-
//#region node_modules/.pnpm/postcss@8.5.
|
|
35282
|
+
//#region node_modules/.pnpm/postcss@8.5.29/node_modules/postcss/lib/postcss.mjs
|
|
34986
35283
|
var import_postcss = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
34987
35284
|
init__polyfill_node_process();
|
|
34988
35285
|
let AtRule = require_at_rule();
|
|
@@ -43414,11 +43711,14 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
43414
43711
|
const excludedIds = /* @__PURE__ */ new WeakSet();
|
|
43415
43712
|
const parentStack = [];
|
|
43416
43713
|
const propsLocalToPublicMap = Object.create(null);
|
|
43714
|
+
const modelOptionNodes = /* @__PURE__ */ new Set();
|
|
43715
|
+
let currentModelOption = null;
|
|
43417
43716
|
for (const key in ctx.propsDestructuredBindings) {
|
|
43418
43717
|
const { local } = ctx.propsDestructuredBindings[key];
|
|
43419
43718
|
rootScope[local] = true;
|
|
43420
43719
|
propsLocalToPublicMap[local] = key;
|
|
43421
43720
|
}
|
|
43721
|
+
for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) for (const node of runtimeOptionNodes) modelOptionNodes.add(node);
|
|
43422
43722
|
function pushScope(isFunctionScope = false) {
|
|
43423
43723
|
const scope = currentScope = Object.create(currentScope);
|
|
43424
43724
|
scopeStack.push(scope);
|
|
@@ -43459,6 +43759,10 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
43459
43759
|
} });
|
|
43460
43760
|
}
|
|
43461
43761
|
function rewriteId(id, parent, parentStack) {
|
|
43762
|
+
if (currentModelOption) {
|
|
43763
|
+
const isDefault = (currentModelOption.type === "ObjectProperty" || currentModelOption.type === "ObjectMethod") && resolveObjectKey(currentModelOption.key, currentModelOption.computed) === "default";
|
|
43764
|
+
ctx.error(`\`${DEFINE_MODEL}()\` prop options cannot reference destructured props because they are hoisted outside of the setup() function.` + (isDefault ? ` Use the props argument of the default factory instead, e.g. default: props => props${genPropsAccessExp(propsLocalToPublicMap[id.name]).slice(`__props`.length)}` : ``), id);
|
|
43765
|
+
}
|
|
43462
43766
|
if (parent.type === "AssignmentExpression" && id === parent.left || parent.type === "UpdateExpression") ctx.error(`Cannot assign to destructured props as they are readonly.`, id);
|
|
43463
43767
|
if (isStaticProperty(parent) && parent.shorthand) {
|
|
43464
43768
|
if (!parent.inPattern || isInDestructureAssignment(parent, parentStack)) ctx.s.appendLeft(id.end + ctx.startOffset, `: ${genPropsAccessExp(propsLocalToPublicMap[id.name])}`);
|
|
@@ -43477,6 +43781,7 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
43477
43781
|
enter(node, parent) {
|
|
43478
43782
|
parent && parentStack.push(parent);
|
|
43479
43783
|
if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) return this.skip();
|
|
43784
|
+
if (modelOptionNodes.has(node)) currentModelOption = node;
|
|
43480
43785
|
checkUsage(node, "watch", vueImportAliases.watch);
|
|
43481
43786
|
checkUsage(node, "toRef", vueImportAliases.toRef);
|
|
43482
43787
|
if (isFunctionType(node)) {
|
|
@@ -43514,6 +43819,7 @@ function transformDestructuredProps(ctx, vueImportAliases) {
|
|
|
43514
43819
|
},
|
|
43515
43820
|
leave(node, parent) {
|
|
43516
43821
|
parent && parentStack.pop();
|
|
43822
|
+
if (node === currentModelOption) currentModelOption = null;
|
|
43517
43823
|
if (isFunctionType(node)) popScope(true);
|
|
43518
43824
|
else if (node.type === "BlockStatement" && !isFunctionType(parent)) popScope();
|
|
43519
43825
|
else if (node.type === "CatchClause" || node.type === "ForOfStatement" || node.type === "ForInStatement" || node.type === "ForStatement") popScope();
|
|
@@ -44060,7 +44366,7 @@ function compileScript(sfc, options) {
|
|
|
44060
44366
|
if (cssModuleBindings.length) returned = `{\n${cssModuleBindings.join("\n")}\n${returned}\n}`;
|
|
44061
44367
|
} else returned = `() => {}`;
|
|
44062
44368
|
if (!inlineMode && true) ctx.s.appendRight(endOffset, `\nconst __returned__ = ${returned}\nObject.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\nreturn __returned__\n}\n\n`);
|
|
44063
|
-
else ctx.s.appendRight(endOffset, `\n${vapor && !ssr && inlineMode ? `` : `return `}${returned}\n}\n\n`);
|
|
44369
|
+
else ctx.s.appendRight(endOffset, `\n${vapor && !ssr && inlineMode && !(!sfc.template && ctx.hasDefaultExportRender) ? `` : `return `}${returned}\n}\n\n`);
|
|
44064
44370
|
const genDefaultAs = options.genDefaultAs ? `const ${options.genDefaultAs} =` : `export default`;
|
|
44065
44371
|
let runtimeOptions = ``;
|
|
44066
44372
|
if (!ctx.hasDefaultExportName && filename && filename !== "anonymous.vue") {
|
|
@@ -44235,7 +44541,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
44235
44541
|
//#endregion
|
|
44236
44542
|
//#region packages/compiler-sfc/src/index.ts
|
|
44237
44543
|
init_objectSpread2();
|
|
44238
|
-
const version = "3.6.0-rc.
|
|
44544
|
+
const version = "3.6.0-rc.13";
|
|
44239
44545
|
const parseCache = parseCache$1;
|
|
44240
44546
|
const errorMessages = _objectSpread2(_objectSpread2({}, errorMessages$1), DOMErrorMessages);
|
|
44241
44547
|
const walk = walk$2;
|