@vue/runtime-dom 3.2.34 → 3.2.37

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.
@@ -301,7 +301,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
301
301
  // if the low-res timestamp which is bigger than the event timestamp
302
302
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
303
303
  // and we need to use the hi-res version for event listeners as well.
304
- _getNow = () => performance.now();
304
+ _getNow = performance.now.bind(performance);
305
305
  }
306
306
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
307
307
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -781,9 +781,8 @@ function resolveTransitionProps(rawProps) {
781
781
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
782
782
  done && done();
783
783
  };
784
- let isLeaving = false;
785
784
  const finishLeave = (el, done) => {
786
- isLeaving = false;
785
+ el._isLeaving = false;
787
786
  removeTransitionClass(el, leaveFromClass);
788
787
  removeTransitionClass(el, leaveToClass);
789
788
  removeTransitionClass(el, leaveActiveClass);
@@ -817,14 +816,14 @@ function resolveTransitionProps(rawProps) {
817
816
  onEnter: makeEnterHook(false),
818
817
  onAppear: makeEnterHook(true),
819
818
  onLeave(el, done) {
820
- isLeaving = true;
819
+ el._isLeaving = true;
821
820
  const resolve = () => finishLeave(el, done);
822
821
  addTransitionClass(el, leaveFromClass);
823
822
  // force reflow so *-leave-from classes immediately take effect (#2593)
824
823
  forceReflow();
825
824
  addTransitionClass(el, leaveActiveClass);
826
825
  nextFrame(() => {
827
- if (!isLeaving) {
826
+ if (!el._isLeaving) {
828
827
  // cancelled
829
828
  return;
830
829
  }
@@ -297,7 +297,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
297
297
  // if the low-res timestamp which is bigger than the event timestamp
298
298
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
299
299
  // and we need to use the hi-res version for event listeners as well.
300
- _getNow = () => performance.now();
300
+ _getNow = performance.now.bind(performance);
301
301
  }
302
302
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
303
303
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -748,9 +748,8 @@ function resolveTransitionProps(rawProps) {
748
748
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
749
749
  done && done();
750
750
  };
751
- let isLeaving = false;
752
751
  const finishLeave = (el, done) => {
753
- isLeaving = false;
752
+ el._isLeaving = false;
754
753
  removeTransitionClass(el, leaveFromClass);
755
754
  removeTransitionClass(el, leaveToClass);
756
755
  removeTransitionClass(el, leaveActiveClass);
@@ -784,14 +783,14 @@ function resolveTransitionProps(rawProps) {
784
783
  onEnter: makeEnterHook(false),
785
784
  onAppear: makeEnterHook(true),
786
785
  onLeave(el, done) {
787
- isLeaving = true;
786
+ el._isLeaving = true;
788
787
  const resolve = () => finishLeave(el, done);
789
788
  addTransitionClass(el, leaveFromClass);
790
789
  // force reflow so *-leave-from classes immediately take effect (#2593)
791
790
  forceReflow();
792
791
  addTransitionClass(el, leaveActiveClass);
793
792
  nextFrame(() => {
794
- if (!isLeaving) {
793
+ if (!el._isLeaving) {
795
794
  // cancelled
796
795
  return;
797
796
  }
@@ -208,7 +208,6 @@ export interface CSSProperties
208
208
  * For examples and more information, visit:
209
209
  * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
210
210
  */
211
-
212
211
  [v: `--${string}`]: string | number | undefined
213
212
  }
214
213
 
@@ -1479,10 +1478,7 @@ import * as RuntimeCore from '@vue/runtime-core'
1479
1478
 
1480
1479
  type ReservedProps = {
1481
1480
  key?: string | number | symbol
1482
- ref?:
1483
- | string
1484
- | RuntimeCore.Ref
1485
- | ((ref: Element | RuntimeCore.ComponentPublicInstance | null) => void)
1481
+ ref?: RuntimeCore.VNodeRef
1486
1482
  ref_for?: boolean
1487
1483
  ref_key?: string
1488
1484
  }
@@ -4291,7 +4291,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4291
4291
  const Component = instance.type;
4292
4292
  // explicit self name has highest priority
4293
4293
  if (type === COMPONENTS) {
4294
- const selfName = getComponentName(Component);
4294
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4295
4295
  if (selfName &&
4296
4296
  (selfName === name ||
4297
4297
  selfName === camelize(name) ||
@@ -5962,7 +5962,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5962
5962
  setupState[ref] = value;
5963
5963
  }
5964
5964
  }
5965
- else if (isRef(ref)) {
5965
+ else if (_isRef) {
5966
5966
  ref.value = value;
5967
5967
  if (rawRef.k)
5968
5968
  refs[rawRef.k] = value;
@@ -6001,11 +6001,13 @@ function createHydrationFunctions(rendererInternals) {
6001
6001
  `Performing full mount instead.`);
6002
6002
  patch(null, vnode, container);
6003
6003
  flushPostFlushCbs();
6004
+ container._vnode = vnode;
6004
6005
  return;
6005
6006
  }
6006
6007
  hasMismatch = false;
6007
6008
  hydrateNode(container.firstChild, vnode, null, null, null);
6008
6009
  flushPostFlushCbs();
6010
+ container._vnode = vnode;
6009
6011
  if (hasMismatch && !false) {
6010
6012
  // this error should show up in production
6011
6013
  console.error(`Hydration completed but contains mismatches.`);
@@ -6028,7 +6030,7 @@ function createHydrationFunctions(rendererInternals) {
6028
6030
  // #5728 empty text node inside a slot can cause hydration failure
6029
6031
  // because the server rendered HTML won't contain a text node
6030
6032
  if (vnode.children === '') {
6031
- insert((vnode.el = createText('')), node.parentElement, node);
6033
+ insert((vnode.el = createText('')), parentNode(node), node);
6032
6034
  nextNode = node;
6033
6035
  }
6034
6036
  else {
@@ -6055,7 +6057,7 @@ function createHydrationFunctions(rendererInternals) {
6055
6057
  }
6056
6058
  break;
6057
6059
  case Static:
6058
- if (domType !== 1 /* ELEMENT */) {
6060
+ if (domType !== 1 /* ELEMENT */ && domType !== 3 /* TEXT */) {
6059
6061
  nextNode = onMismatch();
6060
6062
  }
6061
6063
  else {
@@ -6066,7 +6068,10 @@ function createHydrationFunctions(rendererInternals) {
6066
6068
  const needToAdoptContent = !vnode.children.length;
6067
6069
  for (let i = 0; i < vnode.staticCount; i++) {
6068
6070
  if (needToAdoptContent)
6069
- vnode.children += nextNode.outerHTML;
6071
+ vnode.children +=
6072
+ nextNode.nodeType === 1 /* ELEMENT */
6073
+ ? nextNode.outerHTML
6074
+ : nextNode.data;
6070
6075
  if (i === vnode.staticCount - 1) {
6071
6076
  vnode.anchor = nextNode;
6072
6077
  }
@@ -8739,10 +8744,10 @@ function getExposeProxy(instance) {
8739
8744
  }
8740
8745
  const classifyRE = /(?:^|[-_])(\w)/g;
8741
8746
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
8742
- function getComponentName(Component) {
8747
+ function getComponentName(Component, includeInferred = true) {
8743
8748
  return isFunction(Component)
8744
8749
  ? Component.displayName || Component.name
8745
- : Component.name;
8750
+ : Component.name || (includeInferred && Component.__name);
8746
8751
  }
8747
8752
  /* istanbul ignore next */
8748
8753
  function formatComponentName(instance, Component, isRoot = false) {
@@ -9186,9 +9191,9 @@ function isMemoSame(cached, memo) {
9186
9191
  }
9187
9192
 
9188
9193
  // Core API ------------------------------------------------------------------
9189
- const version = "3.2.34";
9194
+ const version = "3.2.37";
9190
9195
  /**
9191
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9196
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
9192
9197
  * @internal
9193
9198
  */
9194
9199
  const ssrUtils = (null);
@@ -9497,7 +9502,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
9497
9502
  // if the low-res timestamp which is bigger than the event timestamp
9498
9503
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
9499
9504
  // and we need to use the hi-res version for event listeners as well.
9500
- _getNow = () => performance.now();
9505
+ _getNow = performance.now.bind(performance);
9501
9506
  }
9502
9507
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
9503
9508
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -10027,9 +10032,8 @@ function resolveTransitionProps(rawProps) {
10027
10032
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10028
10033
  done && done();
10029
10034
  };
10030
- let isLeaving = false;
10031
10035
  const finishLeave = (el, done) => {
10032
- isLeaving = false;
10036
+ el._isLeaving = false;
10033
10037
  removeTransitionClass(el, leaveFromClass);
10034
10038
  removeTransitionClass(el, leaveToClass);
10035
10039
  removeTransitionClass(el, leaveActiveClass);
@@ -10063,14 +10067,14 @@ function resolveTransitionProps(rawProps) {
10063
10067
  onEnter: makeEnterHook(false),
10064
10068
  onAppear: makeEnterHook(true),
10065
10069
  onLeave(el, done) {
10066
- isLeaving = true;
10070
+ el._isLeaving = true;
10067
10071
  const resolve = () => finishLeave(el, done);
10068
10072
  addTransitionClass(el, leaveFromClass);
10069
10073
  // force reflow so *-leave-from classes immediately take effect (#2593)
10070
10074
  forceReflow();
10071
10075
  addTransitionClass(el, leaveActiveClass);
10072
10076
  nextFrame(() => {
10073
- if (!isLeaving) {
10077
+ if (!el._isLeaving) {
10074
10078
  // cancelled
10075
10079
  return;
10076
10080
  }