@kheopskit/react 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -103,7 +103,9 @@ var KheopskitProvider = ({
|
|
|
103
103
|
const cached = kheopskitStore.getCachedState();
|
|
104
104
|
return {
|
|
105
105
|
wallets: cached.wallets.map(import_core.hydrateWallet),
|
|
106
|
-
accounts: cached.accounts.map(import_core.hydrateAccount)
|
|
106
|
+
accounts: cached.accounts.map(import_core.hydrateAccount).filter(
|
|
107
|
+
(account) => account.platform !== "polkadot" || resolvedConfig.polkadotAccountTypes.includes(account.type)
|
|
108
|
+
),
|
|
107
109
|
config: resolvedConfig,
|
|
108
110
|
isHydrating: true
|
|
109
111
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/KheopskitProvider.tsx","../src/context.ts","../src/createStore.ts","../src/useWallets.ts"],"sourcesContent":["export * from \"./KheopskitProvider\";\nexport * from \"./useWallets\";\n","import {\n\tcreateKheopskitStore,\n\tgetCachedIcon,\n\tgetKheopskit$,\n\thydrateAccount,\n\thydrateWallet,\n\ttype KheopskitConfig,\n\ttype KheopskitState,\n\tresolveConfig,\n} from \"@kheopskit/core\";\nimport {\n\ttype FC,\n\ttype PropsWithChildren,\n\tuseEffect,\n\tuseMemo,\n\tuseSyncExternalStore,\n} from \"react\";\nimport { KheopskitContext } from \"./context\";\nimport { createStore } from \"./createStore\";\n\nexport type KheopskitProviderProps = PropsWithChildren & {\n\tconfig?: Partial<KheopskitConfig>;\n\t/**\n\t * Cookie string for SSR hydration.\n\t * Pass the request cookie header (e.g., from Next.js headers or TanStack Start)\n\t * to hydrate wallet state on the server.\n\t *\n\t * @remarks\n\t * This value should be stable per render to avoid unnecessary store recreation.\n\t * Compute it once in your server component or layout and pass it down.\n\t *\n\t * @example\n\t * ```tsx\n\t * // Next.js App Router\n\t * const cookieStore = await cookies();\n\t * const ssrCookies = cookieStore.getAll().map(c => `${c.name}=${c.value}`).join('; ');\n\t * return <Providers ssrCookies={ssrCookies}>{children}</Providers>\n\t * ```\n\t */\n\tssrCookies?: string;\n};\n\nexport const KheopskitProvider: FC<KheopskitProviderProps> = ({\n\tchildren,\n\tconfig,\n\tssrCookies,\n}) => {\n\tconst resolvedConfig = useMemo(() => resolveConfig(config), [config]);\n\n\t// Create a single store for both reading cached state and powering the observable\n\tconst kheopskitStore = useMemo(\n\t\t() =>\n\t\t\tcreateKheopskitStore({\n\t\t\t\tssrCookies,\n\t\t\t\tstorageKey: resolvedConfig.storageKey,\n\t\t\t}),\n\t\t[ssrCookies, resolvedConfig.storageKey],\n\t);\n\n\t// Read cached state from the store for SSR hydration\n\t// This produces wallets WITHOUT localStorage icons (Ethereum wallets have no icon)\n\t// because localStorage isn't available on server\n\tconst serverValue = useMemo<KheopskitState>(() => {\n\t\tif (ssrCookies === undefined) {\n\t\t\treturn {\n\t\t\t\twallets: [],\n\t\t\t\taccounts: [],\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\tisHydrating: true,\n\t\t\t};\n\t\t}\n\t\tconst cached = kheopskitStore.getCachedState();\n\t\treturn {\n\t\t\twallets: cached.wallets.map(hydrateWallet),\n\t\t\taccounts: cached.accounts.map(hydrateAccount),\n\t\t\tconfig: resolvedConfig,\n\t\t\tisHydrating: true,\n\t\t};\n\t}, [ssrCookies, kheopskitStore, resolvedConfig]);\n\n\t// Initial value for client includes localStorage icons\n\t// This is what we WANT the client to render, not what server rendered\n\tconst initialValue = useMemo<KheopskitState>(() => {\n\t\t// On client, enrich wallets with localStorage icons\n\t\t// getCachedIcon returns empty on server (no localStorage), so this is safe\n\t\tconst enrichedWallets = serverValue.wallets.map((w) => {\n\t\t\tif (!w.icon) {\n\t\t\t\tconst cachedIcon = getCachedIcon(w.id);\n\t\t\t\tif (cachedIcon) {\n\t\t\t\t\treturn { ...w, icon: cachedIcon };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn w;\n\t\t});\n\t\treturn {\n\t\t\t...serverValue,\n\t\t\twallets: enrichedWallets,\n\t\t};\n\t}, [serverValue]);\n\n\tconst store = useMemo(\n\t\t() =>\n\t\t\tcreateStore(\n\t\t\t\tgetKheopskit$(config, ssrCookies, kheopskitStore),\n\t\t\t\tinitialValue,\n\t\t\t\tserverValue,\n\t\t\t),\n\t\t[config, ssrCookies, kheopskitStore, initialValue, serverValue],\n\t);\n\n\t// Cleanup store subscriptions when store changes or component unmounts\n\tuseEffect(() => {\n\t\treturn () => store.destroy();\n\t}, [store]);\n\n\tconst state = useSyncExternalStore(\n\t\tstore.subscribe,\n\t\tstore.getSnapshot,\n\t\tstore.getServerSnapshot,\n\t);\n\n\tconst value = useMemo(() => ({ state }), [state]);\n\n\treturn (\n\t\t<KheopskitContext.Provider value={value}>\n\t\t\t{children}\n\t\t</KheopskitContext.Provider>\n\t);\n};\n","import type { KheopskitState } from \"@kheopskit/core\";\nimport { createContext } from \"react\";\n\nexport const KheopskitContext = createContext<{\n\tstate: KheopskitState;\n} | null>(null);\n","import type { Observable, Subscription } from \"rxjs\";\n\nexport const createStore = <T>(\n\tobservable$: Observable<T>,\n\tinitialValue: T,\n\tserverValue?: T,\n) => {\n\t// Use null as sentinel to indicate we haven't received first emission yet\n\tlet latestValue: T | null = null;\n\tlet subscription: Subscription | null = null;\n\tlet subscriberCount = 0;\n\tconst listeners = new Set<(value: T) => void>();\n\n\tconst ensureSubscription = () => {\n\t\tif (!subscription || subscription.closed) {\n\t\t\tsubscription = observable$.subscribe((value) => {\n\t\t\t\tlatestValue = value;\n\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\tlistener(value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\t// Start subscription immediately\n\tensureSubscription();\n\n\t// If observable emitted synchronously, use that value\n\t// Otherwise fall back to initialValue\n\tconst getSnapshot = () => latestValue ?? initialValue;\n\n\t/**\n\t * Returns the server-side snapshot for SSR hydration.\n\t * This prevents hydration mismatches by providing a consistent\n\t * value during server rendering. Must return the same value as\n\t * what the server rendered.\n\t */\n\tconst getServerSnapshot = () => serverValue ?? initialValue;\n\n\tconst subscribe = (callback: (value: T) => void) => {\n\t\tsubscriberCount++;\n\t\tlisteners.add(callback);\n\t\t// Ensure observable subscription is active when someone subscribes\n\t\tensureSubscription();\n\n\t\t// Immediately emit current value (BehaviorSubject semantics)\n\t\tcallback(getSnapshot());\n\n\t\treturn () => {\n\t\t\tsubscriberCount--;\n\t\t\tlisteners.delete(callback);\n\t\t\t// Don't close the observable subscription on unsubscribe\n\t\t\t// Let destroy() handle that when the store is truly being disposed\n\t\t};\n\t};\n\n\tconst destroy = () => {\n\t\t// Only unsubscribe if no one is listening\n\t\t// React StrictMode may call destroy and then immediately resubscribe\n\t\tif (subscriberCount === 0 && subscription) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription = null;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetSnapshot,\n\t\tgetServerSnapshot,\n\t\tsubscribe,\n\t\tdestroy,\n\t};\n};\n","import { useContext } from \"react\";\nimport { KheopskitContext } from \"./context\";\n\nexport const useWallets = () => {\n\tconst ctx = useContext(KheopskitContext);\n\n\t// useEffect(() => {\n\t// console.debug(\n\t// \"useWallets wallets:%s accounts:%s\",\n\t// ctx?.state.wallets.length ?? 0,\n\t// ctx?.state.accounts.length ?? 0,\n\t// );\n\t// }, [ctx?.state]);\n\n\tif (!ctx)\n\t\tthrow new Error(\"useWallets can't be used without a KheopskitProvider\");\n\n\treturn ctx.state;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBASO;AACP,IAAAA,gBAMO;;;ACfP,mBAA8B;AAEvB,IAAM,uBAAmB,4BAEtB,IAAI;;;ACHP,IAAM,cAAc,CAC1B,aACA,cACA,gBACI;AAEJ,MAAI,cAAwB;AAC5B,MAAI,eAAoC;AACxC,MAAI,kBAAkB;AACtB,QAAM,YAAY,oBAAI,IAAwB;AAE9C,QAAM,qBAAqB,MAAM;AAChC,QAAI,CAAC,gBAAgB,aAAa,QAAQ;AACzC,qBAAe,YAAY,UAAU,CAAC,UAAU;AAC/C,sBAAc;AACd,mBAAW,YAAY,WAAW;AACjC,mBAAS,KAAK;AAAA,QACf;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAGA,qBAAmB;AAInB,QAAM,cAAc,MAAM,eAAe;AAQzC,QAAM,oBAAoB,MAAM,eAAe;AAE/C,QAAM,YAAY,CAAC,aAAiC;AACnD;AACA,cAAU,IAAI,QAAQ;AAEtB,uBAAmB;AAGnB,aAAS,YAAY,CAAC;AAEtB,WAAO,MAAM;AACZ;AACA,gBAAU,OAAO,QAAQ;AAAA,IAG1B;AAAA,EACD;AAEA,QAAM,UAAU,MAAM;AAGrB,QAAI,oBAAoB,KAAK,cAAc;AAC1C,mBAAa,YAAY;AACzB,qBAAe;AAAA,IAChB;AAAA,EACD;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/KheopskitProvider.tsx","../src/context.ts","../src/createStore.ts","../src/useWallets.ts"],"sourcesContent":["export * from \"./KheopskitProvider\";\nexport * from \"./useWallets\";\n","import {\n\tcreateKheopskitStore,\n\tgetCachedIcon,\n\tgetKheopskit$,\n\thydrateAccount,\n\thydrateWallet,\n\ttype KheopskitConfig,\n\ttype KheopskitState,\n\tresolveConfig,\n} from \"@kheopskit/core\";\nimport {\n\ttype FC,\n\ttype PropsWithChildren,\n\tuseEffect,\n\tuseMemo,\n\tuseSyncExternalStore,\n} from \"react\";\nimport { KheopskitContext } from \"./context\";\nimport { createStore } from \"./createStore\";\n\nexport type KheopskitProviderProps = PropsWithChildren & {\n\tconfig?: Partial<KheopskitConfig>;\n\t/**\n\t * Cookie string for SSR hydration.\n\t * Pass the request cookie header (e.g., from Next.js headers or TanStack Start)\n\t * to hydrate wallet state on the server.\n\t *\n\t * @remarks\n\t * This value should be stable per render to avoid unnecessary store recreation.\n\t * Compute it once in your server component or layout and pass it down.\n\t *\n\t * @example\n\t * ```tsx\n\t * // Next.js App Router\n\t * const cookieStore = await cookies();\n\t * const ssrCookies = cookieStore.getAll().map(c => `${c.name}=${c.value}`).join('; ');\n\t * return <Providers ssrCookies={ssrCookies}>{children}</Providers>\n\t * ```\n\t */\n\tssrCookies?: string;\n};\n\nexport const KheopskitProvider: FC<KheopskitProviderProps> = ({\n\tchildren,\n\tconfig,\n\tssrCookies,\n}) => {\n\tconst resolvedConfig = useMemo(() => resolveConfig(config), [config]);\n\n\t// Create a single store for both reading cached state and powering the observable\n\tconst kheopskitStore = useMemo(\n\t\t() =>\n\t\t\tcreateKheopskitStore({\n\t\t\t\tssrCookies,\n\t\t\t\tstorageKey: resolvedConfig.storageKey,\n\t\t\t}),\n\t\t[ssrCookies, resolvedConfig.storageKey],\n\t);\n\n\t// Read cached state from the store for SSR hydration\n\t// This produces wallets WITHOUT localStorage icons (Ethereum wallets have no icon)\n\t// because localStorage isn't available on server\n\tconst serverValue = useMemo<KheopskitState>(() => {\n\t\tif (ssrCookies === undefined) {\n\t\t\treturn {\n\t\t\t\twallets: [],\n\t\t\t\taccounts: [],\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\tisHydrating: true,\n\t\t\t};\n\t\t}\n\t\tconst cached = kheopskitStore.getCachedState();\n\t\treturn {\n\t\t\twallets: cached.wallets.map(hydrateWallet),\n\t\t\taccounts: cached.accounts\n\t\t\t\t.map(hydrateAccount)\n\t\t\t\t.filter(\n\t\t\t\t\t(account) =>\n\t\t\t\t\t\taccount.platform !== \"polkadot\" ||\n\t\t\t\t\t\tresolvedConfig.polkadotAccountTypes.includes(account.type),\n\t\t\t\t),\n\t\t\tconfig: resolvedConfig,\n\t\t\tisHydrating: true,\n\t\t};\n\t}, [ssrCookies, kheopskitStore, resolvedConfig]);\n\n\t// Initial value for client includes localStorage icons\n\t// This is what we WANT the client to render, not what server rendered\n\tconst initialValue = useMemo<KheopskitState>(() => {\n\t\t// On client, enrich wallets with localStorage icons\n\t\t// getCachedIcon returns empty on server (no localStorage), so this is safe\n\t\tconst enrichedWallets = serverValue.wallets.map((w) => {\n\t\t\tif (!w.icon) {\n\t\t\t\tconst cachedIcon = getCachedIcon(w.id);\n\t\t\t\tif (cachedIcon) {\n\t\t\t\t\treturn { ...w, icon: cachedIcon };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn w;\n\t\t});\n\t\treturn {\n\t\t\t...serverValue,\n\t\t\twallets: enrichedWallets,\n\t\t};\n\t}, [serverValue]);\n\n\tconst store = useMemo(\n\t\t() =>\n\t\t\tcreateStore(\n\t\t\t\tgetKheopskit$(config, ssrCookies, kheopskitStore),\n\t\t\t\tinitialValue,\n\t\t\t\tserverValue,\n\t\t\t),\n\t\t[config, ssrCookies, kheopskitStore, initialValue, serverValue],\n\t);\n\n\t// Cleanup store subscriptions when store changes or component unmounts\n\tuseEffect(() => {\n\t\treturn () => store.destroy();\n\t}, [store]);\n\n\tconst state = useSyncExternalStore(\n\t\tstore.subscribe,\n\t\tstore.getSnapshot,\n\t\tstore.getServerSnapshot,\n\t);\n\n\tconst value = useMemo(() => ({ state }), [state]);\n\n\treturn (\n\t\t<KheopskitContext.Provider value={value}>\n\t\t\t{children}\n\t\t</KheopskitContext.Provider>\n\t);\n};\n","import type { KheopskitState } from \"@kheopskit/core\";\nimport { createContext } from \"react\";\n\nexport const KheopskitContext = createContext<{\n\tstate: KheopskitState;\n} | null>(null);\n","import type { Observable, Subscription } from \"rxjs\";\n\nexport const createStore = <T>(\n\tobservable$: Observable<T>,\n\tinitialValue: T,\n\tserverValue?: T,\n) => {\n\t// Use null as sentinel to indicate we haven't received first emission yet\n\tlet latestValue: T | null = null;\n\tlet subscription: Subscription | null = null;\n\tlet subscriberCount = 0;\n\tconst listeners = new Set<(value: T) => void>();\n\n\tconst ensureSubscription = () => {\n\t\tif (!subscription || subscription.closed) {\n\t\t\tsubscription = observable$.subscribe((value) => {\n\t\t\t\tlatestValue = value;\n\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\tlistener(value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\t// Start subscription immediately\n\tensureSubscription();\n\n\t// If observable emitted synchronously, use that value\n\t// Otherwise fall back to initialValue\n\tconst getSnapshot = () => latestValue ?? initialValue;\n\n\t/**\n\t * Returns the server-side snapshot for SSR hydration.\n\t * This prevents hydration mismatches by providing a consistent\n\t * value during server rendering. Must return the same value as\n\t * what the server rendered.\n\t */\n\tconst getServerSnapshot = () => serverValue ?? initialValue;\n\n\tconst subscribe = (callback: (value: T) => void) => {\n\t\tsubscriberCount++;\n\t\tlisteners.add(callback);\n\t\t// Ensure observable subscription is active when someone subscribes\n\t\tensureSubscription();\n\n\t\t// Immediately emit current value (BehaviorSubject semantics)\n\t\tcallback(getSnapshot());\n\n\t\treturn () => {\n\t\t\tsubscriberCount--;\n\t\t\tlisteners.delete(callback);\n\t\t\t// Don't close the observable subscription on unsubscribe\n\t\t\t// Let destroy() handle that when the store is truly being disposed\n\t\t};\n\t};\n\n\tconst destroy = () => {\n\t\t// Only unsubscribe if no one is listening\n\t\t// React StrictMode may call destroy and then immediately resubscribe\n\t\tif (subscriberCount === 0 && subscription) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription = null;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetSnapshot,\n\t\tgetServerSnapshot,\n\t\tsubscribe,\n\t\tdestroy,\n\t};\n};\n","import { useContext } from \"react\";\nimport { KheopskitContext } from \"./context\";\n\nexport const useWallets = () => {\n\tconst ctx = useContext(KheopskitContext);\n\n\t// useEffect(() => {\n\t// console.debug(\n\t// \"useWallets wallets:%s accounts:%s\",\n\t// ctx?.state.wallets.length ?? 0,\n\t// ctx?.state.accounts.length ?? 0,\n\t// );\n\t// }, [ctx?.state]);\n\n\tif (!ctx)\n\t\tthrow new Error(\"useWallets can't be used without a KheopskitProvider\");\n\n\treturn ctx.state;\n};\n"],"mappings":"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","names":["import_react","import_react"]}
|
package/dist/index.mjs
CHANGED
|
@@ -87,7 +87,9 @@ var KheopskitProvider = ({
|
|
|
87
87
|
const cached = kheopskitStore.getCachedState();
|
|
88
88
|
return {
|
|
89
89
|
wallets: cached.wallets.map(hydrateWallet),
|
|
90
|
-
accounts: cached.accounts.map(hydrateAccount)
|
|
90
|
+
accounts: cached.accounts.map(hydrateAccount).filter(
|
|
91
|
+
(account) => account.platform !== "polkadot" || resolvedConfig.polkadotAccountTypes.includes(account.type)
|
|
92
|
+
),
|
|
91
93
|
config: resolvedConfig,
|
|
92
94
|
isHydrating: true
|
|
93
95
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/KheopskitProvider.tsx","../src/context.ts","../src/createStore.ts","../src/useWallets.ts"],"sourcesContent":["import {\n\tcreateKheopskitStore,\n\tgetCachedIcon,\n\tgetKheopskit$,\n\thydrateAccount,\n\thydrateWallet,\n\ttype KheopskitConfig,\n\ttype KheopskitState,\n\tresolveConfig,\n} from \"@kheopskit/core\";\nimport {\n\ttype FC,\n\ttype PropsWithChildren,\n\tuseEffect,\n\tuseMemo,\n\tuseSyncExternalStore,\n} from \"react\";\nimport { KheopskitContext } from \"./context\";\nimport { createStore } from \"./createStore\";\n\nexport type KheopskitProviderProps = PropsWithChildren & {\n\tconfig?: Partial<KheopskitConfig>;\n\t/**\n\t * Cookie string for SSR hydration.\n\t * Pass the request cookie header (e.g., from Next.js headers or TanStack Start)\n\t * to hydrate wallet state on the server.\n\t *\n\t * @remarks\n\t * This value should be stable per render to avoid unnecessary store recreation.\n\t * Compute it once in your server component or layout and pass it down.\n\t *\n\t * @example\n\t * ```tsx\n\t * // Next.js App Router\n\t * const cookieStore = await cookies();\n\t * const ssrCookies = cookieStore.getAll().map(c => `${c.name}=${c.value}`).join('; ');\n\t * return <Providers ssrCookies={ssrCookies}>{children}</Providers>\n\t * ```\n\t */\n\tssrCookies?: string;\n};\n\nexport const KheopskitProvider: FC<KheopskitProviderProps> = ({\n\tchildren,\n\tconfig,\n\tssrCookies,\n}) => {\n\tconst resolvedConfig = useMemo(() => resolveConfig(config), [config]);\n\n\t// Create a single store for both reading cached state and powering the observable\n\tconst kheopskitStore = useMemo(\n\t\t() =>\n\t\t\tcreateKheopskitStore({\n\t\t\t\tssrCookies,\n\t\t\t\tstorageKey: resolvedConfig.storageKey,\n\t\t\t}),\n\t\t[ssrCookies, resolvedConfig.storageKey],\n\t);\n\n\t// Read cached state from the store for SSR hydration\n\t// This produces wallets WITHOUT localStorage icons (Ethereum wallets have no icon)\n\t// because localStorage isn't available on server\n\tconst serverValue = useMemo<KheopskitState>(() => {\n\t\tif (ssrCookies === undefined) {\n\t\t\treturn {\n\t\t\t\twallets: [],\n\t\t\t\taccounts: [],\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\tisHydrating: true,\n\t\t\t};\n\t\t}\n\t\tconst cached = kheopskitStore.getCachedState();\n\t\treturn {\n\t\t\twallets: cached.wallets.map(hydrateWallet),\n\t\t\taccounts: cached.accounts.map(hydrateAccount),\n\t\t\tconfig: resolvedConfig,\n\t\t\tisHydrating: true,\n\t\t};\n\t}, [ssrCookies, kheopskitStore, resolvedConfig]);\n\n\t// Initial value for client includes localStorage icons\n\t// This is what we WANT the client to render, not what server rendered\n\tconst initialValue = useMemo<KheopskitState>(() => {\n\t\t// On client, enrich wallets with localStorage icons\n\t\t// getCachedIcon returns empty on server (no localStorage), so this is safe\n\t\tconst enrichedWallets = serverValue.wallets.map((w) => {\n\t\t\tif (!w.icon) {\n\t\t\t\tconst cachedIcon = getCachedIcon(w.id);\n\t\t\t\tif (cachedIcon) {\n\t\t\t\t\treturn { ...w, icon: cachedIcon };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn w;\n\t\t});\n\t\treturn {\n\t\t\t...serverValue,\n\t\t\twallets: enrichedWallets,\n\t\t};\n\t}, [serverValue]);\n\n\tconst store = useMemo(\n\t\t() =>\n\t\t\tcreateStore(\n\t\t\t\tgetKheopskit$(config, ssrCookies, kheopskitStore),\n\t\t\t\tinitialValue,\n\t\t\t\tserverValue,\n\t\t\t),\n\t\t[config, ssrCookies, kheopskitStore, initialValue, serverValue],\n\t);\n\n\t// Cleanup store subscriptions when store changes or component unmounts\n\tuseEffect(() => {\n\t\treturn () => store.destroy();\n\t}, [store]);\n\n\tconst state = useSyncExternalStore(\n\t\tstore.subscribe,\n\t\tstore.getSnapshot,\n\t\tstore.getServerSnapshot,\n\t);\n\n\tconst value = useMemo(() => ({ state }), [state]);\n\n\treturn (\n\t\t<KheopskitContext.Provider value={value}>\n\t\t\t{children}\n\t\t</KheopskitContext.Provider>\n\t);\n};\n","import type { KheopskitState } from \"@kheopskit/core\";\nimport { createContext } from \"react\";\n\nexport const KheopskitContext = createContext<{\n\tstate: KheopskitState;\n} | null>(null);\n","import type { Observable, Subscription } from \"rxjs\";\n\nexport const createStore = <T>(\n\tobservable$: Observable<T>,\n\tinitialValue: T,\n\tserverValue?: T,\n) => {\n\t// Use null as sentinel to indicate we haven't received first emission yet\n\tlet latestValue: T | null = null;\n\tlet subscription: Subscription | null = null;\n\tlet subscriberCount = 0;\n\tconst listeners = new Set<(value: T) => void>();\n\n\tconst ensureSubscription = () => {\n\t\tif (!subscription || subscription.closed) {\n\t\t\tsubscription = observable$.subscribe((value) => {\n\t\t\t\tlatestValue = value;\n\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\tlistener(value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\t// Start subscription immediately\n\tensureSubscription();\n\n\t// If observable emitted synchronously, use that value\n\t// Otherwise fall back to initialValue\n\tconst getSnapshot = () => latestValue ?? initialValue;\n\n\t/**\n\t * Returns the server-side snapshot for SSR hydration.\n\t * This prevents hydration mismatches by providing a consistent\n\t * value during server rendering. Must return the same value as\n\t * what the server rendered.\n\t */\n\tconst getServerSnapshot = () => serverValue ?? initialValue;\n\n\tconst subscribe = (callback: (value: T) => void) => {\n\t\tsubscriberCount++;\n\t\tlisteners.add(callback);\n\t\t// Ensure observable subscription is active when someone subscribes\n\t\tensureSubscription();\n\n\t\t// Immediately emit current value (BehaviorSubject semantics)\n\t\tcallback(getSnapshot());\n\n\t\treturn () => {\n\t\t\tsubscriberCount--;\n\t\t\tlisteners.delete(callback);\n\t\t\t// Don't close the observable subscription on unsubscribe\n\t\t\t// Let destroy() handle that when the store is truly being disposed\n\t\t};\n\t};\n\n\tconst destroy = () => {\n\t\t// Only unsubscribe if no one is listening\n\t\t// React StrictMode may call destroy and then immediately resubscribe\n\t\tif (subscriberCount === 0 && subscription) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription = null;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetSnapshot,\n\t\tgetServerSnapshot,\n\t\tsubscribe,\n\t\tdestroy,\n\t};\n};\n","import { useContext } from \"react\";\nimport { KheopskitContext } from \"./context\";\n\nexport const useWallets = () => {\n\tconst ctx = useContext(KheopskitContext);\n\n\t// useEffect(() => {\n\t// console.debug(\n\t// \"useWallets wallets:%s accounts:%s\",\n\t// ctx?.state.wallets.length ?? 0,\n\t// ctx?.state.accounts.length ?? 0,\n\t// );\n\t// }, [ctx?.state]);\n\n\tif (!ctx)\n\t\tthrow new Error(\"useWallets can't be used without a KheopskitProvider\");\n\n\treturn ctx.state;\n};\n"],"mappings":";AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OACM;AACP;AAAA,EAGC;AAAA,EACA;AAAA,EACA;AAAA,OACM;;;ACfP,SAAS,qBAAqB;AAEvB,IAAM,mBAAmB,cAEtB,IAAI;;;ACHP,IAAM,cAAc,CAC1B,aACA,cACA,gBACI;AAEJ,MAAI,cAAwB;AAC5B,MAAI,eAAoC;AACxC,MAAI,kBAAkB;AACtB,QAAM,YAAY,oBAAI,IAAwB;AAE9C,QAAM,qBAAqB,MAAM;AAChC,QAAI,CAAC,gBAAgB,aAAa,QAAQ;AACzC,qBAAe,YAAY,UAAU,CAAC,UAAU;AAC/C,sBAAc;AACd,mBAAW,YAAY,WAAW;AACjC,mBAAS,KAAK;AAAA,QACf;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD;AAGA,qBAAmB;AAInB,QAAM,cAAc,MAAM,eAAe;AAQzC,QAAM,oBAAoB,MAAM,eAAe;AAE/C,QAAM,YAAY,CAAC,aAAiC;AACnD;AACA,cAAU,IAAI,QAAQ;AAEtB,uBAAmB;AAGnB,aAAS,YAAY,CAAC;AAEtB,WAAO,MAAM;AACZ;AACA,gBAAU,OAAO,QAAQ;AAAA,IAG1B;AAAA,EACD;AAEA,QAAM,UAAU,MAAM;AAGrB,QAAI,oBAAoB,KAAK,cAAc;AAC1C,mBAAa,YAAY;AACzB,qBAAe;AAAA,IAChB;AAAA,EACD;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;
|
|
1
|
+
{"version":3,"sources":["../src/KheopskitProvider.tsx","../src/context.ts","../src/createStore.ts","../src/useWallets.ts"],"sourcesContent":["import {\n\tcreateKheopskitStore,\n\tgetCachedIcon,\n\tgetKheopskit$,\n\thydrateAccount,\n\thydrateWallet,\n\ttype KheopskitConfig,\n\ttype KheopskitState,\n\tresolveConfig,\n} from \"@kheopskit/core\";\nimport {\n\ttype FC,\n\ttype PropsWithChildren,\n\tuseEffect,\n\tuseMemo,\n\tuseSyncExternalStore,\n} from \"react\";\nimport { KheopskitContext } from \"./context\";\nimport { createStore } from \"./createStore\";\n\nexport type KheopskitProviderProps = PropsWithChildren & {\n\tconfig?: Partial<KheopskitConfig>;\n\t/**\n\t * Cookie string for SSR hydration.\n\t * Pass the request cookie header (e.g., from Next.js headers or TanStack Start)\n\t * to hydrate wallet state on the server.\n\t *\n\t * @remarks\n\t * This value should be stable per render to avoid unnecessary store recreation.\n\t * Compute it once in your server component or layout and pass it down.\n\t *\n\t * @example\n\t * ```tsx\n\t * // Next.js App Router\n\t * const cookieStore = await cookies();\n\t * const ssrCookies = cookieStore.getAll().map(c => `${c.name}=${c.value}`).join('; ');\n\t * return <Providers ssrCookies={ssrCookies}>{children}</Providers>\n\t * ```\n\t */\n\tssrCookies?: string;\n};\n\nexport const KheopskitProvider: FC<KheopskitProviderProps> = ({\n\tchildren,\n\tconfig,\n\tssrCookies,\n}) => {\n\tconst resolvedConfig = useMemo(() => resolveConfig(config), [config]);\n\n\t// Create a single store for both reading cached state and powering the observable\n\tconst kheopskitStore = useMemo(\n\t\t() =>\n\t\t\tcreateKheopskitStore({\n\t\t\t\tssrCookies,\n\t\t\t\tstorageKey: resolvedConfig.storageKey,\n\t\t\t}),\n\t\t[ssrCookies, resolvedConfig.storageKey],\n\t);\n\n\t// Read cached state from the store for SSR hydration\n\t// This produces wallets WITHOUT localStorage icons (Ethereum wallets have no icon)\n\t// because localStorage isn't available on server\n\tconst serverValue = useMemo<KheopskitState>(() => {\n\t\tif (ssrCookies === undefined) {\n\t\t\treturn {\n\t\t\t\twallets: [],\n\t\t\t\taccounts: [],\n\t\t\t\tconfig: resolvedConfig,\n\t\t\t\tisHydrating: true,\n\t\t\t};\n\t\t}\n\t\tconst cached = kheopskitStore.getCachedState();\n\t\treturn {\n\t\t\twallets: cached.wallets.map(hydrateWallet),\n\t\t\taccounts: cached.accounts\n\t\t\t\t.map(hydrateAccount)\n\t\t\t\t.filter(\n\t\t\t\t\t(account) =>\n\t\t\t\t\t\taccount.platform !== \"polkadot\" ||\n\t\t\t\t\t\tresolvedConfig.polkadotAccountTypes.includes(account.type),\n\t\t\t\t),\n\t\t\tconfig: resolvedConfig,\n\t\t\tisHydrating: true,\n\t\t};\n\t}, [ssrCookies, kheopskitStore, resolvedConfig]);\n\n\t// Initial value for client includes localStorage icons\n\t// This is what we WANT the client to render, not what server rendered\n\tconst initialValue = useMemo<KheopskitState>(() => {\n\t\t// On client, enrich wallets with localStorage icons\n\t\t// getCachedIcon returns empty on server (no localStorage), so this is safe\n\t\tconst enrichedWallets = serverValue.wallets.map((w) => {\n\t\t\tif (!w.icon) {\n\t\t\t\tconst cachedIcon = getCachedIcon(w.id);\n\t\t\t\tif (cachedIcon) {\n\t\t\t\t\treturn { ...w, icon: cachedIcon };\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn w;\n\t\t});\n\t\treturn {\n\t\t\t...serverValue,\n\t\t\twallets: enrichedWallets,\n\t\t};\n\t}, [serverValue]);\n\n\tconst store = useMemo(\n\t\t() =>\n\t\t\tcreateStore(\n\t\t\t\tgetKheopskit$(config, ssrCookies, kheopskitStore),\n\t\t\t\tinitialValue,\n\t\t\t\tserverValue,\n\t\t\t),\n\t\t[config, ssrCookies, kheopskitStore, initialValue, serverValue],\n\t);\n\n\t// Cleanup store subscriptions when store changes or component unmounts\n\tuseEffect(() => {\n\t\treturn () => store.destroy();\n\t}, [store]);\n\n\tconst state = useSyncExternalStore(\n\t\tstore.subscribe,\n\t\tstore.getSnapshot,\n\t\tstore.getServerSnapshot,\n\t);\n\n\tconst value = useMemo(() => ({ state }), [state]);\n\n\treturn (\n\t\t<KheopskitContext.Provider value={value}>\n\t\t\t{children}\n\t\t</KheopskitContext.Provider>\n\t);\n};\n","import type { KheopskitState } from \"@kheopskit/core\";\nimport { createContext } from \"react\";\n\nexport const KheopskitContext = createContext<{\n\tstate: KheopskitState;\n} | null>(null);\n","import type { Observable, Subscription } from \"rxjs\";\n\nexport const createStore = <T>(\n\tobservable$: Observable<T>,\n\tinitialValue: T,\n\tserverValue?: T,\n) => {\n\t// Use null as sentinel to indicate we haven't received first emission yet\n\tlet latestValue: T | null = null;\n\tlet subscription: Subscription | null = null;\n\tlet subscriberCount = 0;\n\tconst listeners = new Set<(value: T) => void>();\n\n\tconst ensureSubscription = () => {\n\t\tif (!subscription || subscription.closed) {\n\t\t\tsubscription = observable$.subscribe((value) => {\n\t\t\t\tlatestValue = value;\n\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\tlistener(value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n\n\t// Start subscription immediately\n\tensureSubscription();\n\n\t// If observable emitted synchronously, use that value\n\t// Otherwise fall back to initialValue\n\tconst getSnapshot = () => latestValue ?? initialValue;\n\n\t/**\n\t * Returns the server-side snapshot for SSR hydration.\n\t * This prevents hydration mismatches by providing a consistent\n\t * value during server rendering. Must return the same value as\n\t * what the server rendered.\n\t */\n\tconst getServerSnapshot = () => serverValue ?? initialValue;\n\n\tconst subscribe = (callback: (value: T) => void) => {\n\t\tsubscriberCount++;\n\t\tlisteners.add(callback);\n\t\t// Ensure observable subscription is active when someone subscribes\n\t\tensureSubscription();\n\n\t\t// Immediately emit current value (BehaviorSubject semantics)\n\t\tcallback(getSnapshot());\n\n\t\treturn () => {\n\t\t\tsubscriberCount--;\n\t\t\tlisteners.delete(callback);\n\t\t\t// Don't close the observable subscription on unsubscribe\n\t\t\t// Let destroy() handle that when the store is truly being disposed\n\t\t};\n\t};\n\n\tconst destroy = () => {\n\t\t// Only unsubscribe if no one is listening\n\t\t// React StrictMode may call destroy and then immediately resubscribe\n\t\tif (subscriberCount === 0 && subscription) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription = null;\n\t\t}\n\t};\n\n\treturn {\n\t\tgetSnapshot,\n\t\tgetServerSnapshot,\n\t\tsubscribe,\n\t\tdestroy,\n\t};\n};\n","import { useContext } from \"react\";\nimport { KheopskitContext } from \"./context\";\n\nexport const useWallets = () => {\n\tconst ctx = useContext(KheopskitContext);\n\n\t// useEffect(() => {\n\t// console.debug(\n\t// \"useWallets wallets:%s accounts:%s\",\n\t// ctx?.state.wallets.length ?? 0,\n\t// ctx?.state.accounts.length ?? 0,\n\t// );\n\t// }, [ctx?.state]);\n\n\tif (!ctx)\n\t\tthrow new Error(\"useWallets can't be used without a KheopskitProvider\");\n\n\treturn ctx.state;\n};\n"],"mappings":"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","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kheopskit/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@kheopskit/core": "^0.
|
|
30
|
+
"@kheopskit/core": "^0.2.0",
|
|
31
31
|
"react": ">=18.0.0",
|
|
32
32
|
"react-dom": ">=18.0.0",
|
|
33
33
|
"rxjs": ">=7.0.0"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": "^19.2.4",
|
|
39
39
|
"react-dom": "^19.2.4",
|
|
40
40
|
"rxjs": "^7.8.2",
|
|
41
|
-
"@kheopskit/core": "0.
|
|
41
|
+
"@kheopskit/core": "0.2.0"
|
|
42
42
|
},
|
|
43
43
|
"tsup": {
|
|
44
44
|
"entry": [
|