omni-viewer-core 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 (387) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/THIRD_PARTY_NOTICES.md +49 -0
  4. package/dist/assets/audio-engine/audio_engine.mjs +2 -0
  5. package/dist/assets/audio-engine/audio_engine.wasm +0 -0
  6. package/dist/assets/pdfjs/pdf.worker.min.mjs +21 -0
  7. package/dist/host/index.d.ts +133 -0
  8. package/dist/host/index.js +10 -0
  9. package/dist/i18n/catalog.en.d.ts +1 -0
  10. package/dist/i18n/catalog.en.js +411 -0
  11. package/dist/i18n/catalog.ko.d.ts +1 -0
  12. package/dist/i18n/catalog.ko.js +68 -0
  13. package/dist/i18n/index.d.ts +18 -0
  14. package/dist/i18n/index.js +41 -0
  15. package/dist/licenses/emscripten.txt +101 -0
  16. package/dist/licenses/kissfft.txt +28 -0
  17. package/dist/licenses/pdfjs-dist.txt +177 -0
  18. package/dist/parsers/a2l/index.d.ts +1 -0
  19. package/dist/parsers/a2l/index.js +1 -0
  20. package/dist/parsers/archive/index.d.ts +22 -0
  21. package/dist/parsers/archive/index.js +46 -0
  22. package/dist/parsers/archive/model.d.ts +29 -0
  23. package/dist/parsers/archive/model.js +1 -0
  24. package/dist/parsers/archive/worker.d.ts +21 -0
  25. package/dist/parsers/archive/worker.js +1 -0
  26. package/dist/parsers/arxml/index.d.ts +1 -0
  27. package/dist/parsers/arxml/index.js +1 -0
  28. package/dist/parsers/asc/index.d.ts +1 -0
  29. package/dist/parsers/asc/index.js +1 -0
  30. package/dist/parsers/audio/index.d.ts +9 -0
  31. package/dist/parsers/audio/index.js +46 -0
  32. package/dist/parsers/automotive/index.d.ts +33 -0
  33. package/dist/parsers/automotive/index.js +973 -0
  34. package/dist/parsers/blf/index.d.ts +1 -0
  35. package/dist/parsers/blf/index.js +1 -0
  36. package/dist/parsers/csv/delimiter.d.ts +31 -0
  37. package/dist/parsers/csv/delimiter.js +151 -0
  38. package/dist/parsers/csv/index.d.ts +30 -0
  39. package/dist/parsers/csv/index.js +108 -0
  40. package/dist/parsers/csv/parseText.d.ts +20 -0
  41. package/dist/parsers/csv/parseText.js +108 -0
  42. package/dist/parsers/csv/sort.d.ts +26 -0
  43. package/dist/parsers/csv/sort.js +224 -0
  44. package/dist/parsers/csv/statistics.d.ts +49 -0
  45. package/dist/parsers/csv/statistics.js +150 -0
  46. package/dist/parsers/dbc/index.d.ts +56 -0
  47. package/dist/parsers/dbc/index.js +94 -0
  48. package/dist/parsers/doc-binary/index.d.ts +35 -0
  49. package/dist/parsers/doc-binary/index.js +267 -0
  50. package/dist/parsers/doc-binary/vscode-parser.d.ts +142 -0
  51. package/dist/parsers/doc-binary/vscode-parser.js +3747 -0
  52. package/dist/parsers/excel/index.d.ts +17 -0
  53. package/dist/parsers/excel/index.js +406 -0
  54. package/dist/parsers/excel/model.d.ts +80 -0
  55. package/dist/parsers/excel/model.js +48 -0
  56. package/dist/parsers/excel/serialize.d.ts +3 -0
  57. package/dist/parsers/excel/serialize.js +78 -0
  58. package/dist/parsers/hdf5/index.d.ts +75 -0
  59. package/dist/parsers/hdf5/index.js +658 -0
  60. package/dist/parsers/hdf5/node.d.ts +21 -0
  61. package/dist/parsers/hdf5/node.js +95 -0
  62. package/dist/parsers/json/index.d.ts +15 -0
  63. package/dist/parsers/json/index.js +102 -0
  64. package/dist/parsers/json/model.d.ts +42 -0
  65. package/dist/parsers/json/model.js +140 -0
  66. package/dist/parsers/json/parse.d.ts +22 -0
  67. package/dist/parsers/json/parse.js +279 -0
  68. package/dist/parsers/json/tokenizer.d.ts +17 -0
  69. package/dist/parsers/json/tokenizer.js +175 -0
  70. package/dist/parsers/jsonl/index.d.ts +14 -0
  71. package/dist/parsers/jsonl/index.js +18 -0
  72. package/dist/parsers/jsonl/model.d.ts +23 -0
  73. package/dist/parsers/jsonl/model.js +1 -0
  74. package/dist/parsers/jsonl/parse.d.ts +7 -0
  75. package/dist/parsers/jsonl/parse.js +34 -0
  76. package/dist/parsers/markdown/index.d.ts +37 -0
  77. package/dist/parsers/markdown/index.js +59 -0
  78. package/dist/parsers/mat/index.d.ts +31 -0
  79. package/dist/parsers/mat/index.js +426 -0
  80. package/dist/parsers/mermaid/index.d.ts +5 -0
  81. package/dist/parsers/mermaid/index.js +3 -0
  82. package/dist/parsers/mf4/index.d.ts +1 -0
  83. package/dist/parsers/mf4/index.js +1 -0
  84. package/dist/parsers/parquet/index.d.ts +21 -0
  85. package/dist/parsers/parquet/index.js +68 -0
  86. package/dist/parsers/pcap/index.d.ts +1 -0
  87. package/dist/parsers/pcap/index.js +1 -0
  88. package/dist/parsers/pcapng/index.d.ts +1 -0
  89. package/dist/parsers/pcapng/index.js +1 -0
  90. package/dist/parsers/plantuml/index.d.ts +5 -0
  91. package/dist/parsers/plantuml/index.js +4 -0
  92. package/dist/parsers/ppt-binary/index.d.ts +5 -0
  93. package/dist/parsers/ppt-binary/index.js +62 -0
  94. package/dist/parsers/ppt-binary/pptBinaryBuildContext.d.ts +12 -0
  95. package/dist/parsers/ppt-binary/pptBinaryBuildContext.js +40 -0
  96. package/dist/parsers/ppt-binary/pptBinaryContainer.d.ts +4 -0
  97. package/dist/parsers/ppt-binary/pptBinaryContainer.js +174 -0
  98. package/dist/parsers/ppt-binary/pptBinaryTypes.d.ts +125 -0
  99. package/dist/parsers/ppt-binary/pptBinaryTypes.js +1 -0
  100. package/dist/parsers/ppt-binary/pptSlideLayouts.d.ts +9 -0
  101. package/dist/parsers/ppt-binary/pptSlideLayouts.js +510 -0
  102. package/dist/parsers/ppt-binary/vscode-parser.d.ts +116 -0
  103. package/dist/parsers/ppt-binary/vscode-parser.js +2853 -0
  104. package/dist/parsers/ppt-binary/vscode.d.ts +4 -0
  105. package/dist/parsers/ppt-binary/vscode.js +12 -0
  106. package/dist/parsers/pptx/index.d.ts +15 -0
  107. package/dist/parsers/pptx/index.js +88 -0
  108. package/dist/parsers/pptx/vscode-parser.d.ts +167 -0
  109. package/dist/parsers/pptx/vscode-parser.js +1503 -0
  110. package/dist/parsers/pptx/vscode.d.ts +4 -0
  111. package/dist/parsers/pptx/vscode.js +18 -0
  112. package/dist/parsers/pptx/zip-reader.d.ts +3 -0
  113. package/dist/parsers/pptx/zip-reader.js +20 -0
  114. package/dist/parsers/proto/index.d.ts +90 -0
  115. package/dist/parsers/proto/index.js +197 -0
  116. package/dist/parsers/psd/index.d.ts +16 -0
  117. package/dist/parsers/psd/index.js +10 -0
  118. package/dist/parsers/shapefile/dbf.d.ts +23 -0
  119. package/dist/parsers/shapefile/dbf.js +112 -0
  120. package/dist/parsers/shapefile/index.d.ts +44 -0
  121. package/dist/parsers/shapefile/index.js +119 -0
  122. package/dist/parsers/shapefile/reproject.d.ts +10 -0
  123. package/dist/parsers/shapefile/reproject.js +41 -0
  124. package/dist/parsers/slide-model.d.ts +106 -0
  125. package/dist/parsers/slide-model.js +1 -0
  126. package/dist/parsers/toml/index.d.ts +15 -0
  127. package/dist/parsers/toml/index.js +18 -0
  128. package/dist/parsers/toml/model.d.ts +15 -0
  129. package/dist/parsers/toml/model.js +1 -0
  130. package/dist/parsers/toml/parse.d.ts +16 -0
  131. package/dist/parsers/toml/parse.js +266 -0
  132. package/dist/parsers/types.d.ts +103 -0
  133. package/dist/parsers/types.js +106 -0
  134. package/dist/parsers/video/index.d.ts +6 -0
  135. package/dist/parsers/video/index.js +2 -0
  136. package/dist/parsers/yaml/index.d.ts +16 -0
  137. package/dist/parsers/yaml/index.js +58 -0
  138. package/dist/parsers/yaml/model.d.ts +22 -0
  139. package/dist/parsers/yaml/model.js +1 -0
  140. package/dist/parsers/yaml/self-loading.d.ts +3 -0
  141. package/dist/parsers/yaml/self-loading.js +19 -0
  142. package/dist/parsers/zip-scan.d.ts +8 -0
  143. package/dist/parsers/zip-scan.js +80 -0
  144. package/dist/registry/container.d.ts +17 -0
  145. package/dist/registry/container.js +49 -0
  146. package/dist/registry/index.d.ts +133 -0
  147. package/dist/registry/index.js +348 -0
  148. package/dist/registry/probe.d.ts +3 -0
  149. package/dist/registry/probe.js +177 -0
  150. package/dist/registry/sniff.d.ts +17 -0
  151. package/dist/registry/sniff.js +57 -0
  152. package/dist/styles/archive.css +10 -0
  153. package/dist/styles/audio.css +66 -0
  154. package/dist/styles/automotive.css +1 -0
  155. package/dist/styles/csv.css +262 -0
  156. package/dist/styles/excel.css +212 -0
  157. package/dist/styles/fallback.css +48 -0
  158. package/dist/styles/hdf5.css +3 -0
  159. package/dist/styles/hwp.css +12 -0
  160. package/dist/styles/image.css +115 -0
  161. package/dist/styles/json.css +342 -0
  162. package/dist/styles/jsonl.css +1 -0
  163. package/dist/styles/markdown.css +10 -0
  164. package/dist/styles/mat.css +2 -0
  165. package/dist/styles/mermaid.css +1 -0
  166. package/dist/styles/parquet.css +2 -0
  167. package/dist/styles/pdf.css +551 -0
  168. package/dist/styles/plantuml.css +1 -0
  169. package/dist/styles/ppt.css +1 -0
  170. package/dist/styles/proto.css +2 -0
  171. package/dist/styles/psd.css +1 -0
  172. package/dist/styles/shapefile.css +25 -0
  173. package/dist/styles/toml.css +1 -0
  174. package/dist/styles/video.css +74 -0
  175. package/dist/styles/word.css +685 -0
  176. package/dist/styles/yaml.css +1 -0
  177. package/dist/viewers/a2l/index.d.ts +15 -0
  178. package/dist/viewers/a2l/index.js +5 -0
  179. package/dist/viewers/archive/archive-preview-decoder.d.ts +4 -0
  180. package/dist/viewers/archive/archive-preview-decoder.js +223 -0
  181. package/dist/viewers/archive/controller.d.ts +24 -0
  182. package/dist/viewers/archive/controller.js +18 -0
  183. package/dist/viewers/archive/index.d.ts +25 -0
  184. package/dist/viewers/archive/index.js +230 -0
  185. package/dist/viewers/archive/preview.d.ts +2 -0
  186. package/dist/viewers/archive/preview.js +2 -0
  187. package/dist/viewers/archive/styles.d.ts +1 -0
  188. package/dist/viewers/archive/styles.js +11 -0
  189. package/dist/viewers/arxml/index.d.ts +15 -0
  190. package/dist/viewers/arxml/index.js +5 -0
  191. package/dist/viewers/asc/index.d.ts +15 -0
  192. package/dist/viewers/asc/index.js +5 -0
  193. package/dist/viewers/audio/controller.d.ts +33 -0
  194. package/dist/viewers/audio/controller.js +49 -0
  195. package/dist/viewers/audio/engine.d.ts +44 -0
  196. package/dist/viewers/audio/engine.js +108 -0
  197. package/dist/viewers/audio/index.d.ts +92 -0
  198. package/dist/viewers/audio/index.js +448 -0
  199. package/dist/viewers/audio/self-loading.d.ts +7 -0
  200. package/dist/viewers/audio/self-loading.js +42 -0
  201. package/dist/viewers/audio/styles.d.ts +1 -0
  202. package/dist/viewers/audio/styles.js +73 -0
  203. package/dist/viewers/automotive/index.d.ts +8 -0
  204. package/dist/viewers/automotive/index.js +152 -0
  205. package/dist/viewers/automotive/styles.d.ts +1 -0
  206. package/dist/viewers/automotive/styles.js +1 -0
  207. package/dist/viewers/avro/index.d.ts +15 -0
  208. package/dist/viewers/avro/index.js +5 -0
  209. package/dist/viewers/bag/index.d.ts +15 -0
  210. package/dist/viewers/bag/index.js +5 -0
  211. package/dist/viewers/blf/index.d.ts +15 -0
  212. package/dist/viewers/blf/index.js +5 -0
  213. package/dist/viewers/csv/controller.d.ts +126 -0
  214. package/dist/viewers/csv/controller.js +598 -0
  215. package/dist/viewers/csv/index.d.ts +48 -0
  216. package/dist/viewers/csv/index.js +846 -0
  217. package/dist/viewers/csv/styles.d.ts +1 -0
  218. package/dist/viewers/csv/styles.js +267 -0
  219. package/dist/viewers/db3/index.d.ts +15 -0
  220. package/dist/viewers/db3/index.js +5 -0
  221. package/dist/viewers/dbc/index.d.ts +15 -0
  222. package/dist/viewers/dbc/index.js +5 -0
  223. package/dist/viewers/diagram.d.ts +14 -0
  224. package/dist/viewers/diagram.js +95 -0
  225. package/dist/viewers/excel/controller.d.ts +108 -0
  226. package/dist/viewers/excel/controller.js +548 -0
  227. package/dist/viewers/excel/grid.d.ts +28 -0
  228. package/dist/viewers/excel/grid.js +99 -0
  229. package/dist/viewers/excel/index.d.ts +37 -0
  230. package/dist/viewers/excel/index.js +620 -0
  231. package/dist/viewers/excel/self-loading.d.ts +6 -0
  232. package/dist/viewers/excel/self-loading.js +13 -0
  233. package/dist/viewers/excel/styles.d.ts +1 -0
  234. package/dist/viewers/excel/styles.js +216 -0
  235. package/dist/viewers/fallback/index.d.ts +17 -0
  236. package/dist/viewers/fallback/index.js +130 -0
  237. package/dist/viewers/fallback/styles.d.ts +1 -0
  238. package/dist/viewers/fallback/styles.js +49 -0
  239. package/dist/viewers/hdf5/index.d.ts +19 -0
  240. package/dist/viewers/hdf5/index.js +170 -0
  241. package/dist/viewers/hdf5/styles.d.ts +1 -0
  242. package/dist/viewers/hdf5/styles.js +4 -0
  243. package/dist/viewers/hwp/controller.d.ts +19 -0
  244. package/dist/viewers/hwp/controller.js +22 -0
  245. package/dist/viewers/hwp/index.d.ts +39 -0
  246. package/dist/viewers/hwp/index.js +271 -0
  247. package/dist/viewers/hwp/self-loading.d.ts +2 -0
  248. package/dist/viewers/hwp/self-loading.js +6 -0
  249. package/dist/viewers/hwp/styles.d.ts +1 -0
  250. package/dist/viewers/hwp/styles.js +13 -0
  251. package/dist/viewers/image/controller.d.ts +210 -0
  252. package/dist/viewers/image/controller.js +336 -0
  253. package/dist/viewers/image/decode.d.ts +54 -0
  254. package/dist/viewers/image/decode.js +150 -0
  255. package/dist/viewers/image/index.d.ts +38 -0
  256. package/dist/viewers/image/index.js +749 -0
  257. package/dist/viewers/image/limits.d.ts +18 -0
  258. package/dist/viewers/image/limits.js +20 -0
  259. package/dist/viewers/image/styles.d.ts +1 -0
  260. package/dist/viewers/image/styles.js +119 -0
  261. package/dist/viewers/json/controller.d.ts +89 -0
  262. package/dist/viewers/json/controller.js +411 -0
  263. package/dist/viewers/json/index.d.ts +25 -0
  264. package/dist/viewers/json/index.js +503 -0
  265. package/dist/viewers/json/styles.d.ts +1 -0
  266. package/dist/viewers/json/styles.js +346 -0
  267. package/dist/viewers/json/transforms.d.ts +27 -0
  268. package/dist/viewers/json/transforms.js +253 -0
  269. package/dist/viewers/jsonl/controller.d.ts +48 -0
  270. package/dist/viewers/jsonl/controller.js +136 -0
  271. package/dist/viewers/jsonl/index.d.ts +22 -0
  272. package/dist/viewers/jsonl/index.js +184 -0
  273. package/dist/viewers/jsonl/styles.d.ts +1 -0
  274. package/dist/viewers/jsonl/styles.js +1 -0
  275. package/dist/viewers/markdown/controller.d.ts +50 -0
  276. package/dist/viewers/markdown/controller.js +62 -0
  277. package/dist/viewers/markdown/index.d.ts +64 -0
  278. package/dist/viewers/markdown/index.js +425 -0
  279. package/dist/viewers/markdown/math.d.ts +21 -0
  280. package/dist/viewers/markdown/math.js +100 -0
  281. package/dist/viewers/markdown/self-loading.d.ts +5 -0
  282. package/dist/viewers/markdown/self-loading.js +48 -0
  283. package/dist/viewers/markdown/styles.d.ts +1 -0
  284. package/dist/viewers/markdown/styles.js +11 -0
  285. package/dist/viewers/mat/index.d.ts +19 -0
  286. package/dist/viewers/mat/index.js +113 -0
  287. package/dist/viewers/mat/styles.d.ts +1 -0
  288. package/dist/viewers/mat/styles.js +3 -0
  289. package/dist/viewers/media.d.ts +9 -0
  290. package/dist/viewers/media.js +77 -0
  291. package/dist/viewers/mermaid/index.d.ts +17 -0
  292. package/dist/viewers/mermaid/index.js +6 -0
  293. package/dist/viewers/mermaid/self-loading.d.ts +2 -0
  294. package/dist/viewers/mermaid/self-loading.js +2 -0
  295. package/dist/viewers/mf4/index.d.ts +15 -0
  296. package/dist/viewers/mf4/index.js +5 -0
  297. package/dist/viewers/parquet/controller.d.ts +37 -0
  298. package/dist/viewers/parquet/controller.js +26 -0
  299. package/dist/viewers/parquet/index.d.ts +23 -0
  300. package/dist/viewers/parquet/index.js +134 -0
  301. package/dist/viewers/parquet/styles.d.ts +1 -0
  302. package/dist/viewers/parquet/styles.js +3 -0
  303. package/dist/viewers/pcap/index.d.ts +15 -0
  304. package/dist/viewers/pcap/index.js +5 -0
  305. package/dist/viewers/pcapng/index.d.ts +15 -0
  306. package/dist/viewers/pcapng/index.js +5 -0
  307. package/dist/viewers/pdf/controller.d.ts +120 -0
  308. package/dist/viewers/pdf/controller.js +191 -0
  309. package/dist/viewers/pdf/editing.d.ts +26 -0
  310. package/dist/viewers/pdf/editing.js +265 -0
  311. package/dist/viewers/pdf/index.d.ts +88 -0
  312. package/dist/viewers/pdf/index.js +1400 -0
  313. package/dist/viewers/pdf/self-loading.d.ts +6 -0
  314. package/dist/viewers/pdf/self-loading.js +14 -0
  315. package/dist/viewers/pdf/styles.d.ts +1 -0
  316. package/dist/viewers/pdf/styles.js +555 -0
  317. package/dist/viewers/plantuml/index.d.ts +17 -0
  318. package/dist/viewers/plantuml/index.js +6 -0
  319. package/dist/viewers/plantuml/self-loading.d.ts +2 -0
  320. package/dist/viewers/plantuml/self-loading.js +2 -0
  321. package/dist/viewers/ppt/chart.d.ts +8 -0
  322. package/dist/viewers/ppt/chart.js +83 -0
  323. package/dist/viewers/ppt/controller.d.ts +34 -0
  324. package/dist/viewers/ppt/controller.js +27 -0
  325. package/dist/viewers/ppt/index.d.ts +33 -0
  326. package/dist/viewers/ppt/index.js +101 -0
  327. package/dist/viewers/ppt/render.d.ts +5 -0
  328. package/dist/viewers/ppt/render.js +144 -0
  329. package/dist/viewers/ppt/self-loading.d.ts +9 -0
  330. package/dist/viewers/ppt/self-loading.js +4 -0
  331. package/dist/viewers/ppt/styles.d.ts +1 -0
  332. package/dist/viewers/ppt/styles.js +1 -0
  333. package/dist/viewers/proto/index.d.ts +17 -0
  334. package/dist/viewers/proto/index.js +170 -0
  335. package/dist/viewers/proto/styles.d.ts +1 -0
  336. package/dist/viewers/proto/styles.js +2 -0
  337. package/dist/viewers/psd/index.d.ts +27 -0
  338. package/dist/viewers/psd/index.js +39 -0
  339. package/dist/viewers/psd/self-loading.d.ts +10 -0
  340. package/dist/viewers/psd/self-loading.js +20 -0
  341. package/dist/viewers/psd/styles.d.ts +1 -0
  342. package/dist/viewers/psd/styles.js +1 -0
  343. package/dist/viewers/reqif/index.d.ts +15 -0
  344. package/dist/viewers/reqif/index.js +5 -0
  345. package/dist/viewers/shapefile/index.d.ts +35 -0
  346. package/dist/viewers/shapefile/index.js +336 -0
  347. package/dist/viewers/shapefile/self-loading.d.ts +7 -0
  348. package/dist/viewers/shapefile/self-loading.js +32 -0
  349. package/dist/viewers/shapefile/styles.d.ts +1 -0
  350. package/dist/viewers/shapefile/styles.js +28 -0
  351. package/dist/viewers/stp/index.d.ts +15 -0
  352. package/dist/viewers/stp/index.js +5 -0
  353. package/dist/viewers/structured-styles.d.ts +1 -0
  354. package/dist/viewers/structured-styles.js +1 -0
  355. package/dist/viewers/structured.d.ts +36 -0
  356. package/dist/viewers/structured.js +138 -0
  357. package/dist/viewers/toml/controller.d.ts +38 -0
  358. package/dist/viewers/toml/controller.js +61 -0
  359. package/dist/viewers/toml/index.d.ts +18 -0
  360. package/dist/viewers/toml/index.js +34 -0
  361. package/dist/viewers/types.d.ts +36 -0
  362. package/dist/viewers/types.js +9 -0
  363. package/dist/viewers/video/controller.d.ts +29 -0
  364. package/dist/viewers/video/controller.js +54 -0
  365. package/dist/viewers/video/index.d.ts +18 -0
  366. package/dist/viewers/video/index.js +305 -0
  367. package/dist/viewers/video/styles.d.ts +1 -0
  368. package/dist/viewers/video/styles.js +79 -0
  369. package/dist/viewers/word/controller.d.ts +19 -0
  370. package/dist/viewers/word/controller.js +22 -0
  371. package/dist/viewers/word/docx-preprocess.d.ts +63 -0
  372. package/dist/viewers/word/docx-preprocess.js +136 -0
  373. package/dist/viewers/word/index.d.ts +32 -0
  374. package/dist/viewers/word/index.js +187 -0
  375. package/dist/viewers/word/normalize-docx.d.ts +2 -0
  376. package/dist/viewers/word/normalize-docx.js +50 -0
  377. package/dist/viewers/word/paginate.d.ts +1 -0
  378. package/dist/viewers/word/paginate.js +1035 -0
  379. package/dist/viewers/word/self-loading.d.ts +2 -0
  380. package/dist/viewers/word/self-loading.js +7 -0
  381. package/dist/viewers/word/styles.d.ts +1 -0
  382. package/dist/viewers/word/styles.js +686 -0
  383. package/dist/viewers/yaml/controller.d.ts +42 -0
  384. package/dist/viewers/yaml/controller.js +41 -0
  385. package/dist/viewers/yaml/index.d.ts +21 -0
  386. package/dist/viewers/yaml/index.js +20 -0
  387. package/package.json +375 -0
