@softov/scena 0.1.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 (496) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -0
  3. package/dist/controls/command.d.ts +18 -0
  4. package/dist/controls/command.js +150 -0
  5. package/dist/controls/events.d.ts +3 -0
  6. package/dist/controls/events.js +43 -0
  7. package/dist/controls/index.d.ts +10 -0
  8. package/dist/controls/index.js +10 -0
  9. package/dist/controls/keybinding.d.ts +9 -0
  10. package/dist/controls/keybinding.js +94 -0
  11. package/dist/controls/layout.d.ts +16 -0
  12. package/dist/controls/layout.js +201 -0
  13. package/dist/controls/manifest.d.ts +21 -0
  14. package/dist/controls/manifest.js +219 -0
  15. package/dist/controls/session.d.ts +16 -0
  16. package/dist/controls/session.js +95 -0
  17. package/dist/controls/shell.d.ts +8 -0
  18. package/dist/controls/shell.js +48 -0
  19. package/dist/controls/storage/layout-local.d.ts +6 -0
  20. package/dist/controls/storage/layout-local.js +47 -0
  21. package/dist/controls/storage/session-local.d.ts +5 -0
  22. package/dist/controls/storage/session-local.js +38 -0
  23. package/dist/controls/when.d.ts +7 -0
  24. package/dist/controls/when.js +226 -0
  25. package/dist/converters/a2ui-v0.10.d.ts +23 -0
  26. package/dist/converters/a2ui-v0.10.js +136 -0
  27. package/dist/converters/index.d.ts +1 -0
  28. package/dist/converters/index.js +1 -0
  29. package/dist/core/backends/modus-backend.d.ts +13 -0
  30. package/dist/core/backends/modus-backend.js +115 -0
  31. package/dist/core/backends/storage-backend.d.ts +7 -0
  32. package/dist/core/backends/storage-backend.js +73 -0
  33. package/dist/core/backends/yjs-backend.d.ts +3 -0
  34. package/dist/core/backends/yjs-backend.js +44 -0
  35. package/dist/core/binding-resolver.d.ts +7 -0
  36. package/dist/core/binding-resolver.js +106 -0
  37. package/dist/core/component-graph.d.ts +6 -0
  38. package/dist/core/component-graph.js +77 -0
  39. package/dist/core/component-registry.d.ts +7 -0
  40. package/dist/core/component-registry.js +87 -0
  41. package/dist/core/computed-dsl.d.ts +2 -0
  42. package/dist/core/computed-dsl.js +267 -0
  43. package/dist/core/converter-registry.d.ts +2 -0
  44. package/dist/core/converter-registry.js +37 -0
  45. package/dist/core/disposable.d.ts +3 -0
  46. package/dist/core/disposable.js +19 -0
  47. package/dist/core/dynamic-resolver.d.ts +12 -0
  48. package/dist/core/dynamic-resolver.js +134 -0
  49. package/dist/core/index.d.ts +44 -0
  50. package/dist/core/index.js +48 -0
  51. package/dist/core/label.d.ts +2 -0
  52. package/dist/core/label.js +14 -0
  53. package/dist/core/mount-menu.d.ts +2 -0
  54. package/dist/core/mount-menu.js +23 -0
  55. package/dist/core/mount-surface.d.ts +15 -0
  56. package/dist/core/mount-surface.js +214 -0
  57. package/dist/core/path-resolver.d.ts +14 -0
  58. package/dist/core/path-resolver.js +169 -0
  59. package/dist/core/permissions.d.ts +2 -0
  60. package/dist/core/permissions.js +50 -0
  61. package/dist/core/reactive-store.d.ts +17 -0
  62. package/dist/core/reactive-store.js +496 -0
  63. package/dist/core/scena.d.ts +2 -0
  64. package/dist/core/scena.js +115 -0
  65. package/dist/core/surface-presentation.d.ts +6 -0
  66. package/dist/core/surface-presentation.js +12 -0
  67. package/dist/i18n/i18n-backend.d.ts +2 -0
  68. package/dist/i18n/i18n-backend.js +35 -0
  69. package/dist/i18n/registry.d.ts +32 -0
  70. package/dist/i18n/registry.js +200 -0
  71. package/dist/porta/Limen.css +50 -0
  72. package/dist/porta/Limen.d.ts +16 -0
  73. package/dist/porta/Limen.js +14 -0
  74. package/dist/porta/PortaContext.d.ts +10 -0
  75. package/dist/porta/PortaContext.js +20 -0
  76. package/dist/porta/PortaLock.css +14 -0
  77. package/dist/porta/PortaLock.d.ts +10 -0
  78. package/dist/porta/PortaLock.js +13 -0
  79. package/dist/porta/SigillumGate.d.ts +8 -0
  80. package/dist/porta/SigillumGate.js +7 -0
  81. package/dist/porta/commands.d.ts +3 -0
  82. package/dist/porta/commands.js +125 -0
  83. package/dist/porta/index.d.ts +18 -0
  84. package/dist/porta/index.js +22 -0
  85. package/dist/porta/login-form.block.d.ts +2 -0
  86. package/dist/porta/login-form.block.js +7 -0
  87. package/dist/porta/match.d.ts +2 -0
  88. package/dist/porta/match.js +20 -0
  89. package/dist/porta/provider.d.ts +59 -0
  90. package/dist/porta/provider.js +1 -0
  91. package/dist/porta/providers/examples/google-oauth.d.ts +6 -0
  92. package/dist/porta/providers/examples/google-oauth.js +21 -0
  93. package/dist/porta/providers/examples/index.d.ts +6 -0
  94. package/dist/porta/providers/examples/index.js +3 -0
  95. package/dist/porta/providers/examples/magic-link.d.ts +8 -0
  96. package/dist/porta/providers/examples/magic-link.js +31 -0
  97. package/dist/porta/providers/examples/sms-otp.d.ts +9 -0
  98. package/dist/porta/providers/examples/sms-otp.js +31 -0
  99. package/dist/porta/providers/password.d.ts +12 -0
  100. package/dist/porta/providers/password.js +46 -0
  101. package/dist/porta/register-blocks.d.ts +3 -0
  102. package/dist/porta/register-blocks.js +31 -0
  103. package/dist/porta/register.d.ts +15 -0
  104. package/dist/porta/register.js +31 -0
  105. package/dist/porta/sigillum.d.ts +19 -0
  106. package/dist/porta/sigillum.js +41 -0
  107. package/dist/react/DefaultShell.d.ts +1 -0
  108. package/dist/react/DefaultShell.js +37 -0
  109. package/dist/react/Scena.d.ts +9 -0
  110. package/dist/react/Scena.js +20 -0
  111. package/dist/react/ScenaProvider.d.ts +8 -0
  112. package/dist/react/ScenaProvider.js +13 -0
  113. package/dist/react/ShellSplitter.d.ts +13 -0
  114. package/dist/react/ShellSplitter.js +88 -0
  115. package/dist/react/SurfaceArea.d.ts +13 -0
  116. package/dist/react/SurfaceArea.js +75 -0
  117. package/dist/react/Translate.d.ts +8 -0
  118. package/dist/react/Translate.js +10 -0
  119. package/dist/react/ViewMount.d.ts +12 -0
  120. package/dist/react/ViewMount.js +268 -0
  121. package/dist/react/core.d.ts +6 -0
  122. package/dist/react/core.js +10 -0
  123. package/dist/react/hooks/useCommand.d.ts +1 -0
  124. package/dist/react/hooks/useCommand.js +6 -0
  125. package/dist/react/hooks/useI18n.d.ts +9 -0
  126. package/dist/react/hooks/useI18n.js +16 -0
  127. package/dist/react/hooks/useLabel.d.ts +2 -0
  128. package/dist/react/hooks/useLabel.js +19 -0
  129. package/dist/react/hooks/useLayout.d.ts +2 -0
  130. package/dist/react/hooks/useLayout.js +10 -0
  131. package/dist/react/hooks/useMounts.d.ts +2 -0
  132. package/dist/react/hooks/useMounts.js +17 -0
  133. package/dist/react/hooks/useStore.d.ts +3 -0
  134. package/dist/react/hooks/useStore.js +40 -0
  135. package/dist/react/hooks/useStoreLabel.d.ts +3 -0
  136. package/dist/react/hooks/useStoreLabel.js +25 -0
  137. package/dist/react/hooks/useSurfacePresentation.d.ts +4 -0
  138. package/dist/react/hooks/useSurfacePresentation.js +16 -0
  139. package/dist/react/index.d.ts +20 -0
  140. package/dist/react/index.js +20 -0
  141. package/dist/react/mount-context.d.ts +8 -0
  142. package/dist/react/mount-context.js +20 -0
  143. package/dist/react/useSurfaceResize.d.ts +39 -0
  144. package/dist/react/useSurfaceResize.js +135 -0
  145. package/dist/runtime/args-schema.d.ts +11 -0
  146. package/dist/runtime/args-schema.js +45 -0
  147. package/dist/runtime/builtins.d.ts +3 -0
  148. package/dist/runtime/builtins.js +193 -0
  149. package/dist/runtime/client-handlers.d.ts +3 -0
  150. package/dist/runtime/client-handlers.js +19 -0
  151. package/dist/runtime/in-memory-socket.d.ts +7 -0
  152. package/dist/runtime/in-memory-socket.js +53 -0
  153. package/dist/runtime/index.d.ts +10 -0
  154. package/dist/runtime/index.js +7 -0
  155. package/dist/runtime/layout-commands.d.ts +5 -0
  156. package/dist/runtime/layout-commands.js +548 -0
  157. package/dist/runtime/opener-commands.d.ts +17 -0
  158. package/dist/runtime/opener-commands.js +96 -0
  159. package/dist/runtime/surface-bridge.d.ts +15 -0
  160. package/dist/runtime/surface-bridge.js +116 -0
  161. package/dist/styles/bar.css +155 -0
  162. package/dist/styles/base.css +285 -0
  163. package/dist/styles/geometry.css +32 -0
  164. package/dist/styles/index.d.ts +29 -0
  165. package/dist/styles/index.js +109 -0
  166. package/dist/styles/scrollbar.css +45 -0
  167. package/dist/styles/surface.css +179 -0
  168. package/dist/styles/theme.css +3 -0
  169. package/dist/styles/themes/dark.css +30 -0
  170. package/dist/styles/themes/light.css +1 -0
  171. package/dist/styles/themes/tokens.css +222 -0
  172. package/dist/types/binding-resolver.d.ts +30 -0
  173. package/dist/types/binding-resolver.js +1 -0
  174. package/dist/types/colors.d.ts +7 -0
  175. package/dist/types/colors.js +59 -0
  176. package/dist/types/command.d.ts +62 -0
  177. package/dist/types/command.js +1 -0
  178. package/dist/types/component-graph.d.ts +72 -0
  179. package/dist/types/component-graph.js +40 -0
  180. package/dist/types/component-registry.d.ts +70 -0
  181. package/dist/types/component-registry.js +1 -0
  182. package/dist/types/converter-registry.d.ts +17 -0
  183. package/dist/types/converter-registry.js +1 -0
  184. package/dist/types/disposable.d.ts +3 -0
  185. package/dist/types/disposable.js +1 -0
  186. package/dist/types/events.d.ts +75 -0
  187. package/dist/types/events.js +1 -0
  188. package/dist/types/host.d.ts +50 -0
  189. package/dist/types/host.js +1 -0
  190. package/dist/types/index.d.ts +23 -0
  191. package/dist/types/index.js +23 -0
  192. package/dist/types/keybinding.d.ts +36 -0
  193. package/dist/types/keybinding.js +1 -0
  194. package/dist/types/label.d.ts +9 -0
  195. package/dist/types/label.js +1 -0
  196. package/dist/types/layout.d.ts +117 -0
  197. package/dist/types/layout.js +1 -0
  198. package/dist/types/manifest.d.ts +152 -0
  199. package/dist/types/manifest.js +1 -0
  200. package/dist/types/mount-menu.d.ts +8 -0
  201. package/dist/types/mount-menu.js +1 -0
  202. package/dist/types/mount-surface.d.ts +87 -0
  203. package/dist/types/mount-surface.js +1 -0
  204. package/dist/types/permissions.d.ts +18 -0
  205. package/dist/types/permissions.js +1 -0
  206. package/dist/types/query.d.ts +34 -0
  207. package/dist/types/query.js +7 -0
  208. package/dist/types/reactive-store.d.ts +39 -0
  209. package/dist/types/reactive-store.js +1 -0
  210. package/dist/types/scena.d.ts +53 -0
  211. package/dist/types/scena.js +1 -0
  212. package/dist/types/scope-backend.d.ts +16 -0
  213. package/dist/types/scope-backend.js +1 -0
  214. package/dist/types/session.d.ts +39 -0
  215. package/dist/types/session.js +1 -0
  216. package/dist/types/shell.d.ts +21 -0
  217. package/dist/types/shell.js +1 -0
  218. package/dist/types/when.d.ts +10 -0
  219. package/dist/types/when.js +1 -0
  220. package/dist/ui/_utils.d.ts +8 -0
  221. package/dist/ui/_utils.js +53 -0
  222. package/dist/ui/campus/CampusMappa.d.ts +18 -0
  223. package/dist/ui/campus/CampusMappa.js +106 -0
  224. package/dist/ui/campus/CampusNodus.d.ts +25 -0
  225. package/dist/ui/campus/CampusNodus.js +211 -0
  226. package/dist/ui/campus/CampusStratum.d.ts +13 -0
  227. package/dist/ui/campus/CampusStratum.js +20 -0
  228. package/dist/ui/campus/CampusVelum.d.ts +7 -0
  229. package/dist/ui/campus/CampusVelum.js +12 -0
  230. package/dist/ui/campus/CampusView.d.ts +27 -0
  231. package/dist/ui/campus/CampusView.js +420 -0
  232. package/dist/ui/campus/context.d.ts +13 -0
  233. package/dist/ui/campus/context.js +12 -0
  234. package/dist/ui/campus/index.d.ts +14 -0
  235. package/dist/ui/campus/index.js +11 -0
  236. package/dist/ui/campus/stratum-context.d.ts +2 -0
  237. package/dist/ui/campus/stratum-context.js +10 -0
  238. package/dist/ui/campus/types.d.ts +47 -0
  239. package/dist/ui/campus/types.js +4 -0
  240. package/dist/ui/chart/BarChart.css +53 -0
  241. package/dist/ui/chart/BarChart.d.ts +24 -0
  242. package/dist/ui/chart/BarChart.js +32 -0
  243. package/dist/ui/chart/Donut.css +15 -0
  244. package/dist/ui/chart/Donut.d.ts +15 -0
  245. package/dist/ui/chart/Donut.js +18 -0
  246. package/dist/ui/chart/LineChart.css +8 -0
  247. package/dist/ui/chart/LineChart.d.ts +24 -0
  248. package/dist/ui/chart/LineChart.js +29 -0
  249. package/dist/ui/chart/catalog.d.ts +2 -0
  250. package/dist/ui/chart/catalog.js +7 -0
  251. package/dist/ui/chart/index.d.ts +6 -0
  252. package/dist/ui/chart/index.js +4 -0
  253. package/dist/ui/control/Button.css +7 -0
  254. package/dist/ui/control/Button.d.ts +17 -0
  255. package/dist/ui/control/Button.js +17 -0
  256. package/dist/ui/control/CheckBox.css +16 -0
  257. package/dist/ui/control/CheckBox.d.ts +15 -0
  258. package/dist/ui/control/CheckBox.js +23 -0
  259. package/dist/ui/control/Checks.css +6 -0
  260. package/dist/ui/control/Checks.d.ts +9 -0
  261. package/dist/ui/control/Checks.js +10 -0
  262. package/dist/ui/control/ChoicePicker.css +16 -0
  263. package/dist/ui/control/ChoicePicker.d.ts +25 -0
  264. package/dist/ui/control/ChoicePicker.js +38 -0
  265. package/dist/ui/control/DateTimeInput.css +1 -0
  266. package/dist/ui/control/DateTimeInput.d.ts +22 -0
  267. package/dist/ui/control/DateTimeInput.js +41 -0
  268. package/dist/ui/control/LocaleToggle.css +38 -0
  269. package/dist/ui/control/LocaleToggle.d.ts +11 -0
  270. package/dist/ui/control/LocaleToggle.js +23 -0
  271. package/dist/ui/control/ReloadButton.d.ts +6 -0
  272. package/dist/ui/control/ReloadButton.js +9 -0
  273. package/dist/ui/control/Slider.css +2 -0
  274. package/dist/ui/control/Slider.d.ts +21 -0
  275. package/dist/ui/control/Slider.js +37 -0
  276. package/dist/ui/control/TextField.css +0 -0
  277. package/dist/ui/control/TextField.d.ts +25 -0
  278. package/dist/ui/control/TextField.js +36 -0
  279. package/dist/ui/control/_field-parts.css +102 -0
  280. package/dist/ui/control/_field-parts.d.ts +15 -0
  281. package/dist/ui/control/_field-parts.js +17 -0
  282. package/dist/ui/control/catalog.d.ts +2 -0
  283. package/dist/ui/control/catalog.js +10 -0
  284. package/dist/ui/control/index.d.ts +13 -0
  285. package/dist/ui/control/index.js +11 -0
  286. package/dist/ui/data/DataTable.d.ts +19 -0
  287. package/dist/ui/data/DataTable.js +20 -0
  288. package/dist/ui/data/Filter.d.ts +13 -0
  289. package/dist/ui/data/Filter.js +56 -0
  290. package/dist/ui/data/List.css +16 -0
  291. package/dist/ui/data/List.d.ts +15 -0
  292. package/dist/ui/data/List.js +18 -0
  293. package/dist/ui/data/Listable.css +245 -0
  294. package/dist/ui/data/Listable.d.ts +60 -0
  295. package/dist/ui/data/Listable.js +209 -0
  296. package/dist/ui/data/Pagination.d.ts +5 -0
  297. package/dist/ui/data/Pagination.js +43 -0
  298. package/dist/ui/data/Tree.css +118 -0
  299. package/dist/ui/data/Tree.d.ts +45 -0
  300. package/dist/ui/data/Tree.js +170 -0
  301. package/dist/ui/data/catalog.d.ts +2 -0
  302. package/dist/ui/data/catalog.js +7 -0
  303. package/dist/ui/data/index.d.ts +11 -0
  304. package/dist/ui/data/index.js +7 -0
  305. package/dist/ui/display/AddPlaceholder.d.ts +6 -0
  306. package/dist/ui/display/AddPlaceholder.js +24 -0
  307. package/dist/ui/display/Alert.css +42 -0
  308. package/dist/ui/display/Alert.d.ts +14 -0
  309. package/dist/ui/display/Alert.js +13 -0
  310. package/dist/ui/display/Avatar.css +19 -0
  311. package/dist/ui/display/Avatar.d.ts +16 -0
  312. package/dist/ui/display/Avatar.js +52 -0
  313. package/dist/ui/display/Badge.css +26 -0
  314. package/dist/ui/display/Badge.d.ts +16 -0
  315. package/dist/ui/display/Badge.js +9 -0
  316. package/dist/ui/display/Card.css +15 -0
  317. package/dist/ui/display/Card.d.ts +11 -0
  318. package/dist/ui/display/Card.js +8 -0
  319. package/dist/ui/display/DetailContainer.d.ts +6 -0
  320. package/dist/ui/display/DetailContainer.js +7 -0
  321. package/dist/ui/display/DetailHeader.css +53 -0
  322. package/dist/ui/display/DetailHeader.d.ts +22 -0
  323. package/dist/ui/display/DetailHeader.js +8 -0
  324. package/dist/ui/display/DetailList.css +26 -0
  325. package/dist/ui/display/DetailList.d.ts +13 -0
  326. package/dist/ui/display/DetailList.js +5 -0
  327. package/dist/ui/display/DetailNotFound.d.ts +17 -0
  328. package/dist/ui/display/DetailNotFound.js +39 -0
  329. package/dist/ui/display/Divider.css +6 -0
  330. package/dist/ui/display/Divider.d.ts +8 -0
  331. package/dist/ui/display/Divider.js +16 -0
  332. package/dist/ui/display/Divisor.css +30 -0
  333. package/dist/ui/display/Divisor.d.ts +11 -0
  334. package/dist/ui/display/Divisor.js +43 -0
  335. package/dist/ui/display/Icon.css +10 -0
  336. package/dist/ui/display/Icon.d.ts +14 -0
  337. package/dist/ui/display/Icon.js +144 -0
  338. package/dist/ui/display/Image.css +1 -0
  339. package/dist/ui/display/Image.d.ts +16 -0
  340. package/dist/ui/display/Image.js +19 -0
  341. package/dist/ui/display/Markdown.css +38 -0
  342. package/dist/ui/display/Markdown.d.ts +8 -0
  343. package/dist/ui/display/Markdown.js +140 -0
  344. package/dist/ui/display/Progress.css +39 -0
  345. package/dist/ui/display/Progress.d.ts +15 -0
  346. package/dist/ui/display/Progress.js +17 -0
  347. package/dist/ui/display/SectionTitle.d.ts +6 -0
  348. package/dist/ui/display/SectionTitle.js +6 -0
  349. package/dist/ui/display/Skeleton.css +20 -0
  350. package/dist/ui/display/Skeleton.d.ts +11 -0
  351. package/dist/ui/display/Skeleton.js +11 -0
  352. package/dist/ui/display/Spinner.css +20 -0
  353. package/dist/ui/display/Spinner.d.ts +12 -0
  354. package/dist/ui/display/Spinner.js +12 -0
  355. package/dist/ui/display/Svg.d.ts +13 -0
  356. package/dist/ui/display/Svg.js +17 -0
  357. package/dist/ui/display/Text.css +20 -0
  358. package/dist/ui/display/Text.d.ts +13 -0
  359. package/dist/ui/display/Text.js +15 -0
  360. package/dist/ui/display/catalog.d.ts +2 -0
  361. package/dist/ui/display/catalog.js +12 -0
  362. package/dist/ui/display/index.d.ts +22 -0
  363. package/dist/ui/display/index.js +14 -0
  364. package/dist/ui/embed/HtmlEmbed.d.ts +12 -0
  365. package/dist/ui/embed/HtmlEmbed.js +16 -0
  366. package/dist/ui/embed/index.d.ts +2 -0
  367. package/dist/ui/embed/index.js +1 -0
  368. package/dist/ui/forms/DangerZone.d.ts +8 -0
  369. package/dist/ui/forms/DangerZone.js +31 -0
  370. package/dist/ui/forms/Field.css +15 -0
  371. package/dist/ui/forms/Field.d.ts +28 -0
  372. package/dist/ui/forms/Field.js +25 -0
  373. package/dist/ui/forms/FieldGroup.css +15 -0
  374. package/dist/ui/forms/FieldGroup.d.ts +7 -0
  375. package/dist/ui/forms/FieldGroup.js +7 -0
  376. package/dist/ui/forms/Form.css +14 -0
  377. package/dist/ui/forms/Form.d.ts +18 -0
  378. package/dist/ui/forms/Form.js +17 -0
  379. package/dist/ui/forms/FormActions.css +11 -0
  380. package/dist/ui/forms/FormActions.d.ts +18 -0
  381. package/dist/ui/forms/FormActions.js +10 -0
  382. package/dist/ui/forms/FormSection.css +19 -0
  383. package/dist/ui/forms/FormSection.d.ts +7 -0
  384. package/dist/ui/forms/FormSection.js +7 -0
  385. package/dist/ui/forms/LoginForm.css +105 -0
  386. package/dist/ui/forms/LoginForm.d.ts +12 -0
  387. package/dist/ui/forms/LoginForm.js +137 -0
  388. package/dist/ui/forms/SchemaForm.css +81 -0
  389. package/dist/ui/forms/SchemaForm.d.ts +26 -0
  390. package/dist/ui/forms/SchemaForm.js +186 -0
  391. package/dist/ui/forms/SettingsContainer.d.ts +8 -0
  392. package/dist/ui/forms/SettingsContainer.js +8 -0
  393. package/dist/ui/forms/catalog.d.ts +2 -0
  394. package/dist/ui/forms/catalog.js +11 -0
  395. package/dist/ui/forms/index.d.ts +19 -0
  396. package/dist/ui/forms/index.js +12 -0
  397. package/dist/ui/forms/schema-walk.d.ts +50 -0
  398. package/dist/ui/forms/schema-walk.js +116 -0
  399. package/dist/ui/index.d.ts +58 -0
  400. package/dist/ui/index.js +63 -0
  401. package/dist/ui/layout/BarLayout.d.ts +2 -0
  402. package/dist/ui/layout/BarLayout.js +18 -0
  403. package/dist/ui/layout/Column.css +6 -0
  404. package/dist/ui/layout/Column.d.ts +12 -0
  405. package/dist/ui/layout/Column.js +13 -0
  406. package/dist/ui/layout/FloatingLayout.d.ts +2 -0
  407. package/dist/ui/layout/FloatingLayout.js +12 -0
  408. package/dist/ui/layout/Grid.css +5 -0
  409. package/dist/ui/layout/Grid.d.ts +13 -0
  410. package/dist/ui/layout/Grid.js +19 -0
  411. package/dist/ui/layout/InlineLayout.d.ts +2 -0
  412. package/dist/ui/layout/InlineLayout.js +13 -0
  413. package/dist/ui/layout/MountTitle.d.ts +12 -0
  414. package/dist/ui/layout/MountTitle.js +42 -0
  415. package/dist/ui/layout/RailLayout.d.ts +2 -0
  416. package/dist/ui/layout/RailLayout.js +38 -0
  417. package/dist/ui/layout/Row.css +16 -0
  418. package/dist/ui/layout/Row.d.ts +13 -0
  419. package/dist/ui/layout/Row.js +21 -0
  420. package/dist/ui/layout/SectionHeader.d.ts +10 -0
  421. package/dist/ui/layout/SectionHeader.js +65 -0
  422. package/dist/ui/layout/SingleLayout.d.ts +2 -0
  423. package/dist/ui/layout/SingleLayout.js +25 -0
  424. package/dist/ui/layout/SpatialCard.d.ts +9 -0
  425. package/dist/ui/layout/SpatialCard.js +30 -0
  426. package/dist/ui/layout/SpatialLayout.d.ts +2 -0
  427. package/dist/ui/layout/SpatialLayout.js +446 -0
  428. package/dist/ui/layout/SplitLayout.d.ts +2 -0
  429. package/dist/ui/layout/SplitLayout.js +159 -0
  430. package/dist/ui/layout/Splitter.d.ts +12 -0
  431. package/dist/ui/layout/Splitter.js +64 -0
  432. package/dist/ui/layout/StackHeader.d.ts +9 -0
  433. package/dist/ui/layout/StackHeader.js +87 -0
  434. package/dist/ui/layout/StackLayout.d.ts +2 -0
  435. package/dist/ui/layout/StackLayout.js +137 -0
  436. package/dist/ui/layout/TabLayout.d.ts +2 -0
  437. package/dist/ui/layout/TabLayout.js +145 -0
  438. package/dist/ui/layout/TabPanelLayout.d.ts +20 -0
  439. package/dist/ui/layout/TabPanelLayout.js +615 -0
  440. package/dist/ui/layout/catalog.d.ts +2 -0
  441. package/dist/ui/layout/catalog.js +10 -0
  442. package/dist/ui/layout/index.d.ts +17 -0
  443. package/dist/ui/layout/index.js +17 -0
  444. package/dist/ui/layout/register.d.ts +3 -0
  445. package/dist/ui/layout/register.js +25 -0
  446. package/dist/ui/media/Audio.css +1 -0
  447. package/dist/ui/media/Audio.d.ts +12 -0
  448. package/dist/ui/media/Audio.js +8 -0
  449. package/dist/ui/media/Video.css +1 -0
  450. package/dist/ui/media/Video.d.ts +16 -0
  451. package/dist/ui/media/Video.js +9 -0
  452. package/dist/ui/media/catalog.d.ts +2 -0
  453. package/dist/ui/media/catalog.js +5 -0
  454. package/dist/ui/media/index.d.ts +2 -0
  455. package/dist/ui/media/index.js +3 -0
  456. package/dist/ui/menu/ActionList.css +262 -0
  457. package/dist/ui/menu/ActionList.d.ts +19 -0
  458. package/dist/ui/menu/ActionList.js +369 -0
  459. package/dist/ui/menu/ContainerMenu.d.ts +13 -0
  460. package/dist/ui/menu/ContainerMenu.js +57 -0
  461. package/dist/ui/menu/ContextMenu.d.ts +27 -0
  462. package/dist/ui/menu/ContextMenu.js +93 -0
  463. package/dist/ui/menu/index.d.ts +10 -0
  464. package/dist/ui/menu/index.js +7 -0
  465. package/dist/ui/menu/token.d.ts +22 -0
  466. package/dist/ui/menu/token.js +145 -0
  467. package/dist/ui/menu/useChatPicker.d.ts +24 -0
  468. package/dist/ui/menu/useChatPicker.js +210 -0
  469. package/dist/ui/navigation/Breadcrumb.css +30 -0
  470. package/dist/ui/navigation/Breadcrumb.d.ts +14 -0
  471. package/dist/ui/navigation/Breadcrumb.js +12 -0
  472. package/dist/ui/navigation/Link.css +13 -0
  473. package/dist/ui/navigation/Link.d.ts +18 -0
  474. package/dist/ui/navigation/Link.js +43 -0
  475. package/dist/ui/navigation/Tabs.css +39 -0
  476. package/dist/ui/navigation/Tabs.d.ts +18 -0
  477. package/dist/ui/navigation/Tabs.js +55 -0
  478. package/dist/ui/navigation/Toolbar.css +25 -0
  479. package/dist/ui/navigation/Toolbar.d.ts +12 -0
  480. package/dist/ui/navigation/Toolbar.js +21 -0
  481. package/dist/ui/navigation/catalog.d.ts +2 -0
  482. package/dist/ui/navigation/catalog.js +5 -0
  483. package/dist/ui/navigation/index.d.ts +8 -0
  484. package/dist/ui/navigation/index.js +5 -0
  485. package/dist/ui/overlay/Modal.css +35 -0
  486. package/dist/ui/overlay/Modal.d.ts +12 -0
  487. package/dist/ui/overlay/Modal.js +57 -0
  488. package/dist/ui/overlay/Popup.d.ts +12 -0
  489. package/dist/ui/overlay/Popup.js +74 -0
  490. package/dist/ui/overlay/catalog.d.ts +2 -0
  491. package/dist/ui/overlay/catalog.js +4 -0
  492. package/dist/ui/overlay/index.d.ts +1 -0
  493. package/dist/ui/overlay/index.js +2 -0
  494. package/dist/ui/register.d.ts +6 -0
  495. package/dist/ui/register.js +26 -0
  496. package/package.json +115 -0
