@mapbox/mapbox-gl-style-spec 14.16.0 → 14.17.0-beta.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 +34 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +48 -3
- package/dist/index.es.js +34 -29
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/reference/v8.json +7 -4
- package/types.ts +48 -3
- package/validate/validate_filter.ts +28 -17
- package/validate_mapbox_api_supported.ts +3 -6
package/dist/index.cjs
CHANGED
|
@@ -1541,7 +1541,6 @@
|
|
|
1541
1541
|
},
|
|
1542
1542
|
model: {
|
|
1543
1543
|
doc: "A 3D model",
|
|
1544
|
-
experimental: true,
|
|
1545
1544
|
"sdk-support": {
|
|
1546
1545
|
"basic functionality": {
|
|
1547
1546
|
js: "3.0.0",
|
|
@@ -1647,7 +1646,7 @@
|
|
|
1647
1646
|
"supported-layer-types": [
|
|
1648
1647
|
"symbol"
|
|
1649
1648
|
],
|
|
1650
|
-
|
|
1649
|
+
experimental: true,
|
|
1651
1650
|
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
1651
|
}
|
|
1653
1652
|
};
|
|
@@ -1656,7 +1655,7 @@
|
|
|
1656
1655
|
type: "boolean",
|
|
1657
1656
|
doc: "A boolean expression that determines when this appearance should be applied.",
|
|
1658
1657
|
expression: {
|
|
1659
|
-
interpolated:
|
|
1658
|
+
interpolated: true,
|
|
1660
1659
|
parameters: [
|
|
1661
1660
|
"zoom",
|
|
1662
1661
|
"pitch",
|
|
@@ -6500,6 +6499,8 @@
|
|
|
6500
6499
|
var indoor = {
|
|
6501
6500
|
"*": {
|
|
6502
6501
|
type: "indoor_source",
|
|
6502
|
+
"private": true,
|
|
6503
|
+
experimental: true,
|
|
6503
6504
|
doc: "Specification of an indoor source - sourceId and sourceLayer required for vector source, for GeoJSON sourceLayers should be omitted."
|
|
6504
6505
|
}
|
|
6505
6506
|
};
|
|
@@ -10550,9 +10551,11 @@
|
|
|
10550
10551
|
interpolated: false
|
|
10551
10552
|
},
|
|
10552
10553
|
"property-type": "data-constant",
|
|
10553
|
-
experimental: true,
|
|
10554
10554
|
"sdk-support": {
|
|
10555
10555
|
"basic functionality": {
|
|
10556
|
+
js: "3.17.0",
|
|
10557
|
+
android: "11.10.0",
|
|
10558
|
+
ios: "11.10.0"
|
|
10556
10559
|
}
|
|
10557
10560
|
}
|
|
10558
10561
|
}
|
|
@@ -21644,23 +21647,7 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
21644
21647
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
21645
21648
|
valueSpec: styleSpec.filter_operator
|
|
21646
21649
|
});
|
|
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':
|
|
21650
|
+
const validate = () => {
|
|
21664
21651
|
if (value.length >= 2) {
|
|
21665
21652
|
if (!isString(value[1])) {
|
|
21666
21653
|
errors.push(new ValidationError(`${ key }[1]`, value[1], `string expected, ${ getType(value[1]) } found`));
|
|
@@ -21678,6 +21665,30 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
21678
21665
|
errors.push(new ValidationError(`${ key }[${ i }]`, value[i], `string, number, or boolean expected, ${ getType(value[i]) } found.`));
|
|
21679
21666
|
}
|
|
21680
21667
|
}
|
|
21668
|
+
};
|
|
21669
|
+
switch (unbundle(value[0])) {
|
|
21670
|
+
case '<':
|
|
21671
|
+
case '<=':
|
|
21672
|
+
case '>':
|
|
21673
|
+
case '>=':
|
|
21674
|
+
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
21675
|
+
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${ value[0] }"`));
|
|
21676
|
+
}
|
|
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 '==':
|
|
21683
|
+
case '!=':
|
|
21684
|
+
if (value.length !== 3) {
|
|
21685
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${ value[0] }" must have 3 elements`));
|
|
21686
|
+
}
|
|
21687
|
+
validate();
|
|
21688
|
+
break;
|
|
21689
|
+
case 'in':
|
|
21690
|
+
case '!in':
|
|
21691
|
+
validate();
|
|
21681
21692
|
break;
|
|
21682
21693
|
case 'any':
|
|
21683
21694
|
case 'all':
|
|
@@ -23879,7 +23890,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23879
23890
|
}
|
|
23880
23891
|
function getImportErrors(imports = []) {
|
|
23881
23892
|
let errors = [];
|
|
23882
|
-
let sourcesCount = 0;
|
|
23883
23893
|
const validateImports = (imports2 = []) => {
|
|
23884
23894
|
for (const importSpec of imports2) {
|
|
23885
23895
|
const style = importSpec.data;
|
|
@@ -23891,7 +23901,6 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23891
23901
|
errors = errors.concat(getRootErrors(style, Object.keys(v8.$root)));
|
|
23892
23902
|
if (style.sources) {
|
|
23893
23903
|
const sourcesErrors = getSourcesErrors(style.sources);
|
|
23894
|
-
sourcesCount += sourcesErrors.sourcesCount;
|
|
23895
23904
|
errors = errors.concat(sourcesErrors.errors);
|
|
23896
23905
|
}
|
|
23897
23906
|
}
|
|
@@ -23900,10 +23909,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23900
23909
|
if (imports.length !== new Set(imports.map(i => i.id)).size) {
|
|
23901
23910
|
errors.push(new ValidationError(null, null, 'Duplicate ids of imports'));
|
|
23902
23911
|
}
|
|
23903
|
-
return
|
|
23904
|
-
errors,
|
|
23905
|
-
sourcesCount
|
|
23906
|
-
};
|
|
23912
|
+
return errors;
|
|
23907
23913
|
}
|
|
23908
23914
|
function getRootErrors(style, specKeys) {
|
|
23909
23915
|
const errors = [];
|
|
@@ -23960,8 +23966,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
23960
23966
|
}
|
|
23961
23967
|
if (s.imports) {
|
|
23962
23968
|
const importsErrors = getImportErrors(s.imports);
|
|
23963
|
-
|
|
23964
|
-
errors = errors.concat(importsErrors.errors);
|
|
23969
|
+
errors = errors.concat(importsErrors);
|
|
23965
23970
|
}
|
|
23966
23971
|
errors = errors.concat(getMaxSourcesErrors(sourcesCount));
|
|
23967
23972
|
return errors;
|