@vue/compat 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/compat v3.6.0-rc.10
2
+ * @vue/compat v3.6.0-rc.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -311,9 +311,10 @@ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
311
311
  * - ismap -> isMap
312
312
  * - nomodule -> noModule
313
313
  * - novalidate -> noValidate
314
+ * - playsinline -> playsInline
314
315
  * - readonly -> readOnly
315
316
  */
316
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
317
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
317
318
  const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
318
319
  /**
319
320
  * The full list is needed during SSR to produce the correct initial markup.
@@ -1004,17 +1005,33 @@ const arrayInstrumentations = {
1004
1005
  };
1005
1006
  function iterator(self, method, wrapValue) {
1006
1007
  const arr = shallowReadArray(self);
1007
- const iter = arr[method]();
1008
+ const methodFn = arr[method];
1009
+ const iter = methodFn.call(arr);
1008
1010
  if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
1011
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
1012
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
1013
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
1014
+ if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
1015
+ return: { get() {
1016
+ const fn = iter.return;
1017
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1018
+ } },
1019
+ throw: { get() {
1020
+ const fn = iter.throw;
1021
+ return typeof fn === "function" ? fn.bind(iter) : fn;
1022
+ } }
1023
+ });
1024
+ return wrapped;
1025
+ }
1009
1026
  iter._next = iter.next;
1010
- iter.next = () => {
1011
- const result = iter._next();
1012
- if (!result.done) result.value = wrapValue(result.value);
1013
- return result;
1014
- };
1027
+ iter.next = () => wrapResult(iter._next(), wrapValue);
1015
1028
  }
1016
1029
  return iter;
1017
1030
  }
1031
+ function wrapResult(result, wrapValue) {
1032
+ if (!result.done) result.value = wrapValue(result.value);
1033
+ return result;
1034
+ }
1018
1035
  const arrayProto = Array.prototype;
1019
1036
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1020
1037
  const arr = shallowReadArray(self);
@@ -1332,6 +1349,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
1332
1349
  return (target, key, receiver) => {
1333
1350
  if (key === "__v_isReactive") return !isReadonly;
1334
1351
  else if (key === "__v_isReadonly") return isReadonly;
1352
+ else if (key === "__v_isShallow") return shallow;
1335
1353
  else if (key === "__v_raw") return target;
1336
1354
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1337
1355
  };
@@ -2241,8 +2259,9 @@ function getCurrentWatcher() {
2241
2259
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
2242
2260
  if (owner) {
2243
2261
  const { call } = owner.options;
2244
- if (call) owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
2245
- else owner.cleanups[owner.cleanupsLength++] = cleanupFn;
2262
+ const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
2263
+ if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
2264
+ else owner.cleanups[owner.cleanupsLength++] = cleanup;
2246
2265
  } else if (!failSilently) warn$2("onWatcherCleanup() was called when there was no active watcher to associate with.");
2247
2266
  }
2248
2267
  var WatcherEffect = class extends ReactiveEffect {
@@ -2303,9 +2322,11 @@ var WatcherEffect = class extends ReactiveEffect {
2303
2322
  if (once && cb) {
2304
2323
  const _cb = cb;
2305
2324
  cb = (...args) => {
2306
- const res = _cb(...args);
2307
- this.stop();
2308
- return res;
2325
+ try {
2326
+ return _cb(...args);
2327
+ } finally {
2328
+ this.stop();
2329
+ }
2309
2330
  };
2310
2331
  }
2311
2332
  this.cb = cb;
@@ -2313,6 +2334,19 @@ var WatcherEffect = class extends ReactiveEffect {
2313
2334
  this.onTrack = options.onTrack;
2314
2335
  this.onTrigger = options.onTrigger;
2315
2336
  }
2337
+ cleanupCallback() {
2338
+ const cleanups = this.cbCleanups;
2339
+ if (cleanups) {
2340
+ this.cbCleanups = void 0;
2341
+ for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
2342
+ }
2343
+ }
2344
+ stop() {
2345
+ if (this.active) {
2346
+ super.stop();
2347
+ this.cleanupCallback();
2348
+ }
2349
+ }
2316
2350
  run(initialRun = false) {
2317
2351
  const oldValue = this.oldValue;
2318
2352
  const newValue = this.oldValue = super.run();
@@ -2320,10 +2354,11 @@ var WatcherEffect = class extends ReactiveEffect {
2320
2354
  const { immediate, deep, call } = this.options;
2321
2355
  if (initialRun && !immediate) return;
2322
2356
  if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2323
- cleanup(this);
2324
2357
  const currentWatcher = activeWatcher;
2325
- activeWatcher = this;
2358
+ const prevSub = setActiveSub();
2326
2359
  try {
2360
+ this.cleanupCallback();
2361
+ activeWatcher = this;
2327
2362
  const args = [
2328
2363
  newValue,
2329
2364
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -2332,6 +2367,7 @@ var WatcherEffect = class extends ReactiveEffect {
2332
2367
  call ? call(this.cb, 3, args) : this.cb(...args);
2333
2368
  } finally {
2334
2369
  activeWatcher = currentWatcher;
2370
+ setActiveSub(prevSub);
2335
2371
  }
2336
2372
  }
2337
2373
  }
@@ -2662,15 +2698,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
2662
2698
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2663
2699
  queueFlush();
2664
2700
  }
2665
- function flushPreFlushCbs(instance, seen) {
2701
+ function flushPreFlushCbs(instance, minUid, seen) {
2666
2702
  seen = seen || /* @__PURE__ */ new Map();
