@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.cjs
CHANGED
|
@@ -1647,7 +1647,7 @@
|
|
|
1647
1647
|
"supported-layer-types": [
|
|
1648
1648
|
"symbol"
|
|
1649
1649
|
],
|
|
1650
|
-
|
|
1650
|
+
experimental: true,
|
|
1651
1651
|
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."
|
|
1652
1652
|
}
|
|
1653
1653
|
};
|
|
@@ -1656,7 +1656,7 @@
|
|
|
1656
1656
|
type: "boolean",
|
|
1657
1657
|
doc: "A boolean expression that determines when this appearance should be applied.",
|
|
1658
1658
|
expression: {
|
|
1659
|
-
interpolated:
|
|
1659
|
+
interpolated: true,
|
|
1660
1660
|
parameters: [
|
|
1661
1661
|
"zoom",
|
|
1662
1662
|
"pitch",
|
|
@@ -6500,6 +6500,8 @@
|
|
|
6500
6500
|
var indoor = {
|
|
6501
6501
|
"*": {
|
|
6502
6502
|
type: "indoor_source",
|
|
6503
|
+
"private": true,
|
|
6504
|
+
experimental: true,
|
|
6503
6505
|
doc: "Specification of an indoor source - sourceId and sourceLayer required for vector source, for GeoJSON sourceLayers should be omitted."
|
|
6504
6506
|
}
|
|
6505
6507
|
};
|
|
@@ -21644,23 +21646,7 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
21644
21646
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
21645
21647
|
valueSpec: styleSpec.filter_operator
|
|
21646
21648
|
});
|
|
21647
|
-
|
|
21648
|
-
case '<':
|
|
21649
|
-
case '<=':
|
|
21650
|
-
case '>':
|
|
21651
|
-
case '>=':
|
|
21652
|
-
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
21653
|
-
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${ value[0] }"`));
|
|
21654
|
-
}
|
|
21655
|
-
/* falls through */
|
|
21656
|
-
case '==':
|
|
21657
|
-
case '!=':
|
|
21658
|
-
if (value.length !== 3) {
|
|
21659
|
-
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21660
|
-
}
|
|
21661
|
-
/* falls through */
|
|
21662
|
-
case 'in':
|
|
21663
|
-
case '!in':
|
|
21649
|
+
const validate = () => {
|
|
21664
21650
|
if (value.length >= 2) {
|
|
21665
21651
|
if (!isString(value[1])) {
|
|
21666
21652
|
errors.push(new ValidationError(`${ key }[1]`, value[1], `string expected, ${ getType(value[1]) } found`));
|
|
@@ -21678,6 +21664,30 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
21678
21664
|
errors.push(new ValidationError(`${ key }[${ i }]`, value[i], `string, number, or boolean expected, ${ getType(value[i]) } found.`));
|
|
21679
21665
|
}
|
|
21680
21666
|
}
|
|
21667
|
+
};
|
|
21668
|
+
switch (unbundle(value[0])) {
|
|
21669
|
+
case '<':
|
|
21670
|
+
case '<=':
|
|
21671
|
+
case '>':
|
|
21672
|
+
case '>=':
|
|
21673
|
+
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
21674
|
+
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${ value[0] }"`));
|
|
21675
|
+
}
|
|
21676
|
+
if (value.length !== 3) {
|
|
21677
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21678
|
+
}
|
|
21679
|
+
validate();
|
|
21680
|
+
break;
|
|
21681
|
+
case '==':
|
|
21682
|
+
case '!=':
|
|
21683
|
+
if (value.length !== 3) {
|
|
21684
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21685
|
+
}
|
|
21686
|
+
validate();
|
|
21687
|
+
break;
|
|
21688
|
+
case 'in':
|
|
21689
|
+
case '!in':
|
|
21690
|
+
validate();
|
|
21681
21691
|
break;
|
|
21682
21692
|
case 'any':
|
|
21683
21693
|
case 'all':
|
|
@@ -23879,7 +23889,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23879
23889
|
}
|
|
23880
23890
|
function getImportErrors(imports = []) {
|
|
23881
23891
|
let errors = [];
|
|
23882
|
-
let sourcesCount = 0;
|
|
23883
23892
|
const validateImports = (imports2 = []) => {
|
|
23884
23893
|
for (const importSpec of imports2) {
|
|
23885
23894
|
const style = importSpec.data;
|
|
@@ -23891,7 +23900,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23891
23900
|
errors = errors.concat(getRootErrors(style, Object.keys(v8.$root)));
|
|
23892
23901
|
if (style.sources) {
|
|
23893
23902
|
const sourcesErrors = getSourcesErrors(style.sources);
|
|
23894
|
-
sourcesCount += sourcesErrors.sourcesCount;
|
|
23895
23903
|
errors = errors.concat(sourcesErrors.errors);
|
|
23896
23904
|
}
|
|
23897
23905
|
}
|
|
@@ -23900,10 +23908,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23900
23908
|
if (imports.length !== new Set(imports.map(i => i.id)).size) {
|
|
23901
23909
|
errors.push(new ValidationError(null, null, 'Duplicate ids of imports'));
|
|
23902
23910
|
}
|
|
23903
|
-
return
|
|
23904
|
-
errors,
|
|
23905
|
-
sourcesCount
|
|
23906
|
-
};
|
|
23911
|
+
return errors;
|
|
23907
23912
|
}
|
|
23908
23913
|
function getRootErrors(style, specKeys) {
|
|
23909
23914
|
const errors = [];
|
|
@@ -23960,8 +23965,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23960
23965
|
}
|
|
23961
23966
|
if (s.imports) {
|
|
23962
23967
|
const importsErrors = getImportErrors(s.imports);
|
|
23963
|
-
|
|
23964
|
-
errors = errors.concat(importsErrors.errors);
|
|
23968
|
+
errors = errors.concat(importsErrors);
|
|
23965
23969
|
}
|
|
23966
23970
|
errors = errors.concat(getMaxSourcesErrors(sourcesCount));
|
|
23967
23971
|
return errors;
|