@tileflow/core 0.1.0-alpha.33 → 0.1.0-alpha.35

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.
@@ -1,3 +1,10 @@
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
+ declare function isTileflowTimeOfDay(value: unknown): value is TileflowTimeOfDay;
7
+
1
8
  declare const expressionBrand: unique symbol;
2
9
  declare const themeValueBrand: unique symbol;
3
10
  declare const zoomBrand: unique symbol;
@@ -444,6 +451,24 @@ type TileflowRoadRoundaboutStyle = {
444
451
  casing?: TileflowCircleStyle;
445
452
  fill?: TileflowCircleStyle;
446
453
  };
454
+ /**
455
+ * How Core's street lights renderer lights the map's streets at night, from the lamps and lit
456
+ * streets its data holds.
457
+ */
458
+ type TileflowRoadStreetLightStyle = {
459
+ /** The light of lamps whose data gives no colour; a warm white by default. */
460
+ color?: TileflowThemeColorValue;
461
+ /** Whether the map has street lights; defaults to true where the data binds street furniture. */
462
+ enabled?: boolean;
463
+ /**
464
+ * Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
465
+ * pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
466
+ * that map few lamps, which invents light; `none` nowhere.
467
+ */
468
+ estimate?: 'lit' | 'streets' | 'none';
469
+ /** How bright the lights shine, from 0 to 2; defaults to 1. */
470
+ intensity?: TileflowThemeNumberValue;
471
+ };
447
472
  type TileflowRoadSidewalkStyle = {
448
473
  outline?: TileflowLineStyle;
449
474
  pattern?: TileflowFillStyle;
@@ -465,6 +490,7 @@ type TileflowRoadsModuleConfig = {
465
490
  roundabouts?: TileflowRoadRoundaboutStyle;
466
491
  serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
467
492
  sidewalks?: TileflowRoadSidewalkStyle;
493
+ streetLights?: TileflowRoadStreetLightStyle;
468
494
  structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
469
495
  weight?: TileflowRoadWeight;
470
496
  widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
@@ -516,21 +542,50 @@ declare const tileflowPoiCategories: readonly ["arts-entertainment", "education"
516
542
  type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
517
543
  type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
518
544
  type TileflowPoiColorMode = 'uniform' | 'category';
519
- type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
520
- /** Optional category-local cap within the module's canonical density tiers. */
521
- density?: TileflowPoiDensity;
522
- };
545
+ /**
546
+ * How POI categories are placed against each other. `importance` places every category in one
547
+ * order, by World's ranks. `categories` gives each category its own layer and places the
548
+ * categories in the order they are listed, the first on top; ranks order each category only.
549
+ */
550
+ type TileflowPoiPlacementOrder = 'categories' | 'importance';
551
+ /**
552
+ * The appearance of one POI category. With the default `importance` order every category shares
553
+ * one placement layer, so categories may differ only in properties MapLibre evaluates per feature
554
+ * (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
555
+ * overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
556
+ */
557
+ type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
523
558
  type TileflowPoiModuleConfig = {
524
559
  type: 'poi';
525
560
  categories?: readonly TileflowPoiCategory[];
526
561
  color?: TileflowPoiColorMode;
562
+ /** One density for the whole module: World's ranks decide what each category shows. */
527
563
  density?: TileflowPoiDensity;
528
564
  icons?: boolean;
529
565
  labels?: boolean;
530
566
  minZoom?: number;
531
567
  placement?: {
568
+ /**
569
+ * Places each pictogram with its name as one unit that needs room for both. Defaults to
570
+ * `false`.
571
+ */
532
572
  coupleIconAndLabel?: boolean;
533
573
  iconPadding?: number;
574
+ /**
575
+ * World POI `type` values whose pictogram explains them. When pictograms and names are both
576
+ * drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
577
+ * Defaults to parking and public toilets.
578
+ */
579
+ iconOnlyTypes?: readonly string[];
580
+ /** Defaults to `importance`. */
581
+ order?: TileflowPoiPlacementOrder;
582
+ /**
583
+ * With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
584
+ * before the map's road and place labels, and the others after them. A map that gives street
585
+ * names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
586
+ * way. Unset, every POI is placed at the module's own position.
587
+ */
588
+ prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
534
589
  textPadding?: number;
535
590
  };
536
591
  styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
@@ -649,6 +704,7 @@ type TileflowRuntimeSource = {
649
704
  map: string;
650
705
  };
651
706
  type TileflowRuntimeStyleOptions = {
707
+ timeOfDay?: TileflowTimeOfDay;
652
708
  colorScheme?: TileflowRuntimeColorScheme;
653
709
  manifestMap?: TileflowRuntimeManifestMap | null;
654
710
  source: TileflowRuntimeSource;
@@ -714,7 +770,7 @@ declare function resolveTileflowRuntimeThemeBlend(options: {
714
770
  declare function assertValidTileflowRuntimeSource(source: unknown): asserts source is TileflowRuntimeSource;
715
771
  declare function resolveTileflowRuntimeStyle(options: TileflowRuntimeStyleOptions): TileflowRuntimeStyle | null;
716
772
  /** Resolve one concrete published theme without consulting ambient browser state. */
717
- declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme): TileflowResolvedRuntimeTheme;
773
+ declare function resolveTileflowRuntimeTheme(map: TileflowRuntimeManifestMap, selection: TileflowThemeSelection | undefined, colorScheme?: TileflowRuntimeColorScheme, timeOfDay?: TileflowTimeOfDay): TileflowResolvedRuntimeTheme;
718
774
  /** Strictly reads Tileflow-owned web-font metadata from a compiled MapLibre style. */
719
775
  declare function getTileflowStyleFontFaces(style: Pick<MapLibreStyle, 'metadata'>): TileflowStyleFontFace[];
720
776
  declare function normalizeTileflowUrl(value: string): string;
@@ -750,6 +806,7 @@ declare function resolveTileflowStaticImageUrl(input: {
750
806
  } | null;
751
807
  manifestMap: TileflowRuntimeManifestMap | null;
752
808
  theme?: TileflowThemeSelection;
809
+ timeOfDay?: TileflowTimeOfDay;
753
810
  zoom: number;
754
811
  }): string | undefined;
755
812
  declare function normalizeTileflowStaticImageSize(input: {
@@ -761,8 +818,10 @@ declare function normalizeTileflowStaticImageSize(input: {
761
818
  };
762
819
  declare function inferTileflowAnalyticsFromStyleUrl(styleUrl: string): TileflowAnalytics | undefined;
763
820
 
764
- /** The first and only public multi-theme runtime manifest contract. */
821
+ /** The original public multi-theme runtime manifest contract. */
765
822
  declare const tileflowRuntimeManifestVersion: 1;
823
+ /** V2 adds the optional time-of-day catalog; maps without it still publish V1. */
824
+ declare const tileflowTimeOfDayManifestVersion: 2;
766
825
  declare const tileflowRuntimeManifestLimits: Readonly<{
767
826
  maximumBytes: number;
768
827
  }>;
@@ -788,6 +847,7 @@ type TileflowRuntimeManifestMapEntry = {
788
847
  mapId?: string;
789
848
  systemThemes?: TileflowRuntimeSystemThemes;
790
849
  themes: Record<string, TileflowRuntimeManifestTheme>;
850
+ timeOfDay?: TileflowTimeOfDayVariants;
791
851
  usageMode?: 'session';
792
852
  view?: TileflowViewConfig;
793
853
  worldGeneration?: 'v1';
@@ -801,7 +861,7 @@ type TileflowRuntimeManifestMapEntry = {
801
861
  type TileflowRuntimeManifest = {
802
862
  apiUrl?: string;
803
863
  maps: Record<string, TileflowRuntimeManifestMapEntry>;
804
- version: typeof tileflowRuntimeManifestVersion;
864
+ version: typeof tileflowRuntimeManifestVersion | typeof tileflowTimeOfDayManifestVersion;
805
865
  };
806
866
 
807
- export { type TileflowManifestFetchOptions as $, type TileflowAreaStyle as A, type TileflowBackgroundPaint as B, type TileflowCirclePaint as C, type TileflowColor as D, type TileflowColorStyleValue as E, type TileflowExtrusionPaint as F, type TileflowFillPaint as G, type TileflowIconAnchor as H, type TileflowIconLayout as I, type TileflowIconPaint as J, type TileflowIconStyle as K, type TileflowIconTextFit as L, type MapLibreStyle as M, type TileflowImageStyleValue as N, type TileflowLabelDetail as O, type TileflowLabelLanguage as P, type TileflowLabelStyles as Q, type TileflowLayerRange as R, type TileflowLight as S, type TileflowRuntimeManifest as T, type TileflowLineCap as U, type ValidationMessage as V, type TileflowLineHatchStyle as W, type TileflowLineJoin as X, type TileflowLineLayout as Y, type TileflowLinePaint as Z, type TileflowLineStackStyle as _, type TileflowRuntimeColorScheme as a, type TileflowTextAnchor as a$, type TileflowManifestLoadOptions as a0, type TileflowMapMode as a1, type TileflowMapModeOptions as a2, type TileflowMarkerSymbolStyle as a3, type TileflowMountainBikeScale as a4, type TileflowNumberInsetsStyleValue as a5, type TileflowNumberStyleValue as a6, type TileflowPlaceLabelClass as a7, type TileflowPoiCategory as a8, type TileflowPoiCategoryStyle as a9, type TileflowRoadWeight as aA, type TileflowRuntimeCenterLike as aB, type TileflowRuntimeManifestMap as aC, type TileflowRuntimeSource as aD, type TileflowRuntimeSourceValidation as aE, type TileflowRuntimeStyle as aF, type TileflowRuntimeStyleOptions as aG, type TileflowRuntimeViewOptions as aH, type TileflowSessionController as aI, type TileflowSessionGrantResponse as aJ, type TileflowStringStyleValue as aK, type TileflowStructuralStyleValue as aL, type TileflowStyleFontFace as aM, type TileflowStyleValue as aN, type TileflowSymbolOverlap as aO, type TileflowSymbolPlacement as aP, type TileflowSymbolPlacementStyle as aQ, type TileflowSymbolZOrder as aR, type TileflowTerrain as aS, type TileflowTerrainConfig as aT, type TileflowTerrainContourLabelStyle as aU, type TileflowTerrainContourLineStyle as aV, type TileflowTerrainContoursConfig as aW, type TileflowTerrainEncoding as aX, type TileflowTerrainHillshadeStyle as aY, type TileflowTerrainLayerRange as aZ, type TileflowTerrainMode as a_, type TileflowPoiColorMode as aa, type TileflowPoiDensity as ab, type TileflowPriorityOrder as ac, type TileflowProjection as ad, type TileflowResolvedRuntimeTheme as ae, type TileflowRoadAreaStyle as af, type TileflowRoadClass as ag, type TileflowRoadClassStyle as ah, type TileflowRoadCrossingStyle as ai, type TileflowRoadDetail as aj, type TileflowRoadExtras as ak, type TileflowRoadHierarchy as al, type TileflowRoadLabelDetail as am, type TileflowRoadLayerStyle as an, type TileflowRoadModifier as ao, type TileflowRoadOutline as ap, type TileflowRoadRestriction as aq, type TileflowRoadRoundaboutStyle as ar, type TileflowRoadServiceType as as, type TileflowRoadShieldDetail as at, type TileflowRoadShieldStyles as au, type TileflowRoadSidewalkStyle as av, type TileflowRoadStructure as aw, type TileflowRoadTreatmentLayerStyle as ax, type TileflowRoadTreatmentLineStyle as ay, type TileflowRoadTreatmentStyle as az, type TileflowRuntimeManifestMapEntry as b, type TileflowTextBackground as b0, type TileflowTextJustify as b1, type TileflowTextLayout as b2, type TileflowTextPaint as b3, type TileflowTextStyle as b4, type TileflowThemeBlendSelection as b5, type TileflowThemeColorAlpha as b6, type TileflowThemeColorMix as b7, type TileflowThemeColorValue as b8, type TileflowThemeFontValue as b9, normalizeTileflowUrl as bA, resolveTileflowAnalyticsRequestUrl as bB, resolveTileflowManifestMap as bC, resolveTileflowMapMode as bD, resolveTileflowRuntimeStyle as bE, resolveTileflowRuntimeTheme as bF, resolveTileflowRuntimeThemeBlend as bG, resolveTileflowRuntimeView as bH, resolveTileflowStaticImageUrl as bI, shouldLoadTileflowManifest as bJ, startTileflowSession as bK, tileflowPoiCategories as bL, tileflowStyleFontFaceLimits as bM, tileflowStyleFontFacesMetadataKey as bN, tileflowThemeBlendLimits as bO, tileflowThemeTokenCategories as bP, token as bQ, validateTileflowRuntimeSource as bR, validateTileflowThemeBlendSelection as bS, validateTileflowThemeSelection as bT, zoom as bU, type TileflowTypographyStyle as bV, type ResolvedTileflowTypography as bW, normalizeTileflowSurfaceId as bX, type TileflowThemeImageValue as ba, type TileflowThemeNumberValue as bb, type TileflowThemeSelection as bc, type TileflowThemeTokenCategory as bd, type TileflowThemeValue as be, type TileflowViewConfig as bf, type TileflowWaterLabelClass as bg, type TileflowZoomInterpolation as bh, type TileflowZoomValue as bi, type ValidationResult as bj, assertValidTileflowRuntimeSource as bk, clearTileflowManifestCache as bl, color as bm, createTileflowSessionController as bn, createTileflowSessionId as bo, defaultTileflowManifestUrl as bp, defaultTileflowRuntimeView as bq, fixed as br, getTileflowAnalyticsApiUrl as bs, getTileflowStyleFontFaces as bt, inferTileflowAnalyticsFromStyleUrl as bu, loadTileflowManifest as bv, mergeTileflowAnalytics as bw, nearestTileflowBlendTheme as bx, normalizeTileflowRuntimeCenter as by, normalizeTileflowStaticImageSize as bz, type TileflowRuntimeManifestTheme as c, type TileflowRuntimeSystemThemes as d, tileflowRuntimeManifestVersion as e, type TileflowExpression as f, type TileflowFixedValue as g, type TileflowThemeTokenReference as h, type TileflowThemeColorOperation as i, type TileflowBackgroundStyle as j, type TileflowCircleStyle as k, type TileflowExtrusionStyle as l, type TileflowFillStyle as m, type TileflowLineStyle as n, type TileflowSymbolStyle as o, type TileflowRoadsModuleOptions as p, type TileflowRoadsModuleConfig as q, type TileflowLabelsModuleOptions as r, type TileflowLabelsModuleConfig as s, tileflowRuntimeManifestLimits as t, type TileflowPoiModuleOptions as u, type TileflowPoiModuleConfig as v, type MapLibreSprite as w, type TileflowAerodromeCodeDetail as x, type TileflowAlignment as y, type TileflowAnalytics as z };
867
+ 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 };
@@ -1,6 +1,6 @@
1
+ import { T as TileflowRuntimeManifest } from './manifest-types-Bzxon3dx.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-Bzxon3dx.js';
1
3
  import { z } from 'zod';
2
- import { T as TileflowRuntimeManifest } from './manifest-types-E7m23eXL.js';
3
- export { a as TileflowRuntimeColorScheme, b as TileflowRuntimeManifestMapEntry, c as TileflowRuntimeManifestTheme, d as TileflowRuntimeSystemThemes, t as tileflowRuntimeManifestLimits, e as tileflowRuntimeManifestVersion } from './manifest-types-E7m23eXL.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.literal(tileflowRuntimeManifestVersion)
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
  };
@@ -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 first and only public multi-theme runtime manifest contract. */
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 };