@namzu/cli 52.1.0 → 52.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-C2H6FGPR.js → acp-QNJODJHL.js} +51 -24
- package/dist/chunks/{acp-C2H6FGPR.js.map → acp-QNJODJHL.js.map} +1 -1
- package/dist/chunks/{add-VOR5M5BV.js → add-L6FKDP7N.js} +9 -9
- package/dist/chunks/{agent-EWZGPBGI.js → agent-VJRVABX2.js} +13 -13
- package/dist/chunks/{agent-session-EKTTB7TN.js → agent-session-JO5HEUHN.js} +14 -14
- package/dist/chunks/{apply-at-exit-FVOHKVHQ.js → apply-at-exit-OGSLNQHX.js} +4 -4
- package/dist/chunks/bash-5556UNOY.js +404 -0
- package/dist/chunks/bash-5556UNOY.js.map +6 -0
- package/dist/chunks/{bin-main-C5UNGSAQ.js → bin-main-XIAVK2BK.js} +5 -5
- package/dist/chunks/c-SMQ2QLVV.js +304 -0
- package/dist/chunks/c-SMQ2QLVV.js.map +6 -0
- package/dist/chunks/{chat-YQCC2O5F.js → chat-AQICSI4M.js} +2 -2
- package/dist/chunks/{chunk-F7LMCISP.js → chunk-33CQRXME.js} +3 -3
- package/dist/chunks/{chunk-H6KPEFAR.js → chunk-47E6HKJT.js} +2 -2
- package/dist/chunks/{chunk-6KB5XGKP.js → chunk-4XZ67B3M.js} +2 -2
- package/dist/chunks/{chunk-FWAUXNV2.js → chunk-625CBBTB.js} +2 -2
- package/dist/chunks/{chunk-W7JMWUGD.js → chunk-A54YZM6S.js} +13 -13
- package/dist/chunks/{chunk-WK6RNDIK.js → chunk-BCPKC2WP.js} +2 -2
- package/dist/chunks/{chunk-YIBJO76L.js → chunk-DMUQFCYZ.js} +2 -2
- package/dist/chunks/{chunk-ZNYLVJIS.js → chunk-FTVJAKCW.js} +3 -3
- package/dist/chunks/{chunk-WNVU6MMP.js → chunk-IZJ5JESH.js} +2 -2
- package/dist/chunks/{chunk-JWS3NQAH.js → chunk-JCIHE3LO.js} +4 -4
- package/dist/chunks/{chunk-J2JLP6NV.js → chunk-LJNIEZAF.js} +27 -8
- package/dist/chunks/{chunk-J2JLP6NV.js.map → chunk-LJNIEZAF.js.map} +1 -1
- package/dist/chunks/{chunk-Y2DDE2WB.js → chunk-NRFNUYVH.js} +3 -3
- package/dist/chunks/{chunk-IBTPIZKL.js → chunk-PRTQ2L3O.js} +8 -8
- package/dist/chunks/{chunk-MVMWAXEY.js → chunk-PVHTDN4J.js} +2 -2
- package/dist/chunks/{chunk-2ZYV3IZA.js → chunk-R3BEW6BX.js} +22 -22
- package/dist/chunks/{chunk-QZODMCBW.js → chunk-RX22HLIT.js} +2 -2
- package/dist/chunks/{chunk-FMBLLPNE.js → chunk-S2JWPUUH.js} +67 -1
- package/dist/chunks/{chunk-FMBLLPNE.js.map → chunk-S2JWPUUH.js.map} +1 -1
- package/dist/chunks/{chunk-SFAK4Z6T.js → chunk-SRHEX5JB.js} +3342 -1228
- package/dist/chunks/chunk-SRHEX5JB.js.map +6 -0
- package/dist/chunks/{chunk-N3LPO5PK.js → chunk-TITSLPYI.js} +11 -11
- package/dist/chunks/{chunk-F7MCS63F.js → chunk-UF6F2Z62.js} +3 -3
- package/dist/chunks/{chunk-6O5Q6YBP.js → chunk-UKOCGHMU.js} +489 -57
- package/dist/chunks/{chunk-6O5Q6YBP.js.map → chunk-UKOCGHMU.js.map} +2 -2
- package/dist/chunks/{chunk-4SEHD4ZI.js → chunk-USDNK4TL.js} +2 -2
- package/dist/chunks/{chunk-EJCQKJZ2.js → chunk-WD2F6EO3.js} +35 -3
- package/dist/chunks/chunk-WD2F6EO3.js.map +6 -0
- package/dist/chunks/{chunk-TEBW5NV3.js → chunk-WSEJK4WO.js} +3 -3
- package/dist/chunks/{chunk-GFEHVD2U.js → chunk-WZHS724Y.js} +2 -2
- package/dist/chunks/{chunk-JBC4TK56.js → chunk-YMMEAXUK.js} +2 -2
- package/dist/chunks/{chunk-47R3EA5L.js → chunk-ZDEQIXJX.js} +2 -2
- package/dist/chunks/{chunk-OIYJMKAT.js → chunk-ZIFCQKET.js} +2 -2
- package/dist/chunks/{cli-runtime-SWBSTK5Y.js → cli-runtime-J5E5XM6I.js} +7 -7
- package/dist/chunks/core-6GH4J4QJ.js +1647 -0
- package/dist/chunks/core-6GH4J4QJ.js.map +6 -0
- package/dist/chunks/cpp-VMCZSFFM.js +553 -0
- package/dist/chunks/cpp-VMCZSFFM.js.map +6 -0
- package/dist/chunks/csharp-OVPHVEVY.js +410 -0
- package/dist/chunks/csharp-OVPHVEVY.js.map +6 -0
- package/dist/chunks/css-RIXPOU7U.js +947 -0
- package/dist/chunks/css-RIXPOU7U.js.map +6 -0
- package/dist/chunks/diff-IP3Y64PF.js +63 -0
- package/dist/chunks/diff-IP3Y64PF.js.map +6 -0
- package/dist/chunks/dockerfile-DVPABFVZ.js +44 -0
- package/dist/chunks/dockerfile-DVPABFVZ.js.map +6 -0
- package/dist/chunks/{doctor-BO6742WI.js → doctor-TC5F3XFP.js} +20 -20
- package/dist/chunks/{drain-R55GDZ6K.js → drain-VINUZDH4.js} +2 -2
- package/dist/chunks/{entry-OIRUHLN6.js → entry-UEPUPWGI.js} +4 -4
- package/dist/chunks/{eval-LC2YEQE4.js → eval-YTQCMDNP.js} +5 -5
- package/dist/chunks/{exec-MVNCTFY2.js → exec-DGX427HX.js} +32 -32
- package/dist/chunks/go-RKN2IZ6A.js +164 -0
- package/dist/chunks/go-RKN2IZ6A.js.map +6 -0
- package/dist/chunks/graphql-2VQIML4V.js +80 -0
- package/dist/chunks/graphql-2VQIML4V.js.map +6 -0
- package/dist/chunks/{host-OJRB5UR4.js → host-KTD5OE67.js} +5 -5
- package/dist/chunks/{host-queries-BTUGRPDQ.js → host-queries-JPW6LDTA.js} +2 -2
- package/dist/chunks/ini-W63MIP5J.js +126 -0
- package/dist/chunks/ini-W63MIP5J.js.map +6 -0
- package/dist/chunks/java-R4N7OXMG.js +265 -0
- package/dist/chunks/java-R4N7OXMG.js.map +6 -0
- package/dist/chunks/javascript-26OKUOUQ.js +712 -0
- package/dist/chunks/javascript-26OKUOUQ.js.map +6 -0
- package/dist/chunks/json-4GADDWNK.js +50 -0
- package/dist/chunks/json-4GADDWNK.js.map +6 -0
- package/dist/chunks/kotlin-MB7RKXOG.js +265 -0
- package/dist/chunks/kotlin-MB7RKXOG.js.map +6 -0
- package/dist/chunks/{learn-L7W4AY6F.js → learn-VUJQOB57.js} +2 -2
- package/dist/chunks/{learn-builtin-F6D7VG2T.js → learn-builtin-POKSGCNI.js} +3 -3
- package/dist/chunks/less-GNSNU2PC.js +1028 -0
- package/dist/chunks/less-GNSNU2PC.js.map +6 -0
- package/dist/chunks/{lifecycle-VH5JVETC.js → lifecycle-7BOLGSXR.js} +11 -11
- package/dist/chunks/{list-O6NVVBVF.js → list-QTYDGVQY.js} +7 -7
- package/dist/chunks/{live-VMIC5YSV.js → live-WTDKDIAG.js} +19 -19
- package/dist/chunks/lua-RNOSKZ3S.js +71 -0
- package/dist/chunks/lua-RNOSKZ3S.js.map +6 -0
- package/dist/chunks/makefile-ZK3QWG3U.js +81 -0
- package/dist/chunks/makefile-ZK3QWG3U.js.map +6 -0
- package/dist/chunks/markdown-JVOBZC3L.js +242 -0
- package/dist/chunks/markdown-JVOBZC3L.js.map +6 -0
- package/dist/chunks/{mcp-SUQ5VHS3.js → mcp-6QVO6CF6.js} +5 -5
- package/dist/chunks/{message-command-D72XMTER.js → message-command-LZDQXRHW.js} +16 -16
- package/dist/chunks/objectivec-SSOLSTDI.js +253 -0
- package/dist/chunks/objectivec-SSOLSTDI.js.map +6 -0
- package/dist/chunks/{pal-IMTWZXWM.js → pal-EHDMM5XR.js} +3 -3
- package/dist/chunks/{palette-V2OJ6BIE.js → palette-GXE6GZA5.js} +4 -4
- package/dist/chunks/perl-G647IKFY.js +495 -0
- package/dist/chunks/perl-G647IKFY.js.map +6 -0
- package/dist/chunks/php-KMB36QTV.js +611 -0
- package/dist/chunks/php-KMB36QTV.js.map +6 -0
- package/dist/chunks/php-template-56RLSWZJ.js +56 -0
- package/dist/chunks/php-template-56RLSWZJ.js.map +6 -0
- package/dist/chunks/powershell-CPSUXW3K.js +266 -0
- package/dist/chunks/powershell-CPSUXW3K.js.map +6 -0
- package/dist/chunks/python-OSTRJJHH.js +425 -0
- package/dist/chunks/python-OSTRJJHH.js.map +6 -0
- package/dist/chunks/python-repl-LLFK2MIA.js +35 -0
- package/dist/chunks/python-repl-LLFK2MIA.js.map +6 -0
- package/dist/chunks/r-CJCHZ5CO.js +220 -0
- package/dist/chunks/r-CJCHZ5CO.js.map +6 -0
- package/dist/chunks/ruby-CFOXHYOD.js +423 -0
- package/dist/chunks/ruby-CFOXHYOD.js.map +6 -0
- package/dist/chunks/rust-2CAQW5OE.js +323 -0
- package/dist/chunks/rust-2CAQW5OE.js.map +6 -0
- package/dist/chunks/{schedule-CKRLCLZE.js → schedule-BLLPDUT7.js} +5 -5
- package/dist/chunks/scss-BWFJU4ST.js +932 -0
- package/dist/chunks/scss-BWFJU4ST.js.map +6 -0
- package/dist/chunks/{service-X3J6SDE6.js → service-E2JXIOD6.js} +10 -10
- package/dist/chunks/shell-DRNHCIHJ.js +34 -0
- package/dist/chunks/shell-DRNHCIHJ.js.map +6 -0
- package/dist/chunks/sql-QPNQXTYW.js +655 -0
- package/dist/chunks/sql-QPNQXTYW.js.map +6 -0
- package/dist/chunks/{start-check-U4TZS2VO.js → start-check-NHTTM354.js} +2 -2
- package/dist/chunks/swift-VA7FJ27U.js +890 -0
- package/dist/chunks/swift-VA7FJ27U.js.map +6 -0
- package/dist/chunks/{tui-C2YPD5ZD.js → tui-MYBPZUMK.js} +57 -681
- package/dist/chunks/tui-MYBPZUMK.js.map +6 -0
- package/dist/chunks/typescript-AD6TOU6X.js +826 -0
- package/dist/chunks/typescript-AD6TOU6X.js.map +6 -0
- package/dist/chunks/{upgrade-7AKSY32I.js → upgrade-LG2D66IY.js} +3 -3
- package/dist/chunks/vbnet-RRNEF3GL.js +143 -0
- package/dist/chunks/vbnet-RRNEF3GL.js.map +6 -0
- package/dist/chunks/wasm-4AFLPXP5.js +131 -0
- package/dist/chunks/wasm-4AFLPXP5.js.map +6 -0
- package/dist/chunks/{watch-X7HL77BT.js → watch-E5G5E7SZ.js} +77 -41
- package/dist/chunks/watch-E5G5E7SZ.js.map +6 -0
- package/dist/chunks/{workspaces-4BNGHUKR.js → workspaces-XNXMVP5C.js} +5 -5
- package/dist/chunks/xml-FZC4FVGO.js +236 -0
- package/dist/chunks/xml-FZC4FVGO.js.map +6 -0
- package/dist/chunks/yaml-KHJI72O5.js +211 -0
- package/dist/chunks/yaml-KHJI72O5.js.map +6 -0
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/config/load.d.ts +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +27 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/settings-descriptors.d.ts.map +1 -1
- package/dist/index.js +22 -22
- package/dist/integrations/sessions/watch-view.d.ts +10 -1
- package/dist/integrations/sessions/watch-view.d.ts.map +1 -1
- package/dist/tui/App.d.ts +4 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BackgroundAgentRows.d.ts.map +1 -1
- package/dist/tui/Markdown.d.ts +13 -3
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts +10 -0
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/TranscriptScrollView.d.ts.map +1 -1
- package/dist/tui/agent-calls.d.ts +49 -0
- package/dist/tui/agent-calls.d.ts.map +1 -0
- package/dist/tui/agent-transcript-rows.d.ts +17 -0
- package/dist/tui/agent-transcript-rows.d.ts.map +1 -1
- package/dist/tui/background-agents.d.ts +22 -2
- package/dist/tui/background-agents.d.ts.map +1 -1
- package/dist/tui/code-highlight.d.ts +222 -0
- package/dist/tui/code-highlight.d.ts.map +1 -0
- package/dist/tui/copy-targets.d.ts.map +1 -1
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts +13 -1
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts.map +1 -1
- package/dist/tui/fullscreen/glide.d.ts +87 -0
- package/dist/tui/fullscreen/glide.d.ts.map +1 -0
- package/dist/tui/fullscreen/layout.d.ts +10 -1
- package/dist/tui/fullscreen/layout.d.ts.map +1 -1
- package/dist/tui/fullscreen/markdown-rows.d.ts.map +1 -1
- package/dist/tui/fullscreen/rows.d.ts +6 -0
- package/dist/tui/fullscreen/rows.d.ts.map +1 -1
- package/dist/tui/fullscreen/selection.d.ts.map +1 -1
- package/dist/tui/fullscreen/viewport.d.ts +4 -1
- package/dist/tui/fullscreen/viewport.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/markdown-fence.d.ts +47 -0
- package/dist/tui/markdown-fence.d.ts.map +1 -0
- package/dist/tui/markdown-structure.d.ts +22 -0
- package/dist/tui/markdown-structure.d.ts.map +1 -1
- package/dist/tui/markdownParser.d.ts +8 -1
- package/dist/tui/markdownParser.d.ts.map +1 -1
- package/dist/tui/new-output.d.ts +60 -0
- package/dist/tui/new-output.d.ts.map +1 -0
- package/dist/tui/paint/live-paint.d.ts +39 -0
- package/dist/tui/paint/live-paint.d.ts.map +1 -1
- package/dist/tui/read-search-group.d.ts +24 -0
- package/dist/tui/read-search-group.d.ts.map +1 -1
- package/dist/tui/restored-rows.d.ts +26 -2
- package/dist/tui/restored-rows.d.ts.map +1 -1
- package/dist/tui/stream-flow.d.ts +24 -0
- package/dist/tui/stream-flow.d.ts.map +1 -1
- package/dist/tui/theme-launch.d.ts +2 -2
- package/dist/tui/theme-launch.d.ts.map +1 -1
- package/dist/tui/theme-palettes.d.ts +20 -0
- package/dist/tui/theme-palettes.d.ts.map +1 -1
- package/dist/tui/theme.d.ts +5 -0
- package/dist/tui/theme.d.ts.map +1 -1
- package/dist/tui/transcript-scroll.d.ts +7 -2
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/dist/tui/types.d.ts +9 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/chunks/chunk-EJCQKJZ2.js.map +0 -6
- package/dist/chunks/chunk-SFAK4Z6T.js.map +0 -6
- package/dist/chunks/tui-C2YPD5ZD.js.map +0 -6
- package/dist/chunks/watch-X7HL77BT.js.map +0 -6
- /package/dist/chunks/{add-VOR5M5BV.js.map → add-L6FKDP7N.js.map} +0 -0
- /package/dist/chunks/{agent-EWZGPBGI.js.map → agent-VJRVABX2.js.map} +0 -0
- /package/dist/chunks/{agent-session-EKTTB7TN.js.map → agent-session-JO5HEUHN.js.map} +0 -0
- /package/dist/chunks/{apply-at-exit-FVOHKVHQ.js.map → apply-at-exit-OGSLNQHX.js.map} +0 -0
- /package/dist/chunks/{bin-main-C5UNGSAQ.js.map → bin-main-XIAVK2BK.js.map} +0 -0
- /package/dist/chunks/{chat-YQCC2O5F.js.map → chat-AQICSI4M.js.map} +0 -0
- /package/dist/chunks/{chunk-F7LMCISP.js.map → chunk-33CQRXME.js.map} +0 -0
- /package/dist/chunks/{chunk-H6KPEFAR.js.map → chunk-47E6HKJT.js.map} +0 -0
- /package/dist/chunks/{chunk-6KB5XGKP.js.map → chunk-4XZ67B3M.js.map} +0 -0
- /package/dist/chunks/{chunk-FWAUXNV2.js.map → chunk-625CBBTB.js.map} +0 -0
- /package/dist/chunks/{chunk-W7JMWUGD.js.map → chunk-A54YZM6S.js.map} +0 -0
- /package/dist/chunks/{chunk-WK6RNDIK.js.map → chunk-BCPKC2WP.js.map} +0 -0
- /package/dist/chunks/{chunk-YIBJO76L.js.map → chunk-DMUQFCYZ.js.map} +0 -0
- /package/dist/chunks/{chunk-ZNYLVJIS.js.map → chunk-FTVJAKCW.js.map} +0 -0
- /package/dist/chunks/{chunk-WNVU6MMP.js.map → chunk-IZJ5JESH.js.map} +0 -0
- /package/dist/chunks/{chunk-JWS3NQAH.js.map → chunk-JCIHE3LO.js.map} +0 -0
- /package/dist/chunks/{chunk-Y2DDE2WB.js.map → chunk-NRFNUYVH.js.map} +0 -0
- /package/dist/chunks/{chunk-IBTPIZKL.js.map → chunk-PRTQ2L3O.js.map} +0 -0
- /package/dist/chunks/{chunk-MVMWAXEY.js.map → chunk-PVHTDN4J.js.map} +0 -0
- /package/dist/chunks/{chunk-2ZYV3IZA.js.map → chunk-R3BEW6BX.js.map} +0 -0
- /package/dist/chunks/{chunk-QZODMCBW.js.map → chunk-RX22HLIT.js.map} +0 -0
- /package/dist/chunks/{chunk-N3LPO5PK.js.map → chunk-TITSLPYI.js.map} +0 -0
- /package/dist/chunks/{chunk-F7MCS63F.js.map → chunk-UF6F2Z62.js.map} +0 -0
- /package/dist/chunks/{chunk-4SEHD4ZI.js.map → chunk-USDNK4TL.js.map} +0 -0
- /package/dist/chunks/{chunk-TEBW5NV3.js.map → chunk-WSEJK4WO.js.map} +0 -0
- /package/dist/chunks/{chunk-GFEHVD2U.js.map → chunk-WZHS724Y.js.map} +0 -0
- /package/dist/chunks/{chunk-JBC4TK56.js.map → chunk-YMMEAXUK.js.map} +0 -0
- /package/dist/chunks/{chunk-47R3EA5L.js.map → chunk-ZDEQIXJX.js.map} +0 -0
- /package/dist/chunks/{chunk-OIYJMKAT.js.map → chunk-ZIFCQKET.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-SWBSTK5Y.js.map → cli-runtime-J5E5XM6I.js.map} +0 -0
- /package/dist/chunks/{doctor-BO6742WI.js.map → doctor-TC5F3XFP.js.map} +0 -0
- /package/dist/chunks/{drain-R55GDZ6K.js.map → drain-VINUZDH4.js.map} +0 -0
- /package/dist/chunks/{entry-OIRUHLN6.js.map → entry-UEPUPWGI.js.map} +0 -0
- /package/dist/chunks/{eval-LC2YEQE4.js.map → eval-YTQCMDNP.js.map} +0 -0
- /package/dist/chunks/{exec-MVNCTFY2.js.map → exec-DGX427HX.js.map} +0 -0
- /package/dist/chunks/{host-OJRB5UR4.js.map → host-KTD5OE67.js.map} +0 -0
- /package/dist/chunks/{host-queries-BTUGRPDQ.js.map → host-queries-JPW6LDTA.js.map} +0 -0
- /package/dist/chunks/{learn-L7W4AY6F.js.map → learn-VUJQOB57.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-F6D7VG2T.js.map → learn-builtin-POKSGCNI.js.map} +0 -0
- /package/dist/chunks/{lifecycle-VH5JVETC.js.map → lifecycle-7BOLGSXR.js.map} +0 -0
- /package/dist/chunks/{list-O6NVVBVF.js.map → list-QTYDGVQY.js.map} +0 -0
- /package/dist/chunks/{live-VMIC5YSV.js.map → live-WTDKDIAG.js.map} +0 -0
- /package/dist/chunks/{mcp-SUQ5VHS3.js.map → mcp-6QVO6CF6.js.map} +0 -0
- /package/dist/chunks/{message-command-D72XMTER.js.map → message-command-LZDQXRHW.js.map} +0 -0
- /package/dist/chunks/{pal-IMTWZXWM.js.map → pal-EHDMM5XR.js.map} +0 -0
- /package/dist/chunks/{palette-V2OJ6BIE.js.map → palette-GXE6GZA5.js.map} +0 -0
- /package/dist/chunks/{schedule-CKRLCLZE.js.map → schedule-BLLPDUT7.js.map} +0 -0
- /package/dist/chunks/{service-X3J6SDE6.js.map → service-E2JXIOD6.js.map} +0 -0
- /package/dist/chunks/{start-check-U4TZS2VO.js.map → start-check-NHTTM354.js.map} +0 -0
- /package/dist/chunks/{upgrade-7AKSY32I.js.map → upgrade-LG2D66IY.js.map} +0 -0
- /package/dist/chunks/{workspaces-4BNGHUKR.js.map → workspaces-XNXMVP5C.js.map} +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax colour for the code blocks of a reply.
|
|
3
|
+
*
|
|
4
|
+
* The colouring is done by the open-source library highlight.js, which is read in
|
|
5
|
+
* pieces: its small core and then one grammar per language, each behind its own
|
|
6
|
+
* dynamic `import()` so that each is a file of its own in the bundle and nothing of
|
|
7
|
+
* it is loaded before a reply holds a block in that language. A person who never sees
|
|
8
|
+
* a fenced block never pays for any of it.
|
|
9
|
+
*
|
|
10
|
+
* ## What this module promises
|
|
11
|
+
*
|
|
12
|
+
* - **The text is never touched.** What comes back is the line it was given, cut into
|
|
13
|
+
* runs; the runs put together are exactly the line. When the library hands back
|
|
14
|
+
* anything else the block is drawn plain (see {@link colourLines}).
|
|
15
|
+
* - **Loading is not a race anyone can see.** {@link grammarState} says `loading` until
|
|
16
|
+
* the grammar has arrived or has failed, and the printing side holds a block's rows
|
|
17
|
+
* for as long as that lasts (never more than {@link GRAMMAR_WAIT_MS}). A grammar that
|
|
18
|
+
* cannot be read, or throws, is plain for the rest of the session, with nothing said.
|
|
19
|
+
* - **The cost is bounded.** A block is cut into windows and a window is only extended
|
|
20
|
+
* while the library is inside something that has not closed (a comment, a template,
|
|
21
|
+
* a docstring). Three prefix rules (one line, one block, one reply) end the colouring
|
|
22
|
+
* at a line; every one of them is a rule about what is above a line, so a line gets
|
|
23
|
+
* the same colours whether the block was drawn whole or one part at a time.
|
|
24
|
+
*
|
|
25
|
+
* ## The set of languages
|
|
26
|
+
*
|
|
27
|
+
* The library's own "common" set (the grammars its default build ships), plus
|
|
28
|
+
* `dockerfile` and `powershell`, and the short names people write after the fence.
|
|
29
|
+
* Every grammar listed here has been run against the stress inputs in
|
|
30
|
+
* `code-highlight-stress.test.ts`; adding one means adding it there first. The grammars
|
|
31
|
+
* that a grammar embeds (`xml` in `markdown`, `bash` in a shell session) are loaded
|
|
32
|
+
* with it; the ones it only embeds for tagged templates (CSS, GraphQL and HTML inside a
|
|
33
|
+
* JavaScript template literal) are not loaded, and that text stays in the normal colour.
|
|
34
|
+
*
|
|
35
|
+
* Pure apart from the module state that holds what has been loaded.
|
|
36
|
+
*/
|
|
37
|
+
import type { LanguageFn } from 'highlight.js';
|
|
38
|
+
/** What a run of code is, as far as colour goes. Everything else is the normal text colour. */
|
|
39
|
+
export type CodeKind = 'keyword' | 'string' | 'number' | 'comment' | 'name' | 'type' | 'literal' | 'added' | 'removed';
|
|
40
|
+
/** A run of one line, in one kind (or none: the normal colour). */
|
|
41
|
+
export interface CodeRun {
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly kind?: CodeKind;
|
|
44
|
+
}
|
|
45
|
+
/** One line of code as runs; the runs put together are the line. */
|
|
46
|
+
export type CodeLine = readonly CodeRun[];
|
|
47
|
+
/**
|
|
48
|
+
* What a reply's drawing of one code block starts from. It is carried from one printed
|
|
49
|
+
* part of a reply to the next, because a part is drawn on its own and cannot look at the
|
|
50
|
+
* lines above it.
|
|
51
|
+
*/
|
|
52
|
+
export interface CodeFlow {
|
|
53
|
+
/**
|
|
54
|
+
* The lines of the open block that the library has to read again to colour the next
|
|
55
|
+
* ones: from the last line the library was between tokens on, to the end of what has
|
|
56
|
+
* been printed. Empty most of the time. `STOPPED` once an open construct has outgrown
|
|
57
|
+
* {@link OPEN_LIMIT}.
|
|
58
|
+
*/
|
|
59
|
+
readonly above: string;
|
|
60
|
+
/** Characters of fenced code in the reply before this part. */
|
|
61
|
+
readonly spent: number;
|
|
62
|
+
/** Characters of the open block before this part. */
|
|
63
|
+
readonly block: number;
|
|
64
|
+
}
|
|
65
|
+
export declare const NO_FLOW: CodeFlow;
|
|
66
|
+
/** The `above` of a block whose colouring has ended: the rest of it is drawn plain. */
|
|
67
|
+
export declare const STOPPED = "\0stopped";
|
|
68
|
+
/** A line longer than this ends the colouring of its block (it is minified or a data blob). */
|
|
69
|
+
export declare const MAX_LINE_CHARS = 400;
|
|
70
|
+
/** A line with an unbroken run of word characters longer than this is a blob, not code. */
|
|
71
|
+
export declare const MAX_WORD_RUN = 100;
|
|
72
|
+
/** Characters of one block that are coloured; the rest is drawn plain. */
|
|
73
|
+
export declare const MAX_BLOCK_CHARS = 80000;
|
|
74
|
+
/** Characters of fenced code in one reply that are coloured. */
|
|
75
|
+
export declare const MAX_REPLY_CHARS = 250000;
|
|
76
|
+
/** The longest stretch of an unclosed comment, string or template that is followed. */
|
|
77
|
+
export declare const OPEN_LIMIT = 8000;
|
|
78
|
+
/** The longest a block may wait for its grammar before it is drawn plain for good. */
|
|
79
|
+
export declare const GRAMMAR_WAIT_MS = 1500;
|
|
80
|
+
/**
|
|
81
|
+
* How many leading lines of `lines` are inside the limits, given what the reply and the
|
|
82
|
+
* block have spent above them. Pure: the answer for a line depends only on what is above it.
|
|
83
|
+
*/
|
|
84
|
+
export declare function colourableLines(lines: readonly string[], flow?: Pick<CodeFlow, 'spent' | 'block'>, word?: string): number;
|
|
85
|
+
type Module = {
|
|
86
|
+
readonly default: LanguageFn;
|
|
87
|
+
};
|
|
88
|
+
/** One loader per grammar, each a literal `import()` so the bundler makes a chunk of it. */
|
|
89
|
+
declare const LOADERS: {
|
|
90
|
+
readonly bash: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
91
|
+
readonly c: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
92
|
+
readonly cpp: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
93
|
+
readonly csharp: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
94
|
+
readonly css: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
95
|
+
readonly diff: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
96
|
+
readonly dockerfile: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
97
|
+
readonly go: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
98
|
+
readonly graphql: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
99
|
+
readonly ini: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
100
|
+
readonly java: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
101
|
+
readonly javascript: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
102
|
+
readonly json: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
103
|
+
readonly kotlin: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
104
|
+
readonly less: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
105
|
+
readonly lua: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
106
|
+
readonly makefile: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
107
|
+
readonly markdown: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
108
|
+
readonly objectivec: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
109
|
+
readonly perl: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
110
|
+
readonly php: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
111
|
+
readonly 'php-template': () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
112
|
+
readonly powershell: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
113
|
+
readonly python: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
114
|
+
readonly 'python-repl': () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
115
|
+
readonly r: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
116
|
+
readonly ruby: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
117
|
+
readonly rust: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
118
|
+
readonly scss: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
119
|
+
readonly shell: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
120
|
+
readonly sql: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
121
|
+
readonly swift: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
122
|
+
readonly typescript: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
123
|
+
readonly vbnet: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
124
|
+
readonly wasm: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
125
|
+
readonly xml: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
126
|
+
readonly yaml: () => Promise<typeof import("highlight.js/lib/languages/*")>;
|
|
127
|
+
};
|
|
128
|
+
export type GrammarId = keyof typeof LOADERS;
|
|
129
|
+
/** Every language word this module draws in colour. */
|
|
130
|
+
export declare const KNOWN_LANGUAGE_WORDS: readonly string[];
|
|
131
|
+
/** The grammar a fence's language word names, or `undefined` for none, an unknown word or a plain-text one. */
|
|
132
|
+
export declare function grammarOf(word: string | undefined): GrammarId | undefined;
|
|
133
|
+
/** `tui.syntaxHighlight`: false draws every code block as it was drawn before there was colour. */
|
|
134
|
+
export declare function setSyntaxHighlight(on: boolean): void;
|
|
135
|
+
export declare function syntaxHighlightOn(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether code is coloured on this terminal: not under `NO_COLOR`, `FORCE_COLOR=0`, a
|
|
138
|
+
* dumb terminal, a CI run that did not force colour, or where nothing is drawn on a
|
|
139
|
+
* terminal at all. Where it is false no highlighting is done, not just no colour written.
|
|
140
|
+
*/
|
|
141
|
+
export declare function colourWanted(env?: NodeJS.ProcessEnv, isTty?: boolean): boolean;
|
|
142
|
+
/** For `useSyncExternalStore`: called when a grammar has arrived, has failed, or the setting changed. */
|
|
143
|
+
export declare function subscribeGrammars(listener: () => void): () => void;
|
|
144
|
+
/** Changes whenever {@link subscribeGrammars} would call back. */
|
|
145
|
+
export declare function grammarVersion(): number;
|
|
146
|
+
/**
|
|
147
|
+
* Whether a block that names `word` is drawn in colour now (`ready`), waits for its
|
|
148
|
+
* grammar (`loading`: the printing side holds its rows), or is drawn plain (`plain`:
|
|
149
|
+
* no such language, plain text, the setting off, no colour on this terminal, or a
|
|
150
|
+
* grammar that could not be read). Asking starts the read.
|
|
151
|
+
*/
|
|
152
|
+
export declare function grammarState(word: string | undefined): 'plain' | 'loading' | 'ready';
|
|
153
|
+
/** Resolves when every grammar the words name has arrived or failed. Never rejects. */
|
|
154
|
+
export declare function whenGrammarsSettle(words: Iterable<string | undefined>): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* The language words of the fenced blocks in a piece of Markdown source, for loading
|
|
157
|
+
* them before it is printed. Cheap: nothing is parsed, a line is looked at only when it
|
|
158
|
+
* begins with a fence.
|
|
159
|
+
*/
|
|
160
|
+
export declare function languagesIn(source: string): string[];
|
|
161
|
+
/** For measuring: called after every call of the library with its size and its time. */
|
|
162
|
+
export declare function observeLibraryCalls(fn: ((id: GrammarId, chars: number, ms: number) => void) | undefined): void;
|
|
163
|
+
export interface Coloured {
|
|
164
|
+
/**
|
|
165
|
+
* The runs of the leading lines of the block, as many as the limits allow (and an
|
|
166
|
+
* unclosed construct longer than {@link OPEN_LIMIT} ends them early). The lines after
|
|
167
|
+
* are drawn plain.
|
|
168
|
+
*/
|
|
169
|
+
readonly lines: readonly CodeLine[];
|
|
170
|
+
/** What the next part of the block starts from, if the block goes on. */
|
|
171
|
+
readonly above: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The runs of the leading lines of a block, or `undefined` when it is drawn plain: the
|
|
175
|
+
* language is not one that is ready, the setting or the terminal says no colour, or the
|
|
176
|
+
* first line is already past a limit.
|
|
177
|
+
*
|
|
178
|
+
* `flow.above` is the open lines above `lines` that the library must read first (a
|
|
179
|
+
* printed part of a block carries them); the runs returned are for `lines` only. A block
|
|
180
|
+
* drawn whole, and the same block drawn a part at a time, give the same runs for a line
|
|
181
|
+
* as long as no unclosed construct above it is longer than {@link OPEN_LIMIT}.
|
|
182
|
+
*
|
|
183
|
+
* The block is remembered: drawn again whole it costs a lookup, and a block that grows
|
|
184
|
+
* (the one being written) is read again only from its last closed window.
|
|
185
|
+
*/
|
|
186
|
+
export declare function colourLines(word: string | undefined, lines: readonly string[], flow?: CodeFlow): Coloured | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* What the part of a block that follows `lines` starts from. Called as a reply is cut
|
|
189
|
+
* into printed parts, with the lines the part just printed holds.
|
|
190
|
+
*/
|
|
191
|
+
export declare function flowAfter(word: string | undefined, flow: CodeFlow, lines: readonly string[]): CodeFlow;
|
|
192
|
+
/**
|
|
193
|
+
* The runs of a line that a wrap cut into `pieces`: each piece's own characters in the
|
|
194
|
+
* kinds the line gave them. A wrapper may drop the blanks it broke at, so each piece is
|
|
195
|
+
* found in the line after the one before; a piece that cannot be found is `undefined`
|
|
196
|
+
* (drawn plain) rather than guessed at.
|
|
197
|
+
*/
|
|
198
|
+
export declare function runsForPieces(line: string, runs: CodeLine, pieces: readonly string[]): (CodeLine | undefined)[];
|
|
199
|
+
/**
|
|
200
|
+
* What a reply that is printed while it is written asks of the colouring (see
|
|
201
|
+
* `CodeHooks` in `stream-flow.ts`): whether a language is ready, what a printed part
|
|
202
|
+
* leaves for the next, and a nudge to start reading the grammars of fences that have
|
|
203
|
+
* just been written.
|
|
204
|
+
*/
|
|
205
|
+
export declare const codeFlowHooks: {
|
|
206
|
+
ready: (word: string | undefined) => boolean;
|
|
207
|
+
next: typeof flowAfter;
|
|
208
|
+
opened: (lines: string) => void;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The whole of `lines` read in one call of the library, with no window, no limit and no
|
|
212
|
+
* memory: what a block would be given if it were never cut. For tests, which hold the
|
|
213
|
+
* windowed and the part-by-part colouring to it.
|
|
214
|
+
*/
|
|
215
|
+
export declare function readInOneCall(word: string | undefined, lines: readonly string[]): CodeLine[] | undefined;
|
|
216
|
+
/** Forget what has been read and loaded; for tests. */
|
|
217
|
+
export declare function resetCodeHighlightForTests(options?: {
|
|
218
|
+
loaders?: Partial<Record<GrammarId, () => Promise<Module>>>;
|
|
219
|
+
waitMs?: number;
|
|
220
|
+
}): void;
|
|
221
|
+
export {};
|
|
222
|
+
//# sourceMappingURL=code-highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-highlight.d.ts","sourceRoot":"","sources":["../../src/tui/code-highlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,cAAc,CAAA;AAEvD,+FAA+F;AAC/F,MAAM,MAAM,QAAQ,GACjB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,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Root":"","sources":["../../src/tui/copy-targets.ts"],"names":[],"mappings":"AAEA,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnF;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACxE;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAmBlF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,kBAAkB,EAAE,CAgEpF;AAgGD,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,CAiB3E"}
|
|
@@ -51,8 +51,20 @@ export interface FullscreenTranscriptProps {
|
|
|
51
51
|
readonly control: {
|
|
52
52
|
current: FullscreenControl | null;
|
|
53
53
|
};
|
|
54
|
+
/** Rows a slow wheel notch moves (`tui.wheelRows`); 3 when absent. */
|
|
55
|
+
readonly wheelRows?: number;
|
|
56
|
+
/** Whether a fast run of notches speeds up (`tui.wheelAccel`); on when absent. */
|
|
57
|
+
readonly wheelAccel?: boolean;
|
|
54
58
|
/** Milliseconds a note stays; a test passes its own scheduler. */
|
|
55
59
|
readonly noteMs?: number;
|
|
60
|
+
/** The clock the wheel reads and schedules its frames on; a test passes its own. */
|
|
61
|
+
readonly clock?: WheelClock;
|
|
62
|
+
}
|
|
63
|
+
/** What the wheel needs of time: the hour, and a way to run something a moment later. */
|
|
64
|
+
export interface WheelClock {
|
|
65
|
+
now(): number;
|
|
66
|
+
/** Runs `run` after `ms`; the returned function cancels it. */
|
|
67
|
+
after(run: () => void, ms: number): () => void;
|
|
56
68
|
}
|
|
57
69
|
/**
|
|
58
70
|
* The conversation on the alternate screen: a window onto the rows, not the
|
|
@@ -69,5 +81,5 @@ export interface FullscreenTranscriptProps {
|
|
|
69
81
|
* pointer is reported in full, a click on a folded row opens it in place and a
|
|
70
82
|
* click on it again folds it.
|
|
71
83
|
*/
|
|
72
|
-
export declare function FullscreenTranscript({ messages, pending, pendingAt, columns, maxRows, header, hidden, keysActive, homeEndActive, subscribeWheel, subscribePointer, copy, copyOnSelect, onSearchChange, control, noteMs, }: FullscreenTranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export declare function FullscreenTranscript({ messages, pending, pendingAt, columns, maxRows, header, hidden, keysActive, homeEndActive, subscribeWheel, subscribePointer, copy, copyOnSelect, onSearchChange, control, noteMs, clock, wheelRows, wheelAccel, }: FullscreenTranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
73
85
|
//# sourceMappingURL=FullscreenTranscript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullscreenTranscript.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/FullscreenTranscript.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"FullscreenTranscript.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/FullscreenTranscript.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AAezF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,C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
2
|
+
* How the wheel moves the fullscreen view: every notch adds to a distance still
|
|
3
|
+
* to travel, a fast run of notches adds more per notch, and the view spends the
|
|
4
|
+
* distance over the next few frames. Pure arithmetic over a state and a clock
|
|
5
|
+
* reading, so the table of cases is tested without a terminal or a timer.
|
|
6
|
+
*
|
|
7
|
+
* Every number that sets the feel is in `WHEEL_FEEL`; nothing else in the code
|
|
8
|
+
* and no test repeats them.
|
|
9
|
+
*/
|
|
10
|
+
/** The numbers that set how the wheel feels. The docs carry the same table. */
|
|
11
|
+
export declare const WHEEL_FEEL: {
|
|
12
|
+
/** Rows a slow notch moves (`tui.wheelRows` replaces it). */
|
|
13
|
+
readonly rows: 3;
|
|
14
|
+
/** Fewest and most rows a notch may be set to. */
|
|
15
|
+
readonly minRows: 1;
|
|
16
|
+
readonly maxRows: 20;
|
|
17
|
+
/** Notches closer together than this belong to one fast run. */
|
|
18
|
+
readonly runGapMs: 120;
|
|
19
|
+
/**
|
|
20
|
+
* Reports this close together are one turn of the wheel: a terminal that sends
|
|
21
|
+
* several reports per notch sends them in one write. They add the plain step
|
|
22
|
+
* each and do not count as a faster run.
|
|
23
|
+
*/
|
|
24
|
+
readonly burstMs: 2;
|
|
25
|
+
/** A gap this long or longer ends the run: the next notch is a plain step. */
|
|
26
|
+
readonly pauseMs: 500;
|
|
27
|
+
/** Notches in a run at which a notch has reached its ceiling of one window less a row. */
|
|
28
|
+
readonly fullRun: 9;
|
|
29
|
+
/** A run this long may have one stray notch the other way without losing it. */
|
|
30
|
+
readonly bounceRun: 3;
|
|
31
|
+
/** The distance to travel never runs more than this many windows ahead of the view, so it stops soon after the hand does. */
|
|
32
|
+
readonly maxAheadWindows: 4;
|
|
33
|
+
/** The share of the distance left that one frame covers. */
|
|
34
|
+
readonly share: 0.5;
|
|
35
|
+
/** At or under this many rows left, one frame covers all of it and lands exactly. */
|
|
36
|
+
readonly landRows: 2;
|
|
37
|
+
/**
|
|
38
|
+
* Milliseconds between frames while a distance remains. The renderer paints at
|
|
39
|
+
* most 30 times a second through two throttles in a row, so a frame at its own
|
|
40
|
+
* rate can land inside the window and wait for the next: 68 ms painted, two
|
|
41
|
+
* frames in one paint. A frame period this much longer than 34 ms paints each
|
|
42
|
+
* frame on its own.
|
|
43
|
+
*/
|
|
44
|
+
readonly frameMs: 44;
|
|
45
|
+
};
|
|
46
|
+
export interface WheelSettings {
|
|
47
|
+
/** Rows a slow notch moves. */
|
|
48
|
+
readonly rows: number;
|
|
49
|
+
/** A fast run speeds up; off, every notch is the plain step. */
|
|
50
|
+
readonly accel: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare const DEFAULT_WHEEL: WheelSettings;
|
|
53
|
+
/** The rows a setting asks for, kept inside what is allowed. */
|
|
54
|
+
export declare function clampWheelRows(rows: number): number;
|
|
55
|
+
export interface WheelState {
|
|
56
|
+
/** Signed rows still to travel: down is positive. */
|
|
57
|
+
readonly pending: number;
|
|
58
|
+
/** Fast notches in a row, before this one. */
|
|
59
|
+
readonly run: number;
|
|
60
|
+
/** The direction of the run; 0 before the first notch. */
|
|
61
|
+
readonly dir: -1 | 0 | 1;
|
|
62
|
+
/** When the last notch arrived; null before the first. */
|
|
63
|
+
readonly at: number | null;
|
|
64
|
+
/** A single notch the other way inside a run, held back until the next notch says what it was. */
|
|
65
|
+
readonly stray: -1 | 1 | null;
|
|
66
|
+
}
|
|
67
|
+
export declare const WHEEL_IDLE: WheelState;
|
|
68
|
+
/** Rows one notch moves in a run of `run` notches: the plain step, rising smoothly to a window less a row. */
|
|
69
|
+
export declare function notchRows(run: number, settings: WheelSettings, window: number): number;
|
|
70
|
+
/**
|
|
71
|
+
* One notch. `window` is the rows the view shows. Several notches in one input
|
|
72
|
+
* chunk are several calls with the same `now`, and they add up.
|
|
73
|
+
*/
|
|
74
|
+
export declare function notch(state: WheelState, direction: 'up' | 'down', now: number, settings: WheelSettings, window: number): WheelState;
|
|
75
|
+
/**
|
|
76
|
+
* The next frame of a glide: how many rows (signed) the view moves now, and the
|
|
77
|
+
* state after. A large distance is covered by shares; a small one all at once,
|
|
78
|
+
* so the last frame lands exactly. One frame never moves more than a window
|
|
79
|
+
* less a row.
|
|
80
|
+
*/
|
|
81
|
+
export declare function frame(state: WheelState, window: number): {
|
|
82
|
+
step: number;
|
|
83
|
+
state: WheelState;
|
|
84
|
+
};
|
|
85
|
+
/** The state with nothing left to travel: the run and direction are kept. */
|
|
86
|
+
export declare function settle(state: WheelState): WheelState;
|
|
87
|
+
//# sourceMappingURL=glide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glide.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/glide.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,+EAA+E;AAC/E,eAAO,MAAM,UAAU;IACtB,6DAA6D;;IAE7D,kDAAkD;;;IAGlD,gEAAgE;;IAEhE;;;;OAIG;;IAEH,8EAA8E;;IAE9E,0FAA0F;;IAE1F,gFAAgF;;IAEhF,6HAA6H;;IAE7H,4DAA4D;;IAE5D,qFAAqF;;IAErF;;;;;;OAMG;;CAEM,CAAA;AAEV,MAAM,WAAW,aAAa;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,aAAsD,CAAA;AAElF,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,MAAM,WAAW,UAAU;IAC1B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,kGAAkG;IAClG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;CAC7B;AAED,eAAO,MAAM,UAAU,EAAE,UAAkE,CAAA;AAE3F,8GAA8G;AAC9G,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMtF;AAED;;;GAGG;AACH,wBAAgB,KAAK,CACpB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,GACZ,UAAU,CAiCZ;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAW5F;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAEpD"}
|
|
@@ -54,10 +54,19 @@ export interface ClickView {
|
|
|
54
54
|
readonly click: boolean;
|
|
55
55
|
readonly open: ReadonlySet<string>;
|
|
56
56
|
}
|
|
57
|
+
/** The rule drawn above the first reply the reader has not seen. */
|
|
58
|
+
export interface UnseenMark {
|
|
59
|
+
/** Id of the message the rule stands above. */
|
|
60
|
+
readonly before: string;
|
|
61
|
+
/** How many replies are new, for the rule's words. */
|
|
62
|
+
readonly count: number;
|
|
63
|
+
}
|
|
64
|
+
/** The id the rule's own entry in the row index carries; no message has it. */
|
|
65
|
+
export declare const MARK_ID = "\0new-replies";
|
|
57
66
|
/**
|
|
58
67
|
* Lay the conversation out at `columns`. The streaming reply stands at
|
|
59
68
|
* `pendingAt`, as in the live transcript, so no row moves when it finishes.
|
|
60
69
|
*/
|
|
61
|
-
export declare function layoutTranscript(messages: readonly TranscriptMessage[], pending: TranscriptMessage | null, pendingAt: number | undefined, columns: number, cache: LayoutCache, view?: ClickView): FullscreenLayout;
|
|
70
|
+
export declare function layoutTranscript(messages: readonly TranscriptMessage[], pending: TranscriptMessage | null, pendingAt: number | undefined, columns: number, cache: LayoutCache, view?: ClickView, unseen?: UnseenMark | null): FullscreenLayout;
|
|
62
71
|
export {};
|
|
63
72
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGpD,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,eAAe,CAAA;AAE5D,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAA;CAC/B;AAED,UAAU,MAAM;IACf,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,KAAK,EAAE,CAA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
-
{"version":3,"file":"markdown-rows.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/markdown-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"markdown-rows.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/markdown-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,UAAU,EAAa,MAAM,WAAW,CAAA;AAEnE,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAuLD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAEtF"}
|
|
@@ -33,6 +33,12 @@ export interface FsRow extends ScrollRow {
|
|
|
33
33
|
readonly lead: number;
|
|
34
34
|
/** A click on this row opens its message in place, or folds it when it is open. */
|
|
35
35
|
readonly opens?: true;
|
|
36
|
+
/**
|
|
37
|
+
* A quiet rule drawn across the row, which is no text: `text` is empty, so a
|
|
38
|
+
* search does not find it and a copy does not take it. It marks where the
|
|
39
|
+
* replies the reader has not seen begin.
|
|
40
|
+
*/
|
|
41
|
+
readonly mark?: string;
|
|
36
42
|
}
|
|
37
43
|
export declare function plainRow(row: ScrollRow, joins?: Joiner | null): FsRow;
|
|
38
44
|
export declare function spansText(spans: readonly StyledSpan[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/rows.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH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;CAAE,GAC9C;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAE/B,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAUjE"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* resize re-wraps every message, so a row number would land somewhere else;
|
|
14
14
|
* the message the reader was looking at is still there.
|
|
15
15
|
*/
|
|
16
|
+
import { type HintWords, type News } from '../new-output.js';
|
|
16
17
|
/** Where one message's rows start in the flat row list. */
|
|
17
18
|
export interface RowIndex {
|
|
18
19
|
/** Message ids, oldest first. */
|
|
@@ -99,11 +100,13 @@ export declare function visibleRange(state: ViewState, index: RowIndex, limit: n
|
|
|
99
100
|
readonly from: number;
|
|
100
101
|
readonly to: number;
|
|
101
102
|
};
|
|
103
|
+
/** What the jump hint calls the move and the key that makes it. */
|
|
104
|
+
export declare const JUMP_WORDS: HintWords;
|
|
102
105
|
/**
|
|
103
106
|
* The one row above the composer while scrolled up: the first label that fits,
|
|
104
107
|
* so it shortens before it ever wraps. Null only when not even the arrow fits.
|
|
105
108
|
*/
|
|
106
|
-
export declare function jumpHint(columns: number,
|
|
109
|
+
export declare function jumpHint(columns: number, news?: News): string | null;
|
|
107
110
|
/**
|
|
108
111
|
* Bring flat row `row` into view. A row already in the window leaves the state
|
|
109
112
|
* as it is; otherwise the window moves to put the row about in its middle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../../src/tui/fullscreen/viewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;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,EACf,OAAO,GAAE;IAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;CAAO,GACvE,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAkCH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAO5C,wBAAsB,SAAS,CAC9B,GAAG,EAAE,UAAU,EACf,OAAO,GAAE;IAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;CAAO,GACvE,OAAO,CAAC,IAAI,CAAC,CA+Qf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one grammar of a fenced code block, shared by everything that reads a
|
|
3
|
+
* reply: the parser, the streaming view, the fullscreen rows and `/copy`.
|
|
4
|
+
*
|
|
5
|
+
* - An opening fence is three or more backticks or three or more tildes,
|
|
6
|
+
* indented, followed by an optional info string. The info string of a
|
|
7
|
+
* backtick fence holds no backtick (otherwise the line is inline code).
|
|
8
|
+
* - The language is the first word of the info string; the rest (a title, a
|
|
9
|
+
* file name, attributes) is not read.
|
|
10
|
+
* - The block closes at a fence of the same character, at least as long as the
|
|
11
|
+
* opener, with nothing after it, or at the end of the text.
|
|
12
|
+
* - Content lines lose the opener's indentation and nothing else.
|
|
13
|
+
*
|
|
14
|
+
* Indentation: a fence is indented to the column of its container (the content
|
|
15
|
+
* column of a list item, the text after a `>`). The block model has no
|
|
16
|
+
* container to measure from, so any indentation opens a fence, and a closing
|
|
17
|
+
* fence may sit up to three columns deeper than the opener. A fence indented
|
|
18
|
+
* four columns or more outside a list is a fence here, where CommonMark would
|
|
19
|
+
* read an indented code block; a reply written by a model does not use the
|
|
20
|
+
* second form to hold a fence.
|
|
21
|
+
*
|
|
22
|
+
* Pure and dependency-free: `parseBlock` must stay a function of its segment.
|
|
23
|
+
*/
|
|
24
|
+
export interface FenceOpener {
|
|
25
|
+
readonly char: '`' | '~';
|
|
26
|
+
/** How many fence characters opened the block. */
|
|
27
|
+
readonly length: number;
|
|
28
|
+
/** The opener's indentation in columns (a tab counts four). */
|
|
29
|
+
readonly indent: number;
|
|
30
|
+
/** The first word of the info string, when there is one. */
|
|
31
|
+
readonly lang?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Columns taken by leading whitespace. */
|
|
34
|
+
export declare function indentColumns(space: string): number;
|
|
35
|
+
/** The opening fence a line is, or null when the line is not one. */
|
|
36
|
+
export declare function openingFence(line: string): FenceOpener | null;
|
|
37
|
+
/** Whether `line` closes a block `opener` opened. */
|
|
38
|
+
export declare function closesFence(line: string, opener: FenceOpener): boolean;
|
|
39
|
+
/** A content line with the opener's indentation taken off, and nothing else. */
|
|
40
|
+
export declare function stripFenceIndent(line: string, indent: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* The opener as one line of its own, for a block continued after a part of it
|
|
43
|
+
* was printed: the rest of the block reads as the block it was, with the same
|
|
44
|
+
* fence character and length and the same indentation.
|
|
45
|
+
*/
|
|
46
|
+
export declare function openerLine(opener: FenceOpener): string;
|
|
47
|
+
//# sourceMappingURL=markdown-fence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-fence.d.ts","sourceRoot":"","sources":["../../src/tui/markdown-fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAAA;IACxB,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,2CAA2C;AAC3C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAa7D;AAED,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAStE;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWrE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEtD"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* (`fullscreen/markdown-rows.ts`) both read it, so a level cannot be drawn one
|
|
5
5
|
* way on one screen and another way on the other.
|
|
6
6
|
*/
|
|
7
|
+
import type { MdBlock } from './markdownParser.js';
|
|
7
8
|
/** Which colour a heading takes: the accent, the body's own, or the muted one. */
|
|
8
9
|
export interface HeadingStyle {
|
|
9
10
|
readonly color: 'accent' | 'body' | 'muted';
|
|
@@ -21,4 +22,25 @@ export declare const QUOTE_BAR_WIDTH: number;
|
|
|
21
22
|
/** Cells a rule is drawn across: the width there is, up to 40. */
|
|
22
23
|
export declare const RULE_MAX = 40;
|
|
23
24
|
export declare function ruleWidth(width: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Blank rows above a block: one between blocks, none before the first, none
|
|
27
|
+
* between consecutive list items, and none above a code block indented under
|
|
28
|
+
* the list item it belongs to (the item and its block are one thing). `prev`
|
|
29
|
+
* is the type of the block before, or `'join'` for text that continues one.
|
|
30
|
+
*/
|
|
31
|
+
export declare function blockGap(block: {
|
|
32
|
+
readonly type: string;
|
|
33
|
+
readonly indent?: number;
|
|
34
|
+
}, prev: string | null | undefined): 0 | 1;
|
|
35
|
+
/** The most of a row a code block's indentation may take; the code keeps the rest. */
|
|
36
|
+
export declare function codeIndent(block: {
|
|
37
|
+
readonly indent?: number;
|
|
38
|
+
}, width: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Characters of fenced code a block holds, a line and its break each counted, in a
|
|
41
|
+
* quote's blocks too. The reply's colour budget is counted in these (`code-highlight.ts`),
|
|
42
|
+
* by the two screens and by the part of a reply that is printed while it is written, so
|
|
43
|
+
* a line is inside the budget or outside it the same way on all of them.
|
|
44
|
+
*/
|
|
45
|
+
export declare function codeChars(block: MdBlock): number;
|
|
24
46
|
//# sourceMappingURL=markdown-structure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-structure.d.ts","sourceRoot":"","sources":["../../src/tui/markdown-structure.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAKxD;AAED,oEAAoE;AACpE,eAAO,MAAM,SAAS,WAAM,CAAA;AAC5B,eAAO,MAAM,eAAe,QAA6B,CAAA;AAEzD,kEAAkE;AAClE,eAAO,MAAM,QAAQ,KAAK,CAAA;AAC1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
1
|
+
{"version":3,"file":"markdown-structure.d.ts","sourceRoot":"","sources":["../../src/tui/markdown-structure.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAKxD;AAED,oEAAoE;AACpE,eAAO,MAAM,SAAS,WAAM,CAAA;AAC5B,eAAO,MAAM,eAAe,QAA6B,CAAA;AAEzD,kEAAkE;AAClE,eAAO,MAAM,QAAQ,KAAK,CAAA;AAC1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACvB,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1D,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC7B,CAAC,GAAG,CAAC,CAKP;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIhD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { openingFence } from './markdown-fence.js';
|
|
1
2
|
/**
|
|
2
3
|
* Lightweight, dependency-free markdown parsing for the transcript. Splits
|
|
3
4
|
* text into block elements (paragraphs, headings, bullet/ordered list
|
|
@@ -66,6 +67,11 @@ export type MdBlock = {
|
|
|
66
67
|
readonly type: 'code';
|
|
67
68
|
readonly lang?: string;
|
|
68
69
|
readonly lines: readonly string[];
|
|
70
|
+
/**
|
|
71
|
+
* Columns the opening fence was indented: the block is drawn at them, so a
|
|
72
|
+
* block in a list item sits under its item. Absent is none.
|
|
73
|
+
*/
|
|
74
|
+
readonly indent?: number;
|
|
69
75
|
} | {
|
|
70
76
|
readonly type: 'table';
|
|
71
77
|
readonly headers: readonly string[];
|
|
@@ -77,6 +83,7 @@ export type MdBlock = {
|
|
|
77
83
|
readonly align?: readonly TableAlign[];
|
|
78
84
|
};
|
|
79
85
|
export type TableAlign = 'left' | 'center' | 'right';
|
|
86
|
+
export { closesFence, openingFence } from './markdown-fence.js';
|
|
80
87
|
/** Where one top-level block sits in its source, and what it is. */
|
|
81
88
|
export interface BlockRange {
|
|
82
89
|
/** Offset of the block's first character. */
|
|
@@ -119,7 +126,7 @@ export declare function openMarkersIn(text: string): number[];
|
|
|
119
126
|
export declare function parseInline(text: string): InlineSpan[];
|
|
120
127
|
/** The line shapes the streaming view reads: the same expressions the parser classifies with. */
|
|
121
128
|
export declare const LINE_SHAPES: {
|
|
122
|
-
readonly fence:
|
|
129
|
+
readonly fence: typeof openingFence;
|
|
123
130
|
readonly heading: RegExp;
|
|
124
131
|
readonly bullet: RegExp;
|
|
125
132
|
readonly quoteMark: RegExp;
|