@prosopo/procaptcha-bundle 3.3.0 → 4.1.7

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 (93) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +28 -35
  2. package/.turbo/turbo-build$colon$tsc.log +33 -36
  3. package/.turbo/turbo-build.log +29 -36
  4. package/CHANGELOG.md +481 -0
  5. package/dist/cjs/index.cjs +4 -9
  6. package/dist/cjs/util/captcha/captchaRenderer.cjs +10 -9
  7. package/dist/cjs/util/captcha/components/{frictionlessCaptcha.cjs → bundleCaptcha.cjs} +2 -2
  8. package/dist/cjs/util/config.cjs +14 -4
  9. package/dist/cjs/util/widgetFactory.cjs +4 -6
  10. package/dist/components.d.ts +1 -4
  11. package/dist/components.d.ts.map +1 -1
  12. package/dist/components.js +1 -4
  13. package/dist/components.js.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4 -9
  16. package/dist/index.js.map +1 -1
  17. package/dist/tests/util/config.test.js +6 -6
  18. package/dist/tests/util/config.test.js.map +1 -1
  19. package/dist/tests/util/renderLogic.test.js +22 -14
  20. package/dist/tests/util/renderLogic.test.js.map +1 -1
  21. package/dist/util/captcha/captchaRenderer.d.ts +1 -6
  22. package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
  23. package/dist/util/captcha/captchaRenderer.js +10 -9
  24. package/dist/util/captcha/captchaRenderer.js.map +1 -1
  25. package/dist/util/captcha/{captchaProps.d.ts → components/bundleCaptcha.d.ts} +4 -3
  26. package/dist/util/captcha/components/bundleCaptcha.d.ts.map +1 -0
  27. package/dist/util/captcha/components/{frictionlessCaptcha.js → bundleCaptcha.js} +2 -2
  28. package/dist/util/captcha/components/bundleCaptcha.js.map +1 -0
  29. package/dist/util/config.d.ts +2 -2
  30. package/dist/util/config.d.ts.map +1 -1
  31. package/dist/util/config.js +14 -4
  32. package/dist/util/config.js.map +1 -1
  33. package/dist/util/widgetFactory.d.ts +1 -1
  34. package/dist/util/widgetFactory.d.ts.map +1 -1
  35. package/dist/util/widgetFactory.js +4 -6
  36. package/dist/util/widgetFactory.js.map +1 -1
  37. package/package.json +12 -12
  38. package/src/components.ts +15 -0
  39. package/src/index.html +11 -0
  40. package/src/index.ts +259 -0
  41. package/src/tests/procaptchaReady.unit.test.ts +58 -0
  42. package/src/tests/util/config.test.ts +97 -0
  43. package/src/tests/util/renderLogic.test.tsx +221 -0
  44. package/src/util/captcha/captchaRenderer.tsx +126 -0
  45. package/src/util/captcha/components/bundleCaptcha.tsx +57 -0
  46. package/src/util/config.ts +40 -0
  47. package/src/util/configCreator.ts +51 -0
  48. package/src/util/language.ts +53 -0
  49. package/src/util/timeout.ts +43 -0
  50. package/src/util/widgetFactory.ts +145 -0
  51. package/src/util/widgetThemeResolver.ts +40 -0
  52. package/tsconfig.cjs.json +35 -0
  53. package/tsconfig.json +42 -0
  54. package/tsconfig.tsbuildinfo +1 -0
  55. package/tsconfig.types.json +9 -0
  56. package/vite.config.ts +18 -1
  57. package/vite.iife.config.ts +119 -0
  58. package/vite.serve.config.ts +17 -0
  59. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +0 -20
  60. package/dist/cjs/util/captcha/captchaComponentsList.cjs +0 -12
  61. package/dist/cjs/util/captcha/captchaType.cjs +0 -12
  62. package/dist/cjs/util/captcha/components/imageCaptcha.cjs +0 -17
  63. package/dist/cjs/util/captcha/components/powCaptcha.cjs +0 -17
  64. package/dist/tests/util/captchaType.test.d.ts +0 -2
  65. package/dist/tests/util/captchaType.test.d.ts.map +0 -1
  66. package/dist/tests/util/captchaType.test.js +0 -36
  67. package/dist/tests/util/captchaType.test.js.map +0 -1
  68. package/dist/util/captcha/captchaComponentProvider.d.ts +0 -8
  69. package/dist/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  70. package/dist/util/captcha/captchaComponentProvider.js +0 -20
  71. package/dist/util/captcha/captchaComponentProvider.js.map +0 -1
  72. package/dist/util/captcha/captchaComponentsList.d.ts +0 -6
  73. package/dist/util/captcha/captchaComponentsList.d.ts.map +0 -1
  74. package/dist/util/captcha/captchaComponentsList.js +0 -12
  75. package/dist/util/captcha/captchaComponentsList.js.map +0 -1
  76. package/dist/util/captcha/captchaProps.d.ts.map +0 -1
  77. package/dist/util/captcha/captchaProps.js +0 -2
  78. package/dist/util/captcha/captchaProps.js.map +0 -1
  79. package/dist/util/captcha/captchaType.d.ts +0 -3
  80. package/dist/util/captcha/captchaType.d.ts.map +0 -1
  81. package/dist/util/captcha/captchaType.js +0 -12
  82. package/dist/util/captcha/captchaType.js.map +0 -1
  83. package/dist/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  84. package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  85. package/dist/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  86. package/dist/util/captcha/components/imageCaptcha.d.ts +0 -4
  87. package/dist/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  88. package/dist/util/captcha/components/imageCaptcha.js +0 -17
  89. package/dist/util/captcha/components/imageCaptcha.js.map +0 -1
  90. package/dist/util/captcha/components/powCaptcha.d.ts +0 -4
  91. package/dist/util/captcha/components/powCaptcha.d.ts.map +0 -1
  92. package/dist/util/captcha/components/powCaptcha.js +0 -17
  93. package/dist/util/captcha/components/powCaptcha.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,486 @@
