@tileflow/core 0.1.0-alpha.3 → 0.1.0-alpha.31

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.
Files changed (38) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +273 -26
  3. package/THIRD_PARTY_NOTICES.md +327 -0
  4. package/dist/browser.d.ts +962 -0
  5. package/dist/browser.js +6237 -0
  6. package/dist/build.d.ts +574 -0
  7. package/dist/build.js +25423 -0
  8. package/dist/capture-scene-D6soWztE.d.ts +161 -0
  9. package/dist/capture.d.ts +9 -0
  10. package/dist/capture.js +276 -0
  11. package/dist/config-reference.json +32261 -0
  12. package/dist/icon-composition-BiOTwrvD.d.ts +1331 -0
  13. package/dist/index.d.ts +1114 -162
  14. package/dist/index.js +18714 -3479
  15. package/dist/manifest-types-CTT2eLbp.d.ts +790 -0
  16. package/dist/manifest.d.ts +9 -0
  17. package/dist/manifest.js +368 -0
  18. package/dist/native-profile.d.ts +188 -0
  19. package/dist/native-profile.js +9316 -0
  20. package/dist/native.d.ts +355 -0
  21. package/dist/native.js +5552 -0
  22. package/dist/runtime.d.ts +1 -0
  23. package/dist/runtime.js +1317 -0
  24. package/docs/authoring-model.md +241 -0
  25. package/docs/capture-scenes.md +36 -0
  26. package/docs/compiled-style-performance.md +263 -0
  27. package/docs/data-is-separate-from-design.md +345 -0
  28. package/docs/globe-atmosphere.md +83 -0
  29. package/docs/hosted-session-authorization.md +108 -0
  30. package/docs/map-and-terrain-examples.md +149 -0
  31. package/docs/map-emphasis.md +89 -0
  32. package/docs/native-artifact-profile.md +145 -0
  33. package/docs/native-resource-urls.md +367 -0
  34. package/docs/public-api-and-browser-subpath.md +93 -0
  35. package/docs/shared-visual-primitives.md +81 -0
  36. package/docs/theme-transitions-and-blends.md +221 -0
  37. package/docs/themes-and-module-styles.md +83 -0
  38. package/package.json +58 -8
