@prosopo/procaptcha-bundle 3.0.13 → 3.1.6

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 (60) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +19 -9
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  4. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
  6. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
  16. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
  17. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
  18. package/CHANGELOG.md +347 -0
  19. package/dist/bundle/{ProcaptchaWidget-BIt2pcrz.js → ProcaptchaWidget-CJ-4hVS1.js} +24 -24
  20. package/dist/bundle/{ProcaptchaWidget-CXxnCzl2.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
  21. package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
  22. package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
  23. package/dist/bundle/{captchaRenderer-CqnUYyKY.js → captchaRenderer-s4QuLEen.js} +23 -22
  24. package/dist/bundle/{commonChunk-BKceWhtS.js → commonChunk-BjvuHlB1.js} +62 -68
  25. package/dist/bundle/{emotion-element-5486c51c.browser.esm-CimrRZxS.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
  26. package/dist/bundle/index-BuQg3Zno.js +1884 -0
  27. package/dist/bundle/{index-KHTbPva_.js → index-DIdd2cUz.js} +1 -1
  28. package/dist/bundle/{index-hrOz2CPm.js → index-IgqrmVIs.js} +61 -59
  29. package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
  30. package/dist/bundle/procaptcha.bundle.js +2 -2
  31. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  32. package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
  33. package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
  34. package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
  35. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  36. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
  37. package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
  38. package/dist/bundle/{utilCryptoChunk-BKe3CKqn.js → utilCryptoChunk-D6ZLkbFV.js} +252 -243
  39. package/dist/bundle/{web2Chunk-Cqw91v-J.js → web2Chunk-CNoojUDK.js} +1067 -977
  40. package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
  41. package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
  42. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
  43. package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
  44. package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
  45. package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
  46. package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
  47. package/dist/cjs/util/widgetFactory.cjs +7 -2
  48. package/dist/util/captcha/captchaComponentProvider.js +3 -2
  49. package/dist/util/captcha/captchaRenderer.js +4 -3
  50. package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
  51. package/dist/util/captcha/components/imageCaptcha.js +1 -1
  52. package/dist/util/captcha/components/powCaptcha.js +1 -1
  53. package/dist/util/widgetFactory.js +7 -2
  54. package/package.json +19 -20
  55. package/stats.html +1 -1
  56. package/vite.test.config.ts +3 -2
  57. package/dist/bundle/captchaComponentProvider-BGEAkC9Y.js +0 -968
  58. package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
  59. package/dist/bundle/nobleChunk-CQ4ENyKh.js +0 -3769
  60. package/dist/bundle/web3Chunk-BcwDKvjL.js +0 -517
@@ -2867,9 +2867,9 @@ var Lt = /* @__PURE__ */ Object.freeze({
2867
2867
  export {
2868
2868
  $e as a,
2869
2869
  mt as b,
2870
- Ae as c,
2871
- ct as d,
2872
- Pe as e,
2870
+ Pe as c,
2871
+ Ae as d,
2872
+ ct as e,
2873
2873
  Vt as f,
2874
2874
  Nt as g,
2875
2875
  Ct as l,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
3
+ const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const types = require("@prosopo/types");
5
5
  const captchaComponentsList = require("./captchaComponentsList.cjs");
6
6
  class CaptchaComponentProvider {
@@ -15,7 +15,8 @@ class CaptchaComponentProvider {
15
15
  {
16
16
  config: captchaProps.config,
17
17
  callbacks: captchaProps.callbacks,
18
- i18n: captchaProps.i18n
18
+ i18n: captchaProps.i18n,
19
+ container: captchaProps.container
19
20
  }
20
21
  );
21
22
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
3
+ const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const createCache = require("@emotion/cache");
5
5
  const react = require("@emotion/react");
6
6
  const client = require("react-dom/client");
@@ -11,7 +11,7 @@ class CaptchaRenderer {
11
11
  constructor(captchaComponentProvider) {
12
12
  this.captchaComponentProvider = captchaComponentProvider;
13
13
  }
14
- renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible = false) {
14
+ renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer) {
15
15
  const captchaType = renderOptions?.captchaType || settings.defaultCaptchaType;
16
16
  const config = configCreator.createConfig(
17
17
  renderOptions.siteKey,
@@ -35,7 +35,8 @@ class CaptchaRenderer {
35
35
  {
36
36
  config,
37
37
  i18n,
38
- callbacks
38
+ callbacks,
39
+ container: widgetContainer
39
40
  }
40
41
  );
41
42
  this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
3
+ const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const procaptchaCommon = require("@prosopo/procaptcha-common");
5
5
  const procaptchaFrictionless = require("@prosopo/procaptcha-frictionless");
6
6
  const react = require("react");
7
7
  const FrictionlessCaptcha = (props) => {
8
- const { config, callbacks, i18n } = props;
8
+ const { config, callbacks, i18n, container } = props;
9
9
  const [componentKey, setComponentKey] = react.useState(0);
10
10
  const restart = () => {
11
11
  setComponentKey((prevKey) => prevKey + 1);
@@ -16,7 +16,8 @@ const FrictionlessCaptcha = (props) => {
16
16
  config,
17
17
  callbacks: procaptchaCommon.getDefaultEvents(callbacks),
18
18
  restart,
19
- i18n
19
+ i18n,
20
+ container
20
21
  },
21
22
  componentKey
22
23
  );
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
3
+ const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const procaptchaCommon = require("@prosopo/procaptcha-common");
5
5
  const procaptchaReact = require("@prosopo/procaptcha-react");
6
6
  const ImageCaptcha = (props) => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
3
+ const jsxRuntime = require("@emotion/react/jsx-runtime");
4
4
  const procaptchaCommon = require("@prosopo/procaptcha-common");
5
5
  const procaptchaPow = require("@prosopo/procaptcha-pow");
6
6
  const PowCaptcha = (props) => {
@@ -38,16 +38,20 @@ class WidgetFactory {
38
38
  );
39
39
  const widgetTheme = "light" === renderOptions.theme ? widgetSkeleton.lightTheme : widgetSkeleton.darkTheme;
40
40
  let widgetInteractiveArea;
41
+ let widgetContainer;
41
42
  if (invisible) {
42
43
  const newDiv = document.createElement("div");
43
44
  container.appendChild(newDiv);
44
45
  widgetInteractiveArea = newDiv;
46
+ widgetContainer = newDiv;
45
47
  } else {
46
- widgetInteractiveArea = widgetSkeleton.createWidgetSkeleton(
48
+ const widgetResult = widgetSkeleton.createWidgetSkeleton(
47
49
  container,
48
50
  widgetTheme,
49
51
  "prosopo-procaptcha"
50
52
  );
53
+ widgetInteractiveArea = widgetResult.widgetInteractiveArea;
54
+ widgetContainer = widgetResult.webComponent;
51
55
  }
52
56
  const captchaRenderer = await this.getCaptchaRenderer();
53
57
  const captchaRoot = captchaRenderer.renderCaptcha(
@@ -62,7 +66,8 @@ class WidgetFactory {
62
66
  callbacks,
63
67
  isWeb2,
64
68
  this.i18n,
65
- invisible
69
+ invisible,
70
+ widgetContainer
66
71
  );
67
72
  return captchaRoot;
68
73
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { CaptchaType } from "@prosopo/types";
3
3
  import { captchaComponentsList } from "./captchaComponentsList.js";
4
4
  class CaptchaComponentProvider {
@@ -13,7 +13,8 @@ class CaptchaComponentProvider {
13
13
  {
14
14
  config: captchaProps.config,
15
15
  callbacks: captchaProps.callbacks,
16
- i18n: captchaProps.i18n
16
+ i18n: captchaProps.i18n,
17
+ container: captchaProps.container
17
18
  }
18
19
  );
19
20
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import createCache from "@emotion/cache";
3
3
  import { CacheProvider } from "@emotion/react";
4
4
  import { createRoot } from "react-dom/client";
@@ -9,7 +9,7 @@ class CaptchaRenderer {
9
9
  constructor(captchaComponentProvider) {
10
10
  this.captchaComponentProvider = captchaComponentProvider;
11
11
  }
12
- renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible = false) {
12
+ renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer) {
13
13
  const captchaType = renderOptions?.captchaType || settings.defaultCaptchaType;
14
14
  const config = createConfig(
15
15
  renderOptions.siteKey,
@@ -33,7 +33,8 @@ class CaptchaRenderer {
33
33
  {
34
34
  config,
35
35
  i18n,
36
- callbacks
36
+ callbacks,
37
+ container: widgetContainer
37
38
  }
38
39
  );
39
40
  this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
@@ -1,9 +1,9 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
3
  import { ProcaptchaFrictionless } from "@prosopo/procaptcha-frictionless";
4
4
  import { useState } from "react";
5
5
  const FrictionlessCaptcha = (props) => {
6
- const { config, callbacks, i18n } = props;
6
+ const { config, callbacks, i18n, container } = props;
7
7
  const [componentKey, setComponentKey] = useState(0);
8
8
  const restart = () => {
9
9
  setComponentKey((prevKey) => prevKey + 1);
@@ -14,7 +14,8 @@ const FrictionlessCaptcha = (props) => {
14
14
  config,
15
15
  callbacks: getDefaultEvents(callbacks),
16
16
  restart,
17
- i18n
17
+ i18n,
18
+ container
18
19
  },
19
20
  componentKey
20
21
  );
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
3
  import { Procaptcha } from "@prosopo/procaptcha-react";
4
4
  const ImageCaptcha = (props) => {
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
2
  import { getDefaultEvents } from "@prosopo/procaptcha-common";
3
3
  import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
4
4
  const PowCaptcha = (props) => {
@@ -36,16 +36,20 @@ class WidgetFactory {
36
36
  );
37
37
  const widgetTheme = "light" === renderOptions.theme ? lightTheme : darkTheme;
38
38
  let widgetInteractiveArea;
39
+ let widgetContainer;
39
40
  if (invisible) {
40
41
  const newDiv = document.createElement("div");
41
42
  container.appendChild(newDiv);
42
43
  widgetInteractiveArea = newDiv;
44
+ widgetContainer = newDiv;
43
45
  } else {
44
- widgetInteractiveArea = createWidgetSkeleton(
46
+ const widgetResult = createWidgetSkeleton(
45
47
  container,
46
48
  widgetTheme,
47
49
  "prosopo-procaptcha"
48
50
  );
51
+ widgetInteractiveArea = widgetResult.widgetInteractiveArea;
52
+ widgetContainer = widgetResult.webComponent;
49
53
  }
50
54
  const captchaRenderer = await this.getCaptchaRenderer();
51
55
  const captchaRoot = captchaRenderer.renderCaptcha(
@@ -60,7 +64,8 @@ class WidgetFactory {
60
64
  callbacks,
61
65
  isWeb2,
62
66
  this.i18n,
63
- invisible
67
+ invisible,
68
+ widgetContainer
64
69
  );
65
70
  return captchaRoot;
66
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-bundle",
3
- "version": "3.0.13",
3
+ "version": "3.1.6",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "build": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
29
29
  "build:tsc": "tsc --build --verbose",
30
30
  "build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
31
- "typecheck": "tsc --build --declaration --emitDeclarationOnly",
31
+ "typecheck": "tsc --project tsconfig.types.json",
32
32
  "bundle": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.config.ts --mode $NODE_ENV",
33
33
  "start": "NODE_ENV=${NODE_ENV:-development}; vite serve --mode $NODE_ENV --host",
34
34
  "bundle:webpack": "NODE_ENV=${NODE_ENV:-development}; MODE=${MODE:-$NODE_ENV}; webpack build --config webpack.config.cjs --mode $MODE",
@@ -37,25 +37,23 @@
37
37
  },
38
38
  "browserslist": ["> 0.5%, last 2 versions, not dead"],
39
39
  "dependencies": {
40
- "@prosopo/common": "3.1.2",
41
- "@prosopo/dotenv": "3.0.7",
42
- "@prosopo/locale": "3.1.2",
43
- "@prosopo/procaptcha-frictionless": "2.6.32",
44
- "@prosopo/procaptcha-pow": "2.7.18",
45
- "@prosopo/procaptcha-react": "2.6.32",
46
- "@prosopo/types": "3.0.6",
47
- "@prosopo/util": "3.0.5",
48
- "@prosopo/util-crypto": "13.5.4",
49
- "@prosopo/widget-skeleton": "2.6.3",
50
- "@typegoose/auto-increment": "4.13.0",
51
- "axios": "1.10.0",
52
- "esbuild": "0.25.6",
53
- "express": "4.21.2",
54
- "openpgp": "5.11.3",
40
+ "@prosopo/dotenv": "3.0.25",
41
+ "@prosopo/locale": "3.1.20",
42
+ "@prosopo/procaptcha-common": "2.9.5",
43
+ "@prosopo/procaptcha-frictionless": "2.8.6",
44
+ "@prosopo/procaptcha-pow": "2.8.13",
45
+ "@prosopo/procaptcha-react": "2.9.5",
46
+ "@prosopo/types": "3.5.3",
47
+ "@prosopo/util": "3.1.5",
48
+ "@prosopo/widget-skeleton": "2.7.6",
49
+ "@prosopo/config": "3.1.20",
50
+ "dotenv": "16.4.5",
51
+ "fast-glob": "3.3.2",
52
+ "jsdom": "25.0.0",
55
53
  "react": "18.3.1",
56
- "react-dom": "18.3.1",
57
- "@prosopo/config": "3.1.3",
58
- "webpack-dev-server": "5.2.2"
54
+ "@emotion/cache": "11.11.0",
55
+ "@emotion/react": "11.11.1",
56
+ "react-dom": "18.3.1"
59
57
  },
60
58
  "repository": {
61
59
  "type": "git",
@@ -71,6 +69,7 @@
71
69
  },
72
70
  "devDependencies": {
73
71
  "@types/jsdom": "21.1.7",
72
+ "@types/node": "22.10.2",
74
73
  "@types/react": "18.3.1",
75
74
  "@types/react-dom": "18.3.1",
76
75
  "@vitest/coverage-v8": "3.0.9",