palistor 0.0.25 → 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 +16 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -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 +54 -53
- 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.js +39 -39
- package/dist/store/buildProxy/buildProxy.js.map +1 -1
- package/dist/store/buildProxy/computeProxyKeys.d.ts +8 -8
- package/dist/store/buildProxy/computeProxyKeys.js +9 -9
- 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 +48 -48
- package/dist/store/constants.d.ts.map +1 -1
- package/dist/store/constants.js +45 -45
- 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 +9 -9
- package/dist/store/flow/buildFlowStepsProxy.js +13 -13
- package/dist/store/flow/buildFlowStepsProxy.js.map +1 -1
- package/dist/store/flow/defineFlow.d.ts +27 -25
- package/dist/store/flow/defineFlow.d.ts.map +1 -1
- package/dist/store/flow/defineFlow.js +15 -13
- package/dist/store/flow/defineFlow.js.map +1 -1
- package/dist/store/flow/flowApi.d.ts +3 -2
- package/dist/store/flow/flowApi.d.ts.map +1 -1
- package/dist/store/flow/flowApi.js +1 -1
- package/dist/store/flow/flowApi.js.map +1 -1
- package/dist/store/flow/flowNavigation.d.ts +65 -63
- package/dist/store/flow/flowNavigation.d.ts.map +1 -1
- package/dist/store/flow/flowNavigation.js +74 -72
- package/dist/store/flow/flowNavigation.js.map +1 -1
- package/dist/store/flow/flowState.d.ts +16 -16
- package/dist/store/flow/flowState.d.ts.map +1 -1
- package/dist/store/flow/flowState.js +5 -5
- package/dist/store/flow/flowState.js.map +1 -1
- 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 +51 -51
- 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.js +15 -15
- 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 +61 -61
- package/dist/store/store/NodeRegistry/nodeRegistry.d.ts.map +1 -1
- package/dist/store/store/NodeRegistry/nodeRegistry.js +85 -86
- 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 +35 -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 +149 -169
- package/dist/store/store/palistor.js.map +1 -1
- package/dist/store/store/registerNodes.d.ts +10 -10
- package/dist/store/store/registerNodes.js +15 -15
- 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 +236 -234
- 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.js +12 -12
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Merge all change sources into a single Set.
|
|
3
3
|
*
|
|
4
|
-
* — currentNode:
|
|
5
|
-
* — patchedNodes:
|
|
6
|
-
* — recomputedNodes:
|
|
4
|
+
* — currentNode: always considered changed (the user explicitly wrote to it)
|
|
5
|
+
* — patchedNodes: nodes updated by a setter patch
|
|
6
|
+
* — recomputedNodes: nodes recomputed by recomputeAll
|
|
7
7
|
*/
|
|
8
8
|
export declare function mergeChanged(currentNode: object, patchedNodes: Set<object>, recomputedNodes: Set<object>): Set<object>;
|
|
9
9
|
//# sourceMappingURL=mergeChanged.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Merge all change sources into a single Set.
|
|
3
3
|
*
|
|
4
|
-
* — currentNode:
|
|
5
|
-
* — patchedNodes:
|
|
6
|
-
* — recomputedNodes:
|
|
4
|
+
* — currentNode: always considered changed (the user explicitly wrote to it)
|
|
5
|
+
* — patchedNodes: nodes updated by a setter patch
|
|
6
|
+
* — recomputedNodes: nodes recomputed by recomputeAll
|
|
7
7
|
*/
|
|
8
8
|
export function mergeChanged(currentNode, patchedNodes, recomputedNodes) {
|
|
9
9
|
const changed = new Set(recomputedNodes);
|
|
@@ -2,15 +2,15 @@ import type { AnyConfigNode } from "../store/types";
|
|
|
2
2
|
import type { FieldState } from "../compute/index";
|
|
3
3
|
import type { ValuesCache } from "../valuesCache/valuesCache";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Phase 3 (alternate branch): apply the setter.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* A setter is an extra write path: it returns a patch that updates
|
|
8
|
+
* dependent (sibling) fields after the current value has been stored.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The patch and values are scoped to the node's parent group (not the root)
|
|
11
|
+
* so the setter can read and patch siblings directly.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* When the setter returns a non-object — logs an error without breaking the runtime.
|
|
14
14
|
*/
|
|
15
15
|
export declare function runSetter(node: AnyConfigNode, processedValue: unknown, parentNode: AnyConfigNode, nodeState: WeakMap<object, FieldState>, valuesCache: ValuesCache, parentPath: string | undefined, previousValue?: unknown): Set<object>;
|
|
16
16
|
//# sourceMappingURL=runSetter.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { applyPatch } from "../applyPatch/applyPatch";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Extract the parent group's values from the cache.
|
|
4
|
+
* Empty parentPath → return the root values.
|
|
5
5
|
*/
|
|
6
6
|
function getParentValues(valuesCache, parentPath) {
|
|
7
7
|
if (!parentPath)
|
|
@@ -13,15 +13,15 @@ function getParentValues(valuesCache, parentPath) {
|
|
|
13
13
|
return current ?? {};
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Phase 3 (alternate branch): apply the setter.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* A setter is an extra write path: it returns a patch that updates
|
|
19
|
+
* dependent (sibling) fields after the current value has been stored.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* The patch and values are scoped to the node's parent group (not the root)
|
|
22
|
+
* so the setter can read and patch siblings directly.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* When the setter returns a non-object — logs an error without breaking the runtime.
|
|
25
25
|
*/
|
|
26
26
|
export function runSetter(node, processedValue, parentNode, nodeState, valuesCache, parentPath, previousValue) {
|
|
27
27
|
const parentValues = getParentValues(valuesCache, parentPath);
|
|
@@ -2,10 +2,10 @@ import type { AnyConfigNode } from "../store/types";
|
|
|
2
2
|
import type { FieldState } from "../compute/index";
|
|
3
3
|
import { type ValuesCache } from "../valuesCache/valuesCache";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Phase 2: store the value in nodeState.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Updates FieldState immutably: creates a new object with the new value.
|
|
8
|
+
* Returns true when stored, false when the node is not registered.
|
|
9
9
|
*/
|
|
10
10
|
export declare function storeValue(node: AnyConfigNode, processedValue: unknown, nodeState: WeakMap<object, FieldState>, valuesCache?: ValuesCache): boolean;
|
|
11
11
|
//# sourceMappingURL=storeValue.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { updateValuesCacheEntry } from "../valuesCache/valuesCache";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Phase 2: store the value in nodeState.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Updates FieldState immutably: creates a new object with the new value.
|
|
6
|
+
* Returns true when stored, false when the node is not registered.
|
|
7
7
|
*/
|
|
8
8
|
export function storeValue(node, processedValue, nodeState, valuesCache) {
|
|
9
9
|
const state = nodeState.get(node);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Result of a write pipeline run. */
|
|
2
2
|
export interface WriteResult {
|
|
3
|
-
/**
|
|
3
|
+
/** All nodes whose state changed (for subscriber notification). */
|
|
4
4
|
changed: Set<object>;
|
|
5
|
-
/** True
|
|
5
|
+
/** True when the write was skipped — the formatted value equals the current one. */
|
|
6
6
|
skipped?: boolean;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/** Signature of a node's setter function. */
|
|
9
9
|
export type Setter = (v: unknown, vals: Record<string, unknown>, prev: unknown) => Record<string, unknown>;
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../store/writePipeline/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../store/writePipeline/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,6CAA6C;AAC7C,MAAM,MAAM,MAAM,GAAG,CACnB,CAAC,EAAE,OAAO,EACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE,OAAO,KACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -9,23 +9,23 @@ export { storeValue } from "./storeValue";
|
|
|
9
9
|
export { runSetter } from "./runSetter";
|
|
10
10
|
export { mergeChanged } from "./mergeChanged";
|
|
11
11
|
export interface WriteOptions {
|
|
12
|
-
/** templateField —
|
|
12
|
+
/** templateField — used for entity leaves: rules come from the template, storage from the entityLeaf. */
|
|
13
13
|
via?: AnyConfigNode;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* WritePipeline —
|
|
16
|
+
* WritePipeline — the full write pipeline: format → store → (setter?) → recompute → merge changed.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Always writes the value to the current node via storeValue.
|
|
19
|
+
* If the node has a setter — additionally patches dependent fields.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* With opts.via — entity mode: rules (formatter, setter) come from the
|
|
22
|
+
* templateField; storage and recompute operate on the entityLeaf (view.storage).
|
|
23
23
|
*/
|
|
24
24
|
export declare class WritePipeline {
|
|
25
25
|
private readonly kernel;
|
|
26
26
|
constructor(kernel: Palistor<any, any>);
|
|
27
27
|
execute(node: AnyConfigNode, rawValue: unknown, previousValue?: unknown, opts?: WriteOptions): WriteResult | null;
|
|
28
|
-
/**
|
|
28
|
+
/** Apply a setter patch to the entity leaf's siblings (storage tree, not the template). */
|
|
29
29
|
private _applyEntitySetterPatch;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=writePipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writePipeline.d.ts","sourceRoot":"","sources":["../../../store/writePipeline/writePipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,
|
|
1
|
+
{"version":3,"file":"writePipeline.d.ts","sourceRoot":"","sources":["../../../store/writePipeline/writePipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQlD,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,yGAAyG;IACzG,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAEvD,OAAO,CACL,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,OAAO,EACjB,aAAa,CAAC,EAAE,OAAO,EACvB,IAAI,CAAC,EAAE,YAAY,GAClB,WAAW,GAAG,IAAI;IA+DrB,2FAA2F;IAC3F,OAAO,CAAC,uBAAuB;CAkChC"}
|
|
@@ -9,13 +9,13 @@ export { storeValue } from "./storeValue";
|
|
|
9
9
|
export { runSetter } from "./runSetter";
|
|
10
10
|
export { mergeChanged } from "./mergeChanged";
|
|
11
11
|
/**
|
|
12
|
-
* WritePipeline —
|
|
12
|
+
* WritePipeline — the full write pipeline: format → store → (setter?) → recompute → merge changed.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Always writes the value to the current node via storeValue.
|
|
15
|
+
* If the node has a setter — additionally patches dependent fields.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* With opts.via — entity mode: rules (formatter, setter) come from the
|
|
18
|
+
* templateField; storage and recompute operate on the entityLeaf (view.storage).
|
|
19
19
|
*/
|
|
20
20
|
export class WritePipeline {
|
|
21
21
|
constructor(kernel) {
|
|
@@ -26,28 +26,28 @@ export class WritePipeline {
|
|
|
26
26
|
const isEntityMode = opts?.via !== undefined;
|
|
27
27
|
const nodeState = this.kernel.nodes.nodeState;
|
|
28
28
|
const valuesCache = this.kernel.values;
|
|
29
|
-
//
|
|
29
|
+
// Phase 1: format (entity: parentValues from the view; config: from valuesCache)
|
|
30
30
|
const allValues = isEntityMode ? view.parent.getValues() : valuesCache.values;
|
|
31
31
|
const processedValue = formatValue(rawValue, view.rules, allValues);
|
|
32
|
-
//
|
|
32
|
+
// Phase 1.5: fast exit — value unchanged
|
|
33
33
|
const currentState = nodeState.get(view.storage);
|
|
34
34
|
if (currentState && Object.is(processedValue, currentState.value)) {
|
|
35
35
|
return { changed: new Set(), skipped: true };
|
|
36
36
|
}
|
|
37
|
-
//
|
|
37
|
+
// Phase 2: direct value write
|
|
38
38
|
const stored = storeValue(view.storage, processedValue, nodeState, valuesCache);
|
|
39
39
|
if (!stored)
|
|
40
40
|
return null;
|
|
41
|
-
// Entity sync:
|
|
42
|
-
// (
|
|
41
|
+
// Entity sync: keep the entityLeaf's raw value current
|
|
42
|
+
// (needed by walkAndSyncEntityNode on the next upsert)
|
|
43
43
|
if (isEntityMode) {
|
|
44
44
|
view.storage.value = processedValue;
|
|
45
45
|
}
|
|
46
|
-
//
|
|
46
|
+
// Phase 2.5: setter branch — patch dependent fields
|
|
47
47
|
let patchedNodes;
|
|
48
48
|
if (typeof view.rules.setter === "function") {
|
|
49
49
|
if (isEntityMode) {
|
|
50
|
-
// Entity mode:
|
|
50
|
+
// Entity mode: siblings live in the entity tree (not the config)
|
|
51
51
|
const entityParent = this.kernel.nodes.nodeParents.get(view.storage);
|
|
52
52
|
patchedNodes = entityParent
|
|
53
53
|
? this._applyEntitySetterPatch(view.rules.setter, processedValue, allValues, previousValue, entityParent, nodeState, valuesCache)
|
|
@@ -62,15 +62,15 @@ export class WritePipeline {
|
|
|
62
62
|
else {
|
|
63
63
|
patchedNodes = new Set();
|
|
64
64
|
}
|
|
65
|
-
//
|
|
65
|
+
// Phase 3: targeted recompute of the affected groups
|
|
66
66
|
const changedSoFar = new Set([view.storage]);
|
|
67
67
|
for (const n of patchedNodes)
|
|
68
68
|
changedSoFar.add(n);
|
|
69
69
|
const recomputedNodes = this.kernel.recompute(changedSoFar);
|
|
70
|
-
//
|
|
70
|
+
// Phase 4: merge all changed nodes
|
|
71
71
|
return { changed: mergeChanged(view.storage, patchedNodes, recomputedNodes) };
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
73
|
+
/** Apply a setter patch to the entity leaf's siblings (storage tree, not the template). */
|
|
74
74
|
_applyEntitySetterPatch(setter, processedValue, parentValues, previousValue, entityParent, nodeState, valuesCache) {
|
|
75
75
|
const patch = setter(processedValue, parentValues, previousValue);
|
|
76
76
|
if (!patch || typeof patch !== "object") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writePipeline.js","sourceRoot":"","sources":["../../../store/writePipeline/writePipeline.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAA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|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.26",
|
|
4
|
+
"description": "Reactive form state manager for React with granular re-renders",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -53,9 +53,16 @@
|
|
|
53
53
|
"publish:github": "npm pkg set name=@projectint/palistor && npm publish --registry=https://npm.pkg.github.com; npm pkg set name=palistor"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
|
+
"react",
|
|
57
|
+
"form",
|
|
58
|
+
"forms",
|
|
56
59
|
"state",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
60
|
+
"state-management",
|
|
61
|
+
"form-state",
|
|
62
|
+
"validation",
|
|
63
|
+
"proxy",
|
|
64
|
+
"reactive",
|
|
65
|
+
"wizard"
|
|
59
66
|
],
|
|
60
67
|
"author": "Yuri Palienko",
|
|
61
68
|
"license": "MIT",
|