@hybridcore/ui 1.5.30 → 1.5.32

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.
@@ -1,6 +1,6 @@
1
- import { d as w, b as v, W as j, f as ae, c as le, h as N, I as he, u as ce, E as O, i as m, j as oe, g as ue } from "./has-9_asnBxn.js";
1
+ import { a as w, c as v, W as $, B as ae, b as le, l as N, I as he, u as ce, E as O, d as m, T as oe, g as ue } from "./has-DNclCIDV.js";
2
2
  const ge = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i, fe = /^([a-z]*)$|^hsla?\(.*\)$/i;
3
- function $(i) {
3
+ function j(i) {
4
4
  return typeof i == "string" ? i : ee(i);
5
5
  }
6
6
  function de(i) {
@@ -123,7 +123,7 @@ class ye {
123
123
  }
124
124
  }
125
125
  function X(i, e, t) {
126
- const n = t ? $(t) : "null";
126
+ const n = t ? j(t) : "null";
127
127
  return e + ":" + i + ":" + n;
128
128
  }
129
129
  const U = new ye(), Me = "ol-hidden", Ee = "ol-unselectable", Re = "ol-control", be = "ol-collapsed", Se = new RegExp(
@@ -166,7 +166,7 @@ const U = new ye(), Me = "ol-hidden", Ee = "ol-unselectable", Re = "ol-control",
166
166
  };
167
167
  function L(i, e, t, n) {
168
168
  let s;
169
- return t && t.length ? s = t.shift() : j ? s = new OffscreenCanvas(i || 300, e || 300) : s = document.createElement("canvas"), i && (s.width = i), e && (s.height = e), /** @type {CanvasRenderingContext2D} */
169
+ return t && t.length ? s = t.shift() : $ ? s = new OffscreenCanvas(i || 300, e || 300) : s = document.createElement("canvas"), i && (s.width = i), e && (s.height = e), /** @type {CanvasRenderingContext2D} */
170
170
  s.getContext("2d", n);
171
171
  }
172
172
  function Fe(i) {
@@ -252,7 +252,7 @@ const P = {}, Ge = function() {
252
252
  return function(e) {
253
253
  let t = P[e];
254
254
  if (t == null) {
255
- if (j) {
255
+ if ($) {
256
256
  const n = te(e), s = ie(e, "Žg");
257
257
  t = (isNaN(Number(n.lineHeight)) ? 1.2 : Number(n.lineHeight)) * (s.actualBoundingBoxAscent + s.actualBoundingBoxDescent);
258
258
  } else
@@ -333,6 +333,9 @@ function Ce(i, e) {
333
333
  function Ke(i) {
334
334
  return i[0] > 0 && i[1] > 0;
335
335
  }
336
+ function $e(i, e, t) {
337
+ return t === void 0 && (t = [0, 0]), t[0] = i[0] * e + 0.5 | 0, t[1] = i[1] * e + 0.5 | 0, t;
338
+ }
336
339
  function M(i, e) {
337
340
  return Array.isArray(i) ? i : (e === void 0 ? e = [i, i] : (e[0] = i, e[1] = i), e);
338
341
  }
@@ -733,7 +736,7 @@ class ze extends oe {
733
736
  const t = this.image_, n = document.createElement("canvas");
734
737
  n.width = Math.ceil(t.width * e), n.height = Math.ceil(t.height * e);
735
738
  const s = n.getContext("2d");
736
- s.scale(e, e), s.drawImage(t, 0, 0), s.globalCompositeOperation = "multiply", s.fillStyle = $(this.color_), s.fillRect(0, 0, n.width / e, n.height / e), s.globalCompositeOperation = "destination-in", s.drawImage(t, 0, 0), this.canvas_[e] = n;
739
+ s.scale(e, e), s.drawImage(t, 0, 0), s.globalCompositeOperation = "multiply", s.fillStyle = j(this.color_), s.fillRect(0, 0, n.width / e, n.height / e), s.globalCompositeOperation = "destination-in", s.drawImage(t, 0, 0), this.canvas_[e] = n;
737
740
  }
738
741
  /**
739
742
  * Discards event handlers which listen for load completion or errors.
@@ -1712,7 +1715,7 @@ function je(i) {
1712
1715
  return e;
1713
1716
  }
1714
1717
  let W = null;
1715
- function $e(i, e) {
1718
+ function Qe(i, e) {
1716
1719
  if (!W) {
1717
1720
  const t = new C({
1718
1721
  color: "rgba(255,255,255,0.4)"
@@ -1734,7 +1737,7 @@ function $e(i, e) {
1734
1737
  }
1735
1738
  return W;
1736
1739
  }
1737
- function Qe() {
1740
+ function et() {
1738
1741
  const i = {}, e = [255, 255, 255, 1], t = [0, 153, 255, 1], n = 3;
1739
1742
  return i.Polygon = [
1740
1743
  new S({
@@ -2145,48 +2148,49 @@ class se {
2145
2148
  }
2146
2149
  }
2147
2150
  export {
2148
- Je as A,
2149
- p as B,
2151
+ Ne as A,
2152
+ Je as B,
2150
2153
  R as C,
2151
- we as D,
2152
- Ie as E,
2154
+ p as D,
2155
+ we as E,
2153
2156
  C as F,
2154
- Ye as G,
2155
- Xe as H,
2157
+ Ie as G,
2158
+ Ye as H,
2156
2159
  ne as I,
2157
- Ue as J,
2158
- He as K,
2159
- Ge as L,
2160
- qe as M,
2161
- Ze as N,
2162
- pe as O,
2160
+ Xe as J,
2161
+ Ue as K,
2162
+ He as L,
2163
+ Ge as M,
2164
+ qe as N,
2165
+ Ze as O,
2166
+ pe as P,
2163
2167
  V as R,
2164
2168
  S,
2165
2169
  se as T,
2166
2170
  A as a,
2167
- y as b,
2168
- Qe as c,
2169
- Ee as d,
2170
- Te as e,
2171
- Re as f,
2172
- be as g,
2173
- Pe as h,
2174
- We as i,
2175
- Me as j,
2176
- Ke as k,
2177
- _ as l,
2178
- Q as m,
2179
- L as n,
2180
- ke as o,
2181
- Fe as p,
2182
- je as q,
2171
+ U as b,
2172
+ et as c,
2173
+ y as d,
2174
+ Ee as e,
2175
+ Te as f,
2176
+ Re as g,
2177
+ be as h,
2178
+ Pe as i,
2179
+ We as j,
2180
+ Me as k,
2181
+ Ke as l,
2182
+ _ as m,
2183
+ Q as n,
2184
+ L as o,
2185
+ ke as p,
2186
+ Fe as q,
2183
2187
  Ve as r,
2184
- U as s,
2188
+ $e as s,
2185
2189
  M as t,
2186
- $e as u,
2187
- Z as v,
2188
- G as w,
2189
- De as x,
2190
- Be as y,
2191
- Ne as z
2190
+ je as u,
2191
+ Qe as v,
2192
+ Z as w,
2193
+ G as x,
2194
+ De as y,
2195
+ Be as z
2192
2196
  };
@@ -2,7 +2,7 @@ import { jsxs as l, Fragment as p, jsx as o } from "react/jsx-runtime";
2
2
  import { Button as a, Box as f } from "@mui/material";
3
3
  import u from "../map/index.js";
4
4
  import C from "../parser/index.js";
5
- import { g as y, c as h } from "../../../ol-9hySGI6D.js";
5
+ import { g as y, c as h } from "../../../ol-lGwSyEIV.js";
6
6
  import { useState as g } from "react";
7
7
  import { Add as P } from "@mui/icons-material";
8
8
  import { parse as v, convert as x } from "../../map/helpers/wkt.js";
@@ -1,71 +1,56 @@
1
- import { jsxs as a, jsx as r, Fragment as x } from "react/jsx-runtime";
2
- import E, { useState as F, useEffect as T } from "react";
3
- import { Dialog as w, DialogContent as K, DialogActions as j, Button as c, Box as O } from "@mui/material";
4
- import g from "../map/index.js";
5
- import { c as P, a as R } from "../../../ol-9hySGI6D.js";
6
- import { parse as S } from "../../map/helpers/wkt.js";
7
- import _ from "lodash";
8
- import { t as B } from "../../../Source-CnCcu5UP.js";
9
- function z({
10
- value: y,
11
- disableActions: D,
12
- mapboxAccessToken: s,
13
- variant: W = "inline",
14
- mapId: f,
15
- onCancel: l,
16
- onSubmit: u,
17
- onChange: d
1
+ import { jsxs as t, jsx as i, Fragment as D } from "react/jsx-runtime";
2
+ import k, { useState as x } from "react";
3
+ import { Dialog as W, DialogContent as w, DialogActions as y, Button as e, Box as j } from "@mui/material";
4
+ import m from "../map/index.js";
5
+ import { c as K } from "../../../ol-lGwSyEIV.js";
6
+ function F({
7
+ value: h,
8
+ disableActions: p,
9
+ mapboxAccessToken: o,
10
+ variant: v = "inline",
11
+ mapId: a,
12
+ onCancel: n,
13
+ onSubmit: l,
14
+ onChange: c
18
15
  }) {
19
- const t = E.useRef(null), [n, k] = F(y), m = () => {
20
- u && u(n);
21
- }, p = (e) => {
22
- const o = P({ features: e });
23
- k(o), d && d(o);
24
- }, h = () => {
25
- var o, v, C;
26
- const e = S(n);
27
- if (!_.isArray(e))
28
- if ((e == null ? void 0 : e.type) === "Point") {
29
- const i = B(e.coordinates, "EPSG:4326", "EPSG:3857");
30
- (o = t.current) == null || o.setCenter(i), (v = t.current) == null || v.setZoomLevel(10);
31
- } else {
32
- const i = R(n);
33
- i && ((C = t.current) == null || C.centerToFeature(i[0], [100, 100, 100, 100]));
34
- }
16
+ const d = k.useRef(null), [r, g] = x(h), f = () => {
17
+ l && l(r);
18
+ }, s = (C) => {
19
+ const u = K({ features: C });
20
+ g(u), c && c(u);
35
21
  };
36
- return T(() => (h(), () => {
37
- }), [h]), W === "dialog" ? /* @__PURE__ */ a(w, { open: !0, maxWidth: "sm", fullWidth: !0, onClose: l, children: [
38
- /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(
39
- g,
22
+ return v === "dialog" ? /* @__PURE__ */ t(W, { open: !0, maxWidth: "sm", fullWidth: !0, onClose: n, children: [
23
+ /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(
24
+ m,
40
25
  {
41
- id: f,
42
- ref: t,
43
- drawingWKTData: n,
44
- mapboxAccessToken: s,
45
- onDrawEnd: p
26
+ id: a,
27
+ ref: d,
28
+ drawingWKTData: r,
29
+ mapboxAccessToken: o,
30
+ onDrawEnd: s
46
31
  }
47
32
  ) }),
48
- /* @__PURE__ */ a(j, { children: [
49
- /* @__PURE__ */ r(c, { color: "inherit", variant: "contained", onClick: l, children: "Cancel" }),
50
- /* @__PURE__ */ r(c, { variant: "contained", onClick: m, children: "Ok" })
33
+ /* @__PURE__ */ t(y, { children: [
34
+ /* @__PURE__ */ i(e, { color: "inherit", variant: "contained", onClick: n, children: "Cancel" }),
35
+ /* @__PURE__ */ i(e, { variant: "contained", onClick: f, children: "Ok" })
51
36
  ] })
52
- ] }) : /* @__PURE__ */ a(x, { children: [
53
- /* @__PURE__ */ r(
54
- g,
37
+ ] }) : /* @__PURE__ */ t(D, { children: [
38
+ /* @__PURE__ */ i(
39
+ m,
55
40
  {
56
- id: f,
57
- ref: t,
58
- drawingWKTData: n,
59
- mapboxAccessToken: s,
60
- onDrawEnd: p
41
+ id: a,
42
+ ref: d,
43
+ drawingWKTData: r,
44
+ mapboxAccessToken: o,
45
+ onDrawEnd: s
61
46
  }
62
47
  ),
63
- !D && /* @__PURE__ */ a(O, { display: "flex", justifyContent: "space-between", mt: 3, children: [
64
- /* @__PURE__ */ r(c, { color: "primary", onClick: l, children: "Cancel" }),
65
- /* @__PURE__ */ r(c, { color: "primary", variant: "contained", onClick: m, children: "Ok" })
48
+ !p && /* @__PURE__ */ t(j, { display: "flex", justifyContent: "space-between", mt: 3, children: [
49
+ /* @__PURE__ */ i(e, { color: "primary", onClick: n, children: "Cancel" }),
50
+ /* @__PURE__ */ i(e, { color: "primary", variant: "contained", onClick: f, children: "Ok" })
66
51
  ] })
67
52
  ] });
68
53
  }
69
54
  export {
70
- z as default
55
+ F as default
71
56
  };
@@ -3,7 +3,7 @@ import D, { useState as k } from "react";
3
3
  import { Dialog as R, DialogContent as K, Box as o, Typography as x, DialogActions as F, Button as d } from "@mui/material";
4
4
  import P from "../map/index.js";
5
5
  import b from "../parser/index.js";
6
- import { c as _ } from "../../../ol-9hySGI6D.js";
6
+ import { c as _ } from "../../../ol-lGwSyEIV.js";
7
7
  import { Button as l } from "../styled.js";
8
8
  import { HorizontalRule as j, ShowChart as O, CircleOutlined as I } from "@mui/icons-material";
9
9
  import L from "./map-overlay.js";
@@ -10,7 +10,7 @@ function d({ show: r }) {
10
10
  height: "100%",
11
11
  justifyContent: "center",
12
12
  alignItems: "center",
13
- sx: { backgroundColor: "rgba(0,0,0,0.85)" },
13
+ sx: { backgroundColor: "rgba(0,0,0,0.5)" },
14
14
  children: /* @__PURE__ */ t(i, { color: "white", children: "Select drawing type to start drawing" })
15
15
  }
16
16
  ),
@@ -1,39 +1,38 @@
1
1
  import { jsx as o, jsxs as i, Fragment as s } from "react/jsx-runtime";
2
2
  import { EditOutlined as f, DeleteOutline as D, AddLocationOutlined as I, DrawOutlined as A, LayersOutlined as p } from "@mui/icons-material";
3
- import { Container as O, Actions as S, Button as d } from "./styled.js";
4
- import y from "./logic.js";
5
- import k from "./coordinate/index.js";
6
- import E from "./edit/index.js";
7
- import b from "./geometry/index.js";
3
+ import { Container as O, Actions as k, Button as l } from "./styled.js";
4
+ import S from "./logic.js";
5
+ import y from "./coordinate/index.js";
6
+ import b from "./edit/index.js";
7
+ import E from "./geometry/index.js";
8
8
  import g from "./kml/index.js";
9
9
  import W from "./wkt/index.js";
10
- import { IconButton as u, OutlinedInput as K, FilledInput as L, Dialog as z, DialogTitle as F, DialogContent as G } from "@mui/material";
11
- import { I as w } from "../../InputAdornment-BAVRrRts.js";
12
- import { F as B, I as M } from "../../InputLabel-ClDXuWBr.js";
13
- import { I as T } from "../../Input-BAbDr3Tk.js";
10
+ import { IconButton as u, OutlinedInput as K, FilledInput as L, Dialog as z, DialogTitle as B, DialogContent as F } from "@mui/material";
11
+ import { I as G } from "../../InputAdornment-BAVRrRts.js";
12
+ import { F as T, I as w } from "../../InputLabel-ClDXuWBr.js";
13
+ import { I as M } from "../../Input-BAbDr3Tk.js";
14
14
  const Z = ({
15
- label: c,
16
- mapboxAccessToken: l,
15
+ label: d,
16
+ mapboxAccessToken: c,
17
17
  value: e = "",
18
18
  disableAddCoordinate: h = !1,
19
19
  defaultExtent: a,
20
20
  variant: r = "outlined",
21
21
  onChange: C
22
22
  }) => {
23
- const { state: t, action: n } = y({
24
- label: c,
23
+ const { state: t, action: n } = S({
24
+ label: d,
25
25
  value: e,
26
- mapboxAccessToken: l,
27
26
  onChange: C
28
- }), m = /* @__PURE__ */ o(w, { position: "end", children: e !== "" && /* @__PURE__ */ i(s, { children: [
27
+ }), m = /* @__PURE__ */ o(G, { position: "end", children: e !== "" && /* @__PURE__ */ i(s, { children: [
29
28
  /* @__PURE__ */ o(u, { size: "small", onClick: n.onEdit, children: /* @__PURE__ */ o(f, { fontSize: "small" }) }),
30
29
  /* @__PURE__ */ o(u, { size: "small", onClick: n.onDelete, children: /* @__PURE__ */ o(D, { fontSize: "small" }) })
31
30
  ] }) });
32
31
  return /* @__PURE__ */ i(s, { children: [
33
32
  /* @__PURE__ */ i(O, { children: [
34
- /* @__PURE__ */ i(S, { variant: r, children: [
33
+ /* @__PURE__ */ i(k, { variant: r, children: [
35
34
  h === !1 && /* @__PURE__ */ o(
36
- d,
35
+ l,
37
36
  {
38
37
  color: "inherit",
39
38
  startIcon: /* @__PURE__ */ o(I, {}),
@@ -42,7 +41,7 @@ const Z = ({
42
41
  }
43
42
  ),
44
43
  /* @__PURE__ */ o(
45
- d,
44
+ l,
46
45
  {
47
46
  color: "inherit",
48
47
  startIcon: /* @__PURE__ */ o(A, {}),
@@ -51,7 +50,7 @@ const Z = ({
51
50
  }
52
51
  ),
53
52
  /* @__PURE__ */ o(
54
- d,
53
+ l,
55
54
  {
56
55
  color: "inherit",
57
56
  startIcon: /* @__PURE__ */ o(p, {}),
@@ -60,7 +59,7 @@ const Z = ({
60
59
  }
61
60
  ),
62
61
  /* @__PURE__ */ o(
63
- d,
62
+ l,
64
63
  {
65
64
  color: "inherit",
66
65
  startIcon: /* @__PURE__ */ o(p, {}),
@@ -70,19 +69,19 @@ const Z = ({
70
69
  )
71
70
  ] }),
72
71
  /* @__PURE__ */ i(
73
- B,
72
+ T,
74
73
  {
75
74
  fullWidth: !0,
76
75
  variant: r,
77
76
  contentEditable: !1,
78
77
  onClick: n.onClick,
79
78
  children: [
80
- /* @__PURE__ */ o(M, { children: c }),
81
- r === "standard" && /* @__PURE__ */ o(T, { value: e, readOnly: !0, endAdornment: m }),
79
+ /* @__PURE__ */ o(w, { shrink: !!e, children: d }),
80
+ r === "standard" && /* @__PURE__ */ o(M, { value: e, readOnly: !0, endAdornment: m }),
82
81
  r === "outlined" && /* @__PURE__ */ o(
83
82
  K,
84
83
  {
85
- label: c,
84
+ label: d,
86
85
  value: e,
87
86
  readOnly: !0,
88
87
  endAdornment: m
@@ -101,22 +100,22 @@ const Z = ({
101
100
  fullWidth: !0,
102
101
  maxWidth: "md",
103
102
  children: [
104
- /* @__PURE__ */ o(F, { children: t.content.title }),
105
- /* @__PURE__ */ i(G, { children: [
103
+ /* @__PURE__ */ o(B, { children: t.content.title }),
104
+ /* @__PURE__ */ i(F, { children: [
106
105
  t.content.action === "ADD" && t.content.type === "COORDINATE" && /* @__PURE__ */ o(
107
- k,
106
+ y,
108
107
  {
109
- mapboxAccessToken: l,
108
+ mapboxAccessToken: c,
110
109
  defaultExtent: a,
111
110
  onCancel: n.modal.close,
112
111
  onSubmit: n.onSubmit
113
112
  }
114
113
  ),
115
114
  t.content.action === "ADD" && t.content.type === "GEOMETRY" && /* @__PURE__ */ o(
116
- b,
115
+ E,
117
116
  {
118
117
  mapId: "map-geo-picker-001",
119
- mapboxAccessToken: l,
118
+ mapboxAccessToken: c,
120
119
  defaultExtent: a,
121
120
  onCancel: n.modal.close,
122
121
  onSubmit: n.onSubmit
@@ -125,11 +124,11 @@ const Z = ({
125
124
  t.content.action === "ADD" && t.content.type === "KML" && /* @__PURE__ */ o(g, { onCancel: n.modal.close, onSubmit: n.onSubmit }),
126
125
  t.content.action === "ADD" && t.content.type === "WKT" && /* @__PURE__ */ o(W, { onCancel: n.modal.close, onSubmit: n.onSubmit }),
127
126
  t.content.action === "EDIT" && !!e && /* @__PURE__ */ o(
128
- E,
127
+ b,
129
128
  {
130
129
  mapId: "map-geo-edit-001",
131
130
  value: e,
132
- mapboxAccessToken: l,
131
+ mapboxAccessToken: c,
133
132
  onCancel: n.modal.close,
134
133
  onSubmit: n.onSubmit
135
134
  }
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
- import { useState as i, useEffect as b } from "react";
3
- import k from "./select-input-method.js";
4
- import { Box as d, TextField as M, Button as m } from "@mui/material";
2
+ import { useState as i, useEffect as k } from "react";
3
+ import M from "./select-input-method.js";
4
+ import { Box as d, TextField as b, Button as m } from "@mui/material";
5
5
  import { validate as C } from "../../map/helpers/kml.js";
6
- import { b as L, c as T } from "../../../ol-9hySGI6D.js";
6
+ import { a as L, c as T } from "../../../ol-lGwSyEIV.js";
7
7
  function W({ onCancel: f, onSubmit: a }) {
8
8
  const [t, l] = i(), [o, p] = i(), [s, n] = i(), h = (e) => {
9
9
  l(e);
@@ -21,10 +21,10 @@ function W({ onCancel: f, onSubmit: a }) {
21
21
  }, x = () => {
22
22
  a && o && a(o);
23
23
  };
24
- return b(() => (u(), () => {
25
- }), [t, u]), t === void 0 ? /* @__PURE__ */ r(k, { onSubmit: h }) : /* @__PURE__ */ c(d, { pt: 1, children: [
24
+ return k(() => (u(), () => {
25
+ }), [t, u]), t === void 0 ? /* @__PURE__ */ r(M, { onSubmit: h }) : /* @__PURE__ */ c(d, { pt: 1, children: [
26
26
  /* @__PURE__ */ r(
27
- M,
27
+ b,
28
28
  {
29
29
  label: "KML Text",
30
30
  multiline: !0,