@prosopo/procaptcha-react 0.2.14 → 0.2.15
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.js +0 -14
- package/dist/components/CaptchaComponent.js.map +1 -1
- package/dist/components/CaptchaWidget.js +1 -32
- package/dist/components/CaptchaWidget.js.map +1 -1
- package/dist/components/ExtensionAccountSelect.js +0 -15
- package/dist/components/ExtensionAccountSelect.js.map +1 -1
- package/dist/components/Procaptcha.d.ts +0 -4
- package/dist/components/Procaptcha.d.ts.map +1 -1
- package/dist/components/Procaptcha.js +0 -23
- package/dist/components/Procaptcha.js.map +1 -1
- package/dist/components/index.js +0 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components/theme.js +0 -13
- package/dist/components/theme.js.map +1 -1
- package/dist/index.js +0 -13
- package/dist/index.js.map +1 -1
- package/dist/util/index.d.ts +0 -5
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +0 -18
- package/dist/util/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -92,13 +92,13 @@ The Procaptcha component is called as follows:
|
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
A config object is required and must contain your SITE_KEY. The callbacks are optional and can be used to handle the
|
|
95
|
-
various Procaptcha events. The following config demonstrates the `
|
|
95
|
+
various Procaptcha events. The following config demonstrates the `PROSOPO_SITE_KEY` variable being pulled from
|
|
96
96
|
environment variables.
|
|
97
97
|
|
|
98
98
|
```tsx
|
|
99
99
|
const config: ProcaptchaConfigOptional = {
|
|
100
100
|
account: {
|
|
101
|
-
address: process.env.
|
|
101
|
+
address: process.env.PROSOPO_SITE_KEY || undefined,
|
|
102
102
|
},
|
|
103
103
|
web2: 'true',
|
|
104
104
|
dappName: 'client-example',
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
2
|
import { Box, Button, Typography } from '@mui/material';
|
|
16
3
|
import { CaptchaWidget } from './CaptchaWidget.js';
|
|
17
4
|
import { at } from '@prosopo/util';
|
|
@@ -25,7 +12,6 @@ const CaptchaComponent = ({ challenge, index, solutions, onSubmit, onCancel, onC
|
|
|
25
12
|
const solution = solutions ? at(solutions, index) : [];
|
|
26
13
|
const theme = useMemo(() => (themeColor === 'light' ? lightTheme : darkTheme), [themeColor]);
|
|
27
14
|
return (_jsx(Box, { sx: {
|
|
28
|
-
// introduce scroll bars when screen < minWidth of children
|
|
29
15
|
overflowX: 'auto',
|
|
30
16
|
overflowY: 'auto',
|
|
31
17
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CaptchaComponent.js","sourceRoot":"","sources":["../../src/components/CaptchaComponent.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,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EAAE,eAAe;qBAClC,aAED,KAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,YACpC,CAAC,CAAC,eAAe,CAAC,GACd,EACT,KAAC,MAAM,IACH,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAClE,OAAO,EAAC,WAAW,KACf,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,CAAC,YAE9C,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GACzE,IACP,IACJ,GACJ,CACT,CAAA;AACL,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
2
|
import { Box, Fade, useTheme } from '@mui/material';
|
|
16
3
|
import { default as CheckIcon } from '@mui/icons-material/Check.js';
|
|
17
4
|
const normalizeIcon = (Icon) => {
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
19
5
|
return (Icon.default ? Icon.default : Icon);
|
|
20
6
|
};
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
22
|
-
// @ts-ignore https://github.com/mui/material-ui/issues/35535
|
|
23
7
|
const CheckIconNormalized = normalizeIcon(CheckIcon);
|
|
24
8
|
const getHash = (item) => {
|
|
25
9
|
if (!item.hash) {
|
|
@@ -32,21 +16,16 @@ export const CaptchaWidget = ({ challenge, solution, onClick }) => {
|
|
|
32
16
|
const theme = useTheme();
|
|
33
17
|
const isTouchDevice = 'ontouchstart' in window;
|
|
34
18
|
return (_jsx(Box, { component: "div", pr: 0.5, pb: 0.5, sx: {
|
|
35
|
-
// expand to full height / width of parent
|
|
36
19
|
width: '100%',
|
|
37
20
|
height: '100%',
|
|
38
|
-
// display children in flex, spreading them evenly and wrapping when row length exceeded
|
|
39
21
|
display: 'flex',
|
|
40
22
|
flexDirection: 'row',
|
|
41
23
|
flexWrap: 'wrap',
|
|
42
24
|
}, children: items.map((item, index) => {
|
|
43
25
|
const hash = getHash(item);
|
|
44
26
|
return (_jsx(Box, { pt: 0.5, pl: 0.5, sx: {
|
|
45
|
-
// enable the items in the grid to grow in width to use up excess space
|
|
46
27
|
flexGrow: 1,
|
|
47
|
-
// make the width of each item 1/3rd of the width overall, i.e. 3 columns
|
|
48
28
|
flexBasis: '33.3333%',
|
|
49
|
-
// include the padding / margin / border in the width
|
|
50
29
|
boxSizing: 'border-box',
|
|
51
30
|
}, children: _jsxs(Box, { sx: { cursor: 'pointer', height: '100%', width: '100%' }, onClick: isTouchDevice ? undefined : () => onClick(hash), onTouchStart: isTouchDevice ? () => onClick(hash) : undefined, children: [_jsx(Box, { sx: { border: 1, borderColor: theme.palette.grey[300] }, children: _jsx("img", { style: {
|
|
52
31
|
width: '100%',
|
|
@@ -54,38 +33,28 @@ export const CaptchaWidget = ({ challenge, solution, onClick }) => {
|
|
|
54
33
|
opacity: solution.includes(hash) && isTouchDevice ? '50%' : '100%',
|
|
55
34
|
display: 'block',
|
|
56
35
|
objectFit: 'contain',
|
|
57
|
-
aspectRatio: '1/1',
|
|
36
|
+
aspectRatio: '1/1',
|
|
58
37
|
}, src: item.data, alt: `Captcha image ${index + 1}` }) }), _jsx(Fade, { in: solution.includes(hash), children: _jsx(Box, { sx: {
|
|
59
|
-
// relative to where the element _should_ be positioned
|
|
60
38
|
position: 'relative',
|
|
61
|
-
// make the overlay the full height/width of an item
|
|
62
39
|
width: '100%',
|
|
63
40
|
height: '100%',
|
|
64
|
-
// shift it up 100% to overlay the item element
|
|
65
41
|
top: '-100%',
|
|
66
|
-
// transition on opacity upon (de)selection
|
|
67
42
|
transitionDuration: '300ms',
|
|
68
43
|
transitionProperty: 'opacity',
|
|
69
44
|
}, children: _jsx(Box, { sx: {
|
|
70
|
-
// make the overlay absolute positioned compare to its container
|
|
71
45
|
position: 'absolute',
|
|
72
|
-
// spread across 100% width/height of the item box
|
|
73
46
|
top: 0,
|
|
74
47
|
left: 0,
|
|
75
48
|
bottom: 0,
|
|
76
49
|
right: 0,
|
|
77
50
|
height: '100%',
|
|
78
51
|
width: '100%',
|
|
79
|
-
// display overlays in center
|
|
80
52
|
display: 'flex',
|
|
81
53
|
alignItems: 'center',
|
|
82
54
|
justifyContent: 'center',
|
|
83
|
-
// make bg half opacity, i.e. shadowing the item's img
|
|
84
55
|
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
85
56
|
}, children: _jsx(CheckIconNormalized, { htmlColor: theme.palette.background.default, sx: {
|
|
86
|
-
// img must be displayed as block otherwise get's a bottom whitespace border
|
|
87
57
|
display: 'block',
|
|
88
|
-
// how big the overlay icon is
|
|
89
58
|
width: '35%',
|
|
90
59
|
height: '35%',
|
|
91
60
|
} }) }) }) })] }) }, index));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaWidget.js","sourceRoot":"","sources":["../../src/components/CaptchaWidget.t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QAAQ,EAAE,UAAU;oCAEpB,KAAK,EAAE,MAAM;oCACb,MAAM,EAAE,MAAM;oCAEd,GAAG,EAAE,OAAO;oCAEZ,kBAAkB,EAAE,OAAO;oCAC3B,kBAAkB,EAAE,SAAS;iCAChC,YAED,KAAC,GAAG,IACA,EAAE,EAAE;wCAEA,QAAQ,EAAE,UAAU;wCAEpB,GAAG,EAAE,CAAC;wCACN,IAAI,EAAE,CAAC;wCACP,MAAM,EAAE,CAAC;wCACT,KAAK,EAAE,CAAC;wCACR,MAAM,EAAE,MAAM;wCACd,KAAK,EAAE,MAAM;wCAEb,OAAO,EAAE,MAAM;wCACf,UAAU,EAAE,QAAQ;wCACpB,cAAc,EAAE,QAAQ;wCAExB,eAAe,EAAE,iBAAiB;qCACrC,YAED,KAAC,mBAAmB,IAChB,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAC3C,EAAE,EAAE;4CAEA,OAAO,EAAE,OAAO;4CAEhB,KAAK,EAAE,KAAK;4CACZ,MAAM,EAAE,KAAK;yCAChB,GACH,GACA,GACJ,GACH,IACL,IApED,KAAK,CAqER,CACT,CAAA;QACL,CAAC,CAAC,GACA,CACT,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
2
|
import { Autocomplete, TextField } from '@mui/material';
|
|
16
3
|
import { useEffect, useState } from 'react';
|
|
17
4
|
import { useTranslation } from '@prosopo/common';
|
|
18
5
|
import { web3AccountsSubscribe, web3Enable } from '@polkadot/extension-dapp';
|
|
19
|
-
// import Autocomplete from '@mui/material/Autocomplete/Autocomplete.js'
|
|
20
|
-
// import TextField from '@mui/material/TextField/TextField.js'
|
|
21
6
|
export const ExtensionAccountSelect = ({ value, dappName, onChange, }) => {
|
|
22
7
|
const { t } = useTranslation();
|
|
23
8
|
const [accounts, setAccounts] = useState([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionAccountSelect.js","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ExtensionAccountSelect.js","sourceRoot":"","sources":["../../src/components/ExtensionAccountSelect.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEvD,OAAO,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAI5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACnC,KAAK,EACL,QAAQ,EACR,QAAQ,GAKX,EAAE,EAAE;IACD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAA4B,EAAE,CAAC,CAAA;IAEvE,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACxC,OAAO,qBAAqB,CAAC,WAAW,CAAC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
|
|
1
|
-
/** @jsxImportSource @emotion/react */
|
|
2
1
|
import { ProcaptchaCallbacks, ProcaptchaConfigOptional } from '@prosopo/procaptcha';
|
|
3
|
-
/**
|
|
4
|
-
* The props for the Procaptcha component.
|
|
5
|
-
*/
|
|
6
2
|
export interface ProcaptchaProps {
|
|
7
3
|
config: ProcaptchaConfigOptional;
|
|
8
4
|
callbacks?: Partial<ProcaptchaCallbacks>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Procaptcha.d.ts","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":"AAcA,OAAO,EAIH,mBAAmB,EACnB,wBAAwB,EAK3B,MAAM,qBAAqB,CAAA;AA0C5B,MAAM,WAAW,eAAe;IAE5B,MAAM,EAAE,wBAAwB,CAAA;IAEhC,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAC3C;AAwED,eAAO,MAAM,UAAU,UAAW,eAAe,qDA0IhD,CAAA"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
/** @jsxImportSource @emotion/react */
|
|
16
2
|
import { Manager, } from '@prosopo/procaptcha';
|
|
17
3
|
import { Alert, Backdrop, Box, Checkbox, CircularProgress, Link, ThemeProvider, Typography } from '@mui/material';
|
|
18
4
|
import { css } from '@emotion/react';
|
|
@@ -50,11 +36,6 @@ const logoStyle = css `
|
|
|
50
36
|
} /* logoWithoutText */
|
|
51
37
|
}
|
|
52
38
|
`;
|
|
53
|
-
/**
|
|
54
|
-
* Wrap a ref to be the same format as useState.
|
|
55
|
-
* @param defaultValue the default value if the state is not already initialised
|
|
56
|
-
* @returns a ref in the same format as a state, e.g. [value, setValue]
|
|
57
|
-
*/
|
|
58
39
|
const useRefAsState = (defaultValue) => {
|
|
59
40
|
const ref = useRef(defaultValue);
|
|
60
41
|
const setter = (value) => {
|
|
@@ -78,7 +59,6 @@ const useProcaptcha = () => {
|
|
|
78
59
|
const [blockNumber, setBlockNumber] = useRefAsState(undefined);
|
|
79
60
|
const [successfullChallengeTimeout, setSuccessfullChallengeTimeout] = useRefAsState(undefined);
|
|
80
61
|
return [
|
|
81
|
-
// the state
|
|
82
62
|
{
|
|
83
63
|
isHuman,
|
|
84
64
|
index,
|
|
@@ -94,7 +74,6 @@ const useProcaptcha = () => {
|
|
|
94
74
|
blockNumber,
|
|
95
75
|
successfullChallengeTimeout,
|
|
96
76
|
},
|
|
97
|
-
// and method to update the state
|
|
98
77
|
(nextState) => {
|
|
99
78
|
if (nextState.account !== undefined)
|
|
100
79
|
setAccount(nextState.account);
|
|
@@ -102,8 +81,6 @@ const useProcaptcha = () => {
|
|
|
102
81
|
setIsHuman(nextState.isHuman);
|
|
103
82
|
if (nextState.index !== undefined)
|
|
104
83
|
setIndex(nextState.index);
|
|
105
|
-
// force a copy of the array to ensure a re-render
|
|
106
|
-
// nutshell: react doesn't look inside an array for changes, hence changes to the array need to result in a fresh array
|
|
107
84
|
if (nextState.solutions !== undefined)
|
|
108
85
|
setSolutions(nextState.solutions.slice());
|
|
109
86
|
if (nextState.captchaApi !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Procaptcha.js","sourceRoot":"","sources":["../../src/components/Procaptcha.tsx"],"names":[],"mappings":";AAcA,OAAO,EAGH,OAAO,GAOV,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACjH,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AAEpD,MAAM,SAAS,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,CAAA;AAiBD,MAAM,aAAa,GAAG,CAAK,YAAe,EAA2B,EAAE;IACnE,MAAM,GAAG,GAAG,MAAM,CAAI,YAAY,CAAC,CAAA;IACnC,MAAM,MAAM,GAAG,CAAC,KAAQ,EAAE,EAAE;QACxB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;IACvB,CAAC,CAAA;IACD,MAAM,KAAK,GAAM,GAAG,CAAC,OAAO,CAAA;IAC5B,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,aAAa,GAAG,GAA+C,EAAE;IACnE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CA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AAK,KAAK,OAAO;gEAC1B,CAAC,CAAC,oBAAoB;gEACtB,CAAC,CAAC,oBAAoB;yDACjC,GACH,EACF,cACI,GAAG,EAAE,SAAS,EACd,uBAAuB,EAAE;4DACrB,MAAM,EACF,KAAK,CAAC,MAAM,CAAC,KAAK,KAAK,OAAO;gEAC1B,CAAC,CAAC,iBAAiB;gEACnB,CAAC,CAAC,iBAAiB;yDAC9B,GACH,IACA,GACJ,GACH,GACL,IACJ,IACJ,IACJ,GACM,CACnB,CAAA;AACL,CAAC,CAAA;AAED,MAAM,iBAAiB,GACnB,olHAAolH,CAAA;AAExlH,MAAM,iBAAiB,GACnB,ilHAAilH,CAAA;AAErlH,MAAM,oBAAoB,GACtB,+uCAA+uC,CAAA;AAEnvC,MAAM,oBAAoB,GACtB,2vCAA2vC,CAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
1
|
export * from './CaptchaWidget.js';
|
|
15
2
|
export * from './CaptchaComponent.js';
|
|
16
3
|
export { default as ExtensionAccountSelect } from './ExtensionAccountSelect.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC/E,cAAc,iBAAiB,CAAA"}
|
package/dist/components/theme.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
1
|
import { createTheme } from '@mui/material';
|
|
15
2
|
export const lightTheme = createTheme({
|
|
16
3
|
palette: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/components/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/components/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;IAClC,OAAO,EAAE;QACL,IAAI,EAAE,OAAO;QACb,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,MAAM;SACvB;QACD,UAAU,EAAE;YACR,OAAO,EAAE,MAAM;SAClB;KACJ;CACJ,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACjC,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,MAAM;SACvB;QACD,UAAU,EAAE;YACR,OAAO,EAAE,SAAS;SACrB;KACJ;CACJ,CAAC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
1
|
export * from './components/index.js';
|
|
15
2
|
export * from './util/index.js';
|
|
16
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA"}
|
package/dist/util/index.d.ts
CHANGED
package/dist/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,OAAO,EACP,GAAG,GACN,EAAE;IACC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACnC,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAClC,MAKA"}
|
package/dist/util/index.js
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
1
|
function renameKeysForDataAttr(data = {}) {
|
|
15
2
|
return Object.keys(data).reduce((prev, curr) => ({ ...prev, [`data-${curr}`]: data[curr] }), {});
|
|
16
3
|
}
|
|
17
|
-
/**
|
|
18
|
-
* maps any data to data attributes (mapped to { data-[key]: value })
|
|
19
|
-
*
|
|
20
|
-
* dev - only in development mode
|
|
21
|
-
*/
|
|
22
4
|
export default function addDataAttr({ general, dev, }) {
|
|
23
5
|
return {
|
|
24
6
|
...renameKeysForDataAttr(general),
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAaA,SAAS,qBAAqB,CAAC,OAAkC,EAAE;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AACpG,CAAC;AAOD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAChC,OAAO,EACP,GAAG,GAIN;IACG,OAAO;QACH,GAAG,qBAAqB,CAAC,OAAO,CAAC;QACjC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAChF,CAAA;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@polkadot/extension-dapp": "0.46.5",
|
|
37
37
|
"@polkadot/extension-inject": "0.46.5",
|
|
38
38
|
"@polkadot/types": "10.10.1",
|
|
39
|
-
"@prosopo/common": "0.2.
|
|
40
|
-
"@prosopo/procaptcha": "0.2.
|
|
39
|
+
"@prosopo/common": "0.2.15",
|
|
40
|
+
"@prosopo/procaptcha": "0.2.15",
|
|
41
41
|
"i18next": "^21.9.2",
|
|
42
42
|
"react": "^18.2.0",
|
|
43
43
|
"react-dom": "^18.2.0",
|