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,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Phase 1: format the incoming value.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* If the node has a formatter — calls it with the raw value and the current
|
|
5
|
+
* snapshot of all form values.
|
|
6
|
+
* Without a formatter — returns the value as-is.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Pure function: does not mutate nodeState, no side effects.
|
|
9
9
|
*/
|
|
10
10
|
export function formatValue(rawValue, node, allValues) {
|
|
11
11
|
if (typeof node.formatter !== "function")
|
|
@@ -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,OAAO,EAA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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",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnyConfigNode } from "../../store/types";
|
|
2
|
-
import type { LeafEntry, GroupLeafMap } from "../../store/registerNodes";
|
|
3
|
-
/**
|
|
4
|
-
* Рекурсивно собирает все leaf-записи поддерева группового узла.
|
|
5
|
-
*
|
|
6
|
-
* Для каждого группового узла из groupLeafMap берутся его прямые листья,
|
|
7
|
-
* затем рекурсия в дочерние группы. Листовые узлы (с "value") пропускаются —
|
|
8
|
-
* они уже учтены в leaf-list своего родителя.
|
|
9
|
-
*/
|
|
10
|
-
export declare function collectGroupLeafNodes(groupNode: AnyConfigNode, groupLeafMap: GroupLeafMap): LeafEntry[];
|
|
11
|
-
//# sourceMappingURL=collectGroupLeafNodes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectGroupLeafNodes.d.ts","sourceRoot":"","sources":["../../../../store/compute/recompute/collectGroupLeafNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzE;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,YAAY,GACzB,SAAS,EAAE,CAkBb"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { configKeys, isLeaf } from "../../traversal";
|
|
2
|
-
/**
|
|
3
|
-
* Рекурсивно собирает все leaf-записи поддерева группового узла.
|
|
4
|
-
*
|
|
5
|
-
* Для каждого группового узла из groupLeafMap берутся его прямые листья,
|
|
6
|
-
* затем рекурсия в дочерние группы. Листовые узлы (с "value") пропускаются —
|
|
7
|
-
* они уже учтены в leaf-list своего родителя.
|
|
8
|
-
*/
|
|
9
|
-
export function collectGroupLeafNodes(groupNode, groupLeafMap) {
|
|
10
|
-
const result = [];
|
|
11
|
-
// Прямые листья этой группы (включая виртуальный лист самой группы, если есть)
|
|
12
|
-
const ownLeaves = groupLeafMap.get(groupNode);
|
|
13
|
-
if (ownLeaves)
|
|
14
|
-
result.push(...ownLeaves);
|
|
15
|
-
// Рекурсия в дочерние группы
|
|
16
|
-
for (const key of configKeys(groupNode)) {
|
|
17
|
-
const child = groupNode[key];
|
|
18
|
-
if (!child || typeof child !== "object")
|
|
19
|
-
continue;
|
|
20
|
-
if (isLeaf(child))
|
|
21
|
-
continue; // уже в ownLeaves родителя
|
|
22
|
-
result.push(...collectGroupLeafNodes(child, groupLeafMap));
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=collectGroupLeafNodes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectGroupLeafNodes.js","sourceRoot":"","sources":["../../../../store/compute/recompute/collectGroupLeafNodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAAwB,EACxB,YAA0B;IAE1B,MAAM,MAAM,GAAgB,EAAE,CAAC;IAE/B,+EAA+E;IAC/E,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAEzC,6BAA6B;IAC7B,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,SAAoC,CAAC,EAAE,CAAC;QACnE,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAkB,CAAC;QAE9C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,SAAS;QAElD,IAAI,MAAM,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,2BAA2B;QACxD,MAAM,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldMapping.typecheck.d.ts","sourceRoot":"","sources":["../../store/fieldMapping.typecheck.ts"],"names":[],"mappings":""}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Compile-time проверки Phase 2 (валидатор external-config + strict).
|
|
2
|
-
// Файл ВРЕМЕННЫЙ — используется для ручной валидации типов, потом удаляется.
|
|
3
|
-
import { Palistor } from "./store";
|
|
4
|
-
import { defineFieldMapping } from "./defineFieldMapping";
|
|
5
|
-
const uiMapping = defineFieldMapping({
|
|
6
|
-
isRequired: "required",
|
|
7
|
-
isDisabled: "disabled",
|
|
8
|
-
isReadOnly: "readOnly",
|
|
9
|
-
isInvalid: "error",
|
|
10
|
-
errorMessage: "helperText",
|
|
11
|
-
description: "helpText",
|
|
12
|
-
});
|
|
13
|
-
// 1) чистый external-конфиг → компилируется
|
|
14
|
-
new Palistor({
|
|
15
|
-
fieldMapping: uiMapping,
|
|
16
|
-
config: {
|
|
17
|
-
email: {
|
|
18
|
-
value: "",
|
|
19
|
-
label: "Email",
|
|
20
|
-
required: true,
|
|
21
|
-
helpText: "hi",
|
|
22
|
-
validate: (v) => (v ? undefined : "req"),
|
|
23
|
-
},
|
|
24
|
-
profile: { firstName: { value: "Jane", required: false } },
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
// 2) internal-имя ремапленного ключа → ОШИБКА
|
|
28
|
-
new Palistor({
|
|
29
|
-
fieldMapping: uiMapping,
|
|
30
|
-
config: {
|
|
31
|
-
// @ts-expect-error write "required" instead of internal "isRequired"
|
|
32
|
-
email: { value: "", isRequired: true },
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
// 3) вложенная группа: internal-имя → ОШИБКА
|
|
36
|
-
new Palistor({
|
|
37
|
-
fieldMapping: uiMapping,
|
|
38
|
-
config: {
|
|
39
|
-
passport: {
|
|
40
|
-
// @ts-expect-error write "disabled" instead of internal "isDisabled"
|
|
41
|
-
number: { value: "", isDisabled: true },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
// 4) list-шаблон: internal-имя → ОШИБКА
|
|
46
|
-
new Palistor({
|
|
47
|
-
fieldMapping: uiMapping,
|
|
48
|
-
config: {
|
|
49
|
-
users: [
|
|
50
|
-
// @ts-expect-error write "required" instead of internal "isRequired"
|
|
51
|
-
{ id: { value: "" }, name: { value: "", isRequired: true } },
|
|
52
|
-
{ resolve: { resolver: async () => [] } },
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
// 5) без fieldMapping → internal-имена валидны (ошибок нет)
|
|
57
|
-
new Palistor({
|
|
58
|
-
config: {
|
|
59
|
-
email: { value: "", isRequired: true, description: "d" },
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
const annotated = {
|
|
63
|
-
email: { value: "", required: true, helpText: "hi" },
|
|
64
|
-
};
|
|
65
|
-
// @ts-expect-error internal-имя под аннотацией → excess property
|
|
66
|
-
const annotatedBad = {
|
|
67
|
-
email: { value: "", isRequired: true },
|
|
68
|
-
};
|
|
69
|
-
void annotated;
|
|
70
|
-
void annotatedBad;
|
|
71
|
-
//# sourceMappingURL=fieldMapping.typecheck.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldMapping.typecheck.js","sourceRoot":"","sources":["../../store/fieldMapping.typecheck.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,6EAA6E;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,SAAS,GAAG,kBAAkB,CAAC;IACnC,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,UAAU;IACtB,SAAS,EAAE,OAAO;IAClB,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,UAAU;CACxB,CAAC,CAAC;AAEH,4CAA4C;AAC5C,IAAI,QAAQ,CAAC;IACX,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;SACjD;QACD,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;KAC3D;CACF,CAAC,CAAC;AAEH,8CAA8C;AAC9C,IAAI,QAAQ,CAAC;IACX,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE;QACN,qEAAqE;QACrE,KAAK,EAAE,EAAE,KAAK,EAAE,E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/**
|
|
4
|
-
* Извлечь поддерево значений для группового узла из кеша.
|
|
5
|
-
* Для корня → весь кеш, для вложенной группы → вложенный объект по пути.
|
|
6
|
-
* Возвращает snapshot (копию), чтобы beforeSubmit-трансформации не мутировали кеш.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getSubValues(cache: ValuesCache, groupNode: AnyConfigNode, rootConfig: AnyConfigNode, nodePaths: WeakMap<object, string>): Record<string, unknown>;
|
|
9
|
-
//# sourceMappingURL=getSubValues.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSubValues.d.ts","sourceRoot":"","sources":["../../../store/submitPipeline/getSubValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBzB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Извлечь поддерево значений для группового узла из кеша.
|
|
3
|
-
* Для корня → весь кеш, для вложенной группы → вложенный объект по пути.
|
|
4
|
-
* Возвращает snapshot (копию), чтобы beforeSubmit-трансформации не мутировали кеш.
|
|
5
|
-
*/
|
|
6
|
-
export function getSubValues(cache, groupNode, rootConfig, nodePaths) {
|
|
7
|
-
let source;
|
|
8
|
-
if (groupNode === rootConfig) {
|
|
9
|
-
source = cache.values;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
const path = nodePaths.get(groupNode);
|
|
13
|
-
if (!path) {
|
|
14
|
-
source = cache.values;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
let current = cache.values;
|
|
18
|
-
for (const segment of path.split(".")) {
|
|
19
|
-
current = current?.[segment];
|
|
20
|
-
}
|
|
21
|
-
source = current ?? {};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return structuredClone(source);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=getSubValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSubValues.js","sourceRoot":"","sources":["../../../store/submitPipeline/getSubValues.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAkB,EAClB,SAAwB,EACxB,UAAyB,EACzB,SAAkC;IAElC,IAAI,MAA+B,CAAC;IAEpC,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;QAC7B,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,IAAI,OAAO,GAAY,KAAK,CAAC,MAAM,CAAC;YACpC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtC,OAAO,GAAI,OAAmC,EAAE,CAAC,OAAO,CAAC,CAAC;YAC5D,CAAC;YACD,MAAM,GAAI,OAAmC,IAAI,EAAE,CAAC;QACtD,CAAC;IACH,CAAC;IAED,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
|