@marktiderman/genesis-native 0.9.0 → 0.10.1

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.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as AuthClientLike, b as AuthGate, c as AuthGateProps, B as BlockSettingsSection, d as BootController, e as BootOptions, f as BootProvider, g as BootScreen, h as BootScreenProps, i as BootState, j as BootStatus, k as BootStep, l as BootStepContext, m as BootTimeoutError, G as GenesisNativeApp, n as GenesisNativeAppProps, H as HeldLinkAuth, L as LinkHold, o as LinkOptions, p as LinkTarget, q as NativeAppSlots, N as NativeBlock, r as NativeBlockRootProps, s as NativeQueryClientOptions, S as SessionProvider, t as SessionState, u as SessionStatus, v as SessionStore, w as SessionStoreOptions, x as SettingsRowLike, y as SignedOutProps, z as SplashModule, C as UseBlockSettingsOptions, E as UseBootReturn, F as UseHeldLinkOptions, I as createBoot, J as createLinkHold, K as createSessionStore, M as mergeBlockSettings, O as normalizeLink, P as useBlockSettings, Q as useBlocks, R as useBoot, T as useHeldLink, W as useSession } from './blocks-BGpfYSCJ.js';
2
- import { A as AsyncStorageLike } from './query-B4YZBiCs.js';
3
- export { a as AppStateLike, D as DAY_MS, E as EnableRejectionTracker, b as ErrorReport, c as ErrorUtilsLike, F as FatalScreen, d as FatalScreenProps, G as GenesisErrorBoundary, e as GenesisErrorBoundaryProps, f as GlobalErrorHandlerOptions, N as NetInfoLike, O as OnError, P as PlainFatalScreen, Q as QueryErrorReporter, g as QueryLifecycleOptions, h as QueryPersistence, R as ReportQueryErrorsOptions, i as connectQueryLifecycle, j as createNativeQueryClient, k as defaultErrorUtils, l as defaultRejectionTracker, m as errorDetails, n as installGlobalErrorHandler, o as installRejectionTracker, q as queryKeyName, r as reportQueryErrors } from './query-B4YZBiCs.js';
4
- export { S as ScreenErrorBoundary, a as ScreenErrorBoundaryOptions, b as ScreenErrorBoundaryProps, c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-DPetH1Eq.js';
1
+ export { A as AuthClientLike, b as AuthGate, c as AuthGateProps, B as BlockSettingsSection, d as BootController, e as BootOptions, f as BootProvider, g as BootScreen, h as BootScreenProps, i as BootState, j as BootStatus, k as BootStep, l as BootStepContext, m as BootTimeoutError, G as GenesisNativeApp, n as GenesisNativeAppProps, H as HeldLinkAuth, L as LinkHold, o as LinkOptions, p as LinkTarget, q as NativeAppSlots, N as NativeBlock, r as NativeBlockRootProps, s as NativeQueryClientOptions, S as SessionProvider, t as SessionState, u as SessionStatus, v as SessionStore, w as SessionStoreOptions, x as SettingsRowLike, y as SignedOutProps, z as SplashModule, C as UseBlockSettingsOptions, E as UseBootReturn, F as UseHeldLinkOptions, I as createBoot, J as createLinkHold, K as createSessionStore, M as mergeBlockSettings, O as normalizeLink, P as useBlockSettings, Q as useBlocks, R as useBoot, T as useHeldLink, W as useSession } from './blocks-dppiMmy-.js';
2
+ import { A as AsyncStorageLike } from './query--ihYsJWC.js';
3
+ export { a as AppStateLike, D as DAY_MS, E as EnableRejectionTracker, b as ErrorReport, c as ErrorUtilsLike, F as FatalScreen, d as FatalScreenKind, e as FatalScreenProps, f as FatalScreenViewProps, G as GenesisErrorBoundary, g as GenesisErrorBoundaryProps, h as GlobalErrorHandlerOptions, N as NetInfoLike, O as OnError, P as PlainFatalScreen, Q as QueryErrorReporter, i as QueryLifecycleOptions, j as QueryPersistence, R as ReportQueryErrorsOptions, k as connectQueryLifecycle, l as createNativeQueryClient, m as defaultErrorUtils, n as defaultRejectionTracker, o as errorDetails, p as installGlobalErrorHandler, q as installRejectionTracker, r as queryKeyName, s as reportQueryErrors } from './query--ihYsJWC.js';
4
+ export { S as ScreenErrorBoundary, a as ScreenErrorBoundaryOptions, b as ScreenErrorBoundaryProps, c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-B8DlsLwb.js';
5
5
  export { ClassifiedError, ClassifyErrorOptions, ErrorKind, ErrorMessages, classifyError, errorMessages, reportError } from '@marktiderman/genesis-core/errors';
6
6
  import 'react';
7
7
  import '@marktiderman/genesis-core/slots';
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ export { mergeBlockSettings, useBlockSettings, useBlocks } from './chunk-65P7RU4
3
3
  import { createNativeQueryClient, connectQueryLifecycle, reportQueryErrors } from './chunk-FKDZP3RJ.js';
4
4
  export { DAY_MS, connectQueryLifecycle, createNativeQueryClient, queryKeyName, reportQueryErrors } from './chunk-FKDZP3RJ.js';
5
5
  export { normalizeLink } from './chunk-VKTIHNAV.js';
6
- import { GenesisErrorBoundary, PlainFatalScreen, createBoot, defaultErrorUtils, installGlobalErrorHandler, defaultRejectionTracker, installRejectionTracker, BootProvider, FatalScreen } from './chunk-MFHOHSEQ.js';
7
- export { BootProvider, BootTimeoutError, FatalScreen, GenesisErrorBoundary, PlainFatalScreen, ScreenErrorBoundary, ScreenErrorScreen, createBoot, createScreenErrorBoundary, defaultErrorUtils, defaultRejectionTracker, errorDetails, installGlobalErrorHandler, installRejectionTracker, useBoot } from './chunk-MFHOHSEQ.js';
6
+ import { GenesisErrorBoundary, createBoot, defaultErrorUtils, installGlobalErrorHandler, defaultRejectionTracker, installRejectionTracker, BootProvider, FatalScreen } from './chunk-YIF4BFQH.js';
7
+ export { BootProvider, BootTimeoutError, FatalScreen, GenesisErrorBoundary, PlainFatalScreen, ScreenErrorBoundary, ScreenErrorScreen, createBoot, createScreenErrorBoundary, defaultErrorUtils, defaultRejectionTracker, errorDetails, installGlobalErrorHandler, installRejectionTracker, useBoot } from './chunk-YIF4BFQH.js';
8
8
  export { BEFORE_RELOAD_TIMEOUT_MS, onBeforeReload, runBeforeReload } from './chunk-VIC2KXMA.js';
9
9
  import { createSessionStore, SessionProvider } from './chunk-NGYNYJPL.js';
10
10
  export { AuthGate, SessionProvider, createSessionStore, useSession } from './chunk-NGYNYJPL.js';
@@ -67,6 +67,7 @@ function BootScreen(_props) {
67
67
  return /* @__PURE__ */ jsx(View, { testID: "genesis-boot", accessibilityRole: "progressbar", style: { flex: 1, justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ jsx(Text, { children: "Loading\u2026" }) });
68
68
  }
69
69
  var PassThrough = ({ children }) => /* @__PURE__ */ jsx(Fragment, { children });
70
+ var PlainFallback = (props) => /* @__PURE__ */ jsx(FatalScreen, { ...props, kind: "plain" });
70
71
  var ThemeProvider = GenesisThemeProvider;
71
72
  function GenesisNativeApp(props) {
72
73
  const [rootKey, setRootKey] = useState(0);
@@ -78,7 +79,7 @@ function GenesisNativeApp(props) {
78
79
  return /* @__PURE__ */ jsx(
79
80
  GenesisErrorBoundary,
80
81
  {
81
- fallback: PlainFatalScreen,
82
+ fallback: PlainFallback,
82
83
  onError: (e, r) => {
83
84
  reportToBlocks(blocksRef.current, e, r);
84
85
  try {
@@ -234,7 +235,7 @@ function Shell(props) {
234
235
  const s = withBlockSlots(blocks.slots, latest.current.slots);
235
236
  return (
236
237
  // A `fatal` slot that throws falls back to the plain screen.
237
- /* @__PURE__ */ jsx(GenesisErrorBoundary, { fallback: PlainFatalScreen, onError, onRetry: fallbackProps.retry, children: renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal) })
238
+ /* @__PURE__ */ jsx(GenesisErrorBoundary, { fallback: PlainFallback, onError, onRetry: fallbackProps.retry, children: renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal) })
238
239
  );
239
240
  }
240
241
  return { client: client2, persistence: persistence2, session: session2, boot: boot2, FatalFallback: FatalFallback2, blocks, provider: provider ?? createSupabaseProvider(supabase) };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/held-link.ts","../src/app.tsx","../src/hydration-gate.ts"],"names":["useRef","useEffect","client","persistence","session","boot","FatalFallback","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCO,SAAS,cAAA,GAA2B;AACzC,EAAA,IAAI,IAAA,GAAsB,IAAA;AAC1B,EAAA,M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,UAAA,GAAa,OAAO,GAAA,KAAgB;AACxC,QAAA,IAAI,CAAC,QAAA,EAAU,OAAO,cAAA,GAAiB,GAAG,CAAA;AAC1C,QAAA,OAAO,OAAA,CAAQ,WAAW,GAAG,CAAA;AAAA,MAC/B,CAAA;AAGA,MAAA,OAAO,IAAI,MAAM,OAAA,EAAS;AAAA,QACxB,GAAA,CAAI,QAAQ,QAAA,EAAU;AACpB,UAAA,IAAI,QAAA,KAAa,WAAW,OAAO,OAAA;AACnC,UAAA,IAAI,QAAA,KAAa,cAAc,OAAO,UAAA;AACtC,UAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,UAAU,MAAM,CAAA;AAClD,UAAA,OAAO,OAAO,KAAA,KAAU,UAAA,GAAa,KAAA,CAAM,IAAA,CAAK,MAAM,CAAA,GAAI,KAAA;AAAA,QAC5D;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACF;AACA,EAAA,OAAO,IAAA;AACT","file":"index.js","sourcesContent":["/**\n * Hold a deep link until sign-in completes.\n *\n * expo-router opens every incoming link itself. For a signed-in user that is\n * all that should happen. For a signed-out user, the auth layout redirects to\n * sign-in and the link is lost; holding it lets the app go there once the user\n * has signed in. The hold lives outside React, because expo-router's\n * `+native-intent` runs before any component:\n *\n * // lib/links.ts\n * export const linkHold = createLinkHold();\n * // app/+native-intent.ts\n * export function redirectSystemPath({ path }) {\n * const to = normalizeLink(path, links);\n * if (to && to !== \"/\") linkHold.hold(to);\n * return to;\n * }\n *\n * `useHeldLink` follows a held link only if the user was seen signed out\n * while it was held. A link that arrives while signed in, or at a cold start\n * that turns out signed in, is dropped, since the router already opened it.\n * `GenesisNativeApp` runs it for you (`links.onRelease`).\n */\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nexport interface LinkHold {\n /** Hold `path`, replacing any held one. */\n hold(path: string): void;\n peek(): string | null;\n /** Return the held path and forget it. */\n take(): string | null;\n clear(): void;\n subscribe(listener: () => void): () => void;\n}\n\n/** A place to hold one deep link until sign-in completes; lives outside React. */\nexport function createLinkHold(): LinkHold {\n let held: string | null = null;\n const listeners = new Set<() => void>();\n const set = (next: string | null) => {\n if (held === next) return;\n held = next;\n for (const listener of listeners) listener();\n };\n return {\n hold: (path) => set(path),\n peek: () => held,\n take() {\n const path = held;\n set(null);\n return path;\n },\n clear: () => set(null),\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/** `\"pending\"` while booting or reading the session. */\nexport type HeldLinkAuth = \"pending\" | \"signedOut\" | \"signedIn\";\n\nexport interface UseHeldLinkOptions {\n auth: HeldLinkAuth;\n /** Go there, e.g. `(path) => router.replace(path)`. Called once per link held across a sign-in. */\n onRelease: (path: string) => void;\n}\n\n/** Follow the held link after a sign-in, drop it otherwise; returns the link still held. */\nexport function useHeldLink(hold: LinkHold, { auth, onRelease }: UseHeldLinkOptions): string | null {\n const held = useSyncExternalStore(hold.subscribe, hold.peek, hold.peek);\n const release = useRef(onRelease);\n release.current = onRelease;\n // Was the user signed out while this link was held?\n const waitedForSignIn = useRef(false);\n useEffect(() => {\n if (held === null) {\n waitedForSignIn.current = false;\n return;\n }\n if (auth === \"signedOut\") waitedForSignIn.current = true;\n if (auth !== \"signedIn\") return;\n const path = hold.take();\n const follow = waitedForSignIn.current;\n waitedForSignIn.current = false;\n if (path !== null && follow) release.current(path);\n }, [auth, held, hold]);\n return held;\n}\n","/**\n * `<GenesisNativeApp>`: everything above an Expo app's screens, so the root\n * `_layout.tsx` is a few lines.\n *\n * last-resort boundary (React Native primitives only)\n * └ theme (GenesisThemeProvider, owning the platform color scheme; with `brandVariables`,\n * role variables on a view around the app for NativeWind's role classes; with\n * `modules.navigation`, React Navigation's theme in the same colors and mode)\n * └ keyboard (`keyboardProvider`, once, then `keyboardScroll` for form screens)\n * └ toasts (`NativeToastProvider`, so `useToast()` works on every screen; `toast={null}` drops it)\n * └ data (GenesisProvider over the Supabase client, the QueryClient)\n * └ session + boot (splash held until both are known)\n * └ blocks' roots (with `blocks`, e.g. updates: force upgrade, maintenance, banner, what's new)\n * └ errorBoundary → `bottomSheet`'s provider, if given → your screens (or `signedOut`)\n *\n * Every error the shell catches goes to each block's `onError` (the\n * observability block reports it) and then to the app's own `onError`:\n * render, global, boot and unhandled-rejection errors, and queries and\n * mutations that failed unexpectedly (`reportQueryErrors`).\n *\n * `blocks` (`defineBlock` declarations a native shell can run) are resolved\n * once: requirements checked, boot steps run behind the splash, roots\n * mounted, slot fills put under your `slots`, Settings rows handed to\n * `useBlockSettings`.\n * Global errors, render errors and a failed boot show the `fatal` slot with\n * \"Try again\". Every part is a slot (`slots` / `slotProps`, `null` drops it)\n * and is also exported on its own.\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\nimport { Text, View } from \"react-native\";\nimport type { QueryClient, QueryClientConfig } from \"@tanstack/react-query\";\nimport { vars } from \"nativewind\";\nimport { GenesisThemeProvider, useTheme } from \"@marktiderman/genesis-design-system/theme\";\nimport { brandRoleVariables, type CanonicalBrand } from \"@marktiderman/genesis-design-system\";\nimport { GenesisProvider, createSupabaseProvider, type DataProvider, type SupabaseClientInput } from \"@marktiderman/genesis-core/provider\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardToolbarProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport {\n GenesisModulesProvider,\n NativeSheetProvider,\n NativeToastProvider,\n type GenesisModules,\n type GenesisNavigationModule,\n type GenesisNavigationTheme,\n type NativeSheetLibrary,\n type NativeToastProviderProps,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { BootProvider, createBoot, type BootOptions, type BootStatus, type BootStep } from \"./boot\";\nimport {\n FatalScreen,\n GenesisErrorBoundary,\n PlainFatalScreen,\n defaultErrorUtils,\n defaultRejectionTracker,\n installGlobalErrorHandler,\n installRejectionTracker,\n type EnableRejectionTracker,\n type ErrorUtilsLike,\n type FatalScreenProps,\n type GenesisErrorBoundaryProps,\n type OnError,\n} from \"./errors\";\nimport { SessionProvider, createSessionStore, type AuthClientLike } from \"./auth\";\nimport { useHeldLink, type HeldLinkAuth, type LinkHold } from \"./held-link\";\nimport { connectQueryLifecycle, createNativeQueryClient, reportQueryErrors, type QueryLifecycleOptions, type QueryPersistence } from \"./query\";\nimport { resolveBlocks } from \"@marktiderman/genesis-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Keep reads on the phone: `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })`\n * from `@marktiderman/genesis-native/offline`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /**\n * Theme role variables (`--primary`, `--background`, …) to set on a view\n * around the app, over what the app's stylesheet declares on `:root`.\n * Default `false`: none are set, so the app's own variables (from\n * `createGenesisNativewindPreset({ brand })` or its brand package) stand.\n * `true` sets `brandRoleVariables(brand)` for the current mode; an object\n * sets the app's own, one map for both modes or `{ light, dark }`.\n */\n brandVariables?: boolean | Record<string, string> | { light: Record<string, string>; dark: Record<string, string> };\n /**\n * React Navigation's theme (headers, tab bars, the screen background), when\n * `modules.navigation` is given. Default: worked out from the same role\n * variables as `brandVariables` (the app's own when it passes them,\n * `brandRoleVariables(brand)` otherwise), for the current mode, so a header\n * is never light in dark mode. Pass a theme (or `{ light, dark }`) to use\n * your own, or `false` to set none.\n */\n navigationTheme?: false | GenesisNavigationTheme | { light: GenesisNavigationTheme; dark: GenesisNavigationTheme };\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * The optional native modules the app installed, for Genesis components to\n * use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):\n * FlashList, expo-image, Reanimated, expo-glass-effect, expo-symbols, a\n * lucide icon set, the @expo/ui date picker. Each one left out falls back\n * to plain React Native. Read once.\n */\n modules?: GenesisModules;\n /**\n * `@gorhom/bottom-sheet` v5, to opt every `NativeSheet` into it (snap\n * points, drag between heights): `import * as BottomSheet from \"@gorhom/bottom-sheet\"`,\n * then `bottomSheet={BottomSheet}`. The app mounts `NativeSheetProvider`\n * (and so the library's `BottomSheetModalProvider`) for you; the app's root\n * must still be inside gesture-handler's `GestureHandlerRootView`, with\n * Reanimated set up. Leave it out and sheets are React Native's own modal\n * (an iOS page sheet), which needs neither. Read once.\n */\n bottomSheet?: NativeSheetLibrary;\n /**\n * Toasts (`useToast()` from `@marktiderman/genesis-ui-native`): `NativeToastProvider` is\n * mounted around the screens, at the top of the screen by default (a bottom toast would sit on\n * a tab bar). Pass its options to place it, or `null` to mount your own. Read once.\n */\n toast?: Pick<NativeToastProviderProps, \"position\" | \"disableAnimation\"> | null;\n /** Follow a link held while signed out, once the user signs in. */\n links?: { hold: LinkHold; onRelease: (path: string) => void };\n /** Run before first render, in order (wipe-on-reinstall, hydrate stores, fonts). Read once. */\n steps?: readonly BootStep[];\n bootOptions?: BootOptions;\n /** Longest wait for Supabase's `getSession()` before using the stored session (offline). Default 5000 ms. */\n sessionWaitMs?: number;\n /** Default `globalThis.ErrorUtils`. */\n errorUtils?: ErrorUtilsLike;\n /** Report unhandled promise rejections to `onError`. Default Hermes's tracker; `null` turns it off. */\n rejectionTracker?: EnableRejectionTracker | null;\n /** `AppState` and NetInfo, so queries refetch on focus and know the network. */\n lifecycle?: QueryLifecycleOptions;\n /**\n * Report queries and mutations that failed for good to `onError` (and so\n * to the observability block), non-fatal, as `query` / `mutation` with the\n * key's first segment as a tag. Only unexpected errors: offline, signed\n * out, not found and the server's expected refusals are left to the\n * screen. One query opts out with `meta: { reportErrors: false }`.\n * Default true. Read once.\n */\n reportQueryErrors?: boolean;\n /**\n * Every caught error, after the blocks' own `onError` (the observability\n * block, `createObservability` from `/observability`, reports to Sentry\n * there). A throwing reporter is ignored.\n */\n onError?: OnError;\n /** After a signed-in user signs out, once the query cache is cleared. */\n onSignedOut?: () => void;\n /**\n * The updates block: `createUpdates(…)` from `@marktiderman/genesis-native/updates`\n * (force upgrade, maintenance, the update banner, what's new). Its policy\n * loads behind the splash for at most `policyTimeoutMs` and never fails the\n * boot. Read once; leave it out to turn the block off.\n */\n updates?: UpdatesBlock;\n /**\n * Blocks to run (`createUpdates(…)` is one). Resolved once at start: a\n * block whose requirement is missing, or two blocks contributing the same\n * slot, nav entry or Settings row, shows the fatal screen and reports a\n * `BlockError` to `onError`. Read once.\n */\n blocks?: readonly NativeBlock[];\n /**\n * Your features (FeatureIds) that blocks may require but that aren't\n * blocks. A block requiring anything that is neither one of `blocks` nor\n * listed here is a `BlockError`. Read once.\n */\n appFeatures?: readonly string[];\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/** The default boot slot: a plain loading view (the splash covers it at launch). */\nexport function BootScreen(_props: BootScreenProps) {\n return (\n <View testID=\"genesis-boot\" accessibilityRole=\"progressbar\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}>\n <Text>Loading…</Text>\n </View>\n );\n}\n\nconst PassThrough: ComponentType<SignedOutProps> = ({ children }) => <>{children}</>;\n\n// The web provider's types don't list the native-only prop; Metro resolves the native provider.\nconst ThemeProvider = GenesisThemeProvider as ComponentType<{\n brand: CanonicalBrand;\n syncNativeAppearance?: boolean;\n children: ReactNode;\n}>;\n\n/**\n * The root of an Expo app: theme, keyboard, data, boot behind the splash, errors, session and held links.\n *\n * @stability Beta\n */\nexport function GenesisNativeApp(props: GenesisNativeAppProps) {\n // Above every provider: if one of them (or the shell's own set-up) throws,\n // this shows a screen made of nothing that can fail, and retry starts over.\n const [rootKey, setRootKey] = useState(0);\n const onErrorRef = useRef(props.onError);\n onErrorRef.current = props.onError;\n // The blocks as given, before they are resolved: an error here may come from resolving them.\n const blocksRef = useRef(givenBlocks(props));\n const splashRef = useRef(props.splash);\n splashRef.current = props.splash;\n return (\n <GenesisErrorBoundary\n key={rootKey}\n fallback={PlainFatalScreen}\n onError={(e, r) => {\n reportToBlocks(blocksRef.current, e, r);\n try {\n onErrorRef.current?.(e, r);\n } catch {\n // A failing reporter must not stop the fatal screen.\n }\n // The shell (which hides the splash) never mounted: hide it here, or the screen stays behind it.\n splashRef.current?.hideAsync().catch(() => {});\n }}\n onRetry={() => setRootKey((key) => key + 1)}\n >\n <ThemedShell {...props} />\n </GenesisErrorBoundary>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nconst MISSING_KEYBOARD_PROVIDER =\n \"GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won't move above the keyboard. \" +\n 'Pass `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nconst TOOLBAR_WITHOUT_SCROLL =\n \"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. \" +\n 'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nfunction ThemedShell(props: GenesisNativeAppProps) {\n const { brand, keyboardScroll, keyboardToolbar } = props;\n // Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.\n const [Keyboard] = useState(() => props.keyboardProvider);\n // Frozen too: an inline object would hand every component a new module set each render.\n const [modules] = useState(() => props.modules);\n const [toast] = useState(() => (props.toast === null ? null : { position: \"top\" as const, ...props.toast }));\n const missingProvider = Boolean(keyboardScroll) && !Keyboard;\n const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;\n useEffect(() => {\n if (typeof __DEV__ === \"undefined\" || !__DEV__) return;\n // genesis-allow-console: development-only set-up mistakes, shown as LogBox errors on purpose.\n if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);\n if (toolbarWithoutScroll) console.error(TOOLBAR_WITHOUT_SCROLL);\n }, [missingProvider, toolbarWithoutScroll]);\n let body = <Shell {...props} />;\n // Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.\n if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;\n if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;\n if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;\n if (Keyboard) body = <Keyboard>{body}</Keyboard>;\n if (modules?.navigation && props.navigationTheme !== false) {\n body = (\n <NavigationTheme module={modules.navigation} brand={brand} brandVariables={props.brandVariables} given={props.navigationTheme}>\n {body}\n </NavigationTheme>\n );\n }\n return (\n <ThemeProvider brand={brand} syncNativeAppearance>\n {props.brandVariables ? (\n <BrandVariables brand={brand} given={props.brandVariables}>\n {body}\n </BrandVariables>\n ) : (\n body\n )}\n </ThemeProvider>\n );\n}\n\n/**\n * Theme role variables (`--primary`, `--background`, …) for the current mode,\n * set on a view around the app, so NativeWind's role classes (`bg-primary` is\n * `hsl(var(--primary))`) read them instead of what `:root` declares. Only with\n * `brandVariables`: NativeWind can't tell which `:root` variables are the\n * app's own, so setting them is the app's choice.\n */\nfunction BrandVariables({\n brand,\n given,\n children,\n}: {\n brand: CanonicalBrand;\n given: NonNullable<GenesisNativeAppProps[\"brandVariables\"]>;\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const variables = useMemo(() => {\n if (given === true) return brandRoleVariables(brand);\n const perMode = given as { light?: unknown; dark?: unknown };\n if (typeof perMode.light === \"object\" && typeof perMode.dark === \"object\") return given as { light: Record<string, string>; dark: Record<string, string> };\n return { light: given as Record<string, string>, dark: given as Record<string, string> };\n }, [brand, given]);\n const style = useMemo(() => [{ flex: 1 }, vars(variables[resolvedMode])], [variables, resolvedMode]);\n return (\n <View testID=\"genesis-brand-variables\" style={style}>\n {children}\n </View>\n );\n}\n\n/**\n * `\"240 10% 3.9%\"` (a role variable's value) → `\"hsl(240, 10%, 3.9%)\"`, and `\"240 10% 3.9% / 0.5\"`\n * → `\"hsla(240, 10%, 3.9%, 0.5)\"`; anything else as it is.\n */\nfunction roleColor(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const [color = \"\", alpha] = value.split(\"/\").map((p) => p.trim());\n const parts = color.split(/\\s+/);\n if (parts.length !== 3) return value;\n return alpha ? `hsla(${parts.join(\", \")}, ${alpha})` : `hsl(${parts.join(\", \")})`;\n}\n\n/**\n * React Navigation's theme for the current mode, in the app's role colors: the\n * variables `brandVariables` sets (or `brandRoleVariables(brand)`) over React\n * Navigation's own light or dark theme, which keeps its fonts.\n */\nfunction NavigationTheme({\n module,\n brand,\n brandVariables,\n given,\n children,\n}: {\n module: GenesisNavigationModule;\n brand: CanonicalBrand;\n brandVariables: GenesisNativeAppProps[\"brandVariables\"];\n given: GenesisNativeAppProps[\"navigationTheme\"];\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const theme = useMemo((): GenesisNavigationTheme => {\n const base = resolvedMode === \"dark\" ? module.DarkTheme : module.DefaultTheme;\n if (given) {\n const perMode = given as { light?: GenesisNavigationTheme; dark?: GenesisNavigationTheme };\n const own = perMode.light && perMode.dark ? perMode[resolvedMode]! : (given as GenesisNavigationTheme);\n // React Navigation's headers read every font variant: a theme without fonts keeps the base's.\n return own.fonts ? own : { ...own, fonts: base.fonts };\n }\n // The app's own map over the brand's role colors, so a partial map never falls back to React Navigation's.\n let variables = brandRoleVariables(brand)[resolvedMode];\n if (brandVariables && brandVariables !== true) {\n const perMode = brandVariables as { light?: unknown; dark?: unknown };\n const own = typeof perMode.light === \"object\" && typeof perMode.dark === \"object\" ? (brandVariables as Record<\"light\" | \"dark\", Record<string, string>>)[resolvedMode] : (brandVariables as Record<string, string>);\n variables = { ...variables, ...own };\n }\n const pick = (name: string, fallback: GenesisNavigationTheme[\"colors\"][\"text\"]) => roleColor(variables[`--${name}`]) ?? fallback;\n return {\n ...base,\n dark: resolvedMode === \"dark\",\n colors: {\n ...base.colors,\n primary: pick(\"primary\", base.colors.primary),\n background: pick(\"background\", base.colors.background),\n card: pick(\"card\", base.colors.card),\n text: pick(\"foreground\", base.colors.text),\n border: pick(\"border\", base.colors.border),\n notification: pick(\"destructive\", base.colors.notification),\n },\n };\n }, [module, brand, brandVariables, given, resolvedMode]);\n const Provider = module.ThemeProvider;\n return <Provider value={theme}>{children}</Provider>;\n}\n\nconst SESSION_STEP_MARGIN_MS = 15_000;\n\nfunction Shell(props: GenesisNativeAppProps) {\n const { supabase, provider, queryClient: queryOptions, persist, splash, links, steps = [], bootOptions, sessionWaitMs = 5000 } = props;\n const { errorUtils, rejectionTracker, lifecycle, slotProps, children } = props;\n const latest = useRef(props);\n latest.current = props;\n const [blockList] = useState(() => givenBlocks(props));\n // Read once, like the keyboard provider: a different module later would remount the screens.\n const [bottomSheet] = useState(() => props.bottomSheet);\n const onError: OnError = (error, report) => {\n reportToBlocks(blockList, error, report);\n try {\n latest.current.onError?.(error, report);\n } catch {\n // A failing reporter must not take the shell down with it.\n }\n };\n // How many fatal screens are up (the global handler lets a second fatal error end the app).\n const fatalShown = useRef(0);\n\n // Created once: the shell's parts live as long as the app.\n const [parts] = useState(() => {\n const list = blockList;\n const blocks = resolveBlocks(list, props.appFeatures ? [...list.map((b) => b.id), ...props.appFeatures] : undefined, {\n platform: \"native\",\n slots: NATIVE_APP_SLOT_NAMES,\n });\n const client = queryOptions?.client ?? createNativeQueryClient(queryOptions?.config);\n const persistence = persist ? persist(client) : null;\n const session = createSessionStore(supabase, {\n waitMs: sessionWaitMs,\n // Another user (or nobody) now: nothing of the last user's may show or stay on disk.\n onUserChange: (previous, next) => {\n client.clear();\n void persistence?.clear();\n if (previous !== null && next === null) latest.current.onSignedOut?.();\n },\n });\n const boot = createBoot(\n [\n ...steps,\n // Blocks' steps, in dependency order (the updates block's settles within its own timeout and never throws).\n ...blocks.blocks.flatMap((block) => block.bootSteps ?? []),\n { id: \"genesis:session\", run: () => session.load(), timeoutMs: sessionWaitMs + SESSION_STEP_MARGIN_MS },\n // After the session, so only the cache saved for this user is restored.\n ...(persistence ? [{ id: \"genesis:query-cache\", run: () => persistence.restore(session.getState().userId ?? \"\") }] : []),\n ],\n bootOptions,\n );\n // One component type for the life of the app, so a re-render never remounts a visible fatal screen.\n function FatalFallback(fallbackProps: FatalScreenProps) {\n useEffect(() => {\n fatalShown.current++;\n return () => {\n fatalShown.current--;\n };\n }, []);\n const { slotProps: sp } = latest.current;\n const s = withBlockSlots(blocks.slots, latest.current.slots);\n return (\n // A `fatal` slot that throws falls back to the plain screen.\n <GenesisErrorBoundary fallback={PlainFatalScreen} onError={onError} onRetry={fallbackProps.retry}>\n {renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal)}\n </GenesisErrorBoundary>\n );\n }\n return { client, persistence, session, boot, FatalFallback, blocks, provider: provider ?? createSupabaseProvider(supabase) };\n });\n const { boot, session, persistence, client, FatalFallback } = parts;\n const slots = withBlockSlots(parts.blocks.slots, props.slots);\n const bootState = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n const sessionState = useSyncExternalStore(session.subscribe, session.getState, session.getState);\n const [fatal, setFatal] = useState<Error | null>(null);\n const [resetKey, setResetKey] = useState(0);\n\n useEffect(() => session.start(), [session]);\n useEffect(() => {\n void boot.start();\n }, [boot]);\n useEffect(() => {\n if (bootState.status === \"failed\" && bootState.error) onError(bootState.error, { fatal: true, source: \"boot\" });\n }, [bootState.status, bootState.error]);\n useEffect(() => {\n // The screens mount, and start reading, before this effect runs: their reads are this person's\n // (the client is emptied whenever the person changes), so they're saved too.\n if (bootState.status === \"ready\" && persistence) return persistence.subscribe(sessionState.userId ?? \"\", { adopt: Boolean(sessionState.userId) });\n }, [bootState.status, persistence, sessionState.userId]);\n useEffect(() => {\n const utils = errorUtils ?? defaultErrorUtils();\n if (!utils) return;\n return installGlobalErrorHandler({ errorUtils: utils, onError, onFatal: setFatal, alreadyFatal: () => fatalShown.current > 0 });\n }, [errorUtils]);\n useEffect(() => {\n const enable = rejectionTracker === null ? undefined : (rejectionTracker ?? defaultRejectionTracker());\n if (enable) installRejectionTracker({ enable, onError });\n }, [rejectionTracker]);\n useEffect(() => (lifecycle ? connectQueryLifecycle(lifecycle) : undefined), [lifecycle]);\n const [queryReports] = useState(() => props.reportQueryErrors !== false);\n useEffect(() => (queryReports ? reportQueryErrors(client, onError) : undefined), [client, queryReports]);\n\n // Splash: up until boot has finished (the session step included), or failed.\n const settled = bootState.status === \"ready\" || bootState.status === \"failed\" || fatal !== null;\n const splashHidden = useRef(false);\n useEffect(() => {\n if (!settled || !splash || splashHidden.current) return;\n splashHidden.current = true;\n splash.hideAsync().catch(() => {});\n }, [settled, splash]);\n\n const auth: HeldLinkAuth = bootState.status !== \"ready\" || sessionState.status === \"loading\" ? \"pending\" : sessionState.status;\n useHeldLink(links?.hold ?? NO_HOLD, { auth: links ? auth : \"pending\", onRelease: (path) => links?.onRelease(path) });\n\n const retry = () => {\n setFatal(null);\n setResetKey((key) => key + 1);\n if (boot.getState().status === \"failed\") void boot.retry();\n };\n\n let content: ReactNode;\n if (fatal) {\n content = <FatalFallback error={fatal} retry={retry} />;\n } else if (bootState.status === \"failed\" && bootState.error) {\n content = <FatalFallback error={bootState.error} retry={retry} />;\n } else if (bootState.status !== \"ready\") {\n content = renderSlot(BootScreen, slots?.boot, { status: bootState.status }, slotProps?.boot);\n } else {\n const screens =\n sessionState.status === \"signedOut\" ? renderSlot(PassThrough, slots?.signedOut, { children }, slotProps?.signedOut) : children;\n const guarded = renderSlot(\n GenesisErrorBoundary,\n slots?.errorBoundary,\n { fallback: FatalFallback, onError, resetKey, onRetry: retry, children: screens },\n slotProps?.errorBoundary,\n );\n // The first block's root is the outermost.\n content = parts.blocks.blocks.reduceRight<ReactNode>((inner, block) => {\n const Root = block.Root;\n return Root ? (\n <Root key={block.id} slots={slots} slotProps={slotProps}>\n {inner}\n </Root>\n ) : (\n inner\n );\n }, guarded);\n }\n\n return (\n <GenesisProvider provider={parts.provider} queryClient={client}>\n <SessionProvider store={session}>\n <BootProvider boot={boot}>\n <BlocksProvider value={parts.blocks}>\n <GenesisErrorBoundary key={resetKey} fallback={FatalFallback} onError={onError} onRetry={retry}>\n {/* Sheet content renders in the library's portal, here: below data, session, boot and blocks. */}\n {bottomSheet ? <NativeSheetProvider bottomSheet={bottomSheet}>{content}</NativeSheetProvider> : content}\n </GenesisErrorBoundary>\n </BlocksProvider>\n </BootProvider>\n </SessionProvider>\n </GenesisProvider>\n );\n}\n\n// Every slot name, checked against NativeAppSlots by the compiler: a block filling any other is a BlockError.\nconst SLOT_NAMES: Record<keyof NativeAppSlots, true> = {\n boot: true,\n fatal: true,\n errorBoundary: true,\n signedOut: true,\n forceUpgrade: true,\n maintenance: true,\n updateBanner: true,\n whatsNew: true,\n devtoolsFeedback: true,\n pushPrompt: true,\n};\nconst NATIVE_APP_SLOT_NAMES: readonly string[] = Object.keys(SLOT_NAMES);\n\n/** Blocks' slot fills under the app's own slots: the app's (a component or `null`) always win. */\nfunction withBlockSlots(fills: Readonly<Record<string, unknown>>, own: Slots<NativeAppSlots> | undefined): Slots<NativeAppSlots> | undefined {\n if (Object.keys(fills).length === 0) return own;\n return { ...(fills as Slots<NativeAppSlots>), ...own };\n}\n\n/** `blocks`, with `updates` added when it was given on its own (given both ways, it runs once). */\nfunction givenBlocks(props: Pick<GenesisNativeAppProps, \"blocks\" | \"updates\">): readonly NativeBlock[] {\n const given = props.blocks ?? [];\n return props.updates && !given.includes(props.updates) ? [...given, props.updates] : given;\n}\n\nconst NO_HOLD: LinkHold = {\n hold: () => {},\n peek: () => null,\n take: () => null,\n clear: () => {},\n subscribe: () => () => {},\n};\n","/**\n * A hydration gate holds writes until a persisted store has loaded from disk.\n *\n * The bug it prevents: a persisted store (zustand `persist`, say) is created\n * with defaults, something sets a value before the saved state has been read,\n * and that write lands on disk first, replacing what the user had. With the\n * gate, a write made before hydration never reaches disk (`storage()`), or\n * waits for it (`run()`).\n *\n * const gate = createHydrationGate();\n * persist(store, {\n * storage: createJSONStorage(() => gate.storage(AsyncStorage)),\n * // Open only after a good read: after a failed one, writes would replace what's on disk.\n * onRehydrateStorage: () => (_state, error) => {\n * if (!error) gate.markHydrated();\n * },\n * });\n */\nimport type { AsyncStorageLike } from \"./query\";\n\nexport interface HydrationGate {\n readonly hydrated: boolean;\n /** Call once the store has read its saved state. Idempotent. */\n markHydrated(): void;\n /** Resolves once hydrated. */\n whenHydrated(): Promise<void>;\n /** Run a write now if hydrated, otherwise once hydrated. */\n run<T>(write: () => T | Promise<T>): Promise<T>;\n /**\n * The storage, with writes made before hydration dropped (reads pass\n * through, since hydration is a read). After hydration the store writes\n * its merged state on its next change, so nothing is lost but the stale\n * write. (A zustand migration's own write during hydration is dropped too;\n * the old version stays on disk and is migrated again until then.)\n */\n storage<S extends AsyncStorageLike>(storage: S): S;\n}\n\nexport interface HydrationGateOptions {\n /** Told about each write `storage()` dropped (to log it in development). */\n onDroppedWrite?: (key: string) => void;\n}\n\n/** A gate that holds writes until a persisted store has hydrated. */\nexport function createHydrationGate({ onDroppedWrite }: HydrationGateOptions = {}): HydrationGate {\n let hydrated = false;\n let open!: () => void;\n const opened = new Promise<void>((resolve) => {\n open = resolve;\n });\n\n const gate: HydrationGate = {\n get hydrated() {\n return hydrated;\n },\n markHydrated() {\n if (hydrated) return;\n hydrated = true;\n open();\n },\n whenHydrated: () => opened,\n async run(write) {\n if (!hydrated) await opened;\n return write();\n },\n storage(storage) {\n const setItem = async (key: string, value: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.setItem(key, value);\n };\n const removeItem = async (key: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.removeItem(key);\n };\n // A proxy, not a spread: a storage class's prototype methods (and its\n // private fields, through `this`) keep working.\n return new Proxy(storage, {\n get(target, property) {\n if (property === \"setItem\") return setItem;\n if (property === \"removeItem\") return removeItem;\n const value = Reflect.get(target, property, target) as unknown;\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n },\n };\n return gate;\n}\n"]}
1
+ {"version":3,"sources":["../src/held-link.ts","../src/app.tsx","../src/hydration-gate.ts"],"names":["useRef","useEffect","client","persistence","session","boot","FatalFallback","useSyncExternalStore"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoCO,SAAS,cAAA,GAA2B;AACzC,EAAA,IAAI,IAAA,GAAsB,IAAA;AAC1B,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,GAAA,GAAM,CAAC,IAAA,KAAwB;AACnC,IAAA,IAAI,SAAS,IAAA,EAAM;AACnB,IAAA,IAAA,GAAO,IAAA;AACP,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAAA,EAC7C,CAAA;AACA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,CAAC,IAAA,KAAS,GAAA,CAAI,IAAI,CAAA;AAAA,IACxB,MAAM,MAAM,IAAA;AAAA,IACZ,IAAA,GAAO;AACL,MAAA,MAAM,IAAA,GAAO,IAAA;AACb,MAAA,GAAA,CAAI,IAAI,CAAA;AACR,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,KAAA,EAAO,MAAM,GAAA,CAAI,IAAI,CAAA;AAAA,IACrB,UAAU,QAAA,EAAU;AAClB,MAAA,SAAA,CAAU,IAAI,QAAQ,CAAA;AACtB,MAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,QAAQ,CAAA;AAAA,IACxC;AAAA,GACF;AACF;AAYO,SAAS,WAAA,CAAY,IAAA,EAAgB,EAA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":"index.js","sourcesContent":["/**\n * Hold a deep link until sign-in completes.\n *\n * expo-router opens every incoming link itself. For a signed-in user that is\n * all that should happen. For a signed-out user, the auth layout redirects to\n * sign-in and the link is lost; holding it lets the app go there once the user\n * has signed in. The hold lives outside React, because expo-router's\n * `+native-intent` runs before any component:\n *\n * // lib/links.ts\n * export const linkHold = createLinkHold();\n * // app/+native-intent.ts\n * export function redirectSystemPath({ path }) {\n * const to = normalizeLink(path, links);\n * if (to && to !== \"/\") linkHold.hold(to);\n * return to;\n * }\n *\n * `useHeldLink` follows a held link only if the user was seen signed out\n * while it was held. A link that arrives while signed in, or at a cold start\n * that turns out signed in, is dropped, since the router already opened it.\n * `GenesisNativeApp` runs it for you (`links.onRelease`).\n */\nimport { useEffect, useRef, useSyncExternalStore } from \"react\";\n\nexport interface LinkHold {\n /** Hold `path`, replacing any held one. */\n hold(path: string): void;\n peek(): string | null;\n /** Return the held path and forget it. */\n take(): string | null;\n clear(): void;\n subscribe(listener: () => void): () => void;\n}\n\n/** A place to hold one deep link until sign-in completes; lives outside React. */\nexport function createLinkHold(): LinkHold {\n let held: string | null = null;\n const listeners = new Set<() => void>();\n const set = (next: string | null) => {\n if (held === next) return;\n held = next;\n for (const listener of listeners) listener();\n };\n return {\n hold: (path) => set(path),\n peek: () => held,\n take() {\n const path = held;\n set(null);\n return path;\n },\n clear: () => set(null),\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\n/** `\"pending\"` while booting or reading the session. */\nexport type HeldLinkAuth = \"pending\" | \"signedOut\" | \"signedIn\";\n\nexport interface UseHeldLinkOptions {\n auth: HeldLinkAuth;\n /** Go there, e.g. `(path) => router.replace(path)`. Called once per link held across a sign-in. */\n onRelease: (path: string) => void;\n}\n\n/** Follow the held link after a sign-in, drop it otherwise; returns the link still held. */\nexport function useHeldLink(hold: LinkHold, { auth, onRelease }: UseHeldLinkOptions): string | null {\n const held = useSyncExternalStore(hold.subscribe, hold.peek, hold.peek);\n const release = useRef(onRelease);\n release.current = onRelease;\n // Was the user signed out while this link was held?\n const waitedForSignIn = useRef(false);\n useEffect(() => {\n if (held === null) {\n waitedForSignIn.current = false;\n return;\n }\n if (auth === \"signedOut\") waitedForSignIn.current = true;\n if (auth !== \"signedIn\") return;\n const path = hold.take();\n const follow = waitedForSignIn.current;\n waitedForSignIn.current = false;\n if (path !== null && follow) release.current(path);\n }, [auth, held, hold]);\n return held;\n}\n","/**\n * `<GenesisNativeApp>`: everything above an Expo app's screens, so the root\n * `_layout.tsx` is a few lines.\n *\n * last-resort boundary (React Native primitives only)\n * └ theme (GenesisThemeProvider, owning the platform color scheme; with `brandVariables`,\n * role variables on a view around the app for NativeWind's role classes; with\n * `modules.navigation`, React Navigation's theme in the same colors and mode)\n * └ keyboard (`keyboardProvider`, once, then `keyboardScroll` for form screens)\n * └ toasts (`NativeToastProvider`, so `useToast()` works on every screen; `toast={null}` drops it)\n * └ data (GenesisProvider over the Supabase client, the QueryClient)\n * └ session + boot (splash held until both are known)\n * └ blocks' roots (with `blocks`, e.g. updates: force upgrade, maintenance, banner, what's new)\n * └ errorBoundary → `bottomSheet`'s provider, if given → your screens (or `signedOut`)\n *\n * Every error the shell catches goes to each block's `onError` (the\n * observability block reports it) and then to the app's own `onError`:\n * render, global, boot and unhandled-rejection errors, and queries and\n * mutations that failed unexpectedly (`reportQueryErrors`).\n *\n * `blocks` (`defineBlock` declarations a native shell can run) are resolved\n * once: requirements checked, boot steps run behind the splash, roots\n * mounted, slot fills put under your `slots`, Settings rows handed to\n * `useBlockSettings`.\n * Global errors, render errors and a failed boot show the `fatal` slot with\n * \"Try again\". Every part is a slot (`slots` / `slotProps`, `null` drops it)\n * and is also exported on its own.\n */\nimport { useEffect, useMemo, useRef, useState, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\nimport { Text, View } from \"react-native\";\nimport type { QueryClient, QueryClientConfig } from \"@tanstack/react-query\";\nimport { vars } from \"nativewind\";\nimport { GenesisThemeProvider, useTheme } from \"@marktiderman/genesis-design-system/theme\";\nimport { brandRoleVariables, type CanonicalBrand } from \"@marktiderman/genesis-design-system\";\nimport { GenesisProvider, createSupabaseProvider, type DataProvider, type SupabaseClientInput } from \"@marktiderman/genesis-core/provider\";\nimport { renderSlot, type SlotPropsFor, type Slots } from \"@marktiderman/genesis-core/slots\";\nimport { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardToolbarProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport {\n GenesisModulesProvider,\n NativeSheetProvider,\n NativeToastProvider,\n type GenesisModules,\n type GenesisNavigationModule,\n type GenesisNavigationTheme,\n type NativeSheetLibrary,\n type NativeToastProviderProps,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { BootProvider, createBoot, type BootOptions, type BootStatus, type BootStep } from \"./boot\";\nimport {\n FatalScreen,\n GenesisErrorBoundary,\n defaultErrorUtils,\n defaultRejectionTracker,\n installGlobalErrorHandler,\n installRejectionTracker,\n type EnableRejectionTracker,\n type ErrorUtilsLike,\n type FatalScreenProps,\n type GenesisErrorBoundaryProps,\n type OnError,\n} from \"./errors\";\nimport { SessionProvider, createSessionStore, type AuthClientLike } from \"./auth\";\nimport { useHeldLink, type HeldLinkAuth, type LinkHold } from \"./held-link\";\nimport { connectQueryLifecycle, createNativeQueryClient, reportQueryErrors, type QueryLifecycleOptions, type QueryPersistence } from \"./query\";\nimport { resolveBlocks } from \"@marktiderman/genesis-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Keep reads on the phone: `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })`\n * from `@marktiderman/genesis-native/offline`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /**\n * Theme role variables (`--primary`, `--background`, …) to set on a view\n * around the app, over what the app's stylesheet declares on `:root`.\n * Default `false`: none are set, so the app's own variables (from\n * `createGenesisNativewindPreset({ brand })` or its brand package) stand.\n * `true` sets `brandRoleVariables(brand)` for the current mode; an object\n * sets the app's own, one map for both modes or `{ light, dark }`.\n */\n brandVariables?: boolean | Record<string, string> | { light: Record<string, string>; dark: Record<string, string> };\n /**\n * React Navigation's theme (headers, tab bars, the screen background), when\n * `modules.navigation` is given. Default: worked out from the same role\n * variables as `brandVariables` (the app's own when it passes them,\n * `brandRoleVariables(brand)` otherwise), for the current mode, so a header\n * is never light in dark mode. Pass a theme (or `{ light, dark }`) to use\n * your own, or `false` to set none.\n */\n navigationTheme?: false | GenesisNavigationTheme | { light: GenesisNavigationTheme; dark: GenesisNavigationTheme };\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * The optional native modules the app installed, for Genesis components to\n * use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):\n * FlashList, expo-image, Reanimated, expo-glass-effect, expo-symbols, a\n * lucide icon set, the @expo/ui date picker. Each one left out falls back\n * to plain React Native. Read once.\n */\n modules?: GenesisModules;\n /**\n * `@gorhom/bottom-sheet` v5, to opt every `NativeSheet` into it (snap\n * points, drag between heights): `import * as BottomSheet from \"@gorhom/bottom-sheet\"`,\n * then `bottomSheet={BottomSheet}`. The app mounts `NativeSheetProvider`\n * (and so the library's `BottomSheetModalProvider`) for you; the app's root\n * must still be inside gesture-handler's `GestureHandlerRootView`, with\n * Reanimated set up. Leave it out and sheets are React Native's own modal\n * (an iOS page sheet), which needs neither. Read once.\n */\n bottomSheet?: NativeSheetLibrary;\n /**\n * Toasts (`useToast()` from `@marktiderman/genesis-ui-native`): `NativeToastProvider` is\n * mounted around the screens, at the top of the screen by default (a bottom toast would sit on\n * a tab bar). Pass its options to place it, or `null` to mount your own. Read once.\n */\n toast?: Pick<NativeToastProviderProps, \"position\" | \"disableAnimation\"> | null;\n /** Follow a link held while signed out, once the user signs in. */\n links?: { hold: LinkHold; onRelease: (path: string) => void };\n /** Run before first render, in order (wipe-on-reinstall, hydrate stores, fonts). Read once. */\n steps?: readonly BootStep[];\n bootOptions?: BootOptions;\n /** Longest wait for Supabase's `getSession()` before using the stored session (offline). Default 5000 ms. */\n sessionWaitMs?: number;\n /** Default `globalThis.ErrorUtils`. */\n errorUtils?: ErrorUtilsLike;\n /** Report unhandled promise rejections to `onError`. Default Hermes's tracker; `null` turns it off. */\n rejectionTracker?: EnableRejectionTracker | null;\n /** `AppState` and NetInfo, so queries refetch on focus and know the network. */\n lifecycle?: QueryLifecycleOptions;\n /**\n * Report queries and mutations that failed for good to `onError` (and so\n * to the observability block), non-fatal, as `query` / `mutation` with the\n * key's first segment as a tag. Only unexpected errors: offline, signed\n * out, not found and the server's expected refusals are left to the\n * screen. One query opts out with `meta: { reportErrors: false }`.\n * Default true. Read once.\n */\n reportQueryErrors?: boolean;\n /**\n * Every caught error, after the blocks' own `onError` (the observability\n * block, `createObservability` from `/observability`, reports to Sentry\n * there). A throwing reporter is ignored.\n */\n onError?: OnError;\n /** After a signed-in user signs out, once the query cache is cleared. */\n onSignedOut?: () => void;\n /**\n * The updates block: `createUpdates(…)` from `@marktiderman/genesis-native/updates`\n * (force upgrade, maintenance, the update banner, what's new). Its policy\n * loads behind the splash for at most `policyTimeoutMs` and never fails the\n * boot. Read once; leave it out to turn the block off.\n */\n updates?: UpdatesBlock;\n /**\n * Blocks to run (`createUpdates(…)` is one). Resolved once at start: a\n * block whose requirement is missing, or two blocks contributing the same\n * slot, nav entry or Settings row, shows the fatal screen and reports a\n * `BlockError` to `onError`. Read once.\n */\n blocks?: readonly NativeBlock[];\n /**\n * Your features (FeatureIds) that blocks may require but that aren't\n * blocks. A block requiring anything that is neither one of `blocks` nor\n * listed here is a `BlockError`. Read once.\n */\n appFeatures?: readonly string[];\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/** The default boot slot: a plain loading view (the splash covers it at launch). */\nexport function BootScreen(_props: BootScreenProps) {\n return (\n <View testID=\"genesis-boot\" accessibilityRole=\"progressbar\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}>\n <Text>Loading…</Text>\n </View>\n );\n}\n\nconst PassThrough: ComponentType<SignedOutProps> = ({ children }) => <>{children}</>;\n/** The last-resort fallback: nothing above it has to work. */\nconst PlainFallback = (props: FatalScreenProps) => <FatalScreen {...props} kind=\"plain\" />;\n\n// The web provider's types don't list the native-only prop; Metro resolves the native provider.\nconst ThemeProvider = GenesisThemeProvider as ComponentType<{\n brand: CanonicalBrand;\n syncNativeAppearance?: boolean;\n children: ReactNode;\n}>;\n\n/**\n * The root of an Expo app: theme, keyboard, data, boot behind the splash, errors, session and held links.\n *\n * @stability Beta\n */\nexport function GenesisNativeApp(props: GenesisNativeAppProps) {\n // Above every provider: if one of them (or the shell's own set-up) throws,\n // this shows a screen made of nothing that can fail, and retry starts over.\n const [rootKey, setRootKey] = useState(0);\n const onErrorRef = useRef(props.onError);\n onErrorRef.current = props.onError;\n // The blocks as given, before they are resolved: an error here may come from resolving them.\n const blocksRef = useRef(givenBlocks(props));\n const splashRef = useRef(props.splash);\n splashRef.current = props.splash;\n return (\n <GenesisErrorBoundary\n key={rootKey}\n fallback={PlainFallback}\n onError={(e, r) => {\n reportToBlocks(blocksRef.current, e, r);\n try {\n onErrorRef.current?.(e, r);\n } catch {\n // A failing reporter must not stop the fatal screen.\n }\n // The shell (which hides the splash) never mounted: hide it here, or the screen stays behind it.\n splashRef.current?.hideAsync().catch(() => {});\n }}\n onRetry={() => setRootKey((key) => key + 1)}\n >\n <ThemedShell {...props} />\n </GenesisErrorBoundary>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nconst MISSING_KEYBOARD_PROVIDER =\n \"GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won't move above the keyboard. \" +\n 'Pass `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nconst TOOLBAR_WITHOUT_SCROLL =\n \"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. \" +\n 'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nfunction ThemedShell(props: GenesisNativeAppProps) {\n const { brand, keyboardScroll, keyboardToolbar } = props;\n // Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.\n const [Keyboard] = useState(() => props.keyboardProvider);\n // Frozen too: an inline object would hand every component a new module set each render.\n const [modules] = useState(() => props.modules);\n const [toast] = useState(() => (props.toast === null ? null : { position: \"top\" as const, ...props.toast }));\n const missingProvider = Boolean(keyboardScroll) && !Keyboard;\n const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;\n useEffect(() => {\n if (typeof __DEV__ === \"undefined\" || !__DEV__) return;\n // genesis-allow-console: development-only set-up mistakes, shown as LogBox errors on purpose.\n if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);\n if (toolbarWithoutScroll) console.error(TOOLBAR_WITHOUT_SCROLL);\n }, [missingProvider, toolbarWithoutScroll]);\n let body = <Shell {...props} />;\n // Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.\n if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;\n if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;\n if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;\n if (Keyboard) body = <Keyboard>{body}</Keyboard>;\n if (modules?.navigation && props.navigationTheme !== false) {\n body = (\n <NavigationTheme module={modules.navigation} brand={brand} brandVariables={props.brandVariables} given={props.navigationTheme}>\n {body}\n </NavigationTheme>\n );\n }\n return (\n <ThemeProvider brand={brand} syncNativeAppearance>\n {props.brandVariables ? (\n <BrandVariables brand={brand} given={props.brandVariables}>\n {body}\n </BrandVariables>\n ) : (\n body\n )}\n </ThemeProvider>\n );\n}\n\n/**\n * Theme role variables (`--primary`, `--background`, …) for the current mode,\n * set on a view around the app, so NativeWind's role classes (`bg-primary` is\n * `hsl(var(--primary))`) read them instead of what `:root` declares. Only with\n * `brandVariables`: NativeWind can't tell which `:root` variables are the\n * app's own, so setting them is the app's choice.\n */\nfunction BrandVariables({\n brand,\n given,\n children,\n}: {\n brand: CanonicalBrand;\n given: NonNullable<GenesisNativeAppProps[\"brandVariables\"]>;\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const variables = useMemo(() => {\n if (given === true) return brandRoleVariables(brand);\n const perMode = given as { light?: unknown; dark?: unknown };\n if (typeof perMode.light === \"object\" && typeof perMode.dark === \"object\") return given as { light: Record<string, string>; dark: Record<string, string> };\n return { light: given as Record<string, string>, dark: given as Record<string, string> };\n }, [brand, given]);\n const style = useMemo(() => [{ flex: 1 }, vars(variables[resolvedMode])], [variables, resolvedMode]);\n return (\n <View testID=\"genesis-brand-variables\" style={style}>\n {children}\n </View>\n );\n}\n\n/**\n * `\"240 10% 3.9%\"` (a role variable's value) → `\"hsl(240, 10%, 3.9%)\"`, and `\"240 10% 3.9% / 0.5\"`\n * → `\"hsla(240, 10%, 3.9%, 0.5)\"`; anything else as it is.\n */\nfunction roleColor(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const [color = \"\", alpha] = value.split(\"/\").map((p) => p.trim());\n const parts = color.split(/\\s+/);\n if (parts.length !== 3) return value;\n return alpha ? `hsla(${parts.join(\", \")}, ${alpha})` : `hsl(${parts.join(\", \")})`;\n}\n\n/**\n * React Navigation's theme for the current mode, in the app's role colors: the\n * variables `brandVariables` sets (or `brandRoleVariables(brand)`) over React\n * Navigation's own light or dark theme, which keeps its fonts.\n */\nfunction NavigationTheme({\n module,\n brand,\n brandVariables,\n given,\n children,\n}: {\n module: GenesisNavigationModule;\n brand: CanonicalBrand;\n brandVariables: GenesisNativeAppProps[\"brandVariables\"];\n given: GenesisNativeAppProps[\"navigationTheme\"];\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const theme = useMemo((): GenesisNavigationTheme => {\n const base = resolvedMode === \"dark\" ? module.DarkTheme : module.DefaultTheme;\n if (given) {\n const perMode = given as { light?: GenesisNavigationTheme; dark?: GenesisNavigationTheme };\n const own = perMode.light && perMode.dark ? perMode[resolvedMode]! : (given as GenesisNavigationTheme);\n // React Navigation's headers read every font variant: a theme without fonts keeps the base's.\n return own.fonts ? own : { ...own, fonts: base.fonts };\n }\n // The app's own map over the brand's role colors, so a partial map never falls back to React Navigation's.\n let variables = brandRoleVariables(brand)[resolvedMode];\n if (brandVariables && brandVariables !== true) {\n const perMode = brandVariables as { light?: unknown; dark?: unknown };\n const own = typeof perMode.light === \"object\" && typeof perMode.dark === \"object\" ? (brandVariables as Record<\"light\" | \"dark\", Record<string, string>>)[resolvedMode] : (brandVariables as Record<string, string>);\n variables = { ...variables, ...own };\n }\n const pick = (name: string, fallback: GenesisNavigationTheme[\"colors\"][\"text\"]) => roleColor(variables[`--${name}`]) ?? fallback;\n return {\n ...base,\n dark: resolvedMode === \"dark\",\n colors: {\n ...base.colors,\n primary: pick(\"primary\", base.colors.primary),\n background: pick(\"background\", base.colors.background),\n card: pick(\"card\", base.colors.card),\n text: pick(\"foreground\", base.colors.text),\n border: pick(\"border\", base.colors.border),\n notification: pick(\"destructive\", base.colors.notification),\n },\n };\n }, [module, brand, brandVariables, given, resolvedMode]);\n const Provider = module.ThemeProvider;\n return <Provider value={theme}>{children}</Provider>;\n}\n\nconst SESSION_STEP_MARGIN_MS = 15_000;\n\nfunction Shell(props: GenesisNativeAppProps) {\n const { supabase, provider, queryClient: queryOptions, persist, splash, links, steps = [], bootOptions, sessionWaitMs = 5000 } = props;\n const { errorUtils, rejectionTracker, lifecycle, slotProps, children } = props;\n const latest = useRef(props);\n latest.current = props;\n const [blockList] = useState(() => givenBlocks(props));\n // Read once, like the keyboard provider: a different module later would remount the screens.\n const [bottomSheet] = useState(() => props.bottomSheet);\n const onError: OnError = (error, report) => {\n reportToBlocks(blockList, error, report);\n try {\n latest.current.onError?.(error, report);\n } catch {\n // A failing reporter must not take the shell down with it.\n }\n };\n // How many fatal screens are up (the global handler lets a second fatal error end the app).\n const fatalShown = useRef(0);\n\n // Created once: the shell's parts live as long as the app.\n const [parts] = useState(() => {\n const list = blockList;\n const blocks = resolveBlocks(list, props.appFeatures ? [...list.map((b) => b.id), ...props.appFeatures] : undefined, {\n platform: \"native\",\n slots: NATIVE_APP_SLOT_NAMES,\n });\n const client = queryOptions?.client ?? createNativeQueryClient(queryOptions?.config);\n const persistence = persist ? persist(client) : null;\n const session = createSessionStore(supabase, {\n waitMs: sessionWaitMs,\n // Another user (or nobody) now: nothing of the last user's may show or stay on disk.\n onUserChange: (previous, next) => {\n client.clear();\n void persistence?.clear();\n if (previous !== null && next === null) latest.current.onSignedOut?.();\n },\n });\n const boot = createBoot(\n [\n ...steps,\n // Blocks' steps, in dependency order (the updates block's settles within its own timeout and never throws).\n ...blocks.blocks.flatMap((block) => block.bootSteps ?? []),\n { id: \"genesis:session\", run: () => session.load(), timeoutMs: sessionWaitMs + SESSION_STEP_MARGIN_MS },\n // After the session, so only the cache saved for this user is restored.\n ...(persistence ? [{ id: \"genesis:query-cache\", run: () => persistence.restore(session.getState().userId ?? \"\") }] : []),\n ],\n bootOptions,\n );\n // One component type for the life of the app, so a re-render never remounts a visible fatal screen.\n function FatalFallback(fallbackProps: FatalScreenProps) {\n useEffect(() => {\n fatalShown.current++;\n return () => {\n fatalShown.current--;\n };\n }, []);\n const { slotProps: sp } = latest.current;\n const s = withBlockSlots(blocks.slots, latest.current.slots);\n return (\n // A `fatal` slot that throws falls back to the plain screen.\n <GenesisErrorBoundary fallback={PlainFallback} onError={onError} onRetry={fallbackProps.retry}>\n {renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal)}\n </GenesisErrorBoundary>\n );\n }\n return { client, persistence, session, boot, FatalFallback, blocks, provider: provider ?? createSupabaseProvider(supabase) };\n });\n const { boot, session, persistence, client, FatalFallback } = parts;\n const slots = withBlockSlots(parts.blocks.slots, props.slots);\n const bootState = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n const sessionState = useSyncExternalStore(session.subscribe, session.getState, session.getState);\n const [fatal, setFatal] = useState<Error | null>(null);\n const [resetKey, setResetKey] = useState(0);\n\n useEffect(() => session.start(), [session]);\n useEffect(() => {\n void boot.start();\n }, [boot]);\n useEffect(() => {\n if (bootState.status === \"failed\" && bootState.error) onError(bootState.error, { fatal: true, source: \"boot\" });\n }, [bootState.status, bootState.error]);\n useEffect(() => {\n // The screens mount, and start reading, before this effect runs: their reads are this person's\n // (the client is emptied whenever the person changes), so they're saved too.\n if (bootState.status === \"ready\" && persistence) return persistence.subscribe(sessionState.userId ?? \"\", { adopt: Boolean(sessionState.userId) });\n }, [bootState.status, persistence, sessionState.userId]);\n useEffect(() => {\n const utils = errorUtils ?? defaultErrorUtils();\n if (!utils) return;\n return installGlobalErrorHandler({ errorUtils: utils, onError, onFatal: setFatal, alreadyFatal: () => fatalShown.current > 0 });\n }, [errorUtils]);\n useEffect(() => {\n const enable = rejectionTracker === null ? undefined : (rejectionTracker ?? defaultRejectionTracker());\n if (enable) installRejectionTracker({ enable, onError });\n }, [rejectionTracker]);\n useEffect(() => (lifecycle ? connectQueryLifecycle(lifecycle) : undefined), [lifecycle]);\n const [queryReports] = useState(() => props.reportQueryErrors !== false);\n useEffect(() => (queryReports ? reportQueryErrors(client, onError) : undefined), [client, queryReports]);\n\n // Splash: up until boot has finished (the session step included), or failed.\n const settled = bootState.status === \"ready\" || bootState.status === \"failed\" || fatal !== null;\n const splashHidden = useRef(false);\n useEffect(() => {\n if (!settled || !splash || splashHidden.current) return;\n splashHidden.current = true;\n splash.hideAsync().catch(() => {});\n }, [settled, splash]);\n\n const auth: HeldLinkAuth = bootState.status !== \"ready\" || sessionState.status === \"loading\" ? \"pending\" : sessionState.status;\n useHeldLink(links?.hold ?? NO_HOLD, { auth: links ? auth : \"pending\", onRelease: (path) => links?.onRelease(path) });\n\n const retry = () => {\n setFatal(null);\n setResetKey((key) => key + 1);\n if (boot.getState().status === \"failed\") void boot.retry();\n };\n\n let content: ReactNode;\n if (fatal) {\n content = <FatalFallback error={fatal} retry={retry} />;\n } else if (bootState.status === \"failed\" && bootState.error) {\n content = <FatalFallback error={bootState.error} retry={retry} />;\n } else if (bootState.status !== \"ready\") {\n content = renderSlot(BootScreen, slots?.boot, { status: bootState.status }, slotProps?.boot);\n } else {\n const screens =\n sessionState.status === \"signedOut\" ? renderSlot(PassThrough, slots?.signedOut, { children }, slotProps?.signedOut) : children;\n const guarded = renderSlot(\n GenesisErrorBoundary,\n slots?.errorBoundary,\n { fallback: FatalFallback, onError, resetKey, onRetry: retry, children: screens },\n slotProps?.errorBoundary,\n );\n // The first block's root is the outermost.\n content = parts.blocks.blocks.reduceRight<ReactNode>((inner, block) => {\n const Root = block.Root;\n return Root ? (\n <Root key={block.id} slots={slots} slotProps={slotProps}>\n {inner}\n </Root>\n ) : (\n inner\n );\n }, guarded);\n }\n\n return (\n <GenesisProvider provider={parts.provider} queryClient={client}>\n <SessionProvider store={session}>\n <BootProvider boot={boot}>\n <BlocksProvider value={parts.blocks}>\n <GenesisErrorBoundary key={resetKey} fallback={FatalFallback} onError={onError} onRetry={retry}>\n {/* Sheet content renders in the library's portal, here: below data, session, boot and blocks. */}\n {bottomSheet ? <NativeSheetProvider bottomSheet={bottomSheet}>{content}</NativeSheetProvider> : content}\n </GenesisErrorBoundary>\n </BlocksProvider>\n </BootProvider>\n </SessionProvider>\n </GenesisProvider>\n );\n}\n\n// Every slot name, checked against NativeAppSlots by the compiler: a block filling any other is a BlockError.\nconst SLOT_NAMES: Record<keyof NativeAppSlots, true> = {\n boot: true,\n fatal: true,\n errorBoundary: true,\n signedOut: true,\n forceUpgrade: true,\n maintenance: true,\n updateBanner: true,\n whatsNew: true,\n devtoolsFeedback: true,\n pushPrompt: true,\n};\nconst NATIVE_APP_SLOT_NAMES: readonly string[] = Object.keys(SLOT_NAMES);\n\n/** Blocks' slot fills under the app's own slots: the app's (a component or `null`) always win. */\nfunction withBlockSlots(fills: Readonly<Record<string, unknown>>, own: Slots<NativeAppSlots> | undefined): Slots<NativeAppSlots> | undefined {\n if (Object.keys(fills).length === 0) return own;\n return { ...(fills as Slots<NativeAppSlots>), ...own };\n}\n\n/** `blocks`, with `updates` added when it was given on its own (given both ways, it runs once). */\nfunction givenBlocks(props: Pick<GenesisNativeAppProps, \"blocks\" | \"updates\">): readonly NativeBlock[] {\n const given = props.blocks ?? [];\n return props.updates && !given.includes(props.updates) ? [...given, props.updates] : given;\n}\n\nconst NO_HOLD: LinkHold = {\n hold: () => {},\n peek: () => null,\n take: () => null,\n clear: () => {},\n subscribe: () => () => {},\n};\n","/**\n * A hydration gate holds writes until a persisted store has loaded from disk.\n *\n * The bug it prevents: a persisted store (zustand `persist`, say) is created\n * with defaults, something sets a value before the saved state has been read,\n * and that write lands on disk first, replacing what the user had. With the\n * gate, a write made before hydration never reaches disk (`storage()`), or\n * waits for it (`run()`).\n *\n * const gate = createHydrationGate();\n * persist(store, {\n * storage: createJSONStorage(() => gate.storage(AsyncStorage)),\n * // Open only after a good read: after a failed one, writes would replace what's on disk.\n * onRehydrateStorage: () => (_state, error) => {\n * if (!error) gate.markHydrated();\n * },\n * });\n */\nimport type { AsyncStorageLike } from \"./query\";\n\nexport interface HydrationGate {\n readonly hydrated: boolean;\n /** Call once the store has read its saved state. Idempotent. */\n markHydrated(): void;\n /** Resolves once hydrated. */\n whenHydrated(): Promise<void>;\n /** Run a write now if hydrated, otherwise once hydrated. */\n run<T>(write: () => T | Promise<T>): Promise<T>;\n /**\n * The storage, with writes made before hydration dropped (reads pass\n * through, since hydration is a read). After hydration the store writes\n * its merged state on its next change, so nothing is lost but the stale\n * write. (A zustand migration's own write during hydration is dropped too;\n * the old version stays on disk and is migrated again until then.)\n */\n storage<S extends AsyncStorageLike>(storage: S): S;\n}\n\nexport interface HydrationGateOptions {\n /** Told about each write `storage()` dropped (to log it in development). */\n onDroppedWrite?: (key: string) => void;\n}\n\n/** A gate that holds writes until a persisted store has hydrated. */\nexport function createHydrationGate({ onDroppedWrite }: HydrationGateOptions = {}): HydrationGate {\n let hydrated = false;\n let open!: () => void;\n const opened = new Promise<void>((resolve) => {\n open = resolve;\n });\n\n const gate: HydrationGate = {\n get hydrated() {\n return hydrated;\n },\n markHydrated() {\n if (hydrated) return;\n hydrated = true;\n open();\n },\n whenHydrated: () => opened,\n async run(write) {\n if (!hydrated) await opened;\n return write();\n },\n storage(storage) {\n const setItem = async (key: string, value: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.setItem(key, value);\n };\n const removeItem = async (key: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.removeItem(key);\n };\n // A proxy, not a spread: a storage class's prototype methods (and its\n // private fields, through `this`) keep working.\n return new Proxy(storage, {\n get(target, property) {\n if (property === \"setItem\") return setItem;\n if (property === \"removeItem\") return removeItem;\n const value = Reflect.get(target, property, target) as unknown;\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n },\n };\n return gate;\n}\n"]}
@@ -1,9 +1,9 @@
1
- import { a as RouteErrorBoundaryProps, b as ObservabilitySink } from './block-BiaXKPZN.js';
2
- export { B as Breadcrumb, c as BreadcrumbLevel, C as ConsoleSinkOptions, E as ErrorContext, d as EventCheck, e as EventPropSpec, f as EventProps, g as EventSchema, h as EventValues, i as OBSERVABILITY_BLOCK_ID, O as ObservabilityBlock, j as ObservabilityOptions, k as ObservabilityProvider, l as ObserveLike, m as ObserveSinkOptions, R as RecentActivity, n as RecentError, o as RecentStore, T as TimingTags, p as checkEvent, q as consoleSink, r as createObservability, s as defineEvents, t as observeSink, u as scrubBreadcrumb, v as scrubbedError, w as useObservability, x as useRecentActivity } from './block-BiaXKPZN.js';
1
+ import { a as RouteErrorBoundaryProps, b as ObservabilitySink } from './block-CQz1pOnm.js';
2
+ export { B as Breadcrumb, c as BreadcrumbLevel, C as ConsoleSinkOptions, E as ErrorContext, d as EventCheck, e as EventPropSpec, f as EventProps, g as EventSchema, h as EventValues, i as OBSERVABILITY_BLOCK_ID, O as ObservabilityBlock, j as ObservabilityOptions, k as ObservabilityProvider, l as ObserveLike, m as ObserveSinkOptions, R as RecentActivity, n as RecentError, o as RecentStore, T as TimingTags, p as checkEvent, q as consoleSink, r as createObservability, s as defineEvents, t as observeSink, u as scrubBreadcrumb, v as scrubbedError, w as useObservability, x as useRecentActivity } from './block-CQz1pOnm.js';
3
3
  import { ComponentType } from 'react';
4
- import { V as VersionSignature } from './blocks-BGpfYSCJ.js';
5
- export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-DPetH1Eq.js';
6
- import './query-B4YZBiCs.js';
4
+ import { V as VersionSignature } from './blocks-dppiMmy-.js';
5
+ export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-B8DlsLwb.js';
6
+ import './query--ihYsJWC.js';
7
7
  import '@tanstack/react-query';
8
8
  import '@marktiderman/genesis-core/slots';
9
9
  import '@marktiderman/genesis-features/blocks';
@@ -1,6 +1,6 @@
1
- import { scrubRecord, scrubEvent, scrubString } from './chunk-6L36FQBX.js';
2
- export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubbedError, useObservability, useRecentActivity } from './chunk-6L36FQBX.js';
3
- export { ScreenErrorScreen, createScreenErrorBoundary } from './chunk-MFHOHSEQ.js';
1
+ import { scrubRecord, scrubEvent, scrubString } from './chunk-EWHO5WQU.js';
2
+ export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubbedError, useObservability, useRecentActivity } from './chunk-EWHO5WQU.js';
3
+ export { ScreenErrorScreen, createScreenErrorBoundary } from './chunk-YIF4BFQH.js';
4
4
  import './chunk-VIC2KXMA.js';
5
5
  import './chunk-NGYNYJPL.js';
6
6
 
package/dist/persist.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { QueryClient } from '@tanstack/react-query';
2
- import { A as AsyncStorageLike, h as QueryPersistence } from './query-B4YZBiCs.js';
2
+ import { A as AsyncStorageLike, j as QueryPersistence } from './query--ihYsJWC.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -40,13 +40,13 @@ interface QueryPersistenceOptions extends PersistQueriesOptions {
40
40
  /**
41
41
  * Save the allowlisted queries to async storage and restore them, with a max age, an app-version buster and a user scope.
42
42
  *
43
- * @deprecated Use `persistOffline` with `sqliteLocalCache` from `@marktiderman/genesis-native/offline`: it keeps each record once, per person and workspace (docs/MIGRATION.md). Removed in the next major.
43
+ * @deprecated Use `persistOffline` with `sqliteLocalCache` from `@marktiderman/genesis-native/offline`: it keeps each record once, per person and workspace. It needs expo-sqlite, a native module, so unless the app's builds already have it the switch takes a new native build and can't ship as an OTA update (https://github.com/marktiderman/genesis/blob/main/docs/MIGRATION.md). Removed in the next major.
44
44
  */
45
45
  declare function createQueryPersistence({ queryClient, storage, keys, buster, maxAge, storageKey, throttleMs, }: QueryPersistenceOptions): QueryPersistence;
46
46
  /**
47
47
  * `createQueryPersistence` for `GenesisNativeApp`'s `persist` prop, which supplies the client.
48
48
  *
49
- * @deprecated Use `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })` from `@marktiderman/genesis-native/offline` (docs/MIGRATION.md). Removed in the next major.
49
+ * @deprecated Use `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })` from `@marktiderman/genesis-native/offline`. It needs expo-sqlite, a native module, so unless the app's builds already have it the switch takes a new native build and can't ship as an OTA update (https://github.com/marktiderman/genesis/blob/main/docs/MIGRATION.md). Removed in the next major.
50
50
  */
51
51
  declare function persistQueries(options: PersistQueriesOptions): (queryClient: QueryClient) => QueryPersistence;
52
52
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/persist.ts"],"names":[],"mappings":";;;;;AA8CO,SAAS,sBAAA,CAAuB;AAAA,EACrC,WAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA,GAAS,MAAA;AAAA,EACT,UAAA,GAAa,qBAAA;AAAA,EACb,UAAA,GAAa;AACf,CAAA,EAA8C;AAC5C,EAAA,MAAM,SAAA,GAAY,4BAA4B,EAAE,OAAA,EAAS,KAAK,UAAA,EAAY,YAAA,EAAc,YAAY,CAAA;AACpG,EAAA,MAAM,OAAA,GAAU,IAAI,GAAA,CAAI,IAAI,CAAA;AAC5B,EAAA,MAAM,gBAAA,GAAmB;AAAA,IACvB,oBAAA,EAAsB,CAAC,KAAA,KACrB,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,KAAA,CAAM,QAAA,CAAS,CAAC,CAAC,CAAC,CAAA,IAAK,4BAA4B,KAAK,CAAA;AAAA;AAAA,IAE7E,yBAAyB,MAAM;AAAA,GACjC;AAGA,EAAA,MAAM,SAAS,CAAC,KAAA,KAAkB,CAAA,EAAG,MAAM,SAAS,KAAK,CAAA,CAAA;AACzD,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,OAAO,KAAA,KAAU;AACxB,MAAA,IAAI;AACF,QAAA,MAAM,yBAAA,CAA0B,EAAE,WAAA,EAAa,SAAA,EAAW,QAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,MAAA,EAAQ,CAAA;AAAA,MAC3F,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF,CAAA;AAAA,IACA,SAAA,EAAW,CAAC,KAAA,EAAO,OAAA,KAAY;AAE7B,MAAA,IAAI,SAAS,KAAA,IAAS,KAAA,EAAO,KAAK,sBAAA,CAAuB,EAAE,WAAA,EAAa,SAAA,EAAW,MAAA,EAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,gBAAA,EAAkB,CAAA,CAAE,KAAA,CAAM,MAAM,MAAS,CAAA;AACnJ,MAAA,OAAO,2BAAA,CAA4B,EAAE,WAAA,EAAa,SAAA,EAAW,QAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,gBAAA,EAAkB,CAAA;AAAA,IACxG,CAAA;AAAA,IACA,OAAO,YAAY;AACjB,MAAA,MAAM,UAAU,YAAA,EAAa;AAAA,IAC/B;AAAA,GACF;AACF;AAOO,SAAS,eAAe,OAAA,EAAgF;AAC7G,EAAA,OAAO,CAAC,WAAA,KAAgB,sBAAA,CAAuB,EAAE,GAAG,OAAA,EAAS,aAAa,CAAA;AAC5E","file":"persist.js","sourcesContent":["/**\n * `@marktiderman/genesis-native/persist`: save chosen queries to async storage\n * (AsyncStorage, MMKV, …) with TanStack's own persister, so restore,\n * throttling and max age are theirs.\n *\n * Install `@tanstack/query-persist-client-core` and\n * `@tanstack/query-async-storage-persister` at the same version as your\n * `@tanstack/react-query`: they pin `@tanstack/query-core` exactly, and two\n * copies of it would not share a cache.\n *\n * <GenesisNativeApp persist={persistQueries({ storage: AsyncStorage, keys: [\"clients\"], buster: version })} … />\n *\n * @stability Beta\n */\nimport { defaultShouldDehydrateQuery, type QueryClient } from \"@tanstack/react-query\";\nimport { persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe } from \"@tanstack/query-persist-client-core\";\nimport { createAsyncStoragePersister } from \"@tanstack/query-async-storage-persister\";\nimport { DAY_MS, type AsyncStorageLike, type QueryPersistence } from \"./query\";\n\nexport interface PersistQueriesOptions {\n storage: AsyncStorageLike;\n /**\n * The query-key roots to persist: a query is saved when its key's first\n * element is listed (`[\"clients\", id]` is saved under `\"clients\"`). Nothing\n * else is written to the phone.\n */\n keys: readonly string[];\n /** Your app's version: a different value discards the saved cache. */\n buster: string;\n /** How old a saved cache may be when restored. Default 24 hours. */\n maxAge?: number;\n /** Storage key. Default `\"genesis-query-cache\"`. */\n storageKey?: string;\n /** Write at most this often. Default 1000 ms. */\n throttleMs?: number;\n}\n\nexport interface QueryPersistenceOptions extends PersistQueriesOptions {\n queryClient: QueryClient;\n}\n\n/**\n * Save the allowlisted queries to async storage and restore them, with a max age, an app-version buster and a user scope.\n *\n * @deprecated Use `persistOffline` with `sqliteLocalCache` from `@marktiderman/genesis-native/offline`: it keeps each record once, per person and workspace (docs/MIGRATION.md). Removed in the next major.\n */\nexport function createQueryPersistence({\n queryClient,\n storage,\n keys,\n buster,\n maxAge = DAY_MS,\n storageKey = \"genesis-query-cache\",\n throttleMs = 1000,\n}: QueryPersistenceOptions): QueryPersistence {\n const persister = createAsyncStoragePersister({ storage, key: storageKey, throttleTime: throttleMs });\n const allowed = new Set(keys);\n const dehydrateOptions = {\n shouldDehydrateQuery: (query: Parameters<typeof defaultShouldDehydrateQuery>[0]) =>\n allowed.has(String(query.queryKey[0])) && defaultShouldDehydrateQuery(query),\n // Mutations stay in memory: replaying a saved write is an outbox's job.\n shouldDehydrateMutation: () => false,\n };\n // The scope rides in the buster: TanStack discards (and deletes) a saved\n // cache whose buster differs, so another user's cache is never restored.\n const scoped = (scope: string) => `${buster}|user:${scope}`;\n return {\n restore: async (scope) => {\n try {\n await persistQueryClientRestore({ queryClient, persister, buster: scoped(scope), maxAge });\n } catch {\n // An unreadable cache has already been deleted; start without it rather than fail the boot.\n }\n },\n subscribe: (scope, options) => {\n // Adopting: what's already in the client is saved now, not only at its next change.\n if (options?.adopt && scope) void persistQueryClientSave({ queryClient, persister, buster: scoped(scope), dehydrateOptions }).catch(() => undefined);\n return persistQueryClientSubscribe({ queryClient, persister, buster: scoped(scope), dehydrateOptions });\n },\n clear: async () => {\n await persister.removeClient();\n },\n };\n}\n\n/**\n * `createQueryPersistence` for `GenesisNativeApp`'s `persist` prop, which supplies the client.\n *\n * @deprecated Use `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })` from `@marktiderman/genesis-native/offline` (docs/MIGRATION.md). Removed in the next major.\n */\nexport function persistQueries(options: PersistQueriesOptions): (queryClient: QueryClient) => QueryPersistence {\n return (queryClient) => createQueryPersistence({ ...options, queryClient });\n}\n\nexport type { QueryPersistence } from \"./query\";\n"]}
1
+ {"version":3,"sources":["../src/persist.ts"],"names":[],"mappings":";;;;;AA8CO,SAAS,sBAAA,CAAuB;AAAA,EACrC,WAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA,GAAS,MAAA;AAAA,EACT,UAAA,GAAa,qBAAA;AAAA,EACb,UAAA,GAAa;AACf,CAAA,EAA8C;AAC5C,EAAA,MAAM,SAAA,GAAY,4BAA4B,EAAE,OAAA,EAAS,KAAK,UAAA,EAAY,YAAA,EAAc,YAAY,CAAA;AACpG,EAAA,MAAM,OAAA,GAAU,IAAI,GAAA,CAAI,IAAI,CAAA;AAC5B,EAAA,MAAM,gBAAA,GAAmB;AAAA,IACvB,oBAAA,EAAsB,CAAC,KAAA,KACrB,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,KAAA,CAAM,QAAA,CAAS,CAAC,CAAC,CAAC,CAAA,IAAK,4BAA4B,KAAK,CAAA;AAAA;AAAA,IAE7E,yBAAyB,MAAM;AAAA,GACjC;AAGA,EAAA,MAAM,SAAS,CAAC,KAAA,KAAkB,CAAA,EAAG,MAAM,SAAS,KAAK,CAAA,CAAA;AACzD,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,OAAO,KAAA,KAAU;AACxB,MAAA,IAAI;AACF,QAAA,MAAM,yBAAA,CAA0B,EAAE,WAAA,EAAa,SAAA,EAAW,QAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,MAAA,EAAQ,CAAA;AAAA,MAC3F,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF,CAAA;AAAA,IACA,SAAA,EAAW,CAAC,KAAA,EAAO,OAAA,KAAY;AAE7B,MAAA,IAAI,SAAS,KAAA,IAAS,KAAA,EAAO,KAAK,sBAAA,CAAuB,EAAE,WAAA,EAAa,SAAA,EAAW,MAAA,EAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,gBAAA,EAAkB,CAAA,CAAE,KAAA,CAAM,MAAM,MAAS,CAAA;AACnJ,MAAA,OAAO,2BAAA,CAA4B,EAAE,WAAA,EAAa,SAAA,EAAW,QAAQ,MAAA,CAAO,KAAK,CAAA,EAAG,gBAAA,EAAkB,CAAA;AAAA,IACxG,CAAA;AAAA,IACA,OAAO,YAAY;AACjB,MAAA,MAAM,UAAU,YAAA,EAAa;AAAA,IAC/B;AAAA,GACF;AACF;AAOO,SAAS,eAAe,OAAA,EAAgF;AAC7G,EAAA,OAAO,CAAC,WAAA,KAAgB,sBAAA,CAAuB,EAAE,GAAG,OAAA,EAAS,aAAa,CAAA;AAC5E","file":"persist.js","sourcesContent":["/**\n * `@marktiderman/genesis-native/persist`: save chosen queries to async storage\n * (AsyncStorage, MMKV, …) with TanStack's own persister, so restore,\n * throttling and max age are theirs.\n *\n * Install `@tanstack/query-persist-client-core` and\n * `@tanstack/query-async-storage-persister` at the same version as your\n * `@tanstack/react-query`: they pin `@tanstack/query-core` exactly, and two\n * copies of it would not share a cache.\n *\n * <GenesisNativeApp persist={persistQueries({ storage: AsyncStorage, keys: [\"clients\"], buster: version })} … />\n *\n * @stability Beta\n */\nimport { defaultShouldDehydrateQuery, type QueryClient } from \"@tanstack/react-query\";\nimport { persistQueryClientRestore, persistQueryClientSave, persistQueryClientSubscribe } from \"@tanstack/query-persist-client-core\";\nimport { createAsyncStoragePersister } from \"@tanstack/query-async-storage-persister\";\nimport { DAY_MS, type AsyncStorageLike, type QueryPersistence } from \"./query\";\n\nexport interface PersistQueriesOptions {\n storage: AsyncStorageLike;\n /**\n * The query-key roots to persist: a query is saved when its key's first\n * element is listed (`[\"clients\", id]` is saved under `\"clients\"`). Nothing\n * else is written to the phone.\n */\n keys: readonly string[];\n /** Your app's version: a different value discards the saved cache. */\n buster: string;\n /** How old a saved cache may be when restored. Default 24 hours. */\n maxAge?: number;\n /** Storage key. Default `\"genesis-query-cache\"`. */\n storageKey?: string;\n /** Write at most this often. Default 1000 ms. */\n throttleMs?: number;\n}\n\nexport interface QueryPersistenceOptions extends PersistQueriesOptions {\n queryClient: QueryClient;\n}\n\n/**\n * Save the allowlisted queries to async storage and restore them, with a max age, an app-version buster and a user scope.\n *\n * @deprecated Use `persistOffline` with `sqliteLocalCache` from `@marktiderman/genesis-native/offline`: it keeps each record once, per person and workspace. It needs expo-sqlite, a native module, so unless the app's builds already have it the switch takes a new native build and can't ship as an OTA update (https://github.com/marktiderman/genesis/blob/main/docs/MIGRATION.md). Removed in the next major.\n */\nexport function createQueryPersistence({\n queryClient,\n storage,\n keys,\n buster,\n maxAge = DAY_MS,\n storageKey = \"genesis-query-cache\",\n throttleMs = 1000,\n}: QueryPersistenceOptions): QueryPersistence {\n const persister = createAsyncStoragePersister({ storage, key: storageKey, throttleTime: throttleMs });\n const allowed = new Set(keys);\n const dehydrateOptions = {\n shouldDehydrateQuery: (query: Parameters<typeof defaultShouldDehydrateQuery>[0]) =>\n allowed.has(String(query.queryKey[0])) && defaultShouldDehydrateQuery(query),\n // Mutations stay in memory: replaying a saved write is an outbox's job.\n shouldDehydrateMutation: () => false,\n };\n // The scope rides in the buster: TanStack discards (and deletes) a saved\n // cache whose buster differs, so another user's cache is never restored.\n const scoped = (scope: string) => `${buster}|user:${scope}`;\n return {\n restore: async (scope) => {\n try {\n await persistQueryClientRestore({ queryClient, persister, buster: scoped(scope), maxAge });\n } catch {\n // An unreadable cache has already been deleted; start without it rather than fail the boot.\n }\n },\n subscribe: (scope, options) => {\n // Adopting: what's already in the client is saved now, not only at its next change.\n if (options?.adopt && scope) void persistQueryClientSave({ queryClient, persister, buster: scoped(scope), dehydrateOptions }).catch(() => undefined);\n return persistQueryClientSubscribe({ queryClient, persister, buster: scoped(scope), dehydrateOptions });\n },\n clear: async () => {\n await persister.removeClient();\n },\n };\n}\n\n/**\n * `createQueryPersistence` for `GenesisNativeApp`'s `persist` prop, which supplies the client.\n *\n * @deprecated Use `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })` from `@marktiderman/genesis-native/offline`. It needs expo-sqlite, a native module, so unless the app's builds already have it the switch takes a new native build and can't ship as an OTA update (https://github.com/marktiderman/genesis/blob/main/docs/MIGRATION.md). Removed in the next major.\n */\nexport function persistQueries(options: PersistQueriesOptions): (queryClient: QueryClient) => QueryPersistence {\n return (queryClient) => createQueryPersistence({ ...options, queryClient });\n}\n\nexport type { QueryPersistence } from \"./query\";\n"]}
package/dist/push.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { X as PushPermissionStatus, Y as NotificationResponseLike, Z as NotificationLike, o as LinkOptions, _ as QuietHours } from './blocks-BGpfYSCJ.js';
2
- export { $ as ChannelImportance, a0 as ChannelInputLike, a1 as DEFAULT_PREFERENCES, a2 as NotificationActionLike, a3 as NotificationBehaviorLike, a4 as NotificationCategory, a5 as NotificationPreferences, a6 as NotificationsModuleLike, a7 as PermissionRequestLike, a8 as PermissionState, a9 as PermissionStatusLike, aa as PermissionStore, ab as PreferencesState, ac as PreferencesStatus, ad as PreferencesStore, ae as PromptOptions, af as PromptState, ag as PromptStore, ah as PushAppStateLike, ai as PushBackend, aj as PushBackendError, ak as PushBlock, al as PushChannel, am as PushDeviceCategory, an as PushErrorSource, ao as PushOnError, ap as PushOptions, aq as PushPromptProps, ar as PushPromptSheet, as as PushProvider, at as PushRoot, au as PushRootProps, av as PushSlots, aw as PushStorageLike, ax as PushSupabaseLike, ay as Registration, az as RegistrationState, aA as RegistrationStatus, aB as SubscriptionLike, aC as canPush, aD as createPermissionStore, aE as createPreferencesStore, aF as createPromptStore, aG as createPush, aH as createRegistration, aI as statusOf, aJ as supabasePushBackend, aK as useBadge, aL as useNotificationPreferences, aM as useOptionalPush, aN as usePush, aO as usePushPermissionState, aP as usePushPrompt, aQ as usePushRegistration, aR as useSuppressNotifications, aS as validPreferences } from './blocks-BGpfYSCJ.js';
1
+ import { X as PushPermissionStatus, Y as NotificationResponseLike, Z as NotificationLike, o as LinkOptions, _ as QuietHours } from './blocks-dppiMmy-.js';
2
+ export { $ as ChannelImportance, a0 as ChannelInputLike, a1 as DEFAULT_PREFERENCES, a2 as NotificationActionLike, a3 as NotificationBehaviorLike, a4 as NotificationCategory, a5 as NotificationPreferences, a6 as NotificationsModuleLike, a7 as PermissionRequestLike, a8 as PermissionState, a9 as PermissionStatusLike, aa as PermissionStore, ab as PreferencesState, ac as PreferencesStatus, ad as PreferencesStore, ae as PromptOptions, af as PromptState, ag as PromptStore, ah as PushAppStateLike, ai as PushBackend, aj as PushBackendError, ak as PushBlock, al as PushChannel, am as PushDeviceCategory, an as PushErrorSource, ao as PushOnError, ap as PushOptions, aq as PushPromptProps, ar as PushPromptSheet, as as PushProvider, at as PushRoot, au as PushRootProps, av as PushSlots, aw as PushStorageLike, ax as PushSupabaseLike, ay as Registration, az as RegistrationState, aA as RegistrationStatus, aB as SubscriptionLike, aC as canPush, aD as createPermissionStore, aE as createPreferencesStore, aF as createPromptStore, aG as createPush, aH as createRegistration, aI as statusOf, aJ as supabasePushBackend, aK as useBadge, aL as useNotificationPreferences, aM as useOptionalPush, aN as usePush, aO as usePushPermissionState, aP as usePushPrompt, aQ as usePushRegistration, aR as useSuppressNotifications, aS as validPreferences } from './blocks-dppiMmy-.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
6
6
  import { SettingsPageProps, SettingsPageRow } from '@marktiderman/genesis-ui-native/layouts';
7
7
  export { RICH_PUSH_IMAGE_FIELDS, RichPushData, RichPushMessageLike, isRichPushUrl, richPushMessage } from './push-payload.js';
8
8
  import '@marktiderman/genesis-features/blocks';
9
- import './query-B4YZBiCs.js';
9
+ import './query--ihYsJWC.js';
10
10
  import '@tanstack/react-query';
11
11
  import '@marktiderman/genesis-design-system';
12
12
  import '@marktiderman/genesis-core/provider';
@@ -14,14 +14,31 @@ interface FatalScreenProps {
14
14
  /** Clears the error and remounts the app below the shell (and re-runs a failed boot). */
15
15
  retry: () => void;
16
16
  }
17
- /** The default fatal screen: what went wrong and "Try again". */
18
- declare function FatalScreen({ error, retry }: FatalScreenProps): react.JSX.Element;
17
+ /** Which fatal screen: the app's, one screen's, or the last-resort plain one. */
18
+ type FatalScreenKind = "app" | "screen" | "plain";
19
+ interface FatalScreenViewProps {
20
+ error: Error;
21
+ /** Clears the error and renders again (a screen's retry may be async, as Expo Router's is). */
22
+ retry: () => void | Promise<void>;
23
+ /**
24
+ * `app` (default): the app hit a problem, "Try again" remounts it. `screen`: one screen failed
25
+ * and the rest of the app still works (the screen boundary's default). `plain`: React Native
26
+ * primitives only, no theme, no context, nothing that can itself fail; shown when the providers
27
+ * could not start, or when the `fatal` slot threw.
28
+ */
29
+ kind?: FatalScreenKind;
30
+ }
19
31
  /**
20
- * The last-resort fatal screen: React Native primitives only, no theme, no
21
- * context, nothing that can itself fail. Shown when the providers could not
22
- * start, or when the `fatal` slot threw.
32
+ * The fatal screen: what went wrong and "Try again", for the whole app, one screen, or (with
33
+ * `kind="plain"`) the last resort that needs nothing above it.
34
+ */
35
+ declare function FatalScreen({ error, retry, kind }: FatalScreenViewProps): react.JSX.Element;
36
+ /**
37
+ * The last-resort fatal screen.
38
+ *
39
+ * @deprecated Use `<FatalScreen kind="plain" />`; this name goes at the next major.
23
40
  */
24
- declare function PlainFatalScreen({ error, retry }: FatalScreenProps): react.JSX.Element;
41
+ declare function PlainFatalScreen(props: FatalScreenProps): react.JSX.Element;
25
42
  interface ErrorReport {
26
43
  /** True when the app could not go on (a render error, a failed boot, a fatal global error). */
27
44
  fatal: boolean;
@@ -210,4 +227,4 @@ declare function queryKeyName(key: readonly unknown[] | undefined): string | und
210
227
  */
211
228
  declare function reportQueryErrors(client: QueryClient, report: QueryErrorReporter, options?: ReportQueryErrorsOptions): () => void;
212
229
 
213
- export { type AsyncStorageLike as A, DAY_MS as D, type EnableRejectionTracker as E, FatalScreen as F, GenesisErrorBoundary as G, type NetInfoLike as N, type OnError as O, PlainFatalScreen as P, type QueryErrorReporter as Q, type ReportQueryErrorsOptions as R, type AppStateLike as a, type ErrorReport as b, type ErrorUtilsLike as c, type FatalScreenProps as d, type GenesisErrorBoundaryProps as e, type GlobalErrorHandlerOptions as f, type QueryLifecycleOptions as g, type QueryPersistence as h, connectQueryLifecycle as i, createNativeQueryClient as j, defaultErrorUtils as k, defaultRejectionTracker as l, errorDetails as m, installGlobalErrorHandler as n, installRejectionTracker as o, queryKeyName as q, reportQueryErrors as r };
230
+ export { type AsyncStorageLike as A, DAY_MS as D, type EnableRejectionTracker as E, FatalScreen as F, GenesisErrorBoundary as G, type NetInfoLike as N, type OnError as O, PlainFatalScreen as P, type QueryErrorReporter as Q, type ReportQueryErrorsOptions as R, type AppStateLike as a, type ErrorReport as b, type ErrorUtilsLike as c, type FatalScreenKind as d, type FatalScreenProps as e, type FatalScreenViewProps as f, type GenesisErrorBoundaryProps as g, type GlobalErrorHandlerOptions as h, type QueryLifecycleOptions as i, type QueryPersistence as j, connectQueryLifecycle as k, createNativeQueryClient as l, defaultErrorUtils as m, defaultRejectionTracker as n, errorDetails as o, installGlobalErrorHandler as p, installRejectionTracker as q, queryKeyName as r, reportQueryErrors as s };
@@ -1,16 +1,20 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ComponentType } from 'react';
3
- import { O as OnError } from './query-B4YZBiCs.js';
3
+ import { O as OnError } from './query--ihYsJWC.js';
4
4
 
5
5
  /** What Expo Router gives a route's `ErrorBoundary`: the error, and `retry` to render the route again. */
6
6
  interface ScreenErrorProps {
7
7
  error: Error;
8
8
  retry: () => Promise<void>;
9
9
  }
10
- /** The default screen fallback: the screen hit a problem, and "Try again". @stability Beta */
11
- declare function ScreenErrorScreen({ error, retry }: ScreenErrorProps): react.JSX.Element;
10
+ /**
11
+ * The default screen fallback: the screen hit a problem, and "Try again".
12
+ *
13
+ * @deprecated Use `<FatalScreen kind="screen" />`; this name goes at the next major.
14
+ */
15
+ declare function ScreenErrorScreen(props: ScreenErrorProps): react.JSX.Element;
12
16
  interface ScreenErrorBoundaryOptions {
13
- /** What to show. Default `ScreenErrorScreen`. */
17
+ /** What to show. Default `<FatalScreen kind="screen" />`. */
14
18
  fallback?: ComponentType<ScreenErrorProps>;
15
19
  /** Where the error goes. Default `reportError` from genesis-core (the observability block, when it is on). */
16
20
  onError?: OnError;
package/dist/updates.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { aT as ApplicationLike, aU as CLOCK_SKEW_MS, aV as ChannelSwitchResult, aW as ChannelSwitcher, aX as ChannelSwitcherOptions, aY as EvaluatePolicyOptions, aZ as ForceUpgradeProps, a_ as ForceUpgradeScreen, a$ as MaintenanceProps, b0 as MaintenanceScreen, b1 as PolicyClientLike, b2 as PolicyOrigin, b3 as PolicyState, b4 as PolicyStore, b5 as PolicyStoreOptions, b6 as ReleaseNote, b7 as ReloadGuard, b8 as SupabasePolicySourceOptions, b9 as UPDATES_BLOCK_ID, ba as UpdateBanner, bb as UpdateBannerProps, bc as UpdateCheckState, bd as UpdateCheckStatus, be as UpdateChecker, bf as UpdateCheckerOptions, bg as UpdatePlatform, bh as UpdatePolicy, bi as UpdatePolicySource, bj as UpdateVerdict, bk as UpdatesAppStateLike, U as UpdatesBlock, bl as UpdatesErrorSource, bm as UpdatesModuleLike, bn as UpdatesOnError, bo as UpdatesOptions, bp as UpdatesProvider, bq as UpdatesRoot, br as UpdatesRootProps, bs as UpdatesSlots, bt as UpdatesStorageLike, V as VersionSignature, bu as VersionSignatureInput, bv as WEEK_MS, bw as WhatsNewOptions, bx as WhatsNewProps, by as WhatsNewSheet, bz as WhatsNewState, bA as WhatsNewStore, bB as createChannelSwitcher, bC as createPolicyStore, bD as createReloadGuard, bE as createUpdateChecker, bF as createUpdates, bG as createWhatsNewStore, bH as evaluatePolicy, bI as notesSince, bJ as sanitizePolicy, bK as staticPolicySource, bL as supabasePolicySource, bM as useBlockReload, bN as useCanReload, bO as useForceUpgrade, bP as useMaintenance, bQ as useUpdateBanner, bR as useUpdateCheck, bS as useUpdatePolicy, bT as useUpdateVerdict, bU as useUpdates, bV as useVersionSignature, bW as useWhatsNew, bX as versionSignature } from './blocks-BGpfYSCJ.js';
1
+ export { aT as ApplicationLike, aU as CLOCK_SKEW_MS, aV as ChannelSwitchResult, aW as ChannelSwitcher, aX as ChannelSwitcherOptions, aY as EvaluatePolicyOptions, aZ as ForceUpgradeProps, a_ as ForceUpgradeScreen, a$ as MaintenanceProps, b0 as MaintenanceScreen, b1 as PolicyClientLike, b2 as PolicyOrigin, b3 as PolicyState, b4 as PolicyStore, b5 as PolicyStoreOptions, b6 as ReleaseNote, b7 as ReloadGuard, b8 as SupabasePolicySourceOptions, b9 as UPDATES_BLOCK_ID, ba as UpdateBanner, bb as UpdateBannerProps, bc as UpdateCheckState, bd as UpdateCheckStatus, be as UpdateChecker, bf as UpdateCheckerOptions, bg as UpdatePlatform, bh as UpdatePolicy, bi as UpdatePolicySource, bj as UpdateVerdict, bk as UpdatesAppStateLike, U as UpdatesBlock, bl as UpdatesErrorSource, bm as UpdatesModuleLike, bn as UpdatesOnError, bo as UpdatesOptions, bp as UpdatesProvider, bq as UpdatesRoot, br as UpdatesRootProps, bs as UpdatesSlots, bt as UpdatesStorageLike, V as VersionSignature, bu as VersionSignatureInput, bv as WEEK_MS, bw as WhatsNewOptions, bx as WhatsNewProps, by as WhatsNewSheet, bz as WhatsNewState, bA as WhatsNewStore, bB as createChannelSwitcher, bC as createPolicyStore, bD as createReloadGuard, bE as createUpdateChecker, bF as createUpdates, bG as createWhatsNewStore, bH as evaluatePolicy, bI as notesSince, bJ as sanitizePolicy, bK as staticPolicySource, bL as supabasePolicySource, bM as useBlockReload, bN as useCanReload, bO as useForceUpgrade, bP as useMaintenance, bQ as useUpdateBanner, bR as useUpdateCheck, bS as useUpdatePolicy, bT as useUpdateVerdict, bU as useUpdates, bV as useVersionSignature, bW as useWhatsNew, bX as versionSignature } from './blocks-dppiMmy-.js';
2
2
  import 'react';
3
3
  import '@marktiderman/genesis-core/slots';
4
4
  import '@marktiderman/genesis-features/blocks';
5
- import './query-B4YZBiCs.js';
5
+ import './query--ihYsJWC.js';
6
6
  import '@tanstack/react-query';
7
7
  import '@marktiderman/genesis-design-system';
8
8
  import '@marktiderman/genesis-core/provider';
package/dist/updates.js CHANGED
@@ -7,7 +7,7 @@ import { View } from 'react-native';
7
7
  import { renderSlot } from '@marktiderman/genesis-core/slots';
8
8
  import { defineBlock } from '@marktiderman/genesis-features/blocks';
9
9
  import { SafeAreaView } from 'react-native-safe-area-context';
10
- import { NativeEmptyState, NativeButton, useLiquidGlass, NativeGlassSurface, NativeBanner, NativeSheet, NativeSheetScrollView, NativeText } from '@marktiderman/genesis-ui-native/components';
10
+ import { NativeEmptyState, NativeButton, useLiquidGlass, NativeGlassSurface, NativeBanner, NativeWhatsNewSheet } from '@marktiderman/genesis-ui-native/components';
11
11
  import { jsx, jsxs } from 'react/jsx-runtime';
12
12
 
13
13
  // src/updates/modules.ts
@@ -539,14 +539,14 @@ function UpdateBanner({ reload, dismiss, canReload, blocked, reloading }) {
539
539
  ] }) }) });
