@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,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./XmindViewer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/XmindViewer.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-c7c338e2"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Side-viewer for XMind workbooks (.xmind). Fetches the bytes, unzips + parses `content.json` / `content.xml`
3
+ * in-browser (see lib/xmind.ts — reuses the project's ZIP reader), then hands the normalized tree to the shared
4
+ * MindMapView so an XMind renders as the same interactive mind map as OPML / FreeMind. Nothing leaves the browser.
5
+ */
6
+ type __VLS_Props = {
7
+ url?: string;
8
+ name: string;
9
+ size?: number;
10
+ };
11
+ 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>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,48 @@
1
+ import { fileExt as e } from "../lib/fileType.js";
2
+ import t from "./MindMapView.js";
3
+ import { parseXmind as n } from "../lib/xmind.js";
4
+ import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, openBlock as l, ref as u, toDisplayString as d, watch as f } from "vue";
5
+ //#region src/components/XmindViewer.vue?vue&type=script&setup=true&lang.ts
6
+ var p = { class: "xm" }, m = {
7
+ key: 0,
8
+ class: "xm__msg"
9
+ }, h = {
10
+ key: 1,
11
+ class: "xm__msg xm__msg--error"
12
+ }, g = /*@__PURE__*/ c({
13
+ __name: "XmindViewer",
14
+ props: {
15
+ url: {},
16
+ name: {},
17
+ size: {}
18
+ },
19
+ setup(c) {
20
+ let g = c, _ = u("loading"), v = u(null), y = u(""), b = r(() => {
21
+ let t = g.name || "", n = e(t);
22
+ return n ? t.slice(0, t.length - n.length - 1) : t;
23
+ });
24
+ async function x() {
25
+ if (g.url) {
26
+ _.value = "loading", y.value = "", v.value = null;
27
+ try {
28
+ let e = await fetch(g.url);
29
+ if (!e.ok) throw Error(`HTTP ${e.status}`);
30
+ v.value = await n(await e.arrayBuffer(), b.value), _.value = "ready";
31
+ } catch (e) {
32
+ y.value = e instanceof Error ? e.message : String(e), _.value = "error";
33
+ }
34
+ }
35
+ }
36
+ return f(() => g.url, x, { immediate: !0 }), (e, n) => (l(), o("div", p, [_.value === "loading" ? (l(), o("p", m, "正在解析 XMind…")) : _.value === "error" ? (l(), o("div", h, [s("p", null, "解析失败:" + d(y.value), 1), s("button", {
37
+ type: "button",
38
+ class: "xm__btn",
39
+ onClick: x
40
+ }, "重试")])) : v.value ? (l(), i(t, {
41
+ key: 2,
42
+ map: v.value,
43
+ name: c.name
44
+ }, null, 8, ["map", "name"])) : a("", !0)]));
45
+ }
46
+ });
47
+ //#endregion
48
+ export { g as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./ZipBrowser.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/ZipBrowser.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-04e7e09d"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The side viewer's ZIP mode: fetch an archive's bytes, decompress them entirely in-browser (see lib/zip.ts),
3
+ * and browse the contents. A master→detail within the narrow pane — a collapsible file tree, and selecting an
4
+ * entry extracts just that one, wraps it in a blob URL, and hands it to {@link FileViewerBody} (so a file
5
+ * inside the zip previews with every viewer a top-level file gets — code/image/pdf/cert/audio/nested-zip/…).
6
+ * No entry bytes are kept around: selecting decodes on demand, and the download button re-extracts.
7
+ */
8
+ type __VLS_Props = {
9
+ url: string;
10
+ name: string;
11
+ };
12
+ 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>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,326 @@
1
+ import { fileExt as e, isDicomFile as t, isTextFile as n } from "../lib/fileType.js";
2
+ import { canToggleView as r, classifyViewerFile as i, mediaMimeForName as ee } from "../lib/viewerKind.js";
3
+ import { formatBytes as a } from "../lib/format.js";
4
+ import o from "./icons/Icon.js";
5
+ import { ZipEncryptedError as te, ZipPasswordError as s, extractZipEntry as c, readZip as ne, zipSupported as re } from "../lib/zip.js";
6
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, normalizeClass as v, normalizeStyle as ie, onBeforeUnmount as ae, onMounted as oe, openBlock as y, reactive as se, ref as b, renderList as ce, toDisplayString as x, unref as S, vModelText as le, watch as ue, withDirectives as de, withKeys as fe } from "vue";
7
+ //#region src/components/ZipBrowser.vue?vue&type=script&setup=true&lang.ts
8
+ var pe = { class: "zip" }, me = {
9
+ key: 0,
10
+ class: "zip__msg"
11
+ }, he = {
12
+ key: 1,
13
+ class: "zip__msg zip__msg--error"
14
+ }, ge = { class: "zip__bar" }, _e = ["title"], ve = { class: "zip__bsize" }, ye = {
15
+ key: 0,
16
+ class: "zip__view",
17
+ role: "group",
18
+ "aria-label": "渲染或源码"
19
+ }, be = ["title"], xe = {
20
+ key: 0,
21
+ class: "zip__msg"
22
+ }, Se = {
23
+ key: 1,
24
+ class: "zip__msg zip__msg--error"
25
+ }, Ce = { class: "zip__summary" }, we = ["placeholder"], Te = {
26
+ key: 0,
27
+ class: "zip__pwerr"
28
+ }, Ee = { class: "zip__scroll zip__tree" }, De = {
29
+ key: 0,
30
+ class: "zip__msg"
31
+ }, Oe = ["onClick"], ke = { class: "zip__twisty" }, Ae = { class: "zip__rowicon" }, je = { class: "zip__rowname" }, Me = {
32
+ key: 1,
33
+ class: "zip__rowsize"
34
+ }, C = /*@__PURE__*/ _({
35
+ __name: "ZipBrowser",
36
+ props: {
37
+ url: {},
38
+ name: {}
39
+ },
40
+ setup(_) {
41
+ let C = g(() => import("./DicomViewer.js")), Ne = g(() => import("./FileViewerBody.js")), w = _, T = b("loading"), E = b(""), D = null, O = b([]), k = b(""), A = b(""), j = b(!1), Pe = u(() => O.value.some((e) => e.encrypted)), M = b({
42
+ name: "",
43
+ path: "",
44
+ isDir: !0,
45
+ size: 0,
46
+ children: []
47
+ }), N = se(/* @__PURE__ */ new Set()), Fe = u(() => O.value.reduce((e, t) => e + +!t.isDir, 0)), Ie = u(() => O.value.reduce((e, t) => e + (t.isDir ? 0 : t.size), 0));
48
+ function Le(e) {
49
+ let t = {
50
+ name: "",
51
+ path: "",
52
+ isDir: !0,
53
+ size: 0,
54
+ children: []
55
+ }, n = new Map([["", t]]), r = (e) => {
56
+ let r = t, i = "";
57
+ for (let t of e) {
58
+ i = i ? `${i}/${t}` : t;
59
+ let e = n.get(i);
60
+ e || (e = {
61
+ name: t,
62
+ path: i,
63
+ isDir: !0,
64
+ size: 0,
65
+ children: []
66
+ }, n.set(i, e), r.children.push(e)), r = e;
67
+ }
68
+ return r;
69
+ };
70
+ for (let t of e) {
71
+ let e = t.path.split("/").filter(Boolean);
72
+ if (t.isDir) {
73
+ r(e);
74
+ continue;
75
+ }
76
+ let n = e.pop();
77
+ n && r(e).children.push({
78
+ name: n,
79
+ path: t.path,
80
+ isDir: !1,
81
+ size: t.size,
82
+ entry: t,
83
+ children: []
84
+ });
85
+ }
86
+ return P(t), t;
87
+ }
88
+ function P(e) {
89
+ e.children.sort((e, t) => e.isDir === t.isDir ? e.name.localeCompare(t.name) : e.isDir ? -1 : 1);
90
+ for (let t of e.children) t.isDir && P(t);
91
+ }
92
+ let F = u(() => {
93
+ let e = [], t = (n, r) => {
94
+ for (let i of n) e.push({
95
+ node: i,
96
+ depth: r
97
+ }), i.isDir && N.has(i.path) && t(i.children, r + 1);
98
+ };
99
+ return t(M.value.children, 0), e;
100
+ });
101
+ async function I() {
102
+ if (T.value = "loading", E.value = "", L.value = null, k.value = "", A.value = "", j.value = !1, J(), G.value = [], !re()) {
103
+ E.value = "当前浏览器不支持在前端解压 ZIP(缺少 DecompressionStream)", T.value = "error";
104
+ return;
105
+ }
106
+ try {
107
+ let e = await fetch(w.url);
108
+ if (!e.ok) throw Error(`HTTP ${e.status}`);
109
+ D = await e.arrayBuffer();
110
+ let t = ne(D);
111
+ O.value = t, M.value = Le(t), N.clear(), T.value = "ready";
112
+ } catch (e) {
113
+ E.value = e instanceof Error ? e.message : String(e), T.value = "error";
114
+ }
115
+ }
116
+ let L = b(null), R = b("ready"), z = b(""), B = b(""), V = b(null), H = b(!1), U = b("render"), W = b(""), G = b([]), K = b(0), q = b(""), Re = u(() => G.value.reduce((e, t) => e + (t.size ?? 0), 0)), ze = u(() => r(V.value, B.value));
117
+ function J() {
118
+ W.value &&= (URL.revokeObjectURL(W.value), "");
119
+ }
120
+ function Y(e) {
121
+ let t = e.lastIndexOf("/");
122
+ return t < 0 ? "" : e.slice(0, t);
123
+ }
124
+ function Be(e) {
125
+ let n = Y(e.path);
126
+ return O.value.filter((e) => !e.isDir && t(e.name) && Y(e.path) === n).sort((e, t) => e.path.localeCompare(t.path, void 0, {
127
+ numeric: !0,
128
+ sensitivity: "base"
129
+ }));
130
+ }
131
+ function Ve(t, r) {
132
+ if (n(r)) return !0;
133
+ if (e(r)) return !1;
134
+ let i = Math.min(t.length, 4096);
135
+ for (let e = 0; e < i; e++) if (t[e] === 0) return !1;
136
+ return !0;
137
+ }
138
+ async function X(e) {
139
+ if (L.value = e, R.value = "loading", z.value = "", B.value = "", V.value = null, H.value = !1, U.value = "render", J(), G.value = [], D) try {
140
+ if (t(e.name)) {
141
+ let t = Be(e);
142
+ if (t.length > 1) {
143
+ G.value = t.map((e) => ({
144
+ name: e.name,
145
+ size: e.size,
146
+ load: async () => {
147
+ let t = await c(D, e, k.value), n = new ArrayBuffer(t.byteLength);
148
+ return new Uint8Array(n).set(t), n;
149
+ }
150
+ })), K.value = Math.max(0, t.findIndex((t) => t.path === e.path)), q.value = Y(e.path).split("/").pop() || e.name, H.value = !0, R.value = "ready";
151
+ return;
152
+ }
153
+ }
154
+ let n = await c(D, e, k.value);
155
+ if (L.value !== e) return;
156
+ W.value = URL.createObjectURL(new Blob([n], { type: ee(e.name) })), V.value = i({
157
+ name: e.name,
158
+ url: W.value,
159
+ size: e.size,
160
+ textHint: Ve(n, e.name)
161
+ }), R.value = "ready";
162
+ } catch (e) {
163
+ e instanceof te ? z.value = "该文件已加密:请返回列表并在顶部输入密码" : e instanceof s ? (z.value = "密码错误", j.value = !1) : z.value = e instanceof Error ? e.message : String(e), R.value = "error";
164
+ }
165
+ }
166
+ async function Z() {
167
+ A.value = "";
168
+ let e = O.value.find((e) => !e.isDir && e.encrypted && e.size > 0);
169
+ if (!e || !D) {
170
+ j.value = !0;
171
+ return;
172
+ }
173
+ try {
174
+ await c(D, e, k.value), j.value = !0, L.value && X(L.value);
175
+ } catch (e) {
176
+ j.value = !1, A.value = e instanceof s ? "密码错误" : e instanceof Error ? e.message : String(e);
177
+ }
178
+ }
179
+ function He(e) {
180
+ e.isDir ? N.has(e.path) ? N.delete(e.path) : N.add(e.path) : e.entry && X(e.entry);
181
+ }
182
+ function Ue() {
183
+ L.value = null, B.value = "", V.value = null, H.value = !1, J(), G.value = [];
184
+ }
185
+ async function We(e) {
186
+ if (D) try {
187
+ let t = URL.createObjectURL(new Blob([await c(D, e, k.value)])), n = document.createElement("a");
188
+ n.href = t, n.download = e.name, document.body.appendChild(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 1e3);
189
+ } catch {}
190
+ }
191
+ let Q = b(!1), $;
192
+ async function Ge() {
193
+ try {
194
+ await navigator.clipboard?.writeText(B.value);
195
+ } catch {}
196
+ Q.value = !0, clearTimeout($), $ = setTimeout(() => Q.value = !1, 1400);
197
+ }
198
+ return oe(I), ue(() => w.url, I), ae(() => {
199
+ J(), clearTimeout($);
200
+ }), (e, t) => (y(), p("div", pe, [T.value === "loading" ? (y(), p("p", me, "正在解压…")) : T.value === "error" ? (y(), p("div", he, [m("p", null, x(E.value), 1), m("button", {
201
+ type: "button",
202
+ class: "zip__retry",
203
+ onClick: I
204
+ }, "重试")])) : L.value ? (y(), p(l, { key: 2 }, [m("div", ge, [
205
+ m("button", {
206
+ type: "button",
207
+ class: "zip__back",
208
+ title: "返回列表",
209
+ onClick: Ue
210
+ }, [h(o, {
211
+ name: "arrowLeft",
212
+ size: 16
213
+ })]),
214
+ m("span", {
215
+ class: "zip__path",
216
+ title: L.value.path
217
+ }, x(L.value.path), 9, _e),
218
+ m("span", ve, x(S(a)(L.value.size)), 1),
219
+ ze.value ? (y(), p("div", ye, [m("button", {
220
+ type: "button",
221
+ class: v(["zip__vbtn", { "zip__vbtn--on": U.value === "render" }]),
222
+ title: "渲染",
223
+ onClick: t[0] ||= (e) => U.value = "render"
224
+ }, [h(o, {
225
+ name: "eye",
226
+ size: 14
227
+ })], 2), m("button", {
228
+ type: "button",
229
+ class: v(["zip__vbtn", { "zip__vbtn--on": U.value === "source" }]),
230
+ title: "源码",
231
+ onClick: t[1] ||= (e) => U.value = "source"
232
+ }, [h(o, {
233
+ name: "code",
234
+ size: 14
235
+ })], 2)])) : f("", !0),
236
+ B.value && R.value === "ready" ? (y(), p("button", {
237
+ key: 1,
238
+ type: "button",
239
+ class: "zip__act",
240
+ title: Q.value ? "已复制" : "复制",
241
+ onClick: Ge
242
+ }, [h(o, {
243
+ name: "copy",
244
+ size: 14
245
+ })], 8, be)) : f("", !0),
246
+ m("button", {
247
+ type: "button",
248
+ class: "zip__act",
249
+ title: "下载",
250
+ onClick: t[2] ||= (e) => We(L.value)
251
+ }, [h(o, {
252
+ name: "download",
253
+ size: 15
254
+ })])
255
+ ]), R.value === "loading" ? (y(), p("p", xe, "读取中…")) : R.value === "error" ? (y(), p("div", Se, [m("p", null, x(z.value), 1)])) : H.value ? (y(), d(S(C), {
256
+ key: 2,
257
+ slices: G.value,
258
+ start: K.value,
259
+ name: q.value,
260
+ size: Re.value
261
+ }, null, 8, [
262
+ "slices",
263
+ "start",
264
+ "name",
265
+ "size"
266
+ ])) : V.value ? (y(), d(S(Ne), {
267
+ key: 3,
268
+ file: V.value,
269
+ mode: U.value,
270
+ onLoaded: t[3] ||= (e) => B.value = e
271
+ }, null, 8, ["file", "mode"])) : f("", !0)], 64)) : (y(), p(l, { key: 3 }, [
272
+ m("div", Ce, x(Fe.value) + " 个文件 · " + x(S(a)(Ie.value)), 1),
273
+ Pe.value ? (y(), p("div", {
274
+ key: 0,
275
+ class: v(["zip__pw", { "zip__pw--ok": j.value }])
276
+ }, [
277
+ h(o, {
278
+ name: "key",
279
+ size: 14
280
+ }),
281
+ de(m("input", {
282
+ "onUpdate:modelValue": t[4] ||= (e) => k.value = e,
283
+ type: "password",
284
+ class: "zip__pwinput",
285
+ placeholder: j.value ? "已解锁(如需可重新输入)" : "此压缩包已加密,输入密码解锁",
286
+ onKeyup: fe(Z, ["enter"])
287
+ }, null, 40, we), [[le, k.value]]),
288
+ m("button", {
289
+ type: "button",
290
+ class: "zip__pwbtn",
291
+ onClick: Z
292
+ }, x(j.value ? "已解锁" : "解锁"), 1),
293
+ A.value ? (y(), p("span", Te, x(A.value), 1)) : f("", !0)
294
+ ], 2)) : f("", !0),
295
+ m("div", Ee, [F.value.length === 0 ? (y(), p("p", De, "空压缩包")) : f("", !0), (y(!0), p(l, null, ce(F.value, (e) => (y(), p("button", {
296
+ key: e.node.path,
297
+ type: "button",
298
+ class: v(["zip__row", { "zip__row--dir": e.node.isDir }]),
299
+ style: ie({ paddingLeft: `${12 + e.depth * 14}px` }),
300
+ onClick: (t) => He(e.node)
301
+ }, [
302
+ m("span", ke, [e.node.isDir ? (y(), d(o, {
303
+ key: 0,
304
+ name: "chevronRight",
305
+ size: 13,
306
+ class: v({ "zip__twisty--open": N.has(e.node.path) })
307
+ }, null, 8, ["class"])) : f("", !0)]),
308
+ m("span", Ae, [h(o, {
309
+ name: e.node.isDir ? "folder" : "fileOutline",
310
+ size: 15
311
+ }, null, 8, ["name"])]),
312
+ m("span", je, x(e.node.name), 1),
313
+ e.node.entry?.encrypted ? (y(), d(o, {
314
+ key: 0,
315
+ name: "key",
316
+ size: 12,
317
+ class: "zip__rowlock",
318
+ title: "已加密"
319
+ })) : f("", !0),
320
+ e.node.isDir ? f("", !0) : (y(), p("span", Me, x(S(a)(e.node.size)), 1))
321
+ ], 14, Oe))), 128))])
322
+ ], 64))]));
323
+ }
324
+ });
325
+ //#endregion
326
+ export { C as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./ZoomImage.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/ZoomImage.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-96f5f467"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A pan + zoom image stage, shared by the full-screen {@link ImageLightbox} and the in-archive image preview
3
+ * ({@link ZipBrowser}/{@link SevenZipBrowser}/{@link ArchiveBrowser}). Fills its parent (which must give it a
4
+ * size). Wheel zooms toward the cursor, drag pans, double-click toggles fit↔2×, and a bottom toolbar offers
5
+ * −/百分比/+. Initial fit is "contain" for a normal image, or fill-width-top-aligned for a `long` one (a tall
6
+ * screenshot) so it reads top-down and pans vertically. A no-drag click on empty area emits `emptyClick` (the
7
+ * lightbox closes on it; the archive preview ignores it).
8
+ *
9
+ * Exposes `zoomIn`/`zoomOut`/`fit` so a host can wire keyboard shortcuts to them.
10
+ */
11
+ type __VLS_Props = {
12
+ src: string;
13
+ alt?: string;
14
+ long?: boolean;
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
17
+ zoomIn: () => void;
18
+ zoomOut: () => void;
19
+ fit: () => void;
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ emptyClick: () => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onEmptyClick?: (() => any) | undefined;
24
+ }>, {
25
+ alt: string;
26
+ long: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
@@ -0,0 +1,147 @@
1
+ import { createElementBlock as e, createElementVNode as t, defineComponent as n, normalizeClass as r, normalizeStyle as i, onBeforeUnmount as a, onMounted as o, openBlock as s, ref as c, toDisplayString as l, watch as u, withModifiers as d } from "vue";
2
+ //#region src/components/ZoomImage.vue?vue&type=script&setup=true&lang.ts
3
+ var f = ["src", "alt"], p = /*@__PURE__*/ n({
4
+ __name: "ZoomImage",
5
+ props: {
6
+ src: {},
7
+ alt: { default: "" },
8
+ long: {
9
+ type: Boolean,
10
+ default: !1
11
+ }
12
+ },
13
+ emits: ["emptyClick"],
14
+ setup(n, { expose: p, emit: m }) {
15
+ let h = n, g = m, _ = c(null), v = c(null), y = c(0), b = c(0), x = c(1), S = c(0), C = c(0), w = c(1), T = c(!1), E = c(100);
16
+ function D() {
17
+ E.value = Math.round(x.value * 100);
18
+ }
19
+ function O() {
20
+ let e = _.value;
21
+ return e && e.clientWidth ? {
22
+ w: e.clientWidth,
23
+ h: e.clientHeight
24
+ } : {
25
+ w: 1024,
26
+ h: 768
27
+ };
28
+ }
29
+ function k() {
30
+ return Math.max(.05, Math.min(w.value, 1) * .5);
31
+ }
32
+ function A() {
33
+ return Math.max(w.value, 1) * 8;
34
+ }
35
+ function j(e = !1) {
36
+ let { w: t, h: n } = O(), r = y.value * x.value, i = b.value * x.value;
37
+ S.value = r <= t ? (t - r) / 2 : Math.min(0, Math.max(t - r, S.value)), i <= n ? C.value = (n - i) / 2 : e ? C.value = 0 : C.value = Math.min(0, Math.max(n - i, C.value)), D();
38
+ }
39
+ function M() {
40
+ if (!y.value || !b.value) return;
41
+ let { w: e, h: t } = O();
42
+ w.value = Math.min(e / y.value, t / b.value), x.value = h.long ? e * .98 / y.value : Math.min(w.value, 1), j(h.long);
43
+ }
44
+ function N(e) {
45
+ return Math.min(A(), Math.max(k(), e));
46
+ }
47
+ function P(e, t, n) {
48
+ let r = N(x.value * n);
49
+ if (r === x.value) return;
50
+ let i = (e - S.value) / x.value, a = (t - C.value) / x.value;
51
+ x.value = r, S.value = e - i * r, C.value = t - a * r, j(!1);
52
+ }
53
+ function F(e) {
54
+ let { w: t, h: n } = O();
55
+ P(t / 2, n / 2, e);
56
+ }
57
+ function I(e) {
58
+ let t = _.value?.getBoundingClientRect();
59
+ P(t ? e.clientX - t.left : e.clientX, t ? e.clientY - t.top : e.clientY, e.deltaY < 0 ? 1.15 : 1 / 1.15);
60
+ }
61
+ function L(e) {
62
+ let t = _.value?.getBoundingClientRect(), n = t ? e.clientX - t.left : e.clientX, r = t ? e.clientY - t.top : e.clientY;
63
+ x.value <= w.value * 1.05 ? P(n, r, Math.max(2, 1 / Math.max(w.value, .001))) : M();
64
+ }
65
+ let R = !1, z = !1, B = 0, V = 0, H = null;
66
+ function U(e) {
67
+ e.button === 0 && (R = !0, z = !1, B = e.clientX, V = e.clientY, H = e.target, _.value?.setPointerCapture(e.pointerId));
68
+ }
69
+ function W(e) {
70
+ if (!R) return;
71
+ let t = e.clientX - B, n = e.clientY - V;
72
+ !z && Math.abs(t) + Math.abs(n) > 3 && (z = !0), B = e.clientX, V = e.clientY, S.value += t, C.value += n, j(!1);
73
+ }
74
+ function G(e) {
75
+ if (R) {
76
+ R = !1;
77
+ try {
78
+ _.value?.releasePointerCapture(e.pointerId);
79
+ } catch {}
80
+ !z && H !== v.value && g("emptyClick");
81
+ }
82
+ }
83
+ function K() {
84
+ let e = v.value;
85
+ e && (y.value = e.naturalWidth || 1, b.value = e.naturalHeight || 1, M(), T.value = !0);
86
+ }
87
+ let q = null;
88
+ function J() {
89
+ T.value && M();
90
+ }
91
+ return u(() => h.src, () => {
92
+ T.value = !1, y.value = 0, b.value = 0, x.value = 1, S.value = 0, C.value = 0, w.value = 1, D();
93
+ }), o(() => {
94
+ typeof ResizeObserver < "u" && _.value && (q = new ResizeObserver(J), q.observe(_.value));
95
+ }), a(() => q?.disconnect()), p({
96
+ zoomIn: () => F(1.2),
97
+ zoomOut: () => F(1 / 1.2),
98
+ fit: () => M()
99
+ }), (a, o) => (s(), e("div", {
100
+ ref_key: "stageEl",
101
+ ref: _,
102
+ class: r(["zi", { "zi--grab": x.value > w.value }]),
103
+ onWheel: d(I, ["prevent"]),
104
+ onPointerdown: U,
105
+ onPointermove: W,
106
+ onPointerup: G,
107
+ onPointercancel: G,
108
+ onDblclick: L
109
+ }, [t("img", {
110
+ ref_key: "imgEl",
111
+ ref: v,
112
+ class: r(["zi__img", { "zi__img--ready": T.value }]),
113
+ src: n.src,
114
+ alt: n.alt,
115
+ draggable: "false",
116
+ style: i({ transform: `translate(${S.value}px, ${C.value}px) scale(${x.value})` }),
117
+ onLoad: K,
118
+ onDragstart: o[0] ||= d(() => {}, ["prevent"])
119
+ }, null, 46, f), t("div", {
120
+ class: "zi__toolbar",
121
+ onPointerdown: o[4] ||= d(() => {}, ["stop"]),
122
+ onDblclick: o[5] ||= d(() => {}, ["stop"]),
123
+ onWheel: o[6] ||= d(() => {}, ["stop"])
124
+ }, [
125
+ t("button", {
126
+ type: "button",
127
+ class: "zi__tool",
128
+ title: "缩小 (-)",
129
+ onClick: o[1] ||= (e) => F(1 / 1.2)
130
+ }, " − "),
131
+ t("button", {
132
+ type: "button",
133
+ class: "zi__pct",
134
+ title: "适应窗口 (0)",
135
+ onClick: o[2] ||= (e) => M()
136
+ }, l(E.value) + "% ", 1),
137
+ t("button", {
138
+ type: "button",
139
+ class: "zi__tool",
140
+ title: "放大 (+)",
141
+ onClick: o[3] ||= (e) => F(1.2)
142
+ }, "+")
143
+ ], 32)], 34));
144
+ }
145
+ });
146
+ //#endregion
147
+ export { p as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./EplCodeBlock.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/epl/EplCodeBlock.vue
5
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-4eade126"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,15 @@
1
+ import type { CodeLine } from '@/lib/epl';
2
+ /**
3
+ * Renders a method body as the 易语言 IDE does: a line-number gutter (numbers come from the document-wide
4
+ * counter via `nos`, so they stay continuous with the definition tables above), dashed block-guide brackets
5
+ * in the indent columns (corner at a block's header/footer, tee to each inner line — precomputed in
6
+ * {@link methodCodeLines}), and lightly syntax-coloured text (comments green, strings red, keyword blue with
7
+ * its leading `.` hidden).
8
+ */
9
+ type __VLS_Props = {
10
+ lines: CodeLine[];
11
+ nos: (number | null)[];
12
+ };
13
+ 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>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;