@prosopo/procaptcha-frictionless 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 +8 -8
- package/dist/ProcaptchaFrictionless.d.ts +0 -3
- package/dist/ProcaptchaFrictionless.d.ts.map +0 -1
- package/dist/ProcaptchaFrictionless.js +0 -33
- package/dist/ProcaptchaFrictionless.js.map +0 -1
- package/dist/cjs/ProcaptchaFrictionless.cjs +0 -44
- package/dist/cjs/index.cjs +0 -4
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-frictionless",
|
|
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,16 +26,16 @@
|
|
|
26
26
|
},
|
|
27
27
|
"browserslist": ["> 0.5%, last 2 versions, not dead"],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@prosopo/detector": "2.1.
|
|
30
|
-
"@prosopo/locale-browser": "2.1.
|
|
31
|
-
"@prosopo/procaptcha-pow": "2.1.
|
|
32
|
-
"@prosopo/procaptcha-react": "2.1.
|
|
33
|
-
"@prosopo/types": "2.1.
|
|
34
|
-
"@prosopo/web-components": "2.1.
|
|
29
|
+
"@prosopo/detector": "2.1.2",
|
|
30
|
+
"@prosopo/locale-browser": "2.1.2",
|
|
31
|
+
"@prosopo/procaptcha-pow": "2.1.2",
|
|
32
|
+
"@prosopo/procaptcha-react": "2.1.2",
|
|
33
|
+
"@prosopo/types": "2.1.2",
|
|
34
|
+
"@prosopo/web-components": "2.1.2",
|
|
35
35
|
"react": "18.3.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@prosopo/config": "2.1.
|
|
38
|
+
"@prosopo/config": "2.1.2",
|
|
39
39
|
"@vitest/coverage-v8": "2.1.1",
|
|
40
40
|
"concurrently": "9.0.1",
|
|
41
41
|
"npm-run-all": "4.1.5",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ProcaptchaFrictionlessProps } from "@prosopo/types";
|
|
2
|
-
export declare const ProcaptchaFrictionless: ({ config, callbacks, detectBot, }: ProcaptchaFrictionlessProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=ProcaptchaFrictionless.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProcaptchaFrictionless.d.ts","sourceRoot":"","sources":["../src/ProcaptchaFrictionless.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAEX,2BAA2B,EAC3B,MAAM,gBAAgB,CAAC;AAWxB,eAAO,MAAM,sBAAsB,sCAIhC,2BAA2B,4CA2B7B,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { isBot } from "@prosopo/detector";
|
|
3
|
-
import { i18n } from "@prosopo/locale-browser";
|
|
4
|
-
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
5
|
-
import { Procaptcha } from "@prosopo/procaptcha-react";
|
|
6
|
-
import { ProcaptchaPlaceholder } from "@prosopo/web-components";
|
|
7
|
-
import { useEffect, useState } from "react";
|
|
8
|
-
const customDetectBot = async () => {
|
|
9
|
-
return await isBot().then((result) => {
|
|
10
|
-
const bot = result.isBot;
|
|
11
|
-
return { bot };
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
export const ProcaptchaFrictionless = ({ config, callbacks, detectBot = customDetectBot, }) => {
|
|
15
|
-
const [componentToRender, setComponentToRender] = useState(_jsx(ProcaptchaPlaceholder, { config: config, callbacks: callbacks }));
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const detectAndSetComponent = async () => {
|
|
18
|
-
const result = await detectBot();
|
|
19
|
-
if (result.bot) {
|
|
20
|
-
setComponentToRender(_jsx(Procaptcha, { config: config, callbacks: callbacks }));
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
setComponentToRender(_jsx(ProcaptchaPow, { config: config, callbacks: callbacks }));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
detectAndSetComponent();
|
|
27
|
-
if (config.language) {
|
|
28
|
-
i18n.changeLanguage(config.language);
|
|
29
|
-
}
|
|
30
|
-
}, [config, callbacks, detectBot, config.language]);
|
|
31
|
-
return componentToRender;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=ProcaptchaFrictionless.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProcaptchaFrictionless.js","sourceRoot":"","sources":["../src/ProcaptchaFrictionless.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAc1C,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,eAAe,GAAyB,KAAK,IAAI,EAAE;IACxD,OAAO,MAAM,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QACzB,OAAO,EAAE,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACtC,MAAM,EACN,SAAS,EACT,SAAS,GAAG,eAAe,GACE,EAAE,EAAE;IACjC,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CACzD,KAAC,qBAAqB,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CAC/D,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;YACxC,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;YACjC,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;gBAChB,oBAAoB,CACnB,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CACpD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACP,oBAAoB,CACnB,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,CACvD,CAAC;YACH,CAAC;QACF,CAAC,CAAC;QAEF,qBAAqB,EAAE,CAAC;QAExB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;IACF,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEpD,OAAO,iBAAiB,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const detector = require("@prosopo/detector");
|
|
5
|
-
const localeBrowser = require("@prosopo/locale-browser");
|
|
6
|
-
const procaptchaPow = require("@prosopo/procaptcha-pow");
|
|
7
|
-
const procaptchaReact = require("@prosopo/procaptcha-react");
|
|
8
|
-
const webComponents = require("@prosopo/web-components");
|
|
9
|
-
const react = require("react");
|
|
10
|
-
const customDetectBot = async () => {
|
|
11
|
-
return await detector.isBot().then((result) => {
|
|
12
|
-
const bot = result.isBot;
|
|
13
|
-
return { bot };
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
const ProcaptchaFrictionless = ({
|
|
17
|
-
config,
|
|
18
|
-
callbacks,
|
|
19
|
-
detectBot = customDetectBot
|
|
20
|
-
}) => {
|
|
21
|
-
const [componentToRender, setComponentToRender] = react.useState(
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsx(webComponents.ProcaptchaPlaceholder, { config, callbacks })
|
|
23
|
-
);
|
|
24
|
-
react.useEffect(() => {
|
|
25
|
-
const detectAndSetComponent = async () => {
|
|
26
|
-
const result = await detectBot();
|
|
27
|
-
if (result.bot) {
|
|
28
|
-
setComponentToRender(
|
|
29
|
-
/* @__PURE__ */ jsxRuntime.jsx(procaptchaReact.Procaptcha, { config, callbacks })
|
|
30
|
-
);
|
|
31
|
-
} else {
|
|
32
|
-
setComponentToRender(
|
|
33
|
-
/* @__PURE__ */ jsxRuntime.jsx(procaptchaPow.ProcaptchaPow, { config, callbacks })
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
detectAndSetComponent();
|
|
38
|
-
if (config.language) {
|
|
39
|
-
localeBrowser.i18n.changeLanguage(config.language);
|
|
40
|
-
}
|
|
41
|
-
}, [config, callbacks, detectBot, config.language]);
|
|
42
|
-
return componentToRender;
|
|
43
|
-
};
|
|
44
|
-
exports.ProcaptchaFrictionless = ProcaptchaFrictionless;
|
package/dist/cjs/index.cjs
DELETED
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,6BAA6B,CAAC"}
|