@glodon-aiot/react-components 3.5.2-beta.0 → 3.5.2-snapshot.0
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/dist/es/Button/index.mjs +1 -1
- package/dist/es/ConfirmableButton/index.mjs +29 -29
- package/dist/es/Drawable/Drawable.mjs +84 -84
- package/dist/es/Drawable/LineElement.mjs +2 -2
- package/dist/es/Drawable/MarkerElement.mjs +4 -4
- package/dist/es/Drawable/PolygonElement.mjs +15 -15
- package/dist/es/Drawable/state.mjs +27 -27
- package/dist/es/ExpandablePannel/index.mjs +18 -18
- package/dist/es/GOSImageMap/DrawableImageMap.mjs +18 -18
- package/dist/es/GOSImageMap/ImageMap.mjs +1 -1
- package/dist/es/IconButton/index.mjs +1 -1
- package/dist/es/ImageMap/index.mjs +120 -120
- package/dist/es/MouseTip/index.mjs +10 -10
- package/dist/es/PanoramaRecordPlayer/index.mjs +21 -21
- package/dist/es/PassMap/index.mjs +6 -6
- package/dist/es/TrackMap/PointTooltip.mjs +44 -42
- package/dist/es/TrackMap/TrackPoint.mjs +10 -10
- package/dist/es/TrackMap/index.mjs +158 -158
- package/dist/es/Zoom/index.mjs +19 -19
- package/dist/es/components/Copy/index.mjs +12 -12
- package/dist/es/components/Markdown/ATag/index.mjs +4 -4
- package/dist/es/components/Markdown/Code/index.mjs +14 -14
- package/dist/es/components/Markdown/Image/index.mjs +5 -5
- package/dist/es/components/Markdown/Video/index.mjs +1 -1
- package/dist/es/components/Markdown/index.mjs +11 -11
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +2 -2
- package/dist/src/Drawable/PolygonElement.d.ts +1 -1
- package/dist/src/GOSImageMap/DrawableImageMap.d.ts +1 -1
- package/dist/src/useBimface/index.d.ts +2 -2
- package/dist/src/utils/markdown/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/es/Button/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ const z = (o) => {
|
|
|
33
33
|
"backgroundColor",
|
|
34
34
|
"label"
|
|
35
35
|
]), p = t ? "storybook-button--primary" : "storybook-button--secondary";
|
|
36
|
-
return
|
|
36
|
+
return j("button", a(y({
|
|
37
37
|
type: "button",
|
|
38
38
|
className: ["storybook-button", `storybook-button--${r}`, p].join(" "),
|
|
39
39
|
style: {
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
2
|
var l = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var a = (
|
|
5
|
-
for (var
|
|
6
|
-
|
|
3
|
+
var d = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var a = (e, t, r) => t in e ? C(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, u = (e, t) => {
|
|
5
|
+
for (var r in t || (t = {}))
|
|
6
|
+
d.call(t, r) && a(e, r, t[r]);
|
|
7
7
|
if (l)
|
|
8
|
-
for (var
|
|
9
|
-
|
|
10
|
-
return
|
|
8
|
+
for (var r of l(t))
|
|
9
|
+
y.call(t, r) && a(e, r, t[r]);
|
|
10
|
+
return e;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as o } from "react/jsx-runtime";
|
|
13
|
-
import { useState as
|
|
13
|
+
import { useState as h, useEffect as k } from "react";
|
|
14
14
|
import s from "antd/es/button";
|
|
15
|
-
import
|
|
16
|
-
const
|
|
15
|
+
import p from "antd/es/popconfirm";
|
|
16
|
+
const T = (e) => {
|
|
17
17
|
const {
|
|
18
18
|
name: t,
|
|
19
|
-
type:
|
|
19
|
+
type: r,
|
|
20
20
|
style: x,
|
|
21
21
|
className: i,
|
|
22
|
-
children:
|
|
23
|
-
onConfirm:
|
|
24
|
-
} =
|
|
25
|
-
return
|
|
26
|
-
if (!
|
|
22
|
+
children: m,
|
|
23
|
+
onConfirm: c
|
|
24
|
+
} = e, [f, n] = h(null);
|
|
25
|
+
return k(() => {
|
|
26
|
+
if (!e.confirm) {
|
|
27
27
|
n(null);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
30
|
+
if (e.confirm === !0) {
|
|
31
31
|
n({
|
|
32
32
|
text: `确认${t}吗?`
|
|
33
33
|
});
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
n(
|
|
37
|
-
}, [
|
|
36
|
+
n(e.confirm);
|
|
37
|
+
}, [e.confirm]), f ? o(p, {
|
|
38
38
|
rootClassName: "track-map-popconfirm",
|
|
39
39
|
okText: "确定",
|
|
40
40
|
cancelText: "取消",
|
|
41
41
|
title: f.text,
|
|
42
42
|
trigger: "click",
|
|
43
|
-
onConfirm:
|
|
44
|
-
children:
|
|
43
|
+
onConfirm: c,
|
|
44
|
+
children: o(s, {
|
|
45
45
|
className: i,
|
|
46
|
-
type:
|
|
46
|
+
type: r,
|
|
47
47
|
style: u({}, x),
|
|
48
|
-
children:
|
|
48
|
+
children: m || t
|
|
49
49
|
})
|
|
50
|
-
}) :
|
|
50
|
+
}) : o(s, {
|
|
51
51
|
className: i,
|
|
52
|
-
type:
|
|
53
|
-
onClick:
|
|
54
|
-
children:
|
|
52
|
+
type: r,
|
|
53
|
+
onClick: c,
|
|
54
|
+
children: m || t
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
T as default
|
|
59
59
|
};
|
|
@@ -2,78 +2,78 @@ var $ = Object.defineProperty, H = Object.defineProperties;
|
|
|
2
2
|
var U = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var b = Object.getOwnPropertySymbols;
|
|
4
4
|
var V = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var x = (
|
|
6
|
-
for (var i in
|
|
7
|
-
V.call(
|
|
5
|
+
var x = (r, t, i) => t in r ? $(r, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[t] = i, M = (r, t) => {
|
|
6
|
+
for (var i in t || (t = {}))
|
|
7
|
+
V.call(t, i) && x(r, i, t[i]);
|
|
8
8
|
if (b)
|
|
9
|
-
for (var i of b(
|
|
10
|
-
q.call(
|
|
11
|
-
return
|
|
12
|
-
}, C = (
|
|
13
|
-
import { jsx as
|
|
9
|
+
for (var i of b(t))
|
|
10
|
+
q.call(t, i) && x(r, i, t[i]);
|
|
11
|
+
return r;
|
|
12
|
+
}, C = (r, t) => H(r, U(t));
|
|
13
|
+
import { jsx as s, jsxs as F } from "react/jsx-runtime";
|
|
14
14
|
import { useSize as J } from "ahooks";
|
|
15
15
|
import { useMachine as Q } from "@xstate/react";
|
|
16
16
|
import Z from "lodash/size";
|
|
17
17
|
import { useState as _, useRef as ee, useEffect as f } from "react";
|
|
18
|
-
import { assign as
|
|
19
|
-
import { DrawableContext as
|
|
18
|
+
import { assign as k } from "xstate";
|
|
19
|
+
import { DrawableContext as ne } from "./index.mjs";
|
|
20
20
|
import Y from "./LineElement.mjs";
|
|
21
21
|
import I from "./MarkerElement.mjs";
|
|
22
22
|
import W from "./PolygonElement.mjs";
|
|
23
|
-
import { drawableMachine as
|
|
24
|
-
function
|
|
23
|
+
import { drawableMachine as te } from "./state.mjs";
|
|
24
|
+
function he(r) {
|
|
25
25
|
const {
|
|
26
|
-
state:
|
|
26
|
+
state: t,
|
|
27
27
|
scale: i,
|
|
28
28
|
width: B,
|
|
29
29
|
height: G,
|
|
30
|
-
drawOptions:
|
|
31
|
-
lines:
|
|
32
|
-
polygons:
|
|
30
|
+
drawOptions: E,
|
|
31
|
+
lines: u,
|
|
32
|
+
polygons: p,
|
|
33
33
|
markers: g,
|
|
34
34
|
markRenderer: j,
|
|
35
|
-
onAddLine:
|
|
36
|
-
onAddPolygon:
|
|
37
|
-
onAddMarker:
|
|
35
|
+
onAddLine: w,
|
|
36
|
+
onAddPolygon: L,
|
|
37
|
+
onAddMarker: S,
|
|
38
38
|
onStateChange: y
|
|
39
|
-
} =
|
|
39
|
+
} = r, [P, z] = _([]), [R, K] = _([]), [v, X] = _([]), c = ee(null), {
|
|
40
40
|
width: O,
|
|
41
41
|
height: N
|
|
42
42
|
} = J(c) || {};
|
|
43
|
-
function
|
|
43
|
+
function h({
|
|
44
44
|
x: e,
|
|
45
|
-
y:
|
|
45
|
+
y: n
|
|
46
46
|
}) {
|
|
47
47
|
return {
|
|
48
48
|
x: e / i,
|
|
49
|
-
y:
|
|
49
|
+
y: n / i
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function A({
|
|
53
53
|
x: e,
|
|
54
|
-
y:
|
|
54
|
+
y: n
|
|
55
55
|
}) {
|
|
56
56
|
return {
|
|
57
57
|
x: e * i,
|
|
58
|
-
y:
|
|
58
|
+
y: n * i
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const [l, a] = Q(
|
|
61
|
+
const [l, a] = Q(te, {
|
|
62
62
|
actions: {
|
|
63
|
-
onAddMarker:
|
|
63
|
+
onAddMarker: k(({
|
|
64
64
|
markerPoint: e
|
|
65
|
-
}) => (
|
|
65
|
+
}) => (S && e && S(h(e)), {
|
|
66
66
|
markerPoint: void 0,
|
|
67
67
|
movingPoint: void 0
|
|
68
68
|
})),
|
|
69
|
-
onAddLine:
|
|
69
|
+
onAddLine: k((e) => (e.lineStart && e.lineEnd && w && w(h(e.lineStart), h(e.lineEnd)), {
|
|
70
70
|
lineEnd: void 0,
|
|
71
71
|
lineStart: void 0,
|
|
72
72
|
movingPoint: void 0
|
|
73
73
|
})),
|
|
74
|
-
onAddPolygon:
|
|
74
|
+
onAddPolygon: k(({
|
|
75
75
|
polygonPoints: e
|
|
76
|
-
}) => (
|
|
76
|
+
}) => (L && e && e.length > 2 && L(e.map(h)), {
|
|
77
77
|
polygonPoints: void 0,
|
|
78
78
|
movingPoint: void 0
|
|
79
79
|
}))
|
|
@@ -82,36 +82,36 @@ function ve(o) {
|
|
|
82
82
|
});
|
|
83
83
|
f(() => {
|
|
84
84
|
var e;
|
|
85
|
-
z((e =
|
|
86
|
-
id:
|
|
87
|
-
start:
|
|
88
|
-
end:
|
|
85
|
+
z((e = u == null ? void 0 : u.map(({
|
|
86
|
+
id: n,
|
|
87
|
+
start: d,
|
|
88
|
+
end: o
|
|
89
89
|
}) => ({
|
|
90
|
-
id:
|
|
91
|
-
start:
|
|
92
|
-
end:
|
|
90
|
+
id: n,
|
|
91
|
+
start: A(d),
|
|
92
|
+
end: A(o)
|
|
93
93
|
}))) != null ? e : []);
|
|
94
|
-
}, [
|
|
94
|
+
}, [u]), f(() => {
|
|
95
95
|
var e;
|
|
96
|
-
X((e = g == null ? void 0 : g.map((
|
|
97
|
-
point:
|
|
96
|
+
X((e = g == null ? void 0 : g.map((n) => C(M({}, n), {
|
|
97
|
+
point: A(n.point)
|
|
98
98
|
}))) != null ? e : []);
|
|
99
99
|
}, [g]), f(() => {
|
|
100
100
|
var e;
|
|
101
|
-
K((e =
|
|
102
|
-
id:
|
|
103
|
-
points:
|
|
104
|
-
options:
|
|
101
|
+
K((e = p == null ? void 0 : p.map(({
|
|
102
|
+
id: n,
|
|
103
|
+
points: d,
|
|
104
|
+
options: o
|
|
105
105
|
}) => ({
|
|
106
|
-
id:
|
|
107
|
-
points:
|
|
108
|
-
options:
|
|
106
|
+
id: n,
|
|
107
|
+
points: d.map(A),
|
|
108
|
+
options: o
|
|
109
109
|
}))) != null ? e : []);
|
|
110
|
-
}, [
|
|
110
|
+
}, [p, i]), f(() => {
|
|
111
111
|
y && l.matches("idle") && y("viewOnly");
|
|
112
112
|
}, [l.value]), f(() => {
|
|
113
113
|
if (y)
|
|
114
|
-
switch (
|
|
114
|
+
switch (t) {
|
|
115
115
|
case "drawingLine":
|
|
116
116
|
a("START_DRAW_LINE");
|
|
117
117
|
break;
|
|
@@ -122,26 +122,26 @@ function ve(o) {
|
|
|
122
122
|
a("START_ADD_MARKER");
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
|
-
}, [
|
|
125
|
+
}, [t]);
|
|
126
126
|
const {
|
|
127
|
-
lineStart:
|
|
127
|
+
lineStart: D,
|
|
128
128
|
lineEnd: ie,
|
|
129
129
|
polygonPoints: T,
|
|
130
130
|
movingPoint: m
|
|
131
131
|
} = l.context;
|
|
132
|
-
return
|
|
132
|
+
return s(ne.Provider, {
|
|
133
133
|
value: {
|
|
134
|
-
options:
|
|
134
|
+
options: E != null ? E : {}
|
|
135
135
|
},
|
|
136
|
-
children:
|
|
136
|
+
children: s("div", {
|
|
137
137
|
ref: c,
|
|
138
138
|
className: "w-full h-full absolute left-0 top-0",
|
|
139
139
|
style: {
|
|
140
|
-
cursor:
|
|
140
|
+
cursor: t === "viewOnly" ? void 0 : "crosshair",
|
|
141
141
|
width: B,
|
|
142
142
|
height: G
|
|
143
143
|
},
|
|
144
|
-
children: O && N &&
|
|
144
|
+
children: O && N && F("svg", {
|
|
145
145
|
viewBox: `0 0 ${O} ${N}`,
|
|
146
146
|
version: "1.1",
|
|
147
147
|
className: "absolute inset-0",
|
|
@@ -149,52 +149,52 @@ function ve(o) {
|
|
|
149
149
|
if (!c.current)
|
|
150
150
|
return;
|
|
151
151
|
const {
|
|
152
|
-
top:
|
|
153
|
-
left:
|
|
154
|
-
} = c.current.getBoundingClientRect(),
|
|
155
|
-
x: e.clientX -
|
|
156
|
-
y: e.clientY -
|
|
152
|
+
top: n,
|
|
153
|
+
left: d
|
|
154
|
+
} = c.current.getBoundingClientRect(), o = {
|
|
155
|
+
x: e.clientX - d,
|
|
156
|
+
y: e.clientY - n
|
|
157
157
|
};
|
|
158
|
-
l.matches("drawingLine") ? a(
|
|
158
|
+
l.matches("drawingLine") ? a(D === void 0 ? {
|
|
159
159
|
type: "ADD_LINE_START",
|
|
160
|
-
point:
|
|
160
|
+
point: o
|
|
161
161
|
} : {
|
|
162
162
|
type: "ADD_LINE_END",
|
|
163
|
-
point:
|
|
163
|
+
point: o
|
|
164
164
|
}) : l.matches("drawingPolygon") ? a({
|
|
165
165
|
type: "ADD_POLYGON_POINT",
|
|
166
|
-
point:
|
|
166
|
+
point: o
|
|
167
167
|
}) : l.matches("addingMarker") && a({
|
|
168
168
|
type: "ADD_MARKER",
|
|
169
|
-
point:
|
|
169
|
+
point: o
|
|
170
170
|
});
|
|
171
171
|
},
|
|
172
172
|
onMouseMove: (e) => {
|
|
173
173
|
if (!c.current)
|
|
174
174
|
return;
|
|
175
175
|
const {
|
|
176
|
-
top:
|
|
177
|
-
left:
|
|
178
|
-
} = c.current.getBoundingClientRect(),
|
|
179
|
-
x: e.clientX -
|
|
180
|
-
y: e.clientY -
|
|
176
|
+
top: n,
|
|
177
|
+
left: d
|
|
178
|
+
} = c.current.getBoundingClientRect(), o = {
|
|
179
|
+
x: e.clientX - d,
|
|
180
|
+
y: e.clientY - n
|
|
181
181
|
};
|
|
182
182
|
a({
|
|
183
183
|
type: "MOUSE_MOVE",
|
|
184
|
-
point:
|
|
184
|
+
point: o
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
|
-
children: [
|
|
188
|
-
start:
|
|
187
|
+
children: [P == null ? void 0 : P.map((e, n) => s(Y, M({}, e), n)), D && m && s(Y, {
|
|
188
|
+
start: D,
|
|
189
189
|
end: m
|
|
190
|
-
}),
|
|
190
|
+
}), R == null ? void 0 : R.map(({
|
|
191
191
|
points: e,
|
|
192
|
-
options:
|
|
193
|
-
},
|
|
192
|
+
options: n
|
|
193
|
+
}, d) => s(W, {
|
|
194
194
|
editing: !1,
|
|
195
195
|
points: e,
|
|
196
|
-
options:
|
|
197
|
-
},
|
|
196
|
+
options: n
|
|
197
|
+
}, d)), Z(T) > 0 && m && s(W, {
|
|
198
198
|
editing: !0,
|
|
199
199
|
points: [...T, m],
|
|
200
200
|
onClose: (e) => {
|
|
@@ -202,10 +202,10 @@ function ve(o) {
|
|
|
202
202
|
type: "DRAW_POLYGON_COMPLETE"
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
}),
|
|
205
|
+
}), v == null ? void 0 : v.map((e) => s(I, {
|
|
206
206
|
marker: e,
|
|
207
207
|
markRenderer: j
|
|
208
|
-
})), l.matches("addingMarker") && m &&
|
|
208
|
+
})), l.matches("addingMarker") && m && s(I, {
|
|
209
209
|
marker: {
|
|
210
210
|
id: "addingMarker",
|
|
211
211
|
point: m
|
|
@@ -216,5 +216,5 @@ function ve(o) {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
export {
|
|
219
|
-
|
|
219
|
+
he as default
|
|
220
220
|
};
|
|
@@ -9,20 +9,20 @@ function o(t) {
|
|
|
9
9
|
y: i
|
|
10
10
|
}
|
|
11
11
|
} = n;
|
|
12
|
-
return
|
|
13
|
-
children: [
|
|
12
|
+
return a("g", {
|
|
13
|
+
children: [e("line", {}), e("line", {}), e("circle", {
|
|
14
14
|
cx: l,
|
|
15
15
|
cy: i,
|
|
16
16
|
r: 1,
|
|
17
17
|
fill: "transparent"
|
|
18
|
-
}),
|
|
18
|
+
}), e("foreignObject", {
|
|
19
19
|
x: l,
|
|
20
20
|
y: i,
|
|
21
21
|
width: 0,
|
|
22
22
|
height: 0,
|
|
23
23
|
fill: "green",
|
|
24
24
|
className: "relative overflow-visible",
|
|
25
|
-
children:
|
|
25
|
+
children: e("div", {
|
|
26
26
|
className: "inline-flex absolute",
|
|
27
27
|
draggable: !0,
|
|
28
28
|
onDragStart: () => {
|
|
@@ -8,8 +8,8 @@ function N(S) {
|
|
|
8
8
|
points: e,
|
|
9
9
|
editing: i,
|
|
10
10
|
options: l,
|
|
11
|
-
onClose:
|
|
12
|
-
} = S, [b,
|
|
11
|
+
onClose: x
|
|
12
|
+
} = S, [b, y] = j(!1), {
|
|
13
13
|
options: {
|
|
14
14
|
polygon: c
|
|
15
15
|
}
|
|
@@ -19,7 +19,7 @@ function N(S) {
|
|
|
19
19
|
const a = D(e), p = e.map(({
|
|
20
20
|
x: n,
|
|
21
21
|
y: r
|
|
22
|
-
}) => `${n},${r}`).join(" "),
|
|
22
|
+
}) => `${n},${r}`).join(" "), g = a ? `${p} ${a.x},${a.y}` : p, {
|
|
23
23
|
showVertexIndex: d,
|
|
24
24
|
vertexBgColor: f,
|
|
25
25
|
vertexTextColor: m
|
|
@@ -27,12 +27,12 @@ function N(S) {
|
|
|
27
27
|
hideBorder: P,
|
|
28
28
|
backgroundColor: u
|
|
29
29
|
} = l != null ? l : {};
|
|
30
|
-
return
|
|
31
|
-
children: [
|
|
32
|
-
points: `${
|
|
30
|
+
return $(v, {
|
|
31
|
+
children: [o("polygon", {
|
|
32
|
+
points: `${g}`,
|
|
33
33
|
fill: u != null ? u : "rgba(255, 66, 66, 0.15)"
|
|
34
|
-
}), !P &&
|
|
35
|
-
points: i ? p :
|
|
34
|
+
}), !P && o("polyline", {
|
|
35
|
+
points: i ? p : g,
|
|
36
36
|
fill: "transparent",
|
|
37
37
|
stroke: "#FF5500",
|
|
38
38
|
strokeDasharray: "6 4",
|
|
@@ -42,31 +42,31 @@ function N(S) {
|
|
|
42
42
|
y: r
|
|
43
43
|
}, h) => {
|
|
44
44
|
const s = h === F(e) - 1;
|
|
45
|
-
return
|
|
45
|
+
return o("g", {
|
|
46
46
|
style: {
|
|
47
47
|
zIndex: s ? 1 : 100,
|
|
48
48
|
cursor: "pointer",
|
|
49
49
|
pointerEvents: s ? "none" : "bounding-box"
|
|
50
50
|
},
|
|
51
51
|
onMouseEnter: (t) => {
|
|
52
|
-
s ||
|
|
52
|
+
s || y(!0);
|
|
53
53
|
},
|
|
54
54
|
onMouseLeave: (t) => {
|
|
55
|
-
|
|
55
|
+
y(!1);
|
|
56
56
|
},
|
|
57
57
|
onClick: (t) => {
|
|
58
58
|
t.stopPropagation();
|
|
59
59
|
},
|
|
60
60
|
onDoubleClick: (t) => {
|
|
61
|
-
t.stopPropagation(),
|
|
61
|
+
t.stopPropagation(), x && x(h);
|
|
62
62
|
},
|
|
63
|
-
children: A && (!s || !b) &&
|
|
64
|
-
children: [
|
|
63
|
+
children: A && (!s || !b) && $(v, {
|
|
64
|
+
children: [o("circle", {
|
|
65
65
|
cx: n,
|
|
66
66
|
cy: r,
|
|
67
67
|
r: k,
|
|
68
68
|
fill: f != null ? f : "#FF5500"
|
|
69
|
-
}), d &&
|
|
69
|
+
}), d && o("text", {
|
|
70
70
|
x: n,
|
|
71
71
|
y: r,
|
|
72
72
|
"text-anchor": "middle",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assign as
|
|
2
|
-
import { createMachine as
|
|
3
|
-
const d =
|
|
1
|
+
import { assign as a } from "@xstate/immer";
|
|
2
|
+
import { createMachine as o } from "xstate";
|
|
3
|
+
const d = o({
|
|
4
4
|
initial: "idle",
|
|
5
5
|
context: {},
|
|
6
6
|
states: {
|
|
@@ -21,24 +21,24 @@ const d = e({
|
|
|
21
21
|
on: {
|
|
22
22
|
RESET: {
|
|
23
23
|
target: "idle",
|
|
24
|
-
actions:
|
|
25
|
-
|
|
24
|
+
actions: a((n) => {
|
|
25
|
+
n.markerPoint = void 0;
|
|
26
26
|
})
|
|
27
27
|
},
|
|
28
28
|
ADD_MARKER: {
|
|
29
29
|
target: "drawCompleted",
|
|
30
|
-
actions: [
|
|
31
|
-
point:
|
|
30
|
+
actions: [a((n, {
|
|
31
|
+
point: t
|
|
32
32
|
}) => {
|
|
33
|
-
|
|
33
|
+
n.markerPoint = t;
|
|
34
34
|
}), "onAddMarker"]
|
|
35
35
|
},
|
|
36
36
|
MOUSE_MOVE: {
|
|
37
37
|
target: "addingMarker",
|
|
38
|
-
actions:
|
|
39
|
-
point:
|
|
38
|
+
actions: a((n, {
|
|
39
|
+
point: t
|
|
40
40
|
}) => {
|
|
41
|
-
|
|
41
|
+
n.movingPoint = t;
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -47,22 +47,22 @@ const d = e({
|
|
|
47
47
|
on: {
|
|
48
48
|
ADD_LINE_START: {
|
|
49
49
|
target: "drawingLine",
|
|
50
|
-
actions:
|
|
51
|
-
|
|
50
|
+
actions: a((n, t) => {
|
|
51
|
+
n.lineStart = t.point;
|
|
52
52
|
})
|
|
53
53
|
},
|
|
54
54
|
ADD_LINE_END: {
|
|
55
55
|
target: "drawCompleted",
|
|
56
|
-
actions: [
|
|
57
|
-
|
|
56
|
+
actions: [a((n, t) => {
|
|
57
|
+
n.lineEnd = t.point;
|
|
58
58
|
}), "onAddLine"]
|
|
59
59
|
},
|
|
60
60
|
MOUSE_MOVE: {
|
|
61
61
|
target: "drawingLine",
|
|
62
|
-
actions:
|
|
63
|
-
point:
|
|
62
|
+
actions: a((n, {
|
|
63
|
+
point: t
|
|
64
64
|
}) => {
|
|
65
|
-
|
|
65
|
+
n.movingPoint = t;
|
|
66
66
|
})
|
|
67
67
|
},
|
|
68
68
|
RESET: {
|
|
@@ -84,25 +84,25 @@ const d = e({
|
|
|
84
84
|
},
|
|
85
85
|
RESET: {
|
|
86
86
|
target: "idle",
|
|
87
|
-
actions:
|
|
88
|
-
|
|
87
|
+
actions: a((n) => {
|
|
88
|
+
n.polygonPoints = void 0;
|
|
89
89
|
})
|
|
90
90
|
},
|
|
91
91
|
ADD_POLYGON_POINT: {
|
|
92
92
|
target: "drawingPolygon",
|
|
93
|
-
actions:
|
|
94
|
-
point:
|
|
93
|
+
actions: a((n, {
|
|
94
|
+
point: t
|
|
95
95
|
}) => {
|
|
96
|
-
var
|
|
97
|
-
|
|
96
|
+
var e;
|
|
97
|
+
n.polygonPoints = (e = n.polygonPoints) != null ? e : [], n.polygonPoints.push(t);
|
|
98
98
|
})
|
|
99
99
|
},
|
|
100
100
|
MOUSE_MOVE: {
|
|
101
101
|
target: "drawingPolygon",
|
|
102
|
-
actions:
|
|
103
|
-
point:
|
|
102
|
+
actions: a((n, {
|
|
103
|
+
point: t
|
|
104
104
|
}) => {
|
|
105
|
-
|
|
105
|
+
n.movingPoint = t;
|
|
106
106
|
})
|
|
107
107
|
},
|
|
108
108
|
DRAW_POLYGON_COMPLETE: {
|