vue 3.5.31 → 3.5.33

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.31
2
+ * vue v3.5.33
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.31
2
+ * vue v3.5.33
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.31
2
+ * vue v3.5.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -500,7 +500,18 @@ class EffectScope {
500
500
  */
501
501
  off() {
502
502
  if (this._on > 0 && --this._on === 0) {
503
- activeEffectScope = this.prevScope;
503
+ if (activeEffectScope === this) {
504
+ activeEffectScope = this.prevScope;
505
+ } else {
506
+ let current = activeEffectScope;
507
+ while (current) {
508
+ if (current.prevScope === this) {
509
+ current.prevScope = this.prevScope;
510
+ break;
511
+ }
512
+ current = current.prevScope;
513
+ }
514
+ }
504
515
  this.prevScope = void 0;
505
516
  }
506
517
  }
@@ -3261,6 +3272,7 @@ function createPathGetter(ctx, path) {
3261
3272
  };
3262
3273
  }
3263
3274
 
3275
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3264
3276
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3265
3277
  const isTeleport = (type) => type.__isTeleport;
3266
3278
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3299,94 +3311,90 @@ const TeleportImpl = {
3299
3311
  mc: mountChildren,
3300
3312
  pc: patchChildren,
3301
3313
  pbc: patchBlockChildren,
3302
- o: { insert, querySelector, createText, createComment }
3314
+ o: { insert, querySelector, createText, createComment, parentNode }
3303
3315
  } = internals;
3304
3316
  const disabled = isTeleportDisabled(n2.props);
3305
- let { shapeFlag, children, dynamicChildren } = n2;
3317
+ let { dynamicChildren } = n2;
3306
3318
  if (isHmrUpdating) {
3307
3319
  optimized = false;
3308
3320
  dynamicChildren = null;
3309
3321
  }
3322
+ const mount = (vnode, container2, anchor2) => {
3323
+ if (vnode.shapeFlag & 16) {
3324
+ mountChildren(
3325
+ vnode.children,
3326
+ container2,
3327
+ anchor2,
3328
+ parentComponent,
3329
+ parentSuspense,
3330
+ namespace,
3331
+ slotScopeIds,
3332
+ optimized
3333
+ );
3334
+ }
3335
+ };
3336
+ const mountToTarget = (vnode = n2) => {
3337
+ const disabled2 = isTeleportDisabled(vnode.props);
3338
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3339
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3340
+ if (target) {
3341
+ if (namespace !== "svg" && isTargetSVG(target)) {
3342
+ namespace = "svg";
3343
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3344
+ namespace = "mathml";
3345
+ }
3346
+ if (parentComponent && parentComponent.isCE) {
3347
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3348
+ }
3349
+ if (!disabled2) {
3350
+ mount(vnode, target, targetAnchor);
3351
+ updateCssVars(vnode, false);
3352
+ }
3353
+ } else if (!disabled2) {
3354
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3355
+ }
3356
+ };
3357
+ const queuePendingMount = (vnode) => {
3358
+ const mountJob = () => {
3359
+ if (pendingMounts.get(vnode) !== mountJob) return;
3360
+ pendingMounts.delete(vnode);
3361
+ if (isTeleportDisabled(vnode.props)) {
3362
+ const mountContainer = parentNode(vnode.el) || container;
3363
+ mount(vnode, mountContainer, vnode.anchor);
3364
+ updateCssVars(vnode, true);
3365
+ }
3366
+ mountToTarget(vnode);
3367
+ };
3368
+ pendingMounts.set(vnode, mountJob);
3369
+ queuePostRenderEffect(mountJob, parentSuspense);
3370
+ };
3310
3371
  if (n1 == null) {
3311
3372
  const placeholder = n2.el = createComment("teleport start") ;
3312
3373
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3313
3374
  insert(placeholder, container, anchor);
3314
3375
  insert(mainAnchor, container, anchor);
3315
- const mount = (container2, anchor2) => {
3316
- if (shapeFlag & 16) {
3317
- mountChildren(
3318
- children,
3319
- container2,
3320
- anchor2,
3321
- parentComponent,
3322
- parentSuspense,
3323
- namespace,
3324
- slotScopeIds,
3325
- optimized
3326
- );
3327
- }
3328
- };
3329
- const mountToTarget = () => {
3330
- const target = n2.target = resolveTarget(n2.props, querySelector);
3331
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3332
- if (target) {
3333
- if (namespace !== "svg" && isTargetSVG(target)) {
3334
- namespace = "svg";
3335
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3336
- namespace = "mathml";
3337
- }
3338
- if (parentComponent && parentComponent.isCE) {
3339
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3340
- }
3341
- if (!disabled) {
3342
- mount(target, targetAnchor);
3343
- updateCssVars(n2, false);
3344
- }
3345
- } else if (!disabled) {
3346
- warn$1(
3347
- "Invalid Teleport target on mount:",
3348
- target,
3349
- `(${typeof target})`
3350
- );
3351
- }
3352
- };
3376
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3377
+ queuePendingMount(n2);
3378
+ return;
3379
+ }
3353
3380
  if (disabled) {
3354
- mount(container, mainAnchor);
3381
+ mount(n2, container, mainAnchor);
3355
3382
  updateCssVars(n2, true);
3356
3383
  }
