@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
  **/
@@ -248,9 +248,10 @@ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
248
248
  * - ismap -> isMap
249
249
  * - nomodule -> noModule
250
250
  * - novalidate -> noValidate
251
+ * - playsinline -> playsInline
251
252
  * - readonly -> readOnly
252
253
  */
253
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
254
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
254
255
  const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
255
256
  /**
256
257
  * The full list is needed during SSR to produce the correct initial markup.
@@ -900,17 +901,33 @@ const arrayInstrumentations = {
900
901
  };
901
902
  function iterator(self, method, wrapValue) {
902
903
  const arr = shallowReadArray(self);
903
- const iter = arr[method]();
904
+ const methodFn = arr[method];
905
+ const iter = methodFn.call(arr);
904
906
  if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
907
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
908
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
909
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
910
+ if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
911
+ return: { get() {
912
+ const fn = iter.return;
913
+ return typeof fn === "function" ? fn.bind(iter) : fn;
914
+ } },
915
+ throw: { get() {
916
+ const fn = iter.throw;
917
+ return typeof fn === "function" ? fn.bind(iter) : fn;
918
+ } }
919
+ });
920
+ return wrapped;
921
+ }
905
922
  iter._next = iter.next;
906
- iter.next = () => {
907
- const result = iter._next();
908
- if (!result.done) result.value = wrapValue(result.value);
909
- return result;
910
- };
923
+ iter.next = () => wrapResult(iter._next(), wrapValue);
911
924
  }
912
925
  return iter;
913
926
  }
927
+ function wrapResult(result, wrapValue) {
928
+ if (!result.done) result.value = wrapValue(result.value);
929
+ return result;
930
+ }
914
931
  const arrayProto = Array.prototype;
915
932
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
916
933
  const arr = shallowReadArray(self);
@@ -1220,6 +1237,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
1220
1237
  return (target, key, receiver) => {
1221
1238
  if (key === "__v_isReactive") return !isReadonly;
1222
1239
  else if (key === "__v_isReadonly") return isReadonly;
1240
+ else if (key === "__v_isShallow") return shallow;
1223
1241
  else if (key === "__v_raw") return target;
1224
1242
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1225
1243
  };
@@ -2089,8 +2107,9 @@ function getCurrentWatcher() {
2089
2107
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
2090
2108
  if (owner) {
2091
2109
  const { call } = owner.options;
2092
- if (call) owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
2093
- else owner.cleanups[owner.cleanupsLength++] = cleanupFn;
2110
+ const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
2111
+ if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
2112
+ else owner.cleanups[owner.cleanupsLength++] = cleanup;
2094
2113
  }
2095
2114
  }
2096
2115
  var WatcherEffect = class extends ReactiveEffect {
@@ -2147,14 +2166,29 @@ var WatcherEffect = class extends ReactiveEffect {
2147
2166
  if (once && cb) {
2148
2167
  const _cb = cb;
2149
2168
  cb = (...args) => {
2150
- const res = _cb(...args);
2151
- this.stop();
2152
- return res;
2169
+ try {
2170
+ return _cb(...args);
2171
+ } finally {
2172
+ this.stop();
2173
+ }
2153
2174
  };
2154
2175
  }
2155
2176
  this.cb = cb;
2156
2177
  this.oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2157
2178
  }
2179
+ cleanupCallback() {
2180
+ const cleanups = this.cbCleanups;
2181
+ if (cleanups) {
2182
+ this.cbCleanups = void 0;
2183
+ for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
2184
+ }
2185
+ }
2186
+ stop() {
2187
+ if (this.active) {
2188
+ super.stop();
2189
+ this.cleanupCallback();
2190
+ }
2191
+ }
2158
2192
  run(initialRun = false) {
2159
2193
  const oldValue = this.oldValue;
2160
2194
  const newValue = this.oldValue = super.run();
@@ -2162,10 +2196,11 @@ var WatcherEffect = class extends ReactiveEffect {
2162
2196
  const { immediate, deep, call } = this.options;
2163
2197
  if (initialRun && !immediate) return;
2164
2198
  if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2165
- cleanup(this);
2166
2199
  const currentWatcher = activeWatcher;
2167
- activeWatcher = this;
2200
+ const prevSub = setActiveSub();
2168
2201
  try {
2202
+ this.cleanupCallback();
2203
+ activeWatcher = this;
2169
2204
  const args = [
2170
2205
  newValue,
2171
2206
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -2174,6 +2209,7 @@ var WatcherEffect = class extends ReactiveEffect {
2174
2209
  call ? call(this.cb, 3, args) : this.cb(...args);
2175
2210
  } finally {
2176
2211
  activeWatcher = currentWatcher;
2212
+ setActiveSub(prevSub);
2177
2213
  }
2178
2214
  }
2179
2215
  }
@@ -2397,13 +2433,13 @@ function queuePostFlushCb(jobs, id = Infinity) {
2397
2433
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2398
2434
  queueFlush();
2399
2435
  }
2400
- function flushPreFlushCbs(instance, seen) {
2436
+ function flushPreFlushCbs(instance, minUid, seen) {
2401
2437
  for (let i = flushIndex; i < jobsLength; i++) {
2402
2438
  const cb = jobs[i];
2403
2439
  if (cb.order & 1 || cb.order === Infinity) continue;
2404
- if (instance && cb.order !== instance.uid * 2) continue;
2440
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
2405
2441
  jobs.splice(i, 1);
2406
- i--;
2442
+ i = instance ? i - 1 : flushIndex - 1;
2407
2443
  jobsLength--;
2408
2444
  if (cb.flags & 2) cb.flags &= -2;
2409
2445
  try {
@@ -2413,15 +2449,24 @@ function flushPreFlushCbs(instance, seen) {
2413
2449
  }
2414
2450
  }
2415
2451
  }
2416
- function flushPostFlushCbs(seen) {
2452
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2417
2453
  if (postJobs.length) {
2454
+ let cbs = postJobs;
2455
+ if (skip) {
2456
+ cbs = [];
2457
+ let kept = 0;
2458
+ for (let i = 0; i < postJobs.length; i++) {
2459
+ const cb = postJobs[i];
2460
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
2461
+ else cbs.push(cb);
2462
+ }
2463
+ postJobs.length = kept;
2464
+ } else postJobs = [];
2418
2465
  if (activePostJobs) {
2419
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2420
- postJobs.length = 0;
2466
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
2421
2467
  return;
2422
2468
  }
2423
- activePostJobs = postJobs;
2424
- postJobs = [];
2469
+ activePostJobs = cbs;
2425
2470
  try {
2426
2471
  while (postFlushIndex < activePostJobs.length) {
2427
2472
  const cb = activePostJobs[postFlushIndex++];
@@ -2441,17 +2486,28 @@ function flushPostFlushCbs(seen) {
2441
2486
  }
2442
2487
  let isFlushing = false;
2443
2488
  /**
2489
+ * Run a root render, then flush the jobs it is responsible for. A mount or
2490
+ * unmount (`minUid` given) only flushes the jobs of the components it created
2491
+ * and the post cbs it queued, so pre watchers triggered in setup run before
2492
+ * mounted (#5721) while the jobs of other components stay in the queue and
2493
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
2494
+ * and post cbs, as the jobs of the components it re-renders may predate it.
2495
+ *
2444
2496
  * @internal
2445
2497
  */
