@tileflow/core 0.1.0-alpha.40 → 0.1.0-alpha.42

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/dist/build.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { T as TileflowCaptureScene, a as TileflowCaptureShot } from './capture-shot-ChPQvPyi.js';
2
- import { T as TileflowRenderedIconIdentity, a as TileflowIconCompositionV1, R as ResolvedTileflowMap, b as TileflowDataRequirementsV1, c as TileflowSourceRequirementsV1, d as TileflowMap, e as TileflowStyleOptions, f as TileflowInspectedStyle, g as TileflowPreparedMapAssets } from './icon-composition-CcSHApUm.js';
3
- export { h as TileflowDataCompatibilityIssue, i as TileflowDataFieldRequirement, j as TileflowDataFieldType, k as TileflowDataLayerRequirement, l as TileflowObservedDataContractV1, m as TileflowStyleInspection, n as TileflowStyleInspectionContribution, o as TileflowStyleInspectionLayer, p as TileflowStyleInspectionRenderOperation, q as collectMapLineage, r as inferTileflowDataRequirements, s as inferTileflowSourceRequirements, t as tileflowStyleInspectionSchemaVersion, v as validateTileflowDataCompatibility } from './icon-composition-CcSHApUm.js';
4
- import { M as MapLibreStyle, f as TileflowTimeOfDayVariants, T as TileflowRuntimeManifest } from './manifest-types-DnhSJjCM.js';
2
+ import { T as TileflowRenderedIconIdentity, a as TileflowIconCompositionV1, R as ResolvedTileflowMap, b as TileflowDataRequirementsV1, c as TileflowSourceRequirementsV1, d as TileflowMap, e as TileflowStyleOptions, f as TileflowInspectedStyle, g as TileflowPreparedMapAssets } from './icon-composition-B1A2udKb.js';
3
+ export { h as TileflowDataCompatibilityIssue, i as TileflowDataFieldRequirement, j as TileflowDataFieldType, k as TileflowDataLayerRequirement, l as TileflowObservedDataContractV1, m as TileflowStyleInspection, n as TileflowStyleInspectionContribution, o as TileflowStyleInspectionLayer, p as TileflowStyleInspectionRenderOperation, q as collectMapLineage, r as inferTileflowDataRequirements, s as inferTileflowSourceRequirements, t as tileflowStyleInspectionSchemaVersion, v as validateTileflowDataCompatibility } from './icon-composition-B1A2udKb.js';
4
+ import { M as MapLibreStyle, f as TileflowTimeOfDayVariants, T as TileflowRuntimeManifest } from './manifest-types-B0lQjabX.js';
5
5
  import { z } from 'zod';
6
6
 
7
7
  declare const tileflowMapRevisionSchemaVersion: 1;
