@prosopo/procaptcha-react 0.1.7 → 0.1.9
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/README.md +2 -2
- package/dist/components/CaptchaComponent.d.ts.map +1 -1
- package/dist/components/CaptchaComponent.js +5 -3
- package/dist/components/CaptchaComponent.js.map +1 -1
- package/dist/components/CaptchaManager.d.ts.map +1 -1
- package/dist/components/CaptchaManager.js +11 -1
- package/dist/components/CaptchaManager.js.map +1 -1
- package/dist/components/CaptchaWidget.js +2 -2
- package/dist/components/CaptchaWidget.js.map +1 -1
- package/dist/components/ExtensionAccountSelect.d.ts.map +1 -1
- package/dist/components/ExtensionAccountSelect.js +3 -1
- package/dist/components/ExtensionAccountSelect.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.js +1 -1
- package/dist/styles.js.map +1 -1
- package/package.json +6 -5
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# React Prosopo Procaptcha Component Library
|
|
2
2
|
|
|
3
|
-
React components for integrating the Prosopo [procaptcha](https://github.com/prosopo
|
|
3
|
+
React components for integrating the Prosopo [procaptcha](https://github.com/prosopo/procaptcha) into a React app.
|
|
4
4
|
|
|
5
5
|
Prosopo is a distributed human verification service that can be used to stop bots from interacting with smart contracts. Sign up to be a network [alpha tester](https://5b06hrhtlmh.typeform.com/to/vNpyOUfg).
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ npm install @prosopo/procaptcha-react --save
|
|
|
14
14
|
|
|
15
15
|
## Basic Usage
|
|
16
16
|
|
|
17
|
-
See the [client example](https://github.com/prosopo
|
|
17
|
+
See the [client example](https://github.com/prosopo/client-example) for a minimal example of these components being used in a frontend app.
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
<Box className={"App"}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEH,oBAAoB,EAGvB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"CaptchaComponent.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAEH,oBAAoB,EAGvB,MAAM,qBAAqB,CAAC;AAU7B,wBAAgB,gBAAgB,CAAC,EAAE,eAAe,EAAE,EAAE;IAAE,eAAe,EAAE,oBAAoB,CAAA;CAAE,eAkF9F;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
3
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
3
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
4
4
|
//
|
|
5
5
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
6
6
|
// it under the terms of the GNU General Public License as published by
|
|
@@ -21,9 +21,11 @@ import Typography from "@mui/material/Typography";
|
|
|
21
21
|
import { ProsopoCaptchaStateClient, captchaStateReducer } from "@prosopo/procaptcha";
|
|
22
22
|
import { CaptchaContextManager } from "./CaptchaManager";
|
|
23
23
|
import { CaptchaWidget } from "./CaptchaWidget";
|
|
24
|
+
import { useTranslation } from "@prosopo/i18n";
|
|
24
25
|
import { useStyles } from "../styles";
|
|
25
26
|
import { addDataAttr } from "../util";
|
|
26
27
|
export function CaptchaComponent({ clientInterface }) {
|
|
28
|
+
const { t } = useTranslation();
|
|
27
29
|
const classes = useStyles();
|
|
28
30
|
const manager = useContext(CaptchaContextManager);
|
|
29
31
|
const [state, update] = useReducer(captchaStateReducer, { captchaIndex: 0, captchaSolution: [] });
|
|
@@ -54,7 +56,7 @@ export function CaptchaComponent({ clientInterface }) {
|
|
|
54
56
|
}, [account]);
|
|
55
57
|
// https://www.npmjs.com/package/i18next
|
|
56
58
|
return (_jsx(Box, { className: classes.root, children: account && captchaChallenge &&
|
|
57
|
-
_jsxs(Box, { className: classes.captchasContainer, children: [_jsx(Box, { className: classes.captchasHeader, children:
|
|
59
|
+
_jsxs(Box, { className: classes.captchasContainer, children: [_jsx(Box, { className: classes.captchasHeader, children: _jsx(Typography, { className: classes.captchasHeaderLabel, children: t("WIDGET.SELECT_ALL", { target: captchaChallenge.captchas[captchaIndex].captcha.target }) }) }), _jsxs(Box, { className: classes.captchasBody, ...addDataAttr({ dev: { cy: 'captcha-' + captchaIndex } }), children: [_jsx(CaptchaWidget, { challenge: captchaChallenge.captchas[captchaIndex], solution: captchaSolution[captchaIndex] || [], onChange: stateClientInterface.onChange.bind(stateClientInterface) }), _jsx(Box, { className: classes.dotsContainer, ...addDataAttr({ dev: { cy: 'dots-captcha' } }), children: captchaChallenge?.captchas.map((_, index) => _jsx(Box, { className: captchaIndex === index ? classes.dot : classes.dotActive }, index)) })] }), _jsxs(Box, { className: classes.captchasFooter, children: [_jsx(Button, { onClick: () => stateClientInterface.onCancel(), variant: "text", children: t('WIDGET.CANCEL') }), _jsx(Button, { onClick: () => stateClientInterface.onSubmit(), variant: "contained", ...addDataAttr({ dev: { cy: "button-next" } }), children: captchaIndex + 1 < totalCaptchas ? t('WIDGET.NEXT') : t('WIDGET.SUBMIT') })] })] }) }));
|
|
58
60
|
}
|
|
59
61
|
export default CaptchaComponent;
|
|
60
62
|
//# sourceMappingURL=CaptchaComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"CaptchaComponent.js","sourceR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AW,KACf,WAAW,CAAC,EAAC,GAAG,EAAE,EAAC,EAAE,EAAE,aAAa,EAAC,EAAC,CAAC,YAE1C,YAAY,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GACpE,IACP,IAEJ,GAER,CACT,CAAC;AACN,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaManager.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaManager.ts"],"names":[],"mappings":";AAiBA,OAAO,EACH,oBAAoB,EAGpB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,wBAAgB,UAAU,CAAC,cAAc,EAAE,oBAAoB,EAAE,SAAS,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,CAIxH;AAED,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"CaptchaManager.d.ts","sourceRoot":"","sources":["../../src/components/CaptchaManager.ts"],"names":[],"mappings":";AAiBA,OAAO,EACH,oBAAoB,EAGpB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,wBAAgB,UAAU,CAAC,cAAc,EAAE,oBAAoB,EAAE,SAAS,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,CAIxH;AAED,eAAO,MAAM,qBAAqB,iDAuBN,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
2
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
3
3
|
//
|
|
4
4
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
5
|
// it under the terms of the GNU General Public License as published by
|
|
@@ -30,6 +30,16 @@ export const CaptchaContextManager = createContext({
|
|
|
30
30
|
"solutionThreshold": 0,
|
|
31
31
|
"web2": false,
|
|
32
32
|
"prosopoContractAccount": "",
|
|
33
|
+
"accountCreator": {
|
|
34
|
+
"area": { width: 0, height: 0 },
|
|
35
|
+
"offsetParameter": 0,
|
|
36
|
+
"multiplier": 0,
|
|
37
|
+
"fontSizeFactor": 0,
|
|
38
|
+
"maxShadowBlur": 0,
|
|
39
|
+
"numberOfRounds": 0,
|
|
40
|
+
"seed": 0
|
|
41
|
+
},
|
|
42
|
+
"dappName": ""
|
|
33
43
|
}
|
|
34
44
|
},
|
|
35
45
|
update: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaManager.js","sourceRoot":"","sources":["../../src/components/CaptchaManager.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"CaptchaManager.js","sourceRoot":"","sources":["../../src/components/CaptchaManager.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAE5E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAEH,qBAAqB,EACrB,oBAAoB,EAEpB,oBAAoB,GAEvB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,UAAU,UAAU,CAAC,cAAoC,EAAE,SAAiC;IAC9F,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,UAAU,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;IACnF,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,UAAU,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACpE,OAAO,IAAI,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,CAAC,CAAC;AACnI,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;IAC/C,KAAK,EAAE;QACH,MAAM,EAAE;YACJ,qBAAqB,EAAE,EAAE;YACzB,oBAAoB,EAAE,EAAE;YACxB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;YACb,mBAAmB,EAAE,CAAC;YACtB,MAAM,EAAE,KAAK;YACb,wBAAwB,EAAE,EAAE;YAC5B,gBAAgB,EAAE;gBACd,MAAM,EAAG,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;gBAC9B,iBAAiB,EAAG,CAAC;gBACrB,YAAY,EAAG,CAAC;gBAChB,gBAAgB,EAAG,CAAC;gBACpB,eAAe,EAAG,CAAC;gBACnB,gBAAgB,EAAG,CAAC;gBACpB,MAAM,EAAG,CAAC;aACb;YACD,UAAU,EAAE,EAAE;SACjB;KACJ;IACD,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;CACO,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
4
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
4
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
5
5
|
//
|
|
6
6
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
7
7
|
// it under the terms of the GNU General Public License as published by
|
|
@@ -23,7 +23,7 @@ export function CaptchaWidget({ challenge, solution, onChange }) {
|
|
|
23
23
|
console.log("CHALLENGE", challenge);
|
|
24
24
|
const items = challenge.captcha.items;
|
|
25
25
|
const classes = useStyles();
|
|
26
|
-
return (_jsx(_Fragment, { children: items.map((item, index) => _createElement(Avatar, { ...addDataAttr({ dev: { cy: 'captcha-item', hash: item.hash } }), key: index, src: item.
|
|
26
|
+
return (_jsx(_Fragment, { children: items.map((item, index) => _createElement(Avatar, { ...addDataAttr({ dev: { cy: 'captcha-item', hash: item.hash ? item.hash : '' } }), key: index, src: item.data, variant: "square", className: classes.captchaItem + " " + (solution.includes(item.hash ? item.hash : '') ? " " + classes.captchaItemSelected : ""), onClick: () => onChange(item.hash ? item.hash : '') })) }));
|
|
27
27
|
}
|
|
28
28
|
export default CaptchaWidget;
|
|
29
29
|
//# sourceMappingURL=CaptchaWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaWidget.js","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":";;AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"CaptchaWidget.js","sourceRoot":"","sources":["../../src/components/CaptchaWidget.tsx"],"names":[],"mappings":";;AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EACgC;IAEzF,4CAA4C;IAC5C,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;IACtC,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAE5B,OAAO,CACH,4BACK,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,eAAC,MAAM,OAC3B,WAAW,CAAC,EAAC,GAAG,EAAE,EAAC,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAC,EAAC,CAAC,EAC9E,GAAG,EAAE,KAAK,EACV,GAAG,EAAE,IAAI,CAAC,IAAI,EACd,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAE,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/H,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,CAC1D,GACF,CACN,CAAC;AACN,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionAccountSelect.d.ts","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,sBAAsB;;aACU,iBAAiB,EAAE;sBAAoB,iBAAiB,GAAG,IAAI,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"ExtensionAccountSelect.d.ts","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,eAAO,MAAM,sBAAsB;;aACU,iBAAiB,EAAE;sBAAoB,iBAAiB,GAAG,IAAI,KAAK,IAAI;iBAgBpH,CAAA;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
3
3
|
import TextField from "@mui/material/TextField";
|
|
4
|
+
import { useTranslation } from "@prosopo/i18n";
|
|
4
5
|
export const ExtensionAccountSelect = ({ value, options, onChange }) => {
|
|
5
|
-
|
|
6
|
+
const { t } = useTranslation();
|
|
7
|
+
return (_jsx(Autocomplete, { disablePortal: true, id: "select-accounts", options: options, value: value, isOptionEqualToValue: (option, value) => option.address === value.address, onChange: (event, value) => onChange(value), sx: { width: 550 }, getOptionLabel: (option) => `${option.meta.name}\n${option.address}`, renderInput: (props) => _jsx(TextField, { ...props, label: t('WIDGET.SELECT_ACCOUNT') }) }));
|
|
6
8
|
};
|
|
7
9
|
export default ExtensionAccountSelect;
|
|
8
10
|
//# sourceMappingURL=ExtensionAccountSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionAccountSelect.js","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":";AAgBA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,SAAS,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExtensionAccountSelect.js","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":";AAgBA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EACsD,EAAE,EAAE;IACtH,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/B,OAAO,CACH,KAAC,YAAY,IACT,aAAa,QACb,EAAE,EAAC,iBAAiB,EACpB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,oBAAoB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EACzE,QAAQ,EAAE,CAAC,KAAqC,EAAE,KAA+B,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EACrG,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAClB,cAAc,EAAE,CAAC,MAAW,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,EAAE,EACzE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,uBAAuB,CAAC,GAAI,GACrF,CACL,CAAC;AACN,CAAC,CAAA;AAED,eAAe,sBAAsB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
2
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
3
3
|
//
|
|
4
4
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
5
|
// it under the terms of the GNU General Public License as published by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
2
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
3
3
|
//
|
|
4
4
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
5
|
// it under the terms of the GNU General Public License as published by
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/dist/styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (C) 2021-2022 Prosopo (UK) Ltd.
|
|
2
|
-
// This file is part of procaptcha-react <https://github.com/prosopo
|
|
2
|
+
// This file is part of procaptcha-react <https://github.com/prosopo/procaptcha-react>.
|
|
3
3
|
//
|
|
4
4
|
// procaptcha-react is free software: you can redistribute it and/or modify
|
|
5
5
|
// it under the terms of the GNU General Public License as published by
|
package/dist/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,uFAAuF;AACvF,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,GAAG,GAAG;IACR,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,YAAY,EAAE,GAAG;IACjB,WAAW,EAAE,CAAC;IACd,MAAM,EAAE,mBAAmB;IAC3B,eAAe,EAAE,SAAS;CAC7B,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE;QACF,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACjB;IACD,iBAAiB,EAAE;QACf,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,QAAQ;QACvB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,gCAAgC;KAC9C;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,SAAS;QAC1B,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,EAAE;KAClB;IACD,YAAY,EAAE;QACV,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,mBAAmB;KACpC;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;QAC/B,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;KACnB;IACD,WAAW,EAAE;QACT,KAAK,EAAE,kBAAkB;QACzB,YAAY,EAAE,CAAC;QACf,MAAM,EAAE,kBAAkB;QAC1B,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;KACnB;IACD,mBAAmB,EAAE;QACjB,MAAM,EAAE,mBAAmB;KAC9B;IACD,mBAAmB,EAAE;QACjB,KAAK,EAAE,SAAS;KACnB;IACD,aAAa,EAAE;QACX,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,MAAM;QACb,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,EAAE;KACjB;IACD,GAAG;IACH,SAAS,EAAE;QACP,GAAG,GAAG;QACN,eAAe,EAAE,SAAS;KAC7B;CACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@mui/material": "^5.8.3",
|
|
17
17
|
"@mui/styles": "^5.8.3",
|
|
18
|
-
"@prosopo/
|
|
18
|
+
"@prosopo/i18n": "0.0.1",
|
|
19
|
+
"@prosopo/procaptcha": "^0.1.9",
|
|
19
20
|
"react": "^17.0.0",
|
|
20
21
|
"react-dom": "^17.0.0"
|
|
21
22
|
},
|
|
@@ -29,12 +30,12 @@
|
|
|
29
30
|
},
|
|
30
31
|
"repository": {
|
|
31
32
|
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/prosopo
|
|
33
|
+
"url": "git+https://github.com/prosopo/procaptcha-react.git"
|
|
33
34
|
},
|
|
34
35
|
"bugs": {
|
|
35
|
-
"url": "https://github.com/prosopo
|
|
36
|
+
"url": "https://github.com/prosopo/procaptcha-react/issues"
|
|
36
37
|
},
|
|
37
|
-
"homepage": "https://github.com/prosopo
|
|
38
|
+
"homepage": "https://github.com/prosopo/procaptcha-react#readme",
|
|
38
39
|
"description": "",
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"registry": "https://registry.npmjs.org"
|