@mapbox/mapbox-gl-style-spec 14.24.1 → 14.25.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.
Files changed (57) hide show
  1. package/bin/gl-style-composite.js +9 -4
  2. package/bin/gl-style-format.js +10 -4
  3. package/bin/gl-style-migrate.js +9 -4
  4. package/bin/gl-style-validate.js +16 -15
  5. package/deref.ts +8 -6
  6. package/dist/index.cjs +7743 -9443
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +9 -11
  9. package/dist/index.es.js +7743 -9443
  10. package/dist/index.es.js.map +1 -1
  11. package/expression/compound_expression.ts +1 -1
  12. package/expression/definitions/assertion.ts +1 -1
  13. package/expression/definitions/at_interpolated.ts +2 -1
  14. package/expression/definitions/case.ts +1 -1
  15. package/expression/definitions/coalesce.ts +1 -1
  16. package/expression/definitions/coercion.ts +1 -1
  17. package/expression/definitions/distance.ts +1 -9
  18. package/expression/definitions/interpolate.ts +3 -3
  19. package/expression/definitions/literal.ts +1 -1
  20. package/expression/definitions/match.ts +1 -1
  21. package/expression/definitions/number_format.ts +8 -6
  22. package/expression/definitions/within.ts +1 -8
  23. package/expression/evaluation_context.ts +1 -10
  24. package/expression/index.ts +1 -1
  25. package/expression/values.ts +3 -4
  26. package/feature_filter/index.ts +1 -1
  27. package/function/convert.ts +1 -1
  28. package/group_by_layout.ts +8 -2
  29. package/package.json +4 -6
  30. package/read_style.ts +4 -4
  31. package/reference/v8.json +20 -7
  32. package/rollup.config.js +7 -4
  33. package/test.js +1 -1
  34. package/types/config_options.ts +7 -7
  35. package/types/lut.ts +5 -5
  36. package/types/tile_id.ts +3 -3
  37. package/types.ts +3 -1
  38. package/union-to-intersection.ts +2 -2
  39. package/util/assert.ts +3 -0
  40. package/util/color.ts +33 -18
  41. package/util/deep_equal.ts +6 -4
  42. package/util/geometry_util.ts +1 -1
  43. package/util/lerp.ts +3 -1
  44. package/util/mercator.ts +16 -0
  45. package/util/unbundle_jsonlint.ts +3 -2
  46. package/validate/validate.ts +2 -0
  47. package/validate/validate_appearance.ts +1 -1
  48. package/validate/validate_color.ts +5 -2
  49. package/validate/validate_expression.ts +16 -8
  50. package/validate/validate_function.ts +3 -2
  51. package/validate/validate_iconset.ts +1 -1
  52. package/validate/validate_import.ts +7 -0
  53. package/validate/validate_layer.ts +4 -1
  54. package/validate/validate_object.ts +20 -7
  55. package/validate/validate_option.ts +37 -0
  56. package/validate/validate_terrain.ts +1 -1
  57. package/validate_style.ts +3 -3
package/dist/index.d.ts CHANGED
@@ -1635,7 +1635,7 @@ export type ModelLayerSpecification = {
1635
1635
  /**
1636
1636
  * @experimental This property is experimental and subject to change in future versions.
1637
1637
  */
1638
- "model-ignore-line-cutout"?: boolean | ExpressionSpecification;
1638
+ "model-line-cutout-mode"?: "enabled" | "disabled" | "enabled-above-cutout" | ExpressionSpecification;
1639
1639
  };
1640
1640
  /**
1641
1641
  * @experimental This property is experimental and subject to change in future versions.
@@ -1782,6 +1782,7 @@ export type ClipLayout = ClipLayerSpecification["layout"];
1782
1782
  export type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | BuildingLayerSpecification | RasterLayerSpecification | RasterParticleLayerSpecification | HillshadeLayerSpecification | ModelLayerSpecification | BackgroundLayerSpecification | SkyLayerSpecification | SlotLayerSpecification | ClipLayerSpecification;
1783
1783
  export type LayoutSpecification = UnionToIntersection<NonNullable<LayerSpecification["layout"]>>;
1784
1784
  export type PaintSpecification = UnionToIntersection<NonNullable<LayerSpecification["paint"]>>;
1785
+ export type LayerBaseSpecification = Pick<LayerSpecification, "slot" | "minzoom" | "maxzoom" | "filter" | "appearances">;
1785
1786
  export type Layer = Pick<LayerSpecification, "id" | "type" | "source" | "source-layer" | "slot" | "filter" | "layout" | "paint" | "minzoom" | "maxzoom" | "metadata">;
1786
1787
  /**
1787
1788
  * @deprecated Use `StyleSpecification` instead.
@@ -1969,10 +1970,10 @@ type LUT = {
1969
1970
  * @private
1970
1971
  */
1971
1972
  export declare class Color {
1972
- r: number;
1973
- g: number;
1974
- b: number;
1975
- a: number;
1973
+ readonly r: number;
1974
+ readonly g: number;
1975
+ readonly b: number;
1976
+ readonly a: number;
1976
1977
  constructor(r: number, g: number, b: number, a?: number);
1977
1978
  static black: Color;
1978
1979
  static white: Color;
@@ -2252,9 +2253,6 @@ declare class EvaluationContext {
2252
2253
  scope: string | null | undefined;
2253
2254
  options: ConfigOptions | null | undefined;
2254
2255
  iconImageUseTheme: string | null | undefined;
2255
- _parseColorCache: {
2256
- [_: string]: Color | null | undefined;
2257
- };
2258
2256
  constructor(scope?: string | null, options?: ConfigOptions | null, iconImageUseTheme?: string);
2259
2257
  id(): string | number | null;
2260
2258
  geometryType(): null | string;
@@ -2482,8 +2480,8 @@ type ValidationErrors = ReadonlyArray<ValidationError$1>;
2482
2480
  *
2483
2481
  * @private
2484
2482
  * @alias validate
2485
- * @param {Object|String|Buffer} style The style to be validated. If a `String`
2486
- * or `Buffer` is provided, the returned errors will contain line numbers.
2483
+ * @param {Object|String|Uint8Array} style The style to be validated. If a `String`
2484
+ * or `Uint8Array` is provided, the returned errors will contain line numbers.
2487
2485
  * @param {Object} [styleSpec] The style specification to validate against.
2488
2486
  * If omitted, the spec version is inferred from the stylesheet.
2489
2487
  * @returns {Array<ValidationError|ParsingError>}
@@ -2492,7 +2490,7 @@ type ValidationErrors = ReadonlyArray<ValidationError$1>;
2492
2490
  * var style = fs.readFileSync('./style.json', 'utf8');
2493
2491
  * var errors = validate(style);
2494
2492
  */
2495
- declare function validateStyle(style: StyleSpecification | string | Buffer, styleSpec?: StyleReference): ValidationErrors;
2493
+ declare function validateStyle(style: StyleSpecification | string | Uint8Array, styleSpec?: StyleReference): ValidationErrors;
2496
2494
  type MapboxStyleSpecification = StyleSpecification & {
2497
2495
  visibility?: "public" | "private";
2498
2496
  protected?: boolean;