@prosopo/procaptcha-react 2.11.3 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +15 -15
  2. package/.turbo/turbo-build$colon$tsc.log +22 -22
  3. package/.turbo/turbo-build.log +16 -15
  4. package/CHANGELOG.md +79 -0
  5. package/dist/cjs/components/button.cjs +98 -0
  6. package/dist/cjs/components/captchaComponent.cjs +225 -0
  7. package/dist/cjs/components/captchaWidget.cjs +210 -0
  8. package/dist/cjs/components/collector.cjs +49 -0
  9. package/dist/cjs/components/index.cjs +15 -6
  10. package/dist/cjs/components/modal.cjs +39 -0
  11. package/dist/cjs/components/procaptcha.cjs +23 -0
  12. package/dist/cjs/components/procaptchaWidget.cjs +166 -0
  13. package/dist/cjs/index.cjs +15 -6
  14. package/dist/cjs/util/index.cjs +6 -4
  15. package/dist/components/button.d.ts +9 -0
  16. package/dist/components/button.d.ts.map +1 -0
  17. package/dist/components/button.js +98 -0
  18. package/dist/components/button.js.map +1 -0
  19. package/dist/components/{CaptchaComponent.d.ts → captchaComponent.d.ts} +5 -3
  20. package/dist/components/captchaComponent.d.ts.map +1 -0
  21. package/dist/components/captchaComponent.js +225 -0
  22. package/dist/components/captchaComponent.js.map +1 -0
  23. package/dist/components/{CaptchaWidget.d.ts → captchaWidget.d.ts} +3 -2
  24. package/dist/components/captchaWidget.d.ts.map +1 -0
  25. package/dist/components/captchaWidget.js +210 -0
  26. package/dist/components/captchaWidget.js.map +1 -0
  27. package/dist/components/collector.d.ts +5 -4
  28. package/dist/components/collector.d.ts.map +1 -1
  29. package/dist/components/collector.js +46 -24
  30. package/dist/components/collector.js.map +1 -1
  31. package/dist/components/index.d.ts +7 -5
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/index.js +8 -4
  34. package/dist/components/index.js.map +1 -1
  35. package/dist/components/modal.d.ts +14 -0
  36. package/dist/components/modal.d.ts.map +1 -0
  37. package/dist/components/modal.js +39 -0
  38. package/dist/components/modal.js.map +1 -0
  39. package/dist/components/procaptcha.d.ts +7 -0
  40. package/dist/components/procaptcha.d.ts.map +1 -0
  41. package/dist/components/procaptcha.js +22 -0
  42. package/dist/components/procaptcha.js.map +1 -0
  43. package/dist/components/procaptchaWidget.d.ts +7 -0
  44. package/dist/components/procaptchaWidget.d.ts.map +1 -0
  45. package/dist/components/procaptchaWidget.js +166 -0
  46. package/dist/components/procaptchaWidget.js.map +1 -0
  47. package/dist/index.js +8 -4
  48. package/dist/tests/button.unit.test.d.ts.map +1 -1
  49. package/dist/tests/button.unit.test.js +99 -50
  50. package/dist/tests/button.unit.test.js.map +1 -1
  51. package/dist/tests/captchaComponent.unit.test.d.ts.map +1 -1
  52. package/dist/tests/captchaComponent.unit.test.js +35 -13
  53. package/dist/tests/captchaComponent.unit.test.js.map +1 -1
  54. package/dist/tests/captchaWidget.unit.test.d.ts.map +1 -1
  55. package/dist/tests/captchaWidget.unit.test.js +125 -12
  56. package/dist/tests/captchaWidget.unit.test.js.map +1 -1
  57. package/dist/tests/collector.unit.test.d.ts.map +1 -1
  58. package/dist/tests/collector.unit.test.js +43 -10
  59. package/dist/tests/collector.unit.test.js.map +1 -1
  60. package/dist/tests/harness.d.ts +2 -0
  61. package/dist/tests/harness.d.ts.map +1 -1
  62. package/dist/tests/harness.js +7 -0
  63. package/dist/tests/harness.js.map +1 -1
  64. package/dist/tests/modal.unit.test.d.ts.map +1 -1
  65. package/dist/tests/modal.unit.test.js +45 -16
  66. package/dist/tests/modal.unit.test.js.map +1 -1
  67. package/dist/tests/procaptcha.unit.test.d.ts.map +1 -1
  68. package/dist/tests/procaptcha.unit.test.js +37 -15
  69. package/dist/tests/procaptcha.unit.test.js.map +1 -1
  70. package/dist/tests/procaptchaReact.test-d.js +8 -6
  71. package/dist/tests/procaptchaReact.test-d.js.map +1 -1
  72. package/dist/tests/procaptchaWidget.unit.test.d.ts.map +1 -1
  73. package/dist/tests/procaptchaWidget.unit.test.js +121 -96
  74. package/dist/tests/procaptchaWidget.unit.test.js.map +1 -1
  75. package/dist/tests/render.d.ts +6 -7
  76. package/dist/tests/render.d.ts.map +1 -1
  77. package/dist/tests/render.js +23 -30
  78. package/dist/tests/render.js.map +1 -1
  79. package/dist/util/index.d.ts +8 -7
  80. package/dist/util/index.d.ts.map +1 -1
  81. package/dist/util/index.js +6 -4
  82. package/dist/util/index.js.map +1 -1
  83. package/package.json +9 -14
  84. package/vite.test.config.ts +1 -2
  85. package/dist/cjs/_virtual/_rolldown/runtime.cjs +0 -23
  86. package/dist/cjs/components/Button.cjs +0 -81
  87. package/dist/cjs/components/CaptchaComponent.cjs +0 -171
  88. package/dist/cjs/components/CaptchaWidget.cjs +0 -129
  89. package/dist/cjs/components/Modal.cjs +0 -35
  90. package/dist/cjs/components/Procaptcha.cjs +0 -7
  91. package/dist/cjs/components/ProcaptchaWidget.cjs +0 -168
  92. package/dist/components/Button.d.ts +0 -11
  93. package/dist/components/Button.d.ts.map +0 -1
  94. package/dist/components/Button.js +0 -81
  95. package/dist/components/Button.js.map +0 -1
  96. package/dist/components/CaptchaComponent.d.ts.map +0 -1
  97. package/dist/components/CaptchaComponent.js +0 -171
  98. package/dist/components/CaptchaComponent.js.map +0 -1
  99. package/dist/components/CaptchaWidget.d.ts.map +0 -1
  100. package/dist/components/CaptchaWidget.js +0 -129
  101. package/dist/components/CaptchaWidget.js.map +0 -1
  102. package/dist/components/Modal.d.ts +0 -13
  103. package/dist/components/Modal.d.ts.map +0 -1
  104. package/dist/components/Modal.js +0 -33
  105. package/dist/components/Modal.js.map +0 -1
  106. package/dist/components/Procaptcha.d.ts +0 -4
  107. package/dist/components/Procaptcha.d.ts.map +0 -1
  108. package/dist/components/Procaptcha.js +0 -7
  109. package/dist/components/Procaptcha.js.map +0 -1
  110. package/dist/components/ProcaptchaWidget.d.ts +0 -4
  111. package/dist/components/ProcaptchaWidget.d.ts.map +0 -1
  112. package/dist/components/ProcaptchaWidget.js +0 -168
  113. package/dist/components/ProcaptchaWidget.js.map +0 -1
  114. package/dist/tests/setup.d.ts +0 -5
  115. package/dist/tests/setup.d.ts.map +0 -1
  116. package/dist/tests/setup.js +0 -3
  117. package/dist/tests/setup.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.11.3 build:cjs
