@vue/compiler-sfc 3.6.0-rc.6 → 3.6.0-rc.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/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-rc.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-rc.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -16121,7 +16121,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
16121
16121
|
}
|
|
16122
16122
|
//#endregion
|
|
16123
16123
|
//#region packages/compiler-sfc/src/index.ts
|
|
16124
|
-
const version = "3.6.0-rc.
|
|
16124
|
+
const version = "3.6.0-rc.7";
|
|
16125
16125
|
const parseCache = parseCache$1;
|
|
16126
16126
|
const errorMessages = {
|
|
16127
16127
|
..._vue_compiler_dom.errorMessages,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-rc.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-rc.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -25050,6 +25050,10 @@ function isInTransition(context) {
|
|
|
25050
25050
|
function isTransitionNode(node) {
|
|
25051
25051
|
return node.type === 1 && isTransitionTag(node.tag);
|
|
25052
25052
|
}
|
|
25053
|
+
/** Transition or TransitionGroup: hosts whose children render specially. */
|
|
25054
|
+
function isTransitionHostNode(node) {
|
|
25055
|
+
return node.type === 1 && (isTransitionTag(node.tag) || isTransitionGroupTag(node.tag));
|
|
25056
|
+
}
|
|
25053
25057
|
function isTransitionTag(tag) {
|
|
25054
25058
|
tag = tag.toLowerCase();
|
|
25055
25059
|
return tag === "transition" || tag === "vaportransition";
|
|
@@ -25559,6 +25563,10 @@ function codeFragmentToString(code, context) {
|
|
|
25559
25563
|
});
|
|
25560
25564
|
}
|
|
25561
25565
|
}
|
|
25566
|
+
/** Formats a numeric flags argument with its dev-only name annotation. */
|
|
25567
|
+
function genFlags(flags, names) {
|
|
25568
|
+
return `${flags} /* ${names.join(", ")} */`;
|
|
25569
|
+
}
|
|
25562
25570
|
//#endregion
|
|
25563
25571
|
//#region packages/compiler-vapor/src/generators/dom.ts
|
|
25564
25572
|
function genInsertNode({ parent, elements, anchor }, { helper }) {
|
|
@@ -26198,7 +26206,7 @@ function isConstantBinding(value, context) {
|
|
|
26198
26206
|
//#region packages/compiler-vapor/src/generators/for.ts
|
|
26199
26207
|
function genFor(oper, context) {
|
|
26200
26208
|
const { helper } = context;
|
|
26201
|
-
const { source, value, key, index, render, keyProp, once, id, component, onlyChild, slotRoot } = oper;
|
|
26209
|
+
const { source, value, key, index, render, keyProp, once, id, component, onlyChild, slotRoot, wrappedRows } = oper;
|
|
26202
26210
|
const rawValue = value && value.content;
|
|
26203
26211
|
const rawKey = key && key.content;
|
|
26204
26212
|
const rawIndex = index && index.content;
|
|
@@ -26251,7 +26259,7 @@ function genFor(oper, context) {
|
|
|
26251
26259
|
return frag;
|
|
26252
26260
|
}, idMap);
|
|
26253
26261
|
exitScope();
|
|
26254
|
-
const flags = genForFlags(onlyChild, component, isFragmentBlock(render), !component && isSingleNodeBlock(render), once, slotRoot);
|
|
26262
|
+
const flags = genForFlags(onlyChild, component, isFragmentBlock(render), !component && isSingleNodeBlock(render), once, slotRoot, wrappedRows);
|
|
26255
26263
|
const onResetCalls = [];
|
|
26256
26264
|
for (let i = 0; i < selectorPatterns.length; i++) onResetCalls.push(NEWLINE, `n${id}.onReset(${selectorName(i)}.reset)`);
|
|
26257
26265
|
return [
|
|
@@ -26283,7 +26291,7 @@ function genFor(oper, context) {
|
|
|
26283
26291
|
return idMap;
|
|
26284
26292
|
}
|
|
26285
26293
|
}
|
|
26286
|
-
function genForFlags(onlyChild, component, isFragment, isSingleNode, once, slotRoot) {
|
|
26294
|
+
function genForFlags(onlyChild, component, isFragment, isSingleNode, once, slotRoot, wrappedRows) {
|
|
26287
26295
|
let flags = 0;
|
|
26288
26296
|
const names = [];
|
|
26289
26297
|
if (onlyChild) {
|
|
@@ -26310,8 +26318,12 @@ function genForFlags(onlyChild, component, isFragment, isSingleNode, once, slotR
|
|
|
26310
26318
|
flags |= 32;
|
|
26311
26319
|
names.push("SLOT_ROOT");
|
|
26312
26320
|
}
|
|
26321
|
+
if (wrappedRows) {
|
|
26322
|
+
flags |= 64;
|
|
26323
|
+
names.push("WRAPPED_ROWS");
|
|
26324
|
+
}
|
|
26313
26325
|
if (!flags) return;
|
|
26314
|
-
return
|
|
26326
|
+
return genFlags(flags, names);
|
|
26315
26327
|
}
|
|
26316
26328
|
function isSingleNodeBlock(block) {
|
|
26317
26329
|
const child = getSingleReturnedChild(block);
|
|
@@ -26532,7 +26544,7 @@ function genIfFlags(blockShape, once, slotRoot, index) {
|
|
|
26532
26544
|
if (once) flags |= 16;
|
|
26533
26545
|
else if (index !== void 0) flags |= index + 1 << 8;
|
|
26534
26546
|
if (flags === 1) return false;
|
|
26535
|
-
return
|
|
26547
|
+
return genFlags(flags, genIfFlagNames(once, slotRoot, index, blockShape));
|
|
26536
26548
|
}
|
|
26537
26549
|
function genIfFlagNames(once, slotRoot, index, blockShape) {
|
|
26538
26550
|
const names = [`TRUE_${genBlockShapeName(blockShape)}`];
|
|
@@ -26544,7 +26556,7 @@ function genIfFlagNames(once, slotRoot, index, blockShape) {
|
|
|
26544
26556
|
if (once) names.push("ONCE");
|
|
26545
26557
|
if (slotRoot) names.push("SLOT_ROOT");
|
|
26546
26558
|
if (!once && index !== void 0) names.push(`KEYED_INDEX_${index}`);
|
|
26547
|
-
return names
|
|
26559
|
+
return names;
|
|
26548
26560
|
}
|
|
26549
26561
|
function genBlockShapeName(flags) {
|
|
26550
26562
|
switch (flags & 3) {
|
|
@@ -26973,7 +26985,7 @@ function genDynamicComponentFlags(root, once, slotRoot) {
|
|
|
26973
26985
|
names.push("SLOT_ROOT");
|
|
26974
26986
|
}
|
|
26975
26987
|
if (!flags) return false;
|
|
26976
|
-
return
|
|
26988
|
+
return genFlags(flags, names);
|
|
26977
26989
|
}
|
|
26978
26990
|
function getUniqueHandlerName(context, name) {
|
|
26979
26991
|
const { seenInlineHandlerNames } = context;
|
|
@@ -27329,19 +27341,11 @@ function genSlotBlockWithProps(oper, context, emitNonStableFlag = true) {
|
|
|
27329
27341
|
const hasStableRoot = hasStableSlotRoot(oper, context);
|
|
27330
27342
|
if (!hasStableRoot) markSlotRootOperations(oper, context);
|
|
27331
27343
|
let blockFn = context.withId(() => genBlock(oper, context, propsName ? [propsName] : []), idMap);
|
|
27332
|
-
if (emitNonStableFlag && !hasStableRoot) blockFn = genCall(context.helper("extend"), blockFn, [`{ _: ${
|
|
27344
|
+
if (emitNonStableFlag && !hasStableRoot) blockFn = genCall(context.helper("extend"), blockFn, [`{ _: ${genFlags(1, ["NON_STABLE"])} }`]);
|
|
27333
27345
|
exitSlotBlock();
|
|
27334
27346
|
exitScope && exitScope();
|
|
27335
27347
|
return blockFn;
|
|
27336
27348
|
}
|
|
27337
|
-
function genSlotFlags$1(flags) {
|
|
27338
|
-
const names = [];
|
|
27339
|
-
if (flags & 1) names.push("NO_SLOTTED");
|
|
27340
|
-
if (flags & 2) names.push("ONCE");
|
|
27341
|
-
if (flags & 4) names.push("SLOT_ROOT");
|
|
27342
|
-
if (flags & 8) names.push("NON_STABLE");
|
|
27343
|
-
return `${flags} /* ${names.join(", ")} */`;
|
|
27344
|
-
}
|
|
27345
27349
|
//#endregion
|
|
27346
27350
|
//#region packages/compiler-vapor/src/generators/slotOutlet.ts
|
|
27347
27351
|
function genSlotOutlet(oper, context) {
|
|
@@ -27368,10 +27372,9 @@ function genSlotFlags(flags) {
|
|
|
27368
27372
|
const names = [];
|
|
27369
27373
|
if (flags & 1) names.push("NO_SLOTTED");
|
|
27370
27374
|
if (flags & 2) names.push("ONCE");
|
|
27371
|
-
if (flags & 4) names.push("
|
|
27372
|
-
if (flags &
|
|
27373
|
-
|
|
27374
|
-
return `${flags} /* ${names.join(", ")} */`;
|
|
27375
|
+
if (flags & 4) names.push("FORWARDED");
|
|
27376
|
+
if (flags & 8) names.push("SHARED_FALLBACK");
|
|
27377
|
+
return genFlags(flags, names);
|
|
27375
27378
|
}
|
|
27376
27379
|
//#endregion
|
|
27377
27380
|
//#region packages/compiler-vapor/src/generators/key.ts
|
|
@@ -27732,9 +27735,8 @@ function markSlotRootOperations(block, context, sharedFallback = false) {
|
|
|
27732
27735
|
markSlotRootOperations(operation.block, context, sharedFallback);
|
|
27733
27736
|
} else if (operation.type === 11) markSlotRootComponent(operation);
|
|
27734
27737
|
else if (operation.type === 12) {
|
|
27735
|
-
|
|
27736
|
-
if (sharedFallback) operation.flags |=
|
|
27737
|
-
else operation.flags |= 32;
|
|
27738
|
+
operation.flags |= 4;
|
|
27739
|
+
if (sharedFallback) operation.flags |= 8;
|
|
27738
27740
|
}
|
|
27739
27741
|
}
|
|
27740
27742
|
}
|
|
@@ -28834,13 +28836,13 @@ function processInterpolation(context) {
|
|
|
28834
28836
|
const values = processTextLikeChildren(collectAdjacentText(context), context);
|
|
28835
28837
|
if (values.length === 0 && parentNode.type !== 0) return;
|
|
28836
28838
|
const literalValues = values.map((v) => getLiteralExpressionValue(v));
|
|
28837
|
-
|
|
28838
|
-
|
|
28839
|
+
const text = literalValues.every((v) => v != null) ? literalValues.join("") : null;
|
|
28840
|
+
const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
|
|
28841
|
+
if (text !== null && parentNode.type !== 0 && (isElementChild || text !== "")) {
|
|
28839
28842
|
if (parentNode.type === 1 && shouldUseCreateElement(parentNode, context.parent) && text[0] === "<") {
|
|
28840
28843
|
materializeLiteralTextNode(createSimpleExpression(text, true, context.node.loc), context);
|
|
28841
28844
|
return;
|
|
28842
28845
|
}
|
|
28843
|
-
const isElementChild = parentNode.type === 1 && parentNode.tagType === 0;
|
|
28844
28846
|
context.template += isElementChild ? escapeHtml(text) : text;
|
|
28845
28847
|
return;
|
|
28846
28848
|
}
|
|
@@ -29360,6 +29362,8 @@ function processFor(node, dir, context) {
|
|
|
29360
29362
|
const keyProp = findProp(node, "key");
|
|
29361
29363
|
const keyProperty = keyProp && propToExpression(keyProp);
|
|
29362
29364
|
const isComponent = node.tagType === 1 || isTemplateWithSingleComponent(node);
|
|
29365
|
+
const parentNode = context.parent && context.parent.node;
|
|
29366
|
+
const wrappedRows = node.tagType === 3 && !(parentNode && isTransitionHostNode(parentNode)) && (node.children.length !== 1 || node.children[0].type !== 1 || !!findDir(node.children[0], ROW_FRAGMENT_DIR_RE));
|
|
29363
29367
|
context.node = node = wrapTemplate(node, ["for", "key"]);
|
|
29364
29368
|
context.dynamic.flags |= 6;
|
|
29365
29369
|
const id = context.reference();
|
|
@@ -29382,10 +29386,12 @@ function processFor(node, dir, context) {
|
|
|
29382
29386
|
render,
|
|
29383
29387
|
once: context.inVOnce || isStaticExpression(source, context.options.bindingMetadata),
|
|
29384
29388
|
component: isComponent,
|
|
29385
|
-
onlyChild: !!isOnlyChild
|
|
29389
|
+
onlyChild: !!isOnlyChild,
|
|
29390
|
+
wrappedRows
|
|
29386
29391
|
});
|
|
29387
29392
|
};
|
|
29388
29393
|
}
|
|
29394
|
+
const ROW_FRAGMENT_DIR_RE = /^(?:if|for)$/;
|
|
29389
29395
|
function isTemplateWithSingleComponent(node) {
|
|
29390
29396
|
if (node.tag !== "template") return false;
|
|
29391
29397
|
const nonCommentChildren = node.children.filter((c) => c.type !== 3);
|
|
@@ -29472,10 +29478,11 @@ function transformComponentSlot(node, dir, context) {
|
|
|
29472
29478
|
const { children } = node;
|
|
29473
29479
|
const arg = dir && dir.arg;
|
|
29474
29480
|
const hasTemplateSlots = children.some(isSlotTemplateChild);
|
|
29481
|
+
const isTransitionHost = isTransitionHostNode(node);
|
|
29475
29482
|
const emptyTextNodes = [];
|
|
29476
29483
|
const nonSlotTemplateChildren = children.filter((n) => {
|
|
29477
29484
|
if (isSlotTemplateChild(n)) return false;
|
|
29478
|
-
if (n.type === 3 && hasTemplateSlots) {
|
|
29485
|
+
if (n.type === 3 && (hasTemplateSlots || isTransitionHost)) {
|
|
29479
29486
|
ignoreComment(n, context);
|
|
29480
29487
|
return false;
|
|
29481
29488
|
}
|
|
@@ -43418,7 +43425,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
43418
43425
|
//#endregion
|
|
43419
43426
|
//#region packages/compiler-sfc/src/index.ts
|
|
43420
43427
|
init_objectSpread2();
|
|
43421
|
-
const version = "3.6.0-rc.
|
|
43428
|
+
const version = "3.6.0-rc.7";
|
|
43422
43429
|
const parseCache = parseCache$1;
|
|
43423
43430
|
const errorMessages = _objectSpread2(_objectSpread2({}, errorMessages$1), DOMErrorMessages);
|
|
43424
43431
|
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-rc.
|
|
3
|
+
"version": "3.6.0-rc.7",
|
|
4
4
|
"description": "@vue/compiler-sfc",
|
|
5
5
|
"main": "dist/compiler-sfc.cjs.js",
|
|
6
6
|
"module": "dist/compiler-sfc.esm-browser.js",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"magic-string": "^0.30.21",
|
|
48
48
|
"postcss": "^8.5.19",
|
|
49
49
|
"source-map-js": "^1.2.1",
|
|
50
|
-
"@vue/compiler-
|
|
51
|
-
"@vue/compiler-
|
|
52
|
-
"@vue/compiler-vapor": "3.6.0-rc.
|
|
53
|
-
"@vue/shared": "3.6.0-rc.
|
|
54
|
-
"@vue/compiler-ssr": "3.6.0-rc.
|
|
50
|
+
"@vue/compiler-dom": "3.6.0-rc.7",
|
|
51
|
+
"@vue/compiler-core": "3.6.0-rc.7",
|
|
52
|
+
"@vue/compiler-vapor": "3.6.0-rc.7",
|
|
53
|
+
"@vue/shared": "3.6.0-rc.7",
|
|
54
|
+
"@vue/compiler-ssr": "3.6.0-rc.7"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/types": "^7.29.8",
|