@flyingrobots/bijou-tui 7.2.0 → 8.0.0-rc.1

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 (974) hide show
  1. package/dist/animate-constants.d.ts +3 -0
  2. package/dist/animate-constants.d.ts.map +1 -0
  3. package/dist/animate-constants.js +3 -0
  4. package/dist/animate-constants.js.map +1 -0
  5. package/dist/animate.d.ts +3 -91
  6. package/dist/animate.d.ts.map +1 -1
  7. package/dist/animate.js +2 -158
  8. package/dist/animate.js.map +1 -1
  9. package/dist/animate.part01.d.ts +83 -0
  10. package/dist/animate.part01.d.ts.map +1 -0
  11. package/dist/animate.part01.js +40 -0
  12. package/dist/animate.part01.js.map +1 -0
  13. package/dist/animate.part02.d.ts +44 -0
  14. package/dist/animate.part02.d.ts.map +1 -0
  15. package/dist/animate.part02.js +61 -0
  16. package/dist/animate.part02.js.map +1 -0
  17. package/dist/animate.part03.d.ts +43 -0
  18. package/dist/animate.part03.d.ts.map +1 -0
  19. package/dist/animate.part03.js +52 -0
  20. package/dist/animate.part03.js.map +1 -0
  21. package/dist/app-frame-action-types.d.ts +177 -0
  22. package/dist/app-frame-action-types.d.ts.map +1 -0
  23. package/dist/app-frame-action-types.js +2 -0
  24. package/dist/app-frame-action-types.js.map +1 -0
  25. package/dist/app-frame-actions-dispatch.d.ts +5 -0
  26. package/dist/app-frame-actions-dispatch.d.ts.map +1 -0
  27. package/dist/app-frame-actions-dispatch.js +67 -0
  28. package/dist/app-frame-actions-dispatch.js.map +1 -0
  29. package/dist/app-frame-actions-footer.d.ts +13 -0
  30. package/dist/app-frame-actions-footer.d.ts.map +1 -0
  31. package/dist/app-frame-actions-footer.js +57 -0
  32. package/dist/app-frame-actions-footer.js.map +1 -0
  33. package/dist/app-frame-actions-measure.d.ts +4 -0
  34. package/dist/app-frame-actions-measure.d.ts.map +1 -0
  35. package/dist/app-frame-actions-measure.js +11 -0
  36. package/dist/app-frame-actions-measure.js.map +1 -0
  37. package/dist/app-frame-actions-overlays.d.ts +5 -0
  38. package/dist/app-frame-actions-overlays.d.ts.map +1 -0
  39. package/dist/app-frame-actions-overlays.js +66 -0
  40. package/dist/app-frame-actions-overlays.js.map +1 -0
  41. package/dist/app-frame-actions-pane.d.ts +5 -0
  42. package/dist/app-frame-actions-pane.d.ts.map +1 -0
  43. package/dist/app-frame-actions-pane.js +48 -0
  44. package/dist/app-frame-actions-pane.js.map +1 -0
  45. package/dist/app-frame-actions-panel.d.ts +7 -0
  46. package/dist/app-frame-actions-panel.d.ts.map +1 -0
  47. package/dist/app-frame-actions-panel.js +68 -0
  48. package/dist/app-frame-actions-panel.js.map +1 -0
  49. package/dist/app-frame-actions-scroll.d.ts +8 -0
  50. package/dist/app-frame-actions-scroll.d.ts.map +1 -0
  51. package/dist/app-frame-actions-scroll.js +79 -0
  52. package/dist/app-frame-actions-scroll.js.map +1 -0
  53. package/dist/app-frame-actions-tabs.d.ts +6 -0
  54. package/dist/app-frame-actions-tabs.d.ts.map +1 -0
  55. package/dist/app-frame-actions-tabs.js +81 -0
  56. package/dist/app-frame-actions-tabs.js.map +1 -0
  57. package/dist/app-frame-actions.d.ts +6 -15
  58. package/dist/app-frame-actions.d.ts.map +1 -1
  59. package/dist/app-frame-actions.js +6 -443
  60. package/dist/app-frame-actions.js.map +1 -1
  61. package/dist/app-frame-app-init.d.ts +14 -0
  62. package/dist/app-frame-app-init.d.ts.map +1 -0
  63. package/dist/app-frame-app-init.js +81 -0
  64. package/dist/app-frame-app-init.js.map +1 -0
  65. package/dist/app-frame-app-update.d.ts +29 -0
  66. package/dist/app-frame-app-update.d.ts.map +1 -0
  67. package/dist/app-frame-app-update.js +28 -0
  68. package/dist/app-frame-app-update.js.map +1 -0
  69. package/dist/app-frame-app-view.d.ts +6 -0
  70. package/dist/app-frame-app-view.d.ts.map +1 -0
  71. package/dist/app-frame-app-view.js +14 -0
  72. package/dist/app-frame-app-view.js.map +1 -0
  73. package/dist/app-frame-contracts.d.ts +32 -0
  74. package/dist/app-frame-contracts.d.ts.map +1 -0
  75. package/dist/app-frame-contracts.js +3 -0
  76. package/dist/app-frame-contracts.js.map +1 -0
  77. package/dist/app-frame-controls-runtime.d.ts +32 -0
  78. package/dist/app-frame-controls-runtime.d.ts.map +1 -0
  79. package/dist/app-frame-controls-runtime.js +86 -0
  80. package/dist/app-frame-controls-runtime.js.map +1 -0
  81. package/dist/app-frame-create.d.ts +14 -0
  82. package/dist/app-frame-create.d.ts.map +1 -0
  83. package/dist/app-frame-create.js +64 -0
  84. package/dist/app-frame-create.js.map +1 -0
  85. package/dist/app-frame-frame-action-update.d.ts +21 -0
  86. package/dist/app-frame-frame-action-update.d.ts.map +1 -0
  87. package/dist/app-frame-frame-action-update.js +51 -0
  88. package/dist/app-frame-frame-action-update.js.map +1 -0
  89. package/dist/app-frame-geometry.d.ts +8 -0
  90. package/dist/app-frame-geometry.d.ts.map +1 -0
  91. package/dist/app-frame-geometry.js +27 -0
  92. package/dist/app-frame-geometry.js.map +1 -0
  93. package/dist/app-frame-help-keys.d.ts +8 -0
  94. package/dist/app-frame-help-keys.d.ts.map +1 -0
  95. package/dist/app-frame-help-keys.js +72 -0
  96. package/dist/app-frame-help-keys.js.map +1 -0
  97. package/dist/app-frame-help-scroll.d.ts +8 -0
  98. package/dist/app-frame-help-scroll.d.ts.map +1 -0
  99. package/dist/app-frame-help-scroll.js +25 -0
  100. package/dist/app-frame-help-scroll.js.map +1 -0
  101. package/dist/app-frame-hint-sources.d.ts +14 -0
  102. package/dist/app-frame-hint-sources.d.ts.map +1 -0
  103. package/dist/app-frame-hint-sources.js +17 -0
  104. package/dist/app-frame-hint-sources.js.map +1 -0
  105. package/dist/app-frame-host.d.ts +5 -0
  106. package/dist/app-frame-host.d.ts.map +1 -0
  107. package/dist/app-frame-host.js +51 -0
  108. package/dist/app-frame-host.js.map +1 -0
  109. package/dist/app-frame-i18n-catalog.d.ts +4 -0
  110. package/dist/app-frame-i18n-catalog.d.ts.map +1 -0
  111. package/dist/app-frame-i18n-catalog.js +97 -0
  112. package/dist/app-frame-i18n-catalog.js.map +1 -0
  113. package/dist/app-frame-i18n.d.ts +2 -2
  114. package/dist/app-frame-i18n.d.ts.map +1 -1
  115. package/dist/app-frame-i18n.js +2 -95
  116. package/dist/app-frame-i18n.js.map +1 -1
  117. package/dist/app-frame-key-collision.d.ts +5 -0
  118. package/dist/app-frame-key-collision.d.ts.map +1 -0
  119. package/dist/app-frame-key-collision.js +54 -0
  120. package/dist/app-frame-key-collision.js.map +1 -0
  121. package/dist/app-frame-key-route-contract.d.ts +20 -0
  122. package/dist/app-frame-key-route-contract.d.ts.map +1 -0
  123. package/dist/app-frame-key-route-contract.js +2 -0
  124. package/dist/app-frame-key-route-contract.js.map +1 -0
  125. package/dist/app-frame-key-route-layers.d.ts +8 -0
  126. package/dist/app-frame-key-route-layers.d.ts.map +1 -0
  127. package/dist/app-frame-key-route-layers.js +38 -0
  128. package/dist/app-frame-key-route-layers.js.map +1 -0
  129. package/dist/app-frame-key-route-notifications.d.ts +5 -0
  130. package/dist/app-frame-key-route-notifications.d.ts.map +1 -0
  131. package/dist/app-frame-key-route-notifications.js +92 -0
  132. package/dist/app-frame-key-route-notifications.js.map +1 -0
  133. package/dist/app-frame-key-route-palette-help.d.ts +6 -0
  134. package/dist/app-frame-key-route-palette-help.d.ts.map +1 -0
  135. package/dist/app-frame-key-route-palette-help.js +67 -0
  136. package/dist/app-frame-key-route-palette-help.js.map +1 -0
  137. package/dist/app-frame-key-route-settings.d.ts +5 -0
  138. package/dist/app-frame-key-route-settings.d.ts.map +1 -0
  139. package/dist/app-frame-key-route-settings.js +88 -0
  140. package/dist/app-frame-key-route-settings.js.map +1 -0
  141. package/dist/app-frame-key-route-shared.d.ts +3 -0
  142. package/dist/app-frame-key-route-shared.d.ts.map +1 -0
  143. package/dist/app-frame-key-route-shared.js +35 -0
  144. package/dist/app-frame-key-route-shared.js.map +1 -0
  145. package/dist/app-frame-key-route-workspace.d.ts +5 -0
  146. package/dist/app-frame-key-route-workspace.d.ts.map +1 -0
  147. package/dist/app-frame-key-route-workspace.js +76 -0
  148. package/dist/app-frame-key-route-workspace.js.map +1 -0
  149. package/dist/app-frame-key-route.d.ts +9 -0
  150. package/dist/app-frame-key-route.d.ts.map +1 -0
  151. package/dist/app-frame-key-route.js +67 -0
  152. package/dist/app-frame-key-route.js.map +1 -0
  153. package/dist/app-frame-keymap.d.ts +12 -0
  154. package/dist/app-frame-keymap.d.ts.map +1 -0
  155. package/dist/app-frame-keymap.js +77 -0
  156. package/dist/app-frame-keymap.js.map +1 -0
  157. package/dist/app-frame-layer-context.d.ts +15 -0
  158. package/dist/app-frame-layer-context.d.ts.map +1 -0
  159. package/dist/app-frame-layer-context.js +23 -0
  160. package/dist/app-frame-layer-context.js.map +1 -0
  161. package/dist/app-frame-layer-metadata.d.ts +18 -0
  162. package/dist/app-frame-layer-metadata.d.ts.map +1 -0
  163. package/dist/app-frame-layer-metadata.js +67 -0
  164. package/dist/app-frame-layer-metadata.js.map +1 -0
  165. package/dist/app-frame-layers.d.ts +3 -42
  166. package/dist/app-frame-layers.d.ts.map +1 -1
  167. package/dist/app-frame-layers.js +2 -154
  168. package/dist/app-frame-layers.js.map +1 -1
  169. package/dist/app-frame-layers.part01.d.ts +37 -0
  170. package/dist/app-frame-layers.part01.d.ts.map +1 -0
  171. package/dist/app-frame-layers.part01.js +2 -0
  172. package/dist/app-frame-layers.part01.js.map +1 -0
  173. package/dist/app-frame-layers.part02.d.ts +7 -0
  174. package/dist/app-frame-layers.part02.d.ts.map +1 -0
  175. package/dist/app-frame-layers.part02.js +91 -0
  176. package/dist/app-frame-layers.part02.js.map +1 -0
  177. package/dist/app-frame-layers.part03.d.ts +7 -0
  178. package/dist/app-frame-layers.part03.d.ts.map +1 -0
  179. package/dist/app-frame-layers.part03.js +47 -0
  180. package/dist/app-frame-layers.part03.js.map +1 -0
  181. package/dist/app-frame-layers.part04.d.ts +4 -0
  182. package/dist/app-frame-layers.part04.d.ts.map +1 -0
  183. package/dist/app-frame-layers.part04.js +21 -0
  184. package/dist/app-frame-layers.part04.js.map +1 -0
  185. package/dist/app-frame-layout-contract.d.ts +46 -0
  186. package/dist/app-frame-layout-contract.d.ts.map +1 -0
  187. package/dist/app-frame-layout-contract.js +2 -0
  188. package/dist/app-frame-layout-contract.js.map +1 -0
  189. package/dist/app-frame-layout-runtime.d.ts +27 -0
  190. package/dist/app-frame-layout-runtime.d.ts.map +1 -0
  191. package/dist/app-frame-layout-runtime.js +37 -0
  192. package/dist/app-frame-layout-runtime.js.map +1 -0
  193. package/dist/app-frame-messages.d.ts +31 -0
  194. package/dist/app-frame-messages.d.ts.map +1 -0
  195. package/dist/app-frame-messages.js +86 -0
  196. package/dist/app-frame-messages.js.map +1 -0
  197. package/dist/app-frame-model-helpers.d.ts +6 -0
  198. package/dist/app-frame-model-helpers.d.ts.map +1 -0
  199. package/dist/app-frame-model-helpers.js +17 -0
  200. package/dist/app-frame-model-helpers.js.map +1 -0
  201. package/dist/app-frame-model-types.d.ts +88 -0
  202. package/dist/app-frame-model-types.d.ts.map +1 -0
  203. package/dist/app-frame-model-types.js +2 -0
  204. package/dist/app-frame-model-types.js.map +1 -0
  205. package/dist/app-frame-mouse-layout.d.ts +16 -0
  206. package/dist/app-frame-mouse-layout.d.ts.map +1 -0
  207. package/dist/app-frame-mouse-layout.js +63 -0
  208. package/dist/app-frame-mouse-layout.js.map +1 -0
  209. package/dist/app-frame-mouse-route.d.ts +17 -0
  210. package/dist/app-frame-mouse-route.d.ts.map +1 -0
  211. package/dist/app-frame-mouse-route.js +67 -0
  212. package/dist/app-frame-mouse-route.js.map +1 -0
  213. package/dist/app-frame-mouse-workspace.d.ts +14 -0
  214. package/dist/app-frame-mouse-workspace.d.ts.map +1 -0
  215. package/dist/app-frame-mouse-workspace.js +73 -0
  216. package/dist/app-frame-mouse-workspace.js.map +1 -0
  217. package/dist/app-frame-notification-contract.d.ts +18 -0
  218. package/dist/app-frame-notification-contract.d.ts.map +1 -0
  219. package/dist/app-frame-notification-contract.js +2 -0
  220. package/dist/app-frame-notification-contract.js.map +1 -0
  221. package/dist/app-frame-notification-runtime.d.ts +16 -0
  222. package/dist/app-frame-notification-runtime.d.ts.map +1 -0
  223. package/dist/app-frame-notification-runtime.js +40 -0
  224. package/dist/app-frame-notification-runtime.js.map +1 -0
  225. package/dist/app-frame-notification-state.d.ts +13 -0
  226. package/dist/app-frame-notification-state.d.ts.map +1 -0
  227. package/dist/app-frame-notification-state.js +64 -0
  228. package/dist/app-frame-notification-state.js.map +1 -0
  229. package/dist/app-frame-options.d.ts +112 -0
  230. package/dist/app-frame-options.d.ts.map +1 -0
  231. package/dist/app-frame-options.js +2 -0
  232. package/dist/app-frame-options.js.map +1 -0
  233. package/dist/app-frame-overlay-contract.d.ts +55 -0
  234. package/dist/app-frame-overlay-contract.d.ts.map +1 -0
  235. package/dist/app-frame-overlay-contract.js +3 -0
  236. package/dist/app-frame-overlay-contract.js.map +1 -0
  237. package/dist/app-frame-overlay-help.d.ts +13 -0
  238. package/dist/app-frame-overlay-help.d.ts.map +1 -0
  239. package/dist/app-frame-overlay-help.js +39 -0
  240. package/dist/app-frame-overlay-help.js.map +1 -0
  241. package/dist/app-frame-overlay-layout.d.ts +7 -0
  242. package/dist/app-frame-overlay-layout.d.ts.map +1 -0
  243. package/dist/app-frame-overlay-layout.js +90 -0
  244. package/dist/app-frame-overlay-layout.js.map +1 -0
  245. package/dist/app-frame-overlay-navigation.d.ts +11 -0
  246. package/dist/app-frame-overlay-navigation.d.ts.map +1 -0
  247. package/dist/app-frame-overlay-navigation.js +72 -0
  248. package/dist/app-frame-overlay-navigation.js.map +1 -0
  249. package/dist/app-frame-overlay-notifications.d.ts +10 -0
  250. package/dist/app-frame-overlay-notifications.d.ts.map +1 -0
  251. package/dist/app-frame-overlay-notifications.js +107 -0
  252. package/dist/app-frame-overlay-notifications.js.map +1 -0
  253. package/dist/app-frame-overlay-render-notifications.d.ts +5 -0
  254. package/dist/app-frame-overlay-render-notifications.d.ts.map +1 -0
  255. package/dist/app-frame-overlay-render-notifications.js +57 -0
  256. package/dist/app-frame-overlay-render-notifications.js.map +1 -0
  257. package/dist/app-frame-overlay-render-settings.d.ts +7 -0
  258. package/dist/app-frame-overlay-render-settings.d.ts.map +1 -0
  259. package/dist/app-frame-overlay-render-settings.js +44 -0
  260. package/dist/app-frame-overlay-render-settings.js.map +1 -0
  261. package/dist/app-frame-overlay-settings.d.ts +8 -0
  262. package/dist/app-frame-overlay-settings.d.ts.map +1 -0
  263. package/dist/app-frame-overlay-settings.js +63 -0
  264. package/dist/app-frame-overlay-settings.js.map +1 -0
  265. package/dist/app-frame-overlay-shell-theme.d.ts +10 -0
  266. package/dist/app-frame-overlay-shell-theme.d.ts.map +1 -0
  267. package/dist/app-frame-overlay-shell-theme.js +97 -0
  268. package/dist/app-frame-overlay-shell-theme.js.map +1 -0
  269. package/dist/app-frame-overlays.d.ts +9 -89
  270. package/dist/app-frame-overlays.d.ts.map +1 -1
  271. package/dist/app-frame-overlays.js +9 -571
  272. package/dist/app-frame-overlays.js.map +1 -1
  273. package/dist/app-frame-page-contract.d.ts +60 -0
  274. package/dist/app-frame-page-contract.d.ts.map +1 -0
  275. package/dist/app-frame-page-contract.js +2 -0
  276. package/dist/app-frame-page-contract.js.map +1 -0
  277. package/dist/app-frame-page-registry.d.ts +9 -0
  278. package/dist/app-frame-page-registry.d.ts.map +1 -0
  279. package/dist/app-frame-page-registry.js +19 -0
  280. package/dist/app-frame-page-registry.js.map +1 -0
  281. package/dist/app-frame-page-update.d.ts +5 -0
  282. package/dist/app-frame-page-update.d.ts.map +1 -0
  283. package/dist/app-frame-page-update.js +19 -0
  284. package/dist/app-frame-page-update.js.map +1 -0
  285. package/dist/app-frame-palette-selection.d.ts +10 -0
  286. package/dist/app-frame-palette-selection.d.ts.map +1 -0
  287. package/dist/app-frame-palette-selection.js +39 -0
  288. package/dist/app-frame-palette-selection.js.map +1 -0
  289. package/dist/app-frame-palette.d.ts +4 -9
  290. package/dist/app-frame-palette.d.ts.map +1 -1
  291. package/dist/app-frame-palette.js +4 -210
  292. package/dist/app-frame-palette.js.map +1 -1
  293. package/dist/app-frame-palette.part01.d.ts +10 -0
  294. package/dist/app-frame-palette.part01.d.ts.map +1 -0
  295. package/dist/app-frame-palette.part01.js +44 -0
  296. package/dist/app-frame-palette.part01.js.map +1 -0
  297. package/dist/app-frame-palette.part02.d.ts +6 -0
  298. package/dist/app-frame-palette.part02.d.ts.map +1 -0
  299. package/dist/app-frame-palette.part02.js +25 -0
  300. package/dist/app-frame-palette.part02.js.map +1 -0
  301. package/dist/app-frame-palette.part03.d.ts +5 -0
  302. package/dist/app-frame-palette.part03.d.ts.map +1 -0
  303. package/dist/app-frame-palette.part03.js +89 -0
  304. package/dist/app-frame-palette.part03.js.map +1 -0
  305. package/dist/app-frame-palette.part04.d.ts +5 -0
  306. package/dist/app-frame-palette.part04.d.ts.map +1 -0
  307. package/dist/app-frame-palette.part04.js +20 -0
  308. package/dist/app-frame-palette.part04.js.map +1 -0
  309. package/dist/app-frame-performance-runtime.d.ts +6 -0
  310. package/dist/app-frame-performance-runtime.d.ts.map +1 -0
  311. package/dist/app-frame-performance-runtime.js +30 -0
  312. package/dist/app-frame-performance-runtime.js.map +1 -0
  313. package/dist/app-frame-performance.d.ts +26 -0
  314. package/dist/app-frame-performance.d.ts.map +1 -0
  315. package/dist/app-frame-performance.js +44 -0
  316. package/dist/app-frame-performance.js.map +1 -0
  317. package/dist/app-frame-presentation.d.ts +20 -0
  318. package/dist/app-frame-presentation.d.ts.map +1 -0
  319. package/dist/app-frame-presentation.js +20 -0
  320. package/dist/app-frame-presentation.js.map +1 -0
  321. package/dist/app-frame-render-colors.d.ts +5 -0
  322. package/dist/app-frame-render-colors.d.ts.map +1 -0
  323. package/dist/app-frame-render-colors.js +117 -0
  324. package/dist/app-frame-render-colors.js.map +1 -0
  325. package/dist/app-frame-render-content.d.ts +11 -0
  326. package/dist/app-frame-render-content.d.ts.map +1 -0
  327. package/dist/app-frame-render-content.js +42 -0
  328. package/dist/app-frame-render-content.js.map +1 -0
  329. package/dist/app-frame-render-contract.d.ts +33 -0
  330. package/dist/app-frame-render-contract.d.ts.map +1 -0
  331. package/dist/app-frame-render-contract.js +2 -0
  332. package/dist/app-frame-render-contract.js.map +1 -0
  333. package/dist/app-frame-render-grid.d.ts +10 -0
  334. package/dist/app-frame-render-grid.d.ts.map +1 -0
  335. package/dist/app-frame-render-grid.js +51 -0
  336. package/dist/app-frame-render-grid.js.map +1 -0
  337. package/dist/app-frame-render-header.d.ts +10 -0
  338. package/dist/app-frame-render-header.d.ts.map +1 -0
  339. package/dist/app-frame-render-header.js +96 -0
  340. package/dist/app-frame-render-header.js.map +1 -0
  341. package/dist/app-frame-render-maximized.d.ts +11 -0
  342. package/dist/app-frame-render-maximized.d.ts.map +1 -0
  343. package/dist/app-frame-render-maximized.js +51 -0
  344. package/dist/app-frame-render-maximized.js.map +1 -0
  345. package/dist/app-frame-render-node.d.ts +9 -0
  346. package/dist/app-frame-render-node.d.ts.map +1 -0
  347. package/dist/app-frame-render-node.js +35 -0
  348. package/dist/app-frame-render-node.js.map +1 -0
  349. package/dist/app-frame-render-pane.d.ts +7 -0
  350. package/dist/app-frame-render-pane.d.ts.map +1 -0
  351. package/dist/app-frame-render-pane.js +36 -0
  352. package/dist/app-frame-render-pane.js.map +1 -0
  353. package/dist/app-frame-render-scratch.d.ts +7 -0
  354. package/dist/app-frame-render-scratch.d.ts.map +1 -0
  355. package/dist/app-frame-render-scratch.js +20 -0
  356. package/dist/app-frame-render-scratch.js.map +1 -0
  357. package/dist/app-frame-render-split.d.ts +7 -0
  358. package/dist/app-frame-render-split.d.ts.map +1 -0
  359. package/dist/app-frame-render-split.js +46 -0
  360. package/dist/app-frame-render-split.js.map +1 -0
  361. package/dist/app-frame-render-surface.d.ts +11 -0
  362. package/dist/app-frame-render-surface.d.ts.map +1 -0
  363. package/dist/app-frame-render-surface.js +80 -0
  364. package/dist/app-frame-render-surface.js.map +1 -0
  365. package/dist/app-frame-render-transition.d.ts +9 -0
  366. package/dist/app-frame-render-transition.d.ts.map +1 -0
  367. package/dist/app-frame-render-transition.js +46 -0
  368. package/dist/app-frame-render-transition.js.map +1 -0
  369. package/dist/app-frame-render.d.ts +9 -47
  370. package/dist/app-frame-render.d.ts.map +1 -1
  371. package/dist/app-frame-render.js +8 -533
  372. package/dist/app-frame-render.js.map +1 -1
  373. package/dist/app-frame-runtime.d.ts +22 -0
  374. package/dist/app-frame-runtime.d.ts.map +1 -0
  375. package/dist/app-frame-runtime.js +12 -0
  376. package/dist/app-frame-runtime.js.map +1 -0
  377. package/dist/app-frame-settings-contract.d.ts +44 -0
  378. package/dist/app-frame-settings-contract.d.ts.map +1 -0
  379. package/dist/app-frame-settings-contract.js +2 -0
  380. package/dist/app-frame-settings-contract.js.map +1 -0
  381. package/dist/app-frame-shell-command-contract.d.ts +28 -0
  382. package/dist/app-frame-shell-command-contract.d.ts.map +1 -0
  383. package/dist/app-frame-shell-command-contract.js +2 -0
  384. package/dist/app-frame-shell-command-contract.js.map +1 -0
  385. package/dist/app-frame-shell-command-interaction.d.ts +5 -0
  386. package/dist/app-frame-shell-command-interaction.d.ts.map +1 -0
  387. package/dist/app-frame-shell-command-interaction.js +70 -0
  388. package/dist/app-frame-shell-command-interaction.js.map +1 -0
  389. package/dist/app-frame-shell-command-ui.d.ts +5 -0
  390. package/dist/app-frame-shell-command-ui.d.ts.map +1 -0
  391. package/dist/app-frame-shell-command-ui.js +103 -0
  392. package/dist/app-frame-shell-command-ui.js.map +1 -0
  393. package/dist/app-frame-shell-command.d.ts +9 -0
  394. package/dist/app-frame-shell-command.d.ts.map +1 -0
  395. package/dist/app-frame-shell-command.js +48 -0
  396. package/dist/app-frame-shell-command.js.map +1 -0
  397. package/dist/app-frame-theme-contract.d.ts +74 -0
  398. package/dist/app-frame-theme-contract.d.ts.map +1 -0
  399. package/dist/app-frame-theme-contract.js +6 -0
  400. package/dist/app-frame-theme-contract.js.map +1 -0
  401. package/dist/app-frame-theme-mode.d.ts +28 -0
  402. package/dist/app-frame-theme-mode.d.ts.map +1 -0
  403. package/dist/app-frame-theme-mode.js +50 -0
  404. package/dist/app-frame-theme-mode.js.map +1 -0
  405. package/dist/app-frame-theme-run-contract.d.ts +9 -0
  406. package/dist/app-frame-theme-run-contract.d.ts.map +1 -0
  407. package/dist/app-frame-theme-run-contract.js +2 -0
  408. package/dist/app-frame-theme-run-contract.js.map +1 -0
  409. package/dist/app-frame-theme-runtime.d.ts +24 -0
  410. package/dist/app-frame-theme-runtime.d.ts.map +1 -0
  411. package/dist/app-frame-theme-runtime.js +109 -0
  412. package/dist/app-frame-theme-runtime.js.map +1 -0
  413. package/dist/app-frame-transition-contract.d.ts +5 -0
  414. package/dist/app-frame-transition-contract.d.ts.map +1 -0
  415. package/dist/app-frame-transition-contract.js +2 -0
  416. package/dist/app-frame-transition-contract.js.map +1 -0
  417. package/dist/app-frame-transition-update.d.ts +12 -0
  418. package/dist/app-frame-transition-update.d.ts.map +1 -0
  419. package/dist/app-frame-transition-update.js +46 -0
  420. package/dist/app-frame-transition-update.js.map +1 -0
  421. package/dist/app-frame-types.d.ts +5 -386
  422. package/dist/app-frame-types.d.ts.map +1 -1
  423. package/dist/app-frame-types.js +2 -89
  424. package/dist/app-frame-types.js.map +1 -1
  425. package/dist/app-frame-utils.d.ts +4 -17
  426. package/dist/app-frame-utils.d.ts.map +1 -1
  427. package/dist/app-frame-utils.js +3 -75
  428. package/dist/app-frame-utils.js.map +1 -1
  429. package/dist/app-frame-view-base.d.ts +22 -0
  430. package/dist/app-frame-view-base.d.ts.map +1 -0
  431. package/dist/app-frame-view-base.js +47 -0
  432. package/dist/app-frame-view-base.js.map +1 -0
  433. package/dist/app-frame-view-body.d.ts +12 -0
  434. package/dist/app-frame-view-body.d.ts.map +1 -0
  435. package/dist/app-frame-view-body.js +27 -0
  436. package/dist/app-frame-view-body.js.map +1 -0
  437. package/dist/app-frame-view-contract.d.ts +24 -0
  438. package/dist/app-frame-view-contract.d.ts.map +1 -0
  439. package/dist/app-frame-view-contract.js +2 -0
  440. package/dist/app-frame-view-contract.js.map +1 -0
  441. package/dist/app-frame-view-modals.d.ts +6 -0
  442. package/dist/app-frame-view-modals.d.ts.map +1 -0
  443. package/dist/app-frame-view-modals.js +59 -0
  444. package/dist/app-frame-view-modals.js.map +1 -0
  445. package/dist/app-frame-view-overlays.d.ts +6 -0
  446. package/dist/app-frame-view-overlays.d.ts.map +1 -0
  447. package/dist/app-frame-view-overlays.js +64 -0
  448. package/dist/app-frame-view-overlays.js.map +1 -0
  449. package/dist/app-frame-workspace-layout.d.ts +33 -0
  450. package/dist/app-frame-workspace-layout.d.ts.map +1 -0
  451. package/dist/app-frame-workspace-layout.js +58 -0
  452. package/dist/app-frame-workspace-layout.js.map +1 -0
  453. package/dist/app-frame-workspace-tree.d.ts +11 -0
  454. package/dist/app-frame-workspace-tree.d.ts.map +1 -0
  455. package/dist/app-frame-workspace-tree.js +29 -0
  456. package/dist/app-frame-workspace-tree.js.map +1 -0
  457. package/dist/app-frame.d.ts +3 -375
  458. package/dist/app-frame.d.ts.map +1 -1
  459. package/dist/app-frame.js +2 -1806
  460. package/dist/app-frame.js.map +1 -1
  461. package/dist/browsable-list.d.ts +4 -158
  462. package/dist/browsable-list.d.ts.map +1 -1
  463. package/dist/browsable-list.js +3 -214
  464. package/dist/browsable-list.js.map +1 -1
  465. package/dist/browsable-list.part01.d.ts +86 -0
  466. package/dist/browsable-list.part01.d.ts.map +1 -0
  467. package/dist/browsable-list.part01.js +45 -0
  468. package/dist/browsable-list.part01.js.map +1 -0
  469. package/dist/browsable-list.part02.d.ts +49 -0
  470. package/dist/browsable-list.part02.d.ts.map +1 -0
  471. package/dist/browsable-list.part02.js +100 -0
  472. package/dist/browsable-list.part02.js.map +1 -0
  473. package/dist/browsable-list.part03.d.ts +43 -0
  474. package/dist/browsable-list.part03.d.ts.map +1 -0
  475. package/dist/browsable-list.part03.js +77 -0
  476. package/dist/browsable-list.part03.js.map +1 -0
  477. package/dist/canvas.d.ts +2 -29
  478. package/dist/canvas.d.ts.map +1 -1
  479. package/dist/canvas.js +1 -276
  480. package/dist/canvas.js.map +1 -1
  481. package/dist/canvas.part01.d.ts +45 -0
  482. package/dist/canvas.part01.d.ts.map +1 -0
  483. package/dist/canvas.part01.js +80 -0
  484. package/dist/canvas.part01.js.map +1 -0
  485. package/dist/canvas.part02.d.ts +7 -0
  486. package/dist/canvas.part02.d.ts.map +1 -0
  487. package/dist/canvas.part02.js +86 -0
  488. package/dist/canvas.part02.js.map +1 -0
  489. package/dist/canvas.part03.d.ts +8 -0
  490. package/dist/canvas.part03.d.ts.map +1 -0
  491. package/dist/canvas.part03.js +121 -0
  492. package/dist/canvas.part03.js.map +1 -0
  493. package/dist/command-palette.d.ts +5 -160
  494. package/dist/command-palette.d.ts.map +1 -1
  495. package/dist/command-palette.js +4 -301
  496. package/dist/command-palette.js.map +1 -1
  497. package/dist/command-palette.part01.d.ts +59 -0
  498. package/dist/command-palette.part01.d.ts.map +1 -0
  499. package/dist/command-palette.part01.js +65 -0
  500. package/dist/command-palette.part01.js.map +1 -0
  501. package/dist/command-palette.part02.d.ts +45 -0
  502. package/dist/command-palette.part02.d.ts.map +1 -0
  503. package/dist/command-palette.part02.js +111 -0
  504. package/dist/command-palette.part02.js.map +1 -0
  505. package/dist/command-palette.part03.d.ts +31 -0
  506. package/dist/command-palette.part03.d.ts.map +1 -0
  507. package/dist/command-palette.part03.js +88 -0
  508. package/dist/command-palette.part03.js.map +1 -0
  509. package/dist/command-palette.part04.d.ts +34 -0
  510. package/dist/command-palette.part04.d.ts.map +1 -0
  511. package/dist/command-palette.part04.js +43 -0
  512. package/dist/command-palette.part04.js.map +1 -0
  513. package/dist/css/text-style-token.d.ts +20 -0
  514. package/dist/css/text-style-token.d.ts.map +1 -0
  515. package/dist/css/text-style-token.js +83 -0
  516. package/dist/css/text-style-token.js.map +1 -0
  517. package/dist/css/text-style.d.ts +4 -19
  518. package/dist/css/text-style.d.ts.map +1 -1
  519. package/dist/css/text-style.js +6 -74
  520. package/dist/css/text-style.js.map +1 -1
  521. package/dist/driver-contract.d.ts +38 -0
  522. package/dist/driver-contract.d.ts.map +1 -0
  523. package/dist/driver-contract.js +2 -0
  524. package/dist/driver-contract.js.map +1 -0
  525. package/dist/driver-harness-api.d.ts +4 -0
  526. package/dist/driver-harness-api.d.ts.map +1 -0
  527. package/dist/driver-harness-api.js +34 -0
  528. package/dist/driver-harness-api.js.map +1 -0
  529. package/dist/driver-harness-command.d.ts +5 -0
  530. package/dist/driver-harness-command.d.ts.map +1 -0
  531. package/dist/driver-harness-command.js +60 -0
  532. package/dist/driver-harness-command.js.map +1 -0
  533. package/dist/driver-harness-contract.d.ts +87 -0
  534. package/dist/driver-harness-contract.d.ts.map +1 -0
  535. package/dist/driver-harness-contract.js +2 -0
  536. package/dist/driver-harness-contract.js.map +1 -0
  537. package/dist/driver-harness-state.d.ts +8 -0
  538. package/dist/driver-harness-state.d.ts.map +1 -0
  539. package/dist/driver-harness-state.js +42 -0
  540. package/dist/driver-harness-state.js.map +1 -0
  541. package/dist/driver-harness.d.ts +11 -0
  542. package/dist/driver-harness.d.ts.map +1 -0
  543. package/dist/driver-harness.js +91 -0
  544. package/dist/driver-harness.js.map +1 -0
  545. package/dist/driver-mouse.d.ts +13 -0
  546. package/dist/driver-mouse.d.ts.map +1 -0
  547. package/dist/driver-mouse.js +42 -0
  548. package/dist/driver-mouse.js.map +1 -0
  549. package/dist/driver-runtime.d.ts +16 -0
  550. package/dist/driver-runtime.d.ts.map +1 -0
  551. package/dist/driver-runtime.js +53 -0
  552. package/dist/driver-runtime.js.map +1 -0
  553. package/dist/driver-script-contract.d.ts +73 -0
  554. package/dist/driver-script-contract.d.ts.map +1 -0
  555. package/dist/driver-script-contract.js +2 -0
  556. package/dist/driver-script-contract.js.map +1 -0
  557. package/dist/driver-script.d.ts +12 -0
  558. package/dist/driver-script.d.ts.map +1 -0
  559. package/dist/driver-script.js +71 -0
  560. package/dist/driver-script.js.map +1 -0
  561. package/dist/driver.d.ts +5 -209
  562. package/dist/driver.d.ts.map +1 -1
  563. package/dist/driver.js +4 -418
  564. package/dist/driver.js.map +1 -1
  565. package/dist/eventbus-command.d.ts +6 -0
  566. package/dist/eventbus-command.d.ts.map +1 -0
  567. package/dist/eventbus-command.js +94 -0
  568. package/dist/eventbus-command.js.map +1 -0
  569. package/dist/eventbus-contract.d.ts +41 -0
  570. package/dist/eventbus-contract.d.ts.map +1 -0
  571. package/dist/eventbus-contract.js +2 -0
  572. package/dist/eventbus-contract.js.map +1 -0
  573. package/dist/eventbus-create.d.ts +5 -0
  574. package/dist/eventbus-create.d.ts.map +1 -0
  575. package/dist/eventbus-create.js +75 -0
  576. package/dist/eventbus-create.js.map +1 -0
  577. package/dist/eventbus-io.d.ts +5 -0
  578. package/dist/eventbus-io.d.ts.map +1 -0
  579. package/dist/eventbus-io.js +31 -0
  580. package/dist/eventbus-io.js.map +1 -0
  581. package/dist/eventbus-options.d.ts +20 -0
  582. package/dist/eventbus-options.d.ts.map +1 -0
  583. package/dist/eventbus-options.js +2 -0
  584. package/dist/eventbus-options.js.map +1 -0
  585. package/dist/eventbus-pulse.d.ts +6 -0
  586. package/dist/eventbus-pulse.d.ts.map +1 -0
  587. package/dist/eventbus-pulse.js +34 -0
  588. package/dist/eventbus-pulse.js.map +1 -0
  589. package/dist/eventbus-report.d.ts +4 -0
  590. package/dist/eventbus-report.d.ts.map +1 -0
  591. package/dist/eventbus-report.js +19 -0
  592. package/dist/eventbus-report.js.map +1 -0
  593. package/dist/eventbus-state.d.ts +26 -0
  594. package/dist/eventbus-state.d.ts.map +1 -0
  595. package/dist/eventbus-state.js +97 -0
  596. package/dist/eventbus-state.js.map +1 -0
  597. package/dist/eventbus.d.ts +7 -174
  598. package/dist/eventbus.d.ts.map +1 -1
  599. package/dist/eventbus.js +5 -343
  600. package/dist/eventbus.js.map +1 -1
  601. package/dist/flex.d.ts +2 -53
  602. package/dist/flex.d.ts.map +1 -1
  603. package/dist/flex.js +1 -328
  604. package/dist/flex.js.map +1 -1
  605. package/dist/flex.part01.d.ts +79 -0
  606. package/dist/flex.part01.d.ts.map +1 -0
  607. package/dist/flex.part01.js +30 -0
  608. package/dist/flex.part01.js.map +1 -0
  609. package/dist/flex.part02.d.ts +8 -0
  610. package/dist/flex.part02.d.ts.map +1 -0
  611. package/dist/flex.part02.js +80 -0
  612. package/dist/flex.part02.js.map +1 -0
  613. package/dist/flex.part03.d.ts +9 -0
  614. package/dist/flex.part03.d.ts.map +1 -0
  615. package/dist/flex.part03.js +105 -0
  616. package/dist/flex.part03.js.map +1 -0
  617. package/dist/flex.part04.d.ts +7 -0
  618. package/dist/flex.part04.d.ts.map +1 -0
  619. package/dist/flex.part04.js +81 -0
  620. package/dist/flex.part04.js.map +1 -0
  621. package/dist/flex.part05.d.ts +5 -0
  622. package/dist/flex.part05.d.ts.map +1 -0
  623. package/dist/flex.part05.js +52 -0
  624. package/dist/flex.part05.js.map +1 -0
  625. package/dist/focus-map-inspection.d.ts +30 -0
  626. package/dist/focus-map-inspection.d.ts.map +1 -0
  627. package/dist/focus-map-inspection.js +64 -0
  628. package/dist/focus-map-inspection.js.map +1 -0
  629. package/dist/focus-map.d.ts +3 -29
  630. package/dist/focus-map.d.ts.map +1 -1
  631. package/dist/focus-map.js +5 -73
  632. package/dist/focus-map.js.map +1 -1
  633. package/dist/help-surface.d.ts +15 -0
  634. package/dist/help-surface.d.ts.map +1 -0
  635. package/dist/help-surface.js +31 -0
  636. package/dist/help-surface.js.map +1 -0
  637. package/dist/help-text.d.ts +27 -0
  638. package/dist/help-text.d.ts.map +1 -0
  639. package/dist/help-text.js +78 -0
  640. package/dist/help-text.js.map +1 -0
  641. package/dist/help-types.d.ts +27 -0
  642. package/dist/help-types.d.ts.map +1 -0
  643. package/dist/help-types.js +2 -0
  644. package/dist/help-types.js.map +1 -0
  645. package/dist/help.d.ts +6 -112
  646. package/dist/help.d.ts.map +1 -1
  647. package/dist/help.js +5 -165
  648. package/dist/help.js.map +1 -1
  649. package/dist/input-map.d.ts +4 -67
  650. package/dist/input-map.d.ts.map +1 -1
  651. package/dist/input-map.js +3 -160
  652. package/dist/input-map.js.map +1 -1
  653. package/dist/input-map.part01.d.ts +68 -0
  654. package/dist/input-map.part01.d.ts.map +1 -0
  655. package/dist/input-map.part01.js +36 -0
  656. package/dist/input-map.part01.js.map +1 -0
  657. package/dist/input-map.part02.d.ts +5 -0
  658. package/dist/input-map.part02.d.ts.map +1 -0
  659. package/dist/input-map.part02.js +85 -0
  660. package/dist/input-map.part02.js.map +1 -0
  661. package/dist/input-map.part03.d.ts +15 -0
  662. package/dist/input-map.part03.d.ts.map +1 -0
  663. package/dist/input-map.part03.js +33 -0
  664. package/dist/input-map.part03.js.map +1 -0
  665. package/dist/input-map.part04.d.ts +3 -0
  666. package/dist/input-map.part04.d.ts.map +1 -0
  667. package/dist/input-map.part04.js +7 -0
  668. package/dist/input-map.part04.js.map +1 -0
  669. package/dist/inputstack-types.d.ts +86 -0
  670. package/dist/inputstack-types.d.ts.map +1 -0
  671. package/dist/inputstack-types.js +3 -0
  672. package/dist/inputstack-types.js.map +1 -0
  673. package/dist/inputstack.d.ts +2 -59
  674. package/dist/inputstack.d.ts.map +1 -1
  675. package/dist/inputstack.js.map +1 -1
  676. package/dist/keybindings.d.ts +4 -152
  677. package/dist/keybindings.d.ts.map +1 -1
  678. package/dist/keybindings.js +2 -199
  679. package/dist/keybindings.js.map +1 -1
  680. package/dist/keybindings.part01.d.ts +56 -0
  681. package/dist/keybindings.part01.d.ts.map +1 -0
  682. package/dist/keybindings.part01.js +5 -0
  683. package/dist/keybindings.part01.js.map +1 -0
  684. package/dist/keybindings.part02.d.ts +68 -0
  685. package/dist/keybindings.part02.d.ts.map +1 -0
  686. package/dist/keybindings.part02.js +2 -0
  687. package/dist/keybindings.part02.js.map +1 -0
  688. package/dist/keybindings.part03.d.ts +34 -0
  689. package/dist/keybindings.part03.d.ts.map +1 -0
  690. package/dist/keybindings.part03.js +101 -0
  691. package/dist/keybindings.part03.js.map +1 -0
  692. package/dist/keybindings.part04.d.ts +13 -0
  693. package/dist/keybindings.part04.d.ts.map +1 -0
  694. package/dist/keybindings.part04.js +102 -0
  695. package/dist/keybindings.part04.js.map +1 -0
  696. package/dist/layout-preset-factories.d.ts +8 -0
  697. package/dist/layout-preset-factories.d.ts.map +1 -0
  698. package/dist/layout-preset-factories.js +28 -0
  699. package/dist/layout-preset-factories.js.map +1 -0
  700. package/dist/layout-preset.d.ts +1 -6
  701. package/dist/layout-preset.d.ts.map +1 -1
  702. package/dist/layout-preset.js +1 -30
  703. package/dist/layout-preset.js.map +1 -1
  704. package/dist/layout-stack.d.ts +5 -0
  705. package/dist/layout-stack.d.ts.map +1 -0
  706. package/dist/layout-stack.js +37 -0
  707. package/dist/layout-stack.js.map +1 -0
  708. package/dist/layout.d.ts +1 -16
  709. package/dist/layout.d.ts.map +1 -1
  710. package/dist/layout.js +1 -59
  711. package/dist/layout.js.map +1 -1
  712. package/dist/motion/reconciler-geometry.d.ts +12 -0
  713. package/dist/motion/reconciler-geometry.d.ts.map +1 -0
  714. package/dist/motion/reconciler-geometry.js +39 -0
  715. package/dist/motion/reconciler-geometry.js.map +1 -0
  716. package/dist/motion/reconciler.d.ts.map +1 -1
  717. package/dist/motion/reconciler.js +1 -35
  718. package/dist/motion/reconciler.js.map +1 -1
  719. package/dist/notification-card-content.d.ts +12 -0
  720. package/dist/notification-card-content.d.ts.map +1 -0
  721. package/dist/notification-card-content.js +76 -0
  722. package/dist/notification-card-content.js.map +1 -0
  723. package/dist/notification-card-metrics.d.ts +5 -0
  724. package/dist/notification-card-metrics.d.ts.map +1 -0
  725. package/dist/notification-card-metrics.js +33 -0
  726. package/dist/notification-card-metrics.js.map +1 -0
  727. package/dist/notification-card.d.ts.map +1 -1
  728. package/dist/notification-card.js +16 -96
  729. package/dist/notification-card.js.map +1 -1
  730. package/dist/pager.d.ts +4 -164
  731. package/dist/pager.d.ts.map +1 -1
  732. package/dist/pager.js +3 -253
  733. package/dist/pager.js.map +1 -1
  734. package/dist/pager.part01.d.ts +75 -0
  735. package/dist/pager.part01.d.ts.map +1 -0
  736. package/dist/pager.part01.js +60 -0
  737. package/dist/pager.part01.js.map +1 -0
  738. package/dist/pager.part02.d.ts +54 -0
  739. package/dist/pager.part02.d.ts.map +1 -0
  740. package/dist/pager.part02.js +101 -0
  741. package/dist/pager.part02.js.map +1 -0
  742. package/dist/pager.part03.d.ts +59 -0
  743. package/dist/pager.part03.d.ts.map +1 -0
  744. package/dist/pager.part03.js +98 -0
  745. package/dist/pager.part03.js.map +1 -0
  746. package/dist/panel-label.d.ts +4 -0
  747. package/dist/panel-label.d.ts.map +1 -0
  748. package/dist/panel-label.js +11 -0
  749. package/dist/panel-label.js.map +1 -0
  750. package/dist/panel-types.d.ts +23 -0
  751. package/dist/panel-types.d.ts.map +1 -0
  752. package/dist/panel-types.js +2 -0
  753. package/dist/panel-types.js.map +1 -0
  754. package/dist/panels.d.ts +2 -66
  755. package/dist/panels.d.ts.map +1 -1
  756. package/dist/panels.js +3 -12
  757. package/dist/panels.js.map +1 -1
  758. package/dist/pipeline/middleware/surface-shaders.d.ts +3 -36
  759. package/dist/pipeline/middleware/surface-shaders.d.ts.map +1 -1
  760. package/dist/pipeline/middleware/surface-shaders.js +2 -165
  761. package/dist/pipeline/middleware/surface-shaders.js.map +1 -1
  762. package/dist/pipeline/middleware/surface-shaders.part01.d.ts +36 -0
  763. package/dist/pipeline/middleware/surface-shaders.part01.d.ts.map +1 -0
  764. package/dist/pipeline/middleware/surface-shaders.part01.js +51 -0
  765. package/dist/pipeline/middleware/surface-shaders.part01.js.map +1 -0
  766. package/dist/pipeline/middleware/surface-shaders.part02.d.ts +8 -0
  767. package/dist/pipeline/middleware/surface-shaders.part02.d.ts.map +1 -0
  768. package/dist/pipeline/middleware/surface-shaders.part02.js +63 -0
  769. package/dist/pipeline/middleware/surface-shaders.part02.js.map +1 -0
  770. package/dist/pipeline/middleware/surface-shaders.part03.d.ts +12 -0
  771. package/dist/pipeline/middleware/surface-shaders.part03.d.ts.map +1 -0
  772. package/dist/pipeline/middleware/surface-shaders.part03.js +57 -0
  773. package/dist/pipeline/middleware/surface-shaders.part03.js.map +1 -0
  774. package/dist/runtime-binding.d.ts +4 -57
  775. package/dist/runtime-binding.d.ts.map +1 -1
  776. package/dist/runtime-binding.js +3 -281
  777. package/dist/runtime-binding.js.map +1 -1
  778. package/dist/runtime-binding.part01.d.ts +51 -0
  779. package/dist/runtime-binding.part01.d.ts.map +1 -0
  780. package/dist/runtime-binding.part01.js +52 -0
  781. package/dist/runtime-binding.part01.js.map +1 -0
  782. package/dist/runtime-binding.part02.d.ts +9 -0
  783. package/dist/runtime-binding.part02.d.ts.map +1 -0
  784. package/dist/runtime-binding.part02.js +47 -0
  785. package/dist/runtime-binding.part02.js.map +1 -0
  786. package/dist/runtime-binding.part03.d.ts +4 -0
  787. package/dist/runtime-binding.part03.d.ts.map +1 -0
  788. package/dist/runtime-binding.part03.js +65 -0
  789. package/dist/runtime-binding.part03.js.map +1 -0
  790. package/dist/runtime-binding.part04.d.ts +13 -0
  791. package/dist/runtime-binding.part04.d.ts.map +1 -0
  792. package/dist/runtime-binding.part04.js +55 -0
  793. package/dist/runtime-binding.part04.js.map +1 -0
  794. package/dist/runtime-binding.part05.d.ts +8 -0
  795. package/dist/runtime-binding.part05.d.ts.map +1 -0
  796. package/dist/runtime-binding.part05.js +79 -0
  797. package/dist/runtime-binding.part05.js.map +1 -0
  798. package/dist/runtime-buffers.d.ts +13 -0
  799. package/dist/runtime-buffers.d.ts.map +1 -0
  800. package/dist/runtime-buffers.js +55 -0
  801. package/dist/runtime-buffers.js.map +1 -0
  802. package/dist/runtime-bus.d.ts +6 -0
  803. package/dist/runtime-bus.d.ts.map +1 -0
  804. package/dist/runtime-bus.js +47 -0
  805. package/dist/runtime-bus.js.map +1 -0
  806. package/dist/runtime-commands.d.ts +31 -0
  807. package/dist/runtime-commands.d.ts.map +1 -0
  808. package/dist/runtime-commands.js +12 -0
  809. package/dist/runtime-commands.js.map +1 -0
  810. package/dist/runtime-contract.d.ts +54 -0
  811. package/dist/runtime-contract.d.ts.map +1 -0
  812. package/dist/runtime-contract.js +2 -0
  813. package/dist/runtime-contract.js.map +1 -0
  814. package/dist/runtime-crash.d.ts +10 -0
  815. package/dist/runtime-crash.d.ts.map +1 -0
  816. package/dist/runtime-crash.js +46 -0
  817. package/dist/runtime-crash.js.map +1 -0
  818. package/dist/runtime-engine-buffers.d.ts +32 -0
  819. package/dist/runtime-engine-buffers.d.ts.map +1 -0
  820. package/dist/runtime-engine-buffers.js +48 -0
  821. package/dist/runtime-engine-buffers.js.map +1 -0
  822. package/dist/runtime-engine-component-contract.d.ts +45 -0
  823. package/dist/runtime-engine-component-contract.d.ts.map +1 -0
  824. package/dist/runtime-engine-component-contract.js +2 -0
  825. package/dist/runtime-engine-component-contract.js.map +1 -0
  826. package/dist/runtime-engine-component-create.d.ts +4 -0
  827. package/dist/runtime-engine-component-create.d.ts.map +1 -0
  828. package/dist/runtime-engine-component-create.js +39 -0
  829. package/dist/runtime-engine-component-create.js.map +1 -0
  830. package/dist/runtime-engine-component-input.d.ts +7 -0
  831. package/dist/runtime-engine-component-input.d.ts.map +1 -0
  832. package/dist/runtime-engine-component-input.js +39 -0
  833. package/dist/runtime-engine-component-input.js.map +1 -0
  834. package/dist/runtime-engine-component-layout.d.ts +25 -0
  835. package/dist/runtime-engine-component-layout.d.ts.map +1 -0
  836. package/dist/runtime-engine-component-layout.js +23 -0
  837. package/dist/runtime-engine-component-layout.js.map +1 -0
  838. package/dist/runtime-engine-hit-test.d.ts +4 -0
  839. package/dist/runtime-engine-hit-test.d.ts.map +1 -0
  840. package/dist/runtime-engine-hit-test.js +40 -0
  841. package/dist/runtime-engine-hit-test.js.map +1 -0
  842. package/dist/runtime-engine-input.d.ts +53 -0
  843. package/dist/runtime-engine-input.d.ts.map +1 -0
  844. package/dist/runtime-engine-input.js +9 -0
  845. package/dist/runtime-engine-input.js.map +1 -0
  846. package/dist/runtime-engine-layouts.d.ts +25 -0
  847. package/dist/runtime-engine-layouts.d.ts.map +1 -0
  848. package/dist/runtime-engine-layouts.js +72 -0
  849. package/dist/runtime-engine-layouts.js.map +1 -0
  850. package/dist/runtime-engine-route.d.ts +6 -0
  851. package/dist/runtime-engine-route.d.ts.map +1 -0
  852. package/dist/runtime-engine-route.js +54 -0
  853. package/dist/runtime-engine-route.js.map +1 -0
  854. package/dist/runtime-engine-state.d.ts +11 -0
  855. package/dist/runtime-engine-state.d.ts.map +1 -0
  856. package/dist/runtime-engine-state.js +15 -0
  857. package/dist/runtime-engine-state.js.map +1 -0
  858. package/dist/runtime-engine-view-stack.d.ts +25 -0
  859. package/dist/runtime-engine-view-stack.d.ts.map +1 -0
  860. package/dist/runtime-engine-view-stack.js +70 -0
  861. package/dist/runtime-engine-view-stack.js.map +1 -0
  862. package/dist/runtime-engine.d.ts +11 -222
  863. package/dist/runtime-engine.d.ts.map +1 -1
  864. package/dist/runtime-engine.js +10 -467
  865. package/dist/runtime-engine.js.map +1 -1
  866. package/dist/runtime-format.d.ts +7 -0
  867. package/dist/runtime-format.d.ts.map +1 -0
  868. package/dist/runtime-format.js +35 -0
  869. package/dist/runtime-format.js.map +1 -0
  870. package/dist/runtime-input.d.ts +8 -0
  871. package/dist/runtime-input.d.ts.map +1 -0
  872. package/dist/runtime-input.js +52 -0
  873. package/dist/runtime-input.js.map +1 -0
  874. package/dist/runtime-loop.d.ts +5 -0
  875. package/dist/runtime-loop.d.ts.map +1 -0
  876. package/dist/runtime-loop.js +90 -0
  877. package/dist/runtime-loop.js.map +1 -0
  878. package/dist/runtime-messages.d.ts +38 -0
  879. package/dist/runtime-messages.d.ts.map +1 -0
  880. package/dist/runtime-messages.js +19 -0
  881. package/dist/runtime-messages.js.map +1 -0
  882. package/dist/runtime-pipeline.d.ts +11 -0
  883. package/dist/runtime-pipeline.d.ts.map +1 -0
  884. package/dist/runtime-pipeline.js +37 -0
  885. package/dist/runtime-pipeline.js.map +1 -0
  886. package/dist/runtime-render.d.ts +5 -0
  887. package/dist/runtime-render.d.ts.map +1 -0
  888. package/dist/runtime-render.js +115 -0
  889. package/dist/runtime-render.js.map +1 -0
  890. package/dist/runtime-shutdown.d.ts +9 -0
  891. package/dist/runtime-shutdown.d.ts.map +1 -0
  892. package/dist/runtime-shutdown.js +65 -0
  893. package/dist/runtime-shutdown.js.map +1 -0
  894. package/dist/runtime-startup.d.ts +10 -0
  895. package/dist/runtime-startup.d.ts.map +1 -0
  896. package/dist/runtime-startup.js +35 -0
  897. package/dist/runtime-startup.js.map +1 -0
  898. package/dist/runtime.d.ts +3 -21
  899. package/dist/runtime.d.ts.map +1 -1
  900. package/dist/runtime.js +2 -531
  901. package/dist/runtime.js.map +1 -1
  902. package/dist/status-bar-layout.d.ts +19 -0
  903. package/dist/status-bar-layout.d.ts.map +1 -0
  904. package/dist/status-bar-layout.js +71 -0
  905. package/dist/status-bar-layout.js.map +1 -0
  906. package/dist/status-bar.d.ts +2 -13
  907. package/dist/status-bar.d.ts.map +1 -1
  908. package/dist/status-bar.js +2 -83
  909. package/dist/status-bar.js.map +1 -1
  910. package/dist/subapp/adapter.d.ts +12 -0
  911. package/dist/subapp/adapter.d.ts.map +1 -0
  912. package/dist/subapp/adapter.js +17 -0
  913. package/dist/subapp/adapter.js.map +1 -0
  914. package/dist/subapp/mount.d.ts +1 -17
  915. package/dist/subapp/mount.d.ts.map +1 -1
  916. package/dist/subapp/mount.js +1 -22
  917. package/dist/subapp/mount.js.map +1 -1
  918. package/dist/surface-diff-engine.d.ts +5 -0
  919. package/dist/surface-diff-engine.d.ts.map +1 -0
  920. package/dist/surface-diff-engine.js +72 -0
  921. package/dist/surface-diff-engine.js.map +1 -0
  922. package/dist/surface-diff.d.ts +4 -35
  923. package/dist/surface-diff.d.ts.map +1 -1
  924. package/dist/surface-diff.js +3 -199
  925. package/dist/surface-diff.js.map +1 -1
  926. package/dist/surface-diff.part01.d.ts +34 -0
  927. package/dist/surface-diff.part01.d.ts.map +1 -0
  928. package/dist/surface-diff.part01.js +11 -0
  929. package/dist/surface-diff.part01.js.map +1 -0
  930. package/dist/surface-diff.part02.d.ts +8 -0
  931. package/dist/surface-diff.part02.d.ts.map +1 -0
  932. package/dist/surface-diff.part02.js +73 -0
  933. package/dist/surface-diff.part02.js.map +1 -0
  934. package/dist/surface-diff.part03.d.ts +12 -0
  935. package/dist/surface-diff.part03.d.ts.map +1 -0
  936. package/dist/surface-diff.part03.js +63 -0
  937. package/dist/surface-diff.part03.js.map +1 -0
  938. package/dist/timeline-builder.d.ts +3 -0
  939. package/dist/timeline-builder.d.ts.map +1 -0
  940. package/dist/timeline-builder.js +23 -0
  941. package/dist/timeline-builder.js.map +1 -0
  942. package/dist/timeline-compile.d.ts +3 -0
  943. package/dist/timeline-compile.d.ts.map +1 -0
  944. package/dist/timeline-compile.js +60 -0
  945. package/dist/timeline-compile.js.map +1 -0
  946. package/dist/timeline-contract.d.ts +102 -0
  947. package/dist/timeline-contract.d.ts.map +1 -0
  948. package/dist/timeline-contract.js +2 -0
  949. package/dist/timeline-contract.js.map +1 -0
  950. package/dist/timeline-position.d.ts +10 -0
  951. package/dist/timeline-position.d.ts.map +1 -0
  952. package/dist/timeline-position.js +55 -0
  953. package/dist/timeline-position.js.map +1 -0
  954. package/dist/timeline-runtime.d.ts +3 -0
  955. package/dist/timeline-runtime.d.ts.map +1 -0
  956. package/dist/timeline-runtime.js +63 -0
  957. package/dist/timeline-runtime.js.map +1 -0
  958. package/dist/timeline-track-step.d.ts +3 -0
  959. package/dist/timeline-track-step.d.ts.map +1 -0
  960. package/dist/timeline-track-step.js +58 -0
  961. package/dist/timeline-track-step.js.map +1 -0
  962. package/dist/timeline-utils.d.ts +2 -0
  963. package/dist/timeline-utils.d.ts.map +1 -0
  964. package/dist/timeline-utils.js +6 -0
  965. package/dist/timeline-utils.js.map +1 -0
  966. package/dist/timeline.d.ts +5 -186
  967. package/dist/timeline.d.ts.map +1 -1
  968. package/dist/timeline.js +4 -329
  969. package/dist/timeline.js.map +1 -1
  970. package/dist/types.d.ts +4 -118
  971. package/dist/types.d.ts.map +1 -1
  972. package/dist/types.js +2 -32
  973. package/dist/types.js.map +1 -1
  974. package/package.json +3 -3
