@prosopo/procaptcha-react 2.9.96 → 2.9.98

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 (80) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +20 -35
  2. package/.turbo/turbo-build$colon$tsc.log +21 -21
  3. package/.turbo/turbo-build.log +21 -36
  4. package/CHANGELOG.md +41 -0
  5. package/dist/_virtual/_rolldown/runtime.js +3 -0
  6. package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
  7. package/dist/cjs/components/Button.cjs +68 -78
  8. package/dist/cjs/components/CaptchaComponent.cjs +164 -228
  9. package/dist/cjs/components/CaptchaWidget.cjs +104 -158
  10. package/dist/cjs/components/Modal.cjs +30 -23
  11. package/dist/cjs/components/Procaptcha.cjs +7 -7
  12. package/dist/cjs/components/ProcaptchaWidget.cjs +147 -163
  13. package/dist/cjs/components/index.cjs +6 -9
  14. package/dist/cjs/index.cjs +6 -9
  15. package/dist/cjs/util/index.cjs +17 -15
  16. package/dist/components/Button.js +67 -78
  17. package/dist/components/CaptchaComponent.d.ts.map +1 -1
  18. package/dist/components/CaptchaComponent.js +160 -225
  19. package/dist/components/CaptchaComponent.js.map +1 -1
  20. package/dist/components/CaptchaWidget.d.ts.map +1 -1
  21. package/dist/components/CaptchaWidget.js +103 -157
  22. package/dist/components/CaptchaWidget.js.map +1 -1
  23. package/dist/components/Modal.js +24 -21
  24. package/dist/components/Procaptcha.js +6 -6
  25. package/dist/components/ProcaptchaWidget.d.ts.map +1 -1
  26. package/dist/components/ProcaptchaWidget.js +146 -162
  27. package/dist/components/ProcaptchaWidget.js.map +1 -1
  28. package/dist/components/index.js +3 -8
  29. package/dist/index.js +4 -9
  30. package/dist/tests/button.unit.test.d.ts +2 -0
  31. package/dist/tests/button.unit.test.d.ts.map +1 -0
  32. package/dist/tests/button.unit.test.js +113 -0
  33. package/dist/tests/button.unit.test.js.map +1 -0
  34. package/dist/tests/captchaComponent.unit.test.d.ts +2 -0
  35. package/dist/tests/captchaComponent.unit.test.d.ts.map +1 -0
  36. package/dist/tests/captchaComponent.unit.test.js +141 -0
  37. package/dist/tests/captchaComponent.unit.test.js.map +1 -0
  38. package/dist/tests/captchaWidget.unit.test.d.ts +2 -0
  39. package/dist/tests/captchaWidget.unit.test.d.ts.map +1 -0
  40. package/dist/tests/captchaWidget.unit.test.js +191 -0
  41. package/dist/tests/captchaWidget.unit.test.js.map +1 -0
  42. package/dist/tests/collector.unit.test.d.ts +2 -0
  43. package/dist/tests/collector.unit.test.d.ts.map +1 -0
  44. package/dist/tests/collector.unit.test.js +109 -0
  45. package/dist/tests/collector.unit.test.js.map +1 -0
  46. package/dist/tests/harness.d.ts +12 -0
  47. package/dist/tests/harness.d.ts.map +1 -0
  48. package/dist/tests/harness.js +69 -0
  49. package/dist/tests/harness.js.map +1 -0
  50. package/dist/tests/modal.unit.test.d.ts +2 -0
  51. package/dist/tests/modal.unit.test.d.ts.map +1 -0
  52. package/dist/tests/modal.unit.test.js +72 -0
  53. package/dist/tests/modal.unit.test.js.map +1 -0
  54. package/dist/tests/procaptcha.unit.test.d.ts +2 -0
  55. package/dist/tests/procaptcha.unit.test.d.ts.map +1 -0
  56. package/dist/tests/procaptcha.unit.test.js +57 -0
  57. package/dist/tests/procaptcha.unit.test.js.map +1 -0
  58. package/dist/tests/procaptchaReact.test-d.d.ts +2 -0
  59. package/dist/tests/procaptchaReact.test-d.d.ts.map +1 -0
  60. package/dist/tests/procaptchaReact.test-d.js +72 -0
  61. package/dist/tests/procaptchaReact.test-d.js.map +1 -0
  62. package/dist/tests/procaptchaWidget.unit.test.d.ts +2 -0
  63. package/dist/tests/procaptchaWidget.unit.test.d.ts.map +1 -0
  64. package/dist/tests/procaptchaWidget.unit.test.js +403 -0
  65. package/dist/tests/procaptchaWidget.unit.test.js.map +1 -0
  66. package/dist/tests/render.d.ts +23 -0
  67. package/dist/tests/render.d.ts.map +1 -0
  68. package/dist/tests/render.js +77 -0
  69. package/dist/tests/render.js.map +1 -0
  70. package/dist/tests/setup.d.ts +5 -0
  71. package/dist/tests/setup.d.ts.map +1 -0
  72. package/dist/tests/setup.js +3 -0
  73. package/dist/tests/setup.js.map +1 -0
  74. package/dist/tests/util.unit.test.d.ts +2 -0
  75. package/dist/tests/util.unit.test.d.ts.map +1 -0
  76. package/dist/tests/util.unit.test.js +84 -0
  77. package/dist/tests/util.unit.test.js.map +1 -0
  78. package/dist/util/index.js +17 -16
  79. package/package.json +16 -12
  80. package/vite.test.config.ts +28 -0