2667
2703
  for (let i = flushIndex; i < jobsLength; i++) {
2668
2704
  const cb = jobs[i];
2669
2705
  if (cb.order & 1 || cb.order === Infinity) continue;
2670
- if (instance && cb.order !== instance.uid * 2) continue;
2706
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
2671
2707
  if (checkRecursiveUpdates(seen, cb)) continue;
2672
2708
  jobs.splice(i, 1);
2673
- i--;
2709
+ i = instance ? i - 1 : flushIndex - 1;
2674
2710
  jobsLength--;
2675
2711
  if (cb.flags & 2) cb.flags &= -2;
2676
2712
  try {
@@ -2680,15 +2716,24 @@ function flushPreFlushCbs(instance, seen) {
2680
2716
  }
2681
2717
  }
2682
2718
  }
2683
- function flushPostFlushCbs(seen) {
2719
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2684
2720
  if (postJobs.length) {
2721
+ let cbs = postJobs;
2722
+ if (skip) {
2723
+ cbs = [];
2724
+ let kept = 0;
2725
+ for (let i = 0; i < postJobs.length; i++) {
2726
+ const cb = postJobs[i];
2727
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
2728
+ else cbs.push(cb);
2729
+ }
2730
+ postJobs.length = kept;
2731
+ } else postJobs = [];
2685
2732
  if (activePostJobs) {
2686
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2687
- postJobs.length = 0;
2733
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
2688
2734
  return;
2689
2735
  }
2690
- activePostJobs = postJobs;
2691
- postJobs = [];
2736
+ activePostJobs = cbs;
2692
2737
  seen = seen || /* @__PURE__ */ new Map();
2693
2738
  try {
2694
2739
  while (postFlushIndex < activePostJobs.length) {
@@ -2710,17 +2755,28 @@ function flushPostFlushCbs(seen) {
2710
2755
  }
2711
2756
  let isFlushing = false;
2712
2757
  /**
2758
+ * Run a root render, then flush the jobs it is responsible for. A mount or
2759
+ * unmount (`minUid` given) only flushes the jobs of the components it created
2760
+ * and the post cbs it queued, so pre watchers triggered in setup run before
2761
+ * mounted (#5721) while the jobs of other components stay in the queue and
2762
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
2763
+ * and post cbs, as the jobs of the components it re-renders may predate it.
2764
+ *
2713
2765
  * @internal
2714
2766
  */
2715
- function flushOnAppMount(instance) {
2716
- if (!isFlushing) {
2717
- isFlushing = true;
2718
- try {
2719
- flushPreFlushCbs(instance);
2720
- flushPostFlushCbs();
2721
- } finally {
2722
- isFlushing = false;
2723
- }
2767
+ function flushOnAppMount(fn, minUid) {
2768
+ if (isFlushing) {
2769
+ fn();
2770
+ return;
2771
+ }
2772
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
2773
+ fn();
2774
+ isFlushing = true;
2775
+ try {
2776
+ flushPreFlushCbs(void 0, minUid);
2777
+ flushPostFlushCbs(void 0, queued, minUid);
2778
+ } finally {
2779
+ isFlushing = false;
2724
2780
  }
2725
2781
  }
2726
2782
  function flushJobs(seen) {
@@ -3541,7 +3597,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
3541
3597
  this.flags |= 128;
3542
3598
  job.flags |= 2;
3543
3599
  }
3544
- if (instance) job.i = instance;
3600
+ job.i = instance;
3545
3601
  this.job = job;
3546
3602
  }
3547
3603
  notify() {
@@ -3734,7 +3790,11 @@ const TeleportImpl = {
3734
3790
  hydrate: hydrateTeleport
3735
3791
  };
3736
3792
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
3737
- if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
3793
+ if (moveType === 0) {
3794
+ if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
3795
+ insert(vnode.targetAnchor, container, parentAnchor);
3796
+ parentAnchor = vnode.targetAnchor;
3797
+ }
3738
3798
  const { el, anchor, shapeFlag, children, props } = vnode;
3739
3799
  const isReorder = moveType === 2;
3740
3800
  if (isReorder) insert(el, container, parentAnchor);
@@ -3853,10 +3913,15 @@ const BaseTransitionPropsValidators = {
3853
3913
  onAfterAppear: TransitionHookValidator,
3854
3914
  onAppearCancelled: TransitionHookValidator
3855
3915
  };
3856
- const recursiveGetSubtree = (instance) => {
3857
- const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
3858
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3859
- };
3916
+ function isEmptyTransitionChild(vnode, instance) {
3917
+ if (vnode.type === Comment) return true;
3918
+ if (vnode.type === Fragment) {
3919
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3920
+ return !child || isEmptyTransitionChild(child, instance);
3921
+ }
3922
+ if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3923
+ return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3924
+ }
3860
3925
  const BaseTransitionImpl = {
3861
3926
  name: `BaseTransition`,
3862
3927
  props: BaseTransitionPropsValidators,
@@ -3905,7 +3970,7 @@ function getLeavingNodesForType(state, vnode) {
3905
3970
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3906
3971
  const key = String(vnode.key);
3907
3972
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3908
- return baseResolveTransitionHooks({
3973
+ const hooks = baseResolveTransitionHooks({
3909
3974
  isLeaving: () => leavingVNodesCache[key] === vnode,
3910
3975
  setLeavingNodeCache: () => {
3911
3976
  leavingVNodesCache[key] = vnode;
@@ -3915,7 +3980,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3915
3980
  },
3916
3981
  earlyRemove: () => {
3917
3982
  const leavingVNode = leavingVNodesCache[key];
3918
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) leavingVNode.el[leaveCbKey]();
3983
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3984
+ let leavingCb = leavingVNode.el[leaveCbKey];
3985
+ if (!leavingCb) {
3986
+ const leavingRoot = getTransitionRoot(leavingVNode);
3987
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3988
+ }
3989
+ if (leavingCb) leavingCb();
3990
+ }
3919
3991
  },
3920
3992
  cloneHooks: (vnode) => {
3921
3993
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -3923,6 +3995,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3923
3995
  return hooks;
3924
3996
  }
3925
3997
  }, props, state, instance);
3998
+ if (vnode.type === VaporSlot) extend(hooks, {
3999
+ __vapor: true,
4000
+ props,
4001
+ state,
4002
+ instance
4003
+ });
4004
+ return hooks;
3926
4005
  }
3927
4006
  function baseResolveTransitionHooks(context, props, state, instance) {
3928
4007
  const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
@@ -4038,7 +4117,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
4038
4117
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
4039
4118
  const mode = props.mode;
4040
4119
  const previousInner = previous && getInnerChild$1(previous);
4041
- if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
4120
+ if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
4042
4121
  const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
4043
4122
  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);
4044
4123
  }
@@ -4102,7 +4181,13 @@ function setTransitionHooks(vnode, hooks) {
4102
4181
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4103
4182
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4104
4183
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
4105
- } else vnode.transition = hooks;
4184
+ } else {
4185
+ vnode.transition = hooks;
4186
+ if (vnode.type === Fragment && isArray(vnode.children)) {
4187
+ const child = filterSingleRoot(vnode.children, false);
4188
+ if (child) setTransitionHooks(child, hooks);
4189
+ }
4190
+ }
4106
4191
  return hooks;
4107
4192
  }
4108
4193
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -4125,6 +4210,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4125
4210
  function checkTransitionMode(mode) {
4126
4211
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
4127
4212
  }
4213
+ function getTransitionRoot(vnode) {
4214
+ if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
4215
+ if (vnode.type === Fragment) {
4216
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
4217
+ return child ? getTransitionRoot(child) : void 0;
4218
+ }
4219
+ if (vnode.type !== Comment) return vnode;
4220
+ }
4128
4221
  //#endregion
4129
4222
  //#region packages/runtime-core/src/apiDefineComponent.ts
4130
4223
  /*@__NO_SIDE_EFFECTS__*/
@@ -4754,14 +4847,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
4754
4847
  break;
4755
4848
  }
4756
4849
  }, opts);
4757
- forEach((el) => {
4758
- if (!(el instanceof Element)) return;
4850
+ const observe = (el) => {
4759
4851
  if (elementIsVisibleInViewport(el)) {
4760
4852
  hydrate();
4761
4853
  ob.disconnect();
4762
4854
  return false;
4763
4855
  }
4856
+ if (getComputedStyle(el).display === "contents") {
4857
+ for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
4858
+ }
4764
4859
  ob.observe(el);
4860
+ };
4861
+ forEach((el) => {
4862
+ if (!(el instanceof Element)) return;
4863
+ return observe(el);
4765
4864
  });
4766
4865
  return () => ob.disconnect();
4767
4866
  };
@@ -5019,7 +5118,10 @@ const KeepAliveImpl = {
5019
5118
  function pruneCacheEntry(key) {
5020
5119
  const cached = cache.get(key);
5021
5120
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
5022
- else if (current) resetShapeFlag(current);
5121
+ else if (current) {
5122
+ resetShapeFlag(current);
5123
+ if (cached) resetShapeFlag(cached);
5124
+ }
5023
5125
  cache.delete(key);
5024
5126
  keys.delete(key);
5025
5127
  }
@@ -5565,6 +5667,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5565
5667
  owner: currentRenderingInstance
5566
5668
  }] : void 0
5567
5669
  };
