@glodon-aiot/dataset-annotation 3.14.0-alpha.33 → 3.15.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.
- package/dist/es/DatasetContext/index.mjs +3 -6
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +91 -94
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +28 -37
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +101 -145
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +195 -256
- package/dist/es/components/DetectionAnnotation/index.mjs +424 -456
- package/dist/es/components/Iconfont/index.mjs +2 -2
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +45 -43
- package/dist/es/components/PicZipImportModal/index.mjs +293 -308
- package/dist/es/components/PreLabelOCR/index.mjs +1 -1
- package/dist/es/constant.mjs +3 -3
- package/dist/es/featuresConfig.mjs +9 -13
- package/dist/es/index.mjs +7 -11
- package/dist/lib/index.js +3 -4
- package/dist/src/DatasetContext/index.d.ts +0 -2
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +0 -1
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/featuresConfig.d.ts +0 -4
- package/dist/src/index.d.ts +0 -3
- package/package.json +2 -2
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +0 -129
- package/dist/es/components/DetectionAnnotation/components/ImageModal/style.less.mjs +0 -4
- package/dist/es/components/PicZipImportModal/config.mjs +0 -47
- package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +0 -4
- package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/RegionItem.mjs +0 -170
- package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +0 -94
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.mjs +0 -193
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +0 -116
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +0 -115
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +0 -42
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +0 -55
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +0 -51
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +0 -62
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +0 -484
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.mjs +0 -100
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +0 -106
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +0 -101
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.mjs +0 -103
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +0 -38
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +0 -173
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +0 -72
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +0 -218
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +0 -98
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +0 -156
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/ai.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/error.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/loading.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/star.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +0 -678
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +0 -33
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/AIErrorTooltip.less.mjs +0 -4
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/index.mjs +0 -24
- package/dist/es/components/VLMAnnotation/components/DragButton.mjs +0 -18
- package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +0 -16
- package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +0 -30
- package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +0 -40
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +0 -44
- package/dist/es/components/VLMAnnotation/constants.mjs +0 -57
- package/dist/es/components/VLMAnnotation/index.mjs +0 -279
- package/dist/es/components/VLMAnnotation/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +0 -343
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +0 -240
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +0 -201
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +0 -455
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +0 -149
- package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/index.mjs +0 -449
- package/dist/es/components/VLMAnnotationDetail/style.less.mjs +0 -4
- package/dist/es/createVlmtasetAnnotation/index.mjs +0 -131
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +0 -34
- package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
- package/dist/src/components/PicZipImportModal/config.d.ts +0 -23
- package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/RegionItem.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.d.ts +0 -16
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +0 -38
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +0 -18
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +0 -22
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +0 -35
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.d.ts +0 -16
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +0 -11
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +0 -29
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.d.ts +0 -31
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +0 -41
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +0 -12
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +0 -16
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +0 -32
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +0 -25
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +0 -32
- package/dist/src/components/VLMAnnotation/components/AIErrorTooltip/index.d.ts +0 -8
- package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +0 -6
- package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/constants.d.ts +0 -113
- package/dist/src/components/VLMAnnotation/index.d.ts +0 -6
- package/dist/src/components/VLMAnnotation/types.d.ts +0 -187
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +0 -14
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +0 -17
- package/dist/src/components/VLMAnnotationDetail/index.d.ts +0 -6
- package/dist/src/createVlmtasetAnnotation/index.d.ts +0 -16
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as U, useState as k, useEffect as $ } from "react";
|
|
3
|
-
import { Tooltip as V, Input as W } from "antd";
|
|
4
|
-
import { UpOutlined as q } from "@ant-design/icons";
|
|
5
|
-
import G from "./VLMLabelMaker/icons/del.png.mjs";
|
|
6
|
-
import H from "./VLMLabelMaker/icons/ai.svg.mjs";
|
|
7
|
-
import J from "./VLMLabelMaker/icons/star.svg.mjs";
|
|
8
|
-
import K from "./VLMLabelMaker/icons/loading.svg.mjs";
|
|
9
|
-
const F = ({
|
|
10
|
-
name: P,
|
|
11
|
-
labelDefinitions: v,
|
|
12
|
-
region: m,
|
|
13
|
-
isSelected: g,
|
|
14
|
-
isActive: l,
|
|
15
|
-
activeLabelId: a,
|
|
16
|
-
onChange: x,
|
|
17
|
-
onFocus: h,
|
|
18
|
-
onBlur: N,
|
|
19
|
-
onDelete: T,
|
|
20
|
-
onRegionClick: c,
|
|
21
|
-
onOCR: M,
|
|
22
|
-
isOCRRecognizing: p,
|
|
23
|
-
hasOCRError: w,
|
|
24
|
-
readOnly: d
|
|
25
|
-
}) => {
|
|
26
|
-
const n = U(null), u = U(/* @__PURE__ */ new Map()), [f, I] = k(!1);
|
|
27
|
-
return $(() => {
|
|
28
|
-
g && n.current && (I(!1), setTimeout(() => {
|
|
29
|
-
n.current && n.current.scrollIntoView({
|
|
30
|
-
behavior: "smooth",
|
|
31
|
-
block: "nearest",
|
|
32
|
-
inline: "nearest"
|
|
33
|
-
});
|
|
34
|
-
}, 200));
|
|
35
|
-
}, [g]), $(() => {
|
|
36
|
-
l && n.current && (I(!1), setTimeout(() => {
|
|
37
|
-
n.current && n.current.scrollIntoView({
|
|
38
|
-
behavior: "smooth",
|
|
39
|
-
block: "nearest",
|
|
40
|
-
inline: "nearest"
|
|
41
|
-
});
|
|
42
|
-
}, 200));
|
|
43
|
-
}, [l]), $(() => {
|
|
44
|
-
if (l && a) {
|
|
45
|
-
const t = u.current.get(a);
|
|
46
|
-
t != null && t.input ? t.input.focus() : setTimeout(() => {
|
|
47
|
-
const r = u.current.get(a);
|
|
48
|
-
r != null && r.input && r.input.focus();
|
|
49
|
-
}, 100);
|
|
50
|
-
}
|
|
51
|
-
}, [l, a]), /* @__PURE__ */ i("div", {
|
|
52
|
-
ref: n,
|
|
53
|
-
className: `vlm-text-region ${g || l ? "vlm-text-region-selected" : ""} ${f ? "vlm-text-region-collapsed" : ""}`,
|
|
54
|
-
children: [/* @__PURE__ */ i("div", {
|
|
55
|
-
className: "vlm-text-region-header",
|
|
56
|
-
onClick: (t) => {
|
|
57
|
-
const r = t.target;
|
|
58
|
-
r.closest(".vlm-text-region-delete-btn") !== null || r.closest(".vlm-text-region-collapse-icon") !== null || c == null || c(m);
|
|
59
|
-
},
|
|
60
|
-
children: [/* @__PURE__ */ e("span", {
|
|
61
|
-
className: `vlm-text-region-collapse-icon ${f ? "vlm-text-region-collapse-icon-collapsed" : ""}`,
|
|
62
|
-
onClick: (t) => {
|
|
63
|
-
t.stopPropagation(), I(!f);
|
|
64
|
-
},
|
|
65
|
-
children: /* @__PURE__ */ e(q, {})
|
|
66
|
-
}), /* @__PURE__ */ e("span", {
|
|
67
|
-
className: "vlm-text-region-name",
|
|
68
|
-
children: P
|
|
69
|
-
}), /* @__PURE__ */ i("div", {
|
|
70
|
-
className: "vlm-text-region-actions",
|
|
71
|
-
children: [!d && M && /* @__PURE__ */ e(V, {
|
|
72
|
-
title: p ? "识别中..." : w ? "预置服务调用失败" : "OCR识别",
|
|
73
|
-
children: /* @__PURE__ */ e("span", {
|
|
74
|
-
className: `vlm-text-region-ocr-btn ${p ? "vlm-text-region-ocr-btn-loading" : ""} ${w ? "vlm-text-region-ocr-btn-error" : ""}`,
|
|
75
|
-
onClick: (t) => {
|
|
76
|
-
t.stopPropagation(), p || M(m.id);
|
|
77
|
-
},
|
|
78
|
-
children: /* @__PURE__ */ i("div", {
|
|
79
|
-
className: "vlm-text-region-ocr-icon-wrapper",
|
|
80
|
-
children: [/* @__PURE__ */ e("img", {
|
|
81
|
-
src: H,
|
|
82
|
-
alt: "OCR识别",
|
|
83
|
-
className: "vlm-text-region-ocr-icon"
|
|
84
|
-
}), p ? /* @__PURE__ */ e("img", {
|
|
85
|
-
src: K,
|
|
86
|
-
alt: "",
|
|
87
|
-
className: "vlm-text-region-ocr-status vlm-text-region-ocr-loading"
|
|
88
|
-
}) : w ? /* @__PURE__ */ i("svg", {
|
|
89
|
-
className: "vlm-text-region-ocr-status vlm-text-region-ocr-error-icon",
|
|
90
|
-
width: "12",
|
|
91
|
-
height: "12",
|
|
92
|
-
viewBox: "0 0 12 12",
|
|
93
|
-
fill: "none",
|
|
94
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
95
|
-
children: [/* @__PURE__ */ e("circle", {
|
|
96
|
-
cx: "6",
|
|
97
|
-
cy: "6",
|
|
98
|
-
r: "5.5",
|
|
99
|
-
fill: "#ff4d4f",
|
|
100
|
-
stroke: "none"
|
|
101
|
-
}), /* @__PURE__ */ e("path", {
|
|
102
|
-
d: "M6 3.5v3M6 8.5h.01",
|
|
103
|
-
stroke: "#fff",
|
|
104
|
-
strokeWidth: "1.2",
|
|
105
|
-
strokeLinecap: "round"
|
|
106
|
-
})]
|
|
107
|
-
}) : /* @__PURE__ */ e("img", {
|
|
108
|
-
src: J,
|
|
109
|
-
alt: "",
|
|
110
|
-
className: "vlm-text-region-ocr-status vlm-text-region-ocr-star"
|
|
111
|
-
})]
|
|
112
|
-
})
|
|
113
|
-
})
|
|
114
|
-
}), !d && T && /* @__PURE__ */ e("span", {
|
|
115
|
-
className: "vlm-text-region-delete-btn",
|
|
116
|
-
onClick: (t) => {
|
|
117
|
-
t.stopPropagation(), T(m.id);
|
|
118
|
-
},
|
|
119
|
-
title: "删除",
|
|
120
|
-
children: /* @__PURE__ */ e("img", {
|
|
121
|
-
src: G,
|
|
122
|
-
alt: "删除",
|
|
123
|
-
className: "vlm-text-region-delete-icon"
|
|
124
|
-
})
|
|
125
|
-
})]
|
|
126
|
-
})]
|
|
127
|
-
}), /* @__PURE__ */ e("div", {
|
|
128
|
-
className: `vlm-text-region-content ${f ? "vlm-text-region-content-collapsed" : ""}`,
|
|
129
|
-
onClick: (t) => {
|
|
130
|
-
const r = t.target;
|
|
131
|
-
r.tagName === "INPUT" || r.closest("input") !== null || c == null || c(m);
|
|
132
|
-
},
|
|
133
|
-
children: v == null ? void 0 : v.map((t) => {
|
|
134
|
-
const r = l && a === t.id;
|
|
135
|
-
return /* @__PURE__ */ i("div", {
|
|
136
|
-
className: "vlm-text-label",
|
|
137
|
-
children: [t.name, /* @__PURE__ */ e("br", {}), /* @__PURE__ */ e(W, {
|
|
138
|
-
ref: (o) => {
|
|
139
|
-
o ? u.current.set(t.id, o) : u.current.delete(t.id);
|
|
140
|
-
},
|
|
141
|
-
value: m.content[t.id],
|
|
142
|
-
onFocus: (o) => {
|
|
143
|
-
h == null || h(t.id, o.target.value || ""), setTimeout(() => {
|
|
144
|
-
const s = u.current.get(t.id);
|
|
145
|
-
s != null && s.input && s.input.focus();
|
|
146
|
-
}, 0);
|
|
147
|
-
},
|
|
148
|
-
onBlur: (o) => {
|
|
149
|
-
console.log("onBlur", o);
|
|
150
|
-
const s = o.relatedTarget, j = (s == null ? void 0 : s.tagName) === "INPUT" || (s == null ? void 0 : s.closest("input")) !== null;
|
|
151
|
-
if (r && !j) {
|
|
152
|
-
o.target.focus();
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
N == null || N(t.id, o.target.value || "");
|
|
156
|
-
},
|
|
157
|
-
onChange: (o) => {
|
|
158
|
-
x == null || x(t.id, o.target.value || "");
|
|
159
|
-
},
|
|
160
|
-
allowClear: !d,
|
|
161
|
-
readOnly: d
|
|
162
|
-
})]
|
|
163
|
-
}, t.id);
|
|
164
|
-
})
|
|
165
|
-
})]
|
|
166
|
-
}, P);
|
|
167
|
-
};
|
|
168
|
-
export {
|
|
169
|
-
F as default
|
|
170
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
var B = Object.defineProperty, H = Object.defineProperties;
|
|
2
|
-
var J = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var S = Object.getOwnPropertySymbols;
|
|
4
|
-
var K = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var T = (m, d, t) => d in m ? B(m, d, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[d] = t, c = (m, d) => {
|
|
6
|
-
for (var t in d || (d = {}))
|
|
7
|
-
K.call(d, t) && T(m, t, d[t]);
|
|
8
|
-
if (S)
|
|
9
|
-
for (var t of S(d))
|
|
10
|
-
Q.call(d, t) && T(m, t, d[t]);
|
|
11
|
-
return m;
|
|
12
|
-
}, _ = (m, d) => H(m, J(d));
|
|
13
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
14
|
-
import { Empty as R } from "antd";
|
|
15
|
-
import U from "./RegionItem.mjs";
|
|
16
|
-
import { REGION_NAME_PREFIX as W } from "./constants.mjs";
|
|
17
|
-
const V = ({
|
|
18
|
-
labelDefinitions: m,
|
|
19
|
-
labels: d,
|
|
20
|
-
selectedRegion: t,
|
|
21
|
-
activeLabelValue: A,
|
|
22
|
-
activeRegionNumber: X,
|
|
23
|
-
onChange: u,
|
|
24
|
-
onInputActive: $,
|
|
25
|
-
onBlur: j,
|
|
26
|
-
onDelete: f,
|
|
27
|
-
onRegionClick: k,
|
|
28
|
-
onOCR: q,
|
|
29
|
-
ocrRecognizing: F,
|
|
30
|
-
ocrErrors: I,
|
|
31
|
-
readOnly: w
|
|
32
|
-
}) => !d || d.length === 0 ? /* @__PURE__ */ y("div", {
|
|
33
|
-
className: "vlm-text-panel",
|
|
34
|
-
children: /* @__PURE__ */ y("div", {
|
|
35
|
-
className: "vlm-text-panel-empty",
|
|
36
|
-
children: /* @__PURE__ */ y(R, {
|
|
37
|
-
description: "暂无标注数据,按R键开始标注吧"
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
}) : /* @__PURE__ */ y("div", {
|
|
41
|
-
className: "vlm-text-panel",
|
|
42
|
-
children: d.map((p, N) => {
|
|
43
|
-
var G, M;
|
|
44
|
-
const E = A != null && X === N && A.region.id === p.id, x = E ? A.label.id : void 0;
|
|
45
|
-
return /* @__PURE__ */ y(U, {
|
|
46
|
-
name: `${W}${N + 1}`,
|
|
47
|
-
labelDefinitions: m != null ? m : [],
|
|
48
|
-
region: p,
|
|
49
|
-
isSelected: (t == null ? void 0 : t.id) === p.id,
|
|
50
|
-
isActive: E,
|
|
51
|
-
activeLabelId: x,
|
|
52
|
-
readOnly: w,
|
|
53
|
-
onDelete: f,
|
|
54
|
-
onRegionClick: k,
|
|
55
|
-
onOCR: q,
|
|
56
|
-
isOCRRecognizing: (G = F == null ? void 0 : F.has(p.id)) != null ? G : !1,
|
|
57
|
-
hasOCRError: (M = I == null ? void 0 : I.has(p.id)) != null ? M : !1,
|
|
58
|
-
onFocus: (O) => {
|
|
59
|
-
const r = m == null ? void 0 : m.find((P) => P.id === O);
|
|
60
|
-
if (!r)
|
|
61
|
-
return;
|
|
62
|
-
const v = d == null ? void 0 : d[N];
|
|
63
|
-
v && ($ ? $({
|
|
64
|
-
label: r,
|
|
65
|
-
region: c({}, v)
|
|
66
|
-
}, N) : u == null || u({
|
|
67
|
-
label: r,
|
|
68
|
-
region: v
|
|
69
|
-
}, N));
|
|
70
|
-
},
|
|
71
|
-
onBlur: (O) => {
|
|
72
|
-
const r = m == null ? void 0 : m.find((v) => v.id === O);
|
|
73
|
-
r && (r && j ? j({
|
|
74
|
-
label: r,
|
|
75
|
-
region: c({}, p)
|
|
76
|
-
}, N) : u == null || u(null));
|
|
77
|
-
},
|
|
78
|
-
onChange: (O, r) => {
|
|
79
|
-
const v = m == null ? void 0 : m.find((P) => P.id === O);
|
|
80
|
-
v && u && u({
|
|
81
|
-
label: v,
|
|
82
|
-
region: _(c({}, p), {
|
|
83
|
-
content: _(c({}, p.content), {
|
|
84
|
-
[O]: r
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
}, N);
|
|
88
|
-
}
|
|
89
|
-
}, p.id);
|
|
90
|
-
})
|
|
91
|
-
});
|
|
92
|
-
export {
|
|
93
|
-
V as default
|
|
94
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { useRef as rt, useEffect as ft } from "react";
|
|
2
|
-
import { fabric as Z } from "fabric";
|
|
3
|
-
import { AI_CONTROL_OFFSET_X as ut, AI_CONTROL_OFFSET_Y as Ct, AI_ICON_SIZE as st } from "../../constants.mjs";
|
|
4
|
-
const Ft = ({
|
|
5
|
-
canvas: l,
|
|
6
|
-
ocrErrorRef: k,
|
|
7
|
-
rectMapRef: D,
|
|
8
|
-
onAIButtonHover: n
|
|
9
|
-
}) => {
|
|
10
|
-
const G = rt(null), J = rt(null);
|
|
11
|
-
ft(() => {
|
|
12
|
-
if (!l || !n)
|
|
13
|
-
return;
|
|
14
|
-
const O = /* @__PURE__ */ new Map(), lt = (S) => {
|
|
15
|
-
var h;
|
|
16
|
-
const a = (h = S.controls) == null ? void 0 : h.ocrControl;
|
|
17
|
-
if (!a)
|
|
18
|
-
return;
|
|
19
|
-
const E = a.render;
|
|
20
|
-
E && !a._intercepted && (a.render = (q, F, c, i, _) => {
|
|
21
|
-
O.set(S, {
|
|
22
|
-
x: F,
|
|
23
|
-
y: c
|
|
24
|
-
}), E && E(q, F, c, i, _);
|
|
25
|
-
}, a._intercepted = !0);
|
|
26
|
-
}, K = (S) => {
|
|
27
|
-
var et;
|
|
28
|
-
const a = S.e, h = l.getElement().getBoundingClientRect(), q = a.clientX - h.left, F = a.clientY - h.top;
|
|
29
|
-
let c = null, i = null;
|
|
30
|
-
const _ = l.getActiveObject();
|
|
31
|
-
if (!_ || !(_ instanceof Z.Rect)) {
|
|
32
|
-
n(null, null);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const o = _, W = D.current.get(o);
|
|
36
|
-
if (!W) {
|
|
37
|
-
n(null, null);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const $ = W.id;
|
|
41
|
-
if (!k.current.has($)) {
|
|
42
|
-
n(null, null);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const y = (et = o.controls) == null ? void 0 : et.ocrControl;
|
|
46
|
-
if (!y) {
|
|
47
|
-
n(null, null);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const U = ut, V = Ct + st + 4;
|
|
51
|
-
lt(o);
|
|
52
|
-
let x = O.get(o);
|
|
53
|
-
if (!x) {
|
|
54
|
-
try {
|
|
55
|
-
if (o._calcControlPosition && typeof o._calcControlPosition == "function") {
|
|
56
|
-
const t = o._calcControlPosition(y);
|
|
57
|
-
t && (x = {
|
|
58
|
-
x: t.x,
|
|
59
|
-
y: t.y
|
|
60
|
-
}, O.set(o, x));
|
|
61
|
-
}
|
|
62
|
-
} catch (t) {
|
|
63
|
-
}
|
|
64
|
-
if (!x)
|
|
65
|
-
try {
|
|
66
|
-
const t = o.getCoords();
|
|
67
|
-
if (t && t.length >= 4) {
|
|
68
|
-
const e = t[1], L = t[2], f = t[0], M = e, u = {
|
|
69
|
-
x: L.x - e.x,
|
|
70
|
-
y: L.y - e.y
|
|
71
|
-
}, C = {
|
|
72
|
-
x: f.x - e.x,
|
|
73
|
-
y: f.y - e.y
|
|
74
|
-
}, r = Math.sqrt(u.x * u.x + u.y * u.y), s = Math.sqrt(C.x * C.x + C.y * C.y), b = r > 1e-3 ? {
|
|
75
|
-
x: u.x / r,
|
|
76
|
-
y: u.y / r
|
|
77
|
-
} : {
|
|
78
|
-
x: 1,
|
|
79
|
-
y: 0
|
|
80
|
-
}, P = s > 1e-3 ? {
|
|
81
|
-
x: C.x / s,
|
|
82
|
-
y: C.y / s
|
|
83
|
-
} : {
|
|
84
|
-
x: 0,
|
|
85
|
-
y: -1
|
|
86
|
-
}, T = M.x + b.x * U - P.x * V, z = M.y + b.y * U - P.y * V;
|
|
87
|
-
x = {
|
|
88
|
-
x: T,
|
|
89
|
-
y: z
|
|
90
|
-
}, O.set(o, x);
|
|
91
|
-
}
|
|
92
|
-
} catch (t) {
|
|
93
|
-
console.warn("[useAIButtonHover] Failed to calculate control position:", t);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const d = o.getCoords();
|
|
97
|
-
if (!d || d.length < 4) {
|
|
98
|
-
n(null, null);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const A = d[0], R = d[1], H = d[2];
|
|
102
|
-
d[3];
|
|
103
|
-
const B = R, p = {
|
|
104
|
-
x: H.x - R.x,
|
|
105
|
-
y: H.y - R.y
|
|
106
|
-
}, m = {
|
|
107
|
-
x: A.x - R.x,
|
|
108
|
-
y: A.y - R.y
|
|
109
|
-
}, I = Math.sqrt(p.x * p.x + p.y * p.y), N = Math.sqrt(m.x * m.x + m.y * m.y), tt = I > 1e-3 ? {
|
|
110
|
-
x: p.x / I,
|
|
111
|
-
y: p.y / I
|
|
112
|
-
} : {
|
|
113
|
-
x: 1,
|
|
114
|
-
y: 0
|
|
115
|
-
}, ot = N > 1e-3 ? {
|
|
116
|
-
x: m.x / N,
|
|
117
|
-
y: m.y / N
|
|
118
|
-
} : {
|
|
119
|
-
x: 0,
|
|
120
|
-
y: -1
|
|
121
|
-
}, it = B.x + tt.x * U - ot.x * V, yt = B.y + tt.y * U - ot.y * V, v = st / 2, w = 8;
|
|
122
|
-
let g = null;
|
|
123
|
-
try {
|
|
124
|
-
if (o._calcControlPosition && typeof o._calcControlPosition == "function") {
|
|
125
|
-
const t = o._calcControlPosition(y);
|
|
126
|
-
t && (g = {
|
|
127
|
-
x: t.x,
|
|
128
|
-
y: t.y
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
if (!g && o.calcCoords) {
|
|
132
|
-
const t = o.calcCoords();
|
|
133
|
-
if (t && y.x !== void 0 && y.y !== void 0) {
|
|
134
|
-
const e = y.x, L = y.y, f = y.offsetX || 0, M = y.offsetY || 0, u = t.tr.x, C = t.tr.y, r = {
|
|
135
|
-
x: t.br.x - t.tr.x,
|
|
136
|
-
y: t.br.y - t.tr.y
|
|
137
|
-
}, s = {
|
|
138
|
-
x: t.tl.x - t.tr.x,
|
|
139
|
-
y: t.tl.y - t.tr.y
|
|
140
|
-
}, b = Math.sqrt(r.x * r.x + r.y * r.y), P = Math.sqrt(s.x * s.x + s.y * s.y), T = b > 1e-3 ? {
|
|
141
|
-
x: r.x / b,
|
|
142
|
-
y: r.y / b
|
|
143
|
-
} : {
|
|
144
|
-
x: 1,
|
|
145
|
-
y: 0
|
|
146
|
-
}, z = P > 1e-3 ? {
|
|
147
|
-
x: s.x / P,
|
|
148
|
-
y: s.y / P
|
|
149
|
-
} : {
|
|
150
|
-
x: 0,
|
|
151
|
-
y: -1
|
|
152
|
-
}, xt = u + T.x * f - z.x * M, at = C + T.y * f - z.y * M;
|
|
153
|
-
g = {
|
|
154
|
-
x: xt,
|
|
155
|
-
y: at
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
} catch (t) {
|
|
160
|
-
console.warn("[useAIButtonHover] Failed to calculate fabric control position:", t);
|
|
161
|
-
}
|
|
162
|
-
const nt = l.viewportTransform;
|
|
163
|
-
if (!nt) {
|
|
164
|
-
n(null, null);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
let X, Y;
|
|
168
|
-
if (x)
|
|
169
|
-
X = x.x, Y = x.y;
|
|
170
|
-
else {
|
|
171
|
-
const t = g ? g.x : it, e = g ? g.y : yt, L = new Z.Point(t, e), f = Z.util.transformPoint(L, nt);
|
|
172
|
-
X = f.x, Y = f.y;
|
|
173
|
-
}
|
|
174
|
-
if (q >= X - v - w && q <= X + v + w && F >= Y - v - w && F <= Y + v + w) {
|
|
175
|
-
const t = h.left + X, e = h.top + Y;
|
|
176
|
-
c = $, i = {
|
|
177
|
-
x: t,
|
|
178
|
-
y: e
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
const ct = G.current, j = J.current;
|
|
182
|
-
(c !== ct || c && i && (!j || j.x !== i.x || j.y !== i.y) || !c && ct !== null) && (c && i ? n(c, i) : n(null, null), G.current = c, J.current = i);
|
|
183
|
-
}, Q = () => {
|
|
184
|
-
n && n(null, null);
|
|
185
|
-
};
|
|
186
|
-
return l.on("mouse:move", K), l.on("mouse:out", Q), () => {
|
|
187
|
-
l.off("mouse:move", K), l.off("mouse:out", Q);
|
|
188
|
-
};
|
|
189
|
-
}, [l, k, D, n]);
|
|
190
|
-
};
|
|
191
|
-
export {
|
|
192
|
-
Ft as useAIButtonHover
|
|
193
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { useEffect as b } from "react";
|
|
2
|
-
import { fabric as c } from "fabric";
|
|
3
|
-
const O = ({
|
|
4
|
-
canvas: e,
|
|
5
|
-
draggable: i,
|
|
6
|
-
drawingMode: f,
|
|
7
|
-
textLayersMapRef: n
|
|
8
|
-
}) => {
|
|
9
|
-
const u = () => {
|
|
10
|
-
const s = /* @__PURE__ */ new Set();
|
|
11
|
-
return n.current.forEach((l) => {
|
|
12
|
-
l.forEach((r) => {
|
|
13
|
-
s.add(r);
|
|
14
|
-
});
|
|
15
|
-
}), s;
|
|
16
|
-
};
|
|
17
|
-
b(() => {
|
|
18
|
-
if (!e || f) {
|
|
19
|
-
if (e) {
|
|
20
|
-
e.selection = !1, e.skipTargetFind = !1;
|
|
21
|
-
const o = u();
|
|
22
|
-
e.getObjects().forEach((t) => {
|
|
23
|
-
t instanceof c.Rect && o.has(t) ? t.set({
|
|
24
|
-
evented: !0,
|
|
25
|
-
selectable: !1,
|
|
26
|
-
lockMovementX: !0,
|
|
27
|
-
lockMovementY: !0,
|
|
28
|
-
lockScalingX: !0,
|
|
29
|
-
lockScalingY: !0,
|
|
30
|
-
lockRotation: !0
|
|
31
|
-
}) : t.set({
|
|
32
|
-
evented: !0,
|
|
33
|
-
selectable: !0,
|
|
34
|
-
lockMovementX: !1,
|
|
35
|
-
lockMovementY: !1,
|
|
36
|
-
lockScalingX: !1,
|
|
37
|
-
lockScalingY: !1
|
|
38
|
-
});
|
|
39
|
-
}), e.defaultCursor = "default";
|
|
40
|
-
}
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (!i) {
|
|
44
|
-
e.selection = !1, e.skipTargetFind = !1;
|
|
45
|
-
const o = u();
|
|
46
|
-
e.getObjects().forEach((t) => {
|
|
47
|
-
t instanceof c.Rect && o.has(t) ? t.set({
|
|
48
|
-
evented: !0,
|
|
49
|
-
selectable: !1,
|
|
50
|
-
lockMovementX: !0,
|
|
51
|
-
lockMovementY: !0,
|
|
52
|
-
lockScalingX: !0,
|
|
53
|
-
lockScalingY: !0,
|
|
54
|
-
lockRotation: !0
|
|
55
|
-
}) : t.set({
|
|
56
|
-
evented: !0,
|
|
57
|
-
selectable: !0,
|
|
58
|
-
lockMovementX: !1,
|
|
59
|
-
lockMovementY: !1,
|
|
60
|
-
lockScalingX: !1,
|
|
61
|
-
lockScalingY: !1
|
|
62
|
-
});
|
|
63
|
-
}), e.defaultCursor = "default";
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
e.selection = !1, e.skipTargetFind = !0, e.getActiveObject() && (e.discardActiveObject(), e.renderAll()), e.getObjects().forEach((o) => {
|
|
67
|
-
o.set({
|
|
68
|
-
evented: !1,
|
|
69
|
-
selectable: !1,
|
|
70
|
-
lockMovementX: !0,
|
|
71
|
-
lockMovementY: !0,
|
|
72
|
-
lockScalingX: !0,
|
|
73
|
-
lockScalingY: !0,
|
|
74
|
-
lockRotation: !0
|
|
75
|
-
});
|
|
76
|
-
}), e.defaultCursor = "grab";
|
|
77
|
-
let l = !1;
|
|
78
|
-
const r = (o) => {
|
|
79
|
-
e.getActiveObject() && (e.discardActiveObject(), e.renderAll()), l = !0, e.selection = !1, e.skipTargetFind = !0, e.setCursor("grabbing");
|
|
80
|
-
}, k = (o) => {
|
|
81
|
-
if (l && o && o.e) {
|
|
82
|
-
const t = o.e, m = new c.Point(t.movementX, t.movementY);
|
|
83
|
-
e.relativePan(m);
|
|
84
|
-
}
|
|
85
|
-
}, d = () => {
|
|
86
|
-
l = !1, e.selection = !1, e.skipTargetFind = !0, e.defaultCursor = "grab", e.setCursor("grab"), e.getActiveObject() && (e.discardActiveObject(), e.renderAll());
|
|
87
|
-
}, g = () => {
|
|
88
|
-
e.setCursor("grabbing");
|
|
89
|
-
};
|
|
90
|
-
return e.on("mouse:down", r), e.on("mouse:move", k), e.on("mouse:up", d), e.on("mouse:down:before", g), () => {
|
|
91
|
-
e.off("mouse:down", r), e.off("mouse:move", k), e.off("mouse:up", d), e.off("mouse:down:before", g), e.selection = !1, e.skipTargetFind = !1;
|
|
92
|
-
const o = u();
|
|
93
|
-
e.getObjects().forEach((t) => {
|
|
94
|
-
t instanceof c.Rect && o.has(t) ? t.set({
|
|
95
|
-
evented: !0,
|
|
96
|
-
selectable: !1,
|
|
97
|
-
lockMovementX: !0,
|
|
98
|
-
lockMovementY: !0,
|
|
99
|
-
lockScalingX: !0,
|
|
100
|
-
lockScalingY: !0,
|
|
101
|
-
lockRotation: !0
|
|
102
|
-
}) : t.set({
|
|
103
|
-
evented: !0,
|
|
104
|
-
selectable: !0,
|
|
105
|
-
lockMovementX: !1,
|
|
106
|
-
lockMovementY: !1,
|
|
107
|
-
lockScalingX: !1,
|
|
108
|
-
lockScalingY: !1
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
}, [e, i, f, n]);
|
|
113
|
-
};
|
|
114
|
-
export {
|
|
115
|
-
O as useCanvasDrag
|
|
116
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { useEffect as V, useCallback as Z } from "react";
|
|
2
|
-
import { fabric as o } from "fabric";
|
|
3
|
-
import { CANVAS_CONTAINER_CLASS as q, BASE_STROKE_WIDTH as F } from "../../constants.mjs";
|
|
4
|
-
const $ = ({
|
|
5
|
-
sample: h,
|
|
6
|
-
image: f,
|
|
7
|
-
onImageLoad: y,
|
|
8
|
-
canvasRef: w,
|
|
9
|
-
containerRef: d,
|
|
10
|
-
canvasInitializedRef: S,
|
|
11
|
-
bgImagePositionRef: s,
|
|
12
|
-
bgImageSizeRef: b,
|
|
13
|
-
rectMapRef: U,
|
|
14
|
-
updateTextLayersRef: j,
|
|
15
|
-
onRectPositionUpdated: p,
|
|
16
|
-
setCanvas: a,
|
|
17
|
-
setImage: O,
|
|
18
|
-
setScale: X,
|
|
19
|
-
setBgImagePosition: Y,
|
|
20
|
-
setLoading: C
|
|
21
|
-
}) => (V(() => {
|
|
22
|
-
if (C(!0), O(void 0), a((t) => (t && t.setBackgroundImage(void 0, t.renderAll.bind(t)), t)), s.current = {
|
|
23
|
-
left: 0,
|
|
24
|
-
top: 0
|
|
25
|
-
}, !(h != null && h.fileUrl)) {
|
|
26
|
-
C(!1);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
o.Image.fromURL(h.fileUrl, (t) => {
|
|
30
|
-
t.set({
|
|
31
|
-
originX: "center",
|
|
32
|
-
originY: "center"
|
|
33
|
-
}), O(t), C(!1);
|
|
34
|
-
}, {
|
|
35
|
-
crossOrigin: "anonymous"
|
|
36
|
-
});
|
|
37
|
-
}, [h == null ? void 0 : h.fileUrl, O, C, s, a]), {
|
|
38
|
-
updateCanvas: Z(() => {
|
|
39
|
-
if (!f || !w.current || !d.current)
|
|
40
|
-
return;
|
|
41
|
-
S.current = !1;
|
|
42
|
-
const t = f.getElement();
|
|
43
|
-
if (!(t != null && t.width) || !(t != null && t.height))
|
|
44
|
-
return;
|
|
45
|
-
const N = d.current.offsetWidth, B = d.current.offsetHeight, _ = t.width / t.height, l = N, i = B;
|
|
46
|
-
let r, c;
|
|
47
|
-
if (t.width <= l && t.height <= i)
|
|
48
|
-
r = 1, c = [t.width, t.height];
|
|
49
|
-
else {
|
|
50
|
-
const u = l / t.width, e = i / t.height;
|
|
51
|
-
u > e ? c = [i * _, i] : c = [l, l / _];
|
|
52
|
-
const k = c[0] / t.width, W = c[1] / t.height;
|
|
53
|
-
r = Math.min(k, W);
|
|
54
|
-
}
|
|
55
|
-
s.current = {
|
|
56
|
-
left: 0,
|
|
57
|
-
top: 0
|
|
58
|
-
}, a((u) => {
|
|
59
|
-
let e = u;
|
|
60
|
-
if (e)
|
|
61
|
-
e.setDimensions({
|
|
62
|
-
width: l,
|
|
63
|
-
height: i
|
|
64
|
-
});
|
|
65
|
-
else {
|
|
66
|
-
e = new o.Canvas(w.current, {
|
|
67
|
-
containerClass: q,
|
|
68
|
-
width: l,
|
|
69
|
-
height: i
|
|
70
|
-
}), e.selection = !1;
|
|
71
|
-
const n = e;
|
|
72
|
-
n.uniScaleKey = "", n.uniformScaling = !1, o.Object.prototype.hasRotatingPoint = !1, o.Object.prototype.lockRotation = !0, o.Object.prototype.lockUniScaling = !1, o.Object.prototype.objectCaching = !1, o.Object.prototype.statefullCache = !1, o.Object.prototype.noScaleCache = !1;
|
|
73
|
-
}
|
|
74
|
-
e.setViewportTransform([1, 0, 0, 1, 0, 0]), e.setZoom(r), X(r);
|
|
75
|
-
const k = c[0], W = c[1], D = k / r, K = W / r, A = (l / r - D) / 2, H = (i / r - K) / 2;
|
|
76
|
-
return s.current = {
|
|
77
|
-
left: A,
|
|
78
|
-
top: H
|
|
79
|
-
}, b.current = {
|
|
80
|
-
width: c[0] / r,
|
|
81
|
-
height: c[1] / r
|
|
82
|
-
}, Y({
|
|
83
|
-
left: A,
|
|
84
|
-
top: H
|
|
85
|
-
}), e.setBackgroundImage(f, () => {
|
|
86
|
-
S.current = !0, u && (U.current.forEach((n, x) => {
|
|
87
|
-
const E = {
|
|
88
|
-
x: n.shape.x + s.current.left,
|
|
89
|
-
y: n.shape.y + s.current.top
|
|
90
|
-
};
|
|
91
|
-
x.set({
|
|
92
|
-
left: E.x,
|
|
93
|
-
top: E.y
|
|
94
|
-
});
|
|
95
|
-
const T = F / r;
|
|
96
|
-
x.set({
|
|
97
|
-
strokeWidth: T,
|
|
98
|
-
strokeUniform: !0,
|
|
99
|
-
objectCaching: !1,
|
|
100
|
-
statefullCache: !1,
|
|
101
|
-
noScaleCache: !1
|
|
102
|
-
}), n.textLayouts && n.textLayouts.length > 0 && j.current && j.current(x, n);
|
|
103
|
-
}), p && p(r)), e.renderAll(), u || y && y();
|
|
104
|
-
}, {
|
|
105
|
-
originX: "left",
|
|
106
|
-
originY: "top",
|
|
107
|
-
left: A,
|
|
108
|
-
top: H
|
|
109
|
-
}), e;
|
|
110
|
-
});
|
|
111
|
-
}, [f, w, d, S, s, b, U, j, p, a, X, Y, y])
|
|
112
|
-
});
|
|
113
|
-
export {
|
|
114
|
-
$ as useCanvasSetup
|
|
115
|
-
};
|