@mapbox/mapbox-gl-style-spec 14.16.0-beta.1 → 14.16.0-beta.2

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
@@ -2061,6 +2061,7 @@ interface GlobalProperties {
2061
2061
  accumulated?: Value;
2062
2062
  brightness?: number;
2063
2063
  worldview?: string;
2064
+ activeFloors?: Set<string>;
2064
2065
  }
2065
2066
  declare class StyleExpression {
2066
2067
  expression: Expression;
@@ -2073,6 +2074,7 @@ declare class StyleExpression {
2073
2074
  [_: string]: unknown;
2074
2075
  };
2075
2076
  configDependencies: Set<string>;
2077
+ isIndoorDependent: boolean;
2076
2078
  constructor(expression: Expression, propertySpec?: StylePropertySpecification, scope?: string, options?: ConfigOptions, iconImageUseTheme?: string);
2077
2079
  evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[], formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any;
2078
2080
  evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[], formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData, iconImageUseTheme?: string): any;
@@ -2083,6 +2085,7 @@ declare class ZoomConstantExpression<Kind extends EvaluationKind> {
2083
2085
  kind: Kind;
2084
2086
  isStateDependent: boolean;
2085
2087
  configDependencies: Set<string>;
2088
+ isIndoorDependent: boolean;
2086
2089
  _styleExpression: StyleExpression;
2087
2090
  isLightConstant: boolean | null | undefined;
2088
2091
  isLineProgressConstant: boolean | null | undefined;
@@ -2094,6 +2097,7 @@ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
2094
2097
  kind: Kind;
2095
2098
  zoomStops: Array<number>;
2096
2099
  isStateDependent: boolean;
2100
+ isIndoorDependent: boolean;
2097
2101
  isLightConstant: boolean | null | undefined;
2098
2102
  isLineProgressConstant: boolean | null | undefined;
2099
2103
  configDependencies: Set<string>;
@@ -2107,11 +2111,13 @@ declare class ZoomDependentExpression<Kind extends EvaluationKind> {
2107
2111
  type ConstantExpression = {
2108
2112
  kind: "constant";
2109
2113
  configDependencies: Set<string>;
2114
+ isIndoorDependent: boolean;
2110
2115
  readonly evaluate: <T = unknown>(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[], formattedSection?: FormattedSection, iconImageUseTheme?: string) => T;
2111
2116
  };
2112
2117
  type SourceExpression = {
2113
2118
  kind: "source";
2114
2119
  isStateDependent: boolean;
2120
+ isIndoorDependent: boolean;
2115
2121
  isLightConstant: boolean | null | undefined;
2116
2122
  isLineProgressConstant: boolean | null | undefined;
2117
2123
  configDependencies: Set<string>;
@@ -2120,6 +2126,7 @@ type SourceExpression = {
2120
2126
  type CameraExpression = {
2121
2127
  kind: "camera";
2122
2128
  isStateDependent: boolean;
2129
+ isIndoorDependent: boolean;
2123
2130
  configDependencies: Set<string>;
2124
2131
  readonly evaluate: <T = unknown>(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[]) => T;
2125
2132
  readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
@@ -2129,6 +2136,7 @@ type CameraExpression = {
2129
2136
  interface CompositeExpression {
2130
2137
  kind: "composite";
2131
2138
  isStateDependent: boolean;
2139
+ isIndoorDependent: boolean;
2132
2140
  isLightConstant: boolean | null | undefined;
2133
2141
  isLineProgressConstant: boolean | null | undefined;
2134
2142
  configDependencies: Set<string>;
package/dist/index.es.js CHANGED
@@ -5599,6 +5599,18 @@ var expression_name = {
5599
5599
  }
5600
5600
  }
5601
5601
  },
5602
+ "is-active-floor": {
5603
+ doc: "Experimental. Returns `true` if the input floor id belongs to one of the active indoor floors, `false` otherwise. In case of array of strings, returns `true` if any of the input floor ids belongs to one of the active indoor floors, `false` otherwise. Only supported in filters.",
5604
+ group: "Indoor",
5605
+ experimental: true,
5606
+ "sdk-support": {
5607
+ "basic functionality": {
5608
+ js: "3.16.0",
5609
+ android: "11.16.0",
5610
+ ios: "11.16.0"
5611
+ }
5612
+ }
5613
+ },
5602
5614
  random: {
5603
5615
  doc: "Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.",
5604
5616
  group: "Math",
@@ -16581,23 +16593,6 @@ function isStateConstant(e) {
16581
16593
  });
16582
16594
  return result;
16583
16595
  }
16584
- function getConfigDependencies(e) {
16585
- if (e instanceof Config) {
16586
- const singleConfig = /* @__PURE__ */
16587
- new Set([e.key]);
16588
- return singleConfig;
16589
- }
16590
- let result = /* @__PURE__ */
16591
- new Set();
16592
- e.eachChild(arg => {
16593
- result = /* @__PURE__ */
16594
- new Set([
16595
- ...result,
16596
- ...getConfigDependencies(arg)
16597
- ]);
16598
- });
16599
- return result;
16600
- }
16601
16596
  function isGlobalPropertyConstant(e, properties) {
16602
16597
  if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
16603
16598
  return false;
@@ -18576,6 +18571,21 @@ CompoundExpression.register(expressions, {
18576
18571
  [],
18577
18572
  ctx => ctx.globals.worldview || ''
18578
18573
  ],
18574
+ 'is-active-floor': [
18575
+ BooleanType,
18576
+ varargs(StringType),
18577
+ (ctx, args) => {
18578
+ const hasActiveFloors = ctx.globals.activeFloors && ctx.globals.activeFloors.size > 0;
18579
+ if (!hasActiveFloors) {
18580
+ return false;
18581
+ }
18582
+ const floorIds = ctx.globals.activeFloors;
18583
+ return args.some(arg => {
18584
+ const value = arg.evaluate(ctx);
18585
+ return floorIds.has(value);
18586
+ });
18587
+ }
18588
+ ],
18579
18589
  'id': [
18580
18590
  ValueType,
18581
18591
  [],
@@ -19069,6 +19079,36 @@ CompoundExpression.register(expressions, {
19069
19079
  ]
19070
19080
  });
19071
19081
 
19082
+ function getConfigDependencies(e) {
19083
+ if (e instanceof Config) {
19084
+ const singleConfig = /* @__PURE__ */
19085
+ new Set([e.key]);
19086
+ return singleConfig;
19087
+ }
19088
+ let result = /* @__PURE__ */
19089
+ new Set();
19090
+ e.eachChild(arg => {
19091
+ result = /* @__PURE__ */
19092
+ new Set([
19093
+ ...result,
19094
+ ...getConfigDependencies(arg)
19095
+ ]);
19096
+ });
19097
+ return result;
19098
+ }
19099
+ function isIndoorDependent(e) {
19100
+ if (e instanceof CompoundExpression && e.name === 'is-active-floor') {
19101
+ return true;
19102
+ }
19103
+ let result = false;
19104
+ e.eachChild(arg => {
19105
+ if (!result && isIndoorDependent(arg)) {
19106
+ result = true;
19107
+ }
19108
+ });
19109
+ return result;
19110
+ }
19111
+
19072
19112
  function success(value) {
19073
19113
  return {
19074
19114
  result: 'success',
@@ -19322,6 +19362,7 @@ class StyleExpression {
19322
19362
  this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;
19323
19363
  this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;
19324
19364
  this.configDependencies = getConfigDependencies(expression);
19365
+ this.isIndoorDependent = isIndoorDependent(expression);
19325
19366
  }
19326
19367
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
19327
19368
  this._evaluator.globals = globals;
@@ -19383,6 +19424,7 @@ class ZoomConstantExpression {
19383
19424
  this.isLineProgressConstant = isLineProgressConstant;
19384
19425
  this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
19385
19426
  this.configDependencies = getConfigDependencies(expression.expression);
19427
+ this.isIndoorDependent = isIndoorDependent(expression.expression);
19386
19428
  }
19387
19429
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {
19388
19430
  return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);
@@ -19397,6 +19439,7 @@ class ZoomDependentExpression {
19397
19439
  this.zoomStops = zoomStops;
19398
19440
  this._styleExpression = expression;
19399
19441
  this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
19442
+ this.isIndoorDependent = isIndoorDependent(expression.expression);
19400
19443
  this.isLightConstant = isLightConstant;
19401
19444
  this.isLineProgressConstant = isLineProgressConstant;
19402
19445
  this.configDependencies = getConfigDependencies(expression.expression);
@@ -19495,6 +19538,7 @@ function normalizePropertyExpression(value, specification, scope, options, iconI
19495
19538
  kind: 'constant',
19496
19539
  configDependencies: /* @__PURE__ */
19497
19540
  new Set(),
19541
+ isIndoorDependent: false,
19498
19542
  evaluate: () => constant
19499
19543
  };
19500
19544
  }