@verbb/formie-browser 1.0.13 → 1.0.14
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/CHANGELOG.md +50 -0
- package/dist/chunks/{address-country-Rx6GQTND.js → address-country-Dn71jroa.js} +10 -4
- package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-O49uDRoR.js} +2 -2
- package/dist/chunks/{address-state-BwE01m2_.js → address-state-ByYatUur.js} +154 -143
- package/dist/chunks/{api-DqpfkZWL.js → api-D6kJ7kXZ.js} +183 -179
- package/dist/chunks/{api-BUb6P-xu.js → api-DYYsVIub.js} +77 -47
- package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
- package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-D0RKFM4F.js} +3 -3
- package/dist/chunks/calculations-YEoVCG2q.js +310 -0
- package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DERJbXnH.js} +5 -4
- package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
- package/dist/chunks/{combobox-C0EuExSI.js → combobox-CWNdx4Fk.js} +290 -279
- package/dist/chunks/conditions-DqNHLTbN.js +464 -0
- package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
- package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
- package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
- package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
- package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
- package/dist/chunks/{date-picker-F9BUBDSW.js → date-picker-RUnevF7l.js} +455 -432
- package/dist/chunks/{dist-D6i-VNgM.js → dist-ZLeW0zZ3.js} +1281 -453
- package/dist/chunks/{eway-D9_m8ooj.js → eway-or6dtjoT.js} +3 -3
- package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
- package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-Bm-TXyNB.js} +104 -96
- package/dist/chunks/friendly-captcha-v1-GFqCt1Mh.js +34 -0
- package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-WoW246JG.js} +6 -5
- package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
- package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-DzJ-0FKg.js} +2 -2
- package/dist/chunks/google-address-C1P1nTDM.js +163 -0
- package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-D0T8aIHz.js} +3 -3
- package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
- package/dist/chunks/http-C2QdHuWO.js +27 -0
- package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
- package/dist/chunks/{loqate-CJPzBmSm.js → loqate-DD1S7PY9.js} +2 -2
- package/dist/chunks/{mollie-Bibhl67p.js → mollie-DG8Ju83x.js} +2 -2
- package/dist/chunks/{moneris-H2wSqk9h.js → moneris-C8m3Fvqu.js} +3 -3
- package/dist/chunks/opayo-B3EvrVxw.js +188 -0
- package/dist/chunks/{paddle-DkvIxQdG.js → paddle-BIYR9Um3.js} +3 -3
- package/dist/chunks/{password-validation-D06uH9va.js → password-validation-C8_uO_c_.js} +18 -12
- package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-B_yxIo2d.js} +7 -5
- package/dist/chunks/{payway-CwDkC7YZ.js → payway-CeOzS0sL.js} +3 -3
- package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-bAqje17P.js} +80 -63
- package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BE5gi3vo.js} +3 -3
- package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
- package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CruXddZq.js} +4 -4
- package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-AQRMDMme.js} +1 -1
- package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-CCnJYCnG.js} +4 -4
- package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-BuVqRRYn.js} +4 -4
- package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CloqhO2A.js} +4 -4
- package/dist/chunks/{repeater-BVnPUqTj.js → repeater-DwE27jI1.js} +25 -19
- package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
- package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
- package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
- package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
- package/dist/chunks/{signature-IOhuicje.js → signature-7cldFbqj.js} +138 -112
- package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C04kNGYQ.js} +2 -2
- package/dist/chunks/{square-DwdcOI1G.js → square-DEzxv9D9.js} +8 -6
- package/dist/chunks/{stripe-DaoG2FT1.js → stripe-CVPQGDz3.js} +10 -11
- package/dist/chunks/{summary-Dks0gXS3.js → summary-BF_8mrXI.js} +47 -45
- package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
- package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
- package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
- package/dist/chunks/{table-CAjCJHrL.js → table-DnIBdeKF.js} +21 -15
- package/dist/chunks/{text-limit-BGaY0jhI.js → text-limit-LGMPhFuC.js} +40 -34
- package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
- package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-n9DNyPxi.js} +3 -3
- package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BbiUosZq.js} +410 -350
- package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
- package/dist/css/formie-base.css +104 -1
- package/dist/css/theme/_messages.css +2 -0
- package/dist/css/theme/_tokens.css +31 -25
- package/dist/css/theme/forms/_form.css +5 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1778 -1427
- package/dist/js/contracts/client.d.ts +5 -3
- package/dist/js/contracts/client.d.ts.map +1 -1
- package/dist/js/contracts/common.d.ts +2 -2
- package/dist/js/contracts/common.d.ts.map +1 -1
- package/dist/js/contracts/modules.d.ts +37 -12
- package/dist/js/contracts/modules.d.ts.map +1 -1
- package/dist/js/contracts/schema.d.ts +20 -38
- package/dist/js/contracts/schema.d.ts.map +1 -1
- package/dist/js/contracts/theme.d.ts +4 -1
- package/dist/js/contracts/theme.d.ts.map +1 -1
- package/dist/js/core/client-rendered-modules.d.ts +17 -0
- package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/field-error-aria.d.ts +23 -0
- package/dist/js/core/field-error-aria.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +10 -8
- package/dist/js/core/hydrate-modules.d.ts.map +1 -1
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/core/validation-focus.d.ts.map +1 -1
- package/dist/js/modules/address/address-finder.d.ts +1 -1
- package/dist/js/modules/address/address-finder.d.ts.map +1 -1
- package/dist/js/modules/address/factories.d.ts +3 -3
- package/dist/js/modules/address/factories.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +2 -1
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/index.d.ts +2 -2
- package/dist/js/modules/address/index.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts +11 -11
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/index.d.ts +2 -2
- package/dist/js/modules/captchas/index.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +2 -2
- package/dist/js/modules/fields/address-country.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts +2 -2
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/calculations.d.ts +2 -2
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +2 -2
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
- package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +3 -1
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts +2 -2
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-link.d.ts +2 -2
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts +2 -2
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts +2 -2
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/hidden.d.ts +2 -2
- package/dist/js/modules/fields/hidden.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts +2 -2
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/password-validation.d.ts +2 -2
- package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts +2 -2
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts +2 -2
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/rich-text.d.ts +2 -2
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
- package/dist/js/modules/fields/shared.d.ts +1 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts +2 -2
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts +2 -2
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-likert.d.ts +2 -2
- package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rank.d.ts +2 -2
- package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rating.d.ts +2 -2
- package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
- package/dist/js/modules/fields/table.d.ts +2 -2
- package/dist/js/modules/fields/table.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts +2 -2
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +2 -2
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/modules/loader.d.ts +10 -4
- package/dist/js/modules/loader.d.ts.map +1 -1
- package/dist/js/modules/payments/bpoint.d.ts +1 -1
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
- package/dist/js/modules/payments/eway.d.ts +1 -1
- package/dist/js/modules/payments/eway.d.ts.map +1 -1
- package/dist/js/modules/payments/factories.d.ts +7 -7
- package/dist/js/modules/payments/factories.d.ts.map +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
- package/dist/js/modules/payments/index.d.ts +2 -2
- package/dist/js/modules/payments/index.d.ts.map +1 -1
- package/dist/js/modules/payments/mollie.d.ts +1 -1
- package/dist/js/modules/payments/mollie.d.ts.map +1 -1
- package/dist/js/modules/payments/moneris.d.ts +1 -1
- package/dist/js/modules/payments/moneris.d.ts.map +1 -1
- package/dist/js/modules/payments/opayo.d.ts +1 -1
- package/dist/js/modules/payments/opayo.d.ts.map +1 -1
- package/dist/js/modules/payments/paddle.d.ts +1 -1
- package/dist/js/modules/payments/paddle.d.ts.map +1 -1
- package/dist/js/modules/payments/paypal.d.ts +1 -1
- package/dist/js/modules/payments/paypal.d.ts.map +1 -1
- package/dist/js/modules/payments/payway.d.ts +1 -1
- package/dist/js/modules/payments/payway.d.ts.map +1 -1
- package/dist/js/modules/payments/square.d.ts +1 -1
- package/dist/js/modules/payments/square.d.ts.map +1 -1
- package/dist/js/modules/payments/stripe.d.ts +1 -1
- package/dist/js/modules/payments/stripe.d.ts.map +1 -1
- package/dist/js/modules/payments/utils.d.ts +6 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -1
- package/dist/js/modules/registry.d.ts +6 -4
- package/dist/js/modules/registry.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
- package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +3 -3
- package/dist/js/theme/theme-classes.d.ts.map +1 -1
- package/dist/js/transport/forms-api.d.ts +5 -3
- package/dist/js/transport/forms-api.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +2 -2
- package/dist/js/utils/country-from-ip.d.ts.map +1 -1
- package/dist/js/utils/csrf.d.ts +17 -0
- package/dist/js/utils/csrf.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +1 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -1
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
- package/dist/js/utils/field-references.types.d.ts +1 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -1
- package/dist/js/utils/http.d.ts +3 -1
- package/dist/js/utils/http.d.ts.map +1 -1
- package/dist/js/utils/request-profile.d.ts +4 -0
- package/dist/js/utils/request-profile.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/rules/email.d.ts.map +1 -1
- package/dist/js/validation/rules/match.d.ts.map +1 -1
- package/dist/js/validation/rules/number.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/rules/shared.d.ts.map +1 -1
- package/dist/js/validation/rules/url.d.ts.map +1 -1
- package/dist/js/validation/skip.d.ts +7 -0
- package/dist/js/validation/skip.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +43 -12
- package/src/css/formie-base.css +104 -1
- package/src/css/theme/_messages.css +2 -0
- package/src/css/theme/_tokens.css +31 -25
- package/src/css/theme/forms/_form.css +5 -1
- package/src/index.ts +13 -8
- package/src/js/contracts/client.ts +5 -3
- package/src/js/contracts/common.ts +5 -6
- package/src/js/contracts/modules.ts +41 -12
- package/src/js/contracts/schema.ts +21 -43
- package/src/js/contracts/theme.ts +6 -1
- package/src/js/core/client-rendered-modules.ts +69 -0
- package/src/js/core/create-formie-client.ts +116 -77
- package/src/js/core/field-error-aria.ts +93 -0
- package/src/js/core/hydrate-modules.ts +54 -29
- package/src/js/core/submit-result-state.ts +34 -45
- package/src/js/core/submit-result-ui.ts +21 -65
- package/src/js/core/validation-focus.ts +20 -20
- package/src/js/modules/address/address-finder.ts +1 -1
- package/src/js/modules/address/factories.ts +15 -13
- package/src/js/modules/address/google-address.ts +10 -6
- package/src/js/modules/address/index.ts +2 -2
- package/src/js/modules/address/loqate.ts +1 -1
- package/src/js/modules/address/place-kit.ts +1 -1
- package/src/js/modules/captchas/captcha-eu.ts +2 -2
- package/src/js/modules/captchas/factories.ts +66 -42
- package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
- package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
- package/src/js/modules/captchas/hcaptcha.ts +5 -5
- package/src/js/modules/captchas/index.ts +2 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
- package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
- package/src/js/modules/captchas/snaptcha.ts +1 -1
- package/src/js/modules/captchas/turnstile.ts +3 -3
- package/src/js/modules/fields/address-country.ts +6 -4
- package/src/js/modules/fields/address-state.ts +20 -12
- package/src/js/modules/fields/calculations.ts +5 -3
- package/src/js/modules/fields/checkbox-radio.ts +24 -42
- package/src/js/modules/fields/combobox.ts +25 -9
- package/src/js/modules/fields/conditions/config.ts +17 -20
- package/src/js/modules/fields/conditions/effects.ts +23 -26
- package/src/js/modules/fields/conditions/evaluator.ts +21 -29
- package/src/js/modules/fields/conditions/references.ts +16 -5
- package/src/js/modules/fields/conditions/submission-context.ts +80 -0
- package/src/js/modules/fields/conditions/types.ts +3 -1
- package/src/js/modules/fields/conditions/values.ts +31 -6
- package/src/js/modules/fields/conditions.ts +59 -18
- package/src/js/modules/fields/custom-google-maps.ts +5 -3
- package/src/js/modules/fields/custom-link.ts +5 -3
- package/src/js/modules/fields/custom-maps.ts +5 -3
- package/src/js/modules/fields/date-picker.ts +34 -4
- package/src/js/modules/fields/file-upload.ts +19 -10
- package/src/js/modules/fields/hidden.ts +5 -3
- package/src/js/modules/fields/index.ts +2 -2
- package/src/js/modules/fields/password-validation.ts +5 -3
- package/src/js/modules/fields/phone-country.ts +33 -6
- package/src/js/modules/fields/repeater.ts +5 -3
- package/src/js/modules/fields/rich-text.ts +20 -4
- package/src/js/modules/fields/shared.ts +13 -0
- package/src/js/modules/fields/signature.ts +24 -4
- package/src/js/modules/fields/summary.ts +8 -20
- package/src/js/modules/fields/survey-likert.ts +5 -3
- package/src/js/modules/fields/survey-rank.ts +21 -3
- package/src/js/modules/fields/survey-rating.ts +17 -3
- package/src/js/modules/fields/table.ts +5 -3
- package/src/js/modules/fields/text-limit.ts +5 -3
- package/src/js/modules/fields/upload-manager.ts +190 -49
- package/src/js/modules/loader.ts +345 -281
- package/src/js/modules/payments/bpoint.ts +2 -2
- package/src/js/modules/payments/eway.ts +2 -2
- package/src/js/modules/payments/factories.ts +53 -52
- package/src/js/modules/payments/go-cardless.ts +1 -1
- package/src/js/modules/payments/index.ts +2 -2
- package/src/js/modules/payments/mollie.ts +1 -1
- package/src/js/modules/payments/moneris.ts +2 -2
- package/src/js/modules/payments/opayo.ts +21 -8
- package/src/js/modules/payments/paddle.ts +10 -6
- package/src/js/modules/payments/payment.ts +22 -18
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +2 -2
- package/src/js/modules/payments/square.ts +2 -2
- package/src/js/modules/payments/stripe.ts +5 -5
- package/src/js/modules/payments/utils.ts +14 -0
- package/src/js/modules/registry.ts +19 -11
- package/src/js/submit/pipeline.ts +10 -11
- package/src/js/theme/browser-theme-state.generated.ts +25 -0
- package/src/js/theme/theme-classes.ts +3 -3
- package/src/js/transport/forms-api.ts +66 -67
- package/src/js/utils/country-from-ip.ts +14 -9
- package/src/js/utils/csrf.ts +136 -0
- package/src/js/utils/field-references.parser.ts +13 -113
- package/src/js/utils/field-references.resolver.ts +27 -64
- package/src/js/utils/field-references.row-scope.ts +1 -1
- package/src/js/utils/field-references.types.ts +1 -0
- package/src/js/utils/http.ts +5 -5
- package/src/js/utils/request-profile.ts +10 -0
- package/src/js/utils/unload-warning.ts +12 -4
- package/src/js/validation/rules/email.ts +3 -5
- package/src/js/validation/rules/match.ts +2 -1
- package/src/js/validation/rules/minmax.ts +4 -43
- package/src/js/validation/rules/number.ts +3 -47
- package/src/js/validation/rules/pattern.ts +3 -8
- package/src/js/validation/rules/required.ts +2 -1
- package/src/js/validation/rules/shared.ts +5 -1
- package/src/js/validation/rules/url.ts +3 -10
- package/src/js/validation/skip.ts +9 -0
- package/src/js/validation/submit-readiness.ts +9 -2
- package/src/js/validation/validator.ts +35 -59
- package/dist/chunks/calculations-Dv3hYb8_.js +0 -299
- package/dist/chunks/conditions-CPH1snCx.js +0 -424
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
- package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
- package/dist/chunks/google-address-BH3Zhi06.js +0 -161
- package/dist/chunks/http-D-JExro7.js +0 -27
- package/dist/chunks/opayo-CR0DtsLa.js +0 -179
- package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
- package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
- package/src/js/modules/fields/conditions/transforms.ts +0 -206
- package/src/js/modules/payments/stub-payment-module.ts +0 -87
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verbb/formie-browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -28,19 +28,49 @@
|
|
|
28
28
|
"**/*.css"
|
|
29
29
|
],
|
|
30
30
|
"imports": {
|
|
31
|
-
"#theme/*":
|
|
31
|
+
"#theme/*": {
|
|
32
|
+
"types": "./dist/js/theme/*.d.ts",
|
|
33
|
+
"default": "./src/js/theme/*"
|
|
34
|
+
},
|
|
32
35
|
"#theme-css/*": "./src/css/theme/*",
|
|
33
36
|
"#theme-base/*": "./src/css/theme-base/*",
|
|
34
37
|
"#icons/*": "./src/icons/*",
|
|
35
|
-
"#contracts/*":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"#
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"#
|
|
38
|
+
"#contracts/*": {
|
|
39
|
+
"types": "./dist/js/contracts/*.d.ts",
|
|
40
|
+
"default": "./src/js/contracts/*"
|
|
41
|
+
},
|
|
42
|
+
"#compatibility/*": {
|
|
43
|
+
"types": "./dist/js/compatibility/*.d.ts",
|
|
44
|
+
"default": "./src/js/compatibility/*"
|
|
45
|
+
},
|
|
46
|
+
"#core/*": {
|
|
47
|
+
"types": "./dist/js/core/*.d.ts",
|
|
48
|
+
"default": "./src/js/core/*"
|
|
49
|
+
},
|
|
50
|
+
"#events/*": {
|
|
51
|
+
"types": "./dist/js/events/*.d.ts",
|
|
52
|
+
"default": "./src/js/events/*"
|
|
53
|
+
},
|
|
54
|
+
"#modules/*": {
|
|
55
|
+
"types": "./dist/js/modules/*.d.ts",
|
|
56
|
+
"default": "./src/js/modules/*"
|
|
57
|
+
},
|
|
58
|
+
"#submit/*": {
|
|
59
|
+
"types": "./dist/js/submit/*.d.ts",
|
|
60
|
+
"default": "./src/js/submit/*"
|
|
61
|
+
},
|
|
62
|
+
"#transport/*": {
|
|
63
|
+
"types": "./dist/js/transport/*.d.ts",
|
|
64
|
+
"default": "./src/js/transport/*"
|
|
65
|
+
},
|
|
66
|
+
"#utils/*": {
|
|
67
|
+
"types": "./dist/js/utils/*.d.ts",
|
|
68
|
+
"default": "./src/js/utils/*"
|
|
69
|
+
},
|
|
70
|
+
"#validation/*": {
|
|
71
|
+
"types": "./dist/js/validation/*.d.ts",
|
|
72
|
+
"default": "./src/js/validation/*"
|
|
73
|
+
}
|
|
44
74
|
},
|
|
45
75
|
"exports": {
|
|
46
76
|
".": {
|
|
@@ -57,6 +87,7 @@
|
|
|
57
87
|
"access": "public"
|
|
58
88
|
},
|
|
59
89
|
"scripts": {
|
|
90
|
+
"prebuild": "node ../../scripts/generate-browser-theme-state.mjs",
|
|
60
91
|
"dev": "vite build --watch",
|
|
61
92
|
"build": "vite build && tsc -p tsconfig.json"
|
|
62
93
|
},
|
|
@@ -70,7 +101,7 @@
|
|
|
70
101
|
"@placekit/autocomplete-js": "^2.2.1",
|
|
71
102
|
"@uppy/core": "^5.2.0",
|
|
72
103
|
"@uppy/xhr-upload": "^5.2.0",
|
|
73
|
-
"@verbb/formie-core": "1.0.
|
|
104
|
+
"@verbb/formie-core": "1.0.14",
|
|
74
105
|
"expression-language": "^2.5.4",
|
|
75
106
|
"flatpickr": "^4.6.13",
|
|
76
107
|
"friendly-challenge": "^0.9.19",
|
package/src/css/formie-base.css
CHANGED
|
@@ -75,4 +75,107 @@
|
|
|
75
75
|
[hidden] {
|
|
76
76
|
display: none !important;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
|
|
79
|
+
.formie-module-error--fallback {
|
|
80
|
+
margin-block: 0 1.5rem;
|
|
81
|
+
padding: 1rem;
|
|
82
|
+
border: 1px solid #f3a6a6;
|
|
83
|
+
border-inline-start: 4px solid #c92a2a;
|
|
84
|
+
border-radius: 0.375rem;
|
|
85
|
+
background: #fff5f5;
|
|
86
|
+
color: #5f2120;
|
|
87
|
+
font: 0.875rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.formie-module-error--fallback .formie-module-error__notice {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: flex-start;
|
|
93
|
+
gap: 0.75rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.formie-module-error--fallback .formie-module-error__indicator {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
flex: 0 0 auto;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
width: 1.5rem;
|
|
102
|
+
height: 1.5rem;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
background: #c92a2a;
|
|
105
|
+
color: #fff;
|
|
106
|
+
font-weight: 700;
|
|
107
|
+
line-height: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.formie-module-error--fallback .formie-module-error__content {
|
|
111
|
+
min-width: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.formie-module-error--fallback .formie-module-error__title {
|
|
115
|
+
display: block;
|
|
116
|
+
margin-block-end: 0.125rem;
|
|
117
|
+
color: #842029;
|
|
118
|
+
font-size: 0.9375rem;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.formie-module-error--fallback .formie-module-error__details {
|
|
122
|
+
margin-block-start: 0.875rem;
|
|
123
|
+
padding-block-start: 0.75rem;
|
|
124
|
+
border-block-start: 1px solid #f3c2c2;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.formie-module-error--fallback .formie-module-error__details > summary {
|
|
128
|
+
width: fit-content;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.formie-module-error--fallback .formie-module-error__details > pre {
|
|
134
|
+
max-height: 16rem;
|
|
135
|
+
margin-block: 0.75rem;
|
|
136
|
+
padding: 0.75rem;
|
|
137
|
+
overflow: auto;
|
|
138
|
+
border: 1px solid #ead0d0;
|
|
139
|
+
border-radius: 0.25rem;
|
|
140
|
+
background: #fff;
|
|
141
|
+
color: #3f2929;
|
|
142
|
+
font: 0.75rem/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
|
|
143
|
+
overflow-wrap: anywhere;
|
|
144
|
+
user-select: text;
|
|
145
|
+
white-space: pre-wrap;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.formie-module-error--fallback .formie-module-error__actions {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-wrap: wrap;
|
|
151
|
+
align-items: center;
|
|
152
|
+
gap: 0.75rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.formie-module-error--fallback .formie-module-error__copy {
|
|
156
|
+
padding: 0.375rem 0.625rem;
|
|
157
|
+
border: 1px solid #bd6464;
|
|
158
|
+
border-radius: 0.25rem;
|
|
159
|
+
background: #fff;
|
|
160
|
+
color: #6f1d1d;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
font: inherit;
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.formie-module-error--fallback .formie-module-error__copy:hover {
|
|
167
|
+
background: #fffafa;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.formie-module-error--fallback .formie-module-error__details > summary:focus-visible,
|
|
171
|
+
.formie-module-error--fallback .formie-module-error__copy:focus-visible,
|
|
172
|
+
.formie-module-error--fallback .formie-module-error__details > pre:focus-visible {
|
|
173
|
+
outline: 2px solid #7f1d1d;
|
|
174
|
+
outline-offset: 2px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.formie-module-error--fallback .formie-module-error__copy-status {
|
|
178
|
+
color: #6f1d1d;
|
|
179
|
+
font-size: 0.8125rem;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.formie-message-error {
|
|
27
|
+
border: var(--formie-border-width) solid var(--formie-color-danger-border);
|
|
27
28
|
background: var(--formie-color-danger-soft);
|
|
28
29
|
color: var(--formie-color-danger-dark);
|
|
29
30
|
}
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.formie-message-success {
|
|
37
|
+
border: var(--formie-border-width) solid var(--formie-color-success-border);
|
|
36
38
|
background: var(--formie-color-success-soft);
|
|
37
39
|
color: var(--formie-color-success-dark);
|
|
38
40
|
}
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
--formie-black: #000000;
|
|
48
48
|
--formie-white: #ffffff;
|
|
49
49
|
|
|
50
|
+
/* Matches Tailwind CSS's Slate color palette, with a custom 450 accessibility step. */
|
|
50
51
|
--formie-neutral-50: #f8fafc;
|
|
51
52
|
--formie-neutral-100: #f1f5f9;
|
|
52
53
|
--formie-neutral-200: #e2e8f0;
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
--formie-neutral-900: #0f172a;
|
|
62
63
|
--formie-neutral-950: #020617;
|
|
63
64
|
|
|
65
|
+
/* Custom tonal scale based on #1c41e3. */
|
|
64
66
|
--formie-primary-50: #e8ecfc;
|
|
65
67
|
--formie-primary-100: #d2d9f9;
|
|
66
68
|
--formie-primary-200: #a4b3f4;
|
|
@@ -73,29 +75,31 @@
|
|
|
73
75
|
--formie-primary-900: #060d2d;
|
|
74
76
|
--formie-primary-950: #040920;
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
--formie-danger-
|
|
78
|
-
--formie-danger-
|
|
79
|
-
--formie-danger-
|
|
80
|
-
--formie-danger-
|
|
81
|
-
--formie-danger-
|
|
82
|
-
--formie-danger-
|
|
83
|
-
--formie-danger-
|
|
84
|
-
--formie-danger-
|
|
85
|
-
--formie-danger-
|
|
86
|
-
--formie-danger-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
--formie-success-
|
|
91
|
-
--formie-success-
|
|
92
|
-
--formie-success-
|
|
93
|
-
--formie-success-
|
|
94
|
-
--formie-success-
|
|
95
|
-
--formie-success-
|
|
96
|
-
--formie-success-
|
|
97
|
-
--formie-success-
|
|
98
|
-
--formie-success-
|
|
78
|
+
/* Matches Tailwind CSS's Rose color palette. */
|
|
79
|
+
--formie-danger-50: #fff1f2;
|
|
80
|
+
--formie-danger-100: #ffe4e6;
|
|
81
|
+
--formie-danger-200: #fecdd3;
|
|
82
|
+
--formie-danger-300: #fda4af;
|
|
83
|
+
--formie-danger-400: #fb7185;
|
|
84
|
+
--formie-danger-500: #f43f5e;
|
|
85
|
+
--formie-danger-600: #e11d48;
|
|
86
|
+
--formie-danger-700: #be123c;
|
|
87
|
+
--formie-danger-800: #9f1239;
|
|
88
|
+
--formie-danger-900: #881337;
|
|
89
|
+
--formie-danger-950: #4c0519;
|
|
90
|
+
|
|
91
|
+
/* Matches Tailwind CSS's Emerald color palette. */
|
|
92
|
+
--formie-success-50: #ecfdf5;
|
|
93
|
+
--formie-success-100: #d1fae5;
|
|
94
|
+
--formie-success-200: #a7f3d0;
|
|
95
|
+
--formie-success-300: #6ee7b7;
|
|
96
|
+
--formie-success-400: #34d399;
|
|
97
|
+
--formie-success-500: #10b981;
|
|
98
|
+
--formie-success-600: #059669;
|
|
99
|
+
--formie-success-700: #047857;
|
|
100
|
+
--formie-success-800: #065f46;
|
|
101
|
+
--formie-success-900: #064e3b;
|
|
102
|
+
--formie-success-950: #022c22;
|
|
99
103
|
|
|
100
104
|
/* Semantic color aliases */
|
|
101
105
|
--formie-color-background: var(--formie-white);
|
|
@@ -116,16 +120,18 @@
|
|
|
116
120
|
--formie-color-primary-soft: var(--formie-primary-100);
|
|
117
121
|
--formie-color-focus-ring: var(--formie-primary-300);
|
|
118
122
|
--formie-color-danger: var(--formie-danger-600);
|
|
123
|
+
--formie-color-danger-border: var(--formie-danger-200);
|
|
119
124
|
--formie-color-danger-soft: var(--formie-danger-50);
|
|
120
125
|
--formie-color-danger-dark: var(--formie-danger-900);
|
|
121
126
|
--formie-color-success: var(--formie-success-500);
|
|
127
|
+
--formie-color-success-border: var(--formie-success-200);
|
|
122
128
|
--formie-color-success-soft: var(--formie-success-50);
|
|
123
129
|
--formie-color-success-dark: var(--formie-success-900);
|
|
124
130
|
--formie-color-button-text: var(--formie-color-surface);
|
|
125
131
|
|
|
126
132
|
--formie-focus-ring-border-color: var(--formie-color-focus-ring);
|
|
127
133
|
--formie-shadow-focus: 0 0 0 3px rgba(119, 141, 238, 0.45);
|
|
128
|
-
--formie-shadow-danger-focus: 0 0 0 3px rgba(
|
|
134
|
+
--formie-shadow-danger-focus: 0 0 0 3px rgba(253, 164, 175, 0.45);
|
|
129
135
|
|
|
130
136
|
/* Form */
|
|
131
137
|
--formie-title-form-size: 1.4rem;
|
|
@@ -365,4 +371,4 @@
|
|
|
365
371
|
-webkit-font-smoothing: antialiased;
|
|
366
372
|
-moz-osx-font-smoothing: grayscale;
|
|
367
373
|
}
|
|
368
|
-
}
|
|
374
|
+
}
|
|
@@ -146,6 +146,10 @@
|
|
|
146
146
|
gap: var(--formie-gap-field-errors);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
.formie-field-errors:empty {
|
|
150
|
+
position: absolute;
|
|
151
|
+
}
|
|
152
|
+
|
|
149
153
|
.formie-page-tabs {
|
|
150
154
|
display: flex;
|
|
151
155
|
flex-wrap: wrap;
|
|
@@ -191,4 +195,4 @@
|
|
|
191
195
|
.formie-tab-error.formie-tab-current .formie-tab-link:hover {
|
|
192
196
|
color: var(--formie-color-danger);
|
|
193
197
|
}
|
|
194
|
-
}
|
|
198
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createFormieClient } from '#core/create-formie-client';
|
|
2
2
|
export { hydrateFormieModules } from '#core/hydrate-modules';
|
|
3
3
|
export { formie } from '#core/formie';
|
|
4
|
-
export { ModuleRegistry } from '#modules/registry';
|
|
4
|
+
export { ModuleRegistry, clientRenderedModuleRegistry } from '#modules/registry';
|
|
5
5
|
export { FormieValidator } from '#validation/validator';
|
|
6
6
|
export { bindLegacyDomEventCompatibility } from '#compatibility/dom-adapter';
|
|
7
7
|
export { bindLegacyValidatorCompatibility } from '#compatibility/validator-adapter';
|
|
@@ -85,8 +85,12 @@ export type {
|
|
|
85
85
|
} from '#compatibility/event-map';
|
|
86
86
|
export type { FormAction, FormMode, FormTransport, SubmitStage } from '#contracts/common';
|
|
87
87
|
export type {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
BrowserModuleDefinition,
|
|
89
|
+
BrowserModuleInstance,
|
|
90
|
+
BrowserModuleFailure,
|
|
91
|
+
BrowserModuleHydrationReport,
|
|
92
|
+
AfterSubmitContext,
|
|
93
|
+
BeforeSubmitContext,
|
|
90
94
|
ModuleHookContext,
|
|
91
95
|
ModuleMatchContext,
|
|
92
96
|
ModuleRegistrationOptions,
|
|
@@ -95,17 +99,16 @@ export type {
|
|
|
95
99
|
} from '#contracts/modules';
|
|
96
100
|
export type {
|
|
97
101
|
FormRefreshTokensPayload,
|
|
98
|
-
FormDefinitionField,
|
|
99
|
-
FormDefinitionPage,
|
|
100
|
-
FormDefinitionPayload,
|
|
101
102
|
FormEndpointPayload,
|
|
102
|
-
|
|
103
|
+
BrowserModuleEntry,
|
|
104
|
+
BrowserModuleKind,
|
|
105
|
+
BrowserModuleManifest,
|
|
103
106
|
FormModuleTarget,
|
|
104
107
|
FormModuleTargetType,
|
|
105
108
|
FormRedirect,
|
|
106
109
|
FormSubmitResult,
|
|
107
110
|
} from '#contracts/schema';
|
|
108
|
-
export type { ThemeClassMap } from '#contracts/theme';
|
|
111
|
+
export type { BrowserThemeClassMap, ThemeClassMap } from '#contracts/theme';
|
|
109
112
|
export type {
|
|
110
113
|
ValidationConfig,
|
|
111
114
|
ValidationContext,
|
|
@@ -123,3 +126,5 @@ export type {
|
|
|
123
126
|
ParsedFieldReference,
|
|
124
127
|
ResolveFieldValueResult,
|
|
125
128
|
} from '#utils/field-references';
|
|
129
|
+
|
|
130
|
+
export { mountClientRenderedModules } from '#core/client-rendered-modules';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { LegacyCompatibilityOptions } from '#compatibility/event-map';
|
|
2
2
|
import type { FormAction, FormMode, FormTransport } from '#contracts/common';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BrowserModuleDefinition, ModuleRegistrationOptions } from '#contracts/modules';
|
|
4
4
|
import type { FormEndpointPayload, FormSubmitResult } from '#contracts/schema';
|
|
5
5
|
|
|
6
6
|
export type FormMountOptions = {
|
|
7
7
|
mode: FormMode;
|
|
8
|
+
/** REST/GraphQL select the HTML source; submission always uses the normal form endpoint. */
|
|
8
9
|
transport?: FormTransport;
|
|
10
|
+
profile?: import('@verbb/formie-core').BrowserRequestOptions['profile'];
|
|
9
11
|
formHandle?: string;
|
|
10
12
|
endpoint?: string;
|
|
11
13
|
payload?: FormEndpointPayload;
|
|
@@ -35,9 +37,9 @@ export type FormieClient = {
|
|
|
35
37
|
update: (target: Element, options: Partial<FormMountOptions>) => Promise<FormieFormInstance>;
|
|
36
38
|
getInstance: (target: Element) => FormieFormInstance | null;
|
|
37
39
|
refreshForCache: (targetOrId: Element | string) => Promise<void>;
|
|
38
|
-
registerModule: (moduleDefinition:
|
|
40
|
+
registerModule: (moduleDefinition: BrowserModuleDefinition, options?: ModuleRegistrationOptions) => boolean;
|
|
39
41
|
unregisterModule: (moduleId: string) => void;
|
|
40
|
-
getRegisteredModules: () =>
|
|
42
|
+
getRegisteredModules: () => BrowserModuleDefinition[];
|
|
41
43
|
scan: (root?: ParentNode) => Promise<FormieFormInstance[]>;
|
|
42
44
|
observe: (root?: ParentNode) => () => void;
|
|
43
45
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export type FormAction = 'submit' | 'back' | 'save';
|
|
2
2
|
|
|
3
|
-
export type FormMode = 'server-rendered'
|
|
3
|
+
export type FormMode = 'server-rendered';
|
|
4
4
|
|
|
5
5
|
export type FormTransport = 'rest' | 'graphql';
|
|
6
6
|
|
|
7
7
|
export type SubmitStage =
|
|
8
8
|
| 'prepare'
|
|
9
|
-
| 'normalize'
|
|
10
9
|
| 'validate'
|
|
11
|
-
| '
|
|
12
|
-
| '
|
|
13
|
-
| '
|
|
14
|
-
| '
|
|
10
|
+
| 'challenge'
|
|
11
|
+
| 'payment'
|
|
12
|
+
| 'send'
|
|
13
|
+
| 'result';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { FormAction
|
|
2
|
-
import type {
|
|
1
|
+
import type { FormAction } from '#contracts/common';
|
|
2
|
+
import type { BrowserModuleEntry, FormModuleTargetType, FormSubmitResult } from '#contracts/schema';
|
|
3
|
+
import type { BrowserModuleKind, BrowserSurface } from '@verbb/formie-core';
|
|
3
4
|
|
|
4
5
|
export type ModuleMatchContext = {
|
|
5
6
|
root: Element;
|
|
6
7
|
form: HTMLFormElement | null;
|
|
7
8
|
target: Element;
|
|
8
9
|
scope: FormModuleTargetType;
|
|
9
|
-
|
|
10
|
-
manifestItem:
|
|
10
|
+
surface: BrowserSurface;
|
|
11
|
+
manifestItem: BrowserModuleEntry;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type ModuleHookContext = {
|
|
@@ -20,6 +21,8 @@ export type ModuleHookContext = {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export type ModuleSetupContext = ModuleHookContext & {
|
|
24
|
+
entryKey?: string;
|
|
25
|
+
surface: BrowserSurface;
|
|
23
26
|
options?: Record<string, unknown>;
|
|
24
27
|
on: (eventName: string, callback: (payload: unknown) => void) => () => void;
|
|
25
28
|
emit: (eventName: string, payload?: unknown) => Promise<void>;
|
|
@@ -31,23 +34,49 @@ export type ModuleRegistrationOptions = {
|
|
|
31
34
|
|
|
32
35
|
export type SubmitHookContext = {
|
|
33
36
|
form: HTMLFormElement;
|
|
34
|
-
stage: SubmitStage;
|
|
35
37
|
action: FormAction;
|
|
36
38
|
formData: FormData;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type BeforeSubmitContext = SubmitHookContext & {
|
|
37
42
|
abort: (reason?: string) => void;
|
|
38
43
|
isAborted: () => boolean;
|
|
39
44
|
abortReason: () => string | undefined;
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
export type
|
|
47
|
+
export type AfterSubmitContext = SubmitHookContext;
|
|
48
|
+
|
|
49
|
+
export type BrowserModuleInstance = {
|
|
50
|
+
assertReady?: () => void;
|
|
51
|
+
key?: string;
|
|
52
|
+
moduleId?: string;
|
|
53
|
+
kind?: BrowserModuleKind;
|
|
54
|
+
target?: Element;
|
|
55
|
+
update?: (ctx: ModuleSetupContext) => void | Promise<void>;
|
|
43
56
|
destroy: () => void | Promise<void>;
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
beforeSubmit?: (ctx: BeforeSubmitContext) => void | Promise<void>;
|
|
58
|
+
afterSubmit?: (ctx: AfterSubmitContext, result: FormSubmitResult) => void | Promise<void>;
|
|
46
59
|
};
|
|
47
60
|
|
|
48
|
-
export type
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
export type BrowserModuleDefinition = {
|
|
62
|
+
moduleId: string;
|
|
63
|
+
version: 2;
|
|
64
|
+
surfaces: BrowserSurface[];
|
|
65
|
+
kind: BrowserModuleKind;
|
|
51
66
|
match: (ctx: ModuleMatchContext) => boolean;
|
|
52
|
-
setup: (ctx: ModuleSetupContext) => Promise<
|
|
67
|
+
setup: (ctx: ModuleSetupContext) => Promise<BrowserModuleInstance | void>;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type BrowserModuleFailure = {
|
|
71
|
+
key: string;
|
|
72
|
+
moduleId: string;
|
|
73
|
+
required: boolean;
|
|
74
|
+
surface: BrowserSurface;
|
|
75
|
+
code: 'MODULE_UNAVAILABLE';
|
|
76
|
+
message: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type BrowserModuleHydrationReport = {
|
|
80
|
+
readonly instances: readonly BrowserModuleInstance[];
|
|
81
|
+
readonly failures: readonly BrowserModuleFailure[];
|
|
53
82
|
};
|
|
@@ -1,32 +1,7 @@
|
|
|
1
|
+
import type { BrowserModuleManifest, PaymentDecision } from '@verbb/formie-core';
|
|
1
2
|
import type { FormAction, SubmitStage } from '#contracts/common';
|
|
2
3
|
import type { ThemeClassMap } from '#contracts/theme';
|
|
3
4
|
|
|
4
|
-
export type FormDefinitionField = {
|
|
5
|
-
id: string;
|
|
6
|
-
uid?: string;
|
|
7
|
-
handle: string;
|
|
8
|
-
type: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
settings?: Record<string, unknown>;
|
|
12
|
-
children?: FormDefinitionField[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type FormDefinitionPage = {
|
|
16
|
-
id: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
fields: FormDefinitionField[];
|
|
19
|
-
settings?: Record<string, unknown>;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type FormDefinitionPayload = {
|
|
23
|
-
formId?: string;
|
|
24
|
-
handle?: string;
|
|
25
|
-
pages?: FormDefinitionPage[];
|
|
26
|
-
settings?: Record<string, unknown>;
|
|
27
|
-
theme?: ThemeClassMap;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
5
|
export type FormRefreshTokensPayload = {
|
|
31
6
|
csrf?: {
|
|
32
7
|
param: string;
|
|
@@ -34,6 +9,7 @@ export type FormRefreshTokensPayload = {
|
|
|
34
9
|
};
|
|
35
10
|
requestToken?: string;
|
|
36
11
|
renderId?: string;
|
|
12
|
+
uploadCreateToken?: string;
|
|
37
13
|
captchas?: Record<string, { sessionKey: string; value?: string }>;
|
|
38
14
|
meta?: Record<string, unknown>;
|
|
39
15
|
};
|
|
@@ -43,6 +19,14 @@ export type FormRedirect = {
|
|
|
43
19
|
target?: 'same-tab' | 'new-tab';
|
|
44
20
|
};
|
|
45
21
|
|
|
22
|
+
export type FormCompletion = {
|
|
23
|
+
behavior: 'message' | 'redirect' | 'reload' | 'reset';
|
|
24
|
+
url: string | null;
|
|
25
|
+
target: 'same-tab' | 'new-tab';
|
|
26
|
+
message: string | null;
|
|
27
|
+
hideForm: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
46
30
|
export type FormClientEvent = {
|
|
47
31
|
event: string;
|
|
48
32
|
payload: Record<string, string>;
|
|
@@ -50,13 +34,19 @@ export type FormClientEvent = {
|
|
|
50
34
|
|
|
51
35
|
export type FormSubmitResult = {
|
|
52
36
|
ok: boolean;
|
|
37
|
+
outcome?: string;
|
|
38
|
+
version?: number | null;
|
|
39
|
+
submissionUid?: string | null;
|
|
40
|
+
errors?: unknown;
|
|
41
|
+
session?: unknown;
|
|
42
|
+
completion?: FormCompletion | null;
|
|
53
43
|
action?: FormAction;
|
|
54
44
|
stage?: SubmitStage;
|
|
55
45
|
code?: string;
|
|
56
46
|
message?: string;
|
|
57
47
|
keepSubmitLoading?: boolean;
|
|
48
|
+
payment?: PaymentDecision | null;
|
|
58
49
|
fieldErrors?: Record<string, string[]>;
|
|
59
|
-
pageFieldErrors?: Record<string, Record<string, string[]>>;
|
|
60
50
|
formErrors?: string[];
|
|
61
51
|
nextPage?: { id: string } | null;
|
|
62
52
|
redirect?: FormRedirect | null;
|
|
@@ -68,22 +58,10 @@ export type FormSubmitResult = {
|
|
|
68
58
|
export type FormEndpointPayload = {
|
|
69
59
|
html?: string;
|
|
70
60
|
theme?: ThemeClassMap;
|
|
71
|
-
modules?:
|
|
61
|
+
modules?: BrowserModuleManifest;
|
|
72
62
|
refreshTokens?: FormRefreshTokensPayload;
|
|
73
63
|
};
|
|
74
64
|
|
|
75
|
-
export type
|
|
76
|
-
|
|
77
|
-
export type
|
|
78
|
-
targetType: FormModuleTargetType;
|
|
79
|
-
targetId: string;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export type FormModuleManifest = {
|
|
83
|
-
id: string;
|
|
84
|
-
src?: string;
|
|
85
|
-
type: string;
|
|
86
|
-
targets?: FormModuleTarget[];
|
|
87
|
-
renderTargets?: string[];
|
|
88
|
-
config?: Record<string, unknown>;
|
|
89
|
-
};
|
|
65
|
+
export type { BrowserModuleEntry, BrowserModuleKind, BrowserModuleManifest } from '@verbb/formie-core';
|
|
66
|
+
export type FormModuleTarget = import('@verbb/formie-core').BrowserModuleTarget;
|
|
67
|
+
export type FormModuleTargetType = FormModuleTarget['type'];
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BrowserThemeStateKey } from '#theme/browser-theme-state.generated';
|
|
2
|
+
|
|
3
|
+
export type BrowserThemeClassMap = Partial<Record<BrowserThemeStateKey, string[] | string>> & Record<string, string[] | string>;
|
|
4
|
+
|
|
5
|
+
/** @deprecated Use BrowserThemeClassMap. */
|
|
6
|
+
export type ThemeClassMap = BrowserThemeClassMap;
|