@mapbox/mapbox-gl-style-spec 14.0.0 → 14.1.0
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/diff.js +5 -4
- package/dist/index.cjs +567 -637
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +567 -637
- package/dist/index.es.js.map +1 -1
- package/expression/compound_expression.js +20 -12
- package/expression/definitions/index.js +47 -2
- package/expression/evaluation_context.js +4 -4
- package/expression/index.js +5 -4
- package/expression/parsing_context.js +3 -2
- package/flow-typed/sinon.js +1 -0
- package/package.json +1 -1
- package/reference/v8.json +481 -621
- package/types.js +23 -4
- package/validate/validate_property.js +5 -2
- package/validate/validate_source.js +9 -3
- package/validate/validate_terrain.js +2 -0
package/diff.js
CHANGED
|
@@ -462,7 +462,7 @@ export function diffImports(before: Array<ImportSpecification> = [], after: Arra
|
|
|
462
462
|
export default function diffStyles(before: StyleSpecification, after: StyleSpecification): Array<Command> {
|
|
463
463
|
if (!before) return [{command: operations.setStyle, args: [after]}];
|
|
464
464
|
|
|
465
|
-
let commands = [];
|
|
465
|
+
let commands: Array<Command> = [];
|
|
466
466
|
|
|
467
467
|
try {
|
|
468
468
|
// Handle changes to top-level properties
|
|
@@ -487,6 +487,10 @@ export default function diffStyles(before: StyleSpecification, after: StyleSpeci
|
|
|
487
487
|
if (!isEqual(before.glyphs, after.glyphs)) {
|
|
488
488
|
commands.push({command: operations.setGlyphs, args: [after.glyphs]});
|
|
489
489
|
}
|
|
490
|
+
// Handle changes to `imports` before other mergable top-level properties
|
|
491
|
+
if (!isEqual(before.imports, after.imports)) {
|
|
492
|
+
diffImports(before.imports, after.imports, commands);
|
|
493
|
+
}
|
|
490
494
|
if (!isEqual(before.transition, after.transition)) {
|
|
491
495
|
commands.push({command: operations.setTransition, args: [after.transition]});
|
|
492
496
|
}
|
|
@@ -550,9 +554,6 @@ export default function diffStyles(before: StyleSpecification, after: StyleSpeci
|
|
|
550
554
|
|
|
551
555
|
// Handle changes to `layers`
|
|
552
556
|
diffLayers(beforeLayers, after.layers, commands);
|
|
553
|
-
|
|
554
|
-
// Handle changes to `imports`
|
|
555
|
-
diffImports(before.imports, after.imports, commands);
|
|
556
557
|
} catch (e) {
|
|
557
558
|
// fall back to setStyle
|
|
558
559
|
console.warn('Unable to compute style diff:', e);
|