@peaske7/readit 0.2.1 → 0.3.0-rc.1

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 (367) hide show
  1. package/dist/.vite/manifest.json +1111 -0
  2. package/dist/assets/_basePickBy-BMMA4Tou.js +1 -0
  3. package/dist/assets/_baseUniq-D40qku1I.js +1 -0
  4. package/dist/assets/arc-Ckg65iy8.js +1 -0
  5. package/dist/assets/architecture-YZFGNWBL-Dv3EY0zV.js +1 -0
  6. package/dist/assets/architectureDiagram-Q4EWVU46-ClRss4cm.js +36 -0
  7. package/dist/assets/array-Bjz-wYpJ.js +1 -0
  8. package/dist/assets/blockDiagram-DXYQGD6D-CBcFvoK1.js +132 -0
  9. package/dist/assets/c4Diagram-AHTNJAMY-D4d3ZLam.js +10 -0
  10. package/dist/assets/channel-D9EJxDy_.js +1 -0
  11. package/dist/assets/chunk-2KRD3SAO-DaFfaCGO.js +1 -0
  12. package/dist/assets/chunk-336JU56O-yLEQoF0v.js +2 -0
  13. package/dist/assets/chunk-426QAEUC-Uyzd4wAA.js +1 -0
  14. package/dist/assets/chunk-4BX2VUAB-DRuTD7x5.js +1 -0
  15. package/dist/assets/chunk-4TB4RGXK-3xbpIi_o.js +206 -0
  16. package/dist/assets/chunk-55IACEB6-BExiaAoD.js +1 -0
  17. package/dist/assets/chunk-5FUZZQ4R-DatVvHnF.js +62 -0
  18. package/dist/assets/chunk-5PVQY5BW-BKgvrGh8.js +2 -0
  19. package/dist/assets/chunk-67CJDMHE-DMt8LNEX.js +1 -0
  20. package/dist/assets/chunk-7N4EOEYR-CzLGefVf.js +1 -0
  21. package/dist/assets/chunk-AA7GKIK3-B6GFAk4U.js +1 -0
  22. package/dist/assets/chunk-BSJP7CBP-BK29yehL.js +1 -0
  23. package/dist/assets/chunk-CIAEETIT-D7hBXImP.js +1 -0
  24. package/dist/assets/chunk-Dlc7tRH4.js +1 -0
  25. package/dist/assets/chunk-EDXVE4YY-PYJdlmyH.js +1 -0
  26. package/dist/assets/chunk-ENJZ2VHE-DUHKBv6x.js +10 -0
  27. package/dist/assets/chunk-FMBD7UC4-2FWyCCAV.js +15 -0
  28. package/dist/assets/chunk-FOC6F5B3-DKFHrt4K.js +1 -0
  29. package/dist/assets/chunk-ICPOFSXX-Bh__D0ec.js +122 -0
  30. package/dist/assets/chunk-K5T4RW27-D51O7IkG.js +94 -0
  31. package/dist/assets/chunk-KGLVRYIC-DMHSCH4T.js +1 -0
  32. package/dist/assets/chunk-LIHQZDEY-C2aANxt9.js +1 -0
  33. package/dist/assets/chunk-ORNJ4GCN-Db_37NRX.js +1 -0
  34. package/dist/assets/chunk-OYMX7WX6-BltXOJLJ.js +231 -0
  35. package/dist/assets/chunk-QZHKN3VN-8Lcg9gti.js +1 -0
  36. package/dist/assets/chunk-U2HBQHQK-ByS6tilY.js +70 -0
  37. package/dist/assets/chunk-X2U36JSP-Bm-4Gqg_.js +1 -0
  38. package/dist/assets/chunk-XPW4576I-Bqbompq4.js +32 -0
  39. package/dist/assets/chunk-YZCP3GAM-CsC0imPb.js +1 -0
  40. package/dist/assets/chunk-ZZ45TVLE-CG-CqfPC.js +1 -0
  41. package/dist/assets/classDiagram-6PBFFD2Q-Jy1uFUk4.js +1 -0
  42. package/dist/assets/classDiagram-v2-HSJHXN6E-ChiLl3rR.js +1 -0
  43. package/dist/assets/clone-BBjvuERA.js +1 -0
  44. package/dist/assets/cose-bilkent-S5V4N54A-q90QeGKv.js +1 -0
  45. package/dist/assets/cytoscape.esm-BfXff3fb.js +321 -0
  46. package/dist/assets/dagre-KV5264BT-BQWiLFJB.js +4 -0
  47. package/dist/assets/dagre-nn_aIZ2E.js +1 -0
  48. package/dist/assets/defaultLocale-BwmRmqJp.js +1 -0
  49. package/dist/assets/diagram-5BDNPKRD-CJa7Y97H.js +10 -0
  50. package/dist/assets/diagram-G4DWMVQ6-tVQGBWfY.js +24 -0
  51. package/dist/assets/diagram-MMDJMWI5-CpimFldm.js +43 -0
  52. package/dist/assets/diagram-TYMM5635-D11WQVgy.js +24 -0
  53. package/dist/assets/dist-BNz65Ibc.js +1 -0
  54. package/dist/assets/erDiagram-SMLLAGMA-C2bLd0jS.js +85 -0
  55. package/dist/assets/flowDiagram-DWJPFMVM-Kw3fOOLT.js +162 -0
  56. package/dist/assets/ganttDiagram-T4ZO3ILL-fyMhyE2X.js +292 -0
  57. package/dist/assets/gitGraph-7Q5UKJZL-BGFRt2qs.js +1 -0
  58. package/dist/assets/gitGraphDiagram-UUTBAWPF-D4JoiOvg.js +106 -0
  59. package/dist/assets/graphlib-DGcD9J2L.js +1 -0
  60. package/dist/assets/index-Cow3qpoq.css +2 -0
  61. package/dist/assets/index-DUf7okYi.js +14 -0
  62. package/dist/assets/info-OMHHGYJF-DI6-Z9vh.js +1 -0
  63. package/dist/assets/infoDiagram-42DDH7IO-D1ZkeMBy.js +2 -0
  64. package/dist/assets/init-TPm5RB77.js +1 -0
  65. package/dist/assets/isArrayLikeObject-69BLnVNM.js +1 -0
  66. package/dist/assets/isEmpty-DUS28g5f.js +1 -0
  67. package/dist/assets/ishikawaDiagram-UXIWVN3A-Dv8hzjZB.js +70 -0
  68. package/dist/assets/journeyDiagram-VCZTEJTY-COeB7F5r.js +139 -0
  69. package/dist/assets/kanban-definition-6JOO6SKY-BbYmxCYU.js +89 -0
  70. package/dist/assets/katex-5SGEXwpi.js +261 -0
  71. package/dist/assets/line-_v2NGEdn.js +1 -0
  72. package/dist/assets/linear-CXMqTN8N.js +1 -0
  73. package/dist/assets/mermaid-config-C8a4L22x.js +1 -0
  74. package/dist/assets/mermaid-parser.core-CFmphzPP.js +4 -0
  75. package/dist/assets/mermaid.core-DnHAupTp.js +11 -0
  76. package/dist/assets/mindmap-definition-QFDTVHPH-D7_lIep7.js +96 -0
  77. package/dist/assets/ordinal-D7l-8DAO.js +1 -0
  78. package/dist/assets/packet-4T2RLAQJ-DidW3JFc.js +1 -0
  79. package/dist/assets/path-BVpCanzE.js +1 -0
  80. package/dist/assets/pie-ZZUOXDRM-Bff2e5hg.js +1 -0
  81. package/dist/assets/pieDiagram-DEJITSTG-DDvYHCT_.js +30 -0
  82. package/dist/assets/quadrantDiagram-34T5L4WZ-DcLcIrdi.js +7 -0
  83. package/dist/assets/radar-PYXPWWZC-CsdZBH3M.js +1 -0
  84. package/dist/assets/requirementDiagram-MS252O5E-DLX6ld7D.js +84 -0
  85. package/dist/assets/rough.esm-BoTisKeL.js +1 -0
  86. package/dist/assets/sankeyDiagram-XADWPNL6-D-1GtsHM.js +10 -0
  87. package/dist/assets/sequenceDiagram-FGHM5R23-Bwxs0YQg.js +157 -0
  88. package/dist/assets/src-CrmkjRpa.js +1 -0
  89. package/dist/assets/stateDiagram-FHFEXIEX-DW7rOcnQ.js +1 -0
  90. package/dist/assets/stateDiagram-v2-QKLJ7IA2-Jm-24vQ2.js +1 -0
  91. package/dist/assets/timeline-definition-GMOUNBTQ-DVdHyzxS.js +120 -0
  92. package/dist/assets/treeView-SZITEDCU-DPKseaET.js +1 -0
  93. package/dist/assets/treemap-W4RFUUIX-DH-7GZe_.js +1 -0
  94. package/dist/assets/vennDiagram-DHZGUBPP-DJaC6xmI.js +34 -0
  95. package/dist/assets/wardley-RL74JXVD-AgyXyBN5.js +1 -0
  96. package/dist/assets/wardleyDiagram-NUSXRM2D-CTKERPKv.js +20 -0
  97. package/dist/assets/xychartDiagram-5P7HB3ND-BuExiLXc.js +7 -0
  98. package/{index.html → dist/index.html} +2 -1
  99. package/dist/index.js +2539 -0
  100. package/package.json +11 -1
  101. package/.agents/skills/remotion-best-practices/SKILL.md +0 -61
  102. package/.agents/skills/remotion-best-practices/rules/3d.md +0 -86
  103. package/.agents/skills/remotion-best-practices/rules/animations.md +0 -27
  104. package/.agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +0 -178
  105. package/.agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +0 -100
  106. package/.agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +0 -108
  107. package/.agents/skills/remotion-best-practices/rules/assets.md +0 -78
  108. package/.agents/skills/remotion-best-practices/rules/audio-visualization.md +0 -198
  109. package/.agents/skills/remotion-best-practices/rules/audio.md +0 -169
  110. package/.agents/skills/remotion-best-practices/rules/calculate-metadata.md +0 -134
  111. package/.agents/skills/remotion-best-practices/rules/can-decode.md +0 -75
  112. package/.agents/skills/remotion-best-practices/rules/charts.md +0 -120
  113. package/.agents/skills/remotion-best-practices/rules/compositions.md +0 -154
  114. package/.agents/skills/remotion-best-practices/rules/display-captions.md +0 -184
  115. package/.agents/skills/remotion-best-practices/rules/extract-frames.md +0 -229
  116. package/.agents/skills/remotion-best-practices/rules/ffmpeg.md +0 -38
  117. package/.agents/skills/remotion-best-practices/rules/fonts.md +0 -152
  118. package/.agents/skills/remotion-best-practices/rules/get-audio-duration.md +0 -58
  119. package/.agents/skills/remotion-best-practices/rules/get-video-dimensions.md +0 -68
  120. package/.agents/skills/remotion-best-practices/rules/get-video-duration.md +0 -60
  121. package/.agents/skills/remotion-best-practices/rules/gifs.md +0 -141
  122. package/.agents/skills/remotion-best-practices/rules/images.md +0 -134
  123. package/.agents/skills/remotion-best-practices/rules/import-srt-captions.md +0 -69
  124. package/.agents/skills/remotion-best-practices/rules/light-leaks.md +0 -73
  125. package/.agents/skills/remotion-best-practices/rules/lottie.md +0 -70
  126. package/.agents/skills/remotion-best-practices/rules/maps.md +0 -412
  127. package/.agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md +0 -34
  128. package/.agents/skills/remotion-best-practices/rules/measuring-text.md +0 -140
  129. package/.agents/skills/remotion-best-practices/rules/parameters.md +0 -109
  130. package/.agents/skills/remotion-best-practices/rules/sequencing.md +0 -118
  131. package/.agents/skills/remotion-best-practices/rules/sfx.md +0 -26
  132. package/.agents/skills/remotion-best-practices/rules/subtitles.md +0 -36
  133. package/.agents/skills/remotion-best-practices/rules/tailwind.md +0 -11
  134. package/.agents/skills/remotion-best-practices/rules/text-animations.md +0 -20
  135. package/.agents/skills/remotion-best-practices/rules/timing.md +0 -179
  136. package/.agents/skills/remotion-best-practices/rules/transcribe-captions.md +0 -70
  137. package/.agents/skills/remotion-best-practices/rules/transitions.md +0 -197
  138. package/.agents/skills/remotion-best-practices/rules/transparent-videos.md +0 -106
  139. package/.agents/skills/remotion-best-practices/rules/trimming.md +0 -51
  140. package/.agents/skills/remotion-best-practices/rules/videos.md +0 -171
  141. package/.agents/skills/remotion-best-practices/rules/voiceover.md +0 -99
  142. package/.agents/skills/simple/SKILL.md +0 -52
  143. package/.agents/skills/vercel-react-best-practices/AGENTS.md +0 -3254
  144. package/.agents/skills/vercel-react-best-practices/README.md +0 -123
  145. package/.agents/skills/vercel-react-best-practices/SKILL.md +0 -141
  146. package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  147. package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
  148. package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
  149. package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  150. package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
  151. package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
  152. package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
  153. package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  154. package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
  155. package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  156. package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  157. package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  158. package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  159. package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  160. package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  161. package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  162. package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  163. package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
  164. package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  165. package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  166. package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  167. package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  168. package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  169. package/.agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
  170. package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  171. package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  172. package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  173. package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  174. package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  175. package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  176. package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  177. package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  178. package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  179. package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  180. package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  181. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  182. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
  183. package/.agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
  184. package/.agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
  185. package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  186. package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
  187. package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  188. package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  189. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
  190. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  191. package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  192. package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  193. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
  194. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  195. package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
  196. package/.agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
  197. package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
  198. package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  199. package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
  200. package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  201. package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
  202. package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  203. package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  204. package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
  205. package/.agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
  206. package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  207. package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
  208. package/.claude/CLAUDE.md +0 -184
  209. package/.claude/commands/review.md +0 -120
  210. package/.claude/commands/sync-docs.md +0 -71
  211. package/.claude/roadmap.md +0 -121
  212. package/.claude/rules/style-guide.md +0 -830
  213. package/.claude/settings.json +0 -18
  214. package/.claude/user-stories.md +0 -333
  215. package/AGENTS.md +0 -68
  216. package/Makefile +0 -32
  217. package/biome.json +0 -79
  218. package/bun.lock +0 -854
  219. package/bunfig.toml +0 -2
  220. package/docs/design.md +0 -563
  221. package/docs/perf-baseline.md +0 -130
  222. package/docs/plans/2026-03-13-client-mode-design.md +0 -86
  223. package/docs/plans/2026-03-13-client-mode-plan.md +0 -605
  224. package/docs/plans/2026-03-13-keyboard-shortcuts-design.md +0 -129
  225. package/docs/plans/2026-03-13-keyboard-shortcuts-plan.md +0 -1471
  226. package/docs/plans/2026-03-13-multi-document-design.md +0 -183
  227. package/docs/plans/2026-03-13-performance-benchmarks-design.md +0 -121
  228. package/docs/superpowers/plans/2026-03-26-surgical-pruning.md +0 -1176
  229. package/docs/superpowers/specs/2026-03-27-go-server-rewrite-design.md +0 -284
  230. package/e2e/comments.spec.ts +0 -81
  231. package/e2e/document-load.spec.ts +0 -32
  232. package/e2e/export.spec.ts +0 -58
  233. package/e2e/fixtures/sample.md +0 -7
  234. package/e2e/perf/add-comment.spec.ts +0 -116
  235. package/e2e/perf/fixtures/generate.ts +0 -327
  236. package/e2e/perf/initial-load.spec.ts +0 -49
  237. package/e2e/perf/perf.setup.ts +0 -23
  238. package/e2e/perf/perf.teardown.ts +0 -9
  239. package/e2e/perf/screenshot-final.png +0 -0
  240. package/e2e/perf/scroll.spec.ts +0 -39
  241. package/e2e/perf/tab-switch.spec.ts +0 -69
  242. package/e2e/perf/text-selection.spec.ts +0 -119
  243. package/e2e/perf/utils/metrics.ts +0 -350
  244. package/e2e/perf/utils/perf-cli.ts +0 -86
  245. package/e2e/persistence-file.spec.ts +0 -357
  246. package/e2e/utils/cli.ts +0 -84
  247. package/e2e/utils/selection.ts +0 -79
  248. package/go/cmd/readit/main.go +0 -416
  249. package/go/go.mod +0 -20
  250. package/go/go.sum +0 -41
  251. package/go/internal/server/anchor.go +0 -302
  252. package/go/internal/server/anchor_test.go +0 -111
  253. package/go/internal/server/comments.go +0 -390
  254. package/go/internal/server/documents.go +0 -113
  255. package/go/internal/server/embed.go +0 -17
  256. package/go/internal/server/headings.go +0 -33
  257. package/go/internal/server/headings_test.go +0 -75
  258. package/go/internal/server/htmltext.go +0 -123
  259. package/go/internal/server/markdown.go +0 -157
  260. package/go/internal/server/markdown_bench_test.go +0 -42
  261. package/go/internal/server/markdown_test.go +0 -79
  262. package/go/internal/server/server.go +0 -453
  263. package/go/internal/server/server_bench_test.go +0 -122
  264. package/go/internal/server/settings.go +0 -110
  265. package/go/internal/server/sse.go +0 -140
  266. package/go/internal/server/storage.go +0 -275
  267. package/go/internal/server/storage_test.go +0 -118
  268. package/go/internal/server/template.go +0 -66
  269. package/go/internal/server/types.go +0 -101
  270. package/go/internal/server/watcher.go +0 -74
  271. package/lefthook.yml +0 -8
  272. package/nvim-readit/lua/readit/health.lua +0 -64
  273. package/nvim-readit/lua/readit/init.lua +0 -463
  274. package/nvim-readit/plugin/readit.lua +0 -19
  275. package/playwright.config.ts +0 -34
  276. package/skills-lock.json +0 -20
  277. package/src/App.svelte +0 -881
  278. package/src/cli.ts +0 -881
  279. package/src/components/ActionsMenu.svelte +0 -95
  280. package/src/components/CommentBadge.svelte +0 -67
  281. package/src/components/CommentErrorBanner.svelte +0 -33
  282. package/src/components/CommentInput.svelte +0 -75
  283. package/src/components/CommentListItem.svelte +0 -95
  284. package/src/components/CommentManager.svelte +0 -129
  285. package/src/components/CommentNav.svelte +0 -109
  286. package/src/components/DocumentViewer.svelte +0 -218
  287. package/src/components/FloatingComment.svelte +0 -107
  288. package/src/components/Header.svelte +0 -76
  289. package/src/components/InlineEditor.svelte +0 -72
  290. package/src/components/MarginNote.svelte +0 -167
  291. package/src/components/MarginNotesContainer.svelte +0 -33
  292. package/src/components/RawModal.svelte +0 -126
  293. package/src/components/ReanchorConfirm.svelte +0 -30
  294. package/src/components/SettingsModal.svelte +0 -220
  295. package/src/components/ShortcutCapture.svelte +0 -82
  296. package/src/components/ShortcutList.svelte +0 -145
  297. package/src/components/TabBar.svelte +0 -52
  298. package/src/components/TableOfContents.svelte +0 -125
  299. package/src/components/ui/ActionLink.svelte +0 -40
  300. package/src/components/ui/Button.svelte +0 -53
  301. package/src/components/ui/Dialog.svelte +0 -97
  302. package/src/components/ui/DropdownMenu.svelte +0 -85
  303. package/src/components/ui/DropdownMenuItem.svelte +0 -38
  304. package/src/components/ui/DropdownMenuSeparator.svelte +0 -11
  305. package/src/components/ui/Text.svelte +0 -42
  306. package/src/env.d.ts +0 -6
  307. package/src/index.css +0 -754
  308. package/src/lib/__fixtures__/bench-data.ts +0 -114
  309. package/src/lib/anchor.bench.ts +0 -91
  310. package/src/lib/anchor.test.ts +0 -527
  311. package/src/lib/anchor.ts +0 -381
  312. package/src/lib/comment-storage.bench.ts +0 -49
  313. package/src/lib/comment-storage.test.ts +0 -632
  314. package/src/lib/comment-storage.ts +0 -222
  315. package/src/lib/export.bench.ts +0 -21
  316. package/src/lib/export.ts +0 -36
  317. package/src/lib/headings.test.ts +0 -103
  318. package/src/lib/headings.ts +0 -44
  319. package/src/lib/highlight/core.test.ts +0 -93
  320. package/src/lib/highlight/dom.ts +0 -187
  321. package/src/lib/highlight/highlight-registry.ts +0 -221
  322. package/src/lib/highlight/highlight.bench.ts +0 -92
  323. package/src/lib/highlight/highlighter.ts +0 -247
  324. package/src/lib/highlight/resolver.ts +0 -38
  325. package/src/lib/highlight/types.ts +0 -17
  326. package/src/lib/html-text.test.ts +0 -162
  327. package/src/lib/html-text.ts +0 -161
  328. package/src/lib/i18n/en.ts +0 -116
  329. package/src/lib/i18n/index.ts +0 -3
  330. package/src/lib/i18n/ja.ts +0 -118
  331. package/src/lib/i18n/translations.ts +0 -27
  332. package/src/lib/i18n/types.ts +0 -122
  333. package/src/lib/margin-layout.bench.ts +0 -61
  334. package/src/lib/margin-layout.ts +0 -71
  335. package/src/lib/markdown-renderer.test.ts +0 -154
  336. package/src/lib/markdown-renderer.ts +0 -177
  337. package/src/lib/mermaid-config.ts +0 -38
  338. package/src/lib/mermaid-renderer.ts +0 -162
  339. package/src/lib/mermaid-worker.ts +0 -60
  340. package/src/lib/positions.ts +0 -157
  341. package/src/lib/shortcut-registry.ts +0 -244
  342. package/src/lib/utils.ts +0 -15
  343. package/src/main.ts +0 -16
  344. package/src/schema.ts +0 -92
  345. package/src/server.ts +0 -1220
  346. package/src/stores/app.svelte.ts +0 -231
  347. package/src/stores/locale.svelte.ts +0 -46
  348. package/src/stores/settings.svelte.ts +0 -90
  349. package/src/stores/shortcuts.svelte.ts +0 -104
  350. package/src/stores/ui.svelte.ts +0 -12
  351. package/src/template.ts +0 -104
  352. package/src/test-setup.ts +0 -48
  353. package/svelte.config.js +0 -5
  354. package/test.md +0 -74
  355. package/tsconfig.cli.json +0 -12
  356. package/tsconfig.json +0 -20
  357. package/vite.config.ts +0 -47
  358. package/vitest.config.ts +0 -15
  359. package/vscode-readit/.mcp.json +0 -7
  360. package/vscode-readit/.vscodeignore +0 -7
  361. package/vscode-readit/bun.lock +0 -78
  362. package/vscode-readit/icon.svg +0 -10
  363. package/vscode-readit/package.json +0 -110
  364. package/vscode-readit/src/extension.ts +0 -117
  365. package/vscode-readit/src/server-manager.ts +0 -272
  366. package/vscode-readit/src/webview-provider.ts +0 -204
  367. package/vscode-readit/tsconfig.json +0 -20
