@tileflow/core 0.1.0-alpha.34 → 0.1.0-alpha.36
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 +24 -23
- package/THIRD_PARTY_NOTICES.md +100 -6
- package/dist/browser.d.ts +758 -388
- package/dist/browser.js +4598 -1169
- package/dist/build.d.ts +9 -5
- package/dist/build.js +2892 -1410
- package/dist/capture.js +1 -0
- package/dist/config-reference.json +3780 -2153
- package/dist/{icon-composition-DqoZWQuz.d.ts → icon-composition-sN3JkXdb.d.ts} +380 -96
- package/dist/index.d.ts +426 -13
- package/dist/index.js +4999 -1841
- package/dist/{manifest-types-hmzy2bBX.d.ts → manifest-types-jrBdBrES.d.ts} +71 -9
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.js +80 -2
- package/dist/native-profile.js +1 -0
- package/dist/native.d.ts +13 -3
- package/dist/native.js +714 -318
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +124 -6
- package/dist/worker/buildings-3d-worker.global.js +1 -0
- package/docs/authoring-model.md +12 -3
- package/docs/boundary-areas-and-choropleths.md +217 -0
- package/docs/buildings-3d.md +264 -34
- package/docs/cartographic-defaults.md +142 -0
- package/docs/compiled-style-performance.md +14 -3
- package/docs/data-is-separate-from-design.md +191 -7
- package/docs/hosted-session-authorization.md +2 -4
- package/docs/map-and-terrain-examples.md +10 -3
- package/docs/native-artifact-profile.md +5 -0
- package/docs/native-resource-urls.md +5 -3
- package/docs/street-lights.md +22 -6
- package/docs/sun-and-light.md +42 -2
- package/docs/theme-transitions-and-blends.md +50 -0
- package/docs/themes-and-module-styles.md +66 -0
- package/docs/trees-3d.md +85 -13
- package/package.json +5 -4
|
@@ -389,6 +389,13 @@ type TileflowTerrainContoursConfig = {
|
|
|
389
389
|
thresholds: Readonly<Record<number, readonly [number, number]>>;
|
|
390
390
|
};
|
|
391
391
|
type TileflowTerrainConfig = {
|
|
392
|
+
/** Explicit DEM tile templates, mutually exclusive with the TileJSON url. */
|
|
393
|
+
tiles?: readonly string[];
|
|
394
|
+
/** Native DEM resolution limits, independent of hillshade visibility. */
|
|
395
|
+
minZoom?: number;
|
|
396
|
+
maxZoom?: number;
|
|
397
|
+
/** Raster tile width in pixels. Defaults to the renderer default when omitted. */
|
|
398
|
+
tileSize?: 256 | 512;
|
|
392
399
|
attribution?: string;
|
|
393
400
|
contours?: TileflowTerrainContoursConfig;
|
|
394
401
|
encoding?: TileflowTerrainEncoding;
|
|
@@ -441,7 +448,11 @@ type TileflowRoadAreaStyle = {
|
|
|
441
448
|
};
|
|
442
449
|
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
443
450
|
type TileflowRoadRoundaboutStyle = {
|
|
451
|
+
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
452
|
+
borderWidth?: TileflowNumberStyleValue;
|
|
444
453
|
casing?: TileflowCircleStyle;
|
|
454
|
+
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
455
|
+
fallbackWidth?: TileflowNumberStyleValue;
|
|
445
456
|
fill?: TileflowCircleStyle;
|
|
446
457
|
};
|
|
447
458
|
/**
|
|
@@ -451,7 +462,7 @@ type TileflowRoadRoundaboutStyle = {
|
|
|
451
462
|
type TileflowRoadStreetLightStyle = {
|
|
452
463
|
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
453
464
|
color?: TileflowThemeColorValue;
|
|
454
|
-
/** Whether the map has street lights; defaults to
|
|
465
|
+
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
455
466
|
enabled?: boolean;
|
|
456
467
|
/**
|
|
457
468
|
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
@@ -479,6 +490,8 @@ type TileflowRoadsModuleConfig = {
|
|
|
479
490
|
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
480
491
|
oneWayMarkers?: boolean;
|
|
481
492
|
outline?: TileflowRoadOutline;
|
|
493
|
+
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
494
|
+
rampOrder?: 'below-roads' | 'by-class';
|
|
482
495
|
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
483
496
|
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
484
497
|
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
@@ -524,6 +537,14 @@ type TileflowLabelsModuleConfig = {
|
|
|
524
537
|
language?: TileflowLabelLanguage;
|
|
525
538
|
places?: TileflowLabelDetail;
|
|
526
539
|
roadClasses?: readonly TileflowRoadClass[];
|
|
540
|
+
/**
|
|
541
|
+
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
542
|
+
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
543
|
+
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
544
|
+
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
545
|
+
* Shields and junction numbers keep their foreground placement.
|
|
546
|
+
*/
|
|
547
|
+
roadPlacement?: 'ground' | 'foreground';
|
|
527
548
|
roads?: TileflowRoadLabelDetail;
|
|
528
549
|
shields?: TileflowRoadShieldDetail;
|
|
529
550
|
styles?: TileflowLabelStyles;
|
|
@@ -535,21 +556,50 @@ declare const tileflowPoiCategories: readonly ["arts-entertainment", "education"
|
|
|
535
556
|
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
536
557
|
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
537
558
|
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
559
|
+
/**
|
|
560
|
+
* How POI categories are placed against each other. `importance` places every category in one
|
|
561
|
+
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
562
|
+
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
563
|
+
*/
|
|
564
|
+
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
565
|
+
/**
|
|
566
|
+
* The appearance of one POI category. With the default `importance` order every category shares
|
|
567
|
+
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
568
|
+
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
569
|
+
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
570
|
+
*/
|
|
571
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
542
572
|
type TileflowPoiModuleConfig = {
|
|
543
573
|
type: 'poi';
|
|
544
574
|
categories?: readonly TileflowPoiCategory[];
|
|
545
575
|
color?: TileflowPoiColorMode;
|
|
576
|
+
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
546
577
|
density?: TileflowPoiDensity;
|
|
547
578
|
icons?: boolean;
|
|
548
579
|
labels?: boolean;
|
|
549
580
|
minZoom?: number;
|
|
550
581
|
placement?: {
|
|
582
|
+
/**
|
|
583
|
+
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
584
|
+
* `false`.
|
|
585
|
+
*/
|
|
551
586
|
coupleIconAndLabel?: boolean;
|
|
552
587
|
iconPadding?: number;
|
|
588
|
+
/**
|
|
589
|
+
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
590
|
+
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
591
|
+
* Defaults to parking and public toilets.
|
|
592
|
+
*/
|
|
593
|
+
iconOnlyTypes?: readonly string[];
|
|
594
|
+
/** Defaults to `importance`. */
|
|
595
|
+
order?: TileflowPoiPlacementOrder;
|
|
596
|
+
/**
|
|
597
|
+
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
598
|
+
* before the map's road and place labels, and the others after them. A map that gives street
|
|
599
|
+
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
600
|
+
* way. Unset, every POI is placed at the module's own position.
|
|
601
|
+
*/
|
|
602
|
+
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
553
603
|
textPadding?: number;
|
|
554
604
|
};
|
|
555
605
|
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
@@ -591,6 +641,13 @@ type ValidationResult = {
|
|
|
591
641
|
messages: ValidationMessage[];
|
|
592
642
|
};
|
|
593
643
|
|
|
644
|
+
/** Artistic presets; selecting one never starts a clock or moves the real sun. */
|
|
645
|
+
declare const tileflowTimesOfDay: readonly ["day", "dawn", "dusk", "night"];
|
|
646
|
+
type TileflowTimeOfDay = (typeof tileflowTimesOfDay)[number];
|
|
647
|
+
/** A named theme family points to complete, already compiled themes. */
|
|
648
|
+
type TileflowTimeOfDayVariants = Readonly<Record<string, Readonly<Partial<Record<TileflowTimeOfDay, string>>>>>;
|
|
649
|
+
declare function isTileflowTimeOfDay(value: unknown): value is TileflowTimeOfDay;
|
|
650
|
+
|
|
594
651
|
declare const defaultTileflowManifestUrl = "/tileflow/manifest.json";
|
|
595
652
|
declare const defaultTileflowRuntimeView: Readonly<{
|
|
596
653
|
bearing: 0;
|
|
@@ -668,6 +725,7 @@ type TileflowRuntimeSource = {
|
|
|
668
725
|
map: string;
|
|
669
726
|
};
|
|
670
727
|
type TileflowRuntimeStyleOptions = {
|
|
728
|
+
timeOfDay?: TileflowTimeOfDay;
|
|
671
729
|
colorScheme?: TileflowRuntimeColorScheme;
|
|
672
730
|
manifestMap?: TileflowRuntimeManifestMap | null;
|
|
673
731
|
source: TileflowRuntimeSource;
|
|
@@ -733,7 +791,7 @@ declare function resolveTileflowRuntimeThemeBlend(options: {
|
|
|
733
791
|
declare function assertValidTileflowRuntimeSource(source: unknown): asserts source is TileflowRuntimeSource;
|
|
734
792
|
declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
|
|
735
793
|
/** Resolve one concrete published theme without consulting ambient browser state. */
|
|
736
|
-
declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme): TileflowResolvedRuntimeTheme;
|
|
794
|
+
declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme, timeOfDay?: TileflowTimeOfDay): TileflowResolvedRuntimeTheme;
|
|
737
795
|
/** Strictly reads Tileflow-owned web-font metadata from a compiled MapLibre style. */
|
|
738
796
|
declare function getTileflowStyleFontFaces(style: Pick<MapLibreStyle, 'metadata'>): TileflowStyleFontFace[];
|
|
739
797
|
declare function normalizeTileflowUrl(value: string): string;
|
|
@@ -769,6 +827,7 @@ declare function resolveTileflowStaticImageUrl(input: {
|
|
|
769
827
|
} | null;
|
|
770
828
|
manifestMap: TileflowRuntimeManifestMap | null;
|
|
771
829
|
theme?: TileflowThemeSelection;
|
|
830
|
+
timeOfDay?: TileflowTimeOfDay;
|
|
772
831
|
zoom: number;
|
|
773
832
|
}): string | undefined;
|
|
774
833
|
declare function normalizeTileflowStaticImageSize(input: {
|
|
@@ -780,8 +839,10 @@ declare function normalizeTileflowStaticImageSize(input: {
|
|
|
780
839
|
};
|
|
781
840
|
declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
|
|
782
841
|
|
|
783
|
-
/** The
|
|
842
|
+
/** The original public multi-theme runtime manifest contract. */
|
|
784
843
|
declare const tileflowRuntimeManifestVersion: 1;
|
|
844
|
+
/** V2 adds the optional time-of-day catalog; maps without it still publish V1. */
|
|
845
|
+
declare const tileflowTimeOfDayManifestVersion: 2;
|
|
785
846
|
declare const tileflowRuntimeManifestLimits: Readonly<{
|
|
786
847
|
maximumBytes: number;
|
|
787
848
|
}>;
|
|
@@ -807,6 +868,7 @@ type TileflowRuntimeManifestMapEntry = {
|
|
|
807
868
|
mapId?: string;
|
|
808
869
|
systemThemes?: TileflowRuntimeSystemThemes;
|
|
809
870
|
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
871
|
+
timeOfDay?: TileflowTimeOfDayVariants;
|
|
810
872
|
usageMode?: 'session';
|
|
811
873
|
view?: TileflowViewConfig;
|
|
812
874
|
worldGeneration?: 'v1';
|
|
@@ -820,7 +882,7 @@ type TileflowRuntimeManifestMapEntry = {
|
|
|
820
882
|
type TileflowRuntimeManifest = {
|
|
821
883
|
apiUrl?: string;
|
|
822
884
|
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
823
|
-
version: typeof tileflowRuntimeManifestVersion;
|
|
885
|
+
version: typeof tileflowRuntimeManifestVersion | typeof tileflowTimeOfDayManifestVersion;
|
|
824
886
|
};
|
|
825
887
|
|
|
826
|
-
export { type
|
|
888
|
+
export { type TileflowLineLayout as $, type TileflowAerodromeCodeDetail as A, type TileflowAlignment as B, type TileflowAnalytics as C, type TileflowAreaStyle as D, type TileflowBackgroundPaint as E, type TileflowCirclePaint as F, type TileflowColor as G, type TileflowColorStyleValue as H, type TileflowExtrusionPaint as I, type TileflowFillPaint as J, type TileflowIconAnchor as K, type TileflowIconLayout as L, type MapLibreStyle as M, type TileflowIconPaint as N, type TileflowIconStyle as O, type TileflowIconTextFit as P, type TileflowImageStyleValue as Q, type TileflowLabelDetail as R, type TileflowLabelLanguage as S, type TileflowRuntimeManifest as T, type TileflowLabelStyles as U, type ValidationMessage as V, type TileflowLayerRange as W, type TileflowLight as X, type TileflowLineCap as Y, type TileflowLineHatchStyle as Z, type TileflowLineJoin as _, type TileflowRuntimeColorScheme as a, type TileflowTerrainContoursConfig as a$, type TileflowLinePaint as a0, type TileflowLineStackStyle as a1, type TileflowManifestFetchOptions as a2, type TileflowManifestLoadOptions as a3, type TileflowMapMode as a4, type TileflowMapModeOptions as a5, type TileflowMarkerSymbolStyle as a6, type TileflowMountainBikeScale as a7, type TileflowNumberInsetsStyleValue as a8, type TileflowNumberStyleValue as a9, type TileflowRoadStreetLightStyle as aA, type TileflowRoadStructure as aB, type TileflowRoadTreatmentLayerStyle as aC, type TileflowRoadTreatmentLineStyle as aD, type TileflowRoadTreatmentStyle as aE, type TileflowRoadWeight as aF, type TileflowRuntimeCenterLike as aG, type TileflowRuntimeManifestMap as aH, type TileflowRuntimeSource as aI, type TileflowRuntimeSourceValidation as aJ, type TileflowRuntimeStyle as aK, type TileflowRuntimeStyleOptions as aL, type TileflowRuntimeViewOptions as aM, type TileflowSessionController as aN, type TileflowSessionGrantResponse as aO, type TileflowStringStyleValue as aP, type TileflowStructuralStyleValue as aQ, type TileflowStyleFontFace as aR, type TileflowStyleValue as aS, type TileflowSymbolOverlap as aT, type TileflowSymbolPlacement as aU, type TileflowSymbolPlacementStyle as aV, type TileflowSymbolZOrder as aW, type TileflowTerrain as aX, type TileflowTerrainConfig as aY, type TileflowTerrainContourLabelStyle as aZ, type TileflowTerrainContourLineStyle as a_, type TileflowPlaceLabelClass as aa, type TileflowPoiCategory as ab, type TileflowPoiCategoryStyle as ac, type TileflowPoiColorMode as ad, type TileflowPoiDensity as ae, type TileflowPoiPlacementOrder as af, type TileflowPriorityOrder as ag, type TileflowProjection as ah, type TileflowResolvedRuntimeTheme as ai, type TileflowRoadAreaStyle as aj, type TileflowRoadClass as ak, type TileflowRoadClassStyle as al, type TileflowRoadCrossingStyle as am, type TileflowRoadDetail as an, type TileflowRoadExtras as ao, type TileflowRoadHierarchy as ap, type TileflowRoadLabelDetail as aq, type TileflowRoadLayerStyle as ar, type TileflowRoadModifier as as, type TileflowRoadOutline as at, type TileflowRoadRestriction as au, type TileflowRoadRoundaboutStyle as av, type TileflowRoadServiceType as aw, type TileflowRoadShieldDetail as ax, type TileflowRoadShieldStyles as ay, type TileflowRoadSidewalkStyle as az, type TileflowRuntimeManifestMapEntry as b, zoom as b$, type TileflowTerrainEncoding as b0, type TileflowTerrainHillshadeStyle as b1, type TileflowTerrainLayerRange as b2, type TileflowTerrainMode as b3, type TileflowTextAnchor as b4, type TileflowTextBackground as b5, type TileflowTextJustify as b6, type TileflowTextLayout as b7, type TileflowTextPaint as b8, type TileflowTextStyle as b9, isTileflowTimeOfDay as bA, loadTileflowManifest as bB, mergeTileflowAnalytics as bC, nearestTileflowBlendTheme as bD, normalizeTileflowRuntimeCenter as bE, normalizeTileflowStaticImageSize as bF, normalizeTileflowUrl as bG, resolveTileflowAnalyticsRequestUrl as bH, resolveTileflowManifestMap as bI, resolveTileflowMapMode as bJ, resolveTileflowRuntimeStyle as bK, resolveTileflowRuntimeTheme as bL, resolveTileflowRuntimeThemeBlend as bM, resolveTileflowRuntimeView as bN, resolveTileflowStaticImageUrl as bO, shouldLoadTileflowManifest as bP, startTileflowSession as bQ, tileflowPoiCategories as bR, tileflowStyleFontFaceLimits as bS, tileflowStyleFontFacesMetadataKey as bT, tileflowThemeBlendLimits as bU, tileflowThemeTokenCategories as bV, tileflowTimesOfDay as bW, token as bX, validateTileflowRuntimeSource as bY, validateTileflowThemeBlendSelection as bZ, validateTileflowThemeSelection as b_, type TileflowThemeBlendSelection as ba, type TileflowThemeColorAlpha as bb, type TileflowThemeColorMix as bc, type TileflowThemeColorValue as bd, type TileflowThemeFontValue as be, type TileflowThemeImageValue as bf, type TileflowThemeNumberValue as bg, type TileflowThemeSelection as bh, type TileflowThemeTokenCategory as bi, type TileflowThemeValue as bj, type TileflowViewConfig as bk, type TileflowWaterLabelClass as bl, type TileflowZoomInterpolation as bm, type TileflowZoomValue as bn, type ValidationResult as bo, assertValidTileflowRuntimeSource as bp, clearTileflowManifestCache as bq, color as br, createTileflowSessionController as bs, createTileflowSessionId as bt, defaultTileflowManifestUrl as bu, defaultTileflowRuntimeView as bv, fixed as bw, getTileflowAnalyticsApiUrl as bx, getTileflowStyleFontFaces as by, inferTileflowAnalyticsFromStyleUrl as bz, type TileflowRuntimeManifestTheme as c, type TileflowTypographyStyle as c0, type ResolvedTileflowTypography as c1, normalizeTileflowSurfaceId as c2, type TileflowRuntimeSystemThemes as d, type TileflowTimeOfDay as e, type TileflowTimeOfDayVariants as f, tileflowRuntimeManifestVersion as g, tileflowTimeOfDayManifestVersion as h, type TileflowExpression as i, type TileflowFixedValue as j, type TileflowThemeTokenReference as k, type TileflowThemeColorOperation as l, type TileflowBackgroundStyle as m, type TileflowCircleStyle as n, type TileflowExtrusionStyle as o, type TileflowFillStyle as p, type TileflowLineStyle as q, type TileflowSymbolStyle as r, type TileflowRoadsModuleOptions as s, tileflowRuntimeManifestLimits as t, type TileflowRoadsModuleConfig as u, type TileflowLabelsModuleOptions as v, type TileflowLabelsModuleConfig as w, type TileflowPoiModuleOptions as x, type TileflowPoiModuleConfig as y, type MapLibreSprite as z };
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { T as TileflowRuntimeManifest } from './manifest-types-jrBdBrES.js';
|
|
2
|
+
export { a as TileflowRuntimeColorScheme, b as TileflowRuntimeManifestMapEntry, c as TileflowRuntimeManifestTheme, d as TileflowRuntimeSystemThemes, e as TileflowTimeOfDay, f as TileflowTimeOfDayVariants, t as tileflowRuntimeManifestLimits, g as tileflowRuntimeManifestVersion, h as tileflowTimeOfDayManifestVersion } from './manifest-types-jrBdBrES.js';
|
|
1
3
|
import { z } from 'zod';
|
|
2
|
-
import { T as TileflowRuntimeManifest } from './manifest-types-hmzy2bBX.js';
|
|
3
|
-
export { a as TileflowRuntimeColorScheme, b as TileflowRuntimeManifestMapEntry, c as TileflowRuntimeManifestTheme, d as TileflowRuntimeSystemThemes, t as tileflowRuntimeManifestLimits, e as tileflowRuntimeManifestVersion } from './manifest-types-hmzy2bBX.js';
|
|
4
4
|
|
|
5
5
|
declare const tileflowRuntimeManifestSchema: z.ZodType<TileflowRuntimeManifest>;
|
|
6
6
|
declare function parseTileflowRuntimeManifest(input: unknown): TileflowRuntimeManifest;
|
package/dist/manifest.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/manifest-types.ts
|
|
2
2
|
var tileflowRuntimeManifestVersion = 1;
|
|
3
|
+
var tileflowTimeOfDayManifestVersion = 2;
|
|
3
4
|
var tileflowRuntimeManifestLimits = Object.freeze({ maximumBytes: 1024 * 1024 });
|
|
4
5
|
|
|
5
6
|
// src/portable-identity-rules.ts
|
|
@@ -48,6 +49,43 @@ function createTileflowRuntimeViewSchema(operations) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
// src/time-of-day.ts
|
|
53
|
+
var tileflowTimesOfDay = ["day", "dawn", "dusk", "night"];
|
|
54
|
+
function isTileflowTimeOfDay(value) {
|
|
55
|
+
return typeof value === "string" && tileflowTimesOfDay.includes(value);
|
|
56
|
+
}
|
|
57
|
+
function validateTileflowTimeOfDayVariants(variants, themes) {
|
|
58
|
+
const issues = [];
|
|
59
|
+
const owners = /* @__PURE__ */ new Map();
|
|
60
|
+
const families = Object.entries(variants);
|
|
61
|
+
for (const [family, moments] of families) {
|
|
62
|
+
if (!isTileflowThemeName(family) || !Object.hasOwn(themes, family)) {
|
|
63
|
+
issues.push({ path: [family], message: "Time-of-day family must name an existing theme" });
|
|
64
|
+
}
|
|
65
|
+
if (!Object.values(moments).includes(family)) {
|
|
66
|
+
issues.push({ path: [family], message: "A family must include its own theme in its presets" });
|
|
67
|
+
}
|
|
68
|
+
for (const [moment, name] of Object.entries(moments)) {
|
|
69
|
+
if (name === void 0) continue;
|
|
70
|
+
if (!isTileflowTimeOfDay(moment) || !isTileflowThemeName(name) || !Object.hasOwn(themes, name)) {
|
|
71
|
+
issues.push({
|
|
72
|
+
path: [family, moment],
|
|
73
|
+
message: "Expected a supported moment and an existing theme"
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const owner = owners.get(name);
|
|
77
|
+
if (owner !== void 0 && owner !== family) {
|
|
78
|
+
issues.push({
|
|
79
|
+
path: [family, moment],
|
|
80
|
+
message: `Theme "${name}" already belongs to family "${owner}"`
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
owners.set(name, family);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return issues;
|
|
87
|
+
}
|
|
88
|
+
|
|
51
89
|
// src/themes/model.ts
|
|
52
90
|
var tileflowThemeLimits = Object.freeze({ maxThemes: 64 });
|
|
53
91
|
var themeTypographyStyleKeys = ["fallbacks", "font", "letterSpacing", "transform"];
|
|
@@ -59,6 +97,19 @@ var themeTypographyKeys = [
|
|
|
59
97
|
"water"
|
|
60
98
|
];
|
|
61
99
|
|
|
100
|
+
// src/time-of-day-schema.ts
|
|
101
|
+
function createTileflowTimeOfDaySchema(operations, themeName) {
|
|
102
|
+
return operations.record(
|
|
103
|
+
themeName,
|
|
104
|
+
operations.object({
|
|
105
|
+
day: operations.optional(themeName),
|
|
106
|
+
dawn: operations.optional(themeName),
|
|
107
|
+
dusk: operations.optional(themeName),
|
|
108
|
+
night: operations.optional(themeName)
|
|
109
|
+
})
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
62
113
|
// src/manifest-schema.ts
|
|
63
114
|
function createTileflowRuntimeManifestSchema(primitives, operations, identities = createPortableIdentitySchemas(operations)) {
|
|
64
115
|
const { tileflowPortableIdSchema: tileflowPortableIdSchema2, tileflowThemeNameSchema: tileflowThemeNameSchema2 } = identities;
|
|
@@ -114,12 +165,24 @@ function createTileflowRuntimeManifestSchema(primitives, operations, identities
|
|
|
114
165
|
})
|
|
115
166
|
),
|
|
116
167
|
themes: operations.record(tileflowThemeNameSchema2, manifestThemeSchema),
|
|
168
|
+
timeOfDay: operations.optional(
|
|
169
|
+
createTileflowTimeOfDaySchema(operations, tileflowThemeNameSchema2)
|
|
170
|
+
),
|
|
117
171
|
usageMode: operations.optional(operations.literal("session")),
|
|
118
172
|
view: operations.optional(viewSchema),
|
|
119
173
|
worldGeneration: operations.optional(operations.literal("v1"))
|
|
120
174
|
}),
|
|
121
175
|
(entry, context) => {
|
|
122
176
|
const names = Object.keys(entry.themes);
|
|
177
|
+
if (entry.timeOfDay) {
|
|
178
|
+
for (const issue of validateTileflowTimeOfDayVariants(entry.timeOfDay, entry.themes)) {
|
|
179
|
+
context.addIssue({
|
|
180
|
+
code: "custom",
|
|
181
|
+
message: issue.message,
|
|
182
|
+
path: ["timeOfDay", ...issue.path]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
123
186
|
if (names.length === 0) {
|
|
124
187
|
context.addIssue({
|
|
125
188
|
code: "custom",
|
|
@@ -173,10 +236,23 @@ function createTileflowRuntimeManifestSchema(primitives, operations, identities
|
|
|
173
236
|
operations.object({
|
|
174
237
|
apiUrl: operations.optional(apiOriginSchema),
|
|
175
238
|
maps: operations.record(tileflowPortableIdSchema2, manifestMapSchema),
|
|
176
|
-
version: operations.
|
|
239
|
+
version: operations.union(
|
|
240
|
+
operations.literal(tileflowRuntimeManifestVersion),
|
|
241
|
+
operations.literal(2)
|
|
242
|
+
)
|
|
177
243
|
}),
|
|
178
244
|
(manifest, context) => {
|
|
179
245
|
const mapCount = Object.keys(manifest.maps).length;
|
|
246
|
+
if (manifest.version === 1) {
|
|
247
|
+
for (const [name, map] of Object.entries(manifest.maps)) {
|
|
248
|
+
if (map.timeOfDay !== void 0)
|
|
249
|
+
context.addIssue({
|
|
250
|
+
code: "custom",
|
|
251
|
+
message: "timeOfDay requires manifest version 2",
|
|
252
|
+
path: ["maps", name, "timeOfDay"]
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
180
256
|
if (mapCount === 0) {
|
|
181
257
|
context.addIssue({ code: "custom", message: "Expected at least one map", path: ["maps"] });
|
|
182
258
|
}
|
|
@@ -326,6 +402,7 @@ var classicManifestSchemaOperations = {
|
|
|
326
402
|
return z2.enum(values);
|
|
327
403
|
},
|
|
328
404
|
literal: (value) => z2.literal(value),
|
|
405
|
+
union: (left, right) => z2.union([classic(left), classic(right)]),
|
|
329
406
|
tuplePair(left, right) {
|
|
330
407
|
return z2.tuple([classic(left), classic(right)]);
|
|
331
408
|
},
|
|
@@ -364,5 +441,6 @@ export {
|
|
|
364
441
|
safeParseTileflowRuntimeManifest,
|
|
365
442
|
tileflowRuntimeManifestLimits,
|
|
366
443
|
tileflowRuntimeManifestSchema,
|
|
367
|
-
tileflowRuntimeManifestVersion
|
|
444
|
+
tileflowRuntimeManifestVersion,
|
|
445
|
+
tileflowTimeOfDayManifestVersion
|
|
368
446
|
};
|
package/dist/native-profile.js
CHANGED
|
@@ -8744,6 +8744,7 @@ var classicManifestSchemaOperations = {
|
|
|
8744
8744
|
return z3.enum(values);
|
|
8745
8745
|
},
|
|
8746
8746
|
literal: (value) => z3.literal(value),
|
|
8747
|
+
union: (left, right) => z3.union([classic(left), classic(right)]),
|
|
8747
8748
|
tuplePair(left, right) {
|
|
8748
8749
|
return z3.tuple([classic(left), classic(right)]);
|
|
8749
8750
|
},
|
package/dist/native.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/** Artistic presets; selecting one never starts a clock or moves the real sun. */
|
|
2
|
+
declare const tileflowTimesOfDay: readonly ["day", "dawn", "dusk", "night"];
|
|
3
|
+
type TileflowTimeOfDay = (typeof tileflowTimesOfDay)[number];
|
|
4
|
+
/** A named theme family points to complete, already compiled themes. */
|
|
5
|
+
type TileflowTimeOfDayVariants = Readonly<Record<string, Readonly<Partial<Record<TileflowTimeOfDay, string>>>>>;
|
|
6
|
+
|
|
1
7
|
/** URL resolution for native clients, without a renderer or an ambient application origin. */
|
|
2
8
|
declare const tileflowNativeUrlLimits: Readonly<{
|
|
3
9
|
maximumLength: 2048;
|
|
@@ -93,8 +99,10 @@ declare function validateTileflowThemeBlendSelection(value: unknown): value is T
|
|
|
93
99
|
/** The theme nearest to a blend position, which a blend shows when it cannot blend. */
|
|
94
100
|
declare function nearestTileflowBlendTheme(blend: TileflowThemeBlendSelection): string;
|
|
95
101
|
|
|
96
|
-
/** The
|
|
102
|
+
/** The original public multi-theme runtime manifest contract. */
|
|
97
103
|
declare const tileflowRuntimeManifestVersion: 1;
|
|
104
|
+
/** V2 adds the optional time-of-day catalog; maps without it still publish V1. */
|
|
105
|
+
declare const tileflowTimeOfDayManifestVersion: 2;
|
|
98
106
|
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
99
107
|
type TileflowRuntimeManifestTheme = {
|
|
100
108
|
colorScheme: TileflowRuntimeColorScheme;
|
|
@@ -117,6 +125,7 @@ type TileflowRuntimeManifestMapEntry = {
|
|
|
117
125
|
mapId?: string;
|
|
118
126
|
systemThemes?: TileflowRuntimeSystemThemes;
|
|
119
127
|
themes: Record<string, TileflowRuntimeManifestTheme>;
|
|
128
|
+
timeOfDay?: TileflowTimeOfDayVariants;
|
|
120
129
|
usageMode?: 'session';
|
|
121
130
|
view?: TileflowViewConfig;
|
|
122
131
|
worldGeneration?: 'v1';
|
|
@@ -130,7 +139,7 @@ type TileflowRuntimeManifestMapEntry = {
|
|
|
130
139
|
type TileflowRuntimeManifest = {
|
|
131
140
|
apiUrl?: string;
|
|
132
141
|
maps: Record<string, TileflowRuntimeManifestMapEntry>;
|
|
133
|
-
version: typeof tileflowRuntimeManifestVersion;
|
|
142
|
+
version: typeof tileflowRuntimeManifestVersion | typeof tileflowTimeOfDayManifestVersion;
|
|
134
143
|
};
|
|
135
144
|
|
|
136
145
|
/** The adapter must honor the requested read bound, without first buffering an unbounded body. */
|
|
@@ -179,6 +188,7 @@ type TileflowNativeSource = {
|
|
|
179
188
|
};
|
|
180
189
|
type TileflowNativeSourceOptions = {
|
|
181
190
|
theme?: string;
|
|
191
|
+
timeOfDay?: TileflowTimeOfDay;
|
|
182
192
|
/** Required only for theme="system"; no ambient appearance access. */
|
|
183
193
|
colorScheme?: TileflowRuntimeColorScheme;
|
|
184
194
|
signal?: TileflowNativeAbortSignal;
|
|
@@ -352,4 +362,4 @@ declare function planTileflowThemeBlend(styles: readonly MapLibreStyle[], option
|
|
|
352
362
|
/** Fills one blend template for a position. Plain values pass through unchanged. */
|
|
353
363
|
declare function fillTileflowThemeBlendTemplate(template: unknown, position: number): unknown;
|
|
354
364
|
|
|
355
|
-
export { type TileflowNativeAbortSignal, type TileflowNativeInitialView, type TileflowNativeInitialViewOptions, type TileflowNativeManifestAcquire, type TileflowNativeManifestLoadOptions, type TileflowNativeManifestOperation, type TileflowNativeManifestReader, type TileflowNativeManifestResponse, type TileflowNativeManifestResult, type TileflowNativeNetworkOptions, type TileflowNativeResourceUrlOptions, type TileflowNativeSource, type TileflowNativeSourceController, TileflowNativeSourceError, type TileflowNativeSourceErrorCode, type TileflowNativeSourceErrorField, type TileflowNativeSourceOptions, type TileflowNativeSourceState, TileflowNativeUrlError, type TileflowNativeUrlErrorCode, type TileflowNativeUrlField, type TileflowThemeBlendClock, TileflowThemeBlendError, type TileflowThemeBlendImage, type TileflowThemeBlendOptions, type TileflowThemeBlendPaint, type TileflowThemeBlendPlan, type TileflowThemeBlendSelection, type TileflowThemeBlendSwitch, createTileflowNativeSourceController, fillTileflowThemeBlendTemplate, loadTileflowNativeManifest, nearestTileflowBlendTheme, planTileflowThemeBlend, resolveTileflowNativeInitialView, resolveTileflowNativeManifestUrl, resolveTileflowNativeResourceUrl, tileflowNativeManifestLimits, tileflowNativeUrlLimits, tileflowThemeBlendLimits, validateTileflowThemeBlendSelection };
|
|
365
|
+
export { type TileflowNativeAbortSignal, type TileflowNativeInitialView, type TileflowNativeInitialViewOptions, type TileflowNativeManifestAcquire, type TileflowNativeManifestLoadOptions, type TileflowNativeManifestOperation, type TileflowNativeManifestReader, type TileflowNativeManifestResponse, type TileflowNativeManifestResult, type TileflowNativeNetworkOptions, type TileflowNativeResourceUrlOptions, type TileflowNativeSource, type TileflowNativeSourceController, TileflowNativeSourceError, type TileflowNativeSourceErrorCode, type TileflowNativeSourceErrorField, type TileflowNativeSourceOptions, type TileflowNativeSourceState, TileflowNativeUrlError, type TileflowNativeUrlErrorCode, type TileflowNativeUrlField, type TileflowThemeBlendClock, TileflowThemeBlendError, type TileflowThemeBlendImage, type TileflowThemeBlendOptions, type TileflowThemeBlendPaint, type TileflowThemeBlendPlan, type TileflowThemeBlendSelection, type TileflowThemeBlendSwitch, type TileflowTimeOfDay, type TileflowTimeOfDayVariants, createTileflowNativeSourceController, fillTileflowThemeBlendTemplate, loadTileflowNativeManifest, nearestTileflowBlendTheme, planTileflowThemeBlend, resolveTileflowNativeInitialView, resolveTileflowNativeManifestUrl, resolveTileflowNativeResourceUrl, tileflowNativeManifestLimits, tileflowNativeUrlLimits, tileflowThemeBlendLimits, validateTileflowThemeBlendSelection };
|