@stytch/react 20.0.0-next.2 → 20.0.0-next.3
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 +6 -0
- package/dist/cjs/StytchSSRProxy-Bz6LNYdq.js.map +1 -1
- package/dist/cjs/adminPortal/index.cjs +1 -1
- package/dist/cjs/b2b/index.cjs +14 -13
- package/dist/cjs/b2b/index.cjs.map +1 -1
- package/dist/cjs/compat.cjs +2 -0
- package/dist/cjs/compat.cjs.map +1 -1
- package/dist/cjs/{index-Ni_dyEsz.js → index-BIjXBvf_.js} +2 -2
- package/dist/cjs/index-BIjXBvf_.js.map +1 -0
- package/dist/cjs/index.cjs +508 -518
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/{shadcn-B8TEzQMT.js → shadcn-Z4AvHriT.js} +247 -233
- package/dist/cjs/shadcn-Z4AvHriT.js.map +1 -0
- package/dist/cjs-dev/StytchSSRProxy-d553KgcY.js +438 -0
- package/dist/cjs-dev/StytchSSRProxy-d553KgcY.js.map +1 -0
- package/dist/cjs-dev/adminPortal/index.cjs +54 -53
- package/dist/cjs-dev/adminPortal/index.cjs.map +1 -1
- package/dist/cjs-dev/b2b/index.cjs +80 -68
- package/dist/cjs-dev/b2b/index.cjs.map +1 -1
- package/dist/cjs-dev/b2b/index.headless.cjs +89 -88
- package/dist/cjs-dev/b2b/index.headless.cjs.map +1 -1
- package/dist/cjs-dev/compat.cjs +15 -14
- package/dist/cjs-dev/compat.cjs.map +1 -1
- package/dist/cjs-dev/{StytchSSRProxy-CxXsyme4.js → dev-DaCGDI6V.js} +60 -426
- package/dist/cjs-dev/dev-DaCGDI6V.js.map +1 -0
- package/dist/cjs-dev/{idpHelpers-BVMUYvt1.js → idpHelpers-DOYYSxsX.js} +45 -102
- package/dist/cjs-dev/idpHelpers-DOYYSxsX.js.map +1 -0
- package/dist/cjs-dev/{index-DdK3Jt4u.js → index-rquGmIlv.js} +4 -4
- package/dist/cjs-dev/index-rquGmIlv.js.map +1 -0
- package/dist/cjs-dev/index.cjs +738 -727
- package/dist/cjs-dev/index.cjs.map +1 -1
- package/dist/cjs-dev/index.headless.cjs +70 -69
- package/dist/cjs-dev/index.headless.cjs.map +1 -1
- package/dist/cjs-dev/{passwordManagerDisableAutofillProps-D70WyvIu.js → passwordManagerDisableAutofillProps-CgiK2M_U.js} +2 -2
- package/dist/cjs-dev/{passwordManagerDisableAutofillProps-D70WyvIu.js.map → passwordManagerDisableAutofillProps-CgiK2M_U.js.map} +1 -1
- package/dist/cjs-dev/{shadcn-C9ClUju1.js → shadcn-DnNfms7-.js} +257 -242
- package/dist/cjs-dev/shadcn-DnNfms7-.js.map +1 -0
- package/dist/esm/b2b/StytchB2BContext.mjs +5 -5
- package/dist/esm/b2b/StytchB2BContext.mjs.map +1 -1
- package/dist/esm/packages/core/src/public/b2b/ui.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2b/App.mjs +2 -2
- package/dist/esm/packages/web/src/ui/b2b/App.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2b/components/Icons.mjs +3 -1
- package/dist/esm/packages/web/src/ui/b2b/components/Icons.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/AppContainer.mjs +1 -1
- package/dist/esm/packages/web/src/ui/b2c/AppContainer.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/IDPContainer.mjs +1 -1
- package/dist/esm/packages/web/src/ui/b2c/IDPContainer.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs +1 -1
- package/dist/esm/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/ResetPasswordContainer.mjs +1 -1
- package/dist/esm/packages/web/src/ui/b2c/ResetPasswordContainer.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs +12 -11
- package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs +12 -14
- package/dist/esm/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/compat/styleToTheme.mjs +2 -0
- package/dist/esm/packages/web/src/ui/compat/styleToTheme.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/components/PresentationConfig.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/components/atoms/Typography.module.css.mjs +2 -2
- package/dist/esm/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2b/Stytch.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2b/Stytch.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2b/StytchB2BContext.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2b/StytchB2BContext.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/IdentityProvider.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/IdentityProvider.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchContext.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchContext.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchLogin.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchLogin.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs +1 -1
- package/dist/esm/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs.map +1 -1
- package/dist/esm/packages/web/src/ui/react/utils/errors.mjs.map +1 -1
- package/dist/esm/packages/web/src/utils/crypto.mjs +15 -14
- package/dist/esm/packages/web/src/utils/crypto.mjs.map +1 -1
- package/dist/esm/packages/web/src/utils/oauthProviderType.mjs +1 -1
- package/dist/esm/packages/web/src/utils/oauthProviderType.mjs.map +1 -1
- package/dist/esm-dev/b2b/StytchB2BContext.mjs +5 -5
- package/dist/esm-dev/b2b/StytchB2BContext.mjs.map +1 -1
- package/dist/esm-dev/packages/core/src/public/b2b/ui.mjs.map +1 -1
- package/dist/esm-dev/packages/core/src/utils/dev.mjs +7 -1
- package/dist/esm-dev/packages/core/src/utils/dev.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/App.mjs +14 -2
- package/dist/esm-dev/packages/web/src/ui/b2b/App.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/components/Icons.mjs +3 -1
- package/dist/esm-dev/packages/web/src/ui/b2b/components/Icons.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/AppContainer.mjs +8 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/AppContainer.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/IDPContainer.mjs +8 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/IDPContainer.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs +8 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/PasskeyRegistrationContainer.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/ResetPasswordContainer.mjs +8 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/ResetPasswordContainer.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs +12 -11
- package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/SetupNewWallet.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs +12 -14
- package/dist/esm-dev/packages/web/src/ui/b2c/screens/Crypto/WalletButtons.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/compat/styleToTheme.mjs +15 -14
- package/dist/esm-dev/packages/web/src/ui/compat/styleToTheme.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/components/PresentationConfig.mjs +3 -2
- package/dist/esm-dev/packages/web/src/ui/components/PresentationConfig.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/components/atoms/Typography.module.css.mjs +2 -2
- package/dist/esm-dev/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2b/B2BIdentityProvider.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2b/Stytch.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2b/Stytch.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2b/StytchB2BContext.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2b/StytchB2BContext.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/IdentityProvider.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/IdentityProvider.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchContext.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchContext.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchLogin.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchLogin.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasskeyRegistration.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/b2c/StytchPasswordReset.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/ui/react/utils/errors.mjs +8 -4
- package/dist/esm-dev/packages/web/src/ui/react/utils/errors.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/utils/crypto.mjs +15 -14
- package/dist/esm-dev/packages/web/src/utils/crypto.mjs.map +1 -1
- package/dist/esm-dev/packages/web/src/utils/oauthProviderType.mjs +1 -1
- package/dist/esm-dev/packages/web/src/utils/oauthProviderType.mjs.map +1 -1
- package/dist/types/{PresentationConfig-Bqzf8zr3.d.ts → PresentationConfig-CcNEXkjS.d.ts} +5 -1
- package/dist/types/{StytchB2BClient-CsY7ZNKh.d.ts → StytchB2BClient-D16e_lp1.d.ts} +2 -2
- package/dist/types/{StytchClient-DZRM_fM4.d.ts → StytchClient-BwQdJzdj.d.ts} +2 -2
- package/dist/types/adminPortal/index.d.ts +5 -5
- package/dist/types/b2b/index.d.ts +27 -19
- package/dist/types/b2b/index.headless.d.ts +5 -5
- package/dist/types/compat.d.ts +2 -2
- package/dist/types/{createAuthUrlHandler-BZoD2LDF.d.ts → createAuthUrlHandler-R1kNNQD_.d.ts} +2 -2
- package/dist/types/{idpHelpers-CD5sSDzA.d.ts → idpHelpers-BQP76WgZ.d.ts} +1 -1
- package/dist/types/index.d.ts +36 -16
- package/dist/types/index.headless.d.ts +5 -5
- package/dist/types/{shadcn-4-5byj93.d.ts → shadcn-B04UXoBD.d.ts} +9 -6
- package/dist/types/{ui-DXrQ-gA8.d.ts → ui-B7IvSGQf.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-Ni_dyEsz.js.map +0 -1
- package/dist/cjs/shadcn-B8TEzQMT.js.map +0 -1
- package/dist/cjs-dev/StytchSSRProxy-CxXsyme4.js.map +0 -1
- package/dist/cjs-dev/idpHelpers-BVMUYvt1.js.map +0 -1
- package/dist/cjs-dev/index-DdK3Jt4u.js.map +0 -1
- package/dist/cjs-dev/shadcn-C9ClUju1.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","sources":["../../../../../../../../../web/src/ui/react/utils/errors.ts"],"sourcesContent":["// The strings in this file are only for developers\n/* eslint-disable lingui/no-unlocalized-strings */\n\nexport function serverRenderError(name: string) {\n
|
|
1
|
+
{"version":3,"file":"errors.mjs","sources":["../../../../../../../../../web/src/ui/react/utils/errors.ts"],"sourcesContent":["// The strings in this file are only for developers\n/* eslint-disable lingui/no-unlocalized-strings */\n\nimport { RUN_IN_DEV } from '@stytch/core';\n\nexport function serverRenderError(name: string) {\n RUN_IN_DEV(() => {\n if (typeof window === 'undefined') {\n throw new Error(\n `<${name} /> cannot be rendered on the server. If you are using Next.js, use the @stytch/nextjs package or 'use client' directives`,\n );\n }\n });\n}\n\nexport const noProviderError = (item: string, provider = 'StytchProvider'): string =>\n `${item} can only be used inside <${provider}>.`;\n\nexport const providerMustBeUniqueError = 'You cannot render a <StytchProvider> inside another <StytchProvider>.';\n\nexport const cannotInvokeMethodOnServerError = (path: string) =>\n process.env.NODE_ENV === 'production'\n ? `[Stytch] Invalid server-side function call to ${path}`\n : `[Stytch] Invalid server-side function call to ${path}.\nThe Stytch JavaScript SDK is intended to only be used on the client side.\nMake sure to wrap your API calls in a hook to ensure they are executed on the client.\n\n\\`\\`\\`\nconst myComponent = () => {\n const stytch = useStytch();\n // This will error out on the server.\n stytch.magicLinks.authenticate(...);\n useEffect(() => {\n // This will work well\n stytch.magicLinks.authenticate(...);\n }, []);\n}\n\\`\\`\\`\n\nIf you want to make API calls from server environments, please use the Stytch Node Library\nhttps://www.npmjs.com/package/stytch.`;\n"],"names":["noProviderError","item","provider","providerMustBeUniqueError","cannotInvokeMethodOnServerError","path"],"mappings":"AAAA;MAeaA,eAAAA,GAAkB,CAACC,IAAAA,EAAcC,WAAW,gBAAgB,GACvE,CAAA,EAAGD,IAAAA,CAAK,0BAA0B,EAAEC,QAAAA,CAAS,EAAE;AAE1C,MAAMC,4BAA4B;AAElC,MAAMC,+BAAAA,GAAkC,CAACC,IAAAA,GAE1C,CAAC,8CAA8C,EAAEA,IAAAA,CAAAA,CAAK;;;;"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import 'react';
|
|
2
1
|
import { b as bs58Exports } from '../../../../_virtual/index3.mjs';
|
|
2
|
+
import 'react';
|
|
3
3
|
import { GenericWalletIcon } from '../assets/genericWallet.mjs';
|
|
4
|
-
import '../
|
|
5
|
-
import { BinanceIcon } from '../assets/logo-color/Binance.mjs';
|
|
6
|
-
import { CoinbaseIcon } from '../assets/logo-color/Coinbase.mjs';
|
|
7
|
-
import { MetamaskIcon } from '../assets/logo-color/Metamask.mjs';
|
|
8
|
-
import { PhantomIcon } from '../assets/logo-color/Phantom.mjs';
|
|
4
|
+
import { usePresentation } from '../ui/components/PresentationConfig.mjs';
|
|
9
5
|
import { Wallets } from '../../../core/src/public/ui.mjs';
|
|
10
6
|
|
|
11
7
|
const hasMultipleEthereumWallets = ()=>!!window.ethereum?.providers;
|
|
@@ -15,13 +11,18 @@ const hasOtherEthereumWallet = ()=>!hasMetaMask() && !hasCoinbaseWallet() && !!w
|
|
|
15
11
|
const getMetaMaskProvider = ()=>hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet)=>wallet.isMetaMask) : window.ethereum;
|
|
16
12
|
const getCoinbaseProvider = ()=>hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet)=>wallet.isCoinbaseWallet) : window.ethereum;
|
|
17
13
|
const getOtherInjectedProvider = ()=>window.ethereum.providers?.find((wallet)=>!wallet.isCoinbaseWallet && !wallet.isMetaMask);
|
|
18
|
-
const
|
|
19
|
-
[Wallets.Phantom]:
|
|
20
|
-
[Wallets.Binance]:
|
|
21
|
-
[Wallets.Coinbase]:
|
|
22
|
-
[Wallets.Metamask]:
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
const walletIcons = {
|
|
15
|
+
[Wallets.Phantom]: 'phantom',
|
|
16
|
+
[Wallets.Binance]: 'binance',
|
|
17
|
+
[Wallets.Coinbase]: 'coinbase',
|
|
18
|
+
[Wallets.Metamask]: 'metamask'
|
|
19
|
+
};
|
|
20
|
+
const useCryptoIcon = ()=>{
|
|
21
|
+
const iconRegistry = usePresentation().iconRegistry;
|
|
22
|
+
return (wallet)=>{
|
|
23
|
+
const iconName = walletIcons[wallet];
|
|
24
|
+
return iconName ? iconRegistry[iconName] : GenericWalletIcon;
|
|
25
|
+
};
|
|
25
26
|
};
|
|
26
27
|
const WalletToText = {
|
|
27
28
|
[Wallets.Phantom]: {
|
|
@@ -167,5 +168,5 @@ const isSolanaWallet = (wallet)=>{
|
|
|
167
168
|
return solanaWallets.includes(wallet);
|
|
168
169
|
};
|
|
169
170
|
|
|
170
|
-
export {
|
|
171
|
+
export { WalletToText, connectWithWallet, isSolanaWallet, isWalletVisible, signMessageWithWallet, useCryptoIcon, walletIcons };
|
|
171
172
|
//# sourceMappingURL=crypto.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.mjs","sources":["../../../../../../../web/src/utils/crypto.tsx"],"sourcesContent":["import { MessageDescriptor } from '@lingui/core';\nimport { msg } from '@lingui/core/macro';\nimport * as React from 'react';\nimport { Wallets } from '@stytch/core/public';\nimport { encode } from 'bs58';\n\nimport { GenericWalletIcon } from '../assets';\nimport { PhantomIcon, MetamaskIcon, BinanceIcon, CoinbaseIcon } from '../assets/logo-color';\n\ntype ProviderRequest = ({\n method,\n params,\n}: {\n method: 'eth_requestAccounts' | 'personal_sign';\n params?: string[];\n}) => string[] | string;\n\ntype ETHProvider = {\n isMetaMask?: boolean;\n isCoinbaseWallet?: boolean;\n request: ProviderRequest;\n};\n\ndeclare global {\n interface Window {\n solana: {\n isPhantom?: boolean;\n connect: () => { publicKey: { toString: () => string } };\n request: ({\n method,\n params,\n }: {\n method: 'signMessage';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params: Record<string, any>;\n }) => { signature: Uint8Array };\n };\n\n ethereum: {\n isMetaMask?: boolean;\n isCoinbaseWallet?: boolean;\n request?: ({ method, params }: { method: string; params?: string[] }) => string[] | string;\n providers?: ETHProvider[];\n };\n\n BinanceChain: { request: ProviderRequest };\n }\n}\n\nconst hasMultipleEthereumWallets = () => !!window.ethereum?.providers;\n\nconst hasMetaMask = () =>\n !!(hasMultipleEthereumWallets()\n ? window.ethereum.providers?.find((wallet) => wallet.isMetaMask)\n : window.ethereum.isMetaMask);\n\nconst hasCoinbaseWallet = () =>\n !!(hasMultipleEthereumWallets()\n ? window.ethereum.providers?.find((wallet) => wallet.isCoinbaseWallet)\n : window.ethereum?.isCoinbaseWallet);\n\nconst hasOtherEthereumWallet = () => !hasMetaMask() && !hasCoinbaseWallet() && !!window.ethereum;\n\nconst getMetaMaskProvider = () =>\n hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet) => wallet.isMetaMask) : window.ethereum;\n\nconst getCoinbaseProvider = () =>\n hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet) => wallet.isCoinbaseWallet) : window.ethereum;\n\nconst getOtherInjectedProvider = () =>\n window.ethereum.providers?.find((wallet) => !wallet.isCoinbaseWallet && !wallet.isMetaMask);\n\nexport const WalletToIcon: Record<Wallets, React.FC> = {\n [Wallets.Phantom]: PhantomIcon,\n [Wallets.Binance]: BinanceIcon,\n [Wallets.Coinbase]: CoinbaseIcon,\n [Wallets.Metamask]: MetamaskIcon,\n [Wallets.GenericEthereumWallet]: GenericWalletIcon,\n [Wallets.GenericSolanaWallet]: GenericWalletIcon,\n};\n\nexport const WalletToText: Record<Wallets, MessageDescriptor> = {\n [Wallets.Phantom]: msg({ id: 'crypto.wallet.phantom', message: 'Phantom' }),\n [Wallets.Binance]: msg({ id: 'crypto.wallet.binance', message: 'Binance' }),\n [Wallets.Coinbase]: msg({ id: 'crypto.wallet.coinbase', message: 'Coinbase' }),\n [Wallets.Metamask]: msg({ id: 'crypto.wallet.metamask', message: 'Metamask' }),\n [Wallets.GenericEthereumWallet]: msg({ id: 'crypto.wallet.otherEthereum', message: 'Other Ethereum Wallet' }),\n [Wallets.GenericSolanaWallet]: msg({ id: 'crypto.wallet.otherSolana', message: 'Other Solana Wallet' }),\n};\n\nexport const isWalletVisible = (wallet: Wallets): boolean => {\n switch (wallet) {\n case Wallets.Metamask:\n return !!window.ethereum && hasMetaMask();\n case Wallets.Phantom:\n return (!!window.solana && window.solana?.isPhantom) ?? false;\n case Wallets.Binance:\n return !!window.BinanceChain;\n case Wallets.Coinbase:\n return !!window.ethereum && hasCoinbaseWallet();\n case Wallets.GenericEthereumWallet:\n return !!window.ethereum && hasOtherEthereumWallet();\n case Wallets.GenericSolanaWallet:\n return !!window.solana && !window.solana.isPhantom;\n default:\n return false;\n }\n};\n\nconst connectWithEthereumProvider = async (request: ProviderRequest): Promise<string> => {\n const [address] = await request({\n method: 'eth_requestAccounts',\n });\n return address;\n};\n\nexport const connectWithWallet = async ({ wallet }: { wallet: Wallets }): Promise<string> => {\n switch (wallet) {\n case Wallets.Metamask: {\n const provider = getMetaMaskProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.Phantom: {\n const connectResp = await window.solana.connect();\n return connectResp.publicKey.toString();\n }\n case Wallets.Binance: {\n const provider = window.BinanceChain;\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.Coinbase: {\n const provider = getCoinbaseProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.GenericEthereumWallet: {\n const provider = getOtherInjectedProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.GenericSolanaWallet: {\n const connectResp = await window.solana.connect();\n return connectResp.publicKey.toString();\n }\n default:\n return '';\n }\n};\n\nconst signMessageWithSolanaProvider = async (message: string): Promise<string> => {\n const encodedMessage = new TextEncoder().encode(message);\n const signResp = await window.solana.request({\n method: 'signMessage',\n params: {\n message: encodedMessage,\n display: 'utf8',\n },\n });\n return encode(signResp.signature);\n};\n\nconst signMessageWithEthereumProvider = async (\n request: ProviderRequest,\n message: string,\n address: string,\n): Promise<string> => {\n const signature = await request({\n method: 'personal_sign',\n params: [message, address],\n });\n return signature as string;\n};\n\nexport const signMessageWithWallet = async ({\n wallet,\n message,\n address,\n}: {\n wallet: Wallets;\n message: string;\n address: string;\n}): Promise<string> => {\n switch (wallet) {\n case Wallets.Phantom:\n case Wallets.GenericSolanaWallet:\n return signMessageWithSolanaProvider(message);\n case Wallets.Metamask: {\n const provider = getMetaMaskProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.Binance: {\n const provider = window.BinanceChain;\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.Coinbase: {\n const provider = getCoinbaseProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.GenericEthereumWallet: {\n const provider = getOtherInjectedProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n default:\n return '';\n }\n};\n\nexport const isSolanaWallet = (wallet: Wallets) => {\n const solanaWallets: Wallets[] = [Wallets.Phantom, Wallets.GenericSolanaWallet];\n return solanaWallets.includes(wallet);\n};\n\nexport const isEthereumWallet = (wallet: Wallets) => {\n const ethWallets: Wallets[] = [Wallets.Binance, Wallets.GenericEthereumWallet, Wallets.Coinbase, Wallets.Metamask];\n return ethWallets.includes(wallet);\n};\n"],"names":["hasMultipleEthereumWallets","window","ethereum","providers","hasMetaMask","find","wallet","isMetaMask","hasCoinbaseWallet","isCoinbaseWallet","hasOtherEthereumWallet","getMetaMaskProvider","getCoinbaseProvider","getOtherInjectedProvider","WalletToIcon","Wallets","Phantom","PhantomIcon","Binance","BinanceIcon","Coinbase","CoinbaseIcon","Metamask","MetamaskIcon","GenericEthereumWallet","GenericWalletIcon","GenericSolanaWallet","WalletToText","isWalletVisible","solana","isPhantom","BinanceChain","connectWithEthereumProvider","request","address","method","connectWithWallet","provider","connectResp","connect","publicKey","toString","signMessageWithSolanaProvider","message","encodedMessage","TextEncoder","encode","signResp","params","display","signature","signMessageWithEthereumProv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oB,KAAA;IAC/E,OAAO4B,aAAAA,CAAcC,QAAQ,CAACjD,MAAAA,CAAAA;AAChC;;;;"}
|
|
1
|
+
{"version":3,"file":"crypto.mjs","sources":["../../../../../../../web/src/utils/crypto.tsx"],"sourcesContent":["import { MessageDescriptor } from '@lingui/core';\nimport { msg } from '@lingui/core/macro';\nimport { Wallets } from '@stytch/core/public';\nimport { encode } from 'bs58';\n\nimport { GenericWalletIcon } from '../assets';\nimport { cryptoIcons } from '../ui/b2c/components/Icons';\nimport { IconRegistry } from '../ui/components/IconRegistry';\nimport { usePresentation } from '../ui/components/PresentationConfig';\n\ntype ProviderRequest = ({\n method,\n params,\n}: {\n method: 'eth_requestAccounts' | 'personal_sign';\n params?: string[];\n}) => string[] | string;\n\ntype ETHProvider = {\n isMetaMask?: boolean;\n isCoinbaseWallet?: boolean;\n request: ProviderRequest;\n};\n\ndeclare global {\n interface Window {\n solana: {\n isPhantom?: boolean;\n connect: () => { publicKey: { toString: () => string } };\n request: ({\n method,\n params,\n }: {\n method: 'signMessage';\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n params: Record<string, any>;\n }) => { signature: Uint8Array };\n };\n\n ethereum: {\n isMetaMask?: boolean;\n isCoinbaseWallet?: boolean;\n request?: ({ method, params }: { method: string; params?: string[] }) => string[] | string;\n providers?: ETHProvider[];\n };\n\n BinanceChain: { request: ProviderRequest };\n }\n}\n\nconst hasMultipleEthereumWallets = () => !!window.ethereum?.providers;\n\nconst hasMetaMask = () =>\n !!(hasMultipleEthereumWallets()\n ? window.ethereum.providers?.find((wallet) => wallet.isMetaMask)\n : window.ethereum.isMetaMask);\n\nconst hasCoinbaseWallet = () =>\n !!(hasMultipleEthereumWallets()\n ? window.ethereum.providers?.find((wallet) => wallet.isCoinbaseWallet)\n : window.ethereum?.isCoinbaseWallet);\n\nconst hasOtherEthereumWallet = () => !hasMetaMask() && !hasCoinbaseWallet() && !!window.ethereum;\n\nconst getMetaMaskProvider = () =>\n hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet) => wallet.isMetaMask) : window.ethereum;\n\nconst getCoinbaseProvider = () =>\n hasMultipleEthereumWallets() ? window.ethereum.providers?.find((wallet) => wallet.isCoinbaseWallet) : window.ethereum;\n\nconst getOtherInjectedProvider = () =>\n window.ethereum.providers?.find((wallet) => !wallet.isCoinbaseWallet && !wallet.isMetaMask);\n\ntype CryptoIcon = keyof typeof cryptoIcons;\nexport const walletIcons: Partial<Record<Wallets, CryptoIcon>> = {\n [Wallets.Phantom]: 'phantom',\n [Wallets.Binance]: 'binance',\n [Wallets.Coinbase]: 'coinbase',\n [Wallets.Metamask]: 'metamask',\n};\n\nexport const useCryptoIcon = () => {\n const iconRegistry: IconRegistry<CryptoIcon> = usePresentation().iconRegistry;\n return (wallet: Wallets) => {\n const iconName = walletIcons[wallet];\n return iconName ? iconRegistry[iconName] : GenericWalletIcon;\n };\n};\n\nexport const WalletToText: Record<Wallets, MessageDescriptor> = {\n [Wallets.Phantom]: msg({ id: 'crypto.wallet.phantom', message: 'Phantom' }),\n [Wallets.Binance]: msg({ id: 'crypto.wallet.binance', message: 'Binance' }),\n [Wallets.Coinbase]: msg({ id: 'crypto.wallet.coinbase', message: 'Coinbase' }),\n [Wallets.Metamask]: msg({ id: 'crypto.wallet.metamask', message: 'Metamask' }),\n [Wallets.GenericEthereumWallet]: msg({ id: 'crypto.wallet.otherEthereum', message: 'Other Ethereum Wallet' }),\n [Wallets.GenericSolanaWallet]: msg({ id: 'crypto.wallet.otherSolana', message: 'Other Solana Wallet' }),\n};\n\nexport const isWalletVisible = (wallet: Wallets): boolean => {\n switch (wallet) {\n case Wallets.Metamask:\n return !!window.ethereum && hasMetaMask();\n case Wallets.Phantom:\n return (!!window.solana && window.solana?.isPhantom) ?? false;\n case Wallets.Binance:\n return !!window.BinanceChain;\n case Wallets.Coinbase:\n return !!window.ethereum && hasCoinbaseWallet();\n case Wallets.GenericEthereumWallet:\n return !!window.ethereum && hasOtherEthereumWallet();\n case Wallets.GenericSolanaWallet:\n return !!window.solana && !window.solana.isPhantom;\n default:\n return false;\n }\n};\n\nconst connectWithEthereumProvider = async (request: ProviderRequest): Promise<string> => {\n const [address] = await request({\n method: 'eth_requestAccounts',\n });\n return address;\n};\n\nexport const connectWithWallet = async ({ wallet }: { wallet: Wallets }): Promise<string> => {\n switch (wallet) {\n case Wallets.Metamask: {\n const provider = getMetaMaskProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.Phantom: {\n const connectResp = await window.solana.connect();\n return connectResp.publicKey.toString();\n }\n case Wallets.Binance: {\n const provider = window.BinanceChain;\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.Coinbase: {\n const provider = getCoinbaseProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.GenericEthereumWallet: {\n const provider = getOtherInjectedProvider();\n return provider?.request ? connectWithEthereumProvider(provider?.request) : '';\n }\n case Wallets.GenericSolanaWallet: {\n const connectResp = await window.solana.connect();\n return connectResp.publicKey.toString();\n }\n default:\n return '';\n }\n};\n\nconst signMessageWithSolanaProvider = async (message: string): Promise<string> => {\n const encodedMessage = new TextEncoder().encode(message);\n const signResp = await window.solana.request({\n method: 'signMessage',\n params: {\n message: encodedMessage,\n display: 'utf8',\n },\n });\n return encode(signResp.signature);\n};\n\nconst signMessageWithEthereumProvider = async (\n request: ProviderRequest,\n message: string,\n address: string,\n): Promise<string> => {\n const signature = await request({\n method: 'personal_sign',\n params: [message, address],\n });\n return signature as string;\n};\n\nexport const signMessageWithWallet = async ({\n wallet,\n message,\n address,\n}: {\n wallet: Wallets;\n message: string;\n address: string;\n}): Promise<string> => {\n switch (wallet) {\n case Wallets.Phantom:\n case Wallets.GenericSolanaWallet:\n return signMessageWithSolanaProvider(message);\n case Wallets.Metamask: {\n const provider = getMetaMaskProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.Binance: {\n const provider = window.BinanceChain;\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.Coinbase: {\n const provider = getCoinbaseProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n case Wallets.GenericEthereumWallet: {\n const provider = getOtherInjectedProvider();\n return provider?.request ? signMessageWithEthereumProvider(provider?.request, message, address) : '';\n }\n default:\n return '';\n }\n};\n\nexport const isSolanaWallet = (wallet: Wallets) => {\n const solanaWallets: Wallets[] = [Wallets.Phantom, Wallets.GenericSolanaWallet];\n return solanaWallets.includes(wallet);\n};\n\nexport const isEthereumWallet = (wallet: Wallets) => {\n const ethWallets: Wallets[] = [Wallets.Binance, Wallets.GenericEthereumWallet, Wallets.Coinbase, Wallets.Metamask];\n return ethWallets.includes(wallet);\n};\n"],"names":["hasMultipleEthereumWallets","window","ethereum","providers","hasMetaMask","find","wallet","isMetaMask","hasCoinbaseWallet","isCoinbaseWallet","hasOtherEthereumWallet","getMetaMaskProvider","getCoinbaseProvider","getOtherInjectedProvider","walletIcons","Wallets","Phantom","Binance","Coinbase","Metamask","useCryptoIcon","iconRegistry","usePresentation","iconName","GenericWalletIcon","WalletToText","GenericEthereumWallet","GenericSolanaWallet","isWalletVisible","solana","isPhantom","BinanceChain","connectWithEthereumProvider","request","address","method","connectWithWallet","provider","connectResp","connect","publicKey","toString","signMessageWithSolanaProvider","message","encodedMessage","TextEncoder","encode","signResp","params","display","signature","signMessageWithEthereumProvider","signMessageWithWallet","isSolanaWallet","solanaWallets","includes"],"mappings":";;;;;;AAkDA,MAAMA,6BAA6B,IAAM,CAAC,CAACC,MAAAA,CAAOC,QAAQ,EAAEC,SAAAA;AAE5D,MAAMC,WAAAA,GAAc,IAClB,CAAC,EAAEJ,0BAAAA,EAAAA,GACCC,MAAAA,CAAOC,QAAQ,CAACC,SAAS,EAAEE,IAAAA,CAAK,CAACC,SAAWA,MAAAA,CAAOC,UAAU,IAC7DN,MAAAA,CAAOC,QAAQ,CAACK,UA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
11
11
|
} else {
|
|
12
12
|
providerType = provider.type;
|
|
13
|
-
if (provider.type === B2BOAuthProviders.Google &&
|
|
13
|
+
if (provider.type === B2BOAuthProviders.Google && provider.one_tap) {
|
|
14
14
|
oneTap = provider.one_tap;
|
|
15
15
|
cancelOnTapOutside = provider.cancel_on_tap_outside;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauthProviderType.mjs","sources":["../../../../../../../web/src/utils/oauthProviderType.ts"],"sourcesContent":["import { B2BOAuthProviderConfig, B2BOAuthProviders } from '@stytch/core/public';\n\nexport const getParamsFromB2BOAuthProviderConfig = (provider: B2BOAuthProviderConfig) => {\n let providerType: B2BOAuthProviders;\n let oneTap = false;\n let customScopes: string[] = [];\n let providerParams: Record<string, string> = {};\n let cancelOnTapOutside: boolean | undefined = undefined;\n if (typeof provider === 'string') {\n providerType = provider;\n } else {\n providerType = provider.type;\n if (provider.type === B2BOAuthProviders.Google &&
|
|
1
|
+
{"version":3,"file":"oauthProviderType.mjs","sources":["../../../../../../../web/src/utils/oauthProviderType.ts"],"sourcesContent":["import { B2BOAuthProviderConfig, B2BOAuthProviders } from '@stytch/core/public';\n\nexport const getParamsFromB2BOAuthProviderConfig = (provider: B2BOAuthProviderConfig) => {\n let providerType: B2BOAuthProviders;\n let oneTap = false;\n let customScopes: string[] = [];\n let providerParams: Record<string, string> = {};\n let cancelOnTapOutside: boolean | undefined = undefined;\n if (typeof provider === 'string') {\n providerType = provider;\n } else {\n providerType = provider.type;\n if (provider.type === B2BOAuthProviders.Google && provider.one_tap) {\n oneTap = provider.one_tap;\n cancelOnTapOutside = provider.cancel_on_tap_outside;\n }\n customScopes = provider.customScopes || [];\n providerParams = provider.providerParams || {};\n }\n return {\n type: providerType,\n one_tap: oneTap,\n customScopes,\n providerParams,\n cancel_on_tap_outside: cancelOnTapOutside,\n };\n};\n"],"names":["getParamsFromB2BOAuthProviderConfig","provider","providerType","oneTap","customScopes","providerParams","cancelOnTapOutside","undefined","type","B2BOAuthProviders","Google","one_tap","cancel_on_tap_outside"],"mappings":";;AAEO,MAAMA,sCAAsC,CAACC,QAAAA,GAAAA;IAClD,IAAIC,YAAAA;AACJ,IAAA,IAAIC,MAAAA,GAAS,KAAA;AACb,IAAA,IAAIC,eAAyB,EAAE;AAC/B,IAAA,IAAIC,iBAAyC,EAAC;AAC9C,IAAA,IAAIC,kBAAAA,GAA0CC,SAAAA;IAC9C,IAAI,OAAON,aAAa,QAAA,EAAU;QAChCC,YAAAA,GAAeD,QAAAA;IACjB,CAAA,MAAO;AACLC,QAAAA,YAAAA,GAAeD,SAASO,IAAI;QAC5B,IAAIP,QAAAA,CAASO,IAAI,KAAKC,iBAAAA,CAAkBC,MAAM,IAAIT,QAAAA,CAASU,OAAO,EAAE;AAClER,YAAAA,MAAAA,GAASF,SAASU,OAAO;AACzBL,YAAAA,kBAAAA,GAAqBL,SAASW,qBAAqB;AACrD,QAAA;QACAR,YAAAA,GAAeH,QAAAA,CAASG,YAAY,IAAI,EAAE;QAC1CC,cAAAA,GAAiBJ,QAAAA,CAASI,cAAc,IAAI,EAAC;AAC/C,IAAA;IACA,OAAO;QACLG,IAAAA,EAAMN,YAAAA;QACNS,OAAAA,EAASR,MAAAA;AACTC,QAAAA,YAAAA;AACAC,QAAAA,cAAAA;QACAO,qBAAAA,EAAuBN;AACzB,KAAA;AACF;;;;"}
|
|
@@ -10,7 +10,7 @@ export { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '
|
|
|
10
10
|
* @example
|
|
11
11
|
* const {member, isInitialized, fromCache} = useStytchMember();
|
|
12
12
|
* if (!isInitialized) {
|
|
13
|
-
*
|
|
13
|
+
* return <p>Loading...</p>;
|
|
14
14
|
* }
|
|
15
15
|
* return (<h1>Welcome, {member.name}</h1>);
|
|
16
16
|
*/ const useStytchMember = useStytchMember$1;
|
|
@@ -26,7 +26,7 @@ export { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '
|
|
|
26
26
|
* return;
|
|
27
27
|
* }
|
|
28
28
|
* if (!session) {
|
|
29
|
-
* router.replace('/login')
|
|
29
|
+
* router.replace('/login');
|
|
30
30
|
* }
|
|
31
31
|
* }, [session, isInitialized]);
|
|
32
32
|
*/ const useStytchMemberSession = useStytchMemberSession$1;
|
|
@@ -38,9 +38,9 @@ export { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '
|
|
|
38
38
|
* @example
|
|
39
39
|
* const {organization, isInitialized, fromCache} = useStytchOrganization();
|
|
40
40
|
* if (!isInitialized) {
|
|
41
|
-
*
|
|
41
|
+
* return <p>Loading...</p>;
|
|
42
42
|
* }
|
|
43
|
-
* return
|
|
43
|
+
* return <p>Welcome to {organization.organization_name}</p>;
|
|
44
44
|
*/ const useStytchOrganization = useStytchOrganization$1;
|
|
45
45
|
/**
|
|
46
46
|
* Determines whether the logged-in member is allowed to perform the specified action on the specified resource.
|
|
@@ -51,7 +51,7 @@ export { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '
|
|
|
51
51
|
*
|
|
52
52
|
* Remember - authorization checks for sensitive actions should always occur on the backend as well.
|
|
53
53
|
* @example
|
|
54
|
-
* const { isAuthorized } = useStytchIsAuthorized
|
|
54
|
+
* const { isAuthorized } = useStytchIsAuthorized('documents', 'edit');
|
|
55
55
|
* return <button disabled={!isAuthorized}>Edit</button>
|
|
56
56
|
*/ const useStytchIsAuthorized = useStytchIsAuthorized$1;
|
|
57
57
|
const withStytchMember = withStytchMember$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StytchB2BContext.mjs","sources":["../../../src/b2b/StytchB2BContext.tsx"],"sourcesContent":["'use client';\n\nimport React, { ComponentType, ReactNode } from 'react';\n\nimport type { Member, MemberSession, Organization, StytchProjectConfigurationInput } from '@stytch/web/b2b';\nimport { StytchB2BClient } from '@stytch/web/b2b/headless';\n\nexport { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '@stytch/web/react/b2b';\n\nimport {\n StytchB2BProvider as StytchB2BProviderShared,\n useStytchIsAuthorized as useStytchIsAuthorizedShared,\n useStytchMemberSession as useStytchMemberSessionShared,\n useStytchMember as useStytchMemberShared,\n useStytchOrganization as useStytchOrganizationShared,\n withStytchMemberSession as withStytchMemberSessionShared,\n withStytchMember as withStytchMemberShared,\n withStytchOrganization as withStytchOrganizationShared,\n} from '@stytch/web/react/b2b';\n\n/**\n * Returns the active Member.\n * The Stytch SDKs are used for client-side authentication and session management.\n * Check the isInitialized property to determine if the SDK has completed initialization.\n * Check the fromCache property to determine if the member data is from persistent storage.\n * @example\n * const {member, isInitialized, fromCache} = useStytchMember();\n * if (!isInitialized) {\n *
|
|
1
|
+
{"version":3,"file":"StytchB2BContext.mjs","sources":["../../../src/b2b/StytchB2BContext.tsx"],"sourcesContent":["'use client';\n\nimport React, { ComponentType, ReactNode } from 'react';\n\nimport type { Member, MemberSession, Organization, StytchProjectConfigurationInput } from '@stytch/web/b2b';\nimport { StytchB2BClient } from '@stytch/web/b2b/headless';\n\nexport { useStytchB2BClient, withStytchB2BClient, withStytchPermissions } from '@stytch/web/react/b2b';\n\nimport {\n StytchB2BProvider as StytchB2BProviderShared,\n useStytchIsAuthorized as useStytchIsAuthorizedShared,\n useStytchMemberSession as useStytchMemberSessionShared,\n useStytchMember as useStytchMemberShared,\n useStytchOrganization as useStytchOrganizationShared,\n withStytchMemberSession as withStytchMemberSessionShared,\n withStytchMember as withStytchMemberShared,\n withStytchOrganization as withStytchOrganizationShared,\n} from '@stytch/web/react/b2b';\n\n/**\n * Returns the active Member.\n * The Stytch SDKs are used for client-side authentication and session management.\n * Check the isInitialized property to determine if the SDK has completed initialization.\n * Check the fromCache property to determine if the member data is from persistent storage.\n * @example\n * const {member, isInitialized, fromCache} = useStytchMember();\n * if (!isInitialized) {\n * return <p>Loading...</p>;\n * }\n * return (<h1>Welcome, {member.name}</h1>);\n */\nexport const useStytchMember = useStytchMemberShared as <TAssumeHydrated extends boolean = true>() => ReturnType<\n typeof useStytchMemberShared<TAssumeHydrated>\n>;\n\n/**\n * Returns the active member's Stytch member session.\n * The Stytch SDKs are used for client-side authentication and session management.\n * Check the isInitialized property to determine if the SDK has completed initialization.\n * Check the fromCache property to determine if the session data is from persistent storage.\n * @example\n * const {session, isInitialized, fromCache} = useStytchMemberSession();\n * useEffect(() => {\n * if (!isInitialized) {\n * return;\n * }\n * if (!session) {\n * router.replace('/login');\n * }\n * }, [session, isInitialized]);\n */\nexport const useStytchMemberSession = useStytchMemberSessionShared as <\n TAssumeHydrated extends boolean = true,\n>() => ReturnType<typeof useStytchMemberSessionShared<TAssumeHydrated>>;\n\n/**\n * Returns the active Stytch organization.\n * The Stytch SDKs are used for client-side authentication and session management.\n * Check the isInitialized property to determine if the SDK has completed initialization.\n * Check the fromCache property to determine if the organization data is from persistent storage.\n * @example\n * const {organization, isInitialized, fromCache} = useStytchOrganization();\n * if (!isInitialized) {\n * return <p>Loading...</p>;\n * }\n * return <p>Welcome to {organization.organization_name}</p>;\n */\nexport const useStytchOrganization = useStytchOrganizationShared as <\n TAssumeHydrated extends boolean = true,\n>() => ReturnType<typeof useStytchOrganizationShared<TAssumeHydrated>>;\n\n/**\n * Determines whether the logged-in member is allowed to perform the specified action on the specified resource.\n * Returns `true` if the member can perform the action, `false` otherwise.\n *\n * If the member is not logged in, this method will always return false.\n * If the resource or action provided are not valid for the configured RBAC policy, this method will return false.\n *\n * Remember - authorization checks for sensitive actions should always occur on the backend as well.\n * @example\n * const { isAuthorized } = useStytchIsAuthorized('documents', 'edit');\n * return <button disabled={!isAuthorized}>Edit</button>\n */\nexport const useStytchIsAuthorized = useStytchIsAuthorizedShared as <TAssumeHydrated extends boolean = false>(\n resourceId: string,\n action: string,\n) => ReturnType<typeof useStytchIsAuthorizedShared<TAssumeHydrated>>;\n\nexport const withStytchMember = withStytchMemberShared as <T extends object, TAssumeHydrated extends boolean = false>(\n Component: ComponentType<\n T & { stytchMember: Member | null; stytchMemberIsInitialized: boolean; stytchMemberIsFromCache: boolean }\n >,\n) => ReturnType<typeof withStytchMemberShared<T, TAssumeHydrated>>;\n\nexport const withStytchMemberSession = withStytchMemberSessionShared as <\n T extends object,\n TAssumeHydrated extends boolean = false,\n>(\n Component: ComponentType<\n T & {\n stytchMemberSession: MemberSession | null;\n stytchMemberSessionIsInitialized: boolean;\n stytchMemberSessionIsFromCache: boolean;\n }\n >,\n) => ReturnType<typeof withStytchMemberSessionShared<T, TAssumeHydrated>>;\n\nexport const withStytchOrganization = withStytchOrganizationShared as <\n T extends object,\n TAssumeHydrated extends boolean = false,\n>(\n Component: ComponentType<\n T & {\n stytchOrganization: Organization | null;\n stytchOrganizationIsInitialized: boolean;\n stytchOrganizationIsFromCache: boolean;\n }\n >,\n) => ReturnType<typeof withStytchOrganizationShared<T, TAssumeHydrated>>;\n\nexport interface StytchB2BProviderProps<\n TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n> {\n /**\n * A Stytch client instance, a {@link StytchB2BClient}\n */\n stytch: StytchB2BClient<TProjectConfiguration>;\n /**\n * When true, the provider will assume that the component will only be\n * rendered in a browser environment, either in a single-page application or\n * after completing hydration of a server-rendered application. This allows\n * cached values to be retrieved from the browser on the first render, meaning\n * that the `isInitialized` value returned from Stytch hooks will be `true`\n * starting from the first render.\n *\n * When `false`, the provider will defer initialization until after the first\n * render, and `isInitialized` will initially be `false`.\n *\n * If you encounter hydration errors relating to the use of this component,\n * set this to `false`.\n *\n * This value defaults to `true` in `@stytch/react`.\n */\n assumeHydrated?: boolean;\n children?: ReactNode;\n}\n\n/**\n * The Stytch Context Provider.\n * Wrap your application with this component in order to use Stytch everywhere in your app.\n * @example\n * const stytch = createStytchB2BClient('public-token-<find yours in the stytch dashboard>')\n *\n * ReactDOM.render(\n * <StytchB2BProvider stytch={stytch}>\n * <App />\n * </StytchProvider>,\n * document.getElementById('root'),\n * )\n */\nexport const StytchB2BProvider = <\n TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration,\n>({\n stytch,\n children,\n assumeHydrated = true,\n}: StytchB2BProviderProps<TProjectConfiguration>): JSX.Element => (\n <StytchB2BProviderShared stytch={stytch} assumeHydrated={assumeHydrated}>\n {children}\n </StytchB2BProviderShared>\n);\n"],"names":["useStytchMember","useStytchMemberShared","useStytchMemberSession","useStytchMemberSessionShared","useStytchOrganization","useStytchOrganizationShared","useStytchIsAuthorized","useStytchIsAuthorizedShared","withStytchMember","withStytchMemberShared","withStytchMemberSession","withStytchMemberSessionShared","withStytchOrganization","withStytchOrganizationShared","StytchB2BProvider","stytch","children","assumeHydrated","React","StytchB2BProviderShared"],"mappings":";;;;AAoBA;;;;;;;;;;;IAYO,MAAMA,eAAAA,GAAkBC;AAI/B;;;;;;;;;;;;;;;IAgBO,MAAMC,sBAAAA,GAAyBC;AAItC;;;;;;;;;;;IAYO,MAAMC,qBAAAA,GAAwBC;AAIrC;;;;;;;;;;;IAYO,MAAMC,qBAAAA,GAAwBC;AAK9B,MAAMC,mBAAmBC;AAMzB,MAAMC,0BAA0BC;AAahC,MAAMC,yBAAyBC;AAwCtC;;;;;;;;;;;;AAYC,IACM,MAAMC,iBAAAA,GAAoB,CAE/B,EACAC,MAAM,EACNC,QAAQ,EACRC,cAAAA,GAAiB,IAAI,EACyB,iBAC9CC,cAAA,CAAA,aAAA,CAACC,mBAAAA,EAAAA;QAAwBJ,MAAAA,EAAQA,MAAAA;QAAQE,cAAAA,EAAgBA;OACtDD,QAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.mjs","sources":["../../../../../../../../core/src/public/b2b/ui.ts"],"sourcesContent":["import { Values } from '../../utils';\n\n/**\n * The authentication methods we support through our UI.\n * Currently we support `emailMagicLinks`, `emailOtp`, `sso`, `passwords`, and `oauth`.\n */\n\nexport const AuthFlowType = {\n Discovery: 'Discovery',\n Organization: 'Organization',\n PasswordReset: 'PasswordReset',\n} as const;\n\nexport type AuthFlowType = Values<typeof AuthFlowType>;\n\nexport const RedirectURLType = {\n ResetPassword: 'reset_password',\n} as const;\n\nexport type RedirectURLType = Values<typeof RedirectURLType>;\n\n/**\n * The OAuth providers we support in our B2B OAuth product.\n */\nexport const B2BOAuthProviders = {\n Google: 'google',\n Microsoft: 'microsoft',\n HubSpot: 'hubspot',\n Slack: 'slack',\n GitHub: 'github',\n} as const;\nexport type B2BOAuthProviders = Values<typeof B2BOAuthProviders>;\n\n/**\n * The options for email magic links. This is used if you've enabled the `emailMagicLinks` product\n * in your configuration.\n */\n\nexport type B2BEmailMagicLinksOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n discoveryRedirectURL?: string;\n loginTemplateId?: string;\n signupTemplateId?: string;\n /**\n * @param domainHint - An optional hint indicating what domain the email will be sent from.\n * This field is only required if your project uses more than one custom domain to send emails.\n */\n domainHint?: string;\n locale?: string;\n};\n\n/**\n * The options for SSO. This is used if you've enabled the `sso` product\n * in your configuration.\n */\n\nexport type B2BSSOOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n};\n\n/**\n * The options for OAuth. This is required if you've enabled the `oauth` product\n * in your configuration.\n */\n\nexport type B2BOAuthOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n discoveryRedirectURL?: string;\n /** @deprecated Use customScopes in B2BOAuthProviderConfig instead */\n customScopes?: string[];\n providers: B2BOAuthProviderConfig[];\n /** @deprecated Use providerParams in B2BOAuthProviderConfig instead */\n providerParams?: Record<string, string>;\n locale?: string;\n};\n\n/**\n * Details about the OAuth provider you wish to use. Each B2BOAuthProviderConfig object can be either a plain\n * B2BOAuthProviders string (e.g. 'google'), or an object with a type key that determines the type of provider. For\n * Google OAuth, you can optionally specify the one_tap property to display Google One Tap.\n */\nexport type B2BOAuthProviderConfig =\n | B2BOAuthProviders\n | {\n type: typeof B2BOAuthProviders.Google;\n customScopes?: string[];\n providerParams?: Record<string, string>;\n\n one_tap
|
|
1
|
+
{"version":3,"file":"ui.mjs","sources":["../../../../../../../../core/src/public/b2b/ui.ts"],"sourcesContent":["import { Values } from '../../utils';\n\n/**\n * The authentication methods we support through our UI.\n * Currently we support `emailMagicLinks`, `emailOtp`, `sso`, `passwords`, and `oauth`.\n */\n\nexport const AuthFlowType = {\n Discovery: 'Discovery',\n Organization: 'Organization',\n PasswordReset: 'PasswordReset',\n} as const;\n\nexport type AuthFlowType = Values<typeof AuthFlowType>;\n\nexport const RedirectURLType = {\n ResetPassword: 'reset_password',\n} as const;\n\nexport type RedirectURLType = Values<typeof RedirectURLType>;\n\n/**\n * The OAuth providers we support in our B2B OAuth product.\n */\nexport const B2BOAuthProviders = {\n Google: 'google',\n Microsoft: 'microsoft',\n HubSpot: 'hubspot',\n Slack: 'slack',\n GitHub: 'github',\n} as const;\nexport type B2BOAuthProviders = Values<typeof B2BOAuthProviders>;\n\n/**\n * The options for email magic links. This is used if you've enabled the `emailMagicLinks` product\n * in your configuration.\n */\n\nexport type B2BEmailMagicLinksOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n discoveryRedirectURL?: string;\n loginTemplateId?: string;\n signupTemplateId?: string;\n /**\n * @param domainHint - An optional hint indicating what domain the email will be sent from.\n * This field is only required if your project uses more than one custom domain to send emails.\n */\n domainHint?: string;\n locale?: string;\n};\n\n/**\n * The options for SSO. This is used if you've enabled the `sso` product\n * in your configuration.\n */\n\nexport type B2BSSOOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n};\n\n/**\n * The options for OAuth. This is required if you've enabled the `oauth` product\n * in your configuration.\n */\n\nexport type B2BOAuthOptions = {\n loginRedirectURL?: string;\n signupRedirectURL?: string;\n discoveryRedirectURL?: string;\n /** @deprecated Use customScopes in B2BOAuthProviderConfig instead */\n customScopes?: string[];\n providers: B2BOAuthProviderConfig[];\n /** @deprecated Use providerParams in B2BOAuthProviderConfig instead */\n providerParams?: Record<string, string>;\n locale?: string;\n};\n\n/**\n * Details about the OAuth provider you wish to use. Each B2BOAuthProviderConfig object can be either a plain\n * B2BOAuthProviders string (e.g. 'google'), or an object with a type key that determines the type of provider. For\n * Google OAuth, you can optionally specify the one_tap property to display Google One Tap.\n */\nexport type B2BOAuthProviderConfig =\n | B2BOAuthProviders\n | {\n type: typeof B2BOAuthProviders.Google;\n customScopes?: string[];\n providerParams?: Record<string, string>;\n\n one_tap?: boolean;\n /**\n * Whether to cancel the One Tap prompt when the user taps outside of it.\n * This is only applicable if one_tap is true.\n */\n cancel_on_tap_outside?: boolean;\n }\n | {\n type: Exclude<B2BOAuthProviders, typeof B2BOAuthProviders.Google>;\n customScopes?: string[];\n providerParams?: Record<string, string>;\n };\n\n/**\n * The options for Passwords. This is used if you've enabled the `passwords` product\n * in your configuration.\n */\n\nexport type B2BPasswordOptions = {\n loginRedirectURL?: string;\n resetPasswordRedirectURL?: string;\n resetPasswordExpirationMinutes?: number;\n resetPasswordTemplateId?: string;\n discoveryRedirectURL?: string;\n verifyEmailTemplateId?: string;\n locale?: string;\n};\n\nexport type B2BEmailOTPOptions = {\n loginTemplateId?: string;\n signupTemplateId?: string;\n locale?: string;\n};\n\nexport type B2BSMSOTPOptions = {\n locale?: string;\n};\n\nexport type DirectLoginForSingleMembershipConfig = {\n /**\n * Whether or not direct login for single membership is enabled.\n */\n status: boolean;\n /**\n * If enabled, logs user in directly even if they have pending invite to a different organization\n */\n ignoreInvites: boolean;\n /**\n * If enabled, logs user in directly even if they have organizations they could join via JIT provisioning\n */\n ignoreJitProvisioning: boolean;\n};\n\nexport const B2BMFAProducts = {\n smsOtp: 'smsOtp',\n totp: 'totp',\n} as const;\nexport type B2BMFAProducts = Values<typeof B2BMFAProducts>;\n"],"names":["AuthFlowType","Discovery","Organization","PasswordReset","RedirectURLType","ResetPassword","B2BOAuthProviders","Google","Microsoft","HubSpot","Slack","GitHub","B2BMFAProducts","smsOtp","totp"],"mappings":"AAEA;;;UAKaA,YAAAA,GAAe;IAC1BC,SAAAA,EAAW,WAAA;IACXC,YAAAA,EAAc,cAAA;IACdC,aAAAA,EAAe;AACjB;MAIaC,eAAAA,GAAkB;IAC7BC,aAAAA,EAAe;AACjB;AAIA;;UAGaC,iBAAAA,GAAoB;IAC/BC,MAAAA,EAAQ,QAAA;IACRC,SAAAA,EAAW,WAAA;IACXC,OAAAA,EAAS,SAAA;IACTC,KAAAA,EAAO,OAAA;IACPC,MAAAA,EAAQ;AACV;MAkHaC,cAAAA,GAAiB;IAC5BC,MAAAA,EAAQ,QAAA;IACRC,IAAAA,EAAM;AACR;;;;"}
|
|
@@ -5,6 +5,12 @@ import { StytchSDKUsageError } from '../public/SDKErrors.mjs';
|
|
|
5
5
|
* NOTE: Be careful when wrapping render function return values. React before v18 do not allow undefined
|
|
6
6
|
* to be returned, so wrapping the entire return value will crash those runtimes.
|
|
7
7
|
*/ const DEV = (input)=>input;
|
|
8
|
+
/**
|
|
9
|
+
* This function is stripped in production builds using rollup plugin. Useful for adding
|
|
10
|
+
* logging or validation in dev only
|
|
11
|
+
*/ function RUN_IN_DEV(callback) {
|
|
12
|
+
callback();
|
|
13
|
+
}
|
|
8
14
|
const validateInDev = (methodName, obj, rules)=>{
|
|
9
15
|
const errors = [];
|
|
10
16
|
for (const [key, rule] of Object.entries(rules)){
|
|
@@ -56,5 +62,5 @@ const validateInDev = (methodName, obj, rules)=>{
|
|
|
56
62
|
}
|
|
57
63
|
};
|
|
58
64
|
|
|
59
|
-
export { DEV, validateInDev };
|
|
65
|
+
export { DEV, RUN_IN_DEV, validateInDev };
|
|
60
66
|
//# sourceMappingURL=dev.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.mjs","sources":["../../../../../../../core/src/utils/dev.ts"],"sourcesContent":["import { StytchSDKUsageError } from '../public';\n\n/**\n * This function and its parameter is stripped in production builds using rollup plugin.\n * NOTE: Be careful when wrapping render function return values. React before v18 do not allow undefined\n * to be returned, so wrapping the entire return value will crash those runtimes.\n */\nexport const DEV = <T>(input: T): T | undefined => input;\n\nexport type ValidateRule =\n | 'object'\n | 'optionalObject'\n | 'string'\n | 'optionalString'\n | 'number'\n | 'optionalNumber'\n | 'stringArray'\n | 'optionalStringArray'\n | 'boolean'\n | 'optionalBoolean';\n\nexport const validateInDev = <T extends Record<string, unknown>>(\n methodName: string,\n obj: T,\n rules: Partial<Record<keyof T, ValidateRule>>,\n) => {\n const errors: StytchSDKUsageError[] = [];\n for (const [key, rule] of Object.entries(rules)) {\n if (rule == null) continue;\n\n const val = obj[key];\n if (rule.startsWith('optional') && val == null) continue;\n\n switch (rule) {\n case 'object':\n case 'optionalObject': {\n const isObject = typeof val === 'object' && !Array.isArray(val) && val !== null;\n if (!isObject) {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be an object.`));\n }\n break;\n }\n\n case 'string':\n case 'optionalString':\n if (typeof val !== 'string') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a string.`));\n }\n break;\n\n case 'number':\n case 'optionalNumber':\n if (typeof val !== 'number') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a number.`));\n }\n break;\n\n case 'stringArray':\n case 'optionalStringArray':\n if (!Array.isArray(val) || !val.every((str) => typeof str === 'string')) {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be an array of strings.`));\n }\n break;\n\n case 'boolean':\n case 'optionalBoolean':\n if (typeof val !== 'boolean') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a boolean.`));\n }\n break;\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n throw new AggregateError(errors);\n }\n }\n};\n"],"names":["DEV","input","validateInDev","methodName","obj","rules","errors","key","rule","Object","entries","val","startsWith","isObject","Array","isArray","push","StytchSDKUsageError","every","str","length","AggregateError"],"mappings":";;AAEA;;;;AAIC,IACM,MAAMA,GAAAA,GAAM,CAAIC,QAA4BA;
|
|
1
|
+
{"version":3,"file":"dev.mjs","sources":["../../../../../../../core/src/utils/dev.ts"],"sourcesContent":["import { StytchSDKUsageError } from '../public';\n\n/**\n * This function and its parameter is stripped in production builds using rollup plugin.\n * NOTE: Be careful when wrapping render function return values. React before v18 do not allow undefined\n * to be returned, so wrapping the entire return value will crash those runtimes.\n */\nexport const DEV = <T>(input: T): T | undefined => input;\n\n/**\n * This function is stripped in production builds using rollup plugin. Useful for adding\n * logging or validation in dev only\n */\nexport function RUN_IN_DEV(callback: () => void) {\n callback();\n}\n\nexport type ValidateRule =\n | 'object'\n | 'optionalObject'\n | 'string'\n | 'optionalString'\n | 'number'\n | 'optionalNumber'\n | 'stringArray'\n | 'optionalStringArray'\n | 'boolean'\n | 'optionalBoolean';\n\nexport const validateInDev = <T extends Record<string, unknown>>(\n methodName: string,\n obj: T,\n rules: Partial<Record<keyof T, ValidateRule>>,\n) => {\n const errors: StytchSDKUsageError[] = [];\n for (const [key, rule] of Object.entries(rules)) {\n if (rule == null) continue;\n\n const val = obj[key];\n if (rule.startsWith('optional') && val == null) continue;\n\n switch (rule) {\n case 'object':\n case 'optionalObject': {\n const isObject = typeof val === 'object' && !Array.isArray(val) && val !== null;\n if (!isObject) {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be an object.`));\n }\n break;\n }\n\n case 'string':\n case 'optionalString':\n if (typeof val !== 'string') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a string.`));\n }\n break;\n\n case 'number':\n case 'optionalNumber':\n if (typeof val !== 'number') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a number.`));\n }\n break;\n\n case 'stringArray':\n case 'optionalStringArray':\n if (!Array.isArray(val) || !val.every((str) => typeof str === 'string')) {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be an array of strings.`));\n }\n break;\n\n case 'boolean':\n case 'optionalBoolean':\n if (typeof val !== 'boolean') {\n errors.push(new StytchSDKUsageError(methodName, `${key} must be a boolean.`));\n }\n break;\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n throw new AggregateError(errors);\n }\n }\n};\n"],"names":["DEV","input","RUN_IN_DEV","callback","validateInDev","methodName","obj","rules","errors","key","rule","Object","entries","val","startsWith","isObject","Array","isArray","push","StytchSDKUsageError","every","str","length","AggregateError"],"mappings":";;AAEA;;;;AAIC,IACM,MAAMA,GAAAA,GAAM,CAAIC,QAA4BA;AAEnD;;;IAIO,SAASC,UAAAA,CAAWC,QAAoB,EAAA;AAC7CA,IAAAA,QAAAA,EAAAA;AACF;AAcO,MAAMC,aAAAA,GAAgB,CAC3BC,UAAAA,EACAC,GAAAA,EACAC,KAAAA,GAAAA;AAEA,IAAA,MAAMC,SAAgC,EAAE;IACxC,KAAK,MAAM,CAACC,GAAAA,EAAKC,IAAAA,CAAK,IAAIC,MAAAA,CAAOC,OAAO,CAACL,KAAAA,CAAAA,CAAQ;AAC/C,QAAA,IAAIG,QAAQ,IAAA,EAAM;QAElB,MAAMG,GAAAA,GAAMP,GAAG,CAACG,GAAAA,CAAI;AACpB,QAAA,IAAIC,IAAAA,CAAKI,UAAU,CAAC,UAAA,CAAA,IAAeD,OAAO,IAAA,EAAM;QAEhD,OAAQH,IAAAA;YACN,KAAK,QAAA;YACL,KAAK,gBAAA;AAAkB,gBAAA;oBACrB,MAAMK,QAAAA,GAAW,OAAOF,GAAAA,KAAQ,QAAA,IAAY,CAACG,KAAAA,CAAMC,OAAO,CAACJ,GAAAA,CAAAA,IAAQA,GAAAA,KAAQ,IAAA;AAC3E,oBAAA,IAAI,CAACE,QAAAA,EAAU;wBACbP,MAAAA,CAAOU,IAAI,CAAC,IAAIC,mBAAAA,CAAoBd,YAAY,CAAA,EAAGI,GAAAA,CAAI,mBAAmB,CAAC,CAAA,CAAA;AAC7E,oBAAA;AACA,oBAAA;AACF,gBAAA;YAEA,KAAK,QAAA;YACL,KAAK,gBAAA;gBACH,IAAI,OAAOI,QAAQ,QAAA,EAAU;oBAC3BL,MAAAA,CAAOU,IAAI,CAAC,IAAIC,mBAAAA,CAAoBd,YAAY,CAAA,EAAGI,GAAAA,CAAI,kBAAkB,CAAC,CAAA,CAAA;AAC5E,gBAAA;AACA,gBAAA;YAEF,KAAK,QAAA;YACL,KAAK,gBAAA;gBACH,IAAI,OAAOI,QAAQ,QAAA,EAAU;oBAC3BL,MAAAA,CAAOU,IAAI,CAAC,IAAIC,mBAAAA,CAAoBd,YAAY,CAAA,EAAGI,GAAAA,CAAI,kBAAkB,CAAC,CAAA,CAAA;AAC5E,gBAAA;AACA,gBAAA;YAEF,KAAK,aAAA;YACL,KAAK,qBAAA;AACH,gBAAA,IAAI,CAACO,KAAAA,CAAMC,OAAO,CAACJ,GAAAA,CAAAA,IAAQ,CAACA,GAAAA,CAAIO,KAAK,CAAC,CAACC,GAAAA,GAAQ,OAAOA,QAAQ,QAAA,CAAA,EAAW;oBACvEb,MAAAA,CAAOU,IAAI,CAAC,IAAIC,mBAAAA,CAAoBd,YAAY,CAAA,EAAGI,GAAAA,CAAI,6BAA6B,CAAC,CAAA,CAAA;AACvF,gBAAA;AACA,gBAAA;YAEF,KAAK,SAAA;YACL,KAAK,iBAAA;gBACH,IAAI,OAAOI,QAAQ,SAAA,EAAW;oBAC5BL,MAAAA,CAAOU,IAAI,CAAC,IAAIC,mBAAAA,CAAoBd,YAAY,CAAA,EAAGI,GAAAA,CAAI,mBAAmB,CAAC,CAAA,CAAA;AAC7E,gBAAA;AACA,gBAAA;AACJ;AACF,IAAA;IAEA,IAAID,MAAAA,CAAOc,MAAM,GAAG,CAAA,EAAG;QACrB,IAAId,MAAAA,CAAOc,MAAM,KAAK,CAAA,EAAG;YACvB,MAAMd,MAAM,CAAC,CAAA,CAAE;QACjB,CAAA,MAAO;AACL,YAAA,MAAM,IAAIe,cAAAA,CAAef,MAAAA,CAAAA;AAC3B,QAAA;AACF,IAAA;AACF;;;;"}
|
|
@@ -8,12 +8,19 @@ import { IDPContextProvider } from '../components/organisms/IDPContextProvider.m
|
|
|
8
8
|
import { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper.mjs';
|
|
9
9
|
import { messages } from '../../messages/b2b/en.mjs';
|
|
10
10
|
import { IDPConsentScreen } from './screens/IDPConsent.mjs';
|
|
11
|
+
import { RUN_IN_DEV } from '../../../../core/src/utils/dev.mjs';
|
|
12
|
+
import { logger } from '../../../../core/src/utils/logger.mjs';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Wrapper to add default organizationProducts value. This is done to preserve the ability for a future
|
|
14
16
|
* component that doesn't do this, allowing B2B products to be properly tree-shaken (which is also why this is currently
|
|
15
17
|
* in a completely different file)
|
|
16
|
-
*/ const AppContainer = ({ config, ...props })=>{
|
|
18
|
+
*/ const AppContainer = ({ config, styles, ...props })=>{
|
|
19
|
+
RUN_IN_DEV(()=>{
|
|
20
|
+
if (styles) {
|
|
21
|
+
logger.error('styles is deprecated and has no effect. Use the presentation prop instead.\n' + 'See https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide');
|
|
22
|
+
}
|
|
23
|
+
});
|
|
17
24
|
const internalConfig = {
|
|
18
25
|
...config,
|
|
19
26
|
organizationProducts: Object.values(B2BProducts)
|
|
@@ -23,7 +30,7 @@ import { IDPConsentScreen } from './screens/IDPConsent.mjs';
|
|
|
23
30
|
...props
|
|
24
31
|
});
|
|
25
32
|
};
|
|
26
|
-
const B2BIDPContainer = ({ client, presentation, callbacks, strings, getIDPConsentManifest, trustedAuthTokenParams })=>{
|
|
33
|
+
const B2BIDPContainer = ({ client, presentation, callbacks, strings, getIDPConsentManifest, trustedAuthTokenParams, styles })=>{
|
|
27
34
|
const presentationValue = usePresentationWithDefault(presentation, false, []);
|
|
28
35
|
useEffect(()=>{
|
|
29
36
|
readB2BInternals(client).bootstrap.getAsync().then((data)=>{
|
|
@@ -37,6 +44,11 @@ const B2BIDPContainer = ({ client, presentation, callbacks, strings, getIDPConse
|
|
|
37
44
|
}, [
|
|
38
45
|
client
|
|
39
46
|
]);
|
|
47
|
+
RUN_IN_DEV(()=>{
|
|
48
|
+
if (styles) {
|
|
49
|
+
logger.error('styles is deprecated and has no effect. Use the presentation prop instead.\n' + 'See https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide');
|
|
50
|
+
}
|
|
51
|
+
});
|
|
40
52
|
return /*#__PURE__*/ React__default.createElement(GlobalContextProvider, {
|
|
41
53
|
client: client,
|
|
42
54
|
config: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.mjs","sources":["../../../../../../../../web/src/ui/b2b/App.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { B2BIDPSDKConfig, B2BSDKConfig, StytchB2BExtendedLoginConfig } from '../../types';\nimport { InternalAppContainer } from './InternalAppContainer';\nimport * as B2BProducts from './B2BProducts';\nimport { PresentationContext, usePresentationWithDefault } from '../components/PresentationConfig';\nimport { readB2BInternals } from '../../utils/internal';\nimport { DEFAULT_STATE, GlobalContextProvider } from './GlobalContextProvider';\nimport { IDPContextProvider } from '../components/organisms/IDPContextProvider';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { messages } from '../../messages/b2b/en';\nimport { IDPConsentScreen } from './screens/IDPConsent';\n\n/**\n * Wrapper to add default organizationProducts value. This is done to preserve the ability for a future\n * component that doesn't do this, allowing B2B products to be properly tree-shaken (which is also why this is currently\n * in a completely different file)\n */\nexport const AppContainer = ({
|
|
1
|
+
{"version":3,"file":"App.mjs","sources":["../../../../../../../../web/src/ui/b2b/App.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { B2BIDPSDKConfig, B2BSDKConfig, DeprecatedSDKConfig, StytchB2BExtendedLoginConfig } from '../../types';\nimport { InternalAppContainer } from './InternalAppContainer';\nimport * as B2BProducts from './B2BProducts';\nimport { PresentationContext, usePresentationWithDefault } from '../components/PresentationConfig';\nimport { readB2BInternals } from '../../utils/internal';\nimport { DEFAULT_STATE, GlobalContextProvider } from './GlobalContextProvider';\nimport { IDPContextProvider } from '../components/organisms/IDPContextProvider';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { messages } from '../../messages/b2b/en';\nimport { IDPConsentScreen } from './screens/IDPConsent';\nimport { logger, RUN_IN_DEV } from '@stytch/core';\n\n/**\n * Wrapper to add default organizationProducts value. This is done to preserve the ability for a future\n * component that doesn't do this, allowing B2B products to be properly tree-shaken (which is also why this is currently\n * in a completely different file)\n */\nexport const AppContainer = ({\n config,\n styles,\n ...props\n}: B2BSDKConfig<StytchProjectConfigurationInput> & DeprecatedSDKConfig) => {\n RUN_IN_DEV(() => {\n if (styles) {\n logger.error(\n 'styles is deprecated and has no effect. Use the presentation prop instead.\\n' +\n 'See https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide',\n );\n }\n });\n\n const internalConfig = {\n ...config,\n organizationProducts: Object.values(B2BProducts),\n };\n\n return <InternalAppContainer config={internalConfig} {...props}></InternalAppContainer>;\n};\n\nexport const B2BIDPContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n presentation,\n callbacks,\n strings,\n getIDPConsentManifest,\n trustedAuthTokenParams,\n styles,\n}: B2BIDPSDKConfig<TProjectConfiguration> & DeprecatedSDKConfig) => {\n const presentationValue = usePresentationWithDefault(presentation, false, []);\n\n useEffect(() => {\n readB2BInternals(client)\n .bootstrap.getAsync()\n .then((data) => {\n readB2BInternals(client).networkClient.logEvent({\n name: 'render_b2b_idp_screen',\n details: { bootstrap: data },\n });\n });\n }, [client]);\n\n RUN_IN_DEV(() => {\n if (styles) {\n logger.error(\n 'styles is deprecated and has no effect. Use the presentation prop instead.\\n' +\n 'See https://staging.stytch.com/docs/api-reference/b2b/frontend-sdks/react/upgrade-guide',\n );\n }\n });\n\n return (\n <GlobalContextProvider\n client={client}\n config={{} as StytchB2BExtendedLoginConfig}\n callbacks={callbacks}\n initialState={DEFAULT_STATE}\n >\n <IDPContextProvider consentManifestGenerator={getIDPConsentManifest} authTokenParams={trustedAuthTokenParams}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <IDPConsentScreen />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </IDPContextProvider>\n </GlobalContextProvider>\n );\n};\n"],"names":["AppContainer","config","styles","props","RUN_IN_DEV","logger","error","internalConfig","organizationProducts","Object","values","B2BProducts","React","InternalAppContainer","B2BIDPContainer","client","presentation","callbacks","strings","getIDPConsentManifest","trustedAuthTokenParams","presentationValue","usePresentationWithDefault","useEffect","readB2BInternals","bootstrap","getAsync","then","data","networkClient","logEvent","name","details","GlobalContextProvider","initialState","DEFAULT_STATE","IDPContextProvider","consentManifestGenerator","authTokenParams","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","IDPConsentScreen"],"mappings":";;;;;;;;;;;;;AAcA;;;;IAKO,MAAMA,YAAAA,GAAe,CAAC,EAC3BC,MAAM,EACNC,MAAM,EACN,GAAGC,KAAAA,EACiE,GAAA;IACpEC,UAAAA,CAAW,IAAA;AACT,QAAA,IAAIF,MAAAA,EAAQ;YACVG,MAAAA,CAAOC,KAAK,CACV,8EAAA,GACE,yFAAA,CAAA;AAEN,QAAA;AACF,IAAA,CAAA,CAAA;AAEA,IAAA,MAAMC,cAAAA,GAAiB;AACrB,QAAA,GAAGN,MAAM;QACTO,oBAAAA,EAAsBC,MAAAA,CAAOC,MAAM,CAACC,WAAAA;AACtC,KAAA;AAEA,IAAA,qBAAOC,cAAA,CAAA,aAAA,CAACC,oBAAAA,EAAAA;QAAqBZ,MAAAA,EAAQM,cAAAA;AAAiB,QAAA,GAAGJ;;AAC3D;MAEaW,eAAAA,GAAkB,CAAgE,EAC7FC,MAAM,EACNC,YAAY,EACZC,SAAS,EACTC,OAAO,EACPC,qBAAqB,EACrBC,sBAAsB,EACtBlB,MAAM,EACuD,GAAA;AAC7D,IAAA,MAAMmB,iBAAAA,GAAoBC,0BAAAA,CAA2BN,YAAAA,EAAc,KAAA,EAAO,EAAE,CAAA;IAE5EO,SAAAA,CAAU,IAAA;AACRC,QAAAA,gBAAAA,CAAiBT,QACdU,SAAS,CAACC,QAAQ,EAAA,CAClBC,IAAI,CAAC,CAACC,IAAAA,GAAAA;AACLJ,YAAAA,gBAAAA,CAAiBT,MAAAA,CAAAA,CAAQc,aAAa,CAACC,QAAQ,CAAC;gBAC9CC,IAAAA,EAAM,uBAAA;gBACNC,OAAAA,EAAS;oBAAEP,SAAAA,EAAWG;AAAK;AAC7B,aAAA,CAAA;AACF,QAAA,CAAA,CAAA;IACJ,CAAA,EAAG;AAACb,QAAAA;AAAO,KAAA,CAAA;IAEXX,UAAAA,CAAW,IAAA;AACT,QAAA,IAAIF,MAAAA,EAAQ;YACVG,MAAAA,CAAOC,KAAK,CACV,8EAAA,GACE,yFAAA,CAAA;AAEN,QAAA;AACF,IAAA,CAAA,CAAA;AAEA,IAAA,qBACEM,cAAA,CAAA,aAAA,CAACqB,qBAAAA,EAAAA;QACClB,MAAAA,EAAQA,MAAAA;AACRd,QAAAA,MAAAA,EAAQ,EAAC;QACTgB,SAAAA,EAAWA,SAAAA;QACXiB,YAAAA,EAAcC;qBAEdvB,cAAA,CAAA,aAAA,CAACwB,kBAAAA,EAAAA;QAAmBC,wBAAAA,EAA0BlB,qBAAAA;QAAuBmB,eAAAA,EAAiBlB;AACpF,KAAA,gBAAAR,cAAA,CAAA,aAAA,CAAC2B,oBAAoBC,QAAQ,EAAA;QAACC,KAAAA,EAAOpB;qBACnCT,cAAA,CAAA,aAAA,CAAC8B,mBAAAA,EAAAA;QAAoBC,QAAAA,EAAUA,QAAAA;QAAUC,SAAAA,EAAW1B;qBAClDN,cAAA,CAAA,aAAA,CAACiC,gBAAAA,EAAAA,IAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAMb;;;;"}
|
|
@@ -8,6 +8,7 @@ import { MicrosoftIcon } from '../../../assets/logo-color/Microsoft.mjs';
|
|
|
8
8
|
import { OktaIcon } from '../../../assets/logo-color/Okta.mjs';
|
|
9
9
|
import { OutlookIcon } from '../../../assets/logo-color/Outlook.mjs';
|
|
10
10
|
import { SlackIcon } from '../../../assets/logo-color/Slack.mjs';
|
|
11
|
+
import { YahooIcon } from '../../../assets/logo-color/Yahoo.mjs';
|
|
11
12
|
|
|
12
13
|
const oauthIcons = {
|
|
13
14
|
google: GoogleIcon,
|
|
@@ -23,7 +24,8 @@ const ssoIcons = {
|
|
|
23
24
|
};
|
|
24
25
|
const emailIcons = {
|
|
25
26
|
gmail: GmailIcon,
|
|
26
|
-
outlook: OutlookIcon
|
|
27
|
+
outlook: OutlookIcon,
|
|
28
|
+
yahoo: YahooIcon
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export { emailIcons, oauthIcons, ssoIcons };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.mjs","sources":["../../../../../../../../../web/src/ui/b2b/components/Icons.ts"],"sourcesContent":["import {\n GithubIcon,\n HubspotIcon,\n SlackIcon,\n GmailIcon,\n GoogleIcon,\n MicrosoftIcon,\n OktaIcon,\n OutlookIcon,\n} from '../../../assets/logo-color';\n\nexport const oauthIcons = {\n google: GoogleIcon,\n microsoft: MicrosoftIcon,\n hubspot: HubspotIcon,\n slack: SlackIcon,\n github: GithubIcon,\n};\n\nexport const ssoIcons = {\n google: GoogleIcon,\n microsoft: MicrosoftIcon,\n okta: OktaIcon,\n};\n\nexport const emailIcons = {\n gmail: GmailIcon,\n outlook: OutlookIcon,\n};\n\nexport type IconNames =\n | keyof typeof oauthIcons //\n | keyof typeof ssoIcons\n | keyof typeof emailIcons;\n"],"names":["oauthIcons","google","GoogleIcon","microsoft","MicrosoftIcon","hubspot","HubspotIcon","slack","SlackIcon","github","GithubIcon","ssoIcons","okta","OktaIcon","emailIcons","gmail","GmailIcon","outlook","OutlookIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icons.mjs","sources":["../../../../../../../../../web/src/ui/b2b/components/Icons.ts"],"sourcesContent":["import {\n GithubIcon,\n HubspotIcon,\n SlackIcon,\n GmailIcon,\n GoogleIcon,\n MicrosoftIcon,\n OktaIcon,\n OutlookIcon,\n YahooIcon,\n} from '../../../assets/logo-color';\n\nexport const oauthIcons = {\n google: GoogleIcon,\n microsoft: MicrosoftIcon,\n hubspot: HubspotIcon,\n slack: SlackIcon,\n github: GithubIcon,\n};\n\nexport const ssoIcons = {\n google: GoogleIcon,\n microsoft: MicrosoftIcon,\n okta: OktaIcon,\n};\n\nexport const emailIcons = {\n gmail: GmailIcon,\n outlook: OutlookIcon,\n yahoo: YahooIcon,\n};\n\nexport type IconNames =\n | keyof typeof oauthIcons //\n | keyof typeof ssoIcons\n | keyof typeof emailIcons;\n"],"names":["oauthIcons","google","GoogleIcon","microsoft","MicrosoftIcon","hubspot","HubspotIcon","slack","SlackIcon","github","GithubIcon","ssoIcons","okta","OktaIcon","emailIcons","gmail","GmailIcon","outlook","OutlookIcon","yahoo","YahooIcon"],"mappings":";;;;;;;;;;;;MAYaA,UAAAA,GAAa;IACxBC,MAAAA,EAAQC,UAAAA;IACRC,SAAAA,EAAWC,aAAAA;IACXC,OAAAA,EAASC,WAAAA;IACTC,KAAAA,EAAOC,SAAAA;IACPC,MAAAA,EAAQC;AACV;MAEaC,QAAAA,GAAW;IACtBV,MAAAA,EAAQC,UAAAA;IACRC,SAAAA,EAAWC,aAAAA;IACXQ,IAAAA,EAAMC;AACR;MAEaC,UAAAA,GAAa;IACxBC,KAAAA,EAAOC,SAAAA;IACPC,OAAAA,EAASC,WAAAA;IACTC,KAAAA,EAAOC;AACT;;;;"}
|
|
@@ -5,8 +5,10 @@ import { GlobalContextProvider } from './GlobalContextProvider.mjs';
|
|
|
5
5
|
import AppContainer$1 from './Container.mjs';
|
|
6
6
|
import { readB2CInternals } from '../../utils/internal.mjs';
|
|
7
7
|
import { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig.mjs';
|
|
8
|
+
import { RUN_IN_DEV } from '../../../../core/src/utils/dev.mjs';
|
|
9
|
+
import { logger } from '../../../../core/src/utils/logger.mjs';
|
|
8
10
|
|
|
9
|
-
const AppContainer = ({ client, config, presentation, callbacks, strings })=>{
|
|
11
|
+
const AppContainer = ({ client, config, presentation, callbacks, strings, styles })=>{
|
|
10
12
|
// Read the watermark out of sync storage, then read it out of async storage
|
|
11
13
|
const [displayWatermark, setDisplayWatermark] = useState(()=>{
|
|
12
14
|
const { displayWatermark } = readB2CInternals(client).bootstrap.getSync();
|
|
@@ -27,6 +29,11 @@ const AppContainer = ({ client, config, presentation, callbacks, strings })=>{
|
|
|
27
29
|
}, [
|
|
28
30
|
client
|
|
29
31
|
]);
|
|
32
|
+
RUN_IN_DEV(()=>{
|
|
33
|
+
if (styles) {
|
|
34
|
+
logger.error('styles is deprecated and has no effect. Use the presentation prop instead.\n' + 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide');
|
|
35
|
+
}
|
|
36
|
+
});
|
|
30
37
|
const presentationValue = usePresentationWithDefault(presentation, displayWatermark, config.products, 'Products');
|
|
31
38
|
return /*#__PURE__*/ React__default.createElement(GlobalContextProvider, {
|
|
32
39
|
client: client,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/AppContainer.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider } from './GlobalContextProvider';\nimport Container from './Container';\nimport { SDKConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\n\nexport const AppContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n config,\n presentation,\n callbacks,\n strings,\n}: SDKConfig<TProjectConfiguration>) => {\n // Read the watermark out of sync storage, then read it out of async storage\n const [displayWatermark, setDisplayWatermark] = useState(() => {\n const { displayWatermark } = readB2CInternals(client).bootstrap.getSync();\n return displayWatermark;\n });\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then((data) => {\n readB2CInternals(client).networkClient.logEvent({\n name: 'render_login_screen',\n details: { options: config, bootstrap: data },\n });\n setDisplayWatermark(data.displayWatermark);\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- SDK-1354\n }, [client]);\n\n const presentationValue = usePresentationWithDefault(presentation, displayWatermark, config.products, 'Products');\n\n return (\n <GlobalContextProvider client={client} config={config} callbacks={callbacks}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <Container />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </GlobalContextProvider>\n );\n};\n"],"names":["AppContainer","client","config","presentation","callbacks","strings","displayWatermark","setDisplayWatermark","useState","readB2CInternals","bootstrap","getSync","useEffect","getAsync","then","data","networkClient","logEvent","name","details","options","presentationValue","usePresentationWithDefault","products","React","GlobalContextProvider","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","Container"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/AppContainer.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider } from './GlobalContextProvider';\nimport Container from './Container';\nimport { DeprecatedSDKConfig, SDKConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\nimport { logger, RUN_IN_DEV } from '@stytch/core';\n\nexport const AppContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n config,\n presentation,\n callbacks,\n strings,\n styles,\n}: SDKConfig<TProjectConfiguration> & DeprecatedSDKConfig) => {\n // Read the watermark out of sync storage, then read it out of async storage\n const [displayWatermark, setDisplayWatermark] = useState(() => {\n const { displayWatermark } = readB2CInternals(client).bootstrap.getSync();\n return displayWatermark;\n });\n\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then((data) => {\n readB2CInternals(client).networkClient.logEvent({\n name: 'render_login_screen',\n details: { options: config, bootstrap: data },\n });\n setDisplayWatermark(data.displayWatermark);\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- SDK-1354\n }, [client]);\n\n RUN_IN_DEV(() => {\n if (styles) {\n logger.error(\n 'styles is deprecated and has no effect. Use the presentation prop instead.\\n' +\n 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide',\n );\n }\n });\n\n const presentationValue = usePresentationWithDefault(presentation, displayWatermark, config.products, 'Products');\n\n return (\n <GlobalContextProvider client={client} config={config} callbacks={callbacks}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <Container />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </GlobalContextProvider>\n );\n};\n"],"names":["AppContainer","client","config","presentation","callbacks","strings","styles","displayWatermark","setDisplayWatermark","useState","readB2CInternals","bootstrap","getSync","useEffect","getAsync","then","data","networkClient","logEvent","name","details","options","RUN_IN_DEV","logger","error","presentationValue","usePresentationWithDefault","products","React","GlobalContextProvider","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","Container"],"mappings":";;;;;;;;;;AAWO,MAAMA,YAAAA,GAAe,CAAgE,EAC1FC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,SAAS,EACTC,OAAO,EACPC,MAAM,EACiD,GAAA;;AAEvD,IAAA,MAAM,CAACC,gBAAAA,EAAkBC,mBAAAA,CAAoB,GAAGC,QAAAA,CAAS,IAAA;QACvD,MAAM,EAAEF,gBAAgB,EAAE,GAAGG,iBAAiBT,MAAAA,CAAAA,CAAQU,SAAS,CAACC,OAAO,EAAA;QACvE,OAAOL,gBAAAA;AACT,IAAA,CAAA,CAAA;IAEAM,SAAAA,CA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from '../components/organisms/IDPContextProvider.mjs';
|
|
7
7
|
import { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig.mjs';
|
|
8
8
|
import { IDPConsentScreen } from './screens/IdentityProvider/IDPConsent.mjs';
|
|
9
|
+
import { RUN_IN_DEV } from '../../../../core/src/utils/dev.mjs';
|
|
10
|
+
import { logger } from '../../../../core/src/utils/logger.mjs';
|
|
9
11
|
|
|
10
|
-
const IDPContainer = ({ client, presentation, callbacks, strings, getIDPConsentManifest, authTokenParams })=>{
|
|
12
|
+
const IDPContainer = ({ client, presentation, callbacks, strings, styles, getIDPConsentManifest, authTokenParams })=>{
|
|
11
13
|
const presentationValue = usePresentationWithDefault(presentation, false, []);
|
|
12
14
|
useEffect(()=>{
|
|
13
15
|
readB2CInternals(client).bootstrap.getAsync().then((data)=>{
|
|
@@ -21,6 +23,11 @@ const IDPContainer = ({ client, presentation, callbacks, strings, getIDPConsentM
|
|
|
21
23
|
}, [
|
|
22
24
|
client
|
|
23
25
|
]);
|
|
26
|
+
RUN_IN_DEV(()=>{
|
|
27
|
+
if (styles) {
|
|
28
|
+
logger.error('styles is deprecated and has no effect. Use the presentation prop instead.\n' + 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide');
|
|
29
|
+
}
|
|
30
|
+
});
|
|
24
31
|
return /*#__PURE__*/ React__default.createElement(GlobalContextProvider, {
|
|
25
32
|
client: client,
|
|
26
33
|
config: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDPContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/IDPContainer.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider, DEFAULT_STATE } from './GlobalContextProvider';\nimport { IDPSDKConfig, StytchLoginConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { IDPContextProvider } from '../components/organisms/IDPContextProvider';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\nimport { IDPConsentScreen } from './screens/IdentityProvider/IDPConsent';\n\nexport const IDPContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n presentation,\n callbacks,\n strings,\n getIDPConsentManifest,\n authTokenParams,\n}: IDPSDKConfig<TProjectConfiguration>) => {\n const presentationValue = usePresentationWithDefault(presentation, false, []);\n\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then((data) => {\n readB2CInternals(client).networkClient.logEvent({\n name: 'render_idp_screen',\n details: { bootstrap: data },\n });\n });\n }, [client]);\n\n return (\n <GlobalContextProvider\n client={client}\n config={{} as StytchLoginConfig}\n callbacks={callbacks}\n initialState={DEFAULT_STATE}\n >\n <IDPContextProvider consentManifestGenerator={getIDPConsentManifest} authTokenParams={authTokenParams}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <IDPConsentScreen />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </IDPContextProvider>\n </GlobalContextProvider>\n );\n};\n"],"names":["IDPContainer","client","presentation","callbacks","strings","getIDPConsentManifest","authTokenParams","presentationValue","usePresentationWithDefault","useEffect","readB2CInternals","bootstrap","getAsync","then","data","networkClient","logEvent","name","details","React","GlobalContextProvider","config","initialState","DEFAULT_STATE","IDPContextProvider","consentManifestGenerator","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","IDPConsentScreen"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IDPContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/IDPContainer.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider, DEFAULT_STATE } from './GlobalContextProvider';\nimport { IDPSDKConfig, StytchLoginConfig, DeprecatedSDKConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { IDPContextProvider } from '../components/organisms/IDPContextProvider';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\nimport { IDPConsentScreen } from './screens/IdentityProvider/IDPConsent';\nimport { logger, RUN_IN_DEV } from '@stytch/core';\n\nexport const IDPContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n presentation,\n callbacks,\n strings,\n styles,\n getIDPConsentManifest,\n authTokenParams,\n}: IDPSDKConfig<TProjectConfiguration> & DeprecatedSDKConfig) => {\n const presentationValue = usePresentationWithDefault(presentation, false, []);\n\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then((data) => {\n readB2CInternals(client).networkClient.logEvent({\n name: 'render_idp_screen',\n details: { bootstrap: data },\n });\n });\n }, [client]);\n\n RUN_IN_DEV(() => {\n if (styles) {\n logger.error(\n 'styles is deprecated and has no effect. Use the presentation prop instead.\\n' +\n 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide',\n );\n }\n });\n\n return (\n <GlobalContextProvider\n client={client}\n config={{} as StytchLoginConfig}\n callbacks={callbacks}\n initialState={DEFAULT_STATE}\n >\n <IDPContextProvider consentManifestGenerator={getIDPConsentManifest} authTokenParams={authTokenParams}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <IDPConsentScreen />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </IDPContextProvider>\n </GlobalContextProvider>\n );\n};\n"],"names":["IDPContainer","client","presentation","callbacks","strings","styles","getIDPConsentManifest","authTokenParams","presentationValue","usePresentationWithDefault","useEffect","readB2CInternals","bootstrap","getAsync","then","data","networkClient","logEvent","name","details","RUN_IN_DEV","logger","error","React","GlobalContextProvider","config","initialState","DEFAULT_STATE","IDPContextProvider","consentManifestGenerator","PresentationContext","Provider","value","I18nProviderWrapper","messages","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A,QAAAA;QAAUC,SAAAA,EAAW/B;qBAClDmB,cAAA,CAAA,aAAA,CAACa,gBAAAA,EAAAA,IAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAMb;;;;"}
|
|
@@ -7,8 +7,10 @@ import { readB2CInternals } from '../../utils/internal.mjs';
|
|
|
7
7
|
import { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig.mjs';
|
|
8
8
|
import { passkeyRegistration } from './Products.mjs';
|
|
9
9
|
import { addProduct } from './utils.mjs';
|
|
10
|
+
import { RUN_IN_DEV } from '../../../../core/src/utils/dev.mjs';
|
|
11
|
+
import { logger } from '../../../../core/src/utils/logger.mjs';
|
|
10
12
|
|
|
11
|
-
const PasskeyRegistrationContainer = ({ client, config: rawConfig, presentation, callbacks, strings })=>{
|
|
13
|
+
const PasskeyRegistrationContainer = ({ client, config: rawConfig, presentation, callbacks, strings, styles })=>{
|
|
12
14
|
const config = addProduct(rawConfig, passkeyRegistration);
|
|
13
15
|
/**
|
|
14
16
|
* Read the watermark out of sync storage, then read it out of async storage
|
|
@@ -23,6 +25,11 @@ const PasskeyRegistrationContainer = ({ client, config: rawConfig, presentation,
|
|
|
23
25
|
}, [
|
|
24
26
|
client
|
|
25
27
|
]);
|
|
28
|
+
RUN_IN_DEV(()=>{
|
|
29
|
+
if (styles) {
|
|
30
|
+
logger.error('styles is deprecated and has no effect. Use the presentation prop instead.\n' + 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
26
33
|
const initialState = {
|
|
27
34
|
...DEFAULT_STATE,
|
|
28
35
|
screen: AppScreens.PasskeyRegistrationStart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasskeyRegistrationContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/PasskeyRegistrationContainer.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider, DEFAULT_STATE, AppState, AppScreens } from './GlobalContextProvider';\nimport Container from './Container';\nimport { SDKConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\nimport { passkeyRegistration } from './Products';\nimport { addProduct } from './utils';\n\nexport const PasskeyRegistrationContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n config: rawConfig,\n presentation,\n callbacks,\n strings,\n}: SDKConfig<TProjectConfiguration>) => {\n const config = addProduct(rawConfig, passkeyRegistration);\n\n /**\n * Read the watermark out of sync storage, then read it out of async storage\n */\n const [displayWatermark, setDisplayWatermark] = useState(() => {\n const { displayWatermark } = readB2CInternals(client).bootstrap.getSync();\n return displayWatermark;\n });\n\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then(({ displayWatermark }) => {\n setDisplayWatermark(displayWatermark);\n });\n }, [client]);\n\n const initialState: AppState = {\n ...DEFAULT_STATE,\n screen: AppScreens.PasskeyRegistrationStart,\n formState: {\n ...DEFAULT_STATE.formState,\n },\n };\n\n const presentationValue = usePresentationWithDefault(presentation, displayWatermark, config.products, 'Products');\n\n return (\n <GlobalContextProvider client={client} config={config} callbacks={callbacks} initialState={initialState}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <Container />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </GlobalContextProvider>\n );\n};\n"],"names":["PasskeyRegistrationContainer","client","config","rawConfig","presentation","callbacks","strings","addProduct","passkeyRegistration","displayWatermark","setDisplayWatermark","useState","readB2CInternals","bootstrap","getSync","useEffect","getAsync","then","initialState","DEFAULT_STATE","screen","AppScreens","PasskeyRegistrationStart","formState","presentationValue","usePresentationWithDefault","products","React","GlobalContextProvider","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","Container"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasskeyRegistrationContainer.mjs","sources":["../../../../../../../../web/src/ui/b2c/PasskeyRegistrationContainer.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { StytchProjectConfigurationInput } from '@stytch/core/public';\nimport { messages } from '../../messages/en';\nimport { I18nProviderWrapper } from '../components/atoms/I18nProviderWrapper';\nimport { GlobalContextProvider, DEFAULT_STATE, AppState, AppScreens } from './GlobalContextProvider';\nimport Container from './Container';\nimport { SDKConfig, DeprecatedSDKConfig } from '../../types';\nimport { readB2CInternals } from '../../utils/internal';\nimport { usePresentationWithDefault, PresentationContext } from '../components/PresentationConfig';\nimport { passkeyRegistration } from './Products';\nimport { addProduct } from './utils';\nimport { logger, RUN_IN_DEV } from '@stytch/core';\n\nexport const PasskeyRegistrationContainer = <TProjectConfiguration extends StytchProjectConfigurationInput>({\n client,\n config: rawConfig,\n presentation,\n callbacks,\n strings,\n styles,\n}: SDKConfig<TProjectConfiguration> & DeprecatedSDKConfig) => {\n const config = addProduct(rawConfig, passkeyRegistration);\n\n /**\n * Read the watermark out of sync storage, then read it out of async storage\n */\n const [displayWatermark, setDisplayWatermark] = useState(() => {\n const { displayWatermark } = readB2CInternals(client).bootstrap.getSync();\n return displayWatermark;\n });\n\n useEffect(() => {\n readB2CInternals(client)\n .bootstrap.getAsync()\n .then(({ displayWatermark }) => {\n setDisplayWatermark(displayWatermark);\n });\n }, [client]);\n\n RUN_IN_DEV(() => {\n if (styles) {\n logger.error(\n 'styles is deprecated and has no effect. Use the presentation prop instead.\\n' +\n 'See https://stytch.com/docs/api-reference/consumer/frontend-sdks/react/upgrade-guide#step-by-step-guide',\n );\n }\n });\n\n const initialState: AppState = {\n ...DEFAULT_STATE,\n screen: AppScreens.PasskeyRegistrationStart,\n formState: {\n ...DEFAULT_STATE.formState,\n },\n };\n\n const presentationValue = usePresentationWithDefault(presentation, displayWatermark, config.products, 'Products');\n\n return (\n <GlobalContextProvider client={client} config={config} callbacks={callbacks} initialState={initialState}>\n <PresentationContext.Provider value={presentationValue}>\n <I18nProviderWrapper messages={messages} overrides={strings}>\n <Container />\n </I18nProviderWrapper>\n </PresentationContext.Provider>\n </GlobalContextProvider>\n );\n};\n"],"names":["PasskeyRegistrationContainer","client","config","rawConfig","presentation","callbacks","strings","styles","addProduct","passkeyRegistration","displayWatermark","setDisplayWatermark","useState","readB2CInternals","bootstrap","getSync","useEffect","getAsync","then","RUN_IN_DEV","logger","error","initialState","DEFAULT_STATE","screen","AppScreens","PasskeyRegistrationStart","formState","presentationValue","usePresentationWithDefault","products","React","GlobalContextProvider","PresentationContext","Provider","value","I18nProviderWrapper","messages","overrides","Container"],"mappings":";;;;;;;;;;;;MAaaA,4BAAAA,GAA+B,CAAgE,EAC1GC,MAAM,EACNC,MAAAA,EAAQC,SAAS,EACjBC,YAAY,EACZC,SAAS,EACTC,OAAO,EACPC,MAAM,EACiD,GAAA;IACvD,MAAML,MAAAA,GAASM,WAAWL,SAAAA,EAAWM,mBAAAA,CAAAA;AAErC;;AAEC,MACD,MAAM,CAACC,gBAAAA,EAAkBC,mBAAAA,CAAoB,GAAGC,QAAAA,CAAS,IAAA;QACvD,MAAM,EAAEF,gBAAgB,EAAE,GAAGG,iBAAiBZ,MAAAA,CAAAA,CAAQa,SAAS,CAACC,OAAO,EAAA;QACvE,OAAOL,gBAAAA;AACT,IAAA,CAAA,CAAA;IAEAM,SAAAA,CAAU,IAAA;QACRH,gBAAAA,CAAiBZ,MAAAA,CAAAA,CACda,SAAS,CAACG,QAAQ,EAAA,CAClBC,IAAI,CAAC,CAAC,EAAER,gBAAgB,EAAE,GAAA;YACzBC,mBAAAA,CAAoBD,gBAAAA,CAAAA;AACtB,QAAA,CAAA,CAAA;IACJ,CAAA,EAAG;AAACT,QAAAA;AAAO,KAAA,CAAA;IAEXkB,UAAAA,CAAW,IAAA;AACT,QAAA,IAAIZ,MAAAA,EAAQ;YACVa,MAAAA,CAAOC,KAAK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