2446
- function flushOnAppMount(instance) {
2447
- if (!isFlushing) {
2448
- isFlushing = true;
2449
- try {
2450
- flushPreFlushCbs(instance);
2451
- flushPostFlushCbs();
2452
- } finally {
2453
- isFlushing = false;
2454
- }
2498
+ function flushOnAppMount(fn, minUid) {
2499
+ if (isFlushing) {
2500
+ fn();
2501
+ return;
2502
+ }
2503
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
2504
+ fn();
2505
+ isFlushing = true;
2506
+ try {
2507
+ flushPreFlushCbs(void 0, minUid);
2508
+ flushPostFlushCbs(void 0, queued, minUid);
2509
+ } finally {
2510
+ isFlushing = false;
2455
2511
  }
2456
2512
  }
2457
2513
  function flushJobs(seen) {
@@ -2829,7 +2885,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
2829
2885
  this.flags |= 128;
2830
2886
  job.flags |= 2;
2831
2887
  }
2832
- if (instance) job.i = instance;
2888
+ job.i = instance;
2833
2889
  this.job = job;
2834
2890
  }
2835
2891
  notify() {
@@ -3021,7 +3077,11 @@ const TeleportImpl = {
3021
3077
  hydrate: hydrateTeleport
3022
3078
  };
3023
3079
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
3024
- if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
3080
+ if (moveType === 0) {
3081
+ if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
3082
+ insert(vnode.targetAnchor, container, parentAnchor);
3083
+ parentAnchor = vnode.targetAnchor;
3084
+ }
3025
3085
  const { el, anchor, shapeFlag, children, props } = vnode;
3026
3086
  const isReorder = moveType === 2;
3027
3087
  if (isReorder) insert(el, container, parentAnchor);
@@ -3142,6 +3202,10 @@ const BaseTransitionPropsValidators = {
3142
3202
  };
3143
3203
  function isEmptyTransitionChild(vnode, instance) {
3144
3204
  if (vnode.type === Comment) return true;
3205
+ if (vnode.type === Fragment) {
3206
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3207
+ return !child || isEmptyTransitionChild(child, instance);
3208
+ }
3145
3209
  if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3146
3210
  return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3147
3211
  }
@@ -3197,7 +3261,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3197
3261
  },
3198
3262
  earlyRemove: () => {
3199
3263
  const leavingVNode = leavingVNodesCache[key];
3200
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) leavingVNode.el[leaveCbKey]();
3264
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3265
+ let leavingCb = leavingVNode.el[leaveCbKey];
3266
+ if (!leavingCb) {
3267
+ const leavingRoot = getTransitionRoot(leavingVNode);
3268
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3269
+ }
3270
+ if (leavingCb) leavingCb();
3271
+ }
3201
3272
  },
