@emuanalytics/flow-rdf-core 4.0.0-preview.6 → 4.0.0

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 (27) hide show
  1. package/dist/index.cjs +676 -665
  2. package/dist/index.d.cts +2 -2
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.mjs +643 -643
  6. package/dist/lib/map/plugins/index.cjs +35 -34
  7. package/dist/lib/map/plugins/index.d.cts +2 -2
  8. package/dist/lib/map/plugins/index.d.mts +2 -2
  9. package/dist/lib/map/plugins/index.d.ts +2 -2
  10. package/dist/lib/map/plugins/index.mjs +6 -6
  11. package/dist/lib/utils/index.cjs +31 -29
  12. package/dist/lib/utils/index.d.cts +10 -9
  13. package/dist/lib/utils/index.d.mts +10 -9
  14. package/dist/lib/utils/index.d.ts +10 -9
  15. package/dist/lib/utils/index.mjs +4 -3
  16. package/dist/shared/{flow-rdf-core.769a4928.d.mts → flow-rdf-core.04b30d7a.d.cts} +801 -802
  17. package/dist/shared/{flow-rdf-core.769a4928.d.ts → flow-rdf-core.04b30d7a.d.mts} +801 -802
  18. package/dist/shared/{flow-rdf-core.769a4928.d.cts → flow-rdf-core.04b30d7a.d.ts} +801 -802
  19. package/dist/shared/{flow-rdf-core.ea06a1d3.mjs → flow-rdf-core.187cb345.mjs} +1 -1
  20. package/dist/shared/{flow-rdf-core.bd95d618.mjs → flow-rdf-core.1f0901c5.mjs} +1 -1
  21. package/dist/shared/{flow-rdf-core.b80085b4.mjs → flow-rdf-core.25e5f6d7.mjs} +9 -1
  22. package/dist/shared/{flow-rdf-core.1f72b20b.cjs → flow-rdf-core.55c169ca.cjs} +2 -2
  23. package/dist/shared/{flow-rdf-core.1f9c0593.cjs → flow-rdf-core.9b5dad76.cjs} +26 -34
  24. package/dist/shared/{flow-rdf-core.84eded74.cjs → flow-rdf-core.a82b9be4.cjs} +4 -4
  25. package/dist/shared/{flow-rdf-core.ce91eb14.mjs → flow-rdf-core.e2b1bb7f.mjs} +2 -9
  26. package/dist/shared/{flow-rdf-core.3042be4a.cjs → flow-rdf-core.f50908f0.cjs} +9 -0
  27. package/package.json +5 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const mapFeatureStream = require('../../../shared/flow-rdf-core.1f9c0593.cjs');
3
+ const mapFeatureStream = require('../../../shared/flow-rdf-core.9b5dad76.cjs');
4
4
  const MapboxDraw = require('@emuanalytics/mapbox-gl-draw');
5
5
  const turfArea = require('@turf/area');
6
6
  const turfBBox = require('@turf/bbox');
@@ -8,22 +8,22 @@ const turfBooleanEqual = require('@turf/boolean-equal');
8
8
  const turfBuffer = require('@turf/buffer');
9
9
  const turfLength = require('@turf/length');
10
10
  const Debug = require('debug');
11
- const featureTypeChecks = require('../../../shared/flow-rdf-core.84eded74.cjs');
11
+ const featureTypeChecks = require('../../../shared/flow-rdf-core.a82b9be4.cjs');
12
+ const randomId = require('../../../shared/flow-rdf-core.f50908f0.cjs');
12
13
  const EventEmitter = require('eventemitter3');
13
- const stringUtils = require('../../../shared/flow-rdf-core.3042be4a.cjs');
14
14
  const lit = require('lit-html');
15
15
  const maplibre = require('@emuanalytics/maplibre-gl');
16
16
  const turfCircle = require('@turf/circle');
17
17
  const turfDistance = require('@turf/distance');
18
18
  const helpers = require('@turf/helpers');
19
19
  const mobx = require('mobx');
20
- const fileSaver = require('file-saver');
20
+ const saveAs = require('file-saver');
21
21
  require('@emuanalytics/maplibre-gl-style-spec');
22
22
  require('mobx-utils');
23
23
  require('parsimmon');
24
24
  require('colorbrewer');
25
- require('nanoid');
26
25
  require('@turf/invariant');
26
+ require('nanoid');
27
27
 
28
28
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
29
29
 
