@mapbox/mapbox-gl-style-spec 13.24.0-alpha.3 → 13.24.0-alpha.6
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/bin/gl-style-composite.js +21 -0
- package/bin/{gl-style-format → gl-style-format.js} +8 -4
- package/bin/gl-style-migrate.js +21 -0
- package/bin/{gl-style-validate → gl-style-validate.js} +15 -12
- package/build/.gitkeep +0 -0
- package/deref.js +8 -7
- package/diff.js +11 -6
- package/dist/index.cjs +11 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +11 -50
- package/dist/index.es.js.map +1 -1
- package/empty.js +9 -28
- package/expression/definitions/in.js +1 -1
- package/feature_filter/index.js +1 -1
- package/flow-typed/gl-matrix.js +1 -0
- package/group_by_layout.js +8 -10
- package/package.json +9 -7
- package/style-spec.js +0 -3
- package/test.js +31 -0
- package/util/color_spaces.js +2 -2
- package/util/extend.js +1 -1
- package/util/interpolate.js +2 -2
- package/util/ref_properties.js +1 -1
- package/util/unbundle_jsonlint.js +1 -1
- package/validate/validate.js +0 -2
- package/validate_mapbox_api_supported.js +8 -6
- package/validate_style.js +14 -9
- package/validate_style.min.js +32 -47
- package/bin/gl-style-composite +0 -9
- package/bin/gl-style-migrate +0 -9
- package/declass.js +0 -42
- package/validate/latest.js +0 -11
- package/validate/validate_constants.js +0 -13
package/dist/index.es.js
CHANGED
|
@@ -10680,7 +10680,7 @@ class In {
|
|
|
10680
10680
|
evaluate(ctx) {
|
|
10681
10681
|
const needle = this.needle.evaluate(ctx);
|
|
10682
10682
|
const haystack = this.haystack.evaluate(ctx);
|
|
10683
|
-
if (
|
|
10683
|
+
if (haystack == null)
|
|
10684
10684
|
return false;
|
|
10685
10685
|
if (!isValidNativeType(needle, [
|
|
10686
10686
|
'boolean',
|
|
@@ -13613,7 +13613,7 @@ function diffStyles(before, after) {
|
|
|
13613
13613
|
const beforeLayers = [];
|
|
13614
13614
|
if (before.layers) {
|
|
13615
13615
|
before.layers.forEach(layer => {
|
|
13616
|
-
if (sourcesRemoved[layer.source]) {
|
|
13616
|
+
if (layer.source && sourcesRemoved[layer.source]) {
|
|
13617
13617
|
commands.push({
|
|
13618
13618
|
command: operations.removeLayer,
|
|
13619
13619
|
args: [layer.id]
|
|
@@ -13671,16 +13671,6 @@ class ParsingError$1 {
|
|
|
13671
13671
|
}
|
|
13672
13672
|
}
|
|
13673
13673
|
|
|
13674
|
-
function validateConstants(options) {
|
|
13675
|
-
const key = options.key;
|
|
13676
|
-
const constants = options.value;
|
|
13677
|
-
if (constants) {
|
|
13678
|
-
return [new ValidationError(key, constants, 'constants have been deprecated as of v8')];
|
|
13679
|
-
} else {
|
|
13680
|
-
return [];
|
|
13681
|
-
}
|
|
13682
|
-
}
|
|
13683
|
-
|
|
13684
13674
|
function validateObject(options) {
|
|
13685
13675
|
const key = options.key;
|
|
13686
13676
|
const object = options.value;
|
|
@@ -14636,7 +14626,6 @@ const VALIDATORS = {
|
|
|
14636
14626
|
'boolean': validateBoolean,
|
|
14637
14627
|
'number': validateNumber,
|
|
14638
14628
|
'color': validateColor,
|
|
14639
|
-
'constants': validateConstants,
|
|
14640
14629
|
'enum': validateEnum,
|
|
14641
14630
|
'filter': validateFilter,
|
|
14642
14631
|
'function': validateFunction,
|
|
@@ -14682,9 +14671,8 @@ function validateGlyphsURL (options) {
|
|
|
14682
14671
|
return errors;
|
|
14683
14672
|
}
|
|
14684
14673
|
|
|
14685
|
-
function
|
|
14686
|
-
|
|
14687
|
-
errors = errors.concat(validate({
|
|
14674
|
+
function validateStyle(style, styleSpec = v8) {
|
|
14675
|
+
const errors = validate({
|
|
14688
14676
|
key: '',
|
|
14689
14677
|
value: style,
|
|
14690
14678
|
valueSpec: styleSpec.$root,
|
|
@@ -14692,38 +14680,13 @@ function validateStyleMin(style, styleSpec = v8) {
|
|
|
14692
14680
|
style,
|
|
14693
14681
|
objectElementValidators: {
|
|
14694
14682
|
glyphs: validateGlyphsURL,
|
|
14695
|
-
'*'()
|
|
14696
|
-
return [];
|
|
14697
|
-
}
|
|
14683
|
+
'*': () => []
|
|
14698
14684
|
}
|
|
14699
|
-
})
|
|
14700
|
-
if (style.constants) {
|
|
14701
|
-
errors = errors.concat(validateConstants({
|
|
14702
|
-
key: 'constants',
|
|
14703
|
-
value: style.constants,
|
|
14704
|
-
style,
|
|
14705
|
-
styleSpec
|
|
14706
|
-
}));
|
|
14707
|
-
}
|
|
14685
|
+
});
|
|
14708
14686
|
return sortErrors(errors);
|
|
14709
14687
|
}
|
|
14710
|
-
validateStyleMin.source = wrapCleanErrors(validateSource);
|
|
14711
|
-
validateStyleMin.light = wrapCleanErrors(validateLight);
|
|
14712
|
-
validateStyleMin.terrain = wrapCleanErrors(validateTerrain);
|
|
14713
|
-
validateStyleMin.fog = wrapCleanErrors(validateFog);
|
|
14714
|
-
validateStyleMin.layer = wrapCleanErrors(validateLayer);
|
|
14715
|
-
validateStyleMin.filter = wrapCleanErrors(validateFilter);
|
|
14716
|
-
validateStyleMin.paintProperty = wrapCleanErrors(validatePaintProperty);
|
|
14717
|
-
validateStyleMin.layoutProperty = wrapCleanErrors(validateLayoutProperty);
|
|
14718
14688
|
function sortErrors(errors) {
|
|
14719
|
-
return
|
|
14720
|
-
return a.line - b.line;
|
|
14721
|
-
});
|
|
14722
|
-
}
|
|
14723
|
-
function wrapCleanErrors(inner) {
|
|
14724
|
-
return function (...args) {
|
|
14725
|
-
return sortErrors(inner.apply(this, args));
|
|
14726
|
-
};
|
|
14689
|
+
return errors.slice().sort((a, b) => a.line - b.line);
|
|
14727
14690
|
}
|
|
14728
14691
|
|
|
14729
14692
|
/* parser generated by jison 0.4.15 */
|
|
@@ -15396,14 +15359,14 @@ function readStyle(style) {
|
|
|
15396
15359
|
return style;
|
|
15397
15360
|
}
|
|
15398
15361
|
|
|
15399
|
-
function validateStyle(style, styleSpec = v8) {
|
|
15362
|
+
function validateStyle$1(style, styleSpec = v8) {
|
|
15400
15363
|
let s = style;
|
|
15401
15364
|
try {
|
|
15402
15365
|
s = readStyle(s);
|
|
15403
15366
|
} catch (e) {
|
|
15404
15367
|
return [e];
|
|
15405
15368
|
}
|
|
15406
|
-
return
|
|
15369
|
+
return validateStyle(s, styleSpec);
|
|
15407
15370
|
}
|
|
15408
15371
|
|
|
15409
15372
|
const SUPPORTED_SPEC_VERSION = 8;
|
|
@@ -15512,7 +15475,7 @@ function validateMapboxApiSupported(style) {
|
|
|
15512
15475
|
} catch (e) {
|
|
15513
15476
|
return [e];
|
|
15514
15477
|
}
|
|
15515
|
-
let errors =
|
|
15478
|
+
let errors = validateStyle(s, v8).concat(getRootErrors(s, Object.keys(v8.$root)));
|
|
15516
15479
|
if (s.sources) {
|
|
15517
15480
|
errors = errors.concat(getSourcesErrors(s.sources));
|
|
15518
15481
|
}
|
|
@@ -15540,8 +15503,6 @@ const visit = {
|
|
|
15540
15503
|
eachLayer,
|
|
15541
15504
|
eachProperty
|
|
15542
15505
|
};
|
|
15543
|
-
validateStyle.parsed = validateStyle;
|
|
15544
|
-
validateStyle.latest = validateStyle;
|
|
15545
15506
|
|
|
15546
|
-
export { Color, ParsingError$1 as ParsingError, ValidationError, composite, convertFilter$1 as convertFilter, derefLayers, diffStyles as diff, expression$1 as expression, createFilter as featureFilter, format, styleFunction as function, v8 as latest, migrate, v8, validateStyle as validate, validateMapboxApiSupported, visit };
|
|
15507
|
+
export { Color, ParsingError$1 as ParsingError, ValidationError, composite, convertFilter$1 as convertFilter, derefLayers, diffStyles as diff, expression$1 as expression, createFilter as featureFilter, format, styleFunction as function, v8 as latest, migrate, v8, validateStyle$1 as validate, validateMapboxApiSupported, visit };
|
|
15547
15508
|
//# sourceMappingURL=index.es.js.map
|