@prosopo/procaptcha-bundle 3.2.2 → 3.2.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/CHANGELOG.md +21 -0
- package/package.json +11 -11
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -5
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -5
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -16
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js +0 -144
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts +0 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js +0 -32
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -36
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -69
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +0 -136
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +0 -15
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -11
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +0 -49
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -3
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -8
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +0 -14
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -9
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -9
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -6
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -13
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -5
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -23
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -3
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -17
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -3
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -9
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +0 -18
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +0 -66
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -19
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -599
- package/coverage/coverage-final.json +0 -17
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -161
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/src/components.ts.html +0 -139
- package/coverage/src/index.html +0 -131
- package/coverage/src/index.ts.html +0 -844
- package/coverage/src/util/captcha/captchaComponentProvider.tsx.html +0 -214
- package/coverage/src/util/captcha/captchaComponentsList.ts.html +0 -178
- package/coverage/src/util/captcha/captchaProps.ts.html +0 -166
- package/coverage/src/util/captcha/captchaRenderer.tsx.html +0 -481
- package/coverage/src/util/captcha/captchaType.ts.html +0 -181
- package/coverage/src/util/captcha/components/frictionlessCaptcha.tsx.html +0 -205
- package/coverage/src/util/captcha/components/imageCaptcha.tsx.html +0 -178
- package/coverage/src/util/captcha/components/index.html +0 -146
- package/coverage/src/util/captcha/components/powCaptcha.tsx.html +0 -178
- package/coverage/src/util/captcha/index.html +0 -176
- package/coverage/src/util/config.ts.html +0 -172
- package/coverage/src/util/configCreator.ts.html +0 -241
- package/coverage/src/util/index.html +0 -191
- package/coverage/src/util/language.ts.html +0 -244
- package/coverage/src/util/timeout.ts.html +0 -214
- package/coverage/src/util/widgetFactory.ts.html +0 -532
- package/coverage/src/util/widgetThemeResolver.ts.html +0 -205
- package/dist/bundle/ProcaptchaWidget-CuMH13Bh.js +0 -1012
- package/dist/bundle/ProcaptchaWidget-DsflBBn_.js +0 -187
- package/dist/bundle/Signer-DP9drQ55.js +0 -23
- package/dist/bundle/bnChunk-DRlDxTFg.js +0 -1137
- package/dist/bundle/browser-ponyfill-DXriyH6D.js +0 -339
- package/dist/bundle/builder-ByZ5z580.js +0 -46
- package/dist/bundle/captchaComponentProvider-D02Su4nd.js +0 -1013
- package/dist/bundle/captchaRenderer-BV-WgbEA.js +0 -70
- package/dist/bundle/commonChunk-PB26mndo.js +0 -183
- package/dist/bundle/components.d.ts.map +0 -1
- package/dist/bundle/emotion-element-c39617d8.browser.esm-DG1XhEZ1.js +0 -916
- package/dist/bundle/fp.esm-DYWeNGcH.js +0 -1654
- package/dist/bundle/index-B9KeZfID.js +0 -5416
- package/dist/bundle/index-Calnfnac.js +0 -609
- package/dist/bundle/index-DU371vQ0.js +0 -1634
- package/dist/bundle/index.d.ts.map +0 -1
- package/dist/bundle/locales/ar/translation.json +0 -57
- package/dist/bundle/locales/az/translation.json +0 -57
- package/dist/bundle/locales/cs/translation.json +0 -57
- package/dist/bundle/locales/de/translation.json +0 -57
- package/dist/bundle/locales/el/translation.json +0 -57
- package/dist/bundle/locales/en/translation.json +0 -57
- package/dist/bundle/locales/es/translation.json +0 -57
- package/dist/bundle/locales/fi/translation.json +0 -57
- package/dist/bundle/locales/fr/translation.json +0 -57
- package/dist/bundle/locales/hi/translation.json +0 -57
- package/dist/bundle/locales/hu/translation.json +0 -57
- package/dist/bundle/locales/id/translation.json +0 -57
- package/dist/bundle/locales/it/translation.json +0 -57
- package/dist/bundle/locales/ja/translation.json +0 -57
- package/dist/bundle/locales/jv/translation.json +0 -57
- package/dist/bundle/locales/ko/translation.json +0 -57
- package/dist/bundle/locales/ml/translation.json +0 -57
- package/dist/bundle/locales/ms/translation.json +0 -57
- package/dist/bundle/locales/nl/translation.json +0 -57
- package/dist/bundle/locales/no/translation.json +0 -57
- package/dist/bundle/locales/pl/translation.json +0 -57
- package/dist/bundle/locales/pt/translation.json +0 -57
- package/dist/bundle/locales/pt-BR/translation.json +0 -57
- package/dist/bundle/locales/ro/translation.json +0 -57
- package/dist/bundle/locales/ru/translation.json +0 -57
- package/dist/bundle/locales/sr/translation.json +0 -57
- package/dist/bundle/locales/sv/translation.json +0 -57
- package/dist/bundle/locales/th/translation.json +0 -57
- package/dist/bundle/locales/tr/translation.json +0 -57
- package/dist/bundle/locales/uk/translation.json +0 -57
- package/dist/bundle/locales/vi/translation.json +0 -57
- package/dist/bundle/locales/zh-CN/translation.json +0 -57
- package/dist/bundle/nobleChunk-Bbltwf44.js +0 -2728
- package/dist/bundle/procaptcha.bundle.js +0 -8
- package/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +0 -1
- package/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
- package/dist/bundle/tests/util/config.test.d.ts.map +0 -1
- package/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
- package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/bundle/util/config.d.ts.map +0 -1
- package/dist/bundle/util/configCreator.d.ts.map +0 -1
- package/dist/bundle/util/language.d.ts.map +0 -1
- package/dist/bundle/util/timeout.d.ts.map +0 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +0 -1
- package/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
- package/dist/bundle/utilChunk-WRTGKXbU.js +0 -324
- package/dist/bundle/utilCryptoChunk-B4ZdOwus.js +0 -1236
- package/dist/bundle/web2Chunk-BGN6Hv-C.js +0 -3972
- package/dist/bundle/web3Chunk-BIX2T9Eo.js +0 -525
- package/dist/bundle/zodChunk-CaINhWMQ.js +0 -2882
- package/dist/components.d.ts +0 -5
- package/dist/components.d.ts.map +0 -1
- package/dist/components.js +0 -5
- package/dist/components.js.map +0 -1
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tests/procaptchaReady.unit.test.d.ts +0 -2
- package/dist/tests/procaptchaReady.unit.test.d.ts.map +0 -1
- package/dist/tests/procaptchaReady.unit.test.js +0 -32
- package/dist/tests/procaptchaReady.unit.test.js.map +0 -1
- package/dist/tests/util/captchaType.test.d.ts +0 -2
- package/dist/tests/util/captchaType.test.d.ts.map +0 -1
- package/dist/tests/util/captchaType.test.js +0 -36
- package/dist/tests/util/captchaType.test.js.map +0 -1
- package/dist/tests/util/config.test.d.ts +0 -2
- package/dist/tests/util/config.test.d.ts.map +0 -1
- package/dist/tests/util/config.test.js +0 -69
- package/dist/tests/util/config.test.js.map +0 -1
- package/dist/tests/util/renderLogic.test.d.ts +0 -2
- package/dist/tests/util/renderLogic.test.d.ts.map +0 -1
- package/dist/tests/util/renderLogic.test.js +0 -136
- package/dist/tests/util/renderLogic.test.js.map +0 -1
- package/dist/util/captcha/captchaComponentProvider.d.ts +0 -8
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +0 -1
- package/dist/util/captcha/captchaComponentProvider.js.map +0 -1
- package/dist/util/captcha/captchaComponentsList.d.ts +0 -6
- package/dist/util/captcha/captchaComponentsList.d.ts.map +0 -1
- package/dist/util/captcha/captchaComponentsList.js.map +0 -1
- package/dist/util/captcha/captchaProps.d.ts +0 -10
- package/dist/util/captcha/captchaProps.d.ts.map +0 -1
- package/dist/util/captcha/captchaProps.js +0 -2
- package/dist/util/captcha/captchaProps.js.map +0 -1
- package/dist/util/captcha/captchaRenderer.d.ts +0 -24
- package/dist/util/captcha/captchaRenderer.d.ts.map +0 -1
- package/dist/util/captcha/captchaRenderer.js.map +0 -1
- package/dist/util/captcha/captchaType.d.ts +0 -3
- package/dist/util/captcha/captchaType.d.ts.map +0 -1
- package/dist/util/captcha/captchaType.js.map +0 -1
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/dist/util/captcha/components/imageCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/imageCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/imageCaptcha.js.map +0 -1
- package/dist/util/captcha/components/powCaptcha.d.ts +0 -4
- package/dist/util/captcha/components/powCaptcha.d.ts.map +0 -1
- package/dist/util/captcha/components/powCaptcha.js.map +0 -1
- package/dist/util/config.d.ts +0 -6
- package/dist/util/config.d.ts.map +0 -1
- package/dist/util/config.js.map +0 -1
- package/dist/util/configCreator.d.ts +0 -5
- package/dist/util/configCreator.d.ts.map +0 -1
- package/dist/util/configCreator.js.map +0 -1
- package/dist/util/language.d.ts +0 -3
- package/dist/util/language.d.ts.map +0 -1
- package/dist/util/language.js.map +0 -1
- package/dist/util/timeout.d.ts +0 -3
- package/dist/util/timeout.d.ts.map +0 -1
- package/dist/util/timeout.js.map +0 -1
- package/dist/util/widgetFactory.d.ts +0 -18
- package/dist/util/widgetFactory.d.ts.map +0 -1
- package/dist/util/widgetFactory.js.map +0 -1
- package/dist/util/widgetThemeResolver.d.ts +0 -9
- package/dist/util/widgetThemeResolver.d.ts.map +0 -1
- package/dist/util/widgetThemeResolver.js.map +0 -1
- package/stats.html +0 -4949
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @prosopo/procaptcha-bundle
|
|
2
2
|
|
|
3
|
+
## 3.2.3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 8ce9205: Change engine requirements
|
|
7
|
+
- b6e98b2: Run npm audit
|
|
8
|
+
- Updated dependencies [15ae7cf]
|
|
9
|
+
- Updated dependencies [bb5f41c]
|
|
10
|
+
- Updated dependencies [8ce9205]
|
|
11
|
+
- Updated dependencies [df79c03]
|
|
12
|
+
- Updated dependencies [b6e98b2]
|
|
13
|
+
- @prosopo/types@3.6.0
|
|
14
|
+
- @prosopo/util@3.2.0
|
|
15
|
+
- @prosopo/procaptcha-frictionless@2.8.15
|
|
16
|
+
- @prosopo/procaptcha-common@2.9.14
|
|
17
|
+
- @prosopo/procaptcha-react@2.9.14
|
|
18
|
+
- @prosopo/widget-skeleton@2.7.8
|
|
19
|
+
- @prosopo/procaptcha-pow@2.8.22
|
|
20
|
+
- @prosopo/dotenv@3.0.27
|
|
21
|
+
- @prosopo/locale@3.1.22
|
|
22
|
+
- @prosopo/config@3.1.22
|
|
23
|
+
|
|
3
24
|
## 3.2.2
|
|
4
25
|
### Patch Changes
|
|
5
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-bundle",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
},
|
|
38
38
|
"browserslist": ["> 0.5%, last 2 versions, not dead"],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@prosopo/dotenv": "3.0.
|
|
41
|
-
"@prosopo/locale": "3.1.
|
|
42
|
-
"@prosopo/procaptcha-common": "2.9.
|
|
43
|
-
"@prosopo/procaptcha-frictionless": "2.8.
|
|
44
|
-
"@prosopo/procaptcha-pow": "2.8.
|
|
45
|
-
"@prosopo/procaptcha-react": "2.9.
|
|
46
|
-
"@prosopo/types": "3.
|
|
47
|
-
"@prosopo/util": "3.
|
|
48
|
-
"@prosopo/widget-skeleton": "2.7.
|
|
49
|
-
"@prosopo/config": "3.1.
|
|
40
|
+
"@prosopo/dotenv": "3.0.27",
|
|
41
|
+
"@prosopo/locale": "3.1.22",
|
|
42
|
+
"@prosopo/procaptcha-common": "2.9.14",
|
|
43
|
+
"@prosopo/procaptcha-frictionless": "2.8.15",
|
|
44
|
+
"@prosopo/procaptcha-pow": "2.8.22",
|
|
45
|
+
"@prosopo/procaptcha-react": "2.9.14",
|
|
46
|
+
"@prosopo/types": "3.6.0",
|
|
47
|
+
"@prosopo/util": "3.2.0",
|
|
48
|
+
"@prosopo/widget-skeleton": "2.7.8",
|
|
49
|
+
"@prosopo/config": "3.1.22",
|
|
50
50
|
"dotenv": "16.4.5",
|
|
51
51
|
"fast-glob": "3.3.2",
|
|
52
52
|
"jsdom": "25.0.0",
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=components.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import type { ProcaptchaRenderOptions } from "@prosopo/types";
|
|
2
|
-
export declare const render: (element: Element, renderOptions: ProcaptchaRenderOptions) => Promise<void>;
|
|
3
|
-
export default function ready(fn: () => void): void;
|
|
4
|
-
export declare const execute: () => void;
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
procaptcha: {
|
|
8
|
-
ready: typeof ready;
|
|
9
|
-
render: typeof render;
|
|
10
|
-
reset: typeof reset;
|
|
11
|
-
execute: typeof execute;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const reset: () => void;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAoF9D,eAAO,MAAM,MAAM,YACT,OAAO,iBACD,uBAAuB,kBA2BtC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,QAY3C;AAED,eAAO,MAAM,OAAO,YAqBnB,CAAC;AAkCF,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;AAmCD,eAAO,MAAM,KAAK,YAOjB,CAAC"}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { getWindowCallback } from "@prosopo/procaptcha-common";
|
|
2
|
-
import { at } from "@prosopo/util";
|
|
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";
|
|
7
|
-
const BUNDLE_NAME = "procaptcha.bundle.js";
|
|
8
|
-
let procaptchaRoots = [];
|
|
9
|
-
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
10
|
-
const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
11
|
-
const PROCAPTCHA_READY_EVENT = "procaptcha:ready";
|
|
12
|
-
const implicitRender = async () => {
|
|
13
|
-
const elements = Array.from(document.getElementsByClassName("procaptcha")).filter((element) => element.tagName.toLowerCase() !== "button");
|
|
14
|
-
if (elements.length) {
|
|
15
|
-
const siteKey = at(elements, 0).getAttribute("data-sitekey");
|
|
16
|
-
const web3 = at(elements, 0).getAttribute("data-web3");
|
|
17
|
-
if (!siteKey) {
|
|
18
|
-
console.error("No site key found");
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const captchaType = getCaptchaType(elements);
|
|
22
|
-
const root = await widgetFactory.createWidgets(elements, {
|
|
23
|
-
captchaType: captchaType,
|
|
24
|
-
siteKey: siteKey,
|
|
25
|
-
}, !(web3 === "true"));
|
|
26
|
-
procaptchaRoots.push(...root);
|
|
27
|
-
}
|
|
28
|
-
const invisibleButtons = Array.from(document.getElementsByClassName("procaptcha")).filter((button) => button.tagName.toLowerCase() === "button");
|
|
29
|
-
if (invisibleButtons.length) {
|
|
30
|
-
for (const button of invisibleButtons) {
|
|
31
|
-
const siteKey = button.getAttribute("data-sitekey") || "";
|
|
32
|
-
const callback = button.getAttribute("data-callback") || "";
|
|
33
|
-
const captchaType = getCaptchaType([button]);
|
|
34
|
-
const root = await widgetFactory.createWidgets([button], {
|
|
35
|
-
captchaType: captchaType,
|
|
36
|
-
siteKey: siteKey,
|
|
37
|
-
callback: callback,
|
|
38
|
-
}, true, true);
|
|
39
|
-
procaptchaRoots.push(...root);
|
|
40
|
-
button.addEventListener("click", async (event) => {
|
|
41
|
-
event.preventDefault();
|
|
42
|
-
execute();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
export const render = async (element, renderOptions) => {
|
|
48
|
-
const hasInvisibleSize = Object.prototype.hasOwnProperty.call(renderOptions, "size") &&
|
|
49
|
-
renderOptions.size === "invisible";
|
|
50
|
-
const isWeb2 = !renderOptions.web3;
|
|
51
|
-
if (hasInvisibleSize || element.tagName.toLowerCase() === "button") {
|
|
52
|
-
const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, true);
|
|
53
|
-
procaptchaRoots.push(...roots);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, false);
|
|
57
|
-
procaptchaRoots.push(...roots);
|
|
58
|
-
};
|
|
59
|
-
export default function ready(fn) {
|
|
60
|
-
if (document && document.readyState !== "loading") {
|
|
61
|
-
console.log("document.readyState ready!");
|
|
62
|
-
fn();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
console.log("DOMContentLoaded listener!");
|
|
66
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
67
|
-
console.log("DOMContentLoaded fired");
|
|
68
|
-
console.log(window);
|
|
69
|
-
fn();
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export const execute = () => {
|
|
74
|
-
const containers = findProcaptchaContainers();
|
|
75
|
-
if (containers.length === 0) {
|
|
76
|
-
console.error("No Procaptcha containers found for execution");
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const executeEvent = new CustomEvent(PROCAPTCHA_EXECUTE_EVENT, {
|
|
80
|
-
detail: {
|
|
81
|
-
containerId: containers[0]?.id || "procaptcha-container",
|
|
82
|
-
containerCount: containers.length,
|
|
83
|
-
timestamp: Date.now(),
|
|
84
|
-
},
|
|
85
|
-
bubbles: true,
|
|
86
|
-
cancelable: true,
|
|
87
|
-
});
|
|
88
|
-
document.dispatchEvent(executeEvent);
|
|
89
|
-
};
|
|
90
|
-
function findProcaptchaContainers() {
|
|
91
|
-
const containers = [];
|
|
92
|
-
const invisibleContainers = Array.from(document.querySelectorAll('[data-size="invisible"]'));
|
|
93
|
-
containers.push(...invisibleContainers);
|
|
94
|
-
const idContainers = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]'));
|
|
95
|
-
const classContainers = Array.from(document.getElementsByClassName("p-procaptcha"));
|
|
96
|
-
containers.push(...classContainers);
|
|
97
|
-
for (const container of idContainers) {
|
|
98
|
-
if (!containers.includes(container)) {
|
|
99
|
-
containers.push(container);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return containers;
|
|
103
|
-
}
|
|
104
|
-
const start = () => {
|
|
105
|
-
const { onloadUrlCallback, renderExplicit } = extractParams(BUNDLE_NAME);
|
|
106
|
-
let readyCalled = false;
|
|
107
|
-
if (renderExplicit !== "explicit") {
|
|
108
|
-
getProcaptchaScript(BUNDLE_NAME)?.addEventListener("load", () => {
|
|
109
|
-
ready(implicitRender);
|
|
110
|
-
readyCalled = true;
|
|
111
|
-
});
|
|
112
|
-
if (document.readyState === "complete" && !readyCalled) {
|
|
113
|
-
ready(implicitRender);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (onloadUrlCallback) {
|
|
117
|
-
getProcaptchaScript(BUNDLE_NAME)?.addEventListener("load", () => {
|
|
118
|
-
const onloadCallback = getWindowCallback(onloadUrlCallback);
|
|
119
|
-
ready(onloadCallback);
|
|
120
|
-
});
|
|
121
|
-
if (document.readyState === "complete" && !readyCalled) {
|
|
122
|
-
const onloadCallback = getWindowCallback(onloadUrlCallback);
|
|
123
|
-
ready(onloadCallback);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
export const reset = () => {
|
|
128
|
-
for (const root of procaptchaRoots) {
|
|
129
|
-
root.unmount();
|
|
130
|
-
}
|
|
131
|
-
procaptchaRoots = [];
|
|
132
|
-
start();
|
|
133
|
-
};
|
|
134
|
-
window.procaptcha = { ready, render, reset, execute };
|
|
135
|
-
const procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
|
|
136
|
-
detail: {
|
|
137
|
-
timestamp: Date.now(),
|
|
138
|
-
},
|
|
139
|
-
bubbles: true,
|
|
140
|
-
cancelable: false,
|
|
141
|
-
});
|
|
142
|
-
document.dispatchEvent(procaptchaReadyEvent);
|
|
143
|
-
start();
|
|
144
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,sBAAsB,GAAG,kBAAkB,CAAC;AAGlD,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;IAEjC,MAAM,QAAQ,GAAc,KAAK,CAAC,IAAI,CACrC,QAAQ,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAC7C,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,CAAC;IAGlE,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACvD,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e,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;AAGtD,MAAM,oBAAoB,GAAG,IAAI,WAAW,CAAC,sBAAsB,EAAE;IACpE,MAAM,EAAE;QACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACrB;IACD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC;AACH,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE7C,KAAK,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"procaptchaReady.unit.test.d.ts","sourceRoot":"","sources":["../../../src/tests/procaptchaReady.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { JSDOM } from "jsdom";
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
-
describe("procaptcha:ready event", () => {
|
|
4
|
-
let dom;
|
|
5
|
-
beforeEach(() => {
|
|
6
|
-
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
7
|
-
url: "https://example.com",
|
|
8
|
-
});
|
|
9
|
-
global.document = dom.window.document;
|
|
10
|
-
global.window = dom.window;
|
|
11
|
-
});
|
|
12
|
-
afterEach(() => {
|
|
13
|
-
global.document = undefined;
|
|
14
|
-
global.window = undefined;
|
|
15
|
-
});
|
|
16
|
-
it("should dispatch procaptcha:ready event when window.procaptcha is set", (done) => {
|
|
17
|
-
document.addEventListener("procaptcha:ready", (event) => {
|
|
18
|
-
const customEvent = event;
|
|
19
|
-
expect(customEvent.detail).toBeDefined();
|
|
20
|
-
expect(typeof customEvent.detail.timestamp).toBe("number");
|
|
21
|
-
expect(customEvent.bubbles).toBe(true);
|
|
22
|
-
expect(customEvent.cancelable).toBe(false);
|
|
23
|
-
expect(window.procaptcha).toBeDefined();
|
|
24
|
-
expect(window.procaptcha?.render).toBeDefined();
|
|
25
|
-
expect(window.procaptcha?.ready).toBeDefined();
|
|
26
|
-
expect(window.procaptcha?.reset).toBeDefined();
|
|
27
|
-
expect(window.procaptcha?.execute).toBeDefined();
|
|
28
|
-
});
|
|
29
|
-
import("../index.js");
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=procaptchaReady.unit.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"procaptchaReady.unit.test.js","sourceRoot":"","sources":["../../../src/tests/procaptchaReady.unit.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,IAAI,GAAU,CAAC;IAEf,UAAU,CAAC,GAAG,EAAE;QACf,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,EAAE;YAC5D,GAAG,EAAE,qBAAqB;SAC1B,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QAEtC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,MAA+C,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QAEb,MAAc,CAAC,QAAQ,GAAG,SAAS,CAAC;QAEpC,MAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sEAAsE,EAAE,CAAC,IAAI,EAAE,EAAE;QAEnF,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,KAAY,EAAE,EAAE;YAC9D,MAAM,WAAW,GAAG,KAAoB,CAAC;YACzC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YACzC,MAAM,CAAC,OAAO,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3D,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAG3C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;YACxC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YAChD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAC/C,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YAC/C,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;QAClD,CAAC,CAAC,CAAC;QAGH,MAAM,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"captchaType.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/util/captchaType.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CaptchaType } from "@prosopo/types";
|
|
2
|
-
import { JSDOM } from "jsdom";
|
|
3
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
4
|
-
import { getCaptchaType } from "../../util/captcha/captchaType.js";
|
|
5
|
-
describe("getCaptchaType", () => {
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
|
|
8
|
-
global.document = dom.window.document;
|
|
9
|
-
});
|
|
10
|
-
it("should return the correct captcha type when a valid type is set", () => {
|
|
11
|
-
const element = document.createElement("div");
|
|
12
|
-
element.setAttribute("data-captcha-type", CaptchaType.pow);
|
|
13
|
-
const result = getCaptchaType([element]);
|
|
14
|
-
expect(result).toBe(CaptchaType.pow);
|
|
15
|
-
});
|
|
16
|
-
it('should return "frictionless" when no captcha type is set', () => {
|
|
17
|
-
const element = document.createElement("div");
|
|
18
|
-
const result = getCaptchaType([element]);
|
|
19
|
-
expect(result).toBe("frictionless");
|
|
20
|
-
});
|
|
21
|
-
it('should return "frictionless" when an invalid captcha type is set', () => {
|
|
22
|
-
const element = document.createElement("div");
|
|
23
|
-
element.setAttribute("data-captcha-type", "invalid-type");
|
|
24
|
-
const result = getCaptchaType([element]);
|
|
25
|
-
expect(result).toBe("frictionless");
|
|
26
|
-
});
|
|
27
|
-
it("should work with all valid FeaturesEnum values", () => {
|
|
28
|
-
const element = document.createElement("div");
|
|
29
|
-
for (const feature of Object.values(CaptchaType)) {
|
|
30
|
-
element.setAttribute("data-captcha-type", feature);
|
|
31
|
-
const result = getCaptchaType([element]);
|
|
32
|
-
expect(result).toBe(feature);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=captchaType.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,mC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gD,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/util/config.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { JSDOM } from "jsdom";
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
-
import { extractParams, getProcaptchaScript } from "../../util/config.js";
|
|
4
|
-
describe("Config utility functions", () => {
|
|
5
|
-
let dom;
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
8
|
-
url: "https://example.com",
|
|
9
|
-
});
|
|
10
|
-
global.document = dom.window.document;
|
|
11
|
-
});
|
|
12
|
-
afterEach(() => {
|
|
13
|
-
global.document = undefined;
|
|
14
|
-
});
|
|
15
|
-
describe("getProcaptchaScript", () => {
|
|
16
|
-
it("should return null when no matching script is found", () => {
|
|
17
|
-
const result = getProcaptchaScript("nonexistent");
|
|
18
|
-
expect(result).toBeNull();
|
|
19
|
-
});
|
|
20
|
-
it("should return the script element when a matching script is found", () => {
|
|
21
|
-
const script = document.createElement("script");
|
|
22
|
-
script.src = "https://example.com/procaptcha.js";
|
|
23
|
-
document.body.appendChild(script);
|
|
24
|
-
const result = getProcaptchaScript("procaptcha");
|
|
25
|
-
expect(result).toBe(script);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
describe("extractParams", () => {
|
|
29
|
-
it("should return undefined values when no matching script is found", () => {
|
|
30
|
-
const result = extractParams("nonexistent");
|
|
31
|
-
expect(result).toEqual({
|
|
32
|
-
onloadUrlCallback: undefined,
|
|
33
|
-
renderExplicit: undefined,
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
it("should extract parameters from the script URL", () => {
|
|
37
|
-
const script = document.createElement("script");
|
|
38
|
-
script.src =
|
|
39
|
-
"https://example.com/procaptcha.js?onload=onloadCallback&render=explicit";
|
|
40
|
-
document.body.appendChild(script);
|
|
41
|
-
const result = extractParams("procaptcha");
|
|
42
|
-
expect(result).toEqual({
|
|
43
|
-
onloadUrlCallback: "onloadCallback",
|
|
44
|
-
renderExplicit: "explicit",
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
it("should return undefined for missing parameters", () => {
|
|
48
|
-
const script = document.createElement("script");
|
|
49
|
-
script.src = "https://example.com/procaptcha.js?onload=onloadCallback";
|
|
50
|
-
document.body.appendChild(script);
|
|
51
|
-
const result = extractParams("procaptcha");
|
|
52
|
-
expect(result).toEqual({
|
|
53
|
-
onloadUrlCallback: "onloadCallback",
|
|
54
|
-
renderExplicit: undefined,
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
it("should handle scripts without query parameters", () => {
|
|
58
|
-
const script = document.createElement("script");
|
|
59
|
-
script.src = "https://example.com/procaptcha.js";
|
|
60
|
-
document.body.appendChild(script);
|
|
61
|
-
const result = extractParams("procaptcha");
|
|
62
|
-
expect(result).toEqual({
|
|
63
|
-
onloadUrlCallback: undefined,
|
|
64
|
-
renderExplicit: undefined,
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
//# sourceMappingURL=config.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"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,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAChD,MAAM,CAAC,GAAG,GAAG,mCAAmC,CAAC;YACjD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAElC,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;gBACtB,iBAAiB,EAAE,SAAS;gBAC5B,cAAc,EAAE,SAAS;aACzB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderLogic.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/util/renderLogic.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
3
|
-
import { JSDOM } from "jsdom";
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
-
import { WidgetFactory } from "../../util/widgetFactory.js";
|
|
6
|
-
import { WidgetThemeResolver } from "../../util/widgetThemeResolver.js";
|
|
7
|
-
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
8
|
-
const callbacks = {
|
|
9
|
-
onHuman: () => console.log("onHuman"),
|
|
10
|
-
onChallengeExpired: () => console.log("onChallengeExpired"),
|
|
11
|
-
onExpired: () => console.log("onExpired"),
|
|
12
|
-
onError: () => console.log("onError"),
|
|
13
|
-
onClose: () => console.log("onClose"),
|
|
14
|
-
onOpen: () => console.log("onOpen"),
|
|
15
|
-
onFailed: () => console.log("onFailed"),
|
|
16
|
-
onReset: () => console.log("onReset"),
|
|
17
|
-
onExtensionNotFound: () => console.log("onExtensionNotFound"),
|
|
18
|
-
onReload: () => console.log("onReload"),
|
|
19
|
-
};
|
|
20
|
-
vi.mock("@prosopo/detector", async () => {
|
|
21
|
-
return {
|
|
22
|
-
isBot: async () => {
|
|
23
|
-
return { isBot: true };
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
vi.mock("@polkadot/extension-dapp", async () => {
|
|
28
|
-
return {
|
|
29
|
-
web3Enable: async () => {
|
|
30
|
-
return [];
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
vi.mock("@prosopo/procaptcha-pow", async () => {
|
|
35
|
-
return {
|
|
36
|
-
ProcaptchaPow: vi.fn((props) => {
|
|
37
|
-
return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaPow" }));
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
vi.mock("@prosopo/procaptcha-frictionless", async () => {
|
|
42
|
-
return {
|
|
43
|
-
ProcaptchaFrictionless: vi.fn((props) => {
|
|
44
|
-
return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaFrictionless" }));
|
|
45
|
-
}),
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
describe("Config utility functions", () => {
|
|
49
|
-
let dom;
|
|
50
|
-
beforeEach((context) => {
|
|
51
|
-
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
52
|
-
url: "https://example.com",
|
|
53
|
-
});
|
|
54
|
-
context.document = dom.window.document;
|
|
55
|
-
context.window = dom.window;
|
|
56
|
-
global.window = dom.window;
|
|
57
|
-
global.document = dom.window.document;
|
|
58
|
-
global.HTMLElement = dom.window.HTMLElement;
|
|
59
|
-
global.Element = dom.window.Element;
|
|
60
|
-
global.Node = dom.window.Node;
|
|
61
|
-
global.navigator = dom.window.navigator;
|
|
62
|
-
vi.clearAllMocks();
|
|
63
|
-
});
|
|
64
|
-
afterEach((context) => {
|
|
65
|
-
context.document = undefined;
|
|
66
|
-
context.window = undefined;
|
|
67
|
-
global.HTMLElement = undefined;
|
|
68
|
-
global.Element = undefined;
|
|
69
|
-
global.Node = undefined;
|
|
70
|
-
global.navigator = undefined;
|
|
71
|
-
vi.clearAllMocks();
|
|
72
|
-
});
|
|
73
|
-
it("renders the correct captcha type", async (ctx) => {
|
|
74
|
-
const script = ctx.document.createElement("script");
|
|
75
|
-
script.src = "https://example.com/procaptcha.js";
|
|
76
|
-
document.body.appendChild(script);
|
|
77
|
-
expect(ctx.window).toBeDefined();
|
|
78
|
-
if (!ctx.window) {
|
|
79
|
-
expect(true).toBe(false);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
await widgetFactory.createWidgets([script], {
|
|
83
|
-
siteKey: "1234",
|
|
84
|
-
captchaType: "pow",
|
|
85
|
-
});
|
|
86
|
-
await vi.waitFor(() => {
|
|
87
|
-
expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
it("user callbacks should be set when defined on the window and pulled in via data attributes", async (ctx) => {
|
|
91
|
-
const script = ctx.document.createElement("script");
|
|
92
|
-
script.src = "https://example.com/procaptcha.js";
|
|
93
|
-
script["data-callback"] = "onHuman";
|
|
94
|
-
script["data-chalexpired-callback"] = "onChallengeExpired";
|
|
95
|
-
script["data-expired-callback"] = "onExpired";
|
|
96
|
-
script["data-error-callback"] = "onError";
|
|
97
|
-
script["data-close-callback"] = "onClose";
|
|
98
|
-
script["data-open-callback"] = "onOpen";
|
|
99
|
-
script["data-failed-callback"] = "onFailed";
|
|
100
|
-
script["data-reset-callback"] = "onReset";
|
|
101
|
-
document.body.appendChild(script);
|
|
102
|
-
expect(ctx.window).toBeDefined();
|
|
103
|
-
if (!ctx.window) {
|
|
104
|
-
expect(true).toBe(false);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
ctx.window.onHuman = callbacks.onHuman;
|
|
108
|
-
ctx.window.onChallengeExpired = callbacks.onChallengeExpired;
|
|
109
|
-
ctx.window.onExpired = callbacks.onExpired;
|
|
110
|
-
ctx.window.onError = callbacks.onError;
|
|
111
|
-
ctx.window.onClose = callbacks.onClose;
|
|
112
|
-
ctx.window.onOpen = callbacks.onOpen;
|
|
113
|
-
ctx.window.onFailed = callbacks.onFailed;
|
|
114
|
-
ctx.window.onReset = callbacks.onReset;
|
|
115
|
-
ctx.window.onExtensionNotFound = callbacks.onExtensionNotFound;
|
|
116
|
-
ctx.window.onReload = callbacks.onReload;
|
|
117
|
-
await widgetFactory.createWidgets([script], {
|
|
118
|
-
siteKey: "1234",
|
|
119
|
-
captchaType: "pow",
|
|
120
|
-
});
|
|
121
|
-
await vi.waitFor(() => {
|
|
122
|
-
expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
|
|
123
|
-
const call = ProcaptchaPow.mock.calls[0];
|
|
124
|
-
const props = call[0];
|
|
125
|
-
expect(props.config.account.address).toBe("1234");
|
|
126
|
-
expect(props.config.web2).toBe(true);
|
|
127
|
-
expect(props.config.solutionThreshold).toBe(80);
|
|
128
|
-
expect(props.config.dappName).toBe("ProsopoClientDapp");
|
|
129
|
-
expect(props.config.theme).toBe("light");
|
|
130
|
-
expect(props.config.mode).toBe("visible");
|
|
131
|
-
expect(props.callbacks).toBeDefined();
|
|
132
|
-
expect(typeof props.callbacks).toBe("object");
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=renderLogic.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAExD,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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AC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAG1C,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,CAAC,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { 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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"captchaComponentProvider.d.ts","sourceRoot":"","sources":["../../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,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;CAkBZ;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CaptchaType } from "@prosopo/types";
|
|
3
|
-
import { captchaComponentsList } from "./captchaComponentsList.js";
|
|
4
|
-
class CaptchaComponentProvider {
|
|
5
|
-
getCaptchaComponent(captchaType, captchaProps) {
|
|
6
|
-
if (captchaType === CaptchaType.invisible) {
|
|
7
|
-
throw new Error("Not Implemented");
|
|
8
|
-
}
|
|
9
|
-
const CaptchaComponent = captchaComponentsList[captchaType];
|
|
10
|
-
console.log(`rendering ${captchaType}`);
|
|
11
|
-
return (_jsx(CaptchaComponent, { config: captchaProps.config, callbacks: captchaProps.callbacks, i18n: captchaProps.i18n, container: captchaProps.container }));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export { CaptchaComponentProvider };
|
|
15
|
-
//# sourceMappingURL=captchaComponentProvider.js.map
|