@@ -1,25 +1,7 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.9.96 build:cjs
2
+ > @prosopo/procaptcha-react@2.9.98 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
- ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
6
-
7
- package.json:17:3:
8
- 17 │ "types": "./dist/index.d.ts"
9
- ╵ ~~~~~~~
10
-
11
- The "import" condition comes earlier and will be used for all "import" statements:
12
-
13
- package.json:15:3:
14
- 15 │ "import": "./dist/index.js",
15
- ╵ ~~~~~~~~
16
-
17
- The "require" condition comes earlier and will be used for all "require" calls:
18
-
19
- package.json:16:3:
20
- 16 │ "require": "./dist/cjs/index.cjs",
21
- ╵ ~~~~~~~~~
22
-
23
5
  ViteCommonJSConfig: .
24
6
  {
25
7
  tsConfigPaths: [
@@ -32,8 +14,8 @@ ViteCommonJSConfig: .
32
14
  '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
33
15
  '/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
34
16
  '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
35
- '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
36
17
  '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
18
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
37
19
  '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
38
20
  '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
39
21
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
@@ -52,8 +34,8 @@ ViteCommonJSConfig: .
52
34
  '@prosopo/procaptcha',
53
35
  '@prosopo/datasets',
54
36
  '@prosopo/api',
55
- '@prosopo/procaptcha-common',
56
37
  '@prosopo/load-balancer',
38
+ '@prosopo/procaptcha-common',
57
39
  '@prosopo/widget-skeleton',
58
40
  '@prosopo/account',
59
41
  '@prosopo/fingerprint',
@@ -61,19 +43,22 @@ ViteCommonJSConfig: .
61
43
  '@prosopo/keyring'
62
44
  ]
63
45
  }
64
- vite v6.4.1 building SSR bundle for production...
46
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
47
+ vite v8.1.5 building ssr environment for production...
65
48
  Bundle build started
66
- transforming...
67
- Build end
68
- ✓ 9 modules transformed.
49
+ 
50
+ 10 modules transformed.
69
51
  rendering chunks...
70
- dist/cjs/components/index.cjs 0.42 kB
71
- dist/cjs/util/index.cjs 0.45 kB
72
- dist/cjs/index.cjs 0.48 kB
73
- dist/cjs/components/Procaptcha.cjs 0.61 kB
74
- dist/cjs/components/Modal.cjs 1.36 kB
75
- dist/cjs/components/Button.cjs 2.38 kB
76
- dist/cjs/components/CaptchaWidget.cjs 5.94 kB
77
- dist/cjs/components/ProcaptchaWidget.cjs 6.07 kB
78
- dist/cjs/components/CaptchaComponent.cjs 8.81 kB
79
- ✓ built in 149ms
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.55 kB │ gzip: 0.79 kB
59
+ dist/cjs/components/Button.cjs 2.33 kB │ gzip: 1.06 kB
60
+ dist/cjs/components/CaptchaWidget.cjs 3.50 kB │ gzip: 1.40 kB
61
+ dist/cjs/components/CaptchaComponent.cjs 5.95 kB gzip: 1.50 kB
62
+ dist/cjs/components/ProcaptchaWidget.cjs 6.01 kB │ gzip: 1.79 kB
63
+
64
+ ✓ built in 60ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.9.96 build:tsc
2
+ > @prosopo/procaptcha-react@2.9.98 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 10:23:01 PM - Projects in this build:
5
+ 12:36:47 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -22,41 +22,41 @@
22
22
  * ../procaptcha/tsconfig.json
23
23
  * tsconfig.json
24
24
 
25
- 10:23: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
+ 12:36:47 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/index.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
26
26
 
27
- 10:23: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
+ 12:36:47 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
28
28
 
29
- 10:23: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
+ 12:36:47 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
30
30
 
31
- 10:23: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
+ 12:36:47 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
32
32
 
33
- 10:23: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
+ 12:36:47 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
- 10:23:01 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
35
+ 12:36:47 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
36
36
 
37
- 10:23:01 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
37
+ 12:36:47 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
- 10:23:01 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'
39
+ 12:36:47 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
- 10:23: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
+ 12:36:47 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
42
42
 
43
- 10:23:02 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
43
+ 12:36:47 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/providers.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
44
44
 
45
- 10:23:02 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
45
+ 12:36:47 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
46
46
 
47
- 10:23:02 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
+ 12:36:47 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
- 10:23:02 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
49
+ 12:36:47 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
- 10:23:02 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
51
+ 12:36:47 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
52
52
 
53
- 10:23:02 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
53
+ 12:36:47 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
54
54
 
55
- 10:23:02 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/reactComponents/Honeypot.tsx' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
55
+ 12:36:47 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/simdReadings.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
56
56
 
57
- 10:23:02 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
57
+ 12:36:47 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
58
58
 
59
- 10:23:02 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
59
+ 12:36:47 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
60
60
 
61
- 10:23:02 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
61
+ 12:36:47 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
62
62
 
@@ -1,29 +1,11 @@
1
1
 
2
- > @prosopo/procaptcha-react@2.9.96 build
2
+ > @prosopo/procaptcha-react@2.9.98 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-react@2.9.96 build:cross-env
6
+ > @prosopo/procaptcha-react@2.9.98 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
- ▲ [WARNING] The condition "types" here will never be used as it comes after both "import" and "require" [package.json]
10
-
11
- package.json:17:3:
12
- 17 │ "types": "./dist/index.d.ts"
13
- ╵ ~~~~~~~
14
-
15
- The "import" condition comes earlier and will be used for all "import" statements:
16
-
17
- package.json:15:3:
18
- 15 │ "import": "./dist/index.js",
19
- ╵ ~~~~~~~~
20
-
21
- The "require" condition comes earlier and will be used for all "require" calls:
22
-
23
- package.json:16:3:
24
- 16 │ "require": "./dist/cjs/index.cjs",
25
- ╵ ~~~~~~~~~
26
-
27
9
  ViteEsmConfig: .
28
10
  {
29
11
  tsConfigPaths: [
@@ -36,8 +18,8 @@ ViteEsmConfig: .
36
18
  '/home/runner/work/captcha/captcha/packages/procaptcha/tsconfig.json',
37
19
  '/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
38
20
  '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
39
- '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
40
21
  '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
22
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
41
23
  '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
42
24
  '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
43
25
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
@@ -56,8 +38,8 @@ ViteEsmConfig: .
56
38
  '@prosopo/procaptcha',
57
39
  '@prosopo/datasets',
58
40
  '@prosopo/api',
59
- '@prosopo/procaptcha-common',
60
41
  '@prosopo/load-balancer',
42
+ '@prosopo/procaptcha-common',
61
43
  '@prosopo/widget-skeleton',
62
44
  '@prosopo/account',
63
45
  '@prosopo/fingerprint',
@@ -65,19 +47,22 @@ ViteEsmConfig: .
65
47
  '@prosopo/keyring'
66
48
  ]
67
49
  }
68
- vite v6.4.1 building SSR bundle for production...
50
+ The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
51
+ vite v8.1.5 building ssr environment for production...
69
52
  Bundle build started
70
- transforming...
71
- Build end
72
- ✓ 9 modules transformed.
53
+ 
54
+ 10 modules transformed.
73
55
  rendering chunks...
