@vue/runtime-dom 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/runtime-dom v3.5.30
2
+ * @vue/runtime-dom v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1511,7 +1511,8 @@ const vModelText = {
1511
1511
  if (elValue === newValue) {
1512
1512
  return;
1513
1513
  }
1514
- if (document.activeElement === el && el.type !== "range") {
1514
+ const rootNode = el.getRootNode();
1515
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
1515
1516
  if (lazy && value === oldValue) {
1516
1517
  return;
1517
1518
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.30
2
+ * @vue/runtime-dom v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1417,7 +1417,8 @@ const vModelText = {
1417
1417
  if (elValue === newValue) {
1418
1418
  return;
1419
1419
  }
1420
- if (document.activeElement === el && el.type !== "range") {
1420
+ const rootNode = el.getRootNode();
1421
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
1421
1422
  if (lazy && value === oldValue) {
1422
1423
  return;
1423
1424
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.30
2
+ * @vue/runtime-dom v3.5.32
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1879,16 +1879,16 @@ function toRefs(object) {
1879
1879
  return ret;
1880
1880
  }
1881
1881
  class ObjectRefImpl {
1882
- constructor(_object, _key, _defaultValue) {
1882
+ constructor(_object, key, _defaultValue) {
1883
1883
  this._object = _object;
1884
- this._key = _key;
1885
1884
  this._defaultValue = _defaultValue;
1886
1885
  this["__v_isRef"] = true;
1887
1886
  this._value = void 0;
1887
+ this._key = isSymbol(key) ? key : String(key);
1888
1888
  this._raw = toRaw(_object);
1889
1889
  let shallow = true;
1890
1890
  let obj = _object;
1891
- if (!isArray(_object) || !isIntegerKey(String(_key))) {
1891
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) {
1892
1892
  do {
1893
1893
  shallow = !isProxy(obj) || isShallow(obj);
1894
1894
  } while (shallow && (obj = obj["__v_raw"]));
@@ -2688,6 +2688,13 @@ function checkRecursiveUpdates(seen, fn) {
2688
2688
  }
2689
2689
 
2690
2690
  let isHmrUpdating = false;
2691
+ const setHmrUpdating = (v) => {
2692
+ try {
2693
+ return isHmrUpdating;
2694
+ } finally {
2695
+ isHmrUpdating = v;
2696
+ }
2697
+ };
2691
2698
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2692
2699
  {
2693
2700
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -3181,6 +3188,7 @@ function createPathGetter(ctx, path) {
3181
3188
  };
3182
3189
  }
3183
3190
 
3191
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3184
3192
  const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
3185
3193
  const isTeleport = (type) => type.__isTeleport;
3186
3194
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3222,88 +3230,84 @@ const TeleportImpl = {
3222
3230
  o: { insert, querySelector, createText, createComment }
3223
3231
  } = internals;
3224
3232
  const disabled = isTeleportDisabled(n2.props);
3225
- let { shapeFlag, children, dynamicChildren } = n2;
3233
+ let { dynamicChildren } = n2;
3226
3234
  if (isHmrUpdating) {
3227
3235
  optimized = false;
3228
3236
  dynamicChildren = null;
3229
3237
  }
3238
+ const mount = (vnode, container2, anchor2) => {
3239
+ if (vnode.shapeFlag & 16) {
3240
+ mountChildren(
3241
+ vnode.children,
3242
+ container2,
3243
+ anchor2,
3244
+ parentComponent,
3245
+ parentSuspense,
3246
+ namespace,
3247
+ slotScopeIds,
3248
+ optimized
3249
+ );
3250
+ }
3251
+ };
3252
+ const mountToTarget = (vnode = n2) => {
3253
+ const disabled2 = isTeleportDisabled(vnode.props);
3254
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3255
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3256
+ if (target) {
3257
+ if (namespace !== "svg" && isTargetSVG(target)) {
3258
+ namespace = "svg";
3259
+ } else if (namespace !== "mathml" && isTargetMathML(target)) {
3260
+ namespace = "mathml";
3261
+ }
3262
+ if (parentComponent && parentComponent.isCE) {
3263
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3264
+ }
3265
+ if (!disabled2) {
3266
+ mount(vnode, target, targetAnchor);
3267
+ updateCssVars(vnode, false);
3268
+ }
3269
+ } else if (!disabled2) {
3270
+ warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3271
+ }
3272
+ };
3273
+ const queuePendingMount = (vnode) => {
3274
+ const mountJob = () => {
3275
+ if (pendingMounts.get(vnode) !== mountJob) return;
3276
+ pendingMounts.delete(vnode);
3277
+ if (isTeleportDisabled(vnode.props)) {
3278
+ mount(vnode, container, vnode.anchor);
3279
+ updateCssVars(vnode, true);
3280
+ }
3281
+ mountToTarget(vnode);
3282
+ };
3283
+ pendingMounts.set(vnode, mountJob);
3284
+ queuePostRenderEffect(mountJob, parentSuspense);
3285
+ };
3230
3286
  if (n1 == null) {
3231
3287
  const placeholder = n2.el = createComment("teleport start") ;
3232
3288
  const mainAnchor = n2.anchor = createComment("teleport end") ;
3233
3289
  insert(placeholder, container, anchor);
3234
3290
  insert(mainAnchor, container, anchor);
3235
- const mount = (container2, anchor2) => {
3236
- if (shapeFlag & 16) {
3237
- mountChildren(
3238
- children,
3239
- container2,
3240
- anchor2,
3241
- parentComponent,
3242
- parentSuspense,
3243
- namespace,
3244
- slotScopeIds,
3245
- optimized
3246
- );
3247
- }
3248
- };
3249
- const mountToTarget = () => {
3250
- const target = n2.target = resolveTarget(n2.props, querySelector);
3251
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3252
- if (target) {
3253
- if (namespace !== "svg" && isTargetSVG(target)) {
3254
- namespace = "svg";
3255
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
3256
- namespace = "mathml";
3257
- }
3258
- if (parentComponent && parentComponent.isCE) {
3259
- (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3260
- }
3261
- if (!disabled) {
3262
- mount(target, targetAnchor);
3263
- updateCssVars(n2, false);
3264
- }
3265
- } else if (!disabled) {
3266
- warn$1(
3267
- "Invalid Teleport target on mount:",
3268
- target,
3269
- `(${typeof target})`
3270
- );
3271
- }
3272
- };
3291
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3292
+ queuePendingMount(n2);
3293
+ return;
3294
+ }
3273
3295
  if (disabled) {
3274
- mount(container, mainAnchor);
3296
+ mount(n2, container, mainAnchor);
3275
3297
  updateCssVars(n2, true);
3276
3298
  }
3277
- if (isTeleportDeferred(n2.props)) {
3278
- n2.el.__isMounted = false;
3279
- queuePostRenderEffect(() => {
3280
- mountToTarget();
3281
- delete n2.el.__isMounted;
3282
- }, parentSuspense);
3283
- } else {
3284
- mountToTarget();
3285
- }
3299
+ mountToTarget();
3286
3300
  } else {
3287
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3288
- queuePostRenderEffect(() => {
3289
- TeleportImpl.process(
3290
- n1,
3291
- n2,
3292
- container,
3293
- anchor,
3294
- parentComponent,
3295
- parentSuspense,
3296
- namespace,
3297
- slotScopeIds,
3298
- optimized,
3299
- internals
3300
- );
3301
- }, parentSuspense);
3301
+ n2.el = n1.el;
3302
+ const mainAnchor = n2.anchor = n1.anchor;
3303
+ const pendingMount = pendingMounts.get(n1);
3304
+ if (pendingMount) {
3305
+ pendingMount.flags |= 8;
3306
+ pendingMounts.delete(n1);
3307
+ queuePendingMount(n2);
3302
3308
  return;
3303
3309
  }
3304
- n2.el = n1.el;
3305
3310
  n2.targetStart = n1.targetStart;
3306
- const mainAnchor = n2.anchor = n1.anchor;
3307
3311
  const target = n2.target = n1.target;
3308
3312
  const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3309
3313
  const wasDisabled = isTeleportDisabled(n1.props);
@@ -3396,13 +3400,19 @@ const TeleportImpl = {
3396
3400
  target,
3397
3401
  props
3398
3402
  } = vnode;
3403
+ let shouldRemove = doRemove || !isTeleportDisabled(props);
3404
+ const pendingMount = pendingMounts.get(vnode);
3405
+ if (pendingMount) {
3406
+ pendingMount.flags |= 8;
3407
+ pendingMounts.delete(vnode);
3408
+ shouldRemove = false;
3409
+ }
3399
3410
  if (target) {
3400
3411
  hostRemove(targetStart);
3401
3412
  hostRemove(targetAnchor);
3402
3413
  }
3403
3414
  doRemove && hostRemove(anchor);
3404
3415
  if (shapeFlag & 16) {
3405
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3406
3416
  for (let i = 0; i < children.length; i++) {
3407
3417
  const child = children[i];
3408
3418
  unmount(
@@ -3768,7 +3778,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3768
3778
  callHook(hook, [el]);
3769
3779
  },
3770
3780
  enter(el) {
3771
- if (leavingVNodesCache[key] === vnode) return;
3781
+ if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
3772
3782
  let hook = onEnter;
3773
3783
  let afterHook = onAfterEnter;
3774
3784
  let cancelHook = onEnterCancelled;
@@ -7012,11 +7022,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
7012
7022
  }
7013
7023
  return nextProp !== prevProp;
7014
7024
  }
7015
- function updateHOCHostEl({ vnode, parent }, el) {
7025
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
7016
7026
  while (parent) {
7017
7027
  const root = parent.subTree;
7018
7028
  if (root.suspense && root.suspense.activeBranch === vnode) {
7019
- root.el = vnode.el;
7029
+ root.suspense.vnode.el = root.el = el;
7030
+ vnode = root;
7020
7031
  }
7021
7032
  if (root === vnode) {
7022
7033
  (vnode = parent.vnode).el = el;
@@ -7025,6 +7036,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
7025
7036
  break;
7026
7037
  }
7027
7038
  }
7039
+ if (suspense && suspense.activeBranch === vnode) {
7040
+ suspense.vnode.el = el;
7041
+ }
7028
7042
  }
7029
7043
 
7030
7044
  const internalObjectProto = {};
@@ -7866,10 +7880,17 @@ function baseCreateRenderer(options, createHydrationFns) {
7866
7880
  }
7867
7881
  hostInsert(el, container, anchor);
7868
7882
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7883
+ const isHmr = isHmrUpdating;
7869
7884
  queuePostRenderEffect(() => {
7870
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7871
- needCallTransitionHooks && transition.enter(el);
7872
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7885
+ let prev;
7886
+ prev = setHmrUpdating(isHmr);
7887
+ try {
7888
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7889
+ needCallTransitionHooks && transition.enter(el);
7890
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7891
+ } finally {
7892
+ setHmrUpdating(prev);
7893
+ }
7873
7894
  }, parentSuspense);
7874
7895
  }
7875
7896
  };
@@ -8790,7 +8811,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8790
8811
  shapeFlag,
8791
8812
  patchFlag,
8792
8813
  dirs,
8793
- cacheIndex
8814
+ cacheIndex,
8815
+ memo
8794
8816
  } = vnode;
8795
8817
  if (patchFlag === -2) {
8796
8818
  optimized = false;
@@ -8852,10 +8874,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8852
8874
  remove(vnode);
8853
8875
  }
8854
8876
  }
8855
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
8877
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
8878
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
8856
8879
  queuePostRenderEffect(() => {
8857
8880
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8858
8881
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8882
+ if (shouldInvalidateMemo) {
8883
+ vnode.el = null;
8884
+ }
8859
8885
  }, parentSuspense);
8860
8886
  }
8861
8887
  };
@@ -9409,6 +9435,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9409
9435
  pendingId: suspenseId++,
9410
9436
  timeout: typeof timeout === "number" ? timeout : -1,
9411
9437
  activeBranch: null,
9438
+ isFallbackMountPending: false,
9412
9439
  pendingBranch: null,
9413
9440
  isInFallback: !isHydrating,
9414
9441
  isHydrating,
@@ -9458,7 +9485,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9458
9485
  }
9459
9486
  };
9460
9487
  }
9461
- if (activeBranch) {
9488
+ if (activeBranch && !suspense.isFallbackMountPending) {
9462
9489
  if (parentNode(activeBranch.el) === container2) {
9463
9490
  anchor = next(activeBranch);
9464
9491
  }
@@ -9471,6 +9498,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9471
9498
  move(pendingBranch, container2, anchor, 0);
9472
9499
  }
9473
9500
  }
9501
+ suspense.isFallbackMountPending = false;
9474
9502
  setActiveBranch(suspense, pendingBranch);
9475
9503
  suspense.pendingBranch = null;
9476
9504
  suspense.isInFallback = false;
@@ -9506,6 +9534,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9506
9534
  triggerEvent(vnode2, "onFallback");
9507
9535
  const anchor2 = next(activeBranch);
9508
9536
  const mountFallback = () => {
9537
+ suspense.isFallbackMountPending = false;
9509
9538
  if (!suspense.isInFallback) {
9510
9539
  return;
9511
9540
  }
@@ -9525,6 +9554,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9525
9554
  };
9526
9555
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
9527
9556
  if (delayEnter) {
9557
+ suspense.isFallbackMountPending = true;
9528
9558
  activeBranch.transition.afterLeave = mountFallback;
9529
9559
  }
9530
9560
  suspense.isInFallback = true;
@@ -9559,6 +9589,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9559
9589
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9560
9590
  return;
9561
9591
  }
9592
+ unsetCurrentInstance();
9562
9593
  instance.asyncResolved = true;
9563
9594
  const { vnode: vnode2 } = instance;
9564
9595
  {
@@ -10075,6 +10106,10 @@ function mergeProps(...args) {
10075
10106
  const incoming = toMerge[key];
10076
10107
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
10077
10108
  ret[key] = existing ? [].concat(existing, incoming) : incoming;
10109
+ } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
10110
+ // the model listener.
10111
+ !isModelListener(key)) {
10112
+ ret[key] = incoming;
10078
10113
  }
10079
10114
  } else if (key !== "") {
10080
10115
  ret[key] = toMerge[key];
@@ -10759,7 +10794,7 @@ function isMemoSame(cached, memo) {
10759
10794
  return true;
10760
10795
  }
10761
10796
 
10762
- const version = "3.5.30";
10797
+ const version = "3.5.32";
10763
10798
  const warn = warn$1 ;
10764
10799
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10765
10800
  const devtools = devtools$1 ;
@@ -12350,7 +12385,8 @@ const vModelText = {
12350
12385
  if (elValue === newValue) {
12351
12386
  return;
12352
12387
  }
12353
- if (document.activeElement === el && el.type !== "range") {
12388
+ const rootNode = el.getRootNode();
12389
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
12354
12390
  if (lazy && value === oldValue) {
12355
12391
  return;
12356
12392
  }