@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.
Files changed (373) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/dist/FileViewer.js +7 -0
  4. package/dist/FileViewer.vue.d.ts +37 -0
  5. package/dist/FileViewer.vue_vue_type_script_setup_true_lang.js +103 -0
  6. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  7. package/dist/components/AppxViewer.js +7 -0
  8. package/dist/components/AppxViewer.vue.d.ts +18 -0
  9. package/dist/components/AppxViewer.vue_vue_type_script_setup_true_lang.js +174 -0
  10. package/dist/components/ArchiveBrowser.js +7 -0
  11. package/dist/components/ArchiveBrowser.vue.d.ts +18 -0
  12. package/dist/components/ArchiveBrowser.vue_vue_type_script_setup_true_lang.js +279 -0
  13. package/dist/components/AudioViewer.js +7 -0
  14. package/dist/components/AudioViewer.vue.d.ts +21 -0
  15. package/dist/components/AudioViewer.vue_vue_type_script_setup_true_lang.js +201 -0
  16. package/dist/components/BinObjBrowser.js +7 -0
  17. package/dist/components/BinObjBrowser.vue.d.ts +19 -0
  18. package/dist/components/BinObjBrowser.vue_vue_type_script_setup_true_lang.js +141 -0
  19. package/dist/components/CertViewer.js +7 -0
  20. package/dist/components/CertViewer.vue.d.ts +17 -0
  21. package/dist/components/CertViewer.vue_vue_type_script_setup_true_lang.js +251 -0
  22. package/dist/components/ClassViewer.js +7 -0
  23. package/dist/components/ClassViewer.vue.d.ts +15 -0
  24. package/dist/components/ClassViewer.vue_vue_type_script_setup_true_lang.js +164 -0
  25. package/dist/components/CodeBlock.js +7 -0
  26. package/dist/components/CodeBlock.vue.d.ts +17 -0
  27. package/dist/components/CodeBlock.vue_vue_type_script_setup_true_lang.js +79 -0
  28. package/dist/components/CodeView.js +7 -0
  29. package/dist/components/CodeView.vue.d.ts +21 -0
  30. package/dist/components/CodeView.vue_vue_type_script_setup_true_lang.js +180 -0
  31. package/dist/components/CsvViewer.js +7 -0
  32. package/dist/components/CsvViewer.vue.d.ts +26 -0
  33. package/dist/components/CsvViewer.vue_vue_type_script_setup_true_lang.js +187 -0
  34. package/dist/components/DicomViewer.js +7 -0
  35. package/dist/components/DicomViewer.vue.d.ts +30 -0
  36. package/dist/components/DicomViewer.vue_vue_type_script_setup_true_lang.js +362 -0
  37. package/dist/components/DocxViewer.js +7 -0
  38. package/dist/components/DocxViewer.vue.d.ts +19 -0
  39. package/dist/components/DocxViewer.vue_vue_type_script_setup_true_lang.js +59 -0
  40. package/dist/components/DrawioViewer.js +7 -0
  41. package/dist/components/DrawioViewer.vue.d.ts +16 -0
  42. package/dist/components/DrawioViewer.vue_vue_type_script_setup_true_lang.js +38 -0
  43. package/dist/components/DxfViewer.js +7 -0
  44. package/dist/components/DxfViewer.vue.d.ts +14 -0
  45. package/dist/components/DxfViewer.vue_vue_type_script_setup_true_lang.js +239 -0
  46. package/dist/components/EbookViewer.js +7 -0
  47. package/dist/components/EbookViewer.vue.d.ts +22 -0
  48. package/dist/components/EbookViewer.vue_vue_type_script_setup_true_lang.js +170 -0
  49. package/dist/components/EmlViewer.js +7 -0
  50. package/dist/components/EmlViewer.vue.d.ts +21 -0
  51. package/dist/components/EmlViewer.vue_vue_type_script_setup_true_lang.js +193 -0
  52. package/dist/components/EplViewer.js +7 -0
  53. package/dist/components/EplViewer.vue.d.ts +19 -0
  54. package/dist/components/EplViewer.vue_vue_type_script_setup_true_lang.js +201 -0
  55. package/dist/components/FileViewerBody.js +7 -0
  56. package/dist/components/FileViewerBody.vue.d.ts +47 -0
  57. package/dist/components/FileViewerBody.vue_vue_type_script_setup_true_lang.js +599 -0
  58. package/dist/components/FileViewerPanel.js +7 -0
  59. package/dist/components/FileViewerPanel.vue.d.ts +3 -0
  60. package/dist/components/FileViewerPanel.vue_vue_type_script_setup_true_lang.js +207 -0
  61. package/dist/components/FontViewer.js +7 -0
  62. package/dist/components/FontViewer.vue.d.ts +17 -0
  63. package/dist/components/FontViewer.vue_vue_type_script_setup_true_lang.js +120 -0
  64. package/dist/components/FrontmatterCard.js +7 -0
  65. package/dist/components/FrontmatterCard.vue.d.ts +11 -0
  66. package/dist/components/FrontmatterCard.vue_vue_type_script_setup_true_lang.js +30 -0
  67. package/dist/components/GeoViewer.js +7 -0
  68. package/dist/components/GeoViewer.vue.d.ts +17 -0
  69. package/dist/components/GeoViewer.vue_vue_type_script_setup_true_lang.js +255 -0
  70. package/dist/components/HarViewer.js +7 -0
  71. package/dist/components/HarViewer.vue.d.ts +20 -0
  72. package/dist/components/HarViewer.vue_vue_type_script_setup_true_lang.js +322 -0
  73. package/dist/components/HexViewer.js +7 -0
  74. package/dist/components/HexViewer.vue.d.ts +22 -0
  75. package/dist/components/HexViewer.vue_vue_type_script_setup_true_lang.js +121 -0
  76. package/dist/components/HprofViewer.js +7 -0
  77. package/dist/components/HprofViewer.vue.d.ts +27 -0
  78. package/dist/components/HprofViewer.vue_vue_type_script_setup_true_lang.js +561 -0
  79. package/dist/components/ImageLightbox.js +7 -0
  80. package/dist/components/ImageLightbox.vue.d.ts +3 -0
  81. package/dist/components/ImageLightbox.vue_vue_type_script_setup_true_lang.js +86 -0
  82. package/dist/components/InlineText.d.ts +29 -0
  83. package/dist/components/InlineText.js +21 -0
  84. package/dist/components/JksViewer.js +7 -0
  85. package/dist/components/JksViewer.vue.d.ts +22 -0
  86. package/dist/components/JksViewer.vue_vue_type_script_setup_true_lang.js +353 -0
  87. package/dist/components/JsonlViewer.js +7 -0
  88. package/dist/components/JsonlViewer.vue.d.ts +15 -0
  89. package/dist/components/JsonlViewer.vue_vue_type_script_setup_true_lang.js +103 -0
  90. package/dist/components/LogViewer.js +7 -0
  91. package/dist/components/LogViewer.vue.d.ts +29 -0
  92. package/dist/components/LogViewer.vue_vue_type_script_setup_true_lang.js +670 -0
  93. package/dist/components/LrcViewer.js +7 -0
  94. package/dist/components/LrcViewer.vue.d.ts +17 -0
  95. package/dist/components/LrcViewer.vue_vue_type_script_setup_true_lang.js +106 -0
  96. package/dist/components/MarkdownTable.js +7 -0
  97. package/dist/components/MarkdownTable.vue.d.ts +19 -0
  98. package/dist/components/MarkdownTable.vue_vue_type_script_setup_true_lang.js +71 -0
  99. package/dist/components/MarkdownText.d.ts +30 -0
  100. package/dist/components/MarkdownText.js +21 -0
  101. package/dist/components/MhtViewer.js +7 -0
  102. package/dist/components/MhtViewer.vue.d.ts +22 -0
  103. package/dist/components/MhtViewer.vue_vue_type_script_setup_true_lang.js +112 -0
  104. package/dist/components/MindMapView.js +7 -0
  105. package/dist/components/MindMapView.vue.d.ts +23 -0
  106. package/dist/components/MindMapView.vue_vue_type_script_setup_true_lang.js +337 -0
  107. package/dist/components/MissingDependency.js +7 -0
  108. package/dist/components/MissingDependency.vue.d.ts +17 -0
  109. package/dist/components/MissingDependency.vue_vue_type_script_setup_true_lang.js +37 -0
  110. package/dist/components/ModelViewer.js +7 -0
  111. package/dist/components/ModelViewer.vue.d.ts +18 -0
  112. package/dist/components/ModelViewer.vue_vue_type_script_setup_true_lang.js +157 -0
  113. package/dist/components/MsiViewer.js +7 -0
  114. package/dist/components/MsiViewer.vue.d.ts +19 -0
  115. package/dist/components/MsiViewer.vue_vue_type_script_setup_true_lang.js +136 -0
  116. package/dist/components/NotebookViewer.js +7 -0
  117. package/dist/components/NotebookViewer.vue.d.ts +20 -0
  118. package/dist/components/NotebookViewer.vue_vue_type_script_setup_true_lang.js +125 -0
  119. package/dist/components/PdfViewer.js +7 -0
  120. package/dist/components/PdfViewer.vue.d.ts +19 -0
  121. package/dist/components/PdfViewer.vue_vue_type_script_setup_true_lang.js +114 -0
  122. package/dist/components/PptxViewer.js +7 -0
  123. package/dist/components/PptxViewer.vue.d.ts +20 -0
  124. package/dist/components/PptxViewer.vue_vue_type_script_setup_true_lang.js +73 -0
  125. package/dist/components/PsdViewer.js +7 -0
  126. package/dist/components/PsdViewer.vue.d.ts +15 -0
  127. package/dist/components/PsdViewer.vue_vue_type_script_setup_true_lang.js +218 -0
  128. package/dist/components/QmcAudioViewer.js +7 -0
  129. package/dist/components/QmcAudioViewer.vue.d.ts +18 -0
  130. package/dist/components/QmcAudioViewer.vue_vue_type_script_setup_true_lang.js +92 -0
  131. package/dist/components/RasterViewer.js +7 -0
  132. package/dist/components/RasterViewer.vue.d.ts +21 -0
  133. package/dist/components/RasterViewer.vue_vue_type_script_setup_true_lang.js +161 -0
  134. package/dist/components/RtfViewer.js +7 -0
  135. package/dist/components/RtfViewer.vue.d.ts +21 -0
  136. package/dist/components/RtfViewer.vue_vue_type_script_setup_true_lang.js +66 -0
  137. package/dist/components/SevenZipBrowser.js +7 -0
  138. package/dist/components/SevenZipBrowser.vue.d.ts +13 -0
  139. package/dist/components/SevenZipBrowser.vue_vue_type_script_setup_true_lang.js +366 -0
  140. package/dist/components/SqliteViewer.js +7 -0
  141. package/dist/components/SqliteViewer.vue.d.ts +18 -0
  142. package/dist/components/SqliteViewer.vue_vue_type_script_setup_true_lang.js +186 -0
  143. package/dist/components/SubtitleViewer.js +7 -0
  144. package/dist/components/SubtitleViewer.vue.d.ts +15 -0
  145. package/dist/components/SubtitleViewer.vue_vue_type_script_setup_true_lang.js +48 -0
  146. package/dist/components/XlsxChart.js +7 -0
  147. package/dist/components/XlsxChart.vue.d.ts +14 -0
  148. package/dist/components/XlsxChart.vue_vue_type_script_setup_true_lang.js +240 -0
  149. package/dist/components/XlsxViewer.js +7 -0
  150. package/dist/components/XlsxViewer.vue.d.ts +22 -0
  151. package/dist/components/XlsxViewer.vue_vue_type_script_setup_true_lang.js +814 -0
  152. package/dist/components/XmindViewer.js +7 -0
  153. package/dist/components/XmindViewer.vue.d.ts +13 -0
  154. package/dist/components/XmindViewer.vue_vue_type_script_setup_true_lang.js +48 -0
  155. package/dist/components/ZipBrowser.js +7 -0
  156. package/dist/components/ZipBrowser.vue.d.ts +14 -0
  157. package/dist/components/ZipBrowser.vue_vue_type_script_setup_true_lang.js +326 -0
  158. package/dist/components/ZoomImage.js +7 -0
  159. package/dist/components/ZoomImage.vue.d.ts +29 -0
  160. package/dist/components/ZoomImage.vue_vue_type_script_setup_true_lang.js +147 -0
  161. package/dist/components/epl/EplCodeBlock.js +7 -0
  162. package/dist/components/epl/EplCodeBlock.vue.d.ts +15 -0
  163. package/dist/components/epl/EplCodeBlock.vue_vue_type_script_setup_true_lang.js +72 -0
  164. package/dist/components/epl/EplDoc.js +7 -0
  165. package/dist/components/epl/EplDoc.vue.d.ts +19 -0
  166. package/dist/components/epl/EplDoc.vue_vue_type_script_setup_true_lang.js +327 -0
  167. package/dist/components/epl/EplMethod.js +7 -0
  168. package/dist/components/epl/EplMethod.vue.d.ts +14 -0
  169. package/dist/components/epl/EplMethod.vue_vue_type_script_setup_true_lang.js +100 -0
  170. package/dist/components/epl/EplResource.js +7 -0
  171. package/dist/components/epl/EplResource.vue.d.ts +15 -0
  172. package/dist/components/epl/EplResource.vue_vue_type_script_setup_true_lang.js +204 -0
  173. package/dist/components/epl/EplTree.js +7 -0
  174. package/dist/components/epl/EplTree.vue.d.ts +27 -0
  175. package/dist/components/epl/EplTree.vue_vue_type_script_setup_true_lang.js +123 -0
  176. package/dist/components/epl/EplVarTable.js +7 -0
  177. package/dist/components/epl/EplVarTable.vue.d.ts +21 -0
  178. package/dist/components/epl/EplVarTable.vue_vue_type_script_setup_true_lang.js +60 -0
  179. package/dist/components/epl/docTypes.d.ts +12 -0
  180. package/dist/components/epl/numbering.d.ts +21 -0
  181. package/dist/components/epl/numbering.js +14 -0
  182. package/dist/components/icons/Icon.js +7 -0
  183. package/dist/components/icons/Icon.vue.d.ts +14 -0
  184. package/dist/components/icons/Icon.vue_vue_type_script_setup_true_lang.js +33 -0
  185. package/dist/components/icons/iconPaths.d.ts +60 -0
  186. package/dist/components/icons/iconPaths.js +54 -0
  187. package/dist/components/optionalViewer.d.ts +14 -0
  188. package/dist/components/optionalViewer.js +37 -0
  189. package/dist/components/ui/ClampBlock.d.ts +82 -0
  190. package/dist/components/ui/ClampBlock.js +63 -0
  191. package/dist/composables/useFileViewer.d.ts +428 -0
  192. package/dist/composables/useFileViewer.js +27 -0
  193. package/dist/composables/useLightbox.d.ts +33 -0
  194. package/dist/composables/useLightbox.js +17 -0
  195. package/dist/composables/useLogRules.d.ts +47 -0
  196. package/dist/composables/useLogRules.js +74 -0
  197. package/dist/index.d.ts +44 -0
  198. package/dist/index.js +30 -0
  199. package/dist/lib/aes.d.ts +25 -0
  200. package/dist/lib/aes.js +99 -0
  201. package/dist/lib/appx.d.ts +66 -0
  202. package/dist/lib/appx.js +112 -0
  203. package/dist/lib/archive.d.ts +29 -0
  204. package/dist/lib/asn1.d.ts +47 -0
  205. package/dist/lib/asn1.js +122 -0
  206. package/dist/lib/binobj.d.ts +69 -0
  207. package/dist/lib/binobj.js +430 -0
  208. package/dist/lib/brotli.d.ts +14 -0
  209. package/dist/lib/brotli.js +16 -0
  210. package/dist/lib/bzip2.d.ts +14 -0
  211. package/dist/lib/bzip2.js +161 -0
  212. package/dist/lib/classfile.d.ts +72 -0
  213. package/dist/lib/classfile.js +210 -0
  214. package/dist/lib/codePreview.d.ts +22 -0
  215. package/dist/lib/codePreview.js +27 -0
  216. package/dist/lib/codefold.d.ts +14 -0
  217. package/dist/lib/codefold.js +30 -0
  218. package/dist/lib/codeformat.d.ts +21 -0
  219. package/dist/lib/codeformat.js +130 -0
  220. package/dist/lib/csv.d.ts +19 -0
  221. package/dist/lib/csv.js +74 -0
  222. package/dist/lib/des.d.ts +17 -0
  223. package/dist/lib/des.js +928 -0
  224. package/dist/lib/diagram.d.ts +5 -0
  225. package/dist/lib/diagram.js +479 -0
  226. package/dist/lib/dicom.d.ts +69 -0
  227. package/dist/lib/dicom.js +442 -0
  228. package/dist/lib/dicomCodecs.d.ts +28 -0
  229. package/dist/lib/dicomCodecs.js +156 -0
  230. package/dist/lib/dicomRender.d.ts +46 -0
  231. package/dist/lib/dicomRender.js +114 -0
  232. package/dist/lib/dxf.d.ts +86 -0
  233. package/dist/lib/dxf.js +399 -0
  234. package/dist/lib/eml.d.ts +40 -0
  235. package/dist/lib/eml.js +46 -0
  236. package/dist/lib/encoding.d.ts +28 -0
  237. package/dist/lib/encoding.js +44 -0
  238. package/dist/lib/epl/code/ast.d.ts +150 -0
  239. package/dist/lib/epl/code/codeDataParser.d.ts +3 -0
  240. package/dist/lib/epl/code/codeDataParser.js +330 -0
  241. package/dist/lib/epl/code/codeLines.d.ts +20 -0
  242. package/dist/lib/epl/code/codeLines.js +191 -0
  243. package/dist/lib/epl/code/structures.d.ts +86 -0
  244. package/dist/lib/epl/code/textCode.d.ts +29 -0
  245. package/dist/lib/epl/code/textCode.js +150 -0
  246. package/dist/lib/epl/code/variable.d.ts +25 -0
  247. package/dist/lib/epl/eplDocument.d.ts +21 -0
  248. package/dist/lib/epl/eplDocument.js +36 -0
  249. package/dist/lib/epl/imageList.d.ts +28 -0
  250. package/dist/lib/epl/imageList.js +66 -0
  251. package/dist/lib/epl/index.d.ts +53 -0
  252. package/dist/lib/epl/index.js +45 -0
  253. package/dist/lib/epl/io/binaryReader.d.ts +56 -0
  254. package/dist/lib/epl/io/binaryReader.js +119 -0
  255. package/dist/lib/epl/io/encoding.d.ts +16 -0
  256. package/dist/lib/epl/io/encoding.js +27 -0
  257. package/dist/lib/epl/model/eplSystemId.d.ts +64 -0
  258. package/dist/lib/epl/model/eplSystemId.js +16 -0
  259. package/dist/lib/epl/model/section.d.ts +46 -0
  260. package/dist/lib/epl/names/eplLibData.js +39 -0
  261. package/dist/lib/epl/names/idToNameMap.d.ts +33 -0
  262. package/dist/lib/epl/names/idToNameMap.js +130 -0
  263. package/dist/lib/epl/names/libNameProvider.d.ts +15 -0
  264. package/dist/lib/epl/names/libNameProvider.js +18 -0
  265. package/dist/lib/epl/program.d.ts +120 -0
  266. package/dist/lib/epl/program.js +134 -0
  267. package/dist/lib/epl/projectFileReader.d.ts +23 -0
  268. package/dist/lib/epl/projectFileReader.js +65 -0
  269. package/dist/lib/epl/sections/code.d.ts +20 -0
  270. package/dist/lib/epl/sections/esystemInfo.d.ts +14 -0
  271. package/dist/lib/epl/sections/losable.d.ts +11 -0
  272. package/dist/lib/epl/sections/projectConfig.d.ts +23 -0
  273. package/dist/lib/epl/sections/resource.d.ts +57 -0
  274. package/dist/lib/fb2.d.ts +14 -0
  275. package/dist/lib/fb2.js +62 -0
  276. package/dist/lib/fileType.d.ts +315 -0
  277. package/dist/lib/fileType.js +800 -0
  278. package/dist/lib/fonts.d.ts +8 -0
  279. package/dist/lib/fonts.js +4 -0
  280. package/dist/lib/format.d.ts +16 -0
  281. package/dist/lib/format.js +38 -0
  282. package/dist/lib/frontmatter.d.ts +13 -0
  283. package/dist/lib/frontmatter.js +23 -0
  284. package/dist/lib/geo.d.ts +30 -0
  285. package/dist/lib/geo.js +235 -0
  286. package/dist/lib/har.d.ts +171 -0
  287. package/dist/lib/har.js +397 -0
  288. package/dist/lib/highlight.d.ts +18 -0
  289. package/dist/lib/highlight.js +34 -0
  290. package/dist/lib/highlightLangs.d.ts +15 -0
  291. package/dist/lib/highlightLangs.js +93 -0
  292. package/dist/lib/hprof.d.ts +211 -0
  293. package/dist/lib/hprof.js +709 -0
  294. package/dist/lib/ipynb.d.ts +48 -0
  295. package/dist/lib/ipynb.js +130 -0
  296. package/dist/lib/jks.d.ts +86 -0
  297. package/dist/lib/jks.js +167 -0
  298. package/dist/lib/jsonl.d.ts +29 -0
  299. package/dist/lib/jsonl.js +24 -0
  300. package/dist/lib/lrc.d.ts +32 -0
  301. package/dist/lib/lrc.js +84 -0
  302. package/dist/lib/lzma.d.ts +70 -0
  303. package/dist/lib/lzma.js +204 -0
  304. package/dist/lib/markdown/blocks.d.ts +9 -0
  305. package/dist/lib/markdown/blocks.js +221 -0
  306. package/dist/lib/markdown/index.d.ts +3 -0
  307. package/dist/lib/markdown/inline.d.ts +33 -0
  308. package/dist/lib/markdown/inline.js +84 -0
  309. package/dist/lib/markdown/math.d.ts +5 -0
  310. package/dist/lib/markdown/math.js +25 -0
  311. package/dist/lib/markdown/segmentize.d.ts +11 -0
  312. package/dist/lib/markdown/segmentize.js +28 -0
  313. package/dist/lib/markdown/styles.d.ts +26 -0
  314. package/dist/lib/markdown/styles.js +135 -0
  315. package/dist/lib/mht.d.ts +51 -0
  316. package/dist/lib/mht.js +122 -0
  317. package/dist/lib/midi.d.ts +28 -0
  318. package/dist/lib/midi.js +84 -0
  319. package/dist/lib/mime.d.ts +82 -0
  320. package/dist/lib/mime.js +151 -0
  321. package/dist/lib/mindmap.d.ts +51 -0
  322. package/dist/lib/mindmap.js +113 -0
  323. package/dist/lib/mobi.d.ts +15 -0
  324. package/dist/lib/mobi.js +68 -0
  325. package/dist/lib/msi.d.ts +50 -0
  326. package/dist/lib/msi.js +332 -0
  327. package/dist/lib/optionalDep.d.ts +26 -0
  328. package/dist/lib/optionalDep.js +20 -0
  329. package/dist/lib/pkcs12.d.ts +56 -0
  330. package/dist/lib/pkcs12.js +356 -0
  331. package/dist/lib/qmc.d.ts +50 -0
  332. package/dist/lib/qmc.js +213 -0
  333. package/dist/lib/rar.d.ts +16 -0
  334. package/dist/lib/rar.js +40 -0
  335. package/dist/lib/rawPreview.d.ts +12 -0
  336. package/dist/lib/rawPreview.js +54 -0
  337. package/dist/lib/rc2.d.ts +12 -0
  338. package/dist/lib/rc2.js +298 -0
  339. package/dist/lib/resolveInput.d.ts +22 -0
  340. package/dist/lib/resolveInput.js +55 -0
  341. package/dist/lib/rtf.d.ts +53 -0
  342. package/dist/lib/rtf.js +413 -0
  343. package/dist/lib/sevenZip.d.ts +82 -0
  344. package/dist/lib/sevenZip.js +395 -0
  345. package/dist/lib/sha1.d.ts +24 -0
  346. package/dist/lib/sha1.js +53 -0
  347. package/dist/lib/sha256.d.ts +21 -0
  348. package/dist/lib/sha256.js +119 -0
  349. package/dist/lib/speechAudio.d.ts +36 -0
  350. package/dist/lib/speechAudio.js +85 -0
  351. package/dist/lib/sqlite.d.ts +38 -0
  352. package/dist/lib/sqlite.js +104 -0
  353. package/dist/lib/subtitle.d.ts +26 -0
  354. package/dist/lib/subtitle.js +99 -0
  355. package/dist/lib/tarball.d.ts +20 -0
  356. package/dist/lib/tarball.js +248 -0
  357. package/dist/lib/viewerFormats.d.ts +35 -0
  358. package/dist/lib/viewerFormats.js +83 -0
  359. package/dist/lib/viewerKind.d.ts +36 -0
  360. package/dist/lib/viewerKind.js +233 -0
  361. package/dist/lib/x509.d.ts +68 -0
  362. package/dist/lib/x509.js +267 -0
  363. package/dist/lib/xlsx.d.ts +55 -0
  364. package/dist/lib/xlsx.js +321 -0
  365. package/dist/lib/xlsxCharts.d.ts +34 -0
  366. package/dist/lib/xlsxCharts.js +152 -0
  367. package/dist/lib/xmind.d.ts +6 -0
  368. package/dist/lib/xmind.js +124 -0
  369. package/dist/lib/zip.d.ts +56 -0
  370. package/dist/lib/zip.js +169 -0
  371. package/dist/style.css +2 -0
  372. package/dist/types.d.ts +42 -0
  373. package/package.json +128 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 l1yp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @l1yp/file-viewer