74
- dist/components/index.js 0.29 kB
75
- dist/components/Procaptcha.js 0.33 kB
76
- dist/index.js 0.35 kB
77
- dist/util/index.js 0.44 kB
78
- dist/components/Modal.js 1.31 kB
79
- dist/components/Button.js 2.33 kB
80
- dist/components/CaptchaWidget.js 5.74 kB
81
- dist/components/ProcaptchaWidget.js 5.86 kB
82
- dist/components/CaptchaComponent.js 8.48 kB
83
- ✓ built in 252ms
56
+ computing gzip size...
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 1.28 kB │ gzip: 0.70 kB
63
+ dist/components/Button.js 2.19 kB │ gzip: 1.03 kB
64
+ dist/components/CaptchaWidget.js 3.18 kB │ gzip: 1.36 kB
65
+ dist/components/CaptchaComponent.js 5.04 kB gzip: 1.45 kB
66
+ dist/components/ProcaptchaWidget.js 5.34 kB │ gzip: 1.75 kB
67
+
68
+ ✓ built in 53ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @prosopo/procaptcha-react
2
2
 
3
+ ## 2.9.98
4
+ ### Patch Changes
5
+
6
+ - 52a6d96: Add unit and type tests for the React image-captcha widget: the button, modal
7
+ portal, captcha grid and round component, the event collector, the lazy
8
+ boundary, and the widget itself (visible and invisible modes, honeypot,
9
+ autoStart, session invalidation, the procaptcha:execute event, language
10
+ handling and the checkbox flow). 174 tests, 98%+ statement, line and function
11
+ coverage.
12
+
13
+ Changes found while writing them:
14
+
15
+ - A failed `manager.start()` from a checkbox click left the loading spinner up
16
+ permanently, with no way back to the checkbox, and produced an unhandled
17
+ rejection.
18
+ - `CaptchaComponent` wrapped an out-of-range round index, silently rendering a
19
+ different round's images; it now rejects the index.
20
+ - Removed unreachable branches in `CaptchaWidget` and `ProcaptchaWidget` that
21
+ read touch coordinates off a React synthetic click, which never carries them.
22
+ This also removed the package's `any` and `@ts-ignore` uses: the image retry
23
+ counter now lives in a data attribute rather than an untyped property.
24
+ - Updated dependencies [cc022be]
25
+ - @prosopo/procaptcha@2.10.59
26
+
27
+ ## 2.9.97
28
+ ### Patch Changes
29
+
30
+ - e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
31
+ - Updated dependencies [2c47bb7]
32
+ - Updated dependencies [ab3499c]
33
+ - Updated dependencies [0e1171c]
34
+ - Updated dependencies [103318c]
35
+ - Updated dependencies [270a8d8]
36
+ - Updated dependencies [e14fce6]
37
+ - @prosopo/util@3.3.5
38
+ - @prosopo/procaptcha-common@2.11.18
39
+ - @prosopo/procaptcha@2.10.58
40
+ - @prosopo/locale@3.2.8
41
+ - @prosopo/types@4.10.0
42
+ - @prosopo/common@3.1.48
43
+
3
44
  ## 2.9.96
4
45
  ### Patch Changes
5
46
 
@@ -0,0 +1,3 @@
1
+ import "node:module";
2
+ //#endregion
3
+ export {};
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -1,80 +1,70 @@
1
- "use strict";
2
- const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const widgetSkeleton = require("@prosopo/widget-skeleton");
4
- const React = require("react");
5
- const index = require("../util/index.cjs");
6
- const buttonStyleBase = {
7
- display: "inline-flex",
8
- alignItems: "center",
9
- justifyContent: "center",
10
- position: "relative",
11
- boxSizing: "border-box",
12
- outline: "0px",
13
- margin: "0px",
14
- cursor: "pointer",
15
- userSelect: "none",
16
- verticalAlign: "middle",
17
- appearance: void 0,
18
- textDecoration: "none",
19
- fontWeight: "500",
20
- fontSize: "0.875rem",
21
- lineHeight: "1.75",
22
- letterSpacing: "0.02857em",
23
- textTransform: "uppercase",
24
- minWidth: "64px",
25
- padding: "6px 16px",
26
- borderRadius: "4px",
27
- 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, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
28
- backgroundColor: "#ffffff"
1
+ const require_index = require("../util/index.cjs");
2
+ let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
3
+ let react = require("react");
4
+ let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
5
+ //#region src/components/Button.tsx
6
+ var buttonStyleBase = {
7
+ display: "inline-flex",
8
+ alignItems: "center",
9
+ justifyContent: "center",
10
+ position: "relative",
11
+ boxSizing: "border-box",
12
+ outline: "0px",
13
+ margin: "0px",
14
+ cursor: "pointer",
15
+ userSelect: "none",
16
+ verticalAlign: "middle",
17
+ appearance: void 0,
18
+ textDecoration: "none",
19
+ fontWeight: "500",
20
+ fontSize: "0.875rem",
21
+ lineHeight: "1.75",
22
+ letterSpacing: "0.02857em",
23
+ textTransform: "uppercase",
24
+ minWidth: "64px",
25
+ padding: "6px 16px",
26
+ borderRadius: "4px",
27
+ 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, border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
28
+ backgroundColor: "#ffffff"
29
29
  };
30
- const Button = ({
31
- themeColor,
32
- buttonType,
33
- text,
34
- onClick
35
- }) => {
36
- const theme = React.useMemo(
37
- () => themeColor === "light" ? widgetSkeleton.lightTheme : widgetSkeleton.darkTheme,
38
- [themeColor]
39
- );
40
- const [hover, setHover] = React.useState(false);
41
- const buttonStyle = React.useMemo(() => {
42
- const baseStyle = {
43
- ...buttonStyleBase,
44
- border: `1px solid ${theme.palette.grey[500]}`,
45
- boxShadow: `0px 1px 3px 0px ${theme.palette.grey[500]}`,
46
- fontFamily: theme.font.fontFamily,
47
- width: "100%",
48
- color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
49
- };
50
- if (buttonType === "cancel") {
51
- return {
52
- ...baseStyle,
53
- backgroundColor: hover ? theme.palette.grey[600] : "transparent"
54
- };
55
- }
56
- return {
57
- ...baseStyle,
58
- backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
59
- };
60
- }, [buttonType, hover, theme]);
61
- return /* @__PURE__ */ jsxRuntime.jsx(
62
- "button",
63
- {
64
- ...index({ dev: { cy: `button-${buttonType}` } }),
65
- onMouseEnter: () => setHover(true),
66
- onMouseLeave: () => setHover(false),
67
- style: buttonStyle,
68
- onClick: (e) => {
69
- if (!e.isTrusted) {
70
- return;
71
- }
72
- e.preventDefault();
73
- onClick();
74
- },
75
- "aria-label": text,
76
- children: text
77
- }
78
- );
30
+ var Button = ({ themeColor, buttonType, text, onClick }) => {
31
+ const theme = (0, react.useMemo)(() => themeColor === "light" ? _prosopo_widget_skeleton.lightTheme : _prosopo_widget_skeleton.darkTheme, [themeColor]);
32
+ const [hover, setHover] = (0, react.useState)(false);
33
+ const buttonStyle = (0, react.useMemo)(() => {
34
+ const baseStyle = {
35
+ ...buttonStyleBase,
36
+ border: `1px solid ${theme.palette.grey[500]}`,
37
+ boxShadow: `0px 1px 3px 0px ${theme.palette.grey[500]}`,
38
+ fontFamily: theme.font.fontFamily,
39
+ width: "100%",
40
+ color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
41
+ };
42
+ if (buttonType === "cancel") return {
43
+ ...baseStyle,
44
+ backgroundColor: hover ? theme.palette.grey[600] : "transparent"
45
+ };
46
+ return {
47
+ ...baseStyle,
48
+ backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
49
+ };
50
+ }, [
51
+ buttonType,
52
+ hover,
53
+ theme
54
+ ]);
55
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("button", {
56
+ ...require_index.default({ dev: { cy: `button-${buttonType}` } }),
57
+ onMouseEnter: () => setHover(true),
58
+ onMouseLeave: () => setHover(false),
59
+ style: buttonStyle,
60
+ onClick: (e) => {
61
+ if (!e.isTrusted) return;
62
+ e.preventDefault();
63
+ onClick();
64
+ },
65
+ "aria-label": text,
66
+ children: text
67
+ });
79
68
  };
80
- module.exports = Button;
69
+ //#endregion
70
+ exports.default = Button;