agvmap-react 0.1.38 → 0.1.40-43
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/README.md +0 -37
- package/dist/LazyModalContent-DmuBEB7X.js +196 -0
- package/dist/agviewermap-react.js +4 -0
- package/dist/agviewermap-react.umd.cjs +1364 -0
- package/dist/{index-D16caLkt.js → index-D0e1C1Q0.js} +37645 -36990
- package/dist/style.css +1 -1
- package/package.json +18 -9
- package/dist/LazyModalContent-Dx3sMuo5.js +0 -197
- package/dist/agvmap-react.js +0 -4
- package/dist/agvmap-react.umd.cjs +0 -1335
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agvmap-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40-43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/agvmap-react.umd.cjs",
|
|
6
6
|
"module": "dist/agvmap-react.js",
|
|
@@ -15,17 +15,13 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"dev": "vite --port
|
|
18
|
+
"dev": "vite --port 3000",
|
|
19
19
|
"prepublish": "rm -rf ./dist && npm run build",
|
|
20
20
|
"build": "vite build",
|
|
21
21
|
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
|
22
22
|
"preview": "vite preview",
|
|
23
23
|
"release": "npm version patch && npm publish --access public --tag beta && npm dist-tag add agvmap-react@$(npm pkg get version | tr -d '\"') latest"
|
|
24
24
|
},
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
27
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
28
|
-
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@floating-ui/react-dom": "^2.1.2",
|
|
31
27
|
"@mapbox/mapbox-gl-draw": "^1.4.3",
|
|
@@ -58,8 +54,10 @@
|
|
|
58
54
|
"maplibre-gl": "^4.5.0",
|
|
59
55
|
"next-themes": "^0.4.4",
|
|
60
56
|
"proj4": "^2.12.0",
|
|
57
|
+
"react": "^18.3.1",
|
|
61
58
|
"react-confirm": "^0.3",
|
|
62
59
|
"react-day-picker": "^9.8.1",
|
|
60
|
+
"react-dom": "^18.3.1",
|
|
63
61
|
"react-icons": "^5.2.1",
|
|
64
62
|
"react-intl": "^5.25.1",
|
|
65
63
|
"react-map-gl": "^7.1.7",
|
|
@@ -80,6 +78,7 @@
|
|
|
80
78
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
81
79
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
82
80
|
"@rollup/plugin-terser": "^0.4.4",
|
|
81
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
83
82
|
"@types/react": "^18.3.3",
|
|
84
83
|
"@types/react-dom": "^18.3.0",
|
|
85
84
|
"@vitejs/plugin-react": "^4.3.1",
|
|
@@ -89,13 +88,23 @@
|
|
|
89
88
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
90
89
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
91
90
|
"postcss": "^8.4.41",
|
|
92
|
-
"react": "^18.3.1",
|
|
93
|
-
"react-dom": "^18.3.1",
|
|
94
91
|
"rollup": "^4.32.1",
|
|
95
92
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
96
|
-
"tailwindcss": "^3.
|
|
93
|
+
"tailwindcss": "^4.3.3",
|
|
97
94
|
"vite": "^5.3.4"
|
|
98
95
|
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"tailwindcss": "^4.3.3",
|
|
98
|
+
"@tailwindcss/postcss": "^4.3.3"
|
|
99
|
+
},
|
|
100
|
+
"peerDependenciesMeta": {
|
|
101
|
+
"tailwindcss": {
|
|
102
|
+
"optional": false
|
|
103
|
+
},
|
|
104
|
+
"@tailwindcss/postcss": {
|
|
105
|
+
"optional": false
|
|
106
|
+
}
|
|
107
|
+
},
|
|
99
108
|
"keywords": [
|
|
100
109
|
"agviewermap",
|
|
101
110
|
"evapotranspiration",
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { useState as g, useContext as H, useCallback as d, useRef as P, useMemo as w, useEffect as U } from "react";
|
|
3
|
-
import { M as V, u as W, a as O, B as q, T as y, b as G, C as J, c as K, d as Q, t as X, S as Y, e as Z, I as $, f as D, g as L, h as ee } from "./index-D16caLkt.js";
|
|
4
|
-
const ae = (a) => /* @__PURE__ */ l(
|
|
5
|
-
"svg",
|
|
6
|
-
{
|
|
7
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
-
width: 20,
|
|
9
|
-
height: 20,
|
|
10
|
-
viewBox: "0 0 20 20",
|
|
11
|
-
fill: "none",
|
|
12
|
-
...a,
|
|
13
|
-
children: [
|
|
14
|
-
/* @__PURE__ */ e(
|
|
15
|
-
"path",
|
|
16
|
-
{
|
|
17
|
-
stroke: "#373737",
|
|
18
|
-
strokeLinecap: "round",
|
|
19
|
-
strokeLinejoin: "round",
|
|
20
|
-
strokeWidth: 2,
|
|
21
|
-
d: "m5.833 14.167 8.334-8.334"
|
|
22
|
-
}
|
|
23
|
-
),
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
"path",
|
|
26
|
-
{
|
|
27
|
-
stroke: "#000",
|
|
28
|
-
strokeLinecap: "round",
|
|
29
|
-
strokeLinejoin: "round",
|
|
30
|
-
strokeWidth: 2,
|
|
31
|
-
d: "M5.833 5.833h8.334v8.334"
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
), te = ({ marker: a, markerId: v, buttonClassName: u = "" }) => {
|
|
37
|
-
const [c, i] = g(!1), { handleMarkerUpdate: s } = H(V), h = W(), M = d(() => {
|
|
38
|
-
i((f) => !f);
|
|
39
|
-
}, []), m = (f) => s(f);
|
|
40
|
-
return /* @__PURE__ */ e(
|
|
41
|
-
O,
|
|
42
|
-
{
|
|
43
|
-
trigger: /* @__PURE__ */ e(q, { variant: "outline", size: "icon", tabIndex: -1, children: /* @__PURE__ */ e(
|
|
44
|
-
y,
|
|
45
|
-
{
|
|
46
|
-
text: h.formatMessage({
|
|
47
|
-
id: "app.agviewer_map.edit_marker",
|
|
48
|
-
defaultMessage: "Edit Marker"
|
|
49
|
-
}),
|
|
50
|
-
children: /* @__PURE__ */ e(G, { className: "w-5 h-5 action-icon" })
|
|
51
|
-
}
|
|
52
|
-
) }),
|
|
53
|
-
title: h.formatMessage({
|
|
54
|
-
id: "app.agviewer_map.edit_marker",
|
|
55
|
-
defaultMessage: "Edit Marker"
|
|
56
|
-
}),
|
|
57
|
-
open: c,
|
|
58
|
-
setOpen: i,
|
|
59
|
-
headerClassName: "m-4",
|
|
60
|
-
onClose: M,
|
|
61
|
-
children: /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
|
|
62
|
-
K,
|
|
63
|
-
{
|
|
64
|
-
marker: a,
|
|
65
|
-
onSubmit: m,
|
|
66
|
-
onCancel: M,
|
|
67
|
-
submitButtonText: h.formatMessage({
|
|
68
|
-
id: "app.agviewer_map.save_changes",
|
|
69
|
-
defaultMessage: "Save Changes"
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
) })
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}, se = ({ marker: a, onMarkerClick: v, onDeleteMarker: u, markersData: c, intl: i }) => /* @__PURE__ */ e("div", { className: "marker-item rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 p-2 mb-2", children: /* @__PURE__ */ e("div", { className: "marker-item-info", children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center gap-2", children: [
|
|
76
|
-
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
77
|
-
/* @__PURE__ */ e(D, { className: "h-4 w-4 text-primary flex-shrink-0" }),
|
|
78
|
-
/* @__PURE__ */ e("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200 break-words leading-tight", children: a == null ? void 0 : a.title })
|
|
79
|
-
] }),
|
|
80
|
-
/* @__PURE__ */ l("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
81
|
-
/* @__PURE__ */ e(y, { text: i.formatMessage({ id: "app.agviewer_map.focus_marker", defaultMessage: "Focus on the marker" }), children: /* @__PURE__ */ e(
|
|
82
|
-
L,
|
|
83
|
-
{
|
|
84
|
-
variant: "icon",
|
|
85
|
-
className: "rounded-full p-1 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
86
|
-
onClick: (s) => v(s, a),
|
|
87
|
-
"data-marker-id": a.id,
|
|
88
|
-
children: /* @__PURE__ */ e(ae, { className: "w-4 h-4" })
|
|
89
|
-
}
|
|
90
|
-
) }),
|
|
91
|
-
/* @__PURE__ */ e(y, { text: i.formatMessage({ id: "app.agviewer_map.delete_marker", defaultMessage: "Delete Marker" }), children: /* @__PURE__ */ e(
|
|
92
|
-
L,
|
|
93
|
-
{
|
|
94
|
-
variant: "icon",
|
|
95
|
-
className: "rounded-full p-1 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
96
|
-
onClick: (s) => u(s, a),
|
|
97
|
-
"data-marker-id": a.id,
|
|
98
|
-
children: /* @__PURE__ */ e(ee, { className: "w-4 h-4 text-red-500" })
|
|
99
|
-
}
|
|
100
|
-
) }),
|
|
101
|
-
/* @__PURE__ */ e(
|
|
102
|
-
te,
|
|
103
|
-
{
|
|
104
|
-
marker: c.find((s) => s.id === a.id)
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
] })
|
|
108
|
-
] }) }) });
|
|
109
|
-
function oe({
|
|
110
|
-
markersData: a,
|
|
111
|
-
loading: v,
|
|
112
|
-
handleDeleteMarker: u,
|
|
113
|
-
onMarkerClick: c,
|
|
114
|
-
onClose: i,
|
|
115
|
-
intl: s
|
|
116
|
-
}) {
|
|
117
|
-
const [h, M] = g(""), [m, f] = g(""), [T, k] = g(!1), [o, _] = g(20), [p, C] = g(!1), j = P(null), S = d(
|
|
118
|
-
Q((t) => {
|
|
119
|
-
f(t), k(!1);
|
|
120
|
-
}, 300),
|
|
121
|
-
[]
|
|
122
|
-
), B = d((t) => {
|
|
123
|
-
const r = t.target.value;
|
|
124
|
-
M(r), k(!0), S(r);
|
|
125
|
-
}, [S]), b = w(() => !a || a.length === 0 ? [] : a.map((t) => X(t)), [a]), n = w(() => {
|
|
126
|
-
if (!m) return b;
|
|
127
|
-
const t = m.toLowerCase();
|
|
128
|
-
return b.filter(
|
|
129
|
-
(r) => {
|
|
130
|
-
var x, N;
|
|
131
|
-
return (N = (x = r == null ? void 0 : r.title) == null ? void 0 : x.toLowerCase()) == null ? void 0 : N.includes(t);
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
}, [b, m]), E = w(() => n.slice(0, o), [n, o]);
|
|
135
|
-
U(() => {
|
|
136
|
-
_(20);
|
|
137
|
-
}, [m]);
|
|
138
|
-
const I = d(() => {
|
|
139
|
-
p || o >= n.length || (C(!0), setTimeout(() => {
|
|
140
|
-
_((t) => Math.min(t + 20, n.length)), C(!1);
|
|
141
|
-
}, 300));
|
|
142
|
-
}, [p, o, n.length]), F = d((t) => {
|
|
143
|
-
const { scrollTop: r, scrollHeight: x, clientHeight: N } = t.target;
|
|
144
|
-
r + N >= x - 100 && !p && o < n.length && I();
|
|
145
|
-
}, [I, p, o, n.length]), R = d((t, r) => {
|
|
146
|
-
c(t, r), i();
|
|
147
|
-
}, [c, i]), z = d((t, r) => {
|
|
148
|
-
u(t, r);
|
|
149
|
-
}, [u]);
|
|
150
|
-
return v ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-40", children: /* @__PURE__ */ e(Y, {}) }) : /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
151
|
-
/* @__PURE__ */ l("div", { className: "relative mb-4", children: [
|
|
152
|
-
/* @__PURE__ */ e(Z, { className: "w-4 h-4 text-gray-500 absolute left-3 top-1/2 transform -translate-y-1/2" }),
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
$,
|
|
155
|
-
{
|
|
156
|
-
className: "pl-9 w-full text-sm h-9",
|
|
157
|
-
placeholder: s.formatMessage({ id: "app.agviewer_map.search_station", defaultMessage: "Search Station" }),
|
|
158
|
-
value: h,
|
|
159
|
-
onChange: B
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
T && /* @__PURE__ */ e("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" }) })
|
|
163
|
-
] }),
|
|
164
|
-
/* @__PURE__ */ e(
|
|
165
|
-
"div",
|
|
166
|
-
{
|
|
167
|
-
ref: j,
|
|
168
|
-
className: "overflow-y-auto h-[350px]",
|
|
169
|
-
onScroll: F,
|
|
170
|
-
children: n.length === 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-20 p-4", children: /* @__PURE__ */ e("h5", { className: "text-sm text-gray-500 dark:text-gray-400", children: h ? s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) : s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) }) }) : /* @__PURE__ */ l(A, { children: [
|
|
171
|
-
E.map((t) => /* @__PURE__ */ e(
|
|
172
|
-
se,
|
|
173
|
-
{
|
|
174
|
-
marker: t,
|
|
175
|
-
onMarkerClick: R,
|
|
176
|
-
onDeleteMarker: z,
|
|
177
|
-
markersData: a,
|
|
178
|
-
intl: s
|
|
179
|
-
},
|
|
180
|
-
t.id
|
|
181
|
-
)),
|
|
182
|
-
p && /* @__PURE__ */ e("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
183
|
-
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" }),
|
|
184
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading more..." })
|
|
185
|
-
] }) }),
|
|
186
|
-
o >= n.length && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: s.formatMessage({
|
|
187
|
-
id: "app.agviewer_map.all_results_loaded",
|
|
188
|
-
defaultMessage: "All results loaded"
|
|
189
|
-
}) }) })
|
|
190
|
-
] })
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
] });
|
|
194
|
-
}
|
|
195
|
-
export {
|
|
196
|
-
oe as default
|
|
197
|
-
};
|
package/dist/agvmap-react.js
DELETED