@vue/runtime-dom 3.6.0-rc.10 → 3.6.0-rc.12

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.6.0-rc.10
2
+ * @vue/runtime-dom v3.6.0-rc.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -221,9 +221,10 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
221
221
  * - ismap -> isMap
222
222
  * - nomodule -> noModule
223
223
  * - novalidate -> noValidate
224
+ * - playsinline -> playsInline
224
225
  * - readonly -> readOnly
225
226
  */
226
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
227
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
227
228
  const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
228
229
  /**
229
230
  * The full list is needed during SSR to produce the correct initial markup.
@@ -914,17 +915,33 @@ const arrayInstrumentations = {
914
915
  };
915
916
  function iterator(self, method, wrapValue) {
916
917
  const arr = shallowReadArray(self);
917
- const iter = arr[method]();
918
+ const methodFn = arr[method];
919
+ const iter = methodFn.call(arr);
918
920
  if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
921
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
922
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
923
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
924
+ if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
925
+ return: { get() {
926
+ const fn = iter.return;
927
+ return typeof fn === "function" ? fn.bind(iter) : fn;
928
+ } },
929
+ throw: { get() {
930
+ const fn = iter.throw;
931
+ return typeof fn === "function" ? fn.bind(iter) : fn;
932
+ } }
933
+ });
934
+ return wrapped;
935
+ }
919
936
  iter._next = iter.next;
920
- iter.next = () => {
921
- const result = iter._next();
922
- if (!result.done) result.value = wrapValue(result.value);
923
- return result;
924
- };
937
+ iter.next = () => wrapResult(iter._next(), wrapValue);
925
938
  }
926
939
  return iter;
927
940
  }
941
+ function wrapResult(result, wrapValue) {
942
+ if (!result.done) result.value = wrapValue(result.value);
943
+ return result;
944
+ }
928
945
  const arrayProto = Array.prototype;
929
946
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
930
947
  const arr = shallowReadArray(self);
@@ -1242,6 +1259,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
1242
1259
  return (target, key, receiver) => {
1243
1260
  if (key === "__v_isReactive") return !isReadonly;
1244
1261
  else if (key === "__v_isReadonly") return isReadonly;
1262
+ else if (key === "__v_isShallow") return shallow;
1245
1263
  else if (key === "__v_raw") return target;
1246
1264
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1247
1265
  };
@@ -2151,8 +2169,9 @@ function getCurrentWatcher() {
2151
2169
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
2152
2170
  if (owner) {
2153
2171
  const { call } = owner.options;
2154
- if (call) owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
2155
- else owner.cleanups[owner.cleanupsLength++] = cleanupFn;
2172
+ const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
2173
+ if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
2174
+ else owner.cleanups[owner.cleanupsLength++] = cleanup;
2156
2175
  } else if (!failSilently) warn$2("onWatcherCleanup() was called when there was no active watcher to associate with.");
2157
2176
  }
2158
2177
  var WatcherEffect = class extends ReactiveEffect {
@@ -2213,9 +2232,11 @@ var WatcherEffect = class extends ReactiveEffect {
2213
2232
  if (once && cb) {
2214
2233
  const _cb = cb;
2215
2234
  cb = (...args) => {
2216
- const res = _cb(...args);
2217
- this.stop();
2218
- return res;
2235
+ try {
2236
+ return _cb(...args);
2237
+ } finally {
2238
+ this.stop();
2239
+ }
2219
2240
  };
2220
2241
  }
2221
2242
  this.cb = cb;
@@ -2223,6 +2244,19 @@ var WatcherEffect = class extends ReactiveEffect {
2223
2244
  this.onTrack = options.onTrack;
2224
2245
  this.onTrigger = options.onTrigger;
2225
2246
  }
2247
+ cleanupCallback() {
2248
+ const cleanups = this.cbCleanups;
2249
+ if (cleanups) {
2250
+ this.cbCleanups = void 0;
2251
+ for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
2252
+ }
2253
+ }
2254
+ stop() {
2255
+ if (this.active) {
2256
+ super.stop();
2257
+ this.cleanupCallback();
2258
+ }
2259
+ }
2226
2260
  run(initialRun = false) {
2227
2261
  const oldValue = this.oldValue;
2228
2262
  const newValue = this.oldValue = super.run();
@@ -2230,10 +2264,11 @@ var WatcherEffect = class extends ReactiveEffect {
2230
2264
  const { immediate, deep, call } = this.options;
2231
2265
  if (initialRun && !immediate) return;
2232
2266
  if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2233
- cleanup(this);
2234
2267
  const currentWatcher = activeWatcher;
2235
- activeWatcher = this;
2268
+ const prevSub = setActiveSub();
2236
2269
  try {
2270
+ this.cleanupCallback();
2271
+ activeWatcher = this;
2237
2272
  const args = [
2238
2273
  newValue,
2239
2274
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -2242,6 +2277,7 @@ var WatcherEffect = class extends ReactiveEffect {
2242
2277
  call ? call(this.cb, 3, args) : this.cb(...args);
2243
2278
  } finally {
2244
2279
  activeWatcher = currentWatcher;
2280
+ setActiveSub(prevSub);
2245
2281
  }
2246
2282
  }
2247
2283
  }
@@ -2572,15 +2608,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
2572
2608
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2573
2609
  queueFlush();
2574
2610
  }
2575
- function flushPreFlushCbs(instance, seen) {
2611
+ function flushPreFlushCbs(instance, minUid, seen) {
2576
2612
  seen = seen || /* @__PURE__ */ new Map();
