@g9tm/lynxcontrols 1.4.11 → 1.6.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 (146) 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/fields/use-text-input.d.ts +1 -1
  61. package/dist/guide/confirm-sheet.d.ts +26 -0
  62. package/dist/guide/confirm-sheet.d.ts.map +1 -0
  63. package/dist/guide/confirm-sheet.jsx +146 -0
  64. package/dist/guide/confirm-sheet.jsx.map +1 -0
  65. package/dist/guide/guide.css +428 -0
  66. package/dist/guide/guide.css.map +1 -0
  67. package/dist/guide/index.d.ts +5 -0
  68. package/dist/guide/index.d.ts.map +1 -0
  69. package/dist/guide/index.jsx +4 -0
  70. package/dist/guide/journey.d.ts +46 -0
  71. package/dist/guide/journey.d.ts.map +1 -0
  72. package/dist/guide/journey.jsx +462 -0
  73. package/dist/guide/journey.jsx.map +1 -0
  74. package/dist/guide/placement.d.ts +44 -0
  75. package/dist/guide/placement.d.ts.map +1 -0
  76. package/dist/guide/placement.jsx +119 -0
  77. package/dist/guide/placement.jsx.map +1 -0
  78. package/dist/guide/service.d.ts +95 -0
  79. package/dist/guide/service.d.ts.map +1 -0
  80. package/dist/guide/service.jsx +566 -0
  81. package/dist/guide/service.jsx.map +1 -0
  82. package/dist/guide/settings.d.ts +68 -0
  83. package/dist/guide/settings.d.ts.map +1 -0
  84. package/dist/guide/settings.jsx +66 -0
  85. package/dist/guide/settings.jsx.map +1 -0
  86. package/dist/host/host.d.ts +5 -1
  87. package/dist/host/host.d.ts.map +1 -1
  88. package/dist/host/host.jsx +12 -0
  89. package/dist/host/host.jsx.map +1 -1
  90. package/dist/host/layers.d.ts +3 -1
  91. package/dist/host/layers.d.ts.map +1 -1
  92. package/dist/host/layers.jsx +4 -2
  93. package/dist/host/layers.jsx.map +1 -1
  94. package/dist/host/registry.d.ts +3 -0
  95. package/dist/host/registry.d.ts.map +1 -1
  96. package/dist/host/registry.jsx.map +1 -1
  97. package/dist/index.d.ts +3 -0
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/provider/contexts.d.ts +3 -0
  100. package/dist/provider/contexts.d.ts.map +1 -1
  101. package/dist/provider/contexts.jsx.map +1 -1
  102. package/dist/provider/provider.d.ts.map +1 -1
  103. package/dist/provider/provider.jsx +24 -17
  104. package/dist/provider/provider.jsx.map +1 -1
  105. package/dist/provider/settings.d.ts +4 -0
  106. package/dist/provider/settings.d.ts.map +1 -1
  107. package/dist/provider/settings.jsx +3 -2
  108. package/dist/provider/settings.jsx.map +1 -1
  109. package/dist/route/hooks.d.ts +34 -0
  110. package/dist/route/hooks.d.ts.map +1 -0
  111. package/dist/route/hooks.jsx +147 -0
  112. package/dist/route/hooks.jsx.map +1 -0
  113. package/dist/route/index.d.ts +3 -0
  114. package/dist/route/index.d.ts.map +1 -0
  115. package/dist/route/index.jsx +2 -0
  116. package/dist/route/router.d.ts +201 -0
  117. package/dist/route/router.d.ts.map +1 -0
  118. package/dist/route/router.jsx +810 -0
  119. package/dist/route/router.jsx.map +1 -0
  120. package/dist/sheet/frame.d.ts +3 -1
  121. package/dist/sheet/frame.d.ts.map +1 -1
  122. package/dist/sheet/frame.jsx +67 -25
  123. package/dist/sheet/frame.jsx.map +1 -1
  124. package/dist/sheet/options.d.ts +10 -0
  125. package/dist/sheet/options.d.ts.map +1 -1
  126. package/dist/sheet/options.jsx.map +1 -1
  127. package/dist/sheet/service.d.ts +5 -0
  128. package/dist/sheet/service.d.ts.map +1 -1
  129. package/dist/sheet/service.jsx +14 -2
  130. package/dist/sheet/service.jsx.map +1 -1
  131. package/dist/sheet/sheet.css +9 -0
  132. package/dist/sheet/sheet.css.map +1 -1
  133. package/dist/tabs/tab-view.d.ts +14 -0
  134. package/dist/tabs/tab-view.d.ts.map +1 -1
  135. package/dist/tabs/tab-view.jsx +59 -3
  136. package/dist/tabs/tab-view.jsx.map +1 -1
  137. package/dist/toggle/checkbox.d.ts.map +1 -1
  138. package/dist/toggle/checkbox.jsx +15 -1
  139. package/dist/toggle/checkbox.jsx.map +1 -1
  140. package/dist/toggle/chip-group.d.ts.map +1 -1
  141. package/dist/toggle/chip-group.jsx +12 -1
  142. package/dist/toggle/chip-group.jsx.map +1 -1
  143. package/dist/toggle/switch.d.ts.map +1 -1
  144. package/dist/toggle/switch.jsx +15 -1
  145. package/dist/toggle/switch.jsx.map +1 -1
  146. package/package.json +17 -2
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAGlB,KAAK,cAAc,EACnB,KAAK,YAAY,EAMlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAA8D,MAAM,gBAAgB,CAAC;AAgB5G,OAAO,EAAE,KAAK,UAAU,EAA4C,MAAM,YAAY,CAAC;AAEvF,OAAO,gBAAgB,CAAC;AACxB,OAAO,a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,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC/C,kHAAkH;IAClH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,gEAAgE;IAChE,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AA6BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAwO5D"}
@@ -1,5 +1,7 @@
1
1
  import { assertRequiredCapabilities, createCultureStore, createDiagnostics, createIconFontRegistry, createPreferences, createSafeExecutor, createStrings, createThemeStore, g9MotionScale, subscribeG9Motion, toCssVariables, toLayoutCssVariables, toMetricCssVariables } from "@g9tm/lynxcontrols-foundation";
2
2
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
3
+ import { G9AnchorRegistryContext } from "../anchor/context.jsx";
4
+ import { createAnchorRegistry } from "../anchor/registry.jsx";
3
5
  import { useStableCallback } from "../base/use-stable-callback.jsx";
4
6
  import { g9Hosts } from "../host/registry.jsx";
5
7
  import { G9CoreContext, G9CultureContext, G9DiagnosticsContext, G9InsetsContext, G9KeyboardContext, G9SettingsContext, G9WindowContext } from "./contexts.jsx";
@@ -109,6 +111,7 @@ function G9Provider(props) {
109
111
  providerSequence += 1;
110
112
  return `g9-provider-${providerSequence}`;
111
113
  });
