@marktiderman/genesis-native 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{block-DlGnjjps.d.ts → block-BfJT3F6B.d.ts} +3 -3
- package/dist/{blocks-CF0agqxk.d.ts → blocks-DoY_Z-Lh.d.ts} +21 -4
- package/dist/{chunk-5STOXRTS.js → chunk-6UVWYJPZ.js} +7 -4
- package/dist/chunk-6UVWYJPZ.js.map +1 -0
- package/dist/{chunk-ZQVRCW5J.js → chunk-JWIBRHDE.js} +3 -3
- package/dist/{chunk-ZQVRCW5J.js.map → chunk-JWIBRHDE.js.map} +1 -1
- package/dist/{chunk-YIF4BFQH.js → chunk-JZHDEU4Q.js} +130 -13
- package/dist/chunk-JZHDEU4Q.js.map +1 -0
- package/dist/devtools.d.ts +36 -6
- package/dist/devtools.js +138 -98
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +5 -5
- package/dist/observability.js +3 -3
- package/dist/persist.d.ts +1 -1
- package/dist/push.d.ts +3 -3
- package/dist/{query--ihYsJWC.d.ts → query-DJFrykK_.d.ts} +38 -2
- package/dist/{screen-boundary-B8DlsLwb.d.ts → screen-boundary-Da3qleNz.d.ts} +5 -1
- package/dist/updates.d.ts +2 -2
- package/dist/updates.js +2 -2
- package/package.json +4 -4
- package/src/blocks.tsx +18 -3
- package/src/devtools/block.tsx +244 -144
- package/src/devtools/index.ts +1 -1
- package/src/errors.tsx +144 -13
- package/src/index.ts +4 -0
- package/src/screen-boundary.tsx +13 -2
- package/src/updates/signature.ts +13 -2
- package/dist/chunk-5STOXRTS.js.map +0 -1
- package/dist/chunk-M7S7F6L5.js +0 -49
- package/dist/chunk-M7S7F6L5.js.map +0 -1
- package/dist/chunk-YIF4BFQH.js.map +0 -1
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,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,EAAE,IAAA,EAAM,WAAU,EAAsC;AAClG,EAAA,MAAM,OAAO,oBAAA,CAAqB,IAAA,CAAK,WAAW,IAAA,CAAK,IAAA,EAAM,KAAK,IAAI,CAAA;AACtE,EAAA,MAAM,OAAA,GAAU,OAAO,SAAS,CAAA;AAChC,EAAA,OAAA,CAAQ,OAAA,GAAU,SAAA;AAElB,EAAA,MAAM,eAAA,GAAkB,OAAO,KAAK,CAAA;AACpC,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K;AAAA,IACP,CAAA;AAAA,IACA,cAAc,MAAM,MAAA;AAAA,IACpB,MAAM,IAAI,KAAA,EAAO;AACf,MAAA,IAAI,CAAC,UAAU,MAAM,MAAA;AACrB,MAAA,OAAO,KAAA,EAAM;AAAA,IACf,CAAA;AAAA,IACA,QAAQ,OAAA,EAAS;AACf,MAAA,MAAM,OAAA,GAAU,OAAO,GAAA,EAAa,KAAA,KAAkB;AACpD,QAAA,IAAI,CAAC,QAAA,EAAU,OAAO,cAAA,GAAiB,GAAG,CAAA;AAC1C,QAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,GAAA,EAAK,KAAK,CAAA;AAAA,MACnC,CAAA;AACA,MAAA,MAAM,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 KeyboardStickyProps, 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-config/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 * `KeyboardStickyView` from react-native-keyboard-controller: keeps FormPage's Save / Cancel\n * bar above the keyboard. Needs `keyboardScroll`; without it, the bar ends the scrolling form.\n */\n keyboardSticky?: ComponentType<KeyboardStickyProps>;\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` or `keyboardSticky` 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, keyboardSticky } = 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 || keyboardSticky) && !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} sticky={keyboardSticky}>{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 devtoolsDiagnostics: 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,MA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AAA,EAAa,KAAA,KAAkB;AACpD,QAAA,IAAI,CAAC,QAAA,EAAU,OAAO,cAAA,GAAiB,GAAG,CAAA;AAC1C,QAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,GAAA,EAAK,KAAK,CAAA;AAAA,MACnC,CAAA;AACA,MAAA,MAAM,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 KeyboardStickyProps, 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-config/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 * `KeyboardStickyView` from react-native-keyboard-controller: keeps FormPage's Save / Cancel\n * bar above the keyboard. Needs `keyboardScroll`; without it, the bar ends the scrolling form.\n */\n keyboardSticky?: ComponentType<KeyboardStickyProps>;\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` or `keyboardSticky` 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, keyboardSticky } = 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 || keyboardSticky) && !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} sticky={keyboardSticky}>{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 devtoolsDiagnostics: 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"]}
|
package/dist/observability.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as RouteErrorBoundaryProps, b as ObservabilitySink } from './block-
|
|
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-
|
|
1
|
+
import { a as RouteErrorBoundaryProps, b as ObservabilitySink } from './block-BfJT3F6B.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-BfJT3F6B.js';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
|
-
import { V as VersionSignature } from './blocks-
|
|
5
|
-
export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-
|
|
6
|
-
import './query
|
|
4
|
+
import { V as VersionSignature } from './blocks-DoY_Z-Lh.js';
|
|
5
|
+
export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-Da3qleNz.js';
|
|
6
|
+
import './query-DJFrykK_.js';
|
|
7
7
|
import '@tanstack/react-query';
|
|
8
8
|
import '@marktiderman/genesis-core/slots';
|
|
9
9
|
import '@marktiderman/genesis-config/blocks';
|
package/dist/observability.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { scrubRecord, scrubEvent, scrubString } from './chunk-
|
|
2
|
-
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubValueStrict, scrubbedError, useObservability, useRecentActivity } from './chunk-
|
|
3
|
-
export { ScreenErrorScreen, createScreenErrorBoundary } from './chunk-
|
|
1
|
+
import { scrubRecord, scrubEvent, scrubString } from './chunk-JWIBRHDE.js';
|
|
2
|
+
export { FILTERED, OBSERVABILITY_BLOCK_ID, ObservabilityProvider, checkEvent, consoleSink, createObservability, defineEvents, isSecretKey, observeSink, scrubBreadcrumb, scrubEvent, scrubRecord, scrubString, scrubUrl, scrubValue, scrubValueStrict, scrubbedError, useObservability, useRecentActivity } from './chunk-JWIBRHDE.js';
|
|
3
|
+
export { ScreenErrorScreen, createScreenErrorBoundary } from './chunk-JZHDEU4Q.js';
|
|
4
4
|
import './chunk-VIC2KXMA.js';
|
|
5
5
|
import './chunk-NGYNYJPL.js';
|
|
6
6
|
|
package/dist/persist.d.ts
CHANGED
package/dist/push.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Y as PushPermissionStatus, Z as NotificationResponseLike, _ as NotificationLike, p as LinkOptions, $ as QuietHours } from './blocks-
|
|
2
|
-
export { a0 as ChannelImportance, a1 as ChannelInputLike, a2 as DEFAULT_PREFERENCES, a3 as NotificationActionLike, a4 as NotificationBehaviorLike, a5 as NotificationCategory, a6 as NotificationPreferences, a7 as NotificationsModuleLike, a8 as PermissionRequestLike, a9 as PermissionState, aa as PermissionStatusLike, ab as PermissionStore, ac as PreferencesState, ad as PreferencesStatus, ae as PreferencesStore, af as PromptOptions, ag as PromptState, ah as PromptStore, ai as PushAppStateLike, aj as PushBackend, ak as PushBackendError, al as PushBlock, am as PushChannel, an as PushDeviceCategory, ao as PushErrorSource, ap as PushOnError, aq as PushOptions, ar as PushPromptProps, as as PushPromptSheet, at as PushProvider, au as PushRoot, av as PushRootProps, aw as PushSlots, ax as PushStorageLike, ay as PushSupabaseLike, az as Registration, aA as RegistrationState, aB as RegistrationStatus, aC as SubscriptionLike, aD as canPush, aE as createPermissionStore, aF as createPreferencesStore, aG as createPromptStore, aH as createPush, aI as createRegistration, aJ as statusOf, aK as supabasePushBackend, aL as useBadge, aM as useNotificationPreferences, aN as useOptionalPush, aO as usePush, aP as usePushPermissionState, aQ as usePushPrompt, aR as usePushRegistration, aS as useSuppressNotifications, aT as validPreferences } from './blocks-
|
|
1
|
+
import { Y as PushPermissionStatus, Z as NotificationResponseLike, _ as NotificationLike, p as LinkOptions, $ as QuietHours } from './blocks-DoY_Z-Lh.js';
|
|
2
|
+
export { a0 as ChannelImportance, a1 as ChannelInputLike, a2 as DEFAULT_PREFERENCES, a3 as NotificationActionLike, a4 as NotificationBehaviorLike, a5 as NotificationCategory, a6 as NotificationPreferences, a7 as NotificationsModuleLike, a8 as PermissionRequestLike, a9 as PermissionState, aa as PermissionStatusLike, ab as PermissionStore, ac as PreferencesState, ad as PreferencesStatus, ae as PreferencesStore, af as PromptOptions, ag as PromptState, ah as PromptStore, ai as PushAppStateLike, aj as PushBackend, ak as PushBackendError, al as PushBlock, am as PushChannel, an as PushDeviceCategory, ao as PushErrorSource, ap as PushOnError, aq as PushOptions, ar as PushPromptProps, as as PushPromptSheet, at as PushProvider, au as PushRoot, av as PushRootProps, aw as PushSlots, ax as PushStorageLike, ay as PushSupabaseLike, az as Registration, aA as RegistrationState, aB as RegistrationStatus, aC as SubscriptionLike, aD as canPush, aE as createPermissionStore, aF as createPreferencesStore, aG as createPromptStore, aH as createPush, aI as createRegistration, aJ as statusOf, aK as supabasePushBackend, aL as useBadge, aM as useNotificationPreferences, aN as useOptionalPush, aO as usePush, aP as usePushPermissionState, aQ as usePushPrompt, aR as usePushRegistration, aS as useSuppressNotifications, aT as validPreferences } from './blocks-DoY_Z-Lh.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-config/blocks';
|
|
9
|
-
import './query
|
|
9
|
+
import './query-DJFrykK_.js';
|
|
10
10
|
import '@tanstack/react-query';
|
|
11
11
|
import '@marktiderman/genesis-design-system';
|
|
12
12
|
import '@marktiderman/genesis-core/provider';
|
|
@@ -27,12 +27,48 @@ interface FatalScreenViewProps {
|
|
|
27
27
|
* could not start, or when the `fatal` slot threw.
|
|
28
28
|
*/
|
|
29
29
|
kind?: FatalScreenKind;
|
|
30
|
+
/**
|
|
31
|
+
* Where people can write when the app can't help (support's `contactEmail` / `contactUrl`
|
|
32
|
+
* settings: `support.contact()`): a "Contact support" button under "Try again". Left out, none.
|
|
33
|
+
*/
|
|
34
|
+
contact?: FatalScreenContact | null;
|
|
35
|
+
/**
|
|
36
|
+
* "Report this": opens the support block's feedback form with the error attached. Left out, the
|
|
37
|
+
* block's (when the support block is on and feedback with it); `null` for none.
|
|
38
|
+
*/
|
|
39
|
+
onReport?: ((error: Error, where: {
|
|
40
|
+
kind: "app" | "screen";
|
|
41
|
+
}) => void) | null;
|
|
42
|
+
/** The screen's words, in English by default. */
|
|
43
|
+
labels?: Partial<FatalScreenLabels>;
|
|
44
|
+
}
|
|
45
|
+
/** The fatal and screen error screens' words. */
|
|
46
|
+
interface FatalScreenLabels {
|
|
47
|
+
/** The app's fatal screen. */
|
|
48
|
+
title: string;
|
|
49
|
+
body: string;
|
|
50
|
+
/** One screen failed. */
|
|
51
|
+
screenTitle: string;
|
|
52
|
+
screenBody: string;
|
|
53
|
+
/** The plain screen's line when the error has nothing safe to say. */
|
|
54
|
+
plainBody: string;
|
|
55
|
+
retry: string;
|
|
56
|
+
contact: string;
|
|
57
|
+
report: string;
|
|
58
|
+
}
|
|
59
|
+
declare const DEFAULT_FATAL_SCREEN_LABELS: FatalScreenLabels;
|
|
60
|
+
/** A support contact for the fatal screens: an email address, a support page, or both. */
|
|
61
|
+
interface FatalScreenContact {
|
|
62
|
+
email?: string | null;
|
|
63
|
+
url?: string | null;
|
|
30
64
|
}
|
|
65
|
+
/** The link a contact opens: the support page, else a mailto. Null with neither (or one that isn't safe). */
|
|
66
|
+
declare function contactHref(contact: FatalScreenContact | null | undefined): string | null;
|
|
31
67
|
/**
|
|
32
68
|
* The fatal screen: what went wrong and "Try again", for the whole app, one screen, or (with
|
|
33
69
|
* `kind="plain"`) the last resort that needs nothing above it.
|
|
34
70
|
*/
|
|
35
|
-
declare function FatalScreen({ error, retry, kind }: FatalScreenViewProps): react.JSX.Element;
|
|
71
|
+
declare function FatalScreen({ error, retry, kind, contact, onReport, labels: given }: FatalScreenViewProps): react.JSX.Element;
|
|
36
72
|
/**
|
|
37
73
|
* The last-resort fatal screen.
|
|
38
74
|
*
|
|
@@ -227,4 +263,4 @@ declare function queryKeyName(key: readonly unknown[] | undefined): string | und
|
|
|
227
263
|
*/
|
|
228
264
|
declare function reportQueryErrors(client: QueryClient, report: QueryErrorReporter, options?: ReportQueryErrorsOptions): () => void;
|
|
229
265
|
|
|
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
|
|
266
|
+
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, DEFAULT_FATAL_SCREEN_LABELS as b, type ErrorReport as c, type ErrorUtilsLike as d, type FatalScreenContact as e, type FatalScreenKind as f, type FatalScreenLabels as g, type FatalScreenProps as h, type FatalScreenViewProps as i, type GenesisErrorBoundaryProps as j, type GlobalErrorHandlerOptions as k, type QueryLifecycleOptions as l, type QueryPersistence as m, connectQueryLifecycle as n, contactHref as o, createNativeQueryClient as p, defaultErrorUtils as q, defaultRejectionTracker as r, errorDetails as s, installGlobalErrorHandler as t, installRejectionTracker as u, queryKeyName as v, reportQueryErrors as w };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { O as OnError } from './query
|
|
3
|
+
import { O as OnError, e as FatalScreenContact, g as FatalScreenLabels } from './query-DJFrykK_.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 {
|
|
@@ -20,6 +20,10 @@ interface ScreenErrorBoundaryOptions {
|
|
|
20
20
|
onError?: OnError;
|
|
21
21
|
/** Wrappers around the route boundary, innermost first (Sentry's `wrapExpoRouterErrorBoundary`). */
|
|
22
22
|
wrap?: readonly ((boundary: ComponentType<ScreenErrorProps>) => ComponentType<ScreenErrorProps>)[];
|
|
23
|
+
/** "Contact support" on the default fallback (support's `support.contact()`), read when it shows. */
|
|
24
|
+
contact?: FatalScreenContact | (() => FatalScreenContact | null) | null;
|
|
25
|
+
/** The default fallback's words ("Contact support", "Report this"…), in English by default. */
|
|
26
|
+
labels?: Partial<FatalScreenLabels>;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* An Expo Router `ErrorBoundary`: reports each error once (non-fatal, source
|
package/dist/updates.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { aU as ApplicationLike, aV as BuildMetadata, aW as CLOCK_SKEW_MS, aX as ChannelSwitchResult, aY as ChannelSwitcher, aZ as ChannelSwitcherOptions, a_ as EvaluatePolicyOptions, a$ as ForceUpgradeProps, b0 as ForceUpgradeScreen, b1 as MaintenanceProps, b2 as MaintenanceScreen, b3 as PolicyClientLike, b4 as PolicyOrigin, b5 as PolicyState, b6 as PolicyStore, b7 as PolicyStoreOptions, b8 as ReleaseNote, b9 as ReloadGuard, ba as SupabasePolicySourceOptions, bb as UPDATES_BLOCK_ID, bc as UpdateBanner, bd as UpdateBannerProps, be as UpdateCheckState, bf as UpdateCheckStatus, bg as UpdateChecker, bh as UpdateCheckerOptions, bi as UpdatePlatform, bj as UpdatePolicy, bk as UpdatePolicySource, bl as UpdateVerdict, bm as UpdatesAppStateLike, U as UpdatesBlock, bn as UpdatesErrorSource, bo as UpdatesModuleLike, bp as UpdatesOnError, bq as UpdatesOptions, br as UpdatesProvider, bs as UpdatesRoot, bt as UpdatesRootProps, bu as UpdatesSlots, bv as UpdatesStorageLike, V as VersionSignature, bw as VersionSignatureInput, bx as WEEK_MS, by as WhatsNewOptions, bz as WhatsNewProps, bA as WhatsNewSheet, bB as WhatsNewState, bC as WhatsNewStore, bD as createChannelSwitcher, bE as createPolicyStore, bF as createReloadGuard, bG as createUpdateChecker, bH as createUpdates, bI as createWhatsNewStore, bJ as evaluatePolicy, bK as notesSince, bL as sanitizePolicy, bM as staticPolicySource, bN as supabasePolicySource, bO as useBlockReload, bP as useCanReload, bQ as useForceUpgrade, bR as useMaintenance, bS as useUpdateBanner, bT as useUpdateCheck, bU as useUpdatePolicy, bV as useUpdateVerdict, bW as useUpdates, bX as useVersionSignature, bY as useWhatsNew, bZ as versionSignature } from './blocks-
|
|
1
|
+
export { aU as ApplicationLike, aV as BuildMetadata, aW as CLOCK_SKEW_MS, aX as ChannelSwitchResult, aY as ChannelSwitcher, aZ as ChannelSwitcherOptions, a_ as EvaluatePolicyOptions, a$ as ForceUpgradeProps, b0 as ForceUpgradeScreen, b1 as MaintenanceProps, b2 as MaintenanceScreen, b3 as PolicyClientLike, b4 as PolicyOrigin, b5 as PolicyState, b6 as PolicyStore, b7 as PolicyStoreOptions, b8 as ReleaseNote, b9 as ReloadGuard, ba as SupabasePolicySourceOptions, bb as UPDATES_BLOCK_ID, bc as UpdateBanner, bd as UpdateBannerProps, be as UpdateCheckState, bf as UpdateCheckStatus, bg as UpdateChecker, bh as UpdateCheckerOptions, bi as UpdatePlatform, bj as UpdatePolicy, bk as UpdatePolicySource, bl as UpdateVerdict, bm as UpdatesAppStateLike, U as UpdatesBlock, bn as UpdatesErrorSource, bo as UpdatesModuleLike, bp as UpdatesOnError, bq as UpdatesOptions, br as UpdatesProvider, bs as UpdatesRoot, bt as UpdatesRootProps, bu as UpdatesSlots, bv as UpdatesStorageLike, V as VersionSignature, bw as VersionSignatureInput, bx as WEEK_MS, by as WhatsNewOptions, bz as WhatsNewProps, bA as WhatsNewSheet, bB as WhatsNewState, bC as WhatsNewStore, bD as createChannelSwitcher, bE as createPolicyStore, bF as createReloadGuard, bG as createUpdateChecker, bH as createUpdates, bI as createWhatsNewStore, bJ as evaluatePolicy, bK as notesSince, bL as sanitizePolicy, bM as staticPolicySource, bN as supabasePolicySource, bO as useBlockReload, bP as useCanReload, bQ as useForceUpgrade, bR as useMaintenance, bS as useUpdateBanner, bT as useUpdateCheck, bU as useUpdatePolicy, bV as useUpdateVerdict, bW as useUpdates, bX as useVersionSignature, bY as useWhatsNew, bZ as versionSignature } from './blocks-DoY_Z-Lh.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@marktiderman/genesis-core/slots';
|
|
4
4
|
import '@marktiderman/genesis-config/blocks';
|
|
5
|
-
import './query
|
|
5
|
+
import './query-DJFrykK_.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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { versionSignature } from './chunk-
|
|
2
|
-
export { versionSignature } from './chunk-
|
|
1
|
+
import { versionSignature } from './chunk-6UVWYJPZ.js';
|
|
2
|
+
export { versionSignature } from './chunk-6UVWYJPZ.js';
|
|
3
3
|
import { createStore, delay } from './chunk-XE7LC7K6.js';
|
|
4
4
|
import { runBeforeReload } from './chunk-VIC2KXMA.js';
|
|
5
5
|
import { createContext, useContext, useEffect, useSyncExternalStore, useMemo, useState } from 'react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marktiderman/genesis-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"README.md"
|
|
108
108
|
],
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@marktiderman/genesis-config": "^0.
|
|
110
|
+
"@marktiderman/genesis-config": "^0.12.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@marktiderman/genesis-core": ">=2.11.0 <3.0.0",
|
|
@@ -152,9 +152,9 @@
|
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
|
-
"@marktiderman/genesis-core": "^2.
|
|
155
|
+
"@marktiderman/genesis-core": "^2.20.0",
|
|
156
156
|
"@marktiderman/genesis-design-system": "^1.13.0",
|
|
157
|
-
"@marktiderman/genesis-ui-native": "^3.
|
|
157
|
+
"@marktiderman/genesis-ui-native": "^3.15.0",
|
|
158
158
|
"@supabase/supabase-js": "^2.118.0",
|
|
159
159
|
"@tanstack/query-async-storage-persister": "5.107.1",
|
|
160
160
|
"@tanstack/query-persist-client-core": "5.107.1",
|
package/src/blocks.tsx
CHANGED
|
@@ -37,6 +37,12 @@ export interface NativeBlock<Id extends string = string> extends BlockDef<Id, Co
|
|
|
37
37
|
* throw is ignored.
|
|
38
38
|
*/
|
|
39
39
|
readonly onError?: (error: Error, report: ErrorReport) => void;
|
|
40
|
+
/**
|
|
41
|
+
* "Report this" on the fatal and screen error screens: the support block opens its feedback form
|
|
42
|
+
* with the error attached. `app`: the app's screens were replaced by the fatal screen, and are
|
|
43
|
+
* remounting ("Try again") as this is called.
|
|
44
|
+
*/
|
|
45
|
+
readonly reportProblem?: (error: Error, where: { kind: "app" | "screen" }) => void;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/** @internal Hand an error to each block's `onError`; one that throws never stops the rest. */
|
|
@@ -56,6 +62,11 @@ const BlocksContext = createContext<ResolvedBlocks<NativeBlock> | null>(null);
|
|
|
56
62
|
/** @internal Provided by GenesisNativeApp. */
|
|
57
63
|
export const BlocksProvider = BlocksContext.Provider;
|
|
58
64
|
|
|
65
|
+
/** @internal The resolved blocks, or null outside GenesisNativeApp (an error screen must never throw for want of them). */
|
|
66
|
+
export function useOptionalBlocks(): ResolvedBlocks<NativeBlock> | null {
|
|
67
|
+
return useContext(BlocksContext);
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
/**
|
|
60
71
|
* The resolved blocks: their ids, nav entries, Settings rows, routes and the
|
|
61
72
|
* rest, each tagged with its FeatureId. Throws outside `GenesisNativeApp`.
|
|
@@ -99,7 +110,8 @@ export interface UseBlockSettingsOptions {
|
|
|
99
110
|
* at the end of the section its `section` names (by `order`, then block
|
|
100
111
|
* order), and a section no one has yet is added after the rest.
|
|
101
112
|
*
|
|
102
|
-
*
|
|
113
|
+
* A row whose `useShown` hook says false is left out. Calls each row's `useSubtitle` and
|
|
114
|
+
* `useShown` hooks, so call it unconditionally at the top
|
|
103
115
|
* of the Settings screen. The blocks are fixed for the life of the app, so
|
|
104
116
|
* the hooks run in the same order on every render.
|
|
105
117
|
*
|
|
@@ -113,18 +125,21 @@ export function useBlockSettings<R extends SettingsRowLike>(
|
|
|
113
125
|
const rows = blocks?.settings ?? [];
|
|
114
126
|
// The same hooks in the same order every render: `rows` never changes once the shell has resolved it.
|
|
115
127
|
const subtitles = rows.map((row) => row.useSubtitle?.());
|
|
116
|
-
|
|
128
|
+
const shown = rows.map((row) => row.useShown?.() ?? true);
|
|
129
|
+
return mergeBlockSettings(sections, rows, subtitles, options, shown);
|
|
117
130
|
}
|
|
118
131
|
|
|
119
|
-
/** The merge `useBlockSettings` does, without hooks (subtitles already read). @stability Beta */
|
|
132
|
+
/** The merge `useBlockSettings` does, without hooks (subtitles and `shown` already read; a row shown false is left out). @stability Beta */
|
|
120
133
|
export function mergeBlockSettings<R extends SettingsRowLike>(
|
|
121
134
|
sections: readonly BlockSettingsSection<R>[],
|
|
122
135
|
rows: readonly Contributed<BlockSettingsRow>[],
|
|
123
136
|
subtitles: readonly (string | null | undefined)[] = [],
|
|
124
137
|
options: UseBlockSettingsOptions = {},
|
|
138
|
+
shown: readonly boolean[] = [],
|
|
125
139
|
): BlockSettingsSection<R | SettingsRowLike>[] {
|
|
126
140
|
const out: BlockSettingsSection<R | SettingsRowLike>[] = sections.map((s) => ({ ...s, rows: [...s.rows] }));
|
|
127
141
|
rows.forEach((row, i) => {
|
|
142
|
+
if (shown[i] === false) return;
|
|
128
143
|
let section = out.find((s) => s.id === row.section);
|
|
129
144
|
if (!section) {
|
|
130
145
|
section = { id: row.section, title: options.sectionTitles?.[row.section] ?? row.section, rows: [] };
|