5670
+ if (branchKey != null && props.key == null) {
5671
+ ret.vs.props = ret.props;
5672
+ ret.props = extend({}, ret.props, { key: branchKey });
5673
+ ret.key = branchKey;
5674
+ }
5568
5675
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5569
5676
  return ret;
5570
5677
  }
@@ -5768,6 +5875,7 @@ function installCompatInstanceProperties(map) {
5768
5875
  const privateAPIs = {
5769
5876
  $vnode: (i) => i.vnode,
5770
5877
  _self: (i) => i.proxy,
5878
+ _setupProxy: (i) => i.setupState,
5771
5879
  _uid: (i) => i.uid,
5772
5880
  _data: (i) => i.data,
5773
5881
  _isMounted: (i) => i.isMounted,
@@ -6543,7 +6651,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6543
6651
  if (options.el) return vm.$mount(options.el);
6544
6652
  else return vm;
6545
6653
  }
6546
- Vue.version = `2.6.14-compat:3.6.0-rc.10`;
6654
+ Vue.version = `2.6.14-compat:3.6.0-rc.12`;
6547
6655
  Vue.config = singletonApp.config;
6548
6656
  Vue.use = (plugin, ...options) => {
6549
6657
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7361,7 +7469,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
7361
7469
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
7362
7470
  for (let i = 0; i < nextKeys.length; i++) {
7363
7471
  const key = nextKeys[i];
7364
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
7472
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
7365
7473
  }
7366
7474
  return false;
7367
7475
  }
@@ -8085,7 +8193,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8085
8193
  for (let i = 0; i < newChildren.length; i++) {
8086
8194
  const oldVNode = oldChildren[i];
8087
8195
  const newVNode = newChildren[i];
8088
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
8196
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
8197
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
8089
8198
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
8090
8199
  }
8091
8200
  };
