@celestia-island/hikari 0.55.102 → 0.55.104
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.
- package/package.json +1 -1
- package/src/board3dSurface.test.ts +31 -0
- package/src/components/HkBoard3D.test.tsx +693 -3
- package/src/components/HkBoard3D.tsx +292 -7
- package/src/components/board3dHoverBox.test.ts +200 -0
- package/src/components/board3dHoverBox.ts +210 -0
- package/src/index.ts +9 -1
- package/src/utils/scene3d.test.ts +69 -0
- package/src/utils/scene3d.ts +67 -0
package/package.json
CHANGED
|
@@ -52,6 +52,23 @@ describe("hikari barrel — 3D board surface", () => {
|
|
|
52
52
|
expect(barrel.BOARD3D_HELPERS_LAYER).toBe(1);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
it("exports the main-camera gizmo layer and the hover-frame geometry", () => {
|
|
56
|
+
// Consumers drawing their own main-camera-only affordance (and the
|
|
57
|
+
// tests pinning that the minimap never sees one) need the layer; the
|
|
58
|
+
// corner-bracket maths is shared so a bespoke frame matches the
|
|
59
|
+
// built-in one.
|
|
60
|
+
expect(barrel.BOARD3D_MAIN_LAYER).toBe(2);
|
|
61
|
+
expect(typeof barrel.hoverBoxSegments).toBe("function");
|
|
62
|
+
expect(barrel.hoverBoxSegments([1, 1, 1])).toHaveLength(48 * 3);
|
|
63
|
+
for (const name of [
|
|
64
|
+
"HOVER_BOX_ARM_RATIO",
|
|
65
|
+
"HOVER_BOX_PADDING",
|
|
66
|
+
"HOVER_BOX_MIN_EXTENT_RATIO",
|
|
67
|
+
] as const) {
|
|
68
|
+
expect(typeof (barrel as Record<string, unknown>)[name], name).toBe("number");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
55
72
|
it("exports the scene3d utilities (palette, orbit, fit, zoom)", () => {
|
|
56
73
|
const fns = [
|
|
57
74
|
"hashIdToUnit",
|
|
@@ -92,6 +109,20 @@ describe("hikari barrel — 3D board surface", () => {
|
|
|
92
109
|
expect(has).toBe(true);
|
|
93
110
|
});
|
|
94
111
|
|
|
112
|
+
it("pins the engine's selection surface", () => {
|
|
113
|
+
// `setSelection` is how a page keeps the 8-corner frame on its
|
|
114
|
+
// selected object (the fleet sky's cube cursor). Type-level probe:
|
|
115
|
+
// vue-tsc covers this file, so dropping the method breaks the gate
|
|
116
|
+
// rather than the consumer's build.
|
|
117
|
+
const engine = null as Engine | null;
|
|
118
|
+
void engine;
|
|
119
|
+
type HasSelection = Engine extends { setSelection(id: string | null): void }
|
|
120
|
+
? true
|
|
121
|
+
: false;
|
|
122
|
+
const has: HasSelection = true;
|
|
123
|
+
expect(has).toBe(true);
|
|
124
|
+
});
|
|
125
|
+
|
|
95
126
|
it("exports the minimap governance constants, drag sensitivity included", () => {
|
|
96
127
|
// A consumer writing its own drag control needs the same sensitivity
|
|
97
128
|
// the built-in one uses — it must not stay module-private.
|