@vue/compiler-dom 3.5.42 → 3.5.44

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.42
2
+ * @vue/compiler-dom v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -412,7 +412,8 @@ const transformTransition = (node, context) => {
412
412
  if (!node.children.length) {
413
413
  return;
414
414
  }
415
- if (hasMultipleChildren(node)) {
415
+ const multipleChildren = hasMultipleChildren(node);
416
+ if (multipleChildren) {
416
417
  context.onError(
417
418
  createDOMCompilerError(
418
419
  63,
@@ -607,8 +608,9 @@ function stringifyNode(node, context) {
607
608
  }
608
609
  }
609
610
  function stringifyElement(node, context) {
611
+ var _a;
610
612
  let res = `<${node.tag}`;
611
- let innerHTML = "";
613
+ let innerHTML = void 0;
612
614
  for (let i = 0; i < node.props.length; i++) {
613
615
  const p = node.props[i];
614
616
  if (p.type === 6) {
@@ -642,7 +644,7 @@ function stringifyElement(node, context) {
642
644
  )}"`;
643
645
  }
644
646
  } else if (p.name === "html") {
645
- innerHTML = evaluateConstant(p.exp);
647
+ innerHTML = (_a = evaluateConstant(p.exp)) != null ? _a : "";
646
648
  } else if (p.name === "text") {
647
649
  innerHTML = shared.escapeHtml(
648
650
  shared.toDisplayString(evaluateConstant(p.exp))
@@ -654,7 +656,7 @@ function stringifyElement(node, context) {
654
656
  res += ` ${context.scopeId}`;
655
657
  }
656
658
  res += `>`;
657
- if (innerHTML) {
659
+ if (innerHTML !== void 0) {
658
660
  res += innerHTML;
659
661
  } else {
660
662
  for (let i = 0; i < node.children.length; i++) {
@@ -876,7 +878,8 @@ const validateHtmlNesting = (node, context) => {
876
878
 
877
879
  const DOMNodeTransforms = [
878
880
  transformStyle,
879
- ...[transformTransition, validateHtmlNesting]
881
+ transformTransition,
882
+ ...[validateHtmlNesting]
880
883
  ];
881
884
  const DOMDirectiveTransforms = {
882
885
  cloak: compilerCore.noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.42
2
+ * @vue/compiler-dom v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -386,6 +386,41 @@ const transformShow = (dir, node, context) => {
386
386
  };
387
387
  };
388
388
 
389
+ const transformTransition = (node, context) => {
390
+ if (node.type === 1 && node.tagType === 1) {
391
+ const component = context.isBuiltInComponent(node.tag);
392
+ if (component === TRANSITION) {
393
+ return () => {
394
+ if (!node.children.length) {
395
+ return;
396
+ }
397
+ hasMultipleChildren(node);
398
+ const child = node.children[0];
399
+ if (child.type === 1) {
400
+ for (const p of child.props) {
401
+ if (p.type === 7 && p.name === "show") {
402
+ node.props.push({
403
+ type: 6,
404
+ name: "persisted",
405
+ nameLoc: node.loc,
406
+ value: void 0,
407
+ loc: node.loc
408
+ });
409
+ }
410
+ }
411
+ }
412
+ };
413
+ }
414
+ }
415
+ };
416
+ function hasMultipleChildren(node) {
417
+ const children = node.children = node.children.filter(
418
+ (c) => !compilerCore.isCommentOrWhitespace(c)
419
+ );
420
+ const child = children[0];
421
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
422
+ }
423
+
389
424
  const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
390
425
  const stringifyStatic = (children, context, parent) => {
391
426
  if (context.scopes.vSlot > 0) {
@@ -543,8 +578,9 @@ function stringifyNode(node, context) {
543
578
  }
544
579
  }
545
580
  function stringifyElement(node, context) {
581
+ var _a;
546
582
  let res = `<${node.tag}`;
547
- let innerHTML = "";
583
+ let innerHTML = void 0;
548
584
  for (let i = 0; i < node.props.length; i++) {
549
585
  const p = node.props[i];
550
586
  if (p.type === 6) {
@@ -578,7 +614,7 @@ function stringifyElement(node, context) {
578
614
  )}"`;
579
615
  }
580
616
  } else if (p.name === "html") {
581
- innerHTML = evaluateConstant(p.exp);
617
+ innerHTML = (_a = evaluateConstant(p.exp)) != null ? _a : "";
582
618
  } else if (p.name === "text") {
583
619
  innerHTML = shared.escapeHtml(
584
620
  shared.toDisplayString(evaluateConstant(p.exp))
@@ -590,7 +626,7 @@ function stringifyElement(node, context) {
590
626
  res += ` ${context.scopeId}`;
591
627
  }
592
628
  res += `>`;
593
- if (innerHTML) {
629
+ if (innerHTML !== void 0) {
594
630
  res += innerHTML;
595
631
  } else {
596
632
  for (let i = 0; i < node.children.length; i++) {
@@ -631,6 +667,7 @@ const ignoreSideEffectTags = (node, context) => {
631
667
 
632
668
  const DOMNodeTransforms = [
633
669
  transformStyle,
670
+ transformTransition,
634
671
  ...[]
635
672
  ];
636
673
  const DOMDirectiveTransforms = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.42
2
+ * @vue/compiler-dom v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -118,10 +118,10 @@ function generateCodeFrame(source, start = 0, end = source.length) {
118
118
 
119
119
  const listDelimiterRE = /;(?![^(]*\))/g;
120
120
  const propertyDelimiterRE = /:([^]+)/;
121
- const styleCommentRE = /\/\*[^]*?\*\//g;
121
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
122
122
  function parseStringStyle(cssText) {
123
123
  const ret = {};
124
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
124
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
125
125
  if (item) {
126
126
  const tmp = item.split(propertyDelimiterRE);
127
127
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -1606,7 +1606,8 @@ const errorMessages = {
1606
1606
  [42]: `v-model value must be a valid JavaScript member expression.`,
1607
1607
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1608
1608
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1609
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1609
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
1610
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
1610
1611
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
1611
1612
  [46]: `Error parsing JavaScript expression: `,
1612
1613
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -4423,7 +4424,7 @@ const transformFor = createStructuralDirectiveTransform(
4423
4424
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
4424
4425
  createCompoundExpression([
4425
4426
  `if (_cached && _cached.el`,
4426
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
4427
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
4427
4428
  ` && ${context.helperString(
4428
4429
  IS_MEMO_SAME
4429
4430
  )}(_cached, _memo)) return _cached`
@@ -6420,7 +6421,8 @@ const transformTransition = (node, context) => {
6420
6421
  if (!node.children.length) {
6421
6422
  return;
6422
6423
  }
6423
- if (hasMultipleChildren(node)) {
6424
+ const multipleChildren = hasMultipleChildren(node);
6425
+ if (multipleChildren) {
6424
6426
  context.onError(
6425
6427
  createDOMCompilerError(
6426
6428
  63,
@@ -6647,7 +6649,8 @@ const validateHtmlNesting = (node, context) => {
6647
6649
 
6648
6650
  const DOMNodeTransforms = [
6649
6651
  transformStyle,
6650
- ...[transformTransition, validateHtmlNesting]
6652
+ transformTransition,
6653
+ ...[validateHtmlNesting]
6651
6654
  ];
6652
6655
  const DOMDirectiveTransforms = {
6653
6656
  cloak: noopDirectiveTransform,