2
+ > @prosopo/procaptcha-react@2.13.0 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -7,8 +7,8 @@ ViteCommonJSConfig: .
7
7
  tsConfigPaths: [
8
8
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
9
9
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
10
- '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
11
10
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
11
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
12
12
  '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
13
13
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
14
14
  '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
@@ -27,8 +27,8 @@ ViteCommonJSConfig: .
27
27
  externals: [
28
28
  '@prosopo/common',
29
29
  '@prosopo/locale',
30
- '@prosopo/logger',
31
30
  '@prosopo/util',
31
+ '@prosopo/logger',
32
32
  '@prosopo/types',
33
33
  '@prosopo/util-crypto',
34
34
  '@prosopo/procaptcha',
@@ -47,18 +47,18 @@ ViteCommonJSConfig: .
47
47
  vite v8.1.5 building ssr environment for production...
48
48
  Bundle build started
49
49
  
50
- ✓ 10 modules transformed.
50
+ ✓ 11 modules transformed.
51
51
  rendering chunks...
52
52
  computing gzip size...
53
- dist/cjs/components/index.cjs 0.35 kB │ gzip: 0.12 kB
54
- dist/cjs/index.cjs 0.46 kB │ gzip: 0.18 kB
55
- dist/cjs/components/Procaptcha.cjs 0.49 kB │ gzip: 0.27 kB
56
- dist/cjs/util/index.cjs 0.50 kB │ gzip: 0.32 kB
57
- dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
58
- dist/cjs/components/Modal.cjs 1.18 kB │ gzip: 0.60 kB
59
- dist/cjs/components/Button.cjs 2.86 kB │ gzip: 1.18 kB
60
- dist/cjs/components/CaptchaWidget.cjs 4.52 kB │ gzip: 1.68 kB
61
- dist/cjs/components/CaptchaComponent.cjs 6.18 kB │ gzip: 1.57 kB
62
- dist/cjs/components/ProcaptchaWidget.cjs 6.95 kB │ gzip: 2.02 kB
53
+ dist/cjs/util/index.cjs 0.56 kB │ gzip: 0.35 kB
54
+ dist/cjs/components/procaptcha.cjs 0.75 kB │ gzip: 0.41 kB
55
+ dist/cjs/components/index.cjs 0.89 kB │ gzip: 0.22 kB
56
+ dist/cjs/index.cjs 1.04 kB │ gzip: 0.28 kB
57
+ dist/cjs/components/modal.cjs 1.39 kB │ gzip: 0.64 kB
58
+ dist/cjs/components/collector.cjs 1.53 kB │ gzip: 0.68 kB
59
+ dist/cjs/components/button.cjs 3.22 kB │ gzip: 1.21 kB
60
+ dist/cjs/components/procaptchaWidget.cjs 6.33 kB │ gzip: 2.06 kB
61
+ dist/cjs/components/captchaWidget.cjs 7.05 kB │ gzip: 2.48 kB
62
+ dist/cjs/components/captchaComponent.cjs 8.29 kB │ gzip: 2.17 kB
63
63
 
64
- ✓ built in 60ms
64
+ ✓ built in 53ms
@@ -1,11 +1,11 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.11.3 build:tsc
2
+ > @prosopo/procaptcha-react@2.13.0 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 2:43:00 PM - Projects in this build:
5
+ 3:28:58 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
- * ../locale/tsconfig.json
8
7
  * ../util/tsconfig.json
8
+ * ../locale/tsconfig.json
9
9
  * ../logger/tsconfig.json
10
10
  * ../util-crypto/tsconfig.json
11
11
  * ../types/tsconfig.json
@@ -22,41 +22,41 @@
22
22
  * ../procaptcha/tsconfig.json
23
23
  * tsconfig.json
24
24
 
25
- 2:43:01 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
25
+ 3:28:58 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
26
26
 
27
- 2:43:01 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
27
+ 3:28:58 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
28
28
 
29
- 2:43:01 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
29
+ 3:28:58 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
30
30
 
31
- 2:43:01 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
31
+ 3:28:58 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
32
32
 
33
- 2:43:01 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
33
+ 3:28:58 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
34
34
 
35
- 2:43:01 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
35
+ 3:28:58 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
36
36
 
37
- 2:43:01 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/utils/batches.ts' is older than output '../common/tsconfig.tsbuildinfo'
37
+ 3:28:58 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
38
38
 
39
- 2:43:01 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
39
+ 3:28:58 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
40
40
 
41
- 2:43:01 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
+ 3:28:58 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
42
42
 
43
- 2:43:01 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
43
+ 3:28:58 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
44
44
 
45
- 2:43:01 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWebComponent.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
45
+ 3:28:58 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/theme.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
46
46
 
47
- 2:43:01 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
47
+ 3:28:58 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
48
48
 
49
- 2:43:01 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
49
+ 3:28:58 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
50
50
 
51
- 2:43:01 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/pair/decode.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
51
+ 3:28:58 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
52
52
 
53
- 2:43:01 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/workers/cryptoWorker.ts' is older than output '../account/tsconfig.tsbuildinfo'
53
+ 3:28:58 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/index.ts' is older than output '../account/tsconfig.tsbuildinfo'
54
54
 
55
- 2:43:01 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/challengeSurfaceRender.unit.test.tsx' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
55
+ 3:28:58 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/extensionLoader.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
56
56
 
57
- 2:43:01 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/modules/Manager.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
57
+ 3:28:58 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/modules/Manager.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
58
58
 
59
- 2:43:01 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
59
+ 3:28:58 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
60
60
 
61
- 2:43:01 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
61
+ 3:28:58 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
62
62
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.11.3 build
2
+ > @prosopo/procaptcha-react@2.13.0 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-react@2.11.3 build:cross-env
6
+ > @prosopo/procaptcha-react@2.13.0 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -11,8 +11,8 @@ ViteEsmConfig: .
11
11
  tsConfigPaths: [
12
12
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
13
13
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
14
- '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
15
14
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
15
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
16
16
  '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
17
17
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
18
18
  '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
@@ -31,8 +31,8 @@ ViteEsmConfig: .
31
31
  externals: [
32
32
  '@prosopo/common',
33
33
  '@prosopo/locale',
34
- '@prosopo/logger',
35
34
  '@prosopo/util',
35
+ '@prosopo/logger',
36
36
  '@prosopo/types',
37
37
  '@prosopo/util-crypto',
38
38
  '@prosopo/procaptcha',
@@ -51,18 +51,19 @@ ViteEsmConfig: .
51
51
  vite v8.1.5 building ssr environment for production...
52
52
  Bundle build started
53
53
  
54
- ✓ 10 modules transformed.
54
+ ✓ 11 modules transformed.
55
55
  rendering chunks...
56
56
  computing gzip size...
57
57
  dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
58
- dist/components/index.js 0.20 kB │ gzip: 0.09 kB
59
- dist/index.js 0.27 kB │ gzip: 0.13 kB
60
- dist/components/Procaptcha.js 0.37 kB │ gzip: 0.24 kB
61
- dist/util/index.js 0.50 kB │ gzip: 0.33 kB
62
- dist/components/Modal.js 0.93 kB │ gzip: 0.53 kB
63
- dist/components/Button.js 2.62 kB │ gzip: 1.15 kB
64
- dist/components/CaptchaWidget.js 4.16 kB │ gzip: 1.64 kB
65
- dist/components/CaptchaComponent.js 5.27 kB │ gzip: 1.52 kB
66
- dist/components/ProcaptchaWidget.js 6.20 kB │ gzip: 1.97 kB
58
+ dist/components/index.js 0.53 kB │ gzip: 0.19 kB
59
+ dist/util/index.js 0.56 kB │ gzip: 0.35 kB
60
+ dist/index.js 0.65 kB │ gzip: 0.21 kB
61
+ dist/components/procaptcha.js 0.68 kB │ gzip: 0.38 kB
62
+ dist/components/modal.js 1.22 kB │ gzip: 0.61 kB
63
+ dist/components/collector.js 1.44 kB │ gzip: 0.66 kB
64
+ dist/components/button.js 2.99 kB │ gzip: 1.19 kB
65
+ dist/components/procaptchaWidget.js 6.00 kB │ gzip: 2.05 kB
66
+ dist/components/captchaWidget.js 6.48 kB │ gzip: 2.45 kB
67
+ dist/components/captchaComponent.js 7.28 kB │ gzip: 2.13 kB
67
68
 
68
- ✓ built in 71ms
69
+ ✓ built in 33ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # @prosopo/procaptcha-react
2
2
 
3
+ ## 2.13.0
4
+ ### Minor Changes
5
+
6
+ - 5e5fb9e: Give the image challenge dialog different class names, a different DOM shape, different element types for its controls and slightly different spacing on every page load, so a solver script cannot hardcode a way to find or click anything inside it.
7
+
8
+ This is the same treatment the checkbox got. Until now the dialog was identical for every user, forever: the panel was always `.prosopo-modalInner` inside `.prosopo-modalOuter` inside `.prosopo-challenge-content`, every tile and every action was a `<button>`, the grid gap was always 10px, and the whole thing sat at the same offsets. The end-to-end suite was itself finding the images by climbing four parents and stepping sideways from the instruction line — which is the clearest possible evidence that the markup was a reliable handle.
9
+
10
+ Four things now change, all drawn fresh each time a challenge mounts:
11
+
12
+ - **The names.** Every class the dialog renders — the two modal layers, the challenge surface and its panel, the reload control — is an 8-character token drawn at mount. Selectors scraped from one page load are dead on the next. The challenge surface is shared with the puzzle, so the puzzle gets this too. Nothing in the widget's own CSS referenced these names, but a site that had written its own rules against `.prosopo-modalOuter`, `.prosopo-modalInner`, `.prosopo-challenge-content` or `.reload-button` will find they no longer match. `image-captcha` on the widget root stays fixed, as `prosopo-checkbox` did, because that one sits in the embedding page's light DOM.
13
+ - **The shape.** The panel, the header, the grid, the action row, each action and each tile sit inside a random number of randomly named `div` or `span` wrappers. The wrappers are `display: contents`, so they generate no boxes and cannot move anything: depth varies, layout does not. Only elements with no accessible role are used, so nothing new is announced to a screen reader.
14
+ - **The element each control is made of.** Every tile and every action is now randomly either a real `<button>` or a `<div role="button" tabindex="0">`, so `button` no longer finds them all. The generic variant is given by hand what the button gave for free: it is in the tab order, it activates on Enter and on Space, Space does not scroll the dialog, and it carries the same `aria-pressed` state. The surface's focus trap already matched `[tabindex]:not([tabindex="-1"])`, so both variants are trapped and tabbable alike.
15
+ - **The spacing.** The grid gap, the grid's and the header's padding, the action row's padding and the panel's own margins are each nudged a few pixels, so tile centres are not where they were last time. Each of these changes the panel's size rather than moving the panel, so the surface still centres it and a panel taller than the viewport still scrolls to its own edges. The tile and action widths are now derived from the gap they were drawn with — three columns fit only if each cell gives up two thirds of a gap, and the old hardcoded basis would have wrapped the row at the wide end of the range.
16
+
17
+ Three related fixes come with it:
18
+
19
+ - The tick badge on a selected tile was shipping `data-testid="CheckIcon"` to production, plus an `aria-label` on an `aria-hidden` element that nothing could ever read and a stray `color="#fff"` attribute. All three are gone.
20
+ - The reload button acted on any click, including one a script dispatched. It now takes the same trusted-event gate every other control in the widget has.
21
+ - The end-to-end suite no longer depends on the markup at all. It uses `data-cy` hooks — the instruction line, the challenge panel, the round, the reload control — that are withheld from production builds, exactly as the checkbox withholds `captcha-checkbox`.
22
+
23
+ Note what this does not do. The dialog still says it is a dialog, the tiles still expose the button role and their pressed state, and the images still carry alt text. A script that looks for what these things mean rather than what they are called will still find them. That is the price of the challenge being usable with a screen reader, and it is the right price; the point here is to kill the cheap selector, not to claim the dialog is unfindable.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [94929c3]
28
+ - Updated dependencies [a9141c3]
29
+ - Updated dependencies [a9141c3]
30
+ - Updated dependencies [a9141c3]
31
+ - Updated dependencies [e180281]
32
+ - Updated dependencies [5e5fb9e]
33
+ - @prosopo/procaptcha-common@2.17.0
34
+ - @prosopo/locale@3.6.0
35
+ - @prosopo/common@3.1.59
36
+ - @prosopo/types@5.10.0
37
+ - @prosopo/util@3.3.11
38
+ - @prosopo/widget-skeleton@2.9.0
39
+ - @prosopo/procaptcha@2.11.18
40
+
41
+ ## 2.12.0
42
+ ### Minor Changes
43
+
44
+ - 59c02da: Replace React with vanilla TS/DOM in the widget.
45
+
46
+ The widget packages no longer depend on react, react-dom, @emotion or
47
+ react-i18next: every component is now a `mount*` function returning a handle
48
+ with `update`/`destroy`. `useTranslation` is replaced by `createTranslator`,
49
+ which exposes i18next's `t` plus the events that used to trigger a re-render.
50
+ The rendered markup, styling and behaviour are unchanged — only the
51
+ implementation is.
52
+
53
+ Everything the widget has gained since this rewrite started is carried over,
54
+ so nothing is lost by dropping React: the shared challenge surface (popup and
55
+ float placement, escape/outside-click dismissal and the dialog focus trap),
56
+ the image-tile and puzzle-piece keyboard paths, the checkbox's focus handover
57
+ across the loading swap, the server-rendered puzzle imagery, `startMode:
58
+ "manual"` with `window.procaptcha.start()`, `data-bind` / targeted
59
+ `execute(widgetId)`, the Web Bot Auth "authenticated" badge, the client
60
+ session id, and the bounded session re-mint and reload handling in the
61
+ frictionless wrapper.
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [59c02da]
66
+ - @prosopo/procaptcha-common@2.16.0
67
+ - @prosopo/locale@3.5.0
68
+ - @prosopo/procaptcha@2.11.17
69
+ - @prosopo/common@3.1.58
70
+ - @prosopo/types@5.9.2
71
+
72
+ ## 2.11.4
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [a22069d]
76
+ - @prosopo/types@5.9.1
77
+ - @prosopo/locale@3.4.4
78
+ - @prosopo/common@3.1.57
79
+ - @prosopo/procaptcha@2.11.16
80
+ - @prosopo/procaptcha-common@2.15.1
81
+
3
82
  ## 2.11.3
4
83
  ### Patch Changes
5
84
 
@@ -0,0 +1,98 @@
1
+ const require_index = require("../util/index.cjs");
2
+ let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
3
+ let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
4
+ //#region src/components/button.ts
5
+ var buttonStyleBase = {
6
+ display: "inline-flex",
7
+ alignItems: "center",
8
+ justifyContent: "center",
9
+ position: "relative",
10
+ boxSizing: "border-box",
11
+ outline: "0px",
12
+ margin: "0px",
13
+ cursor: "pointer",
14
+ userSelect: "none",
15
+ verticalAlign: "middle",
16
+ textDecoration: "none",
17
+ textTransform: "none",
18
+ minWidth: "64px",
19
+ minHeight: "40px",
20
+ borderRadius: "100px",
21
+ border: "none",
22
+ transition: "background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, filter 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
23
+ backgroundColor: "transparent"
24
+ };
25
+ var mountButton = (container, initialProps) => {
26
+ const teardown = new _prosopo_procaptcha_common.Teardown();
27
+ let props = initialProps;
28
+ let hover = false;
29
+ let focusVisible = false;
30
+ const button = (0, _prosopo_procaptcha_common.createControl)(teardown, { onActivate: (event) => {
31
+ event.preventDefault();
32
+ props.onClick();
33
+ } });
34
+ const buttonStyle = () => {
35
+ const theme = "light" === props.themeColor ? _prosopo_widget_skeleton.lightTheme : _prosopo_widget_skeleton.darkTheme;
36
+ const baseStyle = {
37
+ ...buttonStyleBase,
38
+ ...theme.typography.labelLarge,
39
+ borderRadius: theme.shape.button,
40
+ fontFamily: theme.font.fontFamily,
41
+ width: "100%",
42
+ outline: focusVisible ? `3px solid ${theme.palette.primary.main}` : "0px",
43
+ outlineOffset: focusVisible ? "2px" : void 0
44
+ };
45
+ if ("cancel" === props.buttonType) return {
46
+ ...baseStyle,
47
+ padding: "8px 12px",
48
+ backgroundColor: hover ? (0, _prosopo_widget_skeleton.withAlpha)(theme.palette.primary.main, theme.stateLayer.hover) : "transparent",
49
+ color: theme.palette.primary.main,
50
+ boxShadow: void 0
51
+ };
52
+ return {
53
+ ...baseStyle,
54
+ padding: "8px 24px",
55
+ backgroundColor: theme.palette.primary.main,
56
+ color: theme.palette.primary.contrastText,
57
+ boxShadow: hover ? `inset 0 0 0 100px ${(0, _prosopo_widget_skeleton.withAlpha)(theme.palette.primary.contrastText, theme.stateLayer.hover)}` : theme.elevation.buttonPrimary
58
+ };
59
+ };
60
+ const render = () => {
61
+ (0, _prosopo_procaptcha_common.applyStyles)(button, buttonStyle());
62
+ (0, _prosopo_procaptcha_common.applyAttributes)(button, {
63
+ ...require_index.default({ dev: { cy: `button-${props.buttonType}` } }),
64
+ "aria-label": props.text
65
+ });
66
+ button.textContent = props.text;
67
+ };
68
+ teardown.addEventListener(button, "mouseenter", () => {
69
+ hover = true;
70
+ render();
71
+ });
72
+ teardown.addEventListener(button, "mouseleave", () => {
73
+ hover = false;
74
+ render();
75
+ });
76
+ teardown.addEventListener(button, "focus", () => {
77
+ focusVisible = button.matches(":focus-visible");
78
+ render();
79
+ });
80
+ teardown.addEventListener(button, "blur", () => {
81
+ focusVisible = false;
82
+ render();
83
+ });
84
+ render();
85
+ container.appendChild(button);
86
+ return {
87
+ update: (nextProps) => {
88
+ props = nextProps;
89
+ render();
90
+ },
91
+ destroy: () => {
92
+ teardown.run();
93
+ button.parentNode?.removeChild(button);
94
+ }
95
+ };
96
+ };
97
+ //#endregion
98
+ exports.mountButton = mountButton;
@@ -0,0 +1,225 @@
1
+ const require_index = require("../util/index.cjs");
2
+ const require_button = require("./button.cjs");
3
+ const require_captchaWidget = require("./captchaWidget.cjs");
4
+ let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
5
+ let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
6
+ let _prosopo_util = require("@prosopo/util");
7
+ //#region src/components/captchaComponent.ts
8
+ var outerStyle = (theme) => ({
9
+ overflowX: "auto",
10
+ overflowY: "auto",
11
+ maxWidth: "500px",
12
+ maxHeight: "100%",
13
+ display: "flex",
14
+ flexDirection: "column",
15
+ border: `1px solid ${theme.palette.border}`,
16
+ boxShadow: theme.elevation.card,
17
+ borderRadius: theme.shape.card,
18
+ backgroundColor: theme.palette.background.default,
19
+ userSelect: "none",
20
+ touchAction: "none",
21
+ overscrollBehavior: "none"
22
+ });
23
+ var promptStyle = (theme) => ({
24
+ ...theme.typography.titleMedium,
25
+ color: theme.palette.primaryContainer.contrastText,
26
+ margin: 0
27
+ });
28
+ var hintStyle = (theme) => ({
29
+ ...theme.typography.bodyMedium,
30
+ color: theme.palette.onSurfaceVariant,
31
+ margin: "4px 0 0 0"
32
+ });
33
+ var targetStyle = (theme) => ({
34
+ color: theme.palette.titleAccent,
35
+ fontWeight: 700
36
+ });
37
+ var columnStyle = (gap) => ({
38
+ position: "relative",
39
+ flexGrow: 1,
40
+ flexBasis: (0, _prosopo_procaptcha_common.threeColumnBasis)(gap)
41
+ });
42
+ var SPACING_JITTER = 4;
43
+ var MIN_CONTROL_GAP = 6;
44
+ var MAX_CONTROL_GAP = 14;
45
+ var HEADER_PADDING_Y = 12;
46
+ var HEADER_PADDING_X = 14;
47
+ var HEADER_PADDING_JITTER = 3;
48
+ var MIN_WRAPPER_DEPTH = 0;
49
+ var MAX_WRAPPER_DEPTH = 2;
50
+ var decoy = (element) => (0, _prosopo_procaptcha_common.wrapRandomly)(element, MIN_WRAPPER_DEPTH, MAX_WRAPPER_DEPTH);
51
+ /** A spacing token moved by a few pixels, never below zero. */
52
+ var jittered = (base, jitter = SPACING_JITTER) => Math.max(0, base + (0, _prosopo_widget_skeleton.randomInt)(-jitter, jitter));
53
+ var mountCaptchaComponent = (container, initialProps) => {
54
+ let props = initialProps;
55
+ const themeOf = (themeColor) => "light" === themeColor ? _prosopo_widget_skeleton.lightTheme : _prosopo_widget_skeleton.darkTheme;
56
+ const currentCaptcha = () => (0, _prosopo_util.at)(props.challenge.captchas, props.index, { noWrap: true });
57
+ const currentSolution = () => (0, _prosopo_util.at)(props.solutions, props.index, { noWrap: true });
58
+ const isLastRound = () => props.index >= props.challenge.captchas.length - 1;
59
+ const theme = themeOf(props.themeColor);
60
+ const controlGap = (0, _prosopo_widget_skeleton.randomInt)(MIN_CONTROL_GAP, MAX_CONTROL_GAP);
61
+ const column = columnStyle(controlGap);
62
+ const targetLabel = (0, _prosopo_procaptcha_common.createElement)("span", { style: targetStyle(theme) });
63
+ const promptText = (0, _prosopo_procaptcha_common.createElement)("p", {
64
+ style: promptStyle(theme),
65
+ attributes: require_index.default({ dev: { cy: "captcha-prompt" } })
66
+ });
67
+ const hintText = (0, _prosopo_procaptcha_common.createElement)("p", { style: hintStyle(theme) });
68
+ const header = (0, _prosopo_procaptcha_common.createElement)("div", {
69
+ style: {
70
+ padding: `${jittered(HEADER_PADDING_Y, HEADER_PADDING_JITTER)}px ${jittered(HEADER_PADDING_X, HEADER_PADDING_JITTER)}px`,
71
+ fontFamily: theme.font.fontFamily
72
+ },
73
+ children: [decoy(promptText), decoy(hintText)]
74
+ });
75
+ const headerBar = (0, _prosopo_procaptcha_common.createElement)("div", {
76
+ style: {
77
+ backgroundColor: theme.palette.primaryContainer.main,
78
+ borderRadius: theme.shape.header,
79
+ width: "100%",
80
+ marginTop: `${jittered(theme.spacing.unit)}px`
81
+ },
82
+ children: [decoy(header)]
83
+ });
84
+ const headerRow = (0, _prosopo_procaptcha_common.createElement)("div", {
85
+ style: {
86
+ display: "flex",
87
+ alignItems: "center",
88
+ width: "100%"
89
+ },
90
+ children: [decoy(headerBar)]
91
+ });
92
+ const gridHost = (0, _prosopo_procaptcha_common.createElement)("div", {
93
+ style: { overflow: "hidden" },
94
+ attributes: require_index.default({ dev: { cy: `captcha-${props.index}` } })
95
+ });
96
+ const cancelHost = (0, _prosopo_procaptcha_common.createElement)("div", { style: column });
97
+ const reloadHost = (0, _prosopo_procaptcha_common.createElement)("div", { style: column });
98
+ const nextHost = (0, _prosopo_procaptcha_common.createElement)("div", { style: column });
99
+ const controls = (0, _prosopo_procaptcha_common.createElement)("div", {
100
+ style: {
101
+ width: "100%",
102
+ height: "100%",
103
+ display: "flex",
104
+ flexDirection: "row",
105
+ justifyContent: "space-between",
106
+ gap: `${controlGap}px`
107
+ },
108
+ children: [
109
+ decoy(cancelHost),
110
+ decoy(reloadHost),
111
+ decoy(nextHost)
112
+ ]
113
+ });
114
+ const controlsRow = (0, _prosopo_procaptcha_common.createElement)("div", {
115
+ style: {
116
+ display: "flex",
117
+ alignItems: "center",
118
+ justifyContent: "space-between",
119
+ lineHeight: 1.75,
120
+ padding: `${jittered(theme.spacing.unit)}px 0 ${jittered(theme.spacing.unit * 2)}px 0`
121
+ },
122
+ children: [decoy(controls)]
123
+ });
124
+ const inner = (0, _prosopo_procaptcha_common.createElement)("div", {
125
+ style: {
126
+ backgroundColor: theme.palette.background.default,
127
+ display: "flex",
128
+ flexDirection: "column",
129
+ minWidth: "300px",
130
+ marginLeft: `${jittered(theme.spacing.unit)}px`,
131
+ marginRight: `${jittered(theme.spacing.unit)}px`,
132
+ justifyContent: "center"
133
+ },
134
+ children: [
135
+ decoy(headerRow),
136
+ decoy(gridHost),
137
+ decoy(controlsRow)
138
+ ]
139
+ });
140
+ const root = (0, _prosopo_procaptcha_common.createElement)("div", {
141
+ style: outerStyle(theme),
142
+ attributes: require_index.default({ dev: { cy: "captcha-panel" } }),
143
+ children: [decoy(inner)]
144
+ });
145
+ const grid = require_captchaWidget.mountCaptchaWidget(gridHost, {
146
+ challenge: currentCaptcha(),
147
+ solution: currentSolution(),
148
+ onClick: props.onClick,
149
+ themeColor: props.themeColor
150
+ });
151
+ const cancelButton = require_button.mountButton(cancelHost, {
152
+ themeColor: props.themeColor,
153
+ buttonType: "cancel",
154
+ onClick: () => props.onCancel(),
155
+ text: props.translator.t("WIDGET.CANCEL")
156
+ });
157
+ const reloadButton = (0, _prosopo_procaptcha_common.mountReloadButton)(reloadHost, {
158
+ themeColor: props.themeColor,
159
+ onReload: () => props.onReload()
160
+ });
161
+ const nextButton = require_button.mountButton(nextHost, {
162
+ themeColor: props.themeColor,
163
+ buttonType: "next",
164
+ onClick: () => isLastRound() ? props.onSubmit() : props.onNext(),
165
+ text: props.translator.t("WIDGET.SUBMIT")
166
+ });
167
+ const render = () => {
168
+ const activeTheme = themeOf(props.themeColor);
169
+ (0, _prosopo_procaptcha_common.applyStyles)(root, outerStyle(activeTheme));
170
+ (0, _prosopo_procaptcha_common.applyStyles)(inner, { backgroundColor: activeTheme.palette.background.default });
171
+ (0, _prosopo_procaptcha_common.applyStyles)(headerBar, {
172
+ backgroundColor: activeTheme.palette.primaryContainer.main,
173
+ borderRadius: activeTheme.shape.header
174
+ });
175
+ (0, _prosopo_procaptcha_common.applyStyles)(header, { fontFamily: activeTheme.font.fontFamily });
176
+ (0, _prosopo_procaptcha_common.applyStyles)(promptText, promptStyle(activeTheme));
177
+ (0, _prosopo_procaptcha_common.applyStyles)(hintText, hintStyle(activeTheme));
178
+ (0, _prosopo_procaptcha_common.applyStyles)(targetLabel, targetStyle(activeTheme));
179
+ const t = props.translator.t;
180
+ targetLabel.textContent = `${currentCaptcha().target} `;
181
+ promptText.textContent = `${t("WIDGET.SELECT_ALL")}:\u00a0`;
182
+ promptText.appendChild(targetLabel);
183
+ hintText.textContent = t("WIDGET.IF_NONE_CLICK_NEXT");
184
+ (0, _prosopo_procaptcha_common.applyAttributes)(gridHost, require_index.default({ dev: { cy: `captcha-${props.index}` } }));
185
+ grid.update({
186
+ challenge: currentCaptcha(),
187
+ solution: currentSolution(),
188
+ onClick: props.onClick,
189
+ themeColor: props.themeColor
190
+ });
191
+ cancelButton.update({
192
+ themeColor: props.themeColor,
193
+ buttonType: "cancel",
194
+ onClick: () => props.onCancel(),
195
+ text: t("WIDGET.CANCEL")
196
+ });
197
+ reloadButton.update({
198
+ themeColor: props.themeColor,
199
+ onReload: () => props.onReload()
200
+ });
201
+ nextButton.update({
202
+ themeColor: props.themeColor,
203
+ buttonType: "next",
204
+ onClick: () => isLastRound() ? props.onSubmit() : props.onNext(),
205
+ text: isLastRound() ? t("WIDGET.SUBMIT") : t("WIDGET.NEXT")
206
+ });
207
+ };
208
+ render();
209
+ container.appendChild(root);
210
+ return {
211
+ update: (nextProps) => {
212
+ props = nextProps;
213
+ render();
214
+ },
215
+ destroy: () => {
216
+ grid.destroy();
217
+ cancelButton.destroy();
218
+ reloadButton.destroy();
219
+ nextButton.destroy();
220
+ root.parentNode?.removeChild(root);
221
+ }
222
+ };
223
+ };
224
+ //#endregion
225
+ exports.mountCaptchaComponent = mountCaptchaComponent;