@vis3/kit 1.0.0-alpha.4 → 1.0.0-alpha.5

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 (2) hide show
  1. package/README.md +57 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @vis3/kit
2
2
  [![npm](https://img.shields.io/npm/v/%40vis3/kit.svg)](https://www.npmjs.com/package/@vis3/kit)
3
3
 
4
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/opendatalab/Vis3/tree/main/web/packages/vis3-kit/example)
5
+
4
6
  ## Install
5
7
 
6
8
  ```bash
@@ -18,12 +20,12 @@ export default function App() {
18
20
  console.log(params)
19
21
  }
20
22
  const dataSource = {
21
- path: "s3://qa-huawei/MinerU/Badcase/badcase_info.jsonl?bytes=0,623",
22
- type: "file",
23
+ path: "s3://qa-huawei/exmaple/example.jsonl?bytes=0,623",
24
+ type: "file" as const,
23
25
  created_by: null,
24
26
  mimetype: "application/x-ndjson",
25
27
  size: 482972,
26
- content: "{\"pdf_name\": \"academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.pdf\", \"img_name\": \"academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.jpg\", \"s3_pdf_path\": \"s3://qa-huawei/MinerU/Badcase_V2_0429/pdf/academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.pdf\", \"s3_img_path\": \"s3://qa-huawei/MinerU/Badcase_V2_0429/img/academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.jpg\", \"pharse_level\": \"中\", \"pdf_category\": \"论文\", \"pdf_layout\": [\"复合布局\", \"双栏\"], \"pdf_element\": [\"公式-印刷体\", \"文本-印刷体\", \"背景-白色\"], \"pdf_watermark\": \"否\", \"pdf_language\": \"英语\"}\r",
28
+ content: "{\"pdf_name\": \"academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.pdf\", \"img_name\": \"academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.jpg\", \"s3_pdf_path\": \"s3://qa-huawei/exmaple/pdf/academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.pdf\", \"s3_img_path\": \"s3://qa-huawei/exmaple/img/academic_literature_6ac08aae4a9de359ec55db33a81fcc92_page_1.jpg\", \"pharse_level\": \"中\", \"pdf_category\": \"论文\", \"pdf_layout\": [\"复合布局\", \"双栏\"], \"pdf_element\": [\"公式-印刷体\", \"文本-印刷体\", \"背景-白色\"], \"pdf_watermark\": \"否\", \"pdf_language\": \"英语\"}\r",
27
29
  last_modified: "2025-04-29T10:56:53Z"
28
30
  }
29
31
 
@@ -38,4 +40,55 @@ export default function App() {
38
40
  />
39
41
  )
40
42
  }
41
- ```
43
+ ```
44
+
45
+ ## Component options
46
+
47
+ ### BucketBlock
48
+
49
+ | 属性 | 类型 | 默认值 | 说明 |
50
+ |------|------|--------|------|
51
+ | id | string | - | 组件唯一标识符 |
52
+ | path | string | - | 文件或目录路径 |
53
+ | dataSource | BucketType \| BucketType[] | - | 数据源,可以是单个文件/目录对象或数组 |
54
+ | loading | boolean | false | 加载状态 |
55
+ | onClose | () => void | - | 关闭按钮点击回调 |
56
+ | onDownload | (path: string) => void | - | 下载按钮点击回调 |
57
+ | pageSize | number | 50 | 每页显示的条目数 |
58
+ | pageNo | number | 1 | 当前页码 |
59
+ | onPathCorrection | (path: string) => void | - | 路径修正回调 |
60
+ | showGoParent | boolean | false | 是否显示返回上级目录按钮 |
61
+ | showPagination | boolean | true | 是否显示分页器 |
62
+ | showOpenInNewTab | boolean | false | 是否显示在新标签页打开按钮 |
63
+ | showDownload | boolean | true | 是否显示下载按钮 |
64
+ | closeable | boolean | false | 是否可关闭 |
65
+ | onChange | (params: Partial<BucketParams>) => void | - | 参数变更回调 |
66
+ | renderBucketItem | (item: BucketType) => React.ReactNode | - | 自定义渲染列表项 |
67
+ | previewUrl | string | - | 预览文件的URL |
68
+ | onOpenInNewTab | (path: string) => void | - | 在新标签页打开回调 |
69
+ | style | React.CSSProperties | - | 自定义样式 |
70
+ | className | string | - | 自定义类名 |
71
+
72
+ #### BucketType 类型定义
73
+
74
+ ```typescript
75
+ interface BaseBucketType {
76
+ type: 'directory' | 'file' | 'bucket'
77
+ path: string
78
+ content: string | null
79
+ size: number | null
80
+ created_by: string | null
81
+ last_modified: string | null
82
+ mimetype: string | null
83
+ }
84
+ ```
85
+
86
+ #### BucketParams 类型定义
87
+
88
+ ```typescript
89
+ interface BucketParams {
90
+ pageSize?: number
91
+ pageNo?: number
92
+ path?: string
93
+ }
94
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vis3/kit",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.5",
4
4
  "scripts": {
5
5
  "build": "vite build && tsc -d --emitDeclarationOnly",
6
6
  "clean": "rimraf ./node_modules",