@glodon-aiot/dataset-annotation 3.22.2-alpha.3 → 3.23.0-alpha.2

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,152 +1,150 @@
1
- var _ = Object.defineProperty, $ = Object.defineProperties;
2
- var V = Object.getOwnPropertyDescriptors;
1
+ var $ = Object.defineProperty, V = Object.defineProperties;
2
+ var S = Object.getOwnPropertyDescriptors;
3
3
  var M = Object.getOwnPropertySymbols;
4
- var S = Object.prototype.hasOwnProperty, ee = Object.prototype.propertyIsEnumerable;
5
- var A = (n, l, o) => l in n ? _(n, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[l] = o, m = (n, l) => {
6
- for (var o in l || (l = {}))
7
- S.call(l, o) && A(n, o, l[o]);
4
+ var ee = Object.prototype.hasOwnProperty, ie = Object.prototype.propertyIsEnumerable;
5
+ var A = (d, o, a) => o in d ? $(d, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : d[o] = a, b = (d, o) => {
6
+ for (var a in o || (o = {}))
7
+ ee.call(o, a) && A(d, a, o[a]);
8
8
  if (M)
9
- for (var o of M(l))
10
- ee.call(l, o) && A(n, o, l[o]);
11
- return n;
12
- }, I = (n, l) => $(n, V(l));
13
- import { jsxs as b, jsx as d } from "react/jsx-runtime";
14
- import { useRef as B, useState as h, useEffect as g } from "react";
9
+ for (var a of M(o))
10
+ ie.call(o, a) && A(d, a, o[a]);
11
+ return d;
12
+ }, U = (d, o) => V(d, S(o));
13
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
14
+ import { useRef as B, useState as h, useEffect as w } from "react";
15
15
  import { Button as H } from "antd";
16
16
  import { useKeyPress as K } from "ahooks";
17
17
  import "./style.less.mjs";
18
- import ie from "../Labels/index.mjs";
19
- import se from "../LabelMaker/index.mjs";
18
+ import se from "../Labels/index.mjs";
19
+ import le from "../LabelMaker/index.mjs";
20
20
  import O from "../../../Iconfont/index.mjs";
21
- import te from "../../../DetectionStatus/index.mjs";
22
- const he = (n) => {
23
- var P, z, F;
21
+ import oe from "../../../DetectionStatus/index.mjs";
22
+ const ge = (d) => {
23
+ var u, z, F;
24
24
  const {
25
- datasetId: l,
26
- isImageDetailVisible: o = !0,
25
+ datasetId: o,
26
+ isImageDetailVisible: a = !0,
27
27
  currentSample: e,
28
- onNextClick: v,
29
- onPrevClick: L,
28
+ onNextClick: g,
29
+ onPrevClick: v,
30
30
  labels: r = [],
31
31
  editing: q,
32
- onRefresh: N,
33
- onChange: k,
34
- isPreLabel: C,
35
- settingHide: U,
36
- imgCount: c,
32
+ onRefresh: L,
33
+ onChange: C,
34
+ isPreLabel: p,
35
+ settingHide: D,
36
+ imgCount: f,
37
37
  readonly: G,
38
- showLabelList: D = !0,
38
+ showLabelList: E = !0,
39
39
  renderLabelItem: J,
40
- onLoadingChange: w
41
- } = n, Q = B(null), T = B({}), [E, W] = h({}), [y, p] = h(), [a, R] = h(), [X, Y] = h(!1), [x, u] = h(!1);
40
+ onLoadingChange: I
41
+ } = d, Q = B(null), T = B({}), [P, W] = h({}), [y, N] = h(), [t, R] = h(), [X, Y] = h(!1), [Z, j] = h(), x = !!(e != null && e.fileUrl) && Z !== e.fileUrl;
42
42
  K("rightarrow", () => {
43
- v && v();
43
+ g && g();
44
44
  }), K("leftarrow", () => {
45
- L && L();
46
- }), g(() => () => {
47
- X && N && N();
48
- }, []), g(() => {
49
- var s, t;
50
- if (p(void 0), (e == null ? void 0 : e.id) !== (a == null ? void 0 : a.id) && R(void 0), !o || !((s = e == null ? void 0 : e.labels) != null && s.length))
45
+ v && v();
46
+ }), w(() => () => {
47
+ X && L && L();
48
+ }, []), w(() => {
49
+ var s, l;
50
+ if (N(void 0), (e == null ? void 0 : e.id) !== (t == null ? void 0 : t.id) && R(void 0), !a || !((s = e == null ? void 0 : e.labels) != null && s.length))
51
51
  return;
52
- const i = (t = a || e) == null ? void 0 : t.labels.reduce((f, j) => (f[j.id] ? ++f[j.id] : f[j.id] = 1, f), {});
52
+ const i = (l = t || e) == null ? void 0 : l.labels.reduce((c, k) => (c[k.id] ? ++c[k.id] : c[k.id] = 1, c), {});
53
53
  W(i || {});
54
- }, [o, e, a]), g(() => {
55
- e != null && e.fileUrl && u(!0);
56
- }, [e == null ? void 0 : e.fileUrl]), g(() => {
57
- w && w(x);
58
- }, [x, w]), g(() => {
59
- if (a != null && a.labels) {
54
+ }, [a, e, t]), w(() => {
55
+ I && I(x, e == null ? void 0 : e.fileUrl);
56
+ }, [x, e == null ? void 0 : e.fileUrl, I]), w(() => {
57
+ if (t != null && t.labels) {
60
58
  const i = [];
61
- a.labels.forEach((s) => {
62
- const t = r.find((f) => f.id === s.id);
63
- t && i.push(I(m({}, s), {
64
- label: t.label
59
+ t.labels.forEach((s) => {
60
+ const l = r.find((c) => c.id === s.id);
61
+ l && i.push(U(b({}, s), {
62
+ label: l.label
65
63
  }));
66
- }), a.labels = i, R(m({}, a));
64
+ }), t.labels = i, R(b({}, t));
67
65
  }
68
66
  }, [r]);
69
- const Z = () => {
70
- Q.current && u(!1);
67
+ const _ = () => {
68
+ Q.current && j(e == null ? void 0 : e.fileUrl);
71
69
  };
72
- return window.onresize = Z, /* @__PURE__ */ b("div", {
70
+ return window.onresize = _, /* @__PURE__ */ m("div", {
73
71
  className: "detection-image-detail",
74
- children: [/* @__PURE__ */ b("div", {
72
+ children: [/* @__PURE__ */ m("div", {
75
73
  className: "detail-image",
76
- children: [U ? /* @__PURE__ */ b("div", {
74
+ children: [D ? /* @__PURE__ */ m("div", {
77
75
  className: "img-detail-info",
78
- children: ["第 ", c == null ? void 0 : c.index, " 张 / 共 ", c == null ? void 0 : c.total, " 张"]
79
- }) : /* @__PURE__ */ d("div", {
76
+ children: ["第 ", f == null ? void 0 : f.index, " 张 / 共 ", f == null ? void 0 : f.total, " 张"]
77
+ }) : /* @__PURE__ */ n("div", {
80
78
  className: "img-detail-info",
81
- children: c == null ? void 0 : c.index
82
- }), /* @__PURE__ */ b("div", {
79
+ children: f == null ? void 0 : f.index
80
+ }), /* @__PURE__ */ m("div", {
83
81
  className: "detail-content",
84
- children: [L && /* @__PURE__ */ d(H, {
82
+ children: [v && /* @__PURE__ */ n(H, {
85
83
  className: "select-prev",
86
- icon: /* @__PURE__ */ d(O, {
84
+ icon: /* @__PURE__ */ n(O, {
87
85
  type: "icon-zuojiantou"
88
86
  }),
89
87
  type: "text",
90
88
  disabled: x,
91
- onClick: () => L(),
89
+ onClick: () => v(),
92
90
  tabIndex: 0
93
- }), /* @__PURE__ */ b("div", {
91
+ }), /* @__PURE__ */ m("div", {
94
92
  className: "select-main",
95
93
  ref: T,
96
- children: [((P = e == null ? void 0 : e.sampleFileName) == null ? void 0 : P.name) && /* @__PURE__ */ d("div", {
94
+ children: [((u = e == null ? void 0 : e.sampleFileName) == null ? void 0 : u.name) && /* @__PURE__ */ n("div", {
97
95
  className: "img-detail-name-overlay",
98
96
  children: e.sampleFileName.name
99
- }), /* @__PURE__ */ d("div", {
97
+ }), /* @__PURE__ */ n("div", {
100
98
  className: "detection-status-wrapper",
101
- children: /* @__PURE__ */ d(te, {
99
+ children: /* @__PURE__ */ n(oe, {
102
100
  sample: e
103
101
  })
104
- }), /* @__PURE__ */ d(se, {
102
+ }), /* @__PURE__ */ n(le, {
105
103
  disabled: G,
106
104
  imageUrl: (e == null ? void 0 : e.fileUrl) || "",
107
105
  pen: y,
108
- labels: ((z = a ? a.labels : e == null ? void 0 : e.labels) == null ? void 0 : z.map((i) => {
106
+ labels: ((z = t ? t.labels : e == null ? void 0 : e.labels) == null ? void 0 : z.map((i) => {
109
107
  var s;
110
- return I(m({}, i), {
111
- color: ((s = r.find((t) => t.id === i.id)) == null ? void 0 : s.color) || ""
108
+ return U(b({}, i), {
109
+ color: ((s = r.find((l) => l.id === i.id)) == null ? void 0 : s.color) || ""
112
110
  });
113
111
  })) || [],
114
- onImageLoad: () => u(!1),
115
- onImageError: () => u(!1),
112
+ onImageLoad: () => j(e == null ? void 0 : e.fileUrl),
113
+ onImageError: () => j(e == null ? void 0 : e.fileUrl),
116
114
  onChange: (i) => {
117
- if (p(void 0), !e)
115
+ if (N(void 0), !e)
118
116
  return;
119
- const s = I(m({}, e), {
120
- labels: i.map((t) => ({
121
- id: t.id,
122
- label: t.label,
123
- box: t.box
117
+ const s = U(b({}, e), {
118
+ labels: i.map((l) => ({
119
+ id: l.id,
120
+ label: l.label,
121
+ box: l.box
124
122
  }))
125
123
  });
126
- R(s), k && k(s);
124
+ R(s), C && C(s);
127
125
  },
128
- isPreLabel: C,
126
+ isPreLabel: p,
129
127
  renderLabelItem: J
130
- }, D ? "with-slide" : "no-slide")]
131
- }), v && /* @__PURE__ */ d(H, {
128
+ }, E ? "with-slide" : "no-slide")]
129
+ }), g && /* @__PURE__ */ n(H, {
132
130
  className: "select-next",
133
- icon: /* @__PURE__ */ d(O, {
131
+ icon: /* @__PURE__ */ n(O, {
134
132
  type: "icon-youjiantou"
135
133
  }),
136
134
  type: "text",
137
135
  disabled: x,
138
- onClick: () => v()
136
+ onClick: () => g()
139
137
  })]
140
138
  })]
141
- }), (!!(r != null && r.length) || q) && D && /* @__PURE__ */ d("div", {
139
+ }), (!!(r != null && r.length) || q) && E && /* @__PURE__ */ n("div", {
142
140
  className: "detail-slide",
143
- children: /* @__PURE__ */ d(ie, {
144
- datasetId: l,
141
+ children: /* @__PURE__ */ n(se, {
142
+ datasetId: o,
145
143
  selectMode: "single",
146
- data: ((F = Object.keys(E)) == null ? void 0 : F.map((i) => {
147
- const s = r.find((t) => t.id === i);
144
+ data: ((F = Object.keys(P)) == null ? void 0 : F.map((i) => {
145
+ const s = r.find((l) => l.id === i);
148
146
  if (s)
149
- return s.count = E[i], s;
147
+ return s.count = P[i], s;
150
148
  }).filter((i) => !!i)) || [],
151
149
  shortcut: !0,
152
150
  selected: y ? [y] : [],
@@ -156,21 +154,21 @@ const he = (n) => {
156
154
  return;
157
155
  }
158
156
  if (!i.length) {
159
- p(void 0);
157
+ N(void 0);
160
158
  return;
161
159
  }
162
- const s = r == null ? void 0 : r.find((t) => i[0].label === t.label);
163
- p(s);
160
+ const s = r == null ? void 0 : r.find((l) => i[0].label === l.label);
161
+ N(s);
164
162
  },
165
163
  onListChange: () => {
166
- Y(!0), N && N();
164
+ Y(!0), L && L();
167
165
  },
168
- isPreLabel: C,
169
- settingHide: U
166
+ isPreLabel: p,
167
+ settingHide: D
170
168
  })
171
169
  })]
172
170
  });
173
171
  };
174
172
  export {
175
- he as default
173
+ ge as default
176
174
  };
@@ -1,51 +1,60 @@
1
- import { jsxs as n, jsx as i } from "react/jsx-runtime";
2
- import { useState as K } from "react";
3
- import { Modal as u, Tabs as O, Space as V, Button as s, Tooltip as x } from "antd";
4
- import { useKeyPress as I } from "ahooks";
5
- import B from "../ImageDetail/index.mjs";
1
+ import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
+ import { useState as x, useCallback as z } from "react";
3
+ import { Modal as N, Button as l, Tabs as F, Space as H, Tooltip as R } from "antd";
4
+ import { useKeyPress as k } from "ahooks";
5
+ import q from "../ImageDetail/index.mjs";
6
6
  import "./style.less.mjs";
7
- import F from "../../../DataEmpty/index.mjs";
8
- import { ISampleActionType as c } from "../../index.mjs";
9
- const W = (L) => {
7
+ import G from "../../../DataEmpty/index.mjs";
8
+ import { ISampleActionType as h } from "../../index.mjs";
9
+ const _ = (w) => {
10
10
  const {
11
- datasetId: N,
12
- setIsImageDetailVisible: m,
13
- isImageDetailVisible: f = !0,
11
+ datasetId: D,
12
+ setIsImageDetailVisible: b,
13
+ isImageDetailVisible: p = !0,
14
14
  currentSample: e,
15
15
  onNextClick: o,
16
- onPrevClick: l,
16
+ onPrevClick: s,
17
17
  onSave: a,
18
- onDeleteSample: h,
19
- labels: w = [],
20
- onRefresh: v,
21
- onChange: D,
22
- isPreLabel: r,
23
- settingHide: k,
24
- imgCount: H,
25
- showLabelList: M = !0,
26
- renderLabelItem: E,
27
- onEnterEdit: p,
28
- filterItems: b,
29
- filterMode: T,
30
- onFilterChange: g,
18
+ onDeleteSample: g,
19
+ labels: v = [],
20
+ onRefresh: M,
21
+ onChange: T,
22
+ isPreLabel: n,
23
+ settingHide: E,
24
+ imgCount: J,
25
+ showLabelList: j = !0,
26
+ renderLabelItem: A,
27
+ onEnterEdit: y,
28
+ onBackToDetail: C,
29
+ onLoadingChange: c,
30
+ filterItems: u,
31
+ filterMode: B,
32
+ onFilterChange: I,
31
33
  previewMode: t = !0,
32
- canLabel: d = !1,
33
- canDelete: y = !1
34
- } = L, [C, j] = K(!1);
35
- return I("rightarrow", () => {
34
+ canLabel: r = !1,
35
+ canDelete: L = !1
36
+ } = w, [f, K] = x(!1), O = z((m, V) => {
37
+ K(m), c == null || c(m, V);
38
+ }, [c]);
39
+ return k("rightarrow", () => {
36
40
  t || o && o(e == null ? void 0 : e.confirmStatus);
37
- }), I("leftarrow", () => {
38
- t || l && l(e == null ? void 0 : e.confirmStatus);
39
- }), /* @__PURE__ */ n(u, {
40
- title: /* @__PURE__ */ i("div", {
41
+ }), k("leftarrow", () => {
42
+ t || s && s(e == null ? void 0 : e.confirmStatus);
43
+ }), /* @__PURE__ */ d(N, {
44
+ title: /* @__PURE__ */ d("div", {
41
45
  className: "detection-sample-detail-title",
42
- children: /* @__PURE__ */ i("span", {
46
+ children: [/* @__PURE__ */ i("span", {
43
47
  children: t ? "详情" : "标注"
44
- })
48
+ }), !t && r && e && C && /* @__PURE__ */ i(l, {
49
+ size: "small",
50
+ onClick: () => C(e.confirmStatus),
51
+ disabled: f,
52
+ children: "返回详情"
53
+ })]
45
54
  }),
46
55
  width: "100%",
47
- open: f,
48
- onCancel: () => m(!1),
56
+ open: p,
57
+ onCancel: () => b(!1),
49
58
  footer: null,
50
59
  centered: !0,
51
60
  wrapClassName: "detection-modal-wrap",
@@ -56,61 +65,61 @@ const W = (L) => {
56
65
  destroyOnClose: !1,
57
66
  children: [/* @__PURE__ */ i("div", {
58
67
  className: "detail-tabs",
59
- children: !t && b && /* @__PURE__ */ i(O, {
60
- activeKey: T,
61
- items: b,
62
- onChange: (A) => g && g(A)
68
+ children: !t && u && /* @__PURE__ */ i(F, {
69
+ activeKey: B,
70
+ items: u,
71
+ onChange: (m) => I && I(m)
63
72
  })
64
- }), e ? /* @__PURE__ */ i(B, {
65
- datasetId: N,
66
- isImageDetailVisible: f,
67
- setIsImageDetailVisible: m,
73
+ }), e ? /* @__PURE__ */ i(q, {
74
+ datasetId: D,
75
+ isImageDetailVisible: p,
76
+ setIsImageDetailVisible: b,
68
77
  currentSample: e,
69
78
  onNextClick: t ? () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus) : void 0,
70
- onPrevClick: t ? () => l == null ? void 0 : l(e == null ? void 0 : e.confirmStatus) : void 0,
71
- labels: w,
79
+ onPrevClick: t ? () => s == null ? void 0 : s(e == null ? void 0 : e.confirmStatus) : void 0,
80
+ labels: v,
72
81
  editing: !t,
73
- onRefresh: v,
74
- onChange: D,
75
- isPreLabel: r,
76
- settingHide: k,
77
- readonly: t || !d,
78
- showLabelList: t ? !1 : M,
79
- renderLabelItem: E,
80
- onLoadingChange: j
81
- }) : /* @__PURE__ */ i(F, {}), e && /* @__PURE__ */ i("div", {
82
+ onRefresh: M,
83
+ onChange: T,
84
+ isPreLabel: n,
85
+ settingHide: E,
86
+ readonly: t || !r,
87
+ showLabelList: t ? !1 : j,
88
+ renderLabelItem: A,
89
+ onLoadingChange: O
90
+ }) : /* @__PURE__ */ i(G, {}), e && /* @__PURE__ */ i("div", {
82
91
  className: "detail-footer",
83
- children: t ? /* @__PURE__ */ n(V, {
84
- children: [p && d && /* @__PURE__ */ i("div", {
92
+ children: t ? /* @__PURE__ */ d(H, {
93
+ children: [y && r && /* @__PURE__ */ i("div", {
85
94
  className: "detail-actions",
86
- children: /* @__PURE__ */ i(s, {
95
+ children: /* @__PURE__ */ i(l, {
87
96
  type: "primary",
88
- onClick: p,
97
+ onClick: y,
89
98
  children: "标注"
90
99
  })
91
- }), y && /* @__PURE__ */ i(s, {
100
+ }), L && /* @__PURE__ */ i(l, {
92
101
  danger: !0,
93
- onClick: h,
102
+ onClick: g,
94
103
  children: "删除数据"
95
104
  })]
96
- }) : /* @__PURE__ */ n("div", {
105
+ }) : /* @__PURE__ */ d("div", {
97
106
  className: "footer-bar",
98
107
  children: [/* @__PURE__ */ i("div", {
99
108
  className: "footer-left"
100
- }), /* @__PURE__ */ n("div", {
109
+ }), /* @__PURE__ */ d("div", {
101
110
  className: "footer-center",
102
- children: [/* @__PURE__ */ i(s, {
103
- onClick: () => l == null ? void 0 : l(e == null ? void 0 : e.confirmStatus),
104
- disabled: C,
111
+ children: [/* @__PURE__ */ i(l, {
112
+ onClick: () => s == null ? void 0 : s(e == null ? void 0 : e.confirmStatus),
113
+ disabled: f,
105
114
  children: "上一张"
106
- }), /* @__PURE__ */ i(s, {
115
+ }), /* @__PURE__ */ i(l, {
107
116
  onClick: () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus),
108
- disabled: C,
117
+ disabled: f,
109
118
  children: "下一张"
110
119
  })]
111
- }), /* @__PURE__ */ n("div", {
120
+ }), /* @__PURE__ */ d("div", {
112
121
  className: "footer-right",
113
- children: [d && e.confirmStatus === 1 && /* @__PURE__ */ i(x, {
122
+ children: [r && e.confirmStatus === 1 && /* @__PURE__ */ i(R, {
114
123
  title: /* @__PURE__ */ i("span", {
115
124
  style: {
116
125
  color: "#ff9800"
@@ -118,36 +127,36 @@ const W = (L) => {
118
127
  children: 'AI预标注数据,请"确认标注"完成审核'
119
128
  }),
120
129
  placement: "top",
121
- children: /* @__PURE__ */ i(s, {
130
+ children: /* @__PURE__ */ i(l, {
122
131
  type: "primary",
123
132
  onClick: () => {
124
- u.confirm({
133
+ N.confirm({
125
134
  title: "确认",
126
135
  content: "是否确认当前标注?",
127
136
  onOk: () => {
128
- a == null || a(0, c.Confirm);
137
+ a == null || a(0, h.Confirm);
129
138
  }
130
139
  });
131
140
  },
132
- disabled: r,
141
+ disabled: n,
133
142
  className: "confirm-label-btn",
134
143
  children: "确认标注"
135
144
  })
136
- }), d && e.confirmStatus === 1 && /* @__PURE__ */ i(s, {
145
+ }), r && e.confirmStatus === 1 && /* @__PURE__ */ i(l, {
137
146
  type: "primary",
138
- onClick: () => a == null ? void 0 : a(1, c.Save),
139
- disabled: r,
147
+ onClick: () => a == null ? void 0 : a(1, h.Save),
148
+ disabled: n,
140
149
  children: "保存标注"
141
- }), d && e.confirmStatus !== 1 && /* @__PURE__ */ i(s, {
150
+ }), r && e.confirmStatus !== 1 && /* @__PURE__ */ i(l, {
142
151
  type: "primary",
143
152
  onClick: () => {
144
- a == null || a(0, c.Confirm);
153
+ a == null || a(0, h.Confirm);
145
154
  },
146
- disabled: r,
155
+ disabled: n,
147
156
  children: "保存标注"
148
- }), y && /* @__PURE__ */ i(s, {
149
- onClick: h,
150
- disabled: r,
157
+ }), L && /* @__PURE__ */ i(l, {
158
+ onClick: g,
159
+ disabled: n,
151
160
  children: "删除数据"
152
161
  })]
153
162
  })]
@@ -156,5 +165,5 @@ const W = (L) => {
156
165
  });
157
166
  };
158
167
  export {
159
- W as default
168
+ _ as default
160
169
  };