@@ -0,0 +1,106 @@
1
+ import { isAction, isDataBinding, isFunctionCall, } from '../types/component-graph.js';
2
+ import { combineDisposables, disposableFrom } from './disposable.js';
3
+ import { parsePath } from './path-resolver.js';
4
+ export function createBindingResolver(deps) {
5
+ const { store } = deps;
6
+ function compilePath(path) {
7
+ const parsed = parsePath(path);
8
+ if (!parsed.absolute) {
9
+ // Relative paths can't be compiled without a data context; consumers that
10
+ // need them go through dynamic-resolver.readPath instead. Return a path
11
+ // form with the literal segments so subscribers at least see the shape.
12
+ return {
13
+ kind: 'path',
14
+ scope: '',
15
+ segments: parsed.segments,
16
+ wildcard: parsed.segments.includes('*'),
17
+ raw: path,
18
+ };
19
+ }
20
+ const scope = (parsed.segments[0] ?? '');
21
+ return {
22
+ kind: 'path',
23
+ scope,
24
+ segments: parsed.segments,
25
+ wildcard: parsed.segments.includes('*'),
26
+ raw: path,
27
+ };
28
+ }
29
+ function compileFunctionCall(fc) {
30
+ const argBindings = {};
31
+ for (const [k, v] of Object.entries(fc.args ?? {})) {
32
+ argBindings[k] = compile(v);
33
+ }
34
+ return {
35
+ kind: 'functionCall',
36
+ call: fc.call,
37
+ argBindings,
38
+ callableFrom: fc.callableFrom,
39
+ returnType: fc.returnType,
40
+ };
41
+ }
42
+ function compileAction(action) {
43
+ if ('functionCall' in action) {
44
+ return compileFunctionCall(action.functionCall);
45
+ }
46
+ const ev = action.event;
47
+ const contextBindings = ev.context
48
+ ? Object.fromEntries(Object.entries(ev.context).map(([k, v]) => [k, compile(v)]))
49
+ : undefined;
50
+ return {
51
+ kind: 'event',
52
+ name: ev.name,
53
+ contextBindings,
54
+ wantResponse: ev.wantResponse,
55
+ responsePath: ev.responsePath,
56
+ };
57
+ }
58
+ function compile(prop) {
59
+ if (prop === null || typeof prop !== 'object') {
60
+ return { kind: 'literal', value: prop };
61
+ }
62
+ if (isDataBinding(prop)) {
63
+ return compilePath(prop.path);
64
+ }
65
+ if (isFunctionCall(prop)) {
66
+ return compileFunctionCall(prop);
67
+ }
68
+ if (isAction(prop)) {
69
+ return compileAction(prop);
70
+ }
71
+ return { kind: 'literal', value: prop };
72
+ }
73
+ function resolve(binding) {
74
+ switch (binding.kind) {
75
+ case 'literal':
76
+ return binding.value;
77
+ case 'path':
78
+ if (binding.wildcard)
79
+ return {};
80
+ return store.get(binding.raw);
81
+ case 'functionCall':
82
+ case 'event':
83
+ // Handlers; resolved by dynamic-resolver at click time.
84
+ return binding;
85
+ }
86
+ }
87
+ function watch(binding, fn) {
88
+ switch (binding.kind) {
89
+ case 'literal':
90
+ return disposableFrom(() => { });
91
+ case 'path':
92
+ return store.subscribe(binding.raw, fn);
93
+ case 'functionCall': {
94
+ const subs = Object.values(binding.argBindings).map((b) => watch(b, () => fn(binding)));
95
+ return combineDisposables(...subs);
96
+ }
97
+ case 'event': {
98
+ if (!binding.contextBindings)
99
+ return disposableFrom(() => { });
100
+ const subs = Object.values(binding.contextBindings).map((b) => watch(b, () => fn(binding)));
101
+ return combineDisposables(...subs);
102
+ }
103
+ }
104
+ }
105
+ return { compile, watch, resolve };
106
+ }
@@ -0,0 +1,6 @@
1
+ import type { ComponentNode } from '../types/component-graph.js';
2
+ export declare function walk(node: ComponentNode, visit: (node: ComponentNode, parent: ComponentNode | null) => void): void;
3
+ export declare function clone(node: ComponentNode): ComponentNode;
4
+ export declare function addIds(node: ComponentNode): ComponentNode;
5
+ export declare function findById(node: ComponentNode, id: string): ComponentNode | null;
6
+ export declare function stripMeta(node: ComponentNode): ComponentNode;
@@ -0,0 +1,77 @@
1
+ import { isComponentNode } from '../types/component-graph.js';
2
+ // Recursive tree walk. Visits the root, then every nested ComponentNode found
3
+ // anywhere in its prop values (single child, child array, or deeper nesting).
4
+ export function walk(node, visit) {
5
+ visit(node, null);
6
+ walkChildren(node);
7
+ function walkChildren(current) {
8
+ for (const [k, v] of Object.entries(current)) {
9
+ if (k === 'id' || k === 'component' || k === '$meta')
10
+ continue;
11
+ walkValue(v, current);
12
+ }
13
+ }
14
+ function walkValue(v, parent) {
15
+ if (v === null || typeof v !== 'object')
16
+ return;
17
+ if (isComponentNode(v)) {
18
+ visit(v, parent);
19
+ walkChildren(v);
20
+ return;
21
+ }
22
+ if (Array.isArray(v)) {
23
+ for (const item of v)
24
+ walkValue(item, parent);
25
+ return;
26
+ }
27
+ // Plain object — recurse into its values (children inside { template } etc).
28
+ for (const inner of Object.values(v)) {
29
+ walkValue(inner, parent);
30
+ }
31
+ }
32
+ }
33
+ export function clone(node) {
34
+ return JSON.parse(JSON.stringify(node));
35
+ }
36
+ let idCounter = 0;
37
+ function nextId() {
38
+ idCounter += 1;
39
+ return `n_${Date.now().toString(36)}_${idCounter.toString(36)}`;
40
+ }
41
+ export function addIds(node) {
42
+ const out = clone(node);
43
+ walk(out, (n) => {
44
+ if (!n.id)
45
+ n.id = nextId();
46
+ });
47
+ return out;
48
+ }
49
+ export function findById(node, id) {
50
+ let found = null;
51
+ walk(node, (n) => {
52
+ if (found)
53
+ return;
54
+ if (n.id === id)
55
+ found = n;
56
+ });
57
+ return found;
58
+ }
59
+ // Deep-clones the node with every `$meta` key removed. Use this before
60
+ // serializing a node back to a sender: `$meta` annotates origin/editor data
61
+ // that the sender never sent and should never receive.
62
+ export function stripMeta(node) {
63
+ return stripValue(node);
64
+ }
65
+ function stripValue(v) {
66
+ if (v === null || typeof v !== 'object')
67
+ return v;
68
+ if (Array.isArray(v))
69
+ return v.map(stripValue);
70
+ const out = {};
71
+ for (const [k, inner] of Object.entries(v)) {
72
+ if (k === '$meta')
73
+ continue;
74
+ out[k] = stripValue(inner);
75
+ }
76
+ return out;
77
+ }
@@ -0,0 +1,7 @@
1
+ import type { EventBus } from '../types/events.js';
2
+ import type { ComponentRegistry } from '../types/component-registry.js';
3
+ interface Deps {
4
+ events: EventBus;
5
+ }
6
+ export declare function createComponentRegistry(deps: Deps): ComponentRegistry;
7
+ export {};
@@ -0,0 +1,87 @@
1
+ import { disposableFrom } from './disposable.js';
2
+ export function createComponentRegistry(deps) {
3
+ const { events } = deps;
4
+ const defs = new Map();
5
+ const pendingResolves = new Map();
6
+ function announce() {
7
+ events.emit('scena:registry:changed', { registry: 'components' });
8
+ }
9
+ return {
10
+ register(def) {
11
+ defs.set(def.component, def);
12
+ const waiters = pendingResolves.get(def.component);
13
+ if (waiters) {
14
+ pendingResolves.delete(def.component);
15
+ const resolved = {
16
+ component: def.component,
17
+ renderer: def.renderer,
18
+ definition: def,
19
+ };
20
+ for (const w of waiters)
21
+ w(resolved);
22
+ }
23
+ announce();
24
+ return disposableFrom(() => {
25
+ if (defs.get(def.component) === def) {
26
+ defs.delete(def.component);
27
+ announce();
28
+ }
29
+ });
30
+ },
31
+ unregister(component) {
32
+ if (defs.delete(component))
33
+ announce();
34
+ },
35
+ get(component) {
36
+ return defs.get(component);
37
+ },
38
+ list() {
39
+ return [...defs.values()];
40
+ },
41
+ findOpeners(resourceKind) {
42
+ const out = [];
43
+ for (const def of defs.values()) {
44
+ const opens = def.opens;
45
+ if (!opens)
46
+ continue;
47
+ const kinds = opens.resourceKinds;
48
+ if (kinds && !kinds.includes(resourceKind))
49
+ continue;
50
+ out.push(def);
51
+ }
52
+ out.sort((a, b) => (b.opens?.priority ?? 0) - (a.opens?.priority ?? 0));
53
+ return out;
54
+ },
55
+ pending() {
56
+ return [...pendingResolves.keys()];
57
+ },
58
+ resolve(component, options) {
59
+ const def = defs.get(component);
60
+ if (def) {
61
+ return Promise.resolve({ component, renderer: def.renderer, definition: def });
62
+ }
63
+ return new Promise((resolve, reject) => {
64
+ let waiters = pendingResolves.get(component);
65
+ if (!waiters) {
66
+ waiters = [];
67
+ pendingResolves.set(component, waiters);
68
+ }
69
+ waiters.push(resolve);
70
+ const timeoutMs = options?.timeoutMs;
71
+ if (typeof timeoutMs === 'number') {
72
+ setTimeout(() => {
73
+ const list = pendingResolves.get(component);
74
+ if (!list)
75
+ return;
76
+ const idx = list.indexOf(resolve);
77
+ if (idx >= 0)
78
+ list.splice(idx, 1);
79
+ if (list.length === 0)
80
+ pendingResolves.delete(component);
81
+ reject(new Error(`Component "${component}" not registered within ${timeoutMs}ms`));
82
+ }, timeoutMs);
83
+ }
84
+ });
85
+ },
86
+ };
87
+ }
@@ -0,0 +1,2 @@
1
+ export type SelectFn = (inputs: Record<string, unknown>) => unknown;
2
+ export declare function compileSelect(select: string): SelectFn;
@@ -0,0 +1,267 @@
1
+ // Compiles a computed `select` STRING into an evaluator over the computed's
2
+ // `from` inputs. Implements the 00-DECISIONS whitelist — no general eval(), no
3
+ // dependencies. Function `select`s bypass this file entirely.
4
+ //
5
+ // Grammar (one statement):
6
+ // countWhere(<expr>) | sumBy(<expr>) | filter(<expr>) | map(<expr>)
7
+ // | length(<expr>) | <expr>
8
+ //
9
+ // <expr>: identifiers (with `.` member access), number / string / true /
10
+ // false / null literals, `! - ` unary, `* /`, `+ -`, `== != < > <= >=`,
11
+ // `&& ||`, parentheses.
12
+ //
13
+ // Inputs object: { [fromPath]: value }. Collection functions (countWhere /
14
+ // sumBy / filter / map) iterate the first ARRAY input (a wildcard `from`
15
+ // expands to an array upstream); inside their <expr>, bare identifiers resolve
16
+ // against the current item (its own props, plus `item` / `value` = the item).
17
+ // `length` and bare <expr> resolve identifiers against the inputs, aliased by
18
+ // each path's LAST segment and by positional `$0`, `$1`, … (and `value` =
19
+ // first input).
20
+ const COLLECTION_FNS = new Set(['countWhere', 'sumBy', 'filter', 'map']);
21
+ export function compileSelect(select) {
22
+ const src = select.trim();
23
+ const fnMatch = /^([A-Za-z_$][\w$]*)\(([\s\S]*)\)$/.exec(src);
24
+ if (fnMatch && (COLLECTION_FNS.has(fnMatch[1]) || fnMatch[1] === 'length')) {
25
+ const fn = fnMatch[1];
26
+ const inner = parse(fnMatch[2]);
27
+ if (fn === 'length') {
28
+ return (inputs) => {
29
+ const v = evalNode(inner, inputsScope(inputs));
30
+ if (Array.isArray(v) || typeof v === 'string')
31
+ return v.length;
32
+ if (v && typeof v === 'object')
33
+ return Object.keys(v).length;
34
+ return 0;
35
+ };
36
+ }
37
+ return (inputs) => {
38
+ const coll = pickCollection(inputs);
39
+ switch (fn) {
40
+ case 'countWhere':
41
+ return coll.reduce((n, item) => (truthy(evalNode(inner, itemScope(item))) ? n + 1 : n), 0);
42
+ case 'sumBy':
43
+ return coll.reduce((s, item) => s + toNum(evalNode(inner, itemScope(item))), 0);
44
+ case 'filter':
45
+ return coll.filter((item) => truthy(evalNode(inner, itemScope(item))));
46
+ case 'map':
47
+ return coll.map((item) => evalNode(inner, itemScope(item)));
48
+ default:
49
+ return undefined;
50
+ }
51
+ };
52
+ }
53
+ if (fnMatch) {
54
+ throw new Error(`computed: unknown select function "${fnMatch[1]}(…)"`);
55
+ }
56
+ const node = parse(src);
57
+ return (inputs) => evalNode(node, inputsScope(inputs));
58
+ }
59
+ // ── scopes ──────────────────────────────────────────────────────────────────
60
+ function pickCollection(inputs) {
61
+ for (const v of Object.values(inputs))
62
+ if (Array.isArray(v))
63
+ return v;
64
+ return [];
65
+ }
66
+ function itemScope(item) {
67
+ if (item && typeof item === 'object') {
68
+ return { ...item, item, value: item };
69
+ }
70
+ return { item, value: item };
71
+ }
72
+ function lastSegment(path) {
73
+ const parts = path.split('/');
74
+ return parts[parts.length - 1] || path;
75
+ }
76
+ function inputsScope(inputs) {
77
+ const scope = {};
78
+ let i = 0;
79
+ for (const [path, value] of Object.entries(inputs)) {
80
+ scope[lastSegment(path)] = value;
81
+ scope[`$${i}`] = value;
82
+ if (i === 0)
83
+ scope.value = value;
84
+ i++;
85
+ }
86
+ return scope;
87
+ }
88
+ const OPS2 = ['==', '!=', '<=', '>=', '&&', '||'];
89
+ const OPS1 = ['<', '>', '!', '+', '-', '*', '/', '(', ')', '.', ','];
90
+ function tokenize(src) {
91
+ const out = [];
92
+ let i = 0;
93
+ while (i < src.length) {
94
+ const c = src[i];
95
+ if (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
96
+ i++;
97
+ continue;
98
+ }
99
+ if (c === '"' || c === "'") {
100
+ let j = i + 1;
101
+ let s = '';
102
+ while (j < src.length && src[j] !== c) {
103
+ s += src[j];
104
+ j++;
105
+ }
106
+ if (j >= src.length)
107
+ throw new Error(`computed: unterminated string in select`);
108
+ out.push({ t: 'str', v: s });
109
+ i = j + 1;
110
+ continue;
111
+ }
112
+ if (/[0-9]/.test(c) || (c === '.' && /[0-9]/.test(src[i + 1] ?? ''))) {
113
+ let j = i;
114
+ while (j < src.length && /[0-9.]/.test(src[j]))
115
+ j++;
116
+ out.push({ t: 'num', v: Number(src.slice(i, j)) });
117
+ i = j;
118
+ continue;
119
+ }
120
+ if (/[A-Za-z_$]/.test(c)) {
121
+ let j = i;
122
+ while (j < src.length && /[\w$]/.test(src[j]))
123
+ j++;
124
+ out.push({ t: 'id', v: src.slice(i, j) });
125
+ i = j;
126
+ continue;
127
+ }
128
+ const two = src.slice(i, i + 2);
129
+ if (OPS2.includes(two)) {
130
+ out.push({ t: 'op', v: two });
131
+ i += 2;
132
+ continue;
133
+ }
134
+ if (OPS1.includes(c)) {
135
+ out.push({ t: 'op', v: c });
136
+ i++;
137
+ continue;
138
+ }
139
+ throw new Error(`computed: unexpected character "${c}" in select`);
140
+ }
141
+ return out;
142
+ }
143
+ function parse(src) {
144
+ const toks = tokenize(src);
145
+ let pos = 0;
146
+ const peek = () => toks[pos];
147
+ const eat = (v) => {
148
+ const t = toks[pos];
149
+ if (!t)
150
+ throw new Error(`computed: unexpected end of select`);
151
+ if (v && !(t.t === 'op' && t.v === v))
152
+ throw new Error(`computed: expected "${v}"`);
153
+ pos++;
154
+ return t;
155
+ };
156
+ const isOp = (v) => { const t = peek(); return !!t && t.t === 'op' && t.v === v; };
157
+ function primary() {
158
+ const t = peek();
159
+ if (!t)
160
+ throw new Error(`computed: unexpected end of select`);
161
+ if (isOp('!') || isOp('-')) {
162
+ const op = eat().v;
163
+ return { k: 'unary', op, arg: primary() };
164
+ }
165
+ if (isOp('(')) {
166
+ eat('(');
167
+ const e = orExpr();
168
+ eat(')');
169
+ return member(e);
170
+ }
171
+ if (t.t === 'num') {
172
+ eat();
173
+ return { k: 'lit', v: t.v };
174
+ }
175
+ if (t.t === 'str') {
176
+ eat();
177
+ return { k: 'lit', v: t.v };
178
+ }
179
+ if (t.t === 'id') {
180
+ eat();
181
+ if (t.v === 'true')
182
+ return { k: 'lit', v: true };
183
+ if (t.v === 'false')
184
+ return { k: 'lit', v: false };
185
+ if (t.v === 'null')
186
+ return { k: 'lit', v: null };
187
+ return member({ k: 'id', v: t.v });
188
+ }
189
+ throw new Error(`computed: unexpected token in select`);
190
+ }
191
+ function member(base) {
192
+ let node = base;
193
+ while (isOp('.')) {
194
+ eat('.');
195
+ const id = eat();
196
+ if (id.t !== 'id')
197
+ throw new Error(`computed: expected property name after "."`);
198
+ node = { k: 'member', obj: node, prop: id.v };
199
+ }
200
+ return node;
201
+ }
202
+ function binLevel(next, ops) {
203
+ let left = next();
204
+ while (peek() && peek().t === 'op' && ops.includes(peek().v)) {
205
+ const op = eat().v;
206
+ left = { k: 'bin', op, l: left, r: next() };
207
+ }
208
+ return left;
209
+ }
210
+ const mul = () => binLevel(primary, ['*', '/']);
211
+ const add = () => binLevel(mul, ['+', '-']);
212
+ const cmp = () => binLevel(add, ['==', '!=', '<', '>', '<=', '>=']);
213
+ const and = () => binLevel(cmp, ['&&']);
214
+ const orExpr = () => binLevel(and, ['||']);
215
+ const result = orExpr();
216
+ if (pos !== toks.length)
217
+ throw new Error(`computed: trailing tokens in select`);
218
+ return result;
219
+ }
220
+ // ── evaluator ─────────────────────────────────────────────────────────────────
221
+ function evalNode(n, scope) {
222
+ switch (n.k) {
223
+ case 'lit':
224
+ return n.v;
225
+ case 'id':
226
+ return scope[n.v];
227
+ case 'member': {
228
+ const o = evalNode(n.obj, scope);
229
+ if (o == null)
230
+ return undefined;
231
+ return o[n.prop];
232
+ }
233
+ case 'unary': {
234
+ const v = evalNode(n.arg, scope);
235
+ return n.op === '!' ? !truthy(v) : -toNum(v);
236
+ }
237
+ case 'bin': {
238
+ const l = evalNode(n.l, scope);
239
+ if (n.op === '&&')
240
+ return truthy(l) ? evalNode(n.r, scope) : l;
241
+ if (n.op === '||')
242
+ return truthy(l) ? l : evalNode(n.r, scope);
243
+ const r = evalNode(n.r, scope);
244
+ switch (n.op) {
245
+ case '==': return l === r;
246
+ case '!=': return l !== r;
247
+ case '<': return l < r;
248
+ case '>': return l > r;
249
+ case '<=': return l <= r;
250
+ case '>=': return l >= r;
251
+ case '+': return typeof l === 'string' || typeof r === 'string'
252
+ ? String(l) + String(r)
253
+ : toNum(l) + toNum(r);
254
+ case '-': return toNum(l) - toNum(r);
255
+ case '*': return toNum(l) * toNum(r);
256
+ case '/': return toNum(l) / toNum(r);
257
+ default: return undefined;
258
+ }
259
+ }
260
+ }
261
+ }
262
+ function truthy(v) {
263
+ return !!v;
264
+ }
265
+ function toNum(v) {
266
+ return typeof v === 'number' ? v : Number(v);
267
+ }
@@ -0,0 +1,2 @@
1
+ import type { ConverterRegistry } from '../types/converter-registry.js';
2
+ export declare function createConverterRegistry(): ConverterRegistry;
@@ -0,0 +1,37 @@
1
+ import { disposableFrom } from './disposable.js';
2
+ export function createConverterRegistry() {
3
+ const converters = new Map();
4
+ function inputMatches(matcher, input) {
5
+ if (typeof matcher === 'function')
6
+ return matcher(input);
7
+ if (!input || typeof input !== 'object')
8
+ return false;
9
+ const value = input[matcher.header];
10
+ if (matcher.value === undefined)
11
+ return value !== undefined;
12
+ return value === matcher.value;
13
+ }
14
+ return {
15
+ register(t) {
16
+ converters.set(t.id, t);
17
+ return disposableFrom(() => {
18
+ if (converters.get(t.id) === t)
19
+ converters.delete(t.id);
20
+ });
21
+ },
22
+ unregister(id) {
23
+ converters.delete(id);
24
+ },
25
+ list() {
26
+ return [...converters.values()];
27
+ },
28
+ translate(input) {
29
+ for (const t of converters.values()) {
30
+ if (inputMatches(t.accepts, input)) {
31
+ return t.translate(input);
32
+ }
33
+ }
34
+ throw new Error('No registered converter accepts this input');
35
+ },
36
+ };
37
+ }
@@ -0,0 +1,3 @@
1
+ import type { Disposable } from '../types/disposable.js';
2
+ export declare function combineDisposables(...disposables: (Disposable | undefined)[]): Disposable;
3
+ export declare function disposableFrom(fn: () => void): Disposable;
@@ -0,0 +1,19 @@
1
+ export function combineDisposables(...disposables) {
2
+ return {
3
+ dispose() {
4
+ for (const d of disposables) {
5
+ if (!d)
6
+ continue;
7
+ try {
8
+ d.dispose();
9
+ }
10
+ catch {
11
+ // Swallow individual disposal errors so one failure doesn't strand others.
12
+ }
13
+ }
14
+ },
15
+ };
16
+ }
17
+ export function disposableFrom(fn) {
18
+ return { dispose: fn };
19
+ }
@@ -0,0 +1,12 @@
1
+ import type { Action, BindingPath, DataBinding, DynamicBoolean, DynamicNumber, DynamicString, DynamicStringList, DynamicValue, FunctionCall, PropValue } from '../types/component-graph.js';
2
+ import type { Scena } from '../types/scena.js';
3
+ export declare function resolveDynamicValue(value: PropValue, dataContext: BindingPath | undefined, scena: Scena): unknown;
4
+ export declare function resolveFunctionCall(fc: FunctionCall, dataContext: BindingPath | undefined, scena: Scena): unknown;
5
+ export declare function resolveDynamicString(v: DynamicString, dataContext: BindingPath | undefined, scena: Scena): string;
6
+ export declare function resolveDynamicNumber(v: DynamicNumber, dataContext: BindingPath | undefined, scena: Scena): number;
7
+ export declare function resolveDynamicBoolean(v: DynamicBoolean, dataContext: BindingPath | undefined, scena: Scena): boolean;
8
+ export declare function resolveDynamicStringList(v: DynamicStringList, dataContext: BindingPath | undefined, scena: Scena): string[];
9
+ export declare function resolveAction(action: Action, dataContext: BindingPath | undefined, scena: Scena, mountKey: string | null): () => Promise<unknown>;
10
+ export declare function writeDynamic(value: PropValue, dataContext: BindingPath | undefined, scena: Scena, next: unknown): void;
11
+ export declare function isWritableDynamic(v: PropValue): v is DataBinding;
12
+ export type { DynamicValue };