@prosopo/procaptcha-bundle 2.1.14 → 2.1.16
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/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js +25 -6
- package/.rollup.cache/home/runner/work/captcha-private/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/renderLogic.js.map +1 -1
- package/dist/bundle/{Checkbox-CBVVEy1p.js → Checkbox-Dg1RwCua.js} +66 -66
- package/dist/bundle/{ProcaptchaWidget-mCNcGAt1.js → ProcaptchaWidget-BlgHuBfn.js} +2 -2
- package/dist/bundle/{ProcaptchaWidget-BY7XImzl.js → ProcaptchaWidget-DGAVVetC.js} +2 -2
- package/dist/bundle/{index-2JU-iJPL.js → index-CgI2y2A6.js} +10338 -10195
- package/dist/bundle/procaptcha.bundle.js +1 -1
- package/dist/bundle/util/renderLogic.d.ts.map +1 -1
- package/dist/util/renderLogic.d.ts.map +1 -1
- package/dist/util/renderLogic.js +25 -6
- package/dist/util/renderLogic.js.map +1 -1
- package/package.json +9 -9
- package/stats.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderLogic.d.ts","sourceRoot":"","sources":["../../../src/util/renderLogic.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderLogic.d.ts","sourceRoot":"","sources":["../../../src/util/renderLogic.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,4BAA4B,EAE5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,kBAAkB,CAAC;AA4BzD,eAAO,MAAM,WAAW,aACb,OAAO,EAAE,UACX,4BAA4B,gCAqDpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderLogic.d.ts","sourceRoot":"","sources":["../../src/util/renderLogic.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderLogic.d.ts","sourceRoot":"","sources":["../../src/util/renderLogic.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,4BAA4B,EAC5B,uBAAuB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,kBAAkB,CAAC;AA4BzD,eAAO,MAAM,WAAW,aACb,OAAO,EAAE,UACX,4BAA4B,kBACpB,uBAAuB,WAoDvC,CAAC"}
|
package/dist/util/renderLogic.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import createCache from "@emotion/cache";
|
|
3
|
+
import { CacheProvider } from "@emotion/react";
|
|
2
4
|
import { ProcaptchaFrictionless } from "@prosopo/procaptcha-frictionless";
|
|
3
5
|
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
4
6
|
import { Procaptcha } from "@prosopo/procaptcha-react";
|
|
@@ -8,30 +10,47 @@ import { setLanguage } from "./language.js";
|
|
|
8
10
|
import { setTheme } from "./theme.js";
|
|
9
11
|
import { setValidChallengeLength } from "./timeout.js";
|
|
10
12
|
const identifierPrefix = "procaptcha-";
|
|
13
|
+
function makeShadowRoot(element, renderOptions) {
|
|
14
|
+
const customCss = "";
|
|
15
|
+
const wrapperElement = document.createElement("prosopo-procaptcha");
|
|
16
|
+
const wrapperShadow = wrapperElement.attachShadow({ mode: "open" });
|
|
17
|
+
wrapperShadow.innerHTML +=
|
|
18
|
+
'<style>:host{all:initial!important;}:host *{font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}</style>';
|
|
19
|
+
wrapperShadow.innerHTML +=
|
|
20
|
+
"" !== customCss ? `<style>${customCss}</style>` : "";
|
|
21
|
+
element.appendChild(wrapperElement);
|
|
22
|
+
return wrapperShadow;
|
|
23
|
+
}
|
|
11
24
|
export const renderLogic = (elements, config, renderOptions) => {
|
|
12
25
|
const roots = [];
|
|
13
26
|
for (const element of elements) {
|
|
14
27
|
const callbacks = getDefaultCallbacks(element);
|
|
28
|
+
const shadowRoot = makeShadowRoot(element, renderOptions);
|
|
15
29
|
setUserCallbacks(renderOptions, callbacks, element);
|
|
16
30
|
setTheme(renderOptions, element, config);
|
|
17
31
|
setValidChallengeLength(renderOptions, element, config);
|
|
18
32
|
setLanguage(renderOptions, element, config);
|
|
33
|
+
const emotionCache = createCache({
|
|
34
|
+
key: "procaptcha",
|
|
35
|
+
prepend: true,
|
|
36
|
+
container: shadowRoot,
|
|
37
|
+
});
|
|
19
38
|
let root = null;
|
|
20
39
|
switch (renderOptions?.captchaType) {
|
|
21
40
|
case "pow":
|
|
22
41
|
console.log("rendering pow");
|
|
23
|
-
root = createRoot(
|
|
24
|
-
root.render(_jsx(ProcaptchaPow, { config: config, callbacks: callbacks }));
|
|
42
|
+
root = createRoot(shadowRoot, { identifierPrefix });
|
|
43
|
+
root.render(_jsx(CacheProvider, { value: emotionCache, children: _jsx(ProcaptchaPow, { config: config, callbacks: callbacks }) }));
|
|
25
44
|
break;
|
|
26
45
|
case "image":
|
|
27
46
|
console.log("rendering image");
|
|
28
|
-
root = createRoot(
|
|
29
|
-
root.render(_jsx(Procaptcha, { config: config, callbacks: callbacks }));
|
|
47
|
+
root = createRoot(shadowRoot, { identifierPrefix });
|
|
48
|
+
root.render(_jsx(CacheProvider, { value: emotionCache, children: _jsx(Procaptcha, { config: config, callbacks: callbacks }) }));
|
|
30
49
|
break;
|
|
31
50
|
default:
|
|
32
51
|
console.log("rendering frictionless");
|
|
33
|
-
root = createRoot(
|
|
34
|
-
root.render(_jsx(ProcaptchaFrictionless, { config: config, callbacks: callbacks }));
|
|
52
|
+
root = createRoot(shadowRoot, { identifierPrefix });
|
|
53
|
+
root.render(_jsx(CacheProvider, { value: emotionCache, children: _jsx(ProcaptchaFrictionless, { config: config, callbacks: callbacks }) }));
|
|
35
54
|
break;
|
|
36
55
|
}
|
|
37
56
|
roots.push(root);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderLogic.js","sourceRoot":"","sources":["../../src/util/renderLogic.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"renderLogic.js","sourceRoot":"","sources":["../../src/util/renderLogic.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAc/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKvD,OAAO,EAAa,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,SAAS,cAAc,CACtB,OAAgB,EAChB,aAAuC;IAGvC,MAAM,SAAS,GAAG,EAAE,CAAC;IAErB,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAEpE,MAAM,aAAa,GAAG,cAAc,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpE,aAAa,CAAC,SAAS;QACtB,uLAAuL,CAAC;IACzL,aAAa,CAAC,SAAS;QACtB,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,SAAS,UA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iBAAiB,CAAC,CAAC;gBAC/B,IAAI,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBACpD,IAAI,CAAC,MAAM,CACV,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YACjC,KAAC,UAAU,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,GACrC,CAChB,CAAC;gBACF,MAAM;YACP;gBACC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;gBACtC,IAAI,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBACpD,IAAI,CAAC,MAAM,CACV,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YACjC,KAAC,sBAAsB,IAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAI,GACjD,CAChB,CAAC;gBACF,MAAM;QACR,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-bundle",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.16",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"browserslist": ["> 0.5%, last 2 versions, not dead"],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@prosopo/dotenv": "2.1.
|
|
33
|
-
"@prosopo/locale": "2.1.
|
|
34
|
-
"@prosopo/procaptcha-frictionless": "2.1.
|
|
35
|
-
"@prosopo/procaptcha-pow": "2.1.
|
|
36
|
-
"@prosopo/procaptcha-react": "2.1.
|
|
37
|
-
"@prosopo/types": "2.1.
|
|
38
|
-
"@prosopo/util": "2.1.
|
|
32
|
+
"@prosopo/dotenv": "2.1.16",
|
|
33
|
+
"@prosopo/locale": "2.1.16",
|
|
34
|
+
"@prosopo/procaptcha-frictionless": "2.1.16",
|
|
35
|
+
"@prosopo/procaptcha-pow": "2.1.16",
|
|
36
|
+
"@prosopo/procaptcha-react": "2.1.16",
|
|
37
|
+
"@prosopo/types": "2.1.16",
|
|
38
|
+
"@prosopo/util": "2.1.16",
|
|
39
39
|
"express": "4.21.1",
|
|
40
40
|
"react": "18.3.1",
|
|
41
41
|
"react-dom": "18.3.1"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"registry": "https://registry.npmjs.org"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@prosopo/config": "2.1.
|
|
56
|
+
"@prosopo/config": "2.1.16",
|
|
57
57
|
"@types/jsdom": "21.1.7",
|
|
58
58
|
"@vitest/coverage-v8": "2.1.1",
|
|
59
59
|
"concurrently": "9.0.1",
|