@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
  **/
@@ -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);
@@ -3140,10 +3200,15 @@ const BaseTransitionPropsValidators = {
3140
3200
  onAfterAppear: TransitionHookValidator,
3141
3201
  onAppearCancelled: TransitionHookValidator
3142
3202
  };
3143
- const recursiveGetSubtree = (instance) => {
3144
- const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
3145
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3146
- };
3203
+ function isEmptyTransitionChild(vnode, instance) {
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
+ }
3209
+ if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3210
+ return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3211
+ }
3147
3212
  const BaseTransitionImpl = {
3148
3213
  name: `BaseTransition`,
3149
3214
  props: BaseTransitionPropsValidators,
@@ -3186,7 +3251,7 @@ function getLeavingNodesForType(state, vnode) {
3186
3251
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3187
3252
  const key = String(vnode.key);
3188
3253
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3189
- return baseResolveTransitionHooks({
3254
+ const hooks = baseResolveTransitionHooks({
3190
3255
  isLeaving: () => leavingVNodesCache[key] === vnode,
3191
3256
  setLeavingNodeCache: () => {
3192
3257
  leavingVNodesCache[key] = vnode;
@@ -3196,7 +3261,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3196
3261
  },
3197
3262
  earlyRemove: () => {
3198
3263
  const leavingVNode = leavingVNodesCache[key];
3199
- 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
+ }
3200
3272
  },
3201
3273
  cloneHooks: (vnode) => {
3202
3274
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -3204,6 +3276,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3204
3276
  return hooks;
3205
3277
  }
3206
3278
  }, props, state, instance);
3279
+ if (vnode.type === VaporSlot) extend(hooks, {
3280
+ __vapor: true,
3281
+ props,
3282
+ state,
3283
+ instance
3284
+ });
3285
+ return hooks;
3207
3286
  }
3208
3287
  function baseResolveTransitionHooks(context, props, state, instance) {
3209
3288
  const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
@@ -3319,7 +3398,7 @@ function prepareTransitionSwitch(previous, next, props, state, instance, resumeA
3319
3398
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
3320
3399
  const mode = props.mode;
3321
3400
  const previousInner = previous && getInnerChild$1(previous);
3322
- if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
3401
+ if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
3323
3402
  const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
3324
3403
  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);
3325
3404
  }
@@ -3383,7 +3462,13 @@ function setTransitionHooks(vnode, hooks) {
3383
3462
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3384
3463
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3385
3464
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3386
- } 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
+ }
3387
3472
  return hooks;
3388
3473
  }
3389
3474
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -3400,6 +3485,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3400
3485
  if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
3401
3486
  return ret;
3402
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
+ }
3403
3496
  //#endregion
3404
3497
  //#region packages/runtime-core/src/apiDefineComponent.ts
3405
3498
  /*@__NO_SIDE_EFFECTS__*/
@@ -3888,14 +3981,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
3888
3981
  break;
3889
3982
  }
3890
3983
  }, opts);
3891
- forEach((el) => {
3892
- if (!(el instanceof Element)) return;
3984
+ const observe = (el) => {
3893
3985
  if (elementIsVisibleInViewport(el)) {
3894
3986
  hydrate();
3895
3987
  ob.disconnect();
3896
3988
  return false;
3897
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
+ }
3898
3993
  ob.observe(el);
3994
+ };
3995
+ forEach((el) => {
3996
+ if (!(el instanceof Element)) return;
3997
+ return observe(el);
3899
3998
  });
3900
3999
  return () => ob.disconnect();
3901
4000
  };
@@ -4148,7 +4247,10 @@ const KeepAliveImpl = {
4148
4247
  function pruneCacheEntry(key) {
4149
4248
  const cached = cache.get(key);
4150
4249
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
4151
- else if (current) resetShapeFlag(current);
4250
+ else if (current) {
4251
+ resetShapeFlag(current);
4252
+ if (cached) resetShapeFlag(cached);
4253
+ }
4152
4254
  cache.delete(key);
4153
4255
  keys.delete(key);
4154
4256
  }
@@ -4622,8 +4724,11 @@ function renderList(source, renderItem, cache, index) {
4622
4724
  ret = new Array(source.length);
4623
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]);
4624
4726
  } else if (typeof source === "number") {
4625
- ret = new Array(source);
4626
- 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
+ }
4627
4732
  } else if (isObject(source)) {
4628
4733
  if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4629
4734
  else {
@@ -4699,6 +4804,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4699
4804
  owner: currentRenderingInstance
4700
4805
  }] : void 0
