@vue/reactivity 3.6.0-beta.7 → 3.6.0-beta.8
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/reactivity.cjs.js +26 -27
- package/dist/reactivity.cjs.prod.js +26 -25
- package/dist/reactivity.esm-browser.js +26 -40
- package/dist/reactivity.esm-browser.prod.js +2 -2
- package/dist/reactivity.esm-bundler.js +22 -26
- package/dist/reactivity.global.js +116 -132
- package/dist/reactivity.global.prod.js +2 -2
- package/package.json +2 -2
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.6.0-beta.
|
|
2
|
+
* @vue/reactivity v3.6.0-beta.8
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { EMPTY_OBJ, NOOP, capitalize, def, extend, hasChanged, hasOwn, isArray, isFunction, isIntegerKey, isMap, isObject, isPlainObject, isSet, isSymbol, makeMap, toRawType } from "@vue/shared";
|
|
7
|
-
|
|
8
7
|
//#region packages/reactivity/src/debug.ts
|
|
9
8
|
const triggerEventInfos = [];
|
|
10
9
|
function onTrack(sub, debugInfo) {
|
|
@@ -42,13 +41,11 @@ function setupFlagsHandler(target) {
|
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
//#endregion
|
|
47
45
|
//#region packages/reactivity/src/warning.ts
|
|
48
46
|
function warn(msg, ...args) {
|
|
49
47
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
50
48
|
}
|
|
51
|
-
|
|
52
49
|
//#endregion
|
|
53
50
|
//#region packages/reactivity/src/system.ts
|
|
54
51
|
const ReactiveFlags$1 = {
|
|
@@ -274,7 +271,6 @@ function isValidLink(checkLink, sub) {
|
|
|
274
271
|
}
|
|
275
272
|
return false;
|
|
276
273
|
}
|
|
277
|
-
|
|
278
274
|
//#endregion
|
|
279
275
|
//#region packages/reactivity/src/dep.ts
|
|
280
276
|
var Dep = class {
|
|
@@ -385,7 +381,6 @@ function getDepFromReactive(object, key) {
|
|
|
385
381
|
const depMap = targetMap.get(object);
|
|
386
382
|
return depMap && depMap.get(key);
|
|
387
383
|
}
|
|
388
|
-
|
|
389
384
|
//#endregion
|
|
390
385
|
//#region packages/reactivity/src/arrayInstrumentations.ts
|
|
391
386
|
/**
|
|
@@ -533,16 +528,25 @@ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
|
|
|
533
528
|
}
|
|
534
529
|
function reduce(self, method, fn, args) {
|
|
535
530
|
const arr = shallowReadArray(self);
|
|
531
|
+
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
|
|
536
532
|
let wrappedFn = fn;
|
|
533
|
+
let wrapInitialAccumulator = false;
|
|
537
534
|
if (arr !== self) {
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
535
|
+
if (needsWrap) {
|
|
536
|
+
wrapInitialAccumulator = args.length === 0;
|
|
537
|
+
wrappedFn = function(acc, item, index) {
|
|
538
|
+
if (wrapInitialAccumulator) {
|
|
539
|
+
wrapInitialAccumulator = false;
|
|
540
|
+
acc = toWrapped(self, acc);
|
|
541
|
+
}
|
|
542
|
+
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
543
|
+
};
|
|
544
|
+
} else if (fn.length > 3) wrappedFn = function(acc, item, index) {
|
|
542
545
|
return fn.call(this, acc, item, index, self);
|
|
543
546
|
};
|
|
544
547
|
}
|
|
545
|
-
|
|
548
|
+
const result = arr[method](wrappedFn, ...args);
|
|
549
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
546
550
|
}
|
|
547
551
|
function searchProxy(self, method, args) {
|
|
548
552
|
const arr = /* @__PURE__ */ toRaw(self);
|
|
@@ -562,7 +566,6 @@ function noTracking(self, method, args = []) {
|
|
|
562
566
|
endBatch();
|
|
563
567
|
return res;
|
|
564
568
|
}
|
|
565
|
-
|
|
566
569
|
//#endregion
|
|
567
570
|
//#region packages/reactivity/src/baseHandlers.ts
|
|
568
571
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
@@ -671,7 +674,6 @@ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
|
|
|
671
674
|
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
672
675
|
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
673
676
|
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
674
|
-
|
|
675
677
|
//#endregion
|
|
676
678
|
//#region packages/reactivity/src/collectionHandlers.ts
|
|
677
679
|
const toShallow = (value) => value;
|
|
@@ -756,11 +758,13 @@ function createInstrumentations(readonly, shallow) {
|
|
|
756
758
|
clear: createReadonlyMethod("clear")
|
|
757
759
|
} : {
|
|
758
760
|
add(value) {
|
|
759
|
-
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
|
|
760
761
|
const target = /* @__PURE__ */ toRaw(this);
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
762
|
+
const proto = getProto(target);
|
|
763
|
+
const rawValue = /* @__PURE__ */ toRaw(value);
|
|
764
|
+
const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
|
|
765
|
+
if (!(proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue))) {
|
|
766
|
+
target.add(valueToAdd);
|
|
767
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
764
768
|
}
|
|
765
769
|
return this;
|
|
766
770
|
},
|
|
@@ -831,7 +835,6 @@ function checkIdentityKeys(target, has, key) {
|
|
|
831
835
|
warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
|
|
832
836
|
}
|
|
833
837
|
}
|
|
834
|
-
|
|
835
838
|
//#endregion
|
|
836
839
|
//#region packages/reactivity/src/reactive.ts
|
|
837
840
|
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1095,7 +1098,6 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
|
|
|
1095
1098
|
* @param value - The value for which a readonly proxy shall be created.
|
|
1096
1099
|
*/
|
|
1097
1100
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1098
|
-
|
|
1099
1101
|
//#endregion
|
|
1100
1102
|
//#region packages/reactivity/src/ref.ts
|
|
1101
1103
|
/* @__NO_SIDE_EFFECTS__ */
|
|
@@ -1370,7 +1372,6 @@ function toRef(source, key, defaultValue) {
|
|
|
1370
1372
|
function propertyToRef(source, key, defaultValue) {
|
|
1371
1373
|
return new ObjectRefImpl(source, key, defaultValue);
|
|
1372
1374
|
}
|
|
1373
|
-
|
|
1374
1375
|
//#endregion
|
|
1375
1376
|
//#region packages/reactivity/src/effect.ts
|
|
1376
1377
|
const EffectFlags = {
|
|
@@ -1540,7 +1541,6 @@ function cleanupEffect(fn) {
|
|
|
1540
1541
|
setActiveSub(prevSub);
|
|
1541
1542
|
}
|
|
1542
1543
|
}
|
|
1543
|
-
|
|
1544
1544
|
//#endregion
|
|
1545
1545
|
//#region packages/reactivity/src/effectScope.ts
|
|
1546
1546
|
let activeEffectScope;
|
|
@@ -1649,7 +1649,6 @@ function onScopeDispose(fn, failSilently = false) {
|
|
|
1649
1649
|
if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
1650
1650
|
else if (!!(process.env.NODE_ENV !== "production") && !failSilently) warn("onScopeDispose() is called when there is no active effect scope to be associated with.");
|
|
1651
1651
|
}
|
|
1652
|
-
|
|
1653
1652
|
//#endregion
|
|
1654
1653
|
//#region packages/reactivity/src/computed.ts
|
|
1655
1654
|
/**
|
|
@@ -1750,7 +1749,6 @@ function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
|
1750
1749
|
}
|
|
1751
1750
|
return cRef;
|
|
1752
1751
|
}
|
|
1753
|
-
|
|
1754
1752
|
//#endregion
|
|
1755
1753
|
//#region packages/reactivity/src/constants.ts
|
|
1756
1754
|
const TrackOpTypes = {
|
|
@@ -1772,7 +1770,6 @@ const ReactiveFlags = {
|
|
|
1772
1770
|
"RAW": "__v_raw",
|
|
1773
1771
|
"IS_REF": "__v_isRef"
|
|
1774
1772
|
};
|
|
1775
|
-
|
|
1776
1773
|
//#endregion
|
|
1777
1774
|
//#region packages/reactivity/src/watch.ts
|
|
1778
1775
|
const WatchErrorCodes = {
|
|
@@ -1934,6 +1931,5 @@ function traverse(value, depth = Infinity, seen) {
|
|
|
1934
1931
|
}
|
|
1935
1932
|
return value;
|
|
1936
1933
|
}
|
|
1937
|
-
|
|
1938
1934
|
//#endregion
|
|
1939
|
-
export { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, WatcherEffect, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, setActiveSub, setCurrentScope, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch };
|
|
1935
|
+
export { ARRAY_ITERATE_KEY, EffectFlags, EffectScope, ITERATE_KEY, MAP_KEY_ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, WatchErrorCodes, WatcherEffect, computed, customRef, effect, effectScope, enableTracking, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onEffectCleanup, onScopeDispose, onWatcherCleanup, pauseTracking, proxyRefs, reactive, reactiveReadArray, readonly, ref, resetTracking, setActiveSub, setCurrentScope, shallowReactive, shallowReadArray, shallowReadonly, shallowRef, stop, toRaw, toReactive, toReadonly, toRef, toRefs, toValue, track, traverse, trigger, triggerRef, unref, watch };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.6.0-beta.
|
|
2
|
+
* @vue/reactivity v3.6.0-beta.8
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
var VueReactivity = (function(exports) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//#region packages/shared/src/makeMap.ts
|
|
11
|
-
/**
|
|
7
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
+
//#region packages/shared/src/makeMap.ts
|
|
9
|
+
/**
|
|
12
10
|
* Make a map and return a function for checking if a key
|
|
13
11
|
* is in that map.
|
|
14
12
|
* IMPORTANT: all calls of this function must be prefixed with
|
|
@@ -21,11 +19,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
21
19
|
for (const key of str.split(",")) map[key] = 1;
|
|
22
20
|
return (val) => val in map;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
//#
|
|
26
|
-
//#region packages/shared/src/general.ts
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region packages/shared/src/general.ts
|
|
27
24
|
const EMPTY_OBJ = Object.freeze({});
|
|
28
|
-
|
|
25
|
+
Object.freeze([]);
|
|
29
26
|
const NOOP = () => {};
|
|
30
27
|
const extend = Object.assign;
|
|
31
28
|
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
@@ -52,25 +49,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
52
49
|
};
|
|
53
50
|
const camelizeRE = /-(\w)/g;
|
|
54
51
|
const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
55
|
-
|
|
56
|
-
* @private
|
|
57
|
-
*/
|
|
58
|
-
const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
52
|
+
cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
|
|
59
53
|
const hyphenateRE = /\B([A-Z])/g;
|
|
60
|
-
|
|
61
|
-
* @private
|
|
62
|
-
*/
|
|
63
|
-
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
54
|
+
cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
|
|
64
55
|
/**
|
|
65
56
|
* @private
|
|
66
57
|
*/
|
|
67
58
|
const capitalize = cacheStringFunction((str) => {
|
|
68
59
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
69
60
|
});
|
|
70
|
-
|
|
71
|
-
* @private
|
|
72
|
-
*/
|
|
73
|
-
const toHandlerKey = cacheStringFunction((str) => {
|
|
61
|
+
cacheStringFunction((str) => {
|
|
74
62
|
return str ? `on${capitalize(str)}` : ``;
|
|
75
63
|
});
|
|
76
64
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
@@ -82,9 +70,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
82
70
|
value
|
|
83
71
|
});
|
|
84
72
|
};
|
|
85
|
-
|
|
86
|
-
//#
|
|
87
|
-
//#region packages/reactivity/src/debug.ts
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region packages/reactivity/src/debug.ts
|
|
88
75
|
const triggerEventInfos = [];
|
|
89
76
|
function onTrack(sub, debugInfo) {
|
|
90
77
|
if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
|
|
@@ -118,15 +105,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
118
105
|
}
|
|
119
106
|
});
|
|
120
107
|
}
|
|
121
|
-
|
|
122
|
-
//#
|
|
123
|
-
//#region packages/reactivity/src/warning.ts
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region packages/reactivity/src/warning.ts
|
|
124
110
|
function warn(msg, ...args) {
|
|
125
111
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
126
112
|
}
|
|
127
|
-
|
|
128
|
-
//#
|
|
129
|
-
//#region packages/reactivity/src/system.ts
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region packages/reactivity/src/system.ts
|
|
130
115
|
const ReactiveFlags$1 = {
|
|
131
116
|
"None": 0,
|
|
132
117
|
"0": "None",
|
|
@@ -350,9 +335,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
350
335
|
}
|
|
351
336
|
return false;
|
|
352
337
|
}
|
|
353
|
-
|
|
354
|
-
//#
|
|
355
|
-
//#region packages/reactivity/src/dep.ts
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region packages/reactivity/src/dep.ts
|
|
356
340
|
var Dep = class {
|
|
357
341
|
constructor(map, key) {
|
|
358
342
|
this.map = map;
|
|
@@ -461,10 +445,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
461
445
|
const depMap = targetMap.get(object);
|
|
462
446
|
return depMap && depMap.get(key);
|
|
463
447
|
}
|
|
464
|
-
|
|
465
|
-
//#
|
|
466
|
-
|
|
467
|
-
/**
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region packages/reactivity/src/arrayInstrumentations.ts
|
|
450
|
+
/**
|
|
468
451
|
* Track array iteration and return:
|
|
469
452
|
* - if input is reactive: a cloned raw array with reactive values
|
|
470
453
|
* - if input is non-reactive or shallowReactive: the original raw array
|
|
@@ -609,16 +592,25 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
609
592
|
}
|
|
610
593
|
function reduce(self, method, fn, args) {
|
|
611
594
|
const arr = shallowReadArray(self);
|
|
595
|
+
const needsWrap = arr !== self && !/* @__PURE__ */ isShallow(self);
|
|
612
596
|
let wrappedFn = fn;
|
|
597
|
+
let wrapInitialAccumulator = false;
|
|
613
598
|
if (arr !== self) {
|
|
614
|
-
if (
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
599
|
+
if (needsWrap) {
|
|
600
|
+
wrapInitialAccumulator = args.length === 0;
|
|
601
|
+
wrappedFn = function(acc, item, index) {
|
|
602
|
+
if (wrapInitialAccumulator) {
|
|
603
|
+
wrapInitialAccumulator = false;
|
|
604
|
+
acc = toWrapped(self, acc);
|
|
605
|
+
}
|
|
606
|
+
return fn.call(this, acc, toWrapped(self, item), index, self);
|
|
607
|
+
};
|
|
608
|
+
} else if (fn.length > 3) wrappedFn = function(acc, item, index) {
|
|
618
609
|
return fn.call(this, acc, item, index, self);
|
|
619
610
|
};
|
|
620
611
|
}
|
|
621
|
-
|
|
612
|
+
const result = arr[method](wrappedFn, ...args);
|
|
613
|
+
return wrapInitialAccumulator ? toWrapped(self, result) : result;
|
|
622
614
|
}
|
|
623
615
|
function searchProxy(self, method, args) {
|
|
624
616
|
const arr = /* @__PURE__ */ toRaw(self);
|
|
@@ -638,9 +630,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
638
630
|
endBatch();
|
|
639
631
|
return res;
|
|
640
632
|
}
|
|
641
|
-
|
|
642
|
-
//#
|
|
643
|
-
//#region packages/reactivity/src/baseHandlers.ts
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region packages/reactivity/src/baseHandlers.ts
|
|
644
635
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
645
636
|
const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
|
|
646
637
|
function hasOwnProperty(key) {
|
|
@@ -747,9 +738,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
747
738
|
const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
|
|
748
739
|
const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
|
|
749
740
|
const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
|
|
750
|
-
|
|
751
|
-
//#
|
|
752
|
-
//#region packages/reactivity/src/collectionHandlers.ts
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region packages/reactivity/src/collectionHandlers.ts
|
|
753
743
|
const toShallow = (value) => value;
|
|
754
744
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
755
745
|
function createIterableMethod(method, isReadonly, isShallow) {
|
|
@@ -832,11 +822,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
832
822
|
clear: createReadonlyMethod("clear")
|
|
833
823
|
} : {
|
|
834
824
|
add(value) {
|
|
835
|
-
if (!shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value)) value = /* @__PURE__ */ toRaw(value);
|
|
836
825
|
const target = /* @__PURE__ */ toRaw(this);
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
826
|
+
const proto = getProto(target);
|
|
827
|
+
const rawValue = /* @__PURE__ */ toRaw(value);
|
|
828
|
+
const valueToAdd = !shallow && !/* @__PURE__ */ isShallow(value) && !/* @__PURE__ */ isReadonly(value) ? rawValue : value;
|
|
829
|
+
if (!(proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue))) {
|
|
830
|
+
target.add(valueToAdd);
|
|
831
|
+
trigger(target, "add", valueToAdd, valueToAdd);
|
|
840
832
|
}
|
|
841
833
|
return this;
|
|
842
834
|
},
|
|
@@ -907,9 +899,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
907
899
|
warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
|
|
908
900
|
}
|
|
909
901
|
}
|
|
910
|
-
|
|
911
|
-
//#
|
|
912
|
-
//#region packages/reactivity/src/reactive.ts
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region packages/reactivity/src/reactive.ts
|
|
913
904
|
const reactiveMap = /* @__PURE__ */ new WeakMap();
|
|
914
905
|
const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
|
|
915
906
|
const readonlyMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1171,9 +1162,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1171
1162
|
* @param value - The value for which a readonly proxy shall be created.
|
|
1172
1163
|
*/
|
|
1173
1164
|
const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
|
|
1174
|
-
|
|
1175
|
-
//#
|
|
1176
|
-
//#region packages/reactivity/src/ref.ts
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region packages/reactivity/src/ref.ts
|
|
1177
1167
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1178
1168
|
function isRef(r) {
|
|
1179
1169
|
return r ? r["__v_isRef"] === true : false;
|
|
@@ -1446,9 +1436,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1446
1436
|
function propertyToRef(source, key, defaultValue) {
|
|
1447
1437
|
return new ObjectRefImpl(source, key, defaultValue);
|
|
1448
1438
|
}
|
|
1449
|
-
|
|
1450
|
-
//#
|
|
1451
|
-
//#region packages/reactivity/src/effect.ts
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region packages/reactivity/src/effect.ts
|
|
1452
1441
|
const EffectFlags = {
|
|
1453
1442
|
"ALLOW_RECURSE": 128,
|
|
1454
1443
|
"128": "ALLOW_RECURSE",
|
|
@@ -1616,9 +1605,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1616
1605
|
setActiveSub(prevSub);
|
|
1617
1606
|
}
|
|
1618
1607
|
}
|
|
1619
|
-
|
|
1620
|
-
//#
|
|
1621
|
-
//#region packages/reactivity/src/effectScope.ts
|
|
1608
|
+
//#endregion
|
|
1609
|
+
//#region packages/reactivity/src/effectScope.ts
|
|
1622
1610
|
let activeEffectScope;
|
|
1623
1611
|
var EffectScope = class {
|
|
1624
1612
|
constructor(detached = false) {
|
|
@@ -1725,10 +1713,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1725
1713
|
if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
|
|
1726
1714
|
else if (!failSilently) warn("onScopeDispose() is called when there is no active effect scope to be associated with.");
|
|
1727
1715
|
}
|
|
1728
|
-
|
|
1729
|
-
//#
|
|
1730
|
-
|
|
1731
|
-
/**
|
|
1716
|
+
//#endregion
|
|
1717
|
+
//#region packages/reactivity/src/computed.ts
|
|
1718
|
+
/**
|
|
1732
1719
|
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
1733
1720
|
* the main vue package
|
|
1734
1721
|
*/
|
|
@@ -1826,9 +1813,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1826
1813
|
}
|
|
1827
1814
|
return cRef;
|
|
1828
1815
|
}
|
|
1829
|
-
|
|
1830
|
-
//#
|
|
1831
|
-
//#region packages/reactivity/src/constants.ts
|
|
1816
|
+
//#endregion
|
|
1817
|
+
//#region packages/reactivity/src/constants.ts
|
|
1832
1818
|
const TrackOpTypes = {
|
|
1833
1819
|
"GET": "get",
|
|
1834
1820
|
"HAS": "has",
|
|
@@ -1848,9 +1834,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1848
1834
|
"RAW": "__v_raw",
|
|
1849
1835
|
"IS_REF": "__v_isRef"
|
|
1850
1836
|
};
|
|
1851
|
-
|
|
1852
|
-
//#
|
|
1853
|
-
//#region packages/reactivity/src/watch.ts
|
|
1837
|
+
//#endregion
|
|
1838
|
+
//#region packages/reactivity/src/watch.ts
|
|
1854
1839
|
const WatchErrorCodes = {
|
|
1855
1840
|
"WATCH_GETTER": 2,
|
|
1856
1841
|
"2": "WATCH_GETTER",
|
|
@@ -2008,60 +1993,59 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2008
1993
|
}
|
|
2009
1994
|
return value;
|
|
2010
1995
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
exports.
|
|
2014
|
-
exports.
|
|
2015
|
-
exports.
|
|
2016
|
-
exports.
|
|
2017
|
-
exports.
|
|
2018
|
-
exports.
|
|
2019
|
-
exports.
|
|
2020
|
-
exports.
|
|
2021
|
-
exports.
|
|
2022
|
-
exports.
|
|
2023
|
-
exports.
|
|
2024
|
-
exports.
|
|
2025
|
-
exports.
|
|
2026
|
-
exports.
|
|
2027
|
-
exports.
|
|
2028
|
-
exports.
|
|
2029
|
-
exports.
|
|
2030
|
-
exports.
|
|
2031
|
-
exports.
|
|
2032
|
-
exports.
|
|
2033
|
-
exports.
|
|
2034
|
-
exports.
|
|
2035
|
-
exports.
|
|
2036
|
-
exports.
|
|
2037
|
-
exports.
|
|
2038
|
-
exports.
|
|
2039
|
-
exports.
|
|
2040
|
-
exports.
|
|
2041
|
-
exports.
|
|
2042
|
-
exports.
|
|
2043
|
-
exports.
|
|
2044
|
-
exports.
|
|
2045
|
-
exports.
|
|
2046
|
-
exports.
|
|
2047
|
-
exports.
|
|
2048
|
-
exports.
|
|
2049
|
-
exports.
|
|
2050
|
-
exports.
|
|
2051
|
-
exports.
|
|
2052
|
-
exports.
|
|
2053
|
-
exports.
|
|
2054
|
-
exports.
|
|
2055
|
-
exports.
|
|
2056
|
-
exports.
|
|
2057
|
-
exports.
|
|
2058
|
-
exports.
|
|
2059
|
-
exports.
|
|
2060
|
-
exports.
|
|
2061
|
-
exports.
|
|
2062
|
-
exports.
|
|
2063
|
-
exports.
|
|
2064
|
-
exports.
|
|
2065
|
-
exports
|
|
2066
|
-
|
|
2067
|
-
})({});
|
|
1996
|
+
//#endregion
|
|
1997
|
+
exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY;
|
|
1998
|
+
exports.EffectFlags = EffectFlags;
|
|
1999
|
+
exports.EffectScope = EffectScope;
|
|
2000
|
+
exports.ITERATE_KEY = ITERATE_KEY;
|
|
2001
|
+
exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY;
|
|
2002
|
+
exports.ReactiveEffect = ReactiveEffect;
|
|
2003
|
+
exports.ReactiveFlags = ReactiveFlags;
|
|
2004
|
+
exports.TrackOpTypes = TrackOpTypes;
|
|
2005
|
+
exports.TriggerOpTypes = TriggerOpTypes;
|
|
2006
|
+
exports.WatchErrorCodes = WatchErrorCodes;
|
|
2007
|
+
exports.WatcherEffect = WatcherEffect;
|
|
2008
|
+
exports.computed = computed;
|
|
2009
|
+
exports.customRef = customRef;
|
|
2010
|
+
exports.effect = effect;
|
|
2011
|
+
exports.effectScope = effectScope;
|
|
2012
|
+
exports.enableTracking = enableTracking;
|
|
2013
|
+
exports.getCurrentScope = getCurrentScope;
|
|
2014
|
+
exports.getCurrentWatcher = getCurrentWatcher;
|
|
2015
|
+
exports.isProxy = isProxy;
|
|
2016
|
+
exports.isReactive = isReactive;
|
|
2017
|
+
exports.isReadonly = isReadonly;
|
|
2018
|
+
exports.isRef = isRef;
|
|
2019
|
+
exports.isShallow = isShallow;
|
|
2020
|
+
exports.markRaw = markRaw;
|
|
2021
|
+
exports.onEffectCleanup = onEffectCleanup;
|
|
2022
|
+
exports.onScopeDispose = onScopeDispose;
|
|
2023
|
+
exports.onWatcherCleanup = onWatcherCleanup;
|
|
2024
|
+
exports.pauseTracking = pauseTracking;
|
|
2025
|
+
exports.proxyRefs = proxyRefs;
|
|
2026
|
+
exports.reactive = reactive;
|
|
2027
|
+
exports.reactiveReadArray = reactiveReadArray;
|
|
2028
|
+
exports.readonly = readonly;
|
|
2029
|
+
exports.ref = ref;
|
|
2030
|
+
exports.resetTracking = resetTracking;
|
|
2031
|
+
exports.setActiveSub = setActiveSub;
|
|
2032
|
+
exports.setCurrentScope = setCurrentScope;
|
|
2033
|
+
exports.shallowReactive = shallowReactive;
|
|
2034
|
+
exports.shallowReadArray = shallowReadArray;
|
|
2035
|
+
exports.shallowReadonly = shallowReadonly;
|
|
2036
|
+
exports.shallowRef = shallowRef;
|
|
2037
|
+
exports.stop = stop;
|
|
2038
|
+
exports.toRaw = toRaw;
|
|
2039
|
+
exports.toReactive = toReactive;
|
|
2040
|
+
exports.toReadonly = toReadonly;
|
|
2041
|
+
exports.toRef = toRef;
|
|
2042
|
+
exports.toRefs = toRefs;
|
|
2043
|
+
exports.toValue = toValue;
|
|
2044
|
+
exports.track = track;
|
|
2045
|
+
exports.traverse = traverse;
|
|
2046
|
+
exports.trigger = trigger;
|
|
2047
|
+
exports.triggerRef = triggerRef;
|
|
2048
|
+
exports.unref = unref;
|
|
2049
|
+
exports.watch = watch;
|
|
2050
|
+
return exports;
|
|
2051
|
+
})({});
|