@vue/runtime-dom 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.
- package/dist/runtime-dom.cjs.js +57 -12
- package/dist/runtime-dom.cjs.prod.js +57 -12
- package/dist/runtime-dom.esm-browser.js +240 -75
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +58 -13
- package/dist/runtime-dom.global.js +240 -75
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -221,9 +221,10 @@ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
|
|
|
221
221
|
* - ismap -> isMap
|
|
222
222
|
* - nomodule -> noModule
|
|
223
223
|
* - novalidate -> noValidate
|
|
224
|
+
* - playsinline -> playsInline
|
|
224
225
|
* - readonly -> readOnly
|
|
225
226
|
*/
|
|
226
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
227
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
227
228
|
const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
|
|
228
229
|
/**
|
|
229
230
|
* The full list is needed during SSR to produce the correct initial markup.
|
|
@@ -914,17 +915,33 @@ const arrayInstrumentations = {
|
|
|
914
915
|
};
|
|
915
916
|
function iterator(self, method, wrapValue) {
|
|
916
917
|
const arr = shallowReadArray(self);
|
|
917
|
-
const
|
|
918
|
+
const methodFn = arr[method];
|
|
919
|
+
const iter = methodFn.call(arr);
|
|
918
920
|
if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
|
|
921
|
+
if (iter[Symbol.toStringTag] === "Array Iterator") {
|
|
922
|
+
const wrapped = Object.create(Object.getPrototypeOf(iter));
|
|
923
|
+
wrapped.next = () => wrapResult(iter.next(), wrapValue);
|
|
924
|
+
if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
|
|
925
|
+
return: { get() {
|
|
926
|
+
const fn = iter.return;
|
|
927
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
928
|
+
} },
|
|
929
|
+
throw: { get() {
|
|
930
|
+
const fn = iter.throw;
|
|
931
|
+
return typeof fn === "function" ? fn.bind(iter) : fn;
|
|
932
|
+
} }
|
|
933
|
+
});
|
|
934
|
+
return wrapped;
|
|
935
|
+
}
|
|
919
936
|
iter._next = iter.next;
|
|
920
|
-
iter.next = () =>
|
|
921
|
-
const result = iter._next();
|
|
922
|
-
if (!result.done) result.value = wrapValue(result.value);
|
|
923
|
-
return result;
|
|
924
|
-
};
|
|
937
|
+
iter.next = () => wrapResult(iter._next(), wrapValue);
|
|
925
938
|
}
|
|
926
939
|
return iter;
|
|
927
940
|
}
|
|
941
|
+
function wrapResult(result, wrapValue) {
|
|
942
|
+
if (!result.done) result.value = wrapValue(result.value);
|
|
943
|
+
return result;
|
|
944
|
+
}
|
|
928
945
|
const arrayProto = Array.prototype;
|
|
929
946
|
function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
930
947
|
const arr = shallowReadArray(self);
|
|
@@ -1242,6 +1259,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
|
|
|
1242
1259
|
return (target, key, receiver) => {
|
|
1243
1260
|
if (key === "__v_isReactive") return !isReadonly;
|
|
1244
1261
|
else if (key === "__v_isReadonly") return isReadonly;
|
|
1262
|
+
else if (key === "__v_isShallow") return shallow;
|
|
1245
1263
|
else if (key === "__v_raw") return target;
|
|
1246
1264
|
return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
|
|
1247
1265
|
};
|
|
@@ -2151,8 +2169,9 @@ function getCurrentWatcher() {
|
|
|
2151
2169
|
function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
|
|
2152
2170
|
if (owner) {
|
|
2153
2171
|
const { call } = owner.options;
|
|
2154
|
-
|
|
2155
|
-
|
|
2172
|
+
const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
|
|
2173
|
+
if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
|
|
2174
|
+
else owner.cleanups[owner.cleanupsLength++] = cleanup;
|
|
2156
2175
|
} else if (!failSilently) warn$2("onWatcherCleanup() was called when there was no active watcher to associate with.");
|
|
2157
2176
|
}
|
|
2158
2177
|
var WatcherEffect = class extends ReactiveEffect {
|
|
@@ -2213,9 +2232,11 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2213
2232
|
if (once && cb) {
|
|
2214
2233
|
const _cb = cb;
|
|
2215
2234
|
cb = (...args) => {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2235
|
+
try {
|
|
2236
|
+
return _cb(...args);
|
|
2237
|
+
} finally {
|
|
2238
|
+
this.stop();
|
|
2239
|
+
}
|
|
2219
2240
|
};
|
|
2220
2241
|
}
|
|
2221
2242
|
this.cb = cb;
|
|
@@ -2223,6 +2244,19 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2223
2244
|
this.onTrack = options.onTrack;
|
|
2224
2245
|
this.onTrigger = options.onTrigger;
|
|
2225
2246
|
}
|
|
2247
|
+
cleanupCallback() {
|
|
2248
|
+
const cleanups = this.cbCleanups;
|
|
2249
|
+
if (cleanups) {
|
|
2250
|
+
this.cbCleanups = void 0;
|
|
2251
|
+
for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
stop() {
|
|
2255
|
+
if (this.active) {
|
|
2256
|
+
super.stop();
|
|
2257
|
+
this.cleanupCallback();
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2226
2260
|
run(initialRun = false) {
|
|
2227
2261
|
const oldValue = this.oldValue;
|
|
2228
2262
|
const newValue = this.oldValue = super.run();
|
|
@@ -2230,10 +2264,11 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2230
2264
|
const { immediate, deep, call } = this.options;
|
|
2231
2265
|
if (initialRun && !immediate) return;
|
|
2232
2266
|
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2233
|
-
cleanup(this);
|
|
2234
2267
|
const currentWatcher = activeWatcher;
|
|
2235
|
-
|
|
2268
|
+
const prevSub = setActiveSub();
|
|
2236
2269
|
try {
|
|
2270
|
+
this.cleanupCallback();
|
|
2271
|
+
activeWatcher = this;
|
|
2237
2272
|
const args = [
|
|
2238
2273
|
newValue,
|
|
2239
2274
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -2242,6 +2277,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2242
2277
|
call ? call(this.cb, 3, args) : this.cb(...args);
|
|
2243
2278
|
} finally {
|
|
2244
2279
|
activeWatcher = currentWatcher;
|
|
2280
|
+
setActiveSub(prevSub);
|
|
2245
2281
|
}
|
|
2246
2282
|
}
|
|
2247
2283
|
}
|
|
@@ -2572,15 +2608,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
2572
2608
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
2573
2609
|
queueFlush();
|
|
2574
2610
|
}
|
|
2575
|
-
function flushPreFlushCbs(instance, seen) {
|
|
2611
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
2576
2612
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2577
2613
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
2578
2614
|
const cb = jobs[i];
|
|
2579
2615
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
2580
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
2616
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
2581
2617
|
if (checkRecursiveUpdates(seen, cb)) continue;
|
|
2582
2618
|
jobs.splice(i, 1);
|
|
2583
|
-
i
|
|
2619
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
2584
2620
|
jobsLength--;
|
|
2585
2621
|
if (cb.flags & 2) cb.flags &= -2;
|
|
2586
2622
|
try {
|
|
@@ -2590,15 +2626,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
2590
2626
|
}
|
|
2591
2627
|
}
|
|
2592
2628
|
}
|
|
2593
|
-
function flushPostFlushCbs(seen) {
|
|
2629
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
2594
2630
|
if (postJobs.length) {
|
|
2631
|
+
let cbs = postJobs;
|
|
2632
|
+
if (skip) {
|
|
2633
|
+
cbs = [];
|
|
2634
|
+
let kept = 0;
|
|
2635
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
2636
|
+
const cb = postJobs[i];
|
|
2637
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
2638
|
+
else cbs.push(cb);
|
|
2639
|
+
}
|
|
2640
|
+
postJobs.length = kept;
|
|
2641
|
+
} else postJobs = [];
|
|
2595
2642
|
if (activePostJobs) {
|
|
2596
|
-
for (let i = 0; i <
|
|
2597
|
-
postJobs.length = 0;
|
|
2643
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
2598
2644
|
return;
|
|
2599
2645
|
}
|
|
2600
|
-
activePostJobs =
|
|
2601
|
-
postJobs = [];
|
|
2646
|
+
activePostJobs = cbs;
|
|
2602
2647
|
seen = seen || /* @__PURE__ */ new Map();
|
|
2603
2648
|
try {
|
|
2604
2649
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -2620,17 +2665,28 @@ function flushPostFlushCbs(seen) {
|
|
|
2620
2665
|
}
|
|
2621
2666
|
let isFlushing = false;
|
|
2622
2667
|
/**
|
|
2668
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
2669
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
2670
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
2671
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
2672
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
2673
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
2674
|
+
*
|
|
2623
2675
|
* @internal
|
|
2624
2676
|
*/
|
|
2625
|
-
function flushOnAppMount(
|
|
2626
|
-
if (
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2677
|
+
function flushOnAppMount(fn, minUid) {
|
|
2678
|
+
if (isFlushing) {
|
|
2679
|
+
fn();
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
2683
|
+
fn();
|
|
2684
|
+
isFlushing = true;
|
|
2685
|
+
try {
|
|
2686
|
+
flushPreFlushCbs(void 0, minUid);
|
|
2687
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
2688
|
+
} finally {
|
|
2689
|
+
isFlushing = false;
|
|
2634
2690
|
}
|
|
2635
2691
|
}
|
|
2636
2692
|
function flushJobs(seen) {
|
|
@@ -3098,7 +3154,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
|
|
|
3098
3154
|
this.flags |= 128;
|
|
3099
3155
|
job.flags |= 2;
|
|
3100
3156
|
}
|
|
3101
|
-
|
|
3157
|
+
job.i = instance;
|
|
3102
3158
|
this.job = job;
|
|
3103
3159
|
}
|
|
3104
3160
|
notify() {
|
|
@@ -3291,7 +3347,11 @@ const TeleportImpl = {
|
|
|
3291
3347
|
hydrate: hydrateTeleport
|
|
3292
3348
|
};
|
|
3293
3349
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
3294
|
-
if (moveType === 0)
|
|
3350
|
+
if (moveType === 0) {
|
|
3351
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
3352
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
3353
|
+
parentAnchor = vnode.targetAnchor;
|
|
3354
|
+
}
|
|
3295
3355
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
3296
3356
|
const isReorder = moveType === 2;
|
|
3297
3357
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -3412,6 +3472,10 @@ const BaseTransitionPropsValidators = {
|
|
|
3412
3472
|
};
|
|
3413
3473
|
function isEmptyTransitionChild(vnode, instance) {
|
|
3414
3474
|
if (vnode.type === Comment) return true;
|
|
3475
|
+
if (vnode.type === Fragment) {
|
|
3476
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
3477
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
3478
|
+
}
|
|
3415
3479
|
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
3416
3480
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
3417
3481
|
}
|
|
@@ -3472,7 +3536,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3472
3536
|
},
|
|
3473
3537
|
earlyRemove: () => {
|
|
3474
3538
|
const leavingVNode = leavingVNodesCache[key];
|
|
3475
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
3539
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
3540
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
3541
|
+
if (!leavingCb) {
|
|
3542
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
3543
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
3544
|
+
}
|
|
3545
|
+
if (leavingCb) leavingCb();
|
|
3546
|
+
}
|
|
3476
3547
|
},
|
|
3477
3548
|
cloneHooks: (vnode) => {
|
|
3478
3549
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -3666,7 +3737,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3666
3737
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
3667
3738
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
3668
3739
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
3669
|
-
} else
|
|
3740
|
+
} else {
|
|
3741
|
+
vnode.transition = hooks;
|
|
3742
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
3743
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
3744
|
+
if (child) setTransitionHooks(child, hooks);
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3670
3747
|
return hooks;
|
|
3671
3748
|
}
|
|
3672
3749
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -3689,6 +3766,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
3689
3766
|
function checkTransitionMode(mode) {
|
|
3690
3767
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
3691
3768
|
}
|
|
3769
|
+
function getTransitionRoot(vnode) {
|
|
3770
|
+
if (vnode.component && !isVaporComponent(vnode.type)) return getTransitionRoot(vnode.component.subTree);
|
|
3771
|
+
if (vnode.type === Fragment) {
|
|
3772
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
3773
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
3774
|
+
}
|
|
3775
|
+
if (vnode.type !== Comment) return vnode;
|
|
3776
|
+
}
|
|
3692
3777
|
//#endregion
|
|
3693
3778
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
3694
3779
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -4318,14 +4403,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
4318
4403
|
break;
|
|
4319
4404
|
}
|
|
4320
4405
|
}, opts);
|
|
4321
|
-
|
|
4322
|
-
if (!(el instanceof Element)) return;
|
|
4406
|
+
const observe = (el) => {
|
|
4323
4407
|
if (elementIsVisibleInViewport(el)) {
|
|
4324
4408
|
hydrate();
|
|
4325
4409
|
ob.disconnect();
|
|
4326
4410
|
return false;
|
|
4327
4411
|
}
|
|
4412
|
+
if (getComputedStyle(el).display === "contents") {
|
|
4413
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
4414
|
+
}
|
|
4328
4415
|
ob.observe(el);
|
|
4416
|
+
};
|
|
4417
|
+
forEach((el) => {
|
|
4418
|
+
if (!(el instanceof Element)) return;
|
|
4419
|
+
return observe(el);
|
|
4329
4420
|
});
|
|
4330
4421
|
return () => ob.disconnect();
|
|
4331
4422
|
};
|
|
@@ -4583,7 +4674,10 @@ const KeepAlive = {
|
|
|
4583
4674
|
function pruneCacheEntry(key) {
|
|
4584
4675
|
const cached = cache.get(key);
|
|
4585
4676
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
4586
|
-
else if (current)
|
|
4677
|
+
else if (current) {
|
|
4678
|
+
resetShapeFlag(current);
|
|
4679
|
+
if (cached) resetShapeFlag(cached);
|
|
4680
|
+
}
|
|
4587
4681
|
cache.delete(key);
|
|
4588
4682
|
keys.delete(key);
|
|
4589
4683
|
}
|
|
@@ -4910,6 +5004,11 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
4910
5004
|
owner: currentRenderingInstance
|
|
4911
5005
|
}] : void 0
|
|
4912
5006
|
};
|
|
5007
|
+
if (branchKey != null && props.key == null) {
|
|
5008
|
+
ret.vs.props = ret.props;
|
|
5009
|
+
ret.props = extend({}, ret.props, { key: branchKey });
|
|
5010
|
+
ret.key = branchKey;
|
|
5011
|
+
}
|
|
4913
5012
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4914
5013
|
return ret;
|
|
4915
5014
|
}
|
|
@@ -6101,7 +6200,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
6101
6200
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
6102
6201
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
6103
6202
|
const key = nextKeys[i];
|
|
6104
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
6203
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
6105
6204
|
}
|
|
6106
6205
|
return false;
|
|
6107
6206
|
}
|
|
@@ -6792,7 +6891,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6792
6891
|
for (let i = 0; i < newChildren.length; i++) {
|
|
6793
6892
|
const oldVNode = oldChildren[i];
|
|
6794
6893
|
const newVNode = newChildren[i];
|
|
6795
|
-
const
|
|
6894
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
6895
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
6796
6896
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
6797
6897
|
}
|
|
6798
6898
|
};
|
|
@@ -6884,6 +6984,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6884
6984
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
6885
6985
|
pushWarningContext(n2);
|
|
6886
6986
|
n2.el = n1.el;
|
|
6987
|
+
n2.placeholder = n1.placeholder;
|
|
6887
6988
|
updateComponentPreRender(instance, n2, optimized);
|
|
6888
6989
|
popWarningContext();
|
|
6889
6990
|
return;
|
|
@@ -6893,6 +6994,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6893
6994
|
}
|
|
6894
6995
|
} else {
|
|
6895
6996
|
n2.el = n1.el;
|
|
6997
|
+
n2.placeholder = n1.placeholder;
|
|
6896
6998
|
instance.vnode = n2;
|
|
6897
6999
|
}
|
|
6898
7000
|
};
|
|
@@ -7237,12 +7339,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7237
7339
|
};
|
|
7238
7340
|
const remove = (vnode) => {
|
|
7239
7341
|
const { type, el, anchor, transition } = vnode;
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
else remove(child);
|
|
7244
|
-
});
|
|
7245
|
-
else removeFragment(el, anchor);
|
|
7342
|
+
const isFragment = type === Fragment;
|
|
7343
|
+
if (isFragment && !transition) {
|
|
7344
|
+
removeFragment(el, anchor);
|
|
7246
7345
|
return;
|
|
7247
7346
|
}
|
|
7248
7347
|
if (type === Static) {
|
|
@@ -7250,8 +7349,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7250
7349
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
7251
7350
|
return;
|
|
7252
7351
|
}
|
|
7253
|
-
|
|
7254
|
-
|
|
7352
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
7353
|
+
const performRemove = () => {
|
|
7354
|
+
if (isFragment) {
|
|
7355
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
7356
|
+
} else hostRemove(el);
|
|
7357
|
+
};
|
|
7358
|
+
if (transition) {
|
|
7359
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
7360
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
7361
|
+
if (isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
7362
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
7363
|
+
isElement = !!leavingEl;
|
|
7364
|
+
}
|
|
7365
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
7366
|
+
} else performRemove();
|
|
7255
7367
|
};
|
|
7256
7368
|
const removeFragment = (cur, end) => {
|
|
7257
7369
|
let next;
|
|
@@ -7294,15 +7406,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7294
7406
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
7295
7407
|
};
|
|
7296
7408
|
const render = (vnode, container, namespace) => {
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
7304
|
-
container._vnode = vnode;
|
|
7305
|
-
flushOnAppMount(instance);
|
|
7409
|
+
flushOnAppMount(() => {
|
|
7410
|
+
if (vnode == null) {
|
|
7411
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
7412
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
7413
|
+
container._vnode = vnode;
|
|
7414
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
7306
7415
|
};
|
|
7307
7416
|
const internals = {
|
|
7308
7417
|
p: patch,
|
|
@@ -7695,13 +7804,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7695
7804
|
registerDep(instance, onResolve) {
|
|
7696
7805
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7697
7806
|
if (isInPendingSuspense) suspense.deps++;
|
|
7698
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
7699
7807
|
instance.asyncDep.catch((err) => {
|
|
7700
7808
|
handleError(err, instance, 0);
|
|
7701
7809
|
}).then((asyncSetupResult) => {
|
|
7702
7810
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7703
7811
|
setCurrentInstance(null, void 0);
|
|
7704
|
-
if (
|
|
7812
|
+
if (!instance.scope.active) {
|
|
7705
7813
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
7706
7814
|
return;
|
|
7707
7815
|
}
|
|
@@ -8014,7 +8122,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
8014
8122
|
ctx: vnode.ctx,
|
|
8015
8123
|
ce: vnode.ce,
|
|
8016
8124
|
vi: vnode.vi,
|
|
8017
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
8125
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
8018
8126
|
vb: vnode.vb,
|
|
8019
8127
|
ibu: vnode.ibu,
|
|
8020
8128
|
iu: vnode.iu,
|
|
@@ -8023,13 +8131,22 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
8023
8131
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
8024
8132
|
return cloned;
|
|
8025
8133
|
}
|
|
8026
|
-
function cloneVaporSlotMeta(vnode) {
|
|
8134
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
8027
8135
|
const vaporSlot = vnode.vs;
|
|
8028
8136
|
if (!vaporSlot) return vaporSlot;
|
|
8029
8137
|
const cloned = {
|
|
8030
8138
|
slot: vaporSlot.slot,
|
|
8031
|
-
outlets: vaporSlot.outlets
|
|
8139
|
+
outlets: vaporSlot.outlets,
|
|
8140
|
+
props: vaporSlot.props
|
|
8032
8141
|
};
|
|
8142
|
+
if (vaporSlot.props && extraProps) {
|
|
8143
|
+
let extraSlotProps;
|
|
8144
|
+
for (const key in extraProps) if (key !== "key") {
|
|
8145
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
8146
|
+
extraSlotProps[key] = extraProps[key];
|
|
8147
|
+
}
|
|
8148
|
+
if (extraSlotProps) cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
8149
|
+
}
|
|
8033
8150
|
if (vnode.el) {
|
|
8034
8151
|
cloned.state = vaporSlot.state;
|
|
8035
8152
|
cloned.ref = vaporSlot.ref;
|
|
@@ -8212,6 +8329,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
8212
8329
|
//#region packages/runtime-core/src/component.ts
|
|
8213
8330
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
8214
8331
|
let uid = 0;
|
|
8332
|
+
function getNextUid() {
|
|
8333
|
+
return uid;
|
|
8334
|
+
}
|
|
8215
8335
|
function createComponentInstance(vnode, parent, suspense) {
|
|
8216
8336
|
const type = vnode.type;
|
|
8217
8337
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
@@ -8716,7 +8836,7 @@ function isMemoSame(cached, memo) {
|
|
|
8716
8836
|
}
|
|
8717
8837
|
//#endregion
|
|
8718
8838
|
//#region packages/runtime-core/src/index.ts
|
|
8719
|
-
const version = "3.6.0-rc.
|
|
8839
|
+
const version = "3.6.0-rc.12";
|
|
8720
8840
|
const warn = warn$1;
|
|
8721
8841
|
/**
|
|
8722
8842
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9199,7 +9319,7 @@ function patchStyle(el, prev, next) {
|
|
|
9199
9319
|
else el.removeAttribute("style");
|
|
9200
9320
|
}
|
|
9201
9321
|
if (vShowOriginalDisplay in el) {
|
|
9202
|
-
el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
9322
|
+
if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
|
|
9203
9323
|
if (el[vShowHidden]) style.display = "none";
|
|
9204
9324
|
}
|
|
9205
9325
|
}
|
|
@@ -9504,7 +9624,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
|
|
|
9504
9624
|
this._resolveProps(def);
|
|
9505
9625
|
if (this.shadowRoot) this._applyStyles(styles);
|
|
9506
9626
|
else if (styles) warn("Custom element style injection is not supported when using shadowRoot: false");
|
|
9507
|
-
this._mountComponent(def);
|
|
9627
|
+
if (this._connected) this._mountComponent(def);
|
|
9508
9628
|
};
|
|
9509
9629
|
const asyncDef = this._def.__asyncLoader;
|
|
9510
9630
|
if (asyncDef) {
|
|
@@ -9822,6 +9942,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
|
|
|
9822
9942
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
9823
9943
|
const moveCbKey = Symbol("_moveCb");
|
|
9824
9944
|
const enterCbKey = Symbol("_enterCb");
|
|
9945
|
+
const pendingGroups = /* @__PURE__ */ new WeakMap();
|
|
9825
9946
|
/**
|
|
9826
9947
|
* Wrap logic that modifies TransitionGroup properties in a function
|
|
9827
9948
|
* so that it can be annotated as pure
|
|
@@ -9841,15 +9962,24 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
9841
9962
|
const state = useTransitionState();
|
|
9842
9963
|
let prevChildren;
|
|
9843
9964
|
let children;
|
|
9965
|
+
let origins;
|
|
9966
|
+
let moves;
|
|
9967
|
+
const willMove = () => {
|
|
9968
|
+
if (moves === void 0) moves = prevChildren.length > 0 && hasCSSTransform(prevChildren[0].el, instance.vnode.el, resolveMoveClass(props));
|
|
9969
|
+
return moves;
|
|
9970
|
+
};
|
|
9844
9971
|
onUpdated(() => {
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
|
|
9972
|
+
pendingGroups.delete(instance);
|
|
9973
|
+
if (!willMove()) {
|
|
9848
9974
|
prevChildren = [];
|
|
9975
|
+
origins = void 0;
|
|
9849
9976
|
return;
|
|
9850
9977
|
}
|
|
9978
|
+
const moveClass = resolveMoveClass(props);
|
|
9851
9979
|
prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
|
|
9852
|
-
|
|
9980
|
+
const shift = origins && getOriginShift(origins, instance.vnode.el);
|
|
9981
|
+
origins = void 0;
|
|
9982
|
+
prevChildren.forEach((c) => recordPosition(c, shift));
|
|
9853
9983
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
9854
9984
|
forceReflow(instance.vnode.el);
|
|
9855
9985
|
movedChildren.forEach((c) => {
|
|
@@ -9863,6 +9993,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
9863
9993
|
const cssTransitionProps = resolveTransitionProps(rawProps);
|
|
9864
9994
|
let tag = rawProps.tag || Fragment;
|
|
9865
9995
|
prevChildren = [];
|
|
9996
|
+
moves = void 0;
|
|
9866
9997
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9867
9998
|
const child = children[i];
|
|
9868
9999
|
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
@@ -9877,6 +10008,14 @@ const TransitionGroup = /* @__PURE__ */ decorate({
|
|
|
9877
10008
|
if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9878
10009
|
else if (child.type !== Text) warn(`<TransitionGroup> children must be keyed.`);
|
|
9879
10010
|
}
|
|
10011
|
+
if (prevChildren.length) {
|
|
10012
|
+
const root = instance.vnode.el;
|
|
10013
|
+
origins = getOrigins(instance, root);
|
|
10014
|
+
pendingGroups.set(instance, {
|
|
10015
|
+
root,
|
|
10016
|
+
willMove
|
|
10017
|
+
});
|
|
10018
|
+
}
|
|
9880
10019
|
return createVNode(tag, null, children);
|
|
9881
10020
|
};
|
|
9882
10021
|
}
|
|
@@ -9885,8 +10024,11 @@ function callPendingCbs(el) {
|
|
|
9885
10024
|
if (el[moveCbKey]) el[moveCbKey]();
|
|
9886
10025
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
9887
10026
|
}
|
|
9888
|
-
function
|
|
9889
|
-
|
|
10027
|
+
function resolveMoveClass(props) {
|
|
10028
|
+
return props.moveClass || `${props.name || "v"}-move`;
|
|
10029
|
+
}
|
|
10030
|
+
function recordPosition(c, shift) {
|
|
10031
|
+
newPositionMap.set(c, getPosition(c.el, shift));
|
|
9890
10032
|
}
|
|
9891
10033
|
function applyTranslation(c) {
|
|
9892
10034
|
if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
|
|
@@ -9911,13 +10053,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
|
|
|
9911
10053
|
}
|
|
9912
10054
|
return false;
|
|
9913
10055
|
}
|
|
9914
|
-
function getPosition(el) {
|
|
10056
|
+
function getPosition(el, shift) {
|
|
9915
10057
|
const rect = el.getBoundingClientRect();
|
|
9916
10058
|
return {
|
|
9917
|
-
left: rect.left,
|
|
9918
|
-
top: rect.top
|
|
10059
|
+
left: rect.left - (shift ? shift.left : 0),
|
|
10060
|
+
top: rect.top - (shift ? shift.top : 0)
|
|
9919
10061
|
};
|
|
9920
10062
|
}
|
|
10063
|
+
function getOrigins(instance, root) {
|
|
10064
|
+
let origins;
|
|
10065
|
+
for (let group = instance.parent; group; group = group.parent) {
|
|
10066
|
+
const pending = pendingGroups.get(group);
|
|
10067
|
+
if (pending) {
|
|
10068
|
+
const item = findItem(pending.root, root);
|
|
10069
|
+
if (item) (origins || (origins = [])).push(extend(getPosition(item), {
|
|
10070
|
+
item,
|
|
10071
|
+
willMove: pending.willMove
|
|
10072
|
+
}));
|
|
10073
|
+
}
|
|
10074
|
+
}
|
|
10075
|
+
return origins;
|
|
10076
|
+
}
|
|
10077
|
+
function findItem(root, node) {
|
|
10078
|
+
const container = root.nodeType === 1 ? root : root.parentNode;
|
|
10079
|
+
while (node && node.parentNode !== container) node = node.parentNode;
|
|
10080
|
+
if (node && node.nodeType === 1) return node;
|
|
10081
|
+
}
|
|
10082
|
+
function getOriginShift(origins, root) {
|
|
10083
|
+
const origin = origins.find((o) => o.willMove() && o.item.contains(root));
|
|
10084
|
+
return origin && getPosition(origin.item, origin);
|
|
10085
|
+
}
|
|
9921
10086
|
function hasCSSTransform(el, root, moveClass) {
|
|
9922
10087
|
const clone = el.cloneNode();
|
|
9923
10088
|
const _vtc = el[vtcKey];
|