@mxmweb/fviewer 1.0.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.
- package/Preview.d.ts +3 -0
- package/README.md +1 -0
- package/StreamPreview.d.ts +3 -0
- package/adopters/GientechStreamReader.d.ts +44 -0
- package/adopters/StaticFileReader.d.ts +39 -0
- package/adopters/components/Header/Toolbar.d.ts +1 -0
- package/adopters/components/Header/index.d.ts +32 -0
- package/assets/style.css +1 -0
- package/core/Annotation/index.d.ts +13 -0
- package/core/Fviewer.d.ts +45 -0
- package/core/ImageRender/index.d.ts +1 -0
- package/core/PdfRender/index.d.ts +25 -0
- package/core/TxtRender/index.d.ts +1 -0
- package/core/index.d.ts +6 -0
- package/core/types.d.ts +46 -0
- package/core/utils/fileParser.d.ts +64 -0
- package/demo.html +226 -0
- package/demo.txt +429 -0
- package/index.js +24542 -0
- package/index.js.map +1 -0
- package/lib_enter.d.ts +18 -0
- package/main.d.ts +1 -0
- package/package.json +23 -0
- package/vite.svg +1 -0
- package/worker/pdf.worker.min.js +22 -0
package/Preview.d.ts
ADDED
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# 工具库架构初始化
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AppTheme, Annotation, ToolsConfig } from '../core/types';
|
|
3
|
+
export interface GientechStreamReaderProps {
|
|
4
|
+
convertedFilePath: string;
|
|
5
|
+
fileName?: string;
|
|
6
|
+
fileType: string;
|
|
7
|
+
initialPage?: number;
|
|
8
|
+
totalPages?: number;
|
|
9
|
+
annotations?: Annotation[];
|
|
10
|
+
userName?: string;
|
|
11
|
+
userId?: string;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
streamApiUrl?: string;
|
|
14
|
+
authorization?: string;
|
|
15
|
+
eventsEmit?: (name: string, data?: any, innerFn?: any) => void;
|
|
16
|
+
styles?: {
|
|
17
|
+
theme?: AppTheme;
|
|
18
|
+
mode?: 'light' | 'dark';
|
|
19
|
+
};
|
|
20
|
+
tools?: ToolsConfig;
|
|
21
|
+
customComponents?: {
|
|
22
|
+
LoadingComponent?: React.ComponentType<{
|
|
23
|
+
status: string;
|
|
24
|
+
theme: AppTheme;
|
|
25
|
+
}>;
|
|
26
|
+
ErrorComponent?: React.ComponentType<{
|
|
27
|
+
error: string;
|
|
28
|
+
theme: AppTheme;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
className?: string;
|
|
32
|
+
headerClass?: string;
|
|
33
|
+
contentClass?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* GientechStreamReader组件
|
|
37
|
+
* 基于stream接口的文件读取器,支持分页获取PDF数据并渲染
|
|
38
|
+
* 遵循adopter_develop规范,使用HOC模式封装core组件
|
|
39
|
+
*
|
|
40
|
+
* @param props - 组件属性
|
|
41
|
+
* @returns GientechStreamReader组件
|
|
42
|
+
*/
|
|
43
|
+
declare const GientechStreamReader: React.FC<GientechStreamReaderProps>;
|
|
44
|
+
export default GientechStreamReader;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AppTheme, Annotation, ToolsConfig } from '../core/types';
|
|
3
|
+
export interface StaticFileReaderProps {
|
|
4
|
+
fileUrl: string;
|
|
5
|
+
fileType?: string;
|
|
6
|
+
fileName?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
initialPage?: number;
|
|
9
|
+
annotations?: Annotation[];
|
|
10
|
+
data?: any;
|
|
11
|
+
eventsEmit?: (name: string, data?: any, innerFn?: any) => void;
|
|
12
|
+
styles?: {
|
|
13
|
+
theme?: AppTheme;
|
|
14
|
+
mode?: 'light' | 'dark';
|
|
15
|
+
};
|
|
16
|
+
tools?: ToolsConfig;
|
|
17
|
+
customComponents?: {
|
|
18
|
+
LoadingComponent?: React.ComponentType<{
|
|
19
|
+
status: string;
|
|
20
|
+
theme: AppTheme;
|
|
21
|
+
}>;
|
|
22
|
+
ErrorComponent?: React.ComponentType<{
|
|
23
|
+
error: string;
|
|
24
|
+
theme: AppTheme;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
className?: string;
|
|
28
|
+
headerClass?: string;
|
|
29
|
+
contentClass?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* StaticFileReader组件
|
|
33
|
+
* 静态文件读取器,支持从URL加载文件并解析显示
|
|
34
|
+
*
|
|
35
|
+
* @param props - 组件属性
|
|
36
|
+
* @returns StaticFileReader组件
|
|
37
|
+
*/
|
|
38
|
+
declare const StaticFileReader: React.FC<StaticFileReaderProps>;
|
|
39
|
+
export default StaticFileReader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AppTheme, ToolsConfig } from '../../../core/types';
|
|
3
|
+
export interface HeaderProps {
|
|
4
|
+
fileName?: string;
|
|
5
|
+
currentPage?: number;
|
|
6
|
+
totalPage?: number;
|
|
7
|
+
tools?: ToolsConfig;
|
|
8
|
+
styles?: {
|
|
9
|
+
theme?: AppTheme;
|
|
10
|
+
};
|
|
11
|
+
onPrevPage?: () => void;
|
|
12
|
+
onNextPage?: () => void;
|
|
13
|
+
onZoomIn?: () => void;
|
|
14
|
+
onZoomOut?: () => void;
|
|
15
|
+
onAnnotationToggle?: () => void;
|
|
16
|
+
onDownload?: () => void;
|
|
17
|
+
onRotateLeft?: () => void;
|
|
18
|
+
onRotateRight?: () => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
scale?: number;
|
|
21
|
+
isAnnotating?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Header组件
|
|
26
|
+
* 负责文件查看器的头部工具栏
|
|
27
|
+
*
|
|
28
|
+
* @param props - 组件属性
|
|
29
|
+
* @returns Header组件
|
|
30
|
+
*/
|
|
31
|
+
declare const Header: React.FC<HeaderProps>;
|
|
32
|
+
export default Header;
|
package/assets/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*{box-sizing:border-box}body{margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.pdf-container{position:relative;overflow:auto}.pdf-canvas{display:block;margin:0 auto}.annotation-layer{position:absolute;top:0;left:0;pointer-events:none}.annotation-item{position:absolute;pointer-events:auto;cursor:pointer;border-radius:2px;transition:all .2s ease}.annotation-item:hover{opacity:.8}.tool-button{display:inline-flex;align-items:center;justify-content:center;padding:6px 12px;border:none;border-radius:4px;background:transparent;color:inherit;cursor:pointer;transition:all .2s ease}.tool-button:hover{background:#0000000d}.tool-button.active{background:#007bff1a;color:#007bff}.loading-container{display:flex;align-items:center;justify-content:center;height:100%;color:#666}.error-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#dc3545;text-align:center;padding:20px}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Annotation as AnnotationType } from '../types';
|
|
3
|
+
export interface AnnotationProps {
|
|
4
|
+
pageNumber: number;
|
|
5
|
+
scale: number;
|
|
6
|
+
isAnnotating: boolean;
|
|
7
|
+
annotations: AnnotationType[];
|
|
8
|
+
onAnnotationAdd?: (annotation: AnnotationType) => void;
|
|
9
|
+
onAnnotationDelete?: (annotationId: string) => void;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Annotation: React.FC<AnnotationProps>;
|
|
13
|
+
export default Annotation;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AppTheme, Annotation, ToolsConfig } from './types';
|
|
3
|
+
export interface CustomizeComponents {
|
|
4
|
+
LoadingComponent?: React.ComponentType<{
|
|
5
|
+
status: string;
|
|
6
|
+
theme: AppTheme;
|
|
7
|
+
}>;
|
|
8
|
+
ErrorComponent?: React.ComponentType<{
|
|
9
|
+
error: string;
|
|
10
|
+
theme: AppTheme;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface FviewerData {
|
|
14
|
+
content: any;
|
|
15
|
+
fileName?: string;
|
|
16
|
+
fileType?: string;
|
|
17
|
+
totalPages?: number;
|
|
18
|
+
pdfStartPage?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface FviewerProps {
|
|
21
|
+
data: FviewerData;
|
|
22
|
+
annotationData?: Annotation[];
|
|
23
|
+
totalPage?: number;
|
|
24
|
+
currentPage?: number;
|
|
25
|
+
scale?: number;
|
|
26
|
+
rotation?: number;
|
|
27
|
+
eventsEmit?: (name: string, data?: any, innerFn?: any) => void;
|
|
28
|
+
styles?: {
|
|
29
|
+
theme?: AppTheme;
|
|
30
|
+
mode?: 'light' | 'dark';
|
|
31
|
+
};
|
|
32
|
+
tools?: ToolsConfig;
|
|
33
|
+
customComponents?: CustomizeComponents;
|
|
34
|
+
className?: string;
|
|
35
|
+
contentClass?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fviewer核心组件
|
|
39
|
+
* 负责文件类型检测、内容渲染和状态管理
|
|
40
|
+
*
|
|
41
|
+
* @param props - 组件属性
|
|
42
|
+
* @returns Fviewer组件
|
|
43
|
+
*/
|
|
44
|
+
declare const Fviewer: React.FC<FviewerProps>;
|
|
45
|
+
export default Fviewer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AppTheme, Annotation as AnnotationType } from '../types';
|
|
3
|
+
export interface PdfRenderProps {
|
|
4
|
+
pdfDocument: any | null;
|
|
5
|
+
currentPage: number;
|
|
6
|
+
pdfStartPage?: number;
|
|
7
|
+
scale: number;
|
|
8
|
+
annotations: AnnotationType[];
|
|
9
|
+
isAnnotating: boolean;
|
|
10
|
+
onPageChange?: (pageNumber: number) => void;
|
|
11
|
+
onAnnotationChange?: (annotation: AnnotationType) => void;
|
|
12
|
+
onAnnotationDelete?: (annotationId: string) => void;
|
|
13
|
+
styles?: {
|
|
14
|
+
theme?: AppTheme;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* PDF渲染组件
|
|
19
|
+
* 负责PDF文件的具体渲染和标注功能
|
|
20
|
+
*
|
|
21
|
+
* @param props - 组件属性
|
|
22
|
+
* @returns PDF渲染组件
|
|
23
|
+
*/
|
|
24
|
+
declare const PdfRender: React.FC<PdfRenderProps>;
|
|
25
|
+
export default PdfRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/core/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as Fviewer, FviewerProps } from './Fviewer';
|
|
2
|
+
import { default as PdfRender, PdfRenderProps } from './PdfRender';
|
|
3
|
+
import { AppTheme, Annotation, ToolsConfig } from './types';
|
|
4
|
+
export { Fviewer, PdfRender };
|
|
5
|
+
export type { FviewerProps, PdfRenderProps, AppTheme, Annotation, ToolsConfig };
|
|
6
|
+
export default Fviewer;
|
package/core/types.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface AppTheme {
|
|
2
|
+
colors: {
|
|
3
|
+
primary: string;
|
|
4
|
+
secondary: string;
|
|
5
|
+
success: string;
|
|
6
|
+
warning: string;
|
|
7
|
+
error: string;
|
|
8
|
+
info: string;
|
|
9
|
+
background: string;
|
|
10
|
+
text: string;
|
|
11
|
+
border: string;
|
|
12
|
+
disabled: string;
|
|
13
|
+
disabledBackground: string;
|
|
14
|
+
disabledText: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
space: {
|
|
18
|
+
sidebar: string;
|
|
19
|
+
size: string;
|
|
20
|
+
radius: string;
|
|
21
|
+
padding: string;
|
|
22
|
+
margin: string;
|
|
23
|
+
shadow: string;
|
|
24
|
+
lineHeight: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface Annotation {
|
|
30
|
+
id: string;
|
|
31
|
+
pageNumber: number;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
content?: string;
|
|
37
|
+
color?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ToolsConfig {
|
|
40
|
+
annotation?: boolean;
|
|
41
|
+
download?: boolean;
|
|
42
|
+
zoom?: boolean;
|
|
43
|
+
close?: boolean;
|
|
44
|
+
navigation?: boolean;
|
|
45
|
+
rotate?: boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type FileType = 'pdf' | 'image' | 'text' | 'markdown' | 'html' | 'unknown';
|
|
2
|
+
export interface ParseResult {
|
|
3
|
+
type: FileType;
|
|
4
|
+
content: any;
|
|
5
|
+
fileName?: string;
|
|
6
|
+
fileType?: string;
|
|
7
|
+
totalPages?: number;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ParseOptions {
|
|
11
|
+
fileName?: string;
|
|
12
|
+
fileType?: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 检测文件类型
|
|
17
|
+
* @param fileName - 文件名
|
|
18
|
+
* @param fileType - 文件类型
|
|
19
|
+
* @param content - 文件内容
|
|
20
|
+
* @returns 文件类型
|
|
21
|
+
*/
|
|
22
|
+
export declare const detectFileType: (fileName?: string, fileType?: string, content?: any) => FileType;
|
|
23
|
+
/**
|
|
24
|
+
* 解析PDF文件(支持静态文件和stream chunk)
|
|
25
|
+
* @param data - PDF数据(ArrayBuffer或URL)
|
|
26
|
+
* @param options - 解析选项
|
|
27
|
+
* @returns 解析结果
|
|
28
|
+
*/
|
|
29
|
+
export declare const parsePdfFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
|
30
|
+
/**
|
|
31
|
+
* 解析图片文件
|
|
32
|
+
* @param data - 图片数据(URL或ArrayBuffer)
|
|
33
|
+
* @param options - 解析选项
|
|
34
|
+
* @returns 解析结果
|
|
35
|
+
*/
|
|
36
|
+
export declare const parseImageFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
|
37
|
+
/**
|
|
38
|
+
* 解析文本文件
|
|
39
|
+
* @param data - 文本数据(URL或ArrayBuffer)
|
|
40
|
+
* @param options - 解析选项
|
|
41
|
+
* @returns 解析结果
|
|
42
|
+
*/
|
|
43
|
+
export declare const parseTextFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
|
44
|
+
/**
|
|
45
|
+
* 解析Markdown文件
|
|
46
|
+
* @param data - Markdown数据(URL或ArrayBuffer)
|
|
47
|
+
* @param options - 解析选项
|
|
48
|
+
* @returns 解析结果
|
|
49
|
+
*/
|
|
50
|
+
export declare const parseMarkdownFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
|
51
|
+
/**
|
|
52
|
+
* 解析HTML文件
|
|
53
|
+
* @param data - HTML数据(URL或ArrayBuffer)
|
|
54
|
+
* @param options - 解析选项
|
|
55
|
+
* @returns 解析结果
|
|
56
|
+
*/
|
|
57
|
+
export declare const parseHtmlFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
|
58
|
+
/**
|
|
59
|
+
* 统一文件解析函数
|
|
60
|
+
* @param data - 文件数据(URL或ArrayBuffer)
|
|
61
|
+
* @param options - 解析选项
|
|
62
|
+
* @returns 解析结果
|
|
63
|
+
*/
|
|
64
|
+
export declare const parseFile: (data: ArrayBuffer | string, options?: ParseOptions) => Promise<ParseResult>;
|
package/demo.html
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>FViewer HTML 测试页面</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
10
|
+
line-height: 1.6;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
14
|
+
color: #333;
|
|
15
|
+
}
|
|
16
|
+
.container {
|
|
17
|
+
max-width: 800px;
|
|
18
|
+
margin: 0 auto;
|
|
19
|
+
background: white;
|
|
20
|
+
padding: 30px;
|
|
21
|
+
border-radius: 10px;
|
|
22
|
+
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
|
|
23
|
+
}
|
|
24
|
+
h1 {
|
|
25
|
+
color: #2c3e50;
|
|
26
|
+
text-align: center;
|
|
27
|
+
border-bottom: 3px solid #3498db;
|
|
28
|
+
padding-bottom: 10px;
|
|
29
|
+
}
|
|
30
|
+
h2 {
|
|
31
|
+
color: #34495e;
|
|
32
|
+
margin-top: 30px;
|
|
33
|
+
}
|
|
34
|
+
.highlight {
|
|
35
|
+
background-color: #f39c12;
|
|
36
|
+
color: white;
|
|
37
|
+
padding: 2px 6px;
|
|
38
|
+
border-radius: 3px;
|
|
39
|
+
}
|
|
40
|
+
.code-block {
|
|
41
|
+
background-color: #f8f9fa;
|
|
42
|
+
border: 1px solid #e9ecef;
|
|
43
|
+
border-radius: 5px;
|
|
44
|
+
padding: 15px;
|
|
45
|
+
font-family: 'Courier New', monospace;
|
|
46
|
+
overflow-x: auto;
|
|
47
|
+
}
|
|
48
|
+
table {
|
|
49
|
+
width: 100%;
|
|
50
|
+
border-collapse: collapse;
|
|
51
|
+
margin: 20px 0;
|
|
52
|
+
}
|
|
53
|
+
th, td {
|
|
54
|
+
border: 1px solid #ddd;
|
|
55
|
+
padding: 12px;
|
|
56
|
+
text-align: left;
|
|
57
|
+
}
|
|
58
|
+
th {
|
|
59
|
+
background-color: #3498db;
|
|
60
|
+
color: white;
|
|
61
|
+
}
|
|
62
|
+
tr:nth-child(even) {
|
|
63
|
+
background-color: #f2f2f2;
|
|
64
|
+
}
|
|
65
|
+
.button {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
padding: 10px 20px;
|
|
68
|
+
background-color: #3498db;
|
|
69
|
+
color: white;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
border-radius: 5px;
|
|
72
|
+
margin: 5px;
|
|
73
|
+
transition: background-color 0.3s;
|
|
74
|
+
}
|
|
75
|
+
.button:hover {
|
|
76
|
+
background-color: #2980b9;
|
|
77
|
+
}
|
|
78
|
+
.alert {
|
|
79
|
+
padding: 15px;
|
|
80
|
+
margin: 20px 0;
|
|
81
|
+
border-radius: 5px;
|
|
82
|
+
}
|
|
83
|
+
.alert-success {
|
|
84
|
+
background-color: #d4edda;
|
|
85
|
+
border: 1px solid #c3e6cb;
|
|
86
|
+
color: #155724;
|
|
87
|
+
}
|
|
88
|
+
.alert-warning {
|
|
89
|
+
background-color: #fff3cd;
|
|
90
|
+
border: 1px solid #ffeaa7;
|
|
91
|
+
color: #856404;
|
|
92
|
+
}
|
|
93
|
+
.alert-error {
|
|
94
|
+
background-color: #f8d7da;
|
|
95
|
+
border: 1px solid #f5c6cb;
|
|
96
|
+
color: #721c24;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
99
|
+
</head>
|
|
100
|
+
<body>
|
|
101
|
+
<div class="container">
|
|
102
|
+
<h1>🚀 FViewer HTML 渲染测试页面</h1>
|
|
103
|
+
|
|
104
|
+
<div class="alert alert-success">
|
|
105
|
+
<strong>✅ 成功!</strong> 这是一个用于测试 FViewer HTML 渲染功能的复杂页面。
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<h2>📋 功能特性</h2>
|
|
109
|
+
<p>这个 HTML 页面包含了多种元素来测试 <span class="highlight">FViewer</span> 的 HTML 渲染能力:</p>
|
|
110
|
+
|
|
111
|
+
<ul>
|
|
112
|
+
<li><strong>标题和段落</strong> - 测试基本文本渲染</li>
|
|
113
|
+
<li><strong>表格</strong> - 测试表格布局和样式</li>
|
|
114
|
+
<li><strong>代码块</strong> - 测试代码高亮显示</li>
|
|
115
|
+
<li><strong>按钮和链接</strong> - 测试交互元素</li>
|
|
116
|
+
<li><strong>警告框</strong> - 测试不同类型的提示信息</li>
|
|
117
|
+
<li><strong>CSS 样式</strong> - 测试样式渲染效果</li>
|
|
118
|
+
</ul>
|
|
119
|
+
|
|
120
|
+
<h2>📊 数据表格示例</h2>
|
|
121
|
+
<table>
|
|
122
|
+
<thead>
|
|
123
|
+
<tr>
|
|
124
|
+
<th>功能模块</th>
|
|
125
|
+
<th>状态</th>
|
|
126
|
+
<th>描述</th>
|
|
127
|
+
<th>优先级</th>
|
|
128
|
+
</tr>
|
|
129
|
+
</thead>
|
|
130
|
+
<tbody>
|
|
131
|
+
<tr>
|
|
132
|
+
<td>PDF 渲染</td>
|
|
133
|
+
<td>✅ 已完成</td>
|
|
134
|
+
<td>支持 PDF 文件查看和标注</td>
|
|
135
|
+
<td>高</td>
|
|
136
|
+
</tr>
|
|
137
|
+
<tr>
|
|
138
|
+
<td>Markdown 渲染</td>
|
|
139
|
+
<td>✅ 已完成</td>
|
|
140
|
+
<td>支持 Markdown 语法和代码高亮</td>
|
|
141
|
+
<td>高</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td>HTML 渲染</td>
|
|
145
|
+
<td>🔄 测试中</td>
|
|
146
|
+
<td>支持 HTML 标签和样式渲染</td>
|
|
147
|
+
<td>中</td>
|
|
148
|
+
</tr>
|
|
149
|
+
<tr>
|
|
150
|
+
<td>文本渲染</td>
|
|
151
|
+
<td>✅ 已完成</td>
|
|
152
|
+
<td>支持纯文本文件显示</td>
|
|
153
|
+
<td>中</td>
|
|
154
|
+
</tr>
|
|
155
|
+
<tr>
|
|
156
|
+
<td>图片渲染</td>
|
|
157
|
+
<td>⏳ 计划中</td>
|
|
158
|
+
<td>支持常见图片格式显示</td>
|
|
159
|
+
<td>低</td>
|
|
160
|
+
</tr>
|
|
161
|
+
</tbody>
|
|
162
|
+
</table>
|
|
163
|
+
|
|
164
|
+
<h2>💻 代码示例</h2>
|
|
165
|
+
<p>以下是一些代码示例来测试代码块的渲染:</p>
|
|
166
|
+
|
|
167
|
+
<div class="code-block">
|
|
168
|
+
<!DOCTYPE html>
|
|
169
|
+
<html>
|
|
170
|
+
<head>
|
|
171
|
+
<title>示例页面</title>
|
|
172
|
+
</head>
|
|
173
|
+
<body>
|
|
174
|
+
<h1>Hello World!</h1>
|
|
175
|
+
<p>这是一个简单的 HTML 示例。</p>
|
|
176
|
+
</body>
|
|
177
|
+
</html>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div class="code-block">
|
|
181
|
+
// JavaScript 示例
|
|
182
|
+
function greet(name) {
|
|
183
|
+
return `Hello, ${name}!`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const message = greet('FViewer');
|
|
187
|
+
console.log(message); // 输出: Hello, FViewer!
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<h2>🔗 交互元素</h2>
|
|
191
|
+
<p>测试按钮和链接的渲染效果:</p>
|
|
192
|
+
|
|
193
|
+
<a href="#" class="button">主要按钮</a>
|
|
194
|
+
<a href="#" class="button" style="background-color: #27ae60;">成功按钮</a>
|
|
195
|
+
<a href="#" class="button" style="background-color: #e74c3c;">危险按钮</a>
|
|
196
|
+
<a href="#" class="button" style="background-color: #f39c12;">警告按钮</a>
|
|
197
|
+
|
|
198
|
+
<h2>⚠️ 警告信息</h2>
|
|
199
|
+
<div class="alert alert-warning">
|
|
200
|
+
<strong>⚠️ 注意!</strong> 这是一个警告信息,用于测试不同类型的提示框渲染。
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div class="alert alert-error">
|
|
204
|
+
<strong>❌ 错误!</strong> 这是一个错误信息,用于测试错误提示框的渲染效果。
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<h2>🎨 样式测试</h2>
|
|
208
|
+
<p>测试各种文本样式:</p>
|
|
209
|
+
<ul>
|
|
210
|
+
<li><em>斜体文本</em> - 测试斜体效果</li>
|
|
211
|
+
<li><strong>粗体文本</strong> - 测试粗体效果</li>
|
|
212
|
+
<li><u>下划线文本</u> - 测试下划线效果</li>
|
|
213
|
+
<li><s>删除线文本</s> - 测试删除线效果</li>
|
|
214
|
+
<li><span style="color: #e74c3c;">红色文本</span> - 测试颜色样式</li>
|
|
215
|
+
<li><span style="font-size: 18px;">大号文本</span> - 测试字体大小</li>
|
|
216
|
+
</ul>
|
|
217
|
+
|
|
218
|
+
<h2>📝 总结</h2>
|
|
219
|
+
<p>这个 HTML 测试页面包含了丰富的元素和样式,可以有效测试 FViewer 的 HTML 渲染能力。如果这个页面能够正确显示,说明 FViewer 的 HTML 渲染功能工作正常。</p>
|
|
220
|
+
|
|
221
|
+
<div class="alert alert-success">
|
|
222
|
+
<strong>🎉 恭喜!</strong> 如果你能看到这个页面完整显示,说明 FViewer 的 HTML 渲染功能已经成功实现!
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</body>
|
|
226
|
+
</html>
|