@prosopo/procaptcha-react 2.1.1 → 2.1.2
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/package.json +9 -9
- package/dist/cjs/components/Button.cjs +0 -76
- package/dist/cjs/components/CaptchaComponent.cjs +0 -185
- package/dist/cjs/components/CaptchaWidget.cjs +0 -186
- package/dist/cjs/components/Modal.cjs +0 -42
- package/dist/cjs/components/Procaptcha.cjs +0 -20
- package/dist/cjs/components/ProcaptchaWidget.cjs +0 -152
- package/dist/cjs/components/index.cjs +0 -9
- package/dist/cjs/index.cjs +0 -10
- package/dist/cjs/util/index.cjs +0 -18
- package/dist/components/Button.d.ts +0 -11
- package/dist/components/Button.d.ts.map +0 -1
- package/dist/components/Button.js +0 -61
- package/dist/components/Button.js.map +0 -1
- package/dist/components/CaptchaComponent.d.ts +0 -14
- package/dist/components/CaptchaComponent.d.ts.map +0 -1
- package/dist/components/CaptchaComponent.js +0 -73
- package/dist/components/CaptchaComponent.js.map +0 -1
- package/dist/components/CaptchaWidget.d.ts +0 -9
- package/dist/components/CaptchaWidget.d.ts.map +0 -1
- package/dist/components/CaptchaWidget.js +0 -106
- package/dist/components/CaptchaWidget.js.map +0 -1
- package/dist/components/Modal.d.ts +0 -8
- package/dist/components/Modal.d.ts.map +0 -1
- package/dist/components/Modal.js +0 -37
- package/dist/components/Modal.js.map +0 -1
- package/dist/components/Procaptcha.d.ts +0 -8
- package/dist/components/Procaptcha.d.ts.map +0 -1
- package/dist/components/Procaptcha.js +0 -7
- package/dist/components/Procaptcha.js.map +0 -1
- package/dist/components/ProcaptchaWidget.d.ts +0 -4
- package/dist/components/ProcaptchaWidget.d.ts.map +0 -1
- package/dist/components/ProcaptchaWidget.js +0 -56
- package/dist/components/ProcaptchaWidget.js.map +0 -1
- package/dist/components/collector.d.ts +0 -9
- package/dist/components/collector.d.ts.map +0 -1
- package/dist/components/collector.js +0 -26
- package/dist/components/collector.js.map +0 -1
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -6
- package/dist/components/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/util/index.d.ts +0 -9
- package/dist/util/index.d.ts.map +0 -1
- package/dist/util/index.js +0 -12
- package/dist/util/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"browserslist": ["> 0.5%, last 2 versions, not dead"],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@prosopo/common": "2.1.
|
|
30
|
-
"@prosopo/locale-browser": "2.1.
|
|
31
|
-
"@prosopo/procaptcha": "2.1.
|
|
32
|
-
"@prosopo/procaptcha-common": "2.1.
|
|
33
|
-
"@prosopo/types": "2.1.
|
|
34
|
-
"@prosopo/util": "2.1.
|
|
35
|
-
"@prosopo/web-components": "2.1.
|
|
29
|
+
"@prosopo/common": "2.1.2",
|
|
30
|
+
"@prosopo/locale-browser": "2.1.2",
|
|
31
|
+
"@prosopo/procaptcha": "2.1.2",
|
|
32
|
+
"@prosopo/procaptcha-common": "2.1.2",
|
|
33
|
+
"@prosopo/types": "2.1.2",
|
|
34
|
+
"@prosopo/util": "2.1.2",
|
|
35
|
+
"@prosopo/web-components": "2.1.2",
|
|
36
36
|
"csstype": "3.1.3",
|
|
37
37
|
"react": "18.3.1"
|
|
38
38
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@prosopo/config": "2.1.
|
|
52
|
+
"@prosopo/config": "2.1.2",
|
|
53
53
|
"@vitest/coverage-v8": "2.1.1",
|
|
54
54
|
"concurrently": "9.0.1",
|
|
55
55
|
"npm-run-all": "4.1.5",
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
|
-
const webComponents = require("@prosopo/web-components");
|
|
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
|
-
border: "0px",
|
|
14
|
-
margin: "0px",
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
userSelect: "none",
|
|
17
|
-
verticalAlign: "middle",
|
|
18
|
-
appearance: void 0,
|
|
19
|
-
textDecoration: "none",
|
|
20
|
-
fontWeight: "500",
|
|
21
|
-
fontSize: "0.875rem",
|
|
22
|
-
lineHeight: "1.75",
|
|
23
|
-
letterSpacing: "0.02857em",
|
|
24
|
-
textTransform: "uppercase",
|
|
25
|
-
minWidth: "64px",
|
|
26
|
-
padding: "6px 16px",
|
|
27
|
-
borderRadius: "4px",
|
|
28
|
-
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",
|
|
29
|
-
color: "rgb(0, 0, 0)",
|
|
30
|
-
backgroundColor: "#ffffff",
|
|
31
|
-
boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px"
|
|
32
|
-
};
|
|
33
|
-
const Button = ({
|
|
34
|
-
themeColor,
|
|
35
|
-
buttonType,
|
|
36
|
-
text,
|
|
37
|
-
onClick
|
|
38
|
-
}) => {
|
|
39
|
-
const theme = React.useMemo(
|
|
40
|
-
() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
|
|
41
|
-
[themeColor]
|
|
42
|
-
);
|
|
43
|
-
const [hover, setHover] = React.useState(false);
|
|
44
|
-
const buttonStyle = React.useMemo(() => {
|
|
45
|
-
const baseStyle = {
|
|
46
|
-
...buttonStyleBase,
|
|
47
|
-
color: hover ? theme.palette.primary.contrastText : theme.palette.background.contrastText
|
|
48
|
-
};
|
|
49
|
-
if (buttonType === "cancel") {
|
|
50
|
-
return {
|
|
51
|
-
...baseStyle,
|
|
52
|
-
backgroundColor: hover ? theme.palette.grey[600] : "transparent"
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
...baseStyle,
|
|
57
|
-
backgroundColor: hover ? theme.palette.primary.main : theme.palette.background.default
|
|
58
|
-
};
|
|
59
|
-
}, [buttonType, hover, theme]);
|
|
60
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
...index({ dev: { cy: `button-${buttonType}` } }),
|
|
64
|
-
onMouseEnter: () => setHover(true),
|
|
65
|
-
onMouseLeave: () => setHover(false),
|
|
66
|
-
style: buttonStyle,
|
|
67
|
-
onClick: (e) => {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
onClick();
|
|
70
|
-
},
|
|
71
|
-
"aria-label": text,
|
|
72
|
-
children: text
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
module.exports = Button;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
|
-
const localeBrowser = require("@prosopo/locale-browser");
|
|
4
|
-
const util = require("@prosopo/util");
|
|
5
|
-
const webComponents = require("@prosopo/web-components");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
const index = require("../util/index.cjs");
|
|
8
|
-
const Button = require("./Button.cjs");
|
|
9
|
-
const CaptchaWidget = require("./CaptchaWidget.cjs");
|
|
10
|
-
const CaptchaComponent = ({
|
|
11
|
-
challenge,
|
|
12
|
-
index: index$1,
|
|
13
|
-
solutions,
|
|
14
|
-
onSubmit,
|
|
15
|
-
onCancel,
|
|
16
|
-
onClick,
|
|
17
|
-
onNext,
|
|
18
|
-
themeColor
|
|
19
|
-
}) => {
|
|
20
|
-
const { t } = localeBrowser.useTranslation();
|
|
21
|
-
const captcha = challenge.captchas ? util.at(challenge.captchas, index$1) : null;
|
|
22
|
-
const solution = solutions ? util.at(solutions, index$1) : [];
|
|
23
|
-
const theme = React.useMemo(
|
|
24
|
-
() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
|
|
25
|
-
[themeColor]
|
|
26
|
-
);
|
|
27
|
-
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
style: {
|
|
31
|
-
// introduce scroll bars when screen < minWidth of children
|
|
32
|
-
overflowX: "auto",
|
|
33
|
-
overflowY: "auto",
|
|
34
|
-
width: "100%",
|
|
35
|
-
maxWidth: "500px",
|
|
36
|
-
maxHeight: "100%",
|
|
37
|
-
display: "flex",
|
|
38
|
-
flexDirection: "column",
|
|
39
|
-
border: "1px solid #dddddd",
|
|
40
|
-
boxShadow: "rgba(255, 255, 255, 0.2) 0px 0px 4px",
|
|
41
|
-
borderRadius: "4px",
|
|
42
|
-
padding: `${theme.spacing.unit}px`,
|
|
43
|
-
backgroundColor: theme.palette.background.default
|
|
44
|
-
},
|
|
45
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
style: {
|
|
49
|
-
backgroundColor: theme.palette.background.default,
|
|
50
|
-
display: "flex",
|
|
51
|
-
flexDirection: "column",
|
|
52
|
-
minWidth: "300px"
|
|
53
|
-
},
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
style: {
|
|
59
|
-
display: "flex",
|
|
60
|
-
alignItems: "center",
|
|
61
|
-
width: "100%"
|
|
62
|
-
},
|
|
63
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
style: {
|
|
67
|
-
backgroundColor: theme.palette.primary.main,
|
|
68
|
-
width: "100%"
|
|
69
|
-
},
|
|
70
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
style: {
|
|
74
|
-
paddingLeft: `${theme.spacing.half}px`,
|
|
75
|
-
paddingRight: `${theme.spacing.half}px`
|
|
76
|
-
},
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
79
|
-
"p",
|
|
80
|
-
{
|
|
81
|
-
style: {
|
|
82
|
-
color: "#ffffff",
|
|
83
|
-
fontWeight: 700,
|
|
84
|
-
lineHeight: 1.5
|
|
85
|
-
},
|
|
86
|
-
children: [
|
|
87
|
-
t("WIDGET.SELECT_ALL"),
|
|
88
|
-
":",
|
|
89
|
-
" ",
|
|
90
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: `${t(util.at(challenge.captchas, index$1).target)} ` })
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
-
"p",
|
|
96
|
-
{
|
|
97
|
-
style: {
|
|
98
|
-
color: "#ffffff",
|
|
99
|
-
fontWeight: 500,
|
|
100
|
-
lineHeight: 0.8,
|
|
101
|
-
fontSize: "0.8rem"
|
|
102
|
-
},
|
|
103
|
-
children: t("WIDGET.IF_NONE_CLICK_NEXT")
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ...index({ dev: { cy: `captcha-${index$1}` } }), children: captcha && /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
-
CaptchaWidget.CaptchaWidget,
|
|
115
|
-
{
|
|
116
|
-
challenge: captcha,
|
|
117
|
-
solution,
|
|
118
|
-
onClick,
|
|
119
|
-
themeColor
|
|
120
|
-
}
|
|
121
|
-
) }),
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
style: {
|
|
126
|
-
display: "flex",
|
|
127
|
-
alignItems: "center",
|
|
128
|
-
justifyContent: "center",
|
|
129
|
-
width: "100%"
|
|
130
|
-
},
|
|
131
|
-
...index({ dev: { cy: "dots-captcha" } })
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
135
|
-
"div",
|
|
136
|
-
{
|
|
137
|
-
style: {
|
|
138
|
-
padding: `0 ${theme.spacing}px`,
|
|
139
|
-
display: "flex",
|
|
140
|
-
width: "100%"
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
),
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
145
|
-
"div",
|
|
146
|
-
{
|
|
147
|
-
style: {
|
|
148
|
-
padding: `0 ${theme.spacing}px`,
|
|
149
|
-
display: "flex",
|
|
150
|
-
alignItems: "center",
|
|
151
|
-
justifyContent: "space-between",
|
|
152
|
-
lineHeight: 1.75
|
|
153
|
-
},
|
|
154
|
-
children: [
|
|
155
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
156
|
-
Button,
|
|
157
|
-
{
|
|
158
|
-
themeColor,
|
|
159
|
-
buttonType: "cancel",
|
|
160
|
-
onClick: onCancel,
|
|
161
|
-
text: t("WIDGET.CANCEL"),
|
|
162
|
-
"aria-label": t("WIDGET.CANCEL")
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
166
|
-
Button,
|
|
167
|
-
{
|
|
168
|
-
themeColor,
|
|
169
|
-
buttonType: "next",
|
|
170
|
-
text: index$1 < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT"),
|
|
171
|
-
onClick: index$1 < challenge.captchas.length - 1 ? onNext : onSubmit,
|
|
172
|
-
"aria-label": index$1 < challenge.captchas.length - 1 ? t("WIDGET.NEXT") : t("WIDGET.SUBMIT"),
|
|
173
|
-
"data-cy": "button-next"
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
)
|
|
182
|
-
}
|
|
183
|
-
) });
|
|
184
|
-
};
|
|
185
|
-
module.exports = CaptchaComponent;
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
-
const common = require("@prosopo/common");
|
|
5
|
-
const webComponents = require("@prosopo/web-components");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
const getHash = (item) => {
|
|
8
|
-
if (!item.hash) {
|
|
9
|
-
throw new common.ProsopoDatasetError("CAPTCHA.MISSING_ITEM_HASH", {
|
|
10
|
-
context: { item }
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
return item.hash;
|
|
14
|
-
};
|
|
15
|
-
const CaptchaWidget = ({
|
|
16
|
-
challenge,
|
|
17
|
-
solution,
|
|
18
|
-
onClick,
|
|
19
|
-
themeColor
|
|
20
|
-
}) => {
|
|
21
|
-
const items = challenge.items;
|
|
22
|
-
const theme = React.useMemo(
|
|
23
|
-
() => themeColor === "light" ? webComponents.lightTheme : webComponents.darkTheme,
|
|
24
|
-
[themeColor]
|
|
25
|
-
);
|
|
26
|
-
const isTouchDevice = "ontouchstart" in window;
|
|
27
|
-
const fullSpacing = `${theme.spacing.unit}px`;
|
|
28
|
-
const halfSpacing = `${theme.spacing.half}px`;
|
|
29
|
-
const paddingForImageColumns = {
|
|
30
|
-
0: {
|
|
31
|
-
paddingLeft: 0,
|
|
32
|
-
paddingRight: halfSpacing,
|
|
33
|
-
paddingTop: halfSpacing,
|
|
34
|
-
paddingBottom: halfSpacing
|
|
35
|
-
},
|
|
36
|
-
1: {
|
|
37
|
-
paddingLeft: halfSpacing,
|
|
38
|
-
paddingRight: halfSpacing,
|
|
39
|
-
paddingTop: halfSpacing,
|
|
40
|
-
paddingBottom: halfSpacing
|
|
41
|
-
},
|
|
42
|
-
2: {
|
|
43
|
-
paddingLeft: halfSpacing,
|
|
44
|
-
paddingRight: 0,
|
|
45
|
-
paddingTop: halfSpacing,
|
|
46
|
-
paddingBottom: halfSpacing
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const paddingForImageRows = {
|
|
50
|
-
0: { paddingTop: fullSpacing },
|
|
51
|
-
2: { paddingBottom: fullSpacing }
|
|
52
|
-
};
|
|
53
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
style: {
|
|
57
|
-
paddingRight: 0.5,
|
|
58
|
-
paddingBottom: 0.5,
|
|
59
|
-
// expand to full height / width of parent
|
|
60
|
-
width: "100%",
|
|
61
|
-
height: "100%",
|
|
62
|
-
// display children in flex, spreading them evenly and wrapping when row length exceeded
|
|
63
|
-
display: "flex",
|
|
64
|
-
flexDirection: "row",
|
|
65
|
-
flexWrap: "wrap"
|
|
66
|
-
},
|
|
67
|
-
children: items.map((item, index) => {
|
|
68
|
-
const hash = getHash(item);
|
|
69
|
-
const imageStyle = {
|
|
70
|
-
...paddingForImageColumns[index % 3],
|
|
71
|
-
...paddingForImageRows[Math.floor(index / 3)],
|
|
72
|
-
// enable the items in the grid to grow in width to use up excess space
|
|
73
|
-
flexGrow: 1,
|
|
74
|
-
// make the width of each item 1/3rd of the width overall, i.e. 3 columns
|
|
75
|
-
flexBasis: "33.3333%",
|
|
76
|
-
// include the padding / margin / border in the width
|
|
77
|
-
boxSizing: "border-box"
|
|
78
|
-
};
|
|
79
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: imageStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
80
|
-
"div",
|
|
81
|
-
{
|
|
82
|
-
style: {
|
|
83
|
-
cursor: "pointer",
|
|
84
|
-
height: "100%",
|
|
85
|
-
width: "100%",
|
|
86
|
-
border: 1,
|
|
87
|
-
borderStyle: "solid",
|
|
88
|
-
borderColor: theme.palette.grey[300]
|
|
89
|
-
},
|
|
90
|
-
onClick: isTouchDevice ? void 0 : () => onClick(hash),
|
|
91
|
-
onTouchStart: isTouchDevice ? () => onClick(hash) : void 0,
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
-
"img",
|
|
95
|
-
{
|
|
96
|
-
style: {
|
|
97
|
-
width: "100%",
|
|
98
|
-
// image should be full width / height of the item
|
|
99
|
-
backgroundColor: theme.palette.grey[300],
|
|
100
|
-
// colour of the bands when letterboxing and image
|
|
101
|
-
opacity: solution.includes(hash) && isTouchDevice ? "50%" : "100%",
|
|
102
|
-
// iphone workaround
|
|
103
|
-
display: "block",
|
|
104
|
-
// removes whitespace below imgs
|
|
105
|
-
objectFit: "contain",
|
|
106
|
-
// contain the entire image in the img tag
|
|
107
|
-
aspectRatio: "1/1",
|
|
108
|
-
// force AR to be 1, letterboxing images with different aspect ratios
|
|
109
|
-
height: "auto"
|
|
110
|
-
// make the img tag responsive to its container
|
|
111
|
-
},
|
|
112
|
-
src: item.data,
|
|
113
|
-
alt: `Captcha image ${index + 1}`
|
|
114
|
-
}
|
|
115
|
-
) }),
|
|
116
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
style: {
|
|
120
|
-
// relative to where the element _should_ be positioned
|
|
121
|
-
position: "relative",
|
|
122
|
-
// make the overlay the full height/width of an item
|
|
123
|
-
width: "100%",
|
|
124
|
-
height: "100%",
|
|
125
|
-
// shift it up 100% to overlay the item element
|
|
126
|
-
top: "-100%",
|
|
127
|
-
visibility: solution.includes(hash) ? "visible" : "hidden",
|
|
128
|
-
// transition on opacity upon (de)selection
|
|
129
|
-
transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
130
|
-
opacity: 1
|
|
131
|
-
},
|
|
132
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
style: {
|
|
136
|
-
// make the overlay absolute positioned compare to its container
|
|
137
|
-
position: "absolute",
|
|
138
|
-
// spread across 100% width/height of the item box
|
|
139
|
-
top: 0,
|
|
140
|
-
left: 0,
|
|
141
|
-
bottom: 0,
|
|
142
|
-
right: 0,
|
|
143
|
-
height: "100%",
|
|
144
|
-
width: "100%",
|
|
145
|
-
// display overlays in center
|
|
146
|
-
display: "flex",
|
|
147
|
-
alignItems: "center",
|
|
148
|
-
justifyContent: "center",
|
|
149
|
-
// make bg half opacity, i.e. shadowing the item's img
|
|
150
|
-
backgroundColor: "rgba(0,0,0,0.5)"
|
|
151
|
-
},
|
|
152
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
-
"svg",
|
|
154
|
-
{
|
|
155
|
-
style: {
|
|
156
|
-
backgroundColor: "transparent",
|
|
157
|
-
// img must be displayed as block otherwise gets a bottom whitespace border
|
|
158
|
-
display: "block",
|
|
159
|
-
// how big the overlay icon is
|
|
160
|
-
width: "35%",
|
|
161
|
-
height: "35%",
|
|
162
|
-
transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
163
|
-
userSelect: "none",
|
|
164
|
-
fill: "currentcolor"
|
|
165
|
-
},
|
|
166
|
-
focusable: "false",
|
|
167
|
-
color: "#fff",
|
|
168
|
-
"aria-hidden": "true",
|
|
169
|
-
viewBox: "0 0 24 24",
|
|
170
|
-
"data-testid": "CheckIcon",
|
|
171
|
-
"aria-label": "Check icon",
|
|
172
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" })
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
) }, item.hash);
|
|
182
|
-
})
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
};
|
|
186
|
-
exports.CaptchaWidget = CaptchaWidget;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const ModalComponent = React.memo(
|
|
5
|
-
(props, nextProps) => {
|
|
6
|
-
const { show, children } = props;
|
|
7
|
-
const display = show ? "block" : "none";
|
|
8
|
-
const ModalOuterDivCss = {
|
|
9
|
-
position: "fixed",
|
|
10
|
-
zIndex: 2147483646,
|
|
11
|
-
inset: 0,
|
|
12
|
-
display
|
|
13
|
-
};
|
|
14
|
-
const ModalBackgroundCSS = {
|
|
15
|
-
position: "fixed",
|
|
16
|
-
display: "flex",
|
|
17
|
-
alignItems: "center",
|
|
18
|
-
justifyContent: "center",
|
|
19
|
-
right: 0,
|
|
20
|
-
bottom: 0,
|
|
21
|
-
top: 0,
|
|
22
|
-
left: 0,
|
|
23
|
-
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
24
|
-
zIndex: -1
|
|
25
|
-
};
|
|
26
|
-
const ModalInnerDivCSS = {
|
|
27
|
-
position: "absolute",
|
|
28
|
-
top: "50%",
|
|
29
|
-
left: "50%",
|
|
30
|
-
transform: "translate(-50%, -50%)",
|
|
31
|
-
width: "400px",
|
|
32
|
-
backgroundColor: "transparent",
|
|
33
|
-
border: "none",
|
|
34
|
-
boxShadow: "rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px,"
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "prosopo-modalOuter", style: ModalOuterDivCss, children: [
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "prosopo-modalBackground", style: ModalBackgroundCSS }),
|
|
38
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "prosopo-modalInner", style: ModalInnerDivCSS, children })
|
|
39
|
-
] });
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
module.exports = ModalComponent;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
3
|
-
const webComponents = require("@prosopo/web-components");
|
|
4
|
-
const React = require("react");
|
|
5
|
-
const _interopNamespaceDefaultOnly = (e) => Object.freeze(Object.defineProperty({ __proto__: null, default: e }, Symbol.toStringTag, { value: "Module" }));
|
|
6
|
-
const ProcaptchaWidget = React.lazy(async () => Promise.resolve().then(() => /* @__PURE__ */ _interopNamespaceDefaultOnly(require("./ProcaptchaWidget.cjs"))));
|
|
7
|
-
const Procaptcha = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8
|
-
React.Suspense,
|
|
9
|
-
{
|
|
10
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
-
webComponents.ProcaptchaPlaceholder,
|
|
12
|
-
{
|
|
13
|
-
config: props.config,
|
|
14
|
-
callbacks: props.callbacks
|
|
15
|
-
}
|
|
16
|
-
),
|
|
17
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks })
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
module.exports = Procaptcha;
|