@@ -0,0 +1,12 @@
1
+ import type { PptColorScheme, PptPictureAsset, PptPresentationMetrics, PptRecord, PptTextBlock } from './pptBinaryTypes.js';
2
+ export declare function normalizeBuildSlidesArgs(slideRecords: PptRecord[], pictures: PptPictureAsset[], outlineTextByPersistId: Map<number, PptTextBlock[]>, defaultColorScheme: PptColorScheme | null, masterRecordOrPresentationMetrics: PptRecord | PptPresentationMetrics | null, presentationMetricsOrWidth: PptPresentationMetrics | number | null, widthPxOrHeight: number, heightPxOrPicturesById?: number | Map<number, PptPictureAsset>, picturesByIdMaybe?: Map<number, PptPictureAsset>): {
3
+ slideRecords: PptRecord[];
4
+ pictures: PptPictureAsset[];
5
+ outlineTextByPersistId: Map<number, PptTextBlock[]>;
6
+ defaultColorScheme: PptColorScheme | null;
7
+ masterRecord: PptRecord | null;
8
+ presentationMetrics: PptPresentationMetrics | null;
9
+ widthPx: number;
10
+ heightPx: number;
11
+ picturesById?: Map<number, PptPictureAsset>;
12
+ };
@@ -0,0 +1,40 @@
1
+ export function normalizeBuildSlidesArgs(slideRecords, pictures, outlineTextByPersistId, defaultColorScheme, masterRecordOrPresentationMetrics, presentationMetricsOrWidth, widthPxOrHeight, heightPxOrPicturesById, picturesByIdMaybe) {
2
+ const isPresentationMetrics = (value) => !!value
3
+ && typeof value === 'object'
4
+ && 'rawWidth' in value
5
+ && 'rawHeight' in value;
6
+ const isPptRecord = (value) => !!value
7
+ && typeof value === 'object'
8
+ && 'recType' in value
9
+ && 'payload' in value;
10
+ const masterRecord = isPptRecord(masterRecordOrPresentationMetrics)
11
+ ? masterRecordOrPresentationMetrics
12
+ : null;
13
+ const presentationMetrics = isPptRecord(masterRecordOrPresentationMetrics)
14
+ ? (isPresentationMetrics(presentationMetricsOrWidth) ? presentationMetricsOrWidth : null)
15
+ : (isPresentationMetrics(masterRecordOrPresentationMetrics)
16
+ ? masterRecordOrPresentationMetrics
17
+ : (isPresentationMetrics(presentationMetricsOrWidth) ? presentationMetricsOrWidth : null));
18
+ const widthPx = typeof heightPxOrPicturesById === 'number'
19
+ ? widthPxOrHeight
20
+ : typeof presentationMetricsOrWidth === 'number'
21
+ ? presentationMetricsOrWidth
22
+ : widthPxOrHeight;
23
+ const heightPx = typeof heightPxOrPicturesById === 'number'
24
+ ? heightPxOrPicturesById
25
+ : widthPxOrHeight;
26
+ const picturesById = heightPxOrPicturesById instanceof Map
27
+ ? heightPxOrPicturesById
28
+ : picturesByIdMaybe;
29
+ return {
30
+ slideRecords,
31
+ pictures,
32
+ outlineTextByPersistId,
33
+ defaultColorScheme,
34
+ masterRecord,
35
+ presentationMetrics,
36
+ widthPx,
37
+ heightPx,
38
+ picturesById
39
+ };
40
+ }
@@ -0,0 +1,4 @@
1
+ import { Buffer } from 'buffer';
2
+ import type { CfbParseResult, PptRecord } from './pptBinaryTypes.js';
3
+ export declare function parseCfb(file: Buffer): CfbParseResult;
4
+ export declare function parseRecords(buffer: Buffer, start: number, end: number): PptRecord[];
@@ -0,0 +1,174 @@
1
+ // @ts-nocheck -- upstream VS Code parser predates exactOptionalPropertyTypes.
2
+ import { Buffer } from 'buffer';
3
+ const FREESECT = 0xffffffff;
4
+ const ENDOFCHAIN = 0xfffffffe;
5
+ export function parseCfb(file) {
6
+ if (file.length < 512) {
7
+ throw new Error('Invalid CFB file: too small.');
8
+ }
9
+ const signature = file.slice(0, 8).toString('hex');
10
+ if (signature !== 'd0cf11e0a1b11ae1') {
11
+ throw new Error('Invalid CFB signature.');
12
+ }
13
+ const sectorShift = file.readUInt16LE(30);
14
+ const miniSectorShift = file.readUInt16LE(32);
15
+ const sectorSize = 1 << sectorShift;
16
+ const miniSectorSize = 1 << miniSectorShift;
17
+ const numFatSectors = file.readUInt32LE(44);
18
+ const firstDirSector = file.readInt32LE(48);
19
+ const miniCutoff = file.readUInt32LE(56);
20
+ const firstMiniFatSector = file.readInt32LE(60);
21
+ const numMiniFatSectors = file.readUInt32LE(64);
22
+ const firstDifatSector = file.readInt32LE(68);
23
+ const numDifatSectors = file.readUInt32LE(72);
24
+ const readSector = (sid) => {
25
+ const offset = (sid + 1) * sectorSize;
26
+ if (offset < 0 || offset + sectorSize > file.length) {
27
+ return Buffer.alloc(0);
28
+ }
29
+ return file.slice(offset, offset + sectorSize);
30
+ };
31
+ const difat = [];
32
+ for (let i = 0; i < 109; i++) {
33
+ const sid = file.readInt32LE(76 + i * 4);
34
+ if (sid !== -1)
35
+ difat.push(sid);
36
+ }
37
+ let nextDifat = firstDifatSector;
38
+ for (let i = 0; i < numDifatSectors && nextDifat !== ENDOFCHAIN && nextDifat !== -1; i++) {
39
+ const sec = readSector(nextDifat);
40
+ if (sec.length === 0)
41
+ break;
42
+ const entriesPerSector = sectorSize / 4 - 1;
43
+ for (let j = 0; j < entriesPerSector; j++) {
44
+ const sid = sec.readInt32LE(j * 4);
45
+ if (sid !== -1)
46
+ difat.push(sid);
47
+ }
48
+ nextDifat = sec.readInt32LE(sectorSize - 4);
49
+ }
50
+ const fatSectors = difat.slice(0, numFatSectors);
51
+ const fat = [];
52
+ fatSectors.forEach((sid) => {
53
+ const sec = readSector(sid);
54
+ if (sec.length === 0) {
55
+ return;
56
+ }
57
+ for (let i = 0; i < sectorSize; i += 4) {
58
+ fat.push(sec.readInt32LE(i));
59
+ }
60
+ });
61
+ const readChain = (startSid) => {
62
+ if (startSid < 0 || startSid === ENDOFCHAIN) {
63
+ return Buffer.alloc(0);
64
+ }
65
+ const chunks = [];
66
+ const seen = new Set();
67
+ let sid = startSid;
68
+ while (sid >= 0 && sid !== ENDOFCHAIN && sid !== FREESECT) {
69
+ if (seen.has(sid) || sid >= fat.length) {
70
+ break;
71
+ }
72
+ seen.add(sid);
73
+ const sec = readSector(sid);
74
+ if (sec.length === 0) {
75
+ break;
76
+ }
77
+ chunks.push(sec);
78
+ sid = fat[sid];
79
+ }
80
+ return Buffer.concat(chunks);
81
+ };
82
+ const dirStream = readChain(firstDirSector);
83
+ const entries = [];
84
+ for (let off = 0; off + 128 <= dirStream.length; off += 128) {
85
+ const nameLength = dirStream.readUInt16LE(off + 64);
86
+ const rawName = dirStream.slice(off, off + Math.max(0, nameLength - 2));
87
+ entries.push({
88
+ name: rawName.toString('utf16le').split('\u0000').join(''),
89
+ type: dirStream.readUInt8(off + 66),
90
+ leftId: dirStream.readInt32LE(off + 68),
91
+ rightId: dirStream.readInt32LE(off + 72),
92
+ childId: dirStream.readInt32LE(off + 76),
93
+ startSector: dirStream.readInt32LE(off + 116),
94
+ size: dirStream.readUInt32LE(off + 124) > 0 ? Number(dirStream.readUInt32LE(off + 120)) : dirStream.readUInt32LE(off + 120)
95
+ });
96
+ }
97
+ const root = entries.find((entry) => entry.type === 5);
98
+ const miniStream = root ? readChain(root.startSector).slice(0, root.size) : Buffer.alloc(0);
99
+ const miniFatStream = readChain(firstMiniFatSector);
100
+ const miniFat = [];
101
+ for (let off = 0; off + 4 <= numMiniFatSectors * sectorSize && off + 4 <= miniFatStream.length; off += 4) {
102
+ miniFat.push(miniFatStream.readInt32LE(off));
103
+ }
104
+ const readMiniChain = (startMiniSid, size) => {
105
+ if (startMiniSid < 0) {
106
+ return Buffer.alloc(0);
107
+ }
108
+ const chunks = [];
109
+ const seen = new Set();
110
+ let sid = startMiniSid;
111
+ while (sid >= 0 && sid !== ENDOFCHAIN && sid !== FREESECT) {
112
+ if (seen.has(sid) || sid >= miniFat.length) {
113
+ break;
114
+ }
115
+ seen.add(sid);
116
+ const start = sid * miniSectorSize;
117
+ const end = start + miniSectorSize;
118
+ if (start < 0 || end > miniStream.length) {
119
+ break;
120
+ }
121
+ chunks.push(miniStream.slice(start, end));
122
+ sid = miniFat[sid];
123
+ }
124
+ return Buffer.concat(chunks).slice(0, size);
125
+ };
126
+ const byName = new Map();
127
+ entries.forEach((entry) => {
128
+ if (entry.name) {
129
+ byName.set(entry.name, entry);
130
+ }
131
+ });
132
+ return {
133
+ getStream: (name) => {
134
+ const entry = byName.get(name);
135
+ if (!entry || entry.type !== 2) {
136
+ return null;
137
+ }
138
+ if (entry.size < miniCutoff && root) {
139
+ return readMiniChain(entry.startSector, entry.size);
140
+ }
141
+ return readChain(entry.startSector).slice(0, entry.size);
142
+ }
143
+ };
144
+ }
145
+ export function parseRecords(buffer, start, end) {
146
+ const records = [];
147
+ let offset = start;
148
+ while (offset + 8 <= end && offset + 8 <= buffer.length) {
149
+ const verInst = buffer.readUInt16LE(offset);
150
+ const recVer = verInst & 0x000f;
151
+ const recInstance = (verInst >> 4) & 0x0fff;
152
+ const recType = buffer.readUInt16LE(offset + 2);
153
+ const length = buffer.readUInt32LE(offset + 4);
154
+ const payloadOffset = offset + 8;
155
+ const payloadEnd = payloadOffset + length;
156
+ if (payloadEnd > end || payloadEnd > buffer.length) {
157
+ break;
158
+ }
159
+ const record = {
160
+ recType,
161
+ recInstance,
162
+ recVer,
163
+ length,
164
+ payloadOffset,
165
+ payload: buffer.slice(payloadOffset, payloadEnd)
166
+ };
167
+ if (recVer === 0x0f) {
168
+ record.children = parseRecords(buffer, payloadOffset, payloadEnd);
169
+ }
170
+ records.push(record);
171
+ offset = payloadEnd;
172
+ }
173
+ return records;
174
+ }
@@ -0,0 +1,125 @@
1
+ export interface CfbEntry {
2
+ name: string;
3
+ type: number;
4
+ leftId: number;
5
+ rightId: number;
6
+ childId: number;
7
+ startSector: number;
8
+ size: number;
9
+ }
10
+ export interface CfbParseResult {
11
+ getStream(name: string): Buffer | null;
12
+ }
13
+ export interface PptRecord {
14
+ recType: number;
15
+ recInstance: number;
16
+ recVer: number;
17
+ length: number;
18
+ payloadOffset: number;
19
+ payload: Buffer;
20
+ children?: PptRecord[];
21
+ }
22
+ export interface PptShapeBounds {
23
+ x: number;
24
+ y: number;
25
+ width: number;
26
+ height: number;
27
+ }
28
+ export interface PptTextBlock {
29
+ text: string;
30
+ textType?: number;
31
+ placeholderType?: number;
32
+ bounds?: PptShapeBounds;
33
+ color?: string;
34
+ fontSizePx?: number;
35
+ fillColor?: string;
36
+ borderColor?: string;
37
+ borderWidthPx?: number;
38
+ fillVisible?: boolean;
39
+ borderVisible?: boolean;
40
+ spContainerIndex?: number;
41
+ }
42
+ export interface PptTextGroup {
43
+ blocks: PptTextBlock[];
44
+ placeholderType?: number;
45
+ bounds?: PptShapeBounds;
46
+ fillColor?: string;
47
+ borderColor?: string;
48
+ borderWidthPx?: number;
49
+ fillVisible?: boolean;
50
+ borderVisible?: boolean;
51
+ spContainerIndex?: number;
52
+ }
53
+ export interface PptVisualSlot {
54
+ placeholderType?: number;
55
+ bounds?: PptShapeBounds;
56
+ fillColor?: string;
57
+ borderColor?: string;
58
+ imageRefId?: number;
59
+ isTextSlot?: boolean;
60
+ borderWidthPx?: number;
61
+ fillVisible?: boolean;
62
+ borderVisible?: boolean;
63
+ spContainerIndex?: number;
64
+ }
65
+ export interface PptColorScheme {
66
+ backgroundColor?: string;
67
+ textColor?: string;
68
+ titleColor?: string;
69
+ fillColor?: string;
70
+ }
71
+ export interface PptSlideLayoutInfo {
72
+ geom: number;
73
+ placeholders: number[];
74
+ }
75
+ export interface PptPictureAsset {
76
+ mime: string;
77
+ base64: string;
78
+ pictureIndex?: number;
79
+ }
80
+ export interface PptSlideElementParagraph {
81
+ text: string;
82
+ level: number;
83
+ bullet?: boolean;
84
+ align?: string;
85
+ fontSizePx?: number;
86
+ bold?: boolean;
87
+ italic?: boolean;
88
+ color?: string;
89
+ runs?: Array<{
90
+ text: string;
91
+ fontSizePx?: number;
92
+ bold?: boolean;
93
+ italic?: boolean;
94
+ color?: string;
95
+ }>;
96
+ }
97
+ export interface PptSlideElement {
98
+ type: 'text' | 'image' | 'shape';
99
+ x: number;
100
+ y: number;
101
+ width: number;
102
+ height: number;
103
+ zIndex: number;
104
+ isTitle?: boolean;
105
+ paragraphs?: PptSlideElementParagraph[];
106
+ src?: string;
107
+ fillColor?: string;
108
+ borderColor?: string;
109
+ borderWidthPx?: number;
110
+ textStylePreset?: string;
111
+ rotateDeg?: number;
112
+ }
113
+ export interface PptSlideModel {
114
+ slideNumber: number;
115
+ widthPx: number;
116
+ heightPx: number;
117
+ backgroundColor: string;
118
+ elements: PptSlideElement[];
119
+ }
120
+ export interface PptPresentationMetrics {
121
+ widthPx: number;
122
+ heightPx: number;
123
+ rawWidth: number;
124
+ rawHeight: number;
125
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { PptPictureAsset, PptPresentationMetrics, PptRecord, PptSlideModel, PptTextBlock } from './pptBinaryTypes.js';
2
+ type ApplyMasterBackgroundImage = (elements: PptSlideModel['elements'], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number) => void;
3
+ export declare function applyActivityProcessLayoutImpl(elements: PptSlideModel['elements'], styledShapeBlocks: PptTextBlock[], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number, applyMasterBackgroundImage: ApplyMasterBackgroundImage): void;
4
+ export declare function applyMathPlayLetterLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
5
+ export declare function applyActivityListTableLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
6
+ export declare function applyClosingPracticeLayoutImpl(elements: PptSlideModel['elements'], masterRecord: PptRecord | null, picturesById: Map<number, PptPictureAsset> | undefined, presentationMetrics: PptPresentationMetrics | null, slideWidth: number, slideHeight: number, applyMasterBackgroundImage: ApplyMasterBackgroundImage): void;
7
+ export declare function applyDialoguePhotoLayoutImpl(elements: PptSlideModel['elements'], slideWidth: number, slideHeight: number): void;
8
+ export declare function applyMathIntroLayoutImpl(elements: PptSlideModel['elements'], picturesById: Map<number, PptPictureAsset> | undefined, slideWidth: number, slideHeight: number): void;
9
+ export {};