@tileflow/core 0.1.0-alpha.32 → 0.1.0-alpha.33
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 +33 -1
- package/THIRD_PARTY_NOTICES.md +25 -2
- package/dist/browser.d.ts +889 -1
- package/dist/browser.js +6336 -1486
- package/dist/build.d.ts +5 -4
- package/dist/build.js +625 -205
- package/dist/{capture-scene-BaAJjGq7.d.ts → capture-shot-ChPQvPyi.d.ts} +121 -1
- package/dist/capture.d.ts +1 -1
- package/dist/capture.js +218 -0
- package/dist/config-reference.json +300 -4
- package/dist/{icon-composition-Befmn-zZ.d.ts → icon-composition-CSnN2-Xt.d.ts} +130 -2
- package/dist/index.d.ts +49 -5
- package/dist/index.js +1617 -764
- package/dist/native.js +1893 -1884
- package/docs/application-tile-reading.md +80 -0
- package/docs/authoring-model.md +11 -2
- package/docs/buildings-3d.md +168 -0
- package/docs/camera-moves-and-tile-cache.md +112 -0
- package/docs/capture-scenes.md +4 -0
- package/docs/capture-shots.md +173 -0
- package/docs/depth-markers.md +65 -0
- package/docs/public-api-and-browser-subpath.md +3 -3
- package/docs/route-drawing.md +191 -0
- package/docs/street-lights.md +80 -0
- package/docs/sun-and-light.md +125 -0
- package/docs/themes-and-module-styles.md +7 -0
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -440,6 +440,315 @@ var init_values = __esm({
|
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
|
|
443
|
+
// src/theme-blend.ts
|
|
444
|
+
function mixTileflowColours(from, to, t) {
|
|
445
|
+
const a = oklab(from);
|
|
446
|
+
const b = oklab(to);
|
|
447
|
+
if (!a || !b) return void 0;
|
|
448
|
+
return colourFromOklab(a.map((value, channel) => value + (b[channel] - value) * t));
|
|
449
|
+
}
|
|
450
|
+
function oklab(colour) {
|
|
451
|
+
const cached = oklabCache.get(colour);
|
|
452
|
+
if (cached !== void 0) return cached;
|
|
453
|
+
const rgba = parseColour(colour);
|
|
454
|
+
let result = null;
|
|
455
|
+
if (rgba) {
|
|
456
|
+
const [r, g, b] = rgba.slice(0, 3).map((channel) => {
|
|
457
|
+
const value = channel / 255;
|
|
458
|
+
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
459
|
+
});
|
|
460
|
+
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
|
|
461
|
+
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
462
|
+
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
463
|
+
result = [
|
|
464
|
+
0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
465
|
+
1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
466
|
+
0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
467
|
+
rgba[3]
|
|
468
|
+
];
|
|
469
|
+
}
|
|
470
|
+
if (oklabCache.size > 4096) oklabCache.clear();
|
|
471
|
+
oklabCache.set(colour, result);
|
|
472
|
+
return result;
|
|
473
|
+
}
|
|
474
|
+
function colourFromOklab([lightness, a, b, alpha2]) {
|
|
475
|
+
const l = (lightness + 0.3963377774 * a + 0.2158037573 * b) ** 3;
|
|
476
|
+
const m = (lightness - 0.1055613458 * a - 0.0638541728 * b) ** 3;
|
|
477
|
+
const s = (lightness - 0.0894841775 * a - 1.291485548 * b) ** 3;
|
|
478
|
+
const [red, green, blue] = [
|
|
479
|
+
4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
|
|
480
|
+
-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
|
|
481
|
+
-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s
|
|
482
|
+
].map((value) => {
|
|
483
|
+
const clamped = Math.min(1, Math.max(0, value));
|
|
484
|
+
const encoded = clamped <= 31308e-7 ? clamped * 12.92 : 1.055 * clamped ** (1 / 2.4) - 0.055;
|
|
485
|
+
return Math.round(encoded * 255);
|
|
486
|
+
});
|
|
487
|
+
return `rgba(${red}, ${green}, ${blue}, ${Number(alpha2.toFixed(3))})`;
|
|
488
|
+
}
|
|
489
|
+
function tileflowColourChannels(colour) {
|
|
490
|
+
const rgba = parseColour(colour);
|
|
491
|
+
if (!rgba) return null;
|
|
492
|
+
return [
|
|
493
|
+
Math.min(1, Math.max(0, rgba[0] / 255)),
|
|
494
|
+
Math.min(1, Math.max(0, rgba[1] / 255)),
|
|
495
|
+
Math.min(1, Math.max(0, rgba[2] / 255)),
|
|
496
|
+
Math.min(1, Math.max(0, rgba[3]))
|
|
497
|
+
];
|
|
498
|
+
}
|
|
499
|
+
function parseColour(colour) {
|
|
500
|
+
const text = colour.trim().toLowerCase();
|
|
501
|
+
const hex = /^#([\da-f]{3,8})$/u.exec(text)?.[1];
|
|
502
|
+
if (hex && [3, 4, 6, 8].includes(hex.length)) {
|
|
503
|
+
const full = hex.length <= 4 ? [...hex].map((digit) => digit + digit).join("") : hex;
|
|
504
|
+
const channels = full.match(/../gu).map((pair) => Number.parseInt(pair, 16));
|
|
505
|
+
return [channels[0], channels[1], channels[2], channels.length > 3 ? channels[3] / 255 : 1];
|
|
506
|
+
}
|
|
507
|
+
const functional = /^(rgba?|hsla?)\(([^)]+)\)$/u.exec(text);
|
|
508
|
+
if (!functional) return null;
|
|
509
|
+
const parts = functional[2].split(/[\s,/]+/u).filter(Boolean);
|
|
510
|
+
if (parts.length < 3 || parts.length > 4) return null;
|
|
511
|
+
const alpha2 = parts[3] === void 0 ? 1 : parseUnit(parts[3], 1);
|
|
512
|
+
if (functional[1].startsWith("rgb")) {
|
|
513
|
+
const [r, g, b] = parts.slice(0, 3).map((part) => parseUnit(part, 255));
|
|
514
|
+
if ([r, g, b, alpha2].some((value) => value === null)) return null;
|
|
515
|
+
return [r, g, b, alpha2];
|
|
516
|
+
}
|
|
517
|
+
const hue = Number.parseFloat(parts[0]);
|
|
518
|
+
const saturation = parseUnit(parts[1], 1);
|
|
519
|
+
const light = parseUnit(parts[2], 1);
|
|
520
|
+
if (!Number.isFinite(hue) || saturation === null || light === null || alpha2 === null) return null;
|
|
521
|
+
const chroma = (1 - Math.abs(2 * light - 1)) * saturation;
|
|
522
|
+
const sector = (hue % 360 + 360) % 360 / 60;
|
|
523
|
+
const x = chroma * (1 - Math.abs(sector % 2 - 1));
|
|
524
|
+
const [r1, g1, b1] = sector < 1 ? [chroma, x, 0] : sector < 2 ? [x, chroma, 0] : sector < 3 ? [0, chroma, x] : sector < 4 ? [0, x, chroma] : sector < 5 ? [x, 0, chroma] : [chroma, 0, x];
|
|
525
|
+
const offset = light - chroma / 2;
|
|
526
|
+
return [(r1 + offset) * 255, (g1 + offset) * 255, (b1 + offset) * 255, alpha2];
|
|
527
|
+
}
|
|
528
|
+
function parseUnit(part, scale) {
|
|
529
|
+
const percentage = part.endsWith("%");
|
|
530
|
+
const value = Number.parseFloat(part);
|
|
531
|
+
if (!Number.isFinite(value)) return null;
|
|
532
|
+
return percentage ? value / 100 * scale : value;
|
|
533
|
+
}
|
|
534
|
+
var oklabCache;
|
|
535
|
+
var init_theme_blend = __esm({
|
|
536
|
+
"src/theme-blend.ts"() {
|
|
537
|
+
"use strict";
|
|
538
|
+
oklabCache = /* @__PURE__ */ new Map();
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// src/sun.ts
|
|
543
|
+
function normalizeTileflowAzimuth(azimuth) {
|
|
544
|
+
const turned = azimuth % 360;
|
|
545
|
+
return turned < 0 ? turned + 360 : turned === 0 ? 0 : turned;
|
|
546
|
+
}
|
|
547
|
+
function tileflowSunPosition(date, location) {
|
|
548
|
+
const time = typeof date === "number" ? date : date.getTime();
|
|
549
|
+
const [longitude, latitude] = location;
|
|
550
|
+
if (!Number.isFinite(time)) throw new TypeError("The sun position needs a valid date.");
|
|
551
|
+
if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || Math.abs(latitude) > 90) {
|
|
552
|
+
throw new TypeError(
|
|
553
|
+
"The sun position needs a [longitude, latitude] location in degrees, latitude from -90 to 90."
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
const t = (time / 864e5 + 24405875e-1 - 2451545) / 36525;
|
|
557
|
+
const meanLongitude = normalizeTileflowAzimuth(280.46646 + t * (36000.76983 + t * 3032e-7));
|
|
558
|
+
const meanAnomaly = 357.52911 + t * (35999.05029 - 1537e-7 * t);
|
|
559
|
+
const eccentricity = 0.016708634 - t * (42037e-9 + 1267e-10 * t);
|
|
560
|
+
const m = meanAnomaly * degrees;
|
|
561
|
+
const centre = Math.sin(m) * (1.914602 - t * (4817e-6 + 14e-6 * t)) + Math.sin(2 * m) * (0.019993 - 101e-6 * t) + Math.sin(3 * m) * 289e-6;
|
|
562
|
+
const omega = (125.04 - 1934.136 * t) * degrees;
|
|
563
|
+
const apparentLongitude = (meanLongitude + centre - 569e-5 - 478e-5 * Math.sin(omega)) * degrees;
|
|
564
|
+
const meanObliquity = 23 + (26 + (21.448 - t * (46.815 + t * (59e-5 - t * 1813e-6))) / 60) / 60;
|
|
565
|
+
const obliquity = (meanObliquity + 256e-5 * Math.cos(omega)) * degrees;
|
|
566
|
+
const declination = Math.asin(Math.sin(obliquity) * Math.sin(apparentLongitude));
|
|
567
|
+
const y = Math.tan(obliquity / 2) ** 2;
|
|
568
|
+
const l0 = meanLongitude * degrees;
|
|
569
|
+
const equation = 4 / degrees * (y * Math.sin(2 * l0) - 2 * eccentricity * Math.sin(m) + 4 * eccentricity * y * Math.sin(m) * Math.cos(2 * l0) - 0.5 * y * y * Math.sin(4 * l0) - 1.25 * eccentricity * eccentricity * Math.sin(2 * m));
|
|
570
|
+
const minutes = (time % 864e5 + 864e5) % 864e5 / 6e4;
|
|
571
|
+
const solarMinutes = ((minutes + equation + 4 * longitude) % 1440 + 1440) % 1440;
|
|
572
|
+
const hourAngle = (solarMinutes / 4 - 180) * degrees;
|
|
573
|
+
const phi = latitude * degrees;
|
|
574
|
+
const cosZenith = Math.min(
|
|
575
|
+
1,
|
|
576
|
+
Math.max(
|
|
577
|
+
-1,
|
|
578
|
+
Math.sin(phi) * Math.sin(declination) + Math.cos(phi) * Math.cos(declination) * Math.cos(hourAngle)
|
|
579
|
+
)
|
|
580
|
+
);
|
|
581
|
+
const elevation = 90 - Math.acos(cosZenith) / degrees;
|
|
582
|
+
const azimuth = normalizeTileflowAzimuth(
|
|
583
|
+
Math.atan2(
|
|
584
|
+
Math.sin(hourAngle),
|
|
585
|
+
Math.cos(hourAngle) * Math.sin(phi) - Math.tan(declination) * Math.cos(phi)
|
|
586
|
+
) / degrees + 180
|
|
587
|
+
);
|
|
588
|
+
return Object.freeze({ azimuth, altitude: Math.min(90, elevation + refraction(elevation)) });
|
|
589
|
+
}
|
|
590
|
+
function refraction(elevation) {
|
|
591
|
+
if (elevation > 85) return 0;
|
|
592
|
+
const tangent = Math.tan(elevation * degrees);
|
|
593
|
+
let seconds;
|
|
594
|
+
if (elevation > 5) seconds = 58.1 / tangent - 0.07 / tangent ** 3 + 86e-6 / tangent ** 5;
|
|
595
|
+
else if (elevation > -0.575)
|
|
596
|
+
seconds = 1735 + elevation * (-518.2 + elevation * (103.4 + elevation * (-12.79 + elevation * 0.711)));
|
|
597
|
+
else seconds = -20.772 / tangent;
|
|
598
|
+
return seconds / 3600;
|
|
599
|
+
}
|
|
600
|
+
function tileflowSunDirection(azimuth, altitude) {
|
|
601
|
+
const a = azimuth * degrees;
|
|
602
|
+
const h = altitude * degrees;
|
|
603
|
+
return Object.freeze([
|
|
604
|
+
Math.sin(a) * Math.cos(h),
|
|
605
|
+
Math.cos(a) * Math.cos(h),
|
|
606
|
+
Math.sin(h)
|
|
607
|
+
]);
|
|
608
|
+
}
|
|
609
|
+
function resolveTileflowSun(preset, direction = preset, source = "theme") {
|
|
610
|
+
const azimuth = normalizeTileflowAzimuth(direction.azimuth);
|
|
611
|
+
const altitude = Math.min(90, Math.max(-90, direction.altitude));
|
|
612
|
+
const horizon = smoothstep2(-0.5, 3, altitude);
|
|
613
|
+
const intensity = clamp01(preset.intensity) * horizon;
|
|
614
|
+
const rgb = rgbOf(preset.color);
|
|
615
|
+
const ambientRgb = rgbOf(preset.ambient.color);
|
|
616
|
+
const ambientIntensity = clamp01(preset.ambient.intensity);
|
|
617
|
+
const brightness = clamp01(
|
|
618
|
+
(luminance(ambientRgb) * ambientIntensity + luminance(rgb) * intensity * Math.max(0, Math.sin(altitude * degrees))) / 2
|
|
619
|
+
);
|
|
620
|
+
return Object.freeze({
|
|
621
|
+
azimuth,
|
|
622
|
+
altitude,
|
|
623
|
+
direction: tileflowSunDirection(azimuth, altitude),
|
|
624
|
+
color: preset.color,
|
|
625
|
+
rgb,
|
|
626
|
+
intensity,
|
|
627
|
+
shadowIntensity: clamp01(preset.shadowIntensity),
|
|
628
|
+
ambient: Object.freeze({
|
|
629
|
+
color: preset.ambient.color,
|
|
630
|
+
rgb: ambientRgb,
|
|
631
|
+
intensity: ambientIntensity
|
|
632
|
+
}),
|
|
633
|
+
brightness: Number(brightness.toFixed(6)),
|
|
634
|
+
source
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
function mixTileflowSunPresets(from, to, t) {
|
|
638
|
+
const at = clamp01(Number.isFinite(t) ? t : 0);
|
|
639
|
+
if (at === 0) return from;
|
|
640
|
+
if (at === 1) return to;
|
|
641
|
+
const colour = (a, b) => mixTileflowColours(a, b, at) ?? (at < 0.5 ? a : b);
|
|
642
|
+
const number = (a, b) => a + (b - a) * at;
|
|
643
|
+
return Object.freeze({
|
|
644
|
+
azimuth: mixTileflowAzimuths(from.azimuth, to.azimuth, at),
|
|
645
|
+
altitude: number(from.altitude, to.altitude),
|
|
646
|
+
color: colour(from.color, to.color),
|
|
647
|
+
intensity: number(from.intensity, to.intensity),
|
|
648
|
+
shadowIntensity: number(from.shadowIntensity, to.shadowIntensity),
|
|
649
|
+
ambient: Object.freeze({
|
|
650
|
+
color: colour(from.ambient.color, to.ambient.color),
|
|
651
|
+
intensity: number(from.ambient.intensity, to.ambient.intensity)
|
|
652
|
+
})
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
function mixTileflowAzimuths(from, to, t) {
|
|
656
|
+
let delta = normalizeTileflowAzimuth(to) - normalizeTileflowAzimuth(from);
|
|
657
|
+
if (delta > 180) delta -= 360;
|
|
658
|
+
if (delta < -180) delta += 360;
|
|
659
|
+
return normalizeTileflowAzimuth(from + delta * t);
|
|
660
|
+
}
|
|
661
|
+
function tileflowSunMetadata(preset) {
|
|
662
|
+
return Object.freeze({ version: 1, ...preset });
|
|
663
|
+
}
|
|
664
|
+
function readTileflowSunPreset(metadata) {
|
|
665
|
+
if (!isRecord3(metadata)) return void 0;
|
|
666
|
+
const value = metadata[tileflowSunMetadataKey];
|
|
667
|
+
if (!isRecord3(value) || value.version !== 1 || !isRecord3(value.ambient)) return void 0;
|
|
668
|
+
const { azimuth, altitude, color: color3, intensity, shadowIntensity } = value;
|
|
669
|
+
const ambient = value.ambient;
|
|
670
|
+
if (!isFiniteNumber(azimuth) || !isFiniteNumber(altitude) || !isUnit(intensity) || !isUnit(shadowIntensity) || !isUnit(ambient.intensity) || !isColour(color3) || !isColour(ambient.color))
|
|
671
|
+
return void 0;
|
|
672
|
+
return Object.freeze({
|
|
673
|
+
azimuth: normalizeTileflowAzimuth(azimuth),
|
|
674
|
+
altitude: Math.min(90, Math.max(-90, altitude)),
|
|
675
|
+
color: color3,
|
|
676
|
+
intensity,
|
|
677
|
+
shadowIntensity,
|
|
678
|
+
ambient: Object.freeze({ color: ambient.color, intensity: ambient.intensity })
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function tileflowStyleSunPreset(style) {
|
|
682
|
+
const published = readTileflowSunPreset(style?.metadata);
|
|
683
|
+
if (published) return published;
|
|
684
|
+
const light = isRecord3(style?.light) ? style.light : void 0;
|
|
685
|
+
const position = light?.position;
|
|
686
|
+
if (!position) return tileflowDefaultSunPreset;
|
|
687
|
+
return Object.freeze({
|
|
688
|
+
...tileflowDefaultSunPreset,
|
|
689
|
+
azimuth: normalizeTileflowAzimuth(position[1]),
|
|
690
|
+
altitude: Math.min(90, Math.max(-90, 90 - position[2])),
|
|
691
|
+
...typeof light.color === "string" && isColour(light.color) ? { color: light.color } : {}
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
function tileflowSunLight(direction, base) {
|
|
695
|
+
const radial = base?.position?.[0] ?? 1.15;
|
|
696
|
+
return {
|
|
697
|
+
...base ?? {},
|
|
698
|
+
anchor: "map",
|
|
699
|
+
position: [
|
|
700
|
+
radial,
|
|
701
|
+
Number(normalizeTileflowAzimuth(direction.azimuth).toFixed(3)),
|
|
702
|
+
// MapLibre lights the extrusions from above the horizon only.
|
|
703
|
+
Number(Math.min(90, Math.max(0, 90 - direction.altitude)).toFixed(3))
|
|
704
|
+
]
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
function rgbOf(colour) {
|
|
708
|
+
const channels = tileflowColourChannels(colour) ?? [1, 1, 1, 1];
|
|
709
|
+
return Object.freeze([channels[0], channels[1], channels[2]]);
|
|
710
|
+
}
|
|
711
|
+
function luminance([r, g, b]) {
|
|
712
|
+
const linear = (value) => value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
713
|
+
return 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b);
|
|
714
|
+
}
|
|
715
|
+
function smoothstep2(from, to, value) {
|
|
716
|
+
const t = clamp01((value - from) / (to - from));
|
|
717
|
+
return t * t * (3 - 2 * t);
|
|
718
|
+
}
|
|
719
|
+
function clamp01(value) {
|
|
720
|
+
return Math.min(1, Math.max(0, Number.isFinite(value) ? value : 0));
|
|
721
|
+
}
|
|
722
|
+
function isRecord3(value) {
|
|
723
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
724
|
+
}
|
|
725
|
+
function isFiniteNumber(value) {
|
|
726
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
727
|
+
}
|
|
728
|
+
function isUnit(value) {
|
|
729
|
+
return isFiniteNumber(value) && value >= 0 && value <= 1;
|
|
730
|
+
}
|
|
731
|
+
function isColour(value) {
|
|
732
|
+
return typeof value === "string" && tileflowColourChannels(value) !== null;
|
|
733
|
+
}
|
|
734
|
+
var tileflowSunMetadataKey, tileflowDefaultSunPreset, degrees;
|
|
735
|
+
var init_sun = __esm({
|
|
736
|
+
"src/sun.ts"() {
|
|
737
|
+
"use strict";
|
|
738
|
+
init_theme_blend();
|
|
739
|
+
tileflowSunMetadataKey = "tileflow:sun";
|
|
740
|
+
tileflowDefaultSunPreset = Object.freeze({
|
|
741
|
+
azimuth: 210,
|
|
742
|
+
altitude: 60,
|
|
743
|
+
color: "#ffffff",
|
|
744
|
+
intensity: 0.5,
|
|
745
|
+
shadowIntensity: 1,
|
|
746
|
+
ambient: Object.freeze({ color: "#ffffff", intensity: 0.5 })
|
|
747
|
+
});
|
|
748
|
+
degrees = Math.PI / 180;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
443
752
|
// src/themes/visual-semantics.ts
|
|
444
753
|
function classifyTileflowVisualProperty(property, _value) {
|
|
445
754
|
if (property === "color" || property === "colors" || property.endsWith("Color") || property.endsWith("Colors") || property.endsWith("-color") || property.endsWith("-colors")) {
|
|
@@ -582,7 +891,7 @@ function defineTheme(baseOrDefinition, maybeDefinition) {
|
|
|
582
891
|
const theme = {
|
|
583
892
|
colorScheme: definition.colorScheme,
|
|
584
893
|
id: definition.id,
|
|
585
|
-
lighting:
|
|
894
|
+
lighting: mergeLighting(base?.lighting ?? {}, definition.lighting ?? {}),
|
|
586
895
|
tokens: {
|
|
587
896
|
color: mergeRecord(base?.tokens.color ?? {}, definition.tokens?.color ?? {}),
|
|
588
897
|
font: mergeRecord(base?.tokens.font ?? {}, definition.tokens?.font ?? {}),
|
|
@@ -605,11 +914,12 @@ function resolveTileflowTheme(theme) {
|
|
|
605
914
|
number: resolver.resolveCategory("number")
|
|
606
915
|
};
|
|
607
916
|
const typography = resolver.resolveTypography(theme.typography);
|
|
608
|
-
const lighting = resolver.resolveLighting(theme.lighting);
|
|
917
|
+
const { light: lighting, sun } = resolver.resolveLighting(theme.lighting);
|
|
609
918
|
return {
|
|
610
919
|
colorScheme: theme.colorScheme,
|
|
611
920
|
id: theme.id,
|
|
612
921
|
lighting,
|
|
922
|
+
...sun ? { sun } : {},
|
|
613
923
|
tokens,
|
|
614
924
|
typography,
|
|
615
925
|
version: theme.version
|
|
@@ -653,7 +963,7 @@ function auditTileflowThemeValues(value, path = "value", context = inferAuditCon
|
|
|
653
963
|
return diagnostics.sort(compareAuditDiagnostics);
|
|
654
964
|
}
|
|
655
965
|
function auditTileflowMapThemeValues(map) {
|
|
656
|
-
const modules =
|
|
966
|
+
const modules = isRecord4(map.modules) ? map.modules : void 0;
|
|
657
967
|
const moduleDiagnostics = modules ? Object.keys(modules).sort(compareCodeUnits2).flatMap(
|
|
658
968
|
(owner) => auditTileflowThemeValues(modules[owner], `modules.${owner}`, {
|
|
659
969
|
owner,
|
|
@@ -760,7 +1070,7 @@ function isThemePrimitiveForCategory(value, category) {
|
|
|
760
1070
|
return category === "number" ? typeof value === "number" && Number.isFinite(value) || Array.isArray(value) && value.every((entry) => typeof entry === "number" && Number.isFinite(entry)) : typeof value === "string" && value.length > 0;
|
|
761
1071
|
}
|
|
762
1072
|
function isThemeValueCandidate(value) {
|
|
763
|
-
return
|
|
1073
|
+
return isRecord4(value) && (value.kind === "theme-token" || value.kind === "theme-fixed" || value.kind === "theme-color");
|
|
764
1074
|
}
|
|
765
1075
|
function visitAuditableValue(value, path, category, state, intentRequired = false) {
|
|
766
1076
|
if (isThemeStructuralPath(path)) category = void 0;
|
|
@@ -776,7 +1086,7 @@ function visitAuditableValue(value, path, category, state, intentRequired = fals
|
|
|
776
1086
|
visitAuditableArray(value, path, category, state, false, intentRequired);
|
|
777
1087
|
return;
|
|
778
1088
|
}
|
|
779
|
-
if (!
|
|
1089
|
+
if (!isRecord4(value)) return;
|
|
780
1090
|
if (value.kind === "expression" && Array.isArray(value.value)) {
|
|
781
1091
|
visitAuditableArray(value.value, `${path}.value`, category, state, true, intentRequired);
|
|
782
1092
|
return;
|
|
@@ -1122,6 +1432,24 @@ function assertThemeTypographyStyleFields(style, path) {
|
|
|
1122
1432
|
function assertThemeLighting(value, path) {
|
|
1123
1433
|
const lighting = assertPlainThemeRecord(value, path);
|
|
1124
1434
|
assertExactThemeKeys(lighting, path, themeLightingKeys);
|
|
1435
|
+
if (Object.hasOwn(lighting, "sun")) {
|
|
1436
|
+
const sun = assertPlainThemeRecord(lighting.sun, `${path}.sun`);
|
|
1437
|
+
assertExactThemeKeys(sun, `${path}.sun`, themeSunKeys);
|
|
1438
|
+
for (const key of ["altitude", "azimuth", "intensity", "shadowIntensity"]) {
|
|
1439
|
+
if (Object.hasOwn(sun, key))
|
|
1440
|
+
assertThemeCategoryValue(sun[key], "number", `${path}.sun.${key}`);
|
|
1441
|
+
}
|
|
1442
|
+
if (Object.hasOwn(sun, "color"))
|
|
1443
|
+
assertThemeCategoryValue(sun.color, "color", `${path}.sun.color`);
|
|
1444
|
+
}
|
|
1445
|
+
if (Object.hasOwn(lighting, "ambient")) {
|
|
1446
|
+
const ambient = assertPlainThemeRecord(lighting.ambient, `${path}.ambient`);
|
|
1447
|
+
assertExactThemeKeys(ambient, `${path}.ambient`, themeAmbientKeys);
|
|
1448
|
+
if (Object.hasOwn(ambient, "intensity"))
|
|
1449
|
+
assertThemeCategoryValue(ambient.intensity, "number", `${path}.ambient.intensity`);
|
|
1450
|
+
if (Object.hasOwn(ambient, "color"))
|
|
1451
|
+
assertThemeCategoryValue(ambient.color, "color", `${path}.ambient.color`);
|
|
1452
|
+
}
|
|
1125
1453
|
if (Object.hasOwn(lighting, "anchor") && lighting.anchor !== "map" && lighting.anchor !== "viewport") {
|
|
1126
1454
|
throw themeTypeError(`${path}.anchor`, "map or viewport", lighting.anchor);
|
|
1127
1455
|
}
|
|
@@ -1141,7 +1469,7 @@ function assertThemeLighting(value, path) {
|
|
|
1141
1469
|
}
|
|
1142
1470
|
}
|
|
1143
1471
|
function assertThemeCategoryValue(value, expectedCategory, path) {
|
|
1144
|
-
if (!
|
|
1472
|
+
if (!isRecord4(value)) {
|
|
1145
1473
|
assertTokenPrimitive(expectedCategory, value, path);
|
|
1146
1474
|
return;
|
|
1147
1475
|
}
|
|
@@ -1288,6 +1616,7 @@ function inferThemeCategoryFromPath(path) {
|
|
|
1288
1616
|
const tokenCategory = path.match(/^theme\.tokens\.(color|font|image|number)(?:\.|$)/u)?.[1];
|
|
1289
1617
|
if (isThemeTokenCategory(tokenCategory)) return tokenCategory;
|
|
1290
1618
|
if (/^theme\.lighting\.position(?:\[\d+\])?$/u.test(path)) return "number";
|
|
1619
|
+
if (/^theme\.lighting\.sun\.(?:altitude|azimuth|shadowIntensity)$/u.test(path)) return "number";
|
|
1291
1620
|
const segments = path.replace(/\[\d+\]/g, "").split(".");
|
|
1292
1621
|
return [...segments].reverse().map((segment) => classifyTileflowVisualProperty(segment)).find((category) => category !== void 0);
|
|
1293
1622
|
}
|
|
@@ -1329,6 +1658,15 @@ function mergeOptionalStyle(key, base, overlay) {
|
|
|
1329
1658
|
const value = mergeRecord(base[key] ?? {}, overlay?.[key] ?? {});
|
|
1330
1659
|
return Object.keys(value).length ? { [key]: value } : {};
|
|
1331
1660
|
}
|
|
1661
|
+
function mergeLighting(base, overlay) {
|
|
1662
|
+
const merged = mergeRecord(base, overlay);
|
|
1663
|
+
for (const key of ["sun", "ambient"]) {
|
|
1664
|
+
if (base[key] !== void 0 && overlay[key] !== void 0) {
|
|
1665
|
+
merged[key] = mergeRecord(base[key], overlay[key]);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
return merged;
|
|
1669
|
+
}
|
|
1332
1670
|
function mergeRecord(base, overlay) {
|
|
1333
1671
|
if (!isPlainRecord(base) || !isPlainRecord(overlay)) {
|
|
1334
1672
|
throw new Error("Tileflow theme composition accepts only plain JSON objects.");
|
|
@@ -1410,9 +1748,9 @@ function oklchToRgba({ c, h, l }) {
|
|
|
1410
1748
|
const sLinear = sRoot ** 3;
|
|
1411
1749
|
return {
|
|
1412
1750
|
a: 1,
|
|
1413
|
-
b:
|
|
1414
|
-
g:
|
|
1415
|
-
r:
|
|
1751
|
+
b: clamp012(-0.0041960863 * lLinear - 0.7034186147 * mLinear + 1.707614701 * sLinear),
|
|
1752
|
+
g: clamp012(-1.2684380046 * lLinear + 2.6097574011 * mLinear - 0.3413193965 * sLinear),
|
|
1753
|
+
r: clamp012(4.0767416621 * lLinear - 3.3077115913 * mLinear + 0.2309699292 * sLinear)
|
|
1416
1754
|
};
|
|
1417
1755
|
}
|
|
1418
1756
|
function formatColor({ a, b, g, r }) {
|
|
@@ -1423,7 +1761,7 @@ function formatColor({ a, b, g, r }) {
|
|
|
1423
1761
|
return `rgba(${channels[0]}, ${channels[1]}, ${channels[2]}, ${round(a, 4)})`;
|
|
1424
1762
|
}
|
|
1425
1763
|
function formatSrgbColor({ a, b, g, r }) {
|
|
1426
|
-
const channels = [r, g, b].map((entry) => Math.round(
|
|
1764
|
+
const channels = [r, g, b].map((entry) => Math.round(clamp012(entry) * 255));
|
|
1427
1765
|
if (a >= 0.9995) {
|
|
1428
1766
|
return `#${channels.map((entry) => entry.toString(16).padStart(2, "0")).join("")}`;
|
|
1429
1767
|
}
|
|
@@ -1433,7 +1771,7 @@ function srgbToLinear(value) {
|
|
|
1433
1771
|
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
1434
1772
|
}
|
|
1435
1773
|
function linearToSrgb(value) {
|
|
1436
|
-
const clamped =
|
|
1774
|
+
const clamped = clamp012(value);
|
|
1437
1775
|
return clamped <= 31308e-7 ? clamped * 12.92 : 1.055 * clamped ** (1 / 2.4) - 0.055;
|
|
1438
1776
|
}
|
|
1439
1777
|
function assertColor(value, path) {
|
|
@@ -1480,7 +1818,7 @@ function describe(value) {
|
|
|
1480
1818
|
function interpolate(from, to, amount) {
|
|
1481
1819
|
return from + (to - from) * amount;
|
|
1482
1820
|
}
|
|
1483
|
-
function
|
|
1821
|
+
function clamp012(value) {
|
|
1484
1822
|
return Math.max(0, Math.min(1, value));
|
|
1485
1823
|
}
|
|
1486
1824
|
function round(value, digits) {
|
|
@@ -1492,24 +1830,25 @@ function cloneJson14(value) {
|
|
|
1492
1830
|
if (serialized === void 0) throw new Error("Tileflow themes must be JSON-serializable.");
|
|
1493
1831
|
return JSON.parse(serialized);
|
|
1494
1832
|
}
|
|
1495
|
-
function
|
|
1833
|
+
function isRecord4(value) {
|
|
1496
1834
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
1497
1835
|
}
|
|
1498
1836
|
function isPlainRecord(value) {
|
|
1499
|
-
if (!
|
|
1837
|
+
if (!isRecord4(value)) return false;
|
|
1500
1838
|
const prototype = Object.getPrototypeOf(value);
|
|
1501
1839
|
return prototype === Object.prototype || prototype === null;
|
|
1502
1840
|
}
|
|
1503
1841
|
function compareCodeUnits2(left, right) {
|
|
1504
1842
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
1505
1843
|
}
|
|
1506
|
-
var tileflowThemeLimits, TileflowThemeAuditError, defaultTypography, themeDocumentKeys, themeDefinitionRequiredKeys, themeTypographyStyleKeys, themeTypographyKeys, themeTypographyDomains, themeLightingKeys, expressionDataOperators, ThemeValueResolver, themeStructuralPathSegments;
|
|
1844
|
+
var tileflowThemeLimits, TileflowThemeAuditError, defaultTypography, themeDocumentKeys, themeDefinitionRequiredKeys, themeTypographyStyleKeys, themeTypographyKeys, themeTypographyDomains, themeLightingKeys, themeSunKeys, themeAmbientKeys, expressionDataOperators, ThemeValueResolver, themeStructuralPathSegments;
|
|
1507
1845
|
var init_model = __esm({
|
|
1508
1846
|
"src/themes/model.ts"() {
|
|
1509
1847
|
"use strict";
|
|
1510
1848
|
init_expression_operators();
|
|
1511
1849
|
init_values();
|
|
1512
1850
|
init_portable_identity_rules();
|
|
1851
|
+
init_sun();
|
|
1513
1852
|
init_visual_semantics();
|
|
1514
1853
|
tileflowThemeLimits = Object.freeze({ maxThemes: 64 });
|
|
1515
1854
|
TileflowThemeAuditError = class extends Error {
|
|
@@ -1545,7 +1884,9 @@ var init_model = __esm({
|
|
|
1545
1884
|
"water"
|
|
1546
1885
|
];
|
|
1547
1886
|
themeTypographyDomains = ["places", "poi", "roads", "water"];
|
|
1548
|
-
themeLightingKeys = ["anchor", "color", "intensity", "position"];
|
|
1887
|
+
themeLightingKeys = ["ambient", "anchor", "color", "intensity", "position", "sun"];
|
|
1888
|
+
themeSunKeys = ["altitude", "azimuth", "color", "intensity", "shadowIntensity"];
|
|
1889
|
+
themeAmbientKeys = ["color", "intensity"];
|
|
1549
1890
|
expressionDataOperators = /* @__PURE__ */ new Set([
|
|
1550
1891
|
"accumulated",
|
|
1551
1892
|
"collator",
|
|
@@ -1606,7 +1947,7 @@ var init_model = __esm({
|
|
|
1606
1947
|
if (Array.isArray(value)) {
|
|
1607
1948
|
return value.map((entry, index) => this.resolveTree(entry, `${path}[${index}]`, category));
|
|
1608
1949
|
}
|
|
1609
|
-
if (!
|
|
1950
|
+
if (!isRecord4(value)) return value;
|
|
1610
1951
|
if (value.kind === "expression" && Array.isArray(value.value)) {
|
|
1611
1952
|
return {
|
|
1612
1953
|
...value,
|
|
@@ -1646,6 +1987,65 @@ var init_model = __esm({
|
|
|
1646
1987
|
};
|
|
1647
1988
|
}
|
|
1648
1989
|
resolveLighting(lighting) {
|
|
1990
|
+
const { ambient, sun, ...flat } = lighting;
|
|
1991
|
+
const light = this.#resolveFlatLight(flat);
|
|
1992
|
+
if (sun === void 0 && ambient === void 0) return { light };
|
|
1993
|
+
const resolvedSun = this.resolveTree(sun ?? {}, "theme.lighting.sun");
|
|
1994
|
+
const resolvedAmbient = this.resolveTree(ambient ?? {}, "theme.lighting.ambient");
|
|
1995
|
+
const defaults4 = tileflowDefaultSunPreset;
|
|
1996
|
+
const number = (value, path, fallback, range2) => {
|
|
1997
|
+
if (value === void 0) return fallback;
|
|
1998
|
+
assertFiniteNumber(value, path);
|
|
1999
|
+
if (range2 && (value < range2[0] || value > range2[1])) {
|
|
2000
|
+
throw new Error(`Tileflow ${path} must be between ${range2[0]} and ${range2[1]}.`);
|
|
2001
|
+
}
|
|
2002
|
+
return value;
|
|
2003
|
+
};
|
|
2004
|
+
const colour = (value, path, fallback) => {
|
|
2005
|
+
if (value === void 0) return fallback;
|
|
2006
|
+
assertColor(value, path);
|
|
2007
|
+
return value;
|
|
2008
|
+
};
|
|
2009
|
+
const preset = {
|
|
2010
|
+
azimuth: normalizeTileflowAzimuth(
|
|
2011
|
+
number(resolvedSun.azimuth, "theme.lighting.sun.azimuth", defaults4.azimuth)
|
|
2012
|
+
),
|
|
2013
|
+
altitude: number(
|
|
2014
|
+
resolvedSun.altitude,
|
|
2015
|
+
"theme.lighting.sun.altitude",
|
|
2016
|
+
defaults4.altitude,
|
|
2017
|
+
[-90, 90]
|
|
2018
|
+
),
|
|
2019
|
+
color: colour(resolvedSun.color, "theme.lighting.sun.color", defaults4.color),
|
|
2020
|
+
intensity: number(
|
|
2021
|
+
resolvedSun.intensity,
|
|
2022
|
+
"theme.lighting.sun.intensity",
|
|
2023
|
+
defaults4.intensity,
|
|
2024
|
+
[0, 1]
|
|
2025
|
+
),
|
|
2026
|
+
shadowIntensity: number(
|
|
2027
|
+
resolvedSun.shadowIntensity,
|
|
2028
|
+
"theme.lighting.sun.shadowIntensity",
|
|
2029
|
+
defaults4.shadowIntensity,
|
|
2030
|
+
[0, 1]
|
|
2031
|
+
),
|
|
2032
|
+
ambient: {
|
|
2033
|
+
color: colour(
|
|
2034
|
+
resolvedAmbient.color,
|
|
2035
|
+
"theme.lighting.ambient.color",
|
|
2036
|
+
defaults4.ambient.color
|
|
2037
|
+
),
|
|
2038
|
+
intensity: number(
|
|
2039
|
+
resolvedAmbient.intensity,
|
|
2040
|
+
"theme.lighting.ambient.intensity",
|
|
2041
|
+
defaults4.ambient.intensity,
|
|
2042
|
+
[0, 1]
|
|
2043
|
+
)
|
|
2044
|
+
}
|
|
2045
|
+
};
|
|
2046
|
+
return { light: sun === void 0 ? light : tileflowSunLight(preset, light), sun: preset };
|
|
2047
|
+
}
|
|
2048
|
+
#resolveFlatLight(lighting) {
|
|
1649
2049
|
const result = this.resolveTree(lighting, "theme.lighting");
|
|
1650
2050
|
if (result.anchor !== void 0 && result.anchor !== "map" && result.anchor !== "viewport") {
|
|
1651
2051
|
throw themeTypeError("theme.lighting.anchor", "map or viewport", result.anchor);
|
|
@@ -2238,6 +2638,216 @@ function hasControlCharacter(value) {
|
|
|
2238
2638
|
return false;
|
|
2239
2639
|
}
|
|
2240
2640
|
|
|
2641
|
+
// src/capture-shot.ts
|
|
2642
|
+
import { z as z4 } from "zod";
|
|
2643
|
+
|
|
2644
|
+
// src/capture-shot-motion.ts
|
|
2645
|
+
function tileflowShotStateAt(shot, at) {
|
|
2646
|
+
const { keyframes } = shot;
|
|
2647
|
+
const first = keyframes[0];
|
|
2648
|
+
const last = keyframes.at(-1);
|
|
2649
|
+
if (!first || !last || keyframes.length < 2)
|
|
2650
|
+
throw new TypeError("A shot needs at least two keyframes.");
|
|
2651
|
+
const time = Math.min(last.at, Math.max(first.at, Number.isFinite(at) ? at : first.at));
|
|
2652
|
+
let segment = 0;
|
|
2653
|
+
while (segment < keyframes.length - 2 && time > keyframes[segment + 1].at) segment += 1;
|
|
2654
|
+
const from = keyframes[segment];
|
|
2655
|
+
const to = keyframes[segment + 1];
|
|
2656
|
+
const linear = Math.min(1, Math.max(0, (time - from.at) / (to.at - from.at)));
|
|
2657
|
+
const t = shot.easing === "linear" ? linear : smoothstep(linear);
|
|
2658
|
+
return {
|
|
2659
|
+
at: time,
|
|
2660
|
+
camera: interpolateCamera(cameraOf(from), cameraOf(to), t),
|
|
2661
|
+
...from.blend && to.blend ? { blendPosition: interpolateNumber(from.blend.position, to.blend.position, t) } : {}
|
|
2662
|
+
};
|
|
2663
|
+
}
|
|
2664
|
+
function cameraOf({ camera }) {
|
|
2665
|
+
return {
|
|
2666
|
+
type: "center",
|
|
2667
|
+
center: [camera.center[0], camera.center[1]],
|
|
2668
|
+
zoom: camera.zoom,
|
|
2669
|
+
bearing: camera.bearing ?? 0,
|
|
2670
|
+
pitch: camera.pitch ?? 0
|
|
2671
|
+
};
|
|
2672
|
+
}
|
|
2673
|
+
var maximumMercatorLatitude = 85.051129;
|
|
2674
|
+
function interpolateCamera(from, to, t) {
|
|
2675
|
+
return {
|
|
2676
|
+
type: "center",
|
|
2677
|
+
center: interpolateCenter(from.center, to.center, t),
|
|
2678
|
+
zoom: interpolateNumber(from.zoom, to.zoom, t),
|
|
2679
|
+
bearing: interpolateBearing(from.bearing, to.bearing, t),
|
|
2680
|
+
pitch: interpolateNumber(from.pitch, to.pitch, t)
|
|
2681
|
+
};
|
|
2682
|
+
}
|
|
2683
|
+
function interpolateNumber(from, to, t) {
|
|
2684
|
+
if (t <= 0 || from === to) return from;
|
|
2685
|
+
if (t >= 1) return to;
|
|
2686
|
+
return from + (to - from) * t;
|
|
2687
|
+
}
|
|
2688
|
+
function interpolateCenter(from, to, t) {
|
|
2689
|
+
if (t <= 0 || from[0] === to[0] && from[1] === to[1]) return [from[0], from[1]];
|
|
2690
|
+
if (t >= 1) return [to[0], to[1]];
|
|
2691
|
+
const start = mercatorFromLngLat(from);
|
|
2692
|
+
const end = mercatorFromLngLat(to);
|
|
2693
|
+
let dx = end[0] - start[0];
|
|
2694
|
+
if (dx > 0.5) dx -= 1;
|
|
2695
|
+
else if (dx < -0.5) dx += 1;
|
|
2696
|
+
return lngLatFromMercator([start[0] + dx * t, start[1] + (end[1] - start[1]) * t]);
|
|
2697
|
+
}
|
|
2698
|
+
function interpolateBearing(from, to, t) {
|
|
2699
|
+
if (t <= 0 || from === to) return from;
|
|
2700
|
+
if (t >= 1) return to;
|
|
2701
|
+
const delta = ((to - from) % 360 + 540) % 360 - 180;
|
|
2702
|
+
return wrapDegrees(from + delta * t);
|
|
2703
|
+
}
|
|
2704
|
+
function mercatorFromLngLat([longitude, latitude]) {
|
|
2705
|
+
const clamped = Math.max(-maximumMercatorLatitude, Math.min(maximumMercatorLatitude, latitude));
|
|
2706
|
+
return [
|
|
2707
|
+
(180 + longitude) / 360,
|
|
2708
|
+
(180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + clamped * Math.PI / 360))) / 360
|
|
2709
|
+
];
|
|
2710
|
+
}
|
|
2711
|
+
function lngLatFromMercator([x, y]) {
|
|
2712
|
+
const latitude = 360 / Math.PI * Math.atan(Math.exp((180 - y * 360) * Math.PI / 180)) - 90;
|
|
2713
|
+
return [wrapDegrees(x * 360 - 180), latitude];
|
|
2714
|
+
}
|
|
2715
|
+
function wrapDegrees(value) {
|
|
2716
|
+
if (value >= -180 && value <= 180) return value;
|
|
2717
|
+
return ((value + 180) % 360 + 360) % 360 - 180;
|
|
2718
|
+
}
|
|
2719
|
+
function smoothstep(t) {
|
|
2720
|
+
return t * t * (3 - 2 * t);
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
// src/capture-shot.ts
|
|
2724
|
+
init_portable_identity();
|
|
2725
|
+
var tileflowCaptureShotSchemaVersion = 1;
|
|
2726
|
+
var tileflowCaptureShotLimits = Object.freeze({
|
|
2727
|
+
blendThemes: Object.freeze({ maximum: 8, minimum: 2 }),
|
|
2728
|
+
defaultFps: 30,
|
|
2729
|
+
durationMs: Object.freeze({ maximum: 6e4 }),
|
|
2730
|
+
fps: Object.freeze([24, 25, 30, 50, 60]),
|
|
2731
|
+
keyframes: Object.freeze({ maximum: 64, minimum: 2 }),
|
|
2732
|
+
maximumFrames: 3600
|
|
2733
|
+
});
|
|
2734
|
+
var tileflowCaptureShotNameSchema = tileflowCaptureSceneNameSchema;
|
|
2735
|
+
var tileflowCaptureShotBlendSchema = z4.object({
|
|
2736
|
+
themes: z4.array(tileflowThemeNameSchema).min(tileflowCaptureShotLimits.blendThemes.minimum).max(tileflowCaptureShotLimits.blendThemes.maximum),
|
|
2737
|
+
position: z4.number().finite().min(0)
|
|
2738
|
+
}).strict().superRefine((blend, context) => {
|
|
2739
|
+
if (new Set(blend.themes).size !== blend.themes.length) {
|
|
2740
|
+
context.addIssue({ code: "custom", message: "Expected distinct themes", path: ["themes"] });
|
|
2741
|
+
}
|
|
2742
|
+
if (blend.position > blend.themes.length - 1) {
|
|
2743
|
+
context.addIssue({
|
|
2744
|
+
code: "custom",
|
|
2745
|
+
message: `Expected a position from 0 to ${blend.themes.length - 1}`,
|
|
2746
|
+
path: ["position"]
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
});
|
|
2750
|
+
var tileflowCaptureShotKeyframeSchema = z4.object({
|
|
2751
|
+
at: z4.number().int().min(0).max(tileflowCaptureShotLimits.durationMs.maximum),
|
|
2752
|
+
camera: tileflowCaptureCenterCameraSchema,
|
|
2753
|
+
blend: tileflowCaptureShotBlendSchema.optional()
|
|
2754
|
+
}).strict();
|
|
2755
|
+
var tileflowCaptureShotFields = {
|
|
2756
|
+
theme: tileflowThemeNameSchema,
|
|
2757
|
+
viewport: tileflowCaptureViewportSchema,
|
|
2758
|
+
fps: z4.literal(tileflowCaptureShotLimits.fps).optional(),
|
|
2759
|
+
keyframes: z4.array(tileflowCaptureShotKeyframeSchema).min(tileflowCaptureShotLimits.keyframes.minimum).max(tileflowCaptureShotLimits.keyframes.maximum),
|
|
2760
|
+
easing: z4.enum(["smooth", "linear"]).optional()
|
|
2761
|
+
};
|
|
2762
|
+
var tileflowCaptureShotSchema = z4.object({ map: tileflowPortableIdSchema, ...tileflowCaptureShotFields }).strict().superRefine(checkShotTiming);
|
|
2763
|
+
var tileflowMapShotSchema = z4.object(tileflowCaptureShotFields).strict().superRefine(checkShotTiming);
|
|
2764
|
+
function normalizeTileflowCaptureShot(input) {
|
|
2765
|
+
const shot = tileflowCaptureShotSchema.parse(input);
|
|
2766
|
+
return { map: shot.map, ...normalizeShotFields(shot) };
|
|
2767
|
+
}
|
|
2768
|
+
function tileflowCaptureShotFrameCount(shot) {
|
|
2769
|
+
const fps = shot.fps ?? tileflowCaptureShotLimits.defaultFps;
|
|
2770
|
+
const duration = shot.keyframes.at(-1)?.at ?? 0;
|
|
2771
|
+
return Math.floor(duration * fps / 1e3 + 1e-9) + 1;
|
|
2772
|
+
}
|
|
2773
|
+
function tileflowCaptureShotFrames(shot) {
|
|
2774
|
+
const { map: _map, ...fields } = shot;
|
|
2775
|
+
const normalized = normalizeShotFields(tileflowMapShotSchema.parse(fields));
|
|
2776
|
+
const count = tileflowCaptureShotFrameCount(normalized);
|
|
2777
|
+
const duration = normalized.keyframes.at(-1).at;
|
|
2778
|
+
const frames = [];
|
|
2779
|
+
for (let index = 0; index < count; index += 1) {
|
|
2780
|
+
const at = Math.min(duration, index * 1e3 / normalized.fps);
|
|
2781
|
+
frames.push({ index, ...tileflowShotStateAt(normalized, at) });
|
|
2782
|
+
}
|
|
2783
|
+
return frames;
|
|
2784
|
+
}
|
|
2785
|
+
function normalizeShotFields(shot) {
|
|
2786
|
+
return {
|
|
2787
|
+
theme: shot.theme,
|
|
2788
|
+
viewport: { ...shot.viewport, dpr: shot.viewport.dpr ?? 1 },
|
|
2789
|
+
fps: shot.fps ?? tileflowCaptureShotLimits.defaultFps,
|
|
2790
|
+
easing: shot.easing ?? "smooth",
|
|
2791
|
+
keyframes: shot.keyframes.map((keyframe) => ({
|
|
2792
|
+
at: keyframe.at,
|
|
2793
|
+
camera: {
|
|
2794
|
+
type: "center",
|
|
2795
|
+
center: keyframe.camera.center,
|
|
2796
|
+
zoom: keyframe.camera.zoom,
|
|
2797
|
+
bearing: keyframe.camera.bearing ?? 0,
|
|
2798
|
+
pitch: keyframe.camera.pitch ?? 0
|
|
2799
|
+
},
|
|
2800
|
+
...keyframe.blend ? { blend: { themes: [...keyframe.blend.themes], position: keyframe.blend.position } } : {}
|
|
2801
|
+
}))
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
function checkShotTiming(shot, context) {
|
|
2805
|
+
const { keyframes } = shot;
|
|
2806
|
+
if (keyframes[0] && keyframes[0].at !== 0) {
|
|
2807
|
+
context.addIssue({
|
|
2808
|
+
code: "custom",
|
|
2809
|
+
message: "Expected the first keyframe at 0 milliseconds",
|
|
2810
|
+
path: ["keyframes", 0, "at"]
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
for (let index = 1; index < keyframes.length; index += 1) {
|
|
2814
|
+
if (keyframes[index].at <= keyframes[index - 1].at) {
|
|
2815
|
+
context.addIssue({
|
|
2816
|
+
code: "custom",
|
|
2817
|
+
message: "Expected a time after the previous keyframe",
|
|
2818
|
+
path: ["keyframes", index, "at"]
|
|
2819
|
+
});
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
const blended = keyframes.filter((keyframe) => keyframe.blend !== void 0);
|
|
2823
|
+
if (blended.length > 0) {
|
|
2824
|
+
const themes = JSON.stringify(blended[0].blend.themes);
|
|
2825
|
+
keyframes.forEach((keyframe, index) => {
|
|
2826
|
+
if (!keyframe.blend) {
|
|
2827
|
+
context.addIssue({
|
|
2828
|
+
code: "custom",
|
|
2829
|
+
message: "Expected a blend on every keyframe when one keyframe blends themes",
|
|
2830
|
+
path: ["keyframes", index, "blend"]
|
|
2831
|
+
});
|
|
2832
|
+
} else if (JSON.stringify(keyframe.blend.themes) !== themes) {
|
|
2833
|
+
context.addIssue({
|
|
2834
|
+
code: "custom",
|
|
2835
|
+
message: "Expected the same themes, in the same order, on every keyframe",
|
|
2836
|
+
path: ["keyframes", index, "blend", "themes"]
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
const frames = tileflowCaptureShotFrameCount(shot);
|
|
2842
|
+
if (frames > tileflowCaptureShotLimits.maximumFrames) {
|
|
2843
|
+
context.addIssue({
|
|
2844
|
+
code: "custom",
|
|
2845
|
+
message: `Expected at most ${tileflowCaptureShotLimits.maximumFrames} frames; this shot renders ${frames}`,
|
|
2846
|
+
path: ["keyframes", keyframes.length - 1, "at"]
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2241
2851
|
// src/cartography/compilation-report.ts
|
|
2242
2852
|
var tileflowCompilationReportSchemaVersion = 1;
|
|
2243
2853
|
var tileflowCompilationPhases = Object.freeze([
|
|
@@ -2379,7 +2989,7 @@ var tileflowWorldGeneration = "v1";
|
|
|
2379
2989
|
var tileflowWorldTileJsonUrl = "https://api.tileflow.dev/tiles/world/tiles.json";
|
|
2380
2990
|
|
|
2381
2991
|
// src/data/world-release-id.ts
|
|
2382
|
-
import { z as
|
|
2992
|
+
import { z as z5 } from "zod";
|
|
2383
2993
|
|
|
2384
2994
|
// src/data/world-release-id-values.ts
|
|
2385
2995
|
var tileflowWorldReleaseIdMinimumLength = 12;
|
|
@@ -2391,7 +3001,7 @@ function isTileflowWorldReleaseId(value) {
|
|
|
2391
3001
|
}
|
|
2392
3002
|
|
|
2393
3003
|
// src/data/world-release-id.ts
|
|
2394
|
-
var tileflowWorldReleaseIdSchema =
|
|
3004
|
+
var tileflowWorldReleaseIdSchema = z5.string().min(tileflowWorldReleaseIdMinimumLength).max(tileflowWorldReleaseIdMaximumLength).regex(tileflowWorldReleaseIdPattern);
|
|
2395
3005
|
|
|
2396
3006
|
// src/data/index.ts
|
|
2397
3007
|
var tileflowPrimarySourceId = "tileflow";
|
|
@@ -7608,7 +8218,7 @@ function compileRoads(request, context) {
|
|
|
7608
8218
|
});
|
|
7609
8219
|
}
|
|
7610
8220
|
}
|
|
7611
|
-
compileSidewalks(request?.sidewalks, context, contributions);
|
|
8221
|
+
compileSidewalks(request?.sidewalks, areaStyles.pedestrian?.fill?.color, context, contributions);
|
|
7612
8222
|
compileRoundabouts(request?.roundabouts, context, contributions);
|
|
7613
8223
|
compileCrossings(request?.crossings, context, contributions);
|
|
7614
8224
|
if (semantics.oneWayMarkers && visible.size > 0) {
|
|
@@ -7677,15 +8287,15 @@ function roadPhysicalCohort(roadClass) {
|
|
|
7677
8287
|
if (roadClass === "minor" || roadClass === "service" || roadClass === "track") return "local";
|
|
7678
8288
|
return "path";
|
|
7679
8289
|
}
|
|
7680
|
-
function compileSidewalks(request, context, contributions) {
|
|
8290
|
+
function compileSidewalks(request, pedestrianAreaColor, context, contributions) {
|
|
7681
8291
|
const { fields, layers } = context.data.schema;
|
|
7682
8292
|
if (!layers.sidewalk) return;
|
|
7683
8293
|
const config = mergeTileflowDesign(
|
|
7684
8294
|
{
|
|
7685
8295
|
surface: {
|
|
7686
|
-
color: context.colors.
|
|
8296
|
+
color: pedestrianAreaColor ?? context.colors.road,
|
|
7687
8297
|
minZoom: 17,
|
|
7688
|
-
opacity:
|
|
8298
|
+
opacity: 1
|
|
7689
8299
|
}
|
|
7690
8300
|
},
|
|
7691
8301
|
request
|
|
@@ -8337,10 +8947,10 @@ function roadWidth(roadClass, scale) {
|
|
|
8337
8947
|
[16, 3.4]
|
|
8338
8948
|
]
|
|
8339
8949
|
};
|
|
8340
|
-
return zoom.linear(stops[roadClass].map(([
|
|
8950
|
+
return zoom.linear(stops[roadClass].map(([z15, value]) => [z15, value * scale]));
|
|
8341
8951
|
}
|
|
8342
8952
|
function widen(value, addition) {
|
|
8343
|
-
return zoom.linear(value.stops.map(([
|
|
8953
|
+
return zoom.linear(value.stops.map(([z15, width]) => [z15, width + addition]));
|
|
8344
8954
|
}
|
|
8345
8955
|
function structureFilter(field2, structure) {
|
|
8346
8956
|
if (structure === "surface") {
|
|
@@ -9661,7 +10271,7 @@ function isPlainRecord2(value) {
|
|
|
9661
10271
|
|
|
9662
10272
|
// src/resolved-map-schema.ts
|
|
9663
10273
|
import { Color as Color3 } from "@maplibre/maplibre-gl-style-spec";
|
|
9664
|
-
import { z as
|
|
10274
|
+
import { z as z7 } from "zod";
|
|
9665
10275
|
|
|
9666
10276
|
// src/cartography/data-expression.ts
|
|
9667
10277
|
init_values();
|
|
@@ -9844,24 +10454,39 @@ function validateStops(stops, api) {
|
|
|
9844
10454
|
}
|
|
9845
10455
|
}
|
|
9846
10456
|
function validateOperandCount(count, api) {
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
10457
|
+
const limit = tileflowDataExpressionLimits.maxOperands;
|
|
10458
|
+
if (count > limit) {
|
|
10459
|
+
throw limitError(
|
|
10460
|
+
`${api} received ${count} operands; it supports at most ${limit}. Nest ${api} calls of at most ${limit} operands each.`
|
|
9850
10461
|
);
|
|
9851
10462
|
}
|
|
9852
10463
|
}
|
|
9853
10464
|
function validateBranchCount(count, api) {
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
10465
|
+
const limit = tileflowDataExpressionLimits.maxBranches;
|
|
10466
|
+
if (count > limit) {
|
|
10467
|
+
throw limitError(
|
|
10468
|
+
`${api} received ${count} branches; it supports at most ${limit}. Split the lookup into nested ${api} groups of at most ${limit} branches, or reduce the mapping.`
|
|
9857
10469
|
);
|
|
9858
10470
|
}
|
|
9859
10471
|
}
|
|
9860
10472
|
function validateStopCount(count, api) {
|
|
9861
|
-
|
|
9862
|
-
|
|
10473
|
+
const limit = tileflowDataExpressionLimits.maxStops;
|
|
10474
|
+
if (count > limit) {
|
|
10475
|
+
throw limitError(
|
|
10476
|
+
`${api} received ${count} stops; it supports at most ${limit}. Remove stops the curve can interpolate.`
|
|
10477
|
+
);
|
|
9863
10478
|
}
|
|
9864
10479
|
}
|
|
10480
|
+
function limitError(message) {
|
|
10481
|
+
const site = authoringCallSite(new Error().stack);
|
|
10482
|
+
return new Error(site ? `${message} Called at ${site}.` : message);
|
|
10483
|
+
}
|
|
10484
|
+
function authoringCallSite(stack) {
|
|
10485
|
+
const locations = (stack ?? "").split("\n").slice(1).map((line) => /\(?([^()\s]+?):(\d+):(\d+)\)?$/.exec(line.trim())).filter((match2) => match2 !== null).map(([, file, line, column]) => ({ file: file.replace(/^file:\/\//, ""), line, column }));
|
|
10486
|
+
const own = locations[0]?.file;
|
|
10487
|
+
const site = locations.find(({ file }) => file !== own && !file.startsWith("node:"));
|
|
10488
|
+
return site ? `${site.file}:${site.line}:${site.column}` : void 0;
|
|
10489
|
+
}
|
|
9865
10490
|
function node(value) {
|
|
9866
10491
|
if (isTileflowExpression(value)) return cloneJson19(value.value);
|
|
9867
10492
|
if (isDataFieldReference(value)) return ["get", cloneJson19(value)];
|
|
@@ -10055,7 +10680,11 @@ function visitExpression(value, path, variables, issues) {
|
|
|
10055
10680
|
return;
|
|
10056
10681
|
}
|
|
10057
10682
|
if ((value.length - 2) / 2 > branchLimit) {
|
|
10058
|
-
addExpressionIssue(
|
|
10683
|
+
addExpressionIssue(
|
|
10684
|
+
issues,
|
|
10685
|
+
path,
|
|
10686
|
+
`Expression case has ${(value.length - 2) / 2} branches and exceeds ${branchLimit}.`
|
|
10687
|
+
);
|
|
10059
10688
|
return;
|
|
10060
10689
|
}
|
|
10061
10690
|
for (let index = 1; index < value.length; index += 1) visit(value[index], index);
|
|
@@ -10071,7 +10700,11 @@ function visitExpression(value, path, variables, issues) {
|
|
|
10071
10700
|
return;
|
|
10072
10701
|
}
|
|
10073
10702
|
if ((value.length - 3) / 2 > branchLimit) {
|
|
10074
|
-
addExpressionIssue(
|
|
10703
|
+
addExpressionIssue(
|
|
10704
|
+
issues,
|
|
10705
|
+
path,
|
|
10706
|
+
`Expression match has ${(value.length - 3) / 2} branches and exceeds ${branchLimit}.`
|
|
10707
|
+
);
|
|
10075
10708
|
return;
|
|
10076
10709
|
}
|
|
10077
10710
|
visit(value[1], 1);
|
|
@@ -10300,21 +10933,21 @@ function bindSemanticValue(value, schema, sourceId) {
|
|
|
10300
10933
|
}
|
|
10301
10934
|
if (isDataSourceReference(value)) return sourceId;
|
|
10302
10935
|
if (Array.isArray(value)) return value.map((item) => bindSemanticValue(item, schema, sourceId));
|
|
10303
|
-
if (!
|
|
10936
|
+
if (!isRecord5(value)) return value;
|
|
10304
10937
|
return Object.fromEntries(
|
|
10305
10938
|
Object.entries(value).map(([key, item]) => [key, bindSemanticValue(item, schema, sourceId)])
|
|
10306
10939
|
);
|
|
10307
10940
|
}
|
|
10308
10941
|
function isDataFieldReference2(value) {
|
|
10309
|
-
return
|
|
10942
|
+
return isRecord5(value) && value.kind === "tileflow-data-field" && typeof value.name === "string";
|
|
10310
10943
|
}
|
|
10311
10944
|
function isDataLayerReference(value) {
|
|
10312
|
-
return
|
|
10945
|
+
return isRecord5(value) && value.kind === "tileflow-data-layer" && typeof value.name === "string";
|
|
10313
10946
|
}
|
|
10314
10947
|
function isDataSourceReference(value) {
|
|
10315
|
-
return
|
|
10948
|
+
return isRecord5(value) && value.kind === "tileflow-data-source" && value.name === "primary";
|
|
10316
10949
|
}
|
|
10317
|
-
function
|
|
10950
|
+
function isRecord5(value) {
|
|
10318
10951
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
10319
10952
|
}
|
|
10320
10953
|
function compareCodeUnits5(left, right) {
|
|
@@ -10418,8 +11051,8 @@ function createTileflowLayerTemplateIR(layer, semanticKey) {
|
|
|
10418
11051
|
renderer: type,
|
|
10419
11052
|
...filter === void 0 ? {} : { selector: cloneJson20(filter) },
|
|
10420
11053
|
style: Object.freeze({
|
|
10421
|
-
...
|
|
10422
|
-
...
|
|
11054
|
+
...isRecord6(layout) ? { placement: Object.freeze(cloneJson20(layout)) } : {},
|
|
11055
|
+
...isRecord6(paint) ? { appearance: Object.freeze(cloneJson20(paint)) } : {}
|
|
10423
11056
|
})
|
|
10424
11057
|
});
|
|
10425
11058
|
}
|
|
@@ -10659,21 +11292,21 @@ function visitReferences(value, counts, visited = /* @__PURE__ */ new WeakSet())
|
|
|
10659
11292
|
}
|
|
10660
11293
|
}
|
|
10661
11294
|
function isSemanticFieldReference(value) {
|
|
10662
|
-
return
|
|
11295
|
+
return isRecord6(value) && value.kind === "tileflow-data-field";
|
|
10663
11296
|
}
|
|
10664
11297
|
function isSemanticLayerReference(value) {
|
|
10665
|
-
return
|
|
11298
|
+
return isRecord6(value) && value.kind === "tileflow-data-layer";
|
|
10666
11299
|
}
|
|
10667
11300
|
function isSemanticSourceReference(value) {
|
|
10668
|
-
return
|
|
11301
|
+
return isRecord6(value) && value.kind === "tileflow-data-source";
|
|
10669
11302
|
}
|
|
10670
11303
|
function cloneJson20(value) {
|
|
10671
11304
|
return JSON.parse(JSON.stringify(value));
|
|
10672
11305
|
}
|
|
10673
11306
|
function asRecord4(value) {
|
|
10674
|
-
return
|
|
11307
|
+
return isRecord6(value) ? value : {};
|
|
10675
11308
|
}
|
|
10676
|
-
function
|
|
11309
|
+
function isRecord6(value) {
|
|
10677
11310
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
10678
11311
|
}
|
|
10679
11312
|
|
|
@@ -10737,7 +11370,7 @@ function validateTileflowRenderSelectorConstraints(input) {
|
|
|
10737
11370
|
};
|
|
10738
11371
|
while (pending.length > 0) {
|
|
10739
11372
|
const current = pending.pop();
|
|
10740
|
-
if (!
|
|
11373
|
+
if (!isRecord7(current.selector) || typeof current.selector.kind !== "string") {
|
|
10741
11374
|
addIssue(
|
|
10742
11375
|
"invalid-selector",
|
|
10743
11376
|
"a render selector must be a semantic selector node",
|
|
@@ -10798,7 +11431,7 @@ function validateTileflowRenderSelectorConstraints(input) {
|
|
|
10798
11431
|
}
|
|
10799
11432
|
for (const [index, branch] of current.selector.branches.entries()) {
|
|
10800
11433
|
const branchPath = [...branchesPath, index];
|
|
10801
|
-
if (!
|
|
11434
|
+
if (!isRecord7(branch)) {
|
|
10802
11435
|
addIssue("invalid-selector", "match selector branch must be an object", branchPath);
|
|
10803
11436
|
continue;
|
|
10804
11437
|
}
|
|
@@ -10829,14 +11462,14 @@ function validateTileflowRenderSelectorConstraints(input) {
|
|
|
10829
11462
|
for (let index = current.selector.stops.length - 1; index >= 0; index -= 1) {
|
|
10830
11463
|
const stop = current.selector.stops[index];
|
|
10831
11464
|
const stopPath = [...stopsPath, index];
|
|
10832
|
-
if (!
|
|
11465
|
+
if (!isRecord7(stop)) {
|
|
10833
11466
|
addIssue("invalid-selector", "step selector stop must be an object", stopPath);
|
|
10834
11467
|
continue;
|
|
10835
11468
|
}
|
|
10836
11469
|
pushChild(stop.selector, current.depth + 1, [...stopPath, "selector"]);
|
|
10837
11470
|
}
|
|
10838
11471
|
for (const [index, stop] of current.selector.stops.entries()) {
|
|
10839
|
-
if (!
|
|
11472
|
+
if (!isRecord7(stop)) continue;
|
|
10840
11473
|
const zoom3 = stop.zoom;
|
|
10841
11474
|
const zoomPath = [...stopsPath, index, "zoom"];
|
|
10842
11475
|
if (typeof zoom3 !== "number" || !Number.isFinite(zoom3) || zoom3 < 0 || zoom3 > 24) {
|
|
@@ -11219,7 +11852,7 @@ function applyRendererStyle(layer, renderer, style) {
|
|
|
11219
11852
|
};
|
|
11220
11853
|
}
|
|
11221
11854
|
function lowerSelector(selector, data) {
|
|
11222
|
-
if (!
|
|
11855
|
+
if (!isRecord7(selector) || typeof selector.kind !== "string") {
|
|
11223
11856
|
throw renderStackError(
|
|
11224
11857
|
"invalid-selector",
|
|
11225
11858
|
"A render selector must be a semantic selector node."
|
|
@@ -11422,7 +12055,7 @@ function requireRenderer(value) {
|
|
|
11422
12055
|
function requirePlacement(value) {
|
|
11423
12056
|
if (typeof value === "string") {
|
|
11424
12057
|
if (tileflowBandPlacements.includes(value)) return;
|
|
11425
|
-
} else if (
|
|
12058
|
+
} else if (isRecord7(value)) {
|
|
11426
12059
|
const keys = Object.keys(value);
|
|
11427
12060
|
if (keys.length === 1 && (keys[0] === "above" || keys[0] === "below")) {
|
|
11428
12061
|
requirePortableTarget(value[keys[0]], "render placement target");
|
|
@@ -11449,7 +12082,7 @@ function validateRefinementShape(operation) {
|
|
|
11449
12082
|
validateStyle(operation.renderer, operation.style);
|
|
11450
12083
|
}
|
|
11451
12084
|
function validateStyle(renderer, style) {
|
|
11452
|
-
if (!
|
|
12085
|
+
if (!isRecord7(style)) {
|
|
11453
12086
|
throw renderStackError(
|
|
11454
12087
|
"invalid-style",
|
|
11455
12088
|
`A ${renderer} render operation requires a style object.`
|
|
@@ -11551,7 +12184,7 @@ function normalizeRequirements(requirements) {
|
|
|
11551
12184
|
return [...requirements];
|
|
11552
12185
|
}
|
|
11553
12186
|
function requireRenderStackEntries(stack) {
|
|
11554
|
-
if (!
|
|
12187
|
+
if (!isRecord7(stack)) {
|
|
11555
12188
|
throw renderStackError("invalid-stack", "A render stack must be a named operation record.");
|
|
11556
12189
|
}
|
|
11557
12190
|
const entries = Object.entries(stack);
|
|
@@ -11698,9 +12331,9 @@ function cloneJson21(value) {
|
|
|
11698
12331
|
return JSON.parse(JSON.stringify(value));
|
|
11699
12332
|
}
|
|
11700
12333
|
function asRecord5(value) {
|
|
11701
|
-
return
|
|
12334
|
+
return isRecord7(value) ? value : {};
|
|
11702
12335
|
}
|
|
11703
|
-
function
|
|
12336
|
+
function isRecord7(value) {
|
|
11704
12337
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
11705
12338
|
}
|
|
11706
12339
|
|
|
@@ -11708,18 +12341,18 @@ function isRecord6(value) {
|
|
|
11708
12341
|
init_values();
|
|
11709
12342
|
|
|
11710
12343
|
// src/icon-set.ts
|
|
11711
|
-
import { z as
|
|
12344
|
+
import { z as z6 } from "zod";
|
|
11712
12345
|
var tileflowIconSourceLimit = 32;
|
|
11713
12346
|
var slug = "[a-z0-9]+(?:-[a-z0-9]+)*";
|
|
11714
|
-
var tileflowIconSetReferenceSchema =
|
|
12347
|
+
var tileflowIconSetReferenceSchema = z6.string().max(130).regex(
|
|
11715
12348
|
new RegExp(`^@${slug}/${slug}$`, "u"),
|
|
11716
12349
|
"Expected a canonical @team/set reference without a version suffix"
|
|
11717
12350
|
).refine(
|
|
11718
12351
|
(value) => value.slice(1).split("/").every((part) => part.length <= 64),
|
|
11719
12352
|
"Team and set slugs must contain at most 64 characters"
|
|
11720
12353
|
);
|
|
11721
|
-
var tileflowIconSetSourceSchema =
|
|
11722
|
-
kind:
|
|
12354
|
+
var tileflowIconSetSourceSchema = z6.object({
|
|
12355
|
+
kind: z6.literal("icon-set"),
|
|
11723
12356
|
reference: tileflowIconSetReferenceSchema
|
|
11724
12357
|
}).strict();
|
|
11725
12358
|
function iconSet(reference) {
|
|
@@ -11730,10 +12363,10 @@ function iconSet(reference) {
|
|
|
11730
12363
|
function isTileflowIconSetSource(value) {
|
|
11731
12364
|
return tileflowIconSetSourceSchema.safeParse(value).success;
|
|
11732
12365
|
}
|
|
11733
|
-
var tileflowIconSetIdSchema =
|
|
11734
|
-
var tileflowIconSetVersionIdSchema =
|
|
11735
|
-
var tileflowIconSetPackageIdSchema =
|
|
11736
|
-
var tileflowIconSetTeamIdSchema =
|
|
12366
|
+
var tileflowIconSetIdSchema = z6.string().regex(/^ics_[A-Za-z0-9_-]{16}$/u);
|
|
12367
|
+
var tileflowIconSetVersionIdSchema = z6.string().regex(/^icv_[A-Za-z0-9_-]{16}$/u);
|
|
12368
|
+
var tileflowIconSetPackageIdSchema = z6.string().regex(/^icp_[A-Za-z0-9_-]{16,64}$/u);
|
|
12369
|
+
var tileflowIconSetTeamIdSchema = z6.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/u);
|
|
11737
12370
|
var TileflowIconSetError = class extends Error {
|
|
11738
12371
|
constructor(code, message, options) {
|
|
11739
12372
|
super(message, options);
|
|
@@ -11923,11 +12556,11 @@ var TileflowResolvedMapValidationError = class extends Error {
|
|
|
11923
12556
|
this.messages = messages;
|
|
11924
12557
|
}
|
|
11925
12558
|
};
|
|
11926
|
-
var identifierSchema =
|
|
11927
|
-
var revisionSchema =
|
|
11928
|
-
var zoomNumberSchema =
|
|
12559
|
+
var identifierSchema = z7.string().trim().regex(/^[A-Za-z0-9_-]+$/, "Expected letters, numbers, underscores, or hyphens").refine((value) => value !== "__proto__", "Expected a safe identifier");
|
|
12560
|
+
var revisionSchema = z7.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/, "Expected a portable data revision");
|
|
12561
|
+
var zoomNumberSchema = z7.number().finite().min(0).max(24);
|
|
11929
12562
|
function zoomValueSchemaFor(valueSchema) {
|
|
11930
|
-
const stops =
|
|
12563
|
+
const stops = z7.array(z7.tuple([zoomNumberSchema, valueSchema])).min(1).superRefine((entries, context) => {
|
|
11931
12564
|
for (let index = 1; index < entries.length; index += 1) {
|
|
11932
12565
|
if (entries[index][0] <= entries[index - 1][0]) {
|
|
11933
12566
|
context.addIssue({
|
|
@@ -11938,105 +12571,105 @@ function zoomValueSchemaFor(valueSchema) {
|
|
|
11938
12571
|
}
|
|
11939
12572
|
}
|
|
11940
12573
|
});
|
|
11941
|
-
return
|
|
11942
|
-
|
|
11943
|
-
base:
|
|
11944
|
-
interpolation:
|
|
11945
|
-
kind:
|
|
12574
|
+
return z7.discriminatedUnion("interpolation", [
|
|
12575
|
+
z7.object({
|
|
12576
|
+
base: z7.number().finite().positive(),
|
|
12577
|
+
interpolation: z7.literal("exponential"),
|
|
12578
|
+
kind: z7.literal("zoom"),
|
|
11946
12579
|
stops
|
|
11947
12580
|
}).strict(),
|
|
11948
|
-
|
|
11949
|
-
interpolation:
|
|
11950
|
-
kind:
|
|
12581
|
+
z7.object({
|
|
12582
|
+
interpolation: z7.literal("linear"),
|
|
12583
|
+
kind: z7.literal("zoom"),
|
|
11951
12584
|
stops
|
|
11952
12585
|
}).strict(),
|
|
11953
|
-
|
|
11954
|
-
interpolation:
|
|
11955
|
-
kind:
|
|
12586
|
+
z7.object({
|
|
12587
|
+
interpolation: z7.literal("step"),
|
|
12588
|
+
kind: z7.literal("zoom"),
|
|
11956
12589
|
stops
|
|
11957
12590
|
}).strict()
|
|
11958
12591
|
]);
|
|
11959
12592
|
}
|
|
11960
|
-
var themeTokenNameSchema =
|
|
12593
|
+
var themeTokenNameSchema = z7.string().regex(
|
|
11961
12594
|
/^[A-Za-z][A-Za-z0-9_-]*(?:\.[A-Za-z][A-Za-z0-9_-]*)*$/,
|
|
11962
12595
|
"Expected a portable dot-separated semantic token name"
|
|
11963
12596
|
);
|
|
11964
|
-
var themeTokenReferenceSchema =
|
|
11965
|
-
category:
|
|
11966
|
-
kind:
|
|
12597
|
+
var themeTokenReferenceSchema = z7.object({
|
|
12598
|
+
category: z7.enum(tileflowThemeTokenCategories),
|
|
12599
|
+
kind: z7.literal("theme-token"),
|
|
11967
12600
|
token: themeTokenNameSchema
|
|
11968
12601
|
}).strict();
|
|
11969
12602
|
var themeNumberReferenceSchema = themeTokenReferenceSchema.extend({
|
|
11970
|
-
category:
|
|
12603
|
+
category: z7.literal("number")
|
|
11971
12604
|
});
|
|
11972
|
-
var fixedNumberSchema =
|
|
11973
|
-
kind:
|
|
11974
|
-
reason:
|
|
11975
|
-
value:
|
|
12605
|
+
var fixedNumberSchema = z7.object({
|
|
12606
|
+
kind: z7.literal("theme-fixed"),
|
|
12607
|
+
reason: z7.string().trim().min(1),
|
|
12608
|
+
value: z7.number().finite()
|
|
11976
12609
|
}).strict();
|
|
11977
|
-
var fixedNumberArraySchema =
|
|
11978
|
-
kind:
|
|
11979
|
-
reason:
|
|
11980
|
-
value:
|
|
12610
|
+
var fixedNumberArraySchema = z7.object({
|
|
12611
|
+
kind: z7.literal("theme-fixed"),
|
|
12612
|
+
reason: z7.string().trim().min(1),
|
|
12613
|
+
value: z7.array(z7.number().finite())
|
|
11981
12614
|
}).strict();
|
|
11982
|
-
var fixedNumberOffsetSchema =
|
|
11983
|
-
kind:
|
|
11984
|
-
reason:
|
|
11985
|
-
value:
|
|
12615
|
+
var fixedNumberOffsetSchema = z7.object({
|
|
12616
|
+
kind: z7.literal("theme-fixed"),
|
|
12617
|
+
reason: z7.string().trim().min(1),
|
|
12618
|
+
value: z7.tuple([z7.number().finite(), z7.number().finite()])
|
|
11986
12619
|
}).strict();
|
|
11987
|
-
var fixedNumberInsetsSchema =
|
|
11988
|
-
kind:
|
|
11989
|
-
reason:
|
|
11990
|
-
value:
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
12620
|
+
var fixedNumberInsetsSchema = z7.object({
|
|
12621
|
+
kind: z7.literal("theme-fixed"),
|
|
12622
|
+
reason: z7.string().trim().min(1),
|
|
12623
|
+
value: z7.tuple([
|
|
12624
|
+
z7.number().finite(),
|
|
12625
|
+
z7.number().finite(),
|
|
12626
|
+
z7.number().finite(),
|
|
12627
|
+
z7.number().finite()
|
|
11995
12628
|
])
|
|
11996
12629
|
}).strict();
|
|
11997
|
-
var fixedStringSchema =
|
|
11998
|
-
var themeColorOperationSchema =
|
|
11999
|
-
() =>
|
|
12000
|
-
|
|
12630
|
+
var fixedStringSchema = z7.object({ kind: z7.literal("theme-fixed"), reason: z7.string().trim().min(1), value: z7.string() }).strict();
|
|
12631
|
+
var themeColorOperationSchema = z7.lazy(
|
|
12632
|
+
() => z7.discriminatedUnion("operation", [
|
|
12633
|
+
z7.object({
|
|
12001
12634
|
color: themeColorValueSchema,
|
|
12002
|
-
kind:
|
|
12635
|
+
kind: z7.literal("theme-color"),
|
|
12003
12636
|
opacity: themeNumberValueSchema,
|
|
12004
|
-
operation:
|
|
12637
|
+
operation: z7.literal("alpha")
|
|
12005
12638
|
}).strict(),
|
|
12006
|
-
|
|
12639
|
+
z7.object({
|
|
12007
12640
|
amount: themeNumberValueSchema,
|
|
12008
12641
|
from: themeColorValueSchema,
|
|
12009
|
-
kind:
|
|
12010
|
-
operation:
|
|
12011
|
-
space:
|
|
12642
|
+
kind: z7.literal("theme-color"),
|
|
12643
|
+
operation: z7.literal("mix"),
|
|
12644
|
+
space: z7.literal("oklch"),
|
|
12012
12645
|
to: themeColorValueSchema
|
|
12013
12646
|
}).strict()
|
|
12014
12647
|
])
|
|
12015
12648
|
);
|
|
12016
|
-
var themeNumberValueSchema =
|
|
12017
|
-
() =>
|
|
12649
|
+
var themeNumberValueSchema = z7.lazy(
|
|
12650
|
+
() => z7.union([z7.number().finite(), fixedNumberSchema, themeNumberReferenceSchema])
|
|
12018
12651
|
);
|
|
12019
|
-
var themeColorValueSchema =
|
|
12020
|
-
() =>
|
|
12021
|
-
|
|
12652
|
+
var themeColorValueSchema = z7.lazy(
|
|
12653
|
+
() => z7.union([
|
|
12654
|
+
z7.string().min(1),
|
|
12022
12655
|
fixedStringSchema,
|
|
12023
|
-
themeTokenReferenceSchema.extend({ category:
|
|
12656
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("color") }),
|
|
12024
12657
|
themeColorOperationSchema
|
|
12025
12658
|
])
|
|
12026
12659
|
);
|
|
12027
|
-
var themeFontValueSchema =
|
|
12028
|
-
|
|
12660
|
+
var themeFontValueSchema = z7.union([
|
|
12661
|
+
z7.string().min(1),
|
|
12029
12662
|
fixedStringSchema,
|
|
12030
|
-
themeTokenReferenceSchema.extend({ category:
|
|
12663
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("font") })
|
|
12031
12664
|
]);
|
|
12032
|
-
var themeImageValueSchema =
|
|
12033
|
-
|
|
12665
|
+
var themeImageValueSchema = z7.union([
|
|
12666
|
+
z7.string().min(1),
|
|
12034
12667
|
fixedStringSchema,
|
|
12035
|
-
themeTokenReferenceSchema.extend({ category:
|
|
12668
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("image") })
|
|
12036
12669
|
]);
|
|
12037
12670
|
function expressionSchemaFor(expectedCategory) {
|
|
12038
12671
|
const category = expectedCategory ?? "structural";
|
|
12039
|
-
return
|
|
12672
|
+
return z7.object({ kind: z7.literal("expression"), value: z7.array(z7.unknown()).min(1) }).strict().superRefine((expression2, context) => {
|
|
12040
12673
|
for (const issue of validateTileflowDataExpression(expression2.value)) {
|
|
12041
12674
|
context.addIssue({
|
|
12042
12675
|
code: "custom",
|
|
@@ -12083,18 +12716,20 @@ function validateExpressionThemeValues(value, expectedCategory, context, path) {
|
|
|
12083
12716
|
if (!parsed.success || parsed.data.category !== expectedCategory) {
|
|
12084
12717
|
context.addIssue({
|
|
12085
12718
|
code: "custom",
|
|
12086
|
-
message: expectedCategory === void 0 ?
|
|
12719
|
+
message: expectedCategory === void 0 ? `Structural expressions cannot contain theme-token references. ${structuralThemeValueHint}` : parsed.success ? `Expected a ${expectedCategory} theme-token reference, received ${parsed.data.category} token "${parsed.data.token}". ${expressionOperandHint(expectedCategory)}` : `Expected a ${expectedCategory} theme-token reference`,
|
|
12087
12720
|
path
|
|
12088
12721
|
});
|
|
12089
12722
|
}
|
|
12090
12723
|
return;
|
|
12091
12724
|
}
|
|
12092
12725
|
if (candidate.kind === "theme-fixed") {
|
|
12093
|
-
const parsed = expectedCategory === "number" ?
|
|
12726
|
+
const parsed = expectedCategory === "number" ? z7.union([fixedNumberSchema, fixedNumberArraySchema]).safeParse(candidate) : expectedCategory === "color" || expectedCategory === "image" ? fixedStringSchema.safeParse(candidate) : void 0;
|
|
12094
12727
|
if (!parsed?.success) {
|
|
12728
|
+
const received = fixedValueKind(candidate.value);
|
|
12729
|
+
const literal2 = JSON.stringify(candidate.value);
|
|
12095
12730
|
context.addIssue({
|
|
12096
12731
|
code: "custom",
|
|
12097
|
-
message: expectedCategory === void 0 ?
|
|
12732
|
+
message: expectedCategory === void 0 ? `Structural expressions cannot contain theme-fixed values. ${structuralThemeValueHint}` : received !== void 0 && received !== expectedCategoryKind(expectedCategory) ? `Expected a fixed ${expectedCategory} value, received a fixed ${received}. ${expressionOperandHint(expectedCategory)} Write ${literal2} instead of fixed(${literal2}).` : `Expected a fixed ${expectedCategory} value`,
|
|
12098
12733
|
path
|
|
12099
12734
|
});
|
|
12100
12735
|
}
|
|
@@ -12114,6 +12749,20 @@ function validateExpressionThemeValues(value, expectedCategory, context, path) {
|
|
|
12114
12749
|
validateExpressionThemeValues(entry, expectedCategory, context, [...path, key]);
|
|
12115
12750
|
}
|
|
12116
12751
|
}
|
|
12752
|
+
var structuralThemeValueHint = "fixed() and theme tokens apply only to visual properties such as colours, sizes, and images; write structural values directly.";
|
|
12753
|
+
function expressionOperandHint(category) {
|
|
12754
|
+
return `In ${category === "image" ? "an" : "a"} ${category} expression, fixed() and theme tokens belong in its ${category} results; conditions and other operands take plain values.`;
|
|
12755
|
+
}
|
|
12756
|
+
function fixedValueKind(value) {
|
|
12757
|
+
if (typeof value === "number") return "number";
|
|
12758
|
+
if (typeof value === "string") return "string";
|
|
12759
|
+
if (typeof value === "boolean") return "boolean";
|
|
12760
|
+
if (Array.isArray(value)) return "array";
|
|
12761
|
+
return void 0;
|
|
12762
|
+
}
|
|
12763
|
+
function expectedCategoryKind(category) {
|
|
12764
|
+
return category === "number" ? "number" : "string";
|
|
12765
|
+
}
|
|
12117
12766
|
var numberExpressionSchema = expressionSchemaFor("number");
|
|
12118
12767
|
var colorExpressionSchema = expressionSchemaFor("color");
|
|
12119
12768
|
var imageExpressionSchema = expressionSchemaFor("image");
|
|
@@ -12121,80 +12770,80 @@ var structuralExpressionSchema = expressionSchemaFor(void 0);
|
|
|
12121
12770
|
var numberZoomValueSchema = zoomValueSchemaFor(themeNumberValueSchema);
|
|
12122
12771
|
var colorZoomValueSchema = zoomValueSchemaFor(themeColorValueSchema);
|
|
12123
12772
|
var imageZoomValueSchema = zoomValueSchemaFor(themeImageValueSchema);
|
|
12124
|
-
var stringZoomValueSchema = zoomValueSchemaFor(
|
|
12125
|
-
var numberValueSchema =
|
|
12773
|
+
var stringZoomValueSchema = zoomValueSchemaFor(z7.string());
|
|
12774
|
+
var numberValueSchema = z7.union([
|
|
12126
12775
|
themeNumberValueSchema,
|
|
12127
12776
|
numberExpressionSchema,
|
|
12128
12777
|
numberZoomValueSchema
|
|
12129
12778
|
]);
|
|
12130
|
-
var structuralNumberValueSchema =
|
|
12131
|
-
|
|
12779
|
+
var structuralNumberValueSchema = z7.union([
|
|
12780
|
+
z7.number().finite(),
|
|
12132
12781
|
structuralExpressionSchema,
|
|
12133
|
-
zoomValueSchemaFor(
|
|
12782
|
+
zoomValueSchemaFor(z7.number().finite())
|
|
12134
12783
|
]);
|
|
12135
|
-
var colorValueSchema =
|
|
12784
|
+
var colorValueSchema = z7.union([
|
|
12136
12785
|
themeColorValueSchema,
|
|
12137
12786
|
colorExpressionSchema,
|
|
12138
12787
|
colorZoomValueSchema
|
|
12139
12788
|
]);
|
|
12140
|
-
var imageValueSchema =
|
|
12789
|
+
var imageValueSchema = z7.union([
|
|
12141
12790
|
themeImageValueSchema,
|
|
12142
12791
|
imageExpressionSchema,
|
|
12143
12792
|
imageZoomValueSchema
|
|
12144
12793
|
]);
|
|
12145
|
-
var stringValueSchema =
|
|
12146
|
-
var themeNumberArraySchema =
|
|
12147
|
-
var themeNumberArrayValueSchema =
|
|
12148
|
-
var numberArrayValueSchema =
|
|
12794
|
+
var stringValueSchema = z7.union([z7.string(), structuralExpressionSchema, stringZoomValueSchema]);
|
|
12795
|
+
var themeNumberArraySchema = z7.array(themeNumberValueSchema);
|
|
12796
|
+
var themeNumberArrayValueSchema = z7.union([themeNumberArraySchema, fixedNumberArraySchema]);
|
|
12797
|
+
var numberArrayValueSchema = z7.union([
|
|
12149
12798
|
themeNumberArrayValueSchema,
|
|
12150
12799
|
numberExpressionSchema,
|
|
12151
12800
|
zoomValueSchemaFor(themeNumberArrayValueSchema)
|
|
12152
12801
|
]);
|
|
12153
|
-
var themeNumberOffsetSchema =
|
|
12154
|
-
var themeNumberOffsetValueSchema =
|
|
12155
|
-
var numberOffsetValueSchema =
|
|
12802
|
+
var themeNumberOffsetSchema = z7.tuple([themeNumberValueSchema, themeNumberValueSchema]);
|
|
12803
|
+
var themeNumberOffsetValueSchema = z7.union([themeNumberOffsetSchema, fixedNumberOffsetSchema]);
|
|
12804
|
+
var numberOffsetValueSchema = z7.union([
|
|
12156
12805
|
themeNumberOffsetValueSchema,
|
|
12157
12806
|
numberExpressionSchema,
|
|
12158
12807
|
zoomValueSchemaFor(themeNumberOffsetValueSchema)
|
|
12159
12808
|
]);
|
|
12160
|
-
var themeNumberInsetsSchema =
|
|
12809
|
+
var themeNumberInsetsSchema = z7.tuple([
|
|
12161
12810
|
themeNumberValueSchema,
|
|
12162
12811
|
themeNumberValueSchema,
|
|
12163
12812
|
themeNumberValueSchema,
|
|
12164
12813
|
themeNumberValueSchema
|
|
12165
12814
|
]);
|
|
12166
|
-
var themeNumberInsetsValueSchema =
|
|
12167
|
-
var numberInsetsValueSchema =
|
|
12815
|
+
var themeNumberInsetsValueSchema = z7.union([themeNumberInsetsSchema, fixedNumberInsetsSchema]);
|
|
12816
|
+
var numberInsetsValueSchema = z7.union([
|
|
12168
12817
|
themeNumberInsetsValueSchema,
|
|
12169
12818
|
numberExpressionSchema,
|
|
12170
12819
|
zoomValueSchemaFor(themeNumberInsetsValueSchema)
|
|
12171
12820
|
]);
|
|
12172
|
-
var lineCapSchema =
|
|
12173
|
-
var lineCapValueSchema =
|
|
12821
|
+
var lineCapSchema = z7.enum(["butt", "round", "square"]);
|
|
12822
|
+
var lineCapValueSchema = z7.union([
|
|
12174
12823
|
lineCapSchema,
|
|
12175
12824
|
structuralExpressionSchema,
|
|
12176
12825
|
zoomValueSchemaFor(lineCapSchema)
|
|
12177
12826
|
]);
|
|
12178
|
-
var lineJoinSchema =
|
|
12179
|
-
var lineJoinValueSchema =
|
|
12827
|
+
var lineJoinSchema = z7.enum(["bevel", "miter", "round"]);
|
|
12828
|
+
var lineJoinValueSchema = z7.union([
|
|
12180
12829
|
lineJoinSchema,
|
|
12181
12830
|
structuralExpressionSchema,
|
|
12182
12831
|
zoomValueSchemaFor(lineJoinSchema)
|
|
12183
12832
|
]);
|
|
12184
|
-
var exactFontFaceSchema =
|
|
12833
|
+
var exactFontFaceSchema = z7.string().min(1).max(100).refine(
|
|
12185
12834
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\]/u.test(value),
|
|
12186
12835
|
"Expected an exact NFC font face name without surrounding whitespace, controls, or backslashes"
|
|
12187
12836
|
);
|
|
12188
|
-
var moduleFontValueSchema =
|
|
12837
|
+
var moduleFontValueSchema = z7.union([
|
|
12189
12838
|
exactFontFaceSchema,
|
|
12190
12839
|
fixedStringSchema,
|
|
12191
|
-
themeTokenReferenceSchema.extend({ category:
|
|
12840
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("font") })
|
|
12192
12841
|
]);
|
|
12193
|
-
var moduleFontFallbacksSchema =
|
|
12194
|
-
var hexColorSchema =
|
|
12842
|
+
var moduleFontFallbacksSchema = z7.array(moduleFontValueSchema).max(8);
|
|
12843
|
+
var hexColorSchema = z7.string().regex(/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, {
|
|
12195
12844
|
message: "Expected a hex color like #F6F7F3 or #F6F7F3FF"
|
|
12196
12845
|
});
|
|
12197
|
-
var rgbColorSchema =
|
|
12846
|
+
var rgbColorSchema = z7.string().refine((value) => {
|
|
12198
12847
|
const match2 = value.match(
|
|
12199
12848
|
/^rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d+(?:\.\d+)?))?\s*\)$/iu
|
|
12200
12849
|
);
|
|
@@ -12203,21 +12852,21 @@ var rgbColorSchema = z6.string().refine((value) => {
|
|
|
12203
12852
|
const alpha2 = Number(match2[4] ?? 1);
|
|
12204
12853
|
return channels.every((channel) => channel >= 0 && channel <= 255) && alpha2 >= 0 && alpha2 <= 1;
|
|
12205
12854
|
}, "Expected a Tileflow hex, rgb(), or rgba() color");
|
|
12206
|
-
var terrainColorLiteralSchema =
|
|
12207
|
-
var terrainColorValueSchema =
|
|
12855
|
+
var terrainColorLiteralSchema = z7.union([hexColorSchema, rgbColorSchema]);
|
|
12856
|
+
var terrainColorValueSchema = z7.union([
|
|
12208
12857
|
terrainColorLiteralSchema,
|
|
12209
12858
|
fixedStringSchema.extend({ value: terrainColorLiteralSchema }),
|
|
12210
|
-
themeTokenReferenceSchema.extend({ category:
|
|
12859
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("color") }),
|
|
12211
12860
|
themeColorOperationSchema
|
|
12212
12861
|
]);
|
|
12213
12862
|
function terrainNumberValueSchema(schema) {
|
|
12214
|
-
return
|
|
12863
|
+
return z7.union([schema, fixedNumberSchema.extend({ value: schema }), themeNumberReferenceSchema]);
|
|
12215
12864
|
}
|
|
12216
|
-
var themeTypographyStyleSchema =
|
|
12217
|
-
fallbacks:
|
|
12865
|
+
var themeTypographyStyleSchema = z7.object({
|
|
12866
|
+
fallbacks: z7.array(themeFontValueSchema).max(8).optional(),
|
|
12218
12867
|
font: themeFontValueSchema.optional(),
|
|
12219
12868
|
letterSpacing: themeNumberValueSchema.optional(),
|
|
12220
|
-
transform:
|
|
12869
|
+
transform: z7.enum(["lowercase", "none", "uppercase"]).optional()
|
|
12221
12870
|
}).strict();
|
|
12222
12871
|
var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
12223
12872
|
places: themeTypographyStyleSchema.optional(),
|
|
@@ -12225,46 +12874,57 @@ var themeTypographySchema = themeTypographyStyleSchema.extend({
|
|
|
12225
12874
|
roads: themeTypographyStyleSchema.optional(),
|
|
12226
12875
|
water: themeTypographyStyleSchema.optional()
|
|
12227
12876
|
});
|
|
12228
|
-
var themeLightingSchema =
|
|
12229
|
-
|
|
12877
|
+
var themeLightingSchema = z7.object({
|
|
12878
|
+
ambient: z7.object({
|
|
12879
|
+
color: themeColorValueSchema.optional(),
|
|
12880
|
+
intensity: themeNumberValueSchema.optional()
|
|
12881
|
+
}).strict().optional(),
|
|
12882
|
+
anchor: z7.enum(["map", "viewport"]).optional(),
|
|
12230
12883
|
color: themeColorValueSchema.optional(),
|
|
12231
12884
|
intensity: themeNumberValueSchema.optional(),
|
|
12232
|
-
position:
|
|
12885
|
+
position: z7.tuple([themeNumberValueSchema, themeNumberValueSchema, themeNumberValueSchema]).optional(),
|
|
12886
|
+
sun: z7.object({
|
|
12887
|
+
altitude: themeNumberValueSchema.optional(),
|
|
12888
|
+
azimuth: themeNumberValueSchema.optional(),
|
|
12889
|
+
color: themeColorValueSchema.optional(),
|
|
12890
|
+
intensity: themeNumberValueSchema.optional(),
|
|
12891
|
+
shadowIntensity: themeNumberValueSchema.optional()
|
|
12892
|
+
}).strict().optional()
|
|
12233
12893
|
}).strict();
|
|
12234
|
-
var tileflowThemeSchema =
|
|
12235
|
-
colorScheme:
|
|
12894
|
+
var tileflowThemeSchema = z7.object({
|
|
12895
|
+
colorScheme: z7.enum(["light", "dark"]),
|
|
12236
12896
|
id: tileflowThemeNameSchema,
|
|
12237
12897
|
lighting: themeLightingSchema,
|
|
12238
|
-
tokens:
|
|
12239
|
-
color:
|
|
12240
|
-
font:
|
|
12241
|
-
image:
|
|
12242
|
-
number:
|
|
12898
|
+
tokens: z7.object({
|
|
12899
|
+
color: z7.record(themeTokenNameSchema, themeColorValueSchema),
|
|
12900
|
+
font: z7.record(themeTokenNameSchema, themeFontValueSchema),
|
|
12901
|
+
image: z7.record(themeTokenNameSchema, themeImageValueSchema),
|
|
12902
|
+
number: z7.record(themeTokenNameSchema, themeNumberValueSchema)
|
|
12243
12903
|
}).strict(),
|
|
12244
12904
|
typography: themeTypographySchema,
|
|
12245
|
-
version:
|
|
12905
|
+
version: z7.number().int().positive()
|
|
12246
12906
|
}).strict();
|
|
12247
12907
|
var rangeShape = {
|
|
12248
12908
|
maxZoom: zoomNumberSchema.optional(),
|
|
12249
12909
|
minZoom: zoomNumberSchema.optional(),
|
|
12250
|
-
visible:
|
|
12910
|
+
visible: z7.boolean().optional()
|
|
12251
12911
|
};
|
|
12252
|
-
var backgroundStyleSchema =
|
|
12912
|
+
var backgroundStyleSchema = z7.object({
|
|
12253
12913
|
...rangeShape,
|
|
12254
12914
|
color: colorValueSchema.optional(),
|
|
12255
12915
|
opacity: numberValueSchema.optional(),
|
|
12256
12916
|
pattern: imageValueSchema.optional()
|
|
12257
12917
|
}).strict();
|
|
12258
|
-
var fillStyleSchema =
|
|
12918
|
+
var fillStyleSchema = z7.object({
|
|
12259
12919
|
...rangeShape,
|
|
12260
|
-
antialias:
|
|
12920
|
+
antialias: z7.boolean().optional(),
|
|
12261
12921
|
color: colorValueSchema.optional(),
|
|
12262
12922
|
opacity: numberValueSchema.optional(),
|
|
12263
12923
|
pattern: imageValueSchema.optional(),
|
|
12264
12924
|
translate: numberOffsetValueSchema.optional(),
|
|
12265
|
-
translateAnchor:
|
|
12925
|
+
translateAnchor: z7.enum(["map", "viewport"]).optional()
|
|
12266
12926
|
}).strict();
|
|
12267
|
-
var lineStyleSchema =
|
|
12927
|
+
var lineStyleSchema = z7.object({
|
|
12268
12928
|
...rangeShape,
|
|
12269
12929
|
blur: numberValueSchema.optional(),
|
|
12270
12930
|
cap: lineCapValueSchema.optional(),
|
|
@@ -12278,13 +12938,13 @@ var lineStyleSchema = z6.object({
|
|
|
12278
12938
|
pattern: imageValueSchema.optional(),
|
|
12279
12939
|
roundLimit: numberValueSchema.optional(),
|
|
12280
12940
|
translate: numberOffsetValueSchema.optional(),
|
|
12281
|
-
translateAnchor:
|
|
12941
|
+
translateAnchor: z7.enum(["map", "viewport"]).optional(),
|
|
12282
12942
|
width: numberValueSchema.optional()
|
|
12283
12943
|
}).strict();
|
|
12284
|
-
var textStyleSchema =
|
|
12944
|
+
var textStyleSchema = z7.object({
|
|
12285
12945
|
...rangeShape,
|
|
12286
|
-
allowOverlap:
|
|
12287
|
-
anchor:
|
|
12946
|
+
allowOverlap: z7.boolean().optional(),
|
|
12947
|
+
anchor: z7.enum([
|
|
12288
12948
|
"bottom",
|
|
12289
12949
|
"bottom-left",
|
|
12290
12950
|
"bottom-right",
|
|
@@ -12295,9 +12955,9 @@ var textStyleSchema = z6.object({
|
|
|
12295
12955
|
"top-left",
|
|
12296
12956
|
"top-right"
|
|
12297
12957
|
]).optional(),
|
|
12298
|
-
background:
|
|
12958
|
+
background: z7.object({
|
|
12299
12959
|
color: colorValueSchema,
|
|
12300
|
-
fit:
|
|
12960
|
+
fit: z7.literal("lines"),
|
|
12301
12961
|
padding: themeNumberValueSchema.optional()
|
|
12302
12962
|
}).strict().optional(),
|
|
12303
12963
|
color: colorValueSchema.optional(),
|
|
@@ -12307,26 +12967,26 @@ var textStyleSchema = z6.object({
|
|
|
12307
12967
|
haloBlur: numberValueSchema.optional(),
|
|
12308
12968
|
haloColor: colorValueSchema.optional(),
|
|
12309
12969
|
haloWidth: numberValueSchema.optional(),
|
|
12310
|
-
ignorePlacement:
|
|
12311
|
-
justify:
|
|
12312
|
-
keepUpright:
|
|
12970
|
+
ignorePlacement: z7.boolean().optional(),
|
|
12971
|
+
justify: z7.enum(["auto", "center", "left", "right"]).optional(),
|
|
12972
|
+
keepUpright: z7.boolean().optional(),
|
|
12313
12973
|
letterSpacing: numberValueSchema.optional(),
|
|
12314
12974
|
lineHeight: numberValueSchema.optional(),
|
|
12315
12975
|
maxAngle: numberValueSchema.optional(),
|
|
12316
12976
|
maxWidth: numberValueSchema.optional(),
|
|
12317
12977
|
offset: numberOffsetValueSchema.optional(),
|
|
12318
|
-
optional:
|
|
12978
|
+
optional: z7.boolean().optional(),
|
|
12319
12979
|
opacity: numberValueSchema.optional(),
|
|
12320
|
-
overlap:
|
|
12980
|
+
overlap: z7.enum(["always", "cooperative", "never"]).optional(),
|
|
12321
12981
|
padding: numberValueSchema.optional(),
|
|
12322
|
-
pitchAlignment:
|
|
12982
|
+
pitchAlignment: z7.enum(["auto", "map", "viewport"]).optional(),
|
|
12323
12983
|
radialOffset: numberValueSchema.optional(),
|
|
12324
12984
|
rotate: numberValueSchema.optional(),
|
|
12325
|
-
rotationAlignment:
|
|
12985
|
+
rotationAlignment: z7.enum(["auto", "map", "viewport"]).optional(),
|
|
12326
12986
|
size: numberValueSchema.optional(),
|
|
12327
|
-
transform:
|
|
12328
|
-
variableAnchors:
|
|
12329
|
-
|
|
12987
|
+
transform: z7.enum(["lowercase", "none", "uppercase"]).optional(),
|
|
12988
|
+
variableAnchors: z7.array(
|
|
12989
|
+
z7.enum([
|
|
12330
12990
|
"bottom",
|
|
12331
12991
|
"bottom-left",
|
|
12332
12992
|
"bottom-right",
|
|
@@ -12339,10 +12999,10 @@ var textStyleSchema = z6.object({
|
|
|
12339
12999
|
])
|
|
12340
13000
|
).min(1).optional()
|
|
12341
13001
|
}).strict();
|
|
12342
|
-
var iconStyleSchema =
|
|
13002
|
+
var iconStyleSchema = z7.object({
|
|
12343
13003
|
...rangeShape,
|
|
12344
|
-
allowOverlap:
|
|
12345
|
-
anchor:
|
|
13004
|
+
allowOverlap: z7.boolean().optional(),
|
|
13005
|
+
anchor: z7.enum([
|
|
12346
13006
|
"bottom",
|
|
12347
13007
|
"bottom-left",
|
|
12348
13008
|
"bottom-right",
|
|
@@ -12357,61 +13017,61 @@ var iconStyleSchema = z6.object({
|
|
|
12357
13017
|
haloBlur: numberValueSchema.optional(),
|
|
12358
13018
|
haloColor: colorValueSchema.optional(),
|
|
12359
13019
|
haloWidth: numberValueSchema.optional(),
|
|
12360
|
-
ignorePlacement:
|
|
13020
|
+
ignorePlacement: z7.boolean().optional(),
|
|
12361
13021
|
image: imageValueSchema.optional(),
|
|
12362
13022
|
offset: numberOffsetValueSchema.optional(),
|
|
12363
13023
|
opacity: numberValueSchema.optional(),
|
|
12364
|
-
keepUpright:
|
|
12365
|
-
optional:
|
|
12366
|
-
overlap:
|
|
13024
|
+
keepUpright: z7.boolean().optional(),
|
|
13025
|
+
optional: z7.boolean().optional(),
|
|
13026
|
+
overlap: z7.enum(["always", "cooperative", "never"]).optional(),
|
|
12367
13027
|
padding: numberValueSchema.optional(),
|
|
12368
|
-
pitchAlignment:
|
|
13028
|
+
pitchAlignment: z7.enum(["auto", "map", "viewport"]).optional(),
|
|
12369
13029
|
rotate: numberValueSchema.optional(),
|
|
12370
|
-
rotationAlignment:
|
|
13030
|
+
rotationAlignment: z7.enum(["auto", "map", "viewport"]).optional(),
|
|
12371
13031
|
size: numberValueSchema.optional(),
|
|
12372
|
-
textFit:
|
|
13032
|
+
textFit: z7.enum(["both", "height", "none", "width"]).optional(),
|
|
12373
13033
|
textFitPadding: numberInsetsValueSchema.optional()
|
|
12374
13034
|
}).strict();
|
|
12375
13035
|
var symbolPlacementShape = {
|
|
12376
13036
|
...rangeShape,
|
|
12377
|
-
placement:
|
|
13037
|
+
placement: z7.enum(["line", "line-center", "point"]).optional(),
|
|
12378
13038
|
priority: structuralNumberValueSchema.optional(),
|
|
12379
|
-
priorityOrder:
|
|
13039
|
+
priorityOrder: z7.enum(["higher-first", "lower-first"]).optional(),
|
|
12380
13040
|
spacing: numberValueSchema.optional(),
|
|
12381
|
-
zOrder:
|
|
13041
|
+
zOrder: z7.enum(["auto", "source", "viewport-y"]).optional()
|
|
12382
13042
|
};
|
|
12383
|
-
var circleStyleSchema =
|
|
13043
|
+
var circleStyleSchema = z7.object({
|
|
12384
13044
|
...rangeShape,
|
|
12385
13045
|
blur: numberValueSchema.optional(),
|
|
12386
13046
|
color: colorValueSchema.optional(),
|
|
12387
13047
|
opacity: numberValueSchema.optional(),
|
|
12388
|
-
pitchAlignment:
|
|
12389
|
-
pitchScale:
|
|
13048
|
+
pitchAlignment: z7.enum(["map", "viewport"]).optional(),
|
|
13049
|
+
pitchScale: z7.enum(["map", "viewport"]).optional(),
|
|
12390
13050
|
priority: structuralNumberValueSchema.optional(),
|
|
12391
|
-
priorityOrder:
|
|
13051
|
+
priorityOrder: z7.enum(["higher-first", "lower-first"]).optional(),
|
|
12392
13052
|
radius: numberValueSchema.optional(),
|
|
12393
13053
|
strokeColor: colorValueSchema.optional(),
|
|
12394
13054
|
strokeOpacity: numberValueSchema.optional(),
|
|
12395
13055
|
strokeWidth: numberValueSchema.optional(),
|
|
12396
13056
|
translate: numberOffsetValueSchema.optional(),
|
|
12397
|
-
translateAnchor:
|
|
13057
|
+
translateAnchor: z7.enum(["map", "viewport"]).optional()
|
|
12398
13058
|
}).strict();
|
|
12399
|
-
var extrusionStyleSchema =
|
|
13059
|
+
var extrusionStyleSchema = z7.object({
|
|
12400
13060
|
...rangeShape,
|
|
12401
13061
|
base: numberValueSchema.optional(),
|
|
12402
13062
|
color: colorValueSchema.optional(),
|
|
12403
13063
|
height: numberValueSchema.optional(),
|
|
12404
13064
|
opacity: numberValueSchema.optional(),
|
|
12405
13065
|
pattern: imageValueSchema.optional(),
|
|
12406
|
-
verticalGradient:
|
|
13066
|
+
verticalGradient: z7.boolean().optional()
|
|
12407
13067
|
}).strict();
|
|
12408
|
-
var areaStyleSchema =
|
|
12409
|
-
var lineStackStyleSchema =
|
|
13068
|
+
var areaStyleSchema = z7.object({ fill: fillStyleSchema.optional(), outline: lineStyleSchema.optional() }).strict();
|
|
13069
|
+
var lineStackStyleSchema = z7.object({
|
|
12410
13070
|
casing: lineStyleSchema.optional(),
|
|
12411
13071
|
fill: lineStyleSchema.optional(),
|
|
12412
13072
|
shadow: lineStyleSchema.optional()
|
|
12413
13073
|
}).strict();
|
|
12414
|
-
var lineHatchStyleSchema =
|
|
13074
|
+
var lineHatchStyleSchema = z7.object({
|
|
12415
13075
|
...rangeShape,
|
|
12416
13076
|
angle: numberValueSchema.optional(),
|
|
12417
13077
|
color: colorValueSchema.optional(),
|
|
@@ -12460,62 +13120,62 @@ var lineHatchStyleSchema = z6.object({
|
|
|
12460
13120
|
}
|
|
12461
13121
|
});
|
|
12462
13122
|
var roadLayerStyleSchema = lineStackStyleSchema.extend({ hatch: lineHatchStyleSchema.optional() }).strict();
|
|
12463
|
-
var symbolStyleSchema =
|
|
13123
|
+
var symbolStyleSchema = z7.object({
|
|
12464
13124
|
...symbolPlacementShape,
|
|
12465
13125
|
icon: iconStyleSchema.optional(),
|
|
12466
13126
|
text: textStyleSchema.optional()
|
|
12467
13127
|
}).strict();
|
|
12468
13128
|
var markerSymbolStyleSchema = symbolStyleSchema.extend({ marker: circleStyleSchema.optional() }).strict();
|
|
12469
13129
|
var poiCategoryStyleSchema = markerSymbolStyleSchema.omit({ priority: true, priorityOrder: true }).extend({
|
|
12470
|
-
density:
|
|
13130
|
+
density: z7.union([z7.literal(1), z7.literal(2), z7.literal(3), z7.literal(4), z7.literal(5)]).optional()
|
|
12471
13131
|
}).strict();
|
|
12472
|
-
var renderScalarSchema =
|
|
12473
|
-
var renderTargetSchema =
|
|
12474
|
-
var renderStackOperationNameSchema =
|
|
13132
|
+
var renderScalarSchema = z7.union([z7.boolean(), z7.number().finite(), z7.string()]);
|
|
13133
|
+
var renderTargetSchema = z7.string().regex(tileflowSemanticTargetPattern, "Expected a semantic target");
|
|
13134
|
+
var renderStackOperationNameSchema = z7.string().regex(
|
|
12475
13135
|
tileflowRenderStackOperationNamePattern,
|
|
12476
13136
|
"Expected a lowercase-initial portable render-stack operation name without dots"
|
|
12477
13137
|
);
|
|
12478
13138
|
var renderFieldNormalizationShape = {
|
|
12479
|
-
coerce:
|
|
13139
|
+
coerce: z7.literal("number").optional(),
|
|
12480
13140
|
fallback: renderScalarSchema.optional(),
|
|
12481
|
-
field:
|
|
13141
|
+
field: z7.enum(tileflowSemanticFieldNames)
|
|
12482
13142
|
};
|
|
12483
|
-
var renderSelectorNodeSchema =
|
|
12484
|
-
() =>
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
13143
|
+
var renderSelectorNodeSchema = z7.lazy(
|
|
13144
|
+
() => z7.discriminatedUnion("kind", [
|
|
13145
|
+
z7.object({ kind: z7.literal("literal"), value: z7.boolean() }).strict(),
|
|
13146
|
+
z7.object({ kind: z7.literal("geometry"), geometry: z7.enum(tileflowRenderSelectorGeometries) }).strict(),
|
|
13147
|
+
z7.object({ kind: z7.literal("has"), field: z7.enum(tileflowSemanticFieldNames) }).strict(),
|
|
13148
|
+
z7.object({
|
|
12489
13149
|
...renderFieldNormalizationShape,
|
|
12490
|
-
kind:
|
|
12491
|
-
operator:
|
|
13150
|
+
kind: z7.literal("compare"),
|
|
13151
|
+
operator: z7.enum(tileflowRenderSelectorComparisons),
|
|
12492
13152
|
value: renderScalarSchema
|
|
12493
13153
|
}).strict(),
|
|
12494
|
-
|
|
13154
|
+
z7.object({
|
|
12495
13155
|
...renderFieldNormalizationShape,
|
|
12496
|
-
kind:
|
|
12497
|
-
values:
|
|
13156
|
+
kind: z7.literal("in"),
|
|
13157
|
+
values: z7.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
12498
13158
|
}).strict(),
|
|
12499
|
-
|
|
13159
|
+
z7.object({
|
|
12500
13160
|
...renderFieldNormalizationShape,
|
|
12501
|
-
branches:
|
|
12502
|
-
|
|
12503
|
-
result:
|
|
12504
|
-
values:
|
|
13161
|
+
branches: z7.array(
|
|
13162
|
+
z7.object({
|
|
13163
|
+
result: z7.boolean(),
|
|
13164
|
+
values: z7.array(renderScalarSchema).min(1).max(tileflowRenderStackLimits.maxScalarValues)
|
|
12505
13165
|
}).strict()
|
|
12506
13166
|
).min(1).max(tileflowRenderStackLimits.maxMatchBranches),
|
|
12507
|
-
kind:
|
|
12508
|
-
otherwise:
|
|
13167
|
+
kind: z7.literal("match"),
|
|
13168
|
+
otherwise: z7.boolean()
|
|
12509
13169
|
}).strict(),
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
kind:
|
|
12513
|
-
selectors:
|
|
13170
|
+
z7.object({ kind: z7.literal("not"), selector: renderSelectorNodeSchema }).strict(),
|
|
13171
|
+
z7.object({
|
|
13172
|
+
kind: z7.enum(["all", "any"]),
|
|
13173
|
+
selectors: z7.array(renderSelectorNodeSchema).min(1).max(tileflowRenderStackLimits.maxSelectorChildren)
|
|
12514
13174
|
}).strict(),
|
|
12515
|
-
|
|
13175
|
+
z7.object({
|
|
12516
13176
|
fallback: renderSelectorNodeSchema,
|
|
12517
|
-
kind:
|
|
12518
|
-
stops:
|
|
13177
|
+
kind: z7.literal("step"),
|
|
13178
|
+
stops: z7.array(z7.object({ selector: renderSelectorNodeSchema, zoom: zoomNumberSchema }).strict()).min(1).max(tileflowRenderStackLimits.maxStepStops)
|
|
12519
13179
|
}).strict()
|
|
12520
13180
|
])
|
|
12521
13181
|
);
|
|
@@ -12526,7 +13186,7 @@ var renderSelectorSchema = renderSelectorNodeSchema.superRefine(
|
|
|
12526
13186
|
}
|
|
12527
13187
|
}
|
|
12528
13188
|
);
|
|
12529
|
-
var renderVisibilitySchema =
|
|
13189
|
+
var renderVisibilitySchema = z7.object({ visibilityGroup: z7.literal("building").optional() });
|
|
12530
13190
|
var renderStyleSchemas = {
|
|
12531
13191
|
background: backgroundStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
12532
13192
|
circle: circleStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
@@ -12535,7 +13195,7 @@ var renderStyleSchemas = {
|
|
|
12535
13195
|
line: lineStyleSchema.extend(renderVisibilitySchema.shape).strict(),
|
|
12536
13196
|
symbol: symbolStyleSchema.extend(renderVisibilitySchema.shape).strict()
|
|
12537
13197
|
};
|
|
12538
|
-
var renderRequirementsSchema =
|
|
13198
|
+
var renderRequirementsSchema = z7.array(z7.enum(tileflowLayerDomains)).min(1).max(tileflowRenderStackLimits.maxRequirements).superRefine((requirements, context) => {
|
|
12539
13199
|
const seen = /* @__PURE__ */ new Set();
|
|
12540
13200
|
for (const [index, requirement] of requirements.entries()) {
|
|
12541
13201
|
if (seen.has(requirement)) {
|
|
@@ -12548,55 +13208,55 @@ var renderRequirementsSchema = z6.array(z6.enum(tileflowLayerDomains)).min(1).ma
|
|
|
12548
13208
|
seen.add(requirement);
|
|
12549
13209
|
}
|
|
12550
13210
|
});
|
|
12551
|
-
var renderPlacementSchema =
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
13211
|
+
var renderPlacementSchema = z7.union([
|
|
13212
|
+
z7.enum(tileflowBandPlacements),
|
|
13213
|
+
z7.object({ above: renderTargetSchema }).strict(),
|
|
13214
|
+
z7.object({ below: renderTargetSchema }).strict()
|
|
12555
13215
|
]);
|
|
12556
13216
|
var vectorRenderPassSchemas = tileflowRenderStackRenderers.filter((renderer) => renderer !== "background").map(
|
|
12557
|
-
(renderer) =>
|
|
12558
|
-
feature:
|
|
12559
|
-
kind:
|
|
13217
|
+
(renderer) => z7.object({
|
|
13218
|
+
feature: z7.enum(tileflowSemanticLayerNames).optional(),
|
|
13219
|
+
kind: z7.literal("render-pass"),
|
|
12560
13220
|
placement: renderPlacementSchema,
|
|
12561
|
-
renderer:
|
|
13221
|
+
renderer: z7.literal(renderer),
|
|
12562
13222
|
requirements: renderRequirementsSchema.optional(),
|
|
12563
13223
|
selector: renderSelectorSchema.optional(),
|
|
12564
13224
|
style: renderStyleSchemas[renderer]
|
|
12565
13225
|
}).strict()
|
|
12566
13226
|
);
|
|
12567
|
-
var renderPassSchema =
|
|
12568
|
-
|
|
12569
|
-
kind:
|
|
13227
|
+
var renderPassSchema = z7.discriminatedUnion("renderer", [
|
|
13228
|
+
z7.object({
|
|
13229
|
+
kind: z7.literal("render-pass"),
|
|
12570
13230
|
placement: renderPlacementSchema,
|
|
12571
|
-
renderer:
|
|
13231
|
+
renderer: z7.literal("background"),
|
|
12572
13232
|
requirements: renderRequirementsSchema.optional(),
|
|
12573
13233
|
style: renderStyleSchemas.background
|
|
12574
13234
|
}).strict(),
|
|
12575
13235
|
...vectorRenderPassSchemas
|
|
12576
13236
|
]);
|
|
12577
13237
|
var renderRefinementSchemas = tileflowRenderStackRenderers.map(
|
|
12578
|
-
(renderer) =>
|
|
12579
|
-
kind:
|
|
13238
|
+
(renderer) => z7.object({
|
|
13239
|
+
kind: z7.literal("refine-render-target"),
|
|
12580
13240
|
placement: renderPlacementSchema.optional(),
|
|
12581
13241
|
requirements: renderRequirementsSchema.optional(),
|
|
12582
|
-
renderer:
|
|
13242
|
+
renderer: z7.literal(renderer),
|
|
12583
13243
|
...renderer === "background" ? {} : { selector: renderSelectorSchema.optional() },
|
|
12584
13244
|
style: renderStyleSchemas[renderer],
|
|
12585
13245
|
target: renderTargetSchema
|
|
12586
13246
|
}).strict()
|
|
12587
13247
|
);
|
|
12588
|
-
var renderPlacementRefinementSchema =
|
|
12589
|
-
kind:
|
|
13248
|
+
var renderPlacementRefinementSchema = z7.object({
|
|
13249
|
+
kind: z7.literal("refine-render-target"),
|
|
12590
13250
|
placement: renderPlacementSchema,
|
|
12591
13251
|
requirements: renderRequirementsSchema.optional(),
|
|
12592
13252
|
target: renderTargetSchema
|
|
12593
13253
|
}).strict();
|
|
12594
|
-
var renderStackOperationSchema =
|
|
13254
|
+
var renderStackOperationSchema = z7.union([
|
|
12595
13255
|
renderPassSchema,
|
|
12596
13256
|
...renderRefinementSchemas,
|
|
12597
13257
|
renderPlacementRefinementSchema
|
|
12598
13258
|
]);
|
|
12599
|
-
var renderStackSchema =
|
|
13259
|
+
var renderStackSchema = z7.record(renderStackOperationNameSchema, renderStackOperationSchema).superRefine((stack, context) => {
|
|
12600
13260
|
const size = Object.keys(stack).length;
|
|
12601
13261
|
if (size === 0) {
|
|
12602
13262
|
context.addIssue({
|
|
@@ -12611,19 +13271,19 @@ var renderStackSchema = z6.record(renderStackOperationNameSchema, renderStackOpe
|
|
|
12611
13271
|
});
|
|
12612
13272
|
}
|
|
12613
13273
|
}).describe("tileflow-render-stack");
|
|
12614
|
-
var roadClassSchema =
|
|
12615
|
-
var roadClassStyleSchema =
|
|
12616
|
-
enabled:
|
|
13274
|
+
var roadClassSchema = z7.enum(tileflowRoadClasses);
|
|
13275
|
+
var roadClassStyleSchema = z7.object({
|
|
13276
|
+
enabled: z7.boolean().optional(),
|
|
12617
13277
|
bridge: roadLayerStyleSchema.optional(),
|
|
12618
13278
|
surface: roadLayerStyleSchema.optional(),
|
|
12619
13279
|
tunnel: roadLayerStyleSchema.optional()
|
|
12620
13280
|
}).strict();
|
|
12621
|
-
var roadStructureMapSchema =
|
|
13281
|
+
var roadStructureMapSchema = z7.object({
|
|
12622
13282
|
bridge: roadLayerStyleSchema.optional(),
|
|
12623
13283
|
surface: roadLayerStyleSchema.optional(),
|
|
12624
13284
|
tunnel: roadLayerStyleSchema.optional()
|
|
12625
13285
|
}).strict();
|
|
12626
|
-
var roadTreatmentLayerStyleSchema =
|
|
13286
|
+
var roadTreatmentLayerStyleSchema = z7.object({
|
|
12627
13287
|
casing: lineStyleSchema.pick({
|
|
12628
13288
|
blur: true,
|
|
12629
13289
|
color: true,
|
|
@@ -12652,19 +13312,19 @@ var roadTreatmentLayerStyleSchema = z6.object({
|
|
|
12652
13312
|
width: true
|
|
12653
13313
|
}).optional()
|
|
12654
13314
|
}).strict();
|
|
12655
|
-
var roadTreatmentStyleSchema =
|
|
13315
|
+
var roadTreatmentStyleSchema = z7.object({
|
|
12656
13316
|
bridge: roadTreatmentLayerStyleSchema.optional(),
|
|
12657
|
-
enabled:
|
|
13317
|
+
enabled: z7.boolean().optional(),
|
|
12658
13318
|
surface: roadTreatmentLayerStyleSchema.optional(),
|
|
12659
13319
|
tunnel: roadTreatmentLayerStyleSchema.optional(),
|
|
12660
13320
|
widthScale: themeNumberValueSchema.optional()
|
|
12661
13321
|
}).strict();
|
|
12662
|
-
var landModuleSchema =
|
|
12663
|
-
type:
|
|
13322
|
+
var landModuleSchema = z7.object({
|
|
13323
|
+
type: z7.literal("land"),
|
|
12664
13324
|
background: backgroundStyleSchema.optional(),
|
|
12665
|
-
enabled:
|
|
13325
|
+
enabled: z7.boolean().optional(),
|
|
12666
13326
|
globalLandcover: fillStyleSchema.optional(),
|
|
12667
|
-
landcover:
|
|
13327
|
+
landcover: z7.object({
|
|
12668
13328
|
farmland: areaStyleSchema.optional(),
|
|
12669
13329
|
flowerbed: areaStyleSchema.optional(),
|
|
12670
13330
|
grass: areaStyleSchema.optional(),
|
|
@@ -12680,7 +13340,7 @@ var landModuleSchema = z6.object({
|
|
|
12680
13340
|
wetland: areaStyleSchema.optional(),
|
|
12681
13341
|
wood: areaStyleSchema.optional()
|
|
12682
13342
|
}).strict().optional(),
|
|
12683
|
-
landuse:
|
|
13343
|
+
landuse: z7.object({
|
|
12684
13344
|
cemetery: areaStyleSchema.optional(),
|
|
12685
13345
|
civic: areaStyleSchema.optional(),
|
|
12686
13346
|
commercial: areaStyleSchema.optional(),
|
|
@@ -12696,99 +13356,99 @@ var landModuleSchema = z6.object({
|
|
|
12696
13356
|
}).strict().optional(),
|
|
12697
13357
|
renderStack: renderStackSchema.optional()
|
|
12698
13358
|
}).strict();
|
|
12699
|
-
var waterModuleSchema =
|
|
12700
|
-
type:
|
|
13359
|
+
var waterModuleSchema = z7.object({
|
|
13360
|
+
type: z7.literal("water"),
|
|
12701
13361
|
bathymetry: fillStyleSchema.optional(),
|
|
12702
13362
|
bathymetryContours: lineStyleSchema.optional(),
|
|
12703
13363
|
bathymetryLabels: symbolStyleSchema.optional(),
|
|
12704
13364
|
bodies: areaStyleSchema.optional(),
|
|
12705
|
-
enabled:
|
|
12706
|
-
intermittent:
|
|
13365
|
+
enabled: z7.boolean().optional(),
|
|
13366
|
+
intermittent: z7.object({ bodies: areaStyleSchema.optional(), waterways: lineStyleSchema.optional() }).strict().optional(),
|
|
12707
13367
|
renderStack: renderStackSchema.optional(),
|
|
12708
|
-
waterways:
|
|
13368
|
+
waterways: z7.object({
|
|
12709
13369
|
canal: lineStyleSchema.optional(),
|
|
12710
13370
|
other: lineStyleSchema.optional(),
|
|
12711
13371
|
river: lineStyleSchema.optional(),
|
|
12712
13372
|
stream: lineStyleSchema.optional()
|
|
12713
13373
|
}).strict().optional()
|
|
12714
13374
|
}).strict();
|
|
12715
|
-
var buildingsModuleSchema =
|
|
12716
|
-
type:
|
|
13375
|
+
var buildingsModuleSchema = z7.object({
|
|
13376
|
+
type: z7.literal("buildings"),
|
|
12717
13377
|
businessCorridor: areaStyleSchema.optional(),
|
|
12718
|
-
enabled:
|
|
13378
|
+
enabled: z7.boolean().optional(),
|
|
12719
13379
|
extrusion: extrusionStyleSchema.optional(),
|
|
12720
13380
|
flat: areaStyleSchema.optional(),
|
|
12721
|
-
mode:
|
|
13381
|
+
mode: z7.enum(["3d", "flat"]).optional(),
|
|
12722
13382
|
renderStack: renderStackSchema.optional()
|
|
12723
13383
|
}).strict();
|
|
12724
|
-
var addressesModuleSchema =
|
|
12725
|
-
type:
|
|
12726
|
-
enabled:
|
|
13384
|
+
var addressesModuleSchema = z7.object({
|
|
13385
|
+
type: z7.literal("addresses"),
|
|
13386
|
+
enabled: z7.boolean().optional(),
|
|
12727
13387
|
labels: symbolStyleSchema.optional(),
|
|
12728
13388
|
renderStack: renderStackSchema.optional()
|
|
12729
13389
|
}).strict();
|
|
12730
|
-
var landformClassSchema =
|
|
12731
|
-
var landformsModuleSchema =
|
|
12732
|
-
type:
|
|
12733
|
-
classes:
|
|
12734
|
-
elevation:
|
|
12735
|
-
enabled:
|
|
13390
|
+
var landformClassSchema = z7.enum(tileflowLandformClasses);
|
|
13391
|
+
var landformsModuleSchema = z7.object({
|
|
13392
|
+
type: z7.literal("landforms"),
|
|
13393
|
+
classes: z7.partialRecord(landformClassSchema, symbolStyleSchema).optional(),
|
|
13394
|
+
elevation: z7.boolean().optional(),
|
|
13395
|
+
enabled: z7.boolean().optional(),
|
|
12736
13396
|
renderStack: renderStackSchema.optional()
|
|
12737
13397
|
}).strict();
|
|
12738
|
-
var boundariesModuleSchema =
|
|
12739
|
-
type:
|
|
13398
|
+
var boundariesModuleSchema = z7.object({
|
|
13399
|
+
type: z7.literal("boundaries"),
|
|
12740
13400
|
admin2: lineStyleSchema.optional(),
|
|
12741
13401
|
admin4: lineStyleSchema.optional(),
|
|
12742
13402
|
disputed: lineStyleSchema.optional(),
|
|
12743
|
-
enabled:
|
|
13403
|
+
enabled: z7.boolean().optional(),
|
|
12744
13404
|
maritime: lineStyleSchema.optional(),
|
|
12745
13405
|
renderStack: renderStackSchema.optional()
|
|
12746
13406
|
}).strict();
|
|
12747
|
-
var aerowaysModuleSchema =
|
|
12748
|
-
type:
|
|
13407
|
+
var aerowaysModuleSchema = z7.object({
|
|
13408
|
+
type: z7.literal("aeroways"),
|
|
12749
13409
|
area: areaStyleSchema.optional(),
|
|
12750
|
-
enabled:
|
|
13410
|
+
enabled: z7.boolean().optional(),
|
|
12751
13411
|
runway: lineStackStyleSchema.optional(),
|
|
12752
13412
|
runwayRef: symbolStyleSchema.optional(),
|
|
12753
13413
|
renderStack: renderStackSchema.optional(),
|
|
12754
13414
|
taxiway: lineStackStyleSchema.optional()
|
|
12755
13415
|
}).strict();
|
|
12756
|
-
var transitModuleSchema =
|
|
12757
|
-
type:
|
|
13416
|
+
var transitModuleSchema = z7.object({
|
|
13417
|
+
type: z7.literal("transit"),
|
|
12758
13418
|
cableway: lineStyleSchema.optional(),
|
|
12759
|
-
enabled:
|
|
13419
|
+
enabled: z7.boolean().optional(),
|
|
12760
13420
|
ferry: lineStyleSchema.optional(),
|
|
12761
|
-
rail:
|
|
13421
|
+
rail: z7.object({
|
|
12762
13422
|
bridge: lineStyleSchema.optional(),
|
|
12763
13423
|
surface: lineStyleSchema.optional(),
|
|
12764
13424
|
tunnel: lineStyleSchema.optional()
|
|
12765
13425
|
}).strict().optional(),
|
|
12766
|
-
railHatching:
|
|
13426
|
+
railHatching: z7.object({
|
|
12767
13427
|
bridge: lineStyleSchema.optional(),
|
|
12768
13428
|
surface: lineStyleSchema.optional(),
|
|
12769
13429
|
tunnel: lineStyleSchema.optional()
|
|
12770
13430
|
}).strict().optional(),
|
|
12771
|
-
serviceRail:
|
|
13431
|
+
serviceRail: z7.object({
|
|
12772
13432
|
bridge: lineStyleSchema.optional(),
|
|
12773
13433
|
surface: lineStyleSchema.optional(),
|
|
12774
13434
|
tunnel: lineStyleSchema.optional()
|
|
12775
13435
|
}).strict().optional(),
|
|
12776
13436
|
renderStack: renderStackSchema.optional()
|
|
12777
13437
|
}).strict();
|
|
12778
|
-
var roadsModuleSchema =
|
|
12779
|
-
type:
|
|
12780
|
-
areas:
|
|
13438
|
+
var roadsModuleSchema = z7.object({
|
|
13439
|
+
type: z7.literal("roads"),
|
|
13440
|
+
areas: z7.object({
|
|
12781
13441
|
pedestrian: areaStyleSchema.optional(),
|
|
12782
13442
|
pier: areaStyleSchema.optional(),
|
|
12783
13443
|
road: areaStyleSchema.optional()
|
|
12784
13444
|
}).strict().optional(),
|
|
12785
|
-
classes:
|
|
13445
|
+
classes: z7.partialRecord(roadClassSchema, roadClassStyleSchema).optional(),
|
|
12786
13446
|
crossings: iconStyleSchema.extend({ image: imageValueSchema }).strict().optional(),
|
|
12787
|
-
detail:
|
|
12788
|
-
enabled:
|
|
12789
|
-
extras:
|
|
12790
|
-
hierarchy:
|
|
12791
|
-
modifiers:
|
|
13447
|
+
detail: z7.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
13448
|
+
enabled: z7.boolean().optional(),
|
|
13449
|
+
extras: z7.object({ paths: z7.boolean().optional() }).strict().optional(),
|
|
13450
|
+
hierarchy: z7.enum(["subtle", "clear", "strong"]).optional(),
|
|
13451
|
+
modifiers: z7.object({
|
|
12792
13452
|
construction: roadTreatmentStyleSchema.optional(),
|
|
12793
13453
|
expressway: roadTreatmentStyleSchema.optional(),
|
|
12794
13454
|
indoor: roadTreatmentStyleSchema.optional(),
|
|
@@ -12796,7 +13456,7 @@ var roadsModuleSchema = z6.object({
|
|
|
12796
13456
|
ramp: roadTreatmentStyleSchema.optional(),
|
|
12797
13457
|
unpaved: roadTreatmentStyleSchema.optional()
|
|
12798
13458
|
}).strict().optional(),
|
|
12799
|
-
mountainBike:
|
|
13459
|
+
mountainBike: z7.object({
|
|
12800
13460
|
"0": roadTreatmentStyleSchema.optional(),
|
|
12801
13461
|
"0+": roadTreatmentStyleSchema.optional(),
|
|
12802
13462
|
"1": roadTreatmentStyleSchema.optional(),
|
|
@@ -12809,9 +13469,9 @@ var roadsModuleSchema = z6.object({
|
|
|
12809
13469
|
"5": roadTreatmentStyleSchema.optional(),
|
|
12810
13470
|
"6": roadTreatmentStyleSchema.optional()
|
|
12811
13471
|
}).strict().optional(),
|
|
12812
|
-
oneWayMarkers:
|
|
12813
|
-
outline:
|
|
12814
|
-
restrictions:
|
|
13472
|
+
oneWayMarkers: z7.boolean().optional(),
|
|
13473
|
+
outline: z7.enum(["none", "subtle", "strong"]).optional(),
|
|
13474
|
+
restrictions: z7.object({
|
|
12815
13475
|
access: roadTreatmentStyleSchema.optional(),
|
|
12816
13476
|
bicycle: roadTreatmentStyleSchema.optional(),
|
|
12817
13477
|
foot: roadTreatmentStyleSchema.optional(),
|
|
@@ -12819,24 +13479,24 @@ var roadsModuleSchema = z6.object({
|
|
|
12819
13479
|
toll: roadTreatmentStyleSchema.optional()
|
|
12820
13480
|
}).strict().optional(),
|
|
12821
13481
|
renderStack: renderStackSchema.optional(),
|
|
12822
|
-
roundabouts:
|
|
12823
|
-
serviceTypes:
|
|
13482
|
+
roundabouts: z7.object({ casing: circleStyleSchema.optional(), fill: circleStyleSchema.optional() }).strict().optional(),
|
|
13483
|
+
serviceTypes: z7.object({
|
|
12824
13484
|
alley: roadTreatmentStyleSchema.optional(),
|
|
12825
13485
|
crossover: roadTreatmentStyleSchema.optional(),
|
|
12826
13486
|
driveway: roadTreatmentStyleSchema.optional(),
|
|
12827
13487
|
parkingAisle: roadTreatmentStyleSchema.optional(),
|
|
12828
13488
|
yard: roadTreatmentStyleSchema.optional()
|
|
12829
13489
|
}).strict().optional(),
|
|
12830
|
-
sidewalks:
|
|
13490
|
+
sidewalks: z7.object({
|
|
12831
13491
|
outline: lineStyleSchema.optional(),
|
|
12832
13492
|
pattern: fillStyleSchema.optional(),
|
|
12833
13493
|
surface: fillStyleSchema.optional()
|
|
12834
13494
|
}).strict().optional(),
|
|
12835
13495
|
structures: roadStructureMapSchema.optional(),
|
|
12836
|
-
weight:
|
|
12837
|
-
widthScale:
|
|
13496
|
+
weight: z7.enum(["thin", "regular", "bold"]).optional(),
|
|
13497
|
+
widthScale: z7.partialRecord(roadClassSchema, themeNumberValueSchema).optional()
|
|
12838
13498
|
}).strict();
|
|
12839
|
-
var placeLabelStylesSchema =
|
|
13499
|
+
var placeLabelStylesSchema = z7.object({
|
|
12840
13500
|
city: symbolStyleSchema.optional(),
|
|
12841
13501
|
continent: symbolStyleSchema.optional(),
|
|
12842
13502
|
country: symbolStyleSchema.optional(),
|
|
@@ -12846,65 +13506,65 @@ var placeLabelStylesSchema = z6.object({
|
|
|
12846
13506
|
town: symbolStyleSchema.optional(),
|
|
12847
13507
|
village: symbolStyleSchema.optional()
|
|
12848
13508
|
}).strict();
|
|
12849
|
-
var waterLabelStylesSchema =
|
|
13509
|
+
var waterLabelStylesSchema = z7.object({
|
|
12850
13510
|
line: symbolStyleSchema.optional(),
|
|
12851
13511
|
ocean: symbolStyleSchema.optional(),
|
|
12852
13512
|
other: symbolStyleSchema.optional(),
|
|
12853
13513
|
waterway: symbolStyleSchema.optional()
|
|
12854
13514
|
}).strict();
|
|
12855
|
-
var labelsModuleSchema =
|
|
12856
|
-
type:
|
|
12857
|
-
aerodromeCodes:
|
|
12858
|
-
collisionPriority:
|
|
12859
|
-
enabled:
|
|
12860
|
-
junctions:
|
|
12861
|
-
language:
|
|
12862
|
-
places:
|
|
12863
|
-
roadClasses:
|
|
13515
|
+
var labelsModuleSchema = z7.object({
|
|
13516
|
+
type: z7.literal("labels"),
|
|
13517
|
+
aerodromeCodes: z7.enum(["none", "iata", "all"]).optional(),
|
|
13518
|
+
collisionPriority: z7.enum(["balanced", "navigation"]).optional(),
|
|
13519
|
+
enabled: z7.boolean().optional(),
|
|
13520
|
+
junctions: z7.boolean().optional(),
|
|
13521
|
+
language: z7.string().trim().min(1).optional(),
|
|
13522
|
+
places: z7.enum(["none", "major", "all"]).optional(),
|
|
13523
|
+
roadClasses: z7.array(roadClassSchema).min(1).optional(),
|
|
12864
13524
|
renderStack: renderStackSchema.optional(),
|
|
12865
|
-
roads:
|
|
12866
|
-
styles:
|
|
13525
|
+
roads: z7.enum(["none", "highways", "major", "streets", "all"]).optional(),
|
|
13526
|
+
styles: z7.object({
|
|
12867
13527
|
aerodrome: symbolStyleSchema.optional(),
|
|
12868
13528
|
junctions: symbolStyleSchema.optional(),
|
|
12869
13529
|
places: placeLabelStylesSchema.optional(),
|
|
12870
|
-
roads:
|
|
12871
|
-
shields:
|
|
13530
|
+
roads: z7.partialRecord(roadClassSchema, symbolStyleSchema).optional(),
|
|
13531
|
+
shields: z7.object({
|
|
12872
13532
|
default: symbolStyleSchema.optional(),
|
|
12873
13533
|
detail: symbolStyleSchema.optional(),
|
|
12874
|
-
kinds:
|
|
13534
|
+
kinds: z7.record(identifierSchema, z7.object({ image: themeImageValueSchema }).strict()).optional(),
|
|
12875
13535
|
overview: symbolStyleSchema.optional(),
|
|
12876
|
-
textColors:
|
|
13536
|
+
textColors: z7.record(identifierSchema, z7.object({ color: themeColorValueSchema }).strict()).optional()
|
|
12877
13537
|
}).strict().optional(),
|
|
12878
13538
|
water: waterLabelStylesSchema.optional()
|
|
12879
13539
|
}).strict().optional(),
|
|
12880
|
-
shields:
|
|
12881
|
-
water:
|
|
13540
|
+
shields: z7.enum(["none", "major", "all"]).optional(),
|
|
13541
|
+
water: z7.enum(["none", "major", "all"]).optional()
|
|
12882
13542
|
}).strict();
|
|
12883
|
-
var poiModuleSchema =
|
|
12884
|
-
type:
|
|
12885
|
-
categories:
|
|
12886
|
-
color:
|
|
12887
|
-
density:
|
|
12888
|
-
enabled:
|
|
12889
|
-
icons:
|
|
12890
|
-
labels:
|
|
13543
|
+
var poiModuleSchema = z7.object({
|
|
13544
|
+
type: z7.literal("poi"),
|
|
13545
|
+
categories: z7.array(z7.enum(tileflowPoiCategories)).optional(),
|
|
13546
|
+
color: z7.enum(["uniform", "category"]).optional(),
|
|
13547
|
+
density: z7.union([z7.literal(1), z7.literal(2), z7.literal(3), z7.literal(4), z7.literal(5)]).optional(),
|
|
13548
|
+
enabled: z7.boolean().optional(),
|
|
13549
|
+
icons: z7.boolean().optional(),
|
|
13550
|
+
labels: z7.boolean().optional(),
|
|
12891
13551
|
minZoom: zoomNumberSchema.optional(),
|
|
12892
|
-
placement:
|
|
12893
|
-
coupleIconAndLabel:
|
|
12894
|
-
iconPadding:
|
|
12895
|
-
textPadding:
|
|
13552
|
+
placement: z7.object({
|
|
13553
|
+
coupleIconAndLabel: z7.boolean().optional(),
|
|
13554
|
+
iconPadding: z7.number().finite().min(0).optional(),
|
|
13555
|
+
textPadding: z7.number().finite().min(0).optional()
|
|
12896
13556
|
}).strict().optional(),
|
|
12897
13557
|
renderStack: renderStackSchema.optional(),
|
|
12898
|
-
styles:
|
|
13558
|
+
styles: z7.partialRecord(z7.enum(tileflowPoiCategories), poiCategoryStyleSchema).optional()
|
|
12899
13559
|
}).strict();
|
|
12900
|
-
var nauticalModuleSchema =
|
|
12901
|
-
type:
|
|
13560
|
+
var nauticalModuleSchema = z7.object({
|
|
13561
|
+
type: z7.literal("nautical"),
|
|
12902
13562
|
aids: markerSymbolStyleSchema.optional(),
|
|
12903
13563
|
coverage: areaStyleSchema.optional(),
|
|
12904
|
-
enabled:
|
|
13564
|
+
enabled: z7.boolean().optional(),
|
|
12905
13565
|
hazardAreas: areaStyleSchema.optional(),
|
|
12906
13566
|
hazards: markerSymbolStyleSchema.optional(),
|
|
12907
|
-
labels:
|
|
13567
|
+
labels: z7.object({
|
|
12908
13568
|
coverage: symbolStyleSchema.optional(),
|
|
12909
13569
|
hazards: symbolStyleSchema.optional(),
|
|
12910
13570
|
navigationAreas: symbolStyleSchema.optional(),
|
|
@@ -12920,7 +13580,7 @@ var nauticalModuleSchema = z6.object({
|
|
|
12920
13580
|
wreckAreas: areaStyleSchema.optional(),
|
|
12921
13581
|
wrecks: markerSymbolStyleSchema.optional()
|
|
12922
13582
|
}).strict();
|
|
12923
|
-
var modulesSchema =
|
|
13583
|
+
var modulesSchema = z7.object({
|
|
12924
13584
|
addresses: addressesModuleSchema.optional(),
|
|
12925
13585
|
aeroways: aerowaysModuleSchema.optional(),
|
|
12926
13586
|
boundaries: boundariesModuleSchema.optional(),
|
|
@@ -12932,151 +13592,151 @@ var modulesSchema = z6.object({
|
|
|
12932
13592
|
poi: poiModuleSchema.optional(),
|
|
12933
13593
|
roads: roadsModuleSchema.optional(),
|
|
12934
13594
|
transit: transitModuleSchema.optional(),
|
|
12935
|
-
vegetation:
|
|
12936
|
-
type:
|
|
12937
|
-
enabled:
|
|
13595
|
+
vegetation: z7.object({
|
|
13596
|
+
type: z7.literal("vegetation"),
|
|
13597
|
+
enabled: z7.boolean().optional(),
|
|
12938
13598
|
flat: circleStyleSchema.optional(),
|
|
12939
|
-
mode:
|
|
13599
|
+
mode: z7.enum(["3d", "flat"]).optional(),
|
|
12940
13600
|
renderStack: renderStackSchema.optional(),
|
|
12941
|
-
threeDimensional:
|
|
13601
|
+
threeDimensional: z7.object({
|
|
12942
13602
|
barkColor: themeColorValueSchema.optional(),
|
|
12943
|
-
broadleafColors:
|
|
12944
|
-
coniferColors:
|
|
12945
|
-
crownScale:
|
|
12946
|
-
|
|
13603
|
+
broadleafColors: z7.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
13604
|
+
coniferColors: z7.array(themeColorValueSchema).min(1).max(8).optional(),
|
|
13605
|
+
crownScale: z7.union([
|
|
13606
|
+
z7.number().finite().positive().max(10),
|
|
12947
13607
|
themeNumberReferenceSchema,
|
|
12948
|
-
|
|
12949
|
-
kind:
|
|
12950
|
-
reason:
|
|
12951
|
-
value:
|
|
13608
|
+
z7.object({
|
|
13609
|
+
kind: z7.literal("theme-fixed"),
|
|
13610
|
+
reason: z7.string().trim().min(1),
|
|
13611
|
+
value: z7.number().finite().positive().max(10)
|
|
12952
13612
|
}).strict()
|
|
12953
13613
|
]).optional(),
|
|
12954
|
-
heightScale:
|
|
12955
|
-
|
|
13614
|
+
heightScale: z7.union([
|
|
13615
|
+
z7.number().finite().positive().max(10),
|
|
12956
13616
|
themeNumberReferenceSchema,
|
|
12957
|
-
|
|
12958
|
-
kind:
|
|
12959
|
-
reason:
|
|
12960
|
-
value:
|
|
13617
|
+
z7.object({
|
|
13618
|
+
kind: z7.literal("theme-fixed"),
|
|
13619
|
+
reason: z7.string().trim().min(1),
|
|
13620
|
+
value: z7.number().finite().positive().max(10)
|
|
12961
13621
|
}).strict()
|
|
12962
13622
|
]).optional()
|
|
12963
13623
|
}).strict().optional()
|
|
12964
13624
|
}).strict().optional(),
|
|
12965
13625
|
water: waterModuleSchema.optional()
|
|
12966
13626
|
}).strict();
|
|
12967
|
-
var layerBindingsSchema =
|
|
12968
|
-
aerodromeLabel:
|
|
12969
|
-
aeroway:
|
|
12970
|
-
boundary:
|
|
12971
|
-
building:
|
|
12972
|
-
bathymetry:
|
|
12973
|
-
businessCorridor:
|
|
12974
|
-
canopy:
|
|
12975
|
-
circularFeature:
|
|
12976
|
-
globalLandcover:
|
|
12977
|
-
houseNumber:
|
|
12978
|
-
landcover:
|
|
12979
|
-
landuse:
|
|
12980
|
-
mountainPeak:
|
|
12981
|
-
park:
|
|
12982
|
-
place:
|
|
12983
|
-
poi:
|
|
12984
|
-
road:
|
|
12985
|
-
roadName:
|
|
12986
|
-
roadShield:
|
|
12987
|
-
sidewalk:
|
|
12988
|
-
streetFurniture:
|
|
12989
|
-
tree:
|
|
12990
|
-
water:
|
|
12991
|
-
waterName:
|
|
12992
|
-
waterway:
|
|
13627
|
+
var layerBindingsSchema = z7.object({
|
|
13628
|
+
aerodromeLabel: z7.string().trim().min(1),
|
|
13629
|
+
aeroway: z7.string().trim().min(1),
|
|
13630
|
+
boundary: z7.string().trim().min(1),
|
|
13631
|
+
building: z7.string().trim().min(1),
|
|
13632
|
+
bathymetry: z7.string().trim().min(1).optional(),
|
|
13633
|
+
businessCorridor: z7.string().trim().min(1).optional(),
|
|
13634
|
+
canopy: z7.string().trim().min(1).optional(),
|
|
13635
|
+
circularFeature: z7.string().trim().min(1).optional(),
|
|
13636
|
+
globalLandcover: z7.string().trim().min(1).optional(),
|
|
13637
|
+
houseNumber: z7.string().trim().min(1),
|
|
13638
|
+
landcover: z7.string().trim().min(1),
|
|
13639
|
+
landuse: z7.string().trim().min(1),
|
|
13640
|
+
mountainPeak: z7.string().trim().min(1),
|
|
13641
|
+
park: z7.string().trim().min(1),
|
|
13642
|
+
place: z7.string().trim().min(1),
|
|
13643
|
+
poi: z7.string().trim().min(1),
|
|
13644
|
+
road: z7.string().trim().min(1),
|
|
13645
|
+
roadName: z7.string().trim().min(1),
|
|
13646
|
+
roadShield: z7.string().trim().min(1).optional(),
|
|
13647
|
+
sidewalk: z7.string().trim().min(1).optional(),
|
|
13648
|
+
streetFurniture: z7.string().trim().min(1).optional(),
|
|
13649
|
+
tree: z7.string().trim().min(1).optional(),
|
|
13650
|
+
water: z7.string().trim().min(1),
|
|
13651
|
+
waterName: z7.string().trim().min(1),
|
|
13652
|
+
waterway: z7.string().trim().min(1)
|
|
12993
13653
|
}).strict();
|
|
12994
|
-
var fieldBindingsSchema =
|
|
12995
|
-
access:
|
|
12996
|
-
activityScore:
|
|
12997
|
-
adminLevel:
|
|
12998
|
-
bicycle:
|
|
12999
|
-
bathymetryMinDepth:
|
|
13000
|
-
bathymetrySortKey:
|
|
13001
|
-
brunnel:
|
|
13002
|
-
buildingTone:
|
|
13003
|
-
canopyClearanceAtZoom15:
|
|
13004
|
-
canopyCoverPercent:
|
|
13005
|
-
canopyRank:
|
|
13006
|
-
capital:
|
|
13007
|
-
circularClearanceExtraAtZoom15:
|
|
13008
|
-
circularKind:
|
|
13009
|
-
circularRadiusAtZoom15:
|
|
13010
|
-
circularRadiusMeters:
|
|
13011
|
-
circularInnerRadiusMeters:
|
|
13012
|
-
circularOuterRadiusMeters:
|
|
13013
|
-
class:
|
|
13014
|
-
crossing:
|
|
13015
|
-
confidence:
|
|
13016
|
-
circumference:
|
|
13017
|
-
diameterCrown:
|
|
13018
|
-
disputed:
|
|
13019
|
-
direction:
|
|
13020
|
-
elevation:
|
|
13021
|
-
elevationFeet:
|
|
13022
|
-
expressway:
|
|
13023
|
-
foot:
|
|
13024
|
-
height:
|
|
13025
|
-
hasParts:
|
|
13026
|
-
hide3d:
|
|
13027
|
-
horse:
|
|
13028
|
-
houseNumber:
|
|
13029
|
-
importanceTier:
|
|
13030
|
-
iata:
|
|
13031
|
-
icao:
|
|
13032
|
-
indoor:
|
|
13033
|
-
intermittent:
|
|
13034
|
-
genus:
|
|
13035
|
-
layer:
|
|
13036
|
-
leafCycle:
|
|
13037
|
-
leafType:
|
|
13038
|
-
level:
|
|
13039
|
-
maritime:
|
|
13040
|
-
markings:
|
|
13041
|
-
minHeight:
|
|
13042
|
-
minZoom:
|
|
13043
|
-
mtbScale:
|
|
13044
|
-
name:
|
|
13045
|
-
nameEnglish:
|
|
13046
|
-
nameLatin:
|
|
13047
|
-
network:
|
|
13048
|
-
official:
|
|
13049
|
-
oneway:
|
|
13050
|
-
poiCategory:
|
|
13051
|
-
poiFilterRank:
|
|
13052
|
-
poiIcon:
|
|
13053
|
-
poiSizeRank:
|
|
13054
|
-
poiType:
|
|
13055
|
-
ramp:
|
|
13056
|
-
rank:
|
|
13057
|
-
ref:
|
|
13058
|
-
refLength:
|
|
13059
|
-
renderHeight:
|
|
13060
|
-
renderMinHeight:
|
|
13061
|
-
shieldKind:
|
|
13062
|
-
shieldLineLengthMeters:
|
|
13063
|
-
shieldNetwork:
|
|
13064
|
-
shieldRank:
|
|
13065
|
-
shieldText:
|
|
13066
|
-
shieldTextColor:
|
|
13067
|
-
service:
|
|
13068
|
-
species:
|
|
13069
|
-
speciesWikidata:
|
|
13070
|
-
subclass:
|
|
13071
|
-
surface:
|
|
13072
|
-
toll:
|
|
13654
|
+
var fieldBindingsSchema = z7.object({
|
|
13655
|
+
access: z7.string().trim().min(1),
|
|
13656
|
+
activityScore: z7.string().trim().min(1),
|
|
13657
|
+
adminLevel: z7.string().trim().min(1),
|
|
13658
|
+
bicycle: z7.string().trim().min(1),
|
|
13659
|
+
bathymetryMinDepth: z7.string().trim().min(1).optional(),
|
|
13660
|
+
bathymetrySortKey: z7.string().trim().min(1).optional(),
|
|
13661
|
+
brunnel: z7.string().trim().min(1),
|
|
13662
|
+
buildingTone: z7.string().trim().min(1),
|
|
13663
|
+
canopyClearanceAtZoom15: z7.string().trim().min(1),
|
|
13664
|
+
canopyCoverPercent: z7.string().trim().min(1),
|
|
13665
|
+
canopyRank: z7.string().trim().min(1),
|
|
13666
|
+
capital: z7.string().trim().min(1),
|
|
13667
|
+
circularClearanceExtraAtZoom15: z7.string().trim().min(1),
|
|
13668
|
+
circularKind: z7.string().trim().min(1),
|
|
13669
|
+
circularRadiusAtZoom15: z7.string().trim().min(1),
|
|
13670
|
+
circularRadiusMeters: z7.string().trim().min(1),
|
|
13671
|
+
circularInnerRadiusMeters: z7.string().trim().min(1),
|
|
13672
|
+
circularOuterRadiusMeters: z7.string().trim().min(1),
|
|
13673
|
+
class: z7.string().trim().min(1),
|
|
13674
|
+
crossing: z7.string().trim().min(1),
|
|
13675
|
+
confidence: z7.string().trim().min(1),
|
|
13676
|
+
circumference: z7.string().trim().min(1),
|
|
13677
|
+
diameterCrown: z7.string().trim().min(1),
|
|
13678
|
+
disputed: z7.string().trim().min(1),
|
|
13679
|
+
direction: z7.string().trim().min(1),
|
|
13680
|
+
elevation: z7.string().trim().min(1),
|
|
13681
|
+
elevationFeet: z7.string().trim().min(1),
|
|
13682
|
+
expressway: z7.string().trim().min(1),
|
|
13683
|
+
foot: z7.string().trim().min(1),
|
|
13684
|
+
height: z7.string().trim().min(1),
|
|
13685
|
+
hasParts: z7.string().trim().min(1),
|
|
13686
|
+
hide3d: z7.string().trim().min(1),
|
|
13687
|
+
horse: z7.string().trim().min(1),
|
|
13688
|
+
houseNumber: z7.string().trim().min(1),
|
|
13689
|
+
importanceTier: z7.string().trim().min(1),
|
|
13690
|
+
iata: z7.string().trim().min(1),
|
|
13691
|
+
icao: z7.string().trim().min(1),
|
|
13692
|
+
indoor: z7.string().trim().min(1),
|
|
13693
|
+
intermittent: z7.string().trim().min(1),
|
|
13694
|
+
genus: z7.string().trim().min(1),
|
|
13695
|
+
layer: z7.string().trim().min(1),
|
|
13696
|
+
leafCycle: z7.string().trim().min(1),
|
|
13697
|
+
leafType: z7.string().trim().min(1),
|
|
13698
|
+
level: z7.string().trim().min(1),
|
|
13699
|
+
maritime: z7.string().trim().min(1),
|
|
13700
|
+
markings: z7.string().trim().min(1),
|
|
13701
|
+
minHeight: z7.string().trim().min(1),
|
|
13702
|
+
minZoom: z7.string().trim().min(1),
|
|
13703
|
+
mtbScale: z7.string().trim().min(1),
|
|
13704
|
+
name: z7.string().trim().min(1),
|
|
13705
|
+
nameEnglish: z7.string().trim().min(1),
|
|
13706
|
+
nameLatin: z7.string().trim().min(1),
|
|
13707
|
+
network: z7.string().trim().min(1),
|
|
13708
|
+
official: z7.string().trim().min(1),
|
|
13709
|
+
oneway: z7.string().trim().min(1),
|
|
13710
|
+
poiCategory: z7.string().trim().min(1),
|
|
13711
|
+
poiFilterRank: z7.string().trim().min(1),
|
|
13712
|
+
poiIcon: z7.string().trim().min(1),
|
|
13713
|
+
poiSizeRank: z7.string().trim().min(1),
|
|
13714
|
+
poiType: z7.string().trim().min(1),
|
|
13715
|
+
ramp: z7.string().trim().min(1),
|
|
13716
|
+
rank: z7.string().trim().min(1),
|
|
13717
|
+
ref: z7.string().trim().min(1),
|
|
13718
|
+
refLength: z7.string().trim().min(1),
|
|
13719
|
+
renderHeight: z7.string().trim().min(1),
|
|
13720
|
+
renderMinHeight: z7.string().trim().min(1),
|
|
13721
|
+
shieldKind: z7.string().trim().min(1).optional(),
|
|
13722
|
+
shieldLineLengthMeters: z7.string().trim().min(1).optional(),
|
|
13723
|
+
shieldNetwork: z7.string().trim().min(1).optional(),
|
|
13724
|
+
shieldRank: z7.string().trim().min(1).optional(),
|
|
13725
|
+
shieldText: z7.string().trim().min(1).optional(),
|
|
13726
|
+
shieldTextColor: z7.string().trim().min(1).optional(),
|
|
13727
|
+
service: z7.string().trim().min(1),
|
|
13728
|
+
species: z7.string().trim().min(1),
|
|
13729
|
+
speciesWikidata: z7.string().trim().min(1),
|
|
13730
|
+
subclass: z7.string().trim().min(1),
|
|
13731
|
+
surface: z7.string().trim().min(1),
|
|
13732
|
+
toll: z7.string().trim().min(1)
|
|
13073
13733
|
}).strict();
|
|
13074
|
-
var openMapTilesSchema =
|
|
13075
|
-
type:
|
|
13076
|
-
contractVersion:
|
|
13734
|
+
var openMapTilesSchema = z7.object({
|
|
13735
|
+
type: z7.literal("openmaptiles"),
|
|
13736
|
+
contractVersion: z7.literal(openMapTilesContractVersion),
|
|
13077
13737
|
fields: fieldBindingsSchema.partial().optional(),
|
|
13078
13738
|
layers: layerBindingsSchema.partial().optional(),
|
|
13079
|
-
semantics:
|
|
13739
|
+
semantics: z7.object({ parkLayer: z7.enum(["mixed", "protected-only"]).optional() }).strict().optional()
|
|
13080
13740
|
}).strict().transform(
|
|
13081
13741
|
(schema) => openMapTiles({
|
|
13082
13742
|
capabilities: schema.layers === void 0 ? void 0 : {
|
|
@@ -13092,12 +13752,12 @@ var openMapTilesSchema = z6.object({
|
|
|
13092
13752
|
})
|
|
13093
13753
|
);
|
|
13094
13754
|
var vectorDataShape = {
|
|
13095
|
-
type:
|
|
13096
|
-
attribution:
|
|
13755
|
+
type: z7.literal("vector-tiles"),
|
|
13756
|
+
attribution: z7.string().trim().min(1),
|
|
13097
13757
|
revision: revisionSchema.optional(),
|
|
13098
13758
|
schema: openMapTilesSchema
|
|
13099
13759
|
};
|
|
13100
|
-
var publicVectorUrlSchema =
|
|
13760
|
+
var publicVectorUrlSchema = z7.string().min(1).max(4096).superRefine((value, context) => {
|
|
13101
13761
|
try {
|
|
13102
13762
|
validatePublicVectorUrl(value);
|
|
13103
13763
|
} catch (error) {
|
|
@@ -13107,8 +13767,8 @@ var publicVectorUrlSchema = z6.string().min(1).max(4096).superRefine((value, con
|
|
|
13107
13767
|
});
|
|
13108
13768
|
}
|
|
13109
13769
|
}).describe("tileflow-public-vector-url");
|
|
13110
|
-
var marineSourceSchema =
|
|
13111
|
-
attribution:
|
|
13770
|
+
var marineSourceSchema = z7.object({
|
|
13771
|
+
attribution: z7.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
13112
13772
|
sourceId: identifierSchema.optional(),
|
|
13113
13773
|
url: publicVectorUrlSchema.optional()
|
|
13114
13774
|
}).strict();
|
|
@@ -13116,24 +13776,24 @@ var bathymetryDemUrlSchema = publicVectorUrlSchema.refine(
|
|
|
13116
13776
|
(value) => !value.startsWith("pmtiles://"),
|
|
13117
13777
|
"Expected an HTTPS, loopback HTTP, or root-relative DEM TileJSON URL"
|
|
13118
13778
|
).describe("tileflow-public-dem-url");
|
|
13119
|
-
var bathymetryReliefSchema =
|
|
13779
|
+
var bathymetryReliefSchema = z7.object({
|
|
13120
13780
|
accentColor: terrainColorValueSchema.optional(),
|
|
13121
|
-
attribution:
|
|
13122
|
-
encoding:
|
|
13123
|
-
exaggeration: terrainNumberValueSchema(
|
|
13781
|
+
attribution: z7.string().min(1).max(2048).refine((value) => value === value.trim()).optional(),
|
|
13782
|
+
encoding: z7.enum(["mapbox", "terrarium"]).optional(),
|
|
13783
|
+
exaggeration: terrainNumberValueSchema(z7.number().finite().min(0).max(1)).optional(),
|
|
13124
13784
|
highlightColor: terrainColorValueSchema.optional(),
|
|
13125
|
-
illuminationAltitude: terrainNumberValueSchema(
|
|
13126
|
-
illuminationAnchor:
|
|
13127
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
13785
|
+
illuminationAltitude: terrainNumberValueSchema(z7.number().finite().min(0).max(90)).optional(),
|
|
13786
|
+
illuminationAnchor: z7.enum(["map", "viewport"]).optional(),
|
|
13787
|
+
illuminationDirection: terrainNumberValueSchema(z7.number().finite().min(0).max(359)).optional(),
|
|
13128
13788
|
maxZoom: zoomNumberSchema.optional(),
|
|
13129
13789
|
minZoom: zoomNumberSchema.optional(),
|
|
13130
|
-
multidirectional:
|
|
13131
|
-
opacity: terrainNumberValueSchema(
|
|
13790
|
+
multidirectional: z7.boolean().optional(),
|
|
13791
|
+
opacity: terrainNumberValueSchema(z7.number().finite().min(0).max(1)).optional(),
|
|
13132
13792
|
shadowColor: terrainColorValueSchema.optional(),
|
|
13133
13793
|
sourceId: identifierSchema.optional(),
|
|
13134
|
-
tileSize:
|
|
13794
|
+
tileSize: z7.union([z7.literal(256), z7.literal(512)]).optional(),
|
|
13135
13795
|
url: bathymetryDemUrlSchema.optional(),
|
|
13136
|
-
visible:
|
|
13796
|
+
visible: z7.boolean().optional()
|
|
13137
13797
|
}).strict().superRefine((relief, context) => {
|
|
13138
13798
|
if (relief.minZoom !== void 0 && relief.maxZoom !== void 0 && relief.minZoom > relief.maxZoom) {
|
|
13139
13799
|
context.addIssue({
|
|
@@ -13143,33 +13803,33 @@ var bathymetryReliefSchema = z6.object({
|
|
|
13143
13803
|
});
|
|
13144
13804
|
}
|
|
13145
13805
|
});
|
|
13146
|
-
var bathymetryConfigSchema =
|
|
13806
|
+
var bathymetryConfigSchema = z7.object({
|
|
13147
13807
|
...marineSourceSchema.shape,
|
|
13148
|
-
bands:
|
|
13149
|
-
contours:
|
|
13150
|
-
display:
|
|
13151
|
-
labels:
|
|
13152
|
-
relief:
|
|
13153
|
-
type:
|
|
13808
|
+
bands: z7.union([z7.literal(false), fillStyleSchema]).optional(),
|
|
13809
|
+
contours: z7.union([z7.literal(false), lineStyleSchema]).optional(),
|
|
13810
|
+
display: z7.enum(["bands", "relief", "hybrid"]).optional(),
|
|
13811
|
+
labels: z7.union([z7.literal(false), symbolStyleSchema]).optional(),
|
|
13812
|
+
relief: z7.union([z7.literal(false), bathymetryReliefSchema]).optional(),
|
|
13813
|
+
type: z7.literal("bathymetry")
|
|
13154
13814
|
}).strict();
|
|
13155
|
-
var marineSchema =
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
bathymetry:
|
|
13159
|
-
nautical:
|
|
13815
|
+
var marineSchema = z7.union([
|
|
13816
|
+
z7.enum(["none", "bathymetry", "nautical", "chart"]),
|
|
13817
|
+
z7.object({
|
|
13818
|
+
bathymetry: z7.union([z7.literal(false), marineSourceSchema, bathymetryConfigSchema]).optional(),
|
|
13819
|
+
nautical: z7.union([z7.literal(false), marineSourceSchema]).optional()
|
|
13160
13820
|
}).strict()
|
|
13161
13821
|
]);
|
|
13162
|
-
var directVectorDataSchema =
|
|
13822
|
+
var directVectorDataSchema = z7.object({
|
|
13163
13823
|
...vectorDataShape,
|
|
13164
|
-
bounds:
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13824
|
+
bounds: z7.tuple([
|
|
13825
|
+
z7.number().finite().min(-180).max(180),
|
|
13826
|
+
z7.number().finite().min(-90).max(90),
|
|
13827
|
+
z7.number().finite().min(-180).max(180),
|
|
13828
|
+
z7.number().finite().min(-90).max(90)
|
|
13169
13829
|
]).optional(),
|
|
13170
|
-
maxzoom:
|
|
13171
|
-
minzoom:
|
|
13172
|
-
tiles:
|
|
13830
|
+
maxzoom: z7.number().int().min(0).max(30).optional(),
|
|
13831
|
+
minzoom: z7.number().int().min(0).max(30).optional(),
|
|
13832
|
+
tiles: z7.array(publicVectorUrlSchema).min(1).max(8)
|
|
13173
13833
|
}).strict().refine(
|
|
13174
13834
|
(value) => value.minzoom === void 0 || value.maxzoom === void 0 || value.minzoom <= value.maxzoom,
|
|
13175
13835
|
{ message: "minzoom must not exceed maxzoom", path: ["minzoom"] }
|
|
@@ -13177,34 +13837,34 @@ var directVectorDataSchema = z6.object({
|
|
|
13177
13837
|
(value) => value.bounds === void 0 || value.bounds[0] < value.bounds[2] && value.bounds[1] < value.bounds[3],
|
|
13178
13838
|
{ message: "bounds must have increasing axes", path: ["bounds"] }
|
|
13179
13839
|
);
|
|
13180
|
-
var dataSchema =
|
|
13181
|
-
|
|
13182
|
-
type:
|
|
13183
|
-
generation:
|
|
13184
|
-
selection:
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
kind:
|
|
13188
|
-
product:
|
|
13189
|
-
release:
|
|
13190
|
-
descriptorSha256:
|
|
13840
|
+
var dataSchema = z7.union([
|
|
13841
|
+
z7.object({
|
|
13842
|
+
type: z7.literal("tileflow-world"),
|
|
13843
|
+
generation: z7.literal(tileflowWorldGeneration),
|
|
13844
|
+
selection: z7.discriminatedUnion("kind", [
|
|
13845
|
+
z7.object({ kind: z7.literal("current"), product: z7.literal("world-v1") }).strict(),
|
|
13846
|
+
z7.object({
|
|
13847
|
+
kind: z7.literal("release"),
|
|
13848
|
+
product: z7.literal("world-v1"),
|
|
13849
|
+
release: z7.object({
|
|
13850
|
+
descriptorSha256: z7.string().regex(/^[0-9a-f]{64}$/u),
|
|
13191
13851
|
releaseId: tileflowWorldReleaseIdSchema
|
|
13192
13852
|
}).strict()
|
|
13193
13853
|
}).strict()
|
|
13194
13854
|
])
|
|
13195
13855
|
}).strict(),
|
|
13196
|
-
|
|
13856
|
+
z7.object({ ...vectorDataShape, url: publicVectorUrlSchema }).strict(),
|
|
13197
13857
|
directVectorDataSchema
|
|
13198
13858
|
]);
|
|
13199
|
-
var hostedTilesetSourceSchema =
|
|
13200
|
-
attribution:
|
|
13201
|
-
kind:
|
|
13202
|
-
local:
|
|
13859
|
+
var hostedTilesetSourceSchema = z7.object({
|
|
13860
|
+
attribution: z7.string().trim().min(1).max(4096),
|
|
13861
|
+
kind: z7.literal("hosted-tileset"),
|
|
13862
|
+
local: z7.string().refine(isSafeLocalPmtilesPath, {
|
|
13203
13863
|
message: "Expected a safe relative .pmtiles path beginning with ./ or ../"
|
|
13204
13864
|
}),
|
|
13205
|
-
tileset:
|
|
13206
|
-
tileSize:
|
|
13207
|
-
type:
|
|
13865
|
+
tileset: z7.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u).refine((value) => value !== "terrain" && value !== "world", "Expected a Team tileset ID"),
|
|
13866
|
+
tileSize: z7.union([z7.literal(256), z7.literal(512)]).optional(),
|
|
13867
|
+
type: z7.enum(["raster", "vector"])
|
|
13208
13868
|
}).strict().superRefine((source, context) => {
|
|
13209
13869
|
if (source.type === "vector" && source.tileSize !== void 0) {
|
|
13210
13870
|
context.addIssue({
|
|
@@ -13214,7 +13874,7 @@ var hostedTilesetSourceSchema = z6.object({
|
|
|
13214
13874
|
});
|
|
13215
13875
|
}
|
|
13216
13876
|
});
|
|
13217
|
-
var hostedSourcesSchema =
|
|
13877
|
+
var hostedSourcesSchema = z7.record(tileflowMapIdSchema, hostedTilesetSourceSchema).superRefine((sources, context) => {
|
|
13218
13878
|
if (Object.keys(sources).length > tileflowHostedSourceLimit) {
|
|
13219
13879
|
context.addIssue({
|
|
13220
13880
|
code: "too_big",
|
|
@@ -13223,7 +13883,7 @@ var hostedSourcesSchema = z6.record(tileflowMapIdSchema, hostedTilesetSourceSche
|
|
|
13223
13883
|
});
|
|
13224
13884
|
}
|
|
13225
13885
|
});
|
|
13226
|
-
var maplibreOverlayLayerSchema =
|
|
13886
|
+
var maplibreOverlayLayerSchema = z7.record(z7.string(), z7.unknown()).superRefine((layer, context) => {
|
|
13227
13887
|
if (!tileflowMapIdSchema.safeParse(layer.id).success) {
|
|
13228
13888
|
context.addIssue({ code: "custom", message: "Expected a portable layer ID", path: ["id"] });
|
|
13229
13889
|
}
|
|
@@ -13241,28 +13901,28 @@ var maplibreOverlayLayerSchema = z6.record(z6.string(), z6.unknown()).superRefin
|
|
|
13241
13901
|
});
|
|
13242
13902
|
}
|
|
13243
13903
|
});
|
|
13244
|
-
var maplibreOverlaySchema =
|
|
13245
|
-
kind:
|
|
13246
|
-
layers:
|
|
13247
|
-
placement:
|
|
13904
|
+
var maplibreOverlaySchema = z7.object({
|
|
13905
|
+
kind: z7.literal("maplibre-overlay"),
|
|
13906
|
+
layers: z7.array(maplibreOverlayLayerSchema).min(1),
|
|
13907
|
+
placement: z7.enum(tileflowOverlayPlacements),
|
|
13248
13908
|
source: tileflowMapIdSchema
|
|
13249
13909
|
}).strict();
|
|
13250
|
-
var overlaysSchema =
|
|
13251
|
-
var localAssetDirectorySchema =
|
|
13252
|
-
var packageAssetDirectorySchema =
|
|
13253
|
-
kind:
|
|
13254
|
-
package:
|
|
13910
|
+
var overlaysSchema = z7.record(tileflowMapIdSchema, maplibreOverlaySchema);
|
|
13911
|
+
var localAssetDirectorySchema = z7.string().min(3).max(tileflowLocalDirectoryMaximumLength).refine(isTileflowLocalDirectory, { message: tileflowLocalDirectoryMessage });
|
|
13912
|
+
var packageAssetDirectorySchema = z7.object({
|
|
13913
|
+
kind: z7.literal("package-directory"),
|
|
13914
|
+
package: z7.string().regex(
|
|
13255
13915
|
/^(?:@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*|[a-z0-9][a-z0-9._-]*)$/u,
|
|
13256
13916
|
"Expected a lowercase npm package name"
|
|
13257
13917
|
),
|
|
13258
|
-
path:
|
|
13918
|
+
path: z7.string().min(1).max(512).refine(
|
|
13259
13919
|
(value) => !value.startsWith("/") && !value.includes("\\") && value.split("/").every((segment) => Boolean(segment) && segment !== "." && segment !== ".."),
|
|
13260
13920
|
"Expected a portable package-relative directory"
|
|
13261
13921
|
)
|
|
13262
13922
|
}).strict();
|
|
13263
|
-
var assetDirectorySchema =
|
|
13264
|
-
var iconDirectoriesSchema =
|
|
13265
|
-
|
|
13923
|
+
var assetDirectorySchema = z7.union([localAssetDirectorySchema, packageAssetDirectorySchema]);
|
|
13924
|
+
var iconDirectoriesSchema = z7.array(
|
|
13925
|
+
z7.union([localAssetDirectorySchema, packageAssetDirectorySchema, tileflowIconSetSourceSchema])
|
|
13266
13926
|
).max(tileflowIconSourceLimit).superRefine((sources, context) => {
|
|
13267
13927
|
try {
|
|
13268
13928
|
collectTileflowIconSetReferences(sources);
|
|
@@ -13273,9 +13933,9 @@ var iconDirectoriesSchema = z6.array(
|
|
|
13273
13933
|
});
|
|
13274
13934
|
}
|
|
13275
13935
|
});
|
|
13276
|
-
var fontDirectoriesSchema =
|
|
13277
|
-
var fontStacksSchema =
|
|
13278
|
-
|
|
13936
|
+
var fontDirectoriesSchema = z7.array(assetDirectorySchema).max(16);
|
|
13937
|
+
var fontStacksSchema = z7.array(
|
|
13938
|
+
z7.string().min(1).max(200).refine(
|
|
13279
13939
|
(value) => value === value.trim() && value === value.normalize("NFC") && !/[\p{Cc}\\/]/u.test(value),
|
|
13280
13940
|
"Expected an exact NFC MapLibre font-stack key without whitespace padding, controls, slashes, or backslashes"
|
|
13281
13941
|
)
|
|
@@ -13292,10 +13952,10 @@ var fontStacksSchema = z6.array(
|
|
|
13292
13952
|
seen.add(fontStack);
|
|
13293
13953
|
}
|
|
13294
13954
|
});
|
|
13295
|
-
var glyphsSchema =
|
|
13955
|
+
var glyphsSchema = z7.object({
|
|
13296
13956
|
fontStacks: fontStacksSchema,
|
|
13297
|
-
kind:
|
|
13298
|
-
url:
|
|
13957
|
+
kind: z7.literal("url"),
|
|
13958
|
+
url: z7.string().min(1).refine(
|
|
13299
13959
|
(value) => value.includes("{fontstack}") && value.includes("{range}"),
|
|
13300
13960
|
"Expected {fontstack} and {range} placeholders"
|
|
13301
13961
|
).refine(isSafeGlyphUrl, "Expected an HTTP(S), root-relative, or path-relative glyph URL")
|
|
@@ -13303,34 +13963,34 @@ var glyphsSchema = z6.object({
|
|
|
13303
13963
|
var terrainLayerRangeShape = {
|
|
13304
13964
|
maxZoom: zoomNumberSchema.optional(),
|
|
13305
13965
|
minZoom: zoomNumberSchema.optional(),
|
|
13306
|
-
visible:
|
|
13966
|
+
visible: z7.boolean().optional()
|
|
13307
13967
|
};
|
|
13308
|
-
var terrainHillshadeSchema =
|
|
13968
|
+
var terrainHillshadeSchema = z7.object({
|
|
13309
13969
|
...terrainLayerRangeShape,
|
|
13310
13970
|
accentColor: terrainColorValueSchema.optional(),
|
|
13311
|
-
exaggeration: terrainNumberValueSchema(
|
|
13971
|
+
exaggeration: terrainNumberValueSchema(z7.number().finite().min(0).max(1)).optional(),
|
|
13312
13972
|
highlightColor: terrainColorValueSchema.optional(),
|
|
13313
|
-
illuminationAnchor:
|
|
13314
|
-
illuminationDirection: terrainNumberValueSchema(
|
|
13973
|
+
illuminationAnchor: z7.enum(["map", "viewport"]).optional(),
|
|
13974
|
+
illuminationDirection: terrainNumberValueSchema(z7.number().finite().min(0).max(359)).optional(),
|
|
13315
13975
|
shadowColor: terrainColorValueSchema.optional()
|
|
13316
13976
|
}).strict();
|
|
13317
|
-
var terrainContourLineSchema =
|
|
13977
|
+
var terrainContourLineSchema = z7.object({
|
|
13318
13978
|
...terrainLayerRangeShape,
|
|
13319
13979
|
color: terrainColorValueSchema.optional(),
|
|
13320
|
-
opacity: terrainNumberValueSchema(
|
|
13321
|
-
width: terrainNumberValueSchema(
|
|
13980
|
+
opacity: terrainNumberValueSchema(z7.number().finite().min(0).max(1)).optional(),
|
|
13981
|
+
width: terrainNumberValueSchema(z7.number().finite().min(0).max(32)).optional()
|
|
13322
13982
|
}).strict();
|
|
13323
|
-
var terrainContourLabelSchema =
|
|
13983
|
+
var terrainContourLabelSchema = z7.object({
|
|
13324
13984
|
...terrainLayerRangeShape,
|
|
13325
13985
|
color: terrainColorValueSchema.optional(),
|
|
13326
13986
|
font: moduleFontValueSchema.optional(),
|
|
13327
13987
|
haloColor: terrainColorValueSchema.optional(),
|
|
13328
|
-
haloWidth: terrainNumberValueSchema(
|
|
13329
|
-
opacity: terrainNumberValueSchema(
|
|
13330
|
-
size: terrainNumberValueSchema(
|
|
13331
|
-
spacing: terrainNumberValueSchema(
|
|
13988
|
+
haloWidth: terrainNumberValueSchema(z7.number().finite().min(0).max(16)).optional(),
|
|
13989
|
+
opacity: terrainNumberValueSchema(z7.number().finite().min(0).max(1)).optional(),
|
|
13990
|
+
size: terrainNumberValueSchema(z7.number().finite().min(1).max(64)).optional(),
|
|
13991
|
+
spacing: terrainNumberValueSchema(z7.number().finite().min(1).max(1e3)).optional()
|
|
13332
13992
|
}).strict();
|
|
13333
|
-
var terrainContourThresholdPairSchema =
|
|
13993
|
+
var terrainContourThresholdPairSchema = z7.tuple([z7.number().finite().min(1e-3).max(1e5), z7.number().finite().min(1e-3).max(1e5)]).refine(([minor, index]) => minor <= index, {
|
|
13334
13994
|
message: "Expected the index contour interval to be greater than or equal to the minor interval"
|
|
13335
13995
|
}).refine(([minor, index]) => isWholeContourMultiple2(index, minor), {
|
|
13336
13996
|
message: "Expected the index contour interval to be a whole multiple of the minor interval"
|
|
@@ -13339,7 +13999,7 @@ function isWholeContourMultiple2(value, interval) {
|
|
|
13339
13999
|
const ratio = value / interval;
|
|
13340
14000
|
return Math.abs(ratio - Math.round(ratio)) <= Number.EPSILON * Math.max(1, ratio) * 8;
|
|
13341
14001
|
}
|
|
13342
|
-
var terrainContourThresholdsSchema =
|
|
14002
|
+
var terrainContourThresholdsSchema = z7.record(z7.string().regex(/^(?:0|[1-9]|1\d|2[0-4])$/u), terrainContourThresholdPairSchema).superRefine((thresholds, context) => {
|
|
13343
14003
|
const count = Object.keys(thresholds).length;
|
|
13344
14004
|
if (count === 0 || count > 25) {
|
|
13345
14005
|
context.addIssue({
|
|
@@ -13348,19 +14008,19 @@ var terrainContourThresholdsSchema = z6.record(z6.string().regex(/^(?:0|[1-9]|1\
|
|
|
13348
14008
|
});
|
|
13349
14009
|
}
|
|
13350
14010
|
});
|
|
13351
|
-
var terrainContoursSchema =
|
|
13352
|
-
demMaxZoom:
|
|
13353
|
-
demUrl:
|
|
14011
|
+
var terrainContoursSchema = z7.object({
|
|
14012
|
+
demMaxZoom: z7.number().int().min(0).max(24),
|
|
14013
|
+
demUrl: z7.string().min(1).max(2048).refine(
|
|
13354
14014
|
isSafeTileflowDemUrlTemplate,
|
|
13355
14015
|
"Expected a safe HTTP(S) DEM URL template containing {z}, {x}, and {y}"
|
|
13356
14016
|
),
|
|
13357
14017
|
index: terrainContourLineSchema.optional(),
|
|
13358
14018
|
labels: terrainContourLabelSchema.optional(),
|
|
13359
|
-
maxZoom:
|
|
14019
|
+
maxZoom: z7.number().int().min(0).max(24).optional(),
|
|
13360
14020
|
minZoom: zoomNumberSchema.optional(),
|
|
13361
14021
|
minor: terrainContourLineSchema.optional(),
|
|
13362
|
-
multiplier:
|
|
13363
|
-
overzoom:
|
|
14022
|
+
multiplier: z7.number().finite().min(1e-3).max(100).optional(),
|
|
14023
|
+
overzoom: z7.number().int().min(0).max(8).optional(),
|
|
13364
14024
|
sourceId: identifierSchema.optional(),
|
|
13365
14025
|
thresholds: terrainContourThresholdsSchema
|
|
13366
14026
|
}).strict().superRefine((contours, context) => {
|
|
@@ -13424,44 +14084,44 @@ var terrainContoursSchema = z6.object({
|
|
|
13424
14084
|
}
|
|
13425
14085
|
}
|
|
13426
14086
|
});
|
|
13427
|
-
var terrainSchema =
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
attribution:
|
|
14087
|
+
var terrainSchema = z7.union([
|
|
14088
|
+
z7.enum(["none", "hillshade", "3d"]),
|
|
14089
|
+
z7.object({
|
|
14090
|
+
attribution: z7.string().optional(),
|
|
13431
14091
|
contours: terrainContoursSchema.optional(),
|
|
13432
|
-
encoding:
|
|
13433
|
-
exaggeration:
|
|
14092
|
+
encoding: z7.enum(["mapbox", "terrarium"]).optional(),
|
|
14093
|
+
exaggeration: z7.number().finite().min(0).max(10).optional(),
|
|
13434
14094
|
hillshade: terrainHillshadeSchema.optional(),
|
|
13435
|
-
mode:
|
|
13436
|
-
sourceId:
|
|
13437
|
-
url:
|
|
14095
|
+
mode: z7.enum(["none", "hillshade", "3d"]).optional(),
|
|
14096
|
+
sourceId: z7.string().trim().min(1).optional(),
|
|
14097
|
+
url: z7.string().trim().min(1).optional()
|
|
13438
14098
|
}).strict()
|
|
13439
14099
|
]);
|
|
13440
|
-
var atmosphereColorLiteralSchema =
|
|
13441
|
-
var atmosphereColorSchema =
|
|
14100
|
+
var atmosphereColorLiteralSchema = z7.string().refine((value) => Color3.parse(value)?.a === 1, "Expected an opaque color");
|
|
14101
|
+
var atmosphereColorSchema = z7.union([
|
|
13442
14102
|
atmosphereColorLiteralSchema,
|
|
13443
14103
|
fixedStringSchema.extend({ value: atmosphereColorLiteralSchema }),
|
|
13444
|
-
themeTokenReferenceSchema.extend({ category:
|
|
14104
|
+
themeTokenReferenceSchema.extend({ category: z7.literal("color") }),
|
|
13445
14105
|
themeColorOperationSchema
|
|
13446
14106
|
]);
|
|
13447
|
-
var atmosphereSchema =
|
|
13448
|
-
|
|
13449
|
-
|
|
14107
|
+
var atmosphereSchema = z7.union([
|
|
14108
|
+
z7.boolean(),
|
|
14109
|
+
z7.object({
|
|
13450
14110
|
skyColor: atmosphereColorSchema.optional(),
|
|
13451
14111
|
horizonColor: atmosphereColorSchema.optional(),
|
|
13452
14112
|
fogColor: atmosphereColorSchema.optional(),
|
|
13453
14113
|
spaceColor: atmosphereColorSchema.optional(),
|
|
13454
|
-
starIntensity:
|
|
13455
|
-
starParallax:
|
|
14114
|
+
starIntensity: z7.number().finite().min(0).max(1).optional(),
|
|
14115
|
+
starParallax: z7.number().finite().min(0).max(1).optional()
|
|
13456
14116
|
}).strict()
|
|
13457
14117
|
]);
|
|
13458
|
-
var viewSchema =
|
|
13459
|
-
bearing:
|
|
13460
|
-
center:
|
|
13461
|
-
pitch:
|
|
14118
|
+
var viewSchema = z7.object({
|
|
14119
|
+
bearing: z7.number().finite().min(-180).max(180).optional(),
|
|
14120
|
+
center: z7.tuple([z7.number().finite().min(-180).max(180), z7.number().finite().min(-90).max(90)]).optional(),
|
|
14121
|
+
pitch: z7.number().finite().min(0).max(85).optional(),
|
|
13462
14122
|
zoom: zoomNumberSchema.optional()
|
|
13463
14123
|
}).strict();
|
|
13464
|
-
var themesSchema =
|
|
14124
|
+
var themesSchema = z7.record(tileflowThemeNameSchema, tileflowThemeSchema).superRefine((themes, context) => {
|
|
13465
14125
|
const names = Object.keys(themes);
|
|
13466
14126
|
if (names.length === 0) {
|
|
13467
14127
|
context.addIssue({ code: "custom", message: "Expected at least one named theme" });
|
|
@@ -13485,8 +14145,8 @@ var themesSchema = z6.record(tileflowThemeNameSchema, tileflowThemeSchema).super
|
|
|
13485
14145
|
}
|
|
13486
14146
|
}
|
|
13487
14147
|
}).describe("tileflow-themes");
|
|
13488
|
-
var systemThemesSchema =
|
|
13489
|
-
var resolvedTileflowMapSchema =
|
|
14148
|
+
var systemThemesSchema = z7.object({ dark: tileflowThemeNameSchema, light: tileflowThemeNameSchema }).strict();
|
|
14149
|
+
var resolvedTileflowMapSchema = z7.object({
|
|
13490
14150
|
atmosphere: atmosphereSchema.optional(),
|
|
13491
14151
|
data: dataSchema.optional(),
|
|
13492
14152
|
defaultTheme: tileflowThemeNameSchema,
|
|
@@ -13496,14 +14156,14 @@ var resolvedTileflowMapSchema = z6.object({
|
|
|
13496
14156
|
id: tileflowMapIdSchema,
|
|
13497
14157
|
marine: marineSchema.optional(),
|
|
13498
14158
|
modules: modulesSchema.optional(),
|
|
13499
|
-
name:
|
|
14159
|
+
name: z7.string().trim().min(1),
|
|
13500
14160
|
overlays: overlaysSchema.optional(),
|
|
13501
|
-
projection:
|
|
14161
|
+
projection: z7.enum(["globe", "mercator"]).optional(),
|
|
13502
14162
|
sources: hostedSourcesSchema.optional(),
|
|
13503
14163
|
systemThemes: systemThemesSchema.optional(),
|
|
13504
14164
|
terrain: terrainSchema.optional(),
|
|
13505
14165
|
themes: themesSchema,
|
|
13506
|
-
version:
|
|
14166
|
+
version: z7.number().int().positive(),
|
|
13507
14167
|
view: viewSchema.optional()
|
|
13508
14168
|
}).strict().superRefine((map, context) => {
|
|
13509
14169
|
if (map.fonts !== void 0 && map.glyphs !== void 0) {
|
|
@@ -13584,9 +14244,43 @@ function parseOrThrow(schema, input, name) {
|
|
|
13584
14244
|
if (result.success) return result.data;
|
|
13585
14245
|
throw new TileflowResolvedMapValidationError(
|
|
13586
14246
|
name,
|
|
13587
|
-
validationMessagesFromIssues(result.error.issues)
|
|
14247
|
+
validationMessagesFromIssues(expandUnionIssues(result.error.issues, [], input))
|
|
13588
14248
|
);
|
|
13589
14249
|
}
|
|
14250
|
+
function expandUnionIssues(issues, base, input) {
|
|
14251
|
+
return issues.flatMap((issue) => {
|
|
14252
|
+
const path = [...base, ...issue.path];
|
|
14253
|
+
if (issue.code !== "invalid_union" || issue.errors.length === 0) return [{ ...issue, path }];
|
|
14254
|
+
const candidates = issue.errors.filter((branch) => !branch.some(isUnionBranchMismatch));
|
|
14255
|
+
if (candidates.length === 0) {
|
|
14256
|
+
return [{ ...issue, path, message: unmatchedUnionMessage(valueAtPath(input, path)) }];
|
|
14257
|
+
}
|
|
14258
|
+
const fewest = Math.min(...candidates.map((branch) => branch.length));
|
|
14259
|
+
const best = candidates.filter((branch) => branch.length === fewest);
|
|
14260
|
+
return best.length === 1 ? expandUnionIssues(best[0], path, input) : [{ ...issue, path }];
|
|
14261
|
+
});
|
|
14262
|
+
}
|
|
14263
|
+
function isUnionBranchMismatch(issue) {
|
|
14264
|
+
if (issue.path.length === 0)
|
|
14265
|
+
return issue.code === "invalid_type" || issue.code === "invalid_value";
|
|
14266
|
+
return issue.path.length === 1 && (issue.code === "invalid_value" || issue.code === "invalid_union" && issue.errors.length === 0);
|
|
14267
|
+
}
|
|
14268
|
+
function unmatchedUnionMessage(value) {
|
|
14269
|
+
const kind = value !== null && typeof value === "object" ? value.kind : void 0;
|
|
14270
|
+
if (kind === "theme-fixed" || kind === "theme-token") {
|
|
14271
|
+
return `This property is structural. ${structuralThemeValueHint}`;
|
|
14272
|
+
}
|
|
14273
|
+
const received = value === null ? "null" : Array.isArray(value) ? "an array" : typeof value;
|
|
14274
|
+
return `Invalid input: no accepted form takes ${received === "object" ? "this object" : received}`;
|
|
14275
|
+
}
|
|
14276
|
+
function valueAtPath(input, path) {
|
|
14277
|
+
let value = input;
|
|
14278
|
+
for (const key of path) {
|
|
14279
|
+
if (value === null || typeof value !== "object" || !Object.hasOwn(value, key)) return void 0;
|
|
14280
|
+
value = value[key];
|
|
14281
|
+
}
|
|
14282
|
+
return value;
|
|
14283
|
+
}
|
|
13590
14284
|
function validationMessagesFromIssues(issues) {
|
|
13591
14285
|
return issues.flatMap((issue) => {
|
|
13592
14286
|
const basePath = issue.path.join(".");
|
|
@@ -13650,6 +14344,74 @@ function findUnsafeObjectStructure(input) {
|
|
|
13650
14344
|
return void 0;
|
|
13651
14345
|
}
|
|
13652
14346
|
|
|
14347
|
+
// src/route-inks.ts
|
|
14348
|
+
var tileflowRouteMetadataKey = "tileflow:route";
|
|
14349
|
+
var tileflowRouteTokens = Object.freeze({
|
|
14350
|
+
color: Object.freeze({
|
|
14351
|
+
line: "route.line",
|
|
14352
|
+
casing: "route.casing",
|
|
14353
|
+
core: "route.core",
|
|
14354
|
+
glow: "route.glow",
|
|
14355
|
+
alternative: "route.alternative"
|
|
14356
|
+
}),
|
|
14357
|
+
number: Object.freeze({
|
|
14358
|
+
glowOpacity: "route.glow.opacity",
|
|
14359
|
+
coreOpacity: "route.core.opacity"
|
|
14360
|
+
})
|
|
14361
|
+
});
|
|
14362
|
+
var tileflowDefaultRouteInks = Object.freeze({
|
|
14363
|
+
light: Object.freeze({
|
|
14364
|
+
line: "#2563eb",
|
|
14365
|
+
casing: "#1e3a8a",
|
|
14366
|
+
core: "#dbeafe",
|
|
14367
|
+
glow: "#2563eb",
|
|
14368
|
+
alternative: "#94a3b8",
|
|
14369
|
+
glowOpacity: 0.16,
|
|
14370
|
+
coreOpacity: 0
|
|
14371
|
+
}),
|
|
14372
|
+
dark: Object.freeze({
|
|
14373
|
+
line: "#60a5fa",
|
|
14374
|
+
casing: "#0b1220",
|
|
14375
|
+
core: "#eff6ff",
|
|
14376
|
+
glow: "#60a5fa",
|
|
14377
|
+
alternative: "#64748b",
|
|
14378
|
+
glowOpacity: 0.4,
|
|
14379
|
+
coreOpacity: 0.7
|
|
14380
|
+
})
|
|
14381
|
+
});
|
|
14382
|
+
var colourKeys = Object.keys(
|
|
14383
|
+
tileflowRouteTokens.color
|
|
14384
|
+
);
|
|
14385
|
+
var numberKeys = Object.keys(
|
|
14386
|
+
tileflowRouteTokens.number
|
|
14387
|
+
);
|
|
14388
|
+
function resolveTileflowRouteInks(theme) {
|
|
14389
|
+
const defaults4 = tileflowDefaultRouteInks[theme.colorScheme];
|
|
14390
|
+
const inks = { ...defaults4 };
|
|
14391
|
+
for (const key of colourKeys) {
|
|
14392
|
+
const value = theme.tokens.color[tileflowRouteTokens.color[key]];
|
|
14393
|
+
if (value !== void 0) inks[key] = value;
|
|
14394
|
+
}
|
|
14395
|
+
for (const key of numberKeys) {
|
|
14396
|
+
const token2 = tileflowRouteTokens.number[key];
|
|
14397
|
+
const value = theme.tokens.number[token2];
|
|
14398
|
+
if (value === void 0) continue;
|
|
14399
|
+
if (!(value >= 0 && value <= 1)) {
|
|
14400
|
+
throw new Error(
|
|
14401
|
+
`Tileflow theme "${theme.id}" sets number token "${token2}" to ${value}; route opacities run from 0 to 1.`
|
|
14402
|
+
);
|
|
14403
|
+
}
|
|
14404
|
+
inks[key] = value;
|
|
14405
|
+
}
|
|
14406
|
+
return Object.freeze(inks);
|
|
14407
|
+
}
|
|
14408
|
+
function tileflowRouteMetadata(inks) {
|
|
14409
|
+
return Object.freeze({ version: 1, ...inks });
|
|
14410
|
+
}
|
|
14411
|
+
|
|
14412
|
+
// src/cartography/streets.ts
|
|
14413
|
+
init_sun();
|
|
14414
|
+
|
|
13653
14415
|
// src/terrain/index.ts
|
|
13654
14416
|
function resolveTerrain(terrain, apiBaseUrl) {
|
|
13655
14417
|
if (!terrain || terrain === "none") return void 0;
|
|
@@ -13935,18 +14697,18 @@ function cloneJson22(value) {
|
|
|
13935
14697
|
|
|
13936
14698
|
// src/icon-appearance.ts
|
|
13937
14699
|
import { Color as Color4 } from "@maplibre/maplibre-gl-style-spec";
|
|
13938
|
-
import { z as
|
|
14700
|
+
import { z as z9 } from "zod";
|
|
13939
14701
|
|
|
13940
14702
|
// src/icon-layout.ts
|
|
13941
|
-
import { z as
|
|
13942
|
-
var coordinate =
|
|
13943
|
-
var regions =
|
|
14703
|
+
import { z as z8 } from "zod";
|
|
14704
|
+
var coordinate = z8.number().int().nonnegative().max(2048);
|
|
14705
|
+
var regions = z8.array(z8.tuple([coordinate, coordinate])).min(1).max(2048);
|
|
13944
14706
|
var tileflowIconLayoutFields = {
|
|
13945
14707
|
stretchX: regions.optional(),
|
|
13946
14708
|
stretchY: regions.optional(),
|
|
13947
|
-
content:
|
|
14709
|
+
content: z8.tuple([coordinate, coordinate, coordinate, coordinate]).optional()
|
|
13948
14710
|
};
|
|
13949
|
-
var tileflowIconLayoutSchema =
|
|
14711
|
+
var tileflowIconLayoutSchema = z8.object(tileflowIconLayoutFields).strict().superRefine((layout, context) => {
|
|
13950
14712
|
if (!Object.values(layout).some((value) => value !== void 0))
|
|
13951
14713
|
context.addIssue({
|
|
13952
14714
|
code: "custom",
|
|
@@ -14008,14 +14770,14 @@ function scaleTileflowIconLayout(layout, scale) {
|
|
|
14008
14770
|
}
|
|
14009
14771
|
|
|
14010
14772
|
// src/icon-appearance.ts
|
|
14011
|
-
var color2 =
|
|
14012
|
-
var tileflowIconAppearanceSchema =
|
|
14013
|
-
representation:
|
|
14014
|
-
defaults:
|
|
14773
|
+
var color2 = z9.string().max(128).refine((value) => Color4.parse(value) !== void 0, "Expected a MapLibre color");
|
|
14774
|
+
var tileflowIconAppearanceSchema = z9.object({
|
|
14775
|
+
representation: z9.literal("sdf"),
|
|
14776
|
+
defaults: z9.object({
|
|
14015
14777
|
color: color2,
|
|
14016
14778
|
haloColor: color2,
|
|
14017
|
-
haloWidth:
|
|
14018
|
-
haloBlur:
|
|
14779
|
+
haloWidth: z9.number().finite().min(0).max(2),
|
|
14780
|
+
haloBlur: z9.number().finite().min(0).max(1)
|
|
14019
14781
|
}).strict()
|
|
14020
14782
|
}).strict();
|
|
14021
14783
|
function assertTileflowSdfPixels(input) {
|
|
@@ -14039,18 +14801,18 @@ function assertTileflowSdfPixels(input) {
|
|
|
14039
14801
|
throw new Error("SDF pixels require an interior and a distance transition.");
|
|
14040
14802
|
}
|
|
14041
14803
|
var tileflowIconMetadataFileName = "tileflow.icons.json";
|
|
14042
|
-
var tileflowIconAuthorMetadataSchema =
|
|
14043
|
-
schemaVersion:
|
|
14044
|
-
icons:
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14804
|
+
var tileflowIconAuthorMetadataSchema = z9.object({
|
|
14805
|
+
schemaVersion: z9.literal(1),
|
|
14806
|
+
icons: z9.record(
|
|
14807
|
+
z9.string().max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
14808
|
+
z9.union([
|
|
14809
|
+
z9.object({ representation: z9.literal("rgba"), layout: tileflowIconLayoutSchema.optional() }).strict(),
|
|
14048
14810
|
tileflowIconAppearanceSchema.extend({
|
|
14049
14811
|
layout: tileflowIconLayoutSchema.optional(),
|
|
14050
14812
|
defaults: tileflowIconAppearanceSchema.shape.defaults.extend({
|
|
14051
14813
|
haloColor: color2.default("transparent"),
|
|
14052
|
-
haloWidth:
|
|
14053
|
-
haloBlur:
|
|
14814
|
+
haloWidth: z9.number().finite().min(0).max(2).default(0),
|
|
14815
|
+
haloBlur: z9.number().finite().min(0).max(1).default(0)
|
|
14054
14816
|
})
|
|
14055
14817
|
})
|
|
14056
14818
|
])
|
|
@@ -14335,11 +15097,11 @@ function isTileflowPoiCategory(value) {
|
|
|
14335
15097
|
return typeof value === "string" && tileflowPoiCategories.includes(value);
|
|
14336
15098
|
}
|
|
14337
15099
|
function semanticTarget(layer) {
|
|
14338
|
-
if (!
|
|
15100
|
+
if (!isRecord8(layer.metadata)) return void 0;
|
|
14339
15101
|
const value = layer.metadata[tileflowCompilerMetadataKeys.target];
|
|
14340
15102
|
return typeof value === "string" ? value : void 0;
|
|
14341
15103
|
}
|
|
14342
|
-
function
|
|
15104
|
+
function isRecord8(value) {
|
|
14343
15105
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
14344
15106
|
}
|
|
14345
15107
|
function isSafeArtifactName(value) {
|
|
@@ -14349,6 +15111,47 @@ function isSafeArtifactName(value) {
|
|
|
14349
15111
|
});
|
|
14350
15112
|
}
|
|
14351
15113
|
|
|
15114
|
+
// src/cartography/layout-zoom-diagnostics.ts
|
|
15115
|
+
function diagnoseFractionalLayoutZoomSteps(layers) {
|
|
15116
|
+
const diagnostics = [];
|
|
15117
|
+
for (const layer of layers) {
|
|
15118
|
+
const layout = layer.layout;
|
|
15119
|
+
if (layout === null || typeof layout !== "object") continue;
|
|
15120
|
+
for (const [property, value] of Object.entries(layout)) {
|
|
15121
|
+
const stops = fractionalZoomSteps(value);
|
|
15122
|
+
if (stops.length === 0) continue;
|
|
15123
|
+
const [origin] = readTileflowCompilerProvenance(layer);
|
|
15124
|
+
const listed = stops.map((stop) => String(stop)).join(", ");
|
|
15125
|
+
diagnostics.push({
|
|
15126
|
+
code: "TF_LAYOUT_FRACTIONAL_ZOOM_STEP",
|
|
15127
|
+
...origin ? { domain: origin.owner } : {},
|
|
15128
|
+
message: `${property} steps at zoom ${listed}; layout properties are evaluated at each tile's integer zoom, so the step takes effect at zoom ${stops.map(Math.ceil).join(", ")}.`,
|
|
15129
|
+
path: `layers.${String(layer.id)}.layout.${property}`,
|
|
15130
|
+
phase: "lowering",
|
|
15131
|
+
severity: "warning",
|
|
15132
|
+
suggestion: "Step at whole zooms, or move the change to a paint property or a zoom range.",
|
|
15133
|
+
...origin ? { target: origin.target } : {}
|
|
15134
|
+
});
|
|
15135
|
+
}
|
|
15136
|
+
}
|
|
15137
|
+
return diagnostics;
|
|
15138
|
+
}
|
|
15139
|
+
function fractionalZoomSteps(value) {
|
|
15140
|
+
if (!Array.isArray(value)) return [];
|
|
15141
|
+
const stops = [];
|
|
15142
|
+
if (value[0] === "step" && isZoom(value[1])) {
|
|
15143
|
+
for (let index = 3; index < value.length; index += 2) {
|
|
15144
|
+
const stop = value[index];
|
|
15145
|
+
if (typeof stop === "number" && !Number.isInteger(stop)) stops.push(stop);
|
|
15146
|
+
}
|
|
15147
|
+
}
|
|
15148
|
+
for (const entry of value) stops.push(...fractionalZoomSteps(entry));
|
|
15149
|
+
return stops;
|
|
15150
|
+
}
|
|
15151
|
+
function isZoom(value) {
|
|
15152
|
+
return Array.isArray(value) && value.length === 1 && value[0] === "zoom";
|
|
15153
|
+
}
|
|
15154
|
+
|
|
14352
15155
|
// src/cartography/overlay-placement-manifest.ts
|
|
14353
15156
|
var tileflowOverlayPlacementManifestMetadataKey = "tileflow:overlay-placement-manifest";
|
|
14354
15157
|
var tileflowOverlayPlacementManifestSchemaVersion = 1;
|
|
@@ -15343,7 +16146,7 @@ function compileSemanticStyleInternal(input, options, inspect, onReport) {
|
|
|
15343
16146
|
() => compileSemanticDomains(modules, context)
|
|
15344
16147
|
);
|
|
15345
16148
|
const renderStackModules = Object.values(modules).filter(
|
|
15346
|
-
(module) =>
|
|
16149
|
+
(module) => isRecord9(module) && module.enabled !== false && "renderStack" in module && isRecord9(module.renderStack)
|
|
15347
16150
|
);
|
|
15348
16151
|
const renderOperations = runCompilationPhase(
|
|
15349
16152
|
"render-stack",
|
|
@@ -15573,13 +16376,15 @@ function compileSemanticStyleInternal(input, options, inspect, onReport) {
|
|
|
15573
16376
|
...atmosphere ? { [tileflowAtmosphereMetadataKey]: { version: 1, ...atmosphere } } : {},
|
|
15574
16377
|
"tileflow:theme": selected.name,
|
|
15575
16378
|
"tileflow:colorScheme": resolvedTheme.colorScheme,
|
|
16379
|
+
[tileflowRouteMetadataKey]: tileflowRouteMetadata(resolveTileflowRouteInks(resolvedTheme)),
|
|
16380
|
+
...resolvedTheme.sun ? { [tileflowSunMetadataKey]: tileflowSunMetadata(resolvedTheme.sun) } : {},
|
|
15576
16381
|
"tileflow:data": data.identity,
|
|
15577
16382
|
"tileflow:sources": sourceIdentities,
|
|
15578
16383
|
...Object.keys(loweredOverlays.identities).length > 0 ? { "tileflow:overlays": loweredOverlays.identities } : {},
|
|
15579
16384
|
"tileflow:sourceRequirements": sourceRequirements,
|
|
15580
16385
|
...interactionManifest ? { [tileflowInteractionManifestMetadataKey]: interactionManifest } : {},
|
|
15581
16386
|
[tileflowOverlayPlacementManifestMetadataKey]: overlayPlacementManifest,
|
|
15582
|
-
"tileflow:modules": Object.entries(modules).filter(([, module]) => !
|
|
16387
|
+
"tileflow:modules": Object.entries(modules).filter(([, module]) => !isRecord9(module) || module.enabled !== false).map(([name]) => name).sort(),
|
|
15583
16388
|
...config.view ? { "tileflow:view": config.view } : {}
|
|
15584
16389
|
}
|
|
15585
16390
|
};
|
|
@@ -15599,7 +16404,16 @@ function compileSemanticStyleInternal(input, options, inspect, onReport) {
|
|
|
15599
16404
|
runCompilationPhase("assets", () => assertTextAssets(style, config));
|
|
15600
16405
|
runCompilationPhase("assets", () => assertGlyphFontStacks(style, config));
|
|
15601
16406
|
runCompilationPhase("validation", () => assertMapLibreStyle(style, config.id));
|
|
15602
|
-
|
|
16407
|
+
const layoutDiagnostics = runCompilationPhase(
|
|
16408
|
+
"validation",
|
|
16409
|
+
() => diagnoseFractionalLayoutZoomSteps(plannedLayers)
|
|
16410
|
+
);
|
|
16411
|
+
return {
|
|
16412
|
+
diagnostics: [...diagnostics, ...layoutDiagnostics],
|
|
16413
|
+
report,
|
|
16414
|
+
style,
|
|
16415
|
+
...inspection ? { inspection } : {}
|
|
16416
|
+
};
|
|
15603
16417
|
}
|
|
15604
16418
|
function finalizeTileflowLayers(input) {
|
|
15605
16419
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -15622,7 +16436,7 @@ function finalizeTileflowLayers(input) {
|
|
|
15622
16436
|
if (typeof minimum2 === "number" && typeof maximum2 === "number" && minimum2 > maximum2) {
|
|
15623
16437
|
throw new Error(`Compiled Tileflow layer ${id2} requires minzoom <= maxzoom.`);
|
|
15624
16438
|
}
|
|
15625
|
-
const metadata =
|
|
16439
|
+
const metadata = isRecord9(layer.metadata) ? { ...layer.metadata } : void 0;
|
|
15626
16440
|
if (metadata) {
|
|
15627
16441
|
const owner = metadata[tileflowCompilerMetadataKeys.owner];
|
|
15628
16442
|
delete metadata[tileflowCompilerProvenanceMetadataKey];
|
|
@@ -15656,7 +16470,7 @@ function assertMapLibreStyle(style, mapId) {
|
|
|
15656
16470
|
}
|
|
15657
16471
|
);
|
|
15658
16472
|
}
|
|
15659
|
-
function
|
|
16473
|
+
function isRecord9(value) {
|
|
15660
16474
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
15661
16475
|
}
|
|
15662
16476
|
function resolveGlyphs(config) {
|
|
@@ -15677,8 +16491,8 @@ function assertPreparedIconReferences(style, config, prepared) {
|
|
|
15677
16491
|
function collectStyleImageReferences(style) {
|
|
15678
16492
|
const result = /* @__PURE__ */ new Set();
|
|
15679
16493
|
for (const layer of style.layers) {
|
|
15680
|
-
const layout =
|
|
15681
|
-
const paint =
|
|
16494
|
+
const layout = isRecord9(layer.layout) ? layer.layout : {};
|
|
16495
|
+
const paint = isRecord9(layer.paint) ? layer.paint : {};
|
|
15682
16496
|
const layerId = typeof layer.id === "string" ? layer.id : "<unknown>";
|
|
15683
16497
|
for (const [property, value] of [
|
|
15684
16498
|
["icon-image", layout["icon-image"]],
|
|
@@ -15767,7 +16581,7 @@ function assertGlyphFontStacks(style, config) {
|
|
|
15767
16581
|
const declared = new Set(config.glyphs.fontStacks);
|
|
15768
16582
|
const missing = /* @__PURE__ */ new Set();
|
|
15769
16583
|
for (const layer of style.layers) {
|
|
15770
|
-
const layout =
|
|
16584
|
+
const layout = isRecord9(layer.layout) ? layer.layout : void 0;
|
|
15771
16585
|
const font = layout?.["text-font"];
|
|
15772
16586
|
if (!Array.isArray(font) || !font.every((entry) => typeof entry === "string")) continue;
|
|
15773
16587
|
const stack = font.join(",");
|
|
@@ -15783,7 +16597,7 @@ function assertGlyphFontStacks(style, config) {
|
|
|
15783
16597
|
function assertTextAssets(style, config) {
|
|
15784
16598
|
const textLayers = [];
|
|
15785
16599
|
for (const layer of style.layers) {
|
|
15786
|
-
const layout =
|
|
16600
|
+
const layout = isRecord9(layer.layout) ? layer.layout : void 0;
|
|
15787
16601
|
if (layout?.["text-field"] === void 0) continue;
|
|
15788
16602
|
textLayers.push(typeof layer.id === "string" ? layer.id : "<unknown>");
|
|
15789
16603
|
const font = layout["text-font"];
|
|
@@ -15796,7 +16610,7 @@ function assertTextAssets(style, config) {
|
|
|
15796
16610
|
if (textLayers.length === 0) return;
|
|
15797
16611
|
if (config.fonts !== void 0) {
|
|
15798
16612
|
const backed = style.layers.find((layer) => {
|
|
15799
|
-
const font =
|
|
16613
|
+
const font = isRecord9(layer.layout) ? layer.layout["text-font"] : void 0;
|
|
15800
16614
|
return Array.isArray(font) && font.length === 1 && typeof font[0] === "string" && parseTileflowLineBackgroundFontStack(font[0]) !== void 0;
|
|
15801
16615
|
});
|
|
15802
16616
|
if (backed) {
|
|
@@ -15822,7 +16636,7 @@ function runCompilationPhase(phase, operation) {
|
|
|
15822
16636
|
}
|
|
15823
16637
|
}
|
|
15824
16638
|
function withCompilationPhase(error, phase) {
|
|
15825
|
-
const record2 =
|
|
16639
|
+
const record2 = isRecord9(error) ? error : {};
|
|
15826
16640
|
if (typeof record2.phase === "string") return error;
|
|
15827
16641
|
if (error instanceof Error && Object.isExtensible(error)) {
|
|
15828
16642
|
Object.defineProperty(error, "phase", { configurable: true, enumerable: true, value: phase });
|
|
@@ -15924,6 +16738,7 @@ var tileflowMapMergeStrategies = {
|
|
|
15924
16738
|
overlays: "keyed-resources",
|
|
15925
16739
|
projection: "atomic",
|
|
15926
16740
|
scenes: "leaf",
|
|
16741
|
+
shots: "leaf",
|
|
15927
16742
|
sources: "keyed-resources",
|
|
15928
16743
|
systemThemes: "atomic",
|
|
15929
16744
|
terrain: "atomic",
|
|
@@ -16263,11 +17078,11 @@ function cloneDesign(value) {
|
|
|
16263
17078
|
function describeMap(value) {
|
|
16264
17079
|
return typeof value.id === "string" && value.id ? value.id : "<anonymous>";
|
|
16265
17080
|
}
|
|
16266
|
-
function
|
|
17081
|
+
function isRecord10(value) {
|
|
16267
17082
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
16268
17083
|
}
|
|
16269
17084
|
function isPlainRecord4(value) {
|
|
16270
|
-
if (!
|
|
17085
|
+
if (!isRecord10(value)) return false;
|
|
16271
17086
|
const prototype = Object.getPrototypeOf(value);
|
|
16272
17087
|
return prototype === Object.prototype || prototype === null;
|
|
16273
17088
|
}
|
|
@@ -16334,6 +17149,7 @@ function parseTileflowMap(map) {
|
|
|
16334
17149
|
for (const node2 of lineage.reverse()) {
|
|
16335
17150
|
const resolved = node2 === map ? resolvedLeaf : resolveMap(node2);
|
|
16336
17151
|
validateMapScenes(node2, resolved.id);
|
|
17152
|
+
validateMapShots(node2, resolved.id);
|
|
16337
17153
|
const parsed = parseResolvedTileflowMap(resolved);
|
|
16338
17154
|
if (node2 === map) parsedLeaf = parsed;
|
|
16339
17155
|
}
|
|
@@ -16341,40 +17157,53 @@ function parseTileflowMap(map) {
|
|
|
16341
17157
|
return parsedLeaf;
|
|
16342
17158
|
}
|
|
16343
17159
|
function validateMapScenes(map, mapId) {
|
|
16344
|
-
|
|
16345
|
-
|
|
16346
|
-
|
|
17160
|
+
validateMapCaptureEntries(map, mapId, "scenes", (input) => {
|
|
17161
|
+
const result = tileflowCaptureSceneSchema.safeParse(input);
|
|
17162
|
+
return result.success ? tileflowCaptureSceneFitIssue(result.data) : result.error.issues[0];
|
|
17163
|
+
});
|
|
17164
|
+
}
|
|
17165
|
+
function validateMapShots(map, mapId) {
|
|
17166
|
+
validateMapCaptureEntries(map, mapId, "shots", (input) => {
|
|
17167
|
+
const result = tileflowCaptureShotSchema.safeParse(input);
|
|
17168
|
+
return result.success ? void 0 : result.error.issues[0];
|
|
17169
|
+
});
|
|
17170
|
+
}
|
|
17171
|
+
function validateMapCaptureEntries(map, mapId, key, findIssue) {
|
|
17172
|
+
const entries = map[key];
|
|
17173
|
+
if (entries === void 0) return;
|
|
17174
|
+
if (!isPlainRecord5(entries)) {
|
|
17175
|
+
throw new Error(`Invalid Tileflow map "${map.id}". ${key}: Expected a plain object.`);
|
|
16347
17176
|
}
|
|
17177
|
+
const label = key === "scenes" ? "scene" : "shot";
|
|
16348
17178
|
const namesByCaseFold = /* @__PURE__ */ new Map();
|
|
16349
|
-
for (const [
|
|
16350
|
-
const nameResult = tileflowCaptureSceneNameSchema.safeParse(
|
|
17179
|
+
for (const [name, input] of Object.entries(entries)) {
|
|
17180
|
+
const nameResult = tileflowCaptureSceneNameSchema.safeParse(name);
|
|
16351
17181
|
if (!nameResult.success) {
|
|
16352
17182
|
throw new Error(
|
|
16353
|
-
`Invalid Tileflow map "${map.id}".
|
|
17183
|
+
`Invalid Tileflow map "${map.id}". ${key}.${name}: ${nameResult.error.issues[0]?.message ?? `Invalid ${label} name`}`
|
|
16354
17184
|
);
|
|
16355
17185
|
}
|
|
16356
|
-
const
|
|
16357
|
-
const folded =
|
|
17186
|
+
const normalizedName = nameResult.data;
|
|
17187
|
+
const folded = normalizedName.toLowerCase();
|
|
16358
17188
|
const existing = namesByCaseFold.get(folded);
|
|
16359
17189
|
if (existing) {
|
|
16360
17190
|
throw new Error(
|
|
16361
|
-
`Invalid Tileflow map "${map.id}".
|
|
17191
|
+
`Invalid Tileflow map "${map.id}". ${key}.${name}: Expected an id that does not normalize to "${existing}".`
|
|
16362
17192
|
);
|
|
16363
17193
|
}
|
|
16364
|
-
namesByCaseFold.set(folded,
|
|
17194
|
+
namesByCaseFold.set(folded, normalizedName);
|
|
16365
17195
|
if (!isPlainRecord5(input)) {
|
|
16366
|
-
throw new Error(`Invalid Tileflow map "${map.id}".
|
|
17196
|
+
throw new Error(`Invalid Tileflow map "${map.id}". ${key}.${name}: Expected an object.`);
|
|
16367
17197
|
}
|
|
16368
17198
|
if (Object.hasOwn(input, "map")) {
|
|
16369
17199
|
throw new Error(
|
|
16370
|
-
`Invalid Tileflow map "${map.id}".
|
|
17200
|
+
`Invalid Tileflow map "${map.id}". ${key}.${name}.map: Unrecognized key; a singular map ${label} inherits its map id.`
|
|
16371
17201
|
);
|
|
16372
17202
|
}
|
|
16373
|
-
const
|
|
16374
|
-
|
|
16375
|
-
if (!result.success || issue) {
|
|
17203
|
+
const issue = findIssue({ ...input, map: mapId });
|
|
17204
|
+
if (issue) {
|
|
16376
17205
|
throw new Error(
|
|
16377
|
-
`Invalid Tileflow map "${map.id}".
|
|
17206
|
+
`Invalid Tileflow map "${map.id}". ${key}.${name}${issue.path.length ? `.${issue.path.join(".")}` : ""}: ${issue.message}`
|
|
16378
17207
|
);
|
|
16379
17208
|
}
|
|
16380
17209
|
}
|
|
@@ -16997,7 +17826,7 @@ function resolveSemanticDiffInput(input) {
|
|
|
16997
17826
|
}
|
|
16998
17827
|
function isAuthoringOnlyMapShape(input) {
|
|
16999
17828
|
if (!isUnknownRecord(input)) return true;
|
|
17000
|
-
if (!Object.hasOwn(input, "name") || Object.hasOwn(input, "extends") || Object.hasOwn(input, "scenes")) {
|
|
17829
|
+
if (!Object.hasOwn(input, "name") || Object.hasOwn(input, "extends") || Object.hasOwn(input, "scenes") || Object.hasOwn(input, "shots")) {
|
|
17001
17830
|
return true;
|
|
17002
17831
|
}
|
|
17003
17832
|
if (!isUnknownRecord(input.modules)) return false;
|
|
@@ -17011,7 +17840,7 @@ function semanticDesign(map) {
|
|
|
17011
17840
|
}
|
|
17012
17841
|
function compareValues(before, after, path, output) {
|
|
17013
17842
|
if (Object.is(before, after)) return;
|
|
17014
|
-
if (
|
|
17843
|
+
if (isRecord11(before) && isRecord11(after)) {
|
|
17015
17844
|
const keys = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])].sort(
|
|
17016
17845
|
compareCodeUnits9
|
|
17017
17846
|
);
|
|
@@ -17053,7 +17882,7 @@ function toSemanticValue(value, path) {
|
|
|
17053
17882
|
}
|
|
17054
17883
|
throw new TypeError(`Tileflow semantic value at ${path || "/"} is not JSON-serializable.`);
|
|
17055
17884
|
}
|
|
17056
|
-
function
|
|
17885
|
+
function isRecord11(value) {
|
|
17057
17886
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
17058
17887
|
}
|
|
17059
17888
|
function isUnknownRecord(value) {
|
|
@@ -17066,7 +17895,7 @@ function deepEqual(left, right) {
|
|
|
17066
17895
|
if (Array.isArray(left) || Array.isArray(right)) {
|
|
17067
17896
|
return Array.isArray(left) && Array.isArray(right) && left.length === right.length && left.every((value, index) => deepEqual(value, right[index]));
|
|
17068
17897
|
}
|
|
17069
|
-
if (!
|
|
17898
|
+
if (!isRecord11(left) || !isRecord11(right)) return false;
|
|
17070
17899
|
const leftKeys = Object.keys(left).sort(compareCodeUnits9);
|
|
17071
17900
|
const rightKeys = Object.keys(right).sort(compareCodeUnits9);
|
|
17072
17901
|
return leftKeys.length === rightKeys.length && leftKeys.every((key, index) => key === rightKeys[index] && deepEqual(left[key], right[key]));
|
|
@@ -17163,8 +17992,11 @@ function asRecord7(value) {
|
|
|
17163
17992
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
17164
17993
|
}
|
|
17165
17994
|
|
|
17995
|
+
// src/index.ts
|
|
17996
|
+
init_sun();
|
|
17997
|
+
|
|
17166
17998
|
// src/icon-package.ts
|
|
17167
|
-
import { z as
|
|
17999
|
+
import { z as z10 } from "zod";
|
|
17168
18000
|
var tileflowIconPackageFileNames = [
|
|
17169
18001
|
"sprite.json",
|
|
17170
18002
|
"sprite.png",
|
|
@@ -17189,19 +18021,19 @@ var tileflowHostedAlphaCompatibility = {
|
|
|
17189
18021
|
},
|
|
17190
18022
|
maxMapsPerDeploy: 20
|
|
17191
18023
|
};
|
|
17192
|
-
var sha256Schema =
|
|
18024
|
+
var sha256Schema = z10.string().regex(/^[a-f0-9]{64}$/);
|
|
17193
18025
|
var tileflowIconPackageContentHashSchema = sha256Schema;
|
|
17194
|
-
var tileflowIconIdSchema =
|
|
17195
|
-
var tileflowRenderedIconManifestEntrySchema =
|
|
18026
|
+
var tileflowIconIdSchema = z10.string().max(64).regex(tileflowIconIdPattern);
|
|
18027
|
+
var tileflowRenderedIconManifestEntrySchema = z10.object({
|
|
17196
18028
|
name: tileflowIconIdSchema,
|
|
17197
18029
|
appearance: tileflowIconAppearanceSchema.optional(),
|
|
17198
18030
|
layout: tileflowIconLayoutSchema.optional(),
|
|
17199
|
-
pixelSha256:
|
|
18031
|
+
pixelSha256: z10.object({
|
|
17200
18032
|
oneX: sha256Schema,
|
|
17201
18033
|
twoX: sha256Schema
|
|
17202
18034
|
}).strict()
|
|
17203
18035
|
}).strict();
|
|
17204
|
-
var tileflowIconPackageLabelSchema =
|
|
18036
|
+
var tileflowIconPackageLabelSchema = z10.string().superRefine((value, context) => {
|
|
17205
18037
|
if (value !== value.trim() || value.length === 0) {
|
|
17206
18038
|
context.addIssue({
|
|
17207
18039
|
code: "custom",
|
|
@@ -17221,32 +18053,32 @@ var tileflowIconPackageLabelSchema = z9.string().superRefine((value, context) =>
|
|
|
17221
18053
|
});
|
|
17222
18054
|
}
|
|
17223
18055
|
});
|
|
17224
|
-
var spriteDimensionsSchema =
|
|
17225
|
-
height:
|
|
17226
|
-
pixelRatio:
|
|
17227
|
-
width:
|
|
18056
|
+
var spriteDimensionsSchema = z10.object({
|
|
18057
|
+
height: z10.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
18058
|
+
pixelRatio: z10.union([z10.literal(1), z10.literal(2)]),
|
|
18059
|
+
width: z10.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension)
|
|
17228
18060
|
}).strict();
|
|
17229
18061
|
function iconPackageFileSchema(name, contentType) {
|
|
17230
|
-
return
|
|
17231
|
-
byteLength:
|
|
17232
|
-
contentType:
|
|
17233
|
-
name:
|
|
18062
|
+
return z10.object({
|
|
18063
|
+
byteLength: z10.number().int().nonnegative().max(tileflowIconPackageLimits.maxGeneratedFileBytes),
|
|
18064
|
+
contentType: z10.literal(contentType),
|
|
18065
|
+
name: z10.literal(name),
|
|
17234
18066
|
sha256: sha256Schema
|
|
17235
18067
|
}).strict();
|
|
17236
18068
|
}
|
|
17237
|
-
var tileflowIconPackageManifestSchema =
|
|
17238
|
-
files:
|
|
18069
|
+
var tileflowIconPackageManifestSchema = z10.object({
|
|
18070
|
+
files: z10.tuple([
|
|
17239
18071
|
iconPackageFileSchema("sprite.json", "application/json"),
|
|
17240
18072
|
iconPackageFileSchema("sprite.png", "image/png"),
|
|
17241
18073
|
iconPackageFileSchema("sprite@2x.json", "application/json"),
|
|
17242
18074
|
iconPackageFileSchema("sprite@2x.png", "image/png")
|
|
17243
18075
|
]),
|
|
17244
|
-
format:
|
|
17245
|
-
iconNames:
|
|
17246
|
-
renderedIcons:
|
|
17247
|
-
sprites:
|
|
17248
|
-
oneX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
17249
|
-
twoX: spriteDimensionsSchema.extend({ pixelRatio:
|
|
18076
|
+
format: z10.enum(["tileflow-icon-package-v1", "tileflow-icon-package-v2"]),
|
|
18077
|
+
iconNames: z10.array(tileflowIconIdSchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
18078
|
+
renderedIcons: z10.array(tileflowRenderedIconManifestEntrySchema).min(1).max(tileflowIconPackageLimits.maxIconCount),
|
|
18079
|
+
sprites: z10.object({
|
|
18080
|
+
oneX: spriteDimensionsSchema.extend({ pixelRatio: z10.literal(1) }),
|
|
18081
|
+
twoX: spriteDimensionsSchema.extend({ pixelRatio: z10.literal(2) })
|
|
17250
18082
|
}).strict()
|
|
17251
18083
|
}).strict().superRefine((manifest, context) => {
|
|
17252
18084
|
if (manifest.renderedIcons.some(
|
|
@@ -17381,7 +18213,7 @@ function containsControlCharacter(value) {
|
|
|
17381
18213
|
}
|
|
17382
18214
|
|
|
17383
18215
|
// src/font-bundle.ts
|
|
17384
|
-
import { z as
|
|
18216
|
+
import { z as z11 } from "zod";
|
|
17385
18217
|
var tileflowFontBundleLimits = {
|
|
17386
18218
|
maxFaceCount: 16,
|
|
17387
18219
|
maxFileCount: 32,
|
|
@@ -17390,39 +18222,39 @@ var tileflowFontBundleLimits = {
|
|
|
17390
18222
|
maxManifestBytes: 64 * 1024,
|
|
17391
18223
|
maxPackageBytes: 20 * 1024 * 1024
|
|
17392
18224
|
};
|
|
17393
|
-
var sha256Schema2 =
|
|
17394
|
-
var fontFileNameSchema =
|
|
17395
|
-
var licenseFileNameSchema =
|
|
17396
|
-
var fontFamilySchema =
|
|
18225
|
+
var sha256Schema2 = z11.string().regex(/^[a-f0-9]{64}$/u);
|
|
18226
|
+
var fontFileNameSchema = z11.string().max(512).regex(/^fonts\/[a-z0-9]+(?:-[a-z0-9]+)*-[a-f0-9]{64}\.(?:otf|ttf|woff2)$/u);
|
|
18227
|
+
var licenseFileNameSchema = z11.string().max(512).regex(/^fonts\/licenses\/license-[a-f0-9]{64}\.txt$/u);
|
|
18228
|
+
var fontFamilySchema = z11.string().min(1).max(100).refine(
|
|
17397
18229
|
(value) => value === value.trim() && !/[\p{Cc}\\]/u.test(value),
|
|
17398
18230
|
"Font family must be printable, trimmed text"
|
|
17399
18231
|
);
|
|
17400
18232
|
var tileflowFontBundleContentHashSchema = sha256Schema2;
|
|
17401
|
-
var fontFileSchema =
|
|
17402
|
-
byteLength:
|
|
17403
|
-
contentType:
|
|
17404
|
-
kind:
|
|
18233
|
+
var fontFileSchema = z11.object({
|
|
18234
|
+
byteLength: z11.number().int().positive().max(tileflowFontBundleLimits.maxFontFileBytes),
|
|
18235
|
+
contentType: z11.enum(["font/otf", "font/ttf", "font/woff2"]),
|
|
18236
|
+
kind: z11.literal("font"),
|
|
17405
18237
|
name: fontFileNameSchema,
|
|
17406
18238
|
sha256: sha256Schema2
|
|
17407
18239
|
}).strict();
|
|
17408
|
-
var licenseFileSchema =
|
|
17409
|
-
byteLength:
|
|
17410
|
-
contentType:
|
|
17411
|
-
kind:
|
|
18240
|
+
var licenseFileSchema = z11.object({
|
|
18241
|
+
byteLength: z11.number().int().positive().max(tileflowFontBundleLimits.maxLicenseFileBytes),
|
|
18242
|
+
contentType: z11.literal("text/plain; charset=utf-8"),
|
|
18243
|
+
kind: z11.literal("license"),
|
|
17412
18244
|
name: licenseFileNameSchema,
|
|
17413
18245
|
sha256: sha256Schema2
|
|
17414
18246
|
}).strict();
|
|
17415
|
-
var fontFaceSchema =
|
|
18247
|
+
var fontFaceSchema = z11.object({
|
|
17416
18248
|
family: fontFamilySchema,
|
|
17417
18249
|
file: fontFileNameSchema,
|
|
17418
18250
|
licenseFile: licenseFileNameSchema,
|
|
17419
|
-
style:
|
|
17420
|
-
weight:
|
|
18251
|
+
style: z11.enum(["italic", "normal", "oblique"]),
|
|
18252
|
+
weight: z11.enum(["100", "200", "300", "400", "500", "600", "700", "800", "900"])
|
|
17421
18253
|
}).strict();
|
|
17422
|
-
var tileflowFontBundleManifestSchema =
|
|
17423
|
-
files:
|
|
17424
|
-
fontFaces:
|
|
17425
|
-
format:
|
|
18254
|
+
var tileflowFontBundleManifestSchema = z11.object({
|
|
18255
|
+
files: z11.array(z11.discriminatedUnion("kind", [fontFileSchema, licenseFileSchema])).min(2).max(tileflowFontBundleLimits.maxFileCount),
|
|
18256
|
+
fontFaces: z11.array(fontFaceSchema).min(1).max(tileflowFontBundleLimits.maxFaceCount),
|
|
18257
|
+
format: z11.literal("tileflow-font-bundle-v1")
|
|
17426
18258
|
}).strict().superRefine((manifest, context) => {
|
|
17427
18259
|
const sortedFiles = [...manifest.files].sort(
|
|
17428
18260
|
(left, right) => compareCodeUnits11(left.name, right.name)
|
|
@@ -17864,7 +18696,7 @@ async function requestSessionGrant(input) {
|
|
|
17864
18696
|
else throw error;
|
|
17865
18697
|
}
|
|
17866
18698
|
throwIfSessionGrantAborted(signal);
|
|
17867
|
-
if (response.status === 409 &&
|
|
18699
|
+
if (response.status === 409 && isRecord12(body) && body.code === "COMMERCIAL_SESSION_RESTART_REQUIRED" && body.ok === false && body.retryWithNewSession === true && body.sessionId === input.sessionId) {
|
|
17868
18700
|
throw new TileflowSessionRestartError();
|
|
17869
18701
|
}
|
|
17870
18702
|
if (!response.ok) {
|
|
@@ -17937,7 +18769,7 @@ function sessionGrantAbortReason(signal) {
|
|
|
17937
18769
|
return error;
|
|
17938
18770
|
}
|
|
17939
18771
|
function parseSessionGrantResponse(value, expectedSessionId) {
|
|
17940
|
-
if (!
|
|
18772
|
+
if (!isRecord12(value) || value.ok !== true || value.sessionId !== expectedSessionId) return null;
|
|
17941
18773
|
if (value.usageMode !== void 0 && value.usageMode !== "session") return null;
|
|
17942
18774
|
if (value.billingEnabled !== void 0 && value.billingEnabled !== false) return null;
|
|
17943
18775
|
if (value.disposition !== void 0 && value.disposition !== "ordinary" && value.disposition !== "unbilled_fail_open") {
|
|
@@ -17956,11 +18788,11 @@ function parseSessionGrantResponse(value, expectedSessionId) {
|
|
|
17956
18788
|
}
|
|
17957
18789
|
return value;
|
|
17958
18790
|
}
|
|
17959
|
-
function
|
|
18791
|
+
function isRecord12(value) {
|
|
17960
18792
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
17961
18793
|
}
|
|
17962
18794
|
function isPlainRuntimeRecord(value) {
|
|
17963
|
-
if (!
|
|
18795
|
+
if (!isRecord12(value)) return false;
|
|
17964
18796
|
const prototype = Object.getPrototypeOf(value);
|
|
17965
18797
|
return prototype === Object.prototype || prototype === null;
|
|
17966
18798
|
}
|
|
@@ -18391,7 +19223,7 @@ function getTileflowLocationBaseUrl() {
|
|
|
18391
19223
|
}
|
|
18392
19224
|
|
|
18393
19225
|
// src/icon-lock.ts
|
|
18394
|
-
import { z as
|
|
19226
|
+
import { z as z12 } from "zod";
|
|
18395
19227
|
|
|
18396
19228
|
// src/icon-json.ts
|
|
18397
19229
|
function parseTileflowIconJson(text, maximumBytes) {
|
|
@@ -18498,15 +19330,15 @@ function parseTileflowIconJson(text, maximumBytes) {
|
|
|
18498
19330
|
// src/icon-lock.ts
|
|
18499
19331
|
var tileflowIconsLockfileName = "tileflow.icons.lock.json";
|
|
18500
19332
|
var tileflowIconsLockfileMaximumBytes = 4 * 1024 * 1024;
|
|
18501
|
-
var tileflowIconSetPinSchema =
|
|
19333
|
+
var tileflowIconSetPinSchema = z12.object({
|
|
18502
19334
|
teamId: tileflowIconSetTeamIdSchema,
|
|
18503
19335
|
setId: tileflowIconSetIdSchema,
|
|
18504
19336
|
versionId: tileflowIconSetVersionIdSchema,
|
|
18505
|
-
version:
|
|
19337
|
+
version: z12.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
18506
19338
|
packageId: tileflowIconSetPackageIdSchema,
|
|
18507
19339
|
contentHash: tileflowIconPackageContentHashSchema,
|
|
18508
19340
|
manifest: tileflowIconPackageManifestSchema,
|
|
18509
|
-
spriteUrl:
|
|
19341
|
+
spriteUrl: z12.string().max(2048)
|
|
18510
19342
|
}).strict().superRefine((pin, context) => {
|
|
18511
19343
|
try {
|
|
18512
19344
|
const url = new URL(pin.spriteUrl);
|
|
@@ -18521,9 +19353,9 @@ var tileflowIconSetPinSchema = z11.object({
|
|
|
18521
19353
|
});
|
|
18522
19354
|
}
|
|
18523
19355
|
});
|
|
18524
|
-
var tileflowIconsLockfileSchema =
|
|
18525
|
-
lockfileVersion:
|
|
18526
|
-
sets:
|
|
19356
|
+
var tileflowIconsLockfileSchema = z12.object({
|
|
19357
|
+
lockfileVersion: z12.literal(1),
|
|
19358
|
+
sets: z12.record(tileflowIconSetReferenceSchema, tileflowIconSetPinSchema)
|
|
18527
19359
|
}).strict().superRefine((lock, context) => {
|
|
18528
19360
|
const entries = Object.entries(lock.sets);
|
|
18529
19361
|
if (entries.length > tileflowIconSourceLimit) {
|
|
@@ -18577,59 +19409,59 @@ async function serializeTileflowIconsLockfile(input) {
|
|
|
18577
19409
|
}
|
|
18578
19410
|
|
|
18579
19411
|
// src/icon-composition.ts
|
|
18580
|
-
import { z as
|
|
19412
|
+
import { z as z13 } from "zod";
|
|
18581
19413
|
var tileflowIconCompositionMaximumBytes = 1024 * 1024;
|
|
18582
|
-
var idsSchema =
|
|
19414
|
+
var idsSchema = z13.array(tileflowIconIdSchema).max(tileflowIconPackageLimits.maxIconCount).refine(
|
|
18583
19415
|
(ids) => new Set(ids).size === ids.length && ids.every((id2, index) => index === 0 || compareCodeUnits11(ids[index - 1], id2) < 0),
|
|
18584
19416
|
"Icon exports must be unique and sorted by code unit"
|
|
18585
19417
|
);
|
|
18586
|
-
var localContributorSchema =
|
|
18587
|
-
var packageContributorSchema =
|
|
18588
|
-
kind:
|
|
18589
|
-
package:
|
|
19418
|
+
var localContributorSchema = z13.object({ kind: z13.literal("local"), iconIds: idsSchema }).strict();
|
|
19419
|
+
var packageContributorSchema = z13.object({
|
|
19420
|
+
kind: z13.literal("package"),
|
|
19421
|
+
package: z13.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u),
|
|
18590
19422
|
iconIds: idsSchema
|
|
18591
19423
|
}).strict();
|
|
18592
|
-
var setContributorSchema =
|
|
18593
|
-
kind:
|
|
19424
|
+
var setContributorSchema = z13.object({
|
|
19425
|
+
kind: z13.literal("icon-set"),
|
|
18594
19426
|
reference: tileflowIconSetReferenceSchema,
|
|
18595
19427
|
teamId: tileflowIconSetTeamIdSchema,
|
|
18596
19428
|
setId: tileflowIconSetIdSchema,
|
|
18597
19429
|
versionId: tileflowIconSetVersionIdSchema,
|
|
18598
|
-
version:
|
|
19430
|
+
version: z13.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
18599
19431
|
packageId: tileflowIconSetPackageIdSchema,
|
|
18600
19432
|
contentHash: tileflowIconPackageContentHashSchema,
|
|
18601
19433
|
iconIds: idsSchema.min(1)
|
|
18602
19434
|
}).strict();
|
|
18603
|
-
var tileflowRenderedIconIdentitySchema =
|
|
18604
|
-
kind:
|
|
19435
|
+
var tileflowRenderedIconIdentitySchema = z13.object({
|
|
19436
|
+
kind: z13.literal("rendered-icon"),
|
|
18605
19437
|
id: tileflowIconIdSchema,
|
|
18606
19438
|
appearance: tileflowIconAppearanceSchema.optional(),
|
|
18607
19439
|
layout: tileflowIconLayoutSchema.optional(),
|
|
18608
|
-
width:
|
|
18609
|
-
height:
|
|
18610
|
-
pixelSha256:
|
|
19440
|
+
width: z13.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
19441
|
+
height: z13.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension / 2),
|
|
19442
|
+
pixelSha256: z13.object({
|
|
18611
19443
|
oneX: tileflowIconPackageContentHashSchema,
|
|
18612
19444
|
twoX: tileflowIconPackageContentHashSchema
|
|
18613
19445
|
}).strict()
|
|
18614
19446
|
}).strict();
|
|
18615
|
-
var tileflowIconCompositionSchema =
|
|
19447
|
+
var tileflowIconCompositionSchema = z13.object({
|
|
18616
19448
|
// An explicit map keeps declaration order independent of TypeScript's literal cache.
|
|
18617
|
-
format:
|
|
19449
|
+
format: z13.enum({
|
|
18618
19450
|
"tileflow-icon-composition-v1": "tileflow-icon-composition-v1",
|
|
18619
19451
|
"tileflow-icon-composition-v2": "tileflow-icon-composition-v2"
|
|
18620
19452
|
}),
|
|
18621
|
-
compositionVersion:
|
|
19453
|
+
compositionVersion: z13.union([z13.literal(1), z13.literal(2)]),
|
|
18622
19454
|
packageHash: tileflowIconPackageContentHashSchema,
|
|
18623
|
-
contributors:
|
|
18624
|
-
|
|
19455
|
+
contributors: z13.array(
|
|
19456
|
+
z13.discriminatedUnion("kind", [
|
|
18625
19457
|
localContributorSchema,
|
|
18626
19458
|
packageContributorSchema,
|
|
18627
19459
|
setContributorSchema
|
|
18628
19460
|
])
|
|
18629
19461
|
).min(1).max(tileflowIconSourceLimit),
|
|
18630
|
-
winners:
|
|
19462
|
+
winners: z13.array(
|
|
18631
19463
|
tileflowRenderedIconIdentitySchema.omit({ kind: true }).extend({
|
|
18632
|
-
contributor:
|
|
19464
|
+
contributor: z13.number().int().min(0).max(tileflowIconSourceLimit - 1)
|
|
18633
19465
|
})
|
|
18634
19466
|
).min(1).max(tileflowIconPackageLimits.maxIconCount)
|
|
18635
19467
|
}).strict().superRefine((receipt, context) => {
|
|
@@ -18714,15 +19546,15 @@ async function hashTileflowIconComposition(input) {
|
|
|
18714
19546
|
}
|
|
18715
19547
|
|
|
18716
19548
|
// src/icon-sprite-index.ts
|
|
18717
|
-
import { z as
|
|
18718
|
-
var tileflowIconSpriteIndexEntrySchema =
|
|
19549
|
+
import { z as z14 } from "zod";
|
|
19550
|
+
var tileflowIconSpriteIndexEntrySchema = z14.object({
|
|
18719
19551
|
...tileflowIconLayoutFields,
|
|
18720
|
-
height:
|
|
18721
|
-
width:
|
|
18722
|
-
pixelRatio:
|
|
18723
|
-
x:
|
|
18724
|
-
y:
|
|
18725
|
-
sdf:
|
|
19552
|
+
height: z14.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
19553
|
+
width: z14.number().int().positive().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
19554
|
+
pixelRatio: z14.union([z14.literal(1), z14.literal(2)]),
|
|
19555
|
+
x: z14.number().int().nonnegative().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
19556
|
+
y: z14.number().int().nonnegative().max(tileflowIconPackageLimits.maxAtlasDimension),
|
|
19557
|
+
sdf: z14.literal(true).optional(),
|
|
18726
19558
|
tileflow: tileflowIconAppearanceSchema.optional()
|
|
18727
19559
|
}).strict().refine(
|
|
18728
19560
|
(entry) => entry.sdf === true === (entry.tileflow !== void 0),
|
|
@@ -18738,7 +19570,7 @@ var tileflowIconSpriteIndexEntrySchema = z13.object({
|
|
|
18738
19570
|
});
|
|
18739
19571
|
}
|
|
18740
19572
|
});
|
|
18741
|
-
var tileflowIconSpriteIndexSchema =
|
|
19573
|
+
var tileflowIconSpriteIndexSchema = z14.record(tileflowIconIdSchema, tileflowIconSpriteIndexEntrySchema).refine(
|
|
18742
19574
|
(index) => Object.keys(index).length > 0 && Object.keys(index).length <= tileflowIconPackageLimits.maxIconCount,
|
|
18743
19575
|
`A generated sprite index must contain 1 through ${tileflowIconPackageLimits.maxIconCount} icons`
|
|
18744
19576
|
);
|
|
@@ -18806,10 +19638,12 @@ export {
|
|
|
18806
19638
|
loadTileflowManifest,
|
|
18807
19639
|
maplibreOverlay,
|
|
18808
19640
|
mergeTileflowAnalytics,
|
|
19641
|
+
mixTileflowSunPresets,
|
|
18809
19642
|
nautical,
|
|
18810
19643
|
nearestTileflowBlendTheme,
|
|
18811
19644
|
normalizeTileflowCaptureId,
|
|
18812
19645
|
normalizeTileflowCaptureScene,
|
|
19646
|
+
normalizeTileflowCaptureShot,
|
|
18813
19647
|
normalizeTileflowLineBackgroundMetrics,
|
|
18814
19648
|
normalizeTileflowRuntimeCenter,
|
|
18815
19649
|
normalizeTileflowStaticImageSize,
|
|
@@ -18825,6 +19659,7 @@ export {
|
|
|
18825
19659
|
parseTileflowRuntimeManifest,
|
|
18826
19660
|
poi,
|
|
18827
19661
|
readTileflowIconLayout,
|
|
19662
|
+
readTileflowSunPreset,
|
|
18828
19663
|
refine,
|
|
18829
19664
|
refineRenderTarget,
|
|
18830
19665
|
remove,
|
|
@@ -18840,11 +19675,13 @@ export {
|
|
|
18840
19675
|
resolveTileflowIconPreviewPaint,
|
|
18841
19676
|
resolveTileflowManifestMap,
|
|
18842
19677
|
resolveTileflowMapMode,
|
|
19678
|
+
resolveTileflowRouteInks,
|
|
18843
19679
|
resolveTileflowRuntimeStyle,
|
|
18844
19680
|
resolveTileflowRuntimeTheme,
|
|
18845
19681
|
resolveTileflowRuntimeThemeBlend,
|
|
18846
19682
|
resolveTileflowRuntimeView,
|
|
18847
19683
|
resolveTileflowStaticImageUrl,
|
|
19684
|
+
resolveTileflowSun,
|
|
18848
19685
|
resolveTileflowTheme,
|
|
18849
19686
|
roads,
|
|
18850
19687
|
safeParseTileflowRuntimeManifest,
|
|
@@ -18873,11 +19710,21 @@ export {
|
|
|
18873
19710
|
tileflowCaptureSceneNameSchema,
|
|
18874
19711
|
tileflowCaptureSceneSchema,
|
|
18875
19712
|
tileflowCaptureSceneSchemaVersion,
|
|
19713
|
+
tileflowCaptureShotBlendSchema,
|
|
19714
|
+
tileflowCaptureShotFrameCount,
|
|
19715
|
+
tileflowCaptureShotFrames,
|
|
19716
|
+
tileflowCaptureShotKeyframeSchema,
|
|
19717
|
+
tileflowCaptureShotLimits,
|
|
19718
|
+
tileflowCaptureShotNameSchema,
|
|
19719
|
+
tileflowCaptureShotSchema,
|
|
19720
|
+
tileflowCaptureShotSchemaVersion,
|
|
18876
19721
|
tileflowCaptureTargetSchema,
|
|
18877
19722
|
tileflowCaptureViewportSchema,
|
|
18878
19723
|
tileflowCompilationPhases,
|
|
18879
19724
|
tileflowCompilationPlannerStages,
|
|
18880
19725
|
tileflowCompilationReportSchemaVersion,
|
|
19726
|
+
tileflowDefaultRouteInks,
|
|
19727
|
+
tileflowDefaultSunPreset,
|
|
18881
19728
|
tileflowFontBundleContentHashSchema,
|
|
18882
19729
|
tileflowFontBundleLimits,
|
|
18883
19730
|
tileflowFontBundleManifestSchema,
|
|
@@ -18935,12 +19782,18 @@ export {
|
|
|
18935
19782
|
tileflowRenderedIconIdentitySchema,
|
|
18936
19783
|
tileflowRenderedIconManifestEntrySchema,
|
|
18937
19784
|
tileflowRoadClasses,
|
|
19785
|
+
tileflowRouteMetadataKey,
|
|
19786
|
+
tileflowRouteTokens,
|
|
18938
19787
|
tileflowRuntimeManifestLimits,
|
|
18939
19788
|
tileflowRuntimeManifestSchema,
|
|
18940
19789
|
tileflowRuntimeManifestVersion,
|
|
18941
19790
|
tileflowSemanticDiffSchemaVersion,
|
|
18942
19791
|
tileflowStyleFontFaceLimits,
|
|
18943
19792
|
tileflowStyleFontFacesMetadataKey,
|
|
19793
|
+
tileflowStyleSunPreset,
|
|
19794
|
+
tileflowSunDirection,
|
|
19795
|
+
tileflowSunMetadataKey,
|
|
19796
|
+
tileflowSunPosition,
|
|
18944
19797
|
tileflowThemeBlendLimits,
|
|
18945
19798
|
tileflowThemeLimits,
|
|
18946
19799
|
tileflowThemeNameSchema,
|