@vue/runtime-dom 3.5.34 → 3.5.35

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.34
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -677,12 +677,37 @@ function createInvoker(initialValue, instance) {
677
677
  } else if (e._vts <= invoker.attached) {
678
678
  return;
679
679
  }
680
- runtimeCore.callWithAsyncErrorHandling(
681
- patchStopImmediatePropagation(e, invoker.value),
682
- instance,
683
- 5,
684
- [e]
685
- );
680
+ const value = invoker.value;
681
+ if (shared.isArray(value)) {
682
+ const originalStop = e.stopImmediatePropagation;
683
+ e.stopImmediatePropagation = () => {
684
+ originalStop.call(e);
685
+ e._stopped = true;
686
+ };
687
+ const handlers = value.slice();
688
+ const args = [e];
689
+ for (let i = 0; i < handlers.length; i++) {
690
+ if (e._stopped) {
691
+ break;
692
+ }
693
+ const handler = handlers[i];
694
+ if (handler) {
695
+ runtimeCore.callWithAsyncErrorHandling(
696
+ handler,
697
+ instance,
698
+ 5,
699
+ args
700
+ );
701
+ }
702
+ }
703
+ } else {
704
+ runtimeCore.callWithAsyncErrorHandling(
705
+ value,
706
+ instance,
707
+ 5,
708
+ [e]
709
+ );
710
+ }
686
711
  };
687
712
  invoker.value = initialValue;
688
713
  invoker.attached = getNow();
