@schema-engine/forms 0.0.0-stage → 0.5.0
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-2PTM54FQ.js +51 -0
- package/dist/chunk-2PTM54FQ.js.map +7 -0
- package/dist/chunk-2VKEOE2L.js +907 -0
- package/dist/chunk-2VKEOE2L.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-56CJ2UZ7.js +55 -0
- package/dist/chunk-56CJ2UZ7.js.map +7 -0
- package/dist/chunk-5QXT7YAJ.js +87 -0
- package/dist/chunk-5QXT7YAJ.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-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-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-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-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-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-GY657L56.js +206 -0
- package/dist/chunk-GY657L56.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-HEAKWS27.js +2730 -0
- package/dist/chunk-HEAKWS27.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-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-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-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-PXWVKJGF.js +6 -0
- package/dist/chunk-PXWVKJGF.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-U2X3IYSD.js +23 -0
- package/dist/chunk-U2X3IYSD.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-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-WS7SLVXL.js +550 -0
- package/dist/chunk-WS7SLVXL.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-XPQRHO5E.js +587 -0
- package/dist/chunk-XPQRHO5E.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/form-state-container-conformance.d.ts +51 -0
- package/dist/testing/form-state-container-conformance.js +43 -0
- package/dist/testing/form-state-container-conformance.js.map +7 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.js +35 -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 +119 -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 +179 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AsyncRuleSchema,
|
|
3
|
+
Base64RuleSchema,
|
|
4
|
+
BaseValidationRuleSchema,
|
|
5
|
+
CidrRuleSchema,
|
|
6
|
+
Cuid2RuleSchema,
|
|
7
|
+
CuidRuleSchema,
|
|
8
|
+
DateRuleSchema,
|
|
9
|
+
DateTimeRuleSchema,
|
|
10
|
+
EmailRuleSchema,
|
|
11
|
+
HashRuleSchema,
|
|
12
|
+
HexRuleSchema,
|
|
13
|
+
Ipv4RuleSchema,
|
|
14
|
+
Ipv6RuleSchema,
|
|
15
|
+
JwtRuleSchema,
|
|
16
|
+
MaxItemsRuleSchema,
|
|
17
|
+
MaxLengthRuleSchema,
|
|
18
|
+
MaxRuleSchema,
|
|
19
|
+
MinItemsRuleSchema,
|
|
20
|
+
MinLengthRuleSchema,
|
|
21
|
+
MinRuleSchema,
|
|
22
|
+
PatternRuleSchema,
|
|
23
|
+
PhoneRuleSchema,
|
|
24
|
+
RelateRuleSchema,
|
|
25
|
+
RelationAssertSchema,
|
|
26
|
+
RequiredRuleSchema,
|
|
27
|
+
TimeRuleSchema,
|
|
28
|
+
UlidRuleSchema,
|
|
29
|
+
UrlRuleSchema,
|
|
30
|
+
UuidRuleSchema,
|
|
31
|
+
ValidationRuleSchema
|
|
32
|
+
} from "../../chunk-KE53GN4Q.js";
|
|
33
|
+
export {
|
|
34
|
+
AsyncRuleSchema,
|
|
35
|
+
Base64RuleSchema,
|
|
36
|
+
BaseValidationRuleSchema,
|
|
37
|
+
CidrRuleSchema,
|
|
38
|
+
Cuid2RuleSchema,
|
|
39
|
+
CuidRuleSchema,
|
|
40
|
+
DateRuleSchema,
|
|
41
|
+
DateTimeRuleSchema,
|
|
42
|
+
EmailRuleSchema,
|
|
43
|
+
HashRuleSchema,
|
|
44
|
+
HexRuleSchema,
|
|
45
|
+
Ipv4RuleSchema,
|
|
46
|
+
Ipv6RuleSchema,
|
|
47
|
+
JwtRuleSchema,
|
|
48
|
+
MaxItemsRuleSchema,
|
|
49
|
+
MaxLengthRuleSchema,
|
|
50
|
+
MaxRuleSchema,
|
|
51
|
+
MinItemsRuleSchema,
|
|
52
|
+
MinLengthRuleSchema,
|
|
53
|
+
MinRuleSchema,
|
|
54
|
+
PatternRuleSchema,
|
|
55
|
+
PhoneRuleSchema,
|
|
56
|
+
RelateRuleSchema,
|
|
57
|
+
RelationAssertSchema,
|
|
58
|
+
RequiredRuleSchema,
|
|
59
|
+
TimeRuleSchema,
|
|
60
|
+
UlidRuleSchema,
|
|
61
|
+
UrlRuleSchema,
|
|
62
|
+
UuidRuleSchema,
|
|
63
|
+
ValidationRuleSchema
|
|
64
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import type { ValidationScope, ValidationRule, BaseValidationRule } from './types.js';
|
|
3
|
+
import type { BaseField } from '../base-field.js';
|
|
4
|
+
import type { ValidationRegistry } from './validation-registry.js';
|
|
5
|
+
import type { DebounceScope } from '../../lib/debounce.js';
|
|
6
|
+
type ValidationRuleType = ValidationRule | BaseValidationRule;
|
|
7
|
+
interface ValidationElement {
|
|
8
|
+
$type?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
rules?: ValidationRuleType[];
|
|
11
|
+
}
|
|
12
|
+
interface FieldConfigElement extends BaseField {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
type FormElement = ValidationElement | FieldConfigElement;
|
|
16
|
+
export type ValidatableField = {
|
|
17
|
+
path: string;
|
|
18
|
+
rules: ReadonlyArray<BaseValidationRule>;
|
|
19
|
+
};
|
|
20
|
+
export declare function isFieldRequired(rules?: ReadonlyArray<{
|
|
21
|
+
readonly $type: string;
|
|
22
|
+
}>): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Configured rules plus any `defaultFor` rules registered for the field `$type`.
|
|
25
|
+
*
|
|
26
|
+
* @remarks Default rules are stored as `{ $type }` and asserted as `TRule` because
|
|
27
|
+
* every validation rule in the union is identified by `$type` alone.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getValidationRulesForElement<TRule extends BaseValidationRule>(element: {
|
|
30
|
+
$type?: string;
|
|
31
|
+
rules?: readonly TRule[];
|
|
32
|
+
}, registry: ValidationRegistry): ReadonlyArray<TRule> | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Leaf fields with validation rules, using composed paths (`address.street`).
|
|
35
|
+
* Array indices are expanded later against live values.
|
|
36
|
+
*/
|
|
37
|
+
export declare function collectValidatableFields(elements: readonly object[], basePath: string, registry: ValidationRegistry): ValidatableField[];
|
|
38
|
+
export interface ValidationContextInput {
|
|
39
|
+
/** Nested value tree for the whole form. Renderers holding flat values expand them first. */
|
|
40
|
+
values?: Record<string, unknown>;
|
|
41
|
+
/** Rendered path of the field being validated, e.g. `contacts.0.email`. */
|
|
42
|
+
fieldPath?: string;
|
|
43
|
+
/** Reuse keyed async validation state across calls when the caller owns its lifetime. */
|
|
44
|
+
debounceScope?: DebounceScope;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds the context handed to every validation handler.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Both inputs default so a caller with no cross-field rules — a unit test, or a
|
|
51
|
+
* schema generated without values — can still satisfy the required argument.
|
|
52
|
+
* An empty context resolves every reference to `undefined`, which cross-field
|
|
53
|
+
* rules treat as "not filled in" rather than as a match.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createValidationContext({ values, fieldPath, debounceScope, }?: ValidationContextInput): ValidationScope;
|
|
56
|
+
/**
|
|
57
|
+
* Combines a field's rules into one Zod Mini schema.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* A rule of the `string` or `date` category (email, url, pattern, minLength, phone and the other formats,
|
|
61
|
+
* including a consumer's registrations in those categories) passes an empty value, so an optional field
|
|
62
|
+
* can be left blank; `required` is what rejects it. Rules of other categories, such as `minItems`, are
|
|
63
|
+
* unchanged.
|
|
64
|
+
*
|
|
65
|
+
* A rule that cannot be built throws `ValidationRuleError`; it is never skipped.
|
|
66
|
+
*
|
|
67
|
+
* `context` is required. Callers with no form values to offer pass
|
|
68
|
+
* `createValidationContext()` explicitly, so omitting the form context is a
|
|
69
|
+
* decision in the diff rather than an accident nobody notices until a
|
|
70
|
+
* cross-field rule silently passes.
|
|
71
|
+
*/
|
|
72
|
+
export declare function createZodSchemaFromRules(rules: ReadonlyArray<ValidationRuleType> | undefined, context: ValidationScope, registry: ValidationRegistry): z.ZodMiniType;
|
|
73
|
+
export declare function generateFormSchema(elements: FormElement[], registry: ValidationRegistry): z.ZodMiniObject<{
|
|
74
|
+
[x: string]: z.ZodMiniType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectValidatableFields,
|
|
3
|
+
createValidationContext,
|
|
4
|
+
createZodSchemaFromRules,
|
|
5
|
+
generateFormSchema,
|
|
6
|
+
getValidationRulesForElement,
|
|
7
|
+
isFieldRequired
|
|
8
|
+
} from "../../chunk-KLATKWUA.js";
|
|
9
|
+
import "../../chunk-YDGH7DTL.js";
|
|
10
|
+
import "../../chunk-S7I76ISM.js";
|
|
11
|
+
import "../../chunk-CRQWKC67.js";
|
|
12
|
+
import "../../chunk-QLGM2AZW.js";
|
|
13
|
+
import "../../chunk-OR2L7EKO.js";
|
|
14
|
+
import "../../chunk-ZUYSGCEH.js";
|
|
15
|
+
import "../../chunk-3YLRJVVN.js";
|
|
16
|
+
import "../../chunk-CMPOBBRV.js";
|
|
17
|
+
export {
|
|
18
|
+
collectValidatableFields,
|
|
19
|
+
createValidationContext,
|
|
20
|
+
createZodSchemaFromRules,
|
|
21
|
+
generateFormSchema,
|
|
22
|
+
getValidationRulesForElement,
|
|
23
|
+
isFieldRequired
|
|
24
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import { type ReadOnlyRegistry } from '@schema-engine/registry';
|
|
3
|
+
import type { AnyValidationRegistration, BaseValidationRule, ValidationScope, ValidationRegistrationConstraint } from './types.js';
|
|
4
|
+
import { type FormFetch } from '../../lib/form-fetch.js';
|
|
5
|
+
import { type FormValidationIssue } from '../../lib/validate-form/issues.js';
|
|
6
|
+
/**
|
|
7
|
+
* Read-only store of validation registrations, with the lookups the renderers and the engine need.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Built by {@link createValidationRegistry}, so it has no `register`, `unregister` or `clear`: to
|
|
11
|
+
* change the rules, build another registry from a new list. The per-field-type default rules are
|
|
12
|
+
* derived from the registrations once, at build.
|
|
13
|
+
*/
|
|
14
|
+
export interface ValidationRegistry extends ReadOnlyRegistry<AnyValidationRegistration> {
|
|
15
|
+
/**
|
|
16
|
+
* Default rules injected for a field `$type` when the author omitted them.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Frozen, and shared between calls. When a registration is replaced, its default rules keep the
|
|
20
|
+
* position the first registration of that `$type` had among the field type's defaults.
|
|
21
|
+
*/
|
|
22
|
+
getDefaultRulesForFieldType(fieldType: string): readonly BaseValidationRule[];
|
|
23
|
+
/**
|
|
24
|
+
* Field references a rule reads besides the value under test.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Lives on the registry because the answer comes from the registration, and a
|
|
28
|
+
* consumer-registered type is a plain string that `get` would otherwise need
|
|
29
|
+
* a cast to reach at every call site.
|
|
30
|
+
*/
|
|
31
|
+
getRuleDependencies(rule: {
|
|
32
|
+
$type: string;
|
|
33
|
+
}): readonly string[];
|
|
34
|
+
/** The options of a rule its registration exposes to messages (`{ minLength: 8 }`), or `undefined` when it exposes none. */
|
|
35
|
+
getRuleParams(rule: {
|
|
36
|
+
$type: string;
|
|
37
|
+
}): Readonly<Record<string, unknown>> | undefined;
|
|
38
|
+
/** The fallback text of an issue of a rule: its author's `message`, or what its registration takes from the schema's `reported` text. */
|
|
39
|
+
getRuleMessage(rule: {
|
|
40
|
+
$type: string;
|
|
41
|
+
message?: string;
|
|
42
|
+
}, reported: string | undefined): string | undefined;
|
|
43
|
+
/** Registrations of one category. */
|
|
44
|
+
getByCategory(category: string): AnyValidationRegistration[];
|
|
45
|
+
/**
|
|
46
|
+
* The request function of the rules that make requests: the engine's `fetch`, or the global one for a standalone registry.
|
|
47
|
+
*
|
|
48
|
+
* @remarks `createSchema` hands it to every handler as `context.fetch`, whatever context the caller built.
|
|
49
|
+
*/
|
|
50
|
+
readonly fetch: FormFetch;
|
|
51
|
+
/**
|
|
52
|
+
* Create a Zod Mini schema from a validation rule.
|
|
53
|
+
*
|
|
54
|
+
* @param rule - The validation rule
|
|
55
|
+
* @param context - Form context for rules that read other fields
|
|
56
|
+
* @throws {ValidationRuleError} When the rule type is not registered or its handler throws
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* A rule that cannot be built is never skipped: a form that silently skipped it would accept values
|
|
60
|
+
* the author meant to reject. A config is checked with {@link ValidationRegistry.check} when it is
|
|
61
|
+
* validated, so reaching this error at run time means the registry changed after that.
|
|
62
|
+
*
|
|
63
|
+
* `context` is required rather than optional so a caller cannot silently omit
|
|
64
|
+
* it: a renderer that did exactly that is why cross-field rules were inert on
|
|
65
|
+
* one of the two renderers. Build it with `createValidationContext`.
|
|
66
|
+
*
|
|
67
|
+
* The rule type is generic, not `{ $type: string }`, so a rule literal with extra properties such as
|
|
68
|
+
* `{ $type: 'min', value: 10 }` is not rejected as an excess-property error.
|
|
69
|
+
*/
|
|
70
|
+
createSchema<T extends {
|
|
71
|
+
$type: string;
|
|
72
|
+
}>(rule: T, context: ValidationScope): z.ZodMiniType;
|
|
73
|
+
/**
|
|
74
|
+
* Whether a rule can be used, and the rule as its registration parses it.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* The one check of a rule written in a form config: its `$type` is registered, its options satisfy the
|
|
78
|
+
* registration's `schema`, and the handler builds a schema for it, so a rule that throws is found when
|
|
79
|
+
* the form config is validated and not when a user first types. The registration owns the shape, so a
|
|
80
|
+
* registration that replaces a built-in decides its options. The rule that comes back is the parsed
|
|
81
|
+
* one, which is what the handler runs on: the schema's defaults applied, and `$type`, `message`, `id` and
|
|
82
|
+
* `severity` kept from the authored rule even when the schema is a plain object that strips them.
|
|
83
|
+
*
|
|
84
|
+
* Issue paths are relative to the rule: an option the schema refuses is reported at its key, and a
|
|
85
|
+
* `$type` nothing registers or a handler that throws at `$type`.
|
|
86
|
+
*/
|
|
87
|
+
check(rule: {
|
|
88
|
+
$type: string;
|
|
89
|
+
}): RuleCheck;
|
|
90
|
+
}
|
|
91
|
+
/** What {@link ValidationRegistry.check} found: the rule as its registration parses it, or the issues that make it unusable. */
|
|
92
|
+
export type RuleCheck = {
|
|
93
|
+
readonly ok: true;
|
|
94
|
+
readonly rule: BaseValidationRule;
|
|
95
|
+
} | {
|
|
96
|
+
readonly ok: false;
|
|
97
|
+
readonly issues: readonly FormValidationIssue[];
|
|
98
|
+
};
|
|
99
|
+
/** What a validation registry is built with besides its registrations. */
|
|
100
|
+
export interface ValidationRegistryOptions {
|
|
101
|
+
/** The request function of rules that make requests; the global `fetch` by default. */
|
|
102
|
+
readonly fetch?: FormFetch;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build a read-only validation registry from a list of registrations.
|
|
106
|
+
*
|
|
107
|
+
* @param registrations - Validation registrations, keyed by `$type`
|
|
108
|
+
* @throws {Error} Naming the `$type` when a winning registration's schema is not a Standard Schema
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* Stored by `createRegistry` from `@schema-engine/registry`: a later registration with the same
|
|
112
|
+
* `$type` replaces the earlier one without a warning, so `[...defaults, custom]` overrides a rule.
|
|
113
|
+
* The built-in rules are not added; use {@link createDefaultValidationRegistry} for those.
|
|
114
|
+
*
|
|
115
|
+
* Takes {@link ValidationRegistrationConstraint}, which erases each rule type so a
|
|
116
|
+
* `ValidationRegistration<PostcodeRule>` is accepted; the registrations are stored as
|
|
117
|
+
* {@link AnyValidationRegistration} after that single cast.
|
|
118
|
+
*/
|
|
119
|
+
export declare function createValidationRegistry(registrations: readonly ValidationRegistrationConstraint[], options?: ValidationRegistryOptions): ValidationRegistry;
|
|
120
|
+
/**
|
|
121
|
+
* The built-in rules followed by any extra registrations, so an extra registration with a built-in
|
|
122
|
+
* `$type` overrides it.
|
|
123
|
+
*/
|
|
124
|
+
export declare function createDefaultValidationRegistry(extra?: readonly ValidationRegistrationConstraint[], options?: ValidationRegistryOptions): ValidationRegistry;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDefaultValidationRegistry,
|
|
3
|
+
createValidationRegistry
|
|
4
|
+
} from "../../chunk-6IZYNHZ3.js";
|
|
5
|
+
import "../../chunk-FVOL3ZOJ.js";
|
|
6
|
+
import "../../chunk-LMWJAD3B.js";
|
|
7
|
+
import "../../chunk-OUF57UZ7.js";
|
|
8
|
+
import "../../chunk-G33EUV7N.js";
|
|
9
|
+
import "../../chunk-J7GSNWXT.js";
|
|
10
|
+
import "../../chunk-MD23VADH.js";
|
|
11
|
+
import "../../chunk-OLYHNFKC.js";
|
|
12
|
+
import "../../chunk-KE53GN4Q.js";
|
|
13
|
+
import "../../chunk-KLATKWUA.js";
|
|
14
|
+
import "../../chunk-YDGH7DTL.js";
|
|
15
|
+
import "../../chunk-S7I76ISM.js";
|
|
16
|
+
import "../../chunk-CRQWKC67.js";
|
|
17
|
+
import "../../chunk-QLGM2AZW.js";
|
|
18
|
+
import "../../chunk-OR2L7EKO.js";
|
|
19
|
+
import "../../chunk-ZUYSGCEH.js";
|
|
20
|
+
import "../../chunk-6BAJHAGL.js";
|
|
21
|
+
import "../../chunk-6NV2JDGI.js";
|
|
22
|
+
import "../../chunk-3YLRJVVN.js";
|
|
23
|
+
import "../../chunk-CMPOBBRV.js";
|
|
24
|
+
export {
|
|
25
|
+
createDefaultValidationRegistry,
|
|
26
|
+
createValidationRegistry
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FormStateErrorsInput } from '../state-container/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The input of `setServerErrors` for a JSON:API error document.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Reads `errors[]`: `source.pointer` is a JSON Pointer to the dotted path, without a leading `/data/attributes`,
|
|
7
|
+
* and no pointer means the form ({@link FORM_ROOT}). An issue's `type` is its `code`, its `message` its `detail`,
|
|
8
|
+
* and the plain serializable members of its `meta` become `params`. Several errors on one path become a list.
|
|
9
|
+
* Reads no text of its own: `title` and `status` are not carried.
|
|
10
|
+
*
|
|
11
|
+
* @throws {ServerErrorsInputError} For input that is not an object with an `errors` list of objects, for an error with none of `source.pointer`, `detail` and `code`, for a `source` that is not an object, for a `source.pointer` that is not a string, and for a pointer that is not one or names a reserved segment.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fromJsonApiErrors(document: unknown): FormStateErrorsInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type FormStateErrorsInput } from '../state-container/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The input of `setServerErrors` for an RFC 9457 Problem Details response.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Reads the common `errors` extension, a list of `{ pointer?, detail?, code?, ...extra }`: `pointer` is a JSON
|
|
7
|
+
* Pointer (RFC 6901, plain or as a URI fragment) that becomes the dotted path, and no pointer means the form
|
|
8
|
+
* ({@link FORM_ROOT}). An issue's `type` is its `code`, else the problem's `type` (`about:blank` names none), its
|
|
9
|
+
* `message` is its `detail`, and the other members become `params` when they are plain serializable values.
|
|
10
|
+
* Several errors on one path become a list. A problem with no `errors` is one issue on the form, with the
|
|
11
|
+
* problem's `type` and `detail`. Reads no text of its own: `title` and `status` are not carried.
|
|
12
|
+
*
|
|
13
|
+
* @throws {ServerErrorsInputError} For input that is not an object with a recognisable member, for an `errors` that is not a list of objects, for an error with none of `pointer`, `detail` and `code`, for a `pointer` that is not a string, and for a pointer that is not one or names a reserved segment.
|
|
14
|
+
*/
|
|
15
|
+
export declare function fromProblemDetails(problem: unknown): FormStateErrorsInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers that turn a server's error response into the input of `setServerErrors`.
|
|
3
|
+
*
|
|
4
|
+
* @remarks Pure functions with no state: they read a response and return `path -> issue or issues`.
|
|
5
|
+
*/
|
|
6
|
+
export { fromJsonApiErrors } from './from-json-api-errors';
|
|
7
|
+
export { fromProblemDetails } from './from-problem-details';
|
|
8
|
+
export { ServerErrorsInputError } from './shared';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fromJsonApiErrors
|
|
3
|
+
} from "../chunk-2PTM54FQ.js";
|
|
4
|
+
import {
|
|
5
|
+
fromProblemDetails
|
|
6
|
+
} from "../chunk-56CJ2UZ7.js";
|
|
7
|
+
import {
|
|
8
|
+
ServerErrorsInputError
|
|
9
|
+
} from "../chunk-5QXT7YAJ.js";
|
|
10
|
+
import "../chunk-PXWVKJGF.js";
|
|
11
|
+
import "../chunk-3YLRJVVN.js";
|
|
12
|
+
import "../chunk-CMPOBBRV.js";
|
|
13
|
+
export {
|
|
14
|
+
ServerErrorsInputError,
|
|
15
|
+
fromJsonApiErrors,
|
|
16
|
+
fromProblemDetails
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isPlainObject } from '../lib/is-plain-object.js';
|
|
2
|
+
import { type FormStateErrorInput, type FormStateErrorsInput } from '../state-container/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Thrown by the server error helpers for input whose shape they do not recognise, or that names a path no field can have.
|
|
5
|
+
*
|
|
6
|
+
* @remarks The helpers never guess: a response they cannot read is an outage for the host to handle, not a field error.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ServerErrorsInputError extends Error {
|
|
9
|
+
readonly name = "ServerErrorsInputError";
|
|
10
|
+
}
|
|
11
|
+
export declare const isRecord: typeof isPlainObject;
|
|
12
|
+
/** The members of `source` outside `omit` that are plain serializable values, or `undefined` when none are. */
|
|
13
|
+
export declare function serializableParams(source: Readonly<Record<string, unknown>>, omit: ReadonlySet<string>): Readonly<Record<string, unknown>> | undefined;
|
|
14
|
+
/** The text of `value` when it is a non-empty string. */
|
|
15
|
+
export declare const textOf: (value: unknown) => string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The dotted path of a JSON Pointer (RFC 6901), in its plain or URI fragment form (`#/a/0/b`).
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* An empty pointer names the whole document, so the form. A segment is unescaped (`~1` is `/`, `~0` is `~`),
|
|
21
|
+
* and one that holds a `.` cannot be a field name in a dotted path. `skip` lists leading segments that are not
|
|
22
|
+
* part of the path, such as `data` and `attributes` of a JSON:API document.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pointerToPath(pointer: string, skip?: readonly string[]): string;
|
|
25
|
+
/** Collects issues by path: one stays an issue, several become a list in the order they came. */
|
|
26
|
+
export declare function groupByPath(found: ReadonlyArray<readonly [string, FormStateErrorInput]>): FormStateErrorsInput;
|
|
27
|
+
/** An issue with only the parts that are there. */
|
|
28
|
+
export declare function issueOf(parts: {
|
|
29
|
+
readonly type?: string;
|
|
30
|
+
readonly message?: string;
|
|
31
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
32
|
+
}): FormStateErrorInput;
|
|
33
|
+
/** The list at `key` of `source`, which must be an array of records when it is there. */
|
|
34
|
+
export declare function recordsAt(source: Readonly<Record<string, unknown>>, key: string, what: string): ReadonlyArray<Readonly<Record<string, unknown>>> | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ServerErrorsInputError,
|
|
3
|
+
groupByPath,
|
|
4
|
+
isRecord,
|
|
5
|
+
issueOf,
|
|
6
|
+
pointerToPath,
|
|
7
|
+
recordsAt,
|
|
8
|
+
serializableParams,
|
|
9
|
+
textOf
|
|
10
|
+
} from "../chunk-5QXT7YAJ.js";
|
|
11
|
+
import "../chunk-PXWVKJGF.js";
|
|
12
|
+
import "../chunk-3YLRJVVN.js";
|
|
13
|
+
import "../chunk-CMPOBBRV.js";
|
|
14
|
+
export {
|
|
15
|
+
ServerErrorsInputError,
|
|
16
|
+
groupByPath,
|
|
17
|
+
isRecord,
|
|
18
|
+
issueOf,
|
|
19
|
+
pointerToPath,
|
|
20
|
+
recordsAt,
|
|
21
|
+
serializableParams,
|
|
22
|
+
textOf
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FormStateContainer, type FormStateContainerOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the engine's reference {@link FormStateContainer}: framework-free, with the engine's validation.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Values live in null-prototype maps and come out of the snapshot as frozen plain records; both views
|
|
7
|
+
* share structure, so a branch no command touched keeps its reference. Validation goes through
|
|
8
|
+
* `planFormValidation` and `runValidationPlan` with one debounce scope for recorded validation. Each silent
|
|
9
|
+
* {@link FormStateContainer.checkValidity} gets a scope of its own, so it neither replaces a debounced call of
|
|
10
|
+
* the validation that writes errors nor another check's, and answers for the value it was called with.
|
|
11
|
+
*
|
|
12
|
+
* Errors, native facts, touched marks and checks are trees with a slot per node, in the shape of the
|
|
13
|
+
* values. A row operation is one splice, applied to the values and to every tree in the same commit, so
|
|
14
|
+
* state cannot fall out of step with its rows. A validation result that arrives late finds its fields by
|
|
15
|
+
* row id, not by index, and is applied only while the scope it covered is current.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createFormStateContainer(options: FormStateContainerOptions): FormStateContainer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFormStateContainer
|
|
3
|
+
} from "../chunk-2VKEOE2L.js";
|
|
4
|
+
import "../chunk-GH34XFCC.js";
|
|
5
|
+
import "../chunk-QYHOFLRX.js";
|
|
6
|
+
import "../chunk-EEYGPPLU.js";
|
|
7
|
+
import "../chunk-BLFLCSG3.js";
|
|
8
|
+
import "../chunk-NJTLBSTR.js";
|
|
9
|
+
import "../chunk-UN3DARLG.js";
|
|
10
|
+
import "../chunk-EQ5AIF3T.js";
|
|
11
|
+
import "../chunk-VGGERKV2.js";
|
|
12
|
+
import "../chunk-WUTGZYP4.js";
|
|
13
|
+
import "../chunk-R3MBVWVI.js";
|
|
14
|
+
import "../chunk-3B7CJOF6.js";
|
|
15
|
+
import "../chunk-KLATKWUA.js";
|
|
16
|
+
import "../chunk-YDGH7DTL.js";
|
|
17
|
+
import "../chunk-S7I76ISM.js";
|
|
18
|
+
import "../chunk-CRQWKC67.js";
|
|
19
|
+
import "../chunk-QLGM2AZW.js";
|
|
20
|
+
import "../chunk-OR2L7EKO.js";
|
|
21
|
+
import "../chunk-ZUYSGCEH.js";
|
|
22
|
+
import "../chunk-6BAJHAGL.js";
|
|
23
|
+
import "../chunk-6NV2JDGI.js";
|
|
24
|
+
import "../chunk-PXWVKJGF.js";
|
|
25
|
+
import "../chunk-RB22U6HI.js";
|
|
26
|
+
import "../chunk-K5TMXCMY.js";
|
|
27
|
+
import "../chunk-3YLRJVVN.js";
|
|
28
|
+
import "../chunk-CMPOBBRV.js";
|
|
29
|
+
export {
|
|
30
|
+
createFormStateContainer
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Tree } from './state-tree';
|
|
2
|
+
/**
|
|
3
|
+
* Where `value` differs from `defaultValue`, in the shape of the value.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A leaf differs when it is not the same value; an opaque value is compared by reference. An array's own
|
|
7
|
+
* mark means its row count changed, and its rows are compared index by index against the default's, so a
|
|
8
|
+
* row appended after the last default row is dirty and the rows before it are not. A container with no
|
|
9
|
+
* default holds its fields to `undefined`. The walk stops at any branch shared with the defaults.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dirtyTree(value: unknown, defaultValue: unknown): Tree<true>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field-array operations shared by React and Radiant form adapters.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Errors and touched state move with their rows. An operation naming a row that
|
|
6
|
+
* does not exist does nothing (`insert` also accepts the index past the last
|
|
7
|
+
* row), and `remove` removes each listed row once, however often it is listed.
|
|
8
|
+
*/
|
|
9
|
+
export interface FieldArrayValue {
|
|
10
|
+
fields: Array<{
|
|
11
|
+
id: string;
|
|
12
|
+
}>;
|
|
13
|
+
append: (value: unknown) => void;
|
|
14
|
+
prepend: (value: unknown) => void;
|
|
15
|
+
insert: (index: number, value: unknown) => void;
|
|
16
|
+
swap: (indexA: number, indexB: number) => void;
|
|
17
|
+
move: (indexA: number, indexB: number) => void;
|
|
18
|
+
update: (index: number, value: unknown) => void;
|
|
19
|
+
replace: (value: unknown[]) => void;
|
|
20
|
+
remove: (index?: number | number[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/** The operations of a field array, which a container keeps one set of per array path. */
|
|
23
|
+
export type FieldArrayCommands = Omit<FieldArrayValue, 'fields'>;
|
|
24
|
+
/**
|
|
25
|
+
* The `fields` of a field array: one `{ id }` per row, in row order.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The same array comes back for the same row ids, so a binding can compare it by reference.
|
|
29
|
+
*/
|
|
30
|
+
export declare function selectFields(rowIds: readonly string[] | undefined): Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Builds the React Hook Form style field array a binding hands to its widgets.
|
|
35
|
+
*
|
|
36
|
+
* @param rowIds - The ids of the array's rows, from `snapshot.rowIds[path]`.
|
|
37
|
+
* @param commands - The container's commands for the array, from `fieldArray(path)`.
|
|
38
|
+
*
|
|
39
|
+
* @remarks Memoized by the commands and the row ids array, so the same object comes back until the rows change.
|
|
40
|
+
*/
|
|
41
|
+
export declare function toFieldArrayValue(rowIds: readonly string[] | undefined, commands: FieldArrayCommands): FieldArrayValue;
|