@xemahq/ui-kernel 0.9.0 → 0.9.2

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 (444) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/biome-host/biome-builders.d.ts.map +1 -1
  7. package/dist/lib/biome-host/biome-builders.js +3 -1
  8. package/dist/lib/biome-host/biome-builders.js.map +1 -1
  9. package/dist/lib/biome-host/biome-registry.d.ts.map +1 -1
  10. package/dist/lib/biome-host/biome-registry.js +14 -9
  11. package/dist/lib/biome-host/biome-registry.js.map +1 -1
  12. package/dist/lib/biome-host/biome-scope-hooks.d.ts +11 -0
  13. package/dist/lib/biome-host/biome-scope-hooks.d.ts.map +1 -0
  14. package/dist/lib/biome-host/biome-scope-hooks.js +25 -0
  15. package/dist/lib/biome-host/biome-scope-hooks.js.map +1 -0
  16. package/dist/lib/biome-host/biome-scope.d.ts +1 -10
  17. package/dist/lib/biome-host/biome-scope.d.ts.map +1 -1
  18. package/dist/lib/biome-host/biome-scope.js +1 -24
  19. package/dist/lib/biome-host/biome-scope.js.map +1 -1
  20. package/dist/lib/biome-host/biome-scoped-query.d.ts +1 -1
  21. package/dist/lib/biome-host/biome-scoped-query.d.ts.map +1 -1
  22. package/dist/lib/biome-host/biome-scoped-query.js +1 -1
  23. package/dist/lib/biome-host/biome-scoped-query.js.map +1 -1
  24. package/dist/lib/biome-host/create-biome-orval-config.js +2 -2
  25. package/dist/lib/biome-host/create-biome-orval-config.js.map +1 -1
  26. package/dist/lib/biome-host/errors.js.map +1 -1
  27. package/dist/lib/biome-host/index.d.ts +1 -1
  28. package/dist/lib/biome-host/index.d.ts.map +1 -1
  29. package/dist/lib/biome-host/index.js +1 -1
  30. package/dist/lib/biome-host/index.js.map +1 -1
  31. package/dist/lib/biome-host/session-profiles.d.ts.map +1 -1
  32. package/dist/lib/biome-host/session-profiles.js +4 -1
  33. package/dist/lib/biome-host/session-profiles.js.map +1 -1
  34. package/dist/lib/capabilities/capability-context.d.ts +9 -0
  35. package/dist/lib/capabilities/capability-context.d.ts.map +1 -0
  36. package/dist/lib/capabilities/capability-context.js +13 -0
  37. package/dist/lib/capabilities/capability-context.js.map +1 -0
  38. package/dist/lib/capabilities/capability-provider.d.ts +2 -8
  39. package/dist/lib/capabilities/capability-provider.d.ts.map +1 -1
  40. package/dist/lib/capabilities/capability-provider.js +1 -12
  41. package/dist/lib/capabilities/capability-provider.js.map +1 -1
  42. package/dist/lib/capabilities/index.d.ts +1 -0
  43. package/dist/lib/capabilities/index.d.ts.map +1 -1
  44. package/dist/lib/capabilities/index.js +1 -0
  45. package/dist/lib/capabilities/index.js.map +1 -1
  46. package/dist/lib/capabilities/use-capability.d.ts.map +1 -1
  47. package/dist/lib/capabilities/use-capability.js +1 -1
  48. package/dist/lib/capabilities/use-capability.js.map +1 -1
  49. package/dist/lib/contribution-registry/contribution-registry.d.ts +24 -0
  50. package/dist/lib/contribution-registry/contribution-registry.d.ts.map +1 -0
  51. package/dist/lib/contribution-registry/contribution-registry.js +67 -0
  52. package/dist/lib/contribution-registry/contribution-registry.js.map +1 -0
  53. package/dist/lib/contribution-registry/index.d.ts +3 -0
  54. package/dist/lib/contribution-registry/index.d.ts.map +1 -0
  55. package/dist/lib/contribution-registry/index.js +3 -0
  56. package/dist/lib/contribution-registry/index.js.map +1 -0
  57. package/dist/lib/contribution-registry/renderable-registry.d.ts +33 -0
  58. package/dist/lib/contribution-registry/renderable-registry.d.ts.map +1 -0
  59. package/dist/lib/contribution-registry/renderable-registry.js +51 -0
  60. package/dist/lib/contribution-registry/renderable-registry.js.map +1 -0
  61. package/dist/lib/system-bus/deeplink.js.map +1 -1
  62. package/dist/lib/system-bus/host-ports.d.ts +2 -1
  63. package/dist/lib/system-bus/host-ports.d.ts.map +1 -1
  64. package/dist/lib/system-bus/intent-registry.d.ts.map +1 -1
  65. package/dist/lib/system-bus/intent-registry.js.map +1 -1
  66. package/dist/offline/index.d.ts +2 -1
  67. package/dist/offline/index.d.ts.map +1 -1
  68. package/dist/offline/index.js +2 -1
  69. package/dist/offline/index.js.map +1 -1
  70. package/dist/offline/offline-status-badge.js +1 -1
  71. package/dist/offline/offline-status-badge.js.map +1 -1
  72. package/dist/offline/outbox.js.map +1 -1
  73. package/dist/offline/react-hooks.d.ts +7 -0
  74. package/dist/offline/react-hooks.d.ts.map +1 -0
  75. package/dist/offline/react-hooks.js +25 -0
  76. package/dist/offline/react-hooks.js.map +1 -0
  77. package/dist/offline/react.d.ts +0 -4
  78. package/dist/offline/react.d.ts.map +1 -1
  79. package/dist/offline/react.js +2 -24
  80. package/dist/offline/react.js.map +1 -1
  81. package/dist/offline/storage.d.ts.map +1 -1
  82. package/dist/offline/storage.js +8 -5
  83. package/dist/offline/storage.js.map +1 -1
  84. package/dist/registry/index.d.ts +1 -0
  85. package/dist/registry/index.d.ts.map +1 -1
  86. package/dist/registry/index.js +1 -0
  87. package/dist/registry/index.js.map +1 -1
  88. package/dist/registry/lib/primitives/SessionEventCard.d.ts.map +1 -1
  89. package/dist/registry/lib/primitives/SessionEventCard.js +1 -1
  90. package/dist/registry/lib/primitives/SessionEventCard.js.map +1 -1
  91. package/dist/registry/lib/session-context-provider.d.ts +1 -3
  92. package/dist/registry/lib/session-context-provider.d.ts.map +1 -1
  93. package/dist/registry/lib/session-context-provider.js +2 -15
  94. package/dist/registry/lib/session-context-provider.js.map +1 -1
  95. package/dist/registry/lib/session-context.d.ts +5 -0
  96. package/dist/registry/lib/session-context.d.ts.map +1 -0
  97. package/dist/registry/lib/session-context.js +15 -0
  98. package/dist/registry/lib/session-context.js.map +1 -0
  99. package/dist/registry/lib/session-selectors.d.ts.map +1 -1
  100. package/dist/registry/lib/session-selectors.js +3 -1
  101. package/dist/registry/lib/session-selectors.js.map +1 -1
  102. package/dist/ui/branding/app-branding-context.d.ts +9 -0
  103. package/dist/ui/branding/app-branding-context.d.ts.map +1 -0
  104. package/dist/ui/branding/app-branding-context.js +10 -0
  105. package/dist/ui/branding/app-branding-context.js.map +1 -0
  106. package/dist/ui/branding/app-branding-provider.d.ts +0 -6
  107. package/dist/ui/branding/app-branding-provider.d.ts.map +1 -1
  108. package/dist/ui/branding/app-branding-provider.js +1 -8
  109. package/dist/ui/branding/app-branding-provider.js.map +1 -1
  110. package/dist/ui/capture/field-spec-to-zod.d.ts +1 -0
  111. package/dist/ui/capture/field-spec-to-zod.d.ts.map +1 -1
  112. package/dist/ui/capture/field-spec-to-zod.js +19 -0
  113. package/dist/ui/capture/field-spec-to-zod.js.map +1 -1
  114. package/dist/ui/capture/field-spec-validate.d.ts +4 -0
  115. package/dist/ui/capture/field-spec-validate.d.ts.map +1 -0
  116. package/dist/ui/capture/field-spec-validate.js +129 -0
  117. package/dist/ui/capture/field-spec-validate.js.map +1 -0
  118. package/dist/ui/capture/field-spec.d.ts +13 -1
  119. package/dist/ui/capture/field-spec.d.ts.map +1 -1
  120. package/dist/ui/capture/field-spec.js +25 -0
  121. package/dist/ui/capture/field-spec.js.map +1 -1
  122. package/dist/ui/capture/index.d.ts +4 -2
  123. package/dist/ui/capture/index.d.ts.map +1 -1
  124. package/dist/ui/capture/index.js +4 -2
  125. package/dist/ui/capture/index.js.map +1 -1
  126. package/dist/ui/capture/schema-field-input.d.ts.map +1 -1
  127. package/dist/ui/capture/schema-field-input.js +40 -13
  128. package/dist/ui/capture/schema-field-input.js.map +1 -1
  129. package/dist/ui/capture/submit-values.d.ts +6 -0
  130. package/dist/ui/capture/submit-values.d.ts.map +1 -0
  131. package/dist/ui/capture/submit-values.js +28 -0
  132. package/dist/ui/capture/submit-values.js.map +1 -0
  133. package/dist/ui/capture/use-prefill.d.ts.map +1 -1
  134. package/dist/ui/capture/use-prefill.js +3 -1
  135. package/dist/ui/capture/use-prefill.js.map +1 -1
  136. package/dist/ui/capture/use-wizard.d.ts +1 -1
  137. package/dist/ui/capture/use-wizard.d.ts.map +1 -1
  138. package/dist/ui/capture/use-wizard.js +1 -1
  139. package/dist/ui/capture/use-wizard.js.map +1 -1
  140. package/dist/ui/capture/wizard.d.ts.map +1 -1
  141. package/dist/ui/capture/wizard.js.map +1 -1
  142. package/dist/ui/index.d.ts +6 -1
  143. package/dist/ui/index.d.ts.map +1 -1
  144. package/dist/ui/index.js +6 -1
  145. package/dist/ui/index.js.map +1 -1
  146. package/dist/ui/primitives/alert-dialog.js +1 -1
  147. package/dist/ui/primitives/alert-dialog.js.map +1 -1
  148. package/dist/ui/primitives/badge-variants.d.ts +4 -0
  149. package/dist/ui/primitives/badge-variants.d.ts.map +1 -0
  150. package/dist/ui/primitives/badge-variants.js +15 -0
  151. package/dist/ui/primitives/badge-variants.js.map +1 -0
  152. package/dist/ui/primitives/badge.d.ts +3 -5
  153. package/dist/ui/primitives/badge.d.ts.map +1 -1
  154. package/dist/ui/primitives/badge.js +2 -15
  155. package/dist/ui/primitives/badge.js.map +1 -1
  156. package/dist/ui/primitives/button-variants.d.ts +5 -0
  157. package/dist/ui/primitives/button-variants.d.ts.map +1 -0
  158. package/dist/ui/primitives/button-variants.js +24 -0
  159. package/dist/ui/primitives/button-variants.js.map +1 -0
  160. package/dist/ui/primitives/button.d.ts +3 -6
  161. package/dist/ui/primitives/button.d.ts.map +1 -1
  162. package/dist/ui/primitives/button.js +2 -24
  163. package/dist/ui/primitives/button.js.map +1 -1
  164. package/dist/ui/primitives/form-stepper.d.ts +1 -13
  165. package/dist/ui/primitives/form-stepper.d.ts.map +1 -1
  166. package/dist/ui/primitives/form-stepper.js +1 -6
  167. package/dist/ui/primitives/form-stepper.js.map +1 -1
  168. package/dist/ui/primitives/form-stepper.types.d.ts +14 -0
  169. package/dist/ui/primitives/form-stepper.types.d.ts.map +1 -0
  170. package/dist/ui/primitives/form-stepper.types.js +7 -0
  171. package/dist/ui/primitives/form-stepper.types.js.map +1 -0
  172. package/dist/ui/primitives/overflow-tabs.d.ts +5 -0
  173. package/dist/ui/primitives/overflow-tabs.d.ts.map +1 -1
  174. package/dist/ui/primitives/overflow-tabs.js +4 -4
  175. package/dist/ui/primitives/overflow-tabs.js.map +1 -1
  176. package/dist/ui/primitives/preview-device-frame.js +1 -1
  177. package/dist/ui/primitives/preview-device-frame.js.map +1 -1
  178. package/dist/ui/primitives/tag-multi-select.d.ts.map +1 -1
  179. package/dist/ui/primitives/tag-multi-select.js +1 -1
  180. package/dist/ui/primitives/tag-multi-select.js.map +1 -1
  181. package/dist/ui/primitives/url-preview-chrome.d.ts +8 -0
  182. package/dist/ui/primitives/url-preview-chrome.d.ts.map +1 -0
  183. package/dist/ui/primitives/url-preview-chrome.js +40 -0
  184. package/dist/ui/primitives/url-preview-chrome.js.map +1 -0
  185. package/dist/vista/GenericCatalogueSurface.d.ts +10 -0
  186. package/dist/vista/GenericCatalogueSurface.d.ts.map +1 -0
  187. package/dist/vista/GenericCatalogueSurface.js +80 -0
  188. package/dist/vista/GenericCatalogueSurface.js.map +1 -0
  189. package/dist/vista/SurfaceFallbackCard.d.ts +9 -0
  190. package/dist/vista/SurfaceFallbackCard.d.ts.map +1 -0
  191. package/dist/vista/SurfaceFallbackCard.js +44 -0
  192. package/dist/vista/SurfaceFallbackCard.js.map +1 -0
  193. package/dist/vista/VistaPanel.d.ts +21 -0
  194. package/dist/vista/VistaPanel.d.ts.map +1 -0
  195. package/dist/vista/VistaPanel.js +31 -0
  196. package/dist/vista/VistaPanel.js.map +1 -0
  197. package/dist/vista/html/CustomUiFrame.d.ts +20 -0
  198. package/dist/vista/html/CustomUiFrame.d.ts.map +1 -0
  199. package/dist/vista/html/CustomUiFrame.js +69 -0
  200. package/dist/vista/html/CustomUiFrame.js.map +1 -0
  201. package/dist/vista/html/custom-ui-frame-bridge.d.ts +13 -0
  202. package/dist/vista/html/custom-ui-frame-bridge.d.ts.map +1 -0
  203. package/dist/vista/html/custom-ui-frame-bridge.js +30 -0
  204. package/dist/vista/html/custom-ui-frame-bridge.js.map +1 -0
  205. package/dist/vista/html/custom-ui-frame-contract.d.ts +29 -0
  206. package/dist/vista/html/custom-ui-frame-contract.d.ts.map +1 -0
  207. package/dist/vista/html/custom-ui-frame-contract.js +16 -0
  208. package/dist/vista/html/custom-ui-frame-contract.js.map +1 -0
  209. package/dist/vista/html/custom-ui-intents.d.ts +20 -0
  210. package/dist/vista/html/custom-ui-intents.d.ts.map +1 -0
  211. package/dist/vista/html/custom-ui-intents.js +57 -0
  212. package/dist/vista/html/custom-ui-intents.js.map +1 -0
  213. package/dist/vista/html/custom-ui-srcdoc.d.ts +17 -0
  214. package/dist/vista/html/custom-ui-srcdoc.d.ts.map +1 -0
  215. package/dist/vista/html/custom-ui-srcdoc.js +70 -0
  216. package/dist/vista/html/custom-ui-srcdoc.js.map +1 -0
  217. package/dist/vista/html/index.d.ts +6 -0
  218. package/dist/vista/html/index.d.ts.map +1 -0
  219. package/dist/vista/html/index.js +6 -0
  220. package/dist/vista/html/index.js.map +1 -0
  221. package/dist/vista/index.d.ts +22 -0
  222. package/dist/vista/index.d.ts.map +1 -0
  223. package/dist/vista/index.js +22 -0
  224. package/dist/vista/index.js.map +1 -0
  225. package/dist/vista/surface-catalogue.d.ts +5 -0
  226. package/dist/vista/surface-catalogue.d.ts.map +1 -0
  227. package/dist/vista/surface-catalogue.js +30 -0
  228. package/dist/vista/surface-catalogue.js.map +1 -0
  229. package/dist/vista/surface-icons.d.ts +7 -0
  230. package/dist/vista/surface-icons.d.ts.map +1 -0
  231. package/dist/vista/surface-icons.js +26 -0
  232. package/dist/vista/surface-icons.js.map +1 -0
  233. package/dist/vista/surface-registry.d.ts +7 -0
  234. package/dist/vista/surface-registry.d.ts.map +1 -0
  235. package/dist/vista/surface-registry.js +7 -0
  236. package/dist/vista/surface-registry.js.map +1 -0
  237. package/dist/vista/surfaces/ChartSurface.d.ts +4 -0
  238. package/dist/vista/surfaces/ChartSurface.d.ts.map +1 -0
  239. package/dist/vista/surfaces/ChartSurface.js +17 -0
  240. package/dist/vista/surfaces/ChartSurface.js.map +1 -0
  241. package/dist/vista/surfaces/FilesSurface.d.ts +4 -0
  242. package/dist/vista/surfaces/FilesSurface.d.ts.map +1 -0
  243. package/dist/vista/surfaces/FilesSurface.js +77 -0
  244. package/dist/vista/surfaces/FilesSurface.js.map +1 -0
  245. package/dist/vista/surfaces/FormSurface.d.ts +4 -0
  246. package/dist/vista/surfaces/FormSurface.d.ts.map +1 -0
  247. package/dist/vista/surfaces/FormSurface.js +124 -0
  248. package/dist/vista/surfaces/FormSurface.js.map +1 -0
  249. package/dist/vista/surfaces/HtmlSurface.d.ts +4 -0
  250. package/dist/vista/surfaces/HtmlSurface.d.ts.map +1 -0
  251. package/dist/vista/surfaces/HtmlSurface.js +11 -0
  252. package/dist/vista/surfaces/HtmlSurface.js.map +1 -0
  253. package/dist/vista/surfaces/TableSurface.d.ts +4 -0
  254. package/dist/vista/surfaces/TableSurface.d.ts.map +1 -0
  255. package/dist/vista/surfaces/TableSurface.js +42 -0
  256. package/dist/vista/surfaces/TableSurface.js.map +1 -0
  257. package/dist/vista/surfaces/UrlSurface.d.ts +4 -0
  258. package/dist/vista/surfaces/UrlSurface.d.ts.map +1 -0
  259. package/dist/vista/surfaces/UrlSurface.js +7 -0
  260. package/dist/vista/surfaces/UrlSurface.js.map +1 -0
  261. package/dist/vista/surfaces/blob-surfaces.d.ts +6 -0
  262. package/dist/vista/surfaces/blob-surfaces.d.ts.map +1 -0
  263. package/dist/vista/surfaces/blob-surfaces.js +38 -0
  264. package/dist/vista/surfaces/blob-surfaces.js.map +1 -0
  265. package/dist/vista/surfaces/elicitation-transport.d.ts +27 -0
  266. package/dist/vista/surfaces/elicitation-transport.d.ts.map +1 -0
  267. package/dist/vista/surfaces/elicitation-transport.js +193 -0
  268. package/dist/vista/surfaces/elicitation-transport.js.map +1 -0
  269. package/dist/vista/surfaces/file-surface-utils.d.ts +13 -0
  270. package/dist/vista/surfaces/file-surface-utils.d.ts.map +1 -0
  271. package/dist/vista/surfaces/file-surface-utils.js +46 -0
  272. package/dist/vista/surfaces/file-surface-utils.js.map +1 -0
  273. package/dist/vista/surfaces/index.d.ts +12 -0
  274. package/dist/vista/surfaces/index.d.ts.map +1 -0
  275. package/dist/vista/surfaces/index.js +12 -0
  276. package/dist/vista/surfaces/index.js.map +1 -0
  277. package/dist/vista/surfaces/register-surfaces.d.ts +2 -0
  278. package/dist/vista/surfaces/register-surfaces.d.ts.map +1 -0
  279. package/dist/vista/surfaces/register-surfaces.js +80 -0
  280. package/dist/vista/surfaces/register-surfaces.js.map +1 -0
  281. package/dist/vista/surfaces/text-surfaces.d.ts +8 -0
  282. package/dist/vista/surfaces/text-surfaces.d.ts.map +1 -0
  283. package/dist/vista/surfaces/text-surfaces.js +54 -0
  284. package/dist/vista/surfaces/text-surfaces.js.map +1 -0
  285. package/dist/vista/use-vista-tabs.d.ts +30 -0
  286. package/dist/vista/use-vista-tabs.d.ts.map +1 -0
  287. package/dist/vista/use-vista-tabs.js +77 -0
  288. package/dist/vista/use-vista-tabs.js.map +1 -0
  289. package/dist/vista/vista-code-renderer-context.d.ts +9 -0
  290. package/dist/vista/vista-code-renderer-context.d.ts.map +1 -0
  291. package/dist/vista/vista-code-renderer-context.js +6 -0
  292. package/dist/vista/vista-code-renderer-context.js.map +1 -0
  293. package/dist/vista/vista-code-renderer.d.ts +7 -0
  294. package/dist/vista/vista-code-renderer.d.ts.map +1 -0
  295. package/dist/vista/vista-code-renderer.js +6 -0
  296. package/dist/vista/vista-code-renderer.js.map +1 -0
  297. package/dist/vista/vista-file-context.d.ts +8 -0
  298. package/dist/vista/vista-file-context.d.ts.map +1 -0
  299. package/dist/vista/vista-file-context.js +6 -0
  300. package/dist/vista/vista-file-context.js.map +1 -0
  301. package/dist/vista/vista-file-source.d.ts +15 -0
  302. package/dist/vista/vista-file-source.d.ts.map +1 -0
  303. package/dist/vista/vista-file-source.js +66 -0
  304. package/dist/vista/vista-file-source.js.map +1 -0
  305. package/dist/vista/vista-form-context.d.ts +13 -0
  306. package/dist/vista/vista-form-context.d.ts.map +1 -0
  307. package/dist/vista/vista-form-context.js +6 -0
  308. package/dist/vista/vista-form-context.js.map +1 -0
  309. package/dist/vista/vista-form-host.d.ts +7 -0
  310. package/dist/vista/vista-form-host.d.ts.map +1 -0
  311. package/dist/vista/vista-form-host.js +6 -0
  312. package/dist/vista/vista-form-host.js.map +1 -0
  313. package/dist/vista/vista-model.d.ts +12 -0
  314. package/dist/vista/vista-model.d.ts.map +1 -0
  315. package/dist/vista/vista-model.js +72 -0
  316. package/dist/vista/vista-model.js.map +1 -0
  317. package/dist/vista/vista-open-context.d.ts +7 -0
  318. package/dist/vista/vista-open-context.d.ts.map +1 -0
  319. package/dist/vista/vista-open-context.js +6 -0
  320. package/dist/vista/vista-open-context.js.map +1 -0
  321. package/dist/vista/vista-open-state.d.ts +5 -0
  322. package/dist/vista/vista-open-state.d.ts.map +1 -0
  323. package/dist/vista/vista-open-state.js +6 -0
  324. package/dist/vista/vista-open-state.js.map +1 -0
  325. package/dist/vista/vista-payloads.d.ts +106 -0
  326. package/dist/vista/vista-payloads.d.ts.map +1 -0
  327. package/dist/vista/vista-payloads.js +302 -0
  328. package/dist/vista/vista-payloads.js.map +1 -0
  329. package/dist/vista/vista-tabs-manifest.d.ts +17 -0
  330. package/dist/vista/vista-tabs-manifest.d.ts.map +1 -0
  331. package/dist/vista/vista-tabs-manifest.js +60 -0
  332. package/dist/vista/vista-tabs-manifest.js.map +1 -0
  333. package/dist/vista/vista-tools.d.ts +41 -0
  334. package/dist/vista/vista-tools.d.ts.map +1 -0
  335. package/dist/vista/vista-tools.js +113 -0
  336. package/dist/vista/vista-tools.js.map +1 -0
  337. package/package.json +4 -4
  338. package/src/index.ts +5 -0
  339. package/src/lib/biome-host/biome-builders.ts +4 -1
  340. package/src/lib/biome-host/biome-registry.ts +31 -12
  341. package/src/lib/biome-host/biome-scope-hooks.ts +39 -0
  342. package/src/lib/biome-host/biome-scope.tsx +1 -68
  343. package/src/lib/biome-host/biome-scoped-query.ts +4 -1
  344. package/src/lib/biome-host/create-biome-orval-config.ts +2 -2
  345. package/src/lib/biome-host/errors.ts +1 -1
  346. package/src/lib/biome-host/index.ts +1 -1
  347. package/src/lib/biome-host/session-profiles.ts +7 -1
  348. package/src/lib/capabilities/capability-context.ts +25 -0
  349. package/src/lib/capabilities/capability-provider.tsx +5 -34
  350. package/src/lib/capabilities/index.ts +1 -0
  351. package/src/lib/capabilities/use-capability.ts +4 -1
  352. package/src/lib/contribution-registry/contribution-registry.spec.ts +141 -0
  353. package/src/lib/contribution-registry/contribution-registry.ts +202 -0
  354. package/src/lib/contribution-registry/index.ts +9 -0
  355. package/src/lib/contribution-registry/renderable-registry.ts +142 -0
  356. package/src/lib/system-bus/deeplink.ts +1 -1
  357. package/src/lib/system-bus/host-ports.ts +2 -1
  358. package/src/lib/system-bus/intent-registry.ts +1 -2
  359. package/src/offline/index.ts +4 -2
  360. package/src/offline/offline-status-badge.tsx +1 -1
  361. package/src/offline/outbox.test.ts +23 -16
  362. package/src/offline/outbox.ts +1 -1
  363. package/src/offline/react-hooks.ts +37 -0
  364. package/src/offline/react.tsx +1 -40
  365. package/src/offline/storage.ts +11 -6
  366. package/src/registry/index.ts +1 -0
  367. package/src/registry/lib/primitives/SessionEventCard.tsx +4 -2
  368. package/src/registry/lib/session-context-provider.tsx +8 -25
  369. package/src/registry/lib/session-context.ts +21 -0
  370. package/src/registry/lib/session-selectors.ts +3 -1
  371. package/src/ui/branding/app-branding-context.ts +20 -0
  372. package/src/ui/branding/app-branding-provider.tsx +5 -27
  373. package/src/ui/capture/field-spec-to-zod.ts +22 -0
  374. package/src/ui/capture/field-spec-validate.ts +147 -0
  375. package/src/ui/capture/field-spec.ts +62 -0
  376. package/src/ui/capture/index.ts +9 -1
  377. package/src/ui/capture/schema-field-input.tsx +141 -15
  378. package/src/ui/capture/submit-values.test.ts +70 -0
  379. package/src/ui/capture/submit-values.ts +63 -0
  380. package/src/ui/capture/use-prefill.ts +4 -1
  381. package/src/ui/capture/use-wizard.ts +2 -2
  382. package/src/ui/capture/wizard.tsx +2 -1
  383. package/src/ui/index.ts +11 -2
  384. package/src/ui/primitives/alert-dialog.tsx +1 -1
  385. package/src/ui/primitives/badge-variants.ts +21 -0
  386. package/src/ui/primitives/badge.tsx +3 -19
  387. package/src/ui/primitives/button-variants.ts +31 -0
  388. package/src/ui/primitives/button.tsx +3 -28
  389. package/src/ui/primitives/form-stepper.tsx +1 -16
  390. package/src/ui/primitives/form-stepper.types.ts +15 -0
  391. package/src/ui/primitives/overflow-tabs.tsx +24 -4
  392. package/src/ui/primitives/preview-device-frame.tsx +1 -1
  393. package/src/ui/primitives/tag-multi-select.tsx +3 -4
  394. package/src/ui/primitives/url-preview-chrome.tsx +102 -0
  395. package/src/vista/GenericCatalogueSurface.tsx +177 -0
  396. package/src/vista/SurfaceFallbackCard.tsx +109 -0
  397. package/src/vista/VistaPanel.tsx +155 -0
  398. package/src/vista/form-payload.spec.ts +139 -0
  399. package/src/vista/html/CustomUiFrame.spec.tsx +125 -0
  400. package/src/vista/html/CustomUiFrame.tsx +204 -0
  401. package/src/vista/html/custom-ui-frame-bridge.spec.ts +191 -0
  402. package/src/vista/html/custom-ui-frame-bridge.ts +92 -0
  403. package/src/vista/html/custom-ui-frame-contract.ts +88 -0
  404. package/src/vista/html/custom-ui-intents.spec.ts +133 -0
  405. package/src/vista/html/custom-ui-intents.ts +151 -0
  406. package/src/vista/html/custom-ui-srcdoc.spec.ts +151 -0
  407. package/src/vista/html/custom-ui-srcdoc.ts +193 -0
  408. package/src/vista/html/index.ts +13 -0
  409. package/src/vista/index.ts +52 -0
  410. package/src/vista/surface-catalogue.spec.ts +140 -0
  411. package/src/vista/surface-catalogue.ts +84 -0
  412. package/src/vista/surface-icons.ts +57 -0
  413. package/src/vista/surface-registry.ts +56 -0
  414. package/src/vista/surfaces/ChartSurface.tsx +34 -0
  415. package/src/vista/surfaces/FilesSurface.tsx +202 -0
  416. package/src/vista/surfaces/FormSurface.tsx +363 -0
  417. package/src/vista/surfaces/HtmlSurface.tsx +43 -0
  418. package/src/vista/surfaces/TableSurface.tsx +99 -0
  419. package/src/vista/surfaces/UrlSurface.tsx +40 -0
  420. package/src/vista/surfaces/blob-surfaces.tsx +129 -0
  421. package/src/vista/surfaces/elicitation-transport.spec.ts +369 -0
  422. package/src/vista/surfaces/elicitation-transport.ts +353 -0
  423. package/src/vista/surfaces/file-surface-utils.ts +62 -0
  424. package/src/vista/surfaces/index.ts +24 -0
  425. package/src/vista/surfaces/register-surfaces.tsx +137 -0
  426. package/src/vista/surfaces/text-surfaces.tsx +119 -0
  427. package/src/vista/use-vista-tabs.ts +188 -0
  428. package/src/vista/vista-code-renderer-context.ts +16 -0
  429. package/src/vista/vista-code-renderer.tsx +34 -0
  430. package/src/vista/vista-file-context.ts +14 -0
  431. package/src/vista/vista-file-source.tsx +140 -0
  432. package/src/vista/vista-form-context.ts +20 -0
  433. package/src/vista/vista-form-host.tsx +53 -0
  434. package/src/vista/vista-model.ts +130 -0
  435. package/src/vista/vista-open-context.tsx +32 -0
  436. package/src/vista/vista-open-state.ts +11 -0
  437. package/src/vista/vista-payloads.ts +512 -0
  438. package/src/vista/vista-tabs-manifest.ts +123 -0
  439. package/src/vista/vista-tools.ts +220 -0
  440. package/dist/lib/biome-host/response-envelope.d.ts +0 -3
  441. package/dist/lib/biome-host/response-envelope.d.ts.map +0 -1
  442. package/dist/lib/biome-host/response-envelope.js +0 -21
  443. package/dist/lib/biome-host/response-envelope.js.map +0 -1
  444. package/src/lib/biome-host/response-envelope.ts +0 -69