package/dist/app-frame.js CHANGED
@@ -1,1809 +1,5 @@
1
1
  /**
2
- * `appFrame()` — high-level TEA app shell.
3
- *
4
- * Provides tabs, pane focus/scroll isolation, shell key handling, help,
5
- * panel-scoped overlay context, and optional frame-level command palette.
2
+ * Public facade for the high-level TEA application frame.
6
3
  */
7
- import { cloneContextWithResolvedTheme, createSurface, perfOverlaySurface, setDefaultContext, resolveClock, resolveSafeCtx, } from '@flyingrobots/bijou';
8
- import { createKeyMap, formatKeyCombo } from './keybindings.js';
9
- import { isKeyMsg, isMouseMsg, isResizeMsg } from './types.js';
10
- import { quit } from './commands.js';
11
- import { runWithLifecycleHooks } from './runtime.js';
12
- import { compositeSurfaceInto, modal } from './overlay.js';
13
- import { isShellQuitConfirmAccept, isShellQuitConfirmDismiss, isShellQuitRequest, renderShellQuitOverlay, shouldUseShellQuitConfirm, } from './shell-quit.js';
14
- import { commandPaletteSurface, commandPaletteKeyMap, } from './command-palette.js';
15
- import { restoreLayoutState } from './layout-preset.js';
16
- import { createNotificationState, dismissNotification, hitTestNotificationStack, notificationsNeedTick, pushNotification, renderNotificationStack, tickNotifications, trimNotificationsToViewport, } from './notification.js';
17
- import { isFrameScopedMsg, isPageScopedMsg, wrapCmdForPage, emitMsg, emitMsgForPage, wrapFrameMsg, } from './app-frame-types.js';
18
- import { createFrameKeyMap, frameBodyRect, mergeBindingSources, resolveFramePageText, } from './app-frame-utils.js';
19
- import { renderHelpOverlay, isHelpScrollAction, resolveFrameShellThemeChoices, resolveCurrentShellTheme, resolveNextShellTheme, resolveShellThemeModeToggle, resolveShellThemeForContext, resolveFrameSettings, resolveFrameNotificationCenter, resolveSettingsLayout, resolveNotificationCenterLayout, resolveInputAreas, findInputAreaByPaneId, moveSettingsFocus, scrollSettingsBy, clampSettingsScroll, scrollNotificationCenterBy, cycleNotificationCenterFilter, clampSettingsFocus, renderSettingsDrawer, renderNotificationCenterDrawer, resolveNotificationFooterCue, } from './app-frame-overlays.js';
20
- import { activeFrameLayer, describeFrameRuntimeViewStack, projectFrameControls, } from './app-frame-layers.js';
21
- import { applyRuntimeCommandBuffer, bufferRuntimeRouteResult, createRuntimeBuffers, createRuntimeRetainedLayouts, retainRuntimeLayout, routeRuntimeInput, } from './runtime-engine.js';
22
- import { frameMessage, frameNotificationFilterLabel, } from './app-frame-i18n.js';
23
- import { resolveHeaderLine, renderHelpLine, renderPageContent, renderPageContentInto, renderMaximizedPane, renderMaximizedPaneInto, renderTransition, createFramePaneScratchPool, } from './app-frame-render.js';
24
- import { applyFrameAction, scrollFocusedPane, switchTab, syncPageFrameState, } from './app-frame-actions.js';
25
- import { handlePaletteKey, openCommandPalette, openSearchPalette, } from './app-frame-palette.js';
26
- /** Stable values for shell theme mode siblings. */
27
- export const FRAME_SHELL_THEME_MODE_SUPPORT = Object.freeze({
28
- single: 'single',
29
- paired: 'paired',
30
- });
31
- export { FRAME_MSG_TOKEN, PAGE_MSG_TOKEN, emitMsg, emitFrameAction, emitMsgForPage, isFrameScopedMsg, isPageScopedMsg, notify, wrapCmdForPage, wrapFrameMsg, wrapPageMsg, } from './app-frame-types.js';
32
- export { activeFrameLayer, describeFrameLayerStack, describeFrameRuntimeViewStack, projectFrameControls, underlyingFrameLayer, } from './app-frame-layers.js';
33
- // ---------------------------------------------------------------------------
34
- // Frame Notification Helpers
35
- // ---------------------------------------------------------------------------
36
- const FRAME_NOTIFICATION_TICK_MS = 40;
37
- const DEFAULT_FRAME_NOTIFICATION_DURATION_MS = 6_000;
38
- const SETTINGS_FEEDBACK_TOAST_WIDTH = 40;
39
- const EMPTY_RUNTIME_LAYOUTS = createRuntimeRetainedLayouts();
40
- function createQuitHelpKeys(i18n) {
41
- const t = (id, fallback) => frameMessage(i18n, id, fallback);
42
- return createKeyMap()
43
- .group(t('help.group.quit', 'Quit'), (g) => g
44
- .bind('q', t('help.key.quit', 'Quit'), { type: 'toggle-help' })
45
- .bind('escape', t('help.key.quit', 'Quit'), { type: 'toggle-help' })
46
- .bind('ctrl+c', t('help.key.quit', 'Quit'), { type: 'toggle-help' }));
47
- }
48
- function createHelpLayerHelpKeys(i18n) {
49
- const t = (id, fallback) => frameMessage(i18n, id, fallback);
50
- return createKeyMap()
51
- .group(t('help.group.help', 'Help'), (g) => g
52
- .bind('escape', t('help.key.closeHelp', 'Close help'), { type: 'noop' })
53
- .bind('?', t('help.key.closeHelp', 'Close help'), { type: 'noop' })
54
- .bind('up', t('key.scrollUp', 'Scroll up'), { type: 'noop' })
55
- .bind('down', t('key.scrollDown', 'Scroll down'), { type: 'noop' })
56
- .bind('j', t('key.scrollDown', 'Scroll down'), { type: 'noop' })
57
- .bind('k', t('key.scrollUp', 'Scroll up'), { type: 'noop' })
58
- .bind('d', t('key.pageDown', 'Page down'), { type: 'noop' })
59
- .bind('u', t('key.pageUp', 'Page up'), { type: 'noop' })
60
- .bind('g', t('key.top', 'Top'), { type: 'noop' })
61
- .bind('shift+g', t('key.bottom', 'Bottom'), { type: 'noop' }));
62
- }
63
- function createSettingsHelpKeys(i18n) {
64
- const t = (id, fallback) => frameMessage(i18n, id, fallback);
65
- return createKeyMap()
66
- .group(t('help.group.settings', 'Settings'), (g) => g
67
- .bind('escape', t('help.key.closeSettings', 'Close settings'), { type: 'toggle-settings' })
68
- .bind('f2', t('help.key.closeSettings', 'Close settings'), { type: 'toggle-settings' })
69
- .bind('up', t('help.key.previousRow', 'Previous row'), { type: 'scroll-up' })
70
- .bind('down', t('help.key.nextRow', 'Next row'), { type: 'scroll-down' })
71
- .bind('enter', t('help.key.activateSetting', 'Activate setting'), { type: 'toggle-settings' })
72
- .bind('space', t('help.key.activateSetting', 'Activate setting'), { type: 'toggle-settings' })
73
- .bind('j', t('key.scrollDown', 'Scroll down'), { type: 'scroll-down' })
74
- .bind('k', t('key.scrollUp', 'Scroll up'), { type: 'scroll-up' })
75
- .bind('d', t('key.pageDown', 'Page down'), { type: 'page-down' })
76
- .bind('u', t('key.pageUp', 'Page up'), { type: 'page-up' })
77
- .bind('g', t('key.top', 'Top'), { type: 'top' })
78
- .bind('shift+g', t('key.bottom', 'Bottom'), { type: 'bottom' })
79
- .bind('/', t('key.search', 'Search'), { type: 'open-search' })
80
- .bind('ctrl+p', t('key.openPalette', 'Open command palette'), { type: 'open-palette' })
81
- .bind(':', t('key.openPalette', 'Open command palette'), { type: 'open-palette' })
82
- .bind('?', t('key.toggleHelp', 'Toggle help'), { type: 'toggle-help' }));
83
- }
84
- function createNotificationCenterHelpKeys(i18n) {
85
- const t = (id, fallback) => frameMessage(i18n, id, fallback);
86
- return createKeyMap()
87
- .group(t('help.group.notifications', 'Notifications'), (g) => g
88
- .bind('shift+n', t('help.key.closeNotifications', 'Close notification center'), { type: 'noop' })
89
- .bind('up', t('key.scrollUp', 'Scroll up'), { type: 'noop' })
90
- .bind('down', t('key.scrollDown', 'Scroll down'), { type: 'noop' })
91
- .bind('j', t('key.scrollDown', 'Scroll down'), { type: 'noop' })
92
- .bind('k', t('key.scrollUp', 'Scroll up'), { type: 'noop' })
93
- .bind('d', t('key.pageDown', 'Page down'), { type: 'noop' })
94
- .bind('u', t('key.pageUp', 'Page up'), { type: 'noop' })
95
- .bind('g', t('key.top', 'Top'), { type: 'noop' })
96
- .bind('shift+g', t('key.bottom', 'Bottom'), { type: 'noop' })
97
- .bind('f', t('help.key.cycleFilter', 'Cycle filter'), { type: 'noop' })
98
- .bind('/', t('key.search', 'Search'), { type: 'noop' })
99
- .bind('ctrl+p', t('key.openPalette', 'Open command palette'), { type: 'noop' })
100
- .bind(':', t('key.openPalette', 'Open command palette'), { type: 'noop' })
101
- .bind('?', t('key.toggleHelp', 'Toggle help'), { type: 'noop' }));
102
- }
103
- function createQuitConfirmHelpKeys(i18n) {
104
- const t = (id, fallback) => frameMessage(i18n, id, fallback);
105
- return createKeyMap()
106
- .group(t('help.group.quit', 'Quit'), (g) => g
107
- .bind('y', t('help.key.quit', 'Quit'), { type: 'noop' })
108
- .bind('enter', t('help.key.quit', 'Quit'), { type: 'noop' })
109
- .bind('n', t('help.key.stay', 'Stay'), { type: 'noop' })
110
- .bind('escape', t('help.key.stay', 'Stay'), { type: 'noop' })
111
- .bind('q', t('help.key.stay', 'Stay'), { type: 'noop' }));
112
- }
113
- function resolveFrameNotificationOptions(options) {
114
- if (options.runtimeNotifications === false) {
115
- return {
116
- enabled: false,
117
- placement: 'LOWER_RIGHT',
118
- durationMs: DEFAULT_FRAME_NOTIFICATION_DURATION_MS,
119
- margin: 1,
120
- gap: 1,
121
- overflow: 'wrap',
122
- };
123
- }
124
- const configured = options.runtimeNotifications === true || options.runtimeNotifications == null
125
- ? {}
126
- : options.runtimeNotifications;
127
- return {
128
- enabled: configured.enabled ?? true,
129
- placement: configured.placement ?? 'LOWER_RIGHT',
130
- durationMs: configured.durationMs ?? DEFAULT_FRAME_NOTIFICATION_DURATION_MS,
131
- margin: configured.margin ?? 1,
132
- gap: configured.gap ?? 1,
133
- overflow: configured.overflow ?? 'wrap',
134
- };
135
- }
136
- function createFrameNotificationTickCmd() {
137
- return async (_emit, caps) => {
138
- if (!caps.sleep) {
139
- throw new Error('createFrameNotificationTickCmd requires sleep capability');
140
- }
141
- await caps.sleep(FRAME_NOTIFICATION_TICK_MS);
142
- return wrapFrameMsg({
143
- type: 'notification-tick',
144
- atMs: caps.now?.() ?? 0,
145
- });
146
- };
147
- }
148
- function cloneShellThemeContext(ctx, resolvedTheme) {
149
- return cloneContextWithResolvedTheme(ctx, resolvedTheme);
150
- }
151
- function readStageDuration(timings, stage) {
152
- return timings.find((timing) => timing.stage === stage)?.durationMs ?? 0;
153
- }
154
- export function summarizeFrameTimings(timings, frameBudgetMs) {
155
- const frameTimeMs = timings.reduce((total, timing) => total + timing.durationMs, 0);
156
- return {
157
- frameTimeMs,
158
- viewTimeMs: readStageDuration(timings, 'Layout'),
159
- diffTimeMs: readStageDuration(timings, 'Diff'),
160
- frameBudgetMs,
161
- frameOverBudget: frameBudgetMs != null && frameTimeMs > frameBudgetMs,
162
- };
163
- }
164
- export function renderFramePerfHudOverlay(telemetry, options = {}) {
165
- const refreshRate = telemetry.refreshRate ?? options.ctx?.runtime.refreshRate ?? 60;
166
- const fps = telemetry.frameTimeMs > 0
167
- ? Math.min(refreshRate, 1000 / telemetry.frameTimeMs)
168
- : refreshRate;
169
- const width = Math.max(12, Math.min(40, telemetry.columns - 2));
170
- const surface = perfOverlaySurface({
171
- fps,
172
- frameTimeMs: telemetry.frameTimeMs,
173
- width: telemetry.columns,
174
- height: telemetry.rows,
175
- extras: [
176
- { label: 'view', value: `${telemetry.viewTimeMs.toFixed(2)} ms` },
177
- { label: 'diff', value: `${telemetry.diffTimeMs.toFixed(2)} ms` },
178
- ],
179
- }, {
180
- title: frameMessage(options.i18n, 'perfHud.title', 'Perf HUD'),
181
- width,
182
- showChart: false,
183
- borderToken: options.ctx?.border('primary'),
184
- bgToken: options.ctx?.surface('elevated'),
185
- ctx: options.ctx,
186
- });
187
- return {
188
- content: '',
189
- surface,
190
- row: 1,
191
- col: Math.max(0, telemetry.columns - surface.width - 1),
192
- };
193
- }
194
- function applyFrameTimingSnapshot(model, snapshot) {
195
- if (model.frameTimeMs === snapshot.frameTimeMs
196
- && model.viewTimeMs === snapshot.viewTimeMs
197
- && model.diffTimeMs === snapshot.diffTimeMs
198
- && model.frameBudgetMs === snapshot.frameBudgetMs
199
- && model.frameOverBudget === snapshot.frameOverBudget) {
200
- return model;
201
- }
202
- return {
203
- ...model,
204
- frameTimeMs: snapshot.frameTimeMs,
205
- viewTimeMs: snapshot.viewTimeMs,
206
- diffTimeMs: snapshot.diffTimeMs,
207
- frameBudgetMs: snapshot.frameBudgetMs,
208
- frameOverBudget: snapshot.frameOverBudget,
209
- };
210
- }
211
- function resolveFrameBudgetMs(runOptions, fallbackCtx) {
212
- if (runOptions?.frameBudgetMs != null)
213
- return runOptions.frameBudgetMs;
214
- const refreshRate = runOptions?.ctx?.runtime.refreshRate ?? fallbackCtx?.runtime.refreshRate;
215
- if (refreshRate == null || !Number.isFinite(refreshRate) || refreshRate <= 0) {
216
- return undefined;
217
- }
218
- return 1_000 / refreshRate;
219
- }
220
- // Factory
221
- // ---------------------------------------------------------------------------
222
- /**
223
- * Create a fully framed TEA app shell.
224
- */
225
- export function createFramedApp(options) {
226
- if (options.pages.length === 0) {
227
- throw new Error('createFramedApp: "pages" must contain at least one page');
228
- }
229
- const pagesById = new Map();
230
- for (const page of options.pages) {
231
- if (pagesById.has(page.id)) {
232
- throw new Error(`createFramedApp: duplicate page id "${page.id}"`);
233
- }
234
- pagesById.set(page.id, page);
235
- }
236
- const pageOrder = options.pages.map((p) => p.id);
237
- const defaultPageId = options.defaultPageId ?? pageOrder.at(0);
238
- if (defaultPageId === undefined || !pagesById.has(defaultPageId)) {
239
- throw new Error(`createFramedApp: defaultPageId "${String(defaultPageId)}" not found in pages`);
240
- }
241
- const shellThemeSpecs = options.shellThemes ?? [];
242
- let defaultFrameCtx = options.ctx ?? resolveSafeCtx();
243
- let resolvedShellThemes = [];
244
- const enableShellThemeSettings = shellThemeSpecs.length > 1
245
- || shellThemeSpecs.some((theme) => (theme.modes?.length ?? 0) > 1);
246
- const usesAmbientDefaultContext = options.ctx == null && defaultFrameCtx != null;
247
- let frameCtx = options.ctx;
248
- let frameCtxShellThemeId;
249
- let useRunScopedFrameCtx = false;
250
- function ensureResolvedShellThemes(explicitCtx) {
251
- if (shellThemeSpecs.length === 0 || resolvedShellThemes.length > 0)
252
- return;
253
- const baseCtx = explicitCtx ?? frameCtx ?? options.ctx ?? resolveSafeCtx();
254
- if (baseCtx == null) {
255
- throw new Error('createFramedApp: shellThemes requires options.ctx, app.run({ ctx }), or a default Bijou context');
256
- }
257
- defaultFrameCtx ??= baseCtx;
258
- resolvedShellThemes = resolveFrameShellThemeChoices(shellThemeSpecs, defaultFrameCtx);
259
- }
260
- if (frameCtx != null) {
261
- ensureResolvedShellThemes(frameCtx);
262
- frameCtxShellThemeId = resolveShellThemeForContext(resolvedShellThemes, frameCtx)?.id;
263
- }
264
- function resolveFrameCtx() {
265
- return frameCtx ?? options.ctx ?? resolveSafeCtx();
266
- }
267
- function resolveFrameThemeCtx(activeShellThemeId) {
268
- const baseCtx = resolveFrameCtx();
269
- ensureResolvedShellThemes(baseCtx);
270
- if (defaultFrameCtx == null)
271
- return baseCtx;
272
- const activeTheme = resolveCurrentShellTheme(resolvedShellThemes, activeShellThemeId);
273
- if (activeTheme == null)
274
- return baseCtx;
275
- if (frameCtx != null && frameCtxShellThemeId === activeTheme.id) {
276
- return frameCtx;
277
- }
278
- if (resolveShellThemeForContext(resolvedShellThemes, baseCtx)?.id === activeTheme.id) {
279
- return baseCtx;
280
- }
281
- return cloneShellThemeContext(defaultFrameCtx, activeTheme.resolvedTheme);
282
- }
283
- function publishShellThemeContext(nextTheme) {
284
- ensureResolvedShellThemes(resolveFrameCtx());
285
- if (defaultFrameCtx == null)
286
- return resolveFrameCtx();
287
- frameCtx = cloneShellThemeContext(defaultFrameCtx, nextTheme.resolvedTheme);
288
- frameCtxShellThemeId = nextTheme.id;
289
- if (usesAmbientDefaultContext && !useRunScopedFrameCtx) {
290
- setDefaultContext(frameCtx);
291
- }
292
- options.onShellThemeChange?.({
293
- shellTheme: nextTheme.shellTheme,
294
- shellThemeSpec: nextTheme.shellThemeSpec,
295
- shellThemeId: nextTheme.shellThemeId,
296
- shellThemeLabel: nextTheme.shellThemeLabel,
297
- modeId: nextTheme.modeId,
298
- modeLabel: nextTheme.modeLabel,
299
- ctx: frameCtx,
300
- });
301
- return frameCtx;
302
- }
303
- const frameKeys = createFrameKeyMap({
304
- enableSettings: options.settings != null || enableShellThemeSettings,
305
- enableShellThemeModeToggle: shellThemeSpecs.some((theme) => (theme.modes?.length ?? 0) > 1),
306
- enableNotifications: options.notificationCenter != null || options.runtimeNotifications !== false,
307
- i18n: options.i18n,
308
- });
309
- const quitHelpKeys = createQuitHelpKeys(options.i18n);
310
- const helpLayerHelpKeys = createHelpLayerHelpKeys(options.i18n);
311
- const settingsHelpKeys = createSettingsHelpKeys(options.i18n);
312
- const notificationCenterHelpKeys = createNotificationCenterHelpKeys(options.i18n);
313
- const quitConfirmHelpKeys = createQuitConfirmHelpKeys(options.i18n);
314
- const frameNotificationOptions = resolveFrameNotificationOptions(options);
315
- let composedFrameScratch = null;
316
- let headerScratch;
317
- let helpLineScratch;
318
- const paneScratchPool = createFramePaneScratchPool();
319
- let workspaceLayoutCache;
320
- const paletteKeys = commandPaletteKeyMap({
321
- focusNext: { type: 'cp-next' },
322
- focusPrev: { type: 'cp-prev' },
323
- pageDown: { type: 'cp-page-down' },
324
- pageUp: { type: 'cp-page-up' },
325
- select: { type: 'cp-select' },
326
- close: { type: 'cp-close' },
327
- });
328
- function bindingComboKey(binding) {
329
- const combo = binding.combo;
330
- return [combo.key, combo.ctrl ? '1' : '0', combo.alt ? '1' : '0', combo.shift ? '1' : '0'].join('|');
331
- }
332
- function findBindingForMessage(bindings, msg) {
333
- const comboKey = [msg.key, msg.ctrl ? '1' : '0', msg.alt ? '1' : '0', msg.shift ? '1' : '0'].join('|');
334
- return bindings.find((binding) => binding.enabled && bindingComboKey(binding) === comboKey);
335
- }
336
- function queueFrameKeyCollisionWarning(model, msg, teaCmds) {
337
- if (!frameNotificationOptions.enabled)
338
- return model;
339
- if ((options.keyPriority ?? 'frame-first') !== 'frame-first')
340
- return model;
341
- if (model.warnedFrameKeyCollisionPages[model.activePageId])
342
- return model;
343
- const activePage = pagesById.get(model.activePageId);
344
- if (activePage?.keyMap == null)
345
- return model;
346
- const pageBinding = findBindingForMessage(activePage.keyMap.bindings(), msg);
347
- const frameBinding = findBindingForMessage(frameKeys.bindings(), msg);
348
- if (pageBinding == null || frameBinding == null)
349
- return model;
350
- const warningCmd = () => wrapFrameMsg({
351
- type: 'runtime-issue',
352
- issue: {
353
- level: 'warning',
354
- source: 'runtime',
355
- message: `Page "${model.activePageId}" key binding ${formatKeyCombo(pageBinding.combo)} `
356
- + `("${pageBinding.description}") is shadowed by the frame binding `
357
- + `"${frameBinding.description}" under keyPriority="frame-first". `
358
- + `Use keyPriority: 'page-first' or choose a different page binding.`,
359
- atMs: resolveClock(resolveFrameCtx()).now(),
360
- },
361
- });
362
- teaCmds.push(warningCmd);
363
- return {
364
- ...model,
365
- warnedFrameKeyCollisionPages: {
366
- ...model.warnedFrameKeyCollisionPages,
367
- [model.activePageId]: true,
368
- },
369
- };
370
- }
371
- function getComposedFrameScratch(width, height) {
372
- if (composedFrameScratch?.width !== width
373
- || composedFrameScratch.height !== height) {
374
- composedFrameScratch = createSurface(width, height);
375
- }
376
- return composedFrameScratch;
377
- }
378
- function closeCommandPalette(model) {
379
- return {
380
- ...model,
381
- commandPalette: undefined,
382
- commandPaletteEntries: undefined,
383
- commandPaletteTitle: undefined,
384
- commandPaletteKind: undefined,
385
- };
386
- }
387
- function applyShellCommand(model, cmd, teaCmds) {
388
- switch (cmd.type) {
389
- case 'close-help':
390
- return { ...model, helpOpen: false, helpScrollY: 0 };
391
- case 'close-settings':
392
- return { ...model, settingsOpen: false };
393
- case 'close-notification-center':
394
- return { ...model, notificationCenterOpen: false, notificationCenterScrollY: 0 };
395
- case 'close-palette':
396
- return closeCommandPalette(model);
397
- case 'close-quit-confirm':
398
- return { ...model, quitConfirmOpen: false };
399
- case 'open-help':
400
- return { ...model, helpOpen: true };
401
- case 'open-quit-confirm': {
402
- if (!shouldUseShellQuitConfirm() || model.quitConfirmOpen)
403
- return model;
404
- return {
405
- ...model,
406
- quitConfirmOpen: true,
407
- helpOpen: false,
408
- helpScrollY: 0,
409
- settingsOpen: false,
410
- notificationCenterOpen: false,
411
- commandPalette: undefined,
412
- commandPaletteEntries: undefined,
413
- commandPaletteTitle: undefined,
414
- commandPaletteKind: undefined,
415
- };
416
- }
417
- case 'open-search-palette':
418
- return openSearchPalette(model, frameKeys, options, pagesById);
419
- case 'open-command-palette':
420
- return openCommandPalette(model, frameKeys, options, pagesById);
421
- case 'settings-focus-move': {
422
- const layout = resolveSettingsLayout(model, options, pagesById, resolvedShellThemes);
423
- return layout != null ? moveSettingsFocus(model, layout, cmd.delta) : model;
424
- }
425
- case 'settings-scroll': {
426
- const layout = resolveSettingsLayout(model, options, pagesById, resolvedShellThemes);
427
- return layout != null ? scrollSettingsBy(model, layout, cmd.delta) : model;
428
- }
429
- case 'settings-scroll-to': {
430
- const layout = resolveSettingsLayout(model, options, pagesById, resolvedShellThemes);
431
- if (layout == null)
432
- return model;
433
- return { ...model, settingsScrollY: cmd.position === 'top' ? 0 : layout.maxScrollY };
434
- }
435
- case 'activate-settings-row': {
436
- const layout = resolveSettingsLayout(model, options, pagesById, resolvedShellThemes);
437
- if (layout == null)
438
- return model;
439
- const hitRow = layout.rows.find((row) => row.index === cmd.rowIndex);
440
- if (hitRow == null)
441
- return model;
442
- const focusedModel = { ...model, settingsFocusIndex: hitRow.index };
443
- if (hitRow.behavior === 'cycle-shell-theme') {
444
- const [nextModel, cmds] = cycleShellThemeSetting(focusedModel, hitRow.row);
445
- teaCmds.push(...cmds);
446
- return nextModel;
447
- }
448
- if (hitRow.row.action === undefined || hitRow.row.enabled === false || hitRow.row.kind === 'info') {
449
- return focusedModel;
450
- }
451
- const [nextModel, cmds] = activateSettingsRow(focusedModel, hitRow.row);
452
- teaCmds.push(...cmds);
453
- return nextModel;
454
- }
455
- case 'toggle-shell-theme-mode': {
456
- const [nextModel, cmds] = toggleShellThemeMode(model);
457
- teaCmds.push(...cmds);
458
- return nextModel;
459
- }
460
- case 'notification-center-scroll': {
461
- const layout = resolveNotificationCenterLayout(model, options, pagesById, resolveFrameThemeCtx(model.activeShellThemeId));
462
- return layout != null ? scrollNotificationCenterBy(model, layout, cmd.delta) : model;
463
- }
464
- case 'notification-center-scroll-to': {
465
- const layout = resolveNotificationCenterLayout(model, options, pagesById, resolveFrameThemeCtx(model.activeShellThemeId));
466
- if (layout == null)
467
- return model;
468
- return { ...model, notificationCenterScrollY: cmd.position === 'top' ? 0 : layout.maxScrollY };
469
- }
470
- case 'cycle-notification-filter': {
471
- const layout = resolveNotificationCenterLayout(model, options, pagesById, resolveFrameThemeCtx(model.activeShellThemeId));
472
- if (layout == null)
473
- return model;
474
- const [nextModel, cmds] = cycleNotificationCenterFilter(model, layout);
475
- teaCmds.push(...cmds);
476
- return nextModel;
477
- }
478
- case 'warn-frame-key-collision':
479
- return queueFrameKeyCollisionWarning(model, cmd.msg, teaCmds);
480
- case 'help-scroll': {
481
- const helpSource = resolvePresentedLayerContext(model).controlProjection.helpSource;
482
- if (helpSource == null)
483
- return model;
484
- const overlay = renderHelpOverlay(model, helpSource, options.i18n);
485
- const viewportHeight = Math.max(1, overlay.body.height - 1);
486
- const delta = cmd.action === 'down' ? 3
487
- : cmd.action === 'up' ? -3
488
- : cmd.action === 'page-down' ? viewportHeight
489
- : cmd.action === 'page-up' ? -viewportHeight
490
- : cmd.action === 'bottom' ? Infinity
491
- : -Infinity;
492
- return { ...model, helpScrollY: Math.max(0, Math.min(overlay.maxScrollY, overlay.scrollY + delta)) };
493
- }
494
- case 'focus-pane':
495
- return focusPane(model, cmd.paneId);
496
- case 'scroll-focused-pane':
497
- return scrollFocusedPane(model, { type: cmd.direction === 'down' ? 'scroll-down' : 'scroll-up' }, pagesById, options);
498
- case 'switch-tab': {
499
- const [nextModel, cmds] = switchTab(model, cmd.delta, pagesById, options);
500
- teaCmds.push(...cmds);
501
- return nextModel;
502
- }
503
- case 'apply-frame-action': {
504
- const [nextModel, cmds] = applyFrameAction(cmd.action, model, options, pagesById);
505
- teaCmds.push(...cmds);
506
- return nextModel;
507
- }
508
- case 'palette-key': {
509
- const [nextModel, cmds] = handlePaletteKey(cmd.msg, model, paletteKeys, options, pagesById, (action, closedModel) => action.type === 'toggle-shell-theme-mode'
510
- ? toggleShellThemeMode(closedModel)
511
- : undefined);
512
- teaCmds.push(...cmds);
513
- return nextModel;
514
- }
515
- case 'emit-page-msg':
516
- teaCmds.push(emitMsgForPage(cmd.pageId, cmd.msg));
517
- return model;
518
- case 'emit-global-msg':
519
- teaCmds.push(emitMsg(cmd.msg));
520
- return model;
521
- case 'quit':
522
- teaCmds.push(quit());
523
- return model;
524
- case 'dismiss-notification': {
525
- if (!frameNotificationOptions.enabled)
526
- return model;
527
- const nowMs = resolveClock(resolveFrameCtx()).now();
528
- const [nextModel, cmds] = applyFrameNotificationState(model, dismissNotification(model.runtimeNotifications, cmd.notificationId, nowMs), nowMs);
529
- teaCmds.push(...cmds);
530
- return nextModel;
531
- }
532
- case 'observed-key': {
533
- const observed = options.observeKey?.(cmd.msg, cmd.route);
534
- if (observed !== undefined)
535
- teaCmds.push(emitMsgForPage(model.activePageId, observed));
536
- return model;
537
- }
538
- }
539
- }
540
- function drainShellCommandBuffer(model, routeResult) {
541
- const buffers = bufferRuntimeRouteResult(createRuntimeBuffers(), routeResult);
542
- const teaCmds = [];
543
- const { state } = applyRuntimeCommandBuffer(model, buffers.commands, (s, cmd) => applyShellCommand(s, cmd, teaCmds));
544
- return [state, teaCmds];
545
- }
546
- function resolveLayerContext(model) {
547
- const activePage = pagesById.get(model.activePageId);
548
- const activePageModel = model.pageModels[model.activePageId];
549
- if (activePage == null || activePageModel === undefined) {
550
- throw new Error(`createFramedApp: active page "${model.activePageId}" is missing`);
551
- }
552
- const inputAreas = resolveInputAreas(activePage, activePageModel);
553
- const activeInputArea = findInputAreaByPaneId(inputAreas, model.focusedPaneByPage[model.activePageId]);
554
- const modalKeyMap = activePage.modalKeyMap?.(activePageModel);
555
- const pageModalOpen = modalKeyMap != null;
556
- const activeLayer = activeFrameLayer(model, { pageModalOpen });
557
- return {
558
- activePage,
559
- activePageModel,
560
- inputAreas,
561
- activeInputArea,
562
- modalKeyMap,
563
- pageModalOpen,
564
- activeLayer,
565
- };
566
- }
567
- function quitRequestCommands(msg, route) {
568
- if (!shouldUseShellQuitConfirm()) {
569
- return [{ type: 'observed-key', msg, route }, { type: 'quit' }];
570
- }
571
- return [{ type: 'observed-key', msg, route }, { type: 'open-quit-confirm' }];
572
- }
573
- function resolveFrameActionCommands(msg, action, route) {
574
- if (action.type === 'open-search' && options.enableCommandPalette) {
575
- return [{ type: 'observed-key', msg, route }, { type: 'open-search-palette' }];
576
- }
577
- if (action.type === 'open-palette' && options.enableCommandPalette) {
578
- return [{ type: 'observed-key', msg, route }, { type: 'open-command-palette' }];
579
- }
580
- if (action.type === 'toggle-shell-theme-mode') {
581
- return [{ type: 'observed-key', msg, route }, { type: 'toggle-shell-theme-mode' }];
582
- }
583
- return [{ type: 'observed-key', msg, route }, { type: 'apply-frame-action', action }];
584
- }
585
- function handlePaletteLayerKeyCommands(msg, routedLayerKind) {
586
- const obs = { type: 'observed-key', msg, route: 'palette' };
587
- if (msg.ctrl && !msg.alt && msg.key === 'c') {
588
- return quitRequestCommands(msg, 'palette');
589
- }
590
- if (!msg.ctrl && !msg.alt && !msg.shift && msg.key === 'escape') {
591
- return [obs, { type: 'close-palette' }];
592
- }
593
- const frameAction = frameKeys.handle(msg);
594
- if (frameAction?.type === 'open-search') {
595
- return routedLayerKind === 'search'
596
- ? [obs, { type: 'close-palette' }]
597
- : [obs, { type: 'open-search-palette' }];
598
- }
599
- if (frameAction?.type === 'open-palette') {
600
- return routedLayerKind === 'command-palette'
601
- ? [obs, { type: 'close-palette' }]
602
- : [obs, { type: 'open-command-palette' }];
603
- }
604
- if (frameAction?.type === 'toggle-shell-theme-mode') {
605
- return [obs, { type: 'toggle-shell-theme-mode' }];
606
- }
607
- if (frameAction?.type === 'toggle-notifications') {
608
- return [obs, { type: 'close-palette' }, { type: 'apply-frame-action', action: frameAction }];
609
- }
610
- if (frameAction?.type === 'toggle-perf-hud') {
611
- return [obs, { type: 'apply-frame-action', action: frameAction }];
612
- }
613
- return [obs, { type: 'palette-key', msg }];
614
- }
615
- function handleHelpLayerKeyCommands(msg) {
616
- const obs = { type: 'observed-key', msg, route: 'help' };
617
- if (!msg.ctrl && !msg.alt && (msg.key === '?' || msg.key === 'escape')) {
618
- return [obs, { type: 'close-help' }];
619
- }
620
- if (isShellQuitRequest(msg)) {
621
- return quitRequestCommands(msg, 'help');
622
- }
623
- const helpAction = frameKeys.handle(msg);
624
- if (helpAction?.type === 'toggle-shell-theme-mode') {
625
- return [obs, { type: 'toggle-shell-theme-mode' }];
626
- }
627
- if (helpAction?.type === 'toggle-perf-hud') {
628
- return [obs, { type: 'apply-frame-action', action: helpAction }];
629
- }
630
- if (helpAction && isHelpScrollAction(helpAction)) {
631
- const action = helpAction.type === 'scroll-down' ? 'down'
632
- : helpAction.type === 'scroll-up' ? 'up'
633
- : helpAction.type === 'page-down' ? 'page-down'
634
- : helpAction.type === 'page-up' ? 'page-up'
635
- : helpAction.type === 'bottom' ? 'bottom'
636
- : 'top';
637
- return [obs, { type: 'help-scroll', action }];
638
- }
639
- return [obs];
640
- }
641
- function handleSettingsLayerKeyCommands(msg, model) {
642
- const layout = resolveSettingsLayout(model, options, pagesById, resolvedShellThemes);
643
- if (layout == null)
644
- return undefined;
645
- const obs = { type: 'observed-key', msg, route: 'frame' };
646
- if (!msg.ctrl && !msg.alt && (msg.key === 'escape' || msg.key === 'f2')) {
647
- return [obs, { type: 'close-settings' }];
648
- }
649
- if (msg.ctrl && !msg.alt && msg.key === ',') {
650
- return [obs, { type: 'close-settings' }];
651
- }
652
- if (!msg.ctrl && !msg.alt && msg.key === '?') {
653
- return [obs, { type: 'open-help' }];
654
- }
655
- if (isShellQuitRequest(msg)) {
656
- return quitRequestCommands(msg, 'frame');
657
- }
658
- if (options.enableCommandPalette && !msg.ctrl && !msg.alt && msg.key === '/') {
659
- return [obs, { type: 'open-search-palette' }];
660
- }
661
- if (options.enableCommandPalette && ((msg.ctrl && !msg.alt && msg.key === 'p') || (!msg.ctrl && !msg.alt && msg.key === ':'))) {
662
- return [obs, { type: 'open-command-palette' }];
663
- }
664
- const settingsFrameAction = frameKeys.handle(msg);
665
- if (settingsFrameAction?.type === 'toggle-shell-theme-mode') {
666
- return [obs, { type: 'toggle-shell-theme-mode' }];
667
- }
668
- if (settingsFrameAction?.type === 'toggle-notifications') {
669
- return [obs, { type: 'apply-frame-action', action: settingsFrameAction }];
670
- }
671
- if (settingsFrameAction?.type === 'toggle-perf-hud') {
672
- return [obs, { type: 'apply-frame-action', action: settingsFrameAction }];
673
- }
674
- if (!msg.ctrl && !msg.alt && msg.key === 'up') {
675
- return [obs, { type: 'settings-focus-move', delta: -1 }];
676
- }
677
- if (!msg.ctrl && !msg.alt && msg.key === 'down') {
678
- return [obs, { type: 'settings-focus-move', delta: 1 }];
679
- }
680
- if (!msg.ctrl && !msg.alt && msg.key === 'j') {
681
- return [obs, { type: 'settings-scroll', delta: 1 }];
682
- }
683
- if (!msg.ctrl && !msg.alt && msg.key === 'k') {
684
- return [obs, { type: 'settings-scroll', delta: -1 }];
685
- }
686
- if (!msg.ctrl && !msg.alt && msg.key === 'd') {
687
- return [obs, { type: 'settings-scroll', delta: Math.max(1, layout.contentHeight - 1) }];
688
- }
689
- if (!msg.ctrl && !msg.alt && msg.key === 'u') {
690
- return [obs, { type: 'settings-scroll', delta: -Math.max(1, layout.contentHeight - 1) }];
691
- }
692
- if (!msg.ctrl && !msg.alt && msg.key === 'g') {
693
- return [obs, { type: 'settings-scroll-to', position: 'top' }];
694
- }
695
- if (!msg.ctrl && !msg.alt && msg.key === 'G') {
696
- return [obs, { type: 'settings-scroll-to', position: 'bottom' }];
697
- }
698
- if (!msg.ctrl && !msg.alt && (msg.key === 'enter' || msg.key === 'space')) {
699
- const rowIndex = clampSettingsFocus(model, layout);
700
- const row = layout.rows[rowIndex];
701
- if (row != null
702
- && row.row.enabled !== false
703
- && row.row.kind !== 'info'
704
- && (row.behavior === 'cycle-shell-theme' || row.row.action !== undefined)) {
705
- return [obs, { type: 'activate-settings-row', rowIndex: row.index }];
706
- }
707
- return [obs];
708
- }
709
- return [obs];
710
- }
711
- function handleNotificationCenterLayerKeyCommands(msg, model) {
712
- const layout = resolveNotificationCenterLayout(model, options, pagesById, resolveFrameThemeCtx(model.activeShellThemeId));
713
- if (layout == null)
714
- return undefined;
715
- const obs = { type: 'observed-key', msg, route: 'frame' };
716
- if (!msg.ctrl && !msg.alt && msg.key === 'escape') {
717
- return [obs, { type: 'close-notification-center' }];
718
- }
719
- if (isShellQuitRequest(msg)) {
720
- return quitRequestCommands(msg, 'frame');
721
- }
722
- const centerFrameAction = frameKeys.handle(msg);
723
- if (centerFrameAction?.type === 'toggle-shell-theme-mode') {
724
- return [obs, { type: 'toggle-shell-theme-mode' }];
725
- }
726
- if (centerFrameAction?.type === 'toggle-notifications') {
727
- return [obs, { type: 'apply-frame-action', action: centerFrameAction }];
728
- }
729
- if (centerFrameAction?.type === 'toggle-perf-hud') {
730
- return [obs, { type: 'apply-frame-action', action: centerFrameAction }];
731
- }
732
- if (!msg.ctrl && !msg.alt && msg.key === 'f2') {
733
- return [obs, { type: 'close-notification-center' }, { type: 'apply-frame-action', action: { type: 'toggle-settings' } }];
734
- }
735
- if (!msg.ctrl && !msg.alt && msg.key === '?') {
736
- return [obs, { type: 'close-notification-center' }, { type: 'open-help' }];
737
- }
738
- if (options.enableCommandPalette && !msg.ctrl && !msg.alt && msg.key === '/') {
739
- return [obs, { type: 'close-notification-center' }, { type: 'open-search-palette' }];
740
- }
741
- if (options.enableCommandPalette && ((msg.ctrl && !msg.alt && msg.key === 'p') || (!msg.ctrl && !msg.alt && msg.key === ':'))) {
742
- return [obs, { type: 'close-notification-center' }, { type: 'open-command-palette' }];
743
- }
744
- if (!msg.ctrl && !msg.alt && (msg.key === 'up' || msg.key === 'k')) {
745
- return [obs, { type: 'notification-center-scroll', delta: -1 }];
746
- }
747
- if (!msg.ctrl && !msg.alt && (msg.key === 'down' || msg.key === 'j')) {
748
- return [obs, { type: 'notification-center-scroll', delta: 1 }];
749
- }
750
- if (!msg.ctrl && !msg.alt && msg.key === 'd') {
751
- return [obs, { type: 'notification-center-scroll', delta: Math.max(1, layout.contentHeight - 2) }];
752
- }
753
- if (!msg.ctrl && !msg.alt && msg.key === 'u') {
754
- return [obs, { type: 'notification-center-scroll', delta: -Math.max(1, layout.contentHeight - 2) }];
755
- }
756
- if (!msg.ctrl && !msg.alt && msg.key === 'g') {
757
- return [obs, { type: 'notification-center-scroll-to', position: 'top' }];
758
- }
759
- if (!msg.ctrl && !msg.alt && msg.key === 'G') {
760
- return [obs, { type: 'notification-center-scroll-to', position: 'bottom' }];
761
- }
762
- if (!msg.ctrl && !msg.alt && msg.key === 'f') {
763
- return [obs, { type: 'cycle-notification-filter' }];
764
- }
765
- return [obs];
766
- }
767
- function handleWorkspaceLayerKeyCommands(msg, model) {
768
- if (isShellQuitRequest(msg)) {
769
- return quitRequestCommands(msg, 'frame');
770
- }
771
- const context = resolveLayerContext(model);
772
- const { activePage, activeInputArea } = context;
773
- const paneAction = activeInputArea?.keyMap?.handle(msg);
774
- const pageAction = activePage.keyMap?.handle(msg);
775
- const globalAction = options.globalKeys?.handle(msg);
776
- const frameAction = frameKeys.handle(msg);
777
- const keyPriority = options.keyPriority ?? 'frame-first';
778
- if (keyPriority === 'page-first') {
779
- if (paneAction !== undefined) {
780
- return [{ type: 'observed-key', msg, route: 'page' }, { type: 'emit-page-msg', pageId: model.activePageId, msg: paneAction }];
781
- }
782
- if (pageAction !== undefined) {
783
- return [{ type: 'observed-key', msg, route: 'page' }, { type: 'emit-page-msg', pageId: model.activePageId, msg: pageAction }];
784
- }
785
- if (globalAction !== undefined) {
786
- return [{ type: 'observed-key', msg, route: 'global' }, { type: 'emit-global-msg', msg: globalAction }];
787
- }
788
- if (frameAction !== undefined) {
789
- return resolveFrameActionCommands(msg, frameAction, 'frame');
790
- }
791
- return [{ type: 'observed-key', msg, route: 'unhandled' }];
792
- }
793
- // frame-first (default)
794
- if (frameAction !== undefined) {
795
- return pageAction !== undefined
796
- ? [...resolveFrameActionCommands(msg, frameAction, 'frame'), { type: 'warn-frame-key-collision', msg }]
797
- : resolveFrameActionCommands(msg, frameAction, 'frame');
798
- }
799
- if (paneAction !== undefined) {
800
- return [{ type: 'observed-key', msg, route: 'page' }, { type: 'emit-page-msg', pageId: model.activePageId, msg: paneAction }];
801
- }
802
- if (globalAction !== undefined) {
803
- return [{ type: 'observed-key', msg, route: 'global' }, { type: 'emit-global-msg', msg: globalAction }];
804
- }
805
- if (pageAction !== undefined) {
806
- return [{ type: 'observed-key', msg, route: 'page' }, { type: 'emit-page-msg', pageId: model.activePageId, msg: pageAction }];
807
- }
808
- return [{ type: 'observed-key', msg, route: 'unhandled' }];
809
- }
810
- function resolveRoutedKeyLayer(msg, model) {
811
- const context = resolveLayerContext(model);
812
- const runtimeStack = describeFrameRuntimeViewStack(model, {
813
- pageModalOpen: context.pageModalOpen,
814
- });
815
- return routeRuntimeInput(runtimeStack, EMPTY_RUNTIME_LAYOUTS, { kind: 'key', key: msg.key }, ({ layer }) => {
816
- const frameLayer = layer.model;
817
- if (frameLayer == null)
818
- return undefined;
819
- if (frameLayer.kind === 'search' || frameLayer.kind === 'command-palette') {
820
- return { handled: true, commands: handlePaletteLayerKeyCommands(msg, frameLayer.kind) };
821
- }
822
- if (frameLayer.kind === 'help') {
823
- return { handled: true, commands: handleHelpLayerKeyCommands(msg) };
824
- }
825
- if (frameLayer.kind === 'settings') {
826
- const cmds = handleSettingsLayerKeyCommands(msg, model);
827
- return cmds != null ? { handled: true, commands: cmds } : { bubble: true };
828
- }
829
- if (frameLayer.kind === 'notification-center') {
830
- const cmds = handleNotificationCenterLayerKeyCommands(msg, model);
831
- return cmds != null ? { handled: true, commands: cmds } : { bubble: true };
832
- }
833
- if (frameLayer.kind === 'quit-confirm') {
834
- const obs = { type: 'observed-key', msg, route: 'frame' };
835
- const frameAction = frameKeys.handle(msg);
836
- if (frameAction?.type === 'toggle-perf-hud') {
837
- return { handled: true, commands: [obs, { type: 'apply-frame-action', action: frameAction }] };
838
- }
839
- if (isShellQuitConfirmAccept(msg)) {
840
- return { handled: true, commands: [obs, { type: 'close-quit-confirm' }, { type: 'quit' }] };
841
- }
842
- if (isShellQuitConfirmDismiss(msg)) {
843
- return { handled: true, commands: [obs, { type: 'close-quit-confirm' }] };
844
- }
845
- return { handled: true, commands: [obs] };
846
- }
847
- if (frameLayer.kind === 'page-modal') {
848
- const { modalKeyMap } = context;
849
- const obs = { type: 'observed-key', msg, route: 'page' };
850
- const frameAction = frameKeys.handle(msg);
851
- if (frameAction?.type === 'toggle-perf-hud') {
852
- return { handled: true, commands: [obs, { type: 'apply-frame-action', action: frameAction }] };
853
- }
854
- if (modalKeyMap != null) {
855
- const modalAction = modalKeyMap.handle(msg);
856
- if (modalAction !== undefined) {
857
- return { handled: true, commands: [obs, { type: 'emit-page-msg', pageId: model.activePageId, msg: modalAction }] };
858
- }
859
- }
860
- return { handled: true, commands: [obs] };
861
- }
862
- // workspace (root layer)
863
- return { handled: true, commands: handleWorkspaceLayerKeyCommands(msg, model) };
864
- });
865
- }
866
- function createShellRetainedLayoutNode(id, rect, children) {
867
- return {
868
- id,
869
- rect: {
870
- x: rect.col,
871
- y: rect.row,
872
- width: rect.width,
873
- height: rect.height,
874
- },
875
- children: children ?? [],
876
- };
877
- }
878
- function buildWorkspaceLayoutTreeFromPaneRects(model, paneRects, tabTargets) {
879
- const resolvedTabTargets = tabTargets ?? resolveHeaderLine(model, options, pagesById, headerScratch, resolveFrameThemeCtx(model.activeShellThemeId)).tabTargets;
880
- const tabChildren = resolvedTabTargets.map((target) => createShellRetainedLayoutNode(`tab:${target.pageId}`, {
881
- row: 0,
882
- col: target.startCol,
883
- width: target.endCol - target.startCol + 1,
884
- height: 1,
885
- }));
886
- const bodyRect = resolveBodyRect(model, options);
887
- const paneChildren = [];
888
- for (const [paneId, rect] of paneRects.entries()) {
889
- paneChildren.push(createShellRetainedLayoutNode(`pane:${paneId}`, rect));
890
- }
891
- return createShellRetainedLayoutNode('workspace', { row: 0, col: 0, width: model.columns, height: model.rows }, [
892
- createShellRetainedLayoutNode('header-bar', { row: 0, col: 0, width: model.columns, height: 1 }, tabChildren),
893
- createShellRetainedLayoutNode('workspace-body', bodyRect, paneChildren),
894
- ]);
895
- }
896
- function rememberWorkspaceLayout(model, paneRects, tabTargets) {
897
- const activePageId = model.activePageId;
898
- const activePageModel = model.pageModels[activePageId];
899
- if (activePageModel === undefined) {
900
- throw new Error(`createFramedApp: active page model "${activePageId}" is missing`);
901
- }
902
- const next = {
903
- activePageId,
904
- activePageModel,
905
- columns: model.columns,
906
- rows: model.rows,
907
- visibilityState: model.minimizedByPage[activePageId],
908
- dockState: model.dockStateByPage[activePageId],
909
- splitRatioOverrides: model.splitRatioOverrides,
910
- maximizedPaneId: model.maximizedPaneByPage[activePageId]?.maximizedPaneId,
911
- paneRects,
912
- tree: buildWorkspaceLayoutTreeFromPaneRects(model, paneRects, tabTargets),
913
- };
914
- workspaceLayoutCache = next;
915
- return next;
916
- }
917
- function matchesWorkspaceLayoutCache(model) {
918
- if (workspaceLayoutCache == null)
919
- return false;
920
- const activePageId = model.activePageId;
921
- return workspaceLayoutCache.activePageId === activePageId
922
- && workspaceLayoutCache.activePageModel === model.pageModels[activePageId]
923
- && workspaceLayoutCache.columns === model.columns
924
- && workspaceLayoutCache.rows === model.rows
925
- && workspaceLayoutCache.visibilityState === model.minimizedByPage[activePageId]
926
- && workspaceLayoutCache.dockState === model.dockStateByPage[activePageId]
927
- && workspaceLayoutCache.splitRatioOverrides === model.splitRatioOverrides
928
- && workspaceLayoutCache.maximizedPaneId === model.maximizedPaneByPage[activePageId]?.maximizedPaneId;
929
- }
930
- function resolveWorkspaceLayout(model) {
931
- if (matchesWorkspaceLayoutCache(model)) {
932
- const cached = workspaceLayoutCache;
933
- if (cached !== undefined)
934
- return cached;
935
- }
936
- const bodyRect = resolveBodyRect(model, options);
937
- const maxState = model.maximizedPaneByPage[model.activePageId];
938
- const maximizedPaneId = maxState?.maximizedPaneId;
939
- const themedFrameCtx = resolveFrameThemeCtx(model.activeShellThemeId);
940
- const renderResult = maximizedPaneId
941
- ? renderMaximizedPane(model.activePageId, model, bodyRect, pagesById, maximizedPaneId, paneScratchPool, themedFrameCtx)
942
- : renderPageContent(model.activePageId, model, bodyRect, pagesById, themedFrameCtx);
943
- return rememberWorkspaceLayout(model, renderResult.paneRects);
944
- }
945
- function resolveWorkspacePaneRects(model) {
946
- return resolveWorkspaceLayout(model).paneRects;
947
- }
948
- function buildWorkspaceLayoutTree(model) {
949
- return resolveWorkspaceLayout(model).tree;
950
- }
951
- function buildSettingsRowChildren(model, layout) {
952
- const scrollY = clampSettingsScroll(model, layout);
953
- const viewportTop = 1;
954
- const viewportBottom = model.rows - 1;
955
- const children = [];
956
- for (const flatRow of layout.rows) {
957
- const screenRow = flatRow.line - scrollY + viewportTop;
958
- const clippedTop = Math.max(viewportTop, screenRow);
959
- const clippedBottom = Math.min(viewportBottom, screenRow + flatRow.height);
960
- if (clippedTop >= clippedBottom)
961
- continue;
962
- children.push(createShellRetainedLayoutNode(`settings-row:${String(flatRow.index)}`, {
963
- row: clippedTop,
964
- col: layout.startCol,
965
- width: layout.drawerWidth,
966
- height: clippedBottom - clippedTop,
967
- }));
968
- }
969
- return children;
970
- }
971
- function nodeIdSuffix(node, prefix) {
972
- const id = node.id;
973
- return id?.startsWith(prefix) === true ? id.slice(prefix.length) : undefined;
974
- }
975
- function resolveFrameMouseRuntimeLayouts(model) {
976
- let layouts = EMPTY_RUNTIME_LAYOUTS;
977
- const settingsLayout = model.settingsOpen
978
- ? resolveSettingsLayout(model, options, pagesById, resolvedShellThemes)
979
- : undefined;
980
- if (settingsLayout != null) {
981
- layouts = retainRuntimeLayout(layouts, {
982
- viewId: 'settings',
983
- tree: createShellRetainedLayoutNode('settings-drawer', {
984
- row: 0,
985
- col: settingsLayout.startCol,
986
- width: settingsLayout.drawerWidth,
987
- height: model.rows,
988
- }, buildSettingsRowChildren(model, settingsLayout)),
989
- });
990
- }
991
- const notificationCenterLayout = model.notificationCenterOpen
992
- ? resolveNotificationCenterLayout(model, options, pagesById, resolveFrameThemeCtx(model.activeShellThemeId))
993
- : undefined;
994
- if (notificationCenterLayout != null) {
995
- layouts = retainRuntimeLayout(layouts, {
996
- viewId: 'notification-center',
997
- tree: createShellRetainedLayoutNode('notification-center-drawer', {
998
- row: 0,
999
- col: notificationCenterLayout.startCol,
1000
- width: notificationCenterLayout.drawerWidth,
1001
- height: model.rows,
1002
- }),
1003
- });
1004
- }
1005
- layouts = retainRuntimeLayout(layouts, {
1006
- viewId: 'workspace',
1007
- tree: buildWorkspaceLayoutTree(model),
1008
- });
1009
- return layouts;
1010
- }
1011
- function resolveRoutedMouseLayer(msg, model) {
1012
- const context = resolveLayerContext(model);
1013
- const { activePageModel, inputAreas } = context;
1014
- const runtimeStack = describeFrameRuntimeViewStack(model, {
1015
- pageModalOpen: context.pageModalOpen,
1016
- });
1017
- return routeRuntimeInput(runtimeStack, resolveFrameMouseRuntimeLayouts(model), {
1018
- kind: 'pointer',
1019
- action: msg.action,
1020
- x: msg.col,
1021
- y: msg.row,
1022
- button: msg.button === 'none' ? undefined : msg.button,
1023
- }, ({ layer, hit }) => {
1024
- const frameLayer = layer.model;
1025
- if (frameLayer == null)
1026
- return undefined;
1027
- const cmds = [];
1028
- if (frameLayer.kind === 'help') {
1029
- if (msg.action === 'scroll-up' || msg.action === 'scroll-down') {
1030
- cmds.push({ type: 'help-scroll', action: msg.action === 'scroll-down' ? 'down' : 'up' });
1031
- }
1032
- return { handled: true, commands: cmds };
1033
- }
1034
- if (frameLayer.kind === 'search' || frameLayer.kind === 'command-palette'
1035
- || frameLayer.kind === 'quit-confirm' || frameLayer.kind === 'page-modal') {
1036
- return { handled: true };
1037
- }
1038
- if (frameLayer.kind === 'settings') {
1039
- if (hit == null)
1040
- return { handled: true };
1041
- if (msg.action === 'scroll-up' || msg.action === 'scroll-down') {
1042
- cmds.push({ type: 'settings-scroll', delta: msg.action === 'scroll-down' ? 3 : -3 });
1043
- return { handled: true, commands: cmds };
1044
- }
1045
- if (msg.action === 'press' && msg.button === 'left') {
1046
- const rowNode = hit.path.find((n) => n.id?.startsWith('settings-row:'));
1047
- if (rowNode != null) {
1048
- const rowId = nodeIdSuffix(rowNode, 'settings-row:');
1049
- if (rowId !== undefined)
1050
- cmds.push({ type: 'activate-settings-row', rowIndex: Number.parseInt(rowId, 10) });
1051
- }
1052
- return { handled: true, commands: cmds };
1053
- }
1054
- return { handled: true };
1055
- }
1056
- if (frameLayer.kind === 'notification-center') {
1057
- if (hit == null)
1058
- return { handled: true };
1059
- if (msg.action === 'scroll-up' || msg.action === 'scroll-down') {
1060
- cmds.push({ type: 'notification-center-scroll', delta: msg.action === 'scroll-down' ? 3 : -3 });
1061
- return { handled: true, commands: cmds };
1062
- }
1063
- return { handled: true };
1064
- }
1065
- // workspace layer
1066
- if (msg.action === 'press' && msg.button === 'left') {
1067
- // notification toast hit-testing (outside retained layouts)
1068
- if (frameNotificationOptions.enabled) {
1069
- const notificationTarget = hitTestNotificationStack(model.runtimeNotifications, {
1070
- screenWidth: model.columns,
1071
- screenHeight: model.rows,
1072
- margin: frameNotificationOptions.margin,
1073
- gap: frameNotificationOptions.gap,
1074
- ctx: resolveFrameThemeCtx(model.activeShellThemeId) ?? undefined,
1075
- }, msg.col, msg.row);
1076
- if (notificationTarget?.kind === 'dismiss') {
1077
- cmds.push({ type: 'dismiss-notification', notificationId: notificationTarget.item.id });
1078
- return { handled: true, commands: cmds };
1079
- }
1080
- if (notificationTarget != null) {
1081
- return { handled: true };
1082
- }
1083
- }
1084
- // tab click
1085
- const tabNode = hit?.path.find((n) => n.id?.startsWith('tab:'));
1086
- const pageId = tabNode == null ? undefined : nodeIdSuffix(tabNode, 'tab:');
1087
- if (pageId !== undefined) {
1088
- const currentIndex = model.pageOrder.indexOf(model.activePageId);
1089
- const nextIndex = model.pageOrder.indexOf(pageId);
1090
- if (currentIndex >= 0 && nextIndex >= 0 && nextIndex !== currentIndex) {
1091
- cmds.push({ type: 'switch-tab', delta: nextIndex - currentIndex });
1092
- }
1093
- return { handled: true, commands: cmds };
1094
- }
1095
- if (msg.row === 0) {
1096
- return { handled: true };
1097
- }
1098
- // pane click
1099
- const clickedPaneNode = hit?.path.find((n) => n.id?.startsWith('pane:'));
1100
- const clickedPaneId = clickedPaneNode == null ? undefined : nodeIdSuffix(clickedPaneNode, 'pane:');
1101
- if (clickedPaneId !== undefined) {
1102
- const paneRects = resolveWorkspacePaneRects(model);
1103
- const paneRect = paneRects.get(clickedPaneId);
1104
- if (paneRect != null) {
1105
- cmds.push({ type: 'focus-pane', paneId: clickedPaneId });
1106
- const inputArea = findInputAreaByPaneId(inputAreas, clickedPaneId);
1107
- const areaMsg = inputArea?.mouse?.({ msg, model: activePageModel, rect: paneRect });
1108
- let routedMsg = msg;
1109
- if (areaMsg !== undefined)
1110
- routedMsg = areaMsg;
1111
- cmds.push({
1112
- type: 'emit-page-msg',
1113
- pageId: model.activePageId,
1114
- msg: routedMsg,
1115
- });
1116
- return { handled: true, commands: cmds };
1117
- }
1118
- }
1119
- }
1120
- if (msg.action === 'scroll-up' || msg.action === 'scroll-down') {
1121
- const scrollPaneNode = hit?.path.find((n) => n.id?.startsWith('pane:'));
1122
- const scrollPaneId = scrollPaneNode == null ? undefined : nodeIdSuffix(scrollPaneNode, 'pane:');
1123
- if (scrollPaneId !== undefined) {
1124
- const paneRects = resolveWorkspacePaneRects(model);
1125
- const paneRect = paneRects.get(scrollPaneId);
1126
- if (paneRect != null) {
1127
- cmds.push({ type: 'focus-pane', paneId: scrollPaneId });
1128
- const inputArea = findInputAreaByPaneId(inputAreas, scrollPaneId);
1129
- const areaMsg = inputArea?.mouse?.({ msg, model: activePageModel, rect: paneRect });
1130
- if (areaMsg !== undefined) {
1131
- cmds.push({ type: 'emit-page-msg', pageId: model.activePageId, msg: areaMsg });
1132
- }
1133
- else {
1134
- cmds.push({ type: 'scroll-focused-pane', direction: msg.action === 'scroll-down' ? 'down' : 'up' });
1135
- }
1136
- return { handled: true, commands: cmds };
1137
- }
1138
- }
1139
- }
1140
- return { handled: false };
1141
- });
1142
- }
1143
- function resolveWorkspaceHelpSource(activePage, activeInputArea) {
1144
- return mergeBindingSources(frameKeys, quitHelpKeys, options.globalKeys, activeInputArea?.helpSource ?? activeInputArea?.keyMap, activePage.helpSource ?? activePage.keyMap);
1145
- }
1146
- function resolveWorkspaceHintSource(model, activePage, activeInputArea) {
1147
- const helpLineOverride = options.helpLineSource?.({
1148
- model,
1149
- activePage,
1150
- frameKeys,
1151
- globalKeys: options.globalKeys,
1152
- });
1153
- if (typeof helpLineOverride === 'string') {
1154
- return helpLineOverride;
1155
- }
1156
- return helpLineOverride ?? mergeBindingSources(frameKeys, options.globalKeys, activeInputArea?.helpSource ?? activeInputArea?.keyMap, activePage.helpSource ?? activePage.keyMap);
1157
- }
1158
- function resolveLayerMetadata(model, activePage, activePageModel, activeInputArea, modalKeyMap) {
1159
- const settings = resolveFrameSettings(model, options, pagesById, resolvedShellThemes);
1160
- const notificationCenter = resolveFrameNotificationCenter(model, options, pagesById);
1161
- const workspaceHintSource = resolveWorkspaceHintSource(model, activePage, activeInputArea);
1162
- const workspaceHelpSource = resolveWorkspaceHelpSource(activePage, activeInputArea);
1163
- const paletteHint = frameMessage(options.i18n, 'palette.hint', 'Enter select • Esc close');
1164
- const helpHint = frameMessage(options.i18n, 'help.hint', 'j/k scroll • d/u page • g/G top/bottom • mouse wheel • ?/Esc close');
1165
- const settingsHint = frameMessage(options.i18n, 'settings.footer', 'F2/Esc close • ↑/↓ rows • Enter toggle • / search • q quit');
1166
- const notificationsHint = frameMessage(options.i18n, 'notifications.footer', 'Shift+N close • f filter • j/k scroll • q quit');
1167
- const quitHint = frameMessage(options.i18n, 'quit.footer', 'Y Quit • N Stay');
1168
- const paletteTitle = model.commandPaletteTitle
1169
- ?? frameMessage(options.i18n, 'palette.title', 'Command Palette');
1170
- const activePageTitle = resolveFramePageText(activePage.title, activePageModel) ?? '';
1171
- const searchTitle = model.commandPaletteTitle
1172
- ?? resolveFramePageText(activePage.searchTitle, activePageModel)
1173
- ?? frameMessage(options.i18n, 'search.title', 'Search');
1174
- const notificationsTitle = notificationCenter == null
1175
- ? frameMessage(options.i18n, 'notifications.title', 'Notifications')
1176
- : `${notificationCenter.title} • ${frameNotificationFilterLabel(options.i18n, notificationCenter.activeFilter)}`;
1177
- const pageLayers = activePage.layers?.(activePageModel);
1178
- const workspaceLayer = {
1179
- title: activePageTitle,
1180
- hintSource: workspaceHintSource,
1181
- helpSource: workspaceHelpSource,
1182
- ...pageLayers?.workspace,
1183
- };
1184
- const pageModalLayer = {
1185
- title: activePageTitle,
1186
- hintSource: modalKeyMap ?? activePage.helpSource ?? activePage.keyMap,
1187
- helpSource: mergeBindingSources(quitHelpKeys, modalKeyMap, activePage.helpSource ?? activePage.keyMap),
1188
- ...pageLayers?.['page-modal'],
1189
- };
1190
- return {
1191
- workspace: workspaceLayer,
1192
- 'page-modal': pageModalLayer,
1193
- settings: {
1194
- title: settings?.title ?? frameMessage(options.i18n, 'settings.title', 'Settings'),
1195
- hintSource: settingsHint,
1196
- helpSource: mergeBindingSources(settingsHelpKeys, quitHelpKeys),
1197
- },
1198
- help: {
1199
- title: frameMessage(options.i18n, 'help.title', 'Keyboard Help'),
1200
- hintSource: helpHint,
1201
- helpSource: helpLayerHelpKeys,
1202
- },
1203
- 'notification-center': {
1204
- title: notificationsTitle,
1205
- hintSource: notificationsHint,
1206
- helpSource: mergeBindingSources(notificationCenterHelpKeys, quitHelpKeys),
1207
- },
1208
- search: {
1209
- title: searchTitle,
1210
- hintSource: paletteHint,
1211
- helpSource: mergeBindingSources(paletteKeys, quitHelpKeys),
1212
- },
1213
- 'command-palette': {
1214
- title: paletteTitle,
1215
- hintSource: paletteHint,
1216
- helpSource: mergeBindingSources(paletteKeys, quitHelpKeys),
1217
- },
1218
- 'quit-confirm': {
1219
- title: frameMessage(options.i18n, 'quit.title', 'Quit?'),
1220
- hintSource: quitHint,
1221
- helpSource: quitConfirmHelpKeys,
1222
- },
1223
- };
1224
- }
1225
- function resolvePresentedLayerContext(model) {
1226
- const { activePage, activePageModel, inputAreas, activeInputArea, modalKeyMap, pageModalOpen, } = resolveLayerContext(model);
1227
- const layerMetadata = resolveLayerMetadata(model, activePage, activePageModel, activeInputArea, modalKeyMap);
1228
- const controlProjection = projectFrameControls(model, {
1229
- pageModalOpen,
1230
- layers: layerMetadata,
1231
- });
1232
- return {
1233
- activePage,
1234
- activePageModel,
1235
- inputAreas,
1236
- activeInputArea,
1237
- modalKeyMap,
1238
- pageModalOpen,
1239
- layerMetadata,
1240
- controlProjection,
1241
- layerStack: controlProjection.layerStack,
1242
- activeLayer: controlProjection.activeLayer,
1243
- underlyingLayer: controlProjection.underlyingLayer,
1244
- };
1245
- }
1246
- function updateTargetPage(model, targetPageId, targetMsg) {
1247
- const targetPage = pagesById.get(targetPageId);
1248
- if (targetPage == null)
1249
- return [model, []];
1250
- const pageModel = model.pageModels[targetPageId];
1251
- if (pageModel === undefined)
1252
- return [model, []];
1253
- const updateResult = targetPage.update(targetMsg, pageModel);
1254
- const [nextPageModel, cmds] = updateResult;
1255
- const nextModels = { ...model.pageModels, [targetPageId]: nextPageModel };
1256
- const synced = syncPageFrameState({ ...model, pageModels: nextModels }, targetPageId, pagesById);
1257
- const wrappedCmds = cmds.map((cmd) => wrapCmdForPage(targetPageId, cmd));
1258
- return [synced, wrappedCmds];
1259
- }
1260
- function applyFrameNotificationState(model, notifications, nowMs, forceTick = false) {
1261
- const trimmed = trimNotificationsToViewport(notifications, {
1262
- screenWidth: model.columns,
1263
- screenHeight: model.rows,
1264
- margin: frameNotificationOptions.margin,
1265
- gap: frameNotificationOptions.gap,
1266
- }, nowMs);
1267
- const needsTick = notificationsNeedTick(trimmed);
1268
- const nextModel = {
1269
- ...model,
1270
- runtimeNotifications: trimmed,
1271
- runtimeNotificationLoopActive: needsTick,
1272
- };
1273
- if (needsTick && (forceTick || !model.runtimeNotificationLoopActive)) {
1274
- return [nextModel, [createFrameNotificationTickCmd()]];
1275
- }
1276
- return [nextModel, []];
1277
- }
1278
- function pushSettingsFeedback(model, row) {
1279
- if (!frameNotificationOptions.enabled) {
1280
- return [model, []];
1281
- }
1282
- const feedback = row.feedback ?? {
1283
- title: 'Setting updated',
1284
- message: `${row.label} updated.`,
1285
- };
1286
- const nowMs = resolveClock(resolveFrameCtx()).now();
1287
- const notifications = pushNotification(model.runtimeNotifications, {
1288
- title: feedback.title ?? 'Setting updated',
1289
- message: feedback.message,
1290
- variant: 'TOAST',
1291
- tone: feedback.tone ?? 'INFO',
1292
- width: SETTINGS_FEEDBACK_TOAST_WIDTH,
1293
- placement: frameNotificationOptions.placement,
1294
- durationMs: feedback.durationMs ?? 2_500,
1295
- overflow: frameNotificationOptions.overflow,
1296
- }, nowMs);
1297
- return applyFrameNotificationState(model, notifications, nowMs);
1298
- }
1299
- function activateSettingsRow(model, row) {
1300
- if (row.action === undefined || row.enabled === false || row.kind === 'info') {
1301
- return [model, []];
1302
- }
1303
- const cmds = [emitMsgForPage(model.activePageId, row.action)];
1304
- const [nextModel, notificationCmds] = pushSettingsFeedback(model, row);
1305
- return [nextModel, [...cmds, ...notificationCmds]];
1306
- }
1307
- function cycleShellThemeSetting(model, row) {
1308
- const nextTheme = resolveNextShellTheme(resolvedShellThemes, model.activeShellThemeId);
1309
- if (nextTheme == null) {
1310
- return [model, []];
1311
- }
1312
- publishShellThemeContext(nextTheme);
1313
- const [nextModel, notificationCmds] = pushSettingsFeedback({
1314
- ...model,
1315
- activeShellThemeId: nextTheme.id,
1316
- }, row);
1317
- return [nextModel, notificationCmds];
1318
- }
1319
- function pushShellThemeModeFeedback(model, nextTheme) {
1320
- if (!frameNotificationOptions.enabled) {
1321
- return [model, []];
1322
- }
1323
- const nowMs = resolveClock(resolveFrameCtx()).now();
1324
- const notifications = pushNotification(model.runtimeNotifications, {
1325
- title: frameMessage(options.i18n, 'settings.title', 'Settings'),
1326
- message: frameMessage(options.i18n, 'settings.shellTheme.feedback', 'Shell theme set to {theme}.', { theme: nextTheme.label }),
1327
- variant: 'TOAST',
1328
- tone: 'INFO',
1329
- width: SETTINGS_FEEDBACK_TOAST_WIDTH,
1330
- placement: frameNotificationOptions.placement,
1331
- durationMs: 2_500,
1332
- overflow: frameNotificationOptions.overflow,
1333
- }, nowMs);
1334
- return applyFrameNotificationState(model, notifications, nowMs);
1335
- }
1336
- function pushShellThemeModeUnsupportedFeedback(model, currentTheme) {
1337
- if (!frameNotificationOptions.enabled || currentTheme == null) {
1338
- return [model, []];
1339
- }
1340
- const nowMs = resolveClock(resolveFrameCtx()).now();
1341
- const notifications = pushNotification(model.runtimeNotifications, {
1342
- title: frameMessage(options.i18n, 'settings.title', 'Settings'),
1343
- message: frameMessage(options.i18n, 'settings.shellTheme.modeUnsupported', 'Shell theme {theme} has no alternate mode.', { theme: currentTheme.label }),
1344
- variant: 'TOAST',
1345
- tone: 'INFO',
1346
- width: SETTINGS_FEEDBACK_TOAST_WIDTH,
1347
- placement: frameNotificationOptions.placement,
1348
- durationMs: 2_500,
1349
- overflow: frameNotificationOptions.overflow,
1350
- }, nowMs);
1351
- return applyFrameNotificationState(model, notifications, nowMs);
1352
- }
1353
- function toggleShellThemeMode(model) {
1354
- ensureResolvedShellThemes(resolveFrameCtx());
1355
- const currentTheme = resolveCurrentShellTheme(resolvedShellThemes, model.activeShellThemeId);
1356
- const nextTheme = resolveShellThemeModeToggle(resolvedShellThemes, model.activeShellThemeId);
1357
- if (nextTheme == null) {
1358
- return pushShellThemeModeUnsupportedFeedback(model, currentTheme);
1359
- }
1360
- publishShellThemeContext(nextTheme);
1361
- return pushShellThemeModeFeedback({
1362
- ...model,
1363
- activeShellThemeId: nextTheme.id,
1364
- }, nextTheme);
1365
- }
1366
- const app = {
1367
- init() {
1368
- const pageModels = {};
1369
- const initCmds = [];
1370
- for (const page of options.pages) {
1371
- const [pageModel, cmds] = page.init();
1372
- pageModels[page.id] = pageModel;
1373
- initCmds.push(...cmds.map((cmd) => wrapCmdForPage(page.id, cmd)));
1374
- }
1375
- let model = {
1376
- activePageId: defaultPageId,
1377
- pageOrder,
1378
- pageModels,
1379
- warnedFrameKeyCollisionPages: {},
1380
- focusedPaneByPage: {},
1381
- scrollByPage: {},
1382
- columns: Math.max(1, options.initialColumns ?? 80),
1383
- rows: Math.max(1, options.initialRows ?? 24),
1384
- frameTimeMs: 0,
1385
- viewTimeMs: 0,
1386
- diffTimeMs: 0,
1387
- frameBudgetMs: undefined,
1388
- frameOverBudget: false,
1389
- perfHudOpen: false,
1390
- helpOpen: false,
1391
- footerVisible: true,
1392
- footerTranslateY: 0,
1393
- footerAnimationGeneration: 0,
1394
- helpScrollY: 0,
1395
- commandPaletteKind: undefined,
1396
- settingsOpen: false,
1397
- notificationCenterOpen: false,
1398
- quitConfirmOpen: false,
1399
- settingsFocusIndex: 0,
1400
- settingsScrollY: 0,
1401
- notificationCenterScrollY: 0,
1402
- transitionProgress: 1,
1403
- transitionGeneration: 0,
1404
- transitionFrame: 0,
1405
- minimizedByPage: {},
1406
- maximizedPaneByPage: {},
1407
- dockStateByPage: {},
1408
- splitRatioOverrides: {},
1409
- runtimeNotifications: createNotificationState(),
1410
- runtimeNotificationHistoryFilter: 'ALL',
1411
- runtimeNotificationLoopActive: false,
1412
- activeShellThemeId: undefined,
1413
- };
1414
- ensureResolvedShellThemes(resolveFrameCtx());
1415
- const initialShellTheme = resolveShellThemeForContext(resolvedShellThemes, resolveFrameCtx())
1416
- ?? resolvedShellThemes[0];
1417
- model = {
1418
- ...model,
1419
- activeShellThemeId: initialShellTheme?.id,
1420
- };
1421
- if (initialShellTheme != null) {
1422
- publishShellThemeContext(initialShellTheme);
1423
- }
1424
- for (const pageId of pageOrder) {
1425
- model = syncPageFrameState(model, pageId, pagesById);
1426
- }
1427
- // Apply initial layout if provided
1428
- if (options.initialLayout) {
1429
- const restored = restoreLayoutState(options.initialLayout);
1430
- model = {
1431
- ...model,
1432
- activePageId: pagesById.has(restored.activePageId) ? restored.activePageId : model.activePageId,
1433
- focusedPaneByPage: { ...model.focusedPaneByPage, ...restored.focusedPaneByPage },
1434
- minimizedByPage: restored.minimizedByPage,
1435
- maximizedPaneByPage: restored.maximizedPaneByPage,
1436
- dockStateByPage: restored.dockStateByPage,
1437
- splitRatioOverrides: restored.splitRatiosByPage,
1438
- };
1439
- }
1440
- return [model, initCmds];
1441
- },
1442
- update(msg, model) {
1443
- if (isFrameScopedMsg(msg)) {
1444
- const action = msg.action;
1445
- if (action.type === 'runtime-issue') {
1446
- if (!frameNotificationOptions.enabled)
1447
- return [model, []];
1448
- const notifications = pushNotification(model.runtimeNotifications, {
1449
- title: action.issue.level === 'warning' ? 'Framework warning' : 'Runtime error',
1450
- message: action.issue.message,
1451
- variant: 'TOAST',
1452
- tone: action.issue.level === 'warning' ? 'WARNING' : 'ERROR',
1453
- placement: frameNotificationOptions.placement,
1454
- durationMs: frameNotificationOptions.durationMs,
1455
- overflow: frameNotificationOptions.overflow,
1456
- }, action.issue.atMs);
1457
- return applyFrameNotificationState(model, notifications, action.issue.atMs);
1458
- }
1459
- if (action.type === 'push-notification') {
1460
- if (!frameNotificationOptions.enabled)
1461
- return [model, []];
1462
- const nowMs = resolveClock(resolveFrameCtx()).now();
1463
- const notifications = pushNotification(model.runtimeNotifications, {
1464
- ...action.notification,
1465
- placement: action.notification.placement ?? frameNotificationOptions.placement,
1466
- durationMs: action.notification.durationMs === undefined
1467
- ? frameNotificationOptions.durationMs
1468
- : action.notification.durationMs,
1469
- overflow: action.notification.overflow ?? frameNotificationOptions.overflow,
1470
- }, nowMs);
1471
- return applyFrameNotificationState(model, notifications, nowMs);
1472
- }
1473
- if (action.type === 'notification-tick') {
1474
- const notifications = tickNotifications(model.runtimeNotifications, action.atMs);
1475
- return applyFrameNotificationState(model, notifications, action.atMs, true);
1476
- }
1477
- if (action.type === 'toggle-shell-theme-mode') {
1478
- return toggleShellThemeMode(model);
1479
- }
1480
- if (action.type === 'transition') {
1481
- // Ignore stale transition ticks from a previous generation
1482
- if (action.generation !== model.transitionGeneration)
1483
- return [model, []];
1484
- // Advance timeline from deterministic pulse deltas.
1485
- if (model.transitionTimeline && model.transitionTimelineState) {
1486
- const state = model.transitionTimeline.step(model.transitionTimelineState, Math.max(0, action.dt));
1487
- const vals = model.transitionTimeline.values(state);
1488
- const progress = Math.min(1, Math.max(0, vals['progress'] ?? action.progress));
1489
- if (model.transitionTimeline.done(state) || progress >= 1) {
1490
- return [{
1491
- ...model,
1492
- transitionProgress: 1,
1493
- transitionFrame: 0,
1494
- previousPageId: undefined,
1495
- activeTransition: undefined,
1496
- transitionStartMs: undefined,
1497
- transitionTimeline: undefined,
1498
- transitionTimelineState: undefined,
1499
- }, []];
1500
- }
1501
- return [{
1502
- ...model,
1503
- transitionProgress: progress,
1504
- transitionFrame: model.transitionFrame + 1,
1505
- transitionTimelineState: state,
1506
- }, []];
1507
- }
1508
- // Fallback for non-timeline transitions (backward compat)
1509
- return [{
1510
- ...model,
1511
- transitionProgress: action.progress,
1512
- transitionFrame: model.transitionFrame + 1,
1513
- }, []];
1514
- }
1515
- if (action.type === 'transition-complete') {
1516
- if (action.generation !== model.transitionGeneration)
1517
- return [model, []];
1518
- return [{
1519
- ...model,
1520
- transitionProgress: 1,
1521
- transitionFrame: 0,
1522
- previousPageId: undefined,
1523
- activeTransition: undefined,
1524
- transitionStartMs: undefined,
1525
- transitionTimeline: undefined,
1526
- transitionTimelineState: undefined,
1527
- }, []];
1528
- }
1529
- return applyFrameAction(action, model, options, pagesById);
1530
- }
1531
- if (isResizeMsg(msg)) {
1532
- return [{
1533
- ...model,
1534
- columns: msg.columns,
1535
- rows: msg.rows,
1536
- }, []];
1537
- }
1538
- if (isKeyMsg(msg)) {
1539
- return drainShellCommandBuffer(model, resolveRoutedKeyLayer(msg, model));
1540
- }
1541
- if (isMouseMsg(msg)) {
1542
- const mouseRouteResult = resolveRoutedMouseLayer(msg, model);
1543
- if (mouseRouteResult.handled) {
1544
- return drainShellCommandBuffer(model, mouseRouteResult);
1545
- }
1546
- return updateTargetPage(model, model.activePageId, msg);
1547
- }
1548
- // Custom message path: route to originating page when command messages are scoped.
1549
- if (isPageScopedMsg(msg)) {
1550
- return updateTargetPage(model, msg.pageId, msg.msg);
1551
- }
1552
- return updateTargetPage(model, model.activePageId, msg);
1553
- },
1554
- view(model) {
1555
- const themedFrameCtx = resolveFrameThemeCtx(model.activeShellThemeId);
1556
- const { controlProjection, layerStack, activeLayer, } = resolvePresentedLayerContext(model);
1557
- const headerResult = resolveHeaderLine(model, options, pagesById, headerScratch, themedFrameCtx);
1558
- headerScratch = headerResult.surface;
1559
- const header = headerResult.surface;
1560
- helpLineScratch = renderHelpLine(model, activeLayer, options.i18n, resolveNotificationFooterCue(model, options, pagesById), helpLineScratch, themedFrameCtx);
1561
- const helpLine = helpLineScratch;
1562
- const bodyRect = resolveBodyRect(model, options);
1563
- // Check for maximized pane — if set, render only that pane at full body rect
1564
- const maxState = model.maximizedPaneByPage[model.activePageId];
1565
- const maximizedPaneId = maxState?.maximizedPaneId;
1566
- const frameSurface = getComposedFrameScratch(model.columns, model.rows);
1567
- // clear() is load-bearing: it resets dim flags left by overlay compositing
1568
- // on the previous frame. Do not skip or defer this call.
1569
- frameSurface.clear();
1570
- frameSurface.blit(header, 0, 0);
1571
- if (model.rows > 1) {
1572
- const footerVisible = model.footerVisible ?? true;
1573
- const footerTranslateY = Math.max(0, Math.min(1, model.footerTranslateY ?? (footerVisible ? 0 : 1)));
1574
- const footerRow = model.rows - helpLine.height + Math.floor(footerTranslateY * helpLine.height);
1575
- if (footerRow < model.rows) {
1576
- frameSurface.blit(helpLine, 0, footerRow);
1577
- }
1578
- }
1579
- let activeResult;
1580
- let bodySurface;
1581
- const activeTransition = model.activeTransition ?? options.transition;
1582
- if (model.previousPageId != null && model.transitionProgress < 1 && activeTransition && activeTransition !== 'none') {
1583
- const activeBodyResult = maximizedPaneId
1584
- ? renderMaximizedPane(model.activePageId, model, bodyRect, pagesById, maximizedPaneId, paneScratchPool, themedFrameCtx)
1585
- : renderPageContent(model.activePageId, model, bodyRect, pagesById, themedFrameCtx);
1586
- activeResult = activeBodyResult;
1587
- bodySurface = activeBodyResult.surface;
1588
- const ctx = themedFrameCtx;
1589
- if (ctx) {
1590
- const prevResult = renderPageContent(model.previousPageId, model, bodyRect, pagesById, themedFrameCtx);
1591
- bodySurface = renderTransition(prevResult.surface, activeBodyResult.surface, activeTransition, model.transitionProgress, bodyRect.width, bodyRect.height, ctx, model.transitionFrame);
1592
- }
1593
- }
1594
- else {
1595
- activeResult = maximizedPaneId
1596
- ? renderMaximizedPaneInto(model.activePageId, model, bodyRect, pagesById, maximizedPaneId, frameSurface, bodyRect.row, bodyRect.col, paneScratchPool, themedFrameCtx)
1597
- : renderPageContentInto(model.activePageId, model, bodyRect, pagesById, frameSurface, bodyRect.row, bodyRect.col, paneScratchPool, themedFrameCtx);
1598
- }
1599
- rememberWorkspaceLayout(model, activeResult.paneRects, headerResult.tabTargets);
1600
- const overlays = [];
1601
- if (options.overlayFactory != null) {
1602
- const activePageModel = model.pageModels[model.activePageId];
1603
- if (activePageModel === undefined) {
1604
- throw new Error(`createFramedApp: active page model "${model.activePageId}" is missing`);
1605
- }
1606
- overlays.push(...options.overlayFactory({
1607
- activePageId: model.activePageId,
1608
- pageModel: activePageModel,
1609
- paneRects: activeResult.paneRects,
1610
- screenRect: { row: 0, col: 0, width: model.columns, height: model.rows },
1611
- }));
1612
- }
1613
- if (frameNotificationOptions.enabled) {
1614
- const ctx = themedFrameCtx;
1615
- overlays.push(...renderNotificationStack(model.runtimeNotifications, {
1616
- screenWidth: model.columns,
1617
- screenHeight: model.rows,
1618
- margin: frameNotificationOptions.margin,
1619
- gap: frameNotificationOptions.gap,
1620
- ctx: ctx ?? undefined,
1621
- }));
1622
- }
1623
- if (model.settingsOpen) {
1624
- const settingsLayer = layerStack.find((layer) => layer.kind === 'settings');
1625
- const settingsOverlay = renderSettingsDrawer(model, options, pagesById, resolvedShellThemes, settingsLayer?.title, themedFrameCtx);
1626
- if (settingsOverlay != null) {
1627
- overlays.push(settingsOverlay);
1628
- }
1629
- }
1630
- if (model.notificationCenterOpen) {
1631
- const notificationLayer = layerStack.find((layer) => layer.kind === 'notification-center');
1632
- const notificationCenterOverlay = renderNotificationCenterDrawer(model, options, pagesById, notificationLayer?.title, themedFrameCtx);
1633
- if (notificationCenterOverlay != null) {
1634
- overlays.push(notificationCenterOverlay);
1635
- }
1636
- }
1637
- if (model.helpOpen) {
1638
- const helpSource = controlProjection.helpSource;
1639
- if (helpSource == null) {
1640
- throw new Error('createFramedApp: help layer projection is missing a help source');
1641
- }
1642
- const helpOverlay = renderHelpOverlay(model, helpSource, options.i18n);
1643
- overlays.push(modal({
1644
- title: activeLayer.kind === 'help'
1645
- ? (activeLayer.title ?? frameMessage(options.i18n, 'help.title', 'Keyboard Help'))
1646
- : frameMessage(options.i18n, 'help.title', 'Keyboard Help'),
1647
- body: helpOverlay.body,
1648
- hint: typeof activeLayer.hintSource === 'string'
1649
- ? activeLayer.hintSource
1650
- : frameMessage(options.i18n, 'help.hint', 'j/k scroll • d/u page • g/G top/bottom • mouse wheel • ?/Esc close'),
1651
- borderToken: themedFrameCtx?.border('primary'),
1652
- bgToken: themedFrameCtx?.surface('elevated'),
1653
- ctx: themedFrameCtx,
1654
- width: helpOverlay.body.width + 4,
1655
- screenWidth: model.columns,
1656
- screenHeight: model.rows,
1657
- }));
1658
- }
1659
- if (model.commandPalette != null) {
1660
- const paletteWidth = Math.max(20, Math.min(80, model.columns - 4));
1661
- const paletteBody = commandPaletteSurface(model.commandPalette, {
1662
- width: Math.max(16, paletteWidth - 4),
1663
- ctx: themedFrameCtx,
1664
- showScrollbar: false,
1665
- });
1666
- const paletteLayer = activeLayer.kind === 'search' || activeLayer.kind === 'command-palette'
1667
- ? activeLayer
1668
- : undefined;
1669
- overlays.push(modal({
1670
- title: paletteLayer?.title ?? model.commandPaletteTitle ?? frameMessage(options.i18n, 'palette.title', 'Command Palette'),
1671
- body: paletteBody,
1672
- hint: typeof paletteLayer?.hintSource === 'string'
1673
- ? paletteLayer.hintSource
1674
- : frameMessage(options.i18n, 'palette.hint', 'Enter select • Esc close'),
1675
- borderToken: themedFrameCtx?.border('primary'),
1676
- bgToken: themedFrameCtx?.surface('elevated'),
1677
- ctx: themedFrameCtx,
1678
- width: paletteWidth,
1679
- screenWidth: model.columns,
1680
- screenHeight: model.rows,
1681
- }));
1682
- }
1683
- if (model.quitConfirmOpen) {
1684
- overlays.push(renderShellQuitOverlay(model.columns, model.rows, options.i18n, themedFrameCtx));
1685
- }
1686
- const dimBackground = overlays.length > 0;
1687
- if (model.perfHudOpen) {
1688
- overlays.push(renderFramePerfHudOverlay({
1689
- columns: model.columns,
1690
- rows: model.rows,
1691
- frameTimeMs: model.frameTimeMs,
1692
- viewTimeMs: model.viewTimeMs,
1693
- diffTimeMs: model.diffTimeMs,
1694
- refreshRate: themedFrameCtx?.runtime.refreshRate,
1695
- }, {
1696
- i18n: options.i18n,
1697
- ctx: themedFrameCtx,
1698
- }));
1699
- }
1700
- if (bodySurface != null && bodyRect.width > 0 && bodyRect.height > 0) {
1701
- frameSurface.blit(bodySurface, bodyRect.col, bodyRect.row);
1702
- }
1703
- return compositeSurfaceInto(frameSurface, frameSurface, overlays, { dim: dimBackground });
1704
- },
1705
- routeRuntimeIssue(issue) {
1706
- if (!frameNotificationOptions.enabled)
1707
- return undefined;
1708
- return wrapFrameMsg({ type: 'runtime-issue', issue });
1709
- },
1710
- };
1711
- function isInternalFrameModel(model) {
1712
- return 'helpScrollY' in model && 'warnedFrameKeyCollisionPages' in model;
1713
- }
1714
- function requireInternalFrameModel(model) {
1715
- if (isInternalFrameModel(model))
1716
- return model;
1717
- throw new Error('createFramedApp: framed runtime received a non-frame model');
1718
- }
1719
- let hostedRunActive = false;
1720
- const framedApp = {
1721
- init() {
1722
- return app.init();
1723
- },
1724
- update(msg, model) {
1725
- return app.update(msg, requireInternalFrameModel(model));
1726
- },
1727
- view(model) {
1728
- return app.view(requireInternalFrameModel(model));
1729
- },
1730
- routeRuntimeIssue(issue) {
1731
- return app.routeRuntimeIssue?.(issue);
1732
- },
1733
- run: runHostedFramedApp,
1734
- };
1735
- async function runHostedFramedApp(runOptions) {
1736
- if (hostedRunActive) {
1737
- throw new Error('createFramedApp: concurrent app.run() calls on the same framed app are not supported');
1738
- }
1739
- hostedRunActive = true;
1740
- const previousFrameCtx = frameCtx;
1741
- const previousFrameCtxShellThemeId = frameCtxShellThemeId;
1742
- const previousDefaultFrameCtx = defaultFrameCtx;
1743
- const previousResolvedShellThemes = resolvedShellThemes;
1744
- const runtimeCtx = runOptions?.ctx;
1745
- if (runtimeCtx != null && options.ctx == null) {
1746
- useRunScopedFrameCtx = true;
1747
- frameCtx = runtimeCtx;
1748
- defaultFrameCtx = runtimeCtx;
1749
- resolvedShellThemes = [];
1750
- ensureResolvedShellThemes(runtimeCtx);
1751
- frameCtxShellThemeId = resolveShellThemeForContext(resolvedShellThemes, runtimeCtx)?.id;
1752
- }
1753
- const frameBudgetMs = resolveFrameBudgetMs(runOptions, resolveFrameCtx());
1754
- let pendingTimingSnapshot;
1755
- let needsTimingHydrationRender = true;
1756
- try {
1757
- await runWithLifecycleHooks(framedApp, {
1758
- ...runOptions,
1759
- mouse: runOptions?.mouse ?? true,
1760
- }, {
1761
- beforeRender(model) {
1762
- if (pendingTimingSnapshot == null)
1763
- return model;
1764
- return applyFrameTimingSnapshot(requireInternalFrameModel(model), pendingTimingSnapshot);
1765
- },
1766
- afterRender({ timings }) {
1767
- pendingTimingSnapshot = summarizeFrameTimings(timings, frameBudgetMs);
1768
- if (!needsTimingHydrationRender)
1769
- return;
1770
- needsTimingHydrationRender = false;
1771
- return { requestRender: true };
1772
- },
1773
- });
1774
- }
1775
- finally {
1776
- hostedRunActive = false;
1777
- useRunScopedFrameCtx = false;
1778
- frameCtx = previousFrameCtx;
1779
- frameCtxShellThemeId = previousFrameCtxShellThemeId;
1780
- defaultFrameCtx = previousDefaultFrameCtx;
1781
- resolvedShellThemes = previousResolvedShellThemes;
1782
- }
1783
- }
1784
- return framedApp;
1785
- }
1786
- /**
1787
- * Create and immediately run a batteries-included framed shell.
1788
- *
1789
- * This is the one-call hosted path for users who want the frame to own the
1790
- * runtime pump while `run(app)` remains the low-level TEA contract.
1791
- */
1792
- export async function runFramedApp(options, runOptions) {
1793
- await createFramedApp(options).run(runOptions);
1794
- }
1795
- function focusPane(model, paneId) {
1796
- if (model.focusedPaneByPage[model.activePageId] === paneId)
1797
- return model;
1798
- return {
1799
- ...model,
1800
- focusedPaneByPage: {
1801
- ...model.focusedPaneByPage,
1802
- [model.activePageId]: paneId,
1803
- },
1804
- };
1805
- }
1806
- function resolveBodyRect(model, options) {
1807
- return frameBodyRect(model.columns, model.rows, options.bodyTopRows ?? 1, options.bodyBottomRows ?? 1);
1808
- }
4
+ export { FRAME_MSG_TOKEN, FRAME_SHELL_THEME_MODE_SUPPORT, PAGE_MSG_TOKEN, activeFrameLayer, createFramedApp, describeFrameLayerStack, describeFrameRuntimeViewStack, emitFrameAction, emitMsg, emitMsgForPage, isFrameScopedMsg, isPageScopedMsg, notify, projectFrameControls, renderFramePerfHudOverlay, runFramedApp, summarizeFrameTimings, underlyingFrameLayer, wrapCmdForPage, wrapFrameMsg, wrapPageMsg, } from './app-frame-runtime.js';
1809
5
  //# sourceMappingURL=app-frame.js.map