@yandex/smart-captcha
Advanced tools
Comparing version 1.6.25 to 1.7.0
@@ -1,6 +0,8 @@ | ||
import { VFC } from 'react'; | ||
import { FC } from 'react'; | ||
import { SmartCaptchaPropsBase } from '../typings/api'; | ||
export declare type InvisibleSmartCaptchaProps = SmartCaptchaPropsBase & { | ||
shieldPosition?: 'top-left' | 'center-left' | 'bottom-left' | 'top-right' | 'center-right' | 'bottom-right'; | ||
hideShield?: boolean; | ||
visible?: boolean; | ||
}; | ||
export declare const InvisibleSmartCaptcha: VFC<InvisibleSmartCaptchaProps>; | ||
export declare const InvisibleSmartCaptcha: FC<InvisibleSmartCaptchaProps>; |
@@ -36,3 +36,3 @@ "use strict"; | ||
const useSmartCaptcha_1 = require("../hooks/useSmartCaptcha"); | ||
const style = { height: 98 }; | ||
const style = { height: 102 }; | ||
const InvisibleSmartCaptcha = (props) => { | ||
@@ -46,3 +46,3 @@ const containerRef = react_1.useRef(null); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [language, restProps.sitekey, restProps.test]); | ||
}, [language, restProps.hideShield, restProps.shieldPosition, restProps.sitekey, restProps.test]); | ||
react_1.useEffect(() => { | ||
@@ -49,0 +49,0 @@ if (restProps.visible) { |
@@ -1,4 +0,4 @@ | ||
import { VFC } from 'react'; | ||
import { FC } from 'react'; | ||
import { SmartCaptchaPropsBase } from '../typings/api'; | ||
export declare type SmartCaptchaProps = SmartCaptchaPropsBase; | ||
export declare const SmartCaptcha: VFC<SmartCaptchaProps>; | ||
export declare const SmartCaptcha: FC<SmartCaptchaProps>; |
@@ -36,3 +36,3 @@ "use strict"; | ||
const useSmartCaptcha_1 = require("../hooks/useSmartCaptcha"); | ||
const style = { height: 98 }; | ||
const style = { height: 102 }; | ||
const SmartCaptcha = (props) => { | ||
@@ -39,0 +39,0 @@ const containerRef = react_1.useRef(null); |
@@ -12,5 +12,2 @@ "use strict"; | ||
let startLoading = false; | ||
window.__onSmartCaptchaReady = () => { | ||
exports.callbacks.forEach((callback) => callback()); | ||
}; | ||
function useSmartCaptchaLoader() { | ||
@@ -22,2 +19,7 @@ const [smartCaptcha, setSmartCaptcha] = react_1.useState(); | ||
} | ||
if (window.__onSmartCaptchaReady === undefined) { | ||
window.__onSmartCaptchaReady = () => { | ||
exports.callbacks.forEach((callback) => callback()); | ||
}; | ||
} | ||
if (window.smartCaptcha) { | ||
@@ -24,0 +26,0 @@ setSmartCaptcha(window.smartCaptcha); |
{ | ||
"name": "@yandex/smart-captcha", | ||
"version": "1.6.25", | ||
"version": "1.7.0", | ||
"main": "index.js", | ||
@@ -13,3 +13,3 @@ "scripts": { | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0" | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": {}, |
19405
409