@mapbox/mapbox-gl-style-spec 14.5.2 → 14.6.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/dist/index.d.ts CHANGED
@@ -45,7 +45,7 @@ type ResolvedImageSpecification = string;
45
45
  type PromoteIdSpecification = {
46
46
  [_: string]: string;
47
47
  } | string;
48
- type FilterSpecification = [
48
+ type FilterSpecification = ExpressionSpecification | [
49
49
  "has",
50
50
  string
51
51
  ] | [
@@ -180,7 +180,7 @@ type ExpressionSpecification = [
180
180
  ...any[]
181
181
  ];
182
182
  type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
183
- type DataDrivenPropertyValueSpecification<T> = T | FunctionSpecification<T> | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification;
183
+ type DataDrivenPropertyValueSpecification<T> = T | FunctionSpecification<T> | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification | (T extends Array<infer U> ? Array<U | ExpressionSpecification> : never);
184
184
  type StyleSpecification = {
185
185
  "version": 8;
186
186
  "fragment"?: boolean;
@@ -824,6 +824,9 @@ type FillExtrusionLayerSpecification = {
824
824
  "fill-extrusion-cutoff-fade-range"?: ExpressionSpecification;
825
825
  "fill-extrusion-emissive-strength"?: PropertyValueSpecification<number>;
826
826
  "fill-extrusion-emissive-strength-transition"?: TransitionSpecification;
827
+ "fill-extrusion-line-width"?: DataDrivenPropertyValueSpecification<number>;
828
+ "fill-extrusion-line-width-transition"?: TransitionSpecification;
829
+ "fill-extrusion-line-alignment"?: "inside" | "outside" | "center";
827
830
  };
828
831
  };
829
832
  type RasterLayerSpecification = {
@@ -900,6 +903,8 @@ type RasterParticleLayerSpecification = {
900
903
  "raster-particle-fade-opacity-factor"?: PropertyValueSpecification<number>;
901
904
  "raster-particle-fade-opacity-factor-transition"?: TransitionSpecification;
902
905
  "raster-particle-reset-rate-factor"?: number;
906
+ "raster-particle-elevation"?: PropertyValueSpecification<number>;
907
+ "raster-particle-elevation-transition"?: TransitionSpecification;
903
908
  };
904
909
  };
905
910
  type HillshadeLayerSpecification = {
@@ -970,8 +975,8 @@ type ModelLayerSpecification = {
970
975
  "model-color-mix-intensity"?: DataDrivenPropertyValueSpecification<number>;
971
976
  "model-color-mix-intensity-transition"?: TransitionSpecification;
972
977
  "model-type"?: "common-3d" | "location-indicator";
973
- "model-cast-shadows"?: ExpressionSpecification;
974
- "model-receive-shadows"?: ExpressionSpecification;
978
+ "model-cast-shadows"?: boolean;
979
+ "model-receive-shadows"?: boolean;
975
980
  "model-ambient-occlusion-intensity"?: PropertyValueSpecification<number>;
976
981
  "model-ambient-occlusion-intensity-transition"?: TransitionSpecification;
977
982
  "model-emissive-strength"?: DataDrivenPropertyValueSpecification<number>;
@@ -1077,6 +1082,10 @@ type ClipLayerSpecification = {
1077
1082
  * @experimental This property is experimental and subject to change in future versions.
1078
1083
  */
1079
1084
  "clip-layer-types"?: ExpressionSpecification;
1085
+ /**
1086
+ * @experimental This property is experimental and subject to change in future versions.
1087
+ */
1088
+ "clip-layer-scope"?: ExpressionSpecification;
1080
1089
  };
1081
1090
  "paint"?: never;
1082
1091
  };
@@ -1364,7 +1373,7 @@ declare function isExpressionFilter(filter: unknown): boolean;
1364
1373
  * @param {string} layerType the type of the layer this filter will be applied to.
1365
1374
  * @returns {Function} filter-evaluating function
1366
1375
  */
1367
- declare function createFilter(filter?: FilterSpecification | ExpressionSpecification, layerType?: string): FeatureFilter;
1376
+ declare function createFilter(filter?: FilterSpecification, layerType?: string): FeatureFilter;
1368
1377
  type SerializedExpression = Array<unknown> | Array<string> | string | number | boolean | null;
1369
1378
  interface Expression {
1370
1379
  readonly type: Type;
@@ -1481,7 +1490,7 @@ declare function createExpression(expression: unknown, propertySpec?: StylePrope
1481
1490
  declare class ZoomConstantExpression<Kind extends EvaluationKind> {
1482
1491
  kind: Kind;
1483
1492
  isStateDependent: boolean;
1484
- isConfigDependent: boolean;
1493
+ configDependencies: Set<string>;
1485
1494
  _styleExpression: StyleExpression;
1486
1495
  isLightConstant: boolean | null | undefined;
1487
1496
  constructor(kind: Kind, expression: StyleExpression, isLightConstant?: boolean | null);
@@ -1493,7 +1502,7 @@ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
1493
1502
  zoomStops: Array<number>;
1494
1503
  isStateDependent: boolean;
1495
1504
  isLightConstant: boolean | null | undefined;
1496
- isConfigDependent: boolean;
1505
+ configDependencies: Set<string>;
1497
1506
  _styleExpression: StyleExpression;
1498
1507
  interpolationType: InterpolationType | null | undefined;
1499
1508
  constructor(kind: Kind, expression: StyleExpression, zoomStops: Array<number>, interpolationType?: InterpolationType, isLightConstant?: boolean | null);
@@ -1503,20 +1512,20 @@ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
1503
1512
  }
1504
1513
  type ConstantExpression = {
1505
1514
  kind: "constant";
1506
- isConfigDependent: boolean;
1515
+ configDependencies: Set<string>;
1507
1516
  readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1508
1517
  };
1509
1518
  type SourceExpression = {
1510
1519
  kind: "source";
1511
1520
  isStateDependent: boolean;
1512
1521
  isLightConstant: boolean | null | undefined;
1513
- isConfigDependent: boolean;
1522
+ configDependencies: Set<string>;
1514
1523
  readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1515
1524
  };
1516
1525
  type CameraExpression = {
1517
1526
  kind: "camera";
1518
1527
  isStateDependent: boolean;
1519
- isConfigDependent: boolean;
1528
+ configDependencies: Set<string>;
1520
1529
  readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
1521
1530
  readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1522
1531
  zoomStops: Array<number>;
@@ -1526,7 +1535,7 @@ interface CompositeExpression {
1526
1535
  kind: "composite";
1527
1536
  isStateDependent: boolean;
1528
1537
  isLightConstant: boolean | null | undefined;
1529
- isConfigDependent: boolean;
1538
+ configDependencies: Set<string>;
1530
1539
  readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
1531
1540
  readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
1532
1541
  zoomStops: Array<number>;
package/dist/index.es.js CHANGED
@@ -1440,6 +1440,25 @@ var layout_clip = {
1440
1440
  },
1441
1441
  "property-type": "data-constant",
1442
1442
  experimental: true
1443
+ },
1444
+ "clip-layer-scope": {
1445
+ type: "array",
1446
+ value: "string",
1447
+ "default": [
1448
+ ],
1449
+ doc: "Removes content from layers with the specified scope. By default all layers are affected. For example specifying `basemap` will only remove content from the Mapbox Standard style layers which have the same scope",
1450
+ "sdk-support": {
1451
+ "basic functionality": {
1452
+ js: "3.6.0",
1453
+ android: "11.7.0",
1454
+ ios: "11.7.0"
1455
+ }
1456
+ },
1457
+ expression: {
1458
+ interpolated: false
1459
+ },
1460
+ "property-type": "data-constant",
1461
+ experimental: true
1443
1462
  }
1444
1463
  };
1445
1464
  var layout_fill = {
@@ -5763,7 +5782,6 @@ var paint_line = {
5763
5782
  "default": 0,
5764
5783
  minimum: 0,
5765
5784
  maximum: 1,
5766
- experimental: true,
5767
5785
  doc: "Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.",
5768
5786
  "sdk-support": {
5769
5787
  "basic functionality": {
@@ -5844,7 +5862,7 @@ var paint_circle = {
5844
5862
  "circle-blur": {
5845
5863
  type: "number",
5846
5864
  "default": 0,
5847
- doc: "Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",
5865
+ doc: "Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. Setting a negative value renders the blur as an inner glow effect.",
5848
5866
  transition: true,
5849
5867
  "sdk-support": {
5850
5868
  "basic functionality": {
@@ -6305,11 +6323,11 @@ var paint_symbol = {
6305
6323
  "property-type": "data-driven"
6306
6324
  },
6307
6325
  "icon-occlusion-opacity": {
6308
- doc: "The opacity at which the icon will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",
6326
+ doc: "The opacity at which the icon will be drawn in case of being depth occluded. Absent value means full occlusion against terrain only.",
6309
6327
  type: "number",
6310
6328
  minimum: 0,
6311
6329
  maximum: 1,
6312
- "default": 1,
6330
+ "default": 0,
6313
6331
  transition: true,
6314
6332
  requires: [
6315
6333
  "icon-image"
@@ -6655,10 +6673,10 @@ var paint_symbol = {
6655
6673
  },
6656
6674
  "text-occlusion-opacity": {
6657
6675
  type: "number",
6658
- doc: "The opacity at which the text will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",
6676
+ doc: "The opacity at which the text will be drawn in case of being depth occluded. Absent value means full occlusion against terrain only.",
6659
6677
  minimum: 0,
6660
6678
  maximum: 1,
6661
- "default": 1,
6679
+ "default": 0,
6662
6680
  transition: true,
6663
6681
  requires: [
6664
6682
  "text-field"
@@ -8002,9 +8020,6 @@ var paint_model = {
8002
8020
  "default": true,
8003
8021
  doc: "Enable/Disable shadow casting for this layer",
8004
8022
  transition: false,
8005
- expression: {
8006
- interpolated: false
8007
- },
8008
8023
  "sdk-support": {
8009
8024
  "basic functionality": {
8010
8025
  js: "3.0.0",
@@ -8019,9 +8034,6 @@ var paint_model = {
8019
8034
  "default": true,
8020
8035
  doc: "Enable/Disable shadow receiving for this layer",
8021
8036
  transition: false,
8022
- expression: {
8023
- interpolated: false
8024
- },
8025
8037
  "sdk-support": {
8026
8038
  "basic functionality": {
8027
8039
  js: "3.0.0",
@@ -9083,6 +9095,57 @@ var v8 = {
9083
9095
  ]
9084
9096
  },
9085
9097
  "property-type": "data-constant"
9098
+ },
9099
+ "fill-extrusion-line-width": {
9100
+ type: "number",
9101
+ "default": 0,
9102
+ minimum: 0,
9103
+ transition: true,
9104
+ units: "meters",
9105
+ doc: "If a non-zero value is provided, it sets the fill-extrusion layer into wall rendering mode. The value is used to render the feature with the given width over the outlines of the geometry. Note: This property is experimental and some other fill-extrusion properties might not be supported with non-zero line width.",
9106
+ "sdk-support": {
9107
+ "basic functionality": {
9108
+ js: "3.7.0"
9109
+ },
9110
+ "data-driven styling": {
9111
+ js: "3.7.0"
9112
+ }
9113
+ },
9114
+ expression: {
9115
+ interpolated: true,
9116
+ parameters: [
9117
+ "zoom",
9118
+ "feature",
9119
+ "feature-state",
9120
+ "measure-light"
9121
+ ]
9122
+ },
9123
+ "property-type": "data-driven"
9124
+ },
9125
+ "fill-extrusion-line-alignment": {
9126
+ type: "enum",
9127
+ values: {
9128
+ inside: {
9129
+ doc: "Aligns the wall inside of the outline."
9130
+ },
9131
+ outside: {
9132
+ doc: "Aligns the wall outside of the outline."
9133
+ },
9134
+ center: {
9135
+ doc: "Aligns the wall relative to the center of the outline."
9136
+ }
9137
+ },
9138
+ "default": "center",
9139
+ doc: "Specifies the alignment for offset of the walls relative to the outlines of the geometry. For open-ended line string geometries the positioning is considered based on the ordering of the points, where inside is in clockwise order and outside is counter-clockwise. This property only has an effect if a non-zero fill-extrusion-line-width is used. Center alignment is automatically used for non-closed lines.",
9140
+ requires: [
9141
+ "fill-extrusion-line-width"
9142
+ ],
9143
+ "sdk-support": {
9144
+ "basic functionality": {
9145
+ js: "3.7.0"
9146
+ }
9147
+ },
9148
+ "property-type": "data-constant"
9086
9149
  }
9087
9150
  },
9088
9151
  paint_line: paint_line,
@@ -9216,6 +9279,27 @@ var v8 = {
9216
9279
  }
9217
9280
  },
9218
9281
  "property-type": "data-constant"
9282
+ },
9283
+ "raster-particle-elevation": {
9284
+ type: "number",
9285
+ doc: "Specifies an uniform elevation from the ground, in meters.",
9286
+ "default": 0,
9287
+ minimum: 0,
9288
+ transition: true,
9289
+ "sdk-support": {
9290
+ "basic functionality": {
9291
+ js: "3.7.0",
9292
+ android: "11.7.0",
9293
+ ios: "11.7.0"
9294
+ }
9295
+ },
9296
+ expression: {
9297
+ interpolated: true,
9298
+ parameters: [
9299
+ "zoom"
9300
+ ]
9301
+ },
9302
+ "property-type": "data-constant"
9219
9303
  }
9220
9304
  },
9221
9305
  paint_hillshade: paint_hillshade,
@@ -11301,7 +11385,7 @@ class Assertion {
11301
11385
  if (!error) {
11302
11386
  return value;
11303
11387
  } else if (i === this.args.length - 1) {
11304
- throw new RuntimeError(`Expected value to be of type ${ toString$1(this.type) }, but found ${ toString$1(typeOf(value)) } instead.`);
11388
+ throw new RuntimeError(`The expression ${ JSON.stringify(this.args[i].serialize()) } evaluated to ${ toString$1(typeOf(value)) } but was expected to be of type ${ toString$1(this.type) }.`);
11305
11389
  }
11306
11390
  }
11307
11391
  return null;
@@ -13800,15 +13884,20 @@ function isStateConstant(e) {
13800
13884
  });
13801
13885
  return result;
13802
13886
  }
13803
- function isConfigConstant(e) {
13887
+ function getConfigDependencies(e) {
13804
13888
  if (e instanceof Config) {
13805
- return false;
13889
+ const singleConfig = /* @__PURE__ */
13890
+ new Set([e.key]);
13891
+ return singleConfig;
13806
13892
  }
13807
- let result = true;
13893
+ let result = /* @__PURE__ */
13894
+ new Set();
13808
13895
  e.eachChild(arg => {
13809
- if (result && !isConfigConstant(arg)) {
13810
- result = false;
13811
- }
13896
+ result = /* @__PURE__ */
13897
+ new Set([
13898
+ ...result,
13899
+ ...getConfigDependencies(arg)
13900
+ ]);
13812
13901
  });
13813
13902
  return result;
13814
13903
  }
@@ -16236,7 +16325,7 @@ class StyleExpression {
16236
16325
  if (!this._warningHistory[e.message]) {
16237
16326
  this._warningHistory[e.message] = true;
16238
16327
  if (typeof console !== 'undefined') {
16239
- console.warn(e.message);
16328
+ console.warn(`Failed to evaluate expression "${ JSON.stringify(this.expression.serialize()) }". ${ e.message }`);
16240
16329
  }
16241
16330
  }
16242
16331
  return this._defaultValue;
@@ -16260,7 +16349,7 @@ class ZoomConstantExpression {
16260
16349
  this._styleExpression = expression;
16261
16350
  this.isLightConstant = isLightConstant;
16262
16351
  this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
16263
- this.isConfigDependent = !isConfigConstant(expression.expression);
16352
+ this.configDependencies = getConfigDependencies(expression.expression);
16264
16353
  }
16265
16354
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {
16266
16355
  return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);
@@ -16276,7 +16365,7 @@ class ZoomDependentExpression {
16276
16365
  this._styleExpression = expression;
16277
16366
  this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
16278
16367
  this.isLightConstant = isLightConstant;
16279
- this.isConfigDependent = !isConfigConstant(expression.expression);
16368
+ this.configDependencies = getConfigDependencies(expression.expression);
16280
16369
  this.interpolationType = interpolationType;
16281
16370
  }
16282
16371
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {
@@ -16366,7 +16455,8 @@ function normalizePropertyExpression(value, specification, scope, options) {
16366
16455
  }
16367
16456
  return {
16368
16457
  kind: 'constant',
16369
- isConfigDependent: false,
16458
+ configDependencies: /* @__PURE__ */
16459
+ new Set(),
16370
16460
  evaluate: () => constant
16371
16461
  };
16372
16462
  }
@@ -17195,8 +17285,7 @@ function convertInOp(property, values, negate = false) {
17195
17285
  negate
17196
17286
  ];
17197
17287
  }
17198
- return [negate ? 'all' : 'any'].concat(// @ts-expect-error - TS2769 - No overload matches this call.
17199
- values.map(v => [
17288
+ return [negate ? 'all' : 'any'].concat(values.map(v => [
17200
17289
  negate ? '!=' : '==',
17201
17290
  get,
17202
17291
  v