@@ -1,122 +0,0 @@
1
- export const Locales = {
2
- JA: "ja",
3
- EN: "en",
4
- } as const;
5
-
6
- export type Locale = (typeof Locales)[keyof typeof Locales];
7
-
8
- export interface Translations {
9
- // App
10
- "app.loading": string;
11
- "app.noDocuments": string;
12
- "app.noDocumentsHintPrefix": string;
13
- "app.noDocumentsHintSuffix": string;
14
- "app.footer": string;
15
-
16
- // Header
17
- "header.selectTextToReanchor": string;
18
-
19
- // Actions menu
20
- "actions.ariaLabel": string;
21
- "actions.settings": string;
22
- "actions.reload": string;
23
- "actions.copyAll": string;
24
- "actions.exportJson": string;
25
- "actions.viewRaw": string;
26
-
27
- // Settings
28
- "settings.title": string;
29
- "settings.theme": string;
30
- "settings.font": string;
31
- "settings.language": string;
32
- "settings.theme.system": string;
33
- "settings.theme.light": string;
34
- "settings.theme.dark": string;
35
- "settings.font.serif": string;
36
- "settings.font.sansSerif": string;
37
-
38
- // Comment input
39
- "comment.placeholder": string;
40
- "comment.cancel": string;
41
- "comment.addNote": string;
42
- "comment.highlight": string;
43
-
44
- // Margin note
45
- "marginNote.addNote": string;
46
- "marginNote.delete": string;
47
- "marginNote.edit": string;
48
- "marginNote.copy": string;
49
-
50
- // Comment manager
51
- "commentManager.unresolved": string;
52
- "commentManager.deleteAllConfirm": string;
53
- "commentManager.delete": string;
54
- "commentManager.cancel": string;
55
- "commentManager.copyAllTitle": string;
56
- "commentManager.deleteAllTitle": string;
57
- "commentManager.noComments": string;
58
-
59
- // Comment list item
60
- "commentList.edit": string;
61
- "commentList.delete": string;
62
- "commentList.goTo": string;
63
- "commentList.reanchor": string;
64
- "commentList.unresolved": string;
65
-
66
- // Comment nav
67
- "commentNav.previous": string;
68
- "commentNav.next": string;
69
- "commentNav.of": string;
70
-
71
- // Inline editor
72
- "editor.save": string;
73
- "editor.cancel": string;
74
-
75
- // Reanchor confirm
76
- "reanchor.question": string;
77
- "reanchor.confirm": string;
78
- "reanchor.cancel": string;
79
-
80
- // Raw comments modal
81
- "rawModal.title": string;
82
- "rawModal.copyTitle": string;
83
- "rawModal.loading": string;
84
- "rawModal.noComments": string;
85
- "rawModal.copiedToClipboard": string;
86
- "rawModal.failedToCopy": string;
87
-
88
- // Toast messages
89
- "toast.copied": string;
90
- "toast.copiedAllComments": string;
91
-
92
- // Comment badge
93
- "commentBadge.title": string;
94
- "commentBadge.titlePlural": string;
95
-
96
- // Keyboard shortcuts
97
- "shortcuts.title": string;
98
- "shortcutGroup.copy": string;
99
- "shortcutGroup.navigate": string;
100
- "shortcutGroup.other": string;
101
- "shortcuts.resetToDefaults": string;
102
- "shortcuts.enableDisable": string;
103
- "shortcutCapture.pressKeys": string;
104
- "shortcutCapture.reserved": string;
105
- "shortcutCapture.ariaLabel": string;
106
- "shortcut.copyAll.label": string;
107
- "shortcut.copyAll.description": string;
108
- "shortcut.copyAllRaw.label": string;
109
- "shortcut.copyAllRaw.description": string;
110
- "shortcut.navigateNext.label": string;
111
- "shortcut.navigateNext.description": string;
112
- "shortcut.navigatePrevious.label": string;
113
- "shortcut.navigatePrevious.description": string;
114
- "shortcut.copySelectionRaw.label": string;
115
- "shortcut.copySelectionRaw.description": string;
116
- "shortcut.copySelectionLLM.label": string;
117
- "shortcut.copySelectionLLM.description": string;
118
- "shortcut.clearSelection.label": string;
119
- "shortcut.clearSelection.description": string;
120
- }
121
-
122
- export type TranslationKey = keyof Translations;
@@ -1,61 +0,0 @@
1
- import { bench, describe } from "vitest";
2
- import {
3
- COMMENTS_1,
4
- COMMENTS_10,
5
- COMMENTS_50,
6
- } from "./__fixtures__/bench-data";
7
- import { resolveMarginNotePositions } from "./margin-layout";
8
-
9
- function makeHighlightPositions(
10
- commentIds: string[],
11
- spacing: number,
12
- ): Record<string, number> {
13
- const positions: Record<string, number> = {};
14
- for (let i = 0; i < commentIds.length; i++) {
15
- positions[commentIds[i]] = i * spacing;
16
- }
17
- return positions;
18
- }
19
-
20
- describe("resolveMarginNotePositions — well-spaced", () => {
21
- bench("1 comment", () => {
22
- const ids = COMMENTS_1.map((c) => c.id);
23
- const positions = makeHighlightPositions(ids, 300);
24
- resolveMarginNotePositions(ids, positions, undefined);
25
- });
26
-
27
- bench("10 comments", () => {
28
- const ids = COMMENTS_10.map((c) => c.id);
29
- const positions = makeHighlightPositions(ids, 300);
30
- resolveMarginNotePositions(ids, positions, undefined);
31
- });
32
-
33
- bench("50 comments", () => {
34
- const ids = COMMENTS_50.map((c) => c.id);
35
- const positions = makeHighlightPositions(ids, 300);
36
- resolveMarginNotePositions(ids, positions, undefined);
37
- });
38
- });
39
-
40
- describe("resolveMarginNotePositions — clustered", () => {
41
- bench("10 comments, 10px apart", () => {
42
- const ids = COMMENTS_10.map((c) => c.id);
43
- const positions = makeHighlightPositions(ids, 10);
44
- resolveMarginNotePositions(ids, positions, undefined);
45
- });
46
-
47
- bench("50 comments, 10px apart", () => {
48
- const ids = COMMENTS_50.map((c) => c.id);
49
- const positions = makeHighlightPositions(ids, 10);
50
- resolveMarginNotePositions(ids, positions, undefined);
51
- });
52
- });
53
-
54
- describe("resolveMarginNotePositions — with input zone", () => {
55
- bench("50 comments, input at middle", () => {
56
- const ids = COMMENTS_50.map((c) => c.id);
57
- const positions = makeHighlightPositions(ids, 100);
58
- const midpoint = 25 * 100;
59
- resolveMarginNotePositions(ids, positions, midpoint);
60
- });
61
- });
@@ -1,71 +0,0 @@
1
- const MARGIN_NOTE_MIN_GAP_PX = 150;
2
- const COMMENT_INPUT_HEIGHT_PX = 160;
3
-
4
- interface NotePosition {
5
- commentId: string;
6
- top: number;
7
- }
8
-
9
- export function resolveMarginNotePositions(
10
- commentIds: string[],
11
- highlightPositions: Record<string, number>,
12
- pendingSelectionTop: number | undefined,
13
- ): Map<string, number> {
14
- const positions: NotePosition[] = commentIds
15
- .filter((id) => id in highlightPositions)
16
- .map((id) => ({
17
- commentId: id,
18
- top: highlightPositions[id],
19
- }));
20
-
21
- positions.sort((a, b) => a.top - b.top);
22
-
23
- if (pendingSelectionTop !== null && pendingSelectionTop !== undefined) {
24
- const inputStart = pendingSelectionTop;
25
- const inputEnd = pendingSelectionTop + COMMENT_INPUT_HEIGHT_PX;
26
-
27
- for (const pos of positions) {
28
- const noteBottom = pos.top + MARGIN_NOTE_MIN_GAP_PX;
29
-
30
- const overlaps = noteBottom > inputStart && pos.top < inputEnd;
31
-
32
- if (overlaps) {
33
- if (pos.top < inputStart) {
34
- pos.top = Math.max(0, inputStart - MARGIN_NOTE_MIN_GAP_PX);
35
- } else {
36
- pos.top = inputEnd;
37
- }
38
- }
39
- }
40
- positions.sort((a, b) => a.top - b.top);
41
- }
42
-
43
- const inputStartForOverlap = pendingSelectionTop ?? Infinity;
44
- const inputEndForOverlap =
45
- pendingSelectionTop != null
46
- ? pendingSelectionTop + COMMENT_INPUT_HEIGHT_PX
47
- : Infinity;
48
-
49
- for (let i = positions.length - 2; i >= 0; i--) {
50
- const curr = positions[i];
51
- const next = positions[i + 1];
52
- if (next.top >= inputStartForOverlap) continue;
53
- if (next.top - curr.top < MARGIN_NOTE_MIN_GAP_PX) {
54
- curr.top = Math.max(0, next.top - MARGIN_NOTE_MIN_GAP_PX);
55
- }
56
- }
57
-
58
- for (let i = 1; i < positions.length; i++) {
59
- const prev = positions[i - 1];
60
- const curr = positions[i];
61
- if (curr.top - prev.top < MARGIN_NOTE_MIN_GAP_PX) {
62
- let newTop = prev.top + MARGIN_NOTE_MIN_GAP_PX;
63
- if (newTop >= inputStartForOverlap && newTop < inputEndForOverlap) {
64
- newTop = inputEndForOverlap;
65
- }
66
- curr.top = newTop;
67
- }
68
- }
69
-
70
- return new Map(positions.map((p) => [p.commentId, p.top]));
71
- }
@@ -1,154 +0,0 @@
1
- import { JSDOM } from "jsdom";
2
- import { describe, expect, it } from "vitest";
3
- import { renderMarkdown } from "./markdown-renderer";
4
-
5
- const SAMPLE_MARKDOWN = `# Hello World
6
-
7
- This is a paragraph with **bold** and *italic* text.
8
-
9
- ## Code Example
10
-
11
- \`\`\`typescript
12
- function hello() {
13
- return "world";
14
- }
15
- \`\`\`
16
-
17
- Some text after the code block.
18
-
19
- - Item 1
20
- - Item 2
21
- - Item 3
22
-
23
- ### Table
24
-
25
- | Name | Value |
26
- |------|-------|
27
- | foo | bar |
28
- | baz | qux |
29
-
30
- > A blockquote with some text.
31
-
32
- Final paragraph.
33
- `;
34
-
35
- const SAMPLE_WITH_MERMAID = `# Diagrams
36
-
37
- \`\`\`mermaid
38
- graph TD
39
- A --> B
40
- \`\`\`
41
-
42
- After mermaid.
43
- `;
44
-
45
- describe("renderMarkdown", () => {
46
- it("renders basic markdown to HTML", async () => {
47
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
48
-
49
- expect(html).toContain("<h1");
50
- expect(html).toContain("Hello World");
51
- expect(html).toContain("<strong>bold</strong>");
52
- expect(html).toContain("<em>italic</em>");
53
- expect(html).toContain("<h2");
54
- expect(html).toContain("Code Example");
55
- expect(html).toContain("<h3");
56
- expect(html).toContain("Table");
57
- });
58
-
59
- it("extracts headings with correct IDs", async () => {
60
- const { headings } = await renderMarkdown(SAMPLE_MARKDOWN);
61
-
62
- expect(headings).toEqual([
63
- { id: "hello-world", text: "Hello World", level: 1 },
64
- { id: "code-example", text: "Code Example", level: 2 },
65
- { id: "table", text: "Table", level: 3 },
66
- ]);
67
- });
68
-
69
- it("injects heading IDs into HTML", async () => {
70
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
71
-
72
- expect(html).toContain('id="hello-world"');
73
- expect(html).toContain('id="code-example"');
74
- expect(html).toContain('id="table"');
75
- });
76
-
77
- it("syntax-highlights code blocks with shiki", async () => {
78
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
79
-
80
- expect(html).toContain("shiki");
81
- expect(html).toContain("hello");
82
- expect(html).toContain("world");
83
- });
84
-
85
- it("leaves mermaid blocks for client-side hydration", async () => {
86
- const { html } = await renderMarkdown(SAMPLE_WITH_MERMAID);
87
-
88
- expect(html).toContain('class="language-mermaid"');
89
- expect(html).toContain("graph TD");
90
- expect(html).not.toMatch(/class="shiki[^"]*"[^>]*>.*graph TD/s);
91
- });
92
-
93
- it("renders GFM tables", async () => {
94
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
95
-
96
- expect(html).toContain("<table>");
97
- expect(html).toContain("<th>");
98
- expect(html).toContain("foo");
99
- });
100
-
101
- it("renders lists", async () => {
102
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
103
-
104
- expect(html).toContain("<ul>");
105
- expect(html).toContain("<li>");
106
- expect(html).toContain("Item 1");
107
- });
108
-
109
- it("renders blockquotes", async () => {
110
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
111
-
112
- expect(html).toContain("<blockquote>");
113
- expect(html).toContain("A blockquote with some text.");
114
- });
115
-
116
- it("handles duplicate headings", async () => {
117
- const md = `## Section\n\n## Section\n\n## Section\n`;
118
- const { headings } = await renderMarkdown(md);
119
-
120
- expect(headings).toEqual([
121
- { id: "section", text: "Section", level: 2 },
122
- { id: "section-1", text: "Section", level: 2 },
123
- { id: "section-2", text: "Section", level: 2 },
124
- ]);
125
- });
126
- });
127
-
128
- describe("text offset conformance", () => {
129
- it("rendered HTML has proper block structure for text offset extraction", async () => {
130
- const { html } = await renderMarkdown(SAMPLE_MARKDOWN);
131
-
132
- const dom = new JSDOM(html);
133
- const doc = dom.window.document;
134
-
135
- const paragraphs = doc.querySelectorAll("p");
136
- expect(paragraphs.length).toBeGreaterThan(0);
137
-
138
- const h1 = doc.querySelector("h1");
139
- expect(h1?.id).toBe("hello-world");
140
- expect(h1?.textContent).toBe("Hello World");
141
-
142
- const pres = doc.querySelectorAll("pre");
143
- expect(pres.length).toBeGreaterThan(0);
144
-
145
- const lis = doc.querySelectorAll("li");
146
- expect(lis.length).toBe(3);
147
-
148
- const trs = doc.querySelectorAll("tr");
149
- expect(trs.length).toBeGreaterThan(0);
150
-
151
- const blockquote = doc.querySelector("blockquote");
152
- expect(blockquote).not.toBeNull();
153
- });
154
- });
@@ -1,177 +0,0 @@
1
- import MarkdownIt from "markdown-it";
2
- import type { BundledLanguage, BundledTheme, HighlighterGeneric } from "shiki";
3
- import { type Heading, parseMarkdownHeadings } from "./headings";
4
- import { renderMermaidBlocks } from "./mermaid-renderer";
5
-
6
- const SHIKI_LANGUAGES: BundledLanguage[] = [
7
- "bash",
8
- "css",
9
- "diff",
10
- "go",
11
- "graphql",
12
- "javascript",
13
- "json",
14
- "jsx",
15
- "markdown",
16
- "python",
17
- "rust",
18
- "sql",
19
- "tsx",
20
- "typescript",
21
- "yaml",
22
- ];
23
-
24
- const SHIKI_THEME: BundledTheme = "one-dark-pro";
25
-
26
- let shikiInstance: HighlighterGeneric<BundledLanguage, BundledTheme> | null =
27
- null;
28
- let shikiPromise: Promise<
29
- HighlighterGeneric<BundledLanguage, BundledTheme>
30
- > | null = null;
31
-
32
- export async function getShiki(): Promise<
33
- HighlighterGeneric<BundledLanguage, BundledTheme>
34
- > {
35
- if (shikiInstance) return shikiInstance;
36
- if (shikiPromise) return shikiPromise;
37
-
38
- shikiPromise = import("shiki").then(async ({ createHighlighter }) => {
39
- const highlighter = await createHighlighter({
40
- themes: [SHIKI_THEME],
41
- langs: SHIKI_LANGUAGES,
42
- });
43
- shikiInstance = highlighter;
44
- return highlighter;
45
- });
46
-
47
- return shikiPromise;
48
- }
49
-
50
- function createMarkdownRenderer(
51
- shiki: HighlighterGeneric<BundledLanguage, BundledTheme>,
52
- ): MarkdownIt {
53
- const md = new MarkdownIt({
54
- html: true, // Allow raw HTML (matches rehype-raw behavior)
55
- linkify: true,
56
- typographer: false,
57
- highlight(code: string, lang: string): string {
58
- if (lang === "mermaid") {
59
- return `<pre><code class="language-mermaid">${md.utils.escapeHtml(code)}</code></pre>`;
60
- }
61
-
62
- const language = normalizeLanguage(lang);
63
-
64
- if (language && shiki.getLoadedLanguages().includes(language)) {
65
- return shiki.codeToHtml(code, {
66
- lang: language,
67
- theme: SHIKI_THEME,
68
- });
69
- }
70
-
71
- return `<pre class="shiki"><code>${md.utils.escapeHtml(code)}</code></pre>`;
72
- },
73
- });
74
-
75
- return md;
76
- }
77
-
78
- function normalizeLanguage(lang: string): BundledLanguage | undefined {
79
- const aliases: Record<string, BundledLanguage> = {
80
- sh: "bash",
81
- shell: "bash",
82
- js: "javascript",
83
- ts: "typescript",
84
- py: "python",
85
- rs: "rust",
86
- yml: "yaml",
87
- md: "markdown",
88
- };
89
- const normalized = lang.toLowerCase().trim();
90
- if (SHIKI_LANGUAGES.includes(normalized as BundledLanguage)) {
91
- return normalized as BundledLanguage;
92
- }
93
- return aliases[normalized];
94
- }
95
-
96
- function injectHeadingIds(html: string, headings: Heading[]): string {
97
- let headingIdx = 0;
98
-
99
- return html.replace(
100
- /<(h[1-6])([^>]*)>([\s\S]*?)<\/\1>/gi,
101
- (match, tag: string, attrs: string, content: string) => {
102
- if (headingIdx >= headings.length) return match;
103
-
104
- const heading = headings[headingIdx];
105
- headingIdx++;
106
-
107
- if (/\bid\s*=/.test(attrs)) return match;
108
-
109
- return `<${tag} id="${heading.id}"${attrs}>${content}</${tag}>`;
110
- },
111
- );
112
- }
113
-
114
- interface RenderResult {
115
- html: string;
116
- headings: Heading[];
117
- }
118
-
119
- const MERMAID_BLOCK_RE =
120
- /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/g;
121
-
122
- function unescapeHtml(str: string): string {
123
- return str
124
- .replace(/&amp;/g, "&")
125
- .replace(/&lt;/g, "<")
126
- .replace(/&gt;/g, ">")
127
- .replace(/&quot;/g, '"');
128
- }
129
-
130
- async function replaceMermaidBlocks(html: string): Promise<string> {
131
- MERMAID_BLOCK_RE.lastIndex = 0;
132
- const matches: { fullMatch: string; code: string; index: number }[] = [];
133
-
134
- let match: RegExpExecArray | null = MERMAID_BLOCK_RE.exec(html);
135
- while (match !== null) {
136
- matches.push({
137
- fullMatch: match[0],
138
- code: unescapeHtml(match[1]),
139
- index: match.index,
140
- });
141
- match = MERMAID_BLOCK_RE.exec(html);
142
- }
143
-
144
- if (matches.length === 0) return html;
145
-
146
- const codes = matches.map((m) => m.code);
147
- const svgs = await renderMermaidBlocks(codes);
148
-
149
- // Replace in reverse order to preserve string indices
150
- for (let i = matches.length - 1; i >= 0; i--) {
151
- const svg = svgs[i];
152
- if (svg !== null) {
153
- const { fullMatch, index } = matches[i];
154
- const replacement = `<div class="mermaid-container">${svg}</div>`;
155
- html =
156
- html.slice(0, index) +
157
- replacement +
158
- html.slice(index + fullMatch.length);
159
- }
160
- }
161
-
162
- return html;
163
- }
164
-
165
- export async function renderMarkdown(content: string): Promise<RenderResult> {
166
- const shiki = await getShiki();
167
- const md = createMarkdownRenderer(shiki);
168
-
169
- const headings = parseMarkdownHeadings(content);
170
-
171
- let html = md.render(content);
172
-
173
- html = injectHeadingIds(html, headings);
174
- html = await replaceMermaidBlocks(html);
175
-
176
- return { html, headings };
177
- }
@@ -1,38 +0,0 @@
1
- export const MERMAID_THEME = {
2
- fontSize: "16px",
3
- primaryColor: "rgba(245, 222, 160, 0.8)",
4
- primaryTextColor: "#3f3f46",
5
- primaryBorderColor: "#c9a84a",
6
- secondaryColor: "rgba(168, 196, 228, 0.6)",
7
- secondaryTextColor: "#3f3f46",
8
- secondaryBorderColor: "#5b7fa8",
9
- tertiaryColor: "rgba(170, 210, 170, 0.6)",
10
- tertiaryTextColor: "#3f3f46",
11
- tertiaryBorderColor: "#5a9a62",
12
- background: "#ffffff",
13
- mainBkg: "#ffffff",
14
- textColor: "#3f3f46",
15
- lineColor: "#a1a1aa",
16
- nodeBkg: "rgba(245, 222, 160, 0.6)",
17
- nodeBorder: "#c9a84a",
18
- clusterBkg: "rgba(250, 250, 250, 0.8)",
19
- clusterBorder: "#e4e4e7",
20
- actorBkg: "rgba(168, 196, 228, 0.5)",
21
- actorBorder: "#5b7fa8",
22
- actorTextColor: "#3f3f46",
23
- signalColor: "#3f3f46",
24
- signalTextColor: "#3f3f46",
25
- noteBkgColor: "rgba(245, 222, 160, 0.5)",
26
- noteBorderColor: "#c9a84a",
27
- noteTextColor: "#3f3f46",
28
- } as const;
29
-
30
- export function getMermaidInitConfig() {
31
- return {
32
- startOnLoad: false,
33
- theme: "base" as const,
34
- securityLevel: "strict" as const,
35
- fontFamily: "system-ui, -apple-system, sans-serif",
36
- themeVariables: MERMAID_THEME,
37
- };
38
- }