@glodon-aiot/dataset-annotation 3.25.1-alpha.2 → 3.25.1-alpha.4

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 (39) hide show
  1. package/dist/es/_virtual/_commonjsHelpers.mjs +8 -0
  2. package/dist/es/_virtual/dayjs.min.mjs +4 -0
  3. package/dist/es/components/OCRImageViewer/index.mjs +130 -117
  4. package/dist/es/components/VersionCompare/VersionCompareSelectModal/index.mjs +121 -0
  5. package/dist/es/components/VersionCompare/adapter.mjs +215 -0
  6. package/dist/es/components/VersionCompare/components/DataChangeStatsCard.mjs +68 -0
  7. package/dist/es/components/VersionCompare/components/DiffValue.mjs +31 -0
  8. package/dist/es/components/VersionCompare/components/LabelComparisonCard.mjs +130 -0
  9. package/dist/es/components/VersionCompare/components/ModifiedSampleCompareModal.mjs +207 -0
  10. package/dist/es/components/VersionCompare/components/SampleChangeDetailsCard.mjs +167 -0
  11. package/dist/es/components/VersionCompare/components/SingleSampleDetailModal.mjs +165 -0
  12. package/dist/es/components/VersionCompare/components/VersionCompareHeader.mjs +114 -0
  13. package/dist/es/components/VersionCompare/components/VersionOverviewCard.mjs +70 -0
  14. package/dist/es/components/VersionCompare/index.mjs +416 -0
  15. package/dist/es/components/VersionCompare/mock.mjs +571 -0
  16. package/dist/es/components/VersionCompare/style.less.mjs +4 -0
  17. package/dist/es/components/VersionCompare/utils/labelColors.mjs +45 -0
  18. package/dist/es/createDatasetVersionCompare/index.mjs +124 -0
  19. package/dist/es/index.mjs +21 -15
  20. package/dist/es/node_modules/dayjs/dayjs.min.mjs +324 -0
  21. package/dist/lib/index.js +37 -4
  22. package/dist/src/components/OCRImageViewer/index.d.ts +1 -0
  23. package/dist/src/components/VersionCompare/VersionCompareSelectModal/index.d.ts +16 -0
  24. package/dist/src/components/VersionCompare/adapter.d.ts +50 -0
  25. package/dist/src/components/VersionCompare/components/DataChangeStatsCard.d.ts +9 -0
  26. package/dist/src/components/VersionCompare/components/DiffValue.d.ts +23 -0
  27. package/dist/src/components/VersionCompare/components/LabelComparisonCard.d.ts +12 -0
  28. package/dist/src/components/VersionCompare/components/ModifiedSampleCompareModal.d.ts +48 -0
  29. package/dist/src/components/VersionCompare/components/SampleChangeDetailsCard.d.ts +21 -0
  30. package/dist/src/components/VersionCompare/components/SingleSampleDetailModal.d.ts +46 -0
  31. package/dist/src/components/VersionCompare/components/VersionCompareHeader.d.ts +13 -0
  32. package/dist/src/components/VersionCompare/components/VersionOverviewCard.d.ts +9 -0
  33. package/dist/src/components/VersionCompare/index.d.ts +34 -0
  34. package/dist/src/components/VersionCompare/mock.d.ts +25 -0
  35. package/dist/src/components/VersionCompare/types.d.ts +75 -0
  36. package/dist/src/components/VersionCompare/utils/labelColors.d.ts +13 -0
  37. package/dist/src/createDatasetVersionCompare/index.d.ts +26 -0
  38. package/dist/src/index.d.ts +6 -0
  39. package/package.json +2 -2
@@ -25,6 +25,7 @@ interface OCRImageViewerProps {
25
25
  children?: ReactNode;
26
26
  labels?: TInfer[];
27
27
  onImageLoad?: (img: HTMLImageElement) => void;
28
+ onImageError?: () => void;
28
29
  }