2577
2613
  for (let i = flushIndex; i < jobsLength; i++) {
2578
2614
  const cb = jobs[i];
2579
2615
  if (cb.order & 1 || cb.order === Infinity) continue;
2580
- if (instance && cb.order !== instance.uid * 2) continue;
2616
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
2581
2617
  if (checkRecursiveUpdates(seen, cb)) continue;
2582
2618
  jobs.splice(i, 1);
2583
- i--;
2619
+ i = instance ? i - 1 : flushIndex - 1;
2584
2620
  jobsLength--;
2585
2621
  if (cb.flags & 2) cb.flags &= -2;
2586
2622
  try {
@@ -2590,15 +2626,24 @@ function flushPreFlushCbs(instance, seen) {
2590
2626
  }
2591
2627
  }
2592
2628
  }
2593
- function flushPostFlushCbs(seen) {
2629
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2594
2630
  if (postJobs.length) {
2631
+ let cbs = postJobs;
2632
+ if (skip) {
2633
+ cbs = [];
2634
+ let kept = 0;
2635
+ for (let i = 0; i < postJobs.length; i++) {
2636
+ const cb = postJobs[i];
2637
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
2638
+ else cbs.push(cb);
2639
+ }
2640
+ postJobs.length = kept;
2641
+ } else postJobs = [];
2595
2642
  if (activePostJobs) {
2596
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2597
- postJobs.length = 0;
2643
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
2598
2644
  return;
2599
2645
  }
2600
- activePostJobs = postJobs;
2601
- postJobs = [];
2646
+ activePostJobs = cbs;
2602
2647
  seen = seen || /* @__PURE__ */ new Map();
2603
2648
  try {
2604
2649
  while (postFlushIndex < activePostJobs.length) {
@@ -2620,17 +2665,28 @@ function flushPostFlushCbs(seen) {
2620
2665
  }
2621
2666
  let isFlushing = false;
2622
2667
  /**
2668
+ * Run a root render, then flush the jobs it is responsible for. A mount or
2669
+ * unmount (`minUid` given) only flushes the jobs of the components it created
2670
+ * and the post cbs it queued, so pre watchers triggered in setup run before
2671
+ * mounted (#5721) while the jobs of other components stay in the queue and
2672
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
2673
+ * and post cbs, as the jobs of the components it re-renders may predate it.
2674
+ *
2623
2675
  * @internal
2624
2676
  */
2625
- function flushOnAppMount(instance) {
2626
- if (!isFlushing) {
2627
- isFlushing = true;
2628
- try {
2629
- flushPreFlushCbs(instance);
2630
- flushPostFlushCbs();
2631
- } finally {
2632
- isFlushing = false;
2633
- }
2677
+ function flushOnAppMount(fn, minUid) {
2678
+ if (isFlushing) {
2679
+ fn();
2680
+ return;
2681
+ }
2682
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
2683
+ fn();
2684
+ isFlushing = true;
2685
+ try {
2686
+ flushPreFlushCbs(void 0, minUid);
2687
+ flushPostFlushCbs(void 0, queued, minUid);
2688
+ } finally {
2689
+ isFlushing = false;
2634
2690
  }
2635
2691
  }
2636
2692
  function flushJobs(seen) {
@@ -3098,7 +3154,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
3098
3154
  this.flags |= 128;
3099
3155
  job.flags |= 2;
3100
3156
  }
3101
- if (instance) job.i = instance;
3157
+ job.i = instance;
3102
3158
  this.job = job;
3103
3159
  }
3104
3160
  notify() {
@@ -3291,7 +3347,11 @@ const TeleportImpl = {
3291
3347
  hydrate: hydrateTeleport
3292
3348
  };
3293
3349
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
3294
- if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
3350
+ if (moveType === 0) {
3351
+ if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
3352
+ insert(vnode.targetAnchor, container, parentAnchor);
3353
+ parentAnchor = vnode.targetAnchor;
3354
+ }
3295
3355
  const { el, anchor, shapeFlag, children, props } = vnode;
3296
3356
  const isReorder = moveType === 2;
3297
3357
  if (isReorder) insert(el, container, parentAnchor);
@@ -3410,10 +3470,15 @@ const BaseTransitionPropsValidators = {
3410
3470
  onAfterAppear: TransitionHookValidator,
3411
3471
  onAppearCancelled: TransitionHookValidator
3412
3472
  };
3413
- const recursiveGetSubtree = (instance) => {
3414
- const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
3415
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3416
- };
3473
+ function isEmptyTransitionChild(vnode, instance) {
3474
+ if (vnode.type === Comment) return true;
3475
+ if (vnode.type === Fragment) {
3476
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3477
+ return !child || isEmptyTransitionChild(child, instance);
3478
+ }
3479
+ if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3480
+ return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3481
+ }
3417
3482
  const BaseTransitionImpl = {
3418
3483
  name: `BaseTransition`,
3419
3484
  props: BaseTransitionPropsValidators,
@@ -3461,7 +3526,7 @@ function getLeavingNodesForType(state, vnode) {
3461
3526
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3462
3527
  const key = String(vnode.key);
3463
3528
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3464
- return baseResolveTransitionHooks({
3529
+ const hooks = baseResolveTransitionHooks({
3465
3530
  isLeaving: () => leavingVNodesCache[key] === vnode,
3466
3531
  setLeavingNodeCache: () => {
3467
3532
  leavingVNodesCache[key] = vnode;
@@ -3471,7 +3536,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3471
3536
  },
3472
3537
  earlyRemove: () => {
3473
3538
  const leavingVNode = leavingVNodesCache[key];
3474
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) leavingVNode.el[leaveCbKey]();
3539
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3540
+ let leavingCb = leavingVNode.el[leaveCbKey];
3541
+ if (!leavingCb) {
3542
+ const leavingRoot = getTransitionRoot(leavingVNode);
3543
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3544
+ }
3545
+ if (leavingCb) leavingCb();
3546
+ }
3475
3547
  },
3476
3548
  cloneHooks: (vnode) => {
3477
3549
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -3479,6 +3551,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3479
3551
  return hooks;
3480
3552
  }
3481
3553
  }, props, state, instance);
3554
+ if (vnode.type === VaporSlot) extend(hooks, {
3555
+ __vapor: true,
3556
+ props,
3557
+ state,
3558
+ instance
3559
+ });
3560
+ return hooks;
3482
3561
  }
3483
3562
  function baseResolveTransitionHooks(context, props, state, instance) {
3484
3563
  const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
@@ -3594,7 +3673,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
3594
3673
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3595
3674
  const mode = props.mode;
3596
3675
  const previousInner = previous && getInnerChild$1(previous);
3597
- if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3676
+ if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
3598
3677
  const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3599
3678
  if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
3600
3679
  }
@@ -3658,7 +3737,13 @@ function setTransitionHooks(vnode, hooks) {
3658
3737
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3659
3738
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3660
3739
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3661
- } else vnode.transition = hooks;
3740
+ } else {
3741
+ vnode.transition = hooks;
3742
+ if (vnode.type === Fragment && isArray(vnode.children)) {
3743
+ const child = filterSingleRoot(vnode.children, false);
3744
+ if (child) setTransitionHooks(child, hooks);
3745
+ }
3746
+ }
3662
3747
  return hooks;
3663
3748
  }
3664
3749
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -3681,6 +3766,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3681
3766
  function checkTransitionMode(mode) {
3682
3767
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
3683
3768
  }
3769
+ function getTransitionRoot(vnode) {
3770
+ if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
3771
+ if (vnode.type === Fragment) {
3772
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3773
+ return child ? getTransitionRoot(child) : void 0;
3774
+ }
3775
+ if (vnode.type !== Comment) return vnode;
3776
+ }
3684
3777
  //#endregion
3685
3778
  //#region packages/runtime-core/src/apiDefineComponent.ts
3686
3779
  /*@__NO_SIDE_EFFECTS__*/
@@ -4310,14 +4403,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
4310
4403
  break;
4311
4404
  }
4312
4405
  }, opts);
4313
- forEach((el) => {
4314
- if (!(el instanceof Element)) return;
4406
+ const observe = (el) => {
4315
4407
  if (elementIsVisibleInViewport(el)) {
4316
4408
  hydrate();
4317
4409
  ob.disconnect();
4318
4410
  return false;
4319
4411
  }
4412
+ if (getComputedStyle(el).display === "contents") {
4413
+ for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
4414
+ }
4320
4415
  ob.observe(el);
4416
+ };
4417
+ forEach((el) => {
4418
+ if (!(el instanceof Element)) return;
4419
+ return observe(el);
4321
4420
  });
4322
4421
  return () => ob.disconnect();
4323
4422
  };
@@ -4575,7 +4674,10 @@ const KeepAlive = {
4575
4674
  function pruneCacheEntry(key) {
4576
4675
  const cached = cache.get(key);
4577
4676
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
4578
- else if (current) resetShapeFlag(current);
4677
+ else if (current) {
4678
+ resetShapeFlag(current);
4679
+ if (cached) resetShapeFlag(cached);
4680
+ }
4579
4681
  cache.delete(key);
4580
4682
  keys.delete(key);
4581
4683
  }
@@ -4902,6 +5004,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4902
5004
  owner: currentRenderingInstance
4903
5005
  }] : void 0
4904
5006
  };
5007
+ if (branchKey != null && props.key == null) {
5008
+ ret.vs.props = ret.props;
5009
+ ret.props = extend({}, ret.props, { key: branchKey });
5010
+ ret.key = branchKey;
5011
+ }
4905
5012
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4906
5013
  return ret;
4907
5014
  }
