palistor 0.0.25 → 0.0.27
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 +609 -542
- package/README.ru.md +1015 -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,19 +1,19 @@
|
|
|
1
1
|
import { CONFIG_NODE, FLOW_STATE } from "../constants";
|
|
2
|
-
/**
|
|
2
|
+
/** Stable steps-proxy cache — one per FlowState (like listProxyCache). */
|
|
3
3
|
const stepsProxyCache = new WeakMap();
|
|
4
4
|
const NUMERIC_KEY = /^\d+$/;
|
|
5
5
|
/**
|
|
6
|
-
* Proxy
|
|
6
|
+
* Proxy over the flow's step collection (flow.steps).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* steps[0] —
|
|
10
|
-
* steps.welcome —
|
|
11
|
-
* steps.current —
|
|
12
|
-
* steps.length —
|
|
13
|
-
* [...steps] —
|
|
8
|
+
* Access:
|
|
9
|
+
* steps[0] — by index (step array order)
|
|
10
|
+
* steps.welcome — by key
|
|
11
|
+
* steps.current — live reference to the active step's proxy
|
|
12
|
+
* steps.length — number of steps
|
|
13
|
+
* [...steps] — iteration over step proxies
|
|
14
14
|
*
|
|
15
|
-
* Step
|
|
16
|
-
*
|
|
15
|
+
* Step proxies are regular group proxies of the step nodes (cached in
|
|
16
|
+
* proxyCache), enriched with `status` in the group GET trap (via stepToFlow).
|
|
17
17
|
*/
|
|
18
18
|
export function buildFlowStepsProxy(flowState, kernel) {
|
|
19
19
|
const cached = stepsProxyCache.get(flowState);
|
|
@@ -23,10 +23,10 @@ export function buildFlowStepsProxy(flowState, kernel) {
|
|
|
23
23
|
const spreadKeys = () => [...flowState.stepKeys, "current", "length"];
|
|
24
24
|
const proxy = new Proxy({}, {
|
|
25
25
|
get(_target, key) {
|
|
26
|
-
//
|
|
26
|
+
// Tracking brand: navigation bumps the FlowState version.
|
|
27
27
|
if (key === FLOW_STATE)
|
|
28
28
|
return flowState;
|
|
29
|
-
// steps
|
|
29
|
+
// steps is not a config node; transparent to the tracking proxy.
|
|
30
30
|
if (key === CONFIG_NODE)
|
|
31
31
|
return undefined;
|
|
32
32
|
if (typeof key === "symbol") {
|
|
@@ -52,7 +52,7 @@ export function buildFlowStepsProxy(flowState, kernel) {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
},
|
|
54
54
|
set() {
|
|
55
|
-
//
|
|
55
|
+
// The step set is static — writes are forbidden.
|
|
56
56
|
return false;
|
|
57
57
|
},
|
|
58
58
|
ownKeys() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFlowStepsProxy.js","sourceRoot":"","sources":["../../../store/flow/buildFlowStepsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAIvD,
|
|
1
|
+
{"version":3,"file":"buildFlowStepsProxy.js","sourceRoot":"","sources":["../../../store/flow/buildFlowStepsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAIvD,0EAA0E;AAC1E,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEtD,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAoB,EAAE,MAA0B;IAClF,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,SAA8B,CAAC,CAAC;IACnE,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAC1C,MAAM,CAAC,YAAY,CAAC,KAAK,C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AC,GAAG,CAAC,CAAC;YAC9C,IAAI,KAAK,KAAK,CAAC,CAAC;gBAAE,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;YAE1C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,GAAG;YACD,iDAAiD;YACjD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO;YACL,OAAO,UAAU,EAAE,CAAC;QACtB,CAAC;QAED,wBAAwB,CAAC,OAAO,EAAE,GAAoB;YACpD,IAAI,OAAO,GAAG,KAAK,QAAQ;gBAAE,OAAO,SAAS,CAAC;YAC9C,IAAI,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,SAAS,CAAC;YAClD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACnE,CAAC;KACF,CAAC,CAAC;IAEH,eAAe,CAAC,GAAG,CAAC,SAA8B,EAAE,KAAK,CAAC,CAAC;IAC3D,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import type { ExtractValues, ProxyStore } from "../store/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Flow step status — a computed step-proxy property derived from navigation
|
|
4
|
+
* state (currentStepKey + visited set). Not a leaf node: never appears in
|
|
5
|
+
* values, submit payloads or persisted state.
|
|
6
6
|
*
|
|
7
|
-
* - `null` —
|
|
8
|
-
* - `"active"` —
|
|
9
|
-
* - `"completed"` —
|
|
7
|
+
* - `null` — the step has not been visited yet
|
|
8
|
+
* - `"active"` — the current step
|
|
9
|
+
* - `"completed"` — was active, then left (forward or back)
|
|
10
10
|
*/
|
|
11
11
|
export type StepStatus = "active" | "completed" | null;
|
|
12
|
-
/**
|
|
12
|
+
/** Flow validation error — same shape as in SubmitResult. */
|
|
13
13
|
export interface FlowError {
|
|
14
14
|
path: string;
|
|
15
15
|
message: string;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* defineFlow
|
|
18
|
+
* Result of defineStep: the step's group config + its key within the flow.
|
|
19
|
+
* defineFlow expands steps into regular child groups of the flow node.
|
|
20
20
|
*/
|
|
21
21
|
export interface FlowStep<K extends string = string, C extends Record<string, any> = Record<string, any>> {
|
|
22
22
|
readonly key: K;
|
|
23
23
|
readonly config: C;
|
|
24
24
|
}
|
|
25
25
|
export type AnyFlowStep = FlowStep<string, Record<string, any>>;
|
|
26
|
-
/**
|
|
26
|
+
/** Flow values — all steps by key (accumulated state). */
|
|
27
27
|
export type FlowValues<S extends readonly AnyFlowStep[]> = {
|
|
28
28
|
[Step in S[number] as Step["key"]]: ExtractValues<Step["config"]>;
|
|
29
29
|
};
|
|
30
30
|
declare const __flowBrand: unique symbol;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* A flow node in the config tree: a regular group (steps are child groups by
|
|
33
|
+
* key), branded with the step tuple for proxy type inference.
|
|
34
34
|
*/
|
|
35
35
|
export type FlowNode<S extends readonly AnyFlowStep[]> = {
|
|
36
36
|
readonly [__flowBrand]: S;
|
|
37
37
|
} & {
|
|
38
38
|
[Step in S[number] as Step["key"]]: Step["config"];
|
|
39
39
|
};
|
|
40
|
-
/**
|
|
40
|
+
/** Extract the step tuple from a FlowNode (never when the node is not a flow). */
|
|
41
41
|
export type InferFlowSteps<T> = T extends {
|
|
42
42
|
readonly [__flowBrand]: infer S extends readonly AnyFlowStep[];
|
|
43
43
|
} ? S : never;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Wrap a group config into a flow step.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
* resolve, onSubmit, …)
|
|
47
|
+
* A step config is a regular Palistor group node (fields, isVisible,
|
|
48
|
+
* validate, resolve, onSubmit, …) plus the flow lifecycle callbacks
|
|
49
|
+
* `onEnter` / `onReady`.
|
|
49
50
|
*
|
|
50
51
|
* @example
|
|
51
52
|
* defineStep("welcome", {
|
|
@@ -57,24 +58,25 @@ export declare function defineStep<const K extends string, const C extends Recor
|
|
|
57
58
|
status?: never;
|
|
58
59
|
}): FlowStep<K, C>;
|
|
59
60
|
export interface DefineFlowOptions<S extends readonly AnyFlowStep[]> {
|
|
60
|
-
/**
|
|
61
|
+
/** Ordered array of steps (defineStep). The order drives nextStep(). */
|
|
61
62
|
steps: S;
|
|
62
|
-
/** Flow-level submit:
|
|
63
|
+
/** Flow-level submit: invoked by the standard submit pipeline over all steps. */
|
|
63
64
|
onSubmit?: (values: FlowValues<S>, store: ProxyStore<any>, parent?: any) => Promise<unknown> | unknown;
|
|
64
|
-
/** Group-level
|
|
65
|
+
/** Group-level value transformation before submit. */
|
|
65
66
|
beforeSubmit?: (values: FlowValues<S>) => FlowValues<S> | Promise<FlowValues<S>>;
|
|
66
|
-
/**
|
|
67
|
+
/** Post-processing after a successful onSubmit. */
|
|
67
68
|
afterSubmit?: (result: unknown, actions: {
|
|
68
69
|
reset: () => void;
|
|
69
70
|
}) => void | Promise<void>;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
+
* Build a flow node from an ordered array of steps.
|
|
73
74
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* The returned node is a regular group in the config tree (steps become child
|
|
76
|
+
* groups under their keys), stamped with the {@link FLOW_STEPS_PROP} marker
|
|
77
|
+
* holding the step order. It participates in values / persist / dirty like
|
|
78
|
+
* any group; NodeRegistry creates a FlowState (navigation, statuses, history)
|
|
79
|
+
* based on the marker.
|
|
78
80
|
*
|
|
79
81
|
* @example
|
|
80
82
|
* const onboarding = defineFlow({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineFlow.d.ts","sourceRoot":"","sources":["../../../store/flow/defineFlow.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,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AAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,WAAW,EAAE,EAC/D,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,QAAQ,CAAC,CAAC,CAAC,CAgCb"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { CONFIG_PROPS, FLOW_SPREAD_KEYS, FLOW_STEPS_PROP, GROUP_SPREAD_KEYS, } from "../constants";
|
|
2
2
|
// ─── defineStep ───────────────────────────────────────────────────────────────
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The name `status` is reserved on the step proxy for the computed step
|
|
5
|
+
* status — a config field with that name is forbidden (like dirty/loading).
|
|
6
6
|
*/
|
|
7
7
|
const RESERVED_STEP_CONFIG_KEYS = new Set(["status"]);
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Wrap a group config into a flow step.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* resolve, onSubmit, …)
|
|
11
|
+
* A step config is a regular Palistor group node (fields, isVisible,
|
|
12
|
+
* validate, resolve, onSubmit, …) plus the flow lifecycle callbacks
|
|
13
|
+
* `onEnter` / `onReady`.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* defineStep("welcome", {
|
|
@@ -36,8 +37,8 @@ export function defineStep(key, config) {
|
|
|
36
37
|
}
|
|
37
38
|
// ─── defineFlow ───────────────────────────────────────────────────────────────
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
40
|
+
* Step keys that conflict with flow-proxy / steps-proxy properties or service
|
|
41
|
+
* config keys — forbidden as step names.
|
|
41
42
|
*/
|
|
42
43
|
const RESERVED_STEP_KEYS = new Set([
|
|
43
44
|
...CONFIG_PROPS,
|
|
@@ -48,12 +49,13 @@ const RESERVED_STEP_KEYS = new Set([
|
|
|
48
49
|
"length",
|
|
49
50
|
]);
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* Build a flow node from an ordered array of steps.
|
|
52
53
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* The returned node is a regular group in the config tree (steps become child
|
|
55
|
+
* groups under their keys), stamped with the {@link FLOW_STEPS_PROP} marker
|
|
56
|
+
* holding the step order. It participates in values / persist / dirty like
|
|
57
|
+
* any group; NodeRegistry creates a FlowState (navigation, statuses, history)
|
|
58
|
+
* based on the marker.
|
|
57
59
|
*
|
|
58
60
|
* @example
|
|
59
61
|
* const onboarding = defineFlow({
|
|
@@ -90,7 +92,7 @@ export function defineFlow(options) {
|
|
|
90
92
|
node.beforeSubmit = beforeSubmit;
|
|
91
93
|
if (afterSubmit)
|
|
92
94
|
node.afterSubmit = afterSubmit;
|
|
93
|
-
//
|
|
95
|
+
// Flow marker: part of CONFIG_PROPS → all tree walks skip it.
|
|
94
96
|
node[FLOW_STEPS_PROP] = stepKeys;
|
|
95
97
|
return node;
|
|
96
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineFlow.js","sourceRoot":"","sources":["../../../store/flow/defineFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,cAAc,CAAC;AA4DtB,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"defineFlow.js","sourceRoot":"","sources":["../../../store/flow/defineFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,cAAc,CAAC;AA4DtB,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,yBAA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9 @@ import type { SubmitResult } from "../submitPipeline/types";
|
|
|
3
3
|
import type { FlowError } from "./defineFlow";
|
|
4
4
|
import type { FlowState } from "./flowState";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Navigation methods of the flow proxy. All are closures bound over
|
|
7
|
+
* (kernel, flowState), so destructuring in onSubmit works:
|
|
8
|
+
* `(values, store, { nextStep }) => …`.
|
|
8
9
|
*/
|
|
9
10
|
export interface FlowApi {
|
|
10
11
|
nextStep: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.d.ts","sourceRoot":"","sources":["../../../store/flow/flowApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C
|
|
1
|
+
{"version":3,"file":"flowApi.d.ts","sourceRoot":"","sources":["../../../store/flow/flowApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,EAAE,MAAM,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACrC;AAKD,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAcpF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flowBack, flowGoTo, flowNextStep, flowSubmit, flowValidate, } from "./flowNavigation";
|
|
2
|
-
/**
|
|
2
|
+
/** Stable method references — one FlowApi per FlowState (for React). */
|
|
3
3
|
const flowApiCache = new WeakMap();
|
|
4
4
|
export function getFlowApi(kernel, flowState) {
|
|
5
5
|
const cached = flowApiCache.get(flowState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../store/flow/flowApi.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../store/flow/flowApi.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,kBAAkB,CAAC;AAe1B,wEAAwE;AACxE,MAAM,YAAY,GAAG,IAAI,OAAO,EAAmB,CAAC;AAEpD,MAAM,UAAU,UAAU,CAAC,MAA0B,EAAE,SAAoB;IACzE,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,SAA8B,CAAC,CAAC;IAChE,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,GAAG,GAAY;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;QAC/C,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;QACvC,IAAI,EAAE,CAAC,UAA2B,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;QAC9E,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;QAC/C,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;KAC5C,CAAC;IAEF,YAAY,CAAC,GAAG,CAAC,SAA8B,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -4,49 +4,49 @@ import type { SubmitResult } from "../submitPipeline/types";
|
|
|
4
4
|
import type { FlowError, StepStatus } from "./defineFlow";
|
|
5
5
|
import type { FlowState } from "./flowState";
|
|
6
6
|
type Kernel = Palistor<any, any>;
|
|
7
|
-
/**
|
|
7
|
+
/** Step status — derived from navigation state (not stored). */
|
|
8
8
|
export declare function getStepStatus(flowState: FlowState, stepNode: object): StepStatus;
|
|
9
|
-
/**
|
|
9
|
+
/** Step visibility — from the group's computed FieldState (isVisible is reactive). */
|
|
10
10
|
export declare function isStepVisible(kernel: Kernel, stepNode: object): boolean;
|
|
11
|
-
/**
|
|
11
|
+
/** Composite flow loading: true when at least one step is resolving. */
|
|
12
12
|
export declare function flowLoading(kernel: Kernel, flowState: FlowState): boolean;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* computeFieldState(revalidate=true) —
|
|
16
|
-
* (
|
|
17
|
-
*
|
|
14
|
+
* Collect leaf errors of a step's subtree. Validation is computed "live" via
|
|
15
|
+
* computeFieldState(revalidate=true) — independent of the group's revalidate
|
|
16
|
+
* flag (which only the submit pipeline sets). Hidden leaves are skipped.
|
|
17
|
+
* Lists inside a step are skipped (parity with collectLeafStates).
|
|
18
18
|
*
|
|
19
|
-
* `basePath` —
|
|
20
|
-
*
|
|
21
|
-
* submit
|
|
22
|
-
* submitted
|
|
19
|
+
* `basePath` — prefix for error paths. The flow passes the step KEY: paths
|
|
20
|
+
* come out relative to the flow node ("welcome.name") — the same base the
|
|
21
|
+
* submit pipeline uses for errors on flow.submit() (collectLeafStates builds
|
|
22
|
+
* paths from the submitted node).
|
|
23
23
|
*/
|
|
24
24
|
export declare function collectStepErrors(kernel: Kernel, stepNode: AnyConfigNode, basePath?: string): FlowError[];
|
|
25
|
-
/** Live
|
|
25
|
+
/** Live aggregate of step validity (flow.steps.x.isInvalid). */
|
|
26
26
|
export declare function stepIsInvalid(kernel: Kernel, stepNode: AnyConfigNode): boolean;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* Flow errors over visited visible steps (the scope of flow.validate()).
|
|
29
|
+
* Hidden steps are always excluded — an untaken branch must not block.
|
|
30
|
+
* Error paths are relative to the flow node ("stepKey.field") — same as
|
|
31
|
+
* SubmitResult on flow.submit().
|
|
32
32
|
*/
|
|
33
33
|
export declare function collectFlowErrors(kernel: Kernel, flowState: FlowState): FlowError[];
|
|
34
|
-
/**
|
|
34
|
+
/** Aggregate flow.isInvalid: any errors in visited visible steps. */
|
|
35
35
|
export declare function flowIsInvalid(kernel: Kernel, flowState: FlowState): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* flow.validate():
|
|
38
|
-
* flow.errors
|
|
37
|
+
* flow.validate(): collect errors of the visited steps, write them into the
|
|
38
|
+
* reactive flow.errors and return them. Empty array = all valid.
|
|
39
39
|
*/
|
|
40
40
|
export declare function flowValidate(kernel: Kernel, flowState: FlowState): FlowError[];
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* Filter out submit-pipeline errors from leaves under HIDDEN steps of any
|
|
43
|
+
* flow: the base pipeline validates all leaves regardless of visibility, and
|
|
44
|
+
* without this filter an untaken branch with isRequired fields would block
|
|
45
|
+
* finalization forever.
|
|
46
46
|
*
|
|
47
|
-
* `submittedNode` —
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* `submittedNode` — the node the submit ran for: pipeline error paths are
|
|
48
|
+
* RELATIVE to it (collectLeafStates builds paths from the submitted node),
|
|
49
|
+
* so the absolute paths of hidden steps are rebased to the same base.
|
|
50
50
|
*/
|
|
51
51
|
export declare function filterHiddenFlowStepErrors(kernel: Kernel, errors: Array<{
|
|
52
52
|
path: string;
|
|
@@ -56,80 +56,82 @@ export declare function filterHiddenFlowStepErrors(kernel: Kernel, errors: Array
|
|
|
56
56
|
message: string;
|
|
57
57
|
}>;
|
|
58
58
|
/**
|
|
59
|
-
* flow.submit():
|
|
60
|
-
* (submitting → beforeSubmit → validate → onSubmit → afterSubmit;
|
|
61
|
-
*
|
|
62
|
-
*
|
|
59
|
+
* flow.submit(): the standard group-submit pipeline over the flow node
|
|
60
|
+
* (submitting → beforeSubmit → validate → onSubmit → afterSubmit; leaves of
|
|
61
|
+
* hidden steps are filtered by the pipeline). Validation errors land in the
|
|
62
|
+
* reactive flow.errors; on success errors are cleared.
|
|
63
63
|
*/
|
|
64
64
|
export declare function flowSubmit(kernel: Kernel, flowState: FlowState): Promise<SubmitResult>;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Step entry lifecycle: onEnter → resolve (eager) → onReady.
|
|
67
67
|
*
|
|
68
|
-
* - `onEnter` / `onReady`
|
|
69
|
-
*
|
|
70
|
-
* - resolve
|
|
71
|
-
* (
|
|
72
|
-
*
|
|
73
|
-
* -
|
|
68
|
+
* - `onEnter` / `onReady` receive FLOW-scoped values (all steps by key) —
|
|
69
|
+
* the flow's live groupSlot reference; fire-and-forget.
|
|
70
|
+
* - the step's resolve is a standard group resolve; the flow triggers it ON
|
|
71
|
+
* ENTRY (equivalent to first access). Already resolved/error (cached) — not
|
|
72
|
+
* re-run, and onReady is NOT invoked again.
|
|
73
|
+
* - Without resolve — onReady fires right after onEnter.
|
|
74
74
|
*/
|
|
75
75
|
export declare function runEntryLifecycle(kernel: Kernel, flowState: FlowState, stepNode: AnyConfigNode): void;
|
|
76
76
|
/**
|
|
77
|
-
* nextStep():
|
|
78
|
-
*
|
|
79
|
-
*
|
|
77
|
+
* nextStep(): the next VISIBLE step in array order; hidden ones are skipped.
|
|
78
|
+
* When no visible steps remain ahead — finalize via flow.submit() (on
|
|
79
|
+
* validation errors onSubmit is not called, errors land in flow.errors, the
|
|
80
|
+
* step does not change).
|
|
80
81
|
*/
|
|
81
82
|
export declare function flowNextStep(kernel: Kernel, flowState: FlowState): void;
|
|
82
|
-
/** back():
|
|
83
|
+
/** back(): go back along the visit stack. No-op when the stack is empty (canGoBack). */
|
|
83
84
|
export declare function flowBack(kernel: Kernel, flowState: FlowState): void;
|
|
84
85
|
/**
|
|
85
|
-
* goTo(keyOrIndex):
|
|
86
|
-
*
|
|
87
|
-
*
|
|
86
|
+
* goTo(keyOrIndex): arbitrary jump by key or index.
|
|
87
|
+
* Unknown key/index — throws (catches typos during development).
|
|
88
|
+
* Jumping to the current step is a no-op.
|
|
88
89
|
*/
|
|
89
90
|
export declare function flowGoTo(kernel: Kernel, flowState: FlowState, keyOrIndex: string | number): void;
|
|
90
91
|
/**
|
|
91
|
-
*
|
|
92
|
-
* resolve
|
|
93
|
-
* (onEnter → resolve → onReady)
|
|
92
|
+
* Reset flow navigation: the first step is active, the stack and visited set
|
|
93
|
+
* are cleared, step resolve states go back to idle. The first step's entry
|
|
94
|
+
* lifecycle (onEnter → resolve → onReady) runs anew — mirroring initialization.
|
|
94
95
|
*/
|
|
95
96
|
export declare function resetFlowNav(kernel: Kernel, flowState: FlowState): void;
|
|
96
97
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
98
|
+
* Reset navigation of all flows that fall into the reset subtree.
|
|
99
|
+
* Called from ResetPipeline (root reset → all flows; group reset → flows inside it).
|
|
99
100
|
*/
|
|
100
101
|
export declare function resetFlowNavForSubtree(kernel: Kernel, groupNode: AnyConfigNode): void;
|
|
101
102
|
/**
|
|
102
|
-
*
|
|
103
|
-
* store (onEnter → resolve → onReady).
|
|
103
|
+
* Initialization lifecycle: the first step of every flow is "entered" at
|
|
104
|
+
* store creation (onEnter → resolve → onReady). Called from the Palistor
|
|
105
|
+
* constructor.
|
|
104
106
|
*
|
|
105
|
-
*
|
|
106
|
-
* parent.proxy
|
|
107
|
-
*
|
|
108
|
-
*
|
|
107
|
+
* Also pre-warms the proxyCache of flow nodes: a step's identity view reads
|
|
108
|
+
* parent.proxy from the cache on the first step.submit(), and the flow proxy
|
|
109
|
+
* must already exist by then — otherwise the step's onSubmit would receive
|
|
110
|
+
* undefined as its third argument.
|
|
109
111
|
*/
|
|
110
112
|
export declare function initFlows(kernel: Kernel): void;
|
|
111
|
-
/**
|
|
113
|
+
/** Flow navigation snapshot in the persist payload (field values are stored separately). */
|
|
112
114
|
export interface FlowNavSnapshot {
|
|
113
115
|
currentStepKey: string;
|
|
114
116
|
visitStack: string[];
|
|
115
117
|
visitedKeys: string[];
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
+
* Serialize navigation of all flows for persist: key — the flow node's dot-path.
|
|
121
|
+
* Step statuses are not saved — they are derived from navigation on hydrate.
|
|
120
122
|
*/
|
|
121
123
|
export declare function serializeFlowNav(kernel: Kernel): Record<string, FlowNavSnapshot> | null;
|
|
122
124
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
125
|
+
* Restore flow navigation from a persist snapshot. Unknown step keys (the
|
|
126
|
+
* config changed) are dropped; an incompatible currentStepKey leaves the flow
|
|
127
|
+
* in its current state. Returns the changed nodes for notify and the flows
|
|
128
|
+
* whose active step changed (for a repeated entry lifecycle).
|
|
127
129
|
*/
|
|
128
130
|
export declare function restoreFlowNav(kernel: Kernel, snapshots: Record<string, FlowNavSnapshot>): {
|
|
129
131
|
changed: Set<object>;
|
|
130
132
|
entered: FlowState[];
|
|
131
133
|
};
|
|
132
|
-
/** Entry lifecycle
|
|
134
|
+
/** Entry lifecycle of the current step (used by persist after hydration). */
|
|
133
135
|
export declare function runFlowEntryLifecycle(kernel: Kernel, flowState: FlowState): void;
|
|
134
136
|
export {};
|
|
135
137
|
//# sourceMappingURL=flowNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowNavigation.d.ts","sourceRoot":"","sources":["../../../store/flow/flowNavigation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAIjC,
|
|
1
|
+
{"version":3,"file":"flowNavigation.d.ts","sourceRoot":"","sources":["../../../store/flow/flowNavigation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAIjC,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAKhF;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,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