feat(web): render bgm setups as a 3D table

Wire the tabletop library into the setup detail route: seed the store
from the setup, resolve the surface mount tree, and render world and HUD
surfaces. Add serializedToPackage to convert the vite-emitted package.
This commit is contained in:
2026-08-09 22:46:03 +08:00
parent cd08e6af04
commit f494a6f9be
6 changed files with 96 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Convert a serialized package (plain objects, as emitted by the bgm vite
* plugin) into a `Package` (Maps). Consumers that load a package from
* `virtual:bgm/*` get the serialized form; the tabletop components take the
* `Package` form.
*/
import type { Package, SerializedPackage } from '@tts/bgm';
export function serializedToPackage(serialized: SerializedPackage): Package {
return {
meta: serialized.meta,
parts: new Map(Object.entries(serialized.parts)),
surfaces: new Map(Object.entries(serialized.surfaces)),
setups: new Map(Object.entries(serialized.setups)),
};
}