@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
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @l1yp/file-viewer — public API.
|
|
3
|
+
*
|
|
4
|
+
* See docs/file-viewer-package-design.md for the full design. Quick start:
|
|
5
|
+
*
|
|
6
|
+
* import { FileViewer } from '@l1yp/file-viewer'
|
|
7
|
+
* import '@l1yp/file-viewer/style.css'
|
|
8
|
+
*
|
|
9
|
+
* <FileViewer :src="url" name="report.csv" theme="dark" />
|
|
10
|
+
*
|
|
11
|
+
* Beyond the batteries-included `<FileViewer>`, this barrel also re-exports the shared rendering primitives
|
|
12
|
+
* (markdown engine, highlight, Icon, formatting, fonts, lightbox, …) that the original app's conversation
|
|
13
|
+
* shell consumes — so that shell imports them from here instead of keeping its own copies.
|
|
14
|
+
*/
|
|
15
|
+
import './styles/theme.css';
|
|
16
|
+
export { default as FileViewer } from './FileViewer.vue';
|
|
17
|
+
export { default as FileViewerPanel } from './components/FileViewerPanel.vue';
|
|
18
|
+
export { default as FileViewerBody } from './components/FileViewerBody.vue';
|
|
19
|
+
export { default as MissingDependency } from './components/MissingDependency.vue';
|
|
20
|
+
export { default as ImageLightbox } from './components/ImageLightbox.vue';
|
|
21
|
+
export { default as Icon } from './components/icons/Icon.vue';
|
|
22
|
+
export { default as CodeBlock } from './components/CodeBlock.vue';
|
|
23
|
+
export { default as InlineText } from './components/InlineText';
|
|
24
|
+
export { default as MarkdownText } from './components/MarkdownText';
|
|
25
|
+
export { default as MarkdownTable } from './components/MarkdownTable.vue';
|
|
26
|
+
export { default as MindMapView } from './components/MindMapView.vue';
|
|
27
|
+
export { default as ClampBlock } from './components/ui/ClampBlock';
|
|
28
|
+
export * from './composables/useFileViewer';
|
|
29
|
+
export * from './composables/useLightbox';
|
|
30
|
+
export * from './lib/viewerKind';
|
|
31
|
+
export * from './lib/fileType';
|
|
32
|
+
export * from './lib/diagram';
|
|
33
|
+
export * from './lib/resolveInput';
|
|
34
|
+
export * from './lib/optionalDep';
|
|
35
|
+
export * from './lib/format';
|
|
36
|
+
export * from './lib/fonts';
|
|
37
|
+
export * from './lib/markdown/blocks';
|
|
38
|
+
export * from './lib/markdown/inline';
|
|
39
|
+
export * from './lib/markdown/segmentize';
|
|
40
|
+
export * from './components/icons/iconPaths';
|
|
41
|
+
export * from './lib/zip';
|
|
42
|
+
export * from './lib/qmc';
|
|
43
|
+
export * from './lib/sha1';
|
|
44
|
+
export type { ViewerInput, FetchConfig, LoadFn } from './types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { resolveInput as e } from "./lib/resolveInput.js";
|
|
3
|
+
import { LARGE_TEXT_BYTES as t, ebookKind as n, fileExt as r, hljsLang as i, isAppxFile as a, isAudioFile as o, isBinaryObjFile as s, isCertFile as c, isCsvFile as l, isDicomFile as u, isDocxFile as d, isDxfFile as f, isEmlFile as p, isEplFile as m, isFontFile as h, isGeoFile as g, isHarFile as _, isHprofFile as v, isHtmlFile as y, isImageFile as b, isJavaClassFile as x, isJksFile as S, isJsonlFile as C, isLogFile as w, isLrcFile as T, isMhtFile as E, isMindMapFile as D, isModelFile as O, isMsiFile as k, isNotebookFile as A, isPdfFile as j, isPptxFile as M, isQmcAudioFile as N, isRarFile as P, isRtfFile as F, isSevenZipFile as I, isSqliteFile as L, isSubtitleFile as R, isSvgFile as z, isTarballFile as B, isTextFile as V, isVideoFile as H, isXlsxFile as U, isXmindFile as W, isZipFile as G, rasterImageKind as K } from "./lib/fileType.js";
|
|
4
|
+
import { isDiagramFile as q, renderDiagram as J } from "./lib/diagram.js";
|
|
5
|
+
import { canToggleView as Y, classifyViewerFile as X, mediaMimeForName as Z, skipsTextLoad as Q } from "./lib/viewerKind.js";
|
|
6
|
+
import $ from "./components/MissingDependency.js";
|
|
7
|
+
import { formatBytes as ee, formatDateTime as te, formatDuration as ne, formatSizeCoarse as re } from "./lib/format.js";
|
|
8
|
+
import { FILL_ICONS as ie, STROKE_ICONS as ae } from "./components/icons/iconPaths.js";
|
|
9
|
+
import oe from "./components/icons/Icon.js";
|
|
10
|
+
import { useFileViewer as se } from "./composables/useFileViewer.js";
|
|
11
|
+
import ce from "./components/ui/ClampBlock.js";
|
|
12
|
+
import le from "./components/CodeBlock.js";
|
|
13
|
+
import { useLightbox as ue } from "./composables/useLightbox.js";
|
|
14
|
+
import { MONO as de, SANS as fe, SERIF as pe } from "./lib/fonts.js";
|
|
15
|
+
import { inline as me, renderInline as he } from "./lib/markdown/inline.js";
|
|
16
|
+
import ge from "./components/InlineText.js";
|
|
17
|
+
import _e from "./components/MarkdownTable.js";
|
|
18
|
+
import { md as ve, mdNodes as ye } from "./lib/markdown/blocks.js";
|
|
19
|
+
import be from "./components/MarkdownText.js";
|
|
20
|
+
import xe from "./components/FileViewerBody.js";
|
|
21
|
+
import Se from "./FileViewer.js";
|
|
22
|
+
import Ce from "./components/FileViewerPanel.js";
|
|
23
|
+
import we from "./components/ImageLightbox.js";
|
|
24
|
+
import Te from "./components/MindMapView.js";
|
|
25
|
+
import { isMissingModule as Ee, loadOptionalDep as De } from "./lib/optionalDep.js";
|
|
26
|
+
import { segmentize as Oe } from "./lib/markdown/segmentize.js";
|
|
27
|
+
import { ZipEncryptedError as ke, ZipPasswordError as Ae, extractZipEntry as je, readZip as Me, zipSupported as Ne } from "./lib/zip.js";
|
|
28
|
+
import { QmcError as Pe, decryptEKey as Fe, decryptQmc as Ie, parseFooter as Le } from "./lib/qmc.js";
|
|
29
|
+
import { Sha1 as Re, sha1 as ze } from "./lib/sha1.js";
|
|
30
|
+
export { ce as ClampBlock, le as CodeBlock, ie as FILL_ICONS, Se as FileViewer, xe as FileViewerBody, Ce as FileViewerPanel, oe as Icon, we as ImageLightbox, ge as InlineText, t as LARGE_TEXT_BYTES, de as MONO, _e as MarkdownTable, be as MarkdownText, Te as MindMapView, $ as MissingDependency, Pe as QmcError, fe as SANS, pe as SERIF, ae as STROKE_ICONS, Re as Sha1, ke as ZipEncryptedError, Ae as ZipPasswordError, Y as canToggleView, X as classifyViewerFile, Fe as decryptEKey, Ie as decryptQmc, n as ebookKind, je as extractZipEntry, r as fileExt, ee as formatBytes, te as formatDateTime, ne as formatDuration, re as formatSizeCoarse, i as hljsLang, me as inline, a as isAppxFile, o as isAudioFile, s as isBinaryObjFile, c as isCertFile, l as isCsvFile, q as isDiagramFile, u as isDicomFile, d as isDocxFile, f as isDxfFile, p as isEmlFile, m as isEplFile, h as isFontFile, g as isGeoFile, _ as isHarFile, v as isHprofFile, y as isHtmlFile, b as isImageFile, x as isJavaClassFile, S as isJksFile, C as isJsonlFile, w as isLogFile, T as isLrcFile, E as isMhtFile, D as isMindMapFile, Ee as isMissingModule, O as isModelFile, k as isMsiFile, A as isNotebookFile, j as isPdfFile, M as isPptxFile, N as isQmcAudioFile, P as isRarFile, F as isRtfFile, I as isSevenZipFile, L as isSqliteFile, R as isSubtitleFile, z as isSvgFile, B as isTarballFile, V as isTextFile, H as isVideoFile, U as isXlsxFile, W as isXmindFile, G as isZipFile, De as loadOptionalDep, ve as md, ye as mdNodes, Z as mediaMimeForName, Le as parseFooter, K as rasterImageKind, Me as readZip, J as renderDiagram, he as renderInline, e as resolveInput, Oe as segmentize, ze as sha1, Q as skipsTextLoad, se as useFileViewer, ue as useLightbox, Ne as zipSupported };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact AES shared by the in-browser archive viewers — no dependency, no WASM.
|
|
3
|
+
*
|
|
4
|
+
* The FORWARD cipher drives CTR mode (WinZip-AES ZIP extraction, see {@link lib/zip.ts}); the INVERSE
|
|
5
|
+
* cipher drives CBC decryption (AES-256 encrypted 7z extraction, see {@link lib/sevenZip.ts}). The S-box is
|
|
6
|
+
* generated from the GF(2^8) affine transform (not tabled); the inverse S-box and the GF multiplies for
|
|
7
|
+
* InvMixColumns are derived from it. Key derivation (PBKDF2 / SHA-256) stays in each caller via WebCrypto —
|
|
8
|
+
* this module is pure block/mode math and stays synchronous.
|
|
9
|
+
*
|
|
10
|
+
* State layout is column-major: byte `s[4*col + row]`, matching the AES spec's column words. Encrypt and
|
|
11
|
+
* decrypt share the key schedule and AddRoundKey; only Sub/Shift/Mix differ (forward vs inverse).
|
|
12
|
+
*/
|
|
13
|
+
/** Expand a 16/24/32-byte key into the round-key word schedule. */
|
|
14
|
+
export declare function aesKeySchedule(key: Uint8Array): Uint32Array;
|
|
15
|
+
/** Encrypt one 16-byte block in place into `out` (forward cipher). */
|
|
16
|
+
export declare function aesEncryptBlock(w: Uint32Array, block: Uint8Array, out: Uint8Array): void;
|
|
17
|
+
/** Decrypt one 16-byte block in place into `out` (inverse cipher). */
|
|
18
|
+
export declare function aesDecryptBlock(w: Uint32Array, block: Uint8Array, out: Uint8Array): void;
|
|
19
|
+
/** WinZip AES-CTR keystream (counter is a 16-byte LITTLE-endian integer starting at 1) XORed over `data`. */
|
|
20
|
+
export declare function aesCtrXor(key: Uint8Array, data: Uint8Array): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* AES-CBC decrypt (no padding removal — 7z stores the real output length separately and its ciphertext is a
|
|
23
|
+
* whole number of blocks). `iv` is 16 bytes; only full 16-byte blocks of `data` are processed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function aesCbcDecrypt(key: Uint8Array, iv: Uint8Array, data: Uint8Array): Uint8Array;
|
package/dist/lib/aes.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//#region src/lib/aes.ts
|
|
2
|
+
var e = /* @__PURE__ */ (() => {
|
|
3
|
+
let e = new Uint8Array(256), t = (e, t) => (e << t | e >> 8 - t) & 255, n = 1, r = 1;
|
|
4
|
+
do
|
|
5
|
+
n = (n ^ n << 1 ^ (n & 128 ? 283 : 0)) & 255, r ^= r << 1, r ^= r << 2, r ^= r << 4, r &= 255, r & 128 && (r ^= 9), r &= 255, e[n] = (r ^ t(r, 1) ^ t(r, 2) ^ t(r, 3) ^ t(r, 4) ^ 99) & 255;
|
|
6
|
+
while (n !== 1);
|
|
7
|
+
return e[0] = 99, e;
|
|
8
|
+
})(), t = /* @__PURE__ */ (() => {
|
|
9
|
+
let t = new Uint8Array(256);
|
|
10
|
+
for (let n = 0; n < 256; n++) t[e[n]] = n;
|
|
11
|
+
return t;
|
|
12
|
+
})(), n = new Uint8Array([
|
|
13
|
+
1,
|
|
14
|
+
2,
|
|
15
|
+
4,
|
|
16
|
+
8,
|
|
17
|
+
16,
|
|
18
|
+
32,
|
|
19
|
+
64,
|
|
20
|
+
128,
|
|
21
|
+
27,
|
|
22
|
+
54,
|
|
23
|
+
108
|
|
24
|
+
]), r = (e) => (e << 1 ^ (e & 128 ? 283 : 0)) & 255;
|
|
25
|
+
function i(e, t) {
|
|
26
|
+
let n = 0;
|
|
27
|
+
for (let r = 0; r < 8 && t; r++) {
|
|
28
|
+
t & 1 && (n ^= e);
|
|
29
|
+
let r = e & 128;
|
|
30
|
+
e = e << 1 & 255, r && (e ^= 27), t >>= 1;
|
|
31
|
+
}
|
|
32
|
+
return n & 255;
|
|
33
|
+
}
|
|
34
|
+
function a(t) {
|
|
35
|
+
let r = t.length / 4, i = r + 6, a = new Uint32Array(4 * (i + 1));
|
|
36
|
+
for (let e = 0; e < r; e++) a[e] = (t[4 * e] << 24 | t[4 * e + 1] << 16 | t[4 * e + 2] << 8 | t[4 * e + 3]) >>> 0;
|
|
37
|
+
let o = (t) => (e[t >>> 24 & 255] << 24 | e[t >>> 16 & 255] << 16 | e[t >>> 8 & 255] << 8 | e[t & 255]) >>> 0, s = (e) => (e << 8 | e >>> 24) >>> 0;
|
|
38
|
+
for (let e = r; e < a.length; e++) {
|
|
39
|
+
let t = a[e - 1];
|
|
40
|
+
e % r === 0 ? t = (o(s(t)) ^ n[e / r - 1] << 24) >>> 0 : r > 6 && e % r === 4 && (t = o(t)), a[e] = (a[e - r] ^ t) >>> 0;
|
|
41
|
+
}
|
|
42
|
+
return a;
|
|
43
|
+
}
|
|
44
|
+
function o(e, t, n) {
|
|
45
|
+
for (let r = 0; r < 4; r++) {
|
|
46
|
+
let i = t[n * 4 + r];
|
|
47
|
+
e[4 * r] ^= i >>> 24 & 255, e[4 * r + 1] ^= i >>> 16 & 255, e[4 * r + 2] ^= i >>> 8 & 255, e[4 * r + 3] ^= i & 255;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function s(t, n, i) {
|
|
51
|
+
let a = t.length / 4 - 1, s = i;
|
|
52
|
+
s.set(n), o(s, t, 0);
|
|
53
|
+
for (let n = 1; n <= a; n++) {
|
|
54
|
+
for (let t = 0; t < 16; t++) s[t] = e[s[t]];
|
|
55
|
+
let i = s[1];
|
|
56
|
+
if (s[1] = s[5], s[5] = s[9], s[9] = s[13], s[13] = i, i = s[2], s[2] = s[10], s[10] = i, i = s[6], s[6] = s[14], s[14] = i, i = s[15], s[15] = s[11], s[11] = s[7], s[7] = s[3], s[3] = i, n < a) for (let e = 0; e < 4; e++) {
|
|
57
|
+
let t = 4 * e, n = s[t], i = s[t + 1], a = s[t + 2], o = s[t + 3], c = n ^ i ^ a ^ o;
|
|
58
|
+
s[t] ^= c ^ r(n ^ i), s[t + 1] ^= c ^ r(i ^ a), s[t + 2] ^= c ^ r(a ^ o), s[t + 3] ^= c ^ r(o ^ n);
|
|
59
|
+
}
|
|
60
|
+
o(s, t, n);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function c(e, n, r) {
|
|
64
|
+
let a = e.length / 4 - 1, s = r;
|
|
65
|
+
s.set(n), o(s, e, a);
|
|
66
|
+
for (let n = a - 1; n >= 0; n--) {
|
|
67
|
+
let r = s[13];
|
|
68
|
+
s[13] = s[9], s[9] = s[5], s[5] = s[1], s[1] = r, r = s[2], s[2] = s[10], s[10] = r, r = s[6], s[6] = s[14], s[14] = r, r = s[3], s[3] = s[7], s[7] = s[11], s[11] = s[15], s[15] = r;
|
|
69
|
+
for (let e = 0; e < 16; e++) s[e] = t[s[e]];
|
|
70
|
+
if (o(s, e, n), n > 0) for (let e = 0; e < 4; e++) {
|
|
71
|
+
let t = 4 * e, n = s[t], r = s[t + 1], a = s[t + 2], o = s[t + 3];
|
|
72
|
+
s[t] = i(n, 14) ^ i(r, 11) ^ i(a, 13) ^ i(o, 9), s[t + 1] = i(n, 9) ^ i(r, 14) ^ i(a, 11) ^ i(o, 13), s[t + 2] = i(n, 13) ^ i(r, 9) ^ i(a, 14) ^ i(o, 11), s[t + 3] = i(n, 11) ^ i(r, 13) ^ i(a, 9) ^ i(o, 14);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function l(e, t) {
|
|
77
|
+
let n = a(e), r = new Uint8Array(t.length), i = new Uint8Array(16), o = new Uint8Array(16), c = 1;
|
|
78
|
+
for (let e = 0; e < t.length; e += 16) {
|
|
79
|
+
let a = c++;
|
|
80
|
+
for (let e = 0; e < 8; e++) i[e] = a & 255, a = Math.floor(a / 256);
|
|
81
|
+
s(n, i, o);
|
|
82
|
+
let l = Math.min(16, t.length - e);
|
|
83
|
+
for (let n = 0; n < l; n++) r[e + n] = t[e + n] ^ o[n];
|
|
84
|
+
}
|
|
85
|
+
return r;
|
|
86
|
+
}
|
|
87
|
+
function u(e, t, n) {
|
|
88
|
+
let r = a(e), i = n.length - n.length % 16, o = new Uint8Array(i), s = new Uint8Array(16), l = new Uint8Array(16);
|
|
89
|
+
l.set(t.subarray(0, 16));
|
|
90
|
+
for (let e = 0; e < i; e += 16) {
|
|
91
|
+
let t = n.subarray(e, e + 16);
|
|
92
|
+
c(r, t, s);
|
|
93
|
+
for (let t = 0; t < 16; t++) o[e + t] = s[t] ^ l[t];
|
|
94
|
+
l.set(t);
|
|
95
|
+
}
|
|
96
|
+
return o;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { u as aesCbcDecrypt, l as aesCtrXor };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-browser APPX / MSIX package reader — no dependency beyond the project's own ZIP reader.
|
|
3
|
+
*
|
|
4
|
+
* An `.appx`/`.msix` (and `.appxbundle`/`.msixbundle`) is NOT a PE and NOT an OLE compound file — it's an
|
|
5
|
+
* **OPC ZIP archive** (the same container `.docx`/`.jar` use). Its metadata lives in an XML manifest inside:
|
|
6
|
+
* - a single package: `AppxManifest.xml` — `<Identity>` (name/version/arch/publisher), `<Properties>`
|
|
7
|
+
* (display + publisher names), `<Dependencies>` (target OS + package deps), `<Capabilities>`,
|
|
8
|
+
* `<Applications>`, and the declared `<Resources>` languages.
|
|
9
|
+
* - a bundle: `AppxMetadata/AppxBundleManifest.xml` — `<Identity>` + the list of contained `<Package>`s.
|
|
10
|
+
*
|
|
11
|
+
* We decompress just the manifest with the project's ZIP reader (lib/zip.ts — browser-native DEFLATE) and
|
|
12
|
+
* read the fields with the DOM (namespace-agnostic local-name matching, since real manifests sprinkle uap/
|
|
13
|
+
* rescap/wincap prefixes). The manifest structure was checked against a real Microsoft Store `.appx`.
|
|
14
|
+
*
|
|
15
|
+
* Used by AppxViewer (the side viewer's APPX mode): the bytes come from the same download endpoint as any
|
|
16
|
+
* other file, are unzipped + parsed entirely client-side, and never leave the browser.
|
|
17
|
+
*/
|
|
18
|
+
export interface AppxVersionRef {
|
|
19
|
+
name: string;
|
|
20
|
+
minVersion?: string;
|
|
21
|
+
maxVersionTested?: string;
|
|
22
|
+
publisher?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AppxApp {
|
|
25
|
+
id: string;
|
|
26
|
+
displayName?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AppxBundlePackage {
|
|
30
|
+
type?: string;
|
|
31
|
+
architecture?: string;
|
|
32
|
+
version?: string;
|
|
33
|
+
fileName?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface AppxInfo {
|
|
36
|
+
kind: 'package' | 'bundle';
|
|
37
|
+
/** Identity (`<Identity>`): the package family identity. */
|
|
38
|
+
name?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
architecture?: string;
|
|
41
|
+
/** Raw publisher distinguished name, e.g. "CN=Microsoft Corporation, …". */
|
|
42
|
+
publisher?: string;
|
|
43
|
+
/** `<Properties>` display fields (DisplayName may be an `ms-resource:…` reference we can't resolve here). */
|
|
44
|
+
displayName?: string;
|
|
45
|
+
publisherDisplayName?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
/** `<Dependencies>`: target OS families + package dependencies. */
|
|
48
|
+
targetDeviceFamilies: AppxVersionRef[];
|
|
49
|
+
packageDependencies: AppxVersionRef[];
|
|
50
|
+
/** `<Capabilities>` declared capability names (restricted/device ones included). */
|
|
51
|
+
capabilities: string[];
|
|
52
|
+
/** `<Applications>` entry points. */
|
|
53
|
+
applications: AppxApp[];
|
|
54
|
+
/** Declared resource languages (`<Resources><Resource Language=…>`). */
|
|
55
|
+
languages: string[];
|
|
56
|
+
/** For a bundle: the contained packages. */
|
|
57
|
+
bundlePackages: AppxBundlePackage[];
|
|
58
|
+
/** Number of files in the archive. */
|
|
59
|
+
fileCount: number;
|
|
60
|
+
notes: string[];
|
|
61
|
+
}
|
|
62
|
+
/** Thrown when the bytes aren't an APPX/MSIX (not a zip, or no manifest inside). */
|
|
63
|
+
export declare class NotAppxError extends Error {
|
|
64
|
+
constructor(message: string);
|
|
65
|
+
}
|
|
66
|
+
export declare function parseAppx(buf: ArrayBuffer): Promise<AppxInfo>;
|
package/dist/lib/appx.js
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { extractZipEntry as e, readZip as t } from "./zip.js";
|
|
2
|
+
//#region src/lib/appx.ts
|
|
3
|
+
var n = class extends Error {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
super(e), this.name = "NotAppxError";
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
async function r(r) {
|
|
9
|
+
let i;
|
|
10
|
+
try {
|
|
11
|
+
i = t(r);
|
|
12
|
+
} catch {
|
|
13
|
+
throw new n("不是有效的 APPX/MSIX(无法读取 ZIP 容器)");
|
|
14
|
+
}
|
|
15
|
+
let a = (e) => i.find((t) => t.path.toLowerCase() === e.toLowerCase()), o = a("AppxManifest.xml"), s = a("AppxMetadata/AppxBundleManifest.xml") ?? a("AppxBundleManifest.xml"), u = o ?? s;
|
|
16
|
+
if (!u) throw new n("未找到 AppxManifest.xml(不是 APPX/MSIX 包)");
|
|
17
|
+
let d = await e(r, u), f = new TextDecoder("utf-8").decode(d), p = new DOMParser().parseFromString(f, "application/xml");
|
|
18
|
+
if (p.getElementsByTagName("parsererror").length > 0) throw new n("AppxManifest.xml 解析失败(XML 无效)");
|
|
19
|
+
let m = i.filter((e) => !e.isDir).length;
|
|
20
|
+
return o ? c(p, m) : l(p, m);
|
|
21
|
+
}
|
|
22
|
+
function i(e, t) {
|
|
23
|
+
let n = e.getElementsByTagName("*"), r = [];
|
|
24
|
+
for (let e = 0; e < n.length; e++) n[e].localName === t && r.push(n[e]);
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
function a(e, t) {
|
|
28
|
+
if (!e) return null;
|
|
29
|
+
let n = e.getElementsByTagName("*");
|
|
30
|
+
for (let e = 0; e < n.length; e++) if (n[e].localName === t) return n[e];
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
function o(e, t) {
|
|
34
|
+
let n = e?.getAttribute(t);
|
|
35
|
+
return n == null || n === "" ? void 0 : n;
|
|
36
|
+
}
|
|
37
|
+
function s(e, t) {
|
|
38
|
+
return a(e, t)?.textContent?.trim() || void 0;
|
|
39
|
+
}
|
|
40
|
+
function c(e, t) {
|
|
41
|
+
let n = a(e, "Identity"), r = a(e, "Properties"), c = i(e, "TargetDeviceFamily").map((e) => ({
|
|
42
|
+
name: o(e, "Name") ?? "",
|
|
43
|
+
minVersion: o(e, "MinVersion"),
|
|
44
|
+
maxVersionTested: o(e, "MaxVersionTested")
|
|
45
|
+
})), l = i(e, "PackageDependency").map((e) => ({
|
|
46
|
+
name: o(e, "Name") ?? "",
|
|
47
|
+
minVersion: o(e, "MinVersion"),
|
|
48
|
+
publisher: o(e, "Publisher")
|
|
49
|
+
})), u = [], d = a(e, "Capabilities");
|
|
50
|
+
if (d) {
|
|
51
|
+
let e = d.getElementsByTagName("*");
|
|
52
|
+
for (let t = 0; t < e.length; t++) {
|
|
53
|
+
let n = o(e[t], "Name");
|
|
54
|
+
n && !u.includes(n) && u.push(n);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
let f = i(e, "Application").map((e) => {
|
|
58
|
+
let t = a(e, "VisualElements");
|
|
59
|
+
return {
|
|
60
|
+
id: o(e, "Id") ?? "",
|
|
61
|
+
displayName: o(t, "DisplayName"),
|
|
62
|
+
description: o(t, "Description")
|
|
63
|
+
};
|
|
64
|
+
}), p = [];
|
|
65
|
+
for (let t of i(e, "Resource")) {
|
|
66
|
+
let e = o(t, "Language");
|
|
67
|
+
e && !p.includes(e) && p.push(e);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
kind: "package",
|
|
71
|
+
name: o(n, "Name"),
|
|
72
|
+
version: o(n, "Version"),
|
|
73
|
+
architecture: o(n, "ProcessorArchitecture"),
|
|
74
|
+
publisher: o(n, "Publisher"),
|
|
75
|
+
displayName: s(r, "DisplayName"),
|
|
76
|
+
publisherDisplayName: s(r, "PublisherDisplayName"),
|
|
77
|
+
description: s(r, "Description"),
|
|
78
|
+
targetDeviceFamilies: c,
|
|
79
|
+
packageDependencies: l,
|
|
80
|
+
capabilities: u,
|
|
81
|
+
applications: f,
|
|
82
|
+
languages: p,
|
|
83
|
+
bundlePackages: [],
|
|
84
|
+
fileCount: t,
|
|
85
|
+
notes: []
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function l(e, t) {
|
|
89
|
+
let n = a(e, "Identity"), r = i(e, "Package").map((e) => ({
|
|
90
|
+
type: o(e, "Type"),
|
|
91
|
+
architecture: o(e, "Architecture"),
|
|
92
|
+
version: o(e, "Version"),
|
|
93
|
+
fileName: o(e, "FileName")
|
|
94
|
+
}));
|
|
95
|
+
return {
|
|
96
|
+
kind: "bundle",
|
|
97
|
+
name: o(n, "Name"),
|
|
98
|
+
version: o(n, "Version"),
|
|
99
|
+
architecture: void 0,
|
|
100
|
+
publisher: o(n, "Publisher"),
|
|
101
|
+
targetDeviceFamilies: [],
|
|
102
|
+
packageDependencies: [],
|
|
103
|
+
capabilities: [],
|
|
104
|
+
applications: [],
|
|
105
|
+
languages: [],
|
|
106
|
+
bundlePackages: r,
|
|
107
|
+
fileCount: t,
|
|
108
|
+
notes: []
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
export { n as NotAppxError, r as parseAppx };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A format-agnostic view of a decoded archive, shared by the side viewer's multi-file browsers.
|
|
3
|
+
*
|
|
4
|
+
* The two existing browsers (ZipBrowser / SevenZipBrowser) each bake in their own entry type and
|
|
5
|
+
* extraction call. The newer formats — the tar family (tar/gz/xz/bz2, see {@link lib/tarball}) and rar
|
|
6
|
+
* (see {@link lib/rar}) — instead expose this common shape so a single {@link ArchiveBrowser} component
|
|
7
|
+
* can browse any of them: a flat entry list plus an `extract(entry)` that yields one file's bytes.
|
|
8
|
+
*
|
|
9
|
+
* `ref` is a producer-private handle (an index into the opener's own metadata) so `extract` can locate a
|
|
10
|
+
* file's bytes without the consumer knowing the format's internals. Extraction may be sync (tar slices a
|
|
11
|
+
* decoded buffer) or async (rar calls into a WASM extractor), hence the union return.
|
|
12
|
+
*/
|
|
13
|
+
export interface ArchiveEntry {
|
|
14
|
+
/** Full path within the archive, forward-slashed, e.g. "src/app.ts". */
|
|
15
|
+
path: string;
|
|
16
|
+
/** Basename (last path segment). */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Uncompressed size in bytes (0 for directories). */
|
|
19
|
+
size: number;
|
|
20
|
+
/** Directory entry. */
|
|
21
|
+
isDir: boolean;
|
|
22
|
+
/** Producer-internal handle consumed by {@link OpenedArchive.extract}; opaque to callers. */
|
|
23
|
+
ref: number;
|
|
24
|
+
}
|
|
25
|
+
export interface OpenedArchive {
|
|
26
|
+
entries: ArchiveEntry[];
|
|
27
|
+
/** Yield one entry's decompressed bytes. Returns an empty array for directories. */
|
|
28
|
+
extract(entry: ArchiveEntry): Uint8Array | Promise<Uint8Array>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal, zero-dependency ASN.1 DER decoder for the certificate viewer (lib/x509.ts + CertViewer.vue).
|
|
3
|
+
*
|
|
4
|
+
* Decodes the tag/length/value tree; constructed types recurse. Enough to walk X.509 / PKCS#10 / PKCS#7 /
|
|
5
|
+
* PKCS#12 structures and render a generic, collapsible structure tree. It is NOT a validator — it tolerates
|
|
6
|
+
* and surfaces partial / malformed input (bailing on no-progress) rather than throwing, so a weird file shows
|
|
7
|
+
* what could be decoded instead of a blank error.
|
|
8
|
+
*/
|
|
9
|
+
export interface Asn1Node {
|
|
10
|
+
tagClass: number;
|
|
11
|
+
constructed: boolean;
|
|
12
|
+
tagNumber: number;
|
|
13
|
+
start: number;
|
|
14
|
+
headerLen: number;
|
|
15
|
+
length: number;
|
|
16
|
+
content: Uint8Array;
|
|
17
|
+
children: Asn1Node[];
|
|
18
|
+
}
|
|
19
|
+
export declare const TAG: {
|
|
20
|
+
readonly BOOLEAN: 1;
|
|
21
|
+
readonly INTEGER: 2;
|
|
22
|
+
readonly BIT_STRING: 3;
|
|
23
|
+
readonly OCTET_STRING: 4;
|
|
24
|
+
readonly NULL: 5;
|
|
25
|
+
readonly OID: 6;
|
|
26
|
+
readonly UTF8String: 12;
|
|
27
|
+
readonly SEQUENCE: 16;
|
|
28
|
+
readonly SET: 17;
|
|
29
|
+
readonly PrintableString: 19;
|
|
30
|
+
readonly IA5String: 22;
|
|
31
|
+
readonly UTCTime: 23;
|
|
32
|
+
readonly GeneralizedTime: 24;
|
|
33
|
+
};
|
|
34
|
+
/** Decode every TLV in [start, end) into a forest of nodes. */
|
|
35
|
+
export declare function decodeAsn1(buf: Uint8Array, start?: number, end?: number): Asn1Node[];
|
|
36
|
+
/** Display name for a node's tag (universal type name, or `[n]` for context-specific). */
|
|
37
|
+
export declare function tagName(node: Asn1Node): string;
|
|
38
|
+
/** Decode OID content bytes → dotted-decimal string. */
|
|
39
|
+
export declare function oidToString(bytes: Uint8Array): string;
|
|
40
|
+
export declare function bytesToHex(bytes: Uint8Array, sep?: string): string;
|
|
41
|
+
/** Decode a string-typed node's content as UTF-8 text (falls back to hex for odd bytes). */
|
|
42
|
+
export declare function asn1String(node: Asn1Node): string;
|
|
43
|
+
/** Decode a UTCTime / GeneralizedTime node → human text + epoch ms, or null if unparseable. */
|
|
44
|
+
export declare function asn1Time(node: Asn1Node): {
|
|
45
|
+
text: string;
|
|
46
|
+
ms: number;
|
|
47
|
+
} | null;
|
package/dist/lib/asn1.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region src/lib/asn1.ts
|
|
2
|
+
var e = {
|
|
3
|
+
BOOLEAN: 1,
|
|
4
|
+
INTEGER: 2,
|
|
5
|
+
BIT_STRING: 3,
|
|
6
|
+
OCTET_STRING: 4,
|
|
7
|
+
NULL: 5,
|
|
8
|
+
OID: 6,
|
|
9
|
+
UTF8String: 12,
|
|
10
|
+
SEQUENCE: 16,
|
|
11
|
+
SET: 17,
|
|
12
|
+
PrintableString: 19,
|
|
13
|
+
IA5String: 22,
|
|
14
|
+
UTCTime: 23,
|
|
15
|
+
GeneralizedTime: 24
|
|
16
|
+
};
|
|
17
|
+
function t(e, t = 0, r = e.length) {
|
|
18
|
+
let i = [], a = t;
|
|
19
|
+
for (; a < r;) {
|
|
20
|
+
let t = n(e, a, r);
|
|
21
|
+
if (!t) break;
|
|
22
|
+
i.push(t);
|
|
23
|
+
let o = t.start + t.headerLen + t.length;
|
|
24
|
+
if (o <= a) break;
|
|
25
|
+
a = o;
|
|
26
|
+
}
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
function n(e, n, r) {
|
|
30
|
+
let i = n;
|
|
31
|
+
if (i >= r) return null;
|
|
32
|
+
let a = e[i++], o = a >> 6, s = (a & 32) != 0, c = a & 31;
|
|
33
|
+
if (c === 31) for (c = 0; i < r;) {
|
|
34
|
+
let t = e[i++];
|
|
35
|
+
if (c = c << 7 | t & 127, !(t & 128)) break;
|
|
36
|
+
}
|
|
37
|
+
if (i >= r) return null;
|
|
38
|
+
let l = e[i++];
|
|
39
|
+
if (l & 128) {
|
|
40
|
+
let t = l & 127;
|
|
41
|
+
if (t === 0 || t > 4 || i + t > r) l = r - i;
|
|
42
|
+
else {
|
|
43
|
+
l = 0;
|
|
44
|
+
for (let n = 0; n < t; n++) l = l * 256 + e[i++];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
let u = i, d = Math.min(r, u + l), f = {
|
|
48
|
+
tagClass: o,
|
|
49
|
+
constructed: s,
|
|
50
|
+
tagNumber: c,
|
|
51
|
+
start: n,
|
|
52
|
+
headerLen: u - n,
|
|
53
|
+
length: d - u,
|
|
54
|
+
content: e.subarray(u, d),
|
|
55
|
+
children: []
|
|
56
|
+
};
|
|
57
|
+
return s && (f.children = t(e, u, d)), f;
|
|
58
|
+
}
|
|
59
|
+
var r = {
|
|
60
|
+
1: "BOOLEAN",
|
|
61
|
+
2: "INTEGER",
|
|
62
|
+
3: "BIT STRING",
|
|
63
|
+
4: "OCTET STRING",
|
|
64
|
+
5: "NULL",
|
|
65
|
+
6: "OBJECT IDENTIFIER",
|
|
66
|
+
10: "ENUMERATED",
|
|
67
|
+
12: "UTF8String",
|
|
68
|
+
13: "RELATIVE-OID",
|
|
69
|
+
16: "SEQUENCE",
|
|
70
|
+
17: "SET",
|
|
71
|
+
18: "NumericString",
|
|
72
|
+
19: "PrintableString",
|
|
73
|
+
20: "TeletexString",
|
|
74
|
+
22: "IA5String",
|
|
75
|
+
23: "UTCTime",
|
|
76
|
+
24: "GeneralizedTime",
|
|
77
|
+
26: "VisibleString",
|
|
78
|
+
27: "GeneralString",
|
|
79
|
+
28: "UniversalString",
|
|
80
|
+
30: "BMPString"
|
|
81
|
+
};
|
|
82
|
+
function i(e) {
|
|
83
|
+
return e.tagClass === 2 ? `[${e.tagNumber}]` : e.tagClass === 1 ? `APPLICATION ${e.tagNumber}` : e.tagClass === 3 ? `PRIVATE ${e.tagNumber}` : r[e.tagNumber] ?? `TAG ${e.tagNumber}`;
|
|
84
|
+
}
|
|
85
|
+
function a(e) {
|
|
86
|
+
if (!e.length) return "";
|
|
87
|
+
let t = [Math.floor(e[0] / 40), e[0] % 40], n = 0;
|
|
88
|
+
for (let r = 1; r < e.length; r++) n = n * 128 + (e[r] & 127), e[r] & 128 || (t.push(n), n = 0);
|
|
89
|
+
return t.join(".");
|
|
90
|
+
}
|
|
91
|
+
function o(e, t = "") {
|
|
92
|
+
let n = "";
|
|
93
|
+
for (let r = 0; r < e.length; r++) n += e[r].toString(16).padStart(2, "0"), t && r < e.length - 1 && (n += t);
|
|
94
|
+
return n;
|
|
95
|
+
}
|
|
96
|
+
function s(e) {
|
|
97
|
+
try {
|
|
98
|
+
return new TextDecoder("utf-8").decode(e.content);
|
|
99
|
+
} catch {
|
|
100
|
+
return o(e.content);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function c(e, t, n, r, i, a) {
|
|
104
|
+
let o = Date.UTC(e, parseInt(t, 10) - 1, parseInt(n, 10), parseInt(r, 10), parseInt(i, 10), a ? parseInt(a, 10) : 0);
|
|
105
|
+
return {
|
|
106
|
+
text: `${e}-${t}-${n} ${r}:${i}:${a ?? "00"} UTC`,
|
|
107
|
+
ms: o
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function l(t) {
|
|
111
|
+
let n = new TextDecoder("latin1").decode(t.content).trim();
|
|
112
|
+
if (t.tagNumber === e.UTCTime) {
|
|
113
|
+
let e = n.match(/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})?/);
|
|
114
|
+
if (!e) return null;
|
|
115
|
+
let t = parseInt(e[1], 10);
|
|
116
|
+
return c(t < 50 ? 2e3 + t : 1900 + t, e[2], e[3], e[4], e[5], e[6]);
|
|
117
|
+
}
|
|
118
|
+
let r = n.match(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})?/);
|
|
119
|
+
return r ? c(parseInt(r[1], 10), r[2], r[3], r[4], r[5], r[6]) : null;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { e as TAG, s as asn1String, l as asn1Time, o as bytesToHex, t as decodeAsn1, a as oidToString, i as tagName };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-browser ELF / PE symbol reader — no dependency, no WASM.
|
|
3
|
+
*
|
|
4
|
+
* Parses just enough of the container to list its *function symbols* — name, virtual address, and
|
|
5
|
+
* (when the table records it) size. Mirrors {@link lib/zip.ts}: hand-rolled structural parsing over a
|
|
6
|
+
* DataView, decoding only what conversation artifacts actually ship — `.so` shared objects (ELF) and
|
|
7
|
+
* `.dll` libraries (PE). It deliberately does NOT disassemble: turning machine code into mnemonics
|
|
8
|
+
* needs a real engine (Capstone/WASM), which is out of scope for this "what functions are in here?" view.
|
|
9
|
+
*
|
|
10
|
+
* - ELF: walks the section table and reads `.symtab` (full symbols) or, when stripped, `.dynsym`
|
|
11
|
+
* (dynamic/exported symbols only), keeping the `STT_FUNC`/`STT_GNU_IFUNC` entries that are
|
|
12
|
+
* defined in this object (not undefined imports).
|
|
13
|
+
* - PE: reads the export directory — the only symbols a DLL normally carries without a separate PDB.
|
|
14
|
+
*
|
|
15
|
+
* Beyond symbols it also lifts human-facing METADATA (see {@link BinMeta}):
|
|
16
|
+
* - ELF: header type/ABI/entry, the program interpreter (PT_INTERP), and the dynamic section's SONAME /
|
|
17
|
+
* NEEDED libraries / RPATH-RUNPATH, plus the GNU build-id note.
|
|
18
|
+
* - PE: the COFF/optional-header subsystem + kind + link time, and — parsed from the resource directory —
|
|
19
|
+
* the VS_VERSIONINFO strings (company / product / version / copyright …) and the embedded ICON, which
|
|
20
|
+
* is repackaged into a tiny .ico and surfaced as a data URL for inline display.
|
|
21
|
+
*
|
|
22
|
+
* Used by BinObjBrowser (the side viewer's binary-object mode): the bytes come from the same download
|
|
23
|
+
* endpoint as any other file, are parsed entirely client-side, and never leave the browser.
|
|
24
|
+
*/
|
|
25
|
+
export type BinObjFormat = 'elf' | 'pe';
|
|
26
|
+
/** A human-facing metadata row (label + value) shown above the symbol list. */
|
|
27
|
+
export interface BinMeta {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}
|
|
31
|
+
export interface BinSymbol {
|
|
32
|
+
/** Symbol name as stored — NOT demangled (C++ names stay mangled, e.g. `_ZN3foo3barEv`). */
|
|
33
|
+
name: string;
|
|
34
|
+
/** Virtual address (ELF `st_value`) or RVA (PE export). For a PIC `.so` this is a load-base offset. */
|
|
35
|
+
address: number;
|
|
36
|
+
/** Size in bytes when the table records it (ELF `st_size`); undefined for PE exports. */
|
|
37
|
+
size?: number;
|
|
38
|
+
/** Symbol kind: ELF type lowercased (`func` / `ifunc`), or `export` for PE. */
|
|
39
|
+
kind: string;
|
|
40
|
+
/** ELF binding (`local` / `global` / `weak`); undefined for PE. */
|
|
41
|
+
bind?: string;
|
|
42
|
+
/** Where it came from: `.symtab` / `.dynsym` (ELF) or `export` (PE). */
|
|
43
|
+
source: string;
|
|
44
|
+
/** PE export ordinal (Base + index), when applicable. */
|
|
45
|
+
ordinal?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface BinObjInfo {
|
|
48
|
+
format: BinObjFormat;
|
|
49
|
+
/** Human architecture label, e.g. `x86-64`, `aarch64`, `i386`, `arm`. */
|
|
50
|
+
arch: string;
|
|
51
|
+
bits: 32 | 64;
|
|
52
|
+
endian: 'le' | 'be';
|
|
53
|
+
/** True when no full symbol table was available (ELF: only `.dynsym`; PE: always — exports only). */
|
|
54
|
+
stripped: boolean;
|
|
55
|
+
/** Defined function symbols, sorted by address. */
|
|
56
|
+
symbols: BinSymbol[];
|
|
57
|
+
/** Human note explaining an empty/partial list (e.g. fully stripped, or a PE with no exports). */
|
|
58
|
+
note?: string;
|
|
59
|
+
/** Human-facing metadata rows (ELF header/dynamic, PE version-info), shown as a card above the symbols. */
|
|
60
|
+
meta: BinMeta[];
|
|
61
|
+
/** PE icon repackaged as a tiny .ico and encoded as a data URL, when an icon resource was decoded. */
|
|
62
|
+
iconDataUrl?: string;
|
|
63
|
+
}
|
|
64
|
+
/** Thrown when the bytes aren't a recognized ELF or PE container. */
|
|
65
|
+
export declare class UnsupportedBinaryError extends Error {
|
|
66
|
+
constructor(message: string);
|
|
67
|
+
}
|
|
68
|
+
/** Recognize the container by magic and dispatch. Throws {@link UnsupportedBinaryError} otherwise. */
|
|
69
|
+
export declare function parseBinObj(buf: ArrayBuffer): BinObjInfo;
|