react-turnstile
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -17,3 +17,3 @@ import React from "react"; | ||
onVerify: (token: string) => void; | ||
onLoad?: () => void; | ||
onLoad?: (widgetId: string) => void; | ||
onError?: (error?: Error | any) => void; | ||
@@ -25,10 +25,10 @@ onExpire?: () => void; | ||
turnstile: { | ||
render: (element: string | HTMLElement, options: RawTurnstileOptions) => string; | ||
reset: (widgetId: string) => void; | ||
getResponse: (widgetId: string) => string | undefined; | ||
remove: (widgetId: string) => void; | ||
render: (idOrContainer: string | HTMLElement, options: TurnstileOptions) => string; | ||
reset: (widgetIdOrContainer: string | HTMLElement) => void; | ||
getResponse: (widgetIdOrContainer: string | HTMLElement) => string | undefined; | ||
remove: (widgetIdOrContainer: string | HTMLElement) => void; | ||
}; | ||
} | ||
} | ||
interface RawTurnstileOptions { | ||
interface TurnstileOptions { | ||
sitekey: string; | ||
@@ -35,0 +35,0 @@ action?: string; |
@@ -80,4 +80,2 @@ "use strict"; | ||
} | ||
(_b = inplaceState.onLoad) === null || _b === void 0 ? void 0 : _b.call(inplaceState); | ||
// turnstile is loaded, render the widget | ||
if (cancelled || !ref.current) | ||
@@ -98,2 +96,3 @@ return; | ||
widgetId = window.turnstile.render(ref.current, turnstileOptions); | ||
(_b = inplaceState.onLoad) === null || _b === void 0 ? void 0 : _b.call(inplaceState, widgetId); | ||
})(); | ||
@@ -100,0 +99,0 @@ return () => { |
@@ -10,2 +10,8 @@ # Changelog | ||
## [1.0.4] - 2022-10-11 | ||
### Changed | ||
- `onLoad` callback now includes the turnstile widget id (#5) | ||
## [1.0.3] - 2022-10-05 | ||
@@ -46,6 +52,7 @@ | ||
[unreleased]: https://github.com/Le0Developer/react-turnstile/compare/v1.0.3...HEAD | ||
[1.0.2]: https://github.com/le0developer/react-turnstile/compare/v1.0.2...v1.0.3 | ||
[unreleased]: https://github.com/Le0Developer/react-turnstile/compare/v1.0.4...HEAD | ||
[1.0.4]: https://github.com/le0developer/react-turnstile/compare/v1.0.3...v1.0.4 | ||
[1.0.3]: https://github.com/le0developer/react-turnstile/compare/v1.0.2...v1.0.3 | ||
[1.0.2]: https://github.com/le0developer/react-turnstile/compare/v1.0.1...v1.0.2 | ||
[1.0.1]: https://github.com/le0developer/react-turnstile/compare/v1.0.0...v1.0.1 | ||
[1.0.0]: https://github.com/Le0Developer/react-turnstile/releases/tag/v1.0.0 |
{ | ||
"name": "react-turnstile", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "React library for Cloudflare's Turnstile CAPTCHA alternative", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -54,3 +54,2 @@ # react-turnstile | ||
\* responseField and responseFieldName are experimental and not yet documented. | ||
@@ -57,0 +56,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21915
59