@vue/compat 3.6.0-rc.11 → 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.11
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);
@@ -3855,6 +3915,10 @@ const BaseTransitionPropsValidators = {
3855
3915
  };
3856
3916
  function isEmptyTransitionChild(vnode, instance) {
3857
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
+ }
3858
3922
  if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3859
3923
  return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3860
3924
  }
@@ -3916,7 +3980,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3916
3980
  },
3917
3981
  earlyRemove: () => {
3918
3982
  const leavingVNode = leavingVNodesCache[key];
3919
- 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
+ }
3920
3991
  },
3921
3992
  cloneHooks: (vnode) => {
3922
3993
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -4110,7 +4181,13 @@ function setTransitionHooks(vnode, hooks) {
4110
4181
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4111
4182
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4112
4183
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
4113
- } 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
+ }
4114
4191
  return hooks;
4115
4192
  }
4116
4193
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -4133,6 +4210,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4133
4210
  function checkTransitionMode(mode) {
4134
4211
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
4135
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
+ }
4136
4221
  //#endregion
4137
4222
  //#region packages/runtime-core/src/apiDefineComponent.ts
4138
4223
  /*@__NO_SIDE_EFFECTS__*/
@@ -4762,14 +4847,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
4762
4847
  break;
4763
4848
  }
4764
4849
  }, opts);
4765
- forEach((el) => {
4766
- if (!(el instanceof Element)) return;
4850
+ const observe = (el) => {
4767
4851
  if (elementIsVisibleInViewport(el)) {
4768
4852
  hydrate();
4769
4853
  ob.disconnect();
4770
4854
  return false;
4771
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
+ }
4772
4859
  ob.observe(el);
4860
+ };
4861
+ forEach((el) => {
4862
+ if (!(el instanceof Element)) return;
4863
+ return observe(el);
4773
4864
  });
4774
4865
  return () => ob.disconnect();
4775
4866
  };
@@ -5027,7 +5118,10 @@ const KeepAliveImpl = {
5027
5118
  function pruneCacheEntry(key) {
5028
5119
  const cached = cache.get(key);
5029
5120
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
5030
- else if (current) resetShapeFlag(current);
5121
+ else if (current) {
5122
+ resetShapeFlag(current);
5123
+ if (cached) resetShapeFlag(cached);
5124
+ }
5031
5125
  cache.delete(key);
5032
5126
  keys.delete(key);
5033
5127
  }
@@ -5573,6 +5667,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5573
5667
  owner: currentRenderingInstance
5574
5668
  }] : void 0
5575
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
+ }
5576
5675
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5577
5676
  return ret;
5578
5677
  }
@@ -5776,6 +5875,7 @@ function installCompatInstanceProperties(map) {
5776
5875
  const privateAPIs = {
5777
5876
  $vnode: (i) => i.vnode,
5778
5877
  _self: (i) => i.proxy,
5878
+ _setupProxy: (i) => i.setupState,
5779
5879
  _uid: (i) => i.uid,
5780
5880
  _data: (i) => i.data,
5781
5881
  _isMounted: (i) => i.isMounted,
@@ -6551,7 +6651,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6551
6651
  if (options.el) return vm.$mount(options.el);
6552
6652
  else return vm;
6553
6653
  }
6554
- Vue.version = `2.6.14-compat:3.6.0-rc.11`;
6654
+ Vue.version = `2.6.14-compat:3.6.0-rc.12`;
6555
6655
  Vue.config = singletonApp.config;
6556
6656
  Vue.use = (plugin, ...options) => {
6557
6657
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -7369,7 +7469,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
7369
7469
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
7370
7470
  for (let i = 0; i < nextKeys.length; i++) {
7371
7471
  const key = nextKeys[i];
7372
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
7472
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
7373
7473
  }
7374
7474
  return false;
7375
7475
  }
@@ -8093,7 +8193,8 @@ function baseCreateRenderer(options, createHydrationFns) {
8093
8193
  for (let i = 0; i < newChildren.length; i++) {
8094
8194
  const oldVNode = oldChildren[i];
8095
8195
  const newVNode = newChildren[i];
8096
- 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;
8097
8198
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
8098
8199
  }
8099
8200
  };
@@ -8188,6 +8289,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8188
8289
  if (instance.asyncDep && !instance.asyncResolved) {
8189
8290
  pushWarningContext(n2);
8190
8291
  n2.el = n1.el;
8292
+ n2.placeholder = n1.placeholder;
8191
8293
  updateComponentPreRender(instance, n2, optimized);
8192
8294
  popWarningContext();
8193
8295
  return;
@@ -8197,6 +8299,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8197
8299
  }
8198
8300
  } else {
8199
8301
  n2.el = n1.el;
8302
+ n2.placeholder = n1.placeholder;
8200
8303
  instance.vnode = n2;
8201
8304
  }
