@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Andrea Zanenghi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @schema-engine/forms
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The forms domain of Schema Engine: elements, validation rules, constraints, steps, the form state and the submit lifecycle, with no renderer. A form is a JSON document that names registered elements by `$type`. [`@schema-engine/forms-react`](https://www.npmjs.com/package/@schema-engine/forms-react) and [`@schema-engine/forms-radiant`](https://www.npmjs.com/package/@schema-engine/forms-radiant) draw it.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @schema-engine/forms zod
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
First-party schemas use the `zod/mini` entry point. Registrations may use any [Standard Schema](https://standardschema.dev/) validator.
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import * as z from 'zod/mini';
|
|
17
|
+
import { BaseFieldSchema, createFormEngine, defineInput } from '@schema-engine/forms';
|
|
18
|
+
|
|
19
|
+
const text = defineInput({
|
|
20
|
+
$type: 'text',
|
|
21
|
+
schema: z.extend(BaseFieldSchema, { $type: z.literal('text') }),
|
|
22
|
+
metadata: { name: 'Text', category: 'input' },
|
|
23
|
+
value: () => z.string(),
|
|
24
|
+
render: () => null,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const engine = createFormEngine({ elements: [text] });
|
|
28
|
+
|
|
29
|
+
const result = engine.safeValidateForm({
|
|
30
|
+
id: 'contact',
|
|
31
|
+
steps: [
|
|
32
|
+
{
|
|
33
|
+
id: 'details',
|
|
34
|
+
title: 'Your details',
|
|
35
|
+
elements: [{ $type: 'text', id: 'name', name: 'name', rules: [{ $type: 'required' }] }],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`result` is `{ success: true, data }` with the frozen, normalized config, or `{ success: false, issues }` with the `path` of every key to fix. `createFormRuntime` runs the form without a renderer: it owns the submission, the wizard steps and every action.
|
|
42
|
+
|
|
43
|
+
## Entry points
|
|
44
|
+
|
|
45
|
+
| Import | Holds |
|
|
46
|
+
| --------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
47
|
+
| `@schema-engine/forms` | The engine, `defineInput` and `defineStatic`, the runtime, the actions and the types |
|
|
48
|
+
| `@schema-engine/forms/state-container` | The form state container, its selectors and the issue formatter type |
|
|
49
|
+
| `@schema-engine/forms/csrf` | CSRF policies for the engine's requests and native posts |
|
|
50
|
+
| `@schema-engine/forms/server-errors` | `fromProblemDetails` and `fromJsonApiErrors`, to show a server's answer on its fields |
|
|
51
|
+
| `@schema-engine/forms/recipes` | The forms recipe protocol, to write a view recipe |
|
|
52
|
+
| `@schema-engine/forms/recipes/built-in` | The built-in recipe specs and their slot schemas |
|
|
53
|
+
| `@schema-engine/forms/browser` | Browser actions: auto-save, reset and analytics, with consent |
|
|
54
|
+
| `@schema-engine/forms/agent-tool` | Offers a form to a browser agent as a WebMCP tool (experimental) |
|
|
55
|
+
| `@schema-engine/forms/testing` | A conformance suite for a form state container, for any test runner |
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
- [Forms](https://schema-engine.com/docs/forms/overview): what a form can do.
|
|
60
|
+
- [Installation and quick start](https://schema-engine.com/docs/forms/getting-started): register elements, check JSON and submit with no renderer.
|
|
61
|
+
- [Engine and registrations](https://schema-engine.com/docs/forms/engine): the engine, custom fields and configuration errors.
|
|
62
|
+
- [Validation](https://schema-engine.com/docs/forms/validation) and [custom and async rules](https://schema-engine.com/docs/forms/validation-custom).
|
|
63
|
+
- [Form state](https://schema-engine.com/docs/forms/form-state), [Wizard and runtime](https://schema-engine.com/docs/forms/wizard) and [Actions in forms](https://schema-engine.com/docs/forms/actions).
|
|
64
|
+
- [Issue text](https://schema-engine.com/docs/forms/issue-text), [Server errors](https://schema-engine.com/docs/forms/server-errors) and [CSRF](https://schema-engine.com/docs/forms/csrf).
|
|
65
|
+
- [Agent tools](https://schema-engine.com/docs/forms/agent-tool) and [API reference](https://schema-engine.com/docs/forms/api-reference).
|
|
66
|
+
- [For AI agents](https://schema-engine.com/docs/schema-engine/agent-skill): the package ships its part of the agent skill.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import "../chunk-4FELFUCD.js";
|
|
2
|
+
import "../chunk-QH7VW7IY.js";
|
|
3
|
+
import "../chunk-BIHEIJG3.js";
|
|
4
|
+
import {
|
|
5
|
+
NotificationActionRegistration
|
|
6
|
+
} from "../chunk-6FUGK5HQ.js";
|
|
7
|
+
import {
|
|
8
|
+
SubmitActionRegistration
|
|
9
|
+
} from "../chunk-Z6DQLJS2.js";
|
|
10
|
+
import {
|
|
11
|
+
FormSubmitActionSchema,
|
|
12
|
+
formSubmitPlugin
|
|
13
|
+
} from "../chunk-GT2LARKT.js";
|
|
14
|
+
import {
|
|
15
|
+
NotificationActionSchema,
|
|
16
|
+
notificationPlugin
|
|
17
|
+
} from "../chunk-QT3EYUL5.js";
|
|
18
|
+
import {
|
|
19
|
+
FormResetActionSchema,
|
|
20
|
+
formResetPlugin
|
|
21
|
+
} from "../chunk-LFWEJXWE.js";
|
|
22
|
+
import {
|
|
23
|
+
GTMEventActionSchema,
|
|
24
|
+
gtmPlugin
|
|
25
|
+
} from "../chunk-ZDEZ2FOC.js";
|
|
26
|
+
import {
|
|
27
|
+
AutoSaveActionSchema,
|
|
28
|
+
autoSavePlugin,
|
|
29
|
+
getAutoSaveDraftStorageKey
|
|
30
|
+
} from "../chunk-4XPLSYTK.js";
|
|
31
|
+
import {
|
|
32
|
+
FormActionTriggerSchema
|
|
33
|
+
} from "../chunk-CAZPWBQ4.js";
|
|
34
|
+
import "../chunk-VGGERKV2.js";
|
|
35
|
+
export {
|
|
36
|
+
AutoSaveActionSchema,
|
|
37
|
+
FormActionTriggerSchema,
|
|
38
|
+
FormResetActionSchema,
|
|
39
|
+
FormSubmitActionSchema,
|
|
40
|
+
GTMEventActionSchema,
|
|
41
|
+
NotificationActionRegistration,
|
|
42
|
+
NotificationActionSchema,
|
|
43
|
+
SubmitActionRegistration,
|
|
44
|
+
autoSavePlugin,
|
|
45
|
+
formResetPlugin,
|
|
46
|
+
formSubmitPlugin,
|
|
47
|
+
getAutoSaveDraftStorageKey,
|
|
48
|
+
gtmPlugin,
|
|
49
|
+
notificationPlugin
|
|
50
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Storage Interface for Auto-Save Plugin
|
|
5
|
+
*/
|
|
6
|
+
export interface AutoSaveStorage {
|
|
7
|
+
/** Save form data to storage */
|
|
8
|
+
save: (key: string, data: unknown) => Promise<void> | void;
|
|
9
|
+
/** Load form data from storage, synchronously or as a promise. */
|
|
10
|
+
load: (key: string) => unknown;
|
|
11
|
+
/** Remove form data from storage */
|
|
12
|
+
remove: (key: string) => Promise<void> | void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Auto-Save Plugin Configuration
|
|
16
|
+
*/
|
|
17
|
+
export interface AutoSavePluginConfig {
|
|
18
|
+
/** Custom storage implementation */
|
|
19
|
+
storage: AutoSaveStorage;
|
|
20
|
+
/** Checks whether saving is currently allowed, for example by a consent tool. */
|
|
21
|
+
shouldSave?: () => boolean | Promise<boolean>;
|
|
22
|
+
/** Called when auto-save succeeds */
|
|
23
|
+
onSave?: (data: unknown, context: BuilderActionRuntimeContext<AutoSaveAction>) => void | Promise<void>;
|
|
24
|
+
/** Called when auto-save fails */
|
|
25
|
+
onError?: (error: string, context: BuilderActionRuntimeContext<AutoSaveAction>) => void | Promise<void>;
|
|
26
|
+
/** Custom storage key generator */
|
|
27
|
+
getStorageKey?: (context: BuilderActionRuntimeContext<AutoSaveAction>) => string;
|
|
28
|
+
}
|
|
29
|
+
/** Schema for the `auto_save` action configuration. */
|
|
30
|
+
export declare const AutoSaveActionSchema: z.ZodMiniObject<{
|
|
31
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
32
|
+
storageKey: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
33
|
+
includeSensitive: z.ZodMiniOptional<z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type AutoSaveAction = BuilderActionConfig<'auto_save', typeof AutoSaveActionSchema>;
|
|
36
|
+
/** Builds the default storage key shared by auto-save and reset actions. */
|
|
37
|
+
export declare function getAutoSaveDraftStorageKey(formId: string): string;
|
|
38
|
+
/** Creates a configured `auto_save` action registration. */
|
|
39
|
+
export declare function autoSavePlugin(config: AutoSavePluginConfig): BuilderActionRegistration<'auto_save', typeof AutoSaveActionSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '../../types/index.js';
|
|
3
|
+
import { type AutoSaveStorage } from './auto-save.plugin';
|
|
4
|
+
/**
|
|
5
|
+
* Reset Plugin Configuration
|
|
6
|
+
*/
|
|
7
|
+
export interface FormResetPluginConfig {
|
|
8
|
+
/** Storage used to remove a form's auto-saved draft. */
|
|
9
|
+
storage: AutoSaveStorage;
|
|
10
|
+
confirm?: (message: string) => boolean | Promise<boolean>;
|
|
11
|
+
clearDraft?: (formId: string) => void | Promise<void>;
|
|
12
|
+
resetForm?: (context: BuilderActionRuntimeContext<FormResetAction>, resetToDefaults: boolean) => void;
|
|
13
|
+
onReset?: (context: BuilderActionRuntimeContext<FormResetAction>) => void;
|
|
14
|
+
}
|
|
15
|
+
/** Schema for the `reset` action configuration. */
|
|
16
|
+
export declare const FormResetActionSchema: z.ZodMiniObject<{
|
|
17
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
|
+
confirmMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
19
|
+
resetToDefaults: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type FormResetAction = BuilderActionConfig<'reset', typeof FormResetActionSchema>;
|
|
22
|
+
/** Creates a configured `reset` action registration. */
|
|
23
|
+
export declare function formResetPlugin(config: FormResetPluginConfig): BuilderActionRegistration<'reset', typeof FormResetActionSchema>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Form Submit Plugin Configuration
|
|
5
|
+
*/
|
|
6
|
+
export interface FormSubmitPluginConfig {
|
|
7
|
+
/** Custom request adapter (axios, etc.); the engine's `context.fetch` by default. */
|
|
8
|
+
request?: (url: string, options: RequestInit) => Promise<Response>;
|
|
9
|
+
/** Transform data before sending */
|
|
10
|
+
transformData?: (data: Record<string, unknown>, context: BuilderActionRuntimeContext<FormSubmitAction>) => Record<string, unknown>;
|
|
11
|
+
/** Handle successful response */
|
|
12
|
+
onSuccess?: (data: unknown, context: BuilderActionRuntimeContext<FormSubmitAction>) => void;
|
|
13
|
+
/** Handle error response */
|
|
14
|
+
onError?: (error: Error, context: BuilderActionRuntimeContext<FormSubmitAction>) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Schema for the `submit` action configuration. */
|
|
17
|
+
export declare const FormSubmitActionSchema: z.ZodMiniObject<{
|
|
18
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
19
|
+
endpoint: z.ZodMiniString<string>;
|
|
20
|
+
method: z.ZodMiniDefault<z.ZodMiniEnum<{
|
|
21
|
+
POST: "POST";
|
|
22
|
+
PUT: "PUT";
|
|
23
|
+
PATCH: "PATCH";
|
|
24
|
+
}>>;
|
|
25
|
+
successMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
26
|
+
errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
27
|
+
redirectUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type FormSubmitAction = BuilderActionConfig<'submit', typeof FormSubmitActionSchema>;
|
|
30
|
+
/** Creates a configured `submit` action registration. */
|
|
31
|
+
export declare function formSubmitPlugin(config?: FormSubmitPluginConfig): BuilderActionRegistration<'submit', typeof FormSubmitActionSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Submit Action Registration
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured submit action.
|
|
5
|
+
* Register this declaration on your engine to enable the submit action type and get a default configuration.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createFormEngine, SubmitActionRegistration } from '@schema-engine/forms';
|
|
10
|
+
*
|
|
11
|
+
* const engine = createFormEngine({
|
|
12
|
+
* actions: [SubmitActionRegistration],
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { FormSubmitActionSchema } from './form-submit.plugin';
|
|
17
|
+
import type { BuilderActionRegistration } from '../../types/index.js';
|
|
18
|
+
/**
|
|
19
|
+
* Default Submit Action Registration
|
|
20
|
+
* Handles basic form submission with logger output
|
|
21
|
+
*/
|
|
22
|
+
export declare const SubmitActionRegistration: BuilderActionRegistration<'submit', typeof FormSubmitActionSchema>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* GTM Tracker Interface for GTM Plugin
|
|
5
|
+
*/
|
|
6
|
+
export interface GTMTrackerInterface {
|
|
7
|
+
/** Push event to GTM dataLayer */
|
|
8
|
+
push: (eventName: string, eventData: Record<string, unknown>) => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* GTM Plugin Configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface GTMPluginConfig {
|
|
14
|
+
/** GTM tracker implementation. Browser implementations live in the browser entry point. */
|
|
15
|
+
tracker: GTMTrackerInterface;
|
|
16
|
+
/** Called when GTM event is pushed successfully */
|
|
17
|
+
onPush?: (eventName: string, eventData: Record<string, unknown>, context: BuilderActionRuntimeContext<GTMEventAction>) => void | Promise<void>;
|
|
18
|
+
/** Called when GTM event push fails */
|
|
19
|
+
onError?: (error: string, context: BuilderActionRuntimeContext<GTMEventAction>) => void | Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/** Schema for the `gtm_event` action configuration. */
|
|
22
|
+
export declare const GTMEventActionSchema: z.ZodMiniObject<{
|
|
23
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
24
|
+
eventName: z.ZodMiniString<string>;
|
|
25
|
+
eventData: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>>;
|
|
26
|
+
includeFormData: z.ZodMiniDefault<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export type GTMEventAction = BuilderActionConfig<'gtm_event', typeof GTMEventActionSchema>;
|
|
29
|
+
/** Creates a configured `gtm_event` action registration. */
|
|
30
|
+
export declare function gtmPlugin(config: GTMPluginConfig): BuilderActionRegistration<'gtm_event', typeof GTMEventActionSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action plugin factories and preconfigured registrations for FormEngine.
|
|
3
|
+
* Import a registration for built-in action types or create a configured
|
|
4
|
+
* registration with a plugin factory.
|
|
5
|
+
*/
|
|
6
|
+
/** Plugin factory functions; action config types come from the registrations passed to the engine. */
|
|
7
|
+
export * from './auto-save.plugin';
|
|
8
|
+
export * from './gtm.plugin';
|
|
9
|
+
export * from './notification.plugin';
|
|
10
|
+
export * from './form-reset.plugin';
|
|
11
|
+
export * from './form-submit.plugin';
|
|
12
|
+
/** Runtime-neutral pre-configured registrations. */
|
|
13
|
+
export * from './form-submit.registration';
|
|
14
|
+
export * from './notification.registration';
|
|
15
|
+
/** Convenience re-exports. */
|
|
16
|
+
export * from './registrations';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "../../chunk-QH7VW7IY.js";
|
|
2
|
+
import "../../chunk-BIHEIJG3.js";
|
|
3
|
+
import {
|
|
4
|
+
NotificationActionRegistration
|
|
5
|
+
} from "../../chunk-6FUGK5HQ.js";
|
|
6
|
+
import {
|
|
7
|
+
SubmitActionRegistration
|
|
8
|
+
} from "../../chunk-Z6DQLJS2.js";
|
|
9
|
+
import {
|
|
10
|
+
FormSubmitActionSchema,
|
|
11
|
+
formSubmitPlugin
|
|
12
|
+
} from "../../chunk-GT2LARKT.js";
|
|
13
|
+
import {
|
|
14
|
+
NotificationActionSchema,
|
|
15
|
+
notificationPlugin
|
|
16
|
+
} from "../../chunk-QT3EYUL5.js";
|
|
17
|
+
import {
|
|
18
|
+
FormResetActionSchema,
|
|
19
|
+
formResetPlugin
|
|
20
|
+
} from "../../chunk-LFWEJXWE.js";
|
|
21
|
+
import {
|
|
22
|
+
GTMEventActionSchema,
|
|
23
|
+
gtmPlugin
|
|
24
|
+
} from "../../chunk-ZDEZ2FOC.js";
|
|
25
|
+
import {
|
|
26
|
+
AutoSaveActionSchema,
|
|
27
|
+
autoSavePlugin,
|
|
28
|
+
getAutoSaveDraftStorageKey
|
|
29
|
+
} from "../../chunk-4XPLSYTK.js";
|
|
30
|
+
import "../../chunk-VGGERKV2.js";
|
|
31
|
+
export {
|
|
32
|
+
AutoSaveActionSchema,
|
|
33
|
+
FormResetActionSchema,
|
|
34
|
+
FormSubmitActionSchema,
|
|
35
|
+
GTMEventActionSchema,
|
|
36
|
+
NotificationActionRegistration,
|
|
37
|
+
NotificationActionSchema,
|
|
38
|
+
SubmitActionRegistration,
|
|
39
|
+
autoSavePlugin,
|
|
40
|
+
formResetPlugin,
|
|
41
|
+
formSubmitPlugin,
|
|
42
|
+
getAutoSaveDraftStorageKey,
|
|
43
|
+
gtmPlugin,
|
|
44
|
+
notificationPlugin
|
|
45
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Notification Plugin Configuration
|
|
5
|
+
*/
|
|
6
|
+
export interface NotificationPluginConfig {
|
|
7
|
+
/** Custom success handler */
|
|
8
|
+
onSuccess?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;
|
|
9
|
+
/** Custom error handler */
|
|
10
|
+
onError?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;
|
|
11
|
+
/** Custom warning handler */
|
|
12
|
+
onWarning?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;
|
|
13
|
+
/** Custom info handler */
|
|
14
|
+
onInfo?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;
|
|
15
|
+
/** Global handler for all notification types */
|
|
16
|
+
onNotification?: (message: string, variant: NotificationAction['variant'], context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/** Schema for the `show_notification` action configuration. */
|
|
19
|
+
export declare const NotificationActionSchema: z.ZodMiniObject<{
|
|
20
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
21
|
+
message: z.ZodMiniString<string>;
|
|
22
|
+
variant: z.ZodMiniDefault<z.ZodMiniEnum<{
|
|
23
|
+
success: "success";
|
|
24
|
+
error: "error";
|
|
25
|
+
warning: "warning";
|
|
26
|
+
info: "info";
|
|
27
|
+
}>>;
|
|
28
|
+
duration: z.ZodMiniOptional<z.ZodMiniDefault<z.ZodMiniNumber<number>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type NotificationAction = BuilderActionConfig<'show_notification', typeof NotificationActionSchema>;
|
|
31
|
+
/** Creates a configured `show_notification` action registration. */
|
|
32
|
+
export declare function notificationPlugin(config?: NotificationPluginConfig): BuilderActionRegistration<'show_notification', typeof NotificationActionSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Action Registration
|
|
3
|
+
*
|
|
4
|
+
* Pre-configured notification action.
|
|
5
|
+
* Register this declaration on your engine to enable the notification action type and get a default configuration.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createFormEngine, NotificationActionRegistration } from '@schema-engine/forms';
|
|
10
|
+
*
|
|
11
|
+
* const engine = createFormEngine({
|
|
12
|
+
* actions: [NotificationActionRegistration],
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { NotificationActionSchema } from './notification.plugin';
|
|
17
|
+
import type { BuilderActionRegistration } from '../../types/index.js';
|
|
18
|
+
/**
|
|
19
|
+
* Default Notification Action Registration
|
|
20
|
+
* Logs notifications via logger (override with toast library in your app)
|
|
21
|
+
*/
|
|
22
|
+
export declare const NotificationActionRegistration: BuilderActionRegistration<'show_notification', typeof NotificationActionSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convenience re-exports for all action registrations
|
|
3
|
+
*
|
|
4
|
+
* Import individual registrations for tree-shaking:
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import { SubmitActionRegistration } from '@schema-engine/forms';
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Or import multiple from this file:
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { SubmitActionRegistration, NotificationActionRegistration } from '@schema-engine/forms';
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export * from './form-submit.registration';
|
|
17
|
+
export * from './notification.registration';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "../../chunk-BIHEIJG3.js";
|
|
2
|
+
import {
|
|
3
|
+
NotificationActionRegistration
|
|
4
|
+
} from "../../chunk-6FUGK5HQ.js";
|
|
5
|
+
import {
|
|
6
|
+
SubmitActionRegistration
|
|
7
|
+
} from "../../chunk-Z6DQLJS2.js";
|
|
8
|
+
import "../../chunk-GT2LARKT.js";
|
|
9
|
+
import "../../chunk-QT3EYUL5.js";
|
|
10
|
+
import "../../chunk-VGGERKV2.js";
|
|
11
|
+
export {
|
|
12
|
+
NotificationActionRegistration,
|
|
13
|
+
SubmitActionRegistration
|
|
14
|
+
};
|