vue 3.6.0-beta.5 → 3.6.0-beta.7

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.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  - **`vue(.runtime).global(.prod).js`**:
8
8
  - For direct use via `<script src="...">` in the browser. Exposes the `Vue` global.
9
- - Note that global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src="...">`.
9
+ - Note that global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and are only meant for direct use via `<script src="...">`.
10
10
  - In-browser template compilation:
11
11
  - **`vue.global.js`** is the "full" build that includes both the compiler and the runtime so it supports compiling templates on the fly.
12
12
  - **`vue.runtime.global.js`** contains only the runtime and requires templates to be pre-compiled during a build step.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.5
2
+ * vue v3.6.0-beta.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.5
2
+ * vue v3.6.0-beta.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.5
2
+ * vue v3.6.0-beta.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -3300,36 +3300,44 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3300
3300
  if (isReorder) insert(anchor, container, parentAnchor);
3301
3301
  }
3302
3302
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector, insert, createText } }, hydrateChildren) {
3303
- function hydrateDisabledTeleport(node, vnode, targetStart, targetAnchor) {
3303
+ function hydrateAnchor(target, targetNode) {
3304
+ let targetAnchor = targetNode;
3305
+ while (targetAnchor) {
3306
+ if (targetAnchor && targetAnchor.nodeType === 8) {
3307
+ if (targetAnchor.data === "teleport start anchor") vnode.targetStart = targetAnchor;
3308
+ else if (targetAnchor.data === "teleport anchor") {
3309
+ vnode.targetAnchor = targetAnchor;
3310
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
3311
+ break;
3312
+ }
3313
+ }
3314
+ targetAnchor = nextSibling(targetAnchor);
3315
+ }
3316
+ }
3317
+ function hydrateDisabledTeleport(node, vnode) {
3304
3318
  vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
3305
- vnode.targetStart = targetStart;
3306
- vnode.targetAnchor = targetAnchor;
3307
3319
  }
3308
3320
  const target = vnode.target = resolveTarget(vnode.props, querySelector);
3309
3321
  const disabled = isTeleportDisabled(vnode.props);
3310
3322
  if (target) {
3311
3323
  const targetNode = target._lpa || target.firstChild;
3312
- if (vnode.shapeFlag & 16) if (disabled) hydrateDisabledTeleport(node, vnode, targetNode, targetNode && nextSibling(targetNode));
3313
- else {
3324
+ if (vnode.shapeFlag & 16) if (disabled) {
3325
+ hydrateDisabledTeleport(node, vnode);
3326
+ hydrateAnchor(target, targetNode);
3327
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3328
+ } else {
3314
3329
  vnode.anchor = nextSibling(node);
3315
- let targetAnchor = targetNode;
3316
- while (targetAnchor) {
3317
- if (targetAnchor && targetAnchor.nodeType === 8) {
3318
- if (targetAnchor.data === "teleport start anchor") vnode.targetStart = targetAnchor;
3319
- else if (targetAnchor.data === "teleport anchor") {
3320
- vnode.targetAnchor = targetAnchor;
3321
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
3322
- break;
3323
- }
3324
- }
3325
- targetAnchor = nextSibling(targetAnchor);
3326
- }
3330
+ hydrateAnchor(target, targetNode);
3327
3331
  if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3328
3332
  hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3329
3333
  }
3330
3334
  updateCssVars(vnode, disabled);
3331
3335
  } else if (disabled) {
3332
- if (vnode.shapeFlag & 16) hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3336
+ if (vnode.shapeFlag & 16) {
3337
+ hydrateDisabledTeleport(node, vnode);
3338
+ vnode.targetStart = node;
3339
+ vnode.targetAnchor = nextSibling(node);
3340
+ }
3333
3341
  }
3334
3342
  return vnode.anchor && nextSibling(vnode.anchor);
3335
3343
  }
@@ -3352,13 +3360,13 @@ function updateCssVars(vnode, isDisabled) {
3352
3360
  ctx.ut();
3353
3361
  }
3354
3362
  }
3355
- function prepareAnchor(target, vnode, createText, insert) {
3363
+ function prepareAnchor(target, vnode, createText, insert, anchor = null) {
3356
3364
  const targetStart = vnode.targetStart = createText("");
3357
3365
  const targetAnchor = vnode.targetAnchor = createText("");
3358
3366
  targetStart[TeleportEndKey] = targetAnchor;
3359
3367
  if (target) {
3360
- insert(targetStart, target);
3361
- insert(targetAnchor, target);
3368
+ insert(targetStart, target, anchor);
3369
+ insert(targetAnchor, target, anchor);
3362
3370
  }
3363
3371
  return targetAnchor;
3364
3372
  }
@@ -3485,6 +3493,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3485
3493
  const key = String(vnode.key);
3486
3494
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3487
3495
  return baseResolveTransitionHooks({
3496
+ isLeaving: () => leavingVNodesCache[key] === vnode,
3488
3497
  setLeavingNodeCache: () => {
3489
3498
  leavingVNodesCache[key] = vnode;
3490
3499
  },
@@ -3503,7 +3512,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3503
3512
  }, props, state, instance);
3504
3513
  }
3505
3514
  function baseResolveTransitionHooks(context, props, state, instance) {
3506
- const { setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
3515
+ const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
3507
3516
  const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;
3508
3517
  const callHook = (hook, args) => {
3509
3518
  hook && callWithAsyncErrorHandling(hook, instance, 9, args);
@@ -3527,6 +3536,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3527
3536
  callHook(hook, [el]);
3528
3537
  },
3529
3538
  enter(el) {
3539
+ if (isLeaving()) return;
3530
3540
  let hook = onEnter;
3531
3541
  let afterHook = onAfterEnter;
3532
3542
  let cancelHook = onEnterCancelled;
@@ -3536,7 +3546,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3536
3546
  cancelHook = onAppearCancelled || onEnterCancelled;
3537
3547
  } else return;
3538
3548
  let called = false;
3539
- const done = el[enterCbKey$1] = (cancelled) => {
3549
+ el[enterCbKey$1] = (cancelled) => {
3540
3550
  if (called) return;
3541
3551
  called = true;
3542
3552
  if (cancelled) callHook(cancelHook, [el]);
@@ -3544,6 +3554,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3544
3554
  if (hooks.delayedLeave) hooks.delayedLeave();
3545
3555
  el[enterCbKey$1] = void 0;
3546
3556
  };
3557
+ const done = el[enterCbKey$1].bind(null, false);
3547
3558
  if (hook) callAsyncHook(hook, [el, done]);
3548
3559
  else done();
3549
3560
  },
@@ -3552,7 +3563,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3552
3563
  if (state.isUnmounting) return remove();
3553
3564
  callHook(onBeforeLeave, [el]);
3554
3565
  let called = false;
3555
- const done = el[leaveCbKey] = (cancelled) => {
3566
+ el[leaveCbKey] = (cancelled) => {
3556
3567
  if (called) return;
3557
3568
  called = true;
3558
3569
  remove();
@@ -3562,6 +3573,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3562
3573
  unsetLeavingNodeCache(el);
3563
3574
  };
3564
3575
  setLeavingNodeCache(el);
3576
+ const done = el[leaveCbKey].bind(null, false);
3565
3577
  if (onLeave) callAsyncHook(onLeave, [el, done]);
3566
3578
  else done();
3567
3579
  },
@@ -3659,8 +3671,7 @@ function useTemplateRef(key) {
3659
3671
  const r = /* @__PURE__ */ shallowRef(null);
3660
3672
  if (i) {
3661
3673
  const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3662
- let desc;
3663
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) warn$1(`useTemplateRef('${key}') already exists.`);
3674
+ if (isTemplateRefKey(refs, key)) warn$1(`useTemplateRef('${key}') already exists.`);
3664
3675
  else Object.defineProperty(refs, key, {
3665
3676
  enumerable: true,
3666
3677
  get: () => r.value,
@@ -3671,6 +3682,10 @@ function useTemplateRef(key) {
3671
3682
  knownTemplateRefs.add(ret);
3672
3683
  return ret;
3673
3684
  }
3685
+ function isTemplateRefKey(refs, key) {
3686
+ let desc;
3687
+ return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
3688
+ }
3674
3689
 
3675
3690
  //#endregion
3676
3691
  //#region packages/runtime-core/src/rendererTemplateRef.ts
@@ -3697,9 +3712,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3697
3712
  const oldRef = oldRawRef && oldRawRef.r;
3698
3713
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3699
3714
  const setupState = owner.setupState;
3700
- const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3701
- const canSetRef = (ref) => {
3702
- return !knownTemplateRefs.has(ref);
3715
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState, refs);
3716
+ const canSetRef = (ref, key) => {
3717
+ if (knownTemplateRefs.has(ref)) return false;
3718
+ if (key && isTemplateRefKey(refs, key)) return false;
3719
+ return true;
3703
3720
  };
3704
3721
  if (oldRef != null && oldRef !== ref) {
3705
3722
  invalidatePendingSetRef(oldRawRef);
@@ -3707,8 +3724,8 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3707
3724
  refs[oldRef] = null;
3708
3725
  if (canSetSetupRef(oldRef)) setupState[oldRef] = null;
3709
3726
  } else if (/* @__PURE__ */ isRef(oldRef)) {
3710
- if (canSetRef(oldRef)) oldRef.value = null;
3711
3727
  const oldRawRefAtom = oldRawRef;
3728
+ if (canSetRef(oldRef, oldRawRefAtom.k)) oldRef.value = null;
3712
3729
  if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3713
3730
  }
3714
3731
  }
@@ -3726,7 +3743,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3726
3743
  if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
3727
3744
  } else {
3728
3745
  const newVal = [refValue];
3729
- if (canSetRef(ref)) ref.value = newVal;
3746
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
3730
3747
  if (rawRef.k) refs[rawRef.k] = newVal;
3731
3748
  }
3732
3749
  else if (!existing.includes(refValue)) existing.push(refValue);
@@ -3734,7 +3751,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3734
3751
  refs[ref] = value;
3735
3752
  if (canSetSetupRef(ref)) setupState[ref] = value;
3736
3753
  } else if (_isRef) {
3737
- if (canSetRef(ref)) ref.value = value;
3754
+ if (canSetRef(ref, rawRef.k)) ref.value = value;
3738
3755
  if (rawRef.k) refs[rawRef.k] = value;
3739
3756
  } else warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3740
3757
  };
@@ -3752,11 +3769,12 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3752
3769
  } else warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3753
3770
  }
3754
3771
  }
3755
- function createCanSetSetupRefChecker(setupState) {
3772
+ function createCanSetSetupRefChecker(setupState, refs) {
3756
3773
  const rawSetupState = /* @__PURE__ */ toRaw(setupState);
3757
3774
  return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
3758
3775
  if (hasOwn(rawSetupState, key) && !/* @__PURE__ */ isRef(rawSetupState[key])) warn$1(`Template ref "${key}" used on a non-ref value. It will not work in the production build.`);
3759
3776
  if (knownTemplateRefs.has(rawSetupState[key])) return false;
3777
+ if (isTemplateRefKey(refs, key)) return false;
3760
3778
  return hasOwn(rawSetupState, key);
3761
3779
  };
3762
3780
  }
@@ -4620,7 +4638,6 @@ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspen
4620
4638
  instance.isDeactivated = true;
4621
4639
  }, void 0, parentSuspense);
4622
4640
  devtoolsComponentAdded(instance);
4623
- instance.__keepAliveStorageContainer = container;
4624
4641
  }
4625
4642
 
4626
4643
  //#endregion
@@ -5164,11 +5181,16 @@ function withAsyncContext(getAwaitable) {
5164
5181
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5165
5182
  let awaitable = getAwaitable();
5166
5183
  setCurrentInstance(null, void 0);
5184
+ const cleanup = () => setCurrentInstance(null, void 0);
5167
5185
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5168
5186
  setCurrentInstance(ctx);
5187
+ Promise.resolve().then(() => Promise.resolve().then(cleanup));
5169
5188
  throw e;
5170
5189
  });
5171
- return [awaitable, () => setCurrentInstance(ctx)];
5190
+ return [awaitable, () => {
5191
+ setCurrentInstance(ctx);
5192
+ Promise.resolve().then(cleanup);
5193
+ }];
5172
5194
  }
5173
5195
 
5174
5196
  //#endregion
@@ -5863,7 +5885,7 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
5863
5885
  const dynamicProps = nextVNode.dynamicProps;
5864
5886
  for (let i = 0; i < dynamicProps.length; i++) {
5865
5887
  const key = dynamicProps[i];
5866
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) return true;
5888
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) return true;
5867
5889
  }
5868
5890
  }
5869
5891
  } else {
@@ -5882,10 +5904,16 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
5882
5904
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
5883
5905
  for (let i = 0; i < nextKeys.length; i++) {
5884
5906
  const key = nextKeys[i];
5885
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) return true;
5907
+ if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
5886
5908
  }
5887
5909
  return false;
5888
5910
  }
5911
+ function hasPropValueChanged(nextProps, prevProps, key) {
5912
+ const nextProp = nextProps[key];
5913
+ const prevProp = prevProps[key];
5914
+ if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
5915
+ return nextProp !== prevProp;
5916
+ }
5889
5917
  function updateHOCHostEl({ vnode, parent }, el) {
5890
5918
  while (parent && !parent.vapor) {
5891
5919
  const root = parent.subTree;
@@ -6377,7 +6405,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6377
6405
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6378
6406
  break;
6379
6407
  case VaporSlot:
6380
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent);
6408
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
6381
6409
  break;
6382
6410
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6383
6411
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -6392,13 +6420,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6392
6420
  if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
6393
6421
  else {
6394
6422
  const el = n2.el = n1.el;
6395
- if (n2.children !== n1.children) if (isHmrUpdating && n2.patchFlag === -1 && "__elIndex" in n1) {
6396
- const childNodes = container.childNodes;
6397
- const newChild = hostCreateText(n2.children);
6398
- const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
6399
- hostInsert(newChild, container, oldChild);
6400
- hostRemove(oldChild);
6401
- } else hostSetText(el, n2.children);
6423
+ if (n2.children !== n1.children) hostSetText(el, n2.children);
6402
6424
  }
6403
6425
  };
6404
6426
  const processCommentNode = (n1, n2, container, anchor) => {
@@ -6734,7 +6756,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6734
6756
  updateComponentPreRender(instance, next, optimized);
6735
6757
  }
6736
6758
  nonHydratedAsyncRoot.asyncDep.then(() => {
6737
- if (!instance.isUnmounted) this.fn();
6759
+ queuePostRenderEffect(() => {
6760
+ if (!instance.isUnmounted) instance.update();
6761
+ }, void 0, parentSuspense);
6738
6762
  });
6739
6763
  return;
6740
6764
  }
@@ -7143,8 +7167,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
7143
7167
  }
7144
7168
  if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
7145
7169
  }
7146
- if (c2.type === Text) if (c2.patchFlag !== -1) c2.el = c1.el;
7147
- else c2.__elIndex = i + (n1.type === Fragment ? 1 : 0);
7170
+ if (c2.type === Text) {
7171
+ if (c2.patchFlag === -1) c2 = ch2[i] = cloneIfMounted(c2);
7172
+ c2.el = c1.el;
7173
+ }
7148
7174
  if (c2.type === Comment && !c2.el) c2.el = c1.el;
7149
7175
  c2.el && (c2.el.__vnode = c2);
7150
7176
  }
@@ -8385,7 +8411,7 @@ function isMemoSame(cached, memo) {
8385
8411
 
8386
8412
  //#endregion
8387
8413
  //#region packages/runtime-core/src/index.ts
8388
- const version = "3.6.0-beta.5";
8414
+ const version = "3.6.0-beta.7";
8389
8415
  const warn = warn$1;
8390
8416
  /**
8391
8417
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9503,10 +9529,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
9503
9529
  if (child.el && child.el instanceof Element) {
9504
9530
  prevChildren.push(child);
9505
9531
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9506
- positionMap.set(child, {
9507
- left: child.el.offsetLeft,
9508
- top: child.el.offsetTop
9509
- });
9532
+ positionMap.set(child, getPosition(child.el));
9510
9533
  }
9511
9534
  }
9512
9535
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
@@ -9525,10 +9548,7 @@ function callPendingCbs(el) {
9525
9548
  if (el[enterCbKey]) el[enterCbKey]();
9526
9549
  }
9527
9550
  function recordPosition(c) {
9528
- newPositionMap.set(c, {
9529
- left: c.el.offsetLeft,
9530
- top: c.el.offsetTop
9531
- });
9551
+ newPositionMap.set(c, getPosition(c.el));
9532
9552
  }
9533
9553
  function applyTranslation(c) {
9534
9554
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -9538,12 +9558,28 @@ function baseApplyTranslation(oldPos, newPos, el) {
9538
9558
  const dy = oldPos.top - newPos.top;
9539
9559
  if (dx || dy) {
9540
9560
  const s = el.style;
9541
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
9561
+ const rect = el.getBoundingClientRect();
9562
+ let scaleX = 1;
9563
+ let scaleY = 1;
9564
+ if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
9565
+ if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
9566
+ if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
9567
+ if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
9568
+ if (Math.abs(scaleX - 1) < .01) scaleX = 1;
9569
+ if (Math.abs(scaleY - 1) < .01) scaleY = 1;
9570
+ s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
9542
9571
  s.transitionDuration = "0s";
9543
9572
  return true;
9544
9573
  }
9545
9574
  return false;
9546
9575
  }
9576
+ function getPosition(el) {
9577
+ const rect = el.getBoundingClientRect();
9578
+ return {
9579
+ left: rect.left,
9580
+ top: rect.top
9581
+ };
9582
+ }
9547
9583
  function hasCSSTransform(el, root, moveClass) {
9548
9584
  const clone = el.cloneNode();
9549
9585
  const _vtc = el[vtcKey];
@@ -9830,6 +9866,7 @@ const modifierGuards = {
9830
9866
  * @private
9831
9867
  */
9832
9868
  const withModifiers = (fn, modifiers) => {
9869
+ if (!fn) return fn;
9833
9870
  const cache = fn._withMods || (fn._withMods = {});
9834
9871
  const cacheKey = modifiers.join(".");
9835
9872
  return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {