@mapbox/mapbox-gl-style-spec 14.16.0 → 14.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +31 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +48 -0
- package/dist/index.es.js +31 -27
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/reference/v8.json +4 -2
- package/types.ts +48 -0
- package/validate/validate_filter.ts +28 -17
- package/validate_mapbox_api_supported.ts +3 -6
package/dist/index.d.ts
CHANGED
|
@@ -441,6 +441,9 @@ type ImportSpecification = {
|
|
|
441
441
|
"color-theme"?: ColorThemeSpecification | null | undefined;
|
|
442
442
|
};
|
|
443
443
|
type IndoorSpecification = {
|
|
444
|
+
/**
|
|
445
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
446
|
+
*/
|
|
444
447
|
[_: string]: IndoorSourceSpecification;
|
|
445
448
|
};
|
|
446
449
|
type IndoorSourceSpecification = {
|
|
@@ -811,6 +814,9 @@ type FillLayerSpecification = {
|
|
|
811
814
|
"fill-tunnel-structure-color-transition"?: TransitionSpecification;
|
|
812
815
|
"fill-tunnel-structure-color-use-theme"?: PropertyValueSpecification<string>;
|
|
813
816
|
};
|
|
817
|
+
/**
|
|
818
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
819
|
+
*/
|
|
814
820
|
"appearances"?: Array<AppearanceSpecification>;
|
|
815
821
|
};
|
|
816
822
|
type LineLayerSpecification = {
|
|
@@ -899,6 +905,9 @@ type LineLayerSpecification = {
|
|
|
899
905
|
"line-occlusion-opacity"?: PropertyValueSpecification<number>;
|
|
900
906
|
"line-occlusion-opacity-transition"?: TransitionSpecification;
|
|
901
907
|
};
|
|
908
|
+
/**
|
|
909
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
910
|
+
*/
|
|
902
911
|
"appearances"?: Array<AppearanceSpecification>;
|
|
903
912
|
};
|
|
904
913
|
type SymbolLayerSpecification = {
|
|
@@ -1036,6 +1045,9 @@ type SymbolLayerSpecification = {
|
|
|
1036
1045
|
"symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>;
|
|
1037
1046
|
"symbol-z-offset-transition"?: TransitionSpecification;
|
|
1038
1047
|
};
|
|
1048
|
+
/**
|
|
1049
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1050
|
+
*/
|
|
1039
1051
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1040
1052
|
};
|
|
1041
1053
|
type CircleLayerSpecification = {
|
|
@@ -1084,6 +1096,9 @@ type CircleLayerSpecification = {
|
|
|
1084
1096
|
"circle-emissive-strength"?: PropertyValueSpecification<number>;
|
|
1085
1097
|
"circle-emissive-strength-transition"?: TransitionSpecification;
|
|
1086
1098
|
};
|
|
1099
|
+
/**
|
|
1100
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1101
|
+
*/
|
|
1087
1102
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1088
1103
|
};
|
|
1089
1104
|
type HeatmapLayerSpecification = {
|
|
@@ -1110,6 +1125,9 @@ type HeatmapLayerSpecification = {
|
|
|
1110
1125
|
"heatmap-opacity"?: PropertyValueSpecification<number>;
|
|
1111
1126
|
"heatmap-opacity-transition"?: TransitionSpecification;
|
|
1112
1127
|
};
|
|
1128
|
+
/**
|
|
1129
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1130
|
+
*/
|
|
1113
1131
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1114
1132
|
};
|
|
1115
1133
|
type FillExtrusionLayerSpecification = {
|
|
@@ -1220,6 +1238,9 @@ type FillExtrusionLayerSpecification = {
|
|
|
1220
1238
|
"fill-extrusion-line-width-transition"?: TransitionSpecification;
|
|
1221
1239
|
"fill-extrusion-cast-shadows"?: boolean;
|
|
1222
1240
|
};
|
|
1241
|
+
/**
|
|
1242
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1243
|
+
*/
|
|
1223
1244
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1224
1245
|
};
|
|
1225
1246
|
type BuildingLayerSpecification = {
|
|
@@ -1349,6 +1370,9 @@ type BuildingLayerSpecification = {
|
|
|
1349
1370
|
"building-flood-light-ground-attenuation"?: PropertyValueSpecification<number>;
|
|
1350
1371
|
"building-flood-light-ground-attenuation-transition"?: TransitionSpecification;
|
|
1351
1372
|
};
|
|
1373
|
+
/**
|
|
1374
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1375
|
+
*/
|
|
1352
1376
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1353
1377
|
};
|
|
1354
1378
|
type RasterLayerSpecification = {
|
|
@@ -1405,6 +1429,9 @@ type RasterLayerSpecification = {
|
|
|
1405
1429
|
"raster-elevation"?: PropertyValueSpecification<number>;
|
|
1406
1430
|
"raster-elevation-transition"?: TransitionSpecification;
|
|
1407
1431
|
};
|
|
1432
|
+
/**
|
|
1433
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1434
|
+
*/
|
|
1408
1435
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1409
1436
|
};
|
|
1410
1437
|
type RasterParticleLayerSpecification = {
|
|
@@ -1434,6 +1461,9 @@ type RasterParticleLayerSpecification = {
|
|
|
1434
1461
|
"raster-particle-elevation"?: PropertyValueSpecification<number>;
|
|
1435
1462
|
"raster-particle-elevation-transition"?: TransitionSpecification;
|
|
1436
1463
|
};
|
|
1464
|
+
/**
|
|
1465
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1466
|
+
*/
|
|
1437
1467
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1438
1468
|
};
|
|
1439
1469
|
type HillshadeLayerSpecification = {
|
|
@@ -1466,6 +1496,9 @@ type HillshadeLayerSpecification = {
|
|
|
1466
1496
|
"hillshade-emissive-strength"?: PropertyValueSpecification<number>;
|
|
1467
1497
|
"hillshade-emissive-strength-transition"?: TransitionSpecification;
|
|
1468
1498
|
};
|
|
1499
|
+
/**
|
|
1500
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1501
|
+
*/
|
|
1469
1502
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1470
1503
|
};
|
|
1471
1504
|
type ModelLayerSpecification = {
|
|
@@ -1536,6 +1569,9 @@ type ModelLayerSpecification = {
|
|
|
1536
1569
|
*/
|
|
1537
1570
|
"model-elevation-reference"?: "sea" | "ground" | "hd-road-markup" | ExpressionSpecification;
|
|
1538
1571
|
};
|
|
1572
|
+
/**
|
|
1573
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1574
|
+
*/
|
|
1539
1575
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1540
1576
|
};
|
|
1541
1577
|
type BackgroundLayerSpecification = {
|
|
@@ -1565,6 +1601,9 @@ type BackgroundLayerSpecification = {
|
|
|
1565
1601
|
"background-emissive-strength"?: PropertyValueSpecification<number>;
|
|
1566
1602
|
"background-emissive-strength-transition"?: TransitionSpecification;
|
|
1567
1603
|
};
|
|
1604
|
+
/**
|
|
1605
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1606
|
+
*/
|
|
1568
1607
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1569
1608
|
};
|
|
1570
1609
|
type SkyLayerSpecification = {
|
|
@@ -1601,6 +1640,9 @@ type SkyLayerSpecification = {
|
|
|
1601
1640
|
"sky-opacity"?: PropertyValueSpecification<number>;
|
|
1602
1641
|
"sky-opacity-transition"?: TransitionSpecification;
|
|
1603
1642
|
};
|
|
1643
|
+
/**
|
|
1644
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1645
|
+
*/
|
|
1604
1646
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1605
1647
|
};
|
|
1606
1648
|
type SlotLayerSpecification = {
|
|
@@ -1613,6 +1655,9 @@ type SlotLayerSpecification = {
|
|
|
1613
1655
|
"minzoom"?: never;
|
|
1614
1656
|
"maxzoom"?: never;
|
|
1615
1657
|
"filter"?: never;
|
|
1658
|
+
/**
|
|
1659
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1660
|
+
*/
|
|
1616
1661
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1617
1662
|
"layout"?: never;
|
|
1618
1663
|
"paint"?: never;
|
|
@@ -1631,6 +1676,9 @@ type ClipLayerSpecification = {
|
|
|
1631
1676
|
"clip-layer-types"?: ExpressionSpecification;
|
|
1632
1677
|
"clip-layer-scope"?: ExpressionSpecification;
|
|
1633
1678
|
};
|
|
1679
|
+
/**
|
|
1680
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1681
|
+
*/
|
|
1634
1682
|
"appearances"?: Array<AppearanceSpecification>;
|
|
1635
1683
|
"paint"?: never;
|
|
1636
1684
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -1641,7 +1641,7 @@ var layer = {
|
|
|
1641
1641
|
"supported-layer-types": [
|
|
1642
1642
|
"symbol"
|
|
1643
1643
|
],
|
|
1644
|
-
|
|
1644
|
+
experimental: true,
|
|
1645
1645
|
doc: "Conditional styling applied to symbol layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Works with appearances' are supported."
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
@@ -1650,7 +1650,7 @@ var appearance = {
|
|
|
1650
1650
|
type: "boolean",
|
|
1651
1651
|
doc: "A boolean expression that determines when this appearance should be applied.",
|
|
1652
1652
|
expression: {
|
|
1653
|
-
interpolated:
|
|
1653
|
+
interpolated: true,
|
|
1654
1654
|
parameters: [
|
|
1655
1655
|
"zoom",
|
|
1656
1656
|
"pitch",
|
|
@@ -6494,6 +6494,8 @@ var indoor_source = {
|
|
|
6494
6494
|
var indoor = {
|
|
6495
6495
|
"*": {
|
|
6496
6496
|
type: "indoor_source",
|
|
6497
|
+
"private": true,
|
|
6498
|
+
experimental: true,
|
|
6497
6499
|
doc: "Specification of an indoor source - sourceId and sourceLayer required for vector source, for GeoJSON sourceLayers should be omitted."
|
|
6498
6500
|
}
|
|
6499
6501
|
};
|
|
@@ -21638,23 +21640,7 @@ function validateNonExpressionFilter(options) {
|
|
|
21638
21640
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
21639
21641
|
valueSpec: styleSpec.filter_operator
|
|
21640
21642
|
});
|
|
21641
|
-
|
|
21642
|
-
case '<':
|
|
21643
|
-
case '<=':
|
|
21644
|
-
case '>':
|
|
21645
|
-
case '>=':
|
|
21646
|
-
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
21647
|
-
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${ value[0] }"`));
|
|
21648
|
-
}
|
|
21649
|
-
/* falls through */
|
|
21650
|
-
case '==':
|
|
21651
|
-
case '!=':
|
|
21652
|
-
if (value.length !== 3) {
|
|
21653
|
-
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21654
|
-
}
|
|
21655
|
-
/* falls through */
|
|
21656
|
-
case 'in':
|
|
21657
|
-
case '!in':
|
|
21643
|
+
const validate = () => {
|
|
21658
21644
|
if (value.length >= 2) {
|
|
21659
21645
|
if (!isString(value[1])) {
|
|
21660
21646
|
errors.push(new ValidationError(`${ key }[1]`, value[1], `string expected, ${ getType(value[1]) } found`));
|
|
@@ -21672,6 +21658,30 @@ function validateNonExpressionFilter(options) {
|
|
|
21672
21658
|
errors.push(new ValidationError(`${ key }[${ i }]`, value[i], `string, number, or boolean expected, ${ getType(value[i]) } found.`));
|
|
21673
21659
|
}
|
|
21674
21660
|
}
|
|
21661
|
+
};
|
|
21662
|
+
switch (unbundle(value[0])) {
|
|
21663
|
+
case '<':
|
|
21664
|
+
case '<=':
|
|
21665
|
+
case '>':
|
|
21666
|
+
case '>=':
|
|
21667
|
+
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
21668
|
+
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${ value[0] }"`));
|
|
21669
|
+
}
|
|
21670
|
+
if (value.length !== 3) {
|
|
21671
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21672
|
+
}
|
|
21673
|
+
validate();
|
|
21674
|
+
break;
|
|
21675
|
+
case '==':
|
|
21676
|
+
case '!=':
|
|
21677
|
+
if (value.length !== 3) {
|
|
21678
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21679
|
+
}
|
|
21680
|
+
validate();
|
|
21681
|
+
break;
|
|
21682
|
+
case 'in':
|
|
21683
|
+
case '!in':
|
|
21684
|
+
validate();
|
|
21675
21685
|
break;
|
|
21676
21686
|
case 'any':
|
|
21677
21687
|
case 'all':
|
|
@@ -23873,7 +23883,6 @@ function getSourcesErrors(sources) {
|
|
|
23873
23883
|
}
|
|
23874
23884
|
function getImportErrors(imports = []) {
|
|
23875
23885
|
let errors = [];
|
|
23876
|
-
let sourcesCount = 0;
|
|
23877
23886
|
const validateImports = (imports2 = []) => {
|
|
23878
23887
|
for (const importSpec of imports2) {
|
|
23879
23888
|
const style = importSpec.data;
|
|
@@ -23885,7 +23894,6 @@ function getImportErrors(imports = []) {
|
|
|
23885
23894
|
errors = errors.concat(getRootErrors(style, Object.keys(v8.$root)));
|
|
23886
23895
|
if (style.sources) {
|
|
23887
23896
|
const sourcesErrors = getSourcesErrors(style.sources);
|
|
23888
|
-
sourcesCount += sourcesErrors.sourcesCount;
|
|
23889
23897
|
errors = errors.concat(sourcesErrors.errors);
|
|
23890
23898
|
}
|
|
23891
23899
|
}
|
|
@@ -23894,10 +23902,7 @@ function getImportErrors(imports = []) {
|
|
|
23894
23902
|
if (imports.length !== new Set(imports.map(i => i.id)).size) {
|
|
23895
23903
|
errors.push(new ValidationError(null, null, 'Duplicate ids of imports'));
|
|
23896
23904
|
}
|
|
23897
|
-
return
|
|
23898
|
-
errors,
|
|
23899
|
-
sourcesCount
|
|
23900
|
-
};
|
|
23905
|
+
return errors;
|
|
23901
23906
|
}
|
|
23902
23907
|
function getRootErrors(style, specKeys) {
|
|
23903
23908
|
const errors = [];
|
|
@@ -23954,8 +23959,7 @@ function validateMapboxApiSupported(style, styleSpec = v8) {
|
|
|
23954
23959
|
}
|
|
23955
23960
|
if (s.imports) {
|
|
23956
23961
|
const importsErrors = getImportErrors(s.imports);
|
|
23957
|
-
|
|
23958
|
-
errors = errors.concat(importsErrors.errors);
|
|
23962
|
+
errors = errors.concat(importsErrors);
|
|
23959
23963
|
}
|
|
23960
23964
|
errors = errors.concat(getMaxSourcesErrors(sourcesCount));
|
|
23961
23965
|
return errors;
|