@g9tm/lynxcontrols 1.7.3 → 2.1.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 (553) hide show
  1. package/README.md +12 -5
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/anchor/context.jsx +0 -2
  4. package/dist/anchor/hooks.d.ts.map +1 -1
  5. package/dist/anchor/hooks.jsx +6 -4
  6. package/dist/anchor/measure.jsx +0 -2
  7. package/dist/anchor/registry.d.ts +12 -2
  8. package/dist/anchor/registry.d.ts.map +1 -1
  9. package/dist/anchor/registry.jsx +11 -3
  10. package/dist/anchor/scroll.jsx +0 -2
  11. package/dist/base/control.d.ts +18 -2
  12. package/dist/base/control.d.ts.map +1 -1
  13. package/dist/base/control.jsx +16 -9
  14. package/dist/base/corner-badge.jsx +0 -2
  15. package/dist/base/disposer.jsx +0 -2
  16. package/dist/base/index.d.ts +3 -2
  17. package/dist/base/index.d.ts.map +1 -1
  18. package/dist/base/index.jsx +3 -2
  19. package/dist/base/press.css +83 -0
  20. package/dist/base/press.css.map +1 -0
  21. package/dist/base/press.d.ts +13 -2
  22. package/dist/base/press.d.ts.map +1 -1
  23. package/dist/base/press.jsx +49 -5
  24. package/dist/base/pressable.d.ts +10 -1
  25. package/dist/base/pressable.d.ts.map +1 -1
  26. package/dist/base/pressable.jsx +13 -8
  27. package/dist/base/selection-item.jsx +0 -2
  28. package/dist/base/timers.jsx +0 -2
  29. package/dist/base/tone.d.ts +15 -0
  30. package/dist/base/tone.d.ts.map +1 -0
  31. package/dist/base/tone.jsx +71 -0
  32. package/dist/base/use-controllable-state.jsx +0 -2
  33. package/dist/base/use-stable-callback.jsx +0 -2
  34. package/dist/button/button-variants.css +236 -0
  35. package/dist/button/button-variants.css.map +1 -0
  36. package/dist/button/button.css +21 -0
  37. package/dist/button/button.css.map +1 -1
  38. package/dist/button/button.d.ts +13 -1
  39. package/dist/button/button.d.ts.map +1 -1
  40. package/dist/button/button.jsx +51 -38
  41. package/dist/button/header-action-button.d.ts +1 -0
  42. package/dist/button/header-action-button.d.ts.map +1 -1
  43. package/dist/button/header-action-button.jsx +6 -7
  44. package/dist/button/icon-button.d.ts +11 -1
  45. package/dist/button/icon-button.d.ts.map +1 -1
  46. package/dist/button/icon-button.jsx +21 -17
  47. package/dist/button/nav-card.d.ts +1 -0
  48. package/dist/button/nav-card.d.ts.map +1 -1
  49. package/dist/button/nav-card.jsx +6 -7
  50. package/dist/button/safe-tap.jsx +0 -2
  51. package/dist/button/safe.jsx +3 -5
  52. package/dist/button/variant-css.d.ts +8 -0
  53. package/dist/button/variant-css.d.ts.map +1 -0
  54. package/dist/button/variant-css.jsx +47 -0
  55. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  56. package/dist/button/vertical-icon-text-button.jsx +1 -3
  57. package/dist/button/visuals.d.ts +7 -1
  58. package/dist/button/visuals.d.ts.map +1 -1
  59. package/dist/button/visuals.jsx +5 -5
  60. package/dist/cascade/cascade-panel.jsx +0 -2
  61. package/dist/cascade/model.jsx +0 -2
  62. package/dist/commands/commands.css +167 -0
  63. package/dist/commands/commands.css.map +1 -0
  64. package/dist/commands/index.d.ts +3 -0
  65. package/dist/commands/index.d.ts.map +1 -0
  66. package/dist/commands/index.jsx +2 -0
  67. package/dist/commands/keys.d.ts +22 -0
  68. package/dist/commands/keys.d.ts.map +1 -0
  69. package/dist/commands/keys.jsx +119 -0
  70. package/dist/commands/palette.d.ts +62 -0
  71. package/dist/commands/palette.d.ts.map +1 -0
  72. package/dist/commands/palette.jsx +175 -0
  73. package/dist/deferred/deferred-content.jsx +2 -4
  74. package/dist/deferred/readiness-signal.jsx +0 -2
  75. package/dist/display/activity-indicator.jsx +0 -2
  76. package/dist/display/culture-date-time-label.jsx +1 -3
  77. package/dist/display/extras.css +117 -0
  78. package/dist/display/extras.css.map +1 -0
  79. package/dist/display/extras.d.ts +65 -0
  80. package/dist/display/extras.d.ts.map +1 -0
  81. package/dist/display/extras.jsx +118 -0
  82. package/dist/display/figures-index.d.ts +3 -0
  83. package/dist/display/figures-index.d.ts.map +1 -0
  84. package/dist/display/figures-index.jsx +2 -0
  85. package/dist/display/figures.css +249 -0
  86. package/dist/display/figures.css.map +1 -0
  87. package/dist/display/figures.d.ts +132 -0
  88. package/dist/display/figures.d.ts.map +1 -0
  89. package/dist/display/figures.jsx +223 -0
  90. package/dist/display/image.css +46 -0
  91. package/dist/display/image.css.map +1 -0
  92. package/dist/display/image.d.ts +32 -0
  93. package/dist/display/image.d.ts.map +1 -0
  94. package/dist/display/image.jsx +49 -0
  95. package/dist/display/index.d.ts +6 -0
  96. package/dist/display/index.d.ts.map +1 -1
  97. package/dist/display/index.jsx +6 -0
  98. package/dist/display/keycap.css +32 -0
  99. package/dist/display/keycap.css.map +1 -0
  100. package/dist/display/keycap.d.ts +20 -0
  101. package/dist/display/keycap.d.ts.map +1 -0
  102. package/dist/display/keycap.jsx +17 -0
  103. package/dist/display/motion-figures.css +168 -0
  104. package/dist/display/motion-figures.css.map +1 -0
  105. package/dist/display/motion-figures.d.ts +155 -0
  106. package/dist/display/motion-figures.d.ts.map +1 -0
  107. package/dist/display/motion-figures.jsx +246 -0
  108. package/dist/display/progress-bar.jsx +1 -3
  109. package/dist/display/separator.d.ts.map +1 -1
  110. package/dist/display/separator.jsx +2 -4
  111. package/dist/display/shimmer.jsx +0 -2
  112. package/dist/display/skeleton.css +72 -0
  113. package/dist/display/skeleton.css.map +1 -0
  114. package/dist/display/status.css +111 -0
  115. package/dist/display/status.css.map +1 -0
  116. package/dist/display/status.d.ts +67 -0
  117. package/dist/display/status.d.ts.map +1 -0
  118. package/dist/display/status.jsx +117 -0
  119. package/dist/display/theme-preview.css +244 -0
  120. package/dist/display/theme-preview.css.map +1 -0
  121. package/dist/display/theme-preview.d.ts +19 -0
  122. package/dist/display/theme-preview.d.ts.map +1 -0
  123. package/dist/display/theme-preview.jsx +89 -0
  124. package/dist/display/title-with-line.d.ts.map +1 -1
  125. package/dist/display/title-with-line.jsx +2 -4
  126. package/dist/edge-panel/edge-panel.jsx +0 -2
  127. package/dist/edge-panel/helper.jsx +0 -2
  128. package/dist/edge-panel/types.jsx +0 -2
  129. package/dist/effects/effects.css +94 -0
  130. package/dist/effects/effects.css.map +1 -0
  131. package/dist/effects/effects.d.ts +83 -0
  132. package/dist/effects/effects.d.ts.map +1 -0
  133. package/dist/effects/effects.jsx +183 -0
  134. package/dist/effects/index.d.ts +2 -0
  135. package/dist/effects/index.d.ts.map +1 -0
  136. package/dist/effects/index.jsx +1 -0
  137. package/dist/expander/expander.d.ts +1 -0
  138. package/dist/expander/expander.d.ts.map +1 -1
  139. package/dist/expander/expander.jsx +22 -23
  140. package/dist/fields/dictation.jsx +0 -2
  141. package/dist/fields/editor.jsx +2 -4
  142. package/dist/fields/extra-entries.css +133 -0
  143. package/dist/fields/extra-entries.css.map +1 -0
  144. package/dist/fields/extra-entries.d.ts +98 -0
  145. package/dist/fields/extra-entries.d.ts.map +1 -0
  146. package/dist/fields/extra-entries.jsx +323 -0
  147. package/dist/fields/fields.css +4 -0
  148. package/dist/fields/fields.css.map +1 -1
  149. package/dist/fields/index.d.ts +4 -3
  150. package/dist/fields/index.d.ts.map +1 -1
  151. package/dist/fields/index.jsx +1 -0
  152. package/dist/fields/input-policy.jsx +0 -2
  153. package/dist/fields/notch.jsx +0 -2
  154. package/dist/fields/outlined-field.d.ts +9 -0
  155. package/dist/fields/outlined-field.d.ts.map +1 -1
  156. package/dist/fields/outlined-field.jsx +10 -8
  157. package/dist/fields/pin-entry.d.ts.map +1 -1
  158. package/dist/fields/pin-entry.jsx +11 -13
  159. package/dist/fields/search-entry.jsx +2 -4
  160. package/dist/fields/slot-layout.jsx +0 -2
  161. package/dist/fields/text-entry.jsx +2 -4
  162. package/dist/fields/use-dictation.jsx +0 -2
  163. package/dist/fields/use-text-input.d.ts +1 -1
  164. package/dist/fields/use-text-input.jsx +0 -2
  165. package/dist/fields/validator.jsx +0 -2
  166. package/dist/guide/confirm-sheet.jsx +0 -2
  167. package/dist/guide/journey.jsx +0 -2
  168. package/dist/guide/placement.jsx +0 -2
  169. package/dist/guide/service.jsx +0 -2
  170. package/dist/guide/settings.jsx +0 -2
  171. package/dist/header/app-bar.d.ts +35 -0
  172. package/dist/header/app-bar.d.ts.map +1 -0
  173. package/dist/header/app-bar.jsx +64 -0
  174. package/dist/header/header.css +79 -0
  175. package/dist/header/header.css.map +1 -0
  176. package/dist/header/index.d.ts +2 -0
  177. package/dist/header/index.d.ts.map +1 -0
  178. package/dist/header/index.jsx +1 -0
  179. package/dist/host/back.jsx +0 -2
  180. package/dist/host/hooks.jsx +0 -2
  181. package/dist/host/host.css +1 -0
  182. package/dist/host/host.css.map +1 -1
  183. package/dist/host/host.d.ts.map +1 -1
  184. package/dist/host/host.jsx +50 -17
  185. package/dist/host/keyboard.jsx +0 -2
  186. package/dist/host/layers.jsx +0 -2
  187. package/dist/host/page-loading-overlay.jsx +0 -2
  188. package/dist/host/readiness.jsx +0 -2
  189. package/dist/host/registry.d.ts +9 -0
  190. package/dist/host/registry.d.ts.map +1 -1
  191. package/dist/host/registry.jsx +0 -2
  192. package/dist/icon/icon.d.ts +16 -0
  193. package/dist/icon/icon.d.ts.map +1 -1
  194. package/dist/icon/icon.jsx +53 -14
  195. package/dist/icon/index.d.ts +1 -1
  196. package/dist/icon/index.d.ts.map +1 -1
  197. package/dist/icon/index.jsx +1 -1
  198. package/dist/icon/slot.jsx +0 -2
  199. package/dist/icon/swatch.jsx +0 -2
  200. package/dist/index.d.ts +9 -0
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/layout/containers.d.ts +113 -0
  203. package/dist/layout/containers.d.ts.map +1 -0
  204. package/dist/layout/containers.jsx +195 -0
  205. package/dist/layout/index.d.ts +4 -0
  206. package/dist/layout/index.d.ts.map +1 -0
  207. package/dist/layout/index.jsx +3 -0
  208. package/dist/layout/layout.css +361 -0
  209. package/dist/layout/layout.css.map +1 -0
  210. package/dist/layout/scroll-spy.d.ts +18 -0
  211. package/dist/layout/scroll-spy.d.ts.map +1 -0
  212. package/dist/layout/scroll-spy.jsx +38 -0
  213. package/dist/layout/scrollers.d.ts +96 -0
  214. package/dist/layout/scrollers.d.ts.map +1 -0
  215. package/dist/layout/scrollers.jsx +208 -0
  216. package/dist/list/gestures.d.ts +40 -0
  217. package/dist/list/gestures.d.ts.map +1 -0
  218. package/dist/list/gestures.jsx +142 -0
  219. package/dist/list/index.d.ts +4 -0
  220. package/dist/list/index.d.ts.map +1 -0
  221. package/dist/list/index.jsx +3 -0
  222. package/dist/list/list.css +194 -0
  223. package/dist/list/list.css.map +1 -0
  224. package/dist/list/rows.d.ts +69 -0
  225. package/dist/list/rows.d.ts.map +1 -0
  226. package/dist/list/rows.jsx +105 -0
  227. package/dist/list/virtual-list.d.ts +94 -0
  228. package/dist/list/virtual-list.d.ts.map +1 -0
  229. package/dist/list/virtual-list.jsx +159 -0
  230. package/dist/orb/hold-button.d.ts +26 -0
  231. package/dist/orb/hold-button.d.ts.map +1 -0
  232. package/dist/orb/hold-button.jsx +33 -0
  233. package/dist/orb/hold.d.ts +36 -0
  234. package/dist/orb/hold.d.ts.map +1 -0
  235. package/dist/orb/hold.jsx +76 -0
  236. package/dist/orb/index.d.ts +5 -0
  237. package/dist/orb/index.d.ts.map +1 -0
  238. package/dist/orb/index.jsx +4 -0
  239. package/dist/orb/model.d.ts +42 -0
  240. package/dist/orb/model.d.ts.map +1 -0
  241. package/dist/orb/model.jsx +42 -0
  242. package/dist/orb/orb.css +81 -0
  243. package/dist/orb/orb.css.map +1 -0
  244. package/dist/orb/orb.d.ts +61 -0
  245. package/dist/orb/orb.d.ts.map +1 -0
  246. package/dist/orb/orb.jsx +171 -0
  247. package/dist/pickers/combo-box.jsx +0 -2
  248. package/dist/pickers/date-time-picker.jsx +0 -2
  249. package/dist/pickers/date-time.jsx +0 -2
  250. package/dist/pickers/day-stepper.css +43 -0
  251. package/dist/pickers/day-stepper.css.map +1 -0
  252. package/dist/pickers/day-stepper.d.ts +31 -0
  253. package/dist/pickers/day-stepper.d.ts.map +1 -0
  254. package/dist/pickers/day-stepper.jsx +60 -0
  255. package/dist/pickers/index.d.ts +1 -0
  256. package/dist/pickers/index.d.ts.map +1 -1
  257. package/dist/pickers/index.jsx +1 -0
  258. package/dist/pickers/picker-sheet.jsx +0 -2
  259. package/dist/pickers/picker.d.ts +11 -0
  260. package/dist/pickers/picker.d.ts.map +1 -1
  261. package/dist/pickers/picker.jsx +53 -9
  262. package/dist/pickers/timespan-picker.jsx +0 -2
  263. package/dist/pickers/timespan.jsx +0 -2
  264. package/dist/pickers/trigger.jsx +0 -2
  265. package/dist/pickers/wheel-column.jsx +0 -2
  266. package/dist/plus-button/model.jsx +0 -2
  267. package/dist/plus-button/plus-button.jsx +0 -2
  268. package/dist/popover/index.d.ts +3 -0
  269. package/dist/popover/index.d.ts.map +1 -0
  270. package/dist/popover/index.jsx +2 -0
  271. package/dist/popover/popover.css +183 -0
  272. package/dist/popover/popover.css.map +1 -0
  273. package/dist/popover/popover.d.ts +139 -0
  274. package/dist/popover/popover.d.ts.map +1 -0
  275. package/dist/popover/popover.jsx +291 -0
  276. package/dist/popover/position.d.ts +35 -0
  277. package/dist/popover/position.d.ts.map +1 -0
  278. package/dist/popover/position.jsx +53 -0
  279. package/dist/popup/frame.jsx +0 -2
  280. package/dist/popup/input-form.jsx +0 -2
  281. package/dist/popup/input.jsx +0 -2
  282. package/dist/popup/popup-view.jsx +0 -2
  283. package/dist/popup/queue.jsx +0 -2
  284. package/dist/popup/service.jsx +0 -2
  285. package/dist/popup/types.jsx +0 -2
  286. package/dist/provider/activity.d.ts +13 -0
  287. package/dist/provider/activity.d.ts.map +1 -0
  288. package/dist/provider/activity.jsx +55 -0
  289. package/dist/provider/contexts.d.ts +32 -1
  290. package/dist/provider/contexts.d.ts.map +1 -1
  291. package/dist/provider/contexts.jsx +7 -3
  292. package/dist/provider/global-events.jsx +0 -2
  293. package/dist/provider/hooks.d.ts +16 -2
  294. package/dist/provider/hooks.d.ts.map +1 -1
  295. package/dist/provider/hooks.jsx +35 -7
  296. package/dist/provider/index.d.ts +4 -2
  297. package/dist/provider/index.d.ts.map +1 -1
  298. package/dist/provider/index.jsx +3 -1
  299. package/dist/provider/keep-alive.css +19 -0
  300. package/dist/provider/keep-alive.css.map +1 -0
  301. package/dist/provider/keep-alive.d.ts +23 -0
  302. package/dist/provider/keep-alive.d.ts.map +1 -0
  303. package/dist/provider/keep-alive.jsx +9 -0
  304. package/dist/provider/provider.css +1 -1
  305. package/dist/provider/provider.css.map +1 -1
  306. package/dist/provider/provider.d.ts +13 -1
  307. package/dist/provider/provider.d.ts.map +1 -1
  308. package/dist/provider/provider.jsx +128 -15
  309. package/dist/provider/settings.d.ts +23 -0
  310. package/dist/provider/settings.d.ts.map +1 -1
  311. package/dist/provider/settings.jsx +5 -4
  312. package/dist/provider/theme-css.d.ts +1 -1
  313. package/dist/provider/theme-css.d.ts.map +1 -1
  314. package/dist/provider/theme-css.jsx +21 -10
  315. package/dist/provider/theme-root.d.ts.map +1 -1
  316. package/dist/provider/theme-root.jsx +7 -5
  317. package/dist/provider/theme.css +72 -0
  318. package/dist/provider/theme.css.map +1 -1
  319. package/dist/range-slider/index.d.ts +1 -0
  320. package/dist/range-slider/index.d.ts.map +1 -1
  321. package/dist/range-slider/index.jsx +1 -0
  322. package/dist/range-slider/math.jsx +0 -2
  323. package/dist/range-slider/range-slider.css +82 -0
  324. package/dist/range-slider/range-slider.css.map +1 -1
  325. package/dist/range-slider/range-slider.jsx +0 -2
  326. package/dist/range-slider/step-slider.d.ts +18 -0
  327. package/dist/range-slider/step-slider.d.ts.map +1 -0
  328. package/dist/range-slider/step-slider.jsx +55 -0
  329. package/dist/route/hooks.jsx +0 -2
  330. package/dist/route/router.jsx +0 -2
  331. package/dist/selection/model.jsx +0 -2
  332. package/dist/selection/selection-sheet.jsx +0 -2
  333. package/dist/selection/use-selection-model.jsx +0 -2
  334. package/dist/selection/window.jsx +0 -2
  335. package/dist/sheet/backdrop-scope.d.ts +14 -0
  336. package/dist/sheet/backdrop-scope.d.ts.map +1 -0
  337. package/dist/sheet/backdrop-scope.jsx +25 -0
  338. package/dist/sheet/context.d.ts +22 -0
  339. package/dist/sheet/context.d.ts.map +1 -0
  340. package/dist/sheet/context.jsx +7 -0
  341. package/dist/sheet/frame.d.ts +2 -17
  342. package/dist/sheet/frame.d.ts.map +1 -1
  343. package/dist/sheet/frame.jsx +23 -19
  344. package/dist/sheet/gesture.jsx +1 -3
  345. package/dist/sheet/handoff.jsx +0 -2
  346. package/dist/sheet/header.jsx +3 -3
  347. package/dist/sheet/height-memo.jsx +0 -2
  348. package/dist/sheet/index.d.ts +2 -0
  349. package/dist/sheet/index.d.ts.map +1 -1
  350. package/dist/sheet/index.jsx +2 -0
  351. package/dist/sheet/loadable.jsx +0 -2
  352. package/dist/sheet/motion.jsx +0 -2
  353. package/dist/sheet/options.d.ts +17 -0
  354. package/dist/sheet/options.d.ts.map +1 -1
  355. package/dist/sheet/options.jsx +2 -3
  356. package/dist/sheet/panel-frame.css +204 -0
  357. package/dist/sheet/panel-frame.css.map +1 -0
  358. package/dist/sheet/panel-frame.d.ts +16 -0
  359. package/dist/sheet/panel-frame.d.ts.map +1 -0
  360. package/dist/sheet/panel-frame.jsx +103 -0
  361. package/dist/sheet/processing.jsx +0 -2
  362. package/dist/sheet/scroll-indicator.jsx +0 -2
  363. package/dist/sheet/scroll-region.d.ts +19 -0
  364. package/dist/sheet/scroll-region.d.ts.map +1 -0
  365. package/dist/sheet/scroll-region.jsx +58 -0
  366. package/dist/sheet/service.d.ts.map +1 -1
  367. package/dist/sheet/service.jsx +23 -9
  368. package/dist/sheet/sheet.css +33 -0
  369. package/dist/sheet/sheet.css.map +1 -1
  370. package/dist/sheet/sheet.jsx +0 -2
  371. package/dist/sheet/sizing.d.ts +3 -3
  372. package/dist/sheet/sizing.jsx +0 -2
  373. package/dist/sheet/stack.jsx +0 -2
  374. package/dist/shell/index.d.ts +2 -0
  375. package/dist/shell/index.d.ts.map +1 -0
  376. package/dist/shell/index.jsx +1 -0
  377. package/dist/shell/shell.css +342 -0
  378. package/dist/shell/shell.css.map +1 -0
  379. package/dist/shell/shell.d.ts +121 -0
  380. package/dist/shell/shell.d.ts.map +1 -0
  381. package/dist/shell/shell.jsx +214 -0
  382. package/dist/survey/index.d.ts +2 -0
  383. package/dist/survey/index.d.ts.map +1 -0
  384. package/dist/survey/index.jsx +1 -0
  385. package/dist/survey/survey.css +204 -0
  386. package/dist/survey/survey.css.map +1 -0
  387. package/dist/survey/survey.d.ts +76 -0
  388. package/dist/survey/survey.d.ts.map +1 -0
  389. package/dist/survey/survey.jsx +205 -0
  390. package/dist/swipe/model.jsx +0 -2
  391. package/dist/swipe/swipe-view.jsx +0 -2
  392. package/dist/tab-bar/metrics.jsx +20 -22
  393. package/dist/tab-bar/model.d.ts +2 -0
  394. package/dist/tab-bar/model.d.ts.map +1 -1
  395. package/dist/tab-bar/model.jsx +10 -6
  396. package/dist/tab-bar/tab-bar.css +74 -0
  397. package/dist/tab-bar/tab-bar.css.map +1 -1
  398. package/dist/tab-bar/tab-bar.d.ts +7 -0
  399. package/dist/tab-bar/tab-bar.d.ts.map +1 -1
  400. package/dist/tab-bar/tab-bar.jsx +51 -17
  401. package/dist/tabs/model.jsx +0 -2
  402. package/dist/tabs/tab-view.d.ts +1 -0
  403. package/dist/tabs/tab-view.d.ts.map +1 -1
  404. package/dist/tabs/tab-view.jsx +6 -5
  405. package/dist/tabs/tabs.css +1 -0
  406. package/dist/tabs/tabs.css.map +1 -1
  407. package/dist/toast/service.d.ts.map +1 -1
  408. package/dist/toast/service.jsx +34 -16
  409. package/dist/toast/store.jsx +0 -2
  410. package/dist/toggle/checkbox-math.jsx +0 -2
  411. package/dist/toggle/checkbox.d.ts.map +1 -1
  412. package/dist/toggle/checkbox.jsx +10 -12
  413. package/dist/toggle/chip-group.d.ts.map +1 -1
  414. package/dist/toggle/chip-group.jsx +8 -7
  415. package/dist/toggle/choice.css +254 -0
  416. package/dist/toggle/choice.css.map +1 -0
  417. package/dist/toggle/choice.d.ts +125 -0
  418. package/dist/toggle/choice.d.ts.map +1 -0
  419. package/dist/toggle/choice.jsx +367 -0
  420. package/dist/toggle/index.d.ts +2 -1
  421. package/dist/toggle/index.d.ts.map +1 -1
  422. package/dist/toggle/index.jsx +1 -0
  423. package/dist/toggle/switch.d.ts.map +1 -1
  424. package/dist/toggle/switch.jsx +8 -11
  425. package/package.json +126 -16
  426. package/tailwind/index.d.ts +13 -0
  427. package/tailwind/index.mjs +87 -0
  428. package/tailwind/index.test.mjs +24 -0
  429. package/tailwind/tokens.mjs +98 -0
  430. package/dist/anchor/context.jsx.map +0 -1
  431. package/dist/anchor/hooks.jsx.map +0 -1
  432. package/dist/anchor/measure.jsx.map +0 -1
  433. package/dist/anchor/registry.jsx.map +0 -1
  434. package/dist/anchor/scroll.jsx.map +0 -1
  435. package/dist/base/control.jsx.map +0 -1
  436. package/dist/base/corner-badge.jsx.map +0 -1
  437. package/dist/base/disposer.jsx.map +0 -1
  438. package/dist/base/press.jsx.map +0 -1
  439. package/dist/base/pressable.jsx.map +0 -1
  440. package/dist/base/selection-item.jsx.map +0 -1
  441. package/dist/base/timers.jsx.map +0 -1
  442. package/dist/base/use-controllable-state.jsx.map +0 -1
  443. package/dist/base/use-stable-callback.jsx.map +0 -1
  444. package/dist/button/button.jsx.map +0 -1
  445. package/dist/button/header-action-button.jsx.map +0 -1
  446. package/dist/button/icon-button.jsx.map +0 -1
  447. package/dist/button/nav-card.jsx.map +0 -1
  448. package/dist/button/safe-tap.jsx.map +0 -1
  449. package/dist/button/safe.jsx.map +0 -1
  450. package/dist/button/vertical-icon-text-button.jsx.map +0 -1
  451. package/dist/button/visuals.jsx.map +0 -1
  452. package/dist/cascade/cascade-panel.jsx.map +0 -1
  453. package/dist/cascade/model.jsx.map +0 -1
  454. package/dist/deferred/deferred-content.jsx.map +0 -1
  455. package/dist/deferred/readiness-signal.jsx.map +0 -1
  456. package/dist/display/activity-indicator.jsx.map +0 -1
  457. package/dist/display/culture-date-time-label.jsx.map +0 -1
  458. package/dist/display/progress-bar.jsx.map +0 -1
  459. package/dist/display/separator.jsx.map +0 -1
  460. package/dist/display/shimmer.jsx.map +0 -1
  461. package/dist/display/title-with-line.jsx.map +0 -1
  462. package/dist/edge-panel/edge-panel.jsx.map +0 -1
  463. package/dist/edge-panel/helper.jsx.map +0 -1
  464. package/dist/edge-panel/types.jsx.map +0 -1
  465. package/dist/expander/expander.jsx.map +0 -1
  466. package/dist/fields/dictation.jsx.map +0 -1
  467. package/dist/fields/editor.jsx.map +0 -1
  468. package/dist/fields/input-policy.jsx.map +0 -1
  469. package/dist/fields/notch.jsx.map +0 -1
  470. package/dist/fields/outlined-field.jsx.map +0 -1
  471. package/dist/fields/pin-entry.jsx.map +0 -1
  472. package/dist/fields/search-entry.jsx.map +0 -1
  473. package/dist/fields/slot-layout.jsx.map +0 -1
  474. package/dist/fields/text-entry.jsx.map +0 -1
  475. package/dist/fields/use-dictation.jsx.map +0 -1
  476. package/dist/fields/use-text-input.jsx.map +0 -1
  477. package/dist/fields/validator.jsx.map +0 -1
  478. package/dist/guide/confirm-sheet.jsx.map +0 -1
  479. package/dist/guide/journey.jsx.map +0 -1
  480. package/dist/guide/placement.jsx.map +0 -1
  481. package/dist/guide/service.jsx.map +0 -1
  482. package/dist/guide/settings.jsx.map +0 -1
  483. package/dist/host/back.jsx.map +0 -1
  484. package/dist/host/hooks.jsx.map +0 -1
  485. package/dist/host/host.jsx.map +0 -1
  486. package/dist/host/keyboard.jsx.map +0 -1
  487. package/dist/host/layers.jsx.map +0 -1
  488. package/dist/host/page-loading-overlay.jsx.map +0 -1
  489. package/dist/host/readiness.jsx.map +0 -1
  490. package/dist/host/registry.jsx.map +0 -1
  491. package/dist/icon/icon.jsx.map +0 -1
  492. package/dist/icon/slot.jsx.map +0 -1
  493. package/dist/icon/swatch.jsx.map +0 -1
  494. package/dist/pickers/combo-box.jsx.map +0 -1
  495. package/dist/pickers/date-time-picker.jsx.map +0 -1
  496. package/dist/pickers/date-time.jsx.map +0 -1
  497. package/dist/pickers/picker-sheet.jsx.map +0 -1
  498. package/dist/pickers/picker.jsx.map +0 -1
  499. package/dist/pickers/timespan-picker.jsx.map +0 -1
  500. package/dist/pickers/timespan.jsx.map +0 -1
  501. package/dist/pickers/trigger.jsx.map +0 -1
  502. package/dist/pickers/wheel-column.jsx.map +0 -1
  503. package/dist/plus-button/model.jsx.map +0 -1
  504. package/dist/plus-button/plus-button.jsx.map +0 -1
  505. package/dist/popup/frame.jsx.map +0 -1
  506. package/dist/popup/input-form.jsx.map +0 -1
  507. package/dist/popup/input.jsx.map +0 -1
  508. package/dist/popup/popup-view.jsx.map +0 -1
  509. package/dist/popup/queue.jsx.map +0 -1
  510. package/dist/popup/service.jsx.map +0 -1
  511. package/dist/popup/types.jsx.map +0 -1
  512. package/dist/provider/contexts.jsx.map +0 -1
  513. package/dist/provider/global-events.jsx.map +0 -1
  514. package/dist/provider/hooks.jsx.map +0 -1
  515. package/dist/provider/provider.jsx.map +0 -1
  516. package/dist/provider/settings.jsx.map +0 -1
  517. package/dist/provider/theme-css.jsx.map +0 -1
  518. package/dist/provider/theme-root.jsx.map +0 -1
  519. package/dist/range-slider/math.jsx.map +0 -1
  520. package/dist/range-slider/range-slider.jsx.map +0 -1
  521. package/dist/route/hooks.jsx.map +0 -1
  522. package/dist/route/router.jsx.map +0 -1
  523. package/dist/selection/model.jsx.map +0 -1
  524. package/dist/selection/selection-sheet.jsx.map +0 -1
  525. package/dist/selection/use-selection-model.jsx.map +0 -1
  526. package/dist/selection/window.jsx.map +0 -1
  527. package/dist/sheet/frame.jsx.map +0 -1
  528. package/dist/sheet/gesture.jsx.map +0 -1
  529. package/dist/sheet/handoff.jsx.map +0 -1
  530. package/dist/sheet/header.jsx.map +0 -1
  531. package/dist/sheet/height-memo.jsx.map +0 -1
  532. package/dist/sheet/loadable.jsx.map +0 -1
  533. package/dist/sheet/motion.jsx.map +0 -1
  534. package/dist/sheet/options.jsx.map +0 -1
  535. package/dist/sheet/processing.jsx.map +0 -1
  536. package/dist/sheet/scroll-indicator.jsx.map +0 -1
  537. package/dist/sheet/service.jsx.map +0 -1
  538. package/dist/sheet/sheet.jsx.map +0 -1
  539. package/dist/sheet/sizing.jsx.map +0 -1
  540. package/dist/sheet/stack.jsx.map +0 -1
  541. package/dist/swipe/model.jsx.map +0 -1
  542. package/dist/swipe/swipe-view.jsx.map +0 -1
  543. package/dist/tab-bar/metrics.jsx.map +0 -1
  544. package/dist/tab-bar/model.jsx.map +0 -1
  545. package/dist/tab-bar/tab-bar.jsx.map +0 -1
  546. package/dist/tabs/model.jsx.map +0 -1
  547. package/dist/tabs/tab-view.jsx.map +0 -1
  548. package/dist/toast/service.jsx.map +0 -1
  549. package/dist/toast/store.jsx.map +0 -1
  550. package/dist/toggle/checkbox-math.jsx.map +0 -1
  551. package/dist/toggle/checkbox.jsx.map +0 -1
  552. package/dist/toggle/chip-group.jsx.map +0 -1
  553. package/dist/toggle/switch.jsx.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"guide/service.jsx","sources":["../../src/guide/service.tsx"],"sourcesContent":["import {\n type G9ChangeLine,\n type G9GuideEffectSpec,\n type G9JourneySource,\n g9RuntimeTimers,\n textIn,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { anchorRect, measureNode } from '../anchor/measure';\nimport type { G9AnchorRect, G9AnchorRegistry } from '../anchor/registry';\nimport { revealAnchor } from '../anchor/scroll';\nimport { useG9Host } from '../host/hooks';\nimport type { G9HostHandle } from '../host/registry';\nimport { g9Hosts } from '../host/registry';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport type { G9WalkPresenter } from '../route/router';\nimport { type G9ConfirmSheetPresentation, presentConfirmSheet } from './confirm-sheet';\nimport { inflate, placeBubble, placePointer, scrimBands } from './placement';\nimport { type G9ResolvedGuideSettings, resolveGuideSettings } from './settings';\nimport './guide.css';\n\n// The guide: effects drawn over everything (its own host layer, above popups, toasts and the floating items) on any\n// anchor — a highlight in a colour with an opacity, a spotlight that dims all but the control, a finger that shows the\n// gesture, a bubble with text and buttons, a pulsing beacon, a step badge, a ripple where the guide taps — plus the\n// countdown confirmation a guided save waits behind (a G9 sheet of the host, ./confirm-sheet.tsx). A mark follows its target (scrolls, sheets, the keyboard) only\n// while it is shown; nothing animates or measures once the last mark is gone (an idle app does no frame work).\n\n/** What a mark points at: an anchor id (followed as it moves), a fixed rect, or a point. */\nexport type G9GuideTarget = string | G9AnchorRect | { readonly x: number; readonly y: number };\n\n/** One mark: its target, its effects and how it ends. */\nexport interface G9GuideSpec {\n readonly key?: string;\n readonly target: G9GuideTarget;\n readonly effects: readonly G9GuideEffectSpec[];\n /** Bring an anchor into view first (scrolling, mounting a list row). Default true. */\n readonly reveal?: boolean;\n /** Ends by itself after this long. */\n readonly timeoutMs?: number;\n /** What a touch on the guide's own surfaces does. Default `never` (only buttons end it). */\n readonly dismissOn?: 'tap-anywhere' | 'never';\n /** Buttons of the bubble. */\n readonly buttons?: ReadonlyArray<'next' | 'skip' | 'done'>;\n readonly language?: 'fa' | 'en';\n}\n\n/** How a mark ended (exactly once). */\nexport type G9GuideOutcome =\n | 'hidden'\n | 'tapped'\n | 'next'\n | 'skip'\n | 'done'\n | 'timeout'\n | 'target-lost'\n | 'replaced'\n | 'unmount';\n\n/** One shown mark: hide it, or await how it ended. */\nexport interface G9GuideHandle {\n readonly key: string;\n hide(): void;\n readonly result: Promise<G9GuideOutcome>;\n}\n\n/** A shown mark, as the layer draws it. */\nexport interface G9GuideMarkState {\n readonly key: string;\n readonly spec: G9GuideSpec;\n /** The target in LynxView coordinates, null while measuring. */\n readonly rect: G9AnchorRect | null;\n}\n\n/** A guided-save confirmation. */\nexport interface G9ConfirmRequest {\n readonly title: string;\n readonly source: G9JourneySource;\n readonly changes: readonly G9ChangeLine[];\n readonly seconds: number;\n readonly destructive: boolean;\n /** Where this press stands in a journey that presses more than one control (shown when `total` > 1). */\n readonly progress?: { readonly index: number; readonly total: number };\n}\n\ninterface ConfirmState extends G9ConfirmRequest {\n readonly resolve: (ok: boolean) => void;\n sheet: G9ConfirmSheetPresentation | null;\n}\n\n/** The guide of one host: marks, ready-made combinations, the walk presenter and the countdown confirmation. */\nexport interface G9GuideService {\n show(spec: G9GuideSpec): G9GuideHandle;\n hideAll(): void;\n readonly marks: { get(): readonly G9GuideMarkState[]; subscribe(l: () => void): () => void };\n /** A finger and a bubble on a control (the default step of a walk). */\n pointAt(\n target: G9GuideTarget,\n text: string,\n options?: {\n readonly modal?: boolean;\n readonly gesture?: 'tap' | 'longPress';\n readonly buttons?: G9GuideSpec['buttons'];\n },\n ): G9GuideHandle;\n /** A modal spotlight with a bubble and «done». */\n coach(target: G9GuideTarget, text: string): G9GuideHandle;\n /** A small pulsing dot on the control's corner. */\n hint(target: G9GuideTarget): G9GuideHandle;\n /** The presenter a router walk draws its steps with. */\n presenter(): G9WalkPresenter;\n /**\n * Asks the person to confirm a write in a sheet: the changes, the source, a countdown on the confirm button. Resolves\n * once the sheet has gone: true only for the unlocked confirm. A newer request declines the open one.\n */\n confirm(request: G9ConfirmRequest): Promise<boolean>;\n /** Declines the open confirmation, if any (a journey that is cancelled). */\n dismissConfirmation(): void;\n readonly confirmation: { get(): G9ConfirmRequest | null; subscribe(l: () => void): () => void };\n readonly settings: G9ResolvedGuideSettings;\n readonly anchors: G9AnchorRegistry;\n}\n\ninterface Mark {\n state: G9GuideMarkState;\n settle: (o: G9GuideOutcome) => void;\n misses: number;\n timer: unknown;\n}\n\nconst FEATURE = 'g9-guide';\n/** How long a confirmation waits for the provider's settings on a guide first reached outside the tree (ms). */\nconst SETTINGS_WAIT_MS = 500;\n\nfunction store<T>(initial: T) {\n let value = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => value,\n set(v: T) {\n value = v;\n for (const l of Array.from(listeners)) l();\n },\n subscribe(l: () => void) {\n listeners.add(l);\n return () => {\n listeners.delete(l);\n };\n },\n };\n}\n\nconst isRect = (t: G9GuideTarget): t is G9AnchorRect => typeof t === 'object' && 'width' in t;\nconst sameRect = (a: G9AnchorRect | null, b: G9AnchorRect | null) =>\n a === b ||\n (!!a &&\n !!b &&\n Math.abs(a.x - b.x) < 0.5 &&\n Math.abs(a.y - b.y) < 0.5 &&\n Math.abs(a.width - b.width) < 0.5 &&\n Math.abs(a.height - b.height) < 0.5);\n\nfunction createGuideService(host: G9HostHandle, initial: G9ResolvedGuideSettings, provided: boolean): G9GuideService {\n const anchors = host.anchors;\n // The provider's settings win whoever created the service first (`g9Guide()` outside components has none): the\n // layer and the hook hand them in (`useProvidedSettings`).\n let settings = initial;\n // A guide first reached outside the tree (`g9Guide()`: QA, a link) has only the defaults until its layer renders and\n // hands in the provider's settings — a confirmation opened in that gap spoke English with the library's own look (seen\n // on a device, 2026-11-12). It waits for them (one render; at most `SETTINGS_WAIT_MS`).\n let settingsProvided = provided;\n const settingsWaiters = new Set<() => void>();\n const whenSettings = (): Promise<void> =>\n new Promise<void>((resolve) => {\n const done = () => {\n settingsWaiters.delete(done);\n g9RuntimeTimers.clearTimeout(timer);\n resolve();\n };\n const timer = g9RuntimeTimers.setTimeout(done, SETTINGS_WAIT_MS);\n settingsWaiters.add(done);\n });\n const marks = new Map<string, Mark>();\n const view = store<readonly G9GuideMarkState[]>([]);\n const confirmation = store<ConfirmState | null>(null);\n let seq = 0;\n let tracking: unknown = null;\n\n const publish = () => view.set(Array.from(marks.values()).map((m) => m.state));\n\n const measure = async (target: G9GuideTarget): Promise<G9AnchorRect | null> => {\n if (typeof target === 'string') {\n const a = anchors.find(target);\n return a ? anchorRect(a) : null;\n }\n return isRect(target) ? target : { x: target.x - 1, y: target.y - 1, width: 2, height: 2 };\n };\n\n const end = (key: string, outcome: G9GuideOutcome) => {\n const m = marks.get(key);\n if (!m) return;\n marks.delete(key);\n if (m.timer !== null) g9RuntimeTimers.clearTimeout(m.timer);\n publish();\n m.settle(outcome);\n if (marks.size === 0 && tracking !== null) {\n g9RuntimeTimers.clearTimeout(tracking);\n tracking = null;\n }\n };\n\n const track = async () => {\n tracking = null;\n for (const m of Array.from(marks.values())) {\n const rect = await measure(m.state.spec.target);\n if (!marks.has(m.state.key)) continue;\n if (!rect || rect.width <= 0 || rect.height <= 0) {\n m.misses += 1;\n if (m.misses >= 2) end(m.state.key, 'target-lost');\n continue;\n }\n m.misses = 0;\n if (!sameRect(rect, m.state.rect)) {\n m.state = { ...m.state, rect };\n publish();\n }\n }\n if (marks.size > 0 && tracking === null)\n tracking = g9RuntimeTimers.setTimeout(() => void track(), settings.trackMs);\n };\n\n const offRegistry = anchors.subscribe(() => {\n if (marks.size > 0 && tracking === null) tracking = g9RuntimeTimers.setTimeout(() => void track(), 0);\n });\n\n const service: G9GuideService = {\n get settings() {\n return settings;\n },\n anchors,\n marks: view,\n confirmation,\n show(spec) {\n const key = spec.key ?? `g9-guide-${++seq}`;\n if (marks.has(key)) end(key, 'replaced');\n let settle!: (o: G9GuideOutcome) => void;\n const result = new Promise<G9GuideOutcome>((r) => {\n settle = r;\n });\n const mark: Mark = { state: { key, spec, rect: null }, settle, misses: 0, timer: null };\n marks.set(key, mark);\n if (spec.timeoutMs !== undefined)\n mark.timer = g9RuntimeTimers.setTimeout(() => end(key, 'timeout'), spec.timeoutMs);\n publish();\n void (async () => {\n if (typeof spec.target === 'string' && spec.reveal !== false)\n await revealAnchor(anchors, spec.target, { smooth: true });\n if (!marks.has(key)) return;\n const rect = await measure(spec.target);\n if (!marks.has(key)) return;\n if (!rect) {\n end(key, 'target-lost');\n return;\n }\n mark.state = { ...mark.state, rect };\n publish();\n if (tracking === null) tracking = g9RuntimeTimers.setTimeout(() => void track(), settings.trackMs);\n })();\n return { key, hide: () => end(key, 'hidden'), result };\n },\n hideAll() {\n for (const key of Array.from(marks.keys())) end(key, 'hidden');\n },\n pointAt(target, text, options = {}) {\n return service.show({\n target,\n effects: [\n { type: 'spotlight', modal: options.modal === true },\n { type: 'highlight', ring: 2, opacity: 0.08, pulse: true },\n { type: 'pointer', gesture: options.gesture ?? 'tap' },\n { type: 'caption', text },\n ],\n ...(options.buttons ? { buttons: options.buttons } : {}),\n });\n },\n coach(target, text) {\n return service.show({\n target,\n effects: [\n { type: 'spotlight', modal: true },\n { type: 'caption', text },\n ],\n buttons: ['done'],\n });\n },\n hint(target) {\n return service.show({ target, effects: [{ type: 'beacon' }], reveal: false });\n },\n presenter() {\n return {\n show: (step) => {\n const h = service.pointAt(step.anchor, step.text, { gesture: step.gesture });\n return { hide: () => h.hide() };\n },\n note: (text) => {\n service.show({\n target: { x: 0, y: 0, width: 0.01, height: 0.01 },\n effects: [{ type: 'caption', text }],\n timeoutMs: 1600,\n reveal: false,\n });\n },\n };\n },\n confirm(request) {\n service.dismissConfirmation();\n return new Promise<boolean>((resolve) => {\n let done = false;\n const state: ConfirmState = {\n ...request,\n sheet: null,\n resolve: (ok) => {\n if (done) return;\n done = true;\n if (confirmation.get() === state) confirmation.set(null);\n resolve(ok);\n },\n };\n confirmation.set(state);\n const present = () => {\n // Declined (a newer request, back, a cancelled journey) while waiting: nothing to show.\n if (confirmation.get() !== state) {\n state.resolve(false);\n return;\n }\n state.sheet = presentConfirmSheet(host, settings, request, state.resolve);\n };\n if (settingsProvided) present();\n else void whenSettings().then(present);\n });\n },\n dismissConfirmation() {\n const open = confirmation.get();\n if (!open) return;\n // The sheet answers after it has left the screen; the request is over now (a newer one may follow at once). One\n // still waiting for the settings is answered when it would have opened.\n confirmation.set(null);\n open.sheet?.dismiss();\n },\n };\n (service as unknown as { __end: typeof end }).__end = end;\n (service as unknown as Settable).__settings = (next) => {\n settings = next;\n settingsProvided = true;\n for (const w of Array.from(settingsWaiters)) w();\n };\n (service as { dispose?: () => void }).dispose = () => {\n offRegistry();\n for (const key of Array.from(marks.keys())) end(key, 'unmount');\n const open = confirmation.get();\n open?.sheet?.dismiss();\n open?.resolve(false);\n };\n host.attachFeature(FEATURE, service);\n host.registerLayerItem('guide', { key: FEATURE, element: <GuideLayer service={service} /> });\n // Back declines the guide's confirmation first (its sheet closes), then ends any mark (never a journey's place behind it).\n host.back.push(\n () => {\n if (confirmation.get()) {\n service.dismissConfirmation();\n return 'handled';\n }\n if (marks.size > 0) {\n service.hideAll();\n return 'handled';\n }\n return 'pass';\n },\n { layer: 'guide' },\n );\n return service;\n}\n\ninterface Settable {\n __settings?: (settings: G9ResolvedGuideSettings) => void;\n}\n\n/** The guide of a host, created on first use. */\nexport function guideServiceOf(host: G9HostHandle, settings?: G9ResolvedGuideSettings): G9GuideService {\n const existing = host.getFeature(FEATURE) as G9GuideService | undefined;\n if (existing && settings) (existing as unknown as Settable).__settings?.(settings);\n return existing ?? createGuideService(host, settings ?? resolveGuideSettings(undefined), settings !== undefined);\n}\n\n/** The guide of the nearest host. */\nexport function useG9Guide(): G9GuideService {\n const settings = useG9Settings();\n return guideServiceOf(useG9Host(), resolveGuideSettings(settings.guide));\n}\n\n/** The guide of the active host, for code outside components. Throws without a host. */\nexport function g9Guide(): G9GuideService {\n return guideServiceOf(g9Hosts.require());\n}\n\n// ── drawing ─────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst POINTER_SVG = (fill: string, stroke: string) =>\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"${fill}\" stroke=\"${stroke}\" stroke-width=\"0.9\" stroke-linejoin=\"round\" d=\"M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74zm9.84 4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z\"/></svg>`;\n\nfunction rgba(hex: string | undefined, opacity: number, fallback: string): string {\n if (!hex) return fallback;\n const h = hex.replace('#', '');\n const n = Number.parseInt(h.slice(0, 6), 16);\n if (!Number.isFinite(n)) return fallback;\n const a = h.length === 8 ? Number.parseInt(h.slice(6, 8), 16) / 255 : opacity;\n return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${Math.round(a * 1000) / 1000})`;\n}\n\nconst px = (n: number) => `${Math.round(n * 10) / 10}px`;\nconst box = (r: G9AnchorRect) => ({ left: px(r.x), top: px(r.y), width: px(r.width), height: px(r.height) });\n\nfunction GuideLayer(props: { readonly service: G9GuideService }): ReactNode {\n const { service } = props;\n const provided = useG9Settings().guide;\n const resolved = useMemo(() => resolveGuideSettings(provided), [provided]);\n (service as unknown as Settable).__settings?.(resolved);\n const marks = useSyncExternalStore(\n (l) => service.marks.subscribe(l),\n () => service.marks.get(),\n );\n const node = useRef<NodesRef | null>(null);\n const [frame, setFrame] = useState<G9AnchorRect>({ x: 0, y: 0, width: 0, height: 0 });\n const visible = marks.length > 0;\n useEffect(() => {\n if (!visible) return;\n void measureNode(node.current).then((r) => {\n // A root measured before its first layout answers 0×0: the frame it replaces is still the right one.\n if (r && r.width > 0 && r.height > 0 && !sameRect(r, frame)) setFrame(r);\n });\n }, [visible, marks]);\n // The host clears its layers when it unmounts: the guide lets go of the anchors and settles every mark then.\n useEffect(() => () => (service as { dispose?: () => void }).dispose?.(), [service]);\n if (!visible) return null;\n const local = (r: G9AnchorRect): G9AnchorRect => ({\n x: r.x - frame.x,\n y: r.y - frame.y,\n width: r.width,\n height: r.height,\n });\n const viewRect: G9AnchorRect = { x: 0, y: 0, width: frame.width, height: frame.height };\n // Fixed, like a popup: a G9 sheet is lynx-ui's `position: fixed` SheetView, which Lynx paints above every in-flow\n // node — an absolute guide layer drew UNDER an open sheet (measured 2026-11-12 on a device). Fixed elements paint in\n // creation order, so the root is re-created for each new mark: it is always newer than the sheet — the confirmation\n // sheet too, so no mark is drawn while one is open (journey.ts, `press`).\n const generation = marks.map((m) => m.key).join('|');\n return (\n <view\n key={generation}\n className=\"g9-guide\"\n flatten={false}\n ref={(n: NodesRef | null) => {\n node.current = n;\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (Math.abs(w - frame.width) > 0.5 || Math.abs(h - frame.height) > 0.5))\n setFrame((f) => ({ ...f, width: w, height: h }));\n }}\n >\n {marks.map((m) =>\n m.rect ? <MarkView key={m.key} mark={m} rect={local(m.rect)} view={viewRect} service={service} /> : null,\n )}\n </view>\n );\n}\n\nfunction MarkView(props: {\n readonly mark: G9GuideMarkState;\n readonly rect: G9AnchorRect;\n readonly view: G9AnchorRect;\n readonly service: G9GuideService;\n}): ReactNode {\n const { mark, rect, view, service } = props;\n const rtl = useG9Direction() === 'rtl';\n const texts = service.settings.texts;\n const [bubble, setBubble] = useState<{ width: number; height: number } | null>(null);\n const finish = (outcome: G9GuideOutcome) => endMark(service, mark.key, outcome);\n const out: ReactNode[] = [];\n for (const [i, effect] of mark.spec.effects.entries()) {\n const k = `${effect.type}-${i}`;\n switch (effect.type) {\n case 'spotlight': {\n const pad = effect.padding ?? 6;\n const hole = inflate(rect, pad);\n const scrim = rgba(effect.scrim, 0.55, 'rgba(0, 0, 0, 0.55)');\n const modal = effect.modal === true;\n scrimBands(hole, view).forEach((band, b) => {\n if (band.width <= 0 || band.height <= 0) return;\n out.push(\n <view\n key={`${k}-band-${b}`}\n className={`g9-guide__scrim${modal ? ' g9-guide__scrim--modal' : ''}`}\n style={{ ...box(band), backgroundColor: scrim }}\n {...(modal\n ? { bindtap: () => (mark.spec.dismissOn === 'tap-anywhere' ? finish('tapped') : undefined) }\n : {})}\n />,\n );\n });\n // The bands leave a RECTANGULAR hole (no even-odd fill in Lynx): a ring rounder than that shows bright corners\n // outside it (seen on a device, 2026-11-12) — `auto` stays nearly square.\n const radius =\n effect.radius === undefined || effect.radius === 'auto' ? Math.min(4, hole.height / 2) : effect.radius;\n out.push(\n <view key={`${k}-ring`} className=\"g9-guide__hole\" style={{ ...box(hole), borderRadius: px(radius) }} />,\n );\n break;\n }\n case 'highlight': {\n const pad = effect.padding ?? 4;\n const r = inflate(rect, pad);\n const radius =\n effect.radius === undefined || effect.radius === 'auto' ? Math.min(14, r.height / 2) : effect.radius;\n out.push(\n <view\n key={k}\n className={`g9-guide__highlight${effect.pulse ? ' g9-guide__highlight--pulse' : ''}`}\n style={{\n ...box(r),\n borderRadius: px(radius),\n borderWidth: px(effect.ring ?? 2),\n borderColor: effect.color ?? 'var(--g9-primary)',\n backgroundColor: rgba(\n effect.color,\n effect.opacity ?? 0.18,\n effect.opacity === undefined ? 'rgba(46, 125, 50, 0.18)' : `rgba(46, 125, 50, ${effect.opacity})`,\n ),\n }}\n />,\n );\n break;\n }\n case 'pointer': {\n const size = 48;\n const p = placePointer(rect, size);\n const gesture = effect.gesture ?? 'tap';\n out.push(\n <view\n key={k}\n className={`g9-guide__pointer g9-guide__pointer--${gesture}`}\n style={{ left: px(p.x), top: px(p.y), width: px(size), height: px(size) }}\n >\n <svg content={POINTER_SVG('#FFFFFF', '#1B1B1B')} style={{ width: px(size), height: px(size) }} />\n </view>,\n );\n break;\n }\n case 'beacon': {\n const corner = effect.corner ?? 'top-end';\n const atEnd = corner.endsWith('end') !== rtl;\n const x = atEnd ? rect.x + rect.width - 6 : rect.x - 6;\n const y = corner.startsWith('top') ? rect.y - 6 : rect.y + rect.height - 6;\n out.push(\n <view\n key={k}\n className=\"g9-guide__beacon\"\n style={{ left: px(x), top: px(y), backgroundColor: effect.color ?? 'var(--g9-error)' }}\n />,\n );\n break;\n }\n case 'badge':\n out.push(\n <view\n key={k}\n className=\"g9-guide__badge\"\n style={{ left: px(rtl ? rect.x + rect.width - 11 : rect.x - 11), top: px(rect.y - 11) }}\n >\n <text className=\"g9-guide__badge-text\">{effect.text}</text>\n </view>,\n );\n break;\n case 'ripple':\n out.push(\n <view\n key={k}\n className=\"g9-guide__ripple\"\n style={{ left: px(rect.x + rect.width / 2 - 24), top: px(rect.y + rect.height / 2 - 24) }}\n />,\n );\n break;\n case 'caption': {\n const language = mark.spec.language ?? (rtl ? 'fa' : 'en');\n const text = textIn(effect.text, language);\n const title = effect.title ? textIn(effect.title, language) : null;\n const width = Math.min(300, Math.max(120, view.width - 48));\n const size = bubble ?? { width, height: 64 };\n const place = placeBubble({ target: rect, bubble: size, view, prefer: effect.placement ?? 'auto', rtl });\n const buttons = mark.spec.buttons ?? [];\n out.push(\n <view\n key={k}\n className=\"g9-guide__bubble\"\n accessibility-element\n accessibility-label={title ? `${title}. ${text}` : text}\n style={{\n left: px(place.x),\n top: px(place.y),\n width: px(width),\n opacity: bubble ? 1 : 0,\n direction: rtl ? 'rtl' : 'ltr',\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (h > 0 && (!bubble || Math.abs(bubble.height - h) > 0.5)) setBubble({ width: w || width, height: h });\n }}\n >\n {title ? (\n <text className=\"g9-guide__bubble-title\" style={{ textAlign: rtl ? 'right' : 'left' }}>\n {title}\n </text>\n ) : null}\n <text className=\"g9-guide__bubble-text\" style={{ textAlign: rtl ? 'right' : 'left' }}>\n {text}\n </text>\n {buttons.length > 0 ? (\n <view\n className=\"g9-guide__bubble-actions\"\n style={{ flexDirection: rtl ? 'row-reverse' : 'row', direction: 'ltr' }}\n >\n {buttons.map((b) => (\n <view\n key={b}\n className={`g9-guide__bubble-button${b === 'skip' ? ' g9-guide__bubble-button--quiet' : ''}`}\n bindtap={() => finish(b)}\n >\n <text\n className={`g9-guide__bubble-button-text${b === 'skip' ? ' g9-guide__bubble-button-text--quiet' : ''}`}\n >\n {b === 'next' ? texts.next : b === 'skip' ? texts.skip : texts.done}\n </text>\n </view>\n ))}\n </view>\n ) : null}\n <view\n className={`g9-guide__arrow g9-guide__arrow--${place.side}`}\n style={\n place.side === 'below' || place.side === 'above' || place.side === 'over'\n ? { left: px(place.arrow - 7) }\n : { top: px(place.arrow - 7) }\n }\n />\n </view>,\n );\n break;\n }\n }\n }\n return <>{out}</>;\n}\n\n/** Ends a mark with an outcome (the bubble's buttons, a tap on a modal scrim). */\nfunction endMark(service: G9GuideService, key: string, outcome: G9GuideOutcome): void {\n (service as unknown as { __end?: (k: string, o: G9GuideOutcome) => void }).__end?.(key, outcome);\n}\n"],"names":["FEATURE","SETTINGS_WAIT_MS","store","initial","value","listeners","Set","v","l","Array","isRect","t","sameRect","a","b","Math","createGuideService","host","provided","anchors","settings","settingsProvided","settingsWaiters","whenSettings","Promise","resolve","done","g9RuntimeTimers","timer","marks","Map","view1","confirmation","seq","tracking","publish","m","measure","target","anchorRect","end","key","outcome","track","rect","offRegistry","service","spec","_spec_key","settle","result","r","mark","undefined","revealAnchor","text1","options","_options_gesture","step","h","request","state","ok","present","presentConfirmSheet","_open_sheet","open","next","w","GuideLayer","guideServiceOf","_existing___settings","existing","resolveGuideSettings","useG9Guide","useG9Settings","useG9Host","g9Guide","g9Hosts","POINTER_SVG","fill","stroke","rgba","hex","opacity","fallback","n","Number","px","box","props","_service___settings","resolved","useMemo","useSyncExternalStore","node","useRef","frame","setFrame","useState","visible","useEffect","measureNode","_service_dispose","local","viewRect","generation","view","e","_e_detail","_e_detail1","f","MarkView","rtl","useG9Direction","texts","bubble","setBubble","finish","endMark","out","i","effect","k","_effect_padding","pad","hole","inflate","scrim","modal","scrimBands","band","radius","_effect_padding1","_effect_ring","_effect_color","_effect_opacity","_effect_gesture","size","p","placePointer","gesture","svg","_effect_corner","_effect_color1","corner","atEnd","x","y","text","_mark_spec_language","_effect_placement","_mark_spec_buttons","language","textIn","title","width","place","placeBub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AG;oBAAG,IAEjC;UACJ,EAAElD;oBAEJ;gBACF;QACF;IACF;IACA,UAAUa;AACZ;AAGA,SAASD,QAAQzE,OAAuB,EAAEL,GAAW,EAAEC,OAAuB;QAC5EsH;YAAAA,CAAAA,iBAAClH,QAA0E,KAAK,AAAD,KAA/EkH,eAAAA,IAAAA,CAAClH,SAAkFL,KAAKC;AAC1F"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"guide/settings.jsx","sources":["../../src/guide/settings.ts"],"sourcesContent":["import { type G9ConfirmTiming, type G9JourneySource, g9ConfirmTimingDefaults } from '@g9tm/lynxcontrols-foundation';\nimport type { G9SheetOptions } from '../sheet/options';\n\n/** The guide's words (the app gives them in the person's language; defaults are English). */\nexport interface G9GuideTexts {\n readonly next: string;\n readonly done: string;\n readonly skip: string;\n readonly endGuide: string;\n readonly cancel: string;\n /** The confirm button while counting down: `{0}` = seconds left. */\n readonly confirmIn: string;\n readonly confirm: string;\n readonly changesTitle: string;\n /** Who asked for the change, by journey source. */\n readonly sources: Readonly<Record<G9JourneySource, string>>;\n /** A change line's verb, by action. */\n readonly actions: Readonly<Record<'create' | 'update' | 'delete' | 'send' | 'other', string>>;\n /** Shown when a place could not say what will change. */\n readonly undescribed: string;\n /** Added to a link's confirmation. */\n readonly linkWarning: string;\n /**\n * Where a press stands in a journey that presses more than one control: `{0}` = this press, `{1}` = how many the\n * journey presses.\n */\n readonly confirmProgress: string;\n}\n\n/** App-wide guide settings (`G9Settings.guide`). */\n/** The guide's words an app supplies (any subset). */\nexport type G9GuideTextOverrides = Partial<Omit<G9GuideTexts, 'sources' | 'actions'>> & {\n readonly sources?: Partial<G9GuideTexts['sources']>;\n readonly actions?: Partial<G9GuideTexts['actions']>;\n};\n\n/** App-wide guide settings (`G9Settings.guide`): words, countdowns, tracking and typing speed. */\nexport interface G9GuideSettings {\n /** The words, or a function read at every render (so a language switch shows at once). */\n readonly texts?: G9GuideTextOverrides | (() => G9GuideTextOverrides);\n /** Countdown lengths of the guided-save confirmation. */\n readonly confirm?: Partial<G9ConfirmTiming>;\n /** How often a shown mark re-measures its target while nothing else told it to (ms). Default 250. */\n readonly trackMs?: number;\n /** Per character of a value the guide types in front of the person (ms). Default 30, capped at 1200 per field. */\n readonly typeMsPerChar?: number;\n /**\n * The confirmation sheet's options over the guide's own (a fit-to-content sheet up to 75 % of the screen, the title in\n * the header, the close button): an app gives its own sheet look here — a background, the close icon. The title, the\n * footer buttons and the body are the guide's. A function is read at every confirmation (a colour that follows the\n * theme).\n */\n readonly confirmSheet?: G9SheetOptions | (() => G9SheetOptions);\n /** The text size of the confirmation's two footer buttons (the app's footer buttons). Default the hero button's. */\n readonly confirmButtonFontSize?: number;\n}\n\n/** The guide settings with every default filled in. */\nexport interface G9ResolvedGuideSettings {\n readonly texts: G9GuideTexts;\n readonly confirm: G9ConfirmTiming;\n readonly trackMs: number;\n readonly typeMsPerChar: number;\n /** The app's sheet options for the confirmation, read when one opens. */\n readonly confirmSheet: () => G9SheetOptions;\n readonly confirmButtonFontSize: number | null;\n}\n\nconst ENGLISH: G9GuideTexts = {\n next: 'Next',\n done: 'Done',\n skip: 'Skip',\n endGuide: 'End guide',\n cancel: 'Cancel',\n confirmIn: 'Confirm ({0})',\n confirm: 'Confirm',\n changesTitle: 'What will change',\n sources: {\n bundled: 'The app’s guide',\n assistant: 'The assistant',\n link: 'A link from outside the app',\n tester: 'A test',\n qa: 'Automation',\n },\n actions: { create: 'New', update: 'Change', delete: 'Delete', send: 'Send', other: 'Other' },\n undescribed: 'The changes of this form will be saved.',\n linkWarning: 'This request came from outside the app. Confirm only if you expected it.',\n confirmProgress: 'Press {0} of {1} in this journey',\n};\n\n/** The guide settings with their defaults. */\nexport function resolveGuideSettings(s: G9GuideSettings | undefined): G9ResolvedGuideSettings {\n const source = s?.texts;\n const merge = (t: G9GuideTextOverrides): G9GuideTexts => ({\n ...ENGLISH,\n ...t,\n sources: { ...ENGLISH.sources, ...t.sources },\n actions: { ...ENGLISH.actions, ...t.actions },\n });\n const fixed = typeof source === 'function' ? null : merge(source ?? {});\n return {\n get texts() {\n return fixed ?? merge((source as () => G9GuideTextOverrides)());\n },\n confirm: { ...g9ConfirmTimingDefaults, ...s?.confirm },\n trackMs: s?.trackMs && s.trackMs > 0 ? s.trackMs : 250,\n typeMsPerChar: s?.typeMsPerChar !== undefined && s.typeMsPerChar >= 0 ? s.typeMsPerChar : 30,\n confirmSheet: (() => {\n const own = s?.confirmSheet;\n return typeof own === 'function' ? own : () => own ?? {};\n })(),\n confirmButtonFontSize:\n s?.confirmButtonFontSize !== undefined && s.confirmButtonFontSize > 0 ? s.confirmButtonFontSize : null,\n };\n}\n\n/** `{0}`, `{1}`… replaced by the values in order. */\nexport function formatGuideText(template: string, ...values: ReadonlyArray<string | number>): string {\n return values.reduce<string>((t, v, i) => t.split(`{${i}}`).join(String(v)), template);\n}\n"],"names":["ENGLISH","resolveGuideSettings","s","source","merge","t","fixed","g9ConfirmTimingDefaults","undefined","own","formatGuideText","template","values","v","i","String"],"mappings":";AAoEA,MAAMA,UAAwB;IAC5B,MAAM;IACN,MAAM;IACN,MAAM;IACN,UAAU;IACV,QAAQ;IACR,WAAW;IACX,SAAS;IACT,cAAc;IACd,SAAS;QACP,SAAS;QACT,WAAW;QACX,MAAM;QACN,QAAQ;QACR,IAAI;IACN;IACA,SAAS;QAAE,QAAQ;QAAO,QAAQ;QAAU,QAAQ;QAAU,MAAM;QAAQ,OAAO;IAAQ;IAC3F,aAAa;IACb,aAAa;IACb,iBAAiB;AACnB;AAGO,SAASC,qBAAqBC,CAA8B;IACjE,MAAMC,SAASD,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,KAAK;IACvB,MAAME,QAAQ,CAACC,IAA2C;YACxD,GAAGL,OAAO;YACV,GAAGK,CAAC;YACJ,SAAS;gBAAE,GAAGL,QAAQ,OAAO;gBAAE,GAAGK,EAAE,OAAO;YAAC;YAC5C,SAAS;gBAAE,GAAGL,QAAQ,OAAO;gBAAE,GAAGK,EAAE,OAAO;YAAC;QAC9C;IACA,MAAMC,QAAQ,AAAkB,cAAlB,OAAOH,SAAwB,OAAOC,MAAMD,QAAAA,SAAAA,SAAU,CAAC;IACrE,OAAO;QACL,IAAI;YACF,OAAOG,QAAAA,QAAAA,QAASF,MAAOD;QACzB;QACA,SAAS;YAAE,GAAGI,uBAAuB;eAAKL,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,OAAN;QAAc;QACrD,SAASA,AAAAA,CAAAA,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,OAAO,AAAD,KAAKA,EAAE,OAAO,GAAG,IAAIA,EAAE,OAAO,GAAG;QACnD,eAAeA,AAAAA,CAAAA,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,aAAa,AAAD,MAAMM,UAAaN,EAAE,aAAa,IAAI,IAAIA,EAAE,aAAa,GAAG;QAC1F,cAAe,AAAC;YACd,MAAMO,MAAMP,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,YAAY;YAC3B,OAAO,AAAe,cAAf,OAAOO,MAAqBA,MAAM,IAAMA,QAAAA,MAAAA,MAAO,CAAC;QACzD;QACA,uBACEP,AAAAA,CAAAA,QAAAA,IAAAA,KAAAA,IAAAA,EAAG,qBAAqB,AAAD,MAAMM,UAAaN,EAAE,qBAAqB,GAAG,IAAIA,EAAE,qBAAqB,GAAG;IACtG;AACF;AAGO,SAASQ,gBAAgBC,QAAgB,EAAE,GAAGC,MAAsC;IACzF,OAAOA,OAAO,MAAM,CAAS,CAACP,GAAGQ,GAAGC,IAAMT,EAAE,KAAK,CAAC,CAAC,CAAC,EAAES,EAAE,CAAC,CAAC,EAAE,IAAI,CAACC,OAAOF,KAAKF;AAC/E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/back.jsx","sources":["../../src/host/back.ts"],"sourcesContent":["import { type G9Layer, layerRank } from './layers';\n\n/** What a back handler did: consumed the press, or let the next handler (and finally the app exit) have it. */\nexport type G9BackResult = 'handled' | 'pass';\n\n/**\n * A back handler. `'handled'` (or `true`, MAUI `OnHardwareBackPressed` / `TryHandleInAppBack` returned `bool`)\n * consumes the press; `'pass'` (or `false`) lets it continue.\n */\nexport type G9BackHandler = () => G9BackResult | boolean;\n\n/** Where a handler sits in the back order. */\nexport interface G9BackOptions {\n /**\n * The layer the handler belongs to. Handlers of a higher layer run first (popups before sheets before the page,\n * MAUI's order), then newest first within a layer. Default `'content'` (the page's in-app back).\n */\n readonly layer?: G9Layer;\n}\n\n/** The back handlers of one host (plan/specs/01 §5): a LIFO per layer, top layer first. */\nexport interface G9BackStack {\n /** Number of registered handlers. */\n readonly size: number;\n /** Registers `handler`; returns its unregister function (idempotent). */\n push(handler: G9BackHandler, options?: G9BackOptions): () => void;\n /**\n * Offers one back press to the handlers in order until one handles it. While the host suppresses back (MAUI\n * `IsHardwareBackSuppressed`) the press is swallowed before any handler runs and reported `'handled'`.\n * A handler that throws is reported to `onHandlerError` and counts as `'handled'`: a broken handler must never turn\n * a back press into leaving the app.\n */\n dispatch(): G9BackResult;\n /** Drops every handler (host unmount). */\n clear(): void;\n}\n\n/** Options of {@link createBackStack}. */\nexport interface G9BackStackOptions {\n /** Read on every dispatch; `true` swallows the press. */\n readonly isSuppressed?: () => boolean;\n /** Receives an error thrown by a handler. */\n readonly onHandlerError?: (error: unknown) => void;\n}\n\ninterface Entry {\n readonly handler: G9BackHandler;\n readonly rank: number;\n readonly sequence: number;\n}\n\n/** Creates an empty {@link G9BackStack}. */\nexport function createBackStack(options: G9BackStackOptions = {}): G9BackStack {\n const entries = new Set<Entry>();\n let sequence = 0;\n return {\n get size() {\n return entries.size;\n },\n push(handler, pushOptions) {\n sequence += 1;\n const entry: Entry = { handler, rank: layerRank(pushOptions?.layer ?? 'content'), sequence };\n entries.add(entry);\n return () => {\n entries.delete(entry);\n };\n },\n dispatch() {\n if (options.isSuppressed?.()) return 'handled';\n const ordered = Array.from(entries).sort((a, b) => b.rank - a.rank || b.sequence - a.sequence);\n for (const entry of ordered) {\n if (!entries.has(entry)) continue;\n let result: G9BackResult | boolean;\n try {\n result = entry.handler();\n } catch (error) {\n options.onHandlerError?.(error);\n return 'handled';\n }\n if (result === 'handled' || result === true) return 'handled';\n }\n return 'pass';\n },\n clear() {\n entries.clear();\n },\n };\n}\n"],"names":["createBackStack","options","entries","Set","sequence","handler","pushOptions","entry","layerRank","ordered","Array","a","b","result","error"],"mappings":";AAoDO,SAASA,gBAAgBC,UAA8B,CAAC,CAAC;IAC9D,MAAMC,UAAU,IAAIC;IACpB,IAAIC,WAAW;IACf,OAAO;QACL,IAAI;YACF,OAAOF,QAAQ,IAAI;QACrB;QACA,MAAKG,OAAO,EAAEC,WAAW;;YACvBF,YAAY;YACZ,MAAMG,QAAe;gBAAEF;gBAAS,MAAMG,UAAU,QAADA,CAAAA,OAACF,QAAAA,cAAAA,KAAAA,IAAAA,YAAa,KAAK,AAAD,IAAC,OAAI;gBAAYF;YAAS;YAC3FF,QAAQ,GAAG,CAACK;YACZ,OAAO;gBACLL,QAAQ,MAAM,CAACK;YACjB;QACF;QACA;gBACMN;YAAJ,IAAI,QAAAA,CAAAA,wBAAAA,QAAQ,YAAY,AAAD,IAAnBA,KAAAA,IAAAA,sBAAAA,IAAAA,CAAAA,UAA0B,OAAO;YACrC,MAAMQ,UAAUC,MAAM,IAAI,CAACR,SAAS,IAAI,CAAC,CAACS,GAAGC,IAAMA,EAAE,IAAI,GAAGD,EAAE,IAAI,IAAIC,EAAE,QAAQ,GAAGD,EAAE,QAAQ;YAC7F,KAAK,MAAMJ,SAASE,QAAS;gBAC3B,IAAI,CAACP,QAAQ,GAAG,CAACK,QAAQ;gBACzB,IAAIM;gBACJ,IAAI;oBACFA,SAASN,MAAM,OAAO;gBACxB,EAAE,OAAOO,OAAO;wBACdb;4BAAAA,CAAAA,0BAAAA,QAAQ,cAAc,AAAD,KAArBA,wBAAAA,IAAAA,CAAAA,SAAyBa;oBACzB,OAAO;gBACT;gBACA,IAAID,AAAW,cAAXA,UAAwBA,AAAW,SAAXA,QAAiB,OAAO;YACtD;YACA,OAAO;QACT;QACA;YACEX,QAAQ,KAAK;QACf;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/hooks.jsx","sources":["../../src/host/hooks.ts"],"sourcesContent":["import {\n createAbortController,\n type G9AbortController,\n type G9AbortSignal,\n G9Error,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useContext, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { useG9Core, useG9Settings } from '../provider/hooks';\nimport type { G9BackHandler, G9BackResult } from './back';\nimport { G9HostContext, G9HostInsetsContext, G9HostReadinessContext } from './host';\nimport { acquirePanSoftInputMode } from './keyboard';\nimport type { G9Layer, G9OverlayLayer } from './layers';\nimport type { G9HostReadinessSnapshot } from './readiness';\nimport type { G9HostHandle, G9HostInsets } from './registry';\n\nfunction hostMissing(hook: string): G9Error {\n return new G9Error('host-missing', `${hook} must be used inside <G9Host>.`);\n}\n\n/** The nearest `G9Host`. Throws `host-missing` outside one. */\nexport function useG9Host(): G9HostHandle {\n const host = useContext(G9HostContext);\n if (!host) throw hostMissing('useG9Host');\n return host;\n}\n\n/** Insets of the nearest host (MAUI `TopSafeAreaInset` … `BottomSafeAreaWithTabBar`). Re-renders when they change. */\nexport function useG9HostInsets(): G9HostInsets {\n const insets = useContext(G9HostInsetsContext);\n if (!insets) throw hostMissing('useG9HostInsets');\n return insets;\n}\n\n/**\n * Insets of the nearest host, or null outside one — for controls that may be shown both inside a host (edge-to-edge,\n * so they must clear the system bars) and without one (a gallery, a test): `G9IntroCarousel`'s chrome.\n */\nexport function useG9HostInsetsOrNull(): G9HostInsets | null {\n return useContext(G9HostInsetsContext);\n}\n\n/** Readiness of the nearest host, plus `release` (MAUI `ReleasePageLoadingOverlay`) and `whenDismissed`. */\nexport interface G9HostReadyState extends G9HostReadinessSnapshot {\n release(): void;\n whenDismissed(): Promise<void>;\n}\n\n/**\n * The nearest host's ready state and loading cover (MAUI `ReleasePageLoadingOverlay`, `PageLoadingOverlayDismissed`,\n * `G9ContentViewBase.ReleaseHostPageLoadingOverlay`). A page with `manualRelease` calls `release()` when its first\n * meaningful frame is ready.\n */\nexport function useG9HostReady(): G9HostReadyState {\n const readiness = useContext(G9HostReadinessContext);\n if (!readiness) throw hostMissing('useG9HostReady');\n const snapshot = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot);\n return { ...snapshot, release: readiness.release, whenDismissed: readiness.whenDismissed };\n}\n\n/** Options of {@link useG9Back}. */\nexport interface G9UseBackOptions {\n /** The layer the handler belongs to (overlays pass theirs so they are asked first). Default `'content'`. */\n readonly layer?: G9Layer;\n /** Register only while `true`. Default `true`. */\n readonly enabled?: boolean;\n}\n\n/**\n * Registers a back handler on the nearest host while mounted (and enabled). Handlers of higher layers run first, then\n * newest first; returning `'handled'` (or `true`) consumes the press, `'pass'` lets it continue. When nothing handles\n * it, the provider calls `services.host.exit()`. The latest `handler` is always called.\n */\nexport function useG9Back(handler: G9BackHandler, options: G9UseBackOptions = {}): void {\n const host = useG9Host();\n const stable = useStableCallback(handler);\n const enabled = options.enabled ?? true;\n const layer = options.layer ?? 'content';\n useEffect(\n () => (enabled ? host.back.push(() => stable() as G9BackResult | boolean, { layer }) : undefined),\n [host, stable, enabled, layer],\n );\n}\n\n/** Options of {@link useG9LayerItem}. */\nexport interface G9UseLayerItemOptions {\n /** Ordering inside the layer (lower paints below). Default 0. */\n readonly order?: number;\n /** Mount only while `true`. Default `true`. */\n readonly enabled?: boolean;\n}\n\n/**\n * Mounts `element` into an overlay layer of the nearest host while the calling component is mounted (and enabled),\n * keeping it in step with `element`. The key must be unique within the layer.\n */\nexport function useG9LayerItem(\n layer: G9OverlayLayer,\n key: string,\n element: ReactNode,\n options: G9UseLayerItemOptions = {},\n): void {\n const host = useG9Host();\n const enabled = options.enabled ?? true;\n const order = options.order ?? 0;\n useEffect(\n () => (enabled ? host.registerLayerItem(layer, { key, element, order }) : undefined),\n [host, layer, key, element, order, enabled],\n );\n}\n\n/** Inputs of {@link useG9Activation} (MAUI `G9ContentViewBase`). */\nexport interface G9ActivationOptions {\n /** Whether this view is the active one (MAUI `Activate` / `Deactivate`, driven by the hosting page). */\n readonly active: boolean;\n /** First activation only (MAUI `OnFirstActivatedAsync`): heavy one-shot setup. */\n readonly onFirstActivated?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Every activation, after the first-activation work (MAUI `OnActivatedAsync`). */\n readonly onActivated?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Every deactivation, after the activation signal was aborted (MAUI `OnDeactivated`). */\n readonly onDeactivated?: () => void;\n /** Ask the app to pause background work while active (MAUI `SuppressesBackgroundWork`). Default `false`. */\n readonly suppressesBackgroundWork?: boolean;\n /** Back handling while active (MAUI `OnHardwareBackPressed`); asked after overlays. */\n readonly onBack?: G9BackHandler;\n /** Names the view in diagnostics. Default `'G9ActivatedView'`. */\n readonly name?: string;\n}\n\n/**\n * Activation lifecycle of a view kept alive across tab switches (MAUI `G9ContentViewBase`): a fresh abort signal per\n * activation (aborted on deactivation and unmount), first-activation and every-activation work run through the\n * provider's safe executor, the app's background-work pause held while active\n * (`settings.backgroundWorkSuppression`), and back handling while active. Unmounting while active deactivates too\n * (MAUI handler teardown: signal aborted, pause released, `onDeactivated` called). Returns whether the view is active.\n */\nexport function useG9Activation(options: G9ActivationOptions): { readonly active: boolean } {\n const core = useG9Core();\n const settings = useG9Settings();\n const latest = useRef(options);\n latest.current = options;\n const name = options.name ?? 'G9ActivatedView';\n const [session] = useState(() => ({\n firstDone: false,\n controller: null as G9AbortController | null,\n suppression: null as (() => void) | null,\n }));\n\n const deactivate = useStableCallback(() => {\n const controller = session.controller;\n if (!controller) return;\n session.controller = null;\n const suppression = session.suppression;\n session.suppression = null;\n suppression?.();\n controller.abort();\n const onDeactivated = latest.current.onDeactivated;\n if (onDeactivated) {\n void core.executor.run(() => onDeactivated(), {\n source: name,\n throttleKey: `${name}.deactivate`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n });\n\n useEffect(() => {\n if (!options.active) {\n deactivate();\n return;\n }\n if (session.controller) return;\n const controller = createAbortController();\n session.controller = controller;\n if (latest.current.suppressesBackgroundWork) session.suppression = settings.backgroundWorkSuppression?.() ?? null;\n core.executor.runSafe(\n async (context) => {\n const signal = controller.signal;\n if (!session.firstDone) {\n session.firstDone = true;\n await latest.current.onFirstActivated?.({ signal });\n if (signal.aborted || context.signal.aborted) return;\n }\n await latest.current.onActivated?.({ signal });\n },\n { source: name, throttleKey: `${name}.activate`, enableThrottle: false, preventConcurrentExecution: false },\n );\n }, [options.active, session, core, settings, name, deactivate]);\n\n // Unmount while active: MAUI's handler teardown ran the same deactivation (without hiding the view).\n useEffect(() => () => deactivate(), [deactivate]);\n\n const host = useContext(G9HostContext);\n const onBack = useStableCallback(() => latest.current.onBack?.() ?? 'pass');\n const hasBack = options.onBack !== undefined;\n useEffect(\n () => (host && options.active && hasBack ? host.back.push(() => onBack() ?? 'pass') : undefined),\n [host, options.active, hasBack, onBack],\n );\n return { active: options.active };\n}\n\n/**\n * Holds Android's pan soft-input mode while `enabled` (MAUI `G9KeyboardHelper.UseAndroidPanSoftInputMode` scoped to\n * a sheet or page); restores on disable and unmount.\n */\nexport function useG9PanSoftInputMode(enabled = true): void {\n const host = useG9Core().services.host;\n useEffect(() => (enabled ? acquirePanSoftInputMode(host) : undefined), [enabled, host]);\n}\n\n/** The keyboard dismiss path (MAUI `G9KeyboardHelper.HideKeyboardAndClearFocus`): `services.host.hideKeyboard`. */\nexport function useG9HideKeyboard(): () => void {\n const host = useG9Core().services.host;\n return useStableCallback(() => host.hideKeyboard()) as () => void;\n}\n"],"names":["hostMissing","hook","G9Error","useG9Host","host","useContext","G9HostContext","useG9HostInsets","insets","G9HostInsetsContext","useG9HostInsetsOrNull","useG9HostReady","readiness","G9HostReadinessContext","snapshot","useSyncExternalStore","useG9Back","handler","options","_options_enabled","_options_layer","stable","useStableCallback","enabled","layer","useEffect","undefined","useG9LayerItem","key","element","_options_order","order","useG9Activation","_options_name","core","useG9Core","settings","useG9Settings","latest","useRef","name","session","useState","deactivate","controller","suppression","onDeactivated","createAbortController","context","_latest_current","signal","_latest_current1","onBack","hasBack","_onBack","useG9PanSoftInputMode","acquirePanSoftInputMode","useG9HideKeyboard"],"mappings":";;;;;;AAgBA,SAASA,YAAYC,IAAY;IAC/B,OAAO,IAAIC,QAAQ,gBAAgB,GAAGD,KAAK,8BAA8B,CAAC;AAC5E;AAGO,SAASE;IACd,MAAMC,OAAOC,WAAWC;IACxB,IAAI,CAACF,MAAM,MAAMJ,YAAY;IAC7B,OAAOI;AACT;AAGO,SAASG;IACd,MAAMC,SAASH,WAAWI;IAC1B,IAAI,CAACD,QAAQ,MAAMR,YAAY;IAC/B,OAAOQ;AACT;AAMO,SAASE;IACd,OAAOL,WAAWI;AACpB;AAaO,SAASE;IACd,MAAMC,YAAYP,WAAWQ;IAC7B,IAAI,CAACD,WAAW,MAAMZ,YAAY;IAClC,MAAMc,WAAWC,qBAAqBH,UAAU,SAAS,EAAEA,UAAU,WAAW;IAChF,OAAO;QAAE,GAAGE,QAAQ;QAAE,SAASF,UAAU,OAAO;QAAE,eAAeA,UAAU,aAAa;IAAC;AAC3F;AAeO,SAASI,UAAUC,OAAsB,EAAEC,UAA4B,CAAC,CAAC;QAG9DC,kBACFC;IAHd,MAAMhB,OAAOD;IACb,MAAMkB,SAASC,kBAAkBL;IACjC,MAAMM,UAAU,QAAAJ,CAAAA,mBAAAA,QAAQ,OAAO,AAAD,IAAdA,mBAAmB;IACnC,MAAMK,QAAQ,QAAAJ,CAAAA,iBAAAA,QAAQ,KAAK,AAAD,IAAZA,iBAAiB;IAC/BK,UACE,IAAOF,UAAUnB,KAAK,IAAI,CAAC,IAAI,CAAC,IAAMiB,UAAoC;YAAEG;QAAM,KAAKE,QACvF;QAACtB;QAAMiB;QAAQE;QAASC;KAAM;AAElC;AAcO,SAASG,eACdH,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AAA,gBAAAA,IAAAA,OAA6B;;IACpE,MAAMI,UAAUnC,AAAmBQ,WAAnBR,QAAQ,MAAM;IAC9BO,UACE,IAAOrB,QAAQc,QAAQ,MAAM,IAAImC,UAAUjD,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAMkD;2BAAAA,CAAAA,UAAAA,QAAO,IAAPA,UAAY;aAAU5B,QACtF;QAACtB;QAAMc,QAAQ,MAAM;QAAEmC;QAASD;KAAO;IAEzC,OAAO;QAAE,QAAQlC,QAAQ,MAAM;IAAC;AAClC;AAMO,SAASqC,sBAAsBhC,UAAU,IAAI;IAClD,MAAMnB,OAAO+B,YAAY,QAAQ,CAAC,IAAI;IACtCV,UAAU,IAAOF,UAAUiC,wBAAwBpD,QAAQsB,QAAY;QAACH;QAASnB;KAAK;AACxF;AAGO,SAASqD;IACd,MAAMrD,OAAO+B,YAAY,QAAQ,CAAC,IAAI;IACtC,OAAOb,kBAAkB,IAAMlB,KAAK,YAAY;AAClD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/host.jsx","sources":["../../src/host/host.tsx"],"sourcesContent":["import { type G9AbortSignal, G9Error, type G9SegmentInput, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { OverlayView } from '@lynx-js/lynx-ui-overlay';\nimport {\n createContext,\n Fragment,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from '@lynx-js/react';\nimport { useStableCallback } from '../base/use-stable-callback';\nimport { G9KeyboardContext } from '../provider/contexts';\nimport { useG9Core, useG9SafeInsets, useG9Settings } from '../provider/hooks';\nimport { useG9Place } from '../route/hooks';\nimport { createBackStack, type G9BackResult } from './back';\nimport { isKeyboardTarget } from './keyboard';\nimport { createLayerStore, type G9LayerStore, type G9OverlayLayer, g9LayerOrder } from './layers';\nimport { G9PageLoadingOverlay } from './page-loading-overlay';\nimport { createHostReadiness, type G9HostReadinessController } from './readiness';\nimport { type G9HostContentEffect, type G9HostHandle, type G9HostInsets, hostRegistry } from './registry';\nimport './host.css';\n\n/** How a layer is mounted: in the page tree (default) or in a Lynx `<overlay>` above native views (maps, video). */\nexport type G9LayerContainer = 'tree' | 'overlay';\n\n/** Props of {@link G9Host}. */\nexport interface G9HostProps {\n readonly children?: ReactNode;\n /**\n * Whether the page is on screen (MAUI `Loaded`/`Unloaded`, tab activation). Default `true`. An inactive host stays\n * registered and becomes active again when set back to `true`; see `g9Hosts` for the resolution rule.\n */\n readonly active?: boolean;\n /** Names the page in diagnostics (the cover's busy activity is `page:<name>`). Default `'G9Host'`. */\n readonly name?: string;\n /**\n * The page's appearing work (MAUI `OnAppearingAfterParentAsync`), run through the provider's safe executor each time\n * the host becomes active; `signal` aborts when it stops being active or unmounts. On the first appearance the\n * loading cover waits for it (unless `manualRelease`).\n */\n readonly onAppearing?: (context: { readonly signal: G9AbortSignal }) => void | Promise<void>;\n /** Runs each time the host stops being active (MAUI `OnDisappearingAfterParentAsync`), guarded. */\n readonly onDisappearing?: () => void | Promise<void>;\n /** The page's own back handling (MAUI `TryHandleInAppBack`), asked after every overlay. */\n readonly onBack?: () => G9BackResult | boolean;\n /** Swallow every system back press before anything else runs (MAUI `IsHardwareBackSuppressed`). Default `false`. */\n readonly backSuppressed?: boolean;\n /** Show the page-loading cover until the page is ready (MAUI `G9PageLoadingOverlay`, always on). Default `true`. */\n readonly loadingCover?: boolean;\n /** The page releases the cover itself through `useG9HostReady().release()` (MAUI `PageLoadingManualRelease`). */\n readonly manualRelease?: boolean;\n /** Extra delay after ready (MAUI `PageLoadingDismissDelayMs`). Default `settings.pageLoading.dismissDelayMs` (369). */\n readonly dismissDelayMs?: number;\n /** Hard cap on the cover (MAUI `PageLoadingSafetyTimeoutMs`). Default `settings.pageLoading.safetyTimeoutMs` (5000). */\n readonly safetyTimeoutMs?: number;\n /** Dismiss the soft keyboard on a tap outside any keyboard target (MAUI `TapOutsideKeyboardDismisser`). Default `true`. */\n readonly dismissKeyboardOnTapOutside?: boolean;\n /** Per-layer container; a layer over a native view (map, video) needs `'overlay'`. Default `'tree'` for each. */\n readonly layerContainers?: Partial<Record<G9OverlayLayer, G9LayerContainer>>;\n /** MAUI `ComputeBottomSafeAreaWithTabBar`: the bottom inset plus the page's own tab bar. Default: the inset. */\n readonly computeBottomSafeAreaWithTabBar?: (bottomInset: number) => number;\n /** The page background (MAUI `ApplyThemedBackground`). Default `var(--g9-background)`. */\n readonly background?: string;\n /** The colour behind the content, shown when a sheet recedes the page (MAUI `BackdropHost`). Default black. */\n readonly backdropColor?: string;\n readonly className?: string;\n /** The page's place in the navigation (`@g9tm/lynxcontrols/route`), declared while the host is active. */\n readonly route?: G9SegmentInput;\n /** How the router leaves the page (pop it). Without it the router cannot close the page. */\n readonly routeClose?: () => void;\n}\n\n/** The nearest host, for hooks. */\nexport const G9HostContext = createContext<G9HostHandle | null>(null);\n/** The nearest host's insets. */\nexport const G9HostInsetsContext = createContext<G9HostInsets | null>(null);\n/** The nearest host's readiness controller. */\nexport const G9HostReadinessContext = createContext<G9HostReadinessController | null>(null);\n\nconst OVERLAY_LAYERS = g9LayerOrder.filter((layer): layer is G9OverlayLayer => layer !== 'content');\nlet hostSequence = 0;\n\n// The inner name must differ from the binding: rslib renames `const X = memo(function X…)` with a module prefix and the\n// in-module `<X>` then compiles as an unknown intrinsic element (E20; scripts/check-dist-jsx.mjs).\nconst HostLayer = memo(function HostLayerRender(props: {\n readonly hostId: string;\n readonly store: G9LayerStore;\n readonly layer: G9OverlayLayer;\n readonly container: G9LayerContainer;\n}): ReactNode {\n const { hostId, store, layer, container } = props;\n const entries = useSyncExternalStore(\n (listener) => store.subscribe(layer, listener),\n () => store.getSnapshot(layer),\n );\n if (entries.length === 0) return null;\n const className = `g9-host__layer g9-host__layer--${layer}`;\n const items = entries.map((entry) => <Fragment key={entry.key}>{entry.element}</Fragment>);\n if (container === 'overlay') {\n return (\n <OverlayView container=\"window\" className={className} id={`${hostId}-${layer}`}>\n {items}\n </OverlayView>\n );\n }\n return <view className={className}>{items}</view>;\n});\n\n/**\n * The page frame (MAUI `G9PageBase` + `G9PageTemplate`): the content and the overlay layers in a fixed z-order\n * (`content` → `edgePanel` → `sheets` → `popups` → `feedback` → `floating`, then the loading cover), the page's back\n * stack, readiness and loading cover, safe-area insets, tap-outside keyboard dismissal, and its registration in\n * `g9Hosts` for code outside the tree. One per page; hosts may nest. Must be inside `G9Provider`.\n *\n * Layers are input-transparent (`pointer-events: none`), so empty areas pass touches to the layers below; each item\n * receives its own touches only when its root sets `pointer-events: auto` — Lynx inherits pointer-events, so an item\n * without it is transparent as well. An empty layer renders nothing.\n */\nexport function G9Host(props: G9HostProps): ReactNode {\n const core = useG9Core();\n const settings = useG9Settings();\n const parent = useContext(G9HostContext);\n const keyboard = useContext(G9KeyboardContext);\n const providerInsets = useG9SafeInsets();\n const active = props.active ?? true;\n const routeClose = props.routeClose;\n useG9Place(\n props.route ? { segment: props.route, layer: 'page', ...(routeClose ? { close: () => routeClose() } : {}) } : null,\n { active },\n );\n const name = props.name ?? 'G9Host';\n\n const latest = useRef(props);\n latest.current = props;\n\n const bottomWithTabBar = props.computeBottomSafeAreaWithTabBar\n ? props.computeBottomSafeAreaWithTabBar(providerInsets.bottom)\n : providerInsets.bottom;\n const insets = useMemo<G9HostInsets>(\n () => Object.freeze({ ...providerInsets, bottomWithTabBar }),\n [providerInsets, bottomWithTabBar],\n );\n const insetsRef = useRef(insets);\n insetsRef.current = insets;\n\n const [state] = useState(() => {\n hostSequence += 1;\n const id = `g9-host-${hostSequence}`;\n const layers = createLayerStore();\n const back = createBackStack({\n isSuppressed: () => latest.current.backSuppressed === true,\n onHandlerError: (error) =>\n core.diagnostics.log({ level: 'error', message: 'A back handler threw.', source: name, error }),\n });\n const features = new Map<string, unknown>();\n let released = false;\n let contentEffect: G9HostContentEffect | null = null;\n const effectListeners = new Set<() => void>();\n const readiness = createHostReadiness({\n cover: props.loadingCover ?? true,\n manualRelease: props.manualRelease ?? false,\n dismissDelayMs: props.dismissDelayMs ?? settings.pageLoading.dismissDelayMs,\n safetyTimeoutMs: props.safetyTimeoutMs ?? settings.pageLoading.safetyTimeoutMs,\n startActivity: () => {\n const scope = core.diagnostics.activity(`page:${name}`);\n return () => scope.dispose();\n },\n runAppearing: async (signal) => {\n const onAppearing = latest.current.onAppearing;\n if (!onAppearing) return;\n await core.executor.run((context) => onAppearing({ signal: context.signal }), {\n source: name,\n throttleKey: `${id}.onAppearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n signal,\n });\n },\n });\n const handle: G9HostHandle = {\n id,\n parent,\n services: core.services,\n anchors: core.anchors,\n layers,\n registerLayerItem(layer, item) {\n if (released) return () => {};\n return layers.register(layer, item);\n },\n removeLayerItem: (layer, key) => layers.remove(layer, key),\n back,\n getInsets: () => insetsRef.current,\n readiness,\n attachFeature(key, value) {\n if (features.has(key)) throw new G9Error('host-feature', `Host feature '${String(key)}' is already attached.`);\n features.set(key, value);\n return () => {\n if (features.get(key) === value) features.delete(key);\n };\n },\n getFeature: (key) => features.get(key) as never,\n get released() {\n return released;\n },\n setContentEffect(effect) {\n if (released || contentEffect === effect) return;\n contentEffect = effect;\n for (const listener of [...effectListeners]) listener();\n },\n getContentEffect: () => contentEffect,\n };\n const effectStore = {\n subscribe(listener: () => void) {\n effectListeners.add(listener);\n return () => {\n effectListeners.delete(listener);\n };\n },\n getSnapshot: () => contentEffect,\n };\n return {\n handle,\n readiness,\n effectStore,\n release() {\n released = true;\n features.clear();\n },\n };\n });\n const { handle, readiness, effectStore } = state;\n\n // Unmount: synchronous unregistration and release of everything the host owns.\n useEffect(\n () => () => {\n hostRegistry.remove(handle);\n readiness.dispose();\n handle.layers.clear();\n handle.back.clear();\n state.release();\n },\n [handle, readiness, state],\n );\n\n // Visibility drives the registry and the appearing/disappearing lifecycle.\n const wasActive = useRef<boolean | null>(null);\n useEffect(() => {\n const previous = wasActive.current;\n wasActive.current = active;\n if (active) {\n hostRegistry.activate(handle);\n readiness.appear();\n return;\n }\n if (previous === null) {\n hostRegistry.register(handle);\n return;\n }\n hostRegistry.markOffScreen(handle);\n readiness.disappear();\n const onDisappearing = latest.current.onDisappearing;\n if (onDisappearing) {\n core.executor.runSafe(() => onDisappearing(), {\n source: name,\n throttleKey: `${handle.id}.onDisappearing`,\n enableThrottle: false,\n preventConcurrentExecution: false,\n });\n }\n }, [active, handle, readiness, core, name]);\n\n // The page's own back handling sits in the content layer, below every overlay.\n const hasOnBack = props.onBack !== undefined;\n useEffect(\n () => (hasOnBack ? handle.back.push(() => latest.current.onBack?.() ?? 'pass') : undefined),\n [hasOnBack, handle],\n );\n\n const keyboardVisible = useRef(false);\n keyboardVisible.current = keyboard?.visible === true;\n const onCaptureTap = useStableCallback((event: { target?: { dataset?: Record<string, unknown> } }) => {\n if (!keyboardVisible.current || isKeyboardTarget(event.target)) return;\n core.services.host.hideKeyboard();\n });\n\n const cover = useSyncExternalStore(readiness.subscribe, readiness.getSnapshot).cover;\n const effect = useSyncExternalStore(effectStore.subscribe, effectStore.getSnapshot);\n const containers = props.layerContainers ?? {};\n const tapOutside = props.dismissKeyboardOnTapOutside ?? true;\n\n return (\n <G9HostContext.Provider value={handle}>\n <G9HostInsetsContext.Provider value={insets}>\n <G9HostReadinessContext.Provider value={readiness}>\n <view\n className={`g9-host${props.className ? ` ${props.className}` : ''}`}\n {...(tapOutside ? { 'capture-bindtap': onCaptureTap } : {})}\n >\n <view\n className=\"g9-host__backdrop\"\n style={{ backgroundColor: effect?.backdropColor ?? props.backdropColor ?? '#000000' }}\n />\n <view\n className=\"g9-host__content\"\n style={{\n backgroundColor: props.background ?? 'var(--g9-background)',\n transform: effect\n ? `translateY(${effect.translateY}px) scale(${effect.scale})`\n : 'translateY(0px) scale(1)',\n transition: `transform ${g9Ms(effect?.durationMs ?? 300)}ms ease-out`,\n }}\n >\n {props.children}\n </view>\n {OVERLAY_LAYERS.map((layer) => (\n <HostLayer\n key={layer}\n hostId={handle.id}\n store={handle.layers}\n layer={layer}\n container={containers[layer] ?? 'tree'}\n />\n ))}\n {cover === 'hidden' ? null : (\n <G9PageLoadingOverlay\n exiting={cover === 'exiting'}\n backgroundColor={settings.pageLoading.backgroundColor}\n spinnerColor={settings.pageLoading.spinnerColor}\n />\n )}\n </view>\n </G9HostReadinessContext.Provider>\n </G9HostInsetsContext.Provider>\n </G9HostContext.Provider>\n );\n}\n"],"names":["G9HostContext","createContext","G9HostInsetsContext","G9HostReadinessContext","OVERLAY_LAYERS","g9LayerOrder","layer","hostSequence","HostLayer","memo","props","hostId","store","container","entries","useSyncExternalStore","listener","className","items","entry","Fragment","OverlayView","view","G9Host","_props_active","_props_name","_props_layerContainers","_props_dismissKeyboardOnTapOutside","_ref","_props_background","core","useG9Core","settings","useG9Settings","parent","useContext","keyboard","G9KeyboardContext","providerInsets","useG9SafeInsets","active","routeClose","useG9Place","name","latest","useRef","bottomWithTabBar","insets","useMemo","Object","insetsRef","state","useState","_props_loadingCover","_props_manualRelease","_props_dismissDelayMs","_props_safetyTimeoutMs","id","layers","createLayerStore","back","createBackStack","error","features","Map","released","contentEffect","effectListeners","Set","readiness","createHostReadiness","scope","signal","onAppearing","context","handle","item","key","value","G9Error","String","effect","effectStore","useEffect","hostRegistry","wasActive","previous","onDisappearing","hasOnBack","undefined","_latest_current","keyboardVisible","onCaptureTap","useStableCallback","event","isKeyboardTarget","cover","containers","tapOutside","g9Ms","_containers_layer","G9PageLoadingOverlay"],"mappings":";;;;;;;;;;;;;;AA6EO,MAAMA,gBAAgBC,cAAmC;AAEzD,MAAMC,sBAAsBD,cAAmC;AAE/D,MAAME,yBAAyBF,cAAgD;AAEtF,MAAMG,iBAAiBC,aAAa,MAAM,CAAC,CAACC,QAAmCA,AAAU,cAAVA;AAC/E,IAAIC,eAAe;AAInB,MAAMC,YAAYC,KAAK,SAAyBC,KAK/C;IACC,MAAM,EAAEC,MAAM,EAAEC,KAAK,EAAEN,KAAK,EAAEO,SAAS,EAAE,GAAGH;IAC5C,MAAMI,UAAUC,qBACd,CAACC,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,CAAC,CAAC,GAC3D;QACJ,YAAY,CAAC,UAAU,EAAEkB,KAAK,QAADA,CAAAA,QAAClB,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,UAAU,AAAD,IAAC,QAAI,KAAK,WAAW,CAAC;IACvE,GACD;cACC,CAACvE,MAAM,QAAQ,CAAC;YAClB,EAAEY,KAAK;YACP,CAAClB,eAAe,GAAG,CAAC,CAACE;YAMN8F;gBALZ5F,UACC,KAAKF,OACL,QAAQqE,OAAO,EAAE,EACjB,OAAOA,OAAO,MAAM,EACpB,OAAOrE,OACP,WAAW,QAAA8F,CAAAA,oBAAAA,UAAU,CAAC9F,MAAM,AAAD,IAAhB8F,oBAAqB;OAEjC;YACH,CAACJ,AAAU,aAAVA,QAAqB,QACnBK,qBACC,SAASL,AAAU,cAAVA,OACT,iBAAiBhE,SAAS,WAAW,CAAC,eAAe,EACrD,cAAcA,SAAS,WAAW,CAAC,YAAY,IAEjD;UACJ,EAAEV,KAAK;QACT,EAAEnB,uBAAuB,SAAS;MACpC,EAAED,oBAAoB,SAAS;IACjC,EAAEF,cAAc;AAEpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/keyboard.jsx","sources":["../../src/host/keyboard.ts"],"sourcesContent":["import type { G9HostServices } from '@g9tm/lynxcontrols-foundation';\n\n/**\n * Mark an element that takes keyboard focus (an `<input>`, `<textarea>`, or the field box around one) with these\n * props. A tap on a marked element never dismisses the keyboard: focus moves between fields with the keyboard up\n * (MAUI tap-outside rule, `Controls/G9Controls.md` §13).\n */\nexport const g9KeyboardTargetProps = Object.freeze({ 'data-g9keyboard': 'target' });\n\n/**\n * `true` when a tap target's dataset carries the {@link g9KeyboardTargetProps} mark. The key is one lower-case word\n * so it reads the same whether the runtime keeps or camel-cases dataset keys.\n */\nexport function isKeyboardTarget(\n target: { readonly dataset?: Readonly<Record<string, unknown>> } | null | undefined,\n): boolean {\n return target?.dataset?.g9keyboard === 'target';\n}\n\nconst panUsers = new WeakMap<G9HostServices, number>();\n\n/**\n * Switches the window to pan the focused input above the keyboard while a flow needs it (MAUI\n * `G9KeyboardHelper.UseAndroidPanSoftInputMode`). Returns an idempotent restore function; the default `'resize'`\n * comes back when the last user restores. Users are counted per host, so overlapping sheets do not undo each other.\n * On a host without soft-input modes (iOS, desktop: no `setSoftInputMode`) nothing changes, as in MAUI.\n */\nexport function acquirePanSoftInputMode(host: G9HostServices): () => void {\n const setMode = host.setSoftInputMode?.bind(host);\n if (!setMode) return () => {};\n const users = panUsers.get(host) ?? 0;\n panUsers.set(host, users + 1);\n if (users === 0) setMode('pan');\n let restored = false;\n return () => {\n if (restored) return;\n restored = true;\n const remaining = (panUsers.get(host) as number) - 1;\n panUsers.set(host, remaining);\n if (remaining === 0) setMode('resize');\n };\n}\n"],"names":["g9KeyboardTargetProps","Object","isKeyboardTarget","target","_target_dataset","panUsers","WeakMap","acquirePanSoftInputMode","host","_panUsers_get","_host_setSoftInputMode","setMode","users","restored","remaining"],"mappings":"AAOO,MAAMA,wBAAwBC,OAAO,MAAM,CAAC;IAAE,mBAAmB;AAAS;AAM1E,SAASC,iBACdC,MAAmF;QAE5EC;IAAP,OAAOA,AAAAA,CAAAA,QAAAA,SAAAA,KAAAA,IAAAA,QAAAA,CAAAA,kBAAAA,OAAQ,OAAO,AAAD,IAAdA,KAAAA,IAAAA,gBAAiB,UAAU,AAAD,MAAM;AACzC;AAEA,MAAMC,WAAW,IAAIC;AAQd,SAASC,wBAAwBC,IAAoB;QAG5CC;QAFEC;IAAhB,MAAMC,UAAU,QAAAD,CAAAA,yBAAAA,KAAK,gBAAgB,AAAD,IAApBA,KAAAA,IAAAA,uBAAuB,IAAI,CAACF;IAC5C,IAAI,CAACG,SAAS,OAAO,KAAO;IAC5B,MAAMC,QAAQ,QAAAH,CAAAA,gBAAAA,SAAS,GAAG,CAACD,KAAI,IAAjBC,gBAAsB;IACpCJ,SAAS,GAAG,CAACG,MAAMI,QAAQ;IAC3B,IAAIA,AAAU,MAAVA,OAAaD,QAAQ;IACzB,IAAIE,WAAW;IACf,OAAO;QACL,IAAIA,UAAU;QACdA,WAAW;QACX,MAAMC,YAAaT,SAAS,GAAG,CAACG,QAAmB;QACnDH,SAAS,GAAG,CAACG,MAAMM;QACnB,IAAIA,AAAc,MAAdA,WAAiBH,QAAQ;IAC/B;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/layers.jsx","sources":["../../src/host/layers.ts"],"sourcesContent":["import { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\n\n/**\n * The page layers a `G9Host` owns, bottom to top (plan/specs/01 §5, MAUI `G9PageTemplate.xaml` z-stack). Sibling order\n * is the z-order; nothing relies on `z-index`.\n *\n * | Layer | MAUI template host | Holds |\n * | --- | --- | --- |\n * | `content` | `ContentHost` | the page itself (painted over `BackdropHost`) |\n * | `edgePanel` | (page content) | side panels sliding over the content (WP06) |\n * | `sheets` | `OverlayHost` | bottom sheets and their scrims (WP05) |\n * | `popups` | `G9PopupHost` | popups (WP07) |\n * | `feedback` | `ToastHost` | toasts, loaders, progress overlays: above sheets and popups |\n * | `floating` | `DevHost` | always-available floating affordances (developer FAB, QA pill) |\n * | `guide` | (Lynx) | the guide's highlights, spotlight, finger, bubbles and its guided-save confirmation |\n *\n * Only the page-loading cover sits above `guide`.\n */\nexport const G9Layer = {\n Content: 'content',\n EdgePanel: 'edgePanel',\n Sheets: 'sheets',\n Popups: 'popups',\n Feedback: 'feedback',\n Floating: 'floating',\n Guide: 'guide',\n} as const;\nexport type G9Layer = (typeof G9Layer)[keyof typeof G9Layer];\n\n/** Every layer, bottom to top. */\nexport const g9LayerOrder: readonly G9Layer[] = Object.freeze([\n 'content',\n 'edgePanel',\n 'sheets',\n 'popups',\n 'feedback',\n 'floating',\n 'guide',\n]);\n\n/** The layers items can be registered into (`content` is the page's own children). */\nexport type G9OverlayLayer = Exclude<G9Layer, 'content'>;\n\n/** Position of `layer` in the z-stack (0 = bottom). */\nexport function layerRank(layer: G9Layer): number {\n const rank = g9LayerOrder.indexOf(layer);\n if (rank < 0) throw new G9Error('host-layer', `\"${String(layer)}\" is not a G9 layer.`);\n return rank;\n}\n\n/** One thing mounted into a layer. */\nexport interface G9LayerItem {\n /** Identity within the layer. Registering an existing key replaces its element and order in place. */\n readonly key: string;\n /** What to render. */\n readonly element: ReactNode;\n /** Ordering inside the layer: lower paints first (below). Ties keep registration order (later on top). Default 0. */\n readonly order?: number;\n}\n\n/** A registered item as the layer renders it. */\nexport interface G9LayerEntry {\n readonly key: string;\n readonly element: ReactNode;\n readonly order: number;\n /** Registration sequence; stable while the key stays registered. */\n readonly sequence: number;\n}\n\n/** The items of every overlay layer of one host. */\nexport interface G9LayerStore {\n /** The layer's items, bottom first. The same array until the layer changes. */\n getSnapshot(layer: G9OverlayLayer): ReadonlyArray<G9LayerEntry>;\n /** Called after each change of `layer`. Returns an unsubscribe function. */\n subscribe(layer: G9OverlayLayer, listener: () => void): () => void;\n /**\n * Mounts `item` into `layer` (or replaces the item with the same key). Returns a function that removes exactly this\n * registration: it does nothing once the key was removed or registered again by someone else.\n */\n register(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Removes the item with `key`; `false` when there was none. */\n remove(layer: G9OverlayLayer, key: string): boolean;\n /** Number of items in `layer`. */\n count(layer: G9OverlayLayer): number;\n /** Removes every item of every layer (host unmount). */\n clear(): void;\n}\n\nconst EMPTY: ReadonlyArray<G9LayerEntry> = Object.freeze([]);\n\nfunction checkLayer(layer: G9OverlayLayer): void {\n if (layer === ('content' as G9Layer)) {\n throw new G9Error('host-layer', 'The content layer holds the page itself; register items into an overlay layer.');\n }\n layerRank(layer);\n}\n\nfunction checkItem(item: G9LayerItem): number {\n if (typeof item?.key !== 'string' || item.key === '') {\n throw new G9Error('host-layer-item', 'A layer item needs a non-empty string key.');\n }\n const order = item.order ?? 0;\n if (typeof order !== 'number' || !Number.isFinite(order)) {\n throw new G9Error('host-layer-item', `Layer item \"${item.key}\" has an invalid order (${String(order)}).`);\n }\n return order;\n}\n\n/** Creates an empty {@link G9LayerStore}. */\nexport function createLayerStore(): G9LayerStore {\n const layers = new Map<G9OverlayLayer, Map<string, G9LayerEntry>>();\n const snapshots = new Map<G9OverlayLayer, ReadonlyArray<G9LayerEntry>>();\n const listeners = new Map<G9OverlayLayer, Set<() => void>>();\n let sequence = 0;\n\n function changed(layer: G9OverlayLayer): void {\n const entries = Array.from(layers.get(layer)?.values() ?? []);\n entries.sort((a, b) => a.order - b.order || a.sequence - b.sequence);\n snapshots.set(layer, entries.length ? Object.freeze(entries) : EMPTY);\n for (const listener of Array.from(listeners.get(layer) ?? [])) listener();\n }\n\n const store: G9LayerStore = {\n getSnapshot(layer) {\n return snapshots.get(layer) ?? EMPTY;\n },\n subscribe(layer, listener) {\n checkLayer(layer);\n let set = listeners.get(layer);\n if (!set) {\n set = new Set();\n listeners.set(layer, set);\n }\n set.add(listener);\n return () => {\n set.delete(listener);\n };\n },\n register(layer, item) {\n checkLayer(layer);\n const order = checkItem(item);\n let entries = layers.get(layer);\n if (!entries) {\n entries = new Map();\n layers.set(layer, entries);\n }\n const existing = entries.get(item.key);\n sequence += 1;\n const entry: G9LayerEntry = Object.freeze({\n key: item.key,\n element: item.element,\n order,\n sequence: existing ? existing.sequence : sequence,\n });\n entries.set(item.key, entry);\n changed(layer);\n return () => {\n if (layers.get(layer)?.get(item.key) === entry) store.remove(layer, item.key);\n };\n },\n remove(layer, key) {\n checkLayer(layer);\n const entries = layers.get(layer);\n if (!entries?.delete(key)) return false;\n changed(layer);\n return true;\n },\n count(layer) {\n return layers.get(layer)?.size ?? 0;\n },\n clear() {\n for (const [layer, entries] of Array.from(layers)) {\n if (entries.size === 0) continue;\n entries.clear();\n changed(layer);\n }\n },\n };\n return store;\n}\n"],"names":["G9Layer","g9LayerOrder","Object","layerRank","layer","rank","G9Error","String","EMPTY","checkLayer","checkItem","item","_item_order","order","Number","createLayerStore","layers","Map","snapshots","listeners","sequence","changed","_listeners_get","_layers_get","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;YAC3C;YACAI,QAAQ,GAAG,CAACb,KAAK,GAAG,EAAEuB;YACtBb,QAAQjB;YACR,OAAO;oBACDmB;gBAAJ,IAAIA,AAAAA,SAAAA,CAAAA,cAAAA,OAAO,GAAG,CAACnB,MAAK,IAAhBmB,KAAAA,IAAAA,YAAmB,GAAG,CAACZ,KAAK,GAAG,OAAMuB,OAAOL,MAAM,MAAM,CAACzB,OAAOO,KAAK,GAAG;YAC9E;QACF;QACA,QAAOP,KAAK,EAAE+B,GAAG;YACf1B,WAAWL;YACX,MAAMoB,UAAUR,OAAO,GAAG,CAACZ;YAC3B,IAAI,CAACoB,CAAAA,QAAAA,UAAAA,KAAAA,IAAAA,QAAS,MAAM,CAACW,IAAG,GAAG,OAAO;YAClCd,QAAQjB;YACR,OAAO;QACT;QACA,OAAMA,KAAK;;gBACFmB;YAAP,OAAO,QAAP,gBAAOA,CAAAA,cAAAA,OAAO,GAAG,CAACnB,MAAK,IAAhBmB,KAAAA,IAAAA,YAAmB,IAAI,AAAD,IAAC,OAAI;QACpC;QACA;YACE,KAAK,MAAM,CAACnB,OAAOoB,QAAQ,IAAIC,MAAM,IAAI,CAACT,QACxC,IAAIQ,AAAiB,MAAjBA,QAAQ,IAAI;gBAChBA,QAAQ,KAAK;gBACbH,QAAQjB;;QAEZ;IACF;IACA,OAAOyB;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/page-loading-overlay.jsx","sources":["../../src/host/page-loading-overlay.tsx"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\n\n/** Props of {@link G9PageLoadingOverlay}. */\nexport interface G9PageLoadingOverlayProps {\n /** Play the exit (scale to 0.9 and fade, 200 ms). */\n readonly exiting?: boolean;\n /** Cover colour. Default the theme's `Primary`. */\n readonly backgroundColor?: string;\n /** Spinner colour. Default the theme's `OnPrimary`. */\n readonly spinnerColor?: string;\n}\n\n// Three coloured sides and a transparent top make the rotating arc (inline styles win over the class).\nconst spinnerStyle = (color: string) => ({ borderLeftColor: color, borderRightColor: color, borderBottomColor: color });\n\n/**\n * The full-screen cover that hides a page while it assembles itself (MAUI `G9PageLoadingOverlay`): input-opaque, a\n * centred 48 px spinner, the top of the host's z-stack. `G9Host` mounts it and removes it after its exit; set the app\n * default colours with `settings.pageLoading` (match the native splash colour for a seamless hand-off).\n */\nexport function G9PageLoadingOverlay(props: G9PageLoadingOverlayProps): ReactNode {\n return (\n <view\n className={`g9-page-loading${props.exiting ? ' g9-page-loading--exiting' : ''}`}\n style={{ backgroundColor: props.backgroundColor ?? 'var(--g9-primary)' }}\n accessibility-element={true}\n accessibility-label=\"Loading\"\n // Input-opaque on purpose: a tap must not reach a control that is not wired up yet (MAUI).\n catchtap={() => {}}\n >\n <view className=\"g9-page-loading__spinner\" style={spinnerStyle(props.spinnerColor ?? 'var(--g9-on-primary)')} />\n </view>\n );\n}\n"],"names":["spinnerStyle","color","G9PageLoadingOverlay","props","_props_backgroundColor","_props_spinnerColor","view"],"mappings":"AAaA,MAAMA,eAAe,CAACC,QAAmB;QAAE,iBAAiBA;QAAO,kBAAkBA;QAAO,mBAAmBA;IAAM;AAO9G,SAASC,qBAAqBC,KAAgC;QAIrCC,wBAMqCC;IATnE,QACGC,KACC,WAAW,CAAC,eAAe,EAAEH,MAAM,OAAO,GAAG,8BAA8B,IAAI,EAC/E,OAAO;QAAE,iBAAiB,QAAAC,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;IAAoB,GACvE,uBAAuB,MACvB,oBAAoB,UAEpB,UAAU,KAAO,GAClB;MACC,CAACE,KAAK,UAAU,2BAA2B,OAAON,aAAa,QAAAK,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB,0BAA2B;IAClH,EAAEC;AAEN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/readiness.jsx","sources":["../../src/host/readiness.ts"],"sourcesContent":["import { createAbortController, type G9AbortSignal } from '@g9tm/lynxcontrols-foundation';\nimport { createDisposer } from '../base/disposer';\n\n/** Duration of the cover's exit (MAUI: scale to 0.9 and fade out together, 200 ms, cubic-in). */\nexport const g9PageLoadingExitMs = 200;\n/** Margin of the cover's watchdog behind the normal path (MAUI `RunPageLoadingWatchdogAsync`). */\nexport const g9PageLoadingWatchdogMarginMs = 500;\n\n/** State of a host's page-loading cover and ready signal. */\nexport interface G9HostReadinessSnapshot {\n /** The page reported itself ready: automatically after `onAppearing`, or by `release()`. Latched. */\n readonly ready: boolean;\n /** `'covering'` while the cover hides the page, `'exiting'` during its 200 ms exit, `'hidden'` otherwise. */\n readonly cover: 'covering' | 'exiting' | 'hidden';\n /** The cover is gone for good (it is one-shot per host, as in MAUI). */\n readonly dismissed: boolean;\n}\n\n/** A host's readiness, as pages and outside code use it (MAUI `G9PageBase` loading-overlay members). */\nexport interface G9HostReadiness {\n getSnapshot(): G9HostReadinessSnapshot;\n subscribe(listener: (snapshot: G9HostReadinessSnapshot) => void): () => void;\n /**\n * Reports the page visually ready (MAUI `ReleasePageLoadingOverlay`): the cover leaves after the dismiss delay.\n * Idempotent; calling it before the page appeared, or after the cover left, is harmless.\n */\n release(): void;\n /** Settles once the cover has fully left, or at once when it never showed (MAUI `PageLoadingOverlayDismissed`). */\n whenDismissed(): Promise<void>;\n}\n\n/** Inputs of {@link createHostReadiness}. */\nexport interface G9HostReadinessOptions {\n /** Whether the host shows the cover at all. */\n readonly cover: boolean;\n /** The page releases itself (MAUI `PageLoadingManualRelease`). */\n readonly manualRelease: boolean;\n readonly dismissDelayMs: number;\n readonly safetyTimeoutMs: number;\n /** The page's appearing work (MAUI `OnAppearingAfterParentAsync`); aborted when the page disappears. */\n readonly runAppearing: (signal: G9AbortSignal) => Promise<void>;\n /** Holds a busy activity while the cover is up (MAUI `G9Diagnostics.Activity(\"page:…\")`); returns its release. */\n readonly startActivity?: () => () => void;\n}\n\n/** The host-side driver of {@link G9HostReadiness}. */\nexport interface G9HostReadinessController extends G9HostReadiness {\n /** The page became visible (mount, or `active` turned on). */\n appear(): void;\n /** The page stopped being visible; an in-flight appearing run is aborted and the cover leaves. */\n disappear(): void;\n /** Unmount: stops every timer and settles `whenDismissed`. */\n dispose(): void;\n}\n\n/**\n * The MAUI page-loading lifecycle (`RunAppearingWithOverlayDismissAsync`, the watchdog and\n * `DismissPageLoadingOverlayAsync`): on the first appearance run the appearing work, then (auto pages) report ready,\n * wait for ready, wait the dismiss delay, and dismiss. Every wait is bounded by the safety timeout measured from the\n * appearance, and a watchdog (safety + delay + 500 ms) dismisses even if the run never ends. Disappearing aborts the\n * run and dismisses. Dismissal is one-shot; later appearances only run the appearing work.\n */\nexport function createHostReadiness(options: G9HostReadinessOptions): G9HostReadinessController {\n const disposer = createDisposer();\n const listeners = new Set<(snapshot: G9HostReadinessSnapshot) => void>();\n let snapshot: G9HostReadinessSnapshot = Object.freeze({\n ready: false,\n cover: options.cover ? 'covering' : 'hidden',\n dismissed: !options.cover,\n });\n let resolveDismissed!: () => void;\n const dismissedPromise = new Promise<void>((resolve) => {\n resolveDismissed = resolve;\n });\n if (!options.cover) resolveDismissed();\n let readyWaiters: Array<() => void> = [];\n let releaseActivity: (() => void) | null = options.cover && options.startActivity ? options.startActivity() : null;\n let running: { abort(): void } | null = null;\n\n function set(patch: Partial<G9HostReadinessSnapshot>): void {\n snapshot = Object.freeze({ ...snapshot, ...patch });\n if (disposer.disposed) return;\n for (const listener of Array.from(listeners)) listener(snapshot);\n }\n\n function stopActivity(): void {\n const release = releaseActivity;\n releaseActivity = null;\n release?.();\n }\n\n function dismiss(): void {\n if (snapshot.dismissed) return;\n // Released before the exit animation: the page is usable the moment dismissal starts (MAUI).\n stopActivity();\n set({ dismissed: true, cover: 'exiting' });\n disposer.setTimeout(() => {\n set({ cover: 'hidden' });\n resolveDismissed();\n }, g9PageLoadingExitMs);\n }\n\n function release(): void {\n if (snapshot.ready) return;\n set({ ready: true });\n const waiters = readyWaiters;\n readyWaiters = [];\n for (const waiter of waiters) waiter();\n }\n\n /** Resolves `true` when `start` settles, `false` when the run is aborted first. */\n function race(signal: G9AbortSignal, start: (done: () => void) => void): Promise<boolean> {\n return new Promise<boolean>((resolve) => {\n if (signal.aborted) return resolve(false);\n const onAbort = () => resolve(false);\n signal.addEventListener('abort', onAbort);\n start(() => {\n signal.removeEventListener('abort', onAbort);\n resolve(true);\n });\n });\n }\n\n async function run(): Promise<void> {\n const controller = createAbortController();\n const signal = controller.signal;\n running = { abort: () => controller.abort() };\n const cancelSafety = disposer.setTimeout(() => controller.abort(), options.safetyTimeoutMs);\n try {\n const appeared = await race(signal, (done) => {\n options.runAppearing(signal).then(done, done);\n });\n if (!appeared) return;\n if (!options.manualRelease) release();\n const ready = await race(signal, (done) => {\n if (snapshot.ready) done();\n else readyWaiters.push(done);\n });\n if (!ready) return;\n await race(signal, (done) => {\n disposer.setTimeout(done, options.dismissDelayMs);\n });\n } finally {\n cancelSafety();\n running = null;\n if (!disposer.disposed) dismiss();\n }\n }\n\n const controller: G9HostReadinessController = {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n release,\n whenDismissed: () => dismissedPromise,\n appear() {\n if (disposer.disposed) return;\n if (snapshot.dismissed) {\n const appearance = createAbortController();\n running?.abort();\n running = { abort: () => appearance.abort() };\n options.runAppearing(appearance.signal).then(\n () => {\n if (!options.manualRelease) release();\n },\n () => {},\n );\n return;\n }\n if (running) return;\n // The first appearance with the cover up (every later one finds it dismissed): start the watchdog once.\n disposer.setTimeout(dismiss, options.safetyTimeoutMs + options.dismissDelayMs + g9PageLoadingWatchdogMarginMs);\n void run();\n },\n disappear() {\n running?.abort();\n },\n dispose() {\n if (disposer.disposed) return;\n running?.abort();\n stopActivity();\n disposer.dispose();\n readyWaiters = [];\n resolveDismissed();\n },\n };\n return controller;\n}\n"],"names":["g9PageLoadingExitMs","g9PageLoadingWatchdogMarginMs","createHostReadiness","options","disposer","createDisposer","listeners","Set","snapshot","Object","resolveDismissed","dismissedPromise","Promise","resolve","readyWaiters","releaseActivity","running","set","patch","listener","Array","stopActivity","release","dismiss","waiters","waiter","race","signal","start","onAbort","run","controller","createAbortController","cancelSafety","appeared","done","ready","appearance"],"mappings":";;AAIO,MAAMA,sBAAsB;AAE5B,MAAMC,gCAAgC;AAwDtC,SAASC,oBAAoBC,OAA+B;IACjE,MAAMC,WAAWC;IACjB,MAAMC,YAAY,IAAIC;IACtB,IAAIC,WAAoCC,OAAO,MAAM,CAAC;QACpD,OAAO;QACP,OAAON,QAAQ,KAAK,GAAG,aAAa;QACpC,WAAW,CAACA,QAAQ,KAAK;IAC3B;IACA,IAAIO;IACJ,MAAMC,mBAAmB,IAAIC,QAAc,CAACC;QAC1CH,mBAAmBG;IACrB;IACA,IAAI,CAACV,QAAQ,KAAK,EAAEO;IACpB,IAAII,eAAkC,EAAE;IACxC,IAAIC,kBAAuCZ,QAAQ,KAAK,IAAIA,QAAQ,aAAa,GAAGA,QAAQ,aAAa,KAAK;IAC9G,IAAIa,UAAoC;IAExC,SAASC,IAAIC,KAAuC;QAClDV,WAAWC,OAAO,MAAM,CAAC;YAAE,GAAGD,QAAQ;YAAE,GAAGU,KAAK;QAAC;QACjD,IAAId,SAAS,QAAQ,EAAE;QACvB,KAAK,MAAMe,YAAYC,MAAM,IAAI,CAACd,WAAYa,SAASX;IACzD;IAEA,SAASa;QACP,MAAMC,UAAUP;QAChBA,kBAAkB;QAClBO,QAAAA,WAAAA;IACF;IAEA,SAASC;QACP,IAAIf,SAAS,SAAS,EAAE;QAExBa;QACAJ,IAAI;YAAE,WAAW;YAAM,OAAO;QAAU;QACxCb,SAAS,UAAU,CAAC;YAClBa,IAAI;gBAAE,OAAO;YAAS;YACtBP;QACF,GAAGV;IACL;IAEA,SAASsB;QACP,IAAId,SAAS,KAAK,EAAE;QACpBS,IAAI;YAAE,OAAO;QAAK;QAClB,MAAMO,UAAUV;QAChBA,eAAe,EAAE;QACjB,KAAK,MAAMW,UAAUD,QAASC;IAChC;IAGA,SAASC,KAAKC,MAAqB,EA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gBACdA,UAAU;oBAAE,OAAO,IAAMqB,WAAW,KAAK;gBAAG;gBAC5ClC,QAAQ,YAAY,CAACkC,WAAW,MAAM,EAAE,IAAI,CAC1C;oBACE,IAAI,CAAClC,QAAQ,aAAa,EAAEmB;gBAC9B,GACA,KAAO;gBAET;YACF;YACA,IAAIN,SAAS;YAEbZ,SAAS,UAAU,CAACmB,SAASpB,QAAQ,eAAe,GAAGA,QAAQ,cAAc,GAAGF;YAC3E6B;QACP;QACA;YACEd,QAAAA,WAAAA,QAAS,KAAK;QAChB;QACA;YACE,IAAIZ,SAAS,QAAQ,EAAE;YACvBY,QAAAA,WAAAA,QAAS,KAAK;YACdK;YACAjB,SAAS,OAAO;YAChBU,eAAe,EAAE;YACjBJ;QACF;IACF;IACA,OAAOqB;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"host/registry.jsx","sources":["../../src/host/registry.ts"],"sourcesContent":["import type { G9Capabilities } from '@g9tm/lynxcontrols-foundation';\nimport { G9Error } from '@g9tm/lynxcontrols-foundation';\nimport type { G9AnchorRegistry } from '../anchor/registry';\nimport type { G9BackStack } from './back';\nimport type { G9LayerItem, G9LayerStore, G9OverlayLayer } from './layers';\nimport type { G9HostReadiness } from './readiness';\n\n/** Safe-area insets of a host, with the bottom inset that also reserves the page's own tab bar. */\nexport interface G9HostInsets {\n readonly top: number;\n readonly end: number;\n readonly bottom: number;\n readonly start: number;\n /** MAUI `BottomSafeAreaWithTabBar`: `bottom` unless the host's `computeBottomSafeAreaWithTabBar` adds a bar. */\n readonly bottomWithTabBar: number;\n}\n\n/**\n * Feature controllers later packages attach to a host (sheets, popups, toasts). Augment this interface to type them:\n * `declare module '@g9tm/lynxcontrols/host' { interface G9HostFeatures { sheets: G9SheetsController } }`.\n */\n// biome-ignore lint/suspicious/noEmptyInterface: augmentation point for later work packages\nexport interface G9HostFeatures {}\n\n/** A feature key: a declared {@link G9HostFeatures} key, or any string for untyped use. */\nexport type G9HostFeatureKey = keyof G9HostFeatures | (string & {});\ntype FeatureValue<K> = K extends keyof G9HostFeatures ? G9HostFeatures[K] : unknown;\n\n/**\n * One mounted `G9Host`, as code outside the component tree sees it (MAUI `IG9OverlayHost` plus the page's back and\n * readiness): the layers to mount into, the back stack, the insets, the services of its provider.\n */\nexport interface G9HostHandle {\n /** Unique per mounted host. */\n readonly id: string;\n /** The nearest enclosing host, or `null`. */\n readonly parent: G9HostHandle | null;\n /** The services of the provider this host lives in. */\n readonly services: G9Capabilities;\n /** The provider's anchors (every control a guide or an automation can reach). */\n readonly anchors: G9AnchorRegistry;\n /** The overlay layers (MAUI `OverlayLayer` = `sheets`, `ToastLayer` = `feedback`, `DevLayer` = `floating`). */\n readonly layers: G9LayerStore;\n /** Shorthand for `layers.register`. */\n registerLayerItem(layer: G9OverlayLayer, item: G9LayerItem): () => void;\n /** Shorthand for `layers.remove`. */\n removeLayerItem(layer: G9OverlayLayer, key: string): boolean;\n /** The host's back handlers. */\n readonly back: G9BackStack;\n /** Current insets (MAUI `Page.TopSafeAreaInset` and friends). */\n getInsets(): G9HostInsets;\n /** The page-loading cover and ready signal. */\n readonly readiness: G9HostReadiness;\n /** Attaches a feature controller; returns its detach function. Attaching a key twice throws. */\n attachFeature<K extends G9HostFeatureKey>(key: K, value: FeatureValue<K>): () => void;\n /** The attached feature, or `undefined`. */\n getFeature<K extends G9HostFeatureKey>(key: K): FeatureValue<K> | undefined;\n /** `true` once the host unmounted; a released handle refuses new layer items. */\n readonly released: boolean;\n /**\n * Transforms the page content (the sheets' backdrop-card recede, MAUI `BackdropHost`): `scale` and `translateY`\n * with a transition of `durationMs`; `null` restores it. The backdrop colour shows around the scaled page.\n */\n setContentEffect(effect: G9HostContentEffect | null): void;\n /** The current content effect (`null` = identity). */\n getContentEffect(): G9HostContentEffect | null;\n}\n\n/** A transform of the page content (see {@link G9HostHandle.setContentEffect}). */\nexport interface G9HostContentEffect {\n readonly scale: number;\n readonly translateY: number;\n readonly durationMs: number;\n /** Colour shown around the receded page. */\n readonly backdropColor?: string;\n}\n\n/** Listener of {@link G9HostRegistry.subscribe}. */\nexport type G9HostListener = (host: G9HostHandle | null) => void;\n\n/**\n * Finds the host for code that is not a component (MAUI `G9OverlayHosts`): view models, services, startup hooks.\n *\n * **Which host is active.** The registry is a most-recent-first stack of mounted hosts. A host is *on screen* while its\n * `active` prop is `true` (the default). The active host is the most recently activated host that is on screen —\n * except that a host never outranks a mounted, on-screen host nested inside it (the nested one is drawn on top of its\n * parent's content). When no host is on screen, the most recently registered one is active (app start, tab switch).\n * Unmounting a host removes it synchronously; the host beneath becomes active again. There is no \"last page\" leak.\n */\nexport interface G9HostRegistry {\n /** The active host, or `null` (MAUI `TryGetCurrent`): before the first host mounts and after the last unmounts. */\n active(): G9HostHandle | null;\n /** The active host, or throws `G9Error('host-missing')` (MAUI `GetCurrent`). For user-gesture code only. */\n require(): G9HostHandle;\n /**\n * Called when the active host changes (MAUI `CurrentChanged`), with the new host or `null`. Not called when a host\n * merely re-asserts what is already active. Returns an unsubscribe function.\n */\n subscribe(listener: G9HostListener): () => void;\n /** Number of mounted hosts. */\n readonly size: number;\n}\n\ninterface Slot {\n readonly host: G9HostHandle;\n onScreen: boolean;\n}\n\nconst slots: Slot[] = [];\nconst listeners = new Set<G9HostListener>();\n\nfunction isDescendant(host: G9HostHandle, ancestor: G9HostHandle): boolean {\n for (let p = host.parent; p; p = p.parent) if (p === ancestor) return true;\n return false;\n}\n\nfunction resolve(): G9HostHandle | null {\n const onScreen = slots.filter((slot) => slot.onScreen);\n let current = onScreen[0]?.host ?? slots[0]?.host ?? null;\n if (!current || onScreen.length === 0) return current;\n for (;;) {\n const parent: G9HostHandle = current;\n const nested = onScreen.find((slot) => isDescendant(slot.host, parent));\n if (!nested) return current;\n current = nested.host;\n }\n}\n\nfunction mutate(change: () => void): void {\n const before = resolve();\n change();\n const after = resolve();\n if (before === after) return;\n let failure: { error: unknown } | null = null;\n for (const listener of Array.from(listeners)) {\n if (!listeners.has(listener)) continue;\n try {\n listener(after);\n } catch (error) {\n failure ??= { error };\n }\n }\n if (failure) throw failure.error;\n}\n\nconst indexOf = (host: G9HostHandle) => slots.findIndex((slot) => slot.host === host);\n\n/** The process-wide host registry (the only mutable module-level state in the library, plan/specs/03 §6). */\nexport const g9Hosts: G9HostRegistry = {\n active: resolve,\n require() {\n const host = resolve();\n if (!host) {\n throw new G9Error(\n 'host-missing',\n 'No G9Host is mounted. Wrap the page in <G9Host> inside <G9Provider>; during startup or teardown use ' +\n 'g9Hosts.active() and handle null.',\n );\n }\n return host;\n },\n subscribe(listener) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n get size() {\n return slots.length;\n },\n};\n\n/**\n * Registry mutators used by `G9Host` (not exported from the package). `activate` puts a host on top and on screen;\n * `register` adds it below every on-screen host without displacing one; `markOffScreen` keeps the entry; `remove`\n * forgets it.\n */\nexport const hostRegistry = {\n activate(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n slots.unshift({ host, onScreen: true });\n });\n },\n register(host: G9HostHandle): void {\n mutate(() => {\n if (indexOf(host) >= 0) return;\n let index = 0;\n slots.forEach((slot, i) => {\n if (slot.onScreen) index = i + 1;\n });\n slots.splice(index, 0, { host, onScreen: false });\n });\n },\n markOffScreen(host: G9HostHandle): void {\n mutate(() => {\n const slot = slots[indexOf(host)];\n if (slot) slot.onScreen = false;\n });\n },\n remove(host: G9HostHandle): void {\n mutate(() => {\n const index = indexOf(host);\n if (index >= 0) slots.splice(index, 1);\n });\n },\n};\n"],"names":["slots","listeners","Set","isDescendant","host","ancestor","p","resolve","_ref","_slots_","onScreen","slot","current","parent","nested","mutate","change","before","after","failure","listener","Array","error","indexOf","g9Hosts","G9Error","hostRegistry","index","i"],"mappings":";AA4GA,MAAMA,QAAgB,EAAE;AACxB,MAAMC,YAAY,IAAIC;AAEtB,SAASC,aAAaC,IAAkB,EAAEC,QAAsB;IAC9D,IAAK,IAAIC,IAAIF,KAAK,M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ACA;QAIJ,OAAOrB;IACT;IACA,WAAUgB,QAAQ;QAChBnB,UAAU,GAAG,CAACmB;QACd,OAAO;YACLnB,UAAU,MAAM,CAACmB;QACnB;IACF;IACA,IAAI;QACF,OAAOpB,MAAM,MAAM;IACrB;AACF;AAOO,MAAM0B,eAAe;IAC1B,UAAStB,IAAkB;QACzBW,OAAO;YACL,MAAMY,QAAQJ,QAAQnB;YACtB,IAAIuB,SAAS,GAAG3B,MAAM,MAAM,CAAC2B,OAAO;YACpC3B,MAAM,OAAO,CAAC;gBAAEI;gBAAM,UAAU;YAAK;QACvC;IACF;IACA,UAASA,IAAkB;QACzBW,OAAO;YACL,IAAIQ,QAAQnB,SAAS,GAAG;YACxB,IAAIuB,QAAQ;YACZ3B,MAAM,OAAO,CAAC,CAACW,MAAMiB;gBACnB,IAAIjB,KAAK,QAAQ,EAAEgB,QAAQC,IAAI;YACjC;YACA5B,MAAM,MAAM,CAAC2B,OAAO,GAAG;gBAAEvB;gBAAM,UAAU;YAAM;QACjD;IACF;IACA,eAAcA,IAAkB;QAC9BW,OAAO;YACL,MAAMJ,OAAOX,KAAK,CAACuB,QAAQnB,MAAM;YACjC,IAAIO,MAAMA,KAAK,QAAQ,GAAG;QAC5B;IACF;IACA,QAAOP,IAAkB;QACvBW,OAAO;YACL,MAAMY,QAAQJ,QAAQnB;YACtB,IAAIuB,SAAS,GAAG3B,MAAM,MAAM,CAAC2B,OAAO;QACtC;IACF;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon/icon.jsx","sources":["../../src/icon/icon.tsx"],"sourcesContent":["import {\n createGlyphSvgCache,\n cssVariableName,\n fontIconText,\n type G9ColorToken,\n G9Error,\n type G9Glyph,\n type G9IconFontRegistry,\n type G9Icon as G9IconValue,\n type G9ImageSource,\n type G9ResolvedTheme,\n type G9ThemeStore,\n isFontIcon,\n isG9Glyph,\n isIconEmpty,\n toIcon,\n} from '@g9tm/lynxcontrols-foundation';\nimport { memo, type ReactNode, useContext, useMemo, useSyncExternalStore } from '@lynx-js/react';\nimport { G9CoreContext, G9CultureContext, G9SettingsContext } from '../provider/contexts';\nimport type { G9ImageRenderer } from '../provider/settings';\nimport './icon.css';\n\n/** MAUI `G9IconView.Size` default (20 logical pixels). */\nexport const g9IconDefaultSize = 20;\n/** MAUI `G9IconView.Color` default (`Colors.Black`). */\nexport const g9IconDefaultColor = '#000000';\n\n/**\n * The bounded cache of rendered glyph SVG documents every `G9Icon` shares (one entry per glyph × colour × weight,\n * least recently used evicted beyond 256). Exposed for diagnostics and tests; `clear()` is safe at any time.\n */\nexport const g9IconSvgCache = createGlyphSvgCache();\n\n/** What an icon slot accepts: an icon, a built-in glyph name, a registered icon-font name, or nothing. */\nexport type G9IconInput = G9IconValue | G9Glyph | string | null | undefined;\n\n/** Props of {@link G9Icon}. */\nexport interface G9IconProps {\n /**\n * The icon (MAUI `G9IconView.Icon`): a foundation `G9Icon` value, a `G9Glyph` name, or a name the provider's icon-font registry\n * resolves (`'MyIcons.Valve'`, `'hour-glass'`; an unknown name throws `icon-unknown`, MAUI's type converter).\n * Empty draws nothing but keeps the size box.\n */\n readonly icon: G9IconInput;\n /** Box size in logical pixels (MAUI `Size`). Default 20. */\n readonly size?: number;\n /**\n * Colour (MAUI `Color`): any CSS colour, or a theme token (`g9Token('Primary')`, i.e. `var(--g9-primary)`), which\n * built-in glyphs resolve against the active theme. Default black (MAUI `Colors.Black`).\n */\n readonly color?: string;\n /** Stroke weight of built-in glyphs (MAUI `VectorWeightScale`); font glyphs ignore it. Default 1. */\n readonly weight?: number;\n /**\n * Mirror horizontally in a right-to-left culture. Default `false`: an icon is a picture and renders as authored\n * (MAUI pins icons left-to-right; the caller picks `chevronBack` vs `chevronForward`). Set it for a directional icon\n * that has no RTL counterpart.\n */\n readonly mirrorInRtl?: boolean;\n /** Corner radius of image icons (MAUI `G9IconFactory.Create` `imageCornerRadius`). Default 4. */\n readonly imageCornerRadius?: number;\n /** Accessibility label; without it the icon is decorative. */\n readonly accessibilityLabel?: string;\n readonly className?: string;\n}\n\nconst TOKEN = /^var\\(\\s*(--g9-[a-z0-9-]+)\\s*\\)$/;\n\nfunction resolveIcon(input: G9IconInput, registry: G9IconFontRegistry | undefined): G9IconValue | null {\n if (typeof input !== 'string') return toIcon(input);\n if (isG9Glyph(input)) return toIcon(input);\n if (!registry) {\n throw new G9Error('icon-unknown', `\"${input}\" is not a G9Glyph; icon-font names need a G9Provider registry.`);\n }\n return registry.parse(input);\n}\n\nfunction tokenValue(theme: G9ResolvedTheme, variable: string): string | undefined {\n for (const token of Object.keys(theme.palette) as G9ColorToken[]) {\n if (cssVariableName(token) === variable) return theme.palette[token];\n }\n return undefined;\n}\n\nconst noStore = {\n subscribe: () => () => {},\n getSnapshot: () => null,\n};\n\n/** A theme-token colour resolved to its current value (glyph SVG cannot read CSS variables); re-renders on change only. */\nfunction useResolvedColor(color: string, store: G9ThemeStore | undefined): string {\n const variable = TOKEN.exec(color)?.[1];\n const source = store && variable ? store : noStore;\n const resolved = useSyncExternalStore(source.subscribe, () => {\n const theme = source.getSnapshot();\n return theme && variable ? (tokenValue(theme, variable) ?? null) : null;\n });\n if (!variable) return color;\n if (resolved === null) {\n throw new G9Error(\n 'icon-color',\n store ? `${color} is not a G9 theme colour token.` : `${color} needs a G9Provider theme to resolve.`,\n );\n }\n return resolved;\n}\n\n/** The default bitmap renderer (MAUI `G9ImageFactory.DefaultFactory`): `<image>` with aspect fill, or SVG content. */\nexport function renderDefaultImage(source: G9ImageSource, size: number): ReactNode {\n const style = { width: `${size}px`, height: `${size}px` };\n if ('svg' in source) return <svg className=\"g9-icon__image\" content={source.svg} style={style} />;\n return (\n <image\n className=\"g9-icon__image\"\n src={'uri' in source ? source.uri : source.asset}\n mode=\"aspectFill\"\n style={style}\n />\n );\n}\n\n/** Renders `source` through the provider's `imageRenderer` setting, or the default (MAUI `G9ImageFactory.Create`). */\nexport function useG9ImageRenderer(): G9ImageRenderer {\n return useContext(G9SettingsContext)?.imageRenderer ?? renderDefaultImage;\n}\n\n/**\n * Draws one icon (MAUI `G9IconView` + `G9GlyphDrawable`): a built-in glyph as `<svg content>` (the golden SVG,\n * coloured and weighted, from a bounded shared cache), a font glyph as `<text>` in its family, an SVG icon as\n * `<svg content>`, an image through the image renderer. The box is `size` × `size` whatever the kind; the icon is\n * never a touch target (MAUI §10b). Memoised: a parent re-render with the same props does nothing, a colour change\n * re-renders once. Needs the `xelement-svg` behaviour on the host for SVG, the host image service for `<image>`.\n */\nexport const G9Icon = memo(function G9Icon(props: G9IconProps): ReactNode {\n const core = useContext(G9CoreContext);\n const settings = useContext(G9SettingsContext);\n const culture = useContext(G9CultureContext);\n const renderImage = useG9ImageRenderer();\n const size = props.size ?? g9IconDefaultSize;\n const weight = props.weight ?? 1;\n const rawColor = props.color ?? g9IconDefaultColor;\n const icon = useMemo(() => resolveIcon(props.icon, settings?.iconFonts), [props.icon, settings?.iconFonts]);\n const glyph = icon && 'glyph' in icon ? icon.glyph : undefined;\n const color = useResolvedColor(glyph ? rawColor : '', core?.themeStore);\n const svg = useMemo(\n () => (glyph && glyph !== 'none' ? g9IconSvgCache.svg(glyph, color, weight) : undefined),\n [glyph, color, weight],\n );\n\n const mirrored = props.mirrorInRtl === true && culture?.culture.direction === 'rtl';\n const box = {\n width: `${size}px`,\n height: `${size}px`,\n ...(mirrored ? { transform: 'scaleX(-1)' } : {}),\n };\n const a11y = props.accessibilityLabel\n ? { 'accessibility-element': true, 'accessibility-label': props.accessibilityLabel }\n : { 'accessibility-element': false };\n const className = `g9-icon${props.className ? ` ${props.className}` : ''}`;\n\n let content: ReactNode = null;\n if (svg !== undefined) {\n content = <svg className=\"g9-icon__svg\" content={svg} style={{ width: `${size}px`, height: `${size}px` }} />;\n } else if (icon && !isIconEmpty(icon)) {\n if (isFontIcon(icon)) {\n content = (\n <text\n className=\"g9-icon__glyph\"\n style={{ fontFamily: icon.font, fontSize: `${size}px`, lineHeight: `${size}px`, color: rawColor }}\n >\n {fontIconText(icon)}\n </text>\n );\n } else if ('svg' in icon) {\n content = <svg className=\"g9-icon__svg\" content={icon.svg} style={{ width: `${size}px`, height: `${size}px` }} />;\n } else {\n const radius = props.imageCornerRadius ?? 4;\n content = (\n <view className=\"g9-icon__clip\" style={{ borderRadius: `${radius}px` }}>\n {renderImage(icon.image, size)}\n </view>\n );\n }\n }\n return (\n <view className={className} style={box} {...a11y}>\n {content}\n </view>\n );\n});\n"],"names":["g9IconDefaultSize","g9IconDefaultColor","g9IconSvgCache","createGlyphSvgCache","TOKEN","resolveIcon","input","registry","toIcon","isG9Glyph","G9Error","tokenValue","theme","variable","token","Object","cssVariableName","noStore","useResolvedColor","color","store","_TOKEN_exec","source","resolved","useSyncExternalStore","_tokenValue","renderDefaultImage","size","style","svg","image","useG9ImageRenderer","_useContext","G9SettingsContext","G9Icon","memo","props","_props_size","_props_weight","_props_color","core","useContext","G9CoreContext","settings","culture","G9CultureContext","renderImage","weight","rawColor","icon","useMemo","glyph","undefined","svg1","mirrored","box","a11y","className","content","isIconEmpty","isFontIcon","text","fontIconText","_props_imageCornerRadius","radius","view"],"mappings":";;;;AAuBO,MAAMA,oBAAoB;AAE1B,MAAMC,qBAAqB;AAM3B,MAAMC,iBAAiBC;AAmC9B,MAAMC,QAAQ;AAEd,SAASC,YAAYC,KAAkB,EAAEC,QAAwC;IAC/E,IAAI,AAAiB,YAAjB,OAAOD,OAAoB,OAAOE,OAAOF;IAC7C,IAAIG,UAAUH,QAAQ,OAAOE,OAAOF;IACpC,IAAI,CAACC,UACH,MAAM,IAAIG,QAAQ,gBAAgB,CAAC,CAAC,EAAEJ,MAAM,+DAA+D,CAAC;IAE9G,OAAOC,SAAS,KAAK,CAACD;AACxB;AAEA,SAASK,WAAWC,KAAsB,EAAEC,QAAgB;IAC1D,KAAK,MAAMC,SAASC,OAAO,IAAI,CAACH,MAAM,OAAO,EAC3C,IAAII,gBAAgBF,WAAWD,UAAU,OAAOD,MAAM,OAAO,CAACE,MAAM;AAGxE;AAEA,MAAMG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SAAS,EAAE,GAAG,IAAI;IAE1E,IAAIsB,UAAqB;IACzB,IAAIL,AAAQD,WAARC,MACFK,WAAW7B,IAAI,UAAU,eAAe,SAASwB,MAAK,OAAO;QAAE,OAAO,GAAG1B,KAAK,EAAE,CAAC;QAAE,QAAQ,GAAGA,KAAK,EAAE,CAAC;IAAC;SAClG,IAAIsB,QAAQ,CAACU,YAAYV,OAC9B,IAAIW,WAAWX,OACbS,WACGG,KACC,UAAU,iBACV,OAAO;QAAE,YAAYZ,KAAK,IAAI;QAAE,UAAU,GAAGtB,KAAK,EAAE,CAAC;QAAE,YAAY,GAAGA,KAAK,EAAE,CAAC;QAAE,OAAOqB;IAAS,GACjG;UACC,CAACc,aAAab,MAAM;QACtB,EAAEY;SAEC,IAAI,SAASZ,MAClBS,WAAW7B,IAAI,UAAU,eAAe,SAASoB,KAAK,GAAG,EAAE,OAAO;QAAE,OAAO,GAAGtB,KAAK,EAAE,CAAC;QAAE,QAAQ,GAAGA,KAAK,EAAE,CAAC;IAAC;SACvG;YACUoC;QAAf,MAAMC,SAAS,QAAAD,CAAAA,2BAAAA,MAAM,iBAAiB,AAAD,IAAtBA,2BAA2B;QAC1CL,WACGO,KAAK,UAAU,gBAAgB,OAAO;YAAE,cAAc,GAAGD,OAAO,EAAE,CAAC;QAAC,GAAG;UACtE,CAAClB,YAAYG,KAAK,KAAK,EAAEtB,MAAM;QACjC,EAAEsC;IAEN;IAEF,QACGA,KAAK,WAAWR,WAAW,OAAOF,MAAM,GAAGC,IAAI,EAAE;MAChD,CAACE,QAAQ;IACX,EAAEO;AAEN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon/slot.jsx","sources":["../../src/icon/slot.tsx"],"sourcesContent":["import { type G9ImageSource, iconSignature, isIconEmpty } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { G9Icon, type G9IconInput, g9IconDefaultColor, g9IconDefaultSize, useG9ImageRenderer } from './icon';\n\n/**\n * The four ways a control's icon slot can be filled (MAUI `G9IconFactory` arguments). Precedence when several are set:\n * emoji → icon → image path → image source; set only one.\n */\nexport interface G9IconSlotInput {\n /** Emoji text drawn as text. */\n readonly emoji?: string | null | undefined;\n /** An icon (or glyph / icon-font name). */\n readonly icon?: G9IconInput | undefined;\n /** An image path: `http(s)://…` becomes `{ uri }`, anything else a bundled `{ asset }` (MAUI `FromUri` / `FromFile`). */\n readonly imagePath?: string | null | undefined;\n /** An image source. */\n readonly image?: G9ImageSource | null | undefined;\n}\n\nconst isBlank = (value: string | null | undefined): boolean => value == null || value.trim() === '';\n\nfunction hasIconValue(icon: G9IconInput): boolean {\n if (typeof icon === 'string') return icon.trim() !== '' && icon !== 'none';\n return !isIconEmpty(icon);\n}\n\n/** `true` when any of the four inputs is set (MAUI `G9IconFactory.HasIcon`). */\nexport function hasIconSlot(slot: G9IconSlotInput): boolean {\n return !isBlank(slot.emoji) || hasIconValue(slot.icon) || !isBlank(slot.imagePath) || slot.image != null;\n}\n\n/** The image a path-or-source pair stands for (MAUI `G9IconFactory.ResolveImageSource`): the source wins. */\nexport function resolveIconImageSource(\n path: string | null | undefined,\n source: G9ImageSource | null | undefined,\n): G9ImageSource | null {\n if (source != null) return source;\n if (isBlank(path)) return null;\n const trimmed = (path as string).trim();\n return /^https?:\\/\\//i.test(trimmed) ? { uri: trimmed } : { asset: trimmed };\n}\n\nfunction imageSignature(image: G9ImageSource): string {\n const [kind, ref] = Object.entries(image)[0] as [string, string];\n return `${kind}:${ref}`;\n}\n\n/**\n * A stable identity of the slot's content (MAUI `G9IconFactory.Signature`): `e:<emoji>`, `i:<icon signature>`,\n * `p:<path>`, `s:<kind>:<ref>`, or `''`. Use it as a React key or a memo dependency so the slot is rebuilt only when\n * what it shows changes. Unlike MAUI (a hash code for image sources) it is deterministic.\n */\nexport function iconSlotSignature(slot: G9IconSlotInput): string {\n if (!isBlank(slot.emoji)) return `e:${slot.emoji}`;\n if (hasIconValue(slot.icon)) {\n return `i:${typeof slot.icon === 'string' ? slot.icon : iconSignature(slot.icon)}`;\n }\n if (!isBlank(slot.imagePath)) return `p:${slot.imagePath}`;\n return slot.image != null ? `s:${imageSignature(slot.image)}` : '';\n}\n\n/** Props of {@link G9IconSlot}. */\nexport interface G9IconSlotProps extends G9IconSlotInput {\n /** Icon / emoji colour. Default black. */\n readonly color?: string;\n /** Box size. Default 20. */\n readonly size?: number;\n /** Image corner radius. Default 4. */\n readonly imageCornerRadius?: number;\n /** Stroke weight of built-in glyphs. Default 1. */\n readonly weight?: number;\n}\n\n/**\n * Renders one icon slot (MAUI `G9IconFactory.Create`): an emoji as text (no fixed height, an emoji renders taller than\n * its em square), an icon as `G9Icon`, an image through the provider's image renderer in a rounded clip, or a\n * zero-size invisible element when the slot is empty, so callers mount it unconditionally.\n */\nexport function G9IconSlot(props: G9IconSlotProps): ReactNode {\n const renderImage = useG9ImageRenderer();\n const size = props.size ?? g9IconDefaultSize;\n const color = props.color ?? g9IconDefaultColor;\n if (!isBlank(props.emoji)) {\n return (\n <text className=\"g9-icon-emoji\" style={{ fontSize: `${size}px`, width: `${size}px`, color }}>\n {props.emoji}\n </text>\n );\n }\n if (hasIconValue(props.icon)) {\n return <G9Icon icon={props.icon} size={size} color={color} {...(props.weight ? { weight: props.weight } : {})} />;\n }\n const image = resolveIconImageSource(props.imagePath, props.image);\n if (image) {\n return (\n <view\n className=\"g9-icon g9-icon__clip\"\n style={{ width: `${size}px`, height: `${size}px`, borderRadius: `${props.imageCornerRadius ?? 4}px` }}\n >\n {renderImage(image, size)}\n </view>\n );\n }\n return <view className=\"g9-icon-empty\" />;\n}\n"],"names":["isBlank","value","hasIconValue","icon","isIconEmpty","hasIconSlot","slot","resolveIconImageSource","path","source","trimmed","imageSignature","image","kind","ref","Object","iconSlotSignature","iconSignature","G9IconSlot","props","_props_size","_props_color","renderImage","useG9ImageRenderer","size","g9IconDefaultSize","color","g9IconDefaultColor","text","G9Icon","_props_imageCornerRadius","view"],"mappings":";;AAmBA,MAAMA,U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AAClE;AAmBO,SAASY,WAAWC,KAAsB;QAElCC,aACCC;IAFd,MAAMC,cAAcC;IACpB,MAAMC,OAAO,QAAAJ,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAcK;IAC3B,MAAMC,QAAQ,QAAAL,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAeM;IAC7B,IAAI,CAAC3B,QAAQmB,MAAM,KAAK,GACtB,QACGS,KAAK,UAAU,gBAAgB,OAAO;QAAE,UAAU,GAAGJ,KAAK,EAAE,CAAC;QAAE,OAAO,GAAGA,KAAK,EAAE,CAAC;QAAEE;IAAM,GAAG;QAC3F,CAACP,MAAM,KAAK,CAAC;MACf,EAAES;IAGN,IAAI1B,aAAaiB,MAAM,IAAI,GACzB,QAAQU,OAAO,MAAMV,MAAM,IAAI,EAAE,MAAMK,MAAM,OAAOE,QAAQ,GAAIP,MAAM,MAAM,GAAG;QAAE,QAAQA,MAAM,MAAM;IAAC,IAAI,CAAC,CAAC;IAE9G,MAAMP,QAAQL,uBAAuBY,MAAM,SAAS,EAAEA,MAAM,KAAK;IACjE,IAAIP,OAAO;YAI8DkB;QAHvE,QACGC,KACC,UAAU,wBACV,OAAO;YAAE,OAAO,GAAGP,KAAK,EAAE,CAAC;YAAE,QAAQ,GAAGA,KAAK,EAAE,CAAC;YAAE,cAAc,GAAG,QAAAM,CAAAA,2BAAAA,MAAM,iBAAiB,AAAD,IAAtBA,2BAA2B,EAAE,EAAE,CAAC;QAAC,GACrG;QACC,CAACR,YAAYV,OAAOY,MAAM;MAC5B,EAAEO;IAEN;IACA,QAAQA,KAAK,UAAU;AACzB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon/swatch.jsx","sources":["../../src/icon/swatch.tsx"],"sourcesContent":["import { type G9Color, hasSwatch } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useContext } from '@lynx-js/react';\nimport { G9CultureContext } from '../provider/contexts';\n\n/** Props of {@link G9Swatch}. */\nexport interface G9SwatchProps {\n /** The first stored colour (a variety's `FirstColor`). */\n readonly first?: G9Color | null | undefined;\n /** The second stored colour (a variety's `SecondColor`). */\n readonly second?: G9Color | null | undefined;\n /** Diameter in px. Default 18 (MAUI `G9Metrics.SelectionIconSize`). */\n readonly size?: number;\n /**\n * Which side the first half of a two-colour swatch sits on: its reading start, as a MAUI `Grid` column 0 does under\n * the inherited `FlowDirection`. Default the provider's culture direction (LTR without a provider).\n */\n readonly direction?: 'ltr' | 'rtl';\n /** Extra class names (spacing next to a label). */\n readonly className?: string;\n}\n\n/** The default swatch diameter (MAUI `G9Metrics.SelectionIconSize`). */\nexport const g9SwatchDefaultSize = 18;\n\n/**\n * The variety colour swatch shown in place of an icon for items that only carry stored colours (MAUI\n * `G9Visuals.CreateSwatch`), ONE convention for every surface that shows a variety (picker and combo triggers,\n * selection-sheet rows, read-only displays): no colour → a zero-size invisible element (mount it unconditionally),\n * one colour (first or second) → a solid circle, two → a circle split into two vertical halves, first at the reading\n * start. Never a touch target.\n */\nexport function G9Swatch(props: G9SwatchProps): ReactNode {\n const culture = useContext(G9CultureContext);\n // A blank stored colour (an empty database column) is no colour, as a null MAUI `Color?` is.\n const first = props.first?.trim() ? props.first : null;\n const second = props.second?.trim() ? props.second : null;\n const className = props.className ? ` ${props.className}` : '';\n if (!hasSwatch(first, second)) return <view className={`g9-icon-empty${className}`} />;\n const size = props.size ?? g9SwatchDefaultSize;\n const both = first !== null && second !== null;\n const towards = (props.direction ?? culture?.culture.direction ?? 'ltr') === 'rtl' ? 'left' : 'right';\n return (\n <view\n className={`g9-swatch${className}`}\n accessibility-element={false}\n style={{\n width: `${size}px`,\n height: `${size}px`,\n borderRadius: `${size / 2}px`,\n background: both\n ? `linear-gradient(to ${towards}, ${first} 50%, ${second} 50%)`\n : ((first ?? second) as string),\n }}\n />\n );\n}\n"],"names":["g9SwatchDefaultSize","G9Swatch","props","_props_size","_ref","_props_first","_props_second","culture","useContext","G9CultureContext","first","second","className","hasSwatch","view","size","both","tow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 -1 +0,0 @@
1
- {"version":3,"file":"pickers/combo-box.jsx","sources":["../../src/pickers/combo-box.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport { buildSolidOrGradient, fillToCss, G9StringKey, type G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { type G9SelectionItem, isAvatarImage, selectionKey } from '../base/selection-item';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { showSelectionSheet } from '../selection/selection-sheet';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n type G9PickerFieldProps,\n PickerField,\n SelectionValueIcon,\n usePickerOpen,\n valueDirection,\n valueDirectionClass,\n} from './trigger';\n\n/** Chips shown in the box before the `+N` overflow chip (MAUI combo). */\nexport const g9ComboMaxChips = 2;\n\n/** Props of {@link G9ComboBox}. */\nexport interface G9ComboBoxProps<T extends G9SelectionItem = G9SelectionItem> extends G9PickerFieldProps {\n /** The rows (MAUI `ItemsSource`). Disabled items are left out except selected ones (shown dimmed). */\n readonly items: ReadonlyArray<T>;\n /** Multi-selection (MAUI `AllowMultipleSelection`): `values` instead of `value`, Done commits. Default false. */\n readonly allowMultiple?: boolean;\n /** Single mode: the selected key (MAUI `SelectedItem`). */\n readonly value?: string | null;\n readonly defaultValue?: string | null;\n readonly onValueChange?: (key: string | null, item: T | null) => void;\n /** Multi mode: the selected keys, in list order (MAUI `SelectedItems`). */\n readonly values?: ReadonlyArray<string>;\n readonly defaultValues?: ReadonlyArray<string>;\n readonly onValuesChange?: (keys: ReadonlyArray<string>, items: ReadonlyArray<T>) => void;\n /** Sheet title; default the label, else the placeholder. */\n readonly sheetTitle?: string | null;\n /** Text when the search finds nothing (MAUI `EmptyStateText`, default localized \"No results\"). */\n readonly emptyStateText?: string | null;\n /** A × in the trailing slot clears the selection while there is one (MAUI `ClearButton`). Default true. */\n readonly clearButton?: boolean;\n /** Direction of the value/chips and the sheet rows (MAUI `ValueTextDirection`). Default follows the culture. */\n readonly valueTextDirection?: G9TextInputDirection;\n /**\n * How a multi-select field draws its chosen items (MAUI 1.4.10 `ChipStyle`): `'filled'` (default — primary chips) or\n * `'tonal'` — light pills (SurfaceContainerLow, an OutlineVariant hairline, TextPrimary 14) each with its own «×» that\n * removes that one item without opening the sheet. Pair with `clearButton={false}` to keep the trailing glyph (AgriPad).\n */\n readonly chipStyle?: G9ComboBoxChipStyle;\n}\n\n/** MAUI `G9ComboBoxChipStyle`. */\nexport type G9ComboBoxChipStyle = 'filled' | 'tonal';\n\n/** Two key lists hold the same keys in the same order. */\nexport function sameSelectionKeys(a: ReadonlyArray<string>, b: ReadonlyArray<string>): boolean {\n return a.length === b.length && a.every((k, i) => k === b[i]);\n}\nconst sameKeys = sameSelectionKeys;\n\n/**\n * Searchable single or multi selection in an outlined box (MAUI `G9ComboBox`). The sheet always has search. Single:\n * only a pick writes the value; a dismissal leaves it. Multi: Done commits, and so does dismissing a sheet whose\n * selection changed; an untouched dismissal writes nothing. The box shows the value (icon or swatch + text), or up\n * to two chips and a `+N` chip; with `clearButton` the trailing search glyph becomes × while there is a value and a\n * tap on it clears without opening. A result that arrives after the field unmounted, or after a newer open, is\n * dropped.\n */\nexport function G9ComboBox<T extends G9SelectionItem = G9SelectionItem>(props: G9ComboBoxProps<T>): ReactNode {\n const sheets = useG9Sheets();\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const culture = useG9Direction();\n const primary = useG9Theme().palette.Primary;\n const open = usePickerOpen();\n const multiple = props.allowMultiple === true;\n const byKey = (keys: ReadonlyArray<string>) =>\n keys.map((k) => props.items.find((i) => selectionKey(i) === k)).filter((i): i is T => i !== undefined);\n const [key, setKey] = useControllableState<string | null, [T | null]>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9ComboBox.value',\n });\n const [keys, setKeys] = useControllableState<ReadonlyArray<string>, [ReadonlyArray<T>]>({\n value: props.values,\n defaultValue: props.defaultValues ?? [],\n onChange: props.onValuesChange,\n name: 'G9ComboBox.values',\n equals: sameKeys,\n });\n const latest = useRef({ props, key, keys });\n latest.current = { props, key, keys };\n\n const selected = multiple ? byKey(keys) : byKey(key === null ? [] : [key]);\n const hasValue = selected.length > 0;\n const blocked = props.disabled === true || props.readOnly === true;\n\n const clear = () => {\n if (multiple) setKeys([], []);\n else setKey(null, null);\n };\n // A tonal chip's «×» (MAUI RemoveSelected): one item out, the sheet stays closed (catchtap keeps the box's tap away).\n const removeOne = (item: T) => {\n if (blocked) return;\n const k = selectionKey(item);\n const next = latest.current.keys.filter((x) => x !== k);\n if (next.length !== latest.current.keys.length) setKeys(next, byKey(next));\n };\n const tonal = props.chipStyle === 'tonal';\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const { props: p, key: k, keys: ks } = latest.current;\n const current = p.allowMultiple ? ks : k === null ? [] : [k];\n const picked = current\n .map((c) => p.items.find((i) => selectionKey(i) === c))\n .filter((i): i is T => i !== undefined);\n const items = p.items.filter((i) => i.isEnabled !== false || picked.includes(i));\n if (items.length === 0) return;\n const result = await showSelectionSheet(sheets, {\n title: p.sheetTitle?.trim() ? p.sheetTitle : (p.label ?? p.placeholder ?? ''),\n items,\n selectedItems: picked,\n allowMultiple: p.allowMultiple === true,\n closeOnSingleSelection: p.allowMultiple !== true,\n showSearch: true,\n emptyText: p.emptyStateText ?? strings.get(G9StringKey.NoResults),\n ...(p.valueTextDirection ? { itemTextDirection: p.valueTextDirection } : {}),\n });\n if (!isCurrent()) return;\n if (p.allowMultiple) {\n if (!result.wasAccepted && !result.selectionChanged) return;\n const next = result.items.map(selectionKey);\n if (sameKeys(next, latest.current.keys)) return;\n setKeys(next, result.items);\n } else if (result.wasAccepted) {\n const item = result.items[0] ?? null;\n setKey(item ? selectionKey(item) : null, item);\n }\n });\n\n const showClear = props.clearButton !== false && hasValue && !blocked;\n const dir = valueDirectionClass(props.valueTextDirection, culture);\n const row = g9RowStyle(valueDirection(props.valueTextDirection, culture));\n return (\n <PickerField\n field={{ trailingIcon: glyphs.search, ...props }}\n hasValue={hasValue}\n onOpen={onOpen}\n trailingAffordance={\n showClear\n ? { icon: glyphs.clear, signature: 'clear', label: strings.get(G9StringKey.Clear), onPress: clear }\n : null\n }\n >\n <view className={`g9-combo__value ${dir}`} style={row}>\n {multiple && hasValue ? (\n <view className=\"g9-combo__chips\" style={row}>\n {selected.slice(0, g9ComboMaxChips).map((item) =>\n tonal ? (\n <TonalChip\n key={selectionKey(item)}\n item={item}\n row={row}\n rtl={valueDirection(props.valueTextDirection, culture) === 'rtl'}\n removable={!blocked}\n onRemove={() => removeOne(item)}\n />\n ) : (\n // MAUI G9Colors.BuildSolidOrGradient(palette.Primary, useGradient: true).\n <view\n key={selectionKey(item)}\n className=\"g9-combo__chip\"\n style={{ ...row, background: fillToCss(buildSolidOrGradient(primary, true)) }}\n >\n <SelectionValueIcon item={item} color=\"var(--g9-on-primary)\" inChip />\n <text className=\"g9-combo__chip-text\" text-maxline=\"1\">\n {item.text}\n </text>\n </view>\n ),\n )}\n {selected.length > g9ComboMaxChips ? (\n <view className=\"g9-combo__chip g9-combo__chip--more\">\n <text className=\"g9-combo__chip-text\">{`+${selected.length - g9ComboMaxChips}`}</text>\n </view>\n ) : null}\n </view>\n ) : (\n [\n hasValue ? <SelectionValueIcon key=\"i\" item={selected[0] as T} /> : null,\n <text\n key=\"t\"\n className={`g9-picker__text${hasValue ? '' : ' g9-picker__text--placeholder'}`}\n text-maxline=\"1\"\n >\n {hasValue ? (selected[0] as T).text : (resolveRestingPlaceholder(props) ?? '')}\n </text>,\n ]\n )}\n </view>\n </PickerField>\n );\n}\n\n/**\n * A `chipStyle: 'tonal'` chip (MAUI 1.4.10 `CreateTonalChip`): 34 high, fully rounded, SurfaceContainerLow on a 1 px\n * OutlineVariant hairline, padding 10 at the start and 6 at the end, 4 after it; an icon (never an avatar) at 14, the text\n * in TextPrimary 14, then a 24 px «×» (TextTertiary 16) that removes this item. Only the «×» takes the tap — the rest of\n * the chip lets it through to the field, which opens the sheet.\n */\nfunction TonalChip(props: {\n readonly item: G9SelectionItem;\n readonly row: ReturnType<typeof g9RowStyle>;\n readonly rtl: boolean;\n readonly removable: boolean;\n readonly onRemove: () => void;\n}): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const { item } = props;\n const icon = {\n emoji: item.emoji ?? null,\n icon: item.icon,\n imagePath: item.iconPath ?? null,\n image: item.iconImage ?? null,\n };\n return (\n // Physical sides from the row's direction (a row never relies on CSS `direction` — Lynxtron ignores it).\n <view\n className=\"g9-combo__tonal\"\n style={{\n ...props.row,\n ...(props.rtl\n ? { paddingRight: '10px', paddingLeft: '6px', marginLeft: '4px' }\n : { paddingLeft: '10px', paddingRight: '6px', marginRight: '4px' }),\n }}\n >\n {!isAvatarImage(item) && hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={14} color={item.iconTintColor ?? 'var(--g9-on-surface-variant)'} />\n ) : null}\n <text className=\"g9-combo__tonal-text\" text-maxline=\"1\">\n {item.text}\n </text>\n <view\n className=\"g9-combo__tonal-close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={item.text}\n {...(props.removable ? { catchtap: props.onRemove } : {})}\n >\n <G9IconSlot icon={glyphs.clear} size={16} color=\"var(--g9-text-tertiary)\" />\n </view>\n </view>\n );\n}\n"],"names":["g9ComboMaxChips","sameSelectionKeys","a","b","k","i","sameKeys","G9ComboBox","props","_props_defaultValue","_props_defaultValues","_resolveRestingPlaceholder","sheets","useG9Sheets","glyphs","useG9Settings","strings","useG9Strings","culture","useG9Direction","primary","useG9Theme","open","usePickerOpen","multiple","byKey","keys","selectionKey","undefined","key","setKey","useControllableState","setKeys","latest","useRef","selected","hasValue","blocked","clear","removeOne","item","next","x","tonal","onOpen","isCurrent","_ref","_p_emptyStateText","_p_sheetTitle","p","ks","current","picked","c","items","result","showSelectionSheet","G9StringKey","_result_items_","showClear","dir","valueDirectionClass","row","g9RowStyle","valueDirection","PickerField","view","TonalChip","fillToCss","buildSolidOrGradient","SelectionValueIcon","text","_item_emoji","_item_iconPath","_item_iconImage","_item_iconTintColor","icon","isAvatarImage","hasIconSlot","G9IconSlot"],"mappings":";;;;;;;;;;;;AAqBO,MAAMA,kBAAkB;AAoCxB,SAASC,kBAAkBC,CAAwB,EAAEC,CAAwB;IAClF,OAAOD,EAAE,MAAM,KAAKC,EAAE,MAAM,IAAID,EAAE,KAAK,CAAC,CAACE,GAAGC,IAAMD,MAAMD,CAAC,CAACE,EAAE;AAC9D;AACA,MAAMC,WAAWL;AAUV,SAASM,WAAwDC,KAAyB;QAY/EC,qBAMAC,sBA+GmCC;IAhInD,MAAMC,SAASC;IACf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO,CAAC,OAAO;IAC5C,MAAMC,OAAOC;IACb,MAAMC,WAAWhB,AAAwB,SAAxBA,MAAM,aAAa;IACpC,MAAMiB,QAAQ,CAACC,OACbA,KAAK,GAAG,CAAC,CAACtB,IAAMI,MAAM,KAAK,CAAC,IAAI,CAAC,CAACH,IAAMsB,aAAatB,OAAOD,IAAI,MAAM,CAAC,CAACC,IAAcA,AAAMuB,WAANvB;IACxF,MAAM,CAACwB,KAAKC,OAAO,GAAGC,qBAAgD;QACpE,OAAOvB,MAAM,KAAK;QAClB,cAAc,QAAAC,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB;QACpC,UAAUD,MAAM,aAAa;QAC7B,MAAM;IACR;IACA,MAAM,CAACkB,MAAMM,QAAQ,GAAGD,qBAAgE;QACtF,OAAOvB,MAAM,MAAM;QACnB,cAAc,QAAAE,CAAAA,uBAAAA,MAAM,aAAa,AAAD,IAAlBA,uBAAuB,EAAE;QACvC,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ACb,EAAE+B,KAAK;MACP,CAACL,KACC,UAAU,wBACV,uBAAuB,MACvB,qBAAqB,SACrB,qBAAqB1B,KAAK,IAAI,GAC7B,GAAIhC,MAAM,SAAS,GAAG;QAAE,UAAUA,MAAM,QAAQ;IAAC,IAAI,CAAC,CAAC,EACzD;QACC,CAACuE,WAAW,MAAMjE,OAAO,KAAK,EAAE,MAAM,IAAI,MAAM,2BAA4B;MAC9E,EAAEoD,KAAK;IACT,EAAEA;AAEN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pickers/date-time-picker.jsx","sources":["../../src/pickers/date-time-picker.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport {\n daysInMonth,\n formatColor,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n G9StringKey,\n localDateTimeFromDate,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Service, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n asDateTime,\n clampPickerValue,\n composePickerValue,\n dayWheelItems,\n formatPickerValue,\n hourWheelItems,\n minuteWheelItems,\n monthWheelItems,\n normalizePickerBounds,\n pickerParts,\n resolvePickerCalendar,\n yearWheelItems,\n yearWindow,\n} from './date-time';\nimport { PickerSheetHeader, showPickerSheet } from './picker-sheet';\nimport { type G9PickerFieldProps, PickerField, usePickerOpen } from './trigger';\nimport { G9WheelColumn } from './wheel-column';\n\n/** Years the year window grows by at an edge (MAUI `YearWindowStep`: 12 since 1.4.11, was 25). */\nexport const g9YearWindowStep = 12;\n\n/** Props of {@link G9DateTimePicker}. */\nexport interface G9DateTimePickerProps extends G9PickerFieldProps {\n /** The value, always Gregorian (MAUI `SelectedDateTime`); `null` = none. Controlled with `onValueChange`. */\n readonly value?: G9LocalDateTime | null;\n readonly defaultValue?: G9LocalDateTime | null;\n readonly onValueChange?: (value: G9LocalDateTime | null) => void;\n /** Default `'date'`. */\n readonly mode?: G9DateTimePickerMode;\n /** Default `'shortDate'`. */\n readonly displayFormat?: G9DateTimeDisplayFormat;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`). */\n readonly formattedDisplayText?: string | null;\n readonly minDate?: G9LocalDate | null;\n readonly maxDate?: G9LocalDate | null;\n /** Hours 0–23 instead of 12-hour AM/PM. Default false. */\n readonly twentyFourHourDisplay?: boolean;\n /**\n * Default true (MAUI `RestoreOnCancel`): Cancel or a dismissal puts back the value the picker had when it opened if\n * it changed meanwhile. False leaves the current value.\n */\n readonly restoreOnCancel?: boolean;\n /** The Today / Now chip. Default true. */\n readonly showTodayButton?: boolean;\n /** Calendar override; default Persian for `fa`, else Gregorian (follows the language, not the direction). */\n readonly calendar?: G9CalendarSystem | null;\n /** Done confirmed a value (MAUI `DateTimeSelected`). */\n readonly onDateTimeSelected?: (value: G9LocalDateTime) => void;\n}\n\ninterface SheetBodyProps {\n readonly title: string;\n readonly initial: G9LocalDateTime;\n readonly now: () => G9LocalDateTime;\n readonly mode: G9DateTimePickerMode;\n readonly calendar: G9CalendarSystem;\n readonly culture: G9Culture;\n readonly bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null };\n readonly twentyFourHour: boolean;\n readonly showToday: boolean;\n readonly format: (value: G9LocalDateTime) => string;\n readonly done: (value: G9LocalDateTime) => void;\n readonly cancel: () => void;\n}\n\n/** The drum sheet body (MAUI `G9DateTimePickerSheet`): header, live preview, Today/Now chip, the wheels. */\nexport function DateTimeSheetBody(props: SheetBodyProps): ReactNode {\n const strings = useG9Strings();\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const { calendar, culture, bounds, mode } = props;\n const [value, setValueState] = useState(() => clampPickerValue(props.initial, bounds, calendar));\n // The latest value, written synchronously: a wheel that settles and a Done tap (or a second wheel) can arrive before\n // the re-render binds handlers that close over the new state. Reading the render's `value` there returned the old\n // one, and a second wheel overwrote the first (seen on the Windows CI agent, Azure builds 539/541).\n const latest = useRef(value);\n const setValue = (next: G9LocalDateTime) => {\n latest.current = next;\n setValueState(next);\n };\n const partsOf = (v: G9LocalDateTime) => ({ ...pickerParts(v, calendar), hour: v.hour, minute: v.minute });\n const parts = partsOf(value);\n const minYear = bounds.min ? pickerParts(bounds.min, calendar).year : null;\n const maxYear = bounds.max ? pickerParts(bounds.max, calendar).year : null;\n const [years, setYears] = useState(() => yearWindow(parts.year, minYear, maxYear));\n // A value outside the window (Today, a clamp) rebuilds it around the value.\n const window_ = parts.year < years.from || parts.year > years.to ? yearWindow(parts.year, minYear, maxYear) : years;\n const change = (patch: Partial<typeof parts>) =>\n setValue(composePickerValue({ ...partsOf(latest.current), ...patch }, calendar, bounds));\n const grow = (edge: 'start' | 'end') =>\n setYears((w) =>\n edge === 'end'\n ? { from: w.from, to: Math.min(maxYear ?? 9999, 9999, w.to + g9YearWindowStep) }\n : { from: Math.max(minYear ?? 1, 1, w.from - g9YearWindowStep), to: w.to },\n );\n const today = useG9Press(\n () => {\n const now = props.now();\n setValue(clampPickerValue(mode === G9DateTimePickerMode.Date ? asDateTime(now) : now, bounds, calendar));\n },\n { source: 'G9DateTimePicker', guardMs: 0 },\n );\n const showDate = mode !== G9DateTimePickerMode.Time;\n const showTime = mode !== G9DateTimePickerMode.Date;\n return (\n <view className=\"g9-picker-sheet\">\n <PickerSheetHeader title={props.title} onCancel={props.cancel} onDone={() => props.done(latest.current)} />\n <text className=\"g9-picker-sheet__preview\" text-maxline=\"1\">\n {props.format(value)}\n </text>\n {props.showToday ? (\n // MAUI CreateTodayChip: a 14 dp calendar and 12 bold Primary text, 6 apart, in a pill of Primary 8 % with a\n // Primary 30 % stroke.\n <view\n className=\"g9-picker-sheet__today\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n bindtap={today}\n style={{\n ...g9RowStyle(culture.direction),\n backgroundColor: formatColor(withAlpha(palette.Primary, 0.08)),\n borderColor: formatColor(withAlpha(palette.Primary, 0.3)),\n }}\n >\n <G9IconSlot icon={glyphs.calendarToday} size={14} color={palette.Primary} />\n <text className=\"g9-picker-sheet__today-text\">\n {strings.get(mode === G9DateTimePickerMode.Time ? G9StringKey.Now : G9StringKey.Today)}\n </text>\n </view>\n ) : null}\n <view className={`g9-picker-sheet__wheels g9-dir-${culture.direction}`}>\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Day)}\n items={dayWheelItems(daysInMonth(calendar, parts.year, parts.month), culture)}\n value={parts.day}\n onValueChange={(day) => change({ day })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Month)}\n weight={1.7}\n items={monthWheelItems(calendar, culture)}\n value={parts.month}\n onValueChange={(month) => change({ month })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Year)}\n items={yearWheelItems(window_.from, window_.to, culture)}\n value={parts.year}\n onValueChange={(year) => change({ year })}\n onNearEdge={grow}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Hour)}\n items={hourWheelItems(props.twentyFourHour, culture)}\n value={parts.hour}\n onValueChange={(hour) => change({ hour })}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Minute)}\n items={minuteWheelItems(culture)}\n value={parts.minute}\n onValueChange={(minute) => change({ minute })}\n />\n ) : null}\n </view>\n </view>\n );\n}\n\n/**\n * Date, time or date-time in an outlined box (MAUI `G9DateTimePicker`): a tap opens the drum sheet (Cancel, title,\n * Done, live preview, Today/Now, day/month/year and hour/minute wheels). The calendar follows the language (`fa` →\n * Persian) unless `calendar` is set; the value stays Gregorian. Min/max clamp the drums (they roll onto the clamped\n * value); a day past the month's end clamps to its last day. Done writes the value and fires `onDateTimeSelected`;\n * Cancel and dismissals write nothing (see `restoreOnCancel`). Must be inside a `G9Host`.\n */\nexport function G9DateTimePicker(props: G9DateTimePickerProps): ReactNode {\n const sheets = useG9Sheets();\n const culture = useG9Culture();\n const strings = useG9Strings();\n const glyphs = useG9Settings().glyphs;\n const clock = useG9Service('clock');\n const open = usePickerOpen();\n const [value, setValue] = useControllableState<G9LocalDateTime | null>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9DateTimePicker.value',\n });\n const latest = useRef({ props, value });\n latest.current = { props, value };\n const mode = props.mode ?? G9DateTimePickerMode.Date;\n const calendar = resolvePickerCalendar(culture, props.calendar);\n const format = (v: G9LocalDateTime) =>\n formatPickerValue(v, culture, {\n mode,\n displayFormat: props.displayFormat ?? G9DateTimeDisplayFormat.ShortDate,\n twentyFourHour: props.twentyFourHourDisplay === true,\n calendar,\n customText: props.formattedDisplayText ?? null,\n });\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const previous = latest.current.value;\n const p = latest.current.props;\n const now = () => localDateTimeFromDate(new Date(clock.now()));\n const title = p.label?.trim()\n ? p.label\n : strings.get(\n mode === G9DateTimePickerMode.Time\n ? G9StringKey.SelectTime\n : mode === G9DateTimePickerMode.DateTime\n ? G9StringKey.SelectDateTime\n : G9StringKey.SelectDate,\n );\n const bounds = normalizePickerBounds(p.minDate, p.maxDate, calendar);\n const result = await showPickerSheet<G9LocalDateTime>(sheets, ({ done, cancel }) => (\n <DateTimeSheetBody\n title={title}\n initial={previous ?? now()}\n now={now}\n mode={mode}\n calendar={calendar}\n culture={culture}\n bounds={bounds}\n twentyFourHour={p.twentyFourHourDisplay === true}\n showToday={p.showTodayButton !== false}\n format={format}\n done={done}\n cancel={cancel}\n />\n ));\n if (!isCurrent()) return;\n if (result) {\n setValue(result);\n latest.current.props.onDateTimeSelected?.(result);\n } else if (latest.current.props.restoreOnCancel !== false && latest.current.value !== previous) {\n setValue(previous);\n }\n });\n\n return (\n <PickerField\n field={{ trailingIcon: mode === G9DateTimePickerMode.Time ? glyphs.clock : glyphs.calendar, ...props }}\n hasValue={value !== null}\n onOpen={onOpen}\n >\n <text className={`g9-picker__text${value ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {value ? format(value) : (resolveRestingPlaceholder(props) ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["g9YearWindowStep","DateTimeSheetBody","props","strings","useG9Strings","palette","useG9Theme","glyphs","useG9Settings","calendar","culture","bounds","mode","value","setValueState","useState","clampPickerValue","latest","useRef","setValue","next","partsOf","v","pickerParts","parts","minYear","maxYear","years","setYears","yearWindow","window_","change","patch","composePickerValue","grow","edge","w","Math","today","useG9Press","now","G9DateTimePickerMode","asDateTime","showDate","showTime","view","PickerSheetHeader","text","g9RowStyle","formatColor","withAlpha","G9IconSlot","G9StringKey","G9WheelColumn","dayWheelItems","daysInMonth","day","monthWheelItems","month","yearWheelItems","year","hourWheelItems","hour","minuteWheelItems","minute","G9DateTimePicker","_props_defaultValue","_props_mode","_resolveRestingPlaceholder","sheets","useG9Sheets","useG9Culture","clock","useG9Service","open","usePickerOpen","useControllableState","resolvePickerCalendar","format","_props_displayFormat","_props_formattedDisplayText","formatPickerValue","G9DateTimeDisplayFormat","onOpen","isCurrent","_p_label","previous","p","localDateTimeFromDate","Date","title","normalizePickerBounds","result","showPickerSheet","done","cancel","_latest_current_props","PickerField"],"mappings":";;;;;;;;;;;;;;AA0CO,MAAMA,mBAAmB;AA+CzB,SAASC,kBAAkBC,KAAqB;IACrD,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGV;IAC5C,MAAM,CAACW,OAAOC,cAAc,GAAGC,SAAS,IAAMC,iBAAiBd,MAAM,OAAO,EAAES,QAAQF;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AUH,UACV,SAASC,SACT,QAAQC,QACR,gBAAgB4E,AAA4B,SAA5BA,EAAE,qBAAqB,EACvC,WAAWA,AAAsB,UAAtBA,EAAE,eAAe,EAC5B,QAAQT,QACR,MAAMgB,MACN,QAAQC;YAGZ,IAAI,CAACX,aAAa;YAClB,IAAIQ,QAAQ;oBAEVI,0CAAAA;gBADA7E,SAASyE;wBACTI,CAAAA,2CAAAA,AAAAA,CAAAA,wBAAAA,OAAO,OAAO,CAAC,KAAK,AAAD,EAAE,kBAAkB,AAAD,KAAtCA,yCAAAA,IAAAA,CAAAA,uBAA0CJ;YAC5C,OAAO,IAAI3E,AAAyC,UAAzCA,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,IAAcA,OAAO,OAAO,CAAC,KAAK,KAAKqE,UACpFnE,SAASmE;QAEb;IAEF,QACGW,YACC,OAAO;QAAE,cAAcrF,SAAS6B,qBAAqB,IAAI,GAAGlC,OAAO,KAAK,GAAGA,OAAO,QAAQ;QAAE,GAAGL,KAAK;IAAC,GACrG,UAAUW,AAAU,SAAVA,OACV,QAAQsE,QACT;MACC,CAACpC,KAAK,WAAW,CAAC,eAAe,EAAElC,QAAQ,KAAK,iCAAiC,EAAE,aAAa,IAAI;QAClG,CAACA,QAAQiE,OAAOjE,SAAS,QAACuD,CAAAA,6BAAAA,0BAA0BlE,MAAK,IAA/BkE,6BAAoC,GAAI;MACpE,EAAErB,KAAK;IACT,EAAEkD;AAEN"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pickers/date-time.jsx","sources":["../../src/pickers/date-time.ts"],"sourcesContent":["import {\n clampToPersianRange,\n compareLocal,\n daysInMonth,\n formatLocalDateTime,\n fromCalendarDate,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n getMonthNames,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTime,\n toCalendarDate,\n toNativeDigits,\n} from '@g9tm/lynxcontrols-foundation';\n\n// Date math and text of the date/time picker (MAUI `G9DateTimePicker` + `G9DateTimePickerSheet`), Intl-free: every\n// calendar step goes through the foundation calendar functions.\n\n/** One wheel row: the value it stands for and its text. */\nexport interface G9WheelItem<V extends string | number = number> {\n readonly value: V;\n readonly text: string;\n}\n\n/**\n * Year rows are a window of at most ±12 years around the selection (MAUI `YearWindowRadius`; 50 until 1.4.11, when the\n * picker began to open pre-built: every row is paid for in the tap-to-open time, and the window grows at both edges).\n */\nexport const g9YearWindowRadius = 12;\n\n/** The calendar a picker shows: the explicit one, else Persian for a `fa` culture, else Gregorian (MAUI rule). */\nexport function resolvePickerCalendar(culture: G9Culture, calendar?: G9CalendarSystem | null): G9CalendarSystem {\n if (calendar) return calendar;\n return isPersianLanguage(culture) ? 'persian' : 'gregorian';\n}\n\n/** A date-time with its time part (a plain date reads as midnight). */\nexport function asDateTime(value: G9LocalDate): G9LocalDateTime {\n const t = value as Partial<G9LocalDateTime>;\n return localDateTime(\n value.year,\n value.month,\n value.day,\n t.hour ?? 0,\n t.minute ?? 0,\n t.second ?? 0,\n t.millisecond ?? 0,\n );\n}\n\n/**\n * Min/max for a calendar: Persian bounds are pulled into the range the Persian calendar supports (from 0622-03-22),\n * and an inverted pair is swapped.\n */\nexport function normalizePickerBounds(\n min: G9LocalDate | null | undefined,\n max: G9LocalDate | null | undefined,\n calendar: G9CalendarSystem,\n): { min: G9LocalDateTime | null; max: G9LocalDateTime | null } {\n let lo = min ? asDateTime(min) : null;\n let hi = max ? asDateTime(max) : null;\n if (calendar === 'persian') {\n lo = lo ? clampToPersianRange(lo) : null;\n hi = hi ? clampToPersianRange(hi) : null;\n }\n if (lo && hi && compareDateTime(lo, hi) > 0) [lo, hi] = [hi, lo];\n return { min: lo, max: hi };\n}\n\n/** Orders two date-times (date first, then time). */\nexport function compareDateTime(a: G9LocalDateTime, b: G9LocalDateTime): number {\n const d = compareLocal(a, b);\n if (d !== 0) return d;\n return (\n a.hour * 3_600_000 +\n a.minute * 60_000 +\n a.second * 1000 +\n a.millisecond -\n (b.hour * 3_600_000 + b.minute * 60_000 + b.second * 1000 + b.millisecond)\n );\n}\n\n/** Clamps a value into `[min, max]` (either bound optional) and, for Persian, into the supported range. */\nexport function clampPickerValue(\n value: G9LocalDateTime,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n calendar: G9CalendarSystem,\n): G9LocalDateTime {\n let v = calendar === 'persian' ? clampToPersianRange(value) : value;\n if (bounds.min && compareDateTime(v, bounds.min) < 0) v = bounds.min;\n if (bounds.max && compareDateTime(v, bounds.max) > 0) v = bounds.max;\n return v;\n}\n\n/** The value's parts in the picker calendar (what the day/month/year wheels show). */\nexport function pickerParts(\n value: G9LocalDateTime,\n calendar: G9CalendarSystem,\n): {\n year: number;\n month: number;\n day: number;\n} {\n const c = toCalendarDate(value, calendar);\n return { year: c.year, month: c.month, day: c.day };\n}\n\n/**\n * Builds the value from wheel parts: the day is clamped to the month's length (31 Farvardin → 30 Mehr, 29 Feb → 28\n * in a common year, Esfand 30 → 29), then the result is clamped to the bounds.\n */\nexport function composePickerValue(\n parts: { year: number; month: number; day: number; hour: number; minute: number },\n calendar: G9CalendarSystem,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n): G9LocalDateTime {\n const day = Math.min(parts.day, daysInMonth(calendar, parts.year, parts.month));\n const date = fromCalendarDate({ calendar, year: parts.year, month: parts.month, day });\n return clampPickerValue(localDateTime(date.year, date.month, date.day, parts.hour, parts.minute), bounds, calendar);\n}\n\nconst digits = (culture: G9Culture, n: number, width: number) =>\n toNativeDigits(String(n).padStart(width, '0'), culture.numberingSystem);\n\n/** Day rows 1…count (two digits, native numerals). */\nexport function dayWheelItems(count: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: count }, (_, i) => ({ value: i + 1, text: digits(culture, i + 1, 2) }));\n}\n\n/** Month rows with the calendar's month names. */\nexport function monthWheelItems(calendar: G9CalendarSystem, culture: G9Culture): G9WheelItem[] {\n return getMonthNames(calendar, culture).map((text, i) => ({ value: i + 1, text }));\n}\n\n/**\n * The year window (MAUI `BuildYears`): ±{@link g9YearWindowRadius} around `year`, inside the bounds' years (and the\n * calendar's 1…9999 range).\n */\nexport function yearWindow(year: number, minYear: number | null, maxYear: number | null): { from: number; to: number } {\n const lo = Math.max(1, minYear ?? 1);\n const hi = Math.min(9999, maxYear ?? 9999);\n return { from: Math.max(lo, year - g9YearWindowRadius), to: Math.min(hi, year + g9YearWindowRadius) };\n}\n\n/** Year rows `from…to` (four digits, native numerals). */\nexport function yearWheelItems(from: number, to: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => ({\n value: from + i,\n text: digits(culture, from + i, 4),\n }));\n}\n\n/** Hour rows 0…23: `HH`, or `hh tt` in 12-hour display (MAUI `BuildHours`). */\nexport function hourWheelItems(twentyFourHour: boolean, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 24 }, (_, h) => ({\n value: h,\n text: formatLocalDateTime(localDateTime(2000, 1, 1, h), twentyFourHour ? 'HH' : 'hh tt', culture, {\n calendar: 'gregorian',\n }),\n }));\n}\n\n/** Minute rows 0…59. */\nexport function minuteWheelItems(culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 60 }, (_, m) => ({ value: m, text: digits(culture, m, 2) }));\n}\n\n/** Options of {@link formatPickerValue}. */\nexport interface G9PickerFormatOptions {\n readonly mode?: G9DateTimePickerMode;\n readonly displayFormat?: G9DateTimeDisplayFormat;\n readonly twentyFourHour?: boolean;\n readonly calendar?: G9CalendarSystem | null;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`); blank falls back to the short date. */\n readonly customText?: string | null;\n}\n\n/**\n * The trigger and preview text (MAUI `FormatValue`). Gregorian: short `d MMM yyyy`, long `MMMM d, yyyy`, time\n * `HH:mm`/`hh:mm tt`, short date-time `d MMM yyyy, HH:mm`, long date-time `MMMM d, yyyy, hh:mm tt`. Persian:\n * `dd MMMM yyyy` and `{date}، {time}` (a date the Persian calendar cannot hold is written Gregorian). The `'time'`\n * mode always shows the time; `'custom'` shows `customText`.\n */\nexport function formatPickerValue(value: G9LocalDate, culture: G9Culture, options: G9PickerFormatOptions = {}): string {\n const format = options.displayFormat ?? G9DateTimeDisplayFormat.ShortDate;\n if (format === G9DateTimeDisplayFormat.Custom && options.customText && options.customText.trim() !== '') {\n return options.customText;\n }\n const v = asDateTime(value);\n const time = options.twentyFourHour ? 'HH:mm' : 'hh:mm tt';\n const calendar = resolvePickerCalendar(culture, options.calendar);\n const effective = options.mode === G9DateTimePickerMode.Time ? G9DateTimeDisplayFormat.TimeOnly : format;\n if (calendar === 'persian' && isSupportedByPersianCalendar(v)) {\n const fmt = (p: string) => formatLocalDateTime(v, p, culture, { calendar: 'persian' });\n const date = fmt('dd MMMM yyyy');\n if (effective === G9DateTimeDisplayFormat.TimeOnly) return fmt(time);\n if (effective === G9DateTimeDisplayFormat.ShortDateTime || effective === G9DateTimeDisplayFormat.LongDateTime) {\n return `${date}، ${fmt(time)}`;\n }\n return date;\n }\n const pattern =\n effective === G9DateTimeDisplayFormat.LongDate\n ? 'MMMM d, yyyy'\n : effective === G9DateTimeDisplayFormat.TimeOnly\n ? time\n : effective === G9DateTimeDisplayFormat.ShortDateTime\n ? 'd MMM yyyy, HH:mm'\n : effective === G9DateTimeDisplayFormat.LongDateTime\n ? 'MMMM d, yyyy, hh:mm tt'\n : 'd MMM yyyy';\n return formatLocalDateTime(v, pattern, culture, { calendar: 'gregorian' });\n}\n"],"names":["g9YearWindowRadius","resolvePickerCalendar","culture","calendar","isPersianLanguage","asDateTime","value","_t_hour","_t_minute","_t_second","_t_millisecond","t","localDateTime","normalizePickerBounds","min","max","lo","hi","clampToPersianRange","compareDateTime","a","b","d","compareLocal","clampPickerValue","bounds","v","pickerParts","c","toCalendarDate","composePickerValue","parts","day","Math","daysInMonth","date","fromCalendarDate","digits","n","width","toNativeDigits","String","dayWheelItems","count","Array","_","i","monthWheelItems","getMonthNames","text","yearWindow","year","minYear","maxYear","yearWheelItems","from","to","hourWheelItems","twentyFourHour","h","formatLocalDateTime","minuteWheelItems","m","formatPickerValue","options","_options_displayFormat","format","G9DateTimeDisplayFormat","time","effective","G9DateTimePickerMode","isSupportedByPersianCalendar","fmt","p","pattern"],"mappings":";AAiCO,MAAMA,qBAAqB;AAG3B,SAASC,sBAAsBC,OAAkB,EAAEC,QAAkC;IAC1F,IAAIA,UAAU,OAAOA;IACrB,OAAOC,kBAAkBF,WAAW,YAAY;AAClD;AAGO,SAASG,WAAWC,KAAkB;QAMzCC,SACAC,WACAC,WACAC;IARF,MAAMC,IAAIL;IACV,OAAOM,cACLN,MAAM,IAAI,EACVA,MAAM,KAAK,EACXA,MAAM,GAAG,UACTC,CAAAA,UAAAA,EAAE,IAAI,AAAD,IAALA,UAAU,WACVC,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY,WACZC,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY,WACZC,CAAAA,iBAAAA,EAAE,WAAW,AAAD,IAAZA,iBAAiB;AAErB;AAMO,SAASG,sBACdC,GAAmC,EACnCC,GAAmC,EACnCZ,QAA0B;IAE1B,IAAIa,KAAKF,MAAMT,WAAWS,OAAO;IACjC,IAAIG,KAAKF,MAAMV,WAAWU,OAAO;IACjC,IAAIZ,AAAa,cAAbA,UAAwB;QAC1Ba,KAAKA,KAAKE,oBAAoBF,MAAM;QACpCC,KAAKA,KAAKC,oBAAoBD,MAAM;IACtC;IACA,IAAID,MAAMC,MAAME,gBAAgBH,IAAIC,MAAM,GAAG,CAACD,IAAIC,GAAG,GAAG;QAACA;QAAID;KAAG;IAChE,OAAO;QAAE,KAAKA;QAAI,KAAKC;IAAG;AAC5B;AAGO,SAASE,gBAAgBC,CAAkB,EAAEC,CAAkB;IACpE,MAAMC,IAAIC,aAAaH,GAAGC;IAC1B,IAAIC,AAAM,MAANA,GAAS,OAAOA;IACpB,OACEF,AAAS,UAAT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,UAAU;IAAY;AAC1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pickers/picker-sheet.jsx","sources":["../../src/pickers/picker-sheet.tsx"],"sourcesContent":["import './pickers.css';\nimport { G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { G9Button } from '../button/button';\nimport { useG9Direction, useG9Strings } from '../provider/hooks';\nimport { useG9SheetContext } from '../sheet/frame';\nimport { fitToContentSheetOptions } from '../sheet/options';\nimport type { G9SheetService } from '../sheet/service';\n\n/** Props a drum sheet body receives: finish with a value (Done) or without (Cancel). */\nexport interface G9PickerSheetBodyProps<T> {\n readonly done: (value: T) => void;\n readonly cancel: () => void;\n}\n\n/**\n * Opens a fit-to-content drum sheet (MAUI `G9DateTimePickerSheet.ShowAsync` / `G9TimeSpanPickerSheet.ShowAsync`) and\n * resolves the value Done returned, or `null` for Cancel, any dismissal, or a throttled open.\n *\n * ⛔ PRE-BUILT (MAUI 1.4.11): the body is built on the tap and opens finished — no spinner, and nothing waits on the\n * open motion. It used to be a factory shown behind a spinner until the sheet had opened plus 369 ms: the only sheet of\n * the suite that visibly «loaded» (MAUI's field report 2026-11-08, Samsung A24: the spinner stayed for seconds). What made\n * an eager build costly is gone with the ±12-year window (`g9YearWindowRadius`).\n */\nexport async function showPickerSheet<T>(\n sheets: G9SheetService,\n body: (props: G9PickerSheetBodyProps<T>) => ReactNode,\n): Promise<T | null> {\n let result: T | null = null;\n let finished = false;\n const Body = () => {\n const handle = useG9SheetContext()?.handle;\n const finish = (value: T | null) => {\n if (finished) return;\n finished = true;\n result = value;\n handle?.close();\n };\n return body({ done: (v) => finish(v), cancel: () => finish(null) });\n };\n const handle = sheets.show(<Body />, { ...fitToContentSheetOptions(), deferContent: false });\n if (!handle) return null;\n await handle.result;\n return result;\n}\n\n/**\n * The drum sheet header (MAUI `G9DateTimePickerSheet` / `G9TimeSpanPickerSheet.CreateHeader`): a Grid \"Auto,*,Auto\" of\n * Padding (16, 10) — Cancel as a small Text-variant G9Button (Primary text in an Outline pill), the title 15 bold\n * TextPrimary, Done as a small Primary G9Button.\n */\nexport function PickerSheetHeader(props: {\n readonly title: string;\n readonly onCancel: () => void;\n readonly onDone: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const direction = useG9Direction();\n return (\n <view className=\"g9-picker-sheet__header\" style={g9RowStyle(direction)}>\n <G9Button\n className=\"g9-picker-sheet__cancel\"\n text={strings.get(G9StringKey.Cancel)}\n variant=\"text\"\n size=\"small\"\n onPress={props.onCancel}\n />\n <text className=\"g9-picker-sheet__title\" text-maxline=\"1\">\n {props.title}\n </text>\n <G9Button\n className=\"g9-picker-sheet__done\"\n text={strings.get(G9StringKey.Done)}\n variant=\"primary\"\n size=\"small\"\n onPress={props.onDone}\n />\n </view>\n );\n}\n"],"names":["showPickerSheet","sheets","body","result","finished","Body","_useG9SheetContext","handle","finish","value","v","fitToContentSheetOptions","PickerSheetHeader","props","strings","useG9Strings","direction","useG9Direction","view","g9RowStyle","G9Button","G9StringKey","text"],"mappings":";;;;;;;AAyBO,eAAeA,gBACpBC,MAAsB,EACtBC,IAAqD;IAErD,IAAIC,SAAmB;IACvB,IAAIC,WAAW;IACf,MAAMC,OAAO;YACIC;QAAf,MAAMC,SAAS,QAAAD,CAAAA,qBAAAA,mBAAkB,IAAlBA,KAAAA,IAAAA,mBAAqB,MAAM;QAC1C,MAAME,SAAS,CAACC;YACd,IAAIL,UAAU;YACdA,WAAW;YACXD,SAASM;YACTF,QAAAA,UAAAA,OAAQ,KAAK;QACf;QACA,OAAOL,KAAK;YAAE,MAAM,CAACQ,IAAMF,OAAOE;YAAI,QAAQ,IAAMF,OAAO;QAAM;IACnE;IACA,MAAMD,SAASN,OAAO,IAAI,EAAEI,QAAS;QAAE,GAAGM,0BAA0B;QAAE,cAAc;IAAM;IAC1F,IAAI,CAACJ,QAAQ,OAAO;IACpB,MAAMA,OAAO,MAAM;IACnB,OAAOJ;AACT;AAOO,SAASS,kBAAkBC,KAIjC;IACC,MAAMC,UAAUC;IAChB,MAAMC,YAAYC;IAClB,QACGC,KAAK,UAAU,0BAA0B,OAAOC,WAAWH,YAAY;MACtE,CAACI,SACC,UAAU,0BACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,MAAM,GACpC,QAAQ,OACR,KAAK,QACL,SAASR,MAAM,QAAQ,GACvB;MACF,CAACS,KAAK,UAAU,yBAAyB,aAAa,IAAI;QACxD,CAACT,MAAM,KAAK,CAAC;MACf,EAAES,KAAK;MACP,CAACF,SACC,UAAU,wBACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,IAAI,GAClC,QAAQ,UACR,KAAK,QACL,SAASR,MAAM,MAAM,GACrB;IACJ,EAAEK;AAEN"}