vue 3.5.32 → 3.5.34

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/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.32
2
+ * vue v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.32
2
+ * vue v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.32
2
+ * vue v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -427,12 +427,18 @@ class EffectScope {
427
427
  */
428
428
  this.cleanups = [];
429
429
  this._isPaused = false;
430
+ this._warnOnRun = true;
430
431
  this.__v_skip = true;
431
- this.parent = activeEffectScope;
432
432
  if (!detached && activeEffectScope) {
433
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
434
- this
435
- ) - 1;
433
+ if (activeEffectScope.active) {
434
+ this.parent = activeEffectScope;
435
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
436
+ this
437
+ ) - 1;
438
+ } else {
439
+ this._active = false;
440
+ this._warnOnRun = false;
441
+ }
436
442
  }
437
443
  }
438
444
  get active() {
@@ -480,7 +486,7 @@ class EffectScope {
480
486
  } finally {
481
487
  activeEffectScope = currentEffectScope;
482
488
  }
483
- } else {
489
+ } else if (this._warnOnRun) {
484
490
  warn$2(`cannot run an inactive effect scope.`);
485
491
  }
486
492
  }
@@ -500,7 +506,18 @@ class EffectScope {
500
506
  */
501
507
  off() {
502
508
  if (this._on > 0 && --this._on === 0) {
503
- activeEffectScope = this.prevScope;
509
+ if (activeEffectScope === this) {
510
+ activeEffectScope = this.prevScope;
511
+ } else {
512
+ let current = activeEffectScope;
513
+ while (current) {
514
+ if (current.prevScope === this) {
515
+ current.prevScope = this.prevScope;
516
+ break;
517
+ }
518
+ current = current.prevScope;
519
+ }
520
+ }
504
521
  this.prevScope = void 0;
505
522
  }
506
523
  }
@@ -575,8 +592,12 @@ class ReactiveEffect {
575
592
  */
576
593
  this.cleanup = void 0;
577
594
  this.scheduler = void 0;
578
- if (activeEffectScope && activeEffectScope.active) {
579
- activeEffectScope.effects.push(this);
595
+ if (activeEffectScope) {
596
+ if (activeEffectScope.active) {
597
+ activeEffectScope.effects.push(this);
598
+ } else {
599
+ this.flags &= -2;
600
+ }
580
601
  }
581
602
  }
582
603
  pause() {
@@ -3300,7 +3321,7 @@ const TeleportImpl = {
3300
3321
  mc: mountChildren,
3301
3322
  pc: patchChildren,
3302
3323
  pbc: patchBlockChildren,
3303
- o: { insert, querySelector, createText, createComment }
3324
+ o: { insert, querySelector, createText, createComment, parentNode }
3304
3325
  } = internals;
3305
3326
  const disabled = isTeleportDisabled(n2.props);
3306
3327
  let { dynamicChildren } = n2;
@@ -3348,7 +3369,8 @@ const TeleportImpl = {
3348
3369
  if (pendingMounts.get(vnode) !== mountJob) return;
3349
3370
  pendingMounts.delete(vnode);
3350
3371
  if (isTeleportDisabled(vnode.props)) {
3351
- mount(vnode, container, vnode.anchor);
3372
+ const mountContainer = parentNode(vnode.el) || container;
3373
+ mount(vnode, mountContainer, vnode.anchor);
3352
3374
  updateCssVars(vnode, true);
3353
3375
  }
3354
3376
  mountToTarget(vnode);
@@ -3510,7 +3532,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3510
3532
  if (isReorder) {
3511
3533
  insert(el, container, parentAnchor);
3512
3534
  }
3513
- if (!isReorder || isTeleportDisabled(props)) {
3535
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3514
3536
  if (shapeFlag & 16) {
3515
3537
  for (let i = 0; i < children.length; i++) {
3516
3538
  move(
@@ -3684,10 +3706,14 @@ const BaseTransitionImpl = {
3684
3706
  const state = useTransitionState();
3685
3707
  return () => {
3686
3708
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3687
- if (!children || !children.length) {
3709
+ const child = children && children.length ? findNonCommentChild(children) : (
3710
+ // Keep explicit default-slot conditionals on the same transition path
3711
+ // as regular v-if branches, which render a comment placeholder.
3712
+ instance.subTree ? createCommentVNode() : void 0
3713
+ );
3714
+ if (!child) {
3688
3715
  return;
3689
3716
  }
3690
- const child = findNonCommentChild(children);
3691
3717
  const rawProps = toRaw(props);
3692
3718
  const { mode } = rawProps;
3693
3719
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7499,7 +7525,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7499
7525
  const receivedType = toRawType(value);
7500
7526
  const expectedValue = styleValue(value, expectedType);
7501
7527
  const receivedValue = styleValue(value, receivedType);
7502
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
7528
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
7503
7529
  message += ` with value ${expectedValue}`;
7504
7530
  }
7505
7531
  message += `, got ${receivedType} `;
@@ -7509,7 +7535,9 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7509
7535
  return message;
7510
7536
  }
7511
7537
  function styleValue(value, type) {
7512
- if (type === "String") {
7538
+ if (isSymbol(value)) {
7539
+ return value.toString();
7540
+ } else if (type === "String") {
7513
7541
  return `"${value}"`;
7514
7542
  } else if (type === "Number") {
7515
7543
  return `${Number(value)}`;
@@ -7521,8 +7549,11 @@ function isExplicable(type) {
7521
7549
  const explicitTypes = ["string", "number", "boolean"];
7522
7550
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
7523
7551
  }
7524
- function isBoolean(...args) {
7525
- return args.some((elem) => elem.toLowerCase() === "boolean");
7552
+ function isCoercible(...args) {
7553
+ return args.every((elem) => {
7554
+ const value = elem.toLowerCase();
7555
+ return value !== "boolean" && value !== "symbol";
7556
+ });
7526
7557
  }
7527
7558
 
7528
7559
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -9542,13 +9573,14 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9542
9573
  suspense.isHydrating = false;
9543
9574
  } else if (!resume) {
9544
9575
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9576
+ let hasUpdatedAnchor = false;
9545
9577
  if (delayEnter) {
9546
9578
  activeBranch.transition.afterLeave = () => {
9547
9579
  if (pendingId === suspense.pendingId) {
9548
9580
  move(
9549
9581
  pendingBranch,
9550
9582
  container2,
9551
- anchor === initialAnchor ? next(activeBranch) : anchor,
9583
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9552
9584
  0
9553
9585
  );
9554
9586
  queuePostFlushCb(effects);
@@ -9561,6 +9593,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9561
9593
  if (activeBranch && !suspense.isFallbackMountPending) {
9562
9594
  if (parentNode(activeBranch.el) === container2) {
9563
9595
  anchor = next(activeBranch);
9596
+ hasUpdatedAnchor = true;
9564
9597
  }
9565
9598
  unmount(activeBranch, parentComponent2, suspense, true);
9566
9599
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -10867,7 +10900,7 @@ function isMemoSame(cached, memo) {
10867
10900
  return true;
10868
10901
  }
10869
10902
 
10870
- const version = "3.5.32";
10903
+ const version = "3.5.34";
10871
10904
  const warn = warn$1 ;
10872
10905
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10873
10906
  const devtools = devtools$1 ;
@@ -11414,7 +11447,19 @@ function patchStyle(el, prev, next) {
11414
11447
  if (key === "display") {
11415
11448
  hasControlledDisplay = true;
11416
11449
  }
11417
- setStyle(style, key, next[key]);
11450
+ const value = next[key];
11451
+ if (value != null) {
11452
+ if (!shouldPreserveTextareaResizeStyle(
11453
+ el,
11454
+ key,
11455
+ !isString(prev) && prev ? prev[key] : void 0,
11456
+ value
11457
+ )) {
11458
+ setStyle(style, key, value);
11459
+ }
11460
+ } else {
11461
+ setStyle(style, key, "");
11462
+ }
11418
11463
  }
11419
11464
  } else {
11420
11465
  if (isCssString) {
@@ -11487,6 +11532,9 @@ function autoPrefix(style, rawName) {
11487
11532
  }
11488
11533
  return rawName;
11489
11534
  }
11535
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
11536
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
11537
+ }
11490
11538
 
11491
11539
  const xlinkNS = "http://www.w3.org/1999/xlink";
11492
11540
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {