@prosopo/procaptcha-react 2.1.1 → 2.1.3

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 (50) hide show
  1. package/package.json +9 -9
  2. package/dist/cjs/components/Button.cjs +0 -76
  3. package/dist/cjs/components/CaptchaComponent.cjs +0 -185
  4. package/dist/cjs/components/CaptchaWidget.cjs +0 -186
  5. package/dist/cjs/components/Modal.cjs +0 -42
  6. package/dist/cjs/components/Procaptcha.cjs +0 -20
  7. package/dist/cjs/components/ProcaptchaWidget.cjs +0 -152
  8. package/dist/cjs/components/index.cjs +0 -9
  9. package/dist/cjs/index.cjs +0 -10
  10. package/dist/cjs/util/index.cjs +0 -18
  11. package/dist/components/Button.d.ts +0 -11
  12. package/dist/components/Button.d.ts.map +0 -1
  13. package/dist/components/Button.js +0 -61
  14. package/dist/components/Button.js.map +0 -1
  15. package/dist/components/CaptchaComponent.d.ts +0 -14
  16. package/dist/components/CaptchaComponent.d.ts.map +0 -1
  17. package/dist/components/CaptchaComponent.js +0 -73
  18. package/dist/components/CaptchaComponent.js.map +0 -1
  19. package/dist/components/CaptchaWidget.d.ts +0 -9
  20. package/dist/components/CaptchaWidget.d.ts.map +0 -1
  21. package/dist/components/CaptchaWidget.js +0 -106
  22. package/dist/components/CaptchaWidget.js.map +0 -1
  23. package/dist/components/Modal.d.ts +0 -8
  24. package/dist/components/Modal.d.ts.map +0 -1
  25. package/dist/components/Modal.js +0 -37
  26. package/dist/components/Modal.js.map +0 -1
  27. package/dist/components/Procaptcha.d.ts +0 -8
  28. package/dist/components/Procaptcha.d.ts.map +0 -1
  29. package/dist/components/Procaptcha.js +0 -7
  30. package/dist/components/Procaptcha.js.map +0 -1
  31. package/dist/components/ProcaptchaWidget.d.ts +0 -4
  32. package/dist/components/ProcaptchaWidget.d.ts.map +0 -1
  33. package/dist/components/ProcaptchaWidget.js +0 -56
  34. package/dist/components/ProcaptchaWidget.js.map +0 -1
  35. package/dist/components/collector.d.ts +0 -9
  36. package/dist/components/collector.d.ts.map +0 -1
  37. package/dist/components/collector.js +0 -26
  38. package/dist/components/collector.js.map +0 -1
  39. package/dist/components/index.d.ts +0 -6
  40. package/dist/components/index.d.ts.map +0 -1
  41. package/dist/components/index.js +0 -6
  42. package/dist/components/index.js.map +0 -1
  43. package/dist/index.d.ts +0 -3
  44. package/dist/index.d.ts.map +0 -1
  45. package/dist/index.js +0 -3
  46. package/dist/index.js.map +0 -1
  47. package/dist/util/index.d.ts +0 -9
  48. package/dist/util/index.d.ts.map +0 -1
  49. package/dist/util/index.js +0 -12
  50. package/dist/util/index.js.map +0 -1
@@ -1,152 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("@emotion/react/jsx-runtime");
3
- const localeBrowser = require("@prosopo/locale-browser");
4
- const procaptcha = require("@prosopo/procaptcha");
5
- const procaptchaCommon = require("@prosopo/procaptcha-common");
6
- const types = require("@prosopo/types");
7
- const webComponents = require("@prosopo/web-components");
8
- const React = require("react");
9
- const CaptchaComponent = require("./CaptchaComponent.cjs");
10
- const Modal = require("./Modal.cjs");
11
- const ProcaptchaWidget = (props) => {
12
- const { t } = localeBrowser.useTranslation();
13
- const config = types.ProcaptchaConfigSchema.parse(props.config);
14
- const callbacks = props.callbacks || {};
15
- const [state, updateState] = procaptchaCommon.useProcaptcha(React.useState, React.useRef);
16
- const manager = procaptcha.Manager(config, state, updateState, callbacks);
17
- const themeColor = props.config.theme === "light" ? "light" : "dark";
18
- const theme = props.config.theme === "light" ? webComponents.lightTheme : webComponents.darkTheme;
19
- React.useEffect(() => {
20
- if (config.language) {
21
- localeBrowser.i18n.changeLanguage(config.language);
22
- }
23
- }, [config.language]);
24
- return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
25
- "div",
26
- {
27
- style: {
28
- maxWidth: webComponents.WIDGET_MAX_WIDTH,
29
- maxHeight: "100%",
30
- overflowX: "auto"
31
- },
32
- children: [
33
- /* @__PURE__ */ jsxRuntime.jsx(Modal, { show: state.showModal, children: state.challenge ? /* @__PURE__ */ jsxRuntime.jsx(
34
- CaptchaComponent,
35
- {
36
- challenge: state.challenge,
37
- index: state.index,
38
- solutions: state.solutions,
39
- onSubmit: manager.submit,
40
- onCancel: manager.cancel,
41
- onClick: manager.select,
42
- onNext: manager.nextRound,
43
- themeColor: config.theme ?? "light"
44
- }
45
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: "No challenge set." }) }),
46
- /* @__PURE__ */ jsxRuntime.jsx(webComponents.ContainerDiv, { children: /* @__PURE__ */ jsxRuntime.jsx(webComponents.WidthBasedStylesDiv, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: webComponents.WIDGET_DIMENSIONS, "data-cy": "button-human", children: [
47
- " ",
48
- /* @__PURE__ */ jsxRuntime.jsxs(
49
- "div",
50
- {
51
- style: {
52
- padding: webComponents.WIDGET_PADDING,
53
- border: webComponents.WIDGET_BORDER,
54
- backgroundColor: theme.palette.background.default,
55
- borderColor: theme.palette.grey[300],
56
- borderRadius: webComponents.WIDGET_BORDER_RADIUS,
57
- display: "flex",
58
- alignItems: "center",
59
- flexWrap: "wrap",
60
- justifyContent: "space-between",
61
- minHeight: `${webComponents.WIDGET_INNER_HEIGHT}px`,
62
- overflow: "hidden"
63
- },
64
- children: [
65
- /* @__PURE__ */ jsxRuntime.jsx(
66
- "div",
67
- {
68
- style: { display: "inline-flex", flexDirection: "column" },
69
- children: /* @__PURE__ */ jsxRuntime.jsx(
70
- "div",
71
- {
72
- style: {
73
- alignItems: "center",
74
- flex: 1
75
- },
76
- children: /* @__PURE__ */ jsxRuntime.jsxs(
77
- "div",
78
- {
79
- style: {
80
- display: "flex",
81
- alignItems: "center",
82
- justifyContent: "center",
83
- flexDirection: "column",
84
- verticalAlign: "middle"
85
- },
86
- children: [
87
- /* @__PURE__ */ jsxRuntime.jsx(
88
- "div",
89
- {
90
- style: {
91
- display: !state.loading && !state.error ? "flex" : "none"
92
- },
93
- children: /* @__PURE__ */ jsxRuntime.jsx(
94
- webComponents.Checkbox,
95
- {
96
- themeColor,
97
- onChange: manager.start,
98
- checked: state.isHuman,
99
- labelText: t("WIDGET.I_AM_HUMAN"),
100
- error: state.error,
101
- "aria-label": "human checkbox"
102
- }
103
- )
104
- }
105
- ),
106
- /* @__PURE__ */ jsxRuntime.jsx(
107
- "div",
108
- {
109
- style: {
110
- display: state.loading ? "flex" : "none"
111
- },
112
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "inline-flex" }, children: /* @__PURE__ */ jsxRuntime.jsx(
113
- webComponents.LoadingSpinner,
114
- {
115
- themeColor,
116
- "aria-label": "Loading spinner"
117
- }
118
- ) })
119
- }
120
- )
121
- ]
122
- }
123
- )
124
- }
125
- )
126
- }
127
- ),
128
- /* @__PURE__ */ jsxRuntime.jsx(
129
- "div",
130
- {
131
- style: { display: "inline-flex", flexDirection: "column" },
132
- children: /* @__PURE__ */ jsxRuntime.jsx(
133
- "a",
134
- {
135
- href: webComponents.WIDGET_URL,
136
- target: "_blank",
137
- "aria-label": webComponents.WIDGET_URL_TEXT,
138
- rel: "noreferrer",
139
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(webComponents.Logo, { themeColor, "aria-label": "Prosopo logo" }) })
140
- }
141
- )
142
- }
143
- )
144
- ]
145
- }
146
- )
147
- ] }) }) })
148
- ]
149
- }
150
- ) });
151
- };
152
- module.exports = ProcaptchaWidget;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CaptchaWidget = require("./CaptchaWidget.cjs");
4
- require("./CaptchaComponent.cjs");
5
- const ProcaptchaWidget = require("./ProcaptchaWidget.cjs");
6
- const Procaptcha = require("./Procaptcha.cjs");
7
- exports.CaptchaWidget = CaptchaWidget.CaptchaWidget;
8
- exports.ProcaptchaWidget = ProcaptchaWidget;
9
- exports.Procaptcha = Procaptcha;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./components/index.cjs");
4
- require("./util/index.cjs");
5
- const ProcaptchaWidget = require("./components/ProcaptchaWidget.cjs");
6
- const Procaptcha = require("./components/Procaptcha.cjs");
7
- const CaptchaWidget = require("./components/CaptchaWidget.cjs");
8
- exports.ProcaptchaWidget = ProcaptchaWidget;
9
- exports.Procaptcha = Procaptcha;
10
- exports.CaptchaWidget = CaptchaWidget.CaptchaWidget;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- function renameKeysForDataAttr(data = {}) {
3
- return Object.keys(data).reduce(
4
- // biome-ignore lint/performance/noAccumulatingSpread: TODO fix
5
- (prev, curr) => ({ ...prev, [`data-${curr}`]: data[curr] }),
6
- {}
7
- );
8
- }
9
- function addDataAttr({
10
- general,
11
- dev
12
- }) {
13
- return {
14
- ...renameKeysForDataAttr(general),
15
- ...process.env.NODE_ENV !== "production" ? renameKeysForDataAttr(dev) : {}
16
- };
17
- }
18
- module.exports = addDataAttr;
@@ -1,11 +0,0 @@
1
- import type React from "react";
2
- import { type ButtonHTMLAttributes } from "react";
3
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
- themeColor: "light" | "dark";
5
- buttonType: "cancel" | "next";
6
- onClick: () => void;
7
- text: string;
8
- }
9
- declare const Button: React.FC<ButtonProps>;
10
- export default Button;
11
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAcA,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;AAgCD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA+CjC,CAAC;AACF,eAAe,MAAM,CAAC"}
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { darkTheme, lightTheme } from "@prosopo/web-components";
3
- import { useMemo, useState, } from "react";
4
- import addDataAttr from "../util/index.js";
5
- const buttonStyleBase = {
6
- display: "inline-flex",
7
- alignItems: "center",
8
- justifyContent: "center",
9
- position: "relative",
10
- boxSizing: "border-box",
11
- outline: "0px",
12
- border: "0px",
13
- margin: "0px",
14
- cursor: "pointer",
15
- userSelect: "none",
16
- verticalAlign: "middle",
17
- appearance: undefined,
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
- color: "rgb(0, 0, 0)",
29
- backgroundColor: "#ffffff",
30
- 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",
31
- };
32
- const Button = ({ themeColor, buttonType, text, onClick, }) => {
33
- const theme = useMemo(() => (themeColor === "light" ? lightTheme : darkTheme), [themeColor]);
34
- const [hover, setHover] = useState(false);
35
- const buttonStyle = useMemo(() => {
36
- const baseStyle = {
37
- ...buttonStyleBase,
38
- color: hover
39
- ? theme.palette.primary.contrastText
40
- : theme.palette.background.contrastText,
41
- };
42
- if (buttonType === "cancel") {
43
- return {
44
- ...baseStyle,
45
- backgroundColor: hover ? theme.palette.grey[600] : "transparent",
46
- };
47
- }
48
- return {
49
- ...baseStyle,
50
- backgroundColor: hover
51
- ? theme.palette.primary.main
52
- : theme.palette.background.default,
53
- };
54
- }, [buttonType, hover, theme]);
55
- return (_jsx("button", { ...addDataAttr({ dev: { cy: `button-${buttonType}` } }), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: buttonStyle, onClick: (e) => {
56
- e.preventDefault();
57
- onClick();
58
- }, "aria-label": text, children: text }));
59
- };
60
- export default Button;
61
- //# sourceMappingURL=Button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAGN,OAAO,EACP,QAAQ,GACR,MAAM,OAAO,CAAC;AACf,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAS3C,MAAM,eAAe,GAAkB;IACtC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,QAAQ;IACvB,UAAU,EAAE,SAAS;IACrB,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,WAAW;IAC1B,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,KAAK;IACnB,UAAU,E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UAAU,UAAU,EAAE,EAAE,EAAE,CAAC,EACxD,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAClC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO,EAAE,CAAC;QACX,CAAC,gBACW,IAAI,YAEf,IAAI,GACG,CACT,CAAC;AACH,CAAC,CAAC;AACF,eAAe,MAAM,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { CaptchaResponseBody } from "@prosopo/types";
2
- export interface CaptchaComponentProps {
3
- challenge: CaptchaResponseBody;
4
- index: number;
5
- solutions: string[][];
6
- onSubmit: () => void;
7
- onCancel: () => void;
8
- onClick: (hash: string) => void;
9
- onNext: () => void;
10
- themeColor: "light" | "dark";
11
- }
12
- declare const CaptchaComponent: ({ challenge, index, solutions, onSubmit, onCancel, onClick, onNext, themeColor, }: CaptchaComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
13
- export default CaptchaComponent;
14
- //# sourceMappingURL=CaptchaComponent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAQ1D,MAAM,WAAW,qBAAqB;IACrC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;CAC7B;AAED,QAAA,MAAM,gBAAgB,sFASnB,qBAAqB,qDAiJvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,73 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { useTranslation } from "@prosopo/locale-browser";
3
- import { at } from "@prosopo/util";
4
- import { darkTheme, lightTheme } from "@prosopo/web-components";
5
- import { Suspense, useMemo } from "react";
6
- import addDataAttr from "../util/index.js";
7
- import Button from "./Button.js";
8
- import { CaptchaWidget } from "./CaptchaWidget.js";
9
- const CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onClick, onNext, themeColor, }) => {
10
- const { t } = useTranslation();
11
- const captcha = challenge.captchas ? at(challenge.captchas, index) : null;
12
- const solution = solutions ? at(solutions, index) : [];
13
- const theme = useMemo(() => (themeColor === "light" ? lightTheme : darkTheme), [themeColor]);
14
- return (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx("div", { style: {
15
- overflowX: "auto",
16
- overflowY: "auto",
17
- width: "100%",
18
- maxWidth: "500px",
19
- maxHeight: "100%",
20
- display: "flex",
21
- flexDirection: "column",
22
- border: "1px solid #dddddd",
23
- boxShadow: "rgba(255, 255, 255, 0.2) 0px 0px 4px",
24
- borderRadius: "4px",
25
- padding: `${theme.spacing.unit}px`,
26
- backgroundColor: theme.palette.background.default,
27
- }, children: _jsxs("div", { style: {
28
- backgroundColor: theme.palette.background.default,
29
- display: "flex",
30
- flexDirection: "column",
31
- minWidth: "300px",
32
- }, children: [_jsx("div", { style: {
33
- display: "flex",
34
- alignItems: "center",
35
- width: "100%",
36
- }, children: _jsx("div", { style: {
37
- backgroundColor: theme.palette.primary.main,
38
- width: "100%",
39
- }, children: _jsxs("div", { style: {
40
- paddingLeft: `${theme.spacing.half}px`,
41
- paddingRight: `${theme.spacing.half}px`,
42
- }, children: [_jsxs("p", { style: {
43
- color: "#ffffff",
44
- fontWeight: 700,
45
- lineHeight: 1.5,
46
- }, children: [t("WIDGET.SELECT_ALL"), ":", "\u00A0", _jsx("span", { children: `${t(at(challenge.captchas, index).target)} ` })] }), _jsx("p", { style: {
47
- color: "#ffffff",
48
- fontWeight: 500,
49
- lineHeight: 0.8,
50
- fontSize: "0.8rem",
51
- }, children: t("WIDGET.IF_NONE_CLICK_NEXT") })] }) }) }), _jsx("div", { ...addDataAttr({ dev: { cy: `captcha-${index}` } }), children: captcha && (_jsx(CaptchaWidget, { challenge: captcha, solution: solution, onClick: onClick, themeColor: themeColor })) }), _jsx("div", { style: {
52
- display: "flex",
53
- alignItems: "center",
54
- justifyContent: "center",
55
- width: "100%",
56
- }, ...addDataAttr({ dev: { cy: "dots-captcha" } }) }), _jsx("div", { style: {
57
- padding: `0 ${theme.spacing}px`,
58
- display: "flex",
59
- width: "100%",
60
- } }), _jsxs("div", { style: {
61
- padding: `0 ${theme.spacing}px`,
62
- display: "flex",
63
- alignItems: "center",
64
- justifyContent: "space-between",
65
- lineHeight: 1.75,
66
- }, children: [_jsx(Button, { themeColor: themeColor, buttonType: "cancel", onClick: onCancel, text: t("WIDGET.CANCEL"), "aria-label": t("WIDGET.CANCEL") }), _jsx(Button, { themeColor: themeColor, buttonType: "next", text: index < challenge.captchas.length - 1
67
- ? t("WIDGET.NEXT")
68
- : t("WIDGET.SUBMIT"), onClick: index < challenge.captchas.length - 1 ? onNext : onSubmit, "aria-label": index < challenge.captchas.length - 1
69
- ? t("WIDGET.NEXT")
70
- : t("WIDGET.SUBMIT"), "data-cy": "button-next" })] })] }) }) }));
71
- };
72
- export default CaptchaComponent;
73
- //# sourceMappingURL=CaptchaComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAA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AC,CAAC,CAAC,CAAC,aAAa,CAAC;oCAClB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,aAEd,aAAa,GACpB,IACG,IACD,GACD,GACI,CACX,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { Captcha } from "@prosopo/types";
2
- export interface CaptchaWidgetProps {
3
- challenge: Captcha;
4
- solution: string[];
5
- onClick: (hash: string) => void;
6
- themeColor: "light" | "dark";
7
- }
8
- export declare const CaptchaWidget: ({ challenge, solution, onClick, themeColor, }: CaptchaWidgetProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
- //# sourceMappingURL=CaptchaWidget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;CAC7B;AAYD,eAAO,MAAM,aAAa,kDAKvB,kBAAkB,qDAiKpB,CAAC"}
@@ -1,106 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { ProsopoDatasetError } from "@prosopo/common";
3
- import { darkTheme, lightTheme } from "@prosopo/web-components";
4
- import { useMemo } from "react";
5
- const getHash = (item) => {
6
- if (!item.hash) {
7
- throw new ProsopoDatasetError("CAPTCHA.MISSING_ITEM_HASH", {
8
- context: { item },
9
- });
10
- }
11
- return item.hash;
12
- };
13
- export const CaptchaWidget = ({ challenge, solution, onClick, themeColor, }) => {
14
- const items = challenge.items;
15
- const theme = useMemo(() => (themeColor === "light" ? lightTheme : darkTheme), [themeColor]);
16
- const isTouchDevice = "ontouchstart" in window;
17
- const fullSpacing = `${theme.spacing.unit}px`;
18
- const halfSpacing = `${theme.spacing.half}px`;
19
- const paddingForImageColumns = {
20
- 0: {
21
- paddingLeft: 0,
22
- paddingRight: halfSpacing,
23
- paddingTop: halfSpacing,
24
- paddingBottom: halfSpacing,
25
- },
26
- 1: {
27
- paddingLeft: halfSpacing,
28
- paddingRight: halfSpacing,
29
- paddingTop: halfSpacing,
30
- paddingBottom: halfSpacing,
31
- },
32
- 2: {
33
- paddingLeft: halfSpacing,
34
- paddingRight: 0,
35
- paddingTop: halfSpacing,
36
- paddingBottom: halfSpacing,
37
- },
38
- };
39
- const paddingForImageRows = {
40
- 0: { paddingTop: fullSpacing },
41
- 2: { paddingBottom: fullSpacing },
42
- };
43
- return (_jsx("div", { style: {
44
- paddingRight: 0.5,
45
- paddingBottom: 0.5,
46
- width: "100%",
47
- height: "100%",
48
- display: "flex",
49
- flexDirection: "row",
50
- flexWrap: "wrap",
51
- }, children: items.map((item, index) => {
52
- const hash = getHash(item);
53
- const imageStyle = {
54
- ...paddingForImageColumns[index % 3],
55
- ...paddingForImageRows[Math.floor(index / 3)],
56
- flexGrow: 1,
57
- flexBasis: "33.3333%",
58
- boxSizing: "border-box",
59
- };
60
- return (_jsx("div", { style: imageStyle, children: _jsxs("div", { style: {
61
- cursor: "pointer",
62
- height: "100%",
63
- width: "100%",
64
- border: 1,
65
- borderStyle: "solid",
66
- borderColor: theme.palette.grey[300],
67
- }, onClick: isTouchDevice ? undefined : () => onClick(hash), onTouchStart: isTouchDevice ? () => onClick(hash) : undefined, children: [_jsx("div", { children: _jsx("img", { style: {
68
- width: "100%",
69
- backgroundColor: theme.palette.grey[300],
70
- opacity: solution.includes(hash) && isTouchDevice ? "50%" : "100%",
71
- display: "block",
72
- objectFit: "contain",
73
- aspectRatio: "1/1",
74
- height: "auto",
75
- }, src: item.data, alt: `Captcha image ${index + 1}` }) }), _jsx("div", { style: {
76
- position: "relative",
77
- width: "100%",
78
- height: "100%",
79
- top: "-100%",
80
- visibility: solution.includes(hash) ? "visible" : "hidden",
81
- transition: "opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
82
- opacity: 1,
83
- }, children: _jsx("div", { style: {
84
- position: "absolute",
85
- top: 0,
86
- left: 0,
87
- bottom: 0,
88
- right: 0,
89
- height: "100%",
90
- width: "100%",
91
- display: "flex",
92
- alignItems: "center",
93
- justifyContent: "center",
94
- backgroundColor: "rgba(0,0,0,0.5)",
95
- }, children: _jsx("svg", { style: {
96
- backgroundColor: "transparent",
97
- display: "block",
98
- width: "35%",
99
- height: "35%",
100
- transition: "fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
101
- userSelect: "none",
102
- fill: "currentcolor",
103
- }, focusable: "false", color: "#fff", "aria-hidden": "true", viewBox: "0 0 24 24", "data-testid": "CheckIcon", "aria-label": "Check icon", children: _jsx("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) }) }) })] }) }, item.hash));
104
- }) }));
105
- };
106
- //# sourceMappingURL=CaptchaWidget.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaptchaWidget.js","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUhC,MAAM,OAAO,GAAG,CAAC,IAAS,EAAE,EAAE;IAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE;YAC1D,OAAO,EAAE,EAAE,IAAI,EAAE;SACjB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC;AAClB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React.ReactNode;
5
- };
6
- declare const ModalComponent: React.MemoExoticComponent<(props: ModalProps, nextProps: ModalProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
7
- export default ModalComponent;
8
- //# sourceMappingURL=Modal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,KAAK,UAAU,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,cAAc,oCACX,UAAU,aAAa,UAAU,sDA2CzC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import React from "react";
3
- const ModalComponent = React.memo((props, nextProps) => {
4
- const { show, children } = props;
5
- const display = show ? "block" : "none";
6
- const ModalOuterDivCss = {
7
- position: "fixed",
8
- zIndex: 2147483646,
9
- inset: 0,
10
- display,
11
- };
12
- const ModalBackgroundCSS = {
13
- position: "fixed",
14
- display: "flex",
15
- alignItems: "center",
16
- justifyContent: "center",
17
- right: 0,
18
- bottom: 0,
19
- top: 0,
20
- left: 0,
21
- backgroundColor: "rgba(0, 0, 0, 0.5)",
22
- zIndex: -1,
23
- };
24
- const ModalInnerDivCSS = {
25
- position: "absolute",
26
- top: "50%",
27
- left: "50%",
28
- transform: "translate(-50%, -50%)",
29
- width: "400px",
30
- backgroundColor: "transparent",
31
- border: "none",
32
- 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,",
33
- };
34
- return (_jsxs("div", { className: "prosopo-modalOuter", style: ModalOuterDivCss, children: [_jsx("div", { className: "prosopo-modalBackground", style: ModalBackgroundCSS }), _jsx("div", { className: "prosopo-modalInner", style: ModalInnerDivCSS, children: children })] }));
35
- });
36
- export default ModalComponent;
37
- //# sourceMappingURL=Modal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/components/Modal.tsx"],"names":[],"mappings":";AAaA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAMlD,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAChC,CAAC,KAAiB,EAAE,SAAqB,EAAE,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,gBAAgB,GAAkB;QACvC,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,CAAC;QACR,OAAO;KACP,CAAC;IAEF,MAAM,kBAAkB,GAAkB;QACzC,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,oBAAoB;QACrC,MAAM,EAAE,CAAC,CAAC;KACV,CAAC;IACF,MAAM,gBAAgB,GAAkB;QACvC,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,uBAAuB;QAClC,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,aAAa;QAC9B,MAAM,EAAE,MAAM;QACd,SAAS,EACR,qHAAqH;KACtH,CAAC;IAEF,OAAO,CACN,eAAK,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,gBAAgB,aAC1D,cAAK,SAAS,EAAC,yBAAyB,EAAC,KAAK,EAAE,kBAAkB,GAAI,EACtE,cAAK,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,gBAAgB,YACzD,QAAQ,GACJ,IACD,CACN,CAAC;AACH,CAAC,CACD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { ProcaptchaEvents } from "@prosopo/types";
2
- import { type LazyExoticComponent } from "react";
3
- import type { ReactElement } from "react";
4
- declare const ProcaptchaWidget: LazyExoticComponent<(props: any, callbacks: Partial<ProcaptchaEvents>) => ReactElement>;
5
- type ProcaptchaProps = React.ComponentProps<typeof ProcaptchaWidget>;
6
- declare const Procaptcha: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
- export default Procaptcha;
8
- //# sourceMappingURL=Procaptcha.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,QAAA,MAAM,gBAAgB,EAAE,mBAAmB,CAE1C,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,YAAY,CACd,CAAC;AACtD,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAErE,QAAA,MAAM,UAAU,UAAW,eAAe,qDAWzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { ProcaptchaPlaceholder } from "@prosopo/web-components";
3
- import { Suspense, lazy } from "react";
4
- const ProcaptchaWidget = lazy(async () => import("./ProcaptchaWidget.js"));
5
- const Procaptcha = (props) => (_jsx(Suspense, { fallback: _jsx(ProcaptchaPlaceholder, { config: props.config, callbacks: props.callbacks }), children: _jsx(ProcaptchaWidget, { config: props.config, callbacks: props.callbacks }) }));
6
- export default Procaptcha;
7
- //# sourceMappingURL=Procaptcha.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA4B,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIjE,MAAM,gBAAgB,GAGlB,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;AAGtD,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CAC9C,KAAC,QAAQ,IACR,QAAQ,EACP,KAAC,qBAAqB,IACrB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,GACzB,YAGH,KAAC,gBAAgB,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,GAC5D,CACX,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type ProcaptchaProps } from "@prosopo/types";
2
- declare const ProcaptchaWidget: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
- export default ProcaptchaWidget;
4
- //# sourceMappingURL=ProcaptchaWidget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAsB9E,QAAA,MAAM,gBAAgB,UAAW,eAAe,qDAgI/C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}