@vue/compat 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/vue-compat.d.ts +5 -9
- package/dist/vue.cjs.js +78 -44
- package/dist/vue.cjs.prod.js +78 -44
- package/dist/vue.esm-browser.js +110 -78
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +112 -80
- package/dist/vue.global.js +110 -78
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +110 -78
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +112 -80
- package/dist/vue.runtime.global.js +110 -78
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compat v3.6.0-rc.
|
|
2
|
+
* @vue/compat v3.6.0-rc.9
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -231,10 +231,10 @@ function normalizeStyle(value) {
|
|
|
231
231
|
}
|
|
232
232
|
const listDelimiterRE = /;(?![^(]*\))/g;
|
|
233
233
|
const propertyDelimiterRE = /:([^]+)/;
|
|
234
|
-
const styleCommentRE =
|
|
234
|
+
const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
|
|
235
235
|
function parseStringStyle(cssText) {
|
|
236
236
|
const ret = {};
|
|
237
|
-
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
|
|
237
|
+
cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
|
|
238
238
|
if (item) {
|
|
239
239
|
const tmp = item.split(propertyDelimiterRE);
|
|
240
240
|
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
|
|
@@ -362,19 +362,19 @@ function getEscapedCssVarName(key, doubleEscape) {
|
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region packages/shared/src/looseEqual.ts
|
|
365
|
-
function looseCompareArrays(a, b) {
|
|
365
|
+
function looseCompareArrays(a, b, seen) {
|
|
366
366
|
if (a.length !== b.length) return false;
|
|
367
367
|
let equal = true;
|
|
368
|
-
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
|
|
368
|
+
for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
|
|
369
369
|
return equal;
|
|
370
370
|
}
|
|
371
|
-
function looseCompareCollections(a, b) {
|
|
371
|
+
function looseCompareCollections(a, b, seen) {
|
|
372
372
|
if (a.size !== b.size) return false;
|
|
373
373
|
const candidates = Array.from(b);
|
|
374
374
|
const matched = new Uint8Array(candidates.length);
|
|
375
375
|
for (const item of a) {
|
|
376
376
|
let index = -1;
|
|
377
|
-
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i])) {
|
|
377
|
+
for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
|
|
378
378
|
index = i;
|
|
379
379
|
break;
|
|
380
380
|
}
|
|
@@ -383,7 +383,33 @@ function looseCompareCollections(a, b) {
|
|
|
383
383
|
}
|
|
384
384
|
return true;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function looseCompareObjects(a, b, seen) {
|
|
387
|
+
let aValidType = isMap(a);
|
|
388
|
+
let bValidType = isMap(b);
|
|
389
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
390
|
+
aValidType = isSet(a);
|
|
391
|
+
bValidType = isSet(b);
|
|
392
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
|
|
393
|
+
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
394
|
+
for (const key in a) {
|
|
395
|
+
const aHasKey = a.hasOwnProperty(key);
|
|
396
|
+
const bHasKey = b.hasOwnProperty(key);
|
|
397
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
|
|
398
|
+
}
|
|
399
|
+
return String(a) === String(b);
|
|
400
|
+
}
|
|
401
|
+
function looseCompareNested(a, b, seen, compare) {
|
|
402
|
+
if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
403
|
+
const [seenA, seenB] = seen;
|
|
404
|
+
if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
|
|
405
|
+
seenA.set(a, b);
|
|
406
|
+
seenB.set(b, a);
|
|
407
|
+
const equal = compare(a, b, seen);
|
|
408
|
+
seenA.delete(a);
|
|
409
|
+
seenB.delete(b);
|
|
410
|
+
return equal;
|
|
411
|
+
}
|
|
412
|
+
function looseEqual(a, b, seen) {
|
|
387
413
|
if (a === b) return true;
|
|
388
414
|
let aValidType = isDate(a);
|
|
389
415
|
let bValidType = isDate(b);
|
|
@@ -393,23 +419,12 @@ function looseEqual(a, b) {
|
|
|
393
419
|
if (aValidType || bValidType) return a === b;
|
|
394
420
|
aValidType = isArray(a);
|
|
395
421
|
bValidType = isArray(b);
|
|
396
|
-
if (aValidType || bValidType) return aValidType && bValidType ?
|
|
422
|
+
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
|
|
397
423
|
aValidType = isObject(a);
|
|
398
424
|
bValidType = isObject(b);
|
|
399
425
|
if (aValidType || bValidType) {
|
|
400
426
|
if (!aValidType || !bValidType) return false;
|
|
401
|
-
|
|
402
|
-
bValidType = isMap(b);
|
|
403
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
404
|
-
aValidType = isSet(a);
|
|
405
|
-
bValidType = isSet(b);
|
|
406
|
-
if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b) : false;
|
|
407
|
-
if (Object.keys(a).length !== Object.keys(b).length) return false;
|
|
408
|
-
for (const key in a) {
|
|
409
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
410
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
411
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
|
|
412
|
-
}
|
|
427
|
+
return looseCompareNested(a, b, seen, looseCompareObjects);
|
|
413
428
|
}
|
|
414
429
|
return String(a) === String(b);
|
|
415
430
|
}
|
|
@@ -544,6 +559,8 @@ function setupFlagsHandler(target) {
|
|
|
544
559
|
function warn$2(msg, ...args) {
|
|
545
560
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
546
561
|
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region packages/reactivity/src/system.ts
|
|
547
564
|
const notifyBuffer = [];
|
|
548
565
|
let batchDepth = 0;
|
|
549
566
|
let activeSub = void 0;
|
|
@@ -870,13 +887,17 @@ function getDepFromReactive(object, key) {
|
|
|
870
887
|
/**
|
|
871
888
|
* Track array iteration and return:
|
|
872
889
|
* - if input is reactive: a cloned raw array with reactive values
|
|
873
|
-
* - if input is
|
|
890
|
+
* - if input is readonly: a cloned raw array with readonly values, preserving
|
|
891
|
+
* reactivity
|
|
892
|
+
* - if input is raw or shallow: the original raw array
|
|
874
893
|
*/
|
|
875
894
|
function reactiveReadArray(array) {
|
|
876
895
|
const raw = /* @__PURE__ */ toRaw(array);
|
|
877
896
|
if (raw === array) return raw;
|
|
878
897
|
track(raw, "iterate", ARRAY_ITERATE_KEY);
|
|
879
|
-
|
|
898
|
+
if (/* @__PURE__ */ isShallow(array)) return raw;
|
|
899
|
+
if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
|
|
900
|
+
return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
|
|
880
901
|
}
|
|
881
902
|
/**
|
|
882
903
|
* Track array iteration and return raw array
|
|
@@ -4450,12 +4471,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4450
4471
|
} else {
|
|
4451
4472
|
mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
|
|
4452
4473
|
const component = vnode.component;
|
|
4453
|
-
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep
|
|
4474
|
+
if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
|
|
4454
4475
|
let subTree;
|
|
4455
4476
|
if (isFragmentStart) {
|
|
4456
4477
|
subTree = createVNode(Static);
|
|
4457
4478
|
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
4458
|
-
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
4479
|
+
} else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
|
|
4459
4480
|
subTree.el = node;
|
|
4460
4481
|
component.subTree = subTree;
|
|
4461
4482
|
}
|
|
@@ -6269,37 +6290,32 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
6269
6290
|
function withAsyncContext(getAwaitable) {
|
|
6270
6291
|
const ctx = getCurrentGenericInstance();
|
|
6271
6292
|
const inSSRSetup = isInSSRComponentSetup;
|
|
6272
|
-
const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
|
|
6273
6293
|
if (!!(process.env.NODE_ENV !== "production") && !ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
6274
6294
|
let awaitable = getAwaitable();
|
|
6275
6295
|
setCurrentInstance(null, void 0);
|
|
6276
6296
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
6277
6297
|
const restore = () => {
|
|
6278
|
-
const
|
|
6298
|
+
const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
|
|
6279
6299
|
setCurrentInstance(ctx);
|
|
6280
6300
|
if (inSSRSetup) setInSSRSetupState(true);
|
|
6281
|
-
|
|
6282
|
-
return () => {
|
|
6283
|
-
if (reset) reset();
|
|
6284
|
-
if (resetStoppedScope) resetStoppedScope.reset();
|
|
6285
|
-
};
|
|
6301
|
+
return stoppedScope;
|
|
6286
6302
|
};
|
|
6287
6303
|
const cleanup = () => {
|
|
6288
6304
|
setCurrentInstance(null, void 0);
|
|
6289
6305
|
if (inSSRSetup) setInSSRSetupState(false);
|
|
6290
6306
|
};
|
|
6291
6307
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
6292
|
-
const
|
|
6308
|
+
const stoppedScope = restore();
|
|
6293
6309
|
Promise.resolve().then(() => Promise.resolve().then(() => {
|
|
6294
|
-
if (
|
|
6310
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6295
6311
|
cleanup();
|
|
6296
6312
|
}));
|
|
6297
6313
|
throw e;
|
|
6298
6314
|
});
|
|
6299
6315
|
return [awaitable, () => {
|
|
6300
|
-
const
|
|
6316
|
+
const stoppedScope = restore();
|
|
6301
6317
|
Promise.resolve().then(() => {
|
|
6302
|
-
if (
|
|
6318
|
+
if (stoppedScope) stoppedScope.reset();
|
|
6303
6319
|
cleanup();
|
|
6304
6320
|
});
|
|
6305
6321
|
}];
|
|
@@ -6626,7 +6642,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6626
6642
|
if (options.el) return vm.$mount(options.el);
|
|
6627
6643
|
else return vm;
|
|
6628
6644
|
}
|
|
6629
|
-
Vue.version = `2.6.14-compat:3.6.0-rc.
|
|
6645
|
+
Vue.version = `2.6.14-compat:3.6.0-rc.9`;
|
|
6630
6646
|
Vue.config = singletonApp.config;
|
|
6631
6647
|
Vue.use = (plugin, ...options) => {
|
|
6632
6648
|
if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
|
|
@@ -8006,6 +8022,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8006
8022
|
optimized = false;
|
|
8007
8023
|
n2.dynamicChildren = null;
|
|
8008
8024
|
}
|
|
8025
|
+
if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
|
|
8026
|
+
if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
|
|
8027
|
+
n2.dynamicChildren.hasOnce = true;
|
|
8028
|
+
}
|
|
8009
8029
|
const { type, ref, shapeFlag } = n2;
|
|
8010
8030
|
switch (type) {
|
|
8011
8031
|
case Text:
|
|
@@ -8332,6 +8352,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8332
8352
|
if (shouldUpdateComponent(n1, n2, optimized)) {
|
|
8333
8353
|
if (instance.asyncDep && !instance.asyncResolved) {
|
|
8334
8354
|
if (!!(process.env.NODE_ENV !== "production")) pushWarningContext(n2);
|
|
8355
|
+
n2.el = n1.el;
|
|
8335
8356
|
updateComponentPreRender(instance, n2, optimized);
|
|
8336
8357
|
if (!!(process.env.NODE_ENV !== "production")) popWarningContext();
|
|
8337
8358
|
return;
|
|
@@ -8649,13 +8670,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8649
8670
|
};
|
|
8650
8671
|
const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
|
|
8651
8672
|
const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
|
|
8652
|
-
if (patchFlag === -2) optimized = false;
|
|
8673
|
+
if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
|
|
8653
8674
|
if (ref != null) {
|
|
8654
8675
|
const prevSub = setActiveSub();
|
|
8655
8676
|
setRef(ref, null, parentSuspense, vnode, true);
|
|
8656
8677
|
setActiveSub(prevSub);
|
|
8657
8678
|
}
|
|
8658
|
-
if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8679
|
+
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
|
|
8659
8680
|
if (shapeFlag & 256) {
|
|
8660
8681
|
if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
|
|
8661
8682
|
else parentComponent.ctx.deactivate(vnode);
|
|
@@ -8709,6 +8730,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8709
8730
|
}
|
|
8710
8731
|
if (type === Static) {
|
|
8711
8732
|
removeStaticNode(vnode);
|
|
8733
|
+
if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
|
|
8712
8734
|
return;
|
|
8713
8735
|
}
|
|
8714
8736
|
if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
|
|
@@ -8734,7 +8756,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8734
8756
|
if (effect) {
|
|
8735
8757
|
effect.stop();
|
|
8736
8758
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8737
|
-
} else if (
|
|
8759
|
+
} else if (instance.vnode.el && subTree) {
|
|
8760
|
+
subTree.transition = instance.vnode.transition;
|
|
8761
|
+
unmount(subTree, instance, parentSuspense, doRemove);
|
|
8762
|
+
}
|
|
8738
8763
|
if (um) queuePostRenderEffect(um, void 0, parentSuspense);
|
|
8739
8764
|
if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
|
|
8740
8765
|
queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
|
|
@@ -8941,7 +8966,7 @@ const Suspense = {
|
|
|
8941
8966
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
8942
8967
|
if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
|
|
8943
8968
|
else {
|
|
8944
|
-
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
|
|
8969
|
+
if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
|
|
8945
8970
|
n2.suspense = n1.suspense;
|
|
8946
8971
|
n2.suspense.vnode = n2;
|
|
8947
8972
|
n2.el = n1.el;
|
|
@@ -8979,7 +9004,9 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
8979
9004
|
if (pendingBranch) {
|
|
8980
9005
|
suspense.pendingBranch = newBranch;
|
|
8981
9006
|
if (isSameVNodeType(pendingBranch, newBranch)) {
|
|
8982
|
-
|
|
9007
|
+
suspense.deps++;
|
|
9008
|
+
patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
|
|
9009
|
+
suspense.deps--;
|
|
8983
9010
|
if (suspense.deps <= 0) suspense.resolve();
|
|
8984
9011
|
else if (isInFallback) {
|
|
8985
9012
|
if (!isHydrating && !suspense.isFallbackMountPending) {
|
|
@@ -9117,6 +9144,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9117
9144
|
suspense.effects = [];
|
|
9118
9145
|
if (isSuspensible) {
|
|
9119
9146
|
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
9147
|
+
parentSuspenseId = void 0;
|
|
9120
9148
|
parentSuspense.deps--;
|
|
9121
9149
|
if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
|
|
9122
9150
|
}
|
|
@@ -9154,11 +9182,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9154
9182
|
registerDep(instance, onResolve) {
|
|
9155
9183
|
const isInPendingSuspense = !!suspense.pendingBranch;
|
|
9156
9184
|
if (isInPendingSuspense) suspense.deps++;
|
|
9185
|
+
const hydratedEl = instance.vnode && instance.vnode.el;
|
|
9157
9186
|
instance.asyncDep.catch((err) => {
|
|
9158
9187
|
handleError(err, instance, 0);
|
|
9159
9188
|
}).then((asyncSetupResult) => {
|
|
9160
9189
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
|
|
9161
9190
|
setCurrentInstance(null, void 0);
|
|
9191
|
+
if (hydratedEl && !instance.scope.active) {
|
|
9192
|
+
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
9193
|
+
return;
|
|
9194
|
+
}
|
|
9162
9195
|
instance.asyncResolved = true;
|
|
9163
9196
|
onResolve(asyncSetupResult);
|
|
9164
9197
|
if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
|
|
@@ -9514,7 +9547,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
|
|
|
9514
9547
|
vs: cloneVaporSlotMeta(vnode),
|
|
9515
9548
|
vb: vnode.vb,
|
|
9516
9549
|
ibu: vnode.ibu,
|
|
9517
|
-
iu: vnode.iu
|
|
9550
|
+
iu: vnode.iu,
|
|
9551
|
+
cacheIndex: vnode.cacheIndex
|
|
9518
9552
|
};
|
|
9519
9553
|
if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
|
|
9520
9554
|
defineLegacyVNodeProperties(cloned);
|
|
@@ -10249,7 +10283,7 @@ function isMemoSame(cached, memo) {
|
|
|
10249
10283
|
}
|
|
10250
10284
|
//#endregion
|
|
10251
10285
|
//#region packages/runtime-core/src/index.ts
|
|
10252
|
-
const version = "3.6.0-rc.
|
|
10286
|
+
const version = "3.6.0-rc.9";
|
|
10253
10287
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
10254
10288
|
/**
|
|
10255
10289
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -10663,50 +10697,20 @@ const CSS_VAR_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? "CSS_VAR
|
|
|
10663
10697
|
*/
|
|
10664
10698
|
function useCssVars(getter) {
|
|
10665
10699
|
const instance = getCurrentInstance();
|
|
10666
|
-
const getVars = () => getter(instance.proxy);
|
|
10667
|
-
const setVars = (vars) => {
|
|
10668
|
-
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10669
|
-
else setVarsOnVNode(instance.subTree, vars);
|
|
10670
|
-
};
|
|
10671
|
-
baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
|
|
10672
|
-
}
|
|
10673
|
-
function setVarsOnVNode(vnode, vars) {
|
|
10674
|
-
if (vnode.shapeFlag & 128) {
|
|
10675
|
-
const suspense = vnode.suspense;
|
|
10676
|
-
vnode = suspense.activeBranch;
|
|
10677
|
-
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10678
|
-
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10679
|
-
});
|
|
10680
|
-
}
|
|
10681
|
-
while (vnode.component) vnode = vnode.component.subTree;
|
|
10682
|
-
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10683
|
-
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10684
|
-
else if (vnode.type === Static) {
|
|
10685
|
-
let { el, anchor } = vnode;
|
|
10686
|
-
while (el) {
|
|
10687
|
-
setVarsOnNode(el, vars);
|
|
10688
|
-
if (el === anchor) break;
|
|
10689
|
-
el = el.nextSibling;
|
|
10690
|
-
}
|
|
10691
|
-
}
|
|
10692
|
-
}
|
|
10693
|
-
/**
|
|
10694
|
-
* @internal
|
|
10695
|
-
* shared between vdom and vapor
|
|
10696
|
-
*/
|
|
10697
|
-
function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
10698
10700
|
/* v8 ignore start */
|
|
10699
10701
|
if (!instance) {
|
|
10700
10702
|
process.env.NODE_ENV !== "production" && warn(`useCssVars is called without current active component instance.`);
|
|
10701
10703
|
return;
|
|
10702
10704
|
}
|
|
10703
10705
|
/* v8 ignore stop */
|
|
10706
|
+
const getVars = () => getter(instance.proxy);
|
|
10704
10707
|
if (!!(process.env.NODE_ENV !== "production")) instance.getCssVars = getVars;
|
|
10705
10708
|
const updateTeleports = instance.ut = (vars = getVars()) => {
|
|
10706
10709
|
Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
|
|
10707
10710
|
};
|
|
10708
10711
|
const applyCssVars = (vars = getVars()) => {
|
|
10709
|
-
|
|
10712
|
+
if (instance.ce) setVarsOnNode(instance.ce, vars);
|
|
10713
|
+
else setVarsOnVNode(instance.subTree, vars);
|
|
10710
10714
|
updateTeleports(vars);
|
|
10711
10715
|
};
|
|
10712
10716
|
onBeforeUpdate(() => {
|
|
@@ -10719,10 +10723,37 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
|
|
|
10719
10723
|
applyCssVars(vars);
|
|
10720
10724
|
}, NOOP, { flush: "post" });
|
|
10721
10725
|
const ob = new MutationObserver(() => applyCssVars());
|
|
10722
|
-
ob.observe(
|
|
10726
|
+
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
10723
10727
|
onUnmounted(() => ob.disconnect());
|
|
10724
10728
|
});
|
|
10725
10729
|
}
|
|
10730
|
+
function setVarsOnVNode(vnode, vars) {
|
|
10731
|
+
if (vnode.shapeFlag & 128) {
|
|
10732
|
+
const suspense = vnode.suspense;
|
|
10733
|
+
vnode = suspense.activeBranch;
|
|
10734
|
+
if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
|
|
10735
|
+
setVarsOnVNode(suspense.activeBranch, vars);
|
|
10736
|
+
});
|
|
10737
|
+
}
|
|
10738
|
+
while (vnode.component) {
|
|
10739
|
+
const component = vnode.component;
|
|
10740
|
+
if (component.vapor) {
|
|
10741
|
+
component.appContext.vapor.applyCssVars(vnode, vars);
|
|
10742
|
+
return;
|
|
10743
|
+
}
|
|
10744
|
+
vnode = vnode.component.subTree;
|
|
10745
|
+
}
|
|
10746
|
+
if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
|
|
10747
|
+
else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
|
|
10748
|
+
else if (vnode.type === Static) {
|
|
10749
|
+
let { el, anchor } = vnode;
|
|
10750
|
+
while (el) {
|
|
10751
|
+
setVarsOnNode(el, vars);
|
|
10752
|
+
if (el === anchor) break;
|
|
10753
|
+
el = el.nextSibling;
|
|
10754
|
+
}
|
|
10755
|
+
}
|
|
10756
|
+
}
|
|
10726
10757
|
/**
|
|
10727
10758
|
* @internal
|
|
10728
10759
|
* shared between vdom and vapor
|
|
@@ -11944,7 +11975,6 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11944
11975
|
baseEmit: () => baseEmit,
|
|
11945
11976
|
baseNormalizePropsOptions: () => baseNormalizePropsOptions,
|
|
11946
11977
|
baseResolveTransitionHooks: () => baseResolveTransitionHooks,
|
|
11947
|
-
baseUseCssVars: () => baseUseCssVars,
|
|
11948
11978
|
callPendingCbs: () => callPendingCbs,
|
|
11949
11979
|
callWithAsyncErrorHandling: () => callWithAsyncErrorHandling,
|
|
11950
11980
|
callWithErrorHandling: () => callWithErrorHandling,
|
|
@@ -11974,6 +12004,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
11974
12004
|
currentInstance: () => currentInstance,
|
|
11975
12005
|
customRef: () => customRef,
|
|
11976
12006
|
deactivate: () => deactivate,
|
|
12007
|
+
defaultPropGetter: () => defaultPropGetter,
|
|
11977
12008
|
defineAsyncComponent: () => defineAsyncComponent,
|
|
11978
12009
|
defineComponent: () => defineComponent,
|
|
11979
12010
|
defineCustomElement: () => defineCustomElement,
|
|
@@ -12079,6 +12110,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
12079
12110
|
onWatcherCleanup: () => onWatcherCleanup,
|
|
12080
12111
|
openBlock: () => openBlock,
|
|
12081
12112
|
parseEventName: () => parseEventName,
|
|
12113
|
+
patchClass: () => patchClass,
|
|
12082
12114
|
patchProp: () => patchProp,
|
|
12083
12115
|
patchStyle: () => patchStyle,
|
|
12084
12116
|
performAsyncHydrate: () => performAsyncHydrate,
|
|
@@ -16736,4 +16768,4 @@ Vue.compile = compileToFunction;
|
|
|
16736
16768
|
var esm_index_default = Vue;
|
|
16737
16769
|
const configureCompat = Vue.configureCompat;
|
|
16738
16770
|
//#endregion
|
|
16739
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks,
|
|
16771
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defaultPropGetter, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, filterModelListeners, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getContainerType, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFunctionalFallthroughKey, isHydrating, isHydratingEnabled, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, parseEventName, patchClass, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepareTransitionLeave, prepareTransitionSwitch, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, queuePostRenderEffect, rawVaporSlotKey, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionChild, resolveTransitionHooks, resolveTransitionProps, restoreCurrentInstance, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vdomSlotFallbackKey, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
|