@marktiderman/genesis-ui-native 3.9.1 → 3.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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-FM5JYR6R.js → chunk-EAHK7D7N.js} +6 -6
  3. package/dist/{chunk-FM5JYR6R.js.map → chunk-EAHK7D7N.js.map} +1 -1
  4. package/dist/{chunk-P4IN63O4.js → chunk-GGH3ZQNO.js} +4 -4
  5. package/dist/{chunk-P4IN63O4.js.map → chunk-GGH3ZQNO.js.map} +1 -1
  6. package/dist/{chunk-K2WQU3XP.js → chunk-IWWXERKQ.js} +13 -12
  7. package/dist/chunk-IWWXERKQ.js.map +1 -0
  8. package/dist/{chunk-PWS2HLDE.js → chunk-PMS2V46D.js} +2 -2
  9. package/dist/{chunk-PWS2HLDE.js.map → chunk-PMS2V46D.js.map} +1 -1
  10. package/dist/{chunk-JZ7RAGDQ.js → chunk-SG7LYX7Z.js} +4 -4
  11. package/dist/{chunk-JZ7RAGDQ.js.map → chunk-SG7LYX7Z.js.map} +1 -1
  12. package/dist/{chunk-FGIIBON3.js → chunk-VEWSY4TZ.js} +3 -3
  13. package/dist/{chunk-FGIIBON3.js.map → chunk-VEWSY4TZ.js.map} +1 -1
  14. package/dist/{chunk-GA75M5UT.js → chunk-ZUR4PK77.js} +7 -6
  15. package/dist/chunk-ZUR4PK77.js.map +1 -0
  16. package/dist/components/index.d.ts +12 -4
  17. package/dist/components/index.js +5 -5
  18. package/dist/data/index.d.ts +10 -2
  19. package/dist/data/index.js +13 -8
  20. package/dist/data/index.js.map +1 -1
  21. package/dist/hooks/index.d.ts +2 -2
  22. package/dist/hooks/index.js +1 -1
  23. package/dist/icons/lucide.d.ts +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +7 -7
  26. package/dist/layouts/index.js +5 -5
  27. package/dist/{native-modules-CeAaO2Dh.d.ts → native-modules-Bkm1jHO-.d.ts} +2 -0
  28. package/package.json +3 -3
  29. package/src/__tests__/fake-modules.tsx +1 -0
  30. package/src/__tests__/native-modules.test.tsx +39 -0
  31. package/src/components/__tests__/gallery-grid.test.tsx +20 -0
  32. package/src/components/__tests__/lightbox.test.tsx +16 -0
  33. package/src/components/gallery-grid.tsx +1 -1
  34. package/src/components/image.tsx +15 -4
  35. package/src/components/lightbox-zoom.tsx +8 -6
  36. package/src/components/lightbox.tsx +2 -1
  37. package/src/data/resource-view/NativeResourceView.tsx +17 -2
  38. package/src/data/resource-view/__tests__/native-resource-gallery.test.tsx +8 -0
  39. package/src/data/resource-view/index.ts +1 -0
  40. package/src/data/resource-view/mapping.ts +4 -4
  41. package/src/native-modules.tsx +2 -1
  42. package/dist/chunk-GA75M5UT.js.map +0 -1
  43. package/dist/chunk-K2WQU3XP.js.map +0 -1
