@vue/compiler-sfc 3.6.0-beta.15 → 3.6.0-beta.16
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 +2 -2
- package/dist/compiler-sfc.esm-browser.js +145 -52
- package/package.json +6 -6
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-beta.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-beta.16
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -18394,7 +18394,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
18394
18394
|
}
|
|
18395
18395
|
//#endregion
|
|
18396
18396
|
//#region packages/compiler-sfc/src/index.ts
|
|
18397
|
-
const version = "3.6.0-beta.
|
|
18397
|
+
const version = "3.6.0-beta.16";
|
|
18398
18398
|
const parseCache = parseCache$1;
|
|
18399
18399
|
const errorMessages = {
|
|
18400
18400
|
..._vue_compiler_dom.errorMessages,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-beta.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-beta.16
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -25350,6 +25350,8 @@ init_objectSpread2();
|
|
|
25350
25350
|
function genExpression(node, context, assignment) {
|
|
25351
25351
|
node = context.getExpressionReplacement(node);
|
|
25352
25352
|
const { content, ast, isStatic, loc } = node;
|
|
25353
|
+
const { options } = context;
|
|
25354
|
+
const { inline } = options;
|
|
25353
25355
|
if (isStatic) return [[
|
|
25354
25356
|
JSON.stringify(content),
|
|
25355
25357
|
-2,
|
|
@@ -25371,23 +25373,31 @@ function genExpression(node, context, assignment) {
|
|
|
25371
25373
|
let hasMemberExpression = false;
|
|
25372
25374
|
if (ids.length) {
|
|
25373
25375
|
const [frag, push] = buildCodeFragment();
|
|
25374
|
-
|
|
25375
|
-
|
|
25376
|
-
const
|
|
25377
|
-
const
|
|
25378
|
-
const
|
|
25379
|
-
if (leadingText.length) push([leadingText, -3]);
|
|
25380
|
-
const source = content.slice(start, end);
|
|
25376
|
+
let lastEnd = 0;
|
|
25377
|
+
ids.sort((a, b) => a.start - b.start).forEach((id) => {
|
|
25378
|
+
const idStart = id.start - 1;
|
|
25379
|
+
const idEnd = id.end - 1;
|
|
25380
|
+
const source = content.slice(idStart, idEnd);
|
|
25381
25381
|
const parentStack = parentStackMap.get(id);
|
|
25382
25382
|
const parent = parentStack[parentStack.length - 1];
|
|
25383
|
+
let start = idStart;
|
|
25384
|
+
let end = idEnd;
|
|
25385
|
+
if (inline && options.bindingMetadata && options.bindingMetadata[source] === "setup-let" && parent && parent.type === "UpdateExpression" && parent.argument === id) {
|
|
25386
|
+
start = parent.start - 1;
|
|
25387
|
+
end = parent.end - 1;
|
|
25388
|
+
}
|
|
25389
|
+
if (start < lastEnd) return;
|
|
25390
|
+
const leadingText = content.slice(lastEnd, start);
|
|
25391
|
+
if (leadingText.length) push([leadingText, -3]);
|
|
25383
25392
|
hasMemberExpression || (hasMemberExpression = parent && (parent.type === "MemberExpression" || parent.type === "OptionalMemberExpression"));
|
|
25384
25393
|
push(...genIdentifier(source, context, {
|
|
25385
25394
|
start: advancePositionWithClone(node.loc.start, source, start),
|
|
25386
25395
|
end: advancePositionWithClone(node.loc.start, source, end),
|
|
25387
25396
|
source
|
|
25388
|
-
}, hasMemberExpression ? void 0 : assignment, id, parent, parentStack));
|
|
25389
|
-
|
|
25397
|
+
}, hasMemberExpression ? void 0 : assignment, id, parent, parentStack, node));
|
|
25398
|
+
lastEnd = end;
|
|
25390
25399
|
});
|
|
25400
|
+
if (lastEnd < content.length) push([content.slice(lastEnd), -3]);
|
|
25391
25401
|
if (assignment && hasMemberExpression) push(` = ${assignment}`);
|
|
25392
25402
|
return frag;
|
|
25393
25403
|
} else return [[
|
|
@@ -25396,7 +25406,7 @@ function genExpression(node, context, assignment) {
|
|
|
25396
25406
|
loc
|
|
25397
25407
|
]];
|
|
25398
25408
|
}
|
|
25399
|
-
function genIdentifier(raw, context, loc, assignment, id, parent, parentStack) {
|
|
25409
|
+
function genIdentifier(raw, context, loc, assignment, id, parent, parentStack, sourceNode) {
|
|
25400
25410
|
const { options, helper, identifiers } = context;
|
|
25401
25411
|
const { inline, bindingMetadata } = options;
|
|
25402
25412
|
let name = raw;
|
|
@@ -25416,19 +25426,49 @@ function genIdentifier(raw, context, loc, assignment, id, parent, parentStack) {
|
|
|
25416
25426
|
else return genExpression(replacement, context, assignment);
|
|
25417
25427
|
}
|
|
25418
25428
|
let prefix;
|
|
25419
|
-
if (isStaticProperty(parent) && parent.shorthand) prefix = `${raw}: `;
|
|
25420
25429
|
const type = bindingMetadata && bindingMetadata[raw];
|
|
25430
|
+
const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack || []);
|
|
25431
|
+
const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id;
|
|
25432
|
+
const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id;
|
|
25433
|
+
if (isStaticProperty(parent) && parent.shorthand && !(inline && type === "setup-let" && isDestructureAssignment)) prefix = `${raw}: `;
|
|
25421
25434
|
if (inline) switch (type) {
|
|
25422
25435
|
case "setup-let":
|
|
25423
|
-
|
|
25436
|
+
if (isAssignmentLVal) {
|
|
25437
|
+
const { right, operator } = parent;
|
|
25438
|
+
const source = sourceNode;
|
|
25439
|
+
const sourceContent = source.content;
|
|
25440
|
+
const rightStart = right.start - 1;
|
|
25441
|
+
const rightEnd = right.end - 1;
|
|
25442
|
+
const rightContent = sourceContent.slice(rightStart, rightEnd);
|
|
25443
|
+
const rightExp = createSimpleExpression(rightContent, false, {
|
|
25444
|
+
start: advancePositionWithClone(source.loc.start, sourceContent, rightStart),
|
|
25445
|
+
end: advancePositionWithClone(source.loc.start, sourceContent, rightEnd),
|
|
25446
|
+
source: rightContent
|
|
25447
|
+
});
|
|
25448
|
+
rightExp.ast = parseExp(context, rightContent);
|
|
25449
|
+
return [
|
|
25450
|
+
prefix,
|
|
25451
|
+
`${helper("isRef")}(${raw}) ? ${raw}.value ${operator} `,
|
|
25452
|
+
...genExpression(rightExp, context),
|
|
25453
|
+
` : `,
|
|
25454
|
+
[
|
|
25455
|
+
raw,
|
|
25456
|
+
-2,
|
|
25457
|
+
loc,
|
|
25458
|
+
name
|
|
25459
|
+
]
|
|
25460
|
+
];
|
|
25461
|
+
} else if (isUpdateArg) {
|
|
25462
|
+
const { prefix: isPrefix, operator } = parent;
|
|
25463
|
+
const updatePrefix = isPrefix ? operator : ``;
|
|
25464
|
+
const updatePostfix = isPrefix ? `` : operator;
|
|
25465
|
+
raw = `${helper("isRef")}(${raw}) ? ${updatePrefix}${raw}.value${updatePostfix} : ${updatePrefix}${raw}${updatePostfix}`;
|
|
25466
|
+
} else if (!isDestructureAssignment) name = raw = assignment ? `${helper("isRef")}(${raw}) ? (${raw}.value = ${assignment}) : (${raw} = ${assignment})` : unref();
|
|
25424
25467
|
break;
|
|
25425
25468
|
case "setup-ref":
|
|
25426
25469
|
name = raw = withAssignment(`${raw}.value`);
|
|
25427
25470
|
break;
|
|
25428
25471
|
case "setup-maybe-ref":
|
|
25429
|
-
const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack || []);
|
|
25430
|
-
const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id;
|
|
25431
|
-
const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id;
|
|
25432
25472
|
raw = isAssignmentLVal || isUpdateArg || isDestructureAssignment ? name = `${raw}.value` : assignment ? `${helper("isRef")}(${raw}) ? (${raw}.value = ${assignment}) : null` : unref();
|
|
25433
25473
|
break;
|
|
25434
25474
|
case "props":
|
|
@@ -26329,7 +26369,12 @@ function genPropKey({ key: node, modifier, runtimeCamelize, handler, handlerModi
|
|
|
26329
26369
|
if (runtimeCamelize) {
|
|
26330
26370
|
key.push(" || \"\"");
|
|
26331
26371
|
key = genCall(helper("camelize"), key);
|
|
26332
|
-
}
|
|
26372
|
+
} else if (modifier) key = [
|
|
26373
|
+
"(",
|
|
26374
|
+
...key,
|
|
26375
|
+
" || \"\"",
|
|
26376
|
+
")"
|
|
26377
|
+
];
|
|
26333
26378
|
if (handler) key = genCall(helper("toHandlerKey"), key);
|
|
26334
26379
|
return [
|
|
26335
26380
|
"[",
|
|
@@ -26421,6 +26466,11 @@ function genVShow(oper, context) {
|
|
|
26421
26466
|
])];
|
|
26422
26467
|
}
|
|
26423
26468
|
//#endregion
|
|
26469
|
+
//#region packages/compiler-vapor/src/generators/modifier.ts
|
|
26470
|
+
function genDirectiveModifiers(modifiers) {
|
|
26471
|
+
return modifiers.map((value) => `${isSimpleIdentifier(value) ? value : JSON.stringify(value)}: true`).join(", ");
|
|
26472
|
+
}
|
|
26473
|
+
//#endregion
|
|
26424
26474
|
//#region packages/compiler-vapor/src/generators/vModel.ts
|
|
26425
26475
|
const helperMap = {
|
|
26426
26476
|
text: "applyTextModel",
|
|
@@ -26435,7 +26485,7 @@ function genVModel(oper, context) {
|
|
|
26435
26485
|
`() => (`,
|
|
26436
26486
|
...genExpression(exp, context),
|
|
26437
26487
|
`)`
|
|
26438
|
-
], genModelHandler(exp, context), modifiers.length ? `{ ${modifiers.map((e) => e.content
|
|
26488
|
+
], genModelHandler(exp, context), modifiers.length ? `{ ${genDirectiveModifiers(modifiers.map((e) => e.content))} }` : void 0)];
|
|
26439
26489
|
}
|
|
26440
26490
|
function genModelHandler(exp, context) {
|
|
26441
26491
|
return [
|
|
@@ -26477,14 +26527,15 @@ function genCustomDirectives(opers, context) {
|
|
|
26477
26527
|
return genMulti(DELIMITERS_ARRAY.concat("void 0"), directiveVar, value, argument, modifiers);
|
|
26478
26528
|
}
|
|
26479
26529
|
}
|
|
26480
|
-
function genDirectiveModifiers(modifiers) {
|
|
26481
|
-
return modifiers.map((value) => `${isSimpleIdentifier(value) ? value : JSON.stringify(value)}: true`).join(", ");
|
|
26482
|
-
}
|
|
26483
26530
|
function filterCustomDirectives(id, operations) {
|
|
26484
26531
|
return operations.filter((oper) => oper.type === 14 && oper.element === id && !oper.builtin);
|
|
26485
26532
|
}
|
|
26486
26533
|
//#endregion
|
|
26487
26534
|
//#region packages/compiler-vapor/src/generators/component.ts
|
|
26535
|
+
function genStaticModifierPropKey(name) {
|
|
26536
|
+
const key = getModifierPropName(name);
|
|
26537
|
+
return [isSimpleIdentifier(key) ? key : JSON.stringify(key)];
|
|
26538
|
+
}
|
|
26488
26539
|
function genCreateComponent(operation, context) {
|
|
26489
26540
|
const { helper } = context;
|
|
26490
26541
|
const singleUseAssetComponentNames = context.singleUseAssetComponentNames;
|
|
@@ -26626,7 +26677,7 @@ function genStaticProps(props, context, dynamicProps, directStaticLiteralProps =
|
|
|
26626
26677
|
}
|
|
26627
26678
|
const { key, modelModifiers } = prop;
|
|
26628
26679
|
if (modelModifiers && modelModifiers.length) {
|
|
26629
|
-
const modifiersKey = key.isStatic ?
|
|
26680
|
+
const modifiersKey = key.isStatic ? genStaticModifierPropKey(key.content) : [
|
|
26630
26681
|
"[",
|
|
26631
26682
|
...genExpression(key, context),
|
|
26632
26683
|
" + \"Modifiers\"]"
|
|
@@ -26669,7 +26720,7 @@ function genDynamicProps(props, context, directStaticLiteralProps = false) {
|
|
|
26669
26720
|
]);
|
|
26670
26721
|
const { modelModifiers } = p;
|
|
26671
26722
|
if (modelModifiers && modelModifiers.length) {
|
|
26672
|
-
const modifiersKey = p.key.isStatic ?
|
|
26723
|
+
const modifiersKey = p.key.isStatic ? genStaticModifierPropKey(p.key.content) : [
|
|
26673
26724
|
"[",
|
|
26674
26725
|
...genExpression(p.key, context),
|
|
26675
26726
|
" + \"Modifiers\"]"
|
|
@@ -26794,7 +26845,7 @@ function genDynamicSlot(slot, context, withFunction = false) {
|
|
|
26794
26845
|
}
|
|
26795
26846
|
function genBasicDynamicSlot(slot, context) {
|
|
26796
26847
|
const { name, fn } = slot;
|
|
26797
|
-
return genMulti(DELIMITERS_OBJECT_NEWLINE, ["name: ", ...genExpression(name, context)], ["fn: ", ...genSlotBlockWithProps(fn, context)]);
|
|
26848
|
+
return genMulti(DELIMITERS_OBJECT_NEWLINE, ["name: ", ...genExpression(name, context)], ["fn: ", ...genSlotBlockWithProps(fn, context, false)]);
|
|
26798
26849
|
}
|
|
26799
26850
|
function genLoopSlot(slot, context) {
|
|
26800
26851
|
const { name, fn, loop } = slot;
|
|
@@ -26806,7 +26857,7 @@ function genLoopSlot(slot, context) {
|
|
|
26806
26857
|
if (rawValue) idMap[rawValue] = rawValue;
|
|
26807
26858
|
if (rawKey) idMap[rawKey] = rawKey;
|
|
26808
26859
|
if (rawIndex) idMap[rawIndex] = rawIndex;
|
|
26809
|
-
const slotExpr = genMulti(DELIMITERS_OBJECT_NEWLINE, ["name: ", ...context.withId(() => genExpression(name, context), idMap)], ["fn: ", ...context.withId(() => genSlotBlockWithProps(fn, context), idMap)]);
|
|
26860
|
+
const slotExpr = genMulti(DELIMITERS_OBJECT_NEWLINE, ["name: ", ...context.withId(() => genExpression(name, context), idMap)], ["fn: ", ...context.withId(() => genSlotBlockWithProps(fn, context, false), idMap)]);
|
|
26810
26861
|
return [...genCall(context.helper("createForSlots"), genExpression(source, context), [
|
|
26811
26862
|
...genMulti([
|
|
26812
26863
|
"(",
|
|
@@ -26832,7 +26883,7 @@ function genConditionalSlot(slot, context) {
|
|
|
26832
26883
|
INDENT_END
|
|
26833
26884
|
];
|
|
26834
26885
|
}
|
|
26835
|
-
function genSlotBlockWithProps(oper, context) {
|
|
26886
|
+
function genSlotBlockWithProps(oper, context, emitNonStableFlag = true) {
|
|
26836
26887
|
let propsName;
|
|
26837
26888
|
let exitScope;
|
|
26838
26889
|
let depth;
|
|
@@ -26847,10 +26898,45 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
26847
26898
|
const exitSlotBlock = context.enterSlotBlock();
|
|
26848
26899
|
markSlotRootOperations(oper);
|
|
26849
26900
|
let blockFn = context.withId(() => genBlock(oper, context, propsName ? [propsName] : []), idMap);
|
|
26901
|
+
if (emitNonStableFlag && !hasStableSlotRoot(oper, context)) blockFn = genCall(context.helper("extend"), blockFn, `{ _: 8 }`);
|
|
26850
26902
|
exitSlotBlock();
|
|
26851
26903
|
exitScope && exitScope();
|
|
26852
26904
|
return blockFn;
|
|
26853
26905
|
}
|
|
26906
|
+
const commentOnlyTemplateRE = /^(?:<!--[\s\S]*?-->)+$/;
|
|
26907
|
+
function hasStableSlotRoot(block, context) {
|
|
26908
|
+
let hasValidRoot = false;
|
|
26909
|
+
for (let i = 0; i < block.returns.length; i++) {
|
|
26910
|
+
const id = block.returns[i];
|
|
26911
|
+
const child = findReturnedDynamic$1(block, id);
|
|
26912
|
+
const operation = child && child.operation;
|
|
26913
|
+
if (!operation) {
|
|
26914
|
+
if (child && isStableTemplateSlotRoot(child, context)) hasValidRoot = true;
|
|
26915
|
+
continue;
|
|
26916
|
+
}
|
|
26917
|
+
switch (operation.type) {
|
|
26918
|
+
case 12:
|
|
26919
|
+
if (!operation.dynamic || operation.dynamic.isStatic) {
|
|
26920
|
+
hasValidRoot = true;
|
|
26921
|
+
continue;
|
|
26922
|
+
}
|
|
26923
|
+
return false;
|
|
26924
|
+
case 17:
|
|
26925
|
+
if (hasStableSlotRoot(operation.block, context)) {
|
|
26926
|
+
hasValidRoot = true;
|
|
26927
|
+
continue;
|
|
26928
|
+
}
|
|
26929
|
+
return false;
|
|
26930
|
+
default: return false;
|
|
26931
|
+
}
|
|
26932
|
+
}
|
|
26933
|
+
return hasValidRoot;
|
|
26934
|
+
}
|
|
26935
|
+
function isStableTemplateSlotRoot(child, context) {
|
|
26936
|
+
if (child.template == null) return false;
|
|
26937
|
+
const content = context.ir.template.entries[child.template].content;
|
|
26938
|
+
return content !== "" && !commentOnlyTemplateRE.test(content.trim());
|
|
26939
|
+
}
|
|
26854
26940
|
//#endregion
|
|
26855
26941
|
//#region packages/compiler-vapor/src/generators/slotOutlet.ts
|
|
26856
26942
|
function genSlotOutlet(oper, context) {
|
|
@@ -27187,7 +27273,7 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
|
|
|
27187
27273
|
else if (genEffectsExtraFrag) push(...genEffects([], context, genEffectsExtraFrag));
|
|
27188
27274
|
push(NEWLINE, `return `);
|
|
27189
27275
|
const returnNodes = returns.map((n) => `n${n}`);
|
|
27190
|
-
push(...returnNodes.length > 1 ? genMulti(DELIMITERS_ARRAY, ...returnNodes) : [returnNodes[0] || "
|
|
27276
|
+
push(...returnNodes.length > 1 ? genMulti(DELIMITERS_ARRAY, ...returnNodes) : [returnNodes[0] || "[]"]);
|
|
27191
27277
|
resetBlock();
|
|
27192
27278
|
context.singleUseAssetComponentNames = prevSingleUseAssetComponentNames;
|
|
27193
27279
|
return frag;
|
|
@@ -27526,12 +27612,37 @@ const transformVBind = (dir, node, context) => {
|
|
|
27526
27612
|
};
|
|
27527
27613
|
};
|
|
27528
27614
|
//#endregion
|
|
27615
|
+
//#region packages/compiler-vapor/src/transforms/vHtml.ts
|
|
27616
|
+
function ignoreVHtmlChildren(node, context, clear) {
|
|
27617
|
+
if (!node.children.length) return;
|
|
27618
|
+
const dir = findDir$1(node, "html");
|
|
27619
|
+
if (!dir) return;
|
|
27620
|
+
context.options.onError(createDOMCompilerError(55, dir.loc));
|
|
27621
|
+
if (clear === "node") node.children.length = 0;
|
|
27622
|
+
else context.childrenTemplate.length = 0;
|
|
27623
|
+
}
|
|
27624
|
+
const transformVHtml = (dir, node, context) => {
|
|
27625
|
+
let { exp, loc } = dir;
|
|
27626
|
+
if (!exp) {
|
|
27627
|
+
context.options.onError(createDOMCompilerError(54, loc));
|
|
27628
|
+
exp = EMPTY_EXPRESSION;
|
|
27629
|
+
}
|
|
27630
|
+
ignoreVHtmlChildren(node, context, "template");
|
|
27631
|
+
context.registerEffect([exp], {
|
|
27632
|
+
type: 8,
|
|
27633
|
+
element: context.reference(),
|
|
27634
|
+
value: exp,
|
|
27635
|
+
isComponent: node.tagType === 1
|
|
27636
|
+
});
|
|
27637
|
+
};
|
|
27638
|
+
//#endregion
|
|
27529
27639
|
//#region packages/compiler-vapor/src/transforms/transformElement.ts
|
|
27530
27640
|
init_objectSpread2();
|
|
27531
27641
|
const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,");
|
|
27532
27642
|
const transformElement = (node, context) => {
|
|
27533
27643
|
let effectIndex = context.block.effect.length;
|
|
27534
27644
|
const getEffectIndex = () => effectIndex++;
|
|
27645
|
+
if (node.type === 1 && node.children.length) ignoreVHtmlChildren(node, context, "node");
|
|
27535
27646
|
let parentSlots;
|
|
27536
27647
|
if (node.type === 1 && (node.tagType === 1 || context.options.isCustomElement(node.tag))) {
|
|
27537
27648
|
parentSlots = context.slots;
|
|
@@ -27682,17 +27793,18 @@ function transformNativeElement(node, propsResult, staticKey, singleRoot, contex
|
|
|
27682
27793
|
};
|
|
27683
27794
|
for (const prop of propsResult[1]) {
|
|
27684
27795
|
const { key, values } = prop;
|
|
27796
|
+
const canStringifyAttrName = key.isStatic && !UNSAFE_ATTR_NAME_RE.test(key.content);
|
|
27685
27797
|
let foldedValue;
|
|
27686
|
-
if (context.imports.some((imported) => values[0].content.includes(imported.exp.content))) {
|
|
27798
|
+
if (canStringifyAttrName && context.imports.some((imported) => values[0].content.includes(imported.exp.content))) {
|
|
27687
27799
|
if (!prevWasQuoted) template += ` `;
|
|
27688
27800
|
template += `${key.content}="${IMPORT_EXP_START}${values[0].content}${IMPORT_EXP_END}"`;
|
|
27689
27801
|
prevWasQuoted = true;
|
|
27690
|
-
} else if (
|
|
27802
|
+
} else if (canStringifyAttrName && values.length === 1 && (values[0].isStatic || values[0].content === "''") && !dynamicKeys.includes(key.content)) {
|
|
27691
27803
|
const value = values[0].content === "''" ? "" : values[0].content;
|
|
27692
27804
|
appendTemplateProp(key.content, value);
|
|
27693
|
-
} else if (
|
|
27805
|
+
} else if (canStringifyAttrName && !prop.modifier && isBooleanAttr(key.content) && (foldedValue = foldBooleanAttrValue(values)) != null) {
|
|
27694
27806
|
if (foldedValue) appendTemplateProp(key.content);
|
|
27695
|
-
} else if (
|
|
27807
|
+
} else if (canStringifyAttrName && !prop.modifier && hasBoundValue(values) && (foldedValue = key.content === "class" ? foldClassValues(values) : key.content === "style" ? foldStyleValues(values) : void 0) != null) {
|
|
27696
27808
|
if (foldedValue) appendTemplateProp(key.content, foldedValue, true);
|
|
27697
27809
|
} else context.registerEffect(values, {
|
|
27698
27810
|
type: 3,
|
|
@@ -28212,25 +28324,6 @@ const transformVOnce = (node, context) => {
|
|
|
28212
28324
|
if (node.type === 1 && findDir$1(node, "once", true)) context.inVOnce = true;
|
|
28213
28325
|
};
|
|
28214
28326
|
//#endregion
|
|
28215
|
-
//#region packages/compiler-vapor/src/transforms/vHtml.ts
|
|
28216
|
-
const transformVHtml = (dir, node, context) => {
|
|
28217
|
-
let { exp, loc } = dir;
|
|
28218
|
-
if (!exp) {
|
|
28219
|
-
context.options.onError(createDOMCompilerError(54, loc));
|
|
28220
|
-
exp = EMPTY_EXPRESSION;
|
|
28221
|
-
}
|
|
28222
|
-
if (node.children.length) {
|
|
28223
|
-
context.options.onError(createDOMCompilerError(55, loc));
|
|
28224
|
-
context.childrenTemplate.length = 0;
|
|
28225
|
-
}
|
|
28226
|
-
context.registerEffect([exp], {
|
|
28227
|
-
type: 8,
|
|
28228
|
-
element: context.reference(),
|
|
28229
|
-
value: exp,
|
|
28230
|
-
isComponent: node.tagType === 1
|
|
28231
|
-
});
|
|
28232
|
-
};
|
|
28233
|
-
//#endregion
|
|
28234
28327
|
//#region packages/compiler-vapor/src/transforms/transformText.ts
|
|
28235
28328
|
const seen = /* @__PURE__ */ new WeakMap();
|
|
28236
28329
|
function markNonTemplate(node, context) {
|
|
@@ -28926,7 +29019,7 @@ function transformTemplateSlot(node, dir, context) {
|
|
|
28926
29019
|
});
|
|
28927
29020
|
else if (vElse) {
|
|
28928
29021
|
const vIfSlot = slots[slots.length - 1];
|
|
28929
|
-
if (vIfSlot.slotType === 3) {
|
|
29022
|
+
if (vIfSlot && vIfSlot.slotType === 3) {
|
|
28930
29023
|
let ifNode = vIfSlot;
|
|
28931
29024
|
while (ifNode.negative && ifNode.negative.slotType === 3) ifNode = ifNode.negative;
|
|
28932
29025
|
const negative = vElse.exp ? {
|
|
@@ -42205,7 +42298,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
42205
42298
|
//#endregion
|
|
42206
42299
|
//#region packages/compiler-sfc/src/index.ts
|
|
42207
42300
|
init_objectSpread2();
|
|
42208
|
-
const version = "3.6.0-beta.
|
|
42301
|
+
const version = "3.6.0-beta.16";
|
|
42209
42302
|
const parseCache = parseCache$1;
|
|
42210
42303
|
const errorMessages = _objectSpread2(_objectSpread2({}, errorMessages$1), DOMErrorMessages);
|
|
42211
42304
|
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.16",
|
|
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.14",
|
|
49
49
|
"source-map-js": "^1.2.1",
|
|
50
|
-
"@vue/compiler-core": "3.6.0-beta.
|
|
51
|
-
"@vue/compiler-
|
|
52
|
-
"@vue/compiler-
|
|
53
|
-
"@vue/compiler-vapor": "3.6.0-beta.
|
|
54
|
-
"@vue/shared": "3.6.0-beta.
|
|
50
|
+
"@vue/compiler-core": "3.6.0-beta.16",
|
|
51
|
+
"@vue/compiler-dom": "3.6.0-beta.16",
|
|
52
|
+
"@vue/compiler-ssr": "3.6.0-beta.16",
|
|
53
|
+
"@vue/compiler-vapor": "3.6.0-beta.16",
|
|
54
|
+
"@vue/shared": "3.6.0-beta.16"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/types": "^7.29.7",
|