@thoughts-on-things/vantage-mc 0.10.0 → 0.11.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 +34 -0
- package/dist/{biome-B6l-1yx4.d.ts → biome-CcJerc-b.d.ts} +91 -8
- package/dist/{chunk-LZCXJU4U.js → chunk-GKNIX375.js} +128 -13
- package/dist/{chunk-E7Y7K6NH.js → chunk-QV6SDOVV.js} +149 -19
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/react/index.d.ts +20 -6
- package/dist/react/index.js +224 -13
- package/dist/three/index.d.ts +10 -4
- package/dist/three/index.js +2 -2
- package/dist/{viewer-BgXAqYhr.d.ts → viewer-Cy9oGJ-F.d.ts} +52 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { biomePalette, LOWRES_EMPTY, tileKey, parseLowresTile, maybeInflate, parseTileQuantized, summarizeSurfaceBiomes, parseTile, summarizeBiomes, worldFromUrl, parseManifest, parseTextureArray } from './chunk-
|
|
1
|
+
import { biomePalette, LOWRES_EMPTY, tileKey, parseLowresTile, maybeInflate, parseTileQuantized, summarizeSurfaceBiomes, parseTile, summarizeBiomes, worldFromUrl, isWorldIndex, parseWorldIndex, pickDimension, worldFromIndexEntry, parseManifest, parseTextureArray } from './chunk-GKNIX375.js';
|
|
2
2
|
import * as THREE2 from 'three';
|
|
3
3
|
|
|
4
4
|
var SKY_TOP = [0.3, 0.52, 0.84];
|
|
@@ -535,6 +535,11 @@ function createLowresMaterial(terrain) {
|
|
|
535
535
|
alphaToCoverage: true
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
+
function setSkyColors(sky, top, horizon) {
|
|
539
|
+
const u = sky.material.uniforms;
|
|
540
|
+
u["uTop"].value.set(...top);
|
|
541
|
+
u["uHorizon"].value.set(...horizon);
|
|
542
|
+
}
|
|
538
543
|
function createSky() {
|
|
539
544
|
const mat = new THREE2.ShaderMaterial({
|
|
540
545
|
glslVersion: THREE2.GLSL3,
|
|
@@ -3174,6 +3179,17 @@ function resolveContainer(container) {
|
|
|
3174
3179
|
if (!el) throw new Error(`vantage: container not found: ${String(container)}`);
|
|
3175
3180
|
return el;
|
|
3176
3181
|
}
|
|
3182
|
+
function dimensionFromManifest(manifest) {
|
|
3183
|
+
const d = manifest.dimension;
|
|
3184
|
+
if (!d) return null;
|
|
3185
|
+
return {
|
|
3186
|
+
...d,
|
|
3187
|
+
manifest: "manifest.json",
|
|
3188
|
+
tiles: manifest.tiles.length,
|
|
3189
|
+
bytes: 0,
|
|
3190
|
+
...manifest.spawn ? { spawn: manifest.spawn } : {}
|
|
3191
|
+
};
|
|
3192
|
+
}
|
|
3177
3193
|
function makeHeightSampler(surface) {
|
|
3178
3194
|
if (!surface) return null;
|
|
3179
3195
|
const { width, depth, originX, originZ, height } = surface;
|
|
@@ -3227,6 +3243,20 @@ var VantageViewer = class _VantageViewer {
|
|
|
3227
3243
|
// Streamed-world state (world/manifest mode). `tiles` doubles as the mode flag.
|
|
3228
3244
|
tiles = null;
|
|
3229
3245
|
manifest = null;
|
|
3246
|
+
// Multi-dimension worlds (world.json): the index, the source it was loaded
|
|
3247
|
+
// from (every dimension re-roots off it), and which one is showing. The index
|
|
3248
|
+
// is empty for a plain single-manifest world, but `currentDimension` is still
|
|
3249
|
+
// filled in from the manifest when it names one — opening
|
|
3250
|
+
// `/the_nether/manifest.json` directly is a nether map, and everything
|
|
3251
|
+
// downstream (atmosphere, depth gauge, deep links) should know it.
|
|
3252
|
+
worldIndex = [];
|
|
3253
|
+
indexSource = null;
|
|
3254
|
+
currentDimension = null;
|
|
3255
|
+
/** Per-dimension camera hashes, so switching back returns where you were. */
|
|
3256
|
+
dimensionViews = /* @__PURE__ */ new Map();
|
|
3257
|
+
/** The view mode the loaded world was framed with — a `load({ view })` may
|
|
3258
|
+
* differ from the constructor default, and switching dimensions keeps it. */
|
|
3259
|
+
loadedView = "orbit";
|
|
3230
3260
|
waterShader = null;
|
|
3231
3261
|
lowresShader = null;
|
|
3232
3262
|
/** Populated world extent (max of X/Z spans), for whole-world zoom limits. */
|
|
@@ -3267,6 +3297,10 @@ var VantageViewer = class _VantageViewer {
|
|
|
3267
3297
|
cavesShown = true;
|
|
3268
3298
|
// Live lighting appearance (applied to the shader on load and on change).
|
|
3269
3299
|
light = { ...DEFAULT_LIGHT };
|
|
3300
|
+
/** Light fields the embedder set explicitly (constructor option or
|
|
3301
|
+
* `setLight`). A dimension's atmosphere fills in the rest, so switching
|
|
3302
|
+
* worlds re-lights the map without overriding a deliberate choice. */
|
|
3303
|
+
lightOverrides = {};
|
|
3270
3304
|
// Live display fidelity (shader uniforms + render scale).
|
|
3271
3305
|
display = { ...DEFAULT_DISPLAY };
|
|
3272
3306
|
// Hover picking.
|
|
@@ -3309,7 +3343,10 @@ var VantageViewer = class _VantageViewer {
|
|
|
3309
3343
|
caveGeometry: options.caveGeometry ?? "auto"
|
|
3310
3344
|
};
|
|
3311
3345
|
this.caveMode = this.options.caveGeometry;
|
|
3312
|
-
if (options.light)
|
|
3346
|
+
if (options.light) {
|
|
3347
|
+
this.light = { ...this.light, ...options.light };
|
|
3348
|
+
this.lightOverrides = { ...options.light };
|
|
3349
|
+
}
|
|
3313
3350
|
if (options.display) this.display = { ...this.display, ...options.display };
|
|
3314
3351
|
this.renderer = new THREE2.WebGLRenderer({ antialias: false });
|
|
3315
3352
|
this.renderer.setPixelRatio(this.targetPixelRatio());
|
|
@@ -3382,11 +3419,27 @@ var VantageViewer = class _VantageViewer {
|
|
|
3382
3419
|
const textures = opts.textures ? await resolveTextures(opts.textures) : void 0;
|
|
3383
3420
|
this.setTile(tile, textures, opts.view ?? this.options.view);
|
|
3384
3421
|
}
|
|
3385
|
-
/** Stream a tiled world render from its `manifest.json
|
|
3386
|
-
*
|
|
3422
|
+
/** Stream a tiled world render from its `manifest.json` — or from a
|
|
3423
|
+
* `world.json` index, in which case one of its dimensions is opened and the
|
|
3424
|
+
* rest become available through {@link setDimension}. Tiles load around the
|
|
3425
|
+
* camera as it moves and unload behind it; the whole world is reachable
|
|
3387
3426
|
* without ever holding more than the streaming budget in memory. */
|
|
3388
|
-
async loadWorld(world, view) {
|
|
3389
|
-
const
|
|
3427
|
+
async loadWorld(world, view, wantSlug) {
|
|
3428
|
+
const opened = typeof world === "string" ? await worldFromUrl(world) : world;
|
|
3429
|
+
let source = opened;
|
|
3430
|
+
let nextIndex = [];
|
|
3431
|
+
let nextIndexSource = null;
|
|
3432
|
+
let nextDimension = null;
|
|
3433
|
+
if (isWorldIndex(opened.manifest)) {
|
|
3434
|
+
const index = parseWorldIndex(opened.manifest);
|
|
3435
|
+
const slug = wantSlug ?? (this.options.urlState ? this.hashDimension() : null);
|
|
3436
|
+
const entry = pickDimension(index, slug);
|
|
3437
|
+
source = await worldFromIndexEntry(opened, entry.manifest);
|
|
3438
|
+
nextIndex = index.dimensions;
|
|
3439
|
+
nextIndexSource = opened;
|
|
3440
|
+
nextDimension = entry;
|
|
3441
|
+
}
|
|
3442
|
+
this.loadedView = view;
|
|
3390
3443
|
const manifest = parseManifest(source.manifest);
|
|
3391
3444
|
const texData = parseTextureArray(await maybeInflate(await source.fetch(manifest.textures)));
|
|
3392
3445
|
this.disposeCurrent();
|
|
@@ -3400,6 +3453,9 @@ var VantageViewer = class _VantageViewer {
|
|
|
3400
3453
|
this.waterShader = waterShader;
|
|
3401
3454
|
this.lowresShader = lowresShader ?? null;
|
|
3402
3455
|
this.manifest = manifest;
|
|
3456
|
+
this.worldIndex = nextIndex;
|
|
3457
|
+
this.indexSource = nextIndexSource;
|
|
3458
|
+
this.currentDimension = nextDimension ?? dimensionFromManifest(manifest);
|
|
3403
3459
|
this.hasAnims = texData.anims.length > 0;
|
|
3404
3460
|
this.lastTextureLayers = manifest.textureLayers ?? texData.layers;
|
|
3405
3461
|
this.tile = null;
|
|
@@ -3434,8 +3490,12 @@ var VantageViewer = class _VantageViewer {
|
|
|
3434
3490
|
this.emitter.emit("biomes", this._biomes);
|
|
3435
3491
|
}
|
|
3436
3492
|
});
|
|
3493
|
+
this.applyAtmosphere(manifest.atmosphere);
|
|
3437
3494
|
this.frameWorld(manifest, view);
|
|
3438
|
-
if (this.options.urlState)
|
|
3495
|
+
if (this.options.urlState) {
|
|
3496
|
+
const hashSlug = this.hashDimension();
|
|
3497
|
+
if (hashSlug === null || hashSlug === this.currentDimension?.slug) this.applyViewHash(window.location.hash);
|
|
3498
|
+
}
|
|
3439
3499
|
this.applyBiomeUniforms();
|
|
3440
3500
|
this.applyLight();
|
|
3441
3501
|
this.applyDisplay();
|
|
@@ -3452,6 +3512,7 @@ var VantageViewer = class _VantageViewer {
|
|
|
3452
3512
|
size,
|
|
3453
3513
|
biomes: this._biomes
|
|
3454
3514
|
});
|
|
3515
|
+
this.emitter.emit("dimension", { dimensions: this.worldIndex, current: this.currentDimension });
|
|
3455
3516
|
if (manifest.rendering) {
|
|
3456
3517
|
this.progressiveManager = this.tiles;
|
|
3457
3518
|
this.lastProgress = null;
|
|
@@ -3459,6 +3520,53 @@ var VantageViewer = class _VantageViewer {
|
|
|
3459
3520
|
void this.pollProgressive(source, this.tiles);
|
|
3460
3521
|
}
|
|
3461
3522
|
}
|
|
3523
|
+
// --- dimensions ------------------------------------------------------------
|
|
3524
|
+
/** Every dimension of the loaded world (empty for a single-manifest world). */
|
|
3525
|
+
get dimensions() {
|
|
3526
|
+
return this.worldIndex;
|
|
3527
|
+
}
|
|
3528
|
+
/** The dimension currently showing, or null when the world isn't indexed. */
|
|
3529
|
+
get dimension() {
|
|
3530
|
+
return this.currentDimension;
|
|
3531
|
+
}
|
|
3532
|
+
/**
|
|
3533
|
+
* Switch to another dimension of the loaded world by slug or resource id.
|
|
3534
|
+
*
|
|
3535
|
+
* Each dimension is a self-contained render, so this is a full world reload —
|
|
3536
|
+
* but the camera you left behind is remembered per dimension, and coming back
|
|
3537
|
+
* returns to it. Resolves once the new world is framed and streaming; a slug
|
|
3538
|
+
* the world doesn't have throws.
|
|
3539
|
+
*/
|
|
3540
|
+
async setDimension(slug) {
|
|
3541
|
+
const source = this.indexSource;
|
|
3542
|
+
if (!source) throw new Error("vantage: this world has no dimension index");
|
|
3543
|
+
const entry = this.worldIndex.find((d) => d.slug === slug || d.id === slug);
|
|
3544
|
+
if (!entry) throw new Error(`vantage: no dimension "${slug}" in this world`);
|
|
3545
|
+
if (this.currentDimension && entry.slug === this.currentDimension.slug) return;
|
|
3546
|
+
if (this.currentDimension) this.dimensionViews.set(this.currentDimension.slug, this.getViewHash());
|
|
3547
|
+
await this.loadWorld(source, this.loadedView, entry.slug);
|
|
3548
|
+
const remembered = this.dimensionViews.get(entry.slug);
|
|
3549
|
+
if (remembered) this.applyViewHash(remembered);
|
|
3550
|
+
this.queueHashWrite();
|
|
3551
|
+
}
|
|
3552
|
+
/** Paint the dimension's atmosphere: sky dome, fog colour, and the light
|
|
3553
|
+
* defaults. Explicit `light` options from the embedder always win — a page
|
|
3554
|
+
* that set its own ambient/daylight keeps them across dimension switches. */
|
|
3555
|
+
applyAtmosphere(atmosphere) {
|
|
3556
|
+
const a = atmosphere;
|
|
3557
|
+
const top = a?.skyTop ?? SKY_TOP;
|
|
3558
|
+
const horizon = a?.skyHorizon ?? SKY_HORIZON;
|
|
3559
|
+
const fog = a?.fog ?? horizon;
|
|
3560
|
+
setSkyColors(this.sky, top, horizon);
|
|
3561
|
+
this.scene.background.setRGB(...horizon);
|
|
3562
|
+
if (this.shader) this.shader.uniforms["uFogColor"].value.set(...fog);
|
|
3563
|
+
this.light = {
|
|
3564
|
+
ambient: this.lightOverrides.ambient ?? a?.ambient ?? DEFAULT_LIGHT.ambient,
|
|
3565
|
+
daylight: this.lightOverrides.daylight ?? a?.daylight ?? DEFAULT_LIGHT.daylight,
|
|
3566
|
+
exposure: this.lightOverrides.exposure ?? DEFAULT_LIGHT.exposure
|
|
3567
|
+
};
|
|
3568
|
+
this.needsRender = true;
|
|
3569
|
+
}
|
|
3462
3570
|
/** Emit a `progress` event from a manifest (falling back to the tile count
|
|
3463
3571
|
* when the generator didn't include a `progress` block). Deduplicated: a
|
|
3464
3572
|
* continuous server reports the same numbers poll after poll, and repeating
|
|
@@ -3569,7 +3677,9 @@ var VantageViewer = class _VantageViewer {
|
|
|
3569
3677
|
minX = minZ = 0;
|
|
3570
3678
|
maxX = maxZ = tb;
|
|
3571
3679
|
}
|
|
3572
|
-
|
|
3680
|
+
const minY = manifest.yRange?.min ?? -64;
|
|
3681
|
+
const maxY = manifest.yRange?.max ?? 320;
|
|
3682
|
+
this.bounds.set(new THREE2.Vector3(minX, minY, minZ), new THREE2.Vector3(maxX, maxY, maxZ));
|
|
3573
3683
|
this.worldSpan = Math.max(maxX - minX, maxZ - minZ);
|
|
3574
3684
|
}
|
|
3575
3685
|
/** Frame a streamed world: pivot on the spawn point when the manifest has
|
|
@@ -3597,6 +3707,7 @@ var VantageViewer = class _VantageViewer {
|
|
|
3597
3707
|
}
|
|
3598
3708
|
const h = this.controls.heightAt?.(pivot.x, pivot.z);
|
|
3599
3709
|
if (h != null) pivot.y = h + 3;
|
|
3710
|
+
pivot.y = Math.min(Math.max(pivot.y, this.bounds.min.y + 1), this.bounds.max.y - 1);
|
|
3600
3711
|
this.controls.setView({ position: pivot, distance, rotation: 0, angle, floorY: pivot.y });
|
|
3601
3712
|
this.framedState = { position: pivot.clone(), distance, rotation: 0, angle, floorY: pivot.y };
|
|
3602
3713
|
this.applyViewLimits();
|
|
@@ -3805,6 +3916,7 @@ var VantageViewer = class _VantageViewer {
|
|
|
3805
3916
|
* immediately, no re-bake). */
|
|
3806
3917
|
setLight(settings) {
|
|
3807
3918
|
this.light = { ...this.light, ...settings };
|
|
3919
|
+
this.lightOverrides = { ...this.lightOverrides, ...settings };
|
|
3808
3920
|
this.applyLight();
|
|
3809
3921
|
}
|
|
3810
3922
|
applyLight() {
|
|
@@ -3861,7 +3973,8 @@ var VantageViewer = class _VantageViewer {
|
|
|
3861
3973
|
return;
|
|
3862
3974
|
}
|
|
3863
3975
|
const r = this.sliceRange;
|
|
3864
|
-
|
|
3976
|
+
const depth = this.manifest?.dimension?.kind === "nether" ? 0.85 : 0.25;
|
|
3977
|
+
this.setSlice(this.lastSliceY ?? Math.round(r.min + (r.max - r.min) * depth));
|
|
3865
3978
|
}
|
|
3866
3979
|
/** Push slice state to the shader + scene: clip uniform, ambient floor, and
|
|
3867
3980
|
* the void floor's presence. Also called on (re)load to seed a fresh shader. */
|
|
@@ -4020,21 +4133,32 @@ var VantageViewer = class _VantageViewer {
|
|
|
4020
4133
|
this.needsRender = true;
|
|
4021
4134
|
}
|
|
4022
4135
|
// --- URL-hash deep links ----------------------------------------------------
|
|
4023
|
-
/** The current view serialized as a
|
|
4024
|
-
* fragment — paste-able into any URL serving the same world. The
|
|
4025
|
-
*
|
|
4026
|
-
*
|
|
4136
|
+
/** The current view serialized as a `#[dimension]@x,y,z,dist,rot,tilt[,sliceY]`
|
|
4137
|
+
* hash fragment — paste-able into any URL serving the same world. The
|
|
4138
|
+
* dimension prefix appears only for multi-dimension worlds, so overworld-only
|
|
4139
|
+
* links keep their old shape; the trailing component appears only while the
|
|
4140
|
+
* cave view is open, so those deep links reopen sliced at the same depth. */
|
|
4027
4141
|
getViewHash() {
|
|
4028
4142
|
const p = this.controls.position;
|
|
4029
4143
|
const r1 = (v) => Math.round(v * 10) / 10;
|
|
4030
4144
|
const r3 = (v) => Math.round(v * 1e3) / 1e3;
|
|
4031
4145
|
const slice = this.sliceTarget !== null ? `,${r1(this.sliceTarget)}` : "";
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4146
|
+
const dim = this.worldIndex.length > 1 && this.currentDimension ? this.currentDimension.slug : "";
|
|
4147
|
+
return `#${dim}@${r1(p.x)},${r1(p.y)},${r1(p.z)},${r1(this.controls.distance)},${r3(this.controls.rotation)},${r3(this.controls.angle)}${slice}`;
|
|
4148
|
+
}
|
|
4149
|
+
/** The dimension slug in the current URL hash, if it names one. Read before
|
|
4150
|
+
* a world index picks which dimension to open. */
|
|
4151
|
+
hashDimension() {
|
|
4152
|
+
if (typeof window === "undefined") return null;
|
|
4153
|
+
const m = /^#([a-z0-9._-]+)@/.exec(window.location.hash);
|
|
4154
|
+
return m ? m[1] : null;
|
|
4155
|
+
}
|
|
4156
|
+
/** Apply a `#[dimension]@x,y,z,dist,rot,tilt[,sliceY]` hash to the camera
|
|
4157
|
+
* (leading `#` optional). The dimension prefix is ignored here — it is
|
|
4158
|
+
* consumed at load time; this only moves the camera. Returns whether the
|
|
4159
|
+
* hash parsed. */
|
|
4036
4160
|
applyViewHash(hash) {
|
|
4037
|
-
const m =
|
|
4161
|
+
const m = /^#?[a-z0-9._-]*@(-?[\d.]+),(-?[\d.]+),(-?[\d.]+),([\d.]+),(-?[\d.]+),(-?[\d.]+)(?:,(-?[\d.]+))?$/.exec(hash);
|
|
4038
4162
|
if (!m) return false;
|
|
4039
4163
|
const [x, y, z, distance, rotation, angle] = m.slice(1, 7).map(Number);
|
|
4040
4164
|
if (![x, y, z, distance, rotation, angle].every(Number.isFinite)) return false;
|
|
@@ -4057,6 +4181,12 @@ var VantageViewer = class _VantageViewer {
|
|
|
4057
4181
|
this.controls.addEventListener("change", onChange);
|
|
4058
4182
|
const onHash = () => {
|
|
4059
4183
|
if (window.location.hash === this.lastWrittenHash) return;
|
|
4184
|
+
const slug = this.hashDimension();
|
|
4185
|
+
if (slug && slug !== this.currentDimension?.slug && this.worldIndex.some((d) => d.slug === slug)) {
|
|
4186
|
+
const target = window.location.hash;
|
|
4187
|
+
void this.setDimension(slug).then(() => this.applyViewHash(target));
|
|
4188
|
+
return;
|
|
4189
|
+
}
|
|
4060
4190
|
this.applyViewHash(window.location.hash);
|
|
4061
4191
|
};
|
|
4062
4192
|
window.addEventListener("hashchange", onHash);
|
|
@@ -4365,4 +4495,4 @@ var VantageViewer = class _VantageViewer {
|
|
|
4365
4495
|
}
|
|
4366
4496
|
};
|
|
4367
4497
|
|
|
4368
|
-
export { DEFAULT_ORBIT_ANGLE, MapControls, SKY_HORIZON, SKY_TOP, TileManager, VANILLA_DISPLAY, VantageViewer, applyCaveRange, buildLowresMesh, buildQuantizedTileMeshes, buildTerrain, buildTileMeshes, createLowresMaterial, createSky, createTerrainMaterial, createWaterMaterial, pickBiome };
|
|
4498
|
+
export { DEFAULT_ORBIT_ANGLE, MapControls, SKY_HORIZON, SKY_TOP, TileManager, VANILLA_DISPLAY, VantageViewer, applyCaveRange, buildLowresMesh, buildQuantizedTileMeshes, buildTerrain, buildTileMeshes, createLowresMaterial, createSky, createTerrainMaterial, createWaterMaterial, pickBiome, setSkyColors };
|
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, H as HttpWorldOptions, L as Lightmap, c as LowresLevel, M as
|
|
1
|
+
export { B as BiomeEntry, b as ByteReader, a as DecodedTextureArray, D as DecodedTile, H as HttpWorldOptions, L as Lightmap, c as LowresLevel, M as ManifestAtmosphere, d as ManifestDimension, e as ManifestTile, f as MeshSection, g as QuantizedSection, Q as QuantizedTile, R as Rgb, S as SurfaceMap, T as TEXTURE_MAGIC, h as TILE_MAGIC, i as TextureAnimation, j as TileMagic, U as UV_SCALE, V as VantageServerOptions, W as WorldConditionalFetch, k as WorldDimension, l as WorldFetch, m as WorldHttpFetch, n as WorldIndex, o as WorldManifest, p as WorldSource, q as biomePalette, r as canonicalQuadIndices, s as isWorldIndex, t as parseManifest, u as parseTextureArray, v as parseTile, w as parseTileQuantized, x as parseWorldIndex, y as pickDimension, z as resolveManifestPath, A as stripNamespace, C as summarizeBiomes, E as summarizeSurfaceBiomes, F as tileKey, G as worldFromDirectory, I as worldFromFiles, J as worldFromHttp, K as worldFromIndexEntry, N as worldFromUrl, O as worldFromVantageServer } from '../biome-CcJerc-b.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, worldFromHttp, worldFromUrl, worldFromVantageServer } from '../chunk-
|
|
1
|
+
export { ByteReader, LOWRES_EMPTY, LOWRES_MAGIC, TEXTURE_MAGIC, TILE_MAGIC, UV_SCALE, biomePalette, canonicalQuadIndices, isGzip, isWorldIndex, maybeInflate, parseLowresTile, parseManifest, parseTextureArray, parseTile, parseTileQuantized, parseWorldIndex, pickDimension, resolveManifestPath, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromHttp, worldFromIndexEntry, worldFromUrl, worldFromVantageServer } from '../chunk-GKNIX375.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 {
|
|
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 { p as WorldSource, B as BiomeEntry, k as WorldDimension } from '../biome-CcJerc-b.js';
|
|
4
|
+
export { D as DecodedTile, n as WorldIndex } from '../biome-CcJerc-b.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-Cy9oGJ-F.js';
|
|
6
|
+
export { D as DEFAULT_ORBIT_ANGLE, V as VANILLA_DISPLAY } from '../viewer-Cy9oGJ-F.js';
|
|
7
7
|
import 'three';
|
|
8
8
|
|
|
9
9
|
interface VantageViewerProps {
|
|
@@ -153,6 +153,15 @@ interface DepthSliderProps {
|
|
|
153
153
|
}
|
|
154
154
|
declare function DepthSlider({ toggleKey, step, className }: DepthSliderProps): react.JSX.Element | null;
|
|
155
155
|
|
|
156
|
+
interface DimensionPickerProps {
|
|
157
|
+
/** Extra class on the root element. */
|
|
158
|
+
className?: string;
|
|
159
|
+
/** Where the picker sits. Default `'top-center'` — it reads as a tab bar
|
|
160
|
+
* above the map, clear of the corner panels. */
|
|
161
|
+
position?: 'top-center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
162
|
+
}
|
|
163
|
+
declare function DimensionPicker({ className, position }: DimensionPickerProps): react.JSX.Element | null;
|
|
164
|
+
|
|
156
165
|
interface ReticleProps {
|
|
157
166
|
className?: string;
|
|
158
167
|
}
|
|
@@ -172,12 +181,17 @@ interface VantageContextValue {
|
|
|
172
181
|
highlightedBiome: number | null;
|
|
173
182
|
/** Biome id under the cursor, or `null`. */
|
|
174
183
|
hoveredBiome: number | null;
|
|
184
|
+
/** Every dimension of the loaded world — empty unless it was loaded from a
|
|
185
|
+
* `world.json` index. */
|
|
186
|
+
dimensions: WorldDimension[];
|
|
187
|
+
/** The dimension currently showing, or `null` for a single-manifest world. */
|
|
188
|
+
dimension: WorldDimension | null;
|
|
175
189
|
}
|
|
176
190
|
/** Access the viewer engine and live state. Must be used under `<VantageViewer>`. */
|
|
177
191
|
declare function useVantage(): VantageContextValue;
|
|
178
192
|
|
|
179
|
-
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";
|
|
193
|
+
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 /* On a phone the cluster is wider than the screen; it scrolls inside its own\n glass rather than running off the edge. */\n max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none;\n animation: vtg-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-nav::-webkit-scrollbar { display: none; }\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; flex: none; 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; flex: none;\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/* --- dimension picker ------------------------------------------------------ */\n.vtg-dims {\n position: absolute; display: flex; align-items: center; gap: 3px; padding: 4px;\n /* Many dimensions (a data-pack world) scroll rather than push the row past\n the viewport edge; the bar keeps its own scrollbar out of the way. */\n max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none;\n /* The centred variant carries its own translate, so it opts out of the\n shared rise animation's transform rather than fighting it. */\n animation: vtg-fade 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;\n}\n.vtg-dims::-webkit-scrollbar { display: none; }\n.vtg-dims-tc { top: 16px; left: 50%; transform: translateX(-50%); }\n.vtg-dims-tl { top: 16px; left: 16px; }\n.vtg-dims-tr { top: 16px; right: 16px; }\n.vtg-dims-bl { bottom: 16px; left: 16px; }\n.vtg-dims-br { bottom: 16px; right: 16px; }\n@keyframes vtg-fade { from { opacity: 0; } to { opacity: 1; } }\n.vtg-dim-btn {\n /* Each dimension carries a restrained accent of its own \u2014 the glyph wears it\n when idle, the whole pill when current. */\n --vtg-k: var(--vtg-accent);\n display: flex; align-items: center; gap: 7px; padding: 5px 11px; flex: none;\n border-radius: 9px; border: 1px solid transparent; background: transparent;\n font: 600 11px var(--vtg-sans); letter-spacing: 0.03em; color: var(--vtg-muted);\n cursor: pointer; white-space: nowrap;\n transition: background 0.15s, color 0.15s, border-color 0.15s;\n}\n.vtg-dim-btn.vtg-k-nether { --vtg-k: #ff8b4a; }\n.vtg-dim-btn.vtg-k-end { --vtg-k: #b39bff; }\n.vtg-dim-btn.vtg-k-custom { --vtg-k: #6fd6bd; }\n.vtg-dim-btn:hover:not(:disabled) { background: rgba(132, 170, 230, 0.14); color: var(--vtg-text); border-color: var(--vtg-line); }\n.vtg-dim-btn:active:not(:disabled) { background: rgba(91, 155, 255, 0.26); }\n.vtg-dim-btn.vtg-on { background: var(--vtg-k); border-color: var(--vtg-k); color: #07101f; }\n.vtg-dim-btn.vtg-on:hover { background: var(--vtg-k); color: #07101f; }\n.vtg-dim-btn:disabled { opacity: 0.38; cursor: default; }\n.vtg-dim-btn:focus-visible { outline: 2px solid var(--vtg-accent); outline-offset: 1px; }\n.vtg-dim-btn.vtg-on:focus-visible { outline-color: var(--vtg-text); }\n/* Fixed slot so swapping glyph \u2192 spinner never resizes the pill. */\n.vtg-dim-ico { width: 15px; height: 15px; flex: none; display: grid; place-items: center; color: var(--vtg-k); }\n.vtg-dim-ico svg { width: 15px; height: 15px; display: block; }\n.vtg-dim-btn.vtg-on .vtg-dim-ico { color: inherit; }\n.vtg-dim-spin {\n width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid currentColor;\n border-top-color: transparent; animation: vtg-spin 0.7s linear infinite;\n}\n@keyframes vtg-spin { to { transform: rotate(360deg); } }\n/* Tight viewports: only the current dimension keeps its name, the rest stay\n glyphs \u2014 the row still reads, and it stops crowding the corner panels. */\n@media (max-width: 900px) {\n .vtg-dim-btn { padding: 6px 8px; }\n .vtg-dim-btn:not(.vtg-on) .vtg-dim-label { display: none; }\n}\n/* Phone width: both top corners are taken, so the row joins the bottom stack,\n sitting just above the navigation cluster. */\n@media (max-width: 640px) {\n .vtg-dims-tc, .vtg-dims-tl, .vtg-dims-tr, .vtg-dims-bl, .vtg-dims-br {\n top: auto; bottom: 64px; left: 50%; right: auto; transform: translateX(-50%);\n }\n}\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\n/* --- keyboard focus -------------------------------------------------------- */\n/* One ring for every control, drawn only for keyboard users. */\n.vtg-navbtn:focus-visible,\n.vtg-compass:focus-visible,\n.vtg-depth-close:focus-visible,\n.vtg-toggle:focus-visible,\n.vtg-seg button:focus-visible {\n outline: 2px solid var(--vtg-accent); outline-offset: 1px;\n}\n.vtg-navbtn.vtg-on:focus-visible, .vtg-toggle.vtg-on:focus-visible { outline-color: var(--vtg-text); }\n\n/* --- reduced motion -------------------------------------------------------- */\n@media (prefers-reduced-motion: reduce) {\n .vtg-panel, .vtg-nav, .vtg-dims, .vtg-depth { animation: none; }\n .vtg-slider input[type=range]::-webkit-slider-thumb:hover { transform: none; }\n /* The spinner still has to read as \"working\", so it breathes instead of turns. */\n .vtg-dim-spin { animation: vtg-pulse 1.4s ease-in-out infinite; }\n}\n@keyframes vtg-pulse { 50% { opacity: 0.3; } }\n";
|
|
180
194
|
/** Inject the component stylesheet once. No-op on the server or after the first call. */
|
|
181
195
|
declare function injectStyles(): void;
|
|
182
196
|
|
|
183
|
-
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 };
|
|
197
|
+
export { BiomeEntry, BiomeLayer, type BiomeLayerProps, CSS, DepthSlider, type DepthSliderProps, DimensionPicker, type DimensionPickerProps, 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, WorldDimension, injectStyles, useVantage };
|