@vue/compat 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.31
2
+ * @vue/compat v3.5.33
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -427,7 +427,18 @@ class EffectScope {
427
427
  */
428
428
  off() {
429
429
  if (this._on > 0 && --this._on === 0) {
430
- activeEffectScope = this.prevScope;
430
+ if (activeEffectScope === this) {
431
+ activeEffectScope = this.prevScope;
432
+ } else {
433
+ let current = activeEffectScope;
434
+ while (current) {
435
+ if (current.prevScope === this) {
436
+ current.prevScope = this.prevScope;
437
+ break;
438
+ }
439
+ current = current.prevScope;
440
+ }
441
+ }
431
442
  this.prevScope = void 0;
432
443
  }
433
444
  }
@@ -3657,6 +3668,7 @@ function createPathGetter(ctx, path) {
3657
3668
  };
3658
3669
  }
3659
3670
 
3671
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3660
3672
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3661
3673
  const isTeleport = (type) => type.__isTeleport;
3662
3674
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3695,94 +3707,90 @@ const TeleportImpl = {
3695
3707
  mc: mountChildren,
3696
3708
  pc: patchChildren,
3697
3709
  pbc: patchBlockChildren,
3698
- o: { insert, querySelector, createText, createComment }
3710
+ o: { insert, querySelector, createText, createComment, parentNode }
3699
3711
  } = internals;
3700
3712
  const disabled = isTeleportDisabled(n2.props);
3701
- let { shapeFlag, children, dynamicChildren } = n2;
3713
+ let { dynamicChildren } = n2;
3702
3714
  if (isHmrUpdating) {
3703
3715
  optimized = false;
3704
3716
  dynamicChildren = null;
3705
3717
  }
3718
+ const mount = (vnode, container2, anchor2) => {
3719
+ if (vnode.shapeFlag & 16) {
3720
+ mountChildren(
3721
+ vnode.children,
3722
+ container2,
3723
+ anchor2,
3724
+ parentComponent,
3725
+ parentSuspense,
3726
+ namespace,
3727
+ slotScopeIds,
3728
+ optimized
3729
+ );
3730
+ }
3731
+ };
3732
+ const mountToTarget = (vnode = n2) => {
3733
+ const disabled2 = isTeleportDisabled(vnode.props);
3734
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3735
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3736
+ if (target) {
3737
+ if (namespace !== "svg" && isTargetSVG(target)) {
3738
+ namespace = "svg";
3739
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3740
+ namespace = "mathml";
3741
+ }
3742
+ if (parentComponent && parentComponent.isCE) {
3743
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3744
+ }
3745
+ if (!disabled2) {
3746
+ mount(vnode, target, targetAnchor);
3747
+ updateCssVars(vnode, false);
3748
+ }
3749
+ } else if (!disabled2) {
3750
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3751
+ }
3752
+ };
3753
+ const queuePendingMount = (vnode) => {
3754
+ const mountJob = () => {
3755
+ if (pendingMounts.get(vnode) !== mountJob) return;
3756
+ pendingMounts.delete(vnode);
3757
+ if (isTeleportDisabled(vnode.props)) {
3758
+ const mountContainer = parentNode(vnode.el) || container;
3759
+ mount(vnode, mountContainer, vnode.anchor);
3760
+ updateCssVars(vnode, true);
3761
+ }
3762
+ mountToTarget(vnode);
3763
+ };
3764
+ pendingMounts.set(vnode, mountJob);
3765
+ queuePostRenderEffect(mountJob, parentSuspense);
3766
+ };
3706
3767
  if (n1 == null) {
3707
3768
  const placeholder = n2.el = createComment("teleport start") ;
3708
3769
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3709
3770
  insert(placeholder, container, anchor);
3710
3771
  insert(mainAnchor, container, anchor);
3711
- const mount = (container2, anchor2) => {
3712
- if (shapeFlag & 16) {
3713
- mountChildren(
3714
- children,
3715
- container2,
3716
- anchor2,
3717
- parentComponent,
3718
- parentSuspense,
3719
- namespace,
3720
- slotScopeIds,
3721
- optimized
3722
- );
3723
- }
3724
- };
3725
- const mountToTarget = () => {
3726
- const target = n2.target = resolveTarget(n2.props, querySelector);
3727
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3728
- if (target) {
3729
- if (namespace !== "svg" && isTargetSVG(target)) {
3730
- namespace = "svg";
3731
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3732
- namespace = "mathml";
3733
- }
3734
- if (parentComponent && parentComponent.isCE) {
3735
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3736
- }
3737
- if (!disabled) {
3738
- mount(target, targetAnchor);
3739
- updateCssVars(n2, false);
3740
- }
3741
- } else if (!disabled) {
3742
- warn$1(
3743
- "Invalid Teleport target on mount:",
3744
- target,
3745
- `(${typeof target})`
3746
- );
3747
- }
3748
- };
3772
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3773
+ queuePendingMount(n2);
3774
+ return;
3775
+ }
3749
3776
  if (disabled) {
3750
- mount(container, mainAnchor);
3777
+ mount(n2, container, mainAnchor);
3751
3778
  updateCssVars(n2, true);
3752
3779
  }
