@corpsmap/corpsmap 3.2.65 → 3.2.68
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/css/corpsmap.css +9746 -9746
- package/lib/corpsmap.css +10185 -0
- package/lib/dev.js +54062 -50250
- package/lib/prod.js +49730 -47128
- package/package.json +20 -19
- package/rollup.config.js +118 -22
- package/src/core-plugins/identify/listeners/geojson.js +106 -99
- package/src/core-plugins/identify-geojson/bundle.js +131 -109
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@corpsmap/corpsmap",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.68",
|
|
4
4
|
"description": "CorpsMap as React Components",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"prepublishOnly": "npm run release",
|
|
8
9
|
"release": "npm run build:dev && npm run build:prod",
|
|
@@ -23,22 +24,22 @@
|
|
|
23
24
|
"babel-plugin-import": "^1.12.2",
|
|
24
25
|
"concurrently": "^5.3.0",
|
|
25
26
|
"cross-env": "^5.2.0",
|
|
26
|
-
"react": "^
|
|
27
|
-
"react-dom": "^
|
|
28
|
-
"rollup": "
|
|
29
|
-
"rollup
|
|
30
|
-
"rollup
|
|
31
|
-
"rollup-plugin-css-only": "
|
|
32
|
-
"rollup
|
|
33
|
-
"rollup
|
|
34
|
-
"rollup-plugin-postcss": "^
|
|
35
|
-
"rollup
|
|
27
|
+
"react": "^17.0.2",
|
|
28
|
+
"react-dom": "^17.0.2",
|
|
29
|
+
"rollup": "4.5.2",
|
|
30
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
31
|
+
"@rollup/plugin-commonjs": "^25.0.2",
|
|
32
|
+
"rollup-plugin-css-only": "4.5.5",
|
|
33
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
35
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
36
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
36
37
|
"styled-jsx": "^3.2.1",
|
|
37
38
|
"wait-on": "^5.2.1"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
|
-
"react": ">=
|
|
41
|
-
"react-dom": ">=
|
|
41
|
+
"react": ">= 17.x.x",
|
|
42
|
+
"react-dom": ">=17.x.x"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@mapbox/togeojson": "^0.16.0",
|
|
@@ -68,17 +69,17 @@
|
|
|
68
69
|
"markdown-it": "^12.0.3",
|
|
69
70
|
"moment": "^2.29.4",
|
|
70
71
|
"money-clip": "^3.0.1",
|
|
71
|
-
"ol": "^6.
|
|
72
|
-
"ol-esri-style": "^2.
|
|
72
|
+
"ol": "^6.5.0",
|
|
73
|
+
"ol-esri-style": "^2.2.1",
|
|
73
74
|
"parse2-kmz": "^1.0.5",
|
|
74
75
|
"proj4": "^2.4.4",
|
|
75
|
-
"react-data-grid": "
|
|
76
|
-
"react-datepicker": "^
|
|
76
|
+
"react-data-grid": "7.0.0-beta.15",
|
|
77
|
+
"react-datepicker": "^3.0.0",
|
|
77
78
|
"react-dnd": "^9.4.0",
|
|
78
79
|
"react-dnd-html5-backend": "^9.4.0",
|
|
79
|
-
"react-notification-system": "^0.
|
|
80
|
+
"react-notification-system-17": "^1.0.1",
|
|
80
81
|
"react-split": "^2.0.7",
|
|
81
|
-
"redux-bundler": "^
|
|
82
|
+
"redux-bundler": "^29.1.0",
|
|
82
83
|
"redux-bundler-react": "^1.2.0",
|
|
83
84
|
"shpjs": "^3.4.3",
|
|
84
85
|
"uuid": "^3.3.3",
|
package/rollup.config.js
CHANGED
|
@@ -1,12 +1,102 @@
|
|
|
1
|
-
import babel from "rollup
|
|
2
|
-
import commonjs from "rollup
|
|
3
|
-
import resolve from "rollup
|
|
4
|
-
import replace from "rollup
|
|
1
|
+
import babel from "@rollup/plugin-babel";
|
|
2
|
+
import commonjs from "@rollup/plugin-commonjs";
|
|
3
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
4
|
+
import replace from "@rollup/plugin-replace";
|
|
5
5
|
import css from "rollup-plugin-css-only";
|
|
6
|
-
import postcss from
|
|
7
|
-
import json from
|
|
8
|
-
import pkg from
|
|
9
|
-
|
|
6
|
+
import postcss from "rollup-plugin-postcss";
|
|
7
|
+
import json from "@rollup/plugin-json";
|
|
8
|
+
// import pkg from "./package.json";
|
|
9
|
+
// import pkg from "./package.json" { type: "json" };
|
|
10
|
+
// const pkg = require("./package.json");
|
|
11
|
+
const pkg = {
|
|
12
|
+
name: "@corpsmap/corpsmap",
|
|
13
|
+
version: "3.2.65",
|
|
14
|
+
description: "CorpsMap as React Components",
|
|
15
|
+
main: "index.js",
|
|
16
|
+
type: "module",
|
|
17
|
+
scripts: {
|
|
18
|
+
prepublishOnly: "npm run release",
|
|
19
|
+
release: "npm run build:dev && npm run build:prod",
|
|
20
|
+
"build:dev": "cross-env NODE_ENV=development rollup -c",
|
|
21
|
+
"build:prod": "cross-env NODE_ENV=production rollup -c",
|
|
22
|
+
dev: "cross-env NODE_ENV=development rollup -c --watch",
|
|
23
|
+
test: 'echo "Error: no test specified" && exit 1',
|
|
24
|
+
"sample-app":
|
|
25
|
+
"wait-on file:lib/dev.js && (cd ../corpsmap-test-app && npm run start)",
|
|
26
|
+
"dev-n-sample": 'concurrently "npm run dev" "npm run sample-app"',
|
|
27
|
+
},
|
|
28
|
+
author: "willbreitkreutz",
|
|
29
|
+
license: "MIT",
|
|
30
|
+
devDependencies: {
|
|
31
|
+
"@babel/core": "^7.5.5",
|
|
32
|
+
"@babel/plugin-proposal-class-properties": "^7.5.5",
|
|
33
|
+
"@babel/preset-env": "^7.5.5",
|
|
34
|
+
"@babel/preset-react": "^7.0.0",
|
|
35
|
+
"babel-plugin-import": "^1.12.2",
|
|
36
|
+
concurrently: "^5.3.0",
|
|
37
|
+
"cross-env": "^5.2.0",
|
|
38
|
+
react: "^17.0.2",
|
|
39
|
+
"react-dom": "^17.0.2",
|
|
40
|
+
rollup: "4.5.2",
|
|
41
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
42
|
+
"@rollup/plugin-commonjs": "^25.0.2",
|
|
43
|
+
"rollup-plugin-css-only": "4.5.5",
|
|
44
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
45
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
46
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
47
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
48
|
+
"styled-jsx": "^3.2.1",
|
|
49
|
+
"wait-on": "^5.2.1",
|
|
50
|
+
},
|
|
51
|
+
peerDependencies: {
|
|
52
|
+
react: ">= 17.x.x",
|
|
53
|
+
"react-dom": ">=17.x.x",
|
|
54
|
+
},
|
|
55
|
+
dependencies: {
|
|
56
|
+
"@mapbox/togeojson": "^0.16.0",
|
|
57
|
+
"@turf/bbox": "^6.0.1",
|
|
58
|
+
"@turf/bbox-polygon": "^6.0.1",
|
|
59
|
+
"@turf/boolean-crosses": "^6.0.1",
|
|
60
|
+
"@turf/boolean-disjoint": "^6.0.2",
|
|
61
|
+
"@turf/boolean-point-in-polygon": "^6.0.1",
|
|
62
|
+
"@turf/buffer": "^5.1.5",
|
|
63
|
+
"@turf/center-of-mass": "^6.0.1",
|
|
64
|
+
"@turf/centroid": "^6.0.2",
|
|
65
|
+
"@turf/distance": "^6.0.1",
|
|
66
|
+
"@turf/flatten": "^5.1.5",
|
|
67
|
+
"@turf/helpers": "^6.1.4",
|
|
68
|
+
"@turf/length": "^6.0.2",
|
|
69
|
+
"@turf/line-slice": "^5.1.5",
|
|
70
|
+
async: "^2.6.1",
|
|
71
|
+
classnames: "^2.2.5",
|
|
72
|
+
css: "^2.2.4",
|
|
73
|
+
decompress: "^4.2.1",
|
|
74
|
+
"extract-files": "^12.0.0",
|
|
75
|
+
"file-saver": "^2.0.2",
|
|
76
|
+
"is-html": "^2.0.0",
|
|
77
|
+
jspdf: "^1.5.3",
|
|
78
|
+
kmljs: "0.0.1",
|
|
79
|
+
lodash: "^4.17.15",
|
|
80
|
+
"markdown-it": "^12.0.3",
|
|
81
|
+
moment: "^2.29.4",
|
|
82
|
+
"money-clip": "^3.0.1",
|
|
83
|
+
ol: "^6.4.3",
|
|
84
|
+
"ol-esri-style": "^2.0.7",
|
|
85
|
+
"parse2-kmz": "^1.0.5",
|
|
86
|
+
proj4: "^2.4.4",
|
|
87
|
+
"react-data-grid": "7.0.0-beta.15",
|
|
88
|
+
"react-datepicker": "^3.0.0",
|
|
89
|
+
"react-dnd": "^9.4.0",
|
|
90
|
+
"react-dnd-html5-backend": "^9.4.0",
|
|
91
|
+
"react-notification-system-17": "^1.0.1",
|
|
92
|
+
"react-split": "^2.0.7",
|
|
93
|
+
"redux-bundler": "^29.1.0",
|
|
94
|
+
"redux-bundler-react": "^1.2.0",
|
|
95
|
+
shpjs: "^3.4.3",
|
|
96
|
+
uuid: "^3.3.3",
|
|
97
|
+
xhr: "^2.5.0",
|
|
98
|
+
},
|
|
99
|
+
};
|
|
10
100
|
|
|
11
101
|
const NODE_ENV = process.env.NODE_ENV || "development";
|
|
12
102
|
const outputFile = NODE_ENV === "production" ? "./lib/prod.js" : "./lib/dev.js";
|
|
@@ -15,36 +105,42 @@ export default {
|
|
|
15
105
|
input: "./src/index.js",
|
|
16
106
|
output: {
|
|
17
107
|
file: outputFile,
|
|
18
|
-
format: "cjs"
|
|
108
|
+
format: "cjs",
|
|
19
109
|
},
|
|
20
110
|
plugins: [
|
|
21
111
|
replace({
|
|
22
|
-
"process.env.NODE_ENV": JSON.stringify(NODE_ENV)
|
|
112
|
+
"process.env.NODE_ENV": JSON.stringify(NODE_ENV),
|
|
113
|
+
//JB Added below
|
|
114
|
+
preventAssignment: true,
|
|
23
115
|
}),
|
|
24
116
|
babel({
|
|
25
|
-
plugins:[[
|
|
26
|
-
extensions: [
|
|
27
|
-
exclude: "node_modules/**"
|
|
117
|
+
plugins: [["import", { libraryName: "antd", style: true }]],
|
|
118
|
+
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
119
|
+
exclude: "node_modules/**",
|
|
28
120
|
}),
|
|
29
121
|
css({
|
|
30
|
-
|
|
122
|
+
//JB
|
|
123
|
+
// output: "./css/corpsmap.css",
|
|
124
|
+
output: "corpsmap.css",
|
|
31
125
|
}),
|
|
32
126
|
resolve({
|
|
33
127
|
module: true,
|
|
34
128
|
jsnext: true,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
129
|
+
//JB
|
|
130
|
+
// customResolveOptions: {
|
|
131
|
+
// moduleDirectory: "node_modules",
|
|
132
|
+
// },
|
|
133
|
+
moduleDirectories: ["node_modules"],
|
|
38
134
|
}),
|
|
39
135
|
json(),
|
|
40
136
|
commonjs(),
|
|
41
137
|
postcss({
|
|
42
|
-
extensions: [
|
|
43
|
-
use: [
|
|
44
|
-
})
|
|
138
|
+
extensions: [".css", ".scss", ".less"],
|
|
139
|
+
use: ["sass", ["less", { javascriptEnabled: true }]],
|
|
140
|
+
}),
|
|
45
141
|
],
|
|
46
142
|
external: [
|
|
47
143
|
...Object.keys(pkg.devDependencies || {}),
|
|
48
|
-
...Object.keys(pkg.peerDependencies || {})
|
|
49
|
-
]
|
|
144
|
+
...Object.keys(pkg.peerDependencies || {}),
|
|
145
|
+
],
|
|
50
146
|
};
|
|
@@ -2,7 +2,8 @@ import buffer from "@turf/buffer";
|
|
|
2
2
|
import { point } from "@turf/helpers";
|
|
3
3
|
import { polygon } from "@turf/helpers";
|
|
4
4
|
import disjoint from "@turf/boolean-disjoint";
|
|
5
|
-
|
|
5
|
+
// JB
|
|
6
|
+
// import { join } from "path";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
name: "geojsonIdent",
|
|
@@ -33,110 +34,116 @@ export default {
|
|
|
33
34
|
};
|
|
34
35
|
},
|
|
35
36
|
|
|
36
|
-
doGeojsonIdentRegister:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
doGeojsonIdentRegister:
|
|
38
|
+
() =>
|
|
39
|
+
({ dispatch, store }) => {
|
|
40
|
+
dispatch({
|
|
41
|
+
type: "GEOJSON_IDENT_REGISTERED",
|
|
42
|
+
payload: { shouldRegister: false },
|
|
43
|
+
});
|
|
44
|
+
store.doIdentifyAddCollection({
|
|
45
|
+
onIdentify: store.doGeojsonIdentFire,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
doGeojsonIdentRemoveFeatures:
|
|
50
|
+
(uid) =>
|
|
51
|
+
({ dispatch, store }) => {
|
|
52
|
+
dispatch({
|
|
53
|
+
type: "GEOJSON_IDENT_HANDLED_REMOVE",
|
|
54
|
+
payload: { shouldHandleRemove: false },
|
|
55
|
+
});
|
|
56
|
+
const uid = store.selectGeojsonRemovedUid();
|
|
57
|
+
const data = store.selectGeojsonIdentFeatures();
|
|
58
|
+
delete data[uid];
|
|
59
|
+
dispatch({
|
|
60
|
+
type: "GEOJSON_IDENT_REMOVED_FEATURES",
|
|
61
|
+
payload: { data: Object.assign({}, data), removedUid: null },
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
doGeojsonIdentAddFeatures:
|
|
66
|
+
(uid, geojson, mapLayer) =>
|
|
67
|
+
({ dispatch, store }) => {
|
|
68
|
+
const data = store.selectGeojsonIdentFeatures();
|
|
69
|
+
|
|
70
|
+
if (!data[uid])
|
|
71
|
+
data[uid] = {
|
|
72
|
+
features: [],
|
|
73
|
+
maplayer: null,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
if (geojson) {
|
|
77
|
+
let newFeatures = [];
|
|
78
|
+
if (geojson.length) {
|
|
79
|
+
newFeatures = geojson;
|
|
80
|
+
} else if (geojson.features) {
|
|
81
|
+
newFeatures = geojson.features;
|
|
82
|
+
} else {
|
|
83
|
+
newFeatures = [geojson];
|
|
84
|
+
}
|
|
85
|
+
data[uid].features = [...data[uid].features, ...newFeatures];
|
|
86
|
+
}
|
|
45
87
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
payload: { shouldHandleRemove: false },
|
|
50
|
-
});
|
|
51
|
-
const uid = store.selectGeojsonRemovedUid();
|
|
52
|
-
const data = store.selectGeojsonIdentFeatures();
|
|
53
|
-
delete data[uid];
|
|
54
|
-
dispatch({
|
|
55
|
-
type: "GEOJSON_IDENT_REMOVED_FEATURES",
|
|
56
|
-
payload: { data: Object.assign({}, data), removedUid: null },
|
|
57
|
-
});
|
|
58
|
-
},
|
|
88
|
+
if (mapLayer) {
|
|
89
|
+
data[uid].mapLayer = mapLayer;
|
|
90
|
+
}
|
|
59
91
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
92
|
+
dispatch({
|
|
93
|
+
type: "GEOJSON_IDENT_ADDED_FEATURES",
|
|
94
|
+
payload: { data: Object.assign({}, data) },
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
doGeojsonIdentFire:
|
|
99
|
+
(callback) =>
|
|
100
|
+
({ dispatch, store }) => {
|
|
101
|
+
const coords = store.selectIdentifyCoordinates();
|
|
102
|
+
const resolution = store.selectResolution();
|
|
103
|
+
const data = store.selectGeojsonIdentFeatures();
|
|
104
|
+
let identifyFeature = null;
|
|
105
|
+
|
|
106
|
+
if (typeof coords[0] === "number") {
|
|
107
|
+
const pt = point(coords);
|
|
108
|
+
const radius = (resolution * 5) / 1000;
|
|
109
|
+
identifyFeature = buffer(pt, radius, {
|
|
110
|
+
units: "kilometers",
|
|
111
|
+
});
|
|
78
112
|
} else {
|
|
79
|
-
|
|
113
|
+
identifyFeature = polygon(coords);
|
|
80
114
|
}
|
|
81
|
-
data[uid].features = [...data[uid].features, ...newFeatures];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (mapLayer) {
|
|
85
|
-
data[uid].mapLayer = mapLayer;
|
|
86
|
-
}
|
|
87
115
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
const out = [];
|
|
112
|
-
|
|
113
|
-
Object.keys(data).forEach((key) => {
|
|
114
|
-
const outFeatures = [];
|
|
115
|
-
const inFeatures = data[key].features;
|
|
116
|
-
const mapLayer = data[key].mapLayer;
|
|
117
|
-
if (mapLayer.getVisible()) {
|
|
118
|
-
inFeatures.forEach((feature) => {
|
|
119
|
-
if (!disjoint(identifyFeature, feature)) outFeatures.push(feature);
|
|
120
|
-
});
|
|
121
|
-
out.push({
|
|
122
|
-
dataset: key,
|
|
123
|
-
err: null,
|
|
124
|
-
result: {
|
|
125
|
-
[key]: {
|
|
126
|
-
type: "FeatureCollection",
|
|
127
|
-
features: outFeatures,
|
|
116
|
+
try {
|
|
117
|
+
const out = [];
|
|
118
|
+
|
|
119
|
+
Object.keys(data).forEach((key) => {
|
|
120
|
+
const outFeatures = [];
|
|
121
|
+
const inFeatures = data[key].features;
|
|
122
|
+
const mapLayer = data[key].mapLayer;
|
|
123
|
+
if (mapLayer.getVisible()) {
|
|
124
|
+
inFeatures.forEach((feature) => {
|
|
125
|
+
if (!disjoint(identifyFeature, feature))
|
|
126
|
+
outFeatures.push(feature);
|
|
127
|
+
});
|
|
128
|
+
out.push({
|
|
129
|
+
dataset: key,
|
|
130
|
+
err: null,
|
|
131
|
+
result: {
|
|
132
|
+
[key]: {
|
|
133
|
+
type: "FeatureCollection",
|
|
134
|
+
features: outFeatures,
|
|
135
|
+
},
|
|
128
136
|
},
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
callback(null, out);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
console.log(err);
|
|
144
|
+
callback(err);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
140
147
|
|
|
141
148
|
selectGeojsonIdentFeatures: (state) => {
|
|
142
149
|
return state.geojsonIdent.data;
|