8202
8305
  };
@@ -8548,12 +8651,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8548
8651
  };
8549
8652
  const remove = (vnode) => {
8550
8653
  const { type, el, anchor, transition } = vnode;
8551
- if (type === Fragment) {
8552
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) vnode.children.forEach((child) => {
8553
- if (child.type === Comment) hostRemove(child.el);
8554
- else remove(child);
8555
- });
8556
- else removeFragment(el, anchor);
8654
+ const isFragment = type === Fragment;
8655
+ if (isFragment && !transition) {
8656
+ removeFragment(el, anchor);
8557
8657
  return;
8558
8658
  }
8559
8659
  if (type === Static) {
@@ -8561,8 +8661,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8561
8661
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
8562
8662
  return;
8563
8663
  }
8564
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
8565
- 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();
8566
8679
  };
8567
8680
  const removeFragment = (cur, end) => {
8568
8681
  let next;
@@ -8607,15 +8720,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8607
8720
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
8608
8721
  };
8609
8722
  const render = (vnode, container, namespace) => {
8610
- let instance;
8611
- if (vnode == null) {
8612
- if (container._vnode) {
8613
- unmount(container._vnode, null, null, true);
8614
- instance = container._vnode.component;
8615
- }
8616
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
8617
- container._vnode = vnode;
8618
- 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());
8619
8729
  };