3753
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3754
- n2.el.__isMounted = false;
3755
- queuePostRenderEffect(() => {
3756
- if (n2.el.__isMounted !== false) return;
3757
- mountToTarget();
3758
- delete n2.el.__isMounted;
3759
- }, parentSuspense);
3760
- } else {
3761
- mountToTarget();
3762
- }
3780
+ mountToTarget();
3763
3781
  } else {
3764
3782
  n2.el = n1.el;
3765
- n2.targetStart = n1.targetStart;
3766
3783
  const mainAnchor = n2.anchor = n1.anchor;
3767
- const target = n2.target = n1.target;
3768
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3769
- if (n1.el.__isMounted === false) {
3770
- queuePostRenderEffect(() => {
3771
- TeleportImpl.process(
3772
- n1,
3773
- n2,
3774
- container,
3775
- anchor,
3776
- parentComponent,
3777
- parentSuspense,
3778
- namespace,
3779
- slotScopeIds,
3780
- optimized,
3781
- internals
3782
- );
3783
- }, parentSuspense);
3784
+ const pendingMount = pendingMounts.get(n1);
3785
+ if (pendingMount) {
3786
+ pendingMount.flags |= 8;
3787
+ pendingMounts.delete(n1);
3788
+ queuePendingMount(n2);
3784
3789
  return;
3785
3790
  }
3791
+ n2.targetStart = n1.targetStart;
3792
+ const target = n2.target = n1.target;
3793
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3786
3794
  const wasDisabled = isTeleportDisabled(n1.props);
3787
3795
  const currentContainer = wasDisabled ? container : target;
3788
3796
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3873,13 +3881,19 @@ const TeleportImpl = {
3873
3881
  target,
3874
3882
  props
3875
3883
  } = vnode;
3884
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3885
+ const pendingMount = pendingMounts.get(vnode);
3886
+ if (pendingMount) {
3887
+ pendingMount.flags |= 8;
3888
+ pendingMounts.delete(vnode);
3889
+ shouldRemove = false;
3890
+ }
3876
3891
  if (target) {
3877
3892
  hostRemove(targetStart);
3878
3893
  hostRemove(targetAnchor);
3879
3894
  }
3880
3895
  doRemove && hostRemove(anchor);
3881
3896
  if (shapeFlag & 16) {
3882
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3883
3897
  for (let i = 0; i < children.length; i++) {
3884
3898
  const child = children[i];
3885
3899
  unmount(
@@ -3904,7 +3918,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3904
3918
  if (isReorder) {
3905
3919
  insert(el, container, parentAnchor);
3906
3920
  }
3907
- if (!isReorder || isTeleportDisabled(props)) {
3921
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3908
3922
  if (shapeFlag & 16) {
3909
3923
  for (let i = 0; i < children.length; i++) {
3910
3924
  move(
@@ -4078,10 +4092,14 @@ const BaseTransitionImpl = {
4078
4092
  const state = useTransitionState();
4079
4093
  return () => {
4080
4094
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4081
- if (!children || !children.length) {
4095
+ const child = children && children.length ? findNonCommentChild(children) : (
4096
+ // Keep explicit default-slot conditionals on the same transition path
4097
+ // as regular v-if branches, which render a comment placeholder.
4098
+ instance.subTree ? createCommentVNode() : void 0
4099
+ );
4100
+ if (!child) {
4082
4101
  return;
4083
4102
  }
4084
- const child = findNonCommentChild(children);
4085
4103
  const rawProps = toRaw(props);
4086
4104
  const { mode } = rawProps;
4087
4105
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7446,7 +7464,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7446
7464
  return vm;
7447
7465
  }
7448
7466
  }
7449
- Vue.version = `2.6.14-compat:${"3.5.31"}`;
7467
+ Vue.version = `2.6.14-compat:${"3.5.33"}`;
7450
7468
  Vue.config = singletonApp.config;
7451
7469
  Vue.use = (plugin, ...options) => {
7452
7470
  if (plugin && isFunction(plugin.install)) {
@@ -11278,6 +11296,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11278
11296
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11279
11297
  return;
11280
11298
  }
11299
+ unsetCurrentInstance();
11281
11300
  instance.asyncResolved = true;
11282
11301
  const { vnode: vnode2 } = instance;
11283
11302
  {
@@ -12561,7 +12580,7 @@ function isMemoSame(cached, memo) {
12561
12580
  return true;
12562
12581
  }
12563
12582
 
12564
- const version = "3.5.31";
12583
+ const version = "3.5.33";
12565
12584
  const warn = warn$1 ;
12566
12585
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12567
12586
  const devtools = devtools$1 ;
@@ -13152,7 +13171,19 @@ function patchStyle(el, prev, next) {
13152
13171
  if (key === "display") {
13153
13172
  hasControlledDisplay = true;
13154
13173
  }
13155
- setStyle(style, key, next[key]);
13174
+ const value = next[key];
13175
+ if (value != null) {
13176
+ if (!shouldPreserveTextareaResizeStyle(
13177
+ el,
13178
+ key,
13179
+ !isString(prev) && prev ? prev[key] : void 0,
13180
+ value
13181
+ )) {
13182
+ setStyle(style, key, value);
13183
+ }
13184
+ } else {
13185
+ setStyle(style, key, "");
13186
+ }
13156
13187
  }
13157
13188
  } else {
13158
13189
  if (isCssString) {
@@ -13225,6 +13256,9 @@ function autoPrefix(style, rawName) {
13225
13256
  }
13226
13257
  return rawName;
13227
13258
  }
13259
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
13260
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
13261
+ }
13228
13262
 
13229
13263
  const xlinkNS = "http://www.w3.org/1999/xlink";
13230
13264
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {