topotopo 0.3.0 → 0.5.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 (354) hide show
  1. package/NOTICE +40 -10
  2. package/README.md +475 -111
  3. package/dist/cli.js +328 -133
  4. package/dist/config.d.ts +48 -0
  5. package/dist/config.js +170 -0
  6. package/dist/core/analysis.d.ts +5 -1
  7. package/dist/core/analysis.js +8 -3
  8. package/dist/core/bake.d.ts +16 -8
  9. package/dist/core/bake.js +165 -29
  10. package/dist/core/bevel.d.ts +3 -1
  11. package/dist/core/bevel.js +238 -97
  12. package/dist/core/decimate.d.ts +65 -0
  13. package/dist/core/decimate.js +409 -3
  14. package/dist/core/erosion.d.ts +37 -0
  15. package/dist/core/erosion.js +41 -1
  16. package/dist/core/geometry.d.ts +5 -1
  17. package/dist/core/geometry.js +204 -4
  18. package/dist/core/heightfield.d.ts +27 -4
  19. package/dist/core/heightfield.js +54 -16
  20. package/dist/core/imageops.d.ts +6 -0
  21. package/dist/core/imageops.js +51 -0
  22. package/dist/core/intrinsics.d.ts +7 -0
  23. package/dist/core/intrinsics.js +94 -0
  24. package/dist/core/manifold.d.ts +12 -1
  25. package/dist/core/manifold.js +78 -6
  26. package/dist/core/materials.d.ts +11 -0
  27. package/dist/core/materials.js +56 -0
  28. package/dist/core/noise.d.ts +9 -0
  29. package/dist/core/noise.js +10 -1
  30. package/dist/core/packed.js +11 -0
  31. package/dist/core/particles.d.ts +1 -1
  32. package/dist/core/particles.js +1 -1
  33. package/dist/core/polymerge.d.ts +21 -0
  34. package/dist/core/polymerge.js +327 -0
  35. package/dist/core/rbd.js +13 -1
  36. package/dist/core/repair.d.ts +2 -0
  37. package/dist/core/repair.js +2 -0
  38. package/dist/core/report.d.ts +70 -0
  39. package/dist/core/report.js +275 -0
  40. package/dist/core/scatter.d.ts +1 -1
  41. package/dist/core/scatter.js +1 -1
  42. package/dist/core/scene.d.ts +20 -0
  43. package/dist/core/scene.js +72 -0
  44. package/dist/core/sha256.d.ts +4 -0
  45. package/dist/core/sha256.js +69 -0
  46. package/dist/core/shapes.d.ts +3 -0
  47. package/dist/core/shapes.js +34 -0
  48. package/dist/core/snippet-lib.d.ts +15 -2
  49. package/dist/core/snippet-lib.js +40 -14
  50. package/dist/core/solidify.d.ts +38 -0
  51. package/dist/core/solidify.js +356 -0
  52. package/dist/core/tangents.d.ts +54 -0
  53. package/dist/core/tangents.js +218 -0
  54. package/dist/core/texcoord.d.ts +4 -0
  55. package/dist/core/texcoord.js +14 -0
  56. package/dist/core/texnoise.d.ts +6 -1
  57. package/dist/core/texnoise.js +6 -2
  58. package/dist/core/texsdf.d.ts +131 -0
  59. package/dist/core/texsdf.js +637 -0
  60. package/dist/core/texture.d.ts +163 -9
  61. package/dist/core/texture.js +844 -20
  62. package/dist/core/topology.d.ts +32 -0
  63. package/dist/core/topology.js +238 -7
  64. package/dist/core/traceimage.d.ts +7 -0
  65. package/dist/core/traceimage.js +221 -0
  66. package/dist/core/tritri.d.ts +5 -0
  67. package/dist/core/tritri.js +120 -0
  68. package/dist/core/unwrap.d.ts +72 -0
  69. package/dist/core/unwrap.js +800 -0
  70. package/dist/core/usercode.d.ts +27 -0
  71. package/dist/core/usercode.js +87 -0
  72. package/dist/core/uv.d.ts +15 -16
  73. package/dist/core/uv.js +36 -189
  74. package/dist/core/uvislands.d.ts +62 -0
  75. package/dist/core/uvislands.js +574 -0
  76. package/dist/core/uvoverlap.d.ts +58 -0
  77. package/dist/core/uvoverlap.js +220 -0
  78. package/dist/core/uvpack.d.ts +64 -0
  79. package/dist/core/uvpack.js +628 -0
  80. package/dist/core/uvreport.d.ts +127 -0
  81. package/dist/core/uvreport.js +372 -0
  82. package/dist/core/wrangle.d.ts +6 -1
  83. package/dist/core/wrangle.js +27 -16
  84. package/dist/core/xatlas.d.ts +16 -1
  85. package/dist/core/xatlas.js +95 -61
  86. package/dist/engines.d.ts +63 -0
  87. package/dist/engines.js +180 -0
  88. package/dist/explain.d.ts +4 -3
  89. package/dist/explain.js +129 -12
  90. package/dist/graph/engine.d.ts +92 -29
  91. package/dist/graph/engine.js +298 -148
  92. package/dist/graph/expr.d.ts +6 -3
  93. package/dist/graph/expr.js +18 -8
  94. package/dist/graph/outputs.d.ts +23 -0
  95. package/dist/graph/outputs.js +41 -0
  96. package/dist/graph/packages.d.ts +72 -0
  97. package/dist/graph/packages.js +261 -0
  98. package/dist/graph/parallel.d.ts +3 -1
  99. package/dist/graph/parallel.js +4 -1
  100. package/dist/graph/params.d.ts +6 -0
  101. package/dist/graph/params.js +34 -7
  102. package/dist/graph/scope.d.ts +55 -0
  103. package/dist/graph/scope.js +14 -0
  104. package/dist/graph/types.d.ts +75 -12
  105. package/dist/graph/types.js +4 -2
  106. package/dist/graph/vars.d.ts +16 -0
  107. package/dist/graph/vars.js +80 -0
  108. package/dist/host/artifacts.d.ts +10 -1
  109. package/dist/host/artifacts.js +37 -6
  110. package/dist/host/cook.d.ts +241 -0
  111. package/dist/host/cook.js +844 -0
  112. package/dist/host/export-targets.d.ts +42 -5
  113. package/dist/host/export-targets.js +72 -13
  114. package/dist/host/godot-commands.d.ts +4 -0
  115. package/dist/host/godot-commands.js +21 -0
  116. package/dist/host/godot.d.ts +183 -0
  117. package/dist/host/godot.js +916 -0
  118. package/dist/host/node.d.ts +12 -7
  119. package/dist/host/node.js +27 -9
  120. package/dist/host/pool.js +51 -2
  121. package/dist/host/sidecars.d.ts +8 -0
  122. package/dist/host/sidecars.js +50 -0
  123. package/dist/host/types.d.ts +19 -6
  124. package/dist/host/version.d.ts +1 -0
  125. package/dist/host/version.js +3 -0
  126. package/dist/host/worker.js +5 -2
  127. package/dist/index.d.ts +5 -3
  128. package/dist/index.js +3 -2
  129. package/dist/inspect.d.ts +84 -1
  130. package/dist/inspect.js +271 -24
  131. package/dist/io/common.d.ts +33 -5
  132. package/dist/io/export.js +2 -1
  133. package/dist/io/files.d.ts +23 -4
  134. package/dist/io/files.js +60 -8
  135. package/dist/io/gltf.js +355 -51
  136. package/dist/io/heightmap.d.ts +3 -0
  137. package/dist/io/heightmap.js +1 -0
  138. package/dist/io/import.js +10 -0
  139. package/dist/io/inspect-scene.d.ts +55 -0
  140. package/dist/io/inspect-scene.js +155 -0
  141. package/dist/io/kinds.d.ts +81 -0
  142. package/dist/io/kinds.js +163 -0
  143. package/dist/io/points.d.ts +2 -1
  144. package/dist/io/points.js +3 -1
  145. package/dist/io/sidecars.d.ts +24 -0
  146. package/dist/io/sidecars.js +57 -0
  147. package/dist/io/source.d.ts +65 -0
  148. package/dist/io/source.js +112 -0
  149. package/dist/io/targets.d.ts +47 -3
  150. package/dist/io/targets.js +149 -14
  151. package/dist/io/textures.js +21 -1
  152. package/dist/io/unreal.js +5 -1
  153. package/dist/mcp/docs.d.ts +10 -1
  154. package/dist/mcp/docs.js +816 -119
  155. package/dist/mcp/inputs.d.ts +12 -5
  156. package/dist/mcp/inputs.js +50 -13
  157. package/dist/mcp/server.js +70 -24
  158. package/dist/mcp/tools.d.ts +14 -7
  159. package/dist/mcp/tools.js +207 -108
  160. package/dist/mcp/verify.d.ts +2 -2
  161. package/dist/mcp/verify.js +1 -1
  162. package/dist/mcp/workspace.d.ts +15 -0
  163. package/dist/mcp/workspace.js +349 -0
  164. package/dist/nodes/attributes.js +198 -1
  165. package/dist/nodes/bake.js +207 -83
  166. package/dist/nodes/beam.d.ts +1 -0
  167. package/dist/nodes/beam.js +201 -0
  168. package/dist/nodes/bevel.js +54 -5
  169. package/dist/nodes/cloth.js +2 -0
  170. package/dist/nodes/code.js +22 -10
  171. package/dist/nodes/curves.js +440 -93
  172. package/dist/nodes/flow.js +53 -33
  173. package/dist/nodes/generate.js +13 -39
  174. package/dist/nodes/heightfield.js +248 -77
  175. package/dist/nodes/imageops.d.ts +1 -0
  176. package/dist/nodes/imageops.js +203 -0
  177. package/dist/nodes/index.d.ts +4 -0
  178. package/dist/nodes/index.js +4 -0
  179. package/dist/nodes/material.js +91 -23
  180. package/dist/nodes/measure.js +45 -18
  181. package/dist/nodes/particles.js +2 -0
  182. package/dist/nodes/pcg.js +6 -5
  183. package/dist/nodes/procedural.js +4 -3
  184. package/dist/nodes/rbd.js +1 -1
  185. package/dist/nodes/remesh.js +71 -15
  186. package/dist/nodes/scene.d.ts +1 -0
  187. package/dist/nodes/scene.js +55 -0
  188. package/dist/nodes/sdf.js +10 -5
  189. package/dist/nodes/solid.js +20 -5
  190. package/dist/nodes/solidify.d.ts +1 -0
  191. package/dist/nodes/solidify.js +52 -0
  192. package/dist/nodes/splines.d.ts +15 -1
  193. package/dist/nodes/splines.js +112 -105
  194. package/dist/nodes/texture.d.ts +21 -6
  195. package/dist/nodes/texture.js +1318 -185
  196. package/dist/nodes/topology.d.ts +7 -0
  197. package/dist/nodes/topology.js +133 -6
  198. package/dist/nodes/transform.js +11 -3
  199. package/dist/nodes/util.d.ts +1 -1
  200. package/dist/nodes/uv.js +192 -174
  201. package/dist/nodes/wasmcall.js +6 -2
  202. package/dist/open.d.ts +19 -0
  203. package/dist/open.js +12 -0
  204. package/dist/package.d.ts +288 -0
  205. package/dist/package.js +772 -0
  206. package/dist/packages/check.d.ts +32 -0
  207. package/dist/packages/check.js +169 -0
  208. package/dist/packages/commands.d.ts +57 -0
  209. package/dist/packages/commands.js +537 -0
  210. package/dist/packages/registry.d.ts +796 -0
  211. package/dist/packages/registry.js +2998 -0
  212. package/dist/packages/update.d.ts +124 -0
  213. package/dist/packages/update.js +476 -0
  214. package/dist/render/options.d.ts +2 -0
  215. package/dist/render/options.js +44 -5
  216. package/dist/render/pbr.d.ts +28 -0
  217. package/dist/render/pbr.js +378 -0
  218. package/dist/render/preview.d.ts +69 -0
  219. package/dist/render/preview.js +26 -0
  220. package/dist/render/raster.d.ts +78 -7
  221. package/dist/render/raster.js +600 -145
  222. package/dist/render/texview.d.ts +7 -1
  223. package/dist/render/texview.js +34 -2
  224. package/dist/scan.d.ts +61 -0
  225. package/dist/scan.js +228 -0
  226. package/dist/session.d.ts +311 -0
  227. package/dist/session.js +849 -0
  228. package/dist/viewer/app/api.js +48 -6
  229. package/dist/viewer/app/camera.js +1 -1
  230. package/dist/viewer/app/cooking.js +78 -0
  231. package/dist/viewer/app/embed.js +100 -0
  232. package/dist/viewer/app/export-popover.js +118 -16
  233. package/dist/viewer/app/grid.js +6 -2
  234. package/dist/viewer/app/guides.js +123 -1
  235. package/dist/viewer/app/keymap.js +7 -4
  236. package/dist/viewer/app/layers.js +5 -5
  237. package/dist/viewer/app/main.js +186 -53
  238. package/dist/viewer/app/markers.js +61 -1
  239. package/dist/viewer/app/outliner.js +72 -27
  240. package/dist/viewer/app/output-info.js +45 -0
  241. package/dist/viewer/app/outputs.css +147 -8
  242. package/dist/viewer/app/outputs.js +168 -54
  243. package/dist/viewer/app/packages.js +614 -0
  244. package/dist/viewer/app/props.js +177 -53
  245. package/dist/viewer/app/scene.js +35 -6
  246. package/dist/viewer/app/select.js +5 -4
  247. package/dist/viewer/app/selection.js +1 -1
  248. package/dist/viewer/app/status.js +12 -15
  249. package/dist/viewer/app/style.css +66 -8
  250. package/dist/viewer/app/units.js +1 -1
  251. package/dist/viewer/app/vars.js +48 -1
  252. package/dist/viewer/app/welcome.js +72 -0
  253. package/dist/viewer/graph-file.d.ts +62 -0
  254. package/dist/viewer/graph-file.js +175 -0
  255. package/dist/viewer/index.html +24 -11
  256. package/dist/viewer/json-edit.d.ts +13 -0
  257. package/dist/viewer/json-edit.js +274 -0
  258. package/dist/viewer/outputs.d.ts +49 -5
  259. package/dist/viewer/outputs.js +264 -56
  260. package/dist/viewer/packages.d.ts +121 -0
  261. package/dist/viewer/packages.js +584 -0
  262. package/dist/viewer/server.d.ts +24 -7
  263. package/dist/viewer/server.js +289 -31
  264. package/dist/web/app/web.css +419 -0
  265. package/dist/web/app/web.js +188 -0
  266. package/dist/web/bake.d.ts +34 -0
  267. package/dist/web/bake.js +153 -0
  268. package/dist/web/folder-page.d.ts +101 -0
  269. package/dist/web/folder-page.js +146 -0
  270. package/dist/web/folders.d.ts +280 -0
  271. package/dist/web/folders.js +970 -0
  272. package/dist/web/library.d.ts +91 -0
  273. package/dist/web/library.js +228 -0
  274. package/dist/web/markdown.d.ts +45 -0
  275. package/dist/web/markdown.js +677 -0
  276. package/dist/web/pages.d.ts +258 -0
  277. package/dist/web/pages.js +301 -0
  278. package/dist/web/server.d.ts +24 -0
  279. package/dist/web/server.js +1068 -0
  280. package/dist/workspace.d.ts +88 -105
  281. package/dist/workspace.js +359 -375
  282. package/integrations/godot/addons/topotopo/LICENSE +202 -0
  283. package/integrations/godot/addons/topotopo/README.md +57 -0
  284. package/integrations/godot/addons/topotopo/context_menu.gd +43 -0
  285. package/integrations/godot/addons/topotopo/dock.gd +266 -0
  286. package/integrations/godot/addons/topotopo/dock.tscn +72 -0
  287. package/integrations/godot/addons/topotopo/export_filter.gd +72 -0
  288. package/integrations/godot/addons/topotopo/gltf_instancing.gd +131 -0
  289. package/integrations/godot/addons/topotopo/icons/topotopo.svg +1 -0
  290. package/integrations/godot/addons/topotopo/inspector.gd +38 -0
  291. package/integrations/godot/addons/topotopo/instances_post_import.gd +111 -0
  292. package/integrations/godot/addons/topotopo/package.gd +23 -0
  293. package/integrations/godot/addons/topotopo/package_importer.gd +187 -0
  294. package/integrations/godot/addons/topotopo/plugin.cfg +7 -0
  295. package/integrations/godot/addons/topotopo/plugin.gd +970 -0
  296. package/integrations/godot/addons/topotopo/record.gd +435 -0
  297. package/integrations/godot/addons/topotopo/runner.gd +458 -0
  298. package/integrations/godot/addons/topotopo/tools/check.gd +42 -0
  299. package/integrations/godot/addons/topotopo/watcher.gd +199 -0
  300. package/kernels/pkg/README.md +23 -29
  301. package/kernels/pkg-simd/README.md +23 -29
  302. package/library/architecture/versions/1.0/architecture.topo +12 -0
  303. package/{shelf → library/architecture/versions/1.0/graphs}/arch.json +3 -3
  304. package/{shelf → library/architecture/versions/1.0/graphs}/beam_truss.json +6 -6
  305. package/{shelf → library/architecture/versions/1.0/graphs}/brick_wall.json +8 -8
  306. package/{shelf → library/architecture/versions/1.0/graphs}/door_frame.json +3 -3
  307. package/{shelf → library/architecture/versions/1.0/graphs}/hex_grid_floor.json +3 -2
  308. package/{shelf → library/architecture/versions/1.0/graphs}/house.json +8 -8
  309. package/library/architecture/versions/1.0/graphs/lineup.json +42 -0
  310. package/{shelf → library/architecture/versions/1.0/graphs}/pillar.json +3 -2
  311. package/{shelf → library/architecture/versions/1.0/graphs}/railing.json +5 -5
  312. package/{shelf → library/architecture/versions/1.0/graphs}/roof_gable.json +2 -2
  313. package/{shelf → library/architecture/versions/1.0/graphs}/roof_hip.json +2 -2
  314. package/{shelf → library/architecture/versions/1.0/graphs}/roof_skeleton.json +2 -1
  315. package/{shelf → library/architecture/versions/1.0/graphs}/scaffold.json +4 -4
  316. package/{shelf → library/architecture/versions/1.0/graphs}/spiral_stairs.json +3 -2
  317. package/{shelf → library/architecture/versions/1.0/graphs}/stairs.json +6 -6
  318. package/{shelf → library/architecture/versions/1.0/graphs}/tile_floor.json +3 -2
  319. package/{shelf → library/architecture/versions/1.0/graphs}/wall_segment.json +10 -10
  320. package/{shelf → library/architecture/versions/1.0/graphs}/window_frame.json +2 -2
  321. package/library/architecture/versions/1.0/version.json +1119 -0
  322. package/{shelf → library/nature/versions/1.0/graphs}/bush.json +2 -2
  323. package/{shelf → library/nature/versions/1.0/graphs}/cliff_block.json +4 -3
  324. package/{shelf → library/nature/versions/1.0/graphs}/forest_patch.json +5 -5
  325. package/{shelf → library/nature/versions/1.0/graphs}/grass_clumps.json +2 -2
  326. package/library/nature/versions/1.0/graphs/lineup.json +24 -0
  327. package/{shelf → library/nature/versions/1.0/graphs}/log.json +6 -6
  328. package/{shelf → library/nature/versions/1.0/graphs}/rock.json +5 -4
  329. package/{shelf → library/nature/versions/1.0/graphs}/scatter_rocks.json +5 -5
  330. package/{shelf → library/nature/versions/1.0/graphs}/tree_lowpoly.json +3 -2
  331. package/library/nature/versions/1.0/nature.topo +12 -0
  332. package/library/nature/versions/1.0/version.json +534 -0
  333. package/{shelf → library/props/versions/1.0/graphs}/barrel.json +5 -4
  334. package/{shelf → library/props/versions/1.0/graphs}/crate.json +3 -3
  335. package/library/props/versions/1.0/graphs/lineup.json +18 -0
  336. package/{shelf → library/props/versions/1.0/graphs}/pallet.json +4 -3
  337. package/{shelf → library/props/versions/1.0/graphs}/pipe_run.json +3 -3
  338. package/{shelf → library/props/versions/1.0/graphs}/sandbag_wall.json +5 -5
  339. package/library/props/versions/1.0/props.topo +12 -0
  340. package/library/props/versions/1.0/version.json +336 -0
  341. package/{shelf → library/street/versions/1.0/graphs}/bench.json +5 -5
  342. package/{shelf → library/street/versions/1.0/graphs}/bollard.json +2 -1
  343. package/{shelf → library/street/versions/1.0/graphs}/cable.json +4 -4
  344. package/{shelf → library/street/versions/1.0/graphs}/fence.json +7 -7
  345. package/{shelf → library/street/versions/1.0/graphs}/lamp_post.json +2 -2
  346. package/library/street/versions/1.0/graphs/lineup.json +22 -0
  347. package/{shelf → library/street/versions/1.0/graphs}/road_strip.json +2 -2
  348. package/{shelf → library/street/versions/1.0/graphs}/sign_post.json +1 -1
  349. package/library/street/versions/1.0/street.topo +12 -0
  350. package/library/street/versions/1.0/version.json +421 -0
  351. package/package.json +23 -8
  352. package/dist/graph/migrate.d.ts +0 -23
  353. package/dist/graph/migrate.js +0 -58
  354. package/shelf/index.json +0 -190
@@ -0,0 +1,419 @@
1
+ /* The web app's pages (src/web/pages.ts, folder-page.ts): the viewer's neutral dark editor colours and its amber
2
+ accent. The front page's workspace and library cards, a folder page's flags, package, notes as documents, folder
3
+ cards and files by type, and the viewer dialog. One column on a phone. */
4
+ :root {
5
+ --bg: #1f2124; --panel: #26282c; --panel2: #2c2f33; --line: #3a3d42; --text: #d6d9dd; --dim: #8c939b; --faint: #5d636b;
6
+ --view: #2b2d31; --accent: #f0a030; --accent-bg: rgba(240, 160, 48, 0.12); --err: #e5675f; --err-bg: rgba(229, 103, 95, 0.1); --ok: #8fbf7f;
7
+ --font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
8
+ --mono: 12px/1.4 ui-monospace, Consolas, "SF Mono", monospace;
9
+ --read: 15px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
10
+ --radius: 8px;
11
+ --cube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%23f0a030' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M24 5 41 14v20L24 43 7 34V14z'/%3E%3Cpath d='M7 14l17 9 17-9M24 23v20' stroke-opacity='.6'/%3E%3C/svg%3E");
12
+ --dl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
13
+ /* what an inline link in a note leads to: a folder, a package or model, a picture, a sound, a video */
14
+ --i-dir: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 6.5A1.5 1.5 0 0 1 4.5 5H9l2 2h8.5A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z'/%3E%3C/svg%3E");
15
+ --i-cube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E");
16
+ --i-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 16l5-5 4 4 3-3 6 6'/%3E%3C/svg%3E");
17
+ --i-audio: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7'/%3E%3C/svg%3E");
18
+ --i-video: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M10 9l5 3-5 3z'/%3E%3C/svg%3E");
19
+ color-scheme: dark;
20
+ }
21
+ * { box-sizing: border-box; }
22
+ [hidden] { display: none !important; }
23
+ html, body { margin: 0; background: var(--bg); color: var(--text); font: var(--font); }
24
+ body { overflow-x: hidden; }
25
+ a { color: inherit; }
26
+ code, pre { font: var(--mono); }
27
+ h1, h2, h3 { font-weight: 600; line-height: 1.2; }
28
+ h1 { font-size: 28px; margin: 0; letter-spacing: -0.01em; }
29
+ h2 { font-size: 15px; margin: 32px 0 12px; color: var(--text); }
30
+ h3 { font-size: 13px; margin: 18px 0 8px; color: var(--dim); font-weight: 500; }
31
+ .count { color: var(--faint); font-weight: 400; font-size: 0.9em; margin-left: 4px; }
32
+ .dim { color: var(--dim); }
33
+ .small { font-size: 12px; }
34
+ .empty { color: var(--dim); }
35
+ .btn { display: inline-block; padding: 6px 12px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
36
+ .btn:hover { border-color: var(--faint); }
37
+ .btn.primary { border-color: var(--accent); color: var(--accent); }
38
+ .btn.ghost { background: transparent; color: var(--dim); }
39
+ .btn.ghost:hover { color: var(--text); }
40
+ .btn:disabled { opacity: 0.5; cursor: default; }
41
+ :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
42
+
43
+ /* the bar */
44
+ .bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
45
+ .brand { text-decoration: none; color: var(--dim); white-space: nowrap; }
46
+ .brand b { color: var(--text); font-weight: 650; letter-spacing: 0.01em; }
47
+ .news { color: var(--dim); font-size: 12px; white-space: nowrap; }
48
+ .crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: none; color: var(--dim); }
49
+ .crumbs::-webkit-scrollbar { display: none; }
50
+ .crumbs a { color: var(--dim); text-decoration: none; }
51
+ .crumbs a:hover { color: var(--text); text-decoration: underline; }
52
+ .crumbs .sep { color: var(--faint); }
53
+ .crumbs [aria-current] { color: var(--text); }
54
+ #search { flex: 1; max-width: 460px; margin-left: auto; padding: 7px 11px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; }
55
+ #search:focus { outline: 1px solid var(--faint); }
56
+ #clear { padding: 5px 10px; }
57
+
58
+ .wrap { max-width: 1440px; margin: 0 auto; padding: 8px 24px 64px; }
59
+ .problems { margin: 18px 0 0; padding: 8px 12px; border: 1px solid var(--err); border-radius: 6px; color: var(--err); }
60
+ .problems ul { margin: 6px 0 0; padding-left: 18px; color: var(--text); font: var(--mono); }
61
+
62
+ /* pictures as one tile: one, two, three or four */
63
+ .mosaic { display: grid; gap: 2px; aspect-ratio: 4 / 3; background: var(--view); overflow: hidden; }
64
+ .mosaic img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; background: var(--view); }
65
+ .mosaic.m2 { grid-template-columns: 1fr 1fr; }
66
+ .mosaic.m3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
67
+ .mosaic.m3 img:first-child { grid-row: span 2; }
68
+ .mosaic.m4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
69
+ .mosaic.m0 { place-items: center; background: linear-gradient(135deg, #2c2f33, #24262a); }
70
+ .mono { font: 600 28px/1 system-ui, sans-serif; letter-spacing: 0.06em; color: var(--faint); }
71
+ .mosaic.icon { background-position: center; background-repeat: no-repeat; background-size: 30%; }
72
+ .mosaic.icon.dir { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%235d636b' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M5 12a3 3 0 0 1 3-3h10l4 4h18a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3z'/%3E%3Cpath d='M5 19h38'/%3E%3C/svg%3E"); }
73
+ .mosaic.icon.cube { background-image: var(--cube); }
74
+ .mosaic.engine .mono { font-size: 20px; color: var(--dim); letter-spacing: 0.02em; }
75
+
76
+ /* the front page: workspaces and libraries as cards */
77
+ .roots h2 { font-size: 18px; margin-top: 32px; }
78
+ .rgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
79
+ .rgrid.big { grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); gap: 20px; }
80
+ .rcard { display: flex; flex-direction: column; min-width: 0; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.12s; }
81
+ .rcard:hover { border-color: var(--faint); }
82
+ .rcard .mosaic { aspect-ratio: 16 / 9; }
83
+ .rcard.ws { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
84
+ .rcard.ws .mosaic { aspect-ratio: auto; min-height: 220px; height: 100%; }
85
+ .rbody { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; min-width: 0; }
86
+ .rcard.ws .rbody { padding: 20px 22px; justify-content: center; }
87
+ .rsub { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
88
+ .rtitle { font-size: 18px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
89
+ .rcard.ws .rtitle { font-size: 24px; }
90
+ .stats { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--dim); font-size: 12px; margin-top: 6px; }
91
+ /* a workspace's four figures stay on one row at every width: smaller figures before a second row */
92
+ .rcard.ws .stats { flex-wrap: nowrap; gap: 6px 16px; }
93
+ .stat { display: flex; flex-direction: column; line-height: 1.2; }
94
+ .stat b { color: var(--text); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
95
+ .rcard.ws .stat b { font-size: clamp(18px, 1.6vw, 24px); }
96
+ .stat.fstat b, .stat.fstat span { color: var(--accent); }
97
+ .stat.ok b { color: var(--ok); }
98
+ .rprob { color: var(--err); font-size: 12px; }
99
+ .rcut { color: var(--accent); font-size: 12px; }
100
+ .path { color: var(--faint); font: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
101
+
102
+ /* package cards (the search's results) */
103
+ .grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
104
+ .card { display: flex; flex-direction: column; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
105
+ .card:hover { border-color: var(--faint); }
106
+ .thumb { display: block; aspect-ratio: 1; background: var(--view); }
107
+ .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
108
+ .meta { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; min-width: 0; }
109
+ .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
110
+ .sub { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
111
+ .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
112
+ .tag { padding: 0 6px; border-radius: 3px; background: var(--panel2); color: var(--dim); font-size: 11px; line-height: 18px; }
113
+ .status { font-size: 11px; color: var(--dim); }
114
+ .status:empty { display: none; }
115
+ .pkg { align-self: flex-start; max-width: 100%; padding: 0 6px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); font: var(--mono); font-size: 11px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
116
+ .kind { padding: 0 6px; border: 1px solid var(--faint); border-radius: 3px; color: var(--text); font-size: 11px; line-height: 16px; }
117
+ .outs { display: flex; flex-direction: column; gap: 3px; }
118
+ .outs:not(:has(.out:not([hidden]))) { display: none; }
119
+ .out { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; font-size: 11px; color: var(--dim); }
120
+ .out code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
121
+ .upd { align-self: flex-start; font-size: 11px; color: var(--accent); }
122
+ .s-failed { color: var(--err); }
123
+ .s-empty { color: var(--dim); font-style: italic; }
124
+ .s-baking { color: var(--accent); }
125
+
126
+ /* a folder page: its head, a notice, its flags */
127
+ .folder .head { padding: 26px 0 6px; }
128
+ .kicker { margin: 0 0 6px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
129
+ .hstats { margin: 8px 0 0; color: var(--dim); }
130
+ .notice { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid var(--faint); background: var(--panel); border-radius: 0 6px 6px 0; color: var(--dim); }
131
+ .flags { margin: 20px 0 0; padding: 14px 18px 12px; background: var(--accent-bg); border: 1px solid rgba(240, 160, 48, 0.35); border-radius: var(--radius); }
132
+ .flags h2 { margin: 0 0 10px; color: var(--accent); font-size: 15px; }
133
+ .flags .count { color: var(--dim); }
134
+ .flaglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
135
+ .flag { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
136
+ .fkind { grid-row: span 2; justify-self: start; padding: 1px 7px; border-radius: 3px; background: rgba(240, 160, 48, 0.18); color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
137
+ .f-bake .fkind, .f-link .fkind, .f-workspace .fkind { background: var(--err-bg); color: var(--err); }
138
+ .fwhat { overflow-wrap: anywhere; }
139
+ .ftodo { color: var(--dim); font-size: 13px; }
140
+ .ftodo::before { content: "→ "; color: var(--faint); }
141
+ .below { margin-top: 10px; }
142
+ .below summary { cursor: pointer; color: var(--dim); font-size: 13px; }
143
+ .fgroup { margin: 12px 0 0 2px; }
144
+ .fat { display: inline-block; margin-bottom: 6px; font: var(--mono); color: var(--text); }
145
+
146
+ /* a package on its folder page */
147
+ .pkgblock { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 360px; margin-top: 24px; }
148
+ .stage { position: relative; min-width: 0; }
149
+ .view { display: block; width: 100%; aspect-ratio: 16 / 10; max-height: 64vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--view); object-fit: contain; }
150
+ /* a preview picture at its own shape and size, never stretched into the 3D view's frame */
151
+ img.view.pic { width: auto; height: auto; max-width: 100%; aspect-ratio: auto; margin: 0 auto; }
152
+ /* no preview yet: a short frame that says so */
153
+ .view.none { aspect-ratio: auto; height: auto; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; border-style: dashed; color: var(--dim); text-align: center; }
154
+ .view.none .cube { width: 56px; height: 42px; background-size: 70%; }
155
+ .view.none p { margin: 0; }
156
+ /* a bake that failed: the last good preview, dimmed and marked */
157
+ .stage.old .view { opacity: 0.55; }
158
+ .oldmark { position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 4px 10px; border-radius: 4px; background: rgba(31, 33, 36, 0.92); border: 1px solid var(--err); color: var(--err); font-size: 13px; }
159
+ .info { min-width: 0; }
160
+ .pkgline { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--dim); font-size: 13px; }
161
+ .desc { white-space: pre-line; margin: 0 0 12px; font: var(--read); font-size: 14px; }
162
+ .links { margin: 10px 0; padding-left: 18px; }
163
+ .links a { color: var(--accent); }
164
+ .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
165
+ .bake { color: var(--dim); font-size: 12px; margin: 6px 0; }
166
+ .bake.err { color: var(--err); }
167
+ .bake.empty { color: var(--text); }
168
+ pre.error, .warn pre { margin: 6px 0; padding: 8px; max-height: 200px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; white-space: pre-wrap; }
169
+ pre.error { color: var(--err); }
170
+ .warn summary, .board summary { color: var(--dim); font-size: 12px; cursor: pointer; margin: 8px 0 6px; }
171
+ .warn summary { color: var(--accent); }
172
+ .copy { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 6px; margin: 0 0 6px; }
173
+ .copy span { color: var(--dim); font-size: 12px; }
174
+ .copy input { min-width: 0; padding: 4px 6px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: var(--mono); }
175
+ .copy button { padding: 4px 10px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
176
+ .copy button.done { color: var(--ok); border-color: var(--ok); }
177
+ .pkgmore { margin-top: 8px; }
178
+ .othumb { display: block; width: 96px; height: 96px; margin-bottom: 4px; background: var(--view); border-radius: 4px; object-fit: cover; }
179
+ .versions { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
180
+ .version { border-bottom: 1px solid var(--line); }
181
+ .version > summary { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; cursor: pointer; font-size: 13px; }
182
+ .version > summary .vn { flex: 0 0 48px; font: var(--mono); }
183
+ .version > summary .vd { flex: none; color: var(--dim); font: var(--mono); font-size: 11px; }
184
+ .version > summary .vt { flex: 1; min-width: 0; }
185
+ .version > summary:hover { color: var(--accent); }
186
+ .vouts { margin: 2px 0 8px; padding-left: 64px; font-size: 12px; }
187
+ .vouts li { margin: 2px 0; }
188
+ .vouts .tags { display: inline-flex; margin-left: 6px; }
189
+ .pkgcols { display: grid; gap: 0 40px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
190
+ .pkgcols.solo { grid-template-columns: minmax(0, 1fr); }
191
+ .graphs { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
192
+ .graph { border-bottom: 1px solid var(--line); }
193
+ .graph > summary { padding: 6px 0; cursor: pointer; font-size: 13px; }
194
+ .graph > summary:hover b { color: var(--accent); }
195
+ .graph table { margin: 0 0 10px; }
196
+ .allatt { margin-top: 10px; }
197
+ .allatt > summary { cursor: pointer; color: var(--dim); font-size: 13px; margin-bottom: 10px; }
198
+ .table { max-width: 100%; overflow-x: auto; }
199
+ .vars { width: 100%; border-collapse: collapse; font-size: 13px; }
200
+ .vars th, .vars td { text-align: left; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
201
+ .vars th { font-weight: 500; white-space: nowrap; }
202
+ .vars td:nth-child(2) { font: var(--mono); white-space: nowrap; }
203
+ .range { color: var(--faint); }
204
+ .uses th { font: var(--mono); }
205
+ /* what a version in use says: one line (the whole note on hover and on the package's page) */
206
+ .uses td.unotes { width: 100%; max-width: 0; }
207
+ .urow { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
208
+ .udate { flex: none; color: var(--dim); font: var(--mono); font-size: 11px; }
209
+ .unote { flex: 1; min-width: 0; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
210
+ .urow .newer { flex: none; }
211
+ .outputs th code, .outputs th .dim { white-space: nowrap; }
212
+ .outputs td:nth-child(2) { font: var(--font); font-size: 13px; }
213
+ td .tags { margin-top: 4px; }
214
+ .uses a { color: var(--accent); }
215
+ .newer { color: var(--accent); }
216
+ .flist { list-style: none; margin: 0; padding: 0; }
217
+ .flist li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
218
+ .flist li > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
219
+ .flist li > span:last-child { color: var(--dim); font-size: 12px; white-space: nowrap; }
220
+ .stale { padding: 0 6px; border-radius: 3px; background: var(--accent-bg); color: var(--accent); font-size: 11px; white-space: nowrap; }
221
+ .made { color: var(--dim); font-size: 11px; margin-left: 8px; }
222
+
223
+ /* notes: each file a box that reads like a document; a long one folds at --clip, with a Show all */
224
+ .notes { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 600px), 1fr)); align-items: start; margin-top: 24px; }
225
+ .notes.one { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
226
+ .notes.short.many { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
227
+ /* a note opened whole among several reads across the row */
228
+ .notes.many .note.open { grid-column: 1 / -1; }
229
+ .morenotes { grid-column: 1 / -1; margin: 0; }
230
+ .note { --clip: 820px; position: relative; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
231
+ .notes.many .note { --clip: 500px; }
232
+ .notes.short .note { --clip: 320px; }
233
+ .note > header { padding: 9px 18px; border-bottom: 1px solid var(--line); }
234
+ .note > header a { color: var(--dim); font: var(--mono); text-decoration: none; }
235
+ .note > header a:hover { color: var(--accent); }
236
+ .note > p.dim { padding: 14px 22px; margin: 0; }
237
+ /* text keeps a reading width; tables, pictures and players may use the whole box */
238
+ .md { padding: 6px 24px 18px; font: var(--read); overflow-wrap: break-word; }
239
+ .md > :where(:not(.table, .lblocks, .props, pre)) { max-width: 78ch; }
240
+ .notes.one .md > * { max-width: none; }
241
+ .note.clip .md { max-height: var(--clip); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
242
+ /* one note with pictures: the pictures beside it on a wide screen */
243
+ .split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; align-items: start; }
244
+ .split .notes.one { max-width: 860px; }
245
+ @media (min-width: 1280px) {
246
+ .split { grid-template-columns: minmax(0, 860px) minmax(0, 1fr); }
247
+ .split .notes.short .note { --clip: 820px; }
248
+ .split .side h2 { margin-top: 24px; }
249
+ .split .side .igrid.few { grid-template-columns: minmax(0, 1fr); }
250
+ }
251
+ .note .more { display: block; margin: -4px auto 14px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
252
+ .note .more:hover { border-color: var(--accent); color: var(--accent); }
253
+ .md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.3em 0 0.5em; color: var(--text); line-height: 1.25; font-weight: 650; }
254
+ .md h1 { font-size: 24px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16px; } .md h4, .md h5, .md h6 { font-size: 15px; color: var(--dim); }
255
+ .md > :first-child { margin-top: 0.8em; }
256
+ .md p, .md ul, .md ol, .md blockquote, .md pre, .md .table { margin: 0.7em 0; }
257
+ .md ul, .md ol { padding-left: 1.5em; }
258
+ .md li { margin: 0.2em 0; }
259
+ .md li.task { list-style: none; margin-left: -1.3em; }
260
+ .md a { color: var(--accent); text-underline-offset: 2px; }
261
+ .md code { padding: 1px 5px; border-radius: 4px; background: var(--panel2); font-size: 0.86em; }
262
+ .md pre { padding: 12px 14px; border-radius: 6px; background: #1b1d20; border: 1px solid var(--line); overflow-x: auto; }
263
+ .md pre code { padding: 0; background: none; font-size: 12.5px; line-height: 1.5; }
264
+ .md blockquote { padding: 2px 0 2px 16px; border-left: 3px solid var(--faint); color: var(--dim); }
265
+ .md hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
266
+ .md table { border-collapse: collapse; font-size: 14px; }
267
+ .md th, .md td { padding: 6px 12px; border: 1px solid var(--line); vertical-align: top; }
268
+ .md th.n, .md td.n { white-space: nowrap; }
269
+ /* front matter: the note's properties, small, above it */
270
+ .md .props { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 14px; margin: 0.9em 0 1.1em; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); font: var(--font); font-size: 13px; }
271
+ .md .props > div { display: contents; }
272
+ .md .props dt { color: var(--dim); font: var(--mono); font-size: 12px; line-height: 1.6; }
273
+ .md .props dd { margin: 0; overflow-wrap: anywhere; }
274
+ .md th { background: var(--panel2); font-weight: 600; }
275
+ .md img { max-width: 100%; height: auto; border-radius: 6px; vertical-align: middle; }
276
+ .md .limg { display: inline-block; max-width: 100%; }
277
+ /* an inline link marked by what it leads to */
278
+ .md .lk::before { content: ""; display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.25em; vertical-align: -0.12em; background: currentColor; -webkit-mask: var(--i-dir) center / contain no-repeat; mask: var(--i-dir) center / contain no-repeat; }
279
+ .md .lk-pkg::before, .md .lk-model::before { -webkit-mask-image: var(--i-cube); mask-image: var(--i-cube); }
280
+ .md .lk-img::before { -webkit-mask-image: var(--i-img); mask-image: var(--i-img); }
281
+ .md .lk-audio::before { -webkit-mask-image: var(--i-audio); mask-image: var(--i-audio); }
282
+ .md .lk-video::before { -webkit-mask-image: var(--i-video); mask-image: var(--i-video); }
283
+ /* what a paragraph's links lead to, below it: cards and pictures side by side, players full width */
284
+ .md .lblocks { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; margin: 0.6em 0 0.9em; }
285
+ .md .lblocks > .embed { flex: 1 1 100%; margin: 0; }
286
+ .md .lblocks > .lcard, .md .lblocks > .lmodel { margin: 0; }
287
+ .md .lfig { margin: 0; max-width: 100%; }
288
+ .md .lblocks > .lfig { flex: 0 1 auto; }
289
+ .md .lblocks > .lfig:only-child { flex-basis: 100%; }
290
+ .md .lfig figcaption { margin-top: 4px; color: var(--dim); font-size: 13px; }
291
+ .md .lblocks > .lfig:not(:only-child) img { max-height: 260px; width: auto; }
292
+ .md s.missing { color: var(--err); text-decoration-thickness: 1.5px; cursor: help; }
293
+ .md .lnk-text { border-bottom: 1px dotted var(--faint); cursor: help; }
294
+ pre.txt { margin: 0.6em 0; white-space: pre-wrap; font: var(--mono); font-size: 13px; line-height: 1.6; color: var(--text); background: none; border: 0; padding: 0; }
295
+ .md.txt { max-width: none; }
296
+ /* what a link leads to: a player, a card, a 3D view */
297
+ .md .embed { display: block; margin: 0.8em 0; max-width: 640px; }
298
+ .md .embed.web iframe, .md .embed.video video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; background: #000; }
299
+ .md .embed.audio { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
300
+ .md .embed.audio audio { width: 100%; height: 36px; }
301
+ .md .embed .cap { display: block; margin-top: 4px; color: var(--dim); font-size: 13px; }
302
+ .md .embed.audio .cap { margin: 0; color: var(--text); font-size: 13px; }
303
+ .lcard, .lmodel { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; margin: 4px 0; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--text); text-decoration: none; font: var(--font); vertical-align: middle; cursor: pointer; }
304
+ .md .lcard { color: var(--text); }
305
+ .lcard:hover, .lmodel:hover { border-color: var(--accent); }
306
+ .lcard img, .lcard-icon, .lmodel .cube { flex: none; width: 56px; height: 42px; border-radius: 4px; object-fit: cover; background-color: var(--view); }
307
+ .lcard-icon { background: var(--view) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='%238c939b' stroke-width='2.5' stroke-linejoin='round'%3E%3Cpath d='M5 12a3 3 0 0 1 3-3h10l4 4h18a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3z'/%3E%3C/svg%3E") center / 50% no-repeat; }
308
+ .lcard > span, .lmodel > span:last-child { display: flex; flex-direction: column; min-width: 0; text-align: left; }
309
+ .lcard b, .lmodel b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
310
+ .lcard span span, .lmodel span span { color: var(--dim); font-size: 12px; }
311
+ .cube { background: var(--view) var(--cube) center / 60% no-repeat; }
312
+
313
+ /* folders as cards */
314
+ .fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
315
+ .fcard { display: flex; flex-direction: column; min-width: 0; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.12s; }
316
+ .fcard:hover { border-color: var(--faint); }
317
+ .fcard .mosaic { aspect-ratio: 4 / 3; }
318
+ .fcard.k-engine { border-style: dashed; }
319
+ .fcard.k-engine .mosaic.m0 .mono { color: var(--dim); }
320
+ .fcard.k-package { border-color: #4a4335; }
321
+ .fcard.k-package:hover { border-color: var(--accent); }
322
+ .fbody { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px 11px; min-width: 0; }
323
+ .ftitle { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
324
+ .fname { color: var(--dim); font: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
325
+ .fsub { color: var(--dim); font-size: 12px; }
326
+ .fmarks { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 3px; }
327
+ .fmarks:empty { display: none; }
328
+ .kindmark { color: var(--dim); font-size: 11px; }
329
+ .k-package .kindmark { color: var(--accent); }
330
+ .fbadge { padding: 0 7px; border-radius: 999px; background: var(--accent-bg); color: var(--accent); border: 1px solid rgba(240, 160, 48, 0.4); font-size: 11px; line-height: 17px; white-space: nowrap; }
331
+ .empties { margin: 14px 0 0; font-size: 13px; line-height: 1.8; }
332
+ .empties a { color: var(--text); font: var(--mono); font-size: 12px; text-decoration: none; }
333
+ .empties a:hover { color: var(--accent); text-decoration: underline; }
334
+
335
+ /* files by type */
336
+ .igrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
337
+ .tile { display: flex; flex-direction: column; gap: 5px; min-width: 0; text-decoration: none; color: var(--dim); font-size: 12px; }
338
+ .tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--view); transition: border-color 0.12s; }
339
+ .tile:hover img { border-color: var(--accent); }
340
+ .igrid.few { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
341
+ .igrid.few .tile { font-size: 13px; }
342
+ .tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
343
+ .alist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
344
+ .arow { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(220px, 2fr) 52px 70px 28px; gap: 14px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
345
+ .aname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
346
+ .arow audio { width: 100%; height: 34px; }
347
+ .asize, .adur { color: var(--dim); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
348
+ .adur { color: var(--text); }
349
+ .dl { display: inline-block; width: 26px; height: 26px; border-radius: 4px; background: var(--dim); -webkit-mask: var(--dl) center / 16px no-repeat; mask: var(--dl) center / 16px no-repeat; font-size: 0; vertical-align: middle; }
350
+ .dl:hover { background: var(--accent); }
351
+ .vgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
352
+ .vtile { margin: 0; min-width: 0; }
353
+ .vtile video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; background: #000; border: 1px solid var(--line); }
354
+ .vtile figcaption { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 12px; }
355
+ .vtile figcaption span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
356
+ .mgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
357
+ .mtile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 0 8px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
358
+ .mtile .cube { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; border: 1px solid var(--line); background-size: 38%; transition: border-color 0.12s; }
359
+ .mtile:hover .cube { border-color: var(--accent); }
360
+ .mname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
361
+ .mtile .made { margin: 0; }
362
+ .mtile .stale { align-self: flex-start; }
363
+ .ax { display: inline-block; min-width: 38px; margin-right: 10px; padding: 0 5px; border-radius: 3px; background: var(--panel2); color: var(--dim); font: var(--mono); font-size: 10px; line-height: 18px; text-align: center; text-transform: uppercase; vertical-align: 1px; }
364
+ .ftable { width: 100%; border-collapse: collapse; font-size: 13px; }
365
+ .ftable td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
366
+ .ftable tr:first-child td { border-top: 1px solid var(--line); }
367
+ .ftable .fn { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
368
+ .ftable .fn a { text-decoration: none; }
369
+ .ftable .fn a:hover { color: var(--accent); text-decoration: underline; }
370
+ .ftable .fx { color: var(--faint); font: var(--mono); font-size: 11px; text-transform: uppercase; }
371
+ .ftable .fs, .ftable .fd { color: var(--dim); white-space: nowrap; font-size: 12px; }
372
+ .ftable .fdl { padding-right: 0; }
373
+ .engassets { margin: 10px 0 0; color: var(--dim); font-size: 13px; }
374
+ .foot { margin-top: 40px; color: var(--faint); font-size: 12px; overflow-wrap: anywhere; }
375
+ .foot code { font-size: 11px; }
376
+
377
+ /* a banner when the folder changed on disk */
378
+ .changed { position: fixed; left: 50%; bottom: 18px; z-index: 6; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--accent); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); font-size: 13px; }
379
+
380
+ /* the viewer: an image large, a model in 3D */
381
+ #viewer { width: min(96vw, 1600px); height: min(92vh, 1100px); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #17181b; color: var(--text); overflow: hidden; }
382
+ #viewer[open] { display: flex; flex-direction: column; }
383
+ #viewer::backdrop { background: rgba(10, 11, 12, 0.82); }
384
+ .vbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
385
+ .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--mono); font-size: 13px; }
386
+ .vbar a, .vbar button { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
387
+ .vbar button:hover, .vbar a:hover { border-color: var(--faint); }
388
+ .vbody { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--view); }
389
+ .vbody img { max-width: 100%; max-height: 100%; object-fit: contain; }
390
+ .vbody iframe { width: 100%; height: 100%; border: 0; }
391
+
392
+ @media (max-width: 900px) {
393
+ .pkgblock, .pkgcols { grid-template-columns: minmax(0, 1fr); }
394
+ .rcard.ws { display: flex; }
395
+ .rcard.ws .mosaic { aspect-ratio: 16 / 9; min-height: 0; height: auto; }
396
+ .rcard.ws .rbody { padding: 14px 16px 16px; }
397
+ }
398
+ @media (max-width: 640px) {
399
+ .wrap { padding: 4px 16px 48px; }
400
+ .bar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
401
+ .front .bar #search, #search { max-width: none; flex-basis: 100%; order: 3; margin: 0; }
402
+ .news { margin-left: auto; }
403
+ .crumbs { order: 3; flex-basis: 100%; }
404
+ .bar .btn.ghost { margin-left: auto; }
405
+ h1 { font-size: 23px; }
406
+ .rcard.ws .rtitle { font-size: 20px; }
407
+ .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
408
+ .fgrid, .igrid, .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
409
+ .flag { grid-template-columns: minmax(0, 1fr); }
410
+ .fkind { grid-row: auto; }
411
+ .md { padding: 4px 16px 14px; }
412
+ .note, .notes.many .note { --clip: 360px; }
413
+ .notes.short .note, .split .notes.short .note { --clip: 320px; }
414
+ .arow { grid-template-columns: minmax(0, 1fr) auto auto 28px; gap: 4px 10px; }
415
+ .arow audio { grid-column: 1 / -1; grid-row: 2; }
416
+ .unote { display: none; }
417
+ .ftable .fx, .ftable .fd { display: none; }
418
+ .vouts { padding-left: 16px; }
419
+ }
@@ -0,0 +1,188 @@
1
+ // The script of the web app's pages (src/web/pages.ts, folder-page.ts): the front page's search (packages by name,
2
+ // tag and the packages they use, their outputs by name, kind and tag; Escape or Clear ends it); on a folder page the
3
+ // long notes folded with a Show all (at the height the page's style gives each, --clip), a linked note or heading
4
+ // opened, each sound's length, the viewer (an image large with the folder's other images a key away, a model in 3D),
5
+ // copy buttons and actions; and live updates from the server's event stream (a bake finished, the folder changed).
6
+ const page = document.body.dataset.page;
7
+ const data = document.body.dataset.json ? JSON.parse(document.body.dataset.json) : {};
8
+ const $$ = (s, root = document) => [...root.querySelectorAll(s)];
9
+
10
+ if (page === 'front') {
11
+ const search = document.getElementById('search'), clear = document.getElementById('clear');
12
+ const results = document.getElementById('results'), found = document.getElementById('found');
13
+ const roots = $$('.roots');
14
+ const filter = () => {
15
+ const words = search.value.toLowerCase().split(/\s+/).filter(Boolean);
16
+ const on = words.length > 0;
17
+ let shown = 0;
18
+ for (const card of $$('.card')) {
19
+ const hay = card.dataset.hay;
20
+ // an output is found when every word is in it or in its package, and at least one in the output itself
21
+ const outs = $$('.out', card);
22
+ const hits = on ? outs.filter((o) => words.every((w) => o.dataset.hay.includes(w) || hay.includes(w)) && words.some((w) => o.dataset.hay.includes(w))) : [];
23
+ const ok = on && (words.every((w) => hay.includes(w)) || hits.length > 0);
24
+ for (const o of outs) o.hidden = !ok || !hits.includes(o);
25
+ card.hidden = !ok;
26
+ if (ok) shown++;
27
+ }
28
+ results.hidden = !on;
29
+ for (const r of roots) r.hidden = on;
30
+ found.textContent = on ? `${shown} of ${found.dataset.total}` : found.dataset.total;
31
+ clear.hidden = !on;
32
+ document.getElementById('nomatch').hidden = !on || shown > 0;
33
+ };
34
+ const reset = () => { search.value = ''; filter(); search.focus(); };
35
+ search.addEventListener('input', filter);
36
+ search.addEventListener('keydown', (e) => { if (e.key === 'Escape') reset(); });
37
+ clear.addEventListener('click', reset);
38
+ for (const b of $$('[data-clear]')) b.addEventListener('click', reset);
39
+ document.addEventListener('keydown', (e) => { if (e.key === '/' && document.activeElement !== search) { e.preventDefault(); search.focus(); } });
40
+ filter();
41
+ }
42
+
43
+ if (page === 'folder') {
44
+ // long notes fold, with a Show all: a note folds when it is clearly longer than its --clip
45
+ const folds = [];
46
+ for (const note of $$('.note')) {
47
+ const md = note.querySelector('.md'), more = note.querySelector('.more');
48
+ if (!md || !more) continue;
49
+ const fold = () => {
50
+ const clip = parseFloat(getComputedStyle(note).getPropertyValue('--clip')) || 820;
51
+ const long = md.scrollHeight > clip + Math.max(120, clip * 0.2);
52
+ if (note.classList.contains('open')) { more.hidden = !long; return; }
53
+ note.classList.toggle('clip', long);
54
+ more.hidden = !long;
55
+ };
56
+ folds.push(fold);
57
+ fold();
58
+ for (const m of $$('img, video', md)) m.addEventListener(m.tagName === 'IMG' ? 'load' : 'loadedmetadata', fold, { once: true });
59
+ more.addEventListener('click', () => {
60
+ const open = note.classList.toggle('open');
61
+ note.classList.toggle('clip', !open);
62
+ more.textContent = open ? 'Show less' : 'Show all';
63
+ if (!open) note.scrollIntoView({ block: 'nearest' });
64
+ });
65
+ }
66
+ let resized;
67
+ window.addEventListener('resize', () => { clearTimeout(resized); resized = setTimeout(() => folds.forEach((f) => f()), 150); });
68
+ // a link to a note on this page, or to a heading in one, opens that note and shows the place
69
+ const openNote = () => {
70
+ const el = location.hash && document.getElementById(decodeURIComponent(location.hash.slice(1)));
71
+ const note = el?.closest?.('.note');
72
+ if (!note) return;
73
+ if (note.classList.contains('clip')) note.querySelector('.more').click();
74
+ requestAnimationFrame(() => el.scrollIntoView({ block: 'start' }));
75
+ };
76
+ window.addEventListener('hashchange', openNote);
77
+ openNote();
78
+
79
+ // each sound's length beside its size, to the tenth of a second (the player's own clock rounds a short sound to 0:00)
80
+ const length = (s) => (s < 60 ? `${s.toFixed(1)} s` : `${Math.floor(s / 60)}:${String(Math.round(s % 60)).padStart(2, '0')}`);
81
+ for (const row of $$('.arow')) {
82
+ const a = row.querySelector('audio'), d = row.querySelector('.adur');
83
+ if (!a || !d) continue;
84
+ const put = () => { if (Number.isFinite(a.duration) && a.duration > 0) d.textContent = length(a.duration); };
85
+ a.addEventListener('loadedmetadata', put);
86
+ a.addEventListener('durationchange', put);
87
+ put();
88
+ }
89
+
90
+ // the viewer: images large (the arrows step through the page's images), models in 3D
91
+ const dlg = document.getElementById('viewer');
92
+ const body = dlg.querySelector('.vbody'), name = dlg.querySelector('.vname'), open = dlg.querySelector('.vopen');
93
+ const prev = dlg.querySelector('.vprev'), next = dlg.querySelector('.vnext');
94
+ let list = [], at = -1;
95
+ const show = (el) => {
96
+ const isModel = el.dataset.view === 'model';
97
+ body.replaceChildren();
98
+ if (isModel) {
99
+ const f = document.createElement('iframe');
100
+ f.src = el.dataset.src;
101
+ f.title = el.dataset.name;
102
+ f.allow = 'fullscreen';
103
+ body.append(f);
104
+ open.href = el.dataset.src;
105
+ } else {
106
+ const img = document.createElement('img');
107
+ img.src = el.getAttribute('href');
108
+ img.alt = el.dataset.name ?? '';
109
+ body.append(img);
110
+ open.href = el.getAttribute('href');
111
+ }
112
+ name.textContent = el.dataset.name ?? '';
113
+ list = isModel ? [el] : $$('[data-view="image"]');
114
+ at = list.indexOf(el);
115
+ prev.hidden = next.hidden = list.length < 2;
116
+ if (!dlg.open) dlg.showModal();
117
+ };
118
+ const step = (d) => { if (list.length > 1) show(list[(at + d + list.length) % list.length]); };
119
+ document.addEventListener('click', (e) => {
120
+ const el = e.target.closest?.('[data-view]');
121
+ if (!el || e.ctrlKey || e.metaKey || e.shiftKey || e.button !== 0) return;
122
+ e.preventDefault();
123
+ show(el);
124
+ });
125
+ prev.addEventListener('click', () => step(-1));
126
+ next.addEventListener('click', () => step(1));
127
+ dlg.querySelector('.vclose').addEventListener('click', () => dlg.close());
128
+ dlg.addEventListener('click', (e) => { if (e.target === dlg || e.target === body) dlg.close(); });
129
+ dlg.addEventListener('close', () => body.replaceChildren());
130
+ dlg.addEventListener('keydown', (e) => { if (e.key === 'ArrowLeft') step(-1); if (e.key === 'ArrowRight') step(1); });
131
+
132
+ // copy boxes and actions
133
+ for (const b of $$('[data-copy]')) {
134
+ b.addEventListener('click', async () => {
135
+ const input = b.previousElementSibling;
136
+ input.select();
137
+ try { await navigator.clipboard.writeText(input.value); } catch { document.execCommand('copy'); }
138
+ b.textContent = 'Copied';
139
+ b.classList.add('done');
140
+ setTimeout(() => { b.textContent = 'Copy'; b.classList.remove('done'); }, 1500);
141
+ });
142
+ }
143
+ for (const b of $$('[data-post]')) {
144
+ b.addEventListener('click', async () => {
145
+ b.disabled = true;
146
+ try {
147
+ const res = await fetch(b.dataset.post, { method: 'POST' });
148
+ const j = await res.json().catch(() => ({}));
149
+ if (/\/bake$/.test(b.dataset.post)) document.getElementById('bake').textContent = j.ok ? 'Baking…' : `Could not bake: ${j.error ?? res.status}`;
150
+ } finally { setTimeout(() => { b.disabled = false; }, 800); }
151
+ });
152
+ }
153
+ for (const b of $$('[data-reveal]')) b.addEventListener('click', () => fetch(data.reveal, { method: 'POST' }));
154
+ }
155
+
156
+ // live updates: the front page reloads when packages come or go; a folder page reloads when its package's bake
157
+ // finishes, and offers to when its folder changed on disk (not while something plays)
158
+ const playing = () => $$('audio, video').some((m) => !m.paused);
159
+ let banner = null;
160
+ const offerReload = () => {
161
+ if (banner) return;
162
+ banner = document.createElement('div');
163
+ banner.className = 'changed';
164
+ banner.innerHTML = '<span>This folder changed on disk.</span><button class="btn" type="button">Reload</button>';
165
+ banner.querySelector('button').addEventListener('click', () => location.reload());
166
+ document.body.append(banner);
167
+ };
168
+ const es = new EventSource('/api/events');
169
+ es.onmessage = (m) => {
170
+ let ev;
171
+ try { ev = JSON.parse(m.data); } catch { return; }
172
+ if (page === 'front') {
173
+ if (ev.list) location.reload();
174
+ else if (ev.package && !ev.baking) {
175
+ const card = document.querySelector(`.card[data-key="${CSS.escape(ev.package)}"]`);
176
+ const img = card?.querySelector('img');
177
+ if (img) img.src = img.src.replace(/(\?v=[^&]*)?$/, `?v=${ev.version}`);
178
+ }
179
+ } else if (page === 'folder') {
180
+ if (data.package && ev.package === data.package) {
181
+ if (ev.baking) { const b = document.getElementById('bake'); if (b) b.textContent = 'Baking…'; }
182
+ else if (playing()) offerReload(); else location.reload();
183
+ return;
184
+ }
185
+ const here = data.rel ? `${data.root}/${data.rel}` : data.root;
186
+ if (ev.folders?.some((f) => f === here || f.startsWith(`${here}/`) && !f.slice(here.length + 1).includes('/'))) offerReload();
187
+ }
188
+ };
@@ -0,0 +1,34 @@
1
+ import '../nodes/index.ts';
2
+ import type { BakeState } from './library.ts';
3
+ export declare const THUMB_SIZE = 512;
4
+ /** a preview.glb above this is not written (the page shows the thumbnail instead) */
5
+ export declare const MAX_PREVIEW_GLB: number;
6
+ /** a bake child is stopped after this */
7
+ export declare const BAKE_TIMEOUT_MS = 300000;
8
+ /** the simulation limit inside a bake child (the engine's default is 600 s per node) */
9
+ export declare const BAKE_SIM_TIMEOUT_MS = 120000;
10
+ /** Bake one package in this process. Never throws for a graph problem: the result (also in bake.json) says. */
11
+ export declare function bakePackage(dir: string): Promise<BakeState>;
12
+ export interface BakeQueueOptions {
13
+ /** called after each bake with the package folder and its new state (null: the child died without one) */
14
+ onDone?: (dir: string, state: BakeState | null) => void;
15
+ timeoutMs?: number;
16
+ log?: (msg: string) => void;
17
+ }
18
+ /** Bakes in child processes, one at a time, each package once however often it is asked for meanwhile. */
19
+ export declare class BakeQueue {
20
+ private queue;
21
+ private running;
22
+ private child;
23
+ private closed;
24
+ private opts;
25
+ constructor(opts?: BakeQueueOptions);
26
+ /** Ask for a bake; true when it was queued now (false: queued or running already). */
27
+ add(dir: string): boolean;
28
+ pending(dir: string): boolean;
29
+ get size(): number;
30
+ /** Resolves when nothing is queued or running. */
31
+ idle(): Promise<void>;
32
+ close(): void;
33
+ private next;
34
+ }