file-viewer3 1.0.8 → 1.0.26
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/LICENSE +160 -0
- package/README.en.md +390 -0
- package/README.md +306 -89
- package/dist/components/3MFLoader.js +527 -0
- package/dist/components/AMFLoader.js +188 -0
- package/dist/components/ArchiveViewer.js +526 -0
- package/dist/components/AudioViewer.js +66 -0
- package/dist/components/CadViewer.js +9040 -0
- package/dist/components/CodeViewer.js +151 -0
- package/dist/components/ColladaLoader.js +2282 -0
- package/dist/components/DrawingViewer.js +295 -0
- package/dist/components/EdaViewer.js +630 -0
- package/dist/components/EmailViewer.js +276 -0
- package/dist/components/EpubViewer.js +172 -0
- package/dist/components/FBXLoader.js +1574 -0
- package/dist/components/GLTFLoader.js +1383 -0
- package/dist/components/ImageViewer.js +1516 -1895
- package/dist/components/KMZLoader.js +45 -0
- package/dist/components/MarkdownViewer.js +1456 -1557
- package/dist/components/ModelViewer.js +797 -0
- package/dist/components/OBJLoader.js +287 -0
- package/dist/components/OfdViewer.js +133 -0
- package/dist/components/PCDLoader.js +141 -0
- package/dist/components/PLYLoader.js +305 -0
- package/dist/components/PdfView.js +27662 -21655
- package/dist/components/PptxRender.js +11170 -21118
- package/dist/components/STLLoader.js +83 -0
- package/dist/components/TDSLoader.js +228 -0
- package/dist/components/TypstViewer.js +1697 -0
- package/dist/components/USDLoader.js +2526 -0
- package/dist/components/UmdViewer.js +1873 -0
- package/dist/components/VRMLLoader.js +6422 -0
- package/dist/components/VTKLoader.js +337 -0
- package/dist/components/XYZLoader.js +30 -0
- package/dist/components/XlsxTable.js +7871 -69873
- package/dist/components/__vite-browser-external.js +7 -0
- package/dist/components/_plugin-vue_export-helper.js +8 -0
- package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
- package/dist/components/arc.js +79 -0
- package/dist/components/architecture-7EHR7CIX.js +3 -0
- package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
- package/dist/components/archive.js +24 -0
- package/dist/components/asyncToGenerator.js +29 -0
- package/dist/components/audio.js +19 -0
- package/dist/components/az-AZ-76LH7QW2.js +523 -0
- package/dist/components/bash.js +169 -0
- package/dist/components/bg-BG-XCXSNQG7.js +523 -0
- package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
- package/dist/components/bn-BD-2XOGV67Q.js +523 -0
- package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
- package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
- package/dist/components/cad.js +23 -0
- package/dist/components/cfb.js +1174 -0
- package/dist/components/channel.js +5 -0
- package/dist/components/chunk-2J33WTMH.js +26 -0
- package/dist/components/chunk-3OPIFGDE.js +4167 -0
- package/dist/components/chunk-4BX2VUAB.js +19 -0
- package/dist/components/chunk-55IACEB6.js +9 -0
- package/dist/components/chunk-5ZQYHXKU.js +669 -0
- package/dist/components/chunk-6U3AYISY.js +624 -0
- package/dist/components/chunk-727SXJPM.js +3356 -0
- package/dist/components/chunk-AGHRB4JF.js +324 -0
- package/dist/components/chunk-AQP2D5EJ.js +2055 -0
- package/dist/components/chunk-BSJP7CBP.js +83 -0
- package/dist/components/chunk-CSCIHK7Q.js +3500 -0
- package/dist/components/chunk-EIO257PC.js +1836 -0
- package/dist/components/chunk-FMBD7UC4.js +5 -0
- package/dist/components/chunk-K2UTITRG.js +17627 -0
- package/dist/components/chunk-KSCS5N6A.js +572 -0
- package/dist/components/chunk-L5ZTLDWV.js +40 -0
- package/dist/components/chunk-LZXEDZCA.js +60 -0
- package/dist/components/chunk-ND2GUHAM.js +61 -0
- package/dist/components/chunk-NNHCCRGN.js +20425 -0
- package/dist/components/chunk-NZK2D7GU.js +68 -0
- package/dist/components/chunk-O5CBEL6O.js +1894 -0
- package/dist/components/chunk-QZHKN3VN.js +12 -0
- package/dist/components/chunk-SRAX5OIU.js +22 -0
- package/dist/components/chunk-WU5MYG2G.js +14 -0
- package/dist/components/chunk-XPW4576I.js +1146 -0
- package/dist/components/chunk-Z3N5DIM6.js +59 -0
- package/dist/components/chunk-ZUYEQ4TG.js +22 -0
- package/dist/components/chunk.js +23 -0
- package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
- package/dist/components/compiler.js +2 -0
- package/dist/components/core.js +845 -0
- package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
- package/dist/components/cpp.js +225 -0
- package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
- package/dist/components/csharp.js +260 -0
- package/dist/components/css.js +140 -0
- package/dist/components/cytoscape.esm.js +18114 -0
- package/dist/components/da-DK-5WZEPLOC.js +523 -0
- package/dist/components/dagre-BM42HDAG.js +325 -0
- package/dist/components/dagre.js +1936 -0
- package/dist/components/de-DE-XR44H4JA.js +523 -0
- package/dist/components/defaultLocale.js +201 -0
- package/dist/components/defineProperty.js +50 -0
- package/dist/components/diagram-2AECGRRQ.js +229 -0
- package/dist/components/diagram-5GNKFQAL.js +108 -0
- package/dist/components/diagram-KO2AKTUF.js +443 -0
- package/dist/components/diagram-LMA3HP47.js +139 -0
- package/dist/components/diagram-OG6HWLK6.js +541 -0
- package/dist/components/diff.js +39 -0
- package/dist/components/directory-open-01563666.js +26 -0
- package/dist/components/directory-open-4ed118d0.js +83 -0
- package/dist/components/dist.js +50 -0
- package/dist/components/dist2.js +3291 -0
- package/dist/components/dist3.js +1593 -0
- package/dist/components/documentSearch.js +378 -0
- package/dist/components/docx-preview.js +3113 -0
- package/dist/components/drawing.js +19 -0
- package/dist/components/ebook.js +16 -0
- package/dist/components/eda.js +20 -0
- package/dist/components/el-GR-BZB4AONW.js +523 -0
- package/dist/components/email.js +21 -0
- package/dist/components/en-B4ZKOASM.js +3 -0
- package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
- package/dist/components/es-ES-U4NZUMDT.js +523 -0
- package/dist/components/eu-ES-A7QVB2H4.js +523 -0
- package/dist/components/eventmodeling-FCH6USID.js +3 -0
- package/dist/components/fa-IR-HGAKTJCU.js +523 -0
- package/dist/components/fflate.module.js +323 -0
- package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
- package/dist/components/file-open-002ab408.js +38 -0
- package/dist/components/file-open-7c801643.js +24 -0
- package/dist/components/file-save-3189631c.js +40 -0
- package/dist/components/file-save-745eba88.js +36 -0
- package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
- package/dist/components/fr-FR-RHASNOE6.js +523 -0
- package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
- package/dist/components/gitGraph-WXDBUCRP.js +3 -0
- package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
- package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
- package/dist/components/global-compiler.js +23 -0
- package/dist/components/global-renderer.js +23 -0
- package/dist/components/go.js +140 -0
- package/dist/components/graphlib.js +1267 -0
- package/dist/components/he-IL-6SHJWFNN.js +523 -0
- package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
- package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
- package/dist/components/id-ID-SAP4L64H.js +523 -0
- package/dist/components/image-GAAHSSAO.js +3 -0
- package/dist/components/image-blob-reduce.esm.js +1429 -0
- package/dist/components/image.js +17 -0
- package/dist/components/info-J43DQDTF.js +3 -0
- package/dist/components/infoDiagram-5YYISTIA.js +26 -0
- package/dist/components/ini.js +88 -0
- package/dist/components/init.js +15 -0
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
- package/dist/components/it-IT-JPQ66NNP.js +523 -0
- package/dist/components/ja-JP-DBVTYXUO.js +523 -0
- package/dist/components/java.js +169 -0
- package/dist/components/javascript.js +436 -0
- package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
- package/dist/components/json.js +36 -0
- package/dist/components/jszip.min.js +3033 -0
- package/dist/components/kaa-6HZHGXH3.js +523 -0
- package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
- package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
- package/dist/components/katex.js +21979 -0
- package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
- package/dist/components/km-KH-HSX4SM5Z.js +523 -0
- package/dist/components/ko-KR-MTYHY66A.js +523 -0
- package/dist/components/ku-TR-6OUDTVRD.js +523 -0
- package/dist/components/lib.js +4877 -0
- package/dist/components/libarchive.js +360 -0
- package/dist/components/linear.js +289 -0
- package/dist/components/lt-LT-XHIRWOB4.js +523 -0
- package/dist/components/lv-LV-5QDEKY6T.js +523 -0
- package/dist/components/markdown.js +181 -0
- package/dist/components/md.js +17 -0
- package/dist/components/mermaid-parser.core.js +328 -0
- package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
- package/dist/components/model.js +21 -0
- package/dist/components/mp4.js +12 -0
- package/dist/components/mr-IN-CRQNXWMA.js +523 -0
- package/dist/components/my-MM-5M5IBNSE.js +523 -0
- package/dist/components/nb-NO-T6EIAALU.js +523 -0
- package/dist/components/nestedRender.js +158 -0
- package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
- package/dist/components/nn-NO-6E72VCQL.js +523 -0
- package/dist/components/objectSpread2.js +29 -0
- package/dist/components/objectWithoutProperties.js +28 -0
- package/dist/components/oc-FR-POXYY2M6.js +523 -0
- package/dist/components/ofd.js +5261 -0
- package/dist/components/ofd2.js +16 -0
- package/dist/components/ordinal.js +65 -0
- package/dist/components/pa-IN-N4M65BXN.js +523 -0
- package/dist/components/packet-YPE3B663.js +3 -0
- package/dist/components/pdf.js +24 -0
- package/dist/components/percentages-BXMCSKIN.js +3 -0
- package/dist/components/php.js +294 -0
- package/dist/components/pica.js +1009 -0
- package/dist/components/pie-LRSECV5Y.js +3 -0
- package/dist/components/pie.js +47 -0
- package/dist/components/pieDiagram-4H26LBE5.js +130 -0
- package/dist/components/pl-PL-T2D74RX3.js +523 -0
- package/dist/components/postal-mime.js +3146 -0
- package/dist/components/pptx.js +15 -0
- package/dist/components/printLayout.js +42 -0
- package/dist/components/prod.js +21770 -0
- package/dist/components/pt-BR-5N22H2LF.js +523 -0
- package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
- package/dist/components/python.js +238 -0
- package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
- package/dist/components/radar-GUYGQ44K.js +3 -0
- package/dist/components/renderer.js +2 -0
- package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
- package/dist/components/ro-RO-JPDTUUEW.js +523 -0
- package/dist/components/rough.esm.js +1355 -0
- package/dist/components/roundRect.js +90 -0
- package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
- package/dist/components/rust.js +169 -0
- package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
- package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
- package/dist/components/shared.js +175 -0
- package/dist/components/shared2.js +4 -0
- package/dist/components/si-LK-N5RQ5JYF.js +523 -0
- package/dist/components/sk-SK-C5VTKIMK.js +523 -0
- package/dist/components/sl-SI-NN7IZMDC.js +523 -0
- package/dist/components/sourceLoading.js +134 -0
- package/dist/components/sql.js +118 -0
- package/dist/components/src.js +2664 -0
- package/dist/components/src2.js +10722 -0
- package/dist/components/stateDiagram-AJRCARHV.js +217 -0
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
- package/dist/components/subset-shared.chunk.js +3 -0
- package/dist/components/subset-worker.chunk.js +21 -0
- package/dist/components/sv-SE-XGPEYMSR.js +523 -0
- package/dist/components/ta-IN-2NMHFXQM.js +523 -0
- package/dist/components/text.js +20 -0
- package/dist/components/th-TH-HPSO5L25.js +523 -0
- package/dist/components/three.module.js +13134 -0
- package/dist/components/time.js +910 -0
- package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
- package/dist/components/tr-TR-DEFEU3FU.js +523 -0
- package/dist/components/treeView-BLDUP644.js +3 -0
- package/dist/components/treemap-LRROVOQU.js +3 -0
- package/dist/components/typescript.js +521 -0
- package/dist/components/typst.js +25 -0
- package/dist/components/uk-UA-QMV73CPH.js +523 -0
- package/dist/components/umd.js +16 -0
- package/dist/components/use.js +422 -0
- package/dist/components/util.js +49 -0
- package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
- package/dist/components/vi-VN-M7AON7JQ.js +523 -0
- package/dist/components/viewerZoom.js +92 -0
- package/dist/components/wardley-L42UT6IY.js +3 -0
- package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
- package/dist/components/wasm-pack-shim.js +1711 -0
- package/dist/components/wasm-pack-shim2.js +934 -0
- package/dist/components/wasm.js +97 -0
- package/dist/components/word.js +3055 -0
- package/dist/components/worker-ref.js +15 -20
- package/dist/components/xlsx.js +21 -0
- package/dist/components/xml.js +166 -0
- package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
- package/dist/components/yaml.js +144 -0
- package/dist/components/zh-CN-LNUGB5OW.js +523 -0
- package/dist/components/zh-HK-E62DVLB3.js +523 -0
- package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
- package/dist/file-viewer3.css +2 -0
- package/dist/index.mjs +3292 -5
- package/dist/src/App.vue.d.ts +3 -0
- package/dist/src/compare/CompareApp.vue.d.ts +3 -0
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
- package/dist/src/components/HelloWorld.vue.d.ts +3 -0
- package/dist/src/components/utils.d.ts +4 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +27 -0
- package/dist/src/package/common/printLayout.d.ts +16 -0
- package/dist/src/package/common/sourceLoading.d.ts +10 -0
- package/dist/src/package/common/type.d.ts +522 -8
- package/dist/src/package/common/worker-ref.d.ts +1 -1
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
- package/dist/src/package/components/FileViewer/index.d.ts +1 -1
- package/dist/src/package/components/FileViewer/util.d.ts +2 -1
- package/dist/src/package/index.d.ts +14 -4
- package/dist/src/package/use/documentLocation.d.ts +15 -0
- package/dist/src/package/use/documentSearch.d.ts +234 -0
- package/dist/src/package/use/index.d.ts +4 -0
- package/dist/src/package/use/loading.d.ts +33 -0
- package/dist/src/package/use/viewerZoom.d.ts +42 -0
- package/dist/src/package/use/worker.d.ts +2 -2
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/archive/cache.d.ts +10 -0
- package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
- package/dist/src/package/vendors/archive/index.d.ts +3 -0
- package/dist/src/package/vendors/archive/shared.d.ts +24 -0
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
- package/dist/src/package/vendors/audio/index.d.ts +7 -0
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/cad/index.d.ts +8 -0
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/drawing/index.d.ts +7 -0
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ebook/index.d.ts +7 -0
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/eda/index.d.ts +2 -0
- package/dist/src/package/vendors/eda/parser.d.ts +77 -0
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
- package/dist/src/package/vendors/email/index.d.ts +2 -0
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/image/index.d.ts +1 -1
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/md/index.d.ts +1 -1
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/model/index.d.ts +3 -0
- package/dist/src/package/vendors/model/shared.d.ts +1 -0
- package/dist/src/package/vendors/nestedRender.d.ts +10 -0
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ofd/index.d.ts +7 -0
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
- package/dist/src/package/vendors/pdf/index.d.ts +2 -1
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
- package/dist/src/package/vendors/pptx/index.d.ts +1 -1
- package/dist/src/package/vendors/renders.d.ts +1 -1
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
- package/dist/src/package/vendors/text/index.d.ts +6 -2
- 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/umd/UmdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/umd/index.d.ts +7 -0
- package/dist/src/package/vendors/umd/parser.d.ts +30 -0
- package/dist/src/package/vendors/word/doc.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
- package/dist/src/package/vendors/word/index.d.ts +3 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
- package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
- package/dist/style.css +1 -57
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +24 -0
- package/dist/wasm/cad/libredwg-web.js +15 -0
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
- package/package.json +118 -42
- package/.vscode/extensions.json +0 -3
- package/dist/components/_commonjs-dynamic-modules.js +0 -6
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/docx-preview.min.js +0 -5287
- package/dist/components/index.js +0 -1717
- package/dist/favicon.ico +0 -0
- package/dist/index.umd.js +0 -436
- package/dist/src/package/vendors/docx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
- package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
- package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
- package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
- package/dist/worker/pdf.worker.js +0 -66
- package/dist/worker/pptx.worker.js +0 -21
- package/dist/worker/sheet.worker.js +0 -38
- package/dist/worker/xlsx.worker.js +0 -65
- /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
- /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
34
|
+
made available under the License, as indicated by a copyright notice that is
|
|
35
|
+
included in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work by
|
|
47
|
+
the copyright owner or by an individual or Legal Entity authorized to submit on
|
|
48
|
+
behalf of the copyright owner. For the purposes of this definition, "submitted"
|
|
49
|
+
means any form of electronic, verbal, or written communication sent to the
|
|
50
|
+
Licensor or its representatives, including but not limited to communication on
|
|
51
|
+
electronic mailing lists, source code control systems, and issue tracking systems
|
|
52
|
+
that are managed by, or on behalf of, the Licensor for the purpose of discussing
|
|
53
|
+
and improving the Work, but excluding communication that is conspicuously marked
|
|
54
|
+
or otherwise designated in writing by the copyright owner as "Not a
|
|
55
|
+
Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work to
|
|
75
|
+
which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
90
|
+
You changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the Derivative
|
|
102
|
+
Works; within the Source form or documentation, if provided along with the
|
|
103
|
+
Derivative Works; or, within a display generated by the Derivative Works, if and
|
|
104
|
+
wherever such third-party notices normally appear. The contents of the NOTICE
|
|
105
|
+
file are for informational purposes only and do not modify the License. You may
|
|
106
|
+
add Your own attribution notices within Derivative Works that You distribute,
|
|
107
|
+
alongside or as an addendum to the NOTICE text from the Work, provided that such
|
|
108
|
+
additional attribution notices cannot be construed as modifying the License.
|
|
109
|
+
|
|
110
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
111
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
112
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
113
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
114
|
+
with the conditions stated in this License.
|
|
115
|
+
|
|
116
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
117
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
118
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
119
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
120
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
121
|
+
executed with Licensor regarding such Contributions.
|
|
122
|
+
|
|
123
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
124
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
125
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
126
|
+
reproducing the content of the NOTICE file.
|
|
127
|
+
|
|
128
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
129
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
130
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
131
|
+
KIND, either express or implied, including, without limitation, any warranties or
|
|
132
|
+
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
133
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
134
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
135
|
+
associated with Your exercise of permissions under this License.
|
|
136
|
+
|
|
137
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
138
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
139
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
140
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
141
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
142
|
+
arising as a result of this License or out of the use or inability to use the
|
|
143
|
+
Work (including but not limited to damages for loss of goodwill, work stoppage,
|
|
144
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
145
|
+
losses), even if such Contributor has been advised of the possibility of such
|
|
146
|
+
damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
149
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
150
|
+
acceptance of support, warranty, indemnity, or other liability obligations and/or
|
|
151
|
+
rights consistent with this License. However, in accepting such obligations, You
|
|
152
|
+
may act only on Your own behalf and on Your sole responsibility, not on behalf of
|
|
153
|
+
any other Contributor, and only if You agree to indemnify, defend, and hold each
|
|
154
|
+
Contributor harmless for any liability incurred by, or claims asserted against,
|
|
155
|
+
such Contributor by reason of your accepting any such warranty or additional
|
|
156
|
+
liability.
|
|
157
|
+
|
|
158
|
+
END OF TERMS AND CONDITIONS
|
|
159
|
+
|
|
160
|
+
Copyright 2026 Flyfish Viewer
|
package/README.en.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
# Flyfish Viewer
|
|
2
|
+
|
|
3
|
+
[Simplified Chinese](README.md) | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
Bring Word, Excel, PowerPoint, PDF, Typst, archives, email, audio, ebooks, drawings, CAD, 3D models, Markdown, images, and source code preview into the browser with a clean, deployable viewer.
|
|
6
|
+
|
|
7
|
+
`@flyfish-group/file-viewer3` is a pure frontend file preview component built with Vue 3, TypeScript, and Vite. Vue 2.7 projects should use the matching `@flyfish-group/file-viewer` package. The Vue 3 build is also the baseline runtime for the React, vanilla JavaScript, and iframe integration packages.
|
|
8
|
+
|
|
9
|
+
The viewer does not require a backend conversion service. It is designed for OA systems, knowledge bases, attachment centers, workflow platforms, customer support portals, document approval flows, intranet systems, and offline-capable deployments where file preview should feel like a maintained product module rather than a temporary feature.
|
|
10
|
+
|
|
11
|
+
- npm for Vue 3: [@flyfish-group/file-viewer3](https://www.npmjs.com/package/@flyfish-group/file-viewer3)
|
|
12
|
+
- npm for Vue 2.7: [@flyfish-group/file-viewer](https://www.npmjs.com/package/@flyfish-group/file-viewer)
|
|
13
|
+
- npm for React: [@flyfish-group/file-viewer-react](https://www.npmjs.com/package/@flyfish-group/file-viewer-react)
|
|
14
|
+
- npm for vanilla JavaScript: [@flyfish-group/file-viewer-web](https://www.npmjs.com/package/@flyfish-group/file-viewer-web)
|
|
15
|
+
- Official documentation: [doc.flyfish.dev](https://doc.flyfish.dev)
|
|
16
|
+
- Online demo: [viewer.flyfish.dev](https://viewer.flyfish.dev)
|
|
17
|
+
- Document comparison demo: [viewer.flyfish.dev/compare.html](https://viewer.flyfish.dev/compare.html)
|
|
18
|
+
- Release downloads: [github.com/flyfish-dev/file-viewer/releases](https://github.com/flyfish-dev/file-viewer/releases)
|
|
19
|
+
- GitHub artifact repository: [github.com/flyfish-dev/file-viewer](https://github.com/flyfish-dev/file-viewer)
|
|
20
|
+
- Gitee artifact mirror: [gitee.com/flyfish-dev/file-viewer](https://gitee.com/flyfish-dev/file-viewer)
|
|
21
|
+
- Source access and commercial customization: [https://dev.flyfish.group/shop](https://dev.flyfish.group/shop)
|
|
22
|
+
|
|
23
|
+
## Current Packages
|
|
24
|
+
|
|
25
|
+
| Stack | Package | Version | Recommended branch | Notes |
|
|
26
|
+
| --- | --- | --- | --- | --- |
|
|
27
|
+
| Vue 3 | `@flyfish-group/file-viewer3` | `1.0.25` | `v3` | Recommended version and the runtime baseline for React / vanilla JS iframe integrations |
|
|
28
|
+
| Vue 2.7 | `@flyfish-group/file-viewer` | `1.0.25` | `main` | Vue 2 compatible package with the same format coverage and API semantics |
|
|
29
|
+
| React 17 / 18 / 19 | `@flyfish-group/file-viewer-react` | `1.0.25` | adapter package | iframe component that loads `/file-viewer/index.html` by default |
|
|
30
|
+
| Vanilla JavaScript | `@flyfish-group/file-viewer-web` | `1.0.25` | adapter package | iframe helpers and static viewer asset copier |
|
|
31
|
+
|
|
32
|
+
For intranet or offline environments, this artifact repository also ships npm tarballs under `artifacts/`:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install ./artifacts/flyfish-group-file-viewer3-1.0.25.tgz
|
|
36
|
+
npm install ./artifacts/flyfish-group-file-viewer-1.0.25.tgz
|
|
37
|
+
npm install ./artifacts/flyfish-group-file-viewer-web-1.0.25.tgz
|
|
38
|
+
npm install ./artifacts/flyfish-group-file-viewer-react-1.0.25.tgz
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
When installing the React tarball offline, install the same-version web tarball first because the React package depends on `@flyfish-group/file-viewer-web`.
|
|
42
|
+
|
|
43
|
+
If you use pnpm 10 and see `Ignored build scripts: @flyfish-group/file-viewer-web`, run:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm approve-builds
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then allow `@flyfish-group/file-viewer-web`, or manually copy the bundled viewer assets:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm exec file-viewer-copy-assets ./public/file-viewer
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
GitHub Releases provide all distribution downloads:
|
|
56
|
+
|
|
57
|
+
| File | Purpose |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `file-viewer-v3-*-demo.tar.gz` | Main demo / iframe private deployment static site; extract it and use `/index.html?url=...` |
|
|
60
|
+
| `file-viewer-v3-*-adapter-demo.tar.gz` | React / vanilla JavaScript adapter demo site |
|
|
61
|
+
| `file-viewer-v3-*-lib-dist.tar.gz` | Vue 3 library dist for offline inspection or self-hosted packaging |
|
|
62
|
+
| `file-viewer-v3-*-docs.tar.gz` | Documentation site static output |
|
|
63
|
+
| `flyfish-group-file-viewer3-*.tgz` | Vue 3 local npm package |
|
|
64
|
+
| `flyfish-group-file-viewer-*.tgz` | Vue 2.7 local npm package |
|
|
65
|
+
| `flyfish-group-file-viewer-web-*.tgz` | Vanilla JavaScript iframe helper with viewer asset copy tooling |
|
|
66
|
+
| `flyfish-group-file-viewer-react-*.tgz` | React iframe component; install the same-version web package together with it |
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
## Why Use It
|
|
71
|
+
|
|
72
|
+
- **Pure frontend and serverless.** File parsing and rendering happen in the browser. You do not need Office Server, a LibreOffice daemon, or a document conversion backend.
|
|
73
|
+
- **Broad format coverage.** The current release maps 152 extensions across 20 preview pipelines, including Office, PDF, OFD, Typst, archives, email, EDA files, CAD, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, images, audio, video, and source code.
|
|
74
|
+
- **Lazy loaded renderers.** Heavy PDF, Office, OFD, Typst, archive, email, CAD, 3D, ebook, Markdown, and code highlighting dependencies are loaded only when the file type needs them.
|
|
75
|
+
- **Production-ready operations.** The viewer includes original file download, full rendered printing, rendered HTML export, watermark options, theme options, lifecycle hooks, iframe events, and before-operation guards for permission checks.
|
|
76
|
+
- **Better document reading.** Word and PDF keep a grey workspace, white paper surface, centered reading, width fitting, navigation, zoom, rotation, and complete print / HTML export paths.
|
|
77
|
+
- **Renderer-native zoom controls.** The common toolbar can zoom in, zoom out, and reset through per-format providers for PDF, Word, PPTX, virtual Excel tables, images, CAD, OFD, Typst, Markdown, code, and drawing files, avoiding fragile host-level CSS transforms.
|
|
78
|
+
- **Controlled theming.** `options.theme` supports `light`, `dark`, and `system`. Light business UIs can lock the viewer to `light` even when the operating system is in dark mode.
|
|
79
|
+
- **PDF toolbar ergonomics.** `toolbar.position` supports `auto`, `top`, and `bottom-right`. In `auto` mode, PDF uses a bottom-right floating operation bar to avoid duplicating the PDF navigation toolbar.
|
|
80
|
+
- **Demo and comparison views.** The repository includes the main demo and a standalone `/compare.html` page for side-by-side document comparison.
|
|
81
|
+
- **Component and standalone modes.** Use it as a Vue component, or deploy the static viewer and embed it through iframe in any system.
|
|
82
|
+
- **Artifact-first delivery.** This public repository contains minified build artifacts, static demos, documentation output, sample files, Docker deployment assets, and npm tarballs. It does not contain the private source tree.
|
|
83
|
+
|
|
84
|
+
## Supported Formats
|
|
85
|
+
|
|
86
|
+
The viewer is organized around preview pipelines rather than one-off file extensions.
|
|
87
|
+
|
|
88
|
+
| Category | Extensions | Rendering pipeline | Typical use |
|
|
89
|
+
| --- | --- | --- | --- |
|
|
90
|
+
| Word | `docx`, `docm`, `dotx`, `dotm` | `docx-preview`, read-only page preview, print and HTML export | Modern Word documents and templates |
|
|
91
|
+
| Legacy Word | `doc`, `dot` | `msdoc-viewer` with Word-like paper surface and CFB tolerance fixes | Old Word 97-2003 files |
|
|
92
|
+
| Excel | `xlsx`, `xltx` | `styled-exceljs` plus virtual table rendering, merged cells, styles, auto text color, workbook images | Business spreadsheets and templates |
|
|
93
|
+
| Excel-compatible | `xlsm`, `xlsb`, `xls`, `xlt`, `xltm`, `csv`, `ods`, `fods`, `numbers` | Progressive spreadsheet parsing and virtual rendering | Legacy spreadsheets and lightweight data preview |
|
|
94
|
+
| PowerPoint | `pptx`, `pptm`, `potx`, `potm`, `ppsx`, `ppsm` | Slide preview with images, shapes, theme backgrounds, clipping, and EMF fallback | Presentations, training decks, proposals |
|
|
95
|
+
| PDF | `pdf` | `pdfjs-dist`, streaming same-origin loading, Range support, zoom, rotation, page thumbnails, outline tree, width fitting, print, HTML export | Contracts, invoices, official layout documents |
|
|
96
|
+
| OFD | `ofd` | Browser-side OFD preview based on `DLTech21/ofd.js` source | Chinese e-invoices, government documents, archives |
|
|
97
|
+
| Typst | `typ`, `typst` | Direct Typst source rendering with browser WASM compiler and SVG pages | Technical reports, papers, engineering documents |
|
|
98
|
+
| Archives | `zip`, `zipx`, `7z`, `rar`, `tar`, `gz`, `tgz`, `bz2`, `xz`, `zst`, `cab`, `iso`, `jar`, `apk`, `cbz`, `cbr`, and more | `libarchive.js` Worker, directory listing, lazy extraction, IndexedDB cache | Attachment packages and internal document bundles |
|
|
99
|
+
| Email | `eml`, `msg` | `postal-mime` for EML, `@kenjiuno/msgreader` for MSG, headers, HTML/text body, attachment preview | Email archives and support tickets |
|
|
100
|
+
| EDA | `olb`, `dra` | CFB-based OrCAD / Allegro structure inspection, trees, symbols, footprints, padstack candidates, properties, strings, diagnostics | Component libraries and EDA attachments |
|
|
101
|
+
| CAD | `dwg`, `dxf`, `dwf`, `dwfx`, `xps` | `@flyfish-dev/cad-viewer` preview. DWG uses Worker + LibreDWG WASM, DXF uses a JS parser, and DWF/DWFx/XPS use the native `dwf-viewer` path for W2D/W3D/XPS graphics | Engineering drawings and AutoCAD archives |
|
|
102
|
+
| 3D models | `glb`, `gltf`, `obj`, `stl`, `ply`, `fbx`, `dae`, `3ds`, `3mf`, `amf`, `usd`, `usda`, `usdc`, `usdz`, `kmz`, `pcd`, `wrl`, `vrml`, `xyz`, `vtk`, `vtp`, `step`, `stp`, `iges`, `igs`, `ifc`, `3dm` | Three.js interactive preview, with conversion guidance for heavy CAD/BIM kernels | 3D assets, point clouds, design models |
|
|
103
|
+
| Excalidraw | `excalidraw` | Official `@excalidraw/excalidraw` restore and `exportToSvg` read-only rendering | Whiteboard sketches and product diagrams |
|
|
104
|
+
| draw.io | `drawio`, `dio` | Official diagrams.net `GraphViewer` | Flowcharts and architecture diagrams |
|
|
105
|
+
| EPUB | `epub` | `epubjs` table of contents and scrolling reader | Ebooks and long training materials |
|
|
106
|
+
| UMD ebook | `umd` | UMD metadata, chapters, offsets, zlib text blocks | Legacy mobile ebooks |
|
|
107
|
+
| Markdown | `md`, `markdown` | Markdown reading surface with theme-aware styles | README files and knowledge base articles |
|
|
108
|
+
| Images | `gif`, `jpg`, `jpeg`, `bmp`, `tiff`, `tif`, `png`, `svg`, `webp` | Native image preview | Image attachments and design assets |
|
|
109
|
+
| Source and text | `txt`, `json`, `js`, `mjs`, `cjs`, `css`, `java`, `py`, `html`, `htm`, `jsx`, `ts`, `tsx`, `xml`, `log`, `vue`, `yaml`, `yml`, `ini`, `sh`, `bash`, `sql`, `go`, `rs`, `php`, `c`, `cpp`, `cc`, `h`, `hpp`, `cs`, `diff` | Lightweight `highlight.js` language-specific highlighting, HTML shown as source | Logs, configs, code snippets, API responses |
|
|
110
|
+
| Audio | `mp3`, `mpeg`, `wav`, `ogg`, `oga`, `opus`, `m4a`, `aac`, `flac`, `weba` | Native browser audio player | Recordings and audio attachments |
|
|
111
|
+
| Video | `mp4` | Native browser video player | Screen recordings and demo videos |
|
|
112
|
+
|
|
113
|
+
## Vue 3 Integration
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install @flyfish-group/file-viewer3
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { createApp } from 'vue'
|
|
121
|
+
import App from './App.vue'
|
|
122
|
+
import FileViewer from '@flyfish-group/file-viewer3'
|
|
123
|
+
|
|
124
|
+
createApp(App).use(FileViewer).mount('#app')
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```vue
|
|
128
|
+
<script setup lang="ts">
|
|
129
|
+
import { ref } from 'vue'
|
|
130
|
+
|
|
131
|
+
const url = ref('/files/demo.pdf')
|
|
132
|
+
|
|
133
|
+
const options = {
|
|
134
|
+
theme: 'light',
|
|
135
|
+
toolbar: { position: 'bottom-right', download: true, print: true, exportHtml: true },
|
|
136
|
+
watermark: { text: 'Internal Preview', opacity: 0.14 },
|
|
137
|
+
pdf: { streaming: 'same-origin', rangeChunkSize: 64 * 1024 }
|
|
138
|
+
}
|
|
139
|
+
</script>
|
|
140
|
+
|
|
141
|
+
<template>
|
|
142
|
+
<div style="height: 100vh">
|
|
143
|
+
<file-viewer :url="url" :options="options" />
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For local files or authenticated downloads, pass a `File` object:
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
const response = await fetch('/api/files/contract', { credentials: 'include' })
|
|
152
|
+
const blob = await response.blob()
|
|
153
|
+
|
|
154
|
+
file.value = new File([blob], 'contract.pdf', { type: blob.type })
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The filename matters. The viewer uses the extension to choose the correct rendering pipeline.
|
|
158
|
+
|
|
159
|
+
## Vue 2.7 Integration
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm install @flyfish-group/file-viewer
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
import Vue from 'vue'
|
|
167
|
+
import FileViewer from '@flyfish-group/file-viewer'
|
|
168
|
+
|
|
169
|
+
Vue.use(FileViewer)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```vue
|
|
173
|
+
<template>
|
|
174
|
+
<div style="height: 100vh">
|
|
175
|
+
<file-viewer :url="url" :options="options" />
|
|
176
|
+
</div>
|
|
177
|
+
</template>
|
|
178
|
+
|
|
179
|
+
<script>
|
|
180
|
+
export default {
|
|
181
|
+
data() {
|
|
182
|
+
return {
|
|
183
|
+
url: '/files/demo.pdf',
|
|
184
|
+
options: {
|
|
185
|
+
theme: 'light',
|
|
186
|
+
toolbar: { position: 'bottom-right' }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</script>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The Vue 2 and Vue 3 package lines share the same user-facing capabilities and option semantics.
|
|
195
|
+
|
|
196
|
+
## React Integration
|
|
197
|
+
|
|
198
|
+
The React package is an iframe adapter. It reuses the Vue 3 baseline viewer that is bundled by `@flyfish-group/file-viewer-web`.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npm install @flyfish-group/file-viewer-react
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import FileViewer from '@flyfish-group/file-viewer-react'
|
|
206
|
+
|
|
207
|
+
export function Preview() {
|
|
208
|
+
return (
|
|
209
|
+
<div style={{ height: '100vh' }}>
|
|
210
|
+
<FileViewer
|
|
211
|
+
url="/files/demo.pdf"
|
|
212
|
+
options={{
|
|
213
|
+
theme: 'light',
|
|
214
|
+
toolbar: { position: 'bottom-right' },
|
|
215
|
+
watermark: { text: 'Internal Preview', opacity: 0.14 }
|
|
216
|
+
}}
|
|
217
|
+
onViewerEvent={(event) => {
|
|
218
|
+
console.log(event.type, event.event, event.payload)
|
|
219
|
+
}}
|
|
220
|
+
/>
|
|
221
|
+
</div>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
By default, the iframe loads `/file-viewer/index.html`. If your static assets are deployed elsewhere, pass `viewerUrl`.
|
|
227
|
+
|
|
228
|
+
## Vanilla JavaScript Integration
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npm install @flyfish-group/file-viewer-web
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```html
|
|
235
|
+
<div id="viewer" style="height: 100vh"></div>
|
|
236
|
+
|
|
237
|
+
<script type="module">
|
|
238
|
+
import { mountViewerFrame } from '@flyfish-group/file-viewer-web'
|
|
239
|
+
|
|
240
|
+
mountViewerFrame(document.getElementById('viewer'), {
|
|
241
|
+
url: '/files/demo.pdf',
|
|
242
|
+
options: {
|
|
243
|
+
theme: 'light',
|
|
244
|
+
toolbar: { position: 'bottom-right' },
|
|
245
|
+
archive: { cache: true, workerTimeoutMs: 30000 }
|
|
246
|
+
},
|
|
247
|
+
onEvent(event) {
|
|
248
|
+
console.log(event.type, event.event, event.payload)
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
</script>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
The web package copies the static viewer into `public/file-viewer` during installation. If your package manager blocks install scripts, run:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
npx file-viewer-copy-assets ./public/file-viewer
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## iframe Protocol
|
|
261
|
+
|
|
262
|
+
If you cannot use npm helpers, deploy the static viewer and pass a file URL through query parameters:
|
|
263
|
+
|
|
264
|
+
```html
|
|
265
|
+
<iframe
|
|
266
|
+
src="/file-viewer/index.html?url=%2Ffiles%2Fdemo.pdf&options=%7B%22theme%22%3A%22light%22%2C%22toolbar%22%3A%7B%22position%22%3A%22bottom-right%22%7D%7D"
|
|
267
|
+
style="width: 100%; height: 100vh; border: 0"
|
|
268
|
+
></iframe>
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
For authenticated files, download the file in the host system and push a `Blob` to the iframe:
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
const viewerUrl = '/file-viewer/index.html'
|
|
275
|
+
const viewerOrigin = location.origin
|
|
276
|
+
const filename = 'contract.pdf'
|
|
277
|
+
const options = { theme: 'light', toolbar: { position: 'bottom-right' } }
|
|
278
|
+
const frame = document.getElementById('viewer') as HTMLIFrameElement
|
|
279
|
+
|
|
280
|
+
frame.src =
|
|
281
|
+
`${viewerUrl}?name=${encodeURIComponent(filename)}` +
|
|
282
|
+
`&from=${encodeURIComponent(location.origin)}` +
|
|
283
|
+
`&options=${encodeURIComponent(JSON.stringify(options))}`
|
|
284
|
+
|
|
285
|
+
frame.onload = async () => {
|
|
286
|
+
const response = await fetch('/api/files/contract', { credentials: 'include' })
|
|
287
|
+
const blob = await response.blob()
|
|
288
|
+
frame.contentWindow?.postMessage(blob, viewerOrigin)
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The viewer validates `event.origin === from` and only accepts `Blob` messages from the declared origin.
|
|
293
|
+
|
|
294
|
+
## Core Options
|
|
295
|
+
|
|
296
|
+
| Option | Description |
|
|
297
|
+
| --- | --- |
|
|
298
|
+
| `theme` | `light`, `dark`, or `system`. Default is `system`. Use `light` when embedding in a fixed light UI. |
|
|
299
|
+
| `toolbar` | `true`, `false`, or an object that controls download, print, HTML export, unified zoom controls, and toolbar position. |
|
|
300
|
+
| `toolbar.zoom` | Shows or hides the built-in zoom group. The actual capability is provided by each renderer, so unsupported or interaction-sensitive formats are not force-scaled. |
|
|
301
|
+
| `toolbar.position` | `auto`, `top`, or `bottom-right`. Default `auto` floats the operation bar at bottom right for PDF and keeps other formats at top. |
|
|
302
|
+
| `watermark` | Text or image watermark configuration. Watermark participates in preview, print, and exported HTML. |
|
|
303
|
+
| `archive.workerUrl` | Custom `libarchive.js` Worker URL for special private deployments. By default the viewer tries `vendor/libarchive/worker-bundle.js` under the current base and falls back to the bundled Worker automatically. |
|
|
304
|
+
| `archive.wasmUrl` | Custom libarchive WASM URL used by the bundled Worker fallback. |
|
|
305
|
+
| `archive.workerTimeoutMs` | Worker initialization, encryption check, and directory-read timeout. Defaults to 30000ms and then falls back to ZIP/TAR/GZIP compatibility mode when possible. |
|
|
306
|
+
| `archive.cache` | Enables IndexedDB cache for extracted archive entries. |
|
|
307
|
+
| `archive.maxArchiveSize` | Maximum archive size allowed for directory parsing. |
|
|
308
|
+
| `archive.maxEntryPreviewSize` | Maximum extracted entry size allowed for online preview. |
|
|
309
|
+
| `pdf.streaming` | PDF URL loading strategy. Same-origin streaming is enabled by default. |
|
|
310
|
+
| `pdf.rangeChunkSize` | PDF.js Range request chunk size. |
|
|
311
|
+
| `typst.compilerWasmUrl` | Custom Typst compiler WASM URL. |
|
|
312
|
+
| `hooks` | Vue component lifecycle hooks for load and unload events. |
|
|
313
|
+
| `beforeOperation` | Vue component guard before download, print, HTML export, or zoom actions. Return `false` to cancel. |
|
|
314
|
+
|
|
315
|
+
React, vanilla JavaScript, and iframe integrations cannot serialize function hooks into query parameters. Use `onViewerEvent` or `onEvent` to receive lifecycle and operation events from the iframe.
|
|
316
|
+
|
|
317
|
+
## Printing, Exporting, and Watermarks
|
|
318
|
+
|
|
319
|
+
- Download keeps the original file bytes. It does not write rendered output back into the source file.
|
|
320
|
+
- Print opens a print-only document containing the rendered body and watermark, without the demo shell or host UI.
|
|
321
|
+
- PDF print and HTML export use a dedicated adapter that renders complete pages rather than only the visible canvas.
|
|
322
|
+
- Word print and HTML export preserve the white paper surface and page sizing while removing preview-only layout wrappers.
|
|
323
|
+
- Spreadsheet, archive, email, EPUB, audio, video, and 3D pipelines hide unreliable print buttons when the full document cannot be printed consistently.
|
|
324
|
+
- HTML export clones the current rendered output and converts canvas content where possible.
|
|
325
|
+
|
|
326
|
+
## Document Comparison
|
|
327
|
+
|
|
328
|
+
The production demo includes a standalone comparison page:
|
|
329
|
+
|
|
330
|
+
[https://viewer.flyfish.dev/compare.html](https://viewer.flyfish.dev/compare.html)
|
|
331
|
+
|
|
332
|
+
It supports two-pane document preview, built-in samples, URL input, local upload, swapping panes, reset, and synchronized scrolling. The comparison page is intentionally separate from the main viewer entry so that the primary component API stays small and predictable.
|
|
333
|
+
|
|
334
|
+
## Private Deployment
|
|
335
|
+
|
|
336
|
+
For npm-based iframe integrations, make sure your final static output contains:
|
|
337
|
+
|
|
338
|
+
```txt
|
|
339
|
+
file-viewer/index.html
|
|
340
|
+
file-viewer/assets/*
|
|
341
|
+
file-viewer/vendor/libarchive/worker-bundle.js # optional unless you want a static Worker path
|
|
342
|
+
file-viewer/vendor/libarchive/libarchive.wasm # keep next to worker-bundle.js when using archive.workerUrl
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
The artifact repository also contains:
|
|
346
|
+
|
|
347
|
+
| Path | Purpose |
|
|
348
|
+
| --- | --- |
|
|
349
|
+
| `dist/` | Minified library build artifacts |
|
|
350
|
+
| `demo/` | Static production demo, including `index.html` and `compare.html` |
|
|
351
|
+
| `adapter-demo/` | React and vanilla JavaScript integration demo |
|
|
352
|
+
| `docs/` | Static documentation site output |
|
|
353
|
+
| `example/` | Sample files used by the demo |
|
|
354
|
+
| `artifacts/` | npm tarballs and packaged static build archives |
|
|
355
|
+
| `README.md` | Default Chinese documentation |
|
|
356
|
+
| `README.en.md` | English documentation |
|
|
357
|
+
| `LICENSE` | Apache-2.0 license |
|
|
358
|
+
|
|
359
|
+
## Docker
|
|
360
|
+
|
|
361
|
+
The project provides a static nginx runtime image and build scripts for `linux/amd64` and `linux/arm64`. A typical deployment can serve the demo and comparison page directly:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
docker run --rm -p 8080:80 flyfishdev/file-viewer:1.0.25
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Then open:
|
|
368
|
+
|
|
369
|
+
```txt
|
|
370
|
+
http://localhost:8080/
|
|
371
|
+
http://localhost:8080/compare.html
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
If you build the image yourself, use the provided `Dockerfile` and keep the static viewer assets, examples, and vendor WASM files together.
|
|
375
|
+
|
|
376
|
+
## Public Artifacts vs Source Code
|
|
377
|
+
|
|
378
|
+
This public repository is for artifact delivery. It contains minified build output, static demo sites, sample files, documentation output, and npm tarballs. It intentionally does not include the private source tree. The Gitee mirror is synchronized from a clean latest-artifact snapshot when needed, so domestic users can clone the full expanded artifact repository without inheriting oversized binary release history.
|
|
379
|
+
|
|
380
|
+
If you need source code access, second development resources, or commercial customization, use the self-service source access portal:
|
|
381
|
+
|
|
382
|
+
[https://dev.flyfish.group/shop](https://dev.flyfish.group/shop)
|
|
383
|
+
|
|
384
|
+
The self-service source access price is 4.99. It is designed to make legitimate second development and commercial evaluation straightforward without mixing source delivery into the public artifact repository.
|
|
385
|
+
|
|
386
|
+
## License and Attribution
|
|
387
|
+
|
|
388
|
+
Flyfish Viewer is distributed under the Apache-2.0 license. You may use the public artifacts according to that license.
|
|
389
|
+
|
|
390
|
+
For second development or commercial use, please keep clear attribution to Flyfish Viewer and contribute useful fixes or compatibility improvements back whenever possible. This keeps the preview ecosystem healthier for everyone using the component in real business systems.
|