@vue/runtime-dom 3.5.13 → 3.5.14

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.13
2
+ * @vue/runtime-dom v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -326,6 +326,10 @@ var VueRuntimeDOM = (function (exports) {
326
326
  * @internal
327
327
  */
328
328
  this._active = true;
329
+ /**
330
+ * @internal track `on` calls, allow `on` call multiple times
331
+ */
332
+ this._on = 0;
329
333
  /**
330
334
  * @internal
331
335
  */
@@ -396,14 +400,20 @@ var VueRuntimeDOM = (function (exports) {
396
400
  * @internal
397
401
  */
398
402
  on() {
399
- activeEffectScope = this;
403
+ if (++this._on === 1) {
404
+ this.prevScope = activeEffectScope;
405
+ activeEffectScope = this;
406
+ }
400
407
  }
401
408
  /**
402
409
  * This should only be called on non-detached scopes
403
410
  * @internal
404
411
  */
405
412
  off() {
406
- activeEffectScope = this.parent;
413
+ if (this._on > 0 && --this._on === 0) {
414
+ activeEffectScope = this.prevScope;
415
+ this.prevScope = void 0;
416
+ }
407
417
  }
408
418
  stop(fromParent) {
409
419
  if (this._active) {
@@ -485,7 +495,7 @@ var VueRuntimeDOM = (function (exports) {
485
495
  }
486
496
  resume() {
487
497
  if (this.flags & 64) {
488
- this.flags &= ~64;
498
+ this.flags &= -65;
489
499
  if (pausedQueueEffects.has(this)) {
490
500
  pausedQueueEffects.delete(this);
491
501
  this.trigger();
@@ -525,7 +535,7 @@ var VueRuntimeDOM = (function (exports) {
525
535
  cleanupDeps(this);
526
536
  activeSub = prevEffect;
527
537
  shouldTrack = prevShouldTrack;
528
- this.flags &= ~2;
538
+ this.flags &= -3;
529
539
  }
530
540
  }
531
541
  stop() {
@@ -536,7 +546,7 @@ var VueRuntimeDOM = (function (exports) {
536
546
  this.deps = this.depsTail = void 0;
537
547
  cleanupEffect(this);
538
548
  this.onStop && this.onStop();
539
- this.flags &= ~1;
549
+ this.flags &= -2;
540
550
  }
541
551
  }
542
552
  trigger() {
@@ -586,7 +596,7 @@ var VueRuntimeDOM = (function (exports) {
586
596
  while (e) {
587
597
  const next = e.next;
588
598
  e.next = void 0;
589
- e.flags &= ~8;
599
+ e.flags &= -9;
590
600
  e = next;
591
601
  }
592
602
  }
@@ -597,7 +607,7 @@ var VueRuntimeDOM = (function (exports) {
597
607
  while (e) {
598
608
  const next = e.next;
599
609
  e.next = void 0;
600
- e.flags &= ~8;
610
+ e.flags &= -9;
601
611
  if (e.flags & 1) {
602
612
  try {
603
613
  ;
@@ -653,17 +663,16 @@ var VueRuntimeDOM = (function (exports) {
653
663
  if (computed.flags & 4 && !(computed.flags & 16)) {
654
664
  return;
655
665
  }
656
- computed.flags &= ~16;
666
+ computed.flags &= -17;
657
667
  if (computed.globalVersion === globalVersion) {
658
668
  return;
659
669
  }
660
670
  computed.globalVersion = globalVersion;
661
- const dep = computed.dep;
662
- computed.flags |= 2;
663
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
664
- computed.flags &= ~2;
671
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
665
672
  return;
666
673
  }
674
+ computed.flags |= 2;
675
+ const dep = computed.dep;
667
676
  const prevSub = activeSub;
668
677
  const prevShouldTrack = shouldTrack;
669
678
  activeSub = computed;
@@ -672,6 +681,7 @@ var VueRuntimeDOM = (function (exports) {
672
681
  prepareDeps(computed);
673
682
  const value = computed.fn(computed._value);
674
683
  if (dep.version === 0 || hasChanged(value, computed._value)) {
684
+ computed.flags |= 128;
675
685
  computed._value = value;
676
686
  dep.version++;
677
687
  }
@@ -682,7 +692,7 @@ var VueRuntimeDOM = (function (exports) {
682
692
  activeSub = prevSub;
683
693
  shouldTrack = prevShouldTrack;
684
694
  cleanupDeps(computed);
685
- computed.flags &= ~2;
695
+ computed.flags &= -3;
686
696
  }
687
697
  }
688
698
  function removeSub(link, soft = false) {
@@ -701,7 +711,7 @@ var VueRuntimeDOM = (function (exports) {
701
711
  if (dep.subs === link) {
702
712
  dep.subs = prevSub;
703
713
  if (!prevSub && dep.computed) {
704
- dep.computed.flags &= ~4;
714
+ dep.computed.flags &= -5;
705
715
  for (let l = dep.computed.deps; l; l = l.nextDep) {
706
716
  removeSub(l, true);
707
717
  }
@@ -1634,14 +1644,14 @@ var VueRuntimeDOM = (function (exports) {
1634
1644
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1635
1645
  return target;
1636
1646
  }
1637
- const existingProxy = proxyMap.get(target);
1638
- if (existingProxy) {
1639
- return existingProxy;
1640
- }
1641
1647
  const targetType = getTargetType(target);
1642
1648
  if (targetType === 0 /* INVALID */) {
1643
1649
  return target;
1644
1650
  }
1651
+ const existingProxy = proxyMap.get(target);
1652
+ if (existingProxy) {
1653
+ return existingProxy;
1654
+ }
1645
1655
  const proxy = new Proxy(
1646
1656
  target,
1647
1657
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -2485,11 +2495,11 @@ var VueRuntimeDOM = (function (exports) {
2485
2495
  queue.splice(i, 1);
2486
2496
  i--;
2487
2497
  if (cb.flags & 4) {
2488
- cb.flags &= ~1;
2498
+ cb.flags &= -2;
2489
2499
  }
2490
2500
  cb();
2491
2501
  if (!(cb.flags & 4)) {
2492
- cb.flags &= ~1;
2502
+ cb.flags &= -2;
2493
2503
  }
2494
2504
  }
2495
2505
  }
@@ -2514,10 +2524,10 @@ var VueRuntimeDOM = (function (exports) {
2514
2524
  continue;
2515
2525
  }
2516
2526
  if (cb.flags & 4) {
2517
- cb.flags &= ~1;
2527
+ cb.flags &= -2;
2518
2528
  }
2519
2529
  if (!(cb.flags & 8)) cb();
2520
- cb.flags &= ~1;
2530
+ cb.flags &= -2;
2521
2531
  }
2522
2532
  activePostFlushCbs = null;
2523
2533
  postFlushIndex = 0;
@@ -2553,7 +2563,7 @@ var VueRuntimeDOM = (function (exports) {
2553
2563
  for (; flushIndex < queue.length; flushIndex++) {
2554
2564
  const job = queue[flushIndex];
2555
2565
  if (job) {
2556
- job.flags &= ~1;
2566
+ job.flags &= -2;
2557
2567
  }
2558
2568
  }
2559
2569
  flushIndex = -1;
@@ -3042,7 +3052,7 @@ var VueRuntimeDOM = (function (exports) {
3042
3052
  namespace,
3043
3053
  slotScopeIds
3044
3054
  );
3045
- traverseStaticChildren(n1, n2, true);
3055
+ traverseStaticChildren(n1, n2, false);
3046
3056
  } else if (!optimized) {
3047
3057
  patchChildren(
3048
3058
  n1,
@@ -4721,6 +4731,9 @@ Server rendered element contains fewer child nodes than client vdom.`
4721
4731
  {
4722
4732
  devtoolsComponentAdded(instance2);
4723
4733
  }
4734
+ {
4735
+ instance2.__keepAliveStorageContainer = storageContainer;
4736
+ }
4724
4737
  };
4725
4738
  function unmount(vnode) {
4726
4739
  resetShapeFlag(vnode);
@@ -4808,7 +4821,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4808
4821
  );
4809
4822
  const { include, exclude, max } = props;
4810
4823
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4811
- vnode.shapeFlag &= ~256;
4824
+ vnode.shapeFlag &= -257;
4812
4825
  current = vnode;
4813
4826
  return rawVNode;
4814
4827
  }
@@ -4895,8 +4908,8 @@ Server rendered element contains fewer child nodes than client vdom.`
4895
4908
  }, target);
4896
4909
  }
4897
4910
  function resetShapeFlag(vnode) {
4898
- vnode.shapeFlag &= ~256;
4899
- vnode.shapeFlag &= ~512;
4911
+ vnode.shapeFlag &= -257;
4912
+ vnode.shapeFlag &= -513;
4900
4913
  }
4901
4914
  function getInnerChild(vnode) {
4902
4915
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -5011,14 +5024,16 @@ If this is a native custom element, make sure to exclude it from component resol
5011
5024
  if (sourceIsArray || isString(source)) {
5012
5025
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5013
5026
  let needsWrap = false;
5027
+ let isReadonlySource = false;
5014
5028
  if (sourceIsReactiveArray) {
5015
5029
  needsWrap = !isShallow(source);
5030
+ isReadonlySource = isReadonly(source);
5016
5031
  source = shallowReadArray(source);
5017
5032
  }
5018
5033
  ret = new Array(source.length);
5019
5034
  for (let i = 0, l = source.length; i < l; i++) {
5020
5035
  ret[i] = renderItem(
5021
- needsWrap ? toReactive(source[i]) : source[i],
5036
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
5022
5037
  i,
5023
5038
  void 0,
5024
5039
  cached && cached[i]
@@ -6037,11 +6052,9 @@ If this is a native custom element, make sure to exclude it from component resol
6037
6052
  }
6038
6053
  {
6039
6054
  context.reload = () => {
6040
- render(
6041
- cloneVNode(vnode),
6042
- rootContainer,
6043
- namespace
6044
- );
6055
+ const cloned = cloneVNode(vnode);
6056
+ cloned.el = null;
6057
+ render(cloned, rootContainer, namespace);
6045
6058
  };
6046
6059
  }
6047
6060
  if (isHydrate && hydrate) {
@@ -6564,7 +6577,7 @@ If you want to remount the same app, move your app creation logic into a factory
6564
6577
  return rawSlot;
6565
6578
  }
6566
6579
  const normalized = withCtx((...args) => {
6567
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
6580
+ if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6568
6581
  warn$1(
6569
6582
  `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
6570
6583
  );
@@ -6603,7 +6616,7 @@ If you want to remount the same app, move your app creation logic into a factory
6603
6616
  };
6604
6617
  const assignSlots = (slots, children, optimized) => {
6605
6618
  for (const key in children) {
6606
- if (optimized || key !== "_") {
6619
+ if (optimized || !isInternalKey(key)) {
6607
6620
  slots[key] = children[key];
6608
6621
  }
6609
6622
  }
@@ -7289,8 +7302,8 @@ If you want to remount the same app, move your app creation logic into a factory
7289
7302
  endMeasure(instance, `init`);
7290
7303
  }
7291
7304
  }
7305
+ if (isHmrUpdating) initialVNode.el = null;
7292
7306
  if (instance.asyncDep) {
7293
- if (isHmrUpdating) initialVNode.el = null;
7294
7307
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
7295
7308
  if (!initialVNode.el) {
7296
7309
  const placeholder = instance.subTree = createVNode(Comment);
@@ -7852,7 +7865,13 @@ If you want to remount the same app, move your app creation logic into a factory
7852
7865
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7853
7866
  } else {
7854
7867
  const { leave, delayLeave, afterLeave } = transition;
7855
- const remove2 = () => hostInsert(el, container, anchor);
7868
+ const remove2 = () => {
7869
+ if (vnode.ctx.isUnmounted) {
7870
+ hostRemove(el);
7871
+ } else {
7872
+ hostInsert(el, container, anchor);
7873
+ }
7874
+ };
7856
7875
  const performLeave = () => {
7857
7876
  leave(el, () => {
7858
7877
  remove2();
@@ -7885,7 +7904,9 @@ If you want to remount the same app, move your app creation logic into a factory
7885
7904
  optimized = false;
7886
7905
  }
7887
7906
  if (ref != null) {
7907
+ pauseTracking();
7888
7908
  setRef(ref, null, parentSuspense, vnode, true);
7909
+ resetTracking();
7889
7910
  }
7890
7911
  if (cacheIndex != null) {
7891
7912
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -7997,12 +8018,27 @@ If you want to remount the same app, move your app creation logic into a factory
7997
8018
  if (instance.type.__hmrId) {
7998
8019
  unregisterHMR(instance);
7999
8020
  }
8000
- const { bum, scope, job, subTree, um, m, a } = instance;
8021
+ const {
8022
+ bum,
8023
+ scope,
8024
+ job,
8025
+ subTree,
8026
+ um,
8027
+ m,
8028
+ a,
8029
+ parent,
8030
+ slots: { __: slotCacheKeys }
8031
+ } = instance;
8001
8032
  invalidateMount(m);
8002
8033
  invalidateMount(a);
8003
8034
  if (bum) {
8004
8035
  invokeArrayFns(bum);
8005
8036
  }
8037
+ if (parent && isArray(slotCacheKeys)) {
8038
+ slotCacheKeys.forEach((v) => {
8039
+ parent.renderCache[v] = void 0;
8040
+ });
8041
+ }
8006
8042
  scope.stop();
8007
8043
  if (job) {
8008
8044
  job.flags |= 8;
@@ -8098,8 +8134,8 @@ If you want to remount the same app, move your app creation logic into a factory
8098
8134
  effect.flags |= 32;
8099
8135
  job.flags |= 4;
8100
8136
  } else {
8101
- effect.flags &= ~32;
8102
- job.flags &= ~4;
8137
+ effect.flags &= -33;
8138
+ job.flags &= -5;
8103
8139
  }
8104
8140
  }
8105
8141
  function needTransition(parentSuspense, transition) {
@@ -8126,6 +8162,9 @@ If you want to remount the same app, move your app creation logic into a factory
8126
8162
  if (c2.type === Comment && !c2.el) {
8127
8163
  c2.el = c1.el;
8128
8164
  }
8165
+ {
8166
+ c2.el && (c2.el.__vnode = c2);
8167
+ }
8129
8168
  }
8130
8169
  }
8131
8170
  }
@@ -9443,8 +9482,8 @@ If you want to remount the same app, move your app creation logic into a factory
9443
9482
  if (n2.shapeFlag & 6 && n1.component) {
9444
9483
  const dirtyInstances = hmrDirtyComponents.get(n2.type);
9445
9484
  if (dirtyInstances && dirtyInstances.has(n1.component)) {
9446
- n1.shapeFlag &= ~256;
9447
- n2.shapeFlag &= ~512;
9485
+ n1.shapeFlag &= -257;
9486
+ n2.shapeFlag &= -513;
9448
9487
  return false;
9449
9488
  }
9450
9489
  }
@@ -9893,7 +9932,7 @@ Component that was made reactive: `,
9893
9932
  const { props, children } = instance.vnode;
9894
9933
  const isStateful = isStatefulComponent(instance);
9895
9934
  initProps(instance, props, isStateful, isSSR);
9896
- initSlots(instance, children, optimized);
9935
+ initSlots(instance, children, optimized || isSSR);
9897
9936
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9898
9937
  isSSR && setInSSRSetupState(false);
9899
9938
  return setupResult;
@@ -10222,13 +10261,15 @@ Component that was made reactive: `,
10222
10261
  if (obj.__isVue) {
10223
10262
  return ["div", vueStyle, `VueInstance`];
10224
10263
  } else if (isRef(obj)) {
10264
+ pauseTracking();
10265
+ const value = obj.value;
10266
+ resetTracking();
10225
10267
  return [
10226
10268
  "div",
10227
10269
  {},
10228
10270
  ["span", vueStyle, genRefFlag(obj)],
10229
10271
  "<",
10230
- // avoid debugger accessing value affecting behavior
10231
- formatValue("_value" in obj ? obj._value : obj),
10272
+ formatValue(value),
10232
10273
  `>`
10233
10274
  ];
10234
10275
  } else if (isReactive(obj)) {
@@ -10409,7 +10450,7 @@ Component that was made reactive: `,
10409
10450
  return true;
10410
10451
  }
10411
10452
 
10412
- const version = "3.5.13";
10453
+ const version = "3.5.14";
10413
10454
  const warn = warn$1 ;
10414
10455
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10415
10456
  const devtools = devtools$1 ;
@@ -11208,7 +11249,7 @@ Expected function or array of functions, received type ${typeof value}.`
11208
11249
  }
11209
11250
  return false;
11210
11251
  }
11211
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11252
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11212
11253
  return false;
11213
11254
  }
11214
11255
  if (key === "form") {
@@ -11685,6 +11726,7 @@ Expected function or array of functions, received type ${typeof value}.`
11685
11726
  instance.vnode.el,
11686
11727
  moveClass
11687
11728
  )) {
11729
+ prevChildren = [];
11688
11730
  return;
11689
11731
  }
11690
11732
  prevChildren.forEach(callPendingCbs);
@@ -11708,6 +11750,7 @@ Expected function or array of functions, received type ${typeof value}.`
11708
11750
  };
11709
11751
  el.addEventListener("transitionend", cb);
11710
11752
  });
11753
+ prevChildren = [];
11711
11754
  });
11712
11755
  return () => {
11713
11756
  const rawProps = toRaw(props);