@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
  **/
@@ -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
  }
@@ -3730,6 +3741,7 @@ function createPathGetter(ctx, path) {
3730
3741
  };
3731
3742
  }
3732
3743
 
3744
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3733
3745
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3734
3746
  const isTeleport = (type) => type.__isTeleport;
3735
3747
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3768,94 +3780,90 @@ const TeleportImpl = {
3768
3780
  mc: mountChildren,
3769
3781
  pc: patchChildren,
3770
3782
  pbc: patchBlockChildren,
3771
- o: { insert, querySelector, createText, createComment }
3783
+ o: { insert, querySelector, createText, createComment, parentNode }
3772
3784
  } = internals;
3773
3785
  const disabled = isTeleportDisabled(n2.props);
3774
- let { shapeFlag, children, dynamicChildren } = n2;
3786
+ let { dynamicChildren } = n2;
3775
3787
  if (isHmrUpdating) {
3776
3788
  optimized = false;
3777
3789
  dynamicChildren = null;
3778
3790
  }
3791
+ const mount = (vnode, container2, anchor2) => {
3792
+ if (vnode.shapeFlag & 16) {
3793
+ mountChildren(
3794
+ vnode.children,
3795
+ container2,
3796
+ anchor2,
3797
+ parentComponent,
3798
+ parentSuspense,
3799
+ namespace,
3800
+ slotScopeIds,
3801
+ optimized
3802
+ );
3803
+ }
3804
+ };
3805
+ const mountToTarget = (vnode = n2) => {
3806
+ const disabled2 = isTeleportDisabled(vnode.props);
3807
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3808
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3809
+ if (target) {
3810
+ if (namespace !== "svg" && isTargetSVG(target)) {
3811
+ namespace = "svg";
3812
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3813
+ namespace = "mathml";
3814
+ }
3815
+ if (parentComponent && parentComponent.isCE) {
3816
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3817
+ }
3818
+ if (!disabled2) {
3819
+ mount(vnode, target, targetAnchor);
3820
+ updateCssVars(vnode, false);
3821
+ }
3822
+ } else if (!disabled2) {
3823
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3824
+ }
3825
+ };
3826
+ const queuePendingMount = (vnode) => {
3827
+ const mountJob = () => {
3828
+ if (pendingMounts.get(vnode) !== mountJob) return;
3829
+ pendingMounts.delete(vnode);
3830
+ if (isTeleportDisabled(vnode.props)) {
3831
+ const mountContainer = parentNode(vnode.el) || container;
3832
+ mount(vnode, mountContainer, vnode.anchor);
3833
+ updateCssVars(vnode, true);
3834
+ }
3835
+ mountToTarget(vnode);
3836
+ };
3837
+ pendingMounts.set(vnode, mountJob);
3838
+ queuePostRenderEffect(mountJob, parentSuspense);
3839
+ };
3779
3840
  if (n1 == null) {
3780
3841
  const placeholder = n2.el = createComment("teleport start") ;
3781
3842
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3782
3843
  insert(placeholder, container, anchor);
3783
3844
  insert(mainAnchor, container, anchor);
3784
- const mount = (container2, anchor2) => {
3785
- if (shapeFlag & 16) {
3786
- mountChildren(
3787
- children,
3788
- container2,
3789
- anchor2,
3790
- parentComponent,
3791
- parentSuspense,
3792
- namespace,
3793
- slotScopeIds,
3794
- optimized
3795
- );
3796
- }
3797
- };
3798
- const mountToTarget = () => {
3799
- const target = n2.target = resolveTarget(n2.props, querySelector);
3800
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3801
- if (target) {
3802
- if (namespace !== "svg" && isTargetSVG(target)) {
3803
- namespace = "svg";
3804
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3805
- namespace = "mathml";
3806
- }
3807
- if (parentComponent && parentComponent.isCE) {
3808
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3809
- }
3810
- if (!disabled) {
3811
- mount(target, targetAnchor);
3812
- updateCssVars(n2, false);
3813
- }
3814
- } else if (!disabled) {
3815
- warn$1(
3816
- "Invalid Teleport target on mount:",
3817
- target,
3818
- `(${typeof target})`
3819
- );
3820
- }
3821
- };
3845
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3846
+ queuePendingMount(n2);
3847
+ return;
3848
+ }
3822
3849
  if (disabled) {
3823
- mount(container, mainAnchor);
3850
+ mount(n2, container, mainAnchor);
3824
3851
  updateCssVars(n2, true);
3825
3852
  }
