@emuanalytics/flow-rdf-core 4.0.0-preview.7 → 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.
- package/dist/index.cjs +676 -665
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +643 -643
- package/dist/lib/map/plugins/index.cjs +32 -32
- package/dist/lib/map/plugins/index.d.cts +2 -2
- package/dist/lib/map/plugins/index.d.mts +2 -2
- package/dist/lib/map/plugins/index.d.ts +2 -2
- package/dist/lib/map/plugins/index.mjs +5 -5
- package/dist/lib/utils/index.cjs +31 -29
- package/dist/lib/utils/index.d.cts +10 -9
- package/dist/lib/utils/index.d.mts +10 -9
- package/dist/lib/utils/index.d.ts +10 -9
- package/dist/lib/utils/index.mjs +4 -3
- package/dist/shared/{flow-rdf-core.769a4928.d.mts → flow-rdf-core.04b30d7a.d.cts} +801 -802
- package/dist/shared/{flow-rdf-core.769a4928.d.ts → flow-rdf-core.04b30d7a.d.mts} +801 -802
- package/dist/shared/{flow-rdf-core.769a4928.d.cts → flow-rdf-core.04b30d7a.d.ts} +801 -802
- package/dist/shared/{flow-rdf-core.ea06a1d3.mjs → flow-rdf-core.187cb345.mjs} +1 -1
- package/dist/shared/{flow-rdf-core.bd95d618.mjs → flow-rdf-core.1f0901c5.mjs} +1 -1
- package/dist/shared/{flow-rdf-core.b80085b4.mjs → flow-rdf-core.25e5f6d7.mjs} +9 -1
- package/dist/shared/{flow-rdf-core.1f72b20b.cjs → flow-rdf-core.55c169ca.cjs} +2 -2
- package/dist/shared/{flow-rdf-core.1f9c0593.cjs → flow-rdf-core.9b5dad76.cjs} +26 -34
- package/dist/shared/{flow-rdf-core.84eded74.cjs → flow-rdf-core.a82b9be4.cjs} +4 -4
- package/dist/shared/{flow-rdf-core.ce91eb14.mjs → flow-rdf-core.e2b1bb7f.mjs} +2 -9
- package/dist/shared/{flow-rdf-core.3042be4a.cjs → flow-rdf-core.f50908f0.cjs} +9 -0
- package/package.json +5 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const mapFeatureStream = require('../../../shared/flow-rdf-core.
|
|
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,9 +8,9 @@ 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.
|
|
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');
|
|
@@ -22,8 +22,8 @@ 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
|
|
|
@@ -100,7 +100,7 @@ class MapPluginBase extends EventEmitter.EventEmitter {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function isFeatureWithId(f) {
|
|
103
|
-
return
|
|
103
|
+
return randomId.isDefined(f) && randomId.isDefined(f.source) && randomId.isDefined(f.id);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
var __defProp$a = Object.defineProperty;
|
|
@@ -164,7 +164,7 @@ class MapPopup extends EventEmitter__default {
|
|
|
164
164
|
if (this._maplibrePopup) {
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
if (!
|
|
167
|
+
if (!randomId.isArray(eventOrLngLat)) {
|
|
168
168
|
if (isFeatureWithId(eventOrLngLat.features[0])) {
|
|
169
169
|
feature = eventOrLngLat.features[0];
|
|
170
170
|
}
|
|
@@ -206,7 +206,7 @@ class MapPopup extends EventEmitter__default {
|
|
|
206
206
|
}
|
|
207
207
|
cssClasses() {
|
|
208
208
|
const classes = ["flow-map-popup"];
|
|
209
|
-
if (
|
|
209
|
+
if (randomId.isStringFull(this.options.class)) {
|
|
210
210
|
classes.push(this.options.class);
|
|
211
211
|
}
|
|
212
212
|
if (this.options.closeButton) {
|
|
@@ -241,8 +241,8 @@ class MapPopup extends EventEmitter__default {
|
|
|
241
241
|
}
|
|
242
242
|
renderContent(feature) {
|
|
243
243
|
const state = this.map.context.state;
|
|
244
|
-
const content =
|
|
245
|
-
if (
|
|
244
|
+
const content = randomId.isFunction(this.options.content) ? this.options.content(feature, state) : this.options.content;
|
|
245
|
+
if (randomId.isString(content)) {
|
|
246
246
|
this._contentContainer.innerHTML = content;
|
|
247
247
|
} else if (content instanceof Node) {
|
|
248
248
|
this._contentContainer.innerHTML = "";
|
|
@@ -279,7 +279,7 @@ class PopupPlugin extends MapPluginBase {
|
|
|
279
279
|
popup.once("closed", () => {
|
|
280
280
|
this._popups.delete(popup);
|
|
281
281
|
});
|
|
282
|
-
if (
|
|
282
|
+
if (randomId.isArray(eventOrLngLat)) {
|
|
283
283
|
popup.open(eventOrLngLat, feature);
|
|
284
284
|
} else {
|
|
285
285
|
popup.open(eventOrLngLat);
|
|
@@ -291,7 +291,7 @@ class PopupPlugin extends MapPluginBase {
|
|
|
291
291
|
this._popups.clear();
|
|
292
292
|
}
|
|
293
293
|
closePopupsForSources(sources) {
|
|
294
|
-
sources =
|
|
294
|
+
sources = randomId.ensureArray(sources);
|
|
295
295
|
this._popups.forEach((popup) => {
|
|
296
296
|
if (popup.feature?.source && sources.indexOf(popup.feature?.source) >= 0) {
|
|
297
297
|
popup.close();
|
|
@@ -350,7 +350,7 @@ class SourceSelection {
|
|
|
350
350
|
});
|
|
351
351
|
if (options.selectionState) {
|
|
352
352
|
this._stateSubscription = this._map.context.state.toStream(options.selectionState, true).subscribe((val) => {
|
|
353
|
-
val = new Set(
|
|
353
|
+
val = new Set(randomId.ensureArray(val));
|
|
354
354
|
this.updateSelection(val);
|
|
355
355
|
});
|
|
356
356
|
}
|
|
@@ -456,7 +456,7 @@ class SourceSelection {
|
|
|
456
456
|
);
|
|
457
457
|
}
|
|
458
458
|
updateStateStore() {
|
|
459
|
-
if (
|
|
459
|
+
if (randomId.isStringFull(this._options.selectionState)) {
|
|
460
460
|
const selectedIds = Array.from(this._selectedFeatureIds);
|
|
461
461
|
if (this._options.mode === "single") {
|
|
462
462
|
this._map.context.state.set(this._options.selectionState, selectedIds[0]);
|
|
@@ -496,7 +496,7 @@ class SelectionPlugin extends MapPluginBase {
|
|
|
496
496
|
if (!sourceSelection) {
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
499
|
-
features =
|
|
499
|
+
features = randomId.ensureArray(features);
|
|
500
500
|
const currentSelection = new Set(sourceSelection.selectedFeatureIds);
|
|
501
501
|
switch (sourceSelection.options.mode) {
|
|
502
502
|
case "single":
|
|
@@ -546,7 +546,7 @@ class SelectionPlugin extends MapPluginBase {
|
|
|
546
546
|
if (!sourceSelection) {
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
|
-
features =
|
|
549
|
+
features = randomId.ensureArray(features);
|
|
550
550
|
if (features.length === 0) {
|
|
551
551
|
this.clearSelection(source);
|
|
552
552
|
return;
|
|
@@ -562,7 +562,7 @@ class SelectionPlugin extends MapPluginBase {
|
|
|
562
562
|
sourceSelection.updateSelection(currentSelection);
|
|
563
563
|
break;
|
|
564
564
|
}
|
|
565
|
-
if (sourceSelection.selectedFeatureIds.size &&
|
|
565
|
+
if (sourceSelection.selectedFeatureIds.size && randomId.isStringFull(sourceSelection.options.group)) {
|
|
566
566
|
this._sourceSelections.forEach((s) => {
|
|
567
567
|
if (s != sourceSelection && s.options.clear === "group" && s.options.group == sourceSelection.options.group) {
|
|
568
568
|
s.updateSelection(/* @__PURE__ */ new Set());
|
|
@@ -1278,10 +1278,10 @@ const _AnnotationPlugin = class _AnnotationPlugin extends MapPluginBase {
|
|
|
1278
1278
|
return feature;
|
|
1279
1279
|
}
|
|
1280
1280
|
generateFeatureId(feature) {
|
|
1281
|
-
if (
|
|
1281
|
+
if (randomId.isNumber(feature.id) || randomId.isStringFull(feature.id)) {
|
|
1282
1282
|
return feature.id.toString();
|
|
1283
1283
|
} else {
|
|
1284
|
-
return
|
|
1284
|
+
return randomId.randomId("feature");
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
1287
|
generateFeatureName(feature) {
|
|
@@ -1405,15 +1405,15 @@ const _DataJoin = class _DataJoin {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
start() {
|
|
1407
1407
|
this.stop();
|
|
1408
|
-
if (
|
|
1409
|
-
if (
|
|
1408
|
+
if (randomId.isString(this.options.data)) {
|
|
1409
|
+
if (randomId.isURL(this.options.data))
|
|
1410
1410
|
this.options.data = `'${this.options.data}'`;
|
|
1411
1411
|
this.dataExpression = new mapFeatureStream.ReactiveExpression(this.options.data);
|
|
1412
1412
|
this.dataExpression.bindState(this.map.context.state);
|
|
1413
1413
|
} else {
|
|
1414
1414
|
this.dataExpression = null;
|
|
1415
1415
|
}
|
|
1416
|
-
if (
|
|
1416
|
+
if (randomId.isArrayFull(this.options.parameters)) {
|
|
1417
1417
|
this.parameterExpressions = this.options.parameters.reduce((accum, param) => {
|
|
1418
1418
|
const expr = new mapFeatureStream.ReactiveExpression(param.value.toString());
|
|
1419
1419
|
expr.bindState(this.map.context.state);
|
|
@@ -1425,9 +1425,9 @@ const _DataJoin = class _DataJoin {
|
|
|
1425
1425
|
async () => {
|
|
1426
1426
|
let data = this.dataExpression ? mobx.toJS(this.dataExpression.value) : this.options.data;
|
|
1427
1427
|
const missingParams = this.options.parameters.map(
|
|
1428
|
-
(p) => p.required &&
|
|
1428
|
+
(p) => p.required && randomId.isNil(this.parameterExpressions[p.name].value) ? p.name : void 0
|
|
1429
1429
|
).filter((p) => !!p);
|
|
1430
|
-
if (
|
|
1430
|
+
if (randomId.isNull(data)) {
|
|
1431
1431
|
debug$1(`FlowMap<${this.map.id}>: Skipping data join '${this.id}' (null data)`);
|
|
1432
1432
|
return;
|
|
1433
1433
|
}
|
|
@@ -1436,7 +1436,7 @@ const _DataJoin = class _DataJoin {
|
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
1438
|
debug$1(`FlowMap<${this.map.id}>: Performing data join '${this.id}'`);
|
|
1439
|
-
if (
|
|
1439
|
+
if (randomId.isString(data)) {
|
|
1440
1440
|
try {
|
|
1441
1441
|
data = await this.loadData(data);
|
|
1442
1442
|
} catch (e) {
|
|
@@ -1468,10 +1468,10 @@ const _DataJoin = class _DataJoin {
|
|
|
1468
1468
|
this.map.setFeatureStateBulk({ source: source.id, sourceLayer }, featureData);
|
|
1469
1469
|
}
|
|
1470
1470
|
loadData(datasetOrUrl) {
|
|
1471
|
-
if (
|
|
1471
|
+
if (randomId.isURL(datasetOrUrl)) {
|
|
1472
1472
|
const url = new URL(datasetOrUrl);
|
|
1473
1473
|
const params = new URLSearchParams(url.searchParams);
|
|
1474
|
-
if (
|
|
1474
|
+
if (randomId.isArrayFull(this.options.parameters)) {
|
|
1475
1475
|
this.options.parameters.forEach((p) => {
|
|
1476
1476
|
params.append(p.name, this.parameterExpressions[p.name].value);
|
|
1477
1477
|
});
|
|
@@ -1492,7 +1492,7 @@ const _DataJoin = class _DataJoin {
|
|
|
1492
1492
|
});
|
|
1493
1493
|
} else {
|
|
1494
1494
|
const params = {};
|
|
1495
|
-
if (
|
|
1495
|
+
if (randomId.isArrayFull(this.options.parameters)) {
|
|
1496
1496
|
this.options.parameters.forEach((p) => {
|
|
1497
1497
|
params[p.name] = this.parameterExpressions[p.name].value;
|
|
1498
1498
|
});
|
|
@@ -1588,7 +1588,7 @@ const _MapExporter = class _MapExporter {
|
|
|
1588
1588
|
const mapImage = new Image();
|
|
1589
1589
|
mapImage.onload = () => {
|
|
1590
1590
|
exportContext.drawImage(mapImage, 0, 0);
|
|
1591
|
-
if (
|
|
1591
|
+
if (randomId.isFunction(options.drawOverlayFn)) {
|
|
1592
1592
|
options.drawOverlayFn(
|
|
1593
1593
|
exportContext,
|
|
1594
1594
|
exportCanvas.width,
|
|
@@ -1627,7 +1627,7 @@ const _MapExporter = class _MapExporter {
|
|
|
1627
1627
|
const pixelRatio = exportWidth / copyWidth;
|
|
1628
1628
|
this.setDevicePixelRatio(pixelRatio);
|
|
1629
1629
|
const container = document.createElement("div");
|
|
1630
|
-
container.id =
|
|
1630
|
+
container.id = randomId.randomId("export");
|
|
1631
1631
|
container.classList.add("maplibregl-export-container");
|
|
1632
1632
|
container.style.width = `${copyWidth}px`;
|
|
1633
1633
|
container.style.height = `${copyHeight}px`;
|
|
@@ -1664,7 +1664,7 @@ const _MapExporter = class _MapExporter {
|
|
|
1664
1664
|
createExportCanvas(container, mapCanvas) {
|
|
1665
1665
|
const canvasContainer = container.getElementsByClassName("maplibregl-canvas-container")[0];
|
|
1666
1666
|
const overlayCanvas = document.createElement("canvas");
|
|
1667
|
-
overlayCanvas.id =
|
|
1667
|
+
overlayCanvas.id = randomId.randomId("overlay");
|
|
1668
1668
|
overlayCanvas.width = mapCanvas.width;
|
|
1669
1669
|
overlayCanvas.height = mapCanvas.height;
|
|
1670
1670
|
overlayCanvas.style.position = "absolute";
|
|
@@ -1752,7 +1752,7 @@ class HoverEffectPlugin extends MapPluginBase {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
if (!this.compareFeatures(hoveredFeature, this.hoveredFeature)) {
|
|
1754
1754
|
this.clearHover();
|
|
1755
|
-
if (isFeatureWithId(hoveredFeature) &&
|
|
1755
|
+
if (isFeatureWithId(hoveredFeature) && randomId.isDefined(this.map.getSource(hoveredFeature.source)?.featureId)) {
|
|
1756
1756
|
this.map.setFeatureState(hoveredFeature, { hover: true }, false);
|
|
1757
1757
|
this.hoveredFeature = hoveredFeature;
|
|
1758
1758
|
}
|
|
@@ -1771,7 +1771,7 @@ class HoverEffectPlugin extends MapPluginBase {
|
|
|
1771
1771
|
if (f1 === f2) {
|
|
1772
1772
|
return true;
|
|
1773
1773
|
}
|
|
1774
|
-
if (
|
|
1774
|
+
if (randomId.isObject(f1) && randomId.isObject(f2)) {
|
|
1775
1775
|
return f1.id == f2.id && f1.source === f2.source && f1.sourceLayer == f2.sourceLayer;
|
|
1776
1776
|
}
|
|
1777
1777
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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 {
|
|
2
|
-
export {
|
|
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 {
|
|
2
|
-
export {
|
|
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,
|
|
2
|
-
export { P as PluginManager } from '../../../shared/flow-rdf-core.
|
|
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,9 +7,9 @@ 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.
|
|
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';
|
|
@@ -21,8 +21,8 @@ import saveAs from 'file-saver';
|
|
|
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;
|
package/dist/lib/utils/index.cjs
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const featureTypeChecks = require('../../shared/flow-rdf-core.
|
|
5
|
-
const throttle = require('../../shared/flow-rdf-core.
|
|
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 =
|
|
12
|
-
exports.ensureArray =
|
|
13
|
-
exports.hasLength =
|
|
14
|
-
exports.hasValue =
|
|
15
|
-
exports.isArray =
|
|
16
|
-
exports.isArrayFull =
|
|
17
|
-
exports.isArrayStrings =
|
|
18
|
-
exports.isBoolean =
|
|
19
|
-
exports.isDate =
|
|
20
|
-
exports.isDefined =
|
|
21
|
-
exports.isFalse =
|
|
22
|
-
exports.isFunction =
|
|
23
|
-
exports.isIn =
|
|
24
|
-
exports.isNil =
|
|
25
|
-
exports.isNull =
|
|
26
|
-
exports.isNumber =
|
|
27
|
-
exports.isNumeric =
|
|
28
|
-
exports.isObject =
|
|
29
|
-
exports.isObjectFull =
|
|
30
|
-
exports.isPlainObject =
|
|
31
|
-
exports.isString =
|
|
32
|
-
exports.isStringFull =
|
|
33
|
-
exports.isTrue =
|
|
34
|
-
exports.isURL =
|
|
35
|
-
exports.isUndefined =
|
|
36
|
-
exports.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/lib/utils/index.mjs
CHANGED
|
@@ -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.
|
|
2
|
-
export { i as isLineString, a as isMultiPolygon, b as isPoint, c as isPolygon } from '../../shared/flow-rdf-core.
|
|
3
|
-
export { d as debounce, a as debounceWithArgs, m as memoize, t as throttle, b as throttleWithArgs } from '../../shared/flow-rdf-core.
|
|
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';
|