8620
8730
  const internals = {
8621
8731
  p: patch,
@@ -9008,13 +9118,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9008
9118
  registerDep(instance, onResolve) {
9009
9119
  const isInPendingSuspense = !!suspense.pendingBranch;
9010
9120
  if (isInPendingSuspense) suspense.deps++;
9011
- const hydratedEl = instance.vnode && instance.vnode.el;
9012
9121
  instance.asyncDep.catch((err) => {
9013
9122
  handleError(err, instance, 0);
9014
9123
  }).then((asyncSetupResult) => {
9015
9124
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9016
9125
  setCurrentInstance(null, void 0);
9017
- if (hydratedEl && !instance.scope.active) {
9126
+ if (!instance.scope.active) {
9018
9127
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9019
9128
  return;
9020
9129
  }
@@ -9370,7 +9479,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9370
9479
  ctx: vnode.ctx,
9371
9480
  ce: vnode.ce,
9372
9481
  vi: vnode.vi,
9373
- vs: cloneVaporSlotMeta(vnode),
9482
+ vs: cloneVaporSlotMeta(vnode, extraProps),
9374
9483
  vb: vnode.vb,
9375
9484
  ibu: vnode.ibu,
9376
9485
  iu: vnode.iu,
@@ -9380,13 +9489,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9380
9489
  defineLegacyVNodeProperties(cloned);
9381
9490
  return cloned;
9382
9491
  }
9383
- function cloneVaporSlotMeta(vnode) {
9492
+ function cloneVaporSlotMeta(vnode, extraProps) {
9384
9493
  const vaporSlot = vnode.vs;
9385
9494
  if (!vaporSlot) return vaporSlot;
9386
9495
  const cloned = {
9387
9496
  slot: vaporSlot.slot,
9388
- outlets: vaporSlot.outlets
9497
+ outlets: vaporSlot.outlets,
9498
+ props: vaporSlot.props
9389
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
+ }
9390
9508
  if (vnode.el) {
9391
9509
  cloned.state = vaporSlot.state;
9392
9510
  cloned.ref = vaporSlot.ref;
@@ -9569,6 +9687,9 @@ const useInstanceOption = (key, silent = false) => {
9569
9687
  //#region packages/runtime-core/src/component.ts
9570
9688
  const emptyAppContext = /*@__PURE__*/ createAppContext();
9571
9689
  let uid = 0;
9690
+ function getNextUid() {
9691
+ return uid;
9692
+ }
9572
9693
  function createComponentInstance(vnode, parent, suspense) {
9573
9694
  const type = vnode.type;
9574
9695
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -10077,7 +10198,7 @@ function isMemoSame(cached, memo) {
10077
10198
  }
10078
10199
  //#endregion
10079
10200
  //#region packages/runtime-core/src/index.ts
10080
- const version = "3.6.0-rc.11";
10201
+ const version = "3.6.0-rc.12";
10081
10202
  const warn = warn$1;
10082
10203
  /**
10083
10204
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10585,7 +10706,7 @@ function patchStyle(el, prev, next) {
10585
10706
  else el.removeAttribute("style");
10586
10707
  }
10587
10708
  if (vShowOriginalDisplay in el) {
10588
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10709
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10589
10710
  if (el[vShowHidden]) style.display = "none";
10590
10711
  }
10591
10712
  }
@@ -10915,7 +11036,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
10915
11036
  this._resolveProps(def);
10916
11037
  if (this.shadowRoot) this._applyStyles(styles);
10917
11038
  else if (styles) warn("Custom element style injection is not supported when using shadowRoot: false");
10918
- this._mountComponent(def);
11039
+ if (this._connected) this._mountComponent(def);
10919
11040
  };
10920
11041
  const asyncDef = this._def.__asyncLoader;
10921
11042
  if (asyncDef) {
@@ -11233,6 +11354,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
11233
11354
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11234
11355
  const moveCbKey = Symbol("_moveCb");
11235
11356
  const enterCbKey = Symbol("_enterCb");
11357
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
11236
11358
  /**
11237
11359
  * Wrap logic that modifies TransitionGroup properties in a function
11238
11360
  * so that it can be annotated as pure
@@ -11253,15 +11375,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11253
11375
  const state = useTransitionState();
11254
11376
  let prevChildren;
11255
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
+ };
11256
11384
  onUpdated(() => {
11257
- if (!prevChildren.length) return;
11258
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
11259
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
11385
+ pendingGroups.delete(instance);
11386
+ if (!willMove()) {
11260
11387
  prevChildren = [];
11388
+ origins = void 0;
11261
11389
  return;
11262
11390
  }
11391
+ const moveClass = resolveMoveClass(props);
11263
11392
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
11264
- prevChildren.forEach(recordPosition);
11393
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
11394
+ origins = void 0;
11395
+ prevChildren.forEach((c) => recordPosition(c, shift));
11265
11396
  const movedChildren = prevChildren.filter(applyTranslation);
11266
11397
  forceReflow(instance.vnode.el);
11267
11398
  movedChildren.forEach((c) => {
@@ -11276,6 +11407,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11276
11407
  let tag = rawProps.tag || Fragment;
11277
11408
  if (!rawProps.tag && compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT", instance.parent)) tag = "span";
11278
11409
  prevChildren = [];
11410
+ moves = void 0;
11279
11411
  if (children) for (let i = 0; i < children.length; i++) {
11280
11412
  const child = children[i];
11281
11413
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
@@ -11290,6 +11422,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
11290
11422
  if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
11291
11423
  else if (child.type !== Text) warn(`<TransitionGroup> children must be keyed.`);
11292
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
+ }
11293
11433
  return createVNode(tag, null, children);
11294
11434
  };
11295
11435
  }
@@ -11298,8 +11438,11 @@ function callPendingCbs(el) {
11298
11438
  if (el[moveCbKey]) el[moveCbKey]();
11299
11439
  if (el[enterCbKey]) el[enterCbKey]();
11300
11440
  }
11301
- function recordPosition(c) {
11302
- 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));
11303
11446
  }
11304
11447
  function applyTranslation(c) {
11305
11448
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -11324,13 +11467,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
11324
11467
  }
11325
11468
  return false;
11326
11469
  }
11327
- function getPosition(el) {
11470
+ function getPosition(el, shift) {
11328
11471
  const rect = el.getBoundingClientRect();
11329
11472
  return {
11330
- left: rect.left,
11331
- top: rect.top
11473
+ left: rect.left - (shift ? shift.left : 0),
11474
+ top: rect.top - (shift ? shift.top : 0)
11332
11475
  };
11333
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
+ }
11334
11500
  function hasCSSTransform(el, root, moveClass) {
11335
11501
  const clone = el.cloneNode();
11336
11502
  const _vtc = el[vtcKey];
@@ -13082,7 +13248,7 @@ const errorMessages = {
13082
13248
  [41]: `v-model is missing expression.`,
13083
13249
  [42]: `v-model value must be a valid JavaScript member expression.`,
13084
13250
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
13085
- [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.`,
13086
13252
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
13087
13253
  [46]: `Error parsing JavaScript expression: `,
13088
13254
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -14905,7 +15071,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14905
15071
  ]),
14906
15072
  createCompoundExpression([
14907
15073
  `if (_cached && _cached.el`,
14908
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
15074
+ ...keyExp ? [
15075
+ ` && _cached.key === (`,
15076
+ keyExp,
15077
+ `)`
15078
+ ] : [],
14909
15079
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
14910
15080
  ]),
14911
15081
  createCompoundExpression([`const _item = `, childBlock]),
@@ -16327,7 +16497,11 @@ const validateHtmlNesting = (node, context) => {
16327
16497
  };
16328
16498
  //#endregion
16329
16499
  //#region packages/compiler-dom/src/index.ts
16330
- const DOMNodeTransforms = [transformStyle, ...[transformTransition, validateHtmlNesting]];
16500
+ const DOMNodeTransforms = [
16501
+ transformStyle,
16502
+ transformTransition,
16503
+ ...[validateHtmlNesting]
16504
+ ];
16331
16505
  const DOMDirectiveTransforms = {
16332
16506
  cloak: noopDirectiveTransform,
16333
16507
  html: transformVHtml,