@prosopo/procaptcha-bundle 2.5.1 → 2.5.5
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/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +4 -4
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js +4 -4
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +3 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js +86 -18
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +28 -33
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +11 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +6 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha/componentsList.js → captcha/captchaComponentsList.js} +3 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha/captcha.d.ts → captcha/captchaProps.d.ts} +3 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +2 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +24 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +48 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/{dist/util/renderLogic → .rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util}/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -19
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +5 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +24 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +18 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +62 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +9 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +1 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +19 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +1 -0
- package/dist/bundle/ProcaptchaWidget-CCSN3Dxj.js +636 -0
- package/dist/bundle/ProcaptchaWidget-Dfex8hc8.js +156 -0
- package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/bundle/{asU8a-Br9wz334.js → asU8a-CAsEnbuP.js} +1 -1
- package/dist/bundle/{bip39-BtaWByKg.js → bip39-DCaMcFzo.js} +2 -2
- package/dist/bundle/{browser-ponyfill-Ck_bwPOY.js → browser-ponyfill-Dy1JBTMg.js} +20 -20
- package/dist/bundle/captchaComponentProvider-Dm44AMrY.js +1018 -0
- package/dist/bundle/captchaRenderer-BBodRhQu.js +70 -0
- package/dist/bundle/components.d.ts +4 -4
- package/dist/bundle/components.d.ts.map +1 -1
- package/dist/bundle/emotion-element-5486c51c.browser.esm-CQHFV-dS.js +1803 -0
- package/dist/bundle/{fp.esm-C0kLYOiJ.js → fp.esm-DYWeNGcH.js} +17 -0
- package/dist/bundle/{hash-KElfghPn.js → hash-D-64Vz5z.js} +1 -1
- package/dist/bundle/i18nFrontend-C_RgmvGh.js +2273 -0
- package/dist/bundle/index-9I1Aae33.js +5416 -0
- package/dist/bundle/index-DCHEbWAs.js +1242 -0
- package/dist/bundle/{index-B0trzdT2.js → index-DkQ4njKa.js} +17 -16
- package/dist/bundle/index-DxswvPTy.js +606 -0
- package/dist/bundle/{index-Cb-XcaMX.js → index-nNwZuute.js} +256 -255
- package/dist/bundle/index.d.ts +3 -1
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/locales/de/translation.json +55 -404
- package/dist/bundle/locales/en/translation.json +55 -404
- package/dist/bundle/locales/es/translation.json +55 -404
- package/dist/bundle/locales/fr/translation.json +55 -404
- package/dist/bundle/locales/it/translation.json +55 -404
- package/dist/bundle/locales/pt/translation.json +55 -404
- package/dist/bundle/locales/pt-BR/translation.json +55 -404
- package/dist/bundle/procaptcha.bundle.js +4 -3
- package/dist/bundle/translations-B0P9axY3.js +2885 -0
- package/dist/bundle/useTranslation-CEt2t9kE.js +158 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts +6 -0
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/{util/renderLogic/captcha/captcha.d.ts → bundle/util/captcha/captchaProps.d.ts} +3 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +24 -0
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/bundle/util/config.d.ts +0 -2
- package/dist/bundle/util/config.d.ts.map +1 -1
- package/dist/bundle/util/configCreator.d.ts +5 -0
- package/dist/bundle/util/configCreator.d.ts.map +1 -0
- package/dist/bundle/util/widgetFactory.d.ts +18 -0
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -0
- package/dist/bundle/util/widgetThemeResolver.d.ts +9 -0
- package/dist/bundle/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/components.d.ts +4 -4
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +4 -4
- package/dist/components.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -18
- package/dist/index.js.map +1 -1
- package/dist/tests/util/captchaType.test.js +1 -1
- package/dist/tests/util/captchaType.test.js.map +1 -1
- package/dist/tests/util/renderLogic.test.js +28 -33
- package/dist/tests/util/renderLogic.test.js.map +1 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts +8 -0
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/util/captcha/captchaComponentProvider.js +11 -0
- package/dist/util/captcha/captchaComponentProvider.js.map +1 -0
- package/dist/util/captcha/captchaComponentsList.d.ts +6 -0
- package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha/componentsList.js → captcha/captchaComponentsList.js} +3 -3
- package/dist/util/captcha/captchaComponentsList.js.map +1 -0
- package/dist/{bundle/util/renderLogic/captcha/captcha.d.ts → util/captcha/captchaProps.d.ts} +3 -1
- package/dist/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/util/captcha/captchaProps.js +2 -0
- package/dist/util/captcha/captchaProps.js.map +1 -0
- package/dist/util/captcha/captchaRenderer.d.ts +24 -0
- package/dist/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/util/captcha/captchaRenderer.js +48 -0
- package/dist/util/captcha/captchaRenderer.js.map +1 -0
- package/dist/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/util/captcha/captchaType.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/frictionlessCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/{.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic → dist/util}/captcha/components/frictionlessCaptcha.js +2 -2
- package/dist/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/imageCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/imageCaptcha.js +2 -2
- package/dist/util/captcha/components/imageCaptcha.js.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/powCaptcha.d.ts +1 -1
- package/dist/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/util/{renderLogic/captcha → captcha}/components/powCaptcha.js +2 -2
- package/dist/util/captcha/components/powCaptcha.js.map +1 -0
- package/dist/util/config.d.ts +0 -2
- package/dist/util/config.d.ts.map +1 -1
- package/dist/util/config.js +0 -19
- package/dist/util/config.js.map +1 -1
- package/dist/util/configCreator.d.ts +5 -0
- package/dist/util/configCreator.d.ts.map +1 -0
- package/dist/util/configCreator.js +24 -0
- package/dist/util/configCreator.js.map +1 -0
- package/dist/util/widgetFactory.d.ts +18 -0
- package/dist/util/widgetFactory.d.ts.map +1 -0
- package/dist/util/widgetFactory.js +62 -0
- package/dist/util/widgetFactory.js.map +1 -0
- package/dist/util/widgetThemeResolver.d.ts +9 -0
- package/dist/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/util/widgetThemeResolver.js +19 -0
- package/dist/util/widgetThemeResolver.js.map +1 -0
- package/package.json +20 -13
- package/stats.html +1 -1
- package/vite.cjs.config.ts +1 -1
- package/vite.config.ts +19 -4
- package/vite.serve.config.ts +24 -0
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captchaType.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captchaType.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.js +0 -2
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.js +0 -11
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/captchaRenderer.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/components/powCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/captcha/componentsList.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.d.ts +0 -8
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.js +0 -29
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/webComponent.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.js +0 -52
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic/widgetRenderer.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.d.ts +0 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js +0 -14
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.d.ts +0 -3
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.d.ts.map +0 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.js +0 -9
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/theme.js.map +0 -1
- package/dist/bundle/ProcaptchaWidget-CAyH6qD7.js +0 -161
- package/dist/bundle/ProcaptchaWidget-CY3qomFu.js +0 -619
- package/dist/bundle/index-VYSrdSle.js +0 -11587
- package/dist/bundle/index-n-2hvBzo.js +0 -1190
- package/dist/bundle/useTranslation-CcYxvTxi.js +0 -2435
- package/dist/bundle/util/captchaType.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/dist/bundle/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/dist/bundle/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/webComponent.d.ts +0 -8
- package/dist/bundle/util/renderLogic/webComponent.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/dist/bundle/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/dist/bundle/util/renderLogic.d.ts +0 -3
- package/dist/bundle/util/renderLogic.d.ts.map +0 -1
- package/dist/bundle/util/theme.d.ts +0 -3
- package/dist/bundle/util/theme.d.ts.map +0 -1
- package/dist/util/captchaType.d.ts.map +0 -1
- package/dist/util/captchaType.js.map +0 -1
- package/dist/util/renderLogic/captcha/captcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/captcha.js +0 -2
- package/dist/util/renderLogic/captcha/captcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/captchaRenderer.d.ts +0 -8
- package/dist/util/renderLogic/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/captchaRenderer.js +0 -11
- package/dist/util/renderLogic/captcha/captchaRenderer.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/imageCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/components/powCaptcha.js.map +0 -1
- package/dist/util/renderLogic/captcha/componentsList.d.ts +0 -6
- package/dist/util/renderLogic/captcha/componentsList.d.ts.map +0 -1
- package/dist/util/renderLogic/captcha/componentsList.js.map +0 -1
- package/dist/util/renderLogic/webComponent.d.ts +0 -8
- package/dist/util/renderLogic/webComponent.d.ts.map +0 -1
- package/dist/util/renderLogic/webComponent.js +0 -29
- package/dist/util/renderLogic/webComponent.js.map +0 -1
- package/dist/util/renderLogic/widgetRenderer.d.ts +0 -23
- package/dist/util/renderLogic/widgetRenderer.d.ts.map +0 -1
- package/dist/util/renderLogic/widgetRenderer.js +0 -52
- package/dist/util/renderLogic/widgetRenderer.js.map +0 -1
- package/dist/util/renderLogic.d.ts +0 -3
- package/dist/util/renderLogic.d.ts.map +0 -1
- package/dist/util/renderLogic.js +0 -14
- package/dist/util/renderLogic.js.map +0 -1
- package/dist/util/theme.d.ts +0 -3
- package/dist/util/theme.d.ts.map +0 -1
- package/dist/util/theme.js +0 -9
- package/dist/util/theme.js.map +0 -1
- /package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/{captchaType.js → captcha/captchaType.js} +0 -0
- /package/dist/bundle/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/dist/util/{captchaType.d.ts → captcha/captchaType.d.ts} +0 -0
- /package/dist/util/{captchaType.js → captcha/captchaType.js} +0 -0
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
3
|
-
import { ProcaptchaConfigSchema } from "@prosopo/types";
|
|
3
|
+
import { ProcaptchaConfigSchema, } from "@prosopo/types";
|
|
4
4
|
import { JSDOM } from "jsdom";
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
|
-
import {
|
|
6
|
+
import { WidgetFactory } from "../../util/widgetFactory.js";
|
|
7
|
+
import { WidgetThemeResolver } from "../../util/widgetThemeResolver.js";
|
|
8
|
+
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
9
|
+
const callbacks = {
|
|
10
|
+
onHuman: () => console.log("onHuman"),
|
|
11
|
+
onChallengeExpired: () => console.log("onChallengeExpired"),
|
|
12
|
+
onExpired: () => console.log("onExpired"),
|
|
13
|
+
onError: () => console.log("onError"),
|
|
14
|
+
onClose: () => console.log("onClose"),
|
|
15
|
+
onOpen: () => console.log("onOpen"),
|
|
16
|
+
onFailed: () => console.log("onFailed"),
|
|
17
|
+
onReset: () => console.log("onReset"),
|
|
18
|
+
onExtensionNotFound: () => console.log("onExtensionNotFound"),
|
|
19
|
+
onReload: () => console.log("onReload"),
|
|
20
|
+
};
|
|
7
21
|
vi.mock("@prosopo/detector", async () => {
|
|
8
22
|
return {
|
|
9
23
|
isBot: async () => {
|
|
@@ -59,10 +73,7 @@ describe("Config utility functions", () => {
|
|
|
59
73
|
expect(true).toBe(false);
|
|
60
74
|
return;
|
|
61
75
|
}
|
|
62
|
-
|
|
63
|
-
account: { address: "1234" },
|
|
64
|
-
});
|
|
65
|
-
renderLogic([script], config, {
|
|
76
|
+
await widgetFactory.createWidgets([script], {
|
|
66
77
|
siteKey: "1234",
|
|
67
78
|
captchaType: "pow",
|
|
68
79
|
});
|
|
@@ -82,41 +93,25 @@ describe("Config utility functions", () => {
|
|
|
82
93
|
script["data-failed-callback"] = "onFailed";
|
|
83
94
|
script["data-reset-callback"] = "onReset";
|
|
84
95
|
document.body.appendChild(script);
|
|
85
|
-
const onHuman = () => console.log("onHuman");
|
|
86
|
-
const onChallengeExpired = () => console.log("onChallengeExpired");
|
|
87
|
-
const onExpired = () => console.log("onExpired");
|
|
88
|
-
const onError = () => console.log("onError");
|
|
89
|
-
const onClose = () => console.log("onClose");
|
|
90
|
-
const onOpen = () => console.log("onOpen");
|
|
91
|
-
const onFailed = () => console.log("onFailed");
|
|
92
|
-
const onReset = () => console.log("onReset");
|
|
93
96
|
expect(ctx.window).toBeDefined();
|
|
94
97
|
if (!ctx.window) {
|
|
95
98
|
expect(true).toBe(false);
|
|
96
99
|
return;
|
|
97
100
|
}
|
|
98
|
-
ctx.window.onHuman = onHuman;
|
|
99
|
-
ctx.window.onChallengeExpired = onChallengeExpired;
|
|
100
|
-
ctx.window.onExpired = onExpired;
|
|
101
|
-
ctx.window.onError = onError;
|
|
102
|
-
ctx.window.onClose = onClose;
|
|
103
|
-
ctx.window.onOpen = onOpen;
|
|
104
|
-
ctx.window.onFailed = onFailed;
|
|
105
|
-
ctx.window.onReset = onReset;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onChallengeExpired,
|
|
109
|
-
onExpired,
|
|
110
|
-
onError,
|
|
111
|
-
onClose,
|
|
112
|
-
onOpen,
|
|
113
|
-
onFailed,
|
|
114
|
-
onReset,
|
|
115
|
-
};
|
|
101
|
+
ctx.window.onHuman = callbacks.onHuman;
|
|
102
|
+
ctx.window.onChallengeExpired = callbacks.onChallengeExpired;
|
|
103
|
+
ctx.window.onExpired = callbacks.onExpired;
|
|
104
|
+
ctx.window.onError = callbacks.onError;
|
|
105
|
+
ctx.window.onClose = callbacks.onClose;
|
|
106
|
+
ctx.window.onOpen = callbacks.onOpen;
|
|
107
|
+
ctx.window.onFailed = callbacks.onFailed;
|
|
108
|
+
ctx.window.onReset = callbacks.onReset;
|
|
109
|
+
ctx.window.onExtensionNotFound = callbacks.onExtensionNotFound;
|
|
110
|
+
ctx.window.onReload = callbacks.onReload;
|
|
116
111
|
const config = ProcaptchaConfigSchema.parse({
|
|
117
112
|
account: { address: "1234" },
|
|
118
113
|
});
|
|
119
|
-
|
|
114
|
+
await widgetFactory.createWidgets([script], {
|
|
120
115
|
siteKey: "1234",
|
|
121
116
|
captchaType: "pow",
|
|
122
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderLogic.test.js","sourceRoot":"","sources":["../../../src/tests/util/renderLogic.test.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,
|
|
1
|
+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Props } from "./captchaProps.js";
|
|
4
|
+
declare class CaptchaComponentProvider {
|
|
5
|
+
getCaptchaComponent(captchaType: CaptchaType, captchaProps: CaptchaProps): ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export { CaptchaComponentProvider };
|
|
8
|
+
//# sourceMappingURL=captchaComponentProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentProvider.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,cAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GACxB,SAAS;CAaZ;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { captchaComponentsList } from "./captchaComponentsList.js";
|
|
3
|
+
class CaptchaComponentProvider {
|
|
4
|
+
getCaptchaComponent(captchaType, captchaProps) {
|
|
5
|
+
const CaptchaComponent = captchaComponentsList[captchaType];
|
|
6
|
+
console.log(`rendering ${captchaType}`);
|
|
7
|
+
return (_jsx(CaptchaComponent, { config: captchaProps.config, callbacks: captchaProps.callbacks, i18n: captchaProps.i18n }));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export { CaptchaComponentProvider };
|
|
11
|
+
//# sourceMappingURL=captchaComponentProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentProvider.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAwB,EACxB,YAA0B;QAE1B,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAE5D,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,EAAE,CAAC,CAAC;QAExC,OAAO,CACN,KAAC,gBAAgB,IAChB,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,IAAI,EAAE,YAAY,CAAC,IAAI,GACtB,CACF,CAAC;IACH,CAAC;CACD;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CaptchaType } from "@prosopo/types";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { CaptchaProps } from "./captchaProps.js";
|
|
4
|
+
declare const captchaComponentsList: Record<CaptchaType, React.ComponentType<CaptchaProps>>;
|
|
5
|
+
export { captchaComponentsList };
|
|
6
|
+
//# sourceMappingURL=captchaComponentsList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentsList.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,QAAA,MAAM,qBAAqB,EAAE,MAAM,CAClC,WAAW,EACX,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAKjC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/util/{renderLogic/captcha/componentsList.js → captcha/captchaComponentsList.js}
RENAMED
|
@@ -2,10 +2,10 @@ import { CaptchaType } from "@prosopo/types";
|
|
|
2
2
|
import { FrictionlessCaptcha } from "./components/frictionlessCaptcha.js";
|
|
3
3
|
import { ImageCaptcha } from "./components/imageCaptcha.js";
|
|
4
4
|
import { PowCaptcha } from "./components/powCaptcha.js";
|
|
5
|
-
const
|
|
5
|
+
const captchaComponentsList = {
|
|
6
6
|
[CaptchaType.image]: ImageCaptcha,
|
|
7
7
|
[CaptchaType.pow]: PowCaptcha,
|
|
8
8
|
[CaptchaType.frictionless]: FrictionlessCaptcha,
|
|
9
9
|
};
|
|
10
|
-
export {
|
|
11
|
-
//# sourceMappingURL=
|
|
10
|
+
export { captchaComponentsList };
|
|
11
|
+
//# sourceMappingURL=captchaComponentsList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentsList.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,qBAAqB,GAGvB;IACH,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY;IACjC,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,UAAU;IAC7B,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,mBAAmB;CAC/C,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/{bundle/util/renderLogic/captcha/captcha.d.ts → util/captcha/captchaProps.d.ts}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { Ti18n } from "@prosopo/locale";
|
|
1
2
|
import type { ProcaptchaCallbacks, ProcaptchaClientConfigInput } from "@prosopo/types";
|
|
2
3
|
interface CaptchaProps {
|
|
3
4
|
config: ProcaptchaClientConfigInput;
|
|
4
5
|
callbacks: ProcaptchaCallbacks;
|
|
6
|
+
i18n: Ti18n;
|
|
5
7
|
}
|
|
6
8
|
export type { CaptchaProps };
|
|
7
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=captchaProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaProps.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaProps.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,gBAAgB,CAAC;AAExB,UAAU,YAAY;IACrB,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;CACZ;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaProps.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type EmotionCache } from "@emotion/cache";
|
|
2
|
+
import type { Ti18n } from "@prosopo/locale";
|
|
3
|
+
import type { Callbacks, ProcaptchaClientConfigOutput, ProcaptchaRenderOptions } from "@prosopo/types";
|
|
4
|
+
import type { CaptchaType } from "@prosopo/types";
|
|
5
|
+
import type { ReactNode } from "react";
|
|
6
|
+
import { type Root } from "react-dom/client";
|
|
7
|
+
import type { CaptchaComponentProvider } from "./captchaComponentProvider.js";
|
|
8
|
+
interface RenderSettings {
|
|
9
|
+
identifierPrefix: string;
|
|
10
|
+
emotionCacheKey: string;
|
|
11
|
+
webComponentTag: string;
|
|
12
|
+
defaultCaptchaType: CaptchaType;
|
|
13
|
+
}
|
|
14
|
+
declare class CaptchaRenderer {
|
|
15
|
+
private readonly captchaComponentProvider;
|
|
16
|
+
constructor(captchaComponentProvider: CaptchaComponentProvider);
|
|
17
|
+
renderCaptcha(settings: RenderSettings, container: HTMLElement, renderOptions: ProcaptchaRenderOptions, callbacks: Callbacks, isWeb2: boolean, i18n: Ti18n, invisible?: boolean): Root;
|
|
18
|
+
protected readAndValidateSettings(element: Element, config: ProcaptchaClientConfigOutput, renderOptions: ProcaptchaRenderOptions): void;
|
|
19
|
+
protected makeEmotionCache(cacheKey: string, container: HTMLElement): EmotionCache;
|
|
20
|
+
protected createReactRoot(container: HTMLElement, identifierPrefix: string): Root;
|
|
21
|
+
protected renderCaptchaComponent(reactRoot: Root, emotionCache: EmotionCache, captchaComponent: ReactNode): void;
|
|
22
|
+
}
|
|
23
|
+
export { CaptchaRenderer };
|
|
24
|
+
//# sourceMappingURL=captchaRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaRenderer.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaRenderer.tsx"],"names":[],"mappings":"AAcA,OAAoB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACX,SAAS,EACT,4BAA4B,EAC5B,uBAAuB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,kBAAkB,CAAC;AAIzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,UAAU,cAAc;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,WAAW,CAAC;CAChC;AAED,cAAM,eAAe;IACpB,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;gBAExD,wBAAwB,EAAE,wBAAwB;IAIvD,aAAa,CACnB,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,uBAAuB,EACtC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,KAAK,EACX,SAAS,UAAQ,GACf,IAAI;IAsCP,SAAS,CAAC,uBAAuB,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,4BAA4B,EACpC,aAAa,EAAE,uBAAuB,GACpC,IAAI;IAKP,SAAS,CAAC,gBAAgB,CACzB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,WAAW,GACpB,YAAY;IAQf,SAAS,CAAC,eAAe,CACxB,SAAS,EAAE,WAAW,EACtB,gBAAgB,EAAE,MAAM,GACtB,IAAI;IAMP,SAAS,CAAC,sBAAsB,CAC/B,SAAS,EAAE,IAAI,EACf,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,SAAS,GACzB,IAAI;CAKP;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import createCache from "@emotion/cache";
|
|
3
|
+
import { CacheProvider } from "@emotion/react";
|
|
4
|
+
import { createRoot } from "react-dom/client";
|
|
5
|
+
import { createConfig } from "../configCreator.js";
|
|
6
|
+
import { setLanguage } from "../language.js";
|
|
7
|
+
import { setValidChallengeLength } from "../timeout.js";
|
|
8
|
+
class CaptchaRenderer {
|
|
9
|
+
constructor(captchaComponentProvider) {
|
|
10
|
+
this.captchaComponentProvider = captchaComponentProvider;
|
|
11
|
+
}
|
|
12
|
+
renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible = false) {
|
|
13
|
+
const captchaType = renderOptions?.captchaType ||
|
|
14
|
+
settings.defaultCaptchaType;
|
|
15
|
+
const config = createConfig(renderOptions.siteKey, renderOptions.theme, renderOptions.language, isWeb2, invisible);
|
|
16
|
+
this.readAndValidateSettings(container, config, renderOptions);
|
|
17
|
+
const reactRoot = this.createReactRoot(container, settings.identifierPrefix);
|
|
18
|
+
const emotionCache = this.makeEmotionCache(settings.emotionCacheKey, container);
|
|
19
|
+
const captchaComponent = this.captchaComponentProvider.getCaptchaComponent(captchaType, {
|
|
20
|
+
config: config,
|
|
21
|
+
i18n: i18n,
|
|
22
|
+
callbacks,
|
|
23
|
+
});
|
|
24
|
+
this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
|
|
25
|
+
return reactRoot;
|
|
26
|
+
}
|
|
27
|
+
readAndValidateSettings(element, config, renderOptions) {
|
|
28
|
+
setValidChallengeLength(renderOptions, element, config);
|
|
29
|
+
setLanguage(renderOptions, element, config);
|
|
30
|
+
}
|
|
31
|
+
makeEmotionCache(cacheKey, container) {
|
|
32
|
+
return createCache({
|
|
33
|
+
key: cacheKey,
|
|
34
|
+
prepend: true,
|
|
35
|
+
container: container,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
createReactRoot(container, identifierPrefix) {
|
|
39
|
+
return createRoot(container, {
|
|
40
|
+
identifierPrefix: identifierPrefix,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
renderCaptchaComponent(reactRoot, emotionCache, captchaComponent) {
|
|
44
|
+
reactRoot.render(_jsx(CacheProvider, { value: emotionCache, children: captchaComponent }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export { CaptchaRenderer };
|
|
48
|
+
//# sourceMappingURL=captchaRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaRenderer.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaRenderer.tsx"],"names":[],"mappings":";AAcA,OAAO,WAAkC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/C,OAAO,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OA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C,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAES,gBAAgB,CACzB,QAAgB,EAChB,SAAsB;QAEtB,OAAO,WAAW,CAAC;YAClB,GAAG,EAAE,QAAQ;YACb,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,SAAS;SACpB,CAAC,CAAC;IACJ,CAAC;IAES,eAAe,CACxB,SAAsB,EACtB,gBAAwB;QAExB,OAAO,UAAU,CAAC,SAAS,EAAE;YAC5B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC,CAAC;IACJ,CAAC;IAES,sBAAsB,CAC/B,SAAe,EACf,YAA0B,EAC1B,gBAA2B;QAE3B,SAAS,CAAC,MAAM,CACf,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YAAG,gBAAgB,GAAiB,CACtE,CAAC;IACH,CAAC;CACD;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaType.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAS7C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,eAQjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaType.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaType.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAQnC,MAAM,UAAU,cAAc,CAAC,QAAmB;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,WAAW,GAChB,QAAQ,CAAC,IAAI,CACZ,CAAC,OAAO,EAAE,EAAE,CACX,OAAO,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAC9D,IAAK,cAA8B,CAAC;IACtC,OAAO,WAAW,CAAC;AACpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CaptchaProps } from "../
|
|
1
|
+
import type { CaptchaProps } from "../captchaProps.js";
|
|
2
2
|
declare const FrictionlessCaptcha: (props: CaptchaProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { FrictionlessCaptcha };
|
|
4
4
|
//# sourceMappingURL=frictionlessCaptcha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frictionlessCaptcha.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/components/frictionlessCaptcha.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,mBAAmB,UAAW,YAAY,4CAkB/C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -3,12 +3,12 @@ import { getDefaultEvents } from "@prosopo/procaptcha-common";
|
|
|
3
3
|
import { ProcaptchaFrictionless } from "@prosopo/procaptcha-frictionless";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
const FrictionlessCaptcha = (props) => {
|
|
6
|
-
const { config, callbacks } = props;
|
|
6
|
+
const { config, callbacks, i18n } = props;
|
|
7
7
|
const [componentKey, setComponentKey] = useState(0);
|
|
8
8
|
const restart = () => {
|
|
9
9
|
setComponentKey((prevKey) => prevKey + 1);
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(ProcaptchaFrictionless, { config: config, callbacks: getDefaultEvents(callbacks), restart: restart }, componentKey));
|
|
11
|
+
return (_jsx(ProcaptchaFrictionless, { config: config, callbacks: getDefaultEvents(callbacks), restart: restart, i18n: i18n }, componentKey));
|
|
12
12
|
};
|
|
13
13
|
export { FrictionlessCaptcha };
|
|
14
14
|
//# sourceMappingURL=frictionlessCaptcha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frictionlessCaptcha.js","sourceRoot":"","sources":["../../../../src/util/captcha/components/frictionlessCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,MAAM,mBAAmB,GAAG,CAAC,KAAmB,EAAE,EAAE;IACnD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,GAAG,EAAE;QACpB,eAAe,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,CACN,KAAC,sBAAsB,IAEtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,IAJL,YAAY,CAKhB,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CaptchaProps } from "../
|
|
1
|
+
import type { CaptchaProps } from "../captchaProps.js";
|
|
2
2
|
declare const ImageCaptcha: (props: CaptchaProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { ImageCaptcha };
|
|
4
4
|
//# sourceMappingURL=imageCaptcha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageCaptcha.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/components/imageCaptcha.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,YAAY,UAAW,YAAY,4CAUxC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getDefaultEvents } from "@prosopo/procaptcha-common";
|
|
3
3
|
import { Procaptcha } from "@prosopo/procaptcha-react";
|
|
4
4
|
const ImageCaptcha = (props) => {
|
|
5
|
-
const { config, callbacks } = props;
|
|
6
|
-
return _jsx(Procaptcha, { config: config, callbacks: getDefaultEvents(callbacks) });
|
|
5
|
+
const { config, callbacks, i18n } = props;
|
|
6
|
+
return (_jsx(Procaptcha, { config: config, callbacks: getDefaultEvents(callbacks), i18n: i18n }));
|
|
7
7
|
};
|
|
8
8
|
export { ImageCaptcha };
|
|
9
9
|
//# sourceMappingURL=imageCaptcha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageCaptcha.js","sourceRoot":"","sources":["../../../../src/util/captcha/components/imageCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC5C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,OAAO,CACN,KAAC,UAAU,IACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,IAAI,EAAE,IAAI,GACT,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powCaptcha.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/components/powCaptcha.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,QAAA,MAAM,UAAU,UAAW,YAAY,4CAUtC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getDefaultEvents } from "@prosopo/procaptcha-common";
|
|
3
3
|
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
4
4
|
const PowCaptcha = (props) => {
|
|
5
|
-
const { config, callbacks } = props;
|
|
6
|
-
return (_jsx(ProcaptchaPow, { config: config, callbacks: getDefaultEvents(callbacks) }));
|
|
5
|
+
const { config, callbacks, i18n } = props;
|
|
6
|
+
return (_jsx(ProcaptchaPow, { config: config, callbacks: getDefaultEvents(callbacks), i18n: i18n }));
|
|
7
7
|
};
|
|
8
8
|
export { PowCaptcha };
|
|
9
9
|
//# sourceMappingURL=powCaptcha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powCaptcha.js","sourceRoot":"","sources":["../../../../src/util/captcha/components/powCaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,OAAO,CACN,KAAC,aAAa,IACb,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC,EACtC,IAAI,EAAE,IAAI,GACT,CACF,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/util/config.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type ProcaptchaClientConfigOutput } from "@prosopo/types";
|
|
2
|
-
export declare const getConfig: (siteKey?: string, web2?: boolean) => ProcaptchaClientConfigOutput;
|
|
3
1
|
export declare const getProcaptchaScript: (name: string) => HTMLScriptElement | null;
|
|
4
2
|
export declare const extractParams: (name: string) => {
|
|
5
3
|
onloadUrlCallback: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,mBAAmB,SAAU,MAAM,6BACoB,CAAC;AAErE,eAAO,MAAM,aAAa,SAAU,MAAM;;;CAWzC,CAAC"}
|
package/dist/util/config.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import { EnvironmentTypesSchema, ProcaptchaConfigSchema, } from "@prosopo/types";
|
|
2
|
-
export const getConfig = (siteKey, web2 = true) => {
|
|
3
|
-
if (!siteKey) {
|
|
4
|
-
siteKey = process.env.PROSOPO_SITE_KEY || "";
|
|
5
|
-
}
|
|
6
|
-
return ProcaptchaConfigSchema.parse({
|
|
7
|
-
defaultEnvironment: process.env.PROSOPO_DEFAULT_ENVIRONMENT
|
|
8
|
-
? EnvironmentTypesSchema.parse(process.env.PROSOPO_DEFAULT_ENVIRONMENT)
|
|
9
|
-
: EnvironmentTypesSchema.enum.development,
|
|
10
|
-
userAccountAddress: "",
|
|
11
|
-
account: {
|
|
12
|
-
address: siteKey,
|
|
13
|
-
},
|
|
14
|
-
serverUrl: process.env.PROSOPO_SERVER_URL || "",
|
|
15
|
-
mongoAtlasUri: process.env.PROSOPO_MONGO_EVENTS_URI || "",
|
|
16
|
-
devOnlyWatchEvents: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false,
|
|
17
|
-
web2,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
1
|
export const getProcaptchaScript = (name) => document.querySelector(`script[src*="${name}"]`);
|
|
21
2
|
export const extractParams = (name) => {
|
|
22
3
|
const script = getProcaptchaScript(name);
|
package/dist/util/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/util/config.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE,CACnD,QAAQ,CAAC,aAAa,CAAoB,gBAAgB,IAAI,IAAI,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC7C,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO;YACN,iBAAiB,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS;YACpD,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS;SACjD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AACpE,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LanguageSchema } from "@prosopo/locale";
|
|
2
|
+
import { type ProcaptchaClientConfigOutput } from "@prosopo/types";
|
|
3
|
+
declare function createConfig(siteKey?: string, theme?: "light" | "dark", language?: typeof LanguageSchema, web2?: boolean, invisible?: boolean): ProcaptchaClientConfigOutput;
|
|
4
|
+
export { createConfig };
|
|
5
|
+
//# sourceMappingURL=configCreator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configCreator.d.ts","sourceRoot":"","sources":["../../src/util/configCreator.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAEN,KAAK,4BAA4B,EAEjC,MAAM,gBAAgB,CAAC;AAExB,iBAAS,YAAY,CACpB,OAAO,CAAC,EAAE,MAAM,EAChB,KAAK,GAAE,OAAO,GAAG,MAAgB,EACjC,QAAQ,CAAC,EAAE,OAAO,cAAc,EAChC,IAAI,UAAO,EACX,SAAS,UAAQ,GACf,4BAA4B,CAqB9B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EnvironmentTypesSchema, ProcaptchaConfigSchema, } from "@prosopo/types";
|
|
2
|
+
function createConfig(siteKey, theme = "light", language, web2 = true, invisible = false) {
|
|
3
|
+
if (!siteKey) {
|
|
4
|
+
siteKey = process.env.PROSOPO_SITE_KEY || "";
|
|
5
|
+
}
|
|
6
|
+
return ProcaptchaConfigSchema.parse({
|
|
7
|
+
defaultEnvironment: process.env.PROSOPO_DEFAULT_ENVIRONMENT
|
|
8
|
+
? EnvironmentTypesSchema.parse(process.env.PROSOPO_DEFAULT_ENVIRONMENT)
|
|
9
|
+
: EnvironmentTypesSchema.enum.development,
|
|
10
|
+
userAccountAddress: "",
|
|
11
|
+
account: {
|
|
12
|
+
address: siteKey,
|
|
13
|
+
},
|
|
14
|
+
serverUrl: process.env.PROSOPO_SERVER_URL || "",
|
|
15
|
+
mongoAtlasUri: process.env.PROSOPO_MONGO_EVENTS_URI || "",
|
|
16
|
+
devOnlyWatchEvents: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false,
|
|
17
|
+
web2,
|
|
18
|
+
mode: invisible ? "invisible" : "visible",
|
|
19
|
+
theme,
|
|
20
|
+
language,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { createConfig };
|
|
24
|
+
//# sourceMappingURL=configCreator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configCreator.js","sourceRoot":"","sources":["../../src/util/configCreator.ts"],"names":[],"mappings":"AAeA,OAAO,EACN,sBAAsB,EAEtB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AAExB,SAAS,YAAY,CACpB,OAAgB,EAChB,QAA0B,OAAO,EACjC,QAAgC,EAChC,IAAI,GAAG,IAAI,EACX,SAAS,GAAG,KAAK;IAEjB,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;IAC9C,CAAC;IAED,OAAO,sBAAsB,CAAC,KAAK,CAAC;QACnC,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B;YAC1D,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;YACvE,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,WAAW;QAC1C,kBAAkB,EAAE,EAAE;QACtB,OAAO,EAAE;YACR,OAAO,EAAE,OAAO;SAChB;QACD,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE;QAC/C,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;QACzD,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,IAAI,KAAK;QAC1E,IAAI;QACJ,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;QACzC,KAAK;QACL,QAAQ;KACR,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Ti18n } from "@prosopo/locale";
|
|
2
|
+
import { type Callbacks, type ProcaptchaRenderOptions } from "@prosopo/types";
|
|
3
|
+
import type { Root } from "react-dom/client";
|
|
4
|
+
import type { CaptchaRenderer } from "./captcha/captchaRenderer.js";
|
|
5
|
+
import type { WidgetThemeResolver } from "./widgetThemeResolver.js";
|
|
6
|
+
declare class WidgetFactory {
|
|
7
|
+
private readonly widgetThemeResolver;
|
|
8
|
+
private captchaRenderer;
|
|
9
|
+
private _i18n;
|
|
10
|
+
constructor(widgetThemeResolver: WidgetThemeResolver);
|
|
11
|
+
get i18n(): Ti18n;
|
|
12
|
+
createWidgets(containers: Element[], renderOptions: ProcaptchaRenderOptions, isWeb2?: boolean, invisible?: boolean): Promise<Root[]>;
|
|
13
|
+
createWidget(container: Element, renderOptions: ProcaptchaRenderOptions, callbacks: Callbacks, isWeb2?: boolean, invisible?: boolean): Promise<Root>;
|
|
14
|
+
protected getCaptchaRenderer(): Promise<CaptchaRenderer>;
|
|
15
|
+
protected createCaptchaRenderer(): Promise<CaptchaRenderer>;
|
|
16
|
+
}
|
|
17
|
+
export { WidgetFactory };
|
|
18
|
+
//# sourceMappingURL=widgetFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetFactory.d.ts","sourceRoot":"","sources":["../../src/util/widgetFactory.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAK7C,OAAO,EACN,KAAK,SAAS,EAGd,KAAK,uBAAuB,EAC5B,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,cAAM,aAAa;IAKjB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJrC,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,KAAK,CAAsB;gBAGjB,mBAAmB,EAAE,mBAAmB;IAG1D,IAAI,IAAI,IAAI,KAAK,CAKhB;IAEY,aAAa,CACzB,UAAU,EAAE,OAAO,EAAE,EACrB,aAAa,EAAE,uBAAuB,EACtC,MAAM,UAAO,EACb,SAAS,UAAQ,GACf,OAAO,CAAC,IAAI,EAAE,CAAC;IAgBL,YAAY,CACxB,SAAS,EAAE,OAAO,EAClB,aAAa,EAAE,uBAAuB,EACtC,SAAS,EAAE,SAAS,EACpB,MAAM,UAAO,EACb,SAAS,UAAQ,GACf,OAAO,CAAC,IAAI,CAAC;cA+CA,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC;cAY9C,qBAAqB,IAAI,OAAO,CAAC,eAAe,CAAC;CAUjE;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { loadI18next } from "@prosopo/locale";
|
|
2
|
+
import { getDefaultCallbacks, setUserCallbacks, } from "@prosopo/procaptcha-common";
|
|
3
|
+
import { CaptchaType, } from "@prosopo/types";
|
|
4
|
+
import { createWidgetSkeleton, darkTheme, lightTheme, } from "@prosopo/widget-skeleton";
|
|
5
|
+
class WidgetFactory {
|
|
6
|
+
constructor(widgetThemeResolver) {
|
|
7
|
+
this.widgetThemeResolver = widgetThemeResolver;
|
|
8
|
+
this.captchaRenderer = null;
|
|
9
|
+
this._i18n = null;
|
|
10
|
+
}
|
|
11
|
+
get i18n() {
|
|
12
|
+
if (this._i18n === null) {
|
|
13
|
+
throw new Error("I18n is not initialized");
|
|
14
|
+
}
|
|
15
|
+
return this._i18n;
|
|
16
|
+
}
|
|
17
|
+
async createWidgets(containers, renderOptions, isWeb2 = true, invisible = false) {
|
|
18
|
+
return Promise.all(containers.map((container) => {
|
|
19
|
+
const callbacks = getDefaultCallbacks(container);
|
|
20
|
+
setUserCallbacks(renderOptions, callbacks, container);
|
|
21
|
+
return this.createWidget(container, renderOptions, callbacks, isWeb2, invisible);
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
async createWidget(container, renderOptions, callbacks, isWeb2 = true, invisible = false) {
|
|
25
|
+
renderOptions.theme = this.widgetThemeResolver.resolveWidgetTheme(container, renderOptions);
|
|
26
|
+
const widgetTheme = "light" === renderOptions.theme ? lightTheme : darkTheme;
|
|
27
|
+
let widgetInteractiveArea;
|
|
28
|
+
if (invisible) {
|
|
29
|
+
const newDiv = document.createElement("div");
|
|
30
|
+
container.appendChild(newDiv);
|
|
31
|
+
widgetInteractiveArea = newDiv;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
widgetInteractiveArea = createWidgetSkeleton(container, widgetTheme, "prosopo-procaptcha");
|
|
35
|
+
}
|
|
36
|
+
const captchaRenderer = await this.getCaptchaRenderer();
|
|
37
|
+
const captchaRoot = captchaRenderer.renderCaptcha({
|
|
38
|
+
identifierPrefix: "procaptcha-",
|
|
39
|
+
emotionCacheKey: "procaptcha",
|
|
40
|
+
webComponentTag: "prosopo-procaptcha",
|
|
41
|
+
defaultCaptchaType: CaptchaType.frictionless,
|
|
42
|
+
}, widgetInteractiveArea, renderOptions, callbacks, isWeb2, this.i18n, invisible);
|
|
43
|
+
return captchaRoot;
|
|
44
|
+
}
|
|
45
|
+
async getCaptchaRenderer() {
|
|
46
|
+
if (this._i18n === null) {
|
|
47
|
+
this._i18n = await loadI18next(false);
|
|
48
|
+
}
|
|
49
|
+
if (this.captchaRenderer === null) {
|
|
50
|
+
this.captchaRenderer = await this.createCaptchaRenderer();
|
|
51
|
+
}
|
|
52
|
+
return this.captchaRenderer;
|
|
53
|
+
}
|
|
54
|
+
async createCaptchaRenderer() {
|
|
55
|
+
const CaptchaRenderer = (await import("./captcha/captchaRenderer.js"))
|
|
56
|
+
.CaptchaRenderer;
|
|
57
|
+
const CaptchaComponentProvider = (await import("./captcha/captchaComponentProvider.js")).CaptchaComponentProvider;
|
|
58
|
+
return new CaptchaRenderer(new CaptchaComponentProvider());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export { WidgetFactory };
|
|
62
|
+
//# sourceMappingURL=widgetFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetFactory.js","sourceRoot":"","sources":["../../src/util/widgetFactory.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACN,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEN,WAAW,GAGX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,oBAAoB,EACpB,SAAS,EACT,UAAU,GACV,MAAM,0BAA0B,CAAC;AAKlC,MAAM,aAAa;IAIlB,YACkB,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;QAJlD,oBAAe,GAA2B,IAAI,CAAC;QAC/C,UAAK,GAAiB,IAAI,CAAC;IAIhC,CAAC;IAEJ,IAAI,IAAI;QACP,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,UAAqB,EACrB,aAAsC,EACtC,MAAM,GAAG,IAAI,EACb,SAAS,GAAG,KAAK;QAEjB,OAAO,OAAO,CAAC,GAAG,CACjB,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YAC5B,MAAM,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACjD,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,YAAY,CACvB,SAAS,EACT,aAAa,EACb,SAAS,EACT,MAAM,EACN,SAAS,CACT,CAAC;QACH,CAAC,CAAC,C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C;YACnC,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,qBAAqB;QACpC,MAAM,eAAe,GAAG,CAAC,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;aACpE,eAAe,CAAC;QAElB,MAAM,wBAAwB,GAAG,CAChC,MAAM,MAAM,CAAC,uCAAuC,CAAC,CACrD,CAAC,wBAAwB,CAAC;QAE3B,OAAO,IAAI,eAAe,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC;IAC5D,CAAC;CACD;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ProcaptchaRenderOptions } from "@prosopo/types";
|
|
2
|
+
declare class WidgetThemeResolver {
|
|
3
|
+
private readonly themesSet;
|
|
4
|
+
private readonly defaultTheme;
|
|
5
|
+
resolveWidgetTheme(element: Element, renderOptions: ProcaptchaRenderOptions): "light" | "dark";
|
|
6
|
+
protected validateTheme(themeAttribute: string): "light" | "dark";
|
|
7
|
+
}
|
|
8
|
+
export { WidgetThemeResolver };
|
|
9
|
+
//# sourceMappingURL=widgetThemeResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetThemeResolver.d.ts","sourceRoot":"","sources":["../../src/util/widgetThemeResolver.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9D,cAAM,mBAAmB;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;IACxD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAW;IAEjC,kBAAkB,CACxB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,uBAAuB,GACpC,OAAO,GAAG,MAAM;IASnB,SAAS,CAAC,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM;CAKjE;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class WidgetThemeResolver {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.themesSet = new Set(["light", "dark"]);
|
|
4
|
+
this.defaultTheme = "light";
|
|
5
|
+
}
|
|
6
|
+
resolveWidgetTheme(element, renderOptions) {
|
|
7
|
+
const themeAttribute = renderOptions.theme ||
|
|
8
|
+
element.getAttribute("data-theme") ||
|
|
9
|
+
this.defaultTheme;
|
|
10
|
+
return this.validateTheme(themeAttribute);
|
|
11
|
+
}
|
|
12
|
+
validateTheme(themeAttribute) {
|
|
13
|
+
return this.themesSet.has(themeAttribute)
|
|
14
|
+
? themeAttribute
|
|
15
|
+
: this.defaultTheme;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export { WidgetThemeResolver };
|
|
19
|
+
//# sourceMappingURL=widgetThemeResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetThemeResolver.js","sourceRoot":"","sources":["../../src/util/widgetThemeResolver.ts"],"names":[],"mappings":"AAgBA,MAAM,mBAAmB;IAAzB;QACkB,cAAS,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;QACvC,iBAAY,GAAG,OAAO,CAAC;IAmBzC,CAAC;IAjBO,kBAAkB,CACxB,OAAgB,EAChB,aAAsC;QAEtC,MAAM,cAAc,GACnB,aAAa,CAAC,KAAK;YACnB,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC;YAClC,IAAI,CAAC,YAAY,CAAC;QAEnB,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAC3C,CAAC;IAES,aAAa,CAAC,cAAsB;QAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC;YACxC,CAAC,CAAE,cAAmC;YACtC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;IACtB,CAAC;CACD;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|