@g9tm/lynxcontrols 1.4.11 → 1.5.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 (141) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/anchor/context.d.ts +15 -0
  3. package/dist/anchor/context.d.ts.map +1 -0
  4. package/dist/anchor/context.jsx +10 -0
  5. package/dist/anchor/context.jsx.map +1 -0
  6. package/dist/anchor/hooks.d.ts +72 -0
  7. package/dist/anchor/hooks.d.ts.map +1 -0
  8. package/dist/anchor/hooks.jsx +147 -0
  9. package/dist/anchor/hooks.jsx.map +1 -0
  10. package/dist/anchor/index.d.ts +6 -0
  11. package/dist/anchor/index.d.ts.map +1 -0
  12. package/dist/anchor/index.jsx +5 -0
  13. package/dist/anchor/measure.d.ts +22 -0
  14. package/dist/anchor/measure.d.ts.map +1 -0
  15. package/dist/anchor/measure.jsx +110 -0
  16. package/dist/anchor/measure.jsx.map +1 -0
  17. package/dist/anchor/registry.d.ts +108 -0
  18. package/dist/anchor/registry.d.ts.map +1 -0
  19. package/dist/anchor/registry.jsx +142 -0
  20. package/dist/anchor/registry.jsx.map +1 -0
  21. package/dist/anchor/scroll.d.ts +34 -0
  22. package/dist/anchor/scroll.d.ts.map +1 -0
  23. package/dist/anchor/scroll.jsx +255 -0
  24. package/dist/anchor/scroll.jsx.map +1 -0
  25. package/dist/base/control.d.ts +10 -3
  26. package/dist/base/control.d.ts.map +1 -1
  27. package/dist/base/control.jsx +17 -2
  28. package/dist/base/control.jsx.map +1 -1
  29. package/dist/base/pressable.d.ts.map +1 -1
  30. package/dist/base/pressable.jsx +7 -1
  31. package/dist/base/pressable.jsx.map +1 -1
  32. package/dist/button/button.d.ts.map +1 -1
  33. package/dist/button/button.jsx +11 -1
  34. package/dist/button/button.jsx.map +1 -1
  35. package/dist/button/header-action-button.d.ts.map +1 -1
  36. package/dist/button/header-action-button.jsx +10 -1
  37. package/dist/button/header-action-button.jsx.map +1 -1
  38. package/dist/button/icon-button.d.ts.map +1 -1
  39. package/dist/button/icon-button.jsx +11 -1
  40. package/dist/button/icon-button.jsx.map +1 -1
  41. package/dist/button/nav-card.d.ts.map +1 -1
  42. package/dist/button/nav-card.jsx +10 -1
  43. package/dist/button/nav-card.jsx.map +1 -1
  44. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  45. package/dist/button/vertical-icon-text-button.jsx +10 -1
  46. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  47. package/dist/expander/expander.d.ts.map +1 -1
  48. package/dist/expander/expander.jsx +14 -1
  49. package/dist/expander/expander.jsx.map +1 -1
  50. package/dist/fields/editor.d.ts.map +1 -1
  51. package/dist/fields/editor.jsx +17 -1
  52. package/dist/fields/editor.jsx.map +1 -1
  53. package/dist/fields/outlined-field.d.ts +6 -0
  54. package/dist/fields/outlined-field.d.ts.map +1 -1
  55. package/dist/fields/outlined-field.jsx +14 -3
  56. package/dist/fields/outlined-field.jsx.map +1 -1
  57. package/dist/fields/text-entry.d.ts.map +1 -1
  58. package/dist/fields/text-entry.jsx +17 -1
  59. package/dist/fields/text-entry.jsx.map +1 -1
  60. package/dist/guide/guide.css +453 -0
  61. package/dist/guide/guide.css.map +1 -0
  62. package/dist/guide/index.d.ts +5 -0
  63. package/dist/guide/index.d.ts.map +1 -0
  64. package/dist/guide/index.jsx +4 -0
  65. package/dist/guide/journey.d.ts +46 -0
  66. package/dist/guide/journey.d.ts.map +1 -0
  67. package/dist/guide/journey.jsx +464 -0
  68. package/dist/guide/journey.jsx.map +1 -0
  69. package/dist/guide/placement.d.ts +44 -0
  70. package/dist/guide/placement.d.ts.map +1 -0
  71. package/dist/guide/placement.jsx +119 -0
  72. package/dist/guide/placement.jsx.map +1 -0
  73. package/dist/guide/service.d.ts +85 -0
  74. package/dist/guide/service.d.ts.map +1 -0
  75. package/dist/guide/service.jsx +620 -0
  76. package/dist/guide/service.jsx.map +1 -0
  77. package/dist/guide/settings.d.ts +50 -0
  78. package/dist/guide/settings.d.ts.map +1 -0
  79. package/dist/guide/settings.jsx +60 -0
  80. package/dist/guide/settings.jsx.map +1 -0
  81. package/dist/host/host.d.ts +5 -1
  82. package/dist/host/host.d.ts.map +1 -1
  83. package/dist/host/host.jsx +12 -0
  84. package/dist/host/host.jsx.map +1 -1
  85. package/dist/host/layers.d.ts +3 -1
  86. package/dist/host/layers.d.ts.map +1 -1
  87. package/dist/host/layers.jsx +4 -2
  88. package/dist/host/layers.jsx.map +1 -1
  89. package/dist/host/registry.d.ts +3 -0
  90. package/dist/host/registry.d.ts.map +1 -1
  91. package/dist/host/registry.jsx.map +1 -1
  92. package/dist/index.d.ts +3 -0
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/provider/contexts.d.ts +3 -0
  95. package/dist/provider/contexts.d.ts.map +1 -1
  96. package/dist/provider/contexts.jsx.map +1 -1
  97. package/dist/provider/provider.d.ts.map +1 -1
  98. package/dist/provider/provider.jsx +24 -17
  99. package/dist/provider/provider.jsx.map +1 -1
  100. package/dist/provider/settings.d.ts +4 -0
  101. package/dist/provider/settings.d.ts.map +1 -1
  102. package/dist/provider/settings.jsx +3 -2
  103. package/dist/provider/settings.jsx.map +1 -1
  104. package/dist/route/hooks.d.ts +34 -0
  105. package/dist/route/hooks.d.ts.map +1 -0
  106. package/dist/route/hooks.jsx +147 -0
  107. package/dist/route/hooks.jsx.map +1 -0
  108. package/dist/route/index.d.ts +3 -0
  109. package/dist/route/index.d.ts.map +1 -0
  110. package/dist/route/index.jsx +2 -0
  111. package/dist/route/router.d.ts +201 -0
  112. package/dist/route/router.d.ts.map +1 -0
  113. package/dist/route/router.jsx +810 -0
  114. package/dist/route/router.jsx.map +1 -0
  115. package/dist/sheet/frame.d.ts +3 -1
  116. package/dist/sheet/frame.d.ts.map +1 -1
  117. package/dist/sheet/frame.jsx +67 -25
  118. package/dist/sheet/frame.jsx.map +1 -1
  119. package/dist/sheet/options.d.ts +10 -0
  120. package/dist/sheet/options.d.ts.map +1 -1
  121. package/dist/sheet/options.jsx.map +1 -1
  122. package/dist/sheet/service.d.ts +5 -0
  123. package/dist/sheet/service.d.ts.map +1 -1
  124. package/dist/sheet/service.jsx +14 -2
  125. package/dist/sheet/service.jsx.map +1 -1
  126. package/dist/sheet/sheet.css +9 -0
  127. package/dist/sheet/sheet.css.map +1 -1
  128. package/dist/tabs/tab-view.d.ts +14 -0
  129. package/dist/tabs/tab-view.d.ts.map +1 -1
  130. package/dist/tabs/tab-view.jsx +59 -3
  131. package/dist/tabs/tab-view.jsx.map +1 -1
  132. package/dist/toggle/checkbox.d.ts.map +1 -1
  133. package/dist/toggle/checkbox.jsx +15 -1
  134. package/dist/toggle/checkbox.jsx.map +1 -1
  135. package/dist/toggle/chip-group.d.ts.map +1 -1
  136. package/dist/toggle/chip-group.jsx +12 -1
  137. package/dist/toggle/chip-group.jsx.map +1 -1
  138. package/dist/toggle/switch.d.ts.map +1 -1
  139. package/dist/toggle/switch.jsx +15 -1
  140. package/dist/toggle/switch.jsx.map +1 -1
  141. package/package.json +17 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route/router.jsx","sources":["../../src/route/router.ts"],"sourcesContent":["import {\n formatAddress,\n type G9Address,\n type G9Catalogue,\n type G9Entry,\n type G9GoFailure,\n type G9LivePlace,\n type G9PlaceDeclaration,\n type G9PlaceHandle,\n type G9PlaceLayer,\n type G9RouteSink,\n type G9ScrollMark,\n type G9Segment,\n type G9SegmentView,\n type G9Snapshot,\n type G9ViewApplied,\n g9RuntimeTimers,\n generalOf,\n planNavigation,\n resolvePath,\n sameSegment,\n snapshotRefusal,\n toSegment,\n tryParseAddress,\n} from '@g9tm/lynxcontrols-foundation';\nimport { measureNode } from '../anchor/measure';\nimport type { G9AnchorRegistry } from '../anchor/registry';\nimport { applyScrollMark, readScrollMark, revealAnchor } from '../anchor/scroll';\n\n// The router: where the app is (built from what is really open — every place declares itself while open), and how to\n// get somewhere (jump: the router opens each place the way the UI does; walk: it shows the person the control to tap,\n// step by step, or presses it itself in a demo). It never writes data: opening a place is the place's own `open`, the\n// same function its button calls, so every gate (permissions, data on the device) stays where it is. Before anything\n// is closed or opened every segment is checked; an address whose entity is not there changes nothing at all.\n\n/** A store a component reads with `useSyncExternalStore`. */\nexport interface G9ReadableStore<T> {\n get(): T;\n subscribe(listener: () => void): () => void;\n}\n\n/** Where the app is. The same object until something changes. */\nexport interface G9Location {\n /** The unique address (canonical, ids included, no target). */\n readonly unique: string;\n /** The general address (kinds only). */\n readonly general: string;\n readonly segments: readonly G9Segment[];\n /** A breadcrumb per segment, in the current language. */\n readonly titles: readonly string[];\n /** The path does not reach the root (a parent was missing). */\n readonly incomplete: boolean;\n /** Open places that are not on the path, as general segments (`site`, `map`). */\n readonly others: readonly string[];\n /** Facts the open places report (the surface, the open site…). */\n readonly facts: Readonly<Record<string, string | number | boolean | null>>;\n readonly revision: number;\n}\n\n/** One move in the trail. */\nexport interface G9TrailEntry {\n readonly at: number;\n readonly unique: string;\n readonly general: string;\n readonly cause: 'user' | 'go' | 'walk' | 'restore' | 'back';\n}\n\n/** How a navigation ended: where the app is, or the reason, the step and a message for the person. */\nexport type G9GoResult =\n | { readonly ok: true; readonly location: G9Location; readonly view: G9ViewApplied }\n | {\n readonly ok: false;\n readonly reason: G9GoFailure;\n /** The segment index it stopped at (-1: before any). */\n readonly at: number;\n readonly segment: G9Segment | null;\n /** For the person, in their language when the place said so; otherwise for developers. */\n readonly message: string;\n readonly location: G9Location;\n };\n\n/** Who asked for a navigation. */\nexport type G9GoSource = 'user' | 'assistant' | 'link' | 'tester' | 'qa' | 'restore';\n\n/** How a navigation runs: who asked, snapshot views to put back, whether QA may force past unsaved work. */\nexport interface G9GoOptions {\n readonly source?: G9GoSource;\n /** Apply snapshot views (scroll marks, view values). `restore` does. */\n readonly views?: readonly G9SegmentView[];\n /** Close dirty places without asking: honoured for `qa` only. */\n readonly force?: boolean;\n}\n\n/** What the router reports (diagnostics, busy tracking, a tester trail). */\nexport type G9RouteEvent =\n | { readonly kind: 'changed'; readonly location: G9Location; readonly cause: G9TrailEntry['cause'] }\n | { readonly kind: 'go:start'; readonly address: string; readonly mode: 'jump' | 'walk' | 'restore' }\n | {\n readonly kind: 'go:step';\n readonly address: string;\n readonly index: number;\n readonly segment: G9Segment;\n readonly how: 'opened' | 'walked' | 'jumped';\n }\n | { readonly kind: 'go:done'; readonly address: string; readonly result: G9GoResult }\n | { readonly kind: 'error'; readonly where: string; readonly error: unknown };\n\n/** One step of a walk. */\nexport interface G9WalkStep {\n readonly index: number;\n readonly segment: G9Segment;\n readonly title: string;\n readonly state: 'pending' | 'current' | 'done' | 'jumped' | 'failed';\n}\n\n/** Draws a walk step: the guide module's default presenter points a finger at the entry control. */\nexport interface G9WalkPresenter {\n show(step: {\n readonly anchor: string;\n readonly text: string;\n readonly gesture: 'tap' | 'longPress';\n readonly index: number;\n readonly count: number;\n }): { hide(): void };\n /** A step the router does itself (a jump, a preparation): one short line. */\n note?(text: string): void;\n}\n\n/** How a walk runs: the person taps (`user`) or the router presses (`demo`), and who draws the steps. */\nexport interface G9WalkOptions extends G9GoOptions {\n /** `user` waits for the person's own tap; `demo` presses the entry itself. Default `user`. */\n readonly by?: 'user' | 'demo';\n readonly presenter?: G9WalkPresenter;\n /** Per step. Default 60000 (user) / 8000 (demo). */\n readonly stepTimeoutMs?: number;\n /** How long a demo shows the control before pressing it. Default 900 ms. */\n readonly demoDelayMs?: number;\n}\n\n/** A guided navigation in progress: its steps, cancel, and its result. */\nexport interface G9Walk {\n readonly steps: G9ReadableStore<readonly G9WalkStep[]>;\n cancel(): void;\n readonly result: Promise<G9GoResult>;\n}\n\n/** A trip somewhere and back. */\nexport interface G9Excursion {\n readonly origin: G9Snapshot;\n readonly result: G9GoResult;\n back(): Promise<G9GoResult>;\n}\n\n/** What a router is built from: the catalogue, the context and language its callbacks get, the anchors, texts. */\nexport interface G9RouterOptions<Ctx> {\n readonly catalogue: G9Catalogue<Ctx>;\n /** What every catalogue callback gets; null = nobody signed in (only places without guards resolve). */\n context(): Ctx | null;\n language(): 'fa' | 'en';\n readonly anchors?: () => G9AnchorRegistry | null;\n /** Wall clock (ms). Default `Date.now`. */\n now?(): number;\n /** Asked before closing a place with unsaved work. Absent = such a navigation is refused (`dirty`). */\n confirmLeave?(segment: G9Segment, title: string, message: string | undefined): Promise<boolean>;\n onEvent?(event: G9RouteEvent): void;\n /** Default 50. */\n readonly historySize?: number;\n /**\n * After a sheet appeared, how long before the next place is opened (G9 sheets drop a second show within 369 ms, the\n * double-tap guard). Default 410.\n */\n readonly sheetGapMs?: number;\n /** How long a closing place may take to go (ms). Default 3000. */\n readonly closeTimeoutMs?: number;\n /**\n * How long an address's `#target` may take to appear after its place opened (ms) — a list fills after its sheet is\n * declared. Default 3000.\n */\n readonly targetTimeoutMs?: number;\n /** After restoring a scroll mark: how long the rows must stay unchanged before it is applied again (ms). Default 400. */\n readonly scrollSettleMs?: number;\n /** …and the longest wait for that (ms). Default 3000. */\n readonly scrollSettleMaxMs?: number;\n /** The app version written into snapshots. */\n readonly appVersion?: string | (() => string);\n /** Texts the router shows a person (default: English developer texts). */\n readonly texts?: Partial<G9RouterTexts>;\n}\n\n/** What the router tells a person, in their language (the app supplies them). */\nexport interface G9RouterTexts {\n notFound(title: string): string;\n blocked(title: string): string;\n timeout(title: string): string;\n /** `open` said it could not open the place (the app already told the person why). */\n notOpened(title: string): string;\n dirty(title: string): string;\n notAddressable(title: string): string;\n badAddress(): string;\n cancelled(): string;\n jumped(title: string): string;\n}\n\nconst DEFAULT_TEXTS: G9RouterTexts = {\n notFound: (t) => `\"${t}\" is not on this device.`,\n blocked: (t) => `\"${t}\" cannot be closed now.`,\n timeout: (t) => `\"${t}\" did not open in time.`,\n notOpened: (t) => `\"${t}\" could not be opened.`,\n dirty: (t) => `\"${t}\" has unsaved changes.`,\n notAddressable: (t) => `\"${t}\" cannot be opened directly.`,\n badAddress: () => 'This address is not valid.',\n cancelled: () => 'Cancelled.',\n jumped: (t) => `Opening \"${t}\".`,\n};\n\n/** The router (also the route sink places declare themselves to). */\nexport interface G9Router extends G9RouteSink {\n readonly current: G9ReadableStore<G9Location>;\n where(): G9Location;\n go(address: string | G9Address, options?: G9GoOptions): Promise<G9GoResult>;\n walk(address: string | G9Address, options?: G9WalkOptions): G9Walk;\n snapshot(): G9Snapshot;\n /** The snapshot with the scroll mark of every scroller on screen (on the last segment). */\n snapshotWithScroll(): Promise<G9Snapshot>;\n /** Puts a snapshot back (refused across another catalogue or past `maxAgeMs`, default unlimited). */\n restore(snapshot: G9Snapshot, options?: G9GoOptions & { readonly maxAgeMs?: number }): Promise<G9GoResult>;\n excursion(address: string | G9Address, options?: G9GoOptions): Promise<G9Excursion>;\n readonly history: G9ReadableStore<readonly G9TrailEntry[]>;\n readonly busy: G9ReadableStore<boolean>;\n /** The declaration of an open place (QA, the guide), or null. */\n placeAt(index: number): G9PlaceDeclaration | null;\n /** A new user / sign-out: the trail is forgotten and a running navigation ends. */\n reset(): void;\n /** The catalogue (manifests, links). */\n readonly catalogue: G9Catalogue<unknown>;\n}\n\n/** True when a route sink is a full router. */\nexport function isG9Router(sink: G9RouteSink | null | undefined): sink is G9Router {\n return !!sink && typeof (sink as Partial<G9Router>).go === 'function' && !!(sink as Partial<G9Router>).current;\n}\n\ninterface Place {\n readonly token: number;\n readonly declaration: G9PlaceDeclaration;\n readonly at: number;\n}\n\nfunction store<T>(initial: T): G9ReadableStore<T> & { set(v: T): void } {\n let value = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => value,\n set(v) {\n if (Object.is(v, value)) return;\n value = v;\n for (const l of Array.from(listeners)) {\n try {\n l();\n } catch {\n // a listener's failure never stops the others\n }\n }\n },\n subscribe(l) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n };\n}\n\nclass Stop extends Error {\n constructor(\n readonly reason: G9GoFailure,\n readonly at: number,\n readonly segment: G9Segment | null,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst sleep = (ms: number) => new Promise<void>((r) => g9RuntimeTimers.setTimeout(r, ms));\n\n/** Creates a router. */\nexport function createG9Router<Ctx>(options: G9RouterOptions<Ctx>): G9Router {\n const catalogue = options.catalogue as G9Catalogue<unknown>;\n const now = options.now ?? (() => Date.now());\n const texts: G9RouterTexts = { ...DEFAULT_TEXTS, ...options.texts };\n const sheetGapMs = options.sheetGapMs ?? 410;\n const closeTimeoutMs = options.closeTimeoutMs ?? 3000;\n const targetTimeoutMs = options.targetTimeoutMs ?? 3000;\n const scrollSettleMs = options.scrollSettleMs ?? 400;\n const scrollSettleMaxMs = options.scrollSettleMaxMs ?? 3000;\n const historySize = options.historySize ?? 50;\n const places = new Map<number, Place>();\n let tokens = 0;\n let revision = 0;\n let lastSheetAt = Number.NEGATIVE_INFINITY;\n let cause: G9TrailEntry['cause'] = 'user';\n let running: { readonly id: number; cancelled: G9GoFailure | null } | null = null;\n let runs = 0;\n const waiters = new Set<() => void>();\n\n const emit = (event: G9RouteEvent) => {\n try {\n options.onEvent?.(event);\n } catch {\n // diagnostics never break navigation\n }\n };\n\n const segmentOf = (p: Place): G9Segment | null => {\n try {\n const s = p.declaration.segment;\n return toSegment(typeof s === 'function' ? s() : s);\n } catch (error) {\n emit({ kind: 'error', where: 'segment', error });\n return null;\n }\n };\n\n const isShown = (p: Place): boolean => {\n try {\n return p.declaration.shown?.() !== false;\n } catch (error) {\n emit({ kind: 'error', where: 'shown', error });\n return true;\n }\n };\n\n const live = (): G9LivePlace[] => {\n const out: G9LivePlace[] = [];\n for (const p of places.values()) {\n if (!isShown(p)) continue;\n const segment = segmentOf(p);\n if (!segment || !catalogue.def(segment.kind)) continue;\n out.push({\n token: p.token,\n segment,\n layer: p.declaration.layer,\n order: p.declaration.order ?? 0,\n under: p.declaration.under ?? [],\n });\n }\n return out;\n };\n\n const titleOf = (segment: G9Segment, token: number | null): string => {\n const decl = token !== null ? places.get(token)?.declaration : undefined;\n let t: string | null | undefined;\n try {\n t = decl?.title?.();\n } catch {\n t = null;\n }\n return t?.trim() || catalogue.title(segment, options.context(), options.language());\n };\n\n const empty: G9Location = Object.freeze({\n unique: '/',\n general: '/',\n segments: [],\n titles: [],\n incomplete: false,\n others: [],\n facts: {},\n revision: 0,\n });\n const current = store<G9Location>(empty);\n const history = store<readonly G9TrailEntry[]>([]);\n const busy = store(false);\n\n const compute = () => {\n const l = live();\n const path = resolvePath(l, catalogue);\n const unique = formatAddress(path.segments);\n const titles = path.segments.map((s, i) => titleOf(s, path.tokens[i] ?? null));\n const byToken = new Map(l.map((p) => [p.token, p] as const));\n const others = path.others.map((t) => generalOf({ segments: [byToken.get(t)?.segment as G9Segment] }).slice(1));\n const facts: Record<string, string | number | boolean | null> = {};\n const ordered = [...path.others, ...path.tokens.filter((t): t is number => t !== null)];\n for (const t of ordered) {\n try {\n Object.assign(facts, places.get(t)?.declaration.facts?.() ?? {});\n } catch (error) {\n emit({ kind: 'error', where: 'facts', error });\n }\n }\n const prev = current.get();\n const same =\n prev.unique === unique &&\n prev.incomplete === path.incomplete &&\n prev.titles.join('\\u0000') === titles.join('\\u0000') &&\n prev.others.join('\\u0000') === others.join('\\u0000') &&\n JSON.stringify(prev.facts) === JSON.stringify(facts);\n if (!same) {\n revision += 1;\n const next: G9Location = Object.freeze({\n unique,\n general: generalOf({ segments: path.segments }),\n segments: path.segments,\n titles,\n incomplete: path.incomplete,\n others,\n facts,\n revision,\n });\n current.set(next);\n if (prev.unique !== unique) {\n const trail = [...history.get(), { at: now(), unique, general: next.general, cause }];\n history.set(trail.length > historySize ? trail.slice(trail.length - historySize) : trail);\n }\n emit({ kind: 'changed', location: next, cause });\n }\n for (const w of Array.from(waiters)) w();\n };\n\n const waitFor = (predicate: () => boolean, timeoutMs: number, runId: number): Promise<boolean> =>\n new Promise((resolve) => {\n if (predicate()) return resolve(true);\n let done = false;\n const finish = (ok: boolean) => {\n if (done) return;\n done = true;\n waiters.delete(check);\n g9RuntimeTimers.clearTimeout(timer);\n resolve(ok);\n };\n const check = () => {\n if (running?.id !== runId || running.cancelled) finish(false);\n else if (predicate()) finish(true);\n };\n waiters.add(check);\n const timer = g9RuntimeTimers.setTimeout(() => finish(predicate()), timeoutMs);\n });\n\n /** True when the anchors changed and then stayed unchanged for `quietMs` (within `maxMs`): worth another pass. */\n const rowsSettle = (registry: G9AnchorRegistry, quietMs: number, maxMs: number): Promise<boolean> =>\n new Promise((resolve) => {\n let changed = false;\n let done = false;\n let quiet: unknown = null;\n const finish = () => {\n if (done) return;\n done = true;\n off();\n if (quiet !== null) g9RuntimeTimers.clearTimeout(quiet);\n g9RuntimeTimers.clearTimeout(cap);\n resolve(changed);\n };\n const arm = () => {\n if (quiet !== null) g9RuntimeTimers.clearTimeout(quiet);\n quiet = g9RuntimeTimers.setTimeout(finish, quietMs);\n };\n const off = registry.subscribe(() => {\n changed = true;\n arm();\n });\n const cap = g9RuntimeTimers.setTimeout(finish, maxMs);\n arm();\n });\n\n const anchorAppears = (registry: G9AnchorRegistry, id: string, timeoutMs: number): Promise<boolean> =>\n new Promise((resolve) => {\n if (registry.find(id)) return resolve(true);\n let done = false;\n const finish = (ok: boolean) => {\n if (done) return;\n done = true;\n off();\n g9RuntimeTimers.clearTimeout(timer);\n resolve(ok);\n };\n const off = registry.subscribe(() => {\n if (registry.find(id)) finish(true);\n });\n const timer = g9RuntimeTimers.setTimeout(() => finish(registry.find(id) !== null), timeoutMs);\n });\n\n const liveWith = (segment: G9Segment) => live().find((p) => sameSegment(p.segment, segment)) ?? null;\n\n const parse = (address: string | G9Address): G9Address | null => {\n if (typeof address !== 'string') return address;\n const r = tryParseAddress(address);\n return r.ok ? r.address : null;\n };\n\n const failure = (reason: G9GoFailure, at: number, segment: G9Segment | null, message: string): G9GoResult => ({\n ok: false,\n reason,\n at,\n segment,\n message,\n location: current.get(),\n });\n\n /** Checks the address, runs every guard, closes what is in the way. Returns the target and what to open. */\n async function prepare(\n address: string | G9Address,\n opts: G9GoOptions,\n runId: number,\n ): Promise<{ target: G9Address; open: G9Segment[]; keep: number }> {\n const parsed = parse(address);\n if (!parsed) throw new Stop('bad-address', -1, null, texts.badAddress());\n const checked = catalogue.check(parsed);\n if (!checked.ok) throw new Stop(checked.reason, checked.at, parsed.segments[checked.at] ?? null, checked.message);\n const target = checked.address;\n const ctx = options.context();\n for (let i = 0; i < target.segments.length; i++) {\n const s = target.segments[i] as G9Segment;\n const def = catalogue.def(s.kind);\n if (!def?.guard) continue;\n let verdict: Awaited<ReturnType<NonNullable<typeof def.guard>>>;\n try {\n verdict = await def.guard(s, target.segments.slice(0, i + 1), ctx);\n } catch (error) {\n emit({ kind: 'error', where: `guard:${s.kind}`, error });\n throw new Stop('failed', i, s, String((error as Error)?.message ?? error));\n }\n if (!verdict.ok)\n throw new Stop(\n verdict.reason,\n i,\n s,\n verdict.message ?? texts.notFound(catalogue.title(s, ctx, options.language())),\n );\n }\n if (running?.id !== runId) throw new Stop('superseded', -1, null, texts.cancelled());\n\n const l = live();\n const path = resolvePath(l, catalogue);\n const plan = planNavigation(target.segments, path, l);\n for (let i = plan.keep; i < target.segments.length; i++) {\n const s = target.segments[i] as G9Segment;\n if (!catalogue.def(s.kind)?.open)\n throw new Stop('not-addressable', i, s, texts.notAddressable(catalogue.title(s, ctx, options.language())));\n }\n // Unsaved work first: nothing is closed until every dirty place agreed.\n for (const token of plan.close) {\n const p = places.get(token);\n if (!p) continue;\n let leave: ReturnType<NonNullable<G9PlaceDeclaration['canLeave']>> = true;\n try {\n leave = p.declaration.canLeave?.() ?? true;\n } catch {\n leave = true;\n }\n if (leave === true) continue;\n const seg = segmentOf(p) ?? toSegment('sheet');\n const title = titleOf(seg, token);\n if (opts.force && opts.source === 'qa') continue;\n const agreed = options.confirmLeave ? await options.confirmLeave(seg, title, leave.message) : false;\n if (!agreed) throw new Stop('dirty', -1, seg, leave.message ?? texts.dirty(title));\n }\n for (const token of plan.close) {\n const p = places.get(token);\n if (!p) continue;\n const seg = segmentOf(p) ?? toSegment('sheet');\n if (!p.declaration.close) throw new Stop('blocked', -1, seg, texts.blocked(titleOf(seg, token)));\n try {\n await p.declaration.close();\n } catch (error) {\n emit({ kind: 'error', where: `close:${seg.kind}`, error });\n }\n const gone = await waitFor(() => !places.has(token), closeTimeoutMs, runId);\n if (!gone) {\n if (running?.id !== runId || running?.cancelled)\n throw new Stop(running?.cancelled ?? 'superseded', -1, null, texts.cancelled());\n throw new Stop('blocked', -1, seg, texts.blocked(titleOf(seg, token)));\n }\n }\n return { target, open: target.segments.slice(plan.keep), keep: plan.keep };\n }\n\n async function sheetGap(): Promise<void> {\n const wait = lastSheetAt + sheetGapMs - now();\n if (wait > 0) await sleep(wait);\n }\n\n async function openStep(target: G9Address, index: number, runId: number): Promise<void> {\n const s = target.segments[index] as G9Segment;\n const def = catalogue.def(s.kind);\n const path = target.segments.slice(0, index + 1);\n await sheetGap();\n // `open` and the place's declaration race inside ONE budget: an `open` that waits on the person (a warning it shows)\n // or never settles cannot hold the router (measured 2026-11-12: a go stuck for minutes behind an unanswered popup).\n let failure: { readonly error: unknown } | null = null;\n let refused = false;\n const wake = () => {\n for (const w of Array.from(waiters)) w();\n };\n void Promise.resolve()\n .then(() => def?.open?.(s, path, options.context()))\n .then(\n (result) => {\n if (result === false && !liveWith(s)) {\n refused = true;\n wake();\n }\n },\n (error: unknown) => {\n emit({ kind: 'error', where: `open:${s.kind}`, error });\n if (liveWith(s)) return;\n failure = { error };\n wake();\n },\n );\n const opened = await waitFor(() => !!liveWith(s) || failure !== null || refused, def?.openTimeoutMs ?? 8000, runId);\n const failed = failure as { readonly error: unknown } | null;\n if (failed) throw new Stop('failed', index, s, String((failed.error as Error)?.message ?? failed.error));\n if (refused)\n throw new Stop('failed', index, s, texts.notOpened(catalogue.title(s, options.context(), options.language())));\n if (!opened || !liveWith(s)) {\n if (running?.id !== runId || running?.cancelled)\n throw new Stop(running?.cancelled ?? 'superseded', index, s, texts.cancelled());\n throw new Stop('timeout', index, s, texts.timeout(catalogue.title(s, options.context(), options.language())));\n }\n }\n\n const currentView = (decl: G9PlaceDeclaration): Readonly<Record<string, string>> => {\n try {\n return decl.view?.() ?? {};\n } catch {\n return {};\n }\n };\n\n const sameView = (a: Readonly<Record<string, string>>, b: Readonly<Record<string, string>>): boolean => {\n const ka = Object.keys(a);\n return ka.length === Object.keys(b).length && ka.every((k) => a[k] === b[k]);\n };\n\n async function applyViews(target: G9Address, views: readonly G9SegmentView[] | undefined): Promise<G9ViewApplied> {\n let worst: G9ViewApplied = 'exact';\n // `skipped` (nothing to scroll on this screen) is as good as exact; only an approximation degrades the result.\n const degrade = (v: G9ViewApplied) => {\n if (v === 'degraded') worst = 'degraded';\n };\n const l = live();\n for (let i = 0; i < target.segments.length; i++) {\n const s = target.segments[i] as G9Segment;\n const p = l.find((x) => sameSegment(x.segment, s));\n const decl = p ? places.get(p.token)?.declaration : undefined;\n const view = { ...(s.params ?? {}), ...(views?.[i]?.view ?? {}) };\n // Arrive exactly: a place showing another view than the address names gets the address's — an address with no\n // parameters is the default view (`/tasks` after `/tasks;q=x` clears the search; seen in a Didban flow).\n if (decl?.applyView && !sameView(currentView(decl), view)) {\n try {\n await decl.applyView(view);\n } catch (error) {\n emit({ kind: 'error', where: `applyView:${s.kind}`, error });\n worst = 'degraded';\n }\n }\n }\n const registry = options.anchors?.() ?? null;\n const marks = registry && views ? views.flatMap((v) => Object.entries(v.scroll ?? {})) : [];\n if (registry && marks.length > 0) {\n let last: G9ViewApplied = 'exact';\n const pass = async () => {\n last = 'exact';\n for (const [id, mark] of marks) {\n const spec = registry.scroller(id);\n if (!spec) {\n last = 'degraded';\n continue;\n }\n const applied = await applyScrollMark(registry, spec, mark);\n if (applied === 'degraded') last = 'degraded';\n }\n };\n await pass();\n // A list may still be filling or re-sorting (measured 2026-11-12: a sampling's detail sync rebuilt the samples\n // list right after the restore scrolled it): once the rows stop coming and going, the marks are applied again.\n if (await rowsSettle(registry, scrollSettleMs, scrollSettleMaxMs)) await pass();\n degrade(last);\n }\n if (target.target && registry) {\n // Measured 2026-11-12: a package's sample rows appear after its sheet declared itself — wait for the row.\n await anchorAppears(registry, target.target, targetTimeoutMs);\n const r = await revealAnchor(registry, target.target);\n if (!r.ok) worst = 'degraded';\n }\n return worst;\n }\n\n async function run(\n address: string | G9Address,\n opts: G9GoOptions,\n mode: 'jump' | 'restore',\n walk?: (target: G9Address, open: readonly G9Segment[], keep: number, runId: number) => Promise<void>,\n as?: G9TrailEntry['cause'],\n ): Promise<G9GoResult> {\n if (running) running.cancelled = 'superseded';\n const id = ++runs;\n running = { id, cancelled: null };\n const text = typeof address === 'string' ? address : formatAddress(address);\n busy.set(true);\n const before = cause;\n cause = as ?? (walk ? 'walk' : mode === 'restore' ? 'restore' : 'go');\n emit({ kind: 'go:start', address: text, mode: walk ? 'walk' : mode });\n let result: G9GoResult;\n try {\n const { target, open, keep } = await prepare(address, opts, id);\n if (walk) await walk(target, open, keep, id);\n else {\n for (let k = 0; k < open.length; k++) {\n await openStep(target, keep + k, id);\n emit({ kind: 'go:step', address: text, index: keep + k, segment: open[k] as G9Segment, how: 'opened' });\n }\n }\n const view = await applyViews(target, opts.views);\n result = { ok: true, location: current.get(), view };\n } catch (error) {\n if (error instanceof Stop) result = failure(error.reason, error.at, error.segment, error.message);\n else {\n emit({ kind: 'error', where: 'go', error });\n result = failure('failed', -1, null, String((error as Error)?.message ?? error));\n }\n } finally {\n cause = before;\n if (running?.id === id) {\n running = null;\n busy.set(false);\n }\n }\n emit({ kind: 'go:done', address: text, result });\n return result;\n }\n\n function snapshot(): G9Snapshot {\n const loc = current.get();\n const l = live();\n const views: G9SegmentView[] = loc.segments.map((s) => {\n const p = l.find((x) => sameSegment(x.segment, s));\n let view: Readonly<Record<string, string>> | undefined;\n try {\n view = p ? places.get(p.token)?.declaration.view?.() : undefined;\n } catch {\n view = undefined;\n }\n return view && Object.keys(view).length > 0 ? { view } : {};\n });\n return {\n v: 1,\n address: loc.unique,\n general: loc.general,\n views,\n facts: loc.facts,\n at: now(),\n app: (typeof options.appVersion === 'function' ? options.appVersion() : options.appVersion) ?? '',\n catalogue: catalogue.hash,\n };\n }\n\n /** The scroll marks of every scroller on screen, on the leaf segment (a snapshot with its scroll positions). */\n async function snapshotWithScroll(): Promise<G9Snapshot> {\n const s = snapshot();\n const registry = options.anchors?.() ?? null;\n if (!registry || s.views.length === 0) return s;\n const scroll: Record<string, G9ScrollMark> = {};\n const ids = new Set<string>();\n for (const a of registry.all()) {\n const sc = registry.scrollerOf(a);\n if (sc) ids.add(sc.id);\n }\n for (const id of ids) {\n const spec = registry.scroller(id);\n if (!spec) continue;\n const box = await measureNode(spec.node());\n if (!box || box.width <= 0 || box.height <= 0) continue;\n const mark = await readScrollMark(registry, spec);\n if (mark.by !== 'start') scroll[id] = mark;\n }\n if (Object.keys(scroll).length === 0) return s;\n const views = s.views.slice();\n const last = views.length - 1;\n views[last] = { ...views[last], scroll };\n return { ...s, views };\n }\n\n function restoreAs(\n s: G9Snapshot,\n opts: G9GoOptions & { readonly maxAgeMs?: number },\n as: G9TrailEntry['cause'],\n ): Promise<G9GoResult> {\n const refusal = snapshotRefusal(s, {\n at: now(),\n catalogue: catalogue.hash,\n maxAgeMs: opts.maxAgeMs ?? Number.POSITIVE_INFINITY,\n });\n if (refusal)\n return Promise.resolve(\n failure(\n refusal === 'catalogue' ? 'bad-address' : 'cancelled',\n -1,\n null,\n `The snapshot is ${refusal === 'catalogue' ? 'from another catalogue' : refusal}.`,\n ),\n );\n const address = s.target ? `${s.address}#${s.target}` : s.address;\n return run(address, { ...opts, source: opts.source ?? 'restore', views: s.views }, 'restore', undefined, as);\n }\n\n const router: G9Router = {\n catalogue,\n current,\n history,\n busy,\n where: () => current.get(),\n declare(declaration): G9PlaceHandle {\n const token = ++tokens;\n places.set(token, { token, declaration, at: now() });\n if (declaration.layer === 'sheet') lastSheetAt = now();\n compute();\n return {\n token,\n touch: () => {\n if (places.has(token)) compute();\n },\n remove: () => {\n if (places.delete(token)) compute();\n },\n };\n },\n go: (address, opts = {}) => run(address, opts, 'jump'),\n walk(address, opts = {}) {\n const steps = store<readonly G9WalkStep[]>([]);\n const by = opts.by ?? 'user';\n let cancelledByCaller = false;\n const setStep = (index: number, state: G9WalkStep['state']) =>\n steps.set(steps.get().map((s) => (s.index === index ? { ...s, state } : s)));\n const result = run(address, opts, 'jump', async (target, open, keep, runId) => {\n const ctx = options.context();\n steps.set(\n open.map((segment, k) => ({\n index: keep + k,\n segment,\n title: catalogue.title(segment, ctx, options.language()),\n state: 'pending',\n })),\n );\n for (let k = 0; k < open.length; k++) {\n const index = keep + k;\n const s = open[k] as G9Segment;\n if (cancelledByCaller) throw new Stop('cancelled', index, s, texts.cancelled());\n setStep(index, 'current');\n const def = catalogue.def(s.kind);\n let entry: G9Entry | null = null;\n try {\n entry = (await def?.entry?.(s, target.segments.slice(0, index + 1), ctx)) ?? null;\n } catch (error) {\n emit({ kind: 'error', where: `entry:${s.kind}`, error });\n }\n const registry = options.anchors?.() ?? null;\n let walked = false;\n if (entry && registry) {\n if (entry.prepare) {\n if (entry.prepareText) opts.presenter?.note?.(entry.prepareText);\n try {\n await entry.prepare();\n } catch (error) {\n emit({ kind: 'error', where: `prepare:${s.kind}`, error });\n }\n }\n await sheetGap();\n const shown = await revealAnchor(registry, entry.anchor, { smooth: true });\n if (shown.ok && shown.anchor) {\n const title = catalogue.title(s, ctx, options.language());\n const view = opts.presenter?.show({\n anchor: entry.anchor,\n text: title,\n gesture: entry.gesture ?? 'tap',\n index: k,\n count: open.length,\n });\n try {\n if (by === 'demo') {\n await sleep(opts.demoDelayMs ?? 900);\n // Pressed, not awaited: a press that opens a popup and waits on the person must not hold the walk.\n const press = shown.anchor.info().capabilities?.activate;\n void Promise.resolve()\n .then(() => press?.())\n .catch((error: unknown) => emit({ kind: 'error', where: `activate:${s.kind}`, error }));\n }\n walked = await waitFor(\n () => !!liveWith(s),\n opts.stepTimeoutMs ?? (by === 'demo' ? 8000 : 60000),\n runId,\n );\n } finally {\n view?.hide();\n }\n if (!walked) {\n if (cancelledByCaller || running?.id !== runId || running?.cancelled)\n throw new Stop('cancelled', index, s, texts.cancelled());\n setStep(index, 'failed');\n throw new Stop('timeout', index, s, texts.timeout(title));\n }\n }\n }\n if (!walked) {\n opts.presenter?.note?.(texts.jumped(catalogue.title(s, ctx, options.language())));\n await openStep(target, index, runId);\n setStep(index, 'jumped');\n } else setStep(index, 'done');\n emit({\n kind: 'go:step',\n address: formatAddress(target),\n index,\n segment: s,\n how: walked ? 'walked' : 'jumped',\n });\n }\n });\n return {\n steps,\n result,\n cancel() {\n cancelledByCaller = true;\n if (running) running.cancelled = 'cancelled';\n for (const w of Array.from(waiters)) w();\n },\n };\n },\n snapshot,\n snapshotWithScroll,\n restore: (s, opts = {}) => restoreAs(s, opts, 'restore'),\n async excursion(address, opts = {}) {\n const origin = await snapshotWithScroll();\n const result = await run(address, opts, 'jump');\n return {\n origin,\n result,\n back: async () => {\n return await restoreAs(origin, { source: opts.source ?? 'user' }, 'back');\n },\n };\n },\n placeAt(index) {\n const l = live();\n const path = resolvePath(l, catalogue);\n const t = path.tokens[index];\n return t === null || t === undefined ? null : (places.get(t)?.declaration ?? null);\n },\n reset() {\n if (running) running.cancelled = 'session-ended';\n for (const w of Array.from(waiters)) w();\n history.set([]);\n },\n };\n return router;\n}\n\n/** The layers a declaration may use (re-exported for places outside the controls). */\nexport type { G9PlaceLayer };\n"],"names":["DEFAULT_TEXTS","t","isG9Router","sink","store","initial","value","listeners","Set","v","Object","l","Array","Stop","Error","reason","at","segment","message","sleep","ms","Promise","r","g9RuntimeTimers","createG9Router","options","_options_now","_options_sheetGapMs","_options_closeTimeoutMs","_options_targetTimeoutMs","_options_scrollSettleMs","_options_scrollSettleMaxMs","_options_historySize","catalogue","now","Date","texts","sheetGapMs","closeTimeoutMs","targetTimeoutMs","scrollSettleMs","scrollSettleMaxMs","historySize","places","Map","tokens","revision","lastSheetAt","Number","cause","running","runs","waiters","emit","event","segmentOf","p","s","toSegment","error","isShown","_p_declaration","live","out","_p_declaration_order","_p_declaration_under","titleOf","token","_places_get","decl","undefined","empty","current","history","busy","compute","path","resolvePath","unique","formatAddress","titles","i","_path_tokens_i","byToken","others","_byToken_get","generalOf","facts","ordered","_places_get_declaration","prev","same","JSON","next","trail","w","waitFor","predicate","timeoutMs","runId","resolve","done","finish","ok","check","timer","rowsSettle","registry","quietMs","maxMs","changed","quiet","off","cap","arm","anchorAppears","id","liveWith","_live_find","sameSegment","parse","address","tryParseAddress","failure","prepare","opts","_parsed_segments_checked_at","parsed","checked","target","ctx","_verdict_message","def","verdict","String","plan","planNavigation","_catalogue_def","_segmentOf","_leave_message","leave","seg","title","agreed","_segmentOf1","gone","sheetGap","wait","openStep","index","_failed_error","refused","wake","result","opened","failed","currentView","sameView","a","b","ka","k","applyViews","views","worst","degrade","_s_params","_views_i","x","view","marks","_v_scroll","last","pass","mark","spec","applied","applyScrollMark","revealAnchor","run","mode","walk","as","text","before","open","keep","snapshot","_ref","loc","snapshotWithScroll","scroll","ids","sc","box","measureNode","readScrollMark","restoreAs","_opts_maxAgeMs","_opts_source","refusal","snapshotRefusal","router","declaration","_opts_by","steps","by","cancelledByCaller","setStep","state","entry","_ref1","walked","_opts_presenter","shown","_entry_gesture","_opts_presenter1","_opts_stepTimeoutMs","_opts_demoDelayMs","_shown_anchor_info_capabilities","press","_opts_presenter2","origin"],"mappings":";;;;;;;;;;;;;AA2MA,MAAMA,gBAA+B;IACnC,UAAU,CAACC,IAAM,CAAC,CAAC,EAAEA,EAAE,wBAAwB,CAAC;IAChD,SAAS,CAACA,IAAM,CAAC,CAAC,EAAEA,EAAE,uBAAuB,CAAC;IAC9C,SAAS,CAACA,IAAM,CAAC,CAAC,EAAEA,EAAE,uBAAuB,CAAC;IAC9C,WAAW,CAACA,IAAM,CAAC,CAAC,EAAEA,EAAE,sBAAsB,CAAC;IAC/C,OAAO,CAACA,IAAM,CAAC,CAAC,EAAEA,EAAE,sBAAsB,CAAC;IAC3C,gBAAgB,CAACA,IAAM,CAAC,CAAC,EAAEA,EAAE,4BAA4B,CAA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,SAAU2C;gBACvC;YACF;QACF;QACA4F;QACAG;QACA,SAAS,CAACrI,GAAGoE,OAAO,CAAC,CAAC,GAAKwE,UAAU5I,GAAGoE,MAAM;QAC9C,MAAM,WAAUJ,OAAO,EAAEI,OAAO,CAAC,CAAC;YAChC,MAAMiG,SAAS,MAAMhC;YACrB,MAAMrC,SAAS,MAAM0B,IAAI1D,SAASI,MAAM;YACxC,OAAO;gBACLiG;gBACArE;gBACA,MAAM;wBACqC8C;oBAAzC,OAAO,MAAMF,UAAUyB,QAAQ;wBAAE,QAAQ,QAAAvB,CAAAA,eAAAA,KAAK,MAAM,AAAD,IAAVA,eAAe;oBAAO,GAAG;gBACpE;YACF;QACF;QACA,SAAQlD,KAAK;;gBAIoCjF;YAH/C,MAAMzD,IAAImD;YACV,MAAMc,OAAOC,YAAYlE,GAAGsB;YAC5B,MAAMhC,IAAI2E,KAAK,MAAM,CAACyE,MAAM;YAC5B,OAAOpJ,QAAAA,IAAgC,OAAO,QAAC,QAAR,QAAQmE,CAAAA,cAAAA,OAAO,GAAG,CAACnE,EAAC,IAAZmE,KAAAA,IAAAA,YAAe,WAAW,AAAD,IAAC,OAAI;QAC/E;QACA;YACE,IAAIlB,SAASA,QAAQ,SAAS,GAAG;YACjC,KAAK,MAAM6C,KAAKnF,MAAM,IAAI,CAACwC,SAAU2C;YACrCtB,QAAQ,GAAG,CAAC,EAAE;QAChB;IACF;IACA,OAAOiI;AACT"}