@@ -133,5 +133,5 @@ function useThemeRoles(options = {}) {
133
133
  var sentBubbleColor = (roles) => roles.tint;
134
134
 
135
135
  export { GenesisModulesProvider, animateMotion, motionSpring, motionTiming, playHaptic, sentBubbleColor, useGenesisModules, useHaptics, useMotion, usePressFeedback, useReducedMotion, useThemeMode, useThemeRoles };
136
- //# sourceMappingURL=chunk-PWS2HLDE.js.map
137
- //# sourceMappingURL=chunk-PWS2HLDE.js.map
136
+ //# sourceMappingURL=chunk-PMS2V46D.js.map
137
+ //# sourceMappingURL=chunk-PMS2V46D.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/use-reduced-motion.ts","../src/hooks/use-motion.ts","../src/native-modules.tsx","../src/hooks/use-haptics.ts","../src/hooks/use-press-feedback.ts","../src/hooks/use-theme-mode.ts","../src/hooks/use-theme-roles.ts"],"names":["useMemo","useCallback","useEffect","useState"],"mappings":";;;;;;AAgBA,IAAI,SAAA,GAAY,KAAA;AAOT,SAAS,gBAAA,GAA4B;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,SAAS,CAAA;AAEhD,EAAA,S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the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n","/**\n * useMotion — the shared motion tokens (genesis-design-system's\n * `resolveMotion`), with the OS's reduce-motion setting applied.\n *\n * Every Genesis primitive that moves reads its durations, easings and springs\n * from here instead of its own constants, so motion is defined once for web\n * and native. Under Reduce Motion every duration is 0 and `animateMotion`\n * returns the final value, so a component lands without moving.\n *\n * The brand's motion level isn't read from a provider yet: pass `level` (a\n * brand whose design system chose `none` passes `\"none\"`). Without it,\n * `calm`.\n *\n * On the JS thread (an effect, a PanResponder), `animateMotion`:\n *\n * ```tsx\n * const motion = useMotion();\n * const { reanimated: R } = useGenesisModules();\n * opacity.value = animateMotion(R, motion, 1, { duration: \"fast\", easing: \"decelerate\" });\n * ```\n *\n * Inside a worklet (a gesture's `onEnd`, an animated scroll handler), build\n * the config with the worklet-safe `motionSpring` / `motionTiming` and call\n * Reanimated yourself:\n *\n * ```tsx\n * .onEnd((e) => { x.value = withSpring(0, motionSpring(motion, \"snappy\", e.velocityX)); })\n * opacity.value = withTiming(1, motionTiming(motion, \"fast\", Easing, \"decelerate\"));\n * ```\n *\n * A repeating animation checks `motion.reduced` first: a zero-length repeat\n * would flash every frame.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport {\n resolveMotion,\n type MotionDurations,\n type MotionEasings,\n type MotionLevel,\n type MotionSprings,\n type MotionTokens,\n} from \"@marktiderman/genesis-design-system/tokens/motion\";\nimport type { GenesisReanimatedModule } from \"../native-modules\";\nimport { useReducedMotion } from \"./use-reduced-motion\";\n\nexport interface UseMotionOptions {\n /** The brand's motion level. Default `calm`; `none` holds everything still, like Reduce Motion. */\n level?: MotionLevel;\n}\n\nexport function useMotion(options: UseMotionOptions = {}): MotionTokens {\n const reducedMotion = useReducedMotion();\n const level = options.level ?? \"calm\";\n return useMemo(() => resolveMotion(level, { reducedMotion }), [level, reducedMotion]);\n}\n\n/** How to get there: a named spring (keeps a gesture's velocity), or a named duration and easing. */\nexport type MotionHow =\n | { spring: keyof MotionSprings; velocity?: number; duration?: never; easing?: never }\n | { duration: keyof MotionDurations; easing?: keyof MotionEasings; spring?: never; velocity?: never };\n\n/** What `motionSpring` gives `withSpring`. */\nexport interface MotionSpringConfig {\n damping: number;\n stiffness: number;\n mass: number;\n velocity?: number;\n}\n\n/** What `motionTiming` gives `withTiming`. */\nexport interface MotionTimingConfig {\n duration: number;\n easing?: unknown;\n}\n\n/**\n * A `withSpring` config from a named spring. Worklet-safe (plain data in,\n * plain data out). Under reduced motion it's the stiff, critically damped\n * spring that settles in a few frames; to not move at all, check\n * `motion.reduced` and assign the value.\n */\nexport function motionSpring(motion: MotionTokens, name: keyof MotionSprings, velocity?: number): MotionSpringConfig {\n \"worklet\";\n const s = motion.spring[name];\n return typeof velocity === \"number\" && !motion.reduced\n ? { damping: s.damping, stiffness: s.stiffness, mass: s.mass, velocity }\n : { damping: s.damping, stiffness: s.stiffness, mass: s.mass };\n}\n\n/**\n * A `withTiming` config from a named duration and easing. Pass Reanimated's\n * `Easing` (`R.Easing`, or `Easing` imported in a worklet) so the token's\n * curve is used; a module without `Easing.bezier` gets Reanimated's default\n * curve. Worklet-safe.\n */\nexport function motionTiming(\n motion: MotionTokens,\n duration: keyof MotionDurations,\n Easing: Pick<GenesisReanimatedModule[\"Easing\"], \"bezier\"> | undefined,\n easing: keyof MotionEasings = \"out\",\n): MotionTimingConfig {\n \"worklet\";\n const [x1, y1, x2, y2] = motion.easing[easing];\n const curve = Easing?.bezier ? Easing.bezier(x1, y1, x2, y2) : undefined;\n return curve === undefined ? { duration: motion.duration[duration] } : { duration: motion.duration[duration], easing: curve };\n}\n\n/**\n * A Reanimated animation to `toValue` with the motion tokens, for a shared\n * value on the JS thread: `x.value = animateMotion(R, motion, 0, { spring: \"smooth\" })`.\n * Under reduced motion it returns `toValue` itself, so nothing moves.\n *\n * It takes no completion callback: Reanimated runs one on the UI thread, so\n * it must be a worklet, and the reduced path couldn't keep that promise. To\n * act when an animation ends, call `withSpring` / `withTiming` yourself with\n * `motionSpring` / `motionTiming` and a worklet callback. A module without\n * `withSpring` (an older one, a test fake) gets a `withTiming` at `base`.\n */\nexport function animateMotion(R: GenesisReanimatedModule, motion: MotionTokens, toValue: number, how: MotionHow): number {\n if (motion.reduced) return toValue;\n if (how.spring !== undefined) {\n if (R.withSpring) return R.withSpring(toValue, motionSpring(motion, how.spring, how.velocity));\n return R.withTiming(toValue, motionTiming(motion, \"base\", R.Easing));\n }\n return R.withTiming(toValue, motionTiming(motion, how.duration, R.Easing, how.easing));\n}\n","/**\n * GenesisModulesProvider — the native modules an app opts in to, passed in\n * once near the root. Genesis never `require()`s these itself: an app that\n * has a module installed imports it and hands it over, and every component\n * that could use it falls back to plain React Native when it isn't here.\n *\n * import { FlashList } from \"@shopify/flash-list\";\n * import { Image } from \"expo-image\";\n * import * as Reanimated from \"react-native-reanimated\";\n * import * as GlassEffect from \"expo-glass-effect\";\n * import { SymbolView } from \"expo-symbols\";\n * import DateTimePicker from \"@expo/ui/community/datetime-picker\";\n * import { lucideIcons } from \"@marktiderman/genesis-ui-native/icons/lucide\";\n * import { DarkTheme, DefaultTheme, ThemeProvider } from \"expo-router\";\n *\n * // At module scope, not inline:\n * const modules = { list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,\n * symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker,\n * navigation: { ThemeProvider, DefaultTheme, DarkTheme } };\n * <GenesisModulesProvider modules={modules}>…</GenesisModulesProvider>\n *\n * (`GenesisNativeApp` from `@marktiderman/genesis-native` takes the same\n * object as its `modules` prop and mounts this for you.)\n *\n * | Module | Used by | Without it |\n * | ------------------------------ | ---------------------------------------- | ----------------------------- |\n * | `list` (FlashList v2) | NativeResourcePage, NotificationsPage | FlatList / SectionList |\n * | `image` (expo-image) | NativeAvatar, NativeImage | React Native `Image` |\n * | `reanimated` (Reanimated 4) | Toast, Drawer, Skeleton | React Native `Animated` |\n * | `glass` (expo-glass-effect) | Toast, NativeGlassSurface, update banner | the solid surface |\n * | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |\n * | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |\n * | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |\n * | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |\n * | `haptics` (expo-haptics) | useHaptics, usePressFeedback, NativeComposerBar (send) | no haptics |\n * | `swipeable` (react-native-gesture-handler's `ReanimatedSwipeable`) | NativeSwipeRow, InboxPage: the swipe to a row's actions | the actions on long press and as accessibility actions |\n * | `navigation` (React Navigation's theming: from `expo-router` in an Expo Router app, which bundles its own copy; `@react-navigation/native` otherwise) | GenesisNativeApp: headers and tab bars in the brand's light and dark colors | React Navigation's default (light) theme |\n *\n * The props below are written structurally (no import of the optional\n * packages), so this package builds and type-checks without any of them.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { GenesisHapticsModule } from \"./hooks/use-haptics\";\nimport type { ColorValue } from \"react-native\";\nimport type { NativeIconName } from \"./icon-names\";\n\n/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */\nexport interface GenesisListProps<T> {\n data: readonly T[];\n renderItem: (info: { item: T; index: number }) => ReactNode;\n keyExtractor?: (item: T, index: number) => string;\n getItemType?: (item: T, index: number) => string | number | undefined;\n stickyHeaderIndices?: number[];\n /** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */\n stickyHeaderConfig?: { offset?: number };\n ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;\n ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;\n contentContainerStyle?: Record<string, unknown>;\n refreshing?: boolean;\n onRefresh?: () => void;\n refreshControl?: ReactNode;\n testID?: string;\n}\n\n/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */\nexport type GenesisListComponent = ComponentType<GenesisListProps<any>>;\n\n/** The expo-image `Image` props Genesis passes. */\nexport interface GenesisImageProps {\n source: { uri: string } | number | null;\n style?: unknown;\n contentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n cachePolicy?: \"none\" | \"disk\" | \"memory\" | \"memory-disk\";\n placeholder?: unknown;\n placeholderContentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n transition?: number | null;\n recyclingKey?: string | null;\n priority?: \"low\" | \"normal\" | \"high\" | null;\n onError?: (event: unknown) => void;\n onLoad?: (event: unknown) => void;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `Image` from `expo-image`. */\nexport type GenesisImageComponent = ComponentType<GenesisImageProps>;\n\n/** `import * as Reanimated from \"react-native-reanimated\"` (v4). Only what Genesis calls is listed. */\nexport interface GenesisReanimatedModule {\n default: { View: ComponentType<any> };\n useSharedValue: <V>(initial: V) => { value: V };\n useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;\n withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n /** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */\n withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** A React Navigation theme (`ReactNavigation.Theme`): the colors Genesis sets, and the fonts it keeps. */\nexport interface GenesisNavigationTheme {\n dark: boolean;\n colors: { primary: ColorValue; background: ColorValue; card: ColorValue; text: ColorValue; border: ColorValue; notification: ColorValue };\n fonts?: unknown;\n}\n\n/**\n * React Navigation's theming. In an Expo Router app take it from `expo-router`: it bundles its own\n * React Navigation, and its navigators read that copy's theme, not `@react-navigation/native`'s.\n */\nexport interface GenesisNavigationModule {\n ThemeProvider: ComponentType<{ value: any; children: ReactNode }>;\n DefaultTheme: GenesisNavigationTheme;\n DarkTheme: GenesisNavigationTheme;\n}\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\n/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n automaticOffset?: boolean;\n children?: ReactNode;\n testID?: string;\n}>;\n\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n navigation?: GenesisNavigationModule;\n /** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: \"translate-with-padding\"`). */\n keyboardAvoidingView?: KeyboardAvoidingLike;\n /** expo-haptics (`import * as Haptics from \"expo-haptics\"`): `useHaptics`, `usePressFeedback`, and the primitives that answer a touch. Without it, no haptics. */\n haptics?: GenesisHapticsModule;\n /** react-native-gesture-handler's `ReanimatedSwipeable`: NativeSwipeRow and InboxPage's rows. Without it, no swipe; the actions stay on long press. */\n swipeable?: GenesisSwipeableComponent;\n}\n\n/** The props NativeSwipeRow passes; `ReanimatedSwipeable` takes them, and its ref has `close()`. */\nexport type GenesisSwipeableComponent = ComponentType<{\n ref?: unknown;\n testID?: string;\n friction?: number;\n overshootLeft?: boolean;\n overshootRight?: boolean;\n onSwipeableWillOpen?: () => void;\n renderLeftActions?: () => ReactNode;\n renderRightActions?: () => ReactNode;\n children?: ReactNode;\n}>;\n\nconst EMPTY: GenesisModules = Object.freeze({});\nconst GenesisModulesContext = createContext<GenesisModules>(EMPTY);\n\nexport interface GenesisModulesProviderProps {\n modules: GenesisModules;\n children: ReactNode;\n}\n\n/**\n * Pass the optional native modules the app has installed. Nested providers\n * merge: an inner one adds to or replaces what an outer one gave. Define the\n * `modules` object once at module scope (as the starter's\n * `src/lib/native-modules.ts` does): a new inline object on every render\n * re-renders every component that reads it.\n */\nexport function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps) {\n const outer = useContext(GenesisModulesContext);\n const value = useMemo(() => (outer === EMPTY ? modules : { ...outer, ...modules }), [outer, modules]);\n return createElement(GenesisModulesContext.Provider, { value }, children);\n}\n\n/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */\nexport function useGenesisModules(): GenesisModules {\n return useContext(GenesisModulesContext);\n}\n","/**\n * Haptics, one way in: the app passes expo-haptics once, as `GenesisModules.haptics`, and every\n * Genesis primitive (and the app's own pieces) plays the same kinds of feedback through\n * `useHaptics()`. Without the module nothing plays, and nothing throws.\n *\n * import * as Haptics from \"expo-haptics\";\n * <GenesisModulesProvider modules={{ haptics: Haptics }}>\n *\n * const haptic = useHaptics();\n * haptic(\"select\");\n *\n * Kinds follow the platforms' own vocabulary: a light, medium or heavy impact (a press, a swipe\n * passing its threshold, a long press opening a menu), a selection tick (a picker or a tab\n * changing), and a success, warning or error notification. The OS's own haptics setting applies;\n * Reduce Motion doesn't turn haptics off (they're not motion).\n *\n * @stability Beta\n */\nimport { useCallback } from \"react\";\nimport { useGenesisModules } from \"../native-modules\";\n\n/** What a haptic says. */\nexport type HapticKind = \"light\" | \"medium\" | \"heavy\" | \"select\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * `import * as Haptics from \"expo-haptics\"`: the parts Genesis calls, written structurally (the\n * same shape as genesis-chat's `HapticsLike`, so one module serves both).\n */\nexport interface GenesisHapticsModule {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown; Heavy?: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** Plays a haptic on the module given; never throws and never rejects. No module, no haptic. */\nexport function playHaptic(haptics: GenesisHapticsModule | undefined, kind: HapticKind): void {\n if (!haptics) return;\n try {\n const as = (s: unknown) => s as never;\n const styles = haptics.ImpactFeedbackStyle;\n const notes = haptics.NotificationFeedbackType;\n const p =\n kind === \"light\"\n ? haptics.impactAsync(as(styles.Light))\n : kind === \"medium\"\n ? haptics.impactAsync(as(styles.Medium))\n : kind === \"heavy\"\n ? haptics.impactAsync(as(styles.Heavy ?? styles.Medium))\n : kind === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(as(kind === \"success\" ? notes.Success : kind === \"warning\" ? notes.Warning : notes.Error));\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n\n/** A function that plays a haptic through the app's `GenesisModules.haptics`. Stable across renders. */\nexport function useHaptics(): (kind: HapticKind) => void {\n const { haptics } = useGenesisModules();\n return useCallback((kind: HapticKind) => playHaptic(haptics, kind), [haptics]);\n}\n","/**\n * usePressFeedback: how a pressable answers a touch, the same for buttons, rows and cards. It\n * shrinks a little while held (on the motion tokens' `press` duration) and springs back on release\n * (`snappy`), and can play a haptic when the press lands. Under Reduce Motion (or brand motion\n * `none`) it dims instead of moving.\n *\n * const press = usePressFeedback({ haptic: \"light\" });\n * <Pressable onPress={save} onPressIn={press.onPressIn} onPressOut={press.onPressOut}>\n * <Animated.View style={press.style}>…</Animated.View>\n * </Pressable>\n *\n * The haptic plays on `onPressIn` for `select` (a tick under the finger, as iOS does). Any other\n * kind plays when you call `press.confirm()` from `onPress`, so a press cancelled by scrolling\n * stays quiet.\n *\n * Built on React Native's `Animated`, so it works without Reanimated.\n *\n * @stability Beta\n */\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useMotion, type UseMotionOptions } from \"./use-motion\";\nimport { useHaptics, type HapticKind } from \"./use-haptics\";\n\ntype AnimatedValue = InstanceType<typeof Animated.Value>;\n\nexport interface PressFeedbackOptions {\n /** A haptic when the press counts (`confirm()`), or `select` as a tick on press-in. Default none. */\n haptic?: HapticKind | false;\n /** How far it shrinks while held. Default 0.97. */\n scale?: number;\n /** Under Reduce Motion: how far it dims while held. Default 0.6. */\n dimTo?: number;\n /** No feedback (a disabled button). */\n disabled?: boolean;\n /** The brand's motion level, as `useMotion` takes it. */\n level?: UseMotionOptions[\"level\"];\n}\n\nexport interface PressFeedback {\n onPressIn: () => void;\n onPressOut: () => void;\n /** Call from `onPress`: plays the haptic for a press that counted. */\n confirm: () => void;\n /** For an `Animated.View` around the pressable's content. */\n style: { transform?: { scale: AnimatedValue }[]; opacity?: AnimatedValue };\n}\n\nexport function usePressFeedback({ haptic = false, scale = 0.97, dimTo = 0.6, disabled = false, level }: PressFeedbackOptions = {}): PressFeedback {\n const motion = useMotion(level ? { level } : {});\n const play = useHaptics();\n const value = useRef(new Animated.Value(1)).current;\n const reduced = motion.reduced;\n\n const to = useCallback(\n (target: number, held: boolean) => {\n if (held || reduced) {\n Animated.timing(value, { toValue: target, duration: motion.duration.press, useNativeDriver: true }).start();\n } else {\n const s = motion.spring.snappy;\n Animated.spring(value, { toValue: target, damping: s.damping, stiffness: s.stiffness, mass: s.mass, useNativeDriver: true }).start();\n }\n },\n [value, motion, reduced],\n );\n\n const onPressIn = useCallback(() => {\n if (disabled) return;\n to(reduced ? dimTo : scale, true);\n if (haptic === \"select\") play(\"select\");\n }, [disabled, reduced, dimTo, scale, to, haptic, play]);\n\n // Always let go, even if the pressable was disabled mid-press (a send that started), and start\n // from rest whenever it's disabled, so it never comes back still shrunk.\n const onPressOut = useCallback(() => to(1, false), [to]);\n useEffect(() => {\n if (disabled) value.setValue(1);\n }, [disabled, value]);\n\n const confirm = useCallback(() => {\n if (!disabled && haptic && haptic !== \"select\") play(haptic);\n }, [disabled, haptic, play]);\n\n const style = useMemo(() => (disabled ? {} : reduced ? { opacity: value } : { transform: [{ scale: value }] }), [disabled, reduced, value]);\n\n return { onPressIn, onPressOut, confirm, style };\n}\n","/**\n * useThemeMode — read the active color scheme (light / dark / unset).\n *\n * Wraps RN's `Appearance.getColorScheme()` + `Appearance.addChangeListener`\n * with a stable React hook so consumers don't have to wire it themselves.\n *\n * Use this in tokens-aware components when you need to choose between\n * light/dark variants OUTSIDE of Tailwind's `dark:` modifier (e.g., to pick\n * an asset, run an extra-color computation, or set StatusBar style).\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { Appearance, type ColorSchemeName } from \"react-native\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport function useThemeMode(): ThemeMode {\n const [scheme, setScheme] = useState<ColorSchemeName>(\n Appearance.getColorScheme(),\n );\n\n useEffect(() => {\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(colorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return scheme === \"dark\" ? \"dark\" : \"light\";\n}\n","/**\n * useThemeRoles — the theme roles (background, label, separator, tint…) as\n * colors for this platform and color scheme.\n *\n * On iOS every neutral role is a system color through `PlatformColor`, so a\n * screen follows light and dark mode, increased contrast and accessibility\n * settings like the system apps. On Android the roles are the Genesis tokens\n * for the current scheme, or Material You colors on Android 12+ with\n * `materialYou`. A brand sets `tint`.\n *\n * Use it for `style` props and anything Tailwind classes don't reach, such as\n * navigation header and tab bar options.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport { Platform, PlatformColor, type ColorValue } from \"react-native\";\nimport { resolveThemeRoles, type ThemeRole } from \"@marktiderman/genesis-design-system\";\nimport { useThemeMode } from \"./use-theme-mode\";\n\nexport type ThemeRoleColors = Record<ThemeRole, ColorValue>;\n\nexport interface UseThemeRolesOptions {\n /** The brand's primary color. */\n tint?: string;\n /** On Android 12+, use Material You dynamic colors for the neutral roles (and the tint, unless `tint` is set). Ignored elsewhere. */\n materialYou?: boolean;\n}\n\nexport function useThemeRoles(options: UseThemeRolesOptions = {}): ThemeRoleColors {\n const scheme = useThemeMode();\n const { tint, materialYou = false } = options;\n const androidDynamic = materialYou && Platform.OS === \"android\" && Number(Platform.Version) >= 31;\n return useMemo(\n () =>\n resolveThemeRoles<ColorValue>({\n target: Platform.OS === \"ios\" ? \"ios\" : \"android\",\n scheme,\n platformColor: (name) => PlatformColor(name),\n tint,\n androidDynamic,\n }),\n [scheme, tint, androidDynamic],\n );\n}\n\n/** The colour of a message you sent, on every thread on the phone. Its text is `text-primary-foreground`. */\nexport const sentBubbleColor = <C,>(roles: { tint: C }): C => roles.tint;\n"]}
1
+ {"version":3,"sources":["../src/hooks/use-reduced-motion.ts","../src/hooks/use-motion.ts","../src/native-modules.tsx","../src/hooks/use-haptics.ts","../src/hooks/use-press-feedback.ts","../src/hooks/use-theme-mode.ts","../src/hooks/use-theme-roles.ts"],"names":["useMemo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;AAAA,IACH,CAAC,MAAA,EAAQ,IAAA,EAAM,cAAc;AAAA,GAC/B;AACF;AAGO,IAAM,eAAA,GAAkB,CAAK,KAAA,KAA0B,KAAA,CAAM","file":"chunk-PMS2V46D.js","sourcesContent":["/**\n * useReducedMotion — subscribe to the OS reduce-motion preference.\n *\n * Returns `true` when the user has enabled reduce-motion at the OS level,\n * and follows the setting while the app runs (Reanimated's own hook reads it\n * once at launch). Components that animate (Sheet, Drawer, Toast, Skeleton)\n * honor it by skipping non-essential transitions and snapping into the\n * final state.\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { AccessibilityInfo } from \"react-native\";\n\n// The last answer anyone got: a component mounting later (a toast, an open\n// drawer) starts from it instead of animating for a frame before it hears.\nlet lastKnown = false;\n\n/** Tests only: forget the last answer. Not exported from the package. */\nexport function __resetReducedMotion() {\n lastKnown = false;\n}\n\nexport function useReducedMotion(): boolean {\n const [reduced, setReduced] = useState(lastKnown);\n\n useEffect(() => {\n let mounted = true;\n const set = (v: boolean) => {\n lastKnown = v;\n if (mounted) setReduced(v);\n };\n AccessibilityInfo.isReduceMotionEnabled()\n .then(set)\n // Some runtimes (web, older Android) reject when the accessibility\n // manager isn't wired up: treat that as \"no preference\".\n .catch(() => {});\n const sub = AccessibilityInfo.addEventListener(\"reduceMotionChanged\", set);\n return () => {\n mounted = false;\n sub?.remove?.();\n };\n }, []);\n\n return reduced;\n}\n","/**\n * useMotion — the shared motion tokens (genesis-design-system's\n * `resolveMotion`), with the OS's reduce-motion setting applied.\n *\n * Every Genesis primitive that moves reads its durations, easings and springs\n * from here instead of its own constants, so motion is defined once for web\n * and native. Under Reduce Motion every duration is 0 and `animateMotion`\n * returns the final value, so a component lands without moving.\n *\n * The brand's motion level isn't read from a provider yet: pass `level` (a\n * brand whose design system chose `none` passes `\"none\"`). Without it,\n * `calm`.\n *\n * On the JS thread (an effect, a PanResponder), `animateMotion`:\n *\n * ```tsx\n * const motion = useMotion();\n * const { reanimated: R } = useGenesisModules();\n * opacity.value = animateMotion(R, motion, 1, { duration: \"fast\", easing: \"decelerate\" });\n * ```\n *\n * Inside a worklet (a gesture's `onEnd`, an animated scroll handler), build\n * the config with the worklet-safe `motionSpring` / `motionTiming` and call\n * Reanimated yourself:\n *\n * ```tsx\n * .onEnd((e) => { x.value = withSpring(0, motionSpring(motion, \"snappy\", e.velocityX)); })\n * opacity.value = withTiming(1, motionTiming(motion, \"fast\", Easing, \"decelerate\"));\n * ```\n *\n * A repeating animation checks `motion.reduced` first: a zero-length repeat\n * would flash every frame.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport {\n resolveMotion,\n type MotionDurations,\n type MotionEasings,\n type MotionLevel,\n type MotionSprings,\n type MotionTokens,\n} from \"@marktiderman/genesis-design-system/tokens/motion\";\nimport type { GenesisReanimatedModule } from \"../native-modules\";\nimport { useReducedMotion } from \"./use-reduced-motion\";\n\nexport interface UseMotionOptions {\n /** The brand's motion level. Default `calm`; `none` holds everything still, like Reduce Motion. */\n level?: MotionLevel;\n}\n\nexport function useMotion(options: UseMotionOptions = {}): MotionTokens {\n const reducedMotion = useReducedMotion();\n const level = options.level ?? \"calm\";\n return useMemo(() => resolveMotion(level, { reducedMotion }), [level, reducedMotion]);\n}\n\n/** How to get there: a named spring (keeps a gesture's velocity), or a named duration and easing. */\nexport type MotionHow =\n | { spring: keyof MotionSprings; velocity?: number; duration?: never; easing?: never }\n | { duration: keyof MotionDurations; easing?: keyof MotionEasings; spring?: never; velocity?: never };\n\n/** What `motionSpring` gives `withSpring`. */\nexport interface MotionSpringConfig {\n damping: number;\n stiffness: number;\n mass: number;\n velocity?: number;\n}\n\n/** What `motionTiming` gives `withTiming`. */\nexport interface MotionTimingConfig {\n duration: number;\n easing?: unknown;\n}\n\n/**\n * A `withSpring` config from a named spring. Worklet-safe (plain data in,\n * plain data out). Under reduced motion it's the stiff, critically damped\n * spring that settles in a few frames; to not move at all, check\n * `motion.reduced` and assign the value.\n */\nexport function motionSpring(motion: MotionTokens, name: keyof MotionSprings, velocity?: number): MotionSpringConfig {\n \"worklet\";\n const s = motion.spring[name];\n return typeof velocity === \"number\" && !motion.reduced\n ? { damping: s.damping, stiffness: s.stiffness, mass: s.mass, velocity }\n : { damping: s.damping, stiffness: s.stiffness, mass: s.mass };\n}\n\n/**\n * A `withTiming` config from a named duration and easing. Pass Reanimated's\n * `Easing` (`R.Easing`, or `Easing` imported in a worklet) so the token's\n * curve is used; a module without `Easing.bezier` gets Reanimated's default\n * curve. Worklet-safe.\n */\nexport function motionTiming(\n motion: MotionTokens,\n duration: keyof MotionDurations,\n Easing: Pick<GenesisReanimatedModule[\"Easing\"], \"bezier\"> | undefined,\n easing: keyof MotionEasings = \"out\",\n): MotionTimingConfig {\n \"worklet\";\n const [x1, y1, x2, y2] = motion.easing[easing];\n const curve = Easing?.bezier ? Easing.bezier(x1, y1, x2, y2) : undefined;\n return curve === undefined ? { duration: motion.duration[duration] } : { duration: motion.duration[duration], easing: curve };\n}\n\n/**\n * A Reanimated animation to `toValue` with the motion tokens, for a shared\n * value on the JS thread: `x.value = animateMotion(R, motion, 0, { spring: \"smooth\" })`.\n * Under reduced motion it returns `toValue` itself, so nothing moves.\n *\n * It takes no completion callback: Reanimated runs one on the UI thread, so\n * it must be a worklet, and the reduced path couldn't keep that promise. To\n * act when an animation ends, call `withSpring` / `withTiming` yourself with\n * `motionSpring` / `motionTiming` and a worklet callback. A module without\n * `withSpring` (an older one, a test fake) gets a `withTiming` at `base`.\n */\nexport function animateMotion(R: GenesisReanimatedModule, motion: MotionTokens, toValue: number, how: MotionHow): number {\n if (motion.reduced) return toValue;\n if (how.spring !== undefined) {\n if (R.withSpring) return R.withSpring(toValue, motionSpring(motion, how.spring, how.velocity));\n return R.withTiming(toValue, motionTiming(motion, \"base\", R.Easing));\n }\n return R.withTiming(toValue, motionTiming(motion, how.duration, R.Easing, how.easing));\n}\n","/**\n * GenesisModulesProvider — the native modules an app opts in to, passed in\n * once near the root. Genesis never `require()`s these itself: an app that\n * has a module installed imports it and hands it over, and every component\n * that could use it falls back to plain React Native when it isn't here.\n *\n * import { FlashList } from \"@shopify/flash-list\";\n * import { Image } from \"expo-image\";\n * import * as Reanimated from \"react-native-reanimated\";\n * import * as GlassEffect from \"expo-glass-effect\";\n * import { SymbolView } from \"expo-symbols\";\n * import DateTimePicker from \"@expo/ui/community/datetime-picker\";\n * import { lucideIcons } from \"@marktiderman/genesis-ui-native/icons/lucide\";\n * import { DarkTheme, DefaultTheme, ThemeProvider } from \"expo-router\";\n *\n * // At module scope, not inline:\n * const modules = { list: FlashList, image: Image, reanimated: Reanimated, glass: GlassEffect,\n * symbol: SymbolView, icons: lucideIcons, datePicker: DateTimePicker,\n * navigation: { ThemeProvider, DefaultTheme, DarkTheme } };\n * <GenesisModulesProvider modules={modules}>…</GenesisModulesProvider>\n *\n * (`GenesisNativeApp` from `@marktiderman/genesis-native` takes the same\n * object as its `modules` prop and mounts this for you.)\n *\n * | Module | Used by | Without it |\n * | ------------------------------ | ---------------------------------------- | ----------------------------- |\n * | `list` (FlashList v2) | NativeResourcePage, NotificationsPage | FlatList / SectionList |\n * | `image` (expo-image) | NativeAvatar, NativeImage | React Native `Image` |\n * | `reanimated` (Reanimated 4) | Toast, Drawer, Skeleton | React Native `Animated` |\n * | `glass` (expo-glass-effect) | Toast, NativeGlassSurface, update banner | the solid surface |\n * | `symbol` (expo-symbols) | NativeIcon on iOS | `icons` (lucide) |\n * | `icons` (a lucide icon set) | NativeIcon on Android, web, and as the SF Symbol fallback | a blank space of the icon's size |\n * | `datePicker` (@expo/ui) | NativeDatePicker, NativeTimePicker | @react-native-community/datetimepicker |\n * | `keyboardAvoidingView` (react-native-keyboard-controller's `KeyboardAvoidingView`) | ThreadPage: the composer follows the keyboard frame by frame (`translate-with-padding`) | React Native `KeyboardAvoidingView` |\n * | `haptics` (expo-haptics) | useHaptics, usePressFeedback, NativeComposerBar (send) | no haptics |\n * | `swipeable` (react-native-gesture-handler's `ReanimatedSwipeable`) | NativeSwipeRow, InboxPage: the swipe to a row's actions | the actions on long press and as accessibility actions |\n * | `navigation` (React Navigation's theming: from `expo-router` in an Expo Router app, which bundles its own copy; `@react-navigation/native` otherwise) | GenesisNativeApp: headers and tab bars in the brand's light and dark colors | React Navigation's default (light) theme |\n *\n * The props below are written structurally (no import of the optional\n * packages), so this package builds and type-checks without any of them.\n *\n * @stability Beta\n */\nimport { createContext, createElement, useContext, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { GenesisHapticsModule } from \"./hooks/use-haptics\";\nimport type { ColorValue } from \"react-native\";\nimport type { NativeIconName } from \"./icon-names\";\n\n/** The FlatList props Genesis lists pass; FlashList v2 takes the same ones. */\nexport interface GenesisListProps<T> {\n data: readonly T[];\n renderItem: (info: { item: T; index: number }) => ReactNode;\n keyExtractor?: (item: T, index: number) => string;\n getItemType?: (item: T, index: number) => string | number | undefined;\n stickyHeaderIndices?: number[];\n /** FlashList v2's: `offset` moves sticky headers down from the list's top (under a native header). */\n stickyHeaderConfig?: { offset?: number };\n ListHeaderComponent?: ReactNode | ComponentType<unknown> | null;\n ListEmptyComponent?: ReactNode | ComponentType<unknown> | null;\n contentContainerStyle?: Record<string, unknown>;\n refreshing?: boolean;\n onRefresh?: () => void;\n refreshControl?: ReactNode;\n testID?: string;\n}\n\n/** `FlashList` from `@shopify/flash-list` v2 (New Architecture only; no `estimatedItemSize`). */\nexport type GenesisListComponent = ComponentType<GenesisListProps<any>>;\n\n/** The expo-image `Image` props Genesis passes. */\nexport interface GenesisImageProps {\n /** `cacheKey` keys the cache in place of the URL. */\n source: { uri: string; cacheKey?: string } | number | null;\n style?: unknown;\n contentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n cachePolicy?: \"none\" | \"disk\" | \"memory\" | \"memory-disk\";\n placeholder?: unknown;\n placeholderContentFit?: \"cover\" | \"contain\" | \"fill\" | \"none\" | \"scale-down\";\n transition?: number | null;\n recyclingKey?: string | null;\n priority?: \"low\" | \"normal\" | \"high\" | null;\n onError?: (event: unknown) => void;\n onLoad?: (event: unknown) => void;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `Image` from `expo-image`. */\nexport type GenesisImageComponent = ComponentType<GenesisImageProps>;\n\n/** `import * as Reanimated from \"react-native-reanimated\"` (v4). Only what Genesis calls is listed. */\nexport interface GenesisReanimatedModule {\n default: { View: ComponentType<any> };\n useSharedValue: <V>(initial: V) => { value: V };\n useAnimatedStyle: (updater: () => Record<string, unknown>, deps?: unknown[]) => Record<string, unknown>;\n withTiming: (toValue: number, config?: { duration?: number; easing?: unknown; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n /** Optional so older injected modules and test fakes still fit; `animateMotion` falls back to `withTiming`. */\n withSpring?: (toValue: number, config?: { damping?: number; stiffness?: number; mass?: number; velocity?: number; reduceMotion?: unknown }, callback?: (finished?: boolean) => void) => number;\n withRepeat: (animation: number, numberOfReps?: number, reverse?: boolean, callback?: unknown, reduceMotion?: unknown) => number;\n cancelAnimation: (value: { value: unknown }) => void;\n Easing: { inOut: (easing: unknown) => unknown; ease: unknown; out: (easing: unknown) => unknown; cubic: unknown; bezier?: (x1: number, y1: number, x2: number, y2: number) => unknown };\n ReduceMotion?: { System: unknown; Always: unknown; Never: unknown };\n}\n\n/** `import * as GlassEffect from \"expo-glass-effect\"`. */\nexport interface GenesisGlassModule {\n GlassView: ComponentType<{\n style?: unknown;\n glassEffectStyle?: \"regular\" | \"clear\" | \"none\";\n tintColor?: string;\n isInteractive?: boolean;\n colorScheme?: \"auto\" | \"light\" | \"dark\";\n children?: ReactNode;\n testID?: string;\n pointerEvents?: \"box-none\" | \"none\" | \"box-only\" | \"auto\";\n }>;\n isLiquidGlassAvailable: () => boolean;\n isGlassEffectAPIAvailable: () => boolean;\n}\n\n/** The expo-symbols `SymbolView` props Genesis passes. */\nexport interface GenesisSymbolProps {\n name: string;\n size?: number;\n tintColor?: ColorValue;\n type?: \"monochrome\" | \"hierarchical\" | \"palette\" | \"multicolor\";\n weight?: string;\n fallback?: ReactNode;\n style?: unknown;\n accessible?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n\n/** `SymbolView` from `expo-symbols`. */\nexport type GenesisSymbolComponent = ComponentType<GenesisSymbolProps>;\n\n/** A lucide-style icon component: `size`, `color`, `strokeWidth`. */\nexport type GenesisIconComponent = ComponentType<{ size?: number; color?: ColorValue; fill?: ColorValue; strokeWidth?: number; testID?: string }>;\n\n/** Icon components by semantic name (`lucideIcons` from `/icons/lucide` is one). Missing names draw nothing. */\nexport type GenesisIconSet = Partial<Record<NativeIconName, GenesisIconComponent>>;\n\n/** The `@expo/ui/community/datetime-picker` props Genesis passes (a drop-in for the community picker). */\nexport interface GenesisDatePickerProps {\n value: Date;\n mode: \"date\" | \"time\";\n display?: \"default\" | \"compact\" | \"spinner\" | \"inline\";\n presentation?: \"inline\" | \"dialog\";\n disabled?: boolean;\n onValueChange?: (event: unknown, date: Date) => void;\n onDismiss?: () => void;\n style?: unknown;\n testID?: string;\n}\n\n/** The default export of `@expo/ui/community/datetime-picker`. */\nexport type GenesisDatePickerComponent = ComponentType<GenesisDatePickerProps>;\n\n/** A React Navigation theme (`ReactNavigation.Theme`): the colors Genesis sets, and the fonts it keeps. */\nexport interface GenesisNavigationTheme {\n dark: boolean;\n colors: { primary: ColorValue; background: ColorValue; card: ColorValue; text: ColorValue; border: ColorValue; notification: ColorValue };\n fonts?: unknown;\n}\n\n/**\n * React Navigation's theming. In an Expo Router app take it from `expo-router`: it bundles its own\n * React Navigation, and its navigators read that copy's theme, not `@react-navigation/native`'s.\n */\nexport interface GenesisNavigationModule {\n ThemeProvider: ComponentType<{ value: any; children: ReactNode }>;\n DefaultTheme: GenesisNavigationTheme;\n DarkTheme: GenesisNavigationTheme;\n}\n\n/** Every optional native module Genesis components can use. Each is optional on its own. */\n/** react-native-keyboard-controller's `KeyboardAvoidingView`, written structurally (the same shape as genesis-chat's). */\nexport type KeyboardAvoidingLike = ComponentType<{\n behavior?: \"height\" | \"padding\" | \"position\" | \"translate-with-padding\";\n keyboardVerticalOffset?: number;\n automaticOffset?: boolean;\n children?: ReactNode;\n testID?: string;\n}>;\n\nexport interface GenesisModules {\n list?: GenesisListComponent;\n image?: GenesisImageComponent;\n reanimated?: GenesisReanimatedModule;\n glass?: GenesisGlassModule;\n symbol?: GenesisSymbolComponent;\n icons?: GenesisIconSet;\n datePicker?: GenesisDatePickerComponent;\n navigation?: GenesisNavigationModule;\n /** react-native-keyboard-controller's `KeyboardAvoidingView` (it takes `behavior: \"translate-with-padding\"`). */\n keyboardAvoidingView?: KeyboardAvoidingLike;\n /** expo-haptics (`import * as Haptics from \"expo-haptics\"`): `useHaptics`, `usePressFeedback`, and the primitives that answer a touch. Without it, no haptics. */\n haptics?: GenesisHapticsModule;\n /** react-native-gesture-handler's `ReanimatedSwipeable`: NativeSwipeRow and InboxPage's rows. Without it, no swipe; the actions stay on long press. */\n swipeable?: GenesisSwipeableComponent;\n}\n\n/** The props NativeSwipeRow passes; `ReanimatedSwipeable` takes them, and its ref has `close()`. */\nexport type GenesisSwipeableComponent = ComponentType<{\n ref?: unknown;\n testID?: string;\n friction?: number;\n overshootLeft?: boolean;\n overshootRight?: boolean;\n onSwipeableWillOpen?: () => void;\n renderLeftActions?: () => ReactNode;\n renderRightActions?: () => ReactNode;\n children?: ReactNode;\n}>;\n\nconst EMPTY: GenesisModules = Object.freeze({});\nconst GenesisModulesContext = createContext<GenesisModules>(EMPTY);\n\nexport interface GenesisModulesProviderProps {\n modules: GenesisModules;\n children: ReactNode;\n}\n\n/**\n * Pass the optional native modules the app has installed. Nested providers\n * merge: an inner one adds to or replaces what an outer one gave. Define the\n * `modules` object once at module scope (as the starter's\n * `src/lib/native-modules.ts` does): a new inline object on every render\n * re-renders every component that reads it.\n */\nexport function GenesisModulesProvider({ modules, children }: GenesisModulesProviderProps) {\n const outer = useContext(GenesisModulesContext);\n const value = useMemo(() => (outer === EMPTY ? modules : { ...outer, ...modules }), [outer, modules]);\n return createElement(GenesisModulesContext.Provider, { value }, children);\n}\n\n/** The modules given to the nearest `GenesisModulesProvider`; `{}` without one. */\nexport function useGenesisModules(): GenesisModules {\n return useContext(GenesisModulesContext);\n}\n","/**\n * Haptics, one way in: the app passes expo-haptics once, as `GenesisModules.haptics`, and every\n * Genesis primitive (and the app's own pieces) plays the same kinds of feedback through\n * `useHaptics()`. Without the module nothing plays, and nothing throws.\n *\n * import * as Haptics from \"expo-haptics\";\n * <GenesisModulesProvider modules={{ haptics: Haptics }}>\n *\n * const haptic = useHaptics();\n * haptic(\"select\");\n *\n * Kinds follow the platforms' own vocabulary: a light, medium or heavy impact (a press, a swipe\n * passing its threshold, a long press opening a menu), a selection tick (a picker or a tab\n * changing), and a success, warning or error notification. The OS's own haptics setting applies;\n * Reduce Motion doesn't turn haptics off (they're not motion).\n *\n * @stability Beta\n */\nimport { useCallback } from \"react\";\nimport { useGenesisModules } from \"../native-modules\";\n\n/** What a haptic says. */\nexport type HapticKind = \"light\" | \"medium\" | \"heavy\" | \"select\" | \"success\" | \"warning\" | \"error\";\n\n/**\n * `import * as Haptics from \"expo-haptics\"`: the parts Genesis calls, written structurally (the\n * same shape as genesis-chat's `HapticsLike`, so one module serves both).\n */\nexport interface GenesisHapticsModule {\n impactAsync(style?: never): Promise<void>;\n selectionAsync(): Promise<void>;\n notificationAsync(type?: never): Promise<void>;\n ImpactFeedbackStyle: { Light: unknown; Medium: unknown; Heavy?: unknown };\n NotificationFeedbackType: { Success: unknown; Warning: unknown; Error: unknown };\n}\n\n/** Plays a haptic on the module given; never throws and never rejects. No module, no haptic. */\nexport function playHaptic(haptics: GenesisHapticsModule | undefined, kind: HapticKind): void {\n if (!haptics) return;\n try {\n const as = (s: unknown) => s as never;\n const styles = haptics.ImpactFeedbackStyle;\n const notes = haptics.NotificationFeedbackType;\n const p =\n kind === \"light\"\n ? haptics.impactAsync(as(styles.Light))\n : kind === \"medium\"\n ? haptics.impactAsync(as(styles.Medium))\n : kind === \"heavy\"\n ? haptics.impactAsync(as(styles.Heavy ?? styles.Medium))\n : kind === \"select\"\n ? haptics.selectionAsync()\n : haptics.notificationAsync(as(kind === \"success\" ? notes.Success : kind === \"warning\" ? notes.Warning : notes.Error));\n void p?.catch?.(() => undefined);\n } catch {\n // A haptic is never worth an error.\n }\n}\n\n/** A function that plays a haptic through the app's `GenesisModules.haptics`. Stable across renders. */\nexport function useHaptics(): (kind: HapticKind) => void {\n const { haptics } = useGenesisModules();\n return useCallback((kind: HapticKind) => playHaptic(haptics, kind), [haptics]);\n}\n","/**\n * usePressFeedback: how a pressable answers a touch, the same for buttons, rows and cards. It\n * shrinks a little while held (on the motion tokens' `press` duration) and springs back on release\n * (`snappy`), and can play a haptic when the press lands. Under Reduce Motion (or brand motion\n * `none`) it dims instead of moving.\n *\n * const press = usePressFeedback({ haptic: \"light\" });\n * <Pressable onPress={save} onPressIn={press.onPressIn} onPressOut={press.onPressOut}>\n * <Animated.View style={press.style}>…</Animated.View>\n * </Pressable>\n *\n * The haptic plays on `onPressIn` for `select` (a tick under the finger, as iOS does). Any other\n * kind plays when you call `press.confirm()` from `onPress`, so a press cancelled by scrolling\n * stays quiet.\n *\n * Built on React Native's `Animated`, so it works without Reanimated.\n *\n * @stability Beta\n */\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Animated } from \"react-native\";\nimport { useMotion, type UseMotionOptions } from \"./use-motion\";\nimport { useHaptics, type HapticKind } from \"./use-haptics\";\n\ntype AnimatedValue = InstanceType<typeof Animated.Value>;\n\nexport interface PressFeedbackOptions {\n /** A haptic when the press counts (`confirm()`), or `select` as a tick on press-in. Default none. */\n haptic?: HapticKind | false;\n /** How far it shrinks while held. Default 0.97. */\n scale?: number;\n /** Under Reduce Motion: how far it dims while held. Default 0.6. */\n dimTo?: number;\n /** No feedback (a disabled button). */\n disabled?: boolean;\n /** The brand's motion level, as `useMotion` takes it. */\n level?: UseMotionOptions[\"level\"];\n}\n\nexport interface PressFeedback {\n onPressIn: () => void;\n onPressOut: () => void;\n /** Call from `onPress`: plays the haptic for a press that counted. */\n confirm: () => void;\n /** For an `Animated.View` around the pressable's content. */\n style: { transform?: { scale: AnimatedValue }[]; opacity?: AnimatedValue };\n}\n\nexport function usePressFeedback({ haptic = false, scale = 0.97, dimTo = 0.6, disabled = false, level }: PressFeedbackOptions = {}): PressFeedback {\n const motion = useMotion(level ? { level } : {});\n const play = useHaptics();\n const value = useRef(new Animated.Value(1)).current;\n const reduced = motion.reduced;\n\n const to = useCallback(\n (target: number, held: boolean) => {\n if (held || reduced) {\n Animated.timing(value, { toValue: target, duration: motion.duration.press, useNativeDriver: true }).start();\n } else {\n const s = motion.spring.snappy;\n Animated.spring(value, { toValue: target, damping: s.damping, stiffness: s.stiffness, mass: s.mass, useNativeDriver: true }).start();\n }\n },\n [value, motion, reduced],\n );\n\n const onPressIn = useCallback(() => {\n if (disabled) return;\n to(reduced ? dimTo : scale, true);\n if (haptic === \"select\") play(\"select\");\n }, [disabled, reduced, dimTo, scale, to, haptic, play]);\n\n // Always let go, even if the pressable was disabled mid-press (a send that started), and start\n // from rest whenever it's disabled, so it never comes back still shrunk.\n const onPressOut = useCallback(() => to(1, false), [to]);\n useEffect(() => {\n if (disabled) value.setValue(1);\n }, [disabled, value]);\n\n const confirm = useCallback(() => {\n if (!disabled && haptic && haptic !== \"select\") play(haptic);\n }, [disabled, haptic, play]);\n\n const style = useMemo(() => (disabled ? {} : reduced ? { opacity: value } : { transform: [{ scale: value }] }), [disabled, reduced, value]);\n\n return { onPressIn, onPressOut, confirm, style };\n}\n","/**\n * useThemeMode — read the active color scheme (light / dark / unset).\n *\n * Wraps RN's `Appearance.getColorScheme()` + `Appearance.addChangeListener`\n * with a stable React hook so consumers don't have to wire it themselves.\n *\n * Use this in tokens-aware components when you need to choose between\n * light/dark variants OUTSIDE of Tailwind's `dark:` modifier (e.g., to pick\n * an asset, run an extra-color computation, or set StatusBar style).\n *\n * @stability Beta\n */\nimport { useEffect, useState } from \"react\";\nimport { Appearance, type ColorSchemeName } from \"react-native\";\n\nexport type ThemeMode = \"light\" | \"dark\";\n\nexport function useThemeMode(): ThemeMode {\n const [scheme, setScheme] = useState<ColorSchemeName>(\n Appearance.getColorScheme(),\n );\n\n useEffect(() => {\n const sub = Appearance.addChangeListener(({ colorScheme }) => {\n setScheme(colorScheme);\n });\n return () => sub.remove();\n }, []);\n\n return scheme === \"dark\" ? \"dark\" : \"light\";\n}\n","/**\n * useThemeRoles — the theme roles (background, label, separator, tint…) as\n * colors for this platform and color scheme.\n *\n * On iOS every neutral role is a system color through `PlatformColor`, so a\n * screen follows light and dark mode, increased contrast and accessibility\n * settings like the system apps. On Android the roles are the Genesis tokens\n * for the current scheme, or Material You colors on Android 12+ with\n * `materialYou`. A brand sets `tint`.\n *\n * Use it for `style` props and anything Tailwind classes don't reach, such as\n * navigation header and tab bar options.\n *\n * @stability Beta\n */\nimport { useMemo } from \"react\";\nimport { Platform, PlatformColor, type ColorValue } from \"react-native\";\nimport { resolveThemeRoles, type ThemeRole } from \"@marktiderman/genesis-design-system\";\nimport { useThemeMode } from \"./use-theme-mode\";\n\nexport type ThemeRoleColors = Record<ThemeRole, ColorValue>;\n\nexport interface UseThemeRolesOptions {\n /** The brand's primary color. */\n tint?: string;\n /** On Android 12+, use Material You dynamic colors for the neutral roles (and the tint, unless `tint` is set). Ignored elsewhere. */\n materialYou?: boolean;\n}\n\nexport function useThemeRoles(options: UseThemeRolesOptions = {}): ThemeRoleColors {\n const scheme = useThemeMode();\n const { tint, materialYou = false } = options;\n const androidDynamic = materialYou && Platform.OS === \"android\" && Number(Platform.Version) >= 31;\n return useMemo(\n () =>\n resolveThemeRoles<ColorValue>({\n target: Platform.OS === \"ios\" ? \"ios\" : \"android\",\n scheme,\n platformColor: (name) => PlatformColor(name),\n tint,\n androidDynamic,\n }),\n [scheme, tint, androidDynamic],\n );\n}\n\n/** The colour of a message you sent, on every thread on the phone. Its text is `text-primary-foreground`. */\nexport const sentBubbleColor = <C,>(roles: { tint: C }): C => roles.tint;\n"]}
@@ -1,5 +1,5 @@
1
- import { NativeSkeleton, NativeText, NativeIcon, NativeContextMenu } from './chunk-FGIIBON3.js';
2
- import { useGenesisModules, useReducedMotion, useThemeRoles, usePressFeedback } from './chunk-PWS2HLDE.js';
1
+ import { NativeSkeleton, NativeText, NativeIcon, NativeContextMenu } from './chunk-VEWSY4TZ.js';
2
+ import { useGenesisModules, useReducedMotion, useThemeRoles, usePressFeedback } from './chunk-PMS2V46D.js';
3
3
  import { forwardRef, useState, useRef, useEffect, useCallback, useImperativeHandle, useMemo } from 'react';
4
4
  import { FlatList, View, Platform, AccessibilityInfo, Pressable, Dimensions, TextInput, ActivityIndicator, Animated } from 'react-native';
5
5
  import { useThreadJump } from '@marktiderman/genesis-core/conversation';
@@ -414,5 +414,5 @@ function NativeComposerBar({
414
414
  }
415
415
 
416
416
  export { NativeComposerBar, NativeThreadList, THREAD_AT_BOTTOM_POINTS, threadListMode, threadNearBottom };
417
- //# sourceMappingURL=chunk-JZ7RAGDQ.js.map
418
- //# sourceMappingURL=chunk-JZ7RAGDQ.js.map
417
+ //# sourceMappingURL=chunk-SG7LYX7Z.js.map
418
+ //# sourceMappingURL=chunk-SG7LYX7Z.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/thread-list.tsx","../src/components/composer-bar.tsx"],"names":["useState","useEffect","Platform","AccessibilityInfo","jsxs","View","jsx","Pressable","Fragment"],"mappings":";;;;;;;AAoDA,IAAM,QAAA,GAAW,CAAC,IAAA,KAAkB,iBAAA,CAAyE,2BAA2B,IAAI,CAAA;AAGrI,IAAM,uBAAA,GAA0B;AAGvC,IAAM,WAAA,GAAc,GAAA;AAGb,SAAS,gBAAA,CAAiB,CAAA,EAAkB,KAAA,GAAQ,uBAAA,EAAkC;AAC3F,EAAA,OAAO,CAAA,CAAE,cAAc,CAAA,GAAI,CAAA,CAAE,kBAAkB,MAAA,IAAU,CAAA,CAAE,YAAY,MA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AAA,EAAiB,GAAI,IAAK,MAAA,EAAQ,CAAA,EAAG,MAAM,CAAA,UAAA,CAAA,EAAc,CAAA,GAAK;AAAA;AAAA;AAAA,GAClN;AAEJ","file":"chunk-JZ7RAGDQ.js","sourcesContent":["/**\n * NativeThreadList — a conversation's list: oldest first, top to bottom (the\n * order VoiceOver reads), that opens at the newest row, follows new rows only\n * while you're at the bottom, keeps your place while earlier rows load at the\n * top, and can go to one row (a search result, the first unread).\n *\n * The atom under ThreadPage, and the one any app builds its own thread from:\n * it renders the rows it's given and never fetches. Earlier pages come from\n * `onLoadEarlier`, a row out of reach from `onLoadUntil(id)`.\n *\n * FlashList v2 (`GenesisModules.list`) when the app passed it: its chat mode\n * (`startRenderingFromBottom`, `autoscrollToBottomThreshold`, the first\n * visible row held when rows prepend). Without it, FlatList, which keeps its\n * place with `maintainVisibleContentPosition` (anchored past the header) and\n * follows the bottom by hand.\n *\n * Not inverted: in an inverted FlashList a new row at index 0 lands under the\n * composer, and VoiceOver reads each day's heading after its messages.\n *\n * Earlier rows load by themselves near the top, and the explicit \"Load\n * earlier\" button stays: VoiceOver can't reach rows a virtualized list hasn't\n * rendered. Going to a row waits for `loading`, loads until it's held,\n * scrolls to it (again after FlashList's own placement on open), highlights\n * it for two seconds and announces it. Reduce Motion scrolls without\n * animating. The reader's touch wins: a drag during a jump ends the list's own\n * scrolling and drops the jump, even one still loading, so nothing snaps back.\n *\n * A row is gone when, once `onLoadUntil` has settled, no row answers to its\n * id. The list knows only its rows: a row that's drawn (a deleted message's\n * tombstone) is there, and whatever isn't drawn isn't, whatever a cache holds.\n *\n * Promoted from genesis-chat's thread and its `useJumpToMessage` (G4); chat\n * moves onto it later.\n *\n * @stability Beta\n */\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, type ComponentType, type ReactElement, type ReactNode } from \"react\";\nimport { AccessibilityInfo, FlatList, Platform, Pressable, View } from \"react-native\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { useReducedMotion } from \"../hooks/use-reduced-motion\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useThreadJump } from \"@marktiderman/genesis-core/conversation\";\nimport { NativeSkeleton } from \"./skeleton\";\nimport { NativeText } from \"./text\";\n\n/** The scroll event fields the list reads. */\ninterface ScrollMetrics {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n}\n\nconst announce = (text: string) => (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(text);\n\n/** Points from the bottom that still count as \"at the bottom\". */\nexport const THREAD_AT_BOTTOM_POINTS = 120;\n\n/** After the list scrolls itself (to the newest, to a row), how long its own scroll events don't count. */\nconst SETTLING_MS = 400;\n\n/** Whether a scroll position is at (or near) the bottom of its content. */\nexport function threadNearBottom(m: ScrollMetrics, slack = THREAD_AT_BOTTOM_POINTS): boolean {\n return m.contentOffset.y + m.layoutMeasurement.height >= m.contentSize.height - slack;\n}\n\n/**\n * How the list is set up. FlashList follows by itself, within\n * `THREAD_AT_BOTTOM_POINTS` of the bottom (its threshold is a fraction of the\n * viewport: a fifth until the viewport's height is known); FlatList keeps its\n * place on prepend, anchored on the first row past the header (index 1: the\n * header is child 0), and the list follows the bottom by hand.\n */\nexport function threadListMode(\n flash: boolean,\n reducedMotion: boolean,\n viewportHeight = 0,\n): { followsByHand: boolean; maintainVisibleContentPosition: Record<string, unknown> } {\n if (flash) {\n const threshold = viewportHeight > 0 ? Math.min(1, THREAD_AT_BOTTOM_POINTS / viewportHeight) : 0.2;\n return {\n followsByHand: false,\n maintainVisibleContentPosition: { startRenderingFromBottom: true, autoscrollToBottomThreshold: threshold, animateAutoScrollToBottom: !reducedMotion },\n };\n }\n return { followsByHand: true, maintainVisibleContentPosition: { minIndexForVisible: 1 } };\n}\n\nexport interface NativeThreadListHandle {\n /** Go to the newest row (after a send: what you send is what you look at next). */\n scrollToEnd: (options?: { animated?: boolean }) => void;\n}\n\n/** What `renderItem` is told about a row besides the row itself. */\nexport interface ThreadRowInfo {\n index: number;\n /** The row a jump just landed on, for two seconds. */\n highlighted: boolean;\n}\n\nexport interface NativeThreadListProps<T> {\n /** Oldest first. */\n data: readonly T[];\n /** A row's id. It must stay the same across refreshes (from a cache to the server), or rows jump. */\n keyExtractor: (row: T) => string;\n renderItem: (row: T, info: ThreadRowInfo) => ReactElement | null;\n /** Rows of different shapes recycle apart (FlashList): \"mine\", \"theirs\", \"event\". */\n getItemType?: (row: T) => string;\n /** The first page is loading: shows `loadingView` (a skeleton by default), and a jump waits. */\n loading?: boolean;\n loadingView?: ReactNode;\n /** There are earlier rows: loads them near the top, and shows the \"Load earlier\" button. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\n /** Replaces the default \"Load earlier\" button. */\n renderEarlier?: (props: { loading: boolean; onPress: () => void; label: string; testID: string }) => ReactNode;\n /** Go to this row, loading earlier pages with `onLoadUntil` until it's here. A new id, or the same one after `null`, goes again. */\n jumpTo?: string | null;\n /**\n * The id `jumpTo` names a row by, when it isn't the row's key: a message keyed by the id the\n * phone gave it (so it keeps its row when the server's copy lands) and gone to by the server's\n * id. `null` for a row that can't be gone to (a day heading). `keyExtractor` by default.\n * Pass a stable function (module scope, or `useCallback`): a new one each render re-renders every row.\n */\n jumpId?: (row: T) => string | null | undefined;\n /** Load earlier pages until the row is held; resolve false when it can't be found. */\n onLoadUntil?: (id: string) => Promise<boolean>;\n /** What VoiceOver says on arriving at `jumpTo`. */\n jumpAnnouncement?: (row: T) => string;\n /** No row answers to this id once `onLoadUntil` has settled, or it failed. The list goes back to the newest row first. */\n onJumpFailed?: (id: string) => void;\n /** Whether the reader is at the bottom, as it changes (to show a \"new messages\" pill, say). */\n onAtBottomChange?: (atBottom: boolean) => void;\n /** Above the first row, before the \"Load earlier\" button: what the thread is about. */\n header?: ReactNode;\n /** Under the last row: who is typing, a \"Sending…\" line. */\n footer?: ReactNode;\n /** Shown instead of the rows when there are none. */\n empty?: ReactNode;\n testID?: string;\n}\n\n/** The FlatList and FlashList v2 props the thread passes. */\ninterface ThreadListComponentProps {\n ref?: unknown;\n data: readonly unknown[];\n renderItem: (info: { item: unknown; index: number }) => ReactElement | null;\n keyExtractor: (row: unknown) => string;\n getItemType?: (row: unknown) => string;\n extraData?: unknown;\n onStartReached?: () => void;\n onStartReachedThreshold?: number;\n ListHeaderComponent?: ReactElement | null;\n ListFooterComponent?: ReactElement | null;\n keyboardShouldPersistTaps?: \"handled\";\n keyboardDismissMode?: \"interactive\" | \"on-drag\";\n contentInsetAdjustmentBehavior?: \"automatic\";\n contentContainerStyle?: Record<string, unknown>;\n maintainVisibleContentPosition?: Record<string, unknown>;\n onScroll?: (e: { nativeEvent: ScrollMetrics }) => void;\n onScrollBeginDrag?: () => void;\n scrollEventThrottle?: number;\n onContentSizeChange?: () => void;\n onLayout?: () => void;\n onScrollToIndexFailed?: (info: { index: number; averageItemLength: number }) => void;\n accessibilityRole?: \"list\";\n testID?: string;\n}\n\ninterface ListRef {\n scrollToEnd?: (o?: { animated?: boolean }) => void;\n scrollToIndex?: (o: { index: number; animated?: boolean; viewPosition?: number }) => void;\n scrollToOffset?: (o: { offset: number; animated?: boolean }) => void;\n}\n\nfunction NativeThreadListInner<T>(props: NativeThreadListProps<T>, ref: React.ForwardedRef<NativeThreadListHandle>) {\n const {\n data,\n keyExtractor,\n renderItem,\n getItemType,\n loading = false,\n loadingView,\n hasEarlier = false,\n onLoadEarlier,\n loadingEarlier = false,\n earlierLabel = \"Load earlier messages\",\n renderEarlier,\n jumpTo,\n jumpId,\n onLoadUntil,\n jumpAnnouncement,\n onJumpFailed,\n onAtBottomChange,\n footer,\n header,\n empty,\n testID = \"thread-list\",\n } = props;\n const genesis = useGenesisModules();\n const reducedMotion = useReducedMotion();\n const List = (genesis.list ?? FlatList) as unknown as ComponentType<ThreadListComponentProps>;\n const [viewport, setViewport] = useState(0);\n const mode = threadListMode(Boolean(genesis.list), reducedMotion, viewport);\n // The last position the list reported, to re-check \"at the bottom\" after it moves itself.\n const metrics = useRef<ScrollMetrics | null>(null);\n const recheck = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (recheck.current) clearTimeout(recheck.current);\n }, []);\n const listRef = useRef<ListRef | null>(null);\n // At the bottom (or not yet scrolled): new rows and a shorter list keep it there.\n const atBottom = useRef(true);\n // FlatList opens at the top and is moved down a frame later: until then the top isn't \"reached\".\n const placed = useRef(!mode.followsByHand);\n // While the list scrolls itself, its own scroll events don't move \"at the bottom\".\n const settlingUntil = useRef(0);\n // Bumped by each move the list starts and by the reader's touch: a queued try from an older move doesn't run.\n const moveId = useRef(0);\n const timers = useRef(new Set<ReturnType<typeof setTimeout>>());\n const later = useCallback((fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n timers.current.delete(t);\n fn();\n }, ms);\n timers.current.add(t);\n }, []);\n useEffect(() => {\n const pending = timers.current;\n return () => pending.forEach(clearTimeout);\n }, []);\n const idOf = jumpId ?? keyExtractor;\n const latest = useRef({ data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange });\n latest.current = { data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange };\n // The row a jump names, by `jumpId` (the key by default).\n const indexOf = useCallback((id: string) => latest.current.data.findIndex((row) => latest.current.idOf(row) === id), []);\n\n const setAtBottom = useCallback((v: boolean) => {\n if (atBottom.current === v) return;\n atBottom.current = v;\n latest.current.onAtBottomChange?.(v);\n }, []);\n\n const toBottom = useCallback(\n (animated: boolean) => {\n settlingUntil.current = Date.now() + SETTLING_MS;\n const move = ++moveId.current;\n const go = (a: boolean) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });\n requestAnimationFrame(() => {\n go(animated);\n placed.current = true;\n });\n // Once more after a new row has its size (FlashList measures it after the first pass).\n if (animated) later(() => move === moveId.current && go(true), 180);\n },\n [later, reducedMotion],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToEnd: (options) => {\n setAtBottom(true);\n toBottom(options?.animated ?? true);\n },\n }),\n [setAtBottom, toBottom],\n );\n\n // Going to a row: by id, so a page loading in between can't send it to the wrong row.\n const jumpTries = useRef<{ id: string; tries: number } | null>(null);\n const scrollToRow = useCallback(\n (id: string) => {\n const move = ++moveId.current;\n const scroll = () => {\n if (move !== moveId.current) return;\n const at = indexOf(id);\n if (at < 0) return;\n // Each try moves the list again: its events don't count until this one settles.\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n };\n jumpTries.current = { id, tries: 0 };\n settlingUntil.current = Date.now() + SETTLING_MS;\n requestAnimationFrame(scroll);\n // Once more after the first layout: on open, FlashList's start-at-the-bottom placement comes after\n // the first frame and would win, leaving the thread at the bottom.\n later(scroll, 250);\n },\n [indexOf, later, reducedMotion],\n );\n // A jump to a row already in view moves nothing, so no scroll event says where the list is: look\n // once its own scrolling has settled (a second try extends that; mid-way it can still read as the\n // bottom). No scroll event yet means the list hasn't moved from where it opens, the bottom.\n const lookForBottom = useCallback(() => {\n if (recheck.current) clearTimeout(recheck.current);\n const look = () => {\n const wait = settlingUntil.current - Date.now();\n if (wait > 0) {\n recheck.current = setTimeout(look, wait + 50);\n return;\n }\n if (!metrics.current || threadNearBottom(metrics.current)) setAtBottom(true);\n };\n recheck.current = setTimeout(look, SETTLING_MS + 50);\n }, [setAtBottom]);\n const has = useCallback((id: string) => indexOf(id) >= 0, [indexOf]);\n // `has` must change when the rows do, so the jump looks again.\n const hasNow = useMemo(() => (id: string) => has(id), [has, data]); // eslint-disable-line react-hooks/exhaustive-deps\n const { highlightedId, jumping, cancel: cancelJump } = useThreadJump({\n target: jumpTo,\n has: hasNow,\n loading,\n loadUntil: onLoadUntil,\n scrollTo: scrollToRow,\n onStart: () => {\n setAtBottom(false);\n placed.current = true;\n },\n onLanded: (id) => {\n lookForBottom();\n const at = indexOf(id);\n const said = at >= 0 ? latest.current.jumpAnnouncement?.(latest.current.data[at]!) : undefined;\n if (said) announce(said);\n },\n onGone: (id) => {\n // Back to where the thread opens: the newest rows.\n setAtBottom(true);\n toBottom(false);\n latest.current.onJumpFailed?.(id);\n },\n });\n\n const loadEarlier = useCallback(() => {\n if (placed.current && !jumping && hasEarlier && !loadingEarlier) onLoadEarlier?.();\n }, [hasEarlier, jumping, loadingEarlier, onLoadEarlier]);\n\n const earlierProps = { loading: loadingEarlier, onPress: () => onLoadEarlier?.(), label: earlierLabel, testID: `${testID}-earlier` };\n const listHeader = (\n <View>\n {header}\n {hasEarlier && onLoadEarlier ? (renderEarlier ? renderEarlier(earlierProps) : <DefaultEarlier {...earlierProps} />) : null}\n </View>\n );\n\n const renderListItem = useCallback(\n ({ item, index }: { item: unknown; index: number }) => renderItem(item as T, { index, highlighted: highlightedId !== null && idOf(item as T) === highlightedId }),\n [highlightedId, idOf, renderItem],\n );\n const listKey = useCallback((row: unknown) => keyExtractor(row as T), [keyExtractor]);\n const listItemType = useMemo(() => (getItemType ? (row: unknown) => getItemType(row as T) : undefined), [getItemType]);\n const onScroll = useCallback(\n (e: { nativeEvent: ScrollMetrics }) => {\n metrics.current = { contentOffset: { y: e.nativeEvent.contentOffset.y }, contentSize: { height: e.nativeEvent.contentSize.height }, layoutMeasurement: { height: e.nativeEvent.layoutMeasurement.height } };\n const height = e.nativeEvent.layoutMeasurement.height;\n setViewport((v) => (Math.abs(v - height) < 1 ? v : height));\n // The list's own scroll (to the newest, to a row) isn't the reader moving. Going to a row starts\n // at the bottom, so its first events say \"at the bottom\": taken, that turned following back on,\n // and FlatList's next layout scrolled to the end, away from the row. After a jump, onLanded\n // looks again once it has settled.\n if (Date.now() < settlingUntil.current) return;\n setAtBottom(threadNearBottom(e.nativeEvent));\n },\n [setAtBottom],\n );\n // The reader's touch ends the list's own scroll: from here their scrolling counts, even mid-jump,\n // the tries still queued don't snap them back, and a jump still loading doesn't land. Only a drag:\n // a fling follows one, and onMomentumScrollBegin isn't promised to be the reader's alone (Android\n // may report a programmatic smooth scroll), which would cancel the list's own retry. VoiceOver's\n // three-finger scroll and a wheel send no drag, so those count once the settling window (400ms) ends.\n const readerTookOver = useCallback(() => {\n settlingUntil.current = 0;\n moveId.current += 1;\n jumpTries.current = null;\n cancelJump();\n }, [cancelJump]);\n const onScrollToIndexFailed = useCallback(\n ({ index, averageItemLength }: { index: number; averageItemLength: number }) => {\n const target = jumpTries.current;\n // The reader took over.\n if (!target) return;\n // FlatList hasn't measured that far up yet: get near it, then try again by id (three times at most).\n listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });\n if (target.tries >= 3) return;\n target.tries += 1;\n later(() => {\n if (jumpTries.current !== target) return;\n const at = indexOf(target.id);\n if (at < 0) return;\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n lookForBottom();\n }, 250);\n },\n [indexOf, later, lookForBottom, reducedMotion],\n );\n const follow = useCallback(() => {\n if (atBottom.current && !jumping) toBottom(false);\n }, [jumping, toBottom]);\n\n if (loading && data.length === 0) {\n return (\n <View testID={`${testID}-loading`} accessible accessibilityLabel=\"Loading\" style={{ flex: 1, justifyContent: \"flex-end\", padding: 16, gap: 10 }}>\n {loadingView ?? <DefaultLoading />}\n </View>\n );\n }\n\n if (data.length === 0 && empty) {\n return (\n <View testID={testID} style={{ flex: 1, justifyContent: \"center\" }}>\n {listHeader}\n {empty}\n </View>\n );\n }\n\n return (\n <List\n ref={listRef}\n testID={testID}\n accessibilityRole=\"list\"\n data={data as readonly unknown[]}\n renderItem={renderListItem}\n keyExtractor={listKey}\n getItemType={listItemType}\n extraData={highlightedId}\n onStartReached={loadEarlier}\n onStartReachedThreshold={0.5}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.select({ ios: \"interactive\" as const, default: \"on-drag\" as const })}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ paddingVertical: 8, paddingHorizontal: 12 }}\n maintainVisibleContentPosition={mode.maintainVisibleContentPosition}\n scrollEventThrottle={32}\n onScroll={onScroll}\n onScrollBeginDrag={readerTookOver}\n onScrollToIndexFailed={onScrollToIndexFailed}\n {...(mode.followsByHand ? { onContentSizeChange: follow, onLayout: follow } : {})}\n ListHeaderComponent={listHeader}\n ListFooterComponent={footer ? <View>{footer}</View> : null}\n />\n );\n}\n\n/** A conversation's list. See the module docs. */\nexport const NativeThreadList = forwardRef(NativeThreadListInner) as <T>(\n props: NativeThreadListProps<T> & { ref?: React.Ref<NativeThreadListHandle> },\n) => ReactElement | null;\n\nfunction DefaultEarlier({ loading, label, onPress, testID }: { loading: boolean; label: string; onPress: () => void; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View style={{ alignItems: \"center\", paddingVertical: 12 }}>\n {loading ? (\n <View testID={`${testID}-loading`} accessible accessibilityLabel={label} accessibilityState={{ busy: true }} style={{ gap: 8, alignItems: \"center\" }}>\n <NativeSkeleton width={180} height={14} />\n <NativeSkeleton width={120} height={14} />\n </View>\n ) : (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16 }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n )}\n </View>\n );\n}\n\nfunction DefaultLoading() {\n return (\n <>\n <NativeSkeleton width={200} height={36} className=\"rounded-2xl\" />\n <View style={{ alignItems: \"flex-end\" }}>\n <NativeSkeleton width={160} height={36} className=\"rounded-2xl\" />\n </View>\n <NativeSkeleton width={240} height={36} className=\"rounded-2xl\" />\n </>\n );\n}\n","/**\n * NativeComposerBar — the bar you write a message in: an input that grows\n * with what you type (up to `maxLines`, then scrolls), a send button, and\n * slots beside and above it. ThreadPage's composer; chat, comments and AI\n * prompts build on it too.\n *\n * - **Modes:** `modes` with a `tone` each (\"Reply\" / \"Internal note\"). The\n * picker sits above the input, and an `internal` tone edges the bar and\n * the input in the theme's `warning` role, so a staff-only note never\n * reads like a reply (the send button keeps the tint: text on `warning`\n * would fail contrast). The row it sends carries the same tone (ThreadPage).\n * - **Slots:** `leading` (attach), `trailing` (beside send: an emoji button),\n * `above` (a reply preview, attachments waiting to send), `idleAction` (in\n * Send's place while there's nothing to send: a hold-to-record mic) and\n * `replaceInput` (instead of `leading` and the input: a recording's\n * waveform). Attachments with no text: pass `hasContent`.\n * - **More ways to send:** `sendActions` (\"Schedule\"). Touch and hold Send:\n * one action runs, several open a menu. Each is also an accessibility\n * action on Send.\n * - **Keyboard:** the bar doesn't move itself. Put it under a keyboard-aware\n * container (ThreadPage does, with `GenesisModules.keyboardAvoidingView`);\n * the list above it dismisses the keyboard interactively on a drag.\n * - **Accessibility:** send and the mode picker are 44pt targets, the input\n * is labelled by its placeholder (and says when it writes an internal\n * note), Sending is announced, and the input stays editable while a\n * message sends (the keyboard stays up).\n *\n * @stability Beta\n */\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { AccessibilityInfo, ActivityIndicator, Animated, Dimensions, Platform, Pressable, TextInput, View } from \"react-native\";\nimport type { ComposerMode } from \"@marktiderman/genesis-core/conversation\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { usePressFeedback } from \"../hooks/use-press-feedback\";\nimport { NativeContextMenu } from \"./context-menu\";\nimport { NativeIcon } from \"./icon\";\nimport { NativeText } from \"./text\";\n\nexport type { ComposerMode, ComposerTone } from \"@marktiderman/genesis-core/conversation\";\n\nexport interface NativeComposerBarProps {\n value: string;\n onChangeText: (text: string) => void;\n onSend: () => void;\n /** A send is in flight: the button spins and won't send twice. */\n sending?: boolean;\n /** Turns sending off (besides a blank value). */\n disabled?: boolean;\n placeholder?: string;\n /** Send's label, to VoiceOver. Default \"Send\". */\n sendLabel?: string;\n sendingLabel?: string;\n maxLength?: number;\n /** The input grows to this many lines, then scrolls. Default 6. */\n maxLines?: number;\n /** Ways to send (\"Reply\", \"Internal note\"). Two or more show the picker. */\n modes?: readonly ComposerMode[];\n /** The picker's name, to VoiceOver. Default \"Send as\". */\n modesLabel?: string;\n /** The chosen mode's id. Default the first. */\n mode?: string;\n onModeChange?: (id: string) => void;\n leading?: ReactNode;\n trailing?: ReactNode;\n above?: ReactNode;\n /**\n * Whether there's something to send. By default, a `value` that isn't blank; pass `true` when\n * attachments are waiting and no text is needed, and `false` while `replaceInput` is showing.\n */\n hasContent?: boolean;\n /** Takes Send's place (the same 44pt spot) while there's nothing to send and nothing sending: a hold-to-record mic. */\n idleAction?: ReactNode;\n /** Shown instead of `leading` and the input (a recording in progress). Label it yourself: it's one region to VoiceOver. */\n replaceInput?: ReactNode;\n /** Touch and hold Send for these (one runs straight away; several open a menu). Each is also an accessibility action on Send. */\n sendActions?: readonly ComposerSendAction[];\n /** Title of the menu when there are several `sendActions`. */\n sendActionsTitle?: string;\n /** The hint on Send when it has `sendActions`. Default \"Touch and hold for more options\". */\n sendActionsHint?: string;\n /** Passed to the input (to insert at the cursor, say). */\n onSelectionChange?: (e: { nativeEvent: { selection: { start: number; end: number } } }) => void;\n /**\n * The input takes text (default). When false, Send is off and the input reads as disabled.\n * `idleAction` is the app's, so disable it too.\n */\n editable?: boolean;\n testID?: string;\n}\n\n/** Another way to send (touch and hold Send). */\nexport interface ComposerSendAction {\n id: string;\n label: string;\n onPress: () => void;\n destructive?: boolean;\n}\n\nconst LINE = 22;\nconst PAD_Y = 8;\n\nexport function NativeComposerBar({\n value,\n onChangeText,\n onSend,\n sending = false,\n disabled = false,\n placeholder = \"Message\",\n sendLabel = \"Send\",\n sendingLabel = \"Sending\",\n maxLength,\n maxLines = 6,\n modes,\n modesLabel = \"Send as\",\n mode,\n onModeChange,\n leading,\n trailing,\n above,\n hasContent,\n idleAction,\n replaceInput,\n sendActions,\n sendActionsTitle,\n sendActionsHint = \"Touch and hold for more options\",\n onSelectionChange,\n editable = true,\n testID = \"composer\",\n}: NativeComposerBarProps) {\n const colors = useThemeRoles();\n const { symbol, icons } = useGenesisModules();\n // No icon module: the arrow would draw nothing, so the button says its label.\n const hasIcon = Boolean(symbol || icons?.[\"arrow-up\"]);\n const current = modes?.find((m) => m.id === mode) ?? modes?.[0];\n const internal = current?.tone === \"internal\";\n const blank = !(hasContent ?? value.trim().length > 0);\n const canSend = !blank && !disabled && !sending && editable;\n const actions = sendActions?.length ? sendActions : null;\n const [menuOpen, setMenuOpen] = useState(false);\n const idle = idleAction != null && blank && !sending;\n const sendPress = usePressFeedback({ haptic: \"light\", scale: 0.9, disabled: !canSend });\n // A multiline input grows with its text by itself; this caps it, after which it scrolls.\n // Lines grow with the person's text size (Dynamic Type, Android font scale).\n const fontScale = Dimensions.get(\"window\").fontScale || 1;\n const maxHeight = Math.ceil(LINE * fontScale) * maxLines + PAD_Y * 2;\n // Say \"Sending\" on iOS too (a live region is Android-only).\n useEffect(() => {\n if (sending && Platform.OS === \"ios\") (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(sendingLabel);\n }, [sending, sendingLabel]);\n\n return (\n <View\n testID={testID}\n style={{\n paddingHorizontal: 12,\n paddingTop: 8,\n paddingBottom: 8,\n gap: 6,\n backgroundColor: colors.groupedBackground,\n borderTopWidth: internal ? 2 : 0,\n borderTopColor: colors.warning,\n }}\n >\n {modes && modes.length > 1 ? (\n <View testID={`${testID}-modes`} accessibilityRole=\"tablist\" accessibilityLabel={modesLabel} style={{ flexDirection: \"row\", gap: 4 }}>\n {modes.map((m) => {\n const on = m.id === current?.id;\n return (\n <Pressable\n key={m.id}\n testID={`${testID}-mode-${m.id}`}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: on }}\n accessibilityLabel={m.label}\n onPress={() => onModeChange?.(m.id)}\n style={{\n minHeight: 44,\n justifyContent: \"center\",\n paddingHorizontal: 12,\n borderRadius: 22,\n backgroundColor: on ? colors.fill : \"transparent\",\n borderWidth: m.tone === \"internal\" ? 1 : 0,\n borderColor: colors.warning,\n }}\n >\n <NativeText preset=\"label\" style={{ color: on ? colors.label : colors.secondaryLabel }}>\n {m.label}\n </NativeText>\n </Pressable>\n );\n })}\n </View>\n ) : null}\n {above}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 8 }}>\n {replaceInput != null ? (\n <View style={{ flex: 1, minHeight: 44, justifyContent: \"center\" }}>{replaceInput}</View>\n ) : (\n <>\n {leading}\n <TextInput\n testID={`${testID}-input`}\n value={value}\n onChangeText={onChangeText}\n placeholder={internal ? current!.label : placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={internal ? current!.label : placeholder}\n accessibilityState={editable ? undefined : { disabled: true }}\n editable={editable}\n onSelectionChange={onSelectionChange}\n multiline\n maxLength={maxLength}\n style={{\n flex: 1,\n minHeight: 44,\n maxHeight,\n textAlignVertical: \"center\",\n paddingHorizontal: 14,\n paddingTop: PAD_Y,\n paddingBottom: PAD_Y,\n borderRadius: 22,\n fontSize: 17,\n lineHeight: LINE,\n color: colors.label as string,\n backgroundColor: colors.surface,\n borderWidth: internal ? 1 : 0,\n borderColor: colors.warning,\n opacity: editable ? 1 : 0.6,\n }}\n />\n </>\n )}\n {trailing}\n {idle ? (\n <View testID={`${testID}-idle`} style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n {idleAction}\n </View>\n ) : sending ? (\n <View testID={`${testID}-sending`} accessible accessibilityLabel={sendingLabel} accessibilityLiveRegion=\"polite\" style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <ActivityIndicator />\n </View>\n ) : (\n <Animated.View style={sendPress.style}>\n <Pressable\n testID={`${testID}-send`}\n accessibilityRole=\"button\"\n accessibilityLabel={sendLabel}\n accessibilityState={{ disabled: !canSend }}\n accessibilityHint={actions ? sendActionsHint : undefined}\n accessibilityActions={actions && canSend ? actions.map((a) => ({ name: a.id, label: a.label })) : undefined}\n onAccessibilityAction={actions ? (e) => actions.find((a) => a.id === e.nativeEvent.actionName)?.onPress() : undefined}\n onLongPress={actions ? () => (actions.length === 1 ? actions[0]!.onPress() : setMenuOpen(true)) : undefined}\n disabled={!canSend}\n onPressIn={sendPress.onPressIn}\n onPressOut={sendPress.onPressOut}\n onPress={() => {\n sendPress.confirm();\n onSend();\n }}\n style={{ minWidth: 44, height: 44, paddingHorizontal: hasIcon ? 0 : 14, borderRadius: 22, alignItems: \"center\", justifyContent: \"center\", backgroundColor: canSend ? colors.tint : colors.fill }}\n >\n {hasIcon ? (\n <NativeIcon name=\"arrow-up\" size={20} color={canSend ? colors.background : colors.tertiaryLabel} />\n ) : (\n <NativeText preset=\"label\" className={canSend ? \"text-primary-foreground\" : undefined} style={canSend ? undefined : { color: colors.tertiaryLabel }}>\n {sendLabel}\n </NativeText>\n )}\n </Pressable>\n </Animated.View>\n )}\n </View>\n {actions && actions.length > 1 ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} actions={actions} {...(sendActionsTitle ? { title: sendActionsTitle } : {})} testID={`${testID}-send-menu`} /> : null}\n </View>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/thread-list.tsx","../src/components/composer-bar.tsx"],"names":["useState","useEffect","Platform","AccessibilityInfo","jsxs","View","jsx","Pressable","Fragment"],"mappings":";;;;;;;AAoDA,IAAM,QAAA,GAAW,CAAC,IAAA,KAAkB,iBAAA,CAAyE,2BAA2B,IAAI,CAAA;AAGrI,IAAM,uBAAA,GAA0B;AAGvC,IAAM,WAAA,GAAc,GAAA;AAGb,SAAS,gBAAA,CAAiB,CAAA,EAAkB,KAAA,GAAQ,uBAAA,EAAkC;AAC3F,EAAA,OAAO,CAAA,CAAE,cAAc,CAAA,GAAI,CAAA,CAAE,kBAAkB,MAAA,IAAU,CAAA,CAAE,YAAY,MAAA,GAAS,KAAA;AAClF;AASO,SAAS,cAAA,CACd,KAAA,EACA,aAAA,EACA,cAAA,GAAiB,CAAA,EACoE;AACrF,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,MAAM,SAAA,GAAY,iBAAiB,CAAA,GAAI,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— a conversation's list: oldest first, top to bottom (the\n * order VoiceOver reads), that opens at the newest row, follows new rows only\n * while you're at the bottom, keeps your place while earlier rows load at the\n * top, and can go to one row (a search result, the first unread).\n *\n * The atom under ThreadPage, and the one any app builds its own thread from:\n * it renders the rows it's given and never fetches. Earlier pages come from\n * `onLoadEarlier`, a row out of reach from `onLoadUntil(id)`.\n *\n * FlashList v2 (`GenesisModules.list`) when the app passed it: its chat mode\n * (`startRenderingFromBottom`, `autoscrollToBottomThreshold`, the first\n * visible row held when rows prepend). Without it, FlatList, which keeps its\n * place with `maintainVisibleContentPosition` (anchored past the header) and\n * follows the bottom by hand.\n *\n * Not inverted: in an inverted FlashList a new row at index 0 lands under the\n * composer, and VoiceOver reads each day's heading after its messages.\n *\n * Earlier rows load by themselves near the top, and the explicit \"Load\n * earlier\" button stays: VoiceOver can't reach rows a virtualized list hasn't\n * rendered. Going to a row waits for `loading`, loads until it's held,\n * scrolls to it (again after FlashList's own placement on open), highlights\n * it for two seconds and announces it. Reduce Motion scrolls without\n * animating. The reader's touch wins: a drag during a jump ends the list's own\n * scrolling and drops the jump, even one still loading, so nothing snaps back.\n *\n * A row is gone when, once `onLoadUntil` has settled, no row answers to its\n * id. The list knows only its rows: a row that's drawn (a deleted message's\n * tombstone) is there, and whatever isn't drawn isn't, whatever a cache holds.\n *\n * Promoted from genesis-chat's thread and its `useJumpToMessage` (G4); chat\n * moves onto it later.\n *\n * @stability Beta\n */\nimport { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, type ComponentType, type ReactElement, type ReactNode } from \"react\";\nimport { AccessibilityInfo, FlatList, Platform, Pressable, View } from \"react-native\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { useReducedMotion } from \"../hooks/use-reduced-motion\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useThreadJump } from \"@marktiderman/genesis-core/conversation\";\nimport { NativeSkeleton } from \"./skeleton\";\nimport { NativeText } from \"./text\";\n\n/** The scroll event fields the list reads. */\ninterface ScrollMetrics {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n}\n\nconst announce = (text: string) => (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(text);\n\n/** Points from the bottom that still count as \"at the bottom\". */\nexport const THREAD_AT_BOTTOM_POINTS = 120;\n\n/** After the list scrolls itself (to the newest, to a row), how long its own scroll events don't count. */\nconst SETTLING_MS = 400;\n\n/** Whether a scroll position is at (or near) the bottom of its content. */\nexport function threadNearBottom(m: ScrollMetrics, slack = THREAD_AT_BOTTOM_POINTS): boolean {\n return m.contentOffset.y + m.layoutMeasurement.height >= m.contentSize.height - slack;\n}\n\n/**\n * How the list is set up. FlashList follows by itself, within\n * `THREAD_AT_BOTTOM_POINTS` of the bottom (its threshold is a fraction of the\n * viewport: a fifth until the viewport's height is known); FlatList keeps its\n * place on prepend, anchored on the first row past the header (index 1: the\n * header is child 0), and the list follows the bottom by hand.\n */\nexport function threadListMode(\n flash: boolean,\n reducedMotion: boolean,\n viewportHeight = 0,\n): { followsByHand: boolean; maintainVisibleContentPosition: Record<string, unknown> } {\n if (flash) {\n const threshold = viewportHeight > 0 ? Math.min(1, THREAD_AT_BOTTOM_POINTS / viewportHeight) : 0.2;\n return {\n followsByHand: false,\n maintainVisibleContentPosition: { startRenderingFromBottom: true, autoscrollToBottomThreshold: threshold, animateAutoScrollToBottom: !reducedMotion },\n };\n }\n return { followsByHand: true, maintainVisibleContentPosition: { minIndexForVisible: 1 } };\n}\n\nexport interface NativeThreadListHandle {\n /** Go to the newest row (after a send: what you send is what you look at next). */\n scrollToEnd: (options?: { animated?: boolean }) => void;\n}\n\n/** What `renderItem` is told about a row besides the row itself. */\nexport interface ThreadRowInfo {\n index: number;\n /** The row a jump just landed on, for two seconds. */\n highlighted: boolean;\n}\n\nexport interface NativeThreadListProps<T> {\n /** Oldest first. */\n data: readonly T[];\n /** A row's id. It must stay the same across refreshes (from a cache to the server), or rows jump. */\n keyExtractor: (row: T) => string;\n renderItem: (row: T, info: ThreadRowInfo) => ReactElement | null;\n /** Rows of different shapes recycle apart (FlashList): \"mine\", \"theirs\", \"event\". */\n getItemType?: (row: T) => string;\n /** The first page is loading: shows `loadingView` (a skeleton by default), and a jump waits. */\n loading?: boolean;\n loadingView?: ReactNode;\n /** There are earlier rows: loads them near the top, and shows the \"Load earlier\" button. */\n hasEarlier?: boolean;\n onLoadEarlier?: () => void;\n loadingEarlier?: boolean;\n earlierLabel?: string;\n /** Replaces the default \"Load earlier\" button. */\n renderEarlier?: (props: { loading: boolean; onPress: () => void; label: string; testID: string }) => ReactNode;\n /** Go to this row, loading earlier pages with `onLoadUntil` until it's here. A new id, or the same one after `null`, goes again. */\n jumpTo?: string | null;\n /**\n * The id `jumpTo` names a row by, when it isn't the row's key: a message keyed by the id the\n * phone gave it (so it keeps its row when the server's copy lands) and gone to by the server's\n * id. `null` for a row that can't be gone to (a day heading). `keyExtractor` by default.\n * Pass a stable function (module scope, or `useCallback`): a new one each render re-renders every row.\n */\n jumpId?: (row: T) => string | null | undefined;\n /** Load earlier pages until the row is held; resolve false when it can't be found. */\n onLoadUntil?: (id: string) => Promise<boolean>;\n /** What VoiceOver says on arriving at `jumpTo`. */\n jumpAnnouncement?: (row: T) => string;\n /** No row answers to this id once `onLoadUntil` has settled, or it failed. The list goes back to the newest row first. */\n onJumpFailed?: (id: string) => void;\n /** Whether the reader is at the bottom, as it changes (to show a \"new messages\" pill, say). */\n onAtBottomChange?: (atBottom: boolean) => void;\n /** Above the first row, before the \"Load earlier\" button: what the thread is about. */\n header?: ReactNode;\n /** Under the last row: who is typing, a \"Sending…\" line. */\n footer?: ReactNode;\n /** Shown instead of the rows when there are none. */\n empty?: ReactNode;\n testID?: string;\n}\n\n/** The FlatList and FlashList v2 props the thread passes. */\ninterface ThreadListComponentProps {\n ref?: unknown;\n data: readonly unknown[];\n renderItem: (info: { item: unknown; index: number }) => ReactElement | null;\n keyExtractor: (row: unknown) => string;\n getItemType?: (row: unknown) => string;\n extraData?: unknown;\n onStartReached?: () => void;\n onStartReachedThreshold?: number;\n ListHeaderComponent?: ReactElement | null;\n ListFooterComponent?: ReactElement | null;\n keyboardShouldPersistTaps?: \"handled\";\n keyboardDismissMode?: \"interactive\" | \"on-drag\";\n contentInsetAdjustmentBehavior?: \"automatic\";\n contentContainerStyle?: Record<string, unknown>;\n maintainVisibleContentPosition?: Record<string, unknown>;\n onScroll?: (e: { nativeEvent: ScrollMetrics }) => void;\n onScrollBeginDrag?: () => void;\n scrollEventThrottle?: number;\n onContentSizeChange?: () => void;\n onLayout?: () => void;\n onScrollToIndexFailed?: (info: { index: number; averageItemLength: number }) => void;\n accessibilityRole?: \"list\";\n testID?: string;\n}\n\ninterface ListRef {\n scrollToEnd?: (o?: { animated?: boolean }) => void;\n scrollToIndex?: (o: { index: number; animated?: boolean; viewPosition?: number }) => void;\n scrollToOffset?: (o: { offset: number; animated?: boolean }) => void;\n}\n\nfunction NativeThreadListInner<T>(props: NativeThreadListProps<T>, ref: React.ForwardedRef<NativeThreadListHandle>) {\n const {\n data,\n keyExtractor,\n renderItem,\n getItemType,\n loading = false,\n loadingView,\n hasEarlier = false,\n onLoadEarlier,\n loadingEarlier = false,\n earlierLabel = \"Load earlier messages\",\n renderEarlier,\n jumpTo,\n jumpId,\n onLoadUntil,\n jumpAnnouncement,\n onJumpFailed,\n onAtBottomChange,\n footer,\n header,\n empty,\n testID = \"thread-list\",\n } = props;\n const genesis = useGenesisModules();\n const reducedMotion = useReducedMotion();\n const List = (genesis.list ?? FlatList) as unknown as ComponentType<ThreadListComponentProps>;\n const [viewport, setViewport] = useState(0);\n const mode = threadListMode(Boolean(genesis.list), reducedMotion, viewport);\n // The last position the list reported, to re-check \"at the bottom\" after it moves itself.\n const metrics = useRef<ScrollMetrics | null>(null);\n const recheck = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => {\n if (recheck.current) clearTimeout(recheck.current);\n }, []);\n const listRef = useRef<ListRef | null>(null);\n // At the bottom (or not yet scrolled): new rows and a shorter list keep it there.\n const atBottom = useRef(true);\n // FlatList opens at the top and is moved down a frame later: until then the top isn't \"reached\".\n const placed = useRef(!mode.followsByHand);\n // While the list scrolls itself, its own scroll events don't move \"at the bottom\".\n const settlingUntil = useRef(0);\n // Bumped by each move the list starts and by the reader's touch: a queued try from an older move doesn't run.\n const moveId = useRef(0);\n const timers = useRef(new Set<ReturnType<typeof setTimeout>>());\n const later = useCallback((fn: () => void, ms: number) => {\n const t = setTimeout(() => {\n timers.current.delete(t);\n fn();\n }, ms);\n timers.current.add(t);\n }, []);\n useEffect(() => {\n const pending = timers.current;\n return () => pending.forEach(clearTimeout);\n }, []);\n const idOf = jumpId ?? keyExtractor;\n const latest = useRef({ data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange });\n latest.current = { data, idOf, jumpAnnouncement, onJumpFailed, onAtBottomChange };\n // The row a jump names, by `jumpId` (the key by default).\n const indexOf = useCallback((id: string) => latest.current.data.findIndex((row) => latest.current.idOf(row) === id), []);\n\n const setAtBottom = useCallback((v: boolean) => {\n if (atBottom.current === v) return;\n atBottom.current = v;\n latest.current.onAtBottomChange?.(v);\n }, []);\n\n const toBottom = useCallback(\n (animated: boolean) => {\n settlingUntil.current = Date.now() + SETTLING_MS;\n const move = ++moveId.current;\n const go = (a: boolean) => listRef.current?.scrollToEnd?.({ animated: a && !reducedMotion });\n requestAnimationFrame(() => {\n go(animated);\n placed.current = true;\n });\n // Once more after a new row has its size (FlashList measures it after the first pass).\n if (animated) later(() => move === moveId.current && go(true), 180);\n },\n [later, reducedMotion],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToEnd: (options) => {\n setAtBottom(true);\n toBottom(options?.animated ?? true);\n },\n }),\n [setAtBottom, toBottom],\n );\n\n // Going to a row: by id, so a page loading in between can't send it to the wrong row.\n const jumpTries = useRef<{ id: string; tries: number } | null>(null);\n const scrollToRow = useCallback(\n (id: string) => {\n const move = ++moveId.current;\n const scroll = () => {\n if (move !== moveId.current) return;\n const at = indexOf(id);\n if (at < 0) return;\n // Each try moves the list again: its events don't count until this one settles.\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n };\n jumpTries.current = { id, tries: 0 };\n settlingUntil.current = Date.now() + SETTLING_MS;\n requestAnimationFrame(scroll);\n // Once more after the first layout: on open, FlashList's start-at-the-bottom placement comes after\n // the first frame and would win, leaving the thread at the bottom.\n later(scroll, 250);\n },\n [indexOf, later, reducedMotion],\n );\n // A jump to a row already in view moves nothing, so no scroll event says where the list is: look\n // once its own scrolling has settled (a second try extends that; mid-way it can still read as the\n // bottom). No scroll event yet means the list hasn't moved from where it opens, the bottom.\n const lookForBottom = useCallback(() => {\n if (recheck.current) clearTimeout(recheck.current);\n const look = () => {\n const wait = settlingUntil.current - Date.now();\n if (wait > 0) {\n recheck.current = setTimeout(look, wait + 50);\n return;\n }\n if (!metrics.current || threadNearBottom(metrics.current)) setAtBottom(true);\n };\n recheck.current = setTimeout(look, SETTLING_MS + 50);\n }, [setAtBottom]);\n const has = useCallback((id: string) => indexOf(id) >= 0, [indexOf]);\n // `has` must change when the rows do, so the jump looks again.\n const hasNow = useMemo(() => (id: string) => has(id), [has, data]); // eslint-disable-line react-hooks/exhaustive-deps\n const { highlightedId, jumping, cancel: cancelJump } = useThreadJump({\n target: jumpTo,\n has: hasNow,\n loading,\n loadUntil: onLoadUntil,\n scrollTo: scrollToRow,\n onStart: () => {\n setAtBottom(false);\n placed.current = true;\n },\n onLanded: (id) => {\n lookForBottom();\n const at = indexOf(id);\n const said = at >= 0 ? latest.current.jumpAnnouncement?.(latest.current.data[at]!) : undefined;\n if (said) announce(said);\n },\n onGone: (id) => {\n // Back to where the thread opens: the newest rows.\n setAtBottom(true);\n toBottom(false);\n latest.current.onJumpFailed?.(id);\n },\n });\n\n const loadEarlier = useCallback(() => {\n if (placed.current && !jumping && hasEarlier && !loadingEarlier) onLoadEarlier?.();\n }, [hasEarlier, jumping, loadingEarlier, onLoadEarlier]);\n\n const earlierProps = { loading: loadingEarlier, onPress: () => onLoadEarlier?.(), label: earlierLabel, testID: `${testID}-earlier` };\n const listHeader = (\n <View>\n {header}\n {hasEarlier && onLoadEarlier ? (renderEarlier ? renderEarlier(earlierProps) : <DefaultEarlier {...earlierProps} />) : null}\n </View>\n );\n\n const renderListItem = useCallback(\n ({ item, index }: { item: unknown; index: number }) => renderItem(item as T, { index, highlighted: highlightedId !== null && idOf(item as T) === highlightedId }),\n [highlightedId, idOf, renderItem],\n );\n const listKey = useCallback((row: unknown) => keyExtractor(row as T), [keyExtractor]);\n const listItemType = useMemo(() => (getItemType ? (row: unknown) => getItemType(row as T) : undefined), [getItemType]);\n const onScroll = useCallback(\n (e: { nativeEvent: ScrollMetrics }) => {\n metrics.current = { contentOffset: { y: e.nativeEvent.contentOffset.y }, contentSize: { height: e.nativeEvent.contentSize.height }, layoutMeasurement: { height: e.nativeEvent.layoutMeasurement.height } };\n const height = e.nativeEvent.layoutMeasurement.height;\n setViewport((v) => (Math.abs(v - height) < 1 ? v : height));\n // The list's own scroll (to the newest, to a row) isn't the reader moving. Going to a row starts\n // at the bottom, so its first events say \"at the bottom\": taken, that turned following back on,\n // and FlatList's next layout scrolled to the end, away from the row. After a jump, onLanded\n // looks again once it has settled.\n if (Date.now() < settlingUntil.current) return;\n setAtBottom(threadNearBottom(e.nativeEvent));\n },\n [setAtBottom],\n );\n // The reader's touch ends the list's own scroll: from here their scrolling counts, even mid-jump,\n // the tries still queued don't snap them back, and a jump still loading doesn't land. Only a drag:\n // a fling follows one, and onMomentumScrollBegin isn't promised to be the reader's alone (Android\n // may report a programmatic smooth scroll), which would cancel the list's own retry. VoiceOver's\n // three-finger scroll and a wheel send no drag, so those count once the settling window (400ms) ends.\n const readerTookOver = useCallback(() => {\n settlingUntil.current = 0;\n moveId.current += 1;\n jumpTries.current = null;\n cancelJump();\n }, [cancelJump]);\n const onScrollToIndexFailed = useCallback(\n ({ index, averageItemLength }: { index: number; averageItemLength: number }) => {\n const target = jumpTries.current;\n // The reader took over.\n if (!target) return;\n // FlatList hasn't measured that far up yet: get near it, then try again by id (three times at most).\n listRef.current?.scrollToOffset?.({ offset: Math.max(0, index * averageItemLength - 200), animated: false });\n if (target.tries >= 3) return;\n target.tries += 1;\n later(() => {\n if (jumpTries.current !== target) return;\n const at = indexOf(target.id);\n if (at < 0) return;\n settlingUntil.current = Date.now() + SETTLING_MS;\n listRef.current?.scrollToIndex?.({ index: at, animated: !reducedMotion, viewPosition: 0.5 });\n lookForBottom();\n }, 250);\n },\n [indexOf, later, lookForBottom, reducedMotion],\n );\n const follow = useCallback(() => {\n if (atBottom.current && !jumping) toBottom(false);\n }, [jumping, toBottom]);\n\n if (loading && data.length === 0) {\n return (\n <View testID={`${testID}-loading`} accessible accessibilityLabel=\"Loading\" style={{ flex: 1, justifyContent: \"flex-end\", padding: 16, gap: 10 }}>\n {loadingView ?? <DefaultLoading />}\n </View>\n );\n }\n\n if (data.length === 0 && empty) {\n return (\n <View testID={testID} style={{ flex: 1, justifyContent: \"center\" }}>\n {listHeader}\n {empty}\n </View>\n );\n }\n\n return (\n <List\n ref={listRef}\n testID={testID}\n accessibilityRole=\"list\"\n data={data as readonly unknown[]}\n renderItem={renderListItem}\n keyExtractor={listKey}\n getItemType={listItemType}\n extraData={highlightedId}\n onStartReached={loadEarlier}\n onStartReachedThreshold={0.5}\n keyboardShouldPersistTaps=\"handled\"\n keyboardDismissMode={Platform.select({ ios: \"interactive\" as const, default: \"on-drag\" as const })}\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={{ paddingVertical: 8, paddingHorizontal: 12 }}\n maintainVisibleContentPosition={mode.maintainVisibleContentPosition}\n scrollEventThrottle={32}\n onScroll={onScroll}\n onScrollBeginDrag={readerTookOver}\n onScrollToIndexFailed={onScrollToIndexFailed}\n {...(mode.followsByHand ? { onContentSizeChange: follow, onLayout: follow } : {})}\n ListHeaderComponent={listHeader}\n ListFooterComponent={footer ? <View>{footer}</View> : null}\n />\n );\n}\n\n/** A conversation's list. See the module docs. */\nexport const NativeThreadList = forwardRef(NativeThreadListInner) as <T>(\n props: NativeThreadListProps<T> & { ref?: React.Ref<NativeThreadListHandle> },\n) => ReactElement | null;\n\nfunction DefaultEarlier({ loading, label, onPress, testID }: { loading: boolean; label: string; onPress: () => void; testID: string }) {\n const colors = useThemeRoles();\n return (\n <View style={{ alignItems: \"center\", paddingVertical: 12 }}>\n {loading ? (\n <View testID={`${testID}-loading`} accessible accessibilityLabel={label} accessibilityState={{ busy: true }} style={{ gap: 8, alignItems: \"center\" }}>\n <NativeSkeleton width={180} height={14} />\n <NativeSkeleton width={120} height={14} />\n </View>\n ) : (\n <Pressable testID={testID} accessibilityRole=\"button\" accessibilityLabel={label} onPress={onPress} style={{ minHeight: 44, justifyContent: \"center\", paddingHorizontal: 16 }}>\n <NativeText preset=\"label\" style={{ color: colors.tint }}>\n {label}\n </NativeText>\n </Pressable>\n )}\n </View>\n );\n}\n\nfunction DefaultLoading() {\n return (\n <>\n <NativeSkeleton width={200} height={36} className=\"rounded-2xl\" />\n <View style={{ alignItems: \"flex-end\" }}>\n <NativeSkeleton width={160} height={36} className=\"rounded-2xl\" />\n </View>\n <NativeSkeleton width={240} height={36} className=\"rounded-2xl\" />\n </>\n );\n}\n","/**\n * NativeComposerBar — the bar you write a message in: an input that grows\n * with what you type (up to `maxLines`, then scrolls), a send button, and\n * slots beside and above it. ThreadPage's composer; chat, comments and AI\n * prompts build on it too.\n *\n * - **Modes:** `modes` with a `tone` each (\"Reply\" / \"Internal note\"). The\n * picker sits above the input, and an `internal` tone edges the bar and\n * the input in the theme's `warning` role, so a staff-only note never\n * reads like a reply (the send button keeps the tint: text on `warning`\n * would fail contrast). The row it sends carries the same tone (ThreadPage).\n * - **Slots:** `leading` (attach), `trailing` (beside send: an emoji button),\n * `above` (a reply preview, attachments waiting to send), `idleAction` (in\n * Send's place while there's nothing to send: a hold-to-record mic) and\n * `replaceInput` (instead of `leading` and the input: a recording's\n * waveform). Attachments with no text: pass `hasContent`.\n * - **More ways to send:** `sendActions` (\"Schedule\"). Touch and hold Send:\n * one action runs, several open a menu. Each is also an accessibility\n * action on Send.\n * - **Keyboard:** the bar doesn't move itself. Put it under a keyboard-aware\n * container (ThreadPage does, with `GenesisModules.keyboardAvoidingView`);\n * the list above it dismisses the keyboard interactively on a drag.\n * - **Accessibility:** send and the mode picker are 44pt targets, the input\n * is labelled by its placeholder (and says when it writes an internal\n * note), Sending is announced, and the input stays editable while a\n * message sends (the keyboard stays up).\n *\n * @stability Beta\n */\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport { AccessibilityInfo, ActivityIndicator, Animated, Dimensions, Platform, Pressable, TextInput, View } from \"react-native\";\nimport type { ComposerMode } from \"@marktiderman/genesis-core/conversation\";\nimport { useThemeRoles } from \"../hooks/use-theme-roles\";\nimport { useGenesisModules } from \"../native-modules\";\nimport { usePressFeedback } from \"../hooks/use-press-feedback\";\nimport { NativeContextMenu } from \"./context-menu\";\nimport { NativeIcon } from \"./icon\";\nimport { NativeText } from \"./text\";\n\nexport type { ComposerMode, ComposerTone } from \"@marktiderman/genesis-core/conversation\";\n\nexport interface NativeComposerBarProps {\n value: string;\n onChangeText: (text: string) => void;\n onSend: () => void;\n /** A send is in flight: the button spins and won't send twice. */\n sending?: boolean;\n /** Turns sending off (besides a blank value). */\n disabled?: boolean;\n placeholder?: string;\n /** Send's label, to VoiceOver. Default \"Send\". */\n sendLabel?: string;\n sendingLabel?: string;\n maxLength?: number;\n /** The input grows to this many lines, then scrolls. Default 6. */\n maxLines?: number;\n /** Ways to send (\"Reply\", \"Internal note\"). Two or more show the picker. */\n modes?: readonly ComposerMode[];\n /** The picker's name, to VoiceOver. Default \"Send as\". */\n modesLabel?: string;\n /** The chosen mode's id. Default the first. */\n mode?: string;\n onModeChange?: (id: string) => void;\n leading?: ReactNode;\n trailing?: ReactNode;\n above?: ReactNode;\n /**\n * Whether there's something to send. By default, a `value` that isn't blank; pass `true` when\n * attachments are waiting and no text is needed, and `false` while `replaceInput` is showing.\n */\n hasContent?: boolean;\n /** Takes Send's place (the same 44pt spot) while there's nothing to send and nothing sending: a hold-to-record mic. */\n idleAction?: ReactNode;\n /** Shown instead of `leading` and the input (a recording in progress). Label it yourself: it's one region to VoiceOver. */\n replaceInput?: ReactNode;\n /** Touch and hold Send for these (one runs straight away; several open a menu). Each is also an accessibility action on Send. */\n sendActions?: readonly ComposerSendAction[];\n /** Title of the menu when there are several `sendActions`. */\n sendActionsTitle?: string;\n /** The hint on Send when it has `sendActions`. Default \"Touch and hold for more options\". */\n sendActionsHint?: string;\n /** Passed to the input (to insert at the cursor, say). */\n onSelectionChange?: (e: { nativeEvent: { selection: { start: number; end: number } } }) => void;\n /**\n * The input takes text (default). When false, Send is off and the input reads as disabled.\n * `idleAction` is the app's, so disable it too.\n */\n editable?: boolean;\n testID?: string;\n}\n\n/** Another way to send (touch and hold Send). */\nexport interface ComposerSendAction {\n id: string;\n label: string;\n onPress: () => void;\n destructive?: boolean;\n}\n\nconst LINE = 22;\nconst PAD_Y = 8;\n\nexport function NativeComposerBar({\n value,\n onChangeText,\n onSend,\n sending = false,\n disabled = false,\n placeholder = \"Message\",\n sendLabel = \"Send\",\n sendingLabel = \"Sending\",\n maxLength,\n maxLines = 6,\n modes,\n modesLabel = \"Send as\",\n mode,\n onModeChange,\n leading,\n trailing,\n above,\n hasContent,\n idleAction,\n replaceInput,\n sendActions,\n sendActionsTitle,\n sendActionsHint = \"Touch and hold for more options\",\n onSelectionChange,\n editable = true,\n testID = \"composer\",\n}: NativeComposerBarProps) {\n const colors = useThemeRoles();\n const { symbol, icons } = useGenesisModules();\n // No icon module: the arrow would draw nothing, so the button says its label.\n const hasIcon = Boolean(symbol || icons?.[\"arrow-up\"]);\n const current = modes?.find((m) => m.id === mode) ?? modes?.[0];\n const internal = current?.tone === \"internal\";\n const blank = !(hasContent ?? value.trim().length > 0);\n const canSend = !blank && !disabled && !sending && editable;\n const actions = sendActions?.length ? sendActions : null;\n const [menuOpen, setMenuOpen] = useState(false);\n const idle = idleAction != null && blank && !sending;\n const sendPress = usePressFeedback({ haptic: \"light\", scale: 0.9, disabled: !canSend });\n // A multiline input grows with its text by itself; this caps it, after which it scrolls.\n // Lines grow with the person's text size (Dynamic Type, Android font scale).\n const fontScale = Dimensions.get(\"window\").fontScale || 1;\n const maxHeight = Math.ceil(LINE * fontScale) * maxLines + PAD_Y * 2;\n // Say \"Sending\" on iOS too (a live region is Android-only).\n useEffect(() => {\n if (sending && Platform.OS === \"ios\") (AccessibilityInfo as { announceForAccessibility?: (t: string) => void }).announceForAccessibility?.(sendingLabel);\n }, [sending, sendingLabel]);\n\n return (\n <View\n testID={testID}\n style={{\n paddingHorizontal: 12,\n paddingTop: 8,\n paddingBottom: 8,\n gap: 6,\n backgroundColor: colors.groupedBackground,\n borderTopWidth: internal ? 2 : 0,\n borderTopColor: colors.warning,\n }}\n >\n {modes && modes.length > 1 ? (\n <View testID={`${testID}-modes`} accessibilityRole=\"tablist\" accessibilityLabel={modesLabel} style={{ flexDirection: \"row\", gap: 4 }}>\n {modes.map((m) => {\n const on = m.id === current?.id;\n return (\n <Pressable\n key={m.id}\n testID={`${testID}-mode-${m.id}`}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: on }}\n accessibilityLabel={m.label}\n onPress={() => onModeChange?.(m.id)}\n style={{\n minHeight: 44,\n justifyContent: \"center\",\n paddingHorizontal: 12,\n borderRadius: 22,\n backgroundColor: on ? colors.fill : \"transparent\",\n borderWidth: m.tone === \"internal\" ? 1 : 0,\n borderColor: colors.warning,\n }}\n >\n <NativeText preset=\"label\" style={{ color: on ? colors.label : colors.secondaryLabel }}>\n {m.label}\n </NativeText>\n </Pressable>\n );\n })}\n </View>\n ) : null}\n {above}\n <View style={{ flexDirection: \"row\", alignItems: \"flex-end\", gap: 8 }}>\n {replaceInput != null ? (\n <View style={{ flex: 1, minHeight: 44, justifyContent: \"center\" }}>{replaceInput}</View>\n ) : (\n <>\n {leading}\n <TextInput\n testID={`${testID}-input`}\n value={value}\n onChangeText={onChangeText}\n placeholder={internal ? current!.label : placeholder}\n placeholderTextColor={colors.tertiaryLabel as string}\n accessibilityLabel={internal ? current!.label : placeholder}\n accessibilityState={editable ? undefined : { disabled: true }}\n editable={editable}\n onSelectionChange={onSelectionChange}\n multiline\n maxLength={maxLength}\n style={{\n flex: 1,\n minHeight: 44,\n maxHeight,\n textAlignVertical: \"center\",\n paddingHorizontal: 14,\n paddingTop: PAD_Y,\n paddingBottom: PAD_Y,\n borderRadius: 22,\n fontSize: 17,\n lineHeight: LINE,\n color: colors.label as string,\n backgroundColor: colors.surface,\n borderWidth: internal ? 1 : 0,\n borderColor: colors.warning,\n opacity: editable ? 1 : 0.6,\n }}\n />\n </>\n )}\n {trailing}\n {idle ? (\n <View testID={`${testID}-idle`} style={{ minWidth: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n {idleAction}\n </View>\n ) : sending ? (\n <View testID={`${testID}-sending`} accessible accessibilityLabel={sendingLabel} accessibilityLiveRegion=\"polite\" style={{ width: 44, height: 44, alignItems: \"center\", justifyContent: \"center\" }}>\n <ActivityIndicator />\n </View>\n ) : (\n <Animated.View style={sendPress.style}>\n <Pressable\n testID={`${testID}-send`}\n accessibilityRole=\"button\"\n accessibilityLabel={sendLabel}\n accessibilityState={{ disabled: !canSend }}\n accessibilityHint={actions ? sendActionsHint : undefined}\n accessibilityActions={actions && canSend ? actions.map((a) => ({ name: a.id, label: a.label })) : undefined}\n onAccessibilityAction={actions ? (e) => actions.find((a) => a.id === e.nativeEvent.actionName)?.onPress() : undefined}\n onLongPress={actions ? () => (actions.length === 1 ? actions[0]!.onPress() : setMenuOpen(true)) : undefined}\n disabled={!canSend}\n onPressIn={sendPress.onPressIn}\n onPressOut={sendPress.onPressOut}\n onPress={() => {\n sendPress.confirm();\n onSend();\n }}\n style={{ minWidth: 44, height: 44, paddingHorizontal: hasIcon ? 0 : 14, borderRadius: 22, alignItems: \"center\", justifyContent: \"center\", backgroundColor: canSend ? colors.tint : colors.fill }}\n >\n {hasIcon ? (\n <NativeIcon name=\"arrow-up\" size={20} color={canSend ? colors.background : colors.tertiaryLabel} />\n ) : (\n <NativeText preset=\"label\" className={canSend ? \"text-primary-foreground\" : undefined} style={canSend ? undefined : { color: colors.tertiaryLabel }}>\n {sendLabel}\n </NativeText>\n )}\n </Pressable>\n </Animated.View>\n )}\n </View>\n {actions && actions.length > 1 ? <NativeContextMenu open={menuOpen} onOpenChange={setMenuOpen} actions={actions} {...(sendActionsTitle ? { title: sendActionsTitle } : {})} testID={`${testID}-send-menu`} /> : null}\n </View>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { usePressFeedback, useThemeRoles, useGenesisModules, useMotion, useHaptics } from './chunk-PWS2HLDE.js';
1
+ import { usePressFeedback, useThemeRoles, useGenesisModules, useMotion, useHaptics } from './chunk-PMS2V46D.js';
2
2
  import { cn } from './chunk-OHZD7KRO.js';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { Text, Pressable, Animated, View, ActivityIndicator, ScrollView, Dimensions, Platform, Modal, KeyboardAvoidingView, RefreshControl, TextInput, Easing, AccessibilityInfo } from 'react-native';
@@ -945,5 +945,5 @@ function NativeSwipeRow({ actions, children, testID = "swipe-row" }) {
945
945
  }
946
946
 
947
947
  export { NATIVE_ICON_NAMES, NativeBadge, NativeButton, NativeContextMenu, NativeEmptyState, NativeIcon, NativeInput, NativeListItem, NativeListItemDivider, NativeLoadingState, NativeRefreshControl, NativeSectionListHeader, NativeSheet, NativeSheetProvider, NativeSheetScrollView, NativeSkeleton, NativeSwipeRow, NativeText, SF_SYMBOLS, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, textVariants };
948
- //# sourceMappingURL=chunk-FGIIBON3.js.map
949
- //# sourceMappingURL=chunk-FGIIBON3.js.map
948
+ //# sourceMappingURL=chunk-VEWSY4TZ.js.map
949
+ //# sourceMappingURL=chunk-VEWSY4TZ.js.map