3826
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3827
- n2.el.__isMounted = false;
3828
- queuePostRenderEffect(() => {
3829
- if (n2.el.__isMounted !== false) return;
3830
- mountToTarget();
3831
- delete n2.el.__isMounted;
3832
- }, parentSuspense);
3833
- } else {
3834
- mountToTarget();
3835
- }
3853
+ mountToTarget();
3836
3854
  } else {
3837
3855
  n2.el = n1.el;
3838
- n2.targetStart = n1.targetStart;
3839
3856
  const mainAnchor = n2.anchor = n1.anchor;
3840
- const target = n2.target = n1.target;
3841
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3842
- if (n1.el.__isMounted === false) {
3843
- queuePostRenderEffect(() => {
3844
- TeleportImpl.process(
3845
- n1,
3846
- n2,
3847
- container,
3848
- anchor,
3849
- parentComponent,
3850
- parentSuspense,
3851
- namespace,
3852
- slotScopeIds,
3853
- optimized,
3854
- internals
3855
- );
3856
- }, parentSuspense);
3857
+ const pendingMount = pendingMounts.get(n1);
3858
+ if (pendingMount) {
3859
+ pendingMount.flags |= 8;
3860
+ pendingMounts.delete(n1);
3861
+ queuePendingMount(n2);
3857
3862
  return;
3858
3863
  }
3864
+ n2.targetStart = n1.targetStart;
3865
+ const target = n2.target = n1.target;
3866
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3859
3867
  const wasDisabled = isTeleportDisabled(n1.props);
3860
3868
  const currentContainer = wasDisabled ? container : target;
3861
3869
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3946,13 +3954,19 @@ const TeleportImpl = {
3946
3954
  target,
3947
3955
  props
3948
3956
  } = vnode;
3957
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3958
+ const pendingMount = pendingMounts.get(vnode);
3959
+ if (pendingMount) {
3960
+ pendingMount.flags |= 8;
3961
+ pendingMounts.delete(vnode);
3962
+ shouldRemove = false;
3963
+ }
3949
3964
  if (target) {
3950
3965
  hostRemove(targetStart);
3951
3966
  hostRemove(targetAnchor);
3952
3967
  }
3953
3968
  doRemove && hostRemove(anchor);
3954
3969
  if (shapeFlag & 16) {
3955
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3956
3970
  for (let i = 0; i < children.length; i++) {
3957
3971
  const child = children[i];
3958
3972
  unmount(
@@ -3977,7 +3991,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3977
3991
  if (isReorder) {
3978
3992
  insert(el, container, parentAnchor);
3979
3993
  }
3980
- if (!isReorder || isTeleportDisabled(props)) {
3994
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3981
3995
  if (shapeFlag & 16) {
3982
3996
  for (let i = 0; i < children.length; i++) {
3983
3997
  move(
@@ -4151,10 +4165,14 @@ const BaseTransitionImpl = {
4151
4165
  const state = useTransitionState();
4152
4166
  return () => {
4153
4167
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4154
- if (!children || !children.length) {
4168
+ const child = children && children.length ? findNonCommentChild(children) : (
4169
+ // Keep explicit default-slot conditionals on the same transition path
4170
+ // as regular v-if branches, which render a comment placeholder.
4171
+ instance.subTree ? createCommentVNode() : void 0
4172
+ );
4173
+ if (!child) {
4155
4174
  return;
4156
4175
  }
4157
- const child = findNonCommentChild(children);
4158
4176
  const rawProps = toRaw(props);
4159
4177
  const { mode } = rawProps;
4160
4178
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7519,7 +7537,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7519
7537
  return vm;
7520
7538
  }
7521
7539
  }
7522
- Vue.version = `2.6.14-compat:${"3.5.31"}`;
7540
+ Vue.version = `2.6.14-compat:${"3.5.33"}`;
7523
7541
  Vue.config = singletonApp.config;
7524
7542
  Vue.use = (plugin, ...options) => {
7525
7543
  if (plugin && isFunction(plugin.install)) {
@@ -11351,6 +11369,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11351
11369
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11352
11370
  return;
11353
11371
  }
11372
+ unsetCurrentInstance();
11354
11373
  instance.asyncResolved = true;
11355
11374
  const { vnode: vnode2 } = instance;
11356
11375
  {
@@ -12634,7 +12653,7 @@ function isMemoSame(cached, memo) {
12634
12653
  return true;
12635
12654
  }
12636
12655
 
12637
- const version = "3.5.31";
12656
+ const version = "3.5.33";
12638
12657
  const warn = warn$1 ;
12639
12658
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12640
12659
  const devtools = devtools$1 ;
@@ -13225,7 +13244,19 @@ function patchStyle(el, prev, next) {
13225
13244
  if (key === "display") {
13226
13245
  hasControlledDisplay = true;
13227
13246
  }
13228
- setStyle(style, key, next[key]);
13247
+ const value = next[key];
13248
+ if (value != null) {
13249
+ if (!shouldPreserveTextareaResizeStyle(
13250
+ el,
13251
+ key,
13252
+ !isString(prev) && prev ? prev[key] : void 0,
13253
+ value
13254
+ )) {
13255
+ setStyle(style, key, value);
13256
+ }
13257
+ } else {
13258
+ setStyle(style, key, "");
13259
+ }
13229
13260
  }
13230
13261
  } else {
13231
13262
  if (isCssString) {
@@ -13298,6 +13329,9 @@ function autoPrefix(style, rawName) {
13298
13329
  }
13299
13330
  return rawName;
13300
13331
  }
13332
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
13333
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
13334
+ }
13301
13335
 
13302
13336
  const xlinkNS = "http://www.w3.org/1999/xlink";
13303
13337
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {