@redus/georedus-ui 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @orioro/template-react
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - fix worker bundle
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - fix worker file bundling and exposure
14
+
3
15
  ## 0.1.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,40 @@
1
+ import * as Comlink from 'comlink';
2
+ import { scaleNaturalBreaks } from '@orioro/scale-util';
3
+ import { flatten, booleanIntersects, union, featureCollection } from '@turf/turf';
4
+
5
+ function dissolveAreasPreservingIsolated(geojson) {
6
+ var features = flatten(geojson).features.filter(Boolean);
7
+ var changed = true;
8
+ // Keep merging until nothing changes
9
+ while (changed) {
10
+ changed = false;
11
+ var merged = [];
12
+ var used = new Array(features.length).fill(false);
13
+ for (var i = 0; i < features.length; i++) {
14
+ if (used[i]) continue;
15
+ var current = features[i];
16
+ for (var j = i + 1; j < features.length; j++) {
17
+ if (used[j]) continue;
18
+ if (booleanIntersects(current, features[j])) {
19
+ var result = union(featureCollection([current, features[j]]));
20
+ if (result) {
21
+ current = result;
22
+ used[j] = true;
23
+ changed = true;
24
+ }
25
+ }
26
+ }
27
+ used[i] = true;
28
+ merged.push(current);
29
+ }
30
+ features = merged;
31
+ }
32
+ return featureCollection(features);
33
+ }
34
+
35
+ // A simple Comlink worker that doubles a number
36
+ var api = {
37
+ scaleNaturalBreaks: scaleNaturalBreaks,
38
+ dissolveAreasPreservingIsolated: dissolveAreasPreservingIsolated
39
+ };
40
+ Comlink.expose(api);
@@ -14,7 +14,7 @@ import { __makeTemplateObject as __makeTemplateObject$2, __rest as __rest$2, __a
14
14
  import remarkMath from 'remark-math';
15
15
  import rehypeKatex from 'rehype-katex';
16
16
  import 'katex/dist/katex.min.css';
17
- import { isPlainObject, pick, omit, set, get as get$1, uniqBy as uniqBy$1, groupBy as groupBy$1 } from 'lodash';
17
+ import { isPlainObject, pick, omit, set, get as get$1, uniqBy as uniqBy$1, groupBy as groupBy$1, uniq as uniq$1 } from 'lodash';
18
18
  import { useDebounce } from 'react-use';
19
19
  import { createDialogSystem, DIALOGS } from '@orioro/react-dialogs';
20
20
  import { CsvImportDialog } from '@orioro/react-csv';
@@ -2856,7 +2856,7 @@ function Legend(_a) {
2856
2856
  return /*#__PURE__*/React$1.createElement(Component, _assign({}, props));
2857
2857
  }
2858
2858
 
2859
- var worker = typeof Worker !== 'undefined' && new Worker(new URL('./GeoReDUSWorker.worker.ts', import.meta.url), {
2859
+ var worker = typeof Worker !== 'undefined' && new Worker(new URL('./GeoReDUSWorker.worker.js', import.meta.url), {
2860
2860
  type: 'module'
2861
2861
  });
2862
2862
  var GeoReDUSWorker = worker ? wrap(worker) : null;
@@ -7582,7 +7582,7 @@ function _parseGeoFileMetadata() {
7582
7582
  case 2:
7583
7583
  contents = _context2.sent;
7584
7584
  geoJson = JSON.parse(contents);
7585
- geometryTypes = geoJson.type === 'FeatureCollection' ? uniq((geoJson.features || []).map(function (feature) {
7585
+ geometryTypes = geoJson.type === 'FeatureCollection' ? uniq$1((geoJson.features || []).map(function (feature) {
7586
7586
  var _feature$geometry;
7587
7587
  return (_feature$geometry = feature.geometry) === null || _feature$geometry === void 0 ? void 0 : _feature$geometry.type;
7588
7588
  })).filter(Boolean) : [];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@redus/georedus-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
- "main": "dist/index.mjs",
6
+ "main": "dist/main.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
- ".": "./dist/index.mjs",
9
+ ".": "./dist/main.mjs",
10
10
  "./*": "./dist/*"
11
11
  },
12
12
  "files": [
@@ -1 +0,0 @@
1
- export {};