@vue/compat 3.5.30 → 3.5.32

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.30
2
+ * @vue/compat v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1784,16 +1784,16 @@ function toRefs(object) {
1784
1784
  return ret;
1785
1785
  }
1786
1786
  class ObjectRefImpl {
1787
- constructor(_object, _key, _defaultValue) {
1787
+ constructor(_object, key, _defaultValue) {
1788
1788
  this._object = _object;
1789
- this._key = _key;
1790
1789
  this._defaultValue = _defaultValue;
1791
1790
  this["__v_isRef"] = true;
1792
1791
  this._value = void 0;
1792
+ this._key = isSymbol(key) ? key : String(key);
1793
1793
  this._raw = toRaw(_object);
1794
1794
  let shallow = true;
1795
1795
  let obj = _object;
1796
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
1796
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
1797
1797
  do {
1798
1798
  shallow = !isProxy(obj) || isShallow(obj);
1799
1799
  } while (shallow && (obj = obj["__v_raw"]));
@@ -2838,6 +2838,7 @@ function createPathGetter(ctx, path) {
2838
2838
  };
2839
2839
  }
2840
2840
 
2841
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
2841
2842
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
2842
2843
  const isTeleport = (type) => type.__isTeleport;
2843
2844
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -2868,78 +2869,78 @@ const TeleportImpl = {
2868
2869
  o: { insert, querySelector, createText, createComment }
2869
2870
  } = internals;
2870
2871
  const disabled = isTeleportDisabled(n2.props);
2871
- let { shapeFlag, children, dynamicChildren } = n2;
2872
+ let { dynamicChildren } = n2;
2873
+ const mount = (vnode, container2, anchor2) => {
2874
+ if (vnode.shapeFlag & 16) {
2875
+ mountChildren(
2876
+ vnode.children,
2877
+ container2,
2878
+ anchor2,
2879
+ parentComponent,
2880
+ parentSuspense,
2881
+ namespace,
2882
+ slotScopeIds,
2883
+ optimized
2884
+ );
2885
+ }
2886
+ };
2887
+ const mountToTarget = (vnode = n2) => {
2888
+ const disabled2 = isTeleportDisabled(vnode.props);
2889
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
2890
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
2891
+ if (target) {
2892
+ if (namespace !== "svg" && isTargetSVG(target)) {
2893
+ namespace = "svg";
2894
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
2895
+ namespace = "mathml";
2896
+ }
2897
+ if (parentComponent && parentComponent.isCE) {
2898
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
2899
+ }
2900
+ if (!disabled2) {
2901
+ mount(vnode, target, targetAnchor);
2902
+ updateCssVars(vnode, false);
2903
+ }
2904
+ }
2905
+ };
2906
+ const queuePendingMount = (vnode) => {
2907
+ const mountJob = () => {
2908
+ if (pendingMounts.get(vnode) !== mountJob) return;
2909
+ pendingMounts.delete(vnode);
2910
+ if (isTeleportDisabled(vnode.props)) {
2911
+ mount(vnode, container, vnode.anchor);
2912
+ updateCssVars(vnode, true);
2913
+ }
2914
+ mountToTarget(vnode);
2915
+ };
2916
+ pendingMounts.set(vnode, mountJob);
2917
+ queuePostRenderEffect(mountJob, parentSuspense);
2918
+ };
2872
2919
  if (n1 == null) {
2873
2920
  const placeholder = n2.el = createText("");
2874
2921
  const mainAnchor = n2.anchor = createText("");
2875
2922
  insert(placeholder, container, anchor);
2876
2923
  insert(mainAnchor, container, anchor);
2877
- const mount = (container2, anchor2) => {
2878
- if (shapeFlag & 16) {
2879
- mountChildren(
2880
- children,
2881
- container2,
2882
- anchor2,
2883
- parentComponent,
2884
- parentSuspense,
2885
- namespace,
2886
- slotScopeIds,
2887
- optimized
2888
- );
2889
- }
2890
- };
2891
- const mountToTarget = () => {
2892
- const target = n2.target = resolveTarget(n2.props, querySelector);
2893
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
2894
- if (target) {
2895
- if (namespace !== "svg" && isTargetSVG(target)) {
2896
- namespace = "svg";
2897
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
2898
- namespace = "mathml";
2899
- }
2900
- if (parentComponent && parentComponent.isCE) {
2901
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
2902
- }
2903
- if (!disabled) {
2904
- mount(target, targetAnchor);
2905
- updateCssVars(n2, false);
2906
- }
2907
- }
2908
- };
2924
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
2925
+ queuePendingMount(n2);
2926
+ return;
2927
+ }
2909
2928
  if (disabled) {
2910
- mount(container, mainAnchor);
2929
+ mount(n2, container, mainAnchor);
2911
2930
  updateCssVars(n2, true);
2912
2931
  }
2913
- if (isTeleportDeferred(n2.props)) {
2914
- n2.el.__isMounted = false;
2915
- queuePostRenderEffect(() => {
2916
- mountToTarget();
2917
- delete n2.el.__isMounted;
2918
- }, parentSuspense);
2919
- } else {
2920
- mountToTarget();
2921
- }
2932
+ mountToTarget();
2922
2933
  } else {
2923
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
2924
- queuePostRenderEffect(() => {
2925
- TeleportImpl.process(
2926
- n1,
2927
- n2,
2928
- container,
2929
- anchor,
2930
- parentComponent,
2931
- parentSuspense,
2932
- namespace,
2933
- slotScopeIds,
2934
- optimized,
2935
- internals
2936
- );
2937
- }, parentSuspense);
2934
+ n2.el = n1.el;
2935
+ const mainAnchor = n2.anchor = n1.anchor;
2936
+ const pendingMount = pendingMounts.get(n1);
2937
+ if (pendingMount) {
2938
+ pendingMount.flags |= 8;
2939
+ pendingMounts.delete(n1);
2940
+ queuePendingMount(n2);
2938
2941
  return;
2939
2942
  }
2940
- n2.el = n1.el;
2941
2943
  n2.targetStart = n1.targetStart;
2942
- const mainAnchor = n2.anchor = n1.anchor;
2943
2944
  const target = n2.target = n1.target;
2944
2945
  const targetAnchor = n2.targetAnchor = n1.targetAnchor;
2945
2946
  const wasDisabled = isTeleportDisabled(n1.props);
@@ -3026,13 +3027,19 @@ const TeleportImpl = {
3026
3027
  target,
3027
3028
  props
3028
3029
  } = vnode;
3030
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3031
+ const pendingMount = pendingMounts.get(vnode);
3032
+ if (pendingMount) {
3033
+ pendingMount.flags |= 8;
3034
+ pendingMounts.delete(vnode);
3035
+ shouldRemove = false;
3036
+ }
3029
3037
  if (target) {
3030
3038
  hostRemove(targetStart);
3031
3039
  hostRemove(targetAnchor);
3032
3040
  }
3033
3041
  doRemove && hostRemove(anchor);
3034
3042
  if (shapeFlag & 16) {
3035
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3036
3043
  for (let i = 0; i < children.length; i++) {
3037
3044
  const child = children[i];
3038
3045
  unmount(
@@ -6075,7 +6082,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6075
6082
  return vm;
6076
6083
  }
6077
6084
  }
6078
- Vue.version = `2.6.14-compat:${"3.5.30"}`;
6085
+ Vue.version = `2.6.14-compat:${"3.5.32"}`;
6079
6086
  Vue.config = singletonApp.config;
6080
6087
  Vue.use = (plugin, ...options) => {
6081
6088
  if (plugin && isFunction(plugin.install)) {
@@ -6975,11 +6982,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
6975
6982
  }
6976
6983
  return nextProp !== prevProp;
6977
6984
  }
6978
- function updateHOCHostEl({ vnode, parent }, el) {
6985
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
6979
6986
  while (parent) {
6980
6987
  const root = parent.subTree;
6981
6988
  if (root.suspense && root.suspense.activeBranch === vnode) {
6982
- root.el = vnode.el;
6989
+ root.suspense.vnode.el = root.el = el;
6990
+ vnode = root;
6983
6991
  }
6984
6992
  if (root === vnode) {
6985
6993
  (vnode = parent.vnode).el = el;
@@ -6988,6 +6996,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
6988
6996
  break;
6989
6997
  }
6990
6998
  }
6999
+ if (suspense && suspense.activeBranch === vnode) {
7000
+ suspense.vnode.el = el;
7001
+ }
6991
7002
  }
6992
7003
 
6993
7004
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -7685,9 +7696,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7685
7696
  hostInsert(el, container, anchor);
7686
7697
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7687
7698
  queuePostRenderEffect(() => {
7688
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7689
- needCallTransitionHooks && transition.enter(el);
7690
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7699
+ try {
7700
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7701
+ needCallTransitionHooks && transition.enter(el);
7702
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7703
+ } finally {
7704
+ }
7691
7705
  }, parentSuspense);
7692
7706
  }
7693
7707
  };
@@ -8539,7 +8553,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8539
8553
  shapeFlag,
8540
8554
  patchFlag,
8541
8555
  dirs,
8542
- cacheIndex
8556
+ cacheIndex,
8557
+ memo
8543
8558
  } = vnode;
