@vue/runtime-dom 3.6.0-rc.7 → 3.6.0-rc.9
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-dom.cjs.js +1 -1
- package/dist/runtime-dom.cjs.prod.js +1 -1
- package/dist/runtime-dom.esm-browser.js +109 -77
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +33 -36
- package/dist/runtime-dom.global.js +109 -77
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -360,50 +360,20 @@ const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR
|
|
|
360
360
|
*/
|
|
361
361
|
function useCssVars(getter) {
|
|
362
362
|
const instance = getCurrentInstance();
|
|
363
|
-
const getVars = () => getter(instance.proxy);
|
|
364
|
-
const setVars = (vars) => {
|
|
365
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
366
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
367
|
-
};
|
|
368
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
369
|
-
}
|
|
370
|
-
function setVarsOnVNode(vnode, vars) {
|
|
371
|
-
if (vnode.shapeFlag & 128) {
|
|
372
|
-
const suspense = vnode.suspense;
|
|
373
|
-
vnode = suspense.activeBranch;
|
|
374
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
375
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
379
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
380
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
381
|
-
else if (vnode.type === Static) {
|
|
382
|
-
let { el, anchor } = vnode;
|
|
383
|
-
while (el) {
|
|
384
|
-
setVarsOnNode(el, vars);
|
|
385
|
-
if (el === anchor) break;
|
|
386
|
-
el = el.nextSibling;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* @internal
|
|
392
|
-
* shared between vdom and vapor
|
|
393
|
-
*/
|
|
394
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
395
363
|
/* v8 ignore start */
|
|
396
364
|
if (!instance) {
|
|
397
365
|
process.env.NODE_ENV !== "production" && warn(`useCssVars is called without current active component instance.`);
|
|
398
366
|
return;
|
|
399
367
|
}
|
|
400
368
|
/* v8 ignore stop */
|
|
369
|
+
const getVars = () => getter(instance.proxy);
|
|
401
370
|
if (!!(process.env.NODE_ENV !== "production")) instance.getCssVars = getVars;
|
|
402
371
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
403
372
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
404
373
|
};
|
|
405
374
|
const applyCssVars = (vars = getVars()) => {
|
|
406
|
-
|
|
375
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
376
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
407
377
|
updateTeleports(vars);
|
|
408
378
|
};
|
|
409
379
|
onBeforeUpdate(() => {
|
|
@@ -416,10 +386,37 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
|
416
386
|
applyCssVars(vars);
|
|
417
387
|
}, NOOP, { flush: "post" });
|
|
418
388
|
const ob = new MutationObserver(() => applyCssVars());
|
|
419
|
-
ob.observe(
|
|
389
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
420
390
|
onUnmounted(() => ob.disconnect());
|
|
421
391
|
});
|
|
422
392
|
}
|
|
393
|
+
function setVarsOnVNode(vnode, vars) {
|
|
394
|
+
if (vnode.shapeFlag & 128) {
|
|
395
|
+
const suspense = vnode.suspense;
|
|
396
|
+
vnode = suspense.activeBranch;
|
|
397
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
398
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
while (vnode.component) {
|
|
402
|
+
const component = vnode.component;
|
|
403
|
+
if (component.vapor) {
|
|
404
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
vnode = vnode.component.subTree;
|
|
408
|
+
}
|
|
409
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
410
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
411
|
+
else if (vnode.type === Static) {
|
|
412
|
+
let { el, anchor } = vnode;
|
|
413
|
+
while (el) {
|
|
414
|
+
setVarsOnNode(el, vars);
|
|
415
|
+
if (el === anchor) break;
|
|
416
|
+
el = el.nextSibling;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
423
420
|
/**
|
|
424
421
|
* @internal
|
|
425
422
|
* shared between vdom and vapor
|
|
@@ -1675,4 +1672,4 @@ const initDirectivesForSSR = () => {
|
|
|
1675
1672
|
}
|
|
1676
1673
|
};
|
|
1677
1674
|
//#endregion
|
|
1678
|
-
export { Transition, TransitionGroup, TransitionPropsValidators, VueElement, VueElementBase, baseApplyTranslation,
|
|
1675
|
+
export { Transition, TransitionGroup, TransitionPropsValidators, VueElement, VueElementBase, baseApplyTranslation, callPendingCbs, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, ensureHydrationRenderer, ensureRenderer, forceReflow, handleMovedChildren, hasCSSTransform, hydrate, initDirectivesForSSR, nodeOps, normalizeContainer, parseEventName, patchClass, patchProp, patchStyle, render, resolveTransitionProps, setVarsOnNode, shouldSetAsProp, shouldSetAsPropForVueCE, svgNS, unsafeToTrustedHTML, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, withKeys, withModifiers, xlinkNS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-rc.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -149,10 +149,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
149
149
|
}
|
|
150
150
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
151
151
|
const propertyDelimiterRE = /:([^]+)/;
|
|
152
|
-
const styleCommentRE =
|
|
152
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
153
153
|
function parseStringStyle(cssText) {
|
|
154
154
|
const ret = {};
|
|
155
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
155
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
156
156
|
if (item) {
|
|
157
157
|
const tmp = item.split(propertyDelimiterRE);
|
|
158
158
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -274,19 +274,19 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
274
274
|
}
|
|
275
275
|
//#endregion
|
|
276
276
|
//#region packages/shared/src/looseEqual.ts
|
|
277
|
-
function looseCompareArrays(a, b) {
|
|
277
|
+
function looseCompareArrays(a, b, seen) {
|
|
278
278
|
if (a.length !== b.length) return false;
|
|
279
279
|
let equal = true;
|
|
280
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
280
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
281
281
|
return equal;
|
|
282
282
|
}
|
|
283
|
-
function looseCompareCollections(a, b) {
|
|
283
|
+
function looseCompareCollections(a, b, seen) {
|
|
284
284
|
if (a.size !== b.size) return false;
|
|
285
285
|
const candidates = Array.from(b);
|
|
286
286
|
const matched = new Uint8Array(candidates.length);
|
|
287
287
|
for (const item of a) {
|
|
288
288
|
let index = -1;
|
|
289
|
-
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
289
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
290
290
|
index = i;
|
|
291
291
|
break;
|
|
292
292
|
}
|
|
@@ -295,7 +295,33 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
295
295
|
}
|
|
296
296
|
return true;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function looseCompareObjects(a, b, seen) {
|
|
299
|
+
let aValidType = isMap(a);
|
|
300
|
+
let bValidType = isMap(b);
|
|
301
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
302
|
+
aValidType = isSet(a);
|
|
303
|
+
bValidType = isSet(b);
|
|
304
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
305
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
306
|
+
for (const key in a) {
|
|
307
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
308
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
309
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
310
|
+
}
|
|
311
|
+
return String(a) === String(b);
|
|
312
|
+
}
|
|
313
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
314
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
315
|
+
const [seenA, seenB] = seen;
|
|
316
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
317
|
+
seenA.set(a, b);
|
|
318
|
+
seenB.set(b, a);
|
|
319
|
+
const equal = compare(a, b, seen);
|
|
320
|
+
seenA.delete(a);
|
|
321
|
+
seenB.delete(b);
|
|
322
|
+
return equal;
|
|
323
|
+
}
|
|
324
|
+
function looseEqual(a, b, seen) {
|
|
299
325
|
if (a === b) return true;
|
|
300
326
|
let aValidType = isDate(a);
|
|
301
327
|
let bValidType = isDate(b);
|
|
@@ -305,23 +331,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
305
331
|
if (aValidType || bValidType) return a === b;
|
|
306
332
|
aValidType = isArray(a);
|
|
307
333
|
bValidType = isArray(b);
|
|
308
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
334
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
309
335
|
aValidType = isObject(a);
|
|
310
336
|
bValidType = isObject(b);
|
|
311
337
|
if (aValidType || bValidType) {
|
|
312
338
|
if (!aValidType || !bValidType) return false;
|
|
313
|
-
|
|
314
|
-
bValidType = isMap(b);
|
|
315
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
316
|
-
aValidType = isSet(a);
|
|
317
|
-
bValidType = isSet(b);
|
|
318
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
319
|
-
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
320
|
-
for (const key in a) {
|
|
321
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
322
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
323
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
324
|
-
}
|
|
339
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
325
340
|
}
|
|
326
341
|
return String(a) === String(b);
|
|
327
342
|
}
|
|
@@ -451,6 +466,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
451
466
|
function warn$2(msg, ...args) {
|
|
452
467
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
453
468
|
}
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region packages/reactivity/src/system.ts
|
|
454
471
|
const notifyBuffer = [];
|
|
455
472
|
let batchDepth = 0;
|
|
456
473
|
let activeSub = void 0;
|
|
@@ -777,13 +794,17 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
777
794
|
/**
|
|
778
795
|
* Track array iteration and return:
|
|
779
796
|
* - if input is reactive: a cloned raw array with reactive values
|
|
780
|
-
* - if input is
|
|
797
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
798
|
+
* reactivity
|
|
799
|
+
* - if input is raw or shallow: the original raw array
|
|
781
800
|
*/
|
|
782
801
|
function reactiveReadArray(array) {
|
|
783
802
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
784
803
|
if (raw === array) return raw;
|
|
785
804
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
786
|
-
|
|
805
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
806
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
807
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
787
808
|
}
|
|
788
809
|
/**
|
|
789
810
|
* Track array iteration and return raw array
|
|
@@ -3939,12 +3960,12 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
3939
3960
|
} else {
|
|
3940
3961
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
3941
3962
|
const component = vnode.component;
|
|
3942
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
3963
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
3943
3964
|
let subTree;
|
|
3944
3965
|
if (isFragmentStart) {
|
|
3945
3966
|
subTree = createVNode(Static);
|
|
3946
3967
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
3947
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
3968
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
3948
3969
|
subTree.el = node;
|
|
3949
3970
|
component.subTree = subTree;
|
|
3950
3971
|
}
|
|
@@ -5328,37 +5349,32 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
5328
5349
|
function withAsyncContext(getAwaitable) {
|
|
5329
5350
|
const ctx = getCurrentGenericInstance();
|
|
5330
5351
|
const inSSRSetup = isInSSRComponentSetup;
|
|
5331
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
5332
5352
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5333
5353
|
let awaitable = getAwaitable();
|
|
5334
5354
|
setCurrentInstance(null, void 0);
|
|
5335
5355
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5336
5356
|
const restore = () => {
|
|
5337
|
-
const
|
|
5357
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
5338
5358
|
setCurrentInstance(ctx);
|
|
5339
5359
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
5340
|
-
|
|
5341
|
-
return () => {
|
|
5342
|
-
if (reset) reset();
|
|
5343
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
5344
|
-
};
|
|
5360
|
+
return stoppedScope;
|
|
5345
5361
|
};
|
|
5346
5362
|
const cleanup = () => {
|
|
5347
5363
|
setCurrentInstance(null, void 0);
|
|
5348
5364
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
5349
5365
|
};
|
|
5350
5366
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5351
|
-
const
|
|
5367
|
+
const stoppedScope = restore();
|
|
5352
5368
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
5353
|
-
if (
|
|
5369
|
+
if (stoppedScope) stoppedScope.reset();
|
|
5354
5370
|
cleanup();
|
|
5355
5371
|
}));
|
|
5356
5372
|
throw e;
|
|
5357
5373
|
});
|
|
5358
5374
|
return [awaitable, () => {
|
|
5359
|
-
const
|
|
5375
|
+
const stoppedScope = restore();
|
|
5360
5376
|
Promise.resolve().then(() => {
|
|
5361
|
-
if (
|
|
5377
|
+
if (stoppedScope) stoppedScope.reset();
|
|
5362
5378
|
cleanup();
|
|
5363
5379
|
});
|
|
5364
5380
|
}];
|
|
@@ -6576,6 +6592,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6576
6592
|
optimized = false;
|
|
6577
6593
|
n2.dynamicChildren = null;
|
|
6578
6594
|
}
|
|
6595
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
6596
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
6597
|
+
n2.dynamicChildren.hasOnce = true;
|
|
6598
|
+
}
|
|
6579
6599
|
const { type, ref, shapeFlag } = n2;
|
|
6580
6600
|
switch (type) {
|
|
6581
6601
|
case Text:
|
|
@@ -6892,6 +6912,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
6892
6912
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
6893
6913
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
6894
6914
|
pushWarningContext(n2);
|
|
6915
|
+
n2.el = n1.el;
|
|
6895
6916
|
updateComponentPreRender(instance, n2, optimized);
|
|
6896
6917
|
popWarningContext();
|
|
6897
6918
|
return;
|
|
@@ -7200,13 +7221,13 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7200
7221
|
};
|
|
7201
7222
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
7202
7223
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
7203
|
-
if (patchFlag === -2) optimized = false;
|
|
7224
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
7204
7225
|
if (ref != null) {
|
|
7205
7226
|
const prevSub = setActiveSub();
|
|
7206
7227
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
7207
7228
|
setActiveSub(prevSub);
|
|
7208
7229
|
}
|
|
7209
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7230
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
7210
7231
|
if (shapeFlag & 256) {
|
|
7211
7232
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
7212
7233
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -7260,6 +7281,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7260
7281
|
}
|
|
7261
7282
|
if (type === Static) {
|
|
7262
7283
|
removeStaticNode(vnode);
|
|
7284
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
7263
7285
|
return;
|
|
7264
7286
|
}
|
|
7265
7287
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -7284,7 +7306,10 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7284
7306
|
if (effect) {
|
|
7285
7307
|
effect.stop();
|
|
7286
7308
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7287
|
-
} else if (
|
|
7309
|
+
} else if (instance.vnode.el && subTree) {
|
|
7310
|
+
subTree.transition = instance.vnode.transition;
|
|
7311
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
7312
|
+
}
|
|
7288
7313
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
7289
7314
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
7290
7315
|
devtoolsComponentRemoved(instance);
|
|
@@ -7490,7 +7515,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7490
7515
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
7491
7516
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
7492
7517
|
else {
|
|
7493
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
7518
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
7494
7519
|
n2.suspense = n1.suspense;
|
|
7495
7520
|
n2.suspense.vnode = n2;
|
|
7496
7521
|
n2.el = n1.el;
|
|
@@ -7528,7 +7553,9 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7528
7553
|
if (pendingBranch) {
|
|
7529
7554
|
suspense.pendingBranch = newBranch;
|
|
7530
7555
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
7531
|
-
|
|
7556
|
+
suspense.deps++;
|
|
7557
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
7558
|
+
suspense.deps--;
|
|
7532
7559
|
if (suspense.deps <= 0) suspense.resolve();
|
|
7533
7560
|
else if (isInFallback) {
|
|
7534
7561
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -7664,6 +7691,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7664
7691
|
suspense.effects = [];
|
|
7665
7692
|
if (isSuspensible) {
|
|
7666
7693
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
7694
|
+
parentSuspenseId = void 0;
|
|
7667
7695
|
parentSuspense.deps--;
|
|
7668
7696
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
7669
7697
|
}
|
|
@@ -7701,11 +7729,16 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
7701
7729
|
registerDep(instance, onResolve) {
|
|
7702
7730
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
7703
7731
|
if (isInPendingSuspense) suspense.deps++;
|
|
7732
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
7704
7733
|
instance.asyncDep.catch((err) => {
|
|
7705
7734
|
handleError(err, instance, 0);
|
|
7706
7735
|
}).then((asyncSetupResult) => {
|
|
7707
7736
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
7708
7737
|
setCurrentInstance(null, void 0);
|
|
7738
|
+
if (hydratedEl && !instance.scope.active) {
|
|
7739
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
7740
|
+
return;
|
|
7741
|
+
}
|
|
7709
7742
|
instance.asyncResolved = true;
|
|
7710
7743
|
onResolve(asyncSetupResult);
|
|
7711
7744
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -8018,7 +8051,8 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8018
8051
|
vs: cloneVaporSlotMeta(vnode),
|
|
8019
8052
|
vb: vnode.vb,
|
|
8020
8053
|
ibu: vnode.ibu,
|
|
8021
|
-
iu: vnode.iu
|
|
8054
|
+
iu: vnode.iu,
|
|
8055
|
+
cacheIndex: vnode.cacheIndex
|
|
8022
8056
|
};
|
|
8023
8057
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
8024
8058
|
return cloned;
|
|
@@ -8718,7 +8752,7 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
8718
8752
|
}
|
|
8719
8753
|
//#endregion
|
|
8720
8754
|
//#region packages/runtime-core/src/index.ts
|
|
8721
|
-
const version = "3.6.0-rc.
|
|
8755
|
+
const version = "3.6.0-rc.9";
|
|
8722
8756
|
const warn = warn$1;
|
|
8723
8757
|
/**
|
|
8724
8758
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9091,49 +9125,20 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9091
9125
|
*/
|
|
9092
9126
|
function useCssVars(getter) {
|
|
9093
9127
|
const instance = getCurrentInstance();
|
|
9094
|
-
const getVars = () => getter(instance.proxy);
|
|
9095
|
-
const setVars = (vars) => {
|
|
9096
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
9097
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
9098
|
-
};
|
|
9099
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
9100
|
-
}
|
|
9101
|
-
function setVarsOnVNode(vnode, vars) {
|
|
9102
|
-
if (vnode.shapeFlag & 128) {
|
|
9103
|
-
const suspense = vnode.suspense;
|
|
9104
|
-
vnode = suspense.activeBranch;
|
|
9105
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
9106
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
9107
|
-
});
|
|
9108
|
-
}
|
|
9109
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
9110
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
9111
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
9112
|
-
else if (vnode.type === Static) {
|
|
9113
|
-
let { el, anchor } = vnode;
|
|
9114
|
-
while (el) {
|
|
9115
|
-
setVarsOnNode(el, vars);
|
|
9116
|
-
if (el === anchor) break;
|
|
9117
|
-
el = el.nextSibling;
|
|
9118
|
-
}
|
|
9119
|
-
}
|
|
9120
|
-
}
|
|
9121
|
-
/**
|
|
9122
|
-
* @internal
|
|
9123
|
-
* shared between vdom and vapor
|
|
9124
|
-
*/
|
|
9125
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
9126
9128
|
/* v8 ignore start */
|
|
9127
9129
|
if (!instance) {
|
|
9128
9130
|
warn(`useCssVars is called without current active component instance.`);
|
|
9129
9131
|
return;
|
|
9130
9132
|
}
|
|
9133
|
+
/* v8 ignore stop */
|
|
9134
|
+
const getVars = () => getter(instance.proxy);
|
|
9131
9135
|
instance.getCssVars = getVars;
|
|
9132
9136
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
9133
9137
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
9134
9138
|
};
|
|
9135
9139
|
const applyCssVars = (vars = getVars()) => {
|
|
9136
|
-
|
|
9140
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
9141
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
9137
9142
|
updateTeleports(vars);
|
|
9138
9143
|
};
|
|
9139
9144
|
onBeforeUpdate(() => {
|
|
@@ -9146,10 +9151,37 @@ var VueRuntimeDOM = (function(exports) {
|
|
|
9146
9151
|
applyCssVars(vars);
|
|
9147
9152
|
}, NOOP, { flush: "post" });
|
|
9148
9153
|
const ob = new MutationObserver(() => applyCssVars());
|
|
9149
|
-
ob.observe(
|
|
9154
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
9150
9155
|
onUnmounted(() => ob.disconnect());
|
|
9151
9156
|
});
|
|
9152
9157
|
}
|
|
9158
|
+
function setVarsOnVNode(vnode, vars) {
|
|
9159
|
+
if (vnode.shapeFlag & 128) {
|
|
9160
|
+
const suspense = vnode.suspense;
|
|
9161
|
+
vnode = suspense.activeBranch;
|
|
9162
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
9163
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
9164
|
+
});
|
|
9165
|
+
}
|
|
9166
|
+
while (vnode.component) {
|
|
9167
|
+
const component = vnode.component;
|
|
9168
|
+
if (component.vapor) {
|
|
9169
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
9170
|
+
return;
|
|
9171
|
+
}
|
|
9172
|
+
vnode = vnode.component.subTree;
|
|
9173
|
+
}
|
|
9174
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
9175
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
9176
|
+
else if (vnode.type === Static) {
|
|
9177
|
+
let { el, anchor } = vnode;
|
|
9178
|
+
while (el) {
|
|
9179
|
+
setVarsOnNode(el, vars);
|
|
9180
|
+
if (el === anchor) break;
|
|
9181
|
+
el = el.nextSibling;
|
|
9182
|
+
}
|
|
9183
|
+
}
|
|
9184
|
+
}
|
|
9153
9185
|
/**
|
|
9154
9186
|
* @internal
|
|
9155
9187
|
* shared between vdom and vapor
|