@ibiz-template-plugin/ibiz-file-previewer 0.0.14 → 0.0.16

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.
@@ -20,6 +20,10 @@ export interface IFilePreviewShellState {
20
20
  * 文件分类
21
21
  */
22
22
  fileCat: string;
23
+ /**
24
+ * 文件内容
25
+ */
26
+ fileContent: string;
23
27
  /**
24
28
  * 主题
25
29
  */
@@ -15,6 +15,10 @@ interface IFilePreviewerDataWithURL {
15
15
  * 预览文件分类
16
16
  */
17
17
  cat?: string;
18
+ /**
19
+ * 预览内容
20
+ */
21
+ content?: string;
18
22
  /**
19
23
  * 预览文件URL
20
24
  */
@@ -40,6 +44,35 @@ interface IFilePreviewerDataWithID {
40
44
  * 预览文件URL
41
45
  */
42
46
  url?: string;
47
+ /**
48
+ * 预览内容
49
+ */
50
+ content?: string;
51
+ }
52
+ /**
53
+ * 文件预览组件配置项 - 通过 直接内容 预览(仅识别content和name参数)
54
+ */
55
+ interface IFilePreviewerDataWithContent {
56
+ /**
57
+ * 预览内容
58
+ */
59
+ content: string;
60
+ /**
61
+ * 预览文件ID
62
+ */
63
+ id?: string;
64
+ /**
65
+ * 预览文件名称
66
+ */
67
+ name?: string;
68
+ /**
69
+ * 预览文件分类
70
+ */
71
+ cat?: string;
72
+ /**
73
+ * 预览文件URL
74
+ */
75
+ url?: string;
43
76
  }
44
77
  /**
45
78
  * 定义通用属性接口
@@ -94,5 +127,5 @@ export interface IFilePreviewerOption {
94
127
  /**
95
128
  * 文件预览组件配置项
96
129
  */
97
- export type IFilePreviewerData = IFilePreviewerDataWithURL | IFilePreviewerDataWithID;
130
+ export type IFilePreviewerData = IFilePreviewerDataWithURL | IFilePreviewerDataWithID | IFilePreviewerDataWithContent;
98
131
  export {};
@@ -12,3 +12,15 @@ export declare const fileNameToFileType: (fileName: string) => FileType;
12
12
  * @returns
13
13
  */
14
14
  export declare const throttle: <T extends (...args: any[]) => any>(func: T, wait: number) => ((...args: Parameters<T>) => void);
15
+ /**
16
+ * 拷贝文本至剪贴板降级方案
17
+ * @param text
18
+ * @returns
19
+ */
20
+ export declare const fallbackCopyTextToClipboard: (text: string) => boolean;
21
+ /**
22
+ * 拷贝文本至剪贴板
23
+ * @param text
24
+ * @returns
25
+ */
26
+ export declare const copyTextToClipboard: (text: string) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template-plugin/ibiz-file-previewer",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "iBiz文件预览器",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",