@schema-engine/forms 0.0.0-stage → 0.5.1
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/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.js +50 -0
- package/dist/actions/index.js.map +7 -0
- package/dist/actions/plugins/auto-save.plugin.d.ts +39 -0
- package/dist/actions/plugins/auto-save.plugin.js +10 -0
- package/dist/actions/plugins/auto-save.plugin.js.map +7 -0
- package/dist/actions/plugins/form-reset.plugin.d.ts +23 -0
- package/dist/actions/plugins/form-reset.plugin.js +9 -0
- package/dist/actions/plugins/form-reset.plugin.js.map +7 -0
- package/dist/actions/plugins/form-submit.plugin.d.ts +31 -0
- package/dist/actions/plugins/form-submit.plugin.js +9 -0
- package/dist/actions/plugins/form-submit.plugin.js.map +7 -0
- package/dist/actions/plugins/form-submit.registration.d.ts +22 -0
- package/dist/actions/plugins/form-submit.registration.js +8 -0
- package/dist/actions/plugins/form-submit.registration.js.map +7 -0
- package/dist/actions/plugins/gtm.plugin.d.ts +30 -0
- package/dist/actions/plugins/gtm.plugin.js +8 -0
- package/dist/actions/plugins/gtm.plugin.js.map +7 -0
- package/dist/actions/plugins/index.d.ts +16 -0
- package/dist/actions/plugins/index.js +45 -0
- package/dist/actions/plugins/index.js.map +7 -0
- package/dist/actions/plugins/notification.plugin.d.ts +32 -0
- package/dist/actions/plugins/notification.plugin.js +9 -0
- package/dist/actions/plugins/notification.plugin.js.map +7 -0
- package/dist/actions/plugins/notification.registration.d.ts +22 -0
- package/dist/actions/plugins/notification.registration.js +8 -0
- package/dist/actions/plugins/notification.registration.js.map +7 -0
- package/dist/actions/plugins/registrations.d.ts +17 -0
- package/dist/actions/plugins/registrations.js +14 -0
- package/dist/actions/plugins/registrations.js.map +7 -0
- package/dist/actions/triggers.d.ts +42 -0
- package/dist/actions/triggers.js +6 -0
- package/dist/actions/triggers.js.map +7 -0
- package/dist/actions/types.d.ts +16 -0
- package/dist/actions/types.js +1 -0
- package/dist/actions/types.js.map +7 -0
- package/dist/agent-tool/index.d.ts +54 -0
- package/dist/agent-tool/index.js +128 -0
- package/dist/agent-tool/index.js.map +7 -0
- package/dist/browser/action-registrations.d.ts +46 -0
- package/dist/browser/action-registrations.js +19 -0
- package/dist/browser/action-registrations.js.map +7 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.js +36 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/tools/auto-save-storage.d.ts +20 -0
- package/dist/browser/tools/auto-save-storage.js +12 -0
- package/dist/browser/tools/auto-save-storage.js.map +7 -0
- package/dist/browser/tools/gdpr-consent.d.ts +32 -0
- package/dist/browser/tools/gdpr-consent.js +11 -0
- package/dist/browser/tools/gdpr-consent.js.map +7 -0
- package/dist/browser/tools/gtm-tracker.d.ts +7 -0
- package/dist/browser/tools/gtm-tracker.js +7 -0
- package/dist/browser/tools/gtm-tracker.js.map +7 -0
- package/dist/builder/form-authoring.d.ts +159 -0
- package/dist/builder/form-authoring.js +1 -0
- package/dist/builder/form-authoring.js.map +7 -0
- package/dist/builder/form-values.d.ts +158 -0
- package/dist/builder/form-values.js +0 -0
- package/dist/builder/form-values.js.map +7 -0
- package/dist/builder/index.d.ts +5 -0
- package/dist/builder/index.js +2 -0
- package/dist/builder/index.js.map +7 -0
- package/dist/builder/types.utils.d.ts +137 -0
- package/dist/builder/types.utils.js +1 -0
- package/dist/builder/types.utils.js.map +7 -0
- package/dist/chunk-237BHPDH.js +88 -0
- package/dist/chunk-237BHPDH.js.map +7 -0
- package/dist/chunk-25PLQDKN.js +45 -0
- package/dist/chunk-25PLQDKN.js.map +7 -0
- package/dist/chunk-2XWISGGM.js +8 -0
- package/dist/chunk-2XWISGGM.js.map +7 -0
- package/dist/chunk-2YKQAVI2.js +8 -0
- package/dist/chunk-2YKQAVI2.js.map +7 -0
- package/dist/chunk-3B7CJOF6.js +18 -0
- package/dist/chunk-3B7CJOF6.js.map +7 -0
- package/dist/chunk-3YLRJVVN.js +17 -0
- package/dist/chunk-3YLRJVVN.js.map +7 -0
- package/dist/chunk-4CUGHU36.js +58 -0
- package/dist/chunk-4CUGHU36.js.map +7 -0
- package/dist/chunk-4FELFUCD.js +0 -0
- package/dist/chunk-4FELFUCD.js.map +7 -0
- package/dist/chunk-4XPLSYTK.js +82 -0
- package/dist/chunk-4XPLSYTK.js.map +7 -0
- package/dist/chunk-5Y6U3MR3.js +54 -0
- package/dist/chunk-5Y6U3MR3.js.map +7 -0
- package/dist/chunk-6BAJHAGL.js +29 -0
- package/dist/chunk-6BAJHAGL.js.map +7 -0
- package/dist/chunk-6EYX257T.js +23 -0
- package/dist/chunk-6EYX257T.js.map +7 -0
- package/dist/chunk-6FUGK5HQ.js +26 -0
- package/dist/chunk-6FUGK5HQ.js.map +7 -0
- package/dist/chunk-6IZYNHZ3.js +118 -0
- package/dist/chunk-6IZYNHZ3.js.map +7 -0
- package/dist/chunk-6NV2JDGI.js +8 -0
- package/dist/chunk-6NV2JDGI.js.map +7 -0
- package/dist/chunk-6R2MBQPL.js +19 -0
- package/dist/chunk-6R2MBQPL.js.map +7 -0
- package/dist/chunk-7EQJUI5N.js +40 -0
- package/dist/chunk-7EQJUI5N.js.map +7 -0
- package/dist/chunk-A5VLMQAK.js +2780 -0
- package/dist/chunk-A5VLMQAK.js.map +7 -0
- package/dist/chunk-AUZ45XPE.js +27 -0
- package/dist/chunk-AUZ45XPE.js.map +7 -0
- package/dist/chunk-BIHEIJG3.js +0 -0
- package/dist/chunk-BIHEIJG3.js.map +7 -0
- package/dist/chunk-BKNWW4PK.js +0 -0
- package/dist/chunk-BKNWW4PK.js.map +7 -0
- package/dist/chunk-BLFLCSG3.js +71 -0
- package/dist/chunk-BLFLCSG3.js.map +7 -0
- package/dist/chunk-BYYGAGNH.js +0 -0
- package/dist/chunk-BYYGAGNH.js.map +7 -0
- package/dist/chunk-CANRZY5A.js +87 -0
- package/dist/chunk-CANRZY5A.js.map +7 -0
- package/dist/chunk-CAZPWBQ4.js +18 -0
- package/dist/chunk-CAZPWBQ4.js.map +7 -0
- package/dist/chunk-CMPOBBRV.js +10 -0
- package/dist/chunk-CMPOBBRV.js.map +7 -0
- package/dist/chunk-CRQWKC67.js +118 -0
- package/dist/chunk-CRQWKC67.js.map +7 -0
- package/dist/chunk-CRVXBWSY.js +70 -0
- package/dist/chunk-CRVXBWSY.js.map +7 -0
- package/dist/chunk-D6ZHV6AT.js +0 -0
- package/dist/chunk-D6ZHV6AT.js.map +7 -0
- package/dist/chunk-DP7SYLLI.js +206 -0
- package/dist/chunk-DP7SYLLI.js.map +7 -0
- package/dist/chunk-DVDKPY2A.js +12 -0
- package/dist/chunk-DVDKPY2A.js.map +7 -0
- package/dist/chunk-E4VONSLO.js +15 -0
- package/dist/chunk-E4VONSLO.js.map +7 -0
- package/dist/chunk-EEYGPPLU.js +185 -0
- package/dist/chunk-EEYGPPLU.js.map +7 -0
- package/dist/chunk-EI5TMJDC.js +56 -0
- package/dist/chunk-EI5TMJDC.js.map +7 -0
- package/dist/chunk-EQ5AIF3T.js +117 -0
- package/dist/chunk-EQ5AIF3T.js.map +7 -0
- package/dist/chunk-EZZHO6DQ.js +26 -0
- package/dist/chunk-EZZHO6DQ.js.map +7 -0
- package/dist/chunk-FUHLRG3M.js +130 -0
- package/dist/chunk-FUHLRG3M.js.map +7 -0
- package/dist/chunk-FVOL3ZOJ.js +101 -0
- package/dist/chunk-FVOL3ZOJ.js.map +7 -0
- package/dist/chunk-G33EUV7N.js +288 -0
- package/dist/chunk-G33EUV7N.js.map +7 -0
- package/dist/chunk-GH34XFCC.js +56 -0
- package/dist/chunk-GH34XFCC.js.map +7 -0
- package/dist/chunk-GKWRJ6H4.js +27 -0
- package/dist/chunk-GKWRJ6H4.js.map +7 -0
- package/dist/chunk-GQHMU3AR.js +907 -0
- package/dist/chunk-GQHMU3AR.js.map +7 -0
- package/dist/chunk-GRZU6F7Q.js +80 -0
- package/dist/chunk-GRZU6F7Q.js.map +7 -0
- package/dist/chunk-GT2LARKT.js +107 -0
- package/dist/chunk-GT2LARKT.js.map +7 -0
- package/dist/chunk-H4ABGAAG.js +60 -0
- package/dist/chunk-H4ABGAAG.js.map +7 -0
- package/dist/chunk-H63UHX42.js +93 -0
- package/dist/chunk-H63UHX42.js.map +7 -0
- package/dist/chunk-HIS4MGIR.js +8 -0
- package/dist/chunk-HIS4MGIR.js.map +7 -0
- package/dist/chunk-HPPFSWIV.js +213 -0
- package/dist/chunk-HPPFSWIV.js.map +7 -0
- package/dist/chunk-J2FC5K4B.js +87 -0
- package/dist/chunk-J2FC5K4B.js.map +7 -0
- package/dist/chunk-J5BSFDVK.js +123 -0
- package/dist/chunk-J5BSFDVK.js.map +7 -0
- package/dist/chunk-J7GSNWXT.js +151 -0
- package/dist/chunk-J7GSNWXT.js.map +7 -0
- package/dist/chunk-JA5ET6MC.js +550 -0
- package/dist/chunk-JA5ET6MC.js.map +7 -0
- package/dist/chunk-K22S7IZR.js +12 -0
- package/dist/chunk-K22S7IZR.js.map +7 -0
- package/dist/chunk-K5TMXCMY.js +139 -0
- package/dist/chunk-K5TMXCMY.js.map +7 -0
- package/dist/chunk-KE53GN4Q.js +246 -0
- package/dist/chunk-KE53GN4Q.js.map +7 -0
- package/dist/chunk-KFQEDSYI.js +24 -0
- package/dist/chunk-KFQEDSYI.js.map +7 -0
- package/dist/chunk-KH6QWB5Y.js +51 -0
- package/dist/chunk-KH6QWB5Y.js.map +7 -0
- package/dist/chunk-KLATKWUA.js +116 -0
- package/dist/chunk-KLATKWUA.js.map +7 -0
- package/dist/chunk-KSKWSUOB.js +17 -0
- package/dist/chunk-KSKWSUOB.js.map +7 -0
- package/dist/chunk-LFWEJXWE.js +68 -0
- package/dist/chunk-LFWEJXWE.js.map +7 -0
- package/dist/chunk-LMWJAD3B.js +24 -0
- package/dist/chunk-LMWJAD3B.js.map +7 -0
- package/dist/chunk-MD23VADH.js +92 -0
- package/dist/chunk-MD23VADH.js.map +7 -0
- package/dist/chunk-MKMJT3XR.js +0 -0
- package/dist/chunk-MKMJT3XR.js.map +7 -0
- package/dist/chunk-NJTLBSTR.js +82 -0
- package/dist/chunk-NJTLBSTR.js.map +7 -0
- package/dist/chunk-NJXKMF67.js +182 -0
- package/dist/chunk-NJXKMF67.js.map +7 -0
- package/dist/chunk-OBQBIOGN.js +16 -0
- package/dist/chunk-OBQBIOGN.js.map +7 -0
- package/dist/chunk-OLYHNFKC.js +82 -0
- package/dist/chunk-OLYHNFKC.js.map +7 -0
- package/dist/chunk-OR2L7EKO.js +33 -0
- package/dist/chunk-OR2L7EKO.js.map +7 -0
- package/dist/chunk-OUF57UZ7.js +28 -0
- package/dist/chunk-OUF57UZ7.js.map +7 -0
- package/dist/chunk-PBMM2N77.js +56 -0
- package/dist/chunk-PBMM2N77.js.map +7 -0
- package/dist/chunk-PCL2KNHC.js +6 -0
- package/dist/chunk-PCL2KNHC.js.map +7 -0
- package/dist/chunk-PH3LWLYN.js +49 -0
- package/dist/chunk-PH3LWLYN.js.map +7 -0
- package/dist/chunk-PHNMDWSK.js +9 -0
- package/dist/chunk-PHNMDWSK.js.map +7 -0
- package/dist/chunk-PN5EH6DM.js +36 -0
- package/dist/chunk-PN5EH6DM.js.map +7 -0
- package/dist/chunk-POCAINUE.js +42 -0
- package/dist/chunk-POCAINUE.js.map +7 -0
- package/dist/chunk-Q5LEK7CI.js +64 -0
- package/dist/chunk-Q5LEK7CI.js.map +7 -0
- package/dist/chunk-QH7VW7IY.js +0 -0
- package/dist/chunk-QH7VW7IY.js.map +7 -0
- package/dist/chunk-QLGM2AZW.js +173 -0
- package/dist/chunk-QLGM2AZW.js.map +7 -0
- package/dist/chunk-QT3EYUL5.js +85 -0
- package/dist/chunk-QT3EYUL5.js.map +7 -0
- package/dist/chunk-QYHOFLRX.js +43 -0
- package/dist/chunk-QYHOFLRX.js.map +7 -0
- package/dist/chunk-R3MBVWVI.js +127 -0
- package/dist/chunk-R3MBVWVI.js.map +7 -0
- package/dist/chunk-R6V3LH7F.js +67 -0
- package/dist/chunk-R6V3LH7F.js.map +7 -0
- package/dist/chunk-RB22U6HI.js +64 -0
- package/dist/chunk-RB22U6HI.js.map +7 -0
- package/dist/chunk-RQRQYYTB.js +34 -0
- package/dist/chunk-RQRQYYTB.js.map +7 -0
- package/dist/chunk-S5D2QE4G.js +53 -0
- package/dist/chunk-S5D2QE4G.js.map +7 -0
- package/dist/chunk-S7I76ISM.js +245 -0
- package/dist/chunk-S7I76ISM.js.map +7 -0
- package/dist/chunk-TBDZOQ2C.js +66 -0
- package/dist/chunk-TBDZOQ2C.js.map +7 -0
- package/dist/chunk-TSKELYW7.js +55 -0
- package/dist/chunk-TSKELYW7.js.map +7 -0
- package/dist/chunk-U3YHTQHR.js +215 -0
- package/dist/chunk-U3YHTQHR.js.map +7 -0
- package/dist/chunk-UGL3KNOT.js +42 -0
- package/dist/chunk-UGL3KNOT.js.map +7 -0
- package/dist/chunk-UN3DARLG.js +35 -0
- package/dist/chunk-UN3DARLG.js.map +7 -0
- package/dist/chunk-V5H7L5PJ.js +587 -0
- package/dist/chunk-V5H7L5PJ.js.map +7 -0
- package/dist/chunk-VGGERKV2.js +7 -0
- package/dist/chunk-VGGERKV2.js.map +7 -0
- package/dist/chunk-VVFXYY65.js +0 -0
- package/dist/chunk-VVFXYY65.js.map +7 -0
- package/dist/chunk-WLDCYUN6.js +161 -0
- package/dist/chunk-WLDCYUN6.js.map +7 -0
- package/dist/chunk-WMDTQS36.js +0 -0
- package/dist/chunk-WMDTQS36.js.map +7 -0
- package/dist/chunk-WUTGZYP4.js +290 -0
- package/dist/chunk-WUTGZYP4.js.map +7 -0
- package/dist/chunk-XKN3WWK3.js +0 -0
- package/dist/chunk-XKN3WWK3.js.map +7 -0
- package/dist/chunk-XQ5VJ4QO.js +62 -0
- package/dist/chunk-XQ5VJ4QO.js.map +7 -0
- package/dist/chunk-XQVKX47O.js +174 -0
- package/dist/chunk-XQVKX47O.js.map +7 -0
- package/dist/chunk-Y5CNB57V.js +22 -0
- package/dist/chunk-Y5CNB57V.js.map +7 -0
- package/dist/chunk-YDGH7DTL.js +18 -0
- package/dist/chunk-YDGH7DTL.js.map +7 -0
- package/dist/chunk-YIFUBPJ3.js +0 -0
- package/dist/chunk-YIFUBPJ3.js.map +7 -0
- package/dist/chunk-YUUDXRBW.js +212 -0
- package/dist/chunk-YUUDXRBW.js.map +7 -0
- package/dist/chunk-Z6DQLJS2.js +23 -0
- package/dist/chunk-Z6DQLJS2.js.map +7 -0
- package/dist/chunk-ZDEZ2FOC.js +81 -0
- package/dist/chunk-ZDEZ2FOC.js.map +7 -0
- package/dist/chunk-ZUYSGCEH.js +65 -0
- package/dist/chunk-ZUYSGCEH.js.map +7 -0
- package/dist/chunk-ZYP3MIH3.js +115 -0
- package/dist/chunk-ZYP3MIH3.js.map +7 -0
- package/dist/constraints/constraint-evaluator.d.ts +57 -0
- package/dist/constraints/constraint-evaluator.js +17 -0
- package/dist/constraints/constraint-evaluator.js.map +7 -0
- package/dist/constraints/index.d.ts +1 -0
- package/dist/constraints/index.js +17 -0
- package/dist/constraints/index.js.map +7 -0
- package/dist/csrf/index.d.ts +43 -0
- package/dist/csrf/index.js +43 -0
- package/dist/csrf/index.js.map +7 -0
- package/dist/engine/build-form-engine.d.ts +27 -0
- package/dist/engine/build-form-engine.js +58 -0
- package/dist/engine/build-form-engine.js.map +7 -0
- package/dist/engine/component-type.d.ts +19 -0
- package/dist/engine/component-type.js +6 -0
- package/dist/engine/component-type.js.map +7 -0
- package/dist/engine/create-form-engine.d.ts +100 -0
- package/dist/engine/create-form-engine.js +59 -0
- package/dist/engine/create-form-engine.js.map +7 -0
- package/dist/engine/form-action-context.d.ts +70 -0
- package/dist/engine/form-action-context.js +10 -0
- package/dist/engine/form-action-context.js.map +7 -0
- package/dist/engine/form-engine.d.ts +236 -0
- package/dist/engine/form-engine.js +61 -0
- package/dist/engine/form-engine.js.map +7 -0
- package/dist/engine/index.d.ts +12 -0
- package/dist/engine/index.js +124 -0
- package/dist/engine/index.js.map +7 -0
- package/dist/engine/schema-artifacts.d.ts +87 -0
- package/dist/engine/schema-artifacts.js +14 -0
- package/dist/engine/schema-artifacts.js.map +7 -0
- package/dist/engine/schema-metadata-catalog.d.ts +41 -0
- package/dist/engine/schema-metadata-catalog.js +6 -0
- package/dist/engine/schema-metadata-catalog.js.map +7 -0
- package/dist/engine/step-machine.d.ts +59 -0
- package/dist/engine/step-machine.js +32 -0
- package/dist/engine/step-machine.js.map +7 -0
- package/dist/engine/submission-schema.d.ts +53 -0
- package/dist/engine/submission-schema.js +22 -0
- package/dist/engine/submission-schema.js.map +7 -0
- package/dist/engine/value-validation.d.ts +237 -0
- package/dist/engine/value-validation.js +39 -0
- package/dist/engine/value-validation.js.map +7 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +283 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/authoring-catalog.d.ts +5 -0
- package/dist/lib/authoring-catalog.js +11 -0
- package/dist/lib/authoring-catalog.js.map +7 -0
- package/dist/lib/container-kind-of.d.ts +5 -0
- package/dist/lib/container-kind-of.js +6 -0
- package/dist/lib/container-kind-of.js.map +7 -0
- package/dist/lib/debounce.d.ts +19 -0
- package/dist/lib/debounce.js +6 -0
- package/dist/lib/debounce.js.map +7 -0
- package/dist/lib/deep-readonly.d.ts +12 -0
- package/dist/lib/deep-readonly.js +0 -0
- package/dist/lib/deep-readonly.js.map +7 -0
- package/dist/lib/element-children.d.ts +35 -0
- package/dist/lib/element-children.js +16 -0
- package/dist/lib/element-children.js.map +7 -0
- package/dist/lib/exported-action-envelope.d.ts +11 -0
- package/dist/lib/exported-action-envelope.js +7 -0
- package/dist/lib/exported-action-envelope.js.map +7 -0
- package/dist/lib/exported-rules.d.ts +14 -0
- package/dist/lib/exported-rules.js +6 -0
- package/dist/lib/exported-rules.js.map +7 -0
- package/dist/lib/field-ref.d.ts +13 -0
- package/dist/lib/field-ref.js +6 -0
- package/dist/lib/field-ref.js.map +7 -0
- package/dist/lib/field-scope.d.ts +121 -0
- package/dist/lib/field-scope.js +41 -0
- package/dist/lib/field-scope.js.map +7 -0
- package/dist/lib/form-fetch.d.ts +36 -0
- package/dist/lib/form-fetch.js +10 -0
- package/dist/lib/form-fetch.js.map +7 -0
- package/dist/lib/form-view.d.ts +33 -0
- package/dist/lib/form-view.js +12 -0
- package/dist/lib/form-view.js.map +7 -0
- package/dist/lib/frozen-copy.d.ts +9 -0
- package/dist/lib/frozen-copy.js +7 -0
- package/dist/lib/frozen-copy.js.map +7 -0
- package/dist/lib/is-plain-object.d.ts +2 -0
- package/dist/lib/is-plain-object.js +6 -0
- package/dist/lib/is-plain-object.js.map +7 -0
- package/dist/lib/logger.d.ts +2 -0
- package/dist/lib/logger.js +6 -0
- package/dist/lib/logger.js.map +7 -0
- package/dist/lib/normalized-form-config.d.ts +106 -0
- package/dist/lib/normalized-form-config.js +19 -0
- package/dist/lib/normalized-form-config.js.map +7 -0
- package/dist/lib/omit-paths.d.ts +11 -0
- package/dist/lib/omit-paths.js +7 -0
- package/dist/lib/omit-paths.js.map +7 -0
- package/dist/lib/path-values.d.ts +47 -0
- package/dist/lib/path-values.js +22 -0
- package/dist/lib/path-values.js.map +7 -0
- package/dist/lib/renderer-data-attributes.d.ts +10 -0
- package/dist/lib/renderer-data-attributes.js +6 -0
- package/dist/lib/renderer-data-attributes.js.map +7 -0
- package/dist/lib/reserved-path-keys.d.ts +10 -0
- package/dist/lib/reserved-path-keys.js +10 -0
- package/dist/lib/reserved-path-keys.js.map +7 -0
- package/dist/lib/resolve-appearance.d.ts +48 -0
- package/dist/lib/resolve-appearance.js +10 -0
- package/dist/lib/resolve-appearance.js.map +7 -0
- package/dist/lib/standard-json-schema.d.ts +27 -0
- package/dist/lib/standard-json-schema.js +8 -0
- package/dist/lib/standard-json-schema.js.map +7 -0
- package/dist/lib/standard-schema.d.ts +19 -0
- package/dist/lib/standard-schema.js +8 -0
- package/dist/lib/standard-schema.js.map +7 -0
- package/dist/lib/submission-shape.d.ts +60 -0
- package/dist/lib/submission-shape.js +14 -0
- package/dist/lib/submission-shape.js.map +7 -0
- package/dist/lib/validate-form/grid-checks.d.ts +57 -0
- package/dist/lib/validate-form/grid-checks.js +16 -0
- package/dist/lib/validate-form/grid-checks.js.map +7 -0
- package/dist/lib/validate-form/issues.d.ts +43 -0
- package/dist/lib/validate-form/issues.js +13 -0
- package/dist/lib/validate-form/issues.js.map +7 -0
- package/dist/lib/validate-form/options.d.ts +22 -0
- package/dist/lib/validate-form/options.js +0 -0
- package/dist/lib/validate-form/options.js.map +7 -0
- package/dist/lib/validate-form/parse-elements.d.ts +23 -0
- package/dist/lib/validate-form/parse-elements.js +21 -0
- package/dist/lib/validate-form/parse-elements.js.map +7 -0
- package/dist/lib/validate-form/parse-owner-actions.d.ts +14 -0
- package/dist/lib/validate-form/parse-owner-actions.js +10 -0
- package/dist/lib/validate-form/parse-owner-actions.js.map +7 -0
- package/dist/lib/validate-form/parse-view.d.ts +11 -0
- package/dist/lib/validate-form/parse-view.js +11 -0
- package/dist/lib/validate-form/parse-view.js.map +7 -0
- package/dist/lib/validate-form/schema-issues.d.ts +16 -0
- package/dist/lib/validate-form/schema-issues.js +8 -0
- package/dist/lib/validate-form/schema-issues.js.map +7 -0
- package/dist/lib/validate-form/step-checks.d.ts +18 -0
- package/dist/lib/validate-form/step-checks.js +15 -0
- package/dist/lib/validate-form/step-checks.js.map +7 -0
- package/dist/lib/validate-form/validation-error.d.ts +26 -0
- package/dist/lib/validate-form/validation-error.js +8 -0
- package/dist/lib/validate-form/validation-error.js.map +7 -0
- package/dist/lib/validate-form.d.ts +34 -0
- package/dist/lib/validate-form.js +62 -0
- package/dist/lib/validate-form.js.map +7 -0
- package/dist/lib/zod-json-schema.d.ts +33 -0
- package/dist/lib/zod-json-schema.js +10 -0
- package/dist/lib/zod-json-schema.js.map +7 -0
- package/dist/recipes/built-in-specs.d.ts +1832 -0
- package/dist/recipes/built-in-specs.js +28 -0
- package/dist/recipes/built-in-specs.js.map +7 -0
- package/dist/recipes/built-in.d.ts +2 -0
- package/dist/recipes/built-in.js +49 -0
- package/dist/recipes/built-in.js.map +7 -0
- package/dist/recipes/define-form-recipe.d.ts +10 -0
- package/dist/recipes/define-form-recipe.js +6 -0
- package/dist/recipes/define-form-recipe.js.map +7 -0
- package/dist/recipes/define-recipe-spec.d.ts +13 -0
- package/dist/recipes/define-recipe-spec.js +8 -0
- package/dist/recipes/define-recipe-spec.js.map +7 -0
- package/dist/recipes/index.d.ts +6 -0
- package/dist/recipes/index.js +43 -0
- package/dist/recipes/index.js.map +7 -0
- package/dist/recipes/protocol.d.ts +24 -0
- package/dist/recipes/protocol.js +11 -0
- package/dist/recipes/protocol.js.map +7 -0
- package/dist/recipes/slot-schemas.d.ts +128 -0
- package/dist/recipes/slot-schemas.js +24 -0
- package/dist/recipes/slot-schemas.js.map +7 -0
- package/dist/recipes/types.d.ts +55 -0
- package/dist/recipes/types.js +1 -0
- package/dist/recipes/types.js.map +7 -0
- package/dist/recipes/view-model.d.ts +93 -0
- package/dist/recipes/view-model.js +29 -0
- package/dist/recipes/view-model.js.map +7 -0
- package/dist/registries/index.d.ts +8 -0
- package/dist/registries/index.js +0 -0
- package/dist/registries/index.js.map +7 -0
- package/dist/runtime/create-form-runtime.d.ts +43 -0
- package/dist/runtime/create-form-runtime.js +41 -0
- package/dist/runtime/create-form-runtime.js.map +7 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +44 -0
- package/dist/runtime/index.js.map +7 -0
- package/dist/runtime/submission-lifecycle.d.ts +65 -0
- package/dist/runtime/submission-lifecycle.js +6 -0
- package/dist/runtime/submission-lifecycle.js.map +7 -0
- package/dist/runtime/types.d.ts +172 -0
- package/dist/runtime/types.js +6 -0
- package/dist/runtime/types.js.map +7 -0
- package/dist/schemas/base-field.d.ts +450 -0
- package/dist/schemas/base-field.js +36 -0
- package/dist/schemas/base-field.js.map +7 -0
- package/dist/schemas/field-config.d.ts +36 -0
- package/dist/schemas/field-config.js +1 -0
- package/dist/schemas/field-config.js.map +7 -0
- package/dist/schemas/form-config-shape.d.ts +763 -0
- package/dist/schemas/form-config-shape.js +35 -0
- package/dist/schemas/form-config-shape.js.map +7 -0
- package/dist/schemas/form-config.d.ts +1288 -0
- package/dist/schemas/form-config.js +41 -0
- package/dist/schemas/form-config.js.map +7 -0
- package/dist/schemas/html-attributes.d.ts +12 -0
- package/dist/schemas/html-attributes.js +12 -0
- package/dist/schemas/html-attributes.js.map +7 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +165 -0
- package/dist/schemas/index.js.map +7 -0
- package/dist/schemas/validation/async/cache.d.ts +39 -0
- package/dist/schemas/validation/async/cache.js +6 -0
- package/dist/schemas/validation/async/cache.js.map +7 -0
- package/dist/schemas/validation/async/handler.d.ts +21 -0
- package/dist/schemas/validation/async/handler.js +11 -0
- package/dist/schemas/validation/async/handler.js.map +7 -0
- package/dist/schemas/validation/async/index.d.ts +8 -0
- package/dist/schemas/validation/async/index.js +14 -0
- package/dist/schemas/validation/async/index.js.map +7 -0
- package/dist/schemas/validation/defaults.d.ts +6 -0
- package/dist/schemas/validation/defaults.js +12 -0
- package/dist/schemas/validation/defaults.js.map +7 -0
- package/dist/schemas/validation/dependencies.d.ts +52 -0
- package/dist/schemas/validation/dependencies.js +17 -0
- package/dist/schemas/validation/dependencies.js.map +7 -0
- package/dist/schemas/validation/empty.d.ts +1 -0
- package/dist/schemas/validation/empty.js +6 -0
- package/dist/schemas/validation/empty.js.map +7 -0
- package/dist/schemas/validation/errors.d.ts +44 -0
- package/dist/schemas/validation/errors.js +12 -0
- package/dist/schemas/validation/errors.js.map +7 -0
- package/dist/schemas/validation/index.d.ts +9 -0
- package/dist/schemas/validation/index.js +130 -0
- package/dist/schemas/validation/index.js.map +7 -0
- package/dist/schemas/validation/presets.d.ts +66 -0
- package/dist/schemas/validation/presets.js +6 -0
- package/dist/schemas/validation/presets.js.map +7 -0
- package/dist/schemas/validation/relations.d.ts +12 -0
- package/dist/schemas/validation/relations.js +8 -0
- package/dist/schemas/validation/relations.js.map +7 -0
- package/dist/schemas/validation/types.d.ts +817 -0
- package/dist/schemas/validation/types.js +64 -0
- package/dist/schemas/validation/types.js.map +7 -0
- package/dist/schemas/validation/utils.d.ts +76 -0
- package/dist/schemas/validation/utils.js +24 -0
- package/dist/schemas/validation/utils.js.map +7 -0
- package/dist/schemas/validation/validation-registry.d.ts +124 -0
- package/dist/schemas/validation/validation-registry.js +27 -0
- package/dist/schemas/validation/validation-registry.js.map +7 -0
- package/dist/server-errors/from-json-api-errors.d.ts +13 -0
- package/dist/server-errors/from-json-api-errors.js +10 -0
- package/dist/server-errors/from-json-api-errors.js.map +7 -0
- package/dist/server-errors/from-problem-details.d.ts +15 -0
- package/dist/server-errors/from-problem-details.js +10 -0
- package/dist/server-errors/from-problem-details.js.map +7 -0
- package/dist/server-errors/index.d.ts +8 -0
- package/dist/server-errors/index.js +17 -0
- package/dist/server-errors/index.js.map +7 -0
- package/dist/server-errors/shared.d.ts +34 -0
- package/dist/server-errors/shared.js +23 -0
- package/dist/server-errors/shared.js.map +7 -0
- package/dist/state-container/create-form-state-container.d.ts +17 -0
- package/dist/state-container/create-form-state-container.js +31 -0
- package/dist/state-container/create-form-state-container.js.map +7 -0
- package/dist/state-container/dirty.d.ts +11 -0
- package/dist/state-container/dirty.js +9 -0
- package/dist/state-container/dirty.js.map +7 -0
- package/dist/state-container/field-array.d.ts +41 -0
- package/dist/state-container/field-array.js +8 -0
- package/dist/state-container/field-array.js.map +7 -0
- package/dist/state-container/hydration.d.ts +21 -0
- package/dist/state-container/hydration.js +11 -0
- package/dist/state-container/hydration.js.map +7 -0
- package/dist/state-container/index.d.ts +16 -0
- package/dist/state-container/index.js +51 -0
- package/dist/state-container/index.js.map +7 -0
- package/dist/state-container/issue-text.d.ts +11 -0
- package/dist/state-container/issue-text.js +6 -0
- package/dist/state-container/issue-text.js.map +7 -0
- package/dist/state-container/row-ids.d.ts +34 -0
- package/dist/state-container/row-ids.js +19 -0
- package/dist/state-container/row-ids.js.map +7 -0
- package/dist/state-container/selectors.d.ts +33 -0
- package/dist/state-container/selectors.js +22 -0
- package/dist/state-container/selectors.js.map +7 -0
- package/dist/state-container/stale-results.d.ts +28 -0
- package/dist/state-container/stale-results.js +9 -0
- package/dist/state-container/stale-results.js.map +7 -0
- package/dist/state-container/state-tree.d.ts +56 -0
- package/dist/state-container/state-tree.js +33 -0
- package/dist/state-container/state-tree.js.map +7 -0
- package/dist/state-container/submission.d.ts +45 -0
- package/dist/state-container/submission.js +26 -0
- package/dist/state-container/submission.js.map +7 -0
- package/dist/state-container/types.d.ts +404 -0
- package/dist/state-container/types.js +6 -0
- package/dist/state-container/types.js.map +7 -0
- package/dist/state-container/value-tree.d.ts +56 -0
- package/dist/state-container/value-tree.js +34 -0
- package/dist/state-container/value-tree.js.map +7 -0
- package/dist/testing/assert.d.ts +92 -0
- package/dist/testing/assert.js +42 -0
- package/dist/testing/assert.js.map +7 -0
- package/dist/testing/form-state-container-conformance.d.ts +63 -0
- package/dist/testing/form-state-container-conformance.js +44 -0
- package/dist/testing/form-state-container-conformance.js.map +7 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.js +36 -0
- package/dist/testing/index.js.map +7 -0
- package/dist/types/actions.d.ts +75 -0
- package/dist/types/actions.js +1 -0
- package/dist/types/actions.js.map +7 -0
- package/dist/types/categories.d.ts +21 -0
- package/dist/types/categories.js +8 -0
- package/dist/types/categories.js.map +7 -0
- package/dist/types/define-element.d.ts +73 -0
- package/dist/types/define-element.js +8 -0
- package/dist/types/define-element.js.map +7 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +17 -0
- package/dist/types/index.js.map +7 -0
- package/dist/types/metadata.d.ts +14 -0
- package/dist/types/metadata.js +1 -0
- package/dist/types/metadata.js.map +7 -0
- package/dist/types/registration.d.ts +142 -0
- package/dist/types/registration.js +1 -0
- package/dist/types/registration.js.map +7 -0
- package/package.json +113 -3
- package/skill/SKILL.md +79 -0
- package/skill/reference/forms-actions.md +51 -0
- package/skill/reference/forms-submission.md +44 -0
- package/skill/reference/forms-validation.md +91 -0
- package/skill/reference/forms.md +180 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type FormActionConfig } from './submission-lifecycle.js';
|
|
2
|
+
import { type CreateFormRuntimeOptions, type FormRuntime, type FormRuntimeConfig, type FormValues } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The `navigate` a runtime has when none is given: loads the page, where there is one.
|
|
5
|
+
*
|
|
6
|
+
* @remarks `globalThis.location` is undefined on a server, where a submission has nowhere to go. A renderer that takes its own `navigate` falls back to this one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function defaultNavigate(url: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Creates the lifecycle of one rendered form: its container, its submission, its wizard steps and every action dispatch.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* One runtime serves every renderer, so none keeps a copy of the lifecycle. The container owns values, field
|
|
14
|
+
* state, validation, participation (a skipped step's fields take no part) and `reset()`; the runtime owns what
|
|
15
|
+
* is around it, and the renderer owns the element, focus, sync and native submit.
|
|
16
|
+
*
|
|
17
|
+
* Every submission is parsed with the schema derived from the form (`FormEngine.submissionSchema`), and then with
|
|
18
|
+
* the application's own if the form was bound to one, after `container.submit()` passes and before the submit
|
|
19
|
+
* actions: a mismatch is a broken element contract, so it fails the submission with a form-level `valueMismatch`
|
|
20
|
+
* issue (`params.path`) and `onSubmit` never receives the values. That check is what makes `TValues`, the type of the
|
|
21
|
+
* form's config, true of what the callbacks receive. `defaults` are checked against a partial of the same schema once:
|
|
22
|
+
* a field whose default is not the value it declares, or cannot be checked, starts without one, and a warning or an error names its path, so a form
|
|
23
|
+
* is never kept from rendering by what the application gave it.
|
|
24
|
+
*
|
|
25
|
+
* The values type is read from the config's brand ({@link ValuesBrand}), so only a normalized config can name one. A config
|
|
26
|
+
* that is not normalized (the second signature) has none, its callbacks take {@link FormValues}, and naming a type for
|
|
27
|
+
* it is a type error.
|
|
28
|
+
*
|
|
29
|
+
* `container.reset()` is the only reset. The snapshot's `generation` goes up with it, and the runtime then
|
|
30
|
+
* revokes the command in flight, returns the submission to idle and the steps to the first, firing no step
|
|
31
|
+
* trigger, so whichever caller resets resets everything.
|
|
32
|
+
*
|
|
33
|
+
* One lock covers navigation and submission: a command made while another runs ends `'busy'`. A revoked
|
|
34
|
+
* command checks after every await and ends `'cancelled'`, writing nothing. The submission lifecycle is not
|
|
35
|
+
* cut short by a reset: once validation passed it runs to its end, so a `reset` action on
|
|
36
|
+
* `form_submit_success` does not keep `form_submit_complete` from running. An action already running for
|
|
37
|
+
* `form_mount` or `form_change` is not a command and runs to its end. Step actions cannot block a move:
|
|
38
|
+
* the validation of the step is the guard, and a failing step action is reported through `onActionResults`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createFormRuntime<TAction extends FormActionConfig = FormActionConfig, TValues extends FormValues = FormValues>(options: CreateFormRuntimeOptions<TAction, TValues>): FormRuntime;
|
|
41
|
+
export declare function createFormRuntime<TAction extends FormActionConfig = FormActionConfig>(options: Omit<CreateFormRuntimeOptions<TAction>, 'config'> & {
|
|
42
|
+
config: FormRuntimeConfig<TAction>;
|
|
43
|
+
}): FormRuntime;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFormRuntime,
|
|
3
|
+
defaultNavigate
|
|
4
|
+
} from "../chunk-JA5ET6MC.js";
|
|
5
|
+
import "../chunk-5Y6U3MR3.js";
|
|
6
|
+
import "../chunk-HPPFSWIV.js";
|
|
7
|
+
import "../chunk-25PLQDKN.js";
|
|
8
|
+
import "../chunk-GKWRJ6H4.js";
|
|
9
|
+
import "../chunk-H63UHX42.js";
|
|
10
|
+
import "../chunk-2XWISGGM.js";
|
|
11
|
+
import "../chunk-PH3LWLYN.js";
|
|
12
|
+
import "../chunk-GQHMU3AR.js";
|
|
13
|
+
import "../chunk-GH34XFCC.js";
|
|
14
|
+
import "../chunk-EQ5AIF3T.js";
|
|
15
|
+
import "../chunk-QYHOFLRX.js";
|
|
16
|
+
import "../chunk-EEYGPPLU.js";
|
|
17
|
+
import "../chunk-BLFLCSG3.js";
|
|
18
|
+
import "../chunk-NJTLBSTR.js";
|
|
19
|
+
import "../chunk-VGGERKV2.js";
|
|
20
|
+
import "../chunk-WUTGZYP4.js";
|
|
21
|
+
import "../chunk-R3MBVWVI.js";
|
|
22
|
+
import "../chunk-3B7CJOF6.js";
|
|
23
|
+
import "../chunk-KLATKWUA.js";
|
|
24
|
+
import "../chunk-YDGH7DTL.js";
|
|
25
|
+
import "../chunk-S7I76ISM.js";
|
|
26
|
+
import "../chunk-CRQWKC67.js";
|
|
27
|
+
import "../chunk-QLGM2AZW.js";
|
|
28
|
+
import "../chunk-ZUYSGCEH.js";
|
|
29
|
+
import "../chunk-OR2L7EKO.js";
|
|
30
|
+
import "../chunk-6BAJHAGL.js";
|
|
31
|
+
import "../chunk-6NV2JDGI.js";
|
|
32
|
+
import "../chunk-PCL2KNHC.js";
|
|
33
|
+
import "../chunk-UN3DARLG.js";
|
|
34
|
+
import "../chunk-RB22U6HI.js";
|
|
35
|
+
import "../chunk-K5TMXCMY.js";
|
|
36
|
+
import "../chunk-3YLRJVVN.js";
|
|
37
|
+
import "../chunk-CMPOBBRV.js";
|
|
38
|
+
export {
|
|
39
|
+
createFormRuntime,
|
|
40
|
+
defaultNavigate
|
|
41
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createFormRuntime, defaultNavigate } from './create-form-runtime';
|
|
2
|
+
export { isSubmissionBusy } from './types';
|
|
3
|
+
export type { CreateFormRuntimeOptions, FormRuntime, FormRuntimeConfig, FormRuntimeHost, FormRuntimeOutcome, FormRuntimeSnapshot, FormRuntimeStep, FormSubmissionState, FormSubmitHelpers, FormValues, NavigationOutcome, SubmissionStatus, SubmitOutcome, } from './types';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFormRuntime,
|
|
3
|
+
defaultNavigate
|
|
4
|
+
} from "../chunk-JA5ET6MC.js";
|
|
5
|
+
import "../chunk-5Y6U3MR3.js";
|
|
6
|
+
import "../chunk-HPPFSWIV.js";
|
|
7
|
+
import "../chunk-25PLQDKN.js";
|
|
8
|
+
import "../chunk-GKWRJ6H4.js";
|
|
9
|
+
import "../chunk-H63UHX42.js";
|
|
10
|
+
import {
|
|
11
|
+
isSubmissionBusy
|
|
12
|
+
} from "../chunk-2XWISGGM.js";
|
|
13
|
+
import "../chunk-PH3LWLYN.js";
|
|
14
|
+
import "../chunk-GQHMU3AR.js";
|
|
15
|
+
import "../chunk-GH34XFCC.js";
|
|
16
|
+
import "../chunk-EQ5AIF3T.js";
|
|
17
|
+
import "../chunk-QYHOFLRX.js";
|
|
18
|
+
import "../chunk-EEYGPPLU.js";
|
|
19
|
+
import "../chunk-BLFLCSG3.js";
|
|
20
|
+
import "../chunk-NJTLBSTR.js";
|
|
21
|
+
import "../chunk-VGGERKV2.js";
|
|
22
|
+
import "../chunk-WUTGZYP4.js";
|
|
23
|
+
import "../chunk-R3MBVWVI.js";
|
|
24
|
+
import "../chunk-3B7CJOF6.js";
|
|
25
|
+
import "../chunk-KLATKWUA.js";
|
|
26
|
+
import "../chunk-YDGH7DTL.js";
|
|
27
|
+
import "../chunk-S7I76ISM.js";
|
|
28
|
+
import "../chunk-CRQWKC67.js";
|
|
29
|
+
import "../chunk-QLGM2AZW.js";
|
|
30
|
+
import "../chunk-ZUYSGCEH.js";
|
|
31
|
+
import "../chunk-OR2L7EKO.js";
|
|
32
|
+
import "../chunk-6BAJHAGL.js";
|
|
33
|
+
import "../chunk-6NV2JDGI.js";
|
|
34
|
+
import "../chunk-PCL2KNHC.js";
|
|
35
|
+
import "../chunk-UN3DARLG.js";
|
|
36
|
+
import "../chunk-RB22U6HI.js";
|
|
37
|
+
import "../chunk-K5TMXCMY.js";
|
|
38
|
+
import "../chunk-3YLRJVVN.js";
|
|
39
|
+
import "../chunk-CMPOBBRV.js";
|
|
40
|
+
export {
|
|
41
|
+
createFormRuntime,
|
|
42
|
+
defaultNavigate,
|
|
43
|
+
isSubmissionBusy
|
|
44
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ActionDispatchInput, ParsedActionSequence } from '@schema-engine/actions';
|
|
2
|
+
import type { FormActionTrigger } from '../actions/index.js';
|
|
3
|
+
import type { ActionExecutionResult } from '../actions/types.js';
|
|
4
|
+
import type { FormConfigView } from '../lib/normalized-form-config.js';
|
|
5
|
+
import type { BuilderActionBaseContext } from '../types/index.js';
|
|
6
|
+
type Entry = NonNullable<FormConfigView['actions']>[number];
|
|
7
|
+
/** The loosely typed action of a form config, which a typed action extends. */
|
|
8
|
+
export type FormActionConfig = Exclude<Entry, readonly unknown[]>;
|
|
9
|
+
type FormActionDispatch<TAction extends FormActionConfig> = (input: ActionDispatchInput<TAction, BuilderActionBaseContext, FormActionTrigger>) => Promise<Array<ActionExecutionResult & {
|
|
10
|
+
actionId?: string;
|
|
11
|
+
sequenceIndex?: number;
|
|
12
|
+
groupIndex?: number;
|
|
13
|
+
}>>;
|
|
14
|
+
interface RunSubmissionLifecycleOptions<TAction extends FormActionConfig> {
|
|
15
|
+
actions: ParsedActionSequence<TAction>;
|
|
16
|
+
context: BuilderActionBaseContext | (() => BuilderActionBaseContext);
|
|
17
|
+
/**
|
|
18
|
+
* Whether any action answers the trigger. A trigger nothing answers is not dispatched and builds no context.
|
|
19
|
+
*
|
|
20
|
+
* @remarks Defaults to answering every trigger.
|
|
21
|
+
*/
|
|
22
|
+
hasMatching?: (actions: ParsedActionSequence<TAction>, trigger: FormActionTrigger) => boolean;
|
|
23
|
+
onAction?: (action: TAction, data: BuilderActionBaseContext['formData']) => void | Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* The consumer's submission callback.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Runs after the submit actions and before `form_submit_success` or `form_submit_error`, and only when
|
|
29
|
+
* the actions succeeded. A rejection fails the submission, so the error and complete triggers run
|
|
30
|
+
* and the success trigger does not.
|
|
31
|
+
*/
|
|
32
|
+
onSubmit?: () => void | Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export type SubmissionActionResult = ActionExecutionResult & {
|
|
35
|
+
actionId: string;
|
|
36
|
+
sequenceIndex?: number;
|
|
37
|
+
groupIndex?: number;
|
|
38
|
+
status?: 'succeeded' | 'failed' | 'cancelled';
|
|
39
|
+
cancellationRequested?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/** Where a submission failed outside its action results: the consumer's `onSubmit` callback, or a trigger dispatch. */
|
|
42
|
+
export interface SubmissionFailure {
|
|
43
|
+
phase: 'callback' | 'trigger';
|
|
44
|
+
error: unknown;
|
|
45
|
+
}
|
|
46
|
+
export interface SubmissionLifecycleResult {
|
|
47
|
+
succeeded: boolean;
|
|
48
|
+
results: SubmissionActionResult[];
|
|
49
|
+
/** Set when `onSubmit` rejected or a trigger dispatch failed; a failed action alone sets none. */
|
|
50
|
+
failure?: SubmissionFailure;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Runs the form submission sequence and returns the submit action results.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* The sequence is `form_submit_start`, the submit actions, `onSubmit`, then `form_submit_success` or
|
|
57
|
+
* `form_submit_error`, then `form_submit_complete`. It does not reject: a rejected `onSubmit` or trigger
|
|
58
|
+
* dispatch resolves unsuccessful with a `failure`, and one recovery path dispatches `form_submit_error`
|
|
59
|
+
* unless that trigger was already tried, then `form_submit_complete` exactly once even when its own
|
|
60
|
+
* dispatch rejects. Once `onSubmit` and `form_submit_success` have resolved the submission is saved: a
|
|
61
|
+
* later failure, of `form_submit_complete`, is recorded in `failure` and leaves `succeeded` true. Failures
|
|
62
|
+
* while recovering are dropped in favour of the first.
|
|
63
|
+
*/
|
|
64
|
+
export declare function runSubmissionLifecycle<TAction extends FormActionConfig = FormActionConfig>(dispatch: FormActionDispatch<TAction>, { actions, context, onAction, onSubmit, hasMatching }: RunSubmissionLifecycleOptions<TAction>): Promise<SubmissionLifecycleResult>;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { ParsedActionSequence } from '@schema-engine/actions';
|
|
2
|
+
import type { FormEngineRuntime } from '../engine/form-engine.js';
|
|
3
|
+
import type { FormActionConfig, SubmissionActionResult } from './submission-lifecycle.js';
|
|
4
|
+
import type { FormStepState, StepNavigationMode } from '../engine/step-machine.js';
|
|
5
|
+
import type { ValidationStep } from '../engine/value-validation.js';
|
|
6
|
+
import type { SubmissionSchema } from '../engine/submission-schema.js';
|
|
7
|
+
import type { FormFetch } from '../lib/form-fetch.js';
|
|
8
|
+
import type { FormActionTrigger } from '../actions/index.js';
|
|
9
|
+
import type { DefaultValuesOf } from '../builder/form-values.js';
|
|
10
|
+
import type { ValuesBrand } from '../lib/normalized-form-config.js';
|
|
11
|
+
import type { FormStateContainer, FormStateContainerConfig, FormStateErrorsInput, FormIssueFormatter, FormStateHydration, FormSubmissionIssue } from '../state-container/types.js';
|
|
12
|
+
/** The nested values of a form, as the container holds them and a submission hands them over. */
|
|
13
|
+
export type FormValues = Readonly<Record<string, unknown>>;
|
|
14
|
+
/** What `onSubmit` is given besides the values that passed. */
|
|
15
|
+
export interface FormSubmitHelpers {
|
|
16
|
+
/** Shows the server's answer to this submission, by path; `FORM_ROOT` stands for the form. */
|
|
17
|
+
setServerErrors: (errors: FormStateErrorsInput) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The engine's `fetch`: the request to send the values with.
|
|
20
|
+
*
|
|
21
|
+
* @remarks It applies the engine's CSRF policy to a same-origin unsafe request, so a submit callback adds no token itself.
|
|
22
|
+
*/
|
|
23
|
+
fetch: FormFetch;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* How a command ended.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - `moved`: the current step changed.
|
|
30
|
+
* - `submitted` and `failed`: a submission ran and its actions and `onSubmit` succeeded or did not. Why it
|
|
31
|
+
* failed is in `snapshot.submission.failures`, never in the return value.
|
|
32
|
+
* - `invalid`: validation found errors, which are shown and focused.
|
|
33
|
+
* - `overtaken`: an edit or a row move outran the check, so there is no verdict: nothing is shown or focused.
|
|
34
|
+
* - `refused`: there was nowhere to go, or the step is unknown, skipped or not reachable.
|
|
35
|
+
* - `busy`: another command was running.
|
|
36
|
+
* - `cancelled`: a reset or an unmount revoked the command, which then wrote nothing.
|
|
37
|
+
*/
|
|
38
|
+
export type FormRuntimeOutcome = 'moved' | 'submitted' | 'failed' | 'invalid' | 'overtaken' | 'refused' | 'busy' | 'cancelled';
|
|
39
|
+
/** How `next()`, `back()` and `goTo()` ended. */
|
|
40
|
+
export type NavigationOutcome = Extract<FormRuntimeOutcome, 'moved' | 'failed' | 'invalid' | 'overtaken' | 'refused' | 'busy' | 'cancelled'>;
|
|
41
|
+
/** How `submit()` ended: before the last active step it acts as `next()`, so it can end `moved`. */
|
|
42
|
+
export type SubmitOutcome = Extract<FormRuntimeOutcome, 'moved' | 'submitted' | 'failed' | 'invalid' | 'overtaken' | 'refused' | 'busy' | 'cancelled'>;
|
|
43
|
+
/**
|
|
44
|
+
* Where a submission is: `idle` until one starts, `validating` while its validation runs, `submitting` once it passed and the actions and `onSubmit` run, then how it ended.
|
|
45
|
+
*
|
|
46
|
+
* @remarks A submission that is `invalid` or `overtaken` goes from `validating` back to `idle` and is never `submitting`: submission starts, for the `form_submit_start` trigger and for a renderer's own start event, once it passed validation.
|
|
47
|
+
*/
|
|
48
|
+
export type SubmissionStatus = 'idle' | 'validating' | 'submitting' | 'success' | 'error';
|
|
49
|
+
/**
|
|
50
|
+
* Whether a submission is in progress: its validation or its actions are running.
|
|
51
|
+
*
|
|
52
|
+
* @remarks The one definition of busy, which the runtime's revoke and every renderer's submit button, label and busy state share.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isSubmissionBusy(status: SubmissionStatus): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* What the form reports about its submissions.
|
|
57
|
+
*
|
|
58
|
+
* @remarks `failures` explain an `error` status and are empty otherwise. They are issues, so the form's one formatter words them.
|
|
59
|
+
*/
|
|
60
|
+
export interface FormSubmissionState {
|
|
61
|
+
readonly status: SubmissionStatus;
|
|
62
|
+
readonly failures: readonly FormSubmissionIssue[];
|
|
63
|
+
/** The submissions that ended, whether they passed or failed validation, since the form was created or reset. */
|
|
64
|
+
readonly submitCount: number;
|
|
65
|
+
}
|
|
66
|
+
/** What a runtime reports: its submission, and its steps. */
|
|
67
|
+
export interface FormRuntimeSnapshot {
|
|
68
|
+
readonly submission: FormSubmissionState;
|
|
69
|
+
/** The id of the current step. */
|
|
70
|
+
readonly current: string;
|
|
71
|
+
/** A `next`, `back`, `goTo` or a submit that acts as `next` is running. */
|
|
72
|
+
readonly navigating: boolean;
|
|
73
|
+
/** Every step in config order, skipped ones included. */
|
|
74
|
+
readonly steps: readonly FormStepState[];
|
|
75
|
+
}
|
|
76
|
+
/** What only the renderer can do. */
|
|
77
|
+
export interface FormRuntimeHost {
|
|
78
|
+
/**
|
|
79
|
+
* Focuses the first control with an error among `paths`.
|
|
80
|
+
*
|
|
81
|
+
* @remarks The paths are those of the fields that have an error; the host picks the first in the document. The list may be empty (a rule that could not run records no field error), and the host then focuses nothing.
|
|
82
|
+
*/
|
|
83
|
+
focus(paths: readonly string[]): void;
|
|
84
|
+
/** Writes the controls' values to the container and reports their native validity, as a submit does, before a check. */
|
|
85
|
+
sync?(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Called once a submission succeeded, after its actions and `onSubmit`, with the values the form declares, so a host whose form can post natively may do it with them.
|
|
88
|
+
*
|
|
89
|
+
* @remarks The values are what the form's elements write, checked by the schema derived from them, and not what the application's schema made of them (a `Date`, a class): a form posts what its fields hold. The host decides whether it posts, because a renderer always passes a stable `onSubmit` wrapper and the runtime cannot tell whether the application gave one: Radiant posts when it did not. The navigation cannot cut off the success and complete triggers, which ran first.
|
|
90
|
+
*/
|
|
91
|
+
submitNatively?(values: FormValues): void;
|
|
92
|
+
}
|
|
93
|
+
/** A step of the config the runtime reads. */
|
|
94
|
+
export interface FormRuntimeStep<TAction extends FormActionConfig = FormActionConfig> extends ValidationStep {
|
|
95
|
+
readonly id: string;
|
|
96
|
+
/** Actions dispatched after the form's on every trigger while this step is current. */
|
|
97
|
+
readonly actions?: ParsedActionSequence<TAction>;
|
|
98
|
+
}
|
|
99
|
+
/** The normalized form config, in the shape the runtime reads. */
|
|
100
|
+
export interface FormRuntimeConfig<TAction extends FormActionConfig = FormActionConfig> extends FormStateContainerConfig {
|
|
101
|
+
readonly id?: string;
|
|
102
|
+
readonly navigation?: StepNavigationMode;
|
|
103
|
+
readonly actions?: ParsedActionSequence<TAction>;
|
|
104
|
+
readonly steps: readonly FormRuntimeStep<TAction>[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* What {@link createFormRuntime} builds a runtime from.
|
|
108
|
+
*
|
|
109
|
+
* @template TValues - The values a submission holds, which the form's config carries ({@link ValuesBrand}); {@link FormValues} when it is not typed. It is inferred from `config`, which the runtime has parsed every submission against before it reaches a callback.
|
|
110
|
+
*/
|
|
111
|
+
export interface CreateFormRuntimeOptions<TAction extends FormActionConfig = FormActionConfig, TValues = FormValues> {
|
|
112
|
+
/** The engine, for its validation registry, its actions and its `fetch`. */
|
|
113
|
+
engine: FormEngineRuntime;
|
|
114
|
+
config: FormRuntimeConfig<TAction> & ValuesBrand<TValues>;
|
|
115
|
+
/** Values the form starts from, over the defaults of its fields. */
|
|
116
|
+
defaults?: DefaultValuesOf<TValues>;
|
|
117
|
+
/** The snapshot of a container that rendered the form on the server, to start from. */
|
|
118
|
+
snapshot?: FormStateHydration;
|
|
119
|
+
host: FormRuntimeHost;
|
|
120
|
+
/** Called with the values that passed validation and matched the form's value schemas, after the submit actions and before the success trigger. */
|
|
121
|
+
onSubmit?: (data: TValues, helpers: FormSubmitHelpers) => void | Promise<void>;
|
|
122
|
+
/** Called when the values change, never for an error, a touch or a validation result. */
|
|
123
|
+
onChange?: (data: FormValues) => void;
|
|
124
|
+
/** Called with each submit action that succeeded, and the values that passed. Typed by the engine's actions. */
|
|
125
|
+
onAction?: (action: TAction, data: TValues) => void | Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Takes the page to the `redirectUrl` a submit action asked for, once the whole submission succeeded.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* Called at most once, after every submit action and `onSubmit` succeeded and the success trigger ran, with the
|
|
131
|
+
* `redirectUrl` of the last successful submit action that set one. It replaces
|
|
132
|
+
* {@link FormRuntimeHost.submitNatively} for that submission, since a native post would load a page of its own.
|
|
133
|
+
* Defaults to {@link defaultNavigate}: `location.assign` where `globalThis.location` exists, and nothing on a server.
|
|
134
|
+
*/
|
|
135
|
+
navigate?: (url: string) => void;
|
|
136
|
+
/** Called with the results of every trigger that ran actions, and once with those of the submit actions. */
|
|
137
|
+
onActionResults?: (results: readonly SubmissionActionResult[], trigger: FormActionTrigger) => void | Promise<void>;
|
|
138
|
+
}
|
|
139
|
+
/** One instance of a form's lifecycle and wizard navigation, shared by every renderer. */
|
|
140
|
+
export interface FormRuntime {
|
|
141
|
+
/** The form state: values, field state, validation and the captured submission. */
|
|
142
|
+
readonly container: FormStateContainer;
|
|
143
|
+
/** The normalized config the runtime was created from. */
|
|
144
|
+
readonly config: FormRuntimeConfig;
|
|
145
|
+
/**
|
|
146
|
+
* The submitted values of the form as a Standard Schema, composed once from the config's elements.
|
|
147
|
+
*
|
|
148
|
+
* @remarks The schema every submission is checked against, so a tool that builds values for the form reads it from here and cannot drift from the runtime's.
|
|
149
|
+
*/
|
|
150
|
+
readonly submissionSchema: SubmissionSchema;
|
|
151
|
+
/** The engine's `formatIssue`, which a form without one of its own words its issues with. */
|
|
152
|
+
readonly formatIssue: FormIssueFormatter | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Starts the runtime: dispatches `form_mount` the first time, and watches the values for `form_change` and `onChange`.
|
|
155
|
+
*
|
|
156
|
+
* @remarks The returned function stops the watch and revokes any command in flight (`next`, `back`, `goTo`, `submit`), which ends `'cancelled'`. Mounting again is allowed and dispatches `form_mount` no more.
|
|
157
|
+
*/
|
|
158
|
+
mount: () => () => void;
|
|
159
|
+
getSnapshot: () => FormRuntimeSnapshot;
|
|
160
|
+
getServerSnapshot: () => FormRuntimeSnapshot;
|
|
161
|
+
subscribe: (listener: () => void) => () => void;
|
|
162
|
+
/** Validates the current step and moves to the next active one. */
|
|
163
|
+
next: () => Promise<NavigationOutcome>;
|
|
164
|
+
/** Moves to the previous active step, without validating. */
|
|
165
|
+
back: () => Promise<NavigationOutcome>;
|
|
166
|
+
/** Moves to the step `id`: back always, forward as the form's `navigation` allows. */
|
|
167
|
+
goTo: (id: string) => Promise<NavigationOutcome>;
|
|
168
|
+
/** Acts as `next()` before the last active step; on it, validates every active step, runs the actions and `onSubmit`. */
|
|
169
|
+
submit: () => Promise<SubmitOutcome>;
|
|
170
|
+
/** Hides the outcome of the last submission: the status goes back to `idle` and the failures are dropped. */
|
|
171
|
+
clearSubmission: () => void;
|
|
172
|
+
}
|