@vue/runtime-core 3.6.0-rc.11 → 3.6.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +224 -79
- package/dist/runtime-core.cjs.prod.js +230 -78
- package/dist/runtime-core.d.ts +16 -1
- package/dist/runtime-core.esm-bundler.js +210 -86
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-core v3.6.0-rc.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -317,15 +317,15 @@ function queuePostFlushCb(jobs, id = Infinity) {
|
|
|
317
317
|
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
318
318
|
queueFlush();
|
|
319
319
|
}
|
|
320
|
-
function flushPreFlushCbs(instance, seen) {
|
|
320
|
+
function flushPreFlushCbs(instance, minUid, seen) {
|
|
321
321
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
322
322
|
for (let i = flushIndex; i < jobsLength; i++) {
|
|
323
323
|
const cb = jobs[i];
|
|
324
324
|
if (cb.order & 1 || cb.order === Infinity) continue;
|
|
325
|
-
if (instance && cb.order !== instance.uid * 2) continue;
|
|
325
|
+
if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
|
|
326
326
|
if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) continue;
|
|
327
327
|
jobs.splice(i, 1);
|
|
328
|
-
i
|
|
328
|
+
i = instance ? i - 1 : flushIndex - 1;
|
|
329
329
|
jobsLength--;
|
|
330
330
|
if (cb.flags & 2) cb.flags &= -2;
|
|
331
331
|
try {
|
|
@@ -335,15 +335,24 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function flushPostFlushCbs(seen) {
|
|
338
|
+
function flushPostFlushCbs(seen, skip, minUid = 0) {
|
|
339
339
|
if (postJobs.length) {
|
|
340
|
+
let cbs = postJobs;
|
|
341
|
+
if (skip) {
|
|
342
|
+
cbs = [];
|
|
343
|
+
let kept = 0;
|
|
344
|
+
for (let i = 0; i < postJobs.length; i++) {
|
|
345
|
+
const cb = postJobs[i];
|
|
346
|
+
if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
|
|
347
|
+
else cbs.push(cb);
|
|
348
|
+
}
|
|
349
|
+
postJobs.length = kept;
|
|
350
|
+
} else postJobs = [];
|
|
340
351
|
if (activePostJobs) {
|
|
341
|
-
for (let i = 0; i <
|
|
342
|
-
postJobs.length = 0;
|
|
352
|
+
for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
345
|
-
activePostJobs =
|
|
346
|
-
postJobs = [];
|
|
355
|
+
activePostJobs = cbs;
|
|
347
356
|
if (!!(process.env.NODE_ENV !== "production")) seen = seen || /* @__PURE__ */ new Map();
|
|
348
357
|
try {
|
|
349
358
|
while (postFlushIndex < activePostJobs.length) {
|
|
@@ -365,17 +374,28 @@ function flushPostFlushCbs(seen) {
|
|
|
365
374
|
}
|
|
366
375
|
let isFlushing = false;
|
|
367
376
|
/**
|
|
377
|
+
* Run a root render, then flush the jobs it is responsible for. A mount or
|
|
378
|
+
* unmount (`minUid` given) only flushes the jobs of the components it created
|
|
379
|
+
* and the post cbs it queued, so pre watchers triggered in setup run before
|
|
380
|
+
* mounted (#5721) while the jobs of other components stay in the queue and
|
|
381
|
+
* keep their order (#6728). A root update keeps flushing all pending pre jobs
|
|
382
|
+
* and post cbs, as the jobs of the components it re-renders may predate it.
|
|
383
|
+
*
|
|
368
384
|
* @internal
|
|
369
385
|
*/
|
|
370
|
-
function flushOnAppMount(
|
|
371
|
-
if (
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
386
|
+
function flushOnAppMount(fn, minUid) {
|
|
387
|
+
if (isFlushing) {
|
|
388
|
+
fn();
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const queued = minUid === void 0 ? void 0 : new Set(postJobs);
|
|
392
|
+
fn();
|
|
393
|
+
isFlushing = true;
|
|
394
|
+
try {
|
|
395
|
+
flushPreFlushCbs(void 0, minUid);
|
|
396
|
+
flushPostFlushCbs(void 0, queued, minUid);
|
|
397
|
+
} finally {
|
|
398
|
+
isFlushing = false;
|
|
379
399
|
}
|
|
380
400
|
}
|
|
381
401
|
function flushJobs(seen) {
|
|
@@ -845,7 +865,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
|
|
|
845
865
|
this.flags |= 128;
|
|
846
866
|
job.flags |= 2;
|
|
847
867
|
}
|
|
848
|
-
|
|
868
|
+
job.i = instance;
|
|
849
869
|
this.job = job;
|
|
850
870
|
}
|
|
851
871
|
notify() {
|
|
@@ -920,6 +940,16 @@ function createPathGetter(ctx, path) {
|
|
|
920
940
|
};
|
|
921
941
|
}
|
|
922
942
|
//#endregion
|
|
943
|
+
//#region packages/runtime-core/src/vaporInteropState.ts
|
|
944
|
+
/**
|
|
945
|
+
* Set by `vaporInteropPlugin`. Stays false in apps that never import the
|
|
946
|
+
* plugin, so bundlers drop the vapor-in-vdom branches of the renderer.
|
|
947
|
+
*/
|
|
948
|
+
let isVaporInteropEnabled = false;
|
|
949
|
+
function setVaporInteropEnabled() {
|
|
950
|
+
isVaporInteropEnabled = true;
|
|
951
|
+
}
|
|
952
|
+
//#endregion
|
|
923
953
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
924
954
|
const pendingMounts = /* @__PURE__ */ new WeakMap();
|
|
925
955
|
const TeleportEndKey = Symbol("_vte");
|
|
@@ -1056,7 +1086,11 @@ const TeleportImpl = {
|
|
|
1056
1086
|
hydrate: hydrateTeleport
|
|
1057
1087
|
};
|
|
1058
1088
|
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
|
|
1059
|
-
if (moveType === 0)
|
|
1089
|
+
if (moveType === 0) {
|
|
1090
|
+
if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
|
|
1091
|
+
insert(vnode.targetAnchor, container, parentAnchor);
|
|
1092
|
+
parentAnchor = vnode.targetAnchor;
|
|
1093
|
+
}
|
|
1060
1094
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
1061
1095
|
const isReorder = moveType === 2;
|
|
1062
1096
|
if (isReorder) insert(el, container, parentAnchor);
|
|
@@ -1175,9 +1209,18 @@ const BaseTransitionPropsValidators = {
|
|
|
1175
1209
|
onAfterAppear: TransitionHookValidator,
|
|
1176
1210
|
onAppearCancelled: TransitionHookValidator
|
|
1177
1211
|
};
|
|
1212
|
+
let isTransitionEnabled = false;
|
|
1213
|
+
function withTransitionEnabled(value) {
|
|
1214
|
+
isTransitionEnabled = true;
|
|
1215
|
+
return value;
|
|
1216
|
+
}
|
|
1178
1217
|
function isEmptyTransitionChild(vnode, instance) {
|
|
1179
1218
|
if (vnode.type === Comment) return true;
|
|
1180
|
-
if (vnode.type ===
|
|
1219
|
+
if (vnode.type === Fragment) {
|
|
1220
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1221
|
+
return !child || isEmptyTransitionChild(child, instance);
|
|
1222
|
+
}
|
|
1223
|
+
if (isVaporInteropEnabled && (vnode.type === VaporSlot || isVaporComponent(vnode.type))) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
|
|
1181
1224
|
return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
|
|
1182
1225
|
}
|
|
1183
1226
|
const BaseTransitionImpl = {
|
|
@@ -1194,7 +1237,7 @@ const BaseTransitionImpl = {
|
|
|
1194
1237
|
const { mode } = rawProps;
|
|
1195
1238
|
checkTransitionMode(mode);
|
|
1196
1239
|
return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
|
|
1197
|
-
if (!(instance.
|
|
1240
|
+
if (!(instance.effect.flags & 1024)) instance.update();
|
|
1198
1241
|
}) : NOOP);
|
|
1199
1242
|
};
|
|
1200
1243
|
}
|
|
@@ -1215,7 +1258,7 @@ function findNonCommentChild(children) {
|
|
|
1215
1258
|
}
|
|
1216
1259
|
return child;
|
|
1217
1260
|
}
|
|
1218
|
-
const BaseTransition = BaseTransitionImpl;
|
|
1261
|
+
const BaseTransition = /*@__PURE__*/ withTransitionEnabled(BaseTransitionImpl);
|
|
1219
1262
|
function getLeavingNodesForType(state, vnode) {
|
|
1220
1263
|
const { leavingNodes } = state;
|
|
1221
1264
|
let leavingVNodesCache = leavingNodes.get(vnode.type);
|
|
@@ -1238,7 +1281,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1238
1281
|
},
|
|
1239
1282
|
earlyRemove: () => {
|
|
1240
1283
|
const leavingVNode = leavingVNodesCache[key];
|
|
1241
|
-
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)
|
|
1284
|
+
if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
|
|
1285
|
+
let leavingCb = leavingVNode.el[leaveCbKey];
|
|
1286
|
+
if (!leavingCb) {
|
|
1287
|
+
const leavingRoot = getTransitionRoot(leavingVNode);
|
|
1288
|
+
leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
|
|
1289
|
+
}
|
|
1290
|
+
if (leavingCb) leavingCb();
|
|
1291
|
+
}
|
|
1242
1292
|
},
|
|
1243
1293
|
cloneHooks: (vnode) => {
|
|
1244
1294
|
const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
|
|
@@ -1246,7 +1296,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1246
1296
|
return hooks;
|
|
1247
1297
|
}
|
|
1248
1298
|
}, props, state, instance);
|
|
1249
|
-
if (vnode.type === VaporSlot) extend(hooks, {
|
|
1299
|
+
if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
|
|
1250
1300
|
__vapor: true,
|
|
1251
1301
|
props,
|
|
1252
1302
|
state,
|
|
@@ -1384,14 +1434,21 @@ function forwardDelayedLeave(hooks, source) {
|
|
|
1384
1434
|
}
|
|
1385
1435
|
/**
|
|
1386
1436
|
* Prepares an outgoing VNode when the incoming branch belongs to another
|
|
1387
|
-
* renderer. Returns true
|
|
1437
|
+
* renderer. Returns true under out-in, where that branch is a comment
|
|
1438
|
+
* child's: no mode holds for it, the leave runs on its own and
|
|
1439
|
+
* `resumeAfterLeave` follows it.
|
|
1388
1440
|
*
|
|
1389
1441
|
* @internal
|
|
1390
1442
|
*/
|
|
1391
1443
|
function prepareTransitionLeave(previous, enterHooks, props, state, instance, resumeAfterLeave) {
|
|
1392
1444
|
const previousInner = getInnerChild$1(previous);
|
|
1393
1445
|
if (!previousInner || isEmptyTransitionChild(previousInner, instance)) return false;
|
|
1394
|
-
|
|
1446
|
+
const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
|
|
1447
|
+
if (props.mode === "out-in") {
|
|
1448
|
+
leavingHooks.afterLeave = resumeAfterLeave;
|
|
1449
|
+
return true;
|
|
1450
|
+
}
|
|
1451
|
+
return applyTransitionModeSwitch(previousInner, leavingHooks, enterHooks ? () => enterHooks : void 0, props, state, resumeAfterLeave);
|
|
1395
1452
|
}
|
|
1396
1453
|
function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
|
|
1397
1454
|
return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
|
|
@@ -1434,7 +1491,7 @@ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, pr
|
|
|
1434
1491
|
function setTransitionHooks(vnode, hooks) {
|
|
1435
1492
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
1436
1493
|
vnode.transition = hooks;
|
|
1437
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1494
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
|
|
1438
1495
|
else {
|
|
1439
1496
|
const subTree = vnode.component.subTree;
|
|
1440
1497
|
return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
|
|
@@ -1443,7 +1500,13 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
1443
1500
|
const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
1444
1501
|
const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
1445
1502
|
return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
|
|
1446
|
-
} else
|
|
1503
|
+
} else {
|
|
1504
|
+
vnode.transition = hooks;
|
|
1505
|
+
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
1506
|
+
const child = filterSingleRoot(vnode.children, false);
|
|
1507
|
+
if (child) setTransitionHooks(child, hooks);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1447
1510
|
return hooks;
|
|
1448
1511
|
}
|
|
1449
1512
|
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
@@ -1466,6 +1529,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1466
1529
|
function checkTransitionMode(mode) {
|
|
1467
1530
|
if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1468
1531
|
}
|
|
1532
|
+
function getTransitionRoot(vnode) {
|
|
1533
|
+
if (vnode.component && (!isVaporInteropEnabled || !isVaporComponent(vnode.type))) return getTransitionRoot(vnode.component.subTree);
|
|
1534
|
+
if (vnode.type === Fragment) {
|
|
1535
|
+
const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
|
|
1536
|
+
return child ? getTransitionRoot(child) : void 0;
|
|
1537
|
+
}
|
|
1538
|
+
if (vnode.type !== Comment) return vnode;
|
|
1539
|
+
}
|
|
1469
1540
|
//#endregion
|
|
1470
1541
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1471
1542
|
/*@__NO_SIDE_EFFECTS__*/
|
|
@@ -1732,7 +1803,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1732
1803
|
else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1733
1804
|
break;
|
|
1734
1805
|
case VaporSlot:
|
|
1735
|
-
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1806
|
+
if (isVaporInteropEnabled) nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1736
1807
|
break;
|
|
1737
1808
|
default: if (shapeFlag & 1) {
|
|
1738
1809
|
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
@@ -1743,7 +1814,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1743
1814
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
1744
1815
|
else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1745
1816
|
else nextNode = nextSibling(node);
|
|
1746
|
-
if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1817
|
+
if ((isVaporInteropEnabled || !!(process.env.NODE_ENV !== "production")) && vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
|
|
1747
1818
|
else {
|
|
1748
1819
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1749
1820
|
const component = vnode.component;
|
|
@@ -1868,7 +1939,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1868
1939
|
if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1869
1940
|
const container = parentNode(node);
|
|
1870
1941
|
const first = nextSibling(node);
|
|
1871
|
-
const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1942
|
+
const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1872
1943
|
if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
|
|
1873
1944
|
else {
|
|
1874
1945
|
logMismatchError();
|
|
@@ -2124,14 +2195,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
|
2124
2195
|
break;
|
|
2125
2196
|
}
|
|
2126
2197
|
}, opts);
|
|
2127
|
-
|
|
2128
|
-
if (!(el instanceof Element)) return;
|
|
2198
|
+
const observe = (el) => {
|
|
2129
2199
|
if (elementIsVisibleInViewport(el)) {
|
|
2130
2200
|
hydrate();
|
|
2131
2201
|
ob.disconnect();
|
|
2132
2202
|
return false;
|
|
2133
2203
|
}
|
|
2204
|
+
if (getComputedStyle(el).display === "contents") {
|
|
2205
|
+
for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
|
|
2206
|
+
}
|
|
2134
2207
|
ob.observe(el);
|
|
2208
|
+
};
|
|
2209
|
+
forEach((el) => {
|
|
2210
|
+
if (!(el instanceof Element)) return;
|
|
2211
|
+
return observe(el);
|
|
2135
2212
|
});
|
|
2136
2213
|
return () => ob.disconnect();
|
|
2137
2214
|
};
|
|
@@ -2281,7 +2358,7 @@ function createAsyncComponentContext(source) {
|
|
|
2281
2358
|
setPendingRequest: (request) => pendingRequest = request
|
|
2282
2359
|
};
|
|
2283
2360
|
}
|
|
2284
|
-
const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
|
|
2361
|
+
const useAsyncComponentState = (delay = 200, timeout, onError, instance = currentInstance) => {
|
|
2285
2362
|
const loaded = ref$1(false);
|
|
2286
2363
|
const error = ref$1();
|
|
2287
2364
|
const delayed = ref$1(!!delay);
|
|
@@ -2338,7 +2415,12 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
2338
2415
|
//#endregion
|
|
2339
2416
|
//#region packages/runtime-core/src/components/KeepAlive.ts
|
|
2340
2417
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2341
|
-
|
|
2418
|
+
let isKeepAliveEnabled = false;
|
|
2419
|
+
function withKeepAliveEnabled(value) {
|
|
2420
|
+
isKeepAliveEnabled = true;
|
|
2421
|
+
return value;
|
|
2422
|
+
}
|
|
2423
|
+
const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled({
|
|
2342
2424
|
name: `KeepAlive`,
|
|
2343
2425
|
__isKeepAlive: true,
|
|
2344
2426
|
props: {
|
|
@@ -2393,7 +2475,10 @@ const KeepAlive = {
|
|
|
2393
2475
|
function pruneCacheEntry(key) {
|
|
2394
2476
|
const cached = cache.get(key);
|
|
2395
2477
|
if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
|
|
2396
|
-
else if (current)
|
|
2478
|
+
else if (current) {
|
|
2479
|
+
resetShapeFlag(current);
|
|
2480
|
+
if (cached) resetShapeFlag(cached);
|
|
2481
|
+
}
|
|
2397
2482
|
cache.delete(key);
|
|
2398
2483
|
keys.delete(key);
|
|
2399
2484
|
}
|
|
@@ -2478,7 +2563,7 @@ const KeepAlive = {
|
|
|
2478
2563
|
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
2479
2564
|
};
|
|
2480
2565
|
}
|
|
2481
|
-
};
|
|
2566
|
+
});
|
|
2482
2567
|
function matches(pattern, name) {
|
|
2483
2568
|
if (isArray(pattern)) return pattern.some((p) => matches(p, name));
|
|
2484
2569
|
else if (isString(pattern)) return pattern.split(",").includes(name);
|
|
@@ -2655,8 +2740,8 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2655
2740
|
ret = new Array(source.length);
|
|
2656
2741
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2657
2742
|
} else if (typeof source === "number") {
|
|
2658
|
-
if (
|
|
2659
|
-
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2743
|
+
if (!Number.isInteger(source) || source < 0) {
|
|
2744
|
+
if (!!(process.env.NODE_ENV !== "production")) warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2660
2745
|
ret = [];
|
|
2661
2746
|
} else {
|
|
2662
2747
|
ret = new Array(source);
|
|
@@ -2727,16 +2812,22 @@ function invokeSlotFallback(fallback, owner) {
|
|
|
2727
2812
|
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2728
2813
|
if (props == null) props = {};
|
|
2729
2814
|
let slot = slots[name];
|
|
2730
|
-
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2815
|
+
const vaporSlot = isVaporInteropEnabled && slot && slot[rawVaporSlotKey];
|
|
2731
2816
|
if (vaporSlot) {
|
|
2732
2817
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2733
2818
|
ret.vs = {
|
|
2734
2819
|
slot: vaporSlot,
|
|
2820
|
+
name,
|
|
2735
2821
|
outlets: fallback ? [{
|
|
2736
2822
|
fallback,
|
|
2737
2823
|
owner: currentRenderingInstance
|
|
2738
2824
|
}] : void 0
|
|
2739
2825
|
};
|
|
2826
|
+
if (branchKey != null && props.key == null) {
|
|
2827
|
+
ret.vs.props = ret.props;
|
|
2828
|
+
ret.props = extend({}, ret.props, { key: branchKey });
|
|
2829
|
+
ret.key = branchKey;
|
|
2830
|
+
}
|
|
2740
2831
|
if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
|
|
2741
2832
|
return ret;
|
|
2742
2833
|
}
|
|
@@ -2757,7 +2848,7 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
|
2757
2848
|
try {
|
|
2758
2849
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2759
2850
|
let attached = false;
|
|
2760
|
-
if (fallback && validSlotContent && currentRenderingInstance) {
|
|
2851
|
+
if (isVaporInteropEnabled && fallback && validSlotContent && currentRenderingInstance) {
|
|
2761
2852
|
const interop = currentRenderingInstance.appContext.vapor;
|
|
2762
2853
|
if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
|
|
2763
2854
|
}
|
|
@@ -3940,7 +4031,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
3940
4031
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
3941
4032
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
3942
4033
|
const key = nextKeys[i];
|
|
3943
|
-
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
4034
|
+
if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
3944
4035
|
}
|
|
3945
4036
|
return false;
|
|
3946
4037
|
}
|
|
@@ -4483,7 +4574,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4483
4574
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4484
4575
|
break;
|
|
4485
4576
|
case VaporSlot:
|
|
4486
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4577
|
+
if (isVaporInteropEnabled) getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
|
|
4487
4578
|
break;
|
|
4488
4579
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4489
4580
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4619,7 +4710,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4619
4710
|
let vnodeHook;
|
|
4620
4711
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
4621
4712
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4622
|
-
if (n2.ibu) n2.ibu();
|
|
4713
|
+
if (isVaporInteropEnabled && n2.ibu) n2.ibu();
|
|
4623
4714
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
4624
4715
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
4625
4716
|
if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -4653,9 +4744,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4653
4744
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
4654
4745
|
}
|
|
4655
4746
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
4656
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
4747
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || isVaporInteropEnabled && n2.iu) queuePostRenderEffect(() => {
|
|
4657
4748
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
4658
|
-
n2.iu && n2.iu();
|
|
4749
|
+
isVaporInteropEnabled && n2.iu && n2.iu();
|
|
4659
4750
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
4660
4751
|
}, void 0, parentSuspense);
|
|
4661
4752
|
};
|
|
@@ -4663,7 +4754,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4663
4754
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4664
4755
|
const oldVNode = oldChildren[i];
|
|
4665
4756
|
const newVNode = newChildren[i];
|
|
4666
|
-
const
|
|
4757
|
+
const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
|
|
4758
|
+
const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
|
|
4667
4759
|
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
4668
4760
|
}
|
|
4669
4761
|
};
|
|
@@ -4703,7 +4795,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4703
4795
|
};
|
|
4704
4796
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4705
4797
|
n2.slotScopeIds = slotScopeIds;
|
|
4706
|
-
if (n2.type.__vapor) {
|
|
4798
|
+
if ((isVaporInteropEnabled || !!(process.env.NODE_ENV !== "production")) && n2.type.__vapor) {
|
|
4707
4799
|
if (n1 == null) {
|
|
4708
4800
|
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
4709
4801
|
else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
|
|
@@ -4760,6 +4852,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4760
4852
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
4761
4853
|
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
4762
4854
|
n2.el = n1.el;
|
|
4855
|
+
n2.placeholder = n1.placeholder;
|
|
4763
4856
|
updateComponentPreRender(instance, n2, optimized);
|
|
4764
4857
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
4765
4858
|
return;
|
|
@@ -4769,6 +4862,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4769
4862
|
}
|
|
4770
4863
|
} else {
|
|
4771
4864
|
n2.el = n1.el;
|
|
4865
|
+
n2.placeholder = n1.placeholder;
|
|
4772
4866
|
instance.vnode = n2;
|
|
4773
4867
|
}
|
|
4774
4868
|
};
|
|
@@ -4867,7 +4961,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4867
4961
|
} else next = vnode;
|
|
4868
4962
|
if (bu) invokeArrayFns(bu);
|
|
4869
4963
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4870
|
-
if (next.ibu) next.ibu();
|
|
4964
|
+
if (isVaporInteropEnabled && next.ibu) next.ibu();
|
|
4871
4965
|
toggleRecurse(instance, true);
|
|
4872
4966
|
if (!!(process.env.NODE_ENV !== "production")) startMeasure(instance, `render`);
|
|
4873
4967
|
const nextTree = renderComponentRoot(instance);
|
|
@@ -4880,9 +4974,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4880
4974
|
next.el = nextTree.el;
|
|
4881
4975
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
4882
4976
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
4883
|
-
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
4977
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || isVaporInteropEnabled && next.iu) queuePostRenderEffect(() => {
|
|
4884
4978
|
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
4885
|
-
next.iu && next.iu();
|
|
4979
|
+
isVaporInteropEnabled && next.iu && next.iu();
|
|
4886
4980
|
}, void 0, parentSuspense);
|
|
4887
4981
|
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) devtoolsComponentUpdated(instance);
|
|
4888
4982
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
@@ -5034,7 +5128,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5034
5128
|
};
|
|
5035
5129
|
const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
|
|
5036
5130
|
const { el, type, transition, children, shapeFlag } = vnode;
|
|
5037
|
-
if (isVaporComponent(type) || type === VaporSlot) {
|
|
5131
|
+
if (isVaporInteropEnabled && (isVaporComponent(type) || type === VaporSlot)) {
|
|
5038
5132
|
getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
|
|
5039
5133
|
return;
|
|
5040
5134
|
}
|
|
@@ -5078,11 +5172,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5078
5172
|
}
|
|
5079
5173
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
5080
5174
|
if (shapeFlag & 256) {
|
|
5081
|
-
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5175
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
5082
5176
|
else parentComponent.ctx.deactivate(vnode);
|
|
5083
5177
|
return;
|
|
5084
5178
|
}
|
|
5085
|
-
if (shapeFlag & 6 && isVaporComponent(type)) {
|
|
5179
|
+
if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
|
|
5086
5180
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5087
5181
|
return;
|
|
5088
5182
|
}
|
|
@@ -5100,7 +5194,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5100
5194
|
if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
|
|
5101
5195
|
else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
|
|
5102
5196
|
else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
|
|
5103
|
-
if (type === VaporSlot) {
|
|
5197
|
+
if (isVaporInteropEnabled && type === VaporSlot) {
|
|
5104
5198
|
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
5105
5199
|
return;
|
|
5106
5200
|
}
|
|
@@ -5115,12 +5209,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5115
5209
|
};
|
|
5116
5210
|
const remove = (vnode) => {
|
|
5117
5211
|
const { type, el, anchor, transition } = vnode;
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
else remove(child);
|
|
5122
|
-
});
|
|
5123
|
-
else removeFragment(el, anchor);
|
|
5212
|
+
const isFragment = type === Fragment;
|
|
5213
|
+
if (isFragment && !transition) {
|
|
5214
|
+
removeFragment(el, anchor);
|
|
5124
5215
|
return;
|
|
5125
5216
|
}
|
|
5126
5217
|
if (type === Static) {
|
|
@@ -5128,8 +5219,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5128
5219
|
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
5129
5220
|
return;
|
|
5130
5221
|
}
|
|
5131
|
-
|
|
5132
|
-
|
|
5222
|
+
const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
|
|
5223
|
+
const performRemove = () => {
|
|
5224
|
+
if (isFragment) {
|
|
5225
|
+
if (hostParentNode(el)) removeFragment(el, anchor);
|
|
5226
|
+
} else hostRemove(el);
|
|
5227
|
+
};
|
|
5228
|
+
if (transition) {
|
|
5229
|
+
let leavingEl = leavingNode && leavingNode.el;
|
|
5230
|
+
let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
|
|
5231
|
+
if (isVaporInteropEnabled && isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
|
|
5232
|
+
leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
|
|
5233
|
+
isElement = !!leavingEl;
|
|
5234
|
+
}
|
|
5235
|
+
performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
|
|
5236
|
+
} else performRemove();
|
|
5133
5237
|
};
|
|
5134
5238
|
const removeFragment = (cur, end) => {
|
|
5135
5239
|
let next;
|
|
@@ -5163,7 +5267,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5163
5267
|
};
|
|
5164
5268
|
const getNextHostNode = (vnode) => {
|
|
5165
5269
|
if (vnode.shapeFlag & 6) {
|
|
5166
|
-
if (isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
|
|
5270
|
+
if (isVaporInteropEnabled && isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
|
|
5167
5271
|
return getNextHostNode(vnode.component.subTree);
|
|
5168
5272
|
}
|
|
5169
5273
|
if (vnode.shapeFlag & 128) return vnode.suspense.next();
|
|
@@ -5172,15 +5276,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5172
5276
|
return teleportEnd ? hostNextSibling(teleportEnd) : el;
|
|
5173
5277
|
};
|
|
5174
5278
|
const render = (vnode, container, namespace) => {
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5182
|
-
container._vnode = vnode;
|
|
5183
|
-
flushOnAppMount(instance);
|
|
5279
|
+
flushOnAppMount(() => {
|
|
5280
|
+
if (vnode == null) {
|
|
5281
|
+
if (container._vnode) unmount(container._vnode, null, null, true);
|
|
5282
|
+
} else patch(container._vnode || null, vnode, container, null, null, null, namespace);
|
|
5283
|
+
container._vnode = vnode;
|
|
5284
|
+
}, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
|
|
5184
5285
|
};
|
|
5185
5286
|
const internals = {
|
|
5186
5287
|
p: patch,
|
|
@@ -5227,7 +5328,7 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
5227
5328
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
5228
5329
|
}
|
|
5229
5330
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
5230
|
-
if (!vapor) {
|
|
5331
|
+
if (!isVaporInteropEnabled || !vapor) {
|
|
5231
5332
|
if (allowed) {
|
|
5232
5333
|
effect.flags |= 128;
|
|
5233
5334
|
job.flags |= 2;
|
|
@@ -5339,7 +5440,7 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
|
|
|
5339
5440
|
currentParent = currentParent.parent;
|
|
5340
5441
|
} else break;
|
|
5341
5442
|
}
|
|
5342
|
-
const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5443
|
+
const vaporScopeIds = isVaporInteropEnabled && includeVaporRootIds && currentVNode.vaporScopeIds;
|
|
5343
5444
|
if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
|
|
5344
5445
|
return inheritedScopeIds;
|
|
5345
5446
|
}
|
|
@@ -5352,8 +5453,13 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
5352
5453
|
//#endregion
|
|
5353
5454
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
5354
5455
|
const isSuspense = (type) => type.__isSuspense;
|
|
5456
|
+
let isSuspenseEnabled = false;
|
|
5457
|
+
function withSuspenseEnabled(value) {
|
|
5458
|
+
isSuspenseEnabled = true;
|
|
5459
|
+
return value;
|
|
5460
|
+
}
|
|
5355
5461
|
let suspenseId = 0;
|
|
5356
|
-
const Suspense = {
|
|
5462
|
+
const Suspense = /*@__PURE__*/ withSuspenseEnabled({
|
|
5357
5463
|
name: "Suspense",
|
|
5358
5464
|
__isSuspense: true,
|
|
5359
5465
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
@@ -5370,7 +5476,7 @@ const Suspense = {
|
|
|
5370
5476
|
},
|
|
5371
5477
|
hydrate: hydrateSuspense,
|
|
5372
5478
|
normalize: normalizeSuspenseChildren
|
|
5373
|
-
};
|
|
5479
|
+
});
|
|
5374
5480
|
function triggerEvent(vnode, name) {
|
|
5375
5481
|
const eventListener = vnode.props && vnode.props[name];
|
|
5376
5482
|
if (isFunction(eventListener)) eventListener();
|
|
@@ -5575,13 +5681,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5575
5681
|
registerDep(instance, onResolve) {
|
|
5576
5682
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
5577
5683
|
if (isInPendingSuspense) suspense.deps++;
|
|
5578
|
-
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
5579
5684
|
instance.asyncDep.catch((err) => {
|
|
5580
5685
|
handleError(err, instance, 0);
|
|
5581
5686
|
}).then((asyncSetupResult) => {
|
|
5582
5687
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
5583
5688
|
setCurrentInstance(null, void 0);
|
|
5584
|
-
if (
|
|
5689
|
+
if (!instance.scope.active) {
|
|
5585
5690
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
5586
5691
|
return;
|
|
5587
5692
|
}
|
|
@@ -5894,7 +5999,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5894
5999
|
ctx: vnode.ctx,
|
|
5895
6000
|
ce: vnode.ce,
|
|
5896
6001
|
vi: vnode.vi,
|
|
5897
|
-
vs: cloneVaporSlotMeta(vnode),
|
|
6002
|
+
vs: cloneVaporSlotMeta(vnode, extraProps),
|
|
5898
6003
|
vb: vnode.vb,
|
|
5899
6004
|
ibu: vnode.ibu,
|
|
5900
6005
|
iu: vnode.iu,
|
|
@@ -5903,13 +6008,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
5903
6008
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
5904
6009
|
return cloned;
|
|
5905
6010
|
}
|
|
5906
|
-
function cloneVaporSlotMeta(vnode) {
|
|
6011
|
+
function cloneVaporSlotMeta(vnode, extraProps) {
|
|
5907
6012
|
const vaporSlot = vnode.vs;
|
|
5908
6013
|
if (!vaporSlot) return vaporSlot;
|
|
5909
6014
|
const cloned = {
|
|
5910
6015
|
slot: vaporSlot.slot,
|
|
5911
|
-
|
|
6016
|
+
name: vaporSlot.name,
|
|
6017
|
+
outlets: vaporSlot.outlets,
|
|
6018
|
+
props: vaporSlot.props,
|
|
6019
|
+
attrs: vaporSlot.attrs && vaporSlot.attrs === EMPTY_OBJ ? {} : vaporSlot.attrs,
|
|
6020
|
+
group: vaporSlot.group
|
|
5912
6021
|
};
|
|
6022
|
+
const attrs = cloned.attrs;
|
|
6023
|
+
if (extraProps && vaporSlot.props) {
|
|
6024
|
+
let extraSlotProps;
|
|
6025
|
+
for (const key in extraProps) if (attrs ? !isReservedProp(key) : key !== "key") {
|
|
6026
|
+
if (!extraSlotProps) extraSlotProps = {};
|
|
6027
|
+
extraSlotProps[key] = extraProps[key];
|
|
6028
|
+
}
|
|
6029
|
+
if (extraSlotProps) {
|
|
6030
|
+
if (attrs) cloned.attrs = mergeProps(attrs, extraSlotProps);
|
|
6031
|
+
else cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
|
|
6032
|
+
}
|
|
6033
|
+
}
|
|
5913
6034
|
if (vnode.el) {
|
|
5914
6035
|
cloned.state = vaporSlot.state;
|
|
5915
6036
|
cloned.ref = vaporSlot.ref;
|
|
@@ -6101,6 +6222,9 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
6101
6222
|
//#region packages/runtime-core/src/component.ts
|
|
6102
6223
|
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
6103
6224
|
let uid = 0;
|
|
6225
|
+
function getNextUid() {
|
|
6226
|
+
return uid;
|
|
6227
|
+
}
|
|
6104
6228
|
/**
|
|
6105
6229
|
* @internal for vapor
|
|
6106
6230
|
*/
|
|
@@ -6194,7 +6318,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
|
|
|
6194
6318
|
isSSR && setInSSRSetupState(isSSR);
|
|
6195
6319
|
const { props, children, vi } = instance.vnode;
|
|
6196
6320
|
const isStateful = isStatefulComponent(instance);
|
|
6197
|
-
if (vi) vi(instance);
|
|
6321
|
+
if (isVaporInteropEnabled && vi) vi(instance);
|
|
6198
6322
|
else {
|
|
6199
6323
|
initProps(instance, props, isStateful, isSSR);
|
|
6200
6324
|
initSlots(instance, children, optimized || isSSR);
|
|
@@ -6626,7 +6750,7 @@ function isMemoSame(cached, memo) {
|
|
|
6626
6750
|
}
|
|
6627
6751
|
//#endregion
|
|
6628
6752
|
//#region packages/runtime-core/src/index.ts
|
|
6629
|
-
const version = "3.6.0-rc.
|
|
6753
|
+
const version = "3.6.0-rc.13";
|
|
6630
6754
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
6631
6755
|
/**
|
|
6632
6756
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6664,4 +6788,4 @@ const resolveFilter = null;
|
|
|
6664
6788
|
const compatUtils = null;
|
|
6665
6789
|
const DeprecationTypes = null;
|
|
6666
6790
|
//#endregion
|
|
6667
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
6791
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, TriggerOpTypes, VaporSlot, activate, assertNumber, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, defaultPropGetter, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureValidVNode, enterCbKey, expose, filterModelListeners, filterSingleRoot, flushOnAppMount, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getNextUid, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, invokeSlotFallback, invokeVNodeHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isKeepAliveEnabled, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isSuspenseEnabled, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isTransitionEnabled, isUnchangedResourceProp, isVNode, isValidHtmlOrSvgAttribute, isVaporInteropEnabled, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, normalizeClass, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveCssVars, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVaporInteropEnabled, shallowReactive, shallowReadonly, shallowRef, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, useAsyncComponentState, useAttrs, useId, useInstanceOption, useModel, useSSRContext, useSlots, useTemplateRef, useTransitionState, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeepAliveEnabled, withMemo, withScopeId, withSuspenseEnabled, withTransitionEnabled };
|