@thoughts-on-things/vantage-mc 0.12.0 → 0.13.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 +29 -8
- package/dist/{biome-CcJerc-b.d.ts → biome-RR-ydR2j.d.ts} +69 -1
- package/dist/{chunk-GKNIX375.js → chunk-CAQDMI2B.js} +86 -1
- package/dist/{chunk-QV6SDOVV.js → chunk-KGHALEXY.js} +967 -30
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/react/index.d.ts +22 -6
- package/dist/react/index.js +186 -9
- package/dist/three/index.d.ts +51 -4
- package/dist/three/index.js +2 -2
- package/dist/{viewer-Cy9oGJ-F.d.ts → viewer-CXujqMxK.d.ts} +205 -5
- package/package.json +1 -1
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 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,
|
|
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, N as NO_PLAYERS, P as PlayerSnapshot, g as PlayerState, h as QuantizedSection, Q as QuantizedTile, R as Rgb, S as SurfaceMap, T as TEXTURE_MAGIC, i as TILE_MAGIC, j as TextureAnimation, k as TileMagic, U as UV_SCALE, V as VantageServerOptions, W as WorldConditionalFetch, l as WorldDimension, m as WorldFetch, n as WorldHttpFetch, o as WorldIndex, p as WorldManifest, q as WorldSource, r as angleDelta, s as biomePalette, t as canonicalQuadIndices, u as isWorldIndex, v as parseManifest, w as parsePlayers, x as parseTextureArray, y as parseTile, z as parseTileQuantized, A as parseWorldIndex, C as pickDimension, E as resolveManifestPath, F as samePlayers, G as stripNamespace, I as summarizeBiomes, J as summarizeSurfaceBiomes, K as tileKey, O as worldFromDirectory, X as worldFromFiles, Y as worldFromHttp, Z as worldFromIndexEntry, _ as worldFromUrl, $ as worldFromVantageServer, a0 as wrapDegrees } from '../biome-RR-ydR2j.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, isWorldIndex, maybeInflate, parseLowresTile, parseManifest, parseTextureArray, parseTile, parseTileQuantized, parseWorldIndex, pickDimension, resolveManifestPath, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromHttp, worldFromIndexEntry, worldFromUrl, worldFromVantageServer } from '../chunk-
|
|
1
|
+
export { ByteReader, LOWRES_EMPTY, LOWRES_MAGIC, NO_PLAYERS, TEXTURE_MAGIC, TILE_MAGIC, UV_SCALE, angleDelta, biomePalette, canonicalQuadIndices, isGzip, isWorldIndex, maybeInflate, parseLowresTile, parseManifest, parsePlayers, parseTextureArray, parseTile, parseTileQuantized, parseWorldIndex, pickDimension, resolveManifestPath, samePlayers, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromHttp, worldFromIndexEntry, worldFromUrl, worldFromVantageServer, wrapDegrees } from '../chunk-CAQDMI2B.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,
|
|
5
|
-
import {
|
|
6
|
-
export { D as DEFAULT_ORBIT_ANGLE, V as VANILLA_DISPLAY } from '../viewer-
|
|
3
|
+
import { q as WorldSource, B as BiomeEntry, l as WorldDimension } from '../biome-RR-ydR2j.js';
|
|
4
|
+
export { D as DecodedTile, o as WorldIndex } from '../biome-RR-ydR2j.js';
|
|
5
|
+
import { k as TileSource, T as TextureSource, S as StreamingSettings, o as ViewMode, L as LightSettings, a as DisplaySettings, e as PlayerOptions, h as TileInfo, m as VantageViewer$1 } from '../viewer-CXujqMxK.js';
|
|
6
|
+
export { D as DEFAULT_ORBIT_ANGLE, f as PlayerSettings, g as PlayerView, V as VANILLA_DISPLAY } from '../viewer-CXujqMxK.js';
|
|
7
7
|
import 'three';
|
|
8
8
|
|
|
9
9
|
interface VantageViewerProps {
|
|
@@ -35,6 +35,9 @@ interface VantageViewerProps {
|
|
|
35
35
|
/** Live display fidelity (sharpness, AO, saturation, contrast, fog, render
|
|
36
36
|
* scale). Applied on change without re-baking — drive it from sliders. */
|
|
37
37
|
display?: DisplaySettings;
|
|
38
|
+
/** Live players. Polling starts by itself when the world serves a roster;
|
|
39
|
+
* pass `{ enabled: false }` to keep them off. Display fields apply live. */
|
|
40
|
+
players?: PlayerOptions;
|
|
38
41
|
/** Keep the camera in the URL hash so any view is a shareable deep link.
|
|
39
42
|
* Default `true` — pass `false` if the page owns its hash (e.g. a router). */
|
|
40
43
|
urlState?: boolean;
|
|
@@ -144,6 +147,19 @@ interface MapNavProps {
|
|
|
144
147
|
}
|
|
145
148
|
declare function MapNav({ compass, tilt, fly, zoom, home, coords, caves, screenshot, fullscreen, className, }: MapNavProps): react.JSX.Element | null;
|
|
146
149
|
|
|
150
|
+
interface PlayerListProps {
|
|
151
|
+
/** Panel heading. Default `'players'`. */
|
|
152
|
+
title?: string;
|
|
153
|
+
/** Start collapsed (header only). Default `false` — the roster is the point. */
|
|
154
|
+
defaultCollapsed?: boolean;
|
|
155
|
+
/** Key that shows/hides players on the map. Default `'p'`; `null` disables. */
|
|
156
|
+
toggleKey?: string | null;
|
|
157
|
+
/** Override the panel's placement/size. */
|
|
158
|
+
style?: CSSProperties;
|
|
159
|
+
className?: string;
|
|
160
|
+
}
|
|
161
|
+
declare function PlayerList({ title, defaultCollapsed, toggleKey, style, className }: PlayerListProps): react.JSX.Element | null;
|
|
162
|
+
|
|
147
163
|
interface DepthSliderProps {
|
|
148
164
|
/** Key that toggles the cave view. Default `'c'`; pass `null` to disable. */
|
|
149
165
|
toggleKey?: string | null;
|
|
@@ -190,8 +206,8 @@ interface VantageContextValue {
|
|
|
190
206
|
/** Access the viewer engine and live state. Must be used under `<VantageViewer>`. */
|
|
191
207
|
declare function useVantage(): VantageContextValue;
|
|
192
208
|
|
|
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";
|
|
209
|
+
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/* --- player roster -------------------------------------------------------- */\n.vtg-players { overflow-y: auto; padding: 7px; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }\n.vtg-player { gap: 8px; }\n.vtg-player:focus-visible { outline: 2px solid var(--vtg-accent); outline-offset: -2px; }\n/* Faces are 8\u00D78 skin pixels blown up: nearest-neighbour keeps them crisp\n instead of turning them into four smudged blobs. */\n.vtg-face {\n width: 16px; height: 16px; flex: none; border-radius: 3px;\n image-rendering: pixelated; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);\n}\n.vtg-face-blank { background: rgba(132, 170, 230, 0.2); }\n.vtg-follow {\n flex: none; width: 20px; height: 20px; padding: 3px; margin: -2px -3px -2px 0;\n display: grid; place-items: center; border: none; border-radius: 6px;\n background: transparent; color: var(--vtg-dim); cursor: pointer;\n opacity: 0; transition: opacity 0.16s, color 0.16s, background 0.16s;\n}\n.vtg-follow svg { width: 100%; height: 100%; }\n/* The pin only shows on the row you are pointing at \u2014 or permanently, once it\n is the reason the camera is where it is. */\n.vtg-player:hover .vtg-follow, .vtg-player:focus-within .vtg-follow, .vtg-follow.vtg-on { opacity: 1; }\n.vtg-follow:hover { color: var(--vtg-text); background: rgba(132, 170, 230, 0.18); }\n.vtg-follow.vtg-on { color: var(--vtg-accent); }\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";
|
|
194
210
|
/** Inject the component stylesheet once. No-op on the server or after the first call. */
|
|
195
211
|
declare function injectStyles(): void;
|
|
196
212
|
|
|
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 };
|
|
213
|
+
export { BiomeEntry, BiomeLayer, type BiomeLayerProps, CSS, DepthSlider, type DepthSliderProps, DimensionPicker, type DimensionPickerProps, DisplaySettings, LightPanel, type LightPanelProps, LightSettings, MapNav, type MapNavProps, Panel, type PanelProps, PlayerList, type PlayerListProps, PlayerOptions, 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 };
|
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VantageViewer, DEFAULT_ORBIT_ANGLE } from '../chunk-
|
|
2
|
-
export { DEFAULT_ORBIT_ANGLE, VANILLA_DISPLAY } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
import { VantageViewer, DEFAULT_ORBIT_ANGLE } from '../chunk-KGHALEXY.js';
|
|
2
|
+
export { DEFAULT_ORBIT_ANGLE, VANILLA_DISPLAY } from '../chunk-KGHALEXY.js';
|
|
3
|
+
import '../chunk-CAQDMI2B.js';
|
|
4
4
|
import { createContext, forwardRef, useRef, useState, useImperativeHandle, useEffect, useMemo, useContext } from 'react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -100,6 +100,30 @@ var CSS = `
|
|
|
100
100
|
.vtg-name { overflow: hidden; text-overflow: ellipsis; }
|
|
101
101
|
.vtg-pct { margin-left: auto; color: var(--vtg-dim); font: 11px var(--vtg-mono); font-variant-numeric: tabular-nums; }
|
|
102
102
|
|
|
103
|
+
/* --- player roster -------------------------------------------------------- */
|
|
104
|
+
.vtg-players { overflow-y: auto; padding: 7px; scrollbar-width: thin; scrollbar-color: rgba(132,170,230,0.3) transparent; }
|
|
105
|
+
.vtg-player { gap: 8px; }
|
|
106
|
+
.vtg-player:focus-visible { outline: 2px solid var(--vtg-accent); outline-offset: -2px; }
|
|
107
|
+
/* Faces are 8\xD78 skin pixels blown up: nearest-neighbour keeps them crisp
|
|
108
|
+
instead of turning them into four smudged blobs. */
|
|
109
|
+
.vtg-face {
|
|
110
|
+
width: 16px; height: 16px; flex: none; border-radius: 3px;
|
|
111
|
+
image-rendering: pixelated; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
|
|
112
|
+
}
|
|
113
|
+
.vtg-face-blank { background: rgba(132, 170, 230, 0.2); }
|
|
114
|
+
.vtg-follow {
|
|
115
|
+
flex: none; width: 20px; height: 20px; padding: 3px; margin: -2px -3px -2px 0;
|
|
116
|
+
display: grid; place-items: center; border: none; border-radius: 6px;
|
|
117
|
+
background: transparent; color: var(--vtg-dim); cursor: pointer;
|
|
118
|
+
opacity: 0; transition: opacity 0.16s, color 0.16s, background 0.16s;
|
|
119
|
+
}
|
|
120
|
+
.vtg-follow svg { width: 100%; height: 100%; }
|
|
121
|
+
/* The pin only shows on the row you are pointing at \u2014 or permanently, once it
|
|
122
|
+
is the reason the camera is where it is. */
|
|
123
|
+
.vtg-player:hover .vtg-follow, .vtg-player:focus-within .vtg-follow, .vtg-follow.vtg-on { opacity: 1; }
|
|
124
|
+
.vtg-follow:hover { color: var(--vtg-text); background: rgba(132, 170, 230, 0.18); }
|
|
125
|
+
.vtg-follow.vtg-on { color: var(--vtg-accent); }
|
|
126
|
+
|
|
103
127
|
/* --- segmented toggle (render mode) --------------------------------------- */
|
|
104
128
|
.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); }
|
|
105
129
|
.vtg-seg button {
|
|
@@ -380,6 +404,7 @@ var VantageViewer2 = forwardRef(function VantageViewer3(props, ref) {
|
|
|
380
404
|
renderOnDemand = true,
|
|
381
405
|
light,
|
|
382
406
|
display,
|
|
407
|
+
players,
|
|
383
408
|
urlState = true,
|
|
384
409
|
className,
|
|
385
410
|
style,
|
|
@@ -402,7 +427,7 @@ var VantageViewer2 = forwardRef(function VantageViewer3(props, ref) {
|
|
|
402
427
|
injectStyles();
|
|
403
428
|
const el = canvasRef.current;
|
|
404
429
|
if (!el) return;
|
|
405
|
-
const v = new VantageViewer(el, { antialias, maxPixelRatio, renderOnDemand, view, light, display, streaming, urlState });
|
|
430
|
+
const v = new VantageViewer(el, { antialias, maxPixelRatio, renderOnDemand, view, light, display, streaming, players, urlState });
|
|
406
431
|
engineRef.current = v;
|
|
407
432
|
setEngine(v);
|
|
408
433
|
let pendingStats = null;
|
|
@@ -465,6 +490,9 @@ var VantageViewer2 = forwardRef(function VantageViewer3(props, ref) {
|
|
|
465
490
|
useEffect(() => {
|
|
466
491
|
if (engine && streaming) engine.setStreaming(streaming);
|
|
467
492
|
}, [engine, streaming?.viewDistance, streaming?.maxTiles, streaming?.concurrency, streaming?.maxBytes, streaming?.tileCacheBytes, streaming?.mapMemory]);
|
|
493
|
+
useEffect(() => {
|
|
494
|
+
if (engine && players) engine.setPlayers(players);
|
|
495
|
+
}, [engine, players?.enabled, players?.names, players?.offline, players?.foreign, players?.scale, players?.tagSize]);
|
|
468
496
|
const ctx = useMemo(
|
|
469
497
|
() => ({
|
|
470
498
|
viewer: engine,
|
|
@@ -925,6 +953,155 @@ function MapNav({
|
|
|
925
953
|
)
|
|
926
954
|
] });
|
|
927
955
|
}
|
|
956
|
+
var PIN = /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
957
|
+
/* @__PURE__ */ jsx("path", { d: "M8 9.4V14" }),
|
|
958
|
+
/* @__PURE__ */ jsx("path", { d: "M5 2h6l-.8 4.2 2 2.2H3.8l2-2.2z" })
|
|
959
|
+
] });
|
|
960
|
+
var ICON = /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
961
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "5", r: "2.6" }),
|
|
962
|
+
/* @__PURE__ */ jsx("path", { d: "M2.8 13.8c0-2.6 2.3-4.2 5.2-4.2s5.2 1.6 5.2 4.2" })
|
|
963
|
+
] });
|
|
964
|
+
function distanceLabel(blocks) {
|
|
965
|
+
if (blocks < 1e3) return `${Math.round(blocks)}m`;
|
|
966
|
+
return `${(blocks / 1e3).toFixed(1)}km`;
|
|
967
|
+
}
|
|
968
|
+
function agoLabel(seen) {
|
|
969
|
+
if (!seen || seen <= 0) return null;
|
|
970
|
+
const seconds = (Date.now() - seen) / 1e3;
|
|
971
|
+
if (seconds < 0 || seconds > 60 * 60 * 24 * 3650) return null;
|
|
972
|
+
if (seconds < 90) return "just now";
|
|
973
|
+
if (seconds < 3600) return `${Math.round(seconds / 60)}m ago`;
|
|
974
|
+
if (seconds < 86400) return `${Math.round(seconds / 3600)}h ago`;
|
|
975
|
+
return `${Math.round(seconds / 86400)}d ago`;
|
|
976
|
+
}
|
|
977
|
+
function describe(player, ago) {
|
|
978
|
+
const parts = [`${player.name} \xB7 ${Math.round(player.x)}, ${Math.round(player.y)}, ${Math.round(player.z)}`];
|
|
979
|
+
if (player.foreign && player.dimension) parts.push(player.dimension.split(":").pop());
|
|
980
|
+
if (player.gamemode) parts.push(player.gamemode);
|
|
981
|
+
if (player.health !== void 0) parts.push(`${Math.round(player.health * 10) / 10} hp`);
|
|
982
|
+
if (ago) parts.push(`last seen ${ago}`);
|
|
983
|
+
return parts.join(" \xB7 ");
|
|
984
|
+
}
|
|
985
|
+
function isTypingTarget2(target) {
|
|
986
|
+
const el = target;
|
|
987
|
+
if (!el || !el.tagName) return false;
|
|
988
|
+
return el.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName);
|
|
989
|
+
}
|
|
990
|
+
function PlayerList({ title = "players", defaultCollapsed = false, toggleKey = "p", style, className }) {
|
|
991
|
+
const { viewer } = useVantage();
|
|
992
|
+
const [players, setPlayers] = useState([]);
|
|
993
|
+
const [available, setAvailable] = useState(false);
|
|
994
|
+
const [live, setLive] = useState(true);
|
|
995
|
+
const [following, setFollowing] = useState(null);
|
|
996
|
+
const [, setTick] = useState(0);
|
|
997
|
+
useEffect(() => {
|
|
998
|
+
if (!viewer) return;
|
|
999
|
+
setPlayers(viewer.players);
|
|
1000
|
+
setFollowing(viewer.followedPlayer);
|
|
1001
|
+
const offs = [
|
|
1002
|
+
viewer.on("players", (e) => {
|
|
1003
|
+
setPlayers(e.players);
|
|
1004
|
+
setAvailable(e.available);
|
|
1005
|
+
}),
|
|
1006
|
+
viewer.on("follow", ({ uuid }) => setFollowing(uuid)),
|
|
1007
|
+
// A world reload drops the roster with it.
|
|
1008
|
+
viewer.on("load", () => {
|
|
1009
|
+
setPlayers([]);
|
|
1010
|
+
setAvailable(false);
|
|
1011
|
+
setFollowing(null);
|
|
1012
|
+
})
|
|
1013
|
+
];
|
|
1014
|
+
const timer = setInterval(() => setTick((t) => t + 1), 1e3);
|
|
1015
|
+
return () => {
|
|
1016
|
+
offs.forEach((off) => off());
|
|
1017
|
+
clearInterval(timer);
|
|
1018
|
+
};
|
|
1019
|
+
}, [viewer]);
|
|
1020
|
+
useEffect(() => {
|
|
1021
|
+
if (!viewer || !toggleKey) return;
|
|
1022
|
+
const onKey = (e) => {
|
|
1023
|
+
if (isTypingTarget2(e.target) || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
1024
|
+
if (e.key.toLowerCase() !== toggleKey.toLowerCase()) return;
|
|
1025
|
+
setLive((on) => {
|
|
1026
|
+
viewer.setPlayers({ enabled: !on });
|
|
1027
|
+
return !on;
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1030
|
+
window.addEventListener("keydown", onKey);
|
|
1031
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
1032
|
+
}, [viewer, toggleKey]);
|
|
1033
|
+
if (!viewer || !available || players.length === 0) return null;
|
|
1034
|
+
const focus = viewer.controls.position;
|
|
1035
|
+
const rows = players.map((p) => ({ p, distance: Math.hypot(p.drawX - focus.x, p.drawZ - focus.z) })).sort((a, b) => Number(a.p.stale) - Number(b.p.stale) || a.distance - b.distance);
|
|
1036
|
+
const online = players.filter((p) => !p.stale).length;
|
|
1037
|
+
const toggle = () => {
|
|
1038
|
+
const next = !live;
|
|
1039
|
+
setLive(next);
|
|
1040
|
+
viewer.setPlayers({ enabled: next });
|
|
1041
|
+
};
|
|
1042
|
+
return /* @__PURE__ */ jsx(
|
|
1043
|
+
Panel,
|
|
1044
|
+
{
|
|
1045
|
+
icon: ICON,
|
|
1046
|
+
title,
|
|
1047
|
+
defaultCollapsed,
|
|
1048
|
+
className,
|
|
1049
|
+
style: { top: 16, left: 16, right: "auto", width: 216, ...style },
|
|
1050
|
+
headerExtra: /* @__PURE__ */ jsx(
|
|
1051
|
+
"button",
|
|
1052
|
+
{
|
|
1053
|
+
type: "button",
|
|
1054
|
+
className: `vtg-toggle${live ? " vtg-on" : ""}`,
|
|
1055
|
+
"aria-pressed": live,
|
|
1056
|
+
title: `${live ? "Hide" : "Show"} players on the map${toggleKey ? ` (${toggleKey.toUpperCase()})` : ""}`,
|
|
1057
|
+
onClick: toggle,
|
|
1058
|
+
children: online > 0 ? `${online} on` : `${players.length}`
|
|
1059
|
+
}
|
|
1060
|
+
),
|
|
1061
|
+
children: /* @__PURE__ */ jsx("div", { className: "vtg-players", children: rows.map(({ p, distance }) => {
|
|
1062
|
+
const ago = p.stale ? agoLabel(p.seen) : null;
|
|
1063
|
+
const icon = viewer.playerIcon(p.uuid);
|
|
1064
|
+
const followed = following === p.uuid;
|
|
1065
|
+
return /* @__PURE__ */ jsxs(
|
|
1066
|
+
"div",
|
|
1067
|
+
{
|
|
1068
|
+
className: `vtg-row vtg-player${p.stale ? " vtg-dim" : ""}${followed ? " vtg-sel" : ""}`,
|
|
1069
|
+
role: "button",
|
|
1070
|
+
tabIndex: 0,
|
|
1071
|
+
title: describe(p, ago),
|
|
1072
|
+
onClick: () => viewer.focusPlayer(p.uuid),
|
|
1073
|
+
onKeyDown: (e) => {
|
|
1074
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
1075
|
+
e.preventDefault();
|
|
1076
|
+
viewer.focusPlayer(p.uuid);
|
|
1077
|
+
},
|
|
1078
|
+
children: [
|
|
1079
|
+
icon ? /* @__PURE__ */ jsx("img", { className: "vtg-face", src: icon, alt: "", width: 16, height: 16 }) : /* @__PURE__ */ jsx("span", { className: "vtg-face vtg-face-blank" }),
|
|
1080
|
+
/* @__PURE__ */ jsx("span", { className: "vtg-name", children: p.name }),
|
|
1081
|
+
/* @__PURE__ */ jsx("span", { className: "vtg-pct", children: p.foreign ? p.dimension?.split(":").pop() ?? "away" : ago ?? distanceLabel(distance) }),
|
|
1082
|
+
p.visible && /* @__PURE__ */ jsx(
|
|
1083
|
+
"button",
|
|
1084
|
+
{
|
|
1085
|
+
type: "button",
|
|
1086
|
+
className: `vtg-follow${followed ? " vtg-on" : ""}`,
|
|
1087
|
+
"aria-pressed": followed,
|
|
1088
|
+
"aria-label": followed ? `Stop following ${p.name}` : `Follow ${p.name}`,
|
|
1089
|
+
title: followed ? "Stop following" : `Follow ${p.name}`,
|
|
1090
|
+
onClick: (e) => {
|
|
1091
|
+
e.stopPropagation();
|
|
1092
|
+
viewer.followPlayer(followed ? null : p.uuid);
|
|
1093
|
+
},
|
|
1094
|
+
children: PIN
|
|
1095
|
+
}
|
|
1096
|
+
)
|
|
1097
|
+
]
|
|
1098
|
+
},
|
|
1099
|
+
p.uuid
|
|
1100
|
+
);
|
|
1101
|
+
}) })
|
|
1102
|
+
}
|
|
1103
|
+
);
|
|
1104
|
+
}
|
|
928
1105
|
var CORE = {
|
|
929
1106
|
overworld: {
|
|
930
1107
|
gradient: "linear-gradient(180deg, #6f9bce 0%, #6e9150 12%, #6e6f74 48%, #3e424b 76%, #16181d 100%)",
|
|
@@ -950,7 +1127,7 @@ var CORE = {
|
|
|
950
1127
|
marks: [{ y: 0, label: "0" }]
|
|
951
1128
|
}
|
|
952
1129
|
};
|
|
953
|
-
function
|
|
1130
|
+
function isTypingTarget3(t) {
|
|
954
1131
|
if (!(t instanceof HTMLElement)) return false;
|
|
955
1132
|
return t.isContentEditable || t.tagName === "INPUT" || t.tagName === "TEXTAREA";
|
|
956
1133
|
}
|
|
@@ -966,7 +1143,7 @@ function DepthSlider({ toggleKey = "c", step = 4, className }) {
|
|
|
966
1143
|
useEffect(() => {
|
|
967
1144
|
if (!viewer) return;
|
|
968
1145
|
const onKey = (e) => {
|
|
969
|
-
if (
|
|
1146
|
+
if (isTypingTarget3(e.target)) return;
|
|
970
1147
|
if (toggleKey && e.key.toLowerCase() === toggleKey.toLowerCase()) {
|
|
971
1148
|
if (viewer.hasCaves || viewer.slice !== null) viewer.toggleSlice();
|
|
972
1149
|
} else if (viewer.slice !== null && (e.key === "[" || e.key === "]")) {
|
|
@@ -1043,7 +1220,7 @@ function DepthSlider({ toggleKey = "c", step = 4, className }) {
|
|
|
1043
1220
|
)
|
|
1044
1221
|
] });
|
|
1045
1222
|
}
|
|
1046
|
-
var
|
|
1223
|
+
var ICON2 = {
|
|
1047
1224
|
overworld: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1048
1225
|
/* @__PURE__ */ jsx("circle", { cx: "11.7", cy: "4.3", r: "1.9" }),
|
|
1049
1226
|
/* @__PURE__ */ jsx("path", { d: "M1.6 12.6 5.3 7.4l2.4 3.1 1.6-1.9 3.6 4z" })
|
|
@@ -1131,7 +1308,7 @@ function DimensionPicker({ className, position = "top-center" }) {
|
|
|
1131
1308
|
onFocus: () => setRoving(i),
|
|
1132
1309
|
onClick: () => select(d),
|
|
1133
1310
|
children: [
|
|
1134
|
-
/* @__PURE__ */ jsx("span", { className: "vtg-dim-ico", "aria-hidden": "true", children: busy ? /* @__PURE__ */ jsx("i", { className: "vtg-dim-spin" }) :
|
|
1311
|
+
/* @__PURE__ */ jsx("span", { className: "vtg-dim-ico", "aria-hidden": "true", children: busy ? /* @__PURE__ */ jsx("i", { className: "vtg-dim-spin" }) : ICON2[d.kind] }),
|
|
1135
1312
|
/* @__PURE__ */ jsx("span", { className: "vtg-dim-label", children: d.label })
|
|
1136
1313
|
]
|
|
1137
1314
|
},
|
|
@@ -1166,4 +1343,4 @@ function Reticle({ className }) {
|
|
|
1166
1343
|
] });
|
|
1167
1344
|
}
|
|
1168
1345
|
|
|
1169
|
-
export { BiomeLayer, CSS, DepthSlider, DimensionPicker, LightPanel, MapNav, Panel, QUALITY_PRESETS, Reticle, SettingsPanel, VantageViewer2 as VantageViewer, injectStyles, useVantage };
|
|
1346
|
+
export { BiomeLayer, CSS, DepthSlider, DimensionPicker, LightPanel, MapNav, Panel, PlayerList, QUALITY_PRESETS, Reticle, SettingsPanel, VantageViewer2 as VantageViewer, injectStyles, useVantage };
|
package/dist/three/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { R as Rgb, Q as QuantizedTile, D as DecodedTile, a as DecodedTextureArray, S as SurfaceMap } from '../biome-
|
|
3
|
-
export { B as BiomeEntry, b as ByteReader, H as HttpWorldOptions, L as Lightmap, c as LowresLevel, M as ManifestAtmosphere, d as ManifestDimension, e as ManifestTile, f as MeshSection, g as QuantizedSection, T as TEXTURE_MAGIC,
|
|
2
|
+
import { R as Rgb, Q as QuantizedTile, D as DecodedTile, a as DecodedTextureArray, S as SurfaceMap } from '../biome-RR-ydR2j.js';
|
|
3
|
+
export { B as BiomeEntry, b as ByteReader, H as HttpWorldOptions, L as Lightmap, c as LowresLevel, M as ManifestAtmosphere, d as ManifestDimension, e as ManifestTile, f as MeshSection, N as NO_PLAYERS, P as PlayerSnapshot, g as PlayerState, h as QuantizedSection, T as TEXTURE_MAGIC, i as TILE_MAGIC, j as TextureAnimation, k as TileMagic, U as UV_SCALE, V as VantageServerOptions, W as WorldConditionalFetch, l as WorldDimension, m as WorldFetch, n as WorldHttpFetch, o as WorldIndex, p as WorldManifest, q as WorldSource, r as angleDelta, s as biomePalette, t as canonicalQuadIndices, u as isWorldIndex, v as parseManifest, w as parsePlayers, x as parseTextureArray, y as parseTile, z as parseTileQuantized, A as parseWorldIndex, C as pickDimension, E as resolveManifestPath, F as samePlayers, G as stripNamespace, I as summarizeBiomes, J as summarizeSurfaceBiomes, K as tileKey, O as worldFromDirectory, X as worldFromFiles, Y as worldFromHttp, Z as worldFromIndexEntry, _ as worldFromUrl, $ as worldFromVantageServer, a0 as wrapDegrees } from '../biome-RR-ydR2j.js';
|
|
4
4
|
import { LowresTile } from '../core/index.js';
|
|
5
5
|
export { LOWRES_EMPTY, LOWRES_MAGIC, isGzip, maybeInflate, parseLowresTile } from '../core/index.js';
|
|
6
|
-
export { D as DEFAULT_ORBIT_ANGLE, a as DisplaySettings, H as HeightSampler, L as LightSettings, b as LoadOptions, M as MapControls, c as MapControlsOptions, S as StreamingSettings, T as TextureSource,
|
|
6
|
+
export { D as DEFAULT_ORBIT_ANGLE, a as DisplaySettings, H as HeightSampler, L as LightSettings, b as LoadOptions, M as MapControls, c as MapControlsOptions, P as PlayerLayer, d as PlayerLayerOptions, e as PlayerOptions, f as PlayerSettings, g as PlayerView, S as StreamingSettings, T as TextureSource, h as TileInfo, i as TileManager, j as TileManagerOptions, k as TileSource, l as TileStats, V as VANILLA_DISPLAY, m as VantageViewer, n as VantageViewerOptions, o as ViewMode } from '../viewer-CXujqMxK.js';
|
|
7
7
|
|
|
8
8
|
/** The objects and metadata produced from a tile. */
|
|
9
9
|
interface TerrainObjects {
|
|
@@ -126,4 +126,51 @@ declare function createSky(): THREE.Mesh;
|
|
|
126
126
|
*/
|
|
127
127
|
declare function pickBiome(ray: THREE.Ray, surf: SurfaceMap, bounds: THREE.Box3): number;
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
/** Skin sheet size. Modern skins are 64×64; legacy 64×32 sheets are drawn onto
|
|
130
|
+
* a 64×64 canvas with the missing limbs mirrored in (see {@link normalizeSkin}). */
|
|
131
|
+
declare const SKIN_SIZE = 64;
|
|
132
|
+
/** One face rectangle in skin pixels, origin top-left. */
|
|
133
|
+
interface FaceRect {
|
|
134
|
+
x: number;
|
|
135
|
+
y: number;
|
|
136
|
+
w: number;
|
|
137
|
+
h: number;
|
|
138
|
+
}
|
|
139
|
+
/** The six face rects of a cube, in three.js `BoxGeometry` face order:
|
|
140
|
+
* `+X, -X, +Y, -Y, +Z, -Z`. The model faces `+Z`, so `+Z` is the front and
|
|
141
|
+
* `-X` is the player's right. */
|
|
142
|
+
type BoxFaces = [FaceRect, FaceRect, FaceRect, FaceRect, FaceRect, FaceRect];
|
|
143
|
+
/**
|
|
144
|
+
* Unwrap a cube of `w × h × d` skin pixels whose layout block starts at
|
|
145
|
+
* `(x, y)`. This is the standard Minecraft cross: depth-wide side flaps, the
|
|
146
|
+
* top and bottom above, and the faces reading right, front, left, back.
|
|
147
|
+
*/
|
|
148
|
+
declare function boxFaces(x: number, y: number, w: number, h: number, d: number): BoxFaces;
|
|
149
|
+
/** A stable 32-bit hash of a player id, so the same player always gets the
|
|
150
|
+
* same colours across sessions and machines. */
|
|
151
|
+
declare function hashId(id: string): number;
|
|
152
|
+
/**
|
|
153
|
+
* Draw a complete, plausible 64×64 skin for a player we have no real skin for.
|
|
154
|
+
*
|
|
155
|
+
* Deliberately not a copy of Steve or Alex: the colours come from the player's
|
|
156
|
+
* own id, so a server full of unskinned players reads as a crowd of distinct
|
|
157
|
+
* people rather than a row of identical mannequins — and Vantage ships no
|
|
158
|
+
* Mojang artwork.
|
|
159
|
+
*/
|
|
160
|
+
declare function defaultSkinCanvas(id: string, doc?: Document): HTMLCanvasElement;
|
|
161
|
+
/**
|
|
162
|
+
* Normalize any skin image onto a 64×64 canvas.
|
|
163
|
+
*
|
|
164
|
+
* A legacy 64×32 sheet has no left arm or leg and no second layer below the
|
|
165
|
+
* hat; Minecraft mirrors the right limbs into the left slots, and so do we, or
|
|
166
|
+
* half the model would render transparent.
|
|
167
|
+
*/
|
|
168
|
+
declare function normalizeSkin(image: CanvasImageSource, width: number, height: number, doc?: Document): HTMLCanvasElement;
|
|
169
|
+
/**
|
|
170
|
+
* Crop a player's face — the head's front plus whatever the hat layer draws
|
|
171
|
+
* over it — into a square canvas, for the map marker and the player list. This
|
|
172
|
+
* is the same image every Minecraft server's player list shows.
|
|
173
|
+
*/
|
|
174
|
+
declare function headIconCanvas(skin: CanvasImageSource, size?: number, doc?: Document): HTMLCanvasElement;
|
|
175
|
+
|
|
176
|
+
export { type BoxFaces, DecodedTextureArray, DecodedTile, type FaceRect, LowresTile, QuantizedTile, Rgb, SKIN_SIZE, SKY_HORIZON, SKY_TOP, SurfaceMap, type TerrainMaterialOptions, type TerrainObjects, type TileMeshes, applyCaveRange, boxFaces, buildLowresMesh, buildQuantizedTileMeshes, buildTerrain, buildTileMeshes, createLowresMaterial, createSky, createTerrainMaterial, createWaterMaterial, defaultSkinCanvas, hashId, headIconCanvas, normalizeSkin, pickBiome, setSkyColors };
|
package/dist/three/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEFAULT_ORBIT_ANGLE, MapControls, SKY_HORIZON, SKY_TOP, TileManager, VANILLA_DISPLAY, VantageViewer, applyCaveRange, buildLowresMesh, buildQuantizedTileMeshes, buildTerrain, buildTileMeshes, createLowresMaterial, createSky, createTerrainMaterial, createWaterMaterial, pickBiome, setSkyColors } from '../chunk-
|
|
2
|
-
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-
|
|
1
|
+
export { DEFAULT_ORBIT_ANGLE, MapControls, PlayerLayer, SKIN_SIZE, SKY_HORIZON, SKY_TOP, TileManager, VANILLA_DISPLAY, VantageViewer, applyCaveRange, boxFaces, buildLowresMesh, buildQuantizedTileMeshes, buildTerrain, buildTileMeshes, createLowresMaterial, createSky, createTerrainMaterial, createWaterMaterial, defaultSkinCanvas, hashId, headIconCanvas, normalizeSkin, pickBiome, setSkyColors } from '../chunk-KGHALEXY.js';
|
|
2
|
+
export { ByteReader, LOWRES_EMPTY, LOWRES_MAGIC, NO_PLAYERS, TEXTURE_MAGIC, TILE_MAGIC, UV_SCALE, angleDelta, biomePalette, canonicalQuadIndices, isGzip, isWorldIndex, maybeInflate, parseLowresTile, parseManifest, parsePlayers, parseTextureArray, parseTile, parseTileQuantized, parseWorldIndex, pickDimension, resolveManifestPath, samePlayers, stripNamespace, summarizeBiomes, summarizeSurfaceBiomes, tileKey, worldFromDirectory, worldFromFiles, worldFromHttp, worldFromIndexEntry, worldFromUrl, worldFromVantageServer, wrapDegrees } from '../chunk-CAQDMI2B.js';
|