1
1
  # @prosopo/procaptcha-bundle
2
2
 
3
+ ## 4.1.7
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [a1d60db]
7
+ - Updated dependencies [2392aaf]
8
+ - Updated dependencies [6ca1125]
9
+ - @prosopo/types@4.3.0
10
+ - @prosopo/procaptcha-frictionless@2.11.0
11
+ - @prosopo/util@3.2.15
12
+ - @prosopo/procaptcha-common@2.10.17
13
+ - @prosopo/dotenv@3.0.43
14
+
15
+ ## 4.1.6
16
+ ### Patch Changes
17
+
18
+ - d3db08d: feat(widget): bait AI responses with empty input + decoded label, portaled into the dapp's form
19
+
20
+ Redesigns the honeypot so it can actually catch AI agents instead of being inert:
21
+
22
+ - Empty input + decoded label: the encoded morse/semaphore question moves from `input.value` to an offscreen `<label>` (base64-decoded at render). Naive form-fillers and humans leave the empty input alone; agents that read the DOM as a prompt write into the empty field, captured as `clientMetaData.hp` on submit.
23
+ - Portaled to light DOM, inside the dapp's `<form>`: widget stays in shadow DOM, but the honeypot portals via `react-dom/createPortal` into the enclosing form (`document.body` fallback). Bots no longer have to traverse `.shadowRoot` to reach it (which was tripping `@prosopo/catcher`'s shadow-DOM guard and wiping the bot's value), and the bait sits where bots actually look — `form.querySelectorAll('input')`.
24
+ - `form="<useId>-d"`: opaque per-instance non-existent form id disassociates the input from native form submission while keeping it DOM-discoverable. Dapp backends don't receive a stray `email_confirm=` field.
25
+ - Shared `<Honeypot />` extracted to `@prosopo/procaptcha-common`.
26
+ - `procaptcha-bundle` Vite config now routes the Honeypot module into a per-build opaque chunk (`c<random8hex>-<hash>.js`) so the URL doesn't identify the component or stay stable across builds for static blocklisting.
27
+ - Updated dependencies [d3db08d]
28
+ - @prosopo/procaptcha-common@2.10.16
29
+ - @prosopo/procaptcha-frictionless@2.10.3
30
+
31
+ ## 4.1.5
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [6c26669]
35
+ - Updated dependencies [f7f9ec5]
36
+ - @prosopo/types@4.2.1
37
+ - @prosopo/procaptcha-frictionless@2.10.2
38
+ - @prosopo/procaptcha-common@2.10.15
39
+
40
+ ## 4.1.4
41
+ ### Patch Changes
42
+
43
+ - 0fd81af: Extract the logger into its own `@prosopo/logger` package, out of `@prosopo/common`. Consumers now import logger symbols from `@prosopo/logger`; `@prosopo/common` no longer re-exports them. Unused `@prosopo/common` dependencies pruned where the only usage was the logger.
44
+ - Updated dependencies [0fd81af]
45
+ - @prosopo/dotenv@3.0.42
46
+ - @prosopo/procaptcha-frictionless@2.10.1
47
+ - @prosopo/procaptcha-common@2.10.14
48
+
49
+ ## 4.1.3
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [20cae63]
53
+ - Updated dependencies [4d9923e]
54
+ - @prosopo/types@4.2.0
55
+ - @prosopo/procaptcha-frictionless@2.10.0
56
+ - @prosopo/procaptcha-common@2.10.13
57
+
58
+ ## 4.1.2
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [d351362]
62
+ - @prosopo/types@4.1.4
63
+ - @prosopo/procaptcha-common@2.10.12
64
+ - @prosopo/procaptcha-frictionless@2.9.6
65
+
66
+ ## 4.1.1
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [6567ce0]
70
+ - Updated dependencies [e2711ae]
71
+ - Updated dependencies [5786629]
72
+ - @prosopo/util@3.2.14
73
+ - @prosopo/types@4.1.3
74
+ - @prosopo/locale@3.2.4
75
+ - @prosopo/procaptcha-common@2.10.11
76
+ - @prosopo/procaptcha-frictionless@2.9.5
77
+ - @prosopo/dotenv@3.0.41
78
+
79
+ ## 4.1.0
80
+ ### Minor Changes
81
+
82
+ - 566c1f6: Emit a classic-script IIFE build of the procaptcha bundle
83
+ (`procaptcha.bundle.iife.js`, ~1.5 MB / 634 KB gzipped) alongside the
84
+ existing ES-module bundle, so customer integrations can pair
85
+ `<script type="module">` with `<script nomodule>`. Crawlers and runtimes
86
+ that do not execute module scripts (notably Ahrefs' renderer) currently
87
+ skip the bundle entirely and never see the rendered widget link;
88
+ shipping a `nomodule` fallback restores backlink discoverability.
89
+
90
+ Runtime bundle-name lookup now takes a list of candidate filenames so
91
+ each variant finds its own `<script>` tag in the DOM. The IIFE config
92
+ disables `manualChunks`, sets `inlineDynamicImports: true`, and uses
93
+ `emptyOutDir: false` to co-exist with the ESM build in `dist/bundle/`.
94
+
95
+ Widget logo anchor hygiene: drop the `#widget` URL fragment, the
96
+ visually-hidden 10000px-offset marketing span, the SVG `<title>`, the
97
+ `aria-label`, and the redundant `prosopo-logo` wrapper. Visible logo
98
+ and "Prosopo" text are unchanged.
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [72a1218]
103
+ - Updated dependencies [566c1f6]
104
+ - @prosopo/util@3.2.13
105
+ - @prosopo/widget-skeleton@2.8.3
106
+ - @prosopo/types@4.1.2
107
+ - @prosopo/procaptcha-common@2.10.10
108
+ - @prosopo/procaptcha-frictionless@2.9.4
109
+
110
+ ## 4.0.3
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [53bfd45]
114
+ - Updated dependencies [91958da]
115
+ - @prosopo/procaptcha-frictionless@2.9.3
116
+ - @prosopo/procaptcha-common@2.10.9
117
+ - @prosopo/locale@3.2.3
118
+ - @prosopo/types@4.1.1
119
+ - @prosopo/dotenv@3.0.40
120
+
121
+ ## 4.0.2
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [6a741ce]
125
+ - @prosopo/types@4.1.0
126
+ - @prosopo/procaptcha-common@2.10.8
127
+ - @prosopo/procaptcha-frictionless@2.9.2
128
+
129
+ ## 4.0.1
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [cc13a45]
133
+ - @prosopo/procaptcha-frictionless@2.9.1
134
+ - @prosopo/procaptcha-common@2.10.7
135
+
136
+ ## 4.0.0
137
+ ### Major Changes
138
+
139
+ - 8bb7286: Move `captchaType` from client (`data-captcha-type` / render-options prop)
140
+ to a server-side site-key setting; the bundle now calls `/frictionless`
141
+ for all flows. Renames the bundle's universal mount component from
142
+ `FrictionlessCaptcha` to `BundleCaptcha` to reflect that it is no longer
143
+ frictionless-specific — the server decides which concrete challenge type
144
+ to render.
145
+
146
+ ### Minor Changes
147
+
148
+ - d865319: Add puzzle captcha (drag-to-target challenge) as a new captcha type:
149
+ provider endpoints, manager + widget package, types, demo pages, and
150
+ a `puzzleTolerance` site setting.
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies [3c0be68]
155
+ - Updated dependencies [f9ea09d]
156
+ - Updated dependencies [4aae4e6]
157
+ - Updated dependencies [4aae4e6]
158
+ - Updated dependencies [d865319]
159
+ - Updated dependencies [753304b]
160
+ - Updated dependencies [8bb7286]
161
+ - Updated dependencies [f9ea09d]
162
+ - Updated dependencies [4aae4e6]
163
+ - Updated dependencies [5f1ae53]
164
+ - @prosopo/types@4.0.0
165
+ - @prosopo/procaptcha-frictionless@2.9.0
166
+ - @prosopo/locale@3.2.2
167
+ - @prosopo/util@3.2.12
168
+ - @prosopo/widget-skeleton@2.8.2
169
+ - @prosopo/procaptcha-common@2.10.6
170
+ - @prosopo/dotenv@3.0.39
171
+
172
+ ## 3.3.31
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [819ed95]
176
+ - @prosopo/procaptcha-frictionless@2.8.62
177
+ - @prosopo/types@3.16.1
178
+ - @prosopo/procaptcha-common@2.10.5
179
+ - @prosopo/procaptcha-pow@2.8.55
180
+ - @prosopo/procaptcha-react@2.9.54
181
+
182
+ ## 3.3.30
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies [f6a4402]
186
+ - Updated dependencies [99dfb44]
187
+ - @prosopo/types@3.16.0
188
+ - @prosopo/procaptcha-common@2.10.4
189
+ - @prosopo/procaptcha-frictionless@2.8.61
190
+ - @prosopo/procaptcha-pow@2.8.54
191
+ - @prosopo/procaptcha-react@2.9.53
192
+
193
+ ## 3.3.29
194
+ ### Patch Changes
195
+
196
+ - Updated dependencies [3e54c0a]
197
+ - @prosopo/types@3.15.0
198
+ - @prosopo/procaptcha-common@2.10.3
199
+ - @prosopo/procaptcha-frictionless@2.8.60
200
+ - @prosopo/procaptcha-pow@2.8.53
201
+ - @prosopo/procaptcha-react@2.9.52
202
+
203
+ ## 3.3.28
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [946a8ba]
207
+ - Updated dependencies [5614814]
208
+ - Updated dependencies [b94890c]
209
+ - @prosopo/types@3.14.1
210
+ - @prosopo/locale@3.2.1
211
+ - @prosopo/procaptcha-common@2.10.2
212
+ - @prosopo/procaptcha-frictionless@2.8.59
213
+ - @prosopo/procaptcha-pow@2.8.52
214
+ - @prosopo/procaptcha-react@2.9.51
215
+ - @prosopo/dotenv@3.0.38
216
+
217
+ ## 3.3.27
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [06970d2]
221
+ - Updated dependencies [fc514dd]
222
+ - Updated dependencies [42650db]
223
+ - Updated dependencies [dd3e06e]
224
+ - @prosopo/procaptcha-common@2.10.1
225
+ - @prosopo/widget-skeleton@2.8.1
226
+ - @prosopo/locale@3.2.0
227
+ - @prosopo/types@3.14.0
228
+ - @prosopo/procaptcha-frictionless@2.8.58
229
+ - @prosopo/procaptcha-pow@2.8.51
230
+ - @prosopo/procaptcha-react@2.9.50
231
+ - @prosopo/dotenv@3.0.37
232
+
233
+ ## 3.3.26
234
+ ### Patch Changes
235
+
236
+ - 49fd2d8: Fixing implicit lang string defined rendering
237
+ - Updated dependencies [73df23c]
238
+ - Updated dependencies [8139819]
239
+ - @prosopo/procaptcha-common@2.10.0
240
+ - @prosopo/widget-skeleton@2.8.0
241
+ - @prosopo/procaptcha-frictionless@2.8.57
242
+ - @prosopo/procaptcha-pow@2.8.50
243
+ - @prosopo/procaptcha-react@2.9.49
244
+ - @prosopo/dotenv@3.0.36
245
+
246
+ ## 3.3.25
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [a25dffa]
250
+ - @prosopo/util@3.2.11
251
+ - @prosopo/procaptcha-pow@2.8.49
252
+ - @prosopo/procaptcha-react@2.9.48
253
+ - @prosopo/types@3.13.3
254
+ - @prosopo/procaptcha-common@2.9.41
255
+ - @prosopo/procaptcha-frictionless@2.8.56
256
+
257
+ ## 3.3.24
258
+ ### Patch Changes
259
+
260
+ - Updated dependencies [346edd7]
261
+ - @prosopo/util@3.2.10
262
+ - @prosopo/procaptcha-pow@2.8.48
263
+ - @prosopo/procaptcha-react@2.9.47
264
+ - @prosopo/types@3.13.2
265
+ - @prosopo/procaptcha-common@2.9.40
266
+ - @prosopo/procaptcha-frictionless@2.8.55
267
+
268
+ ## 3.3.23
269
+ ### Patch Changes
270
+
271
+ - Updated dependencies [22bfee7]
272
+ - Updated dependencies [20192d2]
273
+ - @prosopo/util@3.2.9
274
+ - @prosopo/widget-skeleton@2.7.14
275
+ - @prosopo/procaptcha-pow@2.8.47
276
+ - @prosopo/procaptcha-react@2.9.46
277
+ - @prosopo/types@3.13.1
278
+ - @prosopo/procaptcha-common@2.9.39
279
+ - @prosopo/procaptcha-frictionless@2.8.54
280
+
281
+ ## 3.3.22
282
+ ### Patch Changes
283
+
284
+ - Updated dependencies [e0fb3d6]
285
+ - Updated dependencies [e6d9553]
286
+ - Updated dependencies [f3f23e3]
287
+ - @prosopo/util@3.2.8
288
+ - @prosopo/types@3.13.0
289
+ - @prosopo/procaptcha-pow@2.8.46
290
+ - @prosopo/procaptcha-react@2.9.45
291
+ - @prosopo/procaptcha-common@2.9.38
292
+ - @prosopo/procaptcha-frictionless@2.8.53
293
+
294
+ ## 3.3.21
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies [730c61e]
298
+ - Updated dependencies [d5082a9]
299
+ - Updated dependencies [e1ea65f]
300
+ - Updated dependencies [c316257]
301
+ - @prosopo/procaptcha-frictionless@2.8.52
302
+ - @prosopo/types@3.12.3
303
+ - @prosopo/util@3.2.7
304
+ - @prosopo/procaptcha-common@2.9.37
305
+ - @prosopo/procaptcha-pow@2.8.45
306
+ - @prosopo/procaptcha-react@2.9.44
307
+
308
+ ## 3.3.20
309
+ ### Patch Changes
310
+
311
+ - Updated dependencies [adb89a6]
312
+ - @prosopo/locale@3.1.29
313
+ - @prosopo/types@3.12.2
314
+ - @prosopo/util@3.2.6
315
+ - @prosopo/procaptcha-frictionless@2.8.51
316
+ - @prosopo/procaptcha-pow@2.8.44
317
+ - @prosopo/procaptcha-react@2.9.43
318
+ - @prosopo/procaptcha-common@2.9.36
319
+ - @prosopo/dotenv@3.0.35
320
+
321
+ ## 3.3.19
322
+ ### Patch Changes
323
+
324
+ - @prosopo/procaptcha-frictionless@2.8.50
325
+
326
+ ## 3.3.18
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [a90eb54]
330
+ - @prosopo/types@3.12.1
331
+ - @prosopo/dotenv@3.0.34
332
+ - @prosopo/procaptcha-frictionless@2.8.49
333
+ - @prosopo/procaptcha-pow@2.8.43
334
+ - @prosopo/procaptcha-react@2.9.42
335
+ - @prosopo/procaptcha-common@2.9.35
336
+
337
+ ## 3.3.17
338
+ ### Patch Changes
339
+
340
+ - 676c5f2: Use HTTPS in developmentwq
341
+ - Updated dependencies [676c5f2]
342
+ - Updated dependencies [feaca02]
343
+ - @prosopo/types@3.12.0
344
+ - @prosopo/procaptcha-frictionless@2.8.48
345
+ - @prosopo/procaptcha-common@2.9.34
346
+ - @prosopo/procaptcha-pow@2.8.42
347
+ - @prosopo/procaptcha-react@2.9.41
348
+
349
+ ## 3.3.16
350
+ ### Patch Changes
351
+
352
+ - 8148587: Clustering
353
+ - Updated dependencies [8148587]
354
+ - @prosopo/types@3.11.1
355
+ - @prosopo/procaptcha-frictionless@2.8.47
356
+ - @prosopo/procaptcha-common@2.9.33
357
+ - @prosopo/procaptcha-pow@2.8.41
358
+ - @prosopo/procaptcha-react@2.9.40
359
+
360
+ ## 3.3.15
361
+ ### Patch Changes
362
+
363
+ - @prosopo/procaptcha-frictionless@2.8.46
364
+
365
+ ## 3.3.14
366
+ ### Patch Changes
367
+
368
+ - Updated dependencies [7f6ffc5]
369
+ - @prosopo/types@3.11.0
370
+ - @prosopo/procaptcha-react@2.9.39
371
+ - @prosopo/procaptcha-common@2.9.32
372
+ - @prosopo/procaptcha-frictionless@2.8.45
373
+ - @prosopo/procaptcha-pow@2.8.40
374
+
375
+ ## 3.3.13
376
+ ### Patch Changes
377
+
378
+ - @prosopo/procaptcha-frictionless@2.8.44
379
+
380
+ ## 3.3.12
381
+ ### Patch Changes
382
+
383
+ - Updated dependencies [93fa086]
384
+ - @prosopo/types@3.10.2
385
+ - @prosopo/procaptcha-frictionless@2.8.43
386
+ - @prosopo/procaptcha-common@2.9.31
387
+ - @prosopo/procaptcha-pow@2.8.39
388
+ - @prosopo/procaptcha-react@2.9.38
389
+
390
+ ## 3.3.11
391
+ ### Patch Changes
392
+
393
+ - Updated dependencies [cde7550]
394
+ - @prosopo/types@3.10.1
395
+ - @prosopo/procaptcha-common@2.9.30
396
+ - @prosopo/procaptcha-frictionless@2.8.42
397
+ - @prosopo/procaptcha-pow@2.8.38
398
+ - @prosopo/procaptcha-react@2.9.37
399
+
400
+ ## 3.3.10
401
+ ### Patch Changes
402
+
403
+ - Updated dependencies [ad6d622]
404
+ - @prosopo/types@3.10.0
405
+ - @prosopo/procaptcha-common@2.9.29
406
+ - @prosopo/procaptcha-frictionless@2.8.41
407
+ - @prosopo/procaptcha-pow@2.8.37
408
+ - @prosopo/procaptcha-react@2.9.36
409
+
410
+ ## 3.3.9
411
+ ### Patch Changes
412
+
413
+ - Updated dependencies [ff58a70]
414
+ - Updated dependencies [592adf1]
415
+ - @prosopo/types@3.9.0
416
+ - @prosopo/procaptcha-react@2.9.35
417
+ - @prosopo/procaptcha-pow@2.8.36
418
+ - @prosopo/procaptcha-common@2.9.28
419
+ - @prosopo/procaptcha-frictionless@2.8.40
420
+
421
+ ## 3.3.8
422
+ ### Patch Changes
423
+
424
+ - @prosopo/procaptcha-react@2.9.34
425
+ - @prosopo/procaptcha-frictionless@2.8.39
426
+
427
+ ## 3.3.7
428
+ ### Patch Changes
429
+
430
+ - Updated dependencies [d2431cd]
431
+ - @prosopo/types@3.8.4
432
+ - @prosopo/procaptcha-common@2.9.27
433
+ - @prosopo/procaptcha-frictionless@2.8.38
434
+ - @prosopo/procaptcha-pow@2.8.35
435
+ - @prosopo/procaptcha-react@2.9.33
436
+
437
+ ## 3.3.6
438
+ ### Patch Changes
439
+
440
+ - @prosopo/procaptcha-react@2.9.32
441
+ - @prosopo/procaptcha-frictionless@2.8.37
442
+
443
+ ## 3.3.5
444
+ ### Patch Changes
445
+
446
+ - Updated dependencies [bd6995b]
447
+ - @prosopo/types@3.8.3
448
+ - @prosopo/procaptcha-frictionless@2.8.36
449
+ - @prosopo/procaptcha-common@2.9.26
450
+ - @prosopo/procaptcha-pow@2.8.34
451
+ - @prosopo/procaptcha-react@2.9.31
452
+
453
+ ## 3.3.4
454
+ ### Patch Changes
455
+
456
+ - Updated dependencies [9633e58]
457
+ - @prosopo/types@3.8.2
458
+ - @prosopo/procaptcha-common@2.9.25
459
+ - @prosopo/procaptcha-frictionless@2.8.35
460
+ - @prosopo/procaptcha-pow@2.8.33
461
+ - @prosopo/procaptcha-react@2.9.30
462
+
463
+ ## 3.3.3
464
+ ### Patch Changes
465
+
466
+ - Updated dependencies [f52a5c1]
467
+ - @prosopo/types@3.8.1
468
+ - @prosopo/procaptcha-common@2.9.24
469
+ - @prosopo/procaptcha-frictionless@2.8.34
470
+ - @prosopo/procaptcha-pow@2.8.32
471
+ - @prosopo/procaptcha-react@2.9.29
472
+
473
+ ## 3.3.2
474
+ ### Patch Changes
475
+
476
+ - @prosopo/procaptcha-react@2.9.28
477
+ - @prosopo/procaptcha-frictionless@2.8.33
478
+
479
+ ## 3.3.1
480
+ ### Patch Changes
481
+
482
+ - @prosopo/procaptcha-frictionless@2.8.32
483
+
3
484
  ## 3.3.0
4
485
  ### Minor Changes
5
486
 
@@ -2,11 +2,10 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const procaptchaCommon = require("@prosopo/procaptcha-common");
4
4
  const util = require("@prosopo/util");
5
- const captchaType = require("./util/captcha/captchaType.cjs");
6
5
  const config = require("./util/config.cjs");
7
6
  const widgetFactory$1 = require("./util/widgetFactory.cjs");
8
7
  const widgetThemeResolver = require("./util/widgetThemeResolver.cjs");
9
- const BUNDLE_NAME = "procaptcha.bundle.js";
8
+ const BUNDLE_NAMES = ["procaptcha.bundle.iife.js", "procaptcha.bundle.js"];
10
9
  let procaptchaRoots = [];
11
10
  const widgetFactory = new widgetFactory$1.WidgetFactory(new widgetThemeResolver.WidgetThemeResolver());
12
11
  const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
@@ -22,11 +21,9 @@ const implicitRender = async () => {
22
21
  console.error("No site key found");
23
22
  return;
24
23
  }
25
- const captchaType$1 = captchaType.getCaptchaType(elements);
26
24
  const root = await widgetFactory.createWidgets(
27
25
  elements,
28
26
  {
29
- captchaType: captchaType$1,
30
27
  siteKey
31
28
  },
32
29
  !(web3 === "true")
@@ -40,11 +37,9 @@ const implicitRender = async () => {
40
37
  for (const button of invisibleButtons) {
41
38
  const siteKey = button.getAttribute("data-sitekey") || "";
42
39
  const callback = button.getAttribute("data-callback") || "";
43
- const captchaType$1 = captchaType.getCaptchaType([button]);
44
40
  const root = await widgetFactory.createWidgets(
45
41
  [button],
46
42
  {
47
- captchaType: captchaType$1,
48
43
  siteKey,
49
44
  callback
50
45
  },
@@ -133,10 +128,10 @@ function findProcaptchaContainers() {
133
128
  return containers;
134
129
  }
135
130
  const start = () => {
136
- const { onloadUrlCallback, renderExplicit } = config.extractParams(BUNDLE_NAME);
131
+ const { onloadUrlCallback, renderExplicit } = config.extractParams(BUNDLE_NAMES);
137
132
  let readyCalled = false;
138
133
  if (renderExplicit !== "explicit") {
139
- config.getProcaptchaScript(BUNDLE_NAME)?.addEventListener("load", () => {
134
+ config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
140
135
  ready(implicitRender);
141
136
  readyCalled = true;
142
137
  });
@@ -145,7 +140,7 @@ const start = () => {
145
140
  }
146
141
  }
147
142
  if (onloadUrlCallback) {
148
- config.getProcaptchaScript(BUNDLE_NAME)?.addEventListener("load", () => {
143
+ config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
149
144
  const onloadCallback = procaptchaCommon.getWindowCallback(onloadUrlCallback);
150
145
  ready(onloadCallback);
151
146
  });
@@ -7,12 +7,9 @@ const client = require("react-dom/client");
7
7
  const configCreator = require("../configCreator.cjs");
8
8
  const language = require("../language.cjs");
9
9
  const timeout = require("../timeout.cjs");
10
+ const bundleCaptcha = require("./components/bundleCaptcha.cjs");
10
11
  class CaptchaRenderer {
11
- constructor(captchaComponentProvider) {
12
- this.captchaComponentProvider = captchaComponentProvider;
13
- }
14
- renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer) {
15
- const captchaType = renderOptions?.captchaType || settings.defaultCaptchaType;
12
+ renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer, sourceElement) {
16
13
  const config = configCreator.createConfig(
17
14
  renderOptions.siteKey,
18
15
  renderOptions.theme,
@@ -21,7 +18,11 @@ class CaptchaRenderer {
21
18
  invisible,
22
19
  renderOptions.userAccountAddress
23
20
  );
24
- this.readAndValidateSettings(container, config, renderOptions);
21
+ this.readAndValidateSettings(
22
+ sourceElement || container,
23
+ config,
24
+ renderOptions
25
+ );
25
26
  const reactRoot = this.createReactRoot(
26
27
  container,
27
28
  settings.identifierPrefix
@@ -30,12 +31,12 @@ class CaptchaRenderer {
30
31
  settings.emotionCacheKey,
31
32
  container
32
33
  );
33
- const captchaComponent = this.captchaComponentProvider.getCaptchaComponent(
34
- captchaType,
34
+ const captchaComponent = /* @__PURE__ */ jsxRuntime.jsx(
35
+ bundleCaptcha.BundleCaptcha,
35
36
  {
36
37
  config,
37
- i18n,
38
38
  callbacks,
39
+ i18n,
39
40
  container: widgetContainer
40
41
  }
41
42
  );
@@ -4,7 +4,7 @@ const jsxRuntime = require("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
- const FrictionlessCaptcha = (props) => {
7
+ const BundleCaptcha = (props) => {
8
8
  const { config, callbacks, i18n, container } = props;
9
9
  const [componentKey, setComponentKey] = react.useState(0);
10
10
  const restart = () => {
@@ -22,4 +22,4 @@ const FrictionlessCaptcha = (props) => {
22
22
  componentKey
23
23
  );
24
24
  };
25
- exports.FrictionlessCaptcha = FrictionlessCaptcha;
25
+ exports.BundleCaptcha = BundleCaptcha;
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const getProcaptchaScript = (name) => document.querySelector(`script[src*="${name}"]`);
4
- const extractParams = (name) => {
5
- const script = getProcaptchaScript(name);
6
- if (script && script.src.indexOf(`${name}`) !== -1) {
3
+ const getProcaptchaScript = (names) => {
4
+ for (const name of names) {
5
+ const script = document.querySelector(
6
+ `script[src*="${name}"]`
7
+ );
8
+ if (script) {
9
+ return script;
10
+ }
11
+ }
12
+ return null;
13
+ };
14
+ const extractParams = (names) => {
15
+ const script = getProcaptchaScript(names);
16
+ if (script) {
7
17
  const params = new URLSearchParams(script.src.split("?")[1]);
8
18
  return {
9
19
  onloadUrlCallback: params.get("onload") || void 0,
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const locale = require("@prosopo/locale");
4
4
  const procaptchaCommon = require("@prosopo/procaptcha-common");
5
- const types = require("@prosopo/types");
6
5
  const widgetSkeleton = require("@prosopo/widget-skeleton");
7
6
  class WidgetFactory {
8
7
  constructor(widgetThemeResolver) {
@@ -58,8 +57,7 @@ class WidgetFactory {
58
57
  {
59
58
  identifierPrefix: "procaptcha-",
60
59
  emotionCacheKey: "procaptcha",
61
- webComponentTag: "prosopo-procaptcha",
62
- defaultCaptchaType: types.CaptchaType.frictionless
60
+ webComponentTag: "prosopo-procaptcha"
63
61
  },
64
62
  widgetInteractiveArea,
65
63
  renderOptions,
@@ -67,7 +65,8 @@ class WidgetFactory {
67
65
  isWeb2,
68
66
  this.i18n,
69
67
  invisible,
70
- widgetContainer
68
+ widgetContainer,
69
+ container
71
70
  );
72
71
  return captchaRoot;
73
72
  }
@@ -82,8 +81,7 @@ class WidgetFactory {
82
81
  }
83
82
  async createCaptchaRenderer() {
84
83
  const CaptchaRenderer = (await Promise.resolve().then(() => require("./captcha/captchaRenderer.cjs"))).CaptchaRenderer;
85
- const CaptchaComponentProvider = (await Promise.resolve().then(() => require("./captcha/captchaComponentProvider.cjs"))).CaptchaComponentProvider;
86
- return new CaptchaRenderer(new CaptchaComponentProvider());
84
+ return new CaptchaRenderer();
87
85
  }
88
86
  }
89
87
  exports.WidgetFactory = WidgetFactory;
@@ -1,5 +1,2 @@
1
- export * from "./util/captcha/components/frictionlessCaptcha.js";
2
- export * from "./util/captcha/components/powCaptcha.js";
3
- export * from "./util/captcha/components/imageCaptcha.js";
4
- export * from "./util/captcha/captchaComponentProvider.js";
1
+ export * from "./util/captcha/components/bundleCaptcha.js";
5
2
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,4CAA4C,CAAC"}
@@ -1,5 +1,2 @@
1
- export * from "./util/captcha/components/frictionlessCaptcha.js";
2
- export * from "./util/captcha/components/powCaptcha.js";
3
- export * from "./util/captcha/components/imageCaptcha.js";
4
- export * from "./util/captcha/captchaComponentProvider.js";
1
+ export * from "./util/captcha/components/bundleCaptcha.js";
5
2
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,4CAA4C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAoF9D,eAAO,MAAM,MAAM,YACT,OAAO,iBACD,uBAAuB,kBA2BtC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,QAY3C;AAED,eAAO,MAAM,OAAO,YAqBnB,CAAC;AAkCF,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,EAAE;YACX,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,MAAM,EAAE,OAAO,MAAM,CAAC;YACtB,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,OAAO,EAAE,OAAO,OAAO,CAAC;SACxB,CAAC;KACF;CACD;AAmCD,eAAO,MAAM,KAAK,YAOjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AA6E9D,eAAO,MAAM,MAAM,YACT,OAAO,iBACD,uBAAuB,kBA2BtC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,QAY3C;AAED,eAAO,MAAM,OAAO,YAqBnB,CAAC;AAkCF,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,EAAE;YACX,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,MAAM,EAAE,OAAO,MAAM,CAAC;YACtB,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,OAAO,EAAE,OAAO,OAAO,CAAC;SACxB,CAAC;KACF;CACD;AAmCD,eAAO,MAAM,KAAK,YAOjB,CAAC"}