@tachybase/schema 0.23.40 → 0.23.47
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/lib/core/effects/index.d.ts +2 -0
- package/lib/core/effects/index.js +23 -0
- package/lib/core/effects/onFieldEffects.d.ts +27 -0
- package/lib/core/effects/onFieldEffects.js +158 -0
- package/lib/core/effects/onFormEffects.d.ts +24 -0
- package/lib/core/effects/onFormEffects.js +117 -0
- package/lib/core/global.d.js +0 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/core/index.js +27 -0
- package/lib/core/models/ArrayField.d.ts +17 -0
- package/lib/core/models/ArrayField.js +145 -0
- package/lib/core/models/BaseField.d.ts +72 -0
- package/lib/core/models/BaseField.js +285 -0
- package/lib/core/models/Field.d.ts +70 -0
- package/lib/core/models/Field.js +426 -0
- package/lib/core/models/Form.d.ts +102 -0
- package/lib/core/models/Form.js +483 -0
- package/lib/core/models/Graph.d.ts +8 -0
- package/lib/core/models/Graph.js +77 -0
- package/lib/core/models/Heart.d.ts +16 -0
- package/lib/core/models/Heart.js +91 -0
- package/lib/core/models/LifeCycle.d.ts +14 -0
- package/lib/core/models/LifeCycle.js +64 -0
- package/lib/core/models/ObjectField.d.ts +12 -0
- package/lib/core/models/ObjectField.js +64 -0
- package/lib/core/models/Query.d.ts +18 -0
- package/lib/core/models/Query.js +105 -0
- package/lib/core/models/VoidField.d.ts +14 -0
- package/lib/core/models/VoidField.js +117 -0
- package/lib/core/models/index.d.ts +9 -0
- package/lib/core/models/index.js +37 -0
- package/lib/core/models/types.d.ts +9 -0
- package/lib/core/models/types.js +15 -0
- package/lib/core/shared/checkers.d.ts +117 -0
- package/lib/core/shared/checkers.js +109 -0
- package/lib/core/shared/constants.d.ts +48 -0
- package/lib/core/shared/constants.js +86 -0
- package/lib/core/shared/effective.d.ts +9 -0
- package/lib/core/shared/effective.js +91 -0
- package/lib/core/shared/externals.d.ts +8 -0
- package/lib/core/shared/externals.js +87 -0
- package/lib/core/shared/internals.d.ts +54 -0
- package/lib/core/shared/internals.js +956 -0
- package/lib/core/types.d.ts +275 -0
- package/lib/core/types.js +76 -0
- package/lib/grid/index.d.ts +67 -0
- package/lib/grid/index.js +378 -0
- package/lib/grid/observer.d.ts +19 -0
- package/lib/grid/observer.js +107 -0
- package/lib/index.d.ts +12 -24
- package/lib/index.js +27 -244
- package/lib/json-schema/compiler.d.ts +8 -0
- package/lib/json-schema/compiler.js +129 -0
- package/lib/json-schema/global.d.js +0 -0
- package/lib/json-schema/index.d.ts +2 -0
- package/lib/json-schema/index.js +23 -0
- package/lib/json-schema/patches.d.ts +5 -0
- package/lib/json-schema/patches.js +68 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.d.ts +2 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.js +132 -0
- package/lib/json-schema/polyfills/index.d.ts +1 -0
- package/lib/json-schema/polyfills/index.js +21 -0
- package/lib/json-schema/schema.d.ts +88 -0
- package/lib/json-schema/schema.js +231 -0
- package/lib/json-schema/shared.d.ts +62 -0
- package/lib/json-schema/shared.js +232 -0
- package/lib/json-schema/transformer.d.ts +4 -0
- package/lib/json-schema/transformer.js +238 -0
- package/lib/json-schema/types.d.ts +119 -0
- package/lib/json-schema/types.js +15 -0
- package/lib/path/contexts.d.ts +10 -0
- package/lib/path/contexts.js +49 -0
- package/lib/path/destructor.d.ts +15 -0
- package/lib/path/destructor.js +151 -0
- package/lib/path/index.d.ts +51 -0
- package/lib/path/index.js +513 -0
- package/lib/path/matcher.d.ts +33 -0
- package/lib/path/matcher.js +197 -0
- package/lib/path/parser.d.ts +33 -0
- package/lib/path/parser.js +379 -0
- package/lib/path/shared.d.ts +13 -0
- package/lib/path/shared.js +121 -0
- package/lib/path/tokenizer.d.ts +27 -0
- package/lib/path/tokenizer.js +269 -0
- package/lib/path/tokens.d.ts +27 -0
- package/lib/path/tokens.js +216 -0
- package/lib/path/types.d.ts +88 -0
- package/lib/path/types.js +63 -0
- package/lib/react/components/ArrayField.d.ts +6 -0
- package/lib/react/components/ArrayField.js +44 -0
- package/lib/react/components/ExpressionScope.d.ts +2 -0
- package/lib/react/components/ExpressionScope.js +35 -0
- package/lib/react/components/Field.d.ts +5 -0
- package/lib/react/components/Field.js +45 -0
- package/lib/react/components/FormConsumer.d.ts +2 -0
- package/lib/react/components/FormConsumer.js +36 -0
- package/lib/react/components/FormProvider.d.ts +2 -0
- package/lib/react/components/FormProvider.js +35 -0
- package/lib/react/components/ObjectField.d.ts +6 -0
- package/lib/react/components/ObjectField.js +39 -0
- package/lib/react/components/ReactiveField.d.ts +11 -0
- package/lib/react/components/ReactiveField.js +115 -0
- package/lib/react/components/RecordScope.d.ts +2 -0
- package/lib/react/components/RecordScope.js +65 -0
- package/lib/react/components/RecordsScope.d.ts +2 -0
- package/lib/react/components/RecordsScope.js +43 -0
- package/lib/react/components/RecursionField.d.ts +2 -0
- package/lib/react/components/RecursionField.js +105 -0
- package/lib/react/components/SchemaField.d.ts +41 -0
- package/lib/react/components/SchemaField.js +154 -0
- package/lib/react/components/VoidField.d.ts +5 -0
- package/lib/react/components/VoidField.js +39 -0
- package/lib/react/components/index.d.ts +11 -0
- package/lib/react/components/index.js +41 -0
- package/lib/react/global.d.js +0 -0
- package/lib/react/hooks/index.d.ts +6 -0
- package/lib/react/hooks/index.js +31 -0
- package/lib/react/hooks/useAttach.d.ts +6 -0
- package/lib/react/hooks/useAttach.js +35 -0
- package/lib/react/hooks/useExpressionScope.d.ts +1 -0
- package/lib/react/hooks/useExpressionScope.js +30 -0
- package/lib/react/hooks/useField.d.ts +2 -0
- package/lib/react/hooks/useField.js +32 -0
- package/lib/react/hooks/useFieldSchema.d.ts +2 -0
- package/lib/react/hooks/useFieldSchema.js +32 -0
- package/lib/react/hooks/useForm.d.ts +2 -0
- package/lib/react/hooks/useForm.js +32 -0
- package/lib/react/hooks/useFormEffects.d.ts +2 -0
- package/lib/react/hooks/useFormEffects.js +42 -0
- package/lib/react/hooks/useParentForm.d.ts +2 -0
- package/lib/react/hooks/useParentForm.js +40 -0
- package/lib/react/index.d.ts +5 -0
- package/lib/react/index.js +29 -0
- package/lib/react/shared/connect.d.ts +9 -0
- package/lib/react/shared/connect.js +118 -0
- package/lib/react/shared/context.d.ts +14 -0
- package/lib/react/shared/context.js +74 -0
- package/lib/react/shared/index.d.ts +2 -0
- package/lib/react/shared/index.js +23 -0
- package/lib/react/shared/render.d.ts +2 -0
- package/lib/react/shared/render.js +69 -0
- package/lib/react/types.d.ts +84 -0
- package/lib/react/types.js +15 -0
- package/lib/reactive/action.d.ts +2 -0
- package/lib/reactive/action.js +48 -0
- package/lib/reactive/annotations/box.d.ts +7 -0
- package/lib/reactive/annotations/box.js +76 -0
- package/lib/reactive/annotations/computed.d.ts +12 -0
- package/lib/reactive/annotations/computed.js +154 -0
- package/lib/reactive/annotations/index.d.ts +5 -0
- package/lib/reactive/annotations/index.js +29 -0
- package/lib/reactive/annotations/observable.d.ts +4 -0
- package/lib/reactive/annotations/observable.js +67 -0
- package/lib/reactive/annotations/ref.d.ts +6 -0
- package/lib/reactive/annotations/ref.js +78 -0
- package/lib/reactive/annotations/shallow.d.ts +2 -0
- package/lib/reactive/annotations/shallow.js +67 -0
- package/lib/reactive/array.d.ts +12 -0
- package/lib/reactive/array.js +83 -0
- package/lib/reactive/autorun.d.ts +7 -0
- package/lib/reactive/autorun.js +155 -0
- package/lib/reactive/batch.d.ts +2 -0
- package/lib/reactive/batch.js +40 -0
- package/lib/reactive/checkers.d.ts +10 -0
- package/lib/reactive/checkers.js +60 -0
- package/lib/reactive/environment.d.ts +28 -0
- package/lib/reactive/environment.js +76 -0
- package/lib/reactive/externals.d.ts +10 -0
- package/lib/reactive/externals.js +156 -0
- package/lib/reactive/global.d.js +0 -0
- package/lib/reactive/handlers.d.ts +4 -0
- package/lib/reactive/handlers.js +246 -0
- package/lib/reactive/index.d.ts +10 -0
- package/lib/reactive/index.js +39 -0
- package/lib/reactive/internals.d.ts +17 -0
- package/lib/reactive/internals.js +139 -0
- package/lib/reactive/model.d.ts +3 -0
- package/lib/reactive/model.js +68 -0
- package/lib/reactive/observable.d.ts +9 -0
- package/lib/reactive/observable.js +50 -0
- package/lib/reactive/observe.d.ts +2 -0
- package/lib/reactive/observe.js +58 -0
- package/lib/reactive/reaction.d.ts +21 -0
- package/lib/reactive/reaction.js +278 -0
- package/lib/reactive/tracker.d.ts +7 -0
- package/lib/reactive/tracker.js +63 -0
- package/lib/reactive/tree.d.ts +25 -0
- package/lib/reactive/tree.js +106 -0
- package/lib/reactive/types.d.ts +79 -0
- package/lib/reactive/types.js +21 -0
- package/lib/reactive/untracked.d.ts +4 -0
- package/lib/reactive/untracked.js +29 -0
- package/lib/reactive-react/hooks/index.d.ts +9 -0
- package/lib/reactive-react/hooks/index.js +48 -0
- package/lib/reactive-react/hooks/useCompatEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useCompatEffect.js +60 -0
- package/lib/reactive-react/hooks/useCompatFactory.d.ts +3 -0
- package/lib/reactive-react/hooks/useCompatFactory.js +74 -0
- package/lib/reactive-react/hooks/useDidUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useDidUpdate.js +38 -0
- package/lib/reactive-react/hooks/useForceUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useForceUpdate.js +76 -0
- package/lib/reactive-react/hooks/useLayoutEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useLayoutEffect.js +28 -0
- package/lib/reactive-react/hooks/useObserver.d.ts +2 -0
- package/lib/reactive-react/hooks/useObserver.js +43 -0
- package/lib/reactive-react/index.d.ts +3 -0
- package/lib/reactive-react/index.js +25 -0
- package/lib/reactive-react/observer.d.ts +8 -0
- package/lib/reactive-react/observer.js +64 -0
- package/lib/reactive-react/shared/gc.d.ts +8 -0
- package/lib/reactive-react/shared/gc.js +59 -0
- package/lib/reactive-react/shared/global.d.ts +1 -0
- package/lib/reactive-react/shared/global.js +50 -0
- package/lib/reactive-react/shared/immediate.d.ts +1 -0
- package/lib/reactive-react/shared/immediate.js +40 -0
- package/lib/reactive-react/shared/index.d.ts +2 -0
- package/lib/reactive-react/shared/index.js +23 -0
- package/lib/reactive-react/types.d.ts +14 -0
- package/lib/reactive-react/types.js +15 -0
- package/lib/shared/array.d.ts +35 -0
- package/lib/shared/array.js +189 -0
- package/lib/shared/case.d.ts +6 -0
- package/lib/shared/case.js +39 -0
- package/lib/shared/checkers.d.ts +21 -0
- package/lib/shared/checkers.js +77 -0
- package/lib/shared/clone.d.ts +2 -0
- package/lib/shared/clone.js +97 -0
- package/lib/shared/compare.d.ts +1 -0
- package/lib/shared/compare.js +129 -0
- package/lib/shared/defaults.d.ts +6 -0
- package/lib/shared/defaults.js +63 -0
- package/lib/shared/deprecate.d.ts +1 -0
- package/lib/shared/deprecate.js +42 -0
- package/lib/shared/global.d.ts +1 -0
- package/lib/shared/global.js +50 -0
- package/lib/shared/index.d.ts +16 -0
- package/lib/shared/index.js +51 -0
- package/lib/shared/instanceof.d.ts +1 -0
- package/lib/shared/instanceof.js +36 -0
- package/lib/shared/isEmpty.d.ts +3 -0
- package/lib/shared/isEmpty.js +94 -0
- package/lib/shared/merge.d.ts +12 -0
- package/lib/shared/merge.js +214 -0
- package/lib/shared/middleware.d.ts +4 -0
- package/lib/shared/middleware.js +41 -0
- package/lib/shared/path.d.ts +3 -0
- package/lib/shared/path.js +27 -0
- package/lib/shared/string.d.ts +1 -0
- package/lib/shared/string.js +38 -0
- package/lib/shared/subscribable.d.ts +11 -0
- package/lib/shared/subscribable.js +74 -0
- package/lib/shared/uid.d.ts +1 -0
- package/lib/shared/uid.js +35 -0
- package/lib/validator/formats.d.ts +16 -0
- package/lib/validator/formats.js +40 -0
- package/lib/validator/index.d.ts +4 -0
- package/lib/validator/index.js +27 -0
- package/lib/validator/locale.d.ts +219 -0
- package/lib/validator/locale.js +240 -0
- package/lib/validator/parser.d.ts +5 -0
- package/lib/validator/parser.js +153 -0
- package/lib/validator/registry.d.ts +15 -0
- package/lib/validator/registry.js +116 -0
- package/lib/validator/rules.d.ts +3 -0
- package/lib/validator/rules.js +154 -0
- package/lib/validator/template.d.ts +2 -0
- package/lib/validator/template.js +42 -0
- package/lib/validator/types.d.ts +62 -0
- package/lib/validator/types.js +28 -0
- package/lib/validator/validator.d.ts +2 -0
- package/lib/validator/validator.js +63 -0
- package/package.json +16 -10
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var reaction_exports = {};
|
|
20
|
+
__export(reaction_exports, {
|
|
21
|
+
batchEnd: () => batchEnd,
|
|
22
|
+
batchScopeEnd: () => batchScopeEnd,
|
|
23
|
+
batchScopeStart: () => batchScopeStart,
|
|
24
|
+
batchStart: () => batchStart,
|
|
25
|
+
bindComputedReactions: () => bindComputedReactions,
|
|
26
|
+
bindTargetKeyWithCurrentReaction: () => bindTargetKeyWithCurrentReaction,
|
|
27
|
+
disposeBindingReactions: () => disposeBindingReactions,
|
|
28
|
+
disposeEffects: () => disposeEffects,
|
|
29
|
+
executeBatchEndpoints: () => executeBatchEndpoints,
|
|
30
|
+
executePendingReactions: () => executePendingReactions,
|
|
31
|
+
hasDepsChange: () => hasDepsChange,
|
|
32
|
+
hasRunningReaction: () => hasRunningReaction,
|
|
33
|
+
isBatching: () => isBatching,
|
|
34
|
+
isScopeBatching: () => isScopeBatching,
|
|
35
|
+
isUntracking: () => isUntracking,
|
|
36
|
+
releaseBindingReactions: () => releaseBindingReactions,
|
|
37
|
+
runReactionsFromTargetKey: () => runReactionsFromTargetKey,
|
|
38
|
+
suspendComputedReactions: () => suspendComputedReactions,
|
|
39
|
+
untrackEnd: () => untrackEnd,
|
|
40
|
+
untrackStart: () => untrackStart
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(reaction_exports);
|
|
43
|
+
var import_array = require("./array");
|
|
44
|
+
var import_checkers = require("./checkers");
|
|
45
|
+
var import_environment = require("./environment");
|
|
46
|
+
const ITERATION_KEY = Symbol("iteration key");
|
|
47
|
+
const addRawReactionsMap = /* @__PURE__ */ __name((target, key, reaction) => {
|
|
48
|
+
const reactionsMap = import_environment.RawReactionsMap.get(target);
|
|
49
|
+
if (reactionsMap) {
|
|
50
|
+
const reactions = reactionsMap.get(key);
|
|
51
|
+
if (reactions) {
|
|
52
|
+
reactions.add(reaction);
|
|
53
|
+
} else {
|
|
54
|
+
reactionsMap.set(key, new import_array.ArraySet([reaction]));
|
|
55
|
+
}
|
|
56
|
+
return reactionsMap;
|
|
57
|
+
} else {
|
|
58
|
+
const reactionsMap2 = /* @__PURE__ */ new Map([[key, new import_array.ArraySet([reaction])]]);
|
|
59
|
+
import_environment.RawReactionsMap.set(target, reactionsMap2);
|
|
60
|
+
return reactionsMap2;
|
|
61
|
+
}
|
|
62
|
+
}, "addRawReactionsMap");
|
|
63
|
+
const addReactionsMapToReaction = /* @__PURE__ */ __name((reaction, reactionsMap) => {
|
|
64
|
+
const bindSet = reaction._reactionsSet;
|
|
65
|
+
if (bindSet) {
|
|
66
|
+
bindSet.add(reactionsMap);
|
|
67
|
+
} else {
|
|
68
|
+
reaction._reactionsSet = new import_array.ArraySet([reactionsMap]);
|
|
69
|
+
}
|
|
70
|
+
return bindSet;
|
|
71
|
+
}, "addReactionsMapToReaction");
|
|
72
|
+
const getReactionsFromTargetKey = /* @__PURE__ */ __name((target, key) => {
|
|
73
|
+
const reactionsMap = import_environment.RawReactionsMap.get(target);
|
|
74
|
+
const reactions = [];
|
|
75
|
+
if (reactionsMap) {
|
|
76
|
+
const map = reactionsMap.get(key);
|
|
77
|
+
if (map) {
|
|
78
|
+
map.forEach((reaction) => {
|
|
79
|
+
if (reactions.indexOf(reaction) === -1) {
|
|
80
|
+
reactions.push(reaction);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return reactions;
|
|
86
|
+
}, "getReactionsFromTargetKey");
|
|
87
|
+
const runReactions = /* @__PURE__ */ __name((target, key) => {
|
|
88
|
+
const reactions = getReactionsFromTargetKey(target, key);
|
|
89
|
+
const prevUntrackCount = import_environment.UntrackCount.value;
|
|
90
|
+
import_environment.UntrackCount.value = 0;
|
|
91
|
+
for (let i = 0, len = reactions.length; i < len; i++) {
|
|
92
|
+
const reaction = reactions[i];
|
|
93
|
+
if (reaction._isComputed) {
|
|
94
|
+
reaction._scheduler(reaction);
|
|
95
|
+
} else if (isScopeBatching()) {
|
|
96
|
+
import_environment.PendingScopeReactions.add(reaction);
|
|
97
|
+
} else if (isBatching()) {
|
|
98
|
+
import_environment.PendingReactions.add(reaction);
|
|
99
|
+
} else {
|
|
100
|
+
if ((0, import_checkers.isFn)(reaction._scheduler)) {
|
|
101
|
+
reaction._scheduler(reaction);
|
|
102
|
+
} else {
|
|
103
|
+
reaction();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
import_environment.UntrackCount.value = prevUntrackCount;
|
|
108
|
+
}, "runReactions");
|
|
109
|
+
const notifyObservers = /* @__PURE__ */ __name((operation) => {
|
|
110
|
+
import_environment.ObserverListeners.forEach((fn) => fn(operation));
|
|
111
|
+
}, "notifyObservers");
|
|
112
|
+
const bindTargetKeyWithCurrentReaction = /* @__PURE__ */ __name((operation) => {
|
|
113
|
+
let { key, type, target } = operation;
|
|
114
|
+
if (type === "iterate") {
|
|
115
|
+
key = ITERATION_KEY;
|
|
116
|
+
}
|
|
117
|
+
const reactionLen = import_environment.ReactionStack.length;
|
|
118
|
+
if (reactionLen === 0) return;
|
|
119
|
+
const current = import_environment.ReactionStack[reactionLen - 1];
|
|
120
|
+
if (isUntracking()) return;
|
|
121
|
+
if (current) {
|
|
122
|
+
import_environment.DependencyCollected.value = true;
|
|
123
|
+
addReactionsMapToReaction(current, addRawReactionsMap(target, key, current));
|
|
124
|
+
}
|
|
125
|
+
}, "bindTargetKeyWithCurrentReaction");
|
|
126
|
+
const bindComputedReactions = /* @__PURE__ */ __name((reaction) => {
|
|
127
|
+
if ((0, import_checkers.isFn)(reaction)) {
|
|
128
|
+
const current = import_environment.ReactionStack[import_environment.ReactionStack.length - 1];
|
|
129
|
+
if (current) {
|
|
130
|
+
const computes = current._computesSet;
|
|
131
|
+
if (computes) {
|
|
132
|
+
computes.add(reaction);
|
|
133
|
+
} else {
|
|
134
|
+
current._computesSet = new import_array.ArraySet([reaction]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}, "bindComputedReactions");
|
|
139
|
+
const runReactionsFromTargetKey = /* @__PURE__ */ __name((operation) => {
|
|
140
|
+
let { key, type, target, oldTarget } = operation;
|
|
141
|
+
batchStart();
|
|
142
|
+
notifyObservers(operation);
|
|
143
|
+
if (type === "clear") {
|
|
144
|
+
oldTarget.forEach((_, key2) => {
|
|
145
|
+
runReactions(target, key2);
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
runReactions(target, key);
|
|
149
|
+
}
|
|
150
|
+
if (type === "add" || type === "delete" || type === "clear") {
|
|
151
|
+
const newKey = Array.isArray(target) ? "length" : ITERATION_KEY;
|
|
152
|
+
runReactions(target, newKey);
|
|
153
|
+
}
|
|
154
|
+
batchEnd();
|
|
155
|
+
}, "runReactionsFromTargetKey");
|
|
156
|
+
const hasRunningReaction = /* @__PURE__ */ __name(() => {
|
|
157
|
+
return import_environment.ReactionStack.length > 0;
|
|
158
|
+
}, "hasRunningReaction");
|
|
159
|
+
const releaseBindingReactions = /* @__PURE__ */ __name((reaction) => {
|
|
160
|
+
var _a;
|
|
161
|
+
(_a = reaction._reactionsSet) == null ? void 0 : _a.forEach((reactionsMap) => {
|
|
162
|
+
reactionsMap.forEach((reactions) => {
|
|
163
|
+
reactions.delete(reaction);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
import_environment.PendingReactions.delete(reaction);
|
|
167
|
+
import_environment.PendingScopeReactions.delete(reaction);
|
|
168
|
+
delete reaction._reactionsSet;
|
|
169
|
+
}, "releaseBindingReactions");
|
|
170
|
+
const suspendComputedReactions = /* @__PURE__ */ __name((current) => {
|
|
171
|
+
var _a;
|
|
172
|
+
(_a = current._computesSet) == null ? void 0 : _a.forEach((reaction) => {
|
|
173
|
+
const reactions = getReactionsFromTargetKey(reaction._context, reaction._property);
|
|
174
|
+
if (reactions.length === 0) {
|
|
175
|
+
disposeBindingReactions(reaction);
|
|
176
|
+
reaction._dirty = true;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}, "suspendComputedReactions");
|
|
180
|
+
const disposeBindingReactions = /* @__PURE__ */ __name((reaction) => {
|
|
181
|
+
reaction._disposed = true;
|
|
182
|
+
releaseBindingReactions(reaction);
|
|
183
|
+
suspendComputedReactions(reaction);
|
|
184
|
+
}, "disposeBindingReactions");
|
|
185
|
+
const batchStart = /* @__PURE__ */ __name(() => {
|
|
186
|
+
import_environment.BatchCount.value++;
|
|
187
|
+
}, "batchStart");
|
|
188
|
+
const batchEnd = /* @__PURE__ */ __name(() => {
|
|
189
|
+
import_environment.BatchCount.value--;
|
|
190
|
+
if (import_environment.BatchCount.value === 0) {
|
|
191
|
+
const prevUntrackCount = import_environment.UntrackCount.value;
|
|
192
|
+
import_environment.UntrackCount.value = 0;
|
|
193
|
+
executePendingReactions();
|
|
194
|
+
executeBatchEndpoints();
|
|
195
|
+
import_environment.UntrackCount.value = prevUntrackCount;
|
|
196
|
+
}
|
|
197
|
+
}, "batchEnd");
|
|
198
|
+
const batchScopeStart = /* @__PURE__ */ __name(() => {
|
|
199
|
+
import_environment.BatchScope.value = true;
|
|
200
|
+
}, "batchScopeStart");
|
|
201
|
+
const batchScopeEnd = /* @__PURE__ */ __name(() => {
|
|
202
|
+
const prevUntrackCount = import_environment.UntrackCount.value;
|
|
203
|
+
import_environment.BatchScope.value = false;
|
|
204
|
+
import_environment.UntrackCount.value = 0;
|
|
205
|
+
import_environment.PendingScopeReactions.batchDelete((reaction) => {
|
|
206
|
+
if ((0, import_checkers.isFn)(reaction._scheduler)) {
|
|
207
|
+
reaction._scheduler(reaction);
|
|
208
|
+
} else {
|
|
209
|
+
reaction();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
import_environment.UntrackCount.value = prevUntrackCount;
|
|
213
|
+
}, "batchScopeEnd");
|
|
214
|
+
const untrackStart = /* @__PURE__ */ __name(() => {
|
|
215
|
+
import_environment.UntrackCount.value++;
|
|
216
|
+
}, "untrackStart");
|
|
217
|
+
const untrackEnd = /* @__PURE__ */ __name(() => {
|
|
218
|
+
import_environment.UntrackCount.value--;
|
|
219
|
+
}, "untrackEnd");
|
|
220
|
+
const isBatching = /* @__PURE__ */ __name(() => import_environment.BatchCount.value > 0, "isBatching");
|
|
221
|
+
const isScopeBatching = /* @__PURE__ */ __name(() => import_environment.BatchScope.value, "isScopeBatching");
|
|
222
|
+
const isUntracking = /* @__PURE__ */ __name(() => import_environment.UntrackCount.value > 0, "isUntracking");
|
|
223
|
+
const executePendingReactions = /* @__PURE__ */ __name(() => {
|
|
224
|
+
import_environment.PendingReactions.batchDelete((reaction) => {
|
|
225
|
+
if ((0, import_checkers.isFn)(reaction._scheduler)) {
|
|
226
|
+
reaction._scheduler(reaction);
|
|
227
|
+
} else {
|
|
228
|
+
reaction();
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}, "executePendingReactions");
|
|
232
|
+
const executeBatchEndpoints = /* @__PURE__ */ __name(() => {
|
|
233
|
+
import_environment.BatchEndpoints.batchDelete((callback) => {
|
|
234
|
+
callback();
|
|
235
|
+
});
|
|
236
|
+
}, "executeBatchEndpoints");
|
|
237
|
+
const hasDepsChange = /* @__PURE__ */ __name((newDeps, oldDeps) => {
|
|
238
|
+
if (newDeps === oldDeps) return false;
|
|
239
|
+
if (newDeps.length !== oldDeps.length) return true;
|
|
240
|
+
if (newDeps.some((value, index) => value !== oldDeps[index])) return true;
|
|
241
|
+
return false;
|
|
242
|
+
}, "hasDepsChange");
|
|
243
|
+
const disposeEffects = /* @__PURE__ */ __name((reaction) => {
|
|
244
|
+
if (reaction._effects) {
|
|
245
|
+
try {
|
|
246
|
+
batchStart();
|
|
247
|
+
reaction._effects.queue.forEach((item) => {
|
|
248
|
+
if (!item || !item.dispose) return;
|
|
249
|
+
item.dispose();
|
|
250
|
+
});
|
|
251
|
+
} finally {
|
|
252
|
+
batchEnd();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}, "disposeEffects");
|
|
256
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
+
0 && (module.exports = {
|
|
258
|
+
batchEnd,
|
|
259
|
+
batchScopeEnd,
|
|
260
|
+
batchScopeStart,
|
|
261
|
+
batchStart,
|
|
262
|
+
bindComputedReactions,
|
|
263
|
+
bindTargetKeyWithCurrentReaction,
|
|
264
|
+
disposeBindingReactions,
|
|
265
|
+
disposeEffects,
|
|
266
|
+
executeBatchEndpoints,
|
|
267
|
+
executePendingReactions,
|
|
268
|
+
hasDepsChange,
|
|
269
|
+
hasRunningReaction,
|
|
270
|
+
isBatching,
|
|
271
|
+
isScopeBatching,
|
|
272
|
+
isUntracking,
|
|
273
|
+
releaseBindingReactions,
|
|
274
|
+
runReactionsFromTargetKey,
|
|
275
|
+
suspendComputedReactions,
|
|
276
|
+
untrackEnd,
|
|
277
|
+
untrackStart
|
|
278
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tracker_exports = {};
|
|
20
|
+
__export(tracker_exports, {
|
|
21
|
+
Tracker: () => Tracker
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(tracker_exports);
|
|
24
|
+
var import_checkers = require("./checkers");
|
|
25
|
+
var import_environment = require("./environment");
|
|
26
|
+
var import_reaction = require("./reaction");
|
|
27
|
+
const _Tracker = class _Tracker {
|
|
28
|
+
constructor(scheduler, name = "TrackerReaction") {
|
|
29
|
+
this.track = /* @__PURE__ */ __name((tracker) => {
|
|
30
|
+
if (!(0, import_checkers.isFn)(tracker)) return this.results;
|
|
31
|
+
if (this.track._boundary > 0) return;
|
|
32
|
+
if (import_environment.ReactionStack.indexOf(this.track) === -1) {
|
|
33
|
+
(0, import_reaction.releaseBindingReactions)(this.track);
|
|
34
|
+
try {
|
|
35
|
+
(0, import_reaction.batchStart)();
|
|
36
|
+
import_environment.ReactionStack.push(this.track);
|
|
37
|
+
this.results = tracker();
|
|
38
|
+
} finally {
|
|
39
|
+
import_environment.ReactionStack.pop();
|
|
40
|
+
this.track._boundary++;
|
|
41
|
+
(0, import_reaction.batchEnd)();
|
|
42
|
+
this.track._boundary = 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return this.results;
|
|
46
|
+
}, "track");
|
|
47
|
+
this.dispose = /* @__PURE__ */ __name(() => {
|
|
48
|
+
(0, import_reaction.disposeBindingReactions)(this.track);
|
|
49
|
+
}, "dispose");
|
|
50
|
+
this.track._scheduler = (callback) => {
|
|
51
|
+
if (this.track._boundary === 0) this.dispose();
|
|
52
|
+
if ((0, import_checkers.isFn)(callback)) scheduler(callback);
|
|
53
|
+
};
|
|
54
|
+
this.track._name = name;
|
|
55
|
+
this.track._boundary = 0;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__name(_Tracker, "Tracker");
|
|
59
|
+
let Tracker = _Tracker;
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
Tracker
|
|
63
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IOperation, PropertyKey } from './types';
|
|
2
|
+
export declare class DataChange {
|
|
3
|
+
node: DataNode;
|
|
4
|
+
key: PropertyKey;
|
|
5
|
+
object: object;
|
|
6
|
+
type: string;
|
|
7
|
+
value: any;
|
|
8
|
+
oldValue: any;
|
|
9
|
+
constructor(operation: IOperation, node: DataNode);
|
|
10
|
+
get path(): any;
|
|
11
|
+
}
|
|
12
|
+
export declare class DataNode {
|
|
13
|
+
target: any;
|
|
14
|
+
key: PropertyKey;
|
|
15
|
+
value: any;
|
|
16
|
+
constructor(target: any, key: PropertyKey, value: any);
|
|
17
|
+
get path(): any;
|
|
18
|
+
get targetRaw(): any;
|
|
19
|
+
get parent(): any;
|
|
20
|
+
isEqual(node: DataNode): boolean;
|
|
21
|
+
contains(node: DataNode): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const getDataNode: (raw: any) => any;
|
|
24
|
+
export declare const setDataNode: (raw: any, node: DataNode) => void;
|
|
25
|
+
export declare const buildDataTree: (target: any, key: PropertyKey, value: any) => any;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tree_exports = {};
|
|
20
|
+
__export(tree_exports, {
|
|
21
|
+
DataChange: () => DataChange,
|
|
22
|
+
DataNode: () => DataNode,
|
|
23
|
+
buildDataTree: () => buildDataTree,
|
|
24
|
+
getDataNode: () => getDataNode,
|
|
25
|
+
setDataNode: () => setDataNode
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(tree_exports);
|
|
28
|
+
var import_environment = require("./environment");
|
|
29
|
+
var import_externals = require("./externals");
|
|
30
|
+
const _DataChange = class _DataChange {
|
|
31
|
+
constructor(operation, node) {
|
|
32
|
+
this.node = node;
|
|
33
|
+
this.key = operation.key;
|
|
34
|
+
this.type = operation.type;
|
|
35
|
+
this.object = operation.target;
|
|
36
|
+
this.value = operation.value;
|
|
37
|
+
this.oldValue = operation.oldValue;
|
|
38
|
+
}
|
|
39
|
+
get path() {
|
|
40
|
+
return this.node.path.concat(this.key);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
__name(_DataChange, "DataChange");
|
|
44
|
+
let DataChange = _DataChange;
|
|
45
|
+
const _DataNode = class _DataNode {
|
|
46
|
+
constructor(target, key, value) {
|
|
47
|
+
this.target = target;
|
|
48
|
+
this.key = key;
|
|
49
|
+
this.value = value;
|
|
50
|
+
}
|
|
51
|
+
get path() {
|
|
52
|
+
if (!this.parent) return this.key ? [this.key] : [];
|
|
53
|
+
return this.parent.path.concat(this.key);
|
|
54
|
+
}
|
|
55
|
+
get targetRaw() {
|
|
56
|
+
return (0, import_externals.raw)(this.target);
|
|
57
|
+
}
|
|
58
|
+
get parent() {
|
|
59
|
+
if (!this.target) return;
|
|
60
|
+
return getDataNode(this.targetRaw);
|
|
61
|
+
}
|
|
62
|
+
isEqual(node) {
|
|
63
|
+
if (this.key) {
|
|
64
|
+
return node.targetRaw === this.targetRaw && node.key === this.key;
|
|
65
|
+
}
|
|
66
|
+
return node.value === this.value;
|
|
67
|
+
}
|
|
68
|
+
contains(node) {
|
|
69
|
+
if (node === this) return true;
|
|
70
|
+
let parent = node.parent;
|
|
71
|
+
while (!!parent) {
|
|
72
|
+
if (this.isEqual(parent)) return true;
|
|
73
|
+
parent = parent.parent;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
__name(_DataNode, "DataNode");
|
|
79
|
+
let DataNode = _DataNode;
|
|
80
|
+
const getDataNode = /* @__PURE__ */ __name((raw) => {
|
|
81
|
+
if (raw == null ? void 0 : raw[import_environment.ObModelNodeSymbol]) {
|
|
82
|
+
return raw[import_environment.ObModelNodeSymbol];
|
|
83
|
+
}
|
|
84
|
+
return import_environment.RawNode.get(raw);
|
|
85
|
+
}, "getDataNode");
|
|
86
|
+
const setDataNode = /* @__PURE__ */ __name((raw, node) => {
|
|
87
|
+
if (raw == null ? void 0 : raw[import_environment.ObModelSymbol]) {
|
|
88
|
+
raw[import_environment.ObModelNodeSymbol] = node;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
import_environment.RawNode.set(raw, node);
|
|
92
|
+
}, "setDataNode");
|
|
93
|
+
const buildDataTree = /* @__PURE__ */ __name((target, key, value) => {
|
|
94
|
+
const raw = (0, import_externals.raw)(value);
|
|
95
|
+
const currentNode = getDataNode(raw);
|
|
96
|
+
if (currentNode) return currentNode;
|
|
97
|
+
setDataNode(raw, new DataNode(target, key, value));
|
|
98
|
+
}, "buildDataTree");
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
DataChange,
|
|
102
|
+
DataNode,
|
|
103
|
+
buildDataTree,
|
|
104
|
+
getDataNode,
|
|
105
|
+
setDataNode
|
|
106
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ArraySet } from './array';
|
|
2
|
+
export * from './tree';
|
|
3
|
+
export type PropertyKey = string | number | symbol;
|
|
4
|
+
export type OperationType = 'add' | 'delete' | 'clear' | 'set' | 'get' | 'iterate' | 'has';
|
|
5
|
+
export interface IOperation {
|
|
6
|
+
target?: any;
|
|
7
|
+
oldTarget?: any;
|
|
8
|
+
key?: PropertyKey;
|
|
9
|
+
value?: any;
|
|
10
|
+
oldValue?: any;
|
|
11
|
+
type?: OperationType;
|
|
12
|
+
receiver?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface IChange {
|
|
15
|
+
key?: PropertyKey;
|
|
16
|
+
path?: ObservablePath;
|
|
17
|
+
value?: any;
|
|
18
|
+
oldValue?: any;
|
|
19
|
+
type?: OperationType;
|
|
20
|
+
}
|
|
21
|
+
export interface IEffectQueueItem {
|
|
22
|
+
dispose?: void | Dispose;
|
|
23
|
+
deps?: any[];
|
|
24
|
+
}
|
|
25
|
+
export interface IMemoQueueItem {
|
|
26
|
+
value?: any;
|
|
27
|
+
deps?: any[];
|
|
28
|
+
}
|
|
29
|
+
export interface IVisitor<Value = any, Target = any> {
|
|
30
|
+
target?: Target;
|
|
31
|
+
key?: PropertyKey;
|
|
32
|
+
value?: Value;
|
|
33
|
+
}
|
|
34
|
+
export type Annotation = (...args: any[]) => any;
|
|
35
|
+
export type Annotations<T = any> = {
|
|
36
|
+
[key in keyof T]?: Annotation;
|
|
37
|
+
};
|
|
38
|
+
export type ObservableListener = (operation: IOperation) => void;
|
|
39
|
+
export type ObservablePath = Array<string | number>;
|
|
40
|
+
export type Dispose = () => void;
|
|
41
|
+
export type Effect = () => void | Dispose;
|
|
42
|
+
export type Reaction = ((...args: any[]) => any) & {
|
|
43
|
+
_boundary?: number;
|
|
44
|
+
_name?: string;
|
|
45
|
+
_isComputed?: boolean;
|
|
46
|
+
_dirty?: boolean;
|
|
47
|
+
_context?: any;
|
|
48
|
+
_disposed?: boolean;
|
|
49
|
+
_property?: PropertyKey;
|
|
50
|
+
_computesSet?: ArraySet<Reaction>;
|
|
51
|
+
_reactionsSet?: ArraySet<ReactionsMap>;
|
|
52
|
+
_scheduler?: (reaction: Reaction) => void;
|
|
53
|
+
_memos?: {
|
|
54
|
+
queue: IMemoQueueItem[];
|
|
55
|
+
cursor: number;
|
|
56
|
+
};
|
|
57
|
+
_effects?: {
|
|
58
|
+
queue: IEffectQueueItem[];
|
|
59
|
+
cursor: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export type ReactionsMap = Map<PropertyKey, ArraySet<Reaction>>;
|
|
63
|
+
export interface IReactionOptions<T> {
|
|
64
|
+
name?: string;
|
|
65
|
+
equals?: (oldValue: T, newValue: T) => boolean;
|
|
66
|
+
fireImmediately?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export type BindFunction<F = (...args: any[]) => any> = (callback?: F, context?: any) => F;
|
|
69
|
+
export type BoundaryFunction = <F extends (...args: any) => any>(fn?: F) => ReturnType<F>;
|
|
70
|
+
export interface IBoundable {
|
|
71
|
+
bound?: <T extends (...args: any[]) => any>(callback: T, context?: any) => T;
|
|
72
|
+
}
|
|
73
|
+
export interface IAction extends IBoundable {
|
|
74
|
+
<T>(callback?: () => T): T;
|
|
75
|
+
scope?: (<T>(callback?: () => T) => T) & IBoundable;
|
|
76
|
+
}
|
|
77
|
+
export interface IBatch extends IAction {
|
|
78
|
+
endpoint?: (callback?: () => void) => void;
|
|
79
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|
|
17
|
+
__reExport(types_exports, require("./tree"), module.exports);
|
|
18
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
19
|
+
0 && (module.exports = {
|
|
20
|
+
...require("./tree")
|
|
21
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var untracked_exports = {};
|
|
19
|
+
__export(untracked_exports, {
|
|
20
|
+
untracked: () => untracked
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(untracked_exports);
|
|
23
|
+
var import_internals = require("./internals");
|
|
24
|
+
var import_reaction = require("./reaction");
|
|
25
|
+
const untracked = (0, import_internals.createBoundaryFunction)(import_reaction.untrackStart, import_reaction.untrackEnd);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
untracked
|
|
29
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useForceUpdate } from './useForceUpdate';
|
|
2
|
+
export declare const unstable_useForceUpdate: typeof useForceUpdate;
|
|
3
|
+
export declare const unstable_useCompatEffect: (effect: import("react").EffectCallback, deps?: import("react").DependencyList) => void;
|
|
4
|
+
export declare const unstable_useCompatFactory: <T extends {
|
|
5
|
+
dispose: () => void;
|
|
6
|
+
}>(factory: () => T) => T;
|
|
7
|
+
export declare const unstable_useDidUpdate: (callback?: () => void) => void;
|
|
8
|
+
export declare const unstable_useLayoutEffect: typeof import("react").useEffect;
|
|
9
|
+
export declare const unstable_useObserver: <T extends () => any>(view: T, options?: import("..").IObserverOptions) => ReturnType<T>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var hooks_exports = {};
|
|
19
|
+
__export(hooks_exports, {
|
|
20
|
+
unstable_useCompatEffect: () => unstable_useCompatEffect,
|
|
21
|
+
unstable_useCompatFactory: () => unstable_useCompatFactory,
|
|
22
|
+
unstable_useDidUpdate: () => unstable_useDidUpdate,
|
|
23
|
+
unstable_useForceUpdate: () => unstable_useForceUpdate,
|
|
24
|
+
unstable_useLayoutEffect: () => unstable_useLayoutEffect,
|
|
25
|
+
unstable_useObserver: () => unstable_useObserver
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
28
|
+
var import_useCompatEffect = require("./useCompatEffect");
|
|
29
|
+
var import_useCompatFactory = require("./useCompatFactory");
|
|
30
|
+
var import_useDidUpdate = require("./useDidUpdate");
|
|
31
|
+
var import_useForceUpdate = require("./useForceUpdate");
|
|
32
|
+
var import_useLayoutEffect = require("./useLayoutEffect");
|
|
33
|
+
var import_useObserver = require("./useObserver");
|
|
34
|
+
const unstable_useForceUpdate = import_useForceUpdate.useForceUpdate;
|
|
35
|
+
const unstable_useCompatEffect = import_useCompatEffect.useCompatEffect;
|
|
36
|
+
const unstable_useCompatFactory = import_useCompatFactory.useCompatFactory;
|
|
37
|
+
const unstable_useDidUpdate = import_useDidUpdate.useDidUpdate;
|
|
38
|
+
const unstable_useLayoutEffect = import_useLayoutEffect.useLayoutEffect;
|
|
39
|
+
const unstable_useObserver = import_useObserver.useObserver;
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
unstable_useCompatEffect,
|
|
43
|
+
unstable_useCompatFactory,
|
|
44
|
+
unstable_useDidUpdate,
|
|
45
|
+
unstable_useForceUpdate,
|
|
46
|
+
unstable_useLayoutEffect,
|
|
47
|
+
unstable_useObserver
|
|
48
|
+
});
|