@tileflow/dev 0.1.0-alpha.32 → 0.1.0-alpha.33
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 +22 -14
- package/dist/artifacts.d.ts +2 -2
- package/dist/artifacts.js +2 -2
- package/dist/{chunk-F4PLTZS4.js → chunk-QYU4OW5A.js} +38 -4
- package/dist/{chunk-CM6ZTYDJ.js → chunk-WJOF6USY.js} +3 -2
- package/dist/devtools-browser.js +2221 -2660
- package/dist/fonts.d.ts +1 -1
- package/dist/{icons-B84H8Ymu.d.ts → icons-BdOehQmB.d.ts} +20 -2
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +3 -1
- package/dist/preview.js +47 -13
- package/dist/server.d.ts +1 -1
- package/dist/server.js +302 -56
- package/docs/beacon-map-audits.md +56 -13
- package/docs/bounded-vector-feature-inspection.md +3 -4
- package/docs/layers-inspection.md +6 -1
- package/docs/local-comparison-workbench-and-compiler-inspection.md +4 -4
- package/docs/map-design-diagnostics.md +76 -0
- package/package.json +3 -3
package/dist/fonts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TileflowFontBundleManifest, MapLibreStyle } from '@tileflow/core';
|
|
2
2
|
import { TileflowEffectiveFontSourceIdentity, TileflowBuildStyles, TileflowBuildCatalog } from '@tileflow/core/build';
|
|
3
|
-
import { T as TileflowBuildAsset } from './icons-
|
|
3
|
+
import { T as TileflowBuildAsset } from './icons-BdOehQmB.js';
|
|
4
4
|
|
|
5
5
|
type TileflowFontCompilationTarget = 'hosted' | 'local';
|
|
6
6
|
type TileflowFontCompilationIssue = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TileflowIconAppearance, TileflowIconLayoutMetadata, TileflowIconSetPin, TileflowLandmarkRegion, TileflowModelDirectory, TileflowTreeModel, TileflowIconSpriteIndex, TileflowIconSource, TileflowIconsLockfileV1, TileflowIconCompositionV1, TileflowIconPackageFileName, TileflowIconPackageManifest, TileflowIconDirectory } from '@tileflow/core';
|
|
1
|
+
import { TileflowIconAppearance, TileflowIconLayoutMetadata, TileflowIconSetPin, TileflowLandmarkRegion, TileflowModelBundleManifest, TileflowModelDirectory, TileflowTreeModel, TileflowIconSpriteIndex, TileflowIconSource, TileflowIconsLockfileV1, TileflowIconCompositionV1, TileflowIconPackageFileName, TileflowIconPackageManifest, TileflowIconDirectory } from '@tileflow/core';
|
|
2
2
|
import { TileflowEffectiveModelSourceIdentity, TileflowEffectiveIconSourceIdentity, TileflowBuildCatalog, TileflowPreparedMapAssets } from '@tileflow/core/build';
|
|
3
3
|
|
|
4
4
|
type TileflowRenderedIconCell = {
|
|
@@ -43,6 +43,7 @@ type PreparedTileflowBuildingModel = {
|
|
|
43
43
|
/** Its file name, content-addressed: `<id>-<first 16 hex of its SHA-256>.glb`. */
|
|
44
44
|
fileName: string;
|
|
45
45
|
bytes: Uint8Array;
|
|
46
|
+
sha256: string;
|
|
46
47
|
};
|
|
47
48
|
/** A building model's glTF binaries, nearest level first. */
|
|
48
49
|
type TileflowBuildingModelLevels = Readonly<{
|
|
@@ -88,6 +89,23 @@ declare function encodeTileflowLandmarkRegion(region: TileflowLandmarkRegion): {
|
|
|
88
89
|
bytes: Uint8Array;
|
|
89
90
|
sha256: string;
|
|
90
91
|
};
|
|
92
|
+
/** A map's building models as the model bundle a hosted deploy uploads before its styles. */
|
|
93
|
+
type TileflowModelBundle = {
|
|
94
|
+
/** The SHA-256 of the manifest's canonical JSON. */
|
|
95
|
+
contentHash: string;
|
|
96
|
+
manifest: TileflowModelBundleManifest;
|
|
97
|
+
/** Each model's prepared file, named as the manifest names it. */
|
|
98
|
+
files: {
|
|
99
|
+
contentType: string;
|
|
100
|
+
fileName: string;
|
|
101
|
+
source: Uint8Array;
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Bundles a map's prepared building models, or returns undefined when it has none. Throws a
|
|
106
|
+
* `RangeError` an author can act on when the models together are too large to host.
|
|
107
|
+
*/
|
|
108
|
+
declare function createTileflowModelBundle(buildings: Readonly<Record<string, PreparedTileflowBuildingModel>>): Promise<TileflowModelBundle | undefined>;
|
|
91
109
|
type PreparedTileflowTreeModels = {
|
|
92
110
|
/** The prepared tree models by id. */
|
|
93
111
|
models: Record<string, TileflowTreeModel>;
|
|
@@ -403,4 +421,4 @@ declare function readTileflowIconDirectory(source: TileflowIconDirectory, option
|
|
|
403
421
|
target: TileflowIconCompilationTarget;
|
|
404
422
|
}): Promise<ReadTileflowIconDirectoryResult>;
|
|
405
423
|
|
|
406
|
-
export {
|
|
424
|
+
export { readTileflowIconDirectory as $, TileflowIconCompilationError as A, type TileflowIconCompilationIssue as B, type CompileTileflowIconPackagesOptions as C, type TileflowIconCompilationTarget as D, type TileflowIconDirectoryEntry as E, type TileflowIconDirectorySourceFile as F, type TileflowIconReplacement as G, type TileflowMapIconPackageBinding as H, type InspectTileflowIconCatalogsOptions as I, type TileflowModelBundle as J, type TileflowRenderedIcon as K, type TileflowRenderedIconCell as L, compileTileflowIconPackages as M, composeTileflowIconSources as N, createTileflowModelBundle as O, type PreparedTileflowBuildCatalog as P, getTileflowIconCacheDirectory as Q, type ReadTileflowIconDirectoryResult as R, getTileflowIconWatchPaths as S, type TileflowBuildAsset as T, iconFileExtensions as U, type VerifiedTileflowIconArtifact as V, inspectTileflowIconCatalogs as W, loadTileflowIconSetArtifact as X, packTileflowRenderedIcons as Y, prepareTileflowCatalogIcons as Z, prepareTileflowMapTreeModels as _, type TileflowIconResolutionOptions as a, readTileflowIconsLockfile as a0, readTileflowIconsLockfileText as a1, renderTileflowIconAtlasPreview as a2, storeTileflowIconSetArtifact as a3, verifyTileflowIconArtifact as a4, writeTileflowIconsLockfile as a5, type TileflowSourceCatalog as b, type PreparedTileflowCatalog as c, type TileflowBuildingModelLevels as d, type TileflowLandmarkSource as e, encodeTileflowLandmarkRegion as f, prepareTileflowBuildingModel as g, type CompileTileflowIconPackagesResult as h, type CompiledTileflowIconPackage as i, type CompiledTileflowIconPackageFile as j, type ComposeTileflowIconSourcesOptions as k, type PreparedTileflowBuildingModel as l, type TileflowComposedIconContributor as m, type TileflowComposedIconSources as n, type TileflowComposedIconWinner as o, packageTileflowLandmarkTile as p, type TileflowIconCacheOptions as q, type TileflowIconCatalog as r, type TileflowIconCatalogAtlasRectangle as s, type TileflowIconCatalogContributor as t, type TileflowIconCatalogIcon as u, type TileflowIconCatalogIconSource as v, type TileflowIconCatalogInspection as w, type TileflowIconCatalogMap as x, type TileflowIconCatalogRenderedDensity as y, type TileflowIconCatalogSourceFormat as z };
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@tileflow/core';
|
|
2
2
|
import '@tileflow/core/build';
|
|
3
|
-
export { C as CompileTileflowIconPackagesOptions, h as CompileTileflowIconPackagesResult, i as CompiledTileflowIconPackage, j as CompiledTileflowIconPackageFile, k as ComposeTileflowIconSourcesOptions, I as InspectTileflowIconCatalogsOptions, P as PreparedTileflowBuildCatalog, c as PreparedTileflowCatalog, R as ReadTileflowIconDirectoryResult, T as TileflowBuildAsset,
|
|
3
|
+
export { C as CompileTileflowIconPackagesOptions, h as CompileTileflowIconPackagesResult, i as CompiledTileflowIconPackage, j as CompiledTileflowIconPackageFile, k as ComposeTileflowIconSourcesOptions, I as InspectTileflowIconCatalogsOptions, P as PreparedTileflowBuildCatalog, l as PreparedTileflowBuildingModel, c as PreparedTileflowCatalog, R as ReadTileflowIconDirectoryResult, T as TileflowBuildAsset, m as TileflowComposedIconContributor, n as TileflowComposedIconSources, o as TileflowComposedIconWinner, q as TileflowIconCacheOptions, r as TileflowIconCatalog, s as TileflowIconCatalogAtlasRectangle, t as TileflowIconCatalogContributor, u as TileflowIconCatalogIcon, v as TileflowIconCatalogIconSource, w as TileflowIconCatalogInspection, x as TileflowIconCatalogMap, y as TileflowIconCatalogRenderedDensity, z as TileflowIconCatalogSourceFormat, A as TileflowIconCompilationError, B as TileflowIconCompilationIssue, D as TileflowIconCompilationTarget, E as TileflowIconDirectoryEntry, F as TileflowIconDirectorySourceFile, G as TileflowIconReplacement, a as TileflowIconResolutionOptions, H as TileflowMapIconPackageBinding, J as TileflowModelBundle, K as TileflowRenderedIcon, L as TileflowRenderedIconCell, b as TileflowSourceCatalog, V as VerifiedTileflowIconArtifact, M as compileTileflowIconPackages, N as composeTileflowIconSources, O as createTileflowModelBundle, Q as getTileflowIconCacheDirectory, S as getTileflowIconWatchPaths, U as iconFileExtensions, W as inspectTileflowIconCatalogs, X as loadTileflowIconSetArtifact, Y as packTileflowRenderedIcons, Z as prepareTileflowCatalogIcons, _ as prepareTileflowMapTreeModels, $ as readTileflowIconDirectory, a0 as readTileflowIconsLockfile, a1 as readTileflowIconsLockfileText, a2 as renderTileflowIconAtlasPreview, a3 as storeTileflowIconSetArtifact, a4 as verifyTileflowIconArtifact, a5 as writeTileflowIconsLockfile } from './icons-BdOehQmB.js';
|
package/dist/icons.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
TileflowIconCompilationError,
|
|
3
3
|
compileTileflowIconPackages,
|
|
4
4
|
composeTileflowIconSources,
|
|
5
|
+
createTileflowModelBundle,
|
|
5
6
|
getTileflowIconCacheDirectory,
|
|
6
7
|
getTileflowIconWatchPaths,
|
|
7
8
|
iconFileExtensions,
|
|
@@ -17,12 +18,13 @@ import {
|
|
|
17
18
|
storeTileflowIconSetArtifact,
|
|
18
19
|
verifyTileflowIconArtifact,
|
|
19
20
|
writeTileflowIconsLockfile
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QYU4OW5A.js";
|
|
21
22
|
import "./chunk-7C4F6GAX.js";
|
|
22
23
|
export {
|
|
23
24
|
TileflowIconCompilationError,
|
|
24
25
|
compileTileflowIconPackages,
|
|
25
26
|
composeTileflowIconSources,
|
|
27
|
+
createTileflowModelBundle,
|
|
26
28
|
getTileflowIconCacheDirectory,
|
|
27
29
|
getTileflowIconWatchPaths,
|
|
28
30
|
iconFileExtensions,
|
package/dist/preview.js
CHANGED
|
@@ -196,6 +196,40 @@ var previewSceneClient = String.raw`
|
|
|
196
196
|
};
|
|
197
197
|
`;
|
|
198
198
|
|
|
199
|
+
// src/preview-scene-themes.ts
|
|
200
|
+
function createPreviewSceneThemes(map, readSun) {
|
|
201
|
+
const cache = {
|
|
202
|
+
value: void 0,
|
|
203
|
+
snapshot() {
|
|
204
|
+
if (!cache.value) {
|
|
205
|
+
const metadata = map.getStyle()?.metadata;
|
|
206
|
+
cache.value = { metadata, sun: readSun(metadata) };
|
|
207
|
+
}
|
|
208
|
+
return cache.value;
|
|
209
|
+
},
|
|
210
|
+
invalidate() {
|
|
211
|
+
cache.value = void 0;
|
|
212
|
+
},
|
|
213
|
+
release() {
|
|
214
|
+
map.off("styledata", cache.invalidate);
|
|
215
|
+
map.off("style.load", cache.invalidate);
|
|
216
|
+
map.off("remove", cache.release);
|
|
217
|
+
cache.invalidate();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
map.on("styledata", cache.invalidate);
|
|
221
|
+
map.on("style.load", cache.invalidate);
|
|
222
|
+
map.on("remove", cache.release);
|
|
223
|
+
return {
|
|
224
|
+
getSun() {
|
|
225
|
+
return cache.snapshot().sun;
|
|
226
|
+
},
|
|
227
|
+
getThemeMetadata(key) {
|
|
228
|
+
return { values: [cache.snapshot().metadata?.[key]], position: 0 };
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
199
233
|
// src/preview-html.ts
|
|
200
234
|
function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticPreview, fontFaces = [], fitViewport = false, controls) {
|
|
201
235
|
const styleUrl = preview ? `${basePath}/styles/${preview.mapName}/${preview.themeName}.json${controls ? `?${new URLSearchParams({ controls })}` : ""}` : void 0;
|
|
@@ -372,7 +406,7 @@ function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticP
|
|
|
372
406
|
if (values[0] === "off") return false;
|
|
373
407
|
return fallback;
|
|
374
408
|
}
|
|
375
|
-
let threeDimensionalEnabled = readToggleFromUrl("buildings3d",
|
|
409
|
+
let threeDimensionalEnabled = readToggleFromUrl("buildings3d", true);
|
|
376
410
|
let treesEnabled = readToggleFromUrl("trees3d", true);
|
|
377
411
|
const landmarkState = {
|
|
378
412
|
active: [],
|
|
@@ -1985,7 +2019,7 @@ function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticP
|
|
|
1985
2019
|
// buildings, trees and street lights look, and the controls only show and hide them. The
|
|
1986
2020
|
// vegetation control hides all trees when off. The preview shows one theme at a
|
|
1987
2021
|
// time, so the style on screen holds the sun and the design.
|
|
1988
|
-
const coreScene = {buildings: undefined, trees: undefined, lights: undefined, buildingsShown:
|
|
2022
|
+
const coreScene = {buildings: undefined, trees: undefined, lights: undefined, buildingsShown: undefined, animation: "0"};
|
|
1989
2023
|
const runtimeLayerVisibility = {};
|
|
1990
2024
|
globalThis.__tileflowPreviewScene = coreScene;
|
|
1991
2025
|
globalThis.__tileflowRuntimeVisibility = (id, visible) => {
|
|
@@ -2001,16 +2035,16 @@ function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticP
|
|
|
2001
2035
|
...(coreScene.trees ? {"tileflow-trees-3d": {controller:"Vegetation", state:{visible:runtimeLayerVisibility["tileflow-trees-3d"] !== false, representation:coreScene.trees.representation}, stats:coreScene.trees.stats}} : {}),
|
|
2002
2036
|
...(coreScene.lights ? {"tileflow-street-lights": {controller:"Street lights", state:{visible:runtimeLayerVisibility["tileflow-street-lights"] !== false, mounted:true}, stats:coreScene.lights.stats}} : {})
|
|
2003
2037
|
});
|
|
2038
|
+
const createPreviewSceneThemes = ${createPreviewSceneThemes.toString()};
|
|
2039
|
+
const coreSceneThemeControllers = new WeakMap();
|
|
2004
2040
|
function coreSceneThemes(map) {
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
}
|
|
2013
|
-
};
|
|
2041
|
+
let controller = coreSceneThemeControllers.get(map);
|
|
2042
|
+
if (!controller) {
|
|
2043
|
+
controller = createPreviewSceneThemes(map, metadata =>
|
|
2044
|
+
resolveTileflowSun(readTileflowSunPreset(metadata) ?? tileflowDefaultSunPreset));
|
|
2045
|
+
coreSceneThemeControllers.set(map, controller);
|
|
2046
|
+
}
|
|
2047
|
+
return controller;
|
|
2014
2048
|
}
|
|
2015
2049
|
let mountingCoreScene = false;
|
|
2016
2050
|
function mountCoreScene(map) {
|
|
@@ -2031,10 +2065,10 @@ function renderTileflowPreviewHtml(preview, basePath, initialStatus, isSemanticP
|
|
|
2031
2065
|
}
|
|
2032
2066
|
coreScene.trees.setVisible(treesEnabled && runtimeLayerVisibility["tileflow-trees-3d"] !== false);
|
|
2033
2067
|
coreScene.trees.setViewMode(threeDimensionalEnabled ? "3d" : "2d");
|
|
2034
|
-
// Street lights
|
|
2068
|
+
// Street lights require an explicit map opt-in and the 3D control; defaults stay off.
|
|
2035
2069
|
if (!coreScene.lights && threeDimensionalEnabled && metadata["tileflow:street-lights"]) {
|
|
2036
2070
|
coreScene.lights = createTileflowStreetLights({map, controller});
|
|
2037
|
-
} else if (coreScene.lights && !threeDimensionalEnabled) {
|
|
2071
|
+
} else if (coreScene.lights && (!threeDimensionalEnabled || !metadata["tileflow:street-lights"])) {
|
|
2038
2072
|
coreScene.lights.dispose();
|
|
2039
2073
|
coreScene.lights = undefined;
|
|
2040
2074
|
}
|
package/dist/server.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import '@tileflow/core';
|
|
|
5
5
|
import '@tileflow/core/build';
|
|
6
6
|
import '@tileflow/core/manifest';
|
|
7
7
|
import '@tileflow/core/native-profile';
|
|
8
|
-
import './icons-
|
|
8
|
+
import './icons-BdOehQmB.js';
|
|
9
9
|
import './config.js';
|
|
10
10
|
|
|
11
11
|
declare const tileflowComparisonSchemaVersion: 1;
|