29
30
  export interface OCRImageViewerRefProps {
30
31
  onImageLoad?: (img: HTMLImageElement) => void;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { CVForceDatahubApi, IVersion } from '@glodon-aiot/apis';
3
+ export interface VersionCompareSelectModalProps {
4
+ open: boolean;
5
+ datasetId?: string;
6
+ datasetName?: string;
7
+ initialBaseVersionId?: string;
8
+ initialTargetVersionId?: string;
9
+ versions?: IVersion[];
10
+ cvforceDatahub?: CVForceDatahubApi;
11
+ useMock?: boolean;
12
+ onCancel: () => void;
13
+ onConfirm: (baseVersionId: string, targetVersionId: string, baseVersion?: IVersion, targetVersion?: IVersion) => void;
14
+ }
15
+ declare const VersionCompareSelectModal: React.FC<VersionCompareSelectModalProps>;
16
+ export default VersionCompareSelectModal;
@@ -0,0 +1,50 @@
1
+ import { CVForceDatahubApi, IVersionCompareSampleItem, IVersionCompareSamplesParams, IVersionCompareSummary, IVersionCompareSummaryParams, Paged } from '@glodon-aiot/apis';
2
+ import { MockCompareScene } from './mock';
3
+ import { VersionCompareAsyncTaskProgress, VersionCompareSampleItemVM, VersionCompareSamplesPageVM, VersionCompareSummaryVM } from './types';
4
+ /**
5
+ * 格式化对比时间戳为 YYYY-MM-DD HH:mm:ss。
6
+ * 兼容毫秒级与秒级时间戳;空值或 0 显示为 -
7
+ */
8
+ export declare const formatCompareTimestamp: (ts?: number | string) => string;
9
+ /**
10
+ * 将后端对比概览 DTO 转换为前端内部 ViewModel
11
+ */
12
+ export declare const adaptVersionCompareSummary: (raw: IVersionCompareSummary, extraLabelNames?: string[]) => VersionCompareSummaryVM;
13
+ /**
14
+ * 将单条对比样本 DTO 转换为前端内部 ViewModel,并注入一致的标签颜色
15
+ */
16
+ export declare const adaptVersionCompareSampleItem: (item: IVersionCompareSampleItem, colorMap?: Map<string, string>) => VersionCompareSampleItemVM;
17
+ /**
18
+ * 将后端对比样本分页列表 DTO 转换为前端内部 ViewModel
19
+ */
20
+ export declare const adaptVersionCompareSamples: (paged: Paged<IVersionCompareSampleItem> & {
21
+ items?: IVersionCompareSampleItem[];
22
+ total?: number;
23
+ }, colorMap?: Map<string, string>) => VersionCompareSamplesPageVM;
24
+ export interface VersionCompareAdapterOptions {
25
+ cvforceDatahub?: CVForceDatahubApi;
26
+ /** 强制使用本地结构化 Mock 数据 */
27
+ useMock?: boolean;
28
+ /** 接口失败时是否降级到 Mock。默认关闭,失败直接抛出。 */
29
+ fallbackToMockOnError?: boolean;
30
+ /** Mock 数据场景(默认根据 datasetId 或传入 markType 自动推断) */
31
+ mockScene?: MockCompareScene;
32
+ /** 覆盖 Mock 数据集名称 */
33
+ mockDatasetName?: string;
34
+ /** 预留异步对比任务轮询间隔(毫秒,默认 2000ms) */
35
+ asyncPollIntervalMs?: number;
36
+ /** 预留异步对比任务最大轮询次数(默认 60 次) */
37
+ maxAsyncPollAttempts?: number;
38
+ /** 预留异步对比任务进度回调(若后续后端切换为异步任务,可通过该回调驱动进度条) */
39
+ onAsyncTaskProgress?: (progress: VersionCompareAsyncTaskProgress) => void;
40
+ /** 取消信号(组件卸载或切换版本时中止异步轮询) */
41
+ signal?: AbortSignal;
42
+ }
43
+ /**
44
+ * 获取版本对比概览。接口为同步返回,失败时仅在显式开启 fallbackToMockOnError 时降级到 Mock。
45
+ */
46
+ export declare const fetchVersionCompareSummaryWithAdapter: (datasetId: string, params: IVersionCompareSummaryParams, options?: VersionCompareAdapterOptions) => Promise<VersionCompareSummaryVM>;
47
+ /**
48
+ * 获取版本对比分页样本列表(支持标签颜色注入与本地 Mock 降级)
49
+ */
50
+ export declare const fetchVersionCompareSamplesWithAdapter: (datasetId: string, params: IVersionCompareSamplesParams, colorMap?: Map<string, string>, options?: VersionCompareAdapterOptions) => Promise<VersionCompareSamplesPageVM>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { IVersionCompareChangeStats } from '../types';
3
+ export interface DataChangeStatsCardProps {
4
+ baseVersionNo: string;
5
+ targetVersionNo: string;
6
+ changeStats: IVersionCompareChangeStats;
7
+ }
8
+ declare const DataChangeStatsCard: React.FC<DataChangeStatsCardProps>;
9
+ export default DataChangeStatsCard;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ export interface DiffValueProps {
3
+ /** 目标版本当前数值(若传入则与差值并排展示) */
4
+ value?: number;
5
+ /** 已计算的差值(目标版本值 - 基准版本值) */
6
+ diff?: number;
7
+ /** 基准版本数值(当未直接传 diff 时用于自动计算) */
8
+ baseValue?: number;
9
+ /** 目标版本数值(当未直接传 diff 时用于自动计算) */
10
+ targetValue?: number;
11
+ /** 主数值与差值之间的间距(px),默认 8px */
12
+ gap?: number;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * 版本对比通用差值展示组件
17
+ * 规则:差值 = 目标版本值 - 基准版本值
18
+ * - > 0:展示 +N(#FF4D4F)
19
+ * - < 0:展示 -|N|(#52C41A)
20
+ * - = 0:不展示差值标识
21
+ */
22
+ declare const DiffValue: React.FC<DiffValueProps>;
23
+ export default DiffValue;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { VersionCompareLabelRowVM } from '../types';
3
+ export interface LabelComparisonCardProps {
4
+ markType: 'detection' | 'ocr' | string;
5
+ ocrMarkTmpl?: string;
6
+ isOcrDetection?: boolean;
7
+ baseVersionNo: string;
8
+ targetVersionNo: string;
9
+ labelComparisons: VersionCompareLabelRowVM[];
10
+ }
11
+ declare const LabelComparisonCard: React.FC<LabelComparisonCardProps>;
12
+ export default LabelComparisonCard;
@@ -0,0 +1,48 @@
1
+ import { default as React } from 'react';
2
+ import { VersionCompareSampleItemVM } from '../types';
3
+ export interface ModifiedSampleCompareModalProps {
4
+ /** 弹窗是否打开 */
5
+ open: boolean;
6
+ /** 关闭弹窗回调 */
7
+ onCancel: () => void;
8
+ /** 当前选中的修改对比样本项 */
9
+ item?: VersionCompareSampleItemVM;
10
+ /** 是否为 OCR 检测数据集 */
11
+ isOcrDetection: boolean;
12
+ /** 数据集 ID */
13
+ datasetId: string;
14
+ /** 基准版本 ID */
15
+ baseVersionId: string;
16
+ /** 基准版本号展示文本(如 V1) */
17
+ baseVersionNo: string;
18
+ /** 目标版本 ID */
19
+ targetVersionId: string;
20
+ /** 目标版本号展示文本(如 V3) */
21
+ targetVersionNo: string;
22
+ /** 统一标签颜色映射表 */
23
+ labelColorMap?: Map<string, string>;
24
+ /** 是否存在上一张(在第 1 张时为 false) */
25
+ canPrev: boolean;
26
+ /** 是否存在下一张(在最后 1 张时为 false) */
27
+ canNext: boolean;
28
+ /** 外部列表是否正在跨页加载 */
29
+ switching?: boolean;
30
+ /** 点击上一张 */
31
+ onPrev: () => void;
32
+ /** 点击下一张 */
33
+ onNext: () => void;
34
+ /** 当前样本两侧主图均加载就绪状态回调(用于驱动后台相邻图片预加载) */
35
+ onImageReadyChange?: (ready: boolean) => void;
36
+ /** 注入的 cvforceDatahub 服务实例(真实接口兜底补全单样本详情) */
37
+ cvforceDatahub?: any;
38
+ /** 是否启用本地 Mock */
39
+ useMock?: boolean;
40
+ }
41
+ /**
42
+ * 修改样本的左右双图并排只读对比弹窗(用于「修改」Tab 下的样本对比查看)
43
+ * - 左侧展示基准版本(baseSample),右侧展示目标版本(sample)
44
+ * - 两侧均处于只读模式,各自支持独立的画布缩放与拖拽平移
45
+ * - OCR 检测模式下在两侧浅蓝版本栏右侧分别展示各自的「标注框数量」
46
+ */
47
+ declare const ModifiedSampleCompareModal: React.FC<ModifiedSampleCompareModalProps>;
48
+ export default ModifiedSampleCompareModal;
@@ -0,0 +1,21 @@
1
+ import { default as React } from 'react';
2
+ import { IProxy } from '@glodon-aiot/apis';
3
+ import { IVersionCompareChangeStats, VersionCompareChangeType, VersionCompareSampleItemVM } from '../types';
4
+ export interface SampleChangeDetailsCardProps {
5
+ baseVersionNo: string;
6
+ targetVersionNo: string;
7
+ isOcrDetection: boolean;
8
+ changeStats: IVersionCompareChangeStats;
9
+ activeTab: VersionCompareChangeType;
10
+ items: VersionCompareSampleItemVM[];
11
+ total: number;
12
+ pageNo: number;
13
+ pageSize: number;
14
+ loading?: boolean;
15
+ imgProxy?: IProxy;
16
+ onTabChange: (tab: VersionCompareChangeType) => void;
17
+ onPageChange: (page: number, pageSize: number) => void;
18
+ onSampleClick?: (item: VersionCompareSampleItemVM, index: number) => void;
19
+ }
20
+ declare const SampleChangeDetailsCard: React.FC<SampleChangeDetailsCardProps>;
21
+ export default SampleChangeDetailsCard;
@@ -0,0 +1,46 @@
1
+ import { default as React } from 'react';
2
+ import { VersionCompareChangeType } from '@glodon-aiot/apis';
3
+ import { VersionCompareSampleItemVM } from '../types';
4
+ export interface SingleSampleDetailModalProps {
5
+ /** 弹窗是否打开 */
6
+ open: boolean;
7
+ /** 关闭弹窗回调 */
8
+ onCancel: () => void;
9
+ /** 当前选中的对比样本项 */
10
+ item?: VersionCompareSampleItemVM;
11
+ /** 当前所属变更类型 Tab */
12
+ changeType: VersionCompareChangeType;
13
+ /** 是否为 OCR 检测数据集 */
14
+ isOcrDetection: boolean;
15
+ /** 数据集 ID */
16
+ datasetId: string;
17
+ /** 基准版本 ID */
18
+ baseVersionId: string;
19
+ /** 目标版本 ID */
20
+ targetVersionId: string;
21
+ /** 统一标签颜色映射表 */
22
+ labelColorMap?: Map<string, string>;
23
+ /** 是否存在上一张(在第 1 张时为 false) */
24
+ canPrev: boolean;
25
+ /** 是否存在下一张(在最后 1 张时为 false) */
26
+ canNext: boolean;
27
+ /** 外部列表是否正在跨页加载 */
28
+ switching?: boolean;
29
+ /** 点击上一张 */
30
+ onPrev: () => void;
31
+ /** 点击下一张 */
32
+ onNext: () => void;
33
+ /** 当前样本主图加载就绪状态回调(用于驱动后台相邻图片预加载) */
34
+ onImageReadyChange?: (ready: boolean) => void;
35
+ /** 注入的 cvforceDatahub 服务实例(真实接口兜底补全单样本详情) */
36
+ cvforceDatahub?: any;
37
+ /** 是否启用本地 Mock */
38
+ useMock?: boolean;
39
+ }
40
+ /**
41
+ * 单图只读详情弹窗(用于「新增」、「删除」、「无变动」Tab 下的样本查看)
42
+ * - 物体检测:复用只读态 LabelMaker(支持画布缩放与拖拽平移,禁止框编辑/删除/新建)
43
+ * - OCR 检测:复用 OCRImageViewer,并在画布右上方额外展示「标注框数量」
44
+ */
45
+ declare const SingleSampleDetailModal: React.FC<SingleSampleDetailModalProps>;
46
+ export default SingleSampleDetailModal;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export interface VersionCompareHeaderProps {
3
+ datasetName: string;
4
+ baseVersionNo: string;
5
+ targetVersionNo: string;
6
+ formattedCompareTime: string;
7
+ /** 是否展示顶部「← 数据集管理 / 版本对比」面包屑导航栏,默认 true */
8
+ showBreadcrumb?: boolean;
9
+ onBack?: () => void;
10
+ onReselect?: () => void;
11
+ }
12
+ declare const VersionCompareHeader: React.FC<VersionCompareHeaderProps>;
13
+ export default VersionCompareHeader;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { VersionCompareOverviewRowVM } from '../types';
3
+ export interface VersionOverviewCardProps {
4
+ baseVersionNo: string;
5
+ targetVersionNo: string;
6
+ rows: VersionCompareOverviewRowVM[];
7
+ }
8
+ declare const VersionOverviewCard: React.FC<VersionOverviewCardProps>;
9
+ export default VersionOverviewCard;
@@ -0,0 +1,34 @@
1
+ import { default as React } from 'react';
2
+ import { CVForceDatahubApi, IProxy, IVersion } from '@glodon-aiot/apis';
3
+ import { MockCompareScene } from './mock';
4
+ import { VersionCompareChangeType, VersionCompareSampleItemVM } from './types';
5
+ export interface DatasetVersionCompareProps {
6
+ datasetId: string;
7
+ baseVersionId: string;
8
+ targetVersionId: string;
9
+ datasetName?: string;
10
+ markType?: 'detection' | 'ocr' | string;
11
+ ocrMarkTmpl?: string;
12
+ cvforceDatahub?: CVForceDatahubApi;
13
+ imgProxy?: IProxy;
14
+ versions?: IVersion[];
15
+ /** 是否显示顶部「← 数据集管理 / 版本对比」面包屑栏,默认 true */
16
+ showBreadcrumb?: boolean;
17
+ /** 是否强制使用本地 Mock 数据 */
18
+ useMock?: boolean;
19
+ /** 当后端接口报错时是否降级到本地 Mock 数据,默认 true */
20
+ fallbackToMockOnError?: boolean;
21
+ /** Mock 数据场景(detection | ocr) */
22
+ mockScene?: MockCompareScene;
23
+ /** 点击返回按钮回调 */
24
+ onBack?: () => void;
25
+ /** 在重新选择对比版本弹窗点击「开始对比」后的回调 */
26
+ onVersionsChange?: (baseVersionId: string, targetVersionId: string, baseVersion?: IVersion, targetVersion?: IVersion) => void;
27
+ /** 点击某张样本卡片的回调(阶段 5.2 / 5.3 接入单/双图弹窗) */
28
+ onSampleClick?: (item: VersionCompareSampleItemVM, index: number, changeType: VersionCompareChangeType) => void;
29
+ }
30
+ declare const DatasetVersionCompare: React.FC<DatasetVersionCompareProps>;
31
+ export default DatasetVersionCompare;
32
+ export * from './types';
33
+ export * from './adapter';
34
+ export * from './mock';
@@ -0,0 +1,25 @@
1
+ import { IVersion, IVersionCompareSampleItem, IVersionCompareSummary, Paged, VersionCompareChangeType } from '@glodon-aiot/apis';
2
+ export type MockCompareScene = 'detection' | 'ocr';
3
+ export declare const MOCK_DATASET_VERSIONS: IVersion[];
4
+ /**
5
+ * 获取本地结构化 Mock 版本对比概览
6
+ */
7
+ export declare const getMockVersionCompareSummary: (params: {
8
+ datasetId: string;
9
+ baseVersionId: string;
10
+ targetVersionId: string;
11
+ scene?: MockCompareScene;
12
+ datasetName?: string;
13
+ }) => IVersionCompareSummary;
14
+ /**
15
+ * 获取本地结构化 Mock 版本对比样本分页列表
16
+ */
17
+ export declare const getMockVersionCompareSamples: (params: {
18
+ datasetId: string;
19
+ baseVersionId: string;
20
+ targetVersionId: string;
21
+ changeType: VersionCompareChangeType;
22
+ pageNo?: number;
23
+ pageSize?: number;
24
+ scene?: MockCompareScene;
25
+ }) => Paged<IVersionCompareSampleItem>;
@@ -0,0 +1,75 @@
1
+ import { ISample, IVersionCompareChangeStats, IVersionCompareLabelItem, IVersionCompareSampleItem, IVersionCompareSummary, IVersionOverviewMetrics, VersionCompareChangeType, VersionCompareTaskStatus } from '@glodon-aiot/apis';
2
+ import { LabelBox } from '../DetectionAnnotation/components/LabelMaker';
3
+ export type { VersionCompareChangeType, VersionCompareTaskStatus, IVersionOverviewMetrics, IVersionCompareChangeStats, IVersionCompareLabelItem, IVersionCompareSummary, IVersionCompareSampleItem, };
4
+ export type VersionCompareOverviewMetricKey = 'totalSampleCount' | 'labeledSampleCount' | 'totalBoxCount';
5
+ export interface VersionCompareOverviewRowVM {
6
+ key: VersionCompareOverviewMetricKey;
7
+ metricLabel: string;
8
+ baseValue: number;
9
+ targetValue: number;
10
+ /** 目标版本值 - 基准版本值 */
11
+ diff: number;
12
+ }
13
+ export interface VersionCompareLabelRowVM extends IVersionCompareLabelItem {
14
+ color: string;
15
+ /** 目标版本标注框数 - 基准版本标注框数 */
16
+ boxDiff: number;
17
+ /** 目标版本图片数 - 基准版本图片数 */
18
+ sampleDiff: number;
19
+ }
20
+ export interface VersionCompareSummaryVM {
21
+ datasetId: string;
22
+ datasetName: string;
23
+ markType: 'detection' | 'ocr' | string;
24
+ ocrMarkTmpl?: string;
25
+ /** 是否为 OCR 检测类型(隐藏标签明细对比、画布使用 OCRImageViewer) */
26
+ isOcrDetection: boolean;
27
+ baseVersionId: string;
28
+ baseVersionNo: string;
29
+ targetVersionId: string;
30
+ targetVersionNo: string;
31
+ compareTime: number;
32
+ formattedCompareTime: string;
33
+ overview: {
34
+ baseVersion: IVersionOverviewMetrics;
35
+ targetVersion: IVersionOverviewMetrics;
36
+ };
37
+ overviewRows: VersionCompareOverviewRowVM[];
38
+ changeStats: IVersionCompareChangeStats;
39
+ labelComparisons: VersionCompareLabelRowVM[];
40
+ /** 全量标签稳定颜色映射表 */
41
+ labelColorMap: Map<string, string>;
42
+ /** 预留异步任务扩展字段 */
43
+ taskId?: string;
44
+ taskStatus?: VersionCompareTaskStatus;
45
+ progress?: number;
46
+ }
47
+ export interface VersionCompareSampleItemVM {
48
+ fileKey: string;
49
+ changeType: VersionCompareChangeType;
50
+ /**
51
+ * 卡片主样本:
52
+ * - added / modified / unchanged 为目标版本样本
53
+ * - deleted 为基准版本样本
54
+ */
55
+ sample: ISample;
56
+ /** 仅当 changeType === 'modified' 时返回基准版本样本 */
57
+ baseSample?: ISample | null;
58
+ /** 归一化后的展示文件名 */
59
+ displayFileName: string;
60
+ /** 注入稳定颜色后的目标版本(或单图主样本)标注框 */
61
+ targetColorLabels: LabelBox[];
62
+ /** 注入稳定颜色后的基准版本标注框(modified 场景左侧画布使用) */
63
+ baseColorLabels: LabelBox[];
64
+ }
65
+ export interface VersionCompareSamplesPageVM {
66
+ items: VersionCompareSampleItemVM[];
67
+ total: number;
68
+ pageNo: number;
69
+ pageSize: number;
70
+ }
71
+ export interface VersionCompareAsyncTaskProgress {
72
+ taskId?: string;
73
+ taskStatus: VersionCompareTaskStatus;
74
+ progress?: number;
75
+ }
@@ -0,0 +1,13 @@
1
+ import { ISample } from '@glodon-aiot/apis';
2
+ import { LabelBox } from '../../DetectionAnnotation/components/LabelMaker';
3
+ /**
4
+ * 为版本对比构建稳定的标签颜色映射表(Map<labelKey, color>)
5
+ * 优先按对比概览中的标签列表顺序分配颜色,再为样本中可能出现的历史标签兜底分配颜色,
6
+ * 保证基准版本与目标版本中同一标签的标注框颜色完全一致。
7
+ */
8
+ export declare const buildCompareLabelColorMap: (labelNames?: string[], samples?: Array<Pick<ISample, "labels"> | undefined | null>) => Map<string, string>;
9
+ /**
10
+ * 为单个样本的 labels 注入稳定颜色,转换为 LabelMaker 所需的 LabelBox[]
11
+ * 确保所有有效标注框均包含非空 color 字段,不会被 LabelMaker 的 .filter(i => i.color) 过滤
12
+ */
13
+ export declare const injectSampleLabelColors: (sample?: Pick<ISample, "labels"> | null, colorMap?: Map<string, string>) => LabelBox[];
@@ -0,0 +1,26 @@
1
+ import { IVersion } from '@glodon-aiot/apis';
2
+ import { TokenGetter } from '../utils';
3
+ import { MockCompareScene } from '../components/VersionCompare/mock';
4
+ export interface DatasetVersionCompareConfig {
5
+ getContainer: () => HTMLElement;
6
+ token: string;
7
+ getToken?: TokenGetter;
8
+ datasetId: string;
9
+ baseVersionId: string;
10
+ targetVersionId: string;
11
+ datasetName?: string;
12
+ markType?: 'detection' | 'ocr' | string;
13
+ ocrMarkTmpl?: string;
14
+ apiUrl?: string;
15
+ showBreadcrumb?: boolean;
16
+ useMock?: boolean;
17
+ fallbackToMockOnError?: boolean;
18
+ mockScene?: MockCompareScene;
19
+ errorHandlers?: {
20
+ aiotToken?: (error: Error) => void;
21
+ };
22
+ onBack?: () => void;
23
+ onVersionsChange?: (baseVersionId: string, targetVersionId: string, baseVersion?: IVersion, targetVersion?: IVersion) => void;
24
+ }
25
+ declare const _default: (config: DatasetVersionCompareConfig) => void;
26
+ export default _default;
@@ -11,3 +11,9 @@ export { default as VLMAnnotation } from './components/VLMAnnotation';
11
11
  export type { VLMAnnotationProps, VLMLabel, VLMSample } from './components/VLMAnnotation';
12
12
  export { default as VQAAnnotation } from './components/VQAAnnotation';
13
13
  export type { VQAAnnotationRef, VQASample, VQAConversation } from './components/VQAAnnotation';
14
+ export { default as VersionCompareSelectModal } from './components/VersionCompare/VersionCompareSelectModal';
15
+ export type { VersionCompareSelectModalProps } from './components/VersionCompare/VersionCompareSelectModal';
16
+ export { default as DatasetVersionCompare } from './components/VersionCompare';
17
+ export type { DatasetVersionCompareProps } from './components/VersionCompare';
18
+ export { default as createDatasetVersionCompare } from './createDatasetVersionCompare';
19
+ export type { DatasetVersionCompareConfig } from './createDatasetVersionCompare';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glodon-aiot/dataset-annotation",
3
- "version": "3.25.1-alpha.2",
3
+ "version": "3.25.1-alpha.4",
4
4
  "module": "./dist/es/index.mjs",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@ant-design/icons": "^5.3.4",
39
39
  "@aws-crypto/sha256-js": "^3.0.0",
40
- "@glodon-aiot/apis": "^3.25.1-alpha.2",
40
+ "@glodon-aiot/apis": "^3.25.1-alpha.4",
41
41
  "@glodon-aiot/minio": "^0.1.6",
42
42
  "@reduxjs/toolkit": "^1.9.5",
43
43
  "@types/fabric": "^5.3.2",