@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.7

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.
Files changed (24) hide show
  1. package/dist/es/components/ClassificationAnnotation/index.mjs +374 -325
  2. package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +82 -78
  3. package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +28 -26
  4. package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +173 -166
  5. package/dist/es/components/DetectionAnnotation/index.mjs +478 -473
  6. package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +249 -230
  7. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +103 -98
  8. package/dist/es/components/OcrAnnotation/index.mjs +281 -248
  9. package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +277 -272
  10. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +42 -40
  11. package/dist/es/components/VLMAnnotationDetail/index.mjs +331 -278
  12. package/dist/es/index.mjs +1 -1
  13. package/dist/es/utils/checkVlmSampleLabeled.mjs +7 -0
  14. package/dist/es/utils/scrollSampleIntoView.mjs +16 -0
  15. package/dist/lib/index.js +4 -4
  16. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -0
  17. package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +2 -0
  18. package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +2 -0
  19. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -0
  20. package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +6 -0
  21. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +5 -0
  22. package/dist/src/utils/checkVlmSampleLabeled.d.ts +8 -0
  23. package/dist/src/utils/scrollSampleIntoView.d.ts +9 -0
  24. package/package.json +2 -2
@@ -1,43 +1,44 @@
1
- import { jsx as t, jsxs as a, Fragment as O } from "react/jsx-runtime";
2
- import { useRef as k, useState as r, useContext as se, useEffect as R } from "react";
3
- import { Modal as w, Button as m, Tabs as V, Tooltip as ie, Space as ne, message as I } from "antd";
1
+ import { jsx as t, jsxs as a, Fragment as k } from "react/jsx-runtime";
2
+ import { useRef as b, useState as r, useContext as le, useEffect as I } from "react";
3
+ import { Modal as w, Button as m, Tabs as z, Tooltip as re, Space as de, message as T } from "antd";
4
4
  import "./style.less.mjs";