@@ -698,20 +723,6 @@ Expected function or array of functions, received type ${typeof value}.`
698
723
  );
699
724
  return shared.NOOP;
700
725
  }
701
- function patchStopImmediatePropagation(e, value) {
702
- if (shared.isArray(value)) {
703
- const originalStop = e.stopImmediatePropagation;
704
- e.stopImmediatePropagation = () => {
705
- originalStop.call(e);
706
- e._stopped = true;
707
- };
708
- return value.map(
709
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
710
- );
711
- } else {
712
- return value;
713
- }
714
- }
715
726
 
716
727
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
717
728
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.34
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -659,31 +659,42 @@ function createInvoker(initialValue, instance) {
659
659
  } else if (e._vts <= invoker.attached) {
660
660
  return;
661
661
  }
662
- runtimeCore.callWithAsyncErrorHandling(
663
- patchStopImmediatePropagation(e, invoker.value),
664
- instance,
665
- 5,
666
- [e]
667
- );
662
+ const value = invoker.value;
663
+ if (shared.isArray(value)) {
664
+ const originalStop = e.stopImmediatePropagation;
665
+ e.stopImmediatePropagation = () => {
666
+ originalStop.call(e);
667
+ e._stopped = true;
668
+ };
669
+ const handlers = value.slice();
670
+ const args = [e];
671
+ for (let i = 0; i < handlers.length; i++) {
672
+ if (e._stopped) {
673
+ break;
674
+ }
675
+ const handler = handlers[i];
676
+ if (handler) {
677
+ runtimeCore.callWithAsyncErrorHandling(
678
+ handler,
679
+ instance,
680
+ 5,
681
+ args
682
+ );
683
+ }
684
+ }
685
+ } else {
686
+ runtimeCore.callWithAsyncErrorHandling(
687
+ value,
688
+ instance,
689
+ 5,
690
+ [e]
691
+ );
692
+ }
668
693
  };
669
694
  invoker.value = initialValue;
670
695
  invoker.attached = getNow();
671
696
  return invoker;
672
697
  }
673
- function patchStopImmediatePropagation(e, value) {
674
- if (shared.isArray(value)) {
675
- const originalStop = e.stopImmediatePropagation;
676
- e.stopImmediatePropagation = () => {
677
- originalStop.call(e);
678
- e._stopped = true;
679
- };
680
- return value.map(
681
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
682
- );
683
- } else {
684
- return value;
685
- }
686
- }
687
698
 
688
699
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
689
700
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.34
2
+ * @vue/runtime-dom v3.5.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1672,9 +1672,6 @@ function targetTypeMap(rawType) {
1672
1672
  return 0 /* INVALID */;
1673
1673
  }
1674
1674
  }
1675
- function getTargetType(value) {
1676
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1677
- }
1678
1675
  // @__NO_SIDE_EFFECTS__
1679
1676
  function reactive(target) {
1680
1677
  if (/* @__PURE__ */ isReadonly(target)) {
@@ -1732,14 +1729,17 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1732
1729
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1733
1730
  return target;
1734
1731
  }
1735
- const targetType = getTargetType(target);
1736
- if (targetType === 0 /* INVALID */) {
1732
+ if (target["__v_skip"] || !Object.isExtensible(target)) {
1737
1733
  return target;
1738
1734
  }
1739
1735
  const existingProxy = proxyMap.get(target);
1740
1736
  if (existingProxy) {
1741
1737
  return existingProxy;
1742
1738
  }
1739
+ const targetType = targetTypeMap(toRawType(target));
1740
+ if (targetType === 0 /* INVALID */) {
1741
+ return target;
1742
+ }
1743
1743
  const proxy = new Proxy(
1744
1744
  target,
1745
1745
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -3422,19 +3422,18 @@ const TeleportImpl = {
3422
3422
  target,
3423
3423
  props
3424
3424
  } = vnode;
3425
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3425
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3426
3426
  const pendingMount = pendingMounts.get(vnode);
3427
3427
  if (pendingMount) {
3428
3428
  pendingMount.flags |= 8;
3429
3429
  pendingMounts.delete(vnode);
3430
- shouldRemove = false;
3431
3430
  }
3432
3431
  if (target) {
3433
3432
  hostRemove(targetStart);
3434
3433
  hostRemove(targetAnchor);
3435
3434
  }
3436
3435
  doRemove && hostRemove(anchor);
3437
- if (shapeFlag & 16) {
3436
+ if (!pendingMount && shapeFlag & 16) {
3438
3437
  for (let i = 0; i < children.length; i++) {
3439
3438
  const child = children[i];
3440
3439
  unmount(
@@ -4402,20 +4401,16 @@ function createHydrationFunctions(rendererInternals) {
4402
4401
  slotScopeIds,
4403
4402
  optimized
4404
4403
  );
4405
- let hasWarned = false;
4406
- while (next) {
4407
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4408
- if (!hasWarned) {
4409
- warn$1(
4410
- `Hydration children mismatch on`,
4411
- el,
4412
- `
4404
+ if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
4405
+ warn$1(
4406
+ `Hydration children mismatch on`,
4407
+ el,
4408
+ `
4413
4409
  Server rendered element contains more child nodes than client vdom.`
4414
- );
4415
- hasWarned = true;
4416
- }
4417
- logMismatchError();
4418
- }
4410
+ );
4411
+ logMismatchError();
4412
+ }
4413
+ while (next) {
4419
4414
  const cur = next;
4420
4415
  next = next.nextSibling;
4421
4416
  remove(cur);
@@ -4478,7 +4473,7 @@ Server rendered element contains more child nodes than client vdom.`
4478
4473
  optimized = optimized || !!parentVNode.dynamicChildren;
4479
4474
  const children = parentVNode.children;
4480
4475
  const l = children.length;
4481
- let hasWarned = false;
4476
+ let hasCheckedMismatch = false;
4482
4477
  for (let i = 0; i < l; i++) {
4483
4478
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4484
4479
  const isText = vnode.type === Text;
@@ -4506,17 +4501,17 @@ Server rendered element contains more child nodes than client vdom.`
4506
4501
  } else if (isText && !vnode.children) {
4507
4502
  insert(vnode.el = createText(""), container);
4508
4503
  } else {
4509
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4510
- if (!hasWarned) {
4504
+ if (!hasCheckedMismatch) {
4505
+ hasCheckedMismatch = true;
4506
+ if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4511
4507
  warn$1(
4512
4508
  `Hydration children mismatch on`,
4513
4509
  container,
4514
4510
  `
4515
4511
  Server rendered element contains fewer child nodes than client vdom.`
4516
4512
  );
4517
- hasWarned = true;
4513
+ logMismatchError();
4518
4514
  }
4519
- logMismatchError();
4520
4515
  }
4521
4516
  patch(
4522
4517
  null,
@@ -8798,9 +8793,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8798
8793
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8799
8794
  if (needTransition2) {
8800
8795
  if (moveType === 0) {
8801
- transition.beforeEnter(el);
8802
- hostInsert(el, container, anchor);
8803
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8796
+ if (transition.persisted && !el[leaveCbKey]) {
8797
+ hostInsert(el, container, anchor);
8798
+ } else {
8799
+ transition.beforeEnter(el);
8800
+ hostInsert(el, container, anchor);
8801
+ queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8802
+ }
8804
8803
  } else {
8805
8804
  const { leave, delayLeave, afterLeave } = transition;
8806
8805
  const remove2 = () => {
@@ -8811,16 +8810,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8811
8810
  }
8812
8811
  };
8813
8812
  const performLeave = () => {
8813
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8814
8814
  if (el._isLeaving) {
8815
8815
  el[leaveCbKey](
8816
8816
  true
8817
8817
  /* cancelled */
8818
8818
  );
8819
8819
  }
8820
- leave(el, () => {
8820
+ if (transition.persisted && !wasLeaving) {
8821
8821
  remove2();
8822
- afterLeave && afterLeave();
8823
- });
8822
+ } else {
8823
+ leave(el, () => {
8824
+ remove2();
8825
+ afterLeave && afterLeave();
8826
+ });
8827
+ }
8824
8828
  };
8825
8829
  if (delayLeave) {
8826
8830
  delayLeave(el, remove2, performLeave);
@@ -10827,7 +10831,7 @@ function isMemoSame(cached, memo) {
10827
10831
  return true;
10828
10832
  }
10829
10833
 
10830
- const version = "3.5.34";
10834
+ const version = "3.5.35";
10831
10835
  const warn = warn$1 ;
10832
10836
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10833
10837
  const devtools = devtools$1 ;
@@ -11584,12 +11588,37 @@ function createInvoker(initialValue, instance) {
11584
11588
  } else if (e._vts <= invoker.attached) {
11585
11589
  return;
11586
11590
  }
11587
- callWithAsyncErrorHandling(
11588
- patchStopImmediatePropagation(e, invoker.value),
11589
- instance,
11590
- 5,
11591
- [e]
11592
- );
11591
+ const value = invoker.value;
11592
+ if (isArray(value)) {
11593
+ const originalStop = e.stopImmediatePropagation;
11594
+ e.stopImmediatePropagation = () => {
11595
+ originalStop.call(e);
11596
+ e._stopped = true;
11597
+ };
11598
+ const handlers = value.slice();
11599
+ const args = [e];
11600
+ for (let i = 0; i < handlers.length; i++) {
11601
+ if (e._stopped) {
11602
+ break;
11603
+ }
11604
+ const handler = handlers[i];
11605
+ if (handler) {
11606
+ callWithAsyncErrorHandling(
11607
+ handler,
11608
+ instance,
11609
+ 5,
11610
+ args
11611
+ );
11612
+ }
11613
+ }
11614
+ } else {
11615
+ callWithAsyncErrorHandling(
11616
+ value,
11617
+ instance,
11618
+ 5,
11619
+ [e]
11620
+ );
11621
+ }
11593
11622
  };
11594
11623
  invoker.value = initialValue;
11595
11624
  invoker.attached = getNow();
@@ -11605,20 +11634,6 @@ Expected function or array of functions, received type ${typeof value}.`
11605
11634
  );
11606
11635
  return NOOP;
11607
11636
  }
11608
- function patchStopImmediatePropagation(e, value) {
11609
- if (isArray(value)) {
11610
- const originalStop = e.stopImmediatePropagation;
11611
- e.stopImmediatePropagation = () => {
11612
- originalStop.call(e);
11613
- e._stopped = true;
11614
- };
11615
- return value.map(
11616
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
11617
- );
11618
- } else {
11619
- return value;
11620
- }
11621
- }
11622
11637
 
11623
11638
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11624
11639
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;