@vue/compiler-sfc 3.6.0-beta.5 → 3.6.0-beta.7
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/README.md +1 -1
- package/dist/compiler-sfc.cjs.js +360 -139
- package/dist/compiler-sfc.esm-browser.js +122 -65
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-beta.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-beta.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -50,7 +50,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
|
-
//#region \0@oxc-project+runtime@0.
|
|
53
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/typeof.js
|
|
54
54
|
function _typeof(o) {
|
|
55
55
|
"@babel/helpers - typeof";
|
|
56
56
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -62,7 +62,7 @@ function _typeof(o) {
|
|
|
62
62
|
var init_typeof = __esmMin((() => {}));
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region \0@oxc-project+runtime@0.
|
|
65
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/toPrimitive.js
|
|
66
66
|
function toPrimitive(t, r) {
|
|
67
67
|
if ("object" != _typeof(t) || !t) return t;
|
|
68
68
|
var e = t[Symbol.toPrimitive];
|
|
@@ -78,7 +78,7 @@ var init_toPrimitive = __esmMin((() => {
|
|
|
78
78
|
}));
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
|
-
//#region \0@oxc-project+runtime@0.
|
|
81
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/toPropertyKey.js
|
|
82
82
|
function toPropertyKey(t) {
|
|
83
83
|
var i = toPrimitive(t, "string");
|
|
84
84
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -89,7 +89,7 @@ var init_toPropertyKey = __esmMin((() => {
|
|
|
89
89
|
}));
|
|
90
90
|
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region \0@oxc-project+runtime@0.
|
|
92
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/defineProperty.js
|
|
93
93
|
function _defineProperty(e, r, t) {
|
|
94
94
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
95
95
|
value: t,
|
|
@@ -103,7 +103,7 @@ var init_defineProperty = __esmMin((() => {
|
|
|
103
103
|
}));
|
|
104
104
|
|
|
105
105
|
//#endregion
|
|
106
|
-
//#region \0@oxc-project+runtime@0.
|
|
106
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/objectSpread2.js
|
|
107
107
|
function ownKeys(e, r) {
|
|
108
108
|
var t = Object.keys(e);
|
|
109
109
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -3649,7 +3649,7 @@ const errorMessages$1 = {
|
|
|
3649
3649
|
};
|
|
3650
3650
|
|
|
3651
3651
|
//#endregion
|
|
3652
|
-
//#region node_modules/.pnpm/@babel+parser@7.
|
|
3652
|
+
//#region node_modules/.pnpm/@babel+parser@7.29.0/node_modules/@babel/parser/lib/index.js
|
|
3653
3653
|
var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3654
3654
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3655
3655
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
@@ -12081,7 +12081,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12081
12081
|
return this.finishCallExpression(node, state.optionalChainMember);
|
|
12082
12082
|
}
|
|
12083
12083
|
const tokenType = this.state.type;
|
|
12084
|
-
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) return;
|
|
12084
|
+
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenType !== 93 && tokenType !== 120 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) return;
|
|
12085
12085
|
const node = this.startNodeAt(startLoc);
|
|
12086
12086
|
node.expression = base;
|
|
12087
12087
|
node.typeParameters = typeArguments;
|
|
@@ -12441,7 +12441,17 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12441
12441
|
}
|
|
12442
12442
|
parseClassSuper(node) {
|
|
12443
12443
|
super.parseClassSuper(node);
|
|
12444
|
-
if (node.superClass
|
|
12444
|
+
if (node.superClass) {
|
|
12445
|
+
if (node.superClass.type === "TSInstantiationExpression") {
|
|
12446
|
+
const tsInstantiationExpression = node.superClass;
|
|
12447
|
+
const superClass = tsInstantiationExpression.expression;
|
|
12448
|
+
this.takeSurroundingComments(superClass, superClass.start, superClass.end);
|
|
12449
|
+
const superTypeArguments = tsInstantiationExpression.typeParameters;
|
|
12450
|
+
this.takeSurroundingComments(superTypeArguments, superTypeArguments.start, superTypeArguments.end);
|
|
12451
|
+
node.superClass = superClass;
|
|
12452
|
+
node.superTypeParameters = superTypeArguments;
|
|
12453
|
+
} else if (this.match(47) || this.match(51)) node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
|
|
12454
|
+
}
|
|
12445
12455
|
if (this.eatContextual(113)) node.implements = this.tsParseHeritageClause("implements");
|
|
12446
12456
|
}
|
|
12447
12457
|
parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
|
|
@@ -16213,7 +16223,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16213
16223
|
}));
|
|
16214
16224
|
|
|
16215
16225
|
//#endregion
|
|
16216
|
-
//#region \0@oxc-project+runtime@0.
|
|
16226
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/asyncToGenerator.js
|
|
16217
16227
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
16218
16228
|
try {
|
|
16219
16229
|
var i = n[a](c), u = i.value;
|
|
@@ -24680,7 +24690,7 @@ function wrapTemplate(node, dirs) {
|
|
|
24680
24690
|
const reserved = [];
|
|
24681
24691
|
const pass = [];
|
|
24682
24692
|
node.props.forEach((prop) => {
|
|
24683
|
-
if (prop.type === 7 && dirs.includes(prop.name)) reserved.push(prop);
|
|
24693
|
+
if (prop.type === 7 && (dirs.includes(prop.name) || prop.name === "bind" && prop.arg && prop.arg.type === 4 && prop.arg.content === "key" && dirs.includes("key"))) reserved.push(prop);
|
|
24684
24694
|
else pass.push(prop);
|
|
24685
24695
|
});
|
|
24686
24696
|
return extend({}, node, {
|
|
@@ -24738,13 +24748,6 @@ function getLiteralExpressionValue(exp, excludeNumber) {
|
|
|
24738
24748
|
}
|
|
24739
24749
|
return exp.isStatic ? exp.content : null;
|
|
24740
24750
|
}
|
|
24741
|
-
function isInTransition(context) {
|
|
24742
|
-
const parentNode = context.parent && context.parent.node;
|
|
24743
|
-
return !!(parentNode && isTransitionNode(parentNode));
|
|
24744
|
-
}
|
|
24745
|
-
function isTransitionNode(node) {
|
|
24746
|
-
return node.type === 1 && isTransitionTag(node.tag);
|
|
24747
|
-
}
|
|
24748
24751
|
function isTransitionTag(tag) {
|
|
24749
24752
|
tag = tag.toLowerCase();
|
|
24750
24753
|
return tag === "transition" || tag === "vaportransition";
|
|
@@ -25201,8 +25204,10 @@ const IRNodeTypes = {
|
|
|
25201
25204
|
"14": "IF",
|
|
25202
25205
|
"FOR": 15,
|
|
25203
25206
|
"15": "FOR",
|
|
25204
|
-
"
|
|
25205
|
-
"16": "
|
|
25207
|
+
"KEY": 16,
|
|
25208
|
+
"16": "KEY",
|
|
25209
|
+
"GET_TEXT_CHILD": 17,
|
|
25210
|
+
"17": "GET_TEXT_CHILD"
|
|
25206
25211
|
};
|
|
25207
25212
|
const DynamicFlag = {
|
|
25208
25213
|
"NONE": 0,
|
|
@@ -25216,7 +25221,7 @@ const DynamicFlag = {
|
|
|
25216
25221
|
};
|
|
25217
25222
|
function isBlockOperation(op) {
|
|
25218
25223
|
const type = op.type;
|
|
25219
|
-
return type === 11 || type === 12 || type === 14 || type === 15;
|
|
25224
|
+
return type === 11 || type === 12 || type === 14 || type === 16 || type === 15;
|
|
25220
25225
|
}
|
|
25221
25226
|
|
|
25222
25227
|
//#endregion
|
|
@@ -26036,18 +26041,19 @@ function genPropValue(values, context) {
|
|
|
26036
26041
|
}
|
|
26037
26042
|
function getRuntimeHelper(tag, key, modifier) {
|
|
26038
26043
|
const tagName = tag.toUpperCase();
|
|
26039
|
-
|
|
26040
|
-
if (modifier) if (modifier === ".") return getSpecialHelper(key, tagName) || helpers.setDOMProp;
|
|
26041
|
-
else return helpers.setAttr;
|
|
26042
|
-
const helper = getSpecialHelper(key, tagName);
|
|
26044
|
+
const isSVG = isSVGTag(tag);
|
|
26045
|
+
if (modifier) if (modifier === ".") return getSpecialHelper(key, tagName, isSVG) || helpers.setDOMProp;
|
|
26046
|
+
else return isSVG ? extend({ isSVG: true }, helpers.setAttr) : helpers.setAttr;
|
|
26047
|
+
const helper = getSpecialHelper(key, tagName, isSVG);
|
|
26043
26048
|
if (helper) return helper;
|
|
26044
26049
|
if (/aria[A-Z]/.test(key)) return helpers.setDOMProp;
|
|
26050
|
+
if (isSVG) return extend({ isSVG: true }, helpers.setAttr);
|
|
26045
26051
|
if (shouldSetAsAttr(tagName, key) || key.includes("-")) return helpers.setAttr;
|
|
26046
26052
|
return helpers.setProp;
|
|
26047
26053
|
}
|
|
26048
|
-
function getSpecialHelper(keyName, tagName) {
|
|
26054
|
+
function getSpecialHelper(keyName, tagName, isSVG) {
|
|
26049
26055
|
if (keyName === "value" && canSetValueDirectly(tagName)) return helpers.setValue;
|
|
26050
|
-
else if (keyName === "class") return helpers.setClass;
|
|
26056
|
+
else if (keyName === "class") return extend({ isSVG }, helpers.setClass);
|
|
26051
26057
|
else if (keyName === "style") return helpers.setStyle;
|
|
26052
26058
|
else if (keyName === "innerHTML") return helpers.setHtml;
|
|
26053
26059
|
else if (keyName === "textContent") return helpers.setText;
|
|
@@ -26461,7 +26467,7 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
26461
26467
|
let propsName;
|
|
26462
26468
|
let exitScope;
|
|
26463
26469
|
let depth;
|
|
26464
|
-
const { props,
|
|
26470
|
+
const { props, node } = oper;
|
|
26465
26471
|
const idToPathMap = props ? parseValueDestructure(props, context) : /* @__PURE__ */ new Map();
|
|
26466
26472
|
if (props) if (props.ast) {
|
|
26467
26473
|
[depth, exitScope] = context.enterScope();
|
|
@@ -26471,16 +26477,6 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
26471
26477
|
if (propsName) idMap[propsName] = null;
|
|
26472
26478
|
let blockFn = context.withId(() => genBlock(oper, context, propsName ? [propsName] : []), idMap);
|
|
26473
26479
|
exitScope && exitScope();
|
|
26474
|
-
if (key) blockFn = [
|
|
26475
|
-
`() => {`,
|
|
26476
|
-
INDENT_START,
|
|
26477
|
-
NEWLINE,
|
|
26478
|
-
`return `,
|
|
26479
|
-
...genCall(context.helper("createKeyedFragment"), [`() => `, ...genExpression(key, context)], blockFn),
|
|
26480
|
-
INDENT_END,
|
|
26481
|
-
NEWLINE,
|
|
26482
|
-
`}`
|
|
26483
|
-
];
|
|
26484
26480
|
if (node.type === 1) {
|
|
26485
26481
|
if (needsVaporCtx(oper)) blockFn = [
|
|
26486
26482
|
`${context.helper("withVaporCtx")}(`,
|
|
@@ -26554,6 +26550,20 @@ function genSlotOutlet(oper, context) {
|
|
|
26554
26550
|
return frag;
|
|
26555
26551
|
}
|
|
26556
26552
|
|
|
26553
|
+
//#endregion
|
|
26554
|
+
//#region packages/compiler-vapor/src/generators/key.ts
|
|
26555
|
+
function genKey(oper, context) {
|
|
26556
|
+
const { id, value, block } = oper;
|
|
26557
|
+
const [frag, push] = buildCodeFragment();
|
|
26558
|
+
const blockFn = genBlock(block, context);
|
|
26559
|
+
push(NEWLINE, `const n${id} = `, ...genCall(context.helper("createKeyedFragment"), [
|
|
26560
|
+
`() => (`,
|
|
26561
|
+
...genExpression(value, context),
|
|
26562
|
+
")"
|
|
26563
|
+
], blockFn));
|
|
26564
|
+
return frag;
|
|
26565
|
+
}
|
|
26566
|
+
|
|
26557
26567
|
//#endregion
|
|
26558
26568
|
//#region packages/compiler-vapor/src/generators/operation.ts
|
|
26559
26569
|
function genOperations(opers, context) {
|
|
@@ -26580,10 +26590,11 @@ function genOperation(oper, context) {
|
|
|
26580
26590
|
case 10: return genPrependNode(oper, context);
|
|
26581
26591
|
case 14: return genIf(oper, context);
|
|
26582
26592
|
case 15: return genFor(oper, context);
|
|
26593
|
+
case 16: return genKey(oper, context);
|
|
26583
26594
|
case 11: return genCreateComponent(oper, context);
|
|
26584
26595
|
case 12: return genSlotOutlet(oper, context);
|
|
26585
26596
|
case 13: return genBuiltinDirective(oper, context);
|
|
26586
|
-
case
|
|
26597
|
+
case 17: return genGetTextChild(oper, context);
|
|
26587
26598
|
default:
|
|
26588
26599
|
const exhaustiveCheck = oper;
|
|
26589
26600
|
throw new Error(`Unhandled operation type in genOperation: ${exhaustiveCheck}`);
|
|
@@ -26660,6 +26671,10 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
|
|
|
26660
26671
|
let prev;
|
|
26661
26672
|
for (const [index, child] of children.entries()) {
|
|
26662
26673
|
if (child.flags & 2) offset--;
|
|
26674
|
+
if (child.flags & 4 && child.template != null) {
|
|
26675
|
+
push(...genSelf(child, context));
|
|
26676
|
+
continue;
|
|
26677
|
+
}
|
|
26663
26678
|
const id = child.flags & 1 ? child.flags & 4 ? child.anchor : child.id : void 0;
|
|
26664
26679
|
if (id === void 0 && !child.hasDynamicChild) {
|
|
26665
26680
|
push(...genSelf(child, context));
|
|
@@ -27257,7 +27272,7 @@ const transformVText = (dir, node, context) => {
|
|
|
27257
27272
|
context.childrenTemplate = [" "];
|
|
27258
27273
|
const isComponent = node.tagType === 1;
|
|
27259
27274
|
if (!isComponent) context.registerOperation({
|
|
27260
|
-
type:
|
|
27275
|
+
type: 17,
|
|
27261
27276
|
parent: context.reference()
|
|
27262
27277
|
});
|
|
27263
27278
|
context.registerEffect([exp], {
|
|
@@ -27450,9 +27465,16 @@ function processInterpolation(context) {
|
|
|
27450
27465
|
if (prev && prev.type === 2) nodes.unshift(prev);
|
|
27451
27466
|
const values = processTextLikeChildren(nodes, context);
|
|
27452
27467
|
if (values.length === 0 && parentNode.type !== 0) return;
|
|
27468
|
+
const literalValues = values.map((v) => getLiteralExpressionValue(v));
|
|
27469
|
+
if (literalValues.every((v) => v != null) && parentNode.type !== 0) {
|
|
27470
|
+
const text = literalValues.join("");
|
|
27471
|
+
const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
|
|
27472
|
+
context.template += isElementChild ? escapeHtml(text) : text;
|
|
27473
|
+
return;
|
|
27474
|
+
}
|
|
27453
27475
|
context.template += " ";
|
|
27454
27476
|
const id = context.reference();
|
|
27455
|
-
if (values.length === 0
|
|
27477
|
+
if (values.length === 0) return;
|
|
27456
27478
|
context.registerEffect(values, {
|
|
27457
27479
|
type: 4,
|
|
27458
27480
|
element: id,
|
|
@@ -27466,7 +27488,7 @@ function processTextContainer(children, context) {
|
|
|
27466
27488
|
else {
|
|
27467
27489
|
context.childrenTemplate = [" "];
|
|
27468
27490
|
context.registerOperation({
|
|
27469
|
-
type:
|
|
27491
|
+
type: 17,
|
|
27470
27492
|
parent: context.reference()
|
|
27471
27493
|
});
|
|
27472
27494
|
context.registerEffect(values, {
|
|
@@ -27607,7 +27629,7 @@ function processIf(node, dir, context) {
|
|
|
27607
27629
|
id,
|
|
27608
27630
|
condition: dir.exp,
|
|
27609
27631
|
positive: branch,
|
|
27610
|
-
index:
|
|
27632
|
+
index: context.root.nextIfIndex(),
|
|
27611
27633
|
once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
|
|
27612
27634
|
};
|
|
27613
27635
|
};
|
|
@@ -27640,7 +27662,7 @@ function processIf(node, dir, context) {
|
|
|
27640
27662
|
id: -1,
|
|
27641
27663
|
condition: dir.exp,
|
|
27642
27664
|
positive: branch,
|
|
27643
|
-
index:
|
|
27665
|
+
index: context.root.nextIfIndex(),
|
|
27644
27666
|
once: context.inVOnce || isStaticExpression(dir.exp, context.options.bindingMetadata)
|
|
27645
27667
|
};
|
|
27646
27668
|
return () => onExit();
|
|
@@ -27675,7 +27697,7 @@ function processFor(node, dir, context) {
|
|
|
27675
27697
|
const keyProp = findProp(node, "key");
|
|
27676
27698
|
const keyProperty = keyProp && propToExpression(keyProp);
|
|
27677
27699
|
const isComponent = node.tagType === 1 || isTemplateWithSingleComponent(node);
|
|
27678
|
-
context.node = node = wrapTemplate(node, ["for"]);
|
|
27700
|
+
context.node = node = wrapTemplate(node, ["for", "key"]);
|
|
27679
27701
|
context.dynamic.flags |= 6;
|
|
27680
27702
|
const id = context.reference();
|
|
27681
27703
|
const render = newBlock(node);
|
|
@@ -27789,13 +27811,6 @@ function transformComponentSlot(node, dir, context) {
|
|
|
27789
27811
|
markNonTemplate(n, context);
|
|
27790
27812
|
});
|
|
27791
27813
|
const [block, onExit] = createSlotBlock(node, dir, context);
|
|
27792
|
-
if (isTransitionNode(node) && nonSlotTemplateChildren.length) {
|
|
27793
|
-
const nonCommentChild = nonSlotTemplateChildren.find((n) => !isCommentOrWhitespace(n));
|
|
27794
|
-
if (nonCommentChild) {
|
|
27795
|
-
const keyProp = findProp(nonCommentChild, "key");
|
|
27796
|
-
if (keyProp) block.key = keyProp.exp;
|
|
27797
|
-
}
|
|
27798
|
-
}
|
|
27799
27814
|
const { slots } = context;
|
|
27800
27815
|
return () => {
|
|
27801
27816
|
onExit();
|
|
@@ -27914,6 +27929,31 @@ function hasMultipleChildren(node) {
|
|
|
27914
27929
|
return children.length > 1;
|
|
27915
27930
|
}
|
|
27916
27931
|
|
|
27932
|
+
//#endregion
|
|
27933
|
+
//#region packages/compiler-vapor/src/transforms/transformKey.ts
|
|
27934
|
+
const transformKey = (node, context) => {
|
|
27935
|
+
if (node.type !== 1 || context.inVOnce || findDir(node, "for")) return;
|
|
27936
|
+
const dir = findProp(node, "key", true, true);
|
|
27937
|
+
if (!dir || dir.type === 6) return;
|
|
27938
|
+
let value;
|
|
27939
|
+
value = dir.exp || normalizeBindShorthand(dir.arg, context);
|
|
27940
|
+
if (isStaticExpression(value, context.options.bindingMetadata)) return;
|
|
27941
|
+
let id = context.reference();
|
|
27942
|
+
context.dynamic.flags |= 6;
|
|
27943
|
+
context.node = node = wrapTemplate(node, ["key"]);
|
|
27944
|
+
const block = newBlock(node);
|
|
27945
|
+
const exitBlock = context.enterBlock(block);
|
|
27946
|
+
return () => {
|
|
27947
|
+
exitBlock();
|
|
27948
|
+
context.dynamic.operation = {
|
|
27949
|
+
type: 16,
|
|
27950
|
+
id,
|
|
27951
|
+
value,
|
|
27952
|
+
block
|
|
27953
|
+
};
|
|
27954
|
+
};
|
|
27955
|
+
};
|
|
27956
|
+
|
|
27917
27957
|
//#endregion
|
|
27918
27958
|
//#region packages/compiler-vapor/src/compile.ts
|
|
27919
27959
|
function compile$1(source, options = {}) {
|
|
@@ -27938,6 +27978,7 @@ function getBaseTransformPreset() {
|
|
|
27938
27978
|
transformVOnce,
|
|
27939
27979
|
transformVIf,
|
|
27940
27980
|
transformVFor,
|
|
27981
|
+
transformKey,
|
|
27941
27982
|
transformSlotOutlet,
|
|
27942
27983
|
transformTemplateRef,
|
|
27943
27984
|
transformElement,
|
|
@@ -27995,6 +28036,7 @@ var src_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
27995
28036
|
transformChildren: () => transformChildren,
|
|
27996
28037
|
transformComment: () => transformComment,
|
|
27997
28038
|
transformElement: () => transformElement,
|
|
28039
|
+
transformKey: () => transformKey,
|
|
27998
28040
|
transformSlotOutlet: () => transformSlotOutlet,
|
|
27999
28041
|
transformTemplateRef: () => transformTemplateRef,
|
|
28000
28042
|
transformText: () => transformText,
|
|
@@ -30120,7 +30162,7 @@ var require_document = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
30120
30162
|
}));
|
|
30121
30163
|
|
|
30122
30164
|
//#endregion
|
|
30123
|
-
//#region \0@oxc-project+runtime@0.
|
|
30165
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/objectWithoutPropertiesLoose.js
|
|
30124
30166
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
30125
30167
|
if (null == r) return {};
|
|
30126
30168
|
var t = {};
|
|
@@ -30133,7 +30175,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
30133
30175
|
var init_objectWithoutPropertiesLoose = __esmMin((() => {}));
|
|
30134
30176
|
|
|
30135
30177
|
//#endregion
|
|
30136
|
-
//#region \0@oxc-project+runtime@0.
|
|
30178
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/objectWithoutProperties.js
|
|
30137
30179
|
function _objectWithoutProperties(e, t) {
|
|
30138
30180
|
if (null == e) return {};
|
|
30139
30181
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
@@ -32332,7 +32374,6 @@ const trimPlugin = () => {
|
|
|
32332
32374
|
};
|
|
32333
32375
|
};
|
|
32334
32376
|
trimPlugin.postcss = true;
|
|
32335
|
-
var pluginTrim_default = trimPlugin;
|
|
32336
32377
|
|
|
32337
32378
|
//#endregion
|
|
32338
32379
|
//#region node_modules/.pnpm/postcss-selector-parser@7.1.1/node_modules/postcss-selector-parser/dist/util/unesc.js
|
|
@@ -35618,7 +35659,6 @@ function extractAndWrapNodes(parentNode) {
|
|
|
35618
35659
|
}
|
|
35619
35660
|
}
|
|
35620
35661
|
scopedPlugin.postcss = true;
|
|
35621
|
-
var pluginScoped_default = scopedPlugin;
|
|
35622
35662
|
|
|
35623
35663
|
//#endregion
|
|
35624
35664
|
//#region node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
|
|
@@ -37807,8 +37847,8 @@ function doCompileStyle(options) {
|
|
|
37807
37847
|
id: shortId,
|
|
37808
37848
|
isProd
|
|
37809
37849
|
}));
|
|
37810
|
-
if (trim) plugins.push(
|
|
37811
|
-
if (scoped) plugins.push(
|
|
37850
|
+
if (trim) plugins.push(trimPlugin());
|
|
37851
|
+
if (scoped) plugins.push(scopedPlugin(longId));
|
|
37812
37852
|
let cssModules;
|
|
37813
37853
|
if (modules) throw new Error("[@vue/compiler-sfc] `modules` option is not supported in the browser build.");
|
|
37814
37854
|
const postCSSOptions = _objectSpread2(_objectSpread2({}, postcssOptions), {}, {
|
|
@@ -39049,7 +39089,7 @@ function resolveParserPlugins(lang, userPlugins, dts = false) {
|
|
|
39049
39089
|
if (!userPlugins || !userPlugins.some((p) => p === "importAssertions" || p === "importAttributes" || isArray$3(p) && p[0] === "importAttributes")) plugins.push("importAttributes");
|
|
39050
39090
|
if (lang === "jsx" || lang === "tsx" || lang === "mtsx") plugins.push("jsx");
|
|
39051
39091
|
else if (userPlugins) userPlugins = userPlugins.filter((p) => p !== "jsx");
|
|
39052
|
-
if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "mtsx") {
|
|
39092
|
+
if (lang === "ts" || lang === "mts" || lang === "tsx" || lang === "cts" || lang === "mtsx") {
|
|
39053
39093
|
plugins.push(["typescript", { dts }], "explicitResourceManagement");
|
|
39054
39094
|
if (!userPlugins || !userPlugins.includes("decorators")) plugins.push("decorators-legacy");
|
|
39055
39095
|
}
|
|
@@ -39542,11 +39582,17 @@ function importSourceToScope(ctx, node, scope, source) {
|
|
|
39542
39582
|
} else return ctx.error(`Failed to resolve import source ${JSON.stringify(source)}.`, node, scope);
|
|
39543
39583
|
}
|
|
39544
39584
|
function resolveExt(filename, fs) {
|
|
39545
|
-
|
|
39585
|
+
let moduleType = "u";
|
|
39586
|
+
if (filename.endsWith(".mjs")) moduleType = "m";
|
|
39587
|
+
else if (filename.endsWith(".cjs")) moduleType = "c";
|
|
39588
|
+
filename = filename.replace(/\.[cm]?jsx?$/, "");
|
|
39546
39589
|
const tryResolve = (filename) => {
|
|
39547
39590
|
if (fs.fileExists(filename)) return filename;
|
|
39548
39591
|
};
|
|
39549
|
-
|
|
39592
|
+
const resolveTs = () => tryResolve(filename + `.ts`) || tryResolve(filename + `.tsx`) || tryResolve(filename + `.d.ts`);
|
|
39593
|
+
const resolveMts = () => tryResolve(filename + `.mts`) || tryResolve(filename + `.d.mts`);
|
|
39594
|
+
const resolveCts = () => tryResolve(filename + `.cts`) || tryResolve(filename + `.d.cts`);
|
|
39595
|
+
return tryResolve(filename) || (moduleType === "m" ? resolveMts() || resolveTs() : moduleType === "c" ? resolveCts() || resolveTs() : resolveTs() || resolveMts() || resolveCts()) || tryResolve(joinPaths(filename, `index.ts`)) || tryResolve(joinPaths(filename, `index.tsx`)) || tryResolve(joinPaths(filename, `index.d.ts`));
|
|
39550
39596
|
}
|
|
39551
39597
|
const tsConfigCache = createCache();
|
|
39552
39598
|
const tsConfigRefMap = /* @__PURE__ */ new Map();
|
|
@@ -39574,8 +39620,8 @@ function fileToScope(ctx, filename, asGlobal = false) {
|
|
|
39574
39620
|
}
|
|
39575
39621
|
function parseFile(filename, content, fs, parserPlugins) {
|
|
39576
39622
|
const ext = extname(filename);
|
|
39577
|
-
if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".mtsx") return (0, import_lib.parse)(content, {
|
|
39578
|
-
plugins: resolveParserPlugins(ext.slice(1), parserPlugins, /\.d\.
|
|
39623
|
+
if (ext === ".ts" || ext === ".mts" || ext === ".tsx" || ext === ".cts" || ext === ".mtsx") return (0, import_lib.parse)(content, {
|
|
39624
|
+
plugins: resolveParserPlugins(ext.slice(1), parserPlugins, /\.d\.[cm]?ts$/.test(filename)),
|
|
39579
39625
|
sourceType: "module"
|
|
39580
39626
|
}).program.body;
|
|
39581
39627
|
const isUnknownTypeSource = !/\.[cm]?[tj]sx?$/.test(filename);
|
|
@@ -40205,7 +40251,18 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
40205
40251
|
return resolveObjectKey(node.key, node.computed) === key;
|
|
40206
40252
|
});
|
|
40207
40253
|
if (prop) if (prop.type === "ObjectProperty") defaultString = `default: ${ctx.getString(prop.value)}`;
|
|
40208
|
-
else
|
|
40254
|
+
else {
|
|
40255
|
+
let paramsString = "";
|
|
40256
|
+
if (prop.params.length) {
|
|
40257
|
+
const start = prop.params[0].start;
|
|
40258
|
+
const end = prop.params[prop.params.length - 1].end;
|
|
40259
|
+
paramsString = ctx.getString({
|
|
40260
|
+
start,
|
|
40261
|
+
end
|
|
40262
|
+
});
|
|
40263
|
+
}
|
|
40264
|
+
defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default(${paramsString}) ${ctx.getString(prop.body)}`;
|
|
40265
|
+
}
|
|
40209
40266
|
}
|
|
40210
40267
|
const finalKey = getEscapedPropName(key);
|
|
40211
40268
|
if (!ctx.options.isProd) return `${finalKey}: { ${concatStrings([
|
|
@@ -41063,7 +41120,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
41063
41120
|
//#endregion
|
|
41064
41121
|
//#region packages/compiler-sfc/src/index.ts
|
|
41065
41122
|
init_objectSpread2();
|
|
41066
|
-
const version = "3.6.0-beta.
|
|
41123
|
+
const version = "3.6.0-beta.7";
|
|
41067
41124
|
const parseCache = parseCache$1;
|
|
41068
41125
|
const errorMessages = _objectSpread2(_objectSpread2({}, errorMessages$1), DOMErrorMessages);
|
|
41069
41126
|
const walk = walk$2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-sfc",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.7",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -42,24 +42,24 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-sfc#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/parser": "^7.
|
|
45
|
+
"@babel/parser": "^7.29.0",
|
|
46
46
|
"estree-walker": "^2.0.2",
|
|
47
47
|
"magic-string": "^0.30.21",
|
|
48
48
|
"postcss": "^8.5.6",
|
|
49
49
|
"source-map-js": "^1.2.1",
|
|
50
|
-
"@vue/compiler-
|
|
51
|
-
"@vue/compiler-
|
|
52
|
-
"@vue/
|
|
53
|
-
"@vue/compiler-
|
|
54
|
-
"@vue/
|
|
50
|
+
"@vue/compiler-dom": "3.6.0-beta.7",
|
|
51
|
+
"@vue/compiler-core": "3.6.0-beta.7",
|
|
52
|
+
"@vue/shared": "3.6.0-beta.7",
|
|
53
|
+
"@vue/compiler-vapor": "3.6.0-beta.7",
|
|
54
|
+
"@vue/compiler-ssr": "3.6.0-beta.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@babel/types": "^7.
|
|
57
|
+
"@babel/types": "^7.29.0",
|
|
58
58
|
"@vue/consolidate": "^1.0.0",
|
|
59
59
|
"hash-sum": "^2.0.0",
|
|
60
60
|
"lru-cache": "10.1.0",
|
|
61
61
|
"merge-source-map": "^1.1.0",
|
|
62
|
-
"minimatch": "~10.
|
|
62
|
+
"minimatch": "~10.2.0",
|
|
63
63
|
"postcss-modules": "^6.0.1",
|
|
64
64
|
"postcss-selector-parser": "^7.1.1",
|
|
65
65
|
"pug": "^3.0.3",
|