@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
@@ -0,0 +1,337 @@
1
+ import { fileExt as e } from "../lib/fileType.js";
2
+ import { parseMindMap as t } from "../lib/mindmap.js";
3
+ import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as ee, onMounted as d, openBlock as f, reactive as te, ref as p, renderList as m, toDisplayString as h, unref as g, watch as _, withModifiers as v } from "vue";
4
+ //#region src/components/MindMapView.vue?vue&type=script&setup=true&lang.ts
5
+ var ne = { class: "mm" }, re = {
6
+ key: 0,
7
+ class: "mm__msg mm__msg--error"
8
+ }, ie = {
9
+ key: 1,
10
+ class: "mm__msg"
11
+ }, ae = {
12
+ class: "mm__svg",
13
+ width: "100%",
14
+ height: "100%"
15
+ }, oe = ["transform"], se = ["d", "stroke"], ce = ["transform"], le = [
16
+ "width",
17
+ "height",
18
+ "onClick"
19
+ ], y = ["onClick"], ue = ["y"], de = { key: 0 }, fe = ["onClick"], pe = ["cx", "cy"], me = [
20
+ "x1",
21
+ "y1",
22
+ "x2",
23
+ "y2"
24
+ ], he = [
25
+ "x1",
26
+ "y1",
27
+ "x2",
28
+ "y2"
29
+ ], ge = ["x", "y"], b = ["href"], _e = ["x"], ve = { class: "mm__toolbar" }, ye = { class: "mm__summary" }, be = { class: "mm__zoom" }, x = 13, S = 19, C = 11, w = 7, T = 240, E = 22, D = 46, O = 14, k = /*@__PURE__*/ s({
30
+ __name: "MindMapView",
31
+ props: {
32
+ text: {},
33
+ name: {},
34
+ map: {}
35
+ },
36
+ setup(s) {
37
+ let k = s, A = [
38
+ "#6ea8fe",
39
+ "#63e6be",
40
+ "#ffd43b",
41
+ "#ff8787",
42
+ "#da77f2",
43
+ "#4dabf7",
44
+ "#ffa94d",
45
+ "#9775fa"
46
+ ], j = r(() => {
47
+ let t = k.name || "", n = e(t);
48
+ return n ? t.slice(0, t.length - n.length - 1) : t;
49
+ }), M = r(() => {
50
+ if (k.map) return { map: k.map };
51
+ if (!k.text) return {};
52
+ try {
53
+ let n = e(k.name).toLowerCase();
54
+ return { map: t(k.text, n === "opml" ? "opml" : "mm", j.value) };
55
+ } catch (e) {
56
+ return { error: e instanceof Error ? e.message : String(e) };
57
+ }
58
+ }), N = te(/* @__PURE__ */ new Set());
59
+ function P(e) {
60
+ e.foldedInit && e.children.length && N.add(e.id);
61
+ for (let t of e.children) P(t);
62
+ }
63
+ _(() => M.value.map, (e) => {
64
+ N.clear(), e && P(e.root), c(U);
65
+ }, { immediate: !0 });
66
+ function F(e) {
67
+ let t = e.codePointAt(0) ?? 0;
68
+ return t >= 4352 && t <= 4447 || t >= 11904 && t <= 42191 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65072 && t <= 65103 || t >= 65280 && t <= 65376 || t >= 65504 && t <= 65510 || t >= 127744 && t <= 129791;
69
+ }
70
+ function I(e) {
71
+ let t = 0;
72
+ for (let n of e) t += F(n) ? x * 1.02 : x * .56;
73
+ return t;
74
+ }
75
+ function xe(e) {
76
+ let t = [], n = "";
77
+ for (let r of e) F(r) ? (n &&= (t.push(n), ""), t.push(r)) : (n += r, (r === " " || r === "-" || r === "_" || r === "/") && (t.push(n), n = ""));
78
+ return n && t.push(n), t;
79
+ }
80
+ function Se(e) {
81
+ let t = (e || "").replace(/\s+/g, " ").trim() || "(无标题)", n = [], r = "", i = 0;
82
+ for (let e of xe(t)) {
83
+ let t = I(e);
84
+ if (t > T) {
85
+ r && (n.push(r.trimEnd()), r = "", i = 0);
86
+ let t = "";
87
+ for (let r of e) I(t + r) > T ? (n.push(t), t = r) : t += r;
88
+ r = t, i = I(t);
89
+ continue;
90
+ }
91
+ r && i + t > T ? (n.push(r.trimEnd()), r = e.trimStart(), i = I(r)) : (r += e, i += t);
92
+ }
93
+ r.trim() && n.push(r.trimEnd()), n.length || n.push("(无标题)");
94
+ let a = 0;
95
+ for (let e of n) a = Math.max(a, I(e));
96
+ return {
97
+ lines: n,
98
+ width: Math.max(E, Math.min(T, Math.ceil(a)))
99
+ };
100
+ }
101
+ let L = r(() => {
102
+ let e = M.value.map;
103
+ if (!e) return {
104
+ nodes: [],
105
+ edges: [],
106
+ width: 0,
107
+ height: 0
108
+ };
109
+ function t(e, n) {
110
+ let { lines: r, width: i } = Se(e.text), a = !N.has(e.id) && e.children.length ? e.children.map((e) => t(e, n + 1)) : [];
111
+ return {
112
+ node: e,
113
+ lines: r,
114
+ w: i + C * 2,
115
+ h: r.length * S + w * 2,
116
+ depth: n,
117
+ children: a,
118
+ hasChildren: e.children.length > 0
119
+ };
120
+ }
121
+ let n = t(e.root, 0), r = [];
122
+ (function e(t) {
123
+ r[t.depth] = Math.max(r[t.depth] ?? 0, t.w), t.children.forEach(e);
124
+ })(n);
125
+ let i = [0];
126
+ for (let e = 1; e < r.length; e++) i[e] = i[e - 1] + (r[e - 1] ?? 0) + D;
127
+ let a = [], o = [], s = 0;
128
+ function c(e) {
129
+ let t = i[e.depth], n;
130
+ if (e.children.length === 0) n = s + e.h / 2, s += e.h + O;
131
+ else {
132
+ let r = e.children.map(c);
133
+ n = (r[0] + r[r.length - 1]) / 2;
134
+ for (let a = 0; a < e.children.length; a++) {
135
+ let s = e.children[a];
136
+ o.push({
137
+ x1: t + e.w,
138
+ y1: n,
139
+ x2: i[s.depth],
140
+ y2: r[a],
141
+ color: s.node.color || s.node.bg || A[s.depth % A.length]
142
+ });
143
+ }
144
+ }
145
+ return a.push({
146
+ node: e.node,
147
+ x: t,
148
+ y: n,
149
+ w: e.w,
150
+ h: e.h,
151
+ depth: e.depth,
152
+ lines: e.lines,
153
+ hasChildren: e.hasChildren,
154
+ collapsed: N.has(e.node.id)
155
+ }), n;
156
+ }
157
+ c(n);
158
+ let l = 0, u = 0;
159
+ for (let e of a) l = Math.max(l, e.x + e.w), u = Math.max(u, e.y + e.h / 2);
160
+ return {
161
+ nodes: a,
162
+ edges: o,
163
+ width: l,
164
+ height: u
165
+ };
166
+ });
167
+ function Ce(e) {
168
+ let t = Math.max(18, (e.x2 - e.x1) * .5);
169
+ return `M${e.x1},${e.y1} C${e.x1 + t},${e.y1} ${e.x2 - t},${e.y2} ${e.x2},${e.y2}`;
170
+ }
171
+ function we(e) {
172
+ let t = {};
173
+ return e.node.bg && (t.fill = e.node.bg), e.node.color && (t.stroke = e.node.color), t;
174
+ }
175
+ function Te(e) {
176
+ return e.node.color ? { fill: e.node.color } : {};
177
+ }
178
+ let R = p(), z = p(0), B = p(0), V = p(1);
179
+ function H(e, t, n) {
180
+ return Math.min(n, Math.max(t, e));
181
+ }
182
+ function U() {
183
+ let e = R.value, t = L.value;
184
+ if (!e || !t.nodes.length) return;
185
+ let n = e.clientWidth || 1, r = e.clientHeight || 1, i = H(Math.min((n - 48) / Math.max(t.width, 1), (r - 48) / Math.max(t.height, 1)), .2, 1.25);
186
+ V.value = i, z.value = (n - t.width * i) / 2, B.value = (r - t.height * i) / 2;
187
+ }
188
+ function W(e, t, n) {
189
+ let r = H(V.value * n, .1, 4), i = (e - z.value) / V.value, a = (t - B.value) / V.value;
190
+ z.value = e - i * r, B.value = t - a * r, V.value = r;
191
+ }
192
+ function G(e) {
193
+ let t = R.value;
194
+ t && W(t.clientWidth / 2, t.clientHeight / 2, e);
195
+ }
196
+ function Ee(e) {
197
+ e.preventDefault();
198
+ let t = R.value;
199
+ if (!t) return;
200
+ let n = t.getBoundingClientRect();
201
+ W(e.clientX - n.left, e.clientY - n.top, Math.exp(-e.deltaY * .0015));
202
+ }
203
+ let K = !1, q = 0, J = 0, Y = 0, X = 0;
204
+ function De(e) {
205
+ e.button === 0 && (e.target?.closest("[data-node]") || (K = !0, q = e.clientX, J = e.clientY, Y = z.value, X = B.value, e.currentTarget.setPointerCapture(e.pointerId)));
206
+ }
207
+ function Oe(e) {
208
+ K && (z.value = Y + (e.clientX - q), B.value = X + (e.clientY - J));
209
+ }
210
+ function Z(e) {
211
+ if (K) {
212
+ K = !1;
213
+ try {
214
+ e.currentTarget.releasePointerCapture(e.pointerId);
215
+ } catch {}
216
+ }
217
+ }
218
+ function Q(e) {
219
+ e.hasChildren && (N.has(e.node.id) ? N.delete(e.node.id) : N.add(e.node.id));
220
+ }
221
+ let ke = r(() => {
222
+ let e = M.value.map;
223
+ return e ? `${e.format === "opml" ? "OPML" : e.format === "xmind" ? "XMind" : "FreeMind"} · ${e.count} 个节点` : "";
224
+ }), $;
225
+ return d(() => {
226
+ U(), typeof ResizeObserver < "u" && R.value && ($ = new ResizeObserver(() => U()), $.observe(R.value));
227
+ }), ee(() => $?.disconnect()), (e, t) => (f(), a("div", ne, [M.value.error ? (f(), a("p", re, h(M.value.error), 1)) : L.value.nodes.length ? (f(), a(n, { key: 2 }, [o("div", {
228
+ ref_key: "viewport",
229
+ ref: R,
230
+ class: l(["mm__canvas", { "mm__canvas--panning": g(K) }]),
231
+ onWheel: Ee,
232
+ onPointerdown: De,
233
+ onPointermove: Oe,
234
+ onPointerup: Z,
235
+ onPointerleave: Z
236
+ }, [(f(), a("svg", ae, [o("g", { transform: `translate(${z.value},${B.value}) scale(${V.value})` }, [(f(!0), a(n, null, m(L.value.edges, (e, t) => (f(), a("path", {
237
+ key: "e" + t,
238
+ class: "mm__edge",
239
+ d: Ce(e),
240
+ stroke: e.color
241
+ }, null, 8, se))), 128)), (f(!0), a(n, null, m(L.value.nodes, (e) => (f(), a("g", {
242
+ key: e.node.id,
243
+ "data-node": "",
244
+ transform: `translate(${e.x},${e.y - e.h / 2})`,
245
+ class: l({ "mm__node--clickable": e.hasChildren })
246
+ }, [
247
+ o("rect", {
248
+ class: l(["mm__box", {
249
+ "mm__box--root": e.depth === 0,
250
+ "mm__box--branch": e.depth > 0 && e.hasChildren
251
+ }]),
252
+ width: e.w,
253
+ height: e.h,
254
+ rx: "8",
255
+ style: u(we(e)),
256
+ onClick: (t) => Q(e)
257
+ }, null, 14, le),
258
+ o("text", {
259
+ class: "mm__text",
260
+ style: u(Te(e)),
261
+ onClick: (t) => Q(e)
262
+ }, [(f(!0), a(n, null, m(e.lines, (e, t) => (f(), a("tspan", {
263
+ key: t,
264
+ x: C,
265
+ y: w + t * S + S / 2
266
+ }, h(e), 9, ue))), 128))], 12, y),
267
+ e.node.note ? (f(), a("title", de, h(e.node.note), 1)) : i("", !0),
268
+ e.hasChildren ? (f(), a("g", {
269
+ key: 1,
270
+ class: "mm__pip",
271
+ onClick: v((t) => Q(e), ["stop"])
272
+ }, [
273
+ o("circle", {
274
+ cx: e.w,
275
+ cy: e.h / 2,
276
+ r: "7.5"
277
+ }, null, 8, pe),
278
+ o("line", {
279
+ class: "mm__pipsign",
280
+ x1: e.w - 4,
281
+ y1: e.h / 2,
282
+ x2: e.w + 4,
283
+ y2: e.h / 2
284
+ }, null, 8, me),
285
+ e.collapsed ? (f(), a("line", {
286
+ key: 0,
287
+ class: "mm__pipsign",
288
+ x1: e.w,
289
+ y1: e.h / 2 - 4,
290
+ x2: e.w,
291
+ y2: e.h / 2 + 4
292
+ }, null, 8, he)) : i("", !0),
293
+ e.collapsed ? (f(), a("text", {
294
+ key: 1,
295
+ class: "mm__pipcount",
296
+ x: e.w + 12,
297
+ y: e.h / 2,
298
+ "dominant-baseline": "central"
299
+ }, h(e.node.children.length), 9, ge)) : i("", !0)
300
+ ], 8, fe)) : i("", !0),
301
+ e.node.link ? (f(), a("a", {
302
+ key: 2,
303
+ href: e.node.link,
304
+ target: "_blank",
305
+ rel: "noopener noreferrer",
306
+ onClick: t[0] ||= v(() => {}, ["stop"]),
307
+ onPointerdown: t[1] ||= v(() => {}, ["stop"])
308
+ }, [o("text", {
309
+ class: "mm__link",
310
+ x: e.w - 5,
311
+ y: "-3",
312
+ "text-anchor": "end"
313
+ }, "↗", 8, _e)], 40, b)) : i("", !0)
314
+ ], 10, ce))), 128))], 8, oe)]))], 34), o("div", ve, [o("span", ye, h(ke.value), 1), o("span", be, [
315
+ o("button", {
316
+ type: "button",
317
+ class: "mm__tbtn",
318
+ title: "放大",
319
+ onClick: t[2] ||= (e) => G(1.2)
320
+ }, "+"),
321
+ o("button", {
322
+ type: "button",
323
+ class: "mm__tbtn",
324
+ title: "缩小",
325
+ onClick: t[3] ||= (e) => G(1 / 1.2)
326
+ }, "−"),
327
+ o("button", {
328
+ type: "button",
329
+ class: "mm__tbtn mm__tbtn--text",
330
+ title: "适应窗口",
331
+ onClick: U
332
+ }, " 适应 ")
333
+ ])])], 64)) : (f(), a("p", ie, "空的思维导图"))]));
334
+ }
335
+ });
336
+ //#endregion
337
+ export { k as default };
@@ -0,0 +1,7 @@
1
+ import e from "./MissingDependency.vue_vue_type_script_setup_true_lang.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ //#region src/components/MissingDependency.vue
5
+ var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-edb397a0"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shown when an OPTIONAL peer dependency for a format isn't installed in the consumer's app (see
3
+ * docs/file-viewer-package-design.md §4). Tells the user which package to install to enable this viewer,
4
+ * offers a one-click copy of the `npm i …` command, and keeps the file downloadable in the meantime.
5
+ */
6
+ type __VLS_Props = {
7
+ /** The missing npm package name(s). */
8
+ pkg: string | string[];
9
+ /** Human label for the format (e.g. "PDF", "Word 文档"). */
10
+ label?: string;
11
+ /** Download URL for the raw file, so it stays reachable even without a viewer. */
12
+ downloadUrl?: string;
13
+ downloadName?: string;
14
+ };
15
+ 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>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createStaticVNode as i, defineComponent as a, openBlock as o, ref as s, toDisplayString as c } from "vue";
2
+ //#region src/components/MissingDependency.vue?vue&type=script&setup=true&lang.ts
3
+ var l = { class: "missdep" }, u = { class: "missdep__title" }, d = { class: "missdep__cmd" }, f = ["href", "download"], p = /*@__PURE__*/ a({
4
+ __name: "MissingDependency",
5
+ props: {
6
+ pkg: {},
7
+ label: {},
8
+ downloadUrl: {},
9
+ downloadName: {}
10
+ },
11
+ setup(a) {
12
+ let p = a, m = e(() => Array.isArray(p.pkg) ? p.pkg : [p.pkg]), h = e(() => `npm i ${m.value.join(" ")}`), g = s(!1), _;
13
+ async function v() {
14
+ try {
15
+ await navigator.clipboard?.writeText(h.value), g.value = !0, clearTimeout(_), _ = setTimeout(() => g.value = !1, 1400);
16
+ } catch {}
17
+ }
18
+ return (e, s) => (o(), n("div", l, [
19
+ s[0] ||= i("<div class=\"missdep__icon\" aria-hidden=\"true\" data-v-edb397a0><svg viewBox=\"0 0 24 24\" width=\"34\" height=\"34\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" data-v-edb397a0><path d=\"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z\" data-v-edb397a0></path><path d=\"M12 8v4\" stroke-linecap=\"round\" data-v-edb397a0></path><path d=\"M12 16h.01\" stroke-linecap=\"round\" data-v-edb397a0></path></svg></div>", 1),
20
+ r("p", u, "预览" + c(a.label ? ` ${a.label} ` : "此格式") + "需要额外依赖", 1),
21
+ s[1] ||= r("p", { class: "missdep__sub" }, "该格式查看器依赖以下未安装的 npm 包,请在你的项目中安装后重试:", -1),
22
+ r("div", d, [r("code", null, c(h.value), 1), r("button", {
23
+ type: "button",
24
+ class: "missdep__copy",
25
+ onClick: v
26
+ }, c(g.value ? "已复制" : "复制"), 1)]),
27
+ a.downloadUrl ? (o(), n("a", {
28
+ key: 0,
29
+ class: "missdep__dl",
30
+ href: a.downloadUrl,
31
+ download: a.downloadName
32
+ }, "下载原文件", 8, f)) : t("", !0)
33
+ ]));
34
+ }
35
+ });
36
+ //#endregion
37
+ export { p as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./ModelViewer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/ModelViewer.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-6d7b6e6f"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Side-viewer 3D model renderer. Fetches the model bytes and renders them with three.js (async-loaded so the
3
+ * ~1MB library only ships when a model is opened): STL / PLY / OBJ / glTF / GLB. Auto-centers and frames the
4
+ * model, lights it, and gives OrbitControls (drag to rotate, wheel to zoom, right-drag to pan).
5
+ *
6
+ * Best-effort by format: STL/PLY/OBJ are self-contained. A `.glb` is fully embedded and renders cleanly; a
7
+ * `.gltf` that references external `.bin`/textures can't resolve them here (we only hold the one file), so it
8
+ * may render untextured or fail — download it with its assets to view fully. No materials library for OBJ
9
+ * (.mtl isn't fetched), so OBJ shows in a neutral material.
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,157 @@
1
+ import { fileExt as e } from "../lib/fileType.js";
2
+ import { formatBytes as t } from "../lib/format.js";
3
+ import { createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, onMounted as c, openBlock as l, ref as u, toDisplayString as d, unref as f, watch as p } from "vue";
4
+ import * as m from "three";
5
+ import { OrbitControls as h } from "three/examples/jsm/controls/OrbitControls.js";
6
+ import { STLLoader as g } from "three/examples/jsm/loaders/STLLoader.js";
7
+ import { OBJLoader as _ } from "three/examples/jsm/loaders/OBJLoader.js";
8
+ import { PLYLoader as v } from "three/examples/jsm/loaders/PLYLoader.js";
9
+ import { GLTFLoader as y } from "three/examples/jsm/loaders/GLTFLoader.js";
10
+ //#region src/components/ModelViewer.vue?vue&type=script&setup=true&lang.ts
11
+ var b = { class: "mdl" }, x = {
12
+ key: 0,
13
+ class: "mdl__msg"
14
+ }, S = {
15
+ key: 1,
16
+ class: "mdl__msg mdl__gate"
17
+ }, C = {
18
+ key: 2,
19
+ class: "mdl__msg mdl__msg--error"
20
+ }, w = {
21
+ key: 3,
22
+ class: "mdl__hint mdl__hint--float"
23
+ }, T = 96 * 1024 * 1024, E = /*@__PURE__*/ a({
24
+ __name: "ModelViewer",
25
+ props: {
26
+ url: {},
27
+ name: {},
28
+ size: {}
29
+ },
30
+ setup(a) {
31
+ let E = a, D = u("loading"), O = u(""), k = u(null), A = null, j = null, M = null, N = null, P = null, F = 0, I = null;
32
+ function L(e) {
33
+ e.traverse((e) => {
34
+ let t = e;
35
+ t.geometry && t.geometry.dispose();
36
+ let n = t.material;
37
+ Array.isArray(n) ? n.forEach((e) => e.dispose()) : n && n.dispose();
38
+ });
39
+ }
40
+ function R() {
41
+ P && j && (j.remove(P), L(P), P = null);
42
+ }
43
+ function z() {
44
+ let e = k.value;
45
+ if (!e || A) return;
46
+ let t = e.clientWidth || 1, n = e.clientHeight || 1;
47
+ j = new m.Scene(), M = new m.PerspectiveCamera(50, t / n, .1, 2e3), M.position.set(2, 1.5, 3), A = new m.WebGLRenderer({
48
+ antialias: !0,
49
+ alpha: !0
50
+ }), A.setPixelRatio(Math.min(2, window.devicePixelRatio || 1)), A.setSize(t, n), e.appendChild(A.domElement), j.add(new m.HemisphereLight(16777215, 4473941, 1.1));
51
+ let r = new m.DirectionalLight(16777215, 1.4);
52
+ r.position.set(4, 6, 5), j.add(r);
53
+ let i = new m.DirectionalLight(16777215, .5);
54
+ i.position.set(-5, -2, -4), j.add(i), N = new h(M, A.domElement), N.enableDamping = !0, N.dampingFactor = .08, I = new ResizeObserver(B), I.observe(e);
55
+ let a = () => {
56
+ F = requestAnimationFrame(a), N?.update(), A && j && M && A.render(j, M);
57
+ };
58
+ a();
59
+ }
60
+ function B() {
61
+ let e = k.value;
62
+ if (!e || !A || !M) return;
63
+ let t = e.clientWidth || 1, n = e.clientHeight || 1;
64
+ A.setSize(t, n), M.aspect = t / n, M.updateProjectionMatrix();
65
+ }
66
+ function V(e) {
67
+ if (!M || !N) return;
68
+ let t = new m.Box3().setFromObject(e), n = t.getSize(new m.Vector3()), r = t.getCenter(new m.Vector3());
69
+ e.position.sub(r);
70
+ let i = Math.max(n.x, n.y, n.z) || 1, a = M.fov * Math.PI / 180, o = i / (2 * Math.tan(a / 2)) * 1.6;
71
+ M.position.set(o * .6, o * .45, o), M.near = Math.max(o / 1e3, .001), M.far = o * 1e3, M.updateProjectionMatrix(), N.target.set(0, 0, 0), N.update();
72
+ }
73
+ let H = () => new m.MeshStandardMaterial({
74
+ color: 10135476,
75
+ metalness: .1,
76
+ roughness: .7,
77
+ side: m.DoubleSide
78
+ });
79
+ async function U(e, t) {
80
+ if (t === "stl") {
81
+ let t = new g().parse(e);
82
+ return t.computeVertexNormals(), new m.Mesh(t, H());
83
+ }
84
+ if (t === "ply") {
85
+ let t = new v().parse(e);
86
+ t.computeVertexNormals();
87
+ let n = t.hasAttribute("color") ? new m.MeshStandardMaterial({
88
+ vertexColors: !0,
89
+ side: m.DoubleSide,
90
+ roughness: .7
91
+ }) : H();
92
+ return new m.Mesh(t, n);
93
+ }
94
+ if (t === "obj") {
95
+ let t = new _().parse(new TextDecoder().decode(e));
96
+ return t.traverse((e) => {
97
+ let t = e;
98
+ t.isMesh && (t.material = H());
99
+ }), t;
100
+ }
101
+ let n = t === "gltf" ? new TextDecoder().decode(e) : e;
102
+ return (await new Promise((e, t) => {
103
+ new y().parse(n, "", (t) => e(t), t);
104
+ })).scene;
105
+ }
106
+ async function W() {
107
+ if (E.url) {
108
+ D.value = "loading", O.value = "";
109
+ try {
110
+ let t = await fetch(E.url);
111
+ if (!t.ok) throw Error(`HTTP ${t.status}`);
112
+ let n = await t.arrayBuffer();
113
+ if (z(), !j) throw Error("WebGL 初始化失败");
114
+ R();
115
+ let r = await U(n, e(E.name));
116
+ P = r, j.add(r), V(r), D.value = "ready";
117
+ } catch (e) {
118
+ O.value = e instanceof Error ? e.message : String(e), D.value = "error";
119
+ }
120
+ }
121
+ }
122
+ function G() {
123
+ if (E.size && E.size > T) {
124
+ D.value = "gate";
125
+ return;
126
+ }
127
+ W();
128
+ }
129
+ return c(() => {
130
+ p(() => E.url, G, { immediate: !0 });
131
+ }), s(() => {
132
+ cancelAnimationFrame(F), I?.disconnect(), R(), N?.dispose(), A && (A.dispose(), A.domElement.remove()), A = null, j = null, M = null, N = null;
133
+ }), (e, a) => (l(), r("div", b, [
134
+ D.value === "loading" ? (l(), r("p", x, "正在加载模型…")) : D.value === "gate" ? (l(), r("div", S, [i("p", null, "该模型较大(" + d(f(t)(E.size)) + "),将在浏览器内解析。是否继续?", 1), i("button", {
135
+ type: "button",
136
+ class: "mdl__btn",
137
+ onClick: W
138
+ }, "加载并预览")])) : D.value === "error" ? (l(), r("div", C, [
139
+ i("p", null, "加载失败:" + d(O.value), 1),
140
+ a[0] ||= i("p", { class: "mdl__hint" }, " 外部引用的 .gltf(需配套 .bin/贴图)或压缩网格可能无法在此渲染,可下载后用本地工具打开。 ", -1),
141
+ i("button", {
142
+ type: "button",
143
+ class: "mdl__btn",
144
+ onClick: W
145
+ }, "重试")
146
+ ])) : n("", !0),
147
+ i("div", {
148
+ ref_key: "host",
149
+ ref: k,
150
+ class: o(["mdl__host", { "mdl__host--hidden": D.value !== "ready" }])
151
+ }, null, 2),
152
+ D.value === "ready" ? (l(), r("div", w, " 拖动旋转 · 滚轮缩放 · 右键平移 ")) : n("", !0)
153
+ ]));
154
+ }
155
+ });
156
+ //#endregion
157
+ export { E as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./MsiViewer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/MsiViewer.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-0c6afdf2"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The side viewer's MSI mode: fetch a Windows Installer `.msi`, parse its OLE compound-file structure
3
+ * entirely in-browser (see lib/msi.ts), and surface the install metadata — the product identity (name /
4
+ * version / codes / publisher) from the Property table, plus the SummaryInformation (platform, package
5
+ * code, authoring tool, dates). Mirrors BinObjBrowser: the bytes come from the same download endpoint as
6
+ * any other file and never leave the browser. An `.msi` is NOT a PE (that's BinObjBrowser) — it's the
7
+ * same OLE2 container legacy Office docs use, which is why this is a separate viewer.
8
+ *
9
+ * Large-file gate: an `.msi` can be tens of MB and parsing needs the whole file in memory, so unless the
10
+ * manifest size is known to be small (≤ LARGE_THRESHOLD) we show a confirm card and only fetch on click.
11
+ */
12
+ type __VLS_Props = {
13
+ url: string;
14
+ name: string;
15
+ size?: number;
16
+ };
17
+ 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>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;