@@ -6093,7 +6200,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6093
6200
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
6094
6201
  for (let i = 0; i < nextKeys.length; i++) {
6095
6202
  const key = nextKeys[i];
6096
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6203
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6097
6204
  }
6098
6205
  return false;
6099
6206
  }
@@ -6784,7 +6891,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6784
6891
  for (let i = 0; i < newChildren.length; i++) {
6785
6892
  const oldVNode = oldChildren[i];
6786
6893
  const newVNode = newChildren[i];
6787
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
6894
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
6895
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
6788
6896
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6789
6897
  }
6790
6898
  };
@@ -6876,6 +6984,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6876
6984
  if (instance.asyncDep && !instance.asyncResolved) {
6877
6985
  pushWarningContext(n2);
6878
6986
  n2.el = n1.el;
6987
+ n2.placeholder = n1.placeholder;
6879
6988
  updateComponentPreRender(instance, n2, optimized);
6880
6989
  popWarningContext();
6881
6990
  return;
@@ -6885,6 +6994,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6885
6994
  }
6886
6995
  } else {
6887
6996
  n2.el = n1.el;
6997
+ n2.placeholder = n1.placeholder;
6888
6998
  instance.vnode = n2;
6889
6999
  }
6890
7000
  };
@@ -7229,12 +7339,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7229
7339
  };
