@schema-engine/forms 0.0.0-stage → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/actions/index.d.ts +3 -0
- package/dist/actions/index.js +50 -0
- package/dist/actions/index.js.map +7 -0
- package/dist/actions/plugins/auto-save.plugin.d.ts +39 -0
- package/dist/actions/plugins/auto-save.plugin.js +10 -0
- package/dist/actions/plugins/auto-save.plugin.js.map +7 -0
- package/dist/actions/plugins/form-reset.plugin.d.ts +23 -0
- package/dist/actions/plugins/form-reset.plugin.js +9 -0
- package/dist/actions/plugins/form-reset.plugin.js.map +7 -0
- package/dist/actions/plugins/form-submit.plugin.d.ts +31 -0
- package/dist/actions/plugins/form-submit.plugin.js +9 -0
- package/dist/actions/plugins/form-submit.plugin.js.map +7 -0
- package/dist/actions/plugins/form-submit.registration.d.ts +22 -0
- package/dist/actions/plugins/form-submit.registration.js +8 -0
- package/dist/actions/plugins/form-submit.registration.js.map +7 -0
- package/dist/actions/plugins/gtm.plugin.d.ts +30 -0
- package/dist/actions/plugins/gtm.plugin.js +8 -0
- package/dist/actions/plugins/gtm.plugin.js.map +7 -0
- package/dist/actions/plugins/index.d.ts +16 -0
- package/dist/actions/plugins/index.js +45 -0
- package/dist/actions/plugins/index.js.map +7 -0
- package/dist/actions/plugins/notification.plugin.d.ts +32 -0
- package/dist/actions/plugins/notification.plugin.js +9 -0
- package/dist/actions/plugins/notification.plugin.js.map +7 -0
- package/dist/actions/plugins/notification.registration.d.ts +22 -0
- package/dist/actions/plugins/notification.registration.js +8 -0
- package/dist/actions/plugins/notification.registration.js.map +7 -0
- package/dist/actions/plugins/registrations.d.ts +17 -0
- package/dist/actions/plugins/registrations.js +14 -0
- package/dist/actions/plugins/registrations.js.map +7 -0
- package/dist/actions/triggers.d.ts +42 -0
- package/dist/actions/triggers.js +6 -0
- package/dist/actions/triggers.js.map +7 -0
- package/dist/actions/types.d.ts +16 -0
- package/dist/actions/types.js +1 -0
- package/dist/actions/types.js.map +7 -0
- package/dist/agent-tool/index.d.ts +54 -0
- package/dist/agent-tool/index.js +128 -0
- package/dist/agent-tool/index.js.map +7 -0
- package/dist/browser/action-registrations.d.ts +46 -0
- package/dist/browser/action-registrations.js +19 -0
- package/dist/browser/action-registrations.js.map +7 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.js +36 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/tools/auto-save-storage.d.ts +20 -0
- package/dist/browser/tools/auto-save-storage.js +12 -0
- package/dist/browser/tools/auto-save-storage.js.map +7 -0
- package/dist/browser/tools/gdpr-consent.d.ts +32 -0
- package/dist/browser/tools/gdpr-consent.js +11 -0
- package/dist/browser/tools/gdpr-consent.js.map +7 -0
- package/dist/browser/tools/gtm-tracker.d.ts +7 -0
- package/dist/browser/tools/gtm-tracker.js +7 -0
- package/dist/browser/tools/gtm-tracker.js.map +7 -0
- package/dist/builder/form-authoring.d.ts +159 -0
- package/dist/builder/form-authoring.js +1 -0
- package/dist/builder/form-authoring.js.map +7 -0
- package/dist/builder/form-values.d.ts +158 -0
- package/dist/builder/form-values.js +0 -0
- package/dist/builder/form-values.js.map +7 -0
- package/dist/builder/index.d.ts +5 -0
- package/dist/builder/index.js +2 -0
- package/dist/builder/index.js.map +7 -0
- package/dist/builder/types.utils.d.ts +137 -0
- package/dist/builder/types.utils.js +1 -0
- package/dist/builder/types.utils.js.map +7 -0
- package/dist/chunk-237BHPDH.js +88 -0
- package/dist/chunk-237BHPDH.js.map +7 -0
- package/dist/chunk-25PLQDKN.js +45 -0
- package/dist/chunk-25PLQDKN.js.map +7 -0
- package/dist/chunk-2XWISGGM.js +8 -0
- package/dist/chunk-2XWISGGM.js.map +7 -0
- package/dist/chunk-2YKQAVI2.js +8 -0
- package/dist/chunk-2YKQAVI2.js.map +7 -0
- package/dist/chunk-3B7CJOF6.js +18 -0
- package/dist/chunk-3B7CJOF6.js.map +7 -0
- package/dist/chunk-3YLRJVVN.js +17 -0
- package/dist/chunk-3YLRJVVN.js.map +7 -0
- package/dist/chunk-4CUGHU36.js +58 -0
- package/dist/chunk-4CUGHU36.js.map +7 -0
- package/dist/chunk-4FELFUCD.js +0 -0
- package/dist/chunk-4FELFUCD.js.map +7 -0
- package/dist/chunk-4XPLSYTK.js +82 -0
- package/dist/chunk-4XPLSYTK.js.map +7 -0
- package/dist/chunk-5Y6U3MR3.js +54 -0
- package/dist/chunk-5Y6U3MR3.js.map +7 -0
- package/dist/chunk-6BAJHAGL.js +29 -0
- package/dist/chunk-6BAJHAGL.js.map +7 -0
- package/dist/chunk-6EYX257T.js +23 -0
- package/dist/chunk-6EYX257T.js.map +7 -0
- package/dist/chunk-6FUGK5HQ.js +26 -0
- package/dist/chunk-6FUGK5HQ.js.map +7 -0
- package/dist/chunk-6IZYNHZ3.js +118 -0
- package/dist/chunk-6IZYNHZ3.js.map +7 -0
- package/dist/chunk-6NV2JDGI.js +8 -0
- package/dist/chunk-6NV2JDGI.js.map +7 -0
- package/dist/chunk-6R2MBQPL.js +19 -0
- package/dist/chunk-6R2MBQPL.js.map +7 -0
- package/dist/chunk-7EQJUI5N.js +40 -0
- package/dist/chunk-7EQJUI5N.js.map +7 -0
- package/dist/chunk-A5VLMQAK.js +2780 -0
- package/dist/chunk-A5VLMQAK.js.map +7 -0
- package/dist/chunk-AUZ45XPE.js +27 -0
- package/dist/chunk-AUZ45XPE.js.map +7 -0
- package/dist/chunk-BIHEIJG3.js +0 -0
- package/dist/chunk-BIHEIJG3.js.map +7 -0
- package/dist/chunk-BKNWW4PK.js +0 -0
- package/dist/chunk-BKNWW4PK.js.map +7 -0
- package/dist/chunk-BLFLCSG3.js +71 -0
- package/dist/chunk-BLFLCSG3.js.map +7 -0
- package/dist/chunk-BYYGAGNH.js +0 -0
- package/dist/chunk-BYYGAGNH.js.map +7 -0
- package/dist/chunk-CANRZY5A.js +87 -0
- package/dist/chunk-CANRZY5A.js.map +7 -0
- package/dist/chunk-CAZPWBQ4.js +18 -0
- package/dist/chunk-CAZPWBQ4.js.map +7 -0
- package/dist/chunk-CMPOBBRV.js +10 -0
- package/dist/chunk-CMPOBBRV.js.map +7 -0
- package/dist/chunk-CRQWKC67.js +118 -0
- package/dist/chunk-CRQWKC67.js.map +7 -0
- package/dist/chunk-CRVXBWSY.js +70 -0
- package/dist/chunk-CRVXBWSY.js.map +7 -0
- package/dist/chunk-D6ZHV6AT.js +0 -0
- package/dist/chunk-D6ZHV6AT.js.map +7 -0
- package/dist/chunk-DP7SYLLI.js +206 -0
- package/dist/chunk-DP7SYLLI.js.map +7 -0
- package/dist/chunk-DVDKPY2A.js +12 -0
- package/dist/chunk-DVDKPY2A.js.map +7 -0
- package/dist/chunk-E4VONSLO.js +15 -0
- package/dist/chunk-E4VONSLO.js.map +7 -0
- package/dist/chunk-EEYGPPLU.js +185 -0
- package/dist/chunk-EEYGPPLU.js.map +7 -0
- package/dist/chunk-EI5TMJDC.js +56 -0
- package/dist/chunk-EI5TMJDC.js.map +7 -0
- package/dist/chunk-EQ5AIF3T.js +117 -0
- package/dist/chunk-EQ5AIF3T.js.map +7 -0
- package/dist/chunk-EZZHO6DQ.js +26 -0
- package/dist/chunk-EZZHO6DQ.js.map +7 -0
- package/dist/chunk-FUHLRG3M.js +130 -0
- package/dist/chunk-FUHLRG3M.js.map +7 -0
- package/dist/chunk-FVOL3ZOJ.js +101 -0
- package/dist/chunk-FVOL3ZOJ.js.map +7 -0
- package/dist/chunk-G33EUV7N.js +288 -0
- package/dist/chunk-G33EUV7N.js.map +7 -0
- package/dist/chunk-GH34XFCC.js +56 -0
- package/dist/chunk-GH34XFCC.js.map +7 -0
- package/dist/chunk-GKWRJ6H4.js +27 -0
- package/dist/chunk-GKWRJ6H4.js.map +7 -0
- package/dist/chunk-GQHMU3AR.js +907 -0
- package/dist/chunk-GQHMU3AR.js.map +7 -0
- package/dist/chunk-GRZU6F7Q.js +80 -0
- package/dist/chunk-GRZU6F7Q.js.map +7 -0
- package/dist/chunk-GT2LARKT.js +107 -0
- package/dist/chunk-GT2LARKT.js.map +7 -0
- package/dist/chunk-H4ABGAAG.js +60 -0
- package/dist/chunk-H4ABGAAG.js.map +7 -0
- package/dist/chunk-H63UHX42.js +93 -0
- package/dist/chunk-H63UHX42.js.map +7 -0
- package/dist/chunk-HIS4MGIR.js +8 -0
- package/dist/chunk-HIS4MGIR.js.map +7 -0
- package/dist/chunk-HPPFSWIV.js +213 -0
- package/dist/chunk-HPPFSWIV.js.map +7 -0
- package/dist/chunk-J2FC5K4B.js +87 -0
- package/dist/chunk-J2FC5K4B.js.map +7 -0
- package/dist/chunk-J5BSFDVK.js +123 -0
- package/dist/chunk-J5BSFDVK.js.map +7 -0
- package/dist/chunk-J7GSNWXT.js +151 -0
- package/dist/chunk-J7GSNWXT.js.map +7 -0
- package/dist/chunk-JA5ET6MC.js +550 -0
- package/dist/chunk-JA5ET6MC.js.map +7 -0
- package/dist/chunk-K22S7IZR.js +12 -0
- package/dist/chunk-K22S7IZR.js.map +7 -0
- package/dist/chunk-K5TMXCMY.js +139 -0
- package/dist/chunk-K5TMXCMY.js.map +7 -0
- package/dist/chunk-KE53GN4Q.js +246 -0
- package/dist/chunk-KE53GN4Q.js.map +7 -0
- package/dist/chunk-KFQEDSYI.js +24 -0
- package/dist/chunk-KFQEDSYI.js.map +7 -0
- package/dist/chunk-KH6QWB5Y.js +51 -0
- package/dist/chunk-KH6QWB5Y.js.map +7 -0
- package/dist/chunk-KLATKWUA.js +116 -0
- package/dist/chunk-KLATKWUA.js.map +7 -0
- package/dist/chunk-KSKWSUOB.js +17 -0
- package/dist/chunk-KSKWSUOB.js.map +7 -0
- package/dist/chunk-LFWEJXWE.js +68 -0
- package/dist/chunk-LFWEJXWE.js.map +7 -0
- package/dist/chunk-LMWJAD3B.js +24 -0
- package/dist/chunk-LMWJAD3B.js.map +7 -0
- package/dist/chunk-MD23VADH.js +92 -0
- package/dist/chunk-MD23VADH.js.map +7 -0
- package/dist/chunk-MKMJT3XR.js +0 -0
- package/dist/chunk-MKMJT3XR.js.map +7 -0
- package/dist/chunk-NJTLBSTR.js +82 -0
- package/dist/chunk-NJTLBSTR.js.map +7 -0
- package/dist/chunk-NJXKMF67.js +182 -0
- package/dist/chunk-NJXKMF67.js.map +7 -0
- package/dist/chunk-OBQBIOGN.js +16 -0
- package/dist/chunk-OBQBIOGN.js.map +7 -0
- package/dist/chunk-OLYHNFKC.js +82 -0
- package/dist/chunk-OLYHNFKC.js.map +7 -0
- package/dist/chunk-OR2L7EKO.js +33 -0
- package/dist/chunk-OR2L7EKO.js.map +7 -0
- package/dist/chunk-OUF57UZ7.js +28 -0
- package/dist/chunk-OUF57UZ7.js.map +7 -0
- package/dist/chunk-PBMM2N77.js +56 -0
- package/dist/chunk-PBMM2N77.js.map +7 -0
- package/dist/chunk-PCL2KNHC.js +6 -0
- package/dist/chunk-PCL2KNHC.js.map +7 -0
- package/dist/chunk-PH3LWLYN.js +49 -0
- package/dist/chunk-PH3LWLYN.js.map +7 -0
- package/dist/chunk-PHNMDWSK.js +9 -0
- package/dist/chunk-PHNMDWSK.js.map +7 -0
- package/dist/chunk-PN5EH6DM.js +36 -0
- package/dist/chunk-PN5EH6DM.js.map +7 -0
- package/dist/chunk-POCAINUE.js +42 -0
- package/dist/chunk-POCAINUE.js.map +7 -0
- package/dist/chunk-Q5LEK7CI.js +64 -0
- package/dist/chunk-Q5LEK7CI.js.map +7 -0
- package/dist/chunk-QH7VW7IY.js +0 -0
- package/dist/chunk-QH7VW7IY.js.map +7 -0
- package/dist/chunk-QLGM2AZW.js +173 -0
- package/dist/chunk-QLGM2AZW.js.map +7 -0
- package/dist/chunk-QT3EYUL5.js +85 -0
- package/dist/chunk-QT3EYUL5.js.map +7 -0
- package/dist/chunk-QYHOFLRX.js +43 -0
- package/dist/chunk-QYHOFLRX.js.map +7 -0
- package/dist/chunk-R3MBVWVI.js +127 -0
- package/dist/chunk-R3MBVWVI.js.map +7 -0
- package/dist/chunk-R6V3LH7F.js +67 -0
- package/dist/chunk-R6V3LH7F.js.map +7 -0
- package/dist/chunk-RB22U6HI.js +64 -0
- package/dist/chunk-RB22U6HI.js.map +7 -0
- package/dist/chunk-RQRQYYTB.js +34 -0
- package/dist/chunk-RQRQYYTB.js.map +7 -0
- package/dist/chunk-S5D2QE4G.js +53 -0
- package/dist/chunk-S5D2QE4G.js.map +7 -0
- package/dist/chunk-S7I76ISM.js +245 -0
- package/dist/chunk-S7I76ISM.js.map +7 -0
- package/dist/chunk-TBDZOQ2C.js +66 -0
- package/dist/chunk-TBDZOQ2C.js.map +7 -0
- package/dist/chunk-TSKELYW7.js +55 -0
- package/dist/chunk-TSKELYW7.js.map +7 -0
- package/dist/chunk-U3YHTQHR.js +215 -0
- package/dist/chunk-U3YHTQHR.js.map +7 -0
- package/dist/chunk-UGL3KNOT.js +42 -0
- package/dist/chunk-UGL3KNOT.js.map +7 -0
- package/dist/chunk-UN3DARLG.js +35 -0
- package/dist/chunk-UN3DARLG.js.map +7 -0
- package/dist/chunk-V5H7L5PJ.js +587 -0
- package/dist/chunk-V5H7L5PJ.js.map +7 -0
- package/dist/chunk-VGGERKV2.js +7 -0
- package/dist/chunk-VGGERKV2.js.map +7 -0
- package/dist/chunk-VVFXYY65.js +0 -0
- package/dist/chunk-VVFXYY65.js.map +7 -0
- package/dist/chunk-WLDCYUN6.js +161 -0
- package/dist/chunk-WLDCYUN6.js.map +7 -0
- package/dist/chunk-WMDTQS36.js +0 -0
- package/dist/chunk-WMDTQS36.js.map +7 -0
- package/dist/chunk-WUTGZYP4.js +290 -0
- package/dist/chunk-WUTGZYP4.js.map +7 -0
- package/dist/chunk-XKN3WWK3.js +0 -0
- package/dist/chunk-XKN3WWK3.js.map +7 -0
- package/dist/chunk-XQ5VJ4QO.js +62 -0
- package/dist/chunk-XQ5VJ4QO.js.map +7 -0
- package/dist/chunk-XQVKX47O.js +174 -0
- package/dist/chunk-XQVKX47O.js.map +7 -0
- package/dist/chunk-Y5CNB57V.js +22 -0
- package/dist/chunk-Y5CNB57V.js.map +7 -0
- package/dist/chunk-YDGH7DTL.js +18 -0
- package/dist/chunk-YDGH7DTL.js.map +7 -0
- package/dist/chunk-YIFUBPJ3.js +0 -0
- package/dist/chunk-YIFUBPJ3.js.map +7 -0
- package/dist/chunk-YUUDXRBW.js +212 -0
- package/dist/chunk-YUUDXRBW.js.map +7 -0
- package/dist/chunk-Z6DQLJS2.js +23 -0
- package/dist/chunk-Z6DQLJS2.js.map +7 -0
- package/dist/chunk-ZDEZ2FOC.js +81 -0
- package/dist/chunk-ZDEZ2FOC.js.map +7 -0
- package/dist/chunk-ZUYSGCEH.js +65 -0
- package/dist/chunk-ZUYSGCEH.js.map +7 -0
- package/dist/chunk-ZYP3MIH3.js +115 -0
- package/dist/chunk-ZYP3MIH3.js.map +7 -0
- package/dist/constraints/constraint-evaluator.d.ts +57 -0
- package/dist/constraints/constraint-evaluator.js +17 -0
- package/dist/constraints/constraint-evaluator.js.map +7 -0
- package/dist/constraints/index.d.ts +1 -0
- package/dist/constraints/index.js +17 -0
- package/dist/constraints/index.js.map +7 -0
- package/dist/csrf/index.d.ts +43 -0
- package/dist/csrf/index.js +43 -0
- package/dist/csrf/index.js.map +7 -0
- package/dist/engine/build-form-engine.d.ts +27 -0
- package/dist/engine/build-form-engine.js +58 -0
- package/dist/engine/build-form-engine.js.map +7 -0
- package/dist/engine/component-type.d.ts +19 -0
- package/dist/engine/component-type.js +6 -0
- package/dist/engine/component-type.js.map +7 -0
- package/dist/engine/create-form-engine.d.ts +100 -0
- package/dist/engine/create-form-engine.js +59 -0
- package/dist/engine/create-form-engine.js.map +7 -0
- package/dist/engine/form-action-context.d.ts +70 -0
- package/dist/engine/form-action-context.js +10 -0
- package/dist/engine/form-action-context.js.map +7 -0
- package/dist/engine/form-engine.d.ts +236 -0
- package/dist/engine/form-engine.js +61 -0
- package/dist/engine/form-engine.js.map +7 -0
- package/dist/engine/index.d.ts +12 -0
- package/dist/engine/index.js +124 -0
- package/dist/engine/index.js.map +7 -0
- package/dist/engine/schema-artifacts.d.ts +87 -0
- package/dist/engine/schema-artifacts.js +14 -0
- package/dist/engine/schema-artifacts.js.map +7 -0
- package/dist/engine/schema-metadata-catalog.d.ts +41 -0
- package/dist/engine/schema-metadata-catalog.js +6 -0
- package/dist/engine/schema-metadata-catalog.js.map +7 -0
- package/dist/engine/step-machine.d.ts +59 -0
- package/dist/engine/step-machine.js +32 -0
- package/dist/engine/step-machine.js.map +7 -0
- package/dist/engine/submission-schema.d.ts +53 -0
- package/dist/engine/submission-schema.js +22 -0
- package/dist/engine/submission-schema.js.map +7 -0
- package/dist/engine/value-validation.d.ts +237 -0
- package/dist/engine/value-validation.js +39 -0
- package/dist/engine/value-validation.js.map +7 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +283 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/authoring-catalog.d.ts +5 -0
- package/dist/lib/authoring-catalog.js +11 -0
- package/dist/lib/authoring-catalog.js.map +7 -0
- package/dist/lib/container-kind-of.d.ts +5 -0
- package/dist/lib/container-kind-of.js +6 -0
- package/dist/lib/container-kind-of.js.map +7 -0
- package/dist/lib/debounce.d.ts +19 -0
- package/dist/lib/debounce.js +6 -0
- package/dist/lib/debounce.js.map +7 -0
- package/dist/lib/deep-readonly.d.ts +12 -0
- package/dist/lib/deep-readonly.js +0 -0
- package/dist/lib/deep-readonly.js.map +7 -0
- package/dist/lib/element-children.d.ts +35 -0
- package/dist/lib/element-children.js +16 -0
- package/dist/lib/element-children.js.map +7 -0
- package/dist/lib/exported-action-envelope.d.ts +11 -0
- package/dist/lib/exported-action-envelope.js +7 -0
- package/dist/lib/exported-action-envelope.js.map +7 -0
- package/dist/lib/exported-rules.d.ts +14 -0
- package/dist/lib/exported-rules.js +6 -0
- package/dist/lib/exported-rules.js.map +7 -0
- package/dist/lib/field-ref.d.ts +13 -0
- package/dist/lib/field-ref.js +6 -0
- package/dist/lib/field-ref.js.map +7 -0
- package/dist/lib/field-scope.d.ts +121 -0
- package/dist/lib/field-scope.js +41 -0
- package/dist/lib/field-scope.js.map +7 -0
- package/dist/lib/form-fetch.d.ts +36 -0
- package/dist/lib/form-fetch.js +10 -0
- package/dist/lib/form-fetch.js.map +7 -0
- package/dist/lib/form-view.d.ts +33 -0
- package/dist/lib/form-view.js +12 -0
- package/dist/lib/form-view.js.map +7 -0
- package/dist/lib/frozen-copy.d.ts +9 -0
- package/dist/lib/frozen-copy.js +7 -0
- package/dist/lib/frozen-copy.js.map +7 -0
- package/dist/lib/is-plain-object.d.ts +2 -0
- package/dist/lib/is-plain-object.js +6 -0
- package/dist/lib/is-plain-object.js.map +7 -0
- package/dist/lib/logger.d.ts +2 -0
- package/dist/lib/logger.js +6 -0
- package/dist/lib/logger.js.map +7 -0
- package/dist/lib/normalized-form-config.d.ts +106 -0
- package/dist/lib/normalized-form-config.js +19 -0
- package/dist/lib/normalized-form-config.js.map +7 -0
- package/dist/lib/omit-paths.d.ts +11 -0
- package/dist/lib/omit-paths.js +7 -0
- package/dist/lib/omit-paths.js.map +7 -0
- package/dist/lib/path-values.d.ts +47 -0
- package/dist/lib/path-values.js +22 -0
- package/dist/lib/path-values.js.map +7 -0
- package/dist/lib/renderer-data-attributes.d.ts +10 -0
- package/dist/lib/renderer-data-attributes.js +6 -0
- package/dist/lib/renderer-data-attributes.js.map +7 -0
- package/dist/lib/reserved-path-keys.d.ts +10 -0
- package/dist/lib/reserved-path-keys.js +10 -0
- package/dist/lib/reserved-path-keys.js.map +7 -0
- package/dist/lib/resolve-appearance.d.ts +48 -0
- package/dist/lib/resolve-appearance.js +10 -0
- package/dist/lib/resolve-appearance.js.map +7 -0
- package/dist/lib/standard-json-schema.d.ts +27 -0
- package/dist/lib/standard-json-schema.js +8 -0
- package/dist/lib/standard-json-schema.js.map +7 -0
- package/dist/lib/standard-schema.d.ts +19 -0
- package/dist/lib/standard-schema.js +8 -0
- package/dist/lib/standard-schema.js.map +7 -0
- package/dist/lib/submission-shape.d.ts +60 -0
- package/dist/lib/submission-shape.js +14 -0
- package/dist/lib/submission-shape.js.map +7 -0
- package/dist/lib/validate-form/grid-checks.d.ts +57 -0
- package/dist/lib/validate-form/grid-checks.js +16 -0
- package/dist/lib/validate-form/grid-checks.js.map +7 -0
- package/dist/lib/validate-form/issues.d.ts +43 -0
- package/dist/lib/validate-form/issues.js +13 -0
- package/dist/lib/validate-form/issues.js.map +7 -0
- package/dist/lib/validate-form/options.d.ts +22 -0
- package/dist/lib/validate-form/options.js +0 -0
- package/dist/lib/validate-form/options.js.map +7 -0
- package/dist/lib/validate-form/parse-elements.d.ts +23 -0
- package/dist/lib/validate-form/parse-elements.js +21 -0
- package/dist/lib/validate-form/parse-elements.js.map +7 -0
- package/dist/lib/validate-form/parse-owner-actions.d.ts +14 -0
- package/dist/lib/validate-form/parse-owner-actions.js +10 -0
- package/dist/lib/validate-form/parse-owner-actions.js.map +7 -0
- package/dist/lib/validate-form/parse-view.d.ts +11 -0
- package/dist/lib/validate-form/parse-view.js +11 -0
- package/dist/lib/validate-form/parse-view.js.map +7 -0
- package/dist/lib/validate-form/schema-issues.d.ts +16 -0
- package/dist/lib/validate-form/schema-issues.js +8 -0
- package/dist/lib/validate-form/schema-issues.js.map +7 -0
- package/dist/lib/validate-form/step-checks.d.ts +18 -0
- package/dist/lib/validate-form/step-checks.js +15 -0
- package/dist/lib/validate-form/step-checks.js.map +7 -0
- package/dist/lib/validate-form/validation-error.d.ts +26 -0
- package/dist/lib/validate-form/validation-error.js +8 -0
- package/dist/lib/validate-form/validation-error.js.map +7 -0
- package/dist/lib/validate-form.d.ts +34 -0
- package/dist/lib/validate-form.js +62 -0
- package/dist/lib/validate-form.js.map +7 -0
- package/dist/lib/zod-json-schema.d.ts +33 -0
- package/dist/lib/zod-json-schema.js +10 -0
- package/dist/lib/zod-json-schema.js.map +7 -0
- package/dist/recipes/built-in-specs.d.ts +1832 -0
- package/dist/recipes/built-in-specs.js +28 -0
- package/dist/recipes/built-in-specs.js.map +7 -0
- package/dist/recipes/built-in.d.ts +2 -0
- package/dist/recipes/built-in.js +49 -0
- package/dist/recipes/built-in.js.map +7 -0
- package/dist/recipes/define-form-recipe.d.ts +10 -0
- package/dist/recipes/define-form-recipe.js +6 -0
- package/dist/recipes/define-form-recipe.js.map +7 -0
- package/dist/recipes/define-recipe-spec.d.ts +13 -0
- package/dist/recipes/define-recipe-spec.js +8 -0
- package/dist/recipes/define-recipe-spec.js.map +7 -0
- package/dist/recipes/index.d.ts +6 -0
- package/dist/recipes/index.js +43 -0
- package/dist/recipes/index.js.map +7 -0
- package/dist/recipes/protocol.d.ts +24 -0
- package/dist/recipes/protocol.js +11 -0
- package/dist/recipes/protocol.js.map +7 -0
- package/dist/recipes/slot-schemas.d.ts +128 -0
- package/dist/recipes/slot-schemas.js +24 -0
- package/dist/recipes/slot-schemas.js.map +7 -0
- package/dist/recipes/types.d.ts +55 -0
- package/dist/recipes/types.js +1 -0
- package/dist/recipes/types.js.map +7 -0
- package/dist/recipes/view-model.d.ts +93 -0
- package/dist/recipes/view-model.js +29 -0
- package/dist/recipes/view-model.js.map +7 -0
- package/dist/registries/index.d.ts +8 -0
- package/dist/registries/index.js +0 -0
- package/dist/registries/index.js.map +7 -0
- package/dist/runtime/create-form-runtime.d.ts +43 -0
- package/dist/runtime/create-form-runtime.js +41 -0
- package/dist/runtime/create-form-runtime.js.map +7 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +44 -0
- package/dist/runtime/index.js.map +7 -0
- package/dist/runtime/submission-lifecycle.d.ts +65 -0
- package/dist/runtime/submission-lifecycle.js +6 -0
- package/dist/runtime/submission-lifecycle.js.map +7 -0
- package/dist/runtime/types.d.ts +172 -0
- package/dist/runtime/types.js +6 -0
- package/dist/runtime/types.js.map +7 -0
- package/dist/schemas/base-field.d.ts +450 -0
- package/dist/schemas/base-field.js +36 -0
- package/dist/schemas/base-field.js.map +7 -0
- package/dist/schemas/field-config.d.ts +36 -0
- package/dist/schemas/field-config.js +1 -0
- package/dist/schemas/field-config.js.map +7 -0
- package/dist/schemas/form-config-shape.d.ts +763 -0
- package/dist/schemas/form-config-shape.js +35 -0
- package/dist/schemas/form-config-shape.js.map +7 -0
- package/dist/schemas/form-config.d.ts +1288 -0
- package/dist/schemas/form-config.js +41 -0
- package/dist/schemas/form-config.js.map +7 -0
- package/dist/schemas/html-attributes.d.ts +12 -0
- package/dist/schemas/html-attributes.js +12 -0
- package/dist/schemas/html-attributes.js.map +7 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +165 -0
- package/dist/schemas/index.js.map +7 -0
- package/dist/schemas/validation/async/cache.d.ts +39 -0
- package/dist/schemas/validation/async/cache.js +6 -0
- package/dist/schemas/validation/async/cache.js.map +7 -0
- package/dist/schemas/validation/async/handler.d.ts +21 -0
- package/dist/schemas/validation/async/handler.js +11 -0
- package/dist/schemas/validation/async/handler.js.map +7 -0
- package/dist/schemas/validation/async/index.d.ts +8 -0
- package/dist/schemas/validation/async/index.js +14 -0
- package/dist/schemas/validation/async/index.js.map +7 -0
- package/dist/schemas/validation/defaults.d.ts +6 -0
- package/dist/schemas/validation/defaults.js +12 -0
- package/dist/schemas/validation/defaults.js.map +7 -0
- package/dist/schemas/validation/dependencies.d.ts +52 -0
- package/dist/schemas/validation/dependencies.js +17 -0
- package/dist/schemas/validation/dependencies.js.map +7 -0
- package/dist/schemas/validation/empty.d.ts +1 -0
- package/dist/schemas/validation/empty.js +6 -0
- package/dist/schemas/validation/empty.js.map +7 -0
- package/dist/schemas/validation/errors.d.ts +44 -0
- package/dist/schemas/validation/errors.js +12 -0
- package/dist/schemas/validation/errors.js.map +7 -0
- package/dist/schemas/validation/index.d.ts +9 -0
- package/dist/schemas/validation/index.js +130 -0
- package/dist/schemas/validation/index.js.map +7 -0
- package/dist/schemas/validation/presets.d.ts +66 -0
- package/dist/schemas/validation/presets.js +6 -0
- package/dist/schemas/validation/presets.js.map +7 -0
- package/dist/schemas/validation/relations.d.ts +12 -0
- package/dist/schemas/validation/relations.js +8 -0
- package/dist/schemas/validation/relations.js.map +7 -0
- package/dist/schemas/validation/types.d.ts +817 -0
- package/dist/schemas/validation/types.js +64 -0
- package/dist/schemas/validation/types.js.map +7 -0
- package/dist/schemas/validation/utils.d.ts +76 -0
- package/dist/schemas/validation/utils.js +24 -0
- package/dist/schemas/validation/utils.js.map +7 -0
- package/dist/schemas/validation/validation-registry.d.ts +124 -0
- package/dist/schemas/validation/validation-registry.js +27 -0
- package/dist/schemas/validation/validation-registry.js.map +7 -0
- package/dist/server-errors/from-json-api-errors.d.ts +13 -0
- package/dist/server-errors/from-json-api-errors.js +10 -0
- package/dist/server-errors/from-json-api-errors.js.map +7 -0
- package/dist/server-errors/from-problem-details.d.ts +15 -0
- package/dist/server-errors/from-problem-details.js +10 -0
- package/dist/server-errors/from-problem-details.js.map +7 -0
- package/dist/server-errors/index.d.ts +8 -0
- package/dist/server-errors/index.js +17 -0
- package/dist/server-errors/index.js.map +7 -0
- package/dist/server-errors/shared.d.ts +34 -0
- package/dist/server-errors/shared.js +23 -0
- package/dist/server-errors/shared.js.map +7 -0
- package/dist/state-container/create-form-state-container.d.ts +17 -0
- package/dist/state-container/create-form-state-container.js +31 -0
- package/dist/state-container/create-form-state-container.js.map +7 -0
- package/dist/state-container/dirty.d.ts +11 -0
- package/dist/state-container/dirty.js +9 -0
- package/dist/state-container/dirty.js.map +7 -0
- package/dist/state-container/field-array.d.ts +41 -0
- package/dist/state-container/field-array.js +8 -0
- package/dist/state-container/field-array.js.map +7 -0
- package/dist/state-container/hydration.d.ts +21 -0
- package/dist/state-container/hydration.js +11 -0
- package/dist/state-container/hydration.js.map +7 -0
- package/dist/state-container/index.d.ts +16 -0
- package/dist/state-container/index.js +51 -0
- package/dist/state-container/index.js.map +7 -0
- package/dist/state-container/issue-text.d.ts +11 -0
- package/dist/state-container/issue-text.js +6 -0
- package/dist/state-container/issue-text.js.map +7 -0
- package/dist/state-container/row-ids.d.ts +34 -0
- package/dist/state-container/row-ids.js +19 -0
- package/dist/state-container/row-ids.js.map +7 -0
- package/dist/state-container/selectors.d.ts +33 -0
- package/dist/state-container/selectors.js +22 -0
- package/dist/state-container/selectors.js.map +7 -0
- package/dist/state-container/stale-results.d.ts +28 -0
- package/dist/state-container/stale-results.js +9 -0
- package/dist/state-container/stale-results.js.map +7 -0
- package/dist/state-container/state-tree.d.ts +56 -0
- package/dist/state-container/state-tree.js +33 -0
- package/dist/state-container/state-tree.js.map +7 -0
- package/dist/state-container/submission.d.ts +45 -0
- package/dist/state-container/submission.js +26 -0
- package/dist/state-container/submission.js.map +7 -0
- package/dist/state-container/types.d.ts +404 -0
- package/dist/state-container/types.js +6 -0
- package/dist/state-container/types.js.map +7 -0
- package/dist/state-container/value-tree.d.ts +56 -0
- package/dist/state-container/value-tree.js +34 -0
- package/dist/state-container/value-tree.js.map +7 -0
- package/dist/testing/assert.d.ts +92 -0
- package/dist/testing/assert.js +42 -0
- package/dist/testing/assert.js.map +7 -0
- package/dist/testing/form-state-container-conformance.d.ts +63 -0
- package/dist/testing/form-state-container-conformance.js +44 -0
- package/dist/testing/form-state-container-conformance.js.map +7 -0
- package/dist/testing/index.d.ts +8 -0
- package/dist/testing/index.js +36 -0
- package/dist/testing/index.js.map +7 -0
- package/dist/types/actions.d.ts +75 -0
- package/dist/types/actions.js +1 -0
- package/dist/types/actions.js.map +7 -0
- package/dist/types/categories.d.ts +21 -0
- package/dist/types/categories.js +8 -0
- package/dist/types/categories.js.map +7 -0
- package/dist/types/define-element.d.ts +73 -0
- package/dist/types/define-element.js +8 -0
- package/dist/types/define-element.js.map +7 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +17 -0
- package/dist/types/index.js.map +7 -0
- package/dist/types/metadata.d.ts +14 -0
- package/dist/types/metadata.js +1 -0
- package/dist/types/metadata.js.map +7 -0
- package/dist/types/registration.d.ts +142 -0
- package/dist/types/registration.js +1 -0
- package/dist/types/registration.js.map +7 -0
- package/package.json +113 -3
- package/skill/SKILL.md +79 -0
- package/skill/reference/forms-actions.md +51 -0
- package/skill/reference/forms-submission.md +44 -0
- package/skill/reference/forms-validation.md +91 -0
- package/skill/reference/forms.md +180 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/engine/form-engine.ts", "../src/engine/build-form-engine.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CsrfPolicy, FormFetch } from '@/lib/form-fetch';\nimport type { FormIssueFormatter } from '@/state-container/types';\nimport type { AnyActionRegistration, AnyElementRegistration, AnyRecipeRegistration } from '@/types/registration';\nimport type { ActionRegistrationRegistry, ElementRegistry, RecipeRegistry } from '@/registries';\nimport { ComponentType } from './component-type';\nimport { logger } from '@/lib/logger';\nimport type { StandardJSONSchemaV1 } from '@/lib/standard-json-schema';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport * as z from 'zod/mini';\nimport type { FormEngineSchemaArtifacts } from './schema-artifacts';\nimport {\n\tsafeValidateFormConfig,\n\tvalidateElementConfig,\n\tvalidateFormConfig,\n\ttype FormValidationResult,\n} from '@/lib/validate-form';\nimport type { NormalizedElementConfig, NormalizedFormConfig, ValuesBrand } from '@/lib/normalized-form-config';\nimport type { ExactFormAppearance, ExactViewConfig, FormAuthoringInput } from '@/builder/form-authoring';\nimport type {\n\tLastWinsMerge,\n\tEngineOutputMaps,\n\tMergedOutputMap,\n\tMergedValueMap,\n\tMergedRegistrationMap,\n\tMergedActionRegistrationMap,\n\tElementRegistrationConstraint,\n\tRecipeRegistrationConstraint,\n\tActionRegistrationConstraint,\n} from '@/builder/types.utils';\nimport type { ExtendFormEngineOptions } from './create-form-engine';\nimport type { ValuesOf } from '@/builder/form-values';\nimport type { FormValues } from '@/runtime/types';\nimport { buildFormEngine } from './build-form-engine';\nimport { SchemaMetadataCatalog } from './schema-metadata-catalog';\nimport type { LayoutTheme, ResolvedAppearanceAxes } from '@schema-engine/layout';\nimport type { ValidationRegistry } from '@/schemas/validation/validation-registry';\nimport type { ValidationRegistrationConstraint } from '@/schemas/validation/types';\nimport {\n\tdescribeRecipeFromRegistration,\n\tdescribeViewCatalogFromRecipes,\n\tgetAuthoringInstructionsFromCatalog,\n} from '@/lib/authoring-catalog';\nimport type { RecipeDescriptor, ViewCatalog } from '@/recipes/types';\nimport { generateZodJSONSchemaDocument } from '@/lib/zod-json-schema';\nimport { createSubmissionSchema, type SubmissionSchema, type SubmissionSchemaConfig } from './submission-schema';\nexport * from './component-type';\n\n/**\n * Engine registries - internal storage for all registered components.\n */\nexport interface EngineRegistries {\n\telements: ElementRegistry;\n\trecipes: RecipeRegistry;\n\tactions: ActionRegistrationRegistry;\n\tschemaArtifacts: FormEngineSchemaArtifacts;\n\tlayout: LayoutTheme;\n\tvalidationRegistry: ValidationRegistry;\n\t/** The validations passed to `createFormEngine`, kept so {@link FormEngine.extend} can rebuild the registry. */\n\tvalidations: readonly ValidationRegistrationConstraint[];\n\tdefaultWizardRecipe?: string;\n\tformatIssue?: FormIssueFormatter;\n\t/** The engine's request function, with the CSRF policy applied. */\n\tfetch: FormFetch;\n\t/** The `fetch` given to `createFormEngine`, without the policy, so {@link FormEngine.extend} can rebuild. */\n\tbaseFetch?: FormFetch;\n\tcsrf?: CsrfPolicy;\n}\n\n/** What `validateForm` takes beside the config: the application's schema of the submitted values. */\nexport interface ValidateFormValuesOption<TSchema extends StandardSchemaV1 = StandardSchemaV1> {\n\treadonly values: TSchema;\n}\n\nexport class FormEngine<\n\tTElements extends Record<string, unknown> = Record<string, unknown>,\n\tTRecipes extends Record<string, unknown> = Record<string, unknown>,\n\tTActions extends Record<string, unknown> = Record<string, unknown>,\n\tTOutputs extends EngineOutputMaps = EngineOutputMaps,\n\tTAppearance extends Record<string, string> = ResolvedAppearanceAxes,\n> {\n\tprivate readonly registries: EngineRegistries;\n\tprivate readonly schemaArtifacts: FormEngineSchemaArtifacts;\n\tprivate readonly layout: LayoutTheme;\n\tprivate readonly validationRegistry: ValidationRegistry;\n\tprivate readonly submissionSchemas = new WeakMap<object, SubmissionSchema>();\n\n\t/**\n\t * Every request the engine makes goes through this: the `fetch` given to `createFormEngine`, or the global one,\n\t * with the CSRF policy applied. Bindings and actions use it (`context.fetch`) so no one remembers a token.\n\t */\n\treadonly fetch: FormFetch;\n\n\t/**\n\t * @remarks\n\t * Shares the registries it receives instead of copying them. They are\n\t * read-only, so engines built by `extend` can share them safely. Construct\n\t * engines with `createFormEngine`; passing a registry that changes later is\n\t * unsupported.\n\t */\n\tconstructor(registries: EngineRegistries) {\n\t\tthis.registries = {\n\t\t\telements: registries.elements,\n\t\t\trecipes: registries.recipes,\n\t\t\tactions: registries.actions,\n\t\t\tschemaArtifacts: registries.schemaArtifacts,\n\t\t\tlayout: registries.layout,\n\t\t\tvalidationRegistry: registries.validationRegistry,\n\t\t\tvalidations: registries.validations,\n\t\t\tdefaultWizardRecipe: registries.defaultWizardRecipe,\n\t\t\tformatIssue: registries.formatIssue,\n\t\t\tfetch: registries.fetch,\n\t\t\tbaseFetch: registries.baseFetch,\n\t\t\tcsrf: registries.csrf,\n\t\t};\n\t\tthis.fetch = registries.fetch;\n\t\tthis.schemaArtifacts = registries.schemaArtifacts;\n\t\tthis.layout = registries.layout;\n\t\tthis.validationRegistry = registries.validationRegistry;\n\n\t\tlogger.debug('FormEngine initialized', {\n\t\t\telements: this.registries.elements.size,\n\t\t\trecipes: this.registries.recipes.size,\n\t\t\tactions: this.registries.actions.size,\n\t\t});\n\t}\n\n\tgetElement(id: string): AnyElementRegistration | undefined {\n\t\treturn this.registries.elements.get(id);\n\t}\n\n\tgetAllElements(): AnyElementRegistration[] {\n\t\treturn [...this.registries.elements.all()];\n\t}\n\n\tgetElementIds(): string[] {\n\t\treturn [...this.registries.elements.keys()];\n\t}\n\n\thasElement(id: string): boolean {\n\t\treturn this.registries.elements.has(id);\n\t}\n\n\tgetRecipe(id: string): AnyRecipeRegistration | undefined {\n\t\treturn this.registries.recipes.get(id);\n\t}\n\n\tgetAllRecipes(): AnyRecipeRegistration[] {\n\t\treturn [...this.registries.recipes.all()];\n\t}\n\n\tgetRecipeIds(): string[] {\n\t\treturn [...this.registries.recipes.keys()];\n\t}\n\n\thasRecipe(id: string): boolean {\n\t\treturn this.registries.recipes.has(id);\n\t}\n\n\t/**\n\t * The engine's immutable layout theme: grid vocabulary, appearance vocabulary, one id and one stylesheet.\n\t *\n\t * @remarks\n\t * Compiled once when the engine is built (or taken as given from `createFormEngine({ layout })`).\n\t * Renderers emit `css` inside the rendered form markup, so SSR output is styled with no FOUC and\n\t * no runtime injection, and put `id` on the form, grid and item elements as `data-se-theme`.\n\t * Engines built on the same theme share its id; React hoists the shared stylesheet to one\n\t * element, while Radiant inlines an identical copy per form.\n\t */\n\tgetLayout(): LayoutTheme {\n\t\treturn this.layout;\n\t}\n\n\t/** The formatter of issues given to `createFormEngine`, which both renderer bindings read; `undefined` when none was. */\n\tgetIssueFormatter(): FormIssueFormatter | undefined {\n\t\treturn this.registries.formatIssue;\n\t}\n\n\t/** The CSRF policy given to `createFormEngine`, for a binding that adds a hidden input to a native post; `undefined` when there is none. */\n\tgetCsrf(): CsrfPolicy | undefined {\n\t\treturn this.registries.csrf;\n\t}\n\n\tgetValidationRegistry(): ValidationRegistry {\n\t\treturn this.validationRegistry;\n\t}\n\n\tgetAction(id: string): AnyActionRegistration | undefined {\n\t\treturn this.registries.actions.get(id);\n\t}\n\n\tgetAllActions(): AnyActionRegistration[] {\n\t\treturn [...this.registries.actions.all()];\n\t}\n\n\tgetActionTypes(): string[] {\n\t\treturn [...this.registries.actions.keys()];\n\t}\n\n\thasAction(id: string): boolean {\n\t\treturn this.registries.actions.has(id);\n\t}\n\n\tgetSummary() {\n\t\treturn {\n\t\t\telements: {\n\t\t\t\tcount: this.registries.elements.size,\n\t\t\t\tids: this.getElementIds(),\n\t\t\t},\n\t\t\trecipes: {\n\t\t\t\tcount: this.registries.recipes.size,\n\t\t\t\tids: this.getRecipeIds(),\n\t\t\t},\n\t\t\tactions: {\n\t\t\t\tcount: this.registries.actions.size,\n\t\t\t\ttypes: this.getActionTypes(),\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Validate external JSON against this engine's registrations.\n\t * Applies defaults and schema transforms. Prefer {@link defineForm} when authoring in TypeScript.\n\t * Returns a frozen {@link NormalizedFormConfig} owned by this engine.\n\t *\n\t * @remarks\n\t * A config that arrives as JSON cannot be typed by inference, so the application binds the schema of what it\n\t * submits with `values`: the runtime parses a submission with it after the one derived from the elements, and\n\t * the values type of the form is its output. Without `values`, `onSubmit` receives {@link FormValues}, still\n\t * checked at runtime by {@link FormEngine.submissionSchema}. A form that is already normalized keeps its own values\n\t * type, and anything else (JSON, an authoring object) gives `FormValues`, so it is not a form of a narrower type: the\n\t * values type is a claim only a normalized form can make, and naming one for plain input is a type error.\n\t */\n\tvalidateForm<TValues extends FormValues = FormValues>(\n\t\tconfig: ValuesBrand<TValues>,\n\t): NormalizedFormConfig<TOutputs['elements'], TOutputs['recipes'], TOutputs['actions'], NoInfer<TValues>>;\n\tvalidateForm(\n\t\tconfig: unknown,\n\t): NormalizedFormConfig<TOutputs['elements'], TOutputs['recipes'], TOutputs['actions'], FormValues>;\n\tvalidateForm<TSchema extends StandardSchemaV1>(\n\t\tconfig: unknown,\n\t\toptions: ValidateFormValuesOption<TSchema>,\n\t): NormalizedFormConfig<\n\t\tTOutputs['elements'],\n\t\tTOutputs['recipes'],\n\t\tTOutputs['actions'],\n\t\tStandardSchemaV1.InferOutput<TSchema>\n\t>;\n\tvalidateForm(config: unknown, options?: ValidateFormValuesOption): unknown {\n\t\treturn validateFormConfig(config, this.validateOptions(options?.values));\n\t}\n\n\t/**\n\t * Same validation as {@link validateForm}, returned as a result instead of thrown.\n\t *\n\t * @returns `{ success: true, data }` with the frozen normalized form, or `{ success: false, issues }`\n\t * with the problems found and the config path each is about (`['steps', 0, 'elements', 2, 'grid', 'width']`;\n\t * `[]` for the whole form). The shape fits a YAML or editor integration that points an issue at a location.\n\t *\n\t * @remarks\n\t * A malformed form envelope (its own shape, such as `steps` not being an array) stops the deeper\n\t * checks and is reported alone; once it parses, element, action, grid and view issues come together.\n\t *\n\t * Still throws for a misuse of the API, such as a registration whose Standard Schema is async.\n\t */\n\tsafeValidateForm(\n\t\tconfig: unknown,\n\t): FormValidationResult<\n\t\tNormalizedFormConfig<TOutputs['elements'], TOutputs['recipes'], TOutputs['actions'], FormValues>\n\t>;\n\tsafeValidateForm<TSchema extends StandardSchemaV1>(\n\t\tconfig: unknown,\n\t\toptions: ValidateFormValuesOption<TSchema>,\n\t): FormValidationResult<\n\t\tNormalizedFormConfig<\n\t\t\tTOutputs['elements'],\n\t\t\tTOutputs['recipes'],\n\t\t\tTOutputs['actions'],\n\t\t\tStandardSchemaV1.InferOutput<TSchema>\n\t\t>\n\t>;\n\tsafeValidateForm(config: unknown, options?: ValidateFormValuesOption): unknown {\n\t\treturn safeValidateFormConfig(config, this.validateOptions(options?.values));\n\t}\n\n\tprivate validateOptions(values?: StandardSchemaV1) {\n\t\treturn {\n\t\t\tvalues,\n\t\t\towner: this,\n\t\t\tgetRecipe: (id: string) => this.getRecipe(id),\n\t\t\tdefaultWizardRecipe: this.registries.defaultWizardRecipe,\n\t\t\tgetElement: (id: string) => this.getElement(id),\n\t\t\tgetAction: (id: string) => this.getAction(id),\n\t\t\tcheckRule: (rule: { $type: string }) => this.validationRegistry.check(rule),\n\t\t\taxes: this.layout.axes,\n\t\t};\n\t}\n\n\t/**\n\t * Author a form from this engine's registered elements, recipes, and actions.\n\t * Same runtime pipeline as {@link validateForm}.\n\t *\n\t * @remarks\n\t * The result carries the values type the literal config declares ({@link ValuesOf}), which a renderer reads to\n\t * type `onSubmit`, `onAction` and `defaultValues`. A config that is not a literal gives {@link FormValues}.\n\t *\n\t * The type is derived from the literal, not from this call's result: it is the static twin of\n\t * {@link FormEngine.submissionSchema}, which `createFormRuntime` checks every submission against.\n\t */\n\tdefineForm<\n\t\tconst TConfig extends FormAuthoringInput<TElements, TRecipes, TActions, TAppearance> & {\n\t\t\t/** @remarks Rejects the callbacks `FormConfig` no longer has, which an inferred generic would let through. */\n\t\t\tonSubmit?: never;\n\t\t\tonChange?: never;\n\t\t},\n\t>(\n\t\tconfig: TConfig & { view?: ExactViewConfig<TConfig['view'], TRecipes, TAppearance> } & ExactFormAppearance<\n\t\t\t\tTConfig,\n\t\t\t\tTAppearance\n\t\t\t>,\n\t): NormalizedFormConfig<\n\t\tTOutputs['elements'],\n\t\tTOutputs['recipes'],\n\t\tTOutputs['actions'],\n\t\tValuesOf<TConfig, TOutputs['values']>\n\t> {\n\t\treturn this.validateForm(config) as NormalizedFormConfig<\n\t\t\tTOutputs['elements'],\n\t\t\tTOutputs['recipes'],\n\t\t\tTOutputs['actions'],\n\t\t\tValuesOf<TConfig, TOutputs['values']>\n\t\t>;\n\t}\n\n\t/**\n\t * The schema of the values a submission of `config` holds, composed from the `value` its elements declare.\n\t *\n\t * @remarks\n\t * It follows the rules the form state container submits by: dotted names nest, named containers become\n\t * objects, a container of kind `array` becomes a list, a one-child row is a list of values (unless its child is a container of its own, which makes the rows objects), and the config's\n\t * `payload` keys are added. A field is a required key only when it has a `required` rule and neither it, a\n\t * container around it nor its step has `constraints` or `disabled`; any other key may be absent, and an\n\t * optional leaf field may hold its empty value (`''` or `null`), and a list or a group its empty list or object. Keys no field declares are not part of it.\n\t * `createFormRuntime` parses every submission with it, so one that does not match fails with a\n\t * `valueMismatch` issue. Its `~standard.jsonSchema` `input()` and `output()` throw for a value schema that has no JSON Schema.\n\t */\n\tsubmissionSchema(config: SubmissionSchemaConfig): SubmissionSchema {\n\t\tconst known = this.submissionSchemas.get(config);\n\t\tif (known) return known;\n\t\tconst created = createSubmissionSchema(config, {\n\t\t\tgetElement: (id) => this.getElement(id),\n\t\t\tvalidationRegistry: this.validationRegistry,\n\t\t});\n\t\tthis.submissionSchemas.set(config, created);\n\t\treturn created;\n\t}\n\n\t/**\n\t * Validate a single element against this engine's registrations, including nested children.\n\t * Use for standalone or dynamically created fields that are not already inside a normalized form.\n\t * The normalized marker is applied only after this element and its children succeed.\n\t */\n\tvalidateElement(config: unknown): NormalizedElementConfig<TOutputs['elements']> {\n\t\treturn validateElementConfig(config, {\n\t\t\tgetElement: (id) => this.getElement(id),\n\t\t\tcheckRule: (rule) => this.validationRegistry.check(rule),\n\t\t\taxes: this.layout.axes,\n\t\t}) as unknown as NormalizedElementConfig<TOutputs['elements']>;\n\t}\n\n\tdescribeRecipe($type: string): RecipeDescriptor {\n\t\tconst recipe = this.getRecipe($type);\n\t\tif (!recipe) {\n\t\t\tthrow new Error(`Unknown recipe '${$type}'. Register it with createFormEngine({ recipes: [...] }).`);\n\t\t}\n\t\treturn describeRecipeFromRegistration(recipe, (r) => this.generateRecipeViewSchema(r));\n\t}\n\n\tdescribeViewCatalog(): ViewCatalog {\n\t\treturn describeViewCatalogFromRecipes(this.getAllRecipes(), (r) => this.generateRecipeViewSchema(r));\n\t}\n\n\tgetAuthoringInstructions(): string {\n\t\treturn getAuthoringInstructionsFromCatalog(this.describeViewCatalog());\n\t}\n\n\t/**\n\t * @remarks\n\t * Generated as input: authors may omit prefaulted slots and defaulted keys, so only `$type` is required.\n\t *\n\t * Uses the schema the export lists the recipe by, which lists each slot's declared appearance axes,\n\t * so a view document gets the same autocomplete as the form config.\n\t */\n\tprivate generateRecipeViewSchema(recipe: AnyRecipeRegistration): Record<string, unknown> {\n\t\tconst id = SchemaMetadataCatalog.entryId(ComponentType.Recipe, recipe.$type);\n\t\ttry {\n\t\t\treturn generateZodJSONSchemaDocument(\n\t\t\t\t(this.schemaArtifacts.exportSchemas.get(id) ?? recipe.schema) as z.ZodMiniType,\n\t\t\t\tthis.schemaArtifacts.metadataRegistry,\n\t\t\t\t{\n\t\t\t\t\ttarget: 'draft-2020-12',\n\t\t\t\t\tio: 'input',\n\t\t\t\t\tschemaId: id,\n\t\t\t\t},\n\t\t\t) as Record<string, unknown>;\n\t\t} catch (error) {\n\t\t\tlogger.warn('Could not generate recipe view schema', {\n\t\t\t\trecipe: recipe.$type,\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t});\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tgetSchemaArtifacts() {\n\t\treturn this.schemaArtifacts;\n\t}\n\n\tgetFormConfigStandardSchema(): StandardJSONSchemaV1 {\n\t\treturn this.schemaArtifacts.jsonSchema.formConfigStandardSchema;\n\t}\n\n\tgetActionConfigStandardSchema(actionType: string): StandardJSONSchemaV1 | undefined {\n\t\treturn this.schemaArtifacts.jsonSchema.actionConfigStandardSchemas[actionType];\n\t}\n\n\tgetSchemaCatalog() {\n\t\treturn this.schemaArtifacts.metadataCatalog;\n\t}\n\n\tgetSchemaRegistry() {\n\t\treturn this.schemaArtifacts.metadataRegistry;\n\t}\n\n\tgenerateJSONSchemaCollection(options?: {\n\t\ttarget?: 'draft-4' | 'draft-7' | 'draft-2020-12' | 'openapi-3.0';\n\t\turi?: (id: string) => string;\n\t\tio?: 'input' | 'output';\n\t}) {\n\t\treturn this.schemaArtifacts.jsonSchema.generateCollection(options);\n\t}\n\n\tgetFormConfigSchema() {\n\t\treturn this.schemaArtifacts.formConfigValidator;\n\t}\n\n\t/**\n\t * JSON Schema of the form config authors write, for editor autocomplete.\n\t *\n\t * @remarks\n\t * `io` defaults to `'input'`, as it does for {@link FormEngine.generateJSONSchemaCollection} and\n\t * {@link FormEngine.generateActionConfigSchema}: the export describes what authors write, and an element\n\t * schema that pipes a transform (Radiant's `input-otp`) has no JSON Schema for its output side, so\n\t * `io: 'output'` throws for an engine that registers one.\n\t */\n\tgenerateFormConfigSchema(options?: {\n\t\ttarget?: 'draft-4' | 'draft-7' | 'draft-2020-12' | 'openapi-3.0';\n\t\tio?: 'input' | 'output';\n\t}) {\n\t\treturn this.schemaArtifacts.jsonSchema.generateFormConfig(options);\n\t}\n\n\tgenerateActionConfigSchema(\n\t\tactionType: string,\n\t\toptions?: {\n\t\t\ttarget?: 'draft-4' | 'draft-7' | 'draft-2020-12' | 'openapi-3.0';\n\t\t\tio?: 'input' | 'output';\n\t\t},\n\t) {\n\t\treturn this.schemaArtifacts.jsonSchema.generateActionConfig(actionType, options);\n\t}\n\n\t/**\n\t * Return a new engine with additional registrations merged in.\n\t * Duplicate `$type` values follow last-wins semantics.\n\t */\n\textend<\n\t\tconst TNewElements extends readonly ElementRegistrationConstraint[] = readonly [],\n\t\tconst TNewRecipes extends readonly RecipeRegistrationConstraint[] = readonly [],\n\t\tconst TNewActions extends readonly ActionRegistrationConstraint[] = readonly [],\n\t>(\n\t\toptions?: ExtendFormEngineOptions<TNewElements, TNewRecipes, TNewActions>,\n\t): FormEngine<\n\t\tLastWinsMerge<TElements, MergedRegistrationMap<TNewElements>>,\n\t\tLastWinsMerge<TRecipes, MergedRegistrationMap<TNewRecipes>>,\n\t\tLastWinsMerge<TActions, MergedActionRegistrationMap<TNewActions>>,\n\t\t{\n\t\t\telements: LastWinsMerge<TOutputs['elements'], MergedOutputMap<TNewElements>>;\n\t\t\trecipes: LastWinsMerge<TOutputs['recipes'], MergedOutputMap<TNewRecipes>>;\n\t\t\tactions: LastWinsMerge<TOutputs['actions'], MergedOutputMap<TNewActions>>;\n\t\t\tvalues: LastWinsMerge<TOutputs['values'], MergedValueMap<TNewElements>>;\n\t\t},\n\t\tTAppearance\n\t> {\n\t\treturn buildFormEngine({\n\t\t\telements: [...this.getAllElements(), ...(options?.elements ?? [])],\n\t\t\trecipes: [...this.getAllRecipes(), ...(options?.recipes ?? [])],\n\t\t\tactions: [...this.getAllActions(), ...(options?.actions ?? [])],\n\t\t\tvalidations: [...this.registries.validations, ...(options?.validations ?? [])],\n\t\t\tcatalog: options?.catalog ?? this.schemaArtifacts.metadataCatalog,\n\t\t\tlayout: this.layout,\n\t\t\tdefaultWizardRecipe: this.registries.defaultWizardRecipe,\n\t\t\tformatIssue: this.registries.formatIssue,\n\t\t\tfetch: this.registries.baseFetch,\n\t\t\tcsrf: this.registries.csrf,\n\t\t}) as unknown as FormEngine<\n\t\t\tLastWinsMerge<TElements, MergedRegistrationMap<TNewElements>>,\n\t\t\tLastWinsMerge<TRecipes, MergedRegistrationMap<TNewRecipes>>,\n\t\t\tLastWinsMerge<TActions, MergedActionRegistrationMap<TNewActions>>,\n\t\t\t{\n\t\t\t\telements: LastWinsMerge<TOutputs['elements'], MergedOutputMap<TNewElements>>;\n\t\t\t\trecipes: LastWinsMerge<TOutputs['recipes'], MergedOutputMap<TNewRecipes>>;\n\t\t\t\tactions: LastWinsMerge<TOutputs['actions'], MergedOutputMap<TNewActions>>;\n\t\t\t\tvalues: LastWinsMerge<TOutputs['values'], MergedValueMap<TNewElements>>;\n\t\t\t},\n\t\t\tTAppearance\n\t\t>;\n\t}\n}\n\n/**\n * Engine operations available while rendering a form.\n *\n * @remarks\n * Registration extension belongs to engine construction. Omitting it allows a\n * renderer to hold engines with different parsed output maps without widening\n * their authoring or normalized return types on the constructed engine.\n */\nexport type FormEngineRuntime<\n\tTElements extends Record<string, unknown> = Record<string, unknown>,\n\tTRecipes extends Record<string, unknown> = Record<string, unknown>,\n\tTActions extends Record<string, unknown> = Record<string, unknown>,\n\tTOutputs extends EngineOutputMaps = EngineOutputMaps,\n\tTAppearance extends Record<string, string> = ResolvedAppearanceAxes,\n> = Omit<FormEngine<TElements, TRecipes, TActions, TOutputs, TAppearance>, 'extend'>;\n\nexport type { EngineOutputMaps } from '@/builder/types.utils';\n", "import { globalFetch, withCsrf, type CsrfPolicy, type FormFetch } from '@/lib/form-fetch';\nimport type { FormIssueFormatter } from '@/state-container/types';\nimport { assertStandardSchema, createRegistry } from '@schema-engine/registry';\nimport type { AnyElementRegistration, AnyRecipeRegistration, AnyActionRegistration } from '@/types/registration';\nimport type {\n\tActionRegistrationConstraint,\n\tElementRegistrationConstraint,\n\tRecipeRegistrationConstraint,\n} from '@/builder/types.utils';\nimport type { ValidationRegistrationConstraint } from '@/schemas/validation/types';\nimport { FormEngine } from '@/engine/form-engine';\nimport { ComponentType } from '@/engine/component-type';\nimport { createActionConfigValidatorMap, createFormEngineSchemaArtifacts } from '@/engine/schema-artifacts';\nimport { SchemaMetadataCatalog } from '@/engine/schema-metadata-catalog';\nimport { logger } from '@/lib/logger';\nimport { declaresChildren, withExportedChildren } from '@/lib/element-children';\nimport { withExportedRules } from '@/lib/exported-rules';\nimport { withActionEnvelope } from '@/lib/exported-action-envelope';\nimport {\n\tassertAxesNotReserved,\n\tcreateAppearanceSchema,\n\tcreateLayoutTheme,\n\tgetDefaultLayoutTheme,\n\tisLayoutTheme,\n\twithAppearanceAxes,\n\twithSlotAppearanceAxes,\n\ttype LayoutInput,\n\ttype LayoutTheme,\n} from '@schema-engine/layout';\nimport { RENDERER_DATA_ATTRIBUTES } from '@/lib/renderer-data-attributes';\nimport { createFormConfigShape } from '@/schemas/form-config-shape';\nimport * as z from 'zod/mini';\nimport { isZodType } from '@/lib/zod-json-schema';\nimport { assertDefaultWizardRecipe, createFormRecipeRegistry } from '@/recipes/protocol';\nimport { createDefaultValidationRegistry, type ValidationRegistry } from '@/schemas/validation';\n\n/**\n * Rejects an element registration that states no `kind`, or an input that declares no `value`, which types forbid but a hand-written object does not.\n *\n * @remarks\n * `defineInput` and `defineStatic` set `kind`, which is what says whether an element holds a value: its metadata is for display and is never read here.\n * A registration written without the helpers states its `kind`.\n *\n * For an `input` the rule is the one the types state: `value` is required exactly when the schema declares no `elements`, since the\n * value of a container is composed from its children. A `containerKind` is no escape for that: it belongs beside\n * `elements`. The one exception is a schema that is not Zod, which cannot be read for `elements`\n * (`declaresChildren` returns `undefined`), so there `containerKind` says the element holds children. A `static` element holds no value and is not checked further.\n */\nfunction assertValueDeclared(registration: ElementRegistrationConstraint): void {\n\tconst { kind } = registration;\n\tif (kind !== 'input' && kind !== 'static') {\n\t\tthrow new Error(\n\t\t\t`Element '${registration.$type}' states no kind. Build it with \\`defineInput\\` or \\`defineStatic\\`, or set \\`kind: 'input'\\` (it holds a value or children) or \\`kind: 'static'\\` (display only) on a registration written by hand.`,\n\t\t);\n\t}\n\tif (kind === 'static') return;\n\tif (typeof registration.value === 'function') return;\n\tconst children = declaresChildren(registration.schema);\n\tif (children === true || (children === undefined && registration.containerKind !== undefined)) return;\n\tthrow new Error(\n\t\t`Element '${registration.$type}' is an input that declares no value. Give it \\`value: (config) => schema\\`, the value its control writes. An input that holds children declares \\`elements\\` in its schema instead; \\`containerKind\\` stands in for that only when the schema is not Zod, which cannot be read for them. A display-only element is made with \\`defineStatic\\`.`,\n\t);\n}\n\nfunction createUnionSchema(schemas: z.ZodMiniType[]): z.ZodMiniType {\n\tif (schemas.length === 0) {\n\t\treturn z.never();\n\t}\n\tif (schemas.length === 1) {\n\t\treturn schemas[0];\n\t}\n\treturn z.union(schemas as [z.ZodMiniType, z.ZodMiniType, ...z.ZodMiniType[]]);\n}\n\n/**\n * What a registration contributes to the schema catalog and the JSON Schema export: its `$type`,\n * its own validator schema, the schema the export lists it by, and its catalog metadata.\n */\ntype ExportRegistration = {\n\t$type: string;\n\tschema: unknown;\n\texportSchema: unknown;\n\tmetadata: { name: string; description?: string; category?: string };\n\t/** Axes declared by an element, so a native Standard Schema envelope can list them. */\n\tappearanceAxes?: readonly string[];\n};\n\n/**\n * JSON Schema / authoring union. Zod registrations keep their full schema.\n * Native Standard Schema registrations contribute a literal `$type` envelope\n * so mixed engines do not silently drop supported types; an element's envelope\n * also lists the axes it declares, because a pick is checked whatever the schema.\n */\nfunction createRegistrationSchema(\n\tregistrations: ExportRegistration[],\n\tenvelopeAppearance?: (registration: ExportRegistration) => z.ZodMiniType,\n): z.ZodMiniType {\n\tconst parts = registrations.map((registration) => {\n\t\tif (isZodType(registration.exportSchema)) return registration.exportSchema;\n\t\treturn z.looseObject({\n\t\t\t$type: z.literal(registration.$type),\n\t\t\t...(envelopeAppearance ? { appearance: z.optional(envelopeAppearance(registration)) } : {}),\n\t\t});\n\t});\n\treturn createUnionSchema(parts);\n}\n\n/**\n * The registrations of one registry as the JSON Schema export lists them: the schema of an element\n * or recipe is closed over the axes it declares, built from the layout theme's axes.\n *\n * @remarks\n * Validation parses the registration's own schema, and the catalog keeps associating it, so only\n * the export sees the closed one. Computed once per registration, so the form config union and the\n * metadata registry hold the same schema object and the export refers to it by its id.\n *\n * With `childSchema`, an element that holds an `elements` array has its children typed as that schema,\n * the lazy union of every element's export schema, so a child gets the same closed `appearance` as a\n * top-level element. The union is lazy because it contains the container itself.\n *\n * With `ruleSchema`, an element's `rules` are typed as that schema, so the export lists each registered rule.\n */\nfunction toExportRegistrations(\n\tregistrations: Iterable<AnyElementRegistration | AnyRecipeRegistration | AnyActionRegistration>,\n\tcomponentType: ComponentType,\n\tlayout: LayoutTheme,\n\tchildSchema?: z.ZodMiniType,\n\truleSchema?: z.ZodMiniType,\n): ExportRegistration[] {\n\treturn Array.from(registrations, (registration) => {\n\t\tconst exported: ExportRegistration = {\n\t\t\t$type: registration.$type,\n\t\t\tschema: registration.schema,\n\t\t\texportSchema: registration.schema,\n\t\t\tmetadata: registration.metadata,\n\t\t};\n\t\tif (!isZodType(registration.schema)) {\n\t\t\tif (componentType === ComponentType.Element) {\n\t\t\t\texported.appearanceAxes = (registration as AnyElementRegistration).appearanceAxes ?? [];\n\t\t\t}\n\t\t\treturn exported;\n\t\t}\n\t\tif (componentType === ComponentType.Element) {\n\t\t\tconst withAppearance = withAppearanceAxes(\n\t\t\t\tregistration.schema,\n\t\t\t\tlayout.appearance,\n\t\t\t\t(registration as AnyElementRegistration).appearanceAxes,\n\t\t\t);\n\t\t\tconst withChildren = childSchema ? withExportedChildren(withAppearance, childSchema) : withAppearance;\n\t\t\texported.exportSchema = ruleSchema ? withExportedRules(withChildren, ruleSchema) : withChildren;\n\t\t} else if (componentType === ComponentType.Recipe) {\n\t\t\texported.exportSchema = withSlotAppearanceAxes(\n\t\t\t\tregistration.schema,\n\t\t\t\tlayout.appearance,\n\t\t\t\t(registration as AnyRecipeRegistration).appearanceAxes,\n\t\t\t);\n\t\t} else {\n\t\t\texported.exportSchema = withActionEnvelope(registration.schema, registration.$type);\n\t\t}\n\t\treturn exported;\n\t});\n}\n\n/** The id the JSON Schema export defines the rule union by, so each element refers to it. */\nconst RULE_EXPORT_ID = 'validation-rule';\n\n/**\n * The schema of a rule as the JSON Schema export lists it: any one of the registered rules, each by\n * its own schema, so a custom rule and a replaced built-in show the options their registration declares.\n *\n * @remarks\n * Only a Zod schema can be written out as JSON Schema here: a registration whose schema comes from another\n * Standard Schema library is listed by its `$type` alone, with no options. The union is built once and carries\n * an id in the metadata registry, so the export defines it once and each element refers to it.\n */\nfunction createRuleExportSchema(validations: ValidationRegistry): z.ZodMiniType {\n\treturn createUnionSchema(\n\t\tvalidations\n\t\t\t.all()\n\t\t\t.map((registration) =>\n\t\t\t\tisZodType(registration.schema)\n\t\t\t\t\t? registration.schema\n\t\t\t\t\t: z.looseObject({ $type: z.literal(registration.$type) }),\n\t\t\t),\n\t);\n}\n\nfunction createElementsUnion(elements: ExportRegistration[], layout: LayoutTheme): z.ZodMiniType {\n\treturn createRegistrationSchema(elements, (element) =>\n\t\tcreateAppearanceSchema(layout.appearance, element.appearanceAxes),\n\t);\n}\n\nfunction createFormConfigSchema(\n\telementsUnion: z.ZodMiniType,\n\trecipes: ExportRegistration[],\n\tactions: ExportRegistration[],\n\tlayout: LayoutTheme,\n) {\n\tconst recipesUnion = createRegistrationSchema(recipes);\n\tconst actionsUnion = createRegistrationSchema(actions);\n\n\treturn createFormConfigShape({\n\t\telements: elementsUnion,\n\t\tview: recipes.length > 0 ? recipesUnion : z.never(),\n\t\tactions: actionsUnion,\n\t\tappearance: createAppearanceSchema(layout.appearance),\n\t});\n}\n\n/**\n * Writes a registration's catalog entry, keyed by {@link SchemaMetadataCatalog.entryId}.\n *\n * @remarks\n * Overwrites any existing entry for that id, so an overriding registration's\n * title and description follow the same last-wins rule as the registration.\n */\nfunction registerSchemaMetadata(\n\tcatalog: SchemaMetadataCatalog,\n\tcomponentType: ComponentType,\n\tregistration: Pick<ExportRegistration, '$type' | 'schema' | 'metadata'>,\n): void {\n\tconst id = SchemaMetadataCatalog.entryId(componentType, registration.$type);\n\tcatalog.register(assertStandardSchema(registration.schema, `Registration '${id}' schema`), {\n\t\tid,\n\t\tcomponentType,\n\t\ttitle: registration.metadata.name,\n\t\tdescription: registration.metadata.description,\n\t\tcategory: registration.metadata.category,\n\t});\n}\n\n/**\n * Rejects an axis a registration declares that the layout theme's axis registry does not hold, so a\n * typo such as `'sise'` fails the build instead of silently making the axis unsupported.\n */\nfunction assertDeclaredAxes(owner: string, axes: readonly string[] | undefined, layout: LayoutTheme): void {\n\tfor (const axis of axes ?? []) {\n\t\tif (!layout.appearance.has(axis)) {\n\t\t\tthrow new Error(\n\t\t\t\t`${owner} declares unknown appearance axis '${axis}'. Declared axes: ${layout.appearance.keys().join(', ')}. Add it with createFormEngine({ layout: { appearance: [...builtInAxes, defineAxis({ $type: '${axis}', ... })] } }).`,\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport type FormEngineRegistrationLists = {\n\telements?: readonly ElementRegistrationConstraint[];\n\trecipes?: readonly RecipeRegistrationConstraint[];\n\tactions?: readonly ActionRegistrationConstraint[];\n\tvalidations?: readonly ValidationRegistrationConstraint[];\n\tcatalog?: SchemaMetadataCatalog;\n\tdefaultWizardRecipe?: string;\n\tformatIssue?: FormIssueFormatter;\n\tlayout?: LayoutInput;\n\tfetch?: FormFetch;\n\tcsrf?: CsrfPolicy;\n};\n\n/**\n * The layout theme an engine runs on: the library default, a theme compiled elsewhere, or one\n * compiled from inline options.\n *\n * @remarks\n * Forms passes its renderer attributes as `reservedNames`, so an axis cannot overwrite a\n * `data-se-*` attribute a renderer writes. A theme compiled elsewhere skipped that check, so it is\n * re-checked here.\n *\n * A value that is not a compiled theme must be `{ grid, appearance }` options and nothing else. A\n * spread copy or a JSON copy of a theme has `id`, `axes` and `css` keys and lost its brand (a\n * structured clone of one throws instead, because the theme holds functions);\n * compiling it as options would drop its appearance axes and change its id without a word, so it\n * throws instead.\n */\nfunction resolveLayout(layout: LayoutInput | undefined): LayoutTheme {\n\tif (layout === undefined) return getDefaultLayoutTheme();\n\tif (isLayoutTheme(layout)) {\n\t\tassertAxesNotReserved(layout, RENDERER_DATA_ATTRIBUTES);\n\t\treturn layout;\n\t}\n\tfor (const key of Object.keys(layout)) {\n\t\tif (key !== 'grid' && key !== 'appearance') {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid layout option: unknown key '${key}'. layout takes a theme from createLayoutTheme or { grid, appearance } options. If this is a copy of a compiled theme, pass the compiled theme itself, not a copy.`,\n\t\t\t);\n\t\t}\n\t}\n\treturn createLayoutTheme(layout, { reservedNames: RENDERER_DATA_ATTRIBUTES });\n}\n\n/**\n * Single construction path for {@link createFormEngine} and {@link FormEngine.extend}.\n * Later duplicate `$type` values overwrite earlier ones (last-wins).\n */\nexport function buildFormEngine(lists: FormEngineRegistrationLists) {\n\tconst layout = resolveLayout(lists.layout);\n\tconst elementRegistry = createRegistry('Element', (lists.elements ?? []) as readonly AnyElementRegistration[]);\n\tfor (const registration of lists.elements ?? []) assertValueDeclared(registration);\n\tconst recipeRegistry = createFormRecipeRegistry((lists.recipes ?? []) as readonly AnyRecipeRegistration[]);\n\tconst actionRegistry = createRegistry('Action', (lists.actions ?? []) as readonly AnyActionRegistration[]);\n\n\tfor (const element of elementRegistry.all()) {\n\t\tassertDeclaredAxes(`Element '${element.$type}'`, element.appearanceAxes, layout);\n\t}\n\tfor (const recipe of recipeRegistry.all()) {\n\t\tfor (const [slot, axes] of Object.entries(recipe.appearanceAxes ?? {})) {\n\t\t\tassertDeclaredAxes(`Recipe '${recipe.$type}' slot '${slot}'`, axes, layout);\n\t\t}\n\t}\n\n\tconst validations = Object.freeze([...(lists.validations ?? [])]);\n\tconst requestFetch = lists.csrf ? withCsrf(lists.fetch ?? globalFetch, lists.csrf) : (lists.fetch ?? globalFetch);\n\tconst validationRegistry = createDefaultValidationRegistry(\n\t\t[\n\t\t\t...collectElementValidations(elementRegistry.all() as readonly ElementRegistrationConstraint[]),\n\t\t\t...validations,\n\t\t],\n\t\t{ fetch: requestFetch },\n\t);\n\n\tassertDefaultWizardRecipe(recipeRegistry, lists.defaultWizardRecipe);\n\n\tlogger.debug('Building FormEngine', {\n\t\telements: elementRegistry.size,\n\t\trecipes: recipeRegistry.size,\n\t\tactions: actionRegistry.size,\n\t});\n\n\tconst childSchema = z.lazy(() => elementsUnion);\n\tconst ruleSchema = createRuleExportSchema(validationRegistry);\n\tconst exportedElements = toExportRegistrations(\n\t\telementRegistry.all(),\n\t\tComponentType.Element,\n\t\tlayout,\n\t\tchildSchema,\n\t\truleSchema,\n\t);\n\tconst exportedRecipes = toExportRegistrations(recipeRegistry.all(), ComponentType.Recipe, layout);\n\tconst exportedActions = toExportRegistrations(actionRegistry.all(), ComponentType.Action, layout);\n\n\tconst exportSchemas = new Map<string, z.ZodMiniType>();\n\tfor (const [componentType, exported] of [\n\t\t[ComponentType.Element, exportedElements],\n\t\t[ComponentType.Recipe, exportedRecipes],\n\t\t[ComponentType.Action, exportedActions],\n\t] as const) {\n\t\tfor (const item of exported) {\n\t\t\tif (item.exportSchema !== item.schema && isZodType(item.exportSchema)) {\n\t\t\t\texportSchemas.set(SchemaMetadataCatalog.entryId(componentType, item.$type), item.exportSchema);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst metadataCatalog = lists.catalog?.clone() ?? new SchemaMetadataCatalog();\n\tfor (const [componentType, registrations] of [\n\t\t[ComponentType.Element, exportedElements],\n\t\t[ComponentType.Recipe, exportedRecipes],\n\t\t[ComponentType.Action, exportedActions],\n\t\t[ComponentType.Axis, layout.appearance.all()],\n\t] as const) {\n\t\tfor (const item of registrations) {\n\t\t\tregisterSchemaMetadata(metadataCatalog, componentType, item);\n\t\t}\n\t}\n\n\tconst elementsUnion = createElementsUnion(exportedElements, layout);\n\tconst formConfigSchema = createFormConfigSchema(elementsUnion, exportedRecipes, exportedActions, layout);\n\tconst actionConfigValidators = createActionConfigValidatorMap(exportedActions);\n\tconst schemaArtifacts = createFormEngineSchemaArtifacts(\n\t\tmetadataCatalog,\n\t\tformConfigSchema,\n\t\tactionConfigValidators,\n\t\texportSchemas,\n\t\t[\n\t\t\t{\n\t\t\t\tschema: ruleSchema,\n\t\t\t\tmetadata: {\n\t\t\t\t\tid: RULE_EXPORT_ID,\n\t\t\t\t\ttitle: 'Validation rule',\n\t\t\t\t\tdescription: 'Any one of the rules the engine registers, with its options.',\n\t\t\t\t\tcomponentType: ComponentType.Validation,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t);\n\n\treturn new FormEngine({\n\t\telements: elementRegistry,\n\t\trecipes: recipeRegistry,\n\t\tactions: actionRegistry,\n\t\tschemaArtifacts,\n\t\tlayout,\n\t\tvalidationRegistry,\n\t\tvalidations,\n\t\tdefaultWizardRecipe: lists.defaultWizardRecipe,\n\t\tformatIssue: lists.formatIssue,\n\t\tfetch: requestFetch,\n\t\tbaseFetch: lists.fetch,\n\t\tcsrf: lists.csrf,\n\t});\n}\n\n/**\n * Validations declared by the winning element of each `$type`, in the element registry's order.\n *\n * @remarks\n * An element replaced by a later one with the same `$type` contributes nothing. The order is the\n * registry's: a replaced `$type` keeps the position of its first registration, as it does for\n * every other lookup. When two elements declare the same validation `$type`, the one later in that\n * order wins. {@link FormEngine.extend} rebuilds from the same registry order, so an extended\n * engine with no new elements keeps the same winner.\n */\nfunction collectElementValidations(\n\telements: readonly ElementRegistrationConstraint[],\n): ValidationRegistrationConstraint[] {\n\treturn elements.flatMap((element) => element.validations ?? []);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,OAAmB;;;ACNnB,SAAS,sBAAsB,sBAAsB;AAgBrD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGM;AAGP,YAAY,OAAO;AAiBnB,SAAS,oBAAoB,cAAmD;AAC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{ Logger } from '@ecopages/logger';\n\nexport const logger = new Logger('[schema-engine/forms]');\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAc;AAEhB,IAAM,SAAS,IAAI,OAAO,uBAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CardShellConfigSchema,
|
|
3
|
+
FormActionsConfigSchema,
|
|
4
|
+
HeroShellConfigSchema,
|
|
5
|
+
MinimalProgressConfigSchema,
|
|
6
|
+
SidebarShellConfigSchema,
|
|
7
|
+
SplitScreenShellConfigSchema,
|
|
8
|
+
StepHeaderConfigSchema,
|
|
9
|
+
StepIndicatorsConfigSchema,
|
|
10
|
+
WizardActionsConfigSchema
|
|
11
|
+
} from "./chunk-J5BSFDVK.js";
|
|
12
|
+
import {
|
|
13
|
+
defineRecipeSpec
|
|
14
|
+
} from "./chunk-E4VONSLO.js";
|
|
15
|
+
|
|
16
|
+
// src/recipes/built-in-specs.ts
|
|
17
|
+
var MINIMAL_ACTIONS = { variant: "minimal", showStepCounter: false };
|
|
18
|
+
var CARD_SHELL_AXES = ["size", "surface"];
|
|
19
|
+
var SPACED_SHELL_AXES = ["size"];
|
|
20
|
+
var CENTERED_HEADER = { align: "center", size: "md" };
|
|
21
|
+
var HERO_HEADER = { align: "center", size: "lg", titleAs: "h1", inheritColor: true };
|
|
22
|
+
var WIZARD_PROGRESS_HEADER = { showStepCounter: true, counterPlacement: "before" };
|
|
23
|
+
var cardSpec = defineRecipeSpec({
|
|
24
|
+
$type: "card",
|
|
25
|
+
kind: "single-step",
|
|
26
|
+
slotSchemas: { shell: CardShellConfigSchema, header: StepHeaderConfigSchema, actions: FormActionsConfigSchema },
|
|
27
|
+
slotDefaults: { header: CENTERED_HEADER },
|
|
28
|
+
appearanceAxes: { shell: CARD_SHELL_AXES },
|
|
29
|
+
metadata: { name: "Card", description: "Single-step form in a centered card shell.", category: "layout" }
|
|
30
|
+
});
|
|
31
|
+
var splitScreenSpec = defineRecipeSpec({
|
|
32
|
+
$type: "split-screen",
|
|
33
|
+
kind: "single-step",
|
|
34
|
+
slotSchemas: { shell: SplitScreenShellConfigSchema, actions: FormActionsConfigSchema },
|
|
35
|
+
appearanceAxes: { shell: SPACED_SHELL_AXES },
|
|
36
|
+
metadata: { name: "Split screen", description: "Single-step form with a side panel.", category: "layout" }
|
|
37
|
+
});
|
|
38
|
+
var heroBackgroundSpec = defineRecipeSpec({
|
|
39
|
+
$type: "hero-background",
|
|
40
|
+
kind: "single-step",
|
|
41
|
+
slotSchemas: { shell: HeroShellConfigSchema, header: StepHeaderConfigSchema, actions: FormActionsConfigSchema },
|
|
42
|
+
slotDefaults: { header: HERO_HEADER },
|
|
43
|
+
appearanceAxes: { shell: SPACED_SHELL_AXES },
|
|
44
|
+
metadata: {
|
|
45
|
+
name: "Hero background",
|
|
46
|
+
description: "Single-step form over a hero image or video.",
|
|
47
|
+
category: "layout"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var bareControlsSpec = defineRecipeSpec({
|
|
51
|
+
$type: "bare-controls",
|
|
52
|
+
kind: "wizard",
|
|
53
|
+
slotSchemas: { actions: WizardActionsConfigSchema },
|
|
54
|
+
metadata: {
|
|
55
|
+
name: "Bare controls",
|
|
56
|
+
description: "Multi-step form with previous, next, and submit controls only.",
|
|
57
|
+
category: "wizard"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var cardWizardSpec = defineRecipeSpec({
|
|
61
|
+
$type: "card-wizard",
|
|
62
|
+
kind: "wizard",
|
|
63
|
+
slotSchemas: {
|
|
64
|
+
shell: CardShellConfigSchema,
|
|
65
|
+
header: StepHeaderConfigSchema,
|
|
66
|
+
progress: MinimalProgressConfigSchema,
|
|
67
|
+
actions: WizardActionsConfigSchema
|
|
68
|
+
},
|
|
69
|
+
slotDefaults: { header: { ...CENTERED_HEADER, ...WIZARD_PROGRESS_HEADER }, actions: MINIMAL_ACTIONS },
|
|
70
|
+
appearanceAxes: { shell: CARD_SHELL_AXES },
|
|
71
|
+
metadata: {
|
|
72
|
+
name: "Card wizard",
|
|
73
|
+
description: "Multi-step wizard inside a card shell with progress bar.",
|
|
74
|
+
category: "wizard"
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
var wizardSpec = defineRecipeSpec({
|
|
78
|
+
$type: "wizard",
|
|
79
|
+
kind: "wizard",
|
|
80
|
+
slotSchemas: {
|
|
81
|
+
header: StepHeaderConfigSchema,
|
|
82
|
+
progress: StepIndicatorsConfigSchema,
|
|
83
|
+
actions: WizardActionsConfigSchema
|
|
84
|
+
},
|
|
85
|
+
metadata: {
|
|
86
|
+
name: "Wizard",
|
|
87
|
+
description: "Multi-step wizard with horizontal step indicators.",
|
|
88
|
+
category: "wizard"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var sidebarWizardSpec = defineRecipeSpec({
|
|
92
|
+
$type: "sidebar-wizard",
|
|
93
|
+
kind: "wizard",
|
|
94
|
+
slotSchemas: {
|
|
95
|
+
shell: SidebarShellConfigSchema,
|
|
96
|
+
header: StepHeaderConfigSchema,
|
|
97
|
+
progress: StepIndicatorsConfigSchema,
|
|
98
|
+
actions: WizardActionsConfigSchema
|
|
99
|
+
},
|
|
100
|
+
slotDefaults: { shell: { showSeparator: true }, header: { size: "sm" }, progress: { orientation: "sidebar" } },
|
|
101
|
+
appearanceAxes: { shell: SPACED_SHELL_AXES },
|
|
102
|
+
metadata: {
|
|
103
|
+
name: "Sidebar wizard",
|
|
104
|
+
description: "Multi-step wizard with step indicators in a sidebar.",
|
|
105
|
+
category: "wizard"
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
var heroWizardSpec = defineRecipeSpec({
|
|
109
|
+
$type: "hero-wizard",
|
|
110
|
+
kind: "wizard",
|
|
111
|
+
slotSchemas: {
|
|
112
|
+
shell: HeroShellConfigSchema,
|
|
113
|
+
header: StepHeaderConfigSchema,
|
|
114
|
+
progress: MinimalProgressConfigSchema,
|
|
115
|
+
actions: WizardActionsConfigSchema
|
|
116
|
+
},
|
|
117
|
+
slotDefaults: { header: { ...HERO_HEADER, ...WIZARD_PROGRESS_HEADER }, actions: MINIMAL_ACTIONS },
|
|
118
|
+
appearanceAxes: { shell: SPACED_SHELL_AXES },
|
|
119
|
+
metadata: { name: "Hero wizard", description: "Multi-step wizard over a hero background.", category: "wizard" }
|
|
120
|
+
});
|
|
121
|
+
var splitScreenWizardSpec = defineRecipeSpec({
|
|
122
|
+
$type: "split-screen-wizard",
|
|
123
|
+
kind: "wizard",
|
|
124
|
+
slotSchemas: {
|
|
125
|
+
shell: SplitScreenShellConfigSchema,
|
|
126
|
+
header: StepHeaderConfigSchema,
|
|
127
|
+
progress: StepIndicatorsConfigSchema,
|
|
128
|
+
actions: WizardActionsConfigSchema
|
|
129
|
+
},
|
|
130
|
+
slotDefaults: { header: { fallbackToFormTitle: false } },
|
|
131
|
+
appearanceAxes: { shell: SPACED_SHELL_AXES },
|
|
132
|
+
metadata: {
|
|
133
|
+
name: "Split screen wizard",
|
|
134
|
+
description: "Multi-step wizard with a marketing side panel.",
|
|
135
|
+
category: "wizard"
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
var builtInRecipeSpecs = {
|
|
139
|
+
card: cardSpec,
|
|
140
|
+
"split-screen": splitScreenSpec,
|
|
141
|
+
"hero-background": heroBackgroundSpec,
|
|
142
|
+
"bare-controls": bareControlsSpec,
|
|
143
|
+
"card-wizard": cardWizardSpec,
|
|
144
|
+
wizard: wizardSpec,
|
|
145
|
+
"sidebar-wizard": sidebarWizardSpec,
|
|
146
|
+
"hero-wizard": heroWizardSpec,
|
|
147
|
+
"split-screen-wizard": splitScreenWizardSpec
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
cardSpec,
|
|
152
|
+
splitScreenSpec,
|
|
153
|
+
heroBackgroundSpec,
|
|
154
|
+
bareControlsSpec,
|
|
155
|
+
cardWizardSpec,
|
|
156
|
+
wizardSpec,
|
|
157
|
+
sidebarWizardSpec,
|
|
158
|
+
heroWizardSpec,
|
|
159
|
+
splitScreenWizardSpec,
|
|
160
|
+
builtInRecipeSpecs
|
|
161
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/recipes/built-in-specs.ts"],
|
|
4
|
+
"sourcesContent": ["import { defineRecipeSpec } from './define-recipe-spec';\nimport {\n\tCardShellConfigSchema,\n\tFormActionsConfigSchema,\n\tHeroShellConfigSchema,\n\tMinimalProgressConfigSchema,\n\tSplitScreenShellConfigSchema,\n\tSidebarShellConfigSchema,\n\tStepHeaderConfigSchema,\n\tStepIndicatorsConfigSchema,\n\tWizardActionsConfigSchema,\n} from './slot-schemas';\n\nconst MINIMAL_ACTIONS = { variant: 'minimal', showStepCounter: false } as const;\nconst CARD_SHELL_AXES = ['size', 'surface'] as const;\nconst SPACED_SHELL_AXES = ['size'] as const;\nconst CENTERED_HEADER = { align: 'center', size: 'md' } as const;\nconst HERO_HEADER = { align: 'center', size: 'lg', titleAs: 'h1', inheritColor: true } as const;\nconst WIZARD_PROGRESS_HEADER = { showStepCounter: true, counterPlacement: 'before' } as const;\n\nexport const cardSpec = defineRecipeSpec({\n\t$type: 'card',\n\tkind: 'single-step',\n\tslotSchemas: { shell: CardShellConfigSchema, header: StepHeaderConfigSchema, actions: FormActionsConfigSchema },\n\tslotDefaults: { header: CENTERED_HEADER },\n\tappearanceAxes: { shell: CARD_SHELL_AXES },\n\tmetadata: { name: 'Card', description: 'Single-step form in a centered card shell.', category: 'layout' },\n});\n\nexport const splitScreenSpec = defineRecipeSpec({\n\t$type: 'split-screen',\n\tkind: 'single-step',\n\tslotSchemas: { shell: SplitScreenShellConfigSchema, actions: FormActionsConfigSchema },\n\tappearanceAxes: { shell: SPACED_SHELL_AXES },\n\tmetadata: { name: 'Split screen', description: 'Single-step form with a side panel.', category: 'layout' },\n});\n\nexport const heroBackgroundSpec = defineRecipeSpec({\n\t$type: 'hero-background',\n\tkind: 'single-step',\n\tslotSchemas: { shell: HeroShellConfigSchema, header: StepHeaderConfigSchema, actions: FormActionsConfigSchema },\n\tslotDefaults: { header: HERO_HEADER },\n\tappearanceAxes: { shell: SPACED_SHELL_AXES },\n\tmetadata: {\n\t\tname: 'Hero background',\n\t\tdescription: 'Single-step form over a hero image or video.',\n\t\tcategory: 'layout',\n\t},\n});\n\nexport const bareControlsSpec = defineRecipeSpec({\n\t$type: 'bare-controls',\n\tkind: 'wizard',\n\tslotSchemas: { actions: WizardActionsConfigSchema },\n\tmetadata: {\n\t\tname: 'Bare controls',\n\t\tdescription: 'Multi-step form with previous, next, and submit controls only.',\n\t\tcategory: 'wizard',\n\t},\n});\n\nexport const cardWizardSpec = defineRecipeSpec({\n\t$type: 'card-wizard',\n\tkind: 'wizard',\n\tslotSchemas: {\n\t\tshell: CardShellConfigSchema,\n\t\theader: StepHeaderConfigSchema,\n\t\tprogress: MinimalProgressConfigSchema,\n\t\tactions: WizardActionsConfigSchema,\n\t},\n\tslotDefaults: { header: { ...CENTERED_HEADER, ...WIZARD_PROGRESS_HEADER }, actions: MINIMAL_ACTIONS },\n\tappearanceAxes: { shell: CARD_SHELL_AXES },\n\tmetadata: {\n\t\tname: 'Card wizard',\n\t\tdescription: 'Multi-step wizard inside a card shell with progress bar.',\n\t\tcategory: 'wizard',\n\t},\n});\n\nexport const wizardSpec = defineRecipeSpec({\n\t$type: 'wizard',\n\tkind: 'wizard',\n\tslotSchemas: {\n\t\theader: StepHeaderConfigSchema,\n\t\tprogress: StepIndicatorsConfigSchema,\n\t\tactions: WizardActionsConfigSchema,\n\t},\n\tmetadata: {\n\t\tname: 'Wizard',\n\t\tdescription: 'Multi-step wizard with horizontal step indicators.',\n\t\tcategory: 'wizard',\n\t},\n});\n\nexport const sidebarWizardSpec = defineRecipeSpec({\n\t$type: 'sidebar-wizard',\n\tkind: 'wizard',\n\tslotSchemas: {\n\t\tshell: SidebarShellConfigSchema,\n\t\theader: StepHeaderConfigSchema,\n\t\tprogress: StepIndicatorsConfigSchema,\n\t\tactions: WizardActionsConfigSchema,\n\t},\n\tslotDefaults: { shell: { showSeparator: true }, header: { size: 'sm' }, progress: { orientation: 'sidebar' } },\n\tappearanceAxes: { shell: SPACED_SHELL_AXES },\n\tmetadata: {\n\t\tname: 'Sidebar wizard',\n\t\tdescription: 'Multi-step wizard with step indicators in a sidebar.',\n\t\tcategory: 'wizard',\n\t},\n});\n\nexport const heroWizardSpec = defineRecipeSpec({\n\t$type: 'hero-wizard',\n\tkind: 'wizard',\n\tslotSchemas: {\n\t\tshell: HeroShellConfigSchema,\n\t\theader: StepHeaderConfigSchema,\n\t\tprogress: MinimalProgressConfigSchema,\n\t\tactions: WizardActionsConfigSchema,\n\t},\n\tslotDefaults: { header: { ...HERO_HEADER, ...WIZARD_PROGRESS_HEADER }, actions: MINIMAL_ACTIONS },\n\tappearanceAxes: { shell: SPACED_SHELL_AXES },\n\tmetadata: { name: 'Hero wizard', description: 'Multi-step wizard over a hero background.', category: 'wizard' },\n});\n\nexport const splitScreenWizardSpec = defineRecipeSpec({\n\t$type: 'split-screen-wizard',\n\tkind: 'wizard',\n\tslotSchemas: {\n\t\tshell: SplitScreenShellConfigSchema,\n\t\theader: StepHeaderConfigSchema,\n\t\tprogress: StepIndicatorsConfigSchema,\n\t\tactions: WizardActionsConfigSchema,\n\t},\n\tslotDefaults: { header: { fallbackToFormTitle: false } },\n\tappearanceAxes: { shell: SPACED_SHELL_AXES },\n\tmetadata: {\n\t\tname: 'Split screen wizard',\n\t\tdescription: 'Multi-step wizard with a marketing side panel.',\n\t\tcategory: 'wizard',\n\t},\n});\n\nexport const builtInRecipeSpecs = {\n\tcard: cardSpec,\n\t'split-screen': splitScreenSpec,\n\t'hero-background': heroBackgroundSpec,\n\t'bare-controls': bareControlsSpec,\n\t'card-wizard': cardWizardSpec,\n\twizard: wizardSpec,\n\t'sidebar-wizard': sideb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M,IAAM,iBAAiB,iBAAiB;AAAA,EAC9C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,EACV;AAAA,EACA,cAAc,EAAE,QAAQ,EAAE,GAAG,aAAa,GAAG,uBAAuB,GAAG,SAAS,gBAAgB;AAAA,EAChG,gBAAgB,EAAE,OAAO,kBAAkB;AAAA,EAC3C,UAAU,EAAE,MAAM,eAAe,aAAa,6CAA6C,UAAU,SAAS;AAC/G,CAAC;AAEM,IAAM,wBAAwB,iBAAiB;AAAA,EACrD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,EACV;AAAA,EACA,cAAc,EAAE,QAAQ,EAAE,qBAAqB,MAAM,EAAE;AAAA,EACvD,gBAAgB,EAAE,OAAO,kBAAkB;AAAA,EAC3C,UAAU;AAAA,IACT,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACX;AACD,CAAC;AAEM,IAAM,qBAAqB;AAAA,EACjC,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,uBAAuB;AACxB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import {
|
|
2
|
+
evaluateConstraints
|
|
3
|
+
} from "./chunk-R3MBVWVI.js";
|
|
4
|
+
import {
|
|
5
|
+
frozenCopy
|
|
6
|
+
} from "./chunk-3B7CJOF6.js";
|
|
7
|
+
import {
|
|
8
|
+
createValidationContext,
|
|
9
|
+
createZodSchemaFromRules,
|
|
10
|
+
getValidationRulesForElement,
|
|
11
|
+
isFieldRequired
|
|
12
|
+
} from "./chunk-KLATKWUA.js";
|
|
13
|
+
import {
|
|
14
|
+
getElementName,
|
|
15
|
+
walkNamedElements
|
|
16
|
+
} from "./chunk-S7I76ISM.js";
|
|
17
|
+
import {
|
|
18
|
+
expandContainerParentPaths,
|
|
19
|
+
expandFieldTemplatePaths,
|
|
20
|
+
getValueAtPath,
|
|
21
|
+
withoutValueAt
|
|
22
|
+
} from "./chunk-QLGM2AZW.js";
|
|
23
|
+
import {
|
|
24
|
+
REPORTED_TEXT,
|
|
25
|
+
ValidationSuperseded,
|
|
26
|
+
ValidationUnavailable
|
|
27
|
+
} from "./chunk-6BAJHAGL.js";
|
|
28
|
+
|
|
29
|
+
// src/engine/value-validation.ts
|
|
30
|
+
import * as z from "zod/mini";
|
|
31
|
+
var FormValidationFailure = class extends Error {
|
|
32
|
+
path;
|
|
33
|
+
ruleType;
|
|
34
|
+
ruleId;
|
|
35
|
+
/** `'unavailable'` when the service the rule asks could not answer, else `'error'`. */
|
|
36
|
+
reason;
|
|
37
|
+
constructor(path, rule, cause) {
|
|
38
|
+
const reason = cause instanceof Error ? cause.message : String(cause);
|
|
39
|
+
super(`Validation rule '${rule.$type}' could not run for '${path}': ${reason}`, { cause });
|
|
40
|
+
this.name = "FormValidationFailure";
|
|
41
|
+
this.path = path;
|
|
42
|
+
this.ruleType = rule.$type;
|
|
43
|
+
this.reason = cause instanceof ValidationUnavailable ? "unavailable" : "error";
|
|
44
|
+
if (rule.id !== void 0) this.ruleId = rule.id;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function expandContainerTemplatePaths(values, templatePath) {
|
|
48
|
+
const segments = templatePath.split(".");
|
|
49
|
+
if (segments.length === 1) {
|
|
50
|
+
return [templatePath];
|
|
51
|
+
}
|
|
52
|
+
const containerName = segments[segments.length - 1];
|
|
53
|
+
const parentPath = segments.slice(0, -1).join(".");
|
|
54
|
+
if (!containerName) {
|
|
55
|
+
return [templatePath];
|
|
56
|
+
}
|
|
57
|
+
return expandContainerParentPaths(values, parentPath).map((fieldPath) => `${fieldPath}.${containerName}`);
|
|
58
|
+
}
|
|
59
|
+
function expandArrayItemPaths(values, templatePath, depth) {
|
|
60
|
+
let paths = expandContainerTemplatePaths(values, templatePath);
|
|
61
|
+
for (let level = 0; level < depth; level += 1) {
|
|
62
|
+
paths = paths.flatMap((path) => {
|
|
63
|
+
const value = getValueAtPath(values, path);
|
|
64
|
+
return Array.isArray(value) ? Array.from({ length: value.length }, (_, index) => `${path}.${index}`) : [];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return paths;
|
|
68
|
+
}
|
|
69
|
+
function pathIsRequested(path, names, exact = false) {
|
|
70
|
+
if (!names) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return names.some((name) => path === name || !exact && path.startsWith(`${name}.`));
|
|
74
|
+
}
|
|
75
|
+
function fieldElementPathsFor(elements, values, fallbackToId = false) {
|
|
76
|
+
return walkNamedElements(elements, "", fallbackToId).flatMap(({ path, element, hasChildren, arrayItemDepth }) => {
|
|
77
|
+
const paths = arrayItemDepth ? expandArrayItemPaths(values, path, arrayItemDepth) : hasChildren ? expandContainerTemplatePaths(values, path) : expandFieldTemplatePaths(values, path);
|
|
78
|
+
return paths.map((fieldPath) => ({ element, fieldPath, hasChildren }));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function collectStepFieldPaths(step, values = {}) {
|
|
82
|
+
const paths = fieldElementPathsFor(step?.elements ?? [], values).map(({ fieldPath }) => fieldPath);
|
|
83
|
+
return [...new Set(paths)];
|
|
84
|
+
}
|
|
85
|
+
function effectiveRulesFor({
|
|
86
|
+
element,
|
|
87
|
+
fieldPath,
|
|
88
|
+
values,
|
|
89
|
+
registry,
|
|
90
|
+
inheritedRequired = false,
|
|
91
|
+
requiredByConstraint
|
|
92
|
+
}) {
|
|
93
|
+
const rules = getValidationRulesForElement(element, registry) ?? [];
|
|
94
|
+
const isRequired = isFieldRequired(rules) || inheritedRequired || (requiredByConstraint ?? evaluateConstraints({ constraints: element.constraints, values, fieldPath }).isRequired);
|
|
95
|
+
if (!isRequired || isFieldRequired(rules)) {
|
|
96
|
+
return [...rules];
|
|
97
|
+
}
|
|
98
|
+
const requiredRule = { $type: "required" };
|
|
99
|
+
return [requiredRule, ...rules];
|
|
100
|
+
}
|
|
101
|
+
var SUPERSEDED = /* @__PURE__ */ Symbol("superseded");
|
|
102
|
+
async function validateFieldValue({
|
|
103
|
+
element,
|
|
104
|
+
value,
|
|
105
|
+
values,
|
|
106
|
+
fieldPath,
|
|
107
|
+
registry,
|
|
108
|
+
debounceScope,
|
|
109
|
+
inheritedRequired,
|
|
110
|
+
requiredByConstraint
|
|
111
|
+
}) {
|
|
112
|
+
const rules = effectiveRulesFor({
|
|
113
|
+
element,
|
|
114
|
+
values,
|
|
115
|
+
fieldPath,
|
|
116
|
+
registry,
|
|
117
|
+
inheritedRequired,
|
|
118
|
+
requiredByConstraint
|
|
119
|
+
});
|
|
120
|
+
const context = createValidationContext({ values, fieldPath, debounceScope });
|
|
121
|
+
const results = await Promise.all(
|
|
122
|
+
rules.map(async (rule) => {
|
|
123
|
+
try {
|
|
124
|
+
const result = await z.safeParseAsync(createZodSchemaFromRules([rule], context, registry), value);
|
|
125
|
+
if (result.success) return void 0;
|
|
126
|
+
const params = registry.getRuleParams(rule);
|
|
127
|
+
const first = result.error.issues[0];
|
|
128
|
+
const reported = first?.code === "custom" ? first.params?.[REPORTED_TEXT] : void 0;
|
|
129
|
+
const message = registry.getRuleMessage(rule, typeof reported === "string" ? reported : void 0);
|
|
130
|
+
return Object.freeze({
|
|
131
|
+
type: rule.$type,
|
|
132
|
+
...rule.id === void 0 ? {} : { ruleId: rule.id },
|
|
133
|
+
...params === void 0 ? {} : { params: frozenCopy(params) },
|
|
134
|
+
...message ? { message } : {},
|
|
135
|
+
severity: rule.severity ?? "error"
|
|
136
|
+
});
|
|
137
|
+
} catch (cause) {
|
|
138
|
+
if (cause instanceof ValidationSuperseded) return SUPERSEDED;
|
|
139
|
+
return new FormValidationFailure(fieldPath, rule, cause);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
return {
|
|
144
|
+
issues: results.filter(
|
|
145
|
+
(found) => found !== void 0 && found !== SUPERSEDED && !(found instanceof Error)
|
|
146
|
+
),
|
|
147
|
+
failures: results.filter((found) => found instanceof FormValidationFailure),
|
|
148
|
+
superseded: results.includes(SUPERSEDED)
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
var isPathExcluded = (excluded, path) => excluded.some((around) => path === around || path.startsWith(`${around}.`));
|
|
152
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
153
|
+
var NO_FIELD = Object.freeze({ hidden: false, disabled: false, required: false });
|
|
154
|
+
function foldFieldParticipation(fields, path, { inheritRequired = true } = {}) {
|
|
155
|
+
const segments = path.split(".");
|
|
156
|
+
let hidden = false;
|
|
157
|
+
let disabled = false;
|
|
158
|
+
let required = false;
|
|
159
|
+
for (let depth = 1; depth <= segments.length; depth += 1) {
|
|
160
|
+
const at = Object.hasOwn(fields, segments.slice(0, depth).join(".")) ? fields[segments.slice(0, depth).join(".")] : void 0;
|
|
161
|
+
if (!at) continue;
|
|
162
|
+
hidden ||= at.hidden;
|
|
163
|
+
disabled ||= at.disabled;
|
|
164
|
+
if (depth === segments.length || inheritRequired) required ||= at.required;
|
|
165
|
+
}
|
|
166
|
+
return !hidden && !disabled && !required ? NO_FIELD : { hidden, disabled, required };
|
|
167
|
+
}
|
|
168
|
+
function resolveParticipation(steps, values, { shownStep } = {}) {
|
|
169
|
+
let visible = values;
|
|
170
|
+
const excluded = [];
|
|
171
|
+
const skippedSteps = [];
|
|
172
|
+
const fields = {};
|
|
173
|
+
const visibleBefore = /* @__PURE__ */ new Map();
|
|
174
|
+
const exclude = (path) => {
|
|
175
|
+
excluded.push(path);
|
|
176
|
+
const without = withoutValueAt(visible, path);
|
|
177
|
+
if (isRecord(without)) visible = without;
|
|
178
|
+
};
|
|
179
|
+
for (const step of steps) {
|
|
180
|
+
if (step.constraints?.length && step.id !== shownStep && !evaluateConstraints({ constraints: step.constraints, values: visible }).shouldShow) {
|
|
181
|
+
if (step.id !== void 0) skippedSteps.push(step.id);
|
|
182
|
+
for (const element of step.elements) {
|
|
183
|
+
const name = getElementName(element);
|
|
184
|
+
if (!name) continue;
|
|
185
|
+
fields[name] = { hidden: true, disabled: false, required: false };
|
|
186
|
+
visibleBefore.set(name, visible);
|
|
187
|
+
exclude(name);
|
|
188
|
+
}
|
|
189
|
+
for (const { fieldPath } of fieldElementPathsFor(step.elements, values, true)) {
|
|
190
|
+
fields[fieldPath] ??= { hidden: true, disabled: false, required: false };
|
|
191
|
+
}
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
for (const { element, fieldPath } of fieldElementPathsFor(step.elements, values, true)) {
|
|
195
|
+
const authored = element.disabled === true;
|
|
196
|
+
const root = excluded.find((around) => isPathExcluded([around], fieldPath));
|
|
197
|
+
if (root !== void 0) {
|
|
198
|
+
const before = visibleBefore.get(root) ?? visible;
|
|
199
|
+
const inside = element.constraints?.length ? evaluateConstraints({ constraints: element.constraints, values: before, fieldPath }) : void 0;
|
|
200
|
+
if (authored || inside) {
|
|
201
|
+
fields[fieldPath] = {
|
|
202
|
+
hidden: inside ? !inside.shouldShow : false,
|
|
203
|
+
disabled: authored || (inside?.shouldDisable ?? false),
|
|
204
|
+
required: inside?.isRequired ?? false
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (!authored && !element.constraints?.length) continue;
|
|
210
|
+
const { shouldShow, shouldDisable, isRequired } = evaluateConstraints({
|
|
211
|
+
constraints: element.constraints,
|
|
212
|
+
values: visible,
|
|
213
|
+
fieldPath
|
|
214
|
+
});
|
|
215
|
+
fields[fieldPath] = { hidden: !shouldShow, disabled: authored || shouldDisable, required: isRequired };
|
|
216
|
+
if (!shouldShow || authored || shouldDisable) {
|
|
217
|
+
visibleBefore.set(fieldPath, visible);
|
|
218
|
+
exclude(fieldPath);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return { excluded: [...new Set(excluded)], skippedSteps, fields };
|
|
223
|
+
}
|
|
224
|
+
function hasParticipationRules(steps) {
|
|
225
|
+
return steps.some(
|
|
226
|
+
(step) => Boolean(step.constraints?.length) || walkNamedElements(step.elements, "", true).some(
|
|
227
|
+
({ element }) => element.disabled === true || Boolean(element.constraints?.length)
|
|
228
|
+
)
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
function planFormValidation({
|
|
232
|
+
steps,
|
|
233
|
+
values,
|
|
234
|
+
names,
|
|
235
|
+
exactNames = false,
|
|
236
|
+
participation = resolveParticipation(steps, values)
|
|
237
|
+
}) {
|
|
238
|
+
const { excluded, fields: states } = participation;
|
|
239
|
+
const fields = steps.flatMap((step) => fieldElementPathsFor(step.elements, values)).filter(
|
|
240
|
+
({ fieldPath }) => pathIsRequested(fieldPath, names, exactNames) && !isPathExcluded(excluded, fieldPath)
|
|
241
|
+
).map((field) => ({
|
|
242
|
+
...field,
|
|
243
|
+
requiredByConstraint: foldFieldParticipation(states, field.fieldPath, { inheritRequired: false }).required,
|
|
244
|
+
inheritedRequired: !field.hasChildren && foldFieldParticipation(states, field.fieldPath.split(".").slice(0, -1).join(".")).required
|
|
245
|
+
}));
|
|
246
|
+
return { fields, values };
|
|
247
|
+
}
|
|
248
|
+
async function runValidationPlan(plan, { registry, debounceScope }) {
|
|
249
|
+
const results = await Promise.all(
|
|
250
|
+
plan.fields.map(async ({ element, fieldPath, inheritedRequired, requiredByConstraint }) => ({
|
|
251
|
+
fieldPath,
|
|
252
|
+
result: await validateFieldValue({
|
|
253
|
+
element,
|
|
254
|
+
value: getValueAtPath(plan.values, fieldPath),
|
|
255
|
+
values: plan.values,
|
|
256
|
+
fieldPath,
|
|
257
|
+
registry,
|
|
258
|
+
debounceScope,
|
|
259
|
+
inheritedRequired,
|
|
260
|
+
requiredByConstraint
|
|
261
|
+
})
|
|
262
|
+
}))
|
|
263
|
+
);
|
|
264
|
+
const issues = {};
|
|
265
|
+
const failures = {};
|
|
266
|
+
const superseded = [];
|
|
267
|
+
for (const { fieldPath, result } of results) {
|
|
268
|
+
if (result.issues.length > 0) issues[fieldPath] = result.issues;
|
|
269
|
+
if (result.failures.length > 0) failures[fieldPath] = result.failures;
|
|
270
|
+
if (result.superseded) superseded.push(fieldPath);
|
|
271
|
+
}
|
|
272
|
+
return { issues, failures, superseded };
|
|
273
|
+
}
|
|
274
|
+
async function validateFormValues(input) {
|
|
275
|
+
return runValidationPlan(planFormValidation(input), input);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export {
|
|
279
|
+
FormValidationFailure,
|
|
280
|
+
collectStepFieldPaths,
|
|
281
|
+
effectiveRulesFor,
|
|
282
|
+
validateFieldValue,
|
|
283
|
+
isPathExcluded,
|
|
284
|
+
foldFieldParticipation,
|
|
285
|
+
resolveParticipation,
|
|
286
|
+
hasParticipationRules,
|
|
287
|
+
planFormValidation,
|
|
288
|
+
runValidationPlan,
|
|
289
|
+
validateFormValues
|
|
290
|
+
};
|