@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.10
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-core.cjs.js +673 -457
- package/dist/runtime-core.cjs.prod.js +527 -378
- package/dist/runtime-core.d.ts +608 -608
- package/dist/runtime-core.esm-bundler.js +688 -459
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.10
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -153,7 +153,7 @@ let currentFlushPromise = null;
|
|
|
153
153
|
let jobsLength = 0;
|
|
154
154
|
let flushIndex = 0;
|
|
155
155
|
let postFlushIndex = 0;
|
|
156
|
-
const resolvedPromise =
|
|
156
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
157
157
|
function nextTick(fn) {
|
|
158
158
|
const p = currentFlushPromise || resolvedPromise;
|
|
159
159
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
@@ -191,6 +191,7 @@ const doFlushJobs = () => {
|
|
|
191
191
|
flushJobs();
|
|
192
192
|
} catch (e) {
|
|
193
193
|
currentFlushPromise = null;
|
|
194
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
194
195
|
throw e;
|
|
195
196
|
}
|
|
196
197
|
};
|
|
@@ -198,9 +199,10 @@ function queueFlush() {
|
|
|
198
199
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
199
200
|
}
|
|
200
201
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
201
|
-
if (!(0, _vue_shared.isArray)(jobs))
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
if (!(0, _vue_shared.isArray)(jobs)) {
|
|
203
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
204
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
205
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
204
206
|
queueFlush();
|
|
205
207
|
}
|
|
206
208
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -212,30 +214,37 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
212
214
|
i--;
|
|
213
215
|
jobsLength--;
|
|
214
216
|
if (cb.flags & 2) cb.flags &= -2;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
try {
|
|
218
|
+
cb();
|
|
219
|
+
} finally {
|
|
220
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
221
|
+
}
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
function flushPostFlushCbs(seen) {
|
|
220
225
|
if (postJobs.length) {
|
|
221
226
|
if (activePostJobs) {
|
|
222
|
-
activePostJobs.push(
|
|
227
|
+
for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
|
|
223
228
|
postJobs.length = 0;
|
|
224
229
|
return;
|
|
225
230
|
}
|
|
226
231
|
activePostJobs = postJobs;
|
|
227
232
|
postJobs = [];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
cb
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
try {
|
|
234
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
235
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
236
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
237
|
+
if (!(cb.flags & 4)) try {
|
|
238
|
+
cb();
|
|
239
|
+
} finally {
|
|
240
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
241
|
+
}
|
|
235
242
|
}
|
|
243
|
+
} finally {
|
|
244
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
245
|
+
activePostJobs = null;
|
|
246
|
+
postFlushIndex = 0;
|
|
236
247
|
}
|
|
237
|
-
activePostJobs = null;
|
|
238
|
-
postFlushIndex = 0;
|
|
239
248
|
}
|
|
240
249
|
}
|
|
241
250
|
let isFlushing = false;
|
|
@@ -245,9 +254,12 @@ let isFlushing = false;
|
|
|
245
254
|
function flushOnAppMount(instance) {
|
|
246
255
|
if (!isFlushing) {
|
|
247
256
|
isFlushing = true;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
257
|
+
try {
|
|
258
|
+
flushPreFlushCbs(instance);
|
|
259
|
+
flushPostFlushCbs();
|
|
260
|
+
} finally {
|
|
261
|
+
isFlushing = false;
|
|
262
|
+
}
|
|
251
263
|
}
|
|
252
264
|
}
|
|
253
265
|
function flushJobs(seen) {
|
|
@@ -275,8 +287,8 @@ function flushJobs(seen) {
|
|
|
275
287
|
jobsLength = 0;
|
|
276
288
|
jobs.length = 0;
|
|
277
289
|
flushPostFlushCbs(seen);
|
|
278
|
-
currentFlushPromise = null;
|
|
279
290
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
291
|
+
else currentFlushPromise = null;
|
|
280
292
|
}
|
|
281
293
|
}
|
|
282
294
|
//#endregion
|
|
@@ -515,7 +527,7 @@ function instanceWatch(source, value, options) {
|
|
|
515
527
|
}
|
|
516
528
|
const prev = setCurrentInstance(this);
|
|
517
529
|
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
518
|
-
|
|
530
|
+
restoreCurrentInstance(prev);
|
|
519
531
|
return res;
|
|
520
532
|
}
|
|
521
533
|
function createPathGetter(ctx, path) {
|
|
@@ -537,9 +549,10 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
537
549
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
538
550
|
const resolveTarget = (props, select) => {
|
|
539
551
|
const targetSelector = props && props.to;
|
|
540
|
-
if ((0, _vue_shared.isString)(targetSelector))
|
|
541
|
-
|
|
542
|
-
|
|
552
|
+
if ((0, _vue_shared.isString)(targetSelector)) {
|
|
553
|
+
if (!select) return null;
|
|
554
|
+
else return select(targetSelector);
|
|
555
|
+
} else return targetSelector;
|
|
543
556
|
};
|
|
544
557
|
const TeleportImpl = {
|
|
545
558
|
name: "Teleport",
|
|
@@ -570,7 +583,8 @@ const TeleportImpl = {
|
|
|
570
583
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
571
584
|
pendingMounts.delete(vnode);
|
|
572
585
|
if (isTeleportDisabled(vnode.props)) {
|
|
573
|
-
|
|
586
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
587
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
574
588
|
updateCssVars(vnode, true);
|
|
575
589
|
}
|
|
576
590
|
mountToTarget(vnode);
|
|
@@ -679,15 +693,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
679
693
|
const disabled = isTeleportDisabled(vnode.props);
|
|
680
694
|
if (target) {
|
|
681
695
|
const targetNode = target._lpa || target.firstChild;
|
|
682
|
-
if (vnode.shapeFlag & 16)
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
696
|
+
if (vnode.shapeFlag & 16) {
|
|
697
|
+
if (disabled) {
|
|
698
|
+
hydrateDisabledTeleport(node, vnode);
|
|
699
|
+
hydrateAnchor(target, targetNode);
|
|
700
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
701
|
+
} else {
|
|
702
|
+
vnode.anchor = nextSibling(node);
|
|
703
|
+
hydrateAnchor(target, targetNode);
|
|
704
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
705
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
706
|
+
}
|
|
691
707
|
}
|
|
692
708
|
updateCssVars(vnode, disabled);
|
|
693
709
|
} else if (disabled) {
|
|
@@ -775,48 +791,15 @@ const BaseTransitionImpl = {
|
|
|
775
791
|
setup(props, { slots }) {
|
|
776
792
|
const instance = getCurrentInstance();
|
|
777
793
|
const state = useTransitionState();
|
|
794
|
+
let resumeAfterLeave;
|
|
778
795
|
return () => {
|
|
779
|
-
const
|
|
780
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
796
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
781
797
|
if (!child) return;
|
|
782
798
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
783
799
|
const { mode } = rawProps;
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
|
|
788
|
-
if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
|
|
789
|
-
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
790
|
-
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
791
|
-
let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
|
|
792
|
-
setTransitionHooks(oldInnerChild, leavingHooks);
|
|
793
|
-
if (mode === "out-in" && innerChild.type !== Comment) {
|
|
794
|
-
state.isLeaving = true;
|
|
795
|
-
leavingHooks.afterLeave = () => {
|
|
796
|
-
state.isLeaving = false;
|
|
797
|
-
if (!(instance.job.flags & 4)) instance.update();
|
|
798
|
-
delete leavingHooks.afterLeave;
|
|
799
|
-
oldInnerChild = void 0;
|
|
800
|
-
};
|
|
801
|
-
return emptyPlaceholder(child);
|
|
802
|
-
} else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
803
|
-
const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
|
|
804
|
-
leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
|
|
805
|
-
el[leaveCbKey] = () => {
|
|
806
|
-
earlyRemove();
|
|
807
|
-
el[leaveCbKey] = void 0;
|
|
808
|
-
delete enterHooks.delayedLeave;
|
|
809
|
-
oldInnerChild = void 0;
|
|
810
|
-
};
|
|
811
|
-
enterHooks.delayedLeave = () => {
|
|
812
|
-
delayedLeave();
|
|
813
|
-
delete enterHooks.delayedLeave;
|
|
814
|
-
oldInnerChild = void 0;
|
|
815
|
-
};
|
|
816
|
-
};
|
|
817
|
-
else oldInnerChild = void 0;
|
|
818
|
-
} else if (oldInnerChild) oldInnerChild = void 0;
|
|
819
|
-
return child;
|
|
800
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
801
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
802
|
+
}) : _vue_shared.NOOP);
|
|
820
803
|
};
|
|
821
804
|
}
|
|
822
805
|
};
|
|
@@ -880,8 +863,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
880
863
|
persisted,
|
|
881
864
|
beforeEnter(el) {
|
|
882
865
|
let hook = onBeforeEnter;
|
|
883
|
-
if (!state.isMounted)
|
|
884
|
-
|
|
866
|
+
if (!state.isMounted) {
|
|
867
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
868
|
+
else return;
|
|
869
|
+
}
|
|
885
870
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
886
871
|
earlyRemove();
|
|
887
872
|
callHook(hook, [el]);
|
|
@@ -891,11 +876,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
891
876
|
let hook = onEnter;
|
|
892
877
|
let afterHook = onAfterEnter;
|
|
893
878
|
let cancelHook = onEnterCancelled;
|
|
894
|
-
if (!state.isMounted)
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
879
|
+
if (!state.isMounted) {
|
|
880
|
+
if (appear) {
|
|
881
|
+
hook = onAppear || onEnter;
|
|
882
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
883
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
884
|
+
} else return;
|
|
885
|
+
}
|
|
899
886
|
let called = false;
|
|
900
887
|
el[enterCbKey] = (cancelled) => {
|
|
901
888
|
if (called) return;
|
|
@@ -929,7 +916,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
929
916
|
else done();
|
|
930
917
|
},
|
|
931
918
|
clone(node) {
|
|
932
|
-
return cloneHooks(node);
|
|
919
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
933
920
|
}
|
|
934
921
|
};
|
|
935
922
|
return hooks;
|
|
@@ -953,16 +940,91 @@ function getInnerChild$1(vnode) {
|
|
|
953
940
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
954
941
|
}
|
|
955
942
|
}
|
|
943
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
944
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
945
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* @internal
|
|
949
|
+
*/
|
|
950
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
951
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
952
|
+
const nextInner = getInnerChild$1(next);
|
|
953
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
954
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
955
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
956
|
+
enterHooks = hooks;
|
|
957
|
+
});
|
|
958
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
959
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
960
|
+
const mode = props.mode;
|
|
961
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
962
|
+
if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
|
|
963
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
964
|
+
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);
|
|
965
|
+
}
|
|
966
|
+
return next;
|
|
967
|
+
}
|
|
968
|
+
function forwardDelayedLeave(hooks, source) {
|
|
969
|
+
const delayedLeave = source && source.delayedLeave;
|
|
970
|
+
if (!delayedLeave) return;
|
|
971
|
+
hooks.delayedLeave = () => {
|
|
972
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
973
|
+
delete hooks.delayedLeave;
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
977
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
978
|
+
}
|
|
979
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
980
|
+
if (props.mode === "out-in") {
|
|
981
|
+
state.isLeaving = true;
|
|
982
|
+
leavingHooks.afterLeave = () => {
|
|
983
|
+
state.isLeaving = false;
|
|
984
|
+
resumeAfterLeave();
|
|
985
|
+
delete leavingHooks.afterLeave;
|
|
986
|
+
};
|
|
987
|
+
return true;
|
|
988
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
989
|
+
let delayedLeavingVNode = leavingVNode;
|
|
990
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
991
|
+
const enterHooks = getEnterHooks();
|
|
992
|
+
if (!enterHooks) {
|
|
993
|
+
delayedLeave();
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
const vnode = delayedLeavingVNode;
|
|
997
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
998
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
999
|
+
el[leaveCbKey] = () => {
|
|
1000
|
+
earlyRemove();
|
|
1001
|
+
el[leaveCbKey] = void 0;
|
|
1002
|
+
delete enterHooks.delayedLeave;
|
|
1003
|
+
delayedLeavingVNode = void 0;
|
|
1004
|
+
};
|
|
1005
|
+
enterHooks.delayedLeave = () => {
|
|
1006
|
+
delayedLeave();
|
|
1007
|
+
delete enterHooks.delayedLeave;
|
|
1008
|
+
delayedLeavingVNode = void 0;
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
956
1014
|
function setTransitionHooks(vnode, hooks) {
|
|
957
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
958
|
-
else {
|
|
1015
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
959
1016
|
vnode.transition = hooks;
|
|
960
|
-
setTransitionHooks(vnode.component
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1017
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1018
|
+
else {
|
|
1019
|
+
const subTree = vnode.component.subTree;
|
|
1020
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1021
|
+
}
|
|
1022
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1023
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1024
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1025
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
965
1026
|
} else vnode.transition = hooks;
|
|
1027
|
+
return hooks;
|
|
966
1028
|
}
|
|
967
1029
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
968
1030
|
let ret = [];
|
|
@@ -980,9 +1042,9 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
980
1042
|
}
|
|
981
1043
|
//#endregion
|
|
982
1044
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
983
|
-
|
|
1045
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
984
1046
|
function defineComponent(options, extraOptions) {
|
|
985
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1047
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
986
1048
|
}
|
|
987
1049
|
//#endregion
|
|
988
1050
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1069,15 +1131,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1069
1131
|
if (rawRef.f) {
|
|
1070
1132
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1071
1133
|
if (isUnmount) (0, _vue_shared.isArray)(existing) && (0, _vue_shared.remove)(existing, refValue);
|
|
1072
|
-
else if (!(0, _vue_shared.isArray)(existing))
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1134
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1135
|
+
if (_isString) {
|
|
1136
|
+
refs[ref] = [refValue];
|
|
1137
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1138
|
+
} else {
|
|
1139
|
+
const newVal = [refValue];
|
|
1140
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1141
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1142
|
+
}
|
|
1143
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1081
1144
|
} else if (_isString) {
|
|
1082
1145
|
refs[ref] = value;
|
|
1083
1146
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1127,7 +1190,18 @@ const logMismatchError = () => {
|
|
|
1127
1190
|
hasLoggedMismatchError = true;
|
|
1128
1191
|
};
|
|
1129
1192
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1130
|
-
const isMathMLContainer = (container) =>
|
|
1193
|
+
const isMathMLContainer = (container) => {
|
|
1194
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
1195
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
1196
|
+
const encoding = container.getAttribute("encoding");
|
|
1197
|
+
return !encoding || !encoding.includes("html");
|
|
1198
|
+
};
|
|
1199
|
+
/**
|
|
1200
|
+
* Resolve the element namespace a container's children should be created in.
|
|
1201
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
1202
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
1203
|
+
* @internal
|
|
1204
|
+
*/
|
|
1131
1205
|
const getContainerType = (container) => {
|
|
1132
1206
|
if (container.nodeType !== 1) return void 0;
|
|
1133
1207
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -1150,7 +1224,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1150
1224
|
};
|
|
1151
1225
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1152
1226
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1153
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1227
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1154
1228
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1155
1229
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1156
1230
|
let domType = node.nodeType;
|
|
@@ -1162,11 +1236,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1162
1236
|
let nextNode = null;
|
|
1163
1237
|
switch (type) {
|
|
1164
1238
|
case Text:
|
|
1165
|
-
if (domType !== 3)
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1239
|
+
if (domType !== 3) {
|
|
1240
|
+
if (vnode.children === "") {
|
|
1241
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1242
|
+
nextNode = node;
|
|
1243
|
+
} else nextNode = onMismatch();
|
|
1244
|
+
} else {
|
|
1170
1245
|
if (node.data !== vnode.children) {
|
|
1171
1246
|
logMismatchError();
|
|
1172
1247
|
node.data = vnode.children;
|
|
@@ -1202,45 +1277,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1202
1277
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1203
1278
|
break;
|
|
1204
1279
|
case VaporSlot:
|
|
1205
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
1280
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1206
1281
|
break;
|
|
1207
|
-
default: if (shapeFlag & 1)
|
|
1208
|
-
|
|
1209
|
-
|
|
1282
|
+
default: if (shapeFlag & 1) {
|
|
1283
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1284
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1285
|
+
} else if (shapeFlag & 6) {
|
|
1210
1286
|
vnode.slotScopeIds = slotScopeIds;
|
|
1211
1287
|
const container = parentNode(node);
|
|
1212
1288
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1213
1289
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1214
1290
|
else nextNode = nextSibling(node);
|
|
1215
|
-
if (vnode.type.__vapor)
|
|
1216
|
-
|
|
1217
|
-
getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
|
|
1218
|
-
if (vnode.dirs) {
|
|
1219
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1220
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1221
|
-
}
|
|
1222
|
-
}, () => {
|
|
1223
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
|
|
1224
|
-
});
|
|
1225
|
-
if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
1226
|
-
const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
|
|
1227
|
-
if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
|
|
1228
|
-
} else {
|
|
1291
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1292
|
+
else {
|
|
1229
1293
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1230
1294
|
const component = vnode.component;
|
|
1231
|
-
if (isAsyncWrapper(vnode)
|
|
1295
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1232
1296
|
let subTree;
|
|
1233
1297
|
if (isFragmentStart) {
|
|
1234
|
-
subTree = createVNode(
|
|
1298
|
+
subTree = createVNode(Static);
|
|
1235
1299
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1236
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1300
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1237
1301
|
subTree.el = node;
|
|
1238
1302
|
component.subTree = subTree;
|
|
1239
1303
|
}
|
|
1240
1304
|
}
|
|
1241
|
-
} else if (shapeFlag & 64)
|
|
1242
|
-
|
|
1243
|
-
|
|
1305
|
+
} else if (shapeFlag & 64) {
|
|
1306
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1307
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1308
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1244
1309
|
}
|
|
1245
1310
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
1246
1311
|
return nextNode;
|
|
@@ -1285,7 +1350,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1285
1350
|
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1286
1351
|
const isCustomElement = el.tagName.includes("-");
|
|
1287
1352
|
const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
|
|
1288
|
-
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key))
|
|
1353
|
+
for (const key in props) if (forcePatch && (key.endsWith("value") || key === "indeterminate") || (0, _vue_shared.isOn)(key) && !(0, _vue_shared.isReservedProp)(key) || key[0] === "." || isCustomElement && !(0, _vue_shared.isReservedProp)(key) || dynamicProps && dynamicProps.includes(key)) {
|
|
1354
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1355
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1356
|
+
}
|
|
1289
1357
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1290
1358
|
else if (patchFlag & 4 && (0, _vue_reactivity.isReactive)(props.style)) for (const key in props.style) props.style[key];
|
|
1291
1359
|
}
|
|
@@ -1331,8 +1399,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1331
1399
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1332
1400
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1333
1401
|
const container = parentNode(node);
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1402
|
+
const first = nextSibling(node);
|
|
1403
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1404
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1336
1405
|
else {
|
|
1337
1406
|
logMismatchError();
|
|
1338
1407
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -1354,20 +1423,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1354
1423
|
const container = parentNode(node);
|
|
1355
1424
|
remove(node);
|
|
1356
1425
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1357
|
-
if (parentComponent) {
|
|
1426
|
+
if (parentComponent && parentComponent.vnode) {
|
|
1358
1427
|
parentComponent.vnode.el = vnode.el;
|
|
1359
1428
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1360
1429
|
}
|
|
1361
1430
|
return next;
|
|
1362
1431
|
};
|
|
1363
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1432
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
1364
1433
|
let match = 0;
|
|
1365
1434
|
while (node) {
|
|
1366
1435
|
node = nextSibling(node);
|
|
1367
1436
|
if (node && isComment(node)) {
|
|
1368
1437
|
if (node.data === open) match++;
|
|
1369
|
-
if (node.data === close)
|
|
1370
|
-
|
|
1438
|
+
if (node.data === close) {
|
|
1439
|
+
if (match === 0) return nextSibling(node);
|
|
1440
|
+
else match--;
|
|
1441
|
+
}
|
|
1371
1442
|
}
|
|
1372
1443
|
}
|
|
1373
1444
|
return node;
|
|
@@ -1377,7 +1448,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1377
1448
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
1378
1449
|
let parent = parentComponent;
|
|
1379
1450
|
while (parent) {
|
|
1380
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1451
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1381
1452
|
parent = parent.parent;
|
|
1382
1453
|
}
|
|
1383
1454
|
};
|
|
@@ -1386,6 +1457,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1386
1457
|
const isTemplateNode = (node) => {
|
|
1387
1458
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1388
1459
|
};
|
|
1460
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1461
|
+
"src",
|
|
1462
|
+
"srcset",
|
|
1463
|
+
"href",
|
|
1464
|
+
"poster"
|
|
1465
|
+
]);
|
|
1466
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1467
|
+
if (!resourceProps.has(key)) return false;
|
|
1468
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1469
|
+
}
|
|
1389
1470
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
1390
1471
|
const MismatchTypeString = {
|
|
1391
1472
|
[0]: "text",
|
|
@@ -1490,16 +1571,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
1490
1571
|
return teardown;
|
|
1491
1572
|
};
|
|
1492
1573
|
function forEachElement(node, cb) {
|
|
1493
|
-
if (isComment(node) && node.data === "[") {
|
|
1574
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
1575
|
+
const open = node.data;
|
|
1576
|
+
const close = open === "[" ? "]" : ")";
|
|
1494
1577
|
let depth = 1;
|
|
1495
1578
|
let next = node.nextSibling;
|
|
1496
1579
|
while (next) {
|
|
1497
1580
|
if (next.nodeType === 1) {
|
|
1498
1581
|
if (cb(next) === false) break;
|
|
1499
1582
|
} else if (isComment(next)) {
|
|
1500
|
-
if (next.data ===
|
|
1583
|
+
if (next.data === close) {
|
|
1501
1584
|
if (--depth === 0) break;
|
|
1502
|
-
} else if (next.data ===
|
|
1585
|
+
} else if (next.data === open) depth++;
|
|
1503
1586
|
}
|
|
1504
1587
|
next = next.nextSibling;
|
|
1505
1588
|
}
|
|
@@ -1508,14 +1591,14 @@ function forEachElement(node, cb) {
|
|
|
1508
1591
|
//#endregion
|
|
1509
1592
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1510
1593
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1511
|
-
|
|
1594
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1512
1595
|
function defineAsyncComponent(source) {
|
|
1513
1596
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
1514
1597
|
return /* @__PURE__ */ defineComponent({
|
|
1515
1598
|
name: "AsyncComponentWrapper",
|
|
1516
1599
|
__asyncLoader: load,
|
|
1517
1600
|
__asyncHydrate(el, instance, hydrate) {
|
|
1518
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
1601
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
1519
1602
|
},
|
|
1520
1603
|
get __asyncResolved() {
|
|
1521
1604
|
return getResolvedComp();
|
|
@@ -1632,10 +1715,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
1632
1715
|
* shared between core and vapor
|
|
1633
1716
|
* @internal
|
|
1634
1717
|
*/
|
|
1635
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
1718
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
1636
1719
|
const wasConnected = el.isConnected;
|
|
1637
1720
|
let patched = false;
|
|
1638
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1721
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1639
1722
|
const performHydrate = () => {
|
|
1640
1723
|
if (patched) return;
|
|
1641
1724
|
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
@@ -1718,10 +1801,13 @@ const KeepAlive = {
|
|
|
1718
1801
|
});
|
|
1719
1802
|
let pendingCacheKey = null;
|
|
1720
1803
|
const cacheSubtree = () => {
|
|
1721
|
-
if (pendingCacheKey != null)
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1804
|
+
if (pendingCacheKey != null) {
|
|
1805
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
1806
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
1807
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
1808
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
1809
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
1810
|
+
}
|
|
1725
1811
|
};
|
|
1726
1812
|
onMounted(cacheSubtree);
|
|
1727
1813
|
onUpdated(cacheSubtree);
|
|
@@ -1875,7 +1961,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
1875
1961
|
try {
|
|
1876
1962
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
1877
1963
|
} finally {
|
|
1878
|
-
|
|
1964
|
+
restoreCurrentInstance(prev);
|
|
1879
1965
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
1880
1966
|
}
|
|
1881
1967
|
});
|
|
@@ -1959,16 +2045,17 @@ function renderList(source, renderItem, cache, index) {
|
|
|
1959
2045
|
} else if (typeof source === "number") {
|
|
1960
2046
|
ret = new Array(source);
|
|
1961
2047
|
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
1962
|
-
} else if ((0, _vue_shared.isObject)(source))
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
2048
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2049
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2050
|
+
else {
|
|
2051
|
+
const keys = Object.keys(source);
|
|
2052
|
+
ret = new Array(keys.length);
|
|
2053
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2054
|
+
const key = keys[i];
|
|
2055
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2056
|
+
}
|
|
1969
2057
|
}
|
|
1970
|
-
}
|
|
1971
|
-
else ret = [];
|
|
2058
|
+
} else ret = [];
|
|
1972
2059
|
if (cache) cache[index] = ret;
|
|
1973
2060
|
return ret;
|
|
1974
2061
|
}
|
|
@@ -1993,18 +2080,45 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1993
2080
|
//#endregion
|
|
1994
2081
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
1995
2082
|
/**
|
|
2083
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2084
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2085
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2086
|
+
* "which one". Internal to vapor interop.
|
|
2087
|
+
*/
|
|
2088
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2089
|
+
/**
|
|
2090
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
2091
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
2092
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
2093
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
2094
|
+
*/
|
|
2095
|
+
function invokeSlotFallback(fallback, owner) {
|
|
2096
|
+
if (!owner) return fallback();
|
|
2097
|
+
const prev = setCurrentRenderingInstance(owner);
|
|
2098
|
+
const prevStackSize = blockStack.length;
|
|
2099
|
+
try {
|
|
2100
|
+
return fallback();
|
|
2101
|
+
} finally {
|
|
2102
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2103
|
+
setCurrentRenderingInstance(prev);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
1996
2107
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1997
2108
|
* @private
|
|
1998
2109
|
*/
|
|
1999
|
-
function renderSlot(slots, name, props
|
|
2110
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2111
|
+
if (props == null) props = {};
|
|
2000
2112
|
let slot = slots[name];
|
|
2001
|
-
|
|
2002
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2113
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2003
2114
|
if (vaporSlot) {
|
|
2004
2115
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2005
2116
|
ret.vs = {
|
|
2006
2117
|
slot: vaporSlot,
|
|
2007
|
-
fallback
|
|
2118
|
+
outlets: fallback ? [{
|
|
2119
|
+
fallback,
|
|
2120
|
+
owner: currentRenderingInstance
|
|
2121
|
+
}] : void 0
|
|
2008
2122
|
};
|
|
2009
2123
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2010
2124
|
return ret;
|
|
@@ -2021,9 +2135,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
2021
2135
|
let rendered;
|
|
2022
2136
|
try {
|
|
2023
2137
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2024
|
-
|
|
2138
|
+
let attached = false;
|
|
2139
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2140
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
2141
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2142
|
+
}
|
|
2025
2143
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2026
2144
|
rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2145
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
2146
|
+
if (attached) rendered.vo = true;
|
|
2027
2147
|
} catch (err) {
|
|
2028
2148
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2029
2149
|
throw err;
|
|
@@ -2041,10 +2161,6 @@ function ensureValidVNode(vnodes) {
|
|
|
2041
2161
|
return true;
|
|
2042
2162
|
}) ? vnodes : null;
|
|
2043
2163
|
}
|
|
2044
|
-
function ensureVaporSlotFallback(vnodes, fallback) {
|
|
2045
|
-
let vaporSlot;
|
|
2046
|
-
if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
|
|
2047
|
-
}
|
|
2048
2164
|
//#endregion
|
|
2049
2165
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2050
2166
|
/**
|
|
@@ -2152,7 +2268,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
2152
2268
|
return Reflect.defineProperty(target, key, descriptor);
|
|
2153
2269
|
}
|
|
2154
2270
|
};
|
|
2155
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2271
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2156
2272
|
get(target, key) {
|
|
2157
2273
|
if (key === Symbol.unscopables) return;
|
|
2158
2274
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2265,12 +2381,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2265
2381
|
for (const key in defaults) {
|
|
2266
2382
|
if (key.startsWith("__skip")) continue;
|
|
2267
2383
|
let opt = props[key];
|
|
2268
|
-
if (opt)
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2384
|
+
if (opt) {
|
|
2385
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
2386
|
+
type: opt,
|
|
2387
|
+
default: defaults[key]
|
|
2388
|
+
};
|
|
2389
|
+
else opt.default = defaults[key];
|
|
2390
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2274
2391
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2275
2392
|
}
|
|
2276
2393
|
return props;
|
|
@@ -2319,36 +2436,31 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2319
2436
|
function withAsyncContext(getAwaitable) {
|
|
2320
2437
|
const ctx = getCurrentGenericInstance();
|
|
2321
2438
|
const inSSRSetup = isInSSRComponentSetup;
|
|
2322
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
2323
2439
|
let awaitable = getAwaitable();
|
|
2324
2440
|
setCurrentInstance(null, void 0);
|
|
2325
2441
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2326
2442
|
const restore = () => {
|
|
2327
|
-
const
|
|
2443
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2328
2444
|
setCurrentInstance(ctx);
|
|
2329
2445
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2330
|
-
|
|
2331
|
-
return () => {
|
|
2332
|
-
if (reset) reset();
|
|
2333
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2334
|
-
};
|
|
2446
|
+
return stoppedScope;
|
|
2335
2447
|
};
|
|
2336
2448
|
const cleanup = () => {
|
|
2337
2449
|
setCurrentInstance(null, void 0);
|
|
2338
2450
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2339
2451
|
};
|
|
2340
2452
|
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2341
|
-
const
|
|
2453
|
+
const stoppedScope = restore();
|
|
2342
2454
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
2343
|
-
if (
|
|
2455
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2344
2456
|
cleanup();
|
|
2345
2457
|
}));
|
|
2346
2458
|
throw e;
|
|
2347
2459
|
});
|
|
2348
2460
|
return [awaitable, () => {
|
|
2349
|
-
const
|
|
2461
|
+
const stoppedScope = restore();
|
|
2350
2462
|
Promise.resolve().then(() => {
|
|
2351
|
-
if (
|
|
2463
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2352
2464
|
cleanup();
|
|
2353
2465
|
});
|
|
2354
2466
|
}];
|
|
@@ -2376,9 +2488,11 @@ function applyOptions(instance) {
|
|
|
2376
2488
|
shouldCacheAccess = true;
|
|
2377
2489
|
if (computedOptions) for (const key in computedOptions) {
|
|
2378
2490
|
const opt = computedOptions[key];
|
|
2491
|
+
const get = (0, _vue_shared.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0, _vue_shared.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared.NOOP;
|
|
2492
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : _vue_shared.NOOP;
|
|
2379
2493
|
const c = computed({
|
|
2380
|
-
get
|
|
2381
|
-
set
|
|
2494
|
+
get,
|
|
2495
|
+
set
|
|
2382
2496
|
});
|
|
2383
2497
|
Object.defineProperty(ctx, key, {
|
|
2384
2498
|
enumerable: true,
|
|
@@ -2434,9 +2548,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
2434
2548
|
for (const key in injectOptions) {
|
|
2435
2549
|
const opt = injectOptions[key];
|
|
2436
2550
|
let injected;
|
|
2437
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
2438
|
-
|
|
2439
|
-
|
|
2551
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
2552
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
2553
|
+
else injected = inject(opt.from || key);
|
|
2554
|
+
} else injected = inject(opt);
|
|
2440
2555
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
2441
2556
|
enumerable: true,
|
|
2442
2557
|
configurable: true,
|
|
@@ -2455,10 +2570,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
2455
2570
|
const handler = ctx[raw];
|
|
2456
2571
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
2457
2572
|
} else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
|
|
2458
|
-
else if ((0, _vue_shared.isObject)(raw))
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2573
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
2574
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2575
|
+
else {
|
|
2576
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2577
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
2578
|
+
}
|
|
2462
2579
|
}
|
|
2463
2580
|
}
|
|
2464
2581
|
/**
|
|
@@ -2544,7 +2661,7 @@ function mergeObjectOptions(to, from) {
|
|
|
2544
2661
|
}
|
|
2545
2662
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
2546
2663
|
if (to) {
|
|
2547
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
2664
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2548
2665
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
2549
2666
|
} else return from;
|
|
2550
2667
|
}
|
|
@@ -2676,13 +2793,17 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
2676
2793
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
2677
2794
|
const res = (0, _vue_reactivity.customRef)((track, trigger) => {
|
|
2678
2795
|
let localValue;
|
|
2796
|
+
let prevPropValue = _vue_shared.EMPTY_OBJ;
|
|
2679
2797
|
let prevSetValue = _vue_shared.EMPTY_OBJ;
|
|
2680
2798
|
let prevEmittedValue;
|
|
2681
2799
|
watchSyncEffect(() => {
|
|
2682
2800
|
const propValue = props[camelizedName];
|
|
2683
|
-
if ((0, _vue_shared.hasChanged)(
|
|
2684
|
-
|
|
2685
|
-
|
|
2801
|
+
if ((0, _vue_shared.hasChanged)(prevPropValue, propValue)) {
|
|
2802
|
+
prevPropValue = propValue;
|
|
2803
|
+
if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
|
|
2804
|
+
localValue = propValue;
|
|
2805
|
+
trigger();
|
|
2806
|
+
}
|
|
2686
2807
|
}
|
|
2687
2808
|
});
|
|
2688
2809
|
return {
|
|
@@ -2747,7 +2868,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
2747
2868
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
2748
2869
|
if (modifiers) {
|
|
2749
2870
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
2750
|
-
if (modifiers.number) args =
|
|
2871
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
2751
2872
|
}
|
|
2752
2873
|
let handlerName;
|
|
2753
2874
|
let handler = getter(props, handlerName = (0, _vue_shared.toHandlerKey)(event)) || getter(props, handlerName = (0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)));
|
|
@@ -2848,7 +2969,7 @@ function renderComponentRoot(instance) {
|
|
|
2848
2969
|
root = cloneVNode(root, null, false, true);
|
|
2849
2970
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2850
2971
|
}
|
|
2851
|
-
if (vnode.transition) setTransitionHooks(root, vnode.transition);
|
|
2972
|
+
if (vnode.transition) setTransitionHooks(isTeleport(root.type) ? getInnerChild$1(root) || root : root, vnode.transition);
|
|
2852
2973
|
result = root;
|
|
2853
2974
|
setCurrentRenderingInstance(prev);
|
|
2854
2975
|
return result;
|
|
@@ -2858,15 +2979,18 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
2858
2979
|
for (let i = 0; i < children.length; i++) {
|
|
2859
2980
|
const child = children[i];
|
|
2860
2981
|
if (isVNode(child)) {
|
|
2861
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
2862
|
-
|
|
2982
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
2983
|
+
if (singleRoot) return;
|
|
2984
|
+
else singleRoot = child;
|
|
2985
|
+
}
|
|
2863
2986
|
} else return;
|
|
2864
2987
|
}
|
|
2865
2988
|
return singleRoot;
|
|
2866
2989
|
}
|
|
2990
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
2867
2991
|
const getFunctionalFallthrough = (attrs) => {
|
|
2868
2992
|
let res;
|
|
2869
|
-
for (const key in attrs) if (
|
|
2993
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
2870
2994
|
return res;
|
|
2871
2995
|
};
|
|
2872
2996
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -2967,16 +3091,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2967
3091
|
let key = propsToUpdate[i];
|
|
2968
3092
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
2969
3093
|
const value = rawProps[key];
|
|
2970
|
-
if (options)
|
|
2971
|
-
if (
|
|
2972
|
-
attrs[key]
|
|
2973
|
-
|
|
3094
|
+
if (options) {
|
|
3095
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3096
|
+
if (value !== attrs[key]) {
|
|
3097
|
+
attrs[key] = value;
|
|
3098
|
+
hasAttrsChanged = true;
|
|
3099
|
+
}
|
|
3100
|
+
} else {
|
|
3101
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3102
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
2974
3103
|
}
|
|
2975
|
-
} else {
|
|
2976
|
-
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
2977
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
2978
|
-
}
|
|
2979
|
-
else if (value !== attrs[key]) {
|
|
3104
|
+
} else if (value !== attrs[key]) {
|
|
2980
3105
|
attrs[key] = value;
|
|
2981
3106
|
hasAttrsChanged = true;
|
|
2982
3107
|
}
|
|
@@ -2985,9 +3110,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2985
3110
|
} else {
|
|
2986
3111
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
2987
3112
|
let kebabKey;
|
|
2988
|
-
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey)))
|
|
2989
|
-
if (
|
|
2990
|
-
|
|
3113
|
+
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey))) {
|
|
3114
|
+
if (options) {
|
|
3115
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3116
|
+
} else delete props[key];
|
|
3117
|
+
}
|
|
2991
3118
|
if (attrs !== rawCurrentProps) {
|
|
2992
3119
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
2993
3120
|
delete attrs[key];
|
|
@@ -3005,9 +3132,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3005
3132
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3006
3133
|
const value = rawProps[key];
|
|
3007
3134
|
let camelKey;
|
|
3008
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3009
|
-
|
|
3010
|
-
|
|
3135
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3136
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3137
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3138
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3011
3139
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3012
3140
|
attrs[key] = value;
|
|
3013
3141
|
hasAttrsChanged = true;
|
|
@@ -3054,7 +3182,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3054
3182
|
const prev = setCurrentInstance(instance);
|
|
3055
3183
|
const props = (0, _vue_reactivity.toRaw)(instance.props);
|
|
3056
3184
|
value = factory.call(null, props);
|
|
3057
|
-
|
|
3185
|
+
restoreCurrentInstance(prev);
|
|
3058
3186
|
return value;
|
|
3059
3187
|
}
|
|
3060
3188
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3168,9 +3296,10 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3168
3296
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
3169
3297
|
if (vnode.shapeFlag & 32) {
|
|
3170
3298
|
const type = children._;
|
|
3171
|
-
if (type)
|
|
3172
|
-
|
|
3173
|
-
|
|
3299
|
+
if (type) {
|
|
3300
|
+
if (optimized && type === 1) needDeletionCheck = false;
|
|
3301
|
+
else assignSlots(slots, children, optimized);
|
|
3302
|
+
} else {
|
|
3174
3303
|
needDeletionCheck = !children.$stable;
|
|
3175
3304
|
normalizeObjectSlots(children, slots, instance);
|
|
3176
3305
|
}
|
|
@@ -3230,6 +3359,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3230
3359
|
optimized = false;
|
|
3231
3360
|
n2.dynamicChildren = null;
|
|
3232
3361
|
}
|
|
3362
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
3363
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
3364
|
+
n2.dynamicChildren.hasOnce = true;
|
|
3365
|
+
}
|
|
3233
3366
|
const { type, ref, shapeFlag } = n2;
|
|
3234
3367
|
switch (type) {
|
|
3235
3368
|
case Text:
|
|
@@ -3245,7 +3378,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3245
3378
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3246
3379
|
break;
|
|
3247
3380
|
case VaporSlot:
|
|
3248
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
3381
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
3249
3382
|
break;
|
|
3250
3383
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3251
3384
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -3341,7 +3474,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3341
3474
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
3342
3475
|
};
|
|
3343
3476
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
3344
|
-
for (let i = start; i < children.length; i++)
|
|
3477
|
+
for (let i = start; i < children.length; i++) {
|
|
3478
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
3479
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3480
|
+
}
|
|
3345
3481
|
};
|
|
3346
3482
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3347
3483
|
const el = n2.el = n1.el;
|
|
@@ -3352,6 +3488,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3352
3488
|
let vnodeHook;
|
|
3353
3489
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
3354
3490
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3491
|
+
if (n2.ibu) n2.ibu();
|
|
3355
3492
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3356
3493
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
3357
3494
|
if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -3383,8 +3520,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3383
3520
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
3384
3521
|
}
|
|
3385
3522
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
3386
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
3523
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
3387
3524
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3525
|
+
n2.iu && n2.iu();
|
|
3388
3526
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3389
3527
|
}, void 0, parentSuspense);
|
|
3390
3528
|
};
|
|
@@ -3392,7 +3530,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3392
3530
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3393
3531
|
const oldVNode = oldChildren[i];
|
|
3394
3532
|
const newVNode = newChildren[i];
|
|
3395
|
-
|
|
3533
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
3534
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3396
3535
|
}
|
|
3397
3536
|
};
|
|
3398
3537
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -3425,41 +3564,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3425
3564
|
};
|
|
3426
3565
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3427
3566
|
n2.slotScopeIds = slotScopeIds;
|
|
3428
|
-
if (n2.type.__vapor)
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
3438
|
-
});
|
|
3439
|
-
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3440
|
-
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
3441
|
-
if (vnodeMountedHook) {
|
|
3442
|
-
const scopedVNode = n2;
|
|
3443
|
-
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
3444
|
-
}
|
|
3445
|
-
}
|
|
3446
|
-
else {
|
|
3447
|
-
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
3448
|
-
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
3449
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3450
|
-
}, () => {
|
|
3451
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
3452
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
3453
|
-
});
|
|
3454
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
3455
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
3456
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3457
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
3458
|
-
}, void 0, parentSuspense);
|
|
3459
|
-
}
|
|
3460
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3461
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
3462
|
-
else updateComponent(n1, n2, optimized);
|
|
3567
|
+
if (n2.type.__vapor) {
|
|
3568
|
+
if (n1 == null) {
|
|
3569
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
3570
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
3571
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
3572
|
+
} else if (n1 == null) {
|
|
3573
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3574
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
3575
|
+
} else updateComponent(n1, n2, optimized);
|
|
3463
3576
|
};
|
|
3464
3577
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
3465
3578
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -3490,14 +3603,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3490
3603
|
};
|
|
3491
3604
|
const updateComponent = (n1, n2, optimized) => {
|
|
3492
3605
|
const instance = n2.component = n1.component;
|
|
3493
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
3494
|
-
|
|
3495
|
-
|
|
3606
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3607
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3608
|
+
n2.el = n1.el;
|
|
3609
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
3610
|
+
return;
|
|
3611
|
+
} else {
|
|
3612
|
+
instance.next = n2;
|
|
3613
|
+
instance.effect.run();
|
|
3614
|
+
}
|
|
3496
3615
|
} else {
|
|
3497
|
-
instance.next = n2;
|
|
3498
|
-
instance.effect.run();
|
|
3499
|
-
}
|
|
3500
|
-
else {
|
|
3501
3616
|
n2.el = n1.el;
|
|
3502
3617
|
instance.vnode = n2;
|
|
3503
3618
|
}
|
|
@@ -3583,6 +3698,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3583
3698
|
} else next = vnode;
|
|
3584
3699
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
3585
3700
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3701
|
+
if (next.ibu) next.ibu();
|
|
3586
3702
|
toggleRecurse(instance, true);
|
|
3587
3703
|
const nextTree = renderComponentRoot(instance);
|
|
3588
3704
|
const prevTree = instance.subTree;
|
|
@@ -3591,7 +3707,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3591
3707
|
next.el = nextTree.el;
|
|
3592
3708
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
3593
3709
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
3594
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
3710
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
3711
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3712
|
+
next.iu && next.iu();
|
|
3713
|
+
}, void 0, parentSuspense);
|
|
3595
3714
|
}
|
|
3596
3715
|
}
|
|
3597
3716
|
}
|
|
@@ -3629,9 +3748,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3629
3748
|
if (shapeFlag & 8) {
|
|
3630
3749
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
3631
3750
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
3632
|
-
} else if (prevShapeFlag & 16)
|
|
3633
|
-
|
|
3634
|
-
|
|
3751
|
+
} else if (prevShapeFlag & 16) {
|
|
3752
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3753
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
3754
|
+
} else {
|
|
3635
3755
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
3636
3756
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3637
3757
|
}
|
|
@@ -3727,15 +3847,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3727
3847
|
const anchorVNode = c2[nextIndex + 1];
|
|
3728
3848
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
3729
3849
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3730
|
-
else if (moved)
|
|
3731
|
-
|
|
3850
|
+
else if (moved) {
|
|
3851
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
3852
|
+
else j--;
|
|
3853
|
+
}
|
|
3732
3854
|
}
|
|
3733
3855
|
}
|
|
3734
3856
|
};
|
|
3735
3857
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
3736
3858
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
3737
3859
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
3738
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
3860
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
3739
3861
|
return;
|
|
3740
3862
|
}
|
|
3741
3863
|
if (shapeFlag & 6) {
|
|
@@ -3760,54 +3882,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3760
3882
|
moveStaticNode(vnode, container, anchor);
|
|
3761
3883
|
return;
|
|
3762
3884
|
}
|
|
3763
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
const remove = () => {
|
|
3885
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
3886
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
3887
|
+
else performTransitionLeave(el, transition, () => {
|
|
3767
3888
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
3768
3889
|
else hostInsert(el, container, anchor);
|
|
3769
|
-
};
|
|
3770
|
-
|
|
3771
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
3772
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
3773
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
3774
|
-
else leave(el, () => {
|
|
3775
|
-
remove();
|
|
3776
|
-
afterLeave && afterLeave();
|
|
3777
|
-
});
|
|
3778
|
-
};
|
|
3779
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
3780
|
-
else performLeave();
|
|
3781
|
-
}
|
|
3782
|
-
else hostInsert(el, container, anchor);
|
|
3890
|
+
}, true, true);
|
|
3891
|
+
} else hostInsert(el, container, anchor);
|
|
3783
3892
|
};
|
|
3784
3893
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3785
3894
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
3786
|
-
if (patchFlag === -2) optimized = false;
|
|
3895
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
3787
3896
|
if (ref != null) {
|
|
3788
3897
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
3789
3898
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
3790
3899
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
3791
3900
|
}
|
|
3792
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3901
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3793
3902
|
if (shapeFlag & 256) {
|
|
3794
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
3903
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
3795
3904
|
else parentComponent.ctx.deactivate(vnode);
|
|
3796
3905
|
return;
|
|
3797
3906
|
}
|
|
3907
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
3908
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3909
|
+
return;
|
|
3910
|
+
}
|
|
3798
3911
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
3799
3912
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
3800
3913
|
let vnodeHook;
|
|
3801
3914
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3802
|
-
if (shapeFlag & 6)
|
|
3803
|
-
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
3804
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3805
|
-
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
3806
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3807
|
-
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3808
|
-
}, void 0, parentSuspense);
|
|
3809
|
-
return;
|
|
3810
|
-
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3915
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3811
3916
|
else {
|
|
3812
3917
|
if (shapeFlag & 128) {
|
|
3813
3918
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -3818,7 +3923,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3818
3923
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
3819
3924
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
3820
3925
|
if (type === VaporSlot) {
|
|
3821
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3926
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3822
3927
|
return;
|
|
3823
3928
|
}
|
|
3824
3929
|
if (doRemove) remove(vnode);
|
|
@@ -3838,6 +3943,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3838
3943
|
}
|
|
3839
3944
|
if (type === Static) {
|
|
3840
3945
|
removeStaticNode(vnode);
|
|
3946
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
3841
3947
|
return;
|
|
3842
3948
|
}
|
|
3843
3949
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -3861,7 +3967,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3861
3967
|
if (effect) {
|
|
3862
3968
|
effect.stop();
|
|
3863
3969
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3864
|
-
} else if (
|
|
3970
|
+
} else if (instance.vnode.el && subTree) {
|
|
3971
|
+
subTree.transition = instance.vnode.transition;
|
|
3972
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3973
|
+
}
|
|
3865
3974
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
3866
3975
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
3867
3976
|
};
|
|
@@ -3929,12 +4038,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
3929
4038
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
3930
4039
|
}
|
|
3931
4040
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
3932
|
-
if (!vapor)
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
4041
|
+
if (!vapor) {
|
|
4042
|
+
if (allowed) {
|
|
4043
|
+
effect.flags |= 128;
|
|
4044
|
+
job.flags |= 2;
|
|
4045
|
+
} else {
|
|
4046
|
+
effect.flags &= -129;
|
|
4047
|
+
job.flags &= -3;
|
|
4048
|
+
}
|
|
3938
4049
|
}
|
|
3939
4050
|
}
|
|
3940
4051
|
function needTransition(parentSuspense, transition) {
|
|
@@ -3973,8 +4084,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
3973
4084
|
}
|
|
3974
4085
|
function locateNonHydratedAsyncRoot(instance) {
|
|
3975
4086
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
3976
|
-
if (subComponent)
|
|
3977
|
-
|
|
4087
|
+
if (subComponent) {
|
|
4088
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
4089
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
4090
|
+
}
|
|
3978
4091
|
}
|
|
3979
4092
|
function invalidateMount(hooks) {
|
|
3980
4093
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -3993,13 +4106,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
3993
4106
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
3994
4107
|
const performRemove = () => {
|
|
3995
4108
|
remove();
|
|
3996
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4109
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
3997
4110
|
};
|
|
3998
4111
|
if (force || isElement && transition && !transition.persisted) {
|
|
3999
4112
|
const { leave, delayLeave } = transition;
|
|
4000
4113
|
const performLeave = () => {
|
|
4114
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4001
4115
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
4002
|
-
|
|
4116
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
4117
|
+
else leave(el, performRemove);
|
|
4003
4118
|
};
|
|
4004
4119
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
4005
4120
|
else performLeave();
|
|
@@ -4015,7 +4130,7 @@ function isVaporComponent(type) {
|
|
|
4015
4130
|
/**
|
|
4016
4131
|
* shared between vdom and vapor
|
|
4017
4132
|
*/
|
|
4018
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
4133
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
4019
4134
|
const inheritedScopeIds = [];
|
|
4020
4135
|
let currentParent = parentComponent;
|
|
4021
4136
|
let currentVNode = vnode;
|
|
@@ -4030,6 +4145,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
4030
4145
|
currentParent = currentParent.parent;
|
|
4031
4146
|
} else break;
|
|
4032
4147
|
}
|
|
4148
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
4149
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
4033
4150
|
return inheritedScopeIds;
|
|
4034
4151
|
}
|
|
4035
4152
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -4048,7 +4165,7 @@ const Suspense = {
|
|
|
4048
4165
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
4049
4166
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4050
4167
|
else {
|
|
4051
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
4168
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
4052
4169
|
n2.suspense = n1.suspense;
|
|
4053
4170
|
n2.suspense.vnode = n2;
|
|
4054
4171
|
n2.el = n1.el;
|
|
@@ -4086,10 +4203,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4086
4203
|
if (pendingBranch) {
|
|
4087
4204
|
suspense.pendingBranch = newBranch;
|
|
4088
4205
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
4089
|
-
|
|
4206
|
+
suspense.deps++;
|
|
4207
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4208
|
+
suspense.deps--;
|
|
4090
4209
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4091
4210
|
else if (isInFallback) {
|
|
4092
|
-
if (!isHydrating) {
|
|
4211
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
4093
4212
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4094
4213
|
setActiveBranch(suspense, newFallback);
|
|
4095
4214
|
}
|
|
@@ -4101,12 +4220,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4101
4220
|
suspense.activeBranch = pendingBranch;
|
|
4102
4221
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
4103
4222
|
suspense.deps = 0;
|
|
4223
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
4224
|
+
const effect = suspense.effects[i];
|
|
4225
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
4226
|
+
}
|
|
4104
4227
|
suspense.effects.length = 0;
|
|
4105
4228
|
suspense.hiddenContainer = createElement("div");
|
|
4106
4229
|
if (isInFallback) {
|
|
4107
4230
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4108
4231
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4109
|
-
else {
|
|
4232
|
+
else if (!suspense.isFallbackMountPending) {
|
|
4110
4233
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4111
4234
|
setActiveBranch(suspense, newFallback);
|
|
4112
4235
|
}
|
|
@@ -4199,7 +4322,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4199
4322
|
let hasUnresolvedAncestor = false;
|
|
4200
4323
|
while (parent) {
|
|
4201
4324
|
if (parent.pendingBranch) {
|
|
4202
|
-
parent.effects.push(
|
|
4325
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
4203
4326
|
hasUnresolvedAncestor = true;
|
|
4204
4327
|
break;
|
|
4205
4328
|
}
|
|
@@ -4209,6 +4332,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4209
4332
|
suspense.effects = [];
|
|
4210
4333
|
if (isSuspensible) {
|
|
4211
4334
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
4335
|
+
parentSuspenseId = void 0;
|
|
4212
4336
|
parentSuspense.deps--;
|
|
4213
4337
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
4214
4338
|
}
|
|
@@ -4223,8 +4347,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4223
4347
|
const mountFallback = () => {
|
|
4224
4348
|
suspense.isFallbackMountPending = false;
|
|
4225
4349
|
if (!suspense.isInFallback) return;
|
|
4226
|
-
|
|
4227
|
-
|
|
4350
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
4351
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4352
|
+
setActiveBranch(suspense, latestFallback);
|
|
4228
4353
|
};
|
|
4229
4354
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
4230
4355
|
if (delayEnter) {
|
|
@@ -4245,11 +4370,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4245
4370
|
registerDep(instance, onResolve) {
|
|
4246
4371
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4247
4372
|
if (isInPendingSuspense) suspense.deps++;
|
|
4373
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
4248
4374
|
instance.asyncDep.catch((err) => {
|
|
4249
4375
|
handleError(err, instance, 0);
|
|
4250
4376
|
}).then((asyncSetupResult) => {
|
|
4251
4377
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4252
4378
|
setCurrentInstance(null, void 0);
|
|
4379
|
+
if (hydratedEl && !instance.scope.active) {
|
|
4380
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4381
|
+
return;
|
|
4382
|
+
}
|
|
4253
4383
|
instance.asyncResolved = true;
|
|
4254
4384
|
onResolve(asyncSetupResult);
|
|
4255
4385
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -4296,9 +4426,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
4296
4426
|
return s;
|
|
4297
4427
|
}
|
|
4298
4428
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
4299
|
-
if (suspense && suspense.pendingBranch)
|
|
4300
|
-
|
|
4301
|
-
|
|
4429
|
+
if (suspense && suspense.pendingBranch) {
|
|
4430
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
4431
|
+
else suspense.effects.push(fn);
|
|
4432
|
+
} else queuePostFlushCb(fn, id);
|
|
4302
4433
|
}
|
|
4303
4434
|
function setActiveBranch(suspense, branch) {
|
|
4304
4435
|
suspense.activeBranch = branch;
|
|
@@ -4459,8 +4590,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
4459
4590
|
if (isVNode(type)) {
|
|
4460
4591
|
const cloned = cloneVNode(type, props, true);
|
|
4461
4592
|
if (children) normalizeChildren(cloned, children);
|
|
4462
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
4463
|
-
|
|
4593
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
4594
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
4595
|
+
else currentBlock.push(cloned);
|
|
4596
|
+
}
|
|
4464
4597
|
cloned.patchFlag = -2;
|
|
4465
4598
|
return cloned;
|
|
4466
4599
|
}
|
|
@@ -4516,7 +4649,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4516
4649
|
ce: vnode.ce,
|
|
4517
4650
|
vi: vnode.vi,
|
|
4518
4651
|
vs: cloneVaporSlotMeta(vnode),
|
|
4519
|
-
vb: vnode.vb
|
|
4652
|
+
vb: vnode.vb,
|
|
4653
|
+
ibu: vnode.ibu,
|
|
4654
|
+
iu: vnode.iu,
|
|
4655
|
+
cacheIndex: vnode.cacheIndex
|
|
4520
4656
|
};
|
|
4521
4657
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4522
4658
|
return cloned;
|
|
@@ -4526,8 +4662,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
4526
4662
|
if (!vaporSlot) return vaporSlot;
|
|
4527
4663
|
const cloned = {
|
|
4528
4664
|
slot: vaporSlot.slot,
|
|
4529
|
-
|
|
4530
|
-
outletFallback: vaporSlot.outletFallback
|
|
4665
|
+
outlets: vaporSlot.outlets
|
|
4531
4666
|
};
|
|
4532
4667
|
if (vnode.el) {
|
|
4533
4668
|
cloned.state = vaporSlot.state;
|
|
@@ -4570,25 +4705,28 @@ function normalizeChildren(vnode, children) {
|
|
|
4570
4705
|
const { shapeFlag } = vnode;
|
|
4571
4706
|
if (children == null) children = null;
|
|
4572
4707
|
else if ((0, _vue_shared.isArray)(children)) type = 16;
|
|
4573
|
-
else if (typeof children === "object")
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4708
|
+
else if (typeof children === "object") {
|
|
4709
|
+
if (shapeFlag & 65) {
|
|
4710
|
+
const slot = children.default;
|
|
4711
|
+
if (slot) {
|
|
4712
|
+
slot._c && (slot._d = false);
|
|
4713
|
+
normalizeChildren(vnode, slot());
|
|
4714
|
+
slot._c && (slot._d = true);
|
|
4715
|
+
}
|
|
4716
|
+
return;
|
|
4717
|
+
} else {
|
|
4718
|
+
type = 32;
|
|
4719
|
+
const slotFlag = children._;
|
|
4720
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
4721
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
4722
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
4723
|
+
else {
|
|
4724
|
+
children._ = 2;
|
|
4725
|
+
vnode.patchFlag |= 1024;
|
|
4726
|
+
}
|
|
4727
|
+
}
|
|
4589
4728
|
}
|
|
4590
|
-
}
|
|
4591
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
4729
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
4592
4730
|
if (shapeFlag & 65) {
|
|
4593
4731
|
normalizeChildren(vnode, { default: children });
|
|
4594
4732
|
return;
|
|
@@ -4665,6 +4803,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
4665
4803
|
simpleSetCurrentInstance(instance);
|
|
4666
4804
|
}
|
|
4667
4805
|
};
|
|
4806
|
+
/**
|
|
4807
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
4808
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
4809
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
4810
|
+
* @internal
|
|
4811
|
+
*/
|
|
4812
|
+
const restoreCurrentInstance = (prev) => {
|
|
4813
|
+
(0, _vue_reactivity.setCurrentScope)(prev[1]);
|
|
4814
|
+
simpleSetCurrentInstance(prev[0]);
|
|
4815
|
+
};
|
|
4668
4816
|
const internalOptions = [
|
|
4669
4817
|
"ce",
|
|
4670
4818
|
"type",
|
|
@@ -4690,7 +4838,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4690
4838
|
};
|
|
4691
4839
|
//#endregion
|
|
4692
4840
|
//#region packages/runtime-core/src/component.ts
|
|
4693
|
-
const emptyAppContext =
|
|
4841
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
4694
4842
|
let uid = 0;
|
|
4695
4843
|
function createComponentInstance(vnode, parent, suspense) {
|
|
4696
4844
|
const type = vnode.type;
|
|
@@ -4793,7 +4941,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4793
4941
|
const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
|
|
4794
4942
|
const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
|
|
4795
4943
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4796
|
-
|
|
4944
|
+
restoreCurrentInstance(prev);
|
|
4797
4945
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
4798
4946
|
if (isAsyncSetup) {
|
|
4799
4947
|
const unsetCurrentInstance = () => {
|
|
@@ -4801,7 +4949,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4801
4949
|
};
|
|
4802
4950
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
4803
4951
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
4804
|
-
|
|
4952
|
+
setInSSRSetupState(true);
|
|
4953
|
+
try {
|
|
4954
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
4955
|
+
} finally {
|
|
4956
|
+
setInSSRSetupState(false);
|
|
4957
|
+
}
|
|
4805
4958
|
}).catch((e) => {
|
|
4806
4959
|
handleError(e, instance, 0);
|
|
4807
4960
|
});
|
|
@@ -4810,9 +4963,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4810
4963
|
} else finishComponentSetup(instance, isSSR);
|
|
4811
4964
|
}
|
|
4812
4965
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
4813
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
4814
|
-
|
|
4815
|
-
|
|
4966
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
4967
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
4968
|
+
else instance.render = setupResult;
|
|
4969
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
4816
4970
|
finishComponentSetup(instance, isSSR);
|
|
4817
4971
|
}
|
|
4818
4972
|
let compile;
|
|
@@ -4853,7 +5007,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
4853
5007
|
applyOptions(instance);
|
|
4854
5008
|
} finally {
|
|
4855
5009
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4856
|
-
|
|
5010
|
+
restoreCurrentInstance(prevInstance);
|
|
4857
5011
|
}
|
|
4858
5012
|
}
|
|
4859
5013
|
}
|
|
@@ -4879,14 +5033,13 @@ function getComponentPublicInstance(instance) {
|
|
|
4879
5033
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy((0, _vue_reactivity.proxyRefs)((0, _vue_reactivity.markRaw)(instance.exposed)), {
|
|
4880
5034
|
get(target, key) {
|
|
4881
5035
|
if (key in target) return target[key];
|
|
4882
|
-
else {
|
|
5036
|
+
else if (!instance.vapor) {
|
|
4883
5037
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
4884
5038
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
4885
5039
|
}
|
|
4886
5040
|
},
|
|
4887
5041
|
has(target, key) {
|
|
4888
|
-
|
|
4889
|
-
return key in target || key in publicPropertiesMap;
|
|
5042
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
4890
5043
|
}
|
|
4891
5044
|
}));
|
|
4892
5045
|
else return instance.proxy;
|
|
@@ -4908,11 +5061,12 @@ function h(type, propsOrChildren, children) {
|
|
|
4908
5061
|
try {
|
|
4909
5062
|
setBlockTracking(-1);
|
|
4910
5063
|
const l = arguments.length;
|
|
4911
|
-
if (l === 2)
|
|
4912
|
-
if (
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
5064
|
+
if (l === 2) {
|
|
5065
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
5066
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
5067
|
+
return createVNode(type, propsOrChildren);
|
|
5068
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
5069
|
+
} else {
|
|
4916
5070
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
4917
5071
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
4918
5072
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -4923,15 +5077,7 @@ function h(type, propsOrChildren, children) {
|
|
|
4923
5077
|
}
|
|
4924
5078
|
//#endregion
|
|
4925
5079
|
//#region packages/runtime-core/src/customFormatter.ts
|
|
4926
|
-
function initCustomFormatter() {
|
|
4927
|
-
return;
|
|
4928
|
-
function isKeyOfType(Comp, key, type) {
|
|
4929
|
-
const opts = Comp[type];
|
|
4930
|
-
if ((0, _vue_shared.isArray)(opts) && opts.includes(key) || (0, _vue_shared.isObject)(opts) && key in opts) return true;
|
|
4931
|
-
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) return true;
|
|
4932
|
-
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) return true;
|
|
4933
|
-
}
|
|
4934
|
-
}
|
|
5080
|
+
function initCustomFormatter() {}
|
|
4935
5081
|
//#endregion
|
|
4936
5082
|
//#region packages/runtime-core/src/helpers/withMemo.ts
|
|
4937
5083
|
function withMemo(memo, render, cache, index) {
|
|
@@ -4951,7 +5097,7 @@ function isMemoSame(cached, memo) {
|
|
|
4951
5097
|
}
|
|
4952
5098
|
//#endregion
|
|
4953
5099
|
//#region packages/runtime-core/src/index.ts
|
|
4954
|
-
const version = "3.6.0-rc.
|
|
5100
|
+
const version = "3.6.0-rc.10";
|
|
4955
5101
|
const warn = _vue_shared.NOOP;
|
|
4956
5102
|
/**
|
|
4957
5103
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -4974,7 +5120,10 @@ const ssrUtils = {
|
|
|
4974
5120
|
getComponentPublicInstance,
|
|
4975
5121
|
ensureValidVNode,
|
|
4976
5122
|
pushWarningContext,
|
|
4977
|
-
popWarningContext
|
|
5123
|
+
popWarningContext,
|
|
5124
|
+
VaporSlot,
|
|
5125
|
+
rawVaporSlotKey,
|
|
5126
|
+
invokeSlotFallback
|
|
4978
5127
|
};
|
|
4979
5128
|
/**
|
|
4980
5129
|
* @internal only exposed in compat builds
|