7230
7340
  const remove = (vnode) => {
7231
7341
  const { type, el, anchor, transition } = vnode;
7232
- if (type === Fragment) {
7233
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
7234
- if (child.type === Comment) hostRemove(child.el);
7235
- else remove(child);
7236
- });
7237
- else removeFragment(el, anchor);
7342
+ const isFragment = type === Fragment;
7343
+ if (isFragment && !transition) {
7344
+ removeFragment(el, anchor);
7238
7345
  return;
7239
7346
  }
7240
7347
  if (type === Static) {
@@ -7242,8 +7349,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7242
7349
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7243
7350
  return;
7244
7351
  }
7245
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
7246
- else hostRemove(el);
7352
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
7353
+ const performRemove = () => {
7354
+ if (isFragment) {
7355
+ if (hostParentNode(el)) removeFragment(el, anchor);
7356
+ } else hostRemove(el);
7357
+ };
7358
+ if (transition) {
7359
+ let leavingEl = leavingNode && leavingNode.el;
7360
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
7361
+ if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
7362
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
7363
+ isElement = !!leavingEl;
7364
+ }
7365
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
7366
+ } else performRemove();
7247
7367
  };
7248
7368
  const removeFragment = (cur, end) => {
7249
7369
  let next;
@@ -7286,15 +7406,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7286
7406
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7287
7407
  };
