@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/index.js
CHANGED
|
@@ -2160,7 +2160,7 @@ __export(manifest_exports, {
|
|
|
2160
2160
|
tileflowRuntimeManifestSchema: () => tileflowRuntimeManifestSchema,
|
|
2161
2161
|
tileflowRuntimeManifestVersion: () => tileflowRuntimeManifestVersion
|
|
2162
2162
|
});
|
|
2163
|
-
import { z as
|
|
2163
|
+
import { z as z6 } from "zod";
|
|
2164
2164
|
function parseTileflowRuntimeManifest(input) {
|
|
2165
2165
|
return tileflowRuntimeManifestSchema.parse(input);
|
|
2166
2166
|
}
|
|
@@ -2250,43 +2250,43 @@ var init_manifest = __esm({
|
|
|
2250
2250
|
init_themes();
|
|
2251
2251
|
tileflowRuntimeManifestVersion = 1;
|
|
2252
2252
|
tileflowRuntimeManifestLimits = Object.freeze({ maximumBytes: 1024 * 1024 });
|
|
2253
|
-
safeTextSchema =
|
|
2253
|
+
safeTextSchema = z6.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");
|
|
2254
2254
|
publicResourceUrlSchema = safeTextSchema.refine(isPublicResourceUrl, {
|
|
2255
2255
|
message: "Expected an HTTP(S), root-relative, or path-relative public URL"
|
|
2256
2256
|
});
|
|
2257
2257
|
apiOriginSchema = safeTextSchema.refine(isApiOrigin, {
|
|
2258
2258
|
message: "Expected an absolute HTTP(S) origin without path, credentials, query, or fragment"
|
|
2259
2259
|
});
|
|
2260
|
-
viewSchema2 =
|
|
2261
|
-
bearing:
|
|
2262
|
-
center:
|
|
2263
|
-
pitch:
|
|
2264
|
-
zoom:
|
|
2260
|
+
viewSchema2 = z6.object({
|
|
2261
|
+
bearing: z6.number().finite().min(-180).max(180).optional(),
|
|
2262
|
+
center: z6.tuple([z6.number().finite().min(-180).max(180), z6.number().finite().min(-90).max(90)]).optional(),
|
|
2263
|
+
pitch: z6.number().finite().min(0).max(85).optional(),
|
|
2264
|
+
zoom: z6.number().finite().min(0).max(24).optional()
|
|
2265
2265
|
}).strict();
|
|
2266
|
-
fontFaceSchema =
|
|
2266
|
+
fontFaceSchema = z6.object({
|
|
2267
2267
|
family: safeTextSchema.max(100),
|
|
2268
2268
|
source: publicResourceUrlSchema,
|
|
2269
|
-
style:
|
|
2270
|
-
weight:
|
|
2269
|
+
style: z6.enum(["italic", "normal", "oblique"]).optional(),
|
|
2270
|
+
weight: z6.enum(["100", "200", "300", "400", "500", "600", "700", "800", "900"]).optional()
|
|
2271
2271
|
}).strict();
|
|
2272
|
-
fontFacesSchema =
|
|
2273
|
-
manifestThemeSchema =
|
|
2274
|
-
colorScheme:
|
|
2272
|
+
fontFacesSchema = z6.array(fontFaceSchema).max(16).superRefine(validateUniqueFontFaces);
|
|
2273
|
+
manifestThemeSchema = z6.object({
|
|
2274
|
+
colorScheme: z6.enum(["dark", "light"]),
|
|
2275
2275
|
fontFaces: fontFacesSchema.optional(),
|
|
2276
2276
|
revision: safeTextSchema.max(128).optional(),
|
|
2277
2277
|
styleId: safeTextSchema.max(128).optional(),
|
|
2278
2278
|
styleUrl: publicResourceUrlSchema
|
|
2279
2279
|
}).strict();
|
|
2280
|
-
manifestMapSchema =
|
|
2280
|
+
manifestMapSchema = z6.object({
|
|
2281
2281
|
apiUrl: apiOriginSchema.optional(),
|
|
2282
2282
|
defaultTheme: tileflowThemeNameSchema,
|
|
2283
2283
|
environment: safeTextSchema.max(128).optional(),
|
|
2284
2284
|
mapId: safeTextSchema.max(128).optional(),
|
|
2285
|
-
systemThemes:
|
|
2286
|
-
themes:
|
|
2287
|
-
usageMode:
|
|
2285
|
+
systemThemes: z6.object({ dark: tileflowThemeNameSchema, light: tileflowThemeNameSchema }).strict().optional(),
|
|
2286
|
+
themes: z6.record(tileflowThemeNameSchema, manifestThemeSchema),
|
|
2287
|
+
usageMode: z6.literal("session").optional(),
|
|
2288
2288
|
view: viewSchema2.optional(),
|
|
2289
|
-
worldGeneration:
|
|
2289
|
+
worldGeneration: z6.literal("v1").optional()
|
|
2290
2290
|
}).strict().superRefine((entry, context) => {
|
|
2291
2291
|
const names = Object.keys(entry.themes);
|
|
2292
2292
|
if (names.length === 0) {
|
|
@@ -2333,10 +2333,10 @@ var init_manifest = __esm({
|
|
|
2333
2333
|
});
|
|
2334
2334
|
}
|
|
2335
2335
|
});
|
|
2336
|
-
canonicalManifestSchema =
|
|
2336
|
+
canonicalManifestSchema = z6.object({
|
|
2337
2337
|
apiUrl: apiOriginSchema.optional(),
|
|
2338
|
-
maps:
|
|
2339
|
-
version:
|
|
2338
|
+
maps: z6.record(tileflowPortableIdSchema, manifestMapSchema),
|
|
2339
|
+
version: z6.literal(tileflowRuntimeManifestVersion)
|
|
2340
2340
|
}).strict().superRefine((manifest, context) => {
|
|
2341
2341
|
const mapCount = Object.keys(manifest.maps).length;
|
|
2342
2342
|
if (mapCount === 0) {
|
|
@@ -2354,7 +2354,7 @@ var init_manifest = __esm({
|
|
|
2354
2354
|
});
|
|
2355
2355
|
}
|
|
2356
2356
|
});
|
|
2357
|
-
safeManifestInputSchema =
|
|
2357
|
+
safeManifestInputSchema = z6.unknown().superRefine((input, context) => {
|
|
2358
2358
|
const unsafe = findUnsafeManifestStructure(input);
|
|
2359
2359
|
if (unsafe) {
|
|
2360
2360
|
context.addIssue({
|
|
@@ -7756,10 +7756,10 @@ function roadWidth(roadClass, scale) {
|
|
|
7756
7756
|
[16, 3.4]
|
|
7757
7757
|
]
|
|
7758
7758
|
};
|
|
7759
|
-
return zoom.linear(stops[roadClass].map(([
|
|
7759
|
+
return zoom.linear(stops[roadClass].map(([z12, value]) => [z12, value * scale]));
|
|
7760
7760
|
}
|
|
7761
7761
|
function widen(value, addition) {
|
|
7762
|
-
return zoom.linear(value.stops.map(([
|
|
7762
|
+
return zoom.linear(value.stops.map(([z12, width]) => [z12, width + addition]));
|
|
7763
7763
|
}
|
|
7764
7764
|
function structureFilter(field2, structure) {
|
|
7765
7765
|
if (structure === "surface") {
|
|
@@ -9469,8 +9469,68 @@ function assertNever(value) {
|
|
|
9469
9469
|
throw new Error(`Unsupported Tileflow map merge strategy: ${String(value)}`);
|
|
9470
9470
|
}
|
|
9471
9471
|
|
|
9472
|
-
// src/
|
|
9472
|
+
// src/icon-set.ts
|
|
9473
9473
|
import { z as z4 } from "zod";
|
|
9474
|
+
var tileflowIconSourceLimit = 32;
|
|
9475
|
+
var slug = "[a-z0-9]+(?:-[a-z0-9]+)*";
|
|
9476
|
+
var tileflowIconSetReferenceSchema = z4.string().max(130).regex(
|
|
9477
|
+
new RegExp(`^@${slug}/${slug}$`, "u"),
|
|
9478
|
+
"Expected a canonical @team/set reference without a version suffix"
|
|
9479
|
+
).refine(
|
|
9480
|
+
(value) => value.slice(1).split("/").every((part) => part.length <= 64),
|
|
9481
|
+
"Team and set slugs must contain at most 64 characters"
|
|
9482
|
+
);
|
|
9483
|
+
var tileflowIconSetSourceSchema = z4.object({
|
|
9484
|
+
kind: z4.literal("icon-set"),
|
|
9485
|
+
reference: tileflowIconSetReferenceSchema
|
|
9486
|
+
}).strict();
|
|
9487
|
+
function iconSet(reference) {
|
|
9488
|
+
return Object.freeze(
|
|
9489
|
+
tileflowIconSetSourceSchema.parse({ kind: "icon-set", reference })
|
|
9490
|
+
);
|
|
9491
|
+
}
|
|
9492
|
+
function isTileflowIconSetSource(value) {
|
|
9493
|
+
return tileflowIconSetSourceSchema.safeParse(value).success;
|
|
9494
|
+
}
|
|
9495
|
+
var tileflowIconSetIdSchema = z4.string().regex(/^ics_[A-Za-z0-9_-]{16}$/u);
|
|
9496
|
+
var tileflowIconSetVersionIdSchema = z4.string().regex(/^icv_[A-Za-z0-9_-]{16}$/u);
|
|
9497
|
+
var tileflowIconSetPackageIdSchema = z4.string().regex(/^icp_[A-Za-z0-9_-]{16,64}$/u);
|
|
9498
|
+
var tileflowIconSetTeamIdSchema = z4.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/u);
|
|
9499
|
+
var TileflowIconSetError = class extends Error {
|
|
9500
|
+
constructor(code, message, options) {
|
|
9501
|
+
super(message, options);
|
|
9502
|
+
this.code = code;
|
|
9503
|
+
this.name = "TileflowIconSetError";
|
|
9504
|
+
}
|
|
9505
|
+
code;
|
|
9506
|
+
phase = "icon-resolution";
|
|
9507
|
+
};
|
|
9508
|
+
function collectTileflowIconSetReferences(sources) {
|
|
9509
|
+
if (sources.length > tileflowIconSourceLimit) {
|
|
9510
|
+
throw new TileflowIconSetError(
|
|
9511
|
+
"ICON_SET_INVALID",
|
|
9512
|
+
`A map supports at most ${tileflowIconSourceLimit} icon contributors`
|
|
9513
|
+
);
|
|
9514
|
+
}
|
|
9515
|
+
const references = [];
|
|
9516
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9517
|
+
for (const source of sources) {
|
|
9518
|
+
if (typeof source !== "object" || source === null || source.kind !== "icon-set") continue;
|
|
9519
|
+
const parsed = tileflowIconSetSourceSchema.safeParse(source);
|
|
9520
|
+
if (!parsed.success || seen.has(source.reference)) {
|
|
9521
|
+
throw new TileflowIconSetError(
|
|
9522
|
+
"ICON_SET_INVALID",
|
|
9523
|
+
"Icon set references must be canonical and unique within a map"
|
|
9524
|
+
);
|
|
9525
|
+
}
|
|
9526
|
+
seen.add(source.reference);
|
|
9527
|
+
references.push(source.reference);
|
|
9528
|
+
}
|
|
9529
|
+
return references;
|
|
9530
|
+
}
|
|
9531
|
+
|
|
9532
|
+
// src/resolved-map-schema.ts
|
|
9533
|
+
import { z as z5 } from "zod";
|
|
9474
9534
|
|
|
9475
9535
|
// src/cartography/data-expression.ts
|
|
9476
9536
|
init_values();
|
|
@@ -11510,11 +11570,11 @@ var TileflowResolvedMapValidationError = class extends Error {
|
|
|
11510
11570
|
this.messages = messages;
|
|
11511
11571
|
}
|
|
11512
11572
|
};
|
|
11513
|
-
var identifierSchema =
|
|
11514
|
-
var revisionSchema =
|
|
11515
|
-
var zoomNumberSchema =
|
|
11573
|
+
var identifierSchema = z5.string().trim().regex(/^[A-Za-z0-9_-]+$/, "Expected letters, numbers, underscores, or hyphens").refine((value) => value !== "__proto__", "Expected a safe identifier");
|
|
11574
|
+
var revisionSchema = z5.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/, "Expected a portable data revision");
|
|
11575
|
+
var zoomNumberSchema = z5.number().finite().min(0).max(24);
|
|
11516
11576
|
function zoomValueSchemaFor(valueSchema) {
|
|
11517
|
-
const stops =
|
|
11577
|
+
const stops = z5.array(z5.tuple([zoomNumberSchema, valueSchema])).min(1).superRefine((entries, context) => {
|
|
11518
11578
|
for (let index = 1; index < entries.length; index += 1) {
|
|
11519
11579
|
if (entries[index][0] <= entries[index - 1][0]) {
|
|
11520
11580
|
context.addIssue({
|
|
@@ -11525,105 +11585,105 @@ function zoomValueSchemaFor(valueSchema) {
|
|
|
11525
11585
|
}
|
|
11526
11586
|
}
|
|
11527
11587
|
});
|
|
11528
|
-
return
|
|
11529
|
-
|
|
11530
|
-
base:
|
|
11531
|
-
interpolation:
|
|
11532
|
-
kind:
|
|
11588
|
+
return z5.discriminatedUnion("interpolation", [
|
|
11589
|
+
z5.object({
|
|
11590
|
+
base: z5.number().finite().positive(),
|
|
11591
|
+
interpolation: z5.literal("exponential"),
|
|
11592
|
+
kind: z5.literal("zoom"),
|
|
11533
11593
|
stops
|
|
11534
11594
|
}).strict(),
|
|
11535
|
-
|
|
11536
|
-
interpolation:
|
|
11537
|
-
kind:
|
|
11595
|
+
z5.object({
|
|
11596
|
+
interpolation: z5.literal("linear"),
|
|
11597
|
+
kind: z5.literal("zoom"),
|
|
11538
11598
|
stops
|
|
11539
11599
|
}).strict(),
|
|
11540
|
-
|
|
11541
|
-
interpolation:
|
|
11542
|
-
kind:
|
|
11600
|
+
z5.object({
|
|
11601
|
+
interpolation: z5.literal("step"),
|
|
11602
|
+
kind: z5.literal("zoom"),
|
|
11543
11603
|
stops
|
|
11544
11604
|
}).strict()
|
|
11545
11605
|
]);
|
|
11546
11606
|
}
|
|
11547
|
-
var themeTokenNameSchema =
|
|
11607
|
+
var themeTokenNameSchema = z5.string().regex(
|
|
11548
11608
|
/^[A-Za-z][A-Za-z0-9_-]*(?:\.[A-Za-z][A-Za-z0-9_-]*)*$/,
|
|
11549
11609
|
"Expected a portable dot-separated semantic token name"
|
|
11550
11610
|
);
|
|
11551
|
-
var themeTokenReferenceSchema =
|
|
11552
|
-
category:
|
|
11553
|
-
kind:
|
|
11611
|
+
var themeTokenReferenceSchema = z5.object({
|
|
11612
|
+
category: z5.enum(tileflowThemeTokenCategories),
|
|
11613
|
+
kind: z5.literal("theme-token"),
|
|
11554
11614
|
token: themeTokenNameSchema
|
|
11555
11615
|
}).strict();
|
|
11556
11616
|
var themeNumberReferenceSchema = themeTokenReferenceSchema.extend({
|
|
11557
|
-
category:
|
|
11617
|
+
category: z5.literal("number")
|
|
11558
11618
|
});
|
|
11559
|
-
var fixedNumberSchema =
|
|
11560
|
-
kind:
|
|
11561
|
-
reason:
|
|
11562
|
-
value:
|
|
11619
|
+
var fixedNumberSchema = z5.object({
|
|
11620
|
+
kind: z5.literal("theme-fixed"),
|
|
11621
|
+
reason: z5.string().trim().min(1),
|
|
11622
|
+
value: z5.number().finite()
|
|
11563
11623
|
}).strict();
|
|
11564
|
-
var fixedNumberArraySchema =
|
|
11565
|
-
kind:
|
|
11566
|
-
reason:
|
|
11567
|
-
value:
|
|
11624
|
+
var fixedNumberArraySchema = z5.object({
|
|
11625
|
+
kind: z5.literal("theme-fixed"),
|
|
11626
|
+
reason: z5.string().trim().min(1),
|
|
11627
|
+
value: z5.array(z5.number().finite())
|
|
11568
11628
|
}).strict();
|
|
11569
|
-
var fixedNumberOffsetSchema =
|
|
11570
|
-
kind:
|
|
11571
|
-
reason:
|
|
11572
|
-
value:
|
|
11629
|
+
var fixedNumberOffsetSchema = z5.object({
|
|
11630
|
+
kind: z5.literal("theme-fixed"),
|
|
11631
|
+
reason: z5.string().trim().min(1),
|
|
11632
|
+
value: z5.tuple([z5.number().finite(), z5.number().finite()])
|
|
11573
11633
|
}).strict();
|
|
11574
|
-
var fixedNumberInsetsSchema =
|
|
11575
|
-
kind:
|
|
11576
|
-
reason:
|
|
11577
|
-
value:
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11634
|
+
var fixedNumberInsetsSchema = z5.object({
|
|
11635
|
+
kind: z5.literal("theme-fixed"),
|
|
11636
|
+
reason: z5.string().trim().min(1),
|
|
11637
|
+
value: z5.tuple([
|
|
11638
|
+
z5.number().finite(),
|
|
11639
|
+
z5.number().finite(),
|
|
11640
|
+
z5.number().finite(),
|
|
11641
|
+
z5.number().finite()
|
|
11582
11642
|
])
|
|
11583
11643
|
}).strict();
|
|
11584
|
-
var fixedStringSchema =
|
|
11585
|
-
var themeColorOperationSchema =
|
|
11586
|
-
() =>
|
|
11587
|
-
|
|
11644
|
+
var fixedStringSchema = z5.object({ kind: z5.literal("theme-fixed"), reason: z5.string().trim().min(1), value: z5.string() }).strict();
|
|
11645
|
+
var themeColorOperationSchema = z5.lazy(
|
|
11646
|
+
() => z5.discriminatedUnion("operation", [
|
|
11647
|
+
z5.object({
|
|
11588
11648
|
color: themeColorValueSchema,
|
|
11589
|
-
kind:
|
|
11649
|
+
kind: z5.literal("theme-color"),
|
|
11590
11650
|
opacity: themeNumberValueSchema,
|
|
11591
|
-
operation:
|
|
11651
|
+
operation: z5.literal("alpha")
|
|
11592
11652
|
}).strict(),
|
|
11593
|
-
|
|
11653
|
+
z5.object({
|
|
11594
11654
|
amount: themeNumberValueSchema,
|
|
11595
11655
|
from: themeColorValueSchema,
|
|
11596
|
-
kind:
|
|
11597
|
-
operation:
|
|
11598
|
-
space:
|
|
11656
|
+
kind: z5.literal("theme-color"),
|
|
11657
|
+
operation: z5.literal("mix"),
|
|
11658
|
+
space: z5.literal("oklch"),
|
|
11599
11659
|
to: themeColorValueSchema
|
|
11600
11660
|
}).strict()
|
|
11601
11661
|
])
|
|
11602
11662
|
);
|
|
11603
|
-
var themeNumberValueSchema =
|
|
11604
|
-
() =>
|
|
11663
|
+
var themeNumberValueSchema = z5.lazy(
|
|
11664
|
+
() => z5.union([z5.number().finite(), fixedNumberSchema, themeNumberReferenceSchema])
|
|
11605
11665
|
);
|
|
11606
|
-
var themeColorValueSchema =
|
|
11607
|
-
() =>
|
|
11608
|
-
|
|
11666
|
+
var themeColorValueSchema = z5.lazy(
|
|
11667
|
+
() => z5.union([
|
|
11668
|
+
z5.string().min(1),
|
|
11609
11669
|
fixedStringSchema,
|
|
11610
|
-
themeTokenReferenceSchema.extend({ category:
|
|
11670
|
+
themeTokenReferenceSchema.extend({ category: z5.literal("color") }),
|
|
11611
11671
|
themeColorOperationSchema
|
|
11612
11672
|
])
|
|
11613
11673
|
);
|
|
11614
|
-
var themeFontValueSchema =
|
|
11615
|
-
|
|
11674
|
+
var themeFontValueSchema = z5.union([
|
|
11675
|
+
z5.string().min(1),
|
|
11616
11676
|
fixedStringSchema,
|
|
11617
|
-
themeTokenReferenceSchema.extend({ category:
|
|
11677
|
+
themeTokenReferenceSchema.extend({ category: z5.literal("font") })
|
|
11618
11678
|
]);
|
|
11619
|
-
var themeImageValueSchema =
|
|
11620
|
-
|
|
11679
|
+
var themeImageValueSchema = z5.union([
|
|
11680
|
+
z5.string().min(1),
|
|
11621
11681
|
fixedStringSchema,
|
|
11622
|
-
themeTokenReferenceSchema.extend({ category:
|
|
11682
|
+
themeTokenReferenceSchema.extend({ category: z5.literal("image") })
|
|
11623
11683
|
]);
|
|
11624
11684
|
function expressionSchemaFor(expectedCategory) {
|
|
11625
11685
|
const category = expectedCategory ?? "structural";
|
|
11626
|
-
return
|
|
11686
|
+
return z5.object({ kind: z5.literal("expression"), value: z5.array(z5.unknown()).min(1) }).strict().superRefine((expression2, context) => {
|
|
11627
11687
|
for (const issue of validateTileflowDataExpression(expression2.value)) {
|
|
11628
11688
|
context.addIssue({
|
|
11629
11689
|
code: "custom",
|
|
@@ -11677,7 +11737,7 @@ function validateExpressionThemeValues(value, expectedCategory, context, path) {
|
|
|
11677
11737
|
return;
|
|
11678
11738
|
}
|
|
11679
11739
|
if (candidate.kind === "theme-fixed") {
|
|
11680
|
-
const parsed = expectedCategory === "number" ?
|
|
11740
|
+
const parsed = expectedCategory === "number" ? z5.union([fixedNumberSchema, fixedNumberArraySchema]).safeParse(candidate) : expectedCategory === "color" || expectedCategory === "image" ? fixedStringSchema.safeParse(candidate) : void 0;
|
|
11681
11741
|
if (!parsed?.success) {
|
|
11682
11742
|
context.addIssue({
|
|
11683
11743
|
code: "custom",
|
|
@@ -11708,71 +11768,71 @@ var structuralExpressionSchema = expressionSchemaFor(void 0);
|
|
|
11708
11768
|
var numberZoomValueSchema = zoomValueSchemaFor(themeNumberValueSchema);
|
|
11709
11769
|
var colorZoomValueSchema = zoomValueSchemaFor(themeColorValueSchema);
|
|
11710
11770
|
var imageZoomValueSchema = zoomValueSchemaFor(themeImageValueSchema);
|
|
11711
|
-
var stringZoomValueSchema = zoomValueSchemaFor(
|
|
11712
|
-
var numberValueSchema =
|
|
11771
|
+
var stringZoomValueSchema = zoomValueSchemaFor(z5.string());
|
|
11772
|
+
var numberValueSchema = z5.union([
|
|
11713
11773
|
themeNumberValueSchema,
|
|
11714
11774
|
numberExpressionSchema,
|
|
11715
11775
|
numberZoomValueSchema
|
|
11716
11776
|
]);
|
|
11717
|
-
var structuralNumberValueSchema =
|
|
11718
|
-
|
|
11777
|
+
var structuralNumberValueSchema = z5.union([
|
|
11778
|
+
z5.number().finite(),
|
|
11719
11779
|
structuralExpressionSchema,
|
|
11720
|
-
zoomValueSchemaFor(
|
|
11780
|
+
zoomValueSchemaFor(z5.number().finite())
|
|
11721
11781
|
]);
|
|
11722
|
-
var colorValueSchema =
|
|
11782
|
+
var colorValueSchema = z5.union([
|
|
11723
11783
|
themeColorValueSchema,
|
|
11724
11784
|
colorExpressionSchema,
|
|
11725
11785
|
colorZoomValueSchema
|
|
11726
11786
|
]);
|
|
11727
|
-
var imageValueSchema =
|
|
11787
|
+
var imageValueSchema = z5.union([
|
|
11728
11788
|
themeImageValueSchema,
|
|
11729
11789
|
imageExpressionSchema,
|
|
11730
11790
|
imageZoomValueSchema
|
|
11731
11791
|
]);
|
|
11732
|
-
var stringValueSchema =
|
|
11733
|
-
var themeNumberArraySchema =
|
|
11734
|
-
var themeNumberArrayValueSchema =
|
|
11735
|
-
var numberArrayValueSchema =
|
|
11792
|
+
var stringValueSchema = z5.union([z5.string(), structuralExpressionSchema, stringZoomValueSchema]);
|
|
11793
|
+
var themeNumberArraySchema = z5.array(themeNumberValueSchema);
|
|
11794
|
+
var themeNumberArrayValueSchema = z5.union([themeNumberArraySchema, fixedNumberArraySchema]);
|
|
11795
|
+
var numberArrayValueSchema = z5.union([
|
|
11736
11796
|
themeNumberArrayValueSchema,
|
|
11737
11797
|
numberExpressionSchema,
|
|
11738
11798
|
zoomValueSchemaFor(themeNumberArrayValueSchema)
|
|
11739
11799
|
]);
|
|
11740
|
-
var themeNumberOffsetSchema =
|
|
11741
|
-
var themeNumberOffsetValueSchema =
|
|
11742
|
-
var numberOffsetValueSchema =
|
|
11800
|
+
var themeNumberOffsetSchema = z5.tuple([themeNumberValueSchema, themeNumberValueSchema]);
|
|
11801
|
+
var themeNumberOffsetValueSchema = z5.union([themeNumberOffsetSchema, fixedNumberOffsetSchema]);
|
|
11802
|
+
var numberOffsetValueSchema = z5.union([
|
|
11743
11803
|
themeNumberOffsetValueSchema,
|
|
11744
11804
|
numberExpressionSchema,
|
|
11745
11805
|
zoomValueSchemaFor(themeNumberOffsetValueSchema)
|
|
11746
11806
|
]);
|
|
11747
|
-
var themeNumberInsetsSchema =
|
|
11807
|
+
var themeNumberInsetsSchema = z5.tuple([
|
|
11748
11808
|
themeNumberValueSchema,
|
|
11749
11809
|
themeNumberValueSchema,
|
|
11750
11810
|
themeNumberValueSchema,
|
|
11751
11811
|
themeNumberValueSchema
|
|
11752
11812
|
]);
|
|
11753
|
-
var themeNumberInsetsValueSchema =
|
|
11754
|
-
var numberInsetsValueSchema =
|
|
11813
|
+
var themeNumberInsetsValueSchema = z5.union([themeNumberInsetsSchema, fixedNumberInsetsSchema]);
|
|
11814
|
+
var numberInsetsValueSchema = z5.union([
|
|
11755
11815
|
themeNumberInsetsValueSchema,
|
|
11756
11816
|
numberExpressionSchema,
|
|
11757
11817
|
zoomValueSchemaFor(themeNumberInsetsValueSchema)
|
|
11758
11818
|
]);
|
|
11759
|
-
var lineCapSchema =
|
|
11760
|
-
var lineCapValueSchema =
|
|
11819
|
+
var lineCapSchema = z5.enum(["butt", "round", "square"]);
|
|
11820
|
+
var lineCapValueSchema = z5.union([
|
|
11761
11821
|
lineCapSchema,
|
|
11762
11822
|
structuralExpressionSchema,
|
|
11763
11823
|
zoomValueSchemaFor(lineCapSchema)
|
|
11764
11824
|
]);
|
|
11765
|
-
var lineJoinSchema =
|
|
11766
|
-
var lineJoinValueSchema =
|
|
11825
|
+
var lineJoinSchema = z5.enum(["bevel", "miter", "round"]);
|
|
11826
|
+
var lineJoinValueSchema = z5.union([
|
|
11767
11827
|
lineJoinSchema,
|
|
11768
11828
|
structuralExpressionSchema,
|
|
11769
11829
|
zoomValueSchemaFor(lineJoinSchema)
|
|
11770
11830
|
]);
|
|
11771
|
-
var exactFontFaceSchema =
|
|
11831
|
+
var exactFontFaceSchema = z5.string().min(1).max(100).refine(
|
|
11772
11832
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\]/u.test(value),
|
|
11773
11833
|
"Expected an exact NFC font face name without surrounding whitespace, controls, or backslashes"
|
|
11774
11834
|
);
|
|
11775
|
-
var fontFallbacksSchema =
|
|
11835
|
+
var fontFallbacksSchema = z5.array(exactFontFaceSchema).max(8).superRefine((fallbacks, context) => {
|
|
11776
11836
|
const seen = /* @__PURE__ */ new Set();
|
|
11777
11837
|
for (const [index, fallback] of fallbacks.entries()) {
|
|
11778
11838
|
if (seen.has(fallback)) {
|
|
@@ -11785,16 +11845,16 @@ var fontFallbacksSchema = z4.array(exactFontFaceSchema).max(8).superRefine((fall
|
|
|
11785
11845
|
seen.add(fallback);
|
|
11786
11846
|
}
|
|
11787
11847
|
});
|
|
11788
|
-
var moduleFontValueSchema =
|
|
11848
|
+
var moduleFontValueSchema = z5.union([
|
|
11789
11849
|
exactFontFaceSchema,
|
|
11790
11850
|
fixedStringSchema,
|
|
11791
|
-
themeTokenReferenceSchema.extend({ category:
|
|
11851
|
+
themeTokenReferenceSchema.extend({ category: z5.literal("font") })
|
|
11792
11852
|
]);
|
|
11793
|
-
var moduleFontFallbacksSchema =
|
|
11794
|
-
var hexColorSchema =
|
|
11853
|
+
var moduleFontFallbacksSchema = z5.array(moduleFontValueSchema).max(8);
|
|
11854
|
+
var hexColorSchema = z5.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, {
|
|
11795
11855
|
message: "Expected a hex color like #F6F7F3 or #F6F7F3FF"
|
|
11796
11856
|
});
|
|
11797
|
-
var rgbColorSchema =
|
|
11857
|
+
var rgbColorSchema = z5.string().refine((value) => {
|
|
11798
11858
|
const match2 = value.match(
|
|
11799
11859
|
/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d+(?:\.\d+)?))?\s*\)$/iu
|
|
11800
11860
|
);
|
|
@@ -11803,21 +11863,21 @@ var rgbColorSchema = z4.string().refine((value) => {
|
|
|
11803
11863
|
const alpha2 = Number(match2[4] ?? 1);
|
|
11804
11864
|
return channels.every((channel) => channel >= 0 && channel <= 255) && alpha2 >= 0 && alpha2 <= 1;
|
|
11805
11865
|
}, "Expected a Tileflow hex, rgb(), or rgba() color");
|
|
11806
|
-
var terrainColorLiteralSchema =
|
|
11807
|
-
var terrainColorValueSchema =
|
|
11866
|
+
var terrainColorLiteralSchema = z5.union([hexColorSchema, rgbColorSchema]);
|
|
11867
|
+
var terrainColorValueSchema = z5.union([
|
|
11808
11868
|
terrainColorLiteralSchema,
|
|
11809
11869
|
fixedStringSchema.extend({ value: terrainColorLiteralSchema }),
|
|
11810
|
-
themeTokenReferenceSchema.extend({ category:
|
|
11870
|
+
themeTokenReferenceSchema.extend({ category: z5.literal("color") }),
|
|
11811
11871
|
themeColorOperationSchema
|
|
11812
11872
|
]);
|
|
11813
11873
|
function terrainNumberValueSchema(schema) {
|
|
11814
|
-
return
|
|
11874
|
+
return z5.union([schema, fixedNumberSchema.extend({ value: schema }), themeNumberReferenceSchema]);
|
|
11815
11875
|
}
|
|
11816
|
-
var themeTypographyStyleSchema =
|
|
11817
|
-
fallbacks:
|
|
11876
|
+
var themeTypographyStyleSchema = z5.object({
|
|
11877
|
+
fallbacks: z5.array(themeFontValueSchema).max(8).optional(),
|
|
11818
11878
|
font: themeFontValueSchema.optional(),
|
|
11819
11879
|
letterSpacing: themeNumberValueSchema.optional(),
|
|
11820
|
-
transform:
|
|
11880
|
+
transform: z5.enum(["lowercase", "none", "uppercase"]).optional()
|
|
11821
11881
|
}).strict();
|
|
11822
11882
|
var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
11823
11883
|
places: themeTypographyStyleSchema.optional(),
|
|
@@ -11825,46 +11885,46 @@ var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
|
11825
11885
|
roads: themeTypographyStyleSchema.optional(),
|
|
11826
11886
|
water: themeTypographyStyleSchema.optional()
|
|
11827
11887
|
});
|
|
11828
|
-
var themeLightingSchema =
|
|
11829
|
-
anchor:
|
|
11888
|
+
var themeLightingSchema = z5.object({
|
|
11889
|
+
anchor: z5.enum(["map", "viewport"]).optional(),
|
|
11830
11890
|
color: themeColorValueSchema.optional(),
|
|
11831
11891
|
intensity: themeNumberValueSchema.optional(),
|
|
11832
|
-
position:
|
|
11892
|
+
position: z5.tuple([themeNumberValueSchema, themeNumberValueSchema, themeNumberValueSchema]).optional()
|
|
11833
11893
|
}).strict();
|
|
11834
|
-
var tileflowThemeSchema =
|
|
11835
|
-
colorScheme:
|
|
11894
|
+
var tileflowThemeSchema = z5.object({
|
|
11895
|
+
colorScheme: z5.enum(["light", "dark"]),
|
|
11836
11896
|
id: tileflowThemeNameSchema,
|
|
11837
11897
|
lighting: themeLightingSchema,
|
|
11838
|
-
tokens:
|
|
11839
|
-
color:
|
|
11840
|
-
font:
|
|
11841
|
-
image:
|
|
11842
|
-
number:
|
|
11898
|
+
tokens: z5.object({
|
|
11899
|
+
color: z5.record(themeTokenNameSchema, themeColorValueSchema),
|
|
11900
|
+
font: z5.record(themeTokenNameSchema, themeFontValueSchema),
|
|
11901
|
+
image: z5.record(themeTokenNameSchema, themeImageValueSchema),
|
|
11902
|
+
number: z5.record(themeTokenNameSchema, themeNumberValueSchema)
|
|
11843
11903
|
}).strict(),
|
|
11844
11904
|
typography: themeTypographySchema,
|
|
11845
|
-
version:
|
|
11905
|
+
version: z5.number().int().positive()
|
|
11846
11906
|
}).strict();
|
|
11847
11907
|
var rangeShape = {
|
|
11848
11908
|
maxZoom: zoomNumberSchema.optional(),
|
|
11849
11909
|
minZoom: zoomNumberSchema.optional(),
|
|
11850
|
-
visible:
|
|
11910
|
+
visible: z5.boolean().optional()
|
|
11851
11911
|
};
|
|
11852
|
-
var backgroundStyleSchema =
|
|
11912
|
+
var backgroundStyleSchema = z5.object({
|
|
11853
11913
|
...rangeShape,
|
|
11854
11914
|
color: colorValueSchema.optional(),
|
|
11855
11915
|
opacity: numberValueSchema.optional(),
|
|
11856
11916
|
pattern: imageValueSchema.optional()
|
|
11857
11917
|
}).strict();
|
|
11858
|
-
var fillStyleSchema =
|
|
11918
|
+
var fillStyleSchema = z5.object({
|
|
11859
11919
|
...rangeShape,
|
|
11860
|
-
antialias:
|
|
11920
|
+
antialias: z5.boolean().optional(),
|
|
11861
11921
|
color: colorValueSchema.optional(),
|
|
11862
11922
|
opacity: numberValueSchema.optional(),
|
|
11863
11923
|
pattern: imageValueSchema.optional(),
|
|
11864
11924
|
translate: numberOffsetValueSchema.optional(),
|
|
11865
|
-
translateAnchor:
|
|
11925
|
+
translateAnchor: z5.enum(["map", "viewport"]).optional()
|
|
11866
11926
|
}).strict();
|
|
11867
|
-
var lineStyleSchema =
|
|
11927
|
+
var lineStyleSchema = z5.object({
|
|
11868
11928
|
...rangeShape,
|
|
11869
11929
|
blur: numberValueSchema.optional(),
|
|
11870
11930
|
cap: lineCapValueSchema.optional(),
|
|
@@ -11878,13 +11938,13 @@ var lineStyleSchema = z4.object({
|
|
|
11878
11938
|
pattern: imageValueSchema.optional(),
|
|
11879
11939
|
roundLimit: numberValueSchema.optional(),
|
|
11880
11940
|
translate: numberOffsetValueSchema.optional(),
|
|
11881
|
-
translateAnchor:
|
|
11941
|
+
translateAnchor: z5.enum(["map", "viewport"]).optional(),
|
|
11882
11942
|
width: numberValueSchema.optional()
|
|
11883
11943
|
}).strict();
|
|
11884
|
-
var textStyleSchema =
|
|
11944
|
+
var textStyleSchema = z5.object({
|
|
11885
11945
|
...rangeShape,
|
|
11886
|
-
allowOverlap:
|
|
11887
|
-
anchor:
|
|
11946
|
+
allowOverlap: z5.boolean().optional(),
|
|
11947
|
+
anchor: z5.enum([
|
|
11888
11948
|
"bottom",
|
|
11889
11949
|
"bottom-left",
|
|
11890
11950
|
"bottom-right",
|
|
@@ -11902,25 +11962,25 @@ var textStyleSchema = z4.object({
|
|
|
11902
11962
|
haloBlur: numberValueSchema.optional(),
|
|
11903
11963
|
haloColor: colorValueSchema.optional(),
|
|
11904
11964
|
haloWidth: numberValueSchema.optional(),
|
|
11905
|
-
ignorePlacement:
|
|
11906
|
-
justify:
|
|
11907
|
-
keepUpright:
|
|
11965
|
+
ignorePlacement: z5.boolean().optional(),
|
|
11966
|
+
justify: z5.enum(["auto", "center", "left", "right"]).optional(),
|
|
11967
|
+
keepUpright: z5.boolean().optional(),
|
|
11908
11968
|
letterSpacing: numberValueSchema.optional(),
|
|
11909
11969
|
lineHeight: numberValueSchema.optional(),
|
|
11910
11970
|
maxAngle: numberValueSchema.optional(),
|
|
11911
11971
|
maxWidth: numberValueSchema.optional(),
|
|
11912
11972
|
offset: numberOffsetValueSchema.optional(),
|
|
11913
|
-
optional:
|
|
11973
|
+
optional: z5.boolean().optional(),
|
|
11914
11974
|
opacity: numberValueSchema.optional(),
|
|
11915
11975
|
padding: numberValueSchema.optional(),
|
|
11916
|
-
pitchAlignment:
|
|
11976
|
+
pitchAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
11917
11977
|
radialOffset: numberValueSchema.optional(),
|
|
11918
11978
|
rotate: numberValueSchema.optional(),
|
|
11919
|
-
rotationAlignment:
|
|
11979
|
+
rotationAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
11920
11980
|
size: numberValueSchema.optional(),
|
|
11921
|
-
transform:
|
|
11922
|
-
variableAnchors:
|
|
11923
|
-
|
|
11981
|
+
transform: z5.enum(["lowercase", "none", "uppercase"]).optional(),
|
|
11982
|
+
variableAnchors: z5.array(
|
|
11983
|
+
z5.enum([
|
|
11924
11984
|
"bottom",
|
|
11925
11985
|
"bottom-left",
|
|
11926
11986
|
"bottom-right",
|
|
@@ -11933,10 +11993,10 @@ var textStyleSchema = z4.object({
|
|
|
11933
11993
|
])
|
|
11934
11994
|
).min(1).optional()
|
|
11935
11995
|
}).strict();
|
|
11936
|
-
var iconStyleSchema =
|
|
11996
|
+
var iconStyleSchema = z5.object({
|
|
11937
11997
|
...rangeShape,
|
|
11938
|
-
allowOverlap:
|
|
11939
|
-
anchor:
|
|
11998
|
+
allowOverlap: z5.boolean().optional(),
|
|
11999
|
+
anchor: z5.enum([
|
|
11940
12000
|
"bottom",
|
|
11941
12001
|
"bottom-left",
|
|
11942
12002
|
"bottom-right",
|
|
@@ -11951,60 +12011,60 @@ var iconStyleSchema = z4.object({
|
|
|
11951
12011
|
haloBlur: numberValueSchema.optional(),
|
|
11952
12012
|
haloColor: colorValueSchema.optional(),
|
|
11953
12013
|
haloWidth: numberValueSchema.optional(),
|
|
11954
|
-
ignorePlacement:
|
|
12014
|
+
ignorePlacement: z5.boolean().optional(),
|
|
11955
12015
|
image: imageValueSchema.optional(),
|
|
11956
12016
|
offset: numberOffsetValueSchema.optional(),
|
|
11957
12017
|
opacity: numberValueSchema.optional(),
|
|
11958
|
-
keepUpright:
|
|
11959
|
-
optional:
|
|
12018
|
+
keepUpright: z5.boolean().optional(),
|
|
12019
|
+
optional: z5.boolean().optional(),
|
|
11960
12020
|
padding: numberValueSchema.optional(),
|
|
11961
|
-
pitchAlignment:
|
|
12021
|
+
pitchAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
11962
12022
|
rotate: numberValueSchema.optional(),
|
|
11963
|
-
rotationAlignment:
|
|
12023
|
+
rotationAlignment: z5.enum(["auto", "map", "viewport"]).optional(),
|
|
11964
12024
|
size: numberValueSchema.optional(),
|
|
11965
|
-
textFit:
|
|
12025
|
+
textFit: z5.enum(["both", "height", "none", "width"]).optional(),
|
|
11966
12026
|
textFitPadding: numberInsetsValueSchema.optional()
|
|
11967
12027
|
}).strict();
|
|
11968
12028
|
var symbolPlacementShape = {
|
|
11969
12029
|
...rangeShape,
|
|
11970
|
-
placement:
|
|
12030
|
+
placement: z5.enum(["line", "line-center", "point"]).optional(),
|
|
11971
12031
|
priority: structuralNumberValueSchema.optional(),
|
|
11972
|
-
priorityOrder:
|
|
12032
|
+
priorityOrder: z5.enum(["higher-first", "lower-first"]).optional(),
|
|
11973
12033
|
spacing: numberValueSchema.optional(),
|
|
11974
|
-
zOrder:
|
|
12034
|
+
zOrder: z5.enum(["auto", "source", "viewport-y"]).optional()
|
|
11975
12035
|
};
|
|
11976
|
-
var circleStyleSchema =
|
|
12036
|
+
var circleStyleSchema = z5.object({
|
|
11977
12037
|
...rangeShape,
|
|
11978
12038
|
blur: numberValueSchema.optional(),
|
|
11979
12039
|
color: colorValueSchema.optional(),
|
|
11980
12040
|
opacity: numberValueSchema.optional(),
|
|
11981
|
-
pitchAlignment:
|
|
11982
|
-
pitchScale:
|
|
12041
|
+
pitchAlignment: z5.enum(["map", "viewport"]).optional(),
|
|
12042
|
+
pitchScale: z5.enum(["map", "viewport"]).optional(),
|
|
11983
12043
|
priority: structuralNumberValueSchema.optional(),
|
|
11984
|
-
priorityOrder:
|
|
12044
|
+
priorityOrder: z5.enum(["higher-first", "lower-first"]).optional(),
|
|
11985
12045
|
radius: numberValueSchema.optional(),
|
|
11986
12046
|
strokeColor: colorValueSchema.optional(),
|
|
11987
12047
|
strokeOpacity: numberValueSchema.optional(),
|
|
11988
12048
|
strokeWidth: numberValueSchema.optional(),
|
|
11989
12049
|
translate: numberOffsetValueSchema.optional(),
|
|
11990
|
-
translateAnchor:
|
|
12050
|
+
translateAnchor: z5.enum(["map", "viewport"]).optional()
|
|
11991
12051
|
}).strict();
|
|
11992
|
-
var extrusionStyleSchema =
|
|
12052
|
+
var extrusionStyleSchema = z5.object({
|
|
11993
12053
|
...rangeShape,
|
|
11994
12054
|
base: numberValueSchema.optional(),
|
|
11995
12055
|
color: colorValueSchema.optional(),
|
|
11996
12056
|
height: numberValueSchema.optional(),
|
|
11997
12057
|
opacity: numberValueSchema.optional(),
|
|
11998
12058
|
pattern: imageValueSchema.optional(),
|
|
11999
|
-
verticalGradient:
|
|
12059
|
+
verticalGradient: z5.boolean().optional()
|
|
12000
12060
|
}).strict();
|
|
12001
|
-
var areaStyleSchema =
|
|
12002
|
-
var lineStackStyleSchema =
|
|
12061
|
+
var areaStyleSchema = z5.object({ fill: fillStyleSchema.optional(), outline: lineStyleSchema.optional() }).strict();
|
|
12062
|
+
var lineStackStyleSchema = z5.object({
|
|
12003
12063
|
casing: lineStyleSchema.optional(),
|
|
12004
12064
|
fill: lineStyleSchema.optional(),
|
|
12005
12065
|
shadow: lineStyleSchema.optional()
|
|
12006
12066
|
}).strict();
|
|
12007
|
-
var lineHatchStyleSchema =
|
|
12067
|
+
var lineHatchStyleSchema = z5.object({
|
|
12008
12068
|
...rangeShape,
|
|
12009
12069
|
angle: numberValueSchema.optional(),
|
|
12010
12070
|
color: colorValueSchema.optional(),
|
|
@@ -12053,62 +12113,62 @@ var lineHatchStyleSchema = z4.object({
|
|
|
12053
12113
|
}
|
|
12054
12114
|
});
|
|
12055
12115
|
var roadLayerStyleSchema = lineStackStyleSchema.extend({ hatch: lineHatchStyleSchema.optional() }).strict();
|
|
12056
|
-
var symbolStyleSchema =
|
|
12116
|
+
var symbolStyleSchema = z5.object({
|
|
12057
12117
|
...symbolPlacementShape,
|
|
12058
12118
|
icon: iconStyleSchema.optional(),
|
|
12059
12119
|
text: textStyleSchema.optional()
|
|
12060
12120
|
}).strict();
|
|
12061
12121
|
var markerSymbolStyleSchema = symbolStyleSchema.extend({ marker: circleStyleSchema.optional() }).strict();
|
|
12062
12122
|
var poiCategoryStyleSchema = markerSymbolStyleSchema.omit({ priority: true, priorityOrder: true }).extend({
|
|
12063
|
-
density:
|
|
12123
|
+
density: z5.union([z5.literal(1), z5.literal(2), z5.literal(3), z5.literal(4), z5.literal(5)]).optional()
|
|
12064
12124
|
}).strict();
|
|
12065
|
-
var renderScalarSchema =
|
|
12066
|
-
var renderTargetSchema =
|
|
12067
|
-
var renderStackOperationNameSchema =
|
|
12125
|
+
var renderScalarSchema = z5.union([z5.boolean(), z5.number().finite(), z5.string()]);
|
|
12126
|
+
var renderTargetSchema = z5.string().regex(tileflowSemanticTargetPattern, "Expected a semantic target");
|
|
12127
|
+
var renderStackOperationNameSchema = z5.string().regex(
|
|
12068
12128
|
tileflowRenderStackOperationNamePattern,
|
|
12069
12129
|
"Expected a lowercase-initial portable render-stack operation name without dots"
|
|
12070
12130
|
);
|
|
12071
12131
|
var renderFieldNormalizationShape = {
|
|
12072
|
-
coerce:
|
|
12132
|
+
coerce: z5.literal("number").optional(),
|
|
12073
12133
|
fallback: renderScalarSchema.optional(),
|
|
12074
|
-
field:
|
|
12134
|
+
field: z5.enum(tileflowSemanticFieldNames)
|
|
12075
12135
|
};
|
|
12076
|
-
var renderSelectorNodeSchema =
|
|
12077
|
-
() =>
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12136
|
+
var renderSelectorNodeSchema = z5.lazy(
|
|
12137
|
+
() => z5.discriminatedUnion("kind", [
|
|
12138
|
+
z5.object({ kind: z5.literal("literal"), value: z5.boolean() }).strict(),
|
|
12139
|
+
z5.object({ kind: z5.literal("geometry"), geometry: z5.enum(tileflowRenderSelectorGeometries) }).strict(),
|
|
12140
|
+
z5.object({ kind: z5.literal("has"), field: z5.enum(tileflowSemanticFieldNames) }).strict(),
|
|
12141
|
+
z5.object({
|
|
12082
12142
|
...renderFieldNormalizationShape,
|
|
12083
|
-
kind:
|
|
12084
|
-
operator:
|
|
12143
|
+
kind: z5.literal("compare"),
|
|
12144
|
+
operator: z5.enum(tileflowRenderSelectorComparisons),
|
|
12085
12145
|
value: renderScalarSchema
|
|
12086
12146
|
}).strict(),
|
|
12087
|
-
|
|
12147
|
+
z5.object({
|
|
12088
12148
|
...renderFieldNormalizationShape,
|
|
12089
|
-
kind:
|
|
12090
|
-
values:
|
|
12149
|
+
kind: z5.literal("in"),
|
|
12150
|
+
values: z5.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
12091
12151
|
}).strict(),
|
|
12092
|
-
|
|
12152
|
+
z5.object({
|
|
12093
12153
|
...renderFieldNormalizationShape,
|
|
12094
|
-
branches:
|
|
12095
|
-
|
|
12096
|
-
result:
|
|
12097
|
-
values:
|
|
12154
|
+
branches: z5.array(
|
|
12155
|
+
z5.object({
|
|
12156
|
+
result: z5.boolean(),
|
|
12157
|
+
values: z5.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
12098
12158
|
}).strict()
|
|
12099
12159
|
).min(1).max(tileflowRenderStackLimits.maxMatchBranches),
|
|
12100
|
-
kind:
|
|
12101
|
-
otherwise:
|
|
12160
|
+
kind: z5.literal("match"),
|
|
12161
|
+
otherwise: z5.boolean()
|
|
12102
12162
|
}).strict(),
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
kind:
|
|
12106
|
-
selectors:
|
|
12163
|
+
z5.object({ kind: z5.literal("not"), selector: renderSelectorNodeSchema }).strict(),
|
|
12164
|
+
z5.object({
|
|
12165
|
+
kind: z5.enum(["all", "any"]),
|
|
12166
|
+
selectors: z5.array(renderSelectorNodeSchema).min(1).max(tileflowRenderStackLimits.maxSelectorChildren)
|
|
12107
12167
|
}).strict(),
|
|
12108
|
-
|
|
12168
|
+
z5.object({
|
|
12109
12169
|
fallback: renderSelectorNodeSchema,
|
|
12110
|
-
kind:
|
|
12111
|
-
stops:
|
|
12170
|
+
kind: z5.literal("step"),
|
|
12171
|
+
stops: z5.array(z5.object({ selector: renderSelectorNodeSchema, zoom: zoomNumberSchema }).strict()).min(1).max(tileflowRenderStackLimits.maxStepStops)
|
|
12112
12172
|
}).strict()
|
|
12113
12173
|
])
|
|
12114
12174
|
);
|
|
@@ -12119,7 +12179,7 @@ var renderSelectorSchema = renderSelectorNodeSchema.superRefine(
|
|
|
12119
12179
|
}
|
|
12120
12180
|
}
|
|
12121
12181
|
);
|
|
12122
|
-
var renderVisibilitySchema =
|
|
12182
|
+
var renderVisibilitySchema = z5.object({ visibilityGroup: z5.literal("building").optional() });
|
|
12123
12183
|
var renderStyleSchemas = {
|
|
12124
12184
|
background: backgroundStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
12125
12185
|
circle: circleStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
@@ -12128,7 +12188,7 @@ var renderStyleSchemas = {
|
|
|
12128
12188
|
line: lineStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
12129
12189
|
symbol: symbolStyleSchema.extend(renderVisibilitySchema.shape).strict()
|
|
12130
12190
|
};
|
|
12131
|
-
var renderRequirementsSchema =
|
|
12191
|
+
var renderRequirementsSchema = z5.array(z5.enum(tileflowLayerDomains)).min(1).max(tileflowRenderStackLimits.maxRequirements).superRefine((requirements, context) => {
|
|
12132
12192
|
const seen = /* @__PURE__ */ new Set();
|
|
12133
12193
|
for (const [index, requirement] of requirements.entries()) {
|
|
12134
12194
|
if (seen.has(requirement)) {
|
|
@@ -12142,40 +12202,40 @@ var renderRequirementsSchema = z4.array(z4.enum(tileflowLayerDomains)).min(1).ma
|
|
|
12142
12202
|
}
|
|
12143
12203
|
});
|
|
12144
12204
|
var vectorRenderPassSchemas = tileflowRenderStackRenderers.filter((renderer) => renderer !== "background").map(
|
|
12145
|
-
(renderer) =>
|
|
12205
|
+
(renderer) => z5.object({
|
|
12146
12206
|
attachTo: renderTargetSchema,
|
|
12147
|
-
feature:
|
|
12148
|
-
kind:
|
|
12149
|
-
phase:
|
|
12150
|
-
renderer:
|
|
12207
|
+
feature: z5.enum(tileflowSemanticLayerNames).optional(),
|
|
12208
|
+
kind: z5.literal("render-pass"),
|
|
12209
|
+
phase: z5.enum(tileflowRenderStackPhases),
|
|
12210
|
+
renderer: z5.literal(renderer),
|
|
12151
12211
|
requirements: renderRequirementsSchema.optional(),
|
|
12152
12212
|
selector: renderSelectorSchema.optional(),
|
|
12153
12213
|
style: renderStyleSchemas[renderer]
|
|
12154
12214
|
}).strict()
|
|
12155
12215
|
);
|
|
12156
|
-
var renderPassSchema =
|
|
12157
|
-
|
|
12216
|
+
var renderPassSchema = z5.discriminatedUnion("renderer", [
|
|
12217
|
+
z5.object({
|
|
12158
12218
|
attachTo: renderTargetSchema,
|
|
12159
|
-
kind:
|
|
12160
|
-
phase:
|
|
12161
|
-
renderer:
|
|
12219
|
+
kind: z5.literal("render-pass"),
|
|
12220
|
+
phase: z5.enum(tileflowRenderStackPhases),
|
|
12221
|
+
renderer: z5.literal("background"),
|
|
12162
12222
|
requirements: renderRequirementsSchema.optional(),
|
|
12163
12223
|
style: renderStyleSchemas.background
|
|
12164
12224
|
}).strict(),
|
|
12165
12225
|
...vectorRenderPassSchemas
|
|
12166
12226
|
]);
|
|
12167
12227
|
var renderRefinementSchemas = tileflowRenderStackRenderers.map(
|
|
12168
|
-
(renderer) =>
|
|
12169
|
-
kind:
|
|
12228
|
+
(renderer) => z5.object({
|
|
12229
|
+
kind: z5.literal("refine-render-target"),
|
|
12170
12230
|
requirements: renderRequirementsSchema.optional(),
|
|
12171
|
-
renderer:
|
|
12231
|
+
renderer: z5.literal(renderer),
|
|
12172
12232
|
...renderer === "background" ? {} : { selector: renderSelectorSchema.optional() },
|
|
12173
12233
|
style: renderStyleSchemas[renderer],
|
|
12174
12234
|
target: renderTargetSchema
|
|
12175
12235
|
}).strict()
|
|
12176
12236
|
);
|
|
12177
|
-
var renderStackOperationSchema =
|
|
12178
|
-
var renderStackSchema =
|
|
12237
|
+
var renderStackOperationSchema = z5.union([renderPassSchema, ...renderRefinementSchemas]);
|
|
12238
|
+
var renderStackSchema = z5.record(renderStackOperationNameSchema, renderStackOperationSchema).superRefine((stack, context) => {
|
|
12179
12239
|
const size = Object.keys(stack).length;
|
|
12180
12240
|
if (size === 0) {
|
|
12181
12241
|
context.addIssue({
|
|
@@ -12190,19 +12250,19 @@ var renderStackSchema = z4.record(renderStackOperationNameSchema, renderStackOpe
|
|
|
12190
12250
|
});
|
|
12191
12251
|
}
|
|
12192
12252
|
}).describe("tileflow-render-stack");
|
|
12193
|
-
var roadClassSchema =
|
|
12194
|
-
var roadClassStyleSchema =
|
|
12195
|
-
enabled:
|
|
12253
|
+
var roadClassSchema = z5.enum(tileflowRoadClasses);
|
|
12254
|
+
var roadClassStyleSchema = z5.object({
|
|
12255
|
+
enabled: z5.boolean().optional(),
|
|
12196
12256
|
bridge: roadLayerStyleSchema.optional(),
|
|
12197
12257
|
surface: roadLayerStyleSchema.optional(),
|
|
12198
12258
|
tunnel: roadLayerStyleSchema.optional()
|
|
12199
12259
|
}).strict();
|
|
12200
|
-
var roadStructureMapSchema =
|
|
12260
|
+
var roadStructureMapSchema = z5.object({
|
|
12201
12261
|
bridge: roadLayerStyleSchema.optional(),
|
|
12202
12262
|
surface: roadLayerStyleSchema.optional(),
|
|
12203
12263
|
tunnel: roadLayerStyleSchema.optional()
|
|
12204
12264
|
}).strict();
|
|
12205
|
-
var roadTreatmentLayerStyleSchema =
|
|
12265
|
+
var roadTreatmentLayerStyleSchema = z5.object({
|
|
12206
12266
|
casing: lineStyleSchema.pick({
|
|
12207
12267
|
blur: true,
|
|
12208
12268
|
color: true,
|
|
@@ -12231,19 +12291,19 @@ var roadTreatmentLayerStyleSchema = z4.object({
|
|
|
12231
12291
|
width: true
|
|
12232
12292
|
}).optional()
|
|
12233
12293
|
}).strict();
|
|
12234
|
-
var roadTreatmentStyleSchema =
|
|
12294
|
+
var roadTreatmentStyleSchema = z5.object({
|
|
12235
12295
|
bridge: roadTreatmentLayerStyleSchema.optional(),
|
|
12236
|
-
enabled:
|
|
12296
|
+
enabled: z5.boolean().optional(),
|
|
12237
12297
|
surface: roadTreatmentLayerStyleSchema.optional(),
|
|
12238
12298
|
tunnel: roadTreatmentLayerStyleSchema.optional(),
|
|
12239
12299
|
widthScale: themeNumberValueSchema.optional()
|
|
12240
12300
|
}).strict();
|
|
12241
|
-
var landModuleSchema =
|
|
12242
|
-
type:
|
|
12301
|
+
var landModuleSchema = z5.object({
|
|
12302
|
+
type: z5.literal("land"),
|
|
12243
12303
|
background: backgroundStyleSchema.optional(),
|
|
12244
|
-
enabled:
|
|
12304
|
+
enabled: z5.boolean().optional(),
|
|
12245
12305
|
globalLandcover: fillStyleSchema.optional(),
|
|
12246
|
-
landcover:
|
|
12306
|
+
landcover: z5.object({
|
|
12247
12307
|
farmland: areaStyleSchema.optional(),
|
|
12248
12308
|
flowerbed: areaStyleSchema.optional(),
|
|
12249
12309
|
grass: areaStyleSchema.optional(),
|
|
@@ -12259,7 +12319,7 @@ var landModuleSchema = z4.object({
|
|
|
12259
12319
|
wetland: areaStyleSchema.optional(),
|
|
12260
12320
|
wood: areaStyleSchema.optional()
|
|
12261
12321
|
}).strict().optional(),
|
|
12262
|
-
landuse:
|
|
12322
|
+
landuse: z5.object({
|
|
12263
12323
|
cemetery: areaStyleSchema.optional(),
|
|
12264
12324
|
civic: areaStyleSchema.optional(),
|
|
12265
12325
|
commercial: areaStyleSchema.optional(),
|
|
@@ -12275,99 +12335,99 @@ var landModuleSchema = z4.object({
|
|
|
12275
12335
|
}).strict().optional(),
|
|
12276
12336
|
renderStack: renderStackSchema.optional()
|
|
12277
12337
|
}).strict();
|
|
12278
|
-
var waterModuleSchema =
|
|
12279
|
-
type:
|
|
12338
|
+
var waterModuleSchema = z5.object({
|
|
12339
|
+
type: z5.literal("water"),
|
|
12280
12340
|
bathymetry: fillStyleSchema.optional(),
|
|
12281
12341
|
bathymetryContours: lineStyleSchema.optional(),
|
|
12282
12342
|
bathymetryLabels: symbolStyleSchema.optional(),
|
|
12283
12343
|
bodies: areaStyleSchema.optional(),
|
|
12284
|
-
enabled:
|
|
12285
|
-
intermittent:
|
|
12344
|
+
enabled: z5.boolean().optional(),
|
|
12345
|
+
intermittent: z5.object({ bodies: areaStyleSchema.optional(), waterways: lineStyleSchema.optional() }).strict().optional(),
|
|
12286
12346
|
renderStack: renderStackSchema.optional(),
|
|
12287
|
-
waterways:
|
|
12347
|
+
waterways: z5.object({
|
|
12288
12348
|
canal: lineStyleSchema.optional(),
|
|
12289
12349
|
other: lineStyleSchema.optional(),
|
|
12290
12350
|
river: lineStyleSchema.optional(),
|
|
12291
12351
|
stream: lineStyleSchema.optional()
|
|
12292
12352
|
}).strict().optional()
|
|
12293
12353
|
}).strict();
|
|
12294
|
-
var buildingsModuleSchema =
|
|
12295
|
-
type:
|
|
12354
|
+
var buildingsModuleSchema = z5.object({
|
|
12355
|
+
type: z5.literal("buildings"),
|
|
12296
12356
|
businessCorridor: areaStyleSchema.optional(),
|
|
12297
|
-
enabled:
|
|
12357
|
+
enabled: z5.boolean().optional(),
|
|
12298
12358
|
extrusion: extrusionStyleSchema.optional(),
|
|
12299
12359
|
flat: areaStyleSchema.optional(),
|
|
12300
|
-
mode:
|
|
12360
|
+
mode: z5.enum(["3d", "flat"]).optional(),
|
|
12301
12361
|
renderStack: renderStackSchema.optional()
|
|
12302
12362
|
}).strict();
|
|
12303
|
-
var addressesModuleSchema =
|
|
12304
|
-
type:
|
|
12305
|
-
enabled:
|
|
12363
|
+
var addressesModuleSchema = z5.object({
|
|
12364
|
+
type: z5.literal("addresses"),
|
|
12365
|
+
enabled: z5.boolean().optional(),
|
|
12306
12366
|
labels: symbolStyleSchema.optional(),
|
|
12307
12367
|
renderStack: renderStackSchema.optional()
|
|
12308
12368
|
}).strict();
|
|
12309
|
-
var landformClassSchema =
|
|
12310
|
-
var landformsModuleSchema =
|
|
12311
|
-
type:
|
|
12312
|
-
classes:
|
|
12313
|
-
elevation:
|
|
12314
|
-
enabled:
|
|
12369
|
+
var landformClassSchema = z5.enum(tileflowLandformClasses);
|
|
12370
|
+
var landformsModuleSchema = z5.object({
|
|
12371
|
+
type: z5.literal("landforms"),
|
|
12372
|
+
classes: z5.partialRecord(landformClassSchema, symbolStyleSchema).optional(),
|
|
12373
|
+
elevation: z5.boolean().optional(),
|
|
12374
|
+
enabled: z5.boolean().optional(),
|
|
12315
12375
|
renderStack: renderStackSchema.optional()
|
|
12316
12376
|
}).strict();
|
|
12317
|
-
var boundariesModuleSchema =
|
|
12318
|
-
type:
|
|
12377
|
+
var boundariesModuleSchema = z5.object({
|
|
12378
|
+
type: z5.literal("boundaries"),
|
|
12319
12379
|
admin2: lineStyleSchema.optional(),
|
|
12320
12380
|
admin4: lineStyleSchema.optional(),
|
|
12321
12381
|
disputed: lineStyleSchema.optional(),
|
|
12322
|
-
enabled:
|
|
12382
|
+
enabled: z5.boolean().optional(),
|
|
12323
12383
|
maritime: lineStyleSchema.optional(),
|
|
12324
12384
|
renderStack: renderStackSchema.optional()
|
|
12325
12385
|
}).strict();
|
|
12326
|
-
var aerowaysModuleSchema =
|
|
12327
|
-
type:
|
|
12386
|
+
var aerowaysModuleSchema = z5.object({
|
|
12387
|
+
type: z5.literal("aeroways"),
|
|
12328
12388
|
area: areaStyleSchema.optional(),
|
|
12329
|
-
enabled:
|
|
12389
|
+
enabled: z5.boolean().optional(),
|
|
12330
12390
|
runway: lineStackStyleSchema.optional(),
|
|
12331
12391
|
runwayRef: symbolStyleSchema.optional(),
|
|
12332
12392
|
renderStack: renderStackSchema.optional(),
|
|
12333
12393
|
taxiway: lineStackStyleSchema.optional()
|
|
12334
12394
|
}).strict();
|
|
12335
|
-
var transitModuleSchema =
|
|
12336
|
-
type:
|
|
12395
|
+
var transitModuleSchema = z5.object({
|
|
12396
|
+
type: z5.literal("transit"),
|
|
12337
12397
|
cableway: lineStyleSchema.optional(),
|
|
12338
|
-
enabled:
|
|
12398
|
+
enabled: z5.boolean().optional(),
|
|
12339
12399
|
ferry: lineStyleSchema.optional(),
|
|
12340
|
-
rail:
|
|
12400
|
+
rail: z5.object({
|
|
12341
12401
|
bridge: lineStyleSchema.optional(),
|
|
12342
12402
|
surface: lineStyleSchema.optional(),
|
|
12343
12403
|
tunnel: lineStyleSchema.optional()
|
|
12344
12404
|
}).strict().optional(),
|
|
12345
|
-
railHatching:
|
|
12405
|
+
railHatching: z5.object({
|
|
12346
12406
|
bridge: lineStyleSchema.optional(),
|
|
12347
12407
|
surface: lineStyleSchema.optional(),
|
|
12348
12408
|
tunnel: lineStyleSchema.optional()
|
|
12349
12409
|
}).strict().optional(),
|
|
12350
|
-
serviceRail:
|
|
12410
|
+
serviceRail: z5.object({
|
|
12351
12411
|
bridge: lineStyleSchema.optional(),
|
|
12352
12412
|
surface: lineStyleSchema.optional(),
|
|
12353
12413
|
tunnel: lineStyleSchema.optional()
|
|
12354
12414
|
}).strict().optional(),
|
|
12355
12415
|
renderStack: renderStackSchema.optional()
|
|
12356
12416
|
}).strict();
|
|
12357
|
-
var roadsModuleSchema =
|
|
12358
|
-
type:
|
|
12359
|
-
areas:
|
|
12417
|
+
var roadsModuleSchema = z5.object({
|
|
12418
|
+
type: z5.literal("roads"),
|
|
12419
|
+
areas: z5.object({
|
|
12360
12420
|
pedestrian: areaStyleSchema.optional(),
|
|
12361
12421
|
pier: areaStyleSchema.optional(),
|
|
12362
12422
|
road: areaStyleSchema.optional()
|
|
12363
12423
|
}).strict().optional(),
|
|
12364
|
-
classes:
|
|
12424
|
+
classes: z5.partialRecord(roadClassSchema, roadClassStyleSchema).optional(),
|
|
12365
12425
|
crossings: iconStyleSchema.extend({ image: imageValueSchema }).strict().optional(),
|
|
12366
|
-
detail:
|
|
12367
|
-
enabled:
|
|
12368
|
-
extras:
|
|
12369
|
-
hierarchy:
|
|
12370
|
-
modifiers:
|
|
12426
|
+
detail: z5.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
12427
|
+
enabled: z5.boolean().optional(),
|
|
12428
|
+
extras: z5.object({ paths: z5.boolean().optional() }).strict().optional(),
|
|
12429
|
+
hierarchy: z5.enum(["subtle", "clear", "strong"]).optional(),
|
|
12430
|
+
modifiers: z5.object({
|
|
12371
12431
|
construction: roadTreatmentStyleSchema.optional(),
|
|
12372
12432
|
expressway: roadTreatmentStyleSchema.optional(),
|
|
12373
12433
|
indoor: roadTreatmentStyleSchema.optional(),
|
|
@@ -12375,7 +12435,7 @@ var roadsModuleSchema = z4.object({
|
|
|
12375
12435
|
ramp: roadTreatmentStyleSchema.optional(),
|
|
12376
12436
|
unpaved: roadTreatmentStyleSchema.optional()
|
|
12377
12437
|
}).strict().optional(),
|
|
12378
|
-
mountainBike:
|
|
12438
|
+
mountainBike: z5.object({
|
|
12379
12439
|
"0": roadTreatmentStyleSchema.optional(),
|
|
12380
12440
|
"0+": roadTreatmentStyleSchema.optional(),
|
|
12381
12441
|
"1": roadTreatmentStyleSchema.optional(),
|
|
@@ -12388,9 +12448,9 @@ var roadsModuleSchema = z4.object({
|
|
|
12388
12448
|
"5": roadTreatmentStyleSchema.optional(),
|
|
12389
12449
|
"6": roadTreatmentStyleSchema.optional()
|
|
12390
12450
|
}).strict().optional(),
|
|
12391
|
-
oneWayMarkers:
|
|
12392
|
-
outline:
|
|
12393
|
-
restrictions:
|
|
12451
|
+
oneWayMarkers: z5.boolean().optional(),
|
|
12452
|
+
outline: z5.enum(["none", "subtle", "strong"]).optional(),
|
|
12453
|
+
restrictions: z5.object({
|
|
12394
12454
|
access: roadTreatmentStyleSchema.optional(),
|
|
12395
12455
|
bicycle: roadTreatmentStyleSchema.optional(),
|
|
12396
12456
|
foot: roadTreatmentStyleSchema.optional(),
|
|
@@ -12398,24 +12458,24 @@ var roadsModuleSchema = z4.object({
|
|
|
12398
12458
|
toll: roadTreatmentStyleSchema.optional()
|
|
12399
12459
|
}).strict().optional(),
|
|
12400
12460
|
renderStack: renderStackSchema.optional(),
|
|
12401
|
-
roundabouts:
|
|
12402
|
-
serviceTypes:
|
|
12461
|
+
roundabouts: z5.object({ casing: circleStyleSchema.optional(), fill: circleStyleSchema.optional() }).strict().optional(),
|
|
12462
|
+
serviceTypes: z5.object({
|
|
12403
12463
|
alley: roadTreatmentStyleSchema.optional(),
|
|
12404
12464
|
crossover: roadTreatmentStyleSchema.optional(),
|
|
12405
12465
|
driveway: roadTreatmentStyleSchema.optional(),
|
|
12406
12466
|
parkingAisle: roadTreatmentStyleSchema.optional(),
|
|
12407
12467
|
yard: roadTreatmentStyleSchema.optional()
|
|
12408
12468
|
}).strict().optional(),
|
|
12409
|
-
sidewalks:
|
|
12469
|
+
sidewalks: z5.object({
|
|
12410
12470
|
outline: lineStyleSchema.optional(),
|
|
12411
12471
|
pattern: fillStyleSchema.optional(),
|
|
12412
12472
|
surface: fillStyleSchema.optional()
|
|
12413
12473
|
}).strict().optional(),
|
|
12414
12474
|
structures: roadStructureMapSchema.optional(),
|
|
12415
|
-
weight:
|
|
12416
|
-
widthScale:
|
|
12475
|
+
weight: z5.enum(["thin", "regular", "bold"]).optional(),
|
|
12476
|
+
widthScale: z5.partialRecord(roadClassSchema, themeNumberValueSchema).optional()
|
|
12417
12477
|
}).strict();
|
|
12418
|
-
var placeLabelStylesSchema =
|
|
12478
|
+
var placeLabelStylesSchema = z5.object({
|
|
12419
12479
|
city: symbolStyleSchema.optional(),
|
|
12420
12480
|
continent: symbolStyleSchema.optional(),
|
|
12421
12481
|
country: symbolStyleSchema.optional(),
|
|
@@ -12425,65 +12485,65 @@ var placeLabelStylesSchema = z4.object({
|
|
|
12425
12485
|
town: symbolStyleSchema.optional(),
|
|
12426
12486
|
village: symbolStyleSchema.optional()
|
|
12427
12487
|
}).strict();
|
|
12428
|
-
var waterLabelStylesSchema =
|
|
12488
|
+
var waterLabelStylesSchema = z5.object({
|
|
12429
12489
|
line: symbolStyleSchema.optional(),
|
|
12430
12490
|
ocean: symbolStyleSchema.optional(),
|
|
12431
12491
|
other: symbolStyleSchema.optional(),
|
|
12432
12492
|
waterway: symbolStyleSchema.optional()
|
|
12433
12493
|
}).strict();
|
|
12434
|
-
var labelsModuleSchema =
|
|
12435
|
-
type:
|
|
12436
|
-
aerodromeCodes:
|
|
12437
|
-
collisionPriority:
|
|
12438
|
-
enabled:
|
|
12439
|
-
junctions:
|
|
12440
|
-
language:
|
|
12441
|
-
places:
|
|
12442
|
-
roadClasses:
|
|
12494
|
+
var labelsModuleSchema = z5.object({
|
|
12495
|
+
type: z5.literal("labels"),
|
|
12496
|
+
aerodromeCodes: z5.enum(["none", "iata", "all"]).optional(),
|
|
12497
|
+
collisionPriority: z5.enum(["balanced", "navigation"]).optional(),
|
|
12498
|
+
enabled: z5.boolean().optional(),
|
|
12499
|
+
junctions: z5.boolean().optional(),
|
|
12500
|
+
language: z5.string().trim().min(1).optional(),
|
|
12501
|
+
places: z5.enum(["none", "major", "all"]).optional(),
|
|
12502
|
+
roadClasses: z5.array(roadClassSchema).min(1).optional(),
|
|
12443
12503
|
renderStack: renderStackSchema.optional(),
|
|
12444
|
-
roads:
|
|
12445
|
-
styles:
|
|
12504
|
+
roads: z5.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
12505
|
+
styles: z5.object({
|
|
12446
12506
|
aerodrome: symbolStyleSchema.optional(),
|
|
12447
12507
|
junctions: symbolStyleSchema.optional(),
|
|
12448
12508
|
places: placeLabelStylesSchema.optional(),
|
|
12449
|
-
roads:
|
|
12450
|
-
shields:
|
|
12509
|
+
roads: z5.partialRecord(roadClassSchema, symbolStyleSchema).optional(),
|
|
12510
|
+
shields: z5.object({
|
|
12451
12511
|
default: symbolStyleSchema.optional(),
|
|
12452
12512
|
detail: symbolStyleSchema.optional(),
|
|
12453
|
-
kinds:
|
|
12513
|
+
kinds: z5.record(identifierSchema, z5.object({ image: themeImageValueSchema }).strict()).optional(),
|
|
12454
12514
|
overview: symbolStyleSchema.optional(),
|
|
12455
|
-
textColors:
|
|
12515
|
+
textColors: z5.record(identifierSchema, z5.object({ color: themeColorValueSchema }).strict()).optional()
|
|
12456
12516
|
}).strict().optional(),
|
|
12457
12517
|
water: waterLabelStylesSchema.optional()
|
|
12458
12518
|
}).strict().optional(),
|
|
12459
|
-
shields:
|
|
12460
|
-
water:
|
|
12519
|
+
shields: z5.enum(["none", "major", "all"]).optional(),
|
|
12520
|
+
water: z5.enum(["none", "major", "all"]).optional()
|
|
12461
12521
|
}).strict();
|
|
12462
|
-
var poiModuleSchema =
|
|
12463
|
-
type:
|
|
12464
|
-
categories:
|
|
12465
|
-
color:
|
|
12466
|
-
density:
|
|
12467
|
-
enabled:
|
|
12468
|
-
icons:
|
|
12469
|
-
labels:
|
|
12522
|
+
var poiModuleSchema = z5.object({
|
|
12523
|
+
type: z5.literal("poi"),
|
|
12524
|
+
categories: z5.array(z5.enum(tileflowPoiCategories)).optional(),
|
|
12525
|
+
color: z5.enum(["uniform", "category"]).optional(),
|
|
12526
|
+
density: z5.union([z5.literal(1), z5.literal(2), z5.literal(3), z5.literal(4), z5.literal(5)]).optional(),
|
|
12527
|
+
enabled: z5.boolean().optional(),
|
|
12528
|
+
icons: z5.boolean().optional(),
|
|
12529
|
+
labels: z5.boolean().optional(),
|
|
12470
12530
|
minZoom: zoomNumberSchema.optional(),
|
|
12471
|
-
placement:
|
|
12472
|
-
coupleIconAndLabel:
|
|
12473
|
-
iconPadding:
|
|
12474
|
-
textPadding:
|
|
12531
|
+
placement: z5.object({
|
|
12532
|
+
coupleIconAndLabel: z5.boolean().optional(),
|
|
12533
|
+
iconPadding: z5.number().finite().min(0).optional(),
|
|
12534
|
+
textPadding: z5.number().finite().min(0).optional()
|
|
12475
12535
|
}).strict().optional(),
|
|
12476
12536
|
renderStack: renderStackSchema.optional(),
|
|
12477
|
-
styles:
|
|
12537
|
+
styles: z5.partialRecord(z5.enum(tileflowPoiCategories), poiCategoryStyleSchema).optional()
|
|
12478
12538
|
}).strict();
|
|
12479
|
-
var nauticalModuleSchema =
|
|
12480
|
-
type:
|
|
12539
|
+
var nauticalModuleSchema = z5.object({
|
|
12540
|
+
type: z5.literal("nautical"),
|
|
12481
12541
|
aids: markerSymbolStyleSchema.optional(),
|
|
12482
12542
|
coverage: areaStyleSchema.optional(),
|
|
12483
|
-
enabled:
|
|
12543
|
+
enabled: z5.boolean().optional(),
|
|
12484
12544
|
hazardAreas: areaStyleSchema.optional(),
|
|
12485
12545
|
hazards: markerSymbolStyleSchema.optional(),
|
|
12486
|
-
labels:
|
|
12546
|
+
labels: z5.object({
|
|
12487
12547
|
coverage: symbolStyleSchema.optional(),
|
|
12488
12548
|
hazards: symbolStyleSchema.optional(),
|
|
12489
12549
|
navigationAreas: symbolStyleSchema.optional(),
|
|
@@ -12499,7 +12559,7 @@ var nauticalModuleSchema = z4.object({
|
|
|
12499
12559
|
wreckAreas: areaStyleSchema.optional(),
|
|
12500
12560
|
wrecks: markerSymbolStyleSchema.optional()
|
|
12501
12561
|
}).strict();
|
|
12502
|
-
var modulesSchema =
|
|
12562
|
+
var modulesSchema = z5.object({
|
|
12503
12563
|
addresses: addressesModuleSchema.optional(),
|
|
12504
12564
|
aeroways: aerowaysModuleSchema.optional(),
|
|
12505
12565
|
boundaries: boundariesModuleSchema.optional(),
|
|
@@ -12511,152 +12571,152 @@ var modulesSchema = z4.object({
|
|
|
12511
12571
|
poi: poiModuleSchema.optional(),
|
|
12512
12572
|
roads: roadsModuleSchema.optional(),
|
|
12513
12573
|
transit: transitModuleSchema.optional(),
|
|
12514
|
-
vegetation:
|
|
12515
|
-
type:
|
|
12516
|
-
enabled:
|
|
12574
|
+
vegetation: z5.object({
|
|
12575
|
+
type: z5.literal("vegetation"),
|
|
12576
|
+
enabled: z5.boolean().optional(),
|
|
12517
12577
|
flat: circleStyleSchema.optional(),
|
|
12518
12578
|
minZoom: zoomNumberSchema.optional(),
|
|
12519
|
-
mode:
|
|
12579
|
+
mode: z5.enum(["3d", "flat"]).optional(),
|
|
12520
12580
|
renderStack: renderStackSchema.optional(),
|
|
12521
|
-
threeDimensional:
|
|
12581
|
+
threeDimensional: z5.object({
|
|
12522
12582
|
barkColor: themeColorValueSchema.optional(),
|
|
12523
|
-
broadleafColors:
|
|
12524
|
-
coniferColors:
|
|
12525
|
-
crownScale:
|
|
12526
|
-
|
|
12583
|
+
broadleafColors: z5.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
12584
|
+
coniferColors: z5.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
12585
|
+
crownScale: z5.union([
|
|
12586
|
+
z5.number().finite().positive().max(10),
|
|
12527
12587
|
themeNumberReferenceSchema,
|
|
12528
|
-
|
|
12529
|
-
kind:
|
|
12530
|
-
reason:
|
|
12531
|
-
value:
|
|
12588
|
+
z5.object({
|
|
12589
|
+
kind: z5.literal("theme-fixed"),
|
|
12590
|
+
reason: z5.string().trim().min(1),
|
|
12591
|
+
value: z5.number().finite().positive().max(10)
|
|
12532
12592
|
}).strict()
|
|
12533
12593
|
]).optional(),
|
|
12534
|
-
heightScale:
|
|
12535
|
-
|
|
12594
|
+
heightScale: z5.union([
|
|
12595
|
+
z5.number().finite().positive().max(10),
|
|
12536
12596
|
themeNumberReferenceSchema,
|
|
12537
|
-
|
|
12538
|
-
kind:
|
|
12539
|
-
reason:
|
|
12540
|
-
value:
|
|
12597
|
+
z5.object({
|
|
12598
|
+
kind: z5.literal("theme-fixed"),
|
|
12599
|
+
reason: z5.string().trim().min(1),
|
|
12600
|
+
value: z5.number().finite().positive().max(10)
|
|
12541
12601
|
}).strict()
|
|
12542
12602
|
]).optional()
|
|
12543
12603
|
}).strict().optional()
|
|
12544
12604
|
}).strict().optional(),
|
|
12545
12605
|
water: waterModuleSchema.optional()
|
|
12546
12606
|
}).strict();
|
|
12547
|
-
var layerBindingsSchema =
|
|
12548
|
-
aerodromeLabel:
|
|
12549
|
-
aeroway:
|
|
12550
|
-
boundary:
|
|
12551
|
-
building:
|
|
12552
|
-
bathymetry:
|
|
12553
|
-
businessCorridor:
|
|
12554
|
-
circularFeature:
|
|
12555
|
-
globalLandcover:
|
|
12556
|
-
houseNumber:
|
|
12557
|
-
landcover:
|
|
12558
|
-
landuse:
|
|
12559
|
-
mountainPeak:
|
|
12560
|
-
park:
|
|
12561
|
-
place:
|
|
12562
|
-
poi:
|
|
12563
|
-
road:
|
|
12564
|
-
roadName:
|
|
12565
|
-
roadShield:
|
|
12566
|
-
sidewalk:
|
|
12567
|
-
streetFurniture:
|
|
12568
|
-
tree:
|
|
12569
|
-
water:
|
|
12570
|
-
waterName:
|
|
12571
|
-
waterway:
|
|
12607
|
+
var layerBindingsSchema = z5.object({
|
|
12608
|
+
aerodromeLabel: z5.string().trim().min(1),
|
|
12609
|
+
aeroway: z5.string().trim().min(1),
|
|
12610
|
+
boundary: z5.string().trim().min(1),
|
|
12611
|
+
building: z5.string().trim().min(1),
|
|
12612
|
+
bathymetry: z5.string().trim().min(1).optional(),
|
|
12613
|
+
businessCorridor: z5.string().trim().min(1).optional(),
|
|
12614
|
+
circularFeature: z5.string().trim().min(1).optional(),
|
|
12615
|
+
globalLandcover: z5.string().trim().min(1).optional(),
|
|
12616
|
+
houseNumber: z5.string().trim().min(1),
|
|
12617
|
+
landcover: z5.string().trim().min(1),
|
|
12618
|
+
landuse: z5.string().trim().min(1),
|
|
12619
|
+
mountainPeak: z5.string().trim().min(1),
|
|
12620
|
+
park: z5.string().trim().min(1),
|
|
12621
|
+
place: z5.string().trim().min(1),
|
|
12622
|
+
poi: z5.string().trim().min(1),
|
|
12623
|
+
road: z5.string().trim().min(1),
|
|
12624
|
+
roadName: z5.string().trim().min(1),
|
|
12625
|
+
roadShield: z5.string().trim().min(1).optional(),
|
|
12626
|
+
sidewalk: z5.string().trim().min(1).optional(),
|
|
12627
|
+
streetFurniture: z5.string().trim().min(1).optional(),
|
|
12628
|
+
tree: z5.string().trim().min(1).optional(),
|
|
12629
|
+
water: z5.string().trim().min(1),
|
|
12630
|
+
waterName: z5.string().trim().min(1),
|
|
12631
|
+
waterway: z5.string().trim().min(1)
|
|
12572
12632
|
}).strict();
|
|
12573
|
-
var fieldBindingsSchema =
|
|
12574
|
-
access:
|
|
12575
|
-
activityScore:
|
|
12576
|
-
adminLevel:
|
|
12577
|
-
bicycle:
|
|
12578
|
-
bathymetryMinDepth:
|
|
12579
|
-
bathymetrySortKey:
|
|
12580
|
-
brunnel:
|
|
12581
|
-
buildingKind:
|
|
12582
|
-
buildingTone:
|
|
12583
|
-
capital:
|
|
12584
|
-
circularClearanceExtraAtZoom15:
|
|
12585
|
-
circularKind:
|
|
12586
|
-
circularRadiusAtZoom15:
|
|
12587
|
-
circularRadiusMeters:
|
|
12588
|
-
circularInnerRadiusMeters:
|
|
12589
|
-
circularOuterRadiusMeters:
|
|
12590
|
-
class:
|
|
12591
|
-
crossing:
|
|
12592
|
-
classificationConfidence:
|
|
12593
|
-
confidence:
|
|
12594
|
-
circumference:
|
|
12595
|
-
diameterCrown:
|
|
12596
|
-
disputed:
|
|
12597
|
-
direction:
|
|
12598
|
-
elevation:
|
|
12599
|
-
elevationFeet:
|
|
12600
|
-
expressway:
|
|
12601
|
-
foot:
|
|
12602
|
-
height:
|
|
12603
|
-
hasBusiness:
|
|
12604
|
-
hasParts:
|
|
12605
|
-
hide3d:
|
|
12606
|
-
horse:
|
|
12607
|
-
houseNumber:
|
|
12608
|
-
importanceTier:
|
|
12609
|
-
iata:
|
|
12610
|
-
icao:
|
|
12611
|
-
indoor:
|
|
12612
|
-
intermittent:
|
|
12613
|
-
genus:
|
|
12614
|
-
layer:
|
|
12615
|
-
leafCycle:
|
|
12616
|
-
leafType:
|
|
12617
|
-
level:
|
|
12618
|
-
maritime:
|
|
12619
|
-
markings:
|
|
12620
|
-
minHeight:
|
|
12621
|
-
minZoom:
|
|
12622
|
-
mtbScale:
|
|
12623
|
-
name:
|
|
12624
|
-
nameEnglish:
|
|
12625
|
-
nameLatin:
|
|
12626
|
-
network:
|
|
12627
|
-
official:
|
|
12628
|
-
oneway:
|
|
12629
|
-
poiCategory:
|
|
12630
|
-
poiFilterRank:
|
|
12631
|
-
poiIcon:
|
|
12632
|
-
poiSizeRank:
|
|
12633
|
-
poiType:
|
|
12634
|
-
ramp:
|
|
12635
|
-
rank:
|
|
12636
|
-
ref:
|
|
12637
|
-
refLength:
|
|
12638
|
-
renderHeight:
|
|
12639
|
-
renderMinZoom:
|
|
12640
|
-
renderMinHeight:
|
|
12641
|
-
shieldKind:
|
|
12642
|
-
shieldLineLengthMeters:
|
|
12643
|
-
shieldNetwork:
|
|
12644
|
-
shieldRank:
|
|
12645
|
-
shieldText:
|
|
12646
|
-
shieldTextColor:
|
|
12647
|
-
service:
|
|
12648
|
-
species:
|
|
12649
|
-
speciesWikidata:
|
|
12650
|
-
subclass:
|
|
12651
|
-
surface:
|
|
12652
|
-
toll:
|
|
12633
|
+
var fieldBindingsSchema = z5.object({
|
|
12634
|
+
access: z5.string().trim().min(1),
|
|
12635
|
+
activityScore: z5.string().trim().min(1),
|
|
12636
|
+
adminLevel: z5.string().trim().min(1),
|
|
12637
|
+
bicycle: z5.string().trim().min(1),
|
|
12638
|
+
bathymetryMinDepth: z5.string().trim().min(1).optional(),
|
|
12639
|
+
bathymetrySortKey: z5.string().trim().min(1).optional(),
|
|
12640
|
+
brunnel: z5.string().trim().min(1),
|
|
12641
|
+
buildingKind: z5.string().trim().min(1),
|
|
12642
|
+
buildingTone: z5.string().trim().min(1),
|
|
12643
|
+
capital: z5.string().trim().min(1),
|
|
12644
|
+
circularClearanceExtraAtZoom15: z5.string().trim().min(1).optional(),
|
|
12645
|
+
circularKind: z5.string().trim().min(1).optional(),
|
|
12646
|
+
circularRadiusAtZoom15: z5.string().trim().min(1).optional(),
|
|
12647
|
+
circularRadiusMeters: z5.string().trim().min(1).optional(),
|
|
12648
|
+
circularInnerRadiusMeters: z5.string().trim().min(1).optional(),
|
|
12649
|
+
circularOuterRadiusMeters: z5.string().trim().min(1).optional(),
|
|
12650
|
+
class: z5.string().trim().min(1),
|
|
12651
|
+
crossing: z5.string().trim().min(1),
|
|
12652
|
+
classificationConfidence: z5.string().trim().min(1),
|
|
12653
|
+
confidence: z5.string().trim().min(1),
|
|
12654
|
+
circumference: z5.string().trim().min(1),
|
|
12655
|
+
diameterCrown: z5.string().trim().min(1),
|
|
12656
|
+
disputed: z5.string().trim().min(1),
|
|
12657
|
+
direction: z5.string().trim().min(1).optional(),
|
|
12658
|
+
elevation: z5.string().trim().min(1),
|
|
12659
|
+
elevationFeet: z5.string().trim().min(1),
|
|
12660
|
+
expressway: z5.string().trim().min(1),
|
|
12661
|
+
foot: z5.string().trim().min(1),
|
|
12662
|
+
height: z5.string().trim().min(1),
|
|
12663
|
+
hasBusiness: z5.string().trim().min(1),
|
|
12664
|
+
hasParts: z5.string().trim().min(1).optional(),
|
|
12665
|
+
hide3d: z5.string().trim().min(1),
|
|
12666
|
+
horse: z5.string().trim().min(1),
|
|
12667
|
+
houseNumber: z5.string().trim().min(1),
|
|
12668
|
+
importanceTier: z5.string().trim().min(1).optional(),
|
|
12669
|
+
iata: z5.string().trim().min(1),
|
|
12670
|
+
icao: z5.string().trim().min(1),
|
|
12671
|
+
indoor: z5.string().trim().min(1),
|
|
12672
|
+
intermittent: z5.string().trim().min(1),
|
|
12673
|
+
genus: z5.string().trim().min(1),
|
|
12674
|
+
layer: z5.string().trim().min(1),
|
|
12675
|
+
leafCycle: z5.string().trim().min(1),
|
|
12676
|
+
leafType: z5.string().trim().min(1),
|
|
12677
|
+
level: z5.string().trim().min(1),
|
|
12678
|
+
maritime: z5.string().trim().min(1),
|
|
12679
|
+
markings: z5.string().trim().min(1),
|
|
12680
|
+
minHeight: z5.string().trim().min(1),
|
|
12681
|
+
minZoom: z5.string().trim().min(1),
|
|
12682
|
+
mtbScale: z5.string().trim().min(1),
|
|
12683
|
+
name: z5.string().trim().min(1),
|
|
12684
|
+
nameEnglish: z5.string().trim().min(1),
|
|
12685
|
+
nameLatin: z5.string().trim().min(1),
|
|
12686
|
+
network: z5.string().trim().min(1),
|
|
12687
|
+
official: z5.string().trim().min(1),
|
|
12688
|
+
oneway: z5.string().trim().min(1),
|
|
12689
|
+
poiCategory: z5.string().trim().min(1),
|
|
12690
|
+
poiFilterRank: z5.string().trim().min(1),
|
|
12691
|
+
poiIcon: z5.string().trim().min(1),
|
|
12692
|
+
poiSizeRank: z5.string().trim().min(1),
|
|
12693
|
+
poiType: z5.string().trim().min(1),
|
|
12694
|
+
ramp: z5.string().trim().min(1),
|
|
12695
|
+
rank: z5.string().trim().min(1),
|
|
12696
|
+
ref: z5.string().trim().min(1),
|
|
12697
|
+
refLength: z5.string().trim().min(1),
|
|
12698
|
+
renderHeight: z5.string().trim().min(1),
|
|
12699
|
+
renderMinZoom: z5.string().trim().min(1),
|
|
12700
|
+
renderMinHeight: z5.string().trim().min(1),
|
|
12701
|
+
shieldKind: z5.string().trim().min(1).optional(),
|
|
12702
|
+
shieldLineLengthMeters: z5.string().trim().min(1).optional(),
|
|
12703
|
+
shieldNetwork: z5.string().trim().min(1).optional(),
|
|
12704
|
+
shieldRank: z5.string().trim().min(1).optional(),
|
|
12705
|
+
shieldText: z5.string().trim().min(1).optional(),
|
|
12706
|
+
shieldTextColor: z5.string().trim().min(1).optional(),
|
|
12707
|
+
service: z5.string().trim().min(1),
|
|
12708
|
+
species: z5.string().trim().min(1),
|
|
12709
|
+
speciesWikidata: z5.string().trim().min(1),
|
|
12710
|
+
subclass: z5.string().trim().min(1),
|
|
12711
|
+
surface: z5.string().trim().min(1),
|
|
12712
|
+
toll: z5.string().trim().min(1)
|
|
12653
12713
|
}).strict();
|
|
12654
|
-
var openMapTilesSchema =
|
|
12655
|
-
type:
|
|
12656
|
-
contractVersion:
|
|
12714
|
+
var openMapTilesSchema = z5.object({
|
|
12715
|
+
type: z5.literal("openmaptiles"),
|
|
12716
|
+
contractVersion: z5.literal(openMapTilesContractVersion),
|
|
12657
12717
|
fields: fieldBindingsSchema.partial().optional(),
|
|
12658
12718
|
layers: layerBindingsSchema.partial().optional(),
|
|
12659
|
-
semantics:
|
|
12719
|
+
semantics: z5.object({ parkLayer: z5.enum(["mixed", "protected-only"]).optional() }).strict().optional()
|
|
12660
12720
|
}).strict().transform(
|
|
12661
12721
|
(schema) => openMapTiles({
|
|
12662
12722
|
capabilities: schema.layers === void 0 ? void 0 : {
|
|
@@ -12671,12 +12731,12 @@ var openMapTilesSchema = z4.object({
|
|
|
12671
12731
|
})
|
|
12672
12732
|
);
|
|
12673
12733
|
var vectorDataShape = {
|
|
12674
|
-
type:
|
|
12675
|
-
attribution:
|
|
12734
|
+
type: z5.literal("vector-tiles"),
|
|
12735
|
+
attribution: z5.string().trim().min(1),
|
|
12676
12736
|
revision: revisionSchema.optional(),
|
|
12677
12737
|
schema: openMapTilesSchema
|
|
12678
12738
|
};
|
|
12679
|
-
var publicVectorUrlSchema =
|
|
12739
|
+
var publicVectorUrlSchema = z5.string().min(1).max(4096).superRefine((value, context) => {
|
|
12680
12740
|
try {
|
|
12681
12741
|
validatePublicVectorUrl(value);
|
|
12682
12742
|
} catch (error) {
|
|
@@ -12686,8 +12746,8 @@ var publicVectorUrlSchema = z4.string().min(1).max(4096).superRefine((value, con
|
|
|
12686
12746
|
});
|
|
12687
12747
|
}
|
|
12688
12748
|
}).describe("tileflow-public-vector-url");
|
|
12689
|
-
var marineSourceSchema =
|
|
12690
|
-
attribution:
|
|
12749
|
+
var marineSourceSchema = z5.object({
|
|
12750
|
+
attribution: z5.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
12691
12751
|
sourceId: identifierSchema.optional(),
|
|
12692
12752
|
url: publicVectorUrlSchema.optional()
|
|
12693
12753
|
}).strict();
|
|
@@ -12695,24 +12755,24 @@ var bathymetryDemUrlSchema = publicVectorUrlSchema.refine(
|
|
|
12695
12755
|
(value) => !value.startsWith("pmtiles://"),
|
|
12696
12756
|
"Expected an HTTPS, loopback HTTP, or root-relative DEM TileJSON URL"
|
|
12697
12757
|
).describe("tileflow-public-dem-url");
|
|
12698
|
-
var bathymetryReliefSchema =
|
|
12758
|
+
var bathymetryReliefSchema = z5.object({
|
|
12699
12759
|
accentColor: terrainColorValueSchema.optional(),
|
|
12700
|
-
attribution:
|
|
12701
|
-
encoding:
|
|
12702
|
-
exaggeration: terrainNumberValueSchema(
|
|
12760
|
+
attribution: z5.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
12761
|
+
encoding: z5.enum(["mapbox", "terrarium"]).optional(),
|
|
12762
|
+
exaggeration: terrainNumberValueSchema(z5.number().finite().min(0).max(1)).optional(),
|
|
12703
12763
|
highlightColor: terrainColorValueSchema.optional(),
|
|
12704
|
-
illuminationAltitude: terrainNumberValueSchema(
|
|
12705
|
-
illuminationAnchor:
|
|
12706
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
12764
|
+
illuminationAltitude: terrainNumberValueSchema(z5.number().finite().min(0).max(90)).optional(),
|
|
12765
|
+
illuminationAnchor: z5.enum(["map", "viewport"]).optional(),
|
|
12766
|
+
illuminationDirection: terrainNumberValueSchema(z5.number().finite().min(0).max(359)).optional(),
|
|
12707
12767
|
maxZoom: zoomNumberSchema.optional(),
|
|
12708
12768
|
minZoom: zoomNumberSchema.optional(),
|
|
12709
|
-
multidirectional:
|
|
12710
|
-
opacity: terrainNumberValueSchema(
|
|
12769
|
+
multidirectional: z5.boolean().optional(),
|
|
12770
|
+
opacity: terrainNumberValueSchema(z5.number().finite().min(0).max(1)).optional(),
|
|
12711
12771
|
shadowColor: terrainColorValueSchema.optional(),
|
|
12712
12772
|
sourceId: identifierSchema.optional(),
|
|
12713
|
-
tileSize:
|
|
12773
|
+
tileSize: z5.union([z5.literal(256), z5.literal(512)]).optional(),
|
|
12714
12774
|
url: bathymetryDemUrlSchema.optional(),
|
|
12715
|
-
visible:
|
|
12775
|
+
visible: z5.boolean().optional()
|
|
12716
12776
|
}).strict().superRefine((relief, context) => {
|
|
12717
12777
|
if (relief.minZoom !== void 0 && relief.maxZoom !== void 0 && relief.minZoom > relief.maxZoom) {
|
|
12718
12778
|
context.addIssue({
|
|
@@ -12722,33 +12782,33 @@ var bathymetryReliefSchema = z4.object({
|
|
|
12722
12782
|
});
|
|
12723
12783
|
}
|
|
12724
12784
|
});
|
|
12725
|
-
var bathymetryConfigSchema =
|
|
12785
|
+
var bathymetryConfigSchema = z5.object({
|
|
12726
12786
|
...marineSourceSchema.shape,
|
|
12727
|
-
bands:
|
|
12728
|
-
contours:
|
|
12729
|
-
display:
|
|
12730
|
-
labels:
|
|
12731
|
-
relief:
|
|
12732
|
-
type:
|
|
12787
|
+
bands: z5.union([z5.literal(false), fillStyleSchema]).optional(),
|
|
12788
|
+
contours: z5.union([z5.literal(false), lineStyleSchema]).optional(),
|
|
12789
|
+
display: z5.enum(["bands", "relief", "hybrid"]).optional(),
|
|
12790
|
+
labels: z5.union([z5.literal(false), symbolStyleSchema]).optional(),
|
|
12791
|
+
relief: z5.union([z5.literal(false), bathymetryReliefSchema]).optional(),
|
|
12792
|
+
type: z5.literal("bathymetry")
|
|
12733
12793
|
}).strict();
|
|
12734
|
-
var marineSchema =
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
bathymetry:
|
|
12738
|
-
nautical:
|
|
12794
|
+
var marineSchema = z5.union([
|
|
12795
|
+
z5.enum(["none", "bathymetry", "nautical", "chart"]),
|
|
12796
|
+
z5.object({
|
|
12797
|
+
bathymetry: z5.union([z5.literal(false), marineSourceSchema, bathymetryConfigSchema]).optional(),
|
|
12798
|
+
nautical: z5.union([z5.literal(false), marineSourceSchema]).optional()
|
|
12739
12799
|
}).strict()
|
|
12740
12800
|
]);
|
|
12741
|
-
var directVectorDataSchema =
|
|
12801
|
+
var directVectorDataSchema = z5.object({
|
|
12742
12802
|
...vectorDataShape,
|
|
12743
|
-
bounds:
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12803
|
+
bounds: z5.tuple([
|
|
12804
|
+
z5.number().finite().min(-180).max(180),
|
|
12805
|
+
z5.number().finite().min(-90).max(90),
|
|
12806
|
+
z5.number().finite().min(-180).max(180),
|
|
12807
|
+
z5.number().finite().min(-90).max(90)
|
|
12748
12808
|
]).optional(),
|
|
12749
|
-
maxzoom:
|
|
12750
|
-
minzoom:
|
|
12751
|
-
tiles:
|
|
12809
|
+
maxzoom: z5.number().int().min(0).max(30).optional(),
|
|
12810
|
+
minzoom: z5.number().int().min(0).max(30).optional(),
|
|
12811
|
+
tiles: z5.array(publicVectorUrlSchema).min(1).max(8)
|
|
12752
12812
|
}).strict().refine(
|
|
12753
12813
|
(value) => value.minzoom === void 0 || value.maxzoom === void 0 || value.minzoom <= value.maxzoom,
|
|
12754
12814
|
{ message: "minzoom must not exceed maxzoom", path: ["minzoom"] }
|
|
@@ -12756,34 +12816,34 @@ var directVectorDataSchema = z4.object({
|
|
|
12756
12816
|
(value) => value.bounds === void 0 || value.bounds[0] < value.bounds[2] && value.bounds[1] < value.bounds[3],
|
|
12757
12817
|
{ message: "bounds must have increasing axes", path: ["bounds"] }
|
|
12758
12818
|
);
|
|
12759
|
-
var dataSchema =
|
|
12760
|
-
|
|
12761
|
-
type:
|
|
12762
|
-
generation:
|
|
12763
|
-
selection:
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
kind:
|
|
12767
|
-
product:
|
|
12768
|
-
release:
|
|
12769
|
-
descriptorSha256:
|
|
12819
|
+
var dataSchema = z5.union([
|
|
12820
|
+
z5.object({
|
|
12821
|
+
type: z5.literal("tileflow-world"),
|
|
12822
|
+
generation: z5.literal(tileflowWorldGeneration),
|
|
12823
|
+
selection: z5.discriminatedUnion("kind", [
|
|
12824
|
+
z5.object({ kind: z5.literal("current"), product: z5.literal("world-v1") }).strict(),
|
|
12825
|
+
z5.object({
|
|
12826
|
+
kind: z5.literal("release"),
|
|
12827
|
+
product: z5.literal("world-v1"),
|
|
12828
|
+
release: z5.object({
|
|
12829
|
+
descriptorSha256: z5.string().regex(/^[0-9a-f]{64}$/u),
|
|
12770
12830
|
releaseId: tileflowWorldReleaseIdSchema
|
|
12771
12831
|
}).strict()
|
|
12772
12832
|
}).strict()
|
|
12773
12833
|
])
|
|
12774
12834
|
}).strict(),
|
|
12775
|
-
|
|
12835
|
+
z5.object({ ...vectorDataShape, url: publicVectorUrlSchema }).strict(),
|
|
12776
12836
|
directVectorDataSchema
|
|
12777
12837
|
]);
|
|
12778
|
-
var hostedTilesetSourceSchema =
|
|
12779
|
-
attribution:
|
|
12780
|
-
kind:
|
|
12781
|
-
local:
|
|
12838
|
+
var hostedTilesetSourceSchema = z5.object({
|
|
12839
|
+
attribution: z5.string().trim().min(1).max(4096),
|
|
12840
|
+
kind: z5.literal("hosted-tileset"),
|
|
12841
|
+
local: z5.string().refine(isSafeLocalPmtilesPath, {
|
|
12782
12842
|
message: "Expected a safe relative .pmtiles path beginning with ./ or ../"
|
|
12783
12843
|
}),
|
|
12784
|
-
tileset:
|
|
12785
|
-
tileSize:
|
|
12786
|
-
type:
|
|
12844
|
+
tileset: z5.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u).refine((value) => value !== "terrain" && value !== "world", "Expected a Team tileset ID"),
|
|
12845
|
+
tileSize: z5.union([z5.literal(256), z5.literal(512)]).optional(),
|
|
12846
|
+
type: z5.enum(["raster", "vector"])
|
|
12787
12847
|
}).strict().superRefine((source, context) => {
|
|
12788
12848
|
if (source.type === "vector" && source.tileSize !== void 0) {
|
|
12789
12849
|
context.addIssue({
|
|
@@ -12793,7 +12853,7 @@ var hostedTilesetSourceSchema = z4.object({
|
|
|
12793
12853
|
});
|
|
12794
12854
|
}
|
|
12795
12855
|
});
|
|
12796
|
-
var hostedSourcesSchema =
|
|
12856
|
+
var hostedSourcesSchema = z5.record(tileflowMapIdSchema, hostedTilesetSourceSchema).superRefine((sources, context) => {
|
|
12797
12857
|
if (Object.keys(sources).length > tileflowHostedSourceLimit) {
|
|
12798
12858
|
context.addIssue({
|
|
12799
12859
|
code: "too_big",
|
|
@@ -12802,7 +12862,7 @@ var hostedSourcesSchema = z4.record(tileflowMapIdSchema, hostedTilesetSourceSche
|
|
|
12802
12862
|
});
|
|
12803
12863
|
}
|
|
12804
12864
|
});
|
|
12805
|
-
var maplibreOverlayLayerSchema =
|
|
12865
|
+
var maplibreOverlayLayerSchema = z5.record(z5.string(), z5.unknown()).superRefine((layer, context) => {
|
|
12806
12866
|
if (!tileflowMapIdSchema.safeParse(layer.id).success) {
|
|
12807
12867
|
context.addIssue({ code: "custom", message: "Expected a portable layer ID", path: ["id"] });
|
|
12808
12868
|
}
|
|
@@ -12820,30 +12880,41 @@ var maplibreOverlayLayerSchema = z4.record(z4.string(), z4.unknown()).superRefin
|
|
|
12820
12880
|
});
|
|
12821
12881
|
}
|
|
12822
12882
|
});
|
|
12823
|
-
var maplibreOverlaySchema =
|
|
12824
|
-
kind:
|
|
12825
|
-
layers:
|
|
12826
|
-
placement:
|
|
12883
|
+
var maplibreOverlaySchema = z5.object({
|
|
12884
|
+
kind: z5.literal("maplibre-overlay"),
|
|
12885
|
+
layers: z5.array(maplibreOverlayLayerSchema).min(1),
|
|
12886
|
+
placement: z5.enum(tileflowOverlayPlacements),
|
|
12827
12887
|
source: tileflowMapIdSchema
|
|
12828
12888
|
}).strict();
|
|
12829
|
-
var overlaysSchema =
|
|
12830
|
-
var localAssetDirectorySchema =
|
|
12831
|
-
var packageAssetDirectorySchema =
|
|
12832
|
-
kind:
|
|
12833
|
-
package:
|
|
12889
|
+
var overlaysSchema = z5.record(tileflowMapIdSchema, maplibreOverlaySchema);
|
|
12890
|
+
var localAssetDirectorySchema = z5.string().min(3).max(tileflowLocalDirectoryMaximumLength).refine(isTileflowLocalDirectory, { message: tileflowLocalDirectoryMessage });
|
|
12891
|
+
var packageAssetDirectorySchema = z5.object({
|
|
12892
|
+
kind: z5.literal("package-directory"),
|
|
12893
|
+
package: z5.string().regex(
|
|
12834
12894
|
/^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/u,
|
|
12835
12895
|
"Expected a lowercase npm package name"
|
|
12836
12896
|
),
|
|
12837
|
-
path:
|
|
12897
|
+
path: z5.string().min(1).max(512).refine(
|
|
12838
12898
|
(value) => !value.startsWith("/") && !value.includes("\\") && value.split("/").every((segment) => Boolean(segment) && segment !== "." && segment !== ".."),
|
|
12839
12899
|
"Expected a portable package-relative directory"
|
|
12840
12900
|
)
|
|
12841
12901
|
}).strict();
|
|
12842
|
-
var assetDirectorySchema =
|
|
12843
|
-
var iconDirectoriesSchema =
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12902
|
+
var assetDirectorySchema = z5.union([localAssetDirectorySchema, packageAssetDirectorySchema]);
|
|
12903
|
+
var iconDirectoriesSchema = z5.array(
|
|
12904
|
+
z5.union([localAssetDirectorySchema, packageAssetDirectorySchema, tileflowIconSetSourceSchema])
|
|
12905
|
+
).max(tileflowIconSourceLimit).superRefine((sources, context) => {
|
|
12906
|
+
try {
|
|
12907
|
+
collectTileflowIconSetReferences(sources);
|
|
12908
|
+
} catch (cause) {
|
|
12909
|
+
context.addIssue({
|
|
12910
|
+
code: "custom",
|
|
12911
|
+
message: cause instanceof Error ? cause.message : "Invalid icon contributors"
|
|
12912
|
+
});
|
|
12913
|
+
}
|
|
12914
|
+
});
|
|
12915
|
+
var fontDirectoriesSchema = z5.array(assetDirectorySchema).max(16);
|
|
12916
|
+
var fontStacksSchema = z5.array(
|
|
12917
|
+
z5.string().min(1).max(200).refine(
|
|
12847
12918
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\/]/u.test(value),
|
|
12848
12919
|
"Expected an exact NFC MapLibre font-stack key without whitespace padding, controls, slashes, or backslashes"
|
|
12849
12920
|
)
|
|
@@ -12860,10 +12931,10 @@ var fontStacksSchema = z4.array(
|
|
|
12860
12931
|
seen.add(fontStack);
|
|
12861
12932
|
}
|
|
12862
12933
|
});
|
|
12863
|
-
var glyphsSchema =
|
|
12934
|
+
var glyphsSchema = z5.object({
|
|
12864
12935
|
fontStacks: fontStacksSchema,
|
|
12865
|
-
kind:
|
|
12866
|
-
url:
|
|
12936
|
+
kind: z5.literal("url"),
|
|
12937
|
+
url: z5.string().min(1).refine(
|
|
12867
12938
|
(value) => value.includes("{fontstack}") && value.includes("{range}"),
|
|
12868
12939
|
"Expected {fontstack} and {range} placeholders"
|
|
12869
12940
|
).refine(isSafeGlyphUrl, "Expected an HTTP(S), root-relative, or path-relative glyph URL")
|
|
@@ -12871,34 +12942,34 @@ var glyphsSchema = z4.object({
|
|
|
12871
12942
|
var terrainLayerRangeShape = {
|
|
12872
12943
|
maxZoom: zoomNumberSchema.optional(),
|
|
12873
12944
|
minZoom: zoomNumberSchema.optional(),
|
|
12874
|
-
visible:
|
|
12945
|
+
visible: z5.boolean().optional()
|
|
12875
12946
|
};
|
|
12876
|
-
var terrainHillshadeSchema =
|
|
12947
|
+
var terrainHillshadeSchema = z5.object({
|
|
12877
12948
|
...terrainLayerRangeShape,
|
|
12878
12949
|
accentColor: terrainColorValueSchema.optional(),
|
|
12879
|
-
exaggeration: terrainNumberValueSchema(
|
|
12950
|
+
exaggeration: terrainNumberValueSchema(z5.number().finite().min(0).max(1)).optional(),
|
|
12880
12951
|
highlightColor: terrainColorValueSchema.optional(),
|
|
12881
|
-
illuminationAnchor:
|
|
12882
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
12952
|
+
illuminationAnchor: z5.enum(["map", "viewport"]).optional(),
|
|
12953
|
+
illuminationDirection: terrainNumberValueSchema(z5.number().finite().min(0).max(359)).optional(),
|
|
12883
12954
|
shadowColor: terrainColorValueSchema.optional()
|
|
12884
12955
|
}).strict();
|
|
12885
|
-
var terrainContourLineSchema =
|
|
12956
|
+
var terrainContourLineSchema = z5.object({
|
|
12886
12957
|
...terrainLayerRangeShape,
|
|
12887
12958
|
color: terrainColorValueSchema.optional(),
|
|
12888
|
-
opacity: terrainNumberValueSchema(
|
|
12889
|
-
width: terrainNumberValueSchema(
|
|
12959
|
+
opacity: terrainNumberValueSchema(z5.number().finite().min(0).max(1)).optional(),
|
|
12960
|
+
width: terrainNumberValueSchema(z5.number().finite().min(0).max(32)).optional()
|
|
12890
12961
|
}).strict();
|
|
12891
|
-
var terrainContourLabelSchema =
|
|
12962
|
+
var terrainContourLabelSchema = z5.object({
|
|
12892
12963
|
...terrainLayerRangeShape,
|
|
12893
12964
|
color: terrainColorValueSchema.optional(),
|
|
12894
12965
|
font: moduleFontValueSchema.optional(),
|
|
12895
12966
|
haloColor: terrainColorValueSchema.optional(),
|
|
12896
|
-
haloWidth: terrainNumberValueSchema(
|
|
12897
|
-
opacity: terrainNumberValueSchema(
|
|
12898
|
-
size: terrainNumberValueSchema(
|
|
12899
|
-
spacing: terrainNumberValueSchema(
|
|
12967
|
+
haloWidth: terrainNumberValueSchema(z5.number().finite().min(0).max(16)).optional(),
|
|
12968
|
+
opacity: terrainNumberValueSchema(z5.number().finite().min(0).max(1)).optional(),
|
|
12969
|
+
size: terrainNumberValueSchema(z5.number().finite().min(1).max(64)).optional(),
|
|
12970
|
+
spacing: terrainNumberValueSchema(z5.number().finite().min(1).max(1e3)).optional()
|
|
12900
12971
|
}).strict();
|
|
12901
|
-
var terrainContourThresholdPairSchema =
|
|
12972
|
+
var terrainContourThresholdPairSchema = z5.tuple([z5.number().finite().min(1e-3).max(1e5), z5.number().finite().min(1e-3).max(1e5)]).refine(([minor, index]) => minor <= index, {
|
|
12902
12973
|
message: "Expected the index contour interval to be greater than or equal to the minor interval"
|
|
12903
12974
|
}).refine(([minor, index]) => isWholeContourMultiple2(index, minor), {
|
|
12904
12975
|
message: "Expected the index contour interval to be a whole multiple of the minor interval"
|
|
@@ -12907,7 +12978,7 @@ function isWholeContourMultiple2(value, interval) {
|
|
|
12907
12978
|
const ratio = value / interval;
|
|
12908
12979
|
return Math.abs(ratio - Math.round(ratio)) <= Number.EPSILON * Math.max(1, ratio) * 8;
|
|
12909
12980
|
}
|
|
12910
|
-
var terrainContourThresholdsSchema =
|
|
12981
|
+
var terrainContourThresholdsSchema = z5.record(z5.string().regex(/^(?:0|[1-9]|1\d|2[0-4])$/u), terrainContourThresholdPairSchema).superRefine((thresholds, context) => {
|
|
12911
12982
|
const count = Object.keys(thresholds).length;
|
|
12912
12983
|
if (count === 0 || count > 25) {
|
|
12913
12984
|
context.addIssue({
|
|
@@ -12916,19 +12987,19 @@ var terrainContourThresholdsSchema = z4.record(z4.string().regex(/^(?:0|[1-9]|1\
|
|
|
12916
12987
|
});
|
|
12917
12988
|
}
|
|
12918
12989
|
});
|
|
12919
|
-
var terrainContoursSchema =
|
|
12920
|
-
demMaxZoom:
|
|
12921
|
-
demUrl:
|
|
12990
|
+
var terrainContoursSchema = z5.object({
|
|
12991
|
+
demMaxZoom: z5.number().int().min(0).max(24),
|
|
12992
|
+
demUrl: z5.string().min(1).max(2048).refine(
|
|
12922
12993
|
isSafeTileflowDemUrlTemplate,
|
|
12923
12994
|
"Expected a safe HTTP(S) DEM URL template containing {z}, {x}, and {y}"
|
|
12924
12995
|
),
|
|
12925
12996
|
index: terrainContourLineSchema.optional(),
|
|
12926
12997
|
labels: terrainContourLabelSchema.optional(),
|
|
12927
|
-
maxZoom:
|
|
12998
|
+
maxZoom: z5.number().int().min(0).max(24).optional(),
|
|
12928
12999
|
minZoom: zoomNumberSchema.optional(),
|
|
12929
13000
|
minor: terrainContourLineSchema.optional(),
|
|
12930
|
-
multiplier:
|
|
12931
|
-
overzoom:
|
|
13001
|
+
multiplier: z5.number().finite().min(1e-3).max(100).optional(),
|
|
13002
|
+
overzoom: z5.number().int().min(0).max(8).optional(),
|
|
12932
13003
|
sourceId: identifierSchema.optional(),
|
|
12933
13004
|
thresholds: terrainContourThresholdsSchema
|
|
12934
13005
|
}).strict().superRefine((contours, context) => {
|
|
@@ -12992,26 +13063,26 @@ var terrainContoursSchema = z4.object({
|
|
|
12992
13063
|
}
|
|
12993
13064
|
}
|
|
12994
13065
|
});
|
|
12995
|
-
var terrainSchema =
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
attribution:
|
|
13066
|
+
var terrainSchema = z5.union([
|
|
13067
|
+
z5.enum(["none", "hillshade", "3d"]),
|
|
13068
|
+
z5.object({
|
|
13069
|
+
attribution: z5.string().optional(),
|
|
12999
13070
|
contours: terrainContoursSchema.optional(),
|
|
13000
|
-
encoding:
|
|
13001
|
-
exaggeration:
|
|
13071
|
+
encoding: z5.enum(["mapbox", "terrarium"]).optional(),
|
|
13072
|
+
exaggeration: z5.number().finite().min(0).max(10).optional(),
|
|
13002
13073
|
hillshade: terrainHillshadeSchema.optional(),
|
|
13003
|
-
mode:
|
|
13004
|
-
sourceId:
|
|
13005
|
-
url:
|
|
13074
|
+
mode: z5.enum(["none", "hillshade", "3d"]).optional(),
|
|
13075
|
+
sourceId: z5.string().trim().min(1).optional(),
|
|
13076
|
+
url: z5.string().trim().min(1).optional()
|
|
13006
13077
|
}).strict()
|
|
13007
13078
|
]);
|
|
13008
|
-
var viewSchema =
|
|
13009
|
-
bearing:
|
|
13010
|
-
center:
|
|
13011
|
-
pitch:
|
|
13079
|
+
var viewSchema = z5.object({
|
|
13080
|
+
bearing: z5.number().finite().min(-180).max(180).optional(),
|
|
13081
|
+
center: z5.tuple([z5.number().finite().min(-180).max(180), z5.number().finite().min(-90).max(90)]).optional(),
|
|
13082
|
+
pitch: z5.number().finite().min(0).max(85).optional(),
|
|
13012
13083
|
zoom: zoomNumberSchema.optional()
|
|
13013
13084
|
}).strict();
|
|
13014
|
-
var themesSchema =
|
|
13085
|
+
var themesSchema = z5.record(tileflowThemeNameSchema, tileflowThemeSchema).superRefine((themes, context) => {
|
|
13015
13086
|
const names = Object.keys(themes);
|
|
13016
13087
|
if (names.length === 0) {
|
|
13017
13088
|
context.addIssue({ code: "custom", message: "Expected at least one named theme" });
|
|
@@ -13035,8 +13106,8 @@ var themesSchema = z4.record(tileflowThemeNameSchema, tileflowThemeSchema).super
|
|
|
13035
13106
|
}
|
|
13036
13107
|
}
|
|
13037
13108
|
}).describe("tileflow-themes");
|
|
13038
|
-
var systemThemesSchema =
|
|
13039
|
-
var resolvedTileflowMapSchema =
|
|
13109
|
+
var systemThemesSchema = z5.object({ dark: tileflowThemeNameSchema, light: tileflowThemeNameSchema }).strict();
|
|
13110
|
+
var resolvedTileflowMapSchema = z5.object({
|
|
13040
13111
|
data: dataSchema.optional(),
|
|
13041
13112
|
defaultTheme: tileflowThemeNameSchema,
|
|
13042
13113
|
fonts: fontDirectoriesSchema.optional(),
|
|
@@ -13045,14 +13116,14 @@ var resolvedTileflowMapSchema = z4.object({
|
|
|
13045
13116
|
id: tileflowMapIdSchema,
|
|
13046
13117
|
marine: marineSchema.optional(),
|
|
13047
13118
|
modules: modulesSchema.optional(),
|
|
13048
|
-
name:
|
|
13119
|
+
name: z5.string().trim().min(1),
|
|
13049
13120
|
overlays: overlaysSchema.optional(),
|
|
13050
|
-
projection:
|
|
13121
|
+
projection: z5.enum(["globe", "mercator"]).optional(),
|
|
13051
13122
|
sources: hostedSourcesSchema.optional(),
|
|
13052
13123
|
systemThemes: systemThemesSchema.optional(),
|
|
13053
13124
|
terrain: terrainSchema.optional(),
|
|
13054
13125
|
themes: themesSchema,
|
|
13055
|
-
version:
|
|
13126
|
+
version: z5.number().int().positive(),
|
|
13056
13127
|
view: viewSchema.optional()
|
|
13057
13128
|
}).strict().superRefine((map, context) => {
|
|
13058
13129
|
if (map.fonts !== void 0 && map.glyphs !== void 0) {
|
|
@@ -15885,7 +15956,7 @@ function asRecord7(value) {
|
|
|
15885
15956
|
init_themes();
|
|
15886
15957
|
|
|
15887
15958
|
// src/icon-package.ts
|
|
15888
|
-
import { z as
|
|
15959
|
+
import { z as z7 } from "zod";
|
|
15889
15960
|
var tileflowIconPackageFileNames = [
|
|
15890
15961
|
"sprite.json",
|
|
15891
15962
|
"sprite.png",
|
|
@@ -15910,17 +15981,17 @@ var tileflowHostedAlphaCompatibility = {
|
|
|
15910
15981
|
},
|
|
15911
15982
|
maxMapsPerDeploy: 20
|
|
15912
15983
|
};
|
|
15913
|
-
var sha256Schema =
|
|
15984
|
+
var sha256Schema = z7.string().regex(/^[a-f0-9]{64}$/);
|
|
15914
15985
|
var tileflowIconPackageContentHashSchema = sha256Schema;
|
|
15915
|
-
var tileflowIconIdSchema =
|
|
15916
|
-
var tileflowRenderedIconManifestEntrySchema =
|
|
15986
|
+
var tileflowIconIdSchema = z7.string().max(64).regex(tileflowIconIdPattern);
|
|
15987
|
+
var tileflowRenderedIconManifestEntrySchema = z7.object({
|
|
15917
15988
|
name: tileflowIconIdSchema,
|
|
15918
|
-
pixelSha256:
|
|
15989
|
+
pixelSha256: z7.object({
|
|
15919
15990
|
oneX: sha256Schema,
|
|
15920
15991
|
twoX: sha256Schema
|
|
15921
15992
|
}).strict()
|
|
15922
15993
|
}).strict();
|
|
15923
|
-
var tileflowIconPackageLabelSchema =
|
|
15994
|
+
var tileflowIconPackageLabelSchema = z7.string().superRefine((value, context) => {
|
|
15924
15995
|
if (value !== value.trim() || value.length === 0) {
|
|
15925
15996
|
context.addIssue({
|
|
15926
15997
|
code: "custom",
|
|
@@ -15940,32 +16011,32 @@ var tileflowIconPackageLabelSchema = z6.string().superRefine((value, context) =>
|
|
|
15940
16011
|
});
|
|
15941
16012
|
}
|
|
15942
16013
|
});
|
|
15943
|
-
var spriteDimensionsSchema =
|
|
15944
|
-
height:
|
|
15945
|
-
pixelRatio:
|
|
15946
|
-
width:
|
|
16014
|
+
var spriteDimensionsSchema = z7.object({
|
|
16015
|
+
height: z7.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
16016
|
+
pixelRatio: z7.union([z7.literal(1), z7.literal(2)]),
|
|
16017
|
+
width: z7.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension)
|
|
15947
16018
|
}).strict();
|
|
15948
16019
|
function iconPackageFileSchema(name, contentType) {
|
|
15949
|
-
return
|
|
15950
|
-
byteLength:
|
|
15951
|
-
contentType:
|
|
15952
|
-
name:
|
|
16020
|
+
return z7.object({
|
|
16021
|
+
byteLength: z7.number().int().nonnegative().max(tileflowIconPackageLimits.maxGeneratedFileBytes),
|
|
16022
|
+
contentType: z7.literal(contentType),
|
|
16023
|
+
name: z7.literal(name),
|
|
15953
16024
|
sha256: sha256Schema
|
|
15954
16025
|
}).strict();
|
|
15955
16026
|
}
|
|
15956
|
-
var tileflowIconPackageManifestSchema =
|
|
15957
|
-
files:
|
|
16027
|
+
var tileflowIconPackageManifestSchema = z7.object({
|
|
16028
|
+
files: z7.tuple([
|
|
15958
16029
|
iconPackageFileSchema("sprite.json", "application/json"),
|
|
15959
16030
|
iconPackageFileSchema("sprite.png", "image/png"),
|
|
15960
16031
|
iconPackageFileSchema("sprite@2x.json", "application/json"),
|
|
15961
16032
|
iconPackageFileSchema("sprite@2x.png", "image/png")
|
|
15962
16033
|
]),
|
|
15963
|
-
format:
|
|
15964
|
-
iconNames:
|
|
15965
|
-
renderedIcons:
|
|
15966
|
-
sprites:
|
|
15967
|
-
oneX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
15968
|
-
twoX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
16034
|
+
format: z7.literal("tileflow-icon-package-v1"),
|
|
16035
|
+
iconNames: z7.array(tileflowIconIdSchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
16036
|
+
renderedIcons: z7.array(tileflowRenderedIconManifestEntrySchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
16037
|
+
sprites: z7.object({
|
|
16038
|
+
oneX: spriteDimensionsSchema.extend({ pixelRatio: z7.literal(1) }),
|
|
16039
|
+
twoX: spriteDimensionsSchema.extend({ pixelRatio: z7.literal(2) })
|
|
15969
16040
|
}).strict()
|
|
15970
16041
|
}).strict().superRefine((manifest, context) => {
|
|
15971
16042
|
const sortedNames = [...manifest.iconNames].sort(compareCodeUnits11);
|
|
@@ -16091,7 +16162,7 @@ function containsControlCharacter(value) {
|
|
|
16091
16162
|
}
|
|
16092
16163
|
|
|
16093
16164
|
// src/font-bundle.ts
|
|
16094
|
-
import { z as
|
|
16165
|
+
import { z as z8 } from "zod";
|
|
16095
16166
|
var tileflowFontBundleLimits = {
|
|
16096
16167
|
maxFaceCount: 16,
|
|
16097
16168
|
maxFileCount: 32,
|
|
@@ -16100,39 +16171,39 @@ var tileflowFontBundleLimits = {
|
|
|
16100
16171
|
maxManifestBytes: 64 * 1024,
|
|
16101
16172
|
maxPackageBytes: 20 * 1024 * 1024
|
|
16102
16173
|
};
|
|
16103
|
-
var sha256Schema2 =
|
|
16104
|
-
var fontFileNameSchema =
|
|
16105
|
-
var licenseFileNameSchema =
|
|
16106
|
-
var fontFamilySchema =
|
|
16174
|
+
var sha256Schema2 = z8.string().regex(/^[a-f0-9]{64}$/u);
|
|
16175
|
+
var fontFileNameSchema = z8.string().max(512).regex(/^fonts\/[a-z0-9]+(?:-[a-z0-9]+)*-[a-f0-9]{64}\.(?:otf|ttf|woff2)$/u);
|
|
16176
|
+
var licenseFileNameSchema = z8.string().max(512).regex(/^fonts\/licenses\/license-[a-f0-9]{64}\.txt$/u);
|
|
16177
|
+
var fontFamilySchema = z8.string().min(1).max(100).refine(
|
|
16107
16178
|
(value) => value === value.trim() && !/[\p{Cc}\\]/u.test(value),
|
|
16108
16179
|
"Font family must be printable, trimmed text"
|
|
16109
16180
|
);
|
|
16110
16181
|
var tileflowFontBundleContentHashSchema = sha256Schema2;
|
|
16111
|
-
var fontFileSchema =
|
|
16112
|
-
byteLength:
|
|
16113
|
-
contentType:
|
|
16114
|
-
kind:
|
|
16182
|
+
var fontFileSchema = z8.object({
|
|
16183
|
+
byteLength: z8.number().int().positive().max(tileflowFontBundleLimits.maxFontFileBytes),
|
|
16184
|
+
contentType: z8.enum(["font/otf", "font/ttf", "font/woff2"]),
|
|
16185
|
+
kind: z8.literal("font"),
|
|
16115
16186
|
name: fontFileNameSchema,
|
|
16116
16187
|
sha256: sha256Schema2
|
|
16117
16188
|
}).strict();
|
|
16118
|
-
var licenseFileSchema =
|
|
16119
|
-
byteLength:
|
|
16120
|
-
contentType:
|
|
16121
|
-
kind:
|
|
16189
|
+
var licenseFileSchema = z8.object({
|
|
16190
|
+
byteLength: z8.number().int().positive().max(tileflowFontBundleLimits.maxLicenseFileBytes),
|
|
16191
|
+
contentType: z8.literal("text/plain; charset=utf-8"),
|
|
16192
|
+
kind: z8.literal("license"),
|
|
16122
16193
|
name: licenseFileNameSchema,
|
|
16123
16194
|
sha256: sha256Schema2
|
|
16124
16195
|
}).strict();
|
|
16125
|
-
var fontFaceSchema2 =
|
|
16196
|
+
var fontFaceSchema2 = z8.object({
|
|
16126
16197
|
family: fontFamilySchema,
|
|
16127
16198
|
file: fontFileNameSchema,
|
|
16128
16199
|
licenseFile: licenseFileNameSchema,
|
|
16129
|
-
style:
|
|
16130
|
-
weight:
|
|
16200
|
+
style: z8.enum(["italic", "normal", "oblique"]),
|
|
16201
|
+
weight: z8.enum(["100", "200", "300", "400", "500", "600", "700", "800", "900"])
|
|
16131
16202
|
}).strict();
|
|
16132
|
-
var tileflowFontBundleManifestSchema =
|
|
16133
|
-
files:
|
|
16134
|
-
fontFaces:
|
|
16135
|
-
format:
|
|
16203
|
+
var tileflowFontBundleManifestSchema = z8.object({
|
|
16204
|
+
files: z8.array(z8.discriminatedUnion("kind", [fontFileSchema, licenseFileSchema])).min(2).max(tileflowFontBundleLimits.maxFileCount),
|
|
16205
|
+
fontFaces: z8.array(fontFaceSchema2).min(1).max(tileflowFontBundleLimits.maxFaceCount),
|
|
16206
|
+
format: z8.literal("tileflow-font-bundle-v1")
|
|
16136
16207
|
}).strict().superRefine((manifest, context) => {
|
|
16137
16208
|
const sortedFiles = [...manifest.files].sort(
|
|
16138
16209
|
(left, right) => compareCodeUnits11(left.name, right.name)
|
|
@@ -17112,7 +17183,318 @@ function getTileflowLocationBaseUrl() {
|
|
|
17112
17183
|
if (typeof window !== "undefined" && window.location.href) return window.location.href;
|
|
17113
17184
|
return `${getTileflowLocationOrigin().replace(/\/+$/u, "")}/`;
|
|
17114
17185
|
}
|
|
17186
|
+
|
|
17187
|
+
// src/icon-lock.ts
|
|
17188
|
+
import { z as z9 } from "zod";
|
|
17189
|
+
|
|
17190
|
+
// src/icon-json.ts
|
|
17191
|
+
function parseTileflowIconJson(text, maximumBytes) {
|
|
17192
|
+
if (new TextEncoder().encode(text).byteLength > maximumBytes) {
|
|
17193
|
+
throw new TileflowIconSetError("ICON_LOCK_INVALID", "Icon JSON exceeds its byte limit");
|
|
17194
|
+
}
|
|
17195
|
+
let position = 0;
|
|
17196
|
+
const fail = () => {
|
|
17197
|
+
throw new TileflowIconSetError(
|
|
17198
|
+
"ICON_LOCK_INVALID",
|
|
17199
|
+
`Invalid or duplicate-key icon JSON at offset ${position}`
|
|
17200
|
+
);
|
|
17201
|
+
};
|
|
17202
|
+
const whitespace = () => {
|
|
17203
|
+
while (position < text.length && /[\t\n\r ]/u.test(text[position])) position += 1;
|
|
17204
|
+
};
|
|
17205
|
+
const string = () => {
|
|
17206
|
+
if (text[position] !== '"') return fail();
|
|
17207
|
+
const start = position++;
|
|
17208
|
+
while (position < text.length) {
|
|
17209
|
+
const character = text[position++];
|
|
17210
|
+
if (character === "\\") {
|
|
17211
|
+
position += 1;
|
|
17212
|
+
} else if (character === '"') {
|
|
17213
|
+
try {
|
|
17214
|
+
return JSON.parse(text.slice(start, position));
|
|
17215
|
+
} catch {
|
|
17216
|
+
return fail();
|
|
17217
|
+
}
|
|
17218
|
+
}
|
|
17219
|
+
}
|
|
17220
|
+
return fail();
|
|
17221
|
+
};
|
|
17222
|
+
const value = (depth) => {
|
|
17223
|
+
if (depth > 32) return fail();
|
|
17224
|
+
whitespace();
|
|
17225
|
+
const character = text[position];
|
|
17226
|
+
if (character === '"') return string();
|
|
17227
|
+
if (character === "{") {
|
|
17228
|
+
position += 1;
|
|
17229
|
+
const result2 = {};
|
|
17230
|
+
const keys = /* @__PURE__ */ new Set();
|
|
17231
|
+
whitespace();
|
|
17232
|
+
if (text[position] === "}") {
|
|
17233
|
+
position += 1;
|
|
17234
|
+
return result2;
|
|
17235
|
+
}
|
|
17236
|
+
while (true) {
|
|
17237
|
+
whitespace();
|
|
17238
|
+
const key = string();
|
|
17239
|
+
if (keys.has(key)) return fail();
|
|
17240
|
+
keys.add(key);
|
|
17241
|
+
whitespace();
|
|
17242
|
+
if (text[position++] !== ":") return fail();
|
|
17243
|
+
Object.defineProperty(result2, key, {
|
|
17244
|
+
value: value(depth + 1),
|
|
17245
|
+
enumerable: true,
|
|
17246
|
+
writable: true,
|
|
17247
|
+
configurable: true
|
|
17248
|
+
});
|
|
17249
|
+
whitespace();
|
|
17250
|
+
const delimiter = text[position++];
|
|
17251
|
+
if (delimiter === "}") return result2;
|
|
17252
|
+
if (delimiter !== ",") return fail();
|
|
17253
|
+
}
|
|
17254
|
+
}
|
|
17255
|
+
if (character === "[") {
|
|
17256
|
+
position += 1;
|
|
17257
|
+
const result2 = [];
|
|
17258
|
+
whitespace();
|
|
17259
|
+
if (text[position] === "]") {
|
|
17260
|
+
position += 1;
|
|
17261
|
+
return result2;
|
|
17262
|
+
}
|
|
17263
|
+
while (true) {
|
|
17264
|
+
result2.push(value(depth + 1));
|
|
17265
|
+
whitespace();
|
|
17266
|
+
const delimiter = text[position++];
|
|
17267
|
+
if (delimiter === "]") return result2;
|
|
17268
|
+
if (delimiter !== ",") return fail();
|
|
17269
|
+
}
|
|
17270
|
+
}
|
|
17271
|
+
for (const [literal2, parsed] of [
|
|
17272
|
+
["true", true],
|
|
17273
|
+
["false", false],
|
|
17274
|
+
["null", null]
|
|
17275
|
+
]) {
|
|
17276
|
+
if (text.startsWith(literal2, position)) {
|
|
17277
|
+
position += literal2.length;
|
|
17278
|
+
return parsed;
|
|
17279
|
+
}
|
|
17280
|
+
}
|
|
17281
|
+
const number = text.slice(position).match(/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/u)?.[0];
|
|
17282
|
+
if (!number || !Number.isFinite(Number(number))) return fail();
|
|
17283
|
+
position += number.length;
|
|
17284
|
+
return Number(number);
|
|
17285
|
+
};
|
|
17286
|
+
const result = value(0);
|
|
17287
|
+
whitespace();
|
|
17288
|
+
if (position !== text.length) return fail();
|
|
17289
|
+
return result;
|
|
17290
|
+
}
|
|
17291
|
+
|
|
17292
|
+
// src/icon-lock.ts
|
|
17293
|
+
var tileflowIconsLockfileName = "tileflow.icons.lock.json";
|
|
17294
|
+
var tileflowIconsLockfileMaximumBytes = 4 * 1024 * 1024;
|
|
17295
|
+
var tileflowIconSetPinSchema = z9.object({
|
|
17296
|
+
teamId: tileflowIconSetTeamIdSchema,
|
|
17297
|
+
setId: tileflowIconSetIdSchema,
|
|
17298
|
+
versionId: tileflowIconSetVersionIdSchema,
|
|
17299
|
+
version: z9.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
17300
|
+
packageId: tileflowIconSetPackageIdSchema,
|
|
17301
|
+
contentHash: tileflowIconPackageContentHashSchema,
|
|
17302
|
+
manifest: tileflowIconPackageManifestSchema,
|
|
17303
|
+
spriteUrl: z9.string().max(2048)
|
|
17304
|
+
}).strict().superRefine((pin, context) => {
|
|
17305
|
+
try {
|
|
17306
|
+
const url = new URL(pin.spriteUrl);
|
|
17307
|
+
if (url.protocol !== "https:" || url.username || url.password || url.search || url.hash || url.href !== pin.spriteUrl || !url.pathname.endsWith(`/sprites/${pin.packageId}/sprite`)) {
|
|
17308
|
+
throw new Error("Invalid delivery URL");
|
|
17309
|
+
}
|
|
17310
|
+
} catch {
|
|
17311
|
+
context.addIssue({
|
|
17312
|
+
code: "custom",
|
|
17313
|
+
path: ["spriteUrl"],
|
|
17314
|
+
message: "Expected a canonical HTTPS sprite URL for the exact package, without credentials, query or fragment"
|
|
17315
|
+
});
|
|
17316
|
+
}
|
|
17317
|
+
});
|
|
17318
|
+
var tileflowIconsLockfileSchema = z9.object({
|
|
17319
|
+
lockfileVersion: z9.literal(1),
|
|
17320
|
+
sets: z9.record(tileflowIconSetReferenceSchema, tileflowIconSetPinSchema)
|
|
17321
|
+
}).strict().superRefine((lock, context) => {
|
|
17322
|
+
const entries = Object.entries(lock.sets);
|
|
17323
|
+
if (entries.length > tileflowIconSourceLimit) {
|
|
17324
|
+
context.addIssue({ code: "custom", path: ["sets"], message: "Too many locked icon sets" });
|
|
17325
|
+
}
|
|
17326
|
+
const teams = new Set(entries.map(([, pin]) => pin.teamId));
|
|
17327
|
+
const slugs = new Set(entries.map(([reference]) => reference.split("/")[0]));
|
|
17328
|
+
const ids = new Set(entries.map(([, pin]) => pin.setId));
|
|
17329
|
+
if (teams.size > 1 || slugs.size > 1 || ids.size !== entries.length) {
|
|
17330
|
+
context.addIssue({
|
|
17331
|
+
code: "custom",
|
|
17332
|
+
path: ["sets"],
|
|
17333
|
+
message: "Locked sets must have distinct identities within one Team"
|
|
17334
|
+
});
|
|
17335
|
+
}
|
|
17336
|
+
});
|
|
17337
|
+
async function parseTileflowIconsLockfile(input, sources) {
|
|
17338
|
+
try {
|
|
17339
|
+
const lock = tileflowIconsLockfileSchema.parse(
|
|
17340
|
+
typeof input === "string" ? parseTileflowIconJson(input, tileflowIconsLockfileMaximumBytes) : input
|
|
17341
|
+
);
|
|
17342
|
+
const serialized = serializeCanonicalJson(lock);
|
|
17343
|
+
if (new TextEncoder().encode(serialized).byteLength > tileflowIconsLockfileMaximumBytes)
|
|
17344
|
+
throw new Error("Lock exceeds its byte limit");
|
|
17345
|
+
for (const pin of Object.values(lock.sets)) {
|
|
17346
|
+
if (await hashTileflowIconPackageManifest(pin.manifest) !== pin.contentHash)
|
|
17347
|
+
throw new Error("Locked manifest does not match its content hash");
|
|
17348
|
+
}
|
|
17349
|
+
if (sources) {
|
|
17350
|
+
const required = collectTileflowIconSetReferences(sources).sort(compareCodeUnits11);
|
|
17351
|
+
const actual = Object.keys(lock.sets).sort(compareCodeUnits11);
|
|
17352
|
+
if (required.length !== actual.length || required.some((reference, index) => reference !== actual[index])) {
|
|
17353
|
+
throw new Error(
|
|
17354
|
+
"Lock must exactly match declared icon sets; explicitly install, update or pin it"
|
|
17355
|
+
);
|
|
17356
|
+
}
|
|
17357
|
+
}
|
|
17358
|
+
return lock;
|
|
17359
|
+
} catch (cause) {
|
|
17360
|
+
if (cause instanceof TileflowIconSetError) throw cause;
|
|
17361
|
+
throw new TileflowIconSetError(
|
|
17362
|
+
"ICON_LOCK_INVALID",
|
|
17363
|
+
"Invalid icon lock: exact references, revisions, manifests and delivery URLs are required",
|
|
17364
|
+
{ cause }
|
|
17365
|
+
);
|
|
17366
|
+
}
|
|
17367
|
+
}
|
|
17368
|
+
async function serializeTileflowIconsLockfile(input) {
|
|
17369
|
+
return `${serializeCanonicalJson(await parseTileflowIconsLockfile(input))}
|
|
17370
|
+
`;
|
|
17371
|
+
}
|
|
17372
|
+
|
|
17373
|
+
// src/icon-composition.ts
|
|
17374
|
+
import { z as z10 } from "zod";
|
|
17375
|
+
var tileflowIconCompositionMaximumBytes = 1024 * 1024;
|
|
17376
|
+
var idsSchema = z10.array(tileflowIconIdSchema).max(tileflowIconPackageLimits.maxIconCount).refine(
|
|
17377
|
+
(ids) => new Set(ids).size === ids.length && ids.every((id, index) => index === 0 || compareCodeUnits11(ids[index - 1], id) < 0),
|
|
17378
|
+
"Icon exports must be unique and sorted by code unit"
|
|
17379
|
+
);
|
|
17380
|
+
var localContributorSchema = z10.object({ kind: z10.literal("local"), iconIds: idsSchema }).strict();
|
|
17381
|
+
var packageContributorSchema = z10.object({
|
|
17382
|
+
kind: z10.literal("package"),
|
|
17383
|
+
package: z10.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u),
|
|
17384
|
+
iconIds: idsSchema
|
|
17385
|
+
}).strict();
|
|
17386
|
+
var setContributorSchema = z10.object({
|
|
17387
|
+
kind: z10.literal("icon-set"),
|
|
17388
|
+
reference: tileflowIconSetReferenceSchema,
|
|
17389
|
+
teamId: tileflowIconSetTeamIdSchema,
|
|
17390
|
+
setId: tileflowIconSetIdSchema,
|
|
17391
|
+
versionId: tileflowIconSetVersionIdSchema,
|
|
17392
|
+
version: z10.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
17393
|
+
packageId: tileflowIconSetPackageIdSchema,
|
|
17394
|
+
contentHash: tileflowIconPackageContentHashSchema,
|
|
17395
|
+
iconIds: idsSchema.min(1)
|
|
17396
|
+
}).strict();
|
|
17397
|
+
var tileflowRenderedIconIdentitySchema = z10.object({
|
|
17398
|
+
kind: z10.literal("rendered-icon"),
|
|
17399
|
+
id: tileflowIconIdSchema,
|
|
17400
|
+
width: z10.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
17401
|
+
height: z10.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
17402
|
+
pixelSha256: z10.object({
|
|
17403
|
+
oneX: tileflowIconPackageContentHashSchema,
|
|
17404
|
+
twoX: tileflowIconPackageContentHashSchema
|
|
17405
|
+
}).strict()
|
|
17406
|
+
}).strict();
|
|
17407
|
+
var tileflowIconCompositionSchema = z10.object({
|
|
17408
|
+
format: z10.literal("tileflow-icon-composition-v1"),
|
|
17409
|
+
compositionVersion: z10.literal(1),
|
|
17410
|
+
packageHash: tileflowIconPackageContentHashSchema,
|
|
17411
|
+
contributors: z10.array(
|
|
17412
|
+
z10.discriminatedUnion("kind", [
|
|
17413
|
+
localContributorSchema,
|
|
17414
|
+
packageContributorSchema,
|
|
17415
|
+
setContributorSchema
|
|
17416
|
+
])
|
|
17417
|
+
).min(1).max(tileflowIconSourceLimit),
|
|
17418
|
+
winners: z10.array(
|
|
17419
|
+
tileflowRenderedIconIdentitySchema.omit({ kind: true }).extend({
|
|
17420
|
+
contributor: z10.number().int().min(0).max(tileflowIconSourceLimit - 1)
|
|
17421
|
+
})
|
|
17422
|
+
).min(1).max(tileflowIconPackageLimits.maxIconCount)
|
|
17423
|
+
}).strict().superRefine((receipt, context) => {
|
|
17424
|
+
const expected = /* @__PURE__ */ new Map();
|
|
17425
|
+
const references = /* @__PURE__ */ new Set();
|
|
17426
|
+
const sets = /* @__PURE__ */ new Set();
|
|
17427
|
+
const versions = /* @__PURE__ */ new Set();
|
|
17428
|
+
const teams = /* @__PURE__ */ new Set();
|
|
17429
|
+
const teamSlugs = /* @__PURE__ */ new Set();
|
|
17430
|
+
for (const [ordinal, contributor] of receipt.contributors.entries()) {
|
|
17431
|
+
if (contributor.kind === "icon-set") {
|
|
17432
|
+
if (references.has(contributor.reference) || sets.has(contributor.setId) || versions.has(contributor.versionId)) {
|
|
17433
|
+
context.addIssue({
|
|
17434
|
+
code: "custom",
|
|
17435
|
+
path: ["contributors", ordinal],
|
|
17436
|
+
message: "Duplicate icon set dependency"
|
|
17437
|
+
});
|
|
17438
|
+
}
|
|
17439
|
+
references.add(contributor.reference);
|
|
17440
|
+
sets.add(contributor.setId);
|
|
17441
|
+
versions.add(contributor.versionId);
|
|
17442
|
+
teams.add(contributor.teamId);
|
|
17443
|
+
teamSlugs.add(contributor.reference.split("/")[0]);
|
|
17444
|
+
}
|
|
17445
|
+
for (const id of contributor.iconIds) expected.set(id, ordinal);
|
|
17446
|
+
}
|
|
17447
|
+
if (teams.size !== 1 || teamSlugs.size !== 1)
|
|
17448
|
+
context.addIssue({
|
|
17449
|
+
code: "custom",
|
|
17450
|
+
path: ["contributors"],
|
|
17451
|
+
message: "A shared composition must contain exact dependencies from one Team"
|
|
17452
|
+
});
|
|
17453
|
+
const names = [...expected.keys()].sort(compareCodeUnits11);
|
|
17454
|
+
if (names.length !== receipt.winners.length || receipt.winners.some(
|
|
17455
|
+
(winner, index) => names[index] !== winner.id || expected.get(winner.id) !== winner.contributor
|
|
17456
|
+
)) {
|
|
17457
|
+
context.addIssue({
|
|
17458
|
+
code: "custom",
|
|
17459
|
+
path: ["winners"],
|
|
17460
|
+
message: "Winners must exactly cover the sorted last-wins export closure"
|
|
17461
|
+
});
|
|
17462
|
+
}
|
|
17463
|
+
if (new TextEncoder().encode(serializeCanonicalJson(receipt)).byteLength > tileflowIconCompositionMaximumBytes) {
|
|
17464
|
+
context.addIssue({ code: "custom", message: "Composition receipt exceeds its byte limit" });
|
|
17465
|
+
}
|
|
17466
|
+
});
|
|
17467
|
+
function parseTileflowIconComposition(input) {
|
|
17468
|
+
const parsed = tileflowIconCompositionSchema.safeParse(input);
|
|
17469
|
+
if (!parsed.success)
|
|
17470
|
+
throw new TileflowIconSetError(
|
|
17471
|
+
"ICON_COMPOSITION_INVALID",
|
|
17472
|
+
"Invalid ordered icon composition receipt",
|
|
17473
|
+
{ cause: parsed.error }
|
|
17474
|
+
);
|
|
17475
|
+
return parsed.data;
|
|
17476
|
+
}
|
|
17477
|
+
async function hashTileflowIconComposition(input) {
|
|
17478
|
+
return sha256Hex(
|
|
17479
|
+
`tileflow-icon-composition-v1\0${serializeCanonicalJson(parseTileflowIconComposition(input))}`
|
|
17480
|
+
);
|
|
17481
|
+
}
|
|
17482
|
+
|
|
17483
|
+
// src/icon-sprite-index.ts
|
|
17484
|
+
import { z as z11 } from "zod";
|
|
17485
|
+
var tileflowIconSpriteIndexEntrySchema = z11.object({
|
|
17486
|
+
height: z11.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
17487
|
+
width: z11.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
17488
|
+
pixelRatio: z11.union([z11.literal(1), z11.literal(2)]),
|
|
17489
|
+
x: z11.number().int().nonnegative().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
17490
|
+
y: z11.number().int().nonnegative().max(tileflowIconPackageLimits.maxAtlasDimension)
|
|
17491
|
+
}).strict();
|
|
17492
|
+
var tileflowIconSpriteIndexSchema = z11.record(tileflowIconIdSchema, tileflowIconSpriteIndexEntrySchema).refine(
|
|
17493
|
+
(index) => Object.keys(index).length > 0 && Object.keys(index).length <= tileflowIconPackageLimits.maxIconCount,
|
|
17494
|
+
"A generated sprite index must contain 1 through 256 icons"
|
|
17495
|
+
);
|
|
17115
17496
|
export {
|
|
17497
|
+
TileflowIconSetError,
|
|
17116
17498
|
TileflowMapResolutionError,
|
|
17117
17499
|
TileflowResolvedMapValidationError,
|
|
17118
17500
|
TileflowThemeAuditError,
|
|
@@ -17128,6 +17510,7 @@ export {
|
|
|
17128
17510
|
buildings,
|
|
17129
17511
|
classifyTileflowVisualProperty,
|
|
17130
17512
|
clearTileflowManifestCache,
|
|
17513
|
+
collectTileflowIconSetReferences,
|
|
17131
17514
|
color,
|
|
17132
17515
|
compareCodeUnits11 as compareCodeUnits,
|
|
17133
17516
|
createStyle,
|
|
@@ -17147,15 +17530,18 @@ export {
|
|
|
17147
17530
|
getTileflowAnalyticsApiUrl,
|
|
17148
17531
|
getTileflowStyleFontFaces,
|
|
17149
17532
|
hashTileflowFontBundleManifest,
|
|
17533
|
+
hashTileflowIconComposition,
|
|
17150
17534
|
hashTileflowIconPackageManifest,
|
|
17151
17535
|
hashTileflowRenderedIconPixels,
|
|
17152
17536
|
hostedTileset,
|
|
17537
|
+
iconSet,
|
|
17153
17538
|
inferTileflowAnalyticsFromStyleUrl,
|
|
17154
17539
|
inferTileflowDataRequirements,
|
|
17155
17540
|
inferTileflowSourceRequirements,
|
|
17156
17541
|
isCanonicalOpenMapTilesSchema,
|
|
17157
17542
|
isSafeLocalPmtilesPath,
|
|
17158
17543
|
isTileflowCompilationPhase,
|
|
17544
|
+
isTileflowIconSetSource,
|
|
17159
17545
|
isTileflowLocalDirectory,
|
|
17160
17546
|
isTileflowPortableId,
|
|
17161
17547
|
isTileflowThemeName,
|
|
@@ -17175,6 +17561,9 @@ export {
|
|
|
17175
17561
|
openMapTiles,
|
|
17176
17562
|
openMapTilesContractVersion,
|
|
17177
17563
|
parseResolvedTileflowMap,
|
|
17564
|
+
parseTileflowIconComposition,
|
|
17565
|
+
parseTileflowIconJson,
|
|
17566
|
+
parseTileflowIconsLockfile,
|
|
17178
17567
|
parseTileflowMap,
|
|
17179
17568
|
parseTileflowRuntimeManifest,
|
|
17180
17569
|
poi,
|
|
@@ -17201,6 +17590,7 @@ export {
|
|
|
17201
17590
|
serializeCanonicalJson,
|
|
17202
17591
|
serializeTileflowFontBundleManifest,
|
|
17203
17592
|
serializeTileflowIconPackageManifest,
|
|
17593
|
+
serializeTileflowIconsLockfile,
|
|
17204
17594
|
sha256Hex,
|
|
17205
17595
|
shouldLoadTileflowManifest,
|
|
17206
17596
|
startTileflowSession,
|
|
@@ -17229,6 +17619,8 @@ export {
|
|
|
17229
17619
|
tileflowFontBundleManifestSchema,
|
|
17230
17620
|
tileflowHostedAlphaCompatibility,
|
|
17231
17621
|
tileflowHostedSourceLimit,
|
|
17622
|
+
tileflowIconCompositionMaximumBytes,
|
|
17623
|
+
tileflowIconCompositionSchema,
|
|
17232
17624
|
tileflowIconIdPattern,
|
|
17233
17625
|
tileflowIconIdSchema,
|
|
17234
17626
|
tileflowIconPackageContentHashSchema,
|
|
@@ -17236,6 +17628,19 @@ export {
|
|
|
17236
17628
|
tileflowIconPackageLabelSchema,
|
|
17237
17629
|
tileflowIconPackageLimits,
|
|
17238
17630
|
tileflowIconPackageManifestSchema,
|
|
17631
|
+
tileflowIconSetIdSchema,
|
|
17632
|
+
tileflowIconSetPackageIdSchema,
|
|
17633
|
+
tileflowIconSetPinSchema,
|
|
17634
|
+
tileflowIconSetReferenceSchema,
|
|
17635
|
+
tileflowIconSetSourceSchema,
|
|
17636
|
+
tileflowIconSetTeamIdSchema,
|
|
17637
|
+
tileflowIconSetVersionIdSchema,
|
|
17638
|
+
tileflowIconSourceLimit,
|
|
17639
|
+
tileflowIconSpriteIndexEntrySchema,
|
|
17640
|
+
tileflowIconSpriteIndexSchema,
|
|
17641
|
+
tileflowIconsLockfileMaximumBytes,
|
|
17642
|
+
tileflowIconsLockfileName,
|
|
17643
|
+
tileflowIconsLockfileSchema,
|
|
17239
17644
|
tileflowLandformClasses,
|
|
17240
17645
|
tileflowLocalDirectoryMaximumLength,
|
|
17241
17646
|
tileflowLocalDirectoryMessage,
|
|
@@ -17255,6 +17660,7 @@ export {
|
|
|
17255
17660
|
tileflowRenderStackLimits,
|
|
17256
17661
|
tileflowRenderStackPhases,
|
|
17257
17662
|
tileflowRenderStackRenderers,
|
|
17663
|
+
tileflowRenderedIconIdentitySchema,
|
|
17258
17664
|
tileflowRenderedIconManifestEntrySchema,
|
|
17259
17665
|
tileflowRoadClasses,
|
|
17260
17666
|
tileflowRuntimeManifestLimits,
|