@flyfish-group/file-viewer3 1.0.19 → 1.0.21
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 +57 -24
- package/dist/components/3MFLoader.js +1 -1
- package/dist/components/AMFLoader.js +1 -1
- package/dist/components/AudioViewer.js +1 -1
- package/dist/components/CadViewer.js +1 -1
- package/dist/components/CodeViewer.js +1 -1
- package/dist/components/ColladaLoader.js +1 -1
- package/dist/components/DrawingViewer.js +1 -1
- package/dist/components/EdaViewer.js +1 -1
- package/dist/components/EmailViewer.js +1 -1
- package/dist/components/EpubViewer.js +1 -1
- package/dist/components/FBXLoader.js +1 -1
- package/dist/components/GLTFLoader.js +1 -1
- package/dist/components/ImageViewer.js +1 -1
- package/dist/components/KMZLoader.js +1 -1
- package/dist/components/MarkdownViewer.js +1 -1
- package/dist/components/ModelViewer.js +1 -1
- package/dist/components/OBJLoader.js +1 -1
- package/dist/components/OfdViewer.js +1 -1
- package/dist/components/PCDLoader.js +1 -1
- package/dist/components/PLYLoader.js +1 -1
- package/dist/components/PdfView.js +206 -207
- package/dist/components/PptxRender.js +1 -1
- package/dist/components/STLLoader.js +1 -1
- package/dist/components/TDSLoader.js +1 -1
- package/dist/components/TypstViewer.js +1671 -0
- package/dist/components/USDLoader.js +1 -1
- package/dist/components/UmdViewer.js +1 -1
- package/dist/components/VRMLLoader.js +1 -1
- package/dist/components/VTKLoader.js +1 -1
- package/dist/components/XYZLoader.js +1 -1
- package/dist/components/XlsxTable.js +1 -1
- package/dist/components/__vite-browser-external.js +1 -1
- package/dist/components/_plugin-vue_export-helper.js +1 -1
- package/dist/components/ar-SA-G6X2FPQ2.js +1 -1
- package/dist/components/arc.js +1 -1
- package/dist/components/architecture-7EHR7CIX.js +1 -1
- package/dist/components/architectureDiagram-3BPJPVTR.js +1 -1
- package/dist/components/archive.js +1 -1
- package/dist/components/asyncToGenerator.js +1 -1
- package/dist/components/audio.js +1 -1
- package/dist/components/az-AZ-76LH7QW2.js +1 -1
- package/dist/components/bash.js +1 -1
- package/dist/components/bg-BG-XCXSNQG7.js +1 -1
- package/dist/components/blockDiagram-GPEHLZMM.js +1 -1
- package/dist/components/bn-BD-2XOGV67Q.js +1 -1
- package/dist/components/c4Diagram-AAUBKEIU.js +1 -1
- package/dist/components/ca-ES-6MX7JW3Y.js +1 -1
- package/dist/components/cad.js +1 -1
- package/dist/components/cfb.js +1 -1
- package/dist/components/channel.js +1 -1
- package/dist/components/chunk-2J33WTMH.js +1 -1
- package/dist/components/chunk-3OPIFGDE.js +1 -1
- package/dist/components/chunk-4BX2VUAB.js +1 -1
- package/dist/components/chunk-55IACEB6.js +1 -1
- package/dist/components/chunk-5ZQYHXKU.js +1 -1
- package/dist/components/chunk-6U3AYISY.js +1 -1
- package/dist/components/chunk-727SXJPM.js +1 -1
- package/dist/components/chunk-AGHRB4JF.js +1 -1
- package/dist/components/chunk-AQP2D5EJ.js +1 -1
- package/dist/components/chunk-BSJP7CBP.js +1 -1
- package/dist/components/chunk-CSCIHK7Q.js +1 -1
- package/dist/components/chunk-FMBD7UC4.js +1 -1
- package/dist/components/chunk-K2UTITRG.js +1 -1
- package/dist/components/chunk-KSCS5N6A.js +1 -1
- package/dist/components/chunk-L5ZTLDWV.js +1 -1
- package/dist/components/chunk-LZXEDZCA.js +1 -1
- package/dist/components/chunk-ND2GUHAM.js +1 -1
- package/dist/components/chunk-NZK2D7GU.js +1 -1
- package/dist/components/chunk-O5CBEL6O.js +1 -1
- package/dist/components/chunk-QZHKN3VN.js +1 -1
- package/dist/components/chunk-SRAX5OIU.js +1 -1
- package/dist/components/chunk-WU5MYG2G.js +1 -1
- package/dist/components/chunk-XPW4576I.js +1 -1
- package/dist/components/chunk-Z3N5DIM6.js +1 -1
- package/dist/components/chunk-ZUYEQ4TG.js +1 -1
- package/dist/components/chunk.js +1 -1
- package/dist/components/classDiagram-4FO5ZUOK.js +1 -1
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +1 -1
- package/dist/components/compiler.js +1 -0
- package/dist/components/core.js +1 -1
- package/dist/components/cose-bilkent-S5V4N54A.js +1 -1
- package/dist/components/cpp.js +1 -1
- package/dist/components/cs-CZ-2BRQDIVT.js +1 -1
- package/dist/components/csharp.js +1 -1
- package/dist/components/css.js +1 -1
- package/dist/components/cytoscape.esm.js +1 -1
- package/dist/components/da-DK-5WZEPLOC.js +1 -1
- package/dist/components/dagre-BM42HDAG.js +1 -1
- package/dist/components/dagre.js +1 -1
- package/dist/components/de-DE-XR44H4JA.js +1 -1
- package/dist/components/defaultLocale.js +1 -1
- package/dist/components/defineProperty.js +1 -1
- package/dist/components/diagram-2AECGRRQ.js +1 -1
- package/dist/components/diagram-5GNKFQAL.js +1 -1
- package/dist/components/diagram-KO2AKTUF.js +1 -1
- package/dist/components/diagram-LMA3HP47.js +1 -1
- package/dist/components/diagram-OG6HWLK6.js +1 -1
- package/dist/components/diff.js +1 -1
- package/dist/components/directory-open-01563666.js +1 -1
- package/dist/components/directory-open-4ed118d0.js +1 -1
- package/dist/components/dist.js +1 -1
- package/dist/components/dist2.js +1 -1
- package/dist/components/dist3.js +1 -1
- package/dist/components/docx-preview.js +1 -1
- package/dist/components/drawing.js +1 -1
- package/dist/components/ebook.js +1 -1
- package/dist/components/eda.js +1 -1
- package/dist/components/el-GR-BZB4AONW.js +1 -1
- package/dist/components/email.js +1 -1
- package/dist/components/en-B4ZKOASM.js +1 -1
- package/dist/components/erDiagram-TEJ5UH35.js +1 -1
- package/dist/components/es-ES-U4NZUMDT.js +1 -1
- package/dist/components/eu-ES-A7QVB2H4.js +1 -1
- package/dist/components/eventmodeling-FCH6USID.js +1 -1
- package/dist/components/fa-IR-HGAKTJCU.js +1 -1
- package/dist/components/fflate.module.js +1 -1
- package/dist/components/fi-FI-Z5N7JZ37.js +1 -1
- package/dist/components/file-open-002ab408.js +1 -1
- package/dist/components/file-open-7c801643.js +1 -1
- package/dist/components/file-save-3189631c.js +1 -1
- package/dist/components/file-save-745eba88.js +1 -1
- package/dist/components/flowDiagram-I6XJVG4X.js +1 -1
- package/dist/components/fr-FR-RHASNOE6.js +1 -1
- package/dist/components/ganttDiagram-6RSMTGT7.js +1 -1
- package/dist/components/gitGraph-WXDBUCRP.js +1 -1
- package/dist/components/gitGraphDiagram-PVQCEYII.js +1 -1
- package/dist/components/gl-ES-HMX3MZ6V.js +1 -1
- package/dist/components/global-compiler.js +1 -0
- package/dist/components/global-renderer.js +1 -0
- package/dist/components/go.js +1 -1
- package/dist/components/graphlib.js +1 -1
- package/dist/components/he-IL-6SHJWFNN.js +1 -1
- package/dist/components/hi-IN-IWLTKZ5I.js +1 -1
- package/dist/components/hu-HU-A5ZG7DT2.js +1 -1
- package/dist/components/id-ID-SAP4L64H.js +1 -1
- package/dist/components/image-GAAHSSAO.js +1 -1
- package/dist/components/image-blob-reduce.esm.js +1 -1
- package/dist/components/image.js +1 -1
- package/dist/components/info-J43DQDTF.js +1 -1
- package/dist/components/infoDiagram-5YYISTIA.js +1 -1
- package/dist/components/ini.js +1 -1
- package/dist/components/init.js +1 -1
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +1 -1
- package/dist/components/it-IT-JPQ66NNP.js +1 -1
- package/dist/components/ja-JP-DBVTYXUO.js +1 -1
- package/dist/components/java.js +1 -1
- package/dist/components/javascript.js +1 -1
- package/dist/components/journeyDiagram-JHISSGLW.js +1 -1
- package/dist/components/json.js +1 -1
- package/dist/components/jszip.min.js +1 -1
- package/dist/components/kaa-6HZHGXH3.js +1 -1
- package/dist/components/kab-KAB-ZGHBKWFO.js +1 -1
- package/dist/components/kanban-definition-UN3LZRKU.js +1 -1
- package/dist/components/katex.js +1 -1
- package/dist/components/kk-KZ-P5N5QNE5.js +1 -1
- package/dist/components/km-KH-HSX4SM5Z.js +1 -1
- package/dist/components/ko-KR-MTYHY66A.js +1 -1
- package/dist/components/ku-TR-6OUDTVRD.js +1 -1
- package/dist/components/lib.js +1 -1
- package/dist/components/libarchive.js +1 -1
- package/dist/components/linear.js +1 -1
- package/dist/components/lt-LT-XHIRWOB4.js +1 -1
- package/dist/components/lv-LV-5QDEKY6T.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/md.js +1 -1
- package/dist/components/mermaid-parser.core.js +1 -1
- package/dist/components/mindmap-definition-RKZ34NQL.js +1 -1
- package/dist/components/model.js +1 -1
- package/dist/components/mp4.js +1 -1
- package/dist/components/mr-IN-CRQNXWMA.js +1 -1
- package/dist/components/my-MM-5M5IBNSE.js +1 -1
- package/dist/components/nb-NO-T6EIAALU.js +1 -1
- package/dist/components/nestedRender.js +1 -1
- package/dist/components/nl-NL-IS3SIHDZ.js +1 -1
- package/dist/components/nn-NO-6E72VCQL.js +1 -1
- package/dist/components/objectSpread2.js +1 -1
- package/dist/components/objectWithoutProperties.js +1 -1
- package/dist/components/oc-FR-POXYY2M6.js +1 -1
- package/dist/components/ofd.js +1 -1
- package/dist/components/ofd2.js +1 -1
- package/dist/components/ordinal.js +1 -1
- package/dist/components/pa-IN-N4M65BXN.js +1 -1
- package/dist/components/packet-YPE3B663.js +1 -1
- package/dist/components/pdf.js +1 -1
- package/dist/components/percentages-BXMCSKIN.js +1 -1
- package/dist/components/php.js +1 -1
- package/dist/components/pica.js +1 -1
- package/dist/components/pie-LRSECV5Y.js +1 -1
- package/dist/components/pie.js +1 -1
- package/dist/components/pieDiagram-4H26LBE5.js +1 -1
- package/dist/components/pl-PL-T2D74RX3.js +1 -1
- package/dist/components/postal-mime.js +1 -1
- package/dist/components/pptx.js +1 -1
- package/dist/components/printLayout.js +1 -1
- package/dist/components/prod.js +1 -1
- package/dist/components/pt-BR-5N22H2LF.js +1 -1
- package/dist/components/pt-PT-UZXXM6DQ.js +1 -1
- package/dist/components/python.js +1 -1
- package/dist/components/quadrantDiagram-W4KKPZXB.js +1 -1
- package/dist/components/radar-GUYGQ44K.js +1 -1
- package/dist/components/renderer.js +1 -0
- package/dist/components/requirementDiagram-4Y6WPE33.js +1 -1
- package/dist/components/ro-RO-JPDTUUEW.js +1 -1
- package/dist/components/rough.esm.js +1 -1
- package/dist/components/roundRect.js +1 -1
- package/dist/components/ru-RU-B4JR7IUQ.js +1 -1
- package/dist/components/rust.js +1 -1
- package/dist/components/sankeyDiagram-5OEKKPKP.js +1 -1
- package/dist/components/sequenceDiagram-3UESZ5HK.js +1 -1
- package/dist/components/shared.js +1 -1
- package/dist/components/shared2.js +1 -1
- package/dist/components/si-LK-N5RQ5JYF.js +1 -1
- package/dist/components/sk-SK-C5VTKIMK.js +1 -1
- package/dist/components/sl-SI-NN7IZMDC.js +1 -1
- package/dist/components/sourceLoading.js +1 -0
- package/dist/components/sql.js +1 -1
- package/dist/components/src.js +1 -1
- package/dist/components/src2.js +1 -1
- package/dist/components/stateDiagram-AJRCARHV.js +1 -1
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +1 -1
- package/dist/components/subset-shared.chunk.js +1 -1
- package/dist/components/subset-worker.chunk.js +1 -1
- package/dist/components/sv-SE-XGPEYMSR.js +1 -1
- package/dist/components/ta-IN-2NMHFXQM.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/th-TH-HPSO5L25.js +1 -1
- package/dist/components/three.module.js +1 -1
- package/dist/components/time.js +1 -1
- package/dist/components/timeline-definition-PNZ67QCA.js +1 -1
- package/dist/components/tr-TR-DEFEU3FU.js +1 -1
- package/dist/components/treeView-BLDUP644.js +1 -1
- package/dist/components/treemap-LRROVOQU.js +1 -1
- package/dist/components/typescript.js +1 -1
- package/dist/components/typst.js +1 -0
- package/dist/components/uk-UA-QMV73CPH.js +1 -1
- package/dist/components/umd.js +1 -1
- package/dist/components/use.js +1 -1
- package/dist/components/util.js +1 -1
- package/dist/components/vennDiagram-CIIHVFJN.js +1 -1
- package/dist/components/vi-VN-M7AON7JQ.js +1 -1
- package/dist/components/wardley-L42UT6IY.js +1 -1
- package/dist/components/wardleyDiagram-YWT4CUSO.js +1 -1
- package/dist/components/wasm-pack-shim.js +1 -0
- package/dist/components/wasm-pack-shim2.js +1 -0
- package/dist/components/wasm.js +1 -0
- package/dist/components/word.js +1 -1
- package/dist/components/worker-ref.js +1 -1
- package/dist/components/xlsx.js +1 -1
- package/dist/components/xml.js +1 -1
- package/dist/components/xychartDiagram-2RQKCTM6.js +1 -1
- package/dist/components/yaml.js +1 -1
- package/dist/components/zh-CN-LNUGB5OW.js +1 -1
- package/dist/components/zh-HK-E62DVLB3.js +1 -1
- package/dist/components/zh-TW-RAJ6MFWO.js +1 -1
- package/dist/file-viewer3.css +1 -1
- package/dist/index.mjs +1 -1
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/package/common/sourceLoading.d.ts +10 -0
- package/dist/src/package/common/type.d.ts +33 -1
- package/dist/src/package/components/FileViewer/useViewerExport.d.ts +2 -1
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +2 -1
- package/dist/src/package/vendors/pptx/index.d.ts +1 -1
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/typst/index.d.ts +8 -0
- package/dist/src/package/vendors/xlsx/index.d.ts +1 -1
- package/package.json +8 -1
- package/dist/components/wrapAsyncGenerator.js +0 -1
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileViewerPdfOptions } from './type';
|
|
2
|
+
export declare const DEFAULT_PDF_RANGE_CHUNK_SIZE: number;
|
|
3
|
+
export declare const normalizePdfStreamingMode: (mode: FileViewerPdfOptions["streaming"]) => true | false | "same-origin";
|
|
4
|
+
export declare const isSameOriginUrl: (url: string, pageHref: string) => boolean;
|
|
5
|
+
export declare const shouldStreamPdfUrl: ({ extension, pageHref, streaming, url }: {
|
|
6
|
+
extension: string;
|
|
7
|
+
pageHref: string;
|
|
8
|
+
streaming?: FileViewerPdfOptions["streaming"];
|
|
9
|
+
url: string;
|
|
10
|
+
}) => boolean;
|
|
@@ -94,6 +94,32 @@ export interface FileViewerPdfOptions {
|
|
|
94
94
|
* 初始页面旋转角度。会按 90 度归一化到 0 / 90 / 180 / 270。
|
|
95
95
|
*/
|
|
96
96
|
rotation?: number;
|
|
97
|
+
/**
|
|
98
|
+
* 远端 PDF 是否优先交给 PDF.js 直接按 URL 渐进读取。
|
|
99
|
+
*
|
|
100
|
+
* 默认 `same-origin`,即同源 PDF 交给 PDF.js 通过 URL 渐进读取;
|
|
101
|
+
* 当文件服务支持 Range 时会进一步使用分片加载。跨域 URL 仍保持
|
|
102
|
+
* 旧的 Blob 下载后预览链路,最大化兼容鉴权下载和 CORS 场景。
|
|
103
|
+
* 设为 `true` 会对所有 URL 启用,设为 `false` 会完全禁用。
|
|
104
|
+
*/
|
|
105
|
+
streaming?: boolean | 'same-origin';
|
|
106
|
+
/**
|
|
107
|
+
* PDF.js Range 请求的分片大小,默认 64KB;仅在文件服务支持 Range 时生效。
|
|
108
|
+
*/
|
|
109
|
+
rangeChunkSize?: number;
|
|
110
|
+
/**
|
|
111
|
+
* PDF.js URL 读取 PDF 时是否携带浏览器凭据。
|
|
112
|
+
*/
|
|
113
|
+
withCredentials?: boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Typst 预览配置。
|
|
117
|
+
*/
|
|
118
|
+
export interface FileViewerTypstOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Typst compiler WASM 地址。需要浏览器端编译时才会加载。
|
|
121
|
+
*/
|
|
122
|
+
compilerWasmUrl?: string;
|
|
97
123
|
}
|
|
98
124
|
export type FileViewerSourceType = 'file' | 'url' | 'empty';
|
|
99
125
|
export type FileViewerLifecyclePhase = 'load-start' | 'load-complete' | 'unload-start' | 'unload-complete';
|
|
@@ -142,6 +168,7 @@ export interface FileViewerOptions {
|
|
|
142
168
|
toolbar?: boolean | FileViewerToolbarOptions;
|
|
143
169
|
archive?: FileViewerArchiveOptions;
|
|
144
170
|
pdf?: FileViewerPdfOptions;
|
|
171
|
+
typst?: FileViewerTypstOptions;
|
|
145
172
|
/**
|
|
146
173
|
* 文档加载/卸载生命周期钩子。直接使用 Vue 组件时可以传函数;
|
|
147
174
|
* iframe 集成时同名事件会通过 `postMessage` 向宿主发送。
|
|
@@ -203,13 +230,18 @@ export interface FileRenderExportAdapter {
|
|
|
203
230
|
export interface FileRenderContext {
|
|
204
231
|
filename?: string;
|
|
205
232
|
url?: string;
|
|
233
|
+
/**
|
|
234
|
+
* 渲染器可以直接读取的远端 URL。当前主要给 PDF.js 使用,
|
|
235
|
+
* 让同源 PDF 不必先整包下载为 Blob,就可以边拉取边建页。
|
|
236
|
+
*/
|
|
237
|
+
streamUrl?: string;
|
|
206
238
|
options?: FileViewerOptions;
|
|
207
239
|
registerExportAdapter?: (adapter: FileRenderExportAdapter | null) => void;
|
|
208
240
|
}
|
|
209
241
|
/**
|
|
210
242
|
* 文件处理逻辑,用于声明具体格式的异步渲染器。
|
|
211
243
|
*
|
|
212
|
-
* 渲染器只在命中文件扩展名时被按需加载,避免 PDF、OFD、压缩包、
|
|
244
|
+
* 渲染器只在命中文件扩展名时被按需加载,避免 PDF、OFD、Typst、压缩包、
|
|
213
245
|
* 邮件、CAD、3D、Office 等重型依赖进入无关格式的首屏路径。
|
|
214
246
|
*
|
|
215
247
|
* @param buffer 二进制缓存
|
|
@@ -4,6 +4,7 @@ interface UseViewerExportOptions {
|
|
|
4
4
|
activeExportAdapter: ShallowRef<FileRenderExportAdapter | null>;
|
|
5
5
|
currentBuffer: Ref<ArrayBuffer | null>;
|
|
6
6
|
currentFile: Ref<File | null>;
|
|
7
|
+
currentSourceUrl: Ref<string | null>;
|
|
7
8
|
displayFilename: ComputedRef<string>;
|
|
8
9
|
formatErrorMessage: (prefix: string, nextError: unknown) => string;
|
|
9
10
|
operationAvailability: ComputedRef<FileViewerOperationAvailability>;
|
|
@@ -12,7 +13,7 @@ interface UseViewerExportOptions {
|
|
|
12
13
|
showError: (message: string) => void;
|
|
13
14
|
watermarkInlineStyle: ComputedRef<string>;
|
|
14
15
|
}
|
|
15
|
-
export declare const useViewerExport: ({ activeExportAdapter, currentBuffer, currentFile, displayFilename, formatErrorMessage, operationAvailability, output, runBeforeOperation, showError, watermarkInlineStyle }: UseViewerExportOptions) => {
|
|
16
|
+
export declare const useViewerExport: ({ activeExportAdapter, currentBuffer, currentFile, currentSourceUrl, displayFilename, formatErrorMessage, operationAvailability, output, runBeforeOperation, showError, watermarkInlineStyle }: UseViewerExportOptions) => {
|
|
16
17
|
downloadOriginalFile: () => Promise<void>;
|
|
17
18
|
exportRenderedHtml: () => Promise<void>;
|
|
18
19
|
printRenderedHtml: () => Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FileRenderExportAdapter, FileViewerPdfOptions } from '../../common/type';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
data
|
|
3
|
+
data?: ArrayBuffer;
|
|
4
|
+
url?: string;
|
|
4
5
|
exportAdapter?: (adapter: FileRenderExportAdapter | null) => void;
|
|
5
6
|
options?: FileViewerPdfOptions;
|
|
6
7
|
};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @param buffer 二进制数据
|
|
4
4
|
* @param target 目标
|
|
5
5
|
*/
|
|
6
|
-
export default function renderPptx(buffer: ArrayBuffer, target: HTMLDivElement): Promise<import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import('vue').ComponentProvideOptions>, {}, {}, "", {}, any>>;
|
|
6
|
+
export default function renderPptx(buffer: ArrayBuffer, target: HTMLDivElement, type?: string): Promise<import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import('vue').ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import('vue').ComponentProvideOptions>, {}, {}, "", {}, any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FileRenderExportAdapter } from '../../common/type';
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
__FLYFISH_TYPST_COMPILER_WASM_URL__?: string;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
source: string;
|
|
9
|
+
filename?: string;
|
|
10
|
+
compilerWasmUrl?: string;
|
|
11
|
+
exportAdapter?: (adapter: FileRenderExportAdapter | null) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FileRenderContext } from '../../common/type';
|
|
2
|
+
/**
|
|
3
|
+
* Render Typst source documents through the browser WASM compiler/renderer stack.
|
|
4
|
+
*
|
|
5
|
+
* The heavy Typst runtime is kept behind this async vendor entry so normal
|
|
6
|
+
* Office/PDF/image previews do not pay for the WASM compiler on first load.
|
|
7
|
+
*/
|
|
8
|
+
export default function renderTypst(buffer: ArrayBuffer, target: HTMLDivElement, _type?: string, context?: FileRenderContext): Promise<import('vue').App<Element>>;
|
|
@@ -3,4 +3,4 @@ import { FileRenderContext } from '../../common/type';
|
|
|
3
3
|
/**
|
|
4
4
|
* 渲染excel
|
|
5
5
|
*/
|
|
6
|
-
export default function render(buffer: ArrayBuffer, target: HTMLDivElement,
|
|
6
|
+
export default function render(buffer: ArrayBuffer, target: HTMLDivElement, type?: string, context?: FileRenderContext): Promise<App>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flyfish-group/file-viewer3",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.0.9",
|
|
@@ -48,8 +48,12 @@
|
|
|
48
48
|
"build-lib-only": "vite build --mode lib && node scripts/fix-lib-css.mjs && node scripts/fix-lib-workers.mjs",
|
|
49
49
|
"build:viewer-assets": "pnpm build-only && node scripts/sync-viewer-assets.mjs",
|
|
50
50
|
"build:adapters": "pnpm build:viewer-assets && pnpm --filter @flyfish-group/file-viewer-web build && pnpm --filter @flyfish-group/file-viewer-react build",
|
|
51
|
+
"deploy:cloudflare": "pnpm build-only && node scripts/deploy-cloudflare-pages.mjs",
|
|
51
52
|
"dev:adapters": "pnpm --filter @flyfish-group/file-viewer-demo dev",
|
|
52
53
|
"build:adapter-demo": "pnpm --filter @flyfish-group/file-viewer-demo build",
|
|
54
|
+
"docker:build": "node scripts/docker-buildx.mjs --load",
|
|
55
|
+
"docker:repo:create": "node scripts/docker-hub-create-repo.mjs",
|
|
56
|
+
"docker:publish": "node scripts/docker-buildx.mjs --push",
|
|
53
57
|
"release:adapters:pack": "pnpm build:adapters && mkdir -p .release/adapters && pnpm -C packages/web pack --pack-destination ../../.release/adapters && pnpm -C packages/react pack --pack-destination ../../.release/adapters",
|
|
54
58
|
"release:adapters:publish": "pnpm build:adapters && pnpm -C packages/web publish --access public && pnpm -C packages/react publish --access public",
|
|
55
59
|
"obfuscate": "node scripts/obfuscate-dist.mjs",
|
|
@@ -79,6 +83,9 @@
|
|
|
79
83
|
"@cadview/core": "^0.5.0",
|
|
80
84
|
"@excalidraw/excalidraw": "^0.18.1",
|
|
81
85
|
"@kenjiuno/msgreader": "^1.28.0",
|
|
86
|
+
"@myriaddreamin/typst-ts-renderer": "0.7.0",
|
|
87
|
+
"@myriaddreamin/typst-ts-web-compiler": "0.7.0",
|
|
88
|
+
"@myriaddreamin/typst.ts": "0.7.0",
|
|
82
89
|
"axios": "^1.16.1",
|
|
83
90
|
"billboard.js": "^3.18.0",
|
|
84
91
|
"buffer": "^6.0.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var B=c;(function(d,f){var w=c,g=d();while(!![]){try{var h=parseInt(w(0x176))/0x1*(-parseInt(w(0x179))/0x2)+-parseInt(w(0x17a))/0x3+-parseInt(w(0x177))/0x4+-parseInt(w(0x171))/0x5+-parseInt(w(0x178))/0x6*(-parseInt(w(0x170))/0x7)+-parseInt(w(0x17b))/0x8+parseInt(w(0x175))/0x9;if(h===f)break;else g['push'](g['shift']());}catch(j){g['push'](g['shift']());}}}(b,0x8be16));function e(d){var f,g,h,j=0x2;for(typeof Symbol<'u'&&(g=Symbol['asyncIterator'],h=Symbol['iterator']);j--;){if(g&&(f=d[g])!=null)return f['call'](d);if(h&&(f=d[h])!=null)return new t(f['call'](d));g='@@asyncIterator',h='@@iterator';}throw TypeError('Object\x20is\x20not\x20async\x20iterable');}function t(d){function f(g){var x=c;if(Object(g)!==g)return Promise['reject'](TypeError(g+x(0x17d)));var h=g['done'];return Promise['resolve'](g['value'])['then'](function(j){return{'value':j,'done':h};});}return t=function(g){this['s']=g,this['n']=g['next'];},t['prototype']={'s':null,'n':null,'next':function(){return f(this['n']['apply'](this['s'],arguments));},'return':function(g){var h=this['s']['return'];return h===void 0x0?Promise['resolve']({'value':g,'done':!0x0}):f(h['apply'](this['s'],arguments));},'throw':function(g){var y=c,h=this['s'][y(0x172)];return h===void 0x0?Promise['reject'](g):f(h[y(0x174)](this['s'],arguments));}},new t(d);}function n(d,f){this['v']=d,this['k']=f;}function r(d){return new n(d,0x0);}function b(){var C=['1622300CSRAuq','12svHhIg','456838pRnXYP','988413SYilZM','621272IxTGvm','@@asyncIterator','\x20is\x20not\x20an\x20object.','prototype','119721MndUQI','5404810FPlntq','return','function','apply','32170554ryRbyI','5MmaJyX'];b=function(){return C;};return b();}function c(a,d){a=a-0x170;var e=b();var f=e[a];return f;}function i(d){return function(){return new a(d['apply'](this,arguments));};}function a(d){var f,g;function h(k,l){try{var m=d[k](l),p=m['value'],q=p instanceof n;Promise['resolve'](q?p['v']:p)['then'](function(u){var z=c;if(q){var v=k===z(0x172)?'return':'next';if(!p['k']||u['done'])return h(v,u);u=d[v](u)['value'];}j(m['done']?'return':'normal',u);},function(u){h('throw',u);});}catch(u){j('throw',u);}}function j(k,l){var A=c;switch(k){case A(0x172):f['resolve']({'value':l,'done':!0x0});break;case'throw':f['reject'](l);break;default:f['resolve']({'value':l,'done':!0x1});}(f=f['next'])?h(f['key'],f['arg']):g=null;}this['_invoke']=function(k,l){return new Promise(function(m,p){var q={'key':k,'arg':l,'resolve':m,'reject':p,'next':null};g?g=g['next']=q:(f=g=q,h(k,l));});},typeof d['return']!='function'&&(this['return']=void 0x0);}a['prototype'][typeof Symbol==B(0x173)&&Symbol['asyncIterator']||B(0x17c)]=function(){return this;},a[B(0x17e)]['next']=function(d){return this['_invoke']('next',d);},a[B(0x17e)]['throw']=function(d){return this['_invoke']('throw',d);},a['prototype'][B(0x172)]=function(d){return this['_invoke']('return',d);};export{e as i,r as n,n as r,i as t};
|