@mapbox/mapbox-gl-style-spec 13.23.0-beta.1 → 13.23.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/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- # 13.23.0-beta.1
1
+ # 13.23.1
2
+
3
+ ### ✨ Features and improvements
4
+
5
+ * Improve `coalesce` expressions to return a `ResolvedImage` when images are missing. ([#11371](https://github.com/mapbox/mapbox-gl-js/pull/11371))
6
+
7
+ # 13.23.0
2
8
 
3
9
  ### ✨ Features and improvements
4
10
 
package/dist/index.cjs CHANGED
@@ -101,7 +101,7 @@
101
101
  },
102
102
  projection: {
103
103
  type: "projection",
104
- doc: "The projection the map should be rendered in. Suported projections are Albers, Equal Earth, Equirectangular (WGS84), Globe, Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain and fog are not supported for projections other than mercator.",
104
+ doc: "The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",
105
105
  example: {
106
106
  name: "albers",
107
107
  center: [
@@ -8686,7 +8686,7 @@
8686
8686
 
8687
8687
  class FormattedSection {
8688
8688
  constructor(text, image, scale, fontStack, textColor) {
8689
- this.text = text;
8689
+ this.text = text.normalize ? text.normalize() : text;
8690
8690
  this.image = image;
8691
8691
  this.scale = scale;
8692
8692
  this.fontStack = fontStack;
@@ -10523,17 +10523,17 @@
10523
10523
  evaluate(ctx) {
10524
10524
  let result = null;
10525
10525
  let argCount = 0;
10526
- let requestedImageName;
10526
+ let firstImage;
10527
10527
  for (const arg of this.args) {
10528
10528
  argCount++;
10529
10529
  result = arg.evaluate(ctx);
10530
10530
  if (result && result instanceof ResolvedImage && !result.available) {
10531
- if (!requestedImageName) {
10532
- requestedImageName = result.name;
10531
+ if (!firstImage) {
10532
+ firstImage = result;
10533
10533
  }
10534
10534
  result = null;
10535
10535
  if (argCount === this.args.length) {
10536
- result = requestedImageName;
10536
+ return firstImage;
10537
10537
  }
10538
10538
  }
10539
10539
  if (result !== null)
@@ -12644,6 +12644,26 @@
12644
12644
  return result;
12645
12645
  }
12646
12646
 
12647
+ function unbundle(value) {
12648
+ if (value instanceof Number || value instanceof String || value instanceof Boolean) {
12649
+ return value.valueOf();
12650
+ } else {
12651
+ return value;
12652
+ }
12653
+ }
12654
+ function deepUnbundle(value) {
12655
+ if (Array.isArray(value)) {
12656
+ return value.map(deepUnbundle);
12657
+ } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {
12658
+ const unbundledValue = {};
12659
+ for (const key in value) {
12660
+ unbundledValue[key] = deepUnbundle(value[key]);
12661
+ }
12662
+ return unbundledValue;
12663
+ }
12664
+ return unbundle(value);
12665
+ }
12666
+
12647
12667
  function isExpressionFilter(filter) {
12648
12668
  if (filter === true || filter === false) {
12649
12669
  return true;
@@ -12735,7 +12755,7 @@ ${ JSON.stringify(filterExp, null, 2) }
12735
12755
  if (!isDynamicFilter(filter)) {
12736
12756
  return filter;
12737
12757
  }
12738
- let result = filter.slice();
12758
+ let result = deepUnbundle(filter);
12739
12759
  unionDynamicBranches(result);
12740
12760
  result = collapseDynamicBooleanExpressions(result);
12741
12761
  return result;
@@ -13664,26 +13684,6 @@ ${ JSON.stringify(filterExp, null, 2) }
13664
13684
  }
13665
13685
  }
13666
13686
 
13667
- function unbundle(value) {
13668
- if (value instanceof Number || value instanceof String || value instanceof Boolean) {
13669
- return value.valueOf();
13670
- } else {
13671
- return value;
13672
- }
13673
- }
13674
- function deepUnbundle(value) {
13675
- if (Array.isArray(value)) {
13676
- return value.map(deepUnbundle);
13677
- } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {
13678
- const unbundledValue = {};
13679
- for (const key in value) {
13680
- unbundledValue[key] = deepUnbundle(value[key]);
13681
- }
13682
- return unbundledValue;
13683
- }
13684
- return unbundle(value);
13685
- }
13686
-
13687
13687
  function validateObject(options) {
13688
13688
  const key = options.key;
13689
13689
  const object = options.value;