@glodon-aiot/dataset-annotation 3.16.0-alpha.40 → 3.16.0-alpha.41

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.
@@ -2,27 +2,27 @@ var z = Object.defineProperty, A = Object.defineProperties;
2
2
  var B = Object.getOwnPropertyDescriptors;
3
3
  var w = Object.getOwnPropertySymbols;
4
4
  var K = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
5
- var N = (s, e, o) => e in s ? z(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o, d = (s, e) => {
6
- for (var o in e || (e = {}))
7
- K.call(e, o) && N(s, o, e[o]);
5
+ var k = (o, e, s) => e in o ? z(o, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[e] = s, d = (o, e) => {
6
+ for (var s in e || (e = {}))
7
+ K.call(e, s) && k(o, s, e[s]);
8
8
  if (w)
9
- for (var o of w(e))
10
- O.call(e, o) && N(s, o, e[o]);
11
- return s;
12
- }, c = (s, e) => A(s, B(e));
13
- import { jsx as a, jsxs as q } from "react/jsx-runtime";
14
- import { useRef as g, useState as i, useEffect as b } from "react";
15
- import { Row as F, Col as G } from "antd";
16
- import { useKeyPress as k } from "ahooks";
9
+ for (var s of w(e))
10
+ O.call(e, s) && k(o, s, e[s]);
11
+ return o;
12
+ }, c = (o, e) => A(o, B(e));
13
+ import { jsx as n, jsxs as q } from "react/jsx-runtime";
14
+ import { useRef as g, useState as t, useEffect as h } from "react";
15
+ import { Row as G, Col as H } from "antd";
16
+ import { useKeyPress as I } from "ahooks";
17
17
  import "./style.less.mjs";
18
- import H from "../OCRBoxMaker/index.mjs";
19
- const ee = (s) => {
20
- var C;
18
+ import J from "../OCRBoxMaker/index.mjs";
19
+ const se = (o) => {
20
+ var p, C;
21
21
  const {
22
22
  // datasetId,
23
23
  currentSample: e,
24
- onNextClick: o,
25
- onPrevClick: h,
24
+ onNextClick: s,
25
+ onPrevClick: b,
26
26
  // labels = [],
27
27
  // editing,
28
28
  onRefresh: x,
@@ -30,61 +30,64 @@ const ee = (s) => {
30
30
  // isPreLabel,
31
31
  // settingHide,
32
32
  // imgCount,
33
- readonly: u,
33
+ readonly: L,
34
34
  // showLabelList = true,
35
- categories: I,
36
- renderLabelItem: L
37
- } = s, R = g(null), U = g(null), y = g({}), [J, j] = i({}), [Q, D] = i(), [f, E] = i(), [M, T] = i(!1), [W, p] = i(!1);
38
- k("rightarrow", () => {
39
- o && o();
40
- }), k("leftarrow", () => {
41
- h && h();
42
- }), b(() => () => {
35
+ categories: y,
36
+ renderLabelItem: U
37
+ } = o, N = g(null), u = g(null), j = g({}), [Q, D] = t({}), [T, E] = t(), [m, F] = t(), [M, W] = t(!1), [X, R] = t(!1);
38
+ I("rightarrow", () => {
39
+ s && s();
40
+ }), I("leftarrow", () => {
41
+ b && b();
42
+ }), h(() => () => {
43
43
  M && x && x();
44
- }, []), b(() => {
45
- var l, n;
46
- if (D(void 0), E(void 0), !((l = e == null ? void 0 : e.labels) != null && l.length))
44
+ }, []), h(() => {
45
+ var l, i;
46
+ if (E(void 0), F(void 0), !((l = e == null ? void 0 : e.labels) != null && l.length))
47
47
  return;
48
- const t = (n = f || e) == null ? void 0 : n.labels.reduce((r, m) => (r[m.id] ? ++r[m.id] : r[m.id] = 1, r), {});
49
- j(t || {});
50
- }, [e, f]), b(() => {
51
- e != null && e.fileUrl && p(!0);
48
+ const a = (i = m || e) == null ? void 0 : i.labels.reduce((r, f) => (r[f.id] ? ++r[f.id] : r[f.id] = 1, r), {});
49
+ D(a || {});
50
+ }, [e, m]), h(() => {
51
+ e != null && e.fileUrl && R(!0);
52
52
  }, [e == null ? void 0 : e.fileUrl]);
53
53
  const P = () => {
54
- U.current && p(!1);
54
+ u.current && R(!1);
55
55
  };
56
- return window.onresize = P, /* @__PURE__ */ a("div", {
56
+ return window.onresize = P, /* @__PURE__ */ n("div", {
57
57
  className: "ocr-mark",
58
- children: /* @__PURE__ */ a(F, {
58
+ children: /* @__PURE__ */ n(G, {
59
59
  className: "ocr-detail",
60
- children: /* @__PURE__ */ q(G, {
60
+ children: /* @__PURE__ */ q(H, {
61
61
  className: "detail-content",
62
- children: [e && /* @__PURE__ */ a(H, {
63
- disabled: u,
62
+ children: [((p = e == null ? void 0 : e.sampleFileName) == null ? void 0 : p.name) && /* @__PURE__ */ n("div", {
63
+ className: "ocr-img-detail-name-overlay",
64
+ children: e.sampleFileName.name
65
+ }), e && /* @__PURE__ */ n(J, {
66
+ disabled: L,
64
67
  id: e.id,
65
- canvasElement: R.current,
68
+ canvasElement: N.current,
66
69
  imageUrl: e == null ? void 0 : e.fileUrl,
67
- categories: I,
68
- labels: (C = e.labels) == null ? void 0 : C.map((t) => c(d({}, t), {
69
- box: t.box.length < 5 ? [...t.box, t.box[0]] : t.box || []
70
+ categories: y,
71
+ labels: (C = e.labels) == null ? void 0 : C.map((a) => c(d({}, a), {
72
+ box: a.box.length < 5 ? [...a.box, a.box[0]] : a.box || []
70
73
  })),
71
- onChange: (t) => {
74
+ onChange: (a) => {
72
75
  const l = c(d({}, e), {
73
- labels: t.map((n) => c(d({}, n), {
74
- box: n.box.length > 4 ? n.box.splice(0, 4) : n.box
76
+ labels: a.map((i) => c(d({}, i), {
77
+ box: i.box.length > 4 ? i.box.splice(0, 4) : i.box
75
78
  }))
76
79
  });
77
80
  v && v(l);
78
81
  },
79
- renderLabelItem: L
80
- }), /* @__PURE__ */ a("div", {
82
+ renderLabelItem: U
83
+ }), /* @__PURE__ */ n("div", {
81
84
  className: "select-main",
82
- ref: y,
83
- onContextMenu: (t) => {
84
- t.preventDefault();
85
+ ref: j,
86
+ onContextMenu: (a) => {
87
+ a.preventDefault();
85
88
  },
86
- children: /* @__PURE__ */ a("canvas", {
87
- ref: R,
89
+ children: /* @__PURE__ */ n("canvas", {
90
+ ref: N,
88
91
  id: "marking-canvas",
89
92
  style: {
90
93
  width: "100%",
@@ -97,5 +100,5 @@ const ee = (s) => {
97
100
  });
98
101
  };
99
102
  export {
100
- ee as default
103
+ se as default
101
104
  };
@@ -108,7 +108,7 @@ const me = T.default || T, {
108
108
  className: "select-main",
109
109
  ref: H,
110
110
  children: [((M = e == null ? void 0 : e.sampleFileName) == null ? void 0 : M.name) && /* @__PURE__ */ t("div", {
111
- className: "img-detail-name-overlay",
111
+ className: "ocr-img-detail-name-overlay",
112
112
  children: e.sampleFileName.name
113
113
  }), /* @__PURE__ */ t(re, {
114
114
  zoomMin: 0.1,