@vue/runtime-vapor 3.6.0-alpha.3 → 3.6.0-alpha.5
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-vapor.d.ts +49 -25
- package/dist/runtime-vapor.esm-bundler.js +984 -591
- package/package.json +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-vapor v3.6.0-alpha.
|
|
2
|
+
* @vue/runtime-vapor v3.6.0-alpha.5
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { isMismatchAllowed, warn, currentInstance, startMeasure, setCurrentInstance, queuePostFlushCb, queueJob, TransitionPropsValidators, leaveCbKey, isAsyncWrapper, getComponentName, baseResolveTransitionHooks, isTemplateNode, checkTransitionMode, resolveTransitionProps, useTransitionState,
|
|
7
|
-
import { invokeArrayFns, isArray, extend,
|
|
6
|
+
import { isMismatchAllowed, warn, currentInstance, startMeasure, setCurrentInstance, queuePostFlushCb, queueJob, TransitionPropsValidators, leaveCbKey, isAsyncWrapper, getComponentName, baseResolveTransitionHooks, isTemplateNode, checkTransitionMode, resolveTransitionProps, useTransitionState, callWithAsyncErrorHandling, unsafeToTrustedHTML, patchStyle, xlinkNS, mergeProps, shouldSetAsProp, toClassSet, isSetEqual, warnPropMismatch, toStyleMap, vShowHidden, isMapEqual, isValidHtmlOrSvgAttribute, getAttributeMismatch, isRef, watch, onMounted, onUpdated, onBeforeUnmount, matches, devtoolsComponentAdded, resetShapeFlag, isKeepAlive, ensureRenderer, shallowRef, simpleSetCurrentInstance, renderSlot, ensureVaporSlotFallback, createVNode, shallowReactive, createInternalObject, isEmitListener, onScopeDispose, activate as activate$1, setTransitionHooks as setTransitionHooks$1, normalizeRef, isVNode, Fragment, ensureHydrationRenderer, setRef as setRef$1, deactivate as deactivate$1, baseEmit, baseNormalizePropsOptions, pushWarningContext, validateProps, popWarningContext, resolvePropValue, resolveTeleportTarget, isTeleportDisabled, isTeleportDeferred, performTransitionEnter, performTransitionLeave, getInheritedScopeIds, registerHMR, endMeasure, unregisterHMR, nextUid, EffectScope as EffectScope$1, expose, callWithErrorHandling, createAppAPI, initFeatureFlags, setDevtoolsHook, flushOnAppMount, normalizeContainer, createAsyncComponentContext, markAsyncBoundary, useAsyncComponentState, performAsyncHydrate, handleError, VueElementBase, onBeforeUpdate, hasCSSTransform, callPendingCbs, forceReflow, handleMovedChildren, baseApplyTranslation, createCanSetSetupRefChecker, baseUseCssVars, setVarsOnNode, resolveDynamicComponent, vShowOriginalDisplay, vModelTextInit, vModelCheckboxInit, vModelSelectInit, vModelTextUpdate, vModelCheckboxUpdate, vModelGetValue, vModelSetSelected } from '@vue/runtime-dom';
|
|
7
|
+
import { invokeArrayFns, isArray, extend, normalizeClass, normalizeStyle, includeBooleanAttr, toDisplayString, isString, parseStringStyle, isOn, canSetValueDirectly, camelize, stringifyStyle, normalizeCssVarValue, getEscapedCssVarName, EMPTY_OBJ, isFunction, NO, hasOwn, isReservedProp, EMPTY_ARR, YES, getGlobalThis, isPlainObject, isObject, remove as remove$1, looseEqual } from '@vue/shared';
|
|
8
8
|
import { ReactiveEffect, setActiveSub, EffectScope, onEffectCleanup, pauseTracking, resetTracking, onScopeDispose as onScopeDispose$1, markRaw, unref, proxyRefs, watch as watch$1, isReactive, isShallow, shallowReadArray, isReadonly, toReadonly, toReactive, shallowRef as shallowRef$1, isRef as isRef$1, traverse } from '@vue/reactivity';
|
|
9
9
|
|
|
10
10
|
let insertionParent;
|
|
@@ -357,6 +357,8 @@ class RenderEffect extends ReactiveEffect {
|
|
|
357
357
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
358
358
|
this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
359
359
|
this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
360
|
+
}
|
|
361
|
+
if (!!(process.env.NODE_ENV !== "production") || instance.type.ce) {
|
|
360
362
|
(instance.renderEffects || (instance.renderEffects = [])).push(this);
|
|
361
363
|
}
|
|
362
364
|
job.i = instance;
|
|
@@ -544,7 +546,7 @@ function applyTransitionHooks(block, hooks, fallthroughAttrs = true, isResolved
|
|
|
544
546
|
if (isFrag) setTransitionHooksOnFragment(block, hooks);
|
|
545
547
|
return hooks;
|
|
546
548
|
}
|
|
547
|
-
const { props, instance, state, delayedLeave } = hooks;
|
|
549
|
+
const { props, instance, state, delayedLeave, group } = hooks;
|
|
548
550
|
let resolvedHooks = resolveTransitionHooks(
|
|
549
551
|
child,
|
|
550
552
|
props,
|
|
@@ -553,6 +555,7 @@ function applyTransitionHooks(block, hooks, fallthroughAttrs = true, isResolved
|
|
|
553
555
|
(hooks2) => resolvedHooks = hooks2
|
|
554
556
|
);
|
|
555
557
|
resolvedHooks.delayedLeave = delayedLeave;
|
|
558
|
+
resolvedHooks.group = group;
|
|
556
559
|
child.$transition = resolvedHooks;
|
|
557
560
|
if (isFrag) setTransitionHooksOnFragment(block, resolvedHooks);
|
|
558
561
|
if (fallthroughAttrs && instance.hasFallthrough) {
|
|
@@ -642,6 +645,9 @@ function findTransitionBlock(block, inFragment = false) {
|
|
|
642
645
|
function setTransitionHooksOnFragment(block, hooks) {
|
|
643
646
|
if (isFragment(block)) {
|
|
644
647
|
block.$transition = hooks;
|
|
648
|
+
if (block.nodes && isFragment(block.nodes)) {
|
|
649
|
+
setTransitionHooksOnFragment(block.nodes, hooks);
|
|
650
|
+
}
|
|
645
651
|
} else if (isArray(block)) {
|
|
646
652
|
for (let i = 0; i < block.length; i++) {
|
|
647
653
|
setTransitionHooksOnFragment(block[i], hooks);
|
|
@@ -727,14 +733,14 @@ class DynamicFragment extends VaporFragment {
|
|
|
727
733
|
const prevSub = setActiveSub();
|
|
728
734
|
const parent = isHydrating ? null : this.anchor.parentNode;
|
|
729
735
|
const transition = this.$transition;
|
|
730
|
-
const instance = currentInstance;
|
|
731
|
-
this.inKeepAlive = isKeepAlive(instance);
|
|
732
736
|
if (this.scope) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
737
|
+
let preserveScope = false;
|
|
738
|
+
if (this.beforeTeardown) {
|
|
739
|
+
preserveScope = this.beforeTeardown.some(
|
|
740
|
+
(hook) => hook(this.current, this.nodes, this.scope)
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
if (!preserveScope) {
|
|
738
744
|
this.scope.stop();
|
|
739
745
|
}
|
|
740
746
|
const mode = transition && transition.mode;
|
|
@@ -742,7 +748,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
742
748
|
applyTransitionLeaveHooks(
|
|
743
749
|
this.nodes,
|
|
744
750
|
transition,
|
|
745
|
-
() => this.render(render,
|
|
751
|
+
() => this.render(render, transition, parent)
|
|
746
752
|
);
|
|
747
753
|
parent && remove(this.nodes, parent);
|
|
748
754
|
if (mode === "out-in") {
|
|
@@ -753,7 +759,7 @@ class DynamicFragment extends VaporFragment {
|
|
|
753
759
|
parent && remove(this.nodes, parent);
|
|
754
760
|
}
|
|
755
761
|
}
|
|
756
|
-
this.render(render,
|
|
762
|
+
this.render(render, transition, parent);
|
|
757
763
|
if (this.fallback) {
|
|
758
764
|
const hasNestedFragment = isFragment(this.nodes);
|
|
759
765
|
if (hasNestedFragment) {
|
|
@@ -776,24 +782,29 @@ class DynamicFragment extends VaporFragment {
|
|
|
776
782
|
setActiveSub(prevSub);
|
|
777
783
|
if (isHydrating) this.hydrate();
|
|
778
784
|
}
|
|
779
|
-
render(render,
|
|
785
|
+
render(render, transition, parent) {
|
|
780
786
|
if (render) {
|
|
781
|
-
const scope = this.
|
|
787
|
+
const scope = this.getScope && this.getScope(this.current);
|
|
782
788
|
if (scope) {
|
|
783
789
|
this.scope = scope;
|
|
784
|
-
this.keptAliveScopes.delete(this.current);
|
|
785
|
-
this.scope.resume();
|
|
786
790
|
} else {
|
|
787
791
|
this.scope = new EffectScope();
|
|
788
792
|
}
|
|
789
793
|
this.nodes = this.scope.run(render) || [];
|
|
790
|
-
if (this.inKeepAlive) {
|
|
791
|
-
instance.cacheFragment(this);
|
|
792
|
-
}
|
|
793
794
|
if (transition) {
|
|
794
795
|
this.$transition = applyTransitionHooks(this.nodes, transition);
|
|
795
796
|
}
|
|
796
|
-
if (
|
|
797
|
+
if (this.beforeMount) {
|
|
798
|
+
this.beforeMount.forEach(
|
|
799
|
+
(hook) => hook(this.current, this.nodes, this.scope)
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
if (parent) {
|
|
803
|
+
insert(this.nodes, parent, this.anchor);
|
|
804
|
+
if (this.anchor.isConnected && this.updated) {
|
|
805
|
+
this.updated.forEach((hook) => hook(this.nodes));
|
|
806
|
+
}
|
|
807
|
+
}
|
|
797
808
|
} else {
|
|
798
809
|
this.scope = void 0;
|
|
799
810
|
this.nodes = [];
|
|
@@ -831,159 +842,8 @@ function findInvalidFragment(fragment) {
|
|
|
831
842
|
function isFragment(val) {
|
|
832
843
|
return val instanceof VaporFragment;
|
|
833
844
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
function setCurrentSlotScopeIds(scopeIds) {
|
|
837
|
-
const prev = currentSlotScopeIds;
|
|
838
|
-
currentSlotScopeIds = scopeIds;
|
|
839
|
-
return prev;
|
|
840
|
-
}
|
|
841
|
-
const dynamicSlotsProxyHandlers = {
|
|
842
|
-
get: getSlot,
|
|
843
|
-
has: (target, key) => !!getSlot(target, key),
|
|
844
|
-
getOwnPropertyDescriptor(target, key) {
|
|
845
|
-
const slot = getSlot(target, key);
|
|
846
|
-
if (slot) {
|
|
847
|
-
return {
|
|
848
|
-
configurable: true,
|
|
849
|
-
enumerable: true,
|
|
850
|
-
value: slot
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
},
|
|
854
|
-
ownKeys(target) {
|
|
855
|
-
let keys = Object.keys(target);
|
|
856
|
-
const dynamicSources = target.$;
|
|
857
|
-
if (dynamicSources) {
|
|
858
|
-
keys = keys.filter((k) => k !== "$");
|
|
859
|
-
for (const source of dynamicSources) {
|
|
860
|
-
if (isFunction(source)) {
|
|
861
|
-
const slot = source();
|
|
862
|
-
if (isArray(slot)) {
|
|
863
|
-
for (const s of slot) keys.push(String(s.name));
|
|
864
|
-
} else {
|
|
865
|
-
keys.push(String(slot.name));
|
|
866
|
-
}
|
|
867
|
-
} else {
|
|
868
|
-
keys.push(...Object.keys(source));
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
return keys;
|
|
873
|
-
},
|
|
874
|
-
set: NO,
|
|
875
|
-
deleteProperty: NO
|
|
876
|
-
};
|
|
877
|
-
function getSlot(target, key) {
|
|
878
|
-
if (key === "$") return;
|
|
879
|
-
const dynamicSources = target.$;
|
|
880
|
-
if (dynamicSources) {
|
|
881
|
-
let i = dynamicSources.length;
|
|
882
|
-
let source;
|
|
883
|
-
while (i--) {
|
|
884
|
-
source = dynamicSources[i];
|
|
885
|
-
if (isFunction(source)) {
|
|
886
|
-
const slot = source();
|
|
887
|
-
if (slot) {
|
|
888
|
-
if (isArray(slot)) {
|
|
889
|
-
for (const s of slot) {
|
|
890
|
-
if (String(s.name) === key) return s.fn;
|
|
891
|
-
}
|
|
892
|
-
} else if (String(slot.name) === key) {
|
|
893
|
-
return slot.fn;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
} else if (hasOwn(source, key)) {
|
|
897
|
-
return source[key];
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
if (hasOwn(target, key)) {
|
|
902
|
-
return target[key];
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
function withVaporCtx(fn) {
|
|
906
|
-
const instance = currentInstance;
|
|
907
|
-
return (...args) => {
|
|
908
|
-
const prev = setCurrentInstance(instance);
|
|
909
|
-
try {
|
|
910
|
-
return fn(...args);
|
|
911
|
-
} finally {
|
|
912
|
-
setCurrentInstance(...prev);
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
function createSlot(name, rawProps, fallback, noSlotted) {
|
|
917
|
-
const _insertionParent = insertionParent;
|
|
918
|
-
const _insertionAnchor = insertionAnchor;
|
|
919
|
-
const _isLastInsertion = isLastInsertion;
|
|
920
|
-
if (!isHydrating) resetInsertionState();
|
|
921
|
-
const instance = currentInstance;
|
|
922
|
-
const rawSlots = instance.rawSlots;
|
|
923
|
-
const slotProps = rawProps ? new Proxy(rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
|
|
924
|
-
let fragment;
|
|
925
|
-
if (isRef(rawSlots._)) {
|
|
926
|
-
if (isHydrating) locateHydrationNode();
|
|
927
|
-
fragment = instance.appContext.vapor.vdomSlot(
|
|
928
|
-
rawSlots._,
|
|
929
|
-
name,
|
|
930
|
-
slotProps,
|
|
931
|
-
instance,
|
|
932
|
-
fallback
|
|
933
|
-
);
|
|
934
|
-
} else {
|
|
935
|
-
fragment = isHydrating || !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("slot") : new DynamicFragment();
|
|
936
|
-
const isDynamicName = isFunction(name);
|
|
937
|
-
const slotScopeIds = [];
|
|
938
|
-
if (!noSlotted) {
|
|
939
|
-
const scopeId = instance.type.__scopeId;
|
|
940
|
-
if (scopeId) {
|
|
941
|
-
slotScopeIds.push(`${scopeId}-s`);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
const renderSlot = () => {
|
|
945
|
-
const slot = getSlot(rawSlots, isFunction(name) ? name() : name);
|
|
946
|
-
if (slot) {
|
|
947
|
-
fragment.fallback = fallback;
|
|
948
|
-
fragment.update(
|
|
949
|
-
slot._bound || (slot._bound = () => {
|
|
950
|
-
const prevSlotScopeIds = setCurrentSlotScopeIds(
|
|
951
|
-
slotScopeIds.length > 0 ? slotScopeIds : null
|
|
952
|
-
);
|
|
953
|
-
try {
|
|
954
|
-
return slot(slotProps);
|
|
955
|
-
} finally {
|
|
956
|
-
setCurrentSlotScopeIds(prevSlotScopeIds);
|
|
957
|
-
}
|
|
958
|
-
})
|
|
959
|
-
);
|
|
960
|
-
} else {
|
|
961
|
-
fragment.update(fallback);
|
|
962
|
-
}
|
|
963
|
-
};
|
|
964
|
-
if (isDynamicName || rawSlots.$) {
|
|
965
|
-
renderEffect(renderSlot);
|
|
966
|
-
} else {
|
|
967
|
-
renderSlot();
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
if (!isHydrating) {
|
|
971
|
-
if (!noSlotted) {
|
|
972
|
-
const scopeId = instance.type.__scopeId;
|
|
973
|
-
if (scopeId) {
|
|
974
|
-
setScopeId(fragment, [`${scopeId}-s`]);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
if (_insertionParent) insert(fragment, _insertionParent, _insertionAnchor);
|
|
978
|
-
} else {
|
|
979
|
-
if (fragment.insert) {
|
|
980
|
-
fragment.hydrate();
|
|
981
|
-
}
|
|
982
|
-
if (_isLastInsertion) {
|
|
983
|
-
advanceHydrationNode(_insertionParent);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
return fragment;
|
|
845
|
+
function isDynamicFragment(val) {
|
|
846
|
+
return val instanceof DynamicFragment;
|
|
987
847
|
}
|
|
988
848
|
|
|
989
849
|
function addEventListener(el, event, handler, options) {
|
|
@@ -1057,6 +917,15 @@ function setDynamicEvents(el, events) {
|
|
|
1057
917
|
on(el, name, events[name], { effect: true });
|
|
1058
918
|
}
|
|
1059
919
|
}
|
|
920
|
+
function createInvoker(handler) {
|
|
921
|
+
const i = currentInstance;
|
|
922
|
+
return (...args) => callWithAsyncErrorHandling(
|
|
923
|
+
handler,
|
|
924
|
+
i,
|
|
925
|
+
5,
|
|
926
|
+
args
|
|
927
|
+
);
|
|
928
|
+
}
|
|
1060
929
|
|
|
1061
930
|
const hasFallthroughKey = (key) => currentInstance.hasFallthrough && key in currentInstance.attrs;
|
|
1062
931
|
function setProp(el, key, value) {
|
|
@@ -1066,7 +935,7 @@ function setProp(el, key, value) {
|
|
|
1066
935
|
setAttr(el, key, value);
|
|
1067
936
|
}
|
|
1068
937
|
}
|
|
1069
|
-
function setAttr(el, key, value) {
|
|
938
|
+
function setAttr(el, key, value, isSVG = false) {
|
|
1070
939
|
if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) {
|
|
1071
940
|
return;
|
|
1072
941
|
}
|
|
@@ -1081,14 +950,22 @@ function setAttr(el, key, value) {
|
|
|
1081
950
|
}
|
|
1082
951
|
if (value !== el[`$${key}`]) {
|
|
1083
952
|
el[`$${key}`] = value;
|
|
1084
|
-
if (
|
|
1085
|
-
|
|
953
|
+
if (isSVG && key.startsWith("xlink:")) {
|
|
954
|
+
if (value != null) {
|
|
955
|
+
el.setAttributeNS(xlinkNS, key, value);
|
|
956
|
+
} else {
|
|
957
|
+
el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
|
|
958
|
+
}
|
|
1086
959
|
} else {
|
|
1087
|
-
|
|
960
|
+
if (value != null) {
|
|
961
|
+
el.setAttribute(key, value);
|
|
962
|
+
} else {
|
|
963
|
+
el.removeAttribute(key);
|
|
964
|
+
}
|
|
1088
965
|
}
|
|
1089
966
|
}
|
|
1090
967
|
}
|
|
1091
|
-
function setDOMProp(el, key, value, forceHydrate = false) {
|
|
968
|
+
function setDOMProp(el, key, value, forceHydrate = false, attrName) {
|
|
1092
969
|
if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) {
|
|
1093
970
|
return;
|
|
1094
971
|
}
|
|
@@ -1122,9 +999,9 @@ function setDOMProp(el, key, value, forceHydrate = false) {
|
|
|
1122
999
|
);
|
|
1123
1000
|
}
|
|
1124
1001
|
}
|
|
1125
|
-
needRemove && el.removeAttribute(key);
|
|
1002
|
+
needRemove && el.removeAttribute(attrName || key);
|
|
1126
1003
|
}
|
|
1127
|
-
function setClass(el, value) {
|
|
1004
|
+
function setClass(el, value, isSVG = false) {
|
|
1128
1005
|
if (el.$root) {
|
|
1129
1006
|
setClassIncremental(el, value);
|
|
1130
1007
|
} else {
|
|
@@ -1134,7 +1011,11 @@ function setClass(el, value) {
|
|
|
1134
1011
|
return;
|
|
1135
1012
|
}
|
|
1136
1013
|
if (value !== el.$cls) {
|
|
1137
|
-
|
|
1014
|
+
if (isSVG) {
|
|
1015
|
+
el.setAttribute("class", el.$cls = value);
|
|
1016
|
+
} else {
|
|
1017
|
+
el.className = el.$cls = value;
|
|
1018
|
+
}
|
|
1138
1019
|
}
|
|
1139
1020
|
}
|
|
1140
1021
|
}
|
|
@@ -1158,14 +1039,29 @@ function setClassIncremental(el, value) {
|
|
|
1158
1039
|
}
|
|
1159
1040
|
}
|
|
1160
1041
|
}
|
|
1042
|
+
function shouldDeferCheckStyleMismatch(el) {
|
|
1043
|
+
return !!(process.env.NODE_ENV !== "production") && (!!currentInstance.getCssVars || Object.values(el.style).some((v) => v.startsWith("--")));
|
|
1044
|
+
}
|
|
1161
1045
|
function setStyle(el, value) {
|
|
1162
1046
|
if (el.$root) {
|
|
1163
1047
|
setStyleIncremental(el, value);
|
|
1164
1048
|
} else {
|
|
1165
1049
|
const normalizedValue = normalizeStyle(value);
|
|
1166
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating
|
|
1167
|
-
el
|
|
1168
|
-
|
|
1050
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating) {
|
|
1051
|
+
if (shouldDeferCheckStyleMismatch(el)) {
|
|
1052
|
+
const instance = currentInstance;
|
|
1053
|
+
queuePostFlushCb(() => {
|
|
1054
|
+
if (!styleHasMismatch(el, value, normalizedValue, false, instance)) {
|
|
1055
|
+
el.$sty = normalizedValue;
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
patchStyle(el, el.$sty, el.$sty = normalizedValue);
|
|
1059
|
+
});
|
|
1060
|
+
return;
|
|
1061
|
+
} else if (!styleHasMismatch(el, value, normalizedValue, false)) {
|
|
1062
|
+
el.$sty = normalizedValue;
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1169
1065
|
}
|
|
1170
1066
|
patchStyle(el, el.$sty, el.$sty = normalizedValue);
|
|
1171
1067
|
}
|
|
@@ -1173,9 +1069,21 @@ function setStyle(el, value) {
|
|
|
1173
1069
|
function setStyleIncremental(el, value) {
|
|
1174
1070
|
const cacheKey = `$styi${isApplyingFallthroughProps ? "$" : ""}`;
|
|
1175
1071
|
const normalizedValue = isString(value) ? parseStringStyle(value) : normalizeStyle(value);
|
|
1176
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating
|
|
1177
|
-
el
|
|
1178
|
-
|
|
1072
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && isHydrating) {
|
|
1073
|
+
if (shouldDeferCheckStyleMismatch(el)) {
|
|
1074
|
+
const instance = currentInstance;
|
|
1075
|
+
queuePostFlushCb(() => {
|
|
1076
|
+
if (!styleHasMismatch(el, value, normalizedValue, true, instance)) {
|
|
1077
|
+
el[cacheKey] = normalizedValue;
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
patchStyle(el, el[cacheKey], el[cacheKey] = normalizedValue);
|
|
1081
|
+
});
|
|
1082
|
+
return;
|
|
1083
|
+
} else if (!styleHasMismatch(el, value, normalizedValue, true)) {
|
|
1084
|
+
el[cacheKey] = normalizedValue;
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1179
1087
|
}
|
|
1180
1088
|
patchStyle(el, el[cacheKey], el[cacheKey] = normalizedValue);
|
|
1181
1089
|
}
|
|
@@ -1296,26 +1204,25 @@ function setHtmlToBlock(block, value) {
|
|
|
1296
1204
|
setHtmlToBlock(block.nodes, value);
|
|
1297
1205
|
}
|
|
1298
1206
|
}
|
|
1299
|
-
function setDynamicProps(el, args) {
|
|
1207
|
+
function setDynamicProps(el, args, isSVG) {
|
|
1300
1208
|
const props = args.length > 1 ? mergeProps(...args) : args[0];
|
|
1301
1209
|
const cacheKey = `$dprops${isApplyingFallthroughProps ? "$" : ""}`;
|
|
1302
1210
|
const prevKeys = el[cacheKey];
|
|
1303
1211
|
if (prevKeys) {
|
|
1304
1212
|
for (const key of prevKeys) {
|
|
1305
1213
|
if (!(key in props)) {
|
|
1306
|
-
setDynamicProp(el, key, null);
|
|
1214
|
+
setDynamicProp(el, key, null, isSVG);
|
|
1307
1215
|
}
|
|
1308
1216
|
}
|
|
1309
1217
|
}
|
|
1310
1218
|
for (const key of el[cacheKey] = Object.keys(props)) {
|
|
1311
|
-
setDynamicProp(el, key, props[key]);
|
|
1219
|
+
setDynamicProp(el, key, props[key], isSVG);
|
|
1312
1220
|
}
|
|
1313
1221
|
}
|
|
1314
|
-
function setDynamicProp(el, key, value) {
|
|
1315
|
-
const isSVG = false;
|
|
1222
|
+
function setDynamicProp(el, key, value, isSVG = false) {
|
|
1316
1223
|
let forceHydrate = false;
|
|
1317
1224
|
if (key === "class") {
|
|
1318
|
-
setClass(el, value);
|
|
1225
|
+
setClass(el, value, isSVG);
|
|
1319
1226
|
} else if (key === "style") {
|
|
1320
1227
|
setStyle(el, value);
|
|
1321
1228
|
} else if (isOn(key)) {
|
|
@@ -1333,8 +1240,13 @@ function setDynamicProp(el, key, value) {
|
|
|
1333
1240
|
} else {
|
|
1334
1241
|
setDOMProp(el, key, value, forceHydrate);
|
|
1335
1242
|
}
|
|
1243
|
+
} else if (
|
|
1244
|
+
// custom elements
|
|
1245
|
+
el._isVueCE && (/[A-Z]/.test(key) || !isString(value))
|
|
1246
|
+
) {
|
|
1247
|
+
setDOMProp(el, camelize(key), value, forceHydrate, key);
|
|
1336
1248
|
} else {
|
|
1337
|
-
setAttr(el, key, value);
|
|
1249
|
+
setAttr(el, key, value, isSVG);
|
|
1338
1250
|
}
|
|
1339
1251
|
return value;
|
|
1340
1252
|
}
|
|
@@ -1347,7 +1259,8 @@ function optimizePropertyLookup() {
|
|
|
1347
1259
|
proto.$key = void 0;
|
|
1348
1260
|
proto.$fc = proto.$evtclick = void 0;
|
|
1349
1261
|
proto.$root = false;
|
|
1350
|
-
proto.$html = proto.$
|
|
1262
|
+
proto.$html = proto.$cls = proto.$sty = "";
|
|
1263
|
+
Text.prototype.$txt = void 0;
|
|
1351
1264
|
}
|
|
1352
1265
|
function classHasMismatch(el, expected, isIncremental) {
|
|
1353
1266
|
const actual = el.getAttribute("class");
|
|
@@ -1370,7 +1283,7 @@ function classHasMismatch(el, expected, isIncremental) {
|
|
|
1370
1283
|
}
|
|
1371
1284
|
return false;
|
|
1372
1285
|
}
|
|
1373
|
-
function styleHasMismatch(el, value, normalizedValue, isIncremental) {
|
|
1286
|
+
function styleHasMismatch(el, value, normalizedValue, isIncremental, instance = currentInstance) {
|
|
1374
1287
|
const actual = el.getAttribute("style");
|
|
1375
1288
|
const actualStyleMap = toStyleMap(actual || "");
|
|
1376
1289
|
const expected = isString(value) ? value : stringifyStyle(normalizedValue);
|
|
@@ -1378,6 +1291,9 @@ function styleHasMismatch(el, value, normalizedValue, isIncremental) {
|
|
|
1378
1291
|
if (el[vShowHidden]) {
|
|
1379
1292
|
expectedStyleMap.set("display", "none");
|
|
1380
1293
|
}
|
|
1294
|
+
if (instance) {
|
|
1295
|
+
resolveCssVars(instance, el, expectedStyleMap);
|
|
1296
|
+
}
|
|
1381
1297
|
let hasMismatch = false;
|
|
1382
1298
|
if (isIncremental) {
|
|
1383
1299
|
if (expected) {
|
|
@@ -1395,6 +1311,24 @@ function styleHasMismatch(el, value, normalizedValue, isIncremental) {
|
|
|
1395
1311
|
}
|
|
1396
1312
|
return false;
|
|
1397
1313
|
}
|
|
1314
|
+
function resolveCssVars(instance, block, expectedMap) {
|
|
1315
|
+
if (!instance.isMounted) return;
|
|
1316
|
+
const rootBlocks = normalizeBlock(instance);
|
|
1317
|
+
if (instance.getCssVars && normalizeBlock(block).every((b) => rootBlocks.includes(b))) {
|
|
1318
|
+
const cssVars = instance.getCssVars();
|
|
1319
|
+
for (const key in cssVars) {
|
|
1320
|
+
const value = normalizeCssVarValue(cssVars[key]);
|
|
1321
|
+
expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
if (normalizeBlock(block).every((b) => rootBlocks.includes(b)) && instance.parent) {
|
|
1325
|
+
resolveCssVars(
|
|
1326
|
+
instance.parent,
|
|
1327
|
+
instance.block,
|
|
1328
|
+
expectedMap
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1398
1332
|
function attributeHasMismatch(el, key, value) {
|
|
1399
1333
|
if (isValidHtmlOrSvgAttribute(el, key)) {
|
|
1400
1334
|
const { actual, expected } = getAttributeMismatch(el, key, value);
|
|
@@ -1418,50 +1352,233 @@ function shouldForceHydrate(el, key) {
|
|
|
1418
1352
|
tagName.includes("-");
|
|
1419
1353
|
}
|
|
1420
1354
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
__vapor: true
|
|
1428
|
-
}))();
|
|
1355
|
+
let currentSlotScopeIds = null;
|
|
1356
|
+
function setCurrentSlotScopeIds(scopeIds) {
|
|
1357
|
+
try {
|
|
1358
|
+
return currentSlotScopeIds;
|
|
1359
|
+
} finally {
|
|
1360
|
+
currentSlotScopeIds = scopeIds;
|
|
1429
1361
|
}
|
|
1430
|
-
comp.__vapor = true;
|
|
1431
|
-
return comp;
|
|
1432
1362
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
return void 0;
|
|
1445
|
-
}
|
|
1446
|
-
const keepAliveInstance = currentInstance;
|
|
1447
|
-
const cache = /* @__PURE__ */ new Map();
|
|
1448
|
-
const keys = /* @__PURE__ */ new Set();
|
|
1449
|
-
const storageContainer = createElement("div");
|
|
1450
|
-
let current;
|
|
1451
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
1452
|
-
keepAliveInstance.__v_cache = cache;
|
|
1363
|
+
const dynamicSlotsProxyHandlers = {
|
|
1364
|
+
get: getSlot,
|
|
1365
|
+
has: (target, key) => !!getSlot(target, key),
|
|
1366
|
+
getOwnPropertyDescriptor(target, key) {
|
|
1367
|
+
const slot = getSlot(target, key);
|
|
1368
|
+
if (slot) {
|
|
1369
|
+
return {
|
|
1370
|
+
configurable: true,
|
|
1371
|
+
enumerable: true,
|
|
1372
|
+
value: slot
|
|
1373
|
+
};
|
|
1453
1374
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1375
|
+
},
|
|
1376
|
+
ownKeys(target) {
|
|
1377
|
+
let keys = Object.keys(target);
|
|
1378
|
+
const dynamicSources = target.$;
|
|
1379
|
+
if (dynamicSources) {
|
|
1380
|
+
keys = keys.filter((k) => k !== "$");
|
|
1381
|
+
for (const source of dynamicSources) {
|
|
1382
|
+
if (isFunction(source)) {
|
|
1383
|
+
const slot = source();
|
|
1384
|
+
if (isArray(slot)) {
|
|
1385
|
+
for (const s of slot) keys.push(String(s.name));
|
|
1386
|
+
} else {
|
|
1387
|
+
keys.push(String(slot.name));
|
|
1388
|
+
}
|
|
1389
|
+
} else {
|
|
1390
|
+
keys.push(...Object.keys(source));
|
|
1391
|
+
}
|
|
1457
1392
|
}
|
|
1458
|
-
const { include, exclude } = props;
|
|
1459
|
-
const name = getComponentName(
|
|
1460
|
-
isAsyncWrapper(instance) ? instance.type.__asyncResolved : instance.type
|
|
1461
|
-
);
|
|
1462
|
-
return !(include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name));
|
|
1463
1393
|
}
|
|
1464
|
-
|
|
1394
|
+
return keys;
|
|
1395
|
+
},
|
|
1396
|
+
set: NO,
|
|
1397
|
+
deleteProperty: NO
|
|
1398
|
+
};
|
|
1399
|
+
function getSlot(target, key) {
|
|
1400
|
+
if (key === "$") return;
|
|
1401
|
+
const dynamicSources = target.$;
|
|
1402
|
+
if (dynamicSources) {
|
|
1403
|
+
let i = dynamicSources.length;
|
|
1404
|
+
let source;
|
|
1405
|
+
while (i--) {
|
|
1406
|
+
source = dynamicSources[i];
|
|
1407
|
+
if (isFunction(source)) {
|
|
1408
|
+
const slot = source();
|
|
1409
|
+
if (slot) {
|
|
1410
|
+
if (isArray(slot)) {
|
|
1411
|
+
for (const s of slot) {
|
|
1412
|
+
if (String(s.name) === key) return s.fn;
|
|
1413
|
+
}
|
|
1414
|
+
} else if (String(slot.name) === key) {
|
|
1415
|
+
return slot.fn;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
} else if (hasOwn(source, key)) {
|
|
1419
|
+
return source[key];
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
if (hasOwn(target, key)) {
|
|
1424
|
+
return target[key];
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
let currentSlotConsumer = null;
|
|
1428
|
+
function setCurrentSlotConsumer(consumer) {
|
|
1429
|
+
try {
|
|
1430
|
+
return currentSlotConsumer;
|
|
1431
|
+
} finally {
|
|
1432
|
+
currentSlotConsumer = consumer;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
function getParentInstance() {
|
|
1436
|
+
return currentSlotConsumer || currentInstance;
|
|
1437
|
+
}
|
|
1438
|
+
function withVaporCtx(fn) {
|
|
1439
|
+
const owner = currentInstance;
|
|
1440
|
+
return (...args) => {
|
|
1441
|
+
const prev = setCurrentInstance(owner);
|
|
1442
|
+
const prevConsumer = setCurrentSlotConsumer(prev[0]);
|
|
1443
|
+
try {
|
|
1444
|
+
return fn(...args);
|
|
1445
|
+
} finally {
|
|
1446
|
+
setCurrentInstance(...prev);
|
|
1447
|
+
setCurrentSlotConsumer(prevConsumer);
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
function createSlot(name, rawProps, fallback, noSlotted) {
|
|
1452
|
+
const _insertionParent = insertionParent;
|
|
1453
|
+
const _insertionAnchor = insertionAnchor;
|
|
1454
|
+
const _isLastInsertion = isLastInsertion;
|
|
1455
|
+
if (!isHydrating) resetInsertionState();
|
|
1456
|
+
const instance = currentInstance;
|
|
1457
|
+
const rawSlots = instance.rawSlots;
|
|
1458
|
+
const slotProps = rawProps ? new Proxy(rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
|
|
1459
|
+
let fragment;
|
|
1460
|
+
if (isRef(rawSlots._)) {
|
|
1461
|
+
if (isHydrating) locateHydrationNode();
|
|
1462
|
+
fragment = instance.appContext.vapor.vdomSlot(
|
|
1463
|
+
rawSlots._,
|
|
1464
|
+
name,
|
|
1465
|
+
slotProps,
|
|
1466
|
+
instance,
|
|
1467
|
+
fallback
|
|
1468
|
+
);
|
|
1469
|
+
} else {
|
|
1470
|
+
fragment = isHydrating || !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("slot") : new DynamicFragment();
|
|
1471
|
+
const isDynamicName = isFunction(name);
|
|
1472
|
+
const slotScopeIds = [];
|
|
1473
|
+
if (!noSlotted) {
|
|
1474
|
+
const scopeId = instance.type.__scopeId;
|
|
1475
|
+
if (scopeId) {
|
|
1476
|
+
slotScopeIds.push(`${scopeId}-s`);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
const renderSlot = () => {
|
|
1480
|
+
const slotName = isFunction(name) ? name() : name;
|
|
1481
|
+
if (instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce) {
|
|
1482
|
+
const el = createElement("slot");
|
|
1483
|
+
renderEffect(() => {
|
|
1484
|
+
setDynamicProps(el, [
|
|
1485
|
+
slotProps,
|
|
1486
|
+
slotName !== "default" ? { name: slotName } : {}
|
|
1487
|
+
]);
|
|
1488
|
+
});
|
|
1489
|
+
if (fallback) insert(fallback(), el);
|
|
1490
|
+
fragment.nodes = el;
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
const slot = getSlot(rawSlots, slotName);
|
|
1494
|
+
if (slot) {
|
|
1495
|
+
fragment.fallback = fallback;
|
|
1496
|
+
fragment.update(
|
|
1497
|
+
slot._bound || (slot._bound = () => {
|
|
1498
|
+
const prevSlotScopeIds = setCurrentSlotScopeIds(
|
|
1499
|
+
slotScopeIds.length > 0 ? slotScopeIds : null
|
|
1500
|
+
);
|
|
1501
|
+
try {
|
|
1502
|
+
return slot(slotProps);
|
|
1503
|
+
} finally {
|
|
1504
|
+
setCurrentSlotScopeIds(prevSlotScopeIds);
|
|
1505
|
+
}
|
|
1506
|
+
})
|
|
1507
|
+
);
|
|
1508
|
+
} else {
|
|
1509
|
+
fragment.update(fallback);
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
if (isDynamicName || rawSlots.$) {
|
|
1513
|
+
renderEffect(renderSlot);
|
|
1514
|
+
} else {
|
|
1515
|
+
renderSlot();
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
if (!isHydrating) {
|
|
1519
|
+
if (!noSlotted) {
|
|
1520
|
+
const scopeId = instance.type.__scopeId;
|
|
1521
|
+
if (scopeId) {
|
|
1522
|
+
setScopeId(fragment, [`${scopeId}-s`]);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
if (_insertionParent) insert(fragment, _insertionParent, _insertionAnchor);
|
|
1526
|
+
} else {
|
|
1527
|
+
if (fragment.insert) {
|
|
1528
|
+
fragment.hydrate();
|
|
1529
|
+
}
|
|
1530
|
+
if (_isLastInsertion) {
|
|
1531
|
+
advanceHydrationNode(_insertionParent);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
return fragment;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
1538
|
+
// @__NO_SIDE_EFFECTS__
|
|
1539
|
+
function defineVaporComponent(comp, extraOptions) {
|
|
1540
|
+
if (isFunction(comp)) {
|
|
1541
|
+
return /* @__PURE__ */ (() => extend({ name: comp.name }, extraOptions, {
|
|
1542
|
+
setup: comp,
|
|
1543
|
+
__vapor: true
|
|
1544
|
+
}))();
|
|
1545
|
+
}
|
|
1546
|
+
comp.__vapor = true;
|
|
1547
|
+
return comp;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
const VaporKeepAliveImpl = defineVaporComponent({
|
|
1551
|
+
name: "VaporKeepAlive",
|
|
1552
|
+
__isKeepAlive: true,
|
|
1553
|
+
props: {
|
|
1554
|
+
include: [String, RegExp, Array],
|
|
1555
|
+
exclude: [String, RegExp, Array],
|
|
1556
|
+
max: [String, Number]
|
|
1557
|
+
},
|
|
1558
|
+
setup(props, { slots }) {
|
|
1559
|
+
if (!slots.default) {
|
|
1560
|
+
return void 0;
|
|
1561
|
+
}
|
|
1562
|
+
const keepAliveInstance = currentInstance;
|
|
1563
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1564
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1565
|
+
const storageContainer = createElement("div");
|
|
1566
|
+
const keptAliveScopes = /* @__PURE__ */ new Map();
|
|
1567
|
+
let current;
|
|
1568
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
1569
|
+
keepAliveInstance.__v_cache = cache;
|
|
1570
|
+
}
|
|
1571
|
+
keepAliveInstance.getStorageContainer = () => storageContainer;
|
|
1572
|
+
keepAliveInstance.getCachedComponent = (comp) => cache.get(comp);
|
|
1573
|
+
keepAliveInstance.activate = (instance, parentNode, anchor) => {
|
|
1574
|
+
current = instance;
|
|
1575
|
+
activate(instance, parentNode, anchor);
|
|
1576
|
+
};
|
|
1577
|
+
keepAliveInstance.deactivate = (instance) => {
|
|
1578
|
+
current = void 0;
|
|
1579
|
+
deactivate(instance, storageContainer);
|
|
1580
|
+
};
|
|
1581
|
+
const innerCacheBlock = (key, instance) => {
|
|
1465
1582
|
const { max } = props;
|
|
1466
1583
|
if (cache.has(key)) {
|
|
1467
1584
|
keys.delete(key);
|
|
@@ -1474,116 +1591,49 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1474
1591
|
}
|
|
1475
1592
|
cache.set(key, instance);
|
|
1476
1593
|
current = instance;
|
|
1477
|
-
}
|
|
1478
|
-
function cacheBlock() {
|
|
1479
|
-
const block = keepAliveInstance.block;
|
|
1480
|
-
const innerBlock = getInnerBlock(block);
|
|
1481
|
-
if (!innerBlock || !shouldCache(innerBlock)) return;
|
|
1482
|
-
let toCache;
|
|
1483
|
-
let key;
|
|
1484
|
-
let frag;
|
|
1485
|
-
if (isFragment(block) && (frag = findInteropFragment(block))) {
|
|
1486
|
-
toCache = frag;
|
|
1487
|
-
key = frag.vnode.type;
|
|
1488
|
-
} else {
|
|
1489
|
-
toCache = innerBlock;
|
|
1490
|
-
key = innerBlock.type;
|
|
1491
|
-
}
|
|
1492
|
-
innerCacheBlock(key, toCache);
|
|
1493
|
-
}
|
|
1494
|
-
onMounted(cacheBlock);
|
|
1495
|
-
onUpdated(cacheBlock);
|
|
1496
|
-
onBeforeUnmount(() => {
|
|
1497
|
-
cache.forEach((cached, key) => {
|
|
1498
|
-
const instance = getInstanceFromCache(cached);
|
|
1499
|
-
if (!instance) return;
|
|
1500
|
-
resetCachedShapeFlag(cached);
|
|
1501
|
-
cache.delete(key);
|
|
1502
|
-
if (current) {
|
|
1503
|
-
const currentKey = isVaporComponent(current) ? current.type : current.vnode.type;
|
|
1504
|
-
if (currentKey === key) {
|
|
1505
|
-
const da = instance.da;
|
|
1506
|
-
da && queuePostFlushCb(da);
|
|
1507
|
-
return;
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
remove(cached, storageContainer);
|
|
1511
|
-
});
|
|
1512
|
-
});
|
|
1513
|
-
keepAliveInstance.getStorageContainer = () => storageContainer;
|
|
1514
|
-
keepAliveInstance.getCachedComponent = (comp) => {
|
|
1515
|
-
return cache.get(comp);
|
|
1516
1594
|
};
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1595
|
+
const cacheBlock = () => {
|
|
1596
|
+
const block = keepAliveInstance.block;
|
|
1597
|
+
const [innerBlock, interop] = getInnerBlock(block);
|
|
1598
|
+
if (!innerBlock || !shouldCache(innerBlock, props, interop)) return;
|
|
1599
|
+
innerCacheBlock(
|
|
1600
|
+
interop ? innerBlock.vnode.type : innerBlock.type,
|
|
1601
|
+
innerBlock
|
|
1602
|
+
);
|
|
1521
1603
|
};
|
|
1522
|
-
|
|
1523
|
-
const innerBlock = getInnerBlock(frag.nodes);
|
|
1524
|
-
if (!innerBlock) return;
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
fragment.vnode.shapeFlag |= 512;
|
|
1604
|
+
const processFragment = (frag) => {
|
|
1605
|
+
const [innerBlock, interop] = getInnerBlock(frag.nodes);
|
|
1606
|
+
if (!innerBlock && !shouldCache(innerBlock, props, interop)) return;
|
|
1607
|
+
if (interop) {
|
|
1608
|
+
if (cache.has(innerBlock.vnode.type)) {
|
|
1609
|
+
innerBlock.vnode.shapeFlag |= 512;
|
|
1529
1610
|
}
|
|
1530
|
-
if (shouldCache(innerBlock)) {
|
|
1531
|
-
|
|
1611
|
+
if (shouldCache(innerBlock, props, true)) {
|
|
1612
|
+
innerBlock.vnode.shapeFlag |= 256;
|
|
1532
1613
|
}
|
|
1533
1614
|
} else {
|
|
1534
1615
|
if (cache.has(innerBlock.type)) {
|
|
1535
1616
|
innerBlock.shapeFlag |= 512;
|
|
1536
1617
|
}
|
|
1537
|
-
if (shouldCache(innerBlock)) {
|
|
1618
|
+
if (shouldCache(innerBlock, props)) {
|
|
1538
1619
|
innerBlock.shapeFlag |= 256;
|
|
1539
1620
|
}
|
|
1540
1621
|
}
|
|
1541
1622
|
};
|
|
1542
|
-
|
|
1543
|
-
const innerBlock = getInnerBlock(fragment.nodes);
|
|
1544
|
-
if (!innerBlock || !shouldCache(innerBlock)) return;
|
|
1545
|
-
let toCache;
|
|
1623
|
+
const cacheFragment = (fragment) => {
|
|
1624
|
+
const [innerBlock, interop] = getInnerBlock(fragment.nodes);
|
|
1625
|
+
if (!innerBlock || !shouldCache(innerBlock, props, interop)) return;
|
|
1546
1626
|
let key;
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
toCache = frag;
|
|
1551
|
-
key = frag.vnode.type;
|
|
1627
|
+
if (interop) {
|
|
1628
|
+
innerBlock.vnode.shapeFlag |= 256;
|
|
1629
|
+
key = innerBlock.vnode.type;
|
|
1552
1630
|
} else {
|
|
1553
1631
|
innerBlock.shapeFlag |= 256;
|
|
1554
|
-
toCache = innerBlock;
|
|
1555
1632
|
key = innerBlock.type;
|
|
1556
1633
|
}
|
|
1557
|
-
innerCacheBlock(key,
|
|
1558
|
-
};
|
|
1559
|
-
keepAliveInstance.activate = (instance, parentNode, anchor) => {
|
|
1560
|
-
current = instance;
|
|
1561
|
-
activate(instance, parentNode, anchor);
|
|
1562
|
-
};
|
|
1563
|
-
keepAliveInstance.deactivate = (instance) => {
|
|
1564
|
-
current = void 0;
|
|
1565
|
-
deactivate(instance, storageContainer);
|
|
1634
|
+
innerCacheBlock(key, innerBlock);
|
|
1566
1635
|
};
|
|
1567
|
-
|
|
1568
|
-
if (isVaporComponent(cached)) {
|
|
1569
|
-
resetShapeFlag(cached);
|
|
1570
|
-
} else {
|
|
1571
|
-
resetShapeFlag(cached.vnode);
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
let children = slots.default();
|
|
1575
|
-
if (isArray(children) && children.length > 1) {
|
|
1576
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1577
|
-
warn(`KeepAlive should contain exactly one component child.`);
|
|
1578
|
-
}
|
|
1579
|
-
return children;
|
|
1580
|
-
}
|
|
1581
|
-
if (isVaporComponent(children)) {
|
|
1582
|
-
children.shapeFlag |= 256;
|
|
1583
|
-
} else if (isInteropFragment(children)) {
|
|
1584
|
-
children.vnode.shapeFlag |= 256;
|
|
1585
|
-
}
|
|
1586
|
-
function pruneCache(filter) {
|
|
1636
|
+
const pruneCache = (filter) => {
|
|
1587
1637
|
cache.forEach((cached, key) => {
|
|
1588
1638
|
const instance = getInstanceFromCache(cached);
|
|
1589
1639
|
if (!instance) return;
|
|
@@ -1592,8 +1642,8 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1592
1642
|
pruneCacheEntry(key);
|
|
1593
1643
|
}
|
|
1594
1644
|
});
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1645
|
+
};
|
|
1646
|
+
const pruneCacheEntry = (key) => {
|
|
1597
1647
|
const cached = cache.get(key);
|
|
1598
1648
|
resetCachedShapeFlag(cached);
|
|
1599
1649
|
if (cached !== current) {
|
|
@@ -1601,7 +1651,7 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1601
1651
|
}
|
|
1602
1652
|
cache.delete(key);
|
|
1603
1653
|
keys.delete(key);
|
|
1604
|
-
}
|
|
1654
|
+
};
|
|
1605
1655
|
watch(
|
|
1606
1656
|
() => [props.include, props.exclude],
|
|
1607
1657
|
([include, exclude]) => {
|
|
@@ -1611,29 +1661,103 @@ const VaporKeepAliveImpl = defineVaporComponent({
|
|
|
1611
1661
|
// prune post-render after `current` has been updated
|
|
1612
1662
|
{ flush: "post", deep: true }
|
|
1613
1663
|
);
|
|
1664
|
+
onMounted(cacheBlock);
|
|
1665
|
+
onUpdated(cacheBlock);
|
|
1666
|
+
onBeforeUnmount(() => {
|
|
1667
|
+
cache.forEach((cached, key) => {
|
|
1668
|
+
const instance = getInstanceFromCache(cached);
|
|
1669
|
+
if (!instance) return;
|
|
1670
|
+
resetCachedShapeFlag(cached);
|
|
1671
|
+
cache.delete(key);
|
|
1672
|
+
if (current) {
|
|
1673
|
+
const currentKey = isVaporComponent(current) ? current.type : current.vnode.type;
|
|
1674
|
+
if (currentKey === key) {
|
|
1675
|
+
const da = instance.da;
|
|
1676
|
+
da && queuePostFlushCb(da);
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
remove(cached, storageContainer);
|
|
1681
|
+
});
|
|
1682
|
+
keptAliveScopes.forEach((scope) => scope.stop());
|
|
1683
|
+
keptAliveScopes.clear();
|
|
1684
|
+
});
|
|
1685
|
+
let children = slots.default();
|
|
1686
|
+
if (isArray(children)) {
|
|
1687
|
+
children = children.filter((child) => !(child instanceof Comment));
|
|
1688
|
+
if (children.length > 1) {
|
|
1689
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1690
|
+
warn(`KeepAlive should contain exactly one component child.`);
|
|
1691
|
+
}
|
|
1692
|
+
return children;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
const injectKeepAliveHooks = (frag) => {
|
|
1696
|
+
(frag.beforeTeardown || (frag.beforeTeardown = [])).push(
|
|
1697
|
+
(oldKey, nodes, scope) => {
|
|
1698
|
+
processFragment(frag);
|
|
1699
|
+
keptAliveScopes.set(oldKey, scope);
|
|
1700
|
+
return true;
|
|
1701
|
+
}
|
|
1702
|
+
);
|
|
1703
|
+
(frag.beforeMount || (frag.beforeMount = [])).push(
|
|
1704
|
+
() => cacheFragment(frag)
|
|
1705
|
+
);
|
|
1706
|
+
frag.getScope = (key) => {
|
|
1707
|
+
const scope = keptAliveScopes.get(key);
|
|
1708
|
+
if (scope) {
|
|
1709
|
+
keptAliveScopes.delete(key);
|
|
1710
|
+
return scope;
|
|
1711
|
+
}
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
if (isVaporComponent(children)) {
|
|
1715
|
+
children.shapeFlag |= 256;
|
|
1716
|
+
if (isAsyncWrapper(children)) {
|
|
1717
|
+
injectKeepAliveHooks(children.block);
|
|
1718
|
+
}
|
|
1719
|
+
} else if (isInteropFragment(children)) {
|
|
1720
|
+
children.vnode.shapeFlag |= 256;
|
|
1721
|
+
} else if (isDynamicFragment(children)) {
|
|
1722
|
+
processFragment(children);
|
|
1723
|
+
injectKeepAliveHooks(children);
|
|
1724
|
+
if (isVaporComponent(children.nodes) && isAsyncWrapper(children.nodes)) {
|
|
1725
|
+
injectKeepAliveHooks(children.nodes.block);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1614
1728
|
return children;
|
|
1615
1729
|
}
|
|
1616
1730
|
});
|
|
1731
|
+
const shouldCache = (block, props, interop = false) => {
|
|
1732
|
+
const isAsync = !interop && isAsyncWrapper(block);
|
|
1733
|
+
const type = interop ? block.vnode.type : block.type;
|
|
1734
|
+
if (isAsync && !type.__asyncResolved) {
|
|
1735
|
+
return true;
|
|
1736
|
+
}
|
|
1737
|
+
const { include, exclude } = props;
|
|
1738
|
+
const name = getComponentName(isAsync ? type.__asyncResolved : type);
|
|
1739
|
+
return !(include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name));
|
|
1740
|
+
};
|
|
1741
|
+
const resetCachedShapeFlag = (cached) => {
|
|
1742
|
+
if (isVaporComponent(cached)) {
|
|
1743
|
+
resetShapeFlag(cached);
|
|
1744
|
+
} else {
|
|
1745
|
+
resetShapeFlag(cached.vnode);
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1617
1748
|
function getInnerBlock(block) {
|
|
1618
1749
|
if (isVaporComponent(block)) {
|
|
1619
|
-
return block;
|
|
1750
|
+
return [block, false];
|
|
1620
1751
|
} else if (isInteropFragment(block)) {
|
|
1621
|
-
return block
|
|
1752
|
+
return [block, true];
|
|
1622
1753
|
} else if (isFragment(block)) {
|
|
1623
1754
|
return getInnerBlock(block.nodes);
|
|
1624
1755
|
}
|
|
1756
|
+
return [void 0, false];
|
|
1625
1757
|
}
|
|
1626
1758
|
function isInteropFragment(block) {
|
|
1627
1759
|
return !!(isFragment(block) && block.vnode);
|
|
1628
1760
|
}
|
|
1629
|
-
function findInteropFragment(block) {
|
|
1630
|
-
if (isInteropFragment(block)) {
|
|
1631
|
-
return block;
|
|
1632
|
-
}
|
|
1633
|
-
if (isFragment(block)) {
|
|
1634
|
-
return findInteropFragment(block.nodes);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
1761
|
function getInstanceFromCache(cached) {
|
|
1638
1762
|
if (isVaporComponent(cached)) {
|
|
1639
1763
|
return cached;
|
|
@@ -1824,8 +1948,7 @@ const vaporSlotsProxyHandler = {
|
|
|
1824
1948
|
}
|
|
1825
1949
|
};
|
|
1826
1950
|
let vdomHydrateNode;
|
|
1827
|
-
function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
1828
|
-
const parentInstance = currentInstance;
|
|
1951
|
+
function createVDOMComponent(internals, component, parentComponent, rawProps, rawSlots) {
|
|
1829
1952
|
const frag = new VaporFragment([]);
|
|
1830
1953
|
const vnode = frag.vnode = createVNode(
|
|
1831
1954
|
component,
|
|
@@ -1834,7 +1957,10 @@ function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
|
1834
1957
|
const wrapper = new VaporComponentInstance(
|
|
1835
1958
|
{ props: component.props },
|
|
1836
1959
|
rawProps,
|
|
1837
|
-
rawSlots
|
|
1960
|
+
rawSlots,
|
|
1961
|
+
parentComponent ? parentComponent.appContext : void 0,
|
|
1962
|
+
void 0,
|
|
1963
|
+
parentComponent
|
|
1838
1964
|
);
|
|
1839
1965
|
vnode.vi = (instance) => {
|
|
1840
1966
|
instance.props = shallowReactive(wrapper.props);
|
|
@@ -1854,9 +1980,9 @@ function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
|
1854
1980
|
if (vnode.shapeFlag & 256) {
|
|
1855
1981
|
deactivate$1(
|
|
1856
1982
|
vnode,
|
|
1857
|
-
findParentKeepAlive(
|
|
1983
|
+
findParentKeepAlive(parentComponent).getStorageContainer(),
|
|
1858
1984
|
internals,
|
|
1859
|
-
|
|
1985
|
+
parentComponent,
|
|
1860
1986
|
null
|
|
1861
1987
|
);
|
|
1862
1988
|
return;
|
|
@@ -1864,12 +1990,12 @@ function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
|
1864
1990
|
internals.umt(vnode.component, null, !!parentNode);
|
|
1865
1991
|
};
|
|
1866
1992
|
frag.hydrate = () => {
|
|
1867
|
-
hydrateVNode(vnode,
|
|
1993
|
+
hydrateVNode(vnode, parentComponent);
|
|
1868
1994
|
onScopeDispose(unmount, true);
|
|
1869
1995
|
isMounted = true;
|
|
1870
1996
|
frag.nodes = vnode.el;
|
|
1871
1997
|
};
|
|
1872
|
-
vnode.scopeId =
|
|
1998
|
+
vnode.scopeId = currentInstance && currentInstance.type.__scopeId || null;
|
|
1873
1999
|
vnode.slotScopeIds = currentSlotScopeIds;
|
|
1874
2000
|
frag.insert = (parentNode, anchor, transition) => {
|
|
1875
2001
|
if (isHydrating) return;
|
|
@@ -1879,21 +2005,21 @@ function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
|
1879
2005
|
parentNode,
|
|
1880
2006
|
anchor,
|
|
1881
2007
|
internals,
|
|
1882
|
-
|
|
2008
|
+
parentComponent,
|
|
1883
2009
|
null,
|
|
1884
2010
|
void 0,
|
|
1885
2011
|
false
|
|
1886
2012
|
);
|
|
1887
2013
|
} else {
|
|
1888
2014
|
const prev = currentInstance;
|
|
1889
|
-
simpleSetCurrentInstance(
|
|
2015
|
+
simpleSetCurrentInstance(parentComponent);
|
|
1890
2016
|
if (!isMounted) {
|
|
1891
2017
|
if (transition) setTransitionHooks$1(vnode, transition);
|
|
1892
2018
|
internals.mt(
|
|
1893
2019
|
vnode,
|
|
1894
2020
|
parentNode,
|
|
1895
2021
|
anchor,
|
|
1896
|
-
|
|
2022
|
+
parentComponent,
|
|
1897
2023
|
null,
|
|
1898
2024
|
void 0,
|
|
1899
2025
|
false
|
|
@@ -1907,12 +2033,13 @@ function createVDOMComponent(internals, component, rawProps, rawSlots) {
|
|
|
1907
2033
|
parentNode,
|
|
1908
2034
|
anchor,
|
|
1909
2035
|
2,
|
|
1910
|
-
|
|
2036
|
+
parentComponent
|
|
1911
2037
|
);
|
|
1912
2038
|
}
|
|
1913
2039
|
simpleSetCurrentInstance(prev);
|
|
1914
2040
|
}
|
|
1915
2041
|
frag.nodes = vnode.el;
|
|
2042
|
+
if (isMounted && frag.updated) frag.updated.forEach((m) => m());
|
|
1916
2043
|
};
|
|
1917
2044
|
frag.remove = unmount;
|
|
1918
2045
|
frag.setRef = (instance, ref, refFor, refKey) => {
|
|
@@ -1954,6 +2081,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
1954
2081
|
internals.um(oldVNode, parentComponent, null);
|
|
1955
2082
|
}
|
|
1956
2083
|
};
|
|
2084
|
+
if (isMounted && frag.updated) frag.updated.forEach((m) => m());
|
|
1957
2085
|
};
|
|
1958
2086
|
const render = (parentNode, anchor) => {
|
|
1959
2087
|
renderEffect(() => {
|
|
@@ -2154,7 +2282,7 @@ function getPropsProxyHandlers(comp, once) {
|
|
|
2154
2282
|
return resolvePropValue(
|
|
2155
2283
|
propsOptions,
|
|
2156
2284
|
key,
|
|
2157
|
-
rawProps[rawKey]
|
|
2285
|
+
resolveSource(rawProps[rawKey]),
|
|
2158
2286
|
instance,
|
|
2159
2287
|
resolveDefault
|
|
2160
2288
|
);
|
|
@@ -2257,10 +2385,11 @@ function getAttrFromRawProps(rawProps, key) {
|
|
|
2257
2385
|
}
|
|
2258
2386
|
}
|
|
2259
2387
|
if (hasOwn(rawProps, key)) {
|
|
2388
|
+
const value = resolveSource(rawProps[key]);
|
|
2260
2389
|
if (merged) {
|
|
2261
|
-
merged.push(
|
|
2390
|
+
merged.push(value);
|
|
2262
2391
|
} else {
|
|
2263
|
-
return
|
|
2392
|
+
return value;
|
|
2264
2393
|
}
|
|
2265
2394
|
}
|
|
2266
2395
|
if (merged && merged.length) {
|
|
@@ -2351,7 +2480,7 @@ function resolveDynamicProps(props) {
|
|
|
2351
2480
|
const mergedRawProps = {};
|
|
2352
2481
|
for (const key in props) {
|
|
2353
2482
|
if (key !== "$") {
|
|
2354
|
-
mergedRawProps[key] = props[key]
|
|
2483
|
+
mergedRawProps[key] = resolveSource(props[key]);
|
|
2355
2484
|
}
|
|
2356
2485
|
}
|
|
2357
2486
|
if (props.$) {
|
|
@@ -2485,6 +2614,7 @@ class TeleportFragment extends VaporFragment {
|
|
|
2485
2614
|
};
|
|
2486
2615
|
this.rawProps = props;
|
|
2487
2616
|
this.rawSlots = slots;
|
|
2617
|
+
this.parentComponent = currentInstance;
|
|
2488
2618
|
this.anchor = isHydrating ? void 0 : !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createTextNode();
|
|
2489
2619
|
renderEffect(() => {
|
|
2490
2620
|
this.resolvedProps = extend(
|
|
@@ -2494,6 +2624,7 @@ class TeleportFragment extends VaporFragment {
|
|
|
2494
2624
|
rawPropsProxyHandlers
|
|
2495
2625
|
)
|
|
2496
2626
|
);
|
|
2627
|
+
this.isDisabled = isTeleportDisabled(this.resolvedProps);
|
|
2497
2628
|
this.handlePropsUpdate();
|
|
2498
2629
|
});
|
|
2499
2630
|
if (!isHydrating) {
|
|
@@ -2509,8 +2640,21 @@ class TeleportFragment extends VaporFragment {
|
|
|
2509
2640
|
this.rawSlots.default && this.rawSlots.default()
|
|
2510
2641
|
);
|
|
2511
2642
|
});
|
|
2643
|
+
const nodes = this.nodes;
|
|
2644
|
+
if (this.parentComponent && this.parentComponent.ut) {
|
|
2645
|
+
if (isFragment(nodes)) {
|
|
2646
|
+
(nodes.updated || (nodes.updated = [])).push(() => updateCssVars(this));
|
|
2647
|
+
} else if (isArray(nodes)) {
|
|
2648
|
+
nodes.forEach((node) => {
|
|
2649
|
+
if (isFragment(node)) {
|
|
2650
|
+
(node.updated || (node.updated = [])).push(
|
|
2651
|
+
() => updateCssVars(this)
|
|
2652
|
+
);
|
|
2653
|
+
}
|
|
2654
|
+
});
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2512
2657
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2513
|
-
const nodes = this.nodes;
|
|
2514
2658
|
if (isVaporComponent(nodes)) {
|
|
2515
2659
|
nodes.parentTeleport = this;
|
|
2516
2660
|
} else if (isArray(nodes)) {
|
|
@@ -2554,7 +2698,11 @@ class TeleportFragment extends VaporFragment {
|
|
|
2554
2698
|
insert(this.targetStart = createTextNode(""), target);
|
|
2555
2699
|
insert(this.targetAnchor = createTextNode(""), target);
|
|
2556
2700
|
}
|
|
2701
|
+
if (this.parentComponent && this.parentComponent.isCE) {
|
|
2702
|
+
(this.parentComponent.ce._teleportTargets || (this.parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
2703
|
+
}
|
|
2557
2704
|
mount(target, this.targetAnchor);
|
|
2705
|
+
updateCssVars(this);
|
|
2558
2706
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2559
2707
|
warn(
|
|
2560
2708
|
`Invalid Teleport target on ${this.targetAnchor ? "update" : "mount"}:`,
|
|
@@ -2563,10 +2711,13 @@ class TeleportFragment extends VaporFragment {
|
|
|
2563
2711
|
);
|
|
2564
2712
|
}
|
|
2565
2713
|
};
|
|
2566
|
-
if (
|
|
2714
|
+
if (this.isDisabled) {
|
|
2567
2715
|
mount(this.parent, this.anchor);
|
|
2716
|
+
updateCssVars(this);
|
|
2568
2717
|
} else {
|
|
2569
|
-
if (isTeleportDeferred(this.resolvedProps)
|
|
2718
|
+
if (isTeleportDeferred(this.resolvedProps) || // force defer when the parent is not connected to the DOM,
|
|
2719
|
+
// typically due to an early insertion caused by setInsertionState.
|
|
2720
|
+
!this.parent.isConnected) {
|
|
2570
2721
|
queuePostFlushCb(mountToTarget);
|
|
2571
2722
|
} else {
|
|
2572
2723
|
mountToTarget();
|
|
@@ -2613,6 +2764,25 @@ function locateTeleportEndAnchor(node = currentHydrationNode) {
|
|
|
2613
2764
|
}
|
|
2614
2765
|
return null;
|
|
2615
2766
|
}
|
|
2767
|
+
function updateCssVars(frag) {
|
|
2768
|
+
const ctx = frag.parentComponent;
|
|
2769
|
+
if (ctx && ctx.ut) {
|
|
2770
|
+
let node, anchor;
|
|
2771
|
+
if (frag.isDisabled) {
|
|
2772
|
+
node = frag.placeholder;
|
|
2773
|
+
anchor = frag.anchor;
|
|
2774
|
+
} else {
|
|
2775
|
+
node = frag.targetStart;
|
|
2776
|
+
anchor = frag.targetAnchor;
|
|
2777
|
+
}
|
|
2778
|
+
while (node && node !== anchor) {
|
|
2779
|
+
if (node.nodeType === 1)
|
|
2780
|
+
node.setAttribute("data-v-owner", String(ctx.uid));
|
|
2781
|
+
node = node.nextSibling;
|
|
2782
|
+
}
|
|
2783
|
+
ctx.ut();
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2616
2786
|
|
|
2617
2787
|
function isBlock(val) {
|
|
2618
2788
|
return val instanceof Node || isArray(val) || isVaporComponent(val) || isFragment(val);
|
|
@@ -2695,11 +2865,6 @@ function remove(block, parent) {
|
|
|
2695
2865
|
if (block.anchor) remove(block.anchor, parent);
|
|
2696
2866
|
if (block.scope) {
|
|
2697
2867
|
block.scope.stop();
|
|
2698
|
-
const scopes = block.keptAliveScopes;
|
|
2699
|
-
if (scopes) {
|
|
2700
|
-
scopes.forEach((scope) => scope.stop());
|
|
2701
|
-
scopes.clear();
|
|
2702
|
-
}
|
|
2703
2868
|
}
|
|
2704
2869
|
}
|
|
2705
2870
|
}
|
|
@@ -2774,13 +2939,15 @@ function setScopeId(block, scopeIds) {
|
|
|
2774
2939
|
}
|
|
2775
2940
|
}
|
|
2776
2941
|
function setComponentScopeId(instance) {
|
|
2777
|
-
const parent = instance
|
|
2778
|
-
if (!parent) return;
|
|
2942
|
+
const { parent, scopeId } = instance;
|
|
2943
|
+
if (!parent || !scopeId) return;
|
|
2779
2944
|
if (isArray(instance.block) && instance.block.length > 1) return;
|
|
2780
2945
|
const scopeIds = [];
|
|
2781
|
-
const
|
|
2782
|
-
if (scopeId) {
|
|
2946
|
+
const parentScopeId = parent && parent.type.__scopeId;
|
|
2947
|
+
if (parentScopeId !== scopeId) {
|
|
2783
2948
|
scopeIds.push(scopeId);
|
|
2949
|
+
} else {
|
|
2950
|
+
if (parentScopeId) scopeIds.push(parentScopeId);
|
|
2784
2951
|
}
|
|
2785
2952
|
if (parent.subTree && parent.subTree.component === instance && parent.vnode.scopeId) {
|
|
2786
2953
|
scopeIds.push(parent.vnode.scopeId);
|
|
@@ -2809,6 +2976,10 @@ function hmrRerender(instance) {
|
|
|
2809
2976
|
insert(instance.block, parent, anchor);
|
|
2810
2977
|
}
|
|
2811
2978
|
function hmrReload(instance, newComp) {
|
|
2979
|
+
if (instance.parent && isKeepAlive(instance.parent)) {
|
|
2980
|
+
instance.parent.hmrRerender();
|
|
2981
|
+
return;
|
|
2982
|
+
}
|
|
2812
2983
|
const normalized = normalizeBlock(instance.block);
|
|
2813
2984
|
const parent = normalized[0].parentNode;
|
|
2814
2985
|
const anchor = normalized[normalized.length - 1].nextSibling;
|
|
@@ -2866,8 +3037,9 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
2866
3037
|
} else {
|
|
2867
3038
|
resetInsertionState();
|
|
2868
3039
|
}
|
|
2869
|
-
|
|
2870
|
-
|
|
3040
|
+
const parentInstance = getParentInstance();
|
|
3041
|
+
if (isSingleRoot && component.inheritAttrs !== false && isVaporComponent(parentInstance) && parentInstance.hasFallthrough) {
|
|
3042
|
+
const attrs = parentInstance.attrs;
|
|
2871
3043
|
if (rawProps) {
|
|
2872
3044
|
(rawProps.$ || (rawProps.$ = [])).push(
|
|
2873
3045
|
() => attrs
|
|
@@ -2876,18 +3048,21 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
2876
3048
|
rawProps = { $: [() => attrs] };
|
|
2877
3049
|
}
|
|
2878
3050
|
}
|
|
2879
|
-
if (
|
|
2880
|
-
const cached =
|
|
3051
|
+
if (parentInstance && parentInstance.vapor && isKeepAlive(parentInstance)) {
|
|
3052
|
+
const cached = parentInstance.getCachedComponent(
|
|
2881
3053
|
component
|
|
2882
3054
|
);
|
|
2883
3055
|
if (cached) return cached;
|
|
2884
3056
|
}
|
|
2885
3057
|
if (appContext.vapor && !component.__vapor) {
|
|
3058
|
+
const prevSlotConsumer2 = setCurrentSlotConsumer(null);
|
|
2886
3059
|
const frag = appContext.vapor.vdomMount(
|
|
2887
3060
|
component,
|
|
3061
|
+
parentInstance,
|
|
2888
3062
|
rawProps,
|
|
2889
3063
|
rawSlots
|
|
2890
3064
|
);
|
|
3065
|
+
setCurrentSlotConsumer(prevSlotConsumer2);
|
|
2891
3066
|
if (!isHydrating) {
|
|
2892
3067
|
if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
|
|
2893
3068
|
} else {
|
|
@@ -2915,15 +3090,15 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
2915
3090
|
rawProps,
|
|
2916
3091
|
rawSlots,
|
|
2917
3092
|
appContext,
|
|
2918
|
-
once
|
|
3093
|
+
once,
|
|
3094
|
+
parentInstance
|
|
2919
3095
|
);
|
|
2920
|
-
|
|
3096
|
+
const prevSlotConsumer = setCurrentSlotConsumer(null);
|
|
3097
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2921
3098
|
registerHMR(instance);
|
|
2922
3099
|
instance.isSingleRoot = isSingleRoot;
|
|
2923
3100
|
instance.hmrRerender = hmrRerender.bind(null, instance);
|
|
2924
3101
|
instance.hmrReload = hmrReload.bind(null, instance);
|
|
2925
|
-
}
|
|
2926
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2927
3102
|
pushWarningContext(instance);
|
|
2928
3103
|
startMeasure(instance, `init`);
|
|
2929
3104
|
instance.propsOptions = normalizePropsOptions(component);
|
|
@@ -2958,6 +3133,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
2958
3133
|
} else {
|
|
2959
3134
|
setupComponent(instance, component);
|
|
2960
3135
|
}
|
|
3136
|
+
setCurrentSlotConsumer(prevSlotConsumer);
|
|
2961
3137
|
onScopeDispose$1(() => unmountComponent(instance), true);
|
|
2962
3138
|
if (_insertionParent || isHydrating) {
|
|
2963
3139
|
mountComponent(instance, _insertionParent, _insertionAnchor);
|
|
@@ -3055,16 +3231,16 @@ const emptyContext = {
|
|
|
3055
3231
|
provides: /* @__PURE__ */ Object.create(null)
|
|
3056
3232
|
};
|
|
3057
3233
|
class VaporComponentInstance {
|
|
3058
|
-
constructor(comp, rawProps, rawSlots, appContext, once) {
|
|
3234
|
+
constructor(comp, rawProps, rawSlots, appContext, once, parent = currentInstance) {
|
|
3059
3235
|
this.vapor = true;
|
|
3060
3236
|
this.uid = nextUid();
|
|
3061
3237
|
this.type = comp;
|
|
3062
|
-
this.parent =
|
|
3063
|
-
this.root =
|
|
3064
|
-
if (
|
|
3065
|
-
this.appContext =
|
|
3066
|
-
this.provides =
|
|
3067
|
-
this.ids =
|
|
3238
|
+
this.parent = parent;
|
|
3239
|
+
this.root = parent ? parent.root : this;
|
|
3240
|
+
if (parent) {
|
|
3241
|
+
this.appContext = parent.appContext;
|
|
3242
|
+
this.provides = parent.provides;
|
|
3243
|
+
this.ids = parent.ids;
|
|
3068
3244
|
} else {
|
|
3069
3245
|
this.appContext = appContext || emptyContext;
|
|
3070
3246
|
this.provides = Object.create(this.appContext.provides);
|
|
@@ -3088,6 +3264,10 @@ class VaporComponentInstance {
|
|
|
3088
3264
|
}
|
|
3089
3265
|
this.rawSlots = rawSlots || EMPTY_OBJ;
|
|
3090
3266
|
this.slots = rawSlots ? rawSlots.$ ? new Proxy(rawSlots, dynamicSlotsProxyHandlers) : rawSlots : EMPTY_OBJ;
|
|
3267
|
+
this.scopeId = currentInstance && currentInstance.type.__scopeId;
|
|
3268
|
+
if (comp.ce) {
|
|
3269
|
+
comp.ce(this);
|
|
3270
|
+
}
|
|
3091
3271
|
}
|
|
3092
3272
|
/**
|
|
3093
3273
|
* Expose `getKeysFromRawProps` on the instance so it can be used in code
|
|
@@ -3111,6 +3291,9 @@ function createComponentWithFallback(comp, rawProps, rawSlots, isSingleRoot, onc
|
|
|
3111
3291
|
appContext
|
|
3112
3292
|
);
|
|
3113
3293
|
}
|
|
3294
|
+
return createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once);
|
|
3295
|
+
}
|
|
3296
|
+
function createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once) {
|
|
3114
3297
|
const _insertionParent = insertionParent;
|
|
3115
3298
|
const _insertionAnchor = insertionAnchor;
|
|
3116
3299
|
const _isLastInsertion = isLastInsertion;
|
|
@@ -3136,8 +3319,15 @@ function createComponentWithFallback(comp, rawProps, rawSlots, isSingleRoot, onc
|
|
|
3136
3319
|
nextNode = locateNextNode(el);
|
|
3137
3320
|
setCurrentHydrationNode(el.firstChild);
|
|
3138
3321
|
}
|
|
3139
|
-
if (rawSlots.$)
|
|
3140
|
-
|
|
3322
|
+
if (rawSlots.$) {
|
|
3323
|
+
const frag = new DynamicFragment(
|
|
3324
|
+
isHydrating ? "" : !!(process.env.NODE_ENV !== "production") ? "slot" : void 0
|
|
3325
|
+
);
|
|
3326
|
+
renderEffect(() => frag.update(getSlot(rawSlots, "default")));
|
|
3327
|
+
if (!isHydrating) insert(frag, el);
|
|
3328
|
+
} else {
|
|
3329
|
+
const block = getSlot(rawSlots, "default")();
|
|
3330
|
+
if (!isHydrating) insert(block, el);
|
|
3141
3331
|
}
|
|
3142
3332
|
if (isHydrating) {
|
|
3143
3333
|
setCurrentHydrationNode(nextNode);
|
|
@@ -3157,6 +3347,11 @@ function mountComponent(instance, parent, anchor) {
|
|
|
3157
3347
|
findParentKeepAlive(instance).activate(instance, parent, anchor);
|
|
3158
3348
|
return;
|
|
3159
3349
|
}
|
|
3350
|
+
const { root, type } = instance;
|
|
3351
|
+
if (root && root.ce && // @ts-expect-error _def is private
|
|
3352
|
+
root.ce._def.shadowRoot !== false) {
|
|
3353
|
+
root.ce._injectChildStyle(type);
|
|
3354
|
+
}
|
|
3160
3355
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3161
3356
|
startMeasure(instance, `mount`);
|
|
3162
3357
|
}
|
|
@@ -3213,6 +3408,22 @@ function getRootElement(block) {
|
|
|
3213
3408
|
return nodes;
|
|
3214
3409
|
}
|
|
3215
3410
|
}
|
|
3411
|
+
if (isArray(block)) {
|
|
3412
|
+
let singleRoot;
|
|
3413
|
+
let hasComment = false;
|
|
3414
|
+
for (const b of block) {
|
|
3415
|
+
if (b instanceof Comment) {
|
|
3416
|
+
hasComment = true;
|
|
3417
|
+
continue;
|
|
3418
|
+
}
|
|
3419
|
+
const thisRoot = getRootElement(b);
|
|
3420
|
+
if (!thisRoot || singleRoot) {
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
singleRoot = thisRoot;
|
|
3424
|
+
}
|
|
3425
|
+
return hasComment ? singleRoot : void 0;
|
|
3426
|
+
}
|
|
3216
3427
|
}
|
|
3217
3428
|
|
|
3218
3429
|
let _createApp;
|
|
@@ -3224,7 +3435,7 @@ const mountApp = (app, container) => {
|
|
|
3224
3435
|
}
|
|
3225
3436
|
container.textContent = "";
|
|
3226
3437
|
}
|
|
3227
|
-
const instance = createComponent(
|
|
3438
|
+
const instance = app._ceComponent || createComponent(
|
|
3228
3439
|
app._component,
|
|
3229
3440
|
app._props,
|
|
3230
3441
|
null,
|
|
@@ -3241,7 +3452,7 @@ const hydrateApp = (app, container) => {
|
|
|
3241
3452
|
optimizePropertyLookup();
|
|
3242
3453
|
let instance;
|
|
3243
3454
|
withHydration(container, () => {
|
|
3244
|
-
instance = createComponent(
|
|
3455
|
+
instance = app._ceComponent || createComponent(
|
|
3245
3456
|
app._component,
|
|
3246
3457
|
app._props,
|
|
3247
3458
|
null,
|
|
@@ -3402,28 +3613,146 @@ function defineVaporAsyncComponent(source) {
|
|
|
3402
3613
|
});
|
|
3403
3614
|
}
|
|
3404
3615
|
function createInnerComp(comp, parent, frag) {
|
|
3405
|
-
const { rawProps, rawSlots,
|
|
3616
|
+
const { rawProps, rawSlots, appContext, $transition } = parent;
|
|
3406
3617
|
const instance = createComponent(
|
|
3407
3618
|
comp,
|
|
3408
3619
|
rawProps,
|
|
3409
3620
|
rawSlots,
|
|
3410
|
-
|
|
3621
|
+
// rawProps is shared and already contains fallthrough attrs.
|
|
3622
|
+
// so isSingleRoot should be undefined
|
|
3623
|
+
void 0,
|
|
3411
3624
|
void 0,
|
|
3412
3625
|
appContext
|
|
3413
3626
|
);
|
|
3414
|
-
if (parent.parent && isKeepAlive(parent.parent)) {
|
|
3415
|
-
parent.parent.cacheComponent(instance);
|
|
3416
|
-
parent.parent.cacheComponent(parent);
|
|
3417
|
-
}
|
|
3418
3627
|
if ($transition) setTransitionHooks(instance, $transition);
|
|
3419
3628
|
frag && frag.setRef && frag.setRef(instance);
|
|
3420
3629
|
return instance;
|
|
3421
3630
|
}
|
|
3422
3631
|
|
|
3632
|
+
// @__NO_SIDE_EFFECTS__
|
|
3633
|
+
function defineVaporCustomElement(options, extraOptions, _createApp) {
|
|
3634
|
+
let Comp = defineVaporComponent(options, extraOptions);
|
|
3635
|
+
if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
|
|
3636
|
+
class VaporCustomElement extends VaporElement {
|
|
3637
|
+
constructor(initialProps) {
|
|
3638
|
+
super(Comp, initialProps, _createApp);
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
VaporCustomElement.def = Comp;
|
|
3642
|
+
return VaporCustomElement;
|
|
3643
|
+
}
|
|
3644
|
+
const defineVaporSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
|
|
3645
|
+
return /* @__PURE__ */ defineVaporCustomElement(options, extraOptions, createVaporSSRApp);
|
|
3646
|
+
});
|
|
3647
|
+
class VaporElement extends VueElementBase {
|
|
3648
|
+
constructor(def, props = {}, createAppFn = createVaporApp) {
|
|
3649
|
+
super(def, props, createAppFn);
|
|
3650
|
+
}
|
|
3651
|
+
_needsHydration() {
|
|
3652
|
+
if (this.shadowRoot && this._createApp !== createVaporApp) {
|
|
3653
|
+
return true;
|
|
3654
|
+
} else {
|
|
3655
|
+
if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
|
|
3656
|
+
warn(
|
|
3657
|
+
`Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineVaporSSRCustomElement\`.`
|
|
3658
|
+
);
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
return false;
|
|
3662
|
+
}
|
|
3663
|
+
_mount(def) {
|
|
3664
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) && !def.name) {
|
|
3665
|
+
def.name = "VaporElement";
|
|
3666
|
+
}
|
|
3667
|
+
this._app = this._createApp(this._def);
|
|
3668
|
+
this._inheritParentContext();
|
|
3669
|
+
if (this._def.configureApp) {
|
|
3670
|
+
this._def.configureApp(this._app);
|
|
3671
|
+
}
|
|
3672
|
+
if (this.shadowRoot && this._createApp === createVaporSSRApp) {
|
|
3673
|
+
withHydration(this._root, this._createComponent.bind(this));
|
|
3674
|
+
} else {
|
|
3675
|
+
this._createComponent();
|
|
3676
|
+
}
|
|
3677
|
+
this._app.mount(this._root);
|
|
3678
|
+
if (!this.shadowRoot) {
|
|
3679
|
+
this._renderSlots();
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
_update() {
|
|
3683
|
+
if (!this._app) return;
|
|
3684
|
+
const renderEffects = this._instance.renderEffects;
|
|
3685
|
+
if (renderEffects) renderEffects.forEach((e) => e.run());
|
|
3686
|
+
}
|
|
3687
|
+
_unmount() {
|
|
3688
|
+
{
|
|
3689
|
+
this._app.unmount();
|
|
3690
|
+
}
|
|
3691
|
+
if (this._instance && this._instance.ce) {
|
|
3692
|
+
this._instance.ce = void 0;
|
|
3693
|
+
}
|
|
3694
|
+
this._app = this._instance = null;
|
|
3695
|
+
}
|
|
3696
|
+
/**
|
|
3697
|
+
* Only called when shadowRoot is false
|
|
3698
|
+
*/
|
|
3699
|
+
_updateSlotNodes(replacements) {
|
|
3700
|
+
this._updateFragmentNodes(
|
|
3701
|
+
this._instance.block,
|
|
3702
|
+
replacements
|
|
3703
|
+
);
|
|
3704
|
+
}
|
|
3705
|
+
/**
|
|
3706
|
+
* Replace slot nodes with their replace content
|
|
3707
|
+
* @internal
|
|
3708
|
+
*/
|
|
3709
|
+
_updateFragmentNodes(block, replacements) {
|
|
3710
|
+
if (Array.isArray(block)) {
|
|
3711
|
+
block.forEach((item) => this._updateFragmentNodes(item, replacements));
|
|
3712
|
+
return;
|
|
3713
|
+
}
|
|
3714
|
+
if (!isFragment(block)) return;
|
|
3715
|
+
const { nodes } = block;
|
|
3716
|
+
if (Array.isArray(nodes)) {
|
|
3717
|
+
const newNodes = [];
|
|
3718
|
+
for (const node of nodes) {
|
|
3719
|
+
if (node instanceof HTMLSlotElement) {
|
|
3720
|
+
newNodes.push(...replacements.get(node));
|
|
3721
|
+
} else {
|
|
3722
|
+
this._updateFragmentNodes(node, replacements);
|
|
3723
|
+
newNodes.push(node);
|
|
3724
|
+
}
|
|
3725
|
+
}
|
|
3726
|
+
block.nodes = newNodes;
|
|
3727
|
+
} else if (nodes instanceof HTMLSlotElement) {
|
|
3728
|
+
block.nodes = replacements.get(nodes);
|
|
3729
|
+
} else {
|
|
3730
|
+
this._updateFragmentNodes(nodes, replacements);
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
_createComponent() {
|
|
3734
|
+
this._def.ce = (instance) => {
|
|
3735
|
+
this._app._ceComponent = this._instance = instance;
|
|
3736
|
+
if (!this.shadowRoot) {
|
|
3737
|
+
this._instance.u = [this._renderSlots.bind(this)];
|
|
3738
|
+
}
|
|
3739
|
+
this._processInstance();
|
|
3740
|
+
};
|
|
3741
|
+
createComponent(
|
|
3742
|
+
this._def,
|
|
3743
|
+
this._props,
|
|
3744
|
+
void 0,
|
|
3745
|
+
void 0,
|
|
3746
|
+
void 0,
|
|
3747
|
+
this._app._context
|
|
3748
|
+
);
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3423
3752
|
let t;
|
|
3424
3753
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
3425
3754
|
// @__NO_SIDE_EFFECTS__
|
|
3426
|
-
function template(html, root) {
|
|
3755
|
+
function template(html, root, ns) {
|
|
3427
3756
|
let node;
|
|
3428
3757
|
return () => {
|
|
3429
3758
|
if (isHydrating) {
|
|
@@ -3431,59 +3760,228 @@ function template(html, root) {
|
|
|
3431
3760
|
if (root) adopted.$root = true;
|
|
3432
3761
|
return adopted;
|
|
3433
3762
|
}
|
|
3434
|
-
if (html[0] !== "<") {
|
|
3435
|
-
return createTextNode(html);
|
|
3763
|
+
if (html[0] !== "<") {
|
|
3764
|
+
return createTextNode(html);
|
|
3765
|
+
}
|
|
3766
|
+
if (!node) {
|
|
3767
|
+
t = t || document.createElement("template");
|
|
3768
|
+
if (ns) {
|
|
3769
|
+
const tag = ns === 1 ? "svg" : "math";
|
|
3770
|
+
t.innerHTML = `<${tag}>${html}</${tag}>`;
|
|
3771
|
+
node = _child(_child(t.content));
|
|
3772
|
+
} else {
|
|
3773
|
+
t.innerHTML = html;
|
|
3774
|
+
node = _child(t.content);
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
const ret = node.cloneNode(true);
|
|
3778
|
+
if (root) ret.$root = true;
|
|
3779
|
+
return ret;
|
|
3780
|
+
};
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
function createIf(condition, b1, b2, once) {
|
|
3784
|
+
const _insertionParent = insertionParent;
|
|
3785
|
+
const _insertionAnchor = insertionAnchor;
|
|
3786
|
+
const _isLastInsertion = isLastInsertion;
|
|
3787
|
+
if (!isHydrating) resetInsertionState();
|
|
3788
|
+
let frag;
|
|
3789
|
+
if (once) {
|
|
3790
|
+
frag = condition() ? b1() : b2 ? b2() : [];
|
|
3791
|
+
} else {
|
|
3792
|
+
frag = isHydrating || !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("if") : new DynamicFragment();
|
|
3793
|
+
renderEffect(() => frag.update(condition() ? b1 : b2));
|
|
3794
|
+
}
|
|
3795
|
+
if (!isHydrating) {
|
|
3796
|
+
if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
|
|
3797
|
+
} else {
|
|
3798
|
+
if (_isLastInsertion) {
|
|
3799
|
+
advanceHydrationNode(_insertionParent);
|
|
3800
|
+
}
|
|
3801
|
+
}
|
|
3802
|
+
return frag;
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3805
|
+
function createKeyedFragment(key, render) {
|
|
3806
|
+
const _insertionParent = insertionParent;
|
|
3807
|
+
const _insertionAnchor = insertionAnchor;
|
|
3808
|
+
const _isLastInsertion = isLastInsertion;
|
|
3809
|
+
if (!isHydrating) resetInsertionState();
|
|
3810
|
+
const frag = !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("keyed") : new DynamicFragment();
|
|
3811
|
+
renderEffect(() => {
|
|
3812
|
+
frag.update(render, key());
|
|
3813
|
+
});
|
|
3814
|
+
if (!isHydrating) {
|
|
3815
|
+
if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
|
|
3816
|
+
} else {
|
|
3817
|
+
if (_isLastInsertion) {
|
|
3818
|
+
advanceHydrationNode(_insertionParent);
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
return frag;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
3825
|
+
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
3826
|
+
const decorate = (t) => {
|
|
3827
|
+
delete t.props.mode;
|
|
3828
|
+
t.__vapor = true;
|
|
3829
|
+
return t;
|
|
3830
|
+
};
|
|
3831
|
+
const VaporTransitionGroup = decorate({
|
|
3832
|
+
name: "VaporTransitionGroup",
|
|
3833
|
+
props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
|
|
3834
|
+
tag: String,
|
|
3835
|
+
moveClass: String
|
|
3836
|
+
}),
|
|
3837
|
+
setup(props, { slots }) {
|
|
3838
|
+
const instance = currentInstance;
|
|
3839
|
+
const state = useTransitionState();
|
|
3840
|
+
const cssTransitionProps = resolveTransitionProps(props);
|
|
3841
|
+
let prevChildren;
|
|
3842
|
+
let children;
|
|
3843
|
+
const slottedBlock = slots.default && slots.default();
|
|
3844
|
+
onBeforeUpdate(() => {
|
|
3845
|
+
prevChildren = [];
|
|
3846
|
+
children = getTransitionBlocks(slottedBlock);
|
|
3847
|
+
if (children) {
|
|
3848
|
+
for (let i = 0; i < children.length; i++) {
|
|
3849
|
+
const child = children[i];
|
|
3850
|
+
if (isValidTransitionBlock(child)) {
|
|
3851
|
+
prevChildren.push(child);
|
|
3852
|
+
child.$transition.disabled = true;
|
|
3853
|
+
positionMap.set(
|
|
3854
|
+
child,
|
|
3855
|
+
getTransitionElement(child).getBoundingClientRect()
|
|
3856
|
+
);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
onUpdated(() => {
|
|
3862
|
+
if (!prevChildren.length) {
|
|
3863
|
+
return;
|
|
3864
|
+
}
|
|
3865
|
+
const moveClass = props.moveClass || `${props.name || "v"}-move`;
|
|
3866
|
+
const firstChild = getFirstConnectedChild(prevChildren);
|
|
3867
|
+
if (!firstChild || !hasCSSTransform(
|
|
3868
|
+
firstChild,
|
|
3869
|
+
firstChild.parentNode,
|
|
3870
|
+
moveClass
|
|
3871
|
+
)) {
|
|
3872
|
+
prevChildren = [];
|
|
3873
|
+
return;
|
|
3874
|
+
}
|
|
3875
|
+
prevChildren.forEach(callPendingCbs);
|
|
3876
|
+
prevChildren.forEach((child) => {
|
|
3877
|
+
child.$transition.disabled = false;
|
|
3878
|
+
recordPosition(child);
|
|
3879
|
+
});
|
|
3880
|
+
const movedChildren = prevChildren.filter(applyTranslation);
|
|
3881
|
+
forceReflow();
|
|
3882
|
+
movedChildren.forEach(
|
|
3883
|
+
(c) => handleMovedChildren(
|
|
3884
|
+
getTransitionElement(c),
|
|
3885
|
+
moveClass
|
|
3886
|
+
)
|
|
3887
|
+
);
|
|
3888
|
+
prevChildren = [];
|
|
3889
|
+
});
|
|
3890
|
+
setTransitionHooksOnFragment(slottedBlock, {
|
|
3891
|
+
props: cssTransitionProps,
|
|
3892
|
+
state,
|
|
3893
|
+
instance,
|
|
3894
|
+
group: true
|
|
3895
|
+
});
|
|
3896
|
+
children = getTransitionBlocks(slottedBlock);
|
|
3897
|
+
for (let i = 0; i < children.length; i++) {
|
|
3898
|
+
const child = children[i];
|
|
3899
|
+
if (isValidTransitionBlock(child)) {
|
|
3900
|
+
if (child.$key != null) {
|
|
3901
|
+
const hooks = resolveTransitionHooks(
|
|
3902
|
+
child,
|
|
3903
|
+
cssTransitionProps,
|
|
3904
|
+
state,
|
|
3905
|
+
instance
|
|
3906
|
+
);
|
|
3907
|
+
hooks.group = true;
|
|
3908
|
+
setTransitionHooks(child, hooks);
|
|
3909
|
+
} else if (!!(process.env.NODE_ENV !== "production") && child.$key == null) {
|
|
3910
|
+
warn(`<transition-group> children must be keyed`);
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
const tag = props.tag;
|
|
3915
|
+
if (tag) {
|
|
3916
|
+
const container = createElement(tag);
|
|
3917
|
+
insert(slottedBlock, container);
|
|
3918
|
+
if (instance.hasFallthrough) {
|
|
3919
|
+
container.$root = true;
|
|
3920
|
+
renderEffect(() => applyFallthroughProps(container, instance.attrs));
|
|
3921
|
+
}
|
|
3922
|
+
return container;
|
|
3923
|
+
} else {
|
|
3924
|
+
return slottedBlock;
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
});
|
|
3928
|
+
function getTransitionBlocks(block) {
|
|
3929
|
+
let children = [];
|
|
3930
|
+
if (block instanceof Node) {
|
|
3931
|
+
children.push(block);
|
|
3932
|
+
} else if (isVaporComponent(block)) {
|
|
3933
|
+
children.push(...getTransitionBlocks(block.block));
|
|
3934
|
+
} else if (isArray(block)) {
|
|
3935
|
+
for (let i = 0; i < block.length; i++) {
|
|
3936
|
+
const b = block[i];
|
|
3937
|
+
const blocks = getTransitionBlocks(b);
|
|
3938
|
+
if (isForBlock(b)) blocks.forEach((block2) => block2.$key = b.key);
|
|
3939
|
+
children.push(...blocks);
|
|
3436
3940
|
}
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3941
|
+
} else if (isFragment(block)) {
|
|
3942
|
+
if (block.insert) {
|
|
3943
|
+
children.push(block);
|
|
3944
|
+
} else {
|
|
3945
|
+
children.push(...getTransitionBlocks(block.nodes));
|
|
3441
3946
|
}
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
return ret;
|
|
3445
|
-
};
|
|
3947
|
+
}
|
|
3948
|
+
return children;
|
|
3446
3949
|
}
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3950
|
+
function isValidTransitionBlock(block) {
|
|
3951
|
+
return !!(block instanceof Element || isFragment(block) && block.insert);
|
|
3952
|
+
}
|
|
3953
|
+
function getTransitionElement(c) {
|
|
3954
|
+
return isFragment(c) ? c.nodes : c;
|
|
3955
|
+
}
|
|
3956
|
+
function recordPosition(c) {
|
|
3957
|
+
newPositionMap.set(c, getTransitionElement(c).getBoundingClientRect());
|
|
3958
|
+
}
|
|
3959
|
+
function applyTranslation(c) {
|
|
3960
|
+
if (baseApplyTranslation(
|
|
3961
|
+
positionMap.get(c),
|
|
3962
|
+
newPositionMap.get(c),
|
|
3963
|
+
getTransitionElement(c)
|
|
3964
|
+
)) {
|
|
3965
|
+
return c;
|
|
3459
3966
|
}
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3967
|
+
}
|
|
3968
|
+
function getFirstConnectedChild(children) {
|
|
3969
|
+
for (let i = 0; i < children.length; i++) {
|
|
3970
|
+
const child = children[i];
|
|
3971
|
+
const el = getTransitionElement(child);
|
|
3972
|
+
if (el.isConnected) return el;
|
|
3466
3973
|
}
|
|
3467
|
-
return frag;
|
|
3468
3974
|
}
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
});
|
|
3479
|
-
if (!isHydrating) {
|
|
3480
|
-
if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
|
|
3481
|
-
} else {
|
|
3482
|
-
if (_isLastInsertion) {
|
|
3483
|
-
advanceHydrationNode(_insertionParent);
|
|
3484
|
-
}
|
|
3975
|
+
function triggerTransitionGroupUpdate(transition) {
|
|
3976
|
+
const { instance } = transition;
|
|
3977
|
+
if (!instance.isUpdating) {
|
|
3978
|
+
instance.isUpdating = true;
|
|
3979
|
+
if (instance.bu) invokeArrayFns(instance.bu);
|
|
3980
|
+
queuePostFlushCb(() => {
|
|
3981
|
+
instance.isUpdating = false;
|
|
3982
|
+
if (instance.u) invokeArrayFns(instance.u);
|
|
3983
|
+
});
|
|
3485
3984
|
}
|
|
3486
|
-
return frag;
|
|
3487
3985
|
}
|
|
3488
3986
|
|
|
3489
3987
|
class ForBlock extends VaporFragment {
|
|
@@ -3528,6 +4026,10 @@ const createFor = (src, renderItem, getKey, flags = 0, setup) => {
|
|
|
3528
4026
|
const oldLength = oldBlocks.length;
|
|
3529
4027
|
newBlocks = new Array(newLength);
|
|
3530
4028
|
let isFallback = false;
|
|
4029
|
+
const transitionHooks = frag.$transition;
|
|
4030
|
+
if (transitionHooks && transitionHooks.group && isMounted) {
|
|
4031
|
+
triggerTransitionGroupUpdate(transitionHooks);
|
|
4032
|
+
}
|
|
3531
4033
|
const prevSub = setActiveSub();
|
|
3532
4034
|
if (!isMounted) {
|
|
3533
4035
|
isMounted = true;
|
|
@@ -3743,6 +4245,7 @@ const createFor = (src, renderItem, getKey, flags = 0, setup) => {
|
|
|
3743
4245
|
} else {
|
|
3744
4246
|
oldBlocks = [];
|
|
3745
4247
|
}
|
|
4248
|
+
if (isMounted && frag.updated) frag.updated.forEach((m) => m());
|
|
3746
4249
|
setActiveSub(prevSub);
|
|
3747
4250
|
};
|
|
3748
4251
|
const needKey = renderItem.length > 1;
|
|
@@ -4061,6 +4564,45 @@ const getRefValue = (el) => {
|
|
|
4061
4564
|
return el;
|
|
4062
4565
|
};
|
|
4063
4566
|
|
|
4567
|
+
function useVaporCssVars(getter) {
|
|
4568
|
+
const instance = currentInstance;
|
|
4569
|
+
baseUseCssVars(
|
|
4570
|
+
instance,
|
|
4571
|
+
() => resolveParentNode(instance.block),
|
|
4572
|
+
getter,
|
|
4573
|
+
(vars) => setVars(instance, vars)
|
|
4574
|
+
);
|
|
4575
|
+
}
|
|
4576
|
+
function resolveParentNode(block) {
|
|
4577
|
+
if (block instanceof Node) {
|
|
4578
|
+
return block.parentNode;
|
|
4579
|
+
} else if (isArray(block)) {
|
|
4580
|
+
return resolveParentNode(block[0]);
|
|
4581
|
+
} else if (isVaporComponent(block)) {
|
|
4582
|
+
return resolveParentNode(block.block);
|
|
4583
|
+
} else {
|
|
4584
|
+
return resolveParentNode(block.nodes);
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
function setVars(instance, vars) {
|
|
4588
|
+
if (instance.ce) {
|
|
4589
|
+
setVarsOnNode(instance.ce, vars);
|
|
4590
|
+
} else {
|
|
4591
|
+
setVarsOnBlock(instance.block, vars);
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
function setVarsOnBlock(block, vars) {
|
|
4595
|
+
if (block instanceof Node) {
|
|
4596
|
+
setVarsOnNode(block, vars);
|
|
4597
|
+
} else if (isArray(block)) {
|
|
4598
|
+
block.forEach((child) => setVarsOnBlock(child, vars));
|
|
4599
|
+
} else if (isVaporComponent(block)) {
|
|
4600
|
+
setVarsOnBlock(block.block, vars);
|
|
4601
|
+
} else {
|
|
4602
|
+
setVarsOnBlock(block.nodes, vars);
|
|
4603
|
+
}
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4064
4606
|
function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once) {
|
|
4065
4607
|
const _insertionParent = insertionParent;
|
|
4066
4608
|
const _insertionAnchor = insertionAnchor;
|
|
@@ -4118,7 +4660,7 @@ function applyVShow(target, source) {
|
|
|
4118
4660
|
}
|
|
4119
4661
|
function setDisplay(target, value) {
|
|
4120
4662
|
if (isVaporComponent(target)) {
|
|
4121
|
-
return setDisplay(target, value);
|
|
4663
|
+
return setDisplay(target.block, value);
|
|
4122
4664
|
}
|
|
4123
4665
|
if (isArray(target)) {
|
|
4124
4666
|
if (target.length === 0) return;
|
|
@@ -4246,153 +4788,4 @@ function withVaporDirectives(node, dirs) {
|
|
|
4246
4788
|
}
|
|
4247
4789
|
}
|
|
4248
4790
|
|
|
4249
|
-
|
|
4250
|
-
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
4251
|
-
const decorate = (t) => {
|
|
4252
|
-
delete t.props.mode;
|
|
4253
|
-
t.__vapor = true;
|
|
4254
|
-
return t;
|
|
4255
|
-
};
|
|
4256
|
-
const VaporTransitionGroup = decorate({
|
|
4257
|
-
name: "VaporTransitionGroup",
|
|
4258
|
-
props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
|
|
4259
|
-
tag: String,
|
|
4260
|
-
moveClass: String
|
|
4261
|
-
}),
|
|
4262
|
-
setup(props, { slots }) {
|
|
4263
|
-
const instance = currentInstance;
|
|
4264
|
-
const state = useTransitionState();
|
|
4265
|
-
const cssTransitionProps = resolveTransitionProps(props);
|
|
4266
|
-
let prevChildren;
|
|
4267
|
-
let children;
|
|
4268
|
-
const slottedBlock = slots.default && slots.default();
|
|
4269
|
-
onBeforeUpdate(() => {
|
|
4270
|
-
prevChildren = [];
|
|
4271
|
-
children = getTransitionBlocks(slottedBlock);
|
|
4272
|
-
if (children) {
|
|
4273
|
-
for (let i = 0; i < children.length; i++) {
|
|
4274
|
-
const child = children[i];
|
|
4275
|
-
if (isValidTransitionBlock(child)) {
|
|
4276
|
-
prevChildren.push(child);
|
|
4277
|
-
child.$transition.disabled = true;
|
|
4278
|
-
positionMap.set(
|
|
4279
|
-
child,
|
|
4280
|
-
getTransitionElement(child).getBoundingClientRect()
|
|
4281
|
-
);
|
|
4282
|
-
}
|
|
4283
|
-
}
|
|
4284
|
-
}
|
|
4285
|
-
});
|
|
4286
|
-
onUpdated(() => {
|
|
4287
|
-
if (!prevChildren.length) {
|
|
4288
|
-
return;
|
|
4289
|
-
}
|
|
4290
|
-
const moveClass = props.moveClass || `${props.name || "v"}-move`;
|
|
4291
|
-
const firstChild = getFirstConnectedChild(prevChildren);
|
|
4292
|
-
if (!firstChild || !hasCSSTransform(
|
|
4293
|
-
firstChild,
|
|
4294
|
-
firstChild.parentNode,
|
|
4295
|
-
moveClass
|
|
4296
|
-
)) {
|
|
4297
|
-
prevChildren = [];
|
|
4298
|
-
return;
|
|
4299
|
-
}
|
|
4300
|
-
prevChildren.forEach(callPendingCbs);
|
|
4301
|
-
prevChildren.forEach((child) => {
|
|
4302
|
-
child.$transition.disabled = false;
|
|
4303
|
-
recordPosition(child);
|
|
4304
|
-
});
|
|
4305
|
-
const movedChildren = prevChildren.filter(applyTranslation);
|
|
4306
|
-
forceReflow();
|
|
4307
|
-
movedChildren.forEach(
|
|
4308
|
-
(c) => handleMovedChildren(
|
|
4309
|
-
getTransitionElement(c),
|
|
4310
|
-
moveClass
|
|
4311
|
-
)
|
|
4312
|
-
);
|
|
4313
|
-
prevChildren = [];
|
|
4314
|
-
});
|
|
4315
|
-
setTransitionHooksOnFragment(slottedBlock, {
|
|
4316
|
-
props: cssTransitionProps,
|
|
4317
|
-
state,
|
|
4318
|
-
instance
|
|
4319
|
-
});
|
|
4320
|
-
children = getTransitionBlocks(slottedBlock);
|
|
4321
|
-
for (let i = 0; i < children.length; i++) {
|
|
4322
|
-
const child = children[i];
|
|
4323
|
-
if (isValidTransitionBlock(child)) {
|
|
4324
|
-
if (child.$key != null) {
|
|
4325
|
-
setTransitionHooks(
|
|
4326
|
-
child,
|
|
4327
|
-
resolveTransitionHooks(child, cssTransitionProps, state, instance)
|
|
4328
|
-
);
|
|
4329
|
-
} else if (!!(process.env.NODE_ENV !== "production") && child.$key == null) {
|
|
4330
|
-
warn(`<transition-group> children must be keyed`);
|
|
4331
|
-
}
|
|
4332
|
-
}
|
|
4333
|
-
}
|
|
4334
|
-
const tag = props.tag;
|
|
4335
|
-
if (tag) {
|
|
4336
|
-
const container = createElement(tag);
|
|
4337
|
-
insert(slottedBlock, container);
|
|
4338
|
-
if (instance.hasFallthrough) {
|
|
4339
|
-
container.$root = true;
|
|
4340
|
-
renderEffect(() => applyFallthroughProps(container, instance.attrs));
|
|
4341
|
-
}
|
|
4342
|
-
return container;
|
|
4343
|
-
} else {
|
|
4344
|
-
const frag = !!(process.env.NODE_ENV !== "production") ? new DynamicFragment("transition-group") : new DynamicFragment();
|
|
4345
|
-
renderEffect(() => frag.update(() => slottedBlock));
|
|
4346
|
-
return frag;
|
|
4347
|
-
}
|
|
4348
|
-
}
|
|
4349
|
-
});
|
|
4350
|
-
function getTransitionBlocks(block) {
|
|
4351
|
-
let children = [];
|
|
4352
|
-
if (block instanceof Node) {
|
|
4353
|
-
children.push(block);
|
|
4354
|
-
} else if (isVaporComponent(block)) {
|
|
4355
|
-
children.push(...getTransitionBlocks(block.block));
|
|
4356
|
-
} else if (isArray(block)) {
|
|
4357
|
-
for (let i = 0; i < block.length; i++) {
|
|
4358
|
-
const b = block[i];
|
|
4359
|
-
const blocks = getTransitionBlocks(b);
|
|
4360
|
-
if (isForBlock(b)) blocks.forEach((block2) => block2.$key = b.key);
|
|
4361
|
-
children.push(...blocks);
|
|
4362
|
-
}
|
|
4363
|
-
} else if (isFragment(block)) {
|
|
4364
|
-
if (block.insert) {
|
|
4365
|
-
children.push(block);
|
|
4366
|
-
} else {
|
|
4367
|
-
children.push(...getTransitionBlocks(block.nodes));
|
|
4368
|
-
}
|
|
4369
|
-
}
|
|
4370
|
-
return children;
|
|
4371
|
-
}
|
|
4372
|
-
function isValidTransitionBlock(block) {
|
|
4373
|
-
return !!(block instanceof Element || isFragment(block) && block.insert);
|
|
4374
|
-
}
|
|
4375
|
-
function getTransitionElement(c) {
|
|
4376
|
-
return isFragment(c) ? c.nodes : c;
|
|
4377
|
-
}
|
|
4378
|
-
function recordPosition(c) {
|
|
4379
|
-
newPositionMap.set(c, getTransitionElement(c).getBoundingClientRect());
|
|
4380
|
-
}
|
|
4381
|
-
function applyTranslation(c) {
|
|
4382
|
-
if (baseApplyTranslation(
|
|
4383
|
-
positionMap.get(c),
|
|
4384
|
-
newPositionMap.get(c),
|
|
4385
|
-
getTransitionElement(c)
|
|
4386
|
-
)) {
|
|
4387
|
-
return c;
|
|
4388
|
-
}
|
|
4389
|
-
}
|
|
4390
|
-
function getFirstConnectedChild(children) {
|
|
4391
|
-
for (let i = 0; i < children.length; i++) {
|
|
4392
|
-
const child = children[i];
|
|
4393
|
-
const el = getTransitionElement(child);
|
|
4394
|
-
if (el.isConnected) return el;
|
|
4395
|
-
}
|
|
4396
|
-
}
|
|
4397
|
-
|
|
4398
|
-
export { VaporFragment, VaporKeepAliveImpl as VaporKeepAlive, VaporTeleportImpl as VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createKeyedFragment, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockText, setClass, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStyle, setText, setValue, template, txt, vaporInteropPlugin, withVaporCtx, withVaporDirectives };
|
|
4791
|
+
export { VaporFragment, VaporKeepAliveImpl as VaporKeepAlive, VaporTeleportImpl as VaporTeleport, VaporTransition, VaporTransitionGroup, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, child, createComponent, createComponentWithFallback, createDynamicComponent, createFor, createForSlots, createIf, createInvoker, createKeyedFragment, createPlainElement, createSlot, createTemplateRefSetter, createTextNode, createVaporApp, createVaporSSRApp, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, getDefaultValue, getRestElement, insert, isFragment, isVaporComponent, next, nthChild, on, prepend, remove, renderEffect, setAttr, setBlockHtml, setBlockText, setClass, setDOMProp, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setProp, setStyle, setText, setValue, template, txt, useVaporCssVars, vaporInteropPlugin, withVaporCtx, withVaporDirectives };
|