@arkitektio/bsx 4.2.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/README.md +39 -18
  2. package/dist/bsx/parse.d.ts +13 -7
  3. package/dist/bsx/parse.d.ts.map +1 -1
  4. package/dist/bsx/parse.js +18 -57
  5. package/dist/bsx/parse.js.map +1 -1
  6. package/dist/bsx/print.d.ts.map +1 -1
  7. package/dist/bsx/print.js +22 -35
  8. package/dist/bsx/print.js.map +1 -1
  9. package/dist/bsx/references.d.ts +5 -5
  10. package/dist/bsx/references.d.ts.map +1 -1
  11. package/dist/bsx/references.js +124 -30
  12. package/dist/bsx/references.js.map +1 -1
  13. package/dist/catalogs/html.d.ts +1 -1
  14. package/dist/catalogs/html.d.ts.map +1 -1
  15. package/dist/catalogs/html.js +3 -3
  16. package/dist/catalogs/html.js.map +1 -1
  17. package/dist/catalogs/index.d.ts +209 -139
  18. package/dist/catalogs/index.d.ts.map +1 -1
  19. package/dist/catalogs/index.js +6 -2
  20. package/dist/catalogs/index.js.map +1 -1
  21. package/dist/catalogs/logo.d.ts +5 -5
  22. package/dist/catalogs/logo.d.ts.map +1 -1
  23. package/dist/catalogs/logo.js +3 -3
  24. package/dist/catalogs/logo.js.map +1 -1
  25. package/dist/catalogs/parts/data.d.ts +6 -6
  26. package/dist/catalogs/parts/feedback.d.ts +15 -15
  27. package/dist/catalogs/parts/forms.d.ts +55 -27
  28. package/dist/catalogs/parts/forms.d.ts.map +1 -1
  29. package/dist/catalogs/parts/forms.js +32 -0
  30. package/dist/catalogs/parts/forms.js.map +1 -1
  31. package/dist/catalogs/parts/html.d.ts +1 -1
  32. package/dist/catalogs/parts/html.d.ts.map +1 -1
  33. package/dist/catalogs/parts/html.js +1 -1
  34. package/dist/catalogs/parts/html.js.map +1 -1
  35. package/dist/catalogs/parts/icons.d.ts +11 -11
  36. package/dist/catalogs/parts/icons.js +1 -1
  37. package/dist/catalogs/parts/index.d.ts +183 -137
  38. package/dist/catalogs/parts/index.d.ts.map +1 -1
  39. package/dist/catalogs/parts/layout.d.ts +11 -1
  40. package/dist/catalogs/parts/layout.d.ts.map +1 -1
  41. package/dist/catalogs/parts/layout.js +9 -0
  42. package/dist/catalogs/parts/layout.js.map +1 -1
  43. package/dist/catalogs/parts/logo.d.ts +8 -8
  44. package/dist/catalogs/parts/logo.d.ts.map +1 -1
  45. package/dist/catalogs/parts/logo.js +2 -2
  46. package/dist/catalogs/parts/logo.js.map +1 -1
  47. package/dist/catalogs/parts/navigation.d.ts +20 -20
  48. package/dist/catalogs/parts/overlays.d.ts +55 -55
  49. package/dist/catalogs/parts/run.d.ts +13 -5
  50. package/dist/catalogs/parts/run.d.ts.map +1 -1
  51. package/dist/catalogs/parts/run.js +1 -1
  52. package/dist/catalogs/parts/scene.d.ts +12 -4
  53. package/dist/catalogs/parts/scene.d.ts.map +1 -1
  54. package/dist/catalogs/parts/scene.js +4 -0
  55. package/dist/catalogs/parts/scene.js.map +1 -1
  56. package/dist/catalogs/parts/structure.js +2 -2
  57. package/dist/catalogs/parts/toast.js +1 -1
  58. package/dist/catalogs/parts/toast.js.map +1 -1
  59. package/dist/catalogs/parts/typography.js +1 -1
  60. package/dist/catalogs/parts/typography.js.map +1 -1
  61. package/dist/catalogs/props.d.ts +3 -3
  62. package/dist/catalogs/scene.d.ts +13 -5
  63. package/dist/catalogs/scene.d.ts.map +1 -1
  64. package/dist/catalogs/scene.js +3 -3
  65. package/dist/catalogs/scene.js.map +1 -1
  66. package/dist/catalogs/shadcn.d.ts +106 -58
  67. package/dist/catalogs/shadcn.d.ts.map +1 -1
  68. package/dist/catalogs/shadcn.js +6 -4
  69. package/dist/catalogs/shadcn.js.map +1 -1
  70. package/dist/catalogs/structure.d.ts +1 -1
  71. package/dist/catalogs/structure.d.ts.map +1 -1
  72. package/dist/catalogs/structure.js +3 -3
  73. package/dist/catalogs/structure.js.map +1 -1
  74. package/dist/catalogs/ui.d.ts +83 -73
  75. package/dist/catalogs/ui.d.ts.map +1 -1
  76. package/dist/catalogs/ui.js +4 -3
  77. package/dist/catalogs/ui.js.map +1 -1
  78. package/dist/catalogs.d.ts +1 -1
  79. package/dist/catalogs.d.ts.map +1 -1
  80. package/dist/catalogs.js +2 -2
  81. package/dist/catalogs.js.map +1 -1
  82. package/dist/ports.js +1 -1
  83. package/dist/ports.js.map +1 -1
  84. package/dist/renderer/BlokRenderer.d.ts +4 -1
  85. package/dist/renderer/BlokRenderer.d.ts.map +1 -1
  86. package/dist/renderer/BlokRenderer.js +5 -1
  87. package/dist/renderer/BlokRenderer.js.map +1 -1
  88. package/dist/renderer/baseCatalog.d.ts +8 -6
  89. package/dist/renderer/baseCatalog.d.ts.map +1 -1
  90. package/dist/renderer/baseCatalog.js +7 -5
  91. package/dist/renderer/baseCatalog.js.map +1 -1
  92. package/dist/renderer/bloks/control.d.ts +14 -0
  93. package/dist/renderer/bloks/control.d.ts.map +1 -1
  94. package/dist/renderer/bloks/control.js +105 -6
  95. package/dist/renderer/bloks/control.js.map +1 -1
  96. package/dist/renderer/bloks/data.d.ts +6 -6
  97. package/dist/renderer/bloks/feedback.d.ts +15 -15
  98. package/dist/renderer/bloks/forms.d.ts +51 -27
  99. package/dist/renderer/bloks/forms.d.ts.map +1 -1
  100. package/dist/renderer/bloks/forms.js +56 -0
  101. package/dist/renderer/bloks/forms.js.map +1 -1
  102. package/dist/renderer/bloks/html.js +2 -2
  103. package/dist/renderer/bloks/icons.d.ts +5 -5
  104. package/dist/renderer/bloks/index.d.ts +166 -134
  105. package/dist/renderer/bloks/index.d.ts.map +1 -1
  106. package/dist/renderer/bloks/index.js +1 -1
  107. package/dist/renderer/bloks/layout.d.ts +9 -1
  108. package/dist/renderer/bloks/layout.d.ts.map +1 -1
  109. package/dist/renderer/bloks/layout.js +15 -0
  110. package/dist/renderer/bloks/layout.js.map +1 -1
  111. package/dist/renderer/bloks/logo/index.d.ts +5 -5
  112. package/dist/renderer/bloks/logo/index.d.ts.map +1 -1
  113. package/dist/renderer/bloks/logo/index.js +2 -2
  114. package/dist/renderer/bloks/logo/index.js.map +1 -1
  115. package/dist/renderer/bloks/navigation.d.ts +20 -20
  116. package/dist/renderer/bloks/overlays.d.ts +55 -55
  117. package/dist/renderer/bloks/run/components.d.ts +6 -2
  118. package/dist/renderer/bloks/run/components.d.ts.map +1 -1
  119. package/dist/renderer/bloks/run/components.js +1 -1
  120. package/dist/renderer/bloks/run/host.d.ts +32 -3
  121. package/dist/renderer/bloks/run/host.d.ts.map +1 -1
  122. package/dist/renderer/bloks/run/host.js.map +1 -1
  123. package/dist/renderer/bloks/scene/index.d.ts +6 -2
  124. package/dist/renderer/bloks/scene/index.d.ts.map +1 -1
  125. package/dist/renderer/bloks/toast.d.ts +1 -1
  126. package/dist/renderer/bloks/typography.js +1 -1
  127. package/dist/renderer/catalog.d.ts +4 -7
  128. package/dist/renderer/catalog.d.ts.map +1 -1
  129. package/dist/renderer/catalog.js +7 -31
  130. package/dist/renderer/catalog.js.map +1 -1
  131. package/dist/renderer/declare.d.ts +31 -19
  132. package/dist/renderer/declare.d.ts.map +1 -1
  133. package/dist/renderer/declare.js +44 -18
  134. package/dist/renderer/declare.js.map +1 -1
  135. package/dist/renderer/functions/v2/index.d.ts.map +1 -1
  136. package/dist/renderer/functions/v2/index.js +39 -0
  137. package/dist/renderer/functions/v2/index.js.map +1 -1
  138. package/dist/renderer/runtime/catalog.d.ts +27 -7
  139. package/dist/renderer/runtime/catalog.d.ts.map +1 -1
  140. package/dist/renderer/runtime/catalog.js +30 -3
  141. package/dist/renderer/runtime/catalog.js.map +1 -1
  142. package/dist/renderer/runtime/components.d.ts +7 -1
  143. package/dist/renderer/runtime/components.d.ts.map +1 -1
  144. package/dist/renderer/runtime/components.js +3 -0
  145. package/dist/renderer/runtime/components.js.map +1 -1
  146. package/dist/renderer/runtime/context.d.ts +2 -0
  147. package/dist/renderer/runtime/context.d.ts.map +1 -1
  148. package/dist/renderer/runtime/context.js +4 -0
  149. package/dist/renderer/runtime/context.js.map +1 -1
  150. package/dist/renderer/runtime/describe.d.ts +14 -4
  151. package/dist/renderer/runtime/describe.d.ts.map +1 -1
  152. package/dist/renderer/runtime/describe.js +3 -0
  153. package/dist/renderer/runtime/describe.js.map +1 -1
  154. package/dist/renderer/runtime/hooks.d.ts.map +1 -1
  155. package/dist/renderer/runtime/hooks.js +1 -0
  156. package/dist/renderer/runtime/hooks.js.map +1 -1
  157. package/dist/renderer/runtime/index.d.ts +1 -0
  158. package/dist/renderer/runtime/index.d.ts.map +1 -1
  159. package/dist/renderer/runtime/index.js +1 -0
  160. package/dist/renderer/runtime/index.js.map +1 -1
  161. package/dist/renderer/runtime/preflight.d.ts.map +1 -1
  162. package/dist/renderer/runtime/preflight.js +5 -2
  163. package/dist/renderer/runtime/preflight.js.map +1 -1
  164. package/dist/renderer/runtime/resolution.d.ts +2 -0
  165. package/dist/renderer/runtime/resolution.d.ts.map +1 -1
  166. package/dist/renderer/runtime/resolution.js +17 -1
  167. package/dist/renderer/runtime/resolution.js.map +1 -1
  168. package/dist/renderer/runtime/schemas.d.ts +5 -5
  169. package/dist/renderer/runtime/task.d.ts +25 -2
  170. package/dist/renderer/runtime/task.d.ts.map +1 -1
  171. package/dist/renderer/runtime/task.js +11 -2
  172. package/dist/renderer/runtime/task.js.map +1 -1
  173. package/dist/renderer/runtime/text.d.ts +28 -0
  174. package/dist/renderer/runtime/text.d.ts.map +1 -0
  175. package/dist/renderer/runtime/text.js +82 -0
  176. package/dist/renderer/runtime/text.js.map +1 -0
  177. package/dist/renderer/runtime/types.d.ts +7 -2
  178. package/dist/renderer/runtime/types.d.ts.map +1 -1
  179. package/dist/runtime.d.ts +0 -1
  180. package/dist/runtime.d.ts.map +1 -1
  181. package/dist/runtime.js +0 -1
  182. package/dist/runtime.js.map +1 -1
  183. package/dist/scene.d.ts +1 -1
  184. package/dist/scene.d.ts.map +1 -1
  185. package/dist/scene.js +2 -2
  186. package/dist/scene.js.map +1 -1
  187. package/dist/shadcn.d.ts +169 -137
  188. package/dist/shadcn.d.ts.map +1 -1
  189. package/dist/shadcn.js +8 -5
  190. package/dist/shadcn.js.map +1 -1
  191. package/dist/spec/bsx_v2.json +3080 -2372
  192. package/dist/spec/catalogs/base@3.json +13029 -0
  193. package/dist/spec/catalogs/base@3.json.js +13029 -0
  194. package/dist/spec/catalogs/orkestrator@1.json +489 -0
  195. package/dist/spec/catalogs/orkestrator@1.json.js +489 -0
  196. package/dist/spec/catalogs.d.ts +109 -46
  197. package/dist/spec/catalogs.d.ts.map +1 -1
  198. package/dist/spec/catalogs.js +241 -73
  199. package/dist/spec/catalogs.js.map +1 -1
  200. package/dist/spec/vocabulary.d.ts +21 -3
  201. package/dist/spec/vocabulary.d.ts.map +1 -1
  202. package/dist/spec/vocabulary.js +16 -2
  203. package/dist/spec/vocabulary.js.map +1 -1
  204. package/dist/spec/vocabulary.json +73 -27
  205. package/dist/spec/vocabulary.json.js +73 -27
  206. package/dist/vendor/core/ui/button-group.d.ts +1 -1
  207. package/dist/vendor/core/ui/button.d.ts +1 -1
  208. package/dist/vendor/core/ui/field.d.ts +1 -1
  209. package/package.json +1 -1
  210. package/src/bsx/infer.test.ts +18 -26
  211. package/src/bsx/language.test.ts +2 -2
  212. package/src/bsx/parse.ts +18 -62
  213. package/src/bsx/partial.test.ts +1 -1
  214. package/src/bsx/print.ts +24 -34
  215. package/src/bsx/references.test.ts +71 -10
  216. package/src/bsx/references.ts +114 -35
  217. package/src/catalogs/catalogs.test.ts +45 -14
  218. package/src/catalogs/html.ts +3 -3
  219. package/src/catalogs/index.ts +6 -2
  220. package/src/catalogs/logo.ts +3 -3
  221. package/src/catalogs/parts/forms.ts +32 -0
  222. package/src/catalogs/parts/html.ts +1 -1
  223. package/src/catalogs/parts/icons.ts +1 -1
  224. package/src/catalogs/parts/layout.ts +11 -0
  225. package/src/catalogs/parts/logo.ts +2 -2
  226. package/src/catalogs/parts/run.ts +1 -1
  227. package/src/catalogs/parts/scene.ts +6 -0
  228. package/src/catalogs/parts/structure.ts +2 -2
  229. package/src/catalogs/parts/toast.ts +1 -1
  230. package/src/catalogs/parts/typography.ts +1 -1
  231. package/src/catalogs/scene.ts +3 -3
  232. package/src/catalogs/shadcn.ts +6 -4
  233. package/src/catalogs/structure.ts +3 -3
  234. package/src/catalogs/ui.ts +4 -3
  235. package/src/catalogs.ts +9 -2
  236. package/src/ports.ts +1 -1
  237. package/src/renderer/BlokRenderer.tsx +9 -0
  238. package/src/renderer/addBlokComponents.test.tsx +8 -22
  239. package/src/renderer/baseCatalog.ts +7 -5
  240. package/src/renderer/bloks/components.test.tsx +2 -2
  241. package/src/renderer/bloks/control.tsx +133 -6
  242. package/src/renderer/bloks/flow.test.tsx +1 -1
  243. package/src/renderer/bloks/forms.tsx +126 -0
  244. package/src/renderer/bloks/html.tsx +2 -2
  245. package/src/renderer/bloks/index.ts +1 -1
  246. package/src/renderer/bloks/layout.tsx +28 -0
  247. package/src/renderer/bloks/logo/index.tsx +2 -2
  248. package/src/renderer/bloks/run/components.tsx +1 -1
  249. package/src/renderer/bloks/run/host.tsx +33 -3
  250. package/src/renderer/bloks/run/space.test.tsx +76 -0
  251. package/src/renderer/bloks/time.test.tsx +1 -1
  252. package/src/renderer/bloks/toast.tsx +1 -1
  253. package/src/renderer/bloks/typography.tsx +1 -1
  254. package/src/renderer/catalog.tsx +7 -31
  255. package/src/renderer/declare.test.ts +41 -0
  256. package/src/renderer/declare.ts +70 -32
  257. package/src/renderer/functions/v2/functions.test.ts +40 -1
  258. package/src/renderer/functions/v2/index.ts +47 -0
  259. package/src/renderer/runtime/catalog.ts +35 -10
  260. package/src/renderer/runtime/components.tsx +10 -1
  261. package/src/renderer/runtime/context.tsx +6 -0
  262. package/src/renderer/runtime/describe.ts +17 -4
  263. package/src/renderer/runtime/hooks.ts +1 -0
  264. package/src/renderer/runtime/index.ts +1 -0
  265. package/src/renderer/runtime/preflight.ts +5 -2
  266. package/src/renderer/runtime/resolution.test.ts +14 -0
  267. package/src/renderer/runtime/resolution.ts +15 -1
  268. package/src/renderer/runtime/task.ts +33 -4
  269. package/src/renderer/runtime/text.test.tsx +65 -0
  270. package/src/renderer/runtime/text.ts +88 -0
  271. package/src/renderer/runtime/types.ts +7 -2
  272. package/src/runtime.ts +0 -1
  273. package/src/scene.ts +2 -2
  274. package/src/shadcn.ts +8 -5
  275. package/src/spec/bsx_v2.json +3080 -2372
  276. package/src/spec/catalogs/base@3.json +13029 -0
  277. package/src/spec/catalogs/orkestrator@1.json +489 -0
  278. package/src/spec/catalogs.ts +257 -101
  279. package/src/spec/spec.test.ts +107 -21
  280. package/src/spec/vocabulary.json +73 -27
  281. package/src/spec/vocabulary.ts +36 -7
  282. package/dist/renderer/modules.d.ts +0 -4
  283. package/dist/renderer/modules.d.ts.map +0 -1
  284. package/dist/renderer/modules.js +0 -11
  285. package/dist/renderer/modules.js.map +0 -1
  286. package/dist/spec/catalogs/base@2.json +0 -222
  287. package/dist/spec/catalogs/base@2.json.js +0 -222
  288. package/dist/spec/catalogs/html@1.json +0 -308
  289. package/dist/spec/catalogs/html@1.json.js +0 -308
  290. package/dist/spec/catalogs/logo@1.json +0 -1687
  291. package/dist/spec/catalogs/logo@1.json.js +0 -1687
  292. package/dist/spec/catalogs/scene@1.json +0 -858
  293. package/dist/spec/catalogs/scene@1.json.js +0 -858
  294. package/dist/spec/catalogs/shadcn@1.json +0 -3860
  295. package/dist/spec/catalogs/shadcn@1.json.js +0 -3860
  296. package/dist/spec/catalogs/structure@1.json +0 -185
  297. package/dist/spec/catalogs/structure@1.json.js +0 -185
  298. package/dist/spec/catalogs/ui@1.json +0 -5349
  299. package/dist/spec/catalogs/ui@1.json.js +0 -5349
  300. package/src/renderer/modules.ts +0 -12
  301. package/src/spec/catalogs/base@2.json +0 -222
  302. package/src/spec/catalogs/html@1.json +0 -308
  303. package/src/spec/catalogs/logo@1.json +0 -1687
  304. package/src/spec/catalogs/scene@1.json +0 -858
  305. package/src/spec/catalogs/shadcn@1.json +0 -3860
  306. package/src/spec/catalogs/structure@1.json +0 -185
  307. package/src/spec/catalogs/ui@1.json +0 -5349
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  /**
3
3
  * What an action's own blok needs from the app that shows a run of it.
4
4
  *
5
- * The blok core draws `Space`, `Placed`, `Route` and `ask`; it does not know
5
+ * The blok core draws `Space`, `Placed`, `Route`, `ask` and `timeline`; it does not know
6
6
  * which agents a run got, how an agent's own scene blok is found, where a room
7
7
  * keeps its devices, or how an ask is answered. The host answers those through
8
8
  * these contexts: the run (rekuest, from the task or a dry run) and the rooms
@@ -11,6 +11,15 @@ import * as React from 'react';
11
11
  * Both are provided around the scene surface, not inside the canvas: a
12
12
  * `Popout`'s card is rendered by the scene's HTML half, outside the blok.
13
13
  */
14
+ /** How an `<args />` narrows the form it draws. */
15
+ export type BlokArgsOptions = {
16
+ /** Only these port keys. */
17
+ only?: readonly string[];
18
+ /** Not these port keys. */
19
+ omit?: readonly string[];
20
+ /** What it does with the arguments the caller gave: leaves them out (`hide`, the default) or lists them, locked (`show`). */
21
+ given?: 'hide' | 'show';
22
+ };
14
23
  /** An agent a run binds a dependency key to. */
15
24
  export type BlokRunAgent = {
16
25
  id: string;
@@ -21,8 +30,28 @@ export type BlokRunHost = {
21
30
  agentsFor: (key: string) => readonly BlokRunAgent[];
22
31
  /** The run's open ask, answered in place (answering resumes the run); nothing while none is open. */
23
32
  renderAsk: () => React.ReactNode;
24
- /** The form of the arguments of the run an assign blok starts (`<args />`); absent where no run is being started. */
25
- renderArgs?: () => React.ReactNode;
33
+ /**
34
+ * The form of the arguments of the run an assign blok starts (`<args />`); absent where no run is
35
+ * being started. It draws the rest: every argument the caller did not give and no `<arg />` places,
36
+ * narrowed by `options`.
37
+ */
38
+ renderArgs?: (options?: BlokArgsOptions) => React.ReactNode;
39
+ /** One argument of that run, by port key (`<arg key="image" />`); nothing for one the caller gave. */
40
+ renderArg?: (key: string) => React.ReactNode;
41
+ /** The picker of the run's dependencies (`<deps />`): every dependency no `<dep />` places. */
42
+ renderDeps?: () => React.ReactNode;
43
+ /** The picker of one dependency of that run, by key (`<dep key="microscope" />`). */
44
+ renderDep?: (key: string) => React.ReactNode;
45
+ /** What the run returned, as its return ports show it (`<returns />`); nothing before the first yield. */
46
+ renderReturns?: (options?: Pick<BlokArgsOptions, 'only' | 'omit'>) => React.ReactNode;
47
+ /** Where the run stands, as one line (`<status />`). */
48
+ renderStatus?: () => React.ReactNode;
49
+ /**
50
+ * The run's time slider (`<timeline />`): moving it moves what the host shows of the run, this
51
+ * blok with it. Absent where the run has no clock; a host that draws a slider of its own leaves
52
+ * that out for a blok that places this one.
53
+ */
54
+ renderTimeline?: () => React.ReactNode;
26
55
  };
27
56
  export declare const BlokRunHostProvider: React.Provider<BlokRunHost>;
28
57
  export declare const useBlokRunHost: () => BlokRunHost;
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/run/host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;GAWG;AAEH,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG;IACxB,2FAA2F;IAC3F,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,YAAY,EAAE,CAAC;IACpD,qGAAqG;IACrG,SAAS,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACjC,qHAAqH;IACrH,UAAU,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACpC,CAAC;AAWF,eAAO,MAAM,mBAAmB,6BAA8B,CAAC;AAE/D,eAAO,MAAM,cAAc,QAAO,WAAmD,CAAC;AAEtF,oFAAoF;AACpF,MAAM,MAAM,QAAQ,GAAG,MAAM,EAAE,EAAE,CAAC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AG,EAAE,CAAC,IAAI,EAAC,CAAC;AAE/C,MAAM,cAAc,GAAkB;IACpC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;IACtB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI;CACxB,CAAC;AAEF,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAgB,cAAc,CAAC,CAAC;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,QAAQ,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAkB,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAgB,IAAI,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAC;AAEzD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAkB,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
@@ -14,11 +14,15 @@ export declare const sceneRenders: {
14
14
  notDownstreamOf: string[];
15
15
  };
16
16
  schema: import("zod").ZodObject<{
17
+ chrome: import("zod").ZodOptional<import("zod").ZodEnum<{
18
+ none: "none";
19
+ auto: "auto";
20
+ }>>;
17
21
  camera: import("zod").ZodOptional<import("zod").ZodEnum<{
22
+ top: "top";
18
23
  iso: "iso";
19
- front: "front";
20
24
  side: "side";
21
- top: "top";
25
+ front: "front";
22
26
  }>>;
23
27
  grid: import("zod").ZodOptional<import("zod").ZodBoolean>;
24
28
  height: import("zod").ZodOptional<import("zod").ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAexB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderer/bloks/scene/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAexB,CAAC"}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import * as z from 'zod';
3
3
  /**
4
4
  * `<Toast task={move}>`: a notification when a task settles, once per task
5
- * (ui@1). Each outcome slot (`done`, `failed`, `cancelled`) is optional and
5
+ * (the ui family). Each outcome slot (`done`, `failed`, `cancelled`) is optional and
6
6
  * holds the text shown for it:
7
7
  *
8
8
  * <Toast task={move}>
@@ -78,7 +78,7 @@ const useClock = (active, target) => {
78
78
  return now;
79
79
  };
80
80
  /**
81
- * `<Time value relative? format?>` (ui@1): a moment, absolute or relative.
81
+ * `<Time value relative? format?>` (the ui family): a moment, absolute or relative.
82
82
  * Relative time is measured from the viewed moment: the wall clock live
83
83
  * (ticking here), `then` while travelling, so the past renders as it did.
84
84
  */
@@ -5,7 +5,7 @@ export declare const BlokCatalogProvider: ({ catalog, children }: {
5
5
  catalog: BlokCatalog;
6
6
  children?: React.ReactNode;
7
7
  }) => React.JSX.Element;
8
- /** The app's catalog when no provider says otherwise: the platform's, or base@2 alone. */
8
+ /** The app's catalog when no provider says otherwise: the platform's, or the language's own elements alone. */
9
9
  export declare const appBlokCatalog: () => BlokCatalog;
10
10
  /** The catalog the app provides here, or the app's. */
11
11
  export declare const useBlokCatalog: () => BlokCatalog;
@@ -15,12 +15,9 @@ export declare const useBlokCatalog: () => BlokCatalog;
15
15
  * export) offers them. Called once, by the composition root that installs the
16
16
  * modules; core never imports a module.
17
17
  *
18
- * A module may draw over a global catalog's component (its own `Slider`):
19
- * the module's is rendered, as the spec's `blok_view` says, and the validator
20
- * warns `catalog.shadow` where a blok uses it. Any other name the catalog
21
- * already holds (base's, the app's own, another module's) is refused, whoever
22
- * brought it. Returns the undo, which puts a drawn-over component back (a dev
23
- * hot reload installs the modules again).
18
+ * A catalog only adds: a name the catalog already holds (the language's, the
19
+ * base catalog's, the app's own, another module's) is refused, whoever brought
20
+ * it. Returns the undo (a dev hot reload installs the modules again).
24
21
  */
25
22
  export declare const addBlokComponents: (components: readonly BlokComponentDefinition[], catalog: BlokCatalog) => (() => void);
26
23
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAC,WAAW,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAWpE,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,GAAI,uBAAqB;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,sBAE1G,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,cAAc,QAAO,WAAwD,CAAC;AAE3F,uDAAuD;AACvD,eAAO,MAAM,cAAc,QAAO,WAAuE,CAAC;AAK1G;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,uBAAuB,EAAE,EAC9C,SAAS,WAAW,KACnB,CAAC,MAAM,IAAI,CA4Bb,CAAC"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAC,WAAW,EAAE,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAWpE,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,GAAI,uBAAqB;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,sBAE1G,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,cAAc,QAAO,WAAwD,CAAC;AAE3F,uDAAuD;AACvD,eAAO,MAAM,cAAc,QAAO,WAAuE,CAAC;AAE1G;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,SAAS,uBAAuB,EAAE,EAC9C,SAAS,WAAW,KACnB,CAAC,MAAM,IAAI,CAWb,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { baseBlokCatalog } from './baseCatalog.js';
4
- import { moduleShadowsOf } from './modules.js';
5
4
  import { blokPlatform } from '../platform.js';
6
5
  /**
7
6
  * The catalog a blok payload is validated and rendered against: which
@@ -12,53 +11,30 @@ import { blokPlatform } from '../platform.js';
12
11
  const BlokCatalogContext = React.createContext(null);
13
12
  /** The app's catalog, for every renderer below it. */
14
13
  export const BlokCatalogProvider = ({ catalog, children }) => (_jsx(BlokCatalogContext.Provider, { value: catalog, children: children }));
15
- /** The app's catalog when no provider says otherwise: the platform's, or base@2 alone. */
14
+ /** The app's catalog when no provider says otherwise: the platform's, or the language's own elements alone. */
16
15
  export const appBlokCatalog = () => blokPlatform().catalog ?? baseBlokCatalog;
17
16
  /** The catalog the app provides here, or the app's. */
18
17
  export const useBlokCatalog = () => React.useContext(BlokCatalogContext) ?? appBlokCatalog();
19
- /** A component of a global catalog (`ui@1`, `scene@1`): what a module may draw over. */
20
- const isGlobal = (component) => component?.origin?.includes('@') === true;
21
18
  /**
22
19
  * Adds components a module brings (`ModuleBuiltins.bloks`) to the catalog, so
23
20
  * everything that reads the app's catalog (the renderer, the registrar, the
24
21
  * export) offers them. Called once, by the composition root that installs the
25
22
  * modules; core never imports a module.
26
23
  *
27
- * A module may draw over a global catalog's component (its own `Slider`):
28
- * the module's is rendered, as the spec's `blok_view` says, and the validator
29
- * warns `catalog.shadow` where a blok uses it. Any other name the catalog
30
- * already holds (base's, the app's own, another module's) is refused, whoever
31
- * brought it. Returns the undo, which puts a drawn-over component back (a dev
32
- * hot reload installs the modules again).
24
+ * A catalog only adds: a name the catalog already holds (the language's, the
25
+ * base catalog's, the app's own, another module's) is refused, whoever brought
26
+ * it. Returns the undo (a dev hot reload installs the modules again).
33
27
  */
34
28
  export const addBlokComponents = (components, catalog) => {
35
- const shadows = moduleShadowsOf(catalog);
36
- const taken = components.filter(component => {
37
- const held = catalog.components.get(component.name);
38
- return held !== undefined && (!isGlobal(held) || shadows.has(component.name));
39
- });
29
+ const taken = components.filter(component => catalog.components.has(component.name));
40
30
  if (taken.length > 0) {
41
31
  throw new Error(`Blok components already in the catalog: ${taken.map(component => component.name).join(', ')}`);
42
32
  }
43
- const previous = new Map();
44
- for (const component of components) {
45
- const drawnOver = catalog.components.get(component.name);
46
- if (drawnOver) {
47
- previous.set(component.name, drawnOver);
48
- shadows.add(component.name);
49
- }
33
+ for (const component of components)
50
34
  catalog.components.set(component.name, component);
51
- }
52
35
  return () => {
53
36
  for (const component of components) {
54
- if (catalog.components.get(component.name) !== component)
55
- continue;
56
- const restored = previous.get(component.name);
57
- if (restored) {
58
- catalog.components.set(component.name, restored);
59
- shadows.delete(component.name);
60
- }
61
- else
37
+ if (catalog.components.get(component.name) === component)
62
38
  catalog.components.delete(component.name);
63
39
  }
64
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/renderer/catalog.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAGzC;;;;;GAKG;AAEH,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAqB,IAAI,CAAC,CAAC;AAEzE,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAqD,EAAE,EAAE,CAAC,CAC9G,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAAG,QAAQ,GAA+B,CACtF,CAAC;AAEF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,GAAgB,EAAE,CAAC,YAAY,EAAE,CAAC,OAAO,IAAI,eAAe,CAAC;AAE3F,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAgB,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,cAAc,EAAE,CAAC;AAE1G,wFAAwF;AACxF,MAAM,QAAQ,GAAG,CAAC,SAA8C,EAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAExH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B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,CAC/B,UAA8C,EAC9C,OAAoB,EACN,EAAE;IAChB,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACrF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,2CAA2C,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,KAAK,MAAM,SAAS,IAAI,UAAU;QAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtF,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,SAAS;gBAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtG,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,40 +1,52 @@
1
1
  import { type BlokCatalog, type BlokCatalogImplementation, type BlokComponentDefinition, type SpecCatalogJson } from './runtime';
2
+ import type { BlokContextName } from '../spec/vocabulary';
2
3
  /**
3
- * A UI's catalog, declared: the catalogs it implements and nothing inferred.
4
+ * A UI's catalog, declared: what it draws, and nothing inferred.
4
5
  *
5
- * - `catalog` is what its renderers draw: base@2 and every implementation.
6
- * - `claims` are the global catalogs it implements whole (`ui@1`, `scene@1`):
7
- * the server resolves their components from the spec, so a blok that uses
8
- * only claimed catalogs is known to render here.
9
- * - Its own catalogs (unversioned contracts) are part of `catalog`; what it
10
- * registers as its module is `moduleComponentsOf(catalog)`, which also counts
11
- * what its modules add later (`addBlokComponents`).
12
- *
13
- * A global catalog implemented `partial`ly is drawn but not claimed.
6
+ * - `catalog` is what its renderers draw: the language's own elements and every
7
+ * implementation.
8
+ * - `contexts` are the contexts in which it draws the base catalog whole
9
+ * (`HTML`, `SCENE`, `LOGO`): a blok written for the base catalog and drawn in
10
+ * one of them is known to render here.
11
+ * - `claims` are the catalogs it speaks: the base catalog when it draws it
12
+ * whole in at least one context, and each published catalog of its own.
13
+ * - Its own catalogs are part of `catalog`; what it publishes as its app
14
+ * catalog is `ownComponentsOf(catalog)`, which also counts what its modules
15
+ * add later (`addBlokComponents`).
14
16
  */
15
17
  export type BlokUi = {
16
18
  name: string;
17
19
  description: string | null;
18
20
  catalog: BlokCatalog;
19
21
  implementations: readonly BlokCatalogImplementation[];
22
+ contexts: readonly BlokContextName[];
20
23
  claims: readonly string[];
21
24
  };
25
+ /** The contexts in which `catalog` draws every component of the base catalog. */
26
+ export declare const baseContextsOf: (catalog: BlokCatalog) => BlokContextName[];
22
27
  export declare const declareBlokUi: (declaration: {
23
28
  name: string;
24
29
  description?: string;
25
30
  implements: readonly BlokCatalogImplementation[];
26
31
  }) => BlokUi;
27
32
  /**
28
- * What a UI registers as its module (the server's `Module.components`): every
29
- * component of its catalog that is neither base@2's nor a global catalog's. Its
30
- * own catalogs' components, what its modules added since (`addBlokComponents`),
31
- * and a global component a module drew over (it is the module's now).
33
+ * What a UI draws beyond the base catalog: every component of its catalog
34
+ * that is neither the language's own nor one of the base catalog's. Its own
35
+ * catalogs' components, and what its modules added since (`addBlokComponents`).
32
36
  */
33
- export declare const moduleComponentsOf: (catalog: BlokCatalog) => BlokComponentDefinition[];
37
+ export declare const ownComponentsOf: (catalog: BlokCatalog) => BlokComponentDefinition[];
34
38
  /**
35
- * A UI's module as the spec writes a catalog: for the language's default view
36
- * (`registerBlokModules([parseSpecCatalog(blokModuleSpec(...), ...)])`), so the
37
- * parser and the checks know the components only this UI draws.
39
+ * A UI's app catalog as the spec writes one (`{id, name, version, minor,
40
+ * extends, components}`): what it publishes at `id`, registers with the
41
+ * server, and hands the language (`setAppBlokCatalog(parseSpecCatalog(...))`)
42
+ * so its own parser, checks and editor know the components only it draws.
38
43
  */
39
- export declare const blokModuleSpec: (name: string, description: string, catalog: BlokCatalog) => SpecCatalogJson;
44
+ export declare const blokCatalogSpec: (meta: {
45
+ id: string;
46
+ name: string;
47
+ version: number;
48
+ minor?: number;
49
+ extends?: string;
50
+ description: string;
51
+ }, catalog: BlokCatalog) => SpecCatalogJson;
40
52
  //# sourceMappingURL=declare.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["../../src/renderer/declare.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACtD,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,aAAa;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,SAAS,yBAAyB,EAAE,CAAC;CAClD,KAAG,MAqBH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,WAAW,KAAG,uBAAuB,EAG9E,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,aAAa,MAAM,EAAE,SAAS,WAAW,KAAG,eAMvF,CAAC"}
1
+ {"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["../../src/renderer/declare.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACtD,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAYF,iFAAiF;AACjF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,KAAG,eAAe,EAMpE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,aAAa;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,SAAS,yBAAyB,EAAE,CAAC;CAClD,KAAG,MA2BH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,uBAAuB,EAG3E,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,EACxG,SAAS,WAAW,KACnB,eAUD,CAAC"}
@@ -1,5 +1,21 @@
1
1
  import { baseBlokCatalog } from './baseCatalog.js';
2
- import { catalogRef, describeBlokComponent, extendBlokCatalog, } from './runtime/index.js';
2
+ import { BASE_CATALOG_ADDRESS, BASE_CATALOG_REF, catalogRef, describeBlokComponent, extendBlokCatalog, } from './runtime/index.js';
3
+ import { baseCatalog } from '../spec/catalogs.js';
4
+ const CONTEXTS = ['HTML', 'SCENE', 'LOGO'];
5
+ /**
6
+ * The context a base component counts towards: its own, and for one that
7
+ * bridges html and another context (`Scene` opens a scene inside html), the
8
+ * other one: a renderer that draws no 3D still draws html whole.
9
+ */
10
+ const contextOf = (component) => component.context !== 'HTML' ? component.context : (component.childrenContext ?? 'HTML');
11
+ /** The contexts in which `catalog` draws every component of the base catalog. */
12
+ export const baseContextsOf = (catalog) => {
13
+ const components = baseCatalog().components;
14
+ return CONTEXTS.filter(context => {
15
+ const drawn = components.filter(component => !component.inheritsContext && contextOf(component) === context);
16
+ return drawn.length > 0 && drawn.every(component => catalog.components.has(component.name));
17
+ });
18
+ };
3
19
  export const declareBlokUi = (declaration) => {
4
20
  const implementations = declaration.implements;
5
21
  const refs = implementations.map(implementation => catalogRef(implementation.contract));
@@ -7,33 +23,43 @@ export const declareBlokUi = (declaration) => {
7
23
  if (twice.length > 0) {
8
24
  throw new Error(`${declaration.name} implements ${[...new Set(twice)].join(', ')} twice`);
9
25
  }
26
+ const catalog = extendBlokCatalog(baseBlokCatalog, declaration.name, implementations.flatMap(implementation => implementation.components));
27
+ const contexts = baseContextsOf(catalog);
10
28
  return {
11
29
  name: declaration.name,
12
30
  description: declaration.description ?? null,
13
- catalog: extendBlokCatalog(baseBlokCatalog, declaration.name, implementations.flatMap(implementation => implementation.components)),
31
+ catalog,
14
32
  implementations,
15
- claims: implementations
16
- .filter(implementation => implementation.contract.version !== null && implementation.whole)
17
- .map(implementation => catalogRef(implementation.contract))
18
- .sort(),
33
+ contexts,
34
+ claims: [
35
+ ...(contexts.length > 0 ? [BASE_CATALOG_REF] : []),
36
+ ...implementations
37
+ .filter(implementation => implementation.contract.partOf === null && implementation.contract.version !== null && implementation.whole)
38
+ .map(implementation => catalogRef(implementation.contract))
39
+ .sort(),
40
+ ],
19
41
  };
20
42
  };
21
43
  /**
22
- * What a UI registers as its module (the server's `Module.components`): every
23
- * component of its catalog that is neither base@2's nor a global catalog's. Its
24
- * own catalogs' components, what its modules added since (`addBlokComponents`),
25
- * and a global component a module drew over (it is the module's now).
44
+ * What a UI draws beyond the base catalog: every component of its catalog
45
+ * that is neither the language's own nor one of the base catalog's. Its own
46
+ * catalogs' components, and what its modules added since (`addBlokComponents`).
26
47
  */
27
- export const moduleComponentsOf = (catalog) => [...catalog.components.values()].filter(component => catalog.base?.components.get(component.name) !== component && component.origin?.includes('@') !== true);
48
+ export const ownComponentsOf = (catalog) => [...catalog.components.values()].filter(component => catalog.base?.components.get(component.name) !== component && component.origin !== BASE_CATALOG_REF);
28
49
  /**
29
- * A UI's module as the spec writes a catalog: for the language's default view
30
- * (`registerBlokModules([parseSpecCatalog(blokModuleSpec(...), ...)])`), so the
31
- * parser and the checks know the components only this UI draws.
50
+ * A UI's app catalog as the spec writes one (`{id, name, version, minor,
51
+ * extends, components}`): what it publishes at `id`, registers with the
52
+ * server, and hands the language (`setAppBlokCatalog(parseSpecCatalog(...))`)
53
+ * so its own parser, checks and editor know the components only it draws.
32
54
  */
33
- export const blokModuleSpec = (name, description, catalog) => ({
34
- name,
35
- description,
36
- components: moduleComponentsOf(catalog)
55
+ export const blokCatalogSpec = (meta, catalog) => ({
56
+ id: meta.id,
57
+ name: meta.name,
58
+ version: meta.version,
59
+ minor: meta.minor ?? 0,
60
+ extends: meta.extends ?? BASE_CATALOG_ADDRESS,
61
+ description: meta.description,
62
+ components: ownComponentsOf(catalog)
37
63
  .map(component => describeBlokComponent(component.name, component))
38
64
  .sort((left, right) => (left.name < right.name ? -1 : left.name > right.name ? 1 : 0)),
39
65
  });
@@ -1 +1 @@
1
- {"version":3,"file":"declare.js","sourceRoot":"","sources":["../../src/renderer/declare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC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AAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS,qBAAqB,KAAG,kBAcxH,CAAC"}
@@ -252,6 +252,17 @@ const strTest = (key, test) => args => {
252
252
  const other = str(args[key]);
253
253
  return value !== null && other !== null && test(value, other);
254
254
  };
255
+ /** What list.where keeps: the items whose `key` deep-equals `equals`, or is truthy when `equals` is left out. */
256
+ const matching = (args) => {
257
+ const key = optStr(args.key, '', 'key');
258
+ const any = isNull(args.equals);
259
+ return item => {
260
+ const found = readDotted(item, key).value;
261
+ return any ? truthy(found) : deepEqual(found, args.equals);
262
+ };
263
+ };
264
+ /** Key names as a list holds them. */
265
+ const keyNames = (value) => (list(value) ?? []).filter((key) => typeof key === 'string');
255
266
  const listOr = (fallback, operate) => args => {
256
267
  const value = list(args.value);
257
268
  return value === null ? fallback() : operate(value, args);
@@ -472,6 +483,10 @@ const IMPLEMENTATIONS = {
472
483
  })
473
484
  .map(entry => entry.item);
474
485
  }),
486
+ 'list.where': listOr(() => [], (value, args) => value.filter(matching(args))),
487
+ 'list.find': listOr(() => null, (value, args) => value.find(matching(args)) ?? null),
488
+ 'list.count': listOr(() => 0, (value, args) => value.filter(matching(args)).length),
489
+ 'list.concat': args => [...(list(args.value) ?? []), ...(list(args.other) ?? [])],
475
490
  'list.range': args => {
476
491
  const start = num(args.start);
477
492
  const end = num(args.end);
@@ -503,6 +518,15 @@ const IMPLEMENTATIONS = {
503
518
  const key = str(args.key);
504
519
  return key !== null && Object.prototype.hasOwnProperty.call(value, key);
505
520
  }),
521
+ 'obj.merge': args => ({ ...(dict(args.value) ?? {}), ...(dict(args.other) ?? {}) }),
522
+ 'obj.pick': dictOr(() => ({}), (value, args) => {
523
+ const keys = keyNames(args.keys);
524
+ return Object.fromEntries(Object.entries(value).filter(([key]) => keys.includes(key)));
525
+ }),
526
+ 'obj.omit': dictOr(() => ({}), (value, args) => {
527
+ const keys = keyNames(args.keys);
528
+ return Object.fromEntries(Object.entries(value).filter(([key]) => !keys.includes(key)));
529
+ }),
506
530
  'obj.keys': dictOr(() => [], value => Object.keys(value)),
507
531
  'obj.values': dictOr(() => [], value => Object.values(value)),
508
532
  'obj.entries': dictOr(() => [], value => Object.entries(value).map(([key, item]) => ({ key, value: item }))),
@@ -613,6 +637,21 @@ const IMPLEMENTATIONS = {
613
637
  const end = timeOf(args.end);
614
638
  return start === null || end === null ? null : (end - start) / 1000;
615
639
  },
640
+ 'time.add': args => {
641
+ const start = timeOf(args.value);
642
+ const seconds = num(args.seconds);
643
+ return start === null || seconds === null ? null : new Date(start + seconds * 1000).toISOString();
644
+ },
645
+ 'time.before': args => {
646
+ const a = timeOf(args.a);
647
+ const b = timeOf(args.b);
648
+ return a !== null && b !== null && a < b;
649
+ },
650
+ 'time.after': args => {
651
+ const a = timeOf(args.a);
652
+ const b = timeOf(args.b);
653
+ return a !== null && b !== null && a > b;
654
+ },
616
655
  };
617
656
  const build = () => {
618
657
  const functions = new Map();