540
540
  }
541
541
  function WhatsNewSheet({ notes, dismiss }) {
542
- return /* @__PURE__ */ jsx(NativeSheet, { open: true, onOpenChange: (open) => open ? void 0 : dismiss(), testID: "genesis-whats-new", children: /* @__PURE__ */ jsxs(NativeSheetScrollView, { contentContainerClassName: "gap-4 p-6", children: [
543
- /* @__PURE__ */ jsx(NativeText, { preset: "h3", accessibilityRole: "header", children: "What's new" }),
544
- notes.map((note) => /* @__PURE__ */ jsxs(View, { className: "gap-1", testID: `genesis-whats-new-${note.version}`, children: [
545
- /* @__PURE__ */ jsx(NativeText, { preset: "label", children: note.title ?? `Version ${note.version}` }),
546
- /* @__PURE__ */ jsx(NativeText, { preset: "body-sm", className: "text-muted-foreground", children: note.body })
547
- ] }, note.version)),
548
- /* @__PURE__ */ jsx(NativeButton, { onPress: dismiss, testID: "genesis-whats-new-done", children: "Got it" })
549
- ] }) });
542
+ return /* @__PURE__ */ jsx(
543
+ NativeWhatsNewSheet,
544
+ {
545
+ notes: notes.map((note) => ({ key: note.version, title: note.title ?? `Version ${note.version}`, body: note.body })),
546
+ dismiss,
547
+ testID: "genesis-whats-new"
548
+ }
549
+ );
550
550
  }
551
551
  var UPDATES_BLOCK_ID = "app-updates";
552
552
  function createUpdates(options) {