114
+ const [anchors] = useState(createAnchorRegistry);
112
115
  const core = useMemo(()=>{
113
116
  var _executorSettings_showError;
114
117
  const preferences = createPreferences({
@@ -152,14 +155,16 @@ function G9Provider(props) {
152
155
  preferences,
153
156
  diagnostics,
154
157
  executor,
155
- rootId
158
+ rootId,
159
+ anchors
156
160
  });
157
161
  }, [
158
162
  services,
159
163
  themeStore,
160
164
  diagnostics,
161
165
  settings.executor,
162
- rootId
166
+ rootId,
167
+ anchors
163
168
  ]);
164
169
  useEffect(()=>()=>core.executor.dispose(), [
165
170
  core
@@ -270,21 +275,23 @@ function G9Provider(props) {
270
275
  const rootStyle = null != fallbackVariables ? fallbackVariables : initialVariables;
271
276
  const directionClass = 'rtl' === culture.direction ? 'g9-dir-rtl' : 'g9-dir-ltr';
272
277
  return <G9CoreContext.Provider value={core}>
273
- <G9DiagnosticsContext.Provider value={diagnostics}>
274
- <G9SettingsContext.Provider value={settings}>
275
- <G9CultureContext.Provider value={cultureValue}>
276
- <G9KeyboardContext.Provider value={keyboard}>
277
- <G9WindowContext.Provider value={windowState}>
278
- <G9InsetsContext.Provider value={insets}>
279
- <view id={rootId} className={`g9-provider g9-theme-${initialScheme} ${directionClass}${motionOff ? ' g9-motion-off' : ''}${props.className ? ` ${props.className}` : ''}`} style={rootStyle}>
280
- {props.children}
281
- </view>
282
- </G9InsetsContext.Provider>
283
- </G9WindowContext.Provider>
284
- </G9KeyboardContext.Provider>
285
- </G9CultureContext.Provider>
286
- </G9SettingsContext.Provider>
287
- </G9DiagnosticsContext.Provider>
278
+ <G9AnchorRegistryContext.Provider value={anchors}>
279
+ <G9DiagnosticsContext.Provider value={diagnostics}>
280
+ <G9SettingsContext.Provider value={settings}>
281
+ <G9CultureContext.Provider value={cultureValue}>
282
+ <G9KeyboardContext.Provider value={keyboard}>
283
+ <G9WindowContext.Provider value={windowState}>
284
+ <G9InsetsContext.Provider value={insets}>
285
+ <view id={rootId} className={`g9-provider g9-theme-${initialScheme} ${directionClass}${motionOff ? ' g9-motion-off' : ''}${props.className ? ` ${props.className}` : ''}`} style={rootStyle}>
286
+ {props.children}
287
+ </view>
288
+ </G9InsetsContext.Provider>
289
+ </G9WindowContext.Provider>
290
+ </G9KeyboardContext.Provider>
291
+ </G9CultureContext.Provider>
292
+ </G9SettingsContext.Provider>
293
+ </G9DiagnosticsContext.Provider>
294
+ </G9AnchorRegistryContext.Provider>
288
295
  </G9CoreContext.Provider>;
289
296
  }
290
297
  export { G9Provider };
@@ -1 +1 @@
1
- {"version":3,"file":"provider/provider.jsx","sources":["../../src/provider/provider.tsx"],"sourcesContent":["import {\n assertRequiredCapabilities,\n createCultureStore,\n createDiagnostics,\n createIconFontRegistry,\n createPreferences,\n createSafeExecutor,\n createStrings,\n createThemeStore,\n type G9Capabilities,\n type G9ColorScheme,\n type G9CssVariables,\n type G9Culture,\n type G9CultureStore,\n type G9Diagnostics,\n type G9SafeInsets,\n type G9ThemeMode,\n type G9ThemeOptions,\n type G9ThemeStore,\n g9MotionScale,\n subscribeG9Motion,\n toCssVariables,\n toLayoutCssVariables,\n toMetricCssVariables,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { g9Hosts } from '../host/registry';\nimport {\n G9CoreContext,\n G9CultureContext,\n G9DiagnosticsContext,\n G9InsetsContext,\n G9KeyboardContext,\n type G9KeyboardState,\n type G9ProviderCore,\n G9SettingsContext,\n G9WindowContext,\n type G9WindowState,\n} from './contexts';\nimport { addGlobalListener } from './global-events';\nimport { type G9Settings, g9DefaultErrorPresenter, resolveSettings } from './settings';\nimport { applyThemeVariables, changedVariables } from './theme-root';\nimport './provider.css';\nimport './theme.css';\n\n/** Props of {@link G9Provider}. */\nexport interface G9ProviderProps {\n /**\n * The app's platform services (plan/specs/01 §8). `clock`, `preferences` and `host` are required: a missing one\n * throws `G9CapabilityMissingError` naming it when the provider mounts. Pass a stable object.\n */\n readonly services: Partial<G9Capabilities>;\n /**\n * The culture: a store the app drives (`createCultureStore`), or a culture value / locale tag the provider keeps in\n * its own store (a new value switches it). Default `'en'`.\n */\n readonly culture?: G9CultureStore | G9Culture | string;\n /**\n * The theme: a store the app drives (`createThemeStore`), or options for the provider's own store (changes to\n * `mode`, `systemScheme`, `palettes`, `overrides` are applied to it). Default: system mode, stock palettes.\n */\n readonly theme?: G9ThemeStore | G9ThemeOptions;\n /** The platform's current colour scheme (MAUI `RequestedThemeChanged`); followed while the mode is `'system'`. */\n readonly systemScheme?: G9ColorScheme;\n /**\n * Save the theme mode in preferences and restore it at mount (MAUI `G9Theme.ChangeTheme` / `Init`, key\n * `g9controls.theme`, values 0 system, 1 light, 2 dark). Default `true`.\n */\n readonly persistTheme?: boolean;\n /** App-wide settings (plan/specs/03 §6). Validated at mount and on change. */\n readonly settings?: G9Settings;\n /** The diagnostics hub. Default: a hub the provider creates. */\n readonly diagnostics?: G9Diagnostics;\n readonly className?: string;\n readonly children?: ReactNode;\n}\n\nconst THEME_PREFERENCE_KEY = 'theme';\nconst THEME_MODES: readonly G9ThemeMode[] = ['system', 'light', 'dark'];\n\nlet providerSequence = 0;\n\nfunction isCultureStore(value: G9ProviderProps['culture']): value is G9CultureStore {\n return typeof value === 'object' && value !== null && typeof (value as G9CultureStore).getSnapshot === 'function';\n}\n\nfunction isThemeStore(value: G9ProviderProps['theme']): value is G9ThemeStore {\n return typeof value === 'object' && value !== null && typeof (value as G9ThemeStore).getSnapshot === 'function';\n}\n\n/** The logical window size the platform reports at startup (`SystemInfo` is in physical pixels). */\nfunction initialWindow(): G9WindowState {\n const info = (globalThis as { SystemInfo?: { pixelWidth?: number; pixelHeight?: number; pixelRatio?: number } })\n .SystemInfo;\n const ratio = info?.pixelRatio && info.pixelRatio > 0 ? info.pixelRatio : 1;\n return Object.freeze({ width: (info?.pixelWidth ?? 0) / ratio, height: (info?.pixelHeight ?? 0) / ratio });\n}\n\nconst HIDDEN_KEYBOARD: G9KeyboardState = Object.freeze({ visible: false, height: 0, compatHeight: 0 });\n\nfunction finite(value: unknown): number {\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;\n}\n\n/**\n * The root every G9 component lives in (plan/specs/01 §5, MAUI `G9Theme`/`G9Culture`/`G9Strings` statics,\n * `G9ServiceProvider`, `G9ScreenHelper`, `G9KeyboardHelper`): culture and strings, the theme as CSS variables on one\n * root `<view>`, settings, services and capabilities, the diagnostics hub, the shared safe executor, keyboard, window\n * and safe-area state, and the dispatch of the system back event to the active `G9Host`. Mount it once per LynxView.\n *\n * - A theme change updates the root's CSS variables with `setProperty`: nothing re-renders except `useG9Theme`\n * readers. A culture change re-renders culture readers.\n * - One `keyboardstatuschanged` and one `onWindowResize` listener for the whole tree.\n * - The back event (`settings.backEventName`, default `g9:back`) goes to the active host's back stack; when nothing\n * handles it, `services.host.exit()` runs (desktop hosts send the same event for Escape).\n * - Unmounting removes every listener, subscription and timer it created.\n */\nexport function G9Provider(props: G9ProviderProps): ReactNode {\n const { services, persistTheme = true } = props;\n assertRequiredCapabilities(services);\n\n const [ownDiagnostics] = useState(createDiagnostics);\n const diagnostics = props.diagnostics ?? ownDiagnostics;\n const [iconFonts] = useState(createIconFontRegistry);\n const settings = useMemo(() => resolveSettings(props.settings, iconFonts), [props.settings, iconFonts]);\n\n // Culture: the app's store, or one the provider keeps in step with the prop.\n const cultureProp = props.culture ?? 'en';\n const [ownCulture] = useState(() => createCultureStore(isCultureStore(cultureProp) ? 'en' : cultureProp));\n const cultureStore = isCultureStore(cultureProp) ? cultureProp : ownCulture;\n useEffect(() => {\n if (!isCultureStore(cultureProp)) ownCulture.setCulture(cultureProp);\n }, [cultureProp, ownCulture]);\n const culture = useSyncExternalStore(cultureStore.subscribe, cultureStore.getSnapshot);\n const strings = useMemo(() => createStrings({ ...settings.strings, culture }), [settings.strings, culture]);\n const cultureValue = useMemo(() => ({ culture, strings, store: cultureStore }), [culture, strings, cultureStore]);\n\n // Theme: the app's store, or one the provider keeps in step with the options.\n const themeProp = props.theme;\n const [ownTheme] = useState(() => createThemeStore(isThemeStore(themeProp) ? {} : (themeProp ?? {})));\n const themeStore = isThemeStore(themeProp) ? themeProp : ownTheme;\n const options = isThemeStore(themeProp) ? undefined : themeProp;\n useEffect(() => {\n if (!options) return;\n ownTheme.beginBatch();\n try {\n if (options.mode !== undefined) ownTheme.setMode(options.mode);\n if (options.systemScheme !== undefined) ownTheme.setSystemScheme(options.systemScheme);\n ownTheme.setPalettes(options.palettes);\n ownTheme.setOverrides(options.overrides);\n } finally {\n ownTheme.endBatch();\n }\n // Field-wise on purpose: an inline `theme={{ … }}` object must not re-apply (and undo a restored mode) per render.\n }, [ownTheme, options?.mode, options?.systemScheme, options?.palettes, options?.overrides]);\n useEffect(() => {\n if (props.systemScheme !== undefined) themeStore.setSystemScheme(props.systemScheme);\n }, [themeStore, props.systemScheme]);\n\n const executorStrings = useRef(strings);\n executorStrings.current = strings;\n const [rootId] = useState(() => {\n providerSequence += 1;\n return `g9-provider-${providerSequence}`;\n });\n\n const core = useMemo<G9ProviderCore>(() => {\n const preferences = createPreferences({\n store: services.preferences,\n onStoreError: (error, failure) =>\n diagnostics.log({\n level: 'warning',\n message: `Preference ${failure.operation} failed for '${failure.key}'.`,\n source: 'G9Provider',\n error,\n }),\n });\n const executorSettings = settings.executor;\n const executor = createSafeExecutor({\n clock: services.clock,\n diagnostics,\n strings: { get: (key) => executorStrings.current.get(key) },\n // No app presenter: the default one (the error popup, registered by `@g9tm/lynxcontrols/popup`) if loaded.\n showError:\n executorSettings.showError ??\n ((request) => {\n const presenter = g9DefaultErrorPresenter.current;\n if (presenter) return presenter(request);\n diagnostics.log({\n level: 'warning',\n message: `No error presenter is configured; not shown: ${request.message}`,\n source: request.source,\n });\n return undefined;\n }),\n ...(executorSettings.diagnosticsHandler ? { diagnosticsHandler: executorSettings.diagnosticsHandler } : {}),\n ...(executorSettings.diagnosticsAvailable ? { diagnosticsAvailable: executorSettings.diagnosticsAvailable } : {}),\n ...(executorSettings.defaults ? { defaults: executorSettings.defaults } : {}),\n });\n return Object.freeze({ services, themeStore, preferences, diagnostics, executor, rootId });\n }, [services, themeStore, diagnostics, settings.executor, rootId]);\n useEffect(() => () => core.executor.dispose(), [core]);\n\n // Theme root. The Lynx engine drops custom properties in an inline style object (page config\n // `enableCSSInlineVariables` is off and not exposed), so the first frame takes the stock palette of the initial\n // scheme and the default metrics from theme.css classes; the inline copy below only serves engines that honour it.\n // At mount every variable is then written with setProperty (custom palettes, overrides, layout), and each later\n // theme change sends only what changed (no re-render).\n const [initialVariables] = useState<G9CssVariables>(() => ({\n ...toMetricCssVariables(),\n ...toLayoutCssVariables(),\n ...toCssVariables(themeStore.getSnapshot()),\n }));\n const [initialScheme] = useState(() => themeStore.getSnapshot().scheme);\n const applied = useRef<G9CssVariables>({});\n const [fallbackVariables, setFallbackVariables] = useState<G9CssVariables | null>(null);\n useEffect(() => {\n const apply = () => {\n const next = { ...initialVariables, ...applied.current, ...toCssVariables(themeStore.getSnapshot()) };\n const diff = changedVariables(applied.current, next);\n applied.current = next;\n if (!diff) return;\n // Without the element API (a host that lacks it), re-render the root's style instead: still no child render.\n if (!applyThemeVariables(rootId, diff)) setFallbackVariables(next);\n };\n apply();\n return themeStore.subscribe(apply);\n }, [themeStore, rootId, initialVariables]);\n\n // Theme persistence (MAUI ChangeTheme wrote the AppTheme number, Init read it back).\n useEffect(() => {\n if (!persistTheme) return;\n let alive = true;\n const save = () => {\n const value = THEME_MODES.indexOf(themeStore.getSnapshot().mode);\n if (core.preferences.getInt(THEME_PREFERENCE_KEY, -1) !== value) {\n void core.preferences.setInt(THEME_PREFERENCE_KEY, value);\n }\n };\n let lastMode = themeStore.getSnapshot().mode;\n const unsubscribe = themeStore.subscribe((theme) => {\n if (theme.mode === lastMode) return;\n lastMode = theme.mode;\n save();\n });\n core.preferences.hydrate().then(\n () => {\n if (!alive) return;\n const stored = THEME_MODES[core.preferences.getInt(THEME_PREFERENCE_KEY, -1)];\n if (stored) themeStore.setMode(stored);\n },\n (error: unknown) =>\n diagnostics.log({ level: 'warning', message: 'Theme restore failed.', source: 'G9Provider', error }),\n );\n return () => {\n alive = false;\n unsubscribe();\n };\n }, [persistTheme, themeStore, core, diagnostics]);\n\n // Keyboard and window: one listener each for the whole tree.\n const [keyboard, setKeyboard] = useState<G9KeyboardState>(HIDDEN_KEYBOARD);\n useEffect(\n () =>\n addGlobalListener(\n 'keyboardstatuschanged',\n (status: unknown, height: unknown, compatHeight: unknown) => {\n setKeyboard(\n status === 'on'\n ? Object.freeze({ visible: true, height: finite(height), compatHeight: finite(compatHeight) })\n : HIDDEN_KEYBOARD,\n );\n },\n // A host without keyboard detection (windowless Lynxtron): the keyboard simply stays hidden.\n (error) =>\n diagnostics.log({\n level: 'warning',\n message: 'Keyboard events are unavailable on this host.',\n source: 'G9Provider',\n error,\n }),\n ),\n [diagnostics],\n );\n const [windowState, setWindowState] = useState<G9WindowState>(initialWindow);\n useEffect(\n () =>\n addGlobalListener('onWindowResize', (width: unknown, height: unknown) => {\n setWindowState((current) => {\n const next = {\n width: typeof width === 'number' && width >= 0 ? width : current.width,\n height: typeof height === 'number' && height >= 0 ? height : current.height,\n };\n return next.width === current.width && next.height === current.height ? current : Object.freeze(next);\n });\n }),\n [],\n );\n\n // Safe-area insets from the host service.\n const [insets, setInsets] = useState<G9SafeInsets>(() => services.host.getSafeInsets());\n useEffect(() => {\n setInsets(services.host.getSafeInsets());\n return services.host.subscribeSafeInsets((next) => setInsets(next));\n }, [services.host]);\n\n // System back: the active host of this provider first, then exit.\n const onBack = useStableCallback(() => {\n const host = g9Hosts.active();\n if (host && host.services === services && host.back.dispatch() === 'handled') return;\n services.host.exit();\n });\n useEffect(() => addGlobalListener(settings.backEventName, onBack), [settings.backEventName, onBack]);\n\n // setG9MotionScale(0) (reduced motion; a screen that holds still for tests): the CSS transitions end at once too — the\n // root carries `g9-motion-off` and theme.css sets their durations to 0 (JS-timed motion already follows g9Ms).\n const [motionOff, setMotionOff] = useState(() => g9MotionScale() === 0);\n useEffect(() => subscribeG9Motion((s) => setMotionOff(s === 0)), []);\n\n const rootStyle = fallbackVariables ?? initialVariables;\n const directionClass = culture.direction === 'rtl' ? 'g9-dir-rtl' : 'g9-dir-ltr';\n return (\n <G9CoreContext.Provider value={core}>\n <G9DiagnosticsContext.Provider value={diagnostics}>\n <G9SettingsContext.Provider value={settings}>\n <G9CultureContext.Provider value={cultureValue}>\n <G9KeyboardContext.Provider value={keyboard}>\n <G9WindowContext.Provider value={windowState}>\n <G9InsetsContext.Provider value={insets}>\n <view\n id={rootId}\n className={`g9-provider g9-theme-${initialScheme} ${directionClass}${motionOff ? ' g9-motion-off' : ''}${props.className ? ` ${props.className}` : ''}`}\n style={rootStyle}\n >\n {props.children}\n </view>\n </G9InsetsContext.Provider>\n </G9WindowContext.Provider>\n </G9KeyboardContext.Provider>\n </G9CultureContext.Provider>\n </G9SettingsContext.Provider>\n </G9DiagnosticsContext.Provider>\n </G9CoreContext.Provider>\n );\n}\n"],"names":["THEME_PREFERENCE_KEY","THEME_MODES","providerSequence","isCultureStore","value","isThemeStore","initialWindow","info","globalThis","ratio","Object","HIDDEN_KEYBOARD","finite","Number","G9Provider","props","_props_diagnostics","_props_culture","services","persistTheme","assertRequiredCapabilities","ownDiagnostics","useState","createDiagnostics","diagnostics","iconFonts","createIconFontRegistry","settings","useMemo","resolveSettings","cultureProp","ownCulture","createCultureStore","cultureStore","useEffect","culture","useSyncExternalStore","strings","createStrings","cultureValue","themeProp","ownTheme","createThemeStore","themeStore","options","undefined","executorStrings","useRef","rootId","core","_executorSettings_showError","preferences","createPreferences","error","failure","executorSettings","executor","createSafeExecutor","key","request","presenter","g9DefaultErrorPresenter","initialVariables","toMetricCssVariables","toLayoutCssVariables","toCssVariables","initialScheme","applied","fallbackVariables","setFallbackVariables","apply","next","diff","changedVariables","applyThemeVariables","alive","save","lastMode","unsubscribe","theme","stored","keyboard","setKeyboard","addGlobalListener","status","height","compatHeight","windowState","setWindowState","width","current","insets","setInsets","onBack","useStableCallback","host","g9Hosts","motionOff","setMotionOff","g9MotionScale","subscribeG9Motion","s","rootStyle","directionClass","G9CoreContext","G9DiagnosticsContext","G9SettingsContext","G9CultureContext","G9KeyboardContext","G9WindowContext","G9InsetsContext","view"],"mappings":";;;;;;;;;;AA8EA,MAAMA,uBAAuB;AAC7B,MAAMC,cAAsC;IAAC;IAAU;IAAS;CAAO;AAEvE,IAAIC,mBAAmB;AAEvB,SAASC,eAAeC,KAAiC;IACvD,OAAO,AAAiB,YAAjB,OAAOA,SAAsBA,AAAU,SAAVA,SAAkB,AAAiD,cAAjD,OAAQA,MAAyB,WAAW;AACpG;AAEA,SAASC,aAAaD,KAA+B;IACnD,OAAO,AAAiB,YAAjB,OAAOA,SAAsBA,AAAU,SAAVA,SAAkB,AAA+C,cAA/C,OAAQA,MAAuB,WAAW;AAClG;AAGA,SAASE;;IACP,MAAMC,OAAQC,WACX,UAAU;IACb,MAAMC,QAAQF,AAAAA,CAAAA,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,UAAU,AAAD,KAAKA,KAAK,UAAU,GAAG,IAAIA,KAAK,UAAU,GAAG;IAC1E,OAAOG,OAAO,MAAM,CAAC;QAAE,OAAO,AAAC,SAAD,QAACH,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,UAAU,AAAD,IAAC,OAAI,KAAKE;QAAO,QAAQ,AAAC,SAAD,SAACF,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,WAAW,AAAD,IAAC,QAAI,KAAKE;IAAM;AAC1G;AAEA,MAAME,kBAAmCD,OAAO,MAAM,CAAC;IAAE,SAAS;IAAO,QAAQ;IAAG,cAAc;AAAE;AAEpG,SAASE,OAAOR,KAAc;IAC5B,OAAO,AAAiB,YAAjB,OAAOA,SAAsBS,OAAO,QAAQ,CAACT,UAAUA,QAAQ,IAAIA,QAAQ;AACpF;AAeO,SAASU,WAAWC,KAAsB;QAK3BC,oBAKAC;IATpB,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;IAInG,MAAM,CAACI,WAAWC,aAAa,GAAG5E,SAAS,IAAM6E,AAAoB,MAApBA;IACjDjE,UAAU,IAAMkE,kBAAkB,CAACC,IAAMH,aAAaG,AAAM,MAANA,KAAW,EAAE;IAEnE,MAAMC,YAAYlC,QAAAA,oBAAAA,oBAAqBN;IACvC,MAAMyC,iBAAiBpE,AAAsB,UAAtBA,QAAQ,SAAS,GAAa,eAAe;IACpE,QACGqE,cAAc,SAAS,OAAOvD,MAAM;MACnC,CAACwD,qBAAqB,SAAS,OAAOjF,aAAa;QACjD,CAACkF,kBAAkB,SAAS,OAAO/E,UAAU;UAC3C,CAACgF,iBAAiB,SAAS,OAAOpE,cAAc;YAC9C,CAACqE,kBAAkB,SAAS,OAAO3B,UAAU;cAC3C,CAAC4B,gBAAgB,SAAS,OAAOtB,aAAa;gBAC5C,CAACuB,gBAAgB,SAAS,OAAOnB,QAAQ;kBACvC,CAACoB,KACC,IAAI/D,QACJ,WAAW,CAAC,qBAAqB,EAAEkB,cAAc,CAAC,EAAEqC,iBAAiBN,YAAY,mBAAmB,KAAKlF,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI,EACvJ,OAAOuF,WACR;oBACC,CAACvF,MAAM,QAAQ,CAAC;kBAClB,EAAEgG,KAAK;gBACT,EAAED,gBAAgB,SAAS;cAC7B,EAAED,gBAAgB,SAAS;YAC7B,EAAED,kBAAkB,SAAS;UAC/B,EAAED,iBAAiB,SAAS;QAC9B,EAAED,kBAAkB,SAAS;MAC/B,EAAED,qBAAqB,SAAS;IAClC,EAAED,cAAc;AAEpB"}
1
+ {"version":3,"file":"provider/provider.jsx","sources":["../../src/provider/provider.tsx"],"sourcesContent":["import {\n assertRequiredCapabilities,\n createCultureStore,\n createDiagnostics,\n createIconFontRegistry,\n createPreferences,\n createSafeExecutor,\n createStrings,\n createThemeStore,\n type G9Capabilities,\n type G9ColorScheme,\n type G9CssVariables,\n type G9Culture,\n type G9CultureStore,\n type G9Diagnostics,\n type G9SafeInsets,\n type G9ThemeMode,\n type G9ThemeOptions,\n type G9ThemeStore,\n g9MotionScale,\n subscribeG9Motion,\n toCssVariables,\n toLayoutCssVariables,\n toMetricCssVariables,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { G9AnchorRegistryContext } from '../anchor/context';\nimport { createAnchorRegistry } from '../anchor/registry';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { g9Hosts } from '../host/registry';\nimport {\n G9CoreContext,\n G9CultureContext,\n G9DiagnosticsContext,\n G9InsetsContext,\n G9KeyboardContext,\n type G9KeyboardState,\n type G9ProviderCore,\n G9SettingsContext,\n G9WindowContext,\n type G9WindowState,\n} from './contexts';\nimport { addGlobalListener } from './global-events';\nimport { type G9Settings, g9DefaultErrorPresenter, resolveSettings } from './settings';\nimport { applyThemeVariables, changedVariables } from './theme-root';\nimport './provider.css';\nimport './theme.css';\n\n/** Props of {@link G9Provider}. */\nexport interface G9ProviderProps {\n /**\n * The app's platform services (plan/specs/01 §8). `clock`, `preferences` and `host` are required: a missing one\n * throws `G9CapabilityMissingError` naming it when the provider mounts. Pass a stable object.\n */\n readonly services: Partial<G9Capabilities>;\n /**\n * The culture: a store the app drives (`createCultureStore`), or a culture value / locale tag the provider keeps in\n * its own store (a new value switches it). Default `'en'`.\n */\n readonly culture?: G9CultureStore | G9Culture | string;\n /**\n * The theme: a store the app drives (`createThemeStore`), or options for the provider's own store (changes to\n * `mode`, `systemScheme`, `palettes`, `overrides` are applied to it). Default: system mode, stock palettes.\n */\n readonly theme?: G9ThemeStore | G9ThemeOptions;\n /** The platform's current colour scheme (MAUI `RequestedThemeChanged`); followed while the mode is `'system'`. */\n readonly systemScheme?: G9ColorScheme;\n /**\n * Save the theme mode in preferences and restore it at mount (MAUI `G9Theme.ChangeTheme` / `Init`, key\n * `g9controls.theme`, values 0 system, 1 light, 2 dark). Default `true`.\n */\n readonly persistTheme?: boolean;\n /** App-wide settings (plan/specs/03 §6). Validated at mount and on change. */\n readonly settings?: G9Settings;\n /** The diagnostics hub. Default: a hub the provider creates. */\n readonly diagnostics?: G9Diagnostics;\n readonly className?: string;\n readonly children?: ReactNode;\n}\n\nconst THEME_PREFERENCE_KEY = 'theme';\nconst THEME_MODES: readonly G9ThemeMode[] = ['system', 'light', 'dark'];\n\nlet providerSequence = 0;\n\nfunction isCultureStore(value: G9ProviderProps['culture']): value is G9CultureStore {\n return typeof value === 'object' && value !== null && typeof (value as G9CultureStore).getSnapshot === 'function';\n}\n\nfunction isThemeStore(value: G9ProviderProps['theme']): value is G9ThemeStore {\n return typeof value === 'object' && value !== null && typeof (value as G9ThemeStore).getSnapshot === 'function';\n}\n\n/** The logical window size the platform reports at startup (`SystemInfo` is in physical pixels). */\nfunction initialWindow(): G9WindowState {\n const info = (globalThis as { SystemInfo?: { pixelWidth?: number; pixelHeight?: number; pixelRatio?: number } })\n .SystemInfo;\n const ratio = info?.pixelRatio && info.pixelRatio > 0 ? info.pixelRatio : 1;\n return Object.freeze({ width: (info?.pixelWidth ?? 0) / ratio, height: (info?.pixelHeight ?? 0) / ratio });\n}\n\nconst HIDDEN_KEYBOARD: G9KeyboardState = Object.freeze({ visible: false, height: 0, compatHeight: 0 });\n\nfunction finite(value: unknown): number {\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;\n}\n\n/**\n * The root every G9 component lives in (plan/specs/01 §5, MAUI `G9Theme`/`G9Culture`/`G9Strings` statics,\n * `G9ServiceProvider`, `G9ScreenHelper`, `G9KeyboardHelper`): culture and strings, the theme as CSS variables on one\n * root `<view>`, settings, services and capabilities, the diagnostics hub, the shared safe executor, keyboard, window\n * and safe-area state, and the dispatch of the system back event to the active `G9Host`. Mount it once per LynxView.\n *\n * - A theme change updates the root's CSS variables with `setProperty`: nothing re-renders except `useG9Theme`\n * readers. A culture change re-renders culture readers.\n * - One `keyboardstatuschanged` and one `onWindowResize` listener for the whole tree.\n * - The back event (`settings.backEventName`, default `g9:back`) goes to the active host's back stack; when nothing\n * handles it, `services.host.exit()` runs (desktop hosts send the same event for Escape).\n * - Unmounting removes every listener, subscription and timer it created.\n */\nexport function G9Provider(props: G9ProviderProps): ReactNode {\n const { services, persistTheme = true } = props;\n assertRequiredCapabilities(services);\n\n const [ownDiagnostics] = useState(createDiagnostics);\n const diagnostics = props.diagnostics ?? ownDiagnostics;\n const [iconFonts] = useState(createIconFontRegistry);\n const settings = useMemo(() => resolveSettings(props.settings, iconFonts), [props.settings, iconFonts]);\n\n // Culture: the app's store, or one the provider keeps in step with the prop.\n const cultureProp = props.culture ?? 'en';\n const [ownCulture] = useState(() => createCultureStore(isCultureStore(cultureProp) ? 'en' : cultureProp));\n const cultureStore = isCultureStore(cultureProp) ? cultureProp : ownCulture;\n useEffect(() => {\n if (!isCultureStore(cultureProp)) ownCulture.setCulture(cultureProp);\n }, [cultureProp, ownCulture]);\n const culture = useSyncExternalStore(cultureStore.subscribe, cultureStore.getSnapshot);\n const strings = useMemo(() => createStrings({ ...settings.strings, culture }), [settings.strings, culture]);\n const cultureValue = useMemo(() => ({ culture, strings, store: cultureStore }), [culture, strings, cultureStore]);\n\n // Theme: the app's store, or one the provider keeps in step with the options.\n const themeProp = props.theme;\n const [ownTheme] = useState(() => createThemeStore(isThemeStore(themeProp) ? {} : (themeProp ?? {})));\n const themeStore = isThemeStore(themeProp) ? themeProp : ownTheme;\n const options = isThemeStore(themeProp) ? undefined : themeProp;\n useEffect(() => {\n if (!options) return;\n ownTheme.beginBatch();\n try {\n if (options.mode !== undefined) ownTheme.setMode(options.mode);\n if (options.systemScheme !== undefined) ownTheme.setSystemScheme(options.systemScheme);\n ownTheme.setPalettes(options.palettes);\n ownTheme.setOverrides(options.overrides);\n } finally {\n ownTheme.endBatch();\n }\n // Field-wise on purpose: an inline `theme={{ … }}` object must not re-apply (and undo a restored mode) per render.\n }, [ownTheme, options?.mode, options?.systemScheme, options?.palettes, options?.overrides]);\n useEffect(() => {\n if (props.systemScheme !== undefined) themeStore.setSystemScheme(props.systemScheme);\n }, [themeStore, props.systemScheme]);\n\n const executorStrings = useRef(strings);\n executorStrings.current = strings;\n const [rootId] = useState(() => {\n providerSequence += 1;\n return `g9-provider-${providerSequence}`;\n });\n\n // One anchor registry for the provider's life: anchors and scrollers outlive a services change.\n const [anchors] = useState(createAnchorRegistry);\n\n const core = useMemo<G9ProviderCore>(() => {\n const preferences = createPreferences({\n store: services.preferences,\n onStoreError: (error, failure) =>\n diagnostics.log({\n level: 'warning',\n message: `Preference ${failure.operation} failed for '${failure.key}'.`,\n source: 'G9Provider',\n error,\n }),\n });\n const executorSettings = settings.executor;\n const executor = createSafeExecutor({\n clock: services.clock,\n diagnostics,\n strings: { get: (key) => executorStrings.current.get(key) },\n // No app presenter: the default one (the error popup, registered by `@g9tm/lynxcontrols/popup`) if loaded.\n showError:\n executorSettings.showError ??\n ((request) => {\n const presenter = g9DefaultErrorPresenter.current;\n if (presenter) return presenter(request);\n diagnostics.log({\n level: 'warning',\n message: `No error presenter is configured; not shown: ${request.message}`,\n source: request.source,\n });\n return undefined;\n }),\n ...(executorSettings.diagnosticsHandler ? { diagnosticsHandler: executorSettings.diagnosticsHandler } : {}),\n ...(executorSettings.diagnosticsAvailable ? { diagnosticsAvailable: executorSettings.diagnosticsAvailable } : {}),\n ...(executorSettings.defaults ? { defaults: executorSettings.defaults } : {}),\n });\n return Object.freeze({ services, themeStore, preferences, diagnostics, executor, rootId, anchors });\n }, [services, themeStore, diagnostics, settings.executor, rootId, anchors]);\n useEffect(() => () => core.executor.dispose(), [core]);\n\n // Theme root. The Lynx engine drops custom properties in an inline style object (page config\n // `enableCSSInlineVariables` is off and not exposed), so the first frame takes the stock palette of the initial\n // scheme and the default metrics from theme.css classes; the inline copy below only serves engines that honour it.\n // At mount every variable is then written with setProperty (custom palettes, overrides, layout), and each later\n // theme change sends only what changed (no re-render).\n const [initialVariables] = useState<G9CssVariables>(() => ({\n ...toMetricCssVariables(),\n ...toLayoutCssVariables(),\n ...toCssVariables(themeStore.getSnapshot()),\n }));\n const [initialScheme] = useState(() => themeStore.getSnapshot().scheme);\n const applied = useRef<G9CssVariables>({});\n const [fallbackVariables, setFallbackVariables] = useState<G9CssVariables | null>(null);\n useEffect(() => {\n const apply = () => {\n const next = { ...initialVariables, ...applied.current, ...toCssVariables(themeStore.getSnapshot()) };\n const diff = changedVariables(applied.current, next);\n applied.current = next;\n if (!diff) return;\n // Without the element API (a host that lacks it), re-render the root's style instead: still no child render.\n if (!applyThemeVariables(rootId, diff)) setFallbackVariables(next);\n };\n apply();\n return themeStore.subscribe(apply);\n }, [themeStore, rootId, initialVariables]);\n\n // Theme persistence (MAUI ChangeTheme wrote the AppTheme number, Init read it back).\n useEffect(() => {\n if (!persistTheme) return;\n let alive = true;\n const save = () => {\n const value = THEME_MODES.indexOf(themeStore.getSnapshot().mode);\n if (core.preferences.getInt(THEME_PREFERENCE_KEY, -1) !== value) {\n void core.preferences.setInt(THEME_PREFERENCE_KEY, value);\n }\n };\n let lastMode = themeStore.getSnapshot().mode;\n const unsubscribe = themeStore.subscribe((theme) => {\n if (theme.mode === lastMode) return;\n lastMode = theme.mode;\n save();\n });\n core.preferences.hydrate().then(\n () => {\n if (!alive) return;\n const stored = THEME_MODES[core.preferences.getInt(THEME_PREFERENCE_KEY, -1)];\n if (stored) themeStore.setMode(stored);\n },\n (error: unknown) =>\n diagnostics.log({ level: 'warning', message: 'Theme restore failed.', source: 'G9Provider', error }),\n );\n return () => {\n alive = false;\n unsubscribe();\n };\n }, [persistTheme, themeStore, core, diagnostics]);\n\n // Keyboard and window: one listener each for the whole tree.\n const [keyboard, setKeyboard] = useState<G9KeyboardState>(HIDDEN_KEYBOARD);\n useEffect(\n () =>\n addGlobalListener(\n 'keyboardstatuschanged',\n (status: unknown, height: unknown, compatHeight: unknown) => {\n setKeyboard(\n status === 'on'\n ? Object.freeze({ visible: true, height: finite(height), compatHeight: finite(compatHeight) })\n : HIDDEN_KEYBOARD,\n );\n },\n // A host without keyboard detection (windowless Lynxtron): the keyboard simply stays hidden.\n (error) =>\n diagnostics.log({\n level: 'warning',\n message: 'Keyboard events are unavailable on this host.',\n source: 'G9Provider',\n error,\n }),\n ),\n [diagnostics],\n );\n const [windowState, setWindowState] = useState<G9WindowState>(initialWindow);\n useEffect(\n () =>\n addGlobalListener('onWindowResize', (width: unknown, height: unknown) => {\n setWindowState((current) => {\n const next = {\n width: typeof width === 'number' && width >= 0 ? width : current.width,\n height: typeof height === 'number' && height >= 0 ? height : current.height,\n };\n return next.width === current.width && next.height === current.height ? current : Object.freeze(next);\n });\n }),\n [],\n );\n\n // Safe-area insets from the host service.\n const [insets, setInsets] = useState<G9SafeInsets>(() => services.host.getSafeInsets());\n useEffect(() => {\n setInsets(services.host.getSafeInsets());\n return services.host.subscribeSafeInsets((next) => setInsets(next));\n }, [services.host]);\n\n // System back: the active host of this provider first, then exit.\n const onBack = useStableCallback(() => {\n const host = g9Hosts.active();\n if (host && host.services === services && host.back.dispatch() === 'handled') return;\n services.host.exit();\n });\n useEffect(() => addGlobalListener(settings.backEventName, onBack), [settings.backEventName, onBack]);\n\n // setG9MotionScale(0) (reduced motion; a screen that holds still for tests): the CSS transitions end at once too — the\n // root carries `g9-motion-off` and theme.css sets their durations to 0 (JS-timed motion already follows g9Ms).\n const [motionOff, setMotionOff] = useState(() => g9MotionScale() === 0);\n useEffect(() => subscribeG9Motion((s) => setMotionOff(s === 0)), []);\n\n const rootStyle = fallbackVariables ?? initialVariables;\n const directionClass = culture.direction === 'rtl' ? 'g9-dir-rtl' : 'g9-dir-ltr';\n return (\n <G9CoreContext.Provider value={core}>\n <G9AnchorRegistryContext.Provider value={anchors}>\n <G9DiagnosticsContext.Provider value={diagnostics}>\n <G9SettingsContext.Provider value={settings}>\n <G9CultureContext.Provider value={cultureValue}>\n <G9KeyboardContext.Provider value={keyboard}>\n <G9WindowContext.Provider value={windowState}>\n <G9InsetsContext.Provider value={insets}>\n <view\n id={rootId}\n className={`g9-provider g9-theme-${initialScheme} ${directionClass}${motionOff ? ' g9-motion-off' : ''}${props.className ? ` ${props.className}` : ''}`}\n style={rootStyle}\n >\n {props.children}\n </view>\n </G9InsetsContext.Provider>\n </G9WindowContext.Provider>\n </G9KeyboardContext.Provider>\n </G9CultureContext.Provider>\n </G9SettingsContext.Provider>\n </G9DiagnosticsContext.Provider>\n </G9AnchorRegistryContext.Provider>\n </G9CoreContext.Provider>\n );\n}\n"],"names":["THEME_PREFERENCE_KEY","THEME_MODES","providerSequence","isCultureStore","value","isThemeStore","initialWindow","info","globalThis","ratio","Object","HIDDEN_KEYBOARD","finite","Number","G9Provider","props","_props_diagnostics","_props_culture","services","persistTheme","assertRequiredCapabilities","ownDiagnostics","useState","createDiagnostics","diagnostics","iconFonts","createIconFontRegistry","settings","useMemo","resolveSettings","cultureProp","ownCulture","createCultureStore","cultureStore","useEffect","culture","useSyncExternalStore","strings","createStrings","cultureValue","themeProp","ownTheme","createThemeStore","themeStore","options","undefined","executorStrings","useRef","rootId","anchors","createAnchorRegistry","core","_executorSettings_showError","preferences","createPreferences","error","failure","executorSettings","executor","createSafeExecutor","key","request","presenter","g9DefaultErrorPresenter","initialVariables","toMetricCssVariables","toLayoutCssVariables","toCssVariables","initialScheme","applied","fallbackVariables","setFallbackVariables","apply","next","diff","changedVariables","applyThemeVariables","alive","save","lastMode","unsubscribe","theme","stored","keyboard","setKeyboard","addGlobalListener","status","height","compatHeight","windowState","setWindowState","width","current","insets","setInsets","onBack","useStableCallback","host","g9Hosts","motionOff","setMotionOff","g9MotionScale","subscribeG9Motion","s","rootStyle","directionClass","G9CoreContext","G9AnchorRegistryContext","G9DiagnosticsContext","G9SettingsContext","G9CultureContext","G9KeyboardContext","G9WindowContext","G9InsetsContext","view"],"mappings":";;;;;;;;;;;;AAgFA,MAAMA,uBAAuB;AAC7B,MAAMC,cAAsC;IAAC;IAAU;IAAS;CAAO;AAEvE,IAAIC,mBAAmB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,QAAQ,SAAS,GAAa,eAAe;IACpE,QACGuE,cAAc,SAAS,OAAOvD,MAAM;MACnC,CAACwD,wBAAwB,SAAS,OAAO1D,SAAS;QAChD,CAAC2D,qBAAqB,SAAS,OAAOpF,aAAa;UACjD,CAACqF,kBAAkB,SAAS,OAAOlF,UAAU;YAC3C,CAACmF,iBAAiB,SAAS,OAAOvE,cAAc;cAC9C,CAACwE,kBAAkB,SAAS,OAAO5B,UAAU;gBAC3C,CAAC6B,gBAAgB,SAAS,OAAOvB,aAAa;kBAC5C,CAACwB,gBAAgB,SAAS,OAAOpB,QAAQ;oBACvC,CAACqB,KACC,IAAIlE,QACJ,WAAW,CAAC,qBAAqB,EAAEoB,cAAc,CAAC,EAAEqC,iBAAiBN,YAAY,mBAAmB,KAAKpF,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI,EACvJ,OAAOyF,WACR;sBACC,CAACzF,MAAM,QAAQ,CAAC;oBAClB,EAAEmG,KAAK;kBACT,EAAED,gBAAgB,SAAS;gBAC7B,EAAED,gBAAgB,SAAS;cAC7B,EAAED,kBAAkB,SAAS;YAC/B,EAAED,iBAAiB,SAAS;UAC9B,EAAED,kBAAkB,SAAS;QAC/B,EAAED,qBAAqB,SAAS;MAClC,EAAED,wBAAwB,SAAS;IACrC,EAAED,cAAc;AAEpB"}
@@ -1,5 +1,6 @@
1
1
  import { type G9DiagnosticsReport, type G9ErrorPopupRequest, type G9GlyphSlotOverrides, type G9GlyphSlots, type G9IconFontRegistry, type G9ImageSource, type G9SafeExecutorOptions, type G9StringsOptions } from '@g9tm/lynxcontrols-foundation';
2
2
  import type { ReactNode } from '@lynx-js/react';
3
+ import type { G9GuideSettings } from '../guide/settings.js';
3
4
  import { type G9PopupSettings } from '../popup/types.js';
4
5
  import { type G9SheetSettings } from '../sheet/options.js';
5
6
  /** The global event the native host sends for a system back press (Android back, desktop Escape). */
@@ -66,6 +67,8 @@ export interface G9Settings {
66
67
  readonly popups?: G9PopupSettings;
67
68
  /** Toggle defaults (MAUI 1.4.10 `G9Switch.MirrorInRtl`, a static set once at startup). */
68
69
  readonly toggles?: G9ToggleSettings;
70
+ /** The guide's words and timings (`@g9tm/lynxcontrols/guide`): the app gives them in the person's language. */
71
+ readonly guide?: G9GuideSettings;
69
72
  }
70
73
  /** App-wide toggle settings. */
71
74
  export interface G9ToggleSettings {
@@ -98,6 +101,7 @@ export interface G9ResolvedSettings {
98
101
  readonly sheets: Required<G9SheetSettings>;
99
102
  readonly popups: G9PopupSettings;
100
103
  readonly toggles: Required<G9ToggleSettings>;
104
+ readonly guide: G9GuideSettings;
101
105
  }
102
106
  /** MAUI `G9PageBase.PageLoadingDismissDelayMs` default. */
103
107
  export declare const g9PageLoadingDismissDelayMs = 369;
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/provider/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAEtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA8B,KAAK,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AACtG,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,kBAAkB,CAAC;AAE9E,qGAAqG;AACrG,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAEhD,iHAAiH;AACjH,MAAM,WAAW,qBAAqB;IACpC,2GAA2G;IAC3G,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,sFAAsF;IACtF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,yGAAyG;IACzG,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,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,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;CACjC;AAED,2DAA2D;AAC3D,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,4DAA4D;AAC5D,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAajD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,iBAAiB,CAAC,EAAE,kBAAkB,GACrC,kBAAkB,CA+BpB"}
@@ -13,7 +13,7 @@ function nonNegative(name, value, fallback) {
13
13
  return value;
14
14
  }
15
15
  function resolveSettings(settings, fallbackIconFonts) {
16
- var _s_backEventName, _s_pageLoading, _s_strings, _ref, _s_iconFonts, _loading_backgroundColor, _loading_spinnerColor, _s_executor, _ref1, _ref2;
16
+ var _s_backEventName, _s_pageLoading, _s_strings, _ref, _s_iconFonts, _loading_backgroundColor, _loading_spinnerColor, _s_executor, _ref1, _ref2, _s_guide;
17
17
  var _s_fields, _s_toggles;
18
18
  const s = null != settings ? settings : {};
19
19
  const backEventName = null != (_s_backEventName = s.backEventName) ? _s_backEventName : g9DefaultBackEventName;
@@ -40,7 +40,8 @@ function resolveSettings(settings, fallbackIconFonts) {
40
40
  popups: Object.freeze(mergePopupSettings(s.popups, createDefaultPopupSettings())),
41
41
  toggles: Object.freeze({
42
42
  switchMirrorInRtl: null != (_ref2 = null == (_s_toggles = s.toggles) ? void 0 : _s_toggles.switchMirrorInRtl) ? _ref2 : true
43
- })
43
+ }),
44
+ guide: null != (_s_guide = s.guide) ? _s_guide : {}
44
45
  });
45
46
  }
46
47
  export { g9DefaultBackEventName, g9DefaultErrorPresenter, g9PageLoadingDismissDelayMs, g9PageLoadingSafetyTimeoutMs, resolveSettings };
@@ -1 +1 @@
1
- {"version":3,"file":"provider/settings.jsx","sources":["../../src/provider/settings.ts"],"sourcesContent":["import {\n createIconFontRegistry,\n type G9DiagnosticsReport,\n G9Error,\n type G9ErrorPopupRequest,\n type G9GlyphSlotOverrides,\n type G9GlyphSlots,\n type G9IconFontRegistry,\n type G9ImageSource,\n type G9SafeExecutorOptions,\n type G9StringsOptions,\n resolveGlyphSlots,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { createDefaultPopupSettings, type G9PopupSettings, mergePopupSettings } from '../popup/types';\nimport { type G9SheetSettings, resolveSheetSettings } from '../sheet/options';\n\n/** The global event the native host sends for a system back press (Android back, desktop Escape). */\nexport const g9DefaultBackEventName = 'g9:back';\n\n/** App-wide page-loading cover settings (MAUI `G9PageLoadingOverlay` statics + `G9PageBase` timing defaults). */\nexport interface G9PageLoadingSettings {\n /** Cover colour (MAUI `BackgroundColorOverride`). Default: the theme's `Primary` (`var(--g9-primary)`). */\n readonly backgroundColor?: string;\n /** Spinner colour (MAUI `SpinnerColorOverride`). Default: the theme's `OnPrimary`. */\n readonly spinnerColor?: string;\n /** Delay after \"ready\" before the cover animates out (MAUI `PageLoadingDismissDelayMs`). Default 369. */\n readonly dismissDelayMs?: number;\n /** Hard cap from appearing to dismissal (MAUI `PageLoadingSafetyTimeoutMs`). Default 5000. */\n readonly safetyTimeoutMs?: number;\n}\n\n/**\n * Renders a bitmap icon at a box size (MAUI `G9ImageFactory.Factory`): the seam for a caching image element. The default\n * is a plain Lynx `<image>` (`aspectFill`), or `<svg content>` for an `{ svg }` source.\n */\nexport type G9ImageRenderer = (source: G9ImageSource, size: number) => ReactNode;\n\n/**\n * The error presenter used when the app sets no `executor.showError`: `@g9tm/lynxcontrols/popup` installs the error\n * popup here when it loads (so the provider does not depend on the popup module).\n */\nexport const g9DefaultErrorPresenter: {\n current: ((request: G9ErrorPopupRequest) => void | PromiseLike<void>) | null;\n} = { current: null };\n\n/** Settings of the shared safe executor (MAUI `G9SafeCommand` statics). */\nexport interface G9ExecutorSettings {\n readonly showError?: (request: G9ErrorPopupRequest) => void | PromiseLike<void>;\n readonly diagnosticsHandler?: (report: G9DiagnosticsReport) => void | PromiseLike<void>;\n readonly diagnosticsAvailable?: () => boolean;\n readonly defaults?: G9SafeExecutorOptions;\n}\n\n/**\n * App-wide configuration (plan/specs/03 §6): what MAUI configured through static helpers. Later work packages add\n * their families here (`sheets`, `popups`, `toasts`, `fields`).\n */\nexport interface G9Settings {\n /** String resolution (MAUI `G9Strings.UseProvider` / `Override`): everything but the culture. */\n readonly strings?: Omit<G9StringsOptions, 'culture'>;\n /** Replacements for the controls' own icons (MAUI `G9Glyphs.*` setters). */\n readonly glyphs?: G9GlyphSlotOverrides;\n /** The app's icon fonts (MAUI `G9IconFonts.Register`); default an empty registry. */\n readonly iconFonts?: G9IconFontRegistry;\n /** Bitmap icon renderer (MAUI `G9ImageFactory.Factory`). Default: {@link G9ImageRenderer}'s plain `<image>`. */\n readonly imageRenderer?: G9ImageRenderer;\n /** Name of the global back event (default {@link g9DefaultBackEventName}). */\n readonly backEventName?: string;\n /** Page-loading cover defaults for every `G9Host`. */\n readonly pageLoading?: G9PageLoadingSettings;\n /** The shared safe executor's popup, diagnostics surface and option defaults. */\n readonly executor?: G9ExecutorSettings;\n /**\n * Pauses the app's background work while a view that asks for it is active (MAUI\n * `G9ContentViewBase.BackgroundWorkSuppressionFactory`). Returns the release function, or nothing.\n */\n readonly backgroundWorkSuppression?: () => (() => void) | null | undefined;\n /** Outlined-field defaults (MAUI `G9OutlinedFieldSettings`, set through `G9OutlinedFieldBase.Configure`). */\n readonly fields?: G9FieldSettings;\n /** Bottom-sheet defaults (MAUI `G9BottomSheetHelper.Configure(G9BottomSheetSettings)`). */\n readonly sheets?: G9SheetSettings;\n /** Popup defaults (MAUI `G9PopupHelper.ConfigureG9PopupDefaults`), merged under per-call settings. */\n readonly popups?: G9PopupSettings;\n /** Toggle defaults (MAUI 1.4.10 `G9Switch.MirrorInRtl`, a static set once at startup). */\n readonly toggles?: G9ToggleSettings;\n}\n\n/** App-wide toggle settings. */\nexport interface G9ToggleSettings {\n /**\n * Whether a right-to-left language mirrors a switch's toggle (on = the thumb on the LEFT). Default `true` (MAUI\n * `G9Switch.MirrorInRtl`). `false` keeps every switch physical in every language — off = left, on = right — as\n * AgriPad's Figma draws all 31 of its toggles; the row (title, switch) still flows with the language.\n */\n readonly switchMirrorInRtl?: boolean;\n}\n\n/** App-wide outlined-field settings (MAUI `G9OutlinedFieldSettings`). */\nexport interface G9FieldSettings {\n /**\n * Whether a field holding a value (unfocused, no error) draws its outline and floated label in the primary colour.\n * Default `true` (MAUI `HighlightFilledValue`); a field's own `filledValueHighlight` overrides it (ADR-0025).\n */\n readonly highlightFilledValue?: boolean;\n}\n\n/** {@link G9Settings} with every default filled in. */\nexport interface G9ResolvedSettings {\n readonly strings: Omit<G9StringsOptions, 'culture'>;\n readonly glyphs: G9GlyphSlots;\n readonly iconFonts: G9IconFontRegistry;\n readonly imageRenderer: G9ImageRenderer | undefined;\n readonly backEventName: string;\n readonly pageLoading: Required<G9PageLoadingSettings>;\n readonly executor: G9ExecutorSettings;\n readonly backgroundWorkSuppression: G9Settings['backgroundWorkSuppression'];\n readonly fields: Required<G9FieldSettings>;\n readonly sheets: Required<G9SheetSettings>;\n readonly popups: G9PopupSettings;\n readonly toggles: Required<G9ToggleSettings>;\n}\n\n/** MAUI `G9PageBase.PageLoadingDismissDelayMs` default. */\nexport const g9PageLoadingDismissDelayMs = 369;\n/** MAUI `G9PageBase.PageLoadingSafetyTimeoutMs` default. */\nexport const g9PageLoadingSafetyTimeoutMs = 5000;\n\nfunction nonNegative(name: string, value: number | undefined, fallback: number): number {\n if (value === undefined) return fallback;\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw new G9Error(\n 'settings-invalid',\n `${name} must be a finite number of milliseconds ≥ 0 (got ${String(value)}).`,\n );\n }\n return value;\n}\n\n/**\n * Validates `settings` and fills the defaults. Invalid values throw a `G9Error` (`settings-invalid`, or the\n * foundation code for a malformed glyph slot) at provider mount rather than at first use.\n */\nexport function resolveSettings(\n settings: G9Settings | undefined,\n fallbackIconFonts?: G9IconFontRegistry,\n): G9ResolvedSettings {\n const s = settings ?? {};\n const backEventName = s.backEventName ?? g9DefaultBackEventName;\n if (typeof backEventName !== 'string' || backEventName.trim() === '') {\n throw new G9Error('settings-invalid', 'backEventName must be a non-blank string.');\n }\n const loading = s.pageLoading ?? {};\n return Object.freeze({\n strings: s.strings ?? {},\n glyphs: resolveGlyphSlots(s.glyphs),\n iconFonts: s.iconFonts ?? fallbackIconFonts ?? createIconFontRegistry(),\n imageRenderer: s.imageRenderer,\n backEventName,\n pageLoading: Object.freeze({\n backgroundColor: loading.backgroundColor ?? 'var(--g9-primary)',\n spinnerColor: loading.spinnerColor ?? 'var(--g9-on-primary)',\n dismissDelayMs: nonNegative('pageLoading.dismissDelayMs', loading.dismissDelayMs, g9PageLoadingDismissDelayMs),\n safetyTimeoutMs: nonNegative(\n 'pageLoading.safetyTimeoutMs',\n loading.safetyTimeoutMs,\n g9PageLoadingSafetyTimeoutMs,\n ),\n }),\n executor: s.executor ?? {},\n backgroundWorkSuppression: s.backgroundWorkSuppression,\n fields: Object.freeze({ highlightFilledValue: s.fields?.highlightFilledValue ?? true }),\n sheets: resolveSheetSettings(s.sheets),\n popups: Object.freeze(mergePopupSettings(s.popups, createDefaultPopupSettings())),\n toggles: Object.freeze({ switchMirrorInRtl: s.toggles?.switchMirrorInRtl ?? true }),\n });\n}\n"],"names":["g9DefaultBackEventName","g9DefaultErrorPresenter","g9PageLoadingDismissDelayMs","g9PageLoadingSafetyTimeoutMs","nonNegative","name","value","fallback","undefined","Number","G9Error","String","resolveSettings","settings","fallbackIconFonts","_s_backEventName","_s_pageLoading","_s_strings","_ref","_loading_backgroundColor","_loading_spinnerColor","_s_executor","_s_fields","_s_toggles","s","backEventName","loading","Object","resolveGlyphSlots","createIconFontRegistry","resolveSheetSettings","m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Q,eAAe,AAAD,IAAtBA,2BAA2B;YAC5C,cAAc,QAAAC,CAAAA,wBAAAA,QAAQ,YAAY,AAAD,IAAnBA,wBAAwB;YACtC,gBAAgBhB,YAAY,8BAA8BsB,QAAQ,cAAc,EAAExB;YAClF,iBAAiBE,YACf,+BACAsB,QAAQ,eAAe,EACvBvB;QAEJ;QACA,UAAU,QAAAkB,CAAAA,cAAAA,EAAE,QAAQ,AAAD,IAATA,cAAc,CAAC;QACzB,2BAA2BG,EAAE,yBAAyB;QACtD,QAAQG,OAAO,MAAM,CAAC;YAAE,sBAAsB,QAAF,iBAAEL,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,oBAAoB,AAAD,IAAC,QAAI;QAAK;QACrF,QAAQQ,qBAAqBN,EAAE,MAAM;QACrC,QAAQG,OAAO,MAAM,CAACI,mBAAmBP,EAAE,MAAM,EAAEQ;QACnD,SAASL,OAAO,MAAM,CAAC;YAAE,mBAAmB,QAAF,iBAAEJ,CAAAA,aAAAA,EAAE,OAAO,AAAD,IAARA,KAAAA,IAAAA,WAAW,iBAAiB,AAAD,IAAC,QAAI;QAAK;IACnF;AACF"}
1
+ {"version":3,"file":"provider/settings.jsx","sources":["../../src/provider/settings.ts"],"sourcesContent":["import {\n createIconFontRegistry,\n type G9DiagnosticsReport,\n G9Error,\n type G9ErrorPopupRequest,\n type G9GlyphSlotOverrides,\n type G9GlyphSlots,\n type G9IconFontRegistry,\n type G9ImageSource,\n type G9SafeExecutorOptions,\n type G9StringsOptions,\n resolveGlyphSlots,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9GuideSettings } from '../guide/settings';\nimport { createDefaultPopupSettings, type G9PopupSettings, mergePopupSettings } from '../popup/types';\nimport { type G9SheetSettings, resolveSheetSettings } from '../sheet/options';\n\n/** The global event the native host sends for a system back press (Android back, desktop Escape). */\nexport const g9DefaultBackEventName = 'g9:back';\n\n/** App-wide page-loading cover settings (MAUI `G9PageLoadingOverlay` statics + `G9PageBase` timing defaults). */\nexport interface G9PageLoadingSettings {\n /** Cover colour (MAUI `BackgroundColorOverride`). Default: the theme's `Primary` (`var(--g9-primary)`). */\n readonly backgroundColor?: string;\n /** Spinner colour (MAUI `SpinnerColorOverride`). Default: the theme's `OnPrimary`. */\n readonly spinnerColor?: string;\n /** Delay after \"ready\" before the cover animates out (MAUI `PageLoadingDismissDelayMs`). Default 369. */\n readonly dismissDelayMs?: number;\n /** Hard cap from appearing to dismissal (MAUI `PageLoadingSafetyTimeoutMs`). Default 5000. */\n readonly safetyTimeoutMs?: number;\n}\n\n/**\n * Renders a bitmap icon at a box size (MAUI `G9ImageFactory.Factory`): the seam for a caching image element. The default\n * is a plain Lynx `<image>` (`aspectFill`), or `<svg content>` for an `{ svg }` source.\n */\nexport type G9ImageRenderer = (source: G9ImageSource, size: number) => ReactNode;\n\n/**\n * The error presenter used when the app sets no `executor.showError`: `@g9tm/lynxcontrols/popup` installs the error\n * popup here when it loads (so the provider does not depend on the popup module).\n */\nexport const g9DefaultErrorPresenter: {\n current: ((request: G9ErrorPopupRequest) => void | PromiseLike<void>) | null;\n} = { current: null };\n\n/** Settings of the shared safe executor (MAUI `G9SafeCommand` statics). */\nexport interface G9ExecutorSettings {\n readonly showError?: (request: G9ErrorPopupRequest) => void | PromiseLike<void>;\n readonly diagnosticsHandler?: (report: G9DiagnosticsReport) => void | PromiseLike<void>;\n readonly diagnosticsAvailable?: () => boolean;\n readonly defaults?: G9SafeExecutorOptions;\n}\n\n/**\n * App-wide configuration (plan/specs/03 §6): what MAUI configured through static helpers. Later work packages add\n * their families here (`sheets`, `popups`, `toasts`, `fields`).\n */\nexport interface G9Settings {\n /** String resolution (MAUI `G9Strings.UseProvider` / `Override`): everything but the culture. */\n readonly strings?: Omit<G9StringsOptions, 'culture'>;\n /** Replacements for the controls' own icons (MAUI `G9Glyphs.*` setters). */\n readonly glyphs?: G9GlyphSlotOverrides;\n /** The app's icon fonts (MAUI `G9IconFonts.Register`); default an empty registry. */\n readonly iconFonts?: G9IconFontRegistry;\n /** Bitmap icon renderer (MAUI `G9ImageFactory.Factory`). Default: {@link G9ImageRenderer}'s plain `<image>`. */\n readonly imageRenderer?: G9ImageRenderer;\n /** Name of the global back event (default {@link g9DefaultBackEventName}). */\n readonly backEventName?: string;\n /** Page-loading cover defaults for every `G9Host`. */\n readonly pageLoading?: G9PageLoadingSettings;\n /** The shared safe executor's popup, diagnostics surface and option defaults. */\n readonly executor?: G9ExecutorSettings;\n /**\n * Pauses the app's background work while a view that asks for it is active (MAUI\n * `G9ContentViewBase.BackgroundWorkSuppressionFactory`). Returns the release function, or nothing.\n */\n readonly backgroundWorkSuppression?: () => (() => void) | null | undefined;\n /** Outlined-field defaults (MAUI `G9OutlinedFieldSettings`, set through `G9OutlinedFieldBase.Configure`). */\n readonly fields?: G9FieldSettings;\n /** Bottom-sheet defaults (MAUI `G9BottomSheetHelper.Configure(G9BottomSheetSettings)`). */\n readonly sheets?: G9SheetSettings;\n /** Popup defaults (MAUI `G9PopupHelper.ConfigureG9PopupDefaults`), merged under per-call settings. */\n readonly popups?: G9PopupSettings;\n /** Toggle defaults (MAUI 1.4.10 `G9Switch.MirrorInRtl`, a static set once at startup). */\n readonly toggles?: G9ToggleSettings;\n /** The guide's words and timings (`@g9tm/lynxcontrols/guide`): the app gives them in the person's language. */\n readonly guide?: G9GuideSettings;\n}\n\n/** App-wide toggle settings. */\nexport interface G9ToggleSettings {\n /**\n * Whether a right-to-left language mirrors a switch's toggle (on = the thumb on the LEFT). Default `true` (MAUI\n * `G9Switch.MirrorInRtl`). `false` keeps every switch physical in every language — off = left, on = right — as\n * AgriPad's Figma draws all 31 of its toggles; the row (title, switch) still flows with the language.\n */\n readonly switchMirrorInRtl?: boolean;\n}\n\n/** App-wide outlined-field settings (MAUI `G9OutlinedFieldSettings`). */\nexport interface G9FieldSettings {\n /**\n * Whether a field holding a value (unfocused, no error) draws its outline and floated label in the primary colour.\n * Default `true` (MAUI `HighlightFilledValue`); a field's own `filledValueHighlight` overrides it (ADR-0025).\n */\n readonly highlightFilledValue?: boolean;\n}\n\n/** {@link G9Settings} with every default filled in. */\nexport interface G9ResolvedSettings {\n readonly strings: Omit<G9StringsOptions, 'culture'>;\n readonly glyphs: G9GlyphSlots;\n readonly iconFonts: G9IconFontRegistry;\n readonly imageRenderer: G9ImageRenderer | undefined;\n readonly backEventName: string;\n readonly pageLoading: Required<G9PageLoadingSettings>;\n readonly executor: G9ExecutorSettings;\n readonly backgroundWorkSuppression: G9Settings['backgroundWorkSuppression'];\n readonly fields: Required<G9FieldSettings>;\n readonly sheets: Required<G9SheetSettings>;\n readonly popups: G9PopupSettings;\n readonly toggles: Required<G9ToggleSettings>;\n readonly guide: G9GuideSettings;\n}\n\n/** MAUI `G9PageBase.PageLoadingDismissDelayMs` default. */\nexport const g9PageLoadingDismissDelayMs = 369;\n/** MAUI `G9PageBase.PageLoadingSafetyTimeoutMs` default. */\nexport const g9PageLoadingSafetyTimeoutMs = 5000;\n\nfunction nonNegative(name: string, value: number | undefined, fallback: number): number {\n if (value === undefined) return fallback;\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw new G9Error(\n 'settings-invalid',\n `${name} must be a finite number of milliseconds ≥ 0 (got ${String(value)}).`,\n );\n }\n return value;\n}\n\n/**\n * Validates `settings` and fills the defaults. Invalid values throw a `G9Error` (`settings-invalid`, or the\n * foundation code for a malformed glyph slot) at provider mount rather than at first use.\n */\nexport function resolveSettings(\n settings: G9Settings | undefined,\n fallbackIconFonts?: G9IconFontRegistry,\n): G9ResolvedSettings {\n const s = settings ?? {};\n const backEventName = s.backEventName ?? g9DefaultBackEventName;\n if (typeof backEventName !== 'string' || backEventName.trim() === '') {\n throw new G9Error('settings-invalid', 'backEventName must be a non-blank string.');\n }\n const loading = s.pageLoading ?? {};\n return Object.freeze({\n strings: s.strings ?? {},\n glyphs: resolveGlyphSlots(s.glyphs),\n iconFonts: s.iconFonts ?? fallbackIconFonts ?? createIconFontRegistry(),\n imageRenderer: s.imageRenderer,\n backEventName,\n pageLoading: Object.freeze({\n backgroundColor: loading.backgroundColor ?? 'var(--g9-primary)',\n spinnerColor: loading.spinnerColor ?? 'var(--g9-on-primary)',\n dismissDelayMs: nonNegative('pageLoading.dismissDelayMs', loading.dismissDelayMs, g9PageLoadingDismissDelayMs),\n safetyTimeoutMs: nonNegative(\n 'pageLoading.safetyTimeoutMs',\n loading.safetyTimeoutMs,\n g9PageLoadingSafetyTimeoutMs,\n ),\n }),\n executor: s.executor ?? {},\n backgroundWorkSuppression: s.backgroundWorkSuppression,\n fields: Object.freeze({ highlightFilledValue: s.fields?.highlightFilledValue ?? true }),\n sheets: resolveSheetSettings(s.sheets),\n popups: Object.freeze(mergePopupSettings(s.popups, createDefaultPopupSettings())),\n toggles: Object.freeze({ switchMirrorInRtl: s.toggles?.switchMirrorInRtl ?? true }),\n guide: s.guide ?? {},\n });\n}\n"],"names":["g9DefaultBackEventName","g9DefaultErrorPresenter","g9PageLoadingDismissDelayMs","g9PageLoadingSafetyTimeoutMs","nonNegative","name","value","fallback","undefined","Number","G9Error","String","resolveSettings","settings","fallbackIconFonts","_s_backEventName","_s_pageLoading","_s_strings","_ref","_loading_backgroundColor","_loading_spinnerColor","_s_executor","_s_guide","_s_fields","_s_toggles","s","backEventName","loading","Object","resolveGlyphSlots","createIconFontRegistry","resolveSheetSettings","mergePopupSettings","createDefaultPopupSettings"],"mappings":";;;AAmBO,MAAMA,yBAAyB;AAwB/B,MAAMC,0BAET;IAAE,SAAS;AAAK;AAmFb,MAAMC,8BAA8B;AAEpC,MAAMC,+BAA+B;AAE5C,SAASC,YAAYC,IAAY,EAAEC,KAAyB,EAAEC,QAAgB;IAC5E,IAAID,AAAUE,WAAVF,OAAqB,OAAOC;IAChC,IAAI,AAAiB,YAAjB,OAAOD,SAAsB,CAACG,OAAO,QAAQ,CAACH,UAAUA,QAAQ,GAClE,MAAM,IAAII,QACR,oBAC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MAAM,CAAC;YAAE,sBAAsB,QAAF,iBAAEL,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,oBAAoB,AAAD,IAAC,QAAI;QAAK;QACrF,QAAQQ,qBAAqBN,EAAE,MAAM;QACrC,QAAQG,OAAO,MAAM,CAACI,mBAAmBP,EAAE,MAAM,EAAEQ;QACnD,SAASL,OAAO,MAAM,CAAC;YAAE,mBAAmB,QAAF,iBAAEJ,CAAAA,aAAAA,EAAE,OAAO,AAAD,IAARA,KAAAA,IAAAA,WAAW,iBAAiB,AAAD,IAAC,QAAI;QAAK;QACjF,OAAO,QAAAF,CAAAA,WAAAA,EAAE,KAAK,AAAD,IAANA,WAAW,CAAC;IACrB;AACF"}
@@ -0,0 +1,34 @@
1
+ import { type G9PlaceDeclaration, type G9PlaceLayer, type G9RouteSink, type G9Segment, type G9SegmentInput } from '@g9tm/lynxcontrols-foundation';
2
+ import { type ReactNode } from '@lynx-js/react';
3
+ import { type G9Location, type G9Router } from './router.js';
4
+ /** A place a component declares while it is open. */
5
+ export interface G9PlaceSpec extends Omit<G9PlaceDeclaration, 'segment' | 'layer'> {
6
+ readonly segment: G9SegmentInput | (() => G9SegmentInput);
7
+ readonly layer: G9PlaceLayer;
8
+ }
9
+ /** The route sink of the provider (`services.route`), or null without one. */
10
+ export declare function useG9RouteSink(): G9RouteSink | null;
11
+ /** The provider's router when the sink is one, else null. */
12
+ export declare function useG9Router(): G9Router | null;
13
+ /** Where the app is (re-renders on every change), or null without a router. */
14
+ export declare function useG9Location(): G9Location | null;
15
+ /**
16
+ * Declares a place while mounted, `spec` is not null and `active` is true (a kept-alive tab body passes its own
17
+ * `active`). The spec may change every render: the router reads the latest; a new segment touches the declaration, a
18
+ * new layer, order or `under` declares it again. Which optional parts the place has (close, canLeave…) is fixed by the
19
+ * first declaration of a mount.
20
+ */
21
+ export declare function useG9Place(spec: G9PlaceSpec | null, options?: {
22
+ readonly active?: boolean;
23
+ readonly sink?: G9RouteSink | null;
24
+ }): void;
25
+ /** Props of {@link G9Place}. */
26
+ export interface G9PlaceProps extends G9PlaceSpec {
27
+ readonly active?: boolean;
28
+ readonly children?: ReactNode;
29
+ }
30
+ /** Declares a place around its children (renders no element). */
31
+ export declare function G9Place(props: G9PlaceProps): ReactNode;
32
+ /** The segment of a sheet without an explicit route: `sheet.<its automation id in kebab case>`, else `sheet`. */
33
+ export declare function sheetSegmentOf(automationId: string | undefined | null): G9Segment;
34
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/route/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,cAAc,EAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAAuD,MAAM,gBAAgB,CAAC;AAErG,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAc,MAAM,UAAU,CAAC;AAEtE,qDAAqD;AACrD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,OAAO,CAAC;IAChF,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC;IAC1D,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CAEnD;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAG7C;AAKD,+EAA+E;AAC/E,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAMjD;AAWD;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,OAAO,GAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAAO,GAC9E,IAAI,CA+CN;AAED,gCAAgC;AAChC,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,iEAAiE;AACjE,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAItD;AAED,iHAAiH;AACjH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAWjF"}
@@ -0,0 +1,147 @@
1
+ import { formatAddress, toSegment } from "@g9tm/lynxcontrols-foundation";
2
+ import { useContext, useEffect, useRef, useSyncExternalStore } from "@lynx-js/react";
3
+ import { G9CoreContext } from "../provider/contexts.jsx";
4
+ import { isG9Router } from "./router.jsx";
5
+ function useG9RouteSink() {
6
+ var _ref;
7
+ var _useContext;
8
+ return null != (_ref = null == (_useContext = useContext(G9CoreContext)) ? void 0 : _useContext.services.route) ? _ref : null;
9
+ }
10
+ function useG9Router() {
11
+ const sink = useG9RouteSink();
12
+ return isG9Router(sink) ? sink : null;
13
+ }
14
+ const NO_LOCATION = ()=>()=>{};
15
+ const NULL = ()=>null;
16
+ function useG9Location() {
17
+ const router = useG9Router();
18
+ return useSyncExternalStore(router ? (l)=>router.current.subscribe(l) : NO_LOCATION, router ? ()=>router.current.get() : NULL);
19
+ }
20
+ function segmentText(spec) {
21
+ try {
22
+ const s = 'function' == typeof spec.segment ? spec.segment() : spec.segment;
23
+ return formatAddress([
24
+ toSegment(s)
25
+ ]);
26
+ } catch {
27
+ return '';
28
+ }
29
+ }
30
+ function useG9Place(spec, options = {}) {
31
+ var _options_active, _spec_order;
32
+ const ownSink = useG9RouteSink();
33
+ const sink = void 0 !== options.sink ? options.sink : ownSink;
34
+ const latest = useRef(spec);
35
+ latest.current = spec;
36
+ const handle = useRef(null);
37
+ const lastText = useRef('');
38
+ const active = null != (_options_active = options.active) ? _options_active : true;
39
+ const key = spec && active ? `${spec.layer}|${null != (_spec_order = spec.order) ? _spec_order : 0}|${spec.under ? formatAddress(spec.under) : ''}` : null;
40
+ useEffect(()=>{
41
+ if (!sink || null === key) return;
42
+ const first = latest.current;
43
+ const read = ()=>{
44
+ var _latest_current;
45
+ const s = (null != (_latest_current = latest.current) ? _latest_current : first).segment;
46
+ return toSegment('function' == typeof s ? s() : s);
47
+ };
48
+ const call = (k)=>{
49
+ var _latest_current;
50
+ return (null != (_latest_current = latest.current) ? _latest_current : first)[k];
51
+ };
52
+ const declaration = {
53
+ segment: read,
54
+ layer: first.layer,
55
+ ...void 0 !== first.order ? {
56
+ order: first.order
57
+ } : {},
58
+ ...first.under ? {
59
+ under: first.under
60
+ } : {},
61
+ ...first.title ? {
62
+ title: ()=>{
63
+ var _call;
64
+ return null == (_call = call('title')) ? void 0 : _call();
65
+ }
66
+ } : {},
67
+ ...first.view ? {
68
+ view: ()=>{
69
+ var _call;
70
+ return null == (_call = call('view')) ? void 0 : _call();
71
+ }
72
+ } : {},
73
+ ...first.applyView ? {
74
+ applyView: (v)=>{
75
+ var _call;
76
+ return null == (_call = call('applyView')) ? void 0 : _call(v);
77
+ }
78
+ } : {},
79
+ ...first.close ? {
80
+ close: ()=>{
81
+ var _call;
82
+ return null == (_call = call('close')) ? void 0 : _call();
83
+ }
84
+ } : {},
85
+ ...first.canLeave ? {
86
+ canLeave: ()=>{
87
+ var _ref;
88
+ var _call;
89
+ return null != (_ref = null == (_call = call('canLeave')) ? void 0 : _call()) ? _ref : true;
90
+ }
91
+ } : {},
92
+ ...first.describeChanges ? {
93
+ describeChanges: ()=>{
94
+ var _ref;
95
+ var _call;
96
+ return null != (_ref = null == (_call = call('describeChanges')) ? void 0 : _call()) ? _ref : [];
97
+ }
98
+ } : {},
99
+ ...first.facts ? {
100
+ facts: ()=>{
101
+ var _ref;
102
+ var _call;
103
+ return null != (_ref = null == (_call = call('facts')) ? void 0 : _call()) ? _ref : {};
104
+ }
105
+ } : {}
106
+ };
107
+ lastText.current = segmentText(first);
108
+ const h = sink.declare(declaration);
109
+ handle.current = h;
110
+ return ()=>{
111
+ h.remove();
112
+ if (handle.current === h) handle.current = null;
113
+ };
114
+ }, [
115
+ sink,
116
+ key
117
+ ]);
118
+ useEffect(()=>{
119
+ if (!spec || !handle.current) return;
120
+ const text = segmentText(spec);
121
+ if (text === lastText.current) return;
122
+ lastText.current = text;
123
+ handle.current.touch();
124
+ });
125
+ }
126
+ function G9Place(props) {
127
+ const { children, active, ...spec } = props;
128
+ useG9Place(spec, void 0 === active ? {} : {
129
+ active
130
+ });
131
+ return <>{children}</>;
132
+ }
133
+ function sheetSegmentOf(automationId) {
134
+ if (!automationId) return {
135
+ kind: 'sheet'
136
+ };
137
+ const kebab = automationId.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/[^A-Za-z0-9]+/g, '-').replace(/^-+|-+$/g, '').toLowerCase().replace(/^[^a-z]+/, '').slice(0, 32).replace(/-+$/, '');
138
+ return kebab ? {
139
+ kind: 'sheet',
140
+ variant: kebab
141
+ } : {
142
+ kind: 'sheet'
143
+ };
144
+ }
145
+ export { G9Place, sheetSegmentOf, useG9Location, useG9Place, useG9RouteSink, useG9Router };
146
+
147
+ //# sourceMappingURL=hooks.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route/hooks.jsx","sources":["../../src/route/hooks.tsx"],"sourcesContent":["import {\n formatAddress,\n type G9PlaceDeclaration,\n type G9PlaceHandle,\n type G9PlaceLayer,\n type G9RouteSink,\n type G9Segment,\n type G9SegmentInput,\n toSegment,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useContext, useEffect, useRef, useSyncExternalStore } from '@lynx-js/react';\nimport { G9CoreContext } from '../provider/contexts';\nimport { type G9Location, type G9Router, isG9Router } from './router';\n\n/** A place a component declares while it is open. */\nexport interface G9PlaceSpec extends Omit<G9PlaceDeclaration, 'segment' | 'layer'> {\n readonly segment: G9SegmentInput | (() => G9SegmentInput);\n readonly layer: G9PlaceLayer;\n}\n\n/** The route sink of the provider (`services.route`), or null without one. */\nexport function useG9RouteSink(): G9RouteSink | null {\n return useContext(G9CoreContext)?.services.route ?? null;\n}\n\n/** The provider's router when the sink is one, else null. */\nexport function useG9Router(): G9Router | null {\n const sink = useG9RouteSink();\n return isG9Router(sink) ? sink : null;\n}\n\nconst NO_LOCATION = () => () => {};\nconst NULL = () => null;\n\n/** Where the app is (re-renders on every change), or null without a router. */\nexport function useG9Location(): G9Location | null {\n const router = useG9Router();\n return useSyncExternalStore(\n router ? (l) => router.current.subscribe(l) : NO_LOCATION,\n router ? () => router.current.get() : NULL,\n );\n}\n\nfunction segmentText(spec: G9PlaceSpec): string {\n try {\n const s = typeof spec.segment === 'function' ? spec.segment() : spec.segment;\n return formatAddress([toSegment(s)]);\n } catch {\n return '';\n }\n}\n\n/**\n * Declares a place while mounted, `spec` is not null and `active` is true (a kept-alive tab body passes its own\n * `active`). The spec may change every render: the router reads the latest; a new segment touches the declaration, a\n * new layer, order or `under` declares it again. Which optional parts the place has (close, canLeave…) is fixed by the\n * first declaration of a mount.\n */\nexport function useG9Place(\n spec: G9PlaceSpec | null,\n options: { readonly active?: boolean; readonly sink?: G9RouteSink | null } = {},\n): void {\n const ownSink = useG9RouteSink();\n const sink = options.sink !== undefined ? options.sink : ownSink;\n const latest = useRef(spec);\n latest.current = spec;\n const handle = useRef<G9PlaceHandle | null>(null);\n const lastText = useRef('');\n const active = options.active ?? true;\n const key = spec && active ? `${spec.layer}|${spec.order ?? 0}|${spec.under ? formatAddress(spec.under) : ''}` : null;\n\n useEffect(() => {\n if (!sink || key === null) return undefined;\n const first = latest.current as G9PlaceSpec;\n const read = (): G9Segment => {\n const s = (latest.current ?? first).segment;\n return toSegment(typeof s === 'function' ? s() : s);\n };\n const call = <K extends keyof G9PlaceSpec>(k: K) => (latest.current ?? first)[k] as G9PlaceSpec[K];\n const declaration: G9PlaceDeclaration = {\n segment: read,\n layer: first.layer,\n ...(first.order !== undefined ? { order: first.order } : {}),\n ...(first.under ? { under: first.under } : {}),\n ...(first.title ? { title: () => call('title')?.() } : {}),\n ...(first.view ? { view: () => call('view')?.() } : {}),\n ...(first.applyView ? { applyView: (v: Readonly<Record<string, string>>) => call('applyView')?.(v) } : {}),\n ...(first.close ? { close: () => call('close')?.() } : {}),\n ...(first.canLeave ? { canLeave: () => call('canLeave')?.() ?? true } : {}),\n ...(first.describeChanges ? { describeChanges: () => call('describeChanges')?.() ?? [] } : {}),\n ...(first.facts ? { facts: () => call('facts')?.() ?? {} } : {}),\n };\n lastText.current = segmentText(first);\n const h = sink.declare(declaration);\n handle.current = h;\n return () => {\n h.remove();\n if (handle.current === h) handle.current = null;\n };\n }, [sink, key]);\n\n useEffect(() => {\n if (!spec || !handle.current) return;\n const text = segmentText(spec);\n if (text === lastText.current) return;\n lastText.current = text;\n handle.current.touch();\n });\n}\n\n/** Props of {@link G9Place}. */\nexport interface G9PlaceProps extends G9PlaceSpec {\n readonly active?: boolean;\n readonly children?: ReactNode;\n}\n\n/** Declares a place around its children (renders no element). */\nexport function G9Place(props: G9PlaceProps): ReactNode {\n const { children, active, ...spec } = props;\n useG9Place(spec, active === undefined ? {} : { active });\n return <>{children}</>;\n}\n\n/** The segment of a sheet without an explicit route: `sheet.<its automation id in kebab case>`, else `sheet`. */\nexport function sheetSegmentOf(automationId: string | undefined | null): G9Segment {\n if (!automationId) return { kind: 'sheet' };\n const kebab = automationId\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[^A-Za-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase()\n .replace(/^[^a-z]+/, '')\n .slice(0, 32)\n .replace(/-+$/, '');\n return kebab ? { kind: 'sheet', variant: kebab } : { kind: 'sheet' };\n}\n"],"names":["useG9RouteSink","_useContext","G9CoreContext","useG9Router","sink","isG9Router","NO_LOCATION","NULL","useG9Location","router","useSyncExternalStore","l","segmentText","spec","s","formatAddress","toSegment","useG9Place","options","_options_active","_spec_order","ownSink","undefined","latest","useRef","handle","lastText","active","key","useEffect","first","read","_latest_current","call","k","declaration","_call","v","h","text","G9Place","props","children","sheetSegmentOf","automationId","kebab"],"mappings":";;;;AAqBO,SAASA;;QACPC;IAAP,OAAO,QAAP,gBAAOA,CAAAA,cAAAA,WAAWC,cAAaA,IAAxBD,KAAAA,IAAAA,YAA2B,QAAQ,CAAC,KAAK,AAAD,IAAC,OAAI;AACtD;AAGO,SAASE;IACd,MAAMC,OAAOJ;IACb,OAAOK,WAAWD,QAAQA,OAAO;AACnC;AAEA,MAAME,cAAc,IAAM,KAAO;AACjC,MAAMC,OAAO,IAAM;AAGZ,SAASC;IACd,MAAMC,SAASN;IACf,OAAOO,qBACLD,SAAS,CAACE,IAAMF,OAAO,OAAO,CAAC,SAAS,CAACE,KAAKL,aAC9CG,SAAS,IAAMA,OAAO,OAAO,CAAC,GAAG,KAAKF;AAE1C;AAEA,SAASK,YAAYC,IAAiB;IACpC,IAAI;QACF,MAAMC,IAAI,AAAwB,cAAxB,OAAOD,KAAK,OAAO,GAAkBA,KAAK,OAAO,KAAKA,KAAK,OAAO;QAC5E,OAAOE,cAAc;YAACC,UAAUF;SAAG;IACrC,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAQO,SAASG,WACdJ,IAAwB,EACxBK,UAA6E,CAAC,CAAC;QAQhEC,iBAC+BC;IAP9C,MAAMC,UAAUrB;IAChB,MAAMI,OAAOc,AAAiBI,WAAjBJ,QAAQ,IAAI,GAAiBA,QAAQ,IAAI,GAAGG;IACzD,MAAME,SAASC,OAAOX;IACtBU,OAAO,OAAO,GAAGV;IACjB,MAAMY,SAASD,OAA6B;IAC5C,MAAME,WAAWF,OAAO;IACxB,MAAMG,SAAS,QAAAR,CAAAA,kBAAAA,QAAQ,MAAM,AAAD,IAAbA,kBAAkB;IACjC,MAA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WL,WAAXK,SAAuB,CAAC,IAAI;QAAEA;IAAO;IACtD,UAAUe;AACZ;AAGO,SAASC,eAAeC,YAAuC;IACpE,IAAI,CAACA,cAAc,OAAO;QAAE,MAAM;IAAQ;IAC1C,MAAMC,QAAQD,aACX,OAAO,CAAC,sBAAsB,SAC9B,OAAO,CAAC,kBAAkB,KAC1B,OAAO,CAAC,YAAY,IACpB,WAAW,GACX,OAAO,CAAC,YAAY,IACpB,KAAK,CAAC,GAAG,IACT,OAAO,CAAC,OAAO;IAClB,OAAOC,QAAQ;QAAE,MAAM;QAAS,SAASA;IAAM,IAAI;QAAE,MAAM;IAAQ;AACrE"}
@@ -0,0 +1,3 @@
1
+ export { G9Place, type G9PlaceProps, type G9PlaceSpec, sheetSegmentOf, useG9Location, useG9Place, useG9Router, useG9RouteSink, } from './hooks.js';
2
+ export { createG9Router, type G9Excursion, type G9GoOptions, type G9GoResult, type G9GoSource, type G9Location, type G9ReadableStore, type G9RouteEvent, type G9Router, type G9RouterOptions, type G9RouterTexts, type G9TrailEntry, type G9Walk, type G9WalkOptions, type G9WalkPresenter, type G9WalkStep, isG9Router, } from './router.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/route/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,UAAU,GACX,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { G9Place, sheetSegmentOf, useG9Location, useG9Place, useG9RouteSink, useG9Router } from "./hooks.jsx";
2
+ export { createG9Router, isG9Router } from "./router.jsx";