@emuanalytics/flow-rdf-core 4.1.6 → 4.1.8

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.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Annotation, M as MapStyleSpecification, S as StateStore, a as MapDataSource, b as MapLayer, F as FlowContextOptions, c as FlowContext } from './shared/flow-rdf-core.dcf0da97.mjs';
2
- export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, _ as FeatureStreamOptions, s as FillExtrusionLayerStyleBuilder, q as FillLayerStyleBuilder, d as FlowCoreError, h as FlowCoreExpressionCustomFunction, i as FlowCoreExpressionCustomFunctionSignature, j as FlowCoreExpressionCustomFunctions, e as FlowCoreExpressionError, a0 as FlowCoreMap, o as FlowEngineEndpoint, f as FlowMapError, H as HeatmapLayerStyleBuilder, u as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, T as MapAnimationOptions, U as MapCenterOptions, K as MapDataSourceOptions, N as MapDataSourceSpecification, J as MapDataSourceType, a3 as MapEvent, a2 as MapEventType, a1 as MapEventTypes, V as MapFeature, W as MapFeatureIdentifier, Z as MapFeatureStream, O as MapGeojsonData, E as MapLayerExpression, z as MapLayerOptions, I as MapLayerPropertyMetadataIndex, G as MapLayerSpecification, w as MapLayerStyleBuilder, p as MapLayerType, a6 as MapLoadingEvent, a4 as MapMouseEvent, $ as MapOptions, X as MapPaddingOptions, aa as MapPopup, a9 as MapPopupOptions, a8 as MapPopupTemplateFn, g as MapRegistry, a5 as MapSourceEvent, Y as MapSourceIdentifier, a7 as MapStyleChangeEvent, P as ParserExpression, k as ParserExpressionWithIndex, l as ParserFunctionExpression, m as ParserIndex, n as ParserProgram, aq as Path, ar as PathValue, ab as Query, ag as QueryAttribute, al as QueryDefinition, an as QueryDefinitionFn, ai as QueryExtraParams, am as QueryOptions, aj as QueryOrderClause, Q as QueryRegistry, af as QueryResultFormat, ao as QueryResultTransformFn, ak as QuerySampleOptions, ah as QueryWhereClauses, t as RasterLayerStyleBuilder, R as ReactiveExpression, au as SerializationFormat, at as StoreAnnotations, as as StoreConstructor, x as StyleExpression, r as SymbolLayerStyleBuilder, y as expr, v as layerStyle, ac as query, ad as queryMany, ae as queryOne, ap as traceReaction } from './shared/flow-rdf-core.dcf0da97.mjs';
1
+ import { A as Annotation, M as MapStyleSpecification, S as StateStore, a as MapDataSource, b as MapLayer, F as FlowContextOptions, c as FlowContext } from './shared/flow-rdf-core.1ee62df9.mjs';
2
+ export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, _ as FeatureStreamOptions, s as FillExtrusionLayerStyleBuilder, q as FillLayerStyleBuilder, d as FlowCoreError, h as FlowCoreExpressionCustomFunction, i as FlowCoreExpressionCustomFunctionSignature, j as FlowCoreExpressionCustomFunctions, e as FlowCoreExpressionError, a0 as FlowCoreMap, o as FlowEngineEndpoint, f as FlowMapError, H as HeatmapLayerStyleBuilder, u as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, T as MapAnimationOptions, U as MapCenterOptions, K as MapDataSourceOptions, N as MapDataSourceSpecification, J as MapDataSourceType, a3 as MapEvent, a2 as MapEventType, a1 as MapEventTypes, V as MapFeature, W as MapFeatureIdentifier, Z as MapFeatureStream, O as MapGeojsonData, E as MapLayerExpression, z as MapLayerOptions, I as MapLayerPropertyMetadataIndex, G as MapLayerSpecification, w as MapLayerStyleBuilder, p as MapLayerType, a6 as MapLoadingEvent, a4 as MapMouseEvent, $ as MapOptions, X as MapPaddingOptions, aa as MapPopup, a9 as MapPopupOptions, a8 as MapPopupTemplateFn, g as MapRegistry, a5 as MapSourceEvent, Y as MapSourceIdentifier, a7 as MapStyleChangeEvent, P as ParserExpression, k as ParserExpressionWithIndex, l as ParserFunctionExpression, m as ParserIndex, n as ParserProgram, aq as Path, ar as PathValue, ab as Query, ag as QueryAttribute, al as QueryDefinition, an as QueryDefinitionFn, ai as QueryExtraParams, am as QueryOptions, aj as QueryOrderClause, Q as QueryRegistry, af as QueryResultFormat, ao as QueryResultTransformFn, ak as QuerySampleOptions, ah as QueryWhereClauses, t as RasterLayerStyleBuilder, R as ReactiveExpression, au as SerializationFormat, at as StoreAnnotations, as as StoreConstructor, x as StyleExpression, r as SymbolLayerStyleBuilder, y as expr, v as layerStyle, ac as query, ad as queryMany, ae as queryOne, ap as traceReaction } from './shared/flow-rdf-core.1ee62df9.mjs';
3
3
  export { IDisposer, IObservableStream, ISubscription } from 'mobx-utils';
