@vue/runtime-core 3.6.0-rc.5 → 3.6.0-rc.7
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 +454 -328
- package/dist/runtime-core.cjs.prod.js +331 -259
- package/dist/runtime-core.d.ts +599 -610
- package/dist/runtime-core.esm-bundler.js +455 -329
- 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.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -153,7 +153,7 @@ let currentFlushPromise = null;
|
|
|
153
153
|
let jobsLength = 0;
|
|
154
154
|
let flushIndex = 0;
|
|
155
155
|
let postFlushIndex = 0;
|
|
156
|
-
const resolvedPromise =
|
|
156
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
157
157
|
function nextTick(fn) {
|
|
158
158
|
const p = currentFlushPromise || resolvedPromise;
|
|
159
159
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
@@ -191,6 +191,7 @@ const doFlushJobs = () => {
|
|
|
191
191
|
flushJobs();
|
|
192
192
|
} catch (e) {
|
|
193
193
|
currentFlushPromise = null;
|
|
194
|
+
if (jobsLength || postJobs.length) queueFlush();
|
|
194
195
|
throw e;
|
|
195
196
|
}
|
|
196
197
|
};
|
|
@@ -198,9 +199,10 @@ function queueFlush() {
|
|
|
198
199
|
if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
|
|
199
200
|
}
|
|
200
201
|
function queuePostFlushCb(jobs, id = Infinity) {
|
|
201
|
-
if (!(0, _vue_shared.isArray)(jobs))
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
if (!(0, _vue_shared.isArray)(jobs)) {
|
|
203
|
+
if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
|
|
204
|
+
else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
|
|
205
|
+
} else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
|
|
204
206
|
queueFlush();
|
|
205
207
|
}
|
|
206
208
|
function flushPreFlushCbs(instance, seen) {
|
|
@@ -212,8 +214,11 @@ function flushPreFlushCbs(instance, seen) {
|
|
|
212
214
|
i--;
|
|
213
215
|
jobsLength--;
|
|
214
216
|
if (cb.flags & 2) cb.flags &= -2;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
try {
|
|
218
|
+
cb();
|
|
219
|
+
} finally {
|
|
220
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
221
|
+
}
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
function flushPostFlushCbs(seen) {
|
|
@@ -225,17 +230,21 @@ function flushPostFlushCbs(seen) {
|
|
|
225
230
|
}
|
|
226
231
|
activePostJobs = postJobs;
|
|
227
232
|
postJobs = [];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
cb
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
try {
|
|
234
|
+
while (postFlushIndex < activePostJobs.length) {
|
|
235
|
+
const cb = activePostJobs[postFlushIndex++];
|
|
236
|
+
if (cb.flags & 2) cb.flags &= -2;
|
|
237
|
+
if (!(cb.flags & 4)) try {
|
|
238
|
+
cb();
|
|
239
|
+
} finally {
|
|
240
|
+
if (!(cb.flags & 2)) cb.flags &= -2;
|
|
241
|
+
}
|
|
235
242
|
}
|
|
243
|
+
} finally {
|
|
244
|
+
while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
|
|
245
|
+
activePostJobs = null;
|
|
246
|
+
postFlushIndex = 0;
|
|
236
247
|
}
|
|
237
|
-
activePostJobs = null;
|
|
238
|
-
postFlushIndex = 0;
|
|
239
248
|
}
|
|
240
249
|
}
|
|
241
250
|
let isFlushing = false;
|
|
@@ -245,9 +254,12 @@ let isFlushing = false;
|
|
|
245
254
|
function flushOnAppMount(instance) {
|
|
246
255
|
if (!isFlushing) {
|
|
247
256
|
isFlushing = true;
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
257
|
+
try {
|
|
258
|
+
flushPreFlushCbs(instance);
|
|
259
|
+
flushPostFlushCbs();
|
|
260
|
+
} finally {
|
|
261
|
+
isFlushing = false;
|
|
262
|
+
}
|
|
251
263
|
}
|
|
252
264
|
}
|
|
253
265
|
function flushJobs(seen) {
|
|
@@ -275,8 +287,8 @@ function flushJobs(seen) {
|
|
|
275
287
|
jobsLength = 0;
|
|
276
288
|
jobs.length = 0;
|
|
277
289
|
flushPostFlushCbs(seen);
|
|
278
|
-
currentFlushPromise = null;
|
|
279
290
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
291
|
+
else currentFlushPromise = null;
|
|
280
292
|
}
|
|
281
293
|
}
|
|
282
294
|
//#endregion
|
|
@@ -537,9 +549,10 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
|
|
|
537
549
|
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
538
550
|
const resolveTarget = (props, select) => {
|
|
539
551
|
const targetSelector = props && props.to;
|
|
540
|
-
if ((0, _vue_shared.isString)(targetSelector))
|
|
541
|
-
|
|
542
|
-
|
|
552
|
+
if ((0, _vue_shared.isString)(targetSelector)) {
|
|
553
|
+
if (!select) return null;
|
|
554
|
+
else return select(targetSelector);
|
|
555
|
+
} else return targetSelector;
|
|
543
556
|
};
|
|
544
557
|
const TeleportImpl = {
|
|
545
558
|
name: "Teleport",
|
|
@@ -570,7 +583,8 @@ const TeleportImpl = {
|
|
|
570
583
|
if (pendingMounts.get(vnode) !== mountJob) return;
|
|
571
584
|
pendingMounts.delete(vnode);
|
|
572
585
|
if (isTeleportDisabled(vnode.props)) {
|
|
573
|
-
|
|
586
|
+
const mountContainer = parentNode(vnode.el) || container;
|
|
587
|
+
mount(vnode, mountContainer, vnode.anchor);
|
|
574
588
|
updateCssVars(vnode, true);
|
|
575
589
|
}
|
|
576
590
|
mountToTarget(vnode);
|
|
@@ -679,15 +693,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
679
693
|
const disabled = isTeleportDisabled(vnode.props);
|
|
680
694
|
if (target) {
|
|
681
695
|
const targetNode = target._lpa || target.firstChild;
|
|
682
|
-
if (vnode.shapeFlag & 16)
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
696
|
+
if (vnode.shapeFlag & 16) {
|
|
697
|
+
if (disabled) {
|
|
698
|
+
hydrateDisabledTeleport(node, vnode);
|
|
699
|
+
hydrateAnchor(target, targetNode);
|
|
700
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
701
|
+
} else {
|
|
702
|
+
vnode.anchor = nextSibling(node);
|
|
703
|
+
hydrateAnchor(target, targetNode);
|
|
704
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
705
|
+
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
706
|
+
}
|
|
691
707
|
}
|
|
692
708
|
updateCssVars(vnode, disabled);
|
|
693
709
|
} else if (disabled) {
|
|
@@ -847,8 +863,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
847
863
|
persisted,
|
|
848
864
|
beforeEnter(el) {
|
|
849
865
|
let hook = onBeforeEnter;
|
|
850
|
-
if (!state.isMounted)
|
|
851
|
-
|
|
866
|
+
if (!state.isMounted) {
|
|
867
|
+
if (appear) hook = onBeforeAppear || onBeforeEnter;
|
|
868
|
+
else return;
|
|
869
|
+
}
|
|
852
870
|
if (el[leaveCbKey]) el[leaveCbKey](true);
|
|
853
871
|
earlyRemove();
|
|
854
872
|
callHook(hook, [el]);
|
|
@@ -858,11 +876,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
858
876
|
let hook = onEnter;
|
|
859
877
|
let afterHook = onAfterEnter;
|
|
860
878
|
let cancelHook = onEnterCancelled;
|
|
861
|
-
if (!state.isMounted)
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
879
|
+
if (!state.isMounted) {
|
|
880
|
+
if (appear) {
|
|
881
|
+
hook = onAppear || onEnter;
|
|
882
|
+
afterHook = onAfterAppear || onAfterEnter;
|
|
883
|
+
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
884
|
+
} else return;
|
|
885
|
+
}
|
|
866
886
|
let called = false;
|
|
867
887
|
el[enterCbKey] = (cancelled) => {
|
|
868
888
|
if (called) return;
|
|
@@ -896,7 +916,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
896
916
|
else done();
|
|
897
917
|
},
|
|
898
918
|
clone(node) {
|
|
899
|
-
return cloneHooks(node);
|
|
919
|
+
return cloneHooks ? cloneHooks(node) : hooks;
|
|
900
920
|
}
|
|
901
921
|
};
|
|
902
922
|
return hooks;
|
|
@@ -1022,9 +1042,9 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1022
1042
|
}
|
|
1023
1043
|
//#endregion
|
|
1024
1044
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1025
|
-
|
|
1045
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1026
1046
|
function defineComponent(options, extraOptions) {
|
|
1027
|
-
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1047
|
+
return (0, _vue_shared.isFunction)(options) ? /*@__PURE__*/ (() => (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }))() : options;
|
|
1028
1048
|
}
|
|
1029
1049
|
//#endregion
|
|
1030
1050
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
@@ -1111,15 +1131,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1111
1131
|
if (rawRef.f) {
|
|
1112
1132
|
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
|
|
1113
1133
|
if (isUnmount) (0, _vue_shared.isArray)(existing) && (0, _vue_shared.remove)(existing, refValue);
|
|
1114
|
-
else if (!(0, _vue_shared.isArray)(existing))
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1134
|
+
else if (!(0, _vue_shared.isArray)(existing)) {
|
|
1135
|
+
if (_isString) {
|
|
1136
|
+
refs[ref] = [refValue];
|
|
1137
|
+
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
1138
|
+
} else {
|
|
1139
|
+
const newVal = [refValue];
|
|
1140
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
1141
|
+
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
1142
|
+
}
|
|
1143
|
+
} else if (!existing.includes(refValue)) existing.push(refValue);
|
|
1123
1144
|
} else if (_isString) {
|
|
1124
1145
|
refs[ref] = value;
|
|
1125
1146
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
@@ -1215,11 +1236,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1215
1236
|
let nextNode = null;
|
|
1216
1237
|
switch (type) {
|
|
1217
1238
|
case Text:
|
|
1218
|
-
if (domType !== 3)
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1239
|
+
if (domType !== 3) {
|
|
1240
|
+
if (vnode.children === "") {
|
|
1241
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1242
|
+
nextNode = node;
|
|
1243
|
+
} else nextNode = onMismatch();
|
|
1244
|
+
} else {
|
|
1223
1245
|
if (node.data !== vnode.children) {
|
|
1224
1246
|
logMismatchError();
|
|
1225
1247
|
node.data = vnode.children;
|
|
@@ -1257,9 +1279,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1257
1279
|
case VaporSlot:
|
|
1258
1280
|
nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
|
|
1259
1281
|
break;
|
|
1260
|
-
default: if (shapeFlag & 1)
|
|
1261
|
-
|
|
1262
|
-
|
|
1282
|
+
default: if (shapeFlag & 1) {
|
|
1283
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
|
|
1284
|
+
else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
1285
|
+
} else if (shapeFlag & 6) {
|
|
1263
1286
|
vnode.slotScopeIds = slotScopeIds;
|
|
1264
1287
|
const container = parentNode(node);
|
|
1265
1288
|
if (isFragmentStart) nextNode = locateClosingAnchor(node);
|
|
@@ -1281,19 +1304,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1281
1304
|
} else {
|
|
1282
1305
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
1283
1306
|
const component = vnode.component;
|
|
1284
|
-
if (isAsyncWrapper(vnode)
|
|
1307
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep && !component.asyncResolved)) {
|
|
1285
1308
|
let subTree;
|
|
1286
1309
|
if (isFragmentStart) {
|
|
1287
|
-
subTree = createVNode(
|
|
1310
|
+
subTree = createVNode(Static);
|
|
1288
1311
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1289
1312
|
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1290
1313
|
subTree.el = node;
|
|
1291
1314
|
component.subTree = subTree;
|
|
1292
1315
|
}
|
|
1293
1316
|
}
|
|
1294
|
-
} else if (shapeFlag & 64)
|
|
1295
|
-
|
|
1296
|
-
|
|
1317
|
+
} else if (shapeFlag & 64) {
|
|
1318
|
+
if (domType !== 8) nextNode = onMismatch();
|
|
1319
|
+
else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
|
|
1320
|
+
} else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
|
|
1297
1321
|
}
|
|
1298
1322
|
if (ref != null) setRef(ref, null, parentSuspense, vnode);
|
|
1299
1323
|
return nextNode;
|
|
@@ -1422,8 +1446,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1422
1446
|
node = nextSibling(node);
|
|
1423
1447
|
if (node && isComment(node)) {
|
|
1424
1448
|
if (node.data === open) match++;
|
|
1425
|
-
if (node.data === close)
|
|
1426
|
-
|
|
1449
|
+
if (node.data === close) {
|
|
1450
|
+
if (match === 0) return nextSibling(node);
|
|
1451
|
+
else match--;
|
|
1452
|
+
}
|
|
1427
1453
|
}
|
|
1428
1454
|
}
|
|
1429
1455
|
return node;
|
|
@@ -1445,7 +1471,7 @@ const isTemplateNode = (node) => {
|
|
|
1445
1471
|
/**
|
|
1446
1472
|
* Dev only
|
|
1447
1473
|
*/
|
|
1448
|
-
const resourceProps =
|
|
1474
|
+
const resourceProps = /*@__PURE__*/ new Set([
|
|
1449
1475
|
"src",
|
|
1450
1476
|
"srcset",
|
|
1451
1477
|
"href",
|
|
@@ -1577,14 +1603,14 @@ function forEachElement(node, cb) {
|
|
|
1577
1603
|
//#endregion
|
|
1578
1604
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1579
1605
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1580
|
-
|
|
1606
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1581
1607
|
function defineAsyncComponent(source) {
|
|
1582
1608
|
const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
|
|
1583
1609
|
return /* @__PURE__ */ defineComponent({
|
|
1584
1610
|
name: "AsyncComponentWrapper",
|
|
1585
1611
|
__asyncLoader: load,
|
|
1586
1612
|
__asyncHydrate(el, instance, hydrate) {
|
|
1587
|
-
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
|
|
1613
|
+
performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
|
|
1588
1614
|
},
|
|
1589
1615
|
get __asyncResolved() {
|
|
1590
1616
|
return getResolvedComp();
|
|
@@ -1701,10 +1727,10 @@ const useAsyncComponentState = (delay, timeout, onError, instance = currentInsta
|
|
|
1701
1727
|
* shared between core and vapor
|
|
1702
1728
|
* @internal
|
|
1703
1729
|
*/
|
|
1704
|
-
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
|
|
1730
|
+
function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
|
|
1705
1731
|
const wasConnected = el.isConnected;
|
|
1706
1732
|
let patched = false;
|
|
1707
|
-
(instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1733
|
+
if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
|
|
1708
1734
|
const performHydrate = () => {
|
|
1709
1735
|
if (patched) return;
|
|
1710
1736
|
if (!el.parentNode || wasConnected && !el.isConnected) return;
|
|
@@ -1787,10 +1813,13 @@ const KeepAlive = {
|
|
|
1787
1813
|
});
|
|
1788
1814
|
let pendingCacheKey = null;
|
|
1789
1815
|
const cacheSubtree = () => {
|
|
1790
|
-
if (pendingCacheKey != null)
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1816
|
+
if (pendingCacheKey != null) {
|
|
1817
|
+
if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
|
|
1818
|
+
const vnode = getInnerChild(keepAliveInstance.subTree);
|
|
1819
|
+
if (vnode.component) cache.set(pendingCacheKey, vnode);
|
|
1820
|
+
}, void 0, keepAliveInstance.subTree.suspense);
|
|
1821
|
+
else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
|
|
1822
|
+
}
|
|
1794
1823
|
};
|
|
1795
1824
|
onMounted(cacheSubtree);
|
|
1796
1825
|
onUpdated(cacheSubtree);
|
|
@@ -2028,16 +2057,17 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2028
2057
|
} else if (typeof source === "number") {
|
|
2029
2058
|
ret = new Array(source);
|
|
2030
2059
|
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2031
|
-
} else if ((0, _vue_shared.isObject)(source))
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2060
|
+
} else if ((0, _vue_shared.isObject)(source)) {
|
|
2061
|
+
if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2062
|
+
else {
|
|
2063
|
+
const keys = Object.keys(source);
|
|
2064
|
+
ret = new Array(keys.length);
|
|
2065
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2066
|
+
const key = keys[i];
|
|
2067
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2068
|
+
}
|
|
2038
2069
|
}
|
|
2039
|
-
}
|
|
2040
|
-
else ret = [];
|
|
2070
|
+
} else ret = [];
|
|
2041
2071
|
if (cache) cache[index] = ret;
|
|
2042
2072
|
return ret;
|
|
2043
2073
|
}
|
|
@@ -2062,14 +2092,27 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2062
2092
|
//#endregion
|
|
2063
2093
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2064
2094
|
/**
|
|
2095
|
+
* Links a slot function to its raw vapor slot: a raw vapor slot carries
|
|
2096
|
+
* itself, and the wrapper the interop slots proxy hands out carries the raw
|
|
2097
|
+
* slot it wraps — one lookup answers both "is this a vapor slot" and
|
|
2098
|
+
* "which one". Internal to vapor interop.
|
|
2099
|
+
*/
|
|
2100
|
+
const rawVaporSlotKey = Symbol(`rawVaporSlot`);
|
|
2101
|
+
/**
|
|
2102
|
+
* Marks a compiler-generated slot fallback as VDOM-rendered so the vapor
|
|
2103
|
+
* interop fallback chain renders it through the VDOM renderer. Internal to
|
|
2104
|
+
* vapor interop.
|
|
2105
|
+
*/
|
|
2106
|
+
const vdomSlotFallbackKey = Symbol(`vdomSlotFallback`);
|
|
2107
|
+
/**
|
|
2065
2108
|
* Compiler runtime helper for rendering `<slot/>`
|
|
2066
2109
|
* @private
|
|
2067
2110
|
*/
|
|
2068
2111
|
function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
|
|
2069
2112
|
if (props == null) props = {};
|
|
2070
2113
|
let slot = slots[name];
|
|
2071
|
-
if (fallback) fallback
|
|
2072
|
-
const vaporSlot = slot &&
|
|
2114
|
+
if (fallback) fallback[vdomSlotFallbackKey] = true;
|
|
2115
|
+
const vaporSlot = slot && slot[rawVaporSlotKey];
|
|
2073
2116
|
if (vaporSlot) {
|
|
2074
2117
|
const ret = (openBlock(), createBlock(VaporSlot, props));
|
|
2075
2118
|
ret.vs = {
|
|
@@ -2222,7 +2265,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
2222
2265
|
return Reflect.defineProperty(target, key, descriptor);
|
|
2223
2266
|
}
|
|
2224
2267
|
};
|
|
2225
|
-
const RuntimeCompiledPublicInstanceProxyHandlers =
|
|
2268
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ (0, _vue_shared.extend)({}, PublicInstanceProxyHandlers, {
|
|
2226
2269
|
get(target, key) {
|
|
2227
2270
|
if (key === Symbol.unscopables) return;
|
|
2228
2271
|
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
@@ -2335,12 +2378,13 @@ function mergeDefaults(raw, defaults) {
|
|
|
2335
2378
|
for (const key in defaults) {
|
|
2336
2379
|
if (key.startsWith("__skip")) continue;
|
|
2337
2380
|
let opt = props[key];
|
|
2338
|
-
if (opt)
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2381
|
+
if (opt) {
|
|
2382
|
+
if ((0, _vue_shared.isArray)(opt) || (0, _vue_shared.isFunction)(opt)) opt = props[key] = {
|
|
2383
|
+
type: opt,
|
|
2384
|
+
default: defaults[key]
|
|
2385
|
+
};
|
|
2386
|
+
else opt.default = defaults[key];
|
|
2387
|
+
} else if (opt === null) opt = props[key] = { default: defaults[key] };
|
|
2344
2388
|
if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
|
|
2345
2389
|
}
|
|
2346
2390
|
return props;
|
|
@@ -2446,9 +2490,11 @@ function applyOptions(instance) {
|
|
|
2446
2490
|
shouldCacheAccess = true;
|
|
2447
2491
|
if (computedOptions) for (const key in computedOptions) {
|
|
2448
2492
|
const opt = computedOptions[key];
|
|
2493
|
+
const get = (0, _vue_shared.isFunction)(opt) ? opt.bind(publicThis, publicThis) : (0, _vue_shared.isFunction)(opt.get) ? opt.get.bind(publicThis, publicThis) : _vue_shared.NOOP;
|
|
2494
|
+
const set = !(0, _vue_shared.isFunction)(opt) && (0, _vue_shared.isFunction)(opt.set) ? opt.set.bind(publicThis) : _vue_shared.NOOP;
|
|
2449
2495
|
const c = computed({
|
|
2450
|
-
get
|
|
2451
|
-
set
|
|
2496
|
+
get,
|
|
2497
|
+
set
|
|
2452
2498
|
});
|
|
2453
2499
|
Object.defineProperty(ctx, key, {
|
|
2454
2500
|
enumerable: true,
|
|
@@ -2504,9 +2550,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = _vue_s
|
|
|
2504
2550
|
for (const key in injectOptions) {
|
|
2505
2551
|
const opt = injectOptions[key];
|
|
2506
2552
|
let injected;
|
|
2507
|
-
if ((0, _vue_shared.isObject)(opt))
|
|
2508
|
-
|
|
2509
|
-
|
|
2553
|
+
if ((0, _vue_shared.isObject)(opt)) {
|
|
2554
|
+
if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
|
|
2555
|
+
else injected = inject(opt.from || key);
|
|
2556
|
+
} else injected = inject(opt);
|
|
2510
2557
|
if ((0, _vue_reactivity.isRef)(injected)) Object.defineProperty(ctx, key, {
|
|
2511
2558
|
enumerable: true,
|
|
2512
2559
|
configurable: true,
|
|
@@ -2525,10 +2572,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
2525
2572
|
const handler = ctx[raw];
|
|
2526
2573
|
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler);
|
|
2527
2574
|
} else if ((0, _vue_shared.isFunction)(raw)) watch(getter, raw.bind(publicThis));
|
|
2528
|
-
else if ((0, _vue_shared.isObject)(raw))
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2575
|
+
else if ((0, _vue_shared.isObject)(raw)) {
|
|
2576
|
+
if ((0, _vue_shared.isArray)(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2577
|
+
else {
|
|
2578
|
+
const handler = (0, _vue_shared.isFunction)(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2579
|
+
if ((0, _vue_shared.isFunction)(handler)) watch(getter, handler, raw);
|
|
2580
|
+
}
|
|
2532
2581
|
}
|
|
2533
2582
|
}
|
|
2534
2583
|
/**
|
|
@@ -2614,7 +2663,7 @@ function mergeObjectOptions(to, from) {
|
|
|
2614
2663
|
}
|
|
2615
2664
|
function mergeEmitsOrPropsOptions(to, from) {
|
|
2616
2665
|
if (to) {
|
|
2617
|
-
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [
|
|
2666
|
+
if ((0, _vue_shared.isArray)(to) && (0, _vue_shared.isArray)(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2618
2667
|
return (0, _vue_shared.extend)(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
|
|
2619
2668
|
} else return from;
|
|
2620
2669
|
}
|
|
@@ -2817,7 +2866,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
|
|
|
2817
2866
|
const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
|
|
2818
2867
|
if (modifiers) {
|
|
2819
2868
|
if (modifiers.trim) args = rawArgs.map((a) => (0, _vue_shared.isString)(a) ? a.trim() : a);
|
|
2820
|
-
if (modifiers.number) args =
|
|
2869
|
+
if (modifiers.number) args = args.map(_vue_shared.looseToNumber);
|
|
2821
2870
|
}
|
|
2822
2871
|
let handlerName;
|
|
2823
2872
|
let handler = getter(props, handlerName = (0, _vue_shared.toHandlerKey)(event)) || getter(props, handlerName = (0, _vue_shared.toHandlerKey)((0, _vue_shared.camelize)(event)));
|
|
@@ -2928,8 +2977,10 @@ function filterSingleRoot(children, recurse = true) {
|
|
|
2928
2977
|
for (let i = 0; i < children.length; i++) {
|
|
2929
2978
|
const child = children[i];
|
|
2930
2979
|
if (isVNode(child)) {
|
|
2931
|
-
if (child.type !== Comment || child.children === "v-if")
|
|
2932
|
-
|
|
2980
|
+
if (child.type !== Comment || child.children === "v-if") {
|
|
2981
|
+
if (singleRoot) return;
|
|
2982
|
+
else singleRoot = child;
|
|
2983
|
+
}
|
|
2933
2984
|
} else return;
|
|
2934
2985
|
}
|
|
2935
2986
|
return singleRoot;
|
|
@@ -3038,16 +3089,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3038
3089
|
let key = propsToUpdate[i];
|
|
3039
3090
|
if (isEmitListener(instance.emitsOptions, key)) continue;
|
|
3040
3091
|
const value = rawProps[key];
|
|
3041
|
-
if (options)
|
|
3042
|
-
if (
|
|
3043
|
-
attrs[key]
|
|
3044
|
-
|
|
3092
|
+
if (options) {
|
|
3093
|
+
if ((0, _vue_shared.hasOwn)(attrs, key)) {
|
|
3094
|
+
if (value !== attrs[key]) {
|
|
3095
|
+
attrs[key] = value;
|
|
3096
|
+
hasAttrsChanged = true;
|
|
3097
|
+
}
|
|
3098
|
+
} else {
|
|
3099
|
+
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3100
|
+
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3045
3101
|
}
|
|
3046
|
-
} else {
|
|
3047
|
-
const camelizedKey = (0, _vue_shared.camelize)(key);
|
|
3048
|
-
props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
|
|
3049
|
-
}
|
|
3050
|
-
else if (value !== attrs[key]) {
|
|
3102
|
+
} else if (value !== attrs[key]) {
|
|
3051
3103
|
attrs[key] = value;
|
|
3052
3104
|
hasAttrsChanged = true;
|
|
3053
3105
|
}
|
|
@@ -3056,9 +3108,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
3056
3108
|
} else {
|
|
3057
3109
|
if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
|
|
3058
3110
|
let kebabKey;
|
|
3059
|
-
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey)))
|
|
3060
|
-
if (
|
|
3061
|
-
|
|
3111
|
+
for (const key in rawCurrentProps) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && ((kebabKey = (0, _vue_shared.hyphenate)(key)) === key || !(0, _vue_shared.hasOwn)(rawProps, kebabKey))) {
|
|
3112
|
+
if (options) {
|
|
3113
|
+
if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
|
|
3114
|
+
} else delete props[key];
|
|
3115
|
+
}
|
|
3062
3116
|
if (attrs !== rawCurrentProps) {
|
|
3063
3117
|
for (const key in attrs) if (!rawProps || !(0, _vue_shared.hasOwn)(rawProps, key) && true) {
|
|
3064
3118
|
delete attrs[key];
|
|
@@ -3076,9 +3130,10 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
3076
3130
|
if ((0, _vue_shared.isReservedProp)(key)) continue;
|
|
3077
3131
|
const value = rawProps[key];
|
|
3078
3132
|
let camelKey;
|
|
3079
|
-
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key)))
|
|
3080
|
-
|
|
3081
|
-
|
|
3133
|
+
if (options && (0, _vue_shared.hasOwn)(options, camelKey = (0, _vue_shared.camelize)(key))) {
|
|
3134
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
|
|
3135
|
+
else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3136
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3082
3137
|
if (!(key in attrs) || value !== attrs[key]) {
|
|
3083
3138
|
attrs[key] = value;
|
|
3084
3139
|
hasAttrsChanged = true;
|
|
@@ -3239,9 +3294,10 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3239
3294
|
let deletionComparisonTarget = _vue_shared.EMPTY_OBJ;
|
|
3240
3295
|
if (vnode.shapeFlag & 32) {
|
|
3241
3296
|
const type = children._;
|
|
3242
|
-
if (type)
|
|
3243
|
-
|
|
3244
|
-
|
|
3297
|
+
if (type) {
|
|
3298
|
+
if (optimized && type === 1) needDeletionCheck = false;
|
|
3299
|
+
else assignSlots(slots, children, optimized);
|
|
3300
|
+
} else {
|
|
3245
3301
|
needDeletionCheck = !children.$stable;
|
|
3246
3302
|
normalizeObjectSlots(children, slots, instance);
|
|
3247
3303
|
}
|
|
@@ -3412,7 +3468,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3412
3468
|
for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
|
|
3413
3469
|
};
|
|
3414
3470
|
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
3415
|
-
for (let i = start; i < children.length; i++)
|
|
3471
|
+
for (let i = start; i < children.length; i++) {
|
|
3472
|
+
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
3473
|
+
patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3474
|
+
}
|
|
3416
3475
|
};
|
|
3417
3476
|
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3418
3477
|
const el = n2.el = n1.el;
|
|
@@ -3423,6 +3482,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3423
3482
|
let vnodeHook;
|
|
3424
3483
|
parentComponent && toggleRecurse(parentComponent, false);
|
|
3425
3484
|
if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3485
|
+
if (n2.ibu) n2.ibu();
|
|
3426
3486
|
if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3427
3487
|
parentComponent && toggleRecurse(parentComponent, true);
|
|
3428
3488
|
if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
|
|
@@ -3454,8 +3514,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3454
3514
|
if (n1.children !== n2.children) hostSetElementText(el, n2.children);
|
|
3455
3515
|
}
|
|
3456
3516
|
} else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
|
|
3457
|
-
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
|
|
3517
|
+
if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
|
|
3458
3518
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3519
|
+
n2.iu && n2.iu();
|
|
3459
3520
|
dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3460
3521
|
}, void 0, parentSuspense);
|
|
3461
3522
|
};
|
|
@@ -3463,7 +3524,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3463
3524
|
for (let i = 0; i < newChildren.length; i++) {
|
|
3464
3525
|
const oldVNode = oldChildren[i];
|
|
3465
3526
|
const newVNode = newChildren[i];
|
|
3466
|
-
|
|
3527
|
+
const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
|
|
3528
|
+
patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
|
|
3467
3529
|
}
|
|
3468
3530
|
};
|
|
3469
3531
|
const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
|
|
@@ -3496,41 +3558,46 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3496
3558
|
};
|
|
3497
3559
|
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
3498
3560
|
n2.slotScopeIds = slotScopeIds;
|
|
3499
|
-
if (n2.type.__vapor)
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3561
|
+
if (n2.type.__vapor) {
|
|
3562
|
+
if (n1 == null) {
|
|
3563
|
+
if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
|
|
3564
|
+
else {
|
|
3565
|
+
const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
|
|
3566
|
+
getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
|
|
3567
|
+
if (n2.dirs) {
|
|
3568
|
+
invokeDirectiveHook(n2, null, parentComponent, "created");
|
|
3569
|
+
invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
|
|
3570
|
+
}
|
|
3571
|
+
}, () => {
|
|
3572
|
+
if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
|
|
3573
|
+
});
|
|
3574
|
+
if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
|
|
3575
|
+
const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
|
|
3576
|
+
if (vnodeMountedHook) {
|
|
3577
|
+
const scopedVNode = n2;
|
|
3578
|
+
queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
|
|
3579
|
+
}
|
|
3506
3580
|
}
|
|
3507
|
-
}
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3581
|
+
} else {
|
|
3582
|
+
const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
|
|
3583
|
+
getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
|
|
3584
|
+
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3585
|
+
}, () => {
|
|
3586
|
+
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
3587
|
+
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
3588
|
+
if (n2.ibu) n2.ibu();
|
|
3589
|
+
});
|
|
3590
|
+
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
3591
|
+
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs || n2.iu)) queuePostRenderEffect(() => {
|
|
3592
|
+
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3593
|
+
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
3594
|
+
n2.iu && n2.iu();
|
|
3595
|
+
}, void 0, parentSuspense);
|
|
3515
3596
|
}
|
|
3516
|
-
}
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
|
|
3521
|
-
}, () => {
|
|
3522
|
-
const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
|
|
3523
|
-
if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
|
|
3524
|
-
});
|
|
3525
|
-
const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
|
|
3526
|
-
if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
|
|
3527
|
-
n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
|
|
3528
|
-
vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
|
|
3529
|
-
}, void 0, parentSuspense);
|
|
3530
|
-
}
|
|
3531
|
-
else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3532
|
-
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
3533
|
-
else updateComponent(n1, n2, optimized);
|
|
3597
|
+
} else if (n1 == null) {
|
|
3598
|
+
if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
|
|
3599
|
+
else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
|
|
3600
|
+
} else updateComponent(n1, n2, optimized);
|
|
3534
3601
|
};
|
|
3535
3602
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
3536
3603
|
const instance = initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense);
|
|
@@ -3561,14 +3628,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3561
3628
|
};
|
|
3562
3629
|
const updateComponent = (n1, n2, optimized) => {
|
|
3563
3630
|
const instance = n2.component = n1.component;
|
|
3564
|
-
if (shouldUpdateComponent(n1, n2, optimized))
|
|
3565
|
-
|
|
3566
|
-
|
|
3631
|
+
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
3632
|
+
if (instance.asyncDep && !instance.asyncResolved) {
|
|
3633
|
+
updateComponentPreRender(instance, n2, optimized);
|
|
3634
|
+
return;
|
|
3635
|
+
} else {
|
|
3636
|
+
instance.next = n2;
|
|
3637
|
+
instance.effect.run();
|
|
3638
|
+
}
|
|
3567
3639
|
} else {
|
|
3568
|
-
instance.next = n2;
|
|
3569
|
-
instance.effect.run();
|
|
3570
|
-
}
|
|
3571
|
-
else {
|
|
3572
3640
|
n2.el = n1.el;
|
|
3573
3641
|
instance.vnode = n2;
|
|
3574
3642
|
}
|
|
@@ -3654,6 +3722,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3654
3722
|
} else next = vnode;
|
|
3655
3723
|
if (bu) (0, _vue_shared.invokeArrayFns)(bu);
|
|
3656
3724
|
if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3725
|
+
if (next.ibu) next.ibu();
|
|
3657
3726
|
toggleRecurse(instance, true);
|
|
3658
3727
|
const nextTree = renderComponentRoot(instance);
|
|
3659
3728
|
const prevTree = instance.subTree;
|
|
@@ -3662,7 +3731,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3662
3731
|
next.el = nextTree.el;
|
|
3663
3732
|
if (originNext === null) updateHOCHostEl(instance, nextTree.el);
|
|
3664
3733
|
if (u) queuePostRenderEffect(u, void 0, parentSuspense);
|
|
3665
|
-
if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() =>
|
|
3734
|
+
if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
|
|
3735
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3736
|
+
next.iu && next.iu();
|
|
3737
|
+
}, void 0, parentSuspense);
|
|
3666
3738
|
}
|
|
3667
3739
|
}
|
|
3668
3740
|
}
|
|
@@ -3700,9 +3772,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3700
3772
|
if (shapeFlag & 8) {
|
|
3701
3773
|
if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
|
|
3702
3774
|
if (c2 !== c1) hostSetElementText(container, c2);
|
|
3703
|
-
} else if (prevShapeFlag & 16)
|
|
3704
|
-
|
|
3705
|
-
|
|
3775
|
+
} else if (prevShapeFlag & 16) {
|
|
3776
|
+
if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3777
|
+
else unmountChildren(c1, parentComponent, parentSuspense, true);
|
|
3778
|
+
} else {
|
|
3706
3779
|
if (prevShapeFlag & 8) hostSetElementText(container, "");
|
|
3707
3780
|
if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3708
3781
|
}
|
|
@@ -3798,8 +3871,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3798
3871
|
const anchorVNode = c2[nextIndex + 1];
|
|
3799
3872
|
const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
|
|
3800
3873
|
if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
3801
|
-
else if (moved)
|
|
3802
|
-
|
|
3874
|
+
else if (moved) {
|
|
3875
|
+
if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
|
|
3876
|
+
else j--;
|
|
3877
|
+
}
|
|
3803
3878
|
}
|
|
3804
3879
|
}
|
|
3805
3880
|
};
|
|
@@ -3831,26 +3906,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3831
3906
|
moveStaticNode(vnode, container, anchor);
|
|
3832
3907
|
return;
|
|
3833
3908
|
}
|
|
3834
|
-
if (moveType !== 2 && shapeFlag & 1 && transition)
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
const remove = () => {
|
|
3909
|
+
if (moveType !== 2 && shapeFlag & 1 && transition) {
|
|
3910
|
+
if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
|
|
3911
|
+
else performTransitionLeave(el, transition, () => {
|
|
3838
3912
|
if (vnode.ctx.isUnmounted) hostRemove(el);
|
|
3839
3913
|
else hostInsert(el, container, anchor);
|
|
3840
|
-
};
|
|
3841
|
-
|
|
3842
|
-
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
3843
|
-
if (el._isLeaving) el[leaveCbKey](true);
|
|
3844
|
-
if (transition.persisted && !wasLeaving) remove();
|
|
3845
|
-
else leave(el, () => {
|
|
3846
|
-
remove();
|
|
3847
|
-
afterLeave && afterLeave();
|
|
3848
|
-
});
|
|
3849
|
-
};
|
|
3850
|
-
if (delayLeave) delayLeave(el, remove, performLeave);
|
|
3851
|
-
else performLeave();
|
|
3852
|
-
}
|
|
3853
|
-
else hostInsert(el, container, anchor);
|
|
3914
|
+
}, true, true);
|
|
3915
|
+
} else hostInsert(el, container, anchor);
|
|
3854
3916
|
};
|
|
3855
3917
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
3856
3918
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
@@ -3870,16 +3932,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3870
3932
|
const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
|
|
3871
3933
|
let vnodeHook;
|
|
3872
3934
|
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3873
|
-
if (shapeFlag & 6)
|
|
3874
|
-
if (
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3935
|
+
if (shapeFlag & 6) {
|
|
3936
|
+
if (isVaporComponent(type)) {
|
|
3937
|
+
if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
|
|
3938
|
+
getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
|
|
3939
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
|
|
3940
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
3941
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
3942
|
+
}, void 0, parentSuspense);
|
|
3943
|
+
return;
|
|
3944
|
+
} else unmountComponent(vnode.component, parentSuspense, doRemove);
|
|
3945
|
+
} else {
|
|
3883
3946
|
if (shapeFlag & 128) {
|
|
3884
3947
|
vnode.suspense.unmount(parentSuspense, doRemove);
|
|
3885
3948
|
return;
|
|
@@ -4000,12 +4063,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
|
4000
4063
|
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
4001
4064
|
}
|
|
4002
4065
|
function toggleRecurse({ effect, job, vapor }, allowed) {
|
|
4003
|
-
if (!vapor)
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4066
|
+
if (!vapor) {
|
|
4067
|
+
if (allowed) {
|
|
4068
|
+
effect.flags |= 128;
|
|
4069
|
+
job.flags |= 2;
|
|
4070
|
+
} else {
|
|
4071
|
+
effect.flags &= -129;
|
|
4072
|
+
job.flags &= -3;
|
|
4073
|
+
}
|
|
4009
4074
|
}
|
|
4010
4075
|
}
|
|
4011
4076
|
function needTransition(parentSuspense, transition) {
|
|
@@ -4044,8 +4109,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
4044
4109
|
}
|
|
4045
4110
|
function locateNonHydratedAsyncRoot(instance) {
|
|
4046
4111
|
const subComponent = instance.subTree && instance.subTree.component;
|
|
4047
|
-
if (subComponent)
|
|
4048
|
-
|
|
4112
|
+
if (subComponent) {
|
|
4113
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
|
|
4114
|
+
else return locateNonHydratedAsyncRoot(subComponent);
|
|
4115
|
+
}
|
|
4049
4116
|
}
|
|
4050
4117
|
function invalidateMount(hooks) {
|
|
4051
4118
|
if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
|
|
@@ -4064,13 +4131,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
|
|
|
4064
4131
|
function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
|
|
4065
4132
|
const performRemove = () => {
|
|
4066
4133
|
remove();
|
|
4067
|
-
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
4134
|
+
if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
|
|
4068
4135
|
};
|
|
4069
4136
|
if (force || isElement && transition && !transition.persisted) {
|
|
4070
4137
|
const { leave, delayLeave } = transition;
|
|
4071
4138
|
const performLeave = () => {
|
|
4139
|
+
const wasLeaving = el._isLeaving || !!el[leaveCbKey];
|
|
4072
4140
|
if (el._isLeaving && force) el[leaveCbKey](true);
|
|
4073
|
-
|
|
4141
|
+
if (force && transition.persisted && !wasLeaving) remove();
|
|
4142
|
+
else leave(el, performRemove);
|
|
4074
4143
|
};
|
|
4075
4144
|
if (delayLeave) delayLeave(el, performRemove, performLeave);
|
|
4076
4145
|
else performLeave();
|
|
@@ -4162,7 +4231,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4162
4231
|
patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4163
4232
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4164
4233
|
else if (isInFallback) {
|
|
4165
|
-
if (!isHydrating) {
|
|
4234
|
+
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
4166
4235
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4167
4236
|
setActiveBranch(suspense, newFallback);
|
|
4168
4237
|
}
|
|
@@ -4183,7 +4252,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
4183
4252
|
if (isInFallback) {
|
|
4184
4253
|
patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
4185
4254
|
if (suspense.deps <= 0) suspense.resolve();
|
|
4186
|
-
else {
|
|
4255
|
+
else if (!suspense.isFallbackMountPending) {
|
|
4187
4256
|
patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4188
4257
|
setActiveBranch(suspense, newFallback);
|
|
4189
4258
|
}
|
|
@@ -4300,8 +4369,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
4300
4369
|
const mountFallback = () => {
|
|
4301
4370
|
suspense.isFallbackMountPending = false;
|
|
4302
4371
|
if (!suspense.isInFallback) return;
|
|
4303
|
-
|
|
4304
|
-
|
|
4372
|
+
const latestFallback = suspense.vnode.ssFallback;
|
|
4373
|
+
patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
|
|
4374
|
+
setActiveBranch(suspense, latestFallback);
|
|
4305
4375
|
};
|
|
4306
4376
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
4307
4377
|
if (delayEnter) {
|
|
@@ -4373,9 +4443,10 @@ function normalizeSuspenseSlot(s) {
|
|
|
4373
4443
|
return s;
|
|
4374
4444
|
}
|
|
4375
4445
|
function queueEffectWithSuspense(fn, id, suspense) {
|
|
4376
|
-
if (suspense && suspense.pendingBranch)
|
|
4377
|
-
|
|
4378
|
-
|
|
4446
|
+
if (suspense && suspense.pendingBranch) {
|
|
4447
|
+
if ((0, _vue_shared.isArray)(fn)) suspense.effects.push(...fn);
|
|
4448
|
+
else suspense.effects.push(fn);
|
|
4449
|
+
} else queuePostFlushCb(fn, id);
|
|
4379
4450
|
}
|
|
4380
4451
|
function setActiveBranch(suspense, branch) {
|
|
4381
4452
|
suspense.activeBranch = branch;
|
|
@@ -4536,8 +4607,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
4536
4607
|
if (isVNode(type)) {
|
|
4537
4608
|
const cloned = cloneVNode(type, props, true);
|
|
4538
4609
|
if (children) normalizeChildren(cloned, children);
|
|
4539
|
-
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock)
|
|
4540
|
-
|
|
4610
|
+
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
|
|
4611
|
+
if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
|
|
4612
|
+
else currentBlock.push(cloned);
|
|
4613
|
+
}
|
|
4541
4614
|
cloned.patchFlag = -2;
|
|
4542
4615
|
return cloned;
|
|
4543
4616
|
}
|
|
@@ -4593,7 +4666,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
4593
4666
|
ce: vnode.ce,
|
|
4594
4667
|
vi: vnode.vi,
|
|
4595
4668
|
vs: cloneVaporSlotMeta(vnode),
|
|
4596
|
-
vb: vnode.vb
|
|
4669
|
+
vb: vnode.vb,
|
|
4670
|
+
ibu: vnode.ibu,
|
|
4671
|
+
iu: vnode.iu
|
|
4597
4672
|
};
|
|
4598
4673
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
4599
4674
|
return cloned;
|
|
@@ -4647,25 +4722,28 @@ function normalizeChildren(vnode, children) {
|
|
|
4647
4722
|
const { shapeFlag } = vnode;
|
|
4648
4723
|
if (children == null) children = null;
|
|
4649
4724
|
else if ((0, _vue_shared.isArray)(children)) type = 16;
|
|
4650
|
-
else if (typeof children === "object")
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4725
|
+
else if (typeof children === "object") {
|
|
4726
|
+
if (shapeFlag & 65) {
|
|
4727
|
+
const slot = children.default;
|
|
4728
|
+
if (slot) {
|
|
4729
|
+
slot._c && (slot._d = false);
|
|
4730
|
+
normalizeChildren(vnode, slot());
|
|
4731
|
+
slot._c && (slot._d = true);
|
|
4732
|
+
}
|
|
4733
|
+
return;
|
|
4734
|
+
} else {
|
|
4735
|
+
type = 32;
|
|
4736
|
+
const slotFlag = children._;
|
|
4737
|
+
if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
|
|
4738
|
+
else if (slotFlag === 3 && currentRenderingInstance) {
|
|
4739
|
+
if (currentRenderingInstance.slots._ === 1) children._ = 1;
|
|
4740
|
+
else {
|
|
4741
|
+
children._ = 2;
|
|
4742
|
+
vnode.patchFlag |= 1024;
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4666
4745
|
}
|
|
4667
|
-
}
|
|
4668
|
-
else if ((0, _vue_shared.isFunction)(children)) {
|
|
4746
|
+
} else if ((0, _vue_shared.isFunction)(children)) {
|
|
4669
4747
|
if (shapeFlag & 65) {
|
|
4670
4748
|
normalizeChildren(vnode, { default: children });
|
|
4671
4749
|
return;
|
|
@@ -4777,7 +4855,7 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4777
4855
|
};
|
|
4778
4856
|
//#endregion
|
|
4779
4857
|
//#region packages/runtime-core/src/component.ts
|
|
4780
|
-
const emptyAppContext =
|
|
4858
|
+
const emptyAppContext = /*@__PURE__*/ createAppContext();
|
|
4781
4859
|
let uid = 0;
|
|
4782
4860
|
function createComponentInstance(vnode, parent, suspense) {
|
|
4783
4861
|
const type = vnode.type;
|
|
@@ -4902,9 +4980,10 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
4902
4980
|
} else finishComponentSetup(instance, isSSR);
|
|
4903
4981
|
}
|
|
4904
4982
|
function handleSetupResult(instance, setupResult, isSSR) {
|
|
4905
|
-
if ((0, _vue_shared.isFunction)(setupResult))
|
|
4906
|
-
|
|
4907
|
-
|
|
4983
|
+
if ((0, _vue_shared.isFunction)(setupResult)) {
|
|
4984
|
+
if (instance.type.__ssrInlineRender) instance.ssrRender = setupResult;
|
|
4985
|
+
else instance.render = setupResult;
|
|
4986
|
+
} else if ((0, _vue_shared.isObject)(setupResult)) instance.setupState = (0, _vue_reactivity.proxyRefs)(setupResult);
|
|
4908
4987
|
finishComponentSetup(instance, isSSR);
|
|
4909
4988
|
}
|
|
4910
4989
|
let compile;
|
|
@@ -5000,11 +5079,12 @@ function h(type, propsOrChildren, children) {
|
|
|
5000
5079
|
try {
|
|
5001
5080
|
setBlockTracking(-1);
|
|
5002
5081
|
const l = arguments.length;
|
|
5003
|
-
if (l === 2)
|
|
5004
|
-
if (
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5082
|
+
if (l === 2) {
|
|
5083
|
+
if ((0, _vue_shared.isObject)(propsOrChildren) && !(0, _vue_shared.isArray)(propsOrChildren)) {
|
|
5084
|
+
if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
|
|
5085
|
+
return createVNode(type, propsOrChildren);
|
|
5086
|
+
} else return createVNode(type, null, propsOrChildren);
|
|
5087
|
+
} else {
|
|
5008
5088
|
if (l > 3) children = Array.prototype.slice.call(arguments, 2);
|
|
5009
5089
|
else if (l === 3 && isVNode(children)) children = [children];
|
|
5010
5090
|
return createVNode(type, propsOrChildren, children);
|
|
@@ -5015,15 +5095,7 @@ function h(type, propsOrChildren, children) {
|
|
|
5015
5095
|
}
|
|
5016
5096
|
//#endregion
|
|
5017
5097
|
//#region packages/runtime-core/src/customFormatter.ts
|
|
5018
|
-
function initCustomFormatter() {
|
|
5019
|
-
return;
|
|
5020
|
-
function isKeyOfType(Comp, key, type) {
|
|
5021
|
-
const opts = Comp[type];
|
|
5022
|
-
if ((0, _vue_shared.isArray)(opts) && opts.includes(key) || (0, _vue_shared.isObject)(opts) && key in opts) return true;
|
|
5023
|
-
if (Comp.extends && isKeyOfType(Comp.extends, key, type)) return true;
|
|
5024
|
-
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) return true;
|
|
5025
|
-
}
|
|
5026
|
-
}
|
|
5098
|
+
function initCustomFormatter() {}
|
|
5027
5099
|
//#endregion
|
|
5028
5100
|
//#region packages/runtime-core/src/helpers/withMemo.ts
|
|
5029
5101
|
function withMemo(memo, render, cache, index) {
|
|
@@ -5043,7 +5115,7 @@ function isMemoSame(cached, memo) {
|
|
|
5043
5115
|
}
|
|
5044
5116
|
//#endregion
|
|
5045
5117
|
//#region packages/runtime-core/src/index.ts
|
|
5046
|
-
const version = "3.6.0-rc.
|
|
5118
|
+
const version = "3.6.0-rc.7";
|
|
5047
5119
|
const warn = _vue_shared.NOOP;
|
|
5048
5120
|
/**
|
|
5049
5121
|
* Runtime error messages. Only exposed in dev or esm builds.
|