@emuanalytics/flow-rdf-core 4.0.4 → 4.0.6

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 (89) hide show
  1. package/README.md +1 -64
  2. package/dist/index.d.mts +36 -31
  3. package/dist/index.d.ts +36 -31
  4. package/dist/index.mjs +20 -3249
  5. package/dist/lib/context/context-registry.mjs +63 -0
  6. package/dist/lib/context/debugger.mjs +240 -0
  7. package/dist/lib/context/flow-context.mjs +61 -0
  8. package/dist/lib/context/global-state.mjs +70 -0
  9. package/dist/lib/context/map-registry.mjs +59 -0
  10. package/dist/lib/context/query-registry.mjs +53 -0
  11. package/dist/lib/errors/flow-error.mjs +10 -0
  12. package/dist/lib/errors/flow-expression-error.mjs +14 -0
  13. package/dist/lib/errors/flow-map-error.mjs +9 -0
  14. package/dist/lib/expressions/expression-parser.mjs +198 -0
  15. package/dist/lib/expressions/functions/from-palette.mjs +75 -0
  16. package/dist/lib/expressions/functions/regex.mjs +25 -0
  17. package/dist/lib/expressions/functions/state.mjs +25 -0
  18. package/dist/lib/expressions/parser-helpers.mjs +37 -0
  19. package/dist/lib/expressions/reactive-expression.mjs +253 -0
  20. package/dist/lib/map/flow-core-map.mjs +749 -0
  21. package/dist/lib/map/plugins/annotations/annotation-layers.mjs +163 -0
  22. package/dist/lib/map/plugins/annotations/annotation.events.mjs +27 -0
  23. package/dist/lib/map/plugins/annotations/annotation.plugin.mjs +498 -0
  24. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DirectModeOverride.mjs +67 -0
  25. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/modes/DragCircleMode.mjs +65 -0
  26. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/create_supplementary_points_circle.mjs +15 -0
  27. package/dist/lib/map/plugins/annotations/maplibre-gl-draw-circle/lib/utils/drag_pan.mjs +20 -0
  28. package/dist/lib/map/plugins/data-join.plugin.mjs +173 -0
  29. package/dist/lib/map/plugins/export/export.plugin.mjs +21 -0
  30. package/dist/lib/map/plugins/export/map-exporter.mjs +177 -0
  31. package/dist/lib/map/plugins/hover-effect.plugin.mjs +58 -0
  32. package/dist/lib/map/plugins/index.d.mts +37 -72
  33. package/dist/lib/map/plugins/index.d.ts +37 -72
  34. package/dist/lib/map/plugins/index.mjs +11 -1810
  35. package/dist/lib/map/plugins/keyboard-shortcut-manager.mjs +120 -0
  36. package/dist/lib/map/plugins/map-plugin-base.mjs +25 -0
  37. package/dist/lib/map/plugins/plugin-manager.mjs +135 -0
  38. package/dist/lib/map/plugins/popup.plugin.mjs +55 -0
  39. package/dist/lib/map/plugins/selection/selection.events.mjs +21 -0
  40. package/dist/lib/map/plugins/selection/selection.plugin.mjs +136 -0
  41. package/dist/lib/map/plugins/selection/source-selection.mjs +156 -0
  42. package/dist/lib/map/plugins/url-sync.plugin.mjs +55 -0
  43. package/dist/lib/map/support/image-registry.mjs +82 -0
  44. package/dist/lib/map/support/map-events.mjs +71 -0
  45. package/dist/lib/map/support/map-feature-stream.mjs +158 -0
  46. package/dist/lib/map/support/map-popup.mjs +159 -0
  47. package/dist/lib/map/types.mjs +7 -0
  48. package/dist/lib/map-style/map-data-source.mjs +192 -0
  49. package/dist/lib/map-style/map-layer-style-builder-generated.mjs +1307 -0
  50. package/dist/lib/map-style/map-layer-style-builder.mjs +86 -0
  51. package/dist/lib/map-style/map-layer.mjs +223 -0
  52. package/dist/lib/map-style/map-style.mjs +178 -0
  53. package/dist/lib/queries/async-committer.mjs +30 -0
  54. package/dist/lib/queries/query.mjs +172 -0
  55. package/dist/lib/state-store/decorators.mjs +83 -0
  56. package/dist/lib/state-store/state-store.mjs +534 -0
  57. package/dist/lib/state-store/utils.mjs +7 -0
  58. package/dist/lib/utils/announce.mjs +12 -0
  59. package/dist/lib/utils/assert.mjs +12 -0
  60. package/dist/{shared/flow-rdf-core.187cb345.mjs → lib/utils/debounce.mjs} +3 -39
  61. package/dist/lib/utils/decorators.mjs +59 -0
  62. package/dist/lib/utils/deferred.mjs +11 -0
  63. package/dist/lib/utils/ensure-array.mjs +16 -0
  64. package/dist/{shared/flow-rdf-core.1f0901c5.mjs → lib/utils/feature-type-checks.mjs} +2 -2
  65. package/dist/lib/utils/functional.mjs +22 -0
  66. package/dist/lib/utils/global.mjs +18 -0
  67. package/dist/lib/utils/index.mjs +8 -5
  68. package/dist/lib/utils/random-id.mjs +9 -0
  69. package/dist/lib/utils/string-utils.mjs +3 -0
  70. package/dist/lib/utils/throttle.mjs +20 -0
  71. package/dist/{shared/flow-rdf-core.25e5f6d7.mjs → lib/utils/type-checks.mjs} +1 -26
  72. package/dist/lib/utils/watchable-promise.mjs +55 -0
  73. package/dist/package.json.mjs +3 -0
  74. package/dist/shared/{flow-rdf-core.4dde996e.d.cts → flow-rdf-core.cef13c7e.d.mts} +1315 -172
  75. package/dist/shared/{flow-rdf-core.4dde996e.d.ts → flow-rdf-core.cef13c7e.d.ts} +1315 -172
  76. package/package.json +4 -8
  77. package/dist/index.cjs +0 -3316
  78. package/dist/index.d.cts +0 -90
  79. package/dist/lib/map/plugins/index.cjs +0 -1850
  80. package/dist/lib/map/plugins/index.d.cts +0 -345
  81. package/dist/lib/utils/index.cjs +0 -48
  82. package/dist/lib/utils/index.d.cts +0 -160
  83. package/dist/shared/flow-rdf-core.06e85a6c.cjs +0 -1394
  84. package/dist/shared/flow-rdf-core.4dde996e.d.mts +0 -1916
  85. package/dist/shared/flow-rdf-core.55c169ca.cjs +0 -150
  86. package/dist/shared/flow-rdf-core.63162669.d.cts +0 -10
  87. package/dist/shared/flow-rdf-core.65045caf.mjs +0 -1360
  88. package/dist/shared/flow-rdf-core.a82b9be4.cjs +0 -34
  89. package/dist/shared/flow-rdf-core.f50908f0.cjs +0 -102
