@mapbox/mapbox-gl-style-spec 14.6.0-beta.1 → 14.7.0-beta.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.
Files changed (45) hide show
  1. package/dist/index.cjs +280 -327
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +65 -29
  4. package/dist/index.es.js +280 -327
  5. package/dist/index.es.js.map +1 -1
  6. package/expression/compound_expression.ts +1 -2
  7. package/expression/definitions/assertion.ts +1 -2
  8. package/expression/definitions/at.ts +0 -1
  9. package/expression/definitions/case.ts +0 -1
  10. package/expression/definitions/coalesce.ts +1 -2
  11. package/expression/definitions/coercion.ts +1 -2
  12. package/expression/definitions/collator.ts +7 -5
  13. package/expression/definitions/distance.ts +1 -1
  14. package/expression/definitions/format.ts +4 -4
  15. package/expression/definitions/index.ts +0 -1
  16. package/expression/definitions/interpolate.ts +1 -2
  17. package/expression/definitions/length.ts +1 -2
  18. package/expression/definitions/match.ts +0 -1
  19. package/expression/definitions/number_format.ts +5 -5
  20. package/expression/definitions/step.ts +0 -1
  21. package/expression/definitions/within.ts +3 -3
  22. package/expression/expression.ts +4 -4
  23. package/expression/index.ts +3 -6
  24. package/expression/is_constant.ts +1 -0
  25. package/expression/parsing_context.ts +28 -5
  26. package/expression/values.ts +1 -2
  27. package/feature_filter/index.ts +6 -5
  28. package/group_by_layout.ts +2 -2
  29. package/package.json +1 -1
  30. package/reference/v8.json +231 -20
  31. package/rollup.config.js +1 -2
  32. package/style-spec.ts +2 -3
  33. package/types.ts +72 -40
  34. package/union-to-intersection.ts +4 -0
  35. package/util/color.ts +1 -0
  36. package/util/color_spaces.ts +0 -1
  37. package/util/deep_equal.ts +1 -1
  38. package/util/geometry_util.ts +1 -2
  39. package/validate/validate.ts +2 -3
  40. package/validate/validate_expression.ts +0 -1
  41. package/validate/validate_function.ts +1 -1
  42. package/validate/validate_property.ts +2 -3
  43. package/validate/validate_style.ts +1 -2
  44. package/validate_style.min.ts +0 -1
  45. package/visit.ts +2 -2
@@ -19,7 +19,7 @@ export default function validateFunction(options: ValidationOptions): any {
19
19
  const functionType = unbundle(options.value.type);
20
20
  let stopKeyType;
21
21
  let stopDomainValues: Partial<Record<string | number, boolean>> = {};
22
- let previousStopDomainValue: unknown | null | undefined;
22
+ let previousStopDomainValue: unknown;
23
23
  let previousStopDomainZoom;
24
24
 
25
25
  const isZoomFunction = functionType !== 'categorical' && options.value.property === undefined;
@@ -5,9 +5,9 @@ import {isFunction} from '../function/index';
5
5
  import {unbundle, deepUnbundle} from '../util/unbundle_jsonlint';
6
6
  import {supportsLightExpression, supportsPropertyExpression, supportsZoomExpression} from '../util/properties';
7
7
  import {isGlobalPropertyConstant, isFeatureConstant, isStateConstant} from '../expression/is_constant';
8
+ import {createPropertyExpression} from '../expression/index';
8
9
 
9
10
  import type {ValidationOptions} from './validate';
10
- import {createPropertyExpression} from '../expression/index';
11
11
 
12
12
  export type PropertyValidationOptions = ValidationOptions & {
13
13
  objectKey: string;
@@ -42,8 +42,7 @@ export default function validateProperty(options: PropertyValidationOptions, pro
42
42
  return [new ValidationWarning(key, value, `unknown property "${propertyKey}"`)];
43
43
  }
44
44
 
45
- // @ts-expect-error - TS2702 - 'RegExp' only refers to a type, but is being used as a namespace here.
46
- let tokenMatch: RegExp.matchResult | null | undefined;
45
+ let tokenMatch: RegExpExecArray | undefined;
47
46
  if (getType(value) === 'string' && supportsPropertyExpression(valueSpec) && !valueSpec.tokens && (tokenMatch = /^{([^}]+)}$/.exec(value))) {
48
47
  const example = `\`{ "type": "identity", "property": ${tokenMatch ? JSON.stringify(tokenMatch[1]) : '"_"'} }\``;
49
48
  return [new ValidationError(
@@ -2,8 +2,7 @@ import validate from './validate';
2
2
  import latestStyleSpec from '../reference/latest';
3
3
  import validateGlyphsURL from './validate_glyphs_url';
4
4
 
5
- import ValidationError from '../error/validation_error';
6
-
5
+ import type ValidationError from '../error/validation_error';
7
6
  import type {ValidationOptions} from './validate';
8
7
  import type {StyleSpecification} from '../types';
9
8
 
@@ -1,5 +1,4 @@
1
1
  import latestStyleSpec from './reference/latest';
2
-
3
2
  import _validateStyle from './validate/validate_style';
4
3
  import _validateSource from './validate/validate_source';
5
4
  import _validateLight from './validate/validate_light';
package/visit.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import Reference from './reference/v8.json';
2
+
2
3
  import type {StylePropertySpecification} from './style-spec';
3
4
  import type {
4
5
  StyleSpecification,
5
6
  SourceSpecification,
6
7
  LayerSpecification,
7
- PropertyValueSpecification,
8
- DataDrivenPropertyValueSpecification
8
+ PropertyValueSpecification
9
9
  } from './types';
10
10
 
11
11
  function getPropertyReference(propertyName: string): StylePropertySpecification {