4
4
  export { makeAutoObservable, makeObservable } from 'mobx';
5
5
  import 'eventemitter3';
@@ -17,6 +17,7 @@ interface SyncAnnotation<T = any> extends Annotation {
17
17
  type: string;
18
18
  arg?: SyncAnnotationArg;
19
19
  }
20
+ /** @function */
20
21
  declare const serialize: PropertyDecorator & SyncAnnotation<any> & {
21
22
  raw: PropertyDecorator & SyncAnnotation<any>;
22
23
  string: PropertyDecorator & SyncAnnotation<string>;
@@ -28,15 +29,18 @@ declare const serialize: PropertyDecorator & SyncAnnotation<any> & {
28
29
  interface ReactiveAnnotation extends Annotation {
29
30
  mobxAnnotation: any;
30
31
  }
32
+ /** @function */
31
33
  declare const observable: PropertyDecorator & ReactiveAnnotation & {
32
34
  deep: PropertyDecorator & ReactiveAnnotation;
33
35
  ref: PropertyDecorator & ReactiveAnnotation;
34
36
  struct: PropertyDecorator & ReactiveAnnotation;
35
37
  shallow: PropertyDecorator & ReactiveAnnotation;
36
38
  };
39
+ /** @function */
37
40
  declare const computed: PropertyDecorator & ReactiveAnnotation & {
38
41
  struct: PropertyDecorator & ReactiveAnnotation;
39
42
  };
43
+ /** @function */
40
44
  declare const action: PropertyDecorator & ReactiveAnnotation;
41
45
 
42
46
  interface MapStyleOptions {
@@ -92,8 +96,11 @@ declare class FlowRdfCoreGlobals {
92
96
  declare function isolateGlobalState(): void;
93
97
  declare function getGlobalState(): FlowRdfCoreGlobals;
94
98
 
99
+ /** @function */
95
100
  declare const initializeContext: <TState extends StateStore = StateStore>(options: FlowContextOptions<TState>) => FlowContext<TState>;
101
+ /** @function */
96
102
  declare const uninitializeContext: (contextId?: string) => void;
103
+ /** @function */
97
104
  declare const getContext: <TState extends StateStore = StateStore>(id?: string) => Promise<FlowContext<TState>>;
98
105
 
99
106
  export { ContextRegistry, FlowContext, FlowContextOptions, FlowRdfCoreGlobals, MapDataSource, MapLayer, MapStyle, type MapStyleOptions, MapStyleSpecification, StateStore, action, computed, getContext, getGlobalState, initializeContext, isolateGlobalState, observable, serialize, uninitializeContext };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Annotation, M as MapStyleSpecification, S as StateStore, a as MapDataSource, b as MapLayer, F as FlowContextOptions, c as FlowContext } from './shared/flow-rdf-core.dcf0da97.js';
2
- export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, _ as FeatureStreamOptions, s as FillExtrusionLayerStyleBuilder, q as FillLayerStyleBuilder, d as FlowCoreError, h as FlowCoreExpressionCustomFunction, i as FlowCoreExpressionCustomFunctionSignature, j as FlowCoreExpressionCustomFunctions, e as FlowCoreExpressionError, a0 as FlowCoreMap, o as FlowEngineEndpoint, f as FlowMapError, H as HeatmapLayerStyleBuilder, u as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, T as MapAnimationOptions, U as MapCenterOptions, K as MapDataSourceOptions, N as MapDataSourceSpecification, J as MapDataSourceType, a3 as MapEvent, a2 as MapEventType, a1 as MapEventTypes, V as MapFeature, W as MapFeatureIdentifier, Z as MapFeatureStream, O as MapGeojsonData, E as MapLayerExpression, z as MapLayerOptions, I as MapLayerPropertyMetadataIndex, G as MapLayerSpecification, w as MapLayerStyleBuilder, p as MapLayerType, a6 as MapLoadingEvent, a4 as MapMouseEvent, $ as MapOptions, X as MapPaddingOptions, aa as MapPopup, a9 as MapPopupOptions, a8 as MapPopupTemplateFn, g as MapRegistry, a5 as MapSourceEvent, Y as MapSourceIdentifier, a7 as MapStyleChangeEvent, P as ParserExpression, k as ParserExpressionWithIndex, l as ParserFunctionExpression, m as ParserIndex, n as ParserProgram, aq as Path, ar as PathValue, ab as Query, ag as QueryAttribute, al as QueryDefinition, an as QueryDefinitionFn, ai as QueryExtraParams, am as QueryOptions, aj as QueryOrderClause, Q as QueryRegistry, af as QueryResultFormat, ao as QueryResultTransformFn, ak as QuerySampleOptions, ah as QueryWhereClauses, t as RasterLayerStyleBuilder, R as ReactiveExpression, au as SerializationFormat, at as StoreAnnotations, as as StoreConstructor, x as StyleExpression, r as SymbolLayerStyleBuilder, y as expr, v as layerStyle, ac as query, ad as queryMany, ae as queryOne, ap as traceReaction } from './shared/flow-rdf-core.dcf0da97.js';
1
+ import { A as Annotation, M as MapStyleSpecification, S as StateStore, a as MapDataSource, b as MapLayer, F as FlowContextOptions, c as FlowContext } from './shared/flow-rdf-core.1ee62df9.js';
2
+ export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, _ as FeatureStreamOptions, s as FillExtrusionLayerStyleBuilder, q as FillLayerStyleBuilder, d as FlowCoreError, h as FlowCoreExpressionCustomFunction, i as FlowCoreExpressionCustomFunctionSignature, j as FlowCoreExpressionCustomFunctions, e as FlowCoreExpressionError, a0 as FlowCoreMap, o as FlowEngineEndpoint, f as FlowMapError, H as HeatmapLayerStyleBuilder, u as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, T as MapAnimationOptions, U as MapCenterOptions, K as MapDataSourceOptions, N as MapDataSourceSpecification, J as MapDataSourceType, a3 as MapEvent, a2 as MapEventType, a1 as MapEventTypes, V as MapFeature, W as MapFeatureIdentifier, Z as MapFeatureStream, O as MapGeojsonData, E as MapLayerExpression, z as MapLayerOptions, I as MapLayerPropertyMetadataIndex, G as MapLayerSpecification, w as MapLayerStyleBuilder, p as MapLayerType, a6 as MapLoadingEvent, a4 as MapMouseEvent, $ as MapOptions, X as MapPaddingOptions, aa as MapPopup, a9 as MapPopupOptions, a8 as MapPopupTemplateFn, g as MapRegistry, a5 as MapSourceEvent, Y as MapSourceIdentifier, a7 as MapStyleChangeEvent, P as ParserExpression, k as ParserExpressionWithIndex, l as ParserFunctionExpression, m as ParserIndex, n as ParserProgram, aq as Path, ar as PathValue, ab as Query, ag as QueryAttribute, al as QueryDefinition, an as QueryDefinitionFn, ai as QueryExtraParams, am as QueryOptions, aj as QueryOrderClause, Q as QueryRegistry, af as QueryResultFormat, ao as QueryResultTransformFn, ak as QuerySampleOptions, ah as QueryWhereClauses, t as RasterLayerStyleBuilder, R as ReactiveExpression, au as SerializationFormat, at as StoreAnnotations, as as StoreConstructor, x as StyleExpression, r as SymbolLayerStyleBuilder, y as expr, v as layerStyle, ac as query, ad as queryMany, ae as queryOne, ap as traceReaction } from './shared/flow-rdf-core.1ee62df9.js';
3
3
  export { IDisposer, IObservableStream, ISubscription } from 'mobx-utils';
4
4
  export { makeAutoObservable, makeObservable } from 'mobx';
5
5
  import 'eventemitter3';
@@ -17,6 +17,7 @@ interface SyncAnnotation<T = any> extends Annotation {
17
17
  type: string;
18
18
  arg?: SyncAnnotationArg;
19
19
  }
20
+ /** @function */
20
21
  declare const serialize: PropertyDecorator & SyncAnnotation<any> & {
21
22
  raw: PropertyDecorator & SyncAnnotation<any>;
22
23
  string: PropertyDecorator & SyncAnnotation<string>;
@@ -28,15 +29,18 @@ declare const serialize: PropertyDecorator & SyncAnnotation<any> & {
28
29
  interface ReactiveAnnotation extends Annotation {
29
30
  mobxAnnotation: any;
30
31
  }
32
+ /** @function */
31
33
  declare const observable: PropertyDecorator & ReactiveAnnotation & {
32
34
  deep: PropertyDecorator & ReactiveAnnotation;
33
35
  ref: PropertyDecorator & ReactiveAnnotation;
34
36
  struct: PropertyDecorator & ReactiveAnnotation;
35
37
  shallow: PropertyDecorator & ReactiveAnnotation;
36
38
  };
39
+ /** @function */
37
40
  declare const computed: PropertyDecorator & ReactiveAnnotation & {
38
41
  struct: PropertyDecorator & ReactiveAnnotation;
39
42
  };
43
+ /** @function */
40
44
  declare const action: PropertyDecorator & ReactiveAnnotation;
41
45
 
42
46
  interface MapStyleOptions {
@@ -92,8 +96,11 @@ declare class FlowRdfCoreGlobals {
92
96
  declare function isolateGlobalState(): void;
93
97
  declare function getGlobalState(): FlowRdfCoreGlobals;
94
98
 
99
+ /** @function */
95
100
  declare const initializeContext: <TState extends StateStore = StateStore>(options: FlowContextOptions<TState>) => FlowContext<TState>;
101
+ /** @function */
96
102
  declare const uninitializeContext: (contextId?: string) => void;
103
+ /** @function */
97
104
  declare const getContext: <TState extends StateStore = StateStore>(id?: string) => Promise<FlowContext<TState>>;
98
105
 
99
106
  export { ContextRegistry, FlowContext, FlowContextOptions, FlowRdfCoreGlobals, MapDataSource, MapLayer, MapStyle, type MapStyleOptions, MapStyleSpecification, StateStore, action, computed, getContext, getGlobalState, initializeContext, isolateGlobalState, observable, serialize, uninitializeContext };
@@ -1,4 +1,4 @@
1
- import colorbrewer from 'colorbrewer';
1
+ import colorbrewer from 'colorbrewer/index.es.js';
2
2
  import { isString, isArray } from '../../utils/type-checks.mjs';
3
3
  import { FlowCoreExpressionError } from '../../errors/flow-expression-error.mjs';
4
4
 
@@ -7,7 +7,9 @@ function PREFIX(operatorsParser, nextParser) {
7
7
  return parser;
8
8
  }
9
9
  function BINARY_RIGHT(operatorsParser, nextParser) {
10
- const parser = P.lazy(() => nextParser.chain((next) => P.seq(operatorsParser, P.of(next), parser).or(P.of(next))));
10
+ const parser = P.lazy(
11
+ () => nextParser.chain((next) => P.seq(operatorsParser, P.of(next), parser).or(P.of(next)))
12
+ );
11
13
  return parser;
12
14
  }
13
15
  function TERNARY_RIGHT(operatorsParser, nextParser) {
@@ -694,7 +694,7 @@ const _FlowCoreMap = class _FlowCoreMap extends EventEmitter {
694
694
  return queryBox;
695
695
  }
696
696
  async handleLoading(event) {
697
- let loading = false;
697
+ let loading;
698
698
  if (event.type === "sourcedata" && event.isSourceLoaded === false) {
699
699
  loading = true;
700
700
  } else if (event.type === "idle") {
@@ -585,7 +585,8 @@ const _AnnotationPlugin = class _AnnotationPlugin extends MapPluginBase {
585
585
  }
586
586
  isValidGeometry(feature) {
587
587
  if (isPolygon(feature)) {
588
- return feature.geometry.coordinates[0][0] !== null && feature.geometry.coordinates[0].length > 3 && turfArea(feature) > 0;
588
+ const ring = feature.geometry.coordinates[0];
589
+ return !!ring && ring[0] !== null && ring.length > 3 && turfArea(feature) > 0;
589
590
  } else if (isLineString(feature)) {
590
591
  return feature.geometry.coordinates.length > 1 && turfLength(feature) > 0;
591
592
  } else if (isPoint(feature)) {
@@ -45,12 +45,15 @@ const _DataJoin = class _DataJoin {
45
45
  this.dataExpression = null;
46
46
  }
47
47
  if (isArrayFull(this.options.parameters)) {
48
- this.parameterExpressions = this.options.parameters.reduce((accum, param) => {
49
- const expr = new ReactiveExpression(param.value.toString());
50
- expr.bindState(this.map.context.state);
51
- accum[param.name] = expr;
52
- return accum;
53
- }, {});
48
+ this.parameterExpressions = this.options.parameters.reduce(
49
+ (accum, param) => {
50
+ const expr = new ReactiveExpression(param.value.toString());
51
+ expr.bindState(this.map.context.state);
52
+ accum[param.name] = expr;
53
+ return accum;
54
+ },
55
+ {}
56
+ );
54
57
  }
55
58
  this.autorunDisposer = autorun(
56
59
  async () => {
@@ -35,7 +35,8 @@ const _MapExporter = class _MapExporter {
35
35
  switch (options.format) {
36
36
  case "png":
37
37
  exportCanvas.toBlob((blob) => {
38
- blob && saveAs(blob, fileName);
38
+ if (blob)
39
+ saveAs(blob, fileName);
39
40
  });
40
41
  break;
41
42
  case "pdf":
@@ -68,12 +69,11 @@ const _MapExporter = class _MapExporter {
68
69
  });
69
70
  }
70
71
  createMapCopy(options) {
71
- let bounds = this.map.maplibreMap.getBounds();
72
72
  let center = this.map.maplibreMap.getCenter();
73
73
  let zoom = this.map.maplibreMap.getZoom();
74
74
  const projection = this.map.maplibreMap.getProjection();
75
75
  if (isArray(options.bounds) && options.bounds.length === 4 && (projection?.type !== "globe" || zoom >= 4)) {
76
- bounds = new maplibre.LngLatBounds(
76
+ const bounds = new maplibre.LngLatBounds(
77
77
  [options.bounds[0], options.bounds[1]],
78
78
  [options.bounds[2], options.bounds[3]]
79
79
  );
@@ -1,5 +1,5 @@
1
- import { a3 as MapEvent, a0 as FlowCoreMap, Y as MapSourceIdentifier, av as MapFeatureId, aw as MapPluginBase, ax as PluginManager, a5 as MapSourceEvent, a4 as MapMouseEvent, Z as MapFeatureStream, ay as PartialBy, T as MapAnimationOptions, a7 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, a9 as MapPopupOptions, aa as MapPopup, W as MapFeatureIdentifier } from '../../../shared/flow-rdf-core.dcf0da97.mjs';
2
- export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.dcf0da97.mjs';
1
+ import { a3 as MapEvent, a0 as FlowCoreMap, Y as MapSourceIdentifier, av as MapFeatureId, aw as MapPluginBase, ax as PluginManager, a5 as MapSourceEvent, a4 as MapMouseEvent, Z as MapFeatureStream, ay as PartialBy, T as MapAnimationOptions, a7 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, a9 as MapPopupOptions, aa as MapPopup, W as MapFeatureIdentifier } from '../../../shared/flow-rdf-core.1ee62df9.mjs';
2
+ export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.1ee62df9.mjs';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.mjs';
4
4
  import 'eventemitter3';
5
5
  import 'lit-html';
@@ -1,5 +1,5 @@
1
- import { a3 as MapEvent, a0 as FlowCoreMap, Y as MapSourceIdentifier, av as MapFeatureId, aw as MapPluginBase, ax as PluginManager, a5 as MapSourceEvent, a4 as MapMouseEvent, Z as MapFeatureStream, ay as PartialBy, T as MapAnimationOptions, a7 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, a9 as MapPopupOptions, aa as MapPopup, W as MapFeatureIdentifier } from '../../../shared/flow-rdf-core.dcf0da97.js';
2
- export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.dcf0da97.js';
1
+ import { a3 as MapEvent, a0 as FlowCoreMap, Y as MapSourceIdentifier, av as MapFeatureId, aw as MapPluginBase, ax as PluginManager, a5 as MapSourceEvent, a4 as MapMouseEvent, Z as MapFeatureStream, ay as PartialBy, T as MapAnimationOptions, a7 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, a9 as MapPopupOptions, aa as MapPopup, W as MapFeatureIdentifier } from '../../../shared/flow-rdf-core.1ee62df9.js';
2
+ export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.1ee62df9.js';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.js';
4
4
  import 'eventemitter3';
5
5
  import 'lit-html';
@@ -60,7 +60,7 @@ class MapFeatureStream {
60
60
  *
61
61
  */
62
62
  get featureData() {
63
- this._sourceLoadCount;
63
+ void this._sourceLoadCount;
64
64
  const featureData = this.queryFeatureData(this._options.featureIds);
65
65
  return featureData;
66
66
  }
@@ -137,10 +137,13 @@ class MapFeatureStream {
137
137
  });
138
138
  const ids = /* @__PURE__ */ new Set();
139
139
  features = features.filter((feature) => ids.has(feature.id) ? false : ids.add(feature.id) && true);
140
- const featureData = features.reduce((accum, f) => {
141
- accum[f.id] = this.featureFromMaplibreFeature(f);
142
- return accum;
143
- }, {});
140
+ const featureData = features.reduce(
141
+ (accum, f) => {
142
+ accum[f.id] = this.featureFromMaplibreFeature(f);
143
+ return accum;
144
+ },
145
+ {}
146
+ );
144
147
  return featureData;
145
148
  }
146
149
  resume() {
@@ -53,8 +53,8 @@ const _MapLayer = class _MapLayer {
53
53
  }
54
54
  }
55
55
  get layerSpecification() {
56
- this._options.above;
57
- this._options.below;
56
+ void this._options.above;
57
+ void this._options.below;
58
58
  const layer = {
59
59
  id: this._options.id,
60
60
  type: this._options.type,
@@ -149,7 +149,7 @@ const _MapStyle = class _MapStyle {
149
149
  return this._layerOrder.map((layerId) => this._layers[layerId]).filter((layer) => filter ? filter(layer) : true);
150
150
  }
151
151
  layerInsertionPoint(layer, spec) {
152
- let insertionIndex = -1;
152
+ let insertionIndex;
153
153
  if (layer.above) {
154
154
  insertionIndex = spec.layers.findIndex((l) => l.id === layer.above);
155
155
  if (insertionIndex >= 0)
@@ -242,8 +242,9 @@ class StateStore {
242
242
  bindElementProp(el, prop, path, options) {
243
243
  const fromState = options?.fromState ?? ((v) => v);
244
244
  return this.toStream(path, true).subscribe((value) => {
245
- if (value !== el[prop]) {
246
- el[prop] = fromState(value);
245
+ const propValue = fromState(value);
246
+ if (propValue !== el[prop]) {
247
+ el[prop] = propValue;
247
248
  }
248
249
  });
249
250
  }
@@ -423,29 +424,32 @@ class StateStore {
423
424
  */
424
425
  serialize(format = "raw", scope) {
425
426
  const annotations = this.serializationAnnotations;
426
- const serializedProps = Object.keys(annotations).reduce((accum, prop) => {
427
- const annotationArg = annotations[prop].arg;
428
- let annotationScopes = [];
429
- let persistedName;
430
- if (isStringFull(annotationArg)) {
431
- annotationScopes = [annotationArg];
432
- } else if (isArrayFull(annotationArg)) {
433
- annotationScopes = annotationArg;
434
- } else if (isPlainObject(annotationArg)) {
435
- annotationScopes = ensureArray(annotationArg?.scope ?? []);
436
- persistedName = annotationArg?.name;
437
- }
438
- const annotationType = annotations[prop].type;
439
- if (scope && annotationType !== "state" && !annotationScopes.includes(scope)) {
427
+ const serializedProps = Object.keys(annotations).reduce(
428
+ (accum, prop) => {
429
+ const annotationArg = annotations[prop].arg;
430
+ let annotationScopes = [];
431
+ let persistedName;
432
+ if (isStringFull(annotationArg)) {
433
+ annotationScopes = [annotationArg];
434
+ } else if (isArrayFull(annotationArg)) {
435
+ annotationScopes = annotationArg;
436
+ } else if (isPlainObject(annotationArg)) {
437
+ annotationScopes = ensureArray(annotationArg?.scope ?? []);
438
+ persistedName = annotationArg?.name;
439
+ }
440
+ const annotationType = annotations[prop].type;
441
+ if (scope && annotationType !== "state" && !annotationScopes.includes(scope)) {
442
+ return accum;
443
+ }
444
+ const val = this[prop];
445
+ if (isDefined(val)) {
446
+ const serializedValue = annotations[prop].serialize(val, scope);
447
+ accum[persistedName ?? prop] = serializedValue;
448
+ }
440
449
  return accum;
441
- }
442
- const val = this[prop];
443
- if (isDefined(val)) {
444
- const serializedValue = annotations[prop].serialize(val, scope);
445
- accum[persistedName ?? prop] = serializedValue;
446
- }
447
- return accum;
448
- }, {});
450
+ },
451
+ {}
452
+ );
449
453
  switch (format) {
450
454
  case "json":
451
455
  return JSON.stringify(serializedProps);
@@ -1,3 +1,3 @@
1
- const version = "4.1.6";
1
+ const version = "4.1.8";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emuanalytics/flow-rdf-core",
3
- "version": "4.1.6",
3
+ "version": "4.1.8",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -27,49 +27,38 @@
27
27
  "styles"
28
28
  ],
29
29
  "devDependencies": {
30
- "@storybook/addon-essentials": "^7.1.1",
31
- "@storybook/addon-links": "^7.1.1",
32
- "@storybook/blocks": "^7.1.1",
33
- "@storybook/web-components": "^7.1.1",
34
- "@storybook/web-components-vite": "^7.1.1",
35
- "@types/colorbrewer": "^1.0.29",
30
+ "@storybook/addon-a11y": "^10.6.7",
31
+ "@storybook/addon-docs": "^10.6.7",
32
+ "@storybook/addon-links": "^10.6.7",
33
+ "@storybook/addon-vitest": "^10.6.7",
34
+ "@storybook/web-components-vite": "^10.6.7",
36
35
  "@types/debug": "^4.1.12",
37
36
  "@types/fs-extra": "^11.0.1",
38
37
  "@types/geojson": "^7946.0.10",
39
- "@types/gl": "^6.0.2",
40
38
  "@types/parsimmon": "^1.10.6",
41
- "@vitest/coverage-v8": "^2.1.1",
42
- "@vitest/web-worker": "^0.33.0",
43
- "changelogen": "^0.5.3",
44
- "cross-fetch": "^4.0.0",
39
+ "@vitest/browser-playwright": "^5.1.0",
40
+ "@vitest/coverage-v8": "^5.1.0",
45
41
  "cssnano": "^6.0.1",
46
- "eslint": "^8.42.0",
47
- "eslint-config-unjs": "^0.2.0",
48
- "eslint-plugin-storybook": "^0.6.13",
49
42
  "fs-extra": "^11.1.1",
50
43
  "jest-matcher-deep-close-to": "^3.0.2",
51
- "jest-webgl-canvas-mock": "^2.5.0",
52
- "jsdom": "^22.1.0",
53
- "jsdom-worker": "^0.3.0",
44
+ "jsdom": "^31.0.0",
54
45
  "lit": "^2.7.6",
55
- "msw": "^2.4.9",
46
+ "msw": "^3.0.4",
47
+ "msw-storybook-addon": "^3.0.3",
48
+ "playwright": "^1.65.0",
56
49
  "postcss-cli": "^10.1.0",
57
50
  "postcss-import": "^15.1.0",
58
- "prettier": "^2.8.8",
59
- "react": "^18.2.0",
60
- "react-dom": "^18.2.0",
61
- "storybook": "^7.1.1",
51
+ "prettier": "^3.9.10",
52
+ "storybook": "^10.6.7",
62
53
  "tsx": "^4.19.1",
63
- "typedoc": "^0.26.8",
64
- "typedoc-plugin-markdown": "^4.2.9",
65
- "typedoc-vitepress-theme": "^1.0.2",
66
- "typescript": "^5.6.3",
54
+ "typedoc": "^0.28.20",
55
+ "typedoc-plugin-markdown": "^4.14.1",
56
+ "typedoc-vitepress-theme": "^1.1.4",
57
+ "typescript": "~6.0.3",
67
58
  "unbuild": "^2.0.0",
68
- "vitest": "^2.1.1",
69
- "vitest-canvas-mock": "^0.3.3",
70
- "whatwg-fetch": "^3.6.17"
59
+ "vite": "^8.3.7",
60
+ "vitest": "^5.1.0"
71
61
  },
72
- "packageManager": "pnpm@7.33.0",
73
62
  "dependencies": {
74
63
  "@emuanalytics/flow-engine-client": "^2.3.0",
75
64
  "@emuanalytics/mapbox-gl-draw": "^1.3.2",
@@ -86,7 +75,7 @@
86
75
  "@turf/invariant": "^6.5.0",
87
76
  "@turf/length": "^6.5.0",
88
77
  "@types/file-saver": "^2.0.7",
89
- "colorbrewer": "^1.5.3",
78
+ "colorbrewer": "^1.7.0",
90
79
  "debug": "^4.3.7",
91
80
  "eventemitter3": "^5.0.1",
92
81
  "file-saver": "^2.0.5",
@@ -103,11 +92,9 @@
103
92
  "build": "pnpm run build:css && unbuild && pnpm run build:fix",
104
93
  "build:fix": "tsx scripts/fix-up-build-output.mts",
105
94
  "build:css": "postcss src/css/flow-rdf-core.css -o styles/flow-rdf-core.css --config postcss.custom-config.js",
106
- "build:docs": "typedoc",
107
- "dev": "vitest dev",
108
- "lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test",
109
- "lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
110
- "release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
95
+ "dev": "vitest watch",
96
+ "lint": "eslint --cache . && prettier -c --ignore-path ../../.gitignore --ignore-path ../../.prettierignore src test",
97
+ "lint:fix": "eslint --cache . --fix && prettier -w --ignore-path ../../.gitignore --ignore-path ../../.prettierignore src test",
111
98
  "test": "vitest run --coverage",
112
99
  "storybook": "storybook dev -p 6006",
113
100
  "build-storybook": "storybook build",
@@ -4,6 +4,21 @@ import { Client } from '@emuanalytics/flow-engine-client';
4
4
  import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
5
5
  import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
6
6
 
7
+ declare class FlowCoreError extends Error {
8
+ cause?: Error | undefined;
9
+ constructor(message: string, cause?: Error | undefined);
10
+ }
11
+
12
+ declare class FlowCoreExpressionError extends FlowCoreError {
13
+ readonly reason: 'parseError' | 'evaluationError';
14
+ readonly errors: string[];
15
+ constructor(expression: string, reason: 'parseError' | 'evaluationError', errors: string[]);
16
+ }
17
+
18
+ declare class FlowMapError extends FlowCoreError {
19
+ constructor(message: string, originalError?: Error);
20
+ }
21
+
7
22
  type Annotation = {
8
23
  annotationType: string;
9
24
  };
@@ -578,17 +593,6 @@ declare class Debugger<TState extends StateStore = StateStore> {
578
593
  private logStateValue;
579
594
  }
580
595
 
581
- declare class FlowCoreError extends Error {
582
- cause?: Error | undefined;
583
- constructor(message: string, cause?: Error | undefined);
584
- }
585
-
586
- declare class FlowCoreExpressionError extends FlowCoreError {
587
- readonly reason: 'parseError' | 'evaluationError';
588
- readonly errors: string[];
589
- constructor(expression: string, reason: 'parseError' | 'evaluationError', errors: string[]);
590
- }
591
-
592
596
  /**
593
597
  * A Flo.w RDF reactive expression - used internally to parse and evaluate {@link MapLayer}
594
598
  * style [expressions](/flow-rdf/flow-rdf-core/expression-reference/). An expression can be evaluated
@@ -1943,10 +1947,6 @@ declare class MapDataSource {
1943
1947
  /** Generates a new type by making a specified property of the original type `optional`. */
1944
1948
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
1945
1949
 
1946
- declare class FlowMapError extends FlowCoreError {
1947
- constructor(message: string, originalError?: Error);
1948
- }
1949
-
1950
1950
  type MapFeatureId = string | number;
1951
1951
  interface MapSourceIdentifier {
1952
1952
  source: string;
@@ -4,6 +4,21 @@ import { Client } from '@emuanalytics/flow-engine-client';
4
4
  import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
5
5
  import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
6
6
 
7
+ declare class FlowCoreError extends Error {
8
+ cause?: Error | undefined;
9
+ constructor(message: string, cause?: Error | undefined);
10
+ }
11
+
12
+ declare class FlowCoreExpressionError extends FlowCoreError {
13
+ readonly reason: 'parseError' | 'evaluationError';
14
+ readonly errors: string[];
15
+ constructor(expression: string, reason: 'parseError' | 'evaluationError', errors: string[]);
16
+ }
17
+
18
+ declare class FlowMapError extends FlowCoreError {
19
+ constructor(message: string, originalError?: Error);
20
+ }
21
+
7
22
  type Annotation = {
8
23
  annotationType: string;
9
24
  };
@@ -578,17 +593,6 @@ declare class Debugger<TState extends StateStore = StateStore> {
578
593
  private logStateValue;
579
594
  }
580
595
 
581
- declare class FlowCoreError extends Error {
582
- cause?: Error | undefined;
583
- constructor(message: string, cause?: Error | undefined);
584
- }
585
-
586
- declare class FlowCoreExpressionError extends FlowCoreError {
587
- readonly reason: 'parseError' | 'evaluationError';
588
- readonly errors: string[];
589
- constructor(expression: string, reason: 'parseError' | 'evaluationError', errors: string[]);
590
- }
591
-
592
596
  /**
593
597
  * A Flo.w RDF reactive expression - used internally to parse and evaluate {@link MapLayer}
594
598
  * style [expressions](/flow-rdf/flow-rdf-core/expression-reference/). An expression can be evaluated
@@ -1943,10 +1947,6 @@ declare class MapDataSource {
1943
1947
  /** Generates a new type by making a specified property of the original type `optional`. */
1944
1948
  type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
1945
1949
 
1946
- declare class FlowMapError extends FlowCoreError {
1947
- constructor(message: string, originalError?: Error);
1948
- }
1949
-
1950
1950
  type MapFeatureId = string | number;
1951
1951
  interface MapSourceIdentifier {
1952
1952
  source: string;