@peaske7/readit 0.3.0-rc.0 → 0.3.0-rc.2

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 (374) hide show
  1. package/README.md +3 -3
  2. package/dist/.vite/manifest.json +1111 -0
  3. package/dist/assets/_basePickBy-BMMA4Tou.js +1 -0
  4. package/dist/assets/_baseUniq-D40qku1I.js +1 -0
  5. package/dist/assets/arc-Ckg65iy8.js +1 -0
  6. package/dist/assets/architecture-YZFGNWBL-Dv3EY0zV.js +1 -0
  7. package/dist/assets/architectureDiagram-Q4EWVU46-DQnkwSaB.js +36 -0
  8. package/dist/assets/array-Bjz-wYpJ.js +1 -0
  9. package/dist/assets/blockDiagram-DXYQGD6D-UB6_S1lm.js +132 -0
  10. package/dist/assets/c4Diagram-AHTNJAMY-sn3k2GND.js +10 -0
  11. package/dist/assets/channel-D9wPw2fQ.js +1 -0
  12. package/dist/assets/chunk-2KRD3SAO-DaFfaCGO.js +1 -0
  13. package/dist/assets/chunk-336JU56O-C8siO5Of.js +2 -0
  14. package/dist/assets/chunk-426QAEUC-BB478m3j.js +1 -0
  15. package/dist/assets/chunk-4BX2VUAB-DRuTD7x5.js +1 -0
  16. package/dist/assets/chunk-4TB4RGXK-_l6jvVAY.js +206 -0
  17. package/dist/assets/chunk-55IACEB6-BExiaAoD.js +1 -0
  18. package/dist/assets/chunk-5FUZZQ4R-HOSFTxuG.js +62 -0
  19. package/dist/assets/chunk-5PVQY5BW-BRVNNRAX.js +2 -0
  20. package/dist/assets/chunk-67CJDMHE-DMt8LNEX.js +1 -0
  21. package/dist/assets/chunk-7N4EOEYR-CzLGefVf.js +1 -0
  22. package/dist/assets/chunk-AA7GKIK3-B6GFAk4U.js +1 -0
  23. package/dist/assets/chunk-BSJP7CBP-BK29yehL.js +1 -0
  24. package/dist/assets/chunk-CIAEETIT-D7hBXImP.js +1 -0
  25. package/dist/assets/chunk-Dlc7tRH4.js +1 -0
  26. package/dist/assets/chunk-EDXVE4YY-CSvKh9DT.js +1 -0
  27. package/dist/assets/chunk-ENJZ2VHE-QApb5cYr.js +10 -0
  28. package/dist/assets/chunk-FMBD7UC4-2FWyCCAV.js +15 -0
  29. package/dist/assets/chunk-FOC6F5B3-DKFHrt4K.js +1 -0
  30. package/dist/assets/chunk-ICPOFSXX-agBjBxsW.js +122 -0
  31. package/dist/assets/chunk-K5T4RW27-D51O7IkG.js +94 -0
  32. package/dist/assets/chunk-KGLVRYIC-DMHSCH4T.js +1 -0
  33. package/dist/assets/chunk-LIHQZDEY-C2aANxt9.js +1 -0
  34. package/dist/assets/chunk-ORNJ4GCN-Db_37NRX.js +1 -0
  35. package/dist/assets/chunk-OYMX7WX6-HGUtT2Q9.js +231 -0
  36. package/dist/assets/chunk-QZHKN3VN-8Lcg9gti.js +1 -0
  37. package/dist/assets/chunk-U2HBQHQK-BFYYQeuC.js +70 -0
  38. package/dist/assets/chunk-X2U36JSP-p8ehTP6s.js +1 -0
  39. package/dist/assets/chunk-XPW4576I-Bqbompq4.js +32 -0
  40. package/dist/assets/chunk-YZCP3GAM-HIMez9pG.js +1 -0
  41. package/dist/assets/chunk-ZZ45TVLE-DRIE_0bu.js +1 -0
  42. package/dist/assets/classDiagram-6PBFFD2Q-BawhEeUl.js +1 -0
  43. package/dist/assets/classDiagram-v2-HSJHXN6E-CLNjgH9n.js +1 -0
  44. package/dist/assets/clone-BBjvuERA.js +1 -0
  45. package/dist/assets/cose-bilkent-S5V4N54A-q90QeGKv.js +1 -0
  46. package/dist/assets/cytoscape.esm-BfXff3fb.js +321 -0
  47. package/dist/assets/dagre-Dxbob2Lr.js +1 -0
  48. package/dist/assets/dagre-KV5264BT-BuvpNxMw.js +4 -0
  49. package/dist/assets/defaultLocale-BwmRmqJp.js +1 -0
  50. package/dist/assets/diagram-5BDNPKRD-DQLsxwwt.js +10 -0
  51. package/dist/assets/diagram-G4DWMVQ6-Jv9Eefw4.js +24 -0
  52. package/dist/assets/diagram-MMDJMWI5-D-0YgNhU.js +43 -0
  53. package/dist/assets/diagram-TYMM5635-BHwO7zQG.js +24 -0
  54. package/dist/assets/dist-BNz65Ibc.js +1 -0
  55. package/dist/assets/erDiagram-SMLLAGMA-BjZGGBJz.js +85 -0
  56. package/dist/assets/flowDiagram-DWJPFMVM-CFbFUm_m.js +162 -0
  57. package/dist/assets/ganttDiagram-T4ZO3ILL-CXk4TcBi.js +292 -0
  58. package/dist/assets/gitGraph-7Q5UKJZL-BGFRt2qs.js +1 -0
  59. package/dist/assets/gitGraphDiagram-UUTBAWPF-C8yZOxjo.js +106 -0
  60. package/dist/assets/graphlib-DGcD9J2L.js +1 -0
  61. package/dist/assets/index-D-m0LiFI.js +14 -0
  62. package/dist/assets/index-DANHO6J0.css +2 -0
  63. package/dist/assets/info-OMHHGYJF-DI6-Z9vh.js +1 -0
  64. package/dist/assets/infoDiagram-42DDH7IO-p-PXDra2.js +2 -0
  65. package/dist/assets/init-TPm5RB77.js +1 -0
  66. package/dist/assets/isArrayLikeObject-69BLnVNM.js +1 -0
  67. package/dist/assets/isEmpty-DUS28g5f.js +1 -0
  68. package/dist/assets/ishikawaDiagram-UXIWVN3A-BrIoEvtb.js +70 -0
  69. package/dist/assets/journeyDiagram-VCZTEJTY-aZpvKa9g.js +139 -0
  70. package/dist/assets/kanban-definition-6JOO6SKY-CoOAY9ji.js +89 -0
  71. package/dist/assets/katex-5SGEXwpi.js +261 -0
  72. package/dist/assets/line-4MF1lR4d.js +1 -0
  73. package/dist/assets/linear-CXMqTN8N.js +1 -0
  74. package/dist/assets/mermaid-config-C8a4L22x.js +1 -0
  75. package/dist/assets/mermaid-parser.core-DREsY2u4.js +4 -0
  76. package/dist/assets/mermaid.core-8ysLpTJi.js +11 -0
  77. package/dist/assets/mindmap-definition-QFDTVHPH-CsqUJCMn.js +96 -0
  78. package/dist/assets/ordinal-D7l-8DAO.js +1 -0
  79. package/dist/assets/packet-4T2RLAQJ-DidW3JFc.js +1 -0
  80. package/dist/assets/path-BVpCanzE.js +1 -0
  81. package/dist/assets/pie-ZZUOXDRM-Bff2e5hg.js +1 -0
  82. package/dist/assets/pieDiagram-DEJITSTG-k0Br4NDS.js +30 -0
  83. package/dist/assets/quadrantDiagram-34T5L4WZ-Be9oCSza.js +7 -0
  84. package/dist/assets/radar-PYXPWWZC-CsdZBH3M.js +1 -0
  85. package/dist/assets/requirementDiagram-MS252O5E-8ECT7dEs.js +84 -0
  86. package/dist/assets/rough.esm-BoTisKeL.js +1 -0
  87. package/dist/assets/sankeyDiagram-XADWPNL6-CoKpeJJ0.js +10 -0
  88. package/dist/assets/sequenceDiagram-FGHM5R23-BTT2fFxG.js +157 -0
  89. package/dist/assets/src-CrmkjRpa.js +1 -0
  90. package/dist/assets/stateDiagram-FHFEXIEX-CIF47NYe.js +1 -0
  91. package/dist/assets/stateDiagram-v2-QKLJ7IA2-Cy1rmPfG.js +1 -0
  92. package/dist/assets/timeline-definition-GMOUNBTQ-Bes4B58n.js +120 -0
  93. package/dist/assets/treeView-SZITEDCU-DPKseaET.js +1 -0
  94. package/dist/assets/treemap-W4RFUUIX-DH-7GZe_.js +1 -0
  95. package/dist/assets/vennDiagram-DHZGUBPP-3wx2huKk.js +34 -0
  96. package/dist/assets/wardley-RL74JXVD-AgyXyBN5.js +1 -0
  97. package/dist/assets/wardleyDiagram-NUSXRM2D-DzViT1Yx.js +20 -0
  98. package/dist/assets/xychartDiagram-5P7HB3ND-BO_dbU0r.js +7 -0
  99. package/{index.html → dist/index.html} +2 -1
  100. package/dist/index.js +2625 -0
  101. package/package.json +11 -1
  102. package/.agents/skills/remotion-best-practices/SKILL.md +0 -61
  103. package/.agents/skills/remotion-best-practices/rules/3d.md +0 -86
  104. package/.agents/skills/remotion-best-practices/rules/animations.md +0 -27
  105. package/.agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +0 -178
  106. package/.agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +0 -100
  107. package/.agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +0 -108
  108. package/.agents/skills/remotion-best-practices/rules/assets.md +0 -78
  109. package/.agents/skills/remotion-best-practices/rules/audio-visualization.md +0 -198
  110. package/.agents/skills/remotion-best-practices/rules/audio.md +0 -169
  111. package/.agents/skills/remotion-best-practices/rules/calculate-metadata.md +0 -134
  112. package/.agents/skills/remotion-best-practices/rules/can-decode.md +0 -75
  113. package/.agents/skills/remotion-best-practices/rules/charts.md +0 -120
  114. package/.agents/skills/remotion-best-practices/rules/compositions.md +0 -154
  115. package/.agents/skills/remotion-best-practices/rules/display-captions.md +0 -184
  116. package/.agents/skills/remotion-best-practices/rules/extract-frames.md +0 -229
  117. package/.agents/skills/remotion-best-practices/rules/ffmpeg.md +0 -38
  118. package/.agents/skills/remotion-best-practices/rules/fonts.md +0 -152
  119. package/.agents/skills/remotion-best-practices/rules/get-audio-duration.md +0 -58
  120. package/.agents/skills/remotion-best-practices/rules/get-video-dimensions.md +0 -68
  121. package/.agents/skills/remotion-best-practices/rules/get-video-duration.md +0 -60
  122. package/.agents/skills/remotion-best-practices/rules/gifs.md +0 -141
  123. package/.agents/skills/remotion-best-practices/rules/images.md +0 -134
  124. package/.agents/skills/remotion-best-practices/rules/import-srt-captions.md +0 -69
  125. package/.agents/skills/remotion-best-practices/rules/light-leaks.md +0 -73
  126. package/.agents/skills/remotion-best-practices/rules/lottie.md +0 -70
  127. package/.agents/skills/remotion-best-practices/rules/maps.md +0 -412
  128. package/.agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md +0 -34
  129. package/.agents/skills/remotion-best-practices/rules/measuring-text.md +0 -140
  130. package/.agents/skills/remotion-best-practices/rules/parameters.md +0 -109
  131. package/.agents/skills/remotion-best-practices/rules/sequencing.md +0 -118
  132. package/.agents/skills/remotion-best-practices/rules/sfx.md +0 -26
  133. package/.agents/skills/remotion-best-practices/rules/subtitles.md +0 -36
  134. package/.agents/skills/remotion-best-practices/rules/tailwind.md +0 -11
  135. package/.agents/skills/remotion-best-practices/rules/text-animations.md +0 -20
  136. package/.agents/skills/remotion-best-practices/rules/timing.md +0 -179
  137. package/.agents/skills/remotion-best-practices/rules/transcribe-captions.md +0 -70
  138. package/.agents/skills/remotion-best-practices/rules/transitions.md +0 -197
  139. package/.agents/skills/remotion-best-practices/rules/transparent-videos.md +0 -106
  140. package/.agents/skills/remotion-best-practices/rules/trimming.md +0 -51
  141. package/.agents/skills/remotion-best-practices/rules/videos.md +0 -171
  142. package/.agents/skills/remotion-best-practices/rules/voiceover.md +0 -99
  143. package/.agents/skills/simple/SKILL.md +0 -52
  144. package/.agents/skills/vercel-react-best-practices/AGENTS.md +0 -3254
  145. package/.agents/skills/vercel-react-best-practices/README.md +0 -123
  146. package/.agents/skills/vercel-react-best-practices/SKILL.md +0 -141
  147. package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  148. package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
  149. package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
  150. package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  151. package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
  152. package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
  153. package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
  154. package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  155. package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
  156. package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  157. package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  158. package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  159. package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  160. package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  161. package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  162. package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  163. package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  164. package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
  165. package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  166. package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  167. package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  168. package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  169. package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  170. package/.agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
  171. package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  172. package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  173. package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  174. package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  175. package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  176. package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  177. package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  178. package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  179. package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  180. package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  181. package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  182. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  183. package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
  184. package/.agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
  185. package/.agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
  186. package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  187. package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
  188. package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  189. package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  190. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
  191. package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  192. package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  193. package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  194. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
  195. package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  196. package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
  197. package/.agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
  198. package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
  199. package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  200. package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
  201. package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  202. package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
  203. package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  204. package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  205. package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
  206. package/.agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
  207. package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  208. package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
  209. package/.claude/CLAUDE.md +0 -184
  210. package/.claude/commands/review.md +0 -120
  211. package/.claude/commands/sync-docs.md +0 -71
  212. package/.claude/roadmap.md +0 -121
  213. package/.claude/rules/style-guide.md +0 -830
  214. package/.claude/settings.json +0 -18
  215. package/.claude/user-stories.md +0 -333
  216. package/AGENTS.md +0 -68
  217. package/Makefile +0 -32
  218. package/biome.json +0 -79
  219. package/bun.lock +0 -854
  220. package/bunfig.toml +0 -2
  221. package/docs/design.md +0 -563
  222. package/docs/perf-baseline.md +0 -130
  223. package/docs/plans/2026-03-13-client-mode-design.md +0 -86
  224. package/docs/plans/2026-03-13-client-mode-plan.md +0 -605
  225. package/docs/plans/2026-03-13-keyboard-shortcuts-design.md +0 -129
  226. package/docs/plans/2026-03-13-keyboard-shortcuts-plan.md +0 -1471
  227. package/docs/plans/2026-03-13-multi-document-design.md +0 -183
  228. package/docs/plans/2026-03-13-performance-benchmarks-design.md +0 -121
  229. package/docs/superpowers/plans/2026-03-26-surgical-pruning.md +0 -1176
  230. package/docs/superpowers/specs/2026-03-27-go-server-rewrite-design.md +0 -284
  231. package/e2e/comments.spec.ts +0 -81
  232. package/e2e/document-load.spec.ts +0 -32
  233. package/e2e/export.spec.ts +0 -58
  234. package/e2e/fixtures/sample.md +0 -7
  235. package/e2e/perf/add-comment.spec.ts +0 -116
  236. package/e2e/perf/fixtures/generate.ts +0 -327
  237. package/e2e/perf/initial-load.spec.ts +0 -49
  238. package/e2e/perf/perf.setup.ts +0 -23
  239. package/e2e/perf/perf.teardown.ts +0 -9
  240. package/e2e/perf/screenshot-final.png +0 -0
  241. package/e2e/perf/scroll.spec.ts +0 -39
  242. package/e2e/perf/tab-switch.spec.ts +0 -69
  243. package/e2e/perf/text-selection.spec.ts +0 -119
  244. package/e2e/perf/utils/metrics.ts +0 -350
  245. package/e2e/perf/utils/perf-cli.ts +0 -86
  246. package/e2e/persistence-file.spec.ts +0 -357
  247. package/e2e/utils/cli.ts +0 -84
  248. package/e2e/utils/selection.ts +0 -79
  249. package/go/cmd/readit/main.go +0 -416
  250. package/go/go.mod +0 -20
  251. package/go/go.sum +0 -41
  252. package/go/internal/server/anchor.go +0 -302
  253. package/go/internal/server/anchor_test.go +0 -111
  254. package/go/internal/server/comments.go +0 -390
  255. package/go/internal/server/documents.go +0 -113
  256. package/go/internal/server/embed.go +0 -17
  257. package/go/internal/server/headings.go +0 -33
  258. package/go/internal/server/headings_test.go +0 -75
  259. package/go/internal/server/htmltext.go +0 -123
  260. package/go/internal/server/markdown.go +0 -157
  261. package/go/internal/server/markdown_bench_test.go +0 -42
  262. package/go/internal/server/markdown_test.go +0 -79
  263. package/go/internal/server/server.go +0 -453
  264. package/go/internal/server/server_bench_test.go +0 -122
  265. package/go/internal/server/settings.go +0 -110
  266. package/go/internal/server/sse.go +0 -140
  267. package/go/internal/server/storage.go +0 -275
  268. package/go/internal/server/storage_test.go +0 -152
  269. package/go/internal/server/template.go +0 -66
  270. package/go/internal/server/types.go +0 -101
  271. package/go/internal/server/watcher.go +0 -74
  272. package/lefthook.yml +0 -8
  273. package/nvim-readit/lua/readit/health.lua +0 -64
  274. package/nvim-readit/lua/readit/init.lua +0 -463
  275. package/nvim-readit/plugin/readit.lua +0 -19
  276. package/playwright.config.ts +0 -34
  277. package/skills-lock.json +0 -20
  278. package/src/App.svelte +0 -890
  279. package/src/cli.ts +0 -881
  280. package/src/components/ActionsMenu.svelte +0 -95
  281. package/src/components/CommentBadge.svelte +0 -67
  282. package/src/components/CommentErrorBanner.svelte +0 -33
  283. package/src/components/CommentInput.svelte +0 -75
  284. package/src/components/CommentListItem.svelte +0 -95
  285. package/src/components/CommentManager.svelte +0 -129
  286. package/src/components/CommentNav.svelte +0 -109
  287. package/src/components/DocumentViewer.svelte +0 -233
  288. package/src/components/FloatingComment.svelte +0 -107
  289. package/src/components/Header.svelte +0 -76
  290. package/src/components/InlineEditor.svelte +0 -72
  291. package/src/components/MarginNote.svelte +0 -167
  292. package/src/components/MarginNotesContainer.svelte +0 -33
  293. package/src/components/MermaidEnhancer.svelte +0 -218
  294. package/src/components/MermaidModal.svelte +0 -67
  295. package/src/components/RawModal.svelte +0 -126
  296. package/src/components/ReanchorConfirm.svelte +0 -30
  297. package/src/components/SettingsModal.svelte +0 -220
  298. package/src/components/ShortcutCapture.svelte +0 -82
  299. package/src/components/ShortcutList.svelte +0 -145
  300. package/src/components/TabBar.svelte +0 -52
  301. package/src/components/TableOfContents.svelte +0 -125
  302. package/src/components/ui/ActionLink.svelte +0 -40
  303. package/src/components/ui/Button.svelte +0 -53
  304. package/src/components/ui/Dialog.svelte +0 -97
  305. package/src/components/ui/DropdownMenu.svelte +0 -85
  306. package/src/components/ui/DropdownMenuItem.svelte +0 -38
  307. package/src/components/ui/DropdownMenuSeparator.svelte +0 -11
  308. package/src/components/ui/Text.svelte +0 -42
  309. package/src/env.d.ts +0 -6
  310. package/src/index.css +0 -859
  311. package/src/lib/__fixtures__/bench-data.ts +0 -114
  312. package/src/lib/anchor.bench.ts +0 -91
  313. package/src/lib/anchor.test.ts +0 -527
  314. package/src/lib/anchor.ts +0 -381
  315. package/src/lib/comment-storage.bench.ts +0 -49
  316. package/src/lib/comment-storage.test.ts +0 -694
  317. package/src/lib/comment-storage.ts +0 -226
  318. package/src/lib/export.bench.ts +0 -21
  319. package/src/lib/export.ts +0 -36
  320. package/src/lib/fetch-or-throw.test.ts +0 -59
  321. package/src/lib/fetch-or-throw.ts +0 -12
  322. package/src/lib/headings.test.ts +0 -103
  323. package/src/lib/headings.ts +0 -44
  324. package/src/lib/highlight/core.test.ts +0 -93
  325. package/src/lib/highlight/dom.ts +0 -187
  326. package/src/lib/highlight/highlight-registry.ts +0 -221
  327. package/src/lib/highlight/highlight.bench.ts +0 -92
  328. package/src/lib/highlight/highlighter.ts +0 -247
  329. package/src/lib/highlight/resolver.ts +0 -38
  330. package/src/lib/highlight/types.ts +0 -17
  331. package/src/lib/html-text.test.ts +0 -162
  332. package/src/lib/html-text.ts +0 -161
  333. package/src/lib/i18n/en.ts +0 -124
  334. package/src/lib/i18n/index.ts +0 -3
  335. package/src/lib/i18n/ja.ts +0 -126
  336. package/src/lib/i18n/translations.ts +0 -27
  337. package/src/lib/i18n/types.ts +0 -130
  338. package/src/lib/key-lock.test.ts +0 -104
  339. package/src/lib/key-lock.ts +0 -23
  340. package/src/lib/margin-layout.bench.ts +0 -61
  341. package/src/lib/margin-layout.ts +0 -71
  342. package/src/lib/markdown-renderer.test.ts +0 -154
  343. package/src/lib/markdown-renderer.ts +0 -178
  344. package/src/lib/mermaid-config.ts +0 -38
  345. package/src/lib/mermaid-renderer.ts +0 -162
  346. package/src/lib/mermaid-worker.ts +0 -60
  347. package/src/lib/positions.ts +0 -157
  348. package/src/lib/shortcut-registry.ts +0 -244
  349. package/src/lib/utils.ts +0 -15
  350. package/src/main.ts +0 -16
  351. package/src/schema.ts +0 -92
  352. package/src/server.ts +0 -1216
  353. package/src/stores/app.svelte.ts +0 -231
  354. package/src/stores/locale.svelte.ts +0 -46
  355. package/src/stores/settings.svelte.ts +0 -90
  356. package/src/stores/shortcuts.svelte.ts +0 -104
  357. package/src/stores/ui.svelte.ts +0 -12
  358. package/src/template.ts +0 -104
  359. package/src/test-setup.ts +0 -48
  360. package/svelte.config.js +0 -5
  361. package/test.md +0 -74
  362. package/tsconfig.cli.json +0 -12
  363. package/tsconfig.json +0 -20
  364. package/vite.config.ts +0 -47
  365. package/vitest.config.ts +0 -15
  366. package/vscode-readit/.mcp.json +0 -7
  367. package/vscode-readit/.vscodeignore +0 -7
  368. package/vscode-readit/bun.lock +0 -78
  369. package/vscode-readit/icon.svg +0 -10
  370. package/vscode-readit/package.json +0 -110
  371. package/vscode-readit/src/extension.ts +0 -117
  372. package/vscode-readit/src/server-manager.ts +0 -272
  373. package/vscode-readit/src/webview-provider.ts +0 -204
  374. package/vscode-readit/tsconfig.json +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peaske7/readit",
