@linloir/limr 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.en.md +123 -0
- package/README.md +122 -2
- package/benchmarks/results/browser.json +237 -0
- package/benchmarks/results/node.json +75 -0
- package/benchmarks/results/selection.json +172 -0
- package/dist/THIRD_PARTY_LICENSES.txt +117 -0
- package/dist/base.css +454 -0
- package/dist/chunk-3ILUZKDB.js +3130 -0
- package/dist/chunk-3ILUZKDB.js.map +1 -0
- package/dist/chunk-6N6TFHEN.js +83 -0
- package/dist/chunk-6N6TFHEN.js.map +1 -0
- package/dist/chunk-N77VD2YR.js +1238 -0
- package/dist/chunk-N77VD2YR.js.map +1 -0
- package/dist/chunk-TTISGBST.js +478 -0
- package/dist/chunk-TTISGBST.js.map +1 -0
- package/dist/chunk-V2OG4Y3F.js +1 -0
- package/dist/chunk-V2OG4Y3F.js.map +1 -0
- package/dist/core/index.d.ts +57 -0
- package/dist/core/index.js +39 -0
- package/dist/core/index.js.map +1 -0
- package/dist/engine-43u8B4yt.d.ts +172 -0
- package/dist/extensions/index.d.ts +130 -0
- package/dist/extensions/index.js +50 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/fonts/LICENSE.txt +93 -0
- package/dist/fonts/manifest.json +2204 -0
- package/dist/fonts/maple-7.9-bold-005-5530d8c1d6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-00f-1179d800a7.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-010-9974a942b1.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-011-9b9230baf2.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-012-c2545292b1.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-013-877b19fe05.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-014-6acf4a4e92.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-015-c889146da3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-018-419ad5f31f.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-027-dd414483da.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-028-263744fbc7.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-029-ae3a163d8b.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02a-515f0a82c2.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02b-0823c5133d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02c-296fd5db38.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02d-0bb4734363.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02e-25415fed50.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-02f-19ed79a84e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-030-21962a0327.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-031-d216fc0d68.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-032-d90ba34901.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-033-55ea37ea00.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-034-bc8649f808.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-035-03604fe40b.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-036-44fc7f77b2.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-037-8a1440f155.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-038-c65a618d5c.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-039-be05db966d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03a-ca3a10002d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03b-067b32e10b.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03c-4da4f84530.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03d-f0fe6a68c8.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03e-0e97f89433.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-03f-3289a5e3bc.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-040-232dcd0d7b.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-041-e25e9a9c41.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-042-d64a2b1824.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-043-2d01cf5e52.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-044-0ab808b5f1.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-045-e41dc814b4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-046-d5fe26344d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-047-f322ded671.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-048-0cdcf7257f.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-049-aa280ca08a.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04a-f51ad4d92c.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04b-4e8c6fa3ee.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04c-9bfdf4d743.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04d-83ac1f5bb3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04e-bcec89804a.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-04f-d31e83b6ce.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-070-8a3b0fdf98.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-071-5bee0a62c4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-072-97d891eee4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-073-4d4c36aca0.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-074-6d3cc01e90.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-075-eab42ad657.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-076-2b1f5c4a42.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-077-1db0d50873.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-078-bc6994a28f.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-079-ad6c1757ce.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-07a-d08ed2b87d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-07f-2f4af46cc6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-0fc-42ed90884c.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-780-261fac1b24.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-781-377319a91b.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-782-3106f0be62.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-783-74fbfa8648.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-784-8570270664.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-785-cee8de1ded.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-786-5ab5ff7149.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-787-844b4c4373.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-788-01731198ab.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-789-f4c75fa806.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-78a-4370321ec6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-78b-5cd412b56f.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-78c-f88e331085.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-78d-1b9b77f6e8.woff2 +0 -0
- package/dist/fonts/maple-7.9-bold-latin-3b4b2831f3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-005-d59fef8639.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-00f-1bbda7af69.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-010-5cdd4b46a7.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-011-0d1f1ae687.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-012-4ceb000b2e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-013-ad0a4f4313.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-014-94d54b71b3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-015-7aede280da.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-018-f21221b1c2.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-027-d23d0e80a4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-028-23bd6f24df.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-029-c481c0ad50.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02a-1c134be68e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02b-3feb29ecfd.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02c-de8cc5a063.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02d-ea25c21fad.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02e-e68d6bd335.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-02f-c88d1e92dc.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-030-f26fefe87e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-031-f2aa1b8e22.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-032-c4fafc4aa6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-033-288a1639ca.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-034-7c982125bc.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-035-fd1575dea2.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-036-f6bf406353.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-037-8ac1466916.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-038-e9f7fed6a6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-039-6f90d42310.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03a-30c9409a7e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03b-4f1741e9e9.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03c-6551c74e78.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03d-c8e2b07106.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03e-c3e98613d4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-03f-f1c580bad4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-040-32e8260076.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-041-39805a0ed7.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-042-13b4d84cd3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-043-d85780d0bd.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-044-1b5eb624d7.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-045-ad0b4f8762.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-046-9966021b3a.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-047-100d4f6f4e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-048-a0a1e8b29c.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-049-0806f9b3cc.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04a-28fdef78b3.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04b-6e93ef0086.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04c-50b8da6282.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04d-f93277723d.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04e-72e2644690.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-04f-4f234f1802.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-070-a3658a8a23.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-071-4987e49732.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-072-e587fa72cd.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-073-2aca01fdf6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-074-ae89f99a60.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-075-5a77191665.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-076-4c54a87277.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-077-e47dce25ee.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-078-b0b720dab6.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-079-316ee96f6a.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-07a-b10ccb8107.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-07d-5667cb3be1.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-07f-2ac6735ff8.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-0fc-52171ca01e.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-780-3c090c5f89.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-781-ca4077b4fa.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-782-42c3d52206.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-783-d72840dd37.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-784-b9ca097e50.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-785-b81dec6af9.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-786-76c266f6f5.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-787-403bd73766.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-788-71a4b8c2c5.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-789-94527f3fa4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-78a-81918568b8.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-78b-d0302b4bfe.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-78c-e864792049.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-78d-105ff69bf4.woff2 +0 -0
- package/dist/fonts/maple-7.9-bolditalic-latin-96412d165b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-005-23b09473f8.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-00f-e9bf4dd93c.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-010-22933d6d77.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-011-71b0157ddc.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-012-b751ab3752.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-013-530b1d3f8b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-014-0e842f6749.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-015-642211b03a.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-018-0c5b0001c6.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-027-9a09afbbb1.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-028-93fea67326.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-029-7d7627d4cc.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02a-88e76d051b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02b-7d9219748b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02c-049df19d84.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02d-663fc73c6e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02e-a98ed33998.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-02f-8ef9d93d09.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-030-74885d994d.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-031-4cf66c5d65.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-032-a608b7aed4.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-033-2978f66e55.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-034-38f7a0bf87.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-035-5cc45cd3b7.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-036-ca92d327e5.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-037-f887681c7d.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-038-06150b88f8.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-039-761da333b7.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03a-1408ddaf2c.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03b-1542b3b67c.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03c-479f2f5011.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03d-0f10590b11.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03e-8b93e0ee0e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-03f-2bd8815e3e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-040-b85023679a.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-041-eb881b7b92.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-042-01490a139e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-043-ffb21b6c4c.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-044-05cd1a1b14.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-045-1270935363.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-046-857077eab1.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-047-ca57774cc3.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-048-20969d6307.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-049-4066aa1a18.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04a-1ed360d580.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04b-2eba62d76b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04c-2f4effc460.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04d-d858c0a9c1.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04e-a19eb0289f.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-04f-8addde15f2.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-070-f0bd641f1c.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-071-e6ac564431.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-072-e6fea65bca.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-073-71621c00dc.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-074-4bd488962a.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-075-2838d95bd6.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-076-94e02ecc03.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-077-32c536ab6b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-078-18256447bd.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-079-7a735e61cf.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-07a-2b57a6a905.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-07d-8ba1bbfb50.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-07f-0240d80c69.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-0fc-e5b20a692e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-780-093cc90a9b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-781-f6ec357f6d.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-782-5ca2ef4ddd.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-783-7450baabee.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-784-14a93cc4bd.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-785-d62fb8b4d7.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-786-1d2959dc83.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-787-70ae947136.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-788-cf1f156ebf.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-789-f0b79f9680.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-78a-5a53fd7870.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-78b-40be093bfd.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-78c-3b11646f8e.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-78d-b13ed8c48b.woff2 +0 -0
- package/dist/fonts/maple-7.9-italic-latin-befeb2b610.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-005-90bff107ac.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-00f-001e503e53.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-010-374da1ebb4.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-011-8f91fcc9e7.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-012-e4ec3016ef.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-013-e779e13a12.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-014-6b833ad501.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-015-4e058c4c42.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-018-6f776bc19b.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-027-92c0be3439.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-028-154c8c3039.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-029-9d88470aca.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02a-7a94cb26f2.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02b-1725b841c2.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02c-e080c435d6.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02d-a6461c4708.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02e-2e55d9b957.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-02f-858a76fa1f.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-030-bbbe80f8ad.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-031-cafc1258ad.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-032-0ca83ecceb.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-033-6cb995f2e7.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-034-5877222be6.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-035-988d8f2d26.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-036-e91853e3ca.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-037-3eed60f359.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-038-5681f42a4a.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-039-07036fe444.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03a-5495eead93.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03b-d07b1d6c1e.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03c-6291400ee0.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03d-3787a51772.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03e-ce4d945844.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-03f-95e98b329c.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-040-693b769fe8.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-041-7b436d2c09.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-042-9ad884cd73.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-043-372231e8e2.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-044-9922b540b1.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-045-8a88a91c22.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-046-82859ede10.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-047-6532babd62.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-048-abfdc5d7ce.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-049-adb7fa9ed3.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04a-f3f794b1cb.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04b-715211b8dd.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04c-c6f978d10d.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04d-61019a1c8f.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04e-806d6efe85.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-04f-99d19aa8db.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-070-e94ba9445d.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-071-057314b533.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-072-a7699beb84.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-073-ebe1bd9ef4.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-074-722db38100.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-075-150ff7187b.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-076-c14595e715.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-077-6c88302a32.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-078-549b294c78.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-079-5131c42759.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-07a-c0dad221b5.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-07f-5cf5ebe065.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-0fc-b644c0c6d9.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-780-c6000d472a.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-781-86409ab7f7.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-782-9cd950637c.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-783-105c4d02df.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-784-00c042af97.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-785-022568d0b8.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-786-90b6f3aef5.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-787-e2888596c9.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-788-3416e1fda3.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-789-9ffc917b0b.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-78a-4a921d07f6.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-78b-9d71c5327b.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-78c-9ec048314b.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-78d-46a2ebd113.woff2 +0 -0
- package/dist/fonts/maple-7.9-regular-latin-59c752ba1d.woff2 +0 -0
- package/dist/fonts/maple.css +315 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +136 -0
- package/dist/index.js.map +1 -0
- package/dist/math-renderer-L6DOH4RX.js +21 -0
- package/dist/math-renderer-L6DOH4RX.js.map +1 -0
- package/dist/math.css +1 -0
- package/dist/react/index.d.ts +113 -0
- package/dist/react/index.js +59 -0
- package/dist/react/index.js.map +1 -0
- package/dist/styles.css +454 -0
- package/dist/translations-DHnYMg4h.d.ts +318 -0
- package/docs/README.md +13 -0
- package/docs/api.md +8 -0
- package/docs/assets/rendered.svg +9 -0
- package/docs/assets/source.svg +9 -0
- package/docs/en/README.md +26 -0
- package/docs/en/ai-skills.md +57 -0
- package/docs/en/annotations.md +84 -0
- package/docs/en/api.md +107 -0
- package/docs/en/architecture.md +33 -0
- package/docs/en/extensions.md +159 -0
- package/docs/en/getting-started.md +67 -0
- package/docs/en/integration.md +130 -0
- package/docs/en/modules.md +80 -0
- package/docs/en/performance.md +53 -0
- package/docs/en/plugin-packages.md +68 -0
- package/docs/en/styles.md +80 -0
- package/docs/en/syntax.md +352 -0
- package/docs/extensions.md +8 -0
- package/docs/implementation.md +8 -0
- package/docs/performance.md +8 -0
- package/docs/screenshots/blocks.png +0 -0
- package/docs/screenshots/dark.png +0 -0
- package/docs/screenshots/desktop.png +0 -0
- package/docs/screenshots/plugin-mobile.png +0 -0
- package/docs/styles.md +8 -0
- package/docs/visual-upgrade.md +8 -0
- package/docs/zh-CN/README.md +26 -0
- package/docs/zh-CN/ai-skills.md +57 -0
- package/docs/zh-CN/annotations.md +84 -0
- package/docs/zh-CN/api.md +107 -0
- package/docs/zh-CN/architecture.md +33 -0
- package/docs/zh-CN/extensions.md +159 -0
- package/docs/zh-CN/getting-started.md +67 -0
- package/docs/zh-CN/integration.md +130 -0
- package/docs/zh-CN/modules.md +80 -0
- package/docs/zh-CN/performance.md +53 -0
- package/docs/zh-CN/plugin-packages.md +68 -0
- package/docs/zh-CN/styles.md +80 -0
- package/docs/zh-CN/syntax.md +352 -0
- package/examples/assistant.tsx +52 -0
- package/examples/notes.tsx +80 -0
- package/examples/packages/paper-theme/index.css +25 -0
- package/examples/packages/paper-theme/package.json +7 -0
- package/examples/packages/reading-tools/index.d.ts +2 -0
- package/examples/packages/reading-tools/index.js +25 -0
- package/examples/packages/reading-tools/package.json +16 -0
- package/package.json +114 -3
- package/skills/limr-plugin-development/SKILL.md +22 -0
- package/skills/limr-plugin-development/agents/openai.yaml +4 -0
- package/skills/limr-plugin-development/assets/plugin-template/README.md +30 -0
- package/skills/limr-plugin-development/assets/plugin-template/package.json +36 -0
- package/skills/limr-plugin-development/assets/plugin-template/src/index.tsx +50 -0
- package/skills/limr-plugin-development/assets/plugin-template/src/styles.css +9 -0
- package/skills/limr-plugin-development/assets/plugin-template/tsconfig.json +20 -0
- package/skills/limr-plugin-development/assets/plugin-template/tsup.config.ts +8 -0
- package/skills/limr-plugin-development/references/contract.md +45 -0
- package/skills/limr-use/SKILL.md +23 -0
- package/skills/limr-use/agents/openai.yaml +4 -0
- package/skills/limr-use/references/integration.md +41 -0
- package/skills/limr-use/references/syntax.md +17 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode, CSSProperties } from 'react';
|
|
3
|
+
import { l as SyntaxExtension, M as MarkdownNode, A as Annotation, b as AnnotationOccurrence, g as HighlightData, k as SourceRange, h as SelectionSnapshot, f as DocumentSnapshot, c as DocumentEngine } from './engine-43u8B4yt.js';
|
|
4
|
+
|
|
5
|
+
interface NodeRendererProps {
|
|
6
|
+
node: MarkdownNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
pending: boolean;
|
|
9
|
+
source: string;
|
|
10
|
+
/** Render an existing subtree without parsing strings again. */
|
|
11
|
+
renderChildren: (nodes: readonly MarkdownNode[], options?: {
|
|
12
|
+
trailing?: ReactNode;
|
|
13
|
+
}) => ReactNode;
|
|
14
|
+
/** Render a literal node value with optional syntax tokens, preserving source
|
|
15
|
+
* selection, highlights and annotation insertion. Token offsets are UTF-16. */
|
|
16
|
+
renderValue: (tokens?: readonly TextToken[]) => ReactNode;
|
|
17
|
+
/** Render a text attribute with source selection, highlights and annotations. */
|
|
18
|
+
renderAttribute: (name: string) => ReactNode;
|
|
19
|
+
}
|
|
20
|
+
interface TextToken {
|
|
21
|
+
content: string;
|
|
22
|
+
offset: number;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
type NodeRenderer = ComponentType<NodeRendererProps>;
|
|
26
|
+
type AnnotationPresentation = 'preview' | 'expanded' | 'sidebar';
|
|
27
|
+
interface AnnotationExpansion {
|
|
28
|
+
/** Grow beside the marker, or center within the page's visual viewport. */
|
|
29
|
+
placement: 'anchor' | 'center';
|
|
30
|
+
/** CSS lengths or pixels. Unset height fits content; centered width defaults to 640px. */
|
|
31
|
+
width?: number | string;
|
|
32
|
+
height?: number | string;
|
|
33
|
+
maxHeight?: number | string;
|
|
34
|
+
}
|
|
35
|
+
interface AnnotationContentProps<T = unknown> {
|
|
36
|
+
annotation: Annotation<T>;
|
|
37
|
+
presentation: AnnotationPresentation;
|
|
38
|
+
expanded: boolean;
|
|
39
|
+
/** Shared editor state, preserved when switching between sidebar and overlay. */
|
|
40
|
+
editing: boolean;
|
|
41
|
+
data: T | undefined;
|
|
42
|
+
loading: boolean;
|
|
43
|
+
error: Error | null;
|
|
44
|
+
retry: () => void;
|
|
45
|
+
}
|
|
46
|
+
/** A compact sidebar summary from local annotation data; rendering it never
|
|
47
|
+
* invokes the annotation's loader. The first annotation owns a grouped preview. */
|
|
48
|
+
interface AnnotationSidebarPreviewProps<T = unknown> {
|
|
49
|
+
annotation: Annotation<T>;
|
|
50
|
+
data: T | undefined;
|
|
51
|
+
occurrence: AnnotationOccurrence;
|
|
52
|
+
annotations: readonly Annotation[];
|
|
53
|
+
referenceText: string;
|
|
54
|
+
}
|
|
55
|
+
/** The registering module owns the entire inside of the floating surface.
|
|
56
|
+
* `children` renders the occurrence's Content components, sharing their cache
|
|
57
|
+
* and preserving their state between preview and expanded presentations. */
|
|
58
|
+
interface AnnotationOverlayCardProps<T = unknown> {
|
|
59
|
+
annotation: Annotation<T>;
|
|
60
|
+
occurrence: AnnotationOccurrence;
|
|
61
|
+
presentation: 'preview' | 'expanded';
|
|
62
|
+
expanded: boolean;
|
|
63
|
+
pinned: boolean;
|
|
64
|
+
canExpand: boolean;
|
|
65
|
+
expand: () => void;
|
|
66
|
+
collapse: () => void;
|
|
67
|
+
close: () => void;
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
interface AnnotationType<T = unknown> {
|
|
71
|
+
type: string;
|
|
72
|
+
/** Resolve labels from the reader locale without recreating the plugin. */
|
|
73
|
+
label: string | ((locale: LiMRLocale) => string);
|
|
74
|
+
icon?: ReactNode | ComponentType;
|
|
75
|
+
color?: string;
|
|
76
|
+
/** Highlight referenced text in the marker color while hovered or active. */
|
|
77
|
+
highlight?: 'hover' | false;
|
|
78
|
+
Content?: ComponentType<AnnotationContentProps<T>>;
|
|
79
|
+
Marker?: ComponentType<{
|
|
80
|
+
annotation: Annotation<T>;
|
|
81
|
+
active: boolean;
|
|
82
|
+
}>;
|
|
83
|
+
overlay?: {
|
|
84
|
+
/** Render the full card, including its title, body and controls. */
|
|
85
|
+
Card?: ComponentType<AnnotationOverlayCardProps<T>>;
|
|
86
|
+
/** CSS length or pixels, constrained to the visual viewport. */
|
|
87
|
+
previewWidth?: number | string;
|
|
88
|
+
/** Expansion is opt-in. A resolver may vary the layout per annotation. */
|
|
89
|
+
expand?: false | AnnotationExpansion | ((annotation: Annotation<T>) => false | AnnotationExpansion);
|
|
90
|
+
};
|
|
91
|
+
sidebar?: {
|
|
92
|
+
/** Collapsed summary below the title. Return null or use false to hide it. */
|
|
93
|
+
Preview?: ComponentType<AnnotationSidebarPreviewProps<T>> | false;
|
|
94
|
+
/** Maximum summary lines. Default: 2. */
|
|
95
|
+
previewLines?: number;
|
|
96
|
+
previewColor?: string;
|
|
97
|
+
/** Card accent; defaults to the marker color. CSS colors/variables are accepted. */
|
|
98
|
+
color?: string;
|
|
99
|
+
/** Resting decorative border; defaults to the card accent. */
|
|
100
|
+
borderColor?: string;
|
|
101
|
+
/** Title defaults to the accent; body and excerpt keep the reader text colors. */
|
|
102
|
+
titleColor?: string;
|
|
103
|
+
textColor?: string;
|
|
104
|
+
excerptColor?: string;
|
|
105
|
+
/** Toggle an expanded card by clicking its noninteractive content. Default: false. */
|
|
106
|
+
collapseOnContentClick?: boolean;
|
|
107
|
+
};
|
|
108
|
+
/** Only called when content is displayed; requests share a per-reader cache. */
|
|
109
|
+
load?: (annotation: Annotation<T>, context: {
|
|
110
|
+
signal: AbortSignal;
|
|
111
|
+
}) => Promise<T>;
|
|
112
|
+
}
|
|
113
|
+
interface RendererExtension extends SyntaxExtension {
|
|
114
|
+
/** Register document parameter defaults. Plugins extend RendererParameters
|
|
115
|
+
* through TypeScript declaration merging and read them with useRendererParameter. */
|
|
116
|
+
parameters?: Readonly<RendererParameters>;
|
|
117
|
+
components?: Readonly<Record<string, NodeRenderer>>;
|
|
118
|
+
annotationTypes?: readonly AnnotationType<any>[];
|
|
119
|
+
actions?: readonly SelectionAction[];
|
|
120
|
+
}
|
|
121
|
+
/** Open to module augmentation; parameter names and semantics belong to plugins. */
|
|
122
|
+
interface RendererParameters {
|
|
123
|
+
}
|
|
124
|
+
interface DocumentCommands {
|
|
125
|
+
/** Content annotations get a shared highlight unless disabled or their type
|
|
126
|
+
* uses hover highlighting. An explicit appearance still creates a saved highlight. */
|
|
127
|
+
addAnnotation: (annotation: Annotation, options?: {
|
|
128
|
+
highlight?: HighlightData | false;
|
|
129
|
+
edit?: boolean;
|
|
130
|
+
}) => void;
|
|
131
|
+
updateAnnotation: (id: string, update: Partial<Annotation>) => void;
|
|
132
|
+
removeAnnotation: (id: string) => void;
|
|
133
|
+
/** Remove all annotations bound to these exact fragments, preserving other anchors. */
|
|
134
|
+
removeAnnotationsAt: (ranges: readonly SourceRange[]) => void;
|
|
135
|
+
editAnnotation: (id: string | null) => void;
|
|
136
|
+
/** Open the first occurrence of an annotation, or an explicit occurrence ID. */
|
|
137
|
+
activateAnnotation: (id: string | null) => void;
|
|
138
|
+
}
|
|
139
|
+
interface ActionContext extends DocumentCommands {
|
|
140
|
+
selection: SelectionSnapshot;
|
|
141
|
+
/** Annotations bound to the selected fragment, including its highlight. */
|
|
142
|
+
annotations: readonly Annotation[];
|
|
143
|
+
highlight: Annotation<HighlightData> | null;
|
|
144
|
+
document: DocumentSnapshot;
|
|
145
|
+
locale: LiMRLocale;
|
|
146
|
+
clearSelection: () => void;
|
|
147
|
+
/** Aborted when this reader is disposed, not when its menu closes. */
|
|
148
|
+
signal: AbortSignal;
|
|
149
|
+
}
|
|
150
|
+
interface ToolbarActionContext extends ActionContext {
|
|
151
|
+
busy: boolean;
|
|
152
|
+
expanded: boolean;
|
|
153
|
+
highlightAppearance: HighlightData;
|
|
154
|
+
setHighlightAppearance: (appearance: HighlightData) => void;
|
|
155
|
+
expand: () => void;
|
|
156
|
+
collapse: () => void;
|
|
157
|
+
/** Run a panel operation through the toolbar's busy/error handling. */
|
|
158
|
+
run: (operation: (context: ActionContext) => void | Promise<void>) => Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
interface SelectionAction {
|
|
161
|
+
id: string;
|
|
162
|
+
label: string | ((context: ActionContext) => string);
|
|
163
|
+
/** Required, decorative, ideally a rounded SVG with a square viewBox. */
|
|
164
|
+
icon: NonNullable<ReactNode> | ((context: ActionContext) => ReactNode);
|
|
165
|
+
placement?: 'start' | 'end';
|
|
166
|
+
tone?: 'danger';
|
|
167
|
+
/** Optional transient success feedback after run() resolves. */
|
|
168
|
+
successLabel?: string | ((context: ActionContext) => string);
|
|
169
|
+
successIcon?: ReactNode;
|
|
170
|
+
visible?: (context: ActionContext) => boolean;
|
|
171
|
+
disabled?: (context: ActionContext) => boolean;
|
|
172
|
+
run?: (context: ToolbarActionContext) => void | Promise<void>;
|
|
173
|
+
onHover?: (context: ToolbarActionContext) => void;
|
|
174
|
+
/** Automatically opens on hover; also accessible by keyboard and touch. */
|
|
175
|
+
renderExpanded?: (context: ToolbarActionContext) => ReactNode;
|
|
176
|
+
render?: (context: ToolbarActionContext) => ReactNode;
|
|
177
|
+
}
|
|
178
|
+
interface LiMRLocale {
|
|
179
|
+
/** Optional language tag for plugin-owned translations. */
|
|
180
|
+
language?: string;
|
|
181
|
+
citation?: string;
|
|
182
|
+
contents: string;
|
|
183
|
+
annotations: string;
|
|
184
|
+
expand: string;
|
|
185
|
+
collapse: string;
|
|
186
|
+
close: string;
|
|
187
|
+
copy: string;
|
|
188
|
+
copied: string;
|
|
189
|
+
copyFailed: string;
|
|
190
|
+
copyImage: string;
|
|
191
|
+
copyFigures: string;
|
|
192
|
+
loading: string;
|
|
193
|
+
retry: string;
|
|
194
|
+
unavailable: string;
|
|
195
|
+
footnotes: string;
|
|
196
|
+
definition: string;
|
|
197
|
+
question: string;
|
|
198
|
+
note: string;
|
|
199
|
+
extra: string;
|
|
200
|
+
hint: string;
|
|
201
|
+
answer: string;
|
|
202
|
+
submit: string;
|
|
203
|
+
correct: string;
|
|
204
|
+
incorrect: string;
|
|
205
|
+
play: string;
|
|
206
|
+
highlight: string;
|
|
207
|
+
addHighlight: string;
|
|
208
|
+
editHighlight: string;
|
|
209
|
+
highlightColor: string;
|
|
210
|
+
highlightStyle: string;
|
|
211
|
+
highlightBackground: string;
|
|
212
|
+
highlightUnderline: string;
|
|
213
|
+
highlightDotted: string;
|
|
214
|
+
highlightWavy: string;
|
|
215
|
+
hideHighlight: string;
|
|
216
|
+
showHighlight: string;
|
|
217
|
+
deleteAnnotations: string;
|
|
218
|
+
deleteAnnotationsHint: string;
|
|
219
|
+
}
|
|
220
|
+
interface ViewConfiguration {
|
|
221
|
+
/** Document-wide overrides of parameters registered by extensions. */
|
|
222
|
+
parameters?: Readonly<RendererParameters>;
|
|
223
|
+
extensions?: readonly RendererExtension[];
|
|
224
|
+
/** Add installed plugins to the default extensions (or your extensions list). */
|
|
225
|
+
plugins?: readonly RendererExtension[];
|
|
226
|
+
/** CSS skin name, applied to every view including portalled controls. */
|
|
227
|
+
appearance?: string;
|
|
228
|
+
components?: Readonly<Record<string, NodeRenderer>>;
|
|
229
|
+
annotationTypes?: readonly AnnotationType<any>[];
|
|
230
|
+
annotations?: readonly Annotation[];
|
|
231
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
232
|
+
/** Justify prose paragraphs and list items, leaving the last line start-aligned. */
|
|
233
|
+
justify?: boolean;
|
|
234
|
+
locale?: Partial<LiMRLocale>;
|
|
235
|
+
scrollRoot?: HTMLElement | null;
|
|
236
|
+
scrollOffset?: number;
|
|
237
|
+
onSelectionChange?: (selection: SelectionSnapshot | null) => void;
|
|
238
|
+
onAnnotationClick?: (occurrence: AnnotationOccurrence) => void;
|
|
239
|
+
onAnnotationHover?: (occurrence: AnnotationOccurrence | null) => void;
|
|
240
|
+
onDocumentChange?: (document: DocumentSnapshot) => void;
|
|
241
|
+
onAnnotationsChange?: (annotations: readonly Annotation[]) => void;
|
|
242
|
+
onHighlightHover?: (highlight: Annotation<HighlightData> | null) => void;
|
|
243
|
+
onHighlightClick?: (highlight: Annotation<HighlightData>) => void;
|
|
244
|
+
}
|
|
245
|
+
interface StyledProps {
|
|
246
|
+
className?: string;
|
|
247
|
+
style?: CSSProperties;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface DocumentProviderProps extends ViewConfiguration {
|
|
251
|
+
source?: string;
|
|
252
|
+
streaming?: boolean;
|
|
253
|
+
documentId?: string;
|
|
254
|
+
children: ReactNode;
|
|
255
|
+
}
|
|
256
|
+
declare function DocumentProvider({ children, source, streaming, documentId, ...options }: DocumentProviderProps): react.JSX.Element;
|
|
257
|
+
/** Only the requested value is subscribed; changing a parameter never reparses source. */
|
|
258
|
+
declare function useRendererParameter<K extends keyof RendererParameters>(name: K): RendererParameters[K];
|
|
259
|
+
declare function useDocument(): DocumentSnapshot;
|
|
260
|
+
declare function useDocumentSelector<R>(select: (snapshot: DocumentSnapshot) => R): R;
|
|
261
|
+
declare function useSelection(): SelectionSnapshot | null;
|
|
262
|
+
declare function useLocale(): LiMRLocale;
|
|
263
|
+
declare function useAnnotation(id: string): Annotation | undefined;
|
|
264
|
+
declare function useAnnotations(): {
|
|
265
|
+
annotations: ReadonlyMap<string, Annotation<unknown>>;
|
|
266
|
+
occurrences: readonly AnnotationOccurrence[];
|
|
267
|
+
};
|
|
268
|
+
declare function useAnnotationState(): {
|
|
269
|
+
active: string | null;
|
|
270
|
+
hovered: string | null;
|
|
271
|
+
activate: (id: string | null) => void;
|
|
272
|
+
hover: (id: string | null) => void;
|
|
273
|
+
};
|
|
274
|
+
declare function useAnchor(id: string): {
|
|
275
|
+
element: HTMLElement | null;
|
|
276
|
+
rect: DOMRect | null;
|
|
277
|
+
contentRect: DOMRect | null;
|
|
278
|
+
};
|
|
279
|
+
declare function useLiMR(): {
|
|
280
|
+
document: DocumentEngine;
|
|
281
|
+
signal: AbortSignal;
|
|
282
|
+
clearSelection: () => void;
|
|
283
|
+
scrollToHeading: (id: string) => void;
|
|
284
|
+
scrollToAnnotation: (id: string) => void;
|
|
285
|
+
invalidateAnnotation: (id: string) => void;
|
|
286
|
+
addAnnotation: (annotation: Annotation, options?: {
|
|
287
|
+
highlight?: HighlightData | false;
|
|
288
|
+
edit?: boolean;
|
|
289
|
+
}) => void;
|
|
290
|
+
updateAnnotation: (id: string, update: Partial<Annotation>) => void;
|
|
291
|
+
removeAnnotation: (id: string) => void;
|
|
292
|
+
removeAnnotationsAt: (ranges: readonly SourceRange[]) => void;
|
|
293
|
+
editAnnotation: (id: string | null) => void;
|
|
294
|
+
activateAnnotation: (id: string | null) => void;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
interface MarkdownProps extends Omit<DocumentProviderProps, 'children'>, StyledProps {
|
|
298
|
+
interactive?: boolean;
|
|
299
|
+
/** Follow generated output while the reader remains near the bottom. */
|
|
300
|
+
followOutput?: boolean;
|
|
301
|
+
}
|
|
302
|
+
declare function Markdown({ className, style, interactive, followOutput, justify, ...props }: MarkdownProps): react.JSX.Element;
|
|
303
|
+
|
|
304
|
+
type TranslationMode = 'origin' | 'translation' | 'both';
|
|
305
|
+
interface TranslationsOptions {
|
|
306
|
+
defaultMode?: TranslationMode;
|
|
307
|
+
}
|
|
308
|
+
declare module '@linloir/limr' {
|
|
309
|
+
interface RendererParameters {
|
|
310
|
+
/** Overrides every translations block. Undefined restores each block's local mode. */
|
|
311
|
+
translationMode?: TranslationMode;
|
|
312
|
+
/** With a global mode, markers request an update through this callback. */
|
|
313
|
+
onTranslationModeChange?: (mode: TranslationMode) => void;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
declare function translations(options?: TranslationsOptions): RendererExtension;
|
|
317
|
+
|
|
318
|
+
export { type ActionContext as A, type DocumentCommands as D, type LiMRLocale as L, Markdown as M, type NodeRenderer as N, type RendererExtension as R, type SelectionAction as S, type TextToken as T, type ViewConfiguration as V, type AnnotationContentProps as a, type AnnotationExpansion as b, type AnnotationOverlayCardProps as c, type AnnotationPresentation as d, type AnnotationSidebarPreviewProps as e, type AnnotationType as f, DocumentProvider as g, type DocumentProviderProps as h, type MarkdownProps as i, type NodeRendererProps as j, type RendererParameters as k, type StyledProps as l, type ToolbarActionContext as m, type TranslationMode as n, type TranslationsOptions as o, useAnnotation as p, useAnnotationState as q, useAnnotations as r, useDocument as s, translations as t, useAnchor as u, useDocumentSelector as v, useLiMR as w, useLocale as x, useRendererParameter as y, useSelection as z };
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# LiMR 文档 / Documentation
|
|
2
|
+
|
|
3
|
+
[简体中文](zh-CN/README.md) · [English](en/README.md)
|
|
4
|
+
|
|
5
|
+
文档按阅读、接入与扩展开发场景组织;两种语言使用相同的文件结构,每页顶部可以切换语言。
|
|
6
|
+
|
|
7
|
+
Documentation is organized around writing content, integrating LiMR, and developing extensions. Both languages use the same file structure, with a language switch on each page.
|
|
8
|
+
|
|
9
|
+
- [中文入门](zh-CN/getting-started.md) / [Getting started](en/getting-started.md)
|
|
10
|
+
- [默认语法](zh-CN/syntax.md) / [Default syntax](en/syntax.md)
|
|
11
|
+
- [AI Skills 下载与导入](zh-CN/ai-skills.md) / [Download and install AI Skills](en/ai-skills.md)
|
|
12
|
+
|
|
13
|
+
[项目首页](../README.md) · [Project overview](../README.en.md)
|
package/docs/api.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240" role="img" aria-label="Rendered document">
|
|
2
|
+
<rect width="480" height="240" rx="12" fill="#eef2ec"/>
|
|
3
|
+
<g fill="#364633" font-family="Georgia,serif">
|
|
4
|
+
<text x="32" y="60" font-size="32" font-weight="bold">Markdown</text>
|
|
5
|
+
<text x="32" y="108" font-size="24" font-weight="bold">Readable source</text>
|
|
6
|
+
<text x="32" y="156" font-size="24">• Write</text>
|
|
7
|
+
<text x="32" y="196" font-size="24">• Read</text>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="480" height="240" viewBox="0 0 480 240" role="img" aria-label="Markdown source">
|
|
2
|
+
<rect width="480" height="240" rx="12" fill="#f3f1ee"/>
|
|
3
|
+
<g fill="#5a5650" font-family="monospace" font-size="24">
|
|
4
|
+
<text x="32" y="60"># Markdown</text>
|
|
5
|
+
<text x="32" y="108">**Readable source**</text>
|
|
6
|
+
<text x="32" y="156">- Write</text>
|
|
7
|
+
<text x="32" y="196">- Read</text>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# English documentation
|
|
2
|
+
|
|
3
|
+
> Reading note: this page uses LiMR syntax and interactive examples. Some content cannot be fully displayed by ordinary Markdown viewers such as GitHub; visit the [GitHub Pages documentation](https://linloir.github.io/LiMR/#/docs/en/README) for the best reading experience.
|
|
4
|
+
|
|
5
|
+
[Documentation](README.md) · [简体中文](../zh-CN/README.md)
|
|
6
|
+
|
|
7
|
+
These pages describe the current public LiMR 1.0.0 implementation. Chinese is the default documentation language; every English page has a matching Chinese page.
|
|
8
|
+
|
|
9
|
+
| What you want to do | Read |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Install and render a first document | [Getting started](getting-started.md) |
|
|
12
|
+
| Understand modules, included capabilities, and configuration | [Built-in modules](modules.md) |
|
|
13
|
+
| Write Markdown, exercises, citations, figures, and translations | [Default syntax](syntax.md) |
|
|
14
|
+
| Integrate React, streaming, custom layouts, or SSR | [Application integration](integration.md) |
|
|
15
|
+
| Persist selections, highlights, citations, and custom annotations | [Annotations and selection](annotations.md) |
|
|
16
|
+
| Add syntax, cards, selection actions, and parameters | [Extension development](extensions.md) |
|
|
17
|
+
| Build a standalone npm plugin and import it into an app | [Plugin packages](plugin-packages.md) |
|
|
18
|
+
| Customize themes, fonts, layouts, and portals | [Styles and fonts](styles.md) |
|
|
19
|
+
| Look up component props, hooks, and core APIs | [API reference](api.md) |
|
|
20
|
+
| Understand parsing, state, and resource boundaries | [Architecture and behavior](architecture.md) |
|
|
21
|
+
| Understand measurements and validation boundaries | [Performance and limits](performance.md) |
|
|
22
|
+
| Have an AI use LiMR or develop plugins | [AI Skills](ai-skills.md) |
|
|
23
|
+
|
|
24
|
+
Start with `Reader`, split components when a custom layout is needed, and add plugins for application features. Local persistence, import/export, and simulated assistant responses in the Playground belong to the demo application, not to Reader itself.
|
|
25
|
+
|
|
26
|
+
[Back to README](../../README.en.md) · [Live Playground](https://linloir.github.io/LiMR/)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# AI Skills: download, install, and use
|
|
2
|
+
|
|
3
|
+
> Reading note: this page uses LiMR syntax and interactive examples. Some content cannot be fully displayed by ordinary Markdown viewers such as GitHub; visit the [GitHub Pages documentation](https://linloir.github.io/LiMR/#/docs/en/ai-skills) for the best reading experience.
|
|
4
|
+
|
|
5
|
+
[Documentation](README.md) · [简体中文](../zh-CN/ai-skills.md)
|
|
6
|
+
|
|
7
|
+
Skills are instruction bundles for AI agents, not RendererExtension modules or model services. Installing a Skill does not automatically change a project, install plugins, or connect an AI API.
|
|
8
|
+
|
|
9
|
+
| Skill | Tasks |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [limr-use](../../skills/limr-use/SKILL.md) | Integrate LiMR, choose components, author syntax, configure annotations/streaming/themes, import existing plugins |
|
|
12
|
+
| [limr-plugin-development](../../skills/limr-plugin-development/SKILL.md) | Build new plugin packages with cards/syntax/actions/parameters and validate consumers |
|
|
13
|
+
|
|
14
|
+
Instructions are in English and accept tasks written in Chinese. Human-facing documentation is bilingual. The development Skill includes a standalone starter; both include local references, so the entire repository is not required in the agent's context.
|
|
15
|
+
|
|
16
|
+
## Import from the npm package
|
|
17
|
+
|
|
18
|
+
Install a LiMR version containing Skills, then run in **your application project**:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @linloir/limr
|
|
22
|
+
mkdir -p .agents/skills
|
|
23
|
+
cp -R node_modules/@linloir/limr/skills/limr-use .agents/skills/
|
|
24
|
+
cp -R node_modules/@linloir/limr/skills/limr-plugin-development .agents/skills/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
These commands illustrate a fresh installation. Review local customizations before replacing an existing directory, and update the whole folder to avoid stale templates. Copies are snapshots; npm upgrades do not update them automatically. Review compatibility when upgrading LiMR.
|
|
28
|
+
|
|
29
|
+
## Import from the repository or ZIP
|
|
30
|
+
|
|
31
|
+
Copy from the repository's skills directory, or generate ZIPs locally (requires Python 3):
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
pnpm pack:skills
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Archives are written to artifacts/skills and mirrored to Playground public/downloads for Docs downloads. Each ZIP contains a complete top-level skill directory, not just SKILL.md. A versioned combined archive is also produced. Building the Docs site generates download assets automatically.
|
|
38
|
+
|
|
39
|
+
After the corresponding site version is deployed, download [limr-use.zip](https://linloir.github.io/LiMR/downloads/limr-use.zip) or [limr-plugin-development.zip](https://linloir.github.io/LiMR/downloads/limr-plugin-development.zip). The local AI Skills page also has download buttons. ZIPs are transport archives, not a promise that every AI client supports one-click import; extract and copy the full folders where needed.
|
|
40
|
+
|
|
41
|
+
## Codex locations and invocation
|
|
42
|
+
|
|
43
|
+
Codex supports project skills in .agents/skills and user skills in ~/.agents/skills. Choose one scope to avoid duplicate names. Older clients may use a different supported directory. Changes are normally discovered automatically; restart if missing. Invoke through /skills or $skill-name. Source: [official OpenAI Skills documentation](https://developers.openai.com/codex/skills/).
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
$limr-use Integrate LiMR into this React application with English labels, streaming answers, and controlled annotations.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
$limr-plugin-development Create a glossary plugin package with a term block, selection action, expandable card, and sidebar preview, then import it into this application.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For other SKILL.md-compatible agents, use their supported project/user locations. Without automatic discovery, ask the AI to read SKILL.md and follow its reference/asset links. Do not assume one client's commands work everywhere.
|
|
54
|
+
|
|
55
|
+
## Expected deliverables
|
|
56
|
+
|
|
57
|
+
The use Skill should deliver working integration, stable configuration, and validation. The development Skill should deliver module source, exports/types/CSS, a host example, and real package-consumer verification. Both prioritize the installed API, avoid invented syntax and loss of persisted unknown annotations, and do not publish packages or modify external services unless instructed.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Annotations and selection
|
|
2
|
+
|
|
3
|
+
> Reading note: this page uses LiMR syntax and interactive examples. Some content cannot be fully displayed by ordinary Markdown viewers such as GitHub; visit the [GitHub Pages documentation](https://linloir.github.io/LiMR/#/docs/en/annotations) for the best reading experience.
|
|
4
|
+
|
|
5
|
+
[Documentation](README.md) · [简体中文](../zh-CN/annotations.md)
|
|
6
|
+
|
|
7
|
+
## Data model
|
|
8
|
+
|
|
9
|
+
Annotation stores data, AnnotationType registers presentation/loading, and AnnotationOccurrence describes one location. One annotation can have multiple anchors; one citation marker can refer to several annotations.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import type { Annotation } from '@linloir/limr';
|
|
13
|
+
|
|
14
|
+
export const annotations: readonly Annotation[] = [{
|
|
15
|
+
id: 'paper-reference',
|
|
16
|
+
type: 'citation',
|
|
17
|
+
data: { title: 'Paper', url: 'https://example.com/paper' },
|
|
18
|
+
anchors: [{
|
|
19
|
+
range: { start: 0, end: 4 },
|
|
20
|
+
documentId: 'article',
|
|
21
|
+
quote: 'LiMR',
|
|
22
|
+
}],
|
|
23
|
+
}, {
|
|
24
|
+
id: 'highlight-1',
|
|
25
|
+
type: 'highlight',
|
|
26
|
+
range: { start: 0, end: 4 },
|
|
27
|
+
data: { color: '#F2C744', style: 'background' },
|
|
28
|
+
}];
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The example requires source to begin with LiMR and documentId to be article. range is shorthand for one anchor; anchors takes precedence. All ranges address the **unmodified input**, using UTF-16 offsets with an exclusive end, not UTF-8 bytes or Unicode code points.
|
|
32
|
+
|
|
33
|
+
Persist source, a stable documentId, annotation ID/type/data/anchors, and your application document version when needed. anchor.revision belongs to the current engine session, not a cross-session identity. If quote no longer matches the range, relocation succeeds only for one unique match in the source. Missing/ambiguous matches or a mismatched documentId skip that anchor. Without quote, a mismatched revision also skips it. This is not automatic position transformation for collaborative editing.
|
|
34
|
+
|
|
35
|
+
## Three selection forms
|
|
36
|
+
|
|
37
|
+
| Field | Meaning |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| text | Readable selected text |
|
|
40
|
+
| raw | Mapped original ranges and source |
|
|
41
|
+
| syntax | Absorbs adjacent standard Markdown delimiters at each edge, without selecting extra words or outer custom tags |
|
|
42
|
+
| blocks | Ranges and source for touched blocks |
|
|
43
|
+
| quality | exact, atomic, or unmapped |
|
|
44
|
+
| settled | False while a pointer selection is changing |
|
|
45
|
+
| documentId / revision | Owning document snapshot |
|
|
46
|
+
|
|
47
|
+
Each result has ranges and sourceText. Notes usually use syntax.ranges. Store document.source.slice(start, end) as quote for **every range**. Code supports partial selection; math and images are atomic. Do not infer offsets from DOM textContent lengths: entities, escapes, and emoji make those coordinates differ.
|
|
48
|
+
|
|
49
|
+
## Highlights and commands
|
|
50
|
+
|
|
51
|
+
highlight needs no extra AnnotationType. Its data supports color, style (background / underline / dotted / wavy), and hidden. Deleting content annotations differs from hiding their highlight.
|
|
52
|
+
|
|
53
|
+
| Command | Behavior |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| addAnnotation(annotation, options?) | Adds/replaces an ID; ordinary content annotations also get a shared persistent highlight by default |
|
|
56
|
+
| updateAnnotation(id, partial) | Shallowly merges fields; data is replaced as a whole, so retain needed fields |
|
|
57
|
+
| removeAnnotation(id) | Removes that annotation, preserving other annotations and shared highlights |
|
|
58
|
+
| removeAnnotationsAt(ranges) | Removes annotations/highlights at exact matching fragments, retaining other anchors |
|
|
59
|
+
| editAnnotation(id / null) | Changes shared editing state; setting an ID also activates its card |
|
|
60
|
+
| activateAnnotation(id / null) | Opens the annotation's first occurrence, or accepts an explicit occurrence ID |
|
|
61
|
+
|
|
62
|
+
addAnnotation accepts highlight: false to suppress automatic persistent highlighting, explicit HighlightData to choose its style, and edit: true to enter editing. Types configured with highlight: 'hover' do not add persistent highlights by default, but an explicit appearance still creates one. Default toolbar actions are palette, add/hide highlight, copy, and delete. actions replaces built-in actions; plugin actions are still merged in.
|
|
63
|
+
|
|
64
|
+
## Citation hover highlights
|
|
65
|
+
|
|
66
|
+
Citations default to highlight: 'hover'. Hovering a marker or sidebar item, or activating a reference, paints the referenced text with an 18% tint of the type's color behind the text. Clicking pins the highlight after the pointer leaves; it disappears once the reference is neither active nor hovered. Active and hovered references to the same paragraph do not stack their tints. This feedback never updates annotations or saved hidden settings. Embedded refs use their nearest paragraph, heading, list item, or table cell. External references use their own range; the first line anchors sidebar alignment.
|
|
67
|
+
|
|
68
|
+
Sidebar alignment translates the prose without changing the page's scroll range. Paint updates throughout that animation and on completion or cancellation, so text entering from outside the viewport receives the current hover or active feedback.
|
|
69
|
+
|
|
70
|
+
Disable it with replaceExtension(standard(), citation({ highlight: false })). Other types can opt into highlight: 'hover'.
|
|
71
|
+
|
|
72
|
+
## Missing plugins
|
|
73
|
+
|
|
74
|
+
The current implementation **does not silently ignore unknown annotation types**. It retains data/ranges and may show a generic dot marker. Without Content, the card shows the localized unavailable label and type name. A missing citation definition may also show unavailable content. Install the matching plugin, or let the application decide which annotations to hide temporarily.
|
|
75
|
+
|
|
76
|
+
If filtering unsupported types, retain the full persisted array and merge hidden data back when accepting edits, so disabling a plugin cannot discard data. Playground plugin checkboxes currently toggle action entries while retaining card renderers; they do not simulate uninstalling a plugin.
|
|
77
|
+
|
|
78
|
+
## Cards and async resources
|
|
79
|
+
|
|
80
|
+
Modules register Content for annotation content, overlay.Card for the whole floating card interior, and sidebar.Preview for a local collapsed summary. AnnotationMarkdown reuses Markdown configuration with an isolated selection scope.
|
|
81
|
+
|
|
82
|
+
load(annotation, { signal }) runs when content is displayed, sharing requests and a bounded cache within one reader. Separate readers are isolated. Preview never invokes load. Content receives data, loading, error, retry, editing, presentation, and expanded; the module renders loading/error UI. Refresh with useLiMR().invalidateAnnotation(id).
|
|
83
|
+
|
|
84
|
+
Action signals abort when the reader is disposed, not when the menu closes. Preserve question fields when replacing data with streamed answers. Stopping generation, retries, authentication, conversation state, and storage belong to the application adapter. See the [assistant example](../../examples/assistant.tsx) and [extension development](extensions.md).
|
package/docs/en/api.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
> Reading note: this page uses LiMR syntax and interactive examples. Some content cannot be fully displayed by ordinary Markdown viewers such as GitHub; visit the [GitHub Pages documentation](https://linloir.github.io/LiMR/#/docs/en/api) for the best reading experience.
|
|
4
|
+
|
|
5
|
+
[Documentation](README.md) · [简体中文](../zh-CN/api.md)
|
|
6
|
+
|
|
7
|
+
## Entry points
|
|
8
|
+
|
|
9
|
+
| Entry | Contents |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| @linloir/limr | All public core, React, and extension APIs |
|
|
12
|
+
| @linloir/limr/core | DOM/React-free engine, selection calculations, tree helpers, caches, data types |
|
|
13
|
+
| @linloir/limr/react | Components, hooks, locales, React types |
|
|
14
|
+
| @linloir/limr/extensions | Module factories, definitions, selection actions, AnnotationMarkdown |
|
|
15
|
+
| styles.css / styles/base.css / fonts.css / math.css | Public styles, prefixed by the package name |
|
|
16
|
+
| @linloir/limr/package.json | Package metadata |
|
|
17
|
+
|
|
18
|
+
This is an API guide. Exact TypeScript declarations ship with the package; plugins should use the installed version's declarations.
|
|
19
|
+
|
|
20
|
+
## Shared document configuration
|
|
21
|
+
|
|
22
|
+
Reader, Markdown, and DocumentProvider accept:
|
|
23
|
+
|
|
24
|
+
| Prop | Default / meaning |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| source | Empty string; original Markdown |
|
|
27
|
+
| streaming | false |
|
|
28
|
+
| documentId | Generated; explicit values should be stable and unique on the page |
|
|
29
|
+
| extensions | standard(); the complete extension list |
|
|
30
|
+
| plugins | Appended to the default or explicit list |
|
|
31
|
+
| parameters | Document-wide module parameter overrides |
|
|
32
|
+
| components | NodeRenderer overrides by AST type/custom tag |
|
|
33
|
+
| annotationTypes | Add/override presentation by type |
|
|
34
|
+
| annotations | Internal state if omitted; controlled if supplied |
|
|
35
|
+
| onAnnotationsChange | Next external annotation array, including highlights; required to accept controlled edits |
|
|
36
|
+
| theme | light, dark, or auto |
|
|
37
|
+
| appearance | classic; CSS scope propagated to portals |
|
|
38
|
+
| locale | english; accepts chinese or Partial<LiMRLocale> |
|
|
39
|
+
| justify | false; justify prose/list text |
|
|
40
|
+
| scrollRoot | null/omitted means window |
|
|
41
|
+
| scrollOffset | 24px |
|
|
42
|
+
| onDocumentChange | DocumentSnapshot after updates |
|
|
43
|
+
| onSelectionChange | SelectionSnapshot or null |
|
|
44
|
+
| onAnnotationClick | Activated AnnotationOccurrence |
|
|
45
|
+
| onAnnotationHover | Occurrence or null |
|
|
46
|
+
| onHighlightClick / onHighlightHover | Highlight Annotation; hover exit is null |
|
|
47
|
+
|
|
48
|
+
The default locale is english. Missing partial keys fall back to English. locale affects built-in controls that use LiMRLocale, not document text or third-party copy. Some auxiliary labels (for example Copy LaTeX and translation switch hints) are currently fixed by their modules. The Playground reader-language control demonstrates Chinese/English switching and saves that preference separately in browser storage.
|
|
49
|
+
|
|
50
|
+
## Components
|
|
51
|
+
|
|
52
|
+
| Component | Extra props and defaults |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Reader | toc=true, sidebar=true, fillHeight=true, sidebarBreakpoint=1120, actions, followOutput=false, className/style |
|
|
55
|
+
| Markdown | interactive=true, followOutput=false, className/style |
|
|
56
|
+
| DocumentProvider | children; supplies context to composed views |
|
|
57
|
+
| TableOfContents | title, maxDepth=6, followActive=true, topInset=24, updateHash=false, className/style |
|
|
58
|
+
| AnnotationSidebar | sync='document' / 'none', gap=14, positioner=alignSidebar, renderCard, className/style |
|
|
59
|
+
| AnnotationOverlay | disabled=false, portalRoot, previewWidth=340, maxHeight='80dvh' |
|
|
60
|
+
| SelectionToolbar | actions, portalRoot, maxPanelHeight=260, render, className/style |
|
|
61
|
+
| AnnotationCard | AnnotationOverlayCardProps plus required title and optional bodyLabel |
|
|
62
|
+
| AnnotationContent | annotationId, presentation, expanded=true, enabled=true |
|
|
63
|
+
| AnnotationGroup | occurrence, presentation, expanded=true, enabled=true |
|
|
64
|
+
| AnnotationMarkdown | MarkdownProps with required source; interactive=false by default |
|
|
65
|
+
| InlineMarker | Required label, color, children, button props/ref |
|
|
66
|
+
| ToolIcon | name and SVG props; e.g. note, copy, sparkles, highlight |
|
|
67
|
+
|
|
68
|
+
Shared views/hooks require a provider, except standalone Markdown and Reader. AnnotationCard is an interior template, not its own portal. sidebar.renderCard receives occurrence/active/activate; toolbar.render receives context/actions/run.
|
|
69
|
+
|
|
70
|
+
`SidebarPositioner` receives `{ id, anchorTop, height }[]` and `{ activeId, gap, height?, prioritizeActive? }`, returning a map of IDs to top positions. anchorTop is the first line of referenced text; prioritizeActive distinguishes hovered or active items from the item selected by reading position. The default alignSidebar packs footer cards at rest and prioritizes the current item during interaction.
|
|
71
|
+
|
|
72
|
+
## Hooks
|
|
73
|
+
|
|
74
|
+
| Hook | Result |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| useDocument() | Complete snapshot |
|
|
77
|
+
| useDocumentSelector(select) | Selected value; unchanged references avoid rerenders |
|
|
78
|
+
| useLocale() | Merged locale; built-in language is en / zh-CN for plugin dictionaries |
|
|
79
|
+
| useSelection() | Selection or null |
|
|
80
|
+
| useAnnotation(id) | Annotation or undefined |
|
|
81
|
+
| useAnnotations() | Annotations Map and occurrences, combining embedded and external data |
|
|
82
|
+
| useAnnotationState() | Active/hovered occurrence IDs plus activate/hover |
|
|
83
|
+
| useAnchor(occurrenceId) | Element, viewport rect, contentRect; null until mounted |
|
|
84
|
+
| useRendererParameter(name) | Host override or last registered default |
|
|
85
|
+
| useLiMR() | Engine, commands, signal, clearSelection, scrollToHeading, scrollToAnnotation, invalidateAnnotation |
|
|
86
|
+
|
|
87
|
+
useRuntime and useTheme are not public APIs. useLocale, locale.language, and localized annotation labels are available from 1.0.0. See [annotations](annotations.md) for commands and [extensions](extensions.md) for renderer/action contracts.
|
|
88
|
+
|
|
89
|
+
## Core engine
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { createDocument, selectionFromRange } from '@linloir/limr/core';
|
|
93
|
+
|
|
94
|
+
const engine = createDocument('# Hello\n\nText', { id: 'core-doc', streaming: true });
|
|
95
|
+
engine.append('\n\nMore text.');
|
|
96
|
+
const document = engine.finish();
|
|
97
|
+
const selection = selectionFromRange(document, { start: 9, end: 13 });
|
|
98
|
+
console.log(document.headings, selection.syntax.sourceText);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
createDocument(source?, { id?, extensions?, streaming? }) returns DocumentEngine. Read with getSnapshot(); subscribe(listener) returns an unsubscribe function. update(source, { streaming? }) replaces the complete input, append(chunk) appends in streaming mode, finish() finalizes, and setExtensions(list) changes parsing configuration.
|
|
102
|
+
|
|
103
|
+
Core defaults to extensions=[]. Use SyntaxExtension with micromark/mdast for a strictly React-free parser; importing standard from the React extension entry introduces React dependencies.
|
|
104
|
+
|
|
105
|
+
DocumentSnapshot contains id, revision, source, streaming, blocks, headings, definitions, footnotes, footnoteOrder, annotations, occurrences, diagnostics, and metrics. Its annotations are **parsed from source**. Use useAnnotations for merged external data.
|
|
106
|
+
|
|
107
|
+
Other core exports include walk, textContent, rangeOf, intersects, safeUrl, mapText, selectionFromRange, replaceExtension, resolveAnnotationAnchors, annotationReferenceRange, sameRange, defaultHighlight, LruCache, and ResourceCache. ResourceCache.acquire returns promise/release; invalidate clears a key or everything.
|