7288
7408
  const render = (vnode, container, namespace) => {
7289
- let instance;
7290
- if (vnode == null) {
7291
- if (container._vnode) {
7292
- unmount(container._vnode, null, null, true);
7293
- instance = container._vnode.component;
7294
- }
7295
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7296
- container._vnode = vnode;
7297
- flushOnAppMount(instance);
7409
+ flushOnAppMount(() => {
7410
+ if (vnode == null) {
7411
+ if (container._vnode) unmount(container._vnode, null, null, true);
7412
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7413
+ container._vnode = vnode;
7414
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
7298
7415
  };
7299
7416
  const internals = {
7300
7417
  p: patch,
@@ -7687,13 +7804,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7687
7804
  registerDep(instance, onResolve) {
7688
7805
  const isInPendingSuspense = !!suspense.pendingBranch;
7689
7806
  if (isInPendingSuspense) suspense.deps++;
7690
- const hydratedEl = instance.vnode && instance.vnode.el;
7691
7807
  instance.asyncDep.catch((err) => {
7692
7808
  handleError(err, instance, 0);
7693
7809
  }).then((asyncSetupResult) => {
7694
7810
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7695
7811
  setCurrentInstance(null, void 0);
7696
- if (hydratedEl && !instance.scope.active) {
7812
+ if (!instance.scope.active) {
7697
7813
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7698
7814
  return;
7699
7815
  }
@@ -8006,7 +8122,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8006
8122
  ctx: vnode.ctx,
8007
8123
  ce: vnode.ce,
8008
8124
  vi: vnode.vi,
8009
- vs: cloneVaporSlotMeta(vnode),
8125
+ vs: cloneVaporSlotMeta(vnode, extraProps),
8010
8126
  vb: vnode.vb,
8011
8127
  ibu: vnode.ibu,
8012
8128
  iu: vnode.iu,
@@ -8015,13 +8131,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8015
8131
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
8016
8132
  return cloned;
8017
8133
  }
8018
- function cloneVaporSlotMeta(vnode) {
8134
+ function cloneVaporSlotMeta(vnode, extraProps) {
8019
8135
  const vaporSlot = vnode.vs;
8020
8136
  if (!vaporSlot) return vaporSlot;
8021
8137
  const cloned = {
8022
8138
  slot: vaporSlot.slot,
8023
- outlets: vaporSlot.outlets
8139
+ outlets: vaporSlot.outlets,
8140
+ props: vaporSlot.props
8024
8141
  };
8142
+ if (vaporSlot.props && extraProps) {
8143
+ let extraSlotProps;
8144
+ for (const key in extraProps) if (key !== "key") {
8145
+ if (!extraSlotProps) extraSlotProps = {};
8146
+ extraSlotProps[key] = extraProps[key];
8147
+ }
8148
+ if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
8149
+ }
8025
8150
  if (vnode.el) {
8026
8151
  cloned.state = vaporSlot.state;
8027
8152
  cloned.ref = vaporSlot.ref;
@@ -8204,6 +8329,9 @@ const useInstanceOption = (key, silent = false) => {
8204
8329
  //#region packages/runtime-core/src/component.ts
8205
8330
  const emptyAppContext = /*@__PURE__*/ createAppContext();
8206
8331
  let uid = 0;
8332
+ function getNextUid() {
8333
+ return uid;
8334
+ }
8207
8335
  function createComponentInstance(vnode, parent, suspense) {
8208
8336
  const type = vnode.type;
8209
8337
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8708,7 +8836,7 @@ function isMemoSame(cached, memo) {
8708
8836
  }
8709
8837
  //#endregion
8710
8838
  //#region packages/runtime-core/src/index.ts
8711
- const version = "3.6.0-rc.10";
8839
+ const version = "3.6.0-rc.12";
8712
8840
  const warn = warn$1;
8713
8841
  /**
8714
8842
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9191,7 +9319,7 @@ function patchStyle(el, prev, next) {
9191
9319
  else el.removeAttribute("style");
9192
9320
  }
9193
9321
  if (vShowOriginalDisplay in el) {
9194
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
9322
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
9195
9323
  if (el[vShowHidden]) style.display = "none";
9196
9324
  }
9197
9325
  }
@@ -9496,7 +9624,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9496
9624
  this._resolveProps(def);
9497
9625
  if (this.shadowRoot) this._applyStyles(styles);
9498
9626
  else if (styles) warn("Custom element style injection is not supported when using shadowRoot: false");
9499
- this._mountComponent(def);
9627
+ if (this._connected) this._mountComponent(def);
9500
9628
  };
9501
9629
  const asyncDef = this._def.__asyncLoader;
9502
9630
  if (asyncDef) {
@@ -9814,6 +9942,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
9814
9942
  const newPositionMap = /* @__PURE__ */ new WeakMap();
9815
9943
  const moveCbKey = Symbol("_moveCb");
9816
9944
  const enterCbKey = Symbol("_enterCb");
9945
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
9817
9946
  /**
9818
9947
  * Wrap logic that modifies TransitionGroup properties in a function
9819
9948
  * so that it can be annotated as pure
@@ -9833,15 +9962,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9833
9962
  const state = useTransitionState();
9834
9963
  let prevChildren;
9835
9964
  let children;
9965
+ let origins;
9966
+ let moves;
9967
+ const willMove = () => {
9968
+ if (moves === void 0) moves = prevChildren.length > 0 && hasCSSTransform(prevChildren[0].el, instance.vnode.el, resolveMoveClass(props));
9969
+ return moves;
9970
+ };
9836
9971
  onUpdated(() => {
9837
- if (!prevChildren.length) return;
9838
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
9839
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
9972
+ pendingGroups.delete(instance);
9973
+ if (!willMove()) {
9840
9974
  prevChildren = [];
9975
+ origins = void 0;
9841
9976
  return;
9842
9977
  }
9978
+ const moveClass = resolveMoveClass(props);
9843
9979
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
9844
- prevChildren.forEach(recordPosition);
9980
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
9981
+ origins = void 0;
9982
+ prevChildren.forEach((c) => recordPosition(c, shift));
9845
9983
  const movedChildren = prevChildren.filter(applyTranslation);
9846
9984
  forceReflow(instance.vnode.el);
9847
9985
  movedChildren.forEach((c) => {
@@ -9855,6 +9993,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9855
9993
  const cssTransitionProps = resolveTransitionProps(rawProps);
9856
9994
  let tag = rawProps.tag || Fragment;
9857
9995
  prevChildren = [];
9996
+ moves = void 0;
9858
9997
  if (children) for (let i = 0; i < children.length; i++) {
9859
9998
  const child = children[i];
9860
9999
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
@@ -9869,6 +10008,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9869
10008
  if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9870
10009
  else if (child.type !== Text) warn(`<TransitionGroup> children must be keyed.`);
9871
10010
  }
10011
+ if (prevChildren.length) {
10012
+ const root = instance.vnode.el;
10013
+ origins = getOrigins(instance, root);
10014
+ pendingGroups.set(instance, {
10015
+ root,
10016
+ willMove
10017
+ });
10018
+ }
9872
10019
  return createVNode(tag, null, children);
9873
10020
  };
9874
10021
  }
@@ -9877,8 +10024,11 @@ function callPendingCbs(el) {
9877
10024
  if (el[moveCbKey]) el[moveCbKey]();
9878
10025
  if (el[enterCbKey]) el[enterCbKey]();
9879
10026
  }
9880
- function recordPosition(c) {
9881
- newPositionMap.set(c, getPosition(c.el));
10027
+ function resolveMoveClass(props) {
10028
+ return props.moveClass || `${props.name || "v"}-move`;
10029
+ }
10030
+ function recordPosition(c, shift) {
10031
+ newPositionMap.set(c, getPosition(c.el, shift));
9882
10032
  }
9883
10033
  function applyTranslation(c) {
9884
10034
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -9903,13 +10053,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
9903
10053
  }
9904
10054
  return false;
9905
10055
  }
9906
- function getPosition(el) {
10056
+ function getPosition(el, shift) {
9907
10057
  const rect = el.getBoundingClientRect();
9908
10058
  return {
9909
- left: rect.left,
9910
- top: rect.top
10059
+ left: rect.left - (shift ? shift.left : 0),
10060
+ top: rect.top - (shift ? shift.top : 0)
9911
10061
  };
9912
10062
  }
10063
+ function getOrigins(instance, root) {
10064
+ let origins;
10065
+ for (let group = instance.parent; group; group = group.parent) {
10066
+ const pending = pendingGroups.get(group);
10067
+ if (pending) {
10068
+ const item = findItem(pending.root, root);
10069
+ if (item) (origins || (origins = [])).push(extend(getPosition(item), {
10070
+ item,
10071
+ willMove: pending.willMove
10072
+ }));
10073
+ }
10074
+ }
10075
+ return origins;
10076
+ }
10077
+ function findItem(root, node) {
10078
+ const container = root.nodeType === 1 ? root : root.parentNode;
10079
+ while (node && node.parentNode !== container) node = node.parentNode;
10080
+ if (node && node.nodeType === 1) return node;
10081
+ }
10082
+ function getOriginShift(origins, root) {
10083
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
10084
+ return origin && getPosition(origin.item, origin);
10085
+ }
9913
10086
  function hasCSSTransform(el, root, moveClass) {
9914
10087
  const clone = el.cloneNode();
9915
10088
  const _vtc = el[vtcKey];