5
- import T from "react-json-view";
6
- import { useKeyPress as j } from "ahooks";
7
- import le from "../../MarkDescriptions/index.mjs";
8
- import P from "../../Iconfont/index.mjs";
9
- import re from "../../../DatasetContext/index.mjs";
10
- import de from "../../OCRImageViewer/index.mjs";
11
- import ce from "../../ScanTable/index.mjs";
12
- import me from "../OCRBoxDetail/index.mjs";
13
- import pe from "../../DetectionStatus/index.mjs";
14
- const Ce = T.default || T, {
15
- TabPane: D
16
- } = V, we = (z) => {
17
- var x, u, M;
5
+ import j from "react-json-view";
6
+ import { useKeyPress as P } from "ahooks";
7
+ import ce from "../../MarkDescriptions/index.mjs";
8
+ import D from "../../Iconfont/index.mjs";
9
+ import me from "../../../DatasetContext/index.mjs";
10
+ import Ce from "../../OCRImageViewer/index.mjs";
11
+ import fe from "../../ScanTable/index.mjs";
12
+ import pe from "../OCRBoxDetail/index.mjs";
13
+ import he from "../../DetectionStatus/index.mjs";
14
+ const ge = j.default || j, {
15
+ TabPane: V
16
+ } = z, je = (F) => {
17
+ var M, O, R;
18
18
  const {
19
- mode: p = "preview",
19
+ mode: C = "preview",
20
20
  visible: d,
21
- onClose: C,
22
- record: f,
23
- onNextClick: b,
21
+ onClose: f,
22
+ record: p,
23
+ onNextClick: u,
24
24
  onPrevClick: v,
25
- datasetId: i,
25
+ datasetId: s,
26
26
  versionId: l,
27
- ocrMarkTmpl: n,
28
- handleMarkClick: F,
29
- updateSampleList: J,
27
+ ocrMarkTmpl: i,
28
+ handleMarkClick: J,
29
+ updateSampleList: K,
30
30
  isPreLabel: h,
31
- selectSampleId: K,
31
+ selectSampleId: q,
32
32
  onSave: L,
33
33
  onPending: B,
34
34
  filterMode: E,
35
- pagination: q,
36
- currentIndex: A,
37
- onFilterModeChange: U,
38
- onPaginationChange: W,
39
- samples: G
40
- } = z, H = k(null), Q = k({}), [g, X] = r("annotation"), [e, Y] = r(), [Z, _] = r(), [y, $] = r([]), [S, N] = r(!1), {
35
+ pagination: A,
36
+ currentIndex: U,
37
+ onFilterModeChange: W,
38
+ onPaginationChange: G,
39
+ onCurrentSampleChange: H,
40
+ samples: Q
41
+ } = F, X = b(null), Y = b({}), y = b(0), [g, Z] = r("annotation"), [e, _] = r(), [$, S] = r(), [N, ee] = r([]), [te, x] = r(!1), {
41
42
  services: {
42
43
  cvforceDatahub: o
43
44
  },
@@ -46,40 +47,43 @@ const Ce = T.default || T, {
46
47
  } = {
47
48
  datasetManager: !1
48
49
  }
49
- } = se(re);
50
- j("rightarrow", () => {
51
- b();
52
- }), j("leftarrow", () => {
50
+ } = le(me);
51
+ P("rightarrow", () => {
52
+ u();
53
+ }), P("leftarrow", () => {
53
54
  v();
54
- }), R(() => {
55
- i && (o == null || o.listCategory(i).then((s) => $(s || [])));
56
- }, [i]), R(() => {
57
- d && i && l && f && p === "preview" && (o == null || o.getDatasetsIdVersionsVidSsamplesSid(i, l, f.id).then((s) => {
58
- Y(s);
59
- }));
60
- }, [d, f]);
61
- const ee = () => {
62
- C();
63
- }, te = (s) => {
64
- X(s);
65
- }, ae = (s) => {
66
- _(s);
67
- }, oe = () => {
55
+ }), I(() => {
56
+ s && (o == null || o.listCategory(s).then((n) => ee(n || [])));
57
+ }, [s]), I(() => {
58
+ if (d && s && l && p && C === "preview") {
59
+ const n = ++y.current;
60
+ o == null || o.getDatasetsIdVersionsVidSsamplesSid(s, l, p.id).then((ie) => {
61
+ n === y.current && _(ie);
62
+ });
63
+ }
64
+ }, [d, p]);
65
+ const ae = () => {
66
+ f();
67
+ }, oe = (n) => {
68
+ Z(n);
69
+ }, ne = (n) => {
70
+ S(n);
71
+ }, se = () => {
68
72
  w.confirm({
69
73
  title: "确认要删除此数据吗?",
70
74
  content: "删除后不可恢复,请慎重操作",
71
75
  onOk: () => {
72
- !i || !l || !(e != null && e.id) || o == null || o.delDatasetsIdVersionsVidSamplesId(i, l, e.id).then(() => {
73
- I.success("删除成功"), C(), J();
74
- }).catch(() => I.error("删除失败"));
76
+ !s || !l || !(e != null && e.id) || o == null || o.delDatasetsIdVersionsVidSamplesId(s, l, e.id).then(() => {
77
+ T.success("删除成功"), f(), K();
78
+ }).catch(() => T.error("删除失败"));
75
79
  }
76
80
  });
77
81
  };
78
82
  return /* @__PURE__ */ t(w, {
79
- title: p === "preview" ? /* @__PURE__ */ a("div", {
83
+ title: C === "preview" ? /* @__PURE__ */ a("div", {
80
84
  children: ["详情", /* @__PURE__ */ a("span", {
81
85
  className: "ocr-modal-label-count",
82
- children: ["标注框数量:", (x = e == null ? void 0 : e.labels) == null ? void 0 : x.length]
86
+ children: ["标注框数量:", (M = e == null ? void 0 : e.labels) == null ? void 0 : M.length]
83
87
  })]
84
88
  }) : "标注",
85
89
  width: "100%",
@@ -90,130 +94,131 @@ const Ce = T.default || T, {
90
94
  },
91
95
  open: d,
92
96
  destroyOnClose: !0,
93
- onCancel: () => ee(),
97
+ onCancel: () => ae(),
94
98
  maskClosable: !1,
95
99
  centered: !0,
96
100
  footer: null,
97
- children: p === "preview" ? /* @__PURE__ */ a(O, {
101
+ children: C === "preview" ? /* @__PURE__ */ a(k, {
98
102
  children: [/* @__PURE__ */ a("div", {
99
103
  className: "ocr-detail",
100
104
  children: [/* @__PURE__ */ a("div", {
101
105
  className: "detail-content",
102
106
  children: [/* @__PURE__ */ t(m, {
103
107
  className: "select-prev",
104
- icon: /* @__PURE__ */ t(P, {
108
+ icon: /* @__PURE__ */ t(D, {
105
109
  type: "icon-zuojiantou"
106
110
  }),
107
111
  type: "text",
108
112
  onClick: () => v()
109
113
  }), /* @__PURE__ */ a("div", {
110
114
  className: "select-main",
111
- ref: Q,
112
- children: [((u = e == null ? void 0 : e.sampleFileName) == null ? void 0 : u.name) && /* @__PURE__ */ t("div", {
115
+ ref: Y,
116
+ children: [((O = e == null ? void 0 : e.sampleFileName) == null ? void 0 : O.name) && /* @__PURE__ */ t("div", {
113
117
  className: "ocr-img-detail-name-overlay",
114
118
  children: e.sampleFileName.name
115
119
  }), /* @__PURE__ */ t("div", {
116
120
  className: "ocr-img-status-wrapper",
117
- children: /* @__PURE__ */ t(pe, {
121
+ children: /* @__PURE__ */ t(he, {
118
122
  sample: e
119
123
  })
120
- }), /* @__PURE__ */ t(de, {
124
+ }), /* @__PURE__ */ t(Ce, {
121
125
  zoomMin: 0.1,
122
126
  zoomMax: 10,
123
127
  zoomStep: 0.1,
124
128
  url: (e == null ? void 0 : e.fileUrl) || "",
125
- ref: H,
129
+ ref: X,
126
130
  labels: e == null ? void 0 : e.labels
127
131
  })]
128
132
  }), /* @__PURE__ */ t(m, {
129
133
  className: "select-next",
130
- icon: /* @__PURE__ */ t(P, {
134
+ icon: /* @__PURE__ */ t(D, {
131
135
  type: "icon-youjiantou"
132
136
  }),
133
137
  type: "text",
134
- onClick: () => b()
138
+ onClick: () => u()
135
139
  })]
136
- }), n !== "DetectionOCR" && /* @__PURE__ */ a("div", {
140
+ }), i !== "DetectionOCR" && /* @__PURE__ */ a("div", {
137
141
  className: "detail-slide",
138
142
  children: [/* @__PURE__ */ t("div", {
139
143
  className: "slide-header",
140
- children: /* @__PURE__ */ a(V, {
144
+ children: /* @__PURE__ */ a(z, {
141
145
  className: "header-tab",
142
- onChange: te,
146
+ onChange: oe,
143
147
  activeKey: g,
144
- children: [/* @__PURE__ */ t(D, {
148
+ children: [/* @__PURE__ */ t(V, {
145
149
  tab: "标注信息"
146
- }, "annotation"), /* @__PURE__ */ t(D, {
150
+ }, "annotation"), /* @__PURE__ */ t(V, {
147
151
  tab: "JSON"
148
152
  }, "json")]
149
153
  })
150
154
  }), /* @__PURE__ */ a("div", {
151
155
  className: "slide-main",
152
- children: [g === "annotation" && /* @__PURE__ */ t(O, {
153
- children: n === "TableOCR" ? /* @__PURE__ */ t(ce, {
156
+ children: [g === "annotation" && /* @__PURE__ */ t(k, {
157
+ children: i === "TableOCR" ? /* @__PURE__ */ t(fe, {
154
158
  currentInfer: e == null ? void 0 : e.labels,
155
- onCellSelect: (s) => ae(s),
156
- currentCell: Z
157
- }) : (M = e == null ? void 0 : e.labels) != null && M.length ? /* @__PURE__ */ t(le, {
159
+ onCellSelect: (n) => ne(n),
160
+ currentCell: $
161
+ }) : (R = e == null ? void 0 : e.labels) != null && R.length ? /* @__PURE__ */ t(ce, {
158
162
  labels: e == null ? void 0 : e.labels,
159
- catagories: y
163
+ catagories: N
160
164
  }) : "暂无标注信息"
161
- }), g === "json" && /* @__PURE__ */ t(Ce, {
165
+ }), g === "json" && /* @__PURE__ */ t(ge, {
162
166
  name: !1,
163
167
  iconStyle: "square",
164
168
  indentWidth: 2,
165
169
  displayDataTypes: !1,
166
170
  displayObjectSize: !1,
167
171
  enableClipboard: !1,
168
- src: n === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
172
+ src: i === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
169
173
  })]
170
174
  })]
171
175
  })]
172
176
  }), /* @__PURE__ */ t("div", {
173
177
  className: "ocr-mark-action",
174
- style: n === "DetectionOCR" ? {
178
+ style: i === "DetectionOCR" ? {
175
179
  width: "100%"
176
180
  } : void 0,
177
- children: /* @__PURE__ */ t(ie, {
181
+ children: /* @__PURE__ */ t(re, {
178
182
  title: "预标注进行中,请任务完成后再试",
179
- open: S,
180
- children: /* @__PURE__ */ a(ne, {
181
- onMouseEnter: () => h && N(!0),
182
- onMouseLeave: () => N(!1),
183
+ open: te,
184
+ children: /* @__PURE__ */ a(de, {
185
+ onMouseEnter: () => h && x(!0),
186
+ onMouseLeave: () => x(!1),
183
187
  children: [c && c.label && /* @__PURE__ */ t(m, {
184
188
  type: "primary",
185
- disabled: n !== "StructKVCOCR" && n !== "DetectionOCR" || h,
186
- onClick: () => F(e == null ? void 0 : e.id),
189
+ disabled: i !== "StructKVCOCR" && i !== "DetectionOCR" || h,
190
+ onClick: () => J(e == null ? void 0 : e.id),
187
191
  children: "标注"
188
192
  }), c && c.delete && /* @__PURE__ */ t(m, {
189
193
  danger: !0,
190
194
  type: "ghost",
191
- onClick: oe,
195
+ onClick: se,
192
196
  disabled: h,
193
197
  children: "删除数据"
194
198
  })]
195
199
  })
196
200
  })
197
201
  })]
198
- }) : /* @__PURE__ */ t(me, {
202
+ }) : /* @__PURE__ */ t(pe, {
199
203
  visible: d,
200
- selectSampleId: K,
201
- ocrMarkTmpl: n,
202
- datasetId: i,
204
+ selectSampleId: q,
205
+ ocrMarkTmpl: i,
206
+ datasetId: s,
203
207
  versionId: l,
204
- onClose: C,
208
+ onClose: f,
205
209
  onSave: L,
206
210
  onPending: B,
207
- categories: y,
211
+ categories: N,
208
212
  externalFilterMode: E,
209
- onFilterModeChange: U,
210
- onPaginationChange: W,
211
- externalSamples: G,
212
- externalPagination: q,
213
- externalCurrentIndex: A
213
+ onFilterModeChange: W,
214
+ onPaginationChange: G,
215
+ onCurrentSampleChange: H,
216
+ externalSamples: Q,
217
+ externalPagination: A,
218
+ externalCurrentIndex: U
214
219
  })
215
220
  });
216
221
  };
217
222
  export {
218
- we as default
223
+ je as default
219
224
  };