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 @@
1
+ export { parseBlf } from '../automotive/index.js';
@@ -0,0 +1 @@
1
+ export { parseBlf } from '../automotive/index.js';
@@ -0,0 +1,31 @@
1
+ export type CsvDelimiter = ',' | ';' | '\t' | '|';
2
+ export interface DelimiterDetectionResult {
3
+ delimiter: CsvDelimiter;
4
+ confidence: number;
5
+ }
6
+ /** Order matters — earlier candidates win priority ties. */
7
+ export declare const DELIMITER_PRIORITY: readonly CsvDelimiter[];
8
+ export interface DetectOptions {
9
+ /** Maximum number of leading lines to inspect (default 10). */
10
+ sampleLines?: number;
11
+ }
12
+ /**
13
+ * Detect the most likely delimiter in `text`.
14
+ *
15
+ * Always returns a result. When `text` has no candidates at all (e.g. a
16
+ * single-column CSV) we fall back to `,` with confidence 0 so callers can
17
+ * still parse deterministically.
18
+ */
19
+ export declare function detectDelimiter(text: string, options?: DetectOptions): DelimiterDetectionResult;
20
+ /**
21
+ * Count occurrences of `delimiter` in `line`, ignoring any inside a
22
+ * double-quoted span (`""` is the escaped quote and stays inside).
23
+ */
24
+ export declare function countOutsideQuotes(line: string, delimiter: string): number;
25
+ /** ASCII-only lowercase (determinism rule — no locale-dependent toLowerCase). */
26
+ export declare function asciiLower(s: string): string;
27
+ /**
28
+ * Extension shortcut: `.tsv` is unambiguously tab-delimited; anything else
29
+ * falls through to content-based detection.
30
+ */
31
+ export declare function detectDelimiterForFile(fileName: string, text: string, options?: DetectOptions): DelimiterDetectionResult;
@@ -0,0 +1,151 @@
1
+ // CSV delimiter auto-detection. Ported unchanged (already pure and
2
+ // deterministic) from omni-viewer-chrome `templates/csv/js/csvDelimiter.ts`,
3
+ // except the file-extension shortcut uses ASCII-only lowercasing (ADR 41).
4
+ /** Order matters — earlier candidates win priority ties. */
5
+ export const DELIMITER_PRIORITY = [',', '\t', ';', '|'];
6
+ const DEFAULT_SAMPLE_LINES = 10;
7
+ const DEFAULT_DELIMITER = ',';
8
+ /**
9
+ * Detect the most likely delimiter in `text`.
10
+ *
11
+ * Always returns a result. When `text` has no candidates at all (e.g. a
12
+ * single-column CSV) we fall back to `,` with confidence 0 so callers can
13
+ * still parse deterministically.
14
+ */
15
+ export function detectDelimiter(text, options = {}) {
16
+ const sampleLines = options.sampleLines ?? DEFAULT_SAMPLE_LINES;
17
+ const lines = takeSampleLines(text, sampleLines);
18
+ if (lines.length === 0) {
19
+ return { delimiter: DEFAULT_DELIMITER, confidence: 0 };
20
+ }
21
+ const scores = DELIMITER_PRIORITY.map((delimiter, priorityIndex) => {
22
+ const counts = lines.map((line) => countOutsideQuotes(line, delimiter));
23
+ const positive = counts.filter((c) => c > 0);
24
+ const mean = positive.length === 0 ? 0 : sum(positive) / positive.length;
25
+ const variance = positive.length === 0
26
+ ? Number.POSITIVE_INFINITY
27
+ : varianceOf(positive, mean);
28
+ // Consistency factor squared: a delimiter firing on every line beats
29
+ // one firing on a single high-count outlier.
30
+ const consistency = positive.length / lines.length;
31
+ const score = mean * consistency * consistency;
32
+ return { delimiter, mean, variance, score, priorityIndex };
33
+ });
34
+ scores.sort((a, b) => {
35
+ if (b.score !== a.score)
36
+ return b.score - a.score;
37
+ if (a.variance !== b.variance)
38
+ return a.variance - b.variance;
39
+ return a.priorityIndex - b.priorityIndex;
40
+ });
41
+ const winner = scores[0];
42
+ if (!winner || winner.score === 0) {
43
+ return { delimiter: DEFAULT_DELIMITER, confidence: 0 };
44
+ }
45
+ const runnerUp = scores[1];
46
+ const runnerScore = runnerUp ? runnerUp.score : 0;
47
+ const total = winner.score + runnerScore;
48
+ const confidence = total === 0 ? 0 : (winner.score - runnerScore) / total;
49
+ return {
50
+ delimiter: winner.delimiter,
51
+ confidence: Math.max(0, Math.min(1, confidence))
52
+ };
53
+ }
54
+ /**
55
+ * Slice `text` into up to `max` logical lines: a `\n` only breaks a line when
56
+ * it falls outside an open double-quoted span.
57
+ */
58
+ function takeSampleLines(text, max) {
59
+ if (!text || max <= 0)
60
+ return [];
61
+ const stripped = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
62
+ const normalized = stripped.replace(/\r\n?/g, '\n');
63
+ const out = [];
64
+ let buf = '';
65
+ let inQuotes = false;
66
+ for (let i = 0; i < normalized.length; i++) {
67
+ const ch = normalized[i];
68
+ if (ch === '"') {
69
+ if (inQuotes && normalized[i + 1] === '"') {
70
+ buf += '""';
71
+ i++;
72
+ continue;
73
+ }
74
+ inQuotes = !inQuotes;
75
+ buf += ch;
76
+ continue;
77
+ }
78
+ if (ch === '\n' && !inQuotes) {
79
+ if (buf.length > 0)
80
+ out.push(buf);
81
+ buf = '';
82
+ if (out.length >= max)
83
+ return out;
84
+ continue;
85
+ }
86
+ buf += ch;
87
+ }
88
+ if (out.length < max && buf.length > 0)
89
+ out.push(buf);
90
+ return out;
91
+ }
92
+ /**
93
+ * Count occurrences of `delimiter` in `line`, ignoring any inside a
94
+ * double-quoted span (`""` is the escaped quote and stays inside).
95
+ */
96
+ export function countOutsideQuotes(line, delimiter) {
97
+ if (!delimiter)
98
+ return 0;
99
+ let count = 0;
100
+ let inQuotes = false;
101
+ for (let i = 0; i < line.length; i++) {
102
+ const ch = line[i];
103
+ if (ch === '"') {
104
+ if (inQuotes && line[i + 1] === '"') {
105
+ i++;
106
+ continue;
107
+ }
108
+ inQuotes = !inQuotes;
109
+ continue;
110
+ }
111
+ if (!inQuotes && ch === delimiter) {
112
+ count++;
113
+ }
114
+ }
115
+ return count;
116
+ }
117
+ function sum(values) {
118
+ let s = 0;
119
+ for (const v of values)
120
+ s += v;
121
+ return s;
122
+ }
123
+ function varianceOf(values, mean) {
124
+ if (values.length <= 1)
125
+ return 0;
126
+ let acc = 0;
127
+ for (const v of values) {
128
+ const d = v - mean;
129
+ acc += d * d;
130
+ }
131
+ return acc / values.length;
132
+ }
133
+ /** ASCII-only lowercase (determinism rule — no locale-dependent toLowerCase). */
134
+ export function asciiLower(s) {
135
+ let out = '';
136
+ for (let i = 0; i < s.length; i++) {
137
+ const code = s.charCodeAt(i);
138
+ out += code >= 65 && code <= 90 ? String.fromCharCode(code + 32) : s[i];
139
+ }
140
+ return out;
141
+ }
142
+ /**
143
+ * Extension shortcut: `.tsv` is unambiguously tab-delimited; anything else
144
+ * falls through to content-based detection.
145
+ */
146
+ export function detectDelimiterForFile(fileName, text, options = {}) {
147
+ if (asciiLower(fileName).endsWith('.tsv')) {
148
+ return { delimiter: '\t', confidence: 1 };
149
+ }
150
+ return detectDelimiter(text, options);
151
+ }
@@ -0,0 +1,30 @@
1
+ import type { ParseOptions, ParseOutcome } from '../types.js';
2
+ import { type CsvDelimiter } from './delimiter.js';
3
+ export type { CsvDelimiter, DelimiterDetectionResult } from './delimiter.js';
4
+ export { detectDelimiter, detectDelimiterForFile, DELIMITER_PRIORITY, asciiLower } from './delimiter.js';
5
+ export * from './sort.js';
6
+ export * from './statistics.js';
7
+ export type { RawCsv } from './parseText.js';
8
+ export interface CsvDocument {
9
+ headers: string[];
10
+ rows: string[][];
11
+ columnCount: number;
12
+ delimiter: CsvDelimiter;
13
+ detection: {
14
+ delimiter: CsvDelimiter;
15
+ confidence: number;
16
+ source: 'auto' | 'extension' | 'override';
17
+ };
18
+ }
19
+ export interface CsvParseOptions extends ParseOptions {
20
+ /** Explicit delimiter override; skips auto-detection. */
21
+ delimiter?: CsvDelimiter;
22
+ /** Used for the `.tsv` extension shortcut during auto-detection. */
23
+ fileName?: string;
24
+ /** First row is headers (default true). */
25
+ hasHeader?: boolean;
26
+ }
27
+ /** Input ownership: this parser borrows the input (DESIGN.md §3-① — the
28
+ * caller keeps the bytes; nothing is transferred or mutated). */
29
+ export declare const CSV_INPUT_OWNERSHIP: "borrows";
30
+ export declare function parseCsv(input: Uint8Array | string, options?: CsvParseOptions): ParseOutcome<CsvDocument>;
@@ -0,0 +1,108 @@
1
+ // CSV parser entry — the core contract surface (DESIGN.md §3-①).
2
+ //
3
+ // parseCsv(bytes or text) -> ParseOutcome<CsvDocument>. Input-caused failures
4
+ // never throw; limits stop parsing with `partial` + a limit diagnostic.
5
+ import { DEFAULT_LIMITS, LimitTracker, decodeUtf8, utf8ByteLength } from '../types.js';
6
+ import { parseCsvText } from './parseText.js';
7
+ import { detectDelimiter, detectDelimiterForFile, asciiLower } from './delimiter.js';
8
+ export { detectDelimiter, detectDelimiterForFile, DELIMITER_PRIORITY, asciiLower } from './delimiter.js';
9
+ export * from './sort.js';
10
+ export * from './statistics.js';
11
+ /** Input ownership: this parser borrows the input (DESIGN.md §3-① — the
12
+ * caller keeps the bytes; nothing is transferred or mutated). */
13
+ export const CSV_INPUT_OWNERSHIP = 'borrows';
14
+ export function parseCsv(input, options = {}) {
15
+ const started = Date.now();
16
+ const limits = { ...DEFAULT_LIMITS, ...options.limits };
17
+ const diagnostics = [];
18
+ const finish = (result) => ({
19
+ result,
20
+ execution: {
21
+ workerUsed: false,
22
+ hardLimitEnforced: false,
23
+ elapsedMillis: Date.now() - started
24
+ }
25
+ });
26
+ const inputBytes = typeof input === 'string' ? utf8ByteLength(input) : input.byteLength;
27
+ if (inputBytes > limits.maxInputBytes) {
28
+ return finish({
29
+ status: 'failed',
30
+ failure: {
31
+ code: 'limit-exceeded',
32
+ retryable: false,
33
+ messageKey: 'diag.limit-exceeded.input',
34
+ args: { maxBytes: limits.maxInputBytes }
35
+ },
36
+ diagnostics
37
+ });
38
+ }
39
+ if (options.signal?.aborted) {
40
+ return finish({
41
+ status: 'failed',
42
+ failure: { code: 'aborted', retryable: true, messageKey: 'diag.aborted' },
43
+ diagnostics
44
+ });
45
+ }
46
+ const text = typeof input === 'string' ? input : decodeUtf8(input);
47
+ let detection;
48
+ if (options.delimiter !== undefined) {
49
+ detection = { delimiter: options.delimiter, confidence: 1, source: 'override' };
50
+ }
51
+ else if (options.fileName !== undefined && asciiLower(options.fileName).endsWith('.tsv')) {
52
+ detection = { ...detectDelimiterForFile(options.fileName, text), source: 'extension' };
53
+ }
54
+ else {
55
+ detection = { ...detectDelimiter(text), source: 'auto' };
56
+ }
57
+ const tracker = new LimitTracker(limits, options.signal);
58
+ let violation = null;
59
+ const parseTextOptions = {
60
+ delimiter: detection.delimiter,
61
+ checkpoint: (recordCount) => {
62
+ tracker.addEntries(1);
63
+ // Amortize the time/abort checks: every 256 records.
64
+ if (recordCount % 256 !== 0 && recordCount <= limits.maxEntries) {
65
+ return true;
66
+ }
67
+ violation = tracker.checkpoint();
68
+ return violation === null;
69
+ }
70
+ };
71
+ if (options.hasHeader !== undefined) {
72
+ parseTextOptions.hasHeader = options.hasHeader;
73
+ }
74
+ const raw = parseCsvText(text, parseTextOptions);
75
+ if (raw.raggedRowCount > 0) {
76
+ diagnostics.push({
77
+ severity: 'warning',
78
+ code: 'csv.ragged-rows',
79
+ messageKey: 'diag.csv.ragged-rows',
80
+ args: { count: raw.raggedRowCount }
81
+ });
82
+ }
83
+ const document = {
84
+ headers: raw.headers,
85
+ rows: raw.rows,
86
+ columnCount: raw.columnCount,
87
+ delimiter: detection.delimiter,
88
+ detection
89
+ };
90
+ if (raw.stoppedEarly) {
91
+ const v = violation;
92
+ if (v && v.kind === 'aborted') {
93
+ return finish({
94
+ status: 'failed',
95
+ failure: { code: 'aborted', retryable: true, messageKey: 'diag.aborted' },
96
+ diagnostics
97
+ });
98
+ }
99
+ diagnostics.push({
100
+ severity: 'warning',
101
+ code: 'limit-exceeded',
102
+ messageKey: 'diag.limit-exceeded.rows',
103
+ args: { count: document.rows.length }
104
+ });
105
+ return finish({ status: 'partial', document, diagnostics });
106
+ }
107
+ return finish({ status: 'ok', document, diagnostics });
108
+ }
@@ -0,0 +1,20 @@
1
+ export interface RawCsv {
2
+ headers: string[];
3
+ rows: string[][];
4
+ columnCount: number;
5
+ /** Rows whose cell count differed from columnCount (padded/truncated). */
6
+ raggedRowCount: number;
7
+ /** True when the record loop was stopped early by the checkpoint. */
8
+ stoppedEarly: boolean;
9
+ }
10
+ export interface ParseTextOptions {
11
+ delimiter?: string;
12
+ /** First row is headers (default true); otherwise headers are generated. */
13
+ hasHeader?: boolean;
14
+ /**
15
+ * Called after each completed record with the running record count.
16
+ * Return false to stop parsing (limit hit / aborted).
17
+ */
18
+ checkpoint?: (recordCount: number) => boolean;
19
+ }
20
+ export declare function parseCsvText(text: string, options?: ParseTextOptions): RawCsv;
@@ -0,0 +1,108 @@
1
+ // RFC-4180-ish CSV text parser. Ported from omni-viewer-chrome
2
+ // `templates/csv/js/csvParser.ts` with two changes for the core contract:
3
+ // - ragged rows (padded / truncated to columnCount) are counted so the
4
+ // caller can emit a `diag.csv.ragged-rows` diagnostic,
5
+ // - the record loop reports through a cooperative checkpoint callback so
6
+ // limits / cancellation can stop parsing mid-file (DESIGN.md §3-①).
7
+ export function parseCsvText(text, options = {}) {
8
+ const delimiter = options.delimiter ?? ',';
9
+ const hasHeader = options.hasHeader ?? true;
10
+ const checkpoint = options.checkpoint;
11
+ // Strip BOM so the first header doesn't carry a leading U+FEFF.
12
+ const stripped = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
13
+ const normalized = stripped.replace(/\r\n?/g, '\n');
14
+ const records = [];
15
+ let field = '';
16
+ let row = [];
17
+ let inQuotes = false;
18
+ let stoppedEarly = false;
19
+ for (let i = 0; i < normalized.length; i++) {
20
+ const ch = normalized[i];
21
+ if (inQuotes) {
22
+ if (ch === '"') {
23
+ if (normalized[i + 1] === '"') {
24
+ field += '"';
25
+ i++;
26
+ }
27
+ else {
28
+ inQuotes = false;
29
+ }
30
+ }
31
+ else {
32
+ field += ch;
33
+ }
34
+ continue;
35
+ }
36
+ if (ch === '"' && field.length === 0) {
37
+ inQuotes = true;
38
+ continue;
39
+ }
40
+ if (ch === delimiter) {
41
+ row.push(field);
42
+ field = '';
43
+ continue;
44
+ }
45
+ if (ch === '\n') {
46
+ row.push(field);
47
+ field = '';
48
+ records.push(row);
49
+ row = [];
50
+ if (checkpoint && !checkpoint(records.length)) {
51
+ stoppedEarly = true;
52
+ break;
53
+ }
54
+ continue;
55
+ }
56
+ field += ch;
57
+ }
58
+ // Flush the last field/row unless we stopped early mid-record. Drop a
59
+ // trailing empty row produced by a final newline. The flushed record goes
60
+ // through the same checkpoint as the loop, so a file without a trailing
61
+ // newline cannot slip one record past the entry limit unreported.
62
+ if (!stoppedEarly && (field.length > 0 || row.length > 0)) {
63
+ row.push(field);
64
+ records.push(row);
65
+ if (checkpoint && !checkpoint(records.length)) {
66
+ stoppedEarly = true;
67
+ }
68
+ }
69
+ if (records.length === 0) {
70
+ return { headers: [], rows: [], columnCount: 0, raggedRowCount: 0, stoppedEarly };
71
+ }
72
+ let headers;
73
+ let dataRows;
74
+ if (hasHeader) {
75
+ headers = records[0] ?? [];
76
+ dataRows = records.slice(1);
77
+ }
78
+ else {
79
+ headers = [];
80
+ dataRows = records;
81
+ }
82
+ let columnCount = headers.length;
83
+ for (const r of dataRows) {
84
+ if (r.length > columnCount)
85
+ columnCount = r.length;
86
+ }
87
+ if (!hasHeader) {
88
+ headers = Array.from({ length: columnCount }, (_, i) => `Column ${i + 1}`);
89
+ }
90
+ else {
91
+ while (headers.length < columnCount) {
92
+ headers.push(`Column ${headers.length + 1}`);
93
+ }
94
+ }
95
+ let raggedRowCount = 0;
96
+ const padded = dataRows.map((r) => {
97
+ if (r.length === columnCount)
98
+ return r;
99
+ raggedRowCount++;
100
+ if (r.length > columnCount)
101
+ return r.slice(0, columnCount);
102
+ const out = r.slice();
103
+ while (out.length < columnCount)
104
+ out.push('');
105
+ return out;
106
+ });
107
+ return { headers, rows: padded, columnCount, raggedRowCount, stoppedEarly };
108
+ }
@@ -0,0 +1,26 @@
1
+ export type SortDirection = 'asc' | 'desc' | null;
2
+ export interface SortState {
3
+ columnIndex: number | null;
4
+ direction: SortDirection;
5
+ }
6
+ export type ColumnType = 'number' | 'date' | 'text';
7
+ /** Cycle asc -> desc -> none; switching column restarts at asc. */
8
+ export declare function nextSortState(current: SortState, columnIndex: number): SortState;
9
+ /** Parse a supported date shape to epoch millis; null when not date-shaped. */
10
+ export declare function parseDateKey(value: string): number | null;
11
+ /**
12
+ * Detect the type of a column from its values. Empty strings are ignored —
13
+ * they sort separately at the end.
14
+ */
15
+ export declare function detectColumnType(values: readonly string[]): ColumnType;
16
+ /**
17
+ * Deterministic natural compare: splits both strings into digit / non-digit
18
+ * runs; digit runs compare numerically ("10" > "9"), other runs compare by
19
+ * code point over the Unicode-default lowercased form.
20
+ */
21
+ export declare function naturalCompare(a: string, b: string): number;
22
+ /**
23
+ * Produce a sorted copy of `rowIndices` according to `state`. Stable; never
24
+ * mutates the input; empties end up at the bottom in both directions.
25
+ */
26
+ export declare function applySort(rowIndices: readonly number[], state: SortState, getCell: (rowIndex: number, columnIndex: number) => string, columnType?: ColumnType): number[];