vue 3.6.0-beta.13 → 3.6.0-beta.15
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/vue.cjs.js +2 -1
- package/dist/vue.cjs.prod.js +2 -1
- package/dist/vue.d.mts +3 -3
- package/dist/vue.d.ts +3 -3
- package/dist/vue.esm-browser.js +100 -46
- package/dist/vue.esm-browser.prod.js +5 -5
- package/dist/vue.esm-bundler.js +3 -3
- package/dist/vue.global.js +100 -45
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime-with-vapor.esm-browser.js +1130 -872
- package/dist/vue.runtime-with-vapor.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +95 -43
- package/dist/vue.runtime.esm-browser.prod.js +3 -3
- package/dist/vue.runtime.esm-bundler.js +3 -3
- package/dist/vue.runtime.global.js +95 -42
- package/dist/vue.runtime.global.prod.js +3 -3
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue v3.6.0-beta.
|
|
2
|
+
* vue v3.6.0-beta.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -2196,8 +2196,9 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2196
2196
|
if (once && cb) {
|
|
2197
2197
|
const _cb = cb;
|
|
2198
2198
|
cb = (...args) => {
|
|
2199
|
-
_cb(...args);
|
|
2199
|
+
const res = _cb(...args);
|
|
2200
2200
|
this.stop();
|
|
2201
|
+
return res;
|
|
2201
2202
|
};
|
|
2202
2203
|
}
|
|
2203
2204
|
this.cb = cb;
|
|
@@ -2211,7 +2212,7 @@ var WatcherEffect = class extends ReactiveEffect {
|
|
|
2211
2212
|
if (!this.cb) return;
|
|
2212
2213
|
const { immediate, deep, call } = this.options;
|
|
2213
2214
|
if (initialRun && !immediate) return;
|
|
2214
|
-
if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2215
|
+
if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
|
|
2215
2216
|
cleanup(this);
|
|
2216
2217
|
const currentWatcher = activeWatcher;
|
|
2217
2218
|
activeWatcher = this;
|
|
@@ -2645,6 +2646,7 @@ function flushJobs(seen) {
|
|
|
2645
2646
|
}
|
|
2646
2647
|
flushIndex = 0;
|
|
2647
2648
|
jobsLength = 0;
|
|
2649
|
+
jobs.length = 0;
|
|
2648
2650
|
flushPostFlushCbs(seen);
|
|
2649
2651
|
currentFlushPromise = null;
|
|
2650
2652
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
@@ -2702,6 +2704,14 @@ function createRecord(id, initialDef) {
|
|
|
2702
2704
|
function normalizeClassComponent(component) {
|
|
2703
2705
|
return isClassComponent(component) ? component.__vccOpts : component;
|
|
2704
2706
|
}
|
|
2707
|
+
function hasDirtyAncestor(instance, dirtyInstances) {
|
|
2708
|
+
let parent = instance.parent;
|
|
2709
|
+
while (parent) {
|
|
2710
|
+
if (dirtyInstances.has(parent)) return true;
|
|
2711
|
+
parent = parent.parent;
|
|
2712
|
+
}
|
|
2713
|
+
return false;
|
|
2714
|
+
}
|
|
2705
2715
|
function rerender(id, newRender) {
|
|
2706
2716
|
const record = map.get(id);
|
|
2707
2717
|
if (!record) return;
|
|
@@ -2733,42 +2743,69 @@ function reload(id, newComp) {
|
|
|
2733
2743
|
const isVapor = record.initialDef.__vapor;
|
|
2734
2744
|
updateComponentDef(record.initialDef, newComp);
|
|
2735
2745
|
const instances = [...record.instances];
|
|
2736
|
-
if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
|
|
2746
|
+
if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
|
|
2737
2747
|
for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
const
|
|
2741
|
-
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2742
|
-
if (!dirtyInstances) {
|
|
2743
|
-
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2744
|
-
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2745
|
-
}
|
|
2746
|
-
dirtyInstances.add(instance);
|
|
2747
|
-
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2748
|
-
instance.appContext.propsCache.delete(instance.type);
|
|
2749
|
-
instance.appContext.emitsCache.delete(instance.type);
|
|
2750
|
-
instance.appContext.optionsCache.delete(instance.type);
|
|
2751
|
-
if (instance.ceReload) {
|
|
2752
|
-
dirtyInstances.add(instance);
|
|
2753
|
-
instance.ceReload(newComp.styles);
|
|
2754
|
-
dirtyInstances.delete(instance);
|
|
2755
|
-
} else if (instance.parent) queueJob(() => {
|
|
2756
|
-
isHmrUpdating = true;
|
|
2748
|
+
const dirtyInstances = new Set(instances);
|
|
2749
|
+
const rerenderedParents = /* @__PURE__ */ new Set();
|
|
2750
|
+
for (const instance of instances) {
|
|
2757
2751
|
const parent = instance.parent;
|
|
2758
|
-
if (parent
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2752
|
+
if (parent) {
|
|
2753
|
+
if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
|
|
2754
|
+
rerenderedParents.add(parent);
|
|
2755
|
+
parent.hmrRerender();
|
|
2756
|
+
}
|
|
2757
|
+
} else instance.hmrReload(newComp);
|
|
2758
|
+
}
|
|
2759
|
+
} else {
|
|
2760
|
+
const parentUpdates = /* @__PURE__ */ new Map();
|
|
2761
|
+
const dirtyInstanceSet = new Set(instances);
|
|
2762
|
+
for (const instance of instances) {
|
|
2763
|
+
const oldComp = normalizeClassComponent(instance.type);
|
|
2764
|
+
let dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2765
|
+
if (!dirtyInstances) {
|
|
2766
|
+
if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
|
|
2767
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2762
2768
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2769
|
+
dirtyInstances.add(instance);
|
|
2770
|
+
hmrDirtyComponentsMode.set(oldComp, !!isVapor);
|
|
2771
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
2772
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
2773
|
+
instance.appContext.optionsCache.delete(instance.type);
|
|
2774
|
+
if (instance.ceReload) {
|
|
2775
|
+
dirtyInstances.add(instance);
|
|
2776
|
+
instance.ceReload(newComp.styles);
|
|
2777
|
+
dirtyInstances.delete(instance);
|
|
2778
|
+
} else if (instance.parent) {
|
|
2779
|
+
const parent = instance.parent;
|
|
2780
|
+
if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
|
|
2781
|
+
let updates = parentUpdates.get(parent);
|
|
2782
|
+
if (!updates) parentUpdates.set(parent, updates = []);
|
|
2783
|
+
updates.push([instance, dirtyInstances]);
|
|
2784
|
+
}
|
|
2785
|
+
} else if (instance.appContext.reload) instance.appContext.reload();
|
|
2786
|
+
else if (typeof window !== "undefined") window.location.reload();
|
|
2787
|
+
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2788
|
+
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2789
|
+
}
|
|
2790
|
+
parentUpdates.forEach((updates, parent) => {
|
|
2791
|
+
queueJob(() => {
|
|
2792
|
+
isHmrUpdating = true;
|
|
2793
|
+
if (parent.vapor) parent.hmrRerender();
|
|
2794
|
+
else {
|
|
2795
|
+
const i = parent;
|
|
2796
|
+
if (!(i.effect.flags & 1024)) {
|
|
2797
|
+
i.renderCache = [];
|
|
2798
|
+
i.effect.run();
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
nextTick(() => {
|
|
2802
|
+
isHmrUpdating = false;
|
|
2803
|
+
});
|
|
2804
|
+
updates.forEach(([instance, dirtyInstances]) => {
|
|
2805
|
+
dirtyInstances.delete(instance);
|
|
2806
|
+
});
|
|
2765
2807
|
});
|
|
2766
|
-
dirtyInstances.delete(instance);
|
|
2767
2808
|
});
|
|
2768
|
-
else if (instance.appContext.reload) instance.appContext.reload();
|
|
2769
|
-
else if (typeof window !== "undefined") window.location.reload();
|
|
2770
|
-
else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
|
|
2771
|
-
if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
|
|
2772
2809
|
}
|
|
2773
2810
|
queuePostFlushCb(() => {
|
|
2774
2811
|
hmrDirtyComponents.clear();
|
|
@@ -3148,7 +3185,7 @@ const TeleportImpl = {
|
|
|
3148
3185
|
if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
3149
3186
|
if (!disabled) {
|
|
3150
3187
|
mount(vnode, target, targetAnchor);
|
|
3151
|
-
updateCssVars
|
|
3188
|
+
updateCssVars(vnode, false);
|
|
3152
3189
|
}
|
|
3153
3190
|
} else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
3154
3191
|
};
|
|
@@ -3158,7 +3195,7 @@ const TeleportImpl = {
|
|
|
3158
3195
|
pendingMounts.delete(vnode);
|
|
3159
3196
|
if (isTeleportDisabled(vnode.props)) {
|
|
3160
3197
|
mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
|
|
3161
|
-
updateCssVars
|
|
3198
|
+
updateCssVars(vnode, true);
|
|
3162
3199
|
}
|
|
3163
3200
|
mountToTarget(vnode);
|
|
3164
3201
|
};
|
|
@@ -3176,7 +3213,7 @@ const TeleportImpl = {
|
|
|
3176
3213
|
}
|
|
3177
3214
|
if (disabled) {
|
|
3178
3215
|
mount(n2, container, mainAnchor);
|
|
3179
|
-
updateCssVars
|
|
3216
|
+
updateCssVars(n2, true);
|
|
3180
3217
|
}
|
|
3181
3218
|
mountToTarget();
|
|
3182
3219
|
} else {
|
|
@@ -3209,7 +3246,7 @@ const TeleportImpl = {
|
|
|
3209
3246
|
if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
|
|
3210
3247
|
else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
|
|
3211
3248
|
} else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
|
|
3212
|
-
updateCssVars
|
|
3249
|
+
updateCssVars(n2, disabled);
|
|
3213
3250
|
}
|
|
3214
3251
|
},
|
|
3215
3252
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -3273,7 +3310,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3273
3310
|
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3274
3311
|
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3275
3312
|
}
|
|
3276
|
-
updateCssVars
|
|
3313
|
+
updateCssVars(vnode, disabled);
|
|
3277
3314
|
} else if (disabled) {
|
|
3278
3315
|
if (vnode.shapeFlag & 16) {
|
|
3279
3316
|
hydrateDisabledTeleport(node, vnode);
|
|
@@ -3284,7 +3321,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3284
3321
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
3285
3322
|
}
|
|
3286
3323
|
const Teleport = TeleportImpl;
|
|
3287
|
-
function updateCssVars
|
|
3324
|
+
function updateCssVars(vnode, isDisabled) {
|
|
3288
3325
|
const ctx = vnode.ctx;
|
|
3289
3326
|
if (ctx && ctx.ut) {
|
|
3290
3327
|
let node, anchor;
|
|
@@ -4269,11 +4306,16 @@ function defineAsyncComponent(source) {
|
|
|
4269
4306
|
onError(err);
|
|
4270
4307
|
return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
|
|
4271
4308
|
});
|
|
4272
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
4309
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
4273
4310
|
load().then(() => {
|
|
4311
|
+
if (instance.isUnmounted) return;
|
|
4274
4312
|
loaded.value = true;
|
|
4275
4313
|
if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
|
|
4276
4314
|
}).catch((err) => {
|
|
4315
|
+
if (instance.isUnmounted) {
|
|
4316
|
+
setPendingRequest(null);
|
|
4317
|
+
return;
|
|
4318
|
+
}
|
|
4277
4319
|
onError(err);
|
|
4278
4320
|
error.value = err;
|
|
4279
4321
|
});
|
|
@@ -4331,14 +4373,22 @@ function createAsyncComponentContext(source) {
|
|
|
4331
4373
|
setPendingRequest: (request) => pendingRequest = request
|
|
4332
4374
|
};
|
|
4333
4375
|
}
|
|
4334
|
-
const useAsyncComponentState = (delay, timeout, onError) => {
|
|
4376
|
+
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
4335
4377
|
const loaded = /* @__PURE__ */ ref(false);
|
|
4336
4378
|
const error = /* @__PURE__ */ ref();
|
|
4337
4379
|
const delayed = /* @__PURE__ */ ref(!!delay);
|
|
4338
|
-
|
|
4380
|
+
let timeoutTimer;
|
|
4381
|
+
let delayTimer;
|
|
4382
|
+
if (instance) onUnmounted(() => {
|
|
4383
|
+
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
4384
|
+
if (delayTimer != null) clearTimeout(delayTimer);
|
|
4385
|
+
}, instance);
|
|
4386
|
+
if (delay) delayTimer = setTimeout(() => {
|
|
4387
|
+
if (instance && instance.isUnmounted) return;
|
|
4339
4388
|
delayed.value = false;
|
|
4340
4389
|
}, delay);
|
|
4341
|
-
if (timeout != null) setTimeout(() => {
|
|
4390
|
+
if (timeout != null) timeoutTimer = setTimeout(() => {
|
|
4391
|
+
if (instance && instance.isUnmounted) return;
|
|
4342
4392
|
if (!loaded.value && !error.value) {
|
|
4343
4393
|
const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
|
|
4344
4394
|
onError(err);
|
|
@@ -4741,6 +4791,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
4741
4791
|
slot: vaporSlot,
|
|
4742
4792
|
fallback
|
|
4743
4793
|
};
|
|
4794
|
+
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
4744
4795
|
return ret;
|
|
4745
4796
|
}
|
|
4746
4797
|
if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
|
|
@@ -5594,12 +5645,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
5594
5645
|
for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
|
|
5595
5646
|
else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
|
|
5596
5647
|
}
|
|
5597
|
-
|
|
5648
|
+
const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
|
|
5649
|
+
if (!hasVModel) {
|
|
5598
5650
|
localValue = value;
|
|
5599
5651
|
trigger();
|
|
5600
5652
|
}
|
|
5601
5653
|
i.emit(`update:${name}`, emittedValue);
|
|
5602
|
-
if (hasChanged(value,
|
|
5654
|
+
if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
|
|
5603
5655
|
prevSetValue = value;
|
|
5604
5656
|
prevEmittedValue = emittedValue;
|
|
5605
5657
|
}
|
|
@@ -8468,7 +8520,7 @@ function isMemoSame(cached, memo) {
|
|
|
8468
8520
|
}
|
|
8469
8521
|
//#endregion
|
|
8470
8522
|
//#region packages/runtime-core/src/index.ts
|
|
8471
|
-
const version = "3.6.0-beta.
|
|
8523
|
+
const version = "3.6.0-beta.15";
|
|
8472
8524
|
const warn = warn$1;
|
|
8473
8525
|
/**
|
|
8474
8526
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9619,7 +9671,7 @@ const TransitionGroup = /* @__PURE__ */ decorate$2({
|
|
|
9619
9671
|
prevChildren = [];
|
|
9620
9672
|
if (children) for (let i = 0; i < children.length; i++) {
|
|
9621
9673
|
const child = children[i];
|
|
9622
|
-
if (child.el && child.el instanceof Element) {
|
|
9674
|
+
if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
|
|
9623
9675
|
prevChildren.push(child);
|
|
9624
9676
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9625
9677
|
positionMap$1.set(child, getPosition(child.el));
|
|
@@ -10580,7 +10632,7 @@ var RenderEffect = class extends ReactiveEffect {
|
|
|
10580
10632
|
this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
|
|
10581
10633
|
this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
|
|
10582
10634
|
}
|
|
10583
|
-
|
|
10635
|
+
(instance.renderEffects || (instance.renderEffects = [])).push(this);
|
|
10584
10636
|
job.i = instance;
|
|
10585
10637
|
}
|
|
10586
10638
|
this.job = job;
|
|
@@ -10648,7 +10700,10 @@ function resolveFunctionSource(source) {
|
|
|
10648
10700
|
}
|
|
10649
10701
|
function snapshotRawProps(rawProps) {
|
|
10650
10702
|
const snapshot = Object.create(null);
|
|
10651
|
-
for (const key in rawProps) if (key !== "$")
|
|
10703
|
+
for (const key in rawProps) if (key !== "$") {
|
|
10704
|
+
const value = resolveSource(rawProps[key]);
|
|
10705
|
+
snapshot[key] = () => value;
|
|
10706
|
+
}
|
|
10652
10707
|
const dynamicSources = rawProps.$;
|
|
10653
10708
|
if (dynamicSources) {
|
|
10654
10709
|
const snapshotSources = [];
|
|
@@ -10660,7 +10715,10 @@ function snapshotRawProps(rawProps) {
|
|
|
10660
10715
|
for (const key in resolved) value[key] = resolved[key];
|
|
10661
10716
|
snapshotSources[i] = () => value;
|
|
10662
10717
|
} else {
|
|
10663
|
-
for (const key in source)
|
|
10718
|
+
for (const key in source) {
|
|
10719
|
+
const resolved = resolveSource(source[key]);
|
|
10720
|
+
value[key] = () => resolved;
|
|
10721
|
+
}
|
|
10664
10722
|
snapshotSources[i] = value;
|
|
10665
10723
|
}
|
|
10666
10724
|
}
|
|
@@ -10960,14 +11018,16 @@ const delegatedEventHandler = (e) => {
|
|
|
10960
11018
|
});
|
|
10961
11019
|
while (node !== null) {
|
|
10962
11020
|
const handlers = node[`$evt${e.type}`];
|
|
10963
|
-
if (handlers)
|
|
10964
|
-
|
|
10965
|
-
handler(
|
|
11021
|
+
if (handlers) {
|
|
11022
|
+
if (isArray(handlers)) {
|
|
11023
|
+
for (const handler of handlers) if (!node.disabled) {
|
|
11024
|
+
handler(e);
|
|
11025
|
+
if (e.cancelBubble) return;
|
|
11026
|
+
}
|
|
11027
|
+
} else if (!node.disabled) {
|
|
11028
|
+
handlers(e);
|
|
10966
11029
|
if (e.cancelBubble) return;
|
|
10967
11030
|
}
|
|
10968
|
-
} else {
|
|
10969
|
-
handlers(e);
|
|
10970
|
-
if (e.cancelBubble) return;
|
|
10971
11031
|
}
|
|
10972
11032
|
node = node.host && node.host !== node && node.host instanceof Node ? node.host : node.parentNode;
|
|
10973
11033
|
}
|
|
@@ -11334,22 +11394,77 @@ function setScopeId(block, scopeIds) {
|
|
|
11334
11394
|
if (block instanceof Element) for (const id of scopeIds) block.setAttribute(id, "");
|
|
11335
11395
|
else if (isVaporComponent(block)) setScopeId(block.block, scopeIds);
|
|
11336
11396
|
else if (isArray(block)) for (const b of block) setScopeId(b, scopeIds);
|
|
11337
|
-
else if (isFragment(block))
|
|
11397
|
+
else if (isFragment(block)) {
|
|
11398
|
+
trackScopeIdFragment(block, scopeIds, false);
|
|
11399
|
+
setScopeId(block.nodes, scopeIds);
|
|
11400
|
+
}
|
|
11401
|
+
}
|
|
11402
|
+
const trackedScopeIdFragments = /* @__PURE__ */ new WeakMap();
|
|
11403
|
+
function trackScopeIdFragment(frag, scopeIds, recursive = true) {
|
|
11404
|
+
if (isInteropEnabled && isInteropFragment(frag)) setInteropFragmentScopeIds(frag, scopeIds);
|
|
11405
|
+
else if (trackFragmentScopeIds(frag, scopeIds)) (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => setScopeId(nodes, scopeIds));
|
|
11406
|
+
if (recursive) trackScopeIdsInBlock(frag.nodes, scopeIds);
|
|
11407
|
+
}
|
|
11408
|
+
function trackFragmentScopeIds(frag, scopeIds) {
|
|
11409
|
+
const key = scopeIds.join(" ");
|
|
11410
|
+
let trackedScopeIds = trackedScopeIdFragments.get(frag);
|
|
11411
|
+
if (!trackedScopeIds) {
|
|
11412
|
+
trackedScopeIds = /* @__PURE__ */ new Set();
|
|
11413
|
+
trackedScopeIdFragments.set(frag, trackedScopeIds);
|
|
11414
|
+
} else if (trackedScopeIds.has(key)) return false;
|
|
11415
|
+
trackedScopeIds.add(key);
|
|
11416
|
+
return true;
|
|
11417
|
+
}
|
|
11418
|
+
function setInteropFragmentScopeIds(frag, scopeIds) {
|
|
11419
|
+
const vnode = frag.vnode;
|
|
11420
|
+
if (!vnode) return;
|
|
11421
|
+
const existing = vnode.slotScopeIds;
|
|
11422
|
+
if (!existing) {
|
|
11423
|
+
vnode.slotScopeIds = scopeIds;
|
|
11424
|
+
return;
|
|
11425
|
+
}
|
|
11426
|
+
for (let i = 0; i < scopeIds.length; i++) if (!existing.includes(scopeIds[i])) existing.push(scopeIds[i]);
|
|
11427
|
+
}
|
|
11428
|
+
function trackScopeIdsInBlock(block, scopeIds) {
|
|
11429
|
+
if (isVaporComponent(block)) trackScopeIdsInBlock(block.block, scopeIds);
|
|
11430
|
+
else if (isArray(block)) for (const b of block) trackScopeIdsInBlock(b, scopeIds);
|
|
11431
|
+
else if (isFragment(block)) trackScopeIdFragment(block, scopeIds);
|
|
11432
|
+
}
|
|
11433
|
+
const trackedInheritedScopeIdFragments = /* @__PURE__ */ new WeakMap();
|
|
11434
|
+
function trackInheritedScopeIdFragment(instance, frag) {
|
|
11435
|
+
let trackedInstances = trackedInheritedScopeIdFragments.get(frag);
|
|
11436
|
+
if (!trackedInstances) {
|
|
11437
|
+
trackedInstances = /* @__PURE__ */ new WeakSet();
|
|
11438
|
+
trackedInheritedScopeIdFragments.set(frag, trackedInstances);
|
|
11439
|
+
} else if (trackedInstances.has(instance)) return;
|
|
11440
|
+
trackedInstances.add(instance);
|
|
11441
|
+
(frag.onUpdated || (frag.onUpdated = [])).push(() => applyInheritedScopeIdToRoot(instance));
|
|
11442
|
+
}
|
|
11443
|
+
function applyInheritedScopeIdToRoot(instance) {
|
|
11444
|
+
const { scopeId } = instance;
|
|
11445
|
+
if (!scopeId) return;
|
|
11446
|
+
const root = getRootElement(instance, (frag) => trackInheritedScopeIdFragment(instance, frag));
|
|
11447
|
+
if (root) root.setAttribute(scopeId, "");
|
|
11448
|
+
return root;
|
|
11449
|
+
}
|
|
11450
|
+
function trackComponentScopeId(instance) {
|
|
11451
|
+
const { parent, scopeId } = instance;
|
|
11452
|
+
if (!parent || !scopeId) return;
|
|
11453
|
+
getRootElement(instance, (frag) => trackInheritedScopeIdFragment(instance, frag));
|
|
11338
11454
|
}
|
|
11339
11455
|
function setComponentScopeId(instance) {
|
|
11340
11456
|
const { parent, scopeId } = instance;
|
|
11341
11457
|
if (!parent || !scopeId) return;
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
if (parentScopeId !== scopeId) scopeIds.push(scopeId);
|
|
11346
|
-
else if (parentScopeId) scopeIds.push(parentScopeId);
|
|
11347
|
-
if (isInteropEnabled && parent.subTree && parent.subTree.component === instance && parent.vnode.scopeId) {
|
|
11348
|
-
scopeIds.push(parent.vnode.scopeId);
|
|
11458
|
+
const root = applyInheritedScopeIdToRoot(instance);
|
|
11459
|
+
if (isInteropEnabled && root && parent.subTree && parent.subTree.component === instance && parent.vnode.scopeId) {
|
|
11460
|
+
root.setAttribute(parent.vnode.scopeId, "");
|
|
11349
11461
|
const inheritedScopeIds = getInheritedScopeIds(parent.vnode, parent.parent);
|
|
11350
|
-
|
|
11462
|
+
for (let i = 0; i < inheritedScopeIds.length; i++) root.setAttribute(inheritedScopeIds[i], "");
|
|
11351
11463
|
}
|
|
11352
|
-
|
|
11464
|
+
}
|
|
11465
|
+
function getCurrentScopeId() {
|
|
11466
|
+
const scopeOwner = getScopeOwner();
|
|
11467
|
+
return scopeOwner ? scopeOwner.type.__scopeId : void 0;
|
|
11353
11468
|
}
|
|
11354
11469
|
//#endregion
|
|
11355
11470
|
//#region packages/runtime-vapor/src/componentSlots.ts
|
|
@@ -11378,6 +11493,36 @@ function setCurrentSlotScopeIds(scopeIds) {
|
|
|
11378
11493
|
currentSlotScopeIds = scopeIds;
|
|
11379
11494
|
}
|
|
11380
11495
|
}
|
|
11496
|
+
const rawSlotsOwnerMap = /* @__PURE__ */ new WeakMap();
|
|
11497
|
+
const rawSlotWrappersCache = /* @__PURE__ */ new WeakMap();
|
|
11498
|
+
function normalizeRawSlots(rawSlots) {
|
|
11499
|
+
if (!rawSlots) return rawSlots;
|
|
11500
|
+
const normalized = isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
|
|
11501
|
+
if (!rawSlotsOwnerMap.has(normalized)) rawSlotsOwnerMap.set(normalized, getScopeOwner());
|
|
11502
|
+
return normalized;
|
|
11503
|
+
}
|
|
11504
|
+
function withSlotOwner(slots, fn) {
|
|
11505
|
+
if (!rawSlotsOwnerMap.has(slots)) return fn();
|
|
11506
|
+
const prevOwner = setCurrentSlotOwner(rawSlotsOwnerMap.get(slots) || null);
|
|
11507
|
+
try {
|
|
11508
|
+
return fn();
|
|
11509
|
+
} finally {
|
|
11510
|
+
setCurrentSlotOwner(prevOwner);
|
|
11511
|
+
}
|
|
11512
|
+
}
|
|
11513
|
+
function getOwnedSlot(slots, key, slot) {
|
|
11514
|
+
if (!rawSlotsOwnerMap.has(slots)) return slot;
|
|
11515
|
+
let wrappers = rawSlotWrappersCache.get(slots);
|
|
11516
|
+
if (!wrappers) rawSlotWrappersCache.set(slots, wrappers = /* @__PURE__ */ new Map());
|
|
11517
|
+
const cached = wrappers.get(key);
|
|
11518
|
+
if (cached && cached.slot === slot) return cached.wrapped;
|
|
11519
|
+
const wrapped = ((...args) => withSlotOwner(slots, () => slot(...args)));
|
|
11520
|
+
wrappers.set(key, {
|
|
11521
|
+
slot,
|
|
11522
|
+
wrapped
|
|
11523
|
+
});
|
|
11524
|
+
return wrapped;
|
|
11525
|
+
}
|
|
11381
11526
|
const dynamicSlotsProxyHandlers = {
|
|
11382
11527
|
get: getSlot,
|
|
11383
11528
|
has: (target, key) => !!getSlot(target, key),
|
|
@@ -11390,17 +11535,14 @@ const dynamicSlotsProxyHandlers = {
|
|
|
11390
11535
|
};
|
|
11391
11536
|
},
|
|
11392
11537
|
ownKeys(target) {
|
|
11393
|
-
|
|
11538
|
+
const keys = new Set(Object.keys(target).filter((k) => k !== "$"));
|
|
11394
11539
|
const dynamicSources = target.$;
|
|
11395
|
-
if (dynamicSources) {
|
|
11396
|
-
|
|
11397
|
-
for (const
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
} else keys.push(...Object.keys(source));
|
|
11402
|
-
}
|
|
11403
|
-
return keys;
|
|
11540
|
+
if (dynamicSources) for (const source of dynamicSources) if (isFunction(source)) {
|
|
11541
|
+
const slot = withSlotOwner(target, () => resolveFunctionSource(source));
|
|
11542
|
+
if (slot) if (isArray(slot)) for (const s of slot) keys.add(String(s.name));
|
|
11543
|
+
else keys.add(String(slot.name));
|
|
11544
|
+
} else for (const key of Object.keys(source)) keys.add(key);
|
|
11545
|
+
return [...keys];
|
|
11404
11546
|
},
|
|
11405
11547
|
set: NO,
|
|
11406
11548
|
deleteProperty: NO
|
|
@@ -11414,16 +11556,16 @@ function getSlot(target, key) {
|
|
|
11414
11556
|
while (i--) {
|
|
11415
11557
|
source = dynamicSources[i];
|
|
11416
11558
|
if (isFunction(source)) {
|
|
11417
|
-
const slot = resolveFunctionSource(source);
|
|
11559
|
+
const slot = withSlotOwner(target, () => resolveFunctionSource(source));
|
|
11418
11560
|
if (slot) {
|
|
11419
11561
|
if (isArray(slot)) {
|
|
11420
|
-
for (let j = slot.length - 1; j >= 0; j--) if (String(slot[j].name) === key) return slot[j].fn;
|
|
11421
|
-
} else if (String(slot.name) === key) return slot.fn;
|
|
11562
|
+
for (let j = slot.length - 1; j >= 0; j--) if (String(slot[j].name) === key) return getOwnedSlot(target, key, slot[j].fn);
|
|
11563
|
+
} else if (String(slot.name) === key) return getOwnedSlot(target, key, slot.fn);
|
|
11422
11564
|
}
|
|
11423
|
-
} else if (hasOwn(source, key)) return source[key];
|
|
11565
|
+
} else if (hasOwn(source, key)) return getOwnedSlot(target, key, source[key]);
|
|
11424
11566
|
}
|
|
11425
11567
|
}
|
|
11426
|
-
if (hasOwn(target, key)) return target[key];
|
|
11568
|
+
if (hasOwn(target, key)) return getOwnedSlot(target, key, target[key]);
|
|
11427
11569
|
}
|
|
11428
11570
|
/**
|
|
11429
11571
|
* Tracks the slot owner (the component that defines the slot content).
|
|
@@ -11446,24 +11588,6 @@ function setCurrentSlotOwner(owner) {
|
|
|
11446
11588
|
function getScopeOwner() {
|
|
11447
11589
|
return currentSlotOwner || currentInstance;
|
|
11448
11590
|
}
|
|
11449
|
-
/**
|
|
11450
|
-
* Wrap a slot function to track the slot owner.
|
|
11451
|
-
*
|
|
11452
|
-
* This ensures:
|
|
11453
|
-
* 1. createSlot gets rawSlots from the correct instance (slot owner)
|
|
11454
|
-
* 2. elements inherit the slot owner's scopeId
|
|
11455
|
-
*/
|
|
11456
|
-
function withVaporCtx(fn) {
|
|
11457
|
-
const owner = getScopeOwner();
|
|
11458
|
-
return (...args) => {
|
|
11459
|
-
const prevOwner = setCurrentSlotOwner(owner);
|
|
11460
|
-
try {
|
|
11461
|
-
return fn(...args);
|
|
11462
|
-
} finally {
|
|
11463
|
-
setCurrentSlotOwner(prevOwner);
|
|
11464
|
-
}
|
|
11465
|
-
};
|
|
11466
|
-
}
|
|
11467
11591
|
function createSlot(name = "default", rawProps, fallback, flags = 0) {
|
|
11468
11592
|
if (isInteropEnabled && isCollectingVdomSlotVNodes) return;
|
|
11469
11593
|
const _insertionParent = insertionParent;
|
|
@@ -11475,6 +11599,7 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
|
|
|
11475
11599
|
const scopeId = !(flags & 1) && instance.type.__scopeId;
|
|
11476
11600
|
const slotScopeIds = scopeId ? [`${scopeId}-s`] : null;
|
|
11477
11601
|
const once = !!(flags & 2);
|
|
11602
|
+
const slotRoot = !!(flags & 4);
|
|
11478
11603
|
const slotProps = rawProps ? new Proxy(once ? snapshotRawProps(rawProps) : rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
|
|
11479
11604
|
if (once && fallback) {
|
|
11480
11605
|
const originalFallback = fallback;
|
|
@@ -11483,15 +11608,24 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
|
|
|
11483
11608
|
let fragment;
|
|
11484
11609
|
if (/* @__PURE__ */ isRef(rawSlots._) && isInteropEnabled) {
|
|
11485
11610
|
if (isHydrating$1) hydrationCursor = enterHydrationCursor();
|
|
11486
|
-
fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once);
|
|
11611
|
+
fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once, slotRoot);
|
|
11487
11612
|
} else {
|
|
11488
11613
|
if (isHydrating$1) hydrationCursor = captureHydrationCursor();
|
|
11489
|
-
const
|
|
11490
|
-
slotFragment
|
|
11614
|
+
const isCustomElementSlot = !!(instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce);
|
|
11615
|
+
const slotFragment = isHydrating$1 || !!fallback || !!getCurrentSlotBoundary() || isCustomElementSlot ? new SlotFragment(slotRoot) : void 0;
|
|
11616
|
+
let dynamicFragment;
|
|
11617
|
+
if (slotFragment) {
|
|
11618
|
+
fragment = slotFragment;
|
|
11619
|
+
if (isHydrating$1) slotFragment.forwarded = currentSlotOwner != null && currentSlotOwner !== currentInstance;
|
|
11620
|
+
} else {
|
|
11621
|
+
dynamicFragment = new DynamicFragment("slot", false, false);
|
|
11622
|
+
dynamicFragment.isSlot = true;
|
|
11623
|
+
fragment = dynamicFragment;
|
|
11624
|
+
}
|
|
11491
11625
|
const isDynamicName = isFunction(name);
|
|
11492
11626
|
const renderSlot = () => {
|
|
11493
11627
|
const slotName = isFunction(name) ? name() : name;
|
|
11494
|
-
if (
|
|
11628
|
+
if (isCustomElementSlot) {
|
|
11495
11629
|
const el = /* @__PURE__ */ createElement("slot");
|
|
11496
11630
|
const setSlotProps = () => {
|
|
11497
11631
|
setDynamicProps(el, [slotProps, slotName !== "default" ? { name: slotName } : {}]);
|
|
@@ -11507,8 +11641,10 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
|
|
|
11507
11641
|
return;
|
|
11508
11642
|
}
|
|
11509
11643
|
const slot = getSlot(rawSlots, slotName);
|
|
11510
|
-
if (slot) slotFragment.updateSlot(getBoundSlot(slot), fallback);
|
|
11511
|
-
else
|
|
11644
|
+
if (slot) if (slotFragment) slotFragment.updateSlot(getBoundSlot(slot), fallback);
|
|
11645
|
+
else dynamicFragment.update(getBoundSlot(slot));
|
|
11646
|
+
else if (slotFragment) slotFragment.updateSlot(void 0, fallback);
|
|
11647
|
+
else dynamicFragment.update();
|
|
11512
11648
|
};
|
|
11513
11649
|
let cachedSlot;
|
|
11514
11650
|
let cachedBoundSlot;
|
|
@@ -11533,7 +11669,8 @@ function createSlot(name = "default", rawProps, fallback, flags = 0) {
|
|
|
11533
11669
|
if (slotScopeIds) setScopeId(fragment, slotScopeIds);
|
|
11534
11670
|
if (_insertionParent) insert(fragment, _insertionParent, _insertionAnchor);
|
|
11535
11671
|
} else {
|
|
11536
|
-
if (fragment
|
|
11672
|
+
if (isInteropEnabled && isInteropFragment(fragment)) fragment.hydrate();
|
|
11673
|
+
if (slotScopeIds) trackScopeIdFragment(fragment, slotScopeIds);
|
|
11537
11674
|
exitHydrationCursor(hydrationCursor);
|
|
11538
11675
|
}
|
|
11539
11676
|
return fragment;
|
|
@@ -11578,7 +11715,7 @@ function setBlockKey(block, key) {
|
|
|
11578
11715
|
if (block.length === 1) setBlockKey(block[0], key);
|
|
11579
11716
|
} else {
|
|
11580
11717
|
block.$key = key;
|
|
11581
|
-
if (block.vnode) block.vnode.key = key;
|
|
11718
|
+
if (isInteropEnabled && block.vnode) block.vnode.key = key;
|
|
11582
11719
|
setBlockKey(block.nodes, key);
|
|
11583
11720
|
}
|
|
11584
11721
|
}
|
|
@@ -11598,9 +11735,10 @@ function isVaporTransition(component) {
|
|
|
11598
11735
|
}
|
|
11599
11736
|
//#endregion
|
|
11600
11737
|
//#region packages/runtime-vapor/src/fragment.ts
|
|
11601
|
-
const EMPTY_BLOCK = EMPTY_ARR;
|
|
11738
|
+
const EMPTY_BLOCK$1 = EMPTY_ARR;
|
|
11602
11739
|
var VaporFragment = class {
|
|
11603
11740
|
constructor(nodes) {
|
|
11741
|
+
this.__vf = true;
|
|
11604
11742
|
this.renderInstance = currentInstance;
|
|
11605
11743
|
this.slotOwner = currentSlotOwner;
|
|
11606
11744
|
this.inheritedSlotBoundary = currentSlotBoundary;
|
|
@@ -11609,30 +11747,32 @@ var VaporFragment = class {
|
|
|
11609
11747
|
}
|
|
11610
11748
|
runWithRenderCtx(fn, scope) {
|
|
11611
11749
|
const prevInstance = setCurrentInstance(this.renderInstance, scope);
|
|
11612
|
-
const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx || null : null;
|
|
11613
|
-
if (currentSlotOwner === this.slotOwner && currentSlotBoundary === this.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) try {
|
|
11614
|
-
return fn();
|
|
11615
|
-
} finally {
|
|
11616
|
-
setCurrentInstance(...prevInstance);
|
|
11617
|
-
}
|
|
11618
|
-
const prevSlotOwner = setCurrentSlotOwner(this.slotOwner);
|
|
11619
|
-
let prevKeepAliveCtx = null;
|
|
11620
|
-
if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
|
|
11621
|
-
const prevBoundary = setCurrentSlotBoundary(this.inheritedSlotBoundary);
|
|
11622
11750
|
try {
|
|
11623
|
-
return fn
|
|
11751
|
+
return runWithFragmentCtx(this, fn);
|
|
11624
11752
|
} finally {
|
|
11625
|
-
setCurrentSlotBoundary(prevBoundary);
|
|
11626
|
-
if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
|
|
11627
|
-
setCurrentSlotOwner(prevSlotOwner);
|
|
11628
11753
|
setCurrentInstance(...prevInstance);
|
|
11629
11754
|
}
|
|
11630
11755
|
}
|
|
11631
11756
|
};
|
|
11757
|
+
function runWithFragmentCtx(fragment, fn) {
|
|
11758
|
+
const keepAliveCtx = isKeepAliveEnabled ? fragment.keepAliveCtx || null : null;
|
|
11759
|
+
if (currentSlotOwner === fragment.slotOwner && currentSlotBoundary === fragment.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) return fn();
|
|
11760
|
+
const prevSlotOwner = setCurrentSlotOwner(fragment.slotOwner);
|
|
11761
|
+
let prevKeepAliveCtx = null;
|
|
11762
|
+
if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
|
|
11763
|
+
const prevBoundary = setCurrentSlotBoundary(fragment.inheritedSlotBoundary);
|
|
11764
|
+
try {
|
|
11765
|
+
return fn();
|
|
11766
|
+
} finally {
|
|
11767
|
+
setCurrentSlotBoundary(prevBoundary);
|
|
11768
|
+
if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
|
|
11769
|
+
setCurrentSlotOwner(prevSlotOwner);
|
|
11770
|
+
}
|
|
11771
|
+
}
|
|
11632
11772
|
var ForFragment = class extends VaporFragment {
|
|
11633
|
-
constructor(nodes) {
|
|
11773
|
+
constructor(nodes, trackSlotBoundary) {
|
|
11634
11774
|
super(nodes);
|
|
11635
|
-
trackSlotBoundaryDirtying(this);
|
|
11775
|
+
if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
|
|
11636
11776
|
}
|
|
11637
11777
|
onReset(fn) {
|
|
11638
11778
|
(this.resetListeners || (this.resetListeners = [])).push(fn);
|
|
@@ -11664,8 +11804,9 @@ function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
|
|
|
11664
11804
|
});
|
|
11665
11805
|
}
|
|
11666
11806
|
var DynamicFragment = class extends VaporFragment {
|
|
11667
|
-
constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary =
|
|
11668
|
-
super(EMPTY_BLOCK);
|
|
11807
|
+
constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary = false) {
|
|
11808
|
+
super(EMPTY_BLOCK$1);
|
|
11809
|
+
this.__df = true;
|
|
11669
11810
|
if (keyed) this.keyed = true;
|
|
11670
11811
|
if (isTransitionEnabled && currentInstance && isVaporTransition(currentInstance.type)) this.inTransition = true;
|
|
11671
11812
|
if (isHydrating$1) {
|
|
@@ -11677,12 +11818,17 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11677
11818
|
}
|
|
11678
11819
|
if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
|
|
11679
11820
|
}
|
|
11680
|
-
update(render, key = render, noScope = false) {
|
|
11821
|
+
update(render, key = render, noScope = false, shouldInsert = true) {
|
|
11681
11822
|
if (key === this.current) {
|
|
11682
|
-
if (isHydrating$1 && this.
|
|
11823
|
+
if (isHydrating$1 && !this.isSlot) this.hydrate(true);
|
|
11683
11824
|
return;
|
|
11684
11825
|
}
|
|
11685
11826
|
const transition = isTransitionEnabled ? this.$transition : void 0;
|
|
11827
|
+
const wasMounted = this.current !== void 0;
|
|
11828
|
+
if (wasMounted) {
|
|
11829
|
+
const onBeforeUpdate = this.onBeforeUpdate;
|
|
11830
|
+
if (onBeforeUpdate) for (let i = 0; i < onBeforeUpdate.length; i++) onBeforeUpdate[i]();
|
|
11831
|
+
}
|
|
11686
11832
|
if (transition && transition.state.isLeaving) {
|
|
11687
11833
|
this.current = key;
|
|
11688
11834
|
const pending = this.pending;
|
|
@@ -11699,8 +11845,8 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11699
11845
|
}
|
|
11700
11846
|
const instance = currentInstance;
|
|
11701
11847
|
const prevSub = setActiveSub();
|
|
11702
|
-
const parent = isHydrating$1
|
|
11703
|
-
if (
|
|
11848
|
+
const parent = !isHydrating$1 && shouldInsert ? this.anchor.parentNode : null;
|
|
11849
|
+
if (wasMounted) {
|
|
11704
11850
|
const scope = this.scope;
|
|
11705
11851
|
if (scope) {
|
|
11706
11852
|
let retainScope = false;
|
|
@@ -11716,8 +11862,8 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11716
11862
|
const pending = this.pending;
|
|
11717
11863
|
if (pending) {
|
|
11718
11864
|
this.pending = void 0;
|
|
11719
|
-
this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope);
|
|
11720
|
-
} else this.renderBranch(render, transition, parent, key, noScope);
|
|
11865
|
+
this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope, true);
|
|
11866
|
+
} else this.renderBranch(render, transition, parent, key, noScope, true);
|
|
11721
11867
|
} finally {
|
|
11722
11868
|
setCurrentInstance(...prevInstance);
|
|
11723
11869
|
}
|
|
@@ -11731,7 +11877,7 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11731
11877
|
}
|
|
11732
11878
|
let reusingDeferredAnchor = false;
|
|
11733
11879
|
if (isHydrating$1) {
|
|
11734
|
-
const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && this.
|
|
11880
|
+
const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && !this.isSlot && !isValidBlock(this.nodes);
|
|
11735
11881
|
reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
|
|
11736
11882
|
if (isRevivingDeferredBranch) {
|
|
11737
11883
|
let slotEndAnchor = null;
|
|
@@ -11739,11 +11885,11 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11739
11885
|
if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
|
|
11740
11886
|
}
|
|
11741
11887
|
}
|
|
11742
|
-
this.renderBranch(render, transition, parent, key, noScope);
|
|
11888
|
+
this.renderBranch(render, transition, parent, key, noScope, wasMounted || !!parent);
|
|
11743
11889
|
setActiveSub(prevSub);
|
|
11744
|
-
if (isHydrating$1 && this.
|
|
11890
|
+
if (isHydrating$1 && !this.isSlot && !reusingDeferredAnchor) this.hydrate(render == null);
|
|
11745
11891
|
}
|
|
11746
|
-
renderBranch(render, transition, parent, key, noScope = false) {
|
|
11892
|
+
renderBranch(render, transition, parent, key, noScope = false, notifyUpdated = !!parent) {
|
|
11747
11893
|
this.current = key;
|
|
11748
11894
|
if (render) {
|
|
11749
11895
|
const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx : null;
|
|
@@ -11755,7 +11901,7 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11755
11901
|
} else this.scope = void 0;
|
|
11756
11902
|
const renderBranch = () => {
|
|
11757
11903
|
try {
|
|
11758
|
-
this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK, this.scope);
|
|
11904
|
+
this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK$1, this.scope);
|
|
11759
11905
|
} finally {
|
|
11760
11906
|
const key = this.keyed ? this.current : this.$key;
|
|
11761
11907
|
if (key !== void 0 && (transition || this.inTransition || keepAliveCtx)) setBlockKey(this.nodes, key);
|
|
@@ -11772,14 +11918,12 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11772
11918
|
}
|
|
11773
11919
|
} else {
|
|
11774
11920
|
this.scope = void 0;
|
|
11775
|
-
this.nodes = EMPTY_BLOCK;
|
|
11776
|
-
}
|
|
11777
|
-
if (parent) {
|
|
11778
|
-
const onUpdated = this.onUpdated;
|
|
11779
|
-
if (onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
|
|
11921
|
+
this.nodes = EMPTY_BLOCK$1;
|
|
11780
11922
|
}
|
|
11923
|
+
const onUpdated = this.onUpdated;
|
|
11924
|
+
if (notifyUpdated && onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
|
|
11781
11925
|
}
|
|
11782
|
-
hydrate(isEmpty = false
|
|
11926
|
+
hydrate(isEmpty = false) {
|
|
11783
11927
|
if (!isHydrating$1) return;
|
|
11784
11928
|
let advanceAfterRestore = null;
|
|
11785
11929
|
let exitHydrationBoundary;
|
|
@@ -11814,12 +11958,12 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11814
11958
|
return;
|
|
11815
11959
|
}
|
|
11816
11960
|
}
|
|
11817
|
-
if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
|
|
11961
|
+
if (!this.isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
|
|
11818
11962
|
const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
|
|
11819
11963
|
const anchor = nextLogicalSibling(currentHydrationNode);
|
|
11820
11964
|
const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
|
|
11821
11965
|
if (parentNode$4) {
|
|
11822
|
-
this.nodes = EMPTY_BLOCK;
|
|
11966
|
+
this.nodes = EMPTY_BLOCK$1;
|
|
11823
11967
|
if (reusableAnchor) reuseAnchor(reusableAnchor);
|
|
11824
11968
|
else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
|
|
11825
11969
|
return;
|
|
@@ -11828,7 +11972,7 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11828
11972
|
}
|
|
11829
11973
|
if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
|
|
11830
11974
|
const anchor = this.nodes;
|
|
11831
|
-
this.nodes = EMPTY_BLOCK;
|
|
11975
|
+
this.nodes = EMPTY_BLOCK$1;
|
|
11832
11976
|
reuseAnchor(anchor);
|
|
11833
11977
|
return;
|
|
11834
11978
|
}
|
|
@@ -11836,15 +11980,15 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11836
11980
|
const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
|
|
11837
11981
|
const nextNode = nextLogicalSibling(currentHydrationNode);
|
|
11838
11982
|
if (parentNode$5) {
|
|
11839
|
-
this.nodes = EMPTY_BLOCK;
|
|
11983
|
+
this.nodes = EMPTY_BLOCK$1;
|
|
11840
11984
|
cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
|
|
11841
11985
|
return;
|
|
11842
11986
|
}
|
|
11843
11987
|
}
|
|
11844
11988
|
const currentSlotEndAnchor = getCurrentSlotEndAnchor();
|
|
11845
|
-
const forwardedSlot = isSlot ? this.forwarded : false;
|
|
11846
|
-
const slotAnchor = isSlot ? currentSlotEndAnchor : null;
|
|
11847
|
-
const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
|
|
11989
|
+
const forwardedSlot = this.isSlot ? this.forwarded : false;
|
|
11990
|
+
const slotAnchor = this.isSlot ? currentSlotEndAnchor : null;
|
|
11991
|
+
const closeOwner = getDynamicCloseOwner(!!this.isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
|
|
11848
11992
|
if (closeOwner === 1) {
|
|
11849
11993
|
const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
|
|
11850
11994
|
if (isComment(anchor, "]")) {
|
|
@@ -11870,7 +12014,7 @@ var DynamicFragment = class extends VaporFragment {
|
|
|
11870
12014
|
parentNode$3 = currentSlotEndAnchor.parentNode;
|
|
11871
12015
|
nextNode = currentSlotEndAnchor;
|
|
11872
12016
|
} else {
|
|
11873
|
-
const node =
|
|
12017
|
+
const node = findBlockBoundary(this.nodes);
|
|
11874
12018
|
parentNode$3 = node.parentNode;
|
|
11875
12019
|
nextNode = node.nextNode;
|
|
11876
12020
|
}
|
|
@@ -11914,58 +12058,14 @@ function getRedirectedBoundary(boundary) {
|
|
|
11914
12058
|
function trackSlotBoundaryDirtying(fragment) {
|
|
11915
12059
|
const boundary = currentSlotBoundary;
|
|
11916
12060
|
if (!boundary) return;
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
if (block instanceof Node) return node(block);
|
|
11921
|
-
if (isVaporComponent(block)) return walkSlotFallbackBlock(block.block, node, fragment);
|
|
11922
|
-
if (isArray(block)) {
|
|
11923
|
-
for (const child of block) if (walkSlotFallbackBlock(child, node, fragment)) return true;
|
|
11924
|
-
return false;
|
|
11925
|
-
}
|
|
11926
|
-
return fragment(block, (block) => walkSlotFallbackBlock(block, node, fragment));
|
|
11927
|
-
}
|
|
11928
|
-
function resolveSlotFallbackCarrierOwner(block) {
|
|
11929
|
-
let owner = null;
|
|
11930
|
-
walkSlotFallbackBlock(block, () => false, (block) => {
|
|
11931
|
-
owner = block;
|
|
11932
|
-
return true;
|
|
12061
|
+
let prevValid = isValidBlock(fragment);
|
|
12062
|
+
(fragment.onBeforeUpdate || (fragment.onBeforeUpdate = [])).push(() => {
|
|
12063
|
+
prevValid = isValidBlock(fragment);
|
|
11933
12064
|
});
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
walkSlotFallbackBlock(block, (value) => {
|
|
11939
|
-
node = value;
|
|
11940
|
-
return true;
|
|
11941
|
-
}, (block, walk) => {
|
|
11942
|
-
if (walk(block.nodes)) return true;
|
|
11943
|
-
if (block.anchor) {
|
|
11944
|
-
node = block.anchor;
|
|
11945
|
-
return true;
|
|
11946
|
-
}
|
|
11947
|
-
return false;
|
|
11948
|
-
});
|
|
11949
|
-
return node;
|
|
11950
|
-
}
|
|
11951
|
-
function collectBlockNodes(block, nodes = [], includeComments = false) {
|
|
11952
|
-
walkSlotFallbackBlock(block, (block) => {
|
|
11953
|
-
if (includeComments || !(block instanceof Comment)) nodes.push(block);
|
|
11954
|
-
return false;
|
|
11955
|
-
}, (block) => {
|
|
11956
|
-
collectBlockNodes(block.nodes, nodes, true);
|
|
11957
|
-
if (block.anchor) nodes.push(block.anchor);
|
|
11958
|
-
return false;
|
|
11959
|
-
});
|
|
11960
|
-
return nodes;
|
|
11961
|
-
}
|
|
11962
|
-
function mutateSlotFallbackCarrier(block, apply) {
|
|
11963
|
-
walkSlotFallbackBlock(block, (block) => {
|
|
11964
|
-
if (!(block instanceof Comment)) apply(block);
|
|
11965
|
-
return false;
|
|
11966
|
-
}, (block) => {
|
|
11967
|
-
apply(block);
|
|
11968
|
-
return false;
|
|
12065
|
+
(fragment.onUpdated || (fragment.onUpdated = [])).push(() => {
|
|
12066
|
+
const valid = isValidBlock(fragment);
|
|
12067
|
+
if (valid !== prevValid) boundary.markDirty();
|
|
12068
|
+
prevValid = valid;
|
|
11969
12069
|
});
|
|
11970
12070
|
}
|
|
11971
12071
|
function hasSlotFallback(boundary) {
|
|
@@ -11975,161 +12075,145 @@ function hasSlotFallback(boundary) {
|
|
|
11975
12075
|
}
|
|
11976
12076
|
return false;
|
|
11977
12077
|
}
|
|
11978
|
-
function renderSlotFallback(boundary, scope
|
|
11979
|
-
|
|
11980
|
-
return hasFallback ? block : void 0;
|
|
11981
|
-
}
|
|
11982
|
-
function renderSlotFallbackBlock(boundary, scope, args) {
|
|
11983
|
-
if (!boundary) return [[], false];
|
|
12078
|
+
function renderSlotFallback(boundary, scope) {
|
|
12079
|
+
if (!boundary) return;
|
|
11984
12080
|
const localFallback = boundary.getFallback();
|
|
11985
|
-
if (!localFallback) return
|
|
11986
|
-
const renderFallback = () => withOwnedSlotBoundary(getRedirectedBoundary(boundary), () => localFallback(
|
|
11987
|
-
const local = boundary.run(() =>
|
|
11988
|
-
if (isValidBlock(local)) return
|
|
11989
|
-
const
|
|
11990
|
-
return
|
|
11991
|
-
}
|
|
11992
|
-
function
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
}
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12081
|
+
if (!localFallback) return renderSlotFallback(boundary.parent, scope);
|
|
12082
|
+
const renderFallback = () => withOwnedSlotBoundary(getRedirectedBoundary(boundary), () => localFallback());
|
|
12083
|
+
const local = boundary.run(() => scope.run(renderFallback) || [], scope);
|
|
12084
|
+
if (isValidBlock(local)) return local;
|
|
12085
|
+
const inherited = renderSlotFallback(boundary.parent, scope);
|
|
12086
|
+
return inherited === void 0 ? local : inherited;
|
|
12087
|
+
}
|
|
12088
|
+
function detachBlock(block, parent) {
|
|
12089
|
+
if (block instanceof Node) {
|
|
12090
|
+
if (block.parentNode === parent) removeNode(block, parent);
|
|
12091
|
+
} else if (isVaporComponent(block)) {
|
|
12092
|
+
if (block.block) detachBlock(block.block, parent);
|
|
12093
|
+
} else if (isArray(block)) for (let i = 0; i < block.length; i++) detachBlock(block[i], parent);
|
|
12094
|
+
else {
|
|
12095
|
+
detachBlock(block.nodes, parent);
|
|
12096
|
+
if (!(block instanceof SlotFragment) && block.anchor && block.anchor.parentNode === parent) removeNode(block.anchor, parent);
|
|
12097
|
+
}
|
|
12098
|
+
}
|
|
12099
|
+
function markSlotFallbackDirty(state) {
|
|
12100
|
+
if (state.isDisposed()) return;
|
|
12101
|
+
if (state.isRenderingFallback) {
|
|
12102
|
+
state.pendingRecheck = true;
|
|
12002
12103
|
return;
|
|
12003
12104
|
}
|
|
12004
|
-
if (
|
|
12005
|
-
|
|
12105
|
+
if (state.isBusy()) {
|
|
12106
|
+
state.pendingRecheck = true;
|
|
12006
12107
|
return;
|
|
12007
12108
|
}
|
|
12008
|
-
recheckSlotFallback(
|
|
12109
|
+
recheckSlotFallback(state, true);
|
|
12009
12110
|
}
|
|
12010
|
-
function clearSlotFallback(
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12111
|
+
function clearSlotFallback(state) {
|
|
12112
|
+
const fallback = state.activeFallback;
|
|
12113
|
+
if (fallback) {
|
|
12114
|
+
const parentNode = state.getParentNode();
|
|
12115
|
+
if (parentNode) remove(fallback, parentNode);
|
|
12116
|
+
state.activeFallback = null;
|
|
12015
12117
|
}
|
|
12016
|
-
if (
|
|
12017
|
-
|
|
12018
|
-
|
|
12118
|
+
if (state.fallbackScope) {
|
|
12119
|
+
state.fallbackScope.stop();
|
|
12120
|
+
state.fallbackScope = void 0;
|
|
12019
12121
|
}
|
|
12020
12122
|
}
|
|
12021
|
-
function
|
|
12022
|
-
const scope = new EffectScope();
|
|
12123
|
+
function renderSlotFallbackState(state) {
|
|
12124
|
+
const scope = new EffectScope(true);
|
|
12023
12125
|
let renderedFallback;
|
|
12024
|
-
|
|
12126
|
+
state.isRenderingFallback = true;
|
|
12025
12127
|
try {
|
|
12026
|
-
renderedFallback = renderSlotFallback(
|
|
12128
|
+
renderedFallback = renderSlotFallback(state.boundary, scope);
|
|
12027
12129
|
} catch (err) {
|
|
12028
12130
|
scope.stop();
|
|
12029
12131
|
throw err;
|
|
12030
12132
|
} finally {
|
|
12031
|
-
|
|
12133
|
+
state.isRenderingFallback = false;
|
|
12032
12134
|
}
|
|
12033
12135
|
if (!renderedFallback) {
|
|
12034
12136
|
scope.stop();
|
|
12035
|
-
return
|
|
12137
|
+
return;
|
|
12036
12138
|
}
|
|
12037
12139
|
return {
|
|
12038
|
-
found: true,
|
|
12039
12140
|
block: renderedFallback,
|
|
12040
12141
|
scope
|
|
12041
12142
|
};
|
|
12042
12143
|
}
|
|
12043
|
-
function
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
const
|
|
12047
|
-
const lastNode = fallbackNodes[fallbackNodes.length - 1];
|
|
12048
|
-
if (!carrierNodes.length || !lastNode) return;
|
|
12049
|
-
const parentNode = carrierNodes[0].parentNode;
|
|
12050
|
-
if (!parentNode || lastNode.parentNode !== parentNode) return;
|
|
12051
|
-
let inOrder = true;
|
|
12052
|
-
let nextNode = lastNode.nextSibling;
|
|
12053
|
-
for (const carrierNode of carrierNodes) {
|
|
12054
|
-
if (carrierNode.parentNode !== parentNode) return;
|
|
12055
|
-
if (carrierNode !== nextNode) {
|
|
12056
|
-
inOrder = false;
|
|
12057
|
-
break;
|
|
12058
|
-
}
|
|
12059
|
-
nextNode = carrierNode.nextSibling;
|
|
12060
|
-
}
|
|
12061
|
-
if (inOrder) return;
|
|
12062
|
-
let anchor = lastNode.nextSibling;
|
|
12063
|
-
for (let i = carrierNodes.length - 1; i >= 0; i--) {
|
|
12064
|
-
const carrierNode = carrierNodes[i];
|
|
12065
|
-
parentNode.insertBefore(carrierNode, anchor);
|
|
12066
|
-
anchor = carrierNode;
|
|
12067
|
-
}
|
|
12068
|
-
}
|
|
12069
|
-
function ensureSlotFallbackOrderHook(outlet, block) {
|
|
12070
|
-
if (!isFragment(block)) return;
|
|
12071
|
-
const fragment = block;
|
|
12072
|
-
if (fragment.hasSlotFallbackOrderHook) return;
|
|
12073
|
-
(fragment.onUpdated || (fragment.onUpdated = [])).push(() => syncSlotFallbackOrder(outlet, fragment));
|
|
12074
|
-
fragment.hasSlotFallbackOrderHook = true;
|
|
12075
|
-
}
|
|
12076
|
-
function insertActiveSlotFallback(outlet) {
|
|
12077
|
-
if (isHydrating$1 || !outlet.activeFallback) return;
|
|
12078
|
-
const parentNode = outlet.getParentNode();
|
|
12144
|
+
function insertActiveSlotFallback(state) {
|
|
12145
|
+
const fallback = state.activeFallback;
|
|
12146
|
+
if (isHydrating$1 || !fallback || !isValidBlock(fallback)) return;
|
|
12147
|
+
const parentNode = state.getParentNode();
|
|
12079
12148
|
if (!parentNode) return;
|
|
12080
|
-
|
|
12081
|
-
insert(outlet.activeFallback, parentNode, carrierAnchor && carrierAnchor.parentNode === parentNode ? carrierAnchor : outlet.getAnchor());
|
|
12149
|
+
insert(fallback, parentNode, state.getAnchor());
|
|
12082
12150
|
}
|
|
12083
|
-
function commitSlotFallback(
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12151
|
+
function commitSlotFallback(state, block, scope, detachContent) {
|
|
12152
|
+
const parentNode = state.getParentNode();
|
|
12153
|
+
if (detachContent && !isHydrating$1 && parentNode) detachBlock(state.getContent(), parentNode);
|
|
12154
|
+
state.activeFallback = block;
|
|
12155
|
+
state.fallbackScope = scope;
|
|
12087
12156
|
if (isTransitionEnabled) {
|
|
12088
|
-
const
|
|
12089
|
-
if (
|
|
12157
|
+
const transitionState = state;
|
|
12158
|
+
if (transitionState.$transition) {
|
|
12090
12159
|
setBlockKey(block, "_fb");
|
|
12091
|
-
|
|
12160
|
+
transitionState.$transition = applyTransitionHooks(block, transitionState.$transition);
|
|
12092
12161
|
}
|
|
12093
12162
|
}
|
|
12094
|
-
insertActiveSlotFallback(
|
|
12163
|
+
insertActiveSlotFallback(state);
|
|
12095
12164
|
}
|
|
12096
|
-
function
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12165
|
+
function renderAndCommitSlotFallback(state, hadFallback) {
|
|
12166
|
+
const result = renderSlotFallbackState(state);
|
|
12167
|
+
clearSlotFallback(state);
|
|
12168
|
+
if (result) {
|
|
12169
|
+
commitSlotFallback(state, result.block, result.scope, !hadFallback);
|
|
12170
|
+
if (state.pendingRecheck) {
|
|
12171
|
+
state.pendingRecheck = false;
|
|
12172
|
+
recheckSlotFallback(state, true);
|
|
12173
|
+
}
|
|
12174
|
+
}
|
|
12102
12175
|
}
|
|
12103
|
-
function disposeSlotFallback(
|
|
12104
|
-
clearSlotFallback(
|
|
12105
|
-
|
|
12106
|
-
|
|
12176
|
+
function disposeSlotFallback(state) {
|
|
12177
|
+
clearSlotFallback(state);
|
|
12178
|
+
state.pendingRecheck = false;
|
|
12179
|
+
state.lastNodesValid = void 0;
|
|
12107
12180
|
}
|
|
12108
|
-
function recheckSlotFallback(
|
|
12109
|
-
if (
|
|
12110
|
-
|
|
12181
|
+
function recheckSlotFallback(state, force = false) {
|
|
12182
|
+
if (state.isRenderingFallback) {
|
|
12183
|
+
state.pendingRecheck = true;
|
|
12111
12184
|
return;
|
|
12112
12185
|
}
|
|
12113
|
-
const
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
commitSlotFallback(outlet, result.block, result.scope);
|
|
12122
|
-
if (outlet.pendingRecheck && outlet.rerunRecheckAfterFallbackRender !== false) {
|
|
12123
|
-
outlet.pendingRecheck = false;
|
|
12124
|
-
recheckSlotFallback(outlet, true);
|
|
12125
|
-
}
|
|
12126
|
-
} else clearSlotFallback(outlet);
|
|
12127
|
-
}
|
|
12186
|
+
const fallback = state.activeFallback;
|
|
12187
|
+
const fallbackValid = fallback ? isValidBlock(fallback) : false;
|
|
12188
|
+
const contentValid = state.isContentValid();
|
|
12189
|
+
const prevNodesValid = state.lastNodesValid === void 0 ? fallback ? fallbackValid : contentValid : state.lastNodesValid;
|
|
12190
|
+
if (!force && contentValid && !fallback && prevNodesValid) {
|
|
12191
|
+
state.syncNodes();
|
|
12192
|
+
state.lastNodesValid = true;
|
|
12193
|
+
return;
|
|
12128
12194
|
}
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
|
|
12195
|
+
if (contentValid) {
|
|
12196
|
+
const content = state.getContent();
|
|
12197
|
+
const hadFallback = !!fallback;
|
|
12198
|
+
clearSlotFallback(state);
|
|
12199
|
+
if (!isHydrating$1 && hadFallback) {
|
|
12200
|
+
const parentNode = state.getParentNode();
|
|
12201
|
+
if (parentNode) insert(content, parentNode, state.getAnchor());
|
|
12202
|
+
}
|
|
12203
|
+
} else if (fallback) {
|
|
12204
|
+
if (prevNodesValid) {
|
|
12205
|
+
if (!fallbackValid && !hasSlotFallback(state.boundary.parent)) {
|
|
12206
|
+
const parentNode = state.getParentNode();
|
|
12207
|
+
if (parentNode) detachBlock(fallback, parentNode);
|
|
12208
|
+
} else if (force) renderAndCommitSlotFallback(state, true);
|
|
12209
|
+
} else if (fallbackValid) insertActiveSlotFallback(state);
|
|
12210
|
+
else if (force) renderAndCommitSlotFallback(state, true);
|
|
12211
|
+
} else renderAndCommitSlotFallback(state, false);
|
|
12212
|
+
const nextFallback = state.activeFallback;
|
|
12213
|
+
const nextNodesValid = nextFallback ? isValidBlock(nextFallback) : state.isContentValid();
|
|
12214
|
+
state.syncNodes();
|
|
12215
|
+
state.lastNodesValid = nextNodesValid;
|
|
12216
|
+
if (prevNodesValid !== nextNodesValid) state.notifyFallbackValidityChange();
|
|
12133
12217
|
}
|
|
12134
12218
|
let currentHydratingSlotBoundaryState = null;
|
|
12135
12219
|
function setCurrentHydratingSlotBoundaryState(state) {
|
|
@@ -12184,16 +12268,18 @@ function isReusableDynamicFragmentAnchor(node, anchorLabel) {
|
|
|
12184
12268
|
return isComment(node, anchorLabel) || isComment(node, "") && (anchorLabel === "dynamic-component" || anchorLabel === "async component" || anchorLabel === "keyed");
|
|
12185
12269
|
}
|
|
12186
12270
|
var SlotFragment = class extends DynamicFragment {
|
|
12187
|
-
constructor() {
|
|
12271
|
+
constructor(notifyParent = false) {
|
|
12188
12272
|
super("slot", false, false, false);
|
|
12273
|
+
this.isSlot = true;
|
|
12189
12274
|
this.disposed = false;
|
|
12190
12275
|
this.forwarded = false;
|
|
12191
12276
|
this.parentSlotBoundary = getCurrentSlotBoundary();
|
|
12192
12277
|
this.activeFallback = null;
|
|
12193
12278
|
this.pendingRecheck = false;
|
|
12194
12279
|
this.isRenderingFallback = false;
|
|
12195
|
-
this.
|
|
12280
|
+
this.content = EMPTY_BLOCK$1;
|
|
12196
12281
|
this.isUpdatingSlot = false;
|
|
12282
|
+
this.notifyParent = notifyParent;
|
|
12197
12283
|
if (!isHydrating$1) this.insert = (parent, anchor) => this.insertSlot(parent, anchor);
|
|
12198
12284
|
this.remove = (parent) => this.removeSlot(parent);
|
|
12199
12285
|
}
|
|
@@ -12218,55 +12304,46 @@ var SlotFragment = class extends DynamicFragment {
|
|
|
12218
12304
|
get slotFallbackBoundary() {
|
|
12219
12305
|
return this.ensureSlotFallbackBoundary();
|
|
12220
12306
|
}
|
|
12221
|
-
getEffectiveOutput() {
|
|
12222
|
-
return getSlotEffectiveOutput(this);
|
|
12223
|
-
}
|
|
12224
12307
|
insertSlot(parent, anchor) {
|
|
12225
12308
|
this.disposed = false;
|
|
12226
|
-
if (this.fallbackBlock) {
|
|
12227
|
-
insert(this.fallbackBlock, parent, anchor);
|
|
12228
|
-
mutateSlotFallbackCarrier(this.nodes, (block) => insert(block, parent, anchor));
|
|
12229
|
-
return;
|
|
12230
|
-
}
|
|
12231
12309
|
insert(this.nodes, parent, anchor);
|
|
12232
12310
|
}
|
|
12233
12311
|
removeSlot(parent) {
|
|
12234
12312
|
this.disposed = true;
|
|
12235
|
-
|
|
12236
|
-
|
|
12313
|
+
const nodes = this.nodes;
|
|
12314
|
+
remove(nodes, parent);
|
|
12315
|
+
if (this.activeFallback === nodes) this.activeFallback = null;
|
|
12237
12316
|
disposeSlotFallback(this);
|
|
12238
12317
|
}
|
|
12318
|
+
updateContent(render, key) {
|
|
12319
|
+
this.nodes = this.content;
|
|
12320
|
+
this.update(render, key, false, !this.activeFallback);
|
|
12321
|
+
this.content = this.nodes;
|
|
12322
|
+
}
|
|
12239
12323
|
updateSlot(render, fallback, key = render || fallback) {
|
|
12240
12324
|
const prevLocalFallback = this.localFallback;
|
|
12241
12325
|
this.localFallback = fallback;
|
|
12242
|
-
const fallbackChanged = prevLocalFallback !== fallback;
|
|
12243
|
-
const fastSlotKey = key === void 0 ? render : key;
|
|
12244
|
-
if (!isHydrating$1 && !fallback && !this.parentSlotBoundary && !this._slotFallbackBoundary) {
|
|
12245
|
-
this.update(render, fastSlotKey);
|
|
12246
|
-
return;
|
|
12247
|
-
}
|
|
12248
12326
|
const boundary = this.slotFallbackBoundary;
|
|
12249
|
-
const slotRender = render ? () => withOwnedSlotBoundary(boundary, render) : () =>
|
|
12250
|
-
const slotKey = key === void 0 ? slotRender : key;
|
|
12327
|
+
const slotRender = render ? () => withOwnedSlotBoundary(boundary, render) : () => EMPTY_BLOCK$1;
|
|
12251
12328
|
this.isUpdatingSlot = true;
|
|
12252
12329
|
this.pendingRecheck = false;
|
|
12253
12330
|
try {
|
|
12254
|
-
const shouldForce =
|
|
12331
|
+
const shouldForce = prevLocalFallback !== fallback;
|
|
12255
12332
|
if (isHydrating$1) withHydratingSlotBoundary(() => {
|
|
12256
12333
|
const prev = isHydratingSlotFallbackActive();
|
|
12257
12334
|
try {
|
|
12258
12335
|
if (hasSlotFallback(boundary)) setCurrentHydratingSlotFallbackActive(true);
|
|
12259
|
-
this.
|
|
12260
|
-
const contentValid = isValidBlock(this.
|
|
12336
|
+
this.updateContent(slotRender, key);
|
|
12337
|
+
const contentValid = isValidBlock(this.content);
|
|
12261
12338
|
recheckSlotFallback(this, shouldForce);
|
|
12262
12339
|
if (!hasSlotFallback(boundary) || contentValid) setCurrentHydratingSlotFallbackActive(prev);
|
|
12263
|
-
this.hydrate(!isValidBlock(this.
|
|
12340
|
+
this.hydrate(!isValidBlock(this.nodes));
|
|
12264
12341
|
} finally {
|
|
12265
12342
|
setCurrentHydratingSlotFallbackActive(prev);
|
|
12266
12343
|
}
|
|
12267
12344
|
});
|
|
12268
12345
|
else {
|
|
12269
|
-
this.
|
|
12346
|
+
this.updateContent(slotRender, key);
|
|
12270
12347
|
recheckSlotFallback(this, shouldForce);
|
|
12271
12348
|
}
|
|
12272
12349
|
} finally {
|
|
@@ -12275,7 +12352,7 @@ var SlotFragment = class extends DynamicFragment {
|
|
|
12275
12352
|
}
|
|
12276
12353
|
}
|
|
12277
12354
|
getContent() {
|
|
12278
|
-
return this.
|
|
12355
|
+
return this.content;
|
|
12279
12356
|
}
|
|
12280
12357
|
getParentNode() {
|
|
12281
12358
|
return this.anchor ? this.anchor.parentNode : null;
|
|
@@ -12289,15 +12366,27 @@ var SlotFragment = class extends DynamicFragment {
|
|
|
12289
12366
|
isDisposed() {
|
|
12290
12367
|
return this.disposed;
|
|
12291
12368
|
}
|
|
12369
|
+
isContentValid() {
|
|
12370
|
+
return isValidBlock(this.content);
|
|
12371
|
+
}
|
|
12372
|
+
syncNodes() {
|
|
12373
|
+
this.nodes = this.activeFallback || this.content;
|
|
12374
|
+
}
|
|
12292
12375
|
notifyFallbackValidityChange() {
|
|
12293
|
-
if (this.parentSlotBoundary) this.parentSlotBoundary.markDirty();
|
|
12376
|
+
if (this.notifyParent && this.parentSlotBoundary) this.parentSlotBoundary.markDirty();
|
|
12294
12377
|
}
|
|
12295
12378
|
};
|
|
12296
12379
|
function isFragment(val) {
|
|
12297
|
-
return val
|
|
12380
|
+
return !!(val && val.__vf);
|
|
12381
|
+
}
|
|
12382
|
+
function isInteropFragment(val) {
|
|
12383
|
+
return isFragment(val) && val.vnode !== void 0;
|
|
12298
12384
|
}
|
|
12299
12385
|
function isDynamicFragment(val) {
|
|
12300
|
-
return val
|
|
12386
|
+
return !!(val && val.__df);
|
|
12387
|
+
}
|
|
12388
|
+
function isSlotFragment(val) {
|
|
12389
|
+
return isDynamicFragment(val) && !!val.isSlot;
|
|
12301
12390
|
}
|
|
12302
12391
|
//#endregion
|
|
12303
12392
|
//#region packages/runtime-vapor/src/teleport.ts
|
|
@@ -12310,7 +12399,7 @@ function isVaporTeleport(value) {
|
|
|
12310
12399
|
return !!(value && value.__isTeleport && value.__vapor);
|
|
12311
12400
|
}
|
|
12312
12401
|
function isTeleportFragment(value) {
|
|
12313
|
-
return !!(value && value.
|
|
12402
|
+
return !!(value && value.__tf);
|
|
12314
12403
|
}
|
|
12315
12404
|
//#endregion
|
|
12316
12405
|
//#region packages/runtime-vapor/src/block.ts
|
|
@@ -12323,11 +12412,9 @@ function isValidBlock(block) {
|
|
|
12323
12412
|
else if (isVaporComponent(block)) return isValidBlock(block.block);
|
|
12324
12413
|
else if (isArray(block)) return block.length > 0 && block.some(isValidBlock);
|
|
12325
12414
|
else {
|
|
12326
|
-
|
|
12327
|
-
if (isBlockValid) return isBlockValid.call(block);
|
|
12415
|
+
if (isInteropEnabled && block.isBlockValid) return block.isBlockValid();
|
|
12328
12416
|
if (block.validityPending) return true;
|
|
12329
|
-
|
|
12330
|
-
return isValidBlock(getEffectiveOutput ? getEffectiveOutput.call(block) : block.nodes);
|
|
12417
|
+
return isValidBlock(block.nodes);
|
|
12331
12418
|
}
|
|
12332
12419
|
}
|
|
12333
12420
|
function insert(block, parent, anchor = null, parentSuspense) {
|
|
@@ -12413,7 +12500,7 @@ function normalizeBlock(block) {
|
|
|
12413
12500
|
}
|
|
12414
12501
|
return nodes;
|
|
12415
12502
|
}
|
|
12416
|
-
function
|
|
12503
|
+
function findBlockBoundary(block) {
|
|
12417
12504
|
const lastChild = findLastChild(block);
|
|
12418
12505
|
let { parentNode, nextSibling: nextNode } = lastChild;
|
|
12419
12506
|
if (nextNode && isComment(nextNode, "]") && isFragmentBlock(block) && !isComment(lastChild, "]")) nextNode = nextNode.nextSibling;
|
|
@@ -12440,73 +12527,42 @@ function isFragmentBlock(block) {
|
|
|
12440
12527
|
//#endregion
|
|
12441
12528
|
//#region packages/runtime-vapor/src/hmr.ts
|
|
12442
12529
|
function hmrRerender(instance) {
|
|
12443
|
-
const
|
|
12444
|
-
const parent =
|
|
12445
|
-
|
|
12446
|
-
|
|
12530
|
+
const { parentNode, nextNode: anchor } = findBlockBoundary(instance.block);
|
|
12531
|
+
const parent = parentNode;
|
|
12532
|
+
if (instance.renderEffects) {
|
|
12533
|
+
instance.renderEffects.forEach((e) => e.stop());
|
|
12534
|
+
instance.renderEffects.length = 0;
|
|
12535
|
+
}
|
|
12447
12536
|
remove(instance.block, parent);
|
|
12448
12537
|
const prev = setCurrentInstance(instance);
|
|
12449
12538
|
pushWarningContext(instance);
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12539
|
+
try {
|
|
12540
|
+
devRender(instance);
|
|
12541
|
+
} finally {
|
|
12542
|
+
popWarningContext();
|
|
12543
|
+
setCurrentInstance(...prev);
|
|
12544
|
+
}
|
|
12453
12545
|
insert(instance.block, parent, anchor);
|
|
12454
12546
|
}
|
|
12455
12547
|
function hmrReload(instance, newComp) {
|
|
12456
|
-
|
|
12457
|
-
|
|
12548
|
+
const parentInstance = instance.parent;
|
|
12549
|
+
if (parentInstance) {
|
|
12550
|
+
parentInstance.hmrRerender();
|
|
12458
12551
|
return;
|
|
12459
12552
|
}
|
|
12460
|
-
const
|
|
12461
|
-
const parent =
|
|
12462
|
-
const anchor = normalized[normalized.length - 1].nextSibling;
|
|
12553
|
+
const { parentNode, nextNode: anchor } = findBlockBoundary(instance.block);
|
|
12554
|
+
const parent = parentNode;
|
|
12463
12555
|
unmountComponent(instance, parent);
|
|
12464
|
-
const parentInstance = instance.parent;
|
|
12465
12556
|
const prev = setCurrentInstance(parentInstance);
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
}
|
|
12472
|
-
/**
|
|
12473
|
-
* dev only
|
|
12474
|
-
* update parentInstance.block to ensure that the correct parent and
|
|
12475
|
-
* anchor are found during parentInstance HMR rerender/reload, as
|
|
12476
|
-
* `normalizeBlock` relies on the current instance.block
|
|
12477
|
-
*/
|
|
12478
|
-
function updateParentBlockOnHmrReload(parentInstance, instance, newInstance) {
|
|
12479
|
-
if (parentInstance) parentInstance.block = replaceBlockInstance(parentInstance.block, instance, newInstance);
|
|
12480
|
-
}
|
|
12481
|
-
/**
|
|
12482
|
-
* dev only
|
|
12483
|
-
* during root component HMR reload, since the old component will be unmounted
|
|
12484
|
-
* and a new one will be mounted, we need to update the teleport's nodes
|
|
12485
|
-
* to ensure that the correct parent and anchor are found during parentInstance
|
|
12486
|
-
* HMR rerender/reload, as `normalizeBlock` relies on the current instance.block
|
|
12487
|
-
*/
|
|
12488
|
-
function updateParentTeleportOnHmrReload(instance, newInstance) {
|
|
12489
|
-
const teleport = instance.parentTeleport;
|
|
12490
|
-
if (teleport) {
|
|
12491
|
-
newInstance.parentTeleport = teleport;
|
|
12492
|
-
teleport.nodes = replaceBlockInstance(teleport.nodes, instance, newInstance);
|
|
12493
|
-
}
|
|
12494
|
-
}
|
|
12495
|
-
function replaceBlockInstance(block, instance, newInstance) {
|
|
12496
|
-
if (block === instance) return newInstance;
|
|
12497
|
-
if (isArray(block)) {
|
|
12498
|
-
for (let i = 0; i < block.length; i++) block[i] = replaceBlockInstance(block[i], instance, newInstance);
|
|
12499
|
-
return block;
|
|
12500
|
-
}
|
|
12501
|
-
if (isVaporComponent(block)) {
|
|
12502
|
-
block.block = replaceBlockInstance(block.block, instance, newInstance);
|
|
12503
|
-
return block;
|
|
12504
|
-
}
|
|
12505
|
-
if (isFragment(block)) {
|
|
12506
|
-
block.nodes = replaceBlockInstance(block.nodes, instance, newInstance);
|
|
12507
|
-
return block;
|
|
12557
|
+
let newInstance;
|
|
12558
|
+
try {
|
|
12559
|
+
newInstance = createComponent(newComp, instance.rawProps, instance.rawSlots, instance.isSingleRoot, void 0, instance.appContext);
|
|
12560
|
+
} finally {
|
|
12561
|
+
setCurrentInstance(...prev);
|
|
12508
12562
|
}
|
|
12509
|
-
|
|
12563
|
+
mountComponent(newInstance, parent, anchor);
|
|
12564
|
+
const app = instance.appContext.app;
|
|
12565
|
+
if (app && app._instance === instance) app._instance = newInstance;
|
|
12510
12566
|
}
|
|
12511
12567
|
//#endregion
|
|
12512
12568
|
//#region packages/runtime-vapor/src/suspense.ts
|
|
@@ -12524,10 +12580,7 @@ function setParentSuspense(suspense) {
|
|
|
12524
12580
|
}
|
|
12525
12581
|
//#endregion
|
|
12526
12582
|
//#region packages/runtime-vapor/src/component.ts
|
|
12527
|
-
function
|
|
12528
|
-
return rawSlots && isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
|
|
12529
|
-
}
|
|
12530
|
-
function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false) {
|
|
12583
|
+
function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false, ce) {
|
|
12531
12584
|
const wasInOnceSlot = inOnceSlot;
|
|
12532
12585
|
if (wasInOnceSlot) once = true;
|
|
12533
12586
|
if (isInteropEnabled && isCollectingVdomSlotVNodes) {
|
|
@@ -12585,7 +12638,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
12585
12638
|
} else frag.hydrate();
|
|
12586
12639
|
return frag;
|
|
12587
12640
|
}
|
|
12588
|
-
const instance = new VaporComponentInstance(component, rawProps, rawSlots, appContext, once);
|
|
12641
|
+
const instance = new VaporComponentInstance(component, rawProps, rawSlots, appContext, once, ce);
|
|
12589
12642
|
if (isKeepAliveEnabled && currentKeepAliveCtx && !isAsyncWrapper(instance)) {
|
|
12590
12643
|
currentKeepAliveCtx.processShapeFlag(instance);
|
|
12591
12644
|
setCurrentKeepAliveCtx(null);
|
|
@@ -12623,7 +12676,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
|
|
|
12623
12676
|
if (isSuspenseEnabled && isHydrating$1 && hydrationClose && instance.suspense && instance.asyncDep && !instance.asyncResolved && instance.restoreAsyncContext) {
|
|
12624
12677
|
deferHydrationBoundary = true;
|
|
12625
12678
|
instance.deferredHydrationBoundary = () => {
|
|
12626
|
-
if (instance.block && hydrationClose &&
|
|
12679
|
+
if (instance.block && hydrationClose && findBlockBoundary(instance.block).nextNode === hydrationClose.nextSibling) setCurrentHydrationNode(hydrationClose);
|
|
12627
12680
|
finalizeHydrationBoundary();
|
|
12628
12681
|
};
|
|
12629
12682
|
exitHydrationCursor(hydrationCursor);
|
|
@@ -12705,7 +12758,7 @@ const emptyContext = {
|
|
|
12705
12758
|
provides: /* @__PURE__ */ Object.create(null)
|
|
12706
12759
|
};
|
|
12707
12760
|
var VaporComponentInstance = class {
|
|
12708
|
-
constructor(comp, rawProps, rawSlots, appContext, once) {
|
|
12761
|
+
constructor(comp, rawProps, rawSlots, appContext, once, ce) {
|
|
12709
12762
|
this.accessedAttrs = false;
|
|
12710
12763
|
this.vapor = true;
|
|
12711
12764
|
this.uid = nextUid();
|
|
@@ -12751,9 +12804,9 @@ var VaporComponentInstance = class {
|
|
|
12751
12804
|
} else this.props = this.attrs = EMPTY_OBJ;
|
|
12752
12805
|
const normalizedRawSlots = normalizeRawSlots(rawSlots);
|
|
12753
12806
|
this.rawSlots = normalizedRawSlots || EMPTY_OBJ;
|
|
12754
|
-
this.slots = normalizedRawSlots ?
|
|
12807
|
+
this.slots = normalizedRawSlots ? new Proxy(normalizedRawSlots, dynamicSlotsProxyHandlers) : EMPTY_OBJ;
|
|
12755
12808
|
this.scopeId = getCurrentScopeId();
|
|
12756
|
-
if (
|
|
12809
|
+
if (ce) ce(this);
|
|
12757
12810
|
if (this.props === this.attrs) this.accessedAttrs = true;
|
|
12758
12811
|
else {
|
|
12759
12812
|
const attrs = this.attrs;
|
|
@@ -12887,7 +12940,7 @@ function mountComponent(instance, parent, anchor) {
|
|
|
12887
12940
|
if (!isHydrating$1) {
|
|
12888
12941
|
insert(instance.block, parent, anchor);
|
|
12889
12942
|
setComponentScopeId(instance);
|
|
12890
|
-
}
|
|
12943
|
+
} else trackComponentScopeId(instance);
|
|
12891
12944
|
if (instance.m) queuePostFlushCb(instance.m);
|
|
12892
12945
|
if (isKeepAliveEnabled && instance.shapeFlag & 256 && instance.a) queuePostFlushCb(instance.a);
|
|
12893
12946
|
instance.isMounted = true;
|
|
@@ -12916,7 +12969,7 @@ function getRootElement(block, onDynamicFragment, recurse = true) {
|
|
|
12916
12969
|
if (block instanceof Element) return block;
|
|
12917
12970
|
if (recurse && isVaporComponent(block)) return getRootElement(block.block, onDynamicFragment, recurse);
|
|
12918
12971
|
if (isFragment(block) && !(isTeleportEnabled && isTeleportFragment(block))) {
|
|
12919
|
-
if (block
|
|
12972
|
+
if (isDynamicFragment(block) && onDynamicFragment) onDynamicFragment(block);
|
|
12920
12973
|
const { nodes } = block;
|
|
12921
12974
|
if (nodes instanceof Element && nodes.$root) return nodes;
|
|
12922
12975
|
return getRootElement(nodes, onDynamicFragment, recurse);
|
|
@@ -12953,27 +13006,65 @@ function handleSetupResult(setupResult, component, instance) {
|
|
|
12953
13006
|
else if (setupResult === EMPTY_OBJ && component.render) instance.block = callRender(component.render, instance, setupResult);
|
|
12954
13007
|
else instance.block = setupResult;
|
|
12955
13008
|
if (instance.hasFallthrough && component.inheritAttrs !== false && Object.keys(instance.attrs).length) {
|
|
12956
|
-
const
|
|
12957
|
-
|
|
12958
|
-
|
|
13009
|
+
const getFallthroughAttrs = isFunction(component) && !(isTransitionEnabled ? isVaporTransition(component) : false) ? () => getFunctionalFallthrough(instance.attrs) : () => instance.attrs;
|
|
13010
|
+
applyFallthroughAttrs(instance.block, instance, getFallthroughAttrs);
|
|
13011
|
+
}
|
|
13012
|
+
popWarningContext();
|
|
13013
|
+
}
|
|
13014
|
+
function applyFallthroughAttrs(block, instance, getFallthroughAttrs, scope) {
|
|
13015
|
+
let hasSlotFragment = false;
|
|
13016
|
+
let dynamicFragments;
|
|
13017
|
+
const root = getRootElement(block, (frag) => {
|
|
13018
|
+
if (frag.isSlot) hasSlotFragment = true;
|
|
13019
|
+
else (dynamicFragments || (dynamicFragments = [])).push(frag);
|
|
13020
|
+
}, false);
|
|
13021
|
+
const dynamicRoot = root ? void 0 : getSingleDynamicRootChain(block);
|
|
13022
|
+
const fragmentsToRegister = root ? dynamicFragments : dynamicRoot && dynamicRoot.fragments;
|
|
13023
|
+
if (fragmentsToRegister) {
|
|
13024
|
+
for (const frag of fragmentsToRegister) if (!frag.isSlot) registerDynamicFragmentFallthroughAttrs(frag, instance, getFallthroughAttrs);
|
|
13025
|
+
}
|
|
13026
|
+
if (root && !hasSlotFragment) {
|
|
13027
|
+
const applyEffect = () => renderEffect(() => {
|
|
13028
|
+
const attrs = getFallthroughAttrs();
|
|
12959
13029
|
if (attrs) applyFallthroughProps(root, attrs);
|
|
12960
13030
|
});
|
|
12961
|
-
|
|
13031
|
+
scope ? scope.run(applyEffect) : applyEffect();
|
|
13032
|
+
} else if (hasSlotFragment || dynamicRoot && dynamicRoot.hasNonSingleRoot || isTeleportEnabled && containsTeleportFragment(block) || !instance.accessedAttrs && isArray(block) && block.length) warnExtraneousAttributes(instance.attrs);
|
|
13033
|
+
}
|
|
13034
|
+
function getSingleDynamicRootChain(block) {
|
|
13035
|
+
if (isDynamicFragment(block)) {
|
|
13036
|
+
const { nodes } = block;
|
|
13037
|
+
const nested = getSingleDynamicRootChain(nodes);
|
|
13038
|
+
return {
|
|
13039
|
+
fragments: nested ? [block, ...nested.fragments] : [block],
|
|
13040
|
+
hasNonSingleRoot: nested ? nested.hasNonSingleRoot : isArray(nodes) && nodes.some((child) => !(child instanceof Comment))
|
|
13041
|
+
};
|
|
13042
|
+
}
|
|
13043
|
+
if (isFragment(block) && !(isTeleportEnabled && isTeleportFragment(block))) return getSingleDynamicRootChain(block.nodes);
|
|
13044
|
+
if (isArray(block)) {
|
|
13045
|
+
let singleRoot;
|
|
13046
|
+
let hasComment = false;
|
|
13047
|
+
for (const child of block) {
|
|
13048
|
+
if (child instanceof Comment) {
|
|
13049
|
+
hasComment = true;
|
|
13050
|
+
continue;
|
|
13051
|
+
}
|
|
13052
|
+
const childRoot = getSingleDynamicRootChain(child);
|
|
13053
|
+
if (!childRoot || singleRoot) return;
|
|
13054
|
+
singleRoot = childRoot;
|
|
13055
|
+
}
|
|
13056
|
+
return hasComment ? singleRoot : void 0;
|
|
12962
13057
|
}
|
|
12963
|
-
popWarningContext();
|
|
12964
13058
|
}
|
|
12965
|
-
function
|
|
12966
|
-
|
|
12967
|
-
|
|
13059
|
+
function containsTeleportFragment(block) {
|
|
13060
|
+
if (isTeleportFragment(block)) return true;
|
|
13061
|
+
if (isArray(block)) return block.some((child) => !(child instanceof Comment) && containsTeleportFragment(child));
|
|
13062
|
+
return isFragment(block) && containsTeleportFragment(block.nodes);
|
|
12968
13063
|
}
|
|
12969
|
-
function registerDynamicFragmentFallthroughAttrs(frag,
|
|
13064
|
+
function registerDynamicFragmentFallthroughAttrs(frag, instance, getFallthroughAttrs) {
|
|
13065
|
+
if (frag.hasFallthroughAttrs) return;
|
|
12970
13066
|
frag.hasFallthroughAttrs = true;
|
|
12971
|
-
(frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) =>
|
|
12972
|
-
if (nodes instanceof Element) frag.scope.run(() => {
|
|
12973
|
-
renderEffect(() => applyFallthroughProps(nodes, attrs));
|
|
12974
|
-
});
|
|
12975
|
-
else if (frag.anchorLabel === "slot" || isArray(nodes) && nodes.length) warnExtraneousAttributes(attrs);
|
|
12976
|
-
});
|
|
13067
|
+
(frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => applyFallthroughAttrs(nodes, instance, getFallthroughAttrs, frag.scope));
|
|
12977
13068
|
}
|
|
12978
13069
|
//#endregion
|
|
12979
13070
|
//#region packages/runtime-vapor/src/apiCreateApp.ts
|
|
@@ -13082,23 +13173,31 @@ function defineVaporAsyncComponent(source) {
|
|
|
13082
13173
|
frag.update(() => createInnerComp(resolvedComp, instance));
|
|
13083
13174
|
return frag;
|
|
13084
13175
|
}
|
|
13176
|
+
frag.validityPending = true;
|
|
13085
13177
|
const onError = (err) => {
|
|
13086
13178
|
setPendingRequest(null);
|
|
13087
13179
|
handleError(err, instance, 13, !errorComponent);
|
|
13088
13180
|
};
|
|
13089
13181
|
if (suspensible && instance.suspense) return load().then(() => {
|
|
13090
13182
|
resolvedComp = getResolvedComp();
|
|
13183
|
+
frag.validityPending = false;
|
|
13091
13184
|
if (resolvedComp) frag.update(() => createInnerComp(resolvedComp, instance));
|
|
13092
13185
|
return frag;
|
|
13093
13186
|
}).catch((err) => {
|
|
13094
13187
|
onError(err);
|
|
13095
|
-
|
|
13188
|
+
frag.validityPending = false;
|
|
13189
|
+
if (errorComponent) frag.update(() => createErrorComp(errorComponent, instance, err));
|
|
13096
13190
|
return frag;
|
|
13097
13191
|
});
|
|
13098
|
-
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
|
|
13192
|
+
const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
|
|
13099
13193
|
load().then(() => {
|
|
13194
|
+
if (instance.isUnmounted) return;
|
|
13100
13195
|
loaded.value = true;
|
|
13101
13196
|
}).catch((err) => {
|
|
13197
|
+
if (instance.isUnmounted) {
|
|
13198
|
+
setPendingRequest(null);
|
|
13199
|
+
return;
|
|
13200
|
+
}
|
|
13102
13201
|
onError(err);
|
|
13103
13202
|
error.value = err;
|
|
13104
13203
|
});
|
|
@@ -13106,8 +13205,11 @@ function defineVaporAsyncComponent(source) {
|
|
|
13106
13205
|
resolvedComp = getResolvedComp();
|
|
13107
13206
|
let render;
|
|
13108
13207
|
if (loaded.value && resolvedComp) render = () => createInnerComp(resolvedComp, instance);
|
|
13109
|
-
else if (error.value && errorComponent)
|
|
13110
|
-
|
|
13208
|
+
else if (error.value && errorComponent) {
|
|
13209
|
+
const err = error.value;
|
|
13210
|
+
render = () => createErrorComp(errorComponent, instance, err);
|
|
13211
|
+
} else if (loadingComponent && !delayed.value) render = () => createInnerComp(loadingComponent, instance);
|
|
13212
|
+
frag.validityPending = !render && !error.value;
|
|
13111
13213
|
frag.update(render);
|
|
13112
13214
|
if (isKeepAliveEnabled && frag.keepAliveCtx) frag.keepAliveCtx.cacheBlock();
|
|
13113
13215
|
});
|
|
@@ -13115,6 +13217,9 @@ function defineVaporAsyncComponent(source) {
|
|
|
13115
13217
|
}
|
|
13116
13218
|
});
|
|
13117
13219
|
}
|
|
13220
|
+
function createErrorComp(comp, parent, error) {
|
|
13221
|
+
return createInnerComp(comp, parent, { error: () => error }, {});
|
|
13222
|
+
}
|
|
13118
13223
|
function createInnerComp(comp, parent, rawProps = parent.rawProps, rawSlots = parent.rawSlots) {
|
|
13119
13224
|
const prevInstance = setCurrentInstance(parent);
|
|
13120
13225
|
try {
|
|
@@ -13136,17 +13241,19 @@ function setCurrentPendingVShows(pending) {
|
|
|
13136
13241
|
function applyVShow(target, source) {
|
|
13137
13242
|
if (isVaporComponent(target)) return applyVShow(target.block, source);
|
|
13138
13243
|
if (isArray(target) && target.length === 1) return applyVShow(target[0], source);
|
|
13139
|
-
if (target
|
|
13244
|
+
if (isDynamicFragment(target)) {
|
|
13140
13245
|
const update = target.update;
|
|
13141
|
-
target.update = (
|
|
13142
|
-
update.call(target,
|
|
13246
|
+
target.update = (...args) => {
|
|
13247
|
+
const res = update.call(target, ...args);
|
|
13143
13248
|
setDisplay(target, source());
|
|
13249
|
+
return res;
|
|
13144
13250
|
};
|
|
13145
|
-
} else if (target
|
|
13251
|
+
} else if (isFragment(target) && target.insert) {
|
|
13146
13252
|
const insert = target.insert;
|
|
13147
|
-
target.insert = (
|
|
13148
|
-
insert.call(target,
|
|
13253
|
+
target.insert = (...args) => {
|
|
13254
|
+
const res = insert.call(target, ...args);
|
|
13149
13255
|
setDisplay(target, source());
|
|
13256
|
+
return res;
|
|
13150
13257
|
};
|
|
13151
13258
|
}
|
|
13152
13259
|
renderEffect(() => {
|
|
@@ -13154,20 +13261,20 @@ function applyVShow(target, source) {
|
|
|
13154
13261
|
if (currentPendingVShows) {
|
|
13155
13262
|
currentPendingVShows.push({
|
|
13156
13263
|
target,
|
|
13157
|
-
|
|
13264
|
+
apply: () => setDisplay(target, value, true)
|
|
13158
13265
|
});
|
|
13159
13266
|
return;
|
|
13160
13267
|
}
|
|
13161
13268
|
setDisplay(target, value);
|
|
13162
13269
|
});
|
|
13163
13270
|
}
|
|
13164
|
-
function setDisplay(target, value) {
|
|
13165
|
-
if (isVaporComponent(target)) return setDisplay(target.block, value);
|
|
13271
|
+
function setDisplay(target, value, deferEnter = false) {
|
|
13272
|
+
if (isVaporComponent(target)) return setDisplay(target.block, value, deferEnter);
|
|
13166
13273
|
if (isArray(target)) {
|
|
13167
13274
|
if (target.length === 0) return;
|
|
13168
|
-
if (target.length === 1) return setDisplay(target[0], value);
|
|
13275
|
+
if (target.length === 1) return setDisplay(target[0], value, deferEnter);
|
|
13169
13276
|
}
|
|
13170
|
-
if (isFragment(target)) return setDisplay(target.nodes, value);
|
|
13277
|
+
if (isFragment(target)) return setDisplay(target.nodes, value, deferEnter);
|
|
13171
13278
|
if (target instanceof Element) {
|
|
13172
13279
|
const el = target;
|
|
13173
13280
|
if (!(vShowOriginalDisplay in el)) el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
|
|
@@ -13175,6 +13282,7 @@ function setDisplay(target, value) {
|
|
|
13175
13282
|
if ($transition) if (value) {
|
|
13176
13283
|
$transition.beforeEnter(target);
|
|
13177
13284
|
el.style.display = el[vShowOriginalDisplay];
|
|
13285
|
+
if (deferEnter) return () => $transition.enter(target);
|
|
13178
13286
|
$transition.enter(target);
|
|
13179
13287
|
} else if (target.isConnected) $transition.leave(target, () => {
|
|
13180
13288
|
el.style.display = "none";
|
|
@@ -13269,11 +13377,14 @@ const VaporTransition = /* @__PURE__ */ decorate$1((props, { slots, expose }) =>
|
|
|
13269
13377
|
return children;
|
|
13270
13378
|
});
|
|
13271
13379
|
const transitionTypeMap = /* @__PURE__ */ new WeakMap();
|
|
13380
|
+
const inheritedTransitionKeyMap = /* @__PURE__ */ new WeakMap();
|
|
13381
|
+
let transitionKeyGeneration = 0;
|
|
13382
|
+
let currentTransitionKeyGeneration = 0;
|
|
13272
13383
|
function getTransitionType(block) {
|
|
13273
13384
|
const type = transitionTypeMap.get(block);
|
|
13274
13385
|
if (type !== void 0) return type;
|
|
13275
13386
|
if (block instanceof Element) return block.localName;
|
|
13276
|
-
if (isFragment(block) && block.vnode) {
|
|
13387
|
+
if (isInteropEnabled && isFragment(block) && block.vnode) {
|
|
13277
13388
|
const children = getTransitionRawChildren([block.vnode]);
|
|
13278
13389
|
if (children.length === 1) return children[0].type;
|
|
13279
13390
|
}
|
|
@@ -13290,11 +13401,8 @@ function getLeavingNodesForType(state, block) {
|
|
|
13290
13401
|
return nodes;
|
|
13291
13402
|
}
|
|
13292
13403
|
function getLeaveElement(block) {
|
|
13293
|
-
|
|
13294
|
-
if (
|
|
13295
|
-
const el = getTransitionElementFromVNode(block.vnode);
|
|
13296
|
-
if (el) return el;
|
|
13297
|
-
}
|
|
13404
|
+
const el = getTransitionElement(block);
|
|
13405
|
+
if (el) return el;
|
|
13298
13406
|
if (isFragment(block) && !isArray(block.nodes) && (block.nodes instanceof Element || isFragment(block.nodes))) return getLeaveElement(block.nodes);
|
|
13299
13407
|
}
|
|
13300
13408
|
const getTransitionHooksContext = (block, props, state, instance, postClone) => {
|
|
@@ -13336,7 +13444,7 @@ function applyResolvedTransitionHooks(block, hooks) {
|
|
|
13336
13444
|
if (block.length === 1) block = block[0];
|
|
13337
13445
|
else if (block.length === 0) return { hooks };
|
|
13338
13446
|
}
|
|
13339
|
-
if (hooks.applyGroup && (block instanceof ForFragment || block
|
|
13447
|
+
if (hooks.applyGroup && (block instanceof ForFragment || isSlotFragment(block) || isVaporComponent(block) && isSlotFragment(block.block))) {
|
|
13340
13448
|
hooks.applyGroup(block, hooks.props, hooks.state, hooks.instance);
|
|
13341
13449
|
return { hooks };
|
|
13342
13450
|
}
|
|
@@ -13393,52 +13501,138 @@ function applyTransitionLeaveHooksImpl(block, enterHooks, afterLeaveCb) {
|
|
|
13393
13501
|
};
|
|
13394
13502
|
}
|
|
13395
13503
|
function resolveTransitionBlock(block, onFragment) {
|
|
13396
|
-
|
|
13504
|
+
return resolveTransitionChildren(block, {
|
|
13505
|
+
mode: "single",
|
|
13506
|
+
onFragment
|
|
13507
|
+
})[0];
|
|
13508
|
+
}
|
|
13509
|
+
function resolveTransitionBlocks(block, onFragment, onUpdateOwner) {
|
|
13510
|
+
return resolveTransitionChildren(block, {
|
|
13511
|
+
mode: "group",
|
|
13512
|
+
onFragment,
|
|
13513
|
+
onUpdateOwner
|
|
13514
|
+
});
|
|
13515
|
+
}
|
|
13516
|
+
function resolveTransitionChildren(block, options) {
|
|
13517
|
+
const children = [];
|
|
13518
|
+
const prevGeneration = currentTransitionKeyGeneration;
|
|
13519
|
+
currentTransitionKeyGeneration = ++transitionKeyGeneration;
|
|
13520
|
+
try {
|
|
13521
|
+
collectTransitionBlocks(block, options, children);
|
|
13522
|
+
return children;
|
|
13523
|
+
} finally {
|
|
13524
|
+
currentTransitionKeyGeneration = prevGeneration;
|
|
13525
|
+
}
|
|
13526
|
+
}
|
|
13527
|
+
function collectTransitionBlocks(block, options, children) {
|
|
13397
13528
|
if (block instanceof Node) {
|
|
13398
|
-
if (block instanceof Element)
|
|
13399
|
-
} else if (isVaporComponent(block))
|
|
13400
|
-
else
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
|
|
13408
|
-
|
|
13529
|
+
if (block instanceof Element) children.push(block);
|
|
13530
|
+
} else if (isVaporComponent(block)) collectComponentTransitionBlocks(block, options, children);
|
|
13531
|
+
else if (isArray(block)) collectArrayTransitionBlocks(block, options, children);
|
|
13532
|
+
else if (isFragment(block)) collectFragmentTransitionBlocks(block, options, children);
|
|
13533
|
+
}
|
|
13534
|
+
function collectComponentTransitionBlocks(block, options, children) {
|
|
13535
|
+
if (options.mode === "group") {
|
|
13536
|
+
const isRootSlot = block.block && isSlotFragment(block.block);
|
|
13537
|
+
if (options.onUpdateOwner && !isRootSlot) options.onUpdateOwner(block);
|
|
13538
|
+
const start = children.length;
|
|
13539
|
+
collectTransitionBlocks(block.block, isRootSlot ? options : {
|
|
13540
|
+
mode: options.mode,
|
|
13541
|
+
onFragment: options.onFragment
|
|
13542
|
+
}, children);
|
|
13543
|
+
inheritTransitionKey(children, start, block.$key);
|
|
13544
|
+
return;
|
|
13409
13545
|
}
|
|
13410
|
-
|
|
13411
|
-
if (
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
if (child.$key == null) {
|
|
13415
|
-
var _block$$key2;
|
|
13416
|
-
child.$key = (_block$$key2 = block.$key) !== null && _block$$key2 !== void 0 ? _block$$key2 : block.uid;
|
|
13417
|
-
}
|
|
13418
|
-
transitionTypeMap.set(child, block.type);
|
|
13546
|
+
if (isAsyncWrapper(block)) {
|
|
13547
|
+
if (!block.type.__asyncResolved) {
|
|
13548
|
+
if (options.onFragment) options.onFragment(block.block);
|
|
13549
|
+
return;
|
|
13419
13550
|
}
|
|
13551
|
+
const start = children.length;
|
|
13552
|
+
collectTransitionBlocks(block.block.nodes, options, children);
|
|
13553
|
+
inheritSingleComponentKey(children[start], block);
|
|
13554
|
+
return;
|
|
13420
13555
|
}
|
|
13421
|
-
|
|
13422
|
-
|
|
13556
|
+
if (block.type === VaporTransition) return;
|
|
13557
|
+
const start = children.length;
|
|
13558
|
+
collectTransitionBlocks(block.block, options, children);
|
|
13559
|
+
inheritSingleComponentKey(children[start], block);
|
|
13560
|
+
}
|
|
13561
|
+
function collectArrayTransitionBlocks(block, options, children) {
|
|
13562
|
+
if (options.mode === "group") {
|
|
13423
13563
|
for (const c of block) {
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
if (
|
|
13427
|
-
|
|
13428
|
-
|
|
13564
|
+
const start = children.length;
|
|
13565
|
+
collectTransitionBlocks(c, options, children);
|
|
13566
|
+
if (c instanceof ForBlock) {
|
|
13567
|
+
const count = children.length - start;
|
|
13568
|
+
for (let j = start; j < children.length; j++) children[j].$key = c.key != null && count > 1 ? `${c.key}:${j - start}` : c.key;
|
|
13429
13569
|
}
|
|
13430
|
-
child = item;
|
|
13431
|
-
hasFound = true;
|
|
13432
13570
|
}
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13571
|
+
return;
|
|
13572
|
+
}
|
|
13573
|
+
let hasFound = false;
|
|
13574
|
+
for (const c of block) {
|
|
13575
|
+
if (c instanceof Comment) continue;
|
|
13576
|
+
const nested = [];
|
|
13577
|
+
collectTransitionBlocks(c, options, nested);
|
|
13578
|
+
if (hasFound) {
|
|
13579
|
+
warn("<transition> can only be used on a single element or component. Use <transition-group> for lists.");
|
|
13580
|
+
break;
|
|
13581
|
+
}
|
|
13582
|
+
if (nested.length) children.push(nested[0]);
|
|
13583
|
+
hasFound = true;
|
|
13584
|
+
}
|
|
13585
|
+
}
|
|
13586
|
+
function collectFragmentTransitionBlocks(block, options, children) {
|
|
13587
|
+
if (options.mode === "group") {
|
|
13588
|
+
if (options.onFragment) options.onFragment(block);
|
|
13589
|
+
if (options.onUpdateOwner) options.onUpdateOwner(block);
|
|
13590
|
+
if (isInteropEnabled && block.vnode) children.push(block);
|
|
13591
|
+
else {
|
|
13592
|
+
const start = children.length;
|
|
13593
|
+
collectTransitionBlocks(block.nodes, options, children);
|
|
13594
|
+
inheritTransitionKey(children, start, block.$key);
|
|
13595
|
+
}
|
|
13596
|
+
return;
|
|
13597
|
+
}
|
|
13598
|
+
if (isInteropEnabled && block.vnode) {
|
|
13599
|
+
children.push(block);
|
|
13600
|
+
const rawChildren = getTransitionRawChildren([block.vnode]);
|
|
13601
|
+
if (rawChildren.length === 1) transitionTypeMap.set(block, rawChildren[0].type);
|
|
13602
|
+
return;
|
|
13603
|
+
}
|
|
13604
|
+
if (options.onFragment) options.onFragment(block);
|
|
13605
|
+
collectTransitionBlocks(block.nodes, options, children);
|
|
13606
|
+
}
|
|
13607
|
+
function inheritSingleComponentKey(child, block) {
|
|
13608
|
+
if (!child) return;
|
|
13609
|
+
if (child.$key == null) {
|
|
13610
|
+
var _block$$key;
|
|
13611
|
+
child.$key = (_block$$key = block.$key) !== null && _block$$key !== void 0 ? _block$$key : block.uid;
|
|
13612
|
+
}
|
|
13613
|
+
transitionTypeMap.set(child, block.type);
|
|
13614
|
+
}
|
|
13615
|
+
function inheritTransitionKey(children, start, key) {
|
|
13616
|
+
if (key == null || start === children.length) return;
|
|
13617
|
+
for (let i = start; i < children.length; i++) {
|
|
13618
|
+
const child = children[i];
|
|
13619
|
+
let record = inheritedTransitionKeyMap.get(child);
|
|
13620
|
+
let baseKey;
|
|
13621
|
+
if (record && record.generation === currentTransitionKeyGeneration) baseKey = child.$key != null ? child.$key : i - start;
|
|
13622
|
+
else {
|
|
13623
|
+
if (!record || !Object.is(child.$key, record.inheritedKey)) {
|
|
13624
|
+
record = {
|
|
13625
|
+
generation: currentTransitionKeyGeneration,
|
|
13626
|
+
rawBaseKey: child.$key != null ? child.$key : i - start,
|
|
13627
|
+
inheritedKey: ""
|
|
13628
|
+
};
|
|
13629
|
+
inheritedTransitionKeyMap.set(child, record);
|
|
13630
|
+
} else record.generation = currentTransitionKeyGeneration;
|
|
13631
|
+
baseKey = record.rawBaseKey;
|
|
13632
|
+
}
|
|
13633
|
+
record.inheritedKey = String(key) + String(baseKey);
|
|
13634
|
+
child.$key = record.inheritedKey;
|
|
13440
13635
|
}
|
|
13441
|
-
return child;
|
|
13442
13636
|
}
|
|
13443
13637
|
function setTransitionHooks$1(block, hooks) {
|
|
13444
13638
|
if (isVaporComponent(block)) {
|
|
@@ -13459,6 +13653,13 @@ function getTransitionElementFromVNode(vnode) {
|
|
|
13459
13653
|
const children = getTransitionRawChildren([vnode]);
|
|
13460
13654
|
if (children.length === 1 && children[0] !== vnode) return getTransitionElementFromVNode(children[0]);
|
|
13461
13655
|
}
|
|
13656
|
+
function isValidTransitionBlock(block) {
|
|
13657
|
+
return !!(block instanceof Element || isInteropEnabled && isFragment(block) && block.vnode);
|
|
13658
|
+
}
|
|
13659
|
+
function getTransitionElement(block) {
|
|
13660
|
+
if (block instanceof Element) return block;
|
|
13661
|
+
if (isInteropEnabled && isFragment(block) && block.vnode) return getTransitionElementFromVNode(block.vnode);
|
|
13662
|
+
}
|
|
13462
13663
|
function capturePendingVShows(enabled, render) {
|
|
13463
13664
|
if (!enabled) return [render(), void 0];
|
|
13464
13665
|
const pendingVShows = [];
|
|
@@ -13473,8 +13674,16 @@ function applyPendingVShows(hooks, root, pendingVShows) {
|
|
|
13473
13674
|
if (!pendingVShows) return;
|
|
13474
13675
|
if (root) hooks.persisted = hooks.persisted || pendingVShows.some((pending) => pending.target === root || resolveTransitionBlock(pending.target) === root);
|
|
13475
13676
|
onBeforeMount(() => {
|
|
13476
|
-
|
|
13677
|
+
let enterCbs;
|
|
13678
|
+
pendingVShows.forEach((pending) => {
|
|
13679
|
+
const enterCb = pending.apply();
|
|
13680
|
+
if (enterCb) (enterCbs || (enterCbs = [])).push(enterCb);
|
|
13681
|
+
});
|
|
13477
13682
|
pendingVShows.length = 0;
|
|
13683
|
+
if (enterCbs) {
|
|
13684
|
+
const cbs = enterCbs;
|
|
13685
|
+
queuePostFlushCb(() => cbs.forEach((cb) => cb()), -1);
|
|
13686
|
+
}
|
|
13478
13687
|
});
|
|
13479
13688
|
}
|
|
13480
13689
|
//#endregion
|
|
@@ -13546,7 +13755,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
|
|
|
13546
13755
|
cache.forEach((cached) => {
|
|
13547
13756
|
unsetShapeFlag(cached);
|
|
13548
13757
|
if (cached !== current) {
|
|
13549
|
-
const parentNode =
|
|
13758
|
+
const parentNode = findBlockBoundary(cached).parentNode;
|
|
13550
13759
|
if (parentNode) remove(cached, parentNode);
|
|
13551
13760
|
}
|
|
13552
13761
|
});
|
|
@@ -13638,7 +13847,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
|
|
|
13638
13847
|
const cached = cache.get(key);
|
|
13639
13848
|
if (cached && (!current || cached !== current)) {
|
|
13640
13849
|
unsetShapeFlag(cached);
|
|
13641
|
-
const parentNode =
|
|
13850
|
+
const parentNode = findBlockBoundary(cached).parentNode;
|
|
13642
13851
|
if (parentNode) remove(cached, parentNode);
|
|
13643
13852
|
} else if (current) unsetShapeFlag(current);
|
|
13644
13853
|
cache.delete(key);
|
|
@@ -13770,9 +13979,6 @@ function getInnerBlock(block) {
|
|
|
13770
13979
|
else if (isFragment(block)) return getInnerBlock(block.nodes);
|
|
13771
13980
|
return [void 0, false];
|
|
13772
13981
|
}
|
|
13773
|
-
function isInteropFragment(block) {
|
|
13774
|
-
return !!(isFragment(block) && block.vnode);
|
|
13775
|
-
}
|
|
13776
13982
|
function getInstanceFromCache(cached) {
|
|
13777
13983
|
if (isVaporComponent(cached)) return cached;
|
|
13778
13984
|
if (isInteropEnabled) return cached.vnode.component;
|
|
@@ -13798,6 +14004,8 @@ function deactivate$1(instance, container) {
|
|
|
13798
14004
|
}
|
|
13799
14005
|
//#endregion
|
|
13800
14006
|
//#region packages/runtime-vapor/src/vdomInterop.ts
|
|
14007
|
+
const EMPTY_BLOCK = EMPTY_ARR;
|
|
14008
|
+
const EMPTY_VNODES = EMPTY_ARR;
|
|
13801
14009
|
function filterReservedProps(props) {
|
|
13802
14010
|
const filtered = {};
|
|
13803
14011
|
for (const key in props) if (!isReservedProp(key)) filtered[key] = props[key];
|
|
@@ -13805,7 +14013,7 @@ function filterReservedProps(props) {
|
|
|
13805
14013
|
}
|
|
13806
14014
|
const vaporInteropImpl = {
|
|
13807
14015
|
mount(vnode, container, anchor, parentComponent, parentSuspense, onBeforeMount, onVnodeBeforeMount) {
|
|
13808
|
-
|
|
14016
|
+
const selfAnchor = vnode.anchor = /* @__PURE__ */ createTextNode();
|
|
13809
14017
|
if (isHydrating$1) queuePostFlushCb(() => container.insertBefore(selfAnchor, anchor));
|
|
13810
14018
|
else {
|
|
13811
14019
|
vnode.el = selfAnchor;
|
|
@@ -13879,14 +14087,14 @@ const vaporInteropImpl = {
|
|
|
13879
14087
|
const anchor = vnode.anchor;
|
|
13880
14088
|
unmountComponent(instance, container);
|
|
13881
14089
|
if (!doRemove) {
|
|
13882
|
-
const blockContainer =
|
|
14090
|
+
const blockContainer = needsHostParentForRemove(instance.block) ? anchor && anchor.parentNode : void 0;
|
|
13883
14091
|
remove(instance.block, blockContainer);
|
|
13884
14092
|
}
|
|
13885
14093
|
}
|
|
13886
14094
|
} else if (vnode.vb) {
|
|
13887
14095
|
const anchor = vnode.anchor;
|
|
13888
14096
|
if (vnode.el && vnode.el !== anchor && isComment(vnode.el, "[")) slotStartAnchor = vnode.el;
|
|
13889
|
-
const blockContainer = container || (
|
|
14097
|
+
const blockContainer = container || (needsHostParentForRemove(vnode.vb) ? anchor && anchor.parentNode : void 0);
|
|
13890
14098
|
remove(vnode.vb, blockContainer);
|
|
13891
14099
|
stopVaporSlotScope(vnode);
|
|
13892
14100
|
}
|
|
@@ -14031,26 +14239,35 @@ const vaporSlotPropsProxyHandler = {
|
|
|
14031
14239
|
}
|
|
14032
14240
|
};
|
|
14033
14241
|
const vaporSlotWrappersCache = /* @__PURE__ */ new WeakMap();
|
|
14034
|
-
const vaporSlotsProxyHandler = {
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
slot
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14242
|
+
const vaporSlotsProxyHandler = {
|
|
14243
|
+
get(target, key) {
|
|
14244
|
+
const slot = isString(key) && !isInternalSlotKey(key) ? getSlot(target, key) : target[key];
|
|
14245
|
+
if (isFunction(slot)) {
|
|
14246
|
+
slot.__vapor = true;
|
|
14247
|
+
let wrappers = vaporSlotWrappersCache.get(target);
|
|
14248
|
+
if (!wrappers) vaporSlotWrappersCache.set(target, wrappers = /* @__PURE__ */ new Map());
|
|
14249
|
+
const cached = wrappers.get(key);
|
|
14250
|
+
if (cached && cached.slot === slot) return cached.wrapped;
|
|
14251
|
+
const wrapped = (props) => {
|
|
14252
|
+
return normalizeVaporSlotVNodes(slot, props) || [renderSlot({ [key]: slot }, key, props)];
|
|
14253
|
+
};
|
|
14254
|
+
wrapped.__vs = slot;
|
|
14255
|
+
wrappers.set(key, {
|
|
14256
|
+
slot,
|
|
14257
|
+
wrapped
|
|
14258
|
+
});
|
|
14259
|
+
return wrapped;
|
|
14260
|
+
}
|
|
14261
|
+
return slot;
|
|
14262
|
+
},
|
|
14263
|
+
ownKeys(target) {
|
|
14264
|
+
return Array.from(dynamicSlotsProxyHandlers.ownKeys(target)).filter((key) => isString(key) && !isInternalSlotKey(key));
|
|
14265
|
+
},
|
|
14266
|
+
getOwnPropertyDescriptor(target, key) {
|
|
14267
|
+
if (!isString(key) || isInternalSlotKey(key)) return;
|
|
14268
|
+
return dynamicSlotsProxyHandlers.getOwnPropertyDescriptor(target, key);
|
|
14051
14269
|
}
|
|
14052
|
-
|
|
14053
|
-
} };
|
|
14270
|
+
};
|
|
14054
14271
|
const collectedVdomSlotVNodes = /* @__PURE__ */ new WeakMap();
|
|
14055
14272
|
function normalizeVaporSlotVNodes(slot, props) {
|
|
14056
14273
|
if (props && hasVNodeSlotProps(props)) return;
|
|
@@ -14132,38 +14349,43 @@ function removeAttachedNodes(block, parent) {
|
|
|
14132
14349
|
if (block.parentNode === parent) remove(block, parent);
|
|
14133
14350
|
} else if (isArray(block)) for (let i = 0; i < block.length; i++) removeAttachedNodes(block[i], parent);
|
|
14134
14351
|
}
|
|
14135
|
-
function
|
|
14136
|
-
const props = vnode.props || (vnode.props = {});
|
|
14137
|
-
const existing = props.onVnodeUpdated;
|
|
14138
|
-
props.onVnodeUpdated = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
|
|
14139
|
-
}
|
|
14140
|
-
function appendVnodeBeforeUpdateHook(vnode, hook) {
|
|
14352
|
+
function appendVnodeHook(vnode, key, hook) {
|
|
14141
14353
|
const props = vnode.props || (vnode.props = {});
|
|
14142
|
-
const existing = props
|
|
14143
|
-
props
|
|
14354
|
+
const existing = props[key];
|
|
14355
|
+
props[key] = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
|
|
14144
14356
|
}
|
|
14145
|
-
function trackFragmentVNodeUpdates(frag, vnode) {
|
|
14357
|
+
function trackFragmentVNodeUpdates(frag, vnode, syncNodes) {
|
|
14146
14358
|
const beforeUpdate = () => {
|
|
14147
|
-
if (frag.onBeforeUpdate)
|
|
14359
|
+
if (frag.onBeforeUpdate) frag.onBeforeUpdate.forEach((bu) => bu());
|
|
14148
14360
|
};
|
|
14149
14361
|
const updated = () => {
|
|
14362
|
+
syncNodes();
|
|
14363
|
+
if (frag.onUpdated) frag.onUpdated.forEach((u) => u());
|
|
14364
|
+
};
|
|
14365
|
+
appendVnodeHook(vnode, "onVnodeBeforeUpdate", beforeUpdate);
|
|
14366
|
+
appendVnodeHook(vnode, "onVnodeUpdated", updated);
|
|
14367
|
+
}
|
|
14368
|
+
function createVNodeFragment(vnode) {
|
|
14369
|
+
const frag = createInteropFragment(EMPTY_BLOCK, vnode);
|
|
14370
|
+
frag.$key = vnode.key;
|
|
14371
|
+
let validityPending = !isHydrating$1;
|
|
14372
|
+
const syncNodes = () => {
|
|
14150
14373
|
frag.nodes = resolveVNodeNodes(vnode);
|
|
14151
|
-
|
|
14152
|
-
|
|
14374
|
+
validityPending = false;
|
|
14375
|
+
};
|
|
14376
|
+
frag.isBlockValid = () => validityPending ? true : isValidBlock(frag.nodes);
|
|
14377
|
+
trackFragmentVNodeUpdates(frag, vnode, syncNodes);
|
|
14378
|
+
return {
|
|
14379
|
+
frag,
|
|
14380
|
+
syncNodes
|
|
14153
14381
|
};
|
|
14154
|
-
appendVnodeBeforeUpdateHook(vnode, beforeUpdate);
|
|
14155
|
-
appendVnodeUpdatedHook(vnode, updated);
|
|
14156
14382
|
}
|
|
14157
14383
|
/**
|
|
14158
14384
|
* Mount VNode in vapor
|
|
14159
14385
|
*/
|
|
14160
14386
|
function mountVNode(internals, vnode, parentComponent) {
|
|
14161
14387
|
const suspense = parentSuspense || parentComponent && parentComponent.suspense;
|
|
14162
|
-
const frag =
|
|
14163
|
-
frag.validityPending = !isHydrating$1;
|
|
14164
|
-
frag.vnode = vnode;
|
|
14165
|
-
frag.$key = vnode.key;
|
|
14166
|
-
trackFragmentVNodeUpdates(frag, vnode);
|
|
14388
|
+
const { frag, syncNodes } = createVNodeFragment(vnode);
|
|
14167
14389
|
let isMounted = false;
|
|
14168
14390
|
const unmount = (parentNode, transition) => {
|
|
14169
14391
|
if (transition) setTransitionHooks(vnode, transition);
|
|
@@ -14176,8 +14398,7 @@ function mountVNode(internals, vnode, parentComponent) {
|
|
|
14176
14398
|
hydrateVNode(vnode, parentComponent);
|
|
14177
14399
|
onScopeDispose(unmount, true);
|
|
14178
14400
|
isMounted = true;
|
|
14179
|
-
|
|
14180
|
-
frag.validityPending = false;
|
|
14401
|
+
syncNodes();
|
|
14181
14402
|
};
|
|
14182
14403
|
frag.insert = (parentNode, anchor, transition) => {
|
|
14183
14404
|
if (isHydrating$1) return;
|
|
@@ -14196,8 +14417,7 @@ function mountVNode(internals, vnode, parentComponent) {
|
|
|
14196
14417
|
} else internals.m(vnode, parentNode, anchor, 2, parentComponent);
|
|
14197
14418
|
simpleSetCurrentInstance(prev);
|
|
14198
14419
|
}
|
|
14199
|
-
|
|
14200
|
-
frag.validityPending = false;
|
|
14420
|
+
syncNodes();
|
|
14201
14421
|
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
14202
14422
|
};
|
|
14203
14423
|
frag.remove = unmount;
|
|
@@ -14210,11 +14430,8 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
14210
14430
|
const suspense = parentSuspense || parentComponent && parentComponent.suspense;
|
|
14211
14431
|
const useBridge = shouldUseRendererBridge(component);
|
|
14212
14432
|
const comp = useBridge ? ensureRendererBridge(component) : component;
|
|
14213
|
-
const
|
|
14214
|
-
frag
|
|
14215
|
-
const vnode = frag.vnode = createVNode(comp, rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)));
|
|
14216
|
-
frag.$key = vnode.key;
|
|
14217
|
-
trackFragmentVNodeUpdates(frag, vnode);
|
|
14433
|
+
const vnode = createVNode(comp, rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)));
|
|
14434
|
+
const { frag, syncNodes } = createVNodeFragment(vnode);
|
|
14218
14435
|
if (!isCollectingVdomSlotVNodes && isKeepAliveEnabled && currentKeepAliveCtx) {
|
|
14219
14436
|
currentKeepAliveCtx.processShapeFlag(frag);
|
|
14220
14437
|
if (component.__asyncLoader) {
|
|
@@ -14228,7 +14445,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
14228
14445
|
setCurrentKeepAliveCtx(null);
|
|
14229
14446
|
}
|
|
14230
14447
|
const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, once);
|
|
14231
|
-
if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.
|
|
14448
|
+
if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.rawSlots));
|
|
14232
14449
|
vnode.vi = (instance) => {
|
|
14233
14450
|
instance.props = /* @__PURE__ */ shallowReactive(wrapper.props);
|
|
14234
14451
|
const attrs = createInternalObject();
|
|
@@ -14251,7 +14468,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
14251
14468
|
};
|
|
14252
14469
|
}
|
|
14253
14470
|
});
|
|
14254
|
-
instance.slots = wrapper.
|
|
14471
|
+
instance.slots = wrapper.rawSlots === EMPTY_OBJ ? EMPTY_OBJ : new Proxy(wrapper.rawSlots, vaporSlotsProxyHandler);
|
|
14255
14472
|
};
|
|
14256
14473
|
let rawRef = null;
|
|
14257
14474
|
let isMounted = false;
|
|
@@ -14282,8 +14499,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
14282
14499
|
if (!isHydrating$1) return;
|
|
14283
14500
|
hydrateVNode(vnode, parentComponent);
|
|
14284
14501
|
isMounted = true;
|
|
14285
|
-
|
|
14286
|
-
frag.validityPending = false;
|
|
14502
|
+
syncNodes();
|
|
14287
14503
|
};
|
|
14288
14504
|
vnode.scopeId = getCurrentScopeId() || null;
|
|
14289
14505
|
vnode.slotScopeIds = currentSlotScopeIds;
|
|
@@ -14301,8 +14517,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
|
|
|
14301
14517
|
} else internals.m(vnode, parentNode, anchor, 2, parentComponent);
|
|
14302
14518
|
simpleSetCurrentInstance(prev);
|
|
14303
14519
|
}
|
|
14304
|
-
|
|
14305
|
-
frag.validityPending = false;
|
|
14520
|
+
syncNodes();
|
|
14306
14521
|
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
14307
14522
|
};
|
|
14308
14523
|
frag.remove = unmount;
|
|
@@ -14342,12 +14557,6 @@ function ensureRendererBridge(component) {
|
|
|
14342
14557
|
if (!bridge) rendererBridgeCache.set(component, bridge = (props, { slots }) => createVNode(component, props, slots));
|
|
14343
14558
|
return bridge;
|
|
14344
14559
|
}
|
|
14345
|
-
function trackSlotVNodeUpdates(frag, vnode) {
|
|
14346
|
-
trackSlotVNodeUpdatesWithRefresh(vnode, () => {
|
|
14347
|
-
frag.nodes = resolveVNodeNodes(vnode);
|
|
14348
|
-
if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
14349
|
-
});
|
|
14350
|
-
}
|
|
14351
14560
|
function hasValidVNodeContent(vnode) {
|
|
14352
14561
|
return !!ensureValidVNode(vnode.type === Fragment && isArray(vnode.children) ? vnode.children : [vnode]);
|
|
14353
14562
|
}
|
|
@@ -14355,13 +14564,12 @@ function isSlotOutletOnlyVNode(vnode) {
|
|
|
14355
14564
|
if (vnode.type === VaporSlot) return true;
|
|
14356
14565
|
return vnode.type === Fragment && isArray(vnode.children) && vnode.children.every((child) => isVNode(child) && isSlotOutletOnlyVNode(child));
|
|
14357
14566
|
}
|
|
14358
|
-
function hydrateForwardedEmptySlotFragment(vnode, parentComponent) {
|
|
14567
|
+
function hydrateForwardedEmptySlotFragment(vnode, parentComponent, contentValid) {
|
|
14359
14568
|
if (vnode.type !== Fragment || !isArray(vnode.children)) return false;
|
|
14360
14569
|
const children = vnode.children;
|
|
14361
14570
|
const inheritedEmptySlotEndAnchor = isComment(currentHydrationNode, "]") && isComment(currentHydrationNode.previousSibling, "[") ? currentHydrationNode : null;
|
|
14362
14571
|
const slotEndAnchor = getCurrentSlotEndAnchor() || inheritedEmptySlotEndAnchor;
|
|
14363
14572
|
const slotStartAnchor = slotEndAnchor && slotEndAnchor.previousSibling;
|
|
14364
|
-
const contentValid = hasValidVNodeContent(vnode);
|
|
14365
14573
|
if (!contentValid && currentHydrationNode === slotEndAnchor && slotStartAnchor && isComment(slotStartAnchor, "[")) {
|
|
14366
14574
|
vnode.el = slotStartAnchor;
|
|
14367
14575
|
vnode.anchor = slotEndAnchor;
|
|
@@ -14385,10 +14593,11 @@ function hydrateForwardedEmptySlotFragment(vnode, parentComponent) {
|
|
|
14385
14593
|
if (currentHydrationNode === fragmentEndAnchor) advanceHydrationNode(fragmentEndAnchor);
|
|
14386
14594
|
return true;
|
|
14387
14595
|
}
|
|
14388
|
-
function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
|
|
14596
|
+
function trackSlotVNodeUpdatesWithRefresh(vnode, refresh, beforeUpdate) {
|
|
14389
14597
|
const onUpdated = () => refresh();
|
|
14390
14598
|
const track = (node) => {
|
|
14391
|
-
|
|
14599
|
+
if (beforeUpdate) appendVnodeHook(node, "onVnodeBeforeUpdate", beforeUpdate);
|
|
14600
|
+
appendVnodeHook(node, "onVnodeUpdated", onUpdated);
|
|
14392
14601
|
if (node.type === Fragment && isArray(node.children)) node.children.forEach((child) => {
|
|
14393
14602
|
if (isVNode(child)) track(child);
|
|
14394
14603
|
});
|
|
@@ -14398,73 +14607,81 @@ function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
|
|
|
14398
14607
|
/**
|
|
14399
14608
|
* Mount vdom slot in vapor
|
|
14400
14609
|
*/
|
|
14401
|
-
function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once) {
|
|
14610
|
+
function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once, slotRoot) {
|
|
14402
14611
|
const suspense = parentSuspense || parentComponent.suspense;
|
|
14403
|
-
const frag =
|
|
14404
|
-
|
|
14405
|
-
frag.validityPending = !isHydrating$1;
|
|
14612
|
+
const frag = createInteropFragment();
|
|
14613
|
+
let validityPending = !isHydrating$1;
|
|
14406
14614
|
const instance = currentInstance;
|
|
14407
14615
|
let isMounted = false;
|
|
14408
14616
|
const contentState = {
|
|
14409
|
-
nodes:
|
|
14617
|
+
nodes: EMPTY_BLOCK,
|
|
14410
14618
|
valid: false,
|
|
14411
14619
|
rendered: null
|
|
14412
14620
|
};
|
|
14413
|
-
let currentParentNode;
|
|
14414
|
-
let currentAnchor;
|
|
14621
|
+
let currentParentNode = null;
|
|
14622
|
+
let currentAnchor = null;
|
|
14415
14623
|
let disposed = false;
|
|
14416
14624
|
const scope = effectScope();
|
|
14417
14625
|
const inheritedBoundary = frag.inheritedSlotBoundary;
|
|
14418
14626
|
let isContentUpdateRecheck = false;
|
|
14419
14627
|
let localFallback;
|
|
14420
|
-
let
|
|
14628
|
+
let fallbackState;
|
|
14629
|
+
frag.isBlockValid = () => {
|
|
14630
|
+
if (validityPending) return true;
|
|
14631
|
+
return fallbackState.activeFallback ? isValidBlock(fallbackState.activeFallback) : contentState.valid;
|
|
14632
|
+
};
|
|
14421
14633
|
const boundary = {
|
|
14422
14634
|
get parent() {
|
|
14423
14635
|
return inheritedBoundary;
|
|
14424
14636
|
},
|
|
14425
14637
|
getFallback: () => localFallback,
|
|
14426
|
-
run: (fn) =>
|
|
14427
|
-
markDirty: () => markSlotFallbackDirty(
|
|
14638
|
+
run: (fn) => runWithFragmentCtx(frag, fn),
|
|
14639
|
+
markDirty: () => markSlotFallbackDirty(fallbackState)
|
|
14428
14640
|
};
|
|
14429
|
-
|
|
14641
|
+
fallbackState = {
|
|
14430
14642
|
boundary,
|
|
14431
14643
|
activeFallback: null,
|
|
14432
14644
|
pendingRecheck: false,
|
|
14433
14645
|
isRenderingFallback: false,
|
|
14434
14646
|
getContent: () => contentState.nodes,
|
|
14435
|
-
getParentNode: () =>
|
|
14436
|
-
getAnchor: () => currentAnchor
|
|
14647
|
+
getParentNode: () => currentParentNode,
|
|
14648
|
+
getAnchor: () => currentAnchor,
|
|
14649
|
+
isBusy: () => false,
|
|
14437
14650
|
isDisposed: () => disposed,
|
|
14438
14651
|
isContentValid: () => contentState.valid,
|
|
14439
|
-
|
|
14440
|
-
frag.nodes =
|
|
14652
|
+
syncNodes: () => {
|
|
14653
|
+
frag.nodes = fallbackState.activeFallback || contentState.nodes;
|
|
14441
14654
|
},
|
|
14442
14655
|
notifyFallbackValidityChange: () => {
|
|
14443
|
-
if (!isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
|
|
14656
|
+
if (slotRoot && !isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
|
|
14444
14657
|
}
|
|
14445
14658
|
};
|
|
14659
|
+
if (slotRoot) trackSlotBoundaryDirtying(frag);
|
|
14446
14660
|
localFallback = fallback ? once ? () => withOnceSlot(() => fallback(internals, parentComponent)) : () => fallback(internals, parentComponent) : void 0;
|
|
14447
|
-
const setRenderedContent = (rendered) => {
|
|
14661
|
+
const setRenderedContent = (rendered, knownValid) => {
|
|
14448
14662
|
contentState.rendered = rendered;
|
|
14449
14663
|
if (isVNode(rendered)) {
|
|
14450
14664
|
contentState.nodes = resolveVNodeNodes(rendered);
|
|
14451
|
-
contentState.valid = hasValidVNodeContent(rendered);
|
|
14665
|
+
contentState.valid = knownValid === void 0 ? hasValidVNodeContent(rendered) : knownValid;
|
|
14452
14666
|
} else if (rendered) {
|
|
14453
14667
|
contentState.nodes = rendered;
|
|
14454
|
-
contentState.valid = isValidBlock(rendered);
|
|
14668
|
+
contentState.valid = knownValid === void 0 ? isValidBlock(rendered) : knownValid;
|
|
14455
14669
|
} else {
|
|
14456
|
-
contentState.nodes =
|
|
14670
|
+
contentState.nodes = EMPTY_BLOCK;
|
|
14457
14671
|
contentState.valid = false;
|
|
14458
14672
|
}
|
|
14459
|
-
|
|
14673
|
+
validityPending = false;
|
|
14460
14674
|
};
|
|
14461
14675
|
const notifyUpdated = () => {
|
|
14462
|
-
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((
|
|
14676
|
+
if (isMounted && frag.onUpdated) frag.onUpdated.forEach((u) => u());
|
|
14677
|
+
};
|
|
14678
|
+
const notifyBeforeUpdate = () => {
|
|
14679
|
+
if (isMounted && frag.onBeforeUpdate) frag.onBeforeUpdate.forEach((bu) => bu());
|
|
14463
14680
|
};
|
|
14464
14681
|
const recheckAfterContentUpdate = (forceFallbackRecheck = false) => {
|
|
14465
14682
|
isContentUpdateRecheck = true;
|
|
14466
14683
|
try {
|
|
14467
|
-
recheckSlotFallback(
|
|
14684
|
+
recheckSlotFallback(fallbackState, forceFallbackRecheck);
|
|
14468
14685
|
} finally {
|
|
14469
14686
|
isContentUpdateRecheck = false;
|
|
14470
14687
|
}
|
|
@@ -14475,7 +14692,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14475
14692
|
};
|
|
14476
14693
|
frag.insert = (parentNode, anchor) => {
|
|
14477
14694
|
if (isHydrating$1) return;
|
|
14478
|
-
currentParentNode = parentNode
|
|
14695
|
+
currentParentNode = parentNode;
|
|
14479
14696
|
currentAnchor = anchor;
|
|
14480
14697
|
if (!isMounted) {
|
|
14481
14698
|
scope.run(render);
|
|
@@ -14483,25 +14700,25 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14483
14700
|
} else {
|
|
14484
14701
|
if (isVNode(contentState.rendered)) internals.m(contentState.rendered, parentNode, anchor, 2, parentComponent);
|
|
14485
14702
|
else if (contentState.rendered) insert(contentState.rendered, parentNode, anchor);
|
|
14486
|
-
insertActiveSlotFallback(
|
|
14703
|
+
insertActiveSlotFallback(fallbackState);
|
|
14487
14704
|
}
|
|
14488
14705
|
notifyUpdated();
|
|
14489
14706
|
};
|
|
14490
14707
|
frag.remove = (parentNode) => {
|
|
14491
|
-
|
|
14492
|
-
currentAnchor = currentAnchor || null;
|
|
14708
|
+
if (parentNode) currentParentNode = parentNode;
|
|
14493
14709
|
scope.stop();
|
|
14494
14710
|
disposed = true;
|
|
14495
14711
|
if (isVNode(contentState.rendered)) internals.um(contentState.rendered, parentComponent, null, !!parentNode);
|
|
14496
14712
|
else if (contentState.rendered) remove(contentState.rendered, parentNode);
|
|
14497
|
-
disposeSlotFallback(
|
|
14713
|
+
disposeSlotFallback(fallbackState);
|
|
14498
14714
|
};
|
|
14499
14715
|
const render = () => {
|
|
14500
14716
|
const prev = currentInstance;
|
|
14501
14717
|
simpleSetCurrentInstance(instance);
|
|
14502
14718
|
try {
|
|
14503
14719
|
const renderSlotContent = () => {
|
|
14504
|
-
|
|
14720
|
+
notifyBeforeUpdate();
|
|
14721
|
+
runWithFragmentCtx(frag, () => withOwnedSlotBoundary(boundary, () => {
|
|
14505
14722
|
let slotContent;
|
|
14506
14723
|
let slotContentValid = false;
|
|
14507
14724
|
if (slotsRef.value) {
|
|
@@ -14519,13 +14736,20 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14519
14736
|
if (isVNode(hydratedContent)) {
|
|
14520
14737
|
frag.vnode = hydratedContent;
|
|
14521
14738
|
frag.$key = getVNodeKey(hydratedContent);
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14739
|
+
const refreshSlotVNode = () => {
|
|
14740
|
+
frag.nodes = resolveVNodeNodes(hydratedContent);
|
|
14741
|
+
if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
14742
|
+
};
|
|
14743
|
+
trackSlotVNodeUpdatesWithRefresh(hydratedContent, refreshSlotVNode, slotRoot ? notifyBeforeUpdate : void 0);
|
|
14744
|
+
if (!hydrateForwardedEmptySlotFragment(hydratedContent, parentComponent, slotContentValid)) hydrateVNode(hydratedContent, parentComponent);
|
|
14745
|
+
const hydratedEnd = hydratedContent.anchor;
|
|
14746
|
+
currentParentNode = hydratedEnd.parentNode;
|
|
14747
|
+
currentAnchor = hydratedEnd.nextSibling;
|
|
14748
|
+
setRenderedContent(hydratedContent, slotContentValid);
|
|
14525
14749
|
} else if (hydratedContent) {
|
|
14526
14750
|
frag.vnode = null;
|
|
14527
14751
|
frag.$key = void 0;
|
|
14528
|
-
setRenderedContent(hydratedContent);
|
|
14752
|
+
setRenderedContent(hydratedContent, slotContentValid);
|
|
14529
14753
|
} else {
|
|
14530
14754
|
frag.vnode = null;
|
|
14531
14755
|
frag.$key = void 0;
|
|
@@ -14537,17 +14761,20 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14537
14761
|
if (isVNode(slotContent)) {
|
|
14538
14762
|
frag.vnode = slotContent;
|
|
14539
14763
|
frag.$key = getVNodeKey(slotContent);
|
|
14540
|
-
|
|
14764
|
+
const refreshSlotVNode = () => {
|
|
14541
14765
|
const prevValid = contentState.valid;
|
|
14542
14766
|
const prevOutput = frag.nodes;
|
|
14543
14767
|
setRenderedContent(slotContent);
|
|
14544
14768
|
recheckAfterContentUpdate();
|
|
14545
14769
|
if (contentState.valid !== prevValid || !isSameResolvedOutput(prevOutput, frag.nodes)) notifyUpdated();
|
|
14546
|
-
}
|
|
14770
|
+
};
|
|
14771
|
+
trackSlotVNodeUpdatesWithRefresh(slotContent, refreshSlotVNode, slotRoot ? notifyBeforeUpdate : void 0);
|
|
14547
14772
|
const prevRendered = contentState.rendered;
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14773
|
+
const prevIsVNode = isVNode(prevRendered);
|
|
14774
|
+
const prevVNode = prevIsVNode && (!fallbackState.activeFallback || contentState.valid) ? prevRendered : null;
|
|
14775
|
+
if (prevRendered && !prevIsVNode) remove(prevRendered, currentParentNode);
|
|
14776
|
+
internals.p(prevVNode, slotContent, currentParentNode, currentAnchor, parentComponent, suspense, void 0, slotContent.slotScopeIds);
|
|
14777
|
+
setRenderedContent(slotContent, slotContentValid);
|
|
14551
14778
|
finishContentUpdate();
|
|
14552
14779
|
return;
|
|
14553
14780
|
}
|
|
@@ -14558,7 +14785,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14558
14785
|
if (isVNode(prevRendered)) internals.um(prevRendered, parentComponent, null, true);
|
|
14559
14786
|
else if (prevRendered) remove(prevRendered, currentParentNode);
|
|
14560
14787
|
insert(slotContent, currentParentNode, currentAnchor);
|
|
14561
|
-
setRenderedContent(slotContent);
|
|
14788
|
+
setRenderedContent(slotContent, slotContentValid);
|
|
14562
14789
|
finishContentUpdate();
|
|
14563
14790
|
return;
|
|
14564
14791
|
}
|
|
@@ -14578,23 +14805,25 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
|
|
|
14578
14805
|
frag.hydrate = () => {
|
|
14579
14806
|
if (!isHydrating$1) return;
|
|
14580
14807
|
scope.run(render);
|
|
14581
|
-
currentParentNode
|
|
14582
|
-
|
|
14808
|
+
if (!currentParentNode) {
|
|
14809
|
+
currentAnchor = getCurrentSlotEndAnchor() || currentHydrationNode;
|
|
14810
|
+
currentParentNode = currentAnchor.parentNode;
|
|
14811
|
+
}
|
|
14583
14812
|
isMounted = true;
|
|
14584
14813
|
};
|
|
14585
14814
|
return frag;
|
|
14586
14815
|
}
|
|
14587
|
-
function
|
|
14588
|
-
if (isVaporComponent(block)) return isKeepAlive(block) ||
|
|
14589
|
-
if (isArray(block)) return block.some(
|
|
14590
|
-
if (isFragment(block)) return
|
|
14816
|
+
function needsHostParentForRemove(block) {
|
|
14817
|
+
if (isVaporComponent(block)) return isKeepAlive(block) || needsHostParentForRemove(block.block);
|
|
14818
|
+
if (isArray(block)) return block.some(needsHostParentForRemove);
|
|
14819
|
+
if (isFragment(block)) return needsHostParentForRemove(block.nodes);
|
|
14591
14820
|
return false;
|
|
14592
14821
|
}
|
|
14593
14822
|
const vaporInteropPlugin = (app) => {
|
|
14594
14823
|
enableSuspense();
|
|
14595
14824
|
setInteropEnabled();
|
|
14596
14825
|
const internals = ensureRenderer().internals;
|
|
14597
|
-
app._context.vapor = extend(vaporInteropImpl, {
|
|
14826
|
+
app._context.vapor = extend({}, vaporInteropImpl, {
|
|
14598
14827
|
vdomMount: createVDOMComponent.bind(null, internals),
|
|
14599
14828
|
vdomUnmount: internals.umt,
|
|
14600
14829
|
vdomSlot: renderVDOMSlot.bind(null, internals),
|
|
@@ -14617,30 +14846,17 @@ function createFallback(fallback, parentComponent, isVNodeFallback) {
|
|
|
14617
14846
|
const internals = ensureRenderer().internals;
|
|
14618
14847
|
return () => {
|
|
14619
14848
|
if (isVNodeFallback()) {
|
|
14620
|
-
const frag = createVNodeChildrenFragment(internals, () =>
|
|
14849
|
+
const frag = createVNodeChildrenFragment(internals, () => {
|
|
14850
|
+
const children = fallback();
|
|
14851
|
+
return children == null ? EMPTY_VNODES : normalizeInteropSlotValue(children);
|
|
14852
|
+
}, parentComponent);
|
|
14621
14853
|
if (isHydrating$1 && frag.hydrate) frag.hydrate();
|
|
14622
14854
|
return frag;
|
|
14623
14855
|
}
|
|
14624
14856
|
return fallback();
|
|
14625
14857
|
};
|
|
14626
14858
|
}
|
|
14627
|
-
const renderEmptyVNodes = () =>
|
|
14628
|
-
function runWithFragmentRenderCtx(fragment, fn) {
|
|
14629
|
-
const prevSlotOwner = setCurrentSlotOwner(fragment.slotOwner);
|
|
14630
|
-
let prevKeepAliveCtx = null;
|
|
14631
|
-
if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(fragment.keepAliveCtx || null);
|
|
14632
|
-
try {
|
|
14633
|
-
return withOwnedSlotBoundary(fragment.inheritedSlotBoundary, fn);
|
|
14634
|
-
} finally {
|
|
14635
|
-
if (isKeepAliveEnabled) setCurrentKeepAliveCtx(prevKeepAliveCtx);
|
|
14636
|
-
setCurrentSlotOwner(prevSlotOwner);
|
|
14637
|
-
}
|
|
14638
|
-
}
|
|
14639
|
-
function getSlotFallbackParentNode(currentParentNode, content) {
|
|
14640
|
-
if (currentParentNode) return currentParentNode;
|
|
14641
|
-
const carrierAnchor = findFirstSlotFallbackCarrierNode(content);
|
|
14642
|
-
return carrierAnchor ? carrierAnchor.parentNode : null;
|
|
14643
|
-
}
|
|
14859
|
+
const renderEmptyVNodes = () => EMPTY_VNODES;
|
|
14644
14860
|
function resolveInteropVaporSlotState(vnode) {
|
|
14645
14861
|
const slot = vnode.vs;
|
|
14646
14862
|
let state = slot.state;
|
|
@@ -14688,12 +14904,14 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14688
14904
|
simpleSetCurrentInstance(parentComponent);
|
|
14689
14905
|
if (isSuspenseEnabled && parentSuspense) prevSuspense = setParentSuspense(parentSuspense);
|
|
14690
14906
|
try {
|
|
14691
|
-
if (!vnode.vs || !vnode.vs.slot) return
|
|
14907
|
+
if (!vnode.vs || !vnode.vs.slot) return EMPTY_BLOCK;
|
|
14692
14908
|
const slotState = resolveInteropVaporSlotState(vnode);
|
|
14693
|
-
const
|
|
14694
|
-
frag
|
|
14909
|
+
const scopeIds = getInteropVaporSlotScopeIds(vnode, parentComponent);
|
|
14910
|
+
const frag = createInteropFragment();
|
|
14911
|
+
let validityPending = !isHydrating$1;
|
|
14912
|
+
frag.isBlockValid = () => validityPending ? true : isValidBlock(frag.nodes);
|
|
14695
14913
|
const inheritedBoundary = frag.inheritedSlotBoundary;
|
|
14696
|
-
let contentNodes =
|
|
14914
|
+
let contentNodes = EMPTY_BLOCK;
|
|
14697
14915
|
let isResolvingContent = false;
|
|
14698
14916
|
let localFallback;
|
|
14699
14917
|
let outletFallback;
|
|
@@ -14701,13 +14919,13 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14701
14919
|
let currentAnchor = null;
|
|
14702
14920
|
let slotScope;
|
|
14703
14921
|
let disposed = false;
|
|
14704
|
-
let
|
|
14922
|
+
let fallbackState;
|
|
14705
14923
|
let ownedSlotFragment;
|
|
14706
14924
|
let ownedSlotFragmentDirtyQueued = false;
|
|
14707
14925
|
const markInteropFallbackDirty = () => {
|
|
14708
14926
|
const target = ownedSlotFragment;
|
|
14709
14927
|
if (!target) {
|
|
14710
|
-
markSlotFallbackDirty(
|
|
14928
|
+
markSlotFallbackDirty(fallbackState);
|
|
14711
14929
|
return;
|
|
14712
14930
|
}
|
|
14713
14931
|
if (ownedSlotFragmentDirtyQueued) return;
|
|
@@ -14715,7 +14933,6 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14715
14933
|
queuePostFlushCb(() => {
|
|
14716
14934
|
ownedSlotFragmentDirtyQueued = false;
|
|
14717
14935
|
markSlotFallbackDirty(target);
|
|
14718
|
-
syncActiveSlotFallback(target);
|
|
14719
14936
|
});
|
|
14720
14937
|
};
|
|
14721
14938
|
const outletFallbackBoundary = {
|
|
@@ -14723,7 +14940,7 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14723
14940
|
return inheritedBoundary;
|
|
14724
14941
|
},
|
|
14725
14942
|
getFallback: () => slotState.outletFallback.value ? outletFallback : void 0,
|
|
14726
|
-
run: (fn) =>
|
|
14943
|
+
run: (fn) => runWithFragmentCtx(frag, fn),
|
|
14727
14944
|
markDirty: markInteropFallbackDirty
|
|
14728
14945
|
};
|
|
14729
14946
|
const localFallbackBoundary = {
|
|
@@ -14731,37 +14948,38 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14731
14948
|
return outletFallbackBoundary;
|
|
14732
14949
|
},
|
|
14733
14950
|
getFallback: () => slotState.localFallback.value ? localFallback : void 0,
|
|
14734
|
-
run: (fn) =>
|
|
14951
|
+
run: (fn) => runWithFragmentCtx(frag, fn),
|
|
14735
14952
|
markDirty: markInteropFallbackDirty
|
|
14736
14953
|
};
|
|
14737
|
-
|
|
14954
|
+
fallbackState = {
|
|
14738
14955
|
boundary: localFallbackBoundary,
|
|
14739
14956
|
activeFallback: null,
|
|
14740
14957
|
pendingRecheck: false,
|
|
14741
14958
|
isRenderingFallback: false,
|
|
14742
14959
|
getContent: () => contentNodes,
|
|
14743
|
-
getParentNode: () =>
|
|
14960
|
+
getParentNode: () => currentParentNode,
|
|
14744
14961
|
getAnchor: () => currentAnchor,
|
|
14745
14962
|
isBusy: () => isResolvingContent,
|
|
14746
14963
|
isDisposed: () => disposed,
|
|
14747
|
-
|
|
14748
|
-
|
|
14749
|
-
frag.
|
|
14964
|
+
isContentValid: () => isValidBlock(contentNodes),
|
|
14965
|
+
syncNodes: () => {
|
|
14966
|
+
frag.nodes = fallbackState.activeFallback || contentNodes;
|
|
14967
|
+
validityPending = false;
|
|
14750
14968
|
},
|
|
14751
14969
|
notifyFallbackValidityChange: () => {
|
|
14752
14970
|
if (inheritedBoundary) inheritedBoundary.markDirty();
|
|
14753
14971
|
}
|
|
14754
14972
|
};
|
|
14755
14973
|
const takePendingRecheck = () => {
|
|
14756
|
-
const shouldRecheck =
|
|
14757
|
-
|
|
14974
|
+
const shouldRecheck = fallbackState.pendingRecheck;
|
|
14975
|
+
fallbackState.pendingRecheck = false;
|
|
14758
14976
|
return shouldRecheck;
|
|
14759
14977
|
};
|
|
14760
14978
|
const dispose = (parentNode) => {
|
|
14761
14979
|
if (disposed) return;
|
|
14762
|
-
currentParentNode = parentNode
|
|
14980
|
+
if (parentNode) currentParentNode = parentNode;
|
|
14763
14981
|
disposed = true;
|
|
14764
|
-
disposeSlotFallback(
|
|
14982
|
+
disposeSlotFallback(fallbackState);
|
|
14765
14983
|
slotScope = void 0;
|
|
14766
14984
|
currentParentNode = null;
|
|
14767
14985
|
currentAnchor = null;
|
|
@@ -14769,22 +14987,23 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14769
14987
|
try {
|
|
14770
14988
|
localFallback = createFallback(() => (slotState.localFallback.value || renderEmptyVNodes)(), parentComponent, () => !!slotState.localFallback.value && !!slotState.localFallback.value.__vdom);
|
|
14771
14989
|
outletFallback = createFallback(() => (slotState.outletFallback.value || renderEmptyVNodes)(), parentComponent, () => !!slotState.outletFallback.value && !!slotState.outletFallback.value.__vdom);
|
|
14772
|
-
const
|
|
14773
|
-
|
|
14990
|
+
const hasInteropFallback = !!slotState.localFallback.value || !!slotState.outletFallback.value;
|
|
14991
|
+
fallbackState.pendingRecheck = false;
|
|
14774
14992
|
const finalizeResolvedContent = (resolvedContent) => {
|
|
14775
|
-
if (
|
|
14776
|
-
|
|
14777
|
-
|
|
14993
|
+
if (resolvedContent && scopeIds) setScopeId(resolvedContent, scopeIds);
|
|
14994
|
+
if (hasInteropFallback && resolvedContent instanceof SlotFragment) return resolvedContent;
|
|
14995
|
+
contentNodes = resolvedContent || EMPTY_BLOCK;
|
|
14996
|
+
recheckSlotFallback(fallbackState, takePendingRecheck());
|
|
14778
14997
|
return resolvedContent;
|
|
14779
14998
|
};
|
|
14780
14999
|
let resolvedContent;
|
|
14781
15000
|
isResolvingContent = true;
|
|
14782
15001
|
try {
|
|
14783
|
-
if (isHydrating$1) resolvedContent = withHydratingSlotBoundary(() => finalizeResolvedContent(
|
|
15002
|
+
if (isHydrating$1) resolvedContent = withHydratingSlotBoundary(() => finalizeResolvedContent(runWithFragmentCtx(frag, () => {
|
|
14784
15003
|
const renderSlot = () => withOwnedSlotBoundary(localFallbackBoundary, () => invokeVaporSlot(vnode));
|
|
14785
15004
|
return hasSlotFallback(localFallbackBoundary) ? withHydratingSlotFallbackActive(renderSlot) : renderSlot();
|
|
14786
15005
|
})));
|
|
14787
|
-
else resolvedContent = finalizeResolvedContent(
|
|
15006
|
+
else resolvedContent = finalizeResolvedContent(runWithFragmentCtx(frag, () => withOwnedSlotBoundary(localFallbackBoundary, () => invokeVaporSlot(vnode))));
|
|
14788
15007
|
} finally {
|
|
14789
15008
|
isResolvingContent = false;
|
|
14790
15009
|
}
|
|
@@ -14795,30 +15014,30 @@ function renderVaporSlot(vnode, parentComponent, parentSuspense) {
|
|
|
14795
15014
|
onScopeDispose(() => dispose(), true);
|
|
14796
15015
|
});
|
|
14797
15016
|
}
|
|
14798
|
-
if (
|
|
15017
|
+
if (hasInteropFallback && resolvedContent instanceof SlotFragment) {
|
|
14799
15018
|
ownedSlotFragment = resolvedContent;
|
|
14800
15019
|
trackInteropFallbackChanges(vnode.vs.scope, slotState, () => markInteropFallbackDirty());
|
|
14801
15020
|
dispose();
|
|
14802
15021
|
return resolvedContent;
|
|
14803
15022
|
}
|
|
14804
|
-
|
|
15023
|
+
fallbackState.pendingRecheck = false;
|
|
14805
15024
|
frag.insert = (parentNode, anchor) => {
|
|
14806
15025
|
currentParentNode = parentNode;
|
|
14807
15026
|
currentAnchor = anchor;
|
|
14808
|
-
if (
|
|
14809
|
-
|
|
14810
|
-
mutateSlotFallbackCarrier(contentNodes, (block) => insert(block, parentNode, anchor));
|
|
14811
|
-
} else insert(frag.nodes, parentNode, anchor);
|
|
15027
|
+
if (fallbackState.activeFallback) insertActiveSlotFallback(fallbackState);
|
|
15028
|
+
else insert(frag.nodes, parentNode, anchor);
|
|
14812
15029
|
};
|
|
14813
15030
|
frag.remove = (parentNode) => {
|
|
14814
|
-
if (
|
|
14815
|
-
else remove(frag.nodes, parentNode);
|
|
15031
|
+
if (!fallbackState.activeFallback) remove(frag.nodes, parentNode);
|
|
14816
15032
|
dispose(parentNode);
|
|
14817
15033
|
};
|
|
14818
15034
|
trackInteropFallbackChanges(vnode.vs.scope, slotState, () => {
|
|
14819
|
-
recheckSlotFallback(
|
|
14820
|
-
syncActiveSlotFallback(outlet);
|
|
15035
|
+
recheckSlotFallback(fallbackState, true);
|
|
14821
15036
|
});
|
|
15037
|
+
if (isHydrating$1 && currentHydrationNode) {
|
|
15038
|
+
currentAnchor = currentHydrationNode;
|
|
15039
|
+
currentParentNode = currentAnchor.parentNode;
|
|
15040
|
+
}
|
|
14822
15041
|
return frag;
|
|
14823
15042
|
} catch (e) {
|
|
14824
15043
|
dispose();
|
|
@@ -14894,24 +15113,24 @@ function ensureVNodeHookState(instance, vnode) {
|
|
|
14894
15113
|
}
|
|
14895
15114
|
function createVNodeChildrenFragment(internals, render, parentComponent) {
|
|
14896
15115
|
const suspense = parentSuspense || parentComponent && parentComponent.suspense;
|
|
14897
|
-
const frag =
|
|
15116
|
+
const frag = createInteropFragment();
|
|
14898
15117
|
let contentValid = false;
|
|
14899
|
-
|
|
14900
|
-
frag.isBlockValid = () =>
|
|
15118
|
+
let validityPending = !isHydrating$1;
|
|
15119
|
+
frag.isBlockValid = () => validityPending ? true : contentValid;
|
|
14901
15120
|
let currentVNode = null;
|
|
14902
|
-
let currentChildren =
|
|
15121
|
+
let currentChildren = EMPTY_VNODES;
|
|
14903
15122
|
let currentParentNode = null;
|
|
14904
15123
|
let currentAnchor = null;
|
|
14905
15124
|
let isMounted = false;
|
|
14906
15125
|
let isRenderEffectStarted = false;
|
|
14907
15126
|
const scope = effectScope();
|
|
14908
15127
|
const syncResolvedNodes = (children = currentChildren) => {
|
|
14909
|
-
const prevValid =
|
|
15128
|
+
const prevValid = validityPending ? true : contentValid;
|
|
14910
15129
|
contentValid = !!ensureValidVNode(children);
|
|
14911
|
-
if (children.length === 0) frag.nodes =
|
|
15130
|
+
if (children.length === 0) frag.nodes = EMPTY_BLOCK;
|
|
14912
15131
|
else if (children.length === 1) frag.nodes = resolveVNodeNodes(children[0]);
|
|
14913
15132
|
else frag.nodes = children.map(resolveVNodeNodes);
|
|
14914
|
-
|
|
15133
|
+
validityPending = false;
|
|
14915
15134
|
return prevValid !== contentValid;
|
|
14916
15135
|
};
|
|
14917
15136
|
const notifyUpdated = (validityChanged = false) => {
|
|
@@ -14923,7 +15142,7 @@ function createVNodeChildrenFragment(internals, render, parentComponent) {
|
|
|
14923
15142
|
simpleSetCurrentInstance(parentComponent);
|
|
14924
15143
|
try {
|
|
14925
15144
|
renderEffect(() => {
|
|
14926
|
-
|
|
15145
|
+
runWithFragmentCtx(frag, () => {
|
|
14927
15146
|
const nextChildren = render();
|
|
14928
15147
|
if (isHydrating$1) {
|
|
14929
15148
|
nextChildren.forEach((vnode) => hydrateVNode(vnode, parentComponent));
|
|
@@ -14935,8 +15154,9 @@ function createVNodeChildrenFragment(internals, render, parentComponent) {
|
|
|
14935
15154
|
} else if (!isMounted) {
|
|
14936
15155
|
currentChildren = nextChildren;
|
|
14937
15156
|
currentVNode = createVNode(Fragment, null, nextChildren);
|
|
14938
|
-
|
|
14939
|
-
|
|
15157
|
+
const wasPending = validityPending;
|
|
15158
|
+
const validityChanged = syncResolvedNodes(nextChildren);
|
|
15159
|
+
if (!wasPending) notifyUpdated(validityChanged);
|
|
14940
15160
|
return;
|
|
14941
15161
|
} else if (!currentVNode) {
|
|
14942
15162
|
currentChildren = nextChildren;
|
|
@@ -15022,7 +15242,23 @@ function normalizeInteropSlots(rawSlots) {
|
|
|
15022
15242
|
});
|
|
15023
15243
|
return normalized;
|
|
15024
15244
|
}
|
|
15245
|
+
const interopSlotCache = /* @__PURE__ */ new WeakMap();
|
|
15025
15246
|
function normalizeInteropSlot(rawSlot, ctx) {
|
|
15247
|
+
let cache = interopSlotCache.get(rawSlot);
|
|
15248
|
+
if (!cache) interopSlotCache.set(rawSlot, cache = {});
|
|
15249
|
+
if (ctx) {
|
|
15250
|
+
let ctxCache = cache.ctx;
|
|
15251
|
+
if (!ctxCache) cache.ctx = ctxCache = /* @__PURE__ */ new WeakMap();
|
|
15252
|
+
const cached = ctxCache.get(ctx);
|
|
15253
|
+
if (cached) return cached;
|
|
15254
|
+
const normalized = createNormalizedInteropSlot(rawSlot, ctx);
|
|
15255
|
+
ctxCache.set(ctx, normalized);
|
|
15256
|
+
return normalized;
|
|
15257
|
+
}
|
|
15258
|
+
if (cache.noCtx) return cache.noCtx;
|
|
15259
|
+
return cache.noCtx = createNormalizedInteropSlot(rawSlot, ctx);
|
|
15260
|
+
}
|
|
15261
|
+
function createNormalizedInteropSlot(rawSlot, ctx) {
|
|
15026
15262
|
const normalized = withCtx((...args) => normalizeInteropSlotValue(rawSlot(...args)), ctx);
|
|
15027
15263
|
normalized._c = false;
|
|
15028
15264
|
return normalized;
|
|
@@ -15036,7 +15272,7 @@ function normalizeInteropDefaultSlot(value) {
|
|
|
15036
15272
|
function normalizeInteropSlotValue(value) {
|
|
15037
15273
|
return isArray(value) ? value.map((child) => normalizeVNode(child)) : [normalizeVNode(value)];
|
|
15038
15274
|
}
|
|
15039
|
-
const isInternalSlotKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
15275
|
+
const isInternalSlotKey = (key) => key === "_" || key === "_ctx" || key === "$stable" || key === "$";
|
|
15040
15276
|
const interopSlotsSourceHandlers = {
|
|
15041
15277
|
get(target, key) {
|
|
15042
15278
|
const slots = target.value;
|
|
@@ -15048,7 +15284,7 @@ const interopSlotsSourceHandlers = {
|
|
|
15048
15284
|
},
|
|
15049
15285
|
ownKeys(target) {
|
|
15050
15286
|
const slots = target.value;
|
|
15051
|
-
return slots ? Object.keys(slots).filter((key) => !isInternalSlotKey(key)) :
|
|
15287
|
+
return slots ? Object.keys(slots).filter((key) => !isInternalSlotKey(key)) : EMPTY_ARR;
|
|
15052
15288
|
},
|
|
15053
15289
|
getOwnPropertyDescriptor(target, key) {
|
|
15054
15290
|
const slots = target.value;
|
|
@@ -15088,11 +15324,27 @@ function setInteropVnodeScopeId(instance, vnode, parentComponent) {
|
|
|
15088
15324
|
}
|
|
15089
15325
|
if (interopScopeIdRootMap.get(instance) === root) return;
|
|
15090
15326
|
interopScopeIdRootMap.set(instance, root);
|
|
15327
|
+
const scopeIds = getInteropVnodeScopeIds(vnode, parentComponent);
|
|
15328
|
+
if (!scopeIds) return;
|
|
15329
|
+
for (let i = 0; i < scopeIds.length; i++) root.setAttribute(scopeIds[i], "");
|
|
15330
|
+
}
|
|
15331
|
+
function getInteropVnodeScopeIds(vnode, parentComponent) {
|
|
15091
15332
|
const scopeIds = [];
|
|
15092
15333
|
if (vnode.scopeId) scopeIds.push(vnode.scopeId);
|
|
15093
15334
|
if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
|
|
15094
15335
|
scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
|
|
15095
|
-
|
|
15336
|
+
return scopeIds.length ? scopeIds : void 0;
|
|
15337
|
+
}
|
|
15338
|
+
function getInteropVaporSlotScopeIds(vnode, parentComponent) {
|
|
15339
|
+
const scopeIds = [];
|
|
15340
|
+
if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
|
|
15341
|
+
scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
|
|
15342
|
+
return scopeIds.length ? scopeIds : void 0;
|
|
15343
|
+
}
|
|
15344
|
+
function createInteropFragment(nodes = EMPTY_BLOCK, vnode = null) {
|
|
15345
|
+
const frag = new VaporFragment(nodes);
|
|
15346
|
+
frag.vnode = vnode;
|
|
15347
|
+
return frag;
|
|
15096
15348
|
}
|
|
15097
15349
|
//#endregion
|
|
15098
15350
|
//#region packages/runtime-vapor/src/components/Teleport.ts
|
|
@@ -15107,28 +15359,29 @@ const VaporTeleportImpl = {
|
|
|
15107
15359
|
var TeleportFragment = class extends VaporFragment {
|
|
15108
15360
|
constructor(props, slots) {
|
|
15109
15361
|
super([]);
|
|
15110
|
-
this.
|
|
15111
|
-
this.isMounted = false;
|
|
15362
|
+
this.__tf = true;
|
|
15112
15363
|
this.childrenInitialized = false;
|
|
15113
|
-
this.ownerInstance = currentInstance;
|
|
15114
15364
|
this.childrenScope = getCurrentScope();
|
|
15365
|
+
this.mountState = { location: 0 };
|
|
15115
15366
|
this.insert = (container, anchor) => {
|
|
15116
15367
|
if (isHydrating$1) return;
|
|
15368
|
+
const wasMountedInTarget = this.mountState.location === 2;
|
|
15117
15369
|
if (!this.placeholder) this.placeholder = /* @__PURE__ */ createComment("teleport start");
|
|
15118
15370
|
insert(this.placeholder, container, anchor);
|
|
15119
15371
|
insert(this.anchor, container, anchor);
|
|
15120
|
-
this.handlePropsUpdate();
|
|
15372
|
+
if (!wasMountedInTarget) this.handlePropsUpdate();
|
|
15121
15373
|
};
|
|
15122
15374
|
this.dispose = () => {
|
|
15123
15375
|
if (this.mountToTargetJob) {
|
|
15124
15376
|
this.mountToTargetJob.flags |= 4;
|
|
15125
15377
|
this.mountToTargetJob = void 0;
|
|
15126
15378
|
}
|
|
15127
|
-
|
|
15128
|
-
|
|
15379
|
+
const mountState = this.mountState;
|
|
15380
|
+
if (this.nodes && mountState.location !== 0) {
|
|
15381
|
+
remove(this.nodes, mountState.container);
|
|
15129
15382
|
this.nodes = [];
|
|
15130
15383
|
}
|
|
15131
|
-
this.
|
|
15384
|
+
this.mountState = { location: 0 };
|
|
15132
15385
|
if (this.targetStart) {
|
|
15133
15386
|
remove(this.targetStart, /* @__PURE__ */ parentNode(this.targetStart));
|
|
15134
15387
|
this.targetStart = void 0;
|
|
@@ -15138,8 +15391,6 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15138
15391
|
this.targetAnchor = void 0;
|
|
15139
15392
|
}
|
|
15140
15393
|
this.target = void 0;
|
|
15141
|
-
this.mountContainer = void 0;
|
|
15142
|
-
this.mountAnchor = void 0;
|
|
15143
15394
|
};
|
|
15144
15395
|
this.remove = (_parent) => {
|
|
15145
15396
|
this.dispose();
|
|
@@ -15162,26 +15413,28 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15162
15413
|
if (disabled) this.hydrateDisabledTeleport(target, targetNode);
|
|
15163
15414
|
else {
|
|
15164
15415
|
this.anchor = markHydrationAnchor(locateTeleportEndAnchor(currentHydrationNode.nextSibling));
|
|
15165
|
-
this.mountContainer = target;
|
|
15166
15416
|
this.hydrateTargetAnchors(target, targetNode);
|
|
15167
|
-
this.
|
|
15417
|
+
this.mountState = {
|
|
15418
|
+
location: 2,
|
|
15419
|
+
container: target,
|
|
15420
|
+
anchor: this.targetAnchor || null
|
|
15421
|
+
};
|
|
15168
15422
|
if (targetNode) setCurrentHydrationNode(targetNode.nextSibling);
|
|
15169
15423
|
if (!this.targetAnchor) this.mountChildren(target);
|
|
15170
15424
|
else this.initChildren();
|
|
15171
15425
|
}
|
|
15172
15426
|
} else if (disabled) this.hydrateDisabledTeleport(null, null);
|
|
15173
15427
|
else this.anchor = markHydrationAnchor(locateTeleportEndAnchor(currentHydrationNode.nextSibling));
|
|
15174
|
-
if (target || disabled) updateCssVars(
|
|
15428
|
+
if (target || disabled) this.updateCssVars();
|
|
15175
15429
|
advanceHydrationNode(this.anchor);
|
|
15176
15430
|
};
|
|
15177
|
-
this.rawProps = props;
|
|
15178
15431
|
this.rawSlots = slots;
|
|
15179
|
-
this.parentComponent = getScopeOwner();
|
|
15180
15432
|
this.anchor = isHydrating$1 ? void 0 : /* @__PURE__ */ createComment("teleport end");
|
|
15433
|
+
const propsProxy = new Proxy(props, rawPropsProxyHandlers);
|
|
15181
15434
|
renderEffect(() => {
|
|
15182
15435
|
const prevTo = this.resolvedProps && this.resolvedProps.to;
|
|
15183
15436
|
const wasDisabled = this.isDisabled;
|
|
15184
|
-
this.resolvedProps = extend({},
|
|
15437
|
+
this.resolvedProps = extend({}, propsProxy);
|
|
15185
15438
|
this.isDisabled = isTeleportDisabled(this.resolvedProps);
|
|
15186
15439
|
if (wasDisabled !== this.isDisabled || !this.isDisabled && prevTo !== this.resolvedProps.to) this.handlePropsUpdate();
|
|
15187
15440
|
});
|
|
@@ -15189,8 +15442,11 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15189
15442
|
get parent() {
|
|
15190
15443
|
return this.anchor ? /* @__PURE__ */ parentNode(this.anchor) : null;
|
|
15191
15444
|
}
|
|
15445
|
+
get scopeOwner() {
|
|
15446
|
+
return this.slotOwner || this.renderInstance;
|
|
15447
|
+
}
|
|
15192
15448
|
initChildren() {
|
|
15193
|
-
const prevInstance = setCurrentInstance(this.
|
|
15449
|
+
const prevInstance = setCurrentInstance(this.renderInstance, this.childrenScope);
|
|
15194
15450
|
try {
|
|
15195
15451
|
this.childrenInitialized = true;
|
|
15196
15452
|
renderEffect(() => this.runWithRenderCtx(() => this.handleChildrenUpdate(this.rawSlots && this.rawSlots.default ? this.rawSlots.default() : []), this.childrenScope));
|
|
@@ -15204,76 +15460,87 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15204
15460
|
}
|
|
15205
15461
|
registerUpdateCssVars(block) {
|
|
15206
15462
|
if (isFragment(block)) {
|
|
15207
|
-
(block.onUpdated || (block.onUpdated = [])).push(() => updateCssVars(
|
|
15463
|
+
(block.onUpdated || (block.onUpdated = [])).push(() => this.updateCssVars());
|
|
15208
15464
|
this.registerUpdateCssVars(block.nodes);
|
|
15209
15465
|
} else if (isVaporComponent(block)) this.registerUpdateCssVars(block.block);
|
|
15210
15466
|
else if (isArray(block)) block.forEach((node) => this.registerUpdateCssVars(node));
|
|
15211
15467
|
}
|
|
15212
15468
|
bindChildren(block) {
|
|
15213
|
-
|
|
15214
|
-
if (
|
|
15215
|
-
else if (isArray(block)) block.forEach((node) => isVaporComponent(node) && (node.parentTeleport = this));
|
|
15469
|
+
const scopeOwner = this.scopeOwner;
|
|
15470
|
+
if (scopeOwner && scopeOwner.ut) this.registerUpdateCssVars(block);
|
|
15216
15471
|
}
|
|
15217
15472
|
handleChildrenUpdate(children) {
|
|
15218
|
-
|
|
15473
|
+
const mountState = this.mountState;
|
|
15474
|
+
if (isHydrating$1 || !this.parent || mountState.location === 0) {
|
|
15219
15475
|
this.nodes = children;
|
|
15220
15476
|
return;
|
|
15221
15477
|
}
|
|
15222
|
-
remove(this.nodes,
|
|
15223
|
-
|
|
15478
|
+
remove(this.nodes, mountState.container);
|
|
15479
|
+
this.nodes = children;
|
|
15480
|
+
const onBeforeInsert = this.onBeforeInsert;
|
|
15481
|
+
if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(this.nodes));
|
|
15482
|
+
insert(children, mountState.container, mountState.anchor);
|
|
15224
15483
|
this.bindChildren(this.nodes);
|
|
15225
|
-
updateCssVars(
|
|
15484
|
+
this.updateCssVars();
|
|
15226
15485
|
}
|
|
15227
|
-
mount(parent, anchor) {
|
|
15228
|
-
if (isTransitionEnabled && this.$transition &&
|
|
15229
|
-
if (this.
|
|
15486
|
+
mount(parent, anchor, location) {
|
|
15487
|
+
if (isTransitionEnabled && this.$transition && this.mountState.location === 0) applyTransitionHooks(this.nodes, this.$transition);
|
|
15488
|
+
if (this.mountState.location !== 0) move(this.nodes, parent, anchor, 2);
|
|
15230
15489
|
else {
|
|
15231
|
-
|
|
15232
|
-
|
|
15490
|
+
const onBeforeInsert = this.onBeforeInsert;
|
|
15491
|
+
if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(this.nodes));
|
|
15492
|
+
insert(this.nodes, parent, anchor);
|
|
15493
|
+
}
|
|
15494
|
+
this.mountState = {
|
|
15495
|
+
location,
|
|
15496
|
+
container: parent,
|
|
15497
|
+
anchor
|
|
15498
|
+
};
|
|
15499
|
+
this.updateCssVars();
|
|
15500
|
+
}
|
|
15501
|
+
prepareTargetAnchors(target) {
|
|
15502
|
+
if (!this.targetAnchor || /* @__PURE__ */ parentNode(this.targetAnchor) !== target) {
|
|
15503
|
+
if (this.targetStart) remove(this.targetStart, /* @__PURE__ */ parentNode(this.targetStart));
|
|
15504
|
+
if (this.targetAnchor) remove(this.targetAnchor, /* @__PURE__ */ parentNode(this.targetAnchor));
|
|
15505
|
+
insert(this.targetStart = /* @__PURE__ */ createTextNode(""), target);
|
|
15506
|
+
insert(this.targetAnchor = /* @__PURE__ */ createTextNode(""), target);
|
|
15233
15507
|
}
|
|
15234
|
-
updateCssVars(this);
|
|
15235
15508
|
}
|
|
15236
|
-
|
|
15509
|
+
prepareTarget() {
|
|
15237
15510
|
const target = this.target = resolveTarget(this.resolvedProps, querySelector);
|
|
15238
15511
|
if (target) {
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15512
|
+
this.prepareTargetAnchors(target);
|
|
15513
|
+
const scopeOwner = this.scopeOwner;
|
|
15514
|
+
if (scopeOwner && scopeOwner.isCE) (scopeOwner.ce._teleportTargets || (scopeOwner.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
|
|
15515
|
+
}
|
|
15516
|
+
return target;
|
|
15517
|
+
}
|
|
15518
|
+
queueTargetUpdate() {
|
|
15519
|
+
if (!this.mountToTargetJob || this.mountToTargetJob.flags & 4) this.mountToTargetJob = () => {
|
|
15520
|
+
this.mountToTargetJob = void 0;
|
|
15521
|
+
if (!this.anchor) return;
|
|
15522
|
+
if (this.isDisabled) {
|
|
15523
|
+
if (!this.targetAnchor) this.prepareTarget();
|
|
15524
|
+
} else this.mountToTarget();
|
|
15525
|
+
};
|
|
15526
|
+
queuePostFlushCb(this.mountToTargetJob);
|
|
15527
|
+
}
|
|
15528
|
+
mountToTarget() {
|
|
15529
|
+
const target = this.prepareTarget();
|
|
15530
|
+
if (target) {
|
|
15245
15531
|
this.ensureChildrenInitialized();
|
|
15246
|
-
|
|
15247
|
-
this.mount(target, this.targetAnchor);
|
|
15532
|
+
this.mount(target, this.targetAnchor, 2);
|
|
15248
15533
|
} else warn(`Invalid Teleport target on ${this.targetAnchor ? "update" : "mount"}:`, target, `(${typeof target})`);
|
|
15249
15534
|
}
|
|
15250
|
-
clearMainViewChildren() {
|
|
15251
|
-
if (!this.placeholder || !this.anchor) return;
|
|
15252
|
-
let node = this.placeholder.nextSibling;
|
|
15253
|
-
while (node && node !== this.anchor) {
|
|
15254
|
-
const next = node.nextSibling;
|
|
15255
|
-
remove(node, /* @__PURE__ */ parentNode(node));
|
|
15256
|
-
node = next;
|
|
15257
|
-
}
|
|
15258
|
-
this.isMounted = false;
|
|
15259
|
-
this.mountContainer = null;
|
|
15260
|
-
}
|
|
15261
15535
|
handlePropsUpdate() {
|
|
15262
15536
|
if (!this.parent || isHydrating$1) return;
|
|
15263
15537
|
if (this.isDisabled) {
|
|
15264
15538
|
this.ensureChildrenInitialized();
|
|
15265
|
-
this.mount(this.parent, this.anchor);
|
|
15266
|
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
this.mountToTargetJob = void 0;
|
|
15271
|
-
if (this.isDisabled || !this.anchor) return;
|
|
15272
|
-
this.mountToTarget();
|
|
15273
|
-
};
|
|
15274
|
-
queuePostFlushCb(this.mountToTargetJob);
|
|
15275
|
-
} else this.mountToTarget();
|
|
15276
|
-
}
|
|
15539
|
+
this.mount(this.parent, this.anchor, 1);
|
|
15540
|
+
if (!this.targetAnchor) if (isTeleportDeferred(this.resolvedProps) || !this.parent.isConnected) this.queueTargetUpdate();
|
|
15541
|
+
else this.prepareTarget();
|
|
15542
|
+
} else if (isTeleportDeferred(this.resolvedProps) || !this.parent.isConnected) this.queueTargetUpdate();
|
|
15543
|
+
else this.mountToTarget();
|
|
15277
15544
|
}
|
|
15278
15545
|
hydrateTargetAnchors(target, targetNode) {
|
|
15279
15546
|
let targetAnchor = targetNode;
|
|
@@ -15293,8 +15560,12 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15293
15560
|
if (!isHydrating$1) return;
|
|
15294
15561
|
let nextNode = this.placeholder.nextSibling;
|
|
15295
15562
|
setCurrentHydrationNode(nextNode);
|
|
15296
|
-
this.
|
|
15297
|
-
this.
|
|
15563
|
+
this.anchor = markHydrationAnchor(locateTeleportEndAnchor(nextNode));
|
|
15564
|
+
this.mountState = {
|
|
15565
|
+
location: 1,
|
|
15566
|
+
container: /* @__PURE__ */ parentNode(this.anchor),
|
|
15567
|
+
anchor: this.anchor
|
|
15568
|
+
};
|
|
15298
15569
|
if (target) this.hydrateTargetAnchors(target, targetNode);
|
|
15299
15570
|
else {
|
|
15300
15571
|
this.targetStart = targetNode;
|
|
@@ -15305,13 +15576,42 @@ var TeleportFragment = class extends VaporFragment {
|
|
|
15305
15576
|
mountChildren(target) {
|
|
15306
15577
|
if (!isHydrating$1) return;
|
|
15307
15578
|
target.appendChild(this.targetStart = /* @__PURE__ */ createTextNode(""));
|
|
15308
|
-
target.appendChild(this.
|
|
15579
|
+
target.appendChild(this.targetAnchor = markHydrationAnchor(/* @__PURE__ */ createTextNode("")));
|
|
15580
|
+
this.mountState = {
|
|
15581
|
+
location: 2,
|
|
15582
|
+
container: target,
|
|
15583
|
+
anchor: this.targetAnchor
|
|
15584
|
+
};
|
|
15309
15585
|
if (!isMismatchAllowed(target, 1)) {
|
|
15310
15586
|
warn(`Hydration children mismatch on`, target, `\nServer rendered element contains fewer child nodes than client nodes.`);
|
|
15311
15587
|
logMismatchError();
|
|
15312
15588
|
}
|
|
15313
15589
|
runWithoutHydration(this.initChildren.bind(this));
|
|
15314
15590
|
}
|
|
15591
|
+
updateCssVars() {
|
|
15592
|
+
const ctx = this.scopeOwner;
|
|
15593
|
+
if (ctx && ctx.ut) {
|
|
15594
|
+
let node;
|
|
15595
|
+
let anchor;
|
|
15596
|
+
if (this.mountState.location === 1) {
|
|
15597
|
+
node = this.placeholder;
|
|
15598
|
+
anchor = this.anchor;
|
|
15599
|
+
} else if (this.mountState.location === 2) {
|
|
15600
|
+
node = this.targetStart;
|
|
15601
|
+
anchor = this.targetAnchor;
|
|
15602
|
+
} else return;
|
|
15603
|
+
while (node && node !== anchor) {
|
|
15604
|
+
if (node.nodeType === 1) node.setAttribute("data-v-owner", String(ctx.uid));
|
|
15605
|
+
node = node.nextSibling;
|
|
15606
|
+
}
|
|
15607
|
+
pauseTracking();
|
|
15608
|
+
try {
|
|
15609
|
+
ctx.ut();
|
|
15610
|
+
} finally {
|
|
15611
|
+
resetTracking();
|
|
15612
|
+
}
|
|
15613
|
+
}
|
|
15614
|
+
}
|
|
15315
15615
|
};
|
|
15316
15616
|
const VaporTeleport = /* @__PURE__ */ enableTeleport(VaporTeleportImpl);
|
|
15317
15617
|
function locateTeleportEndAnchor(node = currentHydrationNode) {
|
|
@@ -15324,29 +15624,6 @@ function locateTeleportEndAnchor(node = currentHydrationNode) {
|
|
|
15324
15624
|
}
|
|
15325
15625
|
return null;
|
|
15326
15626
|
}
|
|
15327
|
-
function updateCssVars(frag) {
|
|
15328
|
-
const ctx = frag.parentComponent;
|
|
15329
|
-
if (ctx && ctx.ut) {
|
|
15330
|
-
let node, anchor;
|
|
15331
|
-
if (frag.isDisabled) {
|
|
15332
|
-
node = frag.placeholder;
|
|
15333
|
-
anchor = frag.anchor;
|
|
15334
|
-
} else {
|
|
15335
|
-
node = frag.targetStart;
|
|
15336
|
-
anchor = frag.targetAnchor;
|
|
15337
|
-
}
|
|
15338
|
-
while (node && node !== anchor) {
|
|
15339
|
-
if (node.nodeType === 1) node.setAttribute("data-v-owner", String(ctx.uid));
|
|
15340
|
-
node = node.nextSibling;
|
|
15341
|
-
}
|
|
15342
|
-
pauseTracking();
|
|
15343
|
-
try {
|
|
15344
|
-
ctx.ut();
|
|
15345
|
-
} finally {
|
|
15346
|
-
resetTracking();
|
|
15347
|
-
}
|
|
15348
|
-
}
|
|
15349
|
-
}
|
|
15350
15627
|
//#endregion
|
|
15351
15628
|
//#region packages/runtime-vapor/src/apiDefineCustomElement.ts
|
|
15352
15629
|
const vaporCustomElementHydrates = /* @__PURE__ */ new WeakMap();
|
|
@@ -15368,7 +15645,7 @@ const defineVaporSSRCustomElement = ((options, extraOptions) => {
|
|
|
15368
15645
|
});
|
|
15369
15646
|
var VaporElement = class extends VueElementBase {
|
|
15370
15647
|
constructor(def, props = {}, createAppFn = createVaporApp) {
|
|
15371
|
-
super(def, props, createAppFn);
|
|
15648
|
+
super(def, /* @__PURE__ */ shallowReactive(props), createAppFn);
|
|
15372
15649
|
}
|
|
15373
15650
|
_needsHydration() {
|
|
15374
15651
|
const hydrate = vaporCustomElementHydrates.get(this.constructor);
|
|
@@ -15387,13 +15664,9 @@ var VaporElement = class extends VueElementBase {
|
|
|
15387
15664
|
this._app.mount(this._root);
|
|
15388
15665
|
if (!this.shadowRoot) this._renderSlots();
|
|
15389
15666
|
}
|
|
15390
|
-
_update() {
|
|
15391
|
-
if (!this._app) return;
|
|
15392
|
-
const renderEffects = this._instance.renderEffects;
|
|
15393
|
-
if (renderEffects) renderEffects.forEach((e) => e.run());
|
|
15394
|
-
}
|
|
15667
|
+
_update() {}
|
|
15395
15668
|
_unmount() {
|
|
15396
|
-
this._app.unmount();
|
|
15669
|
+
if (this._app) this._app.unmount();
|
|
15397
15670
|
if (this._instance && this._instance.ce) this._instance.ce = void 0;
|
|
15398
15671
|
this._app = this._instance = null;
|
|
15399
15672
|
}
|
|
@@ -15425,12 +15698,12 @@ var VaporElement = class extends VueElementBase {
|
|
|
15425
15698
|
else this._updateFragmentNodes(nodes, replacements);
|
|
15426
15699
|
}
|
|
15427
15700
|
_createComponent() {
|
|
15428
|
-
|
|
15701
|
+
const ce = (instance) => {
|
|
15429
15702
|
this._app._ceComponent = this._instance = instance;
|
|
15430
15703
|
if (!this.shadowRoot) this._instance.u = [this._renderSlots.bind(this)];
|
|
15431
15704
|
this._processInstance();
|
|
15432
15705
|
};
|
|
15433
|
-
createComponent(this._def, this._props, void 0, void 0, void 0, this._app._context);
|
|
15706
|
+
createComponent(this._def, this._props, void 0, void 0, void 0, this._app._context, false, ce);
|
|
15434
15707
|
}
|
|
15435
15708
|
};
|
|
15436
15709
|
//#endregion
|
|
@@ -15490,10 +15763,10 @@ function createIf(condition, b1, b2, flags = 1) {
|
|
|
15490
15763
|
}
|
|
15491
15764
|
frag = ok ? b1() : b2 ? b2() : [/* @__PURE__ */ createComment("if")];
|
|
15492
15765
|
} else {
|
|
15493
|
-
const index = flags >>
|
|
15766
|
+
const index = flags >> 8;
|
|
15494
15767
|
const keyed = index > 0;
|
|
15495
15768
|
const keyBase = keyed ? (index - 1) * 2 : 0;
|
|
15496
|
-
frag = new DynamicFragment("if", keyed, false);
|
|
15769
|
+
frag = new DynamicFragment("if", keyed, false, !!(flags & 128));
|
|
15497
15770
|
renderEffect(() => {
|
|
15498
15771
|
const ok = condition();
|
|
15499
15772
|
if (isHydrating$1) {
|
|
@@ -15565,10 +15838,10 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15565
15838
|
let parentAnchor;
|
|
15566
15839
|
let pendingHydrationAnchor = false;
|
|
15567
15840
|
if (!isHydrating$1) parentAnchor = /* @__PURE__ */ createComment("for");
|
|
15568
|
-
const frag = new ForFragment(oldBlocks);
|
|
15841
|
+
const frag = new ForFragment(oldBlocks, !!(flags & 32));
|
|
15569
15842
|
const instance = currentInstance;
|
|
15570
|
-
const canUseFastRemove = !!(flags & 1);
|
|
15571
15843
|
const isComponent = !!(flags & 2);
|
|
15844
|
+
const canUseFastRemove = !!(flags & 1) && !isComponent;
|
|
15572
15845
|
const isSingleNode = !!(flags & 8);
|
|
15573
15846
|
const isFragment = !!(flags & 16);
|
|
15574
15847
|
const slotOwner = currentSlotOwner;
|
|
@@ -15590,8 +15863,9 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15590
15863
|
for (let i = 0; i < newLength; i++) newKeys[i] = getKey(...getItem(source, i));
|
|
15591
15864
|
}
|
|
15592
15865
|
const prevSub = setActiveSub();
|
|
15593
|
-
|
|
15594
|
-
if (
|
|
15866
|
+
const wasMounted = isMounted;
|
|
15867
|
+
if (wasMounted && frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
|
|
15868
|
+
if (!wasMounted) {
|
|
15595
15869
|
isMounted = true;
|
|
15596
15870
|
if (isHydrating$1) hydrateList(source, newLength);
|
|
15597
15871
|
else for (let i = 0; i < newLength; i++) mount(source, i);
|
|
@@ -15608,7 +15882,10 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15608
15882
|
}
|
|
15609
15883
|
} else if (!getKey) {
|
|
15610
15884
|
const commonLength = Math.min(newLength, oldLength);
|
|
15611
|
-
for (let i = 0; i < commonLength; i++)
|
|
15885
|
+
for (let i = 0; i < commonLength; i++) {
|
|
15886
|
+
const item = getItem(source, i);
|
|
15887
|
+
update(newBlocks[i] = oldBlocks[i], ...item);
|
|
15888
|
+
}
|
|
15612
15889
|
for (let i = oldLength; i < newLength; i++) mount(source, i);
|
|
15613
15890
|
for (let i = newLength; i < oldLength; i++) unmount(oldBlocks[i]);
|
|
15614
15891
|
} else {
|
|
@@ -15646,7 +15923,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15646
15923
|
const currentKey = newKeys[i];
|
|
15647
15924
|
const oldBlock = oldBlocks[i];
|
|
15648
15925
|
const oldKey = oldBlock.key;
|
|
15649
|
-
if (oldKey === currentKey) update(newBlocks[i] = oldBlock, currentItem
|
|
15926
|
+
if (oldKey === currentKey) update(newBlocks[i] = oldBlock, ...currentItem);
|
|
15650
15927
|
else {
|
|
15651
15928
|
queuedBlocks[queuedBlocksLength++] = [
|
|
15652
15929
|
i,
|
|
@@ -15747,7 +16024,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15747
16024
|
}
|
|
15748
16025
|
frag.nodes = [oldBlocks = newBlocks];
|
|
15749
16026
|
if (parentAnchor) frag.nodes.push(parentAnchor);
|
|
15750
|
-
if (
|
|
16027
|
+
if (wasMounted && frag.onUpdated) frag.onUpdated.forEach((m) => m());
|
|
15751
16028
|
setActiveSub(prevSub);
|
|
15752
16029
|
};
|
|
15753
16030
|
const needKey = renderItem.length > 1;
|
|
@@ -15775,7 +16052,11 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
|
|
|
15775
16052
|
if (frag.$transition.applyGroup) setBlockKey(block.nodes, block.key);
|
|
15776
16053
|
applyTransitionHooks(block.nodes, frag.$transition);
|
|
15777
16054
|
}
|
|
15778
|
-
if (parent)
|
|
16055
|
+
if (parent) {
|
|
16056
|
+
const onBeforeInsert = frag.onBeforeInsert;
|
|
16057
|
+
if (onBeforeInsert) onBeforeInsert.forEach((fn) => fn(block.nodes));
|
|
16058
|
+
insertForBlock(block, anchor);
|
|
16059
|
+
}
|
|
15779
16060
|
return block;
|
|
15780
16061
|
};
|
|
15781
16062
|
function hydrateList(source, newLength) {
|
|
@@ -15957,11 +16238,14 @@ function normalizeSource(source) {
|
|
|
15957
16238
|
isReadonlySource = /* @__PURE__ */ isReadonly(source);
|
|
15958
16239
|
}
|
|
15959
16240
|
} else if (isString(source)) values = source.split("");
|
|
15960
|
-
else if (typeof source === "number") {
|
|
15961
|
-
|
|
16241
|
+
else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
|
|
16242
|
+
warn(`The v-for range expects a positive integer value but got ${source}.`);
|
|
16243
|
+
values = [];
|
|
16244
|
+
} else {
|
|
15962
16245
|
values = new Array(source);
|
|
15963
16246
|
for (let i = 0; i < source; i++) values[i] = i + 1;
|
|
15964
|
-
}
|
|
16247
|
+
}
|
|
16248
|
+
else if (isObject(source)) if (source[Symbol.iterator]) values = Array.from(source);
|
|
15965
16249
|
else {
|
|
15966
16250
|
keys = Object.keys(source);
|
|
15967
16251
|
values = new Array(keys.length);
|
|
@@ -15998,8 +16282,7 @@ function normalizeAnchor(node) {
|
|
|
15998
16282
|
return;
|
|
15999
16283
|
} else if (isVaporComponent(node)) return normalizeAnchor(node.block);
|
|
16000
16284
|
else {
|
|
16001
|
-
const
|
|
16002
|
-
const nodes = getEffectiveOutput ? getEffectiveOutput.call(node) : node.nodes;
|
|
16285
|
+
const nodes = node.nodes;
|
|
16003
16286
|
return isValidBlock(nodes) ? normalizeAnchor(nodes) : node.anchor || normalizeAnchor(nodes);
|
|
16004
16287
|
}
|
|
16005
16288
|
}
|
|
@@ -16008,11 +16291,8 @@ function getRestElement(val, keys) {
|
|
|
16008
16291
|
for (const key in val) if (!keys.includes(key)) res[key] = val[key];
|
|
16009
16292
|
return res;
|
|
16010
16293
|
}
|
|
16011
|
-
function getDefaultValue(val,
|
|
16012
|
-
return val === void 0 ?
|
|
16013
|
-
}
|
|
16014
|
-
function isForBlock(block) {
|
|
16015
|
-
return block instanceof ForBlock;
|
|
16294
|
+
function getDefaultValue(val, getDefaultVal) {
|
|
16295
|
+
return val === void 0 ? getDefaultVal() : val;
|
|
16016
16296
|
}
|
|
16017
16297
|
//#endregion
|
|
16018
16298
|
//#region packages/runtime-vapor/src/apiTemplateRef.ts
|
|
@@ -16034,25 +16314,39 @@ function ensureCleanup(el) {
|
|
|
16034
16314
|
}
|
|
16035
16315
|
function createTemplateRefSetter() {
|
|
16036
16316
|
const instance = currentInstance;
|
|
16037
|
-
const
|
|
16038
|
-
const setRefMap = /* @__PURE__ */ new WeakMap();
|
|
16317
|
+
const stateMap = /* @__PURE__ */ new WeakMap();
|
|
16039
16318
|
return (el, ref, refFor, refKey) => {
|
|
16040
|
-
|
|
16041
|
-
if (
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
const oldRef = setRef$1(instance, el, ref, oldRefMap.get(el), refFor, refKey);
|
|
16052
|
-
oldRefMap.set(el, oldRef);
|
|
16053
|
-
return oldRef;
|
|
16319
|
+
let state = stateMap.get(el);
|
|
16320
|
+
if (!state) stateMap.set(el, state = { ref });
|
|
16321
|
+
return setTemplateRefWithState(instance, el, state, ref, refFor, refKey);
|
|
16322
|
+
};
|
|
16323
|
+
}
|
|
16324
|
+
function createSingleTemplateRefSetter() {
|
|
16325
|
+
const instance = currentInstance;
|
|
16326
|
+
let state;
|
|
16327
|
+
return (el, ref, refFor, refKey) => {
|
|
16328
|
+
if (!state) state = { ref };
|
|
16329
|
+
return setTemplateRefWithState(instance, el, state, ref, refFor, refKey);
|
|
16054
16330
|
};
|
|
16055
16331
|
}
|
|
16332
|
+
function setTemplateRefWithState(instance, el, state, ref, refFor, refKey) {
|
|
16333
|
+
state.ref = ref;
|
|
16334
|
+
state.refFor = refFor;
|
|
16335
|
+
state.refKey = refKey;
|
|
16336
|
+
const frag = getTemplateRefUpdateFragment(el);
|
|
16337
|
+
if (frag && state.registeredFrag !== frag) {
|
|
16338
|
+
state.registeredFrag = frag;
|
|
16339
|
+
(frag.onUpdated || (frag.onUpdated = [])).push(() => {
|
|
16340
|
+
if (isVaporComponent(el) && el.isDeactivated) return;
|
|
16341
|
+
state.oldRef = setRef$1(instance, el, state.ref, state.oldRef, state.refFor, state.refKey, state.oldRefKey);
|
|
16342
|
+
state.oldRefKey = state.oldRef != null ? state.refKey : void 0;
|
|
16343
|
+
});
|
|
16344
|
+
}
|
|
16345
|
+
const oldRef = setRef$1(instance, el, ref, state.oldRef, refFor, refKey, state.oldRefKey);
|
|
16346
|
+
state.oldRef = oldRef;
|
|
16347
|
+
state.oldRefKey = oldRef != null ? refKey : void 0;
|
|
16348
|
+
return oldRef;
|
|
16349
|
+
}
|
|
16056
16350
|
function setStaticTemplateRef(el, ref, refFor, refKey) {
|
|
16057
16351
|
const instance = currentInstance;
|
|
16058
16352
|
const oldRef = setRef$1(instance, el, ref, void 0, refFor, refKey);
|
|
@@ -16063,13 +16357,13 @@ function setStaticTemplateRef(el, ref, refFor, refKey) {
|
|
|
16063
16357
|
});
|
|
16064
16358
|
return oldRef;
|
|
16065
16359
|
}
|
|
16066
|
-
function setTemplateRefBinding(el, getter, setter =
|
|
16360
|
+
function setTemplateRefBinding(el, getter, setter = createSingleTemplateRefSetter(), refFor, refKey) {
|
|
16067
16361
|
renderEffect(() => setter(el, getter(), refFor, refKey));
|
|
16068
16362
|
}
|
|
16069
16363
|
/**
|
|
16070
16364
|
* Function for handling a template ref
|
|
16071
16365
|
*/
|
|
16072
|
-
function setRef$1(instance, el, ref, oldRef, refFor = false, refKey) {
|
|
16366
|
+
function setRef$1(instance, el, ref, oldRef, refFor = false, refKey, oldRefKey) {
|
|
16073
16367
|
if (!instance || instance.isUnmounted) return;
|
|
16074
16368
|
const setupState = instance.setupState || {};
|
|
16075
16369
|
const refValue = getRefValue(el);
|
|
@@ -16093,7 +16387,8 @@ function setRef$1(instance, el, ref, oldRef, refFor = false, refKey) {
|
|
|
16093
16387
|
refs[oldRef] = null;
|
|
16094
16388
|
if (canSetSetupRef(oldRef)) setupState[oldRef] = null;
|
|
16095
16389
|
} else if (/* @__PURE__ */ isRef(oldRef)) {
|
|
16096
|
-
if (canSetRef(oldRef)) oldRef.value = null;
|
|
16390
|
+
if (canSetRef(oldRef, oldRefKey)) oldRef.value = null;
|
|
16391
|
+
if (oldRefKey) refs[oldRefKey] = null;
|
|
16097
16392
|
} else if (isFunction(oldRef) && isDynamicFragment(el)) callWithErrorHandling(oldRef, instance, 12, [null, refs]);
|
|
16098
16393
|
} else if (oldRef != null && isDynamicFragment(el)) {
|
|
16099
16394
|
if (isFunction(oldRef)) callWithErrorHandling(oldRef, instance, 12, [null, refs]);
|
|
@@ -16200,12 +16495,15 @@ function setVarsOnBlock(block, vars) {
|
|
|
16200
16495
|
}
|
|
16201
16496
|
//#endregion
|
|
16202
16497
|
//#region packages/runtime-vapor/src/apiCreateDynamicComponent.ts
|
|
16203
|
-
function createDynamicComponent(getter, rawProps, rawSlots,
|
|
16498
|
+
function createDynamicComponent(getter, rawProps, rawSlots, flags = 0) {
|
|
16499
|
+
const isSingleRoot = !!(flags & 1);
|
|
16500
|
+
const once = !!(flags & 2);
|
|
16501
|
+
const slotRoot = !!(flags & 4);
|
|
16204
16502
|
const _insertionParent = insertionParent;
|
|
16205
16503
|
const _insertionAnchor = insertionAnchor;
|
|
16206
16504
|
if (!isHydrating$1) resetInsertionState();
|
|
16207
16505
|
const hydrationCursor = isHydrating$1 ? captureHydrationCursor() : null;
|
|
16208
|
-
const frag = new DynamicFragment("dynamic-component");
|
|
16506
|
+
const frag = new DynamicFragment("dynamic-component", false, true, slotRoot);
|
|
16209
16507
|
const normalizedRawSlots = normalizeRawSlots(rawSlots);
|
|
16210
16508
|
const scopeOwner = getScopeOwner();
|
|
16211
16509
|
const renderFn = () => {
|
|
@@ -16370,11 +16668,11 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
|
|
|
16370
16668
|
if (isUpdatePending) return;
|
|
16371
16669
|
isUpdatePending = true;
|
|
16372
16670
|
prevChildren = [];
|
|
16373
|
-
const children =
|
|
16671
|
+
const children = resolveTransitionBlocks(slottedBlock);
|
|
16374
16672
|
for (let i = 0; i < children.length; i++) {
|
|
16375
16673
|
const child = children[i];
|
|
16376
16674
|
const el = isValidTransitionBlock(child) && child.$transition ? getTransitionElement(child) : void 0;
|
|
16377
|
-
if (el) {
|
|
16675
|
+
if (el && !el[vShowHidden]) {
|
|
16378
16676
|
prevChildren.push(child);
|
|
16379
16677
|
child.$transition.disabled = true;
|
|
16380
16678
|
positionMap.set(child, el.getBoundingClientRect());
|
|
@@ -16388,15 +16686,16 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
|
|
|
16388
16686
|
if (!prevChildren.length) return;
|
|
16389
16687
|
const moveClass = props.moveClass || `${props.name || "v"}-move`;
|
|
16390
16688
|
const firstChild = getFirstConnectedChild(prevChildren);
|
|
16391
|
-
|
|
16392
|
-
prevChildren = [];
|
|
16393
|
-
return;
|
|
16394
|
-
}
|
|
16395
|
-
prevChildren.forEach(callPendingCbs);
|
|
16689
|
+
const hasMove = !!(firstChild && hasCSSTransform(firstChild, firstChild.parentNode, moveClass));
|
|
16396
16690
|
prevChildren.forEach((child) => {
|
|
16397
16691
|
child.$transition.disabled = false;
|
|
16398
|
-
|
|
16692
|
+
if (hasMove) callPendingCbs(child);
|
|
16399
16693
|
});
|
|
16694
|
+
if (!hasMove) {
|
|
16695
|
+
prevChildren = [];
|
|
16696
|
+
return;
|
|
16697
|
+
}
|
|
16698
|
+
prevChildren.forEach(recordPosition);
|
|
16400
16699
|
const movedChildren = prevChildren.filter(applyTranslation);
|
|
16401
16700
|
forceReflow();
|
|
16402
16701
|
movedChildren.forEach((c) => handleMovedChildren(getTransitionElement(c), moveClass));
|
|
@@ -16459,7 +16758,7 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
|
|
|
16459
16758
|
}));
|
|
16460
16759
|
function applyGroupTransitionHooks(block, props, state, instance, updateHooks) {
|
|
16461
16760
|
const fragments = [];
|
|
16462
|
-
const children =
|
|
16761
|
+
const children = resolveTransitionBlocks(block, (frag) => fragments.push(frag), (owner) => trackTransitionGroupUpdate(owner, updateHooks));
|
|
16463
16762
|
for (let i = 0; i < children.length; i++) {
|
|
16464
16763
|
const child = children[i];
|
|
16465
16764
|
if (isValidTransitionBlock(child)) if (child.$key != null) setTransitionHooks$1(child, resolveTransitionHooks$1(child, props, state, instance));
|
|
@@ -16506,47 +16805,6 @@ function trackTransitionGroupUpdate(owner, updateHooks) {
|
|
|
16506
16805
|
});
|
|
16507
16806
|
}
|
|
16508
16807
|
}
|
|
16509
|
-
function inheritKey(children, key) {
|
|
16510
|
-
if (key === void 0 || children.length === 0) return;
|
|
16511
|
-
for (let i = 0; i < children.length; i++) {
|
|
16512
|
-
const child = children[i];
|
|
16513
|
-
child.$key = String(key) + String(child.$key != null ? child.$key : i);
|
|
16514
|
-
}
|
|
16515
|
-
}
|
|
16516
|
-
function getTransitionBlocks(block, onFragment, onUpdateOwner) {
|
|
16517
|
-
let children = [];
|
|
16518
|
-
if (block instanceof Element) children.push(block);
|
|
16519
|
-
else if (isVaporComponent(block)) {
|
|
16520
|
-
const isRootSlot = block.block instanceof SlotFragment;
|
|
16521
|
-
if (onUpdateOwner && !isRootSlot) onUpdateOwner(block);
|
|
16522
|
-
const blocks = getTransitionBlocks(block.block, onFragment, isRootSlot ? onUpdateOwner : void 0);
|
|
16523
|
-
inheritKey(blocks, block.$key);
|
|
16524
|
-
children.push(...blocks);
|
|
16525
|
-
} else if (isArray(block)) for (let i = 0; i < block.length; i++) {
|
|
16526
|
-
const b = block[i];
|
|
16527
|
-
const blocks = getTransitionBlocks(b, onFragment, onUpdateOwner);
|
|
16528
|
-
if (isForBlock(b)) blocks.forEach((block) => block.$key = b.key);
|
|
16529
|
-
children.push(...blocks);
|
|
16530
|
-
}
|
|
16531
|
-
else if (isFragment(block)) {
|
|
16532
|
-
if (onFragment) onFragment(block);
|
|
16533
|
-
if (onUpdateOwner) onUpdateOwner(block);
|
|
16534
|
-
if (isInteropEnabled && block.vnode) children.push(block);
|
|
16535
|
-
else {
|
|
16536
|
-
const blocks = getTransitionBlocks(block.nodes, onFragment, onUpdateOwner);
|
|
16537
|
-
inheritKey(blocks, block.$key);
|
|
16538
|
-
children.push(...blocks);
|
|
16539
|
-
}
|
|
16540
|
-
}
|
|
16541
|
-
return children;
|
|
16542
|
-
}
|
|
16543
|
-
function isValidTransitionBlock(block) {
|
|
16544
|
-
return !!(block instanceof Element || isFragment(block) && block.vnode);
|
|
16545
|
-
}
|
|
16546
|
-
function getTransitionElement(block) {
|
|
16547
|
-
if (block instanceof Element) return block;
|
|
16548
|
-
if (isInteropEnabled && isFragment(block) && block.vnode) return getTransitionElementFromVNode(block.vnode);
|
|
16549
|
-
}
|
|
16550
16808
|
function recordPosition(c) {
|
|
16551
16809
|
const el = getTransitionElement(c);
|
|
16552
16810
|
if (el) newPositionMap.set(c, el.getBoundingClientRect());
|
|
@@ -16563,4 +16821,4 @@ function getFirstConnectedChild(children) {
|
|
|
16563
16821
|
}
|
|
16564
16822
|
}
|
|
16565
16823
|
//#endregion
|
|
16566
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAssetComponent, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onBinding, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId,
|
|
16824
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAssetComponent, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onBinding, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, withVaporDirectives, withVaporKeys, withVaporModifiers, xlinkNS };
|