@zero-library/common 2.3.2 → 2.3.3
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/index.cjs.js +3 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.esm.js +3 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -289,7 +289,6 @@ type CollectionType = {
|
|
|
289
289
|
text: string;
|
|
290
290
|
from: number;
|
|
291
291
|
to: number;
|
|
292
|
-
pageNo?: string;
|
|
293
292
|
} & {
|
|
294
293
|
[key in (typeof COLLECTION_ATTRS)[number]]: string;
|
|
295
294
|
};
|
|
@@ -387,8 +386,9 @@ interface SizeType {
|
|
|
387
386
|
}
|
|
388
387
|
interface MarkDrawingProps {
|
|
389
388
|
children: ReactNode;
|
|
390
|
-
detections
|
|
389
|
+
detections?: Detection[];
|
|
391
390
|
originalSize: SizeType;
|
|
391
|
+
scopeRender?: (score: number) => ReactNode;
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
394
394
|
* MarkDrawing组件
|
|
@@ -397,8 +397,9 @@ interface MarkDrawingProps {
|
|
|
397
397
|
* @param children - 待绘制标注的内容
|
|
398
398
|
* @param detections - 检测结果数组
|
|
399
399
|
* @param originalSize - 原始尺寸信息
|
|
400
|
+
* @param scopeRender - 可选的作用域渲染函数
|
|
400
401
|
*/
|
|
401
|
-
declare const _default$f: ({ children, detections, originalSize }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
402
|
+
declare const _default$f: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
402
403
|
|
|
403
404
|
/**
|
|
404
405
|
* Markdown渲染组件属性接口
|
package/dist/index.d.ts
CHANGED
|
@@ -289,7 +289,6 @@ type CollectionType = {
|
|
|
289
289
|
text: string;
|
|
290
290
|
from: number;
|
|
291
291
|
to: number;
|
|
292
|
-
pageNo?: string;
|
|
293
292
|
} & {
|
|
294
293
|
[key in (typeof COLLECTION_ATTRS)[number]]: string;
|
|
295
294
|
};
|
|
@@ -387,8 +386,9 @@ interface SizeType {
|
|
|
387
386
|
}
|
|
388
387
|
interface MarkDrawingProps {
|
|
389
388
|
children: ReactNode;
|
|
390
|
-
detections
|
|
389
|
+
detections?: Detection[];
|
|
391
390
|
originalSize: SizeType;
|
|
391
|
+
scopeRender?: (score: number) => ReactNode;
|
|
392
392
|
}
|
|
393
393
|
/**
|
|
394
394
|
* MarkDrawing组件
|
|
@@ -397,8 +397,9 @@ interface MarkDrawingProps {
|
|
|
397
397
|
* @param children - 待绘制标注的内容
|
|
398
398
|
* @param detections - 检测结果数组
|
|
399
399
|
* @param originalSize - 原始尺寸信息
|
|
400
|
+
* @param scopeRender - 可选的作用域渲染函数
|
|
400
401
|
*/
|
|
401
|
-
declare const _default$f: ({ children, detections, originalSize }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
402
|
+
declare const _default$f: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
402
403
|
|
|
403
404
|
/**
|
|
404
405
|
* Markdown渲染组件属性接口
|
package/dist/index.esm.js
CHANGED
|
@@ -8546,7 +8546,6 @@ var MarkdownEditor_default = ({
|
|
|
8546
8546
|
content: value,
|
|
8547
8547
|
contentType: "markdown",
|
|
8548
8548
|
onUpdate: () => {
|
|
8549
|
-
console.log("update \u6587\u672C\u6539\u53D8");
|
|
8550
8549
|
const markdownOutput = getMarkdown();
|
|
8551
8550
|
if (markdownOutput === lastContentRef.current) return;
|
|
8552
8551
|
lastContentRef.current = markdownOutput;
|
|
@@ -8690,7 +8689,7 @@ var styles_module_default7 = {
|
|
|
8690
8689
|
rect: "styles_module_rect",
|
|
8691
8690
|
score: "styles_module_score"
|
|
8692
8691
|
};
|
|
8693
|
-
var MarkDrawing_default = ({ children, detections, originalSize }) => {
|
|
8692
|
+
var MarkDrawing_default = ({ children, detections, originalSize, scopeRender }) => {
|
|
8694
8693
|
const containerRef = useRef(null);
|
|
8695
8694
|
const [containerSize, setContainerSize] = useState({
|
|
8696
8695
|
width: originalSize.width,
|
|
@@ -8711,7 +8710,7 @@ var MarkDrawing_default = ({ children, detections, originalSize }) => {
|
|
|
8711
8710
|
const scaleY = containerSize.height / originalSize.height;
|
|
8712
8711
|
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: styles_module_default7.container, children: [
|
|
8713
8712
|
children,
|
|
8714
|
-
detections
|
|
8713
|
+
detections?.map((det, idx) => {
|
|
8715
8714
|
const [x1, y1, x2, y2] = det.bbox;
|
|
8716
8715
|
const left = x1 * scaleX;
|
|
8717
8716
|
const top = y1 * scaleY;
|
|
@@ -8738,7 +8737,7 @@ var MarkDrawing_default = ({ children, detections, originalSize }) => {
|
|
|
8738
8737
|
left,
|
|
8739
8738
|
top: Math.max(top - 20, 0)
|
|
8740
8739
|
},
|
|
8741
|
-
children: det.score.
|
|
8740
|
+
children: scopeRender ? scopeRender(det.score) : det.score
|
|
8742
8741
|
}
|
|
8743
8742
|
)
|
|
8744
8743
|
] }, idx);
|