@aptos-labs/wallet-adapter-react 7.2.0 → 7.2.2
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/dist/components/AboutAptosConnect.d.ts +5 -2
- package/dist/components/AboutAptosConnect.d.ts.map +1 -1
- package/dist/components/AboutPetraWeb.d.ts +60 -0
- package/dist/components/AboutPetraWeb.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/AboutAptosConnect.tsx +8 -4
- package/src/components/AboutPetraWeb.tsx +210 -0
- package/src/components/WalletItem.tsx +1 -1
- package/src/index.tsx +1 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.tsx","../src/WalletProvider.tsx","../src/useWallet.tsx","../src/components/AboutAptosConnect.tsx","../src/graphics/LinkGraphic.tsx","../src/graphics/WalletGraphic.tsx","../src/graphics/Web3Graphic.tsx","../src/components/utils.tsx","../src/components/AptosPrivacyPolicy.tsx","../src/graphics/SmallAptosLogo.tsx","../src/components/WalletItem.tsx"],"sourcesContent":["export * from \"@aptos-labs/wallet-adapter-core\";\nexport * from \"./WalletProvider\";\nexport * from \"./components/AboutAptosConnect\";\nexport * from \"./components/AptosPrivacyPolicy\";\nexport * from \"./components/WalletItem\";\nexport * from \"./useWallet\";\n","import {\n AvailableWallets,\n DappConfig,\n AccountInfo,\n AdapterWallet,\n NetworkInfo,\n InputTransactionData,\n AptosSignAndSubmitTransactionOutput,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n AccountAuthenticator,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n WalletCore,\n Network,\n InputSubmitTransactionData,\n PendingTransactionResponse,\n WalletReadyState,\n AptosSignInInput,\n AptosSignInOutput,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { ReactNode, FC, useState, useEffect, useCallback, useRef } from \"react\";\nimport { WalletContext } from \"./useWallet\";\n\nexport interface AptosWalletProviderProps {\n children: ReactNode;\n optInWallets?: ReadonlyArray<AvailableWallets>;\n autoConnect?:\n | boolean\n | ((core: WalletCore, adapter: AdapterWallet) => Promise<boolean>);\n dappConfig?: DappConfig;\n disableTelemetry?: boolean;\n onError?: (error: any) => void;\n}\n\nconst initialState: {\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connected: boolean;\n wallet: AdapterWallet | null;\n} = {\n connected: false,\n account: null,\n network: null,\n wallet: null,\n};\n\nexport const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({\n children,\n optInWallets,\n autoConnect = false,\n dappConfig,\n disableTelemetry = false,\n onError,\n}: AptosWalletProviderProps) => {\n const didAttemptAutoConnectRef = useRef(false);\n\n const [{ account, network, connected, wallet }, setState] =\n useState(initialState);\n\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [walletCore, setWalletCore] = useState<WalletCore>();\n\n const [wallets, setWallets] = useState<ReadonlyArray<AdapterWallet>>([]);\n const [notDetectedWallets, setNotDetectedWallets] = useState<\n ReadonlyArray<AdapterNotDetectedWallet>\n >([]);\n // Initialize WalletCore on first load\n useEffect(() => {\n const walletCore = new WalletCore(\n optInWallets,\n dappConfig,\n disableTelemetry,\n );\n setWalletCore(walletCore);\n }, []);\n\n // Update initial Wallets state once WalletCore has been initialized\n useEffect(() => {\n setWallets(walletCore?.wallets ?? []);\n setNotDetectedWallets(walletCore?.notDetectedWallets ?? []);\n }, [walletCore]);\n\n useEffect(() => {\n // Only attempt to auto connect once per render and only if there are wallets\n if (didAttemptAutoConnectRef.current || !walletCore?.wallets.length) {\n return;\n }\n didAttemptAutoConnectRef.current = true;\n\n // If auto connect is not set or is false, ignore the attempt\n if (!autoConnect) {\n setIsLoading(false);\n return;\n }\n\n // Make sure the user has a previously connected wallet\n const walletName = localStorage.getItem(\"AptosWalletName\");\n if (!walletName) {\n setIsLoading(false);\n return;\n }\n\n // Make sure the wallet is installed\n const selectedWallet = walletCore.wallets.find(\n (e) => e.name === walletName,\n ) as AdapterWallet | undefined;\n if (\n !selectedWallet ||\n selectedWallet.readyState !== WalletReadyState.Installed\n ) {\n setIsLoading(false);\n return;\n }\n\n if (!connected) {\n (async () => {\n try {\n let shouldConnect = true;\n\n // Providing a function to autoConnect allows the dapp to determine\n // whether to attempt to connect to the wallet using the `signIn`\n // or `connect` method. If `signIn` is successful, the user can\n // return `false` and skip the `connect` method.\n if (typeof autoConnect === \"function\") {\n shouldConnect = await autoConnect(walletCore, selectedWallet);\n } else {\n shouldConnect = autoConnect;\n }\n\n if (shouldConnect) await connect(walletName);\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n })();\n } else {\n setIsLoading(false);\n }\n }, [autoConnect, wallets]);\n\n const connect = async (walletName: string): Promise<void> => {\n try {\n setIsLoading(true);\n await walletCore?.connect(walletName);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const signIn = async (args: {\n walletName: string;\n input: AptosSignInInput;\n }): Promise<AptosSignInOutput> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n\n try {\n setIsLoading(true);\n return await walletCore?.signIn(args);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const disconnect = async (): Promise<void> => {\n try {\n await walletCore?.disconnect();\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signAndSubmitTransaction = async (\n transaction: InputTransactionData,\n ): Promise<AptosSignAndSubmitTransactionOutput> => {\n try {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n return await walletCore.signAndSubmitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signTransaction = async (args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n options?: InputGenerateTransactionOptions & {\n expirationSecondsFromNow?: number;\n expirationTimestamp?: number;\n };\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }> => {\n const { transactionOrPayload, asFeePayer, options } = args;\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore.signTransaction({\n transactionOrPayload,\n asFeePayer,\n });\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const submitTransaction = async (\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.submitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessage = async (\n message: AptosSignMessageInput,\n ): Promise<AptosSignMessageOutput> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessage(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessageAndVerify = async (\n message: AptosSignMessageInput,\n ): Promise<boolean> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessageAndVerify(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const changeNetwork = async (network: Network) => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.changeNetwork(network);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n // Handle the adapter's connect event\n const handleConnect = (): void => {\n setState((state) => {\n return {\n ...state,\n connected: true,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: walletCore?.wallet || null,\n };\n });\n };\n\n // Handle the adapter's account change event\n const handleAccountChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n account: walletCore?.account || null,\n };\n });\n }, [connected]);\n\n // Handle the adapter's network event\n const handleNetworkChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n network: walletCore?.network || null,\n };\n });\n }, [connected]);\n\n useEffect(() => {\n if (connected) {\n walletCore?.onAccountChange();\n walletCore?.onNetworkChange();\n }\n }, [connected]);\n\n // Handle the adapter's disconnect event\n const handleDisconnect = (): void => {\n if (!connected) return;\n setState((state) => {\n return {\n ...state,\n connected: false,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: null,\n };\n });\n };\n\n const handleStandardWalletsAdded = (standardWallet: AdapterWallet): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == standardWallet.name,\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n standardWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setWallets((wallets) => [...wallets, standardWallet]);\n }\n };\n\n const handleStandardNotDetectedWalletsAdded = (\n notDetectedWallet: AdapterNotDetectedWallet,\n ): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == notDetectedWallet.name,\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setNotDetectedWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n notDetectedWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setNotDetectedWallets((wallets) => [...wallets, notDetectedWallet]);\n }\n };\n\n useEffect(() => {\n walletCore?.on(\"connect\", handleConnect);\n walletCore?.on(\"accountChange\", handleAccountChange);\n walletCore?.on(\"networkChange\", handleNetworkChange);\n walletCore?.on(\"disconnect\", handleDisconnect);\n walletCore?.on(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.on(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded,\n );\n return () => {\n walletCore?.off(\"connect\", handleConnect);\n walletCore?.off(\"accountChange\", handleAccountChange);\n walletCore?.off(\"networkChange\", handleNetworkChange);\n walletCore?.off(\"disconnect\", handleDisconnect);\n walletCore?.off(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.off(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded,\n );\n };\n }, [wallets, account]);\n\n return (\n <WalletContext.Provider\n value={{\n connect,\n signIn,\n disconnect,\n signAndSubmitTransaction,\n signTransaction,\n signMessage,\n signMessageAndVerify,\n changeNetwork,\n submitTransaction,\n account,\n network,\n connected,\n wallet,\n wallets,\n notDetectedWallets,\n isLoading,\n }}\n >\n {children}\n </WalletContext.Provider>\n );\n};\n","import { useContext, createContext } from \"react\";\nimport {\n AccountAuthenticator,\n AccountInfo,\n AdapterWallet,\n AnyRawTransaction,\n AptosSignAndSubmitTransactionOutput,\n InputTransactionData,\n NetworkInfo,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n Network,\n AptosChangeNetworkOutput,\n PendingTransactionResponse,\n InputSubmitTransactionData,\n AptosSignInInput,\n AptosSignInOutput,\n} from \"@aptos-labs/wallet-adapter-core\";\n\nexport interface WalletContextState {\n connected: boolean;\n isLoading: boolean;\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connect(walletName: string): void;\n signIn(args: {\n walletName: string;\n input: AptosSignInInput;\n }): Promise<AptosSignInOutput | void>;\n signAndSubmitTransaction(\n transaction: InputTransactionData,\n ): Promise<AptosSignAndSubmitTransactionOutput>;\n signTransaction(args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }>;\n signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;\n signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;\n disconnect(): void;\n changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;\n submitTransaction(\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse>;\n wallet: AdapterWallet | null;\n wallets: ReadonlyArray<AdapterWallet>;\n notDetectedWallets: ReadonlyArray<AdapterNotDetectedWallet>;\n}\n\nconst DEFAULT_CONTEXT = {\n connected: false,\n};\n\nexport const WalletContext = createContext<WalletContextState>(\n DEFAULT_CONTEXT as WalletContextState,\n);\n\nexport function useWallet(): WalletContextState {\n const context = useContext(WalletContext);\n if (!context) {\n throw new Error(\"useWallet must be used within a WalletContextState\");\n }\n return context;\n}\n","import {\n Dispatch,\n ForwardRefExoticComponent,\n ReactNode,\n RefAttributes,\n SVGProps,\n SetStateAction,\n createContext,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { LinkGraphic } from \"../graphics/LinkGraphic\";\nimport { WalletGraphic } from \"../graphics/WalletGraphic\";\nimport { Web3Graphic } from \"../graphics/Web3Graphic\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const EXPLORE_ECOSYSTEM_URL =\n \"https://aptosnetwork.com/ecosystem/directory/category/defi\";\n\nconst AboutAptosConnectContext = createContext<{\n screenIndex: number;\n setScreenIndex: Dispatch<SetStateAction<number>>;\n} | null>(null);\n\nfunction useAboutAptosConnectContext(displayName: string) {\n const context = useContext(AboutAptosConnectContext);\n\n if (!context) {\n throw new Error(\n `\\`${displayName}\\` must be used within \\`AboutAptosConnect\\``,\n );\n }\n\n return context;\n}\n\nconst educationScreens = [\n {\n Graphic: LinkGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h3\", {\n children: \"A better way to login.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Petra Web is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain.\",\n }),\n },\n {\n Graphic: WalletGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"What is a wallet?\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs.\",\n }),\n },\n {\n Graphic: Web3Graphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"Explore more of web3.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children: (\n <>\n Petra Web lets you take one account across any application built\n on Aptos.{\" \"}\n <a\n href={EXPLORE_ECOSYSTEM_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Explore the ecosystem\n </a>\n .\n </>\n ),\n }),\n },\n];\n\nconst educationScreenIndicators = Array(educationScreens.length)\n .fill(null)\n .map((_, index) =>\n createHeadlessComponent(\n \"AboutAptosConnect.ScreenIndicator\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n const isActive = context.screenIndex - 1 === index;\n\n return {\n \"aria-label\": `Go to screen ${index + 1}`,\n \"aria-current\": isActive ? \"step\" : undefined,\n \"data-active\": isActive || undefined,\n onClick: () => {\n context.setScreenIndex(index + 1);\n },\n };\n },\n ),\n );\n\nexport interface AboutAptosConnectEducationScreen {\n /** A component that renders an SVG to illustrate the idea of the current screen. */\n Graphic: ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & RefAttributes<SVGSVGElement>\n >;\n /** A headless component that renders the title of the current screen. */\n Title: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLHeadingElement>\n >;\n /** A headless component that renders the description text of the current screen. */\n Description: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLParagraphElement>\n >;\n /** The index of the current education screen. */\n screenIndex: number;\n /** The total number of education screens. */\n totalScreens: number;\n /**\n * An array of headless components for indicating the current screen of the set.\n * Each indicator will navigate the user to the screen it represents when clicked.\n */\n screenIndicators: typeof educationScreenIndicators;\n /**\n * A function that navigates the user to the previous education screen.\n * If the user is on the first education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n back: () => void;\n /**\n * A function that navigates the user to the next education screen.\n * If the user is on the last education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n next: () => void;\n /** A function that navigates the user to the initial wallet selection screen. */\n cancel: () => void;\n}\n\nexport interface AboutAptosConnectProps {\n /**\n * A function for defining how each education screen should be rendered.\n * Each screen is modeled as a uniform set of headless components and utilities\n * that allow you to construct your UI and apply your own styles.\n */\n renderEducationScreen: (\n screen: AboutAptosConnectEducationScreen,\n ) => ReactNode;\n /**\n * The initial wallet selection UI that will be replaced by the education\n * screens when `AboutAptosConnect.Trigger` is clicked.\n */\n children?: ReactNode;\n}\n\nconst Root = ({ renderEducationScreen, children }: AboutAptosConnectProps) => {\n const [screenIndex, setScreenIndex] = useState(0);\n\n const currentEducationScreen: AboutAptosConnectEducationScreen = useMemo(\n () =>\n educationScreens.map((screen, i) => ({\n ...screen,\n screenIndex: i,\n totalScreens: educationScreens.length,\n screenIndicators: educationScreenIndicators,\n back: () => {\n setScreenIndex(screenIndex - 1);\n },\n next: () => {\n setScreenIndex(\n screenIndex === educationScreens.length ? 0 : screenIndex + 1,\n );\n },\n cancel: () => {\n setScreenIndex(0);\n },\n }))[screenIndex - 1],\n [screenIndex],\n );\n\n return (\n <AboutAptosConnectContext.Provider value={{ screenIndex, setScreenIndex }}>\n {screenIndex === 0\n ? children\n : renderEducationScreen(currentEducationScreen)}\n </AboutAptosConnectContext.Provider>\n );\n};\nRoot.displayName = \"AboutAptosConnect\";\n\nconst Trigger = createHeadlessComponent(\n \"AboutAptosConnect.Trigger\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n\n return {\n onClick: () => {\n context.setScreenIndex(1);\n },\n };\n },\n);\n\n/**\n * A headless component for rendering education screens that explain the basics\n * of Petra Web and web3 wallets.\n */\nexport const AboutAptosConnect = Object.assign(Root, {\n Trigger,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const LinkGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"102\"\n height=\"132\"\n viewBox=\"0 0 102 132\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeMiterlimit=\"10\">\n <path d=\"M59.633 80.66c11.742-2.814 17.48-7.018 20.925-13.254l17.518-31.69c6.257-11.317 2.142-25.55-9.189-31.798C82.737.53 75.723.188 69.593 2.398M60.7 69.565a14.09 14.09 0 0 1-6.907-1.767l-.228-.108\" />\n <path d=\"m52.365 41.075 12.507-22.627a14.146 14.146 0 0 1 4.727-5.062M32.407 118.619a14.139 14.139 0 0 1-7.034-1.768c-6.857-3.78-9.353-12.402-5.561-19.25l16.634-30.1a14.097 14.097 0 0 1 4.518-4.923\" />\n <path d=\"M41.211 78.85c11.332 6.248 25.583 2.14 31.84-9.177l17.518-31.691c6.256-11.317 2.142-25.55-9.19-31.798-6.085-3.357-13.018-3.724-19.104-1.59A23.31 23.31 0 0 0 49.541 15.36L36.863 38.298l7.989 5.036 12.506-22.627c3.786-6.848 12.419-9.34 19.276-5.554 6.856 3.78 9.353 12.402 5.561 19.25l-16.634 30.1c-3.785 6.848-12.418 9.341-19.275 5.555l-5.075 8.791ZM29.5 130.447c12.361-1.37 19.2-6.994 22.966-13.804l12.678-22.936-8.305-5.239\" />\n <path d=\"m55.72 61.947-.442.764 5.511-9.55c-6.901-3.806-18.65-3.124-27.105.814M44.85 43.523l7.635-2.486m-4.221 23.264 7.217-1.723m-9.316 7.517 7.59-2.405m-.562-12.156 7.508-2.221m10.136-51.32L62.761 4.43M49.642 90.778l7.514-2.26m.474 7.448 7.514-2.26m-50.306-60.13c7.135 0 12.918-5.776 12.918-12.9 0-7.126-5.783-12.902-12.918-12.902-7.134 0-12.917 5.776-12.917 12.901s5.783 12.901 12.918 12.901Z\" />\n <path d=\"M15.724 7.774h3.197c7.135 0 12.918 5.776 12.918 12.901 0 7.126-5.783 12.901-12.918 12.901h-3.425m65.112 66.935h3.198c7.135 0 12.918 5.775 12.918 12.901 0 7.125-5.783 12.9-12.918 12.9h-3.425\" />\n <path d=\"M79.717 126.312c7.135 0 12.918-5.775 12.918-12.9s-5.783-12.901-12.918-12.901c-7.134 0-12.917 5.776-12.917 12.901s5.783 12.9 12.917 12.9ZM53.281 55.414c-11.33-6.248-25.582-2.14-31.839 9.177L3.924 96.281c-6.257 11.318-2.142 25.55 9.189 31.799 11.331 6.248 25.582 2.139 31.839-9.177l12.677-22.937-7.988-5.036-12.507 22.627c-3.785 6.848-12.418 9.341-19.275 5.554-6.857-3.781-9.353-12.402-5.561-19.25l16.633-30.1c3.786-6.848 12.419-9.341 19.276-5.555l5.074-8.792Z\" />\n </g>\n </svg>\n );\n },\n);\nLinkGraphic.displayName = \"LinkGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const WalletGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"128\"\n height=\"102\"\n viewBox=\"0 0 128 102\"\n fill=\"none\"\n {...props}\n >\n <path\n fill=\"currentColor\"\n d=\"m.96 25.93-.36-.35.36.85v-.5Zm7.79-7.81v-.5h-.21l-.15.15.36.35ZM1.3 26.28l7.79-7.8-.7-.71-7.8 7.8.7.71Zm7.44-7.66H10v-1H8.75v1Zm29.22 6.8h-37v1h37.01v-1Z\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M82.25 26.08c0 12.25-9.92 22.2-22.14 22.2a22.17 22.17 0 0 1-22.14-22.2H1.1v74.82h118.02V26.08H82.25Zm44.33 67.02h.33V18.27h-5.7\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M74.52 42.92a22.4 22.4 0 0 1-11.43 3.3 22.5 22.5 0 0 1-22.46-22.53H9.52M119.22 101l7.78-7.82m-7.88-67.1 7.79-7.81m-44.78 7.72 2.73-2.3m-46.89 2.39 2.39-2.4\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M9.86 23.69V5.72h107.97v18.04H84.65\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M117.83 20.46h3.39V1H13.25v4.72M9.36 23.69h31.78\"\n />\n </svg>\n );\n },\n);\nWalletGraphic.displayName = \"WalletGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const Web3Graphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"142\"\n height=\"108\"\n viewBox=\"0 0 142 108\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeLinejoin=\"round\">\n <path d=\"m91.26 35.8.06-10.46L71.3 1v10.53L87 30.5m-36.11 5.24-.06-10.45L71.3 1v10.53L55 30.5\" />\n <path d=\"M71 59.55V49.17L50.83 25.3l.06 10.45L57 42.5m14 17.05V49.18l20.33-23.84-.07 10.45L86 42M1 59.68l.22-9.07 35.33-19.8-.1 9L9 55\" />\n <path d=\"M36.55 30.8s-.08 5.92-.1 9l.1-9ZM71 59.51v-9.07L36.55 30.8l-.1 9L63.5 55\" />\n <path d=\"M71 59.51v-9.07L36.44 70.78l-.1 9.14L55.5 68.5\" />\n <path d=\"M1.22 50.6a77387.2 77387.2 0 0 0 35.22 20.18l-.1 9.14L1 59.68l.23-9.07h-.01ZM141 59.68l-.23-9.07-35.33-19.8.11 9L133 55\" />\n <path d=\"m105.44 30.8.11 9-.1-9Z\" />\n <path d=\"M71 59.51v-9.07l34.44-19.64.11 9L78.5 55\" />\n <path d=\"M71 59.51v-9.07l34.56 20.34.1 9.14L87 69\" />\n <path d=\"M140.78 50.6a78487.3 78487.3 0 0 1-35.23 20.18l.11 9.14L141 59.68l-.23-9.07ZM50.83 80.15l.06-6.33 20.1-23.38H71v9.26L55 79\" />\n <path d=\"M71.3 97.6 50.89 73.81l-.06 9.33L71.3 107v-9.4Zm20.03-14.5-.07-9.33L71 50.44v9.26l16 18.8\" />\n <path d=\"m71.3 97.6 19.96-23.83.06 9.33L71.3 107v-9.4Z\" />\n </g>\n </svg>\n );\n },\n);\nWeb3Graphic.displayName = \"Web3Graphic\";\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { ReactNode, cloneElement, forwardRef, isValidElement } from \"react\";\n\nexport interface HeadlessComponentProps {\n /** A class name for styling the element. */\n className?: string;\n /**\n * Whether to render as the child element instead of the default element provided.\n * All props will be merged into the child element.\n */\n asChild?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Gets an HTML element type from its tag name\n * @example\n * HTMLElementFromTag<\"img\"> // resolved type: HTMLImageElement\n */\ntype HTMLElementFromTag<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] extends React.ClassAttributes<infer Element>\n ? Element\n : HTMLElement;\n\nexport function createHeadlessComponent<\n TElement extends keyof JSX.IntrinsicElements,\n>(\n displayName: string,\n elementType: TElement,\n props?:\n | JSX.IntrinsicElements[TElement]\n | ((displayName: string) => JSX.IntrinsicElements[TElement]),\n) {\n const component = forwardRef<\n HTMLElementFromTag<TElement>,\n HeadlessComponentProps\n >(({ className, asChild, children }, ref) => {\n const Component = asChild ? Slot : elementType;\n\n const { children: defaultChildren, ...resolvedProps } =\n typeof props === \"function\" ? props(displayName) : (props ?? {});\n const resolvedChildren =\n /**\n * Use props' default children if no children are set in the component element's children and when asChild is true.\n */\n asChild && isValidElement(children) && !children.props.children\n ? cloneElement(children, {}, defaultChildren)\n : (children ?? defaultChildren);\n\n return (\n /**\n * Due to the complexity of the types at play, TypeScript reports the\n * following error for our JSX below:\n *\n * `Expression produces a union type that is too complex to represent.`\n *\n * We can safely ignore this error and retain accurate return types for\n * consumers of this function. The only drawback is that type-checking is\n * ignored for the JSX block below.\n */\n // @ts-expect-error\n <Component ref={ref} className={className} {...resolvedProps}>\n {resolvedChildren}\n </Component>\n );\n });\n component.displayName = displayName;\n\n return component;\n}\n","import { forwardRef } from \"react\";\nimport { SmallAptosLogo } from \"../graphics/SmallAptosLogo\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const APTOS_PRIVACY_POLICY_URL = \"https://aptoslabs.com/privacy\";\n\nconst Root = createHeadlessComponent(\"AptosPrivacyPolicy.Root\", \"div\");\n\nconst Disclaimer = createHeadlessComponent(\n \"AptosPrivacyPolicy.Disclaimer\",\n \"span\",\n { children: \"By continuing, you agree to Aptos Labs'\" },\n);\n\nconst Link = createHeadlessComponent(\"AptosPrivacyPolicy.Disclaimer\", \"a\", {\n href: APTOS_PRIVACY_POLICY_URL,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Privacy Policy\",\n});\n\nconst PoweredBy = forwardRef<\n HTMLDivElement,\n Pick<HeadlessComponentProps, \"className\">\n>(({ className }, ref) => {\n return (\n <div ref={ref} className={className}>\n <span>Powered by</span>\n <SmallAptosLogo />\n <span>Aptos Labs</span>\n </div>\n );\n});\nPoweredBy.displayName = \"AptosPrivacyPolicy.PoweredBy\";\n\n/**\n * A headless component for rendering the Aptos Labs privacy policy disclaimer\n * that should be placed under the Petra Web login options.\n */\nexport const AptosPrivacyPolicy = Object.assign(Root, {\n Disclaimer,\n Link,\n PoweredBy,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const SmallAptosLogo = forwardRef<\n SVGSVGElement,\n SVGProps<SVGSVGElement>\n>((props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM7.17547 3.67976C7.13401 3.72309 7.07649 3.74757 7.01648 3.74757H3.00775C3.69185 2.83824 4.77995 2.25 6.00569 2.25C7.23142 2.25 8.31953 2.83824 9.00362 3.74757H8.28524C8.20824 3.74757 8.13498 3.71468 8.08401 3.65701L7.81608 3.35416C7.77618 3.30896 7.71882 3.28308 7.6585 3.28308H7.6454C7.58805 3.28308 7.53318 3.30646 7.49343 3.34792L7.17547 3.67976ZM8.05656 4.75897H7.39569C7.31869 4.75897 7.24543 4.72593 7.19447 4.66842L6.92638 4.36557C6.88647 4.32036 6.82896 4.29465 6.7688 4.29465C6.70863 4.29465 6.65112 4.32052 6.61121 4.36557L6.38131 4.6254C6.30603 4.71034 6.19801 4.75913 6.08454 4.75913H2.46703C2.36401 5.05278 2.29683 5.36296 2.27002 5.68467H5.68505C5.74506 5.68467 5.80258 5.66019 5.84404 5.61686L6.16201 5.28502C6.20175 5.24356 6.25662 5.22018 6.31398 5.22018H6.32707C6.38739 5.22018 6.44475 5.24606 6.48465 5.29126L6.75258 5.59411C6.80355 5.65178 6.87681 5.68467 6.95381 5.68467H9.74133C9.71452 5.3628 9.64734 5.05263 9.54431 4.75913H8.05641L8.05656 4.75897ZM4.33651 7.63095C4.39652 7.63095 4.45404 7.60648 4.4955 7.56315L4.81347 7.23131C4.85321 7.18985 4.90808 7.16647 4.96544 7.16647H4.97853C5.03885 7.16647 5.09621 7.19234 5.13611 7.23739L5.40404 7.54024C5.45501 7.59791 5.52827 7.6308 5.60527 7.6308H9.38285C9.52438 7.33839 9.62803 7.02463 9.68975 6.69591H6.06383C5.98683 6.69591 5.91357 6.66287 5.8626 6.60535L5.59467 6.3025C5.55477 6.2573 5.49725 6.23158 5.43709 6.23158C5.37692 6.23158 5.31941 6.25746 5.27951 6.3025L5.0496 6.56233C4.97432 6.64728 4.86631 6.69606 4.75268 6.69606H2.32147C2.3832 7.02479 2.487 7.33855 2.62837 7.63095H4.33651ZM5.57359 8.55745H4.59116C4.51417 8.55745 4.44091 8.52441 4.38994 8.46689L4.12201 8.16404C4.0821 8.11884 4.02459 8.09312 3.96442 8.09312C3.90426 8.09312 3.84675 8.119 3.80684 8.16404L3.57694 8.42387C3.50166 8.50882 3.39364 8.55761 3.28001 8.55761H3.26474C3.94915 9.29096 4.92378 9.74998 6.00596 9.74998C7.08815 9.74998 8.06262 9.29096 8.74719 8.55761H5.57359V8.55745Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n});\nSmallAptosLogo.displayName = \"SmallAptosLogo\";\n","import {\n AdapterNotDetectedWallet,\n AdapterWallet,\n WalletReadyState,\n isRedirectable,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useCallback, useContext } from \"react\";\nimport { useWallet } from \"../useWallet\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport interface WalletItemProps extends HeadlessComponentProps {\n /** The wallet option to be displayed. */\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n /** A callback to be invoked when the wallet is connected. */\n onConnect?: () => void;\n}\n\nfunction useWalletItemContext(displayName: string) {\n const context = useContext(WalletItemContext);\n\n if (!context) {\n throw new Error(`\\`${displayName}\\` must be used within \\`WalletItem\\``);\n }\n\n return context;\n}\n\nconst WalletItemContext = createContext<{\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n connectWallet: () => void;\n} | null>(null);\n\nconst Root = forwardRef<HTMLDivElement, WalletItemProps>(\n ({ wallet, onConnect, className, asChild, children }, ref) => {\n const { connect } = useWallet();\n\n const connectWallet = useCallback(() => {\n connect(wallet.name);\n onConnect?.();\n }, [connect, wallet.name, onConnect]);\n\n const isWalletReady = wallet.readyState === WalletReadyState.Installed;\n\n const mobileSupport =\n \"deeplinkProvider\" in wallet && wallet.deeplinkProvider;\n\n if (!isWalletReady && isRedirectable() && !mobileSupport) return null;\n\n const Component = asChild ? Slot : \"div\";\n\n return (\n <WalletItemContext.Provider value={{ wallet, connectWallet }}>\n <Component ref={ref} className={className}>\n {children}\n </Component>\n </WalletItemContext.Provider>\n );\n },\n);\nRoot.displayName = \"WalletItem\";\n\nconst Icon = createHeadlessComponent(\n \"WalletItem.Icon\",\n \"img\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n src: context.wallet.icon,\n alt: `${context.wallet.name} icon`,\n };\n },\n);\n\nconst Name = createHeadlessComponent(\n \"WalletItem.Name\",\n \"div\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n children: `${context.wallet.name} - 2`,\n };\n },\n);\n\nconst ConnectButton = createHeadlessComponent(\n \"WalletItem.ConnectButton\",\n \"button\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n onClick: context.connectWallet,\n children: \"Connect\",\n };\n },\n);\n\nconst InstallLink = createHeadlessComponent(\n \"WalletItem.InstallLink\",\n \"a\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n href: context.wallet.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Install\",\n };\n },\n);\n\n/** A headless component for rendering a wallet option's name, icon, and either connect button or install link. */\nexport const WalletItem = Object.assign(Root, {\n Icon,\n Name,\n ConnectButton,\n InstallLink,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,4CAAd;;;ACAA,iCAqBO;AACP,IAAAA,gBAAwE;;;ACtBxE,mBAA0C;AAoD1C,IAAM,kBAAkB;AAAA,EACtB,WAAW;AACb;AAEO,IAAM,oBAAgB;AAAA,EAC3B;AACF;AAEO,SAAS,YAAgC;AAC9C,QAAM,cAAU,yBAAW,aAAa;AACxC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,oDAAoD;AAAA,EACtE;AACA,SAAO;AACT;;;AD8UI;AA5WJ,IAA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AU,KAAU,WAClB,UACH,GACF;AAAA,EAEJ;AACF;AACAA,MAAK,cAAc;AAEnB,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,KAAK,QAAQ,OAAO;AAAA,MACpB,KAAK,GAAG,QAAQ,OAAO,IAAI;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,UAAU,GAAG,QAAQ,OAAO,IAAI;AAAA,IAClC;AAAA,EACF;AACF;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,SAAS,QAAQ;AAAA,MACjB,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,MAAM,QAAQ,OAAO;AAAA,MACrB,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAGO,IAAM,aAAa,OAAO,OAAOA,OAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["import_react","walletCore","network","wallet","wallets","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_jsx_runtime","Root","import_wallet_adapter_core","import_react_slot","import_react","import_jsx_runtime","Root"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx","../src/WalletProvider.tsx","../src/useWallet.tsx","../src/components/AboutAptosConnect.tsx","../src/graphics/LinkGraphic.tsx","../src/graphics/WalletGraphic.tsx","../src/graphics/Web3Graphic.tsx","../src/components/utils.tsx","../src/components/AboutPetraWeb.tsx","../src/components/AptosPrivacyPolicy.tsx","../src/graphics/SmallAptosLogo.tsx","../src/components/WalletItem.tsx"],"sourcesContent":["export * from \"@aptos-labs/wallet-adapter-core\";\nexport * from \"./WalletProvider\";\nexport * from \"./components/AboutAptosConnect\";\nexport * from \"./components/AboutPetraWeb\";\nexport * from \"./components/AptosPrivacyPolicy\";\nexport * from \"./components/WalletItem\";\nexport * from \"./useWallet\";\n","import {\n AvailableWallets,\n DappConfig,\n AccountInfo,\n AdapterWallet,\n NetworkInfo,\n InputTransactionData,\n AptosSignAndSubmitTransactionOutput,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n AccountAuthenticator,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n WalletCore,\n Network,\n InputSubmitTransactionData,\n PendingTransactionResponse,\n WalletReadyState,\n AptosSignInInput,\n AptosSignInOutput,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { ReactNode, FC, useState, useEffect, useCallback, useRef } from \"react\";\nimport { WalletContext } from \"./useWallet\";\n\nexport interface AptosWalletProviderProps {\n children: ReactNode;\n optInWallets?: ReadonlyArray<AvailableWallets>;\n autoConnect?:\n | boolean\n | ((core: WalletCore, adapter: AdapterWallet) => Promise<boolean>);\n dappConfig?: DappConfig;\n disableTelemetry?: boolean;\n onError?: (error: any) => void;\n}\n\nconst initialState: {\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connected: boolean;\n wallet: AdapterWallet | null;\n} = {\n connected: false,\n account: null,\n network: null,\n wallet: null,\n};\n\nexport const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({\n children,\n optInWallets,\n autoConnect = false,\n dappConfig,\n disableTelemetry = false,\n onError,\n}: AptosWalletProviderProps) => {\n const didAttemptAutoConnectRef = useRef(false);\n\n const [{ account, network, connected, wallet }, setState] =\n useState(initialState);\n\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [walletCore, setWalletCore] = useState<WalletCore>();\n\n const [wallets, setWallets] = useState<ReadonlyArray<AdapterWallet>>([]);\n const [notDetectedWallets, setNotDetectedWallets] = useState<\n ReadonlyArray<AdapterNotDetectedWallet>\n >([]);\n // Initialize WalletCore on first load\n useEffect(() => {\n const walletCore = new WalletCore(\n optInWallets,\n dappConfig,\n disableTelemetry,\n );\n setWalletCore(walletCore);\n }, []);\n\n // Update initial Wallets state once WalletCore has been initialized\n useEffect(() => {\n setWallets(walletCore?.wallets ?? []);\n setNotDetectedWallets(walletCore?.notDetectedWallets ?? []);\n }, [walletCore]);\n\n useEffect(() => {\n // Only attempt to auto connect once per render and only if there are wallets\n if (didAttemptAutoConnectRef.current || !walletCore?.wallets.length) {\n return;\n }\n didAttemptAutoConnectRef.current = true;\n\n // If auto connect is not set or is false, ignore the attempt\n if (!autoConnect) {\n setIsLoading(false);\n return;\n }\n\n // Make sure the user has a previously connected wallet\n const walletName = localStorage.getItem(\"AptosWalletName\");\n if (!walletName) {\n setIsLoading(false);\n return;\n }\n\n // Make sure the wallet is installed\n const selectedWallet = walletCore.wallets.find(\n (e) => e.name === walletName,\n ) as AdapterWallet | undefined;\n if (\n !selectedWallet ||\n selectedWallet.readyState !== WalletReadyState.Installed\n ) {\n setIsLoading(false);\n return;\n }\n\n if (!connected) {\n (async () => {\n try {\n let shouldConnect = true;\n\n // Providing a function to autoConnect allows the dapp to determine\n // whether to attempt to connect to the wallet using the `signIn`\n // or `connect` method. If `signIn` is successful, the user can\n // return `false` and skip the `connect` method.\n if (typeof autoConnect === \"function\") {\n shouldConnect = await autoConnect(walletCore, selectedWallet);\n } else {\n shouldConnect = autoConnect;\n }\n\n if (shouldConnect) await connect(walletName);\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n })();\n } else {\n setIsLoading(false);\n }\n }, [autoConnect, wallets]);\n\n const connect = async (walletName: string): Promise<void> => {\n try {\n setIsLoading(true);\n await walletCore?.connect(walletName);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const signIn = async (args: {\n walletName: string;\n input: AptosSignInInput;\n }): Promise<AptosSignInOutput> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n\n try {\n setIsLoading(true);\n return await walletCore?.signIn(args);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n } finally {\n setIsLoading(false);\n }\n };\n\n const disconnect = async (): Promise<void> => {\n try {\n await walletCore?.disconnect();\n } catch (error) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signAndSubmitTransaction = async (\n transaction: InputTransactionData,\n ): Promise<AptosSignAndSubmitTransactionOutput> => {\n try {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n return await walletCore.signAndSubmitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signTransaction = async (args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n options?: InputGenerateTransactionOptions & {\n expirationSecondsFromNow?: number;\n expirationTimestamp?: number;\n };\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }> => {\n const { transactionOrPayload, asFeePayer, options } = args;\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore.signTransaction({\n transactionOrPayload,\n asFeePayer,\n });\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const submitTransaction = async (\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.submitTransaction(transaction);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessage = async (\n message: AptosSignMessageInput,\n ): Promise<AptosSignMessageOutput> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessage(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const signMessageAndVerify = async (\n message: AptosSignMessageInput,\n ): Promise<boolean> => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.signMessageAndVerify(message);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n const changeNetwork = async (network: Network) => {\n if (!walletCore) {\n throw new Error(\"WalletCore is not initialized\");\n }\n try {\n return await walletCore?.changeNetwork(network);\n } catch (error: any) {\n if (onError) onError(error);\n return Promise.reject(error);\n }\n };\n\n // Handle the adapter's connect event\n const handleConnect = (): void => {\n setState((state) => {\n return {\n ...state,\n connected: true,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: walletCore?.wallet || null,\n };\n });\n };\n\n // Handle the adapter's account change event\n const handleAccountChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n account: walletCore?.account || null,\n };\n });\n }, [connected]);\n\n // Handle the adapter's network event\n const handleNetworkChange = useCallback((): void => {\n if (!connected) return;\n if (!walletCore?.wallet) return;\n setState((state) => {\n return {\n ...state,\n network: walletCore?.network || null,\n };\n });\n }, [connected]);\n\n useEffect(() => {\n if (connected) {\n walletCore?.onAccountChange();\n walletCore?.onNetworkChange();\n }\n }, [connected]);\n\n // Handle the adapter's disconnect event\n const handleDisconnect = (): void => {\n if (!connected) return;\n setState((state) => {\n return {\n ...state,\n connected: false,\n account: walletCore?.account || null,\n network: walletCore?.network || null,\n wallet: null,\n };\n });\n };\n\n const handleStandardWalletsAdded = (standardWallet: AdapterWallet): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == standardWallet.name,\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n standardWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setWallets((wallets) => [...wallets, standardWallet]);\n }\n };\n\n const handleStandardNotDetectedWalletsAdded = (\n notDetectedWallet: AdapterNotDetectedWallet,\n ): void => {\n // Manage current wallet state by removing optional duplications\n // as new wallets are coming\n const existingWalletIndex = wallets.findIndex(\n (wallet) => wallet.name == notDetectedWallet.name,\n );\n if (existingWalletIndex !== -1) {\n // If wallet exists, replace it with the new wallet\n setNotDetectedWallets((wallets) => [\n ...wallets.slice(0, existingWalletIndex),\n notDetectedWallet,\n ...wallets.slice(existingWalletIndex + 1),\n ]);\n } else {\n // If wallet doesn't exist, add it to the array\n setNotDetectedWallets((wallets) => [...wallets, notDetectedWallet]);\n }\n };\n\n useEffect(() => {\n walletCore?.on(\"connect\", handleConnect);\n walletCore?.on(\"accountChange\", handleAccountChange);\n walletCore?.on(\"networkChange\", handleNetworkChange);\n walletCore?.on(\"disconnect\", handleDisconnect);\n walletCore?.on(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.on(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded,\n );\n return () => {\n walletCore?.off(\"connect\", handleConnect);\n walletCore?.off(\"accountChange\", handleAccountChange);\n walletCore?.off(\"networkChange\", handleNetworkChange);\n walletCore?.off(\"disconnect\", handleDisconnect);\n walletCore?.off(\"standardWalletsAdded\", handleStandardWalletsAdded);\n walletCore?.off(\n \"standardNotDetectedWalletAdded\",\n handleStandardNotDetectedWalletsAdded,\n );\n };\n }, [wallets, account]);\n\n return (\n <WalletContext.Provider\n value={{\n connect,\n signIn,\n disconnect,\n signAndSubmitTransaction,\n signTransaction,\n signMessage,\n signMessageAndVerify,\n changeNetwork,\n submitTransaction,\n account,\n network,\n connected,\n wallet,\n wallets,\n notDetectedWallets,\n isLoading,\n }}\n >\n {children}\n </WalletContext.Provider>\n );\n};\n","import { useContext, createContext } from \"react\";\nimport {\n AccountAuthenticator,\n AccountInfo,\n AdapterWallet,\n AnyRawTransaction,\n AptosSignAndSubmitTransactionOutput,\n InputTransactionData,\n NetworkInfo,\n AptosSignMessageInput,\n AptosSignMessageOutput,\n AdapterNotDetectedWallet,\n Network,\n AptosChangeNetworkOutput,\n PendingTransactionResponse,\n InputSubmitTransactionData,\n AptosSignInInput,\n AptosSignInOutput,\n} from \"@aptos-labs/wallet-adapter-core\";\n\nexport interface WalletContextState {\n connected: boolean;\n isLoading: boolean;\n account: AccountInfo | null;\n network: NetworkInfo | null;\n connect(walletName: string): void;\n signIn(args: {\n walletName: string;\n input: AptosSignInInput;\n }): Promise<AptosSignInOutput | void>;\n signAndSubmitTransaction(\n transaction: InputTransactionData,\n ): Promise<AptosSignAndSubmitTransactionOutput>;\n signTransaction(args: {\n transactionOrPayload: AnyRawTransaction | InputTransactionData;\n asFeePayer?: boolean;\n }): Promise<{\n authenticator: AccountAuthenticator;\n rawTransaction: Uint8Array;\n }>;\n signMessage(message: AptosSignMessageInput): Promise<AptosSignMessageOutput>;\n signMessageAndVerify(message: AptosSignMessageInput): Promise<boolean>;\n disconnect(): void;\n changeNetwork(network: Network): Promise<AptosChangeNetworkOutput>;\n submitTransaction(\n transaction: InputSubmitTransactionData,\n ): Promise<PendingTransactionResponse>;\n wallet: AdapterWallet | null;\n wallets: ReadonlyArray<AdapterWallet>;\n notDetectedWallets: ReadonlyArray<AdapterNotDetectedWallet>;\n}\n\nconst DEFAULT_CONTEXT = {\n connected: false,\n};\n\nexport const WalletContext = createContext<WalletContextState>(\n DEFAULT_CONTEXT as WalletContextState,\n);\n\nexport function useWallet(): WalletContextState {\n const context = useContext(WalletContext);\n if (!context) {\n throw new Error(\"useWallet must be used within a WalletContextState\");\n }\n return context;\n}\n","import {\n Dispatch,\n ForwardRefExoticComponent,\n ReactNode,\n RefAttributes,\n SVGProps,\n SetStateAction,\n createContext,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { LinkGraphic } from \"../graphics/LinkGraphic\";\nimport { WalletGraphic } from \"../graphics/WalletGraphic\";\nimport { Web3Graphic } from \"../graphics/Web3Graphic\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nconst EXPLORE_ECOSYSTEM_URL =\n \"https://aptosnetwork.com/ecosystem/directory/category/defi\";\n\nconst AboutAptosConnectContext = createContext<{\n screenIndex: number;\n setScreenIndex: Dispatch<SetStateAction<number>>;\n} | null>(null);\n\nfunction useAboutAptosConnectContext(displayName: string) {\n const context = useContext(AboutAptosConnectContext);\n\n if (!context) {\n throw new Error(\n `\\`${displayName}\\` must be used within \\`AboutAptosConnect\\``,\n );\n }\n\n return context;\n}\n\nconst educationScreens = [\n {\n Graphic: LinkGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h3\", {\n children: \"A better way to login.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Petra Web is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain.\",\n }),\n },\n {\n Graphic: WalletGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"What is a wallet?\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs.\",\n }),\n },\n {\n Graphic: Web3Graphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"Explore more of web3.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children: (\n <>\n Petra Web lets you take one account across any application built on\n Aptos.{\" \"}\n <a\n href={EXPLORE_ECOSYSTEM_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Explore the ecosystem\n </a>\n .\n </>\n ),\n }),\n },\n];\n\nconst educationScreenIndicators = Array(educationScreens.length)\n .fill(null)\n .map((_, index) =>\n createHeadlessComponent(\n \"AboutAptosConnect.ScreenIndicator\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n const isActive = context.screenIndex - 1 === index;\n\n return {\n \"aria-label\": `Go to screen ${index + 1}`,\n \"aria-current\": isActive ? \"step\" : undefined,\n \"data-active\": isActive || undefined,\n onClick: () => {\n context.setScreenIndex(index + 1);\n },\n };\n },\n ),\n );\n\n/** @deprecated Use {@link AboutPetraWebEducationScreen} instead. */\nexport interface AboutAptosConnectEducationScreen {\n /** A component that renders an SVG to illustrate the idea of the current screen. */\n Graphic: ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & RefAttributes<SVGSVGElement>\n >;\n /** A headless component that renders the title of the current screen. */\n Title: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLHeadingElement>\n >;\n /** A headless component that renders the description text of the current screen. */\n Description: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLParagraphElement>\n >;\n /** The index of the current education screen. */\n screenIndex: number;\n /** The total number of education screens. */\n totalScreens: number;\n /**\n * An array of headless components for indicating the current screen of the set.\n * Each indicator will navigate the user to the screen it represents when clicked.\n */\n screenIndicators: typeof educationScreenIndicators;\n /**\n * A function that navigates the user to the previous education screen.\n * If the user is on the first education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n back: () => void;\n /**\n * A function that navigates the user to the next education screen.\n * If the user is on the last education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n next: () => void;\n /** A function that navigates the user to the initial wallet selection screen. */\n cancel: () => void;\n}\n\n/** @deprecated Use {@link AboutPetraWebProps} instead. */\nexport interface AboutAptosConnectProps {\n /**\n * A function for defining how each education screen should be rendered.\n * Each screen is modeled as a uniform set of headless components and utilities\n * that allow you to construct your UI and apply your own styles.\n */\n renderEducationScreen: (\n screen: AboutAptosConnectEducationScreen,\n ) => ReactNode;\n /**\n * The initial wallet selection UI that will be replaced by the education\n * screens when `AboutAptosConnect.Trigger` is clicked.\n */\n children?: ReactNode;\n}\n\nconst Root = ({ renderEducationScreen, children }: AboutAptosConnectProps) => {\n const [screenIndex, setScreenIndex] = useState(0);\n\n const currentEducationScreen: AboutAptosConnectEducationScreen = useMemo(\n () =>\n educationScreens.map((screen, i) => ({\n ...screen,\n screenIndex: i,\n totalScreens: educationScreens.length,\n screenIndicators: educationScreenIndicators,\n back: () => {\n setScreenIndex(screenIndex - 1);\n },\n next: () => {\n setScreenIndex(\n screenIndex === educationScreens.length ? 0 : screenIndex + 1,\n );\n },\n cancel: () => {\n setScreenIndex(0);\n },\n }))[screenIndex - 1],\n [screenIndex],\n );\n\n return (\n <AboutAptosConnectContext.Provider value={{ screenIndex, setScreenIndex }}>\n {screenIndex === 0\n ? children\n : renderEducationScreen(currentEducationScreen)}\n </AboutAptosConnectContext.Provider>\n );\n};\nRoot.displayName = \"AboutAptosConnect\";\n\nconst Trigger = createHeadlessComponent(\n \"AboutAptosConnect.Trigger\",\n \"button\",\n (displayName) => {\n const context = useAboutAptosConnectContext(displayName);\n\n return {\n onClick: () => {\n context.setScreenIndex(1);\n },\n };\n },\n);\n\n/**\n * A headless component for rendering education screens that explain the basics\n * of Aptos Connect and web3 wallets.\n *\n * @deprecated Use {@link AboutPetraWeb} instead.\n */\nexport const AboutAptosConnect = Object.assign(Root, {\n Trigger,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const LinkGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"102\"\n height=\"132\"\n viewBox=\"0 0 102 132\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeMiterlimit=\"10\">\n <path d=\"M59.633 80.66c11.742-2.814 17.48-7.018 20.925-13.254l17.518-31.69c6.257-11.317 2.142-25.55-9.189-31.798C82.737.53 75.723.188 69.593 2.398M60.7 69.565a14.09 14.09 0 0 1-6.907-1.767l-.228-.108\" />\n <path d=\"m52.365 41.075 12.507-22.627a14.146 14.146 0 0 1 4.727-5.062M32.407 118.619a14.139 14.139 0 0 1-7.034-1.768c-6.857-3.78-9.353-12.402-5.561-19.25l16.634-30.1a14.097 14.097 0 0 1 4.518-4.923\" />\n <path d=\"M41.211 78.85c11.332 6.248 25.583 2.14 31.84-9.177l17.518-31.691c6.256-11.317 2.142-25.55-9.19-31.798-6.085-3.357-13.018-3.724-19.104-1.59A23.31 23.31 0 0 0 49.541 15.36L36.863 38.298l7.989 5.036 12.506-22.627c3.786-6.848 12.419-9.34 19.276-5.554 6.856 3.78 9.353 12.402 5.561 19.25l-16.634 30.1c-3.785 6.848-12.418 9.341-19.275 5.555l-5.075 8.791ZM29.5 130.447c12.361-1.37 19.2-6.994 22.966-13.804l12.678-22.936-8.305-5.239\" />\n <path d=\"m55.72 61.947-.442.764 5.511-9.55c-6.901-3.806-18.65-3.124-27.105.814M44.85 43.523l7.635-2.486m-4.221 23.264 7.217-1.723m-9.316 7.517 7.59-2.405m-.562-12.156 7.508-2.221m10.136-51.32L62.761 4.43M49.642 90.778l7.514-2.26m.474 7.448 7.514-2.26m-50.306-60.13c7.135 0 12.918-5.776 12.918-12.9 0-7.126-5.783-12.902-12.918-12.902-7.134 0-12.917 5.776-12.917 12.901s5.783 12.901 12.918 12.901Z\" />\n <path d=\"M15.724 7.774h3.197c7.135 0 12.918 5.776 12.918 12.901 0 7.126-5.783 12.901-12.918 12.901h-3.425m65.112 66.935h3.198c7.135 0 12.918 5.775 12.918 12.901 0 7.125-5.783 12.9-12.918 12.9h-3.425\" />\n <path d=\"M79.717 126.312c7.135 0 12.918-5.775 12.918-12.9s-5.783-12.901-12.918-12.901c-7.134 0-12.917 5.776-12.917 12.901s5.783 12.9 12.917 12.9ZM53.281 55.414c-11.33-6.248-25.582-2.14-31.839 9.177L3.924 96.281c-6.257 11.318-2.142 25.55 9.189 31.799 11.331 6.248 25.582 2.139 31.839-9.177l12.677-22.937-7.988-5.036-12.507 22.627c-3.785 6.848-12.418 9.341-19.275 5.554-6.857-3.781-9.353-12.402-5.561-19.25l16.633-30.1c3.786-6.848 12.419-9.341 19.276-5.555l5.074-8.792Z\" />\n </g>\n </svg>\n );\n },\n);\nLinkGraphic.displayName = \"LinkGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const WalletGraphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"128\"\n height=\"102\"\n viewBox=\"0 0 128 102\"\n fill=\"none\"\n {...props}\n >\n <path\n fill=\"currentColor\"\n d=\"m.96 25.93-.36-.35.36.85v-.5Zm7.79-7.81v-.5h-.21l-.15.15.36.35ZM1.3 26.28l7.79-7.8-.7-.71-7.8 7.8.7.71Zm7.44-7.66H10v-1H8.75v1Zm29.22 6.8h-37v1h37.01v-1Z\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M82.25 26.08c0 12.25-9.92 22.2-22.14 22.2a22.17 22.17 0 0 1-22.14-22.2H1.1v74.82h118.02V26.08H82.25Zm44.33 67.02h.33V18.27h-5.7\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M74.52 42.92a22.4 22.4 0 0 1-11.43 3.3 22.5 22.5 0 0 1-22.46-22.53H9.52M119.22 101l7.78-7.82m-7.88-67.1 7.79-7.81m-44.78 7.72 2.73-2.3m-46.89 2.39 2.39-2.4\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M9.86 23.69V5.72h107.97v18.04H84.65\"\n />\n <path\n stroke=\"currentColor\"\n strokeMiterlimit=\"10\"\n d=\"M117.83 20.46h3.39V1H13.25v4.72M9.36 23.69h31.78\"\n />\n </svg>\n );\n },\n);\nWalletGraphic.displayName = \"WalletGraphic\";\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const Web3Graphic = forwardRef<SVGSVGElement, SVGProps<SVGSVGElement>>(\n (props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"142\"\n height=\"108\"\n viewBox=\"0 0 142 108\"\n fill=\"none\"\n {...props}\n >\n <g stroke=\"currentColor\" strokeLinejoin=\"round\">\n <path d=\"m91.26 35.8.06-10.46L71.3 1v10.53L87 30.5m-36.11 5.24-.06-10.45L71.3 1v10.53L55 30.5\" />\n <path d=\"M71 59.55V49.17L50.83 25.3l.06 10.45L57 42.5m14 17.05V49.18l20.33-23.84-.07 10.45L86 42M1 59.68l.22-9.07 35.33-19.8-.1 9L9 55\" />\n <path d=\"M36.55 30.8s-.08 5.92-.1 9l.1-9ZM71 59.51v-9.07L36.55 30.8l-.1 9L63.5 55\" />\n <path d=\"M71 59.51v-9.07L36.44 70.78l-.1 9.14L55.5 68.5\" />\n <path d=\"M1.22 50.6a77387.2 77387.2 0 0 0 35.22 20.18l-.1 9.14L1 59.68l.23-9.07h-.01ZM141 59.68l-.23-9.07-35.33-19.8.11 9L133 55\" />\n <path d=\"m105.44 30.8.11 9-.1-9Z\" />\n <path d=\"M71 59.51v-9.07l34.44-19.64.11 9L78.5 55\" />\n <path d=\"M71 59.51v-9.07l34.56 20.34.1 9.14L87 69\" />\n <path d=\"M140.78 50.6a78487.3 78487.3 0 0 1-35.23 20.18l.11 9.14L141 59.68l-.23-9.07ZM50.83 80.15l.06-6.33 20.1-23.38H71v9.26L55 79\" />\n <path d=\"M71.3 97.6 50.89 73.81l-.06 9.33L71.3 107v-9.4Zm20.03-14.5-.07-9.33L71 50.44v9.26l16 18.8\" />\n <path d=\"m71.3 97.6 19.96-23.83.06 9.33L71.3 107v-9.4Z\" />\n </g>\n </svg>\n );\n },\n);\nWeb3Graphic.displayName = \"Web3Graphic\";\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { ReactNode, cloneElement, forwardRef, isValidElement } from \"react\";\n\nexport interface HeadlessComponentProps {\n /** A class name for styling the element. */\n className?: string;\n /**\n * Whether to render as the child element instead of the default element provided.\n * All props will be merged into the child element.\n */\n asChild?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Gets an HTML element type from its tag name\n * @example\n * HTMLElementFromTag<\"img\"> // resolved type: HTMLImageElement\n */\ntype HTMLElementFromTag<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] extends React.ClassAttributes<infer Element>\n ? Element\n : HTMLElement;\n\nexport function createHeadlessComponent<\n TElement extends keyof JSX.IntrinsicElements,\n>(\n displayName: string,\n elementType: TElement,\n props?:\n | JSX.IntrinsicElements[TElement]\n | ((displayName: string) => JSX.IntrinsicElements[TElement]),\n) {\n const component = forwardRef<\n HTMLElementFromTag<TElement>,\n HeadlessComponentProps\n >(({ className, asChild, children }, ref) => {\n const Component = asChild ? Slot : elementType;\n\n const { children: defaultChildren, ...resolvedProps } =\n typeof props === \"function\" ? props(displayName) : (props ?? {});\n const resolvedChildren =\n /**\n * Use props' default children if no children are set in the component element's children and when asChild is true.\n */\n asChild && isValidElement(children) && !children.props.children\n ? cloneElement(children, {}, defaultChildren)\n : (children ?? defaultChildren);\n\n return (\n /**\n * Due to the complexity of the types at play, TypeScript reports the\n * following error for our JSX below:\n *\n * `Expression produces a union type that is too complex to represent.`\n *\n * We can safely ignore this error and retain accurate return types for\n * consumers of this function. The only drawback is that type-checking is\n * ignored for the JSX block below.\n */\n // @ts-expect-error\n <Component ref={ref} className={className} {...resolvedProps}>\n {resolvedChildren}\n </Component>\n );\n });\n component.displayName = displayName;\n\n return component;\n}\n","import {\n Dispatch,\n ForwardRefExoticComponent,\n ReactNode,\n RefAttributes,\n SVGProps,\n SetStateAction,\n createContext,\n useContext,\n useMemo,\n useState,\n} from \"react\";\nimport { LinkGraphic } from \"../graphics/LinkGraphic\";\nimport { WalletGraphic } from \"../graphics/WalletGraphic\";\nimport { Web3Graphic } from \"../graphics/Web3Graphic\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const EXPLORE_ECOSYSTEM_URL =\n \"https://aptosnetwork.com/ecosystem/directory/category/defi\";\n\nconst AboutPetraWebContext = createContext<{\n screenIndex: number;\n setScreenIndex: Dispatch<SetStateAction<number>>;\n} | null>(null);\n\nfunction useAboutPetraWebContext(displayName: string) {\n const context = useContext(AboutPetraWebContext);\n\n if (!context) {\n throw new Error(`\\`${displayName}\\` must be used within \\`AboutPetraWeb\\``);\n }\n\n return context;\n}\n\nconst educationScreens = [\n {\n Graphic: LinkGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h3\", {\n children: \"A better way to login.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Petra Web is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain.\",\n }),\n },\n {\n Graphic: WalletGraphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"What is a wallet?\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children:\n \"Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs.\",\n }),\n },\n {\n Graphic: Web3Graphic,\n Title: createHeadlessComponent(\"EducationScreen.Title\", \"h2\", {\n children: \"Explore more of web3.\",\n }),\n Description: createHeadlessComponent(\"EducationScreen.Description\", \"p\", {\n children: (\n <>\n Petra Web lets you take one account across any application built on\n Aptos.{\" \"}\n <a\n href={EXPLORE_ECOSYSTEM_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Explore the ecosystem\n </a>\n .\n </>\n ),\n }),\n },\n];\n\nconst educationScreenIndicators = Array(educationScreens.length)\n .fill(null)\n .map((_, index) =>\n createHeadlessComponent(\n \"AboutPetraWeb.ScreenIndicator\",\n \"button\",\n (displayName) => {\n const context = useAboutPetraWebContext(displayName);\n const isActive = context.screenIndex - 1 === index;\n\n return {\n \"aria-label\": `Go to screen ${index + 1}`,\n \"aria-current\": isActive ? \"step\" : undefined,\n \"data-active\": isActive || undefined,\n onClick: () => {\n context.setScreenIndex(index + 1);\n },\n };\n },\n ),\n );\n\nexport interface AboutPetraWebEducationScreen {\n /** A component that renders an SVG to illustrate the idea of the current screen. */\n Graphic: ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & RefAttributes<SVGSVGElement>\n >;\n /** A headless component that renders the title of the current screen. */\n Title: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLHeadingElement>\n >;\n /** A headless component that renders the description text of the current screen. */\n Description: ForwardRefExoticComponent<\n HeadlessComponentProps & RefAttributes<HTMLParagraphElement>\n >;\n /** The index of the current education screen. */\n screenIndex: number;\n /** The total number of education screens. */\n totalScreens: number;\n /**\n * An array of headless components for indicating the current screen of the set.\n * Each indicator will navigate the user to the screen it represents when clicked.\n */\n screenIndicators: typeof educationScreenIndicators;\n /**\n * A function that navigates the user to the previous education screen.\n * If the user is on the first education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n back: () => void;\n /**\n * A function that navigates the user to the next education screen.\n * If the user is on the last education screen, they will be navigated to the\n * initial wallet selection screen.\n */\n next: () => void;\n /** A function that navigates the user to the initial wallet selection screen. */\n cancel: () => void;\n}\n\nexport interface AboutPetraWebProps {\n /**\n * A function for defining how each education screen should be rendered.\n * Each screen is modeled as a uniform set of headless components and utilities\n * that allow you to construct your UI and apply your own styles.\n */\n renderEducationScreen: (screen: AboutPetraWebEducationScreen) => ReactNode;\n /**\n * The initial wallet selection UI that will be replaced by the education\n * screens when `AboutPetraWeb.Trigger` is clicked.\n */\n children?: ReactNode;\n}\n\nconst Root = ({ renderEducationScreen, children }: AboutPetraWebProps) => {\n const [screenIndex, setScreenIndex] = useState(0);\n\n const currentEducationScreen: AboutPetraWebEducationScreen = useMemo(\n () =>\n educationScreens.map((screen, i) => ({\n ...screen,\n screenIndex: i,\n totalScreens: educationScreens.length,\n screenIndicators: educationScreenIndicators,\n back: () => {\n setScreenIndex(screenIndex - 1);\n },\n next: () => {\n setScreenIndex(\n screenIndex === educationScreens.length ? 0 : screenIndex + 1,\n );\n },\n cancel: () => {\n setScreenIndex(0);\n },\n }))[screenIndex - 1],\n [screenIndex],\n );\n\n return (\n <AboutPetraWebContext.Provider value={{ screenIndex, setScreenIndex }}>\n {screenIndex === 0\n ? children\n : renderEducationScreen(currentEducationScreen)}\n </AboutPetraWebContext.Provider>\n );\n};\nRoot.displayName = \"AboutPetraWeb\";\n\nconst Trigger = createHeadlessComponent(\n \"AboutPetraWeb.Trigger\",\n \"button\",\n (displayName) => {\n const context = useAboutPetraWebContext(displayName);\n\n return {\n onClick: () => {\n context.setScreenIndex(1);\n },\n };\n },\n);\n\n/**\n * A headless component for rendering education screens that explain the basics\n * of Petra Web and web3 wallets.\n */\nexport const AboutPetraWeb = Object.assign(Root, {\n Trigger,\n});\n","import { forwardRef } from \"react\";\nimport { SmallAptosLogo } from \"../graphics/SmallAptosLogo\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport const APTOS_PRIVACY_POLICY_URL = \"https://aptoslabs.com/privacy\";\n\nconst Root = createHeadlessComponent(\"AptosPrivacyPolicy.Root\", \"div\");\n\nconst Disclaimer = createHeadlessComponent(\n \"AptosPrivacyPolicy.Disclaimer\",\n \"span\",\n { children: \"By continuing, you agree to Aptos Labs'\" },\n);\n\nconst Link = createHeadlessComponent(\"AptosPrivacyPolicy.Disclaimer\", \"a\", {\n href: APTOS_PRIVACY_POLICY_URL,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Privacy Policy\",\n});\n\nconst PoweredBy = forwardRef<\n HTMLDivElement,\n Pick<HeadlessComponentProps, \"className\">\n>(({ className }, ref) => {\n return (\n <div ref={ref} className={className}>\n <span>Powered by</span>\n <SmallAptosLogo />\n <span>Aptos Labs</span>\n </div>\n );\n});\nPoweredBy.displayName = \"AptosPrivacyPolicy.PoweredBy\";\n\n/**\n * A headless component for rendering the Aptos Labs privacy policy disclaimer\n * that should be placed under the Petra Web login options.\n */\nexport const AptosPrivacyPolicy = Object.assign(Root, {\n Disclaimer,\n Link,\n PoweredBy,\n});\n","import { SVGProps, forwardRef } from \"react\";\n\nexport const SmallAptosLogo = forwardRef<\n SVGSVGElement,\n SVGProps<SVGSVGElement>\n>((props, ref) => {\n return (\n <svg\n ref={ref}\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM7.17547 3.67976C7.13401 3.72309 7.07649 3.74757 7.01648 3.74757H3.00775C3.69185 2.83824 4.77995 2.25 6.00569 2.25C7.23142 2.25 8.31953 2.83824 9.00362 3.74757H8.28524C8.20824 3.74757 8.13498 3.71468 8.08401 3.65701L7.81608 3.35416C7.77618 3.30896 7.71882 3.28308 7.6585 3.28308H7.6454C7.58805 3.28308 7.53318 3.30646 7.49343 3.34792L7.17547 3.67976ZM8.05656 4.75897H7.39569C7.31869 4.75897 7.24543 4.72593 7.19447 4.66842L6.92638 4.36557C6.88647 4.32036 6.82896 4.29465 6.7688 4.29465C6.70863 4.29465 6.65112 4.32052 6.61121 4.36557L6.38131 4.6254C6.30603 4.71034 6.19801 4.75913 6.08454 4.75913H2.46703C2.36401 5.05278 2.29683 5.36296 2.27002 5.68467H5.68505C5.74506 5.68467 5.80258 5.66019 5.84404 5.61686L6.16201 5.28502C6.20175 5.24356 6.25662 5.22018 6.31398 5.22018H6.32707C6.38739 5.22018 6.44475 5.24606 6.48465 5.29126L6.75258 5.59411C6.80355 5.65178 6.87681 5.68467 6.95381 5.68467H9.74133C9.71452 5.3628 9.64734 5.05263 9.54431 4.75913H8.05641L8.05656 4.75897ZM4.33651 7.63095C4.39652 7.63095 4.45404 7.60648 4.4955 7.56315L4.81347 7.23131C4.85321 7.18985 4.90808 7.16647 4.96544 7.16647H4.97853C5.03885 7.16647 5.09621 7.19234 5.13611 7.23739L5.40404 7.54024C5.45501 7.59791 5.52827 7.6308 5.60527 7.6308H9.38285C9.52438 7.33839 9.62803 7.02463 9.68975 6.69591H6.06383C5.98683 6.69591 5.91357 6.66287 5.8626 6.60535L5.59467 6.3025C5.55477 6.2573 5.49725 6.23158 5.43709 6.23158C5.37692 6.23158 5.31941 6.25746 5.27951 6.3025L5.0496 6.56233C4.97432 6.64728 4.86631 6.69606 4.75268 6.69606H2.32147C2.3832 7.02479 2.487 7.33855 2.62837 7.63095H4.33651ZM5.57359 8.55745H4.59116C4.51417 8.55745 4.44091 8.52441 4.38994 8.46689L4.12201 8.16404C4.0821 8.11884 4.02459 8.09312 3.96442 8.09312C3.90426 8.09312 3.84675 8.119 3.80684 8.16404L3.57694 8.42387C3.50166 8.50882 3.39364 8.55761 3.28001 8.55761H3.26474C3.94915 9.29096 4.92378 9.74998 6.00596 9.74998C7.08815 9.74998 8.06262 9.29096 8.74719 8.55761H5.57359V8.55745Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n});\nSmallAptosLogo.displayName = \"SmallAptosLogo\";\n","import {\n AdapterNotDetectedWallet,\n AdapterWallet,\n WalletReadyState,\n isRedirectable,\n} from \"@aptos-labs/wallet-adapter-core\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { createContext, forwardRef, useCallback, useContext } from \"react\";\nimport { useWallet } from \"../useWallet\";\nimport { HeadlessComponentProps, createHeadlessComponent } from \"./utils\";\n\nexport interface WalletItemProps extends HeadlessComponentProps {\n /** The wallet option to be displayed. */\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n /** A callback to be invoked when the wallet is connected. */\n onConnect?: () => void;\n}\n\nfunction useWalletItemContext(displayName: string) {\n const context = useContext(WalletItemContext);\n\n if (!context) {\n throw new Error(`\\`${displayName}\\` must be used within \\`WalletItem\\``);\n }\n\n return context;\n}\n\nconst WalletItemContext = createContext<{\n wallet: AdapterWallet | AdapterNotDetectedWallet;\n connectWallet: () => void;\n} | null>(null);\n\nconst Root = forwardRef<HTMLDivElement, WalletItemProps>(\n ({ wallet, onConnect, className, asChild, children }, ref) => {\n const { connect } = useWallet();\n\n const connectWallet = useCallback(() => {\n connect(wallet.name);\n onConnect?.();\n }, [connect, wallet.name, onConnect]);\n\n const isWalletReady = wallet.readyState === WalletReadyState.Installed;\n\n const mobileSupport =\n \"deeplinkProvider\" in wallet && wallet.deeplinkProvider;\n\n if (!isWalletReady && isRedirectable() && !mobileSupport) return null;\n\n const Component = asChild ? Slot : \"div\";\n\n return (\n <WalletItemContext.Provider value={{ wallet, connectWallet }}>\n <Component ref={ref} className={className}>\n {children}\n </Component>\n </WalletItemContext.Provider>\n );\n },\n);\nRoot.displayName = \"WalletItem\";\n\nconst Icon = createHeadlessComponent(\n \"WalletItem.Icon\",\n \"img\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n src: context.wallet.icon,\n alt: `${context.wallet.name} icon`,\n };\n },\n);\n\nconst Name = createHeadlessComponent(\n \"WalletItem.Name\",\n \"div\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n children: context.wallet.name,\n };\n },\n);\n\nconst ConnectButton = createHeadlessComponent(\n \"WalletItem.ConnectButton\",\n \"button\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n onClick: context.connectWallet,\n children: \"Connect\",\n };\n },\n);\n\nconst InstallLink = createHeadlessComponent(\n \"WalletItem.InstallLink\",\n \"a\",\n (displayName) => {\n const context = useWalletItemContext(displayName);\n\n return {\n href: context.wallet.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: \"Install\",\n };\n },\n);\n\n/** A headless component for rendering a wallet option's name, icon, and either connect button or install link. */\nexport const WalletItem = Object.assign(Root, {\n Icon,\n Name,\n ConnectButton,\n InstallLink,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,4CAAd;;;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e,6CAAiB;AAE7D,UAAM,gBACJ,sBAAsB,UAAU,OAAO;AAEzC,QAAI,CAAC,qBAAiB,4CAAe,KAAK,CAAC,cAAe,QAAO;AAEjE,UAAM,YAAY,UAAU,0BAAO;AAEnC,WACE,8CAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,QAAQ,cAAc,GACzD,wDAAC,aAAU,KAAU,WAClB,UACH,GACF;AAAA,EAEJ;AACF;AACAA,MAAK,cAAc;AAEnB,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,KAAK,QAAQ,OAAO;AAAA,MACpB,KAAK,GAAG,QAAQ,OAAO,IAAI;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,IAAM,OAAO;AAAA,EACX;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,UAAU,QAAQ,OAAO;AAAA,IAC3B;AAAA,EACF;AACF;AAEA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,SAAS,QAAQ;AAAA,MACjB,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAEA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA,CAAC,gBAAgB;AACf,UAAM,UAAU,qBAAqB,WAAW;AAEhD,WAAO;AAAA,MACL,MAAM,QAAQ,OAAO;AAAA,MACrB,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AACF;AAGO,IAAM,aAAa,OAAO,OAAOA,OAAM;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["EXPLORE_ECOSYSTEM_URL","import_react","walletCore","network","wallet","wallets","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","EXPLORE_ECOSYSTEM_URL","educationScreens","educationScreenIndicators","Root","Trigger","import_react","import_react","import_jsx_runtime","import_jsx_runtime","Root","import_wallet_adapter_core","import_react_slot","import_react","import_jsx_runtime","Root"]}
|
package/dist/index.mjs
CHANGED
|
@@ -653,14 +653,131 @@ var AboutAptosConnect = Object.assign(Root, {
|
|
|
653
653
|
Trigger
|
|
654
654
|
});
|
|
655
655
|
|
|
656
|
+
// src/components/AboutPetraWeb.tsx
|
|
657
|
+
import {
|
|
658
|
+
createContext as createContext3,
|
|
659
|
+
useContext as useContext3,
|
|
660
|
+
useMemo as useMemo2,
|
|
661
|
+
useState as useState3
|
|
662
|
+
} from "react";
|
|
663
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
664
|
+
var EXPLORE_ECOSYSTEM_URL2 = "https://aptosnetwork.com/ecosystem/directory/category/defi";
|
|
665
|
+
var AboutPetraWebContext = createContext3(null);
|
|
666
|
+
function useAboutPetraWebContext(displayName) {
|
|
667
|
+
const context = useContext3(AboutPetraWebContext);
|
|
668
|
+
if (!context) {
|
|
669
|
+
throw new Error(`\`${displayName}\` must be used within \`AboutPetraWeb\``);
|
|
670
|
+
}
|
|
671
|
+
return context;
|
|
672
|
+
}
|
|
673
|
+
var educationScreens2 = [
|
|
674
|
+
{
|
|
675
|
+
Graphic: LinkGraphic,
|
|
676
|
+
Title: createHeadlessComponent("EducationScreen.Title", "h3", {
|
|
677
|
+
children: "A better way to login."
|
|
678
|
+
}),
|
|
679
|
+
Description: createHeadlessComponent("EducationScreen.Description", "p", {
|
|
680
|
+
children: "Petra Web is a web3 wallet that uses a Social Login to create accounts on the Aptos blockchain."
|
|
681
|
+
})
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
Graphic: WalletGraphic,
|
|
685
|
+
Title: createHeadlessComponent("EducationScreen.Title", "h2", {
|
|
686
|
+
children: "What is a wallet?"
|
|
687
|
+
}),
|
|
688
|
+
Description: createHeadlessComponent("EducationScreen.Description", "p", {
|
|
689
|
+
children: "Wallets are a secure way to send, receive, and interact with digital assets like cryptocurrencies & NFTs."
|
|
690
|
+
})
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
Graphic: Web3Graphic,
|
|
694
|
+
Title: createHeadlessComponent("EducationScreen.Title", "h2", {
|
|
695
|
+
children: "Explore more of web3."
|
|
696
|
+
}),
|
|
697
|
+
Description: createHeadlessComponent("EducationScreen.Description", "p", {
|
|
698
|
+
children: /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
699
|
+
"Petra Web lets you take one account across any application built on Aptos.",
|
|
700
|
+
" ",
|
|
701
|
+
/* @__PURE__ */ jsx7(
|
|
702
|
+
"a",
|
|
703
|
+
{
|
|
704
|
+
href: EXPLORE_ECOSYSTEM_URL2,
|
|
705
|
+
target: "_blank",
|
|
706
|
+
rel: "noopener noreferrer",
|
|
707
|
+
children: "Explore the ecosystem"
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
"."
|
|
711
|
+
] })
|
|
712
|
+
})
|
|
713
|
+
}
|
|
714
|
+
];
|
|
715
|
+
var educationScreenIndicators2 = Array(educationScreens2.length).fill(null).map(
|
|
716
|
+
(_, index) => createHeadlessComponent(
|
|
717
|
+
"AboutPetraWeb.ScreenIndicator",
|
|
718
|
+
"button",
|
|
719
|
+
(displayName) => {
|
|
720
|
+
const context = useAboutPetraWebContext(displayName);
|
|
721
|
+
const isActive = context.screenIndex - 1 === index;
|
|
722
|
+
return {
|
|
723
|
+
"aria-label": `Go to screen ${index + 1}`,
|
|
724
|
+
"aria-current": isActive ? "step" : void 0,
|
|
725
|
+
"data-active": isActive || void 0,
|
|
726
|
+
onClick: () => {
|
|
727
|
+
context.setScreenIndex(index + 1);
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
)
|
|
732
|
+
);
|
|
733
|
+
var Root2 = ({ renderEducationScreen, children }) => {
|
|
734
|
+
const [screenIndex, setScreenIndex] = useState3(0);
|
|
735
|
+
const currentEducationScreen = useMemo2(
|
|
736
|
+
() => educationScreens2.map((screen, i) => __spreadProps(__spreadValues({}, screen), {
|
|
737
|
+
screenIndex: i,
|
|
738
|
+
totalScreens: educationScreens2.length,
|
|
739
|
+
screenIndicators: educationScreenIndicators2,
|
|
740
|
+
back: () => {
|
|
741
|
+
setScreenIndex(screenIndex - 1);
|
|
742
|
+
},
|
|
743
|
+
next: () => {
|
|
744
|
+
setScreenIndex(
|
|
745
|
+
screenIndex === educationScreens2.length ? 0 : screenIndex + 1
|
|
746
|
+
);
|
|
747
|
+
},
|
|
748
|
+
cancel: () => {
|
|
749
|
+
setScreenIndex(0);
|
|
750
|
+
}
|
|
751
|
+
}))[screenIndex - 1],
|
|
752
|
+
[screenIndex]
|
|
753
|
+
);
|
|
754
|
+
return /* @__PURE__ */ jsx7(AboutPetraWebContext.Provider, { value: { screenIndex, setScreenIndex }, children: screenIndex === 0 ? children : renderEducationScreen(currentEducationScreen) });
|
|
755
|
+
};
|
|
756
|
+
Root2.displayName = "AboutPetraWeb";
|
|
757
|
+
var Trigger2 = createHeadlessComponent(
|
|
758
|
+
"AboutPetraWeb.Trigger",
|
|
759
|
+
"button",
|
|
760
|
+
(displayName) => {
|
|
761
|
+
const context = useAboutPetraWebContext(displayName);
|
|
762
|
+
return {
|
|
763
|
+
onClick: () => {
|
|
764
|
+
context.setScreenIndex(1);
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
var AboutPetraWeb = Object.assign(Root2, {
|
|
770
|
+
Trigger: Trigger2
|
|
771
|
+
});
|
|
772
|
+
|
|
656
773
|
// src/components/AptosPrivacyPolicy.tsx
|
|
657
774
|
import { forwardRef as forwardRef6 } from "react";
|
|
658
775
|
|
|
659
776
|
// src/graphics/SmallAptosLogo.tsx
|
|
660
777
|
import { forwardRef as forwardRef5 } from "react";
|
|
661
|
-
import { jsx as
|
|
778
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
662
779
|
var SmallAptosLogo = forwardRef5((props, ref) => {
|
|
663
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ jsx8(
|
|
664
781
|
"svg",
|
|
665
782
|
__spreadProps(__spreadValues({
|
|
666
783
|
ref,
|
|
@@ -669,7 +786,7 @@ var SmallAptosLogo = forwardRef5((props, ref) => {
|
|
|
669
786
|
viewBox: "0 0 12 12",
|
|
670
787
|
fill: "none"
|
|
671
788
|
}, props), {
|
|
672
|
-
children: /* @__PURE__ */
|
|
789
|
+
children: /* @__PURE__ */ jsx8(
|
|
673
790
|
"path",
|
|
674
791
|
{
|
|
675
792
|
fillRule: "evenodd",
|
|
@@ -684,9 +801,9 @@ var SmallAptosLogo = forwardRef5((props, ref) => {
|
|
|
684
801
|
SmallAptosLogo.displayName = "SmallAptosLogo";
|
|
685
802
|
|
|
686
803
|
// src/components/AptosPrivacyPolicy.tsx
|
|
687
|
-
import { jsx as
|
|
804
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
688
805
|
var APTOS_PRIVACY_POLICY_URL = "https://aptoslabs.com/privacy";
|
|
689
|
-
var
|
|
806
|
+
var Root3 = createHeadlessComponent("AptosPrivacyPolicy.Root", "div");
|
|
690
807
|
var Disclaimer = createHeadlessComponent(
|
|
691
808
|
"AptosPrivacyPolicy.Disclaimer",
|
|
692
809
|
"span",
|
|
@@ -699,14 +816,14 @@ var Link = createHeadlessComponent("AptosPrivacyPolicy.Disclaimer", "a", {
|
|
|
699
816
|
children: "Privacy Policy"
|
|
700
817
|
});
|
|
701
818
|
var PoweredBy = forwardRef6(({ className }, ref) => {
|
|
702
|
-
return /* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
819
|
+
return /* @__PURE__ */ jsxs6("div", { ref, className, children: [
|
|
820
|
+
/* @__PURE__ */ jsx9("span", { children: "Powered by" }),
|
|
821
|
+
/* @__PURE__ */ jsx9(SmallAptosLogo, {}),
|
|
822
|
+
/* @__PURE__ */ jsx9("span", { children: "Aptos Labs" })
|
|
706
823
|
] });
|
|
707
824
|
});
|
|
708
825
|
PoweredBy.displayName = "AptosPrivacyPolicy.PoweredBy";
|
|
709
|
-
var AptosPrivacyPolicy = Object.assign(
|
|
826
|
+
var AptosPrivacyPolicy = Object.assign(Root3, {
|
|
710
827
|
Disclaimer,
|
|
711
828
|
Link,
|
|
712
829
|
PoweredBy
|
|
@@ -718,17 +835,17 @@ import {
|
|
|
718
835
|
isRedirectable
|
|
719
836
|
} from "@aptos-labs/wallet-adapter-core";
|
|
720
837
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
721
|
-
import { createContext as
|
|
722
|
-
import { jsx as
|
|
838
|
+
import { createContext as createContext4, forwardRef as forwardRef7, useCallback as useCallback2, useContext as useContext4 } from "react";
|
|
839
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
723
840
|
function useWalletItemContext(displayName) {
|
|
724
|
-
const context =
|
|
841
|
+
const context = useContext4(WalletItemContext);
|
|
725
842
|
if (!context) {
|
|
726
843
|
throw new Error(`\`${displayName}\` must be used within \`WalletItem\``);
|
|
727
844
|
}
|
|
728
845
|
return context;
|
|
729
846
|
}
|
|
730
|
-
var WalletItemContext =
|
|
731
|
-
var
|
|
847
|
+
var WalletItemContext = createContext4(null);
|
|
848
|
+
var Root4 = forwardRef7(
|
|
732
849
|
({ wallet, onConnect, className, asChild, children }, ref) => {
|
|
733
850
|
const { connect } = useWallet();
|
|
734
851
|
const connectWallet = useCallback2(() => {
|
|
@@ -739,10 +856,10 @@ var Root3 = forwardRef7(
|
|
|
739
856
|
const mobileSupport = "deeplinkProvider" in wallet && wallet.deeplinkProvider;
|
|
740
857
|
if (!isWalletReady && isRedirectable() && !mobileSupport) return null;
|
|
741
858
|
const Component = asChild ? Slot2 : "div";
|
|
742
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ jsx10(WalletItemContext.Provider, { value: { wallet, connectWallet }, children: /* @__PURE__ */ jsx10(Component, { ref, className, children }) });
|
|
743
860
|
}
|
|
744
861
|
);
|
|
745
|
-
|
|
862
|
+
Root4.displayName = "WalletItem";
|
|
746
863
|
var Icon = createHeadlessComponent(
|
|
747
864
|
"WalletItem.Icon",
|
|
748
865
|
"img",
|
|
@@ -760,7 +877,7 @@ var Name = createHeadlessComponent(
|
|
|
760
877
|
(displayName) => {
|
|
761
878
|
const context = useWalletItemContext(displayName);
|
|
762
879
|
return {
|
|
763
|
-
children:
|
|
880
|
+
children: context.wallet.name
|
|
764
881
|
};
|
|
765
882
|
}
|
|
766
883
|
);
|
|
@@ -788,7 +905,7 @@ var InstallLink = createHeadlessComponent(
|
|
|
788
905
|
};
|
|
789
906
|
}
|
|
790
907
|
);
|
|
791
|
-
var WalletItem = Object.assign(
|
|
908
|
+
var WalletItem = Object.assign(Root4, {
|
|
792
909
|
Icon,
|
|
793
910
|
Name,
|
|
794
911
|
ConnectButton,
|
|
@@ -797,9 +914,10 @@ var WalletItem = Object.assign(Root3, {
|
|
|
797
914
|
export {
|
|
798
915
|
APTOS_PRIVACY_POLICY_URL,
|
|
799
916
|
AboutAptosConnect,
|
|
917
|
+
AboutPetraWeb,
|
|
800
918
|
AptosPrivacyPolicy,
|
|
801
919
|
AptosWalletAdapterProvider,
|
|
802
|
-
EXPLORE_ECOSYSTEM_URL,
|
|
920
|
+
EXPLORE_ECOSYSTEM_URL2 as EXPLORE_ECOSYSTEM_URL,
|
|
803
921
|
WalletContext,
|
|
804
922
|
WalletItem,
|
|
805
923
|
useWallet
|