@vis3/kit 1.0.0-alpha.3 → 1.0.0-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.
- package/README.md +34 -1
- package/dist/components/BinaryButton/index.d.ts +20 -0
- package/dist/components/CodeViewer/context.d.ts +10 -0
- package/dist/components/CodeViewer/index.d.ts +7 -0
- package/dist/components/CodeViewer/json-key-plugin.d.ts +19 -0
- package/dist/components/CodeViewer/link-plugin.d.ts +21 -0
- package/dist/components/FileIcon/index.d.ts +93 -0
- package/dist/components/FullscreenButton/index.d.ts +4 -0
- package/dist/components/Markdown.d.ts +6 -0
- package/dist/components/Renderer/Block/index.d.ts +26 -0
- package/dist/components/Renderer/Card.d.ts +27 -0
- package/dist/components/Renderer/ContentList/index.d.ts +53 -0
- package/dist/components/Renderer/Csv/index.d.ts +2 -0
- package/dist/components/Renderer/Folder/index.d.ts +14 -0
- package/dist/components/Renderer/Html/index.d.ts +2 -0
- package/dist/components/Renderer/Image/index.d.ts +2 -0
- package/dist/components/Renderer/ImageList/index.d.ts +10 -0
- package/dist/components/Renderer/Json/index.d.ts +2 -0
- package/dist/components/Renderer/Jsonl/index.d.ts +27 -0
- package/dist/components/Renderer/Markdown/index.d.ts +3 -0
- package/dist/components/Renderer/Media/index.d.ts +5 -0
- package/dist/components/Renderer/Raw/index.d.ts +2 -0
- package/dist/components/Renderer/contexts/card.context.d.ts +6 -0
- package/dist/components/Renderer/contexts/field.context.d.ts +8 -0
- package/dist/components/Renderer/contexts/preview.context.d.ts +20 -0
- package/dist/components/Renderer/contexts/types.d.ts +14 -0
- package/dist/components/Renderer/index.d.ts +13 -0
- package/dist/components/Renderer/stateHooks/useBase.d.ts +5 -0
- package/dist/components/Renderer/stateHooks/useCopy.d.ts +1 -0
- package/dist/components/Renderer/stateHooks/usePreview.d.ts +3 -0
- package/dist/components/Renderer/stateHooks/useRenderType.d.ts +4 -0
- package/dist/components/Renderer/stateHooks/useWrap.d.ts +3 -0
- package/dist/components/Renderer/utils.d.ts +4 -0
- package/dist/components/Renderer/withtout_jsonl.d.ts +19 -0
- package/dist/components/TextLikePreviewer/index.d.ts +7 -0
- package/dist/i18n/i18n.d.ts +3 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/locales/index.d.ts +3 -0
- package/dist/i18n/provider.d.ts +10 -0
- package/dist/i18n/useLocalStorage.d.ts +1 -0
- package/dist/i18n/utils.d.ts +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +89073 -0
- package/dist/index.umd.js +517 -0
- package/dist/theme/ThemeProvider.d.ts +12 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/tokens.d.ts +501 -0
- package/dist/utils.d.ts +40 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
# vis3/kit
|
|
1
|
+
# @vis3/kit
|
|
2
|
+
[](https://www.npmjs.com/package/@vis3/kit)
|
|
2
3
|
|
|
3
4
|
## Install
|
|
4
5
|
|
|
@@ -6,3 +7,35 @@
|
|
|
6
7
|
npm i @vis3/kit
|
|
7
8
|
# or pnpm add @vis3/kit
|
|
8
9
|
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { BucketBlock } from '@vis3/kit'
|
|
15
|
+
|
|
16
|
+
export default function App() {
|
|
17
|
+
const handleParamsChange = (params) => {
|
|
18
|
+
console.log(params)
|
|
19
|
+
}
|
|
20
|
+
const dataSource = {
|
|
21
|
+
path: "s3://qa-huawei/MinerU/Badcase/badcase_info.jsonl?bytes=0,623",
|
|
22
|
+
type: "file",
|
|
23
|
+
created_by: null,
|
|
24
|
+
mimetype: "application/x-ndjson",
|
|
25
|
+
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",
|
|
27
|
+
last_modified: "2025-04-29T10:56:53Z"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<BucketBlock
|
|
32
|
+
id="1"
|
|
33
|
+
dataSource={dataSource}
|
|
34
|
+
path="s3://bucketname/"
|
|
35
|
+
onChange={handleParamsChange}
|
|
36
|
+
showPagination={false}
|
|
37
|
+
showDownload={false}
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TooltipProps } from 'antd';
|
|
2
|
+
import type { ForwardedRef } from 'react';
|
|
3
|
+
export interface BinaryButtonProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
activated: boolean;
|
|
6
|
+
onChange?: (activated: boolean) => void;
|
|
7
|
+
title?: string;
|
|
8
|
+
onTitle?: string;
|
|
9
|
+
offTitle?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
placement?: TooltipProps['placement'];
|
|
12
|
+
onIcon?: React.ReactNode;
|
|
13
|
+
offIcon?: React.ReactNode;
|
|
14
|
+
btnRef?: ForwardedRef<BinaryButtonRef>;
|
|
15
|
+
}
|
|
16
|
+
export interface BinaryButtonRef {
|
|
17
|
+
setActivated: (activated: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
declare const ForwardedBinaryButton: import("react").ForwardRefExoticComponent<BinaryButtonProps & import("react").RefAttributes<unknown>>;
|
|
20
|
+
export default ForwardedBinaryButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const CodeViewerContext: import("react").Context<{
|
|
2
|
+
wrap: boolean;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function useCodeViewerContext(): {
|
|
7
|
+
wrap: boolean;
|
|
8
|
+
value: string;
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface JsonViewerProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function JsonViewer({ className }: JsonViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function TextViewer({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const JSON_KEY_CLICK_EVENT = "json-key-click";
|
|
2
|
+
export type KeyPath = (string | number)[];
|
|
3
|
+
export interface CustomEventJsonNodeDetail {
|
|
4
|
+
field: string;
|
|
5
|
+
valueType: string;
|
|
6
|
+
blockId?: string;
|
|
7
|
+
value: any;
|
|
8
|
+
parentField: string;
|
|
9
|
+
}
|
|
10
|
+
export interface JsonNode {
|
|
11
|
+
key: string;
|
|
12
|
+
depth: number;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
pathArray: KeyPath;
|
|
16
|
+
path: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const keyStyle: import("@codemirror/state").Extension;
|
|
19
|
+
export declare const jsonKeyLink: import("@codemirror/state").Extension[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
import type { DecorationSet, ViewUpdate } from '@codemirror/view';
|
|
3
|
+
import { MatchDecorator, ViewPlugin } from '@codemirror/view';
|
|
4
|
+
export interface HyperLinkState {
|
|
5
|
+
at: number;
|
|
6
|
+
url: string;
|
|
7
|
+
anchor: HyperLinkExtensionOptions['anchor'];
|
|
8
|
+
}
|
|
9
|
+
export interface HyperLinkExtensionOptions {
|
|
10
|
+
regexp?: RegExp;
|
|
11
|
+
match?: Record<string, string>;
|
|
12
|
+
handle?: (value: string, input: string, from: number, to: number) => string;
|
|
13
|
+
anchor?: (dom: HTMLAnchorElement) => HTMLAnchorElement;
|
|
14
|
+
}
|
|
15
|
+
export declare function hyperLinkExtension({ regexp, match, handle }?: HyperLinkExtensionOptions): ViewPlugin<{
|
|
16
|
+
decorator: MatchDecorator;
|
|
17
|
+
decorations: DecorationSet;
|
|
18
|
+
update(update: ViewUpdate): void;
|
|
19
|
+
}, undefined>[];
|
|
20
|
+
export declare const hyperLinkStyle: Extension;
|
|
21
|
+
export declare const hyperLink: Extension;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const fileTypeIconMapping: {
|
|
2
|
+
readonly folder: import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
readonly file: import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
readonly bucket: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
readonly txt: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
readonly md: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
readonly markdown: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
readonly pdf: import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
readonly doc: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
readonly docx: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
readonly rtf: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
readonly json: import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
readonly jsonl: import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
readonly yaml: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
readonly yml: import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
readonly toml: import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
readonly xml: import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
readonly csv: import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
readonly xls: import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
readonly xlsx: import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
readonly sql: import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
readonly sqlite: import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
readonly graphql: import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
readonly gql: import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
readonly ts: import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
readonly tsx: import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
readonly js: import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
readonly jsx: import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
readonly vue: import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
readonly html: import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
readonly htm: import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
readonly css: import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
readonly less: import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
readonly sass: import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
readonly scss: import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
readonly py: import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
readonly pyc: import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
readonly java: import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
readonly class: import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
readonly jar: import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
readonly go: import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
readonly rs: import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
readonly php: import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
readonly sh: import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
readonly bash: import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
readonly zsh: import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
readonly fish: import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
readonly 'tsconfig.json': import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
readonly 'package.json': import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
readonly 'package-lock.json': import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
readonly 'yarn.lock': import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
readonly 'pnpm-lock.yaml': import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
readonly '.gitignore': import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
readonly '.eslintrc': import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
readonly '.eslintrc.js': import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
readonly '.eslintrc.json': import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
readonly '.prettierrc': import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
readonly '.prettierrc.js': import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
readonly '.babelrc': import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
readonly 'babel.config.js': import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
readonly 'vite.config.ts': import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
readonly 'vite.config.js': import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
readonly 'webpack.config.js': import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
readonly Dockerfile: import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
readonly 'docker-compose.yml': import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
readonly 'docker-compose.yaml': import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
readonly mp3: import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
readonly wav: import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
readonly ogg: import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
readonly mp4: import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
readonly avi: import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
readonly mov: import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
readonly mkv: import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
readonly webm: import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
readonly jpg: import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
readonly jpeg: import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
readonly png: import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
readonly gif: import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
readonly svg: import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
readonly webp: import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
readonly ico: import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
readonly zip: import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
readonly rar: import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
readonly '7z': import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
readonly tar: import("react/jsx-runtime").JSX.Element;
|
|
86
|
+
readonly gz: import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
readonly tgz: import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
};
|
|
89
|
+
export interface FileIconProps {
|
|
90
|
+
path?: string;
|
|
91
|
+
type?: keyof typeof fileTypeIconMapping;
|
|
92
|
+
}
|
|
93
|
+
export declare function FileIcon({ path, type }: FileIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseBucketType, BucketParams } from '../contexts/types';
|
|
2
|
+
export declare const PAGENATION_CHANGE_EVENT = "vis3-pagenation-change";
|
|
3
|
+
export declare const PATH_CORRECTION_EVENT = "vis3-path-correction";
|
|
4
|
+
export interface BucketBlockProps<BucketType extends BaseBucketType> {
|
|
5
|
+
id: string;
|
|
6
|
+
path: string;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
dataSource?: BucketType | BucketType[];
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
className?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
onDownload?: (path: string) => void;
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
pageNo?: number;
|
|
15
|
+
onPathCorrection?: (path: string) => void;
|
|
16
|
+
showGoParent?: boolean;
|
|
17
|
+
showPagination?: boolean;
|
|
18
|
+
showOpenInNewTab?: boolean;
|
|
19
|
+
showDownload?: boolean;
|
|
20
|
+
closeable?: boolean;
|
|
21
|
+
onChange?: (params: Partial<BucketParams>) => void;
|
|
22
|
+
renderBucketItem?: (item: BucketType) => React.ReactNode;
|
|
23
|
+
previewUrl?: string;
|
|
24
|
+
onOpenInNewTab?: (path: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function BucketBlock<T extends BaseBucketType>({ id, path, onClose, dataSource, style, className, loading, onDownload, pageSize, pageNo, onPathCorrection, showGoParent, showPagination, onChange, closeable, showOpenInNewTab, onOpenInNewTab, renderBucketItem, previewUrl, showDownload, }: BucketBlockProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type RenderCardProps = React.PropsWithChildren<{
|
|
3
|
+
className?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
titleExtra?: React.ReactNode;
|
|
7
|
+
extra?: React.ReactNode;
|
|
8
|
+
bodyStyle?: React.CSSProperties;
|
|
9
|
+
}>;
|
|
10
|
+
export interface RendererProps {
|
|
11
|
+
className?: string;
|
|
12
|
+
name: string;
|
|
13
|
+
value: string;
|
|
14
|
+
extraTail?: React.ReactNode;
|
|
15
|
+
titleExtra?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare const RenderCard: React.ForwardRefExoticComponent<{
|
|
18
|
+
className?: string;
|
|
19
|
+
name: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
titleExtra?: React.ReactNode;
|
|
22
|
+
extra?: React.ReactNode;
|
|
23
|
+
bodyStyle?: React.CSSProperties;
|
|
24
|
+
} & {
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export default RenderCard;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { RendererProps } from '../Card';
|
|
2
|
+
export interface ContentItem {
|
|
3
|
+
type: 'image' | 'text' | 'audio' | 'video' | 'table' | 'list' | 'code' | 'quote' | 'hr' | 'equation';
|
|
4
|
+
html?: string;
|
|
5
|
+
/**
|
|
6
|
+
* 文本的heading级别,0表示普通正文,1表示一级标题,以此类推。当type为text时,该字段才有意义。
|
|
7
|
+
*/
|
|
8
|
+
text_level?: number;
|
|
9
|
+
text_format?: 'text' | 'md' | 'latex';
|
|
10
|
+
text?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 表格的caption,当type为table时,该字段才有意义。
|
|
13
|
+
*/
|
|
14
|
+
table_caption?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 当type为image时,该字段为图片的url
|
|
17
|
+
*/
|
|
18
|
+
img_urls?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* 当type为image时,该字段为图片的hash值
|
|
21
|
+
*/
|
|
22
|
+
img_url_hash?: string;
|
|
23
|
+
/**
|
|
24
|
+
* 图像的s3路径
|
|
25
|
+
*/
|
|
26
|
+
img_path?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 图像的alt属性
|
|
29
|
+
*/
|
|
30
|
+
img_alt?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 当type为image,且图像链接为data url时,该字段为data url的内容。
|
|
33
|
+
*/
|
|
34
|
+
img_data?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 图像的title属性
|
|
37
|
+
*/
|
|
38
|
+
img_title?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 图像的caption
|
|
41
|
+
*/
|
|
42
|
+
img_caption?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 当type为video/audio时,该字段包含了媒体文件的链接。
|
|
45
|
+
*/
|
|
46
|
+
sources?: string[];
|
|
47
|
+
md?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ContentListProps {
|
|
50
|
+
name: string;
|
|
51
|
+
data: ContentItem[];
|
|
52
|
+
}
|
|
53
|
+
export default function ContentListCard({ className, name, value, extraTail }: RendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RendererProps } from '../Card';
|
|
2
|
+
import { BaseBucketType } from '../contexts/types';
|
|
3
|
+
export interface BucketItemWrapper extends BaseBucketType {
|
|
4
|
+
fullPath: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FolderRendererProps extends Omit<RendererProps, 'value'> {
|
|
7
|
+
value: BucketItemWrapper[];
|
|
8
|
+
highlightCurrent?: boolean;
|
|
9
|
+
pathWithoutQuery: string;
|
|
10
|
+
showBodyOnly?: boolean;
|
|
11
|
+
onPathChange?: (path: string) => void;
|
|
12
|
+
path: string;
|
|
13
|
+
}
|
|
14
|
+
export default function FolderRenderer({ path, onPathChange, name, extraTail, titleExtra, value, highlightCurrent, pathWithoutQuery, showBodyOnly }: FolderRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RendererProps } from '../Card';
|
|
2
|
+
export interface ImageItem {
|
|
3
|
+
url: string;
|
|
4
|
+
img_size: [number, number];
|
|
5
|
+
}
|
|
6
|
+
export interface ImageListProps {
|
|
7
|
+
data: string[] | ImageItem[];
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
export default function ImageListCard({ className, name, value, extraTail }: RendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import 'react-grid-layout/css/styles.css';
|
|
2
|
+
import 'react-resizable/css/styles.css';
|
|
3
|
+
import './index.css';
|
|
4
|
+
import type { RendererProps } from '../Card';
|
|
5
|
+
import type { RenderType } from '../stateHooks/useRenderType';
|
|
6
|
+
export interface FieldBlock {
|
|
7
|
+
id: string;
|
|
8
|
+
field: string;
|
|
9
|
+
renderAs: RenderType;
|
|
10
|
+
}
|
|
11
|
+
interface FieldRendererWrapperProps extends RendererProps {
|
|
12
|
+
renderAs: RenderType;
|
|
13
|
+
}
|
|
14
|
+
export declare function FieldRendererWrapper({ renderAs, ...props }: FieldRendererWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useContainerSize(wrapper: HTMLDivElement | null): {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function inferDefaultRenderAs(field: string, value: any): "markdown" | "html" | "raw" | "content_list" | "img_list";
|
|
20
|
+
export declare class FieldChain {
|
|
21
|
+
current: string;
|
|
22
|
+
parent: FieldChain | undefined;
|
|
23
|
+
constructor(current: string, parent?: FieldChain);
|
|
24
|
+
get fullPath(): string;
|
|
25
|
+
}
|
|
26
|
+
export default function JsonlCard({ className, name, value, extraTail, titleExtra }: RendererProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RendererProps } from '../Card';
|
|
2
|
+
export interface MediaCardProps extends RendererProps {
|
|
3
|
+
type: string;
|
|
4
|
+
}
|
|
5
|
+
export default function MediaCard({ type, className, name, value, extraTail, titleExtra }: MediaCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseBucketType } from './types';
|
|
2
|
+
export interface RenderBlockContextType<BucketType extends BaseBucketType> {
|
|
3
|
+
id: string;
|
|
4
|
+
path: string;
|
|
5
|
+
pathType: string;
|
|
6
|
+
basename?: string;
|
|
7
|
+
data?: BucketType;
|
|
8
|
+
nextable?: boolean;
|
|
9
|
+
onNext?: () => void;
|
|
10
|
+
prevable?: boolean;
|
|
11
|
+
onPrev?: () => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
goParent: () => void;
|
|
14
|
+
dataSource?: BucketType | BucketType[];
|
|
15
|
+
onDownload?: (path: string) => void;
|
|
16
|
+
renderBucketItem?: (item: BucketType) => React.ReactNode;
|
|
17
|
+
previewUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const PreviewBlockContext: import("react").Context<RenderBlockContextType<BaseBucketType>>;
|
|
20
|
+
export declare function usePreviewBlockContext<T extends BaseBucketType>(): RenderBlockContextType<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BaseBucketType {
|
|
2
|
+
type: 'directory' | 'file' | 'bucket';
|
|
3
|
+
path: string;
|
|
4
|
+
content: string | null;
|
|
5
|
+
size: number | null;
|
|
6
|
+
created_by: string | null;
|
|
7
|
+
last_modified: string | null;
|
|
8
|
+
mimetype: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface BucketParams {
|
|
11
|
+
pageSize?: number;
|
|
12
|
+
pageNo?: number;
|
|
13
|
+
path?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import JsonlCard from './Jsonl';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
jsonl: typeof JsonlCard;
|
|
4
|
+
content_list: typeof import("./ContentList").default;
|
|
5
|
+
img_list: typeof import("./ImageList").default;
|
|
6
|
+
html: typeof import("./Html").default;
|
|
7
|
+
markdown: typeof import("./Markdown").default;
|
|
8
|
+
json: typeof import("./Json").default;
|
|
9
|
+
image: typeof import("./Image").default;
|
|
10
|
+
raw: typeof import("./Raw").default;
|
|
11
|
+
csv: typeof import("./Csv").default;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useCopy(value: string): [React.ReactNode];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ContentListCard from './ContentList';
|
|
2
|
+
import CsvCard from './Csv';
|
|
3
|
+
import HtmlCard from './Html';
|
|
4
|
+
import ImageCard from './Image';
|
|
5
|
+
import ImageListCard from './ImageList';
|
|
6
|
+
import JsonCard from './Json';
|
|
7
|
+
import MarkdownCard from './Markdown';
|
|
8
|
+
import RawCard from './Raw';
|
|
9
|
+
declare const renders: {
|
|
10
|
+
content_list: typeof ContentListCard;
|
|
11
|
+
img_list: typeof ImageListCard;
|
|
12
|
+
html: typeof HtmlCard;
|
|
13
|
+
markdown: typeof MarkdownCard;
|
|
14
|
+
json: typeof JsonCard;
|
|
15
|
+
image: typeof ImageCard;
|
|
16
|
+
raw: typeof RawCard;
|
|
17
|
+
csv: typeof CsvCard;
|
|
18
|
+
};
|
|
19
|
+
export default renders;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RendererProps } from '../Renderer/Card';
|
|
2
|
+
export interface TextLikePreviewerProps extends Omit<RendererProps, 'value'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
type: string;
|
|
6
|
+
}
|
|
7
|
+
export default function TextLikePreviewer({ name, type, className, extraTail, titleExtra }: TextLikePreviewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type I18nProviderProps = React.PropsWithChildren<{
|
|
3
|
+
locales?: Record<string, Record<string, unknown> & {
|
|
4
|
+
translation: Record<string, unknown>;
|
|
5
|
+
}>;
|
|
6
|
+
locale?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function I18nProvider(props: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/** 用于外部改变语言 */
|
|
10
|
+
export declare const changeLanguage: (lang: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLocalStorage: (key: string, value: any) => any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function merge(target: any, ...sources: any[]): any;
|