@prosopo/procaptcha-bundle 2.5.1 → 2.5.3
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 +83 -13
- 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 +5 -6
- 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 +51 -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 +57 -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-BlWWnPeB.js +615 -0
- package/dist/bundle/ProcaptchaWidget-Dnwno-4N.js +156 -0
- package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/bundle/{asU8a-Br9wz334.js → asU8a-JliaME7-.js} +1 -1
- package/dist/bundle/{bip39-BtaWByKg.js → bip39-CFjno8fK.js} +2 -2
- package/dist/bundle/{browser-ponyfill-Ck_bwPOY.js → browser-ponyfill-Dy1JBTMg.js} +20 -20
- package/dist/bundle/captchaComponentProvider-dcMua0p9.js +1013 -0
- package/dist/bundle/captchaRenderer-D-du50M4.js +5478 -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-Bywq83R5.js +1838 -0
- package/dist/bundle/{hash-KElfghPn.js → hash-CtL1HOjf.js} +1 -1
- package/dist/bundle/i18nFrontend-C_RgmvGh.js +2273 -0
- package/dist/bundle/index-B8oMghZ3.js +1120 -0
- package/dist/bundle/{index-Cb-XcaMX.js → index-BMjJnq60.js} +11 -10
- package/dist/bundle/index-BTlHNFX8.js +504 -0
- package/dist/bundle/{index-B0trzdT2.js → index-DcG_c-Na.js} +20 -19
- package/dist/bundle/index.d.ts +3 -1
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/locales/de/translation.json +2 -1
- package/dist/bundle/locales/en/translation.json +2 -1
- package/dist/bundle/locales/es/translation.json +2 -1
- package/dist/bundle/locales/fr/translation.json +2 -1
- package/dist/bundle/locales/it/translation.json +2 -1
- package/dist/bundle/locales/pt/translation.json +2 -1
- package/dist/bundle/locales/pt-BR/translation.json +2 -1
- package/dist/bundle/procaptcha.bundle.js +4 -3
- package/dist/bundle/translations-B0P9axY3.js +2885 -0
- package/dist/bundle/useTranslation-7b6JJ18N.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 +83 -13
- 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 +5 -6
- 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 +51 -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 +57 -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 +10 -9
- package/stats.html +1 -1
- package/vite.cjs.config.ts +1 -1
- package/vite.config.ts +1 -1
- 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,5 +1,5 @@
|
|
|
1
|
-
export * from "./util/
|
|
2
|
-
export * from "./util/
|
|
3
|
-
export * from "./util/
|
|
4
|
-
export * from "./util/
|
|
1
|
+
export * from "./util/captcha/components/frictionlessCaptcha.js";
|
|
2
|
+
export * from "./util/captcha/components/powCaptcha.js";
|
|
3
|
+
export * from "./util/captcha/components/imageCaptcha.js";
|
|
4
|
+
export * from "./util/captcha/captchaComponentProvider.js";
|
|
5
5
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./util/
|
|
2
|
-
export * from "./util/
|
|
3
|
-
export * from "./util/
|
|
4
|
-
export * from "./util/
|
|
1
|
+
export * from "./util/captcha/components/frictionlessCaptcha.js";
|
|
2
|
+
export * from "./util/captcha/components/powCaptcha.js";
|
|
3
|
+
export * from "./util/captcha/components/imageCaptcha.js";
|
|
4
|
+
export * from "./util/captcha/captchaComponentProvider.js";
|
|
5
5
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { ProcaptchaRenderOptions } from "@prosopo/types";
|
|
2
|
-
export declare const render: (element: Element, renderOptions: ProcaptchaRenderOptions) => void
|
|
2
|
+
export declare const render: (element: Element, renderOptions: ProcaptchaRenderOptions) => Promise<void>;
|
|
3
3
|
export default function ready(fn: () => void): void;
|
|
4
|
+
export declare const execute: () => void;
|
|
4
5
|
declare global {
|
|
5
6
|
interface Window {
|
|
6
7
|
procaptcha: {
|
|
7
8
|
ready: typeof ready;
|
|
8
9
|
render: typeof render;
|
|
9
10
|
reset: typeof reset;
|
|
11
|
+
execute: typeof execute;
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAiF9D,eAAO,MAAM,MAAM,YACT,OAAO,iBACD,uBAAuB,kBAoBtC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,QAQ3C;AAED,eAAO,MAAM,OAAO,YAqBnB,CAAC;AAiDF,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,EAAE;YACX,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,MAAM,EAAE,OAAO,MAAM,CAAC;YACtB,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,OAAO,EAAE,OAAO,OAAO,CAAC;SACxB,CAAC;KACF;CACD;AA2BD,eAAO,MAAM,KAAK,YAOjB,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { getWindowCallback } from "@prosopo/procaptcha-common";
|
|
2
2
|
import { at } from "@prosopo/util";
|
|
3
|
-
import { getCaptchaType } from "./util/captchaType.js";
|
|
4
|
-
import { extractParams,
|
|
5
|
-
import {
|
|
3
|
+
import { getCaptchaType } from "./util/captcha/captchaType.js";
|
|
4
|
+
import { extractParams, getProcaptchaScript } from "./util/config.js";
|
|
5
|
+
import { WidgetFactory } from "./util/widgetFactory.js";
|
|
6
|
+
import { WidgetThemeResolver } from "./util/widgetThemeResolver.js";
|
|
6
7
|
const BUNDLE_NAME = "procaptcha.bundle.js";
|
|
7
8
|
let procaptchaRoots = [];
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
10
|
+
const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
11
|
+
const implicitRender = async () => {
|
|
12
|
+
const elements = Array.from(document.getElementsByClassName("procaptcha")).filter((element) => element.tagName.toLowerCase() !== "button");
|
|
10
13
|
if (elements.length) {
|
|
11
14
|
const siteKey = at(elements, 0).getAttribute("data-sitekey");
|
|
12
15
|
const web3 = at(elements, 0).getAttribute("data-web3");
|
|
@@ -15,16 +18,40 @@ const implicitRender = () => {
|
|
|
15
18
|
return;
|
|
16
19
|
}
|
|
17
20
|
const captchaType = getCaptchaType(elements);
|
|
18
|
-
const root =
|
|
19
|
-
captchaType,
|
|
20
|
-
siteKey,
|
|
21
|
-
});
|
|
21
|
+
const root = await widgetFactory.createWidgets(elements, {
|
|
22
|
+
captchaType: captchaType,
|
|
23
|
+
siteKey: siteKey,
|
|
24
|
+
}, !(web3 === "true"));
|
|
22
25
|
procaptchaRoots.push(...root);
|
|
23
26
|
}
|
|
27
|
+
const invisibleButtons = Array.from(document.getElementsByClassName("procaptcha")).filter((button) => button.tagName.toLowerCase() === "button");
|
|
28
|
+
if (invisibleButtons.length) {
|
|
29
|
+
for (const button of invisibleButtons) {
|
|
30
|
+
const siteKey = button.getAttribute("data-sitekey") || "";
|
|
31
|
+
const callback = button.getAttribute("data-callback") || "";
|
|
32
|
+
const captchaType = getCaptchaType([button]);
|
|
33
|
+
const root = await widgetFactory.createWidgets([button], {
|
|
34
|
+
captchaType: captchaType,
|
|
35
|
+
siteKey: siteKey,
|
|
36
|
+
callback: callback,
|
|
37
|
+
}, true, true);
|
|
38
|
+
procaptchaRoots.push(...root);
|
|
39
|
+
button.addEventListener("click", async (event) => {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
execute();
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
};
|
|
25
|
-
export const render = (element, renderOptions) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
46
|
+
export const render = async (element, renderOptions) => {
|
|
47
|
+
const hasInvisibleSize = Object.prototype.hasOwnProperty.call(renderOptions, "size") &&
|
|
48
|
+
renderOptions.size === "invisible";
|
|
49
|
+
if (hasInvisibleSize || element.tagName.toLowerCase() === "button") {
|
|
50
|
+
const roots = await widgetFactory.createWidgets([element], renderOptions, true, true);
|
|
51
|
+
procaptchaRoots.push(...roots);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const roots = await widgetFactory.createWidgets([element], renderOptions);
|
|
28
55
|
procaptchaRoots.push(...roots);
|
|
29
56
|
};
|
|
30
57
|
export default function ready(fn) {
|
|
@@ -37,6 +64,49 @@ export default function ready(fn) {
|
|
|
37
64
|
document.addEventListener("DOMContentLoaded", fn);
|
|
38
65
|
}
|
|
39
66
|
}
|
|
67
|
+
export const execute = () => {
|
|
68
|
+
const containers = findProcaptchaContainers();
|
|
69
|
+
if (containers.length === 0) {
|
|
70
|
+
console.error("No Procaptcha containers found for execution");
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const executeEvent = new CustomEvent(PROCAPTCHA_EXECUTE_EVENT, {
|
|
74
|
+
detail: {
|
|
75
|
+
containerId: containers[0]?.id || "procaptcha-container",
|
|
76
|
+
containerCount: containers.length,
|
|
77
|
+
timestamp: Date.now(),
|
|
78
|
+
},
|
|
79
|
+
bubbles: true,
|
|
80
|
+
cancelable: true,
|
|
81
|
+
});
|
|
82
|
+
document.dispatchEvent(executeEvent);
|
|
83
|
+
};
|
|
84
|
+
function findProcaptchaContainers() {
|
|
85
|
+
const containers = [];
|
|
86
|
+
const invisibleContainers = Array.from(document.querySelectorAll('[data-size="invisible"]'));
|
|
87
|
+
containers.push(...invisibleContainers);
|
|
88
|
+
const idContainers = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]'));
|
|
89
|
+
const classContainers = Array.from(document.getElementsByClassName("p-procaptcha"));
|
|
90
|
+
containers.push(...classContainers);
|
|
91
|
+
for (const container of idContainers) {
|
|
92
|
+
if (!containers.includes(container)) {
|
|
93
|
+
containers.push(container);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return containers;
|
|
97
|
+
}
|
|
98
|
+
function getElementAttributes(element) {
|
|
99
|
+
const attributes = {};
|
|
100
|
+
if (element?.attributes) {
|
|
101
|
+
for (let i = 0; i < element.attributes.length; i++) {
|
|
102
|
+
const attr = element.attributes[i];
|
|
103
|
+
if (attr?.name && attr.value !== undefined) {
|
|
104
|
+
attributes[attr.name] = attr.value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return attributes;
|
|
109
|
+
}
|
|
40
110
|
const start = () => {
|
|
41
111
|
const { onloadUrlCallback, renderExplicit } = extractParams(BUNDLE_NAME);
|
|
42
112
|
if (renderExplicit !== "explicit") {
|
|
@@ -61,6 +131,6 @@ export const reset = () => {
|
|
|
61
131
|
procaptchaRoots = [];
|
|
62
132
|
start();
|
|
63
133
|
};
|
|
64
|
-
window.procaptcha = { ready, render, reset };
|
|
134
|
+
window.procaptcha = { ready, render, reset, execute };
|
|
65
135
|
start();
|
|
66
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,IAAI,eAAe,GAAW,EAAE,CAAC;AAEjC,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAGnE,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAGtD,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;IAEjC,MAAM,QAAQ,GAAc,KAAK,CAAC,IA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D,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,mBAAmB,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;YAC/D,KAAK,CAAC,cAAc,CAAC,CAAC;YACtB,WAAW,GAAG,IAAI,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,UAAU,KAAK,UAAU,IAAI,CAAC,WAAW,EAAE,CAAC;YACxD,KAAK,CAAC,cAAc,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,EAAE;IACzB,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IACD,eAAe,GAAG,EAAE,CAAC;IAErB,KAAK,EAAE,CAAC;AACT,CAAC,CAAC;AAGF,MAAM,CAAC,UAAU,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAEtD,KAAK,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CaptchaType } from "@prosopo/types";
|
|
2
2
|
import { JSDOM } from "jsdom";
|
|
3
3
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
4
|
-
import { getCaptchaType } from "../../util/captchaType.js";
|
|
4
|
+
import { getCaptchaType } from "../../util/captcha/captchaType.js";
|
|
5
5
|
describe("getCaptchaType", () => {
|
|
6
6
|
beforeEach(() => {
|
|
7
7
|
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captchaType.test.js","sourceRoot":"","sources":["../../../../src/tests/util/captchaType.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,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MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC3E,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACzD,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE9C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;YAClD,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -3,7 +3,9 @@ import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
|
3
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());
|
|
7
9
|
vi.mock("@prosopo/detector", async () => {
|
|
8
10
|
return {
|
|
9
11
|
isBot: async () => {
|
|
@@ -59,10 +61,7 @@ describe("Config utility functions", () => {
|
|
|
59
61
|
expect(true).toBe(false);
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
|
|
63
|
-
account: { address: "1234" },
|
|
64
|
-
});
|
|
65
|
-
renderLogic([script], config, {
|
|
64
|
+
await widgetFactory.createWidgets([script], {
|
|
66
65
|
siteKey: "1234",
|
|
67
66
|
captchaType: "pow",
|
|
68
67
|
});
|
|
@@ -116,7 +115,7 @@ describe("Config utility functions", () => {
|
|
|
116
115
|
const config = ProcaptchaConfigSchema.parse({
|
|
117
116
|
account: { address: "1234" },
|
|
118
117
|
});
|
|
119
|
-
|
|
118
|
+
await widgetFactory.createWidgets([script], {
|
|
120
119
|
siteKey: "1234",
|
|
121
120
|
captchaType: "pow",
|
|
122
121
|
});
|
|
@@ -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,EAAE,sBAAsB,EAAwB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAkB,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,
|
|
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,EAAE,sBAAsB,EAAwB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAkB,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UA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AO,EAAE,MAAM,EAAE;SAC5B,CAAC,CAAC;QAEH,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,EAAE;YAC3C,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,KAAK;SAClB,CAAC,CAAC;QAIH,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;YACrB,MAAM,CAAC,aAAa,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;YAG/C,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,KAAK,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAEpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CaptchaType } from "@prosopo/types";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { CaptchaProps } 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"}
|
|
@@ -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"}
|
|
@@ -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, isWeb2: boolean, i18n: Ti18n, invisible?: boolean): Root;
|
|
18
|
+
protected readAndValidateSettings(element: Element, callbacks: Callbacks, 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"],"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,YAAY,EAC1B,gBAAgB,EAAE,SAAS,GACzB,IAAI;CAKP;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import createCache from "@emotion/cache";
|
|
3
|
+
import { CacheProvider } from "@emotion/react";
|
|
4
|
+
import { getDefaultCallbacks, setUserCallbacks, } from "@prosopo/procaptcha-common";
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import { createConfig } from "../configCreator.js";
|
|
7
|
+
import { setLanguage } from "../language.js";
|
|
8
|
+
import { setValidChallengeLength } from "../timeout.js";
|
|
9
|
+
class CaptchaRenderer {
|
|
10
|
+
constructor(captchaComponentProvider) {
|
|
11
|
+
this.captchaComponentProvider = captchaComponentProvider;
|
|
12
|
+
}
|
|
13
|
+
renderCaptcha(settings, container, renderOptions, isWeb2, i18n, invisible = false) {
|
|
14
|
+
const callbacks = getDefaultCallbacks(container);
|
|
15
|
+
const captchaType = renderOptions?.captchaType ||
|
|
16
|
+
settings.defaultCaptchaType;
|
|
17
|
+
const config = createConfig(renderOptions.siteKey, renderOptions.theme, renderOptions.language, isWeb2, invisible);
|
|
18
|
+
this.readAndValidateSettings(container, callbacks, config, renderOptions);
|
|
19
|
+
const reactRoot = this.createReactRoot(container, settings.identifierPrefix);
|
|
20
|
+
const emotionCache = this.makeEmotionCache(settings.emotionCacheKey, container);
|
|
21
|
+
const captchaComponent = this.captchaComponentProvider.getCaptchaComponent(captchaType, {
|
|
22
|
+
config: config,
|
|
23
|
+
callbacks: callbacks,
|
|
24
|
+
i18n: i18n,
|
|
25
|
+
});
|
|
26
|
+
this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
|
|
27
|
+
return reactRoot;
|
|
28
|
+
}
|
|
29
|
+
readAndValidateSettings(element, callbacks, config, renderOptions) {
|
|
30
|
+
setUserCallbacks(renderOptions, callbacks, element);
|
|
31
|
+
setValidChallengeLength(renderOptions, element, config);
|
|
32
|
+
setLanguage(renderOptions, element, config);
|
|
33
|
+
}
|
|
34
|
+
makeEmotionCache(cacheKey, container) {
|
|
35
|
+
return createCache({
|
|
36
|
+
key: cacheKey,
|
|
37
|
+
prepend: true,
|
|
38
|
+
container: container,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
createReactRoot(container, identifierPrefix) {
|
|
42
|
+
return createRoot(container, {
|
|
43
|
+
identifierPrefix: identifierPrefix,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
renderCaptchaComponent(reactRoot, emotionCache, captchaComponent) {
|
|
47
|
+
reactRoot.render(_jsx(CacheProvider, { value: emotionCache, children: captchaComponent }));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export { CaptchaRenderer };
|
|
51
|
+
//# 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;AAE/C,OAAO,EACN,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAUxD,MAAM,eAAe;IAGpB,YAAY,wBAAkD;QAC7D,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;IAC1D,CAAC;IAEM,aAAa,CACnB,QAAwB,EACxB,SAAsB,EACtB,aAAsC,EACtC,MAAe,EACf,IAAW,EACX,SAAS,GAAG,KAAK;QAEjB,MAAM,S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ACJ,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":"AAuBA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,OAQjD"}
|
|
@@ -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"}
|
|
@@ -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"}
|
|
@@ -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);
|