@glodon-aiot/dataset-annotation 3.10.0-alpha.18 → 3.10.0-snapshot.16

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 (30) hide show
  1. package/dist/dataset-annotation.js +123598 -0
  2. package/dist/dataset-annotation.umd.cjs +1017 -0
  3. package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +28 -37
  4. package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +1 -1
  5. package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +1 -1
  6. package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +45 -43
  7. package/dist/es/components/PicZipImportModal/index.mjs +220 -219
  8. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +21 -19
  9. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +43 -43
  10. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +230 -247
  11. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +64 -68
  12. package/dist/es/components/VLMAnnotationDetail/index.mjs +174 -177
  13. package/dist/es/index.mjs +1 -1
  14. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  15. package/dist/example/DemoTabs.d.ts +3 -0
  16. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  17. package/dist/example/DetectionImageDemo.d.ts +5 -0
  18. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  19. package/dist/example/OcrImageDemo.d.ts +5 -0
  20. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  21. package/dist/example/constant.local.d.ts +6 -0
  22. package/dist/example/index.d.ts +1 -0
  23. package/dist/lib/index.js +3 -3
  24. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
  25. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  26. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
  27. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
  28. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
  29. package/dist/src/utils/reactCompatibility.d.ts +5 -0
  30. package/package.json +8 -5