@@ -15,7 +15,14 @@
15
15
  * am I." Same for tabs marked `pinned: true` (indicator dot is sticky).
16
16
  */
17
17
  import { ChevronDown, X } from 'lucide-react';
18
- import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
18
+ import {
19
+ useEffect,
20
+ useLayoutEffect,
21
+ useMemo,
22
+ useRef,
23
+ useState,
24
+ type ComponentType,
25
+ } from 'react';
19
26
 
20
27
  import {
21
28
  DropdownMenu,
@@ -32,6 +39,14 @@ export interface OverflowTab {
32
39
  readonly indicator?: boolean;
33
40
  /** Optional numeric badge. */
34
41
  readonly count?: number;
42
+ /**
43
+ * A pinned tab is ALWAYS in the visible set (never collapsed into "More…")
44
+ * and never renders a close affordance, even when `onClose` is supplied.
45
+ * Used for a panel's permanent first tab (e.g. the Vista file browser).
46
+ */
47
+ readonly pinned?: boolean;
48
+ /** Optional leading glyph (a `lucide-react` icon component). */
49
+ readonly icon?: ComponentType<{ className?: string }>;
35
50
  }
36
51
 
37
52
  interface OverflowTabsProps {
@@ -105,7 +120,9 @@ export function OverflowTabs({
105
120
  let used = 0;
106
121
  for (let i = 0; i < tabs.length; i++) {
107
122
  const w = tabWidths[i] + (vis.length > 0 ? gap : 0);
108
- if (used + w <= budget) {
123
+ // A pinned tab is never collapsed — it stays visible whatever the budget
124
+ // says, so a panel's permanent first tab can't hide behind "More…".
125
+ if (tabs[i].pinned === true || used + w <= budget) {
109
126
  vis.push(tabs[i]);
110
127
  used += w;
111
128
  } else {
@@ -155,7 +172,9 @@ export function OverflowTabs({
155
172
  tab={t}
156
173
  active={t.value === value}
157
174
  onClick={() => onChange(t.value)}
158
- onClose={onClose ? () => onClose(t.value) : undefined}
175
+ onClose={
176
+ onClose && t.pinned !== true ? () => onClose(t.value) : undefined
177
+ }
159
178
  />
160
179
  ))}
161
180
  </div>
@@ -192,7 +211,7 @@ export function OverflowTabs({
192
211
  className="ml-2 inline-block h-1.5 w-1.5 rounded-full bg-warning"
193
212
  />
194
213
  )}
195
- {onClose && (
214
+ {onClose && t.pinned !== true && (
196
215
  <button
197
216
  type="button"
198
217
  aria-label={`Close ${t.label}`}
@@ -241,6 +260,7 @@ function TabPill({
241
260
  onClick={onClick}
242
261
  className="inline-flex items-center gap-2 outline-none"
243
262
  >
263
+ {tab.icon && <tab.icon className="h-3.5 w-3.5 shrink-0" />}
244
264
  {tab.label}
245
265
  {tab.count !== undefined && (
246
266
  <span className="rounded bg-paper-elev px-1 font-mono text-[10px] tabular-nums leading-4 text-ink-4">
@@ -181,7 +181,7 @@ function ResponsiveViewport({
181
181
  const observer = new ResizeObserver(compute);
182
182
  observer.observe(el);
183
183
  return () => observer.disconnect();
184
- }, [bezel.width, bezel.height]);
184
+ }, [aspectRatio, bezel.width, bezel.height]);
185
185
 
186
186
  return (
187
187
  <div
@@ -138,9 +138,8 @@ export function TagMultiSelect({
138
138
  className={cn('text-body-1 gap-1 pr-1', chipClass)}
139
139
  >
140
140
  <span className="truncate max-w-[160px]">{opt?.label ?? val}</span>
141
- <span
142
- role="button"
143
- tabIndex={-1}
141
+ <button
142
+ type="button"
144
143
  onClick={(e) => remove(val, e)}
145
144
  onKeyDown={(e) => {
146
145
  if (e.key === 'Enter' || e.key === ' ') {
@@ -153,7 +152,7 @@ export function TagMultiSelect({
153
152
  aria-label={`Remove ${opt?.label ?? val}`}
154
153
  >
155
154
  <X className="h-4 w-4" />
156
- </span>
155
+ </button>
157
156
  </Badge>
158
157
  );
159
158
  })}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Mock browser chrome for a URL preview.
3
+ *
4
+ * Renders the traffic-light dots + an address bar + a refresh affordance, then
5
+ * the caller-supplied live content (the real iframe) below.
6
+ *
7
+ * Owned by the UI kernel so the Vista `url` surface, the thin session
8
+ * workspace, and any biome preview reuse ONE chrome — there is no second
9
+ * implementation.
10
+ */
11
+ import { RotateCw } from 'lucide-react';
12
+ import type { ReactElement, ReactNode } from 'react';
13
+
14
+ const TRAFFIC_LIGHTS = ['#e5645a', '#e8b13d', '#5bb35b'] as const;
15
+
16
+ export interface UrlPreviewChromeProps {
17
+ /** Address shown in the mock address bar. */
18
+ readonly url: string;
19
+ /** Live preview content (the real iframe). */
20
+ readonly children: ReactNode;
21
+ /** Optional reload handler wired to the refresh glyph. */
22
+ readonly onReload?: () => void;
23
+ }
24
+
25
+ export function UrlPreviewChrome({
26
+ url,
27
+ children,
28
+ onReload,
29
+ }: UrlPreviewChromeProps): ReactElement {
30
+ return (
31
+ <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
32
+ <div
33
+ style={{
34
+ display: 'flex',
35
+ alignItems: 'center',
36
+ gap: 8,
37
+ padding: '8px 12px',
38
+ borderBottom: '1px solid hsl(var(--rule))',
39
+ background: 'hsl(var(--paper) / 0.5)',
40
+ flexShrink: 0,
41
+ }}
42
+ >
43
+ <span style={{ display: 'flex', gap: 5 }}>
44
+ {TRAFFIC_LIGHTS.map((color) => (
45
+ <span
46
+ key={color}
47
+ style={{
48
+ width: 9,
49
+ height: 9,
50
+ borderRadius: '50%',
51
+ background: color,
52
+ }}
53
+ />
54
+ ))}
55
+ </span>
56
+ <span
57
+ className="mono"
58
+ style={{
59
+ fontSize: 11,
60
+ color: 'hsl(var(--ink-4))',
61
+ marginLeft: 6,
62
+ padding: '3px 10px',
63
+ background: 'hsl(var(--paper-sunk))',
64
+ borderRadius: 6,
65
+ flex: 1,
66
+ overflow: 'hidden',
67
+ textOverflow: 'ellipsis',
68
+ whiteSpace: 'nowrap',
69
+ }}
70
+ >
71
+ {url}
72
+ </span>
73
+ {onReload ? (
74
+ <button
75
+ type="button"
76
+ onClick={onReload}
77
+ aria-label="Reload preview"
78
+ style={{
79
+ display: 'inline-flex',
80
+ color: 'hsl(var(--ink-4))',
81
+ padding: 2,
82
+ borderRadius: 5,
83
+ }}
84
+ >
85
+ <RotateCw size={13} />
86
+ </button>
87
+ ) : (
88
+ <RotateCw size={13} style={{ color: 'hsl(var(--ink-4))' }} />
89
+ )}
90
+ </div>
91
+ <div
92
+ style={{
93
+ flex: 1,
94
+ minHeight: 0,
95
+ background: 'hsl(var(--paper-elev))',
96
+ }}
97
+ >
98
+ {children}
99
+ </div>
100
+ </div>
101
+ );
102
+ }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Generic schema-driven Vista surface — layer 2 of the three-layer
3
+ * zero-maintenance guarantee (own renderer > THIS > safe fallback card).
4
+ *
5
+ * Renders a biome-contributed surface kind that has NO dedicated frontend
6
+ * renderer yet: the catalogue `displayName` over a labelled key/value view of
7
+ * the payload, ORDERED and LABELLED from the kind's catalogue `payloadSchema`
8
+ * (an opaque JSON Schema the kernel passes through verbatim).
9
+ *
10
+ * The projection is a pure, total function of `(payloadSchema, payload)`:
11
+ * • when the schema declares an object `properties` map, the declared keys
12
+ * are shown FIRST, in declaration order, labelled by each property's
13
+ * `title` (falling back to the key) and annotated with its `description`;
14
+ * • any payload key the schema did not declare is appended after them, so a
15
+ * payload is NEVER silently truncated by a stale schema;
16
+ * • a schema with no usable `properties` map degrades to plain
17
+ * `Object.entries(payload)` — the same view the ChatWidget generic renderer
18
+ * has always given.
19
+ *
20
+ * A biome that ships its OWN renderer overrides this: the catalogue sync only
21
+ * registers here where no renderer exists.
22
+ */
23
+ import { type ReactElement } from 'react';
24
+
25
+ /** One resolved row: the label to show, and the payload key to read. */
26
+ interface GenericSurfaceField {
27
+ readonly key: string;
28
+ readonly label: string;
29
+ readonly description?: string;
30
+ }
31
+
32
+ function stringify(value: unknown): string {
33
+ if (typeof value === 'string') return value;
34
+ if (typeof value === 'number' || typeof value === 'boolean') {
35
+ return String(value);
36
+ }
37
+ if (value === null || value === undefined) return '—';
38
+ try {
39
+ return JSON.stringify(value);
40
+ } catch {
41
+ return String(value);
42
+ }
43
+ }
44
+
45
+ function isPlainObject(value: unknown): value is Record<string, unknown> {
46
+ return (
47
+ typeof value === 'object' && value !== null && !Array.isArray(value)
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Ordered, labelled fields for a payload, derived from the kind's JSON Schema.
53
+ * Schema-declared keys first (declaration order), then any undeclared payload
54
+ * key. Total: never throws, never drops a payload key.
55
+ */
56
+ export function deriveGenericSurfaceFields(
57
+ payloadSchema: Record<string, unknown>,
58
+ payload: unknown,
59
+ ): readonly GenericSurfaceField[] {
60
+ const payloadKeys = isPlainObject(payload) ? Object.keys(payload) : [];
61
+ const properties = payloadSchema['properties'];
62
+ if (!isPlainObject(properties)) {
63
+ return payloadKeys.map((key) => ({ key, label: key }));
64
+ }
65
+ const declared: GenericSurfaceField[] = [];
66
+ for (const [key, raw] of Object.entries(properties)) {
67
+ const spec = isPlainObject(raw) ? raw : {};
68
+ const title = spec['title'];
69
+ const description = spec['description'];
70
+ declared.push({
71
+ key,
72
+ label: typeof title === 'string' && title.length > 0 ? title : key,
73
+ ...(typeof description === 'string' && description.length > 0
74
+ ? { description }
75
+ : {}),
76
+ });
77
+ }
78
+ const declaredKeys = new Set(declared.map((field) => field.key));
79
+ const extra = payloadKeys
80
+ .filter((key) => !declaredKeys.has(key))
81
+ .map((key) => ({ key, label: key }));
82
+ return [...declared, ...extra];
83
+ }
84
+
85
+ function readValue(payload: unknown, key: string): unknown {
86
+ return isPlainObject(payload) ? payload[key] : payload;
87
+ }
88
+
89
+ function renderGenericSurface({
90
+ displayName,
91
+ payloadSchema,
92
+ payload,
93
+ }: Readonly<{
94
+ displayName: string;
95
+ payloadSchema: Record<string, unknown>;
96
+ payload: unknown;
97
+ }>): ReactElement {
98
+ const fields = deriveGenericSurfaceFields(payloadSchema, payload);
99
+ const rows: readonly GenericSurfaceField[] =
100
+ fields.length > 0 ? fields : [{ key: 'value', label: 'value' }];
101
+ return (
102
+ <div
103
+ style={{
104
+ margin: 9,
105
+ border: '1px solid hsl(var(--rule))',
106
+ borderRadius: 9,
107
+ overflow: 'hidden',
108
+ background: 'hsl(var(--paper-elev))',
109
+ }}
110
+ >
111
+ <div
112
+ style={{
113
+ padding: '7px 11px',
114
+ borderBottom: '1px solid hsl(var(--rule))',
115
+ background: 'hsl(var(--muted))',
116
+ color: 'hsl(var(--ink-3))',
117
+ fontSize: 12,
118
+ fontWeight: 600,
119
+ }}
120
+ >
121
+ {displayName}
122
+ </div>
123
+ <div style={{ padding: '4px 0' }}>
124
+ {rows.map((field) => (
125
+ <div
126
+ key={field.key}
127
+ style={{
128
+ display: 'flex',
129
+ gap: 11,
130
+ padding: '4px 11px',
131
+ fontSize: 12.5,
132
+ }}
133
+ >
134
+ <span style={{ color: 'hsl(var(--ink-4))', minWidth: 128 }}>
135
+ {field.label}
136
+ {field.description !== undefined && (
137
+ <span
138
+ style={{
139
+ display: 'block',
140
+ fontSize: 11,
141
+ color: 'hsl(var(--ink-5, var(--ink-4)))',
142
+ }}
143
+ >
144
+ {field.description}
145
+ </span>
146
+ )}
147
+ </span>
148
+ <span
149
+ style={{ color: 'hsl(var(--ink-2))', wordBreak: 'break-word' }}
150
+ >
151
+ {stringify(
152
+ field.key === 'value' && !isPlainObject(payload)
153
+ ? payload
154
+ : readValue(payload, field.key),
155
+ )}
156
+ </span>
157
+ </div>
158
+ ))}
159
+ </div>
160
+ </div>
161
+ );
162
+ }
163
+
164
+ /**
165
+ * Build a renderer bound to a catalogue entry's `displayName` + `payloadSchema`
166
+ * for a biome surface kind with no dedicated frontend renderer.
167
+ */
168
+ export function makeGenericSurfaceRenderer(
169
+ displayName: string,
170
+ payloadSchema: Record<string, unknown>,
171
+ ): (payload: unknown) => ReactElement {
172
+ // `renderGenericSurface` is a pure presentational function (no hooks); call
173
+ // it directly so the renderer is a plain element factory, not a nested
174
+ // component definition.
175
+ return (payload: unknown) =>
176
+ renderGenericSurface({ displayName, payloadSchema, payload });
177
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Safe fallback card for the Vista surface registry — layer 3 of the
3
+ * three-layer zero-maintenance guarantee (own renderer > generic schema-driven
4
+ * renderer > this).
5
+ *
6
+ * Rendered for an unknown kind, an unparseable payload, or a payload version
7
+ * newer than the host supports. It NEVER throws and NEVER blanks — it states
8
+ * what happened and discloses the raw payload, so a biome shipping a
9
+ * not-yet-known surface degrades VISIBLY instead of silently. The fallback is
10
+ * itself part of the contract, not an error path.
11
+ */
12
+ import { AlertTriangle, ChevronDown, ChevronRight } from 'lucide-react';
13
+ import { useState, type ReactElement } from 'react';
14
+
15
+ import { ContributionFallbackReason } from '../lib/contribution-registry';
16
+
17
+ const REASON_LABEL: Record<ContributionFallbackReason, string> = {
18
+ [ContributionFallbackReason.UnknownKind]:
19
+ "This view isn't available in your client.",
20
+ [ContributionFallbackReason.InvalidPayload]:
21
+ "This view couldn't be displayed (its data didn't match the expected shape).",
22
+ [ContributionFallbackReason.UnsupportedVersion]:
23
+ 'This view needs a newer client — refresh to see it.',
24
+ };
25
+
26
+ export function SurfaceFallbackCard({
27
+ kind,
28
+ reason,
29
+ payload,
30
+ title,
31
+ }: Readonly<{
32
+ kind: string;
33
+ reason: ContributionFallbackReason;
34
+ payload: unknown;
35
+ /** The tab title, when the envelope carried one. */
36
+ title?: string;
37
+ }>): ReactElement {
38
+ const [open, setOpen] = useState(false);
39
+ let raw: string;
40
+ try {
41
+ raw = JSON.stringify(payload, null, 2);
42
+ } catch {
43
+ raw = String(payload);
44
+ }
45
+ return (
46
+ <div
47
+ style={{
48
+ margin: 9,
49
+ border: '1px solid hsl(var(--rule))',
50
+ borderRadius: 9,
51
+ background: 'hsl(var(--paper-elev))',
52
+ overflow: 'hidden',
53
+ }}
54
+ >
55
+ <button
56
+ type="button"
57
+ onClick={() => setOpen((v) => !v)}
58
+ style={{
59
+ display: 'flex',
60
+ alignItems: 'center',
61
+ gap: 9,
62
+ width: '100%',
63
+ padding: '9px 11px',
64
+ textAlign: 'left',
65
+ cursor: 'pointer',
66
+ }}
67
+ >
68
+ <AlertTriangle
69
+ size={14}
70
+ style={{ color: 'hsl(var(--warning))', flexShrink: 0 }}
71
+ />
72
+ <div style={{ flex: 1, minWidth: 0 }}>
73
+ <div
74
+ style={{ fontSize: 12.5, fontWeight: 600, color: 'hsl(var(--ink-2))' }}
75
+ >
76
+ {title ?? 'Unsupported view'}
77
+ </div>
78
+ <div style={{ fontSize: 11.5, color: 'hsl(var(--ink-4))', marginTop: 1 }}>
79
+ {REASON_LABEL[reason]}
80
+ </div>
81
+ </div>
82
+ <span
83
+ className="mono"
84
+ style={{ fontSize: 10.5, color: 'hsl(var(--ink-4))', flexShrink: 0 }}
85
+ >
86
+ {kind}
87
+ </span>
88
+ {open ? <ChevronDown size={12} /> : <ChevronRight size={12} />}
89
+ </button>
90
+ {open && (
91
+ <pre
92
+ className="mono"
93
+ style={{
94
+ margin: 0,
95
+ padding: '8px 11px',
96
+ borderTop: '1px solid hsl(var(--rule))',
97
+ fontSize: 11,
98
+ lineHeight: 1.55,
99
+ color: 'hsl(var(--ink-3))',
100
+ whiteSpace: 'pre-wrap',
101
+ overflowX: 'auto',
102
+ }}
103
+ >
104
+ {raw}
105
+ </pre>
106
+ )}
107
+ </div>
108
+ );
109
+ }
@@ -0,0 +1,155 @@
1
+ /**
2
+ * `VistaPanel` — the ONE tabbed render plane.
3
+ *
4
+ * It replaces the three hand-rolled tab strips the frontend carried (the thin
5
+ * session workspace, the Design-System-Builder preview, and App Forge's
6
+ * preview): tab chrome is {@link OverflowTabs} (auto-collapsing "More…" instead
7
+ * of a horizontal-scroll strip, active + pinned always visible), tab STATE is
8
+ * {@link useVistaTabs}, and the body is whatever the Vista surface registry
9
+ * resolves the active {@link VistaTab} to.
10
+ *
11
+ * The panel is presentation only: it never fetches, never authorises, and never
12
+ * decides what a kind means. Resolution follows the three-layer guarantee —
13
+ * a registered renderer wins, else the generic schema-driven renderer the
14
+ * catalogue sync installed, else {@link SurfaceFallbackCard} with a typed
15
+ * reason. It never throws and never blanks.
16
+ */
17
+ import { type ReactElement, type ReactNode } from 'react';
18
+
19
+ import { surfaceKindIcon } from './surface-icons';
20
+ import { vistaSurfaceRegistry } from './surface-registry';
21
+ import { SurfaceFallbackCard } from './SurfaceFallbackCard';
22
+ import { cn } from '../ui/cn';
23
+ import { OverflowTabs, type OverflowTab } from '../ui/primitives/overflow-tabs';
24
+
25
+ import type { VistaTab } from './vista-model';
26
+
27
+ export interface VistaPanelProps {
28
+ /** Every open tab, in display order (pinned first). */
29
+ readonly tabs: readonly VistaTab[];
30
+ /** The focused tab, or `null` when the panel holds no tabs. */
31
+ readonly activeTabId: string | null;
32
+ readonly onActivate: (tabId: string) => void;
33
+ /**
34
+ * Close handler. Omit for a panel whose tabs are all host-owned; pinned tabs
35
+ * never render a close affordance regardless.
36
+ */
37
+ readonly onClose?: (tabId: string) => void;
38
+ /** Optional action rendered at the right edge of the tab bar. */
39
+ readonly tabBarAction?: ReactNode;
40
+ /**
41
+ * Tab ids to mark with the strip's attention dot — "this tab changed while
42
+ * you were looking elsewhere". The panel does not decide what "changed"
43
+ * means; the owner does.
44
+ */
45
+ readonly indicatorTabIds?: readonly string[];
46
+ /** Rendered when there are no tabs at all. */
47
+ readonly emptyState?: ReactNode;
48
+ readonly className?: string;
49
+ }
50
+
51
+ export function VistaPanel({
52
+ tabs,
53
+ activeTabId,
54
+ onActivate,
55
+ onClose,
56
+ tabBarAction,
57
+ indicatorTabIds,
58
+ emptyState,
59
+ className,
60
+ }: VistaPanelProps): ReactElement {
61
+ const active = tabs.find((t) => t.tabId === activeTabId) ?? null;
62
+ return (
63
+ <div
64
+ className={cn(
65
+ 'flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden',
66
+ className,
67
+ )}
68
+ >
69
+ <VistaTabBar
70
+ tabs={tabs}
71
+ activeTabId={activeTabId}
72
+ onActivate={onActivate}
73
+ {...(onClose ? { onClose } : {})}
74
+ {...(tabBarAction === undefined ? {} : { tabBarAction })}
75
+ {...(indicatorTabIds === undefined ? {} : { indicatorTabIds })}
76
+ />
77
+ <div className="min-h-0 flex-1 overflow-hidden">
78
+ {active === null ? (
79
+ <>{emptyState ?? null}</>
80
+ ) : (
81
+ <VistaSurfaceBody tab={active} />
82
+ )}
83
+ </div>
84
+ </div>
85
+ );
86
+ }
87
+
88
+ export type VistaTabBarProps = Omit<
89
+ VistaPanelProps,
90
+ 'emptyState' | 'className'
91
+ > & { readonly className?: string };
92
+
93
+ /**
94
+ * The tab STRIP alone. Exported so a surface whose chrome interleaves other
95
+ * controls between the tabs and the body (the Design-System-Builder's browser
96
+ * chrome puts a URL + action row there) composes the SAME strip instead of
97
+ * hand-rolling a second one. `VistaPanel` is just this plus
98
+ * {@link VistaSurfaceBody}.
99
+ */
100
+ export function VistaTabBar({
101
+ tabs,
102
+ activeTabId,
103
+ onActivate,
104
+ onClose,
105
+ tabBarAction,
106
+ indicatorTabIds,
107
+ className,
108
+ }: VistaTabBarProps): ReactElement {
109
+ const overflowTabs: OverflowTab[] = tabs.map((tab) => {
110
+ const entry: {
111
+ value: string;
112
+ label: string;
113
+ pinned?: boolean;
114
+ indicator?: boolean;
115
+ icon?: OverflowTab['icon'];
116
+ } = { value: tab.tabId, label: tab.title };
117
+ if (tab.pinned === true) entry.pinned = true;
118
+ if (indicatorTabIds?.includes(tab.tabId) === true) entry.indicator = true;
119
+ const icon = surfaceKindIcon(tab.kind);
120
+ if (icon !== undefined) entry.icon = icon;
121
+ return entry;
122
+ });
123
+ return (
124
+ <div className={cn('flex shrink-0 items-end gap-2 px-2', className)}>
125
+ <div className="min-w-0 flex-1">
126
+ <OverflowTabs
127
+ tabs={overflowTabs}
128
+ value={activeTabId ?? ''}
129
+ onChange={onActivate}
130
+ {...(onClose ? { onClose } : {})}
131
+ />
132
+ </div>
133
+ {tabBarAction}
134
+ </div>
135
+ );
136
+ }
137
+
138
+ /**
139
+ * Resolve ONE tab through the registry and draw it. Split out so the resolution
140
+ * decision (and therefore the fallback reason) is inspectable in isolation.
141
+ */
142
+ export function VistaSurfaceBody({
143
+ tab,
144
+ }: Readonly<{ tab: VistaTab }>): ReactElement {
145
+ const resolution = vistaSurfaceRegistry.resolve(tab);
146
+ if (resolution.matched) return resolution.rendered;
147
+ return (
148
+ <SurfaceFallbackCard
149
+ kind={resolution.kind}
150
+ reason={resolution.reason}
151
+ payload={tab.payload}
152
+ title={tab.title}
153
+ />
154
+ );
155
+ }