@tileflow/core 0.1.0-alpha.24 → 0.1.0-alpha.25
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 +165 -1228
- package/dist/build.d.ts +9 -4
- package/dist/build.js +831 -619
- package/dist/config-reference.json +1703 -1661
- package/dist/{map-BHL_0Mkx.d.ts → icon-composition-BssSKOKF.d.ts} +83 -3
- package/dist/index.d.ts +141 -3
- package/dist/index.js +1014 -608
- package/dist/native.d.ts +31 -0
- package/dist/native.js +143 -0
- package/docs/authoring-model.md +198 -0
- package/docs/capture-scenes.md +36 -0
- package/docs/compiled-style-performance.md +263 -0
- package/docs/data-is-separate-from-design.md +345 -0
- package/docs/hosted-session-authorization.md +113 -0
- package/docs/map-and-terrain-examples.md +149 -0
- package/docs/native-resource-urls.md +117 -0
- package/docs/public-api-and-browser-subpath.md +86 -0
- package/docs/shared-visual-primitives.md +22 -0
- package/docs/themes-and-module-styles.md +83 -0
- package/package.json +8 -2
package/dist/build.js
CHANGED
|
@@ -6771,10 +6771,10 @@ function roadWidth(roadClass, scale) {
|
|
|
6771
6771
|
[16, 3.4]
|
|
6772
6772
|
]
|
|
6773
6773
|
};
|
|
6774
|
-
return zoom.linear(stops[roadClass].map(([
|
|
6774
|
+
return zoom.linear(stops[roadClass].map(([z9, value]) => [z9, value * scale]));
|
|
6775
6775
|
}
|
|
6776
6776
|
function widen(value, addition) {
|
|
6777
|
-
return zoom.linear(value.stops.map(([
|
|
6777
|
+
return zoom.linear(value.stops.map(([z9, width]) => [z9, width + addition]));
|
|
6778
6778
|
}
|
|
6779
6779
|
function structureFilter(field2, structure) {
|
|
6780
6780
|
if (structure === "surface") {
|
|
@@ -8420,8 +8420,60 @@ function assertNever(value) {
|
|
|
8420
8420
|
throw new Error(`Unsupported Tileflow map merge strategy: ${String(value)}`);
|
|
8421
8421
|
}
|
|
8422
8422
|
|
|
8423
|
-
// src/
|
|
8423
|
+
// src/icon-set.ts
|
|
8424
8424
|
import { z as z3 } from "zod";
|
|
8425
|
+
var tileflowIconSourceLimit = 32;
|
|
8426
|
+
var slug = "[a-z0-9]+(?:-[a-z0-9]+)*";
|
|
8427
|
+
var tileflowIconSetReferenceSchema = z3.string().max(130).regex(
|
|
8428
|
+
new RegExp(`^@${slug}/${slug}$`, "u"),
|
|
8429
|
+
"Expected a canonical @team/set reference without a version suffix"
|
|
8430
|
+
).refine(
|
|
8431
|
+
(value) => value.slice(1).split("/").every((part) => part.length <= 64),
|
|
8432
|
+
"Team and set slugs must contain at most 64 characters"
|
|
8433
|
+
);
|
|
8434
|
+
var tileflowIconSetSourceSchema = z3.object({
|
|
8435
|
+
kind: z3.literal("icon-set"),
|
|
8436
|
+
reference: tileflowIconSetReferenceSchema
|
|
8437
|
+
}).strict();
|
|
8438
|
+
var tileflowIconSetIdSchema = z3.string().regex(/^ics_[A-Za-z0-9_-]{16}$/u);
|
|
8439
|
+
var tileflowIconSetVersionIdSchema = z3.string().regex(/^icv_[A-Za-z0-9_-]{16}$/u);
|
|
8440
|
+
var tileflowIconSetPackageIdSchema = z3.string().regex(/^icp_[A-Za-z0-9_-]{16,64}$/u);
|
|
8441
|
+
var tileflowIconSetTeamIdSchema = z3.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/u);
|
|
8442
|
+
var TileflowIconSetError = class extends Error {
|
|
8443
|
+
constructor(code, message, options) {
|
|
8444
|
+
super(message, options);
|
|
8445
|
+
this.code = code;
|
|
8446
|
+
this.name = "TileflowIconSetError";
|
|
8447
|
+
}
|
|
8448
|
+
code;
|
|
8449
|
+
phase = "icon-resolution";
|
|
8450
|
+
};
|
|
8451
|
+
function collectTileflowIconSetReferences(sources) {
|
|
8452
|
+
if (sources.length > tileflowIconSourceLimit) {
|
|
8453
|
+
throw new TileflowIconSetError(
|
|
8454
|
+
"ICON_SET_INVALID",
|
|
8455
|
+
`A map supports at most ${tileflowIconSourceLimit} icon contributors`
|
|
8456
|
+
);
|
|
8457
|
+
}
|
|
8458
|
+
const references = [];
|
|
8459
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8460
|
+
for (const source of sources) {
|
|
8461
|
+
if (typeof source !== "object" || source === null || source.kind !== "icon-set") continue;
|
|
8462
|
+
const parsed = tileflowIconSetSourceSchema.safeParse(source);
|
|
8463
|
+
if (!parsed.success || seen.has(source.reference)) {
|
|
8464
|
+
throw new TileflowIconSetError(
|
|
8465
|
+
"ICON_SET_INVALID",
|
|
8466
|
+
"Icon set references must be canonical and unique within a map"
|
|
8467
|
+
);
|
|
8468
|
+
}
|
|
8469
|
+
seen.add(source.reference);
|
|
8470
|
+
references.push(source.reference);
|
|
8471
|
+
}
|
|
8472
|
+
return references;
|
|
8473
|
+
}
|
|
8474
|
+
|
|
8475
|
+
// src/resolved-map-schema.ts
|
|
8476
|
+
import { z as z4 } from "zod";
|
|
8425
8477
|
|
|
8426
8478
|
// src/cartography/data-expression.ts
|
|
8427
8479
|
var tileflowDataExpressionLimits = Object.freeze({
|
|
@@ -10384,11 +10436,11 @@ var TileflowResolvedMapValidationError = class extends Error {
|
|
|
10384
10436
|
this.messages = messages;
|
|
10385
10437
|
}
|
|
10386
10438
|
};
|
|
10387
|
-
var identifierSchema =
|
|
10388
|
-
var revisionSchema =
|
|
10389
|
-
var zoomNumberSchema =
|
|
10439
|
+
var identifierSchema = z4.string().trim().regex(/^[A-Za-z0-9_-]+$/, "Expected letters, numbers, underscores, or hyphens").refine((value) => value !== "__proto__", "Expected a safe identifier");
|
|
10440
|
+
var revisionSchema = z4.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/, "Expected a portable data revision");
|
|
10441
|
+
var zoomNumberSchema = z4.number().finite().min(0).max(24);
|
|
10390
10442
|
function zoomValueSchemaFor(valueSchema) {
|
|
10391
|
-
const stops =
|
|
10443
|
+
const stops = z4.array(z4.tuple([zoomNumberSchema, valueSchema])).min(1).superRefine((entries, context) => {
|
|
10392
10444
|
for (let index = 1; index < entries.length; index += 1) {
|
|
10393
10445
|
if (entries[index][0] <= entries[index - 1][0]) {
|
|
10394
10446
|
context.addIssue({
|
|
@@ -10399,105 +10451,105 @@ function zoomValueSchemaFor(valueSchema) {
|
|
|
10399
10451
|
}
|
|
10400
10452
|
}
|
|
10401
10453
|
});
|
|
10402
|
-
return
|
|
10403
|
-
|
|
10404
|
-
base:
|
|
10405
|
-
interpolation:
|
|
10406
|
-
kind:
|
|
10454
|
+
return z4.discriminatedUnion("interpolation", [
|
|
10455
|
+
z4.object({
|
|
10456
|
+
base: z4.number().finite().positive(),
|
|
10457
|
+
interpolation: z4.literal("exponential"),
|
|
10458
|
+
kind: z4.literal("zoom"),
|
|
10407
10459
|
stops
|
|
10408
10460
|
}).strict(),
|
|
10409
|
-
|
|
10410
|
-
interpolation:
|
|
10411
|
-
kind:
|
|
10461
|
+
z4.object({
|
|
10462
|
+
interpolation: z4.literal("linear"),
|
|
10463
|
+
kind: z4.literal("zoom"),
|
|
10412
10464
|
stops
|
|
10413
10465
|
}).strict(),
|
|
10414
|
-
|
|
10415
|
-
interpolation:
|
|
10416
|
-
kind:
|
|
10466
|
+
z4.object({
|
|
10467
|
+
interpolation: z4.literal("step"),
|
|
10468
|
+
kind: z4.literal("zoom"),
|
|
10417
10469
|
stops
|
|
10418
10470
|
}).strict()
|
|
10419
10471
|
]);
|
|
10420
10472
|
}
|
|
10421
|
-
var themeTokenNameSchema =
|
|
10473
|
+
var themeTokenNameSchema = z4.string().regex(
|
|
10422
10474
|
/^[A-Za-z][A-Za-z0-9_-]*(?:\.[A-Za-z][A-Za-z0-9_-]*)*$/,
|
|
10423
10475
|
"Expected a portable dot-separated semantic token name"
|
|
10424
10476
|
);
|
|
10425
|
-
var themeTokenReferenceSchema =
|
|
10426
|
-
category:
|
|
10427
|
-
kind:
|
|
10477
|
+
var themeTokenReferenceSchema = z4.object({
|
|
10478
|
+
category: z4.enum(tileflowThemeTokenCategories),
|
|
10479
|
+
kind: z4.literal("theme-token"),
|
|
10428
10480
|
token: themeTokenNameSchema
|
|
10429
10481
|
}).strict();
|
|
10430
10482
|
var themeNumberReferenceSchema = themeTokenReferenceSchema.extend({
|
|
10431
|
-
category:
|
|
10483
|
+
category: z4.literal("number")
|
|
10432
10484
|
});
|
|
10433
|
-
var fixedNumberSchema =
|
|
10434
|
-
kind:
|
|
10435
|
-
reason:
|
|
10436
|
-
value:
|
|
10485
|
+
var fixedNumberSchema = z4.object({
|
|
10486
|
+
kind: z4.literal("theme-fixed"),
|
|
10487
|
+
reason: z4.string().trim().min(1),
|
|
10488
|
+
value: z4.number().finite()
|
|
10437
10489
|
}).strict();
|
|
10438
|
-
var fixedNumberArraySchema =
|
|
10439
|
-
kind:
|
|
10440
|
-
reason:
|
|
10441
|
-
value:
|
|
10490
|
+
var fixedNumberArraySchema = z4.object({
|
|
10491
|
+
kind: z4.literal("theme-fixed"),
|
|
10492
|
+
reason: z4.string().trim().min(1),
|
|
10493
|
+
value: z4.array(z4.number().finite())
|
|
10442
10494
|
}).strict();
|
|
10443
|
-
var fixedNumberOffsetSchema =
|
|
10444
|
-
kind:
|
|
10445
|
-
reason:
|
|
10446
|
-
value:
|
|
10495
|
+
var fixedNumberOffsetSchema = z4.object({
|
|
10496
|
+
kind: z4.literal("theme-fixed"),
|
|
10497
|
+
reason: z4.string().trim().min(1),
|
|
10498
|
+
value: z4.tuple([z4.number().finite(), z4.number().finite()])
|
|
10447
10499
|
}).strict();
|
|
10448
|
-
var fixedNumberInsetsSchema =
|
|
10449
|
-
kind:
|
|
10450
|
-
reason:
|
|
10451
|
-
value:
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
|
|
10500
|
+
var fixedNumberInsetsSchema = z4.object({
|
|
10501
|
+
kind: z4.literal("theme-fixed"),
|
|
10502
|
+
reason: z4.string().trim().min(1),
|
|
10503
|
+
value: z4.tuple([
|
|
10504
|
+
z4.number().finite(),
|
|
10505
|
+
z4.number().finite(),
|
|
10506
|
+
z4.number().finite(),
|
|
10507
|
+
z4.number().finite()
|
|
10456
10508
|
])
|
|
10457
10509
|
}).strict();
|
|
10458
|
-
var fixedStringSchema =
|
|
10459
|
-
var themeColorOperationSchema =
|
|
10460
|
-
() =>
|
|
10461
|
-
|
|
10510
|
+
var fixedStringSchema = z4.object({ kind: z4.literal("theme-fixed"), reason: z4.string().trim().min(1), value: z4.string() }).strict();
|
|
10511
|
+
var themeColorOperationSchema = z4.lazy(
|
|
10512
|
+
() => z4.discriminatedUnion("operation", [
|
|
10513
|
+
z4.object({
|
|
10462
10514
|
color: themeColorValueSchema,
|
|
10463
|
-
kind:
|
|
10515
|
+
kind: z4.literal("theme-color"),
|
|
10464
10516
|
opacity: themeNumberValueSchema,
|
|
10465
|
-
operation:
|
|
10517
|
+
operation: z4.literal("alpha")
|
|
10466
10518
|
}).strict(),
|
|
10467
|
-
|
|
10519
|
+
z4.object({
|
|
10468
10520
|
amount: themeNumberValueSchema,
|
|
10469
10521
|
from: themeColorValueSchema,
|
|
10470
|
-
kind:
|
|
10471
|
-
operation:
|
|
10472
|
-
space:
|
|
10522
|
+
kind: z4.literal("theme-color"),
|
|
10523
|
+
operation: z4.literal("mix"),
|
|
10524
|
+
space: z4.literal("oklch"),
|
|
10473
10525
|
to: themeColorValueSchema
|
|
10474
10526
|
}).strict()
|
|
10475
10527
|
])
|
|
10476
10528
|
);
|
|
10477
|
-
var themeNumberValueSchema =
|
|
10478
|
-
() =>
|
|
10529
|
+
var themeNumberValueSchema = z4.lazy(
|
|
10530
|
+
() => z4.union([z4.number().finite(), fixedNumberSchema, themeNumberReferenceSchema])
|
|
10479
10531
|
);
|
|
10480
|
-
var themeColorValueSchema =
|
|
10481
|
-
() =>
|
|
10482
|
-
|
|
10532
|
+
var themeColorValueSchema = z4.lazy(
|
|
10533
|
+
() => z4.union([
|
|
10534
|
+
z4.string().min(1),
|
|
10483
10535
|
fixedStringSchema,
|
|
10484
|
-
themeTokenReferenceSchema.extend({ category:
|
|
10536
|
+
themeTokenReferenceSchema.extend({ category: z4.literal("color") }),
|
|
10485
10537
|
themeColorOperationSchema
|
|
10486
10538
|
])
|
|
10487
10539
|
);
|
|
10488
|
-
var themeFontValueSchema =
|
|
10489
|
-
|
|
10540
|
+
var themeFontValueSchema = z4.union([
|
|
10541
|
+
z4.string().min(1),
|
|
10490
10542
|
fixedStringSchema,
|
|
10491
|
-
themeTokenReferenceSchema.extend({ category:
|
|
10543
|
+
themeTokenReferenceSchema.extend({ category: z4.literal("font") })
|
|
10492
10544
|
]);
|
|
10493
|
-
var themeImageValueSchema =
|
|
10494
|
-
|
|
10545
|
+
var themeImageValueSchema = z4.union([
|
|
10546
|
+
z4.string().min(1),
|
|
10495
10547
|
fixedStringSchema,
|
|
10496
|
-
themeTokenReferenceSchema.extend({ category:
|
|
10548
|
+
themeTokenReferenceSchema.extend({ category: z4.literal("image") })
|
|
10497
10549
|
]);
|
|
10498
10550
|
function expressionSchemaFor(expectedCategory) {
|
|
10499
10551
|
const category = expectedCategory ?? "structural";
|
|
10500
|
-
return
|
|
10552
|
+
return z4.object({ kind: z4.literal("expression"), value: z4.array(z4.unknown()).min(1) }).strict().superRefine((expression2, context) => {
|
|
10501
10553
|
for (const issue of validateTileflowDataExpression(expression2.value)) {
|
|
10502
10554
|
context.addIssue({
|
|
10503
10555
|
code: "custom",
|
|
@@ -10551,7 +10603,7 @@ function validateExpressionThemeValues(value, expectedCategory, context, path) {
|
|
|
10551
10603
|
return;
|
|
10552
10604
|
}
|
|
10553
10605
|
if (candidate.kind === "theme-fixed") {
|
|
10554
|
-
const parsed = expectedCategory === "number" ?
|
|
10606
|
+
const parsed = expectedCategory === "number" ? z4.union([fixedNumberSchema, fixedNumberArraySchema]).safeParse(candidate) : expectedCategory === "color" || expectedCategory === "image" ? fixedStringSchema.safeParse(candidate) : void 0;
|
|
10555
10607
|
if (!parsed?.success) {
|
|
10556
10608
|
context.addIssue({
|
|
10557
10609
|
code: "custom",
|
|
@@ -10582,71 +10634,71 @@ var structuralExpressionSchema = expressionSchemaFor(void 0);
|
|
|
10582
10634
|
var numberZoomValueSchema = zoomValueSchemaFor(themeNumberValueSchema);
|
|
10583
10635
|
var colorZoomValueSchema = zoomValueSchemaFor(themeColorValueSchema);
|
|
10584
10636
|
var imageZoomValueSchema = zoomValueSchemaFor(themeImageValueSchema);
|
|
10585
|
-
var stringZoomValueSchema = zoomValueSchemaFor(
|
|
10586
|
-
var numberValueSchema =
|
|
10637
|
+
var stringZoomValueSchema = zoomValueSchemaFor(z4.string());
|
|
10638
|
+
var numberValueSchema = z4.union([
|
|
10587
10639
|
themeNumberValueSchema,
|
|
10588
10640
|
numberExpressionSchema,
|
|
10589
10641
|
numberZoomValueSchema
|
|
10590
10642
|
]);
|
|
10591
|
-
var structuralNumberValueSchema =
|
|
10592
|
-
|
|
10643
|
+
var structuralNumberValueSchema = z4.union([
|
|
10644
|
+
z4.number().finite(),
|
|
10593
10645
|
structuralExpressionSchema,
|
|
10594
|
-
zoomValueSchemaFor(
|
|
10646
|
+
zoomValueSchemaFor(z4.number().finite())
|
|
10595
10647
|
]);
|
|
10596
|
-
var colorValueSchema =
|
|
10648
|
+
var colorValueSchema = z4.union([
|
|
10597
10649
|
themeColorValueSchema,
|
|
10598
10650
|
colorExpressionSchema,
|
|
10599
10651
|
colorZoomValueSchema
|
|
10600
10652
|
]);
|
|
10601
|
-
var imageValueSchema =
|
|
10653
|
+
var imageValueSchema = z4.union([
|
|
10602
10654
|
themeImageValueSchema,
|
|
10603
10655
|
imageExpressionSchema,
|
|
10604
10656
|
imageZoomValueSchema
|
|
10605
10657
|
]);
|
|
10606
|
-
var stringValueSchema =
|
|
10607
|
-
var themeNumberArraySchema =
|
|
10608
|
-
var themeNumberArrayValueSchema =
|
|
10609
|
-
var numberArrayValueSchema =
|
|
10658
|
+
var stringValueSchema = z4.union([z4.string(), structuralExpressionSchema, stringZoomValueSchema]);
|
|
10659
|
+
var themeNumberArraySchema = z4.array(themeNumberValueSchema);
|
|
10660
|
+
var themeNumberArrayValueSchema = z4.union([themeNumberArraySchema, fixedNumberArraySchema]);
|
|
10661
|
+
var numberArrayValueSchema = z4.union([
|
|
10610
10662
|
themeNumberArrayValueSchema,
|
|
10611
10663
|
numberExpressionSchema,
|
|
10612
10664
|
zoomValueSchemaFor(themeNumberArrayValueSchema)
|
|
10613
10665
|
]);
|
|
10614
|
-
var themeNumberOffsetSchema =
|
|
10615
|
-
var themeNumberOffsetValueSchema =
|
|
10616
|
-
var numberOffsetValueSchema =
|
|
10666
|
+
var themeNumberOffsetSchema = z4.tuple([themeNumberValueSchema, themeNumberValueSchema]);
|
|
10667
|
+
var themeNumberOffsetValueSchema = z4.union([themeNumberOffsetSchema, fixedNumberOffsetSchema]);
|
|
10668
|
+
var numberOffsetValueSchema = z4.union([
|
|
10617
10669
|
themeNumberOffsetValueSchema,
|
|
10618
10670
|
numberExpressionSchema,
|
|
10619
10671
|
zoomValueSchemaFor(themeNumberOffsetValueSchema)
|
|
10620
10672
|
]);
|
|
10621
|
-
var themeNumberInsetsSchema =
|
|
10673
|
+
var themeNumberInsetsSchema = z4.tuple([
|
|
10622
10674
|
themeNumberValueSchema,
|
|
10623
10675
|
themeNumberValueSchema,
|
|
10624
10676
|
themeNumberValueSchema,
|
|
10625
10677
|
themeNumberValueSchema
|
|
10626
10678
|
]);
|
|
10627
|
-
var themeNumberInsetsValueSchema =
|
|
10628
|
-
var numberInsetsValueSchema =
|
|
10679
|
+
var themeNumberInsetsValueSchema = z4.union([themeNumberInsetsSchema, fixedNumberInsetsSchema]);
|
|
10680
|
+
var numberInsetsValueSchema = z4.union([
|
|
10629
10681
|
themeNumberInsetsValueSchema,
|
|
10630
10682
|
numberExpressionSchema,
|
|
10631
10683
|
zoomValueSchemaFor(themeNumberInsetsValueSchema)
|
|
10632
10684
|
]);
|
|
10633
|
-
var lineCapSchema =
|
|
10634
|
-
var lineCapValueSchema =
|
|
10685
|
+
var lineCapSchema = z4.enum(["butt", "round", "square"]);
|
|
10686
|
+
var lineCapValueSchema = z4.union([
|
|
10635
10687
|
lineCapSchema,
|
|
10636
10688
|
structuralExpressionSchema,
|
|
10637
10689
|
zoomValueSchemaFor(lineCapSchema)
|
|
10638
10690
|
]);
|
|
10639
|
-
var lineJoinSchema =
|
|
10640
|
-
var lineJoinValueSchema =
|
|
10691
|
+
var lineJoinSchema = z4.enum(["bevel", "miter", "round"]);
|
|
10692
|
+
var lineJoinValueSchema = z4.union([
|
|
10641
10693
|
lineJoinSchema,
|
|
10642
10694
|
structuralExpressionSchema,
|
|
10643
10695
|
zoomValueSchemaFor(lineJoinSchema)
|
|
10644
10696
|
]);
|
|
10645
|
-
var exactFontFaceSchema =
|
|
10697
|
+
var exactFontFaceSchema = z4.string().min(1).max(100).refine(
|
|
10646
10698
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\]/u.test(value),
|
|
10647
10699
|
"Expected an exact NFC font face name without surrounding whitespace, controls, or backslashes"
|
|
10648
10700
|
);
|
|
10649
|
-
var fontFallbacksSchema =
|
|
10701
|
+
var fontFallbacksSchema = z4.array(exactFontFaceSchema).max(8).superRefine((fallbacks, context) => {
|
|
10650
10702
|
const seen = /* @__PURE__ */ new Set();
|
|
10651
10703
|
for (const [index, fallback] of fallbacks.entries()) {
|
|
10652
10704
|
if (seen.has(fallback)) {
|
|
@@ -10659,16 +10711,16 @@ var fontFallbacksSchema = z3.array(exactFontFaceSchema).max(8).superRefine((fall
|
|
|
10659
10711
|
seen.add(fallback);
|
|
10660
10712
|
}
|
|
10661
10713
|
});
|
|
10662
|
-
var moduleFontValueSchema =
|
|
10714
|
+
var moduleFontValueSchema = z4.union([
|
|
10663
10715
|
exactFontFaceSchema,
|
|
10664
10716
|
fixedStringSchema,
|
|
10665
|
-
themeTokenReferenceSchema.extend({ category:
|
|
10717
|
+
themeTokenReferenceSchema.extend({ category: z4.literal("font") })
|
|
10666
10718
|
]);
|
|
10667
|
-
var moduleFontFallbacksSchema =
|
|
10668
|
-
var hexColorSchema =
|
|
10719
|
+
var moduleFontFallbacksSchema = z4.array(moduleFontValueSchema).max(8);
|
|
10720
|
+
var hexColorSchema = z4.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, {
|
|
10669
10721
|
message: "Expected a hex color like #F6F7F3 or #F6F7F3FF"
|
|
10670
10722
|
});
|
|
10671
|
-
var rgbColorSchema =
|
|
10723
|
+
var rgbColorSchema = z4.string().refine((value) => {
|
|
10672
10724
|
const match2 = value.match(
|
|
10673
10725
|
/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d+(?:\.\d+)?))?\s*\)$/iu
|
|
10674
10726
|
);
|
|
@@ -10677,21 +10729,21 @@ var rgbColorSchema = z3.string().refine((value) => {
|
|
|
10677
10729
|
const alpha2 = Number(match2[4] ?? 1);
|
|
10678
10730
|
return channels.every((channel) => channel >= 0 && channel <= 255) && alpha2 >= 0 && alpha2 <= 1;
|
|
10679
10731
|
}, "Expected a Tileflow hex, rgb(), or rgba() color");
|
|
10680
|
-
var terrainColorLiteralSchema =
|
|
10681
|
-
var terrainColorValueSchema =
|
|
10732
|
+
var terrainColorLiteralSchema = z4.union([hexColorSchema, rgbColorSchema]);
|
|
10733
|
+
var terrainColorValueSchema = z4.union([
|
|
10682
10734
|
terrainColorLiteralSchema,
|
|
10683
10735
|
fixedStringSchema.extend({ value: terrainColorLiteralSchema }),
|
|
10684
|
-
themeTokenReferenceSchema.extend({ category:
|
|
10736
|
+
themeTokenReferenceSchema.extend({ category: z4.literal("color") }),
|
|
10685
10737
|
themeColorOperationSchema
|
|
10686
10738
|
]);
|
|
10687
10739
|
function terrainNumberValueSchema(schema) {
|
|
10688
|
-
return
|
|
10740
|
+
return z4.union([schema, fixedNumberSchema.extend({ value: schema }), themeNumberReferenceSchema]);
|
|
10689
10741
|
}
|
|
10690
|
-
var themeTypographyStyleSchema =
|
|
10691
|
-
fallbacks:
|
|
10742
|
+
var themeTypographyStyleSchema = z4.object({
|
|
10743
|
+
fallbacks: z4.array(themeFontValueSchema).max(8).optional(),
|
|
10692
10744
|
font: themeFontValueSchema.optional(),
|
|
10693
10745
|
letterSpacing: themeNumberValueSchema.optional(),
|
|
10694
|
-
transform:
|
|
10746
|
+
transform: z4.enum(["lowercase", "none", "uppercase"]).optional()
|
|
10695
10747
|
}).strict();
|
|
10696
10748
|
var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
10697
10749
|
places: themeTypographyStyleSchema.optional(),
|
|
@@ -10699,46 +10751,46 @@ var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
|
10699
10751
|
roads: themeTypographyStyleSchema.optional(),
|
|
10700
10752
|
water: themeTypographyStyleSchema.optional()
|
|
10701
10753
|
});
|
|
10702
|
-
var themeLightingSchema =
|
|
10703
|
-
anchor:
|
|
10754
|
+
var themeLightingSchema = z4.object({
|
|
10755
|
+
anchor: z4.enum(["map", "viewport"]).optional(),
|
|
10704
10756
|
color: themeColorValueSchema.optional(),
|
|
10705
10757
|
intensity: themeNumberValueSchema.optional(),
|
|
10706
|
-
position:
|
|
10758
|
+
position: z4.tuple([themeNumberValueSchema, themeNumberValueSchema, themeNumberValueSchema]).optional()
|
|
10707
10759
|
}).strict();
|
|
10708
|
-
var tileflowThemeSchema =
|
|
10709
|
-
colorScheme:
|
|
10760
|
+
var tileflowThemeSchema = z4.object({
|
|
10761
|
+
colorScheme: z4.enum(["light", "dark"]),
|
|
10710
10762
|
id: tileflowThemeNameSchema,
|
|
10711
10763
|
lighting: themeLightingSchema,
|
|
10712
|
-
tokens:
|
|
10713
|
-
color:
|
|
10714
|
-
font:
|
|
10715
|
-
image:
|
|
10716
|
-
number:
|
|
10764
|
+
tokens: z4.object({
|
|
10765
|
+
color: z4.record(themeTokenNameSchema, themeColorValueSchema),
|
|
10766
|
+
font: z4.record(themeTokenNameSchema, themeFontValueSchema),
|
|
10767
|
+
image: z4.record(themeTokenNameSchema, themeImageValueSchema),
|
|
10768
|
+
number: z4.record(themeTokenNameSchema, themeNumberValueSchema)
|
|
10717
10769
|
}).strict(),
|
|
10718
10770
|
typography: themeTypographySchema,
|
|
10719
|
-
version:
|
|
10771
|
+
version: z4.number().int().positive()
|
|
10720
10772
|
}).strict();
|
|
10721
10773
|
var rangeShape = {
|
|
10722
10774
|
maxZoom: zoomNumberSchema.optional(),
|
|
10723
10775
|
minZoom: zoomNumberSchema.optional(),
|
|
10724
|
-
visible:
|
|
10776
|
+
visible: z4.boolean().optional()
|
|
10725
10777
|
};
|
|
10726
|
-
var backgroundStyleSchema =
|
|
10778
|
+
var backgroundStyleSchema = z4.object({
|
|
10727
10779
|
...rangeShape,
|
|
10728
10780
|
color: colorValueSchema.optional(),
|
|
10729
10781
|
opacity: numberValueSchema.optional(),
|
|
10730
10782
|
pattern: imageValueSchema.optional()
|
|
10731
10783
|
}).strict();
|
|
10732
|
-
var fillStyleSchema =
|
|
10784
|
+
var fillStyleSchema = z4.object({
|
|
10733
10785
|
...rangeShape,
|
|
10734
|
-
antialias:
|
|
10786
|
+
antialias: z4.boolean().optional(),
|
|
10735
10787
|
color: colorValueSchema.optional(),
|
|
10736
10788
|
opacity: numberValueSchema.optional(),
|
|
10737
10789
|
pattern: imageValueSchema.optional(),
|
|
10738
10790
|
translate: numberOffsetValueSchema.optional(),
|
|
10739
|
-
translateAnchor:
|
|
10791
|
+
translateAnchor: z4.enum(["map", "viewport"]).optional()
|
|
10740
10792
|
}).strict();
|
|
10741
|
-
var lineStyleSchema =
|
|
10793
|
+
var lineStyleSchema = z4.object({
|
|
10742
10794
|
...rangeShape,
|
|
10743
10795
|
blur: numberValueSchema.optional(),
|
|
10744
10796
|
cap: lineCapValueSchema.optional(),
|
|
@@ -10752,13 +10804,13 @@ var lineStyleSchema = z3.object({
|
|
|
10752
10804
|
pattern: imageValueSchema.optional(),
|
|
10753
10805
|
roundLimit: numberValueSchema.optional(),
|
|
10754
10806
|
translate: numberOffsetValueSchema.optional(),
|
|
10755
|
-
translateAnchor:
|
|
10807
|
+
translateAnchor: z4.enum(["map", "viewport"]).optional(),
|
|
10756
10808
|
width: numberValueSchema.optional()
|
|
10757
10809
|
}).strict();
|
|
10758
|
-
var textStyleSchema =
|
|
10810
|
+
var textStyleSchema = z4.object({
|
|
10759
10811
|
...rangeShape,
|
|
10760
|
-
allowOverlap:
|
|
10761
|
-
anchor:
|
|
10812
|
+
allowOverlap: z4.boolean().optional(),
|
|
10813
|
+
anchor: z4.enum([
|
|
10762
10814
|
"bottom",
|
|
10763
10815
|
"bottom-left",
|
|
10764
10816
|
"bottom-right",
|
|
@@ -10776,25 +10828,25 @@ var textStyleSchema = z3.object({
|
|
|
10776
10828
|
haloBlur: numberValueSchema.optional(),
|
|
10777
10829
|
haloColor: colorValueSchema.optional(),
|
|
10778
10830
|
haloWidth: numberValueSchema.optional(),
|
|
10779
|
-
ignorePlacement:
|
|
10780
|
-
justify:
|
|
10781
|
-
keepUpright:
|
|
10831
|
+
ignorePlacement: z4.boolean().optional(),
|
|
10832
|
+
justify: z4.enum(["auto", "center", "left", "right"]).optional(),
|
|
10833
|
+
keepUpright: z4.boolean().optional(),
|
|
10782
10834
|
letterSpacing: numberValueSchema.optional(),
|
|
10783
10835
|
lineHeight: numberValueSchema.optional(),
|
|
10784
10836
|
maxAngle: numberValueSchema.optional(),
|
|
10785
10837
|
maxWidth: numberValueSchema.optional(),
|
|
10786
10838
|
offset: numberOffsetValueSchema.optional(),
|
|
10787
|
-
optional:
|
|
10839
|
+
optional: z4.boolean().optional(),
|
|
10788
10840
|
opacity: numberValueSchema.optional(),
|
|
10789
10841
|
padding: numberValueSchema.optional(),
|
|
10790
|
-
pitchAlignment:
|
|
10842
|
+
pitchAlignment: z4.enum(["auto", "map", "viewport"]).optional(),
|
|
10791
10843
|
radialOffset: numberValueSchema.optional(),
|
|
10792
10844
|
rotate: numberValueSchema.optional(),
|
|
10793
|
-
rotationAlignment:
|
|
10845
|
+
rotationAlignment: z4.enum(["auto", "map", "viewport"]).optional(),
|
|
10794
10846
|
size: numberValueSchema.optional(),
|
|
10795
|
-
transform:
|
|
10796
|
-
variableAnchors:
|
|
10797
|
-
|
|
10847
|
+
transform: z4.enum(["lowercase", "none", "uppercase"]).optional(),
|
|
10848
|
+
variableAnchors: z4.array(
|
|
10849
|
+
z4.enum([
|
|
10798
10850
|
"bottom",
|
|
10799
10851
|
"bottom-left",
|
|
10800
10852
|
"bottom-right",
|
|
@@ -10807,10 +10859,10 @@ var textStyleSchema = z3.object({
|
|
|
10807
10859
|
])
|
|
10808
10860
|
).min(1).optional()
|
|
10809
10861
|
}).strict();
|
|
10810
|
-
var iconStyleSchema =
|
|
10862
|
+
var iconStyleSchema = z4.object({
|
|
10811
10863
|
...rangeShape,
|
|
10812
|
-
allowOverlap:
|
|
10813
|
-
anchor:
|
|
10864
|
+
allowOverlap: z4.boolean().optional(),
|
|
10865
|
+
anchor: z4.enum([
|
|
10814
10866
|
"bottom",
|
|
10815
10867
|
"bottom-left",
|
|
10816
10868
|
"bottom-right",
|
|
@@ -10825,60 +10877,60 @@ var iconStyleSchema = z3.object({
|
|
|
10825
10877
|
haloBlur: numberValueSchema.optional(),
|
|
10826
10878
|
haloColor: colorValueSchema.optional(),
|
|
10827
10879
|
haloWidth: numberValueSchema.optional(),
|
|
10828
|
-
ignorePlacement:
|
|
10880
|
+
ignorePlacement: z4.boolean().optional(),
|
|
10829
10881
|
image: imageValueSchema.optional(),
|
|
10830
10882
|
offset: numberOffsetValueSchema.optional(),
|
|
10831
10883
|
opacity: numberValueSchema.optional(),
|
|
10832
|
-
keepUpright:
|
|
10833
|
-
optional:
|
|
10884
|
+
keepUpright: z4.boolean().optional(),
|
|
10885
|
+
optional: z4.boolean().optional(),
|
|
10834
10886
|
padding: numberValueSchema.optional(),
|
|
10835
|
-
pitchAlignment:
|
|
10887
|
+
pitchAlignment: z4.enum(["auto", "map", "viewport"]).optional(),
|
|
10836
10888
|
rotate: numberValueSchema.optional(),
|
|
10837
|
-
rotationAlignment:
|
|
10889
|
+
rotationAlignment: z4.enum(["auto", "map", "viewport"]).optional(),
|
|
10838
10890
|
size: numberValueSchema.optional(),
|
|
10839
|
-
textFit:
|
|
10891
|
+
textFit: z4.enum(["both", "height", "none", "width"]).optional(),
|
|
10840
10892
|
textFitPadding: numberInsetsValueSchema.optional()
|
|
10841
10893
|
}).strict();
|
|
10842
10894
|
var symbolPlacementShape = {
|
|
10843
10895
|
...rangeShape,
|
|
10844
|
-
placement:
|
|
10896
|
+
placement: z4.enum(["line", "line-center", "point"]).optional(),
|
|
10845
10897
|
priority: structuralNumberValueSchema.optional(),
|
|
10846
|
-
priorityOrder:
|
|
10898
|
+
priorityOrder: z4.enum(["higher-first", "lower-first"]).optional(),
|
|
10847
10899
|
spacing: numberValueSchema.optional(),
|
|
10848
|
-
zOrder:
|
|
10900
|
+
zOrder: z4.enum(["auto", "source", "viewport-y"]).optional()
|
|
10849
10901
|
};
|
|
10850
|
-
var circleStyleSchema =
|
|
10902
|
+
var circleStyleSchema = z4.object({
|
|
10851
10903
|
...rangeShape,
|
|
10852
10904
|
blur: numberValueSchema.optional(),
|
|
10853
10905
|
color: colorValueSchema.optional(),
|
|
10854
10906
|
opacity: numberValueSchema.optional(),
|
|
10855
|
-
pitchAlignment:
|
|
10856
|
-
pitchScale:
|
|
10907
|
+
pitchAlignment: z4.enum(["map", "viewport"]).optional(),
|
|
10908
|
+
pitchScale: z4.enum(["map", "viewport"]).optional(),
|
|
10857
10909
|
priority: structuralNumberValueSchema.optional(),
|
|
10858
|
-
priorityOrder:
|
|
10910
|
+
priorityOrder: z4.enum(["higher-first", "lower-first"]).optional(),
|
|
10859
10911
|
radius: numberValueSchema.optional(),
|
|
10860
10912
|
strokeColor: colorValueSchema.optional(),
|
|
10861
10913
|
strokeOpacity: numberValueSchema.optional(),
|
|
10862
10914
|
strokeWidth: numberValueSchema.optional(),
|
|
10863
10915
|
translate: numberOffsetValueSchema.optional(),
|
|
10864
|
-
translateAnchor:
|
|
10916
|
+
translateAnchor: z4.enum(["map", "viewport"]).optional()
|
|
10865
10917
|
}).strict();
|
|
10866
|
-
var extrusionStyleSchema =
|
|
10918
|
+
var extrusionStyleSchema = z4.object({
|
|
10867
10919
|
...rangeShape,
|
|
10868
10920
|
base: numberValueSchema.optional(),
|
|
10869
10921
|
color: colorValueSchema.optional(),
|
|
10870
10922
|
height: numberValueSchema.optional(),
|
|
10871
10923
|
opacity: numberValueSchema.optional(),
|
|
10872
10924
|
pattern: imageValueSchema.optional(),
|
|
10873
|
-
verticalGradient:
|
|
10925
|
+
verticalGradient: z4.boolean().optional()
|
|
10874
10926
|
}).strict();
|
|
10875
|
-
var areaStyleSchema =
|
|
10876
|
-
var lineStackStyleSchema =
|
|
10927
|
+
var areaStyleSchema = z4.object({ fill: fillStyleSchema.optional(), outline: lineStyleSchema.optional() }).strict();
|
|
10928
|
+
var lineStackStyleSchema = z4.object({
|
|
10877
10929
|
casing: lineStyleSchema.optional(),
|
|
10878
10930
|
fill: lineStyleSchema.optional(),
|
|
10879
10931
|
shadow: lineStyleSchema.optional()
|
|
10880
10932
|
}).strict();
|
|
10881
|
-
var lineHatchStyleSchema =
|
|
10933
|
+
var lineHatchStyleSchema = z4.object({
|
|
10882
10934
|
...rangeShape,
|
|
10883
10935
|
angle: numberValueSchema.optional(),
|
|
10884
10936
|
color: colorValueSchema.optional(),
|
|
@@ -10927,62 +10979,62 @@ var lineHatchStyleSchema = z3.object({
|
|
|
10927
10979
|
}
|
|
10928
10980
|
});
|
|
10929
10981
|
var roadLayerStyleSchema = lineStackStyleSchema.extend({ hatch: lineHatchStyleSchema.optional() }).strict();
|
|
10930
|
-
var symbolStyleSchema =
|
|
10982
|
+
var symbolStyleSchema = z4.object({
|
|
10931
10983
|
...symbolPlacementShape,
|
|
10932
10984
|
icon: iconStyleSchema.optional(),
|
|
10933
10985
|
text: textStyleSchema.optional()
|
|
10934
10986
|
}).strict();
|
|
10935
10987
|
var markerSymbolStyleSchema = symbolStyleSchema.extend({ marker: circleStyleSchema.optional() }).strict();
|
|
10936
10988
|
var poiCategoryStyleSchema = markerSymbolStyleSchema.omit({ priority: true, priorityOrder: true }).extend({
|
|
10937
|
-
density:
|
|
10989
|
+
density: z4.union([z4.literal(1), z4.literal(2), z4.literal(3), z4.literal(4), z4.literal(5)]).optional()
|
|
10938
10990
|
}).strict();
|
|
10939
|
-
var renderScalarSchema =
|
|
10940
|
-
var renderTargetSchema =
|
|
10941
|
-
var renderStackOperationNameSchema =
|
|
10991
|
+
var renderScalarSchema = z4.union([z4.boolean(), z4.number().finite(), z4.string()]);
|
|
10992
|
+
var renderTargetSchema = z4.string().regex(tileflowSemanticTargetPattern, "Expected a semantic target");
|
|
10993
|
+
var renderStackOperationNameSchema = z4.string().regex(
|
|
10942
10994
|
tileflowRenderStackOperationNamePattern,
|
|
10943
10995
|
"Expected a lowercase-initial portable render-stack operation name without dots"
|
|
10944
10996
|
);
|
|
10945
10997
|
var renderFieldNormalizationShape = {
|
|
10946
|
-
coerce:
|
|
10998
|
+
coerce: z4.literal("number").optional(),
|
|
10947
10999
|
fallback: renderScalarSchema.optional(),
|
|
10948
|
-
field:
|
|
11000
|
+
field: z4.enum(tileflowSemanticFieldNames)
|
|
10949
11001
|
};
|
|
10950
|
-
var renderSelectorNodeSchema =
|
|
10951
|
-
() =>
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
11002
|
+
var renderSelectorNodeSchema = z4.lazy(
|
|
11003
|
+
() => z4.discriminatedUnion("kind", [
|
|
11004
|
+
z4.object({ kind: z4.literal("literal"), value: z4.boolean() }).strict(),
|
|
11005
|
+
z4.object({ kind: z4.literal("geometry"), geometry: z4.enum(tileflowRenderSelectorGeometries) }).strict(),
|
|
11006
|
+
z4.object({ kind: z4.literal("has"), field: z4.enum(tileflowSemanticFieldNames) }).strict(),
|
|
11007
|
+
z4.object({
|
|
10956
11008
|
...renderFieldNormalizationShape,
|
|
10957
|
-
kind:
|
|
10958
|
-
operator:
|
|
11009
|
+
kind: z4.literal("compare"),
|
|
11010
|
+
operator: z4.enum(tileflowRenderSelectorComparisons),
|
|
10959
11011
|
value: renderScalarSchema
|
|
10960
11012
|
}).strict(),
|
|
10961
|
-
|
|
11013
|
+
z4.object({
|
|
10962
11014
|
...renderFieldNormalizationShape,
|
|
10963
|
-
kind:
|
|
10964
|
-
values:
|
|
11015
|
+
kind: z4.literal("in"),
|
|
11016
|
+
values: z4.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
10965
11017
|
}).strict(),
|
|
10966
|
-
|
|
11018
|
+
z4.object({
|
|
10967
11019
|
...renderFieldNormalizationShape,
|
|
10968
|
-
branches:
|
|
10969
|
-
|
|
10970
|
-
result:
|
|
10971
|
-
values:
|
|
11020
|
+
branches: z4.array(
|
|
11021
|
+
z4.object({
|
|
11022
|
+
result: z4.boolean(),
|
|
11023
|
+
values: z4.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
10972
11024
|
}).strict()
|
|
10973
11025
|
).min(1).max(tileflowRenderStackLimits.maxMatchBranches),
|
|
10974
|
-
kind:
|
|
10975
|
-
otherwise:
|
|
11026
|
+
kind: z4.literal("match"),
|
|
11027
|
+
otherwise: z4.boolean()
|
|
10976
11028
|
}).strict(),
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
kind:
|
|
10980
|
-
selectors:
|
|
11029
|
+
z4.object({ kind: z4.literal("not"), selector: renderSelectorNodeSchema }).strict(),
|
|
11030
|
+
z4.object({
|
|
11031
|
+
kind: z4.enum(["all", "any"]),
|
|
11032
|
+
selectors: z4.array(renderSelectorNodeSchema).min(1).max(tileflowRenderStackLimits.maxSelectorChildren)
|
|
10981
11033
|
}).strict(),
|
|
10982
|
-
|
|
11034
|
+
z4.object({
|
|
10983
11035
|
fallback: renderSelectorNodeSchema,
|
|
10984
|
-
kind:
|
|
10985
|
-
stops:
|
|
11036
|
+
kind: z4.literal("step"),
|
|
11037
|
+
stops: z4.array(z4.object({ selector: renderSelectorNodeSchema, zoom: zoomNumberSchema }).strict()).min(1).max(tileflowRenderStackLimits.maxStepStops)
|
|
10986
11038
|
}).strict()
|
|
10987
11039
|
])
|
|
10988
11040
|
);
|
|
@@ -10993,7 +11045,7 @@ var renderSelectorSchema = renderSelectorNodeSchema.superRefine(
|
|
|
10993
11045
|
}
|
|
10994
11046
|
}
|
|
10995
11047
|
);
|
|
10996
|
-
var renderVisibilitySchema =
|
|
11048
|
+
var renderVisibilitySchema = z4.object({ visibilityGroup: z4.literal("building").optional() });
|
|
10997
11049
|
var renderStyleSchemas = {
|
|
10998
11050
|
background: backgroundStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
10999
11051
|
circle: circleStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
@@ -11002,7 +11054,7 @@ var renderStyleSchemas = {
|
|
|
11002
11054
|
line: lineStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
11003
11055
|
symbol: symbolStyleSchema.extend(renderVisibilitySchema.shape).strict()
|
|
11004
11056
|
};
|
|
11005
|
-
var renderRequirementsSchema =
|
|
11057
|
+
var renderRequirementsSchema = z4.array(z4.enum(tileflowLayerDomains)).min(1).max(tileflowRenderStackLimits.maxRequirements).superRefine((requirements, context) => {
|
|
11006
11058
|
const seen = /* @__PURE__ */ new Set();
|
|
11007
11059
|
for (const [index, requirement] of requirements.entries()) {
|
|
11008
11060
|
if (seen.has(requirement)) {
|
|
@@ -11016,40 +11068,40 @@ var renderRequirementsSchema = z3.array(z3.enum(tileflowLayerDomains)).min(1).ma
|
|
|
11016
11068
|
}
|
|
11017
11069
|
});
|
|
11018
11070
|
var vectorRenderPassSchemas = tileflowRenderStackRenderers.filter((renderer) => renderer !== "background").map(
|
|
11019
|
-
(renderer) =>
|
|
11071
|
+
(renderer) => z4.object({
|
|
11020
11072
|
attachTo: renderTargetSchema,
|
|
11021
|
-
feature:
|
|
11022
|
-
kind:
|
|
11023
|
-
phase:
|
|
11024
|
-
renderer:
|
|
11073
|
+
feature: z4.enum(tileflowSemanticLayerNames).optional(),
|
|
11074
|
+
kind: z4.literal("render-pass"),
|
|
11075
|
+
phase: z4.enum(tileflowRenderStackPhases),
|
|
11076
|
+
renderer: z4.literal(renderer),
|
|
11025
11077
|
requirements: renderRequirementsSchema.optional(),
|
|
11026
11078
|
selector: renderSelectorSchema.optional(),
|
|
11027
11079
|
style: renderStyleSchemas[renderer]
|
|
11028
11080
|
}).strict()
|
|
11029
11081
|
);
|
|
11030
|
-
var renderPassSchema =
|
|
11031
|
-
|
|
11082
|
+
var renderPassSchema = z4.discriminatedUnion("renderer", [
|
|
11083
|
+
z4.object({
|
|
11032
11084
|
attachTo: renderTargetSchema,
|
|
11033
|
-
kind:
|
|
11034
|
-
phase:
|
|
11035
|
-
renderer:
|
|
11085
|
+
kind: z4.literal("render-pass"),
|
|
11086
|
+
phase: z4.enum(tileflowRenderStackPhases),
|
|
11087
|
+
renderer: z4.literal("background"),
|
|
11036
11088
|
requirements: renderRequirementsSchema.optional(),
|
|
11037
11089
|
style: renderStyleSchemas.background
|
|
11038
11090
|
}).strict(),
|
|
11039
11091
|
...vectorRenderPassSchemas
|
|
11040
11092
|
]);
|
|
11041
11093
|
var renderRefinementSchemas = tileflowRenderStackRenderers.map(
|
|
11042
|
-
(renderer) =>
|
|
11043
|
-
kind:
|
|
11094
|
+
(renderer) => z4.object({
|
|
11095
|
+
kind: z4.literal("refine-render-target"),
|
|
11044
11096
|
requirements: renderRequirementsSchema.optional(),
|
|
11045
|
-
renderer:
|
|
11097
|
+
renderer: z4.literal(renderer),
|
|
11046
11098
|
...renderer === "background" ? {} : { selector: renderSelectorSchema.optional() },
|
|
11047
11099
|
style: renderStyleSchemas[renderer],
|
|
11048
11100
|
target: renderTargetSchema
|
|
11049
11101
|
}).strict()
|
|
11050
11102
|
);
|
|
11051
|
-
var renderStackOperationSchema =
|
|
11052
|
-
var renderStackSchema =
|
|
11103
|
+
var renderStackOperationSchema = z4.union([renderPassSchema, ...renderRefinementSchemas]);
|
|
11104
|
+
var renderStackSchema = z4.record(renderStackOperationNameSchema, renderStackOperationSchema).superRefine((stack, context) => {
|
|
11053
11105
|
const size = Object.keys(stack).length;
|
|
11054
11106
|
if (size === 0) {
|
|
11055
11107
|
context.addIssue({
|
|
@@ -11064,19 +11116,19 @@ var renderStackSchema = z3.record(renderStackOperationNameSchema, renderStackOpe
|
|
|
11064
11116
|
});
|
|
11065
11117
|
}
|
|
11066
11118
|
}).describe("tileflow-render-stack");
|
|
11067
|
-
var roadClassSchema =
|
|
11068
|
-
var roadClassStyleSchema =
|
|
11069
|
-
enabled:
|
|
11119
|
+
var roadClassSchema = z4.enum(tileflowRoadClasses);
|
|
11120
|
+
var roadClassStyleSchema = z4.object({
|
|
11121
|
+
enabled: z4.boolean().optional(),
|
|
11070
11122
|
bridge: roadLayerStyleSchema.optional(),
|
|
11071
11123
|
surface: roadLayerStyleSchema.optional(),
|
|
11072
11124
|
tunnel: roadLayerStyleSchema.optional()
|
|
11073
11125
|
}).strict();
|
|
11074
|
-
var roadStructureMapSchema =
|
|
11126
|
+
var roadStructureMapSchema = z4.object({
|
|
11075
11127
|
bridge: roadLayerStyleSchema.optional(),
|
|
11076
11128
|
surface: roadLayerStyleSchema.optional(),
|
|
11077
11129
|
tunnel: roadLayerStyleSchema.optional()
|
|
11078
11130
|
}).strict();
|
|
11079
|
-
var roadTreatmentLayerStyleSchema =
|
|
11131
|
+
var roadTreatmentLayerStyleSchema = z4.object({
|
|
11080
11132
|
casing: lineStyleSchema.pick({
|
|
11081
11133
|
blur: true,
|
|
11082
11134
|
color: true,
|
|
@@ -11105,19 +11157,19 @@ var roadTreatmentLayerStyleSchema = z3.object({
|
|
|
11105
11157
|
width: true
|
|
11106
11158
|
}).optional()
|
|
11107
11159
|
}).strict();
|
|
11108
|
-
var roadTreatmentStyleSchema =
|
|
11160
|
+
var roadTreatmentStyleSchema = z4.object({
|
|
11109
11161
|
bridge: roadTreatmentLayerStyleSchema.optional(),
|
|
11110
|
-
enabled:
|
|
11162
|
+
enabled: z4.boolean().optional(),
|
|
11111
11163
|
surface: roadTreatmentLayerStyleSchema.optional(),
|
|
11112
11164
|
tunnel: roadTreatmentLayerStyleSchema.optional(),
|
|
11113
11165
|
widthScale: themeNumberValueSchema.optional()
|
|
11114
11166
|
}).strict();
|
|
11115
|
-
var landModuleSchema =
|
|
11116
|
-
type:
|
|
11167
|
+
var landModuleSchema = z4.object({
|
|
11168
|
+
type: z4.literal("land"),
|
|
11117
11169
|
background: backgroundStyleSchema.optional(),
|
|
11118
|
-
enabled:
|
|
11170
|
+
enabled: z4.boolean().optional(),
|
|
11119
11171
|
globalLandcover: fillStyleSchema.optional(),
|
|
11120
|
-
landcover:
|
|
11172
|
+
landcover: z4.object({
|
|
11121
11173
|
farmland: areaStyleSchema.optional(),
|
|
11122
11174
|
flowerbed: areaStyleSchema.optional(),
|
|
11123
11175
|
grass: areaStyleSchema.optional(),
|
|
@@ -11133,7 +11185,7 @@ var landModuleSchema = z3.object({
|
|
|
11133
11185
|
wetland: areaStyleSchema.optional(),
|
|
11134
11186
|
wood: areaStyleSchema.optional()
|
|
11135
11187
|
}).strict().optional(),
|
|
11136
|
-
landuse:
|
|
11188
|
+
landuse: z4.object({
|
|
11137
11189
|
cemetery: areaStyleSchema.optional(),
|
|
11138
11190
|
civic: areaStyleSchema.optional(),
|
|
11139
11191
|
commercial: areaStyleSchema.optional(),
|
|
@@ -11149,99 +11201,99 @@ var landModuleSchema = z3.object({
|
|
|
11149
11201
|
}).strict().optional(),
|
|
11150
11202
|
renderStack: renderStackSchema.optional()
|
|
11151
11203
|
}).strict();
|
|
11152
|
-
var waterModuleSchema =
|
|
11153
|
-
type:
|
|
11204
|
+
var waterModuleSchema = z4.object({
|
|
11205
|
+
type: z4.literal("water"),
|
|
11154
11206
|
bathymetry: fillStyleSchema.optional(),
|
|
11155
11207
|
bathymetryContours: lineStyleSchema.optional(),
|
|
11156
11208
|
bathymetryLabels: symbolStyleSchema.optional(),
|
|
11157
11209
|
bodies: areaStyleSchema.optional(),
|
|
11158
|
-
enabled:
|
|
11159
|
-
intermittent:
|
|
11210
|
+
enabled: z4.boolean().optional(),
|
|
11211
|
+
intermittent: z4.object({ bodies: areaStyleSchema.optional(), waterways: lineStyleSchema.optional() }).strict().optional(),
|
|
11160
11212
|
renderStack: renderStackSchema.optional(),
|
|
11161
|
-
waterways:
|
|
11213
|
+
waterways: z4.object({
|
|
11162
11214
|
canal: lineStyleSchema.optional(),
|
|
11163
11215
|
other: lineStyleSchema.optional(),
|
|
11164
11216
|
river: lineStyleSchema.optional(),
|
|
11165
11217
|
stream: lineStyleSchema.optional()
|
|
11166
11218
|
}).strict().optional()
|
|
11167
11219
|
}).strict();
|
|
11168
|
-
var buildingsModuleSchema =
|
|
11169
|
-
type:
|
|
11220
|
+
var buildingsModuleSchema = z4.object({
|
|
11221
|
+
type: z4.literal("buildings"),
|
|
11170
11222
|
businessCorridor: areaStyleSchema.optional(),
|
|
11171
|
-
enabled:
|
|
11223
|
+
enabled: z4.boolean().optional(),
|
|
11172
11224
|
extrusion: extrusionStyleSchema.optional(),
|
|
11173
11225
|
flat: areaStyleSchema.optional(),
|
|
11174
|
-
mode:
|
|
11226
|
+
mode: z4.enum(["3d", "flat"]).optional(),
|
|
11175
11227
|
renderStack: renderStackSchema.optional()
|
|
11176
11228
|
}).strict();
|
|
11177
|
-
var addressesModuleSchema =
|
|
11178
|
-
type:
|
|
11179
|
-
enabled:
|
|
11229
|
+
var addressesModuleSchema = z4.object({
|
|
11230
|
+
type: z4.literal("addresses"),
|
|
11231
|
+
enabled: z4.boolean().optional(),
|
|
11180
11232
|
labels: symbolStyleSchema.optional(),
|
|
11181
11233
|
renderStack: renderStackSchema.optional()
|
|
11182
11234
|
}).strict();
|
|
11183
|
-
var landformClassSchema =
|
|
11184
|
-
var landformsModuleSchema =
|
|
11185
|
-
type:
|
|
11186
|
-
classes:
|
|
11187
|
-
elevation:
|
|
11188
|
-
enabled:
|
|
11235
|
+
var landformClassSchema = z4.enum(tileflowLandformClasses);
|
|
11236
|
+
var landformsModuleSchema = z4.object({
|
|
11237
|
+
type: z4.literal("landforms"),
|
|
11238
|
+
classes: z4.partialRecord(landformClassSchema, symbolStyleSchema).optional(),
|
|
11239
|
+
elevation: z4.boolean().optional(),
|
|
11240
|
+
enabled: z4.boolean().optional(),
|
|
11189
11241
|
renderStack: renderStackSchema.optional()
|
|
11190
11242
|
}).strict();
|
|
11191
|
-
var boundariesModuleSchema =
|
|
11192
|
-
type:
|
|
11243
|
+
var boundariesModuleSchema = z4.object({
|
|
11244
|
+
type: z4.literal("boundaries"),
|
|
11193
11245
|
admin2: lineStyleSchema.optional(),
|
|
11194
11246
|
admin4: lineStyleSchema.optional(),
|
|
11195
11247
|
disputed: lineStyleSchema.optional(),
|
|
11196
|
-
enabled:
|
|
11248
|
+
enabled: z4.boolean().optional(),
|
|
11197
11249
|
maritime: lineStyleSchema.optional(),
|
|
11198
11250
|
renderStack: renderStackSchema.optional()
|
|
11199
11251
|
}).strict();
|
|
11200
|
-
var aerowaysModuleSchema =
|
|
11201
|
-
type:
|
|
11252
|
+
var aerowaysModuleSchema = z4.object({
|
|
11253
|
+
type: z4.literal("aeroways"),
|
|
11202
11254
|
area: areaStyleSchema.optional(),
|
|
11203
|
-
enabled:
|
|
11255
|
+
enabled: z4.boolean().optional(),
|
|
11204
11256
|
runway: lineStackStyleSchema.optional(),
|
|
11205
11257
|
runwayRef: symbolStyleSchema.optional(),
|
|
11206
11258
|
renderStack: renderStackSchema.optional(),
|
|
11207
11259
|
taxiway: lineStackStyleSchema.optional()
|
|
11208
11260
|
}).strict();
|
|
11209
|
-
var transitModuleSchema =
|
|
11210
|
-
type:
|
|
11261
|
+
var transitModuleSchema = z4.object({
|
|
11262
|
+
type: z4.literal("transit"),
|
|
11211
11263
|
cableway: lineStyleSchema.optional(),
|
|
11212
|
-
enabled:
|
|
11264
|
+
enabled: z4.boolean().optional(),
|
|
11213
11265
|
ferry: lineStyleSchema.optional(),
|
|
11214
|
-
rail:
|
|
11266
|
+
rail: z4.object({
|
|
11215
11267
|
bridge: lineStyleSchema.optional(),
|
|
11216
11268
|
surface: lineStyleSchema.optional(),
|
|
11217
11269
|
tunnel: lineStyleSchema.optional()
|
|
11218
11270
|
}).strict().optional(),
|
|
11219
|
-
railHatching:
|
|
11271
|
+
railHatching: z4.object({
|
|
11220
11272
|
bridge: lineStyleSchema.optional(),
|
|
11221
11273
|
surface: lineStyleSchema.optional(),
|
|
11222
11274
|
tunnel: lineStyleSchema.optional()
|
|
11223
11275
|
}).strict().optional(),
|
|
11224
|
-
serviceRail:
|
|
11276
|
+
serviceRail: z4.object({
|
|
11225
11277
|
bridge: lineStyleSchema.optional(),
|
|
11226
11278
|
surface: lineStyleSchema.optional(),
|
|
11227
11279
|
tunnel: lineStyleSchema.optional()
|
|
11228
11280
|
}).strict().optional(),
|
|
11229
11281
|
renderStack: renderStackSchema.optional()
|
|
11230
11282
|
}).strict();
|
|
11231
|
-
var roadsModuleSchema =
|
|
11232
|
-
type:
|
|
11233
|
-
areas:
|
|
11283
|
+
var roadsModuleSchema = z4.object({
|
|
11284
|
+
type: z4.literal("roads"),
|
|
11285
|
+
areas: z4.object({
|
|
11234
11286
|
pedestrian: areaStyleSchema.optional(),
|
|
11235
11287
|
pier: areaStyleSchema.optional(),
|
|
11236
11288
|
road: areaStyleSchema.optional()
|
|
11237
11289
|
}).strict().optional(),
|
|
11238
|
-
classes:
|
|
11290
|
+
classes: z4.partialRecord(roadClassSchema, roadClassStyleSchema).optional(),
|
|
11239
11291
|
crossings: iconStyleSchema.extend({ image: imageValueSchema }).strict().optional(),
|
|
11240
|
-
detail:
|
|
11241
|
-
enabled:
|
|
11242
|
-
extras:
|
|
11243
|
-
hierarchy:
|
|
11244
|
-
modifiers:
|
|
11292
|
+
detail: z4.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
11293
|
+
enabled: z4.boolean().optional(),
|
|
11294
|
+
extras: z4.object({ paths: z4.boolean().optional() }).strict().optional(),
|
|
11295
|
+
hierarchy: z4.enum(["subtle", "clear", "strong"]).optional(),
|
|
11296
|
+
modifiers: z4.object({
|
|
11245
11297
|
construction: roadTreatmentStyleSchema.optional(),
|
|
11246
11298
|
expressway: roadTreatmentStyleSchema.optional(),
|
|
11247
11299
|
indoor: roadTreatmentStyleSchema.optional(),
|
|
@@ -11249,7 +11301,7 @@ var roadsModuleSchema = z3.object({
|
|
|
11249
11301
|
ramp: roadTreatmentStyleSchema.optional(),
|
|
11250
11302
|
unpaved: roadTreatmentStyleSchema.optional()
|
|
11251
11303
|
}).strict().optional(),
|
|
11252
|
-
mountainBike:
|
|
11304
|
+
mountainBike: z4.object({
|
|
11253
11305
|
"0": roadTreatmentStyleSchema.optional(),
|
|
11254
11306
|
"0+": roadTreatmentStyleSchema.optional(),
|
|
11255
11307
|
"1": roadTreatmentStyleSchema.optional(),
|
|
@@ -11262,9 +11314,9 @@ var roadsModuleSchema = z3.object({
|
|
|
11262
11314
|
"5": roadTreatmentStyleSchema.optional(),
|
|
11263
11315
|
"6": roadTreatmentStyleSchema.optional()
|
|
11264
11316
|
}).strict().optional(),
|
|
11265
|
-
oneWayMarkers:
|
|
11266
|
-
outline:
|
|
11267
|
-
restrictions:
|
|
11317
|
+
oneWayMarkers: z4.boolean().optional(),
|
|
11318
|
+
outline: z4.enum(["none", "subtle", "strong"]).optional(),
|
|
11319
|
+
restrictions: z4.object({
|
|
11268
11320
|
access: roadTreatmentStyleSchema.optional(),
|
|
11269
11321
|
bicycle: roadTreatmentStyleSchema.optional(),
|
|
11270
11322
|
foot: roadTreatmentStyleSchema.optional(),
|
|
@@ -11272,24 +11324,24 @@ var roadsModuleSchema = z3.object({
|
|
|
11272
11324
|
toll: roadTreatmentStyleSchema.optional()
|
|
11273
11325
|
}).strict().optional(),
|
|
11274
11326
|
renderStack: renderStackSchema.optional(),
|
|
11275
|
-
roundabouts:
|
|
11276
|
-
serviceTypes:
|
|
11327
|
+
roundabouts: z4.object({ casing: circleStyleSchema.optional(), fill: circleStyleSchema.optional() }).strict().optional(),
|
|
11328
|
+
serviceTypes: z4.object({
|
|
11277
11329
|
alley: roadTreatmentStyleSchema.optional(),
|
|
11278
11330
|
crossover: roadTreatmentStyleSchema.optional(),
|
|
11279
11331
|
driveway: roadTreatmentStyleSchema.optional(),
|
|
11280
11332
|
parkingAisle: roadTreatmentStyleSchema.optional(),
|
|
11281
11333
|
yard: roadTreatmentStyleSchema.optional()
|
|
11282
11334
|
}).strict().optional(),
|
|
11283
|
-
sidewalks:
|
|
11335
|
+
sidewalks: z4.object({
|
|
11284
11336
|
outline: lineStyleSchema.optional(),
|
|
11285
11337
|
pattern: fillStyleSchema.optional(),
|
|
11286
11338
|
surface: fillStyleSchema.optional()
|
|
11287
11339
|
}).strict().optional(),
|
|
11288
11340
|
structures: roadStructureMapSchema.optional(),
|
|
11289
|
-
weight:
|
|
11290
|
-
widthScale:
|
|
11341
|
+
weight: z4.enum(["thin", "regular", "bold"]).optional(),
|
|
11342
|
+
widthScale: z4.partialRecord(roadClassSchema, themeNumberValueSchema).optional()
|
|
11291
11343
|
}).strict();
|
|
11292
|
-
var placeLabelStylesSchema =
|
|
11344
|
+
var placeLabelStylesSchema = z4.object({
|
|
11293
11345
|
city: symbolStyleSchema.optional(),
|
|
11294
11346
|
continent: symbolStyleSchema.optional(),
|
|
11295
11347
|
country: symbolStyleSchema.optional(),
|
|
@@ -11299,65 +11351,65 @@ var placeLabelStylesSchema = z3.object({
|
|
|
11299
11351
|
town: symbolStyleSchema.optional(),
|
|
11300
11352
|
village: symbolStyleSchema.optional()
|
|
11301
11353
|
}).strict();
|
|
11302
|
-
var waterLabelStylesSchema =
|
|
11354
|
+
var waterLabelStylesSchema = z4.object({
|
|
11303
11355
|
line: symbolStyleSchema.optional(),
|
|
11304
11356
|
ocean: symbolStyleSchema.optional(),
|
|
11305
11357
|
other: symbolStyleSchema.optional(),
|
|
11306
11358
|
waterway: symbolStyleSchema.optional()
|
|
11307
11359
|
}).strict();
|
|
11308
|
-
var labelsModuleSchema =
|
|
11309
|
-
type:
|
|
11310
|
-
aerodromeCodes:
|
|
11311
|
-
collisionPriority:
|
|
11312
|
-
enabled:
|
|
11313
|
-
junctions:
|
|
11314
|
-
language:
|
|
11315
|
-
places:
|
|
11316
|
-
roadClasses:
|
|
11360
|
+
var labelsModuleSchema = z4.object({
|
|
11361
|
+
type: z4.literal("labels"),
|
|
11362
|
+
aerodromeCodes: z4.enum(["none", "iata", "all"]).optional(),
|
|
11363
|
+
collisionPriority: z4.enum(["balanced", "navigation"]).optional(),
|
|
11364
|
+
enabled: z4.boolean().optional(),
|
|
11365
|
+
junctions: z4.boolean().optional(),
|
|
11366
|
+
language: z4.string().trim().min(1).optional(),
|
|
11367
|
+
places: z4.enum(["none", "major", "all"]).optional(),
|
|
11368
|
+
roadClasses: z4.array(roadClassSchema).min(1).optional(),
|
|
11317
11369
|
renderStack: renderStackSchema.optional(),
|
|
11318
|
-
roads:
|
|
11319
|
-
styles:
|
|
11370
|
+
roads: z4.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
11371
|
+
styles: z4.object({
|
|
11320
11372
|
aerodrome: symbolStyleSchema.optional(),
|
|
11321
11373
|
junctions: symbolStyleSchema.optional(),
|
|
11322
11374
|
places: placeLabelStylesSchema.optional(),
|
|
11323
|
-
roads:
|
|
11324
|
-
shields:
|
|
11375
|
+
roads: z4.partialRecord(roadClassSchema, symbolStyleSchema).optional(),
|
|
11376
|
+
shields: z4.object({
|
|
11325
11377
|
default: symbolStyleSchema.optional(),
|
|
11326
11378
|
detail: symbolStyleSchema.optional(),
|
|
11327
|
-
kinds:
|
|
11379
|
+
kinds: z4.record(identifierSchema, z4.object({ image: themeImageValueSchema }).strict()).optional(),
|
|
11328
11380
|
overview: symbolStyleSchema.optional(),
|
|
11329
|
-
textColors:
|
|
11381
|
+
textColors: z4.record(identifierSchema, z4.object({ color: themeColorValueSchema }).strict()).optional()
|
|
11330
11382
|
}).strict().optional(),
|
|
11331
11383
|
water: waterLabelStylesSchema.optional()
|
|
11332
11384
|
}).strict().optional(),
|
|
11333
|
-
shields:
|
|
11334
|
-
water:
|
|
11385
|
+
shields: z4.enum(["none", "major", "all"]).optional(),
|
|
11386
|
+
water: z4.enum(["none", "major", "all"]).optional()
|
|
11335
11387
|
}).strict();
|
|
11336
|
-
var poiModuleSchema =
|
|
11337
|
-
type:
|
|
11338
|
-
categories:
|
|
11339
|
-
color:
|
|
11340
|
-
density:
|
|
11341
|
-
enabled:
|
|
11342
|
-
icons:
|
|
11343
|
-
labels:
|
|
11388
|
+
var poiModuleSchema = z4.object({
|
|
11389
|
+
type: z4.literal("poi"),
|
|
11390
|
+
categories: z4.array(z4.enum(tileflowPoiCategories)).optional(),
|
|
11391
|
+
color: z4.enum(["uniform", "category"]).optional(),
|
|
11392
|
+
density: z4.union([z4.literal(1), z4.literal(2), z4.literal(3), z4.literal(4), z4.literal(5)]).optional(),
|
|
11393
|
+
enabled: z4.boolean().optional(),
|
|
11394
|
+
icons: z4.boolean().optional(),
|
|
11395
|
+
labels: z4.boolean().optional(),
|
|
11344
11396
|
minZoom: zoomNumberSchema.optional(),
|
|
11345
|
-
placement:
|
|
11346
|
-
coupleIconAndLabel:
|
|
11347
|
-
iconPadding:
|
|
11348
|
-
textPadding:
|
|
11397
|
+
placement: z4.object({
|
|
11398
|
+
coupleIconAndLabel: z4.boolean().optional(),
|
|
11399
|
+
iconPadding: z4.number().finite().min(0).optional(),
|
|
11400
|
+
textPadding: z4.number().finite().min(0).optional()
|
|
11349
11401
|
}).strict().optional(),
|
|
11350
11402
|
renderStack: renderStackSchema.optional(),
|
|
11351
|
-
styles:
|
|
11403
|
+
styles: z4.partialRecord(z4.enum(tileflowPoiCategories), poiCategoryStyleSchema).optional()
|
|
11352
11404
|
}).strict();
|
|
11353
|
-
var nauticalModuleSchema =
|
|
11354
|
-
type:
|
|
11405
|
+
var nauticalModuleSchema = z4.object({
|
|
11406
|
+
type: z4.literal("nautical"),
|
|
11355
11407
|
aids: markerSymbolStyleSchema.optional(),
|
|
11356
11408
|
coverage: areaStyleSchema.optional(),
|
|
11357
|
-
enabled:
|
|
11409
|
+
enabled: z4.boolean().optional(),
|
|
11358
11410
|
hazardAreas: areaStyleSchema.optional(),
|
|
11359
11411
|
hazards: markerSymbolStyleSchema.optional(),
|
|
11360
|
-
labels:
|
|
11412
|
+
labels: z4.object({
|
|
11361
11413
|
coverage: symbolStyleSchema.optional(),
|
|
11362
11414
|
hazards: symbolStyleSchema.optional(),
|
|
11363
11415
|
navigationAreas: symbolStyleSchema.optional(),
|
|
@@ -11373,7 +11425,7 @@ var nauticalModuleSchema = z3.object({
|
|
|
11373
11425
|
wreckAreas: areaStyleSchema.optional(),
|
|
11374
11426
|
wrecks: markerSymbolStyleSchema.optional()
|
|
11375
11427
|
}).strict();
|
|
11376
|
-
var modulesSchema =
|
|
11428
|
+
var modulesSchema = z4.object({
|
|
11377
11429
|
addresses: addressesModuleSchema.optional(),
|
|
11378
11430
|
aeroways: aerowaysModuleSchema.optional(),
|
|
11379
11431
|
boundaries: boundariesModuleSchema.optional(),
|
|
@@ -11385,152 +11437,152 @@ var modulesSchema = z3.object({
|
|
|
11385
11437
|
poi: poiModuleSchema.optional(),
|
|
11386
11438
|
roads: roadsModuleSchema.optional(),
|
|
11387
11439
|
transit: transitModuleSchema.optional(),
|
|
11388
|
-
vegetation:
|
|
11389
|
-
type:
|
|
11390
|
-
enabled:
|
|
11440
|
+
vegetation: z4.object({
|
|
11441
|
+
type: z4.literal("vegetation"),
|
|
11442
|
+
enabled: z4.boolean().optional(),
|
|
11391
11443
|
flat: circleStyleSchema.optional(),
|
|
11392
11444
|
minZoom: zoomNumberSchema.optional(),
|
|
11393
|
-
mode:
|
|
11445
|
+
mode: z4.enum(["3d", "flat"]).optional(),
|
|
11394
11446
|
renderStack: renderStackSchema.optional(),
|
|
11395
|
-
threeDimensional:
|
|
11447
|
+
threeDimensional: z4.object({
|
|
11396
11448
|
barkColor: themeColorValueSchema.optional(),
|
|
11397
|
-
broadleafColors:
|
|
11398
|
-
coniferColors:
|
|
11399
|
-
crownScale:
|
|
11400
|
-
|
|
11449
|
+
broadleafColors: z4.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
11450
|
+
coniferColors: z4.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
11451
|
+
crownScale: z4.union([
|
|
11452
|
+
z4.number().finite().positive().max(10),
|
|
11401
11453
|
themeNumberReferenceSchema,
|
|
11402
|
-
|
|
11403
|
-
kind:
|
|
11404
|
-
reason:
|
|
11405
|
-
value:
|
|
11454
|
+
z4.object({
|
|
11455
|
+
kind: z4.literal("theme-fixed"),
|
|
11456
|
+
reason: z4.string().trim().min(1),
|
|
11457
|
+
value: z4.number().finite().positive().max(10)
|
|
11406
11458
|
}).strict()
|
|
11407
11459
|
]).optional(),
|
|
11408
|
-
heightScale:
|
|
11409
|
-
|
|
11460
|
+
heightScale: z4.union([
|
|
11461
|
+
z4.number().finite().positive().max(10),
|
|
11410
11462
|
themeNumberReferenceSchema,
|
|
11411
|
-
|
|
11412
|
-
kind:
|
|
11413
|
-
reason:
|
|
11414
|
-
value:
|
|
11463
|
+
z4.object({
|
|
11464
|
+
kind: z4.literal("theme-fixed"),
|
|
11465
|
+
reason: z4.string().trim().min(1),
|
|
11466
|
+
value: z4.number().finite().positive().max(10)
|
|
11415
11467
|
}).strict()
|
|
11416
11468
|
]).optional()
|
|
11417
11469
|
}).strict().optional()
|
|
11418
11470
|
}).strict().optional(),
|
|
11419
11471
|
water: waterModuleSchema.optional()
|
|
11420
11472
|
}).strict();
|
|
11421
|
-
var layerBindingsSchema =
|
|
11422
|
-
aerodromeLabel:
|
|
11423
|
-
aeroway:
|
|
11424
|
-
boundary:
|
|
11425
|
-
building:
|
|
11426
|
-
bathymetry:
|
|
11427
|
-
businessCorridor:
|
|
11428
|
-
circularFeature:
|
|
11429
|
-
globalLandcover:
|
|
11430
|
-
houseNumber:
|
|
11431
|
-
landcover:
|
|
11432
|
-
landuse:
|
|
11433
|
-
mountainPeak:
|
|
11434
|
-
park:
|
|
11435
|
-
place:
|
|
11436
|
-
poi:
|
|
11437
|
-
road:
|
|
11438
|
-
roadName:
|
|
11439
|
-
roadShield:
|
|
11440
|
-
sidewalk:
|
|
11441
|
-
streetFurniture:
|
|
11442
|
-
tree:
|
|
11443
|
-
water:
|
|
11444
|
-
waterName:
|
|
11445
|
-
waterway:
|
|
11473
|
+
var layerBindingsSchema = z4.object({
|
|
11474
|
+
aerodromeLabel: z4.string().trim().min(1),
|
|
11475
|
+
aeroway: z4.string().trim().min(1),
|
|
11476
|
+
boundary: z4.string().trim().min(1),
|
|
11477
|
+
building: z4.string().trim().min(1),
|
|
11478
|
+
bathymetry: z4.string().trim().min(1).optional(),
|
|
11479
|
+
businessCorridor: z4.string().trim().min(1).optional(),
|
|
11480
|
+
circularFeature: z4.string().trim().min(1).optional(),
|
|
11481
|
+
globalLandcover: z4.string().trim().min(1).optional(),
|
|
11482
|
+
houseNumber: z4.string().trim().min(1),
|
|
11483
|
+
landcover: z4.string().trim().min(1),
|
|
11484
|
+
landuse: z4.string().trim().min(1),
|
|
11485
|
+
mountainPeak: z4.string().trim().min(1),
|
|
11486
|
+
park: z4.string().trim().min(1),
|
|
11487
|
+
place: z4.string().trim().min(1),
|
|
11488
|
+
poi: z4.string().trim().min(1),
|
|
11489
|
+
road: z4.string().trim().min(1),
|
|
11490
|
+
roadName: z4.string().trim().min(1),
|
|
11491
|
+
roadShield: z4.string().trim().min(1).optional(),
|
|
11492
|
+
sidewalk: z4.string().trim().min(1).optional(),
|
|
11493
|
+
streetFurniture: z4.string().trim().min(1).optional(),
|
|
11494
|
+
tree: z4.string().trim().min(1).optional(),
|
|
11495
|
+
water: z4.string().trim().min(1),
|
|
11496
|
+
waterName: z4.string().trim().min(1),
|
|
11497
|
+
waterway: z4.string().trim().min(1)
|
|
11446
11498
|
}).strict();
|
|
11447
|
-
var fieldBindingsSchema =
|
|
11448
|
-
access:
|
|
11449
|
-
activityScore:
|
|
11450
|
-
adminLevel:
|
|
11451
|
-
bicycle:
|
|
11452
|
-
bathymetryMinDepth:
|
|
11453
|
-
bathymetrySortKey:
|
|
11454
|
-
brunnel:
|
|
11455
|
-
buildingKind:
|
|
11456
|
-
buildingTone:
|
|
11457
|
-
capital:
|
|
11458
|
-
circularClearanceExtraAtZoom15:
|
|
11459
|
-
circularKind:
|
|
11460
|
-
circularRadiusAtZoom15:
|
|
11461
|
-
circularRadiusMeters:
|
|
11462
|
-
circularInnerRadiusMeters:
|
|
11463
|
-
circularOuterRadiusMeters:
|
|
11464
|
-
class:
|
|
11465
|
-
crossing:
|
|
11466
|
-
classificationConfidence:
|
|
11467
|
-
confidence:
|
|
11468
|
-
circumference:
|
|
11469
|
-
diameterCrown:
|
|
11470
|
-
disputed:
|
|
11471
|
-
direction:
|
|
11472
|
-
elevation:
|
|
11473
|
-
elevationFeet:
|
|
11474
|
-
expressway:
|
|
11475
|
-
foot:
|
|
11476
|
-
height:
|
|
11477
|
-
hasBusiness:
|
|
11478
|
-
hasParts:
|
|
11479
|
-
hide3d:
|
|
11480
|
-
horse:
|
|
11481
|
-
houseNumber:
|
|
11482
|
-
importanceTier:
|
|
11483
|
-
iata:
|
|
11484
|
-
icao:
|
|
11485
|
-
indoor:
|
|
11486
|
-
intermittent:
|
|
11487
|
-
genus:
|
|
11488
|
-
layer:
|
|
11489
|
-
leafCycle:
|
|
11490
|
-
leafType:
|
|
11491
|
-
level:
|
|
11492
|
-
maritime:
|
|
11493
|
-
markings:
|
|
11494
|
-
minHeight:
|
|
11495
|
-
minZoom:
|
|
11496
|
-
mtbScale:
|
|
11497
|
-
name:
|
|
11498
|
-
nameEnglish:
|
|
11499
|
-
nameLatin:
|
|
11500
|
-
network:
|
|
11501
|
-
official:
|
|
11502
|
-
oneway:
|
|
11503
|
-
poiCategory:
|
|
11504
|
-
poiFilterRank:
|
|
11505
|
-
poiIcon:
|
|
11506
|
-
poiSizeRank:
|
|
11507
|
-
poiType:
|
|
11508
|
-
ramp:
|
|
11509
|
-
rank:
|
|
11510
|
-
ref:
|
|
11511
|
-
refLength:
|
|
11512
|
-
renderHeight:
|
|
11513
|
-
renderMinZoom:
|
|
11514
|
-
renderMinHeight:
|
|
11515
|
-
shieldKind:
|
|
11516
|
-
shieldLineLengthMeters:
|
|
11517
|
-
shieldNetwork:
|
|
11518
|
-
shieldRank:
|
|
11519
|
-
shieldText:
|
|
11520
|
-
shieldTextColor:
|
|
11521
|
-
service:
|
|
11522
|
-
species:
|
|
11523
|
-
speciesWikidata:
|
|
11524
|
-
subclass:
|
|
11525
|
-
surface:
|
|
11526
|
-
toll:
|
|
11499
|
+
var fieldBindingsSchema = z4.object({
|
|
11500
|
+
access: z4.string().trim().min(1),
|
|
11501
|
+
activityScore: z4.string().trim().min(1),
|
|
11502
|
+
adminLevel: z4.string().trim().min(1),
|
|
11503
|
+
bicycle: z4.string().trim().min(1),
|
|
11504
|
+
bathymetryMinDepth: z4.string().trim().min(1).optional(),
|
|
11505
|
+
bathymetrySortKey: z4.string().trim().min(1).optional(),
|
|
11506
|
+
brunnel: z4.string().trim().min(1),
|
|
11507
|
+
buildingKind: z4.string().trim().min(1),
|
|
11508
|
+
buildingTone: z4.string().trim().min(1),
|
|
11509
|
+
capital: z4.string().trim().min(1),
|
|
11510
|
+
circularClearanceExtraAtZoom15: z4.string().trim().min(1).optional(),
|
|
11511
|
+
circularKind: z4.string().trim().min(1).optional(),
|
|
11512
|
+
circularRadiusAtZoom15: z4.string().trim().min(1).optional(),
|
|
11513
|
+
circularRadiusMeters: z4.string().trim().min(1).optional(),
|
|
11514
|
+
circularInnerRadiusMeters: z4.string().trim().min(1).optional(),
|
|
11515
|
+
circularOuterRadiusMeters: z4.string().trim().min(1).optional(),
|
|
11516
|
+
class: z4.string().trim().min(1),
|
|
11517
|
+
crossing: z4.string().trim().min(1),
|
|
11518
|
+
classificationConfidence: z4.string().trim().min(1),
|
|
11519
|
+
confidence: z4.string().trim().min(1),
|
|
11520
|
+
circumference: z4.string().trim().min(1),
|
|
11521
|
+
diameterCrown: z4.string().trim().min(1),
|
|
11522
|
+
disputed: z4.string().trim().min(1),
|
|
11523
|
+
direction: z4.string().trim().min(1).optional(),
|
|
11524
|
+
elevation: z4.string().trim().min(1),
|
|
11525
|
+
elevationFeet: z4.string().trim().min(1),
|
|
11526
|
+
expressway: z4.string().trim().min(1),
|
|
11527
|
+
foot: z4.string().trim().min(1),
|
|
11528
|
+
height: z4.string().trim().min(1),
|
|
11529
|
+
hasBusiness: z4.string().trim().min(1),
|
|
11530
|
+
hasParts: z4.string().trim().min(1).optional(),
|
|
11531
|
+
hide3d: z4.string().trim().min(1),
|
|
11532
|
+
horse: z4.string().trim().min(1),
|
|
11533
|
+
houseNumber: z4.string().trim().min(1),
|
|
11534
|
+
importanceTier: z4.string().trim().min(1).optional(),
|
|
11535
|
+
iata: z4.string().trim().min(1),
|
|
11536
|
+
icao: z4.string().trim().min(1),
|
|
11537
|
+
indoor: z4.string().trim().min(1),
|
|
11538
|
+
intermittent: z4.string().trim().min(1),
|
|
11539
|
+
genus: z4.string().trim().min(1),
|
|
11540
|
+
layer: z4.string().trim().min(1),
|
|
11541
|
+
leafCycle: z4.string().trim().min(1),
|
|
11542
|
+
leafType: z4.string().trim().min(1),
|
|
11543
|
+
level: z4.string().trim().min(1),
|
|
11544
|
+
maritime: z4.string().trim().min(1),
|
|
11545
|
+
markings: z4.string().trim().min(1),
|
|
11546
|
+
minHeight: z4.string().trim().min(1),
|
|
11547
|
+
minZoom: z4.string().trim().min(1),
|
|
11548
|
+
mtbScale: z4.string().trim().min(1),
|
|
11549
|
+
name: z4.string().trim().min(1),
|
|
11550
|
+
nameEnglish: z4.string().trim().min(1),
|
|
11551
|
+
nameLatin: z4.string().trim().min(1),
|
|
11552
|
+
network: z4.string().trim().min(1),
|
|
11553
|
+
official: z4.string().trim().min(1),
|
|
11554
|
+
oneway: z4.string().trim().min(1),
|
|
11555
|
+
poiCategory: z4.string().trim().min(1),
|
|
11556
|
+
poiFilterRank: z4.string().trim().min(1),
|
|
11557
|
+
poiIcon: z4.string().trim().min(1),
|
|
11558
|
+
poiSizeRank: z4.string().trim().min(1),
|
|
11559
|
+
poiType: z4.string().trim().min(1),
|
|
11560
|
+
ramp: z4.string().trim().min(1),
|
|
11561
|
+
rank: z4.string().trim().min(1),
|
|
11562
|
+
ref: z4.string().trim().min(1),
|
|
11563
|
+
refLength: z4.string().trim().min(1),
|
|
11564
|
+
renderHeight: z4.string().trim().min(1),
|
|
11565
|
+
renderMinZoom: z4.string().trim().min(1),
|
|
11566
|
+
renderMinHeight: z4.string().trim().min(1),
|
|
11567
|
+
shieldKind: z4.string().trim().min(1).optional(),
|
|
11568
|
+
shieldLineLengthMeters: z4.string().trim().min(1).optional(),
|
|
11569
|
+
shieldNetwork: z4.string().trim().min(1).optional(),
|
|
11570
|
+
shieldRank: z4.string().trim().min(1).optional(),
|
|
11571
|
+
shieldText: z4.string().trim().min(1).optional(),
|
|
11572
|
+
shieldTextColor: z4.string().trim().min(1).optional(),
|
|
11573
|
+
service: z4.string().trim().min(1),
|
|
11574
|
+
species: z4.string().trim().min(1),
|
|
11575
|
+
speciesWikidata: z4.string().trim().min(1),
|
|
11576
|
+
subclass: z4.string().trim().min(1),
|
|
11577
|
+
surface: z4.string().trim().min(1),
|
|
11578
|
+
toll: z4.string().trim().min(1)
|
|
11527
11579
|
}).strict();
|
|
11528
|
-
var openMapTilesSchema =
|
|
11529
|
-
type:
|
|
11530
|
-
contractVersion:
|
|
11580
|
+
var openMapTilesSchema = z4.object({
|
|
11581
|
+
type: z4.literal("openmaptiles"),
|
|
11582
|
+
contractVersion: z4.literal(openMapTilesContractVersion),
|
|
11531
11583
|
fields: fieldBindingsSchema.partial().optional(),
|
|
11532
11584
|
layers: layerBindingsSchema.partial().optional(),
|
|
11533
|
-
semantics:
|
|
11585
|
+
semantics: z4.object({ parkLayer: z4.enum(["mixed", "protected-only"]).optional() }).strict().optional()
|
|
11534
11586
|
}).strict().transform(
|
|
11535
11587
|
(schema) => openMapTiles({
|
|
11536
11588
|
capabilities: schema.layers === void 0 ? void 0 : {
|
|
@@ -11545,12 +11597,12 @@ var openMapTilesSchema = z3.object({
|
|
|
11545
11597
|
})
|
|
11546
11598
|
);
|
|
11547
11599
|
var vectorDataShape = {
|
|
11548
|
-
type:
|
|
11549
|
-
attribution:
|
|
11600
|
+
type: z4.literal("vector-tiles"),
|
|
11601
|
+
attribution: z4.string().trim().min(1),
|
|
11550
11602
|
revision: revisionSchema.optional(),
|
|
11551
11603
|
schema: openMapTilesSchema
|
|
11552
11604
|
};
|
|
11553
|
-
var publicVectorUrlSchema =
|
|
11605
|
+
var publicVectorUrlSchema = z4.string().min(1).max(4096).superRefine((value, context) => {
|
|
11554
11606
|
try {
|
|
11555
11607
|
validatePublicVectorUrl(value);
|
|
11556
11608
|
} catch (error) {
|
|
@@ -11560,8 +11612,8 @@ var publicVectorUrlSchema = z3.string().min(1).max(4096).superRefine((value, con
|
|
|
11560
11612
|
});
|
|
11561
11613
|
}
|
|
11562
11614
|
}).describe("tileflow-public-vector-url");
|
|
11563
|
-
var marineSourceSchema =
|
|
11564
|
-
attribution:
|
|
11615
|
+
var marineSourceSchema = z4.object({
|
|
11616
|
+
attribution: z4.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
11565
11617
|
sourceId: identifierSchema.optional(),
|
|
11566
11618
|
url: publicVectorUrlSchema.optional()
|
|
11567
11619
|
}).strict();
|
|
@@ -11569,24 +11621,24 @@ var bathymetryDemUrlSchema = publicVectorUrlSchema.refine(
|
|
|
11569
11621
|
(value) => !value.startsWith("pmtiles://"),
|
|
11570
11622
|
"Expected an HTTPS, loopback HTTP, or root-relative DEM TileJSON URL"
|
|
11571
11623
|
).describe("tileflow-public-dem-url");
|
|
11572
|
-
var bathymetryReliefSchema =
|
|
11624
|
+
var bathymetryReliefSchema = z4.object({
|
|
11573
11625
|
accentColor: terrainColorValueSchema.optional(),
|
|
11574
|
-
attribution:
|
|
11575
|
-
encoding:
|
|
11576
|
-
exaggeration: terrainNumberValueSchema(
|
|
11626
|
+
attribution: z4.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
11627
|
+
encoding: z4.enum(["mapbox", "terrarium"]).optional(),
|
|
11628
|
+
exaggeration: terrainNumberValueSchema(z4.number().finite().min(0).max(1)).optional(),
|
|
11577
11629
|
highlightColor: terrainColorValueSchema.optional(),
|
|
11578
|
-
illuminationAltitude: terrainNumberValueSchema(
|
|
11579
|
-
illuminationAnchor:
|
|
11580
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
11630
|
+
illuminationAltitude: terrainNumberValueSchema(z4.number().finite().min(0).max(90)).optional(),
|
|
11631
|
+
illuminationAnchor: z4.enum(["map", "viewport"]).optional(),
|
|
11632
|
+
illuminationDirection: terrainNumberValueSchema(z4.number().finite().min(0).max(359)).optional(),
|
|
11581
11633
|
maxZoom: zoomNumberSchema.optional(),
|
|
11582
11634
|
minZoom: zoomNumberSchema.optional(),
|
|
11583
|
-
multidirectional:
|
|
11584
|
-
opacity: terrainNumberValueSchema(
|
|
11635
|
+
multidirectional: z4.boolean().optional(),
|
|
11636
|
+
opacity: terrainNumberValueSchema(z4.number().finite().min(0).max(1)).optional(),
|
|
11585
11637
|
shadowColor: terrainColorValueSchema.optional(),
|
|
11586
11638
|
sourceId: identifierSchema.optional(),
|
|
11587
|
-
tileSize:
|
|
11639
|
+
tileSize: z4.union([z4.literal(256), z4.literal(512)]).optional(),
|
|
11588
11640
|
url: bathymetryDemUrlSchema.optional(),
|
|
11589
|
-
visible:
|
|
11641
|
+
visible: z4.boolean().optional()
|
|
11590
11642
|
}).strict().superRefine((relief, context) => {
|
|
11591
11643
|
if (relief.minZoom !== void 0 && relief.maxZoom !== void 0 && relief.minZoom > relief.maxZoom) {
|
|
11592
11644
|
context.addIssue({
|
|
@@ -11596,33 +11648,33 @@ var bathymetryReliefSchema = z3.object({
|
|
|
11596
11648
|
});
|
|
11597
11649
|
}
|
|
11598
11650
|
});
|
|
11599
|
-
var bathymetryConfigSchema =
|
|
11651
|
+
var bathymetryConfigSchema = z4.object({
|
|
11600
11652
|
...marineSourceSchema.shape,
|
|
11601
|
-
bands:
|
|
11602
|
-
contours:
|
|
11603
|
-
display:
|
|
11604
|
-
labels:
|
|
11605
|
-
relief:
|
|
11606
|
-
type:
|
|
11653
|
+
bands: z4.union([z4.literal(false), fillStyleSchema]).optional(),
|
|
11654
|
+
contours: z4.union([z4.literal(false), lineStyleSchema]).optional(),
|
|
11655
|
+
display: z4.enum(["bands", "relief", "hybrid"]).optional(),
|
|
11656
|
+
labels: z4.union([z4.literal(false), symbolStyleSchema]).optional(),
|
|
11657
|
+
relief: z4.union([z4.literal(false), bathymetryReliefSchema]).optional(),
|
|
11658
|
+
type: z4.literal("bathymetry")
|
|
11607
11659
|
}).strict();
|
|
11608
|
-
var marineSchema =
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
bathymetry:
|
|
11612
|
-
nautical:
|
|
11660
|
+
var marineSchema = z4.union([
|
|
11661
|
+
z4.enum(["none", "bathymetry", "nautical", "chart"]),
|
|
11662
|
+
z4.object({
|
|
11663
|
+
bathymetry: z4.union([z4.literal(false), marineSourceSchema, bathymetryConfigSchema]).optional(),
|
|
11664
|
+
nautical: z4.union([z4.literal(false), marineSourceSchema]).optional()
|
|
11613
11665
|
}).strict()
|
|
11614
11666
|
]);
|
|
11615
|
-
var directVectorDataSchema =
|
|
11667
|
+
var directVectorDataSchema = z4.object({
|
|
11616
11668
|
...vectorDataShape,
|
|
11617
|
-
bounds:
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11669
|
+
bounds: z4.tuple([
|
|
11670
|
+
z4.number().finite().min(-180).max(180),
|
|
11671
|
+
z4.number().finite().min(-90).max(90),
|
|
11672
|
+
z4.number().finite().min(-180).max(180),
|
|
11673
|
+
z4.number().finite().min(-90).max(90)
|
|
11622
11674
|
]).optional(),
|
|
11623
|
-
maxzoom:
|
|
11624
|
-
minzoom:
|
|
11625
|
-
tiles:
|
|
11675
|
+
maxzoom: z4.number().int().min(0).max(30).optional(),
|
|
11676
|
+
minzoom: z4.number().int().min(0).max(30).optional(),
|
|
11677
|
+
tiles: z4.array(publicVectorUrlSchema).min(1).max(8)
|
|
11626
11678
|
}).strict().refine(
|
|
11627
11679
|
(value) => value.minzoom === void 0 || value.maxzoom === void 0 || value.minzoom <= value.maxzoom,
|
|
11628
11680
|
{ message: "minzoom must not exceed maxzoom", path: ["minzoom"] }
|
|
@@ -11630,34 +11682,34 @@ var directVectorDataSchema = z3.object({
|
|
|
11630
11682
|
(value) => value.bounds === void 0 || value.bounds[0] < value.bounds[2] && value.bounds[1] < value.bounds[3],
|
|
11631
11683
|
{ message: "bounds must have increasing axes", path: ["bounds"] }
|
|
11632
11684
|
);
|
|
11633
|
-
var dataSchema =
|
|
11634
|
-
|
|
11635
|
-
type:
|
|
11636
|
-
generation:
|
|
11637
|
-
selection:
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
kind:
|
|
11641
|
-
product:
|
|
11642
|
-
release:
|
|
11643
|
-
descriptorSha256:
|
|
11685
|
+
var dataSchema = z4.union([
|
|
11686
|
+
z4.object({
|
|
11687
|
+
type: z4.literal("tileflow-world"),
|
|
11688
|
+
generation: z4.literal(tileflowWorldGeneration),
|
|
11689
|
+
selection: z4.discriminatedUnion("kind", [
|
|
11690
|
+
z4.object({ kind: z4.literal("current"), product: z4.literal("world-v1") }).strict(),
|
|
11691
|
+
z4.object({
|
|
11692
|
+
kind: z4.literal("release"),
|
|
11693
|
+
product: z4.literal("world-v1"),
|
|
11694
|
+
release: z4.object({
|
|
11695
|
+
descriptorSha256: z4.string().regex(/^[0-9a-f]{64}$/u),
|
|
11644
11696
|
releaseId: tileflowWorldReleaseIdSchema
|
|
11645
11697
|
}).strict()
|
|
11646
11698
|
}).strict()
|
|
11647
11699
|
])
|
|
11648
11700
|
}).strict(),
|
|
11649
|
-
|
|
11701
|
+
z4.object({ ...vectorDataShape, url: publicVectorUrlSchema }).strict(),
|
|
11650
11702
|
directVectorDataSchema
|
|
11651
11703
|
]);
|
|
11652
|
-
var hostedTilesetSourceSchema =
|
|
11653
|
-
attribution:
|
|
11654
|
-
kind:
|
|
11655
|
-
local:
|
|
11704
|
+
var hostedTilesetSourceSchema = z4.object({
|
|
11705
|
+
attribution: z4.string().trim().min(1).max(4096),
|
|
11706
|
+
kind: z4.literal("hosted-tileset"),
|
|
11707
|
+
local: z4.string().refine(isSafeLocalPmtilesPath, {
|
|
11656
11708
|
message: "Expected a safe relative .pmtiles path beginning with ./ or ../"
|
|
11657
11709
|
}),
|
|
11658
|
-
tileset:
|
|
11659
|
-
tileSize:
|
|
11660
|
-
type:
|
|
11710
|
+
tileset: z4.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u).refine((value) => value !== "terrain" && value !== "world", "Expected a Team tileset ID"),
|
|
11711
|
+
tileSize: z4.union([z4.literal(256), z4.literal(512)]).optional(),
|
|
11712
|
+
type: z4.enum(["raster", "vector"])
|
|
11661
11713
|
}).strict().superRefine((source, context) => {
|
|
11662
11714
|
if (source.type === "vector" && source.tileSize !== void 0) {
|
|
11663
11715
|
context.addIssue({
|
|
@@ -11667,7 +11719,7 @@ var hostedTilesetSourceSchema = z3.object({
|
|
|
11667
11719
|
});
|
|
11668
11720
|
}
|
|
11669
11721
|
});
|
|
11670
|
-
var hostedSourcesSchema =
|
|
11722
|
+
var hostedSourcesSchema = z4.record(tileflowMapIdSchema, hostedTilesetSourceSchema).superRefine((sources, context) => {
|
|
11671
11723
|
if (Object.keys(sources).length > tileflowHostedSourceLimit) {
|
|
11672
11724
|
context.addIssue({
|
|
11673
11725
|
code: "too_big",
|
|
@@ -11676,7 +11728,7 @@ var hostedSourcesSchema = z3.record(tileflowMapIdSchema, hostedTilesetSourceSche
|
|
|
11676
11728
|
});
|
|
11677
11729
|
}
|
|
11678
11730
|
});
|
|
11679
|
-
var maplibreOverlayLayerSchema =
|
|
11731
|
+
var maplibreOverlayLayerSchema = z4.record(z4.string(), z4.unknown()).superRefine((layer, context) => {
|
|
11680
11732
|
if (!tileflowMapIdSchema.safeParse(layer.id).success) {
|
|
11681
11733
|
context.addIssue({ code: "custom", message: "Expected a portable layer ID", path: ["id"] });
|
|
11682
11734
|
}
|
|
@@ -11694,30 +11746,41 @@ var maplibreOverlayLayerSchema = z3.record(z3.string(), z3.unknown()).superRefin
|
|
|
11694
11746
|
});
|
|
11695
11747
|
}
|
|
11696
11748
|
});
|
|
11697
|
-
var maplibreOverlaySchema =
|
|
11698
|
-
kind:
|
|
11699
|
-
layers:
|
|
11700
|
-
placement:
|
|
11749
|
+
var maplibreOverlaySchema = z4.object({
|
|
11750
|
+
kind: z4.literal("maplibre-overlay"),
|
|
11751
|
+
layers: z4.array(maplibreOverlayLayerSchema).min(1),
|
|
11752
|
+
placement: z4.enum(tileflowOverlayPlacements),
|
|
11701
11753
|
source: tileflowMapIdSchema
|
|
11702
11754
|
}).strict();
|
|
11703
|
-
var overlaysSchema =
|
|
11704
|
-
var localAssetDirectorySchema =
|
|
11705
|
-
var packageAssetDirectorySchema =
|
|
11706
|
-
kind:
|
|
11707
|
-
package:
|
|
11755
|
+
var overlaysSchema = z4.record(tileflowMapIdSchema, maplibreOverlaySchema);
|
|
11756
|
+
var localAssetDirectorySchema = z4.string().min(3).max(tileflowLocalDirectoryMaximumLength).refine(isTileflowLocalDirectory, { message: tileflowLocalDirectoryMessage });
|
|
11757
|
+
var packageAssetDirectorySchema = z4.object({
|
|
11758
|
+
kind: z4.literal("package-directory"),
|
|
11759
|
+
package: z4.string().regex(
|
|
11708
11760
|
/^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/u,
|
|
11709
11761
|
"Expected a lowercase npm package name"
|
|
11710
11762
|
),
|
|
11711
|
-
path:
|
|
11763
|
+
path: z4.string().min(1).max(512).refine(
|
|
11712
11764
|
(value) => !value.startsWith("/") && !value.includes("\\") && value.split("/").every((segment) => Boolean(segment) && segment !== "." && segment !== ".."),
|
|
11713
11765
|
"Expected a portable package-relative directory"
|
|
11714
11766
|
)
|
|
11715
11767
|
}).strict();
|
|
11716
|
-
var assetDirectorySchema =
|
|
11717
|
-
var iconDirectoriesSchema =
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11768
|
+
var assetDirectorySchema = z4.union([localAssetDirectorySchema, packageAssetDirectorySchema]);
|
|
11769
|
+
var iconDirectoriesSchema = z4.array(
|
|
11770
|
+
z4.union([localAssetDirectorySchema, packageAssetDirectorySchema, tileflowIconSetSourceSchema])
|
|
11771
|
+
).max(tileflowIconSourceLimit).superRefine((sources, context) => {
|
|
11772
|
+
try {
|
|
11773
|
+
collectTileflowIconSetReferences(sources);
|
|
11774
|
+
} catch (cause) {
|
|
11775
|
+
context.addIssue({
|
|
11776
|
+
code: "custom",
|
|
11777
|
+
message: cause instanceof Error ? cause.message : "Invalid icon contributors"
|
|
11778
|
+
});
|
|
11779
|
+
}
|
|
11780
|
+
});
|
|
11781
|
+
var fontDirectoriesSchema = z4.array(assetDirectorySchema).max(16);
|
|
11782
|
+
var fontStacksSchema = z4.array(
|
|
11783
|
+
z4.string().min(1).max(200).refine(
|
|
11721
11784
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\/]/u.test(value),
|
|
11722
11785
|
"Expected an exact NFC MapLibre font-stack key without whitespace padding, controls, slashes, or backslashes"
|
|
11723
11786
|
)
|
|
@@ -11734,10 +11797,10 @@ var fontStacksSchema = z3.array(
|
|
|
11734
11797
|
seen.add(fontStack);
|
|
11735
11798
|
}
|
|
11736
11799
|
});
|
|
11737
|
-
var glyphsSchema =
|
|
11800
|
+
var glyphsSchema = z4.object({
|
|
11738
11801
|
fontStacks: fontStacksSchema,
|
|
11739
|
-
kind:
|
|
11740
|
-
url:
|
|
11802
|
+
kind: z4.literal("url"),
|
|
11803
|
+
url: z4.string().min(1).refine(
|
|
11741
11804
|
(value) => value.includes("{fontstack}") && value.includes("{range}"),
|
|
11742
11805
|
"Expected {fontstack} and {range} placeholders"
|
|
11743
11806
|
).refine(isSafeGlyphUrl, "Expected an HTTP(S), root-relative, or path-relative glyph URL")
|
|
@@ -11745,34 +11808,34 @@ var glyphsSchema = z3.object({
|
|
|
11745
11808
|
var terrainLayerRangeShape = {
|
|
11746
11809
|
maxZoom: zoomNumberSchema.optional(),
|
|
11747
11810
|
minZoom: zoomNumberSchema.optional(),
|
|
11748
|
-
visible:
|
|
11811
|
+
visible: z4.boolean().optional()
|
|
11749
11812
|
};
|
|
11750
|
-
var terrainHillshadeSchema =
|
|
11813
|
+
var terrainHillshadeSchema = z4.object({
|
|
11751
11814
|
...terrainLayerRangeShape,
|
|
11752
11815
|
accentColor: terrainColorValueSchema.optional(),
|
|
11753
|
-
exaggeration: terrainNumberValueSchema(
|
|
11816
|
+
exaggeration: terrainNumberValueSchema(z4.number().finite().min(0).max(1)).optional(),
|
|
11754
11817
|
highlightColor: terrainColorValueSchema.optional(),
|
|
11755
|
-
illuminationAnchor:
|
|
11756
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
11818
|
+
illuminationAnchor: z4.enum(["map", "viewport"]).optional(),
|
|
11819
|
+
illuminationDirection: terrainNumberValueSchema(z4.number().finite().min(0).max(359)).optional(),
|
|
11757
11820
|
shadowColor: terrainColorValueSchema.optional()
|
|
11758
11821
|
}).strict();
|
|
11759
|
-
var terrainContourLineSchema =
|
|
11822
|
+
var terrainContourLineSchema = z4.object({
|
|
11760
11823
|
...terrainLayerRangeShape,
|
|
11761
11824
|
color: terrainColorValueSchema.optional(),
|
|
11762
|
-
opacity: terrainNumberValueSchema(
|
|
11763
|
-
width: terrainNumberValueSchema(
|
|
11825
|
+
opacity: terrainNumberValueSchema(z4.number().finite().min(0).max(1)).optional(),
|
|
11826
|
+
width: terrainNumberValueSchema(z4.number().finite().min(0).max(32)).optional()
|
|
11764
11827
|
}).strict();
|
|
11765
|
-
var terrainContourLabelSchema =
|
|
11828
|
+
var terrainContourLabelSchema = z4.object({
|
|
11766
11829
|
...terrainLayerRangeShape,
|
|
11767
11830
|
color: terrainColorValueSchema.optional(),
|
|
11768
11831
|
font: moduleFontValueSchema.optional(),
|
|
11769
11832
|
haloColor: terrainColorValueSchema.optional(),
|
|
11770
|
-
haloWidth: terrainNumberValueSchema(
|
|
11771
|
-
opacity: terrainNumberValueSchema(
|
|
11772
|
-
size: terrainNumberValueSchema(
|
|
11773
|
-
spacing: terrainNumberValueSchema(
|
|
11833
|
+
haloWidth: terrainNumberValueSchema(z4.number().finite().min(0).max(16)).optional(),
|
|
11834
|
+
opacity: terrainNumberValueSchema(z4.number().finite().min(0).max(1)).optional(),
|
|
11835
|
+
size: terrainNumberValueSchema(z4.number().finite().min(1).max(64)).optional(),
|
|
11836
|
+
spacing: terrainNumberValueSchema(z4.number().finite().min(1).max(1e3)).optional()
|
|
11774
11837
|
}).strict();
|
|
11775
|
-
var terrainContourThresholdPairSchema =
|
|
11838
|
+
var terrainContourThresholdPairSchema = z4.tuple([z4.number().finite().min(1e-3).max(1e5), z4.number().finite().min(1e-3).max(1e5)]).refine(([minor, index]) => minor <= index, {
|
|
11776
11839
|
message: "Expected the index contour interval to be greater than or equal to the minor interval"
|
|
11777
11840
|
}).refine(([minor, index]) => isWholeContourMultiple2(index, minor), {
|
|
11778
11841
|
message: "Expected the index contour interval to be a whole multiple of the minor interval"
|
|
@@ -11781,7 +11844,7 @@ function isWholeContourMultiple2(value, interval) {
|
|
|
11781
11844
|
const ratio = value / interval;
|
|
11782
11845
|
return Math.abs(ratio - Math.round(ratio)) <= Number.EPSILON * Math.max(1, ratio) * 8;
|
|
11783
11846
|
}
|
|
11784
|
-
var terrainContourThresholdsSchema =
|
|
11847
|
+
var terrainContourThresholdsSchema = z4.record(z4.string().regex(/^(?:0|[1-9]|1\d|2[0-4])$/u), terrainContourThresholdPairSchema).superRefine((thresholds, context) => {
|
|
11785
11848
|
const count = Object.keys(thresholds).length;
|
|
11786
11849
|
if (count === 0 || count > 25) {
|
|
11787
11850
|
context.addIssue({
|
|
@@ -11790,19 +11853,19 @@ var terrainContourThresholdsSchema = z3.record(z3.string().regex(/^(?:0|[1-9]|1\
|
|
|
11790
11853
|
});
|
|
11791
11854
|
}
|
|
11792
11855
|
});
|
|
11793
|
-
var terrainContoursSchema =
|
|
11794
|
-
demMaxZoom:
|
|
11795
|
-
demUrl:
|
|
11856
|
+
var terrainContoursSchema = z4.object({
|
|
11857
|
+
demMaxZoom: z4.number().int().min(0).max(24),
|
|
11858
|
+
demUrl: z4.string().min(1).max(2048).refine(
|
|
11796
11859
|
isSafeTileflowDemUrlTemplate,
|
|
11797
11860
|
"Expected a safe HTTP(S) DEM URL template containing {z}, {x}, and {y}"
|
|
11798
11861
|
),
|
|
11799
11862
|
index: terrainContourLineSchema.optional(),
|
|
11800
11863
|
labels: terrainContourLabelSchema.optional(),
|
|
11801
|
-
maxZoom:
|
|
11864
|
+
maxZoom: z4.number().int().min(0).max(24).optional(),
|
|
11802
11865
|
minZoom: zoomNumberSchema.optional(),
|
|
11803
11866
|
minor: terrainContourLineSchema.optional(),
|
|
11804
|
-
multiplier:
|
|
11805
|
-
overzoom:
|
|
11867
|
+
multiplier: z4.number().finite().min(1e-3).max(100).optional(),
|
|
11868
|
+
overzoom: z4.number().int().min(0).max(8).optional(),
|
|
11806
11869
|
sourceId: identifierSchema.optional(),
|
|
11807
11870
|
thresholds: terrainContourThresholdsSchema
|
|
11808
11871
|
}).strict().superRefine((contours, context) => {
|
|
@@ -11866,26 +11929,26 @@ var terrainContoursSchema = z3.object({
|
|
|
11866
11929
|
}
|
|
11867
11930
|
}
|
|
11868
11931
|
});
|
|
11869
|
-
var terrainSchema =
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
attribution:
|
|
11932
|
+
var terrainSchema = z4.union([
|
|
11933
|
+
z4.enum(["none", "hillshade", "3d"]),
|
|
11934
|
+
z4.object({
|
|
11935
|
+
attribution: z4.string().optional(),
|
|
11873
11936
|
contours: terrainContoursSchema.optional(),
|
|
11874
|
-
encoding:
|
|
11875
|
-
exaggeration:
|
|
11937
|
+
encoding: z4.enum(["mapbox", "terrarium"]).optional(),
|
|
11938
|
+
exaggeration: z4.number().finite().min(0).max(10).optional(),
|
|
11876
11939
|
hillshade: terrainHillshadeSchema.optional(),
|
|
11877
|
-
mode:
|
|
11878
|
-
sourceId:
|
|
11879
|
-
url:
|
|
11940
|
+
mode: z4.enum(["none", "hillshade", "3d"]).optional(),
|
|
11941
|
+
sourceId: z4.string().trim().min(1).optional(),
|
|
11942
|
+
url: z4.string().trim().min(1).optional()
|
|
11880
11943
|
}).strict()
|
|
11881
11944
|
]);
|
|
11882
|
-
var viewSchema =
|
|
11883
|
-
bearing:
|
|
11884
|
-
center:
|
|
11885
|
-
pitch:
|
|
11945
|
+
var viewSchema = z4.object({
|
|
11946
|
+
bearing: z4.number().finite().min(-180).max(180).optional(),
|
|
11947
|
+
center: z4.tuple([z4.number().finite().min(-180).max(180), z4.number().finite().min(-90).max(90)]).optional(),
|
|
11948
|
+
pitch: z4.number().finite().min(0).max(85).optional(),
|
|
11886
11949
|
zoom: zoomNumberSchema.optional()
|
|
11887
11950
|
}).strict();
|
|
11888
|
-
var themesSchema =
|
|
11951
|
+
var themesSchema = z4.record(tileflowThemeNameSchema, tileflowThemeSchema).superRefine((themes, context) => {
|
|
11889
11952
|
const names = Object.keys(themes);
|
|
11890
11953
|
if (names.length === 0) {
|
|
11891
11954
|
context.addIssue({ code: "custom", message: "Expected at least one named theme" });
|
|
@@ -11909,8 +11972,8 @@ var themesSchema = z3.record(tileflowThemeNameSchema, tileflowThemeSchema).super
|
|
|
11909
11972
|
}
|
|
11910
11973
|
}
|
|
11911
11974
|
}).describe("tileflow-themes");
|
|
11912
|
-
var systemThemesSchema =
|
|
11913
|
-
var resolvedTileflowMapSchema =
|
|
11975
|
+
var systemThemesSchema = z4.object({ dark: tileflowThemeNameSchema, light: tileflowThemeNameSchema }).strict();
|
|
11976
|
+
var resolvedTileflowMapSchema = z4.object({
|
|
11914
11977
|
data: dataSchema.optional(),
|
|
11915
11978
|
defaultTheme: tileflowThemeNameSchema,
|
|
11916
11979
|
fonts: fontDirectoriesSchema.optional(),
|
|
@@ -11919,14 +11982,14 @@ var resolvedTileflowMapSchema = z3.object({
|
|
|
11919
11982
|
id: tileflowMapIdSchema,
|
|
11920
11983
|
marine: marineSchema.optional(),
|
|
11921
11984
|
modules: modulesSchema.optional(),
|
|
11922
|
-
name:
|
|
11985
|
+
name: z4.string().trim().min(1),
|
|
11923
11986
|
overlays: overlaysSchema.optional(),
|
|
11924
|
-
projection:
|
|
11987
|
+
projection: z4.enum(["globe", "mercator"]).optional(),
|
|
11925
11988
|
sources: hostedSourcesSchema.optional(),
|
|
11926
11989
|
systemThemes: systemThemesSchema.optional(),
|
|
11927
11990
|
terrain: terrainSchema.optional(),
|
|
11928
11991
|
themes: themesSchema,
|
|
11929
|
-
version:
|
|
11992
|
+
version: z4.number().int().positive(),
|
|
11930
11993
|
view: viewSchema.optional()
|
|
11931
11994
|
}).strict().superRefine((map, context) => {
|
|
11932
11995
|
if (map.fonts !== void 0 && map.glyphs !== void 0) {
|
|
@@ -13949,46 +14012,46 @@ function semanticReportKey(...parts) {
|
|
|
13949
14012
|
}
|
|
13950
14013
|
|
|
13951
14014
|
// src/manifest.ts
|
|
13952
|
-
import { z as
|
|
14015
|
+
import { z as z5 } from "zod";
|
|
13953
14016
|
var tileflowRuntimeManifestVersion = 1;
|
|
13954
14017
|
var tileflowRuntimeManifestLimits = Object.freeze({ maximumBytes: 1024 * 1024 });
|
|
13955
|
-
var safeTextSchema =
|
|
14018
|
+
var safeTextSchema = z5.string().min(1).max(2048).refine((value) => value === value.trim(), "Expected text without surrounding whitespace").refine((value) => !/[\p{Cc}\\]/u.test(value), "Expected safe text");
|
|
13956
14019
|
var publicResourceUrlSchema = safeTextSchema.refine(isPublicResourceUrl, {
|
|
13957
14020
|
message: "Expected an HTTP(S), root-relative, or path-relative public URL"
|
|
13958
14021
|
});
|
|
13959
14022
|
var apiOriginSchema = safeTextSchema.refine(isApiOrigin, {
|
|
13960
14023
|
message: "Expected an absolute HTTP(S) origin without path, credentials, query, or fragment"
|
|
13961
14024
|
});
|
|
13962
|
-
var viewSchema2 =
|
|
13963
|
-
bearing:
|
|
13964
|
-
center:
|
|
13965
|
-
pitch:
|
|
13966
|
-
zoom:
|
|
14025
|
+
var viewSchema2 = z5.object({
|
|
14026
|
+
bearing: z5.number().finite().min(-180).max(180).optional(),
|
|
14027
|
+
center: z5.tuple([z5.number().finite().min(-180).max(180), z5.number().finite().min(-90).max(90)]).optional(),
|
|
14028
|
+
pitch: z5.number().finite().min(0).max(85).optional(),
|
|
14029
|
+
zoom: z5.number().finite().min(0).max(24).optional()
|
|
13967
14030
|
}).strict();
|
|
13968
|
-
var fontFaceSchema =
|
|
14031
|
+
var fontFaceSchema = z5.object({
|
|
13969
14032
|
family: safeTextSchema.max(100),
|
|
13970
14033
|
source: publicResourceUrlSchema,
|
|
13971
|
-
style:
|
|
13972
|
-
weight:
|
|
14034
|
+
style: z5.enum(["italic", "normal", "oblique"]).optional(),
|
|
14035
|
+
weight: z5.enum(["100", "200", "300", "400", "500", "600", "700", "800", "900"]).optional()
|
|
13973
14036
|
}).strict();
|
|
13974
|
-
var fontFacesSchema =
|
|
13975
|
-
var manifestThemeSchema =
|
|
13976
|
-
colorScheme:
|
|
14037
|
+
var fontFacesSchema = z5.array(fontFaceSchema).max(16).superRefine(validateUniqueFontFaces);
|
|
14038
|
+
var manifestThemeSchema = z5.object({
|
|
14039
|
+
colorScheme: z5.enum(["dark", "light"]),
|
|
13977
14040
|
fontFaces: fontFacesSchema.optional(),
|
|
13978
14041
|
revision: safeTextSchema.max(128).optional(),
|
|
13979
14042
|
styleId: safeTextSchema.max(128).optional(),
|
|
13980
14043
|
styleUrl: publicResourceUrlSchema
|
|
13981
14044
|
}).strict();
|
|
13982
|
-
var manifestMapSchema =
|
|
14045
|
+
var manifestMapSchema = z5.object({
|
|
13983
14046
|
apiUrl: apiOriginSchema.optional(),
|
|
13984
14047
|
defaultTheme: tileflowThemeNameSchema,
|
|
13985
14048
|
environment: safeTextSchema.max(128).optional(),
|
|
13986
14049
|
mapId: safeTextSchema.max(128).optional(),
|
|
13987
|
-
systemThemes:
|
|
13988
|
-
themes:
|
|
13989
|
-
usageMode:
|
|
14050
|
+
systemThemes: z5.object({ dark: tileflowThemeNameSchema, light: tileflowThemeNameSchema }).strict().optional(),
|
|
14051
|
+
themes: z5.record(tileflowThemeNameSchema, manifestThemeSchema),
|
|
14052
|
+
usageMode: z5.literal("session").optional(),
|
|
13990
14053
|
view: viewSchema2.optional(),
|
|
13991
|
-
worldGeneration:
|
|
14054
|
+
worldGeneration: z5.literal("v1").optional()
|
|
13992
14055
|
}).strict().superRefine((entry, context) => {
|
|
13993
14056
|
const names = Object.keys(entry.themes);
|
|
13994
14057
|
if (names.length === 0) {
|
|
@@ -14035,10 +14098,10 @@ var manifestMapSchema = z4.object({
|
|
|
14035
14098
|
});
|
|
14036
14099
|
}
|
|
14037
14100
|
});
|
|
14038
|
-
var canonicalManifestSchema =
|
|
14101
|
+
var canonicalManifestSchema = z5.object({
|
|
14039
14102
|
apiUrl: apiOriginSchema.optional(),
|
|
14040
|
-
maps:
|
|
14041
|
-
version:
|
|
14103
|
+
maps: z5.record(tileflowPortableIdSchema, manifestMapSchema),
|
|
14104
|
+
version: z5.literal(tileflowRuntimeManifestVersion)
|
|
14042
14105
|
}).strict().superRefine((manifest, context) => {
|
|
14043
14106
|
const mapCount = Object.keys(manifest.maps).length;
|
|
14044
14107
|
if (mapCount === 0) {
|
|
@@ -14056,7 +14119,7 @@ var canonicalManifestSchema = z4.object({
|
|
|
14056
14119
|
});
|
|
14057
14120
|
}
|
|
14058
14121
|
});
|
|
14059
|
-
var safeManifestInputSchema =
|
|
14122
|
+
var safeManifestInputSchema = z5.unknown().superRefine((input, context) => {
|
|
14060
14123
|
const unsafe = findUnsafeManifestStructure(input);
|
|
14061
14124
|
if (unsafe) {
|
|
14062
14125
|
context.addIssue({
|
|
@@ -14147,7 +14210,7 @@ function findUnsafeManifestStructure(input) {
|
|
|
14147
14210
|
}
|
|
14148
14211
|
|
|
14149
14212
|
// src/capture-scene.ts
|
|
14150
|
-
import { z as
|
|
14213
|
+
import { z as z6 } from "zod";
|
|
14151
14214
|
var tileflowCaptureSceneLimits = Object.freeze({
|
|
14152
14215
|
applicationPathLength: 2048,
|
|
14153
14216
|
boundsPadding: { maximum: 1024, minimum: 0 },
|
|
@@ -14158,26 +14221,26 @@ var tileflowCaptureSceneLimits = Object.freeze({
|
|
|
14158
14221
|
viewport: { maximum: 4096, minimum: 64 },
|
|
14159
14222
|
zoom: { maximum: 24, minimum: 0 }
|
|
14160
14223
|
});
|
|
14161
|
-
var finiteLongitudeSchema =
|
|
14162
|
-
var finiteLatitudeSchema =
|
|
14163
|
-
var bearingSchema =
|
|
14164
|
-
var pitchSchema =
|
|
14165
|
-
var tileflowCaptureCenterCameraSchema =
|
|
14166
|
-
type:
|
|
14167
|
-
center:
|
|
14168
|
-
zoom:
|
|
14224
|
+
var finiteLongitudeSchema = z6.number().finite().min(-180).max(180);
|
|
14225
|
+
var finiteLatitudeSchema = z6.number().finite().min(-90).max(90);
|
|
14226
|
+
var bearingSchema = z6.number().finite().min(-180).max(180).optional();
|
|
14227
|
+
var pitchSchema = z6.number().finite().min(tileflowCaptureSceneLimits.pitch.minimum).max(tileflowCaptureSceneLimits.pitch.maximum).optional();
|
|
14228
|
+
var tileflowCaptureCenterCameraSchema = z6.object({
|
|
14229
|
+
type: z6.literal("center"),
|
|
14230
|
+
center: z6.tuple([finiteLongitudeSchema, finiteLatitudeSchema]),
|
|
14231
|
+
zoom: z6.number().finite().min(tileflowCaptureSceneLimits.zoom.minimum).max(tileflowCaptureSceneLimits.zoom.maximum),
|
|
14169
14232
|
bearing: bearingSchema,
|
|
14170
14233
|
pitch: pitchSchema
|
|
14171
14234
|
}).strict();
|
|
14172
|
-
var tileflowCaptureBoundsCameraSchema =
|
|
14173
|
-
type:
|
|
14174
|
-
bounds:
|
|
14235
|
+
var tileflowCaptureBoundsCameraSchema = z6.object({
|
|
14236
|
+
type: z6.literal("bounds"),
|
|
14237
|
+
bounds: z6.tuple([
|
|
14175
14238
|
finiteLongitudeSchema,
|
|
14176
14239
|
finiteLatitudeSchema,
|
|
14177
14240
|
finiteLongitudeSchema,
|
|
14178
14241
|
finiteLatitudeSchema
|
|
14179
14242
|
]),
|
|
14180
|
-
padding:
|
|
14243
|
+
padding: z6.number().finite().min(tileflowCaptureSceneLimits.boundsPadding.minimum).max(tileflowCaptureSceneLimits.boundsPadding.maximum).optional(),
|
|
14181
14244
|
bearing: bearingSchema,
|
|
14182
14245
|
pitch: pitchSchema
|
|
14183
14246
|
}).strict().superRefine((camera, context) => {
|
|
@@ -14197,14 +14260,14 @@ var tileflowCaptureBoundsCameraSchema = z5.object({
|
|
|
14197
14260
|
});
|
|
14198
14261
|
}
|
|
14199
14262
|
});
|
|
14200
|
-
var tileflowCaptureCameraSchema =
|
|
14263
|
+
var tileflowCaptureCameraSchema = z6.discriminatedUnion("type", [
|
|
14201
14264
|
tileflowCaptureCenterCameraSchema,
|
|
14202
14265
|
tileflowCaptureBoundsCameraSchema
|
|
14203
14266
|
]);
|
|
14204
|
-
var tileflowCaptureViewportSchema =
|
|
14205
|
-
width:
|
|
14206
|
-
height:
|
|
14207
|
-
dpr:
|
|
14267
|
+
var tileflowCaptureViewportSchema = z6.object({
|
|
14268
|
+
width: z6.number().int().min(tileflowCaptureSceneLimits.viewport.minimum).max(tileflowCaptureSceneLimits.viewport.maximum),
|
|
14269
|
+
height: z6.number().int().min(tileflowCaptureSceneLimits.viewport.minimum).max(tileflowCaptureSceneLimits.viewport.maximum),
|
|
14270
|
+
dpr: z6.union([z6.literal(1), z6.literal(2)]).optional()
|
|
14208
14271
|
}).strict().superRefine((viewport, context) => {
|
|
14209
14272
|
const dpr = viewport.dpr ?? 1;
|
|
14210
14273
|
const physicalWidth = viewport.width * dpr;
|
|
@@ -14218,22 +14281,22 @@ var tileflowCaptureViewportSchema = z5.object({
|
|
|
14218
14281
|
});
|
|
14219
14282
|
}
|
|
14220
14283
|
});
|
|
14221
|
-
var tileflowCaptureIdSchema =
|
|
14284
|
+
var tileflowCaptureIdSchema = z6.string().min(1).max(tileflowCaptureSceneLimits.captureIdLength).regex(/^[A-Za-z0-9_-]+$/, {
|
|
14222
14285
|
message: "Expected letters, numbers, underscores, or hyphens"
|
|
14223
14286
|
}).refine((name) => name !== "__proto__", {
|
|
14224
14287
|
message: "Expected an identifier that cannot mutate an object prototype"
|
|
14225
14288
|
});
|
|
14226
14289
|
var tileflowCaptureSceneNameSchema = tileflowPortableIdSchema;
|
|
14227
|
-
var applicationPathSchema =
|
|
14290
|
+
var applicationPathSchema = z6.string().min(1).max(tileflowCaptureSceneLimits.applicationPathLength).refine(isPortableApplicationPath, {
|
|
14228
14291
|
message: "Expected a root-relative application path without an origin, credentials, fragment, backslash, or control character"
|
|
14229
14292
|
});
|
|
14230
|
-
var tileflowCaptureMapTargetSchema =
|
|
14231
|
-
var tileflowCaptureApplicationTargetSchema =
|
|
14232
|
-
kind:
|
|
14293
|
+
var tileflowCaptureMapTargetSchema = z6.object({ kind: z6.literal("map") }).strict();
|
|
14294
|
+
var tileflowCaptureApplicationTargetSchema = z6.object({
|
|
14295
|
+
kind: z6.literal("application"),
|
|
14233
14296
|
path: applicationPathSchema,
|
|
14234
14297
|
captureId: tileflowCaptureIdSchema.optional(),
|
|
14235
|
-
selector:
|
|
14236
|
-
frame:
|
|
14298
|
+
selector: z6.string().trim().min(1).max(tileflowCaptureSceneLimits.selectorLength).optional(),
|
|
14299
|
+
frame: z6.enum(["map", "viewport"]).optional()
|
|
14237
14300
|
}).strict().superRefine((target, context) => {
|
|
14238
14301
|
if (target.captureId && target.selector) {
|
|
14239
14302
|
context.addIssue({
|
|
@@ -14243,11 +14306,11 @@ var tileflowCaptureApplicationTargetSchema = z5.object({
|
|
|
14243
14306
|
});
|
|
14244
14307
|
}
|
|
14245
14308
|
});
|
|
14246
|
-
var tileflowCaptureTargetSchema =
|
|
14309
|
+
var tileflowCaptureTargetSchema = z6.discriminatedUnion("kind", [
|
|
14247
14310
|
tileflowCaptureMapTargetSchema,
|
|
14248
14311
|
tileflowCaptureApplicationTargetSchema
|
|
14249
14312
|
]);
|
|
14250
|
-
var tileflowCaptureSceneSchema =
|
|
14313
|
+
var tileflowCaptureSceneSchema = z6.object({
|
|
14251
14314
|
map: tileflowPortableIdSchema,
|
|
14252
14315
|
theme: tileflowThemeNameSchema,
|
|
14253
14316
|
camera: tileflowCaptureCameraSchema,
|
|
@@ -14350,8 +14413,11 @@ function isPlainRecord5(value) {
|
|
|
14350
14413
|
return prototype === Object.prototype || prototype === null;
|
|
14351
14414
|
}
|
|
14352
14415
|
|
|
14416
|
+
// src/icon-composition.ts
|
|
14417
|
+
import { z as z8 } from "zod";
|
|
14418
|
+
|
|
14353
14419
|
// src/icon-package.ts
|
|
14354
|
-
import { z as
|
|
14420
|
+
import { z as z7 } from "zod";
|
|
14355
14421
|
var tileflowIconIdPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
14356
14422
|
var tileflowIconPackageLimits = {
|
|
14357
14423
|
decodeConcurrency: 4,
|
|
@@ -14370,16 +14436,17 @@ var tileflowHostedAlphaCompatibility = {
|
|
|
14370
14436
|
},
|
|
14371
14437
|
maxMapsPerDeploy: 20
|
|
14372
14438
|
};
|
|
14373
|
-
var sha256Schema =
|
|
14374
|
-
var
|
|
14375
|
-
var
|
|
14439
|
+
var sha256Schema = z7.string().regex(/^[a-f0-9]{64}$/);
|
|
14440
|
+
var tileflowIconPackageContentHashSchema = sha256Schema;
|
|
14441
|
+
var tileflowIconIdSchema = z7.string().max(64).regex(tileflowIconIdPattern);
|
|
14442
|
+
var tileflowRenderedIconManifestEntrySchema = z7.object({
|
|
14376
14443
|
name: tileflowIconIdSchema,
|
|
14377
|
-
pixelSha256:
|
|
14444
|
+
pixelSha256: z7.object({
|
|
14378
14445
|
oneX: sha256Schema,
|
|
14379
14446
|
twoX: sha256Schema
|
|
14380
14447
|
}).strict()
|
|
14381
14448
|
}).strict();
|
|
14382
|
-
var tileflowIconPackageLabelSchema =
|
|
14449
|
+
var tileflowIconPackageLabelSchema = z7.string().superRefine((value, context) => {
|
|
14383
14450
|
if (value !== value.trim() || value.length === 0) {
|
|
14384
14451
|
context.addIssue({
|
|
14385
14452
|
code: "custom",
|
|
@@ -14399,32 +14466,32 @@ var tileflowIconPackageLabelSchema = z6.string().superRefine((value, context) =>
|
|
|
14399
14466
|
});
|
|
14400
14467
|
}
|
|
14401
14468
|
});
|
|
14402
|
-
var spriteDimensionsSchema =
|
|
14403
|
-
height:
|
|
14404
|
-
pixelRatio:
|
|
14405
|
-
width:
|
|
14469
|
+
var spriteDimensionsSchema = z7.object({
|
|
14470
|
+
height: z7.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
14471
|
+
pixelRatio: z7.union([z7.literal(1), z7.literal(2)]),
|
|
14472
|
+
width: z7.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension)
|
|
14406
14473
|
}).strict();
|
|
14407
14474
|
function iconPackageFileSchema(name, contentType) {
|
|
14408
|
-
return
|
|
14409
|
-
byteLength:
|
|
14410
|
-
contentType:
|
|
14411
|
-
name:
|
|
14475
|
+
return z7.object({
|
|
14476
|
+
byteLength: z7.number().int().nonnegative().max(tileflowIconPackageLimits.maxGeneratedFileBytes),
|
|
14477
|
+
contentType: z7.literal(contentType),
|
|
14478
|
+
name: z7.literal(name),
|
|
14412
14479
|
sha256: sha256Schema
|
|
14413
14480
|
}).strict();
|
|
14414
14481
|
}
|
|
14415
|
-
var tileflowIconPackageManifestSchema =
|
|
14416
|
-
files:
|
|
14482
|
+
var tileflowIconPackageManifestSchema = z7.object({
|
|
14483
|
+
files: z7.tuple([
|
|
14417
14484
|
iconPackageFileSchema("sprite.json", "application/json"),
|
|
14418
14485
|
iconPackageFileSchema("sprite.png", "image/png"),
|
|
14419
14486
|
iconPackageFileSchema("sprite@2x.json", "application/json"),
|
|
14420
14487
|
iconPackageFileSchema("sprite@2x.png", "image/png")
|
|
14421
14488
|
]),
|
|
14422
|
-
format:
|
|
14423
|
-
iconNames:
|
|
14424
|
-
renderedIcons:
|
|
14425
|
-
sprites:
|
|
14426
|
-
oneX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
14427
|
-
twoX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
14489
|
+
format: z7.literal("tileflow-icon-package-v1"),
|
|
14490
|
+
iconNames: z7.array(tileflowIconIdSchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
14491
|
+
renderedIcons: z7.array(tileflowRenderedIconManifestEntrySchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
14492
|
+
sprites: z7.object({
|
|
14493
|
+
oneX: spriteDimensionsSchema.extend({ pixelRatio: z7.literal(1) }),
|
|
14494
|
+
twoX: spriteDimensionsSchema.extend({ pixelRatio: z7.literal(2) })
|
|
14428
14495
|
}).strict()
|
|
14429
14496
|
}).strict().superRefine((manifest, context) => {
|
|
14430
14497
|
const sortedNames = [...manifest.iconNames].sort(compareCodeUnits8);
|
|
@@ -14512,8 +14579,113 @@ function containsControlCharacter(value) {
|
|
|
14512
14579
|
});
|
|
14513
14580
|
}
|
|
14514
14581
|
|
|
14582
|
+
// src/icon-composition.ts
|
|
14583
|
+
var tileflowIconCompositionMaximumBytes = 1024 * 1024;
|
|
14584
|
+
var idsSchema = z8.array(tileflowIconIdSchema).max(tileflowIconPackageLimits.maxIconCount).refine(
|
|
14585
|
+
(ids) => new Set(ids).size === ids.length && ids.every((id, index) => index === 0 || compareCodeUnits8(ids[index - 1], id) < 0),
|
|
14586
|
+
"Icon exports must be unique and sorted by code unit"
|
|
14587
|
+
);
|
|
14588
|
+
var localContributorSchema = z8.object({ kind: z8.literal("local"), iconIds: idsSchema }).strict();
|
|
14589
|
+
var packageContributorSchema = z8.object({
|
|
14590
|
+
kind: z8.literal("package"),
|
|
14591
|
+
package: z8.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u),
|
|
14592
|
+
iconIds: idsSchema
|
|
14593
|
+
}).strict();
|
|
14594
|
+
var setContributorSchema = z8.object({
|
|
14595
|
+
kind: z8.literal("icon-set"),
|
|
14596
|
+
reference: tileflowIconSetReferenceSchema,
|
|
14597
|
+
teamId: tileflowIconSetTeamIdSchema,
|
|
14598
|
+
setId: tileflowIconSetIdSchema,
|
|
14599
|
+
versionId: tileflowIconSetVersionIdSchema,
|
|
14600
|
+
version: z8.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
14601
|
+
packageId: tileflowIconSetPackageIdSchema,
|
|
14602
|
+
contentHash: tileflowIconPackageContentHashSchema,
|
|
14603
|
+
iconIds: idsSchema.min(1)
|
|
14604
|
+
}).strict();
|
|
14605
|
+
var tileflowRenderedIconIdentitySchema = z8.object({
|
|
14606
|
+
kind: z8.literal("rendered-icon"),
|
|
14607
|
+
id: tileflowIconIdSchema,
|
|
14608
|
+
width: z8.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
14609
|
+
height: z8.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
14610
|
+
pixelSha256: z8.object({
|
|
14611
|
+
oneX: tileflowIconPackageContentHashSchema,
|
|
14612
|
+
twoX: tileflowIconPackageContentHashSchema
|
|
14613
|
+
}).strict()
|
|
14614
|
+
}).strict();
|
|
14615
|
+
var tileflowIconCompositionSchema = z8.object({
|
|
14616
|
+
format: z8.literal("tileflow-icon-composition-v1"),
|
|
14617
|
+
compositionVersion: z8.literal(1),
|
|
14618
|
+
packageHash: tileflowIconPackageContentHashSchema,
|
|
14619
|
+
contributors: z8.array(
|
|
14620
|
+
z8.discriminatedUnion("kind", [
|
|
14621
|
+
localContributorSchema,
|
|
14622
|
+
packageContributorSchema,
|
|
14623
|
+
setContributorSchema
|
|
14624
|
+
])
|
|
14625
|
+
).min(1).max(tileflowIconSourceLimit),
|
|
14626
|
+
winners: z8.array(
|
|
14627
|
+
tileflowRenderedIconIdentitySchema.omit({ kind: true }).extend({
|
|
14628
|
+
contributor: z8.number().int().min(0).max(tileflowIconSourceLimit - 1)
|
|
14629
|
+
})
|
|
14630
|
+
).min(1).max(tileflowIconPackageLimits.maxIconCount)
|
|
14631
|
+
}).strict().superRefine((receipt, context) => {
|
|
14632
|
+
const expected = /* @__PURE__ */ new Map();
|
|
14633
|
+
const references = /* @__PURE__ */ new Set();
|
|
14634
|
+
const sets = /* @__PURE__ */ new Set();
|
|
14635
|
+
const versions = /* @__PURE__ */ new Set();
|
|
14636
|
+
const teams = /* @__PURE__ */ new Set();
|
|
14637
|
+
const teamSlugs = /* @__PURE__ */ new Set();
|
|
14638
|
+
for (const [ordinal, contributor] of receipt.contributors.entries()) {
|
|
14639
|
+
if (contributor.kind === "icon-set") {
|
|
14640
|
+
if (references.has(contributor.reference) || sets.has(contributor.setId) || versions.has(contributor.versionId)) {
|
|
14641
|
+
context.addIssue({
|
|
14642
|
+
code: "custom",
|
|
14643
|
+
path: ["contributors", ordinal],
|
|
14644
|
+
message: "Duplicate icon set dependency"
|
|
14645
|
+
});
|
|
14646
|
+
}
|
|
14647
|
+
references.add(contributor.reference);
|
|
14648
|
+
sets.add(contributor.setId);
|
|
14649
|
+
versions.add(contributor.versionId);
|
|
14650
|
+
teams.add(contributor.teamId);
|
|
14651
|
+
teamSlugs.add(contributor.reference.split("/")[0]);
|
|
14652
|
+
}
|
|
14653
|
+
for (const id of contributor.iconIds) expected.set(id, ordinal);
|
|
14654
|
+
}
|
|
14655
|
+
if (teams.size !== 1 || teamSlugs.size !== 1)
|
|
14656
|
+
context.addIssue({
|
|
14657
|
+
code: "custom",
|
|
14658
|
+
path: ["contributors"],
|
|
14659
|
+
message: "A shared composition must contain exact dependencies from one Team"
|
|
14660
|
+
});
|
|
14661
|
+
const names = [...expected.keys()].sort(compareCodeUnits8);
|
|
14662
|
+
if (names.length !== receipt.winners.length || receipt.winners.some(
|
|
14663
|
+
(winner, index) => names[index] !== winner.id || expected.get(winner.id) !== winner.contributor
|
|
14664
|
+
)) {
|
|
14665
|
+
context.addIssue({
|
|
14666
|
+
code: "custom",
|
|
14667
|
+
path: ["winners"],
|
|
14668
|
+
message: "Winners must exactly cover the sorted last-wins export closure"
|
|
14669
|
+
});
|
|
14670
|
+
}
|
|
14671
|
+
if (new TextEncoder().encode(serializeCanonicalJson(receipt)).byteLength > tileflowIconCompositionMaximumBytes) {
|
|
14672
|
+
context.addIssue({ code: "custom", message: "Composition receipt exceeds its byte limit" });
|
|
14673
|
+
}
|
|
14674
|
+
});
|
|
14675
|
+
function parseTileflowIconComposition(input) {
|
|
14676
|
+
const parsed = tileflowIconCompositionSchema.safeParse(input);
|
|
14677
|
+
if (!parsed.success)
|
|
14678
|
+
throw new TileflowIconSetError(
|
|
14679
|
+
"ICON_COMPOSITION_INVALID",
|
|
14680
|
+
"Invalid ordered icon composition receipt",
|
|
14681
|
+
{ cause: parsed.error }
|
|
14682
|
+
);
|
|
14683
|
+
return parsed.data;
|
|
14684
|
+
}
|
|
14685
|
+
|
|
14515
14686
|
// src/map-build-manifest.ts
|
|
14516
14687
|
var tileflowMapRevisionSchemaVersion = 1;
|
|
14688
|
+
var tileflowSharedIconMapRevisionSchemaVersion = 2;
|
|
14517
14689
|
var tileflowMapRevisionCanonicalization = "tileflow-canonical-json-v1";
|
|
14518
14690
|
var tileflowMapBuildManifestSchemaVersion = 1;
|
|
14519
14691
|
var tileflowMapBuildManifestFileName = "build-manifest.json";
|
|
@@ -14553,6 +14725,7 @@ async function createTileflowMapBuildManifest(maps, options = {}) {
|
|
|
14553
14725
|
defaultTheme: map.defaultTheme,
|
|
14554
14726
|
lineage,
|
|
14555
14727
|
mapRevisionSha256,
|
|
14728
|
+
...sourceAssets.iconComposition ? { mapRevisionSchemaVersion: 2 } : {},
|
|
14556
14729
|
mapVersion: map.version,
|
|
14557
14730
|
semanticCompiler: { ...tileflowSemanticCompilerIdentity },
|
|
14558
14731
|
sourceAssets,
|
|
@@ -14628,6 +14801,8 @@ async function hashTileflowMapRevision(input, sourceAssets) {
|
|
|
14628
14801
|
view: _view,
|
|
14629
14802
|
...effectiveCartography
|
|
14630
14803
|
} = map;
|
|
14804
|
+
const normalizedSources = normalizeSourceAssets(sourceAssets);
|
|
14805
|
+
assertIconCompositionMatchesMap(map, normalizedSources);
|
|
14631
14806
|
const revisionDocument = {
|
|
14632
14807
|
canonicalization: tileflowMapRevisionCanonicalization,
|
|
14633
14808
|
effectiveCartography: {
|
|
@@ -14635,10 +14810,11 @@ async function hashTileflowMapRevision(input, sourceAssets) {
|
|
|
14635
14810
|
// The semantic language is map semantics. Its compiler ABI version remains a separate axis.
|
|
14636
14811
|
semanticLanguage: tileflowSemanticCompilerIdentity.name
|
|
14637
14812
|
},
|
|
14638
|
-
schemaVersion: tileflowMapRevisionSchemaVersion,
|
|
14639
|
-
sourceAssets:
|
|
14813
|
+
schemaVersion: normalizedSources.iconComposition ? tileflowSharedIconMapRevisionSchemaVersion : tileflowMapRevisionSchemaVersion,
|
|
14814
|
+
sourceAssets: normalizedSources
|
|
14640
14815
|
};
|
|
14641
|
-
|
|
14816
|
+
const domain = normalizedSources.iconComposition ? "tileflow-map-revision-v2\0" : tileflowMapRevisionDomain;
|
|
14817
|
+
return sha256Hex(`${domain}${serializeCanonicalJson(revisionDocument)}`);
|
|
14642
14818
|
}
|
|
14643
14819
|
function normalizeRevisionCartography(input) {
|
|
14644
14820
|
if (!input.sources) return input;
|
|
@@ -14700,6 +14876,7 @@ function normalizeLineage(input, map) {
|
|
|
14700
14876
|
}
|
|
14701
14877
|
function normalizeSourceAssets(input) {
|
|
14702
14878
|
const icons = [...input.icons].map((icon) => {
|
|
14879
|
+
if (icon.kind === "rendered-icon") return tileflowRenderedIconIdentitySchema.parse(icon);
|
|
14703
14880
|
assertSha256(icon.sha256, `icon ${icon.id}`);
|
|
14704
14881
|
return { ...icon };
|
|
14705
14882
|
}).sort((left, right) => compareCodeUnits8(left.id, right.id));
|
|
@@ -14713,7 +14890,10 @@ function normalizeSourceAssets(input) {
|
|
|
14713
14890
|
if (new Set(fonts.map(fontIdentity)).size !== fonts.length) {
|
|
14714
14891
|
throw new Error("Effective Tileflow font source identities must have unique faces.");
|
|
14715
14892
|
}
|
|
14716
|
-
|
|
14893
|
+
const iconComposition = input.iconComposition === void 0 ? void 0 : parseTileflowIconComposition(input.iconComposition);
|
|
14894
|
+
if (icons.some((icon) => icon.kind === "rendered-icon") && !iconComposition)
|
|
14895
|
+
throw new Error("Rendered icon identities require an explicit composition receipt");
|
|
14896
|
+
return { fonts, icons, ...iconComposition ? { iconComposition } : {} };
|
|
14717
14897
|
}
|
|
14718
14898
|
function fontIdentity(font) {
|
|
14719
14899
|
return `${font.family}\0${font.style}\0${font.weight}`;
|
|
@@ -14728,6 +14908,37 @@ function assertPortableAssetName(value) {
|
|
|
14728
14908
|
throw new Error(`Invalid Tileflow map asset name: ${value}`);
|
|
14729
14909
|
}
|
|
14730
14910
|
}
|
|
14911
|
+
function assertIconCompositionMatchesMap(map, sources) {
|
|
14912
|
+
const declared = map.icons ?? [];
|
|
14913
|
+
const references = collectTileflowIconSetReferences(declared);
|
|
14914
|
+
const receipt = sources.iconComposition;
|
|
14915
|
+
if (references.length === 0 && receipt === void 0) return;
|
|
14916
|
+
if (!receipt || receipt.contributors.length !== declared.length)
|
|
14917
|
+
throw new Error("Shared icon dependencies require their complete ordered composition receipt");
|
|
14918
|
+
for (const [ordinal, source] of declared.entries()) {
|
|
14919
|
+
const contributor = receipt.contributors[ordinal];
|
|
14920
|
+
if (typeof source === "string") {
|
|
14921
|
+
if (contributor.kind !== "local") throw new Error("Icon contributor kind mismatch");
|
|
14922
|
+
} else if (source.kind === "icon-set") {
|
|
14923
|
+
if (contributor.kind !== "icon-set" || contributor.reference !== source.reference)
|
|
14924
|
+
throw new Error("Icon dependency reference mismatch");
|
|
14925
|
+
} else if (contributor.kind !== "package" || contributor.package !== source.package)
|
|
14926
|
+
throw new Error("Package icon contributor mismatch");
|
|
14927
|
+
}
|
|
14928
|
+
if (sources.icons.length !== receipt.winners.length)
|
|
14929
|
+
throw new Error("Effective icon identities must cover the entire winner closure");
|
|
14930
|
+
for (const [ordinal, winner] of receipt.winners.entries()) {
|
|
14931
|
+
const identity = sources.icons[ordinal];
|
|
14932
|
+
if (identity.id !== winner.id) throw new Error("Effective icon identity mismatch");
|
|
14933
|
+
if (receipt.contributors[winner.contributor].kind === "icon-set") {
|
|
14934
|
+
if (identity.kind !== "rendered-icon" || identity.width !== winner.width || identity.height !== winner.height || identity.pixelSha256.oneX !== winner.pixelSha256.oneX || identity.pixelSha256.twoX !== winner.pixelSha256.twoX)
|
|
14935
|
+
throw new Error(
|
|
14936
|
+
"Shared icon identity must match verified rendered pixels, not original-source hashes"
|
|
14937
|
+
);
|
|
14938
|
+
} else if (identity.kind === "rendered-icon")
|
|
14939
|
+
throw new Error("Local originals must retain their existing source identity");
|
|
14940
|
+
}
|
|
14941
|
+
}
|
|
14731
14942
|
|
|
14732
14943
|
// src/style-inspection.ts
|
|
14733
14944
|
function createStyleWithInspection(config, options = {}) {
|
|
@@ -14889,6 +15100,7 @@ export {
|
|
|
14889
15100
|
tileflowMapBuildManifestSchemaVersion,
|
|
14890
15101
|
tileflowMapRevisionCanonicalization,
|
|
14891
15102
|
tileflowMapRevisionSchemaVersion,
|
|
15103
|
+
tileflowSharedIconMapRevisionSchemaVersion,
|
|
14892
15104
|
tileflowStyleInspectionSchemaVersion,
|
|
14893
15105
|
validateTileflowDataCompatibility
|
|
14894
15106
|
};
|