@corpsmap/corpsmap 3.2.66 → 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/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.2.66",
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": "^16.9.0",
27
- "react-dom": "^16.9.0",
28
- "rollup": "^1.20.2",
29
- "rollup-plugin-babel": "^4.3.3",
30
- "rollup-plugin-commonjs": "^10.1.0",
31
- "rollup-plugin-css-only": "^1.0.0",
32
- "rollup-plugin-json": "^4.0.0",
33
- "rollup-plugin-node-resolve": "^5.2.0",
34
- "rollup-plugin-postcss": "^2.0.3",
35
- "rollup-plugin-replace": "^2.2.0",
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": ">= 16.x.x",
41
- "react-dom": ">=16.x.x"
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.4.3",
72
- "ol-esri-style": "^2.0.7",
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": "^6.1.0",
76
- "react-datepicker": "^2.9.6",
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.2.17",
80
+ "react-notification-system-17": "^1.0.1",
80
81
  "react-split": "^2.0.7",
81
- "redux-bundler": "^26.0.0",
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-plugin-babel";
2
- import commonjs from "rollup-plugin-commonjs";
3
- import resolve from "rollup-plugin-node-resolve";
4
- import replace from "rollup-plugin-replace";
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 'rollup-plugin-postcss';
7
- import json from 'rollup-plugin-json';
8
- import pkg from './package.json';
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:[['import', { libraryName: 'antd', style: true }]],
26
- extensions: ['.js', '.jsx', '.ts', '.tsx'],
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
- output: "./css/corpsmap.css"
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
- customResolveOptions: {
36
- moduleDirectory: 'node_modules'
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: ['.css', '.scss', '.less'],
43
- use: ['sass', ['less', { javascriptEnabled: true }]],
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
  };
@@ -55,16 +55,17 @@ export default {
55
55
  },
56
56
 
57
57
  doSearchChangeLogData: (evt) => ({dispatch, store}) => {
58
- const targetValue = evt.target.value.trim().toUpperCase();
58
+ const targetValue = evt.target.value
59
+ // let logData = store.selectChangeLogItems();
59
60
  let logData = store.selectAllChangeLogItems();
60
- if(targetValue.length > 1){
61
+ if(targetValue.length > 2){
61
62
  const wkLogData = []
62
63
  logData.forEach((item) =>{
63
64
  let wkKey = {}
64
65
  let displayRecord = null;
65
66
  for (const [key, value] of Object.entries(item)){
66
67
  if (typeof value == "string"){
67
- let newObj = value.trim().toUpperCase().includes(targetValue) ? item: false;
68
+ let newObj = value.includes(targetValue) ? item: false;
68
69
  if (newObj){
69
70
  displayRecord = true;
70
71
  }
@@ -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
- import { join } from "path";
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: () => ({ dispatch, store }) => {
37
- dispatch({
38
- type: "GEOJSON_IDENT_REGISTERED",
39
- payload: { shouldRegister: false },
40
- });
41
- store.doIdentifyAddCollection({
42
- onIdentify: store.doGeojsonIdentFire,
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
- doGeojsonIdentRemoveFeatures: (uid) => ({ dispatch, store }) => {
47
- dispatch({
48
- type: "GEOJSON_IDENT_HANDLED_REMOVE",
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
- doGeojsonIdentAddFeatures: (uid, geojson, mapLayer) => ({
61
- dispatch,
62
- store,
63
- }) => {
64
- const data = store.selectGeojsonIdentFeatures();
65
-
66
- if (!data[uid])
67
- data[uid] = {
68
- features: [],
69
- maplayer: null,
70
- };
71
-
72
- if (geojson) {
73
- let newFeatures = [];
74
- if (geojson.length) {
75
- newFeatures = geojson;
76
- } else if (geojson.features) {
77
- newFeatures = geojson.features;
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
- newFeatures = [geojson];
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
- dispatch({
89
- type: "GEOJSON_IDENT_ADDED_FEATURES",
90
- payload: { data: Object.assign({}, data) },
91
- });
92
- },
93
-
94
- doGeojsonIdentFire: (callback) => ({ dispatch, store }) => {
95
- const coords = store.selectIdentifyCoordinates();
96
- const resolution = store.selectResolution();
97
- const data = store.selectGeojsonIdentFeatures();
98
- let identifyFeature = null;
99
-
100
- if (typeof coords[0] === "number") {
101
- const pt = point(coords);
102
- const radius = (resolution * 5) / 1000;
103
- identifyFeature = buffer(pt, radius, {
104
- units: "kilometers",
105
- });
106
- } else {
107
- identifyFeature = polygon(coords);
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
- callback(null, out);
135
- } catch (err) {
136
- console.log(err);
137
- callback(err);
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;