package/dist/build.js CHANGED
@@ -5161,6 +5161,7 @@ function resolvePoi(request) {
5161
5161
  density: request?.density ?? 2,
5162
5162
  detailZoom: request?.detailZoom ?? 17,
5163
5163
  densityByCategory: { ...request?.densityByCategory },
5164
+ maxRankByType: { ...request?.maxRankByType },
5164
5165
  icons: request?.icons ?? true,
5165
5166
  labels: request?.labels ?? true,
5166
5167
  minZoom: request?.minZoom ?? 0,
@@ -5644,6 +5645,9 @@ function compileCategory(category, request, semantics, context, language, select
5644
5645
  }
5645
5646
  function createPoiSelection(semantics, context, language) {
5646
5647
  const { fields: fields2 } = context.data.schema;
5648
+ const typeRankCaps = Object.entries(semantics.maxRankByType).sort(
5649
+ ([a], [b]) => a.localeCompare(b)
5650
+ );
5647
5651
  const shown = /* @__PURE__ */ new Map();
5648
5652
  const iconOnlyTypes = [...new Set(semantics.placement.iconOnlyTypes)];
5649
5653
  const iconOnly = () => iconOnlyTypes.length ? ["match", ["get", fields2.poiType], iconOnlyTypes, true, false] : ["literal", false];
@@ -5679,6 +5683,14 @@ function createPoiSelection(semantics, context, language) {
5679
5683
  [">=", sizeRank, 0],
5680
5684
  ["<=", sizeRank, 16]
5681
5685
  ];
5686
+ if (typeRankCaps.length) {
5687
+ result.push([
5688
+ "match",
5689
+ ["get", fields2.poiType],
5690
+ ...typeRankCaps.flatMap(([type, rank]) => [type, ["<=", filterRank, rank]]),
5691
+ true
5692
+ ]);
5693
+ }
5682
5694
  if (!semantics.icons || !semantics.labels) return result;
5683
5695
  const textless = categories.filter((category) => !shown.get(category)?.text);
5684
5696
  const iconless = categories.filter((category) => !shown.get(category)?.icon);
@@ -5924,6 +5936,7 @@ var visualNumberProperties = /* @__PURE__ */ new Set([
5924
5936
  "lightness",
5925
5937
  "fadeDuration",
5926
5938
  "gapWidth",
5939
+ "groundOcclusion",
5927
5940
  "haloBlur",
5928
5941
  "haloWidth",
5929
5942
  "height",
@@ -10898,6 +10911,12 @@ var tileflowModelParts = Object.freeze({
10898
10911
  accent: 3,
10899
10912
  roof: 4
10900
10913
  });
10914
+ var tileflowModelArchitecturalPartNames = Object.freeze(
10915
+ Object.keys(tileflowModelParts)
10916
+ );
10917
+ function isTileflowModelPartName(value) {
10918
+ return typeof value === "string" && value.length <= 32 && /^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$/u.test(value);
10919
+ }
10901
10920
  var tileflowModelLightingRoles = Object.freeze({
10902
10921
  unclassified: 0,
10903
10922
  wall: 1,
@@ -10907,7 +10926,6 @@ var tileflowModelLightingRoles = Object.freeze({
10907
10926
  lamp: 5,
10908
10927
  logo: 6
10909
10928
  });
10910
- var tileflowModelDefaultLightingRoles = Object.freeze([1, 1, 4, 1, 3]);
10911
10929
  var tileflowModelLimits = Object.freeze({
10912
10930
  /** Levels of detail, nearest first. */
10913
10931
  levels: 3,
@@ -10924,7 +10942,9 @@ var tileflowModelLimits = Object.freeze({
10924
10942
  /** Models in one prepared file, as a landmark tile holds them. */
10925
10943
  models: 512,
10926
10944
  /** Bytes of one prepared file. */
10927
- bytes: 16 * 1024 * 1024
10945
+ bytes: 16 * 1024 * 1024,
10946
+ /** Differently named parts of one level. */
10947
+ parts: 16
10928
10948
  });
10929
10949
 
10930
10950
  // src/building-illumination.ts
@@ -10967,6 +10987,9 @@ function readModelRoleLighting(value) {
10967
10987
  ...entry.colorMix === void 0 ? {} : { colorMix: bounded(entry.colorMix, 0, 1, 1) },
10968
10988
  ...entry.metallic === void 0 ? {} : { metallic: bounded(entry.metallic, 0, 1, 0) },
10969
10989
  ...entry.roughness === void 0 ? {} : { roughness: bounded(entry.roughness, 0, 1, 1) },
10990
+ ...entry.shading === "map" || entry.shading === "physical" ? { shading: entry.shading } : {},
10991
+ ...entry.ambientOcclusion === void 0 ? {} : { ambientOcclusion: bounded(entry.ambientOcclusion, 0, 1, 1) },
10992
+ ...entry.partColorMix === void 0 ? {} : { partColorMix: bounded(entry.partColorMix, 0, 1, 1) },
10970
10993
  ...readRoleColorVariation(entry.colorVariation),
10971
10994
  emissiveHeight: Array.isArray(gradient) && gradient.length === 5 && gradient.every(
10972
10995
  (v, i) => typeof v === "number" && Number.isFinite(v) && v <= 1 && v >= (i === 4 ? -1 : 0)
@@ -11050,6 +11073,7 @@ var tileflowDefaultBuildings3DDesign = Object.freeze({
11050
11073
  windows: false,
11051
11074
  shadows: true,
11052
11075
  occlusion: true,
11076
+ groundOcclusion: 0.16,
11053
11077
  modelOcclusion: 0.75
11054
11078
  });
11055
11079
  function tileflowBuildingsMetadata(design) {
@@ -14368,6 +14392,9 @@ var modelRoleLightingSchema = z5.object({
14368
14392
  colorMix: boundedThemeNumberSchema(0, 1).optional(),
14369
14393
  metallic: boundedThemeNumberSchema(0, 1).optional(),
14370
14394
  roughness: boundedThemeNumberSchema(0, 1).optional(),
14395
+ shading: z5.enum(["physical", "map"]).optional(),
14396
+ ambientOcclusion: boundedThemeNumberSchema(0, 1).optional(),
14397
+ partColorMix: boundedThemeNumberSchema(0, 1).optional(),
14371
14398
  colorVariation: z5.object({
14372
14399
  hue: z5.tuple([boundedThemeNumberSchema(0, 360), boundedThemeNumberSchema(0, 360)]),
14373
14400
  saturation: z5.tuple([boundedThemeNumberSchema(0, 100), boundedThemeNumberSchema(0, 100)]),
@@ -14394,7 +14421,7 @@ var buildingsModuleSchema = z5.object({
14394
14421
  lighting: z5.enum(["style", "sun"]).optional(),
14395
14422
  colorVariation: boundedThemeNumberSchema(0, 1).optional(),
14396
14423
  edges: boundedThemeNumberSchema(0, 1).optional(),
14397
- edgeRadius: z5.number().min(0).max(1).optional(),
14424
+ edgeRadius: z5.number().min(0).max(1.5).optional(),
14398
14425
  edgeColor: themeColorValueSchema.optional(),
14399
14426
  nightLight: boundedThemeNumberSchema(0, 2).optional(),
14400
14427
  floodLight: z5.object({
@@ -14417,6 +14444,7 @@ var buildingsModuleSchema = z5.object({
14417
14444
  }).strict().optional(),
14418
14445
  entrance: z5.object({ buildings: entranceBandSchema.optional(), models: entranceBandSchema.optional() }).strict().optional(),
14419
14446
  occlusion: z5.boolean().optional(),
14447
+ groundOcclusion: boundedThemeNumberSchema(0, 1).optional(),
14420
14448
  modelOcclusion: boundedThemeNumberSchema(0, 1).optional(),
14421
14449
  shadows: z5.boolean().optional(),
14422
14450
  windows: z5.boolean().optional(),
@@ -14453,13 +14481,14 @@ var buildingsModuleSchema = z5.object({
14453
14481
  }).optional()
14454
14482
  }).strict()
14455
14483
  ).max(256).optional(),
14456
- modelColors: z5.object({
14457
- surface: themeColorValueSchema.optional(),
14458
- secondary: themeColorValueSchema.optional(),
14459
- glass: themeColorValueSchema.optional(),
14460
- accent: themeColorValueSchema.optional(),
14461
- roof: themeColorValueSchema.optional()
14462
- }).strict().optional(),
14484
+ modelColors: z5.record(
14485
+ z5.string().refine(isTileflowModelPartName, {
14486
+ message: "A model part is named in lower-case words joined by hyphens or underscores, at most 32 characters."
14487
+ }),
14488
+ themeColorValueSchema
14489
+ ).refine((colors) => Object.keys(colors).length <= 64, {
14490
+ message: "A map colours at most 64 model parts."
14491
+ }).optional(),
14463
14492
  landmarks: z5.union([
14464
14493
  z5.boolean(),
14465
14494
  z5.object({
@@ -14664,6 +14693,17 @@ var poiModuleSchema = z5.object({
14664
14693
  type: z5.literal("poi"),
14665
14694
  detailZoom: z5.number().finite().gt(16).max(24).optional(),
14666
14695
  categories: z5.array(z5.enum(tileflowPoiCategories)).optional(),
14696
+ maxRankByType: z5.record(
14697
+ z5.string().regex(/^[a-z0-9]+(?:_[a-z0-9]+)*$/u, "Expected a World POI type"),
14698
+ z5.union([
14699
+ z5.literal(0),
14700
+ z5.literal(1),
14701
+ z5.literal(2),
14702
+ z5.literal(3),
14703
+ z5.literal(4),
14704
+ z5.literal(5)
14705
+ ])
14706
+ ).describe("Fixed maximum World filter rank per POI type, independent of zoom detail.").optional(),
14667
14707
  color: z5.enum(["uniform", "category"]).optional(),
14668
14708
  density: z5.union([z5.literal(1), z5.literal(2), z5.literal(3), z5.literal(4), z5.literal(5)]).describe(
14669
14709
  "POI density from 1 to 5. Defaults to 2; native collisions determine which eligible names fit."
@@ -17578,6 +17618,7 @@ function tileflowBuildings3DDesignOf(module, context, layers2, buildingModels, t
17578
17618
  ...readTileflowBuildingsEntrance(style.entrance),
17579
17619
  shadows: typeof style.shadows === "boolean" ? style.shadows : defaults4.shadows,
17580
17620
  occlusion: typeof style.occlusion === "boolean" ? style.occlusion : defaults4.occlusion,
17621
+ groundOcclusion: number(style.groundOcclusion, defaults4.groundOcclusion),
17581
17622
  modelOcclusion: number(style.modelOcclusion, defaults4.modelOcclusion),
17582
17623
  ...placedModels(style.models, buildingModels),
17583
17624
  ...modelColours(style.modelColors),
@@ -17601,7 +17642,7 @@ function placedModels(value, served) {
17601
17642
  throw new Error(
17602
17643
  `The buildings module places missing 3D models: ${missing.join(", ")}. Add ${missing.map((id2) => `${id2}.glb`).join(
17603
17644
  ", "
17604
- )} to a map.models directory, with materials named surface, secondary, glass, accent or roof, and run the Node build so the directories are prepared.`
17645
+ )} to a map.models directory, with each material named after its part, such as surface, glass, roof or water, and run the Node build so the directories are prepared.`
17605
17646
  );
17606
17647
  return {
17607
17648
  models: placements.map((entry) => ({