2
+
3
+ 浏览器内的**多格式文件查看器**,封装成一个 Vue 3 组件。给它一个文件,它自动识别类型并**完全在浏览器里**解析渲染——**文件字节不经过任何服务器**。支持 60+ 种格式:Office 文档、压缩包、图片、代码、音频、证书、数据库、3D 模型、电子书……
4
+
5
+ > 从 [chat-share-proxy](https://github.com/) 抽取。完整设计见仓库 `frontend/docs/file-viewer-package-design.md`。
6
+
7
+ ## 特性
8
+
9
+ - **60+ 格式**:docx/xlsx/pptx/pdf、zip/7z/rar/tar、png/tiff/psd/heic/dcm、csv/jsonl/sqlite、markdown/代码高亮、eml/mht/har、字体/证书/密钥库、epub/mob、drawio/dxf/geojson、hprof/.class/.so/.dll、易语言 .e/.ec 等。
10
+ - **零后端**:上游字节只在浏览器解析;HTML/SVG 走沙箱 iframe、下载端点无法内联执行。
11
+ - **按需分包**:每个查看器是独立的懒加载 chunk,打开 PDF 才拉 PDF 引擎;用不到的格式零成本。
12
+ - **重型依赖可选**:只装你需要的格式的引擎;没装时显示「请安装 X」提示卡,不崩溃。
13
+ - **主题可定制**:CSS 变量作用域限定在组件根,不污染宿主;`theme` prop 或覆盖变量即可换肤。
14
+
15
+ ## 安装
16
+
17
+ ```sh
18
+ npm i @l1yp/file-viewer vue
19
+ ```
20
+
21
+ `vue`(>=3.5)是 peer 依赖。核心解析(代码高亮 / Markdown 数学 / frontmatter)依赖的 `highlight.js` / `katex` / `js-yaml` 会随包自动安装。
22
+
23
+ **各重型格式的引擎是可选 peer 依赖**——按需安装你要支持的格式:
24
+
25
+ | 格式 | 需额外安装 |
26
+ | --- | --- |
27
+ | PDF | `pdfjs-dist` |
28
+ | Word `.docx` | `docx-preview` |
29
+ | Excel `.xlsx` | `exceljs numfmt` |
30
+ | PowerPoint `.pptx` | `@aiden0z/pptx-renderer pdfjs-dist` |
31
+ | SQLite `.sqlite/.db` | `sql.js` |
32
+ | 3D 模型 `.stl/.obj/.glb/…` | `three` |
33
+ | 地图 `.geojson/.kml/.gpx` | `maplibre-gl` |
34
+ | Photoshop `.psd` | `ag-psd` |
35
+ | TIFF `.tif/.tiff` | `utif2` |
36
+ | HEIC/HEIF | `heic2any` |
37
+ | EPUB | `epubjs` |
38
+ | DICOM `.dcm` | `dicom-parser`(JPEG2000/JPEG-LS 另需 `@cornerstonejs/codec-openjpeg @cornerstonejs/codec-charls @cornerstonejs/codec-libjpeg-turbo-8bit`) |
39
+ | RAR | `node-unrar-js` |
40
+ | Brotli 归档 `.br` | `brotli-dec-wasm` |
41
+ | 微信/QQ 语音(SILK/AMR) | `silk-wasm @audio/decode-amr` |
42
+
43
+ 未安装某格式的引擎时,打开该文件会显示一张「预览 X 需要安装 `<pkg>`」的卡片(含一键复制安装命令 + 下载原文件),不会报错崩溃。
44
+
45
+ > **打包器提示**:这些可选依赖在库构建里是 `external`。若你的打包器(Vite/webpack)对未安装的可选依赖在**构建期**报「无法解析」,把你不用的那几个加进 bundler 的 external / `optimizeDeps.exclude` 即可。
46
+
47
+ ## 使用
48
+
49
+ ```ts
50
+ import { FileViewer } from '@l1yp/file-viewer'
51
+ import '@l1yp/file-viewer/style.css' // 必需:查看器的样式在这里
52
+ ```
53
+
54
+ ```vue
55
+ <!-- 最简:URL + 文件名 -->
56
+ <FileViewer :src="url" name="report.csv" />
57
+
58
+ <!-- 内存字节(拖拽 / 上传的 File 直接喂) -->
59
+ <FileViewer :blob="file" :name="file.name" />
60
+
61
+ <!-- 需要鉴权的 URL:附加 fetch 配置,或用 load 完全自定义取字节 -->
62
+ <FileViewer
63
+ :input="{
64
+ src,
65
+ name,
66
+ mime,
67
+ size,
68
+ fetchConfig: { headers: { Authorization: `Bearer ${token}` } },
69
+ }"
70
+ theme="dark"
71
+ @loaded="onText"
72
+ @error="onError"
73
+ />
74
+ ```
75
+
76
+ **数据源**(写在 `input` 上,或用同名简写 props)——四选一,优先级 `text` > `blob` > `load` > `src`:
77
+
78
+ | 字段 | 说明 |
79
+ | --- | --- |
80
+ | `src` | 可直接 fetch 的 URL(最常用) |
81
+ | `blob` | 内存字节(`Blob`/`File`) |
82
+ | `text` | 已解码文本(文本型查看器免网络) |
83
+ | `fetchConfig` | 附加到 `fetch(src, …)`:headers/credentials/mode …(会触发一次性预取到 blob) |
84
+ | `load` | `() => Promise<Blob \| ArrayBuffer>`,自己拉字节(签名换取 / SDK) |
85
+
86
+ ### 更底层的出口
87
+
88
+ ```ts
89
+ import {
90
+ FileViewer, // ① 完整面板(含头部、下载、主题),ViewerInput 驱动
91
+ FileViewerBody, // ② 只有内容区,塞进你自己的外壳
92
+ classifyViewerFile, // 纯函数:文件 → 用哪个查看器,自己路由
93
+ isTextFile,
94
+ fileExt, // 类型判定辅助
95
+ resolveInput, // 把 ViewerInput 归一化成可 fetch 的源
96
+ } from '@l1yp/file-viewer'
97
+ ```
98
+
99
+ ## 主题 / 样式
100
+
101
+ 所有样式的 CSS 变量作用域限定在组件根 `.fv-root`,**不碰宿主全局样式**。三种定制方式:
102
+
103
+ 1. **`theme` prop**:`theme="light | dark | system | inherit"`。`inherit` = 不设主题、直接吃宿主已定义的变量。
104
+ 2. **覆盖 CSS 变量**:在你自己的 `.fv-root` 规则里改,例如
105
+ ```css
106
+ .fv-root {
107
+ --accent: #2563eb;
108
+ --font-mono: 'JetBrains Mono', monospace;
109
+ }
110
+ ```
111
+ 3. 复制 `dist` 里的令牌整套替换。
112
+
113
+ > **数学公式**:如需 Markdown 里的数学公式正常显示,宿主需自行 `import 'katex/dist/katex.min.css'`。
114
+ > 直接用低层的 `<FileViewerPanel>`(不带 `.fv-root` 包裹)时,请自己定义那批 CSS 变量,或改用带 `.fv-root` 的 `<FileViewer>`。
115
+
116
+ ## 开发
117
+
118
+ ```sh
119
+ pnpm -C packages/file-viewer type-check # vue-tsc 类型检查
120
+ pnpm -C packages/file-viewer build # vp build(JS 分包 + style.css)+ vue-tsc(.d.ts)
121
+ ```
122
+
123
+ ## 发布
124
+
125
+ ```sh
126
+ npm pack --dry-run # 预览将发布的文件(dist + README + LICENSE)
127
+ npm publish # publishConfig.access=public,已配好公开发布
128
+ ```
129
+
130
+ `prepack` 脚本会在打包/发布前自动重新构建。发布前记得在 `package.json` 补上 `repository` / `homepage` 字段。
131
+
132
+ ## License
133
+
134
+ MIT
@@ -0,0 +1,7 @@
1
+ import e from "./_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./FileViewer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/FileViewer.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-b3eb2d75"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,37 @@
1
+ import type { ViewerInput } from './types';
2
+ /**
3
+ * The batteries-included file viewer (see docs/file-viewer-package-design.md §3). Give it a file — as a full
4
+ * {@link ViewerInput}, or the shorthand `src`/`blob`/`text` + `name` props — and it normalizes the source
5
+ * ({@link resolveInput}, honoring `fetchConfig`/`load` for authenticated sources), classifies it
6
+ * ({@link classifyViewerFile}), and dispatches to the right in-browser viewer via {@link FileViewerBody}.
7
+ *
8
+ * The root carries `class="fv-root"` + the resolved `data-theme`, so all tokens (styles/theme.css) are scoped
9
+ * here — the library never touches the host's global styles. `theme="inherit"` sets no attribute, letting the
10
+ * host drive light/dark by defining the CSS variables itself.
11
+ */
12
+ type __VLS_Props = {
13
+ /** Full input (takes precedence over the shorthand props below). */
14
+ input?: ViewerInput;
15
+ /** Shorthand source + descriptors (used when `input` is omitted). */
16
+ src?: string;
17
+ name?: string;
18
+ mime?: string | null;
19
+ size?: number;
20
+ blob?: Blob;
21
+ text?: string;
22
+ /** Theme: light | dark | system, or `inherit` (no attribute — host-driven). */
23
+ theme?: 'light' | 'dark' | 'system' | 'inherit';
24
+ };
25
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ error: (message: string) => any;
27
+ close: () => any;
28
+ loaded: (text: string) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onError?: ((message: string) => any) | undefined;
31
+ onClose?: (() => any) | undefined;
32
+ onLoaded?: ((text: string) => any) | undefined;
33
+ }>, {
34
+ theme: "light" | "dark" | "system" | "inherit";
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
@@ -0,0 +1,103 @@
1
+ import { resolveInput as e } from "./lib/resolveInput.js";
2
+ import { fileExt as t } from "./lib/fileType.js";
3
+ import { classifyViewerFile as n } from "./lib/viewerKind.js";
4
+ import r from "./components/FileViewerBody.js";
5
+ import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, onBeforeUnmount as u, openBlock as d, ref as f, toDisplayString as p, watch as m } from "vue";
6
+ //#region src/FileViewer.vue?vue&type=script&setup=true&lang.ts
7
+ var h = ["data-theme"], g = { class: "fv__head" }, _ = ["title"], v = { class: "fv__name" }, y = {
8
+ key: 0,
9
+ class: "fv__ext"
10
+ }, b = ["href", "download"], x = { class: "fv__body" }, S = {
11
+ key: 0,
12
+ class: "fv__msg"
13
+ }, C = {
14
+ key: 1,
15
+ class: "fv__msg fv__msg--err"
16
+ }, w = {
17
+ key: 3,
18
+ class: "fv__msg"
19
+ }, T = /*@__PURE__*/ l({
20
+ __name: "FileViewer",
21
+ props: {
22
+ input: {},
23
+ src: {},
24
+ name: {},
25
+ mime: {},
26
+ size: {},
27
+ blob: {},
28
+ text: {},
29
+ theme: { default: "system" }
30
+ },
31
+ emits: [
32
+ "loaded",
33
+ "error",
34
+ "close"
35
+ ],
36
+ setup(l, { emit: T }) {
37
+ let E = l, D = T, O = i(() => E.input ? E.input : E.name ? {
38
+ name: E.name,
39
+ src: E.src,
40
+ blob: E.blob,
41
+ text: E.text,
42
+ mime: E.mime,
43
+ size: E.size
44
+ } : null), k = f(null), A = f(!1), j = f(""), M = null;
45
+ function N() {
46
+ M &&= (M.dispose(), null);
47
+ }
48
+ async function P(t) {
49
+ if (N(), k.value = null, j.value = "", t) {
50
+ A.value = !0;
51
+ try {
52
+ let r = await e(t);
53
+ M = r;
54
+ let i = n({
55
+ name: r.name,
56
+ url: r.url,
57
+ mime: r.mime,
58
+ size: r.size
59
+ });
60
+ k.value = r.text == null ? i : {
61
+ ...i,
62
+ content: r.text
63
+ };
64
+ } catch (e) {
65
+ j.value = String(e), D("error", String(e));
66
+ } finally {
67
+ A.value = !1;
68
+ }
69
+ }
70
+ }
71
+ m(O, (e) => void P(e), { immediate: !0 }), u(N);
72
+ let F = i(() => E.theme === "inherit" ? void 0 : E.theme), I = i(() => O.value?.name ?? ""), L = i(() => t(I.value).toUpperCase()), R = i(() => k.value?.content != null);
73
+ return (e, t) => (d(), s("div", {
74
+ class: "fv-root fv",
75
+ "data-theme": F.value
76
+ }, [c("header", g, [
77
+ c("span", {
78
+ class: "fv__title",
79
+ title: I.value
80
+ }, [c("span", v, p(I.value), 1), L.value ? (d(), s("span", y, "· " + p(L.value), 1)) : o("", !0)], 8, _),
81
+ k.value?.url && !R.value ? (d(), s("a", {
82
+ key: 0,
83
+ class: "fv__act",
84
+ href: k.value.url,
85
+ download: k.value.name,
86
+ title: "下载"
87
+ }, "下载", 8, b)) : o("", !0),
88
+ c("button", {
89
+ type: "button",
90
+ class: "fv__act",
91
+ title: "关闭",
92
+ onClick: t[0] ||= (e) => D("close")
93
+ }, "关闭")
94
+ ]), c("div", x, [A.value ? (d(), s("p", S, "准备中…")) : j.value ? (d(), s("p", C, p(j.value), 1)) : k.value ? (d(), a(r, {
95
+ key: 2,
96
+ file: k.value,
97
+ onLoaded: t[1] ||= (e) => D("loaded", e),
98
+ onError: t[2] ||= (e) => D("error", e)
99
+ }, null, 8, ["file"])) : (d(), s("p", w, "未提供文件。"))])], 8, h));
100
+ }
101
+ });
102
+ //#endregion
103
+ export { T as default };
@@ -0,0 +1,8 @@
1
+ //#region \0plugin-vue:export-helper
2
+ var e = (e, t) => {
3
+ let n = e.__vccOpts || e;
4
+ for (let [e, r] of t) n[e] = r;
5
+ return n;
6
+ };
7
+ //#endregion
8
+ export { e as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./AppxViewer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/AppxViewer.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-d5fba7c8"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The side viewer's APPX / MSIX mode: fetch a Windows app package, unzip its manifest in-browser (see
3
+ * lib/appx.ts — an APPX is an OPC zip, decompressed via the project's own ZIP reader), and surface the
4
+ * identity (name / version / publisher), dependencies, declared capabilities, applications and languages.
5
+ * Mirrors BinObjBrowser / MsiViewer: the bytes come from the same download endpoint as any other file and
6
+ * never leave the browser. An APPX is neither a PE nor an MSI — different container, hence a separate viewer.
7
+ *
8
+ * Large-file gate: a package can be hundreds of MB; unless the manifest size is known to be small
9
+ * (≤ LARGE_THRESHOLD) we show a confirm card and only fetch on click.
10
+ */
11
+ type __VLS_Props = {
12
+ url: string;
13
+ name: string;
14
+ size?: number;
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,174 @@
1
+ import { formatBytes as e } from "../lib/format.js";
2
+ import t from "./icons/Icon.js";
3
+ import { NotAppxError as n, parseAppx as r } from "../lib/appx.js";
4
+ import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as ee, defineComponent as u, normalizeClass as te, onBeforeUnmount as ne, onMounted as re, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as ie, watch as ae } from "vue";
5
+ //#region src/components/AppxViewer.vue?vue&type=script&setup=true&lang.ts
6
+ var oe = { class: "apx" }, se = {
7
+ key: 0,
8
+ class: "apx__confirm"
9
+ }, ce = ["title"], le = { class: "apx__confirm-sub" }, h = {
10
+ key: 1,
11
+ class: "apx__msg"
12
+ }, g = {
13
+ key: 2,
14
+ class: "apx__msg apx__msg--error"
15
+ }, _ = { class: "apx__summary" }, v = { class: "apx__fmt" }, y = { key: 0 }, b = { key: 1 }, x = {
16
+ key: 0,
17
+ class: "apx__card"
18
+ }, S = { class: "apx__dl" }, C = { class: "apx__dt" }, w = { class: "apx__dd" }, T = ["title", "onClick"], E = {
19
+ key: 0,
20
+ class: "apx__tag"
21
+ }, D = {
22
+ key: 1,
23
+ class: "apx__copied"
24
+ }, O = {
25
+ key: 1,
26
+ class: "apx__card"
27
+ }, k = { class: "apx__h" }, A = { class: "apx__deps" }, j = { class: "apx__depname" }, M = { class: "apx__depver" }, N = {
28
+ key: 0,
29
+ class: "apx__chip"
30
+ }, P = { key: 1 }, F = { key: 2 }, I = {
31
+ key: 2,
32
+ class: "apx__card"
33
+ }, L = { class: "apx__h" }, R = { class: "apx__deps" }, ue = { class: "apx__depname" }, z = {
34
+ key: 0,
35
+ class: "apx__depver"
36
+ }, B = {
37
+ key: 3,
38
+ class: "apx__card"
39
+ }, V = { class: "apx__deps" }, H = { class: "apx__depname" }, U = { class: "apx__depver" }, de = { key: 0 }, fe = {
40
+ key: 1,
41
+ class: "apx__depmuted"
42
+ }, pe = { class: "apx__depname" }, me = { class: "apx__depver" }, he = { key: 0 }, ge = {
43
+ key: 4,
44
+ class: "apx__card"
45
+ }, _e = { class: "apx__h" }, ve = { class: "apx__tables" }, ye = {
46
+ key: 5,
47
+ class: "apx__section"
48
+ }, be = {
49
+ key: 0,
50
+ class: "apx__tables apx__tables--pad"
51
+ }, xe = 8 * 1024 * 1024, W = /*@__PURE__*/ u({
52
+ __name: "AppxViewer",
53
+ props: {
54
+ url: {},
55
+ name: {},
56
+ size: {}
57
+ },
58
+ setup(u) {
59
+ let W = u, G = f("loading"), K = f(""), q = f(null), J = f(!1);
60
+ function Y() {
61
+ q.value = null, J.value = !1, K.value = "", W.size != null && W.size <= xe ? X() : G.value = "confirm";
62
+ }
63
+ async function X() {
64
+ G.value = "loading", K.value = "";
65
+ try {
66
+ let e = await fetch(W.url);
67
+ if (!e.ok) throw Error(`HTTP ${e.status}`);
68
+ q.value = await r(await e.arrayBuffer()), G.value = "ready";
69
+ } catch (e) {
70
+ K.value = e instanceof n || e instanceof Error ? e.message : String(e), G.value = "error";
71
+ }
72
+ }
73
+ let Se = a(() => q.value?.kind === "bundle" ? "捆绑包" : "应用包");
74
+ function Ce(e) {
75
+ return !!e && e.toLowerCase().startsWith("ms-resource:");
76
+ }
77
+ let Z = a(() => {
78
+ let e = q.value;
79
+ if (!e) return [];
80
+ let t = [], n = (e, n) => {
81
+ n && t.push({
82
+ label: e,
83
+ value: n,
84
+ hint: Ce(n)
85
+ });
86
+ };
87
+ return n("显示名", e.displayName), n("名称", e.name), n("版本", e.version), n("架构", e.architecture), n("发布者", e.publisherDisplayName), n("发布者证书", e.publisher), t;
88
+ }), Q = f(""), $;
89
+ async function we(e) {
90
+ try {
91
+ await navigator.clipboard?.writeText(e);
92
+ } catch {}
93
+ Q.value = e, clearTimeout($), $ = setTimeout(() => Q.value = "", 1200);
94
+ }
95
+ return re(Y), ae(() => W.url, Y), ne(() => clearTimeout($)), (n, r) => (d(), s("div", oe, [G.value === "confirm" ? (d(), s("div", se, [
96
+ ee(t, {
97
+ name: "archive",
98
+ size: 32
99
+ }),
100
+ c("p", {
101
+ class: "apx__confirm-title",
102
+ title: u.name
103
+ }, m(u.name), 9, ce),
104
+ c("p", le, m(u.size == null ? "文件大小未知" : `文件较大(${ie(e)(u.size)})`) + ",解析需将整个文件下载到浏览器。 ", 1),
105
+ c("button", {
106
+ type: "button",
107
+ class: "apx__btn",
108
+ onClick: X
109
+ }, "加载并解析清单")
110
+ ])) : G.value === "loading" ? (d(), s("p", h, "正在解析应用包…")) : G.value === "error" ? (d(), s("div", g, [c("p", null, m(K.value), 1), c("button", {
111
+ type: "button",
112
+ class: "apx__retry",
113
+ onClick: X
114
+ }, "重试")])) : G.value === "ready" && q.value ? (d(), s(i, { key: 3 }, [
115
+ c("div", _, [
116
+ c("span", v, m(Se.value), 1),
117
+ q.value.version ? (d(), s("span", y, "v" + m(q.value.version), 1)) : o("", !0),
118
+ q.value.architecture ? (d(), s("span", b, m(q.value.architecture), 1)) : o("", !0),
119
+ c("span", null, m(q.value.fileCount) + " 个文件", 1)
120
+ ]),
121
+ Z.value.length ? (d(), s("div", x, [r[1] ||= c("h3", { class: "apx__h" }, "包标识", -1), c("dl", S, [(d(!0), s(i, null, p(Z.value, (e, t) => (d(), s(i, { key: t }, [c("dt", C, m(e.label), 1), c("dd", w, [c("button", {
122
+ type: "button",
123
+ class: "apx__copyable",
124
+ title: `点击复制:${e.value}`,
125
+ onClick: (t) => we(e.value)
126
+ }, [
127
+ c("span", null, m(e.value), 1),
128
+ e.hint ? (d(), s("span", E, "资源引用")) : o("", !0),
129
+ Q.value === e.value ? (d(), s("span", D, "已复制")) : o("", !0)
130
+ ], 8, T)])], 64))), 128))])])) : o("", !0),
131
+ q.value.bundlePackages.length ? (d(), s("div", O, [c("h3", k, "包含的包(" + m(q.value.bundlePackages.length) + ")", 1), c("div", A, [(d(!0), s(i, null, p(q.value.bundlePackages, (e, t) => (d(), s("div", {
132
+ key: t,
133
+ class: "apx__dep"
134
+ }, [c("span", j, m(e.fileName || e.architecture || e.type), 1), c("span", M, [
135
+ e.architecture ? (d(), s("span", N, m(e.architecture), 1)) : o("", !0),
136
+ e.type ? (d(), s("span", P, m(e.type), 1)) : o("", !0),
137
+ e.version ? (d(), s("span", F, "v" + m(e.version), 1)) : o("", !0)
138
+ ])]))), 128))])])) : o("", !0),
139
+ q.value.applications.length ? (d(), s("div", I, [c("h3", L, "应用(" + m(q.value.applications.length) + ")", 1), c("div", R, [(d(!0), s(i, null, p(q.value.applications, (e, t) => (d(), s("div", {
140
+ key: t,
141
+ class: "apx__dep"
142
+ }, [c("span", ue, m(e.id || "(无 Id)"), 1), e.displayName ? (d(), s("span", z, m(e.displayName), 1)) : o("", !0)]))), 128))])])) : o("", !0),
143
+ q.value.targetDeviceFamilies.length || q.value.packageDependencies.length ? (d(), s("div", B, [r[4] ||= c("h3", { class: "apx__h" }, "依赖", -1), c("div", V, [(d(!0), s(i, null, p(q.value.targetDeviceFamilies, (e, t) => (d(), s("div", {
144
+ key: "t" + t,
145
+ class: "apx__dep"
146
+ }, [c("span", H, m(e.name), 1), c("span", U, [
147
+ r[2] ||= c("span", { class: "apx__chip" }, "系统", -1),
148
+ e.minVersion ? (d(), s("span", de, "≥ " + m(e.minVersion), 1)) : o("", !0),
149
+ e.maxVersionTested ? (d(), s("span", fe, "测试至 " + m(e.maxVersionTested), 1)) : o("", !0)
150
+ ])]))), 128)), (d(!0), s(i, null, p(q.value.packageDependencies, (e, t) => (d(), s("div", {
151
+ key: "p" + t,
152
+ class: "apx__dep"
153
+ }, [c("span", pe, m(e.name), 1), c("span", me, [r[3] ||= c("span", { class: "apx__chip" }, "包", -1), e.minVersion ? (d(), s("span", he, "≥ " + m(e.minVersion), 1)) : o("", !0)])]))), 128))])])) : o("", !0),
154
+ q.value.capabilities.length ? (d(), s("div", ge, [c("h3", _e, "能力(" + m(q.value.capabilities.length) + ")", 1), c("div", ve, [(d(!0), s(i, null, p(q.value.capabilities, (e) => (d(), s("span", {
155
+ key: e,
156
+ class: "apx__chip"
157
+ }, m(e), 1))), 128))])])) : o("", !0),
158
+ q.value.languages.length ? (d(), s("div", ye, [c("button", {
159
+ type: "button",
160
+ class: "apx__toggle",
161
+ onClick: r[0] ||= (e) => J.value = !J.value
162
+ }, [c("span", { class: te(["apx__caret", { "apx__caret--open": J.value }]) }, "▶", 2), l(" 语言(" + m(q.value.languages.length) + ") ", 1)]), J.value ? (d(), s("div", be, [(d(!0), s(i, null, p(q.value.languages, (e) => (d(), s("span", {
163
+ key: e,
164
+ class: "apx__chip"
165
+ }, m(e), 1))), 128))])) : o("", !0)])) : o("", !0),
166
+ (d(!0), s(i, null, p(q.value.notes, (e, t) => (d(), s("p", {
167
+ key: t,
168
+ class: "apx__note"
169
+ }, m(e), 1))), 128))
170
+ ], 64)) : o("", !0)]));
171
+ }
172
+ });
173
+ //#endregion
174
+ export { W as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./ArchiveBrowser.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/ArchiveBrowser.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-9693d0e6"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The side viewer's generic archive mode — the multi-file browser shared by the tar family (tar/gz/xz/bz2) and
3
+ * rar. Same master→detail UX as {@link ZipBrowser}: a collapsible file tree; selecting an entry extracts just
4
+ * that one, wraps it in a blob URL, and hands it to {@link FileViewerBody} (so a file inside the archive
5
+ * previews with every viewer a top-level file gets).
6
+ *
7
+ * The format-specific work lives behind {@link OpenedArchive}: this component fetches the bytes, lazy-imports
8
+ * the right opener by `kind` (so neither the tar codecs nor the rar WASM ship in the main bundle), and drives
9
+ * everything through `entries` + `extract()`. Extraction may be sync (tar) or async (rar) — every call is awaited.
10
+ */
11
+ type __VLS_Props = {
12
+ url: string;
13
+ name: string;
14
+ kind: 'tar' | 'rar';
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;