3
- "version": "0.3.0-rc.0",
3
+ "version": "0.3.0-rc.2",
4
4
  "description": "A CLI tool to review Markdown documents with inline comments",
5
5
  "author": "Jay Shimada <peaske@pm.me>",
6
6
  "license": "MIT",
@@ -13,6 +13,16 @@
13
13
  ],
14
14
  "type": "module",
15
15
  "main": "./dist/index.js",
16
+ "bin": {
17
+ "readit": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "shell"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
16
26
  "scripts": {
17
27
  "dev": "NODE_ENV=development bun --watch src/cli.ts --",
18
28
  "dev:client": "bunx vite",
@@ -1,61 +0,0 @@
1
- ---
2
- name: remotion-best-practices
3
- description: Best practices for Remotion - Video creation in React
4
- metadata:
5
- tags: remotion, video, react, animation, composition
6
- ---
7
-
8
- ## When to use
9
-
10
- Use this skills whenever you are dealing with Remotion code to obtain the domain-specific knowledge.
11
-
12
- ## Captions
13
-
14
- When dealing with captions or subtitles, load the [./rules/subtitles.md](./rules/subtitles.md) file for more information.
15
-
16
- ## Using FFmpeg
17
-
18
- For some video operations, such as trimming videos or detecting silence, FFmpeg should be used. Load the [./rules/ffmpeg.md](./rules/ffmpeg.md) file for more information.
19
-
20
- ## Audio visualization
21
-
22
- When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the [./rules/audio-visualization.md](./rules/audio-visualization.md) file for more information.
23
-
24
- ## Sound effects
25
-
26
- When needing to use sound effects, load the [./rules/sound-effects.md](./rules/sound-effects.md) file for more information.
27
-
28
- ## How to use
29
-
30
- Read individual rule files for detailed explanations and code examples:
31
-
32
- - [rules/3d.md](rules/3d.md) - 3D content in Remotion using Three.js and React Three Fiber
33
- - [rules/animations.md](rules/animations.md) - Fundamental animation skills for Remotion
34
- - [rules/assets.md](rules/assets.md) - Importing images, videos, audio, and fonts into Remotion
35
- - [rules/audio.md](rules/audio.md) - Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
36
- - [rules/calculate-metadata.md](rules/calculate-metadata.md) - Dynamically set composition duration, dimensions, and props
37
- - [rules/can-decode.md](rules/can-decode.md) - Check if a video can be decoded by the browser using Mediabunny
38
- - [rules/charts.md](rules/charts.md) - Chart and data visualization patterns for Remotion (bar, pie, line, stock charts)
39
- - [rules/compositions.md](rules/compositions.md) - Defining compositions, stills, folders, default props and dynamic metadata
40
- - [rules/extract-frames.md](rules/extract-frames.md) - Extract frames from videos at specific timestamps using Mediabunny
41
- - [rules/fonts.md](rules/fonts.md) - Loading Google Fonts and local fonts in Remotion
42
- - [rules/get-audio-duration.md](rules/get-audio-duration.md) - Getting the duration of an audio file in seconds with Mediabunny
43
- - [rules/get-video-dimensions.md](rules/get-video-dimensions.md) - Getting the width and height of a video file with Mediabunny
44
- - [rules/get-video-duration.md](rules/get-video-duration.md) - Getting the duration of a video file in seconds with Mediabunny
45
- - [rules/gifs.md](rules/gifs.md) - Displaying GIFs synchronized with Remotion's timeline
46
- - [rules/images.md](rules/images.md) - Embedding images in Remotion using the Img component
47
- - [rules/light-leaks.md](rules/light-leaks.md) - Light leak overlay effects using @remotion/light-leaks
48
- - [rules/lottie.md](rules/lottie.md) - Embedding Lottie animations in Remotion
49
- - [rules/measuring-dom-nodes.md](rules/measuring-dom-nodes.md) - Measuring DOM element dimensions in Remotion
50
- - [rules/measuring-text.md](rules/measuring-text.md) - Measuring text dimensions, fitting text to containers, and checking overflow
51
- - [rules/sequencing.md](rules/sequencing.md) - Sequencing patterns for Remotion - delay, trim, limit duration of items
52
- - [rules/tailwind.md](rules/tailwind.md) - Using TailwindCSS in Remotion
53
- - [rules/text-animations.md](rules/text-animations.md) - Typography and text animation patterns for Remotion
54
- - [rules/timing.md](rules/timing.md) - Interpolation curves in Remotion - linear, easing, spring animations
55
- - [rules/transitions.md](rules/transitions.md) - Scene transition patterns for Remotion
56
- - [rules/transparent-videos.md](rules/transparent-videos.md) - Rendering out a video with transparency
57
- - [rules/trimming.md](rules/trimming.md) - Trimming patterns for Remotion - cut the beginning or end of animations
58
- - [rules/videos.md](rules/videos.md) - Embedding videos in Remotion - trimming, volume, speed, looping, pitch
59
- - [rules/parameters.md](rules/parameters.md) - Make a video parametrizable by adding a Zod schema
60
- - [rules/maps.md](rules/maps.md) - Add a map using Mapbox and animate it
61
- - [rules/voiceover.md](rules/voiceover.md) - Adding AI-generated voiceover to Remotion compositions using ElevenLabs TTS
@@ -1,86 +0,0 @@
1
- ---
2
- name: 3d
3
- description: 3D content in Remotion using Three.js and React Three Fiber.
4
- metadata:
5
- tags: 3d, three, threejs
6
- ---
7
-
8
- # Using Three.js and React Three Fiber in Remotion
9
-
10
- Follow React Three Fiber and Three.js best practices.
11
- Only the following Remotion-specific rules need to be followed:
12
-
13
- ## Prerequisites
14
-
15
- First, the `@remotion/three` package needs to be installed.
16
- If it is not, use the following command:
17
-
18
- ```bash
19
- npx remotion add @remotion/three # If project uses npm
20
- bunx remotion add @remotion/three # If project uses bun
21
- yarn remotion add @remotion/three # If project uses yarn
22
- pnpm exec remotion add @remotion/three # If project uses pnpm
23
- ```
24
-
25
- ## Using ThreeCanvas
26
-
27
- You MUST wrap 3D content in `<ThreeCanvas>` and include proper lighting.
28
- `<ThreeCanvas>` MUST have a `width` and `height` prop.
29
-
30
- ```tsx
31
- import { ThreeCanvas } from "@remotion/three";
32
- import { useVideoConfig } from "remotion";
33
-
34
- const { width, height } = useVideoConfig();
35
-
36
- <ThreeCanvas width={width} height={height}>
37
- <ambientLight intensity={0.4} />
38
- <directionalLight position={[5, 5, 5]} intensity={0.8} />
39
- <mesh>
40
- <sphereGeometry args={[1, 32, 32]} />
41
- <meshStandardMaterial color="red" />
42
- </mesh>
43
- </ThreeCanvas>;
44
- ```
45
-
46
- ## No animations not driven by `useCurrentFrame()`
47
-
48
- Shaders, models etc MUST NOT animate by themselves.
49
- No animations are allowed unless they are driven by `useCurrentFrame()`.
50
- Otherwise, it will cause flickering during rendering.
51
-
52
- Using `useFrame()` from `@react-three/fiber` is forbidden.
53
-
54
- ## Animate using `useCurrentFrame()`
55
-
56
- Use `useCurrentFrame()` to perform animations.
57
-
58
- ```tsx
59
- const frame = useCurrentFrame();
60
- const rotationY = frame * 0.02;
61
-
62
- <mesh rotation={[0, rotationY, 0]}>
63
- <boxGeometry args={[2, 2, 2]} />
64
- <meshStandardMaterial color="#4a9eff" />
65
- </mesh>;
66
- ```
67
-
68
- ## Using `<Sequence>` inside `<ThreeCanvas>`
69
-
70
- The `layout` prop of any `<Sequence>` inside a `<ThreeCanvas>` must be set to `none`.
71
-
72
- ```tsx
73
- import { Sequence } from "remotion";
74
- import { ThreeCanvas } from "@remotion/three";
75
-
76
- const { width, height } = useVideoConfig();
77
-
78
- <ThreeCanvas width={width} height={height}>
79
- <Sequence layout="none">
80
- <mesh>
81
- <boxGeometry args={[2, 2, 2]} />
82
- <meshStandardMaterial color="#4a9eff" />
83
- </mesh>
84
- </Sequence>
85
- </ThreeCanvas>;
86
- ```
@@ -1,27 +0,0 @@
1
- ---
2
- name: animations
3
- description: Fundamental animation skills for Remotion
4
- metadata:
5
- tags: animations, transitions, frames, useCurrentFrame
6
- ---
7
-
8
- All animations MUST be driven by the `useCurrentFrame()` hook.
9
- Write animations in seconds and multiply them by the `fps` value from `useVideoConfig()`.
10
-
11
- ```tsx
12
- import { useCurrentFrame } from "remotion";
13
-
14
- export const FadeIn = () => {
15
- const frame = useCurrentFrame();
16
- const { fps } = useVideoConfig();
17
-
18
- const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
19
- extrapolateRight: "clamp",
20
- });
21
-
22
- return <div style={{ opacity }}>Hello World!</div>;
23
- };
24
- ```
25
-
26
- CSS transitions or animations are FORBIDDEN - they will not render correctly.
27
- Tailwind animation class names are FORBIDDEN - they will not render correctly.
@@ -1,178 +0,0 @@
1
- import { loadFont } from "@remotion/google-fonts/Inter";
2
- import {
3
- AbsoluteFill,
4
- spring,
5
- useCurrentFrame,
6
- useVideoConfig,
7
- } from "remotion";
8
-
9
- const { fontFamily } = loadFont();
10
-
11
- const COLOR_BAR = "#D4AF37";
12
- const COLOR_TEXT = "#ffffff";
13
- const COLOR_MUTED = "#888888";
14
- const COLOR_BG = "#0a0a0a";
15
- const COLOR_AXIS = "#333333";
16
-
17
- // Ideal composition size: 1280x720
18
-
19
- const Title: React.FC<{ children: React.ReactNode }> = ({ children }) => (
20
- <div style={{ textAlign: "center", marginBottom: 40 }}>
21
- <div style={{ color: COLOR_TEXT, fontSize: 48, fontWeight: 600 }}>
22
- {children}
23
- </div>
24
- </div>
25
- );
26
-
27
- const YAxis: React.FC<{ steps: number[]; height: number }> = ({
28
- steps,
29
- height,
30
- }) => (
31
- <div
32
- style={{
33
- display: "flex",
34
- flexDirection: "column",
35
- justifyContent: "space-between",
36
- height,
37
- paddingRight: 16,
38
- }}
39
- >
40
- {steps
41
- .slice()
42
- .reverse()
43
- .map((step) => (
44
- <div
45
- key={step}
46
- style={{
47
- color: COLOR_MUTED,
48
- fontSize: 20,
49
- textAlign: "right",
50
- }}
51
- >
52
- {step.toLocaleString()}
53
- </div>
54
- ))}
55
- </div>
56
- );
57
-
58
- const Bar: React.FC<{
59
- height: number;
60
- progress: number;
61
- }> = ({ height, progress }) => (
62
- <div
63
- style={{
64
- flex: 1,
65
- display: "flex",
66
- flexDirection: "column",
67
- justifyContent: "flex-end",
68
- }}
69
- >
70
- <div
71
- style={{
72
- width: "100%",
73
- height,
74
- backgroundColor: COLOR_BAR,
75
- borderRadius: "8px 8px 0 0",
76
- opacity: progress,
77
- }}
78
- />
79
- </div>
80
- );
81
-
82
- const XAxis: React.FC<{
83
- children: React.ReactNode;
84
- labels: string[];
85
- height: number;
86
- }> = ({ children, labels, height }) => (
87
- <div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
88
- <div
89
- style={{
90
- display: "flex",
91
- alignItems: "flex-end",
92
- gap: 16,
93
- height,
94
- borderLeft: `2px solid ${COLOR_AXIS}`,
95
- borderBottom: `2px solid ${COLOR_AXIS}`,
96
- paddingLeft: 16,
97
- }}
98
- >
99
- {children}
100
- </div>
101
- <div
102
- style={{
103
- display: "flex",
104
- gap: 16,
105
- paddingLeft: 16,
106
- marginTop: 12,
107
- }}
108
- >
109
- {labels.map((label) => (
110
- <div
111
- key={label}
112
- style={{
113
- flex: 1,
114
- textAlign: "center",
115
- color: COLOR_MUTED,
116
- fontSize: 20,
117
- }}
118
- >
119
- {label}
120
- </div>
121
- ))}
122
- </div>
123
- </div>
124
- );
125
-
126
- export const MyAnimation = () => {
127
- const frame = useCurrentFrame();
128
- const { fps, height } = useVideoConfig();
129
-
130
- const data = [
131
- { month: "Jan", price: 2039 },
132
- { month: "Mar", price: 2160 },
133
- { month: "May", price: 2327 },
134
- { month: "Jul", price: 2426 },
135
- { month: "Sep", price: 2634 },
136
- { month: "Nov", price: 2672 },
137
- ];
138
-
139
- const minPrice = 2000;
140
- const maxPrice = 2800;
141
- const priceRange = maxPrice - minPrice;
142
- const chartHeight = height - 280;
143
- const yAxisSteps = [2000, 2400, 2800];
144
-
145
- return (
146
- <AbsoluteFill
147
- style={{
148
- backgroundColor: COLOR_BG,
149
- padding: 60,
150
- display: "flex",
151
- flexDirection: "column",
152
- fontFamily,
153
- }}
154
- >
155
- <Title>Gold Price 2024</Title>
156
-
157
- <div style={{ display: "flex", flex: 1 }}>
158
- <YAxis steps={yAxisSteps} height={chartHeight} />
159
- <XAxis height={chartHeight} labels={data.map((d) => d.month)}>
160
- {data.map((item, i) => {
161
- const progress = spring({
162
- frame: frame - i * 5 - 10,
163
- fps,
164
- config: { damping: 18, stiffness: 80 },
165
- });
166
-
167
- const barHeight =
168
- ((item.price - minPrice) / priceRange) * chartHeight * progress;
169
-
170
- return (
171
- <Bar key={item.month} height={barHeight} progress={progress} />
172
- );
173
- })}
174
- </XAxis>
175
- </div>
176
- </AbsoluteFill>
177
- );
178
- };
@@ -1,100 +0,0 @@
1
- import {
2
- AbsoluteFill,
3
- interpolate,
4
- useCurrentFrame,
5
- useVideoConfig,
6
- } from "remotion";
7
-
8
- const COLOR_BG = "#ffffff";
9
- const COLOR_TEXT = "#000000";
10
- const FULL_TEXT = "From prompt to motion graphics. This is Remotion.";
11
- const PAUSE_AFTER = "From prompt to motion graphics.";
12
- const FONT_SIZE = 72;
13
- const FONT_WEIGHT = 700;
14
- const CHAR_FRAMES = 2;
15
- const CURSOR_BLINK_FRAMES = 16;
16
- const PAUSE_SECONDS = 1;
17
-
18
- // Ideal composition size: 1280x720
19
-
20
- const getTypedText = ({
21
- frame,
22
- fullText,
23
- pauseAfter,
24
- charFrames,
25
- pauseFrames,
26
- }: {
27
- frame: number;
28
- fullText: string;
29
- pauseAfter: string;
30
- charFrames: number;
31
- pauseFrames: number;
32
- }): string => {
33
- const pauseIndex = fullText.indexOf(pauseAfter);
34
- const preLen =
35
- pauseIndex >= 0 ? pauseIndex + pauseAfter.length : fullText.length;
36
-
37
- let typedChars = 0;
38
- if (frame < preLen * charFrames) {
39
- typedChars = Math.floor(frame / charFrames);
40
- } else if (frame < preLen * charFrames + pauseFrames) {
41
- typedChars = preLen;
42
- } else {
43
- const postPhase = frame - preLen * charFrames - pauseFrames;
44
- typedChars = Math.min(
45
- fullText.length,
46
- preLen + Math.floor(postPhase / charFrames),
47
- );
48
- }
49
- return fullText.slice(0, typedChars);
50
- };
51
-
52
- const Cursor: React.FC<{
53
- frame: number;
54
- blinkFrames: number;
55
- symbol?: string;
56
- }> = ({ frame, blinkFrames, symbol = "\u258C" }) => {
57
- const opacity = interpolate(
58
- frame % blinkFrames,
59
- [0, blinkFrames / 2, blinkFrames],
60
- [1, 0, 1],
61
- { extrapolateLeft: "clamp", extrapolateRight: "clamp" },
62
- );
63
-
64
- return <span style={{ opacity }}>{symbol}</span>;
65
- };
66
-
67
- export const MyAnimation = () => {
68
- const frame = useCurrentFrame();
69
- const { fps } = useVideoConfig();
70
-
71
- const pauseFrames = Math.round(fps * PAUSE_SECONDS);
72
-
73
- const typedText = getTypedText({
74
- frame,
75
- fullText: FULL_TEXT,
76
- pauseAfter: PAUSE_AFTER,
77
- charFrames: CHAR_FRAMES,
78
- pauseFrames,
79
- });
80
-
81
- return (
82
- <AbsoluteFill
83
- style={{
84
- backgroundColor: COLOR_BG,
85
- }}
86
- >
87
- <div
88
- style={{
89
- color: COLOR_TEXT,
90
- fontSize: FONT_SIZE,
91
- fontWeight: FONT_WEIGHT,
92
- fontFamily: "sans-serif",
93
- }}
94
- >
95
- <span>{typedText}</span>
96
- <Cursor frame={frame} blinkFrames={CURSOR_BLINK_FRAMES} />
97
- </div>
98
- </AbsoluteFill>
99
- );
100
- };
@@ -1,108 +0,0 @@
1
- import { loadFont } from "@remotion/google-fonts/Inter";
2
- import type React from "react";
3
- import {
4
- AbsoluteFill,
5
- spring,
6
- useCurrentFrame,
7
- useVideoConfig,
8
- } from "remotion";
9
-
10
- /*
11
- * Highlight a word in a sentence with a spring-animated wipe effect.
12
- */
13
-
14
- // Ideal composition size: 1280x720
15
-
16
- const COLOR_BG = "#ffffff";
17
- const COLOR_TEXT = "#000000";
18
- const COLOR_HIGHLIGHT = "#A7C7E7";
19
- const FULL_TEXT = "This is Remotion.";
20
- const HIGHLIGHT_WORD = "Remotion";
21
- const FONT_SIZE = 72;
22
- const FONT_WEIGHT = 700;
23
- const HIGHLIGHT_START_FRAME = 30;
24
- const HIGHLIGHT_WIPE_DURATION = 18;
25
-
26
- const { fontFamily } = loadFont();
27
-
28
- const Highlight: React.FC<{
29
- word: string;
30
- color: string;
31
- delay: number;
32
- durationInFrames: number;
33
- }> = ({ word, color, delay, durationInFrames }) => {
34
- const frame = useCurrentFrame();
35
- const { fps } = useVideoConfig();
36
-
37
- const highlightProgress = spring({
38
- fps,
39
- frame,
40
- config: { damping: 200 },
41
- delay,
42
- durationInFrames,
43
- });
44
- const scaleX = Math.max(0, Math.min(1, highlightProgress));
45
-
46
- return (
47
- <span style={{ position: "relative", display: "inline-block" }}>
48
- <span
49
- style={{
50
- position: "absolute",
51
- left: 0,
52
- right: 0,
53
- top: "50%",
54
- height: "1.05em",
55
- transform: `translateY(-50%) scaleX(${scaleX})`,
56
- transformOrigin: "left center",
57
- backgroundColor: color,
58
- borderRadius: "0.18em",
59
- zIndex: 0,
60
- }}
61
- />
62
- <span style={{ position: "relative", zIndex: 1 }}>{word}</span>
63
- </span>
64
- );
65
- };
66
-
67
- export const MyAnimation = () => {
68
- const highlightIndex = FULL_TEXT.indexOf(HIGHLIGHT_WORD);
69
- const hasHighlight = highlightIndex >= 0;
70
- const preText = hasHighlight ? FULL_TEXT.slice(0, highlightIndex) : FULL_TEXT;
71
- const postText = hasHighlight
72
- ? FULL_TEXT.slice(highlightIndex + HIGHLIGHT_WORD.length)
73
- : "";
74
-
75
- return (
76
- <AbsoluteFill
77
- style={{
78
- backgroundColor: COLOR_BG,
79
- alignItems: "center",
80
- justifyContent: "center",
81
- fontFamily,
82
- }}
83
- >
84
- <div
85
- style={{
86
- color: COLOR_TEXT,
87
- fontSize: FONT_SIZE,
88
- fontWeight: FONT_WEIGHT,
89
- }}
90
- >
91
- {hasHighlight ? (
92
- <>
93
- <span>{preText}</span>
94
- <Highlight
95
- word={HIGHLIGHT_WORD}
96
- color={COLOR_HIGHLIGHT}
97
- delay={HIGHLIGHT_START_FRAME}
98
- durationInFrames={HIGHLIGHT_WIPE_DURATION}
99
- />
100
- <span>{postText}</span>
101
- </>
102
- ) : (
103
- <span>{FULL_TEXT}</span>
104
- )}
105
- </div>
106
- </AbsoluteFill>
107
- );
108
- };
@@ -1,78 +0,0 @@
1
- ---
2
- name: assets
3
- description: Importing images, videos, audio, and fonts into Remotion
4
- metadata:
5
- tags: assets, staticFile, images, fonts, public
6
- ---
7
-
8
- # Importing assets in Remotion
9
-
10
- ## The public folder
11
-
12
- Place assets in the `public/` folder at your project root.
13
-
14
- ## Using staticFile()
15
-
16
- You MUST use `staticFile()` to reference files from the `public/` folder:
17
-
18
- ```tsx
19
- import { Img, staticFile } from "remotion";
20
-
21
- export const MyComposition = () => {
22
- return <Img src={staticFile("logo.png")} />;
23
- };
24
- ```
25
-
26
- The function returns an encoded URL that works correctly when deploying to subdirectories.
27
-
28
- ## Using with components
29
-
30
- **Images:**
31
-
32
- ```tsx
33
- import { Img, staticFile } from "remotion";
34
-
35
- <Img src={staticFile("photo.png")} />;
36
- ```
37
-
38
- **Videos:**
39
-
40
- ```tsx
41
- import { Video } from "@remotion/media";
42
- import { staticFile } from "remotion";
43
-
44
- <Video src={staticFile("clip.mp4")} />;
45
- ```
46
-
47
- **Audio:**
48
-
49
- ```tsx
50
- import { Audio } from "@remotion/media";
51
- import { staticFile } from "remotion";
52
-
53
- <Audio src={staticFile("music.mp3")} />;
54
- ```
55
-
56
- **Fonts:**
57
-
58
- ```tsx
59
- import { staticFile } from "remotion";
60
-
61
- const fontFamily = new FontFace("MyFont", `url(${staticFile("font.woff2")})`);
62
- await fontFamily.load();
63
- document.fonts.add(fontFamily);
64
- ```
65
-
66
- ## Remote URLs
67
-
68
- Remote URLs can be used directly without `staticFile()`:
69
-
70
- ```tsx
71
- <Img src="https://example.com/image.png" />
72
- <Video src="https://remotion.media/video.mp4" />
73
- ```
74
-
75
- ## Important notes
76
-
77
- - Remotion components (`<Img>`, `<Video>`, `<Audio>`) ensure assets are fully loaded before rendering
78
- - Special characters in filenames (`#`, `?`, `&`) are automatically encoded