@@ -8180,6 +8289,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8180
8289
  if (instance.asyncDep && !instance.asyncResolved) {
8181
8290
  pushWarningContext(n2);
8182
8291
  n2.el = n1.el;
8292
+ n2.placeholder = n1.placeholder;
8183
8293
  updateComponentPreRender(instance, n2, optimized);
8184
8294
  popWarningContext();
8185
8295
  return;
@@ -8189,6 +8299,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8189
8299
  }
8190
8300
  } else {
8191
8301
  n2.el = n1.el;
8302
+ n2.placeholder = n1.placeholder;
8192
8303
  instance.vnode = n2;
8193
8304
  }
8194
8305
  };
@@ -8540,12 +8651,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8540
8651
  };
8541
8652
  const remove = (vnode) => {
8542
8653
  const { type, el, anchor, transition } = vnode;
8543
- if (type === Fragment) {
8544
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
8545
- if (child.type === Comment) hostRemove(child.el);
8546
- else remove(child);
8547
- });
8548
- else removeFragment(el, anchor);
8654
+ const isFragment = type === Fragment;
8655
+ if (isFragment && !transition) {
8656
+ removeFragment(el, anchor);
8549
8657
  return;
8550
8658
  }
8551
8659
  if (type === Static) {
@@ -8553,8 +8661,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8553
8661
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
8554
8662
  return;
8555
8663
  }
