feat(tabletop): add state, setup, mounting, and stacking

Implement the tabletop library's game state store, setup seeding with
bare-type expansion, surface mount tree resolution, part placement, and
the stacking positioning process with a dependency-free SVG path helper.
Wire the public API and add unit plus vite integration tests.
This commit is contained in:
2026-08-09 22:34:18 +08:00
parent ef0695ed04
commit cd08e6af04
20 changed files with 1281 additions and 11 deletions
+28 -1
View File
@@ -9,4 +9,31 @@ export {
traceToShape,
traceToUvBounds,
} from './part.js';
export { resolveAssetUrl, assetUrl, traceImage } from './http.js';
export { resolveAssetUrl, assetUrl, traceImage } from './http.js';
// State store + derived render state.
export {
useTabletopStore,
useRenderState,
matchRoute,
computeRenderState,
computeSurfacePlacements,
placementKey,
} from './state.js';
export type { GameState, Placement } from './state.js';
// Setup seeding.
export { SetupLoader, seedFromSetup, expandSetupValue } from './setup.js';
// Surface mounting.
export { resolveMountTree } from './mount.js';
export type { MountNode, MountTree } from './mount.js';
export { WorldSurfaceView, SurfaceNode } from './surfaces/WorldSurfaceView.js';
export { HudSurfaceView } from './surfaces/HudSurfaceView.js';
// Part placement.
export { PartPlacement } from './placement.js';
// Stacking.
export { useStacking, stackingOffset, parsePath, pointAt, NO_OFFSET } from './stacking.js';
export type { StackOffset } from './stacking.js';