@@ -2,7 +2,7 @@ import './sheet.css';
2
2
  import { type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';
3
3
  import { type ReactNode } from '@lynx-js/react';
4
4
  import type { G9SheetHeightMemo } from './height-memo.js';
5
- import type { G9SheetSettings } from './options.js';
5
+ import type { G9SheetDetent, G9SheetSettings } from './options.js';
6
6
  import type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack.js';
7
7
  /** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */
8
8
  export interface G9SheetContextValue {
@@ -38,6 +38,8 @@ export interface G9SheetFrameProps {
38
38
  /** The sheet came to rest at a new height (px); drives the page recede threshold. */
39
39
  readonly onRest?: (heightPx: number) => void;
40
40
  }
41
+ /** The lynx-ui snap index of where a sheet rests: 0 for a fit sheet, else its detent's place (0 when it is unknown). */
42
+ export declare function restingSnapIndex(resting: G9SheetDetent | 'fit', fit: boolean, detents: readonly G9SheetDetent[]): number;
41
43
  /**
42
44
  * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,
43
45
  * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets
@@ -1 +1 @@
1
- {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/sheet/frame.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EAKnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,gBAAgB,CAAC;AASxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,WAAW,CAAC;AAgBhE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,qGAAqG;AACrG,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAID,kDAAkD;AAClD,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9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;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAoZhE"}
@@ -1,13 +1,15 @@
1
1
  import "./sheet.css";
2
2
  import { createAbortController, formatColor, g9Ms, resolveThemeColor, tryParseColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
3
3
  import { SheetContent, SheetRoot, SheetView } from "@lynx-js/lynx-ui-sheet";
4
- import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
4
+ import { createContext, useContext, useEffect, useMemo, useRef, useState } from "@lynx-js/react";
5
+ import { G9AnchorLayerContext } from "../anchor/context.jsx";
5
6
  import { g9IdProps } from "../base/control.jsx";
6
7
  import { startTimer, stopTimer } from "../base/timers.jsx";
7
8
  import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
8
9
  import { G9SheetSkeleton } from "../display/shimmer.jsx";
9
10
  import { g9FieldNotchStyle } from "../fields/notch.jsx";
10
11
  import { useG9Theme } from "../provider/hooks.jsx";
12
+ import { sheetSegmentOf, useG9Place } from "../route/hooks.jsx";
11
13
  import { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from "./gesture.jsx";
12
14
  import { G9SheetFooter, G9SheetHeader } from "./header.jsx";
13
15
  import { resolveSheetMotion } from "./motion.jsx";
@@ -39,6 +41,10 @@ function orderedDetents(o) {
39
41
  'large'
40
42
  ].filter((d)=>requested.includes(d));
41
43
  }
44
+ function restingSnapIndex(resting, fit, detents) {
45
+ if (fit || 'fit' === resting) return 0;
46
+ return Math.max(0, detents.indexOf(resting));
47
+ }
42
48
  function initialDetent(o, fit) {
43
49
  var _o_currentState, _ordered_;
44
50
  if (fit) return 'fit';
@@ -47,13 +53,28 @@ function initialDetent(o, fit) {
47
53
  return ordered.includes(current) ? current : null != (_ordered_ = ordered[0]) ? _ordered_ : 'medium';
48
54
  }
49
55
  function G9SheetFrame(props) {
50
- var _ref, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _props_bottomInset, _o_scrollToEndThreshold, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _ratios_restIndex, _o_padding, _o_padding1, _o_padding2;
51
- var _props_memo;
56
+ var _o_route, _ref, _ref1, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _props_bottomInset, _o_scrollToEndThreshold, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _ratios_restIndex, _o_padding, _o_padding1, _o_padding2;
57
+ var _o_route1, _o_route2, _props_memo;
52
58
  const { entry, stack, settings } = props;
53
59
  const palette = useG9Theme().palette;
54
60
  const gesture = useSheetGestureRefs();
55
61
  const bodyGesture = useSheetBodyGesture(gesture);
56
62
  const o = entry.options;
63
+ const placeOpen = 'opening' === entry.status || 'open' === entry.status;
64
+ useG9Place({
65
+ ...null != (_o_route = o.route) ? _o_route : {},
66
+ segment: null != (_ref = null == (_o_route1 = o.route) ? void 0 : _o_route1.segment) ? _ref : sheetSegmentOf(o.automationId),
67
+ layer: 'sheet',
68
+ order: entry.id,
69
+ ...(null == (_o_route2 = o.route) ? void 0 : _o_route2.title) ? {} : 'string' == typeof o.title && o.title.trim() ? {
70
+ title: ()=>'string' == typeof o.title ? o.title : null
71
+ } : {},
72
+ close: ()=>{
73
+ stack.close(entry.id);
74
+ }
75
+ }, {
76
+ active: placeOpen
77
+ });
57
78
  const layout = resolveSheetLayout(o, props.hostHeight);
58
79
  const showing = 'opening' === entry.status || 'open' === entry.status;
59
80
  const closing = 'closing' === entry.status;
@@ -100,7 +121,7 @@ function G9SheetFrame(props) {
100
121
  entry.status
101
122
  ]);
102
123
  const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;
103
- const placeholderHeight = o.useFullScreenLoadingPlaceholder ? props.hostHeight : null != (_ref = null != (_o_deferredLoadingPlaceholderHeight = o.deferredLoadingPlaceholderHeight) ? _o_deferredLoadingPlaceholderHeight : memoKey ? null == (_props_memo = props.memo) ? void 0 : _props_memo.lookup(memoKey) : void 0) ? _ref : g9SheetFitLoadingMinHeight;
124
+ const placeholderHeight = o.useFullScreenLoadingPlaceholder ? props.hostHeight : null != (_ref1 = null != (_o_deferredLoadingPlaceholderHeight = o.deferredLoadingPlaceholderHeight) ? _o_deferredLoadingPlaceholderHeight : memoKey ? null == (_props_memo = props.memo) ? void 0 : _props_memo.lookup(memoKey) : void 0) ? _ref1 : g9SheetFitLoadingMinHeight;
104
125
  const [bodyHeight, setBodyHeight] = useState(0);
105
126
  const [footerHeight, setFooterHeight] = useState(0);
106
127
  const [chromeTopHeight, setChromeTopHeight] = useState(0);
@@ -167,9 +188,28 @@ function G9SheetFrame(props) {
167
188
  resting,
168
189
  layout.fit
169
190
  ]);
191
+ const lastHostHeight = useRef(props.hostHeight);
192
+ useEffect(()=>{
193
+ var _rootRef_current;
194
+ if (Math.abs(lastHostHeight.current - props.hostHeight) < 1) return;
195
+ lastHostHeight.current = props.hostHeight;
196
+ if ('open' !== entry.status) return;
197
+ null == (_rootRef_current = rootRef.current) || _rootRef_current.snapTo(restingSnapIndex(resting, layout.fit, orderedDetents(o)), {
198
+ animate: false
199
+ });
200
+ }, [
201
+ props.hostHeight,
202
+ entry.status
203
+ ]);
170
204
  const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);
171
205
  const bottomPadding = sheetSurfaceBottomPadding(o, null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0);
172
206
  const maxBody = null === layout.fitMaxHeight ? null : Math.max(g9SheetFitMinHeight, layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding);
207
+ const anchorLayer = useMemo(()=>({
208
+ layer: 'sheet',
209
+ sheetId: props.entry.id
210
+ }), [
211
+ props.entry.id
212
+ ]);
173
213
  const contextValue = {
174
214
  handle,
175
215
  signal: controller.current.signal,
@@ -247,19 +287,20 @@ function G9SheetFrame(props) {
247
287
  ...notch
248
288
  }}>
249
289
  <SheetContext.Provider value={contextValue}>
250
- <view className="g9-sheet__chrome-top" bindlayoutchange={onChromeTopLayout}>
251
- {layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
252
- <view className="g9-sheet__grabber"/>
253
- </view> : null}
254
- <G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
255
- {o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap"/> : null}
256
- </view>
257
- {false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
290
+ <G9AnchorLayerContext.Provider value={anchorLayer}>
291
+ <view className="g9-sheet__chrome-top" bindlayoutchange={onChromeTopLayout}>
292
+ {layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
293
+ <view className="g9-sheet__grabber"/>
294
+ </view> : null}
295
+ <G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
296
+ {o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap"/> : null}
297
+ </view>
298
+ {false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
258
299
  padding: `${null != (_o_padding = o.padding) ? _o_padding : 0}px`
259
300
  }}>
260
- {content}
261
- </view> : indicator.current ? <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>
262
- <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} scroll-event-throttle={16} {...endProps} bindscroll={(e)=>{
301
+ {content}
302
+ </view> : indicator.current ? <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>
303
+ <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} scroll-event-throttle={16} {...endProps} bindscroll={(e)=>{
263
304
  var _ref;
264
305
  var _e_detail, _indicator_current;
265
306
  return null == (_indicator_current = indicator.current) ? void 0 : _indicator_current.setTop(null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.scrollTop) ? _ref : 0);
@@ -273,20 +314,21 @@ function G9SheetFrame(props) {
273
314
  maxHeight: `${maxBody}px`
274
315
  } : {}
275
316
  }}>
276
- {content}
277
- </scroll-view>
278
- <G9SheetScrollIndicator model={indicator.current}/>
279
- </view> : <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} {...endProps} style={{
317
+ {content}
318
+ </scroll-view>
319
+ <G9SheetScrollIndicator model={indicator.current}/>
320
+ </view> : <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} {...endProps} style={{
280
321
  padding: `${null != (_o_padding2 = o.padding) ? _o_padding2 : 0}px`,
281
322
  ...null !== maxBody ? {
282
323
  maxHeight: `${maxBody}px`
283
324
  } : {}
284
325
  }}>
285
- {content}
286
- </scroll-view>}
287
- <view className="g9-sheet__footer-slot" bindlayoutchange={onFooterLayout}>
288
- <G9SheetFooter options={o}/>
289
- </view>
326
+ {content}
327
+ </scroll-view>}
328
+ <view className="g9-sheet__footer-slot" bindlayoutchange={onFooterLayout}>
329
+ <G9SheetFooter options={o}/>
330
+ </view>
331
+ </G9AnchorLayerContext.Provider>
290
332
  </SheetContext.Provider>
291
333
  </view>
292
334
  {}
@@ -298,6 +340,6 @@ function G9SheetFrame(props) {
298
340
  </SheetView>
299
341
  </SheetRoot>;
300
342
  }
301
- export { G9SheetFrame, useG9SheetContext };
343
+ export { G9SheetFrame, restingSnapIndex, useG9SheetContext };
302
344
 
303
345
  //# sourceMappingURL=frame.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n g9Ms,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport { G9SheetScrollIndicator, G9SheetScrollModel } from './scroll-indicator';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n g9SheetScrollToEndThreshold,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = (): string => `transform ${g9Ms(220)}ms ease-out, opacity ${g9Ms(220)}ms ease-out`;\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), g9Ms(220));\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n // `scrollIndicator: 'always'` (./scroll-indicator.tsx): the thumb's own store, fed by the body and its content.\n const indicator = useRef<G9SheetScrollModel | null>(null);\n if (o.scrollIndicator === 'always' && o.scrollBody !== false && !indicator.current)\n indicator.current = new G9SheetScrollModel();\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n // The scroller's range is the content plus the body's padding on both sides.\n indicator.current?.setContent(h > 0 ? h + 2 * (o.padding ?? 0) : 0);\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n // A body that renders a window of a long list grows it when the scroll nears the end (options.onScrollToEnd).\n const endProps = o.onScrollToEnd\n ? { 'lower-threshold': o.scrollToEndThreshold ?? g9SheetScrollToEndThreshold, bindscrolltolower: o.onScrollToEnd }\n : {};\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n // Never flattened: a flattened view is painted on the Lynx root canvas, which a native SurfaceView (a map)\n // covers — the dim vanished over AgriPad's map while the sheet itself, a native view, still showed.\n flatten={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition() }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <view className=\"g9-sheet__chrome-top\" bindlayoutchange={onChromeTopLayout}>\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : indicator.current ? (\n // The thumb's frame: the scroller and the thumb over its inline end (only with scrollIndicator).\n <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n scroll-event-throttle={16}\n {...endProps}\n bindscroll={(e: { detail?: { scrollTop?: number } }) =>\n indicator.current?.setTop(e.detail?.scrollTop ?? 0)\n }\n bindlayoutchange={(e: { detail?: { height?: number } }) =>\n indicator.current?.setViewport(e.detail?.height ?? 0)\n }\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n <G9SheetScrollIndicator model={indicator.current} />\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n {...endProps}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","g9Ms","orderedDetents","o","requested","d","initialDetent","fit","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_ref","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_scrollToEndThreshold","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_o_padding2","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","Math","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","indicator","G9SheetScrollModel","onBodyLayout","_indicator_current","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","resting","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","contextValue","platform","currentPlatform","phone","endProps","g9SheetScrollToEndThreshold","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","detents","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9SheetHeader","scroll-view","G9SheetScrollIndicator","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAsBA,SAASI,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IACnE,IAAI,CAACG,QAAQ,OAAOD,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IAC1D,OAAOK,YAAYC,UAAUH,QAAQD,WAAWC,OAAO,CAAC,GAAGF;AAC7D;AAGA,MAAMM,kBAAkB;IAAE,SAAS;IAAQ,eAAe;AAAS;AAEnE,MAAMC,0BAA0B,IAAc,CAAC,UAAU,EAAEC,KAAK,KAAK,qBAAqB,EAAEA,KAAK,KAAK,WAAW,CAAC;AAGlH,SAASC,eAAeC,CAA0B;IAChD,MAAMC,YAAYD,EAAE,MAAM,IAAIA,EAAE,MAAM,CAAC,MAAM,GAAG,IAAIA,EAAE,MAAM,GAAI;QAAC;QAAU;KAAQ;IACnF,OAAQ;QAAC;QAAQ;QAAU;KAAQ,CAAW,MAAM,CAAC,CAACE,IAAMD,UAAU,QAAQ,CAACC;AACjF;AAGA,SAASC,cAAcH,CAA0B,EAAEI,GAAY;QAG7CC,iBAC8BC;IAH9C,IAAIF,KAAK,OAAO;IAChB,MAAMG,UAAUR,eAAeC;IAC/B,MAAMQ,UAAU,QAAAH,CAAAA,kBAAAA,EAAE,YAAY,AAAD,IAAbA,kBAAkB;IAClC,OAAOE,QAAQ,QAAQ,CAACC,WAAWA,UAAU,QAACF,CAAAA,YAAAA,OAAO,CAAC,EAAE,AAAD,IAATA,YAAc;AAC9D;AAOO,SAASG,aAAaC,KA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AK;cACT,EAAE9F,aAAa,SAAS;YAC1B,EAAE8F,KAAK;YACP,EAAqG;YACrG,CAACA,KAAK,UAAU,kBAAkB,OAAO;QAAE,iBAAiBmC;IAAQ,IAAK;UAC3E,EAAEsB,oBAAoB;QACxB,EAAEF,aAAa;MACjB,EAAED,UAAU;IACd,EAAEP;AAEN"}
1
+ {"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n g9Ms,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { G9AnchorLayerContext } from '../anchor/context';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { sheetSegmentOf, useG9Place } from '../route/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport { G9SheetScrollIndicator, G9SheetScrollModel } from './scroll-indicator';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n g9SheetScrollToEndThreshold,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = (): string => `transform ${g9Ms(220)}ms ease-out, opacity ${g9Ms(220)}ms ease-out`;\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The lynx-ui snap index of where a sheet rests: 0 for a fit sheet, else its detent's place (0 when it is unknown). */\nexport function restingSnapIndex(\n resting: G9SheetDetent | 'fit',\n fit: boolean,\n detents: readonly G9SheetDetent[],\n): number {\n if (fit || resting === 'fit') return 0;\n return Math.max(0, detents.indexOf(resting));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n // The sheet's place in the navigation: declared from the moment it opens until it starts closing.\n const placeOpen = entry.status === 'opening' || entry.status === 'open';\n useG9Place(\n {\n ...(o.route ?? {}),\n segment: o.route?.segment ?? sheetSegmentOf(o.automationId),\n layer: 'sheet',\n order: entry.id,\n ...(o.route?.title\n ? {}\n : typeof o.title === 'string' && o.title.trim()\n ? { title: () => (typeof o.title === 'string' ? o.title : null) }\n : {}),\n close: () => {\n stack.close(entry.id);\n },\n },\n { active: placeOpen },\n );\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), g9Ms(220));\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n // `scrollIndicator: 'always'` (./scroll-indicator.tsx): the thumb's own store, fed by the body and its content.\n const indicator = useRef<G9SheetScrollModel | null>(null);\n if (o.scrollIndicator === 'always' && o.scrollBody !== false && !indicator.current)\n indicator.current = new G9SheetScrollModel();\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n // The scroller's range is the content plus the body's padding on both sides.\n indicator.current?.setContent(h > 0 ? h + 2 * (o.padding ?? 0) : 0);\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n // The host's height changed while the sheet was up — the soft keyboard on a host that pads the page by its inset (AgriPad\n // Android, 2026-11-12): lynx-ui keeps the open offset it computed for the OLD height, so a full-screen sheet opened at\n // 760 and squeezed to 463 stood 297 above the screen's top, its footer mid-screen and a band of page under it. Snap\n // again to where it rests, without motion, so the offset is computed for the new height.\n const lastHostHeight = useRef(props.hostHeight);\n useEffect(() => {\n if (Math.abs(lastHostHeight.current - props.hostHeight) < 1) return;\n lastHostHeight.current = props.hostHeight;\n if (entry.status !== 'open') return;\n rootRef.current?.snapTo(restingSnapIndex(resting, layout.fit, orderedDetents(o)), { animate: false });\n }, [props.hostHeight, entry.status]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const anchorLayer = useMemo(() => ({ layer: 'sheet' as const, sheetId: props.entry.id }), [props.entry.id]);\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n // A body that renders a window of a long list grows it when the scroll nears the end (options.onScrollToEnd).\n const endProps = o.onScrollToEnd\n ? { 'lower-threshold': o.scrollToEndThreshold ?? g9SheetScrollToEndThreshold, bindscrolltolower: o.onScrollToEnd }\n : {};\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n // Never flattened: a flattened view is painted on the Lynx root canvas, which a native SurfaceView (a map)\n // covers — the dim vanished over AgriPad's map while the sheet itself, a native view, still showed.\n flatten={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition() }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <G9AnchorLayerContext.Provider value={anchorLayer}>\n <view className=\"g9-sheet__chrome-top\" bindlayoutchange={onChromeTopLayout}>\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : indicator.current ? (\n // The thumb's frame: the scroller and the thumb over its inline end (only with scrollIndicator).\n <view className={`g9-sheet__body-frame${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}>\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n scroll-event-throttle={16}\n {...endProps}\n bindscroll={(e: { detail?: { scrollTop?: number } }) =>\n indicator.current?.setTop(e.detail?.scrollTop ?? 0)\n }\n bindlayoutchange={(e: { detail?: { height?: number } }) =>\n indicator.current?.setViewport(e.detail?.height ?? 0)\n }\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n <G9SheetScrollIndicator model={indicator.current} />\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n {...endProps}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </G9AnchorLayerContext.Provider>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","g9Ms","orderedDetents","o","requested","d","restingSnapIndex","resting","fit","detents","Math","initialDetent","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_o_route","_ref1","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_scrollToEndThreshold","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_o_padding2","_o_route1","_o_route2","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","placeOpen","useG9Place","sheetSegmentOf","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","indicator","G9SheetScrollModel","onBodyLayout","_indicator_current","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","lastHostHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","anchorLayer","useMemo","contextValue","platform","currentPlatform","phone","endProps","g9SheetScrollToEndThreshold","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9AnchorLayerContext","G9SheetHeader","scroll-view","G9SheetScrollIndicator","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;;;;AAyDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAO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F;kBACF,CAAC9D,KAAK,UAAU,wBAAwB,kBAAkBP,gBAAgB;oBACxE,CAACuE,cAAc,SAAStJ,IAAK;kBAC/B,EAAEsF,KAAK;gBACT,EAAE4D,qBAAqB,SAAS;cAClC,EAAEnK,aAAa,SAAS;YAC1B,EAAEuG,KAAK;YACP,EAAqG;YACrG,CAACA,KAAK,UAAU,kBAAkB,OAAO;QAAE,iBAAiBqC;IAAQ,IAAK;UAC3E,EAAEqB,oBAAoB;QACxB,EAAEF,aAAa;MACjB,EAAED,UAAU;IACd,EAAEP;AAEN"}
@@ -1,6 +1,14 @@
1
+ import type { G9PlaceDeclaration, G9SegmentInput } from '@g9tm/lynxcontrols-foundation';
1
2
  import type { ReactNode } from '@lynx-js/react';
2
3
  import type { G9BottomSheetLoadingSkeleton } from '../display/shimmer.js';
3
4
  import type { G9IconInput } from '../icon/icon.js';
5
+ /**
6
+ * The place a sheet is in the app's navigation (`@g9tm/lynxcontrols/route`): declared while the sheet is open, closed
7
+ * through the sheet itself. Without it a sheet still shows in the address, as `sheet.<automation id>`.
8
+ */
9
+ export interface G9SheetRoute extends Omit<G9PlaceDeclaration, 'segment' | 'layer' | 'order' | 'close'> {
10
+ readonly segment: G9SegmentInput | (() => G9SegmentInput);
11
+ }
4
12
  /** Detents (MAUI `G9BottomSheetState`): peek (collapsed height), medium (half), large (full). */
5
13
  export type G9SheetDetent = 'peek' | 'medium' | 'large';
6
14
  /** Detent sizing or fit-to-content (MAUI `G9BottomSheetSizeMode`). */
@@ -183,6 +191,8 @@ export interface G9SheetOptions extends G9SheetLifecycle {
183
191
  * `${id}_Back`, toolbar items `${id}_ToolbarItem_${key or index}` (see `g9ChildId`). Keep it to `[A-Za-z0-9_-]`.
184
192
  */
185
193
  readonly automationId?: string;
194
+ /** The sheet's place in the navigation address (see {@link G9SheetRoute}). */
195
+ readonly route?: G9SheetRoute;
186
196
  readonly title?: string | null;
187
197
  readonly toolbarItems?: ReadonlyArray<G9SheetToolbarItem> | null;
188
198
  /** Items built from the content once it exists. */