palistor 0.0.24 → 0.0.26
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/README.md +574 -542
- package/README.ru.md +979 -0
- package/dist/index.d.ts +19 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -28
- package/dist/index.js.map +1 -1
- package/dist/react/createTrackingProxy.d.ts +27 -27
- package/dist/react/createTrackingProxy.d.ts.map +1 -1
- package/dist/react/createTrackingProxy.js +92 -42
- package/dist/react/createTrackingProxy.js.map +1 -1
- package/dist/react/useForm.d.ts +42 -43
- package/dist/react/useForm.d.ts.map +1 -1
- package/dist/react/useForm.js +38 -38
- package/dist/react/useForm.js.map +1 -1
- package/dist/react/usePersist.d.ts +14 -14
- package/dist/react/usePersist.js +18 -18
- package/dist/react/usePersist.js.map +1 -1
- package/dist/react/useStoreContext.d.ts +11 -11
- package/dist/react/useStoreContext.js +11 -11
- package/dist/react/useTranslator.d.ts +12 -12
- package/dist/react/useTranslator.js +12 -12
- package/dist/store/applyPatch/applyPatch.d.ts +8 -8
- package/dist/store/applyPatch/applyPatch.js +12 -12
- package/dist/store/applyPatch/applyPatch.js.map +1 -1
- package/dist/store/buildProxy/buildEntityProjectionProxy.js +6 -6
- package/dist/store/buildProxy/buildEntityProjectionProxy.js.map +1 -1
- package/dist/store/buildProxy/buildListProxy.d.ts +8 -8
- package/dist/store/buildProxy/buildListProxy.js +30 -30
- package/dist/store/buildProxy/buildListProxy.js.map +1 -1
- package/dist/store/buildProxy/buildProxy.d.ts +8 -8
- package/dist/store/buildProxy/buildProxy.d.ts.map +1 -1
- package/dist/store/buildProxy/buildProxy.js +84 -33
- package/dist/store/buildProxy/buildProxy.js.map +1 -1
- package/dist/store/buildProxy/computeProxyKeys.d.ts +8 -8
- package/dist/store/buildProxy/computeProxyKeys.d.ts.map +1 -1
- package/dist/store/buildProxy/computeProxyKeys.js +18 -13
- package/dist/store/buildProxy/computeProxyKeys.js.map +1 -1
- package/dist/store/buildProxy/handleLazyResolve.d.ts +3 -3
- package/dist/store/buildProxy/handleLazyResolve.js +3 -3
- package/dist/store/buildProxy/initProxyCaches.d.ts +5 -5
- package/dist/store/buildProxy/initProxyCaches.js +5 -5
- package/dist/store/compute/computeFieldState.d.ts +3 -3
- package/dist/store/compute/computeFieldState.js +8 -8
- package/dist/store/compute/computeFieldState.js.map +1 -1
- package/dist/store/compute/fieldStateChanged.d.ts +1 -1
- package/dist/store/compute/fieldStateChanged.js +1 -1
- package/dist/store/compute/recompute/collectGroupComputeNodes.d.ts +4 -4
- package/dist/store/compute/recompute/collectGroupComputeNodes.js +7 -7
- package/dist/store/compute/recompute/collectGroupComputeNodes.js.map +1 -1
- package/dist/store/compute/recompute/recomputeAndNotify.d.ts +3 -3
- package/dist/store/compute/recompute/recomputeAndNotify.js +3 -3
- package/dist/store/compute/recompute/recomputeLeaves.d.ts +11 -10
- package/dist/store/compute/recompute/recomputeLeaves.d.ts.map +1 -1
- package/dist/store/compute/recompute/recomputeLeaves.js +26 -27
- package/dist/store/compute/recompute/recomputeLeaves.js.map +1 -1
- package/dist/store/compute/recompute/recomputeTargeted.d.ts +7 -7
- package/dist/store/compute/recompute/recomputeTargeted.js +12 -12
- package/dist/store/compute/recompute/recomputeTargeted.js.map +1 -1
- package/dist/store/compute/recompute/topologicalSortComputed.d.ts +4 -4
- package/dist/store/compute/recompute/topologicalSortComputed.d.ts.map +1 -1
- package/dist/store/compute/recompute/topologicalSortComputed.js +11 -13
- package/dist/store/compute/recompute/topologicalSortComputed.js.map +1 -1
- package/dist/store/compute/recompute/types.d.ts +4 -4
- package/dist/store/compute/resolveFlag.d.ts +2 -2
- package/dist/store/compute/resolveFlag.js +2 -2
- package/dist/store/compute/resolveString.d.ts +5 -5
- package/dist/store/compute/resolveString.js +6 -6
- package/dist/store/compute/resolveString.js.map +1 -1
- package/dist/store/compute/types.d.ts +3 -3
- package/dist/store/constants.d.ts +57 -38
- package/dist/store/constants.d.ts.map +1 -1
- package/dist/store/constants.js +70 -35
- package/dist/store/constants.js.map +1 -1
- package/dist/store/defineFieldMapping.d.ts +21 -19
- package/dist/store/defineFieldMapping.d.ts.map +1 -1
- package/dist/store/defineFieldMapping.js +21 -19
- package/dist/store/defineFieldMapping.js.map +1 -1
- package/dist/store/dirtyTracking/collectInitialSnapshot.js +1 -1
- package/dist/store/dirtyTracking/collectInitialSnapshot.js.map +1 -1
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.d.ts +3 -3
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.js +11 -11
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.js.map +1 -1
- package/dist/store/dirtyTracking/setGroupRevalidate.d.ts +6 -6
- package/dist/store/dirtyTracking/setGroupRevalidate.js +7 -7
- package/dist/store/dirtyTracking/setGroupRevalidate.js.map +1 -1
- package/dist/store/entityRegistry/entityRegistry.d.ts +72 -72
- package/dist/store/entityRegistry/entityRegistry.d.ts.map +1 -1
- package/dist/store/entityRegistry/entityRegistry.js +91 -91
- package/dist/store/entityRegistry/entityRegistry.js.map +1 -1
- package/dist/store/entityRegistry/generateId.d.ts +3 -3
- package/dist/store/entityRegistry/generateId.js +3 -3
- package/dist/store/entityRegistry/types.d.ts +17 -17
- package/dist/store/entityRegistry/types.d.ts.map +1 -1
- package/dist/store/flow/buildFlowStepsProxy.d.ts +17 -0
- package/dist/store/flow/buildFlowStepsProxy.d.ts.map +1 -0
- package/dist/store/flow/buildFlowStepsProxy.js +72 -0
- package/dist/store/flow/buildFlowStepsProxy.js.map +1 -0
- package/dist/store/flow/defineFlow.d.ts +92 -0
- package/dist/store/flow/defineFlow.d.ts.map +1 -0
- package/dist/store/flow/defineFlow.js +99 -0
- package/dist/store/flow/defineFlow.js.map +1 -0
- package/dist/store/flow/flowApi.d.ts +18 -0
- package/dist/store/flow/flowApi.d.ts.map +1 -0
- package/dist/store/flow/flowApi.js +18 -0
- package/dist/store/flow/flowApi.js.map +1 -0
- package/dist/store/flow/flowNavigation.d.ts +137 -0
- package/dist/store/flow/flowNavigation.d.ts.map +1 -0
- package/dist/store/flow/flowNavigation.js +384 -0
- package/dist/store/flow/flowNavigation.js.map +1 -0
- package/dist/store/flow/flowState.d.ts +41 -0
- package/dist/store/flow/flowState.d.ts.map +1 -0
- package/dist/store/flow/flowState.js +51 -0
- package/dist/store/flow/flowState.js.map +1 -0
- package/dist/store/flow/index.d.ts +10 -0
- package/dist/store/flow/index.d.ts.map +1 -0
- package/dist/store/flow/index.js +6 -0
- package/dist/store/flow/index.js.map +1 -0
- package/dist/store/groupDeps/createGroupDeps.d.ts +3 -3
- package/dist/store/groupDeps/createGroupDeps.js +6 -6
- package/dist/store/groupDeps/createGroupDeps.js.map +1 -1
- package/dist/store/groupDeps/createTrackingValues.d.ts +9 -9
- package/dist/store/groupDeps/createTrackingValues.js +11 -11
- package/dist/store/groupDeps/createTrackingValues.js.map +1 -1
- package/dist/store/groupDeps/getNodeGroupPath.d.ts +3 -3
- package/dist/store/groupDeps/getNodeGroupPath.js +5 -5
- package/dist/store/groupDeps/getNodeGroupPath.js.map +1 -1
- package/dist/store/groupDeps/getRecipientGroups.d.ts +1 -1
- package/dist/store/groupDeps/getRecipientGroups.js +1 -1
- package/dist/store/groupDeps/groupDeps.d.ts +7 -7
- package/dist/store/groupDeps/groupDeps.js +7 -7
- package/dist/store/groupDeps/pairKey.d.ts +3 -3
- package/dist/store/groupDeps/pairKey.d.ts.map +1 -1
- package/dist/store/groupDeps/pairKey.js +4 -4
- package/dist/store/groupDeps/pairKey.js.map +1 -1
- package/dist/store/groupDeps/resolveGroupByPath.d.ts +3 -3
- package/dist/store/groupDeps/resolveGroupByPath.js +3 -3
- package/dist/store/init/createNotificationHub.d.ts +31 -31
- package/dist/store/init/createNotificationHub.d.ts.map +1 -1
- package/dist/store/init/createNotificationHub.js +36 -37
- package/dist/store/init/createNotificationHub.js.map +1 -1
- package/dist/store/init/createResolveManager.d.ts +72 -69
- package/dist/store/init/createResolveManager.d.ts.map +1 -1
- package/dist/store/init/createResolveManager.js +101 -98
- package/dist/store/init/createResolveManager.js.map +1 -1
- package/dist/store/init/initGroupSubmitting.d.ts +2 -2
- package/dist/store/init/initGroupSubmitting.js +4 -4
- package/dist/store/init/initGroupSubmitting.js.map +1 -1
- package/dist/store/normalizeConfig.d.ts +20 -18
- package/dist/store/normalizeConfig.d.ts.map +1 -1
- package/dist/store/normalizeConfig.js +31 -29
- package/dist/store/normalizeConfig.js.map +1 -1
- package/dist/store/onChangePipeline/computeFieldKey.d.ts +2 -2
- package/dist/store/onChangePipeline/computeFieldKey.js +2 -2
- package/dist/store/onChangePipeline/findOnChangeAncestors.d.ts +2 -2
- package/dist/store/onChangePipeline/findOnChangeAncestors.js +4 -4
- package/dist/store/onChangePipeline/findOnChangeAncestors.js.map +1 -1
- package/dist/store/onChangePipeline/onChangePipeline.d.ts +13 -12
- package/dist/store/onChangePipeline/onChangePipeline.d.ts.map +1 -1
- package/dist/store/onChangePipeline/onChangePipeline.js +14 -13
- package/dist/store/onChangePipeline/onChangePipeline.js.map +1 -1
- package/dist/store/persist/drivers.d.ts +7 -7
- package/dist/store/persist/drivers.js +8 -8
- package/dist/store/persist/drivers.js.map +1 -1
- package/dist/store/persist/index.d.ts +1 -1
- package/dist/store/persist/persistManager.d.ts +23 -23
- package/dist/store/persist/persistManager.d.ts.map +1 -1
- package/dist/store/persist/persistManager.js +73 -42
- package/dist/store/persist/persistManager.js.map +1 -1
- package/dist/store/persist/types.d.ts +23 -23
- package/dist/store/persist/types.d.ts.map +1 -1
- package/dist/store/persist/types.js +4 -4
- package/dist/store/resetPipeline/buildResetPatch.d.ts +5 -5
- package/dist/store/resetPipeline/buildResetPatch.js +5 -5
- package/dist/store/resetPipeline/collectDefaults.d.ts +5 -5
- package/dist/store/resetPipeline/collectDefaults.js +6 -6
- package/dist/store/resetPipeline/collectDefaults.js.map +1 -1
- package/dist/store/resetPipeline/resetPipeline.d.ts +7 -7
- package/dist/store/resetPipeline/resetPipeline.d.ts.map +1 -1
- package/dist/store/resetPipeline/resetPipeline.js +17 -12
- package/dist/store/resetPipeline/resetPipeline.js.map +1 -1
- package/dist/store/resolvePipeline/applyPendingWrites.d.ts +10 -10
- package/dist/store/resolvePipeline/applyPendingWrites.d.ts.map +1 -1
- package/dist/store/resolvePipeline/applyPendingWrites.js +35 -38
- package/dist/store/resolvePipeline/applyPendingWrites.js.map +1 -1
- package/dist/store/resolvePipeline/createContextTrackingProxy.d.ts +8 -7
- package/dist/store/resolvePipeline/createContextTrackingProxy.d.ts.map +1 -1
- package/dist/store/resolvePipeline/createContextTrackingProxy.js +6 -5
- package/dist/store/resolvePipeline/createContextTrackingProxy.js.map +1 -1
- package/dist/store/resolvePipeline/createValuesTrackingProxy.d.ts +43 -43
- package/dist/store/resolvePipeline/createValuesTrackingProxy.d.ts.map +1 -1
- package/dist/store/resolvePipeline/createValuesTrackingProxy.js +70 -70
- package/dist/store/resolvePipeline/createValuesTrackingProxy.js.map +1 -1
- package/dist/store/resolvePipeline/executeListResolve.d.ts +14 -14
- package/dist/store/resolvePipeline/executeListResolve.js +27 -27
- package/dist/store/resolvePipeline/executeListResolve.js.map +1 -1
- package/dist/store/resolvePipeline/executeResolve.d.ts +15 -15
- package/dist/store/resolvePipeline/executeResolve.js +46 -46
- package/dist/store/resolvePipeline/executeResolve.js.map +1 -1
- package/dist/store/store/NodeRegistry/nodeRegistry.d.ts +69 -56
- package/dist/store/store/NodeRegistry/nodeRegistry.d.ts.map +1 -1
- package/dist/store/store/NodeRegistry/nodeRegistry.js +94 -78
- package/dist/store/store/NodeRegistry/nodeRegistry.js.map +1 -1
- package/dist/store/store/NodeRegistry/nodeUtils.d.ts +5 -5
- package/dist/store/store/NodeRegistry/nodeUtils.d.ts.map +1 -1
- package/dist/store/store/NodeRegistry/nodeUtils.js +5 -5
- package/dist/store/store/NodeRegistry/nodeUtils.js.map +1 -1
- package/dist/store/store/groupDepsMap.d.ts +23 -23
- package/dist/store/store/groupDepsMap.d.ts.map +1 -1
- package/dist/store/store/groupDepsMap.js +40 -34
- package/dist/store/store/groupDepsMap.js.map +1 -1
- package/dist/store/store/hasComputedProps.d.ts +2 -2
- package/dist/store/store/hasComputedProps.js +2 -2
- package/dist/store/store/nodeMap.d.ts +5 -5
- package/dist/store/store/nodeMap.js +7 -7
- package/dist/store/store/nodeMap.js.map +1 -1
- package/dist/store/store/palistor.d.ts +80 -80
- package/dist/store/store/palistor.d.ts.map +1 -1
- package/dist/store/store/palistor.js +151 -165
- package/dist/store/store/palistor.js.map +1 -1
- package/dist/store/store/registerNodes.d.ts +10 -10
- package/dist/store/store/registerNodes.d.ts.map +1 -1
- package/dist/store/store/registerNodes.js +33 -18
- package/dist/store/store/registerNodes.js.map +1 -1
- package/dist/store/store/serviceRegistry.d.ts +8 -8
- package/dist/store/store/serviceRegistry.d.ts.map +1 -1
- package/dist/store/store/serviceRegistry.js +8 -8
- package/dist/store/store/serviceRegistry.js.map +1 -1
- package/dist/store/store/types.d.ts +277 -223
- package/dist/store/store/types.d.ts.map +1 -1
- package/dist/store/submitPipeline/applyLeafBeforeSubmit.d.ts +2 -2
- package/dist/store/submitPipeline/applyLeafBeforeSubmit.js +2 -2
- package/dist/store/submitPipeline/collectLeafStates.d.ts +2 -2
- package/dist/store/submitPipeline/collectLeafStates.js +2 -2
- package/dist/store/submitPipeline/submitPipeline.d.ts +8 -8
- package/dist/store/submitPipeline/submitPipeline.d.ts.map +1 -1
- package/dist/store/submitPipeline/submitPipeline.js +15 -11
- package/dist/store/submitPipeline/submitPipeline.js.map +1 -1
- package/dist/store/submitPipeline/types.d.ts +1 -1
- package/dist/store/submitPipeline/types.d.ts.map +1 -1
- package/dist/store/traversal/nodeClassifier.d.ts +9 -9
- package/dist/store/traversal/nodeClassifier.d.ts.map +1 -1
- package/dist/store/traversal/nodeClassifier.js +11 -11
- package/dist/store/traversal/nodeClassifier.js.map +1 -1
- package/dist/store/traversal/walkFull.d.ts +14 -14
- package/dist/store/traversal/walkFull.js +2 -2
- package/dist/store/valuesCache/valuesCache.d.ts +9 -9
- package/dist/store/valuesCache/valuesCache.d.ts.map +1 -1
- package/dist/store/valuesCache/valuesCache.js +6 -6
- package/dist/store/writePipeline/formatPatch.d.ts +5 -5
- package/dist/store/writePipeline/formatPatch.js +7 -7
- package/dist/store/writePipeline/formatPatch.js.map +1 -1
- package/dist/store/writePipeline/formatValue.d.ts +5 -5
- package/dist/store/writePipeline/formatValue.js +5 -5
- package/dist/store/writePipeline/mergeChanged.d.ts +4 -4
- package/dist/store/writePipeline/mergeChanged.js +4 -4
- package/dist/store/writePipeline/runSetter.d.ts +6 -6
- package/dist/store/writePipeline/runSetter.js +8 -8
- package/dist/store/writePipeline/storeValue.d.ts +3 -3
- package/dist/store/writePipeline/storeValue.js +3 -3
- package/dist/store/writePipeline/types.d.ts +4 -4
- package/dist/store/writePipeline/types.d.ts.map +1 -1
- package/dist/store/writePipeline/writePipeline.d.ts +7 -7
- package/dist/store/writePipeline/writePipeline.d.ts.map +1 -1
- package/dist/store/writePipeline/writePipeline.js +15 -15
- package/dist/store/writePipeline/writePipeline.js.map +1 -1
- package/package.json +11 -4
- package/dist/store/compute/recompute/collectGroupLeafNodes.d.ts +0 -11
- package/dist/store/compute/recompute/collectGroupLeafNodes.d.ts.map +0 -1
- package/dist/store/compute/recompute/collectGroupLeafNodes.js +0 -26
- package/dist/store/compute/recompute/collectGroupLeafNodes.js.map +0 -1
- package/dist/store/fieldMapping.typecheck.d.ts +0 -2
- package/dist/store/fieldMapping.typecheck.d.ts.map +0 -1
- package/dist/store/fieldMapping.typecheck.js +0 -71
- package/dist/store/fieldMapping.typecheck.js.map +0 -1
- package/dist/store/submitPipeline/getSubValues.d.ts +0 -9
- package/dist/store/submitPipeline/getSubValues.d.ts.map +0 -1
- package/dist/store/submitPipeline/getSubValues.js +0 -26
- package/dist/store/submitPipeline/getSubValues.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeUtils.js","sourceRoot":"","sources":["../../../../store/store/NodeRegistry/nodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACzE;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAa;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"nodeUtils.js","sourceRoot":"","sources":["../../../../store/store/NodeRegistry/nodeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACzE;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAa;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,yEAAyE;AACzE,MAAM,OAAO,SAAS;IAAtB;QACE,eAAU,GAAG,UAAU,CAAC;QACxB,gBAAW,GAAG,WAAW,CAAC;QAC1B,eAAU,GAAG,UAAU,CAAC;IAC1B,CAAC;CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { AnyConfigNode } from "./types";
|
|
2
2
|
import type { TrackingWrap } from "../compute/recompute";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Map of dependencies between groups.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* - `Set<string>`
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
6
|
+
* Combines:
|
|
7
|
+
* - a `Set<string>` of donor→recipient pairs (cross-group dependencies)
|
|
8
|
+
* - a tracking-proxy cache and the "dependencies built" flag
|
|
9
|
+
* - the `createTrackingValues` logic during the first full recomputeAll
|
|
10
10
|
*
|
|
11
|
-
* @internal
|
|
11
|
+
* @internal used by `Palistor` and the compute pipelines
|
|
12
12
|
*/
|
|
13
13
|
export declare class GroupDepsMap {
|
|
14
14
|
private readonly _deps;
|
|
@@ -18,34 +18,34 @@ export declare class GroupDepsMap {
|
|
|
18
18
|
private readonly _nodePaths;
|
|
19
19
|
constructor(rootConfig: AnyConfigNode, nodePaths: WeakMap<object, string>, nodeParents: WeakMap<object, object>);
|
|
20
20
|
/**
|
|
21
|
-
* Raw `Set<string>`
|
|
22
|
-
*
|
|
21
|
+
* Raw `Set<string>` of dependency pairs — for compatibility with
|
|
22
|
+
* `recomputeTargeted` and other functions taking `groupDeps` directly.
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
25
|
get deps(): Set<string>;
|
|
26
|
-
/**
|
|
26
|
+
/** Whether cross-group dependencies were already built in the first recomputeAll. */
|
|
27
27
|
get isBuilt(): boolean;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* Returns a `TrackingWrap` function that intercepts READ accesses to other
|
|
30
|
+
* groups' values and records the dependencies into `deps`.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Use ONLY during the first `recomputeAll` (`isBuilt === false`).
|
|
33
|
+
* Call `markBuilt()` when done.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
* -
|
|
37
|
-
* currentGroupPath = recipientPath (=
|
|
38
|
-
* -
|
|
39
|
-
*
|
|
40
|
-
* recipientPath
|
|
35
|
+
* Receives group-scoped values (parent from nodeSlot):
|
|
36
|
+
* - For leaf nodes: values = the parent group's scope,
|
|
37
|
+
* currentGroupPath = recipientPath (= the parent group's path).
|
|
38
|
+
* - For group nodes (with isVisible etc.): values = the group's parent
|
|
39
|
+
* scope (grandparent scope), currentGroupPath = the parent's path.
|
|
40
|
+
* recipientPath is then the group's own path.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* The cache uses the composite key `currentGroupPath\0recipientPath` to
|
|
43
|
+
* avoid collisions between leaf and group nodes with the same recipientPath.
|
|
44
44
|
*/
|
|
45
45
|
getTrackingWrap(): TrackingWrap;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* Mark the dependencies as built and release the proxy cache.
|
|
48
|
+
* Called exactly once — after the first full `recomputeAll`.
|
|
49
49
|
*/
|
|
50
50
|
markBuilt(): void;
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupDepsMap.d.ts","sourceRoot":"","sources":["../../../store/store/groupDepsMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8C;IAC1E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0B;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;gBAGnD,UAAU,EAAE,aAAa,EACzB,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;IAOtC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAEtB;IAED
|
|
1
|
+
{"version":3,"file":"groupDepsMap.d.ts","sourceRoot":"","sources":["../../../store/store/groupDepsMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8C;IAC1E,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0B;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0B;gBAGnD,UAAU,EAAE,aAAa,EACzB,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;IAOtC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAEtB;IAED,qFAAqF;IACrF,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,IAAI,YAAY;IAgC/B;;;OAGG;IACH,SAAS,IAAI,IAAI;CAIlB"}
|
|
@@ -3,14 +3,14 @@ import { createTrackingValues } from "../groupDeps/createTrackingValues";
|
|
|
3
3
|
import { getNodeGroupPath } from "../groupDeps/getNodeGroupPath";
|
|
4
4
|
import { isLeafNode } from "../traversal";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Map of dependencies between groups.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* - `Set<string>`
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
8
|
+
* Combines:
|
|
9
|
+
* - a `Set<string>` of donor→recipient pairs (cross-group dependencies)
|
|
10
|
+
* - a tracking-proxy cache and the "dependencies built" flag
|
|
11
|
+
* - the `createTrackingValues` logic during the first full recomputeAll
|
|
12
12
|
*
|
|
13
|
-
* @internal
|
|
13
|
+
* @internal used by `Palistor` and the compute pipelines
|
|
14
14
|
*/
|
|
15
15
|
export class GroupDepsMap {
|
|
16
16
|
constructor(rootConfig, nodePaths, nodeParents) {
|
|
@@ -21,60 +21,66 @@ export class GroupDepsMap {
|
|
|
21
21
|
this._nodeParents = nodeParents;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Raw `Set<string>`
|
|
25
|
-
*
|
|
24
|
+
* Raw `Set<string>` of dependency pairs — for compatibility with
|
|
25
|
+
* `recomputeTargeted` and other functions taking `groupDeps` directly.
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
get deps() {
|
|
29
29
|
return this._deps;
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
31
|
+
/** Whether cross-group dependencies were already built in the first recomputeAll. */
|
|
32
32
|
get isBuilt() {
|
|
33
33
|
return this._built;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Returns a `TrackingWrap` function that intercepts READ accesses to other
|
|
37
|
+
* groups' values and records the dependencies into `deps`.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* Use ONLY during the first `recomputeAll` (`isBuilt === false`).
|
|
40
|
+
* Call `markBuilt()` when done.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
* -
|
|
44
|
-
* currentGroupPath = recipientPath (=
|
|
45
|
-
* -
|
|
46
|
-
*
|
|
47
|
-
* recipientPath
|
|
42
|
+
* Receives group-scoped values (parent from nodeSlot):
|
|
43
|
+
* - For leaf nodes: values = the parent group's scope,
|
|
44
|
+
* currentGroupPath = recipientPath (= the parent group's path).
|
|
45
|
+
* - For group nodes (with isVisible etc.): values = the group's parent
|
|
46
|
+
* scope (grandparent scope), currentGroupPath = the parent's path.
|
|
47
|
+
* recipientPath is then the group's own path.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* The cache uses the composite key `currentGroupPath\0recipientPath` to
|
|
50
|
+
* avoid collisions between leaf and group nodes with the same recipientPath.
|
|
51
51
|
*/
|
|
52
52
|
getTrackingWrap() {
|
|
53
53
|
return (node, values) => {
|
|
54
|
-
const recipientPath = getNodeGroupPath(node, this._nodeParents, this._nodePaths);
|
|
55
|
-
// Leaf node: currentGroupPath = recipientPath (= parent group path).
|
|
56
|
-
// Group node (with computed props): currentGroupPath = parent group's path
|
|
57
|
-
// (which is the root of the group-scoped values we receive),
|
|
58
|
-
// recipientPath = group's own path.
|
|
59
54
|
const isLeaf = isLeafNode(node);
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
// The path of the group UNDER which this compute entry lives in
|
|
56
|
+
// groupComputeMap — that group is what recomputeTargeted recomputes, so
|
|
57
|
+
// it must be the recipient of the cross-group dependency:
|
|
58
|
+
// - a leaf is stored under its parent group → getNodeGroupPath(leaf) = its path;
|
|
59
|
+
// - a group node (isVisible etc.) is also stored under its PARENT group,
|
|
60
|
+
// so we take the parent's path, not the node's own path. Otherwise the
|
|
61
|
+
// dependency is recorded on the group's own path, and recomputing that
|
|
62
|
+
// group only touches its CHILDREN — not its own isVisible entry (which
|
|
63
|
+
// lives under the parent) — so a neighbor's cross-group isVisible would
|
|
64
|
+
// never be recomputed.
|
|
65
|
+
// `values` here is the scope of that same parent group, so
|
|
66
|
+
// currentGroupPath (nesting root) equals ownerGroupPath.
|
|
67
|
+
const ownerGroupPath = isLeaf
|
|
68
|
+
? getNodeGroupPath(node, this._nodeParents, this._nodePaths)
|
|
62
69
|
: (() => {
|
|
63
70
|
const parent = this._nodeParents.get(node);
|
|
64
71
|
return parent ? (this._nodePaths.get(parent) ?? "") : "";
|
|
65
72
|
})();
|
|
66
|
-
const
|
|
67
|
-
const cached = this._proxyCache.get(cacheKey);
|
|
73
|
+
const cached = this._proxyCache.get(ownerGroupPath);
|
|
68
74
|
if (cached)
|
|
69
75
|
return cached;
|
|
70
|
-
const proxy = createTrackingValues(values,
|
|
71
|
-
this._proxyCache.set(
|
|
76
|
+
const proxy = createTrackingValues(values, ownerGroupPath, this._deps, ownerGroupPath);
|
|
77
|
+
this._proxyCache.set(ownerGroupPath, proxy);
|
|
72
78
|
return proxy;
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
81
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
82
|
+
* Mark the dependencies as built and release the proxy cache.
|
|
83
|
+
* Called exactly once — after the first full `recomputeAll`.
|
|
78
84
|
*/
|
|
79
85
|
markBuilt() {
|
|
80
86
|
this._built = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupDepsMap.js","sourceRoot":"","sources":["../../../store/store/groupDepsMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAY;IAOvB,YACE,UAAyB,EACzB,SAAkC,EAClC,WAAoC;QARrB,gBAAW,GAAG,IAAI,GAAG,EAAmC,CAAC;QAClE,WAAM,GAAG,KAAK,CAAC;QASrB,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"groupDepsMap.js","sourceRoot":"","sources":["../../../store/store/groupDepsMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAY;IAOvB,YACE,UAAyB,EACzB,SAAkC,EAClC,WAAoC;QARrB,gBAAW,GAAG,IAAI,GAAG,EAAmC,CAAC;QAClE,WAAM,GAAG,KAAK,CAAC;QASrB,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,qFAAqF;IACrF,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe;QACb,OAAO,CAAC,IAAY,EAAE,MAA+B,EAA2B,EAAE;YAChF,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YAEhC,gEAAgE;YAChE,wEAAwE;YACxE,0DAA0D;YAC1D,iFAAiF;YACjF,yEAAyE;YACzE,yEAAyE;YACzE,yEAAyE;YACzE,yEAAyE;YACzE,0EAA0E;YAC1E,yBAAyB;YACzB,2DAA2D;YAC3D,yDAAyD;YACzD,MAAM,cAAc,GAAW,MAAM;gBACnC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;gBAC5D,CAAC,CAAC,CAAC,GAAG,EAAE;oBACJ,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAC3C,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3D,CAAC,CAAC,EAAE,CAAC;YAET,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACpD,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAC;YAE1B,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;YACvF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnyConfigNode } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Checks whether a node has computed props (isVisible, isRequired… functions).
|
|
4
|
+
* Needed for intermediate group nodes (passport.isVisible).
|
|
5
5
|
*/
|
|
6
6
|
export declare function hasComputedProps(node: AnyConfigNode): boolean;
|
|
7
7
|
//# sourceMappingURL=hasComputedProps.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FIELD_STATE_PROPS } from "../constants";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Checks whether a node has computed props (isVisible, isRequired… functions).
|
|
4
|
+
* Needed for intermediate group nodes (passport.isVisible).
|
|
5
5
|
*/
|
|
6
6
|
export function hasComputedProps(node) {
|
|
7
7
|
for (const key of FIELD_STATE_PROPS) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AnyConfigNode } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Recursively builds the path and parent mappings for all config tree nodes.
|
|
4
4
|
*
|
|
5
|
-
* - `nodePaths` — WeakMap<node, "user.email"> —
|
|
6
|
-
* - `nodeParents` — WeakMap<node, parentNode> —
|
|
5
|
+
* - `nodePaths` — WeakMap<node, "user.email"> — absolute path of every node.
|
|
6
|
+
* - `nodeParents` — WeakMap<node, parentNode> — direct parent.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* submit/reset (
|
|
8
|
+
* Used by the onChange pipeline (finding ancestors with `onChange`),
|
|
9
|
+
* submit/reset (deriving fieldKey) and other handlers.
|
|
10
10
|
*/
|
|
11
11
|
export declare function buildNodeMaps(node: AnyConfigNode, nodePaths: WeakMap<object, string>, nodeParents: WeakMap<object, object>, parentPath?: string): void;
|
|
12
12
|
//# sourceMappingURL=nodeMap.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CONFIG_PROPS } from "../constants";
|
|
2
2
|
import { isGroupNode } from "../traversal";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Recursively builds the path and parent mappings for all config tree nodes.
|
|
5
5
|
*
|
|
6
|
-
* - `nodePaths` — WeakMap<node, "user.email"> —
|
|
7
|
-
* - `nodeParents` — WeakMap<node, parentNode> —
|
|
6
|
+
* - `nodePaths` — WeakMap<node, "user.email"> — absolute path of every node.
|
|
7
|
+
* - `nodeParents` — WeakMap<node, parentNode> — direct parent.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* submit/reset (
|
|
9
|
+
* Used by the onChange pipeline (finding ancestors with `onChange`),
|
|
10
|
+
* submit/reset (deriving fieldKey) and other handlers.
|
|
11
11
|
*/
|
|
12
12
|
export function buildNodeMaps(node, nodePaths, nodeParents, parentPath = "") {
|
|
13
13
|
for (const key of Object.keys(node)) {
|
|
@@ -17,11 +17,11 @@ export function buildNodeMaps(node, nodePaths, nodeParents, parentPath = "") {
|
|
|
17
17
|
if (!child || typeof child !== "object")
|
|
18
18
|
continue;
|
|
19
19
|
if (Array.isArray(child))
|
|
20
|
-
continue; // ListNode —
|
|
20
|
+
continue; // ListNode — handled in phase 2
|
|
21
21
|
const path = parentPath ? `${parentPath}.${key}` : key;
|
|
22
22
|
nodePaths.set(child, path);
|
|
23
23
|
nodeParents.set(child, node);
|
|
24
|
-
//
|
|
24
|
+
// Recurse into group nodes (leaves have no children)
|
|
25
25
|
if (isGroupNode(child)) {
|
|
26
26
|
buildNodeMaps(child, nodePaths, nodeParents, path);
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeMap.js","sourceRoot":"","sources":["../../../store/store/nodeMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAmB,EACnB,SAAkC,EAClC,WAAoC,EACpC,UAAU,GAAG,EAAE;IAEf,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAEpC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAkB,CAAC;QACzC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,SAAS;QAClD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"nodeMap.js","sourceRoot":"","sources":["../../../store/store/nodeMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAmB,EACnB,SAAkC,EAClC,WAAoC,EACpC,UAAU,GAAG,EAAE;IAEf,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAEpC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAkB,CAAC;QACzC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,SAAS;QAClD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,gCAAgC;QAEpE,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACvD,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE7B,qDAAqD;QACrD,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -17,8 +17,8 @@ import { EntityRegistry } from "../entityRegistry";
|
|
|
17
17
|
import type { EntityData } from "../entityRegistry";
|
|
18
18
|
import type { AnyConfigNode, DeepPartialValues, ExtractValues, FieldMapping, ListState, ProxyStore, ProxyStoreOptions, RawStoreProxy, TranslateFn, Unsubscribe } from "./types";
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* The public form class. Acts as the DI container for all internal
|
|
21
|
+
* subsystems and implements the public `ProxyStore` interface.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* const store = new Palistor({ config: myConfig, initialValues: {...} });
|
|
@@ -26,17 +26,17 @@ import type { AnyConfigNode, DeepPartialValues, ExtractValues, FieldMapping, Lis
|
|
|
26
26
|
* store.submit();
|
|
27
27
|
*/
|
|
28
28
|
export declare class Palistor<TConfig extends Record<string, any>, const TMapping extends FieldMapping = {}> implements ProxyStore<TConfig, TMapping> {
|
|
29
|
-
/** @internal
|
|
29
|
+
/** @internal Node registry: nodeState, nodePaths, nodeParents, computeNodes, groupComputeMap, proxyCache. */
|
|
30
30
|
readonly nodes: NodeRegistry;
|
|
31
|
-
/** @internal
|
|
31
|
+
/** @internal Global services: translator, notifier and their delegates. */
|
|
32
32
|
readonly services: ServiceRegistry;
|
|
33
|
-
/** @internal
|
|
33
|
+
/** @internal Dirty-flag tracking. */
|
|
34
34
|
readonly dirty: DirtyTracker;
|
|
35
|
-
/** @internal
|
|
35
|
+
/** @internal Mutable values cache. */
|
|
36
36
|
readonly values: ValuesCache;
|
|
37
|
-
/** @internal
|
|
37
|
+
/** @internal Cross-group dependency map. */
|
|
38
38
|
readonly groupDepsMap: GroupDepsMap;
|
|
39
|
-
/** @internal
|
|
39
|
+
/** @internal Registry of entity objects. */
|
|
40
40
|
readonly entityRegistry: EntityRegistry;
|
|
41
41
|
/**
|
|
42
42
|
* @internal Plain POJO mirrors for each entity — used in valuesCache.values
|
|
@@ -44,9 +44,9 @@ export declare class Palistor<TConfig extends Record<string, any>, const TMappin
|
|
|
44
44
|
* Key: entityId, Value: plain object `{ id, field1, field2, ... }`.
|
|
45
45
|
*/
|
|
46
46
|
readonly entityProjectionObjs: Map<string, Record<string, unknown>>;
|
|
47
|
-
/** @internal
|
|
47
|
+
/** @internal Notification system: versions, subscriptions, post-notify hook. */
|
|
48
48
|
readonly hub: NotificationHub;
|
|
49
|
-
/** @internal
|
|
49
|
+
/** @internal Resolve subsystem manager. */
|
|
50
50
|
readonly resolveManager: ResolveManager;
|
|
51
51
|
/** @internal Write pipeline. */
|
|
52
52
|
readonly writePipeline: WritePipeline;
|
|
@@ -58,45 +58,45 @@ export declare class Palistor<TConfig extends Record<string, any>, const TMappin
|
|
|
58
58
|
readonly onChangePipeline: OnChangePipeline;
|
|
59
59
|
/** @internal ProxyBuilder. */
|
|
60
60
|
readonly proxyBuilder: ProxyBuilder;
|
|
61
|
-
/** @internal
|
|
61
|
+
/** @internal Root config, immutable. */
|
|
62
62
|
readonly rootConfig: AnyConfigNode;
|
|
63
63
|
/**
|
|
64
|
-
* @internal
|
|
65
|
-
*
|
|
64
|
+
* @internal internal → external rename map (sparse).
|
|
65
|
+
* Projects keys on proxy output (ownKeys/spread).
|
|
66
66
|
*/
|
|
67
67
|
readonly fieldMapping: FieldMapping;
|
|
68
68
|
/**
|
|
69
|
-
* @internal
|
|
70
|
-
*
|
|
69
|
+
* @internal Reverse map, external → internal (sparse).
|
|
70
|
+
* Translates incoming keys on proxy input (GET/SET/tracking).
|
|
71
71
|
*/
|
|
72
72
|
readonly externalToInternal: Record<string, string>;
|
|
73
73
|
private readonly _proxy;
|
|
74
74
|
private readonly _persist;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
76
|
+
* Non-reactive context — arbitrary data available via `store.context`.
|
|
77
|
+
* Set via `setContext()` or the `useStoreContext()` hook.
|
|
78
78
|
*/
|
|
79
79
|
private _context;
|
|
80
80
|
constructor(options: ProxyStoreOptions<TConfig, TMapping>);
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Recompute node state.
|
|
83
83
|
*
|
|
84
|
-
* - `changedNodes`
|
|
85
|
-
* -
|
|
84
|
+
* - `changedNodes` provided and non-empty → targeted recompute (fast)
|
|
85
|
+
* - otherwise → full recompute of the whole tree (init, reset, resolve completion)
|
|
86
86
|
*
|
|
87
|
-
*
|
|
87
|
+
* The first call without changedNodes builds the group dependency map.
|
|
88
88
|
*
|
|
89
89
|
* @internal
|
|
90
90
|
*/
|
|
91
91
|
recompute(changedNodes?: Set<object>): Set<object>;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* Notify subscribers about changed nodes.
|
|
94
|
+
* Recomputes dirty flags and bumps versions.
|
|
95
95
|
*
|
|
96
96
|
* @internal
|
|
97
97
|
*/
|
|
98
98
|
notifyChanged(changed: Set<object>): void;
|
|
99
|
-
/** @internal
|
|
99
|
+
/** @internal Apply a bulk patch to a node (single recompute + notify). */
|
|
100
100
|
setValuesNode(node: AnyConfigNode, patch: Record<string, unknown>): void;
|
|
101
101
|
get proxy(): RawStoreProxy<TConfig, TMapping>;
|
|
102
102
|
get context(): Record<string, unknown>;
|
|
@@ -113,49 +113,49 @@ export declare class Palistor<TConfig extends Record<string, any>, const TMappin
|
|
|
113
113
|
reset(values?: DeepPartialValues<ExtractValues<TConfig>>): void;
|
|
114
114
|
setValues(patch: DeepPartialValues<ExtractValues<TConfig>>): void;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
116
|
+
* Create or update an entity (or an array of entities) in the registry.
|
|
117
117
|
*
|
|
118
|
-
* -
|
|
119
|
-
* -
|
|
120
|
-
* - Batch
|
|
118
|
+
* - If no entity with the id exists — it is created and its leaf nodes registered.
|
|
119
|
+
* - If it exists — recursive merge; updated leaf nodes are marked as changed.
|
|
120
|
+
* - Batch mode: an array of entities is processed in one recompute + notifyChanged.
|
|
121
121
|
*/
|
|
122
122
|
set(data: EntityData | EntityData[]): void;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
124
|
+
* Rename an entity: move it from oldId to newId.
|
|
125
125
|
*
|
|
126
|
-
* -
|
|
127
|
-
* -
|
|
128
|
-
* -
|
|
129
|
-
* -
|
|
126
|
+
* - Updates EntityRegistry (entities Map, bindings, resolvedCache, id leaf value).
|
|
127
|
+
* - Updates itemIds in all ListState objects.
|
|
128
|
+
* - Updates entityProjectionObjs (moves the POJO mirror).
|
|
129
|
+
* - Notifies subscribers about the id leaf change.
|
|
130
130
|
*
|
|
131
|
-
* No-op
|
|
131
|
+
* No-op when no entity with oldId exists.
|
|
132
132
|
*/
|
|
133
133
|
rekey(oldId: string, newId: string): void;
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Delete an entity from the registry by ID.
|
|
136
136
|
*
|
|
137
|
-
* -
|
|
138
|
-
* -
|
|
139
|
-
* -
|
|
137
|
+
* - Removes the entity's leaf nodes from NodeRegistry (computeNodes, groupComputeMap).
|
|
138
|
+
* - Clears bindings and resolvedCache.
|
|
139
|
+
* - Notifies subscribers.
|
|
140
140
|
*
|
|
141
|
-
* No-op
|
|
141
|
+
* No-op when the entity does not exist.
|
|
142
142
|
*/
|
|
143
143
|
delete(id: string): void;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Clear the resolved cache for an entity (all templates or a specific one).
|
|
146
146
|
*
|
|
147
|
-
* - `invalidate(id)` —
|
|
148
|
-
* - `invalidate(id, templateNode)` —
|
|
147
|
+
* - `invalidate(id)` — clear the whole cache for the entity
|
|
148
|
+
* - `invalidate(id, templateNode)` — clear only for that specific pair
|
|
149
149
|
*
|
|
150
|
-
*
|
|
150
|
+
* On the next mount of useForm(entity, template) the resolve re-runs.
|
|
151
151
|
*/
|
|
152
152
|
invalidate(id: string, templateNode?: object): void;
|
|
153
153
|
/**
|
|
154
|
-
* Submit entity
|
|
155
|
-
*
|
|
154
|
+
* Submit an entity through a template.
|
|
155
|
+
* Called from EntityProjectionProxy.submit().
|
|
156
156
|
*
|
|
157
157
|
* 1. submitting: true → notify
|
|
158
|
-
* 2.
|
|
158
|
+
* 2. Validation via template field rules (validate)
|
|
159
159
|
* 3. templateNode.onSubmit(entityProxy, store)
|
|
160
160
|
* 4. templateNode.afterSubmit(result, { reset })
|
|
161
161
|
* 5. submitting: false → notify
|
|
@@ -170,71 +170,71 @@ export declare class Palistor<TConfig extends Record<string, any>, const TMappin
|
|
|
170
170
|
* Used internally by `set()` and by `executeListResolve` via the
|
|
171
171
|
* `setEntitiesRaw` callback in ResolveManagerDeps.
|
|
172
172
|
*
|
|
173
|
-
*
|
|
173
|
+
* When `listNode` is provided, triggers entity field resolves for
|
|
174
174
|
* each template field entry belonging to that list.
|
|
175
175
|
*
|
|
176
176
|
* @internal
|
|
177
177
|
*/
|
|
178
178
|
_setEntitiesRaw(items: EntityData[], listNode?: object): Set<object>;
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
180
|
+
* Sync valuesCache with list membership — a SINGLE method (root + per-entity).
|
|
181
181
|
*
|
|
182
|
-
*
|
|
183
|
-
* - `null` → root:
|
|
184
|
-
* (`valuesCache.values.users = [{id:"u1",…}, …]` —
|
|
185
|
-
* `proxy.users.value
|
|
186
|
-
* - entity → per-entity
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
182
|
+
* Branches on `listState.ownerEntity`:
|
|
183
|
+
* - `null` → root: write the array of POJO mirrors into the config node's
|
|
184
|
+
* `nodeSlot` (`valuesCache.values.users = [{id:"u1",…}, …]` — the same
|
|
185
|
+
* array that `proxy.users.value` reads, so React sees the update);
|
|
186
|
+
* - entity → per-entity: materialize the membership into the owner's
|
|
187
|
+
* projectionObj at the list path (`["contacts"]` or `["profile","contacts"]`).
|
|
188
|
+
* This includes the nested list in `store.getValues()` — the owner's
|
|
189
|
+
* projectionObj is referenced by the root list array, and child
|
|
190
|
+
* projectionObjs materialize their lists recursively.
|
|
191
191
|
*
|
|
192
|
-
* No-op
|
|
192
|
+
* No-op when the slot/path/owner projectionObj is missing.
|
|
193
193
|
*
|
|
194
194
|
* @internal
|
|
195
195
|
*/
|
|
196
196
|
syncListValuesCache(listState: ListState): void;
|
|
197
|
-
/** @internal
|
|
197
|
+
/** @internal Current entity id (accounts for rekey via nodeState). */
|
|
198
198
|
private _entityId;
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
201
|
-
* (
|
|
200
|
+
* Restore the membership of root AND per-entity lists from a values
|
|
201
|
+
* snapshot (persist hydrate).
|
|
202
202
|
*
|
|
203
|
-
* `applyPatch`
|
|
204
|
-
*
|
|
205
|
-
* owner
|
|
206
|
-
*
|
|
203
|
+
* `applyPatch` skips list nodes, so list membership is restored in a
|
|
204
|
+
* separate pass: for every list field we create child entities, set the
|
|
205
|
+
* owner reference (for nested ones), fill `itemIds`/`initialItemIds` and
|
|
206
|
+
* sync valuesCache. Handles nested-of-nested recursively.
|
|
207
207
|
*
|
|
208
|
-
*
|
|
208
|
+
* Returns the set of changed nodes for a subsequent notify.
|
|
209
209
|
*
|
|
210
210
|
* @internal
|
|
211
211
|
*/
|
|
212
212
|
restoreLists(values: Record<string, unknown>): Set<object>;
|
|
213
213
|
private _restoreListsRec;
|
|
214
214
|
/**
|
|
215
|
-
*
|
|
216
|
-
* (
|
|
217
|
-
* `createEntityNode`
|
|
215
|
+
* Return a shallow copy of an entity data object without list fields
|
|
216
|
+
* (their membership is restored separately via EntityListState). Otherwise
|
|
217
|
+
* `createEntityNode` would ingest the array as a regular leaf value.
|
|
218
218
|
*/
|
|
219
219
|
private _stripListFields;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
222
|
-
* `registerDynamicLeaf`
|
|
221
|
+
* Recursive walk over an entity node: registers new leaf nodes via
|
|
222
|
+
* `registerDynamicLeaf` and accumulates changed ones in `changed`.
|
|
223
223
|
*
|
|
224
|
-
*
|
|
225
|
-
* -
|
|
226
|
-
* -
|
|
224
|
+
* Also maintains the entity projection POJO (projectionObj):
|
|
225
|
+
* - New leaf nodes: register nodeSlot → projectionObj
|
|
226
|
+
* - Existing leaf nodes: updated via updateValuesCacheEntry
|
|
227
227
|
*
|
|
228
|
-
* @param node
|
|
229
|
-
* @param prefix Dot
|
|
230
|
-
* @param parent
|
|
231
|
-
* @param changed
|
|
228
|
+
* @param node Current entity node being walked
|
|
229
|
+
* @param prefix Dot-path of the current node (e.g. "_entity_.u1")
|
|
230
|
+
* @param parent Parent object (for leaf registration)
|
|
231
|
+
* @param changed Accumulated set of changed nodes
|
|
232
232
|
* @param projectionObj Plain POJO at the current nesting level for valuesCache
|
|
233
233
|
*/
|
|
234
234
|
private walkAndSyncEntityNode;
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
236
|
+
* Recursively collect all leaf nodes from an entity node tree.
|
|
237
|
+
* Used by `delete()` to clean up NodeRegistry.
|
|
238
238
|
*/
|
|
239
239
|
private collectEntityLeaves;
|
|
240
240
|
/**
|