@vue/runtime-core 3.6.0-rc.1 → 3.6.0-rc.11
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 +686 -462
- package/dist/runtime-core.cjs.prod.js +540 -383
- package/dist/runtime-core.d.ts +608 -608
- package/dist/runtime-core.esm-bundler.js +701 -464
- 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.11
|
|
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) {
|
|
@@ -765,58 +781,26 @@ const BaseTransitionPropsValidators = {
|
|
|
765
781
|
onAfterAppear: TransitionHookValidator,
|
|
766
782
|
onAppearCancelled: TransitionHookValidator
|
|
767
783
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
784
|
+
function isEmptyTransitionChild(vnode, instance) {
|
|
785
|
+
if (vnode.type === Comment) return true;
|
|
786
|
+
if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
787
|
+
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
788
|
+
}
|
|
772
789
|
const BaseTransitionImpl = {
|
|
773
790
|
name: `BaseTransition`,
|
|
774
791
|
props: BaseTransitionPropsValidators,
|
|
775
792
|
setup(props, { slots }) {
|
|
776
793
|
const instance = getCurrentInstance();
|
|
777
794
|
const state = useTransitionState();
|
|
795
|
+
let resumeAfterLeave;
|
|
778
796
|
return () => {
|
|
779
|
-
const
|
|
780
|
-
const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
|
|
797
|
+
const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
|
|
781
798
|
if (!child) return;
|
|
782
799
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
783
800
|
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;
|
|
801
|
+
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
802
|
+
if (!(instance.job.flags & 4)) instance.update();
|
|
803
|
+
}) : _vue_shared.NOOP);
|
|
820
804
|
};
|
|
821
805
|
}
|
|
822
806
|
};
|
|
@@ -843,7 +827,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
843
827
|
function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
844
828
|
const key = String(vnode.key);
|
|
845
829
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
846
|
-
|
|
830
|
+
const hooks = baseResolveTransitionHooks({
|
|
847
831
|
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
848
832
|
setLeavingNodeCache: () => {
|
|
849
833
|
leavingVNodesCache[key] = vnode;
|
|
@@ -861,6 +845,13 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
861
845
|
return hooks;
|
|
862
846
|
}
|
|
863
847
|
}, props, state, instance);
|
|
848
|
+
if (vnode.type === VaporSlot) (0, _vue_shared.extend)(hooks, {
|
|
849
|
+
__vapor: true,
|
|
850
|
+
props,
|
|
851
|
+
state,
|
|
852
|
+
instance
|
|
853
|
+
});
|
|
854
|
+
return hooks;
|
|
864
855
|
}
|
|
865
856
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
866
857
|
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
@@ -880,8 +871,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
880
871
|
persisted,
|
|
881
872
|
beforeEnter(el) {
|
|
882
873
|
let hook = onBeforeEnter;
|
|
883
|
-
if (!state.isMounted)
|
|
884
|
-
|
|
874
|
+
if (!state.isMounted) {
|
|
875
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
876
|
+
else return;
|
|
877
|
+
}
|
|
885
878
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
886
879
|
earlyRemove();
|
|
887
880
|
callHook(hook, [el]);
|
|
@@ -891,11 +884,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
891
884
|
let hook = onEnter;
|
|
892
885
|
let afterHook = onAfterEnter;
|
|
893
886
|
let cancelHook = onEnterCancelled;
|
|
894
|
-
if (!state.isMounted)
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
887
|
+
if (!state.isMounted) {
|
|
888
|
+
if (appear) {
|
|
889
|
+
hook = onAppear || onEnter;
|
|
890
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
891
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
892
|
+
} else return;
|
|
893
|
+
}
|
|
899
894
|
let called = false;
|
|
900
895
|
el[enterCbKey] = (cancelled) => {
|
|
901
896
|
if (called) return;
|
|
@@ -929,7 +924,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
929
924
|
else done();
|
|
930
925
|
},
|
|
931
926
|
clone(node) {
|
|
932
|
-
return cloneHooks(node);
|
|
927
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
933
928
|
}
|
|
934
929
|
};
|
|
935
930
|
return hooks;
|
|
@@ -953,16 +948,91 @@ function getInnerChild$1(vnode) {
|
|
|
953
948
|
if (shapeFlag & 32 && (0, _vue_shared.isFunction)(children.default)) return children.default();
|
|
954
949
|
}
|
|
955
950
|
}
|
|
951
|
+
function resolveTransitionChild(children, renderEmpty = false) {
|
|
952
|
+
const branches = children && getTransitionRawChildren(children, true);
|
|
953
|
+
return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* @internal
|
|
957
|
+
*/
|
|
958
|
+
function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
|
|
959
|
+
if (state.isLeaving) return emptyPlaceholder(next);
|
|
960
|
+
const nextInner = getInnerChild$1(next);
|
|
961
|
+
if (!nextInner) return emptyPlaceholder(next);
|
|
962
|
+
let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
|
|
963
|
+
if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
|
|
964
|
+
enterHooks = hooks;
|
|
965
|
+
});
|
|
966
|
+
if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
|
|
967
|
+
if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
|
|
968
|
+
const mode = props.mode;
|
|
969
|
+
const previousInner = previous && getInnerChild$1(previous);
|
|
970
|
+
if (previous && previousInner && !isSameVNodeType(previousInner, nextInner) && !isEmptyTransitionChild(previousInner, instance)) {
|
|
971
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
972
|
+
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);
|
|
973
|
+
}
|
|
974
|
+
return next;
|
|
975
|
+
}
|
|
976
|
+
function forwardDelayedLeave(hooks, source) {
|
|
977
|
+
const delayedLeave = source && source.delayedLeave;
|
|
978
|
+
if (!delayedLeave) return;
|
|
979
|
+
hooks.delayedLeave = () => {
|
|
980
|
+
if (source.delayedLeave === delayedLeave) delayedLeave();
|
|
981
|
+
delete hooks.delayedLeave;
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
985
|
+
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
986
|
+
}
|
|
987
|
+
function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
|
|
988
|
+
if (props.mode === "out-in") {
|
|
989
|
+
state.isLeaving = true;
|
|
990
|
+
leavingHooks.afterLeave = () => {
|
|
991
|
+
state.isLeaving = false;
|
|
992
|
+
resumeAfterLeave();
|
|
993
|
+
delete leavingHooks.afterLeave;
|
|
994
|
+
};
|
|
995
|
+
return true;
|
|
996
|
+
} else if (props.mode === "in-out" && getEnterHooks) {
|
|
997
|
+
let delayedLeavingVNode = leavingVNode;
|
|
998
|
+
leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
999
|
+
const enterHooks = getEnterHooks();
|
|
1000
|
+
if (!enterHooks) {
|
|
1001
|
+
delayedLeave();
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
const vnode = delayedLeavingVNode;
|
|
1005
|
+
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1006
|
+
leavingVNodesCache[String(vnode.key)] = vnode;
|
|
1007
|
+
el[leaveCbKey] = () => {
|
|
1008
|
+
earlyRemove();
|
|
1009
|
+
el[leaveCbKey] = void 0;
|
|
1010
|
+
delete enterHooks.delayedLeave;
|
|
1011
|
+
delayedLeavingVNode = void 0;
|
|
1012
|
+
};
|
|
1013
|
+
enterHooks.delayedLeave = () => {
|
|
1014
|
+
delayedLeave();
|
|
1015
|
+
delete enterHooks.delayedLeave;
|
|
1016
|
+
delayedLeavingVNode = void 0;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
956
1022
|
function setTransitionHooks(vnode, hooks) {
|
|
957
|
-
if (vnode.shapeFlag & 6 && vnode.component)
|
|
958
|
-
else {
|
|
1023
|
+
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
959
1024
|
vnode.transition = hooks;
|
|
960
|
-
setTransitionHooks(vnode.component
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1025
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1026
|
+
else {
|
|
1027
|
+
const subTree = vnode.component.subTree;
|
|
1028
|
+
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
1029
|
+
}
|
|
1030
|
+
} else if (vnode.shapeFlag & 128) {
|
|
1031
|
+
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1032
|
+
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1033
|
+
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
965
1034
|
} else vnode.transition = hooks;
|
|
1035
|
+
return hooks;
|
|
966
1036
|
}
|
|
967
1037
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
968
1038
|
let ret = [];
|
|
@@ -980,9 +1050,9 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
980
1050
|
}
|
|
981
1051
|
//#endregion
|
|
982
1052
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
983
|
-
|
|
1053
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
984
1054
|
function defineComponent(options, extraOptions) {
|
|
985
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1055
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
986
1056
|
}
|
|
987
1057
|
//#endregion
|
|
988
1058
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1069,15 +1139,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1069
1139
|
if (rawRef.f) {
|
|
1070
1140
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1071
1141
|
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
|
-
|
|
1142
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1143
|
+
if (_isString) {
|
|
1144
|
+
refs[ref] = [refValue];
|
|
1145
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1146
|
+
} else {
|
|
1147
|
+
const newVal = [refValue];
|
|
1148
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1149
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1150
|
+
}
|
|
1151
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1081
1152
|
} else if (_isString) {
|
|
1082
1153
|
refs[ref] = value;
|
|
1083
1154
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1127,7 +1198,18 @@ const logMismatchError = () => {
|
|
|
1127
1198
|
hasLoggedMismatchError = true;
|
|
1128
1199
|
};
|
|
1129
1200
|
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1130
|
-
const isMathMLContainer = (container) =>
|
|
1201
|
+
const isMathMLContainer = (container) => {
|
|
1202
|
+
if (!container.namespaceURI.includes("MathML")) return false;
|
|
1203
|
+
if (container.tagName !== "annotation-xml") return true;
|
|
1204
|
+
const encoding = container.getAttribute("encoding");
|
|
1205
|
+
return !encoding || !encoding.includes("html");
|
|
1206
|
+
};
|
|
1207
|
+
/**
|
|
1208
|
+
* Resolve the element namespace a container's children should be created in.
|
|
1209
|
+
* The live DOM is the source of truth, so this also covers containers that are
|
|
1210
|
+
* only known at runtime (interop boundaries, teleport targets).
|
|
1211
|
+
* @internal
|
|
1212
|
+
*/
|
|
1131
1213
|
const getContainerType = (container) => {
|
|
1132
1214
|
if (container.nodeType !== 1) return void 0;
|
|
1133
1215
|
if (isSVGContainer(container)) return "svg";
|
|
@@ -1150,7 +1232,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1150
1232
|
};
|
|
1151
1233
|
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1152
1234
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
1153
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1235
|
+
const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
|
|
1154
1236
|
const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
|
|
1155
1237
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1156
1238
|
let domType = node.nodeType;
|
|
@@ -1162,11 +1244,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1162
1244
|
let nextNode = null;
|
|
1163
1245
|
switch (type) {
|
|
1164
1246
|
case Text:
|
|
1165
|
-
if (domType !== 3)
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1247
|
+
if (domType !== 3) {
|
|
1248
|
+
if (vnode.children === "") {
|
|
1249
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1250
|
+
nextNode = node;
|
|
1251
|
+
} else nextNode = onMismatch();
|
|
1252
|
+
} else {
|
|
1170
1253
|
if (node.data !== vnode.children) {
|
|
1171
1254
|
logMismatchError();
|
|
1172
1255
|
node.data = vnode.children;
|
|
@@ -1202,45 +1285,35 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1202
1285
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1203
1286
|
break;
|
|
1204
1287
|
case VaporSlot:
|
|
1205
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
|
|
1288
|
+
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1206
1289
|
break;
|
|
1207
|
-
default: if (shapeFlag & 1)
|
|
1208
|
-
|
|
1209
|
-
|
|
1290
|
+
default: if (shapeFlag & 1) {
|
|
1291
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1292
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1293
|
+
} else if (shapeFlag & 6) {
|
|
1210
1294
|
vnode.slotScopeIds = slotScopeIds;
|
|
1211
1295
|
const container = parentNode(node);
|
|
1212
1296
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1213
1297
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1214
1298
|
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 {
|
|
1299
|
+
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1300
|
+
else {
|
|
1229
1301
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1230
1302
|
const component = vnode.component;
|
|
1231
|
-
if (isAsyncWrapper(vnode)
|
|
1303
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
1232
1304
|
let subTree;
|
|
1233
1305
|
if (isFragmentStart) {
|
|
1234
|
-
subTree = createVNode(
|
|
1306
|
+
subTree = createVNode(Static);
|
|
1235
1307
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1236
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1308
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
1237
1309
|
subTree.el = node;
|
|
1238
1310
|
component.subTree = subTree;
|
|
1239
1311
|
}
|
|
1240
1312
|
}
|
|
1241
|
-
} else if (shapeFlag & 64)
|
|
1242
|
-
|
|
1243
|
-
|
|
1313
|
+
} else if (shapeFlag & 64) {
|
|
1314
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1315
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1316
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1244
1317
|
}
|
|
1245
1318
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
1246
1319
|
return nextNode;
|
|
@@ -1285,7 +1358,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1285
1358
|
if (forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
|
|
1286
1359
|
const isCustomElement = el.tagName.includes("-");
|
|
1287
1360
|
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))
|
|
1361
|
+
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)) {
|
|
1362
|
+
if (isUnchangedResourceProp(el, key, props[key])) continue;
|
|
1363
|
+
patchProp(el, key, null, props[key], namespace, parentComponent);
|
|
1364
|
+
}
|
|
1289
1365
|
} else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
|
|
1290
1366
|
else if (patchFlag & 4 && (0, _vue_reactivity.isReactive)(props.style)) for (const key in props.style) props.style[key];
|
|
1291
1367
|
}
|
|
@@ -1331,8 +1407,9 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1331
1407
|
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1332
1408
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1333
1409
|
const container = parentNode(node);
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1410
|
+
const first = nextSibling(node);
|
|
1411
|
+
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1412
|
+
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1336
1413
|
else {
|
|
1337
1414
|
logMismatchError();
|
|
1338
1415
|
insert(vnode.anchor = createComment(`]`), container, next);
|
|
@@ -1354,20 +1431,22 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1354
1431
|
const container = parentNode(node);
|
|
1355
1432
|
remove(node);
|
|
1356
1433
|
patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
|
|
1357
|
-
if (parentComponent) {
|
|
1434
|
+
if (parentComponent && parentComponent.vnode) {
|
|
1358
1435
|
parentComponent.vnode.el = vnode.el;
|
|
1359
1436
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
1360
1437
|
}
|
|
1361
1438
|
return next;
|
|
1362
1439
|
};
|
|
1363
|
-
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1440
|
+
const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
|
|
1364
1441
|
let match = 0;
|
|
1365
1442
|
while (node) {
|
|
1366
1443
|
node = nextSibling(node);
|
|
1367
1444
|
if (node && isComment(node)) {
|
|
1368
1445
|
if (node.data === open) match++;
|
|
1369
|
-
if (node.data === close)
|
|
1370
|
-
|
|
1446
|
+
if (node.data === close) {
|
|
1447
|
+
if (match === 0) return nextSibling(node);
|
|
1448
|
+
else match--;
|
|
1449
|
+
}
|
|
1371
1450
|
}
|
|
1372
1451
|
}
|
|
1373
1452
|
return node;
|
|
@@ -1377,7 +1456,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1377
1456
|
if (parentNode) parentNode.replaceChild(newNode, oldNode);
|
|
1378
1457
|
let parent = parentComponent;
|
|
1379
1458
|
while (parent) {
|
|
1380
|
-
if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1459
|
+
if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
|
|
1381
1460
|
parent = parent.parent;
|
|
1382
1461
|
}
|
|
1383
1462
|
};
|
|
@@ -1386,6 +1465,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1386
1465
|
const isTemplateNode = (node) => {
|
|
1387
1466
|
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
1388
1467
|
};
|
|
1468
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1469
|
+
"src",
|
|
1470
|
+
"srcset",
|
|
1471
|
+
"href",
|
|
1472
|
+
"poster"
|
|
1473
|
+
]);
|
|
1474
|
+
function isUnchangedResourceProp(el, key, clientValue) {
|
|
1475
|
+
if (!resourceProps.has(key)) return false;
|
|
1476
|
+
return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
|
|
1477
|
+
}
|
|
1389
1478
|
const allowMismatchAttr = "data-allow-mismatch";
|
|
1390
1479
|
const MismatchTypeString = {
|
|
1391
1480
|
[0]: "text",
|
|
@@ -1490,16 +1579,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
|
1490
1579
|
return teardown;
|
|
1491
1580
|
};
|
|
1492
1581
|
function forEachElement(node, cb) {
|
|
1493
|
-
if (isComment(node) && node.data === "[") {
|
|
1582
|
+
if (isComment(node) && (node.data === "[" || node.data === "(")) {
|
|
1583
|
+
const open = node.data;
|
|
1584
|
+
const close = open === "[" ? "]" : ")";
|
|
1494
1585
|
let depth = 1;
|
|
1495
1586
|
let next = node.nextSibling;
|
|
1496
1587
|
while (next) {
|
|
1497
1588
|
if (next.nodeType === 1) {
|
|
1498
1589
|
if (cb(next) === false) break;
|
|
1499
1590
|
} else if (isComment(next)) {
|
|
1500
|
-
if (next.data ===
|
|
1591
|
+
if (next.data === close) {
|
|
1501
1592
|
if (--depth === 0) break;
|
|
1502
|
-
} else if (next.data ===
|
|
1593
|
+
} else if (next.data === open) depth++;
|
|
1503
1594
|
}
|
|
1504
1595
|
next = next.nextSibling;
|
|
1505
1596
|
}
|
|
@@ -1508,14 +1599,14 @@ function forEachElement(node, cb) {
|
|
|
1508
1599
|
//#endregion
|
|
1509
1600
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1510
1601
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1511
|
-
|
|
1602
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1512
1603
|
function defineAsyncComponent(source) {
|
|
1513
1604
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
1514
1605
|
return /* @__PURE__ */ defineComponent({
|
|
1515
1606
|
name: "AsyncComponentWrapper",
|
|
1516
1607
|
__asyncLoader: load,
|
|
1517
1608
|
__asyncHydrate(el, instance, hydrate) {
|
|
1518
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
1609
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
1519
1610
|
},
|
|
1520
1611
|
get __asyncResolved() {
|
|
1521
1612
|
return getResolvedComp();
|
|
@@ -1632,10 +1723,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
1632
1723
|
* shared between core and vapor
|
|
1633
1724
|
* @internal
|
|
1634
1725
|
*/
|
|
1635
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
1726
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
1636
1727
|
const wasConnected = el.isConnected;
|
|
1637
1728
|
let patched = false;
|
|
1638
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1729
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1639
1730
|
const performHydrate = () => {
|
|
1640
1731
|
if (patched) return;
|
|
1641
1732
|
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
@@ -1718,10 +1809,13 @@ const KeepAlive = {
|
|
|
1718
1809
|
});
|
|
1719
1810
|
let pendingCacheKey = null;
|
|
1720
1811
|
const cacheSubtree = () => {
|
|
1721
|
-
if (pendingCacheKey != null)
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1812
|
+
if (pendingCacheKey != null) {
|
|
1813
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
1814
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
1815
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
1816
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
1817
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
1818
|
+
}
|
|
1725
1819
|
};
|
|
1726
1820
|
onMounted(cacheSubtree);
|
|
1727
1821
|
onUpdated(cacheSubtree);
|
|
@@ -1875,7 +1969,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
1875
1969
|
try {
|
|
1876
1970
|
return callWithAsyncErrorHandling(hook, target, type, args);
|
|
1877
1971
|
} finally {
|
|
1878
|
-
|
|
1972
|
+
restoreCurrentInstance(prev);
|
|
1879
1973
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
1880
1974
|
}
|
|
1881
1975
|
});
|
|
@@ -1959,16 +2053,17 @@ function renderList(source, renderItem, cache, index) {
|
|
|
1959
2053
|
} else if (typeof source === "number") {
|
|
1960
2054
|
ret = new Array(source);
|
|
1961
2055
|
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
|
-
|
|
2056
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2057
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2058
|
+
else {
|
|
2059
|
+
const keys = Object.keys(source);
|
|
2060
|
+
ret = new Array(keys.length);
|
|
2061
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2062
|
+
const key = keys[i];
|
|
2063
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2064
|
+
}
|
|
1969
2065
|
}
|
|
1970
|
-
}
|
|
1971
|
-
else ret = [];
|
|
2066
|
+
} else ret = [];
|
|
1972
2067
|
if (cache) cache[index] = ret;
|
|
1973
2068
|
return ret;
|
|
1974
2069
|
}
|
|
@@ -1993,18 +2088,45 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1993
2088
|
//#endregion
|
|
1994
2089
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
1995
2090
|
/**
|
|
2091
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2092
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2093
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2094
|
+
* "which one". Internal to vapor interop.
|
|
2095
|
+
*/
|
|
2096
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2097
|
+
/**
|
|
2098
|
+
* Invokes a VDOM slot fallback under the outlet owner that produced it, the
|
|
2099
|
+
* way `renderSlot` would have rendered it inline. Vapor interop invokes
|
|
2100
|
+
* fallbacks late, outside any render, so it passes the owner recorded on the
|
|
2101
|
+
* vapor slot vnode. Internal to vapor interop.
|
|
2102
|
+
*/
|
|
2103
|
+
function invokeSlotFallback(fallback, owner) {
|
|
2104
|
+
if (!owner) return fallback();
|
|
2105
|
+
const prev = setCurrentRenderingInstance(owner);
|
|
2106
|
+
const prevStackSize = blockStack.length;
|
|
2107
|
+
try {
|
|
2108
|
+
return fallback();
|
|
2109
|
+
} finally {
|
|
2110
|
+
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2111
|
+
setCurrentRenderingInstance(prev);
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
1996
2115
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1997
2116
|
* @private
|
|
1998
2117
|
*/
|
|
1999
|
-
function renderSlot(slots, name, props
|
|
2118
|
+
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2119
|
+
if (props == null) props = {};
|
|
2000
2120
|
let slot = slots[name];
|
|
2001
|
-
|
|
2002
|
-
const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
|
|
2121
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2003
2122
|
if (vaporSlot) {
|
|
2004
2123
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2005
2124
|
ret.vs = {
|
|
2006
2125
|
slot: vaporSlot,
|
|
2007
|
-
fallback
|
|
2126
|
+
outlets: fallback ? [{
|
|
2127
|
+
fallback,
|
|
2128
|
+
owner: currentRenderingInstance
|
|
2129
|
+
}] : void 0
|
|
2008
2130
|
};
|
|
2009
2131
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2010
2132
|
return ret;
|
|
@@ -2021,9 +2143,15 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
|
|
|
2021
2143
|
let rendered;
|
|
2022
2144
|
try {
|
|
2023
2145
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2024
|
-
|
|
2146
|
+
let attached = false;
|
|
2147
|
+
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2148
|
+
const interop = currentRenderingInstance.appContext.vapor;
|
|
2149
|
+
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2150
|
+
}
|
|
2025
2151
|
const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
|
|
2026
2152
|
rendered = createBlock(Fragment, { key: (slotKey && !(0, _vue_shared.isSymbol)(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
|
|
2153
|
+
if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
|
|
2154
|
+
if (attached) rendered.vo = true;
|
|
2027
2155
|
} catch (err) {
|
|
2028
2156
|
for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
|
|
2029
2157
|
throw err;
|
|
@@ -2041,10 +2169,6 @@ function ensureValidVNode(vnodes) {
|
|
|
2041
2169
|
return true;
|
|
2042
2170
|
}) ? vnodes : null;
|
|
2043
2171
|
}
|
|
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
2172
|
//#endregion
|
|
2049
2173
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2050
2174
|
/**
|
|
@@ -2152,7 +2276,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
2152
2276
|
return Reflect.defineProperty(target, key, descriptor);
|
|
2153
2277
|
}
|
|
2154
2278
|
};
|
|
2155
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2279
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2156
2280
|
get(target, key) {
|
|
2157
2281
|
if (key === Symbol.unscopables) return;
|
|
2158
2282
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2265,12 +2389,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2265
2389
|
for (const key in defaults) {
|
|
2266
2390
|
if (key.startsWith("__skip")) continue;
|
|
2267
2391
|
let opt = props[key];
|
|
2268
|
-
if (opt)
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2392
|
+
if (opt) {
|
|
2393
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
2394
|
+
type: opt,
|
|
2395
|
+
default: defaults[key]
|
|
2396
|
+
};
|
|
2397
|
+
else opt.default = defaults[key];
|
|
2398
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2274
2399
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2275
2400
|
}
|
|
2276
2401
|
return props;
|
|
@@ -2319,36 +2444,31 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2319
2444
|
function withAsyncContext(getAwaitable) {
|
|
2320
2445
|
const ctx = getCurrentGenericInstance();
|
|
2321
2446
|
const inSSRSetup = isInSSRComponentSetup;
|
|
2322
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
2323
2447
|
let awaitable = getAwaitable();
|
|
2324
2448
|
setCurrentInstance(null, void 0);
|
|
2325
2449
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2326
2450
|
const restore = () => {
|
|
2327
|
-
const
|
|
2451
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
2328
2452
|
setCurrentInstance(ctx);
|
|
2329
2453
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
2330
|
-
|
|
2331
|
-
return () => {
|
|
2332
|
-
if (reset) reset();
|
|
2333
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
2334
|
-
};
|
|
2454
|
+
return stoppedScope;
|
|
2335
2455
|
};
|
|
2336
2456
|
const cleanup = () => {
|
|
2337
2457
|
setCurrentInstance(null, void 0);
|
|
2338
2458
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
2339
2459
|
};
|
|
2340
2460
|
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2341
|
-
const
|
|
2461
|
+
const stoppedScope = restore();
|
|
2342
2462
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
2343
|
-
if (
|
|
2463
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2344
2464
|
cleanup();
|
|
2345
2465
|
}));
|
|
2346
2466
|
throw e;
|
|
2347
2467
|
});
|
|
2348
2468
|
return [awaitable, () => {
|
|
2349
|
-
const
|
|
2469
|
+
const stoppedScope = restore();
|
|
2350
2470
|
Promise.resolve().then(() => {
|
|
2351
|
-
if (
|
|
2471
|
+
if (stoppedScope) stoppedScope.reset();
|
|
2352
2472
|
cleanup();
|
|
2353
2473
|
});
|
|
2354
2474
|
}];
|
|
@@ -2376,9 +2496,11 @@ function applyOptions(instance) {
|
|
|
2376
2496
|
shouldCacheAccess = true;
|
|
2377
2497
|
if (computedOptions) for (const key in computedOptions) {
|
|
2378
2498
|
const opt = computedOptions[key];
|
|
2499
|
+
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;
|
|
2500
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : _vue_shared.NOOP;
|
|
2379
2501
|
const c = computed({
|
|
2380
|
-
get
|
|
2381
|
-
set
|
|
2502
|
+
get,
|
|
2503
|
+
set
|
|
2382
2504
|
});
|
|
2383
2505
|
Object.defineProperty(ctx, key, {
|
|
2384
2506
|
enumerable: true,
|
|
@@ -2434,9 +2556,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
2434
2556
|
for (const key in injectOptions) {
|
|
2435
2557
|
const opt = injectOptions[key];
|
|
2436
2558
|
let injected;
|
|
2437
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
2438
|
-
|
|
2439
|
-
|
|
2559
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
2560
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
2561
|
+
else injected = inject(opt.from || key);
|
|
2562
|
+
} else injected = inject(opt);
|
|
2440
2563
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
2441
2564
|
enumerable: true,
|
|
2442
2565
|
configurable: true,
|
|
@@ -2455,10 +2578,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
2455
2578
|
const handler = ctx[raw];
|
|
2456
2579
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
2457
2580
|
} else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
|
|
2458
|
-
else if ((0, _vue_shared.isObject)(raw))
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2581
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
2582
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2583
|
+
else {
|
|
2584
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2585
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
2586
|
+
}
|
|
2462
2587
|
}
|
|
2463
2588
|
}
|
|
2464
2589
|
/**
|
|
@@ -2544,7 +2669,7 @@ function mergeObjectOptions(to, from) {
|
|
|
2544
2669
|
}
|
|
2545
2670
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
2546
2671
|
if (to) {
|
|
2547
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
2672
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2548
2673
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
2549
2674
|
} else return from;
|
|
2550
2675
|
}
|
|
@@ -2676,13 +2801,17 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
2676
2801
|
const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
|
|
2677
2802
|
const res = (0, _vue_reactivity.customRef)((track, trigger) => {
|
|
2678
2803
|
let localValue;
|
|
2804
|
+
let prevPropValue = _vue_shared.EMPTY_OBJ;
|
|
2679
2805
|
let prevSetValue = _vue_shared.EMPTY_OBJ;
|
|
2680
2806
|
let prevEmittedValue;
|
|
2681
2807
|
watchSyncEffect(() => {
|
|
2682
2808
|
const propValue = props[camelizedName];
|
|
2683
|
-
if ((0, _vue_shared.hasChanged)(
|
|
2684
|
-
|
|
2685
|
-
|
|
2809
|
+
if ((0, _vue_shared.hasChanged)(prevPropValue, propValue)) {
|
|
2810
|
+
prevPropValue = propValue;
|
|
2811
|
+
if ((0, _vue_shared.hasChanged)(localValue, propValue)) {
|
|
2812
|
+
localValue = propValue;
|
|
2813
|
+
trigger();
|
|
2814
|
+
}
|
|
2686
2815
|
}
|
|
2687
2816
|
});
|
|
2688
2817
|
return {
|
|
@@ -2747,7 +2876,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
2747
2876
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
2748
2877
|
if (modifiers) {
|
|
2749
2878
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
2750
|
-
if (modifiers.number) args =
|
|
2879
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
2751
2880
|
}
|
|
2752
2881
|
let handlerName;
|
|
2753
2882
|
let handler = getter(props, handlerName = (0, _vue_shared.toHandlerKey)(event)) || getter(props, handlerName = (0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)));
|
|
@@ -2848,7 +2977,7 @@ function renderComponentRoot(instance) {
|
|
|
2848
2977
|
root = cloneVNode(root, null, false, true);
|
|
2849
2978
|
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
|
|
2850
2979
|
}
|
|
2851
|
-
if (vnode.transition) setTransitionHooks(root, vnode.transition);
|
|
2980
|
+
if (vnode.transition) setTransitionHooks(isTeleport(root.type) ? getInnerChild$1(root) || root : root, vnode.transition);
|
|
2852
2981
|
result = root;
|
|
2853
2982
|
setCurrentRenderingInstance(prev);
|
|
2854
2983
|
return result;
|
|
@@ -2858,15 +2987,18 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
2858
2987
|
for (let i = 0; i < children.length; i++) {
|
|
2859
2988
|
const child = children[i];
|
|
2860
2989
|
if (isVNode(child)) {
|
|
2861
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
2862
|
-
|
|
2990
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
2991
|
+
if (singleRoot) return;
|
|
2992
|
+
else singleRoot = child;
|
|
2993
|
+
}
|
|
2863
2994
|
} else return;
|
|
2864
2995
|
}
|
|
2865
2996
|
return singleRoot;
|
|
2866
2997
|
}
|
|
2998
|
+
const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || (0, _vue_shared.isOn)(key);
|
|
2867
2999
|
const getFunctionalFallthrough = (attrs) => {
|
|
2868
3000
|
let res;
|
|
2869
|
-
for (const key in attrs) if (
|
|
3001
|
+
for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
|
|
2870
3002
|
return res;
|
|
2871
3003
|
};
|
|
2872
3004
|
const filterModelListeners = (attrs, props) => {
|
|
@@ -2967,16 +3099,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2967
3099
|
let key = propsToUpdate[i];
|
|
2968
3100
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
2969
3101
|
const value = rawProps[key];
|
|
2970
|
-
if (options)
|
|
2971
|
-
if (
|
|
2972
|
-
attrs[key]
|
|
2973
|
-
|
|
3102
|
+
if (options) {
|
|
3103
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3104
|
+
if (value !== attrs[key]) {
|
|
3105
|
+
attrs[key] = value;
|
|
3106
|
+
hasAttrsChanged = true;
|
|
3107
|
+
}
|
|
3108
|
+
} else {
|
|
3109
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3110
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
2974
3111
|
}
|
|
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]) {
|
|
3112
|
+
} else if (value !== attrs[key]) {
|
|
2980
3113
|
attrs[key] = value;
|
|
2981
3114
|
hasAttrsChanged = true;
|
|
2982
3115
|
}
|
|
@@ -2985,9 +3118,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
2985
3118
|
} else {
|
|
2986
3119
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
2987
3120
|
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
|
-
|
|
3121
|
+
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))) {
|
|
3122
|
+
if (options) {
|
|
3123
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3124
|
+
} else delete props[key];
|
|
3125
|
+
}
|
|
2991
3126
|
if (attrs !== rawCurrentProps) {
|
|
2992
3127
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
2993
3128
|
delete attrs[key];
|
|
@@ -3005,9 +3140,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3005
3140
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3006
3141
|
const value = rawProps[key];
|
|
3007
3142
|
let camelKey;
|
|
3008
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3009
|
-
|
|
3010
|
-
|
|
3143
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3144
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3145
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3146
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3011
3147
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3012
3148
|
attrs[key] = value;
|
|
3013
3149
|
hasAttrsChanged = true;
|
|
@@ -3054,7 +3190,7 @@ function baseResolveDefault(factory, instance, key) {
|
|
|
3054
3190
|
const prev = setCurrentInstance(instance);
|
|
3055
3191
|
const props = (0, _vue_reactivity.toRaw)(instance.props);
|
|
3056
3192
|
value = factory.call(null, props);
|
|
3057
|
-
|
|
3193
|
+
restoreCurrentInstance(prev);
|
|
3058
3194
|
return value;
|
|
3059
3195
|
}
|
|
3060
3196
|
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3168,9 +3304,10 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3168
3304
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
3169
3305
|
if (vnode.shapeFlag & 32) {
|
|
3170
3306
|
const type = children._;
|
|
3171
|
-
if (type)
|
|
3172
|
-
|
|
3173
|
-
|
|
3307
|
+
if (type) {
|
|
3308
|
+
if (optimized && type === 1) needDeletionCheck = false;
|
|
3309
|
+
else assignSlots(slots, children, optimized);
|
|
3310
|
+
} else {
|
|
3174
3311
|
needDeletionCheck = !children.$stable;
|
|
3175
3312
|
normalizeObjectSlots(children, slots, instance);
|
|
3176
3313
|
}
|
|
@@ -3230,6 +3367,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3230
3367
|
optimized = false;
|
|
3231
3368
|
n2.dynamicChildren = null;
|
|
3232
3369
|
}
|
|
3370
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
3371
|
+
if (n2.dynamicChildren === _vue_shared.EMPTY_ARR) n2.dynamicChildren = [];
|
|
3372
|
+
n2.dynamicChildren.hasOnce = true;
|
|
3373
|
+
}
|
|
3233
3374
|
const { type, ref, shapeFlag } = n2;
|
|
3234
3375
|
switch (type) {
|
|
3235
3376
|
case Text:
|
|
@@ -3245,7 +3386,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3245
3386
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3246
3387
|
break;
|
|
3247
3388
|
case VaporSlot:
|
|
3248
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
3389
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
3249
3390
|
break;
|
|
3250
3391
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3251
3392
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -3341,7 +3482,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3341
3482
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
3342
3483
|
};
|
|
3343
3484
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
3344
|
-
for (let i = start; i < children.length; i++)
|
|
3485
|
+
for (let i = start; i < children.length; i++) {
|
|
3486
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
3487
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3488
|
+
}
|
|
3345
3489
|
};
|
|
3346
3490
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3347
3491
|
const el = n2.el = n1.el;
|
|
@@ -3352,6 +3496,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3352
3496
|
let vnodeHook;
|
|
3353
3497
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
3354
3498
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3499
|
+
if (n2.ibu) n2.ibu();
|
|
3355
3500
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3356
3501
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
3357
3502
|
if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -3383,8 +3528,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3383
3528
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
3384
3529
|
}
|
|
3385
3530
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
3386
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
3531
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
3387
3532
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3533
|
+
n2.iu && n2.iu();
|
|
3388
3534
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3389
3535
|
}, void 0, parentSuspense);
|
|
3390
3536
|
};
|
|
@@ -3392,7 +3538,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3392
3538
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3393
3539
|
const oldVNode = oldChildren[i];
|
|
3394
3540
|
const newVNode = newChildren[i];
|
|
3395
|
-
|
|
3541
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
3542
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3396
3543
|
}
|
|
3397
3544
|
};
|
|
3398
3545
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -3425,41 +3572,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3425
3572
|
};
|
|
3426
3573
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3427
3574
|
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);
|
|
3575
|
+
if (n2.type.__vapor) {
|
|
3576
|
+
if (n1 == null) {
|
|
3577
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
3578
|
+
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
3579
|
+
} else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
|
|
3580
|
+
} else if (n1 == null) {
|
|
3581
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3582
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
3583
|
+
} else updateComponent(n1, n2, optimized);
|
|
3463
3584
|
};
|
|
3464
3585
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
3465
3586
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -3490,14 +3611,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3490
3611
|
};
|
|
3491
3612
|
const updateComponent = (n1, n2, optimized) => {
|
|
3492
3613
|
const instance = n2.component = n1.component;
|
|
3493
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
3494
|
-
|
|
3495
|
-
|
|
3614
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3615
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3616
|
+
n2.el = n1.el;
|
|
3617
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
3618
|
+
return;
|
|
3619
|
+
} else {
|
|
3620
|
+
instance.next = n2;
|
|
3621
|
+
instance.effect.run();
|
|
3622
|
+
}
|
|
3496
3623
|
} else {
|
|
3497
|
-
instance.next = n2;
|
|
3498
|
-
instance.effect.run();
|
|
3499
|
-
}
|
|
3500
|
-
else {
|
|
3501
3624
|
n2.el = n1.el;
|
|
3502
3625
|
instance.vnode = n2;
|
|
3503
3626
|
}
|
|
@@ -3583,6 +3706,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3583
3706
|
} else next = vnode;
|
|
3584
3707
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
3585
3708
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3709
|
+
if (next.ibu) next.ibu();
|
|
3586
3710
|
toggleRecurse(instance, true);
|
|
3587
3711
|
const nextTree = renderComponentRoot(instance);
|
|
3588
3712
|
const prevTree = instance.subTree;
|
|
@@ -3591,7 +3715,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3591
3715
|
next.el = nextTree.el;
|
|
3592
3716
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
3593
3717
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
3594
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
3718
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
3719
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3720
|
+
next.iu && next.iu();
|
|
3721
|
+
}, void 0, parentSuspense);
|
|
3595
3722
|
}
|
|
3596
3723
|
}
|
|
3597
3724
|
}
|
|
@@ -3629,9 +3756,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3629
3756
|
if (shapeFlag & 8) {
|
|
3630
3757
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
3631
3758
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
3632
|
-
} else if (prevShapeFlag & 16)
|
|
3633
|
-
|
|
3634
|
-
|
|
3759
|
+
} else if (prevShapeFlag & 16) {
|
|
3760
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3761
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
3762
|
+
} else {
|
|
3635
3763
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
3636
3764
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3637
3765
|
}
|
|
@@ -3727,15 +3855,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3727
3855
|
const anchorVNode = c2[nextIndex + 1];
|
|
3728
3856
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
3729
3857
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3730
|
-
else if (moved)
|
|
3731
|
-
|
|
3858
|
+
else if (moved) {
|
|
3859
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
3860
|
+
else j--;
|
|
3861
|
+
}
|
|
3732
3862
|
}
|
|
3733
3863
|
}
|
|
3734
3864
|
};
|
|
3735
3865
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
3736
3866
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
3737
3867
|
if (isVaporComponent(type) || type === VaporSlot) {
|
|
3738
|
-
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
|
|
3868
|
+
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
3739
3869
|
return;
|
|
3740
3870
|
}
|
|
3741
3871
|
if (shapeFlag & 6) {
|
|
@@ -3760,54 +3890,37 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3760
3890
|
moveStaticNode(vnode, container, anchor);
|
|
3761
3891
|
return;
|
|
3762
3892
|
}
|
|
3763
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
const remove = () => {
|
|
3893
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
3894
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
3895
|
+
else performTransitionLeave(el, transition, () => {
|
|
3767
3896
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
3768
3897
|
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);
|
|
3898
|
+
}, true, true);
|
|
3899
|
+
} else hostInsert(el, container, anchor);
|
|
3783
3900
|
};
|
|
3784
3901
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3785
3902
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
3786
|
-
if (patchFlag === -2) optimized = false;
|
|
3903
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
3787
3904
|
if (ref != null) {
|
|
3788
3905
|
const prevSub = (0, _vue_reactivity.setActiveSub)();
|
|
3789
3906
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
3790
3907
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
3791
3908
|
}
|
|
3792
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3909
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
3793
3910
|
if (shapeFlag & 256) {
|
|
3794
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
|
|
3911
|
+
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
3795
3912
|
else parentComponent.ctx.deactivate(vnode);
|
|
3796
3913
|
return;
|
|
3797
3914
|
}
|
|
3915
|
+
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
3916
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3917
|
+
return;
|
|
3918
|
+
}
|
|
3798
3919
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
3799
3920
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
3800
3921
|
let vnodeHook;
|
|
3801
3922
|
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);
|
|
3923
|
+
if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3811
3924
|
else {
|
|
3812
3925
|
if (shapeFlag & 128) {
|
|
3813
3926
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
@@ -3818,7 +3931,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3818
3931
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
3819
3932
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
3820
3933
|
if (type === VaporSlot) {
|
|
3821
|
-
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
|
|
3934
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3822
3935
|
return;
|
|
3823
3936
|
}
|
|
3824
3937
|
if (doRemove) remove(vnode);
|
|
@@ -3838,6 +3951,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3838
3951
|
}
|
|
3839
3952
|
if (type === Static) {
|
|
3840
3953
|
removeStaticNode(vnode);
|
|
3954
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
3841
3955
|
return;
|
|
3842
3956
|
}
|
|
3843
3957
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -3861,7 +3975,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3861
3975
|
if (effect) {
|
|
3862
3976
|
effect.stop();
|
|
3863
3977
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3864
|
-
} else if (
|
|
3978
|
+
} else if (instance.vnode.el && subTree) {
|
|
3979
|
+
subTree.transition = instance.vnode.transition;
|
|
3980
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
3981
|
+
}
|
|
3865
3982
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
3866
3983
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
3867
3984
|
};
|
|
@@ -3929,12 +4046,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
3929
4046
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
3930
4047
|
}
|
|
3931
4048
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
3932
|
-
if (!vapor)
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
4049
|
+
if (!vapor) {
|
|
4050
|
+
if (allowed) {
|
|
4051
|
+
effect.flags |= 128;
|
|
4052
|
+
job.flags |= 2;
|
|
4053
|
+
} else {
|
|
4054
|
+
effect.flags &= -129;
|
|
4055
|
+
job.flags &= -3;
|
|
4056
|
+
}
|
|
3938
4057
|
}
|
|
3939
4058
|
}
|
|
3940
4059
|
function needTransition(parentSuspense, transition) {
|
|
@@ -3973,8 +4092,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
3973
4092
|
}
|
|
3974
4093
|
function locateNonHydratedAsyncRoot(instance) {
|
|
3975
4094
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
3976
|
-
if (subComponent)
|
|
3977
|
-
|
|
4095
|
+
if (subComponent) {
|
|
4096
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
4097
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
4098
|
+
}
|
|
3978
4099
|
}
|
|
3979
4100
|
function invalidateMount(hooks) {
|
|
3980
4101
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -3993,13 +4114,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
3993
4114
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
3994
4115
|
const performRemove = () => {
|
|
3995
4116
|
remove();
|
|
3996
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4117
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
3997
4118
|
};
|
|
3998
4119
|
if (force || isElement && transition && !transition.persisted) {
|
|
3999
4120
|
const { leave, delayLeave } = transition;
|
|
4000
4121
|
const performLeave = () => {
|
|
4122
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4001
4123
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
4002
|
-
|
|
4124
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
4125
|
+
else leave(el, performRemove);
|
|
4003
4126
|
};
|
|
4004
4127
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
4005
4128
|
else performLeave();
|
|
@@ -4015,7 +4138,7 @@ function isVaporComponent(type) {
|
|
|
4015
4138
|
/**
|
|
4016
4139
|
* shared between vdom and vapor
|
|
4017
4140
|
*/
|
|
4018
|
-
function getInheritedScopeIds(vnode, parentComponent) {
|
|
4141
|
+
function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
|
|
4019
4142
|
const inheritedScopeIds = [];
|
|
4020
4143
|
let currentParent = parentComponent;
|
|
4021
4144
|
let currentVNode = vnode;
|
|
@@ -4030,6 +4153,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
|
|
|
4030
4153
|
currentParent = currentParent.parent;
|
|
4031
4154
|
} else break;
|
|
4032
4155
|
}
|
|
4156
|
+
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
4157
|
+
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
4033
4158
|
return inheritedScopeIds;
|
|
4034
4159
|
}
|
|
4035
4160
|
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
@@ -4048,7 +4173,7 @@ const Suspense = {
|
|
|
4048
4173
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
4049
4174
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
4050
4175
|
else {
|
|
4051
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
4176
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
4052
4177
|
n2.suspense = n1.suspense;
|
|
4053
4178
|
n2.suspense.vnode = n2;
|
|
4054
4179
|
n2.el = n1.el;
|
|
@@ -4086,10 +4211,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4086
4211
|
if (pendingBranch) {
|
|
4087
4212
|
suspense.pendingBranch = newBranch;
|
|
4088
4213
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
4089
|
-
|
|
4214
|
+
suspense.deps++;
|
|
4215
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4216
|
+
suspense.deps--;
|
|
4090
4217
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4091
4218
|
else if (isInFallback) {
|
|
4092
|
-
if (!isHydrating) {
|
|
4219
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
4093
4220
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4094
4221
|
setActiveBranch(suspense, newFallback);
|
|
4095
4222
|
}
|
|
@@ -4101,12 +4228,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4101
4228
|
suspense.activeBranch = pendingBranch;
|
|
4102
4229
|
} else unmount(pendingBranch, parentComponent, suspense);
|
|
4103
4230
|
suspense.deps = 0;
|
|
4231
|
+
for (let i = 0; i < suspense.effects.length; i++) {
|
|
4232
|
+
const effect = suspense.effects[i];
|
|
4233
|
+
if (effect.flags & 8) queuePostFlushCb(effect);
|
|
4234
|
+
}
|
|
4104
4235
|
suspense.effects.length = 0;
|
|
4105
4236
|
suspense.hiddenContainer = createElement("div");
|
|
4106
4237
|
if (isInFallback) {
|
|
4107
4238
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4108
4239
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4109
|
-
else {
|
|
4240
|
+
else if (!suspense.isFallbackMountPending) {
|
|
4110
4241
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4111
4242
|
setActiveBranch(suspense, newFallback);
|
|
4112
4243
|
}
|
|
@@ -4199,7 +4330,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4199
4330
|
let hasUnresolvedAncestor = false;
|
|
4200
4331
|
while (parent) {
|
|
4201
4332
|
if (parent.pendingBranch) {
|
|
4202
|
-
parent.effects.push(
|
|
4333
|
+
for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
|
|
4203
4334
|
hasUnresolvedAncestor = true;
|
|
4204
4335
|
break;
|
|
4205
4336
|
}
|
|
@@ -4209,6 +4340,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4209
4340
|
suspense.effects = [];
|
|
4210
4341
|
if (isSuspensible) {
|
|
4211
4342
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
4343
|
+
parentSuspenseId = void 0;
|
|
4212
4344
|
parentSuspense.deps--;
|
|
4213
4345
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
4214
4346
|
}
|
|
@@ -4223,8 +4355,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4223
4355
|
const mountFallback = () => {
|
|
4224
4356
|
suspense.isFallbackMountPending = false;
|
|
4225
4357
|
if (!suspense.isInFallback) return;
|
|
4226
|
-
|
|
4227
|
-
|
|
4358
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
4359
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4360
|
+
setActiveBranch(suspense, latestFallback);
|
|
4228
4361
|
};
|
|
4229
4362
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
4230
4363
|
if (delayEnter) {
|
|
@@ -4245,11 +4378,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4245
4378
|
registerDep(instance, onResolve) {
|
|
4246
4379
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
4247
4380
|
if (isInPendingSuspense) suspense.deps++;
|
|
4381
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
4248
4382
|
instance.asyncDep.catch((err) => {
|
|
4249
4383
|
handleError(err, instance, 0);
|
|
4250
4384
|
}).then((asyncSetupResult) => {
|
|
4251
4385
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
4252
4386
|
setCurrentInstance(null, void 0);
|
|
4387
|
+
if (hydratedEl && !instance.scope.active) {
|
|
4388
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
4389
|
+
return;
|
|
4390
|
+
}
|
|
4253
4391
|
instance.asyncResolved = true;
|
|
4254
4392
|
onResolve(asyncSetupResult);
|
|
4255
4393
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -4296,9 +4434,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
4296
4434
|
return s;
|
|
4297
4435
|
}
|
|
4298
4436
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
4299
|
-
if (suspense && suspense.pendingBranch)
|
|
4300
|
-
|
|
4301
|
-
|
|
4437
|
+
if (suspense && suspense.pendingBranch) {
|
|
4438
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
4439
|
+
else suspense.effects.push(fn);
|
|
4440
|
+
} else queuePostFlushCb(fn, id);
|
|
4302
4441
|
}
|
|
4303
4442
|
function setActiveBranch(suspense, branch) {
|
|
4304
4443
|
suspense.activeBranch = branch;
|
|
@@ -4459,8 +4598,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
4459
4598
|
if (isVNode(type)) {
|
|
4460
4599
|
const cloned = cloneVNode(type, props, true);
|
|
4461
4600
|
if (children) normalizeChildren(cloned, children);
|
|
4462
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
4463
|
-
|
|
4601
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
4602
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
4603
|
+
else currentBlock.push(cloned);
|
|
4604
|
+
}
|
|
4464
4605
|
cloned.patchFlag = -2;
|
|
4465
4606
|
return cloned;
|
|
4466
4607
|
}
|
|
@@ -4516,7 +4657,10 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4516
4657
|
ce: vnode.ce,
|
|
4517
4658
|
vi: vnode.vi,
|
|
4518
4659
|
vs: cloneVaporSlotMeta(vnode),
|
|
4519
|
-
vb: vnode.vb
|
|
4660
|
+
vb: vnode.vb,
|
|
4661
|
+
ibu: vnode.ibu,
|
|
4662
|
+
iu: vnode.iu,
|
|
4663
|
+
cacheIndex: vnode.cacheIndex
|
|
4520
4664
|
};
|
|
4521
4665
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4522
4666
|
return cloned;
|
|
@@ -4526,8 +4670,7 @@ function cloneVaporSlotMeta(vnode) {
|
|
|
4526
4670
|
if (!vaporSlot) return vaporSlot;
|
|
4527
4671
|
const cloned = {
|
|
4528
4672
|
slot: vaporSlot.slot,
|
|
4529
|
-
|
|
4530
|
-
outletFallback: vaporSlot.outletFallback
|
|
4673
|
+
outlets: vaporSlot.outlets
|
|
4531
4674
|
};
|
|
4532
4675
|
if (vnode.el) {
|
|
4533
4676
|
cloned.state = vaporSlot.state;
|
|
@@ -4570,25 +4713,28 @@ function normalizeChildren(vnode, children) {
|
|
|
4570
4713
|
const { shapeFlag } = vnode;
|
|
4571
4714
|
if (children == null) children = null;
|
|
4572
4715
|
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
|
-
|
|
4716
|
+
else if (typeof children === "object") {
|
|
4717
|
+
if (shapeFlag & 65) {
|
|
4718
|
+
const slot = children.default;
|
|
4719
|
+
if (slot) {
|
|
4720
|
+
slot._c && (slot._d = false);
|
|
4721
|
+
normalizeChildren(vnode, slot());
|
|
4722
|
+
slot._c && (slot._d = true);
|
|
4723
|
+
}
|
|
4724
|
+
return;
|
|
4725
|
+
} else {
|
|
4726
|
+
type = 32;
|
|
4727
|
+
const slotFlag = children._;
|
|
4728
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
4729
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
4730
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
4731
|
+
else {
|
|
4732
|
+
children._ = 2;
|
|
4733
|
+
vnode.patchFlag |= 1024;
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4589
4736
|
}
|
|
4590
|
-
}
|
|
4591
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
4737
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
4592
4738
|
if (shapeFlag & 65) {
|
|
4593
4739
|
normalizeChildren(vnode, { default: children });
|
|
4594
4740
|
return;
|
|
@@ -4665,6 +4811,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
|
|
|
4665
4811
|
simpleSetCurrentInstance(instance);
|
|
4666
4812
|
}
|
|
4667
4813
|
};
|
|
4814
|
+
/**
|
|
4815
|
+
* Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
|
|
4816
|
+
* `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
|
|
4817
|
+
* verbatim instead of re-triggering the `instance.scope` default.
|
|
4818
|
+
* @internal
|
|
4819
|
+
*/
|
|
4820
|
+
const restoreCurrentInstance = (prev) => {
|
|
4821
|
+
(0, _vue_reactivity.setCurrentScope)(prev[1]);
|
|
4822
|
+
simpleSetCurrentInstance(prev[0]);
|
|
4823
|
+
};
|
|
4668
4824
|
const internalOptions = [
|
|
4669
4825
|
"ce",
|
|
4670
4826
|
"type",
|
|
@@ -4690,7 +4846,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4690
4846
|
};
|
|
4691
4847
|
//#endregion
|
|
4692
4848
|
//#region packages/runtime-core/src/component.ts
|
|
4693
|
-
const emptyAppContext =
|
|
4849
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
4694
4850
|
let uid = 0;
|
|
4695
4851
|
function createComponentInstance(vnode, parent, suspense) {
|
|
4696
4852
|
const type = vnode.type;
|
|
@@ -4793,7 +4949,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4793
4949
|
const setupResult = callWithErrorHandling(setup, instance, 0, [instance.props, setupContext]);
|
|
4794
4950
|
const isAsyncSetup = (0, _vue_shared.isPromise)(setupResult);
|
|
4795
4951
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4796
|
-
|
|
4952
|
+
restoreCurrentInstance(prev);
|
|
4797
4953
|
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
|
|
4798
4954
|
if (isAsyncSetup) {
|
|
4799
4955
|
const unsetCurrentInstance = () => {
|
|
@@ -4801,7 +4957,12 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4801
4957
|
};
|
|
4802
4958
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
4803
4959
|
if (isSSR) return setupResult.then((resolvedResult) => {
|
|
4804
|
-
|
|
4960
|
+
setInSSRSetupState(true);
|
|
4961
|
+
try {
|
|
4962
|
+
handleSetupResult(instance, resolvedResult, isSSR);
|
|
4963
|
+
} finally {
|
|
4964
|
+
setInSSRSetupState(false);
|
|
4965
|
+
}
|
|
4805
4966
|
}).catch((e) => {
|
|
4806
4967
|
handleError(e, instance, 0);
|
|
4807
4968
|
});
|
|
@@ -4810,9 +4971,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4810
4971
|
} else finishComponentSetup(instance, isSSR);
|
|
4811
4972
|
}
|
|
4812
4973
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
4813
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
4814
|
-
|
|
4815
|
-
|
|
4974
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
4975
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
4976
|
+
else instance.render = setupResult;
|
|
4977
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
4816
4978
|
finishComponentSetup(instance, isSSR);
|
|
4817
4979
|
}
|
|
4818
4980
|
let compile;
|
|
@@ -4853,7 +5015,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
4853
5015
|
applyOptions(instance);
|
|
4854
5016
|
} finally {
|
|
4855
5017
|
(0, _vue_reactivity.setActiveSub)(prevSub);
|
|
4856
|
-
|
|
5018
|
+
restoreCurrentInstance(prevInstance);
|
|
4857
5019
|
}
|
|
4858
5020
|
}
|
|
4859
5021
|
}
|
|
@@ -4879,14 +5041,13 @@ function getComponentPublicInstance(instance) {
|
|
|
4879
5041
|
if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy((0, _vue_reactivity.proxyRefs)((0, _vue_reactivity.markRaw)(instance.exposed)), {
|
|
4880
5042
|
get(target, key) {
|
|
4881
5043
|
if (key in target) return target[key];
|
|
4882
|
-
else {
|
|
5044
|
+
else if (!instance.vapor) {
|
|
4883
5045
|
const publicPropertiesMap = getPublicPropertiesMap();
|
|
4884
5046
|
if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
|
|
4885
5047
|
}
|
|
4886
5048
|
},
|
|
4887
5049
|
has(target, key) {
|
|
4888
|
-
|
|
4889
|
-
return key in target || key in publicPropertiesMap;
|
|
5050
|
+
return key in target || !instance.vapor && key in getPublicPropertiesMap();
|
|
4890
5051
|
}
|
|
4891
5052
|
}));
|
|
4892
5053
|
else return instance.proxy;
|
|
@@ -4908,11 +5069,12 @@ function h(type, propsOrChildren, children) {
|
|
|
4908
5069
|
try {
|
|
4909
5070
|
setBlockTracking(-1);
|
|
4910
5071
|
const l = arguments.length;
|
|
4911
|
-
if (l === 2)
|
|
4912
|
-
if (
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
5072
|
+
if (l === 2) {
|
|
5073
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
5074
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
5075
|
+
return createVNode(type, propsOrChildren);
|
|
5076
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
5077
|
+
} else {
|
|
4916
5078
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
4917
5079
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
4918
5080
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -4923,15 +5085,7 @@ function h(type, propsOrChildren, children) {
|
|
|
4923
5085
|
}
|
|
4924
5086
|
//#endregion
|
|
4925
5087
|
//#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
|
-
}
|
|
5088
|
+
function initCustomFormatter() {}
|
|
4935
5089
|
//#endregion
|
|
4936
5090
|
//#region packages/runtime-core/src/helpers/withMemo.ts
|
|
4937
5091
|
function withMemo(memo, render, cache, index) {
|
|
@@ -4951,7 +5105,7 @@ function isMemoSame(cached, memo) {
|
|
|
4951
5105
|
}
|
|
4952
5106
|
//#endregion
|
|
4953
5107
|
//#region packages/runtime-core/src/index.ts
|
|
4954
|
-
const version = "3.6.0-rc.
|
|
5108
|
+
const version = "3.6.0-rc.11";
|
|
4955
5109
|
const warn = _vue_shared.NOOP;
|
|
4956
5110
|
/**
|
|
4957
5111
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -4974,7 +5128,10 @@ const ssrUtils = {
|
|
|
4974
5128
|
getComponentPublicInstance,
|
|
4975
5129
|
ensureValidVNode,
|
|
4976
5130
|
pushWarningContext,
|
|
4977
|
-
popWarningContext
|
|
5131
|
+
popWarningContext,
|
|
5132
|
+
VaporSlot,
|
|
5133
|
+
rawVaporSlotKey,
|
|
5134
|
+
invokeSlotFallback
|
|
4978
5135
|
};
|
|
4979
5136
|
/**
|
|
4980
5137
|
* @internal only exposed in compat builds
|