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,102 +1,102 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Symbol for accessing the original config node through a Proxy.
|
|
3
|
+
* Used by tracking proxies to identify which node is being read.
|
|
4
4
|
*/
|
|
5
5
|
export declare const CONFIG_NODE: unique symbol;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Symbol for extracting the source proxy (store.proxy) from a tracking proxy.
|
|
8
|
+
* Lets useForm accept a tracking-proxy subtree and unwrap the source.
|
|
9
9
|
*/
|
|
10
10
|
export declare const SOURCE_PROXY: unique symbol;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Symbol for extracting the owning ProxyStore from a tracking proxy.
|
|
13
|
+
* Lets useForm accept a tracking-proxy subtree and subscribe to the store.
|
|
14
14
|
*/
|
|
15
15
|
export declare const STORE_REF: unique symbol;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Symbol for extracting the entity ID from an EntityProjectionProxy.
|
|
18
|
+
* Lets useForm(entity, templateSelector) recover entityId and store from the proxy.
|
|
19
19
|
*/
|
|
20
20
|
export declare const ENTITY_ID: unique symbol;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Symbol for extracting the id leaf object (EntityLeafNode) from an
|
|
23
|
+
* EntityProjectionProxy. Tracking proxies register a subscription on it so
|
|
24
|
+
* rekey() correctly re-renders components that read `entity.id`.
|
|
25
25
|
*/
|
|
26
26
|
export declare const ENTITY_ID_LEAF: unique symbol;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Root
|
|
31
|
-
*
|
|
28
|
+
* Brand symbol of a list proxy — returns the `ListState` object (the single
|
|
29
|
+
* "list" building block). Node identity for tracking/resolve is the `ListState`
|
|
30
|
+
* object itself (hub key). Root lists have `ownerEntity === null`; per-entity
|
|
31
|
+
* lists get an isolated `ListState` per (owner, listConfigNode) pair.
|
|
32
32
|
*/
|
|
33
33
|
export declare const LIST_STATE: unique symbol;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* Brand symbol of a flow proxy — returns the `FlowState` object (flow
|
|
36
|
+
* navigation state). Exposed by three proxies: the flow node, the steps proxy,
|
|
37
|
+
* and each step node (the latter return the owning flow's FlowState).
|
|
38
|
+
* Tracking identity: the `FlowState` object itself (hub key) — navigation
|
|
39
|
+
* bumps its version.
|
|
40
40
|
*/
|
|
41
41
|
export declare const FLOW_STATE: unique symbol;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Marker key on a flow node: the ordered array of step keys.
|
|
44
|
+
* Set by defineFlow; included in CONFIG_PROPS so all tree walks
|
|
45
|
+
* (traversal, registerNodes, buildValuesCache, …) skip it.
|
|
46
46
|
*/
|
|
47
47
|
export declare const FLOW_STEPS_PROP = "__flowSteps";
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* Single source of truth for field-state property names (canonical tuple).
|
|
50
|
+
* {@link FIELD_STATE_PROPS} (Set) and {@link MAPPABLE_KEYS} derive from it.
|
|
51
51
|
*/
|
|
52
52
|
export declare const FIELD_STATE_KEYS: readonly ["value", "label", "placeholder", "description", "isRequired", "isReadOnly", "isDisabled", "isVisible", "isInvalid", "errorMessage", "dirty", "loading"];
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* Field-state properties. When one of these is read, the proxy returns the
|
|
55
|
+
* computed value from FieldState rather than the raw config.
|
|
56
56
|
*/
|
|
57
57
|
export declare const FIELD_STATE_PROPS: Set<string>;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* Keys renamable via `fieldMapping`: field-state keys plus the
|
|
60
|
+
* functional setter `onValueChange`.
|
|
61
61
|
*/
|
|
62
62
|
export declare const MAPPABLE_KEYS: readonly ["value", "label", "placeholder", "description", "isRequired", "isReadOnly", "isDisabled", "isVisible", "isInvalid", "errorMessage", "dirty", "loading", "onValueChange"];
|
|
63
|
-
/**
|
|
63
|
+
/** Internal key name allowed as a rename source in `fieldMapping`. */
|
|
64
64
|
export type MappableKey = (typeof MAPPABLE_KEYS)[number];
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
66
|
+
* Subset of mappable keys that are INPUT config keys — i.e. keys an author
|
|
67
|
+
* writes in a node config. Only these are normalized external→internal when
|
|
68
|
+
* `fieldMapping` is active (see {@link normalizeConfig}).
|
|
69
69
|
*
|
|
70
|
-
*
|
|
71
|
-
* `onValueChange`)
|
|
72
|
-
*
|
|
73
|
-
* proxy).
|
|
70
|
+
* The remaining mappable keys (`isInvalid`, `errorMessage`, `dirty`,
|
|
71
|
+
* `loading`, `onValueChange`) are computed/output-only: they never appear in
|
|
72
|
+
* a config, so there is nothing to normalize on input (they are translated
|
|
73
|
+
* only on proxy output). Writing such a key in a config is an error (strict).
|
|
74
74
|
*/
|
|
75
75
|
export declare const MAPPABLE_CONFIG_KEYS_TUPLE: readonly ["value", "label", "placeholder", "description", "isRequired", "isReadOnly", "isDisabled", "isVisible"];
|
|
76
76
|
export declare const MAPPABLE_CONFIG_KEYS: Set<string>;
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
77
|
+
/** Type-level version of {@link MAPPABLE_CONFIG_KEYS} — internal config key
|
|
78
|
+
* names renamable via `fieldMapping` (used by the type validator). */
|
|
79
79
|
export type MappableConfigKey = (typeof MAPPABLE_CONFIG_KEYS_TUPLE)[number];
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* Full set of "service" keys of a config node.
|
|
82
|
+
* Tree walks (init, buildValuesCache) skip them.
|
|
83
83
|
*/
|
|
84
84
|
export declare const CONFIG_PROPS: Set<string>;
|
|
85
85
|
export declare const SPREADABLE_FIELD_STATE_PROPS: string[];
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
87
|
+
* Static keys included when spreading a group node: state (submitting, dirty,
|
|
88
|
+
* revalidate, loading) and methods (submit, reset).
|
|
89
|
+
* Child node keys are added dynamically in computeProxyKeys.
|
|
90
90
|
*/
|
|
91
91
|
export declare const GROUP_SPREAD_KEYS: string[];
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
93
|
+
* Extra spread keys for a flow node (defineFlow) — appended to
|
|
94
|
+
* GROUP_SPREAD_KEYS in computeProxyKeys when the node carries FLOW_STEPS_PROP.
|
|
95
95
|
*/
|
|
96
96
|
export declare const FLOW_SPREAD_KEYS: string[];
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
98
|
+
* Static key set for a list proxy (ListNode).
|
|
99
|
+
* Returned from computeProxyKeys instead of GROUP_SPREAD_KEYS when the node is an array.
|
|
100
100
|
*/
|
|
101
101
|
export declare const LIST_SPREAD_KEYS: string[];
|
|
102
102
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../store/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,MAA6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AM,gBAAgB,mKAanB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iBAAiB,aAAoC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,aAAa,oLAAkD,CAAC;AAE7E,sEAAsE;AACtE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,kHAS7B,CAAC;AAEX,eAAO,MAAM,oBAAoB,aAA8C,CAAC;AAEhF;uEACuE;AACvE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,aAwBvB,CAAC;AAEH,eAAO,MAAM,4BAA4B,UAM3B,CAAC;AAEf;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,EASrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAWpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAWpC,CAAC"}
|
package/dist/store/constants.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Symbol for accessing the original config node through a Proxy.
|
|
3
|
+
* Used by tracking proxies to identify which node is being read.
|
|
4
4
|
*/
|
|
5
5
|
export const CONFIG_NODE = Symbol("configNode");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Symbol for extracting the source proxy (store.proxy) from a tracking proxy.
|
|
8
|
+
* Lets useForm accept a tracking-proxy subtree and unwrap the source.
|
|
9
9
|
*/
|
|
10
10
|
export const SOURCE_PROXY = Symbol("sourceProxy");
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Symbol for extracting the owning ProxyStore from a tracking proxy.
|
|
13
|
+
* Lets useForm accept a tracking-proxy subtree and subscribe to the store.
|
|
14
14
|
*/
|
|
15
15
|
export const STORE_REF = Symbol("storeRef");
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Symbol for extracting the entity ID from an EntityProjectionProxy.
|
|
18
|
+
* Lets useForm(entity, templateSelector) recover entityId and store from the proxy.
|
|
19
19
|
*/
|
|
20
20
|
export const ENTITY_ID = Symbol("entityId");
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Symbol for extracting the id leaf object (EntityLeafNode) from an
|
|
23
|
+
* EntityProjectionProxy. Tracking proxies register a subscription on it so
|
|
24
|
+
* rekey() correctly re-renders components that read `entity.id`.
|
|
25
25
|
*/
|
|
26
26
|
export const ENTITY_ID_LEAF = Symbol("entityIdLeaf");
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Root
|
|
31
|
-
*
|
|
28
|
+
* Brand symbol of a list proxy — returns the `ListState` object (the single
|
|
29
|
+
* "list" building block). Node identity for tracking/resolve is the `ListState`
|
|
30
|
+
* object itself (hub key). Root lists have `ownerEntity === null`; per-entity
|
|
31
|
+
* lists get an isolated `ListState` per (owner, listConfigNode) pair.
|
|
32
32
|
*/
|
|
33
33
|
export const LIST_STATE = Symbol("listState");
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* Brand symbol of a flow proxy — returns the `FlowState` object (flow
|
|
36
|
+
* navigation state). Exposed by three proxies: the flow node, the steps proxy,
|
|
37
|
+
* and each step node (the latter return the owning flow's FlowState).
|
|
38
|
+
* Tracking identity: the `FlowState` object itself (hub key) — navigation
|
|
39
|
+
* bumps its version.
|
|
40
40
|
*/
|
|
41
41
|
export const FLOW_STATE = Symbol("flowState");
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Marker key on a flow node: the ordered array of step keys.
|
|
44
|
+
* Set by defineFlow; included in CONFIG_PROPS so all tree walks
|
|
45
|
+
* (traversal, registerNodes, buildValuesCache, …) skip it.
|
|
46
46
|
*/
|
|
47
47
|
export const FLOW_STEPS_PROP = "__flowSteps";
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* Single source of truth for field-state property names (canonical tuple).
|
|
50
|
+
* {@link FIELD_STATE_PROPS} (Set) and {@link MAPPABLE_KEYS} derive from it.
|
|
51
51
|
*/
|
|
52
52
|
export const FIELD_STATE_KEYS = [
|
|
53
53
|
"value",
|
|
@@ -64,24 +64,24 @@ export const FIELD_STATE_KEYS = [
|
|
|
64
64
|
"loading",
|
|
65
65
|
];
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* Field-state properties. When one of these is read, the proxy returns the
|
|
68
|
+
* computed value from FieldState rather than the raw config.
|
|
69
69
|
*/
|
|
70
70
|
export const FIELD_STATE_PROPS = new Set(FIELD_STATE_KEYS);
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Keys renamable via `fieldMapping`: field-state keys plus the
|
|
73
|
+
* functional setter `onValueChange`.
|
|
74
74
|
*/
|
|
75
75
|
export const MAPPABLE_KEYS = [...FIELD_STATE_KEYS, "onValueChange"];
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
77
|
+
* Subset of mappable keys that are INPUT config keys — i.e. keys an author
|
|
78
|
+
* writes in a node config. Only these are normalized external→internal when
|
|
79
|
+
* `fieldMapping` is active (see {@link normalizeConfig}).
|
|
80
80
|
*
|
|
81
|
-
*
|
|
82
|
-
* `onValueChange`)
|
|
83
|
-
*
|
|
84
|
-
* proxy).
|
|
81
|
+
* The remaining mappable keys (`isInvalid`, `errorMessage`, `dirty`,
|
|
82
|
+
* `loading`, `onValueChange`) are computed/output-only: they never appear in
|
|
83
|
+
* a config, so there is nothing to normalize on input (they are translated
|
|
84
|
+
* only on proxy output). Writing such a key in a config is an error (strict).
|
|
85
85
|
*/
|
|
86
86
|
export const MAPPABLE_CONFIG_KEYS_TUPLE = [
|
|
87
87
|
"value",
|
|
@@ -95,8 +95,8 @@ export const MAPPABLE_CONFIG_KEYS_TUPLE = [
|
|
|
95
95
|
];
|
|
96
96
|
export const MAPPABLE_CONFIG_KEYS = new Set(MAPPABLE_CONFIG_KEYS_TUPLE);
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
98
|
+
* Full set of "service" keys of a config node.
|
|
99
|
+
* Tree walks (init, buildValuesCache) skip them.
|
|
100
100
|
*/
|
|
101
101
|
export const CONFIG_PROPS = new Set([
|
|
102
102
|
...FIELD_STATE_PROPS,
|
|
@@ -131,9 +131,9 @@ export const SPREADABLE_FIELD_STATE_PROPS = [
|
|
|
131
131
|
"loading",
|
|
132
132
|
].includes(k));
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
134
|
+
* Static keys included when spreading a group node: state (submitting, dirty,
|
|
135
|
+
* revalidate, loading) and methods (submit, reset).
|
|
136
|
+
* Child node keys are added dynamically in computeProxyKeys.
|
|
137
137
|
*/
|
|
138
138
|
export const GROUP_SPREAD_KEYS = [
|
|
139
139
|
"value",
|
|
@@ -146,8 +146,8 @@ export const GROUP_SPREAD_KEYS = [
|
|
|
146
146
|
"reset",
|
|
147
147
|
];
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
149
|
+
* Extra spread keys for a flow node (defineFlow) — appended to
|
|
150
|
+
* GROUP_SPREAD_KEYS in computeProxyKeys when the node carries FLOW_STEPS_PROP.
|
|
151
151
|
*/
|
|
152
152
|
export const FLOW_SPREAD_KEYS = [
|
|
153
153
|
"currentStepKey",
|
|
@@ -162,8 +162,8 @@ export const FLOW_SPREAD_KEYS = [
|
|
|
162
162
|
"validate",
|
|
163
163
|
];
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
165
|
+
* Static key set for a list proxy (ListNode).
|
|
166
|
+
* Returned from computeProxyKeys instead of GROUP_SPREAD_KEYS when the node is an array.
|
|
167
167
|
*/
|
|
168
168
|
export const LIST_SPREAD_KEYS = [
|
|
169
169
|
"items",
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { FieldMapping } from "./store/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Helper for declaring a reusable `fieldMapping` map while preserving literal
|
|
4
|
+
* values in the type.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* (`"required"`, …)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
6
|
+
* Why it exists: when the map is extracted into a separate constant, the
|
|
7
|
+
* literal values (`"required"`, …) usually widen to `string`, and static
|
|
8
|
+
* field renaming stops working (runtime is unaffected). Two ways to avoid
|
|
9
|
+
* that — `as const` or this helper. `defineFieldMapping` is preferred since
|
|
10
|
+
* it also validates the map against {@link FieldMapping} (keys — mappable
|
|
11
|
+
* names only, values — strings).
|
|
12
12
|
*
|
|
13
|
-
* > ⚠️
|
|
14
|
-
* > `satisfies`
|
|
15
|
-
* >
|
|
16
|
-
* >
|
|
13
|
+
* > ⚠️ Do NOT use `... satisfies FieldMapping` for a reusable map:
|
|
14
|
+
* > `satisfies` widens the values to `string` and the rename typing breaks.
|
|
15
|
+
* > For an inline literal directly in `new Palistor({ fieldMapping })` the
|
|
16
|
+
* > helper is unnecessary — the class `const` type parameter captures the
|
|
17
|
+
* > literals by itself.
|
|
17
18
|
*
|
|
18
|
-
* `fieldMapping`
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* `fieldMapping` defines the SINGLE public vocabulary of field names: the
|
|
20
|
+
* config is authored in the same (external) names it is read with. The
|
|
21
|
+
* normalizer in the Palistor constructor converts them to internal names
|
|
22
|
+
* before compute (see `normalizeConfig`), so the core is unchanged. Writing
|
|
23
|
+
* the internal name of a remapped key in the config is an error (strict).
|
|
22
24
|
*
|
|
23
25
|
* @example
|
|
24
26
|
* const fieldMapping = defineFieldMapping({
|
|
@@ -29,13 +31,13 @@ import type { FieldMapping } from "./store/types";
|
|
|
29
31
|
* });
|
|
30
32
|
* const store = new Palistor({
|
|
31
33
|
* config: {
|
|
32
|
-
* // external
|
|
34
|
+
* // external names, not isRequired/description:
|
|
33
35
|
* email: { value: "", required: true, helpText: "We never share it" },
|
|
34
36
|
* },
|
|
35
37
|
* fieldMapping,
|
|
36
38
|
* });
|
|
37
|
-
* store.proxy.email.required; // boolean —
|
|
38
|
-
* store.proxy.email.helperText; // string —
|
|
39
|
+
* store.proxy.email.required; // boolean — statically typed
|
|
40
|
+
* store.proxy.email.helperText; // string — validation error after submit
|
|
39
41
|
*/
|
|
40
42
|
export declare function defineFieldMapping<const M extends FieldMapping>(mapping: M): M;
|
|
41
43
|
//# sourceMappingURL=defineFieldMapping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineFieldMapping.d.ts","sourceRoot":"","sources":["../../store/defineFieldMapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"defineFieldMapping.d.ts","sourceRoot":"","sources":["../../store/defineFieldMapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAE9E"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Helper for declaring a reusable `fieldMapping` map while preserving literal
|
|
3
|
+
* values in the type.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* (`"required"`, …)
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* Why it exists: when the map is extracted into a separate constant, the
|
|
6
|
+
* literal values (`"required"`, …) usually widen to `string`, and static
|
|
7
|
+
* field renaming stops working (runtime is unaffected). Two ways to avoid
|
|
8
|
+
* that — `as const` or this helper. `defineFieldMapping` is preferred since
|
|
9
|
+
* it also validates the map against {@link FieldMapping} (keys — mappable
|
|
10
|
+
* names only, values — strings).
|
|
11
11
|
*
|
|
12
|
-
* > ⚠️
|
|
13
|
-
* > `satisfies`
|
|
14
|
-
* >
|
|
15
|
-
* >
|
|
12
|
+
* > ⚠️ Do NOT use `... satisfies FieldMapping` for a reusable map:
|
|
13
|
+
* > `satisfies` widens the values to `string` and the rename typing breaks.
|
|
14
|
+
* > For an inline literal directly in `new Palistor({ fieldMapping })` the
|
|
15
|
+
* > helper is unnecessary — the class `const` type parameter captures the
|
|
16
|
+
* > literals by itself.
|
|
16
17
|
*
|
|
17
|
-
* `fieldMapping`
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* `fieldMapping` defines the SINGLE public vocabulary of field names: the
|
|
19
|
+
* config is authored in the same (external) names it is read with. The
|
|
20
|
+
* normalizer in the Palistor constructor converts them to internal names
|
|
21
|
+
* before compute (see `normalizeConfig`), so the core is unchanged. Writing
|
|
22
|
+
* the internal name of a remapped key in the config is an error (strict).
|
|
21
23
|
*
|
|
22
24
|
* @example
|
|
23
25
|
* const fieldMapping = defineFieldMapping({
|
|
@@ -28,13 +30,13 @@
|
|
|
28
30
|
* });
|
|
29
31
|
* const store = new Palistor({
|
|
30
32
|
* config: {
|
|
31
|
-
* // external
|
|
33
|
+
* // external names, not isRequired/description:
|
|
32
34
|
* email: { value: "", required: true, helpText: "We never share it" },
|
|
33
35
|
* },
|
|
34
36
|
* fieldMapping,
|
|
35
37
|
* });
|
|
36
|
-
* store.proxy.email.required; // boolean —
|
|
37
|
-
* store.proxy.email.helperText; // string —
|
|
38
|
+
* store.proxy.email.required; // boolean — statically typed
|
|
39
|
+
* store.proxy.email.helperText; // string — validation error after submit
|
|
38
40
|
*/
|
|
39
41
|
export function defineFieldMapping(mapping) {
|
|
40
42
|
return mapping;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineFieldMapping.js","sourceRoot":"","sources":["../../store/defineFieldMapping.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"defineFieldMapping.js","sourceRoot":"","sources":["../../store/defineFieldMapping.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,kBAAkB,CAA+B,OAAU;IACzE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -13,7 +13,7 @@ export function collectInitialSnapshot(node, initialValueMap) {
|
|
|
13
13
|
if (!child || typeof child !== "object")
|
|
14
14
|
continue;
|
|
15
15
|
if (isListNode(child))
|
|
16
|
-
continue; // ListNode —
|
|
16
|
+
continue; // ListNode — skipped, restored separately
|
|
17
17
|
if (isLeafNode(child)) {
|
|
18
18
|
const initial = initialValueMap.get(child);
|
|
19
19
|
if (initial !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectInitialSnapshot.js","sourceRoot":"","sources":["../../../store/dirtyTracking/collectInitialSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGlE;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAmB,EACnB,eAAyC;IAEzC,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,GAAG,IAAI,UAAU,CAAC,IAA+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YAChD,MAAM,CAAC,GAAG,CAAC,GAAG,sBAAsB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -5,10 +5,10 @@ export interface RecomputeDirtyResult {
|
|
|
5
5
|
changed: Set<object>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Scoped recompute
|
|
9
|
-
*
|
|
8
|
+
* Scoped dirty recompute: recomputes dirty only for the groups containing
|
|
9
|
+
* changed nodes, bubbling up to the ancestors.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Complexity: O(affectedGroups × childrenPerGroup) instead of O(allNodes).
|
|
12
12
|
*/
|
|
13
13
|
export declare function recomputeDirtyTargeted(changedNodes: Set<object>, rootConfig: AnyConfigNode, nodeState: WeakMap<object, FieldState>, initialValueMap: WeakMap<object, unknown>, nodeParents: WeakMap<object, object>, nodePaths: WeakMap<object, string>, listStates?: WeakMap<object, {
|
|
14
14
|
itemIds: string[];
|
|
@@ -13,14 +13,14 @@ function arraysEqual(a, b) {
|
|
|
13
13
|
return true;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Scoped recompute
|
|
17
|
-
*
|
|
16
|
+
* Scoped dirty recompute: recomputes dirty only for the groups containing
|
|
17
|
+
* changed nodes, bubbling up to the ancestors.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* Complexity: O(affectedGroups × childrenPerGroup) instead of O(allNodes).
|
|
20
20
|
*/
|
|
21
21
|
export function recomputeDirtyTargeted(changedNodes, rootConfig, nodeState, initialValueMap, nodeParents, nodePaths, listStates) {
|
|
22
22
|
const changed = new Set();
|
|
23
|
-
// 1.
|
|
23
|
+
// 1. Recompute dirty only for the LEAVES from changedNodes
|
|
24
24
|
const affectedGroupPaths = new Set();
|
|
25
25
|
for (const node of changedNodes) {
|
|
26
26
|
if (isLeafNode(node)) {
|
|
@@ -36,8 +36,8 @@ export function recomputeDirtyTargeted(changedNodes, rootConfig, nodeState, init
|
|
|
36
36
|
}
|
|
37
37
|
affectedGroupPaths.add(getNodeGroupPath(node, nodeParents, nodePaths));
|
|
38
38
|
}
|
|
39
|
-
// 2.
|
|
40
|
-
//
|
|
39
|
+
// 2. For every affected group — aggregate dirty from its immediate children
|
|
40
|
+
// and bubble up to the ancestors
|
|
41
41
|
const processed = new Set();
|
|
42
42
|
const queue = [...affectedGroupPaths];
|
|
43
43
|
while (queue.length > 0) {
|
|
@@ -47,8 +47,8 @@ export function recomputeDirtyTargeted(changedNodes, rootConfig, nodeState, init
|
|
|
47
47
|
processed.add(groupPath);
|
|
48
48
|
const groupNode = resolveGroupByPath(rootConfig, groupPath);
|
|
49
49
|
if (!groupNode)
|
|
50
|
-
continue; // entity
|
|
51
|
-
//
|
|
50
|
+
continue; // entity paths — skip
|
|
51
|
+
// Aggregate dirty from immediate children
|
|
52
52
|
let anyChildDirty = false;
|
|
53
53
|
for (const key of configKeys(groupNode)) {
|
|
54
54
|
const child = groupNode[key];
|
|
@@ -67,12 +67,12 @@ export function recomputeDirtyTargeted(changedNodes, rootConfig, nodeState, init
|
|
|
67
67
|
if (childState?.dirty)
|
|
68
68
|
anyChildDirty = true;
|
|
69
69
|
}
|
|
70
|
-
//
|
|
70
|
+
// Update dirty on the group node itself
|
|
71
71
|
const groupState = nodeState.get(groupNode);
|
|
72
72
|
if (groupState && groupState.dirty !== anyChildDirty) {
|
|
73
73
|
nodeState.set(groupNode, { ...groupState, dirty: anyChildDirty });
|
|
74
74
|
changed.add(groupNode);
|
|
75
|
-
// Bubble
|
|
75
|
+
// Bubble up: enqueue the parent group
|
|
76
76
|
const parent = nodeParents.get(groupNode);
|
|
77
77
|
if (parent) {
|
|
78
78
|
const parentPath = nodePaths.get(parent) ?? "";
|
|
@@ -82,7 +82,7 @@ export function recomputeDirtyTargeted(changedNodes, rootConfig, nodeState, init
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
// 3.
|
|
85
|
+
// 3. Determine anyDirty from the root
|
|
86
86
|
const rootState = nodeState.get(rootConfig);
|
|
87
87
|
const anyDirty = rootState?.dirty ?? false;
|
|
88
88
|
return { anyDirty, changed };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recomputeDirtyTargeted.js","sourceRoot":"","sources":["../../../store/dirtyTracking/recomputeDirtyTargeted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,iFAAiF;AACjF,SAAS,WAAW,CAAC,CAAW,EAAE,CAAW;IAC3C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAClC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,YAAyB,EACzB,UAAyB,EACzB,SAAsC,EACtC,eAAyC,EACzC,WAAoC,EACpC,SAAkC,EAClC,UAA6E;IAE7E,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,
|
|
1
|
+
{"version":3,"file":"recomputeDirtyTargeted.js","sourceRoot":"","sources":["../../../store/dirtyTracking/recomputeDirtyTargeted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EA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