3202
3273
  cloneHooks: (vnode) => {
3203
3274
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -3391,7 +3462,13 @@ function setTransitionHooks(vnode, hooks) {
3391
3462
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3392
3463
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3393
3464
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3394
- } else vnode.transition = hooks;
3465
+ } else {
3466
+ vnode.transition = hooks;
3467
+ if (vnode.type === Fragment && isArray(vnode.children)) {
3468
+ const child = filterSingleRoot(vnode.children, false);
3469
+ if (child) setTransitionHooks(child, hooks);
3470
+ }
3471
+ }
3395
3472
  return hooks;
3396
3473
  }
3397
3474
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -3408,6 +3485,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3408
3485
  if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
3409
3486
  return ret;
3410
3487
  }
3488
+ function getTransitionRoot(vnode) {
3489
+ if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
3490
+ if (vnode.type === Fragment) {
3491
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3492
+ return child ? getTransitionRoot(child) : void 0;
3493
+ }
3494
+ if (vnode.type !== Comment) return vnode;
3495
+ }
3411
3496
  //#endregion
3412
3497
  //#region packages/runtime-core/src/apiDefineComponent.ts
3413
3498
  /*@__NO_SIDE_EFFECTS__*/
@@ -3896,14 +3981,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
3896
3981
  break;
3897
3982
  }
3898
3983
  }, opts);