8556
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
8557
- else hostRemove(el);
8664
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
8665
+ const performRemove = () => {
8666
+ if (isFragment) {
8667
+ if (hostParentNode(el)) removeFragment(el, anchor);
8668
+ } else hostRemove(el);
8669
+ };
8670
+ if (transition) {
8671
+ let leavingEl = leavingNode && leavingNode.el;
8672
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
8673
+ if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
8674
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
8675
+ isElement = !!leavingEl;
8676
+ }
8677
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
8678
+ } else performRemove();
8558
8679
  };
8559
8680
  const removeFragment = (cur, end) => {
8560
8681
  let next;
@@ -8599,15 +8720,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8599
8720
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
8600
8721
  };
8601
8722
  const render = (vnode, container, namespace) => {
8602
- let instance;
8603
- if (vnode == null) {
8604
- if (container._vnode) {
8605
- unmount(container._vnode, null, null, true);
8606
- instance = container._vnode.component;
8607
- }
8608
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
8609
- container._vnode = vnode;
8610
- flushOnAppMount(instance);
8723
+ flushOnAppMount(() => {
8724
+ if (vnode == null) {
8725
+ if (container._vnode) unmount(container._vnode, null, null, true);
8726
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
8727
+ container._vnode = vnode;
8728
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
8611
8729
  };
8612
8730
  const internals = {
8613
8731
  p: patch,
@@ -9000,13 +9118,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9000
9118
  registerDep(instance, onResolve) {
9001
9119
  const isInPendingSuspense = !!suspense.pendingBranch;
9002
9120
  if (isInPendingSuspense) suspense.deps++;
9003
- const hydratedEl = instance.vnode && instance.vnode.el;
9004
9121
  instance.asyncDep.catch((err) => {
9005
9122
  handleError(err, instance, 0);
9006
9123
  }).then((asyncSetupResult) => {
9007
9124
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9008
9125
  setCurrentInstance(null, void 0);
9009
- if (hydratedEl && !instance.scope.active) {
9126
+ if (!instance.scope.active) {
9010
9127
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9011
9128
  return;
9012
9129
  }
@@ -9362,7 +9479,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9362
9479
  ctx: vnode.ctx,
9363
9480
  ce: vnode.ce,
9364
9481
  vi: vnode.vi,
9365
- vs: cloneVaporSlotMeta(vnode),
9482
+ vs: cloneVaporSlotMeta(vnode, extraProps),
9366
9483
  vb: vnode.vb,
9367
9484
  ibu: vnode.ibu,
9368
9485
  iu: vnode.iu,
@@ -9372,13 +9489,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9372
9489
  defineLegacyVNodeProperties(cloned);
9373
9490
  return cloned;
9374
9491
  }
9375
- function cloneVaporSlotMeta(vnode) {
9492
+ function cloneVaporSlotMeta(vnode, extraProps) {
9376
9493
  const vaporSlot = vnode.vs;
9377
9494
  if (!vaporSlot) return vaporSlot;
9378
9495
  const cloned = {
9379
9496
  slot: vaporSlot.slot,
9380
- outlets: vaporSlot.outlets
9497
+ outlets: vaporSlot.outlets,
9498
+ props: vaporSlot.props
9381
9499
  };
9500
+ if (vaporSlot.props && extraProps) {
9501
+ let extraSlotProps;
9502
+ for (const key in extraProps) if (key !== "key") {
9503
+ if (!extraSlotProps) extraSlotProps = {};
9504
+ extraSlotProps[key] = extraProps[key];
9505
+ }
9506
+ if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
9507
+ }
9382
9508
  if (vnode.el) {
9383
9509
  cloned.state = vaporSlot.state;
9384
9510
  cloned.ref = vaporSlot.ref;
@@ -9561,6 +9687,9 @@ const useInstanceOption = (key, silent = false) => {
9561
9687
  //#region packages/runtime-core/src/component.ts
9562
9688
  const emptyAppContext = /*@__PURE__*/ createAppContext();
9563
9689
  let uid = 0;
9690
+ function getNextUid() {
9691
+ return uid;
9692
+ }
9564
9693
  function createComponentInstance(vnode, parent, suspense) {
9565
9694
  const type = vnode.type;
9566
9695
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -10069,7 +10198,7 @@ function isMemoSame(cached, memo) {
10069
10198
  }
10070
10199
  //#endregion
10071
10200
  //#region packages/runtime-core/src/index.ts
10072
- const version = "3.6.0-rc.10";
10201
+ const version = "3.6.0-rc.12";
10073
10202
  const warn = warn$1;
10074
10203
  /**
10075
10204
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10577,7 +10706,7 @@ function patchStyle(el, prev, next) {
10577
10706
  else el.removeAttribute("style");
10578
10707
  }
10579
10708
  if (vShowOriginalDisplay in el) {
10580
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10709
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10581
10710
  if (el[vShowHidden]) style.display = "none";
10582
10711
  }
10583
10712
  }
@@ -10907,7 +11036,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
10907
11036
  this._resolveProps(def);
10908
11037
  if (this.shadowRoot) this._applyStyles(styles);
10909
11038
  else if (styles) warn("Custom element style injection is not supported when using shadowRoot: false");
10910
- this._mountComponent(def);
11039
+ if (this._connected) this._mountComponent(def);
10911
11040
  };
10912
11041
  const asyncDef = this._def.__asyncLoader;
10913
11042
  if (asyncDef) {
@@ -11225,6 +11354,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
11225
11354
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11226
11355
  const moveCbKey = Symbol("_moveCb");
11227
11356
  const enterCbKey = Symbol("_enterCb");
11357
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
11228
11358
  /**
11229
11359
  * Wrap logic that modifies TransitionGroup properties in a function
11230
11360
  * so that it can be annotated as pure
@@ -11245,15 +11375,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11245
11375
  const state = useTransitionState();
11246
11376
  let prevChildren;
11247
11377
  let children;
11378
+ let origins;
11379
+ let moves;
11380
+ const willMove = () => {
11381
+ if (moves === void 0) moves = prevChildren.length > 0 && hasCSSTransform(prevChildren[0].el, instance.vnode.el, resolveMoveClass(props));
11382
+ return moves;
11383
+ };
11248
11384
  onUpdated(() => {
11249
- if (!prevChildren.length) return;
11250
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
11251
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
11385
+ pendingGroups.delete(instance);
11386
+ if (!willMove()) {
11252
11387
  prevChildren = [];
11388
+ origins = void 0;
11253
11389
  return;
11254
11390
  }
11391
+ const moveClass = resolveMoveClass(props);
11255
11392
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
11256
- prevChildren.forEach(recordPosition);
11393
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
11394
+ origins = void 0;
11395
+ prevChildren.forEach((c) => recordPosition(c, shift));
11257
11396
  const movedChildren = prevChildren.filter(applyTranslation);
11258
11397
  forceReflow(instance.vnode.el);
11259
11398
  movedChildren.forEach((c) => {
@@ -11268,6 +11407,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11268
11407
  let tag = rawProps.tag || Fragment;
11269
11408
  if (!rawProps.tag && compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT", instance.parent)) tag = "span";
11270
11409
  prevChildren = [];
11410
+ moves = void 0;
11271
11411
  if (children) for (let i = 0; i < children.length; i++) {
11272
11412
  const child = children[i];
11273
11413
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
@@ -11282,6 +11422,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11282
11422
  if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
11283
11423
  else if (child.type !== Text) warn(`<TransitionGroup> children must be keyed.`);
11284
11424
  }
11425
+ if (prevChildren.length) {
11426
+ const root = instance.vnode.el;
11427
+ origins = getOrigins(instance, root);
11428
+ pendingGroups.set(instance, {
11429
+ root,
11430
+ willMove
11431
+ });
11432
+ }
11285
11433
  return createVNode(tag, null, children);
11286
11434
  };
11287
11435
  }
@@ -11290,8 +11438,11 @@ function callPendingCbs(el) {
11290
11438
  if (el[moveCbKey]) el[moveCbKey]();
11291
11439
  if (el[enterCbKey]) el[enterCbKey]();
11292
11440
  }
11293
- function recordPosition(c) {
11294
- newPositionMap.set(c, getPosition(c.el));
11441
+ function resolveMoveClass(props) {
11442
+ return props.moveClass || `${props.name || "v"}-move`;
11443
+ }
11444
+ function recordPosition(c, shift) {
11445
+ newPositionMap.set(c, getPosition(c.el, shift));
11295
11446
  }
11296
11447
  function applyTranslation(c) {
11297
11448
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -11316,13 +11467,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
11316
11467
  }
11317
11468
  return false;
11318
11469
  }
11319
- function getPosition(el) {
11470
+ function getPosition(el, shift) {
11320
11471
  const rect = el.getBoundingClientRect();
11321
11472
  return {
11322
- left: rect.left,
11323
- top: rect.top
11473
+ left: rect.left - (shift ? shift.left : 0),
11474
+ top: rect.top - (shift ? shift.top : 0)
11324
11475
  };
11325
11476
  }
11477
+ function getOrigins(instance, root) {
11478
+ let origins;
11479
+ for (let group = instance.parent; group; group = group.parent) {
11480
+ const pending = pendingGroups.get(group);
11481
+ if (pending) {
11482
+ const item = findItem(pending.root, root);
11483
+ if (item) (origins || (origins = [])).push(extend(getPosition(item), {
11484
+ item,
11485
+ willMove: pending.willMove
11486
+ }));
11487
+ }
11488
+ }
11489
+ return origins;
11490
+ }
11491
+ function findItem(root, node) {
11492
+ const container = root.nodeType === 1 ? root : root.parentNode;
11493
+ while (node && node.parentNode !== container) node = node.parentNode;
11494
+ if (node && node.nodeType === 1) return node;
11495
+ }
11496
+ function getOriginShift(origins, root) {
11497
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
11498
+ return origin && getPosition(origin.item, origin);
11499
+ }
11326
11500
  function hasCSSTransform(el, root, moveClass) {
11327
11501
  const clone = el.cloneNode();
11328
11502
  const _vtc = el[vtcKey];
@@ -13074,7 +13248,7 @@ const errorMessages = {
13074
13248
  [41]: `v-model is missing expression.`,
13075
13249
  [42]: `v-model value must be a valid JavaScript member expression.`,
13076
13250
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
13077
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
13251
+ [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.\nFor props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
13078
13252
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
13079
13253
  [46]: `Error parsing JavaScript expression: `,
13080
13254
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -14897,7 +15071,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14897
15071
  ]),
14898
15072
  createCompoundExpression([
14899
15073
  `if (_cached && _cached.el`,
14900
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
15074
+ ...keyExp ? [
15075
+ ` && _cached.key === (`,
15076
+ keyExp,
15077
+ `)`
15078
+ ] : [],
14901
15079
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
14902
15080
  ]),
14903
15081
  createCompoundExpression([`const _item = `, childBlock]),
@@ -16319,7 +16497,11 @@ const validateHtmlNesting = (node, context) => {
16319
16497
  };
16320
16498
  //#endregion
16321
16499
  //#region packages/compiler-dom/src/index.ts
16322
- const DOMNodeTransforms = [transformStyle, ...[transformTransition, validateHtmlNesting]];
16500
+ const DOMNodeTransforms = [
16501
+ transformStyle,
16502
+ transformTransition,
16503
+ ...[validateHtmlNesting]
16504
+ ];
16323
16505
  const DOMDirectiveTransforms = {
16324
16506
  cloak: noopDirectiveTransform,
16325
16507
  html: transformVHtml,