4701
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
+ }
4702
4812
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4703
4813
  return ret;
4704
4814
  }
@@ -4892,6 +5002,7 @@ function installCompatInstanceProperties(map) {
4892
5002
  const privateAPIs = {
4893
5003
  $vnode: (i) => i.vnode,
4894
5004
  _self: (i) => i.proxy,
5005
+ _setupProxy: (i) => i.setupState,
4895
5006
  _uid: (i) => i.uid,
4896
5007
  _data: (i) => i.data,
4897
5008
  _isMounted: (i) => i.isMounted,
@@ -5487,7 +5598,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5487
5598
  if (options.el) return vm.$mount(options.el);
5488
5599
  else return vm;
5489
5600
  }
5490
- Vue.version = `2.6.14-compat:3.6.0-rc.10`;
5601
+ Vue.version = `2.6.14-compat:3.6.0-rc.12`;
5491
5602
  Vue.config = singletonApp.config;
5492
5603
  Vue.use = (plugin, ...options) => {
5493
5604
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6144,7 +6255,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6144
6255
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
6145
6256
  for (let i = 0; i < nextKeys.length; i++) {
6146
6257
  const key = nextKeys[i];
6147
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6258
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6148
6259
  }
6149
6260
  return false;
6150
6261
  }
@@ -6675,7 +6786,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6675
6786
  for (let i = 0; i < newChildren.length; i++) {
6676
6787
  const oldVNode = oldChildren[i];
6677
6788
  const newVNode = newChildren[i];
6678
- 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;
6679
6791
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6680
6792
  }
6681
6793
  };
@@ -6752,6 +6864,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6752
6864
  if (shouldUpdateComponent(n1, n2, optimized)) {
6753
6865
  if (instance.asyncDep && !instance.asyncResolved) {
6754
6866
  n2.el = n1.el;
6867
+ n2.placeholder = n1.placeholder;
6755
6868
  updateComponentPreRender(instance, n2, optimized);
6756
6869
  return;
6757
6870
  } else {
@@ -6760,6 +6873,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6760
6873
  }
6761
6874
  } else {
6762
6875
  n2.el = n1.el;
6876
+ n2.placeholder = n1.placeholder;
6763
6877
  instance.vnode = n2;
6764
6878
  }
6765
6879
  };
@@ -7090,7 +7204,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7090
7204
  };
7091
7205
  const remove = (vnode) => {
7092
7206
  const { type, el, anchor, transition } = vnode;
7093
- if (type === Fragment) {
7207
+ const isFragment = type === Fragment;
7208
+ if (isFragment && !transition) {
7094
7209
  removeFragment(el, anchor);
7095
7210
  return;
7096
7211
  }
@@ -7099,8 +7214,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7099
7214
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7100
7215
  return;
7101
7216
  }
7102
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
7103
- 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();
7104
7232
  };
7105
7233
  const removeFragment = (cur, end) => {
7106
7234
  let next;
@@ -7143,15 +7271,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7143
7271
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7144
7272
  };
7145
7273
  const render = (vnode, container, namespace) => {
7146
- let instance;
7147
- if (vnode == null) {
7148
- if (container._vnode) {
7149
- unmount(container._vnode, null, null, true);
7150
- instance = container._vnode.component;
7151
- }
7152
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7153
- container._vnode = vnode;
7154
- 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());
7155
7280
  };