3899
- forEach((el) => {
3900
- if (!(el instanceof Element)) return;
3984
+ const observe = (el) => {
3901
3985
  if (elementIsVisibleInViewport(el)) {
3902
3986
  hydrate();
3903
3987
  ob.disconnect();
3904
3988
  return false;
3905
3989
  }
3990
+ if (getComputedStyle(el).display === "contents") {
3991
+ for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
3992
+ }
3906
3993
  ob.observe(el);
3994
+ };
3995
+ forEach((el) => {
3996
+ if (!(el instanceof Element)) return;
3997
+ return observe(el);
3907
3998
  });
3908
3999
  return () => ob.disconnect();
3909
4000
  };
@@ -4156,7 +4247,10 @@ const KeepAliveImpl = {
4156
4247
  function pruneCacheEntry(key) {
4157
4248
  const cached = cache.get(key);
4158
4249
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
4159
- else if (current) resetShapeFlag(current);
4250
+ else if (current) {
4251
+ resetShapeFlag(current);
4252
+ if (cached) resetShapeFlag(cached);
4253
+ }
4160
4254
  cache.delete(key);
4161
4255
  keys.delete(key);
4162
4256
  }
@@ -4630,8 +4724,11 @@ function renderList(source, renderItem, cache, index) {
4630
4724
  ret = new Array(source.length);
4631
4725
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
4632
4726
  } else if (typeof source === "number") {
4633
- ret = new Array(source);
4634
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4727
+ if (!Number.isInteger(source) || source < 0) ret = [];
4728
+ else {
4729
+ ret = new Array(source);
4730
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4731
+ }
4635
4732
  } else if (isObject(source)) {
4636
4733
  if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4637
4734
  else {
@@ -4707,6 +4804,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4707
4804
  owner: currentRenderingInstance
4708
4805
  }] : void 0
4709
4806
  };
4807
+ if (branchKey != null && props.key == null) {
4808
+ ret.vs.props = ret.props;
4809
+ ret.props = extend({}, ret.props, { key: branchKey });
4810
+ ret.key = branchKey;
4811
+ }
4710
4812
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4711
4813
  return ret;
4712
4814
  }
@@ -4900,6 +5002,7 @@ function installCompatInstanceProperties(map) {
4900
5002
  const privateAPIs = {
4901
5003
  $vnode: (i) => i.vnode,
4902
5004
  _self: (i) => i.proxy,
5005
+ _setupProxy: (i) => i.setupState,
4903
5006
  _uid: (i) => i.uid,
4904
5007
  _data: (i) => i.data,
4905
5008
  _isMounted: (i) => i.isMounted,
@@ -5495,7 +5598,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5495
5598
  if (options.el) return vm.$mount(options.el);
5496
5599
  else return vm;
5497
5600
  }
5498
- Vue.version = `2.6.14-compat:3.6.0-rc.11`;
5601
+ Vue.version = `2.6.14-compat:3.6.0-rc.12`;
5499
5602
  Vue.config = singletonApp.config;
5500
5603
  Vue.use = (plugin, ...options) => {
5501
5604
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6152,7 +6255,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6152
6255
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
6153
6256
  for (let i = 0; i < nextKeys.length; i++) {
6154
6257
  const key = nextKeys[i];
6155
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6258
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6156
6259
  }
6157
6260
  return false;
6158
6261
  }
@@ -6683,7 +6786,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6683
6786
  for (let i = 0; i < newChildren.length; i++) {
6684
6787
  const oldVNode = oldChildren[i];
6685
6788
  const newVNode = newChildren[i];
6686
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
6789
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
6790
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
6687
6791
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6688
6792
  }
6689
6793
  };
@@ -6760,6 +6864,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6760
6864
  if (shouldUpdateComponent(n1, n2, optimized)) {
6761
6865
  if (instance.asyncDep && !instance.asyncResolved) {
6762
6866
  n2.el = n1.el;
6867
+ n2.placeholder = n1.placeholder;
6763
6868
  updateComponentPreRender(instance, n2, optimized);
6764
6869
  return;
6765
6870
  } else {
@@ -6768,6 +6873,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6768
6873
  }
6769
6874
  } else {
6770
6875
  n2.el = n1.el;
6876
+ n2.placeholder = n1.placeholder;
6771
6877
  instance.vnode = n2;
6772
6878
  }
6773
6879
  };
@@ -7098,7 +7204,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7098
7204
  };
7099
7205
  const remove = (vnode) => {
7100
7206
  const { type, el, anchor, transition } = vnode;
7101
- if (type === Fragment) {
7207
+ const isFragment = type === Fragment;
7208
+ if (isFragment && !transition) {
7102
7209
  removeFragment(el, anchor);
7103
7210
  return;
7104
7211
  }
@@ -7107,8 +7214,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7107
7214
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7108
7215
  return;
7109
7216
  }
7110
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
7111
- else hostRemove(el);
7217
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
7218
+ const performRemove = () => {
7219
+ if (isFragment) {
7220
+ if (hostParentNode(el)) removeFragment(el, anchor);
7221
+ } else hostRemove(el);
7222
+ };
7223
+ if (transition) {
7224
+ let leavingEl = leavingNode && leavingNode.el;
7225
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
7226
+ if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
7227
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
7228
+ isElement = !!leavingEl;
7229
+ }
7230
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
7231
+ } else performRemove();
7112
7232
  };
7113
7233
  const removeFragment = (cur, end) => {
7114
7234
  let next;
@@ -7151,15 +7271,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7151
7271
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7152
7272
  };
7153
7273
  const render = (vnode, container, namespace) => {
7154
- let instance;
7155
- if (vnode == null) {
7156
- if (container._vnode) {
7157
- unmount(container._vnode, null, null, true);
7158
- instance = container._vnode.component;
7159
- }
7160
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7161
- container._vnode = vnode;
7162
- flushOnAppMount(instance);
7274
+ flushOnAppMount(() => {
7275
+ if (vnode == null) {
7276
+ if (container._vnode) unmount(container._vnode, null, null, true);
7277
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7278
+ container._vnode = vnode;
7279
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
7163
7280
  };
7164
7281
  const internals = {
7165
7282
  p: patch,
@@ -7533,13 +7650,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7533
7650
  registerDep(instance, onResolve) {
7534
7651
  const isInPendingSuspense = !!suspense.pendingBranch;
7535
7652
  if (isInPendingSuspense) suspense.deps++;
7536
- const hydratedEl = instance.vnode && instance.vnode.el;
7537
7653
  instance.asyncDep.catch((err) => {
7538
7654
  handleError(err, instance, 0);
7539
7655
  }).then((asyncSetupResult) => {
7540
7656
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7541
7657
  setCurrentInstance(null, void 0);
7542
- if (hydratedEl && !instance.scope.active) {
7658
+ if (!instance.scope.active) {
7543
7659
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7544
7660
  return;
7545
7661
  }
@@ -7854,7 +7970,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7854
7970
  ctx: vnode.ctx,
7855
7971
  ce: vnode.ce,
7856
7972
  vi: vnode.vi,
7857
- vs: cloneVaporSlotMeta(vnode),
7973
+ vs: cloneVaporSlotMeta(vnode, extraProps),
7858
7974
  vb: vnode.vb,
7859
7975
  ibu: vnode.ibu,
7860
7976
  iu: vnode.iu,
@@ -7864,13 +7980,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7864
7980
  defineLegacyVNodeProperties(cloned);
7865
7981
  return cloned;
7866
7982
  }
7867
- function cloneVaporSlotMeta(vnode) {
7983
+ function cloneVaporSlotMeta(vnode, extraProps) {
7868
7984
  const vaporSlot = vnode.vs;
7869
7985
  if (!vaporSlot) return vaporSlot;
7870
7986
  const cloned = {
7871
7987
  slot: vaporSlot.slot,
7872
- outlets: vaporSlot.outlets
7988
+ outlets: vaporSlot.outlets,
7989
+ props: vaporSlot.props
7873
7990
  };
7991
+ if (vaporSlot.props && extraProps) {
7992
+ let extraSlotProps;
7993
+ for (const key in extraProps) if (key !== "key") {
7994
+ if (!extraSlotProps) extraSlotProps = {};
7995
+ extraSlotProps[key] = extraProps[key];
7996
+ }
7997
+ if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
7998
+ }
7874
7999
  if (vnode.el) {
7875
8000
  cloned.state = vaporSlot.state;
7876
8001
  cloned.ref = vaporSlot.ref;
@@ -8047,6 +8172,9 @@ const useInstanceOption = (key, silent = false) => {
8047
8172
  //#region packages/runtime-core/src/component.ts
8048
8173
  const emptyAppContext = /*@__PURE__*/ createAppContext();
8049
8174
  let uid = 0;
8175
+ function getNextUid() {
8176
+ return uid;
8177
+ }
8050
8178
  function createComponentInstance(vnode, parent, suspense) {
8051
8179
  const type = vnode.type;
8052
8180
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8307,7 +8435,7 @@ function isMemoSame(cached, memo) {
8307
8435
  }
8308
8436
  //#endregion
8309
8437
  //#region packages/runtime-core/src/index.ts
8310
- const version = "3.6.0-rc.11";
8438
+ const version = "3.6.0-rc.12";
8311
8439
  const warn = NOOP;
8312
8440
  /**
8313
8441
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8754,7 +8882,7 @@ function patchStyle(el, prev, next) {
8754
8882
  else el.removeAttribute("style");
8755
8883
  }
8756
8884
  if (vShowOriginalDisplay in el) {
8757
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8885
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8758
8886
  if (el[vShowHidden]) style.display = "none";
8759
8887
  }
8760
8888
  }
@@ -9073,7 +9201,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9073
9201
  this._numberProps = numberProps;
9074
9202
  this._resolveProps(def);
9075
9203
  if (this.shadowRoot) this._applyStyles(styles);
9076
- this._mountComponent(def);
9204
+ if (this._connected) this._mountComponent(def);
9077
9205
  };
9078
9206
  const asyncDef = this._def.__asyncLoader;
9079
9207
  if (asyncDef) {
@@ -9346,6 +9474,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
9346
9474
  const newPositionMap = /* @__PURE__ */ new WeakMap();
9347
9475
  const moveCbKey = Symbol("_moveCb");
9348
9476
  const enterCbKey = Symbol("_enterCb");
9477
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
9349
9478
  /**
9350
9479
  * Wrap logic that modifies TransitionGroup properties in a function
9351
9480
  * so that it can be annotated as pure
@@ -9366,15 +9495,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9366
9495
  const state = useTransitionState();
9367
9496
  let prevChildren;
9368
9497
  let children;
9498
+ let origins;
9499
+ let moves;
9500
+ const willMove = () => {
9501
+ if (moves === void 0) moves = prevChildren.length > 0 && hasCSSTransform(prevChildren[0].el, instance.vnode.el, resolveMoveClass(props));
9502
+ return moves;
9503
+ };
9369
9504
  onUpdated(() => {
9370
- if (!prevChildren.length) return;
9371
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
9372
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
9505
+ pendingGroups.delete(instance);
9506
+ if (!willMove()) {
9373
9507
  prevChildren = [];
9508
+ origins = void 0;
9374
9509
  return;
9375
9510
  }
9511
+ const moveClass = resolveMoveClass(props);
9376
9512
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
9377
- prevChildren.forEach(recordPosition);
9513
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
9514
+ origins = void 0;
9515
+ prevChildren.forEach((c) => recordPosition(c, shift));
9378
9516
  const movedChildren = prevChildren.filter(applyTranslation);
9379
9517
  forceReflow(instance.vnode.el);
9380
9518
  movedChildren.forEach((c) => {
@@ -9389,6 +9527,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9389
9527
  let tag = rawProps.tag || Fragment;
9390
9528
  if (!rawProps.tag && compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT", instance.parent)) tag = "span";
9391
9529
  prevChildren = [];
9530
+ moves = void 0;
9392
9531
  if (children) for (let i = 0; i < children.length; i++) {
9393
9532
  const child = children[i];
9394
9533
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
@@ -9402,6 +9541,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9402
9541
  const child = children[i];
9403
9542
  if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9404
9543
  }
9544
+ if (prevChildren.length) {
9545
+ const root = instance.vnode.el;
9546
+ origins = getOrigins(instance, root);
9547
+ pendingGroups.set(instance, {
9548
+ root,
9549
+ willMove
9550
+ });
9551
+ }
9405
9552
  return createVNode(tag, null, children);
9406
9553
  };
9407
9554
  }
@@ -9410,8 +9557,11 @@ function callPendingCbs(el) {
9410
9557
  if (el[moveCbKey]) el[moveCbKey]();
9411
9558
  if (el[enterCbKey]) el[enterCbKey]();
9412
9559
  }
9413
- function recordPosition(c) {
9414
- newPositionMap.set(c, getPosition(c.el));
9560
+ function resolveMoveClass(props) {
9561
+ return props.moveClass || `${props.name || "v"}-move`;
9562
+ }
9563
+ function recordPosition(c, shift) {
9564
+ newPositionMap.set(c, getPosition(c.el, shift));
9415
9565
  }
9416
9566
  function applyTranslation(c) {
9417
9567
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -9436,13 +9586,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
9436
9586
  }
9437
9587
  return false;
9438
9588
  }
9439
- function getPosition(el) {
9589
+ function getPosition(el, shift) {
9440
9590
  const rect = el.getBoundingClientRect();
9441
9591
  return {
9442
- left: rect.left,
9443
- top: rect.top
9592
+ left: rect.left - (shift ? shift.left : 0),
9593
+ top: rect.top - (shift ? shift.top : 0)
9444
9594
  };
9445
9595
  }
9596
+ function getOrigins(instance, root) {
9597
+ let origins;
9598
+ for (let group = instance.parent; group; group = group.parent) {
9599
+ const pending = pendingGroups.get(group);
9600
+ if (pending) {
9601
+ const item = findItem(pending.root, root);
9602
+ if (item) (origins || (origins = [])).push(extend(getPosition(item), {
9603
+ item,
9604
+ willMove: pending.willMove
9605
+ }));
9606
+ }
9607
+ }
9608
+ return origins;
9609
+ }
9610
+ function findItem(root, node) {
9611
+ const container = root.nodeType === 1 ? root : root.parentNode;
9612
+ while (node && node.parentNode !== container) node = node.parentNode;
9613
+ if (node && node.nodeType === 1) return node;
9614
+ }
9615
+ function getOriginShift(origins, root) {
9616
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
9617
+ return origin && getPosition(origin.item, origin);
9618
+ }
9446
9619
  function hasCSSTransform(el, root, moveClass) {
9447
9620
  const clone = el.cloneNode();
9448
9621
  const _vtc = el[vtcKey];
@@ -11631,7 +11804,7 @@ const errorMessages = {
11631
11804
  [41]: `v-model is missing expression.`,
11632
11805
  [42]: `v-model value must be a valid JavaScript member expression.`,
11633
11806
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
11634
- [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.`,
11807
+ [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.`,
11635
11808
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
11636
11809
  [46]: `Error parsing JavaScript expression: `,
11637
11810
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -13909,7 +14082,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
13909
14082
  ]),
13910
14083
  createCompoundExpression([
13911
14084
  `if (_cached && _cached.el`,
13912
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
14085
+ ...keyExp ? [
14086
+ ` && _cached.key === (`,
14087
+ keyExp,
14088
+ `)`
14089
+ ] : [],
13913
14090
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
13914
14091
  ]),
13915
14092
  createCompoundExpression([`const _item = `, childBlock]),
@@ -15195,6 +15372,34 @@ const transformShow = (dir, node, context) => {
15195
15372
  };
15196
15373
  };
15197
15374
  //#endregion
15375
+ //#region packages/compiler-dom/src/transforms/Transition.ts
15376
+ const transformTransition = (node, context) => {
15377
+ if (node.type === 1 && node.tagType === 1) {
15378
+ if (context.isBuiltInComponent(node.tag) === TRANSITION) return postTransformTransition(node, context.onError);
15379
+ }
15380
+ };
15381
+ function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
15382
+ return () => {
15383
+ if (!node.children.length) return;
15384
+ hasMultipleChildren(node);
15385
+ const child = node.children[0];
15386
+ if (child.type === 1 && !findDir(child, "if")) {
15387
+ for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15388
+ type: 6,
15389
+ name: "persisted",
15390
+ nameLoc: node.loc,
15391
+ value: void 0,
15392
+ loc: node.loc
15393
+ });
15394
+ }
15395
+ };
15396
+ }
15397
+ function defaultHasMultipleChildren(node) {
15398
+ const children = node.children = node.children.filter((c) => !isCommentOrWhitespace(c));
15399
+ const child = children[0];
15400
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
15401
+ }
15402
+ //#endregion
15198
15403
  //#region packages/compiler-dom/src/transforms/stringifyStatic.ts
15199
15404
  /**
15200
15405
  * This module is Node-only.
@@ -15340,7 +15545,7 @@ function stringifyNode(node, context) {
15340
15545
  }
15341
15546
  function stringifyElement(node, context) {
15342
15547
  let res = `<${node.tag}`;
15343
- let innerHTML = "";
15548
+ let innerHTML = void 0;
15344
15549
  for (let i = 0; i < node.props.length; i++) {
15345
15550
  const p = node.props[i];
15346
15551
  if (p.type === 6) {
@@ -15362,13 +15567,15 @@ function stringifyElement(node, context) {
15362
15567
  else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
15363
15568
  res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
15364
15569
  }
15365
- } else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
15366
- else if (p.name === "text") innerHTML = escapeHtml(toDisplayString(evaluateConstant(p.exp)));
15570
+ } else if (p.name === "html") {
15571
+ var _evaluateConstant;
15572
+ innerHTML = (_evaluateConstant = evaluateConstant(p.exp)) !== null && _evaluateConstant !== void 0 ? _evaluateConstant : "";
15573
+ } else if (p.name === "text") innerHTML = escapeHtml(toDisplayString(evaluateConstant(p.exp)));
15367
15574
  }
15368
15575
  }
15369
15576
  if (context.scopeId) res += ` ${context.scopeId}`;
15370
15577
  res += `>`;
15371
- if (innerHTML) res += innerHTML;
15578
+ if (innerHTML !== void 0) res += innerHTML;
15372
15579
  else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
15373
15580
  if (!isVoidTag(node.tag)) res += `</${node.tag}>`;
15374
15581
  return res;
@@ -15393,7 +15600,11 @@ const ignoreSideEffectTags = (node, context) => {
15393
15600
  };
15394
15601
  //#endregion
15395
15602
  //#region packages/compiler-dom/src/index.ts
15396
- const DOMNodeTransforms = [transformStyle, ...[]];
15603
+ const DOMNodeTransforms = [
15604
+ transformStyle,
15605
+ transformTransition,
15606
+ ...[]
15607
+ ];
15397
15608
  const DOMDirectiveTransforms = {
15398
15609
  cloak: noopDirectiveTransform,
15399
15610
  html: transformVHtml,