@prosopo/procaptcha-react 2.9.102 → 2.9.103
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 +8 -8
- package/.turbo/turbo-build$colon$tsc.log +21 -21
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +39 -0
- package/dist/cjs/components/Button.cjs +28 -17
- package/dist/cjs/components/CaptchaComponent.cjs +20 -14
- package/dist/cjs/components/CaptchaWidget.cjs +17 -8
- package/dist/cjs/components/Modal.cjs +3 -4
- package/dist/cjs/components/ProcaptchaWidget.cjs +2 -2
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +29 -18
- package/dist/components/Button.js.map +1 -1
- package/dist/components/CaptchaComponent.d.ts.map +1 -1
- package/dist/components/CaptchaComponent.js +20 -14
- package/dist/components/CaptchaComponent.js.map +1 -1
- package/dist/components/CaptchaWidget.d.ts.map +1 -1
- package/dist/components/CaptchaWidget.js +17 -8
- package/dist/components/CaptchaWidget.js.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +3 -4
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/ProcaptchaWidget.d.ts.map +1 -1
- package/dist/components/ProcaptchaWidget.js +2 -2
- package/dist/components/ProcaptchaWidget.js.map +1 -1
- package/dist/tests/button.unit.test.js +21 -17
- package/dist/tests/button.unit.test.js.map +1 -1
- package/dist/tests/captchaComponent.unit.test.js +1 -1
- package/dist/tests/captchaComponent.unit.test.js.map +1 -1
- package/dist/tests/captchaWidget.unit.test.js +4 -4
- package/dist/tests/captchaWidget.unit.test.js.map +1 -1
- package/dist/tests/procaptchaWidget.unit.test.js +3 -2
- package/dist/tests/procaptchaWidget.unit.test.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
2
|
+
> @prosopo/procaptcha-react@2.9.103 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -25,7 +25,6 @@ ViteCommonJSConfig: .
|
|
|
25
25
|
}
|
|
26
26
|
{
|
|
27
27
|
externals: [
|
|
28
|
-
[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
|
|
29
28
|
'@prosopo/common',
|
|
30
29
|
'@prosopo/locale',
|
|
31
30
|
'@prosopo/logger',
|
|
@@ -44,6 +43,7 @@ ViteCommonJSConfig: .
|
|
|
44
43
|
'@prosopo/keyring'
|
|
45
44
|
]
|
|
46
45
|
}
|
|
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
47
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
48
48
|
Bundle build started
|
|
49
49
|
[2K
|
|
@@ -55,10 +55,10 @@ dist/cjs/index.cjs 0.46 kB │ gzip: 0.18 kB
|
|
|
55
55
|
dist/cjs/components/Procaptcha.cjs 0.49 kB │ gzip: 0.27 kB
|
|
56
56
|
dist/cjs/util/index.cjs 0.50 kB │ gzip: 0.32 kB
|
|
57
57
|
dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
|
|
58
|
-
dist/cjs/components/Modal.cjs 1.
|
|
59
|
-
dist/cjs/components/Button.cjs 2.
|
|
60
|
-
dist/cjs/components/CaptchaWidget.cjs
|
|
61
|
-
dist/cjs/components/
|
|
62
|
-
dist/cjs/components/
|
|
58
|
+
dist/cjs/components/Modal.cjs 1.54 kB │ gzip: 0.80 kB
|
|
59
|
+
dist/cjs/components/Button.cjs 2.86 kB │ gzip: 1.18 kB
|
|
60
|
+
dist/cjs/components/CaptchaWidget.cjs 4.03 kB │ gzip: 1.50 kB
|
|
61
|
+
dist/cjs/components/ProcaptchaWidget.cjs 6.05 kB │ gzip: 1.80 kB
|
|
62
|
+
dist/cjs/components/CaptchaComponent.cjs 6.18 kB │ gzip: 1.57 kB
|
|
63
63
|
|
|
64
|
-
[32m✓ built in
|
|
64
|
+
[32m✓ built in 52ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
2
|
+
> @prosopo/procaptcha-react@2.9.103 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/vite-plugin-copy.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - 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
|
-
|
|
37
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
7:05:39 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/api.test-d.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
7:05:39 AM - 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'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
7:05:39 AM - 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'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
7:05:39 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/sources/webgl.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - 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
|
-
|
|
53
|
+
7:05:39 AM - 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
|
-
|
|
55
|
+
7:05:39 AM - 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
|
+
7:05:39 AM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/tests/manager.unit.test.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
7:05:39 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
7:05:39 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-react/tsconfig.json'...
|
|
62
62
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-react@2.9.
|
|
2
|
+
> @prosopo/procaptcha-react@2.9.103 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.103 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -59,10 +59,10 @@ dist/components/index.js 0.20 kB │ gzip: 0.09 kB
|
|
|
59
59
|
dist/index.js 0.27 kB │ gzip: 0.13 kB
|
|
60
60
|
dist/components/Procaptcha.js 0.37 kB │ gzip: 0.24 kB
|
|
61
61
|
dist/util/index.js 0.50 kB │ gzip: 0.33 kB
|
|
62
|
-
dist/components/Modal.js 1.
|
|
63
|
-
dist/components/Button.js 2.
|
|
64
|
-
dist/components/CaptchaWidget.js 3.
|
|
65
|
-
dist/components/CaptchaComponent.js 5.
|
|
66
|
-
dist/components/ProcaptchaWidget.js 5.
|
|
62
|
+
dist/components/Modal.js 1.26 kB │ gzip: 0.72 kB
|
|
63
|
+
dist/components/Button.js 2.62 kB │ gzip: 1.15 kB
|
|
64
|
+
dist/components/CaptchaWidget.js 3.66 kB │ gzip: 1.46 kB
|
|
65
|
+
dist/components/CaptchaComponent.js 5.27 kB │ gzip: 1.52 kB
|
|
66
|
+
dist/components/ProcaptchaWidget.js 5.36 kB │ gzip: 1.76 kB
|
|
67
67
|
|
|
68
|
-
[32m✓ built in
|
|
68
|
+
[32m✓ built in 48ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @prosopo/procaptcha-react
|
|
2
2
|
|
|
3
|
+
## 2.9.103
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 729349e: Run the cypress suite in firefox as well as chrome whenever the PR is a release
|
|
7
|
+
PR, via a new cypress-firefox workflow. cypress.yml is untouched.
|
|
8
|
+
|
|
9
|
+
The trusted-event checks scattered across the widget components now go through a
|
|
10
|
+
single `isEventTrusted()` helper in `@prosopo/procaptcha-common`. Behaviour is
|
|
11
|
+
unchanged: it still returns early for synthetic input, unless the bundle was
|
|
12
|
+
built with `PROSOPO_ALLOW_UNTRUSTED_EVENTS=1`, which only the firefox CI leg
|
|
13
|
+
sets. Production builds pin the define to `false`, so the branch is folded away
|
|
14
|
+
at build time and the allowance cannot reach a shipped bundle.
|
|
15
|
+
|
|
16
|
+
The allowance exists because cypress-real-events dispatches input over the chrome
|
|
17
|
+
devtools protocol, which cypress exposes for chromium browsers only — on firefox
|
|
18
|
+
the specs fall back to cypress' own synthetic clicks.
|
|
19
|
+
- b525956: Refresh the captcha widget appearance with a Material 3 theme across the widget-skeleton, procaptcha-common, procaptcha-react and procaptcha-puzzle packages.
|
|
20
|
+
|
|
21
|
+
- Split the single tinted surface into M3 surface roles: the widget now sits on a white `surface` (surfaceContainerLowest) and the challenge dialog on `surfaceContainerHigh`.
|
|
22
|
+
- Removed all drop shadows. Separation comes from surface roles and outlines; hover and drag feedback use M3 state layers and outline rings instead.
|
|
23
|
+
- Added shared `typography` (label large / title medium / body medium) and `stateLayer` (8%/10%/10%) tokens, and aligned the shape scale to M3 steps.
|
|
24
|
+
- Buttons: M3 label-large type, 40dp height, spec padding, state-layer hover in place of a brightness filter, and no resting elevation on the filled variant.
|
|
25
|
+
- Added the missing focus indicators (3dp outline, 2dp offset, keyboard-only) to the checkbox, buttons and reload control.
|
|
26
|
+
- Secondary dialog text now uses the `onSurfaceVariant` role rather than reduced opacity.
|
|
27
|
+
- Updated dependencies [729349e]
|
|
28
|
+
- Updated dependencies [16dbab0]
|
|
29
|
+
- Updated dependencies [b525956]
|
|
30
|
+
- Updated dependencies [9091a78]
|
|
31
|
+
- Updated dependencies [d5e104b]
|
|
32
|
+
- Updated dependencies [063e69d]
|
|
33
|
+
- Updated dependencies [8a4d6ad]
|
|
34
|
+
- @prosopo/procaptcha-common@2.11.23
|
|
35
|
+
- @prosopo/types@5.0.3
|
|
36
|
+
- @prosopo/util@3.3.6
|
|
37
|
+
- @prosopo/widget-skeleton@2.8.6
|
|
38
|
+
- @prosopo/locale@3.3.0
|
|
39
|
+
- @prosopo/procaptcha@2.10.64
|
|
40
|
+
- @prosopo/common@3.1.50
|
|
41
|
+
|
|
3
42
|
## 2.9.102
|
|
4
43
|
### Patch Changes
|
|
5
44
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_index = require("../util/index.cjs");
|
|
2
|
+
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
2
3
|
let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
@@ -16,36 +17,38 @@ var buttonStyleBase = {
|
|
|
16
17
|
verticalAlign: "middle",
|
|
17
18
|
appearance: void 0,
|
|
18
19
|
textDecoration: "none",
|
|
19
|
-
|
|
20
|
-
fontSize: "0.875rem",
|
|
21
|
-
lineHeight: "1.75",
|
|
22
|
-
letterSpacing: "0.02857em",
|
|
23
|
-
textTransform: "uppercase",
|
|
20
|
+
textTransform: "none",
|
|
24
21
|
minWidth: "64px",
|
|
25
|
-
|
|
26
|
-
borderRadius: "
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
minHeight: "40px",
|
|
23
|
+
borderRadius: "100px",
|
|
24
|
+
border: "none",
|
|
25
|
+
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",
|
|
26
|
+
backgroundColor: "transparent"
|
|
29
27
|
};
|
|
30
28
|
var Button = ({ themeColor, buttonType, text, onClick }) => {
|
|
31
29
|
const theme = (0, react.useMemo)(() => themeColor === "light" ? _prosopo_widget_skeleton.lightTheme : _prosopo_widget_skeleton.darkTheme, [themeColor]);
|
|
32
30
|
const [hover, setHover] = (0, react.useState)(false);
|
|
31
|
+
const [focusVisible, setFocusVisible] = (0, react.useState)(false);
|
|
33
32
|
const buttonStyle = (0, react.useMemo)(() => {
|
|
34
33
|
const baseStyle = {
|
|
35
34
|
...buttonStyleBase,
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
...theme.typography.labelLarge,
|
|
36
|
+
borderRadius: theme.shape.button,
|
|
38
37
|
fontFamily: theme.font.fontFamily,
|
|
39
|
-
width: "100%"
|
|
40
|
-
color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
|
|
38
|
+
width: "100%"
|
|
41
39
|
};
|
|
42
40
|
if (buttonType === "cancel") return {
|
|
43
41
|
...baseStyle,
|
|
44
|
-
|
|
42
|
+
padding: "8px 12px",
|
|
43
|
+
backgroundColor: hover ? (0, _prosopo_widget_skeleton.withAlpha)(theme.palette.primary.main, theme.stateLayer.hover) : "transparent",
|
|
44
|
+
color: theme.palette.primary.main
|
|
45
45
|
};
|
|
46
46
|
return {
|
|
47
47
|
...baseStyle,
|
|
48
|
-
|
|
48
|
+
padding: "8px 24px",
|
|
49
|
+
backgroundColor: theme.palette.primary.main,
|
|
50
|
+
color: theme.palette.primary.contrastText,
|
|
51
|
+
boxShadow: hover ? `inset 0 0 0 100px ${(0, _prosopo_widget_skeleton.withAlpha)(theme.palette.primary.contrastText, theme.stateLayer.hover)}` : theme.elevation.buttonPrimary
|
|
49
52
|
};
|
|
50
53
|
}, [
|
|
51
54
|
buttonType,
|
|
@@ -56,9 +59,17 @@ var Button = ({ themeColor, buttonType, text, onClick }) => {
|
|
|
56
59
|
...require_index.default({ dev: { cy: `button-${buttonType}` } }),
|
|
57
60
|
onMouseEnter: () => setHover(true),
|
|
58
61
|
onMouseLeave: () => setHover(false),
|
|
59
|
-
|
|
62
|
+
onFocus: (e) => setFocusVisible(e.target.matches(":focus-visible")),
|
|
63
|
+
onBlur: () => setFocusVisible(false),
|
|
64
|
+
style: {
|
|
65
|
+
...buttonStyle,
|
|
66
|
+
...focusVisible ? {
|
|
67
|
+
outline: `3px solid ${theme.palette.primary.main}`,
|
|
68
|
+
outlineOffset: "2px"
|
|
69
|
+
} : {}
|
|
70
|
+
},
|
|
60
71
|
onClick: (e) => {
|
|
61
|
-
if (!
|
|
72
|
+
if (!(0, _prosopo_procaptcha_common.isEventTrusted)(e)) return;
|
|
62
73
|
e.preventDefault();
|
|
63
74
|
onClick();
|
|
64
75
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_CaptchaWidget = require("./CaptchaWidget.cjs");
|
|
2
2
|
const require_index = require("../util/index.cjs");
|
|
3
3
|
const require_Button = require("./Button.cjs");
|
|
4
|
+
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
4
5
|
let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
|
|
5
6
|
let react = require("react");
|
|
6
7
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
7
8
|
let _prosopo_locale = require("@prosopo/locale");
|
|
8
|
-
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
9
9
|
let _prosopo_util = require("@prosopo/util");
|
|
10
10
|
//#region src/components/CaptchaComponent.tsx
|
|
11
11
|
var CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onClick, onNext, onReload, themeColor }) => {
|
|
@@ -25,9 +25,9 @@ var CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onCli
|
|
|
25
25
|
maxHeight: "100%",
|
|
26
26
|
display: "flex",
|
|
27
27
|
flexDirection: "column",
|
|
28
|
-
border:
|
|
29
|
-
boxShadow:
|
|
30
|
-
borderRadius:
|
|
28
|
+
border: `1px solid ${theme.palette.border}`,
|
|
29
|
+
boxShadow: theme.elevation.card,
|
|
30
|
+
borderRadius: theme.shape.card,
|
|
31
31
|
backgroundColor: theme.palette.background.default,
|
|
32
32
|
userSelect: "none",
|
|
33
33
|
touchAction: "none",
|
|
@@ -52,33 +52,39 @@ var CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onCli
|
|
|
52
52
|
},
|
|
53
53
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
|
|
54
54
|
style: {
|
|
55
|
-
backgroundColor: theme.palette.
|
|
55
|
+
backgroundColor: theme.palette.primaryContainer.main,
|
|
56
|
+
borderRadius: theme.shape.header,
|
|
56
57
|
width: "100%",
|
|
57
58
|
marginTop: fullSpacing
|
|
58
59
|
},
|
|
59
60
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("div", {
|
|
60
61
|
style: {
|
|
61
|
-
padding:
|
|
62
|
+
padding: "12px 14px",
|
|
62
63
|
fontFamily: theme.font.fontFamily
|
|
63
64
|
},
|
|
64
65
|
children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("p", {
|
|
65
66
|
style: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
...theme.typography.titleMedium,
|
|
68
|
+
color: theme.palette.primaryContainer.contrastText,
|
|
69
|
+
margin: 0
|
|
69
70
|
},
|
|
70
71
|
children: [
|
|
71
72
|
t("WIDGET.SELECT_ALL"),
|
|
72
73
|
":",
|
|
73
74
|
"\xA0",
|
|
74
|
-
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", {
|
|
75
|
+
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", {
|
|
76
|
+
style: {
|
|
77
|
+
color: theme.palette.titleAccent,
|
|
78
|
+
fontWeight: 700
|
|
79
|
+
},
|
|
80
|
+
children: `${captcha.target} `
|
|
81
|
+
})
|
|
75
82
|
]
|
|
76
83
|
}), /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("p", {
|
|
77
84
|
style: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
fontSize: "0.8rem"
|
|
85
|
+
...theme.typography.bodyMedium,
|
|
86
|
+
color: theme.palette.onSurfaceVariant,
|
|
87
|
+
margin: "4px 0 0 0"
|
|
82
88
|
},
|
|
83
89
|
children: t("WIDGET.IF_NONE_CLICK_NEXT")
|
|
84
90
|
})]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
let _prosopo_common = require("@prosopo/common");
|
|
2
|
+
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
2
3
|
let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
@@ -25,6 +26,7 @@ var CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
|
|
|
25
26
|
},
|
|
26
27
|
children: items.map((item, index) => {
|
|
27
28
|
const hash = getHash(item);
|
|
29
|
+
const selected = solution.some((s) => s[0] === hash);
|
|
28
30
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
|
|
29
31
|
style: {
|
|
30
32
|
flexGrow: 1,
|
|
@@ -41,7 +43,7 @@ var CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
|
|
|
41
43
|
margin: 0
|
|
42
44
|
},
|
|
43
45
|
onClick: (e) => {
|
|
44
|
-
if (!
|
|
46
|
+
if (!(0, _prosopo_procaptcha_common.isEventTrusted)(e)) return;
|
|
45
47
|
onClick(hash, e.clientX, e.clientY);
|
|
46
48
|
},
|
|
47
49
|
children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("img", {
|
|
@@ -54,7 +56,10 @@ var CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
|
|
|
54
56
|
overflow: "hidden",
|
|
55
57
|
borderStyle: "solid",
|
|
56
58
|
borderWidth: "1px",
|
|
57
|
-
borderColor: theme.palette.
|
|
59
|
+
borderColor: theme.palette.tile.border,
|
|
60
|
+
borderRadius: selected ? theme.shape.tileSelected : theme.shape.tile,
|
|
61
|
+
transform: selected ? "scale(0.9)" : "none",
|
|
62
|
+
transition: "transform 200ms cubic-bezier(0.2, 0, 0, 1), border-radius 200ms"
|
|
58
63
|
},
|
|
59
64
|
src: item.data,
|
|
60
65
|
alt: `Captcha image ${index + 1}`,
|
|
@@ -76,18 +81,22 @@ var CaptchaWidget = ({ challenge, solution, onClick, themeColor }) => {
|
|
|
76
81
|
display: "flex",
|
|
77
82
|
alignItems: "center",
|
|
78
83
|
justifyContent: "center",
|
|
79
|
-
backgroundColor:
|
|
80
|
-
|
|
84
|
+
backgroundColor: theme.palette.overlay,
|
|
85
|
+
borderRadius: theme.shape.tileSelected,
|
|
86
|
+
visibility: selected ? "visible" : "hidden"
|
|
81
87
|
},
|
|
82
88
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("svg", {
|
|
83
89
|
style: {
|
|
84
|
-
backgroundColor:
|
|
90
|
+
backgroundColor: theme.palette.checkbox.fill,
|
|
85
91
|
display: "block",
|
|
86
|
-
width: "
|
|
87
|
-
height: "
|
|
92
|
+
width: "34px",
|
|
93
|
+
height: "34px",
|
|
94
|
+
padding: "7px",
|
|
95
|
+
borderRadius: "50%",
|
|
96
|
+
boxSizing: "border-box",
|
|
88
97
|
transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
89
98
|
userSelect: "none",
|
|
90
|
-
fill:
|
|
99
|
+
fill: theme.palette.checkbox.tick
|
|
91
100
|
},
|
|
92
101
|
focusable: "false",
|
|
93
102
|
color: "#fff",
|
|
@@ -13,12 +13,11 @@ var ModalInnerDivCSS = _emotion_react.css`
|
|
|
13
13
|
max-width: 500px;
|
|
14
14
|
background-color: transparent;
|
|
15
15
|
border: none;
|
|
16
|
-
border-radius:
|
|
16
|
+
border-radius: 28px;
|
|
17
17
|
z-index: 2147483647;
|
|
18
18
|
align-self: center;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
19
|
+
/* Shadowless — the dialog separates from the page via the scrim and its own
|
|
20
|
+
surface role, not a drop shadow. */
|
|
22
21
|
box-sizing: border-box; /* Ensures border is part of width */
|
|
23
22
|
/* iOS only */
|
|
24
23
|
@supports (-webkit-touch-callout: none) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_CaptchaComponent = require("./CaptchaComponent.cjs");
|
|
2
2
|
const require_Modal = require("./Modal.cjs");
|
|
3
|
+
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
3
4
|
let _prosopo_widget_skeleton = require("@prosopo/widget-skeleton");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
6
7
|
let _prosopo_locale = require("@prosopo/locale");
|
|
7
|
-
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
8
8
|
let _prosopo_procaptcha = require("@prosopo/procaptcha");
|
|
9
9
|
let _prosopo_types = require("@prosopo/types");
|
|
10
10
|
//#region src/components/ProcaptchaWidget.tsx
|
|
@@ -113,7 +113,7 @@ var ProcaptchaWidget = (props) => {
|
|
|
113
113
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(_prosopo_procaptcha_common.Checkbox, {
|
|
114
114
|
theme,
|
|
115
115
|
onChange: async (event) => {
|
|
116
|
-
if (!
|
|
116
|
+
if (!(0, _prosopo_procaptcha_common.isEventTrusted)(event)) return;
|
|
117
117
|
if (loading) return;
|
|
118
118
|
setLoading(true);
|
|
119
119
|
let x = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,KAAK,oBAAoB,EAIzB,MAAM,OAAO,CAAC;AAGf,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACpE,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,UAAU,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AA8BD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkFjC,CAAC;AACF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import addDataAttr from "../util/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isEventTrusted } from "@prosopo/procaptcha-common";
|
|
3
|
+
import { darkTheme, lightTheme, withAlpha } from "@prosopo/widget-skeleton";
|
|
3
4
|
import { useMemo, useState } from "react";
|
|
4
5
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
5
6
|
//#region src/components/Button.tsx
|
|
@@ -16,36 +17,38 @@ var buttonStyleBase = {
|
|
|
16
17
|
verticalAlign: "middle",
|
|
17
18
|
appearance: void 0,
|
|
18
19
|
textDecoration: "none",
|
|
19
|
-
|
|
20
|
-
fontSize: "0.875rem",
|
|
21
|
-
lineHeight: "1.75",
|
|
22
|
-
letterSpacing: "0.02857em",
|
|
23
|
-
textTransform: "uppercase",
|
|
20
|
+
textTransform: "none",
|
|
24
21
|
minWidth: "64px",
|
|
25
|
-
|
|
26
|
-
borderRadius: "
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
minHeight: "40px",
|
|
23
|
+
borderRadius: "100px",
|
|
24
|
+
border: "none",
|
|
25
|
+
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",
|
|
26
|
+
backgroundColor: "transparent"
|
|
29
27
|
};
|
|
30
28
|
var Button = ({ themeColor, buttonType, text, onClick }) => {
|
|
31
29
|
const theme = useMemo(() => themeColor === "light" ? lightTheme : darkTheme, [themeColor]);
|
|
32
30
|
const [hover, setHover] = useState(false);
|
|
31
|
+
const [focusVisible, setFocusVisible] = useState(false);
|
|
33
32
|
const buttonStyle = useMemo(() => {
|
|
34
33
|
const baseStyle = {
|
|
35
34
|
...buttonStyleBase,
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
...theme.typography.labelLarge,
|
|
36
|
+
borderRadius: theme.shape.button,
|
|
38
37
|
fontFamily: theme.font.fontFamily,
|
|
39
|
-
width: "100%"
|
|
40
|
-
color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
|
|
38
|
+
width: "100%"
|
|
41
39
|
};
|
|
42
40
|
if (buttonType === "cancel") return {
|
|
43
41
|
...baseStyle,
|
|
44
|
-
|
|
42
|
+
padding: "8px 12px",
|
|
43
|
+
backgroundColor: hover ? withAlpha(theme.palette.primary.main, theme.stateLayer.hover) : "transparent",
|
|
44
|
+
color: theme.palette.primary.main
|
|
45
45
|
};
|
|
46
46
|
return {
|
|
47
47
|
...baseStyle,
|
|
48
|
-
|
|
48
|
+
padding: "8px 24px",
|
|
49
|
+
backgroundColor: theme.palette.primary.main,
|
|
50
|
+
color: theme.palette.primary.contrastText,
|
|
51
|
+
boxShadow: hover ? `inset 0 0 0 100px ${withAlpha(theme.palette.primary.contrastText, theme.stateLayer.hover)}` : theme.elevation.buttonPrimary
|
|
49
52
|
};
|
|
50
53
|
}, [
|
|
51
54
|
buttonType,
|
|
@@ -56,9 +59,17 @@ var Button = ({ themeColor, buttonType, text, onClick }) => {
|
|
|
56
59
|
...addDataAttr({ dev: { cy: `button-${buttonType}` } }),
|
|
57
60
|
onMouseEnter: () => setHover(true),
|
|
58
61
|
onMouseLeave: () => setHover(false),
|
|
59
|
-
|
|
62
|
+
onFocus: (e) => setFocusVisible(e.target.matches(":focus-visible")),
|
|
63
|
+
onBlur: () => setFocusVisible(false),
|
|
64
|
+
style: {
|
|
65
|
+
...buttonStyle,
|
|
66
|
+
...focusVisible ? {
|
|
67
|
+
outline: `3px solid ${theme.palette.primary.main}`,
|
|
68
|
+
outlineOffset: "2px"
|
|
69
|
+
} : {}
|
|
70
|
+
},
|
|
60
71
|
onClick: (e) => {
|
|
61
|
-
if (!e
|
|
72
|
+
if (!isEventTrusted(e)) return;
|
|
62
73
|
e.preventDefault();
|
|
63
74
|
onClick();
|
|
64
75
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[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