@@ -0,0 +1,345 @@
1
+ # Data is separate from design
2
+
3
+ Start with the [@tileflow/core guide](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/README.md) for installation and a complete first example.
4
+
5
+ Team data uses named logical sources and validated MapLibre overlays. The hosted identity never
6
+ contains a CDN URL; `local` is the explicit account-free PMTiles resolution for Dev and Capture:
7
+
8
+ ```ts
9
+ import {defineMap, hostedTileset, maplibreOverlay} from '@tileflow/core';
10
+ import {streets} from '@tileflow/maps';
11
+
12
+ const stores = hostedTileset({
13
+ tileset: 'stores',
14
+ local: './data/stores.pmtiles',
15
+ attribution: 'Store data © Example',
16
+ });
17
+
18
+ export default defineMap({
19
+ id: 'store-locator',
20
+ version: 1,
21
+ extends: streets,
22
+ sources: {stores},
23
+ overlays: {
24
+ stores: maplibreOverlay({
25
+ source: 'stores',
26
+ placement: 'above-roads',
27
+ layers: [
28
+ {
29
+ id: 'stores-points',
30
+ type: 'circle',
31
+ 'source-layer': 'store_locations',
32
+ paint: {
33
+ 'circle-color': ['match', ['get', 'category'], 'restaurant', '#ef4444', '#64748b'],
34
+ },
35
+ },
36
+ ],
37
+ }),
38
+ },
39
+ });
40
+ ```
41
+
42
+ Tileflow automatically registers only protocols in namespaces that Tileflow owns.
43
+ `tileflow-pmtiles://` is reserved for PMTiles resources managed by Tileflow. Tileflow never
44
+ automatically registers, removes, or replaces the global `pmtiles://` handler. Explicit PMTiles
45
+ sources supplied by an application remain the application's responsibility.
46
+
47
+ For local resolution, the Style URL is based on the logical tileset ID and remains stable when Dev
48
+ creates a new immutable snapshot. Physical generation IDs and local content hashes never enter the
49
+ Style representation. Each Dev PMTiles request retains the snapshot it resolved until its response
50
+ is prepared, and strong generation ETags prevent one cached PMTiles read from silently combining
51
+ ranges from different generations. Standalone Capture retains one snapshot for its complete render.
52
+ Application Capture does not freeze every local dataset across the complete screenshot window; the
53
+ application's development server remains authoritative for its per-read generation.
54
+
55
+ `local` does not make build output own or publish the archive. Production builds reject unresolved
56
+ local PMTiles. Explicitly publish the tileset through Tileflow's managed upload, validation,
57
+ versioning, and hosting flow, or serve it from infrastructure owned by the application.
58
+
59
+ One overlay owns one ordered group of ordinary MapLibre Style Layers. Public layer IDs are retained
60
+ for `map.on(...)`, feature queries, and application state. Placement is one of `above-water`,
61
+ `below-roads`, `above-roads`, `above-buildings`, `below-labels`, or `above-labels`; overlays sharing
62
+ a placement sort by overlay ID. A map accepts up to 16 Team sources in addition to Tileflow World
63
+ and terrain. These semantic boundaries do not expose generated basemap layer IDs.
64
+ `sources` and `overlays` merge by key through `extends`, declarations replace atomically, and
65
+ `remove()` deletes one inherited key. Removing a still-used source fails validation. There is no
66
+ interaction DSL or parallel expression language.
67
+
68
+ Omitting `data` selects the compiler-owned Tileflow World `v1` compatibility generation:
69
+
70
+ ```ts
71
+ import {streets} from '@tileflow/maps';
72
+
73
+ export default streets;
74
+ ```
75
+
76
+ Theme typography can set `fallbacks`, `letterSpacing`, and `transform` globally or per label
77
+ domain, while the font token catalog gives module styles a stable semantic target. Text delivery is
78
+ explicit and atomic: a map may declare either ordered `fonts` directories
79
+ for browser font files or a `glyphs` provider for PBF glyphs, never both. Omitting both inherits the
80
+ parent's provider; declaring either replaces an inherited provider of either kind. After resolution,
81
+ a map that emits text must have exactly one provider. A text-free standalone map may omit both. On a derived
82
+ map, omission inherits the parent provider while `fonts: []` explicitly removes it; that empty array
83
+ is valid only when the resolved map emits no text.
84
+
85
+ ```ts
86
+ import {defineMap, defineTheme} from '@tileflow/core';
87
+ import {streets, streetsThemes} from '@tileflow/maps';
88
+
89
+ const brandLight = defineTheme(streetsThemes.light, {
90
+ id: 'brand-light',
91
+ version: 1,
92
+ colorScheme: 'light',
93
+ tokens: {font: {default: 'Brand Sans Regular', places: 'Brand Sans Regular'}},
94
+ });
95
+ const brandDark = defineTheme(streetsThemes.dark, {
96
+ id: 'brand-dark',
97
+ version: 1,
98
+ colorScheme: 'dark',
99
+ tokens: {font: {default: 'Brand Sans Regular', places: 'Brand Sans Regular'}},
100
+ });
101
+
102
+ export default defineMap({
103
+ id: 'brand-map',
104
+ version: 1,
105
+ extends: streets,
106
+ fonts: ['./fonts'],
107
+ themes: {light: brandLight, dark: brandDark},
108
+ defaultTheme: 'light',
109
+ systemThemes: {light: 'light', dark: 'dark'},
110
+ });
111
+ ```
112
+
113
+ Node preparation reads TTF, OTF, and WOFF2 files, uses each OpenType full name as its exact
114
+ `text-font` ID, and requires `LICENSE.txt` in every contributing directory. Directories apply left
115
+ to right; a later exact name replaces an earlier face and case-only collisions fail. Only primary
116
+ faces used by the final style become content-addressed assets and strict `tileflow:fontFaces`
117
+ metadata. `font` names an exact OpenType full name or glyph face; local `fallbacks` name exact faces
118
+ or explicit CSS generic families. Tileflow never appends a weight suffix or derives one face from
119
+ another; the only derived stacks are line-fitted text backgrounds on a `glyphs` provider, which keep
120
+ their source faces' shapes. Browser adapters load local faces before MapLibre. Native releases use a locked PBF
121
+ `glyphs` URL provider instead, which enumerates the exact comma-joined MapLibre request keys in
122
+ `fontStacks`.
123
+
124
+ Streets, Ferraris, Härad, Soundings, and Blueprint each declare
125
+ `https://api.tileflow.dev/base/33d4de5e8086d9d629d67d3f39fedb87e23686c4c1ac653c27e2a52aee9d00b3/glyphs/{fontstack}/{range}.pbf`
126
+ with the exact `Noto Sans Regular` and `Noto Sans Bold` stacks. The full hash identifies one
127
+ published, immutable glyph collection independent of World data. The older `/fonts/...` endpoint
128
+ remains a mutable compatibility URL and does not make a resolved map byte-reproducible. The global
129
+ glyph `assetSetSha256` is not the same-domain value as the per-map `assetSetSha256` in
130
+ `build-manifest.json`.
131
+ Cyberpunk and Matrix each replace the URL provider with their own packaged Oxanium directory and
132
+ reference the exact local faces `Oxanium Medium` and `Oxanium SemiBold`. Baedeker and Siegfried
133
+ each own a packaged directory containing Cormorant Garamond Regular, SemiBold, and Italic.
134
+
135
+ Name the official generation deliberately, or use another OpenMapTiles-compatible vector source:
136
+
137
+ ```ts
138
+ import {openMapTiles, tileflowWorld, vectorTiles} from '@tileflow/core';
139
+
140
+ const official = tileflowWorld();
141
+ const external = vectorTiles({
142
+ tiles: ['pmtiles://./test/fixtures/world.pmtiles'],
143
+ revision: 'fixture-1',
144
+ attribution: '© Example © OpenStreetMap contributors',
145
+ schema: openMapTiles(),
146
+ });
147
+ ```
148
+
149
+ The resolved map controls how data is drawn; `data` controls where compatible features come from.
150
+ For Tileflow World, the compiler emits the selector TileJSON URL
151
+ `https://api.tileflow.dev/tiles/world/tiles.json`. Omitted data or `tileflowWorld()` selects
152
+ `world-v1/current`; `tileflowWorld({release: {releaseId, descriptorSha256}})` binds an exact release
153
+ through query parameters. Runtime and capture resolve `current` once per session or job and then
154
+ use the immutable release described by that response. `openMapTiles({layers, fields})` can bind renamed
155
+ source-layers or properties while preserving the versioned semantic contract. External browser
156
+ credentials do not belong in public Style JSON; supply them through the framework's
157
+ `transformRequest` integration.
158
+
159
+ External exact-test sources may use one TileJSON `url` or a bounded direct `tiles` list with optional
160
+ `bounds`, `minzoom`, and `maxzoom`. `pmtiles://` is supported for a checked-in or bring-your-own
161
+ archive. Public vector URLs are HTTPS, root-relative, or HTTP only on loopback development hosts.
162
+ A PMTiles URL names one `.pmtiles` archive through an HTTPS, loopback HTTP, root-relative, or safe
163
+ repository-relative target; credentials, fragments, traversal, and other protocols are rejected at
164
+ both authoring validation and compilation. An external `revision` participates in capture identity,
165
+ so changing fixture bytes cannot silently reuse a baseline.
166
+
167
+ Tileflow's OpenMapTiles contract also recognizes the optional `globallandcover` extension. The
168
+ official Streets map maps its `barren`, `crop`, `grass`, `shrub`, `snow`, `trees`, and
169
+ `urban` classes beneath the OSM land layers. Tileflow World V1 supplies native generalized
170
+ geometry through z10; Streets fades it progressively while detailed `landcover`/`landuse` gains
171
+ opacity and removes it at z11. This is a macro bridge, not local semantic detail. Sources with a
172
+ different layer name can use `openMapTiles({layers: {globalLandcover: 'my_landcover'}})`; archives
173
+ without the extension remain compatible and simply render no features for that style layer. Use
174
+ `land({globalLandcover: {...}})` to customize its fill, opacity, visibility, and zoom range. `crop`
175
+ shares the theme's semantic `landcover.farmland` color with detailed farmland, while `barren` uses
176
+ `landcover.rock`; neither class borrows a road color.
177
+
178
+ The normalized schema also records the meaning of the OpenMapTiles `park` layer. Generic
179
+ `openMapTiles()` defaults to `semantics.parkLayer: 'mixed'` and compiles a private compatibility
180
+ branch for ordinary legacy parks. `tileflowWorldV1Schema()` fixes it to `'protected-only'`: that
181
+ layer is a protection tint, while urban parks and gardens come from
182
+ `landcover.class=grass/subclass=park|garden`. The ambiguous legacy `park` class is therefore not
183
+ a public land-cover target.
184
+
185
+ Tileflow World V1 makes `bathymetry`, `globallandcover`, `circular_feature`, `sidewalk`, and
186
+ `street_furniture` mandatory. Use `tileflowWorldV1Schema()` for that product instead of making raw
187
+ layer names part of a style. Publication tooling calls `validateTileflowWorldV1Tilejson(...)` and
188
+ fails closed unless each layer occurs exactly once, declares its contracted native zooms, and
189
+ advertises the typed fields consumed by the maps. This includes bathymetry z0–z9, global land cover
190
+ z0–z10, the three detailed-city layers at native z15, and numeric
191
+ `transportation.clearance_extra_px_z15` for butt-capping procedural-roundabout approaches. Generic
192
+ OpenMapTiles sources keep the detailed extensions optional and the compiler omits unsupported
193
+ detail. Resolving omitted data or
194
+ `tileflowWorld(...)` uses the strict V1 schema directly, and `water({bathymetry: {...}})` styles the
195
+ emitted depth bands without raw layer IDs. Use `water({bathymetryContours: {...}})` to customize the
196
+ opt-in companion line layer; an empty style selects subtle defaults, and the zero-depth band is
197
+ excluded so the ordinary coastline remains authoritative. The lines follow discrete band polygon
198
+ edges and are therefore approximate rather than surveyed depth contours. Use
199
+ `water({bathymetryLabels: {...}})` to customize the separate opt-in symbol layer; an empty style
200
+ selects the defaults, whose text is the absolute band-minimum number in metres with no unit suffix.
201
+ It remains a band-floor annotation, not a survey sounding.
202
+
203
+ For independent ocean products, `marine` composes stable auxiliary vector sources without changing
204
+ the primary World source:
205
+
206
+ ```ts
207
+ import {bathymetry, defineMap, fixed, nautical} from '@tileflow/core';
208
+ import {streets} from '@tileflow/maps';
209
+
210
+ export default defineMap({
211
+ id: 'chart',
212
+ version: 1,
213
+ extends: streets,
214
+ marine: 'chart', // 'none' | 'bathymetry' | 'nautical' | 'chart'
215
+ modules: {
216
+ nautical: nautical({
217
+ soundings: {minZoom: 13},
218
+ aids: {minZoom: 11},
219
+ lights: {minZoom: 12},
220
+ hazards: {minZoom: 12},
221
+ hazardAreas: {
222
+ fill: {opacity: fixed(0.1, {reason: 'Chart hazard wash is invariant'})},
223
+ },
224
+ wrecks: {minZoom: 12},
225
+ wreckAreas: {
226
+ outline: {opacity: fixed(0.6, {reason: 'Chart wreck outline is invariant'})},
227
+ },
228
+ reefs: {fill: {opacity: fixed(0.3, {reason: 'Chart reef wash is invariant'})}},
229
+ navigationAreas: {
230
+ fill: {opacity: fixed(0.05, {reason: 'Chart navigation-area wash is invariant'})},
231
+ },
232
+ coverage: {outline: {visible: false}},
233
+ labels: {
234
+ navigationAreas: {minZoom: 11},
235
+ reefs: {minZoom: 13},
236
+ },
237
+ }),
238
+ },
239
+ });
240
+ ```
241
+
242
+ `bathymetry` resolves to vector source `tileflow-bathymetry` and supplies the 13-stop
243
+ `bathymetry-v1` band contract to `water(...)`. `nautical` resolves to `tileflow-nautical`; the
244
+ `nautical(...)` module
245
+ styles its `sounding`, `aid`, `light`, `hazard`, `wreck`, `reef`, `navigation_area`, and `coverage`
246
+ layers. The schema also names the product's provider-neutral provenance fields (`provenance`,
247
+ `provider`, `cell`, `edition`, `update`, `scale`, `coverage`, and `licence`). `chart` enables both.
248
+ Point features label depth, name, or light character as applicable. The `lighthouses` symbol style
249
+ targets `aid` points whose canonical `class` is `lighthouse`, leaving other aids under `aids`.
250
+ Polygon reefs, navigation
251
+ areas, hazards, wrecks, and named/provider coverage have separate collision-aware labels under
252
+ `nautical({labels: {...}})`; unnamed coverage does not emit empty text.
253
+ Core does not hard-code a nautical provider or attribution: the selected TileJSON owns its actual
254
+ coverage and attribution, and derived vector tiles are not represented as a certified ENC for
255
+ navigation. The V1 geometry contract preserves `sounding`, `aid`, and `light` as points;
256
+ `reef`, `navigation_area`, and `coverage` as polygons; and both point and polygon geometries for
257
+ `hazard` and `wreck`. Point symbols and polygon areas compile separately, without fabricated
258
+ centroids.
259
+ Advanced callers can override either TileJSON URL, attribution, or source ID and can set the other
260
+ member to `false`:
261
+
262
+ ```ts
263
+ marine: {
264
+ bathymetry: {url: 'https://tiles.example.test/depth/tiles.json'},
265
+ nautical: false,
266
+ }
267
+ ```
268
+
269
+ Use the `bathymetry(...)` helper when the map needs relief or product-level styling. Bathymetry is
270
+ one logical product with two independently loaded physical sources:
271
+
272
+ ```ts
273
+ marine: {
274
+ bathymetry: bathymetry({
275
+ display: 'hybrid',
276
+ bands: {
277
+ opacity: fixed(0.72, {reason: 'Keep chart symbols above the depth wash'}),
278
+ },
279
+ contours: {visible: true},
280
+ relief: {
281
+ multidirectional: true,
282
+ opacity: fixed(0.18, {reason: 'Relief stays legible beneath bands and labels'}),
283
+ },
284
+ }),
285
+ nautical: false,
286
+ }
287
+ ```
288
+
289
+ `display: 'bands'` loads only vector TileJSON `/tiles/bathymetry/tiles.json` as
290
+ `tileflow-bathymetry`. `display: 'relief'` loads only `/tiles/bathymetry/dem/tiles.json` as
291
+ `tileflow-bathymetry-dem` and emits continuous `color-relief` plus hillshade. `display: 'hybrid'`
292
+ loads both. The hosted DEM contract is 512 px, Terrarium-encoded, lossless WebP; advanced compatible
293
+ sources may override `url`, `sourceId`, `encoding`, or `tileSize` inside `relief`.
294
+ Multidirectional illumination uses directions 270°, 315°, 0°, and 45°. The simple
295
+ `marine: 'chart'` shorthand deliberately stays vector-only; DEM relief is an explicit advanced
296
+ opt-in.
297
+
298
+ The vector palette uses thresholds −11 000, −8 000, −6 000, −4 000, −2 000, −1 000, −500, −200,
299
+ −100, −50, −20, −10, and 0 metres. `bands`, `contours`, and `labels` remain separate controls.
300
+ Until native contour fields are contracted, contours are a visual fallback drawn from band polygon
301
+ edges, not surveyed isolines. The V1 schema exposes optional source-layer names
302
+ `bathymetry_contour`, `seafloor_landform`, `water_name`, and `bathymetry_coverage`, but promises
303
+ fields only for required `bathymetry.min_depth` and `bathymetry.sort_key`.
304
+
305
+ The DEM enables future client-side sampling and depth profiles, but Core intentionally exposes no
306
+ profile or remote sampling API yet. Rendered relief must not be interpreted as navigation-safe
307
+ depth data.
308
+
309
+ Omitting `marine` preserves the transitional Tileflow World V1 bathymetry fallback. Declaring
310
+ `marine: 'none'` suppresses that fallback, while a selected bathymetry sidecar always takes
311
+ precedence. Compiled styles retain the singular `tileflow:data` metadata for existing consumers and
312
+ add `tileflow:sources` plus `tileflow:sourceRequirements` for independent product validation.
313
+
314
+ Detailed city datasets can bind `sidewalk`, `streetFurniture`, and `circularFeature` source layers
315
+ through `openMapTiles({layers, fields})`. When present, `roads.sidewalks` owns source-backed
316
+ pedestrian polygons, `roads.crossings` owns oriented crossing icons, and `roads.roundabouts` owns
317
+ metric circular road rings. These bindings are optional: a generic OpenMapTiles source remains
318
+ valid and the compiler omits unsupported detail instead of inventing geometry. Crossing icons are
319
+ explicit because the data contract cannot assume a sprite name. They require positive physical
320
+ `markings` evidence and reject `crossing=no`; both fields are semantic bindings, so custom schemas
321
+ can remap them without weakening that rule.
322
+
323
+ The optional `business_corridor` extension contains activity-selected source footprints below
324
+ buildings. Its `activity_score`, `rank`, `min_zoom`, and `confidence` fields control a quiet local
325
+ warm tint without drawing POI-radius circles. Current building footprints may carry sparse
326
+ `building_tone=commercial|destination|active`; absence means the neutral base building. The three
327
+ values preserve why the warm tone was selected even when a theme maps them to the same color.
328
+ Building visibility is fixed by the layer zoom contract and never by optional semantics. Immutable
329
+ V8.9 archives carrying `building_kind` or `has_business` remain readable as a defensive
330
+ compatibility path, but new candidates do not emit those fields. The land module also exposes
331
+ `medical`, `education`, and `government` independently instead of collapsing their already distinct
332
+ source classes into one civic color.
333
+
334
+ World and text assets are independent contracts. `tileflowWorld()` selects `world-v1/current` or an
335
+ exact `releaseId + descriptorSha256`; a `glyphs` declaration contains its own complete URL. Ordinary
336
+ imports of Streets, Baedeker, Cívica, Ferraris, Härad, Siegfried, Soundings, Cyberpunk, Matrix, Blueprint, and Super Tile World
337
+ remain usable because each official map owns or inherits a URL or packaged-font provider.
338
+ URL-backed maps become exact-byte reproducible
339
+ when the immutable global base-asset set is published and their explicit URL is updated to its
340
+ `assetSetSha256` path; no World or compiler fallback participates in that rollout. The global
341
+ base-asset manifest's hash and a map build manifest's identically named `assetSetSha256` use
342
+ different contracts and must never be substituted for one another.
343
+
344
+ Upstream data attribution remains in the MapLibre source. `Map by Tileflow` is a separate product
345
+ credit/trademark surface and must not replace, obscure, or be presented as upstream attribution.
@@ -0,0 +1,83 @@
1
+ # Globe atmosphere
2
+
3
+ Enable atmosphere in the map exported by `tileflow.config.ts`. Install `@tileflow/core` and
4
+ `@tileflow/maps` and use a browser adapter from the same compatible SDK release. The example
5
+ extends the complete Streets map, including its data and text resources.
6
+
7
+ <!-- docs:check -->
8
+
9
+ ```ts
10
+ import {defineMap} from '@tileflow/core';
11
+ import {streets} from '@tileflow/maps';
12
+
13
+ export default defineMap({
14
+ id: 'earth',
15
+ version: 1,
16
+ extends: streets,
17
+ projection: 'globe',
18
+ atmosphere: true,
19
+ view: {center: [2.3522, 48.8566], zoom: 2},
20
+ });
21
+ ```
22
+
23
+ The result has a blue atmospheric rim, a dark space background, and a deterministic star field.
24
+ Stars move slightly with the camera. There is no continuous animation while the camera is still.
25
+ The space background, stars, and supplementary rim fade between zooms 3 and 6; native atmospheric
26
+ scattering fades out by zoom 7. Coordinates are longitude, then latitude.
27
+
28
+ Omit `atmosphere` to inherit it from the base map. A map without inherited atmosphere remains
29
+ unchanged. Set `atmosphere: false` to disable an inherited atmosphere. An enabled atmosphere requires
30
+ `projection: 'globe'`; validation rejects a Mercator or unspecified projection. Atmosphere options
31
+ replace the inherited object atomically rather than merging individual fields.
32
+
33
+ ## Configure appearance
34
+
35
+ Use an object instead of `true` to override defaults:
36
+
37
+ | Option | Default | Meaning |
38
+ | --------------- | --------- | ------------------------------------------------------- |
39
+ | `skyColor` | `#07152b` | Near-space sky color |
40
+ | `horizonColor` | `#83b9f4` | Horizon and supplementary rim color |
41
+ | `fogColor` | `#bad2eb` | Native atmospheric fog color |
42
+ | `spaceColor` | `#030916` | Outer space background color |
43
+ | `starIntensity` | `0.6` | Brightness from 0 to 1; 0 hides stars |
44
+ | `starParallax` | `0.4` | Camera-relative motion from 0 to 1; 0 keeps stars still |
45
+
46
+ Colors follow the usual theme contract: use `token.color(...)`, color operations, or
47
+ `fixed(color, {reason})`. They must resolve to opaque colors. Compilation normalizes them to
48
+ six-digit hexadecimal values in the runtime metadata. Numeric options must be finite and within
49
+ 0–1. Unknown properties are rejected. For example, this fragment belongs inside `defineMap(...)`
50
+ and uses `fixed` imported from `@tileflow/core`:
51
+
52
+ ```ts
53
+ atmosphere: {
54
+ horizonColor: fixed('#83b9f4', {reason: 'Earth atmosphere stays blue across map themes'}),
55
+ starIntensity: 0.5,
56
+ starParallax: 0.25,
57
+ },
58
+ ```
59
+
60
+ The browser's reduced-motion preference overrides parallax while keeping the sky and stars visible.
61
+ No additional image, font, API key, or network request is needed for the effect.
62
+
63
+ ## Browser integration
64
+
65
+ The compiler emits MapLibre `sky` and versioned `metadata['tileflow:atmosphere']` in every concrete
66
+ style. React, Vue, Svelte, and standalone browser capture attach the shared atmosphere runtime.
67
+ Theme changes update the effect from the newly loaded style. Loading a style without atmosphere
68
+ removes the decoration.
69
+
70
+ When constructing a MapLibre map directly, call `attachTileflowAtmosphere(map)` from
71
+ `@tileflow/core/browser` after constructing the map. Keep its returned cleanup function and call it
72
+ before removing the map; the map's `remove` event also disposes it. The helper creates its own
73
+ noninteractive, accessibility-hidden canvas inside the map container. It does not create a map,
74
+ change the camera, or add controls. Preserve the renderer's transparent canvas and standard
75
+ MapLibre CSS so space can show around the globe.
76
+
77
+ Importing the browser entry is safe during server rendering. Call the attachment only in the
78
+ browser, after mounting. Raw MapLibre consumers that do not attach the helper display the compiled
79
+ native atmosphere but do not receive Tileflow's stars or space background.
80
+
81
+ The native artifact profile does not support globe atmosphere and rejects `sky`. This browser
82
+ capability does not establish React Native or hosted Static Maps support. Public availability is
83
+ established by the installed package version, not by this repository's main branch.
@@ -0,0 +1,108 @@
1
+ # Hosted session authorization
2
+
3
+ Start with the [@tileflow/core guide](https://github.com/tileflow/tileflow-sdk/blob/main/packages/core/README.md) for installation and a complete first example.
4
+
5
+ The framework adapters use `createTileflowSessionController` to obtain one short-lived session
6
+ grant before eligible hosted style, tile, font, or sprite requests. Concurrent resources share the
7
+ same preflight, grants are attached only to reviewed HTTP(S) origins, and an expired unused session
8
+ rotates once when the server requests it. A controller also rotates after six hours or 10,000
9
+ eligible requests. The preflight has a 10-second client timeout by default; direct controller users
10
+ can set `grantTimeoutMs` from 1 to 120,000 milliseconds.
11
+
12
+ `analytics.enabled: false` disables only the optional analytics beacon. It does not disable this
13
+ server-owned commercial authorization. User `transformRequest` callbacks still run first; Tileflow
14
+ then decorates only the resulting eligible URL and preserves the other request options.
15
+
16
+ Set `analytics.surfaceId` to a stable product location when the same Map appears in several places:
17
+
18
+ ```ts
19
+ const analytics = {surfaceId: 'store-locator'};
20
+ ```
21
+
22
+ A Surface ID is 1–64 lowercase ASCII letters, digits, `.`, `_`, or `-`; it starts and ends with a
23
+ letter or digit. Missing or invalid values become `default`. Use a durable integration name such as
24
+ `checkout` or `dealer-search`, not a URL, branch, preview, random component instance, or user ID.
25
+ Surface labels do not change authorization, entitlement, or Session identity.
26
+
27
+ For exact Tileflow World release tiles, framework adapters also use the browser request bridge to
28
+ observe the response's safe fair-use state without adding identity, query parameters, credentials,
29
+ or user headers to the public World URL. The bridge requires the immutable release path and exactly
30
+ one lowercase descriptor digest; the retired mutable World template is never intercepted. Early
31
+ `GRACE` stays silent; signed late `GRACE` creates a compact
32
+ accessible owner-action pill, and `MANAGED_REQUIRED` creates a stronger in-map banner. A missing
33
+ header, absent tile, MapLibre error, or failed response cannot erase an existing manage action; a
34
+ later successful `OPEN` response can clear it. Shaped empty tiles remain render-safe while the owner
35
+ action stays available. Successful World tile bodies are streamed with a 16 MiB maximum: an
36
+ oversized `Content-Length` is rejected before reading, and chunked responses are cancelled as soon
37
+ as their accumulated bytes cross the same bound. Abort signals cancel an active reader; errors do
38
+ not include the remote response body.
39
+
40
+ Other subpaths under `src/`, `themes/`, `templates/`, and `modules/` are internal implementation
41
+ details and can change during alpha releases.
42
+
43
+ Official map definitions and the source assets they own ship together in `@tileflow/maps`, not in
44
+ Core. That package exports the maps and their reusable directory descriptors:
45
+
46
+ ```ts
47
+ import {
48
+ baedeker,
49
+ baedekerFonts,
50
+ baedekerIcons,
51
+ blueprint,
52
+ blueprintIcons,
53
+ civica,
54
+ civicaFonts,
55
+ civicaIcons,
56
+ ferraris,
57
+ ferrarisIcons,
58
+ harad,
59
+ haradIcons,
60
+ siegfried,
61
+ siegfriedFonts,
62
+ siegfriedIcons,
63
+ soundings,
64
+ soundingsIcons,
65
+ streets,
66
+ streetsIcons,
67
+ streetsThemes,
68
+ } from '@tileflow/maps';
69
+ ```
70
+
71
+ All official maps are complete standalone maps. The sole semantic compiler is implicit; none
72
+ imports or extends another official map, and each declares its own icon directory.
73
+ Streets declares `[streetsIcons]` and exposes its complete coordinated appearances as
74
+ `streetsThemes.light` and `streetsThemes.dark`; image tokens select the matching sidewalk pattern
75
+ without changing the asset collection. Baedeker declares `[baedekerIcons]`, whose eight original
76
+ patterns support its travel-atlas design, and `[baedekerFonts]`, its own Cormorant Garamond
77
+ directory; it derives contours in the browser from unpackaged Mapterhorn terrain tiles. Cívica
78
+ declares `[civicaIcons]` for its original civic-print patterns and destination artwork and
79
+ `[civicaFonts]` for its packaged lettering. Blueprint declares
80
+ `[blueprintIcons]` for its four technical hatches and schematic POI node, derives contours from
81
+ unpackaged Mapterhorn tiles, and uses the canonical Noto Sans glyph provider. The same asset
82
+ operation is available to applications:
83
+
84
+ ```ts
85
+ export default defineMap({
86
+ id: 'brand-map',
87
+ version: 1,
88
+ extends: streets,
89
+ icons: [...streets.icons, './icons'],
90
+ });
91
+ ```
92
+
93
+ `icons` is a `readonly TileflowIconSource[]`. Omission inherits the parent's exact array,
94
+ declaration replaces it atomically, and `[]` means no icons. Local and package directories, plus
95
+ explicit locked `iconSet('@team/set')` descriptors, apply left to right.
96
+ `<id>.<ext>` publishes an icon as `<id>`; `<id>.pattern.<ext>` publishes an intrinsic-size pattern
97
+ as `<id>`. The published ID must already be canonical lower-kebab; a later exact ID wins and a
98
+ case-only collision fails. There is no built-in selector, mutable external sprite selector, icon
99
+ mapping, icon-specific inheritance, additive command, or compatibility alias. An Icon Set is an
100
+ explicit locked descriptor, not a generic source registry.
101
+
102
+ `@tileflow/dev` resolves local and package directory descriptors, verifies real-path containment,
103
+ and prepares ordinary public artifacts without serializing installation paths. It compiles one
104
+ deterministic sprite from the final icon composition and validates every literal `icon-image`,
105
+ `fill-pattern`, and `line-pattern` in the final style against it. It also prepares any declared font
106
+ directories generically; `baedekerFonts`, `civicaFonts`, and `siegfriedFonts` are
107
+ ordinary package descriptors rather than pipeline special cases. Calling the pure compiler for a map whose style needs unprepared
108
+ assets fails instead of emitting broken runtime references.