3357
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3358
- n2.el.__isMounted = false;
3359
- queuePostRenderEffect(() => {
3360
- if (n2.el.__isMounted !== false) return;
3361
- mountToTarget();
3362
- delete n2.el.__isMounted;
3363
- }, parentSuspense);
3364
- } else {
3365
- mountToTarget();
3366
- }
3384
+ mountToTarget();
3367
3385
  } else {
3368
3386
  n2.el = n1.el;
3369
- n2.targetStart = n1.targetStart;
3370
3387
  const mainAnchor = n2.anchor = n1.anchor;
3371
- const target = n2.target = n1.target;
3372
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3373
- if (n1.el.__isMounted === false) {
3374
- queuePostRenderEffect(() => {
3375
- TeleportImpl.process(
3376
- n1,
3377
- n2,
3378
- container,
3379
- anchor,
3380
- parentComponent,
3381
- parentSuspense,
3382
- namespace,
3383
- slotScopeIds,
3384
- optimized,
3385
- internals
3386
- );
3387
- }, parentSuspense);
3388
+ const pendingMount = pendingMounts.get(n1);
3389
+ if (pendingMount) {
3390
+ pendingMount.flags |= 8;
3391
+ pendingMounts.delete(n1);
3392
+ queuePendingMount(n2);
3388
3393
  return;
3389
3394
  }
3395
+ n2.targetStart = n1.targetStart;
3396
+ const target = n2.target = n1.target;
3397
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3390
3398
  const wasDisabled = isTeleportDisabled(n1.props);
3391
3399
  const currentContainer = wasDisabled ? container : target;
3392
3400
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3477,13 +3485,19 @@ const TeleportImpl = {
3477
3485
  target,
3478
3486
  props
3479
3487
  } = vnode;
3488
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3489
+ const pendingMount = pendingMounts.get(vnode);
3490
+ if (pendingMount) {
3491
+ pendingMount.flags |= 8;
3492
+ pendingMounts.delete(vnode);
3493
+ shouldRemove = false;
3494
+ }
3480
3495
  if (target) {
3481
3496
  hostRemove(targetStart);
3482
3497
  hostRemove(targetAnchor);
3483
3498
  }
3484
3499
  doRemove && hostRemove(anchor);
3485
3500
  if (shapeFlag & 16) {
3486
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3487
3501
  for (let i = 0; i < children.length; i++) {
3488
3502
  const child = children[i];
3489
3503
  unmount(
@@ -3508,7 +3522,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3508
3522
  if (isReorder) {
3509
3523
  insert(el, container, parentAnchor);
3510
3524
  }
3511
- if (!isReorder || isTeleportDisabled(props)) {
3525
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3512
3526
  if (shapeFlag & 16) {
3513
3527
  for (let i = 0; i < children.length; i++) {
3514
3528
  move(
@@ -3682,10 +3696,14 @@ const BaseTransitionImpl = {
3682
3696
  const state = useTransitionState();
3683
3697
  return () => {
3684
3698
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3685
- if (!children || !children.length) {
3699
+ const child = children && children.length ? findNonCommentChild(children) : (
3700
+ // Keep explicit default-slot conditionals on the same transition path
3701
+ // as regular v-if branches, which render a comment placeholder.
3702
+ instance.subTree ? createCommentVNode() : void 0
3703
+ );
3704
+ if (!child) {
3686
3705
  return;
3687
3706
  }
3688
- const child = findNonCommentChild(children);
3689
3707
  const rawProps = toRaw(props);
3690
3708
  const { mode } = rawProps;
3691
3709
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -9660,6 +9678,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9660
9678
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9661
9679
  return;
9662
9680
  }
9681
+ unsetCurrentInstance();
9663
9682
  instance.asyncResolved = true;
9664
9683
  const { vnode: vnode2 } = instance;
9665
9684
  {
@@ -10864,7 +10883,7 @@ function isMemoSame(cached, memo) {
10864
10883
  return true;
10865
10884
  }
10866
10885
 
10867
- const version = "3.5.31";
10886
+ const version = "3.5.33";
10868
10887
  const warn = warn$1 ;
10869
10888
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10870
10889
  const devtools = devtools$1 ;
@@ -11411,7 +11430,19 @@ function patchStyle(el, prev, next) {
11411
11430
  if (key === "display") {
11412
11431
  hasControlledDisplay = true;
11413
11432
  }
11414
- setStyle(style, key, next[key]);
11433
+ const value = next[key];
11434
+ if (value != null) {
11435
+ if (!shouldPreserveTextareaResizeStyle(
11436
+ el,
11437
+ key,
11438
+ !isString(prev) && prev ? prev[key] : void 0,
11439
+ value
11440
+ )) {
11441
+ setStyle(style, key, value);
11442
+ }
11443
+ } else {
11444
+ setStyle(style, key, "");
11445
+ }
11415
11446
  }
11416
11447
  } else {
11417
11448
  if (isCssString) {
@@ -11484,6 +11515,9 @@ function autoPrefix(style, rawName) {
11484
11515
  }
11485
11516
  return rawName;
11486
11517
  }
11518
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
11519
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
11520
+ }
11487
11521
 
11488
11522
  const xlinkNS = "http://www.w3.org/1999/xlink";
11489
11523
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {