@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.
- package/.turbo/turbo-build$colon$cjs.log +20 -35
- package/.turbo/turbo-build$colon$tsc.log +21 -21
- package/.turbo/turbo-build.log +21 -36
- package/CHANGELOG.md +41 -0
- package/dist/_virtual/_rolldown/runtime.js +3 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/components/Button.cjs +68 -78
- package/dist/cjs/components/CaptchaComponent.cjs +164 -228
- package/dist/cjs/components/CaptchaWidget.cjs +104 -158
- package/dist/cjs/components/Modal.cjs +30 -23
- package/dist/cjs/components/Procaptcha.cjs +7 -7
- package/dist/cjs/components/ProcaptchaWidget.cjs +147 -163
- package/dist/cjs/components/index.cjs +6 -9
- package/dist/cjs/index.cjs +6 -9
- package/dist/cjs/util/index.cjs +17 -15
- package/dist/components/Button.js +67 -78
- package/dist/components/CaptchaComponent.d.ts.map +1 -1
- package/dist/components/CaptchaComponent.js +160 -225
- package/dist/components/CaptchaComponent.js.map +1 -1
- package/dist/components/CaptchaWidget.d.ts.map +1 -1
- package/dist/components/CaptchaWidget.js +103 -157
- package/dist/components/CaptchaWidget.js.map +1 -1
- package/dist/components/Modal.js +24 -21
- package/dist/components/Procaptcha.js +6 -6
- package/dist/components/ProcaptchaWidget.d.ts.map +1 -1
- package/dist/components/ProcaptchaWidget.js +146 -162
- package/dist/components/ProcaptchaWidget.js.map +1 -1
- package/dist/components/index.js +3 -8
- package/dist/index.js +4 -9
- package/dist/tests/button.unit.test.d.ts +2 -0
- package/dist/tests/button.unit.test.d.ts.map +1 -0
- package/dist/tests/button.unit.test.js +113 -0
- package/dist/tests/button.unit.test.js.map +1 -0
- package/dist/tests/captchaComponent.unit.test.d.ts +2 -0
- package/dist/tests/captchaComponent.unit.test.d.ts.map +1 -0
- package/dist/tests/captchaComponent.unit.test.js +141 -0
- package/dist/tests/captchaComponent.unit.test.js.map +1 -0
- package/dist/tests/captchaWidget.unit.test.d.ts +2 -0
- package/dist/tests/captchaWidget.unit.test.d.ts.map +1 -0
- package/dist/tests/captchaWidget.unit.test.js +191 -0
- package/dist/tests/captchaWidget.unit.test.js.map +1 -0
- package/dist/tests/collector.unit.test.d.ts +2 -0
- package/dist/tests/collector.unit.test.d.ts.map +1 -0
- package/dist/tests/collector.unit.test.js +109 -0
- package/dist/tests/collector.unit.test.js.map +1 -0
- package/dist/tests/harness.d.ts +12 -0
- package/dist/tests/harness.d.ts.map +1 -0
- package/dist/tests/harness.js +69 -0
- package/dist/tests/harness.js.map +1 -0
- package/dist/tests/modal.unit.test.d.ts +2 -0
- package/dist/tests/modal.unit.test.d.ts.map +1 -0
- package/dist/tests/modal.unit.test.js +72 -0
- package/dist/tests/modal.unit.test.js.map +1 -0
- package/dist/tests/procaptcha.unit.test.d.ts +2 -0
- package/dist/tests/procaptcha.unit.test.d.ts.map +1 -0
- package/dist/tests/procaptcha.unit.test.js +57 -0
- package/dist/tests/procaptcha.unit.test.js.map +1 -0
- package/dist/tests/procaptchaReact.test-d.d.ts +2 -0
- package/dist/tests/procaptchaReact.test-d.d.ts.map +1 -0
- package/dist/tests/procaptchaReact.test-d.js +72 -0
- package/dist/tests/procaptchaReact.test-d.js.map +1 -0
- package/dist/tests/procaptchaWidget.unit.test.d.ts +2 -0
- package/dist/tests/procaptchaWidget.unit.test.d.ts.map +1 -0
- package/dist/tests/procaptchaWidget.unit.test.js +403 -0
- package/dist/tests/procaptchaWidget.unit.test.js.map +1 -0
- package/dist/tests/render.d.ts +23 -0
- package/dist/tests/render.d.ts.map +1 -0
- package/dist/tests/render.js +77 -0
- package/dist/tests/render.js.map +1 -0
- package/dist/tests/setup.d.ts +5 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +3 -0
- package/dist/tests/setup.js.map +1 -0
- package/dist/tests/util.unit.test.d.ts +2 -0
- package/dist/tests/util.unit.test.d.ts.map +1 -0
- package/dist/tests/util.unit.test.js +84 -0
- package/dist/tests/util.unit.test.js.map +1 -0
- package/dist/util/index.js +17 -16
- package/package.json +16 -12
- package/vite.test.config.ts +28 -0
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
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
|
-
[
|
|
46
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
47
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
65
48
|
Bundle build started
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[32m✓[39m 9 modules transformed.
|
|
49
|
+
[2K
|
|
50
|
+
✓ 10 modules transformed.
|
|
69
51
|
rendering chunks...
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
+
[32m✓ built in 60ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
2
|
+
> @prosopo/procaptcha-react@2.9.98 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
+
12:36:47 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
12:36:47 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
|
|
62
62
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
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.
|
|
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
|
-
[
|
|
50
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
51
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
69
52
|
Bundle build started
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[32m✓[39m 9 modules transformed.
|
|
53
|
+
[2K
|
|
54
|
+
✓ 10 modules transformed.
|
|
73
55
|
rendering chunks...
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
+
[32m✓ built in 53ms[39m
|
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,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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.default = Button;
|