7156
7281
  const internals = {
7157
7282
  p: patch,
@@ -7525,13 +7650,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7525
7650
  registerDep(instance, onResolve) {
7526
7651
  const isInPendingSuspense = !!suspense.pendingBranch;
7527
7652
  if (isInPendingSuspense) suspense.deps++;
7528
- const hydratedEl = instance.vnode && instance.vnode.el;
7529
7653
  instance.asyncDep.catch((err) => {
7530
7654
  handleError(err, instance, 0);
7531
7655
  }).then((asyncSetupResult) => {
7532
7656
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7533
7657
  setCurrentInstance(null, void 0);
7534
- if (hydratedEl && !instance.scope.active) {
7658
+ if (!instance.scope.active) {
7535
7659
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7536
7660
  return;
7537
7661
  }
@@ -7846,7 +7970,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7846
7970
  ctx: vnode.ctx,
7847
7971
  ce: vnode.ce,
7848
7972
  vi: vnode.vi,
7849
- vs: cloneVaporSlotMeta(vnode),
7973
+ vs: cloneVaporSlotMeta(vnode, extraProps),
7850
7974
  vb: vnode.vb,
7851
7975
  ibu: vnode.ibu,
7852
7976
  iu: vnode.iu,
@@ -7856,13 +7980,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7856
7980
  defineLegacyVNodeProperties(cloned);
7857
7981
  return cloned;
7858
7982
  }
7859
- function cloneVaporSlotMeta(vnode) {
7983
+ function cloneVaporSlotMeta(vnode, extraProps) {
7860
7984
  const vaporSlot = vnode.vs;
7861
7985
  if (!vaporSlot) return vaporSlot;
7862
7986
  const cloned = {
7863
7987
  slot: vaporSlot.slot,
7864
- outlets: vaporSlot.outlets
7988
+ outlets: vaporSlot.outlets,
7989
+ props: vaporSlot.props
7865
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
+ }
7866
7999
  if (vnode.el) {
7867
8000
  cloned.state = vaporSlot.state;
7868
8001
  cloned.ref = vaporSlot.ref;
@@ -8039,6 +8172,9 @@ const useInstanceOption = (key, silent = false) => {
8039
8172
  //#region packages/runtime-core/src/component.ts
8040
8173
  const emptyAppContext = /*@__PURE__*/ createAppContext();
8041
8174
  let uid = 0;
8175
+ function getNextUid() {
8176
+ return uid;
8177
+ }
8042
8178
  function createComponentInstance(vnode, parent, suspense) {
8043
8179
  const type = vnode.type;
8044
8180
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8299,7 +8435,7 @@ function isMemoSame(cached, memo) {
8299
8435
  }
8300
8436
  //#endregion
8301
8437
  //#region packages/runtime-core/src/index.ts
8302
- const version = "3.6.0-rc.10";
8438
+ const version = "3.6.0-rc.12";
8303
8439
  const warn = NOOP;
8304
8440
  /**
8305
8441
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8746,7 +8882,7 @@ function patchStyle(el, prev, next) {
8746
8882
  else el.removeAttribute("style");
8747
8883
  }
8748
8884
  if (vShowOriginalDisplay in el) {
8749
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8885
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8750
8886
  if (el[vShowHidden]) style.display = "none";
8751
8887
  }
8752
8888
  }
@@ -9065,7 +9201,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9065
9201
  this._numberProps = numberProps;
9066
9202
  this._resolveProps(def);
9067
9203
  if (this.shadowRoot) this._applyStyles(styles);
9068
- this._mountComponent(def);
9204
+ if (this._connected) this._mountComponent(def);
9069
9205
  };
9070
9206
  const asyncDef = this._def.__asyncLoader;
9071
9207
  if (asyncDef) {
@@ -9338,6 +9474,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
9338
9474
  const newPositionMap = /* @__PURE__ */ new WeakMap();
9339
9475
  const moveCbKey = Symbol("_moveCb");
9340
9476
  const enterCbKey = Symbol("_enterCb");
9477
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
9341
9478
  /**
9342
9479
  * Wrap logic that modifies TransitionGroup properties in a function
9343
9480
  * so that it can be annotated as pure
@@ -9358,15 +9495,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9358
9495
  const state = useTransitionState();
9359
9496
  let prevChildren;
9360
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
+ };
9361
9504
  onUpdated(() => {
9362
- if (!prevChildren.length) return;
9363
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
9364
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
9505
+ pendingGroups.delete(instance);
9506
+ if (!willMove()) {
9365
9507
  prevChildren = [];
9508
+ origins = void 0;
9366
9509
  return;
9367
9510
  }
9511
+ const moveClass = resolveMoveClass(props);
9368
9512
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
9369
- prevChildren.forEach(recordPosition);
9513
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
9514
+ origins = void 0;
9515
+ prevChildren.forEach((c) => recordPosition(c, shift));
9370
9516
  const movedChildren = prevChildren.filter(applyTranslation);
9371
9517
  forceReflow(instance.vnode.el);
9372
9518
  movedChildren.forEach((c) => {
@@ -9381,6 +9527,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9381
9527
  let tag = rawProps.tag || Fragment;
9382
9528
  if (!rawProps.tag && compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT", instance.parent)) tag = "span";
9383
9529
  prevChildren = [];
9530
+ moves = void 0;
9384
9531
  if (children) for (let i = 0; i < children.length; i++) {
9385
9532
  const child = children[i];
9386
9533
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
@@ -9394,6 +9541,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9394
9541
  const child = children[i];
9395
9542
  if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9396
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
+ }
9397
9552
  return createVNode(tag, null, children);
9398
9553
  };
9399
9554
  }
@@ -9402,8 +9557,11 @@ function callPendingCbs(el) {
9402
9557
  if (el[moveCbKey]) el[moveCbKey]();
9403
9558
  if (el[enterCbKey]) el[enterCbKey]();
9404
9559
  }
9405
- function recordPosition(c) {
9406
- 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));
9407
9565
  }
9408
9566
  function applyTranslation(c) {
9409
9567
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -9428,13 +9586,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
9428
9586
  }
9429
9587
  return false;
9430
9588
  }
9431
- function getPosition(el) {
9589
+ function getPosition(el, shift) {
9432
9590
  const rect = el.getBoundingClientRect();
9433
9591
  return {
9434
- left: rect.left,
9435
- top: rect.top
9592
+ left: rect.left - (shift ? shift.left : 0),
9593
+ top: rect.top - (shift ? shift.top : 0)
9436
9594
  };
9437
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
+ }
9438
9619
  function hasCSSTransform(el, root, moveClass) {
9439
9620
  const clone = el.cloneNode();
9440
9621
  const _vtc = el[vtcKey];
@@ -11623,7 +11804,7 @@ const errorMessages = {
11623
11804
  [41]: `v-model is missing expression.`,
11624
11805
  [42]: `v-model value must be a valid JavaScript member expression.`,
11625
11806
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
11626
- [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.`,
11627
11808
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
11628
11809
  [46]: `Error parsing JavaScript expression: `,
11629
11810
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -13901,7 +14082,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
13901
14082
  ]),
13902
14083
  createCompoundExpression([
13903
14084
  `if (_cached && _cached.el`,
13904
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
14085
+ ...keyExp ? [
14086
+ ` && _cached.key === (`,
14087
+ keyExp,
14088
+ `)`
14089
+ ] : [],
13905
14090
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
13906
14091
  ]),
13907
14092
  createCompoundExpression([`const _item = `, childBlock]),
@@ -15187,6 +15372,34 @@ const transformShow = (dir, node, context) => {
15187
15372
  };
15188
15373
  };
15189
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
15190
15403
  //#region packages/compiler-dom/src/transforms/stringifyStatic.ts
15191
15404
  /**
15192
15405
  * This module is Node-only.
@@ -15332,7 +15545,7 @@ function stringifyNode(node, context) {
15332
15545
  }
15333
15546
  function stringifyElement(node, context) {
15334
15547
  let res = `<${node.tag}`;
15335
- let innerHTML = "";
15548
+ let innerHTML = void 0;
15336
15549
  for (let i = 0; i < node.props.length; i++) {
15337
15550
  const p = node.props[i];
15338
15551
  if (p.type === 6) {
@@ -15354,13 +15567,15 @@ function stringifyElement(node, context) {
15354
15567
  else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
15355
15568
  res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
15356
15569
  }
15357
- } else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
15358
- 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)));
15359
15574
  }
15360
15575
  }
15361
15576
  if (context.scopeId) res += ` ${context.scopeId}`;
15362
15577
  res += `>`;
15363
- if (innerHTML) res += innerHTML;
15578
+ if (innerHTML !== void 0) res += innerHTML;
15364
15579
  else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
15365
15580
  if (!isVoidTag(node.tag)) res += `</${node.tag}>`;
15366
15581
  return res;
@@ -15385,7 +15600,11 @@ const ignoreSideEffectTags = (node, context) => {
15385
15600
  };
15386
15601
  //#endregion
15387
15602
  //#region packages/compiler-dom/src/index.ts
15388
- const DOMNodeTransforms = [transformStyle, ...[]];
15603
+ const DOMNodeTransforms = [
15604
+ transformStyle,
15605
+ transformTransition,
15606
+ ...[]
15607
+ ];
15389
15608
  const DOMDirectiveTransforms = {
15390
15609
  cloak: noopDirectiveTransform,
15391
15610
  html: transformVHtml,