@vue/runtime-dom 3.5.20 → 3.5.21

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,9 +1,8 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.20
2
+ * @vue/runtime-dom v3.5.21
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- /*! #__NO_SIDE_EFFECTS__ */
7
6
  // @__NO_SIDE_EFFECTS__
8
7
  function makeMap(str) {
9
8
  const map = /* @__PURE__ */ Object.create(null);
@@ -61,10 +60,10 @@ const cacheStringFunction = (fn) => {
61
60
  return hit || (cache[str] = fn(str));
62
61
  });
63
62
  };
64
- const camelizeRE = /-(\w)/g;
63
+ const camelizeRE = /-\w/g;
65
64
  const camelize = cacheStringFunction(
66
65
  (str) => {
67
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
66
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
68
67
  }
69
68
  );
70
69
  const hyphenateRE = /\B([A-Z])/g;
@@ -2154,11 +2153,11 @@ function traverse(value, depth = Infinity, seen) {
2154
2153
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2155
2154
  return value;
2156
2155
  }
2157
- seen = seen || /* @__PURE__ */ new Set();
2158
- if (seen.has(value)) {
2156
+ seen = seen || /* @__PURE__ */ new Map();
2157
+ if ((seen.get(value) || 0) >= depth) {
2159
2158
  return value;
2160
2159
  }
2161
- seen.add(value);
2160
+ seen.set(value, depth);
2162
2161
  depth--;
2163
2162
  if (isRef(value)) {
2164
2163
  traverse(value.value, depth, seen);
@@ -2620,11 +2619,14 @@ function checkRecursiveUpdates(seen, fn) {
2620
2619
  let isHmrUpdating = false;
2621
2620
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2622
2621
  {
2623
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
2624
- createRecord: tryWrap(createRecord),
2625
- rerender: tryWrap(rerender),
2626
- reload: tryWrap(reload)
2627
- };
2622
+ const g = getGlobalThis();
2623
+ if (!g.__VUE_HMR_RUNTIME__) {
2624
+ g.__VUE_HMR_RUNTIME__ = {
2625
+ createRecord: tryWrap(createRecord),
2626
+ rerender: tryWrap(rerender),
2627
+ reload: tryWrap(reload)
2628
+ };
2629
+ }
2628
2630
  }
2629
2631
  const map = /* @__PURE__ */ new Map();
2630
2632
  function registerHMR(instance) {
@@ -2697,10 +2699,12 @@ function reload(id, newComp) {
2697
2699
  dirtyInstances.delete(instance);
2698
2700
  } else if (instance.parent) {
2699
2701
  queueJob(() => {
2700
- isHmrUpdating = true;
2701
- instance.parent.update();
2702
- isHmrUpdating = false;
2703
- dirtyInstances.delete(instance);
2702
+ if (!(instance.job.flags & 8)) {
2703
+ isHmrUpdating = true;
2704
+ instance.parent.update();
2705
+ isHmrUpdating = false;
2706
+ dirtyInstances.delete(instance);
2707
+ }
2704
2708
  });
2705
2709
  } else if (instance.appContext.reload) {
2706
2710
  instance.appContext.reload();
@@ -2804,7 +2808,6 @@ const devtoolsComponentRemoved = (component) => {
2804
2808
  _devtoolsComponentRemoved(component);
2805
2809
  }
2806
2810
  };
2807
- /*! #__NO_SIDE_EFFECTS__ */
2808
2811
  // @__NO_SIDE_EFFECTS__
2809
2812
  function createDevtoolsComponentHook(hook) {
2810
2813
  return (component) => {
@@ -3202,26 +3205,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3202
3205
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3203
3206
  o: { nextSibling, parentNode, querySelector, insert, createText }
3204
3207
  }, hydrateChildren) {
3208
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3209
+ vnode2.anchor = hydrateChildren(
3210
+ nextSibling(node2),
3211
+ vnode2,
3212
+ parentNode(node2),
3213
+ parentComponent,
3214
+ parentSuspense,
3215
+ slotScopeIds,
3216
+ optimized
3217
+ );
3218
+ vnode2.targetStart = targetStart;
3219
+ vnode2.targetAnchor = targetAnchor;
3220
+ }
3205
3221
  const target = vnode.target = resolveTarget(
3206
3222
  vnode.props,
3207
3223
  querySelector
3208
3224
  );
3225
+ const disabled = isTeleportDisabled(vnode.props);
3209
3226
  if (target) {
3210
- const disabled = isTeleportDisabled(vnode.props);
3211
3227
  const targetNode = target._lpa || target.firstChild;
3212
3228
  if (vnode.shapeFlag & 16) {
3213
3229
  if (disabled) {
3214
- vnode.anchor = hydrateChildren(
3215
- nextSibling(node),
3230
+ hydrateDisabledTeleport(
3231
+ node,
3216
3232
  vnode,
3217
- parentNode(node),
3218
- parentComponent,
3219
- parentSuspense,
3220
- slotScopeIds,
3221
- optimized
3233
+ targetNode,
3234
+ targetNode && nextSibling(targetNode)
3222
3235
  );
3223
- vnode.targetStart = targetNode;
3224
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3225
3236
  } else {
3226
3237
  vnode.anchor = nextSibling(node);
3227
3238
  let targetAnchor = targetNode;
@@ -3252,6 +3263,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3252
3263
  }
3253
3264
  }
3254
3265
  updateCssVars(vnode, disabled);
3266
+ } else if (disabled) {
3267
+ if (vnode.shapeFlag & 16) {
3268
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3269
+ }
3255
3270
  }
3256
3271
  return vnode.anchor && nextSibling(vnode.anchor);
3257
3272
  }
@@ -3363,7 +3378,7 @@ const BaseTransitionImpl = {
3363
3378
  setTransitionHooks(innerChild, enterHooks);
3364
3379
  }
3365
3380
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3366
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3381
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3367
3382
  let leavingHooks = resolveTransitionHooks(
3368
3383
  oldInnerChild,
3369
3384
  rawProps,
@@ -3643,7 +3658,6 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3643
3658
  return ret;
3644
3659
  }
3645
3660
 
3646
- /*! #__NO_SIDE_EFFECTS__ */
3647
3661
  // @__NO_SIDE_EFFECTS__
3648
3662
  function defineComponent(options, extraOptions) {
3649
3663
  return isFunction(options) ? (
@@ -3696,6 +3710,7 @@ function useTemplateRef(key) {
3696
3710
  return ret;
3697
3711
  }
3698
3712
 
3713
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3699
3714
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3700
3715
  if (isArray(rawRef)) {
3701
3716
  rawRef.forEach(
@@ -3745,6 +3760,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3745
3760
  return !knownTemplateRefs.has(ref2);
3746
3761
  };
3747
3762
  if (oldRef != null && oldRef !== ref) {
3763
+ invalidatePendingSetRef(oldRawRef);
3748
3764
  if (isString(oldRef)) {
3749
3765
  refs[oldRef] = null;
3750
3766
  if (canSetSetupRef(oldRef)) {
@@ -3802,9 +3818,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3802
3818
  }
3803
3819
  };
3804
3820
  if (value) {
3805
- doSet.id = -1;
3806
- queuePostRenderEffect(doSet, parentSuspense);
3821
+ const job = () => {
3822
+ doSet();
3823
+ pendingSetRefMap.delete(rawRef);
3824
+ };
3825
+ job.id = -1;
3826
+ pendingSetRefMap.set(rawRef, job);
3827
+ queuePostRenderEffect(job, parentSuspense);
3807
3828
  } else {
3829
+ invalidatePendingSetRef(rawRef);
3808
3830
  doSet();
3809
3831
  }
3810
3832
  } else {
@@ -3812,6 +3834,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3812
3834
  }
3813
3835
  }
3814
3836
  }
3837
+ function invalidatePendingSetRef(rawRef) {
3838
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
3839
+ if (pendingSetRef) {
3840
+ pendingSetRef.flags |= 8;
3841
+ pendingSetRefMap.delete(rawRef);
3842
+ }
3843
+ }
3815
3844
 
3816
3845
  let hasLoggedMismatchError = false;
3817
3846
  const logMismatchError = () => {
@@ -4544,7 +4573,6 @@ function forEachElement(node, cb) {
4544
4573
  }
4545
4574
 
4546
4575
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4547
- /*! #__NO_SIDE_EFFECTS__ */
4548
4576
  // @__NO_SIDE_EFFECTS__
4549
4577
  function defineAsyncComponent(source) {
4550
4578
  if (isFunction(source)) {
@@ -8582,8 +8610,9 @@ function emit(instance, event, ...rawArgs) {
8582
8610
  );
8583
8611
  }
8584
8612
  }
8613
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8585
8614
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8586
- const cache = appContext.emitsCache;
8615
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8587
8616
  const cached = cache.get(comp);
8588
8617
  if (cached !== void 0) {
8589
8618
  return cached;
@@ -9031,7 +9060,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9031
9060
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9032
9061
  if (pendingBranch) {
9033
9062
  suspense.pendingBranch = newBranch;
9034
- if (isSameVNodeType(newBranch, pendingBranch)) {
9063
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9035
9064
  patch(
9036
9065
  pendingBranch,
9037
9066
  newBranch,
@@ -9102,7 +9131,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9102
9131
  );
9103
9132
  setActiveBranch(suspense, newFallback);
9104
9133
  }
9105
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9134
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9106
9135
  patch(
9107
9136
  activeBranch,
9108
9137
  newBranch,
@@ -9133,7 +9162,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9133
9162
  }
9134
9163
  }
9135
9164
  } else {
9136
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9165
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9137
9166
  patch(
9138
9167
  activeBranch,
9139
9168
  newBranch,
@@ -10290,7 +10319,7 @@ function getComponentPublicInstance(instance) {
10290
10319
  return instance.proxy;
10291
10320
  }
10292
10321
  }
10293
- const classifyRE = /(?:^|[-_])(\w)/g;
10322
+ const classifyRE = /(?:^|[-_])\w/g;
10294
10323
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
10295
10324
  function getComponentName(Component, includeInferred = true) {
10296
10325
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -10333,15 +10362,23 @@ const computed = (getterOrOptions, debugOptions) => {
10333
10362
  };
10334
10363
 
10335
10364
  function h(type, propsOrChildren, children) {
10365
+ const doCreateVNode = (type2, props, children2) => {
10366
+ setBlockTracking(-1);
10367
+ try {
10368
+ return createVNode(type2, props, children2);
10369
+ } finally {
10370
+ setBlockTracking(1);
10371
+ }
10372
+ };
10336
10373
  const l = arguments.length;
10337
10374
  if (l === 2) {
10338
10375
  if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10339
10376
  if (isVNode(propsOrChildren)) {
10340
- return createVNode(type, null, [propsOrChildren]);
10377
+ return doCreateVNode(type, null, [propsOrChildren]);
10341
10378
  }
10342
- return createVNode(type, propsOrChildren);
10379
+ return doCreateVNode(type, propsOrChildren);
10343
10380
  } else {
10344
- return createVNode(type, null, propsOrChildren);
10381
+ return doCreateVNode(type, null, propsOrChildren);
10345
10382
  }
10346
10383
  } else {
10347
10384
  if (l > 3) {
@@ -10349,7 +10386,7 @@ function h(type, propsOrChildren, children) {
10349
10386
  } else if (l === 3 && isVNode(children)) {
10350
10387
  children = [children];
10351
10388
  }
10352
- return createVNode(type, propsOrChildren, children);
10389
+ return doCreateVNode(type, propsOrChildren, children);
10353
10390
  }
10354
10391
  }
10355
10392
 
@@ -10559,7 +10596,7 @@ function isMemoSame(cached, memo) {
10559
10596
  return true;
10560
10597
  }
10561
10598
 
10562
- const version = "3.5.20";
10599
+ const version = "3.5.21";
10563
10600
  const warn = warn$1 ;
10564
10601
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10565
10602
  const devtools = devtools$1 ;
@@ -10918,7 +10955,7 @@ function getTransitionInfo(el, expectedType) {
10918
10955
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
10919
10956
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
10920
10957
  }
10921
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
10958
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
10922
10959
  getStyleProperties(`${TRANSITION}Property`).toString()
10923
10960
  );
10924
10961
  return {
@@ -11079,7 +11116,7 @@ function setVarsOnNode(el, vars) {
11079
11116
  }
11080
11117
  }
11081
11118
 
11082
- const displayRE = /(^|;)\s*display\s*:/;
11119
+ const displayRE = /(?:^|;)\s*display\s*:/;
11083
11120
  function patchStyle(el, prev, next) {
11084
11121
  const style = el.style;
11085
11122
  const isCssString = isString(next);
@@ -11402,11 +11439,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
11402
11439
  }
11403
11440
 
11404
11441
  const REMOVAL = {};
11405
- /*! #__NO_SIDE_EFFECTS__ */
11406
11442
  // @__NO_SIDE_EFFECTS__
11407
11443
  function defineCustomElement(options, extraOptions, _createApp) {
11408
- const Comp = defineComponent(options, extraOptions);
11409
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
11444
+ let Comp = defineComponent(options, extraOptions);
11445
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11410
11446
  class VueCustomElement extends VueElement {
11411
11447
  constructor(initialProps) {
11412
11448
  super(Comp, initialProps, _createApp);
@@ -11415,7 +11451,6 @@ function defineCustomElement(options, extraOptions, _createApp) {
11415
11451
  VueCustomElement.def = Comp;
11416
11452
  return VueCustomElement;
11417
11453
  }
11418
-
11419
11454
  const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11420
11455
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11421
11456
  });
@@ -11888,7 +11923,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11888
11923
  if (e && e.target !== el) {
11889
11924
  return;
11890
11925
  }
11891
- if (!e || /transform$/.test(e.propertyName)) {
11926
+ if (!e || e.propertyName.endsWith("transform")) {
11892
11927
  el.removeEventListener("transitionend", cb);
11893
11928
  el[moveCbKey] = null;
11894
11929
  removeTransitionClass(el, moveClass);