@kanorio/elements 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/CustomerAccountPanel-FXJEOS4F.js +2 -0
- package/dist/CustomerAccountPanel-LK4GSYYU.js +2 -0
- package/dist/{FormAddressField-QR7ZCH77.js → FormAddressField-NH5LD6K7.js} +2 -2
- package/dist/{FormAddressField-C6VN7J6I.js → FormAddressField-Z5XT2ELO.js} +2 -2
- package/dist/FormFileField-5YFTKIRZ.js +2 -0
- package/dist/FormFileField-D2XIGIML.js +2 -0
- package/dist/{FormTaxIdField-K34MDUPW.js → FormTaxIdField-GGBQOVZE.js} +2 -2
- package/dist/{FormTaxIdField-XMK5WRQO.js → FormTaxIdField-XJSMW3II.js} +2 -2
- package/dist/KanorioAccount-GXRAMZCI.js +2 -0
- package/dist/KanorioAccount-P6IIPIZ2.js +2 -0
- package/dist/KanorioAnalytics-KYTK3T2L.js +2 -0
- package/dist/KanorioAnalytics-XHKBWYTS.js +2 -0
- package/dist/KanorioCurriculum-3TLNLUL4.js +2 -0
- package/dist/KanorioCurriculum-SQ4S3U5T.js +2 -0
- package/dist/KanorioForm-FDS5UKUT.js +2 -0
- package/dist/KanorioForm-K3H3YUQH.js +2 -0
- package/dist/KanorioLightbox-QPJQJLNO.js +2 -0
- package/dist/KanorioLightbox-WBMR7MLG.js +2 -0
- package/dist/KanorioLogin-JMHHBRU7.js +2 -0
- package/dist/KanorioLogin-QMPBTK55.js +2 -0
- package/dist/KanorioMedia-5P63OK4U.js +2 -0
- package/dist/KanorioMedia-LONTU7H2.js +2 -0
- package/dist/KanorioReviews-AAQ27MYU.js +2 -0
- package/dist/KanorioReviews-LUB4KF23.js +2 -0
- package/dist/KanorioUnit-ADFQ7POH.js +2 -0
- package/dist/KanorioUnit-YBKFHGLB.js +2 -0
- package/dist/{MediaPlayer-F43FPK4E.js → MediaPlayer-C5KI6N5V.js} +2 -2
- package/dist/{MediaPlayer-JHFZFOOG.js → MediaPlayer-PMAEZSCZ.js} +2 -2
- package/dist/{PDFViewerFull-INVHZL4V.js → PDFViewerFull-6MZJTHN2.js} +2 -2
- package/dist/{PDFViewerFull-CB44M7GW.js → PDFViewerFull-P3HCVGDZ.js} +2 -2
- package/dist/account.d.ts +3 -2
- package/dist/account.js +1 -1
- package/dist/analytics.js +1 -1
- package/dist/ar-JXAEXYYY.js +2 -0
- package/dist/ar-UXUCJCPY.js +2 -0
- package/dist/bg-EUIPVVBX.js +2 -0
- package/dist/bg-HEU3KGAJ.js +2 -0
- package/dist/{bn-BHRS66N3.js → bn-L35GOE5D.js} +2 -2
- package/dist/{bn-DM5WNGJ5.js → bn-LMQOF3SO.js} +2 -2
- package/dist/bot-protection.d.ts +67 -36
- package/dist/bot-protection.js +1 -1
- package/dist/chunk-2H3LTDAA.js +2 -0
- package/dist/chunk-3NXF6SCJ.js +2 -0
- package/dist/{chunk-EE4S6NRV.js → chunk-4OC7BRQS.js} +2 -2
- package/dist/{chunk-DTBRUBPG.js → chunk-56UUP6CI.js} +2 -2
- package/dist/{chunk-IAXVJLJ3.js → chunk-65RP744E.js} +2 -2
- package/dist/chunk-APWDEDWM.js +2 -0
- package/dist/{chunk-H7VP4BYY.js → chunk-CD7JDUB6.js} +2 -2
- package/dist/{chunk-4KA3HSRQ.js → chunk-CIVS7LYU.js} +2 -2
- package/dist/chunk-CMYBXWO5.js +3 -0
- package/dist/{chunk-WM5S3YN5.js → chunk-CTMHQZAU.js} +2 -2
- package/dist/chunk-D4KDA3KL.js +2 -0
- package/dist/{chunk-36YEGBKK.js → chunk-EGJ6SNTR.js} +2 -2
- package/dist/chunk-G5673RJK.js +3 -0
- package/dist/{chunk-2ONAW3CA.js → chunk-GWUOOGNK.js} +2 -2
- package/dist/{chunk-FQCA2VGY.js → chunk-HAHAYDYM.js} +2 -2
- package/dist/chunk-IDY2ZCXL.js +2 -0
- package/dist/{chunk-NGRNPVON.js → chunk-II7PVZWZ.js} +2 -2
- package/dist/chunk-J5SMJRYC.js +2 -0
- package/dist/{chunk-N5PIQM4L.js → chunk-KW2CH7SS.js} +2 -2
- package/dist/chunk-KYXZNMNA.js +2 -0
- package/dist/{chunk-QOQQCCID.js → chunk-L3BUSP27.js} +2 -2
- package/dist/{chunk-B7KLKVIM.js → chunk-L66F3USG.js} +2 -2
- package/dist/{chunk-NBDRYQZV.js → chunk-OLGITMLA.js} +2 -2
- package/dist/{chunk-BGVTMWPN.js → chunk-OWXGUUSI.js} +2 -2
- package/dist/chunk-Q4APVE7S.js +2 -0
- package/dist/chunk-QF55WZDP.js +2 -0
- package/dist/{chunk-4MOCTNN7.js → chunk-QRKYFFDH.js} +2 -2
- package/dist/chunk-QYTK2CW3.js +2 -0
- package/dist/chunk-R5M6FXXQ.js +2 -0
- package/dist/chunk-RI64PHGM.js +2 -0
- package/dist/chunk-RNRIZCZS.js +2 -0
- package/dist/chunk-RTF2NUMK.js +3 -0
- package/dist/chunk-SB5665ZK.js +2 -0
- package/dist/{chunk-5HWAL7VK.js → chunk-SGFVHVLE.js} +2 -2
- package/dist/{chunk-K4VRRKYJ.js → chunk-UDNUWN4W.js} +2 -2
- package/dist/{chunk-AF46NLXK.js → chunk-UITC3NFQ.js} +2 -2
- package/dist/chunk-VGQ2N7JH.js +2 -0
- package/dist/chunk-WJPCDZSL.js +2 -0
- package/dist/{chunk-LWRWKZBC.js → chunk-WKKPZXK3.js} +2 -2
- package/dist/{chunk-Z4OV6QHI.js → chunk-Y5JA6B5O.js} +2 -2
- package/dist/cs-LY4LE4NI.js +2 -0
- package/dist/cs-MGLMNU2K.js +2 -0
- package/dist/curriculum.d.ts +3 -2
- package/dist/curriculum.js +1 -1
- package/dist/da-LQTLZNBW.js +2 -0
- package/dist/da-X5HKEDEL.js +2 -0
- package/dist/de-M3M4VBDR.js +2 -0
- package/dist/de-Y5ELIZBU.js +2 -0
- package/dist/{deliverables-C5RD2ASE.js → deliverables-EOIAZFWB.js} +25 -25
- package/dist/{deliverables-BDS7WMBC.js → deliverables-NO5NEFRM.js} +2 -2
- package/dist/{el-SMBF7FG4.js → el-7YYYEHW6.js} +2 -2
- package/dist/{el-G2AWU43W.js → el-YZGS3PLP.js} +2 -2
- package/dist/elements.css +1 -1
- package/dist/en-AU-IUEA3YQP.js +2 -0
- package/dist/en-AU-RQ2DVIXE.js +2 -0
- package/dist/en-CA-OFK46Q44.js +2 -0
- package/dist/en-CA-QDP57WHG.js +2 -0
- package/dist/en-GB-URCOTEDK.js +2 -0
- package/dist/en-GB-VNG2IO2E.js +2 -0
- package/dist/en-JSBHSC4K.js +2 -0
- package/dist/en-MCRNEXQP.js +2 -0
- package/dist/en-US-5RT4SJ3V.js +2 -0
- package/dist/en-US-IWMVMSUT.js +2 -0
- package/dist/es-419-53Z5HI6Z.js +2 -0
- package/dist/es-419-JFUQ3D4V.js +2 -0
- package/dist/es-ES-BMD6JJEO.js +2 -0
- package/dist/es-ES-PBIVNTAT.js +2 -0
- package/dist/fa-57P7R77M.js +2 -0
- package/dist/{fa-OYP2Q5EV.js → fa-NE4XJTHW.js} +2 -2
- package/dist/fi-G5MG7VJ2.js +2 -0
- package/dist/fi-SCTIKRMX.js +2 -0
- package/dist/form.d.ts +393 -23
- package/dist/form.js +1 -1
- package/dist/{forms-answers-address-7P6EVFY5.js → forms-answers-address-5MXQYIH3.js} +2 -2
- package/dist/{forms-answers-address-IQV2Y56H.js → forms-answers-address-BGBI445K.js} +2 -2
- package/dist/{forms-answers-tax-id-WJD7K3PG.js → forms-answers-tax-id-3AYXCNP5.js} +2 -2
- package/dist/{forms-answers-tax-id-D4GOUC6N.js → forms-answers-tax-id-LSWOEHJ4.js} +2 -2
- package/dist/fr-CA-4X7URW4M.js +2 -0
- package/dist/fr-CA-RQDI3NIQ.js +2 -0
- package/dist/fr-FR-EDVHTVOW.js +2 -0
- package/dist/fr-FR-KGXOTINP.js +2 -0
- package/dist/{gu-BREQK3GJ.js → gu-7AJCL43I.js} +2 -2
- package/dist/{gu-RNCZTEOA.js → gu-QE53XIWR.js} +2 -2
- package/dist/he-UWYKIUPF.js +2 -0
- package/dist/he-VLGZUN42.js +2 -0
- package/dist/{hi-DKG5TPYX.js → hi-5M4U37GW.js} +2 -2
- package/dist/{hi-F7Y62LAZ.js → hi-KXKJMKZF.js} +2 -2
- package/dist/{hu-3Y5YEIFL.js → hu-JU7V3YQX.js} +2 -2
- package/dist/{hu-L6W5O2G5.js → hu-YRF3KPIJ.js} +2 -2
- package/dist/id-IRL2KCIE.js +2 -0
- package/dist/id-SXO4Z54V.js +2 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/it-55QCLHB7.js +2 -0
- package/dist/it-RBRELRA3.js +2 -0
- package/dist/ja-2WRUVHKU.js +2 -0
- package/dist/ja-3HZPHYZS.js +2 -0
- package/dist/kanorio-elements.js +1 -1
- package/dist/{km-HPCMYWAG.js → km-EW4ISUB7.js} +2 -2
- package/dist/{km-PHVYTPLT.js → km-SL6MZB3H.js} +2 -2
- package/dist/{kn-QAWBGLHG.js → kn-RUSRJNGR.js} +2 -2
- package/dist/kn-YGEU3PSD.js +2 -0
- package/dist/ko-2GI6Z5YH.js +2 -0
- package/dist/ko-QK33QMU2.js +2 -0
- package/dist/{lightbox-DEvsB5dB.d.ts → lightbox-BmkHgtZg.d.ts} +1 -1
- package/dist/lightbox.d.ts +4 -3
- package/dist/lightbox.js +1 -1
- package/dist/{lo-JNUKFIQV.js → lo-PPDKXTQQ.js} +2 -2
- package/dist/{lo-YRHYLRZC.js → lo-ZRV6OAH6.js} +2 -2
- package/dist/login.d.ts +3 -2
- package/dist/login.js +1 -1
- package/dist/media.d.ts +3 -2
- package/dist/media.js +1 -1
- package/dist/{ml-QO64O4H6.js → ml-BIZEFHNR.js} +2 -2
- package/dist/{ml-3LXSDTNF.js → ml-KO2JGAL5.js} +2 -2
- package/dist/{mr-PLM72664.js → mr-J4AGQFC7.js} +2 -2
- package/dist/{mr-5WLN37JQ.js → mr-PZNRW5MW.js} +2 -2
- package/dist/{ms-PIAATVMD.js → ms-NYWKJQEQ.js} +2 -2
- package/dist/{ms-N544Y63H.js → ms-OMUKF5WC.js} +2 -2
- package/dist/{my-3J665CWK.js → my-FHI5JEQF.js} +2 -2
- package/dist/{my-6IKSM3XW.js → my-R4OXNUDW.js} +2 -2
- package/dist/nb-EC6AP76Y.js +2 -0
- package/dist/nb-U4QN5GJE.js +2 -0
- package/dist/{ne-ASFNHMO3.js → ne-DRPNDCZH.js} +2 -2
- package/dist/ne-J3XQJZAY.js +2 -0
- package/dist/nl-BE-QIH5K6WQ.js +2 -0
- package/dist/nl-BE-VHBDCIRF.js +2 -0
- package/dist/nl-NL-FZMZRVH4.js +2 -0
- package/dist/nl-NL-USXHXD5U.js +2 -0
- package/dist/nn-IPL74C6S.js +2 -0
- package/dist/nn-UCSEDGDB.js +2 -0
- package/dist/{pa-P2GAYL5A.js → pa-LTF7CWS2.js} +2 -2
- package/dist/{pa-VX5TUNDP.js → pa-NTK4KSUF.js} +2 -2
- package/dist/{phone-input-Q5AV6KSW.js → phone-input-DOL46AIF.js} +2 -2
- package/dist/{phone-input-T6QX2TDS.js → phone-input-PXLNDXAB.js} +2 -2
- package/dist/pl-6FXX3WNC.js +2 -0
- package/dist/pl-YWCG2YWW.js +2 -0
- package/dist/{provider-CMLzyAjJ.d.ts → provider-BYGVc6kS.d.ts} +3 -1
- package/dist/provider.d.ts +3 -2
- package/dist/provider.js +1 -1
- package/dist/pt-BR-5JRKIQVH.js +2 -0
- package/dist/pt-BR-CIJCMCLE.js +2 -0
- package/dist/pt-PT-A7F2KKCY.js +2 -0
- package/dist/pt-PT-Y2UCAKHP.js +2 -0
- package/dist/reviews.d.ts +3 -2
- package/dist/reviews.js +1 -1
- package/dist/ro-6MQF2KY2.js +2 -0
- package/dist/ro-YISUN7LU.js +2 -0
- package/dist/ru-KGU3SC3S.js +2 -0
- package/dist/ru-RMPFJQSL.js +2 -0
- package/dist/{si-5VUM5FGR.js → si-CTQN6I2M.js} +2 -2
- package/dist/{si-5F7RWQIE.js → si-N5U32GIL.js} +2 -2
- package/dist/sv-36EB3HIA.js +2 -0
- package/dist/sv-QGZRDKBJ.js +2 -0
- package/dist/sw-CWIRVHYD.js +2 -0
- package/dist/sw-OUQYTLJF.js +2 -0
- package/dist/{ta-MNWTH3F5.js → ta-E3ZBHC6A.js} +2 -2
- package/dist/{ta-R73RBA23.js → ta-N7BHKWBO.js} +2 -2
- package/dist/{te-5SBVH4OF.js → te-7JC2KGAU.js} +2 -2
- package/dist/{te-GVW56XDM.js → te-CTCZQKFU.js} +2 -2
- package/dist/{th-G6SY3D2Q.js → th-AN5CLQP6.js} +2 -2
- package/dist/{th-2GWK7DBB.js → th-JVK4E2AJ.js} +2 -2
- package/dist/tl-BSWGJB7O.js +2 -0
- package/dist/tl-X72423V3.js +2 -0
- package/dist/tr-22NUPSET.js +2 -0
- package/dist/tr-AZ2PLRZY.js +2 -0
- package/dist/{uk-PGHXMWJR.js → uk-POKPJJDZ.js} +2 -2
- package/dist/uk-UOTQJ3E7.js +2 -0
- package/dist/unit.d.ts +3 -1
- package/dist/unit.js +1 -1
- package/dist/{ur-4CR64XUI.js → ur-6LBRTMAE.js} +2 -2
- package/dist/{ur-J5HV4NTW.js → ur-NRHFTLO5.js} +2 -2
- package/dist/vi-3ZVAOXIJ.js +2 -0
- package/dist/vi-XC4CGJHX.js +2 -0
- package/dist/web-components.js +1 -1
- package/dist/zh-CN-EKEY2CLM.js +2 -0
- package/dist/zh-CN-XW3PLUG5.js +2 -0
- package/dist/zh-HK-25OZZBHO.js +2 -0
- package/dist/zh-HK-EPQAUBL3.js +2 -0
- package/dist/zh-Hant-LFJZCOMK.js +2 -0
- package/dist/zh-Hant-RQMTFZSE.js +2 -0
- package/package.json +2 -2
- package/dist/CustomerAccountPanel-DJKV7LT4.js +0 -2
- package/dist/CustomerAccountPanel-RWEHWBJY.js +0 -2
- package/dist/FormFileField-LZDCXI2Z.js +0 -2
- package/dist/FormFileField-ONL4Q55V.js +0 -2
- package/dist/KanorioAccount-EN3TM67X.js +0 -2
- package/dist/KanorioAccount-XGVSGVYN.js +0 -2
- package/dist/KanorioAnalytics-NEKTFQEE.js +0 -2
- package/dist/KanorioAnalytics-UMCUWQM7.js +0 -2
- package/dist/KanorioCurriculum-3QSCOHK7.js +0 -2
- package/dist/KanorioCurriculum-RUIGZ5X7.js +0 -2
- package/dist/KanorioForm-GUA5GEJY.js +0 -2
- package/dist/KanorioForm-KXV7D2TU.js +0 -2
- package/dist/KanorioLightbox-M72HNQQX.js +0 -2
- package/dist/KanorioLightbox-TQ3Q73TD.js +0 -2
- package/dist/KanorioLogin-5XFN3YEE.js +0 -2
- package/dist/KanorioLogin-AJHHVQGV.js +0 -2
- package/dist/KanorioMedia-ADKUDH5C.js +0 -2
- package/dist/KanorioMedia-DLBSXCKA.js +0 -2
- package/dist/KanorioReviews-42FZSXTI.js +0 -2
- package/dist/KanorioReviews-7LD5WKFG.js +0 -2
- package/dist/KanorioUnit-NWBX5DEI.js +0 -2
- package/dist/KanorioUnit-SIM3344J.js +0 -2
- package/dist/ar-3VA7IUCO.js +0 -2
- package/dist/ar-AUQCHHZG.js +0 -2
- package/dist/bg-IRGRVWOG.js +0 -2
- package/dist/bg-QWC2KG3G.js +0 -2
- package/dist/chunk-4BBERZ6T.js +0 -2
- package/dist/chunk-5AUWUK5R.js +0 -2
- package/dist/chunk-66XN5RR4.js +0 -2
- package/dist/chunk-EZMTUAQX.js +0 -2
- package/dist/chunk-FSY5GB5E.js +0 -3
- package/dist/chunk-G4U6BFZY.js +0 -2
- package/dist/chunk-GJY6AQIS.js +0 -2
- package/dist/chunk-IXDKZO42.js +0 -2
- package/dist/chunk-MIQK3T3Y.js +0 -2
- package/dist/chunk-QGR3QAQB.js +0 -3
- package/dist/chunk-SUXTLVTX.js +0 -2
- package/dist/chunk-UIHBR4NU.js +0 -3
- package/dist/chunk-WXIUWMFR.js +0 -2
- package/dist/cs-3IX2ZQKJ.js +0 -2
- package/dist/cs-NZW6FBFY.js +0 -2
- package/dist/da-AFMLFM32.js +0 -2
- package/dist/da-PZ32KKTE.js +0 -2
- package/dist/de-5JPEK4HF.js +0 -2
- package/dist/de-MVL4XGYR.js +0 -2
- package/dist/en-AIAENVLI.js +0 -2
- package/dist/en-AU-LB5UVGIW.js +0 -2
- package/dist/en-AU-Q2O2HPJ2.js +0 -2
- package/dist/en-CA-AZDOY7PW.js +0 -2
- package/dist/en-CA-PVKXM3WS.js +0 -2
- package/dist/en-GB-2N4WB6SL.js +0 -2
- package/dist/en-GB-Y5QRPC7S.js +0 -2
- package/dist/en-SAXQF5YW.js +0 -2
- package/dist/en-US-74L4OI3J.js +0 -2
- package/dist/en-US-EKS52JBW.js +0 -2
- package/dist/es-419-Q5IH6W5F.js +0 -2
- package/dist/es-419-VSZWGONE.js +0 -2
- package/dist/es-ES-7L55KPLO.js +0 -2
- package/dist/es-ES-ETSYFLPQ.js +0 -2
- package/dist/fa-WRJCKGS3.js +0 -2
- package/dist/fi-44ST6B6Q.js +0 -2
- package/dist/fi-J6NJBPNK.js +0 -2
- package/dist/fr-CA-KXRNFZBP.js +0 -2
- package/dist/fr-CA-PWWAPLBH.js +0 -2
- package/dist/fr-FR-FMLQPLOD.js +0 -2
- package/dist/fr-FR-MQAFE7IX.js +0 -2
- package/dist/he-GNC45OCB.js +0 -2
- package/dist/he-VXZCGAHY.js +0 -2
- package/dist/id-7DWHYYFC.js +0 -2
- package/dist/id-DCV57AQB.js +0 -2
- package/dist/it-7RASZ4SK.js +0 -2
- package/dist/it-JICU5WVL.js +0 -2
- package/dist/ja-4V7QJLTM.js +0 -2
- package/dist/ja-52MBIM3T.js +0 -2
- package/dist/kn-5DYCOYAN.js +0 -2
- package/dist/ko-55JV4VQK.js +0 -2
- package/dist/ko-FZIJZG6K.js +0 -2
- package/dist/nb-345ACUTX.js +0 -2
- package/dist/nb-F33WYJ6T.js +0 -2
- package/dist/ne-AAIECB2W.js +0 -2
- package/dist/nl-BE-SHZLAL5T.js +0 -2
- package/dist/nl-BE-WK4C6XRZ.js +0 -2
- package/dist/nl-NL-2YLHGJZL.js +0 -2
- package/dist/nl-NL-PHRY43UB.js +0 -2
- package/dist/nn-I5A2LCBH.js +0 -2
- package/dist/nn-S3SNETRB.js +0 -2
- package/dist/pl-4Y4BWTLT.js +0 -2
- package/dist/pl-SGPLZAER.js +0 -2
- package/dist/pt-BR-CW3MRSRP.js +0 -2
- package/dist/pt-BR-WKEKB5CG.js +0 -2
- package/dist/pt-PT-AJZQS2C6.js +0 -2
- package/dist/pt-PT-ZTPCI2K6.js +0 -2
- package/dist/ro-ANISGUFX.js +0 -2
- package/dist/ro-HRV64STT.js +0 -2
- package/dist/ru-7U566HR4.js +0 -2
- package/dist/ru-PKSZKOLH.js +0 -2
- package/dist/sv-HZVCM7LG.js +0 -2
- package/dist/sv-UOGO55PW.js +0 -2
- package/dist/sw-5XU65KFC.js +0 -2
- package/dist/sw-KVAYRFED.js +0 -2
- package/dist/tl-OCD2O6J3.js +0 -2
- package/dist/tl-PZNXANIM.js +0 -2
- package/dist/tr-2BDM6H5Q.js +0 -2
- package/dist/tr-VFMHVRQX.js +0 -2
- package/dist/uk-OQRACKKD.js +0 -2
- package/dist/vi-MQSOSIUY.js +0 -2
- package/dist/vi-U7OT2LM7.js +0 -2
- package/dist/zh-CN-CCYHPSVA.js +0 -2
- package/dist/zh-CN-RNW2BEY7.js +0 -2
- package/dist/zh-HK-HE2T63O2.js +0 -2
- package/dist/zh-HK-RKREDSAO.js +0 -2
- package/dist/zh-Hant-GBQLGJDF.js +0 -2
- package/dist/zh-Hant-T6KHSA5B.js +0 -2
package/dist/form.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { K as KanorioConfig } from './provider-
|
|
2
|
+
import { K as KanorioConfig } from './provider-BYGVc6kS.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export { F as FORM_SUBMIT_EVENT } from './events-CJeBru-H.js';
|
|
5
5
|
export { KanorioBotProtection, KanorioBotProtectionAltcha, UseKanorioBotProtectionOptions, useKanorioBotProtection } from './bot-protection.js';
|
|
6
|
-
import 'react';
|
|
7
|
-
import '@kanorio/sdk';
|
|
6
|
+
import { InputHTMLAttributes, ChangeEvent, FormEvent, ReactNode } from 'react';
|
|
7
|
+
import '@kanorio/sdk/delivery';
|
|
8
|
+
import '@kanorio/sdk/customer';
|
|
8
9
|
|
|
9
10
|
/** Maximum column options: 1 to 5 columns (no auto; each section's UI may lower the limit) */
|
|
10
11
|
type MaxColumnsValue = 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -15,6 +16,61 @@ type MaxColumnsConfig = {
|
|
|
15
16
|
desktop?: MaxColumnsValue;
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
/** One address: the answer to a form's address question and an address book entry both have this shape */
|
|
20
|
+
interface PostalAddress {
|
|
21
|
+
/** ISO 3166-1 alpha-2 */
|
|
22
|
+
countryCode: string;
|
|
23
|
+
recipientName?: string;
|
|
24
|
+
addressLine1: string;
|
|
25
|
+
addressLine2?: string;
|
|
26
|
+
locality?: string;
|
|
27
|
+
region?: string;
|
|
28
|
+
postalCode?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether a form can be filled in now. No dependencies (no zod, no form schema): the site shell's popups use it too, and must not
|
|
33
|
+
* bring the whole form schema into every page for it. The types are compatible with `FormStatusKey` and `FormSettings` in `forms.ts`.
|
|
34
|
+
*/
|
|
35
|
+
type FormAvailability = "open" | "not_open" | "closed" | "full";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Form constants, answer types and pure helpers that need no schema library.
|
|
39
|
+
*
|
|
40
|
+
* Browser code (the form widget, answer validation, answer formatting) imports from here, so it does not pull in
|
|
41
|
+
* the zod schemas of `forms.ts`. `forms.ts` re-exports everything in this file; server and editor code can keep
|
|
42
|
+
* importing from there. Types that are inferred from the schemas (`FormField`, `FormSettings`, `FormDateBound`)
|
|
43
|
+
* stay in `forms.ts` and are imported here as types only.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/** The answers a visitor submits, keyed by field id. Validation and normalization are in forms-answers.ts */
|
|
47
|
+
type FormAnswers = Record<string, FormAnswerValue>;
|
|
48
|
+
/** The answer to an address question: one structured address (the same shape as an address book entry) */
|
|
49
|
+
type FormAddressAnswer = PostalAddress;
|
|
50
|
+
/**
|
|
51
|
+
* The answer to a tax ID question. The visitor submits `{ countryCode, value }`; once the server has validated it, it stores the
|
|
52
|
+
* normalized `value`, the country's tax ID `type` and the result of the check at submit time in `verification` (a record only; it does
|
|
53
|
+
* not decide whether the form can be submitted). The country is keyed `countryCode`, as in the address question: a question where only
|
|
54
|
+
* the country was chosen does not count as answered.
|
|
55
|
+
*/
|
|
56
|
+
interface FormTaxIdAnswer {
|
|
57
|
+
countryCode: string;
|
|
58
|
+
/** Tax ID type (tw_vat, hk_br, jp_trn…); set once the server has normalized the answer */
|
|
59
|
+
type?: string;
|
|
60
|
+
value: string;
|
|
61
|
+
verification?: FormTaxIdVerification;
|
|
62
|
+
}
|
|
63
|
+
interface FormTaxIdVerification {
|
|
64
|
+
/** VERIFIED: the registry has this number; NOT_FOUND: no public record (which does not make it invalid); VALID_FORMAT: there is no registry to check; UNAVAILABLE: the check could not run at the time */
|
|
65
|
+
status: "VERIFIED" | "NOT_FOUND" | "VALID_FORMAT" | "UNAVAILABLE";
|
|
66
|
+
registryName?: string;
|
|
67
|
+
registryStatus?: string;
|
|
68
|
+
/** Where the result came from (RegistrySource) */
|
|
69
|
+
source?: string;
|
|
70
|
+
checkedAt: string;
|
|
71
|
+
}
|
|
72
|
+
type FormAnswerValue = string | string[] | number | FormAddressAnswer | FormTaxIdAnswer | null;
|
|
73
|
+
|
|
18
74
|
/**
|
|
19
75
|
* The single source of truth for the online form schema.
|
|
20
76
|
*
|
|
@@ -43,8 +99,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
43
99
|
}>>;
|
|
44
100
|
conditions: z.ZodArray<z.ZodObject<{
|
|
45
101
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
46
|
-
field: "field";
|
|
47
102
|
hidden: "hidden";
|
|
103
|
+
field: "field";
|
|
48
104
|
}>>;
|
|
49
105
|
ref: z.ZodString;
|
|
50
106
|
op: z.ZodEnum<{
|
|
@@ -79,8 +135,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
79
135
|
}>>;
|
|
80
136
|
conditions: z.ZodArray<z.ZodObject<{
|
|
81
137
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
82
|
-
field: "field";
|
|
83
138
|
hidden: "hidden";
|
|
139
|
+
field: "field";
|
|
84
140
|
}>>;
|
|
85
141
|
ref: z.ZodString;
|
|
86
142
|
op: z.ZodEnum<{
|
|
@@ -101,7 +157,7 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
101
157
|
}, z.core.$strip>>;
|
|
102
158
|
}, z.core.$strip>, z.ZodObject<{
|
|
103
159
|
type: z.ZodLiteral<"email">;
|
|
104
|
-
required: z.ZodPipe<z.ZodDefault<z.ZodBoolean>, z.ZodTransform<
|
|
160
|
+
required: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodBoolean>, z.ZodTransform<true, boolean>>, z.ZodLiteral<true>>;
|
|
105
161
|
contactMapping: z.ZodDefault<z.ZodLiteral<"email">>;
|
|
106
162
|
id: z.ZodString;
|
|
107
163
|
label: z.ZodString;
|
|
@@ -113,8 +169,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
113
169
|
}>>;
|
|
114
170
|
conditions: z.ZodArray<z.ZodObject<{
|
|
115
171
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
116
|
-
field: "field";
|
|
117
172
|
hidden: "hidden";
|
|
173
|
+
field: "field";
|
|
118
174
|
}>>;
|
|
119
175
|
ref: z.ZodString;
|
|
120
176
|
op: z.ZodEnum<{
|
|
@@ -148,8 +204,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
148
204
|
}>>;
|
|
149
205
|
conditions: z.ZodArray<z.ZodObject<{
|
|
150
206
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
151
|
-
field: "field";
|
|
152
207
|
hidden: "hidden";
|
|
208
|
+
field: "field";
|
|
153
209
|
}>>;
|
|
154
210
|
ref: z.ZodString;
|
|
155
211
|
op: z.ZodEnum<{
|
|
@@ -194,8 +250,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
194
250
|
}>>;
|
|
195
251
|
conditions: z.ZodArray<z.ZodObject<{
|
|
196
252
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
197
|
-
field: "field";
|
|
198
253
|
hidden: "hidden";
|
|
254
|
+
field: "field";
|
|
199
255
|
}>>;
|
|
200
256
|
ref: z.ZodString;
|
|
201
257
|
op: z.ZodEnum<{
|
|
@@ -244,8 +300,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
244
300
|
}>>;
|
|
245
301
|
conditions: z.ZodArray<z.ZodObject<{
|
|
246
302
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
247
|
-
field: "field";
|
|
248
303
|
hidden: "hidden";
|
|
304
|
+
field: "field";
|
|
249
305
|
}>>;
|
|
250
306
|
ref: z.ZodString;
|
|
251
307
|
op: z.ZodEnum<{
|
|
@@ -278,8 +334,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
278
334
|
}>>;
|
|
279
335
|
conditions: z.ZodArray<z.ZodObject<{
|
|
280
336
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
281
|
-
field: "field";
|
|
282
337
|
hidden: "hidden";
|
|
338
|
+
field: "field";
|
|
283
339
|
}>>;
|
|
284
340
|
ref: z.ZodString;
|
|
285
341
|
op: z.ZodEnum<{
|
|
@@ -314,8 +370,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
314
370
|
}>>;
|
|
315
371
|
conditions: z.ZodArray<z.ZodObject<{
|
|
316
372
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
317
|
-
field: "field";
|
|
318
373
|
hidden: "hidden";
|
|
374
|
+
field: "field";
|
|
319
375
|
}>>;
|
|
320
376
|
ref: z.ZodString;
|
|
321
377
|
op: z.ZodEnum<{
|
|
@@ -354,8 +410,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
354
410
|
}>>;
|
|
355
411
|
conditions: z.ZodArray<z.ZodObject<{
|
|
356
412
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
357
|
-
field: "field";
|
|
358
413
|
hidden: "hidden";
|
|
414
|
+
field: "field";
|
|
359
415
|
}>>;
|
|
360
416
|
ref: z.ZodString;
|
|
361
417
|
op: z.ZodEnum<{
|
|
@@ -391,8 +447,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
391
447
|
}>>;
|
|
392
448
|
conditions: z.ZodArray<z.ZodObject<{
|
|
393
449
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
394
|
-
field: "field";
|
|
395
450
|
hidden: "hidden";
|
|
451
|
+
field: "field";
|
|
396
452
|
}>>;
|
|
397
453
|
ref: z.ZodString;
|
|
398
454
|
op: z.ZodEnum<{
|
|
@@ -425,8 +481,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
425
481
|
}>>;
|
|
426
482
|
conditions: z.ZodArray<z.ZodObject<{
|
|
427
483
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
428
|
-
field: "field";
|
|
429
484
|
hidden: "hidden";
|
|
485
|
+
field: "field";
|
|
430
486
|
}>>;
|
|
431
487
|
ref: z.ZodString;
|
|
432
488
|
op: z.ZodEnum<{
|
|
@@ -462,8 +518,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
462
518
|
}>>;
|
|
463
519
|
conditions: z.ZodArray<z.ZodObject<{
|
|
464
520
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
465
|
-
field: "field";
|
|
466
521
|
hidden: "hidden";
|
|
522
|
+
field: "field";
|
|
467
523
|
}>>;
|
|
468
524
|
ref: z.ZodString;
|
|
469
525
|
op: z.ZodEnum<{
|
|
@@ -499,8 +555,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
499
555
|
}>>;
|
|
500
556
|
conditions: z.ZodArray<z.ZodObject<{
|
|
501
557
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
502
|
-
field: "field";
|
|
503
558
|
hidden: "hidden";
|
|
559
|
+
field: "field";
|
|
504
560
|
}>>;
|
|
505
561
|
ref: z.ZodString;
|
|
506
562
|
op: z.ZodEnum<{
|
|
@@ -524,8 +580,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
524
580
|
type: z.ZodLiteral<"statement">;
|
|
525
581
|
label: z.ZodString;
|
|
526
582
|
description: z.ZodOptional<z.ZodString>;
|
|
527
|
-
required: z.ZodPipe<z.ZodDefault<z.ZodBoolean>, z.ZodTransform<
|
|
528
|
-
contactMapping: z.ZodOptional<z.
|
|
583
|
+
required: z.ZodPipe<z.ZodPipe<z.ZodDefault<z.ZodBoolean>, z.ZodTransform<false, boolean>>, z.ZodLiteral<false>>;
|
|
584
|
+
contactMapping: z.ZodOptional<z.ZodNever>;
|
|
529
585
|
visibleWhen: z.ZodOptional<z.ZodObject<{
|
|
530
586
|
match: z.ZodDefault<z.ZodEnum<{
|
|
531
587
|
all: "all";
|
|
@@ -533,8 +589,8 @@ declare const formFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
533
589
|
}>>;
|
|
534
590
|
conditions: z.ZodArray<z.ZodObject<{
|
|
535
591
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
536
|
-
field: "field";
|
|
537
592
|
hidden: "hidden";
|
|
593
|
+
field: "field";
|
|
538
594
|
}>>;
|
|
539
595
|
ref: z.ZodString;
|
|
540
596
|
op: z.ZodEnum<{
|
|
@@ -616,8 +672,6 @@ interface PublicFormDefinition {
|
|
|
616
672
|
defaultPhoneCountry?: string | null;
|
|
617
673
|
/** The site's time zone (IANA); "from today" ranges of date questions are based on it, so the front end and the server compute the same day */
|
|
618
674
|
timezone?: string | null;
|
|
619
|
-
/** @deprecated Older public sites read this field; same value as defaultPhoneCountry, removed once all public sites are updated */
|
|
620
|
-
businessCountry: string | null;
|
|
621
675
|
}
|
|
622
676
|
|
|
623
677
|
/**
|
|
@@ -648,6 +702,8 @@ interface FormSectionLabels {
|
|
|
648
702
|
verificationExpired?: string;
|
|
649
703
|
/** The server attached an error to a question this screen does not have: the visitor has an old version of the form open and should reload */
|
|
650
704
|
outdated?: string;
|
|
705
|
+
/** The site's edge answered the submission with a security check page: the visitor should reload the page so the browser can pass it */
|
|
706
|
+
edgeChallenge?: string;
|
|
651
707
|
/** The whole response exceeds the submission size limit (nothing was stored) */
|
|
652
708
|
tooLarge?: string;
|
|
653
709
|
/** Submitted successfully and about to go to the URL the owner set */
|
|
@@ -738,6 +794,320 @@ interface FormSectionLabels {
|
|
|
738
794
|
previewNotice?: string;
|
|
739
795
|
}
|
|
740
796
|
|
|
797
|
+
/**
|
|
798
|
+
* The validation rules for a form's visitor answers: the public site's widget (before submit and on blur) and the main app's submit
|
|
799
|
+
* endpoint share this one copy. This file leaves out the validation of the phone, address and tax ID question types (each needs a large
|
|
800
|
+
* data set): the caller passes them in, see `FormHeavyFieldValidators`. For a synchronous version with everything included, use
|
|
801
|
+
* `forms-answers.ts`.
|
|
802
|
+
*
|
|
803
|
+
* Returns the normalized answers (phone numbers in E.164, emails in lowercase, the "Other" placeholder replaced by the visitor's text)
|
|
804
|
+
* and a map of question id to error code; each side turns the codes into text. It also defines the error contract of the submit response
|
|
805
|
+
* (the main route, the BFF and the widget use the same constants).
|
|
806
|
+
*
|
|
807
|
+
* Pure functions with no DOM or Prisma dependency. See docs/platform/marketing/forms.md
|
|
808
|
+
*/
|
|
809
|
+
|
|
810
|
+
declare const FORM_ANSWER_ERROR_CODES: readonly ["required", "invalid_email", "invalid_phone", "invalid_date", "invalid_time", "too_long", "too_short", "invalid_format", "invalid_option", "other_required", "too_few_options", "too_many_options", "invalid_number", "not_integer", "out_of_range", "invalid_url", "date_out_of_range", "invalid_address", "invalid_tax_id", "invalid_postal_code", "invalid"];
|
|
811
|
+
type FormAnswerErrorCode = (typeof FORM_ANSWER_ERROR_CODES)[number];
|
|
812
|
+
/**
|
|
813
|
+
* Submit errors that are shown to the visitor (the answers are kept and can be fixed and sent again).
|
|
814
|
+
* Clear signs of automation (a filled honeypot, a forged built-in protection result, a result issued for another form) are not listed:
|
|
815
|
+
* those still get a fake success, see `isSilentProtectionReason` in main. A replay is not one of them: the same result sent again with
|
|
816
|
+
* the same content gets the first answer again, and with other content `verification_expired`. Neither is a rejection from a
|
|
817
|
+
* third-party provider (Turnstile, reCAPTCHA, hCaptcha), which cannot tell a forged token from a site set up for another address:
|
|
818
|
+
* that is `verification_expired` too.
|
|
819
|
+
*/
|
|
820
|
+
declare const FORM_SUBMIT_ERRORS: readonly ["invalid_answers", "duplicate", "daily_limit", "rate_limited", "verification_expired", "temporarily_unavailable", "too_large", "server_error"];
|
|
821
|
+
type FormSubmitError = (typeof FORM_SUBMIT_ERRORS)[number];
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Shared types for tax ID and business data validation.
|
|
825
|
+
*
|
|
826
|
+
* This folder is the only implementation of formats and check digits: pure functions with no dependencies (no zod, no DOM or Node APIs),
|
|
827
|
+
* used by Kanorio's storefront (hosted checkout, forms, Elements), its dashboard and `@kanorio/sdk` (which carries a copy).
|
|
828
|
+
* Registry lookups run on Kanorio's server only.
|
|
829
|
+
* Only relative imports inside this folder.
|
|
830
|
+
*/
|
|
831
|
+
/** Tax ID types; the names follow Stripe's Customer Tax IDs */
|
|
832
|
+
type TaxIdType = "tw_vat" | "hk_br" | "jp_trn" | "kr_brn" | "eu_vat" | "sg_uen" | "my_itn" | "my_sst";
|
|
833
|
+
/** Attribution for government open data (license condition: the providing agency must be named on use) */
|
|
834
|
+
interface RegistryAttributionWire {
|
|
835
|
+
/** The providing agency (original name) */
|
|
836
|
+
provider: string;
|
|
837
|
+
providerEn: string;
|
|
838
|
+
license: "OGDL-TW-1.0";
|
|
839
|
+
licenseUrl: "https://data.gov.tw/license";
|
|
840
|
+
/** Data date (the snapshot's version date, YYYY-MM-DD); absent for live lookups */
|
|
841
|
+
dataDate?: string;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Response shape of a tax ID registry lookup (from the context-bound lookup endpoint to the storefront's tax ID input). No dependencies; only relative imports inside this folder.
|
|
846
|
+
*
|
|
847
|
+
* The lookup is only for prefilling the name and labeling; no result may ever block a submit:
|
|
848
|
+
* `NOT_FOUND` only means the public data has no match, not that the tax ID is invalid.
|
|
849
|
+
*/
|
|
850
|
+
|
|
851
|
+
type TaxIdLookupStatus = "VERIFIED" | "NOT_FOUND" | "VALID_FORMAT" | "UNAVAILABLE";
|
|
852
|
+
interface TaxIdLookupWire {
|
|
853
|
+
ok: true;
|
|
854
|
+
status: TaxIdLookupStatus;
|
|
855
|
+
country: string;
|
|
856
|
+
type: TaxIdType;
|
|
857
|
+
/** The normalized tax ID */
|
|
858
|
+
normalized: string;
|
|
859
|
+
/** Present only when `VERIFIED` */
|
|
860
|
+
registry?: {
|
|
861
|
+
name: string;
|
|
862
|
+
address?: string;
|
|
863
|
+
/** ACTIVE, SUSPENDED, CLOSED or UNKNOWN (UNKNOWN when the source does not say; do not treat it as active) */
|
|
864
|
+
registryStatus: string;
|
|
865
|
+
/** The name contains custom characters most fonts show as boxes: do not prefill it, let the person type it */
|
|
866
|
+
nameHasPrivateUse?: boolean;
|
|
867
|
+
};
|
|
868
|
+
/** The attribution that must be shown whenever government open data is used */
|
|
869
|
+
attribution?: RegistryAttributionWire;
|
|
870
|
+
}
|
|
871
|
+
/** The lookup could not run (wrong context, rate limited, bad format); the storefront always treats it as nothing to prefill and shows no error */
|
|
872
|
+
interface TaxIdLookupUnavailableWire {
|
|
873
|
+
ok: false;
|
|
874
|
+
reason: "invalid_tax_id" | "unavailable" | "rate_limited";
|
|
875
|
+
}
|
|
876
|
+
type TaxIdLookupResponse = TaxIdLookupWire | TaxIdLookupUnavailableWire;
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* The client-side checks and upload of a file question, shared by FormFileField (hosted sites and `<KanorioForm>`) and Elements'
|
|
880
|
+
* useKanorioForm: file type and size → an upload ticket from the ticket endpoint (the hosted site's BFF or the Content Delivery API;
|
|
881
|
+
* it carries the bot-protection payload, which is checked but not consumed) → an XHR PUT straight to storage.
|
|
882
|
+
*/
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Why an upload failed: `file_too_large` and `file_type_not_allowed` are about this file; `unavailable` means the question cannot take
|
|
886
|
+
* files right now (storage quota reached or storage unavailable) and the form can still be submitted; `failed` is a network or upload
|
|
887
|
+
* failure worth retrying, including an upload that made no progress for 30 seconds; `aborted` means the upload was cancelled through
|
|
888
|
+
* its `signal`.
|
|
889
|
+
*/
|
|
890
|
+
type FormFileUploadFailure = "file_too_large" | "file_type_not_allowed" | "unavailable" | "failed" | "aborted";
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* A submit error for the whole form. Two are decided in the browser:
|
|
894
|
+
* - `outdated`: the server reported an error on a question the visitor does not have, so the visitor has an older version of the form
|
|
895
|
+
* open (the owner has added questions since, and the page cache has not caught up). The answers are kept and the visitor is asked to
|
|
896
|
+
* refresh the page.
|
|
897
|
+
* - `edge_challenge`: the site's edge answered the submission with a security check page (`cf-mitigated: challenge`) instead of letting it
|
|
898
|
+
* through. A check page cannot be passed from a script; reloading the page lets the browser pass it. Only readable on the same origin:
|
|
899
|
+
* across origins the check page carries no CORS headers and the browser reports a network error (`server_error`).
|
|
900
|
+
*/
|
|
901
|
+
type FormControllerSubmitError = FormSubmitError | "outdated" | "edge_challenge";
|
|
902
|
+
/** What a successful submit reports: the form, the URL it goes to next (already filled in) and the submission id */
|
|
903
|
+
interface FormSuccessDetail {
|
|
904
|
+
formId: string;
|
|
905
|
+
redirectUrl?: string;
|
|
906
|
+
submissionId?: string;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* `useKanorioForm`: a Kanorio form for a form UI you build yourself. It runs the same state, conditions, validation, bot protection and
|
|
911
|
+
* submission as `<KanorioForm>` (one shared controller), and leaves the markup to you.
|
|
912
|
+
*/
|
|
913
|
+
|
|
914
|
+
interface UseKanorioFormOptions extends Pick<KanorioConfig, "siteUrl" | "locale"> {
|
|
915
|
+
/** Form id (c...) */
|
|
916
|
+
formId: string;
|
|
917
|
+
/** Optional: a public form definition fetched ahead during SSR, which skips the first client-side GET */
|
|
918
|
+
definition?: PublicFormDefinition | null;
|
|
919
|
+
/** The site's display name (interpolated as `{siteName}` in the platform's default consent text when the definition carries none) */
|
|
920
|
+
siteName?: string;
|
|
921
|
+
/** Overrides for the text in `labels` and the error messages (the site's language by default) */
|
|
922
|
+
labels?: FormSectionLabels;
|
|
923
|
+
/**
|
|
924
|
+
* Hidden field values: keys are the hidden field ids set for the form in the dashboard (for example `{ campaign: "spring" }`).
|
|
925
|
+
* Without them the hook reads same-named parameters from the current URL; when both exist, these win.
|
|
926
|
+
*/
|
|
927
|
+
hiddenValues?: Record<string, string>;
|
|
928
|
+
/**
|
|
929
|
+
* Whether the hook navigates when the form has a URL to go to after submit; true by default. Pass false to navigate with your own
|
|
930
|
+
* router, and take the URL from `result.redirectUrl` or `onSuccess`.
|
|
931
|
+
*/
|
|
932
|
+
followRedirect?: boolean;
|
|
933
|
+
/** Called after a successful submit (the DOM event `kanorio:form-submit` is dispatched too) */
|
|
934
|
+
onSuccess?: (detail: FormSuccessDetail) => void;
|
|
935
|
+
}
|
|
936
|
+
/** Props for a text-like question's `<input>` or `<textarea>`: short_text, long_text, email, url, number, date and time */
|
|
937
|
+
interface KanorioFormInputProps extends Pick<InputHTMLAttributes<HTMLInputElement>, "type" | "inputMode" | "autoComplete" | "maxLength" | "min" | "max" | "placeholder" | "autoCapitalize" | "spellCheck"> {
|
|
938
|
+
id: string;
|
|
939
|
+
name: string;
|
|
940
|
+
value: string;
|
|
941
|
+
required: boolean;
|
|
942
|
+
"aria-invalid"?: true;
|
|
943
|
+
"aria-describedby"?: string;
|
|
944
|
+
onChange: (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
945
|
+
onFocus: () => void;
|
|
946
|
+
onBlur: () => void;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* What `uploadFile` resolves to. On success the upload id is already added to the question's value. `file_too_large` and
|
|
950
|
+
* `file_type_not_allowed` are about this file; `unavailable` means the question cannot take files right now (the form can still be
|
|
951
|
+
* submitted without them); `failed` is a network or upload failure worth retrying, including an upload that made no progress for 30
|
|
952
|
+
* seconds; `aborted` means you cancelled it through `signal`; `not_ready` means the bot protection has not passed yet (wait for
|
|
953
|
+
* `uploadReady`, then call again); `too_many_files` means the question already holds its maximum.
|
|
954
|
+
*/
|
|
955
|
+
type KanorioFormUploadResult = {
|
|
956
|
+
ok: true;
|
|
957
|
+
uploadId: string;
|
|
958
|
+
} | {
|
|
959
|
+
ok: false;
|
|
960
|
+
reason: FormFileUploadFailure | "not_ready" | "not_a_file_question" | "too_many_files";
|
|
961
|
+
};
|
|
962
|
+
interface KanorioFormState {
|
|
963
|
+
/**
|
|
964
|
+
* `loading` until the form, the site's text and its bot-protection settings are read; `unavailable` when they cannot be read
|
|
965
|
+
* (show `labels.temporarilyUnavailable`, which is in English when the site's text is what could not be loaded); then `ready`,
|
|
966
|
+
* `submitting` and `success`.
|
|
967
|
+
*/
|
|
968
|
+
status: "loading" | "unavailable" | "ready" | "submitting" | "success";
|
|
969
|
+
/** The form as published; null while loading */
|
|
970
|
+
definition: PublicFormDefinition | null;
|
|
971
|
+
/**
|
|
972
|
+
* The questions to draw now, in order. Questions hidden by the form's conditions are left out and come back when the answers that
|
|
973
|
+
* hide them change; `statement` questions are text to show, not inputs.
|
|
974
|
+
*/
|
|
975
|
+
fields: FormField[];
|
|
976
|
+
/** Whether the form takes responses: `open`, or `closed`, `not_open` or `full` (show `labels.closed`, `labels.notOpenYet` or `labels.full`) */
|
|
977
|
+
availability: FormAvailability;
|
|
978
|
+
/** The answers by question id: text, a number, option ids (choice), upload ids (file), an address object, or null */
|
|
979
|
+
values: FormAnswers;
|
|
980
|
+
/** Sets a question's answer. `submit()` and `validateField()` called right after it, in the same handler, already see the new value */
|
|
981
|
+
setValue: (fieldId: string, value: FormAnswerValue) => void;
|
|
982
|
+
/** What the visitor typed for the "Other" option of a choice question that allows it (the option id is `__other__`) */
|
|
983
|
+
otherText: Record<string, string>;
|
|
984
|
+
setOtherText: (fieldId: string, text: string) => void;
|
|
985
|
+
/** Error codes by question id, after a blur or a submit; `errorMessage` turns one into text */
|
|
986
|
+
errors: Record<string, FormAnswerErrorCode>;
|
|
987
|
+
/** The error of a question in the site's language, or undefined */
|
|
988
|
+
errorMessage: (fieldId: string) => string | undefined;
|
|
989
|
+
/** Checks one question now (the inputs from `getInputProps` do this on blur); a required question left empty is only flagged on submit */
|
|
990
|
+
validateField: (fieldId: string) => void;
|
|
991
|
+
/**
|
|
992
|
+
* Props for a text-like question's input. The `id` is the one the hook focuses when a submit finds this question invalid, so use it
|
|
993
|
+
* as is (and point your `<label htmlFor>` at it).
|
|
994
|
+
*/
|
|
995
|
+
getInputProps: (fieldId: string) => KanorioFormInputProps;
|
|
996
|
+
/** Props for the element that shows a question's error (its id is the input's `aria-describedby`) */
|
|
997
|
+
getErrorProps: (fieldId: string) => {
|
|
998
|
+
id: string;
|
|
999
|
+
role: "alert";
|
|
1000
|
+
};
|
|
1001
|
+
/** Spread onto your `<form>`: validates and submits, and starts the bot protection when the visitor first focuses the form */
|
|
1002
|
+
formProps: {
|
|
1003
|
+
ref: (element: HTMLElement | null) => void;
|
|
1004
|
+
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
1005
|
+
onFocus: () => void;
|
|
1006
|
+
noValidate: true;
|
|
1007
|
+
};
|
|
1008
|
+
/**
|
|
1009
|
+
* The honeypot fields and the site's check (the ALTCHA box, or the Turnstile, reCAPTCHA or hCaptcha widget the site owner chose).
|
|
1010
|
+
* Render it inside your `<form>`, before the submit button. Its colours follow `light` or `dark` set on the surrounding `KanorioProvider`.
|
|
1011
|
+
*/
|
|
1012
|
+
botProtection: ReactNode;
|
|
1013
|
+
/**
|
|
1014
|
+
* The marketing consent the form collects. `checkbox`: draw a checkbox with `text` and bind `checked`/`setChecked`. `submit`: show
|
|
1015
|
+
* `text` next to the submit button (submitting is the consent). `off`: nothing to show. The submission reports what the visitor saw.
|
|
1016
|
+
*/
|
|
1017
|
+
consent: {
|
|
1018
|
+
mode: "off" | "checkbox" | "submit";
|
|
1019
|
+
text: string | null;
|
|
1020
|
+
checked: boolean;
|
|
1021
|
+
setChecked: (checked: boolean) => void;
|
|
1022
|
+
};
|
|
1023
|
+
/** False while the form cannot be submitted: loading, closed, submitting, an attachment still uploading or the bot protection not passed yet */
|
|
1024
|
+
canSubmit: boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Validates and submits (what `formProps.onSubmit` does) the latest answers, including those set earlier in the same handler (a
|
|
1027
|
+
* rating that submits when clicked); does nothing while `canSubmit` is false, while a submit is in progress or after a successful
|
|
1028
|
+
* one (a second call in the same handler sends nothing), or while an upload started with `uploadFile` is still running
|
|
1029
|
+
*/
|
|
1030
|
+
submit: () => Promise<void>;
|
|
1031
|
+
/** Why the last submit failed for the whole form (`duplicate`, `rate_limited`, `verification_expired`, `outdated`…); the answers are kept */
|
|
1032
|
+
submitError: FormControllerSubmitError | null;
|
|
1033
|
+
/** `submitError` in the site's language */
|
|
1034
|
+
submitErrorMessage: string | null;
|
|
1035
|
+
/** After a successful submit: the submission id, and the URL the form goes to next when it has one */
|
|
1036
|
+
result: {
|
|
1037
|
+
submissionId?: string;
|
|
1038
|
+
redirectUrl?: string;
|
|
1039
|
+
} | null;
|
|
1040
|
+
/** The form's success message, or the default one in the site's language */
|
|
1041
|
+
successMessage: string;
|
|
1042
|
+
/** True once attachments can be uploaded (the bot protection has passed) */
|
|
1043
|
+
uploadReady: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Uploads a file to a `file` question and adds its upload id to the question's value. `onProgress` reports 0 to 1. While an upload
|
|
1046
|
+
* runs the form cannot be submitted: `canSubmit` is false and `submit()` does nothing, also when it is called in the same handler
|
|
1047
|
+
* right after `uploadFile` (await the upload first). Abort `signal` when the visitor removes the file; an upload that makes no
|
|
1048
|
+
* progress for 30 seconds ends with `failed`. Calling it counts as the visitor's first interaction, as focusing a question does.
|
|
1049
|
+
*/
|
|
1050
|
+
uploadFile: (fieldId: string, file: File, options?: {
|
|
1051
|
+
onProgress?: (ratio: number) => void;
|
|
1052
|
+
signal?: AbortSignal;
|
|
1053
|
+
}) => Promise<KanorioFormUploadResult>;
|
|
1054
|
+
/** Looks up a `tax_id` question's number in the public registry; null when it cannot be looked up (yet) */
|
|
1055
|
+
lookupTaxId: (fieldId: string, input: {
|
|
1056
|
+
country: string;
|
|
1057
|
+
type: string;
|
|
1058
|
+
value: string;
|
|
1059
|
+
}) => Promise<TaxIdLookupResponse | null>;
|
|
1060
|
+
/** The form's interface text in the site's language, with your `labels` on top */
|
|
1061
|
+
labels: Required<FormSectionLabels>;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* The state, validation and submission of a Kanorio form, for a form UI you build yourself. It reads the form from
|
|
1065
|
+
* `{siteUrl}/api/v1/forms/{formId}` (or takes `definition`) and the site's bot-protection settings from `GET /site`, and submits to
|
|
1066
|
+
* `POST {siteUrl}/api/v1/forms/{formId}/submit`: the same conditions, validation rules, error text, consent record, bot protection,
|
|
1067
|
+
* lifecycle events and redirect as `<KanorioForm>`. Text follows the site's language.
|
|
1068
|
+
*
|
|
1069
|
+
* Draw every question in `fields`. A required question you leave out still fails validation on submit; it has no input to focus and
|
|
1070
|
+
* no message to show, so the button seems to do nothing (`errors` lists the questions that blocked the submit).
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* ```tsx
|
|
1074
|
+
* const form = useKanorioForm({ formId });
|
|
1075
|
+
* if (form.status === "loading") return null;
|
|
1076
|
+
* if (form.status === "unavailable") return <p>{form.labels.temporarilyUnavailable}</p>;
|
|
1077
|
+
* if (form.status === "success") return <p>{form.successMessage}</p>;
|
|
1078
|
+
* if (form.availability !== "open") return <p>{form.labels.closed}</p>;
|
|
1079
|
+
* return (
|
|
1080
|
+
* <form {...form.formProps}>
|
|
1081
|
+
* {form.fields.map((field) => {
|
|
1082
|
+
* if (field.type === "statement") return <p key={field.id}>{field.label}</p>;
|
|
1083
|
+
* // This example draws text-like questions only. Draw every type your form uses: a required question left out blocks the submit
|
|
1084
|
+
* // with nothing to show (see `errors`)
|
|
1085
|
+
* if (field.type !== "short_text" && field.type !== "email" && field.type !== "long_text") return null;
|
|
1086
|
+
* const input = form.getInputProps(field.id);
|
|
1087
|
+
* return (
|
|
1088
|
+
* <div key={field.id}>
|
|
1089
|
+
* <label htmlFor={input.id}>{field.label}</label>
|
|
1090
|
+
* {field.type === "long_text" ? <textarea {...input} /> : <input {...input} />}
|
|
1091
|
+
* {form.errorMessage(field.id) && <p {...form.getErrorProps(field.id)}>{form.errorMessage(field.id)}</p>}
|
|
1092
|
+
* </div>
|
|
1093
|
+
* );
|
|
1094
|
+
* })}
|
|
1095
|
+
* {form.consent.mode === "checkbox" && (
|
|
1096
|
+
* <label>
|
|
1097
|
+
* <input type="checkbox" checked={form.consent.checked} onChange={(e) => form.consent.setChecked(e.target.checked)} />
|
|
1098
|
+
* {form.consent.text}
|
|
1099
|
+
* </label>
|
|
1100
|
+
* )}
|
|
1101
|
+
* {form.botProtection}
|
|
1102
|
+
* {form.submitErrorMessage && <p role="alert">{form.submitErrorMessage}</p>}
|
|
1103
|
+
* <button type="submit" disabled={!form.canSubmit}>{form.definition?.settings.submitLabel || form.labels.submit}</button>
|
|
1104
|
+
* {form.consent.mode === "submit" && <p>{form.consent.text}</p>}
|
|
1105
|
+
* </form>
|
|
1106
|
+
* );
|
|
1107
|
+
* ```
|
|
1108
|
+
*/
|
|
1109
|
+
declare function useKanorioForm(options: UseKanorioFormOptions): KanorioFormState;
|
|
1110
|
+
|
|
741
1111
|
interface KanorioFormProps extends KanorioConfig {
|
|
742
1112
|
/** Form id (c...) */
|
|
743
1113
|
formId: string;
|
|
@@ -772,4 +1142,4 @@ interface KanorioFormProps extends KanorioConfig {
|
|
|
772
1142
|
}
|
|
773
1143
|
declare function KanorioForm({ formId, definition: initialDefinition, maxColumns, siteName, labels, onSuccess, followRedirect, hiddenValues, className, ...config }: KanorioFormProps): react_jsx_runtime.JSX.Element;
|
|
774
1144
|
|
|
775
|
-
export { KanorioForm, type KanorioFormProps };
|
|
1145
|
+
export { KanorioForm, type KanorioFormInputProps, type KanorioFormProps, type KanorioFormState, type KanorioFormUploadResult, type UseKanorioFormOptions, useKanorioForm };
|
package/dist/form.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{KanorioForm}from"./chunk-
|
|
1
|
+
import{KanorioForm,useKanorioForm}from"./chunk-SB5665ZK.js";import"./chunk-D4KDA3KL.js";import"./chunk-QF55WZDP.js";import"./chunk-SVWEVSYJ.js";import"./chunk-APWDEDWM.js";import"./chunk-RG5JA44V.js";import"./chunk-FFAWYDLJ.js";import"./chunk-E77WGXYW.js";import"./chunk-C7HUM2EN.js";import{FORM_SUBMIT_EVENT}from"./chunk-LWKCGUHS.js";import"./chunk-TEUQV3AT.js";import{KanorioBotProtection,KanorioBotProtectionAltcha,useKanorioBotProtection}from"./chunk-J5SMJRYC.js";import"./chunk-KYXZNMNA.js";import"./chunk-RKEHHJDU.js";import"./chunk-JH5D6YJX.js";import"./chunk-4BEKWYEW.js";import"./chunk-OIKRLEW6.js";import"./chunk-O2SYHUQF.js";import"./chunk-33AQQY6T.js";import"./chunk-VUTODQFX.js";import"./chunk-QRKYFFDH.js";import"./chunk-KNNN5V3T.js";import"./chunk-763LNERD.js";import"./chunk-U7H3W23Q.js";import"./chunk-RI64PHGM.js";import"./chunk-Q4APVE7S.js";import"./chunk-CU2JJTXI.js";import"./chunk-3ZTUZPSD.js";export{FORM_SUBMIT_EVENT,KanorioBotProtection,KanorioBotProtectionAltcha,KanorioForm,useKanorioBotProtection,useKanorioForm};
|
|
2
2
|
//# sourceMappingURL=form.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{findAddressIssues,isAddressCountry,isBlankAddress,normalizePostalAddress}from"./chunk-GMW7AUSG.js";import{answerFail,answerOk}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=forms-answers-address-
|
|
1
|
+
import{findAddressIssues,isAddressCountry,isBlankAddress,normalizePostalAddress}from"./chunk-GMW7AUSG.js";import{answerFail,answerOk}from"./chunk-D4KDA3KL.js";import"./chunk-APWDEDWM.js";import"./chunk-FFAWYDLJ.js";import"./chunk-3ZTUZPSD.js";var validateAddressAnswer=(field,raw)=>{const address=normalizePostalAddress(raw);if(!address||isBlankAddress(address))return field.required?answerFail("required"):answerOk(null);if(!isAddressCountry(address.countryCode))return answerFail("invalid_address");if(field.countries.length>0&&!field.countries.includes(address.countryCode))return answerFail("invalid_address");const{recipientName,...rest}=address;const issues=findAddressIssues(address);if(issues.missing.length>0||field.askRecipientName&&!recipientName)return answerFail("invalid_address");if(issues.postalCode)return answerFail("invalid_postal_code");return answerOk(field.askRecipientName?address:rest)};export{validateAddressAnswer};
|
|
2
|
+
//# sourceMappingURL=forms-answers-address-5MXQYIH3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=forms-answers-address-
|
|
1
|
+
import{c as n,e as d,f as t,g as o}from"./chunk-K2XZKV3Q.js";import{h as i,i as e}from"./chunk-VGQ2N7JH.js";import"./chunk-2H3LTDAA.js";import"./chunk-UM74DXPE.js";import"./chunk-CDG7S4P5.js";var v=(r,l)=>{let s=d(l);if(!s||t(s))return r.required?e("required"):i(null);if(!n(s.countryCode))return e("invalid_address");if(r.countries.length>0&&!r.countries.includes(s.countryCode))return e("invalid_address");let{recipientName:u,...c}=s,a=o(s);return a.missing.length>0||r.askRecipientName&&!u?e("invalid_address"):a.postalCode?e("invalid_postal_code"):i(r.askRecipientName?s:c)};export{v as validateAddressAnswer};
|
|
2
|
+
//# sourceMappingURL=forms-answers-address-BGBI445K.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{taxIdCountriesOf,validateTaxIdFormat}from"./chunk-VKSYPXNL.js";import{answerFail,answerOk}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=forms-answers-tax-id-
|
|
1
|
+
import{taxIdCountriesOf,validateTaxIdFormat}from"./chunk-VKSYPXNL.js";import{answerFail,answerOk}from"./chunk-D4KDA3KL.js";import{isFormTaxIdAnswer}from"./chunk-APWDEDWM.js";import"./chunk-FFAWYDLJ.js";import"./chunk-3ZTUZPSD.js";var validateTaxIdAnswer=(field,raw)=>{const input=isFormTaxIdAnswer(raw)?raw:null;const value=input?.value.trim()??"";if(!input||!value)return field.required?answerFail("required"):answerOk(null);if(value.length>64)return answerFail("invalid_tax_id");const countryCode=input.countryCode.toUpperCase();if(!taxIdCountriesOf(field).includes(countryCode))return answerFail("invalid_tax_id");const format=validateTaxIdFormat({country:countryCode,value});if(!format.type)return answerFail("invalid_tax_id");if(!format.ok&&format.enforcement==="block")return answerFail("invalid_tax_id");return answerOk({countryCode,type:format.type,value:format.normalized||value})};export{validateTaxIdAnswer};
|
|
2
|
+
//# sourceMappingURL=forms-answers-tax-id-3AYXCNP5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=forms-answers-tax-id-
|
|
1
|
+
import{c as u,d as s}from"./chunk-PR2NRUEI.js";import{h as o,i as r}from"./chunk-VGQ2N7JH.js";import{j as d}from"./chunk-2H3LTDAA.js";import"./chunk-UM74DXPE.js";import"./chunk-CDG7S4P5.js";var v=(n,l)=>{let i=d(l)?l:null,e=i?.value.trim()??"";if(!i||!e)return n.required?r("required"):o(null);if(e.length>64)return r("invalid_tax_id");let a=i.countryCode.toUpperCase();if(!s(n).includes(a))return r("invalid_tax_id");let t=u({country:a,value:e});return t.type?!t.ok&&t.enforcement==="block"?r("invalid_tax_id"):o({countryCode:a,type:t.type,value:t.normalized||e}):r("invalid_tax_id")};export{v as validateTaxIdAnswer};
|
|
2
|
+
//# sourceMappingURL=forms-answers-tax-id-LSWOEHJ4.js.map
|