@captchafox/react 1.4.0 → 1.5.0
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 +13 -12
- package/dist/index.cjs +15 -1
- package/dist/index.js +15 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,18 +34,19 @@ function Example() {
|
|
|
34
34
|
|
|
35
35
|
### Props
|
|
36
36
|
|
|
37
|
-
| **Prop** | **Type**
|
|
38
|
-
| -------- |
|
|
39
|
-
| sitekey | `string`
|
|
40
|
-
| lang | `string`
|
|
41
|
-
| mode | `inline\|popup\|hidden`
|
|
42
|
-
| theme | `light` | `dark` |
|
|
43
|
-
| nonce | `string`
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
37
|
+
| **Prop** | **Type** | **Description** | **Required** |
|
|
38
|
+
| -------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------ |
|
|
39
|
+
| sitekey | `string` | The sitekey for the widget | ✅ |
|
|
40
|
+
| lang | `string` | The language the widget should display. Defaults to automatically detecting it. | |
|
|
41
|
+
| mode | `inline\|popup\|hidden` | The mode the widget should be displayed in . | |
|
|
42
|
+
| theme | `light` | `dark` | [`ThemeDefinition`](https://docs.captchafox.com/theming#custom-theme) | The theme of the widget. Defaults to light. | |
|
|
43
|
+
| nonce | `string` | Randomly generated nonce . | |
|
|
44
|
+
| i18n | `object` | Custom i18n configuration. | |
|
|
45
|
+
| onVerify | `function` | Called with the response token after successful verification. | |
|
|
46
|
+
| onFail | `function` | Called after unsuccessful verification. | |
|
|
47
|
+
| onError | `function` | Called when an error occured. | |
|
|
48
|
+
| onExpire | `function` | Called when the challenge expires. | |
|
|
49
|
+
| onClose | `function` | Called when the challenge was closed. | |
|
|
49
50
|
|
|
50
51
|
### Using the verification callback
|
|
51
52
|
|
package/dist/index.cjs
CHANGED
|
@@ -87,7 +87,20 @@ var isApiReady = () => typeof (window == null ? void 0 : window.captchafox) !==
|
|
|
87
87
|
// src/CaptchaFox.tsx
|
|
88
88
|
var import_react = __toESM(require("react"), 1);
|
|
89
89
|
var CaptchaFox = (0, import_react.forwardRef)(
|
|
90
|
-
({
|
|
90
|
+
({
|
|
91
|
+
sitekey,
|
|
92
|
+
lang,
|
|
93
|
+
mode,
|
|
94
|
+
theme,
|
|
95
|
+
className,
|
|
96
|
+
nonce,
|
|
97
|
+
i18n,
|
|
98
|
+
onError,
|
|
99
|
+
onVerify,
|
|
100
|
+
onLoad,
|
|
101
|
+
onFail,
|
|
102
|
+
onClose
|
|
103
|
+
}, ref) => {
|
|
91
104
|
const [containerRef, setContainerRef] = (0, import_react.useState)();
|
|
92
105
|
const [widgetId, setWidgetId] = (0, import_react.useState)();
|
|
93
106
|
const firstRendered = (0, import_react.useRef)(false);
|
|
@@ -137,6 +150,7 @@ var CaptchaFox = (0, import_react.forwardRef)(
|
|
|
137
150
|
sitekey,
|
|
138
151
|
mode,
|
|
139
152
|
theme,
|
|
153
|
+
i18n,
|
|
140
154
|
onError,
|
|
141
155
|
onFail,
|
|
142
156
|
onClose,
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,20 @@ var isApiReady = () => typeof (window == null ? void 0 : window.captchafox) !==
|
|
|
51
51
|
// src/CaptchaFox.tsx
|
|
52
52
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
53
53
|
var CaptchaFox = forwardRef(
|
|
54
|
-
({
|
|
54
|
+
({
|
|
55
|
+
sitekey,
|
|
56
|
+
lang,
|
|
57
|
+
mode,
|
|
58
|
+
theme,
|
|
59
|
+
className,
|
|
60
|
+
nonce,
|
|
61
|
+
i18n,
|
|
62
|
+
onError,
|
|
63
|
+
onVerify,
|
|
64
|
+
onLoad,
|
|
65
|
+
onFail,
|
|
66
|
+
onClose
|
|
67
|
+
}, ref) => {
|
|
55
68
|
const [containerRef, setContainerRef] = useState();
|
|
56
69
|
const [widgetId, setWidgetId] = useState();
|
|
57
70
|
const firstRendered = useRef(false);
|
|
@@ -101,6 +114,7 @@ var CaptchaFox = forwardRef(
|
|
|
101
114
|
sitekey,
|
|
102
115
|
mode,
|
|
103
116
|
theme,
|
|
117
|
+
i18n,
|
|
104
118
|
onError,
|
|
105
119
|
onFail,
|
|
106
120
|
onClose,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@captchafox/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-dom": ">=16.8.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@captchafox/types": "^1.
|
|
38
|
+
"@captchafox/types": "^1.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@captchafox/tsconfig": "*",
|