@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.
- package/dist/.vite/manifest.json +1111 -0
- package/dist/assets/_basePickBy-BMMA4Tou.js +1 -0
- package/dist/assets/_baseUniq-D40qku1I.js +1 -0
- package/dist/assets/arc-Ckg65iy8.js +1 -0
- package/dist/assets/architecture-YZFGNWBL-Dv3EY0zV.js +1 -0
- package/dist/assets/architectureDiagram-Q4EWVU46-ClRss4cm.js +36 -0
- package/dist/assets/array-Bjz-wYpJ.js +1 -0
- package/dist/assets/blockDiagram-DXYQGD6D-CBcFvoK1.js +132 -0
- package/dist/assets/c4Diagram-AHTNJAMY-D4d3ZLam.js +10 -0
- package/dist/assets/channel-D9EJxDy_.js +1 -0
- package/dist/assets/chunk-2KRD3SAO-DaFfaCGO.js +1 -0
- package/dist/assets/chunk-336JU56O-yLEQoF0v.js +2 -0
- package/dist/assets/chunk-426QAEUC-Uyzd4wAA.js +1 -0
- package/dist/assets/chunk-4BX2VUAB-DRuTD7x5.js +1 -0
- package/dist/assets/chunk-4TB4RGXK-3xbpIi_o.js +206 -0
- package/dist/assets/chunk-55IACEB6-BExiaAoD.js +1 -0
- package/dist/assets/chunk-5FUZZQ4R-DatVvHnF.js +62 -0
- package/dist/assets/chunk-5PVQY5BW-BKgvrGh8.js +2 -0
- package/dist/assets/chunk-67CJDMHE-DMt8LNEX.js +1 -0
- package/dist/assets/chunk-7N4EOEYR-CzLGefVf.js +1 -0
- package/dist/assets/chunk-AA7GKIK3-B6GFAk4U.js +1 -0
- package/dist/assets/chunk-BSJP7CBP-BK29yehL.js +1 -0
- package/dist/assets/chunk-CIAEETIT-D7hBXImP.js +1 -0
- package/dist/assets/chunk-Dlc7tRH4.js +1 -0
- package/dist/assets/chunk-EDXVE4YY-PYJdlmyH.js +1 -0
- package/dist/assets/chunk-ENJZ2VHE-DUHKBv6x.js +10 -0
- package/dist/assets/chunk-FMBD7UC4-2FWyCCAV.js +15 -0
- package/dist/assets/chunk-FOC6F5B3-DKFHrt4K.js +1 -0
- package/dist/assets/chunk-ICPOFSXX-Bh__D0ec.js +122 -0
- package/dist/assets/chunk-K5T4RW27-D51O7IkG.js +94 -0
- package/dist/assets/chunk-KGLVRYIC-DMHSCH4T.js +1 -0
- package/dist/assets/chunk-LIHQZDEY-C2aANxt9.js +1 -0
- package/dist/assets/chunk-ORNJ4GCN-Db_37NRX.js +1 -0
- package/dist/assets/chunk-OYMX7WX6-BltXOJLJ.js +231 -0
- package/dist/assets/chunk-QZHKN3VN-8Lcg9gti.js +1 -0
- package/dist/assets/chunk-U2HBQHQK-ByS6tilY.js +70 -0
- package/dist/assets/chunk-X2U36JSP-Bm-4Gqg_.js +1 -0
- package/dist/assets/chunk-XPW4576I-Bqbompq4.js +32 -0
- package/dist/assets/chunk-YZCP3GAM-CsC0imPb.js +1 -0
- package/dist/assets/chunk-ZZ45TVLE-CG-CqfPC.js +1 -0
- package/dist/assets/classDiagram-6PBFFD2Q-Jy1uFUk4.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-ChiLl3rR.js +1 -0
- package/dist/assets/clone-BBjvuERA.js +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-q90QeGKv.js +1 -0
- package/dist/assets/cytoscape.esm-BfXff3fb.js +321 -0
- package/dist/assets/dagre-KV5264BT-BQWiLFJB.js +4 -0
- package/dist/assets/dagre-nn_aIZ2E.js +1 -0
- package/dist/assets/defaultLocale-BwmRmqJp.js +1 -0
- package/dist/assets/diagram-5BDNPKRD-CJa7Y97H.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-tVQGBWfY.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-CpimFldm.js +43 -0
- package/dist/assets/diagram-TYMM5635-D11WQVgy.js +24 -0
- package/dist/assets/dist-BNz65Ibc.js +1 -0
- package/dist/assets/erDiagram-SMLLAGMA-C2bLd0jS.js +85 -0
- package/dist/assets/flowDiagram-DWJPFMVM-Kw3fOOLT.js +162 -0
- package/dist/assets/ganttDiagram-T4ZO3ILL-fyMhyE2X.js +292 -0
- package/dist/assets/gitGraph-7Q5UKJZL-BGFRt2qs.js +1 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-D4JoiOvg.js +106 -0
- package/dist/assets/graphlib-DGcD9J2L.js +1 -0
- package/dist/assets/index-Cow3qpoq.css +2 -0
- package/dist/assets/index-DUf7okYi.js +14 -0
- package/dist/assets/info-OMHHGYJF-DI6-Z9vh.js +1 -0
- package/dist/assets/infoDiagram-42DDH7IO-D1ZkeMBy.js +2 -0
- package/dist/assets/init-TPm5RB77.js +1 -0
- package/dist/assets/isArrayLikeObject-69BLnVNM.js +1 -0
- package/dist/assets/isEmpty-DUS28g5f.js +1 -0
- package/dist/assets/ishikawaDiagram-UXIWVN3A-Dv8hzjZB.js +70 -0
- package/dist/assets/journeyDiagram-VCZTEJTY-COeB7F5r.js +139 -0
- package/dist/assets/kanban-definition-6JOO6SKY-BbYmxCYU.js +89 -0
- package/dist/assets/katex-5SGEXwpi.js +261 -0
- package/dist/assets/line-_v2NGEdn.js +1 -0
- package/dist/assets/linear-CXMqTN8N.js +1 -0
- package/dist/assets/mermaid-config-C8a4L22x.js +1 -0
- package/dist/assets/mermaid-parser.core-CFmphzPP.js +4 -0
- package/dist/assets/mermaid.core-DnHAupTp.js +11 -0
- package/dist/assets/mindmap-definition-QFDTVHPH-D7_lIep7.js +96 -0
- package/dist/assets/ordinal-D7l-8DAO.js +1 -0
- package/dist/assets/packet-4T2RLAQJ-DidW3JFc.js +1 -0
- package/dist/assets/path-BVpCanzE.js +1 -0
- package/dist/assets/pie-ZZUOXDRM-Bff2e5hg.js +1 -0
- package/dist/assets/pieDiagram-DEJITSTG-DDvYHCT_.js +30 -0
- package/dist/assets/quadrantDiagram-34T5L4WZ-DcLcIrdi.js +7 -0
- package/dist/assets/radar-PYXPWWZC-CsdZBH3M.js +1 -0
- package/dist/assets/requirementDiagram-MS252O5E-DLX6ld7D.js +84 -0
- package/dist/assets/rough.esm-BoTisKeL.js +1 -0
- package/dist/assets/sankeyDiagram-XADWPNL6-D-1GtsHM.js +10 -0
- package/dist/assets/sequenceDiagram-FGHM5R23-Bwxs0YQg.js +157 -0
- package/dist/assets/src-CrmkjRpa.js +1 -0
- package/dist/assets/stateDiagram-FHFEXIEX-DW7rOcnQ.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-Jm-24vQ2.js +1 -0
- package/dist/assets/timeline-definition-GMOUNBTQ-DVdHyzxS.js +120 -0
- package/dist/assets/treeView-SZITEDCU-DPKseaET.js +1 -0
- package/dist/assets/treemap-W4RFUUIX-DH-7GZe_.js +1 -0
- package/dist/assets/vennDiagram-DHZGUBPP-DJaC6xmI.js +34 -0
- package/dist/assets/wardley-RL74JXVD-AgyXyBN5.js +1 -0
- package/dist/assets/wardleyDiagram-NUSXRM2D-CTKERPKv.js +20 -0
- package/dist/assets/xychartDiagram-5P7HB3ND-BuExiLXc.js +7 -0
- package/{index.html → dist/index.html} +2 -1
- package/dist/index.js +2539 -0
- package/package.json +11 -1
- package/.agents/skills/remotion-best-practices/SKILL.md +0 -61
- package/.agents/skills/remotion-best-practices/rules/3d.md +0 -86
- package/.agents/skills/remotion-best-practices/rules/animations.md +0 -27
- package/.agents/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +0 -178
- package/.agents/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +0 -100
- package/.agents/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +0 -108
- package/.agents/skills/remotion-best-practices/rules/assets.md +0 -78
- package/.agents/skills/remotion-best-practices/rules/audio-visualization.md +0 -198
- package/.agents/skills/remotion-best-practices/rules/audio.md +0 -169
- package/.agents/skills/remotion-best-practices/rules/calculate-metadata.md +0 -134
- package/.agents/skills/remotion-best-practices/rules/can-decode.md +0 -75
- package/.agents/skills/remotion-best-practices/rules/charts.md +0 -120
- package/.agents/skills/remotion-best-practices/rules/compositions.md +0 -154
- package/.agents/skills/remotion-best-practices/rules/display-captions.md +0 -184
- package/.agents/skills/remotion-best-practices/rules/extract-frames.md +0 -229
- package/.agents/skills/remotion-best-practices/rules/ffmpeg.md +0 -38
- package/.agents/skills/remotion-best-practices/rules/fonts.md +0 -152
- package/.agents/skills/remotion-best-practices/rules/get-audio-duration.md +0 -58
- package/.agents/skills/remotion-best-practices/rules/get-video-dimensions.md +0 -68
- package/.agents/skills/remotion-best-practices/rules/get-video-duration.md +0 -60
- package/.agents/skills/remotion-best-practices/rules/gifs.md +0 -141
- package/.agents/skills/remotion-best-practices/rules/images.md +0 -134
- package/.agents/skills/remotion-best-practices/rules/import-srt-captions.md +0 -69
- package/.agents/skills/remotion-best-practices/rules/light-leaks.md +0 -73
- package/.agents/skills/remotion-best-practices/rules/lottie.md +0 -70
- package/.agents/skills/remotion-best-practices/rules/maps.md +0 -412
- package/.agents/skills/remotion-best-practices/rules/measuring-dom-nodes.md +0 -34
- package/.agents/skills/remotion-best-practices/rules/measuring-text.md +0 -140
- package/.agents/skills/remotion-best-practices/rules/parameters.md +0 -109
- package/.agents/skills/remotion-best-practices/rules/sequencing.md +0 -118
- package/.agents/skills/remotion-best-practices/rules/sfx.md +0 -26
- package/.agents/skills/remotion-best-practices/rules/subtitles.md +0 -36
- package/.agents/skills/remotion-best-practices/rules/tailwind.md +0 -11
- package/.agents/skills/remotion-best-practices/rules/text-animations.md +0 -20
- package/.agents/skills/remotion-best-practices/rules/timing.md +0 -179
- package/.agents/skills/remotion-best-practices/rules/transcribe-captions.md +0 -70
- package/.agents/skills/remotion-best-practices/rules/transitions.md +0 -197
- package/.agents/skills/remotion-best-practices/rules/transparent-videos.md +0 -106
- package/.agents/skills/remotion-best-practices/rules/trimming.md +0 -51
- package/.agents/skills/remotion-best-practices/rules/videos.md +0 -171
- package/.agents/skills/remotion-best-practices/rules/voiceover.md +0 -99
- package/.agents/skills/simple/SKILL.md +0 -52
- package/.agents/skills/vercel-react-best-practices/AGENTS.md +0 -3254
- package/.agents/skills/vercel-react-best-practices/README.md +0 -123
- package/.agents/skills/vercel-react-best-practices/SKILL.md +0 -141
- package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
- package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
- package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/.agents/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/.agents/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/.agents/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -142
- package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/.claude/CLAUDE.md +0 -184
- package/.claude/commands/review.md +0 -120
- package/.claude/commands/sync-docs.md +0 -71
- package/.claude/roadmap.md +0 -121
- package/.claude/rules/style-guide.md +0 -830
- package/.claude/settings.json +0 -18
- package/.claude/user-stories.md +0 -333
- package/AGENTS.md +0 -68
- package/Makefile +0 -32
- package/biome.json +0 -79
- package/bun.lock +0 -854
- package/bunfig.toml +0 -2
- package/docs/design.md +0 -563
- package/docs/perf-baseline.md +0 -130
- package/docs/plans/2026-03-13-client-mode-design.md +0 -86
- package/docs/plans/2026-03-13-client-mode-plan.md +0 -605
- package/docs/plans/2026-03-13-keyboard-shortcuts-design.md +0 -129
- package/docs/plans/2026-03-13-keyboard-shortcuts-plan.md +0 -1471
- package/docs/plans/2026-03-13-multi-document-design.md +0 -183
- package/docs/plans/2026-03-13-performance-benchmarks-design.md +0 -121
- package/docs/superpowers/plans/2026-03-26-surgical-pruning.md +0 -1176
- package/docs/superpowers/specs/2026-03-27-go-server-rewrite-design.md +0 -284
- package/e2e/comments.spec.ts +0 -81
- package/e2e/document-load.spec.ts +0 -32
- package/e2e/export.spec.ts +0 -58
- package/e2e/fixtures/sample.md +0 -7
- package/e2e/perf/add-comment.spec.ts +0 -116
- package/e2e/perf/fixtures/generate.ts +0 -327
- package/e2e/perf/initial-load.spec.ts +0 -49
- package/e2e/perf/perf.setup.ts +0 -23
- package/e2e/perf/perf.teardown.ts +0 -9
- package/e2e/perf/screenshot-final.png +0 -0
- package/e2e/perf/scroll.spec.ts +0 -39
- package/e2e/perf/tab-switch.spec.ts +0 -69
- package/e2e/perf/text-selection.spec.ts +0 -119
- package/e2e/perf/utils/metrics.ts +0 -350
- package/e2e/perf/utils/perf-cli.ts +0 -86
- package/e2e/persistence-file.spec.ts +0 -357
- package/e2e/utils/cli.ts +0 -84
- package/e2e/utils/selection.ts +0 -79
- package/go/cmd/readit/main.go +0 -416
- package/go/go.mod +0 -20
- package/go/go.sum +0 -41
- package/go/internal/server/anchor.go +0 -302
- package/go/internal/server/anchor_test.go +0 -111
- package/go/internal/server/comments.go +0 -390
- package/go/internal/server/documents.go +0 -113
- package/go/internal/server/embed.go +0 -17
- package/go/internal/server/headings.go +0 -33
- package/go/internal/server/headings_test.go +0 -75
- package/go/internal/server/htmltext.go +0 -123
- package/go/internal/server/markdown.go +0 -157
- package/go/internal/server/markdown_bench_test.go +0 -42
- package/go/internal/server/markdown_test.go +0 -79
- package/go/internal/server/server.go +0 -453
- package/go/internal/server/server_bench_test.go +0 -122
- package/go/internal/server/settings.go +0 -110
- package/go/internal/server/sse.go +0 -140
- package/go/internal/server/storage.go +0 -275
- package/go/internal/server/storage_test.go +0 -118
- package/go/internal/server/template.go +0 -66
- package/go/internal/server/types.go +0 -101
- package/go/internal/server/watcher.go +0 -74
- package/lefthook.yml +0 -8
- package/nvim-readit/lua/readit/health.lua +0 -64
- package/nvim-readit/lua/readit/init.lua +0 -463
- package/nvim-readit/plugin/readit.lua +0 -19
- package/playwright.config.ts +0 -34
- package/skills-lock.json +0 -20
- package/src/App.svelte +0 -881
- package/src/cli.ts +0 -881
- package/src/components/ActionsMenu.svelte +0 -95
- package/src/components/CommentBadge.svelte +0 -67
- package/src/components/CommentErrorBanner.svelte +0 -33
- package/src/components/CommentInput.svelte +0 -75
- package/src/components/CommentListItem.svelte +0 -95
- package/src/components/CommentManager.svelte +0 -129
- package/src/components/CommentNav.svelte +0 -109
- package/src/components/DocumentViewer.svelte +0 -218
- package/src/components/FloatingComment.svelte +0 -107
- package/src/components/Header.svelte +0 -76
- package/src/components/InlineEditor.svelte +0 -72
- package/src/components/MarginNote.svelte +0 -167
- package/src/components/MarginNotesContainer.svelte +0 -33
- package/src/components/RawModal.svelte +0 -126
- package/src/components/ReanchorConfirm.svelte +0 -30
- package/src/components/SettingsModal.svelte +0 -220
- package/src/components/ShortcutCapture.svelte +0 -82
- package/src/components/ShortcutList.svelte +0 -145
- package/src/components/TabBar.svelte +0 -52
- package/src/components/TableOfContents.svelte +0 -125
- package/src/components/ui/ActionLink.svelte +0 -40
- package/src/components/ui/Button.svelte +0 -53
- package/src/components/ui/Dialog.svelte +0 -97
- package/src/components/ui/DropdownMenu.svelte +0 -85
- package/src/components/ui/DropdownMenuItem.svelte +0 -38
- package/src/components/ui/DropdownMenuSeparator.svelte +0 -11
- package/src/components/ui/Text.svelte +0 -42
- package/src/env.d.ts +0 -6
- package/src/index.css +0 -754
- package/src/lib/__fixtures__/bench-data.ts +0 -114
- package/src/lib/anchor.bench.ts +0 -91
- package/src/lib/anchor.test.ts +0 -527
- package/src/lib/anchor.ts +0 -381
- package/src/lib/comment-storage.bench.ts +0 -49
- package/src/lib/comment-storage.test.ts +0 -632
- package/src/lib/comment-storage.ts +0 -222
- package/src/lib/export.bench.ts +0 -21
- package/src/lib/export.ts +0 -36
- package/src/lib/headings.test.ts +0 -103
- package/src/lib/headings.ts +0 -44
- package/src/lib/highlight/core.test.ts +0 -93
- package/src/lib/highlight/dom.ts +0 -187
- package/src/lib/highlight/highlight-registry.ts +0 -221
- package/src/lib/highlight/highlight.bench.ts +0 -92
- package/src/lib/highlight/highlighter.ts +0 -247
- package/src/lib/highlight/resolver.ts +0 -38
- package/src/lib/highlight/types.ts +0 -17
- package/src/lib/html-text.test.ts +0 -162
- package/src/lib/html-text.ts +0 -161
- package/src/lib/i18n/en.ts +0 -116
- package/src/lib/i18n/index.ts +0 -3
- package/src/lib/i18n/ja.ts +0 -118
- package/src/lib/i18n/translations.ts +0 -27
- package/src/lib/i18n/types.ts +0 -122
- package/src/lib/margin-layout.bench.ts +0 -61
- package/src/lib/margin-layout.ts +0 -71
- package/src/lib/markdown-renderer.test.ts +0 -154
- package/src/lib/markdown-renderer.ts +0 -177
- package/src/lib/mermaid-config.ts +0 -38
- package/src/lib/mermaid-renderer.ts +0 -162
- package/src/lib/mermaid-worker.ts +0 -60
- package/src/lib/positions.ts +0 -157
- package/src/lib/shortcut-registry.ts +0 -244
- package/src/lib/utils.ts +0 -15
- package/src/main.ts +0 -16
- package/src/schema.ts +0 -92
- package/src/server.ts +0 -1220
- package/src/stores/app.svelte.ts +0 -231
- package/src/stores/locale.svelte.ts +0 -46
- package/src/stores/settings.svelte.ts +0 -90
- package/src/stores/shortcuts.svelte.ts +0 -104
- package/src/stores/ui.svelte.ts +0 -12
- package/src/template.ts +0 -104
- package/src/test-setup.ts +0 -48
- package/svelte.config.js +0 -5
- package/test.md +0 -74
- package/tsconfig.cli.json +0 -12
- package/tsconfig.json +0 -20
- package/vite.config.ts +0 -47
- package/vitest.config.ts +0 -15
- package/vscode-readit/.mcp.json +0 -7
- package/vscode-readit/.vscodeignore +0 -7
- package/vscode-readit/bun.lock +0 -78
- package/vscode-readit/icon.svg +0 -10
- package/vscode-readit/package.json +0 -110
- package/vscode-readit/src/extension.ts +0 -117
- package/vscode-readit/src/server-manager.ts +0 -272
- package/vscode-readit/src/webview-provider.ts +0 -204
- package/vscode-readit/tsconfig.json +0 -20
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Copy } from "lucide-svelte";
|
|
3
|
-
import { app } from "../stores/app.svelte";
|
|
4
|
-
import { t } from "../stores/locale.svelte";
|
|
5
|
-
import Button from "./ui/Button.svelte";
|
|
6
|
-
import Dialog from "./ui/Dialog.svelte";
|
|
7
|
-
import Text from "./ui/Text.svelte";
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
open: boolean;
|
|
11
|
-
onclose: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let { open = $bindable(false), onclose }: Props = $props();
|
|
15
|
-
|
|
16
|
-
type ModalState =
|
|
17
|
-
| { status: "idle" }
|
|
18
|
-
| { status: "loading" }
|
|
19
|
-
| { status: "error"; error: string }
|
|
20
|
-
| { status: "empty"; path: string }
|
|
21
|
-
| { status: "success"; content: string; path: string };
|
|
22
|
-
|
|
23
|
-
let modalState = $state<ModalState>({ status: "idle" });
|
|
24
|
-
|
|
25
|
-
$effect(() => {
|
|
26
|
-
if (!open) {
|
|
27
|
-
modalState = { status: "idle" };
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
modalState = { status: "loading" };
|
|
32
|
-
|
|
33
|
-
const query = app.activeDocumentPath
|
|
34
|
-
? `?path=${encodeURIComponent(app.activeDocumentPath)}`
|
|
35
|
-
: "";
|
|
36
|
-
|
|
37
|
-
fetch(`/api/comments/raw${query}`)
|
|
38
|
-
.then((response) => {
|
|
39
|
-
if (!response.ok) {
|
|
40
|
-
throw new Error("Failed to fetch raw comments");
|
|
41
|
-
}
|
|
42
|
-
return response.json();
|
|
43
|
-
})
|
|
44
|
-
.then((result) => {
|
|
45
|
-
if (result.content === null) {
|
|
46
|
-
modalState = { status: "empty", path: result.path };
|
|
47
|
-
} else {
|
|
48
|
-
modalState = {
|
|
49
|
-
status: "success",
|
|
50
|
-
content: result.content,
|
|
51
|
-
path: result.path,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
.catch((err) => {
|
|
56
|
-
modalState = {
|
|
57
|
-
status: "error",
|
|
58
|
-
error: err instanceof Error ? err.message : "Unknown error",
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
async function handleCopy() {
|
|
64
|
-
if (modalState.status !== "success") return;
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
await navigator.clipboard.writeText(modalState.content);
|
|
68
|
-
} catch {}
|
|
69
|
-
}
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<Dialog bind:open {onclose} contentClass="max-w-2xl max-h-[80vh]">
|
|
73
|
-
{#snippet header()}
|
|
74
|
-
{t("rawModal.title")}
|
|
75
|
-
{/snippet}
|
|
76
|
-
|
|
77
|
-
{#snippet headerActions()}
|
|
78
|
-
{#if modalState.status === "success"}
|
|
79
|
-
<Button
|
|
80
|
-
variant="ghost"
|
|
81
|
-
size="icon"
|
|
82
|
-
class="size-7"
|
|
83
|
-
onclick={handleCopy}
|
|
84
|
-
title={t("rawModal.copyTitle")}
|
|
85
|
-
>
|
|
86
|
-
<Copy class="w-4 h-4" />
|
|
87
|
-
</Button>
|
|
88
|
-
{/if}
|
|
89
|
-
{/snippet}
|
|
90
|
-
|
|
91
|
-
{#if modalState.status === "success" || modalState.status === "empty"}
|
|
92
|
-
<div
|
|
93
|
-
class="px-4 py-2 border-b border-zinc-50 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 font-mono truncate -mt-4 -mx-4 mb-4"
|
|
94
|
-
>
|
|
95
|
-
{modalState.path}
|
|
96
|
-
</div>
|
|
97
|
-
{/if}
|
|
98
|
-
|
|
99
|
-
{#if modalState.status === "loading"}
|
|
100
|
-
<Text variant="caption" class="text-center py-8">
|
|
101
|
-
{t("rawModal.loading")}
|
|
102
|
-
</Text>
|
|
103
|
-
{/if}
|
|
104
|
-
|
|
105
|
-
{#if modalState.status === "error"}
|
|
106
|
-
<Text variant="body" class="text-red-500 text-center py-8">
|
|
107
|
-
{modalState.error}
|
|
108
|
-
</Text>
|
|
109
|
-
{/if}
|
|
110
|
-
|
|
111
|
-
{#if modalState.status === "empty"}
|
|
112
|
-
<Text variant="caption" class="text-center py-8">
|
|
113
|
-
{t("rawModal.noComments")}
|
|
114
|
-
</Text>
|
|
115
|
-
{/if}
|
|
116
|
-
|
|
117
|
-
{#if modalState.status === "success"}
|
|
118
|
-
<Text
|
|
119
|
-
variant="body"
|
|
120
|
-
as="pre"
|
|
121
|
-
class="text-xs font-mono whitespace-pre-wrap break-words leading-relaxed"
|
|
122
|
-
>
|
|
123
|
-
{modalState.content}
|
|
124
|
-
</Text>
|
|
125
|
-
{/if}
|
|
126
|
-
</Dialog>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { t } from "../stores/locale.svelte";
|
|
3
|
-
import Button from "./ui/Button.svelte";
|
|
4
|
-
import Text from "./ui/Text.svelte";
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
selectionText: string;
|
|
8
|
-
onconfirm: () => void;
|
|
9
|
-
oncancel: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let { selectionText, onconfirm, oncancel }: Props = $props();
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<div class="border-t border-zinc-200 dark:border-zinc-700 pt-2 pb-3 pl-6">
|
|
16
|
-
<Text variant="body" class="mb-2">
|
|
17
|
-
{t("reanchor.question")}
|
|
18
|
-
</Text>
|
|
19
|
-
<Text variant="caption" class="italic line-clamp-2 mb-2">
|
|
20
|
-
"{selectionText}"
|
|
21
|
-
</Text>
|
|
22
|
-
<div class="flex gap-3 text-sm">
|
|
23
|
-
<Button variant="link" size="sm" onclick={onconfirm}>
|
|
24
|
-
{t("reanchor.confirm")}
|
|
25
|
-
</Button>
|
|
26
|
-
<Button variant="ghost" size="sm" onclick={oncancel}>
|
|
27
|
-
{t("reanchor.cancel")}
|
|
28
|
-
</Button>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Check, ChevronDown } from "lucide-svelte";
|
|
3
|
-
import { type Locale, Locales } from "../lib/i18n";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
import { FontFamilies, type FontFamily, ThemeModes } from "../schema";
|
|
6
|
-
import { localeState, setLocale, t } from "../stores/locale.svelte";
|
|
7
|
-
import {
|
|
8
|
-
settings,
|
|
9
|
-
updateFontFamily,
|
|
10
|
-
updateThemeMode,
|
|
11
|
-
} from "../stores/settings.svelte";
|
|
12
|
-
import ShortcutList from "./ShortcutList.svelte";
|
|
13
|
-
import Dialog from "./ui/Dialog.svelte";
|
|
14
|
-
import DropdownMenu from "./ui/DropdownMenu.svelte";
|
|
15
|
-
import DropdownMenuItem from "./ui/DropdownMenuItem.svelte";
|
|
16
|
-
import Text from "./ui/Text.svelte";
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
open: boolean;
|
|
20
|
-
onclose: () => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let { open = $bindable(false), onclose }: Props = $props();
|
|
24
|
-
|
|
25
|
-
const LOCALE_OPTIONS = [
|
|
26
|
-
{ value: Locales.JA, label: "日本語" },
|
|
27
|
-
{ value: Locales.EN, label: "English" },
|
|
28
|
-
] as const;
|
|
29
|
-
|
|
30
|
-
let themeOptions = $derived([
|
|
31
|
-
{ value: ThemeModes.SYSTEM, label: t("settings.theme.system") },
|
|
32
|
-
{ value: ThemeModes.LIGHT, label: t("settings.theme.light") },
|
|
33
|
-
{ value: ThemeModes.DARK, label: t("settings.theme.dark") },
|
|
34
|
-
]);
|
|
35
|
-
|
|
36
|
-
let fontOptions = $derived([
|
|
37
|
-
{
|
|
38
|
-
value: FontFamilies.SERIF,
|
|
39
|
-
label: t("settings.font.serif"),
|
|
40
|
-
fontClass: "font-serif",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: FontFamilies.SANS_SERIF,
|
|
44
|
-
label: t("settings.font.sansSerif"),
|
|
45
|
-
fontClass: "font-sans",
|
|
46
|
-
},
|
|
47
|
-
]);
|
|
48
|
-
|
|
49
|
-
let activeTheme = $derived(
|
|
50
|
-
themeOptions.find((o) => o.value === settings.themeMode) ?? themeOptions[0],
|
|
51
|
-
);
|
|
52
|
-
let activeFont = $derived(
|
|
53
|
-
fontOptions.find((o) => o.value === settings.fontFamily) ?? fontOptions[0],
|
|
54
|
-
);
|
|
55
|
-
let activeLocale = $derived(
|
|
56
|
-
LOCALE_OPTIONS.find((o) => o.value === localeState.locale) ??
|
|
57
|
-
LOCALE_OPTIONS[0],
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const triggerClassName = cn(
|
|
61
|
-
"inline-flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-sm",
|
|
62
|
-
"border border-zinc-200 dark:border-zinc-700",
|
|
63
|
-
"bg-white dark:bg-zinc-800",
|
|
64
|
-
"text-zinc-700 dark:text-zinc-300",
|
|
65
|
-
"hover:bg-zinc-50 dark:hover:bg-zinc-700/50",
|
|
66
|
-
"transition-colors cursor-pointer",
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
let themeDropdownOpen = $state(false);
|
|
70
|
-
let fontDropdownOpen = $state(false);
|
|
71
|
-
let localeDropdownOpen = $state(false);
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<Dialog bind:open {onclose} contentClass="max-w-md">
|
|
75
|
-
{#snippet header()}
|
|
76
|
-
{t("settings.title")}
|
|
77
|
-
{/snippet}
|
|
78
|
-
|
|
79
|
-
<div class="space-y-4">
|
|
80
|
-
<div>
|
|
81
|
-
<Text variant="overline" as="h3" class="mb-3">
|
|
82
|
-
{t("settings.theme")}
|
|
83
|
-
</Text>
|
|
84
|
-
<DropdownMenu bind:open={themeDropdownOpen} align="start" contentClass="min-w-[160px]">
|
|
85
|
-
{#snippet trigger()}
|
|
86
|
-
<button type="button" class={triggerClassName}>
|
|
87
|
-
{#if activeTheme.value === ThemeModes.SYSTEM}
|
|
88
|
-
<span
|
|
89
|
-
class="size-2.5 rounded-full bg-gradient-to-r from-amber-400 to-indigo-400"
|
|
90
|
-
></span>
|
|
91
|
-
{:else}
|
|
92
|
-
<span
|
|
93
|
-
class={cn(
|
|
94
|
-
"size-2.5 rounded-full",
|
|
95
|
-
activeTheme.value === ThemeModes.LIGHT
|
|
96
|
-
? "bg-amber-400"
|
|
97
|
-
: "bg-indigo-400",
|
|
98
|
-
)}
|
|
99
|
-
></span>
|
|
100
|
-
{/if}
|
|
101
|
-
<span
|
|
102
|
-
class="text-[10px] font-semibold leading-none text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5"
|
|
103
|
-
>Aa</span>
|
|
104
|
-
<span>{activeTheme.label}</span>
|
|
105
|
-
<ChevronDown class="size-3 text-zinc-400 dark:text-zinc-500" />
|
|
106
|
-
</button>
|
|
107
|
-
{/snippet}
|
|
108
|
-
|
|
109
|
-
{#each themeOptions as option (option.value)}
|
|
110
|
-
<DropdownMenuItem
|
|
111
|
-
onselect={() => {
|
|
112
|
-
updateThemeMode(option.value);
|
|
113
|
-
themeDropdownOpen = false;
|
|
114
|
-
}}
|
|
115
|
-
class="flex items-center gap-2"
|
|
116
|
-
>
|
|
117
|
-
{#if option.value === ThemeModes.SYSTEM}
|
|
118
|
-
<span
|
|
119
|
-
class="size-2.5 rounded-full bg-gradient-to-r from-amber-400 to-indigo-400"
|
|
120
|
-
></span>
|
|
121
|
-
{:else}
|
|
122
|
-
<span
|
|
123
|
-
class={cn(
|
|
124
|
-
"size-2.5 rounded-full",
|
|
125
|
-
option.value === ThemeModes.LIGHT
|
|
126
|
-
? "bg-amber-400"
|
|
127
|
-
: "bg-indigo-400",
|
|
128
|
-
)}
|
|
129
|
-
></span>
|
|
130
|
-
{/if}
|
|
131
|
-
<span
|
|
132
|
-
class="text-[10px] font-semibold leading-none text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5"
|
|
133
|
-
>Aa</span>
|
|
134
|
-
<span class="flex-1">{option.label}</span>
|
|
135
|
-
{#if settings.themeMode === option.value}
|
|
136
|
-
<Check class="size-3.5 text-zinc-500 dark:text-zinc-400" />
|
|
137
|
-
{/if}
|
|
138
|
-
</DropdownMenuItem>
|
|
139
|
-
{/each}
|
|
140
|
-
</DropdownMenu>
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<div>
|
|
144
|
-
<Text variant="overline" as="h3" class="mb-3">
|
|
145
|
-
{t("settings.font")}
|
|
146
|
-
</Text>
|
|
147
|
-
<DropdownMenu bind:open={fontDropdownOpen} align="start" contentClass="min-w-[160px]">
|
|
148
|
-
{#snippet trigger()}
|
|
149
|
-
<button type="button" class={triggerClassName}>
|
|
150
|
-
<span
|
|
151
|
-
class={cn(
|
|
152
|
-
"text-[10px] font-semibold leading-none text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5",
|
|
153
|
-
activeFont.fontClass,
|
|
154
|
-
)}
|
|
155
|
-
>Aa</span>
|
|
156
|
-
<span>{activeFont.label}</span>
|
|
157
|
-
<ChevronDown class="size-3 text-zinc-400 dark:text-zinc-500" />
|
|
158
|
-
</button>
|
|
159
|
-
{/snippet}
|
|
160
|
-
|
|
161
|
-
{#each fontOptions as option (option.value)}
|
|
162
|
-
<DropdownMenuItem
|
|
163
|
-
onselect={() => {
|
|
164
|
-
updateFontFamily(option.value as FontFamily);
|
|
165
|
-
fontDropdownOpen = false;
|
|
166
|
-
}}
|
|
167
|
-
class="flex items-center gap-2"
|
|
168
|
-
>
|
|
169
|
-
<span
|
|
170
|
-
class={cn(
|
|
171
|
-
"text-[10px] font-semibold leading-none text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5",
|
|
172
|
-
option.fontClass,
|
|
173
|
-
)}
|
|
174
|
-
>Aa</span>
|
|
175
|
-
<span class="flex-1">{option.label}</span>
|
|
176
|
-
{#if settings.fontFamily === option.value}
|
|
177
|
-
<Check class="size-3.5 text-zinc-500 dark:text-zinc-400" />
|
|
178
|
-
{/if}
|
|
179
|
-
</DropdownMenuItem>
|
|
180
|
-
{/each}
|
|
181
|
-
</DropdownMenu>
|
|
182
|
-
</div>
|
|
183
|
-
|
|
184
|
-
<div>
|
|
185
|
-
<Text variant="overline" as="h3" class="mb-3">
|
|
186
|
-
{t("settings.language")}
|
|
187
|
-
</Text>
|
|
188
|
-
<DropdownMenu bind:open={localeDropdownOpen} align="start" contentClass="min-w-[160px]">
|
|
189
|
-
{#snippet trigger()}
|
|
190
|
-
<button type="button" class={triggerClassName}>
|
|
191
|
-
<span>{activeLocale.label}</span>
|
|
192
|
-
<ChevronDown class="size-3 text-zinc-400 dark:text-zinc-500" />
|
|
193
|
-
</button>
|
|
194
|
-
{/snippet}
|
|
195
|
-
|
|
196
|
-
{#each LOCALE_OPTIONS as option (option.value)}
|
|
197
|
-
<DropdownMenuItem
|
|
198
|
-
onselect={() => {
|
|
199
|
-
setLocale(option.value as Locale);
|
|
200
|
-
localeDropdownOpen = false;
|
|
201
|
-
}}
|
|
202
|
-
class="flex items-center gap-2"
|
|
203
|
-
>
|
|
204
|
-
<span class="flex-1">{option.label}</span>
|
|
205
|
-
{#if localeState.locale === option.value}
|
|
206
|
-
<Check class="size-3.5 text-zinc-500 dark:text-zinc-400" />
|
|
207
|
-
{/if}
|
|
208
|
-
</DropdownMenuItem>
|
|
209
|
-
{/each}
|
|
210
|
-
</DropdownMenu>
|
|
211
|
-
</div>
|
|
212
|
-
|
|
213
|
-
<div>
|
|
214
|
-
<Text variant="overline" as="h3" class="mb-3">
|
|
215
|
-
{t("shortcuts.title")}
|
|
216
|
-
</Text>
|
|
217
|
-
<ShortcutList />
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
</Dialog>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount } from "svelte";
|
|
3
|
-
import {
|
|
4
|
-
eventToBinding,
|
|
5
|
-
formatBinding,
|
|
6
|
-
isReservedBinding,
|
|
7
|
-
} from "../lib/shortcut-registry";
|
|
8
|
-
import { cn } from "../lib/utils";
|
|
9
|
-
import type { ShortcutBinding } from "../schema";
|
|
10
|
-
import { t } from "../stores/locale.svelte";
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
oncapture: (binding: ShortcutBinding) => void;
|
|
14
|
-
oncancel: () => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let { oncapture, oncancel }: Props = $props();
|
|
18
|
-
|
|
19
|
-
let captureEl: HTMLDivElement | undefined = $state();
|
|
20
|
-
let error = $state<string | null>(null);
|
|
21
|
-
const isMac = navigator.platform.includes("Mac");
|
|
22
|
-
|
|
23
|
-
function handleKeyDown(e: KeyboardEvent) {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
e.stopPropagation();
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
e.key === "Alt" ||
|
|
29
|
-
e.key === "Shift" ||
|
|
30
|
-
e.key === "Control" ||
|
|
31
|
-
e.key === "Meta"
|
|
32
|
-
) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (e.key === "Escape" && !e.altKey && !e.metaKey && !e.shiftKey) {
|
|
37
|
-
oncancel();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const binding = eventToBinding(e);
|
|
42
|
-
|
|
43
|
-
if (isReservedBinding(binding, isMac)) {
|
|
44
|
-
error = t("shortcutCapture.reserved", {
|
|
45
|
-
binding: formatBinding(binding, isMac),
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
error = null;
|
|
51
|
-
oncapture(binding);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
onMount(() => {
|
|
55
|
-
captureEl?.focus();
|
|
56
|
-
});
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
60
|
-
<div
|
|
61
|
-
role="button"
|
|
62
|
-
aria-label={t("shortcutCapture.ariaLabel")}
|
|
63
|
-
bind:this={captureEl}
|
|
64
|
-
tabindex={0}
|
|
65
|
-
onkeydown={handleKeyDown}
|
|
66
|
-
onblur={oncancel}
|
|
67
|
-
class={cn(
|
|
68
|
-
"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium",
|
|
69
|
-
"bg-amber-50 dark:bg-amber-900/30",
|
|
70
|
-
"border border-amber-300 dark:border-amber-600",
|
|
71
|
-
"text-amber-700 dark:text-amber-300",
|
|
72
|
-
"outline-none ring-2 ring-amber-400/50",
|
|
73
|
-
"animate-pulse",
|
|
74
|
-
)}
|
|
75
|
-
>
|
|
76
|
-
<span>{t("shortcutCapture.pressKeys")}</span>
|
|
77
|
-
{#if error}
|
|
78
|
-
<span class="text-red-500 dark:text-red-400 text-[10px] animate-none"
|
|
79
|
-
>{error}</span
|
|
80
|
-
>
|
|
81
|
-
{/if}
|
|
82
|
-
</div>
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
bindingsEqual,
|
|
4
|
-
formatBinding,
|
|
5
|
-
SHORTCUT_GROUPS,
|
|
6
|
-
type ShortcutDefinition,
|
|
7
|
-
} from "../lib/shortcut-registry";
|
|
8
|
-
import { cn } from "../lib/utils";
|
|
9
|
-
import type { ShortcutBinding } from "../schema";
|
|
10
|
-
import { t } from "../stores/locale.svelte";
|
|
11
|
-
import {
|
|
12
|
-
resetToDefaults,
|
|
13
|
-
shortcutState,
|
|
14
|
-
toggleEnabled,
|
|
15
|
-
updateBinding,
|
|
16
|
-
} from "../stores/shortcuts.svelte";
|
|
17
|
-
import ShortcutCapture from "./ShortcutCapture.svelte";
|
|
18
|
-
import Button from "./ui/Button.svelte";
|
|
19
|
-
import Text from "./ui/Text.svelte";
|
|
20
|
-
|
|
21
|
-
const isMac = navigator.platform.includes("Mac");
|
|
22
|
-
let capturingId = $state<string | null>(null);
|
|
23
|
-
|
|
24
|
-
function handleCapture(id: string, binding: ShortcutBinding) {
|
|
25
|
-
capturingId = null;
|
|
26
|
-
updateBinding(id, binding);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function handleCancelCapture() {
|
|
30
|
-
capturingId = null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function startCapture(id: string) {
|
|
34
|
-
capturingId = id;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function getShortcut(id: string): ShortcutDefinition | undefined {
|
|
38
|
-
return shortcutState.shortcuts.find((s) => s.id === id);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function isModified(shortcut: ShortcutDefinition): boolean {
|
|
42
|
-
return (
|
|
43
|
-
!shortcut.enabled ||
|
|
44
|
-
!bindingsEqual(shortcut.binding, shortcut.defaultBinding)
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let hasModifications = $derived(
|
|
49
|
-
shortcutState.shortcuts.some((s) => isModified(s)),
|
|
50
|
-
);
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<div class="space-y-4">
|
|
54
|
-
{#each SHORTCUT_GROUPS as group (group.label)}
|
|
55
|
-
<div>
|
|
56
|
-
<Text variant="caption" as="div" class="mb-2 font-medium">
|
|
57
|
-
{t(group.label)}
|
|
58
|
-
</Text>
|
|
59
|
-
|
|
60
|
-
<div class="space-y-1">
|
|
61
|
-
{#each group.ids as id (id)}
|
|
62
|
-
{@const shortcut = getShortcut(id)}
|
|
63
|
-
{#if shortcut}
|
|
64
|
-
<div
|
|
65
|
-
class={cn(
|
|
66
|
-
"flex items-center gap-3 px-2 py-1.5 rounded-lg",
|
|
67
|
-
"hover:bg-zinc-50 dark:hover:bg-zinc-800/50",
|
|
68
|
-
!shortcut.enabled && "opacity-50",
|
|
69
|
-
)}
|
|
70
|
-
>
|
|
71
|
-
<div class="flex-1 min-w-0">
|
|
72
|
-
<div class="text-xs text-zinc-700 dark:text-zinc-300">
|
|
73
|
-
{t(shortcut.label)}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div class="flex items-center gap-2">
|
|
78
|
-
{#if capturingId === shortcut.id}
|
|
79
|
-
<ShortcutCapture
|
|
80
|
-
oncapture={(binding) =>
|
|
81
|
-
handleCapture(shortcut.id, binding)}
|
|
82
|
-
oncancel={handleCancelCapture}
|
|
83
|
-
/>
|
|
84
|
-
{:else}
|
|
85
|
-
<button
|
|
86
|
-
type="button"
|
|
87
|
-
onclick={() => startCapture(shortcut.id)}
|
|
88
|
-
class={cn(
|
|
89
|
-
"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[11px] font-mono",
|
|
90
|
-
"bg-zinc-100 dark:bg-zinc-800",
|
|
91
|
-
"border border-zinc-200 dark:border-zinc-700",
|
|
92
|
-
"text-zinc-600 dark:text-zinc-400",
|
|
93
|
-
"hover:bg-zinc-200 dark:hover:bg-zinc-700",
|
|
94
|
-
"transition-colors cursor-pointer",
|
|
95
|
-
isModified(shortcut) &&
|
|
96
|
-
"ring-1 ring-blue-400/50 dark:ring-blue-500/50",
|
|
97
|
-
)}
|
|
98
|
-
>
|
|
99
|
-
{formatBinding(shortcut.binding, isMac)}
|
|
100
|
-
</button>
|
|
101
|
-
{/if}
|
|
102
|
-
|
|
103
|
-
<label
|
|
104
|
-
class="relative inline-flex items-center cursor-pointer"
|
|
105
|
-
title={t("shortcuts.enableDisable")}
|
|
106
|
-
>
|
|
107
|
-
<input
|
|
108
|
-
type="checkbox"
|
|
109
|
-
checked={shortcut.enabled}
|
|
110
|
-
onchange={() => toggleEnabled(shortcut.id)}
|
|
111
|
-
class="sr-only peer"
|
|
112
|
-
/>
|
|
113
|
-
<div
|
|
114
|
-
class={cn(
|
|
115
|
-
"w-7 h-4 rounded-full transition-colors",
|
|
116
|
-
"bg-zinc-200 dark:bg-zinc-700",
|
|
117
|
-
"peer-checked:bg-blue-500 dark:peer-checked:bg-blue-600",
|
|
118
|
-
"after:content-[''] after:absolute after:top-0.5 after:start-[2px]",
|
|
119
|
-
"after:bg-white after:rounded-full after:size-3",
|
|
120
|
-
"after:transition-all after:duration-150",
|
|
121
|
-
"peer-checked:after:translate-x-full peer-checked:after:translate-x-3",
|
|
122
|
-
)}
|
|
123
|
-
></div>
|
|
124
|
-
</label>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
{/if}
|
|
128
|
-
{/each}
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
{/each}
|
|
132
|
-
|
|
133
|
-
{#if hasModifications}
|
|
134
|
-
<div class="pt-2 border-t border-zinc-100 dark:border-zinc-800">
|
|
135
|
-
<Button
|
|
136
|
-
variant="ghost"
|
|
137
|
-
size="sm"
|
|
138
|
-
onclick={resetToDefaults}
|
|
139
|
-
class="text-xs"
|
|
140
|
-
>
|
|
141
|
-
{t("shortcuts.resetToDefaults")}
|
|
142
|
-
</Button>
|
|
143
|
-
</div>
|
|
144
|
-
{/if}
|
|
145
|
-
</div>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cn } from "../lib/utils";
|
|
3
|
-
import { app, closeDocument, setActiveDocument } from "../stores/app.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
{#if app.documentOrder.length > 1}
|
|
7
|
-
<div
|
|
8
|
-
class="flex border-b border-zinc-200 dark:border-zinc-800 bg-zinc-50 dark:bg-zinc-900 px-2 overflow-x-auto"
|
|
9
|
-
role="tablist"
|
|
10
|
-
>
|
|
11
|
-
{#each app.documentOrder as filePath (filePath)}
|
|
12
|
-
{@const docState = app.documents.get(filePath)}
|
|
13
|
-
{@const isActive = filePath === app.activeDocumentPath}
|
|
14
|
-
|
|
15
|
-
{#if docState}
|
|
16
|
-
<div
|
|
17
|
-
role="tab"
|
|
18
|
-
tabindex={isActive ? 0 : -1}
|
|
19
|
-
aria-selected={isActive}
|
|
20
|
-
class={cn(
|
|
21
|
-
"flex items-center gap-1.5 px-3 py-1.5 text-sm border-b-2 whitespace-nowrap cursor-pointer select-none",
|
|
22
|
-
isActive
|
|
23
|
-
? "border-zinc-900 dark:border-zinc-100 text-zinc-900 dark:text-zinc-100"
|
|
24
|
-
: "border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800",
|
|
25
|
-
)}
|
|
26
|
-
onclick={() => setActiveDocument(filePath)}
|
|
27
|
-
onkeydown={(e) => {
|
|
28
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
29
|
-
e.preventDefault();
|
|
30
|
-
setActiveDocument(filePath);
|
|
31
|
-
}
|
|
32
|
-
}}
|
|
33
|
-
>
|
|
34
|
-
<span>{docState.document.fileName}</span>
|
|
35
|
-
<button
|
|
36
|
-
type="button"
|
|
37
|
-
aria-label="Close tab"
|
|
38
|
-
class="ml-1 rounded p-0.5 hover:bg-zinc-200 dark:hover:bg-zinc-700"
|
|
39
|
-
onclick={(e) => {
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
closeDocument(filePath);
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" stroke-width="2">
|
|
45
|
-
<path d="M18 6 6 18M6 6l12 12"></path>
|
|
46
|
-
</svg>
|
|
47
|
-
</button>
|
|
48
|
-
</div>
|
|
49
|
-
{/if}
|
|
50
|
-
{/each}
|
|
51
|
-
</div>
|
|
52
|
-
{/if}
|