@dynamic-labs/sdk-react-core 2.1.0-alpha.4 → 2.1.0-alpha.6
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.cjs +6 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -0
- package/src/lib/Main.cjs +2 -0
- package/src/lib/Main.js +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +17 -5
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +14 -2
- package/src/lib/context/ErrorBoundary/ErrorBoundary.cjs +64 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundary.d.ts +3 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundary.js +60 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.cjs +40 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.d.ts +14 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.js +36 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.cjs +24 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.d.ts +5 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.js +18 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.cjs +17 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.d.ts +4 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.js +13 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.cjs +17 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.d.ts +4 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.js +13 -0
- package/src/lib/context/ErrorBoundary/index.d.ts +3 -0
- package/src/lib/context/ErrorBoundary/types.d.ts +13 -0
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +2 -1
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +3 -2
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +7 -8
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +7 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +27 -34
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +28 -35
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +31 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +31 -9
- package/src/lib/views/EmailVerification/EmailVerification.cjs +38 -11
- package/src/lib/views/EmailVerification/EmailVerification.js +38 -11
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +6 -7
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +6 -7
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs +16 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.d.ts +2 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js +12 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.5...v2.1.0-alpha.6) (2024-04-24)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* embedded wallets headless session control fixes ([#5469](https://github.com/dynamic-labs/DynamicAuth/issues/5469)) ([92e6c35](https://github.com/dynamic-labs/DynamicAuth/commit/92e6c359d2710fd4f5f5a6fedc4acf6c4bab78ba))
|
|
8
|
+
|
|
9
|
+
## [2.1.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.4...v2.1.0-alpha.5) (2024-04-23)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* get embedded wallet checking the wrong chain enum ([#5458](https://github.com/dynamic-labs/DynamicAuth/issues/5458)) ([ed1c523](https://github.com/dynamic-labs/DynamicAuth/commit/ed1c523ca14cd4d21c00181ab40802f876c02b80))
|
|
15
|
+
|
|
2
16
|
## [2.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.3...v2.1.0-alpha.4) (2024-04-23)
|
|
3
17
|
|
|
4
18
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "2.1.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "2.1.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.1.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.1.0-alpha.
|
|
26
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
27
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
28
|
-
"@dynamic-labs/viem-utils": "2.1.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "2.1.0-alpha.6",
|
|
21
|
+
"@dynamic-labs/logger": "2.1.0-alpha.6",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.1.0-alpha.6",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.6",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.6",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.6",
|
|
26
|
+
"@dynamic-labs/types": "2.1.0-alpha.6",
|
|
27
|
+
"@dynamic-labs/utils": "2.1.0-alpha.6",
|
|
28
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.6",
|
|
29
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.6",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.6",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -8,6 +8,9 @@ var version = require('./version.cjs');
|
|
|
8
8
|
var data = require('./lib/views/WalletList/data.cjs');
|
|
9
9
|
var getAuthToken = require('./lib/utils/functions/getAuthToken/getAuthToken.cjs');
|
|
10
10
|
var DynamicContext = require('./lib/context/DynamicContext/DynamicContext.cjs');
|
|
11
|
+
var ErrorBoundary = require('./lib/context/ErrorBoundary/ErrorBoundary.cjs');
|
|
12
|
+
var ErrorBoundaryExclude = require('./lib/context/ErrorBoundary/ErrorBoundaryExclude.cjs');
|
|
13
|
+
var ErrorBoundaryInclude = require('./lib/context/ErrorBoundary/ErrorBoundaryInclude.cjs');
|
|
11
14
|
var useDynamicContext = require('./lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
12
15
|
require('react');
|
|
13
16
|
var useDynamicScopes = require('./lib/utils/hooks/useDynamicScopes/useDynamicScopes.cjs');
|
|
@@ -149,6 +152,9 @@ exports.getWallets = data.getWallets;
|
|
|
149
152
|
exports.getAuthToken = getAuthToken.getAuthToken;
|
|
150
153
|
exports.DynamicContext = DynamicContext.DynamicContext;
|
|
151
154
|
exports.DynamicContextProvider = DynamicContext.DynamicContextProvider;
|
|
155
|
+
exports.ErrorBoundary = ErrorBoundary.ErrorBoundary;
|
|
156
|
+
exports.ErrorBoundaryExclude = ErrorBoundaryExclude.ErrorBoundaryExclude;
|
|
157
|
+
exports.ErrorBoundaryInclude = ErrorBoundaryInclude.ErrorBoundaryInclude;
|
|
152
158
|
exports.useDynamicContext = useDynamicContext.useDynamicContext;
|
|
153
159
|
exports.useDynamicScopes = useDynamicScopes.useDynamicScopes;
|
|
154
160
|
exports.useUserWallets = UserWalletsContext.useUserWallets;
|
package/src/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { VERSION } from './version';
|
|
|
3
3
|
export { getWallets } from './lib/views/WalletList/data';
|
|
4
4
|
export { getAuthToken } from './lib/utils/functions/getAuthToken';
|
|
5
5
|
export { DynamicContextProvider, DynamicContext, } from './lib/context/DynamicContext';
|
|
6
|
+
export { ErrorBoundary, ErrorBoundaryInclude, ErrorBoundaryExclude, } from './lib/context/ErrorBoundary';
|
|
6
7
|
export type { DynamicContextProps } from './lib/context/DynamicContext';
|
|
7
8
|
export { useDynamicContext } from './lib/context/DynamicContext/useDynamicContext';
|
|
8
9
|
export { useDynamicScopes } from './lib/utils/hooks/useDynamicScopes';
|
package/src/index.js
CHANGED
|
@@ -4,6 +4,9 @@ export { VERSION } from './version.js';
|
|
|
4
4
|
export { getWallets } from './lib/views/WalletList/data.js';
|
|
5
5
|
export { getAuthToken } from './lib/utils/functions/getAuthToken/getAuthToken.js';
|
|
6
6
|
export { DynamicContext, DynamicContextProvider } from './lib/context/DynamicContext/DynamicContext.js';
|
|
7
|
+
export { ErrorBoundary } from './lib/context/ErrorBoundary/ErrorBoundary.js';
|
|
8
|
+
export { ErrorBoundaryExclude } from './lib/context/ErrorBoundary/ErrorBoundaryExclude.js';
|
|
9
|
+
export { ErrorBoundaryInclude } from './lib/context/ErrorBoundary/ErrorBoundaryInclude.js';
|
|
7
10
|
export { useDynamicContext } from './lib/context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
8
11
|
import 'react';
|
|
9
12
|
export { useDynamicScopes } from './lib/utils/hooks/useDynamicScopes/useDynamicScopes.js';
|
package/src/lib/Main.cjs
CHANGED
|
@@ -23,6 +23,8 @@ var localStorage = require('./shared/utils/classes/storage/localStorage.cjs');
|
|
|
23
23
|
var usePreventPageScroll = require('./shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
|
|
24
24
|
var index$1 = require('./shared/consts/index.cjs');
|
|
25
25
|
require('./context/DynamicContext/DynamicContext.cjs');
|
|
26
|
+
require('./context/ErrorBoundary/ErrorBoundaryBase.cjs');
|
|
27
|
+
require('./context/ErrorBoundary/ErrorBoundaryContext.cjs');
|
|
26
28
|
var dynamicEvents = require('./events/dynamicEvents.cjs');
|
|
27
29
|
require('./context/CaptchaContext/CaptchaContext.cjs');
|
|
28
30
|
require('./context/ErrorContext/ErrorContext.cjs');
|
package/src/lib/Main.js
CHANGED
|
@@ -19,6 +19,8 @@ import { LocalStorage } from './shared/utils/classes/storage/localStorage.js';
|
|
|
19
19
|
import { usePreventPageScroll } from './shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js';
|
|
20
20
|
import { authModalZIndex } from './shared/consts/index.js';
|
|
21
21
|
import './context/DynamicContext/DynamicContext.js';
|
|
22
|
+
import './context/ErrorBoundary/ErrorBoundaryBase.js';
|
|
23
|
+
import './context/ErrorBoundary/ErrorBoundaryContext.js';
|
|
22
24
|
import { dynamicEvents } from './events/dynamicEvents.js';
|
|
23
25
|
import './context/CaptchaContext/CaptchaContext.js';
|
|
24
26
|
import './context/ErrorContext/ErrorContext.js';
|
|
@@ -8,6 +8,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var iconic = require('@dynamic-labs/iconic');
|
|
11
|
+
var logger = require('@dynamic-labs/logger');
|
|
11
12
|
var utils = require('@dynamic-labs/utils');
|
|
12
13
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
13
14
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
@@ -15,7 +16,7 @@ var app = require('../../app.cjs');
|
|
|
15
16
|
require('../../events/dynamicEvents.cjs');
|
|
16
17
|
var decodeJwt = require('../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
17
18
|
require('@dynamic-labs/sdk-api-core');
|
|
18
|
-
var logger = require('../../shared/logger.cjs');
|
|
19
|
+
var logger$1 = require('../../shared/logger.cjs');
|
|
19
20
|
var ViewContext = require('../ViewContext/ViewContext.cjs');
|
|
20
21
|
var localStorage$1 = require('../../utils/constants/localStorage.cjs');
|
|
21
22
|
require('../../utils/constants/colors.cjs');
|
|
@@ -110,6 +111,9 @@ var FundingContext = require('../FundingContext/FundingContext.cjs');
|
|
|
110
111
|
var PhantomRedirectContext = require('../PhantomRedirectContext/PhantomRedirectContext.cjs');
|
|
111
112
|
var SendBalanceContext = require('../SendBalanceContext/SendBalanceContext.cjs');
|
|
112
113
|
var UseNetworkValidation = require('../UseNetworkValidation/UseNetworkValidation.cjs');
|
|
114
|
+
var ErrorBoundary = require('../ErrorBoundary/ErrorBoundary.cjs');
|
|
115
|
+
var ErrorBoundaryExclude = require('../ErrorBoundary/ErrorBoundaryExclude.cjs');
|
|
116
|
+
require('../ErrorBoundary/ErrorBoundaryBase.cjs');
|
|
113
117
|
var helpers = require('./helpers/helpers.cjs');
|
|
114
118
|
var useDisplayOrderState = require('./hooks/useDisplayOrderState/useDisplayOrderState.cjs');
|
|
115
119
|
var useEmailLoginState = require('./hooks/useEmailLoginState/useEmailLoginState.cjs');
|
|
@@ -146,10 +150,10 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
146
150
|
if (!environmentId) {
|
|
147
151
|
throw new utils.MissingEnvironmentIdError();
|
|
148
152
|
}
|
|
149
|
-
logger.logger.setLogLevel(logLevel);
|
|
153
|
+
logger$1.logger.setLogLevel(logLevel);
|
|
150
154
|
walletConnectorCore.logger.setLogLevel(logLevel);
|
|
151
155
|
if (environmentId === PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID) {
|
|
152
|
-
logger.logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
156
|
+
logger$1.logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
153
157
|
}
|
|
154
158
|
ApiEndpoint.setBaseUrl((_b = process.env.DYNAMIC_API_BASE_URL) !== null && _b !== void 0 ? _b : apiBaseUrl);
|
|
155
159
|
localStorage.LocalStorage.setSuffix(localStorageSuffix);
|
|
@@ -167,6 +171,12 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
167
171
|
const [showBridgeWidget, setShowBridgeWidget] = React.useState(false);
|
|
168
172
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = React.useState(false);
|
|
169
173
|
const [user, setUser, removeUser] = useLocalStorage.useLocalStorage(localStorage$1.AUTH_USER, EMPTY_INITIAL_USER, validators.validateAuthUser, [localStorage$1.AUTH_TOKEN]);
|
|
174
|
+
if (user) {
|
|
175
|
+
logger$1.logger.setMetaData('user', user);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
logger$1.logger.setMetaData('user', undefined);
|
|
179
|
+
}
|
|
170
180
|
const { consumeNonce } = useFetchNonce.useFetchNonce(environmentId);
|
|
171
181
|
const [qrcodeUri, setQrcodeUri] = React.useState('');
|
|
172
182
|
const [desktopUri, setDesktopUri] = React.useState('');
|
|
@@ -676,12 +686,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
676
686
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
677
687
|
isBridgeFlow,
|
|
678
688
|
isMultiWalletEnabled: multiWallet,
|
|
679
|
-
}), children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncEmbeddedWalletAuthFlow.SyncEmbeddedWalletAuthFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
689
|
+
}), children: [networkValidationMode === 'always' && jsxRuntime.jsx(UseNetworkValidation.UseNetworkValidation, {}), jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(PasskeyContext.PasskeyContextProvider, { children: jsxRuntime.jsx(VerificationContext.VerificationProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsx(UserFieldEditorContext.UserFieldEditorContextProvider, { children: jsxRuntime.jsx(ConnectWithOtpProvider.ConnectWithOtpProvider, { children: jsxRuntime.jsx(PhantomRedirectContext.PhantomRedirectContextProvider, { children: jsxRuntime.jsxs(SocialRedirectContext.SocialRedirectContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncEmbeddedWalletAuthFlow.SyncEmbeddedWalletAuthFlow, {}), confirmationModal, jsxRuntime.jsx(ErrorBoundaryExclude.ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
680
690
|
};
|
|
681
691
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
682
692
|
const DynamicContextProvider = (props) => {
|
|
693
|
+
logger.Logger.setEnvironmentId(props.settings.environmentId);
|
|
694
|
+
logger.Logger.setEmitErrors(props.emitErrors);
|
|
683
695
|
useParentDynamicContextGuard.useParentDynamicContextGuard();
|
|
684
|
-
return (jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(UserWalletsContext.UserWalletsProvider, { children: jsxRuntime.jsx(FieldsStateContext.FieldsStateProvider, { children: jsxRuntime.jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }));
|
|
696
|
+
return (jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(UserWalletsContext.UserWalletsProvider, { children: jsxRuntime.jsx(FieldsStateContext.FieldsStateProvider, { children: jsxRuntime.jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }) }));
|
|
685
697
|
};
|
|
686
698
|
|
|
687
699
|
exports.DynamicContext = DynamicContext;
|
|
@@ -82,6 +82,11 @@ export interface DynamicContextProps {
|
|
|
82
82
|
walletsFilter?: (options: WalletOption[]) => WalletOption[];
|
|
83
83
|
};
|
|
84
84
|
theme?: ThemeData | ThemeSetting;
|
|
85
|
+
/**
|
|
86
|
+
* Emit errors to Dynamic API for debugging purposes
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
emitErrors?: boolean;
|
|
85
90
|
}
|
|
86
91
|
export declare const DynamicContext: import("react").Context<IDynamicContext | undefined>;
|
|
87
92
|
/** The context provider itself we only use internally */
|
|
@@ -4,6 +4,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import { createContext, useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
5
5
|
import { I18nextProvider } from 'react-i18next';
|
|
6
6
|
import { getIconicSpriteUrl } from '@dynamic-labs/iconic';
|
|
7
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
7
8
|
import { MissingEnvironmentIdError } from '@dynamic-labs/utils';
|
|
8
9
|
import { useWalletBookCdn, getWalletBookCdnUrl, WalletBookContextProvider } from '@dynamic-labs/wallet-book';
|
|
9
10
|
import { logger as logger$1 } from '@dynamic-labs/wallet-connector-core';
|
|
@@ -106,6 +107,9 @@ import { FundingContextProvider } from '../FundingContext/FundingContext.js';
|
|
|
106
107
|
import { PhantomRedirectContextProvider } from '../PhantomRedirectContext/PhantomRedirectContext.js';
|
|
107
108
|
import { SendBalanceContextProvider } from '../SendBalanceContext/SendBalanceContext.js';
|
|
108
109
|
import { UseNetworkValidation } from '../UseNetworkValidation/UseNetworkValidation.js';
|
|
110
|
+
import { ErrorBoundary } from '../ErrorBoundary/ErrorBoundary.js';
|
|
111
|
+
import { ErrorBoundaryExclude } from '../ErrorBoundary/ErrorBoundaryExclude.js';
|
|
112
|
+
import '../ErrorBoundary/ErrorBoundaryBase.js';
|
|
109
113
|
import { resolveNetworkValidationMode, initExpirationTime, getInitialView, getDeepLinkPreference } from './helpers/helpers.js';
|
|
110
114
|
import { useDisplayOrderState } from './hooks/useDisplayOrderState/useDisplayOrderState.js';
|
|
111
115
|
import { useEmailLoginState } from './hooks/useEmailLoginState/useEmailLoginState.js';
|
|
@@ -163,6 +167,12 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
163
167
|
const [showBridgeWidget, setShowBridgeWidget] = useState(false);
|
|
164
168
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = useState(false);
|
|
165
169
|
const [user, setUser, removeUser] = useLocalStorage(AUTH_USER, EMPTY_INITIAL_USER, validateAuthUser, [AUTH_TOKEN]);
|
|
170
|
+
if (user) {
|
|
171
|
+
logger.setMetaData('user', user);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
logger.setMetaData('user', undefined);
|
|
175
|
+
}
|
|
166
176
|
const { consumeNonce } = useFetchNonce(environmentId);
|
|
167
177
|
const [qrcodeUri, setQrcodeUri] = useState('');
|
|
168
178
|
const [desktopUri, setDesktopUri] = useState('');
|
|
@@ -672,12 +682,14 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
672
682
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|
|
673
683
|
isBridgeFlow,
|
|
674
684
|
isMultiWalletEnabled: multiWallet,
|
|
675
|
-
}), children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(PasskeyContextProvider, { children: jsx(VerificationProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncEmbeddedWalletAuthFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
685
|
+
}), children: [networkValidationMode === 'always' && jsx(UseNetworkValidation, {}), jsx(CaptchaContextProvider, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(PasskeyContextProvider, { children: jsx(VerificationProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsx(UserFieldEditorContextProvider, { children: jsx(ConnectWithOtpProvider, { children: jsx(PhantomRedirectContextProvider, { children: jsxs(SocialRedirectContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncEmbeddedWalletAuthFlow, {}), confirmationModal, jsx(ErrorBoundaryExclude, { children: children })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }) }) }) }) }));
|
|
676
686
|
};
|
|
677
687
|
/** The context provider you need to have access too all of Dynamic's hooks */
|
|
678
688
|
const DynamicContextProvider = (props) => {
|
|
689
|
+
Logger.setEnvironmentId(props.settings.environmentId);
|
|
690
|
+
Logger.setEmitErrors(props.emitErrors);
|
|
679
691
|
useParentDynamicContextGuard();
|
|
680
|
-
return (jsx(ErrorContextProvider, { children: jsx(UserWalletsProvider, { children: jsx(FieldsStateProvider, { children: jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }));
|
|
692
|
+
return (jsx(ErrorBoundary, { children: jsx(ErrorContextProvider, { children: jsx(UserWalletsProvider, { children: jsx(FieldsStateProvider, { children: jsx(InnerDynamicContextProvider, Object.assign({}, props)) }) }) }) }));
|
|
681
693
|
};
|
|
682
694
|
|
|
683
695
|
export { DynamicContext, DynamicContextProvider, InnerDynamicContextProvider, PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
require('@dynamic-labs/sdk-api-core');
|
|
9
|
+
var logger = require('../../shared/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('../ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../utils/constants/values.cjs');
|
|
17
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('@dynamic-labs/utils');
|
|
19
|
+
require('../../shared/consts/index.cjs');
|
|
20
|
+
var ErrorBoundaryBase = require('./ErrorBoundaryBase.cjs');
|
|
21
|
+
var ErrorBoundaryContext = require('./ErrorBoundaryContext.cjs');
|
|
22
|
+
|
|
23
|
+
class ErrorBoundaryReporter extends ErrorBoundaryBase.ErrorBoundaryBase {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.state = { error: null, hasError: false };
|
|
27
|
+
}
|
|
28
|
+
componentDidCatch(error, info) {
|
|
29
|
+
var _a;
|
|
30
|
+
const { onError } = this.props;
|
|
31
|
+
if ((_a = this.context) === null || _a === void 0 ? void 0 : _a.isDynamicSdkError) {
|
|
32
|
+
onError === null || onError === void 0 ? void 0 : onError(error, info);
|
|
33
|
+
logger.logger.error(error, {
|
|
34
|
+
error: {
|
|
35
|
+
bundleStack: error.stack,
|
|
36
|
+
message: error,
|
|
37
|
+
stack: info.componentStack,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
const { children } = this.props;
|
|
45
|
+
const { hasError, error } = this.state;
|
|
46
|
+
if (hasError) {
|
|
47
|
+
ErrorBoundaryContext.assertErrorBoundaryContext(this.context);
|
|
48
|
+
this.context.error = error;
|
|
49
|
+
this.context.hasError = hasError;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return children;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const ErrorBoundary = (_a) => {
|
|
56
|
+
var { children } = _a, props = _tslib.__rest(_a, ["children"]);
|
|
57
|
+
return (jsxRuntime.jsx(ErrorBoundaryContext.ErrorBoundaryContext.Provider, { value: {
|
|
58
|
+
error: null,
|
|
59
|
+
hasError: false,
|
|
60
|
+
isDynamicSdkError: true,
|
|
61
|
+
}, children: jsxRuntime.jsx(ErrorBoundaryReporter, Object.assign({}, props, { children: children })) }));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __rest } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import { logger } from '../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import '../ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../utils/constants/colors.js';
|
|
12
|
+
import '../../utils/constants/values.js';
|
|
13
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import '@dynamic-labs/utils';
|
|
15
|
+
import '../../shared/consts/index.js';
|
|
16
|
+
import { ErrorBoundaryBase } from './ErrorBoundaryBase.js';
|
|
17
|
+
import { ErrorBoundaryContext, assertErrorBoundaryContext } from './ErrorBoundaryContext.js';
|
|
18
|
+
|
|
19
|
+
class ErrorBoundaryReporter extends ErrorBoundaryBase {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.state = { error: null, hasError: false };
|
|
23
|
+
}
|
|
24
|
+
componentDidCatch(error, info) {
|
|
25
|
+
var _a;
|
|
26
|
+
const { onError } = this.props;
|
|
27
|
+
if ((_a = this.context) === null || _a === void 0 ? void 0 : _a.isDynamicSdkError) {
|
|
28
|
+
onError === null || onError === void 0 ? void 0 : onError(error, info);
|
|
29
|
+
logger.error(error, {
|
|
30
|
+
error: {
|
|
31
|
+
bundleStack: error.stack,
|
|
32
|
+
message: error,
|
|
33
|
+
stack: info.componentStack,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const { children } = this.props;
|
|
41
|
+
const { hasError, error } = this.state;
|
|
42
|
+
if (hasError) {
|
|
43
|
+
assertErrorBoundaryContext(this.context);
|
|
44
|
+
this.context.error = error;
|
|
45
|
+
this.context.hasError = hasError;
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return children;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const ErrorBoundary = (_a) => {
|
|
52
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
53
|
+
return (jsx(ErrorBoundaryContext.Provider, { value: {
|
|
54
|
+
error: null,
|
|
55
|
+
hasError: false,
|
|
56
|
+
isDynamicSdkError: true,
|
|
57
|
+
}, children: jsx(ErrorBoundaryReporter, Object.assign({}, props, { children: children })) }));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { ErrorBoundary };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var logger = require('../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('../../utils/constants/colors.cjs');
|
|
15
|
+
require('../../utils/constants/values.cjs');
|
|
16
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('@dynamic-labs/utils');
|
|
18
|
+
require('../../shared/consts/index.cjs');
|
|
19
|
+
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
20
|
+
var ErrorBoundaryContext = require('./ErrorBoundaryContext.cjs');
|
|
21
|
+
|
|
22
|
+
class ErrorBoundaryBase extends React.Component {
|
|
23
|
+
static getDerivedStateFromError(error) {
|
|
24
|
+
return { error, hasError: true };
|
|
25
|
+
}
|
|
26
|
+
renderOrError(children, { isDynamicSdkError }) {
|
|
27
|
+
try {
|
|
28
|
+
ErrorBoundaryContext.assertErrorBoundaryContext(this.context);
|
|
29
|
+
this.context.isDynamicSdkError = isDynamicSdkError;
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
logger.logger.error(e);
|
|
33
|
+
return React.createElement(ErrorContainer.ErrorContainer, null, 'ErrorBoundary must be used within ErrorBoundaryContext');
|
|
34
|
+
}
|
|
35
|
+
return children;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
ErrorBoundaryBase.contextType = ErrorBoundaryContext.ErrorBoundaryContext;
|
|
39
|
+
|
|
40
|
+
exports.ErrorBoundaryBase = ErrorBoundaryBase;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, PropsWithChildren } from 'react';
|
|
2
|
+
import { ErrorBoundaryState } from './types';
|
|
3
|
+
import { ErrorBoundaryContext } from './ErrorBoundaryContext';
|
|
4
|
+
export declare abstract class ErrorBoundaryBase extends Component<PropsWithChildren<any>, ErrorBoundaryState> {
|
|
5
|
+
static contextType: import("react").Context<import("./types").ErrorBoundaryContextType | null>;
|
|
6
|
+
context: React.ContextType<typeof ErrorBoundaryContext>;
|
|
7
|
+
static getDerivedStateFromError(error: Error): {
|
|
8
|
+
error: Error;
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
};
|
|
11
|
+
renderOrError<T>(children: T, { isDynamicSdkError }: {
|
|
12
|
+
isDynamicSdkError: boolean;
|
|
13
|
+
}): T | JSX.Element;
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { Component, createElement } from 'react';
|
|
3
|
+
import '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { logger } from '../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '../../utils/constants/colors.js';
|
|
11
|
+
import '../../utils/constants/values.js';
|
|
12
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import '@dynamic-labs/utils';
|
|
14
|
+
import '../../shared/consts/index.js';
|
|
15
|
+
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
16
|
+
import { ErrorBoundaryContext, assertErrorBoundaryContext } from './ErrorBoundaryContext.js';
|
|
17
|
+
|
|
18
|
+
class ErrorBoundaryBase extends Component {
|
|
19
|
+
static getDerivedStateFromError(error) {
|
|
20
|
+
return { error, hasError: true };
|
|
21
|
+
}
|
|
22
|
+
renderOrError(children, { isDynamicSdkError }) {
|
|
23
|
+
try {
|
|
24
|
+
assertErrorBoundaryContext(this.context);
|
|
25
|
+
this.context.isDynamicSdkError = isDynamicSdkError;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger.error(e);
|
|
29
|
+
return createElement(ErrorContainer, null, 'ErrorBoundary must be used within ErrorBoundaryContext');
|
|
30
|
+
}
|
|
31
|
+
return children;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
ErrorBoundaryBase.contextType = ErrorBoundaryContext;
|
|
35
|
+
|
|
36
|
+
export { ErrorBoundaryBase };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
/* eslint-disable prefer-arrow/prefer-arrow-functions */
|
|
9
|
+
const ERROR_BOUNDARY_CONTEXT_NOT_FOUND = 'ERROR_BOUNDARY_CONTEXT_NOT_FOUND';
|
|
10
|
+
const ErrorBoundaryContext = React.createContext(null);
|
|
11
|
+
function assertErrorBoundaryContext(value) {
|
|
12
|
+
if (value === null ||
|
|
13
|
+
typeof value.hasError !== 'boolean' ||
|
|
14
|
+
typeof value.error !== 'object' ||
|
|
15
|
+
typeof value.isDynamicSdkError !== 'boolean') {
|
|
16
|
+
const error = new Error('ErrorBoundaryContext not found');
|
|
17
|
+
error.cause = ERROR_BOUNDARY_CONTEXT_NOT_FOUND;
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.ERROR_BOUNDARY_CONTEXT_NOT_FOUND = ERROR_BOUNDARY_CONTEXT_NOT_FOUND;
|
|
23
|
+
exports.ErrorBoundaryContext = ErrorBoundaryContext;
|
|
24
|
+
exports.assertErrorBoundaryContext = assertErrorBoundaryContext;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ErrorBoundaryContextType } from './types';
|
|
3
|
+
export declare const ERROR_BOUNDARY_CONTEXT_NOT_FOUND = "ERROR_BOUNDARY_CONTEXT_NOT_FOUND";
|
|
4
|
+
export declare const ErrorBoundaryContext: import("react").Context<ErrorBoundaryContextType | null>;
|
|
5
|
+
export declare function assertErrorBoundaryContext(value: any): asserts value is ErrorBoundaryContextType;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { createContext } from 'react';
|
|
3
|
+
|
|
4
|
+
/* eslint-disable prefer-arrow/prefer-arrow-functions */
|
|
5
|
+
const ERROR_BOUNDARY_CONTEXT_NOT_FOUND = 'ERROR_BOUNDARY_CONTEXT_NOT_FOUND';
|
|
6
|
+
const ErrorBoundaryContext = createContext(null);
|
|
7
|
+
function assertErrorBoundaryContext(value) {
|
|
8
|
+
if (value === null ||
|
|
9
|
+
typeof value.hasError !== 'boolean' ||
|
|
10
|
+
typeof value.error !== 'object' ||
|
|
11
|
+
typeof value.isDynamicSdkError !== 'boolean') {
|
|
12
|
+
const error = new Error('ErrorBoundaryContext not found');
|
|
13
|
+
error.cause = ERROR_BOUNDARY_CONTEXT_NOT_FOUND;
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { ERROR_BOUNDARY_CONTEXT_NOT_FOUND, ErrorBoundaryContext, assertErrorBoundaryContext };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var ErrorBoundaryBase = require('./ErrorBoundaryBase.cjs');
|
|
7
|
+
|
|
8
|
+
class ErrorBoundaryExclude extends ErrorBoundaryBase.ErrorBoundaryBase {
|
|
9
|
+
render() {
|
|
10
|
+
const { children } = this.props;
|
|
11
|
+
return this.renderOrError(children, {
|
|
12
|
+
isDynamicSdkError: false,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.ErrorBoundaryExclude = ErrorBoundaryExclude;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ErrorBoundaryBase } from './ErrorBoundaryBase.js';
|
|
3
|
+
|
|
4
|
+
class ErrorBoundaryExclude extends ErrorBoundaryBase {
|
|
5
|
+
render() {
|
|
6
|
+
const { children } = this.props;
|
|
7
|
+
return this.renderOrError(children, {
|
|
8
|
+
isDynamicSdkError: false,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ErrorBoundaryExclude };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var ErrorBoundaryBase = require('./ErrorBoundaryBase.cjs');
|
|
7
|
+
|
|
8
|
+
class ErrorBoundaryInclude extends ErrorBoundaryBase.ErrorBoundaryBase {
|
|
9
|
+
render() {
|
|
10
|
+
const { children } = this.props;
|
|
11
|
+
return this.renderOrError(children, {
|
|
12
|
+
isDynamicSdkError: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.ErrorBoundaryInclude = ErrorBoundaryInclude;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ErrorBoundaryBase } from './ErrorBoundaryBase.js';
|
|
3
|
+
|
|
4
|
+
class ErrorBoundaryInclude extends ErrorBoundaryBase {
|
|
5
|
+
render() {
|
|
6
|
+
const { children } = this.props;
|
|
7
|
+
return this.renderOrError(children, {
|
|
8
|
+
isDynamicSdkError: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ErrorBoundaryInclude };
|