@marktiderman/genesis-native 0.10.0 → 0.11.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 +3 -2
- package/dist/{block-CQz1pOnm.d.ts → block-Iga-mCeC.d.ts} +1 -1
- package/dist/{blocks-dppiMmy-.d.ts → blocks-BQY_df3j.d.ts} +6 -1
- package/dist/devtools.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +3 -3
- package/dist/push.d.ts +2 -2
- package/dist/updates.d.ts +1 -1
- package/package.json +5 -5
- package/src/app.tsx +10 -5
package/README.md
CHANGED
|
@@ -66,8 +66,9 @@ From the outside in:
|
|
|
66
66
|
development, `keyboardScroll` without `keyboardProvider` logs an error.
|
|
67
67
|
`keyboardToolbar` (`KeyboardToolbar`) adds the previous / next / done bar
|
|
68
68
|
above the keyboard on Genesis's form layouts (`AuthScreen`,
|
|
69
|
-
`SettingsSubPage`); it needs `keyboardScroll`, and logs an error in
|
|
70
|
-
development without it.
|
|
69
|
+
`SettingsSubPage`, `FormPage`); it needs `keyboardScroll`, and logs an error in
|
|
70
|
+
development without it. `keyboardSticky` (`KeyboardStickyView`) keeps
|
|
71
|
+
`FormPage`'s Save / Cancel bar above the keyboard; it needs `keyboardScroll` too.
|
|
71
72
|
Then `modules`, the optional native modules your app installed
|
|
72
73
|
(`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`: FlashList,
|
|
73
74
|
expo-image, Reanimated, expo-glass-effect, expo-symbols, a lucide icon
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentType, ReactNode } from 'react';
|
|
3
3
|
import { c as ScreenErrorProps } from './screen-boundary-B8DlsLwb.js';
|
|
4
|
-
import { N as NativeBlock, r as NativeBlockRootProps } from './blocks-
|
|
4
|
+
import { N as NativeBlock, r as NativeBlockRootProps } from './blocks-BQY_df3j.js';
|
|
5
5
|
import { b as ErrorReport } from './query--ihYsJWC.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -6,7 +6,7 @@ import { e as FatalScreenProps, g as GenesisErrorBoundaryProps, j as QueryPersis
|
|
|
6
6
|
import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
7
7
|
import { CanonicalBrand } from '@marktiderman/genesis-design-system';
|
|
8
8
|
import { SupabaseClientInput, DataProvider } from '@marktiderman/genesis-core/provider';
|
|
9
|
-
import { KeyboardScrollProps, KeyboardToolbarProps } from '@marktiderman/genesis-ui-native/layouts';
|
|
9
|
+
import { KeyboardScrollProps, KeyboardToolbarProps, KeyboardStickyProps } from '@marktiderman/genesis-ui-native/layouts';
|
|
10
10
|
import { GenesisNavigationTheme, GenesisModules, NativeSheetLibrary, NativeToastProviderProps } from '@marktiderman/genesis-ui-native/components';
|
|
11
11
|
|
|
12
12
|
interface BootStepContext {
|
|
@@ -1376,6 +1376,11 @@ interface GenesisNativeAppProps {
|
|
|
1376
1376
|
* (and so `keyboardProvider`); without them it is ignored.
|
|
1377
1377
|
*/
|
|
1378
1378
|
keyboardToolbar?: ComponentType<KeyboardToolbarProps>;
|
|
1379
|
+
/**
|
|
1380
|
+
* `KeyboardStickyView` from react-native-keyboard-controller: keeps FormPage's Save / Cancel
|
|
1381
|
+
* bar above the keyboard. Needs `keyboardScroll`; without it, the bar ends the scrolling form.
|
|
1382
|
+
*/
|
|
1383
|
+
keyboardSticky?: ComponentType<KeyboardStickyProps>;
|
|
1379
1384
|
/**
|
|
1380
1385
|
* The optional native modules the app installed, for Genesis components to
|
|
1381
1386
|
* use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):
|
package/dist/devtools.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as NativeBlock, U as UpdatesBlock, V as VersionSignature } from './blocks-
|
|
2
|
-
export { D as DevtoolsFeedbackProps, a as DevtoolsSlots } from './blocks-
|
|
3
|
-
import { O as ObservabilityBlock, R as RecentActivity } from './block-
|
|
1
|
+
import { N as NativeBlock, U as UpdatesBlock, V as VersionSignature } from './blocks-BQY_df3j.js';
|
|
2
|
+
export { D as DevtoolsFeedbackProps, a as DevtoolsSlots } from './blocks-BQY_df3j.js';
|
|
3
|
+
import { O as ObservabilityBlock, R as RecentActivity } from './block-Iga-mCeC.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@marktiderman/genesis-core/slots';
|
|
6
6
|
import '@marktiderman/genesis-features/blocks';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AuthClientLike, b as AuthGate, c as AuthGateProps, B as BlockSettingsSection, d as BootController, e as BootOptions, f as BootProvider, g as BootScreen, h as BootScreenProps, i as BootState, j as BootStatus, k as BootStep, l as BootStepContext, m as BootTimeoutError, G as GenesisNativeApp, n as GenesisNativeAppProps, H as HeldLinkAuth, L as LinkHold, o as LinkOptions, p as LinkTarget, q as NativeAppSlots, N as NativeBlock, r as NativeBlockRootProps, s as NativeQueryClientOptions, S as SessionProvider, t as SessionState, u as SessionStatus, v as SessionStore, w as SessionStoreOptions, x as SettingsRowLike, y as SignedOutProps, z as SplashModule, C as UseBlockSettingsOptions, E as UseBootReturn, F as UseHeldLinkOptions, I as createBoot, J as createLinkHold, K as createSessionStore, M as mergeBlockSettings, O as normalizeLink, P as useBlockSettings, Q as useBlocks, R as useBoot, T as useHeldLink, W as useSession } from './blocks-
|
|
1
|
+
export { A as AuthClientLike, b as AuthGate, c as AuthGateProps, B as BlockSettingsSection, d as BootController, e as BootOptions, f as BootProvider, g as BootScreen, h as BootScreenProps, i as BootState, j as BootStatus, k as BootStep, l as BootStepContext, m as BootTimeoutError, G as GenesisNativeApp, n as GenesisNativeAppProps, H as HeldLinkAuth, L as LinkHold, o as LinkOptions, p as LinkTarget, q as NativeAppSlots, N as NativeBlock, r as NativeBlockRootProps, s as NativeQueryClientOptions, S as SessionProvider, t as SessionState, u as SessionStatus, v as SessionStore, w as SessionStoreOptions, x as SettingsRowLike, y as SignedOutProps, z as SplashModule, C as UseBlockSettingsOptions, E as UseBootReturn, F as UseHeldLinkOptions, I as createBoot, J as createLinkHold, K as createSessionStore, M as mergeBlockSettings, O as normalizeLink, P as useBlockSettings, Q as useBlocks, R as useBoot, T as useHeldLink, W as useSession } from './blocks-BQY_df3j.js';
|
|
2
2
|
import { A as AsyncStorageLike } from './query--ihYsJWC.js';
|
|
3
3
|
export { a as AppStateLike, D as DAY_MS, E as EnableRejectionTracker, b as ErrorReport, c as ErrorUtilsLike, F as FatalScreen, d as FatalScreenKind, e as FatalScreenProps, f as FatalScreenViewProps, G as GenesisErrorBoundary, g as GenesisErrorBoundaryProps, h as GlobalErrorHandlerOptions, N as NetInfoLike, O as OnError, P as PlainFatalScreen, Q as QueryErrorReporter, i as QueryLifecycleOptions, j as QueryPersistence, R as ReportQueryErrorsOptions, k as connectQueryLifecycle, l as createNativeQueryClient, m as defaultErrorUtils, n as defaultRejectionTracker, o as errorDetails, p as installGlobalErrorHandler, q as installRejectionTracker, r as queryKeyName, s as reportQueryErrors } from './query--ihYsJWC.js';
|
|
4
4
|
export { S as ScreenErrorBoundary, a as ScreenErrorBoundaryOptions, b as ScreenErrorBoundaryProps, c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-B8DlsLwb.js';
|
package/dist/index.js
CHANGED
|
@@ -96,14 +96,14 @@ function GenesisNativeApp(props) {
|
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
var MISSING_KEYBOARD_PROVIDER = 'GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won\'t move above the keyboard. Pass `keyboardProvider={KeyboardProvider}` from "react-native-keyboard-controller" too.';
|
|
99
|
-
var TOOLBAR_WITHOUT_SCROLL = 'GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from "react-native-keyboard-controller" too.';
|
|
99
|
+
var TOOLBAR_WITHOUT_SCROLL = 'GenesisNativeApp: `keyboardToolbar` or `keyboardSticky` was given without `keyboardScroll`, so it is ignored. Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from "react-native-keyboard-controller" too.';
|
|
100
100
|
function ThemedShell(props) {
|
|
101
|
-
const { brand, keyboardScroll, keyboardToolbar } = props;
|
|
101
|
+
const { brand, keyboardScroll, keyboardToolbar, keyboardSticky } = props;
|
|
102
102
|
const [Keyboard] = useState(() => props.keyboardProvider);
|
|
103
103
|
const [modules] = useState(() => props.modules);
|
|
104
104
|
const [toast] = useState(() => props.toast === null ? null : { position: "top", ...props.toast });
|
|
105
105
|
const missingProvider = Boolean(keyboardScroll) && !Keyboard;
|
|
106
|
-
const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;
|
|
106
|
+
const toolbarWithoutScroll = Boolean(keyboardToolbar || keyboardSticky) && !keyboardScroll;
|
|
107
107
|
useEffect(() => {
|
|
108
108
|
if (typeof __DEV__ === "undefined" || !__DEV__) return;
|
|
109
109
|
if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);
|
|
@@ -112,7 +112,7 @@ function ThemedShell(props) {
|
|
|
112
112
|
let body = /* @__PURE__ */ jsx(Shell, { ...props });
|
|
113
113
|
if (toast) body = /* @__PURE__ */ jsx(NativeToastProvider, { ...toast, children: body });
|
|
114
114
|
if (modules) body = /* @__PURE__ */ jsx(GenesisModulesProvider, { modules, children: body });
|
|
115
|
-
if (keyboardScroll) body = /* @__PURE__ */ jsx(KeyboardScrollProvider, { component: keyboardScroll, toolbar: keyboardToolbar, children: body });
|
|
115
|
+
if (keyboardScroll) body = /* @__PURE__ */ jsx(KeyboardScrollProvider, { component: keyboardScroll, toolbar: keyboardToolbar, sticky: keyboardSticky, children: body });
|
|
116
116
|
if (Keyboard) body = /* @__PURE__ */ jsx(Keyboard, { children: body });
|
|
117
117
|
if (modules?.navigation && props.navigationTheme !== false) {
|
|
118
118
|
body = /* @__PURE__ */ jsx(NavigationTheme, { module: modules.navigation, brand, brandVariables: props.brandVariables, given: props.navigationTheme, children: body });
|
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,KAA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AA,IAAI,QAAA,EAAU;AACd,MAAA,QAAA,GAAW,IAAA;AACX,MAAA,IAAA,EAAK;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 KeyboardToolbarProps } from \"@marktiderman/genesis-ui-native/layouts\";\nimport {\n GenesisModulesProvider,\n NativeSheetProvider,\n NativeToastProvider,\n type GenesisModules,\n type GenesisNavigationModule,\n type GenesisNavigationTheme,\n type NativeSheetLibrary,\n type NativeToastProviderProps,\n} from \"@marktiderman/genesis-ui-native/components\";\nimport { BootProvider, createBoot, type BootOptions, type BootStatus, type BootStep } from \"./boot\";\nimport {\n FatalScreen,\n GenesisErrorBoundary,\n defaultErrorUtils,\n defaultRejectionTracker,\n installGlobalErrorHandler,\n installRejectionTracker,\n type EnableRejectionTracker,\n type ErrorUtilsLike,\n type FatalScreenProps,\n type GenesisErrorBoundaryProps,\n type OnError,\n} from \"./errors\";\nimport { SessionProvider, createSessionStore, type AuthClientLike } from \"./auth\";\nimport { useHeldLink, type HeldLinkAuth, type LinkHold } from \"./held-link\";\nimport { connectQueryLifecycle, createNativeQueryClient, reportQueryErrors, type QueryLifecycleOptions, type QueryPersistence } from \"./query\";\nimport { resolveBlocks } from \"@marktiderman/genesis-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Keep reads on the phone: `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })`\n * from `@marktiderman/genesis-native/offline`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /**\n * Theme role variables (`--primary`, `--background`, …) to set on a view\n * around the app, over what the app's stylesheet declares on `:root`.\n * Default `false`: none are set, so the app's own variables (from\n * `createGenesisNativewindPreset({ brand })` or its brand package) stand.\n * `true` sets `brandRoleVariables(brand)` for the current mode; an object\n * sets the app's own, one map for both modes or `{ light, dark }`.\n */\n brandVariables?: boolean | Record<string, string> | { light: Record<string, string>; dark: Record<string, string> };\n /**\n * React Navigation's theme (headers, tab bars, the screen background), when\n * `modules.navigation` is given. Default: worked out from the same role\n * variables as `brandVariables` (the app's own when it passes them,\n * `brandRoleVariables(brand)` otherwise), for the current mode, so a header\n * is never light in dark mode. Pass a theme (or `{ light, dark }`) to use\n * your own, or `false` to set none.\n */\n navigationTheme?: false | GenesisNavigationTheme | { light: GenesisNavigationTheme; dark: GenesisNavigationTheme };\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * The optional native modules the app installed, for Genesis components to\n * use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):\n * FlashList, expo-image, Reanimated, expo-glass-effect, expo-symbols, a\n * lucide icon set, the @expo/ui date picker. Each one left out falls back\n * to plain React Native. Read once.\n */\n modules?: GenesisModules;\n /**\n * `@gorhom/bottom-sheet` v5, to opt every `NativeSheet` into it (snap\n * points, drag between heights): `import * as BottomSheet from \"@gorhom/bottom-sheet\"`,\n * then `bottomSheet={BottomSheet}`. The app mounts `NativeSheetProvider`\n * (and so the library's `BottomSheetModalProvider`) for you; the app's root\n * must still be inside gesture-handler's `GestureHandlerRootView`, with\n * Reanimated set up. Leave it out and sheets are React Native's own modal\n * (an iOS page sheet), which needs neither. Read once.\n */\n bottomSheet?: NativeSheetLibrary;\n /**\n * Toasts (`useToast()` from `@marktiderman/genesis-ui-native`): `NativeToastProvider` is\n * mounted around the screens, at the top of the screen by default (a bottom toast would sit on\n * a tab bar). Pass its options to place it, or `null` to mount your own. Read once.\n */\n toast?: Pick<NativeToastProviderProps, \"position\" | \"disableAnimation\"> | null;\n /** Follow a link held while signed out, once the user signs in. */\n links?: { hold: LinkHold; onRelease: (path: string) => void };\n /** Run before first render, in order (wipe-on-reinstall, hydrate stores, fonts). Read once. */\n steps?: readonly BootStep[];\n bootOptions?: BootOptions;\n /** Longest wait for Supabase's `getSession()` before using the stored session (offline). Default 5000 ms. */\n sessionWaitMs?: number;\n /** Default `globalThis.ErrorUtils`. */\n errorUtils?: ErrorUtilsLike;\n /** Report unhandled promise rejections to `onError`. Default Hermes's tracker; `null` turns it off. */\n rejectionTracker?: EnableRejectionTracker | null;\n /** `AppState` and NetInfo, so queries refetch on focus and know the network. */\n lifecycle?: QueryLifecycleOptions;\n /**\n * Report queries and mutations that failed for good to `onError` (and so\n * to the observability block), non-fatal, as `query` / `mutation` with the\n * key's first segment as a tag. Only unexpected errors: offline, signed\n * out, not found and the server's expected refusals are left to the\n * screen. One query opts out with `meta: { reportErrors: false }`.\n * Default true. Read once.\n */\n reportQueryErrors?: boolean;\n /**\n * Every caught error, after the blocks' own `onError` (the observability\n * block, `createObservability` from `/observability`, reports to Sentry\n * there). A throwing reporter is ignored.\n */\n onError?: OnError;\n /** After a signed-in user signs out, once the query cache is cleared. */\n onSignedOut?: () => void;\n /**\n * The updates block: `createUpdates(…)` from `@marktiderman/genesis-native/updates`\n * (force upgrade, maintenance, the update banner, what's new). Its policy\n * loads behind the splash for at most `policyTimeoutMs` and never fails the\n * boot. Read once; leave it out to turn the block off.\n */\n updates?: UpdatesBlock;\n /**\n * Blocks to run (`createUpdates(…)` is one). Resolved once at start: a\n * block whose requirement is missing, or two blocks contributing the same\n * slot, nav entry or Settings row, shows the fatal screen and reports a\n * `BlockError` to `onError`. Read once.\n */\n blocks?: readonly NativeBlock[];\n /**\n * Your features (FeatureIds) that blocks may require but that aren't\n * blocks. A block requiring anything that is neither one of `blocks` nor\n * listed here is a `BlockError`. Read once.\n */\n appFeatures?: readonly string[];\n slots?: Slots<NativeAppSlots>;\n slotProps?: SlotPropsFor<NativeAppSlots>;\n children?: ReactNode;\n}\n\n/** The default boot slot: a plain loading view (the splash covers it at launch). */\nexport function BootScreen(_props: BootScreenProps) {\n return (\n <View testID=\"genesis-boot\" accessibilityRole=\"progressbar\" style={{ flex: 1, justifyContent: \"center\", alignItems: \"center\" }}>\n <Text>Loading…</Text>\n </View>\n );\n}\n\nconst PassThrough: ComponentType<SignedOutProps> = ({ children }) => <>{children}</>;\n/** The last-resort fallback: nothing above it has to work. */\nconst PlainFallback = (props: FatalScreenProps) => <FatalScreen {...props} kind=\"plain\" />;\n\n// The web provider's types don't list the native-only prop; Metro resolves the native provider.\nconst ThemeProvider = GenesisThemeProvider as ComponentType<{\n brand: CanonicalBrand;\n syncNativeAppearance?: boolean;\n children: ReactNode;\n}>;\n\n/**\n * The root of an Expo app: theme, keyboard, data, boot behind the splash, errors, session and held links.\n *\n * @stability Beta\n */\nexport function GenesisNativeApp(props: GenesisNativeAppProps) {\n // Above every provider: if one of them (or the shell's own set-up) throws,\n // this shows a screen made of nothing that can fail, and retry starts over.\n const [rootKey, setRootKey] = useState(0);\n const onErrorRef = useRef(props.onError);\n onErrorRef.current = props.onError;\n // The blocks as given, before they are resolved: an error here may come from resolving them.\n const blocksRef = useRef(givenBlocks(props));\n const splashRef = useRef(props.splash);\n splashRef.current = props.splash;\n return (\n <GenesisErrorBoundary\n key={rootKey}\n fallback={PlainFallback}\n onError={(e, r) => {\n reportToBlocks(blocksRef.current, e, r);\n try {\n onErrorRef.current?.(e, r);\n } catch {\n // A failing reporter must not stop the fatal screen.\n }\n // The shell (which hides the splash) never mounted: hide it here, or the screen stays behind it.\n splashRef.current?.hideAsync().catch(() => {});\n }}\n onRetry={() => setRootKey((key) => key + 1)}\n >\n <ThemedShell {...props} />\n </GenesisErrorBoundary>\n );\n}\n\ndeclare const __DEV__: boolean | undefined;\n\nconst MISSING_KEYBOARD_PROVIDER =\n \"GenesisNativeApp: `keyboardScroll` was given without `keyboardProvider`, so form screens won't move above the keyboard. \" +\n 'Pass `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nconst TOOLBAR_WITHOUT_SCROLL =\n \"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. \" +\n 'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from \"react-native-keyboard-controller\" too.';\n\nfunction ThemedShell(props: GenesisNativeAppProps) {\n const { brand, keyboardScroll, keyboardToolbar } = props;\n // Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.\n const [Keyboard] = useState(() => props.keyboardProvider);\n // Frozen too: an inline object would hand every component a new module set each render.\n const [modules] = useState(() => props.modules);\n const [toast] = useState(() => (props.toast === null ? null : { position: \"top\" as const, ...props.toast }));\n const missingProvider = Boolean(keyboardScroll) && !Keyboard;\n const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;\n useEffect(() => {\n if (typeof __DEV__ === \"undefined\" || !__DEV__) return;\n // genesis-allow-console: development-only set-up mistakes, shown as LogBox errors on purpose.\n if (missingProvider) console.error(MISSING_KEYBOARD_PROVIDER);\n if (toolbarWithoutScroll) console.error(TOOLBAR_WITHOUT_SCROLL);\n }, [missingProvider, toolbarWithoutScroll]);\n let body = <Shell {...props} />;\n // Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.\n if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;\n if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;\n if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;\n if (Keyboard) body = <Keyboard>{body}</Keyboard>;\n if (modules?.navigation && props.navigationTheme !== false) {\n body = (\n <NavigationTheme module={modules.navigation} brand={brand} brandVariables={props.brandVariables} given={props.navigationTheme}>\n {body}\n </NavigationTheme>\n );\n }\n return (\n <ThemeProvider brand={brand} syncNativeAppearance>\n {props.brandVariables ? (\n <BrandVariables brand={brand} given={props.brandVariables}>\n {body}\n </BrandVariables>\n ) : (\n body\n )}\n </ThemeProvider>\n );\n}\n\n/**\n * Theme role variables (`--primary`, `--background`, …) for the current mode,\n * set on a view around the app, so NativeWind's role classes (`bg-primary` is\n * `hsl(var(--primary))`) read them instead of what `:root` declares. Only with\n * `brandVariables`: NativeWind can't tell which `:root` variables are the\n * app's own, so setting them is the app's choice.\n */\nfunction BrandVariables({\n brand,\n given,\n children,\n}: {\n brand: CanonicalBrand;\n given: NonNullable<GenesisNativeAppProps[\"brandVariables\"]>;\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const variables = useMemo(() => {\n if (given === true) return brandRoleVariables(brand);\n const perMode = given as { light?: unknown; dark?: unknown };\n if (typeof perMode.light === \"object\" && typeof perMode.dark === \"object\") return given as { light: Record<string, string>; dark: Record<string, string> };\n return { light: given as Record<string, string>, dark: given as Record<string, string> };\n }, [brand, given]);\n const style = useMemo(() => [{ flex: 1 }, vars(variables[resolvedMode])], [variables, resolvedMode]);\n return (\n <View testID=\"genesis-brand-variables\" style={style}>\n {children}\n </View>\n );\n}\n\n/**\n * `\"240 10% 3.9%\"` (a role variable's value) → `\"hsl(240, 10%, 3.9%)\"`, and `\"240 10% 3.9% / 0.5\"`\n * → `\"hsla(240, 10%, 3.9%, 0.5)\"`; anything else as it is.\n */\nfunction roleColor(value: string | undefined): string | undefined {\n if (!value) return undefined;\n const [color = \"\", alpha] = value.split(\"/\").map((p) => p.trim());\n const parts = color.split(/\\s+/);\n if (parts.length !== 3) return value;\n return alpha ? `hsla(${parts.join(\", \")}, ${alpha})` : `hsl(${parts.join(\", \")})`;\n}\n\n/**\n * React Navigation's theme for the current mode, in the app's role colors: the\n * variables `brandVariables` sets (or `brandRoleVariables(brand)`) over React\n * Navigation's own light or dark theme, which keeps its fonts.\n */\nfunction NavigationTheme({\n module,\n brand,\n brandVariables,\n given,\n children,\n}: {\n module: GenesisNavigationModule;\n brand: CanonicalBrand;\n brandVariables: GenesisNativeAppProps[\"brandVariables\"];\n given: GenesisNativeAppProps[\"navigationTheme\"];\n children: ReactNode;\n}) {\n const { resolvedMode } = useTheme();\n const theme = useMemo((): GenesisNavigationTheme => {\n const base = resolvedMode === \"dark\" ? module.DarkTheme : module.DefaultTheme;\n if (given) {\n const perMode = given as { light?: GenesisNavigationTheme; dark?: GenesisNavigationTheme };\n const own = perMode.light && perMode.dark ? perMode[resolvedMode]! : (given as GenesisNavigationTheme);\n // React Navigation's headers read every font variant: a theme without fonts keeps the base's.\n return own.fonts ? own : { ...own, fonts: base.fonts };\n }\n // The app's own map over the brand's role colors, so a partial map never falls back to React Navigation's.\n let variables = brandRoleVariables(brand)[resolvedMode];\n if (brandVariables && brandVariables !== true) {\n const perMode = brandVariables as { light?: unknown; dark?: unknown };\n const own = typeof perMode.light === \"object\" && typeof perMode.dark === \"object\" ? (brandVariables as Record<\"light\" | \"dark\", Record<string, string>>)[resolvedMode] : (brandVariables as Record<string, string>);\n variables = { ...variables, ...own };\n }\n const pick = (name: string, fallback: GenesisNavigationTheme[\"colors\"][\"text\"]) => roleColor(variables[`--${name}`]) ?? fallback;\n return {\n ...base,\n dark: resolvedMode === \"dark\",\n colors: {\n ...base.colors,\n primary: pick(\"primary\", base.colors.primary),\n background: pick(\"background\", base.colors.background),\n card: pick(\"card\", base.colors.card),\n text: pick(\"foreground\", base.colors.text),\n border: pick(\"border\", base.colors.border),\n notification: pick(\"destructive\", base.colors.notification),\n },\n };\n }, [module, brand, brandVariables, given, resolvedMode]);\n const Provider = module.ThemeProvider;\n return <Provider value={theme}>{children}</Provider>;\n}\n\nconst SESSION_STEP_MARGIN_MS = 15_000;\n\nfunction Shell(props: GenesisNativeAppProps) {\n const { supabase, provider, queryClient: queryOptions, persist, splash, links, steps = [], bootOptions, sessionWaitMs = 5000 } = props;\n const { errorUtils, rejectionTracker, lifecycle, slotProps, children } = props;\n const latest = useRef(props);\n latest.current = props;\n const [blockList] = useState(() => givenBlocks(props));\n // Read once, like the keyboard provider: a different module later would remount the screens.\n const [bottomSheet] = useState(() => props.bottomSheet);\n const onError: OnError = (error, report) => {\n reportToBlocks(blockList, error, report);\n try {\n latest.current.onError?.(error, report);\n } catch {\n // A failing reporter must not take the shell down with it.\n }\n };\n // How many fatal screens are up (the global handler lets a second fatal error end the app).\n const fatalShown = useRef(0);\n\n // Created once: the shell's parts live as long as the app.\n const [parts] = useState(() => {\n const list = blockList;\n const blocks = resolveBlocks(list, props.appFeatures ? [...list.map((b) => b.id), ...props.appFeatures] : undefined, {\n platform: \"native\",\n slots: NATIVE_APP_SLOT_NAMES,\n });\n const client = queryOptions?.client ?? createNativeQueryClient(queryOptions?.config);\n const persistence = persist ? persist(client) : null;\n const session = createSessionStore(supabase, {\n waitMs: sessionWaitMs,\n // Another user (or nobody) now: nothing of the last user's may show or stay on disk.\n onUserChange: (previous, next) => {\n client.clear();\n void persistence?.clear();\n if (previous !== null && next === null) latest.current.onSignedOut?.();\n },\n });\n const boot = createBoot(\n [\n ...steps,\n // Blocks' steps, in dependency order (the updates block's settles within its own timeout and never throws).\n ...blocks.blocks.flatMap((block) => block.bootSteps ?? []),\n { id: \"genesis:session\", run: () => session.load(), timeoutMs: sessionWaitMs + SESSION_STEP_MARGIN_MS },\n // After the session, so only the cache saved for this user is restored.\n ...(persistence ? [{ id: \"genesis:query-cache\", run: () => persistence.restore(session.getState().userId ?? \"\") }] : []),\n ],\n bootOptions,\n );\n // One component type for the life of the app, so a re-render never remounts a visible fatal screen.\n function FatalFallback(fallbackProps: FatalScreenProps) {\n useEffect(() => {\n fatalShown.current++;\n return () => {\n fatalShown.current--;\n };\n }, []);\n const { slotProps: sp } = latest.current;\n const s = withBlockSlots(blocks.slots, latest.current.slots);\n return (\n // A `fatal` slot that throws falls back to the plain screen.\n <GenesisErrorBoundary fallback={PlainFallback} onError={onError} onRetry={fallbackProps.retry}>\n {renderSlot(FatalScreen, s?.fatal, fallbackProps, sp?.fatal)}\n </GenesisErrorBoundary>\n );\n }\n return { client, persistence, session, boot, FatalFallback, blocks, provider: provider ?? createSupabaseProvider(supabase) };\n });\n const { boot, session, persistence, client, FatalFallback } = parts;\n const slots = withBlockSlots(parts.blocks.slots, props.slots);\n const bootState = useSyncExternalStore(boot.subscribe, boot.getState, boot.getState);\n const sessionState = useSyncExternalStore(session.subscribe, session.getState, session.getState);\n const [fatal, setFatal] = useState<Error | null>(null);\n const [resetKey, setResetKey] = useState(0);\n\n useEffect(() => session.start(), [session]);\n useEffect(() => {\n void boot.start();\n }, [boot]);\n useEffect(() => {\n if (bootState.status === \"failed\" && bootState.error) onError(bootState.error, { fatal: true, source: \"boot\" });\n }, [bootState.status, bootState.error]);\n useEffect(() => {\n // The screens mount, and start reading, before this effect runs: their reads are this person's\n // (the client is emptied whenever the person changes), so they're saved too.\n if (bootState.status === \"ready\" && persistence) return persistence.subscribe(sessionState.userId ?? \"\", { adopt: Boolean(sessionState.userId) });\n }, [bootState.status, persistence, sessionState.userId]);\n useEffect(() => {\n const utils = errorUtils ?? defaultErrorUtils();\n if (!utils) return;\n return installGlobalErrorHandler({ errorUtils: utils, onError, onFatal: setFatal, alreadyFatal: () => fatalShown.current > 0 });\n }, [errorUtils]);\n useEffect(() => {\n const enable = rejectionTracker === null ? undefined : (rejectionTracker ?? defaultRejectionTracker());\n if (enable) installRejectionTracker({ enable, onError });\n }, [rejectionTracker]);\n useEffect(() => (lifecycle ? connectQueryLifecycle(lifecycle) : undefined), [lifecycle]);\n const [queryReports] = useState(() => props.reportQueryErrors !== false);\n useEffect(() => (queryReports ? reportQueryErrors(client, onError) : undefined), [client, queryReports]);\n\n // Splash: up until boot has finished (the session step included), or failed.\n const settled = bootState.status === \"ready\" || bootState.status === \"failed\" || fatal !== null;\n const splashHidden = useRef(false);\n useEffect(() => {\n if (!settled || !splash || splashHidden.current) return;\n splashHidden.current = true;\n splash.hideAsync().catch(() => {});\n }, [settled, splash]);\n\n const auth: HeldLinkAuth = bootState.status !== \"ready\" || sessionState.status === \"loading\" ? \"pending\" : sessionState.status;\n useHeldLink(links?.hold ?? NO_HOLD, { auth: links ? auth : \"pending\", onRelease: (path) => links?.onRelease(path) });\n\n const retry = () => {\n setFatal(null);\n setResetKey((key) => key + 1);\n if (boot.getState().status === \"failed\") void boot.retry();\n };\n\n let content: ReactNode;\n if (fatal) {\n content = <FatalFallback error={fatal} retry={retry} />;\n } else if (bootState.status === \"failed\" && bootState.error) {\n content = <FatalFallback error={bootState.error} retry={retry} />;\n } else if (bootState.status !== \"ready\") {\n content = renderSlot(BootScreen, slots?.boot, { status: bootState.status }, slotProps?.boot);\n } else {\n const screens =\n sessionState.status === \"signedOut\" ? renderSlot(PassThrough, slots?.signedOut, { children }, slotProps?.signedOut) : children;\n const guarded = renderSlot(\n GenesisErrorBoundary,\n slots?.errorBoundary,\n { fallback: FatalFallback, onError, resetKey, onRetry: retry, children: screens },\n slotProps?.errorBoundary,\n );\n // The first block's root is the outermost.\n content = parts.blocks.blocks.reduceRight<ReactNode>((inner, block) => {\n const Root = block.Root;\n return Root ? (\n <Root key={block.id} slots={slots} slotProps={slotProps}>\n {inner}\n </Root>\n ) : (\n inner\n );\n }, guarded);\n }\n\n return (\n <GenesisProvider provider={parts.provider} queryClient={client}>\n <SessionProvider store={session}>\n <BootProvider boot={boot}>\n <BlocksProvider value={parts.blocks}>\n <GenesisErrorBoundary key={resetKey} fallback={FatalFallback} onError={onError} onRetry={retry}>\n {/* Sheet content renders in the library's portal, here: below data, session, boot and blocks. */}\n {bottomSheet ? <NativeSheetProvider bottomSheet={bottomSheet}>{content}</NativeSheetProvider> : content}\n </GenesisErrorBoundary>\n </BlocksProvider>\n </BootProvider>\n </SessionProvider>\n </GenesisProvider>\n );\n}\n\n// Every slot name, checked against NativeAppSlots by the compiler: a block filling any other is a BlockError.\nconst SLOT_NAMES: Record<keyof NativeAppSlots, true> = {\n boot: true,\n fatal: true,\n errorBoundary: true,\n signedOut: true,\n forceUpgrade: true,\n maintenance: true,\n updateBanner: true,\n whatsNew: true,\n devtoolsFeedback: true,\n pushPrompt: true,\n};\nconst NATIVE_APP_SLOT_NAMES: readonly string[] = Object.keys(SLOT_NAMES);\n\n/** Blocks' slot fills under the app's own slots: the app's (a component or `null`) always win. */\nfunction withBlockSlots(fills: Readonly<Record<string, unknown>>, own: Slots<NativeAppSlots> | undefined): Slots<NativeAppSlots> | undefined {\n if (Object.keys(fills).length === 0) return own;\n return { ...(fills as Slots<NativeAppSlots>), ...own };\n}\n\n/** `blocks`, with `updates` added when it was given on its own (given both ways, it runs once). */\nfunction givenBlocks(props: Pick<GenesisNativeAppProps, \"blocks\" | \"updates\">): readonly NativeBlock[] {\n const given = props.blocks ?? [];\n return props.updates && !given.includes(props.updates) ? [...given, props.updates] : given;\n}\n\nconst NO_HOLD: LinkHold = {\n hold: () => {},\n peek: () => null,\n take: () => null,\n clear: () => {},\n subscribe: () => () => {},\n};\n","/**\n * A hydration gate holds writes until a persisted store has loaded from disk.\n *\n * The bug it prevents: a persisted store (zustand `persist`, say) is created\n * with defaults, something sets a value before the saved state has been read,\n * and that write lands on disk first, replacing what the user had. With the\n * gate, a write made before hydration never reaches disk (`storage()`), or\n * waits for it (`run()`).\n *\n * const gate = createHydrationGate();\n * persist(store, {\n * storage: createJSONStorage(() => gate.storage(AsyncStorage)),\n * // Open only after a good read: after a failed one, writes would replace what's on disk.\n * onRehydrateStorage: () => (_state, error) => {\n * if (!error) gate.markHydrated();\n * },\n * });\n */\nimport type { AsyncStorageLike } from \"./query\";\n\nexport interface HydrationGate {\n readonly hydrated: boolean;\n /** Call once the store has read its saved state. Idempotent. */\n markHydrated(): void;\n /** Resolves once hydrated. */\n whenHydrated(): Promise<void>;\n /** Run a write now if hydrated, otherwise once hydrated. */\n run<T>(write: () => T | Promise<T>): Promise<T>;\n /**\n * The storage, with writes made before hydration dropped (reads pass\n * through, since hydration is a read). After hydration the store writes\n * its merged state on its next change, so nothing is lost but the stale\n * write. (A zustand migration's own write during hydration is dropped too;\n * the old version stays on disk and is migrated again until then.)\n */\n storage<S extends AsyncStorageLike>(storage: S): S;\n}\n\nexport interface HydrationGateOptions {\n /** Told about each write `storage()` dropped (to log it in development). */\n onDroppedWrite?: (key: string) => void;\n}\n\n/** A gate that holds writes until a persisted store has hydrated. */\nexport function createHydrationGate({ onDroppedWrite }: HydrationGateOptions = {}): HydrationGate {\n let hydrated = false;\n let open!: () => void;\n const opened = new Promise<void>((resolve) => {\n open = resolve;\n });\n\n const gate: HydrationGate = {\n get hydrated() {\n return hydrated;\n },\n markHydrated() {\n if (hydrated) return;\n hydrated = true;\n open();\n },\n whenHydrated: () => opened,\n async run(write) {\n if (!hydrated) await opened;\n return write();\n },\n storage(storage) {\n const setItem = async (key: string, value: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.setItem(key, value);\n };\n const removeItem = async (key: string) => {\n if (!hydrated) return onDroppedWrite?.(key);\n return storage.removeItem(key);\n };\n // A proxy, not a spread: a storage class's prototype methods (and its\n // private fields, through `this`) keep working.\n return new Proxy(storage, {\n get(target, property) {\n if (property === \"setItem\") return setItem;\n if (property === \"removeItem\") return removeItem;\n const value = Reflect.get(target, property, target) as unknown;\n return typeof value === \"function\" ? value.bind(target) : value;\n },\n });\n },\n };\n return gate;\n}\n"]}
|
|
1
|
+
{"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;A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ACA,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-features/blocks\";\nimport { BlocksProvider, reportToBlocks, type NativeBlock } from \"./blocks\";\nimport type { DevtoolsSlots } from \"./devtools/slots\";\n// Types only: the block's code is in the `/updates` entry and arrives with the `updates` prop.\nimport type { UpdatesBlock, UpdatesSlots } from \"./updates/block\";\n// Types only, likewise: the push block (`/push`) arrives in `blocks`.\nimport type { PushSlots } from \"./push/block\";\n\n/** `expo-splash-screen`, or a stand-in. Call `preventAutoHideAsync()` at module scope yourself too. */\nexport interface SplashModule {\n preventAutoHideAsync?: () => Promise<unknown>;\n hideAsync: () => Promise<unknown>;\n}\n\nexport interface BootScreenProps {\n status: BootStatus;\n}\n\nexport interface SignedOutProps {\n /** Your screens. The default renders them, for an expo-router layout that redirects. */\n children: ReactNode;\n}\n\n// A type, not an interface, so it fits the slots contract's Record constraint.\n// The updates block's slots (`forceUpgrade`, `maintenance`, `updateBanner`,\n// `whatsNew`) render only when the `updates` prop is given.\nexport type NativeAppSlots = UpdatesSlots &\n PushSlots &\n DevtoolsSlots & {\n /** Shown while booting: under the splash at launch, on its own after \"Try again\". Default `BootScreen`. */\n boot: BootScreenProps;\n /** A failed boot, a fatal global error or a render error. Default `FatalScreen`. */\n fatal: FatalScreenProps;\n /** The boundary around your screens. Default `GenesisErrorBoundary`. */\n errorBoundary: GenesisErrorBoundaryProps;\n /** What a signed-out user sees. Default your screens (gate them with `useSession`). */\n signedOut: SignedOutProps;\n};\n\nexport interface NativeQueryClientOptions {\n /** Your own client. Default `createNativeQueryClient(config)`. */\n client?: QueryClient;\n config?: QueryClientConfig;\n}\n\nexport interface GenesisNativeAppProps {\n brand: CanonicalBrand;\n /** A Supabase client (from `createGenesisSupabase` in `@marktiderman/genesis-supabase`). */\n supabase: AuthClientLike & SupabaseClientInput;\n /** The data provider. Default `createSupabaseProvider(supabase)`. */\n provider?: DataProvider;\n queryClient?: NativeQueryClientOptions;\n /**\n * Keep reads on the phone: `persistOffline({ cache: sqliteLocalCache({ db }), resources, buster })`\n * from `@marktiderman/genesis-native/offline`. The saved cache belongs to\n * one user: it is restored only for that user and cleared when the user\n * changes (sign-out, a session that ended while the app was closed, an\n * account switch).\n */\n persist?: (client: QueryClient) => QueryPersistence;\n /** `expo-splash-screen`: hidden once boot has finished and the session is known. */\n splash?: SplashModule;\n /**\n * `KeyboardProvider` from react-native-keyboard-controller, mounted once\n * around the app. Its keyboard views (`keyboardScroll` included) do nothing\n * without it: give both or neither. Read once: it wraps the whole app, so\n * a different component later would remount everything below it. To pass\n * it props, define the wrapper at module scope, not inline.\n */\n keyboardProvider?: ComponentType<{ children: ReactNode }>;\n /**\n * Theme role variables (`--primary`, `--background`, …) to set on a view\n * around the app, over what the app's stylesheet declares on `:root`.\n * Default `false`: none are set, so the app's own variables (from\n * `createGenesisNativewindPreset({ brand })` or its brand package) stand.\n * `true` sets `brandRoleVariables(brand)` for the current mode; an object\n * sets the app's own, one map for both modes or `{ light, dark }`.\n */\n brandVariables?: boolean | Record<string, string> | { light: Record<string, string>; dark: Record<string, string> };\n /**\n * React Navigation's theme (headers, tab bars, the screen background), when\n * `modules.navigation` is given. Default: worked out from the same role\n * variables as `brandVariables` (the app's own when it passes them,\n * `brandRoleVariables(brand)` otherwise), for the current mode, so a header\n * is never light in dark mode. Pass a theme (or `{ light, dark }`) to use\n * your own, or `false` to set none.\n */\n navigationTheme?: false | GenesisNavigationTheme | { light: GenesisNavigationTheme; dark: GenesisNavigationTheme };\n /** `KeyboardAwareScrollView` from react-native-keyboard-controller, for form screens. Needs `keyboardProvider`. */\n keyboardScroll?: ComponentType<KeyboardScrollProps>;\n /**\n * `KeyboardToolbar` from react-native-keyboard-controller: previous / next /\n * done above the keyboard on Genesis's form layouts. Needs `keyboardScroll`\n * (and so `keyboardProvider`); without them it is ignored.\n */\n keyboardToolbar?: ComponentType<KeyboardToolbarProps>;\n /**\n * `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 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,7 +1,7 @@
|
|
|
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-Iga-mCeC.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-Iga-mCeC.js';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
|
-
import { V as VersionSignature } from './blocks-
|
|
4
|
+
import { V as VersionSignature } from './blocks-BQY_df3j.js';
|
|
5
5
|
export { c as ScreenErrorProps, d as ScreenErrorScreen, e as createScreenErrorBoundary } from './screen-boundary-B8DlsLwb.js';
|
|
6
6
|
import './query--ihYsJWC.js';
|
|
7
7
|
import '@tanstack/react-query';
|
package/dist/push.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as PushPermissionStatus, Y as NotificationResponseLike, Z as NotificationLike, o as LinkOptions, _ as QuietHours } from './blocks-
|
|
2
|
-
export { $ as ChannelImportance, a0 as ChannelInputLike, a1 as DEFAULT_PREFERENCES, a2 as NotificationActionLike, a3 as NotificationBehaviorLike, a4 as NotificationCategory, a5 as NotificationPreferences, a6 as NotificationsModuleLike, a7 as PermissionRequestLike, a8 as PermissionState, a9 as PermissionStatusLike, aa as PermissionStore, ab as PreferencesState, ac as PreferencesStatus, ad as PreferencesStore, ae as PromptOptions, af as PromptState, ag as PromptStore, ah as PushAppStateLike, ai as PushBackend, aj as PushBackendError, ak as PushBlock, al as PushChannel, am as PushDeviceCategory, an as PushErrorSource, ao as PushOnError, ap as PushOptions, aq as PushPromptProps, ar as PushPromptSheet, as as PushProvider, at as PushRoot, au as PushRootProps, av as PushSlots, aw as PushStorageLike, ax as PushSupabaseLike, ay as Registration, az as RegistrationState, aA as RegistrationStatus, aB as SubscriptionLike, aC as canPush, aD as createPermissionStore, aE as createPreferencesStore, aF as createPromptStore, aG as createPush, aH as createRegistration, aI as statusOf, aJ as supabasePushBackend, aK as useBadge, aL as useNotificationPreferences, aM as useOptionalPush, aN as usePush, aO as usePushPermissionState, aP as usePushPrompt, aQ as usePushRegistration, aR as useSuppressNotifications, aS as validPreferences } from './blocks-
|
|
1
|
+
import { X as PushPermissionStatus, Y as NotificationResponseLike, Z as NotificationLike, o as LinkOptions, _ as QuietHours } from './blocks-BQY_df3j.js';
|
|
2
|
+
export { $ as ChannelImportance, a0 as ChannelInputLike, a1 as DEFAULT_PREFERENCES, a2 as NotificationActionLike, a3 as NotificationBehaviorLike, a4 as NotificationCategory, a5 as NotificationPreferences, a6 as NotificationsModuleLike, a7 as PermissionRequestLike, a8 as PermissionState, a9 as PermissionStatusLike, aa as PermissionStore, ab as PreferencesState, ac as PreferencesStatus, ad as PreferencesStore, ae as PromptOptions, af as PromptState, ag as PromptStore, ah as PushAppStateLike, ai as PushBackend, aj as PushBackendError, ak as PushBlock, al as PushChannel, am as PushDeviceCategory, an as PushErrorSource, ao as PushOnError, ap as PushOptions, aq as PushPromptProps, ar as PushPromptSheet, as as PushProvider, at as PushRoot, au as PushRootProps, av as PushSlots, aw as PushStorageLike, ax as PushSupabaseLike, ay as Registration, az as RegistrationState, aA as RegistrationStatus, aB as SubscriptionLike, aC as canPush, aD as createPermissionStore, aE as createPreferencesStore, aF as createPromptStore, aG as createPush, aH as createRegistration, aI as statusOf, aJ as supabasePushBackend, aK as useBadge, aL as useNotificationPreferences, aM as useOptionalPush, aN as usePush, aO as usePushPermissionState, aP as usePushPrompt, aQ as usePushRegistration, aR as useSuppressNotifications, aS as validPreferences } from './blocks-BQY_df3j.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { Slots, SlotPropsFor } from '@marktiderman/genesis-core/slots';
|
package/dist/updates.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aT as ApplicationLike, aU as CLOCK_SKEW_MS, aV as ChannelSwitchResult, aW as ChannelSwitcher, aX as ChannelSwitcherOptions, aY as EvaluatePolicyOptions, aZ as ForceUpgradeProps, a_ as ForceUpgradeScreen, a$ as MaintenanceProps, b0 as MaintenanceScreen, b1 as PolicyClientLike, b2 as PolicyOrigin, b3 as PolicyState, b4 as PolicyStore, b5 as PolicyStoreOptions, b6 as ReleaseNote, b7 as ReloadGuard, b8 as SupabasePolicySourceOptions, b9 as UPDATES_BLOCK_ID, ba as UpdateBanner, bb as UpdateBannerProps, bc as UpdateCheckState, bd as UpdateCheckStatus, be as UpdateChecker, bf as UpdateCheckerOptions, bg as UpdatePlatform, bh as UpdatePolicy, bi as UpdatePolicySource, bj as UpdateVerdict, bk as UpdatesAppStateLike, U as UpdatesBlock, bl as UpdatesErrorSource, bm as UpdatesModuleLike, bn as UpdatesOnError, bo as UpdatesOptions, bp as UpdatesProvider, bq as UpdatesRoot, br as UpdatesRootProps, bs as UpdatesSlots, bt as UpdatesStorageLike, V as VersionSignature, bu as VersionSignatureInput, bv as WEEK_MS, bw as WhatsNewOptions, bx as WhatsNewProps, by as WhatsNewSheet, bz as WhatsNewState, bA as WhatsNewStore, bB as createChannelSwitcher, bC as createPolicyStore, bD as createReloadGuard, bE as createUpdateChecker, bF as createUpdates, bG as createWhatsNewStore, bH as evaluatePolicy, bI as notesSince, bJ as sanitizePolicy, bK as staticPolicySource, bL as supabasePolicySource, bM as useBlockReload, bN as useCanReload, bO as useForceUpgrade, bP as useMaintenance, bQ as useUpdateBanner, bR as useUpdateCheck, bS as useUpdatePolicy, bT as useUpdateVerdict, bU as useUpdates, bV as useVersionSignature, bW as useWhatsNew, bX as versionSignature } from './blocks-
|
|
1
|
+
export { aT as ApplicationLike, aU as CLOCK_SKEW_MS, aV as ChannelSwitchResult, aW as ChannelSwitcher, aX as ChannelSwitcherOptions, aY as EvaluatePolicyOptions, aZ as ForceUpgradeProps, a_ as ForceUpgradeScreen, a$ as MaintenanceProps, b0 as MaintenanceScreen, b1 as PolicyClientLike, b2 as PolicyOrigin, b3 as PolicyState, b4 as PolicyStore, b5 as PolicyStoreOptions, b6 as ReleaseNote, b7 as ReloadGuard, b8 as SupabasePolicySourceOptions, b9 as UPDATES_BLOCK_ID, ba as UpdateBanner, bb as UpdateBannerProps, bc as UpdateCheckState, bd as UpdateCheckStatus, be as UpdateChecker, bf as UpdateCheckerOptions, bg as UpdatePlatform, bh as UpdatePolicy, bi as UpdatePolicySource, bj as UpdateVerdict, bk as UpdatesAppStateLike, U as UpdatesBlock, bl as UpdatesErrorSource, bm as UpdatesModuleLike, bn as UpdatesOnError, bo as UpdatesOptions, bp as UpdatesProvider, bq as UpdatesRoot, br as UpdatesRootProps, bs as UpdatesSlots, bt as UpdatesStorageLike, V as VersionSignature, bu as VersionSignatureInput, bv as WEEK_MS, bw as WhatsNewOptions, bx as WhatsNewProps, by as WhatsNewSheet, bz as WhatsNewState, bA as WhatsNewStore, bB as createChannelSwitcher, bC as createPolicyStore, bD as createReloadGuard, bE as createUpdateChecker, bF as createUpdates, bG as createWhatsNewStore, bH as evaluatePolicy, bI as notesSince, bJ as sanitizePolicy, bK as staticPolicySource, bL as supabasePolicySource, bM as useBlockReload, bN as useCanReload, bO as useForceUpgrade, bP as useMaintenance, bQ as useUpdateBanner, bR as useUpdateCheck, bS as useUpdatePolicy, bT as useUpdateVerdict, bU as useUpdates, bV as useVersionSignature, bW as useWhatsNew, bX as versionSignature } from './blocks-BQY_df3j.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@marktiderman/genesis-core/slots';
|
|
4
4
|
import '@marktiderman/genesis-features/blocks';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marktiderman/genesis-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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-features": "^0.
|
|
110
|
+
"@marktiderman/genesis-features": "^0.9.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.
|
|
156
|
-
"@marktiderman/genesis-design-system": "^1.
|
|
157
|
-
"@marktiderman/genesis-ui-native": "^3.
|
|
155
|
+
"@marktiderman/genesis-core": "^2.16.0",
|
|
156
|
+
"@marktiderman/genesis-design-system": "^1.12.0",
|
|
157
|
+
"@marktiderman/genesis-ui-native": "^3.12.0",
|
|
158
158
|
"@supabase/supabase-js": "^2.118.0",
|
|
159
159
|
"@tanstack/query-async-storage-persister": "5.105.0",
|
|
160
160
|
"@tanstack/query-persist-client-core": "5.105.0",
|
package/src/app.tsx
CHANGED
|
@@ -34,7 +34,7 @@ import { GenesisThemeProvider, useTheme } from "@marktiderman/genesis-design-sys
|
|
|
34
34
|
import { brandRoleVariables, type CanonicalBrand } from "@marktiderman/genesis-design-system";
|
|
35
35
|
import { GenesisProvider, createSupabaseProvider, type DataProvider, type SupabaseClientInput } from "@marktiderman/genesis-core/provider";
|
|
36
36
|
import { renderSlot, type SlotPropsFor, type Slots } from "@marktiderman/genesis-core/slots";
|
|
37
|
-
import { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardToolbarProps } from "@marktiderman/genesis-ui-native/layouts";
|
|
37
|
+
import { KeyboardScrollProvider, type KeyboardScrollProps, type KeyboardStickyProps, type KeyboardToolbarProps } from "@marktiderman/genesis-ui-native/layouts";
|
|
38
38
|
import {
|
|
39
39
|
GenesisModulesProvider,
|
|
40
40
|
NativeSheetProvider,
|
|
@@ -158,6 +158,11 @@ export interface GenesisNativeAppProps {
|
|
|
158
158
|
* (and so `keyboardProvider`); without them it is ignored.
|
|
159
159
|
*/
|
|
160
160
|
keyboardToolbar?: ComponentType<KeyboardToolbarProps>;
|
|
161
|
+
/**
|
|
162
|
+
* `KeyboardStickyView` from react-native-keyboard-controller: keeps FormPage's Save / Cancel
|
|
163
|
+
* bar above the keyboard. Needs `keyboardScroll`; without it, the bar ends the scrolling form.
|
|
164
|
+
*/
|
|
165
|
+
keyboardSticky?: ComponentType<KeyboardStickyProps>;
|
|
161
166
|
/**
|
|
162
167
|
* The optional native modules the app installed, for Genesis components to
|
|
163
168
|
* use (`GenesisModulesProvider` from `@marktiderman/genesis-ui-native`):
|
|
@@ -300,18 +305,18 @@ const MISSING_KEYBOARD_PROVIDER =
|
|
|
300
305
|
'Pass `keyboardProvider={KeyboardProvider}` from "react-native-keyboard-controller" too.';
|
|
301
306
|
|
|
302
307
|
const TOOLBAR_WITHOUT_SCROLL =
|
|
303
|
-
"GenesisNativeApp: `keyboardToolbar` was given without `keyboardScroll`, so it is ignored. " +
|
|
308
|
+
"GenesisNativeApp: `keyboardToolbar` or `keyboardSticky` was given without `keyboardScroll`, so it is ignored. " +
|
|
304
309
|
'Pass `keyboardScroll={KeyboardAwareScrollView}` and `keyboardProvider={KeyboardProvider}` from "react-native-keyboard-controller" too.';
|
|
305
310
|
|
|
306
311
|
function ThemedShell(props: GenesisNativeAppProps) {
|
|
307
|
-
const { brand, keyboardScroll, keyboardToolbar } = props;
|
|
312
|
+
const { brand, keyboardScroll, keyboardToolbar, keyboardSticky } = props;
|
|
308
313
|
// Frozen: a new component type here (an inline wrapper) would remount the shell and reset the app.
|
|
309
314
|
const [Keyboard] = useState(() => props.keyboardProvider);
|
|
310
315
|
// Frozen too: an inline object would hand every component a new module set each render.
|
|
311
316
|
const [modules] = useState(() => props.modules);
|
|
312
317
|
const [toast] = useState(() => (props.toast === null ? null : { position: "top" as const, ...props.toast }));
|
|
313
318
|
const missingProvider = Boolean(keyboardScroll) && !Keyboard;
|
|
314
|
-
const toolbarWithoutScroll = Boolean(keyboardToolbar) && !keyboardScroll;
|
|
319
|
+
const toolbarWithoutScroll = Boolean(keyboardToolbar || keyboardSticky) && !keyboardScroll;
|
|
315
320
|
useEffect(() => {
|
|
316
321
|
if (typeof __DEV__ === "undefined" || !__DEV__) return;
|
|
317
322
|
// genesis-allow-console: development-only set-up mistakes, shown as LogBox errors on purpose.
|
|
@@ -322,7 +327,7 @@ function ThemedShell(props: GenesisNativeAppProps) {
|
|
|
322
327
|
// Inside the modules: a toast animates with Reanimated and draws Liquid Glass when the app gave them.
|
|
323
328
|
if (toast) body = <NativeToastProvider {...toast}>{body}</NativeToastProvider>;
|
|
324
329
|
if (modules) body = <GenesisModulesProvider modules={modules}>{body}</GenesisModulesProvider>;
|
|
325
|
-
if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar}>{body}</KeyboardScrollProvider>;
|
|
330
|
+
if (keyboardScroll) body = <KeyboardScrollProvider component={keyboardScroll} toolbar={keyboardToolbar} sticky={keyboardSticky}>{body}</KeyboardScrollProvider>;
|
|
326
331
|
if (Keyboard) body = <Keyboard>{body}</Keyboard>;
|
|
327
332
|
if (modules?.navigation && props.navigationTheme !== false) {
|
|
328
333
|
body = (
|