@@ -1,8 +1,8 @@
1
- import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.4dde996e.mjs';
2
- export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.4dde996e.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.cef13c7e.mjs';
2
+ export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.cef13c7e.mjs';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.mjs';
4
- import EventEmitter from 'eventemitter3';
5
- import * as lit from 'lit-html';
4
+ import 'eventemitter3';
5
+ import 'lit-html';
6
6
  import '@emuanalytics/flow-engine-client';
7
7
  import 'mobx-utils';
8
8
  import '@emuanalytics/maplibre-gl';
@@ -195,6 +195,12 @@ declare class DataJoin {
195
195
  private doDataJoin;
196
196
  private loadData;
197
197
  }
198
+ /**
199
+ * dfsffd
200
+ *
201
+ * @noInheritDoc
202
+ *
203
+ */
198
204
  declare class DataJoinPlugin extends MapPluginBase {
199
205
  private _joins;
200
206
  readonly name = "DataJoinPlugin";
@@ -242,6 +248,33 @@ declare class ExportPlugin extends MapPluginBase<ExportPluginOptions> {
242
248
  exportMap(options: FlowMapExportOptions): Promise<string>;
243
249
  }
244
250
 
251
+ /**
252
+ * This plugin supports adding hover styling to map features.
253
+ *
254
+ * When active, features that are hovered over will have their `hover`
255
+ * feature state property set to `true`. This can be referenced in map layer
256
+ * style expressions to apply hover effects.
257
+ *
258
+ * The plugin exposes no additional API methods or properties.
259
+ *
260
+ * @noInheritDoc
261
+ *
262
+ * @example
263
+ * This map layer definition applies a hover effect using the `circleStrokeWidth` property:
264
+ ```js{7}
265
+ const circleLayer = new MapLayer({
266
+ id: "circle-layer",
267
+ type: "circle",
268
+ source: "airquality",
269
+ style: layerStyle("circle")
270
+ .circleColor(expr(`@no2 ? from-palette('YlOrRd', @no2, 0, 100) : gray`))
271
+ .circleStrokeWidth(expr("@@hover ? 5 : 0"))
272
+ .circleRadius(expr(`@no2 ? @no2 / 5 : 5`))
273
+ .build()
274
+ });
275
+ ```
276
+ *
277
+ */
245
278
  declare class HoverEffectPlugin extends MapPluginBase {
246
279
  private hoveredFeature;
247
280
  readonly name = "HoverEffectPlugin";
@@ -253,74 +286,6 @@ declare class HoverEffectPlugin extends MapPluginBase {
253
286
  private clearHover;
254
287
  }
255
288
 
256
- type MapPopupTemplateFn<TState extends StateStore = StateStore> = (feature: MapFeature | null, state: TState) => string | Node | lit.TemplateResult;
257
- interface MapPopupEvents {
258
- closed: (popup: MapPopup) => void;
259
- }
260
- /**
261
- * [[MapPopup]] options.
262
- */
263
- interface MapPopupOptions {
264
- /** Specify a CSS class to add to the popup. */
265
- class?: string;
266
- /** Enable 'close' button. */
267
- closeButton?: boolean;
268
- /** Enable closing popup on click on map. */
269
- closeOnClick?: boolean;
270
- /** Enable closing pop when map is moved. */
271
- closeOnMove?: boolean;
272
- /** Specify popup content as HTML string or HTML node. */
273
- content: string | Node | MapPopupTemplateFn;
274
- /** Maximum width of popup in CSS units. */
275
- maxWidth?: string;
276
- trackFeature?: boolean;
277
- }
278
- /**
279
- * Core functionality for Flo.w map popups.
280
- *
281
- * @noInheritDoc
282
- */
283
- declare class MapPopup extends EventEmitter<MapPopupEvents> {
284
- readonly map: FlowCoreMap;
285
- readonly options: MapPopupOptions;
286
- private _feature?;
287
- private _contentContainer;
288
- private _featureStream;
289
- private _maplibrePopup;
290
- private _featureStreamDisposer?;
291
- /**
292
- * Constructs a new `MapPopup` instance.
293
- *
294
- * This is called by the `FlowMap::openPopup` method.
295
- *
296
- * @param map Parent Flo.w map.
297
- * @param options Popup options.
298
- */
299
- constructor(map: FlowCoreMap, options: MapPopupOptions);
300
- get feature(): MapFeatureIdentifier | undefined;
301
- /**
302
- * Close the popup.
303
- */
304
- close(): void;
305
- /**
306
- * Move the popup to a new location.
307
- *
308
- * @param lngLat New location.
309
- */
310
- moveTo(lngLat: [number, number]): void;
311
- /**
312
- * Open the popup at the specified location.
313
- *
314
- * @param lngLat Popup location.
315
- */
316
- open(event: MapMouseEvent): void;
317
- open(lngLat: [number, number], feature?: MapFeatureIdentifier): void;
318
- private cssClasses;
319
- private handleFeatureUpdate;
320
- private popupCloseHandler;
321
- private renderContent;
322
- }
323
-
324
289
  declare class PopupPlugin extends MapPluginBase {
325
290
  private _popupTemplates;
326
291
  private _popups;
@@ -1,8 +1,8 @@
1
- import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.4dde996e.js';
2
- export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.4dde996e.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.cef13c7e.js';
2
+ export { aC as EventHandlers, aB as PluginConstructor, aA as PluginEventsType, az as PluginOptionsType } from '../../../shared/flow-rdf-core.cef13c7e.js';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.js';
4
- import EventEmitter from 'eventemitter3';
5
- import * as lit from 'lit-html';
4
+ import 'eventemitter3';
5
+ import 'lit-html';
6
6
  import '@emuanalytics/flow-engine-client';
7
7
  import 'mobx-utils';
8
8
  import '@emuanalytics/maplibre-gl';
@@ -195,6 +195,12 @@ declare class DataJoin {
195
195
  private doDataJoin;
196
196
  private loadData;
197
197
  }
198
+ /**
199
+ * dfsffd
200
+ *
201
+ * @noInheritDoc
202
+ *
203
+ */
198
204
  declare class DataJoinPlugin extends MapPluginBase {
199
205
  private _joins;
200
206
  readonly name = "DataJoinPlugin";
@@ -242,6 +248,33 @@ declare class ExportPlugin extends MapPluginBase<ExportPluginOptions> {
242
248
  exportMap(options: FlowMapExportOptions): Promise<string>;
243
249
  }
244
250
 
251
+ /**
252
+ * This plugin supports adding hover styling to map features.
253
+ *
254
+ * When active, features that are hovered over will have their `hover`
255
+ * feature state property set to `true`. This can be referenced in map layer
256
+ * style expressions to apply hover effects.
257
+ *
258
+ * The plugin exposes no additional API methods or properties.
259
+ *
260
+ * @noInheritDoc
261
+ *
262
+ * @example
263
+ * This map layer definition applies a hover effect using the `circleStrokeWidth` property:
264
+ ```js{7}
265
+ const circleLayer = new MapLayer({
266
+ id: "circle-layer",
267
+ type: "circle",
268
+ source: "airquality",
269
+ style: layerStyle("circle")
270
+ .circleColor(expr(`@no2 ? from-palette('YlOrRd', @no2, 0, 100) : gray`))
271
+ .circleStrokeWidth(expr("@@hover ? 5 : 0"))
272
+ .circleRadius(expr(`@no2 ? @no2 / 5 : 5`))
273
+ .build()
274
+ });
275
+ ```
276
+ *
277
+ */
245
278
  declare class HoverEffectPlugin extends MapPluginBase {
246
279
  private hoveredFeature;
247
280
  readonly name = "HoverEffectPlugin";
@@ -253,74 +286,6 @@ declare class HoverEffectPlugin extends MapPluginBase {
253
286
  private clearHover;
254
287
  }
255
288
 
256
- type MapPopupTemplateFn<TState extends StateStore = StateStore> = (feature: MapFeature | null, state: TState) => string | Node | lit.TemplateResult;
257
- interface MapPopupEvents {
258
- closed: (popup: MapPopup) => void;
259
- }
260
- /**
261
- * [[MapPopup]] options.
262
- */
263
- interface MapPopupOptions {
264
- /** Specify a CSS class to add to the popup. */
265
- class?: string;
266
- /** Enable 'close' button. */
267
- closeButton?: boolean;
268
- /** Enable closing popup on click on map. */
269
- closeOnClick?: boolean;
270
- /** Enable closing pop when map is moved. */
271
- closeOnMove?: boolean;
272
- /** Specify popup content as HTML string or HTML node. */
273
- content: string | Node | MapPopupTemplateFn;
274
- /** Maximum width of popup in CSS units. */
275
- maxWidth?: string;
276
- trackFeature?: boolean;
277
- }
278
- /**
279
- * Core functionality for Flo.w map popups.
280
- *
281
- * @noInheritDoc
282
- */
283
- declare class MapPopup extends EventEmitter<MapPopupEvents> {
284
- readonly map: FlowCoreMap;
285
- readonly options: MapPopupOptions;
286
- private _feature?;
287
- private _contentContainer;
288
- private _featureStream;
289
- private _maplibrePopup;
290
- private _featureStreamDisposer?;
291
- /**
292
- * Constructs a new `MapPopup` instance.
293
- *
294
- * This is called by the `FlowMap::openPopup` method.
295
- *
296
- * @param map Parent Flo.w map.
297
- * @param options Popup options.
298
- */
299
- constructor(map: FlowCoreMap, options: MapPopupOptions);
300
- get feature(): MapFeatureIdentifier | undefined;
301
- /**
302
- * Close the popup.
303
- */
304
- close(): void;
305
- /**
306
- * Move the popup to a new location.
307
- *
308
- * @param lngLat New location.
309
- */
310
- moveTo(lngLat: [number, number]): void;
311
- /**
312
- * Open the popup at the specified location.
313
- *
314
- * @param lngLat Popup location.
315
- */
316
- open(event: MapMouseEvent): void;
317
- open(lngLat: [number, number], feature?: MapFeatureIdentifier): void;
318
- private cssClasses;
319
- private handleFeatureUpdate;
320
- private popupCloseHandler;
321
- private renderContent;
322
- }
323
-
324
289
  declare class PopupPlugin extends MapPluginBase {
325
290
  private _popupTemplates;
326
291
  private _popups;