@l1yp/file-viewer 0.1.0
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 +21 -0
- package/README.md +134 -0
- package/dist/FileViewer.js +7 -0
- package/dist/FileViewer.vue.d.ts +37 -0
- package/dist/FileViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/components/AppxViewer.js +7 -0
- package/dist/components/AppxViewer.vue.d.ts +18 -0
- package/dist/components/AppxViewer.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/ArchiveBrowser.js +7 -0
- package/dist/components/ArchiveBrowser.vue.d.ts +18 -0
- package/dist/components/ArchiveBrowser.vue_vue_type_script_setup_true_lang.js +279 -0
- package/dist/components/AudioViewer.js +7 -0
- package/dist/components/AudioViewer.vue.d.ts +21 -0
- package/dist/components/AudioViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/BinObjBrowser.js +7 -0
- package/dist/components/BinObjBrowser.vue.d.ts +19 -0
- package/dist/components/BinObjBrowser.vue_vue_type_script_setup_true_lang.js +141 -0
- package/dist/components/CertViewer.js +7 -0
- package/dist/components/CertViewer.vue.d.ts +17 -0
- package/dist/components/CertViewer.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/ClassViewer.js +7 -0
- package/dist/components/ClassViewer.vue.d.ts +15 -0
- package/dist/components/ClassViewer.vue_vue_type_script_setup_true_lang.js +164 -0
- package/dist/components/CodeBlock.js +7 -0
- package/dist/components/CodeBlock.vue.d.ts +17 -0
- package/dist/components/CodeBlock.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/CodeView.js +7 -0
- package/dist/components/CodeView.vue.d.ts +21 -0
- package/dist/components/CodeView.vue_vue_type_script_setup_true_lang.js +180 -0
- package/dist/components/CsvViewer.js +7 -0
- package/dist/components/CsvViewer.vue.d.ts +26 -0
- package/dist/components/CsvViewer.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/DicomViewer.js +7 -0
- package/dist/components/DicomViewer.vue.d.ts +30 -0
- package/dist/components/DicomViewer.vue_vue_type_script_setup_true_lang.js +362 -0
- package/dist/components/DocxViewer.js +7 -0
- package/dist/components/DocxViewer.vue.d.ts +19 -0
- package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/components/DrawioViewer.js +7 -0
- package/dist/components/DrawioViewer.vue.d.ts +16 -0
- package/dist/components/DrawioViewer.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/components/DxfViewer.js +7 -0
- package/dist/components/DxfViewer.vue.d.ts +14 -0
- package/dist/components/DxfViewer.vue_vue_type_script_setup_true_lang.js +239 -0
- package/dist/components/EbookViewer.js +7 -0
- package/dist/components/EbookViewer.vue.d.ts +22 -0
- package/dist/components/EbookViewer.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/EmlViewer.js +7 -0
- package/dist/components/EmlViewer.vue.d.ts +21 -0
- package/dist/components/EmlViewer.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/components/EplViewer.js +7 -0
- package/dist/components/EplViewer.vue.d.ts +19 -0
- package/dist/components/EplViewer.vue_vue_type_script_setup_true_lang.js +201 -0
- package/dist/components/FileViewerBody.js +7 -0
- package/dist/components/FileViewerBody.vue.d.ts +47 -0
- package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +599 -0
- package/dist/components/FileViewerPanel.js +7 -0
- package/dist/components/FileViewerPanel.vue.d.ts +3 -0
- package/dist/components/FileViewerPanel.vue_vue_type_script_setup_true_lang.js +207 -0
- package/dist/components/FontViewer.js +7 -0
- package/dist/components/FontViewer.vue.d.ts +17 -0
- package/dist/components/FontViewer.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/components/FrontmatterCard.js +7 -0
- package/dist/components/FrontmatterCard.vue.d.ts +11 -0
- package/dist/components/FrontmatterCard.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/GeoViewer.js +7 -0
- package/dist/components/GeoViewer.vue.d.ts +17 -0
- package/dist/components/GeoViewer.vue_vue_type_script_setup_true_lang.js +255 -0
- package/dist/components/HarViewer.js +7 -0
- package/dist/components/HarViewer.vue.d.ts +20 -0
- package/dist/components/HarViewer.vue_vue_type_script_setup_true_lang.js +322 -0
- package/dist/components/HexViewer.js +7 -0
- package/dist/components/HexViewer.vue.d.ts +22 -0
- package/dist/components/HexViewer.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/components/HprofViewer.js +7 -0
- package/dist/components/HprofViewer.vue.d.ts +27 -0
- package/dist/components/HprofViewer.vue_vue_type_script_setup_true_lang.js +561 -0
- package/dist/components/ImageLightbox.js +7 -0
- package/dist/components/ImageLightbox.vue.d.ts +3 -0
- package/dist/components/ImageLightbox.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/components/InlineText.d.ts +29 -0
- package/dist/components/InlineText.js +21 -0
- package/dist/components/JksViewer.js +7 -0
- package/dist/components/JksViewer.vue.d.ts +22 -0
- package/dist/components/JksViewer.vue_vue_type_script_setup_true_lang.js +353 -0
- package/dist/components/JsonlViewer.js +7 -0
- package/dist/components/JsonlViewer.vue.d.ts +15 -0
- package/dist/components/JsonlViewer.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/LogViewer.js +7 -0
- package/dist/components/LogViewer.vue.d.ts +29 -0
- package/dist/components/LogViewer.vue_vue_type_script_setup_true_lang.js +670 -0
- package/dist/components/LrcViewer.js +7 -0
- package/dist/components/LrcViewer.vue.d.ts +17 -0
- package/dist/components/LrcViewer.vue_vue_type_script_setup_true_lang.js +106 -0
- package/dist/components/MarkdownTable.js +7 -0
- package/dist/components/MarkdownTable.vue.d.ts +19 -0
- package/dist/components/MarkdownTable.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/components/MarkdownText.d.ts +30 -0
- package/dist/components/MarkdownText.js +21 -0
- package/dist/components/MhtViewer.js +7 -0
- package/dist/components/MhtViewer.vue.d.ts +22 -0
- package/dist/components/MhtViewer.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/components/MindMapView.js +7 -0
- package/dist/components/MindMapView.vue.d.ts +23 -0
- package/dist/components/MindMapView.vue_vue_type_script_setup_true_lang.js +337 -0
- package/dist/components/MissingDependency.js +7 -0
- package/dist/components/MissingDependency.vue.d.ts +17 -0
- package/dist/components/MissingDependency.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/ModelViewer.js +7 -0
- package/dist/components/ModelViewer.vue.d.ts +18 -0
- package/dist/components/ModelViewer.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/MsiViewer.js +7 -0
- package/dist/components/MsiViewer.vue.d.ts +19 -0
- package/dist/components/MsiViewer.vue_vue_type_script_setup_true_lang.js +136 -0
- package/dist/components/NotebookViewer.js +7 -0
- package/dist/components/NotebookViewer.vue.d.ts +20 -0
- package/dist/components/NotebookViewer.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/PdfViewer.js +7 -0
- package/dist/components/PdfViewer.vue.d.ts +19 -0
- package/dist/components/PdfViewer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/PptxViewer.js +7 -0
- package/dist/components/PptxViewer.vue.d.ts +20 -0
- package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/PsdViewer.js +7 -0
- package/dist/components/PsdViewer.vue.d.ts +15 -0
- package/dist/components/PsdViewer.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/components/QmcAudioViewer.js +7 -0
- package/dist/components/QmcAudioViewer.vue.d.ts +18 -0
- package/dist/components/QmcAudioViewer.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/RasterViewer.js +7 -0
- package/dist/components/RasterViewer.vue.d.ts +21 -0
- package/dist/components/RasterViewer.vue_vue_type_script_setup_true_lang.js +161 -0
- package/dist/components/RtfViewer.js +7 -0
- package/dist/components/RtfViewer.vue.d.ts +21 -0
- package/dist/components/RtfViewer.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/SevenZipBrowser.js +7 -0
- package/dist/components/SevenZipBrowser.vue.d.ts +13 -0
- package/dist/components/SevenZipBrowser.vue_vue_type_script_setup_true_lang.js +366 -0
- package/dist/components/SqliteViewer.js +7 -0
- package/dist/components/SqliteViewer.vue.d.ts +18 -0
- package/dist/components/SqliteViewer.vue_vue_type_script_setup_true_lang.js +186 -0
- package/dist/components/SubtitleViewer.js +7 -0
- package/dist/components/SubtitleViewer.vue.d.ts +15 -0
- package/dist/components/SubtitleViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/XlsxChart.js +7 -0
- package/dist/components/XlsxChart.vue.d.ts +14 -0
- package/dist/components/XlsxChart.vue_vue_type_script_setup_true_lang.js +240 -0
- package/dist/components/XlsxViewer.js +7 -0
- package/dist/components/XlsxViewer.vue.d.ts +22 -0
- package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +814 -0
- package/dist/components/XmindViewer.js +7 -0
- package/dist/components/XmindViewer.vue.d.ts +13 -0
- package/dist/components/XmindViewer.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/ZipBrowser.js +7 -0
- package/dist/components/ZipBrowser.vue.d.ts +14 -0
- package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +326 -0
- package/dist/components/ZoomImage.js +7 -0
- package/dist/components/ZoomImage.vue.d.ts +29 -0
- package/dist/components/ZoomImage.vue_vue_type_script_setup_true_lang.js +147 -0
- package/dist/components/epl/EplCodeBlock.js +7 -0
- package/dist/components/epl/EplCodeBlock.vue.d.ts +15 -0
- package/dist/components/epl/EplCodeBlock.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/components/epl/EplDoc.js +7 -0
- package/dist/components/epl/EplDoc.vue.d.ts +19 -0
- package/dist/components/epl/EplDoc.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/components/epl/EplMethod.js +7 -0
- package/dist/components/epl/EplMethod.vue.d.ts +14 -0
- package/dist/components/epl/EplMethod.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/epl/EplResource.js +7 -0
- package/dist/components/epl/EplResource.vue.d.ts +15 -0
- package/dist/components/epl/EplResource.vue_vue_type_script_setup_true_lang.js +204 -0
- package/dist/components/epl/EplTree.js +7 -0
- package/dist/components/epl/EplTree.vue.d.ts +27 -0
- package/dist/components/epl/EplTree.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/components/epl/EplVarTable.js +7 -0
- package/dist/components/epl/EplVarTable.vue.d.ts +21 -0
- package/dist/components/epl/EplVarTable.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/epl/docTypes.d.ts +12 -0
- package/dist/components/epl/numbering.d.ts +21 -0
- package/dist/components/epl/numbering.js +14 -0
- package/dist/components/icons/Icon.js +7 -0
- package/dist/components/icons/Icon.vue.d.ts +14 -0
- package/dist/components/icons/Icon.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/icons/iconPaths.d.ts +60 -0
- package/dist/components/icons/iconPaths.js +54 -0
- package/dist/components/optionalViewer.d.ts +14 -0
- package/dist/components/optionalViewer.js +37 -0
- package/dist/components/ui/ClampBlock.d.ts +82 -0
- package/dist/components/ui/ClampBlock.js +63 -0
- package/dist/composables/useFileViewer.d.ts +428 -0
- package/dist/composables/useFileViewer.js +27 -0
- package/dist/composables/useLightbox.d.ts +33 -0
- package/dist/composables/useLightbox.js +17 -0
- package/dist/composables/useLogRules.d.ts +47 -0
- package/dist/composables/useLogRules.js +74 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +30 -0
- package/dist/lib/aes.d.ts +25 -0
- package/dist/lib/aes.js +99 -0
- package/dist/lib/appx.d.ts +66 -0
- package/dist/lib/appx.js +112 -0
- package/dist/lib/archive.d.ts +29 -0
- package/dist/lib/asn1.d.ts +47 -0
- package/dist/lib/asn1.js +122 -0
- package/dist/lib/binobj.d.ts +69 -0
- package/dist/lib/binobj.js +430 -0
- package/dist/lib/brotli.d.ts +14 -0
- package/dist/lib/brotli.js +16 -0
- package/dist/lib/bzip2.d.ts +14 -0
- package/dist/lib/bzip2.js +161 -0
- package/dist/lib/classfile.d.ts +72 -0
- package/dist/lib/classfile.js +210 -0
- package/dist/lib/codePreview.d.ts +22 -0
- package/dist/lib/codePreview.js +27 -0
- package/dist/lib/codefold.d.ts +14 -0
- package/dist/lib/codefold.js +30 -0
- package/dist/lib/codeformat.d.ts +21 -0
- package/dist/lib/codeformat.js +130 -0
- package/dist/lib/csv.d.ts +19 -0
- package/dist/lib/csv.js +74 -0
- package/dist/lib/des.d.ts +17 -0
- package/dist/lib/des.js +928 -0
- package/dist/lib/diagram.d.ts +5 -0
- package/dist/lib/diagram.js +479 -0
- package/dist/lib/dicom.d.ts +69 -0
- package/dist/lib/dicom.js +442 -0
- package/dist/lib/dicomCodecs.d.ts +28 -0
- package/dist/lib/dicomCodecs.js +156 -0
- package/dist/lib/dicomRender.d.ts +46 -0
- package/dist/lib/dicomRender.js +114 -0
- package/dist/lib/dxf.d.ts +86 -0
- package/dist/lib/dxf.js +399 -0
- package/dist/lib/eml.d.ts +40 -0
- package/dist/lib/eml.js +46 -0
- package/dist/lib/encoding.d.ts +28 -0
- package/dist/lib/encoding.js +44 -0
- package/dist/lib/epl/code/ast.d.ts +150 -0
- package/dist/lib/epl/code/codeDataParser.d.ts +3 -0
- package/dist/lib/epl/code/codeDataParser.js +330 -0
- package/dist/lib/epl/code/codeLines.d.ts +20 -0
- package/dist/lib/epl/code/codeLines.js +191 -0
- package/dist/lib/epl/code/structures.d.ts +86 -0
- package/dist/lib/epl/code/textCode.d.ts +29 -0
- package/dist/lib/epl/code/textCode.js +150 -0
- package/dist/lib/epl/code/variable.d.ts +25 -0
- package/dist/lib/epl/eplDocument.d.ts +21 -0
- package/dist/lib/epl/eplDocument.js +36 -0
- package/dist/lib/epl/imageList.d.ts +28 -0
- package/dist/lib/epl/imageList.js +66 -0
- package/dist/lib/epl/index.d.ts +53 -0
- package/dist/lib/epl/index.js +45 -0
- package/dist/lib/epl/io/binaryReader.d.ts +56 -0
- package/dist/lib/epl/io/binaryReader.js +119 -0
- package/dist/lib/epl/io/encoding.d.ts +16 -0
- package/dist/lib/epl/io/encoding.js +27 -0
- package/dist/lib/epl/model/eplSystemId.d.ts +64 -0
- package/dist/lib/epl/model/eplSystemId.js +16 -0
- package/dist/lib/epl/model/section.d.ts +46 -0
- package/dist/lib/epl/names/eplLibData.js +39 -0
- package/dist/lib/epl/names/idToNameMap.d.ts +33 -0
- package/dist/lib/epl/names/idToNameMap.js +130 -0
- package/dist/lib/epl/names/libNameProvider.d.ts +15 -0
- package/dist/lib/epl/names/libNameProvider.js +18 -0
- package/dist/lib/epl/program.d.ts +120 -0
- package/dist/lib/epl/program.js +134 -0
- package/dist/lib/epl/projectFileReader.d.ts +23 -0
- package/dist/lib/epl/projectFileReader.js +65 -0
- package/dist/lib/epl/sections/code.d.ts +20 -0
- package/dist/lib/epl/sections/esystemInfo.d.ts +14 -0
- package/dist/lib/epl/sections/losable.d.ts +11 -0
- package/dist/lib/epl/sections/projectConfig.d.ts +23 -0
- package/dist/lib/epl/sections/resource.d.ts +57 -0
- package/dist/lib/fb2.d.ts +14 -0
- package/dist/lib/fb2.js +62 -0
- package/dist/lib/fileType.d.ts +315 -0
- package/dist/lib/fileType.js +800 -0
- package/dist/lib/fonts.d.ts +8 -0
- package/dist/lib/fonts.js +4 -0
- package/dist/lib/format.d.ts +16 -0
- package/dist/lib/format.js +38 -0
- package/dist/lib/frontmatter.d.ts +13 -0
- package/dist/lib/frontmatter.js +23 -0
- package/dist/lib/geo.d.ts +30 -0
- package/dist/lib/geo.js +235 -0
- package/dist/lib/har.d.ts +171 -0
- package/dist/lib/har.js +397 -0
- package/dist/lib/highlight.d.ts +18 -0
- package/dist/lib/highlight.js +34 -0
- package/dist/lib/highlightLangs.d.ts +15 -0
- package/dist/lib/highlightLangs.js +93 -0
- package/dist/lib/hprof.d.ts +211 -0
- package/dist/lib/hprof.js +709 -0
- package/dist/lib/ipynb.d.ts +48 -0
- package/dist/lib/ipynb.js +130 -0
- package/dist/lib/jks.d.ts +86 -0
- package/dist/lib/jks.js +167 -0
- package/dist/lib/jsonl.d.ts +29 -0
- package/dist/lib/jsonl.js +24 -0
- package/dist/lib/lrc.d.ts +32 -0
- package/dist/lib/lrc.js +84 -0
- package/dist/lib/lzma.d.ts +70 -0
- package/dist/lib/lzma.js +204 -0
- package/dist/lib/markdown/blocks.d.ts +9 -0
- package/dist/lib/markdown/blocks.js +221 -0
- package/dist/lib/markdown/index.d.ts +3 -0
- package/dist/lib/markdown/inline.d.ts +33 -0
- package/dist/lib/markdown/inline.js +84 -0
- package/dist/lib/markdown/math.d.ts +5 -0
- package/dist/lib/markdown/math.js +25 -0
- package/dist/lib/markdown/segmentize.d.ts +11 -0
- package/dist/lib/markdown/segmentize.js +28 -0
- package/dist/lib/markdown/styles.d.ts +26 -0
- package/dist/lib/markdown/styles.js +135 -0
- package/dist/lib/mht.d.ts +51 -0
- package/dist/lib/mht.js +122 -0
- package/dist/lib/midi.d.ts +28 -0
- package/dist/lib/midi.js +84 -0
- package/dist/lib/mime.d.ts +82 -0
- package/dist/lib/mime.js +151 -0
- package/dist/lib/mindmap.d.ts +51 -0
- package/dist/lib/mindmap.js +113 -0
- package/dist/lib/mobi.d.ts +15 -0
- package/dist/lib/mobi.js +68 -0
- package/dist/lib/msi.d.ts +50 -0
- package/dist/lib/msi.js +332 -0
- package/dist/lib/optionalDep.d.ts +26 -0
- package/dist/lib/optionalDep.js +20 -0
- package/dist/lib/pkcs12.d.ts +56 -0
- package/dist/lib/pkcs12.js +356 -0
- package/dist/lib/qmc.d.ts +50 -0
- package/dist/lib/qmc.js +213 -0
- package/dist/lib/rar.d.ts +16 -0
- package/dist/lib/rar.js +40 -0
- package/dist/lib/rawPreview.d.ts +12 -0
- package/dist/lib/rawPreview.js +54 -0
- package/dist/lib/rc2.d.ts +12 -0
- package/dist/lib/rc2.js +298 -0
- package/dist/lib/resolveInput.d.ts +22 -0
- package/dist/lib/resolveInput.js +55 -0
- package/dist/lib/rtf.d.ts +53 -0
- package/dist/lib/rtf.js +413 -0
- package/dist/lib/sevenZip.d.ts +82 -0
- package/dist/lib/sevenZip.js +395 -0
- package/dist/lib/sha1.d.ts +24 -0
- package/dist/lib/sha1.js +53 -0
- package/dist/lib/sha256.d.ts +21 -0
- package/dist/lib/sha256.js +119 -0
- package/dist/lib/speechAudio.d.ts +36 -0
- package/dist/lib/speechAudio.js +85 -0
- package/dist/lib/sqlite.d.ts +38 -0
- package/dist/lib/sqlite.js +104 -0
- package/dist/lib/subtitle.d.ts +26 -0
- package/dist/lib/subtitle.js +99 -0
- package/dist/lib/tarball.d.ts +20 -0
- package/dist/lib/tarball.js +248 -0
- package/dist/lib/viewerFormats.d.ts +35 -0
- package/dist/lib/viewerFormats.js +83 -0
- package/dist/lib/viewerKind.d.ts +36 -0
- package/dist/lib/viewerKind.js +233 -0
- package/dist/lib/x509.d.ts +68 -0
- package/dist/lib/x509.js +267 -0
- package/dist/lib/xlsx.d.ts +55 -0
- package/dist/lib/xlsx.js +321 -0
- package/dist/lib/xlsxCharts.d.ts +34 -0
- package/dist/lib/xlsxCharts.js +152 -0
- package/dist/lib/xmind.d.ts +6 -0
- package/dist/lib/xmind.js +124 -0
- package/dist/lib/zip.d.ts +56 -0
- package/dist/lib/zip.js +169 -0
- package/dist/style.css +2 -0
- package/dist/types.d.ts +42 -0
- package/package.json +128 -0
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import { fileExt as e } from "../lib/fileType.js";
|
|
2
|
+
import { looksLikeMindMap as t } from "../lib/mindmap.js";
|
|
3
|
+
import { skipsTextLoad as n } from "../lib/viewerKind.js";
|
|
4
|
+
import { optionalViewer as r } from "./optionalViewer.js";
|
|
5
|
+
import { VIEWER_FORMATTERS as i, applyFormatter as ee, findFormatter as te } from "../lib/viewerFormats.js";
|
|
6
|
+
import { parseFrontmatter as ne } from "../lib/frontmatter.js";
|
|
7
|
+
import { formatBytes as re } from "../lib/format.js";
|
|
8
|
+
import a from "./icons/Icon.js";
|
|
9
|
+
import ie from "./CodeView.js";
|
|
10
|
+
import ae from "./MarkdownText.js";
|
|
11
|
+
import oe from "./FrontmatterCard.js";
|
|
12
|
+
import se from "./ZoomImage.js";
|
|
13
|
+
import { Fragment as o, Teleport as ce, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineAsyncComponent as p, defineComponent as m, normalizeClass as h, onBeforeUnmount as le, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, watch as x } from "vue";
|
|
14
|
+
//#region src/components/FileViewerBody.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
+
var ue = { class: "fvb" }, de = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "fvb__fmtbar"
|
|
18
|
+
}, fe = ["onClick"], pe = {
|
|
19
|
+
key: 35,
|
|
20
|
+
class: "fvb__imagezoom"
|
|
21
|
+
}, me = {
|
|
22
|
+
key: 36,
|
|
23
|
+
class: "fvb__video"
|
|
24
|
+
}, he = ["src"], ge = {
|
|
25
|
+
key: 37,
|
|
26
|
+
class: "fvb__binary"
|
|
27
|
+
}, _e = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "fvb__binary-sub"
|
|
30
|
+
}, ve = ["href", "download"], ye = { class: "fvb__openas" }, be = { class: "fvb__openas-grid" }, xe = ["onClick"], Se = {
|
|
31
|
+
key: 38,
|
|
32
|
+
class: "fvb__msg"
|
|
33
|
+
}, S = {
|
|
34
|
+
key: 39,
|
|
35
|
+
class: "fvb__msg fvb__msg--error"
|
|
36
|
+
}, C = {
|
|
37
|
+
key: 40,
|
|
38
|
+
class: "fvb__scroll fvb__scroll--doc"
|
|
39
|
+
}, w = { class: "fvb__markdown" }, T = {
|
|
40
|
+
key: 41,
|
|
41
|
+
class: "fvb__html"
|
|
42
|
+
}, E = { class: "fvb__htmlbar" }, D = ["title"], O = ["src", "sandbox"], k = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "fvb__fs"
|
|
45
|
+
}, A = { class: "fvb__fsbar" }, j = ["title"], Ce = ["src", "sandbox"], we = {
|
|
46
|
+
key: 42,
|
|
47
|
+
class: "fvb__svg"
|
|
48
|
+
}, Te = ["src", "alt"], Ee = {
|
|
49
|
+
key: 43,
|
|
50
|
+
class: "fvb__fill"
|
|
51
|
+
}, De = {
|
|
52
|
+
key: 44,
|
|
53
|
+
class: "fvb__fill"
|
|
54
|
+
}, Oe = {
|
|
55
|
+
key: 45,
|
|
56
|
+
class: "fvb__fill"
|
|
57
|
+
}, ke = {
|
|
58
|
+
key: 46,
|
|
59
|
+
class: "fvb__fill"
|
|
60
|
+
}, Ae = {
|
|
61
|
+
key: 47,
|
|
62
|
+
class: "fvb__fill"
|
|
63
|
+
}, je = {
|
|
64
|
+
key: 48,
|
|
65
|
+
class: "fvb__fill"
|
|
66
|
+
}, Me = "<meta http-equiv=\"Content-Security-Policy\" content=\"script-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'\">", Ne = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'unsafe-inline' 'unsafe-eval' data: blob: https: http:; connect-src data: blob: https: http: ws: wss:; object-src 'none'; base-uri 'none'\">", M = /*@__PURE__*/ m({
|
|
67
|
+
__name: "FileViewerBody",
|
|
68
|
+
props: {
|
|
69
|
+
file: {},
|
|
70
|
+
mode: { default: "render" },
|
|
71
|
+
hostChooser: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
emits: [
|
|
77
|
+
"loaded",
|
|
78
|
+
"formatchange",
|
|
79
|
+
"formatpick"
|
|
80
|
+
],
|
|
81
|
+
setup(m, { expose: M, emit: Pe }) {
|
|
82
|
+
let N = m, P = Pe, Fe = p(() => import("./ZipBrowser.js")), Ie = p(() => import("./SevenZipBrowser.js")), Le = p(() => import("./ArchiveBrowser.js")), Re = p(() => import("./BinObjBrowser.js")), ze = p(() => import("./EplViewer.js")), Be = p(() => import("./ClassViewer.js")), Ve = p(() => import("./HprofViewer.js")), He = p(() => import("./MsiViewer.js")), Ue = p(() => import("./AppxViewer.js")), We = r(() => import("./DicomViewer.js"), "dicom-parser", "DICOM 影像"), Ge = r(() => import("./DocxViewer.js"), "docx-preview", "Word 文档"), Ke = r(() => import("./XlsxViewer.js"), ["exceljs", "numfmt"], "Excel 表格"), qe = r(() => import("./PptxViewer.js"), ["@aiden0z/pptx-renderer", "pdfjs-dist"], "PowerPoint"), Je = p(() => import("./RtfViewer.js")), Ye = r(() => import("./PdfViewer.js"), "pdfjs-dist", "PDF"), Xe = p(() => import("./MindMapView.js")), Ze = p(() => import("./XmindViewer.js")), Qe = p(() => import("./EmlViewer.js")), F = p(() => import("./MhtViewer.js")), $e = p(() => import("./HarViewer.js")), et = r(() => import("./SqliteViewer.js"), "sql.js", "SQLite 数据库"), tt = p(() => import("./SubtitleViewer.js")), nt = p(() => import("./FontViewer.js")), rt = p(() => import("./NotebookViewer.js")), it = p(() => import("./GeoViewer.js")), at = p(() => import("./CsvViewer.js")), ot = p(() => import("./JsonlViewer.js")), st = p(() => import("./CertViewer.js")), ct = p(() => import("./JksViewer.js")), lt = p(() => import("./AudioViewer.js")), ut = p(() => import("./QmcAudioViewer.js")), dt = p(() => import("./LrcViewer.js")), ft = p(() => import("./LogViewer.js")), pt = r(() => import("./ModelViewer.js"), "three", "3D 模型"), mt = p(() => import("./RasterViewer.js")), ht = p(() => import("./PsdViewer.js")), gt = p(() => import("./EbookViewer.js")), _t = p(() => import("./DrawioViewer.js")), vt = p(() => import("./DxfViewer.js")), yt = p(() => import("./HexViewer.js")), I = _(""), L = _(null), R = s(() => L.value ?? N.file);
|
|
83
|
+
function z(e) {
|
|
84
|
+
I.value = e.key, L.value = ee(N.file, e);
|
|
85
|
+
}
|
|
86
|
+
function bt(e) {
|
|
87
|
+
let t = te(e);
|
|
88
|
+
t && z(t);
|
|
89
|
+
}
|
|
90
|
+
function xt() {
|
|
91
|
+
I.value = "", L.value = null;
|
|
92
|
+
}
|
|
93
|
+
x(I, (e) => P("formatpick", e));
|
|
94
|
+
let B = _("loading"), V = _(""), H = _(""), St = s(() => R.value.mindmap === !0 && B.value === "ready" && t(V.value, e(R.value.name))), U = s(() => R.value.lang === "markdown" ? ne(V.value) : {
|
|
95
|
+
data: {},
|
|
96
|
+
body: V.value
|
|
97
|
+
}), Ct = s(() => Object.keys(U.value.data).length > 0), wt = s(() => V.value.replace(/\n$/, "")), Tt = s(() => V.value ? `data:image/svg+xml,${encodeURIComponent(V.value)}` : "");
|
|
98
|
+
function W(e, t) {
|
|
99
|
+
let n = e.match(/<head[^>]*>/i);
|
|
100
|
+
if (n) {
|
|
101
|
+
let r = (n.index ?? 0) + n[0].length;
|
|
102
|
+
return e.slice(0, r) + t + e.slice(r);
|
|
103
|
+
}
|
|
104
|
+
return `<!doctype html><html><head><meta charset="utf-8">${t}</head><body>${e}</body></html>`;
|
|
105
|
+
}
|
|
106
|
+
let G = _(""), K = _(""), q = _(!1), J = _(!1), Y = s(() => q.value ? K.value : G.value);
|
|
107
|
+
function X() {
|
|
108
|
+
G.value &&= (URL.revokeObjectURL(G.value), ""), K.value &&= (URL.revokeObjectURL(K.value), "");
|
|
109
|
+
}
|
|
110
|
+
x([() => R.value.html, V], ([e, t]) => {
|
|
111
|
+
X(), q.value = !1, J.value = !1, e && typeof URL < "u" && URL.createObjectURL && (G.value = URL.createObjectURL(new Blob([W(t, Me)], { type: "text/html" })));
|
|
112
|
+
});
|
|
113
|
+
function Z() {
|
|
114
|
+
if (q.value) {
|
|
115
|
+
q.value = !1;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
typeof URL < "u" && URL.createObjectURL && !K.value && (K.value = URL.createObjectURL(new Blob([W(V.value, Ne)], { type: "text/html" }))), q.value = !0;
|
|
119
|
+
}
|
|
120
|
+
function Q(e) {
|
|
121
|
+
e.key === "Escape" && (J.value = !1);
|
|
122
|
+
}
|
|
123
|
+
x(J, (e) => {
|
|
124
|
+
typeof window > "u" || (e ? (window.addEventListener("keydown", Q), document.body.style.overflow = "hidden") : (window.removeEventListener("keydown", Q), document.body.style.overflow = ""));
|
|
125
|
+
});
|
|
126
|
+
async function $(e = !1) {
|
|
127
|
+
let t = R.value;
|
|
128
|
+
if (n(t)) {
|
|
129
|
+
V.value = "", B.value = "ready";
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (t.content != null) {
|
|
133
|
+
V.value = t.content, B.value = "ready", P("loaded", t.content);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (!t.url) {
|
|
137
|
+
V.value = "", B.value = "ready";
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
B.value = "loading", H.value = "";
|
|
141
|
+
try {
|
|
142
|
+
let n = await fetch(t.url, e ? { cache: "no-store" } : {});
|
|
143
|
+
if (!n.ok) throw Error(`HTTP ${n.status}`);
|
|
144
|
+
let r = await n.text();
|
|
145
|
+
V.value = r, B.value = "ready", P("loaded", r);
|
|
146
|
+
} catch (e) {
|
|
147
|
+
H.value = String(e), B.value = "error";
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return x(() => N.file, () => {
|
|
151
|
+
L.value = null, I.value = "";
|
|
152
|
+
}), x(R, (e) => {
|
|
153
|
+
P("formatchange", e), $();
|
|
154
|
+
}, { immediate: !0 }), le(() => {
|
|
155
|
+
X(), typeof window < "u" && (window.removeEventListener("keydown", Q), document.body.style.overflow = "");
|
|
156
|
+
}), M({
|
|
157
|
+
reload: () => $(!0),
|
|
158
|
+
pickFormat: bt,
|
|
159
|
+
resetFormat: xt
|
|
160
|
+
}), (e, t) => (g(), u("div", ue, [L.value && !m.hostChooser ? (g(), u("div", de, [t[3] ||= d("span", { class: "fvb__fmtbar-label" }, "格式", -1), (g(!0), u(o, null, v(b(i), (e) => (g(), u("button", {
|
|
161
|
+
key: e.key,
|
|
162
|
+
type: "button",
|
|
163
|
+
class: h(["fvb__fmtchip", { "fvb__fmtchip--on": I.value === e.key }]),
|
|
164
|
+
onClick: (t) => z(e)
|
|
165
|
+
}, [f(a, {
|
|
166
|
+
name: e.icon,
|
|
167
|
+
size: 13
|
|
168
|
+
}, null, 8, ["name"]), d("span", null, y(e.label), 1)], 10, fe))), 128))])) : l("", !0), R.value.zip ? (g(), c(b(Fe), {
|
|
169
|
+
key: 1,
|
|
170
|
+
url: R.value.url ?? "",
|
|
171
|
+
name: R.value.name
|
|
172
|
+
}, null, 8, ["url", "name"])) : R.value.sevenZip ? (g(), c(b(Ie), {
|
|
173
|
+
key: 2,
|
|
174
|
+
url: R.value.url ?? "",
|
|
175
|
+
name: R.value.name
|
|
176
|
+
}, null, 8, ["url", "name"])) : R.value.archive ? (g(), c(b(Le), {
|
|
177
|
+
key: 3,
|
|
178
|
+
url: R.value.url ?? "",
|
|
179
|
+
name: R.value.name,
|
|
180
|
+
kind: R.value.archive
|
|
181
|
+
}, null, 8, [
|
|
182
|
+
"url",
|
|
183
|
+
"name",
|
|
184
|
+
"kind"
|
|
185
|
+
])) : R.value.binobj ? (g(), c(b(Re), {
|
|
186
|
+
key: 4,
|
|
187
|
+
url: R.value.url ?? "",
|
|
188
|
+
name: R.value.name,
|
|
189
|
+
size: R.value.size
|
|
190
|
+
}, null, 8, [
|
|
191
|
+
"url",
|
|
192
|
+
"name",
|
|
193
|
+
"size"
|
|
194
|
+
])) : R.value.epl ? (g(), c(b(ze), {
|
|
195
|
+
key: 5,
|
|
196
|
+
url: R.value.url ?? "",
|
|
197
|
+
name: R.value.name,
|
|
198
|
+
size: R.value.size
|
|
199
|
+
}, null, 8, [
|
|
200
|
+
"url",
|
|
201
|
+
"name",
|
|
202
|
+
"size"
|
|
203
|
+
])) : R.value.javaClass ? (g(), c(b(Be), {
|
|
204
|
+
key: 6,
|
|
205
|
+
url: R.value.url ?? "",
|
|
206
|
+
name: R.value.name,
|
|
207
|
+
size: R.value.size
|
|
208
|
+
}, null, 8, [
|
|
209
|
+
"url",
|
|
210
|
+
"name",
|
|
211
|
+
"size"
|
|
212
|
+
])) : R.value.hprof ? (g(), c(b(Ve), {
|
|
213
|
+
key: 7,
|
|
214
|
+
url: R.value.url ?? "",
|
|
215
|
+
name: R.value.name,
|
|
216
|
+
size: R.value.size
|
|
217
|
+
}, null, 8, [
|
|
218
|
+
"url",
|
|
219
|
+
"name",
|
|
220
|
+
"size"
|
|
221
|
+
])) : R.value.msi ? (g(), c(b(He), {
|
|
222
|
+
key: 8,
|
|
223
|
+
url: R.value.url ?? "",
|
|
224
|
+
name: R.value.name,
|
|
225
|
+
size: R.value.size
|
|
226
|
+
}, null, 8, [
|
|
227
|
+
"url",
|
|
228
|
+
"name",
|
|
229
|
+
"size"
|
|
230
|
+
])) : R.value.appx ? (g(), c(b(Ue), {
|
|
231
|
+
key: 9,
|
|
232
|
+
url: R.value.url ?? "",
|
|
233
|
+
name: R.value.name,
|
|
234
|
+
size: R.value.size
|
|
235
|
+
}, null, 8, [
|
|
236
|
+
"url",
|
|
237
|
+
"name",
|
|
238
|
+
"size"
|
|
239
|
+
])) : R.value.xmind ? (g(), c(b(Ze), {
|
|
240
|
+
key: 10,
|
|
241
|
+
url: R.value.url ?? "",
|
|
242
|
+
name: R.value.name,
|
|
243
|
+
size: R.value.size
|
|
244
|
+
}, null, 8, [
|
|
245
|
+
"url",
|
|
246
|
+
"name",
|
|
247
|
+
"size"
|
|
248
|
+
])) : R.value.dxf ? (g(), c(b(vt), {
|
|
249
|
+
key: 11,
|
|
250
|
+
url: R.value.url ?? "",
|
|
251
|
+
name: R.value.name,
|
|
252
|
+
size: R.value.size
|
|
253
|
+
}, null, 8, [
|
|
254
|
+
"url",
|
|
255
|
+
"name",
|
|
256
|
+
"size"
|
|
257
|
+
])) : R.value.dicom ? (g(), c(b(We), {
|
|
258
|
+
key: 12,
|
|
259
|
+
url: R.value.url ?? "",
|
|
260
|
+
name: R.value.name,
|
|
261
|
+
size: R.value.size
|
|
262
|
+
}, null, 8, [
|
|
263
|
+
"url",
|
|
264
|
+
"name",
|
|
265
|
+
"size"
|
|
266
|
+
])) : R.value.docx ? (g(), c(b(Ge), {
|
|
267
|
+
key: 13,
|
|
268
|
+
url: R.value.url ?? "",
|
|
269
|
+
name: R.value.name,
|
|
270
|
+
size: R.value.size
|
|
271
|
+
}, null, 8, [
|
|
272
|
+
"url",
|
|
273
|
+
"name",
|
|
274
|
+
"size"
|
|
275
|
+
])) : R.value.xlsx ? (g(), c(b(Ke), {
|
|
276
|
+
key: 14,
|
|
277
|
+
url: R.value.url ?? "",
|
|
278
|
+
name: R.value.name,
|
|
279
|
+
size: R.value.size
|
|
280
|
+
}, null, 8, [
|
|
281
|
+
"url",
|
|
282
|
+
"name",
|
|
283
|
+
"size"
|
|
284
|
+
])) : R.value.pptx ? (g(), c(b(qe), {
|
|
285
|
+
key: 15,
|
|
286
|
+
url: R.value.url ?? "",
|
|
287
|
+
name: R.value.name,
|
|
288
|
+
size: R.value.size
|
|
289
|
+
}, null, 8, [
|
|
290
|
+
"url",
|
|
291
|
+
"name",
|
|
292
|
+
"size"
|
|
293
|
+
])) : R.value.rtf ? (g(), c(b(Je), {
|
|
294
|
+
key: 16,
|
|
295
|
+
url: R.value.url ?? "",
|
|
296
|
+
name: R.value.name,
|
|
297
|
+
size: R.value.size
|
|
298
|
+
}, null, 8, [
|
|
299
|
+
"url",
|
|
300
|
+
"name",
|
|
301
|
+
"size"
|
|
302
|
+
])) : R.value.pdf ? (g(), c(b(Ye), {
|
|
303
|
+
key: 17,
|
|
304
|
+
url: R.value.url ?? "",
|
|
305
|
+
name: R.value.name,
|
|
306
|
+
size: R.value.size
|
|
307
|
+
}, null, 8, [
|
|
308
|
+
"url",
|
|
309
|
+
"name",
|
|
310
|
+
"size"
|
|
311
|
+
])) : R.value.eml ? (g(), c(b(Qe), {
|
|
312
|
+
key: 18,
|
|
313
|
+
url: R.value.url ?? "",
|
|
314
|
+
name: R.value.name,
|
|
315
|
+
size: R.value.size
|
|
316
|
+
}, null, 8, [
|
|
317
|
+
"url",
|
|
318
|
+
"name",
|
|
319
|
+
"size"
|
|
320
|
+
])) : R.value.mht ? (g(), c(b(F), {
|
|
321
|
+
key: 19,
|
|
322
|
+
url: R.value.url ?? "",
|
|
323
|
+
name: R.value.name,
|
|
324
|
+
size: R.value.size
|
|
325
|
+
}, null, 8, [
|
|
326
|
+
"url",
|
|
327
|
+
"name",
|
|
328
|
+
"size"
|
|
329
|
+
])) : R.value.har ? (g(), c(b($e), {
|
|
330
|
+
key: 20,
|
|
331
|
+
url: R.value.url ?? "",
|
|
332
|
+
name: R.value.name,
|
|
333
|
+
size: R.value.size
|
|
334
|
+
}, null, 8, [
|
|
335
|
+
"url",
|
|
336
|
+
"name",
|
|
337
|
+
"size"
|
|
338
|
+
])) : R.value.sqlite ? (g(), c(b(et), {
|
|
339
|
+
key: 21,
|
|
340
|
+
url: R.value.url ?? "",
|
|
341
|
+
name: R.value.name,
|
|
342
|
+
size: R.value.size
|
|
343
|
+
}, null, 8, [
|
|
344
|
+
"url",
|
|
345
|
+
"name",
|
|
346
|
+
"size"
|
|
347
|
+
])) : R.value.cert ? (g(), c(b(st), {
|
|
348
|
+
key: 22,
|
|
349
|
+
url: R.value.url ?? "",
|
|
350
|
+
name: R.value.name,
|
|
351
|
+
size: R.value.size
|
|
352
|
+
}, null, 8, [
|
|
353
|
+
"url",
|
|
354
|
+
"name",
|
|
355
|
+
"size"
|
|
356
|
+
])) : R.value.jks ? (g(), c(b(ct), {
|
|
357
|
+
key: 23,
|
|
358
|
+
url: R.value.url ?? "",
|
|
359
|
+
name: R.value.name,
|
|
360
|
+
size: R.value.size
|
|
361
|
+
}, null, 8, [
|
|
362
|
+
"url",
|
|
363
|
+
"name",
|
|
364
|
+
"size"
|
|
365
|
+
])) : R.value.font ? (g(), c(b(nt), {
|
|
366
|
+
key: 24,
|
|
367
|
+
url: R.value.url ?? "",
|
|
368
|
+
name: R.value.name,
|
|
369
|
+
size: R.value.size
|
|
370
|
+
}, null, 8, [
|
|
371
|
+
"url",
|
|
372
|
+
"name",
|
|
373
|
+
"size"
|
|
374
|
+
])) : R.value.ipynb ? (g(), c(b(rt), {
|
|
375
|
+
key: 25,
|
|
376
|
+
url: R.value.url ?? "",
|
|
377
|
+
name: R.value.name,
|
|
378
|
+
size: R.value.size
|
|
379
|
+
}, null, 8, [
|
|
380
|
+
"url",
|
|
381
|
+
"name",
|
|
382
|
+
"size"
|
|
383
|
+
])) : R.value.audio ? (g(), c(b(lt), {
|
|
384
|
+
key: 26,
|
|
385
|
+
url: R.value.url ?? "",
|
|
386
|
+
name: R.value.name,
|
|
387
|
+
size: R.value.size
|
|
388
|
+
}, null, 8, [
|
|
389
|
+
"url",
|
|
390
|
+
"name",
|
|
391
|
+
"size"
|
|
392
|
+
])) : R.value.qmc ? (g(), c(b(ut), {
|
|
393
|
+
key: 27,
|
|
394
|
+
url: R.value.url ?? "",
|
|
395
|
+
name: R.value.name,
|
|
396
|
+
size: R.value.size
|
|
397
|
+
}, null, 8, [
|
|
398
|
+
"url",
|
|
399
|
+
"name",
|
|
400
|
+
"size"
|
|
401
|
+
])) : R.value.lrc ? (g(), c(b(dt), {
|
|
402
|
+
key: 28,
|
|
403
|
+
url: R.value.url ?? "",
|
|
404
|
+
name: R.value.name,
|
|
405
|
+
size: R.value.size
|
|
406
|
+
}, null, 8, [
|
|
407
|
+
"url",
|
|
408
|
+
"name",
|
|
409
|
+
"size"
|
|
410
|
+
])) : R.value.log ? (g(), c(b(ft), {
|
|
411
|
+
key: 29,
|
|
412
|
+
url: R.value.url ?? "",
|
|
413
|
+
name: R.value.name,
|
|
414
|
+
size: R.value.size
|
|
415
|
+
}, null, 8, [
|
|
416
|
+
"url",
|
|
417
|
+
"name",
|
|
418
|
+
"size"
|
|
419
|
+
])) : R.value.model ? (g(), c(b(pt), {
|
|
420
|
+
key: 30,
|
|
421
|
+
url: R.value.url ?? "",
|
|
422
|
+
name: R.value.name,
|
|
423
|
+
size: R.value.size
|
|
424
|
+
}, null, 8, [
|
|
425
|
+
"url",
|
|
426
|
+
"name",
|
|
427
|
+
"size"
|
|
428
|
+
])) : R.value.raster === "psd" ? (g(), c(b(ht), {
|
|
429
|
+
key: 31,
|
|
430
|
+
url: R.value.url ?? "",
|
|
431
|
+
name: R.value.name,
|
|
432
|
+
size: R.value.size
|
|
433
|
+
}, null, 8, [
|
|
434
|
+
"url",
|
|
435
|
+
"name",
|
|
436
|
+
"size"
|
|
437
|
+
])) : R.value.raster ? (g(), c(b(mt), {
|
|
438
|
+
key: 32,
|
|
439
|
+
url: R.value.url ?? "",
|
|
440
|
+
name: R.value.name,
|
|
441
|
+
size: R.value.size,
|
|
442
|
+
kind: R.value.raster
|
|
443
|
+
}, null, 8, [
|
|
444
|
+
"url",
|
|
445
|
+
"name",
|
|
446
|
+
"size",
|
|
447
|
+
"kind"
|
|
448
|
+
])) : R.value.ebook ? (g(), c(b(gt), {
|
|
449
|
+
key: 33,
|
|
450
|
+
url: R.value.url ?? "",
|
|
451
|
+
name: R.value.name,
|
|
452
|
+
size: R.value.size,
|
|
453
|
+
kind: R.value.ebook
|
|
454
|
+
}, null, 8, [
|
|
455
|
+
"url",
|
|
456
|
+
"name",
|
|
457
|
+
"size",
|
|
458
|
+
"kind"
|
|
459
|
+
])) : R.value.hex ? (g(), c(b(yt), {
|
|
460
|
+
key: 34,
|
|
461
|
+
url: R.value.url ?? "",
|
|
462
|
+
name: R.value.name,
|
|
463
|
+
size: R.value.size
|
|
464
|
+
}, null, 8, [
|
|
465
|
+
"url",
|
|
466
|
+
"name",
|
|
467
|
+
"size"
|
|
468
|
+
])) : R.value.image ? (g(), u("div", pe, [f(se, {
|
|
469
|
+
src: R.value.url ?? "",
|
|
470
|
+
alt: R.value.name
|
|
471
|
+
}, null, 8, ["src", "alt"])])) : R.value.video ? (g(), u("div", me, [d("video", {
|
|
472
|
+
class: "fvb__videoel",
|
|
473
|
+
src: R.value.url ?? "",
|
|
474
|
+
controls: "",
|
|
475
|
+
preload: "metadata"
|
|
476
|
+
}, null, 8, he)])) : R.value.binary ? (g(), u("div", ge, [
|
|
477
|
+
f(a, {
|
|
478
|
+
name: "archive",
|
|
479
|
+
size: 34
|
|
480
|
+
}),
|
|
481
|
+
t[5] ||= d("p", null, "无法预览的二进制文件", -1),
|
|
482
|
+
R.value.size ? (g(), u("p", _e, y(b(re)(R.value.size)), 1)) : l("", !0),
|
|
483
|
+
d("a", {
|
|
484
|
+
class: "fvb__dlbtn",
|
|
485
|
+
href: R.value.url,
|
|
486
|
+
download: R.value.name
|
|
487
|
+
}, "下载", 8, ve),
|
|
488
|
+
d("div", ye, [t[4] ||= d("span", { class: "fvb__openas-label" }, "用查看器打开:", -1), d("div", be, [(g(!0), u(o, null, v(b(i), (e) => (g(), u("button", {
|
|
489
|
+
key: e.key,
|
|
490
|
+
type: "button",
|
|
491
|
+
class: "fvb__fmtchip",
|
|
492
|
+
onClick: (t) => z(e)
|
|
493
|
+
}, [f(a, {
|
|
494
|
+
name: e.icon,
|
|
495
|
+
size: 13
|
|
496
|
+
}, null, 8, ["name"]), d("span", null, y(e.label), 1)], 8, xe))), 128))])])
|
|
497
|
+
])) : B.value === "loading" ? (g(), u("p", Se, "加载文件中…")) : B.value === "error" ? (g(), u("div", S, [d("p", null, "加载失败:" + y(H.value), 1), d("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
class: "fvb__retry",
|
|
500
|
+
onClick: t[0] ||= (e) => $(!0)
|
|
501
|
+
}, "重试")])) : R.value.lang === "markdown" && m.mode === "render" ? (g(), u("div", C, [d("div", w, [Ct.value ? (g(), c(oe, {
|
|
502
|
+
key: 0,
|
|
503
|
+
data: U.value.data
|
|
504
|
+
}, null, 8, ["data"])) : l("", !0), f(b(ae), {
|
|
505
|
+
text: U.value.body,
|
|
506
|
+
kp: "fv"
|
|
507
|
+
}, null, 8, ["text"])])])) : R.value.html && m.mode === "render" ? (g(), u("div", T, [
|
|
508
|
+
d("div", E, [d("button", {
|
|
509
|
+
type: "button",
|
|
510
|
+
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on": q.value }]),
|
|
511
|
+
title: q.value ? "交互脚本已启用(点击禁用)—— 隔离沙箱内运行:可加载外部 CDN 并发起网络请求(fetch/XHR/WebSocket),但无法访问本站会话 / cookie(不透明源隔离)" : "启用交互脚本(隔离沙箱执行:可加载 CDN、可联网,但无法访问本站会话 / cookie;建议先切到源码视图审查再启用)",
|
|
512
|
+
onClick: Z
|
|
513
|
+
}, [f(a, {
|
|
514
|
+
name: "play",
|
|
515
|
+
size: 13
|
|
516
|
+
})], 10, D), d("button", {
|
|
517
|
+
type: "button",
|
|
518
|
+
class: "fvb__htmlbtn",
|
|
519
|
+
title: "全屏预览(在应用内放大查看;可在全屏内开启交互脚本)",
|
|
520
|
+
onClick: t[1] ||= (e) => J.value = !0
|
|
521
|
+
}, [f(a, {
|
|
522
|
+
name: "maximize",
|
|
523
|
+
size: 13
|
|
524
|
+
})])]),
|
|
525
|
+
(g(), u("iframe", {
|
|
526
|
+
key: q.value ? "interactive" : "inert",
|
|
527
|
+
class: "fvb__frame",
|
|
528
|
+
src: Y.value,
|
|
529
|
+
title: "HTML 预览",
|
|
530
|
+
sandbox: q.value ? "allow-scripts" : "",
|
|
531
|
+
loading: "lazy",
|
|
532
|
+
referrerpolicy: "no-referrer"
|
|
533
|
+
}, null, 8, O)),
|
|
534
|
+
(g(), c(ce, { to: "body" }, [J.value ? (g(), u("div", k, [d("div", A, [d("button", {
|
|
535
|
+
type: "button",
|
|
536
|
+
class: h(["fvb__htmlbtn", { "fvb__htmlbtn--on": q.value }]),
|
|
537
|
+
title: q.value ? "交互脚本已启用(点击禁用)—— 隔离沙箱内运行,可联网但访问不到本站会话 / cookie" : "启用交互脚本(隔离沙箱执行:可加载 CDN、可联网,访问不到本站会话 / cookie)",
|
|
538
|
+
onClick: Z
|
|
539
|
+
}, [f(a, {
|
|
540
|
+
name: "play",
|
|
541
|
+
size: 15
|
|
542
|
+
})], 10, j), d("button", {
|
|
543
|
+
type: "button",
|
|
544
|
+
class: "fvb__htmlbtn",
|
|
545
|
+
title: "关闭全屏 (Esc)",
|
|
546
|
+
onClick: t[2] ||= (e) => J.value = !1
|
|
547
|
+
}, [f(a, {
|
|
548
|
+
name: "close",
|
|
549
|
+
size: 15,
|
|
550
|
+
"stroke-width": 2.2
|
|
551
|
+
})])]), (g(), u("iframe", {
|
|
552
|
+
key: q.value ? "fs-interactive" : "fs-inert",
|
|
553
|
+
class: "fvb__fsframe",
|
|
554
|
+
src: Y.value,
|
|
555
|
+
title: "HTML 全屏预览",
|
|
556
|
+
sandbox: q.value ? "allow-scripts" : "",
|
|
557
|
+
referrerpolicy: "no-referrer"
|
|
558
|
+
}, null, 8, Ce))])) : l("", !0)]))
|
|
559
|
+
])) : R.value.svg && m.mode === "render" ? (g(), u("div", we, [d("img", {
|
|
560
|
+
class: "fvb__svgimg",
|
|
561
|
+
src: Tt.value,
|
|
562
|
+
alt: R.value.name
|
|
563
|
+
}, null, 8, Te)])) : St.value && m.mode === "render" ? (g(), u("div", Ee, [f(b(Xe), {
|
|
564
|
+
text: V.value,
|
|
565
|
+
name: R.value.name
|
|
566
|
+
}, null, 8, ["text", "name"])])) : R.value.subtitle && m.mode === "render" ? (g(), u("div", De, [f(b(tt), {
|
|
567
|
+
text: V.value,
|
|
568
|
+
name: R.value.name
|
|
569
|
+
}, null, 8, ["text", "name"])])) : R.value.geo && m.mode === "render" ? (g(), u("div", Oe, [f(b(it), {
|
|
570
|
+
text: V.value,
|
|
571
|
+
name: R.value.name
|
|
572
|
+
}, null, 8, ["text", "name"])])) : R.value.csv && m.mode === "render" ? (g(), u("div", ke, [f(b(at), {
|
|
573
|
+
text: V.value,
|
|
574
|
+
name: R.value.name
|
|
575
|
+
}, null, 8, ["text", "name"])])) : R.value.jsonl && m.mode === "render" ? (g(), u("div", Ae, [f(b(ot), {
|
|
576
|
+
text: V.value,
|
|
577
|
+
name: R.value.name
|
|
578
|
+
}, null, 8, ["text", "name"])])) : R.value.diagram && m.mode === "render" ? (g(), u("div", je, [f(b(_t), {
|
|
579
|
+
text: V.value,
|
|
580
|
+
name: R.value.name,
|
|
581
|
+
kind: R.value.diagram
|
|
582
|
+
}, null, 8, [
|
|
583
|
+
"text",
|
|
584
|
+
"name",
|
|
585
|
+
"kind"
|
|
586
|
+
])])) : (g(), c(ie, {
|
|
587
|
+
key: 49,
|
|
588
|
+
code: wt.value,
|
|
589
|
+
lang: R.value.lang ?? "",
|
|
590
|
+
name: R.value.name
|
|
591
|
+
}, null, 8, [
|
|
592
|
+
"code",
|
|
593
|
+
"lang",
|
|
594
|
+
"name"
|
|
595
|
+
]))]));
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
//#endregion
|
|
599
|
+
export { M as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./FileViewerPanel.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/FileViewerPanel.vue
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-d5e0901b"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|