@dynamic-labs/sdk-react-core 2.5.3 → 2.6.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/CHANGELOG.md +7 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +14 -14
- package/src/lib/components/QRCode/QRCode.d.ts +15 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -0
- package/src/lib/context/DynamicContext/types/SocialSettings.d.ts +7 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +4 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +4 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/index.d.ts +1 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +150 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.d.ts +7 -0
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +146 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +1 -1
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +1 -1
- package/src/lib/data/api/oauth/oauth.cjs +13 -0
- package/src/lib/data/api/oauth/oauth.d.ts +2 -1
- package/src/lib/data/api/oauth/oauth.js +13 -1
- package/src/lib/shared/utils/hooks/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useEffectOnceCondition/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useEffectOnceCondition/useEffectOnceCondition.cjs +26 -0
- package/src/lib/shared/utils/hooks/useEffectOnceCondition/useEffectOnceCondition.d.ts +7 -0
- package/src/lib/shared/utils/hooks/useEffectOnceCondition/useEffectOnceCondition.js +22 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/socialStorage/index.d.ts +1 -0
- package/src/lib/utils/functions/socialStorage/socialStorage.cjs +36 -0
- package/src/lib/utils/functions/socialStorage/socialStorage.d.ts +17 -0
- package/src/lib/utils/functions/socialStorage/socialStorage.js +29 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/connectWithAppleId.cjs +26 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/connectWithAppleId.d.ts +7 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/connectWithAppleId.js +22 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/loadAppleId.cjs +34 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/loadAppleId.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAuth/apple/loadAppleId.js +30 -0
- package/src/lib/utils/hooks/useSocialAuth/index.d.ts +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +85 -27
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +9 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +90 -32
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +1 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +1 -2
|
@@ -7,3 +7,4 @@ export { useOnClickOutside } from './useOnClickOutside';
|
|
|
7
7
|
export { usePreventPageScroll } from './usePreventPageScroll';
|
|
8
8
|
export { useThrottle } from './useThrottle';
|
|
9
9
|
export { usePrefetch } from './usePrefetch';
|
|
10
|
+
export { useEffectOnceCondition } from './useEffectOnceCondition';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useEffectOnceCondition } from './useEffectOnceCondition';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hook that runs an effect only once based on a condition.
|
|
10
|
+
*
|
|
11
|
+
* @param {Function} effect - The effect callback function to run.
|
|
12
|
+
* @param {boolean} condition - The condition that determines whether the effect should run.
|
|
13
|
+
*/
|
|
14
|
+
const useEffectOnceCondition = (effect, condition) => {
|
|
15
|
+
const hasRun = React.useRef(false);
|
|
16
|
+
const effectRef = React.useRef(effect);
|
|
17
|
+
effectRef.current = effect;
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
if (condition && !hasRun.current) {
|
|
20
|
+
effectRef.current();
|
|
21
|
+
hasRun.current = true;
|
|
22
|
+
}
|
|
23
|
+
}, [condition]);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.useEffectOnceCondition = useEffectOnceCondition;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that runs an effect only once based on a condition.
|
|
3
|
+
*
|
|
4
|
+
* @param {Function} effect - The effect callback function to run.
|
|
5
|
+
* @param {boolean} condition - The condition that determines whether the effect should run.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useEffectOnceCondition: (effect: () => void, condition: boolean) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook that runs an effect only once based on a condition.
|
|
6
|
+
*
|
|
7
|
+
* @param {Function} effect - The effect callback function to run.
|
|
8
|
+
* @param {boolean} condition - The condition that determines whether the effect should run.
|
|
9
|
+
*/
|
|
10
|
+
const useEffectOnceCondition = (effect, condition) => {
|
|
11
|
+
const hasRun = useRef(false);
|
|
12
|
+
const effectRef = useRef(effect);
|
|
13
|
+
effectRef.current = effect;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (condition && !hasRun.current) {
|
|
16
|
+
effectRef.current();
|
|
17
|
+
hasRun.current = true;
|
|
18
|
+
}
|
|
19
|
+
}, [condition]);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { useEffectOnceCondition };
|