@@ -10,20 +10,20 @@ var M = (o, s, n) => s in o ? X(o, s, { enumerable: !0, configurable: !0, writab
10
10
  te.call(s, n) && M(o, n, s[n]);
11
11
  return o;
12
12
  }, A = (o, s) => Y(o, Z(s));
13
- var E = (o, s, n) => new Promise((m, h) => {
13
+ var E = (o, s, n) => new Promise((h, f) => {
14
14
  var l = (c) => {
15
15
  try {
16
16
  a(n.next(c));
17
- } catch (p) {
18
- h(p);
17
+ } catch (m) {
18
+ f(m);
19
19
  }
20
- }, f = (c) => {
20
+ }, p = (c) => {
21
21
  try {
22
22
  a(n.throw(c));
23
- } catch (p) {
24
- h(p);
23
+ } catch (m) {
24
+ f(m);
25
25
  }
26
- }, a = (c) => c.done ? m(c.value) : Promise.resolve(c.value).then(l, f);
26
+ }, a = (c) => c.done ? h(c.value) : Promise.resolve(c.value).then(l, p);
27
27
  a((n = n.apply(o, s)).next());
28
28
  });
29
29
  import { jsxs as u, jsx as i } from "react/jsx-runtime";
@@ -35,14 +35,14 @@ import B from "../../../Iconfont/index.mjs";
35
35
  const de = ie((o, s) => {
36
36
  const {
37
37
  datasetId: n,
38
- versionId: m,
39
- onAttributesChange: h,
38
+ versionId: h,
39
+ onAttributesChange: f,
40
40
  onLoadingChange: l
41
41
  } = o, {
42
42
  services: {
43
- cvforceDatahub: f
43
+ cvforceDatahub: p
44
44
  }
45
- } = ne(oe), [a, c] = b([]), [p, N] = b(!1), [D, g] = b(""), [w, O] = b(!1), [R, y] = b(null), I = re(""), S = (e) => {
45
+ } = ne(oe), [a, c] = b([]), [m, N] = b(!1), [D, g] = b(""), [w, O] = b(!1), [R, y] = b(null), I = re(""), S = (e) => {
46
46
  const t = [...e].sort((r, d) => r.id.localeCompare(d.id));
47
47
  return JSON.stringify(t);
48
48
  }, U = () => S(a) !== I.current, z = () => new Promise((e) => {
@@ -70,8 +70,8 @@ const de = ie((o, s) => {
70
70
  const V = () => E(void 0, null, function* () {
71
71
  N(!0), l == null || l(!0);
72
72
  try {
73
- if (n && m && f) {
74
- const t = (yield f.getDatasetsIdVersionsVidConfigs(n, m)) || [];
73
+ if (n && h && p) {
74
+ const t = (yield p.getDatasetsIdVersionsVidConfigs(n, h)) || [];
75
75
  return c(t), I.current = S(t), t;
76
76
  }
77
77
  } catch (e) {
@@ -126,7 +126,7 @@ const de = ie((o, s) => {
126
126
  }) : d);
127
127
  c(r);
128
128
  }, L = () => E(void 0, null, function* () {
129
- if (!(!n || !m || !f)) {
129
+ if (!(!n || !h || !p)) {
130
130
  N(!0), l == null || l(!0);
131
131
  try {
132
132
  const e = a.map((r) => {
@@ -135,11 +135,11 @@ const de = ie((o, s) => {
135
135
  id: (d = r.id) != null && d.startsWith("attr-") ? "" : r.id
136
136
  });
137
137
  });
138
- console.log("attributes", a), yield f.saveVisionLabelConfigs(n, m, {
138
+ console.log("attributes", a), yield p.saveVisionLabelConfigs(n, h, {
139
139
  data: e
140
140
  });
141
141
  const t = yield V();
142
- C.success("保存成功"), h == null || h(t || a);
142
+ C.success("保存成功"), f == null || f(t || a);
143
143
  } catch (e) {
144
144
  throw console.error("保存属性列表失败:", e), C.error("保存失败"), e;
145
145
  } finally {
@@ -209,7 +209,9 @@ const de = ie((o, s) => {
209
209
  }];
210
210
  return /* @__PURE__ */ u("div", {
211
211
  className: "attribute-detail",
212
- children: [/* @__PURE__ */ i("div", {
212
+ children: [m && /* @__PURE__ */ i("div", {
213
+ children: "加载中..."
214
+ }), /* @__PURE__ */ i("div", {
213
215
  className: "use-tips",
214
216
  children: /* @__PURE__ */ i("div", {
215
217
  children: "使用须知:用户需清楚能从图纸中提取出所有类型的信息,图片中的标注信息(如“零件名称”、“规格型号”),属性定义对应全局"
@@ -327,8 +329,8 @@ const de = ie((o, s) => {
327
329
  children: /* @__PURE__ */ i(T, {
328
330
  children: /* @__PURE__ */ i(v, {
329
331
  type: "primary",
330
- loading: p,
331
- disabled: p,
332
+ loading: m,
333
+ disabled: m,
332
334
  onClick: L,
333
335
  children: "保存"
334
336
  })
@@ -1,20 +1,20 @@
1
- var D = (f, u, i) => new Promise((m, a) => {
2
- var h = (n) => {
1
+ var D = (f, u, i) => new Promise((c, a) => {
2
+ var m = (n) => {
3
3
  try {
4
- d(i.next(n));
5
- } catch (o) {
6
- a(o);
4
+ l(i.next(n));
5
+ } catch (d) {
6
+ a(d);
7
7
  }
8
- }, l = (n) => {
8
+ }, h = (n) => {
9
9
  try {
10
- d(i.throw(n));
11
- } catch (o) {
12
- a(o);
10
+ l(i.throw(n));
11
+ } catch (d) {
12
+ a(d);
13
13
  }
14
- }, d = (n) => n.done ? m(n.value) : Promise.resolve(n.value).then(h, l);
15
- d((i = i.apply(f, u)).next());
14
+ }, l = (n) => n.done ? c(n.value) : Promise.resolve(n.value).then(m, h);
15
+ l((i = i.apply(f, u)).next());
16
16
  });
17
- import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
17
+ import { jsx as e, jsxs as s, Fragment as b } from "react/jsx-runtime";
18
18
  import { forwardRef as z, useState as g, useRef as O, useContext as _, useImperativeHandle as j, useEffect as S } from "react";
19
19
  import "./style.less.mjs";
20
20
  import { Row as E, Col as G, Table as K, Spin as B, Input as R } from "antd";
@@ -26,10 +26,10 @@ const M = z((f, u) => {
26
26
  var w, A;
27
27
  const {
28
28
  sample: i,
29
- visionId: m,
29
+ visionId: c,
30
30
  labels: a,
31
- datasetId: h
32
- } = f, [l, d] = g([]), [n, o] = g([]), [L, p] = g(!1), v = O(null), {
31
+ datasetId: m
32
+ } = f, [h, l] = g([]), [n, d] = g([]), [L, p] = g(!1), v = O(null), {
33
33
  services: {
34
34
  cvforceDatahub: N
35
35
  }
@@ -41,54 +41,54 @@ const M = z((f, u) => {
41
41
  })), S(() => {
42
42
  const t = (i == null ? void 0 : i.labels) || [];
43
43
  if (t.length && (a != null && a.length)) {
44
- const s = t.map((c, I) => {
44
+ const r = t.map((o, I) => {
45
45
  var Q, q;
46
46
  const x = {
47
- id: (Q = c.id) != null ? Q : String(I),
48
- regionId: (q = c.id) != null ? q : String(I),
49
- shape: c.shape
50
- }, T = c.content || {};
47
+ id: (Q = o.id) != null ? Q : String(I),
48
+ regionId: (q = o.id) != null ? q : String(I),
49
+ shape: o.shape
50
+ }, T = o.content || {};
51
51
  return a.forEach((C) => {
52
52
  x[C.id] = T[C.id] || "-";
53
53
  }), x;
54
54
  });
55
- d(s);
55
+ l(r);
56
56
  } else
57
- d([]), o([]);
57
+ l([]), d([]);
58
58
  }, [i == null ? void 0 : i.labels, a]), S(() => {
59
- l.length && y();
60
- }, [l]);
59
+ h.length && y();
60
+ }, [h]);
61
61
  const k = [{
62
62
  title: "序号",
63
63
  key: "index",
64
64
  width: 80,
65
65
  fixed: "left",
66
- render: (t, s, c) => c + 1
66
+ render: (t, r, o) => o + 1
67
67
  }, ...(a || []).map((t) => ({
68
68
  title: t.name,
69
69
  dataIndex: t.id,
70
70
  key: t.id,
71
71
  width: 150,
72
- render: (s) => /* @__PURE__ */ e("span", {
73
- children: s || "-"
72
+ render: (r) => /* @__PURE__ */ e("span", {
73
+ children: r || "-"
74
74
  })
75
75
  }))], y = () => {
76
- p(!0), !(!h || !m || !(i != null && i.id)) && (N == null || N.postGenerateVlmKieQa(h, m, {
76
+ p(!0), !(!m || !c || !(i != null && i.id)) && (N == null || N.postGenerateVlmKieQa(m, c, {
77
77
  sampleIds: [i.id]
78
78
  }).then((t) => {
79
- console.log("QA生成结果:", t), o(t), p(!1);
79
+ console.log("QA生成结果:", t), d(t), p(!1);
80
80
  }).catch((t) => {
81
81
  console.error("QA生成失败:", t), p(!1);
82
82
  }));
83
83
  };
84
- return /* @__PURE__ */ r("div", {
84
+ return /* @__PURE__ */ s("div", {
85
85
  className: "qa-detail",
86
- children: [/* @__PURE__ */ r(E, {
86
+ children: [/* @__PURE__ */ s(E, {
87
87
  className: "infos",
88
88
  gutter: 48,
89
89
  children: [/* @__PURE__ */ e(G, {
90
90
  span: 12,
91
- children: /* @__PURE__ */ r("div", {
91
+ children: /* @__PURE__ */ s("div", {
92
92
  className: "info-item",
93
93
  children: [/* @__PURE__ */ e("div", {
94
94
  className: "info-item-header",
@@ -100,7 +100,7 @@ const M = z((f, u) => {
100
100
  className: "info-item-content table-wrapper",
101
101
  children: /* @__PURE__ */ e(K, {
102
102
  columns: k,
103
- dataSource: l,
103
+ dataSource: h,
104
104
  rowKey: "id",
105
105
  pagination: !1,
106
106
  size: "small",
@@ -114,16 +114,16 @@ const M = z((f, u) => {
114
114
  span: 12,
115
115
  children: /* @__PURE__ */ e(F, {
116
116
  ref: v,
117
- datasetId: h,
118
- visionId: m,
117
+ datasetId: m,
118
+ visionId: c,
119
119
  afterChangeTemplates: () => {
120
- l.length && y();
120
+ y();
121
121
  }
122
122
  })
123
123
  })]
124
- }), /* @__PURE__ */ r("div", {
124
+ }), /* @__PURE__ */ s("div", {
125
125
  className: "qa-result",
126
- children: [/* @__PURE__ */ r("div", {
126
+ children: [/* @__PURE__ */ s("div", {
127
127
  className: "info-item-header",
128
128
  children: [/* @__PURE__ */ e("div", {
129
129
  className: "info-item-title",
@@ -145,10 +145,10 @@ const M = z((f, u) => {
145
145
  }), /* @__PURE__ */ e("div", {
146
146
  className: "result",
147
147
  children: n.length > 0 ? /* @__PURE__ */ e(b, {
148
- children: (A = (w = n[0]) == null ? void 0 : w.qas) != null && A.length ? n[0].qas.map((t, s) => /* @__PURE__ */ r("div", {
148
+ children: (A = (w = n[0]) == null ? void 0 : w.qas) != null && A.length ? n[0].qas.map((t, r) => /* @__PURE__ */ s("div", {
149
149
  className: "result-item-container",
150
150
  style: {
151
- borderBottom: s === n[0].qas.length - 1 ? "none" : "1px solid #D8D8D8"
151
+ borderBottom: r === n[0].qas.length - 1 ? "none" : "1px solid #D8D8D8"
152
152
  },
153
153
  children: [/* @__PURE__ */ e("div", {
154
154
  className: "result-item-header",
@@ -156,7 +156,7 @@ const M = z((f, u) => {
156
156
  className: "result-item-title",
157
157
  children: t.name
158
158
  })
159
- }), /* @__PURE__ */ r("div", {
159
+ }), /* @__PURE__ */ s("div", {
160
160
  className: "result-item-content",
161
161
  children: [/* @__PURE__ */ e("div", {
162
162
  className: "label",
@@ -169,7 +169,7 @@ const M = z((f, u) => {
169
169
  rows: 2
170
170
  })
171
171
  })]
172
- }), /* @__PURE__ */ r("div", {
172
+ }), /* @__PURE__ */ s("div", {
173
173
  className: "result-item-content",
174
174
  children: [/* @__PURE__ */ e("div", {
175
175
  className: "label",
@@ -183,7 +183,7 @@ const M = z((f, u) => {
183
183
  })
184
184
  })]
185
185
  })]
186
- }, s)) : /* @__PURE__ */ e("div", {
186
+ }, r)) : /* @__PURE__ */ e("div", {
187
187
  className: "result-empty",
188
188
  children: "暂无结果"
189
189
  })