8544
8559
  if (patchFlag === -2) {
8545
8560
  optimized = false;
@@ -8601,10 +8616,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8601
8616
  remove(vnode);
8602
8617
  }
8603
8618
  }
8604
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
8619
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
8620
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
8605
8621
  queuePostRenderEffect(() => {
8606
8622
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8607
8623
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8624
+ if (shouldInvalidateMemo) {
8625
+ vnode.el = null;
8626
+ }
8608
8627
  }, parentSuspense);
8609
8628
  }
8610
8629
  };
@@ -9140,6 +9159,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9140
9159
  pendingId: suspenseId++,
9141
9160
  timeout: typeof timeout === "number" ? timeout : -1,
9142
9161
  activeBranch: null,
9162
+ isFallbackMountPending: false,
9143
9163
  pendingBranch: null,
9144
9164
  isInFallback: !isHydrating,
9145
9165
  isHydrating,
@@ -9177,7 +9197,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9177
9197
  }
9178
9198
  };
9179
9199
  }
9180
- if (activeBranch) {
9200
+ if (activeBranch && !suspense.isFallbackMountPending) {
9181
9201
  if (parentNode(activeBranch.el) === container2) {
9182
9202
  anchor = next(activeBranch);
9183
9203
  }
@@ -9190,6 +9210,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9190
9210
  move(pendingBranch, container2, anchor, 0);
9191
9211
  }
9192
9212
  }
