@azx-pbc/axiom-react 0.0.0-stage → 0.0.6

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.
Files changed (191) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +604 -2
  3. package/dist/FormErrorBoundary.d.ts +37 -0
  4. package/dist/FormErrorBoundary.d.ts.map +1 -0
  5. package/dist/FormErrorBoundary.js +54 -0
  6. package/dist/FormErrorBoundary.js.map +1 -0
  7. package/dist/FormProvider.d.ts +197 -0
  8. package/dist/FormProvider.d.ts.map +1 -0
  9. package/dist/FormProvider.js +149 -0
  10. package/dist/FormProvider.js.map +1 -0
  11. package/dist/field-error.d.ts +154 -0
  12. package/dist/field-error.d.ts.map +1 -0
  13. package/dist/field-error.js +2 -0
  14. package/dist/field-error.js.map +1 -0
  15. package/dist/field-props.d.ts +362 -0
  16. package/dist/field-props.d.ts.map +1 -0
  17. package/dist/field-props.js +64 -0
  18. package/dist/field-props.js.map +1 -0
  19. package/dist/form-context.d.ts +31 -0
  20. package/dist/form-context.d.ts.map +1 -0
  21. package/dist/form-context.js +13 -0
  22. package/dist/form-context.js.map +1 -0
  23. package/dist/form-store.d.ts +784 -0
  24. package/dist/form-store.d.ts.map +1 -0
  25. package/dist/form-store.js +2179 -0
  26. package/dist/form-store.js.map +1 -0
  27. package/dist/hints.d.ts +60 -0
  28. package/dist/hints.d.ts.map +1 -0
  29. package/dist/hints.js +158 -0
  30. package/dist/hints.js.map +1 -0
  31. package/dist/index.d.ts +57 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +36 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/render/field-value.d.ts +92 -0
  36. package/dist/render/field-value.d.ts.map +1 -0
  37. package/dist/render/field-value.js +124 -0
  38. package/dist/render/field-value.js.map +1 -0
  39. package/dist/render/nodes.d.ts +303 -0
  40. package/dist/render/nodes.d.ts.map +1 -0
  41. package/dist/render/nodes.js +325 -0
  42. package/dist/render/nodes.js.map +1 -0
  43. package/dist/render/schema.d.ts +30 -0
  44. package/dist/render/schema.d.ts.map +1 -0
  45. package/dist/render/schema.js +40 -0
  46. package/dist/render/schema.js.map +1 -0
  47. package/dist/render/value-text.d.ts +59 -0
  48. package/dist/render/value-text.d.ts.map +1 -0
  49. package/dist/render/value-text.js +104 -0
  50. package/dist/render/value-text.js.map +1 -0
  51. package/dist/store/array-bindings.d.ts +110 -0
  52. package/dist/store/array-bindings.d.ts.map +1 -0
  53. package/dist/store/array-bindings.js +181 -0
  54. package/dist/store/array-bindings.js.map +1 -0
  55. package/dist/store/bindings.d.ts +12 -0
  56. package/dist/store/bindings.d.ts.map +1 -0
  57. package/dist/store/bindings.js +16 -0
  58. package/dist/store/bindings.js.map +1 -0
  59. package/dist/store/buffer-state.d.ts +42 -0
  60. package/dist/store/buffer-state.d.ts.map +1 -0
  61. package/dist/store/buffer-state.js +51 -0
  62. package/dist/store/buffer-state.js.map +1 -0
  63. package/dist/store/configure.d.ts +19 -0
  64. package/dist/store/configure.d.ts.map +1 -0
  65. package/dist/store/configure.js +28 -0
  66. package/dist/store/configure.js.map +1 -0
  67. package/dist/store/derive.d.ts +106 -0
  68. package/dist/store/derive.d.ts.map +1 -0
  69. package/dist/store/derive.js +417 -0
  70. package/dist/store/derive.js.map +1 -0
  71. package/dist/store/errors.d.ts +20 -0
  72. package/dist/store/errors.d.ts.map +1 -0
  73. package/dist/store/errors.js +101 -0
  74. package/dist/store/errors.js.map +1 -0
  75. package/dist/store/fields.d.ts +35 -0
  76. package/dist/store/fields.d.ts.map +1 -0
  77. package/dist/store/fields.js +81 -0
  78. package/dist/store/fields.js.map +1 -0
  79. package/dist/store/form-channel.d.ts +174 -0
  80. package/dist/store/form-channel.d.ts.map +1 -0
  81. package/dist/store/form-channel.js +411 -0
  82. package/dist/store/form-channel.js.map +1 -0
  83. package/dist/store/gates.d.ts +22 -0
  84. package/dist/store/gates.d.ts.map +1 -0
  85. package/dist/store/gates.js +44 -0
  86. package/dist/store/gates.js.map +1 -0
  87. package/dist/store/ids.d.ts +20 -0
  88. package/dist/store/ids.d.ts.map +1 -0
  89. package/dist/store/ids.js +28 -0
  90. package/dist/store/ids.js.map +1 -0
  91. package/dist/store/inputs.d.ts +114 -0
  92. package/dist/store/inputs.d.ts.map +1 -0
  93. package/dist/store/inputs.js +202 -0
  94. package/dist/store/inputs.js.map +1 -0
  95. package/dist/store/layout.d.ts +81 -0
  96. package/dist/store/layout.d.ts.map +1 -0
  97. package/dist/store/layout.js +285 -0
  98. package/dist/store/layout.js.map +1 -0
  99. package/dist/store/messages.d.ts +56 -0
  100. package/dist/store/messages.d.ts.map +1 -0
  101. package/dist/store/messages.js +157 -0
  102. package/dist/store/messages.js.map +1 -0
  103. package/dist/store/option-pages.d.ts +193 -0
  104. package/dist/store/option-pages.d.ts.map +1 -0
  105. package/dist/store/option-pages.js +598 -0
  106. package/dist/store/option-pages.js.map +1 -0
  107. package/dist/store/parse-print.d.ts +105 -0
  108. package/dist/store/parse-print.d.ts.map +1 -0
  109. package/dist/store/parse-print.js +415 -0
  110. package/dist/store/parse-print.js.map +1 -0
  111. package/dist/store/proposals.d.ts +114 -0
  112. package/dist/store/proposals.d.ts.map +1 -0
  113. package/dist/store/proposals.js +90 -0
  114. package/dist/store/proposals.js.map +1 -0
  115. package/dist/store/publish.d.ts +48 -0
  116. package/dist/store/publish.d.ts.map +1 -0
  117. package/dist/store/publish.js +96 -0
  118. package/dist/store/publish.js.map +1 -0
  119. package/dist/store/snapshots.d.ts +63 -0
  120. package/dist/store/snapshots.d.ts.map +1 -0
  121. package/dist/store/snapshots.js +154 -0
  122. package/dist/store/snapshots.js.map +1 -0
  123. package/dist/store/steps.d.ts +13 -0
  124. package/dist/store/steps.d.ts.map +1 -0
  125. package/dist/store/steps.js +31 -0
  126. package/dist/store/steps.js.map +1 -0
  127. package/dist/store/view.d.ts +124 -0
  128. package/dist/store/view.d.ts.map +1 -0
  129. package/dist/store/view.js +301 -0
  130. package/dist/store/view.js.map +1 -0
  131. package/dist/store/visibility.d.ts +68 -0
  132. package/dist/store/visibility.d.ts.map +1 -0
  133. package/dist/store/visibility.js +231 -0
  134. package/dist/store/visibility.js.map +1 -0
  135. package/dist/store/wizard-cursor.d.ts +43 -0
  136. package/dist/store/wizard-cursor.d.ts.map +1 -0
  137. package/dist/store/wizard-cursor.js +67 -0
  138. package/dist/store/wizard-cursor.js.map +1 -0
  139. package/dist/store/writes.d.ts +50 -0
  140. package/dist/store/writes.d.ts.map +1 -0
  141. package/dist/store/writes.js +91 -0
  142. package/dist/store/writes.js.map +1 -0
  143. package/dist/typed.d.ts +134 -0
  144. package/dist/typed.d.ts.map +1 -0
  145. package/dist/typed.js +74 -0
  146. package/dist/typed.js.map +1 -0
  147. package/dist/useAsyncOptions.d.ts +20 -0
  148. package/dist/useAsyncOptions.d.ts.map +1 -0
  149. package/dist/useAsyncOptions.js +70 -0
  150. package/dist/useAsyncOptions.js.map +1 -0
  151. package/dist/useBufferedInput.d.ts +69 -0
  152. package/dist/useBufferedInput.d.ts.map +1 -0
  153. package/dist/useBufferedInput.js +132 -0
  154. package/dist/useBufferedInput.js.map +1 -0
  155. package/dist/useField.d.ts +42 -0
  156. package/dist/useField.d.ts.map +1 -0
  157. package/dist/useField.js +63 -0
  158. package/dist/useField.js.map +1 -0
  159. package/dist/useFieldArray.d.ts +25 -0
  160. package/dist/useFieldArray.d.ts.map +1 -0
  161. package/dist/useFieldArray.js +18 -0
  162. package/dist/useFieldArray.js.map +1 -0
  163. package/dist/useForm.d.ts +20 -0
  164. package/dist/useForm.d.ts.map +1 -0
  165. package/dist/useForm.js +9 -0
  166. package/dist/useForm.js.map +1 -0
  167. package/dist/useFormState.d.ts +23 -0
  168. package/dist/useFormState.d.ts.map +1 -0
  169. package/dist/useFormState.js +11 -0
  170. package/dist/useFormState.js.map +1 -0
  171. package/dist/useGate.d.ts +15 -0
  172. package/dist/useGate.d.ts.map +1 -0
  173. package/dist/useGate.js +21 -0
  174. package/dist/useGate.js.map +1 -0
  175. package/dist/useLayout.d.ts +29 -0
  176. package/dist/useLayout.d.ts.map +1 -0
  177. package/dist/useLayout.js +59 -0
  178. package/dist/useLayout.js.map +1 -0
  179. package/dist/useMessage.d.ts +58 -0
  180. package/dist/useMessage.d.ts.map +1 -0
  181. package/dist/useMessage.js +62 -0
  182. package/dist/useMessage.js.map +1 -0
  183. package/dist/useWatch.d.ts +19 -0
  184. package/dist/useWatch.d.ts.map +1 -0
  185. package/dist/useWatch.js +17 -0
  186. package/dist/useWatch.js.map +1 -0
  187. package/dist/useWizard.d.ts +166 -0
  188. package/dist/useWizard.d.ts.map +1 -0
  189. package/dist/useWizard.js +554 -0
  190. package/dist/useWizard.js.map +1 -0
  191. package/package.json +62 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWizard.js","sourceRoot":"","sources":["../src/useWizard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAUpE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA+E3C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS,CAAC,aAAsB;IAC9C,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,MAAM,EA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I,EAAE;YAAE,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9F,CAAC,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4EAA4E;AAC5E,SAAS,iBAAiB,CAAC,IAAoB,EAAE,KAAgC;IAC/E,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpB,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ;YACX,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;gBAAE,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACnE,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO;QACT;YACE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC","sourcesContent":["import { useCallback, useLayoutEffect, useSyncExternalStore } from 'react';\nimport { assertNever, sameWireValue } from '@azx-pbc/axiom-runtime';\nimport type {\n CompiledSchema,\n FormBlocker,\n LayoutNodeView,\n LayoutStepView,\n WireValue,\n} from '@azx-pbc/axiom-runtime';\nimport type { FormCandidate, FormStore, FormSummary } from './form-store.js';\nimport type { GateView } from './store/gates.js';\nimport { sameMediaLimit, sameSuggestions, sameWireParams } from './store/derive.js';\nimport { fieldFacts } from './store/fields.js';\nimport { findStepView, wizardSteps } from './store/layout.js';\nimport { nextVisibleStepId, previousVisibleStepId } from './store/steps.js';\nimport { visitedWith } from './store/wizard-cursor.js';\nimport { useFormSession } from './useField.js';\nimport { useLayout } from './useLayout.js';\n\n/**\n * How one checkpoint reads in the wizard bar.\n *\n * `current` is the cursor's own page and outranks the others: the page a reader is on is the\n * current one even while it still needs repair, and `problemCount` states that repair. A page\n * that is not current is `blocked` while any visible field it places has a readiness reason,\n * `complete` once the reader has been there and it is clean, and `unvisited` before then.\n */\nexport type StepStatus = 'complete' | 'current' | 'unvisited' | 'blocked';\n\n/** One visible step as the checkpoint bar reads it, in presentation order. */\nexport interface WizardStep {\n readonly stepId: string;\n /** The message key the step's title is written under. */\n readonly titleKey: string;\n /** Position among the visible steps; zero based. */\n readonly index: number;\n readonly status: StepStatus;\n /**\n * How many reasons stand in the way of this page: the readiness blockers whose field this\n * step places, plus the failing items of the gate the step itself declares. A hidden step and\n * a hidden field contribute none.\n */\n readonly problemCount: number;\n}\n\n/**\n * One reason the current page cannot be left.\n *\n * A field problem wraps the same `StepBlocker` `useStep` publishes, so a footer cannot state a\n * count the checkpoint bar disagrees with. A gate problem is the step's own gate, which names\n * no field and therefore never appears in a field's list.\n */\nexport type WizardProblem =\n | { readonly kind: 'field'; readonly blocker: StepBlocker }\n | {\n readonly kind: 'gate';\n readonly gateId: string;\n readonly itemId: string;\n readonly messageKey: string;\n readonly params?: Readonly<Record<string, WireValue>>;\n };\n\n/** A branching flow's cursor, its checkpoints, and the pure moves a host may ask of it. */\nexport interface Wizard {\n /** Every step id in authored order, hidden ones included. */\n readonly stepIds: readonly string[];\n /** The steps a predicate or gate currently shows, in order. */\n readonly visibleStepIds: readonly string[];\n /** The visible checkpoints, with their derived status and problem count. */\n readonly steps: readonly WizardStep[];\n /** The cursor: the step the host asked for, or the first visible one before it is placed. */\n readonly stepId: string | undefined;\n /**\n * Whether the cursor may leave its page.\n *\n * It answers only for the current page: a reader who went back to a clean page may go forward\n * again even when a later page is still untouched. A cursored page with no visible step at all\n * cannot advance.\n */\n readonly canAdvance: boolean;\n /** The reasons the current page blocks, in summary order; empty when `canAdvance`. */\n readonly blockedBy: readonly WizardProblem[];\n readonly setStepId: (stepId: string) => void;\n /**\n * Moves to the first visible step after the cursor, and refuses without throwing when\n * `canAdvance` is false. A refusal is user intent, not a programmer error.\n */\n readonly next: () => void;\n /** Moves to the first visible step before the cursor. */\n readonly previous: () => void;\n /** Where `next` would land from `from`, without moving. */\n readonly nextVisibleStepId: (from: string) => string | undefined;\n /** Where `previous` would land from `from`, without moving. */\n readonly previousVisibleStepId: (from: string) => string | undefined;\n}\n\n/**\n * A wizard's cursor and its checkpoints, host-owned: the engine holds no step state.\n *\n * The cursor changes only through the returned setter (which `next` and `previous` use), so a\n * value edit can never move the user to another page. Hidden steps are skipped in both\n * directions: with the middle step hidden, next from step one is step three and previous from\n * step three is step one.\n *\n * A step that becomes hidden after the cursor was placed on it is not rendered: the published\n * cursor reconciles to the nearest visible step (the next one, then the previous, then the\n * first) so a host never renders a blank page. `setStepId` refuses an id the artifact does not\n * declare, and accepts a declared-but-hidden one, which the same reconciliation then moves.\n *\n * The checkpoint facts are derived from the same summary `useFormState` publishes and the same\n * `useStep` blocker filter, so the bar, the footer and the form-level readiness cannot disagree.\n * \"Visited\" is the session's own history: a step becomes visited when the cursor lands on it,\n * which is why a clean page reads `complete` after the reader leaves it and not before.\n */\nexport function useWizard(initialStepId?: string): Wizard {\n const views = useLayout();\n const { store, candidate, wizard: cursor } = useFormSession('useWizard');\n // One session cursor, read through the store subscription: every `useWizard` caller in this\n // provider sees the same step and the same visited history, and a move from one moves both.\n const { chosen, visited } = useSyncExternalStore(\n cursor.subscribe,\n cursor.getSnapshot,\n cursor.getSnapshot,\n );\n const steps = wizardSteps(views);\n const stepIds = steps.map((step) => step.stepId);\n const visible = new Set(steps.filter((step) => step.visible).map((step) => step.stepId));\n const visibleSteps = steps.filter((step) => step.visible);\n const visibleStepIds = visibleSteps.map((step) => step.stepId);\n const canSeed = initialStepId !== undefined && stepIds.includes(initialStepId);\n // Seed the shared session cursor once in a layout effect so render stays pure and every\n // `useWizard` caller in the provider observes the same starting step before paint.\n useLayoutEffect(() => {\n if (canSeed && initialStepId !== undefined) cursor.seed(initialStepId);\n }, [cursor, canSeed, initialStepId]);\n // Before the layout effect seeds the shared cursor (including during SSR where layout effects\n // do not run), fall back to this caller's declared starting step so server HTML renders the\n // requested page. Once the cursor is seeded (at provider mount via `initialStepId` or after a\n // move), `chosen` is defined and every caller under one provider reads the same session step.\n const chosenStep = chosen !== undefined && stepIds.includes(chosen) ? chosen : undefined;\n const stepId = cursorOf(\n chosenStep ?? (canSeed ? initialStepId : undefined),\n stepIds,\n visible,\n visibleStepIds,\n );\n const facts = useCheckpointFacts(store, candidate, stepId, visibleSteps);\n const currentFacts = facts.steps.find((step) => step.stepId === stepId);\n const blockedBy: readonly WizardProblem[] = Object.freeze([\n ...(currentFacts?.blockers ?? NO_BLOCKERS).map(\n (blocker): WizardProblem => Object.freeze({ kind: 'field', blocker }),\n ),\n ...gateProblemsOf(currentFacts?.gate),\n ]);\n const canAdvance = currentFacts !== undefined && blockedBy.length === 0;\n\n const checkpoints: readonly WizardStep[] = Object.freeze(\n visibleSteps.map((step, index) => {\n const stepFacts = facts.steps[index];\n const problems =\n stepFacts === undefined ? 0 : stepFacts.blockers.length + gateProblemCount(stepFacts.gate);\n // The cursor's page outranks every other answer. A page the reader has not reached is\n // unvisited even when its required fields are still empty: a checkpoint must not accuse a\n // page nobody has been shown. Once visited, a remaining reason makes it blocked.\n const status: StepStatus =\n step.stepId === stepId\n ? 'current'\n : !visited.has(step.stepId)\n ? 'unvisited'\n : problems > 0\n ? 'blocked'\n : 'complete';\n return Object.freeze({\n stepId: step.stepId,\n titleKey: step.titleKey,\n index,\n status,\n problemCount: problems,\n });\n }),\n );\n\n const setStepId = (next: string): void => {\n if (!steps.some((step) => step.stepId === next)) {\n throw new Error(\n `@azx-pbc/axiom-react: wizard step ${JSON.stringify(next)} is not declared by the layout`,\n );\n }\n cursor.update((state) => {\n const from =\n state.chosen === undefined\n ? stepId\n : cursorOf(state.chosen, stepIds, visible, visibleStepIds);\n const landed = cursorOf(next, stepIds, visible, visibleStepIds);\n return {\n chosen: next,\n visited: visitedWith(visitedWith(state.visited, from), landed),\n };\n });\n };\n return {\n stepIds,\n visibleStepIds,\n steps: checkpoints,\n stepId,\n canAdvance,\n blockedBy,\n setStepId,\n next: () => {\n // A move from a page that is not clean is refused, not thrown: a Next press is user\n // intent, and the host states the reason. The move itself is computed from the cursor the\n // state holds, so two calls in one handler advance twice rather than both reading the step\n // this render started on. A move that lands nowhere leaves the cursor where it is: the\n // last step has nowhere to go, and clearing it would place the user back on the first step.\n if (!canAdvance) return;\n cursor.update((state) => {\n const from =\n (state.chosen === undefined\n ? stepId\n : cursorOf(state.chosen, stepIds, visible, visibleStepIds)) ?? visibleStepIds[0];\n if (from === undefined) return state;\n const to = nextVisibleStepId(stepIds, visible, from) ?? from;\n // The page being left and the page being reached are both in the reader's history. A\n // hidden page is never either one, so it cannot become `complete` by being skipped.\n return { chosen: to, visited: visitedWith(visitedWith(state.visited, from), to) };\n });\n },\n previous: () => {\n cursor.update((state) => {\n const from =\n state.chosen === undefined\n ? stepId\n : cursorOf(state.chosen, stepIds, visible, visibleStepIds);\n if (from === undefined) return state;\n const to = previousVisibleStepId(stepIds, visible, from) ?? from;\n return { chosen: to, visited: visitedWith(visitedWith(state.visited, from), to) };\n });\n },\n nextVisibleStepId: (from) => nextVisibleStepId(stepIds, visible, from),\n previousVisibleStepId: (from) => previousVisibleStepId(stepIds, visible, from),\n };\n}\n\n/** One step's published facts: the blockers it owns and the gate it declares, by identity. */\ninterface StepFacts {\n readonly stepId: string;\n readonly blockers: readonly StepBlocker[];\n readonly gate: GateView | undefined;\n}\n\n/** The facts a checkpoint movement depends on, identity-stable across unrelated publishes. */\ninterface CheckpointFacts {\n readonly steps: readonly StepFacts[];\n readonly canAdvance: boolean;\n}\n\ninterface CheckpointCache {\n readonly facts: CheckpointFacts;\n}\n\n/**\n * The per-store cache one wizard's checkpoints read.\n *\n * `useSyncExternalStore` compares by identity, so a publish that moved no checkpoint fact must\n * return the object the previous render held. The key is the visible step sequence; a layout\n * change therefore starts a fresh answer while an edit to another page reuses this one.\n */\nconst CHECKPOINT_FACTS = new WeakMap<FormStore, Map<string, CheckpointCache>>();\n\n/**\n * Subscribes one wizard to the form channel and publishes only the facts a checkpoint can move.\n *\n * A keystroke that changes a different page's values leaves every step's blockers array and gate\n * view at the same identity (`stepBlockersOf` and `store.gateView` both preserve it), so the\n * snapshot is reused and the consumer does not render. That is the same discipline `useStep`\n * keeps for one step, applied to the whole sequence without calling a hook per step.\n */\nfunction useCheckpointFacts(\n store: FormStore,\n candidate: FormCandidate,\n stepId: string | undefined,\n visibleSteps: readonly LayoutStepView[],\n): CheckpointFacts {\n const subscribe = useCallback(\n (onStoreChange: () => void): (() => void) => store.subscribeForm(onStoreChange),\n [store],\n );\n const key = `${stepId ?? ''}|${visibleSteps.map((step) => step.stepId).join(',')}`;\n const getSnapshot = useCallback(\n (): CheckpointFacts => checkpointFactsOf(store, candidate, visibleSteps, key, stepId),\n [store, candidate, visibleSteps, key, stepId],\n );\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n}\n\n/** One render's checkpoint answer, reusing the previous object when no step fact moved. */\nfunction checkpointFactsOf(\n store: FormStore,\n candidate: FormCandidate,\n visibleSteps: readonly LayoutStepView[],\n key: string,\n stepId: string | undefined,\n): CheckpointFacts {\n const current = store.isCurrentCandidate(candidate) ? candidate : undefined;\n const summary =\n current === undefined ? store.getFormSummary() : store.getCandidateFormSummary(current);\n const steps = visibleSteps.map(\n (step): StepFacts =>\n Object.freeze({\n stepId: step.stepId,\n blockers: stepBlockersOf(store, step, summary),\n gate: step.gateId === undefined ? undefined : store.gateView(current, step.gateId),\n }),\n );\n const currentFacts = steps.find((step) => step.stepId === stepId);\n const canAdvance =\n currentFacts !== undefined &&\n currentFacts.blockers.length === 0 &&\n gateProblemCount(currentFacts.gate) === 0;\n let byKey = CHECKPOINT_FACTS.get(store);\n if (byKey === undefined) {\n byKey = new Map();\n CHECKPOINT_FACTS.set(store, byKey);\n }\n const previous = byKey.get(key);\n if (\n previous !== undefined &&\n previous.facts.steps.length === steps.length &&\n previous.facts.steps.every((step, index) => {\n const next = steps[index];\n return (\n next !== undefined &&\n step.stepId === next.stepId &&\n step.blockers === next.blockers &&\n step.gate === next.gate\n );\n }) &&\n previous.facts.canAdvance === canAdvance\n ) {\n return previous.facts;\n }\n const facts: CheckpointFacts = Object.freeze({\n steps: Object.freeze(steps),\n canAdvance,\n });\n byKey.set(key, { facts });\n return facts;\n}\n\nconst NO_GATE_PROBLEMS: readonly WizardProblem[] = Object.freeze([]);\n\n/** How many reasons a step's own gate states; an open or absent gate states none. */\nfunction gateProblemCount(gate: GateView | undefined): number {\n if (gate === undefined || gate.open) return 0;\n const failed = gate.items.filter((item) => item.status === 'FAIL').length;\n return failed === 0 ? 1 : failed;\n}\n\n/**\n * A step's own gate as reasons.\n *\n * A gate names no field, so it can never be one of a step's `StepBlocker`s; a step that declares\n * the gate still owns its verdict. An open gate states nothing. A closed gate states each item\n * that failed, and a closed gate with no failed item (an active gate the engine refused) states\n * one reason under the gate's own id rather than reporting a block with no cause.\n */\nfunction gateProblemsOf(gate: GateView | undefined): readonly WizardProblem[] {\n if (gate === undefined || gate.open) return NO_GATE_PROBLEMS;\n const failed = gate.items.filter((item) => item.status === 'FAIL');\n if (failed.length === 0) {\n return Object.freeze([\n Object.freeze({\n kind: 'gate' as const,\n gateId: gate.gateId,\n itemId: gate.gateId,\n messageKey: gate.gateId,\n }),\n ]);\n }\n return Object.freeze(\n failed.map((item) =>\n Object.freeze({\n kind: 'gate' as const,\n gateId: gate.gateId,\n itemId: item.itemId,\n messageKey: item.messageKey,\n ...(item.params === undefined ? {} : { params: item.params }),\n }),\n ),\n );\n}\n\n/**\n * The published cursor: the chosen step when it still shows, else the nearest visible one.\n *\n * A hidden cursor moves forward first, so the flow continues where it was heading; a hidden\n * last step falls back to the step before it, and a cursor that names no declared step starts\n * from the first visible one.\n */\nfunction cursorOf(\n chosen: string | undefined,\n stepIds: readonly string[],\n visible: ReadonlySet<string>,\n visibleStepIds: readonly string[],\n): string | undefined {\n const first = visibleStepIds[0];\n if (chosen === undefined) return first;\n if (visible.has(chosen)) return chosen;\n if (!stepIds.includes(chosen)) return first;\n return (\n nextVisibleStepId(stepIds, visible, chosen) ??\n previousVisibleStepId(stepIds, visible, chosen) ??\n first\n );\n}\n\n/**\n * A blocking reason the summary states against a field this step places.\n *\n * It is the summary's own entry, narrowed to the kinds that name a field: `gate` items,\n * `screen` failures and a record-scope rule that names no field are the form's reasons, not a\n * page's, so a step never claims them. Item and row failures keep the member's `fieldId` and\n * the row's key, exactly as `useFormState().blockers` states them; `messageKey` is the sentence\n * the host already renders, absent only where the artifact declared none (a cardinality\n * refusal, or a `required` rule that left the sentence to the host).\n */\nexport type StepBlocker = Extract<\n FormBlocker,\n | { readonly kind: 'rule' }\n | { readonly kind: 'required' }\n | { readonly kind: 'cardinality' }\n | { readonly kind: 'media' }\n | { readonly kind: 'rowCount' }\n | { readonly kind: 'invalidOption' }\n | { readonly kind: 'unavailableOption' }\n> & { readonly fieldId: string };\n\n/** One step's own facts: where it sits, whether it shows, and what stands in its way. */\nexport interface StepState {\n readonly stepId: string;\n readonly visible: boolean;\n /** Position in authored order; `-1` for a step the artifact does not declare. */\n readonly index: number;\n readonly gateId: string | undefined;\n readonly gate: GateView | undefined;\n /**\n * The summary's blocking reasons whose field this step places.\n *\n * A field counts as placed when the step places it, its array container or a record that\n * holds it, so a row member's failure belongs to the page an adopter actually painted. A\n * hidden step states none: nothing on it is a page the user can complete.\n */\n readonly blockers: readonly StepBlocker[];\n /**\n * Whether the current page may be left: no field blocker here, and the step's own gate — when\n * it declares one — is not blocking. A step that declares no gate is judged by its fields\n * alone; the primary gate is never borrowed. A hidden step is never ready. This is a\n * navigation answer from the summary's local readiness, not the submission verdict the server\n * re-derives.\n */\n readonly ready: boolean;\n}\n\nconst NO_BLOCKERS: readonly StepBlocker[] = Object.freeze([]);\n\n/**\n * One wizard step, by the id the layout states.\n *\n * `blockers` and `ready` are derived from the same summary `useFormState` publishes and the\n * same gate `useGate` presents, so a page cannot disagree with the form-level badge: the list\n * is `summary.blockers` filtered by the fields this step's subtree places, never a second\n * readiness rule. The placement is static per artifact, so it is read once; the filter walks\n * only the fields in this step, and the per-summary index and per-step answer are memoised\n * against the summary object, so an unrelated keystroke costs no scan and a publish that moved\n * no summary fact reuses both.\n *\n * The gate is read from the same derived state `useGate` presents, so a step's gate and the\n * form-level badge cannot disagree. The step's own visibility is the presentation channel's\n * answer: a hidden step is skipped by the wizard's moves and never rendered by a host that\n * checks it, and a hidden page reports `ready: false` with no blockers because there is no\n * page to leave.\n */\nexport function useStep(stepId: string): StepState {\n const views = useLayout();\n const { store, candidate } = useFormSession('useStep');\n const steps = wizardSteps(views);\n const index = steps.findIndex((step) => step.stepId === stepId);\n const step = findStepView(views, stepId);\n const gateId = step?.gateId;\n const visible = step?.visible ?? false;\n const subscribe = useCallback(\n (onStoreChange: () => void): (() => void) => store.subscribeLayout(onStoreChange),\n [store],\n );\n const getSnapshot = useCallback(\n (): StepSnapshot => snapshotOf(store, candidate, stepId, step, visible, gateId),\n [store, candidate, stepId, step, visible, gateId],\n );\n const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n return {\n stepId,\n visible,\n index,\n gateId,\n gate: snapshot.gate,\n blockers: snapshot.blockers,\n ready: snapshot.ready,\n };\n}\n\n/** What one step's subscription publishes: the facts that can move its answer. */\ninterface StepSnapshot {\n readonly gate: GateView | undefined;\n readonly blockers: readonly StepBlocker[];\n readonly ready: boolean;\n readonly visible: boolean;\n}\n\n/** The last snapshot of one step, so a publish that moved nothing it states reuses it. */\ninterface SnapshotCache {\n readonly blockers: readonly StepBlocker[];\n readonly gate: GateView | undefined;\n readonly visible: boolean;\n readonly ready: boolean;\n readonly snapshot: StepSnapshot;\n}\n\nconst STEP_SNAPSHOTS = new WeakMap<FormStore, Map<string, SnapshotCache>>();\n\n/**\n * One step's published answer, reading the summary and gate from the store the way\n * `useFormState` and `useGate` do.\n *\n * `useSyncExternalStore` compares by identity, so a publish that moved neither this step's\n * blockers nor its gate returns the object the previous render already held; the component is\n * not rendered again, exactly as the layout channel keeps its identity across an edit it does\n * not read. The blockers array is itself borrowed from the previous summary when it states the\n * same reasons, so an edit that changes another page's blockers cannot re-render this one.\n */\nfunction snapshotOf(\n store: FormStore,\n candidate: FormCandidate,\n stepId: string,\n step: LayoutStepView | undefined,\n visible: boolean,\n gateId: string | undefined,\n): StepSnapshot {\n const current = store.isCurrentCandidate(candidate) ? candidate : undefined;\n const summary =\n current === undefined ? store.getFormSummary() : store.getCandidateFormSummary(current);\n const gate = gateId === undefined ? undefined : store.gateView(current, gateId);\n const blockers =\n visible && step !== undefined ? stepBlockersOf(store, step, summary) : NO_BLOCKERS;\n const ready = visible && blockers.length === 0 && (gate === undefined || gate.open);\n let byStep = STEP_SNAPSHOTS.get(store);\n if (byStep === undefined) {\n byStep = new Map();\n STEP_SNAPSHOTS.set(store, byStep);\n }\n const previous = byStep.get(stepId);\n if (\n previous !== undefined &&\n previous.blockers === blockers &&\n previous.gate === gate &&\n previous.visible === visible &&\n previous.ready === ready\n ) {\n return previous.snapshot;\n }\n const snapshot: StepSnapshot = Object.freeze({ gate, blockers, ready, visible });\n byStep.set(stepId, { blockers, gate, visible, ready, snapshot });\n return snapshot;\n}\n\n/** A blocker with the summary position it held, so a step's list keeps the summary's order. */\ninterface IndexedStepBlocker {\n readonly blocker: StepBlocker;\n readonly order: number;\n}\n\n/**\n * The static field set of each step, keyed by artifact and step id.\n *\n * Placement is a declaration fact, not a per-pass answer: `visibleWhen` moves a step's chrome,\n * never which fields it holds. The set therefore lives as long as the compiled artifact.\n */\nconst PLACED_FIELDS = new WeakMap<CompiledSchema, Map<string, readonly string[]>>();\n\n/** One summary's blockers grouped by field, built once per summary rather than once per step. */\nconst BLOCKER_INDEX = new WeakMap<\n FormSummary,\n ReadonlyMap<string, readonly IndexedStepBlocker[]>\n>();\n\n/** The per-step answer, so a step re-read during a render does not filter again. */\nconst STEP_BLOCKERS = new WeakMap<\n FormStore,\n WeakMap<FormSummary, Map<string, readonly StepBlocker[]>>\n>();\n\n/**\n * The last answer each step stated, so a new summary that repeats it keeps the same array.\n *\n * `buildFormSummary` copies its blocker entries, so two summaries that state the same reasons\n * hold different objects. Comparing the reasons here is what lets `useSyncExternalStore` see one\n * answer: an edit on another page then leaves this step unrendered.\n */\nconst LAST_STEP_BLOCKERS = new WeakMap<FormStore, Map<string, readonly StepBlocker[]>>();\n\n/**\n * The summary entries whose field this step places.\n *\n * The step's placed leaves are expanded through their declarations, so a member of a placed\n * array or record is attributed to the page that painted the container. The index is built\n * once per summary; this then reads only the fields this step holds, in summary order.\n */\nfunction stepBlockersOf(\n store: FormStore,\n step: LayoutStepView,\n summary: FormSummary,\n): readonly StepBlocker[] {\n let bySummary = STEP_BLOCKERS.get(store);\n if (bySummary === undefined) {\n bySummary = new WeakMap();\n STEP_BLOCKERS.set(store, bySummary);\n }\n let byStep = bySummary.get(summary);\n if (byStep === undefined) {\n byStep = new Map();\n bySummary.set(summary, byStep);\n }\n const cached = byStep.get(step.stepId);\n if (cached !== undefined) return cached;\n const index = blockerIndex(summary);\n const collected: IndexedStepBlocker[] = [];\n for (const fieldId of placedFieldIds(store.compiled, step)) {\n const entries = index.get(fieldId);\n if (entries === undefined) continue;\n for (const entry of entries) collected.push(entry);\n }\n collected.sort((left, right) => left.order - right.order);\n const next = collected.map((entry) => entry.blocker);\n const last = lastBlockersOf(store);\n const previous = last.get(step.stepId);\n const blockers: readonly StepBlocker[] =\n previous !== undefined && sameStepBlockers(previous, next) ? previous : Object.freeze(next);\n last.set(step.stepId, blockers);\n byStep.set(step.stepId, blockers);\n return blockers;\n}\n\nfunction lastBlockersOf(store: FormStore): Map<string, readonly StepBlocker[]> {\n const cached = LAST_STEP_BLOCKERS.get(store);\n if (cached !== undefined) return cached;\n const created = new Map<string, readonly StepBlocker[]>();\n LAST_STEP_BLOCKERS.set(store, created);\n return created;\n}\n\n/** Whether two step blocker lists state the same reasons, so a new summary may reuse the array. */\nfunction sameStepBlockers(left: readonly StepBlocker[], right: readonly StepBlocker[]): boolean {\n return (\n left.length === right.length &&\n left.every((blocker, index) => {\n const other = right[index];\n return other !== undefined && sameStepBlocker(blocker, other);\n })\n );\n}\n\nfunction sameStepBlocker(left: StepBlocker, right: StepBlocker): boolean {\n if (left.kind !== right.kind) return false;\n switch (left.kind) {\n case 'rule':\n return (\n right.kind === 'rule' &&\n left.ruleId === right.ruleId &&\n left.fieldId === right.fieldId &&\n left.rowKey === right.rowKey &&\n left.messageKey === right.messageKey &&\n sameWireParams(left.params, right.params) &&\n sameSuggestions(left.suggestions, right.suggestions)\n );\n case 'required':\n return (\n right.kind === 'required' &&\n left.fieldId === right.fieldId &&\n left.rowKey === right.rowKey &&\n left.messageKey === right.messageKey &&\n sameWireParams(left.params, right.params)\n );\n case 'cardinality':\n return (\n right.kind === 'cardinality' &&\n left.fieldId === right.fieldId &&\n left.bound === right.bound &&\n left.count === right.count &&\n left.limit === right.limit\n );\n case 'media':\n return (\n right.kind === 'media' &&\n left.fieldId === right.fieldId &&\n left.member === right.member &&\n left.value === right.value &&\n left.index === right.index &&\n left.rowKey === right.rowKey &&\n sameMediaLimit(left.limit, right.limit)\n );\n case 'rowCount':\n return (\n right.kind === 'rowCount' &&\n left.fieldId === right.fieldId &&\n left.expected === right.expected &&\n left.actual === right.actual &&\n left.source === right.source &&\n left.reason === right.reason &&\n left.ceiling === right.ceiling\n );\n case 'invalidOption':\n return (\n right.kind === 'invalidOption' &&\n left.fieldId === right.fieldId &&\n left.rowKey === right.rowKey &&\n sameWireValue(left.value, right.value)\n );\n case 'unavailableOption':\n return (\n right.kind === 'unavailableOption' &&\n left.fieldId === right.fieldId &&\n left.rowKey === right.rowKey &&\n left.code === right.code &&\n left.messageKey === right.messageKey &&\n sameWireParams(left.params, right.params) &&\n sameSuggestions(left.suggestions, right.suggestions)\n );\n default:\n return assertNever(left);\n }\n}\n\n/** One summary's field-named blockers, in summary order, indexed by the field they name. */\nfunction blockerIndex(summary: FormSummary): ReadonlyMap<string, readonly IndexedStepBlocker[]> {\n const cached = BLOCKER_INDEX.get(summary);\n if (cached !== undefined) return cached;\n const mutable = new Map<string, IndexedStepBlocker[]>();\n for (const [order, blocker] of summary.blockers.entries()) {\n if (!isStepBlocker(blocker)) continue;\n const entries = mutable.get(blocker.fieldId);\n const entry: IndexedStepBlocker = Object.freeze({ blocker, order });\n if (entries === undefined) mutable.set(blocker.fieldId, [entry]);\n else entries.push(entry);\n }\n const index = new Map<string, readonly IndexedStepBlocker[]>();\n for (const [fieldId, entries] of mutable) index.set(fieldId, Object.freeze(entries));\n BLOCKER_INDEX.set(summary, index);\n return index;\n}\n\n/** Whether a summary blocker names the field a step must hold to own it. */\nfunction isStepBlocker(blocker: FormBlocker): blocker is StepBlocker {\n switch (blocker.kind) {\n case 'rule':\n case 'required':\n case 'cardinality':\n case 'scale':\n case 'media':\n case 'rowCount':\n case 'invalidOption':\n case 'unavailableOption':\n return blocker.fieldId !== undefined;\n case 'gate':\n case 'screen':\n return false;\n default:\n return assertNever(blocker);\n }\n}\n\n/**\n * Every field a step places, and every member those declarations hold.\n *\n * The walk is a step's own subtree, so the cost is the step rather than the report.\n */\nfunction placedFieldIds(compiled: CompiledSchema, step: LayoutStepView): readonly string[] {\n let byStep = PLACED_FIELDS.get(compiled);\n if (byStep === undefined) {\n byStep = new Map();\n PLACED_FIELDS.set(compiled, byStep);\n }\n const cached = byStep.get(step.stepId);\n if (cached !== undefined) return cached;\n const facts = fieldFacts(compiled);\n const ids: string[] = [];\n const seen = new Set<string>();\n const addDeclaration = (fieldId: string): void => {\n if (seen.has(fieldId)) return;\n seen.add(fieldId);\n ids.push(fieldId);\n for (const member of facts.get(fieldId)?.field.fields ?? []) addDeclaration(member.fieldId);\n };\n for (const child of step.children) visitPlacedFields(child, addDeclaration);\n const placed = Object.freeze(ids);\n byStep.set(step.stepId, placed);\n return placed;\n}\n\n/** Calls `visit` for every field leaf a layout node places, depth first. */\nfunction visitPlacedFields(node: LayoutNodeView, visit: (fieldId: string) => void): void {\n switch (node.kind) {\n case 'field':\n visit(node.fieldId);\n return;\n case 'section':\n case 'group':\n case 'step':\n case 'wizard':\n for (const child of node.children) visitPlacedFields(child, visit);\n return;\n case 'heading':\n case 'callout':\n case 'divider':\n case 'sop_block':\n case 'summary_card':\n return;\n default:\n return assertNever(node);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,65 @@
1
1
  {
2
2
  "name": "@azx-pbc/axiom-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.6",
4
+ "description": "Headless React 19 bindings over @azx-pbc/axiom-runtime: a form provider and the field, watch, form-state and submit hooks, with no DOM, CSS or UI dependency.",
5
+ "license": "MIT",
6
+ "author": "AZX, PBC",
7
+ "homepage": "https://github.com/AZX-PBC-OSS/axiom",
8
+ "bugs": {
9
+ "url": "https://github.com/AZX-PBC-OSS/axiom/issues"
10
+ },
11
+ "keywords": [
12
+ "axiom",
13
+ "react",
14
+ "react-hooks",
15
+ "headless",
16
+ "forms",
17
+ "validation"
18
+ ],
19
+ "engines": {
20
+ "node": ">=24"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AZX-PBC-OSS/axiom.git",
25
+ "directory": "packages/react"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "provenance": true
30
+ },
31
+ "sideEffects": false,
32
+ "type": "module",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "react-native": "./dist/index.js",
37
+ "browser": "./dist/index.js",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "./package.json": "./package.json"
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "LICENSE"
45
+ ],
46
+ "peerDependencies": {
47
+ "react": "^19.0.0"
48
+ },
49
+ "dependencies": {
50
+ "@azx-pbc/axiom-runtime": "0.0.6"
51
+ },
52
+ "devDependencies": {
53
+ "@babel/core": "8.1.3",
54
+ "@testing-library/react": "16.3.3",
55
+ "@types/react": "19.3.3",
56
+ "@types/react-dom": "19.3.0",
57
+ "babel-plugin-react-compiler": "1.0.0",
58
+ "jsdom": "31.0.1",
59
+ "react-dom": "19.3.1",
60
+ "vitest": "5.1.2"
61
+ },
62
+ "scripts": {
63
+ "check:publish": "publint && attw --pack . --profile esm-only"
64
+ }
6
65
  }