@thoughts-on-things/vantage-mc 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.
- package/README.md +26 -5
- package/dist/{biome-CPP37ieY.d.ts → biome-NBWIY7dT.d.ts} +43 -13
- package/dist/{chunk-C7GIMQYZ.js → chunk-46RBFJ4D.js} +731 -78
- package/dist/{chunk-M6KVJXCR.js → chunk-EVPUXVSB.js} +46 -13
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/react/index.d.ts +29 -8
- package/dist/react/index.js +262 -22
- package/dist/three/index.d.ts +6 -6
- package/dist/three/index.js +2 -2
- package/dist/{viewer-GsEn9RpF.d.ts → viewer-C5vYxrL1.d.ts} +178 -11
- package/package.json +10 -6
|
@@ -18,7 +18,10 @@ var TILE_MAGIC = {
|
|
|
18
18
|
/** + a per-tile lightmap atlas: the greedy vertex tail samples baked
|
|
19
19
|
* light/AO from a texture instead of vertices, so lighting gradients no
|
|
20
20
|
* longer fragment greedy merges (~23% fewer vertices). */
|
|
21
|
-
VTL8: "VTL8"
|
|
21
|
+
VTL8: "VTL8",
|
|
22
|
+
/** VTL8 geometry + a losslessly packed RG8 lightmap (sky/block nibbles,
|
|
23
|
+
* full-byte AO), stored as gzip-friendly planes. */
|
|
24
|
+
VTL9: "VTL9"
|
|
22
25
|
};
|
|
23
26
|
var UV_SCALE = 128;
|
|
24
27
|
var TEXTURE_MAGIC = "VTA1";
|
|
@@ -295,7 +298,21 @@ function readLightmap(r) {
|
|
|
295
298
|
pixels[i * 4 + 2] = ao[i];
|
|
296
299
|
pixels[i * 4 + 3] = 255;
|
|
297
300
|
}
|
|
298
|
-
return { width, height, pixels };
|
|
301
|
+
return { width, height, packed: false, pixels };
|
|
302
|
+
}
|
|
303
|
+
function readPackedLightmap(r) {
|
|
304
|
+
const width = r.u32();
|
|
305
|
+
const height = r.u32();
|
|
306
|
+
const n = width * height;
|
|
307
|
+
if (n === 0) return void 0;
|
|
308
|
+
const light = r.u8a(n);
|
|
309
|
+
const ao = r.u8a(n);
|
|
310
|
+
const pixels = new Uint8Array(2 * n);
|
|
311
|
+
for (let i = 0; i < n; i++) {
|
|
312
|
+
pixels[i * 2] = light[i];
|
|
313
|
+
pixels[i * 2 + 1] = ao[i];
|
|
314
|
+
}
|
|
315
|
+
return { width, height, packed: true, pixels };
|
|
299
316
|
}
|
|
300
317
|
function expandSection(raw) {
|
|
301
318
|
const { vertexCount, indexCount } = raw;
|
|
@@ -340,24 +357,26 @@ function bakeVertexLight(sec, lm) {
|
|
|
340
357
|
const k = i - lmStart;
|
|
341
358
|
const u = lmuv[k * 2] - 1 >> 1;
|
|
342
359
|
const v = lmuv[k * 2 + 1] - 1 >> 1;
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
const
|
|
360
|
+
const texel = v * lm.width + u;
|
|
361
|
+
const o = texel * (lm.packed ? 2 : 4);
|
|
362
|
+
const packed = lm.packed ? lm.pixels[o] : 0;
|
|
363
|
+
const sky = lm.packed ? packed >> 4 : Math.round(lm.pixels[o] / 17);
|
|
364
|
+
const blk = lm.packed ? packed & 15 : Math.round(lm.pixels[o + 1] / 17);
|
|
346
365
|
light[i] = sky << 4 | blk;
|
|
347
|
-
colors[i * 4 + 3] = lm.pixels[o + 2];
|
|
366
|
+
colors[i * 4 + 3] = lm.pixels[o + (lm.packed ? 1 : 2)];
|
|
348
367
|
}
|
|
349
368
|
sec.colors = colors;
|
|
350
369
|
}
|
|
351
370
|
function parseTileQuantized(buffer) {
|
|
352
371
|
const r = new ByteReader(buffer);
|
|
353
372
|
const magic = r.magic();
|
|
354
|
-
if (magic !== TILE_MAGIC.VTL6 && magic !== TILE_MAGIC.VTL7 && magic !== TILE_MAGIC.VTL8) return null;
|
|
373
|
+
if (magic !== TILE_MAGIC.VTL6 && magic !== TILE_MAGIC.VTL7 && magic !== TILE_MAGIC.VTL8 && magic !== TILE_MAGIC.VTL9) return null;
|
|
355
374
|
r.off = 4;
|
|
356
375
|
const version = r.u32();
|
|
357
|
-
const readSection = magic === TILE_MAGIC.VTL8 ? readLitSectionRaw : magic === TILE_MAGIC.VTL7 ? readCompactSectionRaw : readQuantizedSectionRaw;
|
|
376
|
+
const readSection = magic === TILE_MAGIC.VTL8 || magic === TILE_MAGIC.VTL9 ? readLitSectionRaw : magic === TILE_MAGIC.VTL7 ? readCompactSectionRaw : readQuantizedSectionRaw;
|
|
358
377
|
const solid = readSection(r);
|
|
359
378
|
const fluid = readSection(r);
|
|
360
|
-
const lightmap = magic === TILE_MAGIC.VTL8 ? readLightmap(r) : void 0;
|
|
379
|
+
const lightmap = magic === TILE_MAGIC.VTL9 ? readPackedLightmap(r) : magic === TILE_MAGIC.VTL8 ? readLightmap(r) : void 0;
|
|
361
380
|
const surface = readSurface(r);
|
|
362
381
|
const biomeNames = readLegend(r);
|
|
363
382
|
return { magic, version, solid, fluid, surface, biomeNames, ...lightmap ? { lightmap } : {} };
|
|
@@ -387,10 +406,10 @@ function parseTile(buffer) {
|
|
|
387
406
|
const magic = r.magic();
|
|
388
407
|
r.off = 4;
|
|
389
408
|
const version = r.u32();
|
|
390
|
-
if (magic === TILE_MAGIC.VTL8) {
|
|
409
|
+
if (magic === TILE_MAGIC.VTL8 || magic === TILE_MAGIC.VTL9) {
|
|
391
410
|
const solid = expandSection(readLitSectionRaw(r));
|
|
392
411
|
const fluid = expandSection(readLitSectionRaw(r));
|
|
393
|
-
const lightmap = readLightmap(r);
|
|
412
|
+
const lightmap = magic === TILE_MAGIC.VTL9 ? readPackedLightmap(r) : readLightmap(r);
|
|
394
413
|
if (lightmap) bakeVertexLight(solid, lightmap);
|
|
395
414
|
const surface = readSurface(r);
|
|
396
415
|
const biomeNames = readLegend(r);
|
|
@@ -513,8 +532,8 @@ function parseManifest(data) {
|
|
|
513
532
|
if (typeof data !== "object" || data === null) throw new Error("vantage: manifest is not an object");
|
|
514
533
|
const m = data;
|
|
515
534
|
const format = m["format"];
|
|
516
|
-
if (format !== 1 && format !== 2 && format !== 3 && format !== 4) {
|
|
517
|
-
throw new Error(`vantage: unsupported manifest format ${String(format)} (expected 1..
|
|
535
|
+
if (format !== 1 && format !== 2 && format !== 3 && format !== 4 && format !== 5) {
|
|
536
|
+
throw new Error(`vantage: unsupported manifest format ${String(format)} (expected 1..5)`);
|
|
518
537
|
}
|
|
519
538
|
const tileChunks = m["tileChunks"];
|
|
520
539
|
const tileBlocks = m["tileBlocks"];
|
|
@@ -565,14 +584,28 @@ function parseManifest(data) {
|
|
|
565
584
|
if (typeof s === "object" && s !== null && typeof s["x"] === "number" && typeof s["y"] === "number" && typeof s["z"] === "number") {
|
|
566
585
|
spawn = { x: s["x"], y: s["y"], z: s["z"] };
|
|
567
586
|
}
|
|
587
|
+
let yRange;
|
|
588
|
+
const yr = m["yRange"];
|
|
589
|
+
if (typeof yr === "object" && yr !== null && typeof yr["min"] === "number" && typeof yr["max"] === "number" && yr["min"] < yr["max"]) {
|
|
590
|
+
yRange = { min: yr["min"], max: yr["max"] };
|
|
591
|
+
}
|
|
568
592
|
const maxSectionVerts = m["maxSectionVerts"];
|
|
593
|
+
const textureLayers = m["textureLayers"];
|
|
594
|
+
const pr = m["progress"];
|
|
595
|
+
const progress = typeof pr === "object" && pr !== null && typeof pr["done"] === "number" && typeof pr["total"] === "number" ? { done: pr["done"], total: pr["total"] } : void 0;
|
|
569
596
|
return {
|
|
570
597
|
format,
|
|
571
598
|
tileChunks,
|
|
572
599
|
tileBlocks,
|
|
573
600
|
textures,
|
|
574
601
|
...typeof maxSectionVerts === "number" && maxSectionVerts > 0 ? { maxSectionVerts } : {},
|
|
602
|
+
...typeof textureLayers === "number" && textureLayers > 0 ? { textureLayers } : {},
|
|
603
|
+
...m["rendering"] === true ? { rendering: true } : {},
|
|
604
|
+
...m["dynamic"] === true ? { dynamic: true } : {},
|
|
605
|
+
...progress ? { progress } : {},
|
|
575
606
|
...spawn ? { spawn } : {},
|
|
607
|
+
...m["caves"] === true ? { caves: true } : {},
|
|
608
|
+
...yRange ? { yRange } : {},
|
|
576
609
|
...lowres ? { lowres } : {},
|
|
577
610
|
biomes,
|
|
578
611
|
tiles: parsedTiles
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BiomeEntry, b as ByteReader, a as DecodedTextureArray, D as DecodedTile, L as Lightmap, c as LowresLevel, M as ManifestTile, d as MeshSection, e as QuantizedSection, Q as QuantizedTile, R as Rgb, S as SurfaceMap, T as TEXTURE_MAGIC, f as TILE_MAGIC, g as TextureAnimation, h as TileMagic, U as UV_SCALE, W as WorldFetch, i as WorldManifest, j as WorldSource, k as biomePalette, l as canonicalQuadIndices, p as parseManifest, m as parseTextureArray, n as parseTile, o as parseTileQuantized, s as stripNamespace, q as summarizeBiomes, r as summarizeSurfaceBiomes, t as tileKey, w as worldFromDirectory, u as worldFromFiles, v as worldFromUrl } from '../biome-
|
|
1
|
+
export { B as BiomeEntry, b as ByteReader, a as DecodedTextureArray, D as DecodedTile, L as Lightmap, c as LowresLevel, M as ManifestTile, d as MeshSection, e as QuantizedSection, Q as QuantizedTile, R as Rgb, S as SurfaceMap, T as TEXTURE_MAGIC, f as TILE_MAGIC, g as TextureAnimation, h as TileMagic, U as UV_SCALE, W as WorldFetch, i as WorldManifest, j as WorldSource, k as biomePalette, l as canonicalQuadIndices, p as parseManifest, m as parseTextureArray, n as parseTile, o as parseTileQuantized, s as stripNamespace, q as summarizeBiomes, r as summarizeSurfaceBiomes, t as tileKey, w as worldFromDirectory, u as worldFromFiles, v as worldFromUrl } from '../biome-NBWIY7dT.js';
|
|
2
2
|
|
|
3
3
|
declare const LOWRES_MAGIC = "VLR1";
|
|
4
4
|
/** Height sentinel for samples with no terrain (unpopulated chunks). */
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ByteReader, LOWRES_EMPTY, LOWRES_MAGIC, TEXTURE_MAGIC, TILE_MAGIC, UV_SCALE, biomePalette, canonicalQuadIndices, isGzip, maybeInflate, parseLowresTile, parseManifest, parseTextureArray, parseTile, parseTileQuantized, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromUrl } from '../chunk-
|
|
1
|
+
export { ByteReader, LOWRES_EMPTY, LOWRES_MAGIC, TEXTURE_MAGIC, TILE_MAGIC, UV_SCALE, biomePalette, canonicalQuadIndices, isGzip, maybeInflate, parseLowresTile, parseManifest, parseTextureArray, parseTile, parseTileQuantized, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromUrl } from '../chunk-EVPUXVSB.js';
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import { j as WorldSource, B as BiomeEntry } from '../biome-
|
|
4
|
-
export { D as DecodedTile } from '../biome-
|
|
5
|
-
import { g as TileSource, T as TextureSource, S as StreamingSettings, k as ViewMode, L as LightSettings, a as DisplaySettings, d as TileInfo, i as VantageViewer$1 } from '../viewer-
|
|
6
|
-
export { D as DEFAULT_ORBIT_ANGLE, V as VANILLA_DISPLAY } from '../viewer-
|
|
3
|
+
import { j as WorldSource, B as BiomeEntry } from '../biome-NBWIY7dT.js';
|
|
4
|
+
export { D as DecodedTile } from '../biome-NBWIY7dT.js';
|
|
5
|
+
import { g as TileSource, T as TextureSource, S as StreamingSettings, k as ViewMode, L as LightSettings, a as DisplaySettings, d as TileInfo, i as VantageViewer$1 } from '../viewer-C5vYxrL1.js';
|
|
6
|
+
export { D as DEFAULT_ORBIT_ANGLE, V as VANILLA_DISPLAY } from '../viewer-C5vYxrL1.js';
|
|
7
7
|
import 'three';
|
|
8
8
|
|
|
9
9
|
interface VantageViewerProps {
|
|
@@ -17,7 +17,7 @@ interface VantageViewerProps {
|
|
|
17
17
|
tile?: TileSource;
|
|
18
18
|
/** The `.vtexarr` texture array (required for textured tiles). */
|
|
19
19
|
textures?: TextureSource;
|
|
20
|
-
/** Streaming behaviour for `world` sources (view distance, tile
|
|
20
|
+
/** Streaming behaviour for `world` sources (view distance, tile/byte budgets).
|
|
21
21
|
* Live: changes re-plan in place, like the other setting props. */
|
|
22
22
|
streaming?: StreamingSettings;
|
|
23
23
|
/** Initial camera framing. Default `'orbit'`. */
|
|
@@ -26,6 +26,9 @@ interface VantageViewerProps {
|
|
|
26
26
|
antialias?: boolean;
|
|
27
27
|
/** Device pixel-ratio cap. Default `2`. Changing this remounts the canvas. */
|
|
28
28
|
maxPixelRatio?: number;
|
|
29
|
+
/** Render only when the view changes, with a low-frequency tick for animated
|
|
30
|
+
* textures. Default `true`; idle maps then use effectively no GPU time. */
|
|
31
|
+
renderOnDemand?: boolean;
|
|
29
32
|
/** Live lighting appearance (ambient floor, daylight, exposure). Applied on
|
|
30
33
|
* change without re-baking — drive it from a slider for a day/night control. */
|
|
31
34
|
light?: LightSettings;
|
|
@@ -108,6 +111,7 @@ interface QualityPreset {
|
|
|
108
111
|
name: string;
|
|
109
112
|
viewDistance: number;
|
|
110
113
|
maxTiles: number;
|
|
114
|
+
maxBytes: number;
|
|
111
115
|
renderScale: number;
|
|
112
116
|
}
|
|
113
117
|
declare const QUALITY_PRESETS: QualityPreset[];
|
|
@@ -126,9 +130,26 @@ interface MapNavProps {
|
|
|
126
130
|
home?: boolean;
|
|
127
131
|
/** Show the centred-coordinate readout. Default `true`. */
|
|
128
132
|
coords?: boolean;
|
|
133
|
+
/** Show the cave-view (depth slice) toggle. Default `true` — hidden
|
|
134
|
+
* automatically unless the world was baked with `--caves full`. */
|
|
135
|
+
caves?: boolean;
|
|
136
|
+
/** Show the screenshot (PNG download) button. Default `true`. */
|
|
137
|
+
screenshot?: boolean;
|
|
138
|
+
/** Show the fullscreen toggle. Default `true` (hidden automatically where
|
|
139
|
+
* the Fullscreen API is unavailable, e.g. iPhone Safari). */
|
|
140
|
+
fullscreen?: boolean;
|
|
129
141
|
className?: string;
|
|
130
142
|
}
|
|
131
|
-
declare function MapNav({ compass, tilt, fly, zoom, home, coords, className }: MapNavProps): react.JSX.Element | null;
|
|
143
|
+
declare function MapNav({ compass, tilt, fly, zoom, home, coords, caves, screenshot, fullscreen, className, }: MapNavProps): react.JSX.Element | null;
|
|
144
|
+
|
|
145
|
+
interface DepthSliderProps {
|
|
146
|
+
/** Key that toggles the cave view. Default `'c'`; pass `null` to disable. */
|
|
147
|
+
toggleKey?: string | null;
|
|
148
|
+
/** World-Y step for the `[` / `]` nudge keys. Default `4`. */
|
|
149
|
+
step?: number;
|
|
150
|
+
className?: string;
|
|
151
|
+
}
|
|
152
|
+
declare function DepthSlider({ toggleKey, step, className }: DepthSliderProps): react.JSX.Element | null;
|
|
132
153
|
|
|
133
154
|
interface ReticleProps {
|
|
134
155
|
className?: string;
|
|
@@ -153,8 +174,8 @@ interface VantageContextValue {
|
|
|
153
174
|
/** Access the viewer engine and live state. Must be used under `<VantageViewer>`. */
|
|
154
175
|
declare function useVantage(): VantageContextValue;
|
|
155
176
|
|
|
156
|
-
declare const CSS = "\n.vtg-root {\n position: relative; width: 100%; height: 100%; overflow: hidden;\n background: #0d1015; color-scheme: dark;\n --vtg-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n --vtg-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;\n --vtg-accent: #5b9bff;\n --vtg-text: #e6eefb;\n --vtg-muted: #93a9cc;\n --vtg-dim: #6f86ab;\n --vtg-line: rgba(132, 170, 230, 0.16);\n}\n.vtg-canvas { position: absolute; inset: 0; }\n/* Constrain the GL canvas to its container. The renderer keeps a high-res\n drawing buffer (devicePixelRatio \u00D7 renderScale) via setSize(\u2026, false), which\n leaves the canvas's intrinsic attribute size large; without an explicit\n display size that size leaks into layout and overflows. width/height:100%\n pins the *displayed* size to the container while the buffer stays crisp. */\n.vtg-canvas > canvas { display: block; width: 100%; height: 100%; }\n\n.vtg-glass {\n background: linear-gradient(180deg, rgba(18, 24, 35, 0.72), rgba(11, 15, 22, 0.7));\n border: 1px solid rgba(140, 178, 238, 0.18);\n border-radius: 13px;\n backdrop-filter: blur(16px) saturate(1.3);\n -webkit-backdrop-filter: blur(16px) saturate(1.3);\n box-shadow: 0 10px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);\n}\n\n.vtg-status {\n position: absolute; inset: 0; display: grid; place-content: center; text-align: center;\n font: 13px var(--vtg-sans); color: var(--vtg-muted); padding: 2rem;\n}\n.vtg-status.vtg-error { color: #ffb4b4; }\n\n/* --- panels --------------------------------------------------------------- */\n.vtg-panel {\n position: absolute; top: 16px; right: 16px; width: 240px; max-height: calc(100% - 32px);\n display: flex; flex-direction: column; overflow: hidden;\n font: 13px/1.45 var(--vtg-sans); color: var(--vtg-text);\n animation: vtg-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-panel header {\n padding: 11px 13px; display: flex; align-items: center; gap: 9px;\n user-select: none; flex: none;\n}\n.vtg-panel:not(.vtg-collapsed) header { border-bottom: 1px solid var(--vtg-line); }\n.vtg-panel header.vtg-click { cursor: pointer; }\n.vtg-panel header.vtg-click:hover .vtg-title { color: #fff; }\n.vtg-chev {\n font-size: 9px; color: var(--vtg-dim); width: 10px; flex: none; text-align: center;\n transition: transform 0.18s ease, color 0.16s;\n}\n.vtg-panel header.vtg-click:hover .vtg-chev { color: var(--vtg-muted); }\n.vtg-title {\n display: flex; align-items: center; gap: 7px;\n font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;\n color: var(--vtg-text); transition: color 0.16s;\n}\n.vtg-title .vtg-ico { color: var(--vtg-accent); font-size: 12px; opacity: 0.9; }\n.vtg-head-extra { margin-left: auto; display: flex; align-items: center; gap: 6px; }\n.vtg-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }\n\n.vtg-toggle {\n font: 600 11px var(--vtg-sans); padding: 3px 12px; border-radius: 999px;\n border: 1px solid rgba(132, 170, 230, 0.38); background: rgba(40, 60, 90, 0.4);\n color: var(--vtg-muted); cursor: pointer;\n transition: background 0.16s, color 0.16s, border-color 0.16s;\n}\n.vtg-toggle:hover { border-color: rgba(132, 170, 230, 0.7); color: var(--vtg-text); }\n.vtg-toggle.vtg-on { background: var(--vtg-accent); border-color: var(--vtg-accent); color: #07101f; }\n\n/* --- biome legend --------------------------------------------------------- */\n.vtg-legend { overflow-y: auto; padding: 7px; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }\n.vtg-row {\n display: flex; align-items: center; gap: 9px; padding: 5px 8px;\n border-radius: 7px; cursor: pointer; white-space: nowrap;\n transition: background 0.16s, opacity 0.16s, box-shadow 0.16s;\n}\n.vtg-row:hover { background: rgba(132, 170, 230, 0.12); }\n.vtg-row.vtg-sel { background: rgba(91, 155, 255, 0.26); }\n.vtg-row.vtg-hover { box-shadow: inset 0 0 0 1px rgba(143, 182, 232, 0.75); }\n.vtg-row.vtg-dim { opacity: 0.34; }\n.vtg-chip { width: 13px; height: 13px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }\n.vtg-name { overflow: hidden; text-overflow: ellipsis; }\n.vtg-pct { margin-left: auto; color: var(--vtg-dim); font: 11px var(--vtg-mono); font-variant-numeric: tabular-nums; }\n\n/* --- segmented toggle (render mode) --------------------------------------- */\n.vtg-seg { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(40, 60, 90, 0.4); border: 1px solid rgba(132, 170, 230, 0.28); }\n.vtg-seg button {\n font: 600 10px var(--vtg-sans); letter-spacing: 0.04em; text-transform: uppercase;\n padding: 3px 10px; border-radius: 999px; border: none; background: transparent; color: var(--vtg-muted);\n cursor: pointer; transition: background 0.16s, color 0.16s;\n}\n.vtg-seg button:hover { color: var(--vtg-text); }\n.vtg-seg button.vtg-seg-on { background: var(--vtg-accent); color: #07101f; }\n.vtg-seg-full { display: flex; }\n.vtg-seg-full button { flex: 1; text-align: center; padding: 4px 0; }\n\n/* --- sliders -------------------------------------------------------------- */\n.vtg-sliders { padding: 13px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }\n.vtg-slider { display: flex; flex-direction: column; gap: 7px; cursor: pointer; }\n.vtg-slider-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--vtg-muted); font-size: 12px; }\n.vtg-slider-row b { color: var(--vtg-text); font: 600 11px var(--vtg-mono); font-variant-numeric: tabular-nums; }\n.vtg-slider input[type=range] {\n -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px;\n background: rgba(132, 170, 230, 0.25); outline: none; cursor: pointer;\n}\n.vtg-slider input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;\n background: var(--vtg-accent); cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);\n transition: transform 0.12s;\n}\n.vtg-slider input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.18); }\n.vtg-slider input[type=range]::-moz-range-thumb {\n width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--vtg-accent);\n cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);\n}\n\n/* --- hover-to-identify tooltip -------------------------------------------- */\n.vtg-tip {\n position: fixed; display: flex; align-items: center; gap: 8px;\n padding: 6px 10px; pointer-events: none; z-index: 10;\n font: 12px/1 var(--vtg-sans); color: var(--vtg-text);\n background: rgba(13, 17, 25, 0.88); border: 1px solid var(--vtg-line); border-radius: 8px;\n backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);\n}\n.vtg-tip .vtg-chip { width: 12px; height: 12px; border-radius: 3px; }\n\n/* --- navigation cluster (compass \u00B7 zoom \u00B7 home \u00B7 coords) ------------------ */\n.vtg-nav {\n position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);\n display: flex; align-items: center; gap: 6px; padding: 6px;\n animation: vtg-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-navbtn {\n width: 30px; height: 30px; flex: none; display: grid; place-items: center;\n border-radius: 9px; border: 1px solid transparent; background: transparent;\n color: var(--vtg-muted); cursor: pointer; padding: 0;\n transition: background 0.15s, color 0.15s, border-color 0.15s;\n}\n.vtg-navbtn:hover { background: rgba(132, 170, 230, 0.14); color: var(--vtg-text); border-color: var(--vtg-line); }\n.vtg-navbtn:active { background: rgba(91, 155, 255, 0.26); }\n.vtg-navbtn svg { width: 16px; height: 16px; display: block; }\n.vtg-navbtn-text { width: auto; min-width: 30px; padding: 0 8px; font: 700 11px var(--vtg-mono); letter-spacing: 0.03em; }\n.vtg-navbtn.vtg-on { background: var(--vtg-accent); border-color: var(--vtg-accent); color: #07101f; }\n.vtg-navbtn.vtg-on:hover { background: var(--vtg-accent); color: #07101f; }\n.vtg-nav-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--vtg-line); }\n\n.vtg-compass {\n position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%;\n border: 1px solid var(--vtg-line); background: rgba(20, 28, 40, 0.5);\n cursor: pointer; display: grid; place-items: center;\n transition: border-color 0.16s, background 0.16s;\n}\n.vtg-compass:hover { border-color: rgba(132, 170, 230, 0.5); background: rgba(30, 42, 60, 0.6); }\n.vtg-compass svg { width: 30px; height: 30px; }\n.vtg-compass .vtg-n { fill: #ff6a6a; }\n.vtg-compass .vtg-s { fill: #c2d2ee; }\n.vtg-compass .vtg-cn { fill: var(--vtg-dim); font: 700 6px var(--vtg-sans); }\n\n.vtg-coords {\n display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px;\n font: 11px var(--vtg-mono); color: var(--vtg-muted); font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.vtg-coords b { color: var(--vtg-dim); font-weight: 600; margin-right: 1px; }\n\n/* --- centre reticle (navigation reference) -------------------------------- */\n.vtg-reticle {\n position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;\n transform: translate(-50%, -50%); pointer-events: none; z-index: 4;\n}\n.vtg-ret-ring {\n position: absolute; inset: 0; border-radius: 50%;\n border: 1.5px solid rgba(180, 205, 240, 0.28); transform: scale(0.62);\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);\n transition: border-color 0.2s ease, transform 0.2s ease;\n}\n.vtg-ret-dot {\n position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;\n border-radius: 50%; background: rgba(238, 244, 255, 0.85);\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 6px rgba(0, 0, 0, 0.55);\n transition: background 0.2s ease;\n}\n.vtg-reticle-on .vtg-ret-ring { border-color: rgba(143, 182, 232, 0.85); transform: scale(1); }\n.vtg-reticle-on .vtg-ret-dot { background: #fff; }\n\n@keyframes vtg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }\n.vtg-nav { animation-name: vtg-rise-x; }\n@keyframes vtg-rise-x { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }\n";
|
|
177
|
+
declare const CSS = "\n.vtg-root {\n position: relative; width: 100%; height: 100%; overflow: hidden;\n background: #0d1015; color-scheme: dark;\n --vtg-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n --vtg-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;\n --vtg-accent: #5b9bff;\n --vtg-text: #e6eefb;\n --vtg-muted: #93a9cc;\n --vtg-dim: #6f86ab;\n --vtg-line: rgba(132, 170, 230, 0.16);\n}\n.vtg-canvas { position: absolute; inset: 0; }\n/* Constrain the GL canvas to its container. The renderer keeps a high-res\n drawing buffer (devicePixelRatio \u00D7 renderScale) via setSize(\u2026, false), which\n leaves the canvas's intrinsic attribute size large; without an explicit\n display size that size leaks into layout and overflows. width/height:100%\n pins the *displayed* size to the container while the buffer stays crisp. */\n.vtg-canvas > canvas { display: block; width: 100%; height: 100%; }\n\n.vtg-glass {\n background: linear-gradient(180deg, rgba(18, 24, 35, 0.72), rgba(11, 15, 22, 0.7));\n border: 1px solid rgba(140, 178, 238, 0.18);\n border-radius: 13px;\n backdrop-filter: blur(16px) saturate(1.3);\n -webkit-backdrop-filter: blur(16px) saturate(1.3);\n box-shadow: 0 10px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);\n}\n\n.vtg-status {\n position: absolute; inset: 0; display: grid; place-content: center; text-align: center;\n font: 13px var(--vtg-sans); color: var(--vtg-muted); padding: 2rem;\n}\n.vtg-status.vtg-error { color: #ffb4b4; }\n\n/* --- panels --------------------------------------------------------------- */\n.vtg-panel {\n position: absolute; top: 16px; right: 16px; width: 240px; max-height: calc(100% - 32px);\n display: flex; flex-direction: column; overflow: hidden;\n font: 13px/1.45 var(--vtg-sans); color: var(--vtg-text);\n animation: vtg-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-panel header {\n padding: 11px 13px; display: flex; align-items: center; gap: 9px;\n user-select: none; flex: none;\n}\n.vtg-panel:not(.vtg-collapsed) header { border-bottom: 1px solid var(--vtg-line); }\n.vtg-panel header.vtg-click { cursor: pointer; }\n.vtg-panel header.vtg-click:hover .vtg-title { color: #fff; }\n.vtg-chev {\n font-size: 9px; color: var(--vtg-dim); width: 10px; flex: none; text-align: center;\n transition: transform 0.18s ease, color 0.16s;\n}\n.vtg-panel header.vtg-click:hover .vtg-chev { color: var(--vtg-muted); }\n.vtg-title {\n display: flex; align-items: center; gap: 7px;\n font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;\n color: var(--vtg-text); transition: color 0.16s;\n}\n.vtg-title .vtg-ico { color: var(--vtg-accent); font-size: 12px; opacity: 0.9; }\n.vtg-head-extra { margin-left: auto; display: flex; align-items: center; gap: 6px; }\n.vtg-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }\n\n.vtg-toggle {\n font: 600 11px var(--vtg-sans); padding: 3px 12px; border-radius: 999px;\n border: 1px solid rgba(132, 170, 230, 0.38); background: rgba(40, 60, 90, 0.4);\n color: var(--vtg-muted); cursor: pointer;\n transition: background 0.16s, color 0.16s, border-color 0.16s;\n}\n.vtg-toggle:hover { border-color: rgba(132, 170, 230, 0.7); color: var(--vtg-text); }\n.vtg-toggle.vtg-on { background: var(--vtg-accent); border-color: var(--vtg-accent); color: #07101f; }\n\n/* --- biome legend --------------------------------------------------------- */\n.vtg-legend { overflow-y: auto; padding: 7px; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }\n.vtg-row {\n display: flex; align-items: center; gap: 9px; padding: 5px 8px;\n border-radius: 7px; cursor: pointer; white-space: nowrap;\n transition: background 0.16s, opacity 0.16s, box-shadow 0.16s;\n}\n.vtg-row:hover { background: rgba(132, 170, 230, 0.12); }\n.vtg-row.vtg-sel { background: rgba(91, 155, 255, 0.26); }\n.vtg-row.vtg-hover { box-shadow: inset 0 0 0 1px rgba(143, 182, 232, 0.75); }\n.vtg-row.vtg-dim { opacity: 0.34; }\n.vtg-chip { width: 13px; height: 13px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }\n.vtg-name { overflow: hidden; text-overflow: ellipsis; }\n.vtg-pct { margin-left: auto; color: var(--vtg-dim); font: 11px var(--vtg-mono); font-variant-numeric: tabular-nums; }\n\n/* --- segmented toggle (render mode) --------------------------------------- */\n.vtg-seg { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(40, 60, 90, 0.4); border: 1px solid rgba(132, 170, 230, 0.28); }\n.vtg-seg button {\n font: 600 10px var(--vtg-sans); letter-spacing: 0.04em; text-transform: uppercase;\n padding: 3px 10px; border-radius: 999px; border: none; background: transparent; color: var(--vtg-muted);\n cursor: pointer; transition: background 0.16s, color 0.16s;\n}\n.vtg-seg button:hover { color: var(--vtg-text); }\n.vtg-seg button.vtg-seg-on { background: var(--vtg-accent); color: #07101f; }\n.vtg-seg-full { display: flex; }\n.vtg-seg-full button { flex: 1; text-align: center; padding: 4px 0; }\n\n/* --- sliders -------------------------------------------------------------- */\n.vtg-sliders { padding: 13px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }\n.vtg-slider { display: flex; flex-direction: column; gap: 7px; cursor: pointer; }\n.vtg-slider-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--vtg-muted); font-size: 12px; }\n.vtg-slider-row b { color: var(--vtg-text); font: 600 11px var(--vtg-mono); font-variant-numeric: tabular-nums; }\n.vtg-slider input[type=range] {\n -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px;\n background: rgba(132, 170, 230, 0.25); outline: none; cursor: pointer;\n}\n.vtg-slider input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;\n background: var(--vtg-accent); cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);\n transition: transform 0.12s;\n}\n.vtg-slider input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.18); }\n.vtg-slider input[type=range]::-moz-range-thumb {\n width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--vtg-accent);\n cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);\n}\n\n/* --- hover-to-identify tooltip -------------------------------------------- */\n.vtg-tip {\n position: fixed; display: flex; align-items: center; gap: 8px;\n padding: 6px 10px; pointer-events: none; z-index: 10;\n font: 12px/1 var(--vtg-sans); color: var(--vtg-text);\n background: rgba(13, 17, 25, 0.88); border: 1px solid var(--vtg-line); border-radius: 8px;\n backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);\n}\n.vtg-tip .vtg-chip { width: 12px; height: 12px; border-radius: 3px; }\n\n/* --- navigation cluster (compass \u00B7 zoom \u00B7 home \u00B7 coords) ------------------ */\n.vtg-nav {\n position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);\n display: flex; align-items: center; gap: 6px; padding: 6px;\n animation: vtg-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-navbtn {\n width: 30px; height: 30px; flex: none; display: grid; place-items: center;\n border-radius: 9px; border: 1px solid transparent; background: transparent;\n color: var(--vtg-muted); cursor: pointer; padding: 0;\n transition: background 0.15s, color 0.15s, border-color 0.15s;\n}\n.vtg-navbtn:hover { background: rgba(132, 170, 230, 0.14); color: var(--vtg-text); border-color: var(--vtg-line); }\n.vtg-navbtn:active { background: rgba(91, 155, 255, 0.26); }\n.vtg-navbtn svg { width: 16px; height: 16px; display: block; }\n.vtg-navbtn-text { width: auto; min-width: 30px; padding: 0 8px; font: 700 11px var(--vtg-mono); letter-spacing: 0.03em; }\n.vtg-navbtn.vtg-on { background: var(--vtg-accent); border-color: var(--vtg-accent); color: #07101f; }\n.vtg-navbtn.vtg-on:hover { background: var(--vtg-accent); color: #07101f; }\n.vtg-nav-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--vtg-line); }\n\n.vtg-compass {\n position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%;\n border: 1px solid var(--vtg-line); background: rgba(20, 28, 40, 0.5);\n cursor: pointer; display: grid; place-items: center;\n transition: border-color 0.16s, background 0.16s;\n}\n.vtg-compass:hover { border-color: rgba(132, 170, 230, 0.5); background: rgba(30, 42, 60, 0.6); }\n.vtg-compass svg { width: 30px; height: 30px; }\n.vtg-compass .vtg-n { fill: #ff6a6a; }\n.vtg-compass .vtg-s { fill: #c2d2ee; }\n.vtg-compass .vtg-cn { fill: var(--vtg-dim); font: 700 6px var(--vtg-sans); }\n\n.vtg-coords {\n display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px;\n font: 11px var(--vtg-mono); color: var(--vtg-muted); font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n.vtg-coords b { color: var(--vtg-dim); font-weight: 600; margin-right: 1px; }\n\n/* --- cave-view depth gauge ------------------------------------------------- */\n.vtg-depth {\n position: absolute; left: 16px; top: 50%; transform: translateY(-50%);\n display: flex; flex-direction: column; align-items: center; gap: 8px;\n padding: 10px 8px; width: 58px;\n animation: vtg-rise-y 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-depth-val {\n font: 11px var(--vtg-mono); color: var(--vtg-text); font-variant-numeric: tabular-nums;\n display: flex; flex-direction: column; align-items: center; line-height: 1.3;\n}\n.vtg-depth-val b { color: var(--vtg-dim); font-weight: 600; font-size: 9px; letter-spacing: 0.08em; }\n/* The interactive rail: the thumb and landmark labels hang outside the track,\n so the rail stays unclipped while the track clips its own paint. */\n.vtg-depth-rail {\n position: relative; width: 14px; height: min(320px, 38vh);\n cursor: ns-resize; touch-action: none;\n}\n.vtg-depth-rail:focus-visible { outline: 2px solid var(--vtg-accent); outline-offset: 4px; border-radius: 7px; }\n.vtg-depth-track {\n position: absolute; inset: 0; border-radius: 7px; overflow: hidden; pointer-events: none;\n /* A core sample: sky, grass, stone, deepslate, bedrock. */\n background: linear-gradient(180deg, #6f9bce 0%, #6e9150 12%, #6e6f74 48%, #3e424b 76%, #16181d 100%);\n border: 1px solid var(--vtg-line);\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);\n}\n/* The stratum the slice removed: struck through with hazard stripes. */\n.vtg-depth-cut {\n position: absolute; inset: 0 0 auto 0;\n background: repeating-linear-gradient(-45deg, rgba(10, 13, 19, 0.75) 0 4px, rgba(24, 30, 42, 0.55) 4px 8px);\n}\n.vtg-depth-thumb {\n position: absolute; left: -3px; right: -3px; height: 0; pointer-events: none;\n}\n.vtg-depth-thumb::before {\n content: ''; position: absolute; left: 0; right: 0; top: -1.5px; height: 3px;\n background: var(--vtg-accent); border-radius: 2px;\n box-shadow: 0 0 6px rgba(91, 155, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.vtg-depth-mark {\n position: absolute; left: 0; right: 0; height: 0; pointer-events: none;\n}\n.vtg-depth-mark i { position: absolute; left: -4px; width: 4px; top: -0.5px; height: 1px; background: rgba(230, 238, 251, 0.55); }\n.vtg-depth-mark span {\n position: absolute; left: 17px; top: -5px; font: 9px var(--vtg-mono); color: var(--vtg-dim);\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);\n}\n.vtg-depth-close {\n width: 24px; height: 24px; flex: none; display: grid; place-items: center;\n border-radius: 7px; border: 1px solid transparent; background: transparent;\n color: var(--vtg-muted); cursor: pointer; padding: 0;\n transition: background 0.15s, color 0.15s, border-color 0.15s;\n}\n.vtg-depth-close:hover { background: rgba(132, 170, 230, 0.14); color: var(--vtg-text); border-color: var(--vtg-line); }\n.vtg-depth-close svg { width: 13px; height: 13px; display: block; }\n@keyframes vtg-rise-y { from { opacity: 0; transform: translate(-8px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }\n\n/* --- centre reticle (navigation reference) -------------------------------- */\n.vtg-reticle {\n position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;\n transform: translate(-50%, -50%); pointer-events: none; z-index: 4;\n}\n.vtg-ret-ring {\n position: absolute; inset: 0; border-radius: 50%;\n border: 1.5px solid rgba(180, 205, 240, 0.28); transform: scale(0.62);\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);\n transition: border-color 0.2s ease, transform 0.2s ease;\n}\n.vtg-ret-dot {\n position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px;\n border-radius: 50%; background: rgba(238, 244, 255, 0.85);\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 6px rgba(0, 0, 0, 0.55);\n transition: background 0.2s ease;\n}\n.vtg-reticle-on .vtg-ret-ring { border-color: rgba(143, 182, 232, 0.85); transform: scale(1); }\n.vtg-reticle-on .vtg-ret-dot { background: #fff; }\n\n@keyframes vtg-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }\n.vtg-nav { animation-name: vtg-rise-x; }\n@keyframes vtg-rise-x { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }\n";
|
|
157
178
|
/** Inject the component stylesheet once. No-op on the server or after the first call. */
|
|
158
179
|
declare function injectStyles(): void;
|
|
159
180
|
|
|
160
|
-
export { BiomeEntry, BiomeLayer, type BiomeLayerProps, CSS, DisplaySettings, LightPanel, type LightPanelProps, LightSettings, MapNav, type MapNavProps, Panel, type PanelProps, QUALITY_PRESETS, type QualityPreset, Reticle, type ReticleProps, SettingsPanel, type SettingsPanelProps, StreamingSettings, TextureSource, TileInfo, TileSource, type VantageContextValue, VantageViewer$1 as VantageEngine, type VantageStatus, VantageViewer, type VantageViewerProps, ViewMode, injectStyles, useVantage };
|
|
181
|
+
export { BiomeEntry, BiomeLayer, type BiomeLayerProps, CSS, DepthSlider, type DepthSliderProps, DisplaySettings, LightPanel, type LightPanelProps, LightSettings, MapNav, type MapNavProps, Panel, type PanelProps, QUALITY_PRESETS, type QualityPreset, Reticle, type ReticleProps, SettingsPanel, type SettingsPanelProps, StreamingSettings, TextureSource, TileInfo, TileSource, type VantageContextValue, VantageViewer$1 as VantageEngine, type VantageStatus, VantageViewer, type VantageViewerProps, ViewMode, injectStyles, useVantage };
|