@@ -51,6 +51,7 @@ const lit__namespace = /*#__PURE__*/_interopNamespaceCompat(lit);
51
51
  const maplibre__default = /*#__PURE__*/_interopDefaultCompat(maplibre);
52
52
  const turfCircle__default = /*#__PURE__*/_interopDefaultCompat(turfCircle);
53
53
  const turfDistance__default = /*#__PURE__*/_interopDefaultCompat(turfDistance);
54
+ const saveAs__default = /*#__PURE__*/_interopDefaultCompat(saveAs);
54
55
 
55
56
  var __defProp$c = Object.defineProperty;
56
57
  var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -99,7 +100,7 @@ class MapPluginBase extends EventEmitter.EventEmitter {
99
100
  }
100
101
 
101
102
  function isFeatureWithId(f) {
102
- return stringUtils.isDefined(f) && stringUtils.isDefined(f.source) && stringUtils.isDefined(f.id);
103
+ return randomId.isDefined(f) && randomId.isDefined(f.source) && randomId.isDefined(f.id);
103
104
  }
104
105
 
105
106
  var __defProp$a = Object.defineProperty;
@@ -163,7 +164,7 @@ class MapPopup extends EventEmitter__default {
163
164
  if (this._maplibrePopup) {
164
165
  return;
165
166
  }
166
- if (!stringUtils.isArray(eventOrLngLat)) {
167
+ if (!randomId.isArray(eventOrLngLat)) {
167
168
  if (isFeatureWithId(eventOrLngLat.features[0])) {
168
169
  feature = eventOrLngLat.features[0];
169
170
  }
@@ -205,7 +206,7 @@ class MapPopup extends EventEmitter__default {
205
206
  }
206
207
  cssClasses() {
207
208
  const classes = ["flow-map-popup"];
208
- if (stringUtils.isStringFull(this.options.class)) {
209
+ if (randomId.isStringFull(this.options.class)) {
209
210
  classes.push(this.options.class);
210
211
  }
211
212
  if (this.options.closeButton) {
@@ -240,8 +241,8 @@ class MapPopup extends EventEmitter__default {
240
241
  }
241
242
  renderContent(feature) {
242
243
  const state = this.map.context.state;
243
- const content = stringUtils.isFunction(this.options.content) ? this.options.content(feature, state) : this.options.content;
244
- if (stringUtils.isString(content)) {
244
+ const content = randomId.isFunction(this.options.content) ? this.options.content(feature, state) : this.options.content;
245
+ if (randomId.isString(content)) {
245
246
  this._contentContainer.innerHTML = content;
246
247
  } else if (content instanceof Node) {
247
248
  this._contentContainer.innerHTML = "";
@@ -278,7 +279,7 @@ class PopupPlugin extends MapPluginBase {
278
279
  popup.once("closed", () => {
279
280
  this._popups.delete(popup);
280
281
  });
281
- if (stringUtils.isArray(eventOrLngLat)) {
282
+ if (randomId.isArray(eventOrLngLat)) {
282
283
  popup.open(eventOrLngLat, feature);
283
284
  } else {
284
285
  popup.open(eventOrLngLat);
@@ -290,7 +291,7 @@ class PopupPlugin extends MapPluginBase {
290
291
  this._popups.clear();
291
292
  }
292
293
  closePopupsForSources(sources) {
293
- sources = stringUtils.ensureArray(sources);
294
+ sources = randomId.ensureArray(sources);
294
295
  this._popups.forEach((popup) => {
295
296
  if (popup.feature?.source && sources.indexOf(popup.feature?.source) >= 0) {
296
297
  popup.close();
@@ -349,7 +350,7 @@ class SourceSelection {
349
350
  });
350
351
  if (options.selectionState) {
351
352
  this._stateSubscription = this._map.context.state.toStream(options.selectionState, true).subscribe((val) => {
352
- val = new Set(stringUtils.ensureArray(val));
353
+ val = new Set(randomId.ensureArray(val));
353
354
  this.updateSelection(val);
354
355
  });
355
356
  }
@@ -455,7 +456,7 @@ class SourceSelection {
455
456
  );
456
457
  }
457
458
  updateStateStore() {
458
- if (stringUtils.isStringFull(this._options.selectionState)) {
459
+ if (randomId.isStringFull(this._options.selectionState)) {
459
460
  const selectedIds = Array.from(this._selectedFeatureIds);
460
461
  if (this._options.mode === "single") {
461
462
  this._map.context.state.set(this._options.selectionState, selectedIds[0]);
@@ -495,7 +496,7 @@ class SelectionPlugin extends MapPluginBase {
495
496
  if (!sourceSelection) {
496
497
  return;
497
498
  }
498
- features = stringUtils.ensureArray(features);
499
+ features = randomId.ensureArray(features);
499
500
  const currentSelection = new Set(sourceSelection.selectedFeatureIds);
500
501
  switch (sourceSelection.options.mode) {
501
502
  case "single":
@@ -545,7 +546,7 @@ class SelectionPlugin extends MapPluginBase {
545
546
  if (!sourceSelection) {
546
547
  return;
547
548
  }
548
- features = stringUtils.ensureArray(features);
549
+ features = randomId.ensureArray(features);
549
550
  if (features.length === 0) {
550
551
  this.clearSelection(source);
551
552
  return;
@@ -561,7 +562,7 @@ class SelectionPlugin extends MapPluginBase {
561
562
  sourceSelection.updateSelection(currentSelection);
562
563
  break;
563
564
  }
564
- if (sourceSelection.selectedFeatureIds.size && stringUtils.isStringFull(sourceSelection.options.group)) {
565
+ if (sourceSelection.selectedFeatureIds.size && randomId.isStringFull(sourceSelection.options.group)) {
565
566
  this._sourceSelections.forEach((s) => {
566
567
  if (s != sourceSelection && s.options.clear === "group" && s.options.group == sourceSelection.options.group) {
567
568
  s.updateSelection(/* @__PURE__ */ new Set());
@@ -1277,10 +1278,10 @@ const _AnnotationPlugin = class _AnnotationPlugin extends MapPluginBase {
1277
1278
  return feature;
1278
1279
  }
1279
1280
  generateFeatureId(feature) {
1280
- if (stringUtils.isNumber(feature.id) || stringUtils.isStringFull(feature.id)) {
1281
+ if (randomId.isNumber(feature.id) || randomId.isStringFull(feature.id)) {
1281
1282
  return feature.id.toString();
1282
1283
  } else {
1283
- return mapFeatureStream.randomId("feature");
1284
+ return randomId.randomId("feature");
1284
1285
  }
1285
1286
  }
1286
1287
  generateFeatureName(feature) {
@@ -1404,15 +1405,15 @@ const _DataJoin = class _DataJoin {
1404
1405
  }
1405
1406
  start() {
1406
1407
  this.stop();
1407
- if (stringUtils.isString(this.options.data)) {
1408
- if (stringUtils.isURL(this.options.data))
1408
+ if (randomId.isString(this.options.data)) {
1409
+ if (randomId.isURL(this.options.data))
1409
1410
  this.options.data = `'${this.options.data}'`;
1410
1411
  this.dataExpression = new mapFeatureStream.ReactiveExpression(this.options.data);
1411
1412
  this.dataExpression.bindState(this.map.context.state);
1412
1413
  } else {
1413
1414
  this.dataExpression = null;
1414
1415
  }
1415
- if (stringUtils.isArrayFull(this.options.parameters)) {
1416
+ if (randomId.isArrayFull(this.options.parameters)) {
1416
1417
  this.parameterExpressions = this.options.parameters.reduce((accum, param) => {
1417
1418
  const expr = new mapFeatureStream.ReactiveExpression(param.value.toString());
1418
1419
  expr.bindState(this.map.context.state);
@@ -1424,9 +1425,9 @@ const _DataJoin = class _DataJoin {
1424
1425
  async () => {
1425
1426
  let data = this.dataExpression ? mobx.toJS(this.dataExpression.value) : this.options.data;
1426
1427
  const missingParams = this.options.parameters.map(
1427
- (p) => p.required && stringUtils.isNil(this.parameterExpressions[p.name].value) ? p.name : void 0
1428
+ (p) => p.required && randomId.isNil(this.parameterExpressions[p.name].value) ? p.name : void 0
1428
1429
  ).filter((p) => !!p);
1429
- if (stringUtils.isNull(data)) {
1430
+ if (randomId.isNull(data)) {
1430
1431
  debug$1(`FlowMap<${this.map.id}>: Skipping data join '${this.id}' (null data)`);
1431
1432
  return;
1432
1433
  }
@@ -1435,7 +1436,7 @@ const _DataJoin = class _DataJoin {
1435
1436
  return;
1436
1437
  }
1437
1438
  debug$1(`FlowMap<${this.map.id}>: Performing data join '${this.id}'`);
1438
- if (stringUtils.isString(data)) {
1439
+ if (randomId.isString(data)) {
1439
1440
  try {
1440
1441
  data = await this.loadData(data);
1441
1442
  } catch (e) {
@@ -1467,10 +1468,10 @@ const _DataJoin = class _DataJoin {
1467
1468
  this.map.setFeatureStateBulk({ source: source.id, sourceLayer }, featureData);
1468
1469
  }
1469
1470
  loadData(datasetOrUrl) {
1470
- if (stringUtils.isURL(datasetOrUrl)) {
1471
+ if (randomId.isURL(datasetOrUrl)) {
1471
1472
  const url = new URL(datasetOrUrl);
1472
1473
  const params = new URLSearchParams(url.searchParams);
1473
- if (stringUtils.isArrayFull(this.options.parameters)) {
1474
+ if (randomId.isArrayFull(this.options.parameters)) {
1474
1475
  this.options.parameters.forEach((p) => {
1475
1476
  params.append(p.name, this.parameterExpressions[p.name].value);
1476
1477
  });
@@ -1491,7 +1492,7 @@ const _DataJoin = class _DataJoin {
1491
1492
  });
1492
1493
  } else {
1493
1494
  const params = {};
1494
- if (stringUtils.isArrayFull(this.options.parameters)) {
1495
+ if (randomId.isArrayFull(this.options.parameters)) {
1495
1496
  this.options.parameters.forEach((p) => {
1496
1497
  params[p.name] = this.parameterExpressions[p.name].value;
1497
1498
  });
@@ -1574,7 +1575,7 @@ const _MapExporter = class _MapExporter {
1574
1575
  switch (options.format) {
1575
1576
  case "png":
1576
1577
  exportCanvas.toBlob((blob) => {
1577
- blob && fileSaver.saveAs(blob, fileName);
1578
+ blob && saveAs__default(blob, fileName);
1578
1579
  });
1579
1580
  break;
1580
1581
  case "pdf":
@@ -1587,7 +1588,7 @@ const _MapExporter = class _MapExporter {
1587
1588
  const mapImage = new Image();
1588
1589
  mapImage.onload = () => {
1589
1590
  exportContext.drawImage(mapImage, 0, 0);
1590
- if (stringUtils.isFunction(options.drawOverlayFn)) {
1591
+ if (randomId.isFunction(options.drawOverlayFn)) {
1591
1592
  options.drawOverlayFn(
1592
1593
  exportContext,
1593
1594
  exportCanvas.width,
@@ -1626,7 +1627,7 @@ const _MapExporter = class _MapExporter {
1626
1627
  const pixelRatio = exportWidth / copyWidth;
1627
1628
  this.setDevicePixelRatio(pixelRatio);
1628
1629
  const container = document.createElement("div");
1629
- container.id = mapFeatureStream.randomId("export");
1630
+ container.id = randomId.randomId("export");
1630
1631
  container.classList.add("maplibregl-export-container");
1631
1632
  container.style.width = `${copyWidth}px`;
1632
1633
  container.style.height = `${copyHeight}px`;
@@ -1663,7 +1664,7 @@ const _MapExporter = class _MapExporter {
1663
1664
  createExportCanvas(container, mapCanvas) {
1664
1665
  const canvasContainer = container.getElementsByClassName("maplibregl-canvas-container")[0];
1665
1666
  const overlayCanvas = document.createElement("canvas");
1666
- overlayCanvas.id = mapFeatureStream.randomId("overlay");
1667
+ overlayCanvas.id = randomId.randomId("overlay");
1667
1668
  overlayCanvas.width = mapCanvas.width;
1668
1669
  overlayCanvas.height = mapCanvas.height;
1669
1670
  overlayCanvas.style.position = "absolute";
@@ -1751,7 +1752,7 @@ class HoverEffectPlugin extends MapPluginBase {
1751
1752
  }
1752
1753
  if (!this.compareFeatures(hoveredFeature, this.hoveredFeature)) {
1753
1754
  this.clearHover();
1754
- if (isFeatureWithId(hoveredFeature) && stringUtils.isDefined(this.map.getSource(hoveredFeature.source)?.featureId)) {
1755
+ if (isFeatureWithId(hoveredFeature) && randomId.isDefined(this.map.getSource(hoveredFeature.source)?.featureId)) {
1755
1756
  this.map.setFeatureState(hoveredFeature, { hover: true }, false);
1756
1757
  this.hoveredFeature = hoveredFeature;
1757
1758
  }
@@ -1770,7 +1771,7 @@ class HoverEffectPlugin extends MapPluginBase {
1770
1771
  if (f1 === f2) {
1771
1772
  return true;
1772
1773
  }
1773
- if (stringUtils.isObject(f1) && stringUtils.isObject(f2)) {
1774
+ if (randomId.isObject(f1) && randomId.isObject(f2)) {
1774
1775
  return f1.id == f2.id && f1.source === f2.source && f1.sourceLayer == f2.sourceLayer;
1775
1776
  }
1776
1777
  return false;
@@ -1,5 +1,5 @@
1
- import { Z as MapEvent, y as FlowMap, w as MapSourceIdentifier, _ as MapFeatureId, $ as MapPluginBase, a0 as PluginManager, a1 as MapSourceEvent, a2 as MapMouseEvent, a3 as MapFeatureStream, a4 as PartialBy, r as MapAnimationOptions, a5 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, u as MapFeatureIdentifier, t as MapFeature } from '../../../shared/flow-rdf-core.769a4928.cjs';
2
- export { a9 as EventHandlers, a8 as PluginConstructor, a7 as PluginEventsType, a6 as PluginOptionsType } from '../../../shared/flow-rdf-core.769a4928.cjs';
1
+ import { a8 as MapEvent, K as FlowMap, 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.04b30d7a.cjs';
2
+ export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.04b30d7a.cjs';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.cjs';
4
4
  import EventEmitter from 'eventemitter3';
5
5
  import * as lit from 'lit-html';
@@ -1,5 +1,5 @@
1
- import { Z as MapEvent, y as FlowMap, w as MapSourceIdentifier, _ as MapFeatureId, $ as MapPluginBase, a0 as PluginManager, a1 as MapSourceEvent, a2 as MapMouseEvent, a3 as MapFeatureStream, a4 as PartialBy, r as MapAnimationOptions, a5 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, u as MapFeatureIdentifier, t as MapFeature } from '../../../shared/flow-rdf-core.769a4928.mjs';
2
- export { a9 as EventHandlers, a8 as PluginConstructor, a7 as PluginEventsType, a6 as PluginOptionsType } from '../../../shared/flow-rdf-core.769a4928.mjs';
1
+ import { a8 as MapEvent, K as FlowMap, 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.04b30d7a.mjs';
2
+ export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.04b30d7a.mjs';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.mjs';
4
4
  import EventEmitter from 'eventemitter3';
5
5
  import * as lit from 'lit-html';
@@ -1,5 +1,5 @@
1
- import { Z as MapEvent, y as FlowMap, w as MapSourceIdentifier, _ as MapFeatureId, $ as MapPluginBase, a0 as PluginManager, a1 as MapSourceEvent, a2 as MapMouseEvent, a3 as MapFeatureStream, a4 as PartialBy, r as MapAnimationOptions, a5 as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, u as MapFeatureIdentifier, t as MapFeature } from '../../../shared/flow-rdf-core.769a4928.js';
2
- export { a9 as EventHandlers, a8 as PluginConstructor, a7 as PluginEventsType, a6 as PluginOptionsType } from '../../../shared/flow-rdf-core.769a4928.js';
1
+ import { a8 as MapEvent, K as FlowMap, 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.04b30d7a.js';
2
+ export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.04b30d7a.js';
3
3
  import { F as Func } from '../../../shared/flow-rdf-core.63162669.js';
4
4
  import EventEmitter from 'eventemitter3';
5
5
  import * as lit from 'lit-html';
@@ -1,5 +1,5 @@
1
- import { M as MapEvent, a as assert, b as MapFeatureStream, F as FlowError, c as FlowMapError, d as MapDataSource, e as MapLayer, r as randomId, R as ReactiveExpression } from '../../../shared/flow-rdf-core.ce91eb14.mjs';
2
- export { P as PluginManager } from '../../../shared/flow-rdf-core.ce91eb14.mjs';
1
+ import { M as MapEvent, a as assert, b as MapFeatureStream, F as FlowError, c as FlowMapError, d as MapDataSource, e as MapLayer, R as ReactiveExpression } from '../../../shared/flow-rdf-core.e2b1bb7f.mjs';
2
+ export { P as PluginManager } from '../../../shared/flow-rdf-core.e2b1bb7f.mjs';
3
3
  import MapboxDraw from '@emuanalytics/mapbox-gl-draw';
4
4
  import turfArea from '@turf/area';
5
5
  import turfBBox from '@turf/bbox';
@@ -7,22 +7,22 @@ import turfBooleanEqual from '@turf/boolean-equal';
7
7
  import turfBuffer from '@turf/buffer';
8
8
  import turfLength from '@turf/length';
9
9
  import Debug from 'debug';
10
- import { c as isPolygon, i as isLineString, b as isPoint } from '../../../shared/flow-rdf-core.bd95d618.mjs';
10
+ import { c as isPolygon, i as isLineString, b as isPoint } from '../../../shared/flow-rdf-core.1f0901c5.mjs';
11
+ import { d as isDefined, j as isArray, g as isStringFull, x as isFunction, f as isString, e as ensureArray, o as isNumber, A as randomId, z as isURL, k as isArrayFull, b as isNil, a as isNull, m as isObject } from '../../../shared/flow-rdf-core.25e5f6d7.mjs';
11
12
  import EventEmitter$1, { EventEmitter } from 'eventemitter3';
12
- import { d as isDefined, j as isArray, g as isStringFull, x as isFunction, f as isString, e as ensureArray, o as isNumber, z as isURL, k as isArrayFull, b as isNil, a as isNull, m as isObject } from '../../../shared/flow-rdf-core.b80085b4.mjs';
13
13
  import * as lit from 'lit-html';
14
14
  import maplibre from '@emuanalytics/maplibre-gl';
15
15
  import turfCircle from '@turf/circle';
16
16
  import turfDistance from '@turf/distance';
17
17
  import { point } from '@turf/helpers';
18
18
  import { autorun, toJS } from 'mobx';
19
- import { saveAs } from 'file-saver';
19
+ import saveAs from 'file-saver';
20
20
  // import '@emuanalytics/maplibre-gl-style-spec';
21
21
  // import 'mobx-utils';
22
22
  import 'parsimmon';
23
23
  import 'colorbrewer';
24
- // import 'nanoid';
25
24
  import '@turf/invariant';
25
+ // import 'nanoid';
26
26
 
27
27
  var __defProp$c = Object.defineProperty;
28
28
  var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -1,39 +1,41 @@
1
1
  'use strict';
2
2
 
3
- const stringUtils = require('../../shared/flow-rdf-core.3042be4a.cjs');
4
- const featureTypeChecks = require('../../shared/flow-rdf-core.84eded74.cjs');
5
- const throttle = require('../../shared/flow-rdf-core.1f72b20b.cjs');
3
+ const randomId = require('../../shared/flow-rdf-core.f50908f0.cjs');
4
+ const featureTypeChecks = require('../../shared/flow-rdf-core.a82b9be4.cjs');
5
+ const throttle = require('../../shared/flow-rdf-core.55c169ca.cjs');
6
6
  const lit = require('lit-html');
7
+ require('nanoid');
7
8
  require('@turf/invariant');
8
9
 
9
10
 
10
11
 
11
- exports.capitalize = stringUtils.capitalize;
12
- exports.ensureArray = stringUtils.ensureArray;
13
- exports.hasLength = stringUtils.hasLength;
14
- exports.hasValue = stringUtils.hasValue;
15
- exports.isArray = stringUtils.isArray;
16
- exports.isArrayFull = stringUtils.isArrayFull;
17
- exports.isArrayStrings = stringUtils.isArrayStrings;
18
- exports.isBoolean = stringUtils.isBoolean;
19
- exports.isDate = stringUtils.isDate;
20
- exports.isDefined = stringUtils.isDefined;
21
- exports.isFalse = stringUtils.isFalse;
22
- exports.isFunction = stringUtils.isFunction;
23
- exports.isIn = stringUtils.isIn;
24
- exports.isNil = stringUtils.isNil;
25
- exports.isNull = stringUtils.isNull;
26
- exports.isNumber = stringUtils.isNumber;
27
- exports.isNumeric = stringUtils.isNumeric;
28
- exports.isObject = stringUtils.isObject;
29
- exports.isObjectFull = stringUtils.isObjectFull;
30
- exports.isPlainObject = stringUtils.isPlainObject;
31
- exports.isString = stringUtils.isString;
32
- exports.isStringFull = stringUtils.isStringFull;
33
- exports.isTrue = stringUtils.isTrue;
34
- exports.isURL = stringUtils.isURL;
35
- exports.isUndefined = stringUtils.isUndefined;
36
- exports.isValue = stringUtils.isValue;
12
+ exports.capitalize = randomId.capitalize;
13
+ exports.ensureArray = randomId.ensureArray;
14
+ exports.hasLength = randomId.hasLength;
15
+ exports.hasValue = randomId.hasValue;
16
+ exports.isArray = randomId.isArray;
17
+ exports.isArrayFull = randomId.isArrayFull;
18
+ exports.isArrayStrings = randomId.isArrayStrings;
19
+ exports.isBoolean = randomId.isBoolean;
20
+ exports.isDate = randomId.isDate;
21
+ exports.isDefined = randomId.isDefined;
22
+ exports.isFalse = randomId.isFalse;
23
+ exports.isFunction = randomId.isFunction;
24
+ exports.isIn = randomId.isIn;
25
+ exports.isNil = randomId.isNil;
26
+ exports.isNull = randomId.isNull;
27
+ exports.isNumber = randomId.isNumber;
28
+ exports.isNumeric = randomId.isNumeric;
29
+ exports.isObject = randomId.isObject;
30
+ exports.isObjectFull = randomId.isObjectFull;
31
+ exports.isPlainObject = randomId.isPlainObject;
32
+ exports.isString = randomId.isString;
33
+ exports.isStringFull = randomId.isStringFull;
34
+ exports.isTrue = randomId.isTrue;
35
+ exports.isURL = randomId.isURL;
36
+ exports.isUndefined = randomId.isUndefined;
37
+ exports.isValue = randomId.isValue;
38
+ exports.randomId = randomId.randomId;
37
39
  exports.isLineString = featureTypeChecks.isLineString;
38
40
  exports.isMultiPolygon = featureTypeChecks.isMultiPolygon;
39
41
  exports.isPoint = featureTypeChecks.isPoint;
@@ -56,10 +56,6 @@ declare const isMultiPolygon: (val: any) => val is GeoJSON.Feature<GeoJSON.Multi
56
56
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
57
57
  * for details over the differences between `_.debounce` and `_.throttle`.
58
58
  *
59
- * @static
60
- * @memberOf _
61
- * @since 0.1.0
62
- * @category Function
63
59
  * @param {Function} func The function to debounce.
64
60
  * @param {number} [wait=0] The number of milliseconds to delay.
65
61
  * @param {Object} [options={}] The options object.
@@ -126,10 +122,6 @@ declare function debounceWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
126
122
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
127
123
  * for details over the differences between `_.throttle` and `_.debounce`.
128
124
  *
129
- * @static
130
- * @memberOf _
131
- * @since 0.1.0
132
- * @category Function
133
125
  * @param {Function} func The function to throttle.
134
126
  * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
135
127
  * @param {Object} [options={}] The options object.
@@ -156,4 +148,13 @@ declare function throttleWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
156
148
 
157
149
  declare const capitalize: (str: string, lowerRest?: boolean) => string;
158
150
 
159
- export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, throttle, throttleWithArgs };
151
+ /**
152
+ * Generate a random ID of `length` characters and prepending the given prefix.
153
+ *
154
+ * @param prefix Fixed prefix to prepend to the generated ID.
155
+ * @param length Number of characters in the generated ID.
156
+ *
157
+ */
158
+ declare function randomId(prefix?: string, length?: number): string;
159
+
160
+ export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, randomId, throttle, throttleWithArgs };
@@ -56,10 +56,6 @@ declare const isMultiPolygon: (val: any) => val is GeoJSON.Feature<GeoJSON.Multi
56
56
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
57
57
  * for details over the differences between `_.debounce` and `_.throttle`.
58
58
  *
59
- * @static
60
- * @memberOf _
61
- * @since 0.1.0
62
- * @category Function
63
59
  * @param {Function} func The function to debounce.
64
60
  * @param {number} [wait=0] The number of milliseconds to delay.
65
61
  * @param {Object} [options={}] The options object.
@@ -126,10 +122,6 @@ declare function debounceWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
126
122
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
127
123
  * for details over the differences between `_.throttle` and `_.debounce`.
128
124
  *
129
- * @static
130
- * @memberOf _
131
- * @since 0.1.0
132
- * @category Function
133
125
  * @param {Function} func The function to throttle.
134
126
  * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
135
127
  * @param {Object} [options={}] The options object.
@@ -156,4 +148,13 @@ declare function throttleWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
156
148
 
157
149
  declare const capitalize: (str: string, lowerRest?: boolean) => string;
158
150
 
159
- export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, throttle, throttleWithArgs };
151
+ /**
152
+ * Generate a random ID of `length` characters and prepending the given prefix.
153
+ *
154
+ * @param prefix Fixed prefix to prepend to the generated ID.
155
+ * @param length Number of characters in the generated ID.
156
+ *
157
+ */
158
+ declare function randomId(prefix?: string, length?: number): string;
159
+
160
+ export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, randomId, throttle, throttleWithArgs };
@@ -56,10 +56,6 @@ declare const isMultiPolygon: (val: any) => val is GeoJSON.Feature<GeoJSON.Multi
56
56
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
57
57
  * for details over the differences between `_.debounce` and `_.throttle`.
58
58
  *
59
- * @static
60
- * @memberOf _
61
- * @since 0.1.0
62
- * @category Function
63
59
  * @param {Function} func The function to debounce.
64
60
  * @param {number} [wait=0] The number of milliseconds to delay.
65
61
  * @param {Object} [options={}] The options object.
@@ -126,10 +122,6 @@ declare function debounceWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
126
122
  * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
127
123
  * for details over the differences between `_.throttle` and `_.debounce`.
128
124
  *
129
- * @static
130
- * @memberOf _
131
- * @since 0.1.0
132
- * @category Function
133
125
  * @param {Function} func The function to throttle.
134
126
  * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
135
127
  * @param {Object} [options={}] The options object.
@@ -156,4 +148,13 @@ declare function throttleWithArgs<TArgs extends any[], TKey>(fn: Func<TArgs, any
156
148
 
157
149
  declare const capitalize: (str: string, lowerRest?: boolean) => string;
158
150
 
159
- export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, throttle, throttleWithArgs };
151
+ /**
152
+ * Generate a random ID of `length` characters and prepending the given prefix.
153
+ *
154
+ * @param prefix Fixed prefix to prepend to the generated ID.
155
+ * @param length Number of characters in the generated ID.
156
+ *
157
+ */
158
+ declare function randomId(prefix?: string, length?: number): string;
159
+
160
+ export { capitalize, debounce, debounceWithArgs, ensureArray, hasLength, hasValue, isArray, isArrayFull, isArrayStrings, isBoolean, isDate, isDefined, isFalse, isFunction, isIn, isLineString, isMultiPolygon, isNil, isNull, isNumber, isNumeric, isObject, isObjectFull, isPlainObject, isPoint, isPolygon, isString, isStringFull, isTrue, isURL, isUndefined, isValue, randomId, throttle, throttleWithArgs };
@@ -1,5 +1,6 @@
1
- export { c as capitalize, e as ensureArray, h as hasLength, w as hasValue, j as isArray, k as isArrayFull, l as isArrayStrings, s as isBoolean, u as isDate, d as isDefined, p as isFalse, x as isFunction, r as isIn, b as isNil, a as isNull, o as isNumber, t as isNumeric, m as isObject, n as isObjectFull, y as isPlainObject, f as isString, g as isStringFull, q as isTrue, z as isURL, i as isUndefined, v as isValue } from '../../shared/flow-rdf-core.b80085b4.mjs';
2
- export { i as isLineString, a as isMultiPolygon, b as isPoint, c as isPolygon } from '../../shared/flow-rdf-core.bd95d618.mjs';
3
- export { d as debounce, a as debounceWithArgs, m as memoize, t as throttle, b as throttleWithArgs } from '../../shared/flow-rdf-core.ea06a1d3.mjs';
1
+ export { c as capitalize, e as ensureArray, h as hasLength, w as hasValue, j as isArray, k as isArrayFull, l as isArrayStrings, s as isBoolean, u as isDate, d as isDefined, p as isFalse, x as isFunction, r as isIn, b as isNil, a as isNull, o as isNumber, t as isNumeric, m as isObject, n as isObjectFull, y as isPlainObject, f as isString, g as isStringFull, q as isTrue, z as isURL, i as isUndefined, v as isValue, A as randomId } from '../../shared/flow-rdf-core.25e5f6d7.mjs';
2
+ export { i as isLineString, a as isMultiPolygon, b as isPoint, c as isPolygon } from '../../shared/flow-rdf-core.1f0901c5.mjs';
3
+ export { d as debounce, a as debounceWithArgs, m as memoize, t as throttle, b as throttleWithArgs } from '../../shared/flow-rdf-core.187cb345.mjs';
4
4
  export { html } from 'lit-html';
5
+ import 'nanoid';
5
6
  import '@turf/invariant';