9213
+ suspense.isFallbackMountPending = false;
9193
9214
  setActiveBranch(suspense, pendingBranch);
9194
9215
  suspense.pendingBranch = null;
9195
9216
  suspense.isInFallback = false;
@@ -9225,6 +9246,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9225
9246
  triggerEvent(vnode2, "onFallback");
9226
9247
  const anchor2 = next(activeBranch);
9227
9248
  const mountFallback = () => {
9249
+ suspense.isFallbackMountPending = false;
9228
9250
  if (!suspense.isInFallback) {
9229
9251
  return;
9230
9252
  }
@@ -9244,6 +9266,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9244
9266
  };
9245
9267
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
9246
9268
  if (delayEnter) {
9269
+ suspense.isFallbackMountPending = true;
9247
9270
  activeBranch.transition.afterLeave = mountFallback;
9248
9271
  }
9249
9272
  suspense.isInFallback = true;
@@ -9278,6 +9301,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9278
9301
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9279
9302
  return;
9280
9303
  }
9304
+ unsetCurrentInstance();
9281
9305
  instance.asyncResolved = true;
9282
9306
  const { vnode: vnode2 } = instance;
9283
9307
  handleSetupResult(instance, asyncSetupResult, false);
@@ -9815,6 +9839,10 @@ function mergeProps(...args) {
9815
9839
  const incoming = toMerge[key];
9816
9840
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
9817
9841
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
9842
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
9843
+ // the model listener.
9844
+ !isModelListener(key)) {
9845
+ ret[key] = incoming;
9818
9846
  }
9819
9847
  } else if (key !== "") {
9820
9848
  ret[key] = toMerge[key];
@@ -10190,7 +10218,7 @@ function isMemoSame(cached, memo) {
10190
10218
  return true;
10191
10219
  }
10192
10220
 
10193
- const version = "3.5.30";
10221
+ const version = "3.5.32";
10194
10222
  const warn$1 = NOOP;
10195
10223
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10196
10224
  const devtools = void 0;
@@ -11711,7 +11739,8 @@ const vModelText = {
11711
11739
  if (elValue === newValue) {
11712
11740
  return;
11713
11741
  }
11714
- if (document.activeElement === el && el.type !== "range") {
11742
+ const rootNode = el.getRootNode();
11743
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
11715
11744
  if (lazy && value === oldValue) {
11716
11745
  return;
11717
11746
  }
@@ -16831,7 +16860,7 @@ const transformFor = createStructuralDirectiveTransform(
16831
16860
  loop.body = createBlockStatement([
16832
16861
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
16833
16862
  createCompoundExpression([
16834
- `if (_cached`,
16863
+ `if (_cached && _cached.el`,
16835
16864
  ...keyExp ? [` && _cached.key === `, keyExp] : [],
16836
16865
  ` && ${context.helperString(
16837
16866
  IS_MEMO_SAME