@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 +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/lib/expressions/functions/from-palette.mjs +1 -1
- package/dist/lib/expressions/parser-helpers.mjs +3 -1
- package/dist/lib/map/flow-core-map.mjs +1 -1
- package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +2 -1
- package/dist/lib/map/plugins/data-join.plugin.mjs +9 -6
- package/dist/lib/map/plugins/export/map-exporter.mjs +3 -3
- package/dist/lib/map/plugins/index.d.mts +2 -2
- package/dist/lib/map/plugins/index.d.ts +2 -2
- package/dist/lib/map/support/map-feature-stream.mjs +8 -5
- package/dist/lib/map-style/map-layer.mjs +2 -2
- package/dist/lib/map-style/map-style.mjs +1 -1
- package/dist/lib/state-store/state-store.mjs +28 -24
- package/dist/package.json.mjs +1 -1
- package/package.json +24 -37
- package/dist/shared/{flow-rdf-core.dcf0da97.d.mts → flow-rdf-core.1ee62df9.d.mts} +15 -15
- package/dist/shared/{flow-rdf-core.dcf0da97.d.ts → flow-rdf-core.1ee62df9.d.ts} +15 -15
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 };
|
|
@@ -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(
|
|
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
|
|
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
|
-
|
|
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(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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.
|
|
2
|
-
export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.
|
|
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.
|
|
2
|
-
export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.
|
|
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(
|
|
141
|
-
accum
|
|
142
|
-
|
|
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() {
|
|
@@ -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
|
|
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
|
-
|
|
246
|
-
|
|
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(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
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
|
-
|
|
443
|
-
|
|
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);
|
package/dist/package.json.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emuanalytics/flow-rdf-core",
|
|
3
|
-
"version": "4.1.
|
|
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-
|
|
31
|
-
"@storybook/addon-
|
|
32
|
-
"@storybook/
|
|
33
|
-
"@storybook/
|
|
34
|
-
"@storybook/web-components-vite": "^
|
|
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/
|
|
42
|
-
"@vitest/
|
|
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
|
-
"
|
|
52
|
-
"jsdom": "^22.1.0",
|
|
53
|
-
"jsdom-worker": "^0.3.0",
|
|
44
|
+
"jsdom": "^31.0.0",
|
|
54
45
|
"lit": "^2.7.6",
|
|
55
|
-
"msw": "^
|
|
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": "^
|
|
59
|
-
"
|
|
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.
|
|
64
|
-
"typedoc-plugin-markdown": "^4.
|
|
65
|
-
"typedoc-vitepress-theme": "^1.
|
|
66
|
-
"typescript": "
|
|
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
|
-
"
|
|
69
|
-
"vitest
|
|
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.
|
|
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
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"lint": "eslint --cache
|
|
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;
|