@pyreon/code 0.11.4 → 0.11.5
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/lib/analysis/index.js.html +1 -1
- package/lib/index.js +42 -20
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/diff-editor.tsx +49 -36
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"\u0000rolldown/runtime.js","uid":"96363bbd-1"},{"name":"home/runner/work/pyreon/pyreon/packages/core/core/lib/jsx-runtime.js","uid":"96363bbd-3"},{"name":"src","children":[{"name":"components","children":[{"uid":"96363bbd-5","name":"code-editor.tsx"},{"uid":"96363bbd-11","name":"diff-editor.tsx"},{"uid":"96363bbd-13","name":"tabbed-editor.tsx"}]},{"uid":"96363bbd-7","name":"languages.ts"},{"uid":"96363bbd-9","name":"themes.ts"},{"uid":"96363bbd-15","name":"minimap.ts"},{"uid":"96363bbd-17","name":"editor.ts"},{"uid":"96363bbd-19","name":"index.ts"}]}]},{"name":"dist-5FA-omYL.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+go@1.0.1/node_modules/@lezer/go/dist/index.js","uid":"96363bbd-21"},{"name":"@codemirror+lang-go@6.0.1/node_modules/@codemirror/lang-go/dist/index.js","uid":"96363bbd-23"}]}]},{"name":"dist-BisvZuec.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js","uid":"96363bbd-25"},{"name":"@codemirror+lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js","uid":"96363bbd-27"}]}]},{"name":"dist-BrE8YJpx.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js","uid":"96363bbd-29"},{"name":"@codemirror+lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js","uid":"96363bbd-31"}]}]},{"name":"dist-BxzbGcJt.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+cpp@1.1.5/node_modules/@lezer/cpp/dist/index.js","uid":"96363bbd-33"},{"name":"@codemirror+lang-cpp@6.0.3/node_modules/@codemirror/lang-cpp/dist/index.js","uid":"96363bbd-35"}]}]},{"name":"dist-CXUY-Nzh.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+rust@1.0.2/node_modules/@lezer/rust/dist/index.js","uid":"96363bbd-37"},{"name":"@codemirror+lang-rust@6.0.2/node_modules/@codemirror/lang-rust/dist/index.js","uid":"96363bbd-39"}]}]},{"name":"dist-CfapY6Xm.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+common@1.5.1/node_modules/@lezer/common/dist/index.js","uid":"96363bbd-41"},{"name":"@lezer+lr@1.4.8/node_modules/@lezer/lr/dist/index.js","uid":"96363bbd-43"},{"name":"@lezer+highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js","uid":"96363bbd-45"}]}]},{"name":"dist-CkzBqhDP.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+css@1.3.3/node_modules/@lezer/css/dist/index.js","uid":"96363bbd-47"},{"name":"@codemirror+lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js","uid":"96363bbd-49"}]}]},{"name":"dist-DGt-lmGy.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js","uid":"96363bbd-51"}]},{"name":"dist-DqTrMnaP.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+xml@1.0.6/node_modules/@lezer/xml/dist/index.js","uid":"96363bbd-53"},{"name":"@codemirror+lang-xml@6.1.0/node_modules/@codemirror/lang-xml/dist/index.js","uid":"96363bbd-55"}]}]},{"name":"dist-DwKx52QE.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+php@1.0.5/node_modules/@lezer/php/dist/index.js","uid":"96363bbd-57"},{"name":"@codemirror+lang-php@6.0.2/node_modules/@codemirror/lang-php/dist/index.js","uid":"96363bbd-59"}]}]},{"name":"dist-Oei2Buyd.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+yaml@1.0.4/node_modules/@lezer/yaml/dist/index.js","uid":"96363bbd-61"},{"name":"@codemirror+lang-yaml@6.1.3/node_modules/@codemirror/lang-yaml/dist/index.js","uid":"96363bbd-63"}]}]},{"name":"dist-TrbJHyZy.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+python@1.1.18/node_modules/@lezer/python/dist/index.js","uid":"96363bbd-65"},{"name":"@codemirror+lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js","uid":"96363bbd-67"}]}]},{"name":"dist-jF2joTkO.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+java@1.1.3/node_modules/@lezer/java/dist/index.js","uid":"96363bbd-69"},{"name":"@codemirror+lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js","uid":"96363bbd-71"}]}]},{"name":"dist-pDxtX_z4.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js","uid":"96363bbd-73"},{"name":"@codemirror+lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js","uid":"96363bbd-75"}]}]},{"name":"dist-sGMMCnKq.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js","uid":"96363bbd-77"},{"name":"@codemirror+lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js","uid":"96363bbd-79"}]}]}],"isRoot":true},"nodeParts":{"96363bbd-1":{"renderedLength":848,"gzipLength":487,"brotliLength":0,"metaUid":"96363bbd-0"},"96363bbd-3":{"renderedLength":1599,"gzipLength":807,"brotliLength":0,"metaUid":"96363bbd-2"},"96363bbd-5":{"renderedLength":731,"gzipLength":441,"brotliLength":0,"metaUid":"96363bbd-4"},"96363bbd-7":{"renderedLength":2245,"gzipLength":736,"brotliLength":0,"metaUid":"96363bbd-6"},"96363bbd-9":{"renderedLength":1544,"gzipLength":554,"brotliLength":0,"metaUid":"96363bbd-8"},"96363bbd-11":{"renderedLength":1594,"gzipLength":734,"brotliLength":0,"metaUid":"96363bbd-10"},"96363bbd-13":{"renderedLength":2681,"gzipLength":1174,"brotliLength":0,"metaUid":"96363bbd-12"},"96363bbd-15":{"renderedLength":3907,"gzipLength":1561,"brotliLength":0,"metaUid":"96363bbd-14"},"96363bbd-17":{"renderedLength":11849,"gzipLength":3501,"brotliLength":0,"metaUid":"96363bbd-16"},"96363bbd-19":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"96363bbd-18"},"96363bbd-21":{"renderedLength":28601,"gzipLength":11397,"brotliLength":0,"metaUid":"96363bbd-20"},"96363bbd-23":{"renderedLength":6785,"gzipLength":2297,"brotliLength":0,"metaUid":"96363bbd-22"},"96363bbd-25":{"renderedLength":1938,"gzipLength":1154,"brotliLength":0,"metaUid":"96363bbd-24"},"96363bbd-27":{"renderedLength":756,"gzipLength":427,"brotliLength":0,"metaUid":"96363bbd-26"},"96363bbd-29":{"renderedLength":20067,"gzipLength":7172,"brotliLength":0,"metaUid":"96363bbd-28"},"96363bbd-31":{"renderedLength":22646,"gzipLength":6816,"brotliLength":0,"metaUid":"96363bbd-30"},"96363bbd-33":{"renderedLength":102369,"gzipLength":33579,"brotliLength":0,"metaUid":"96363bbd-32"},"96363bbd-35":{"renderedLength":1473,"gzipLength":734,"brotliLength":0,"metaUid":"96363bbd-34"},"96363bbd-37":{"renderedLength":72535,"gzipLength":25860,"brotliLength":0,"metaUid":"96363bbd-36"},"96363bbd-39":{"renderedLength":1193,"gzipLength":672,"brotliLength":0,"metaUid":"96363bbd-38"},"96363bbd-41":{"renderedLength":63580,"gzipLength":17558,"brotliLength":0,"metaUid":"96363bbd-40"},"96363bbd-43":{"renderedLength":48118,"gzipLength":13327,"brotliLength":0,"metaUid":"96363bbd-42"},"96363bbd-45":{"renderedLength":14883,"gzipLength":5154,"brotliLength":0,"metaUid":"96363bbd-44"},"96363bbd-47":{"renderedLength":18528,"gzipLength":8035,"brotliLength":0,"metaUid":"96363bbd-46"},"96363bbd-49":{"renderedLength":15651,"gzipLength":5292,"brotliLength":0,"metaUid":"96363bbd-48"},"96363bbd-51":{"renderedLength":44478,"gzipLength":14909,"brotliLength":0,"metaUid":"96363bbd-50"},"96363bbd-53":{"renderedLength":10378,"gzipLength":4022,"brotliLength":0,"metaUid":"96363bbd-52"},"96363bbd-55":{"renderedLength":11204,"gzipLength":3380,"brotliLength":0,"metaUid":"96363bbd-54"},"96363bbd-57":{"renderedLength":100189,"gzipLength":28339,"brotliLength":0,"metaUid":"96363bbd-56"},"96363bbd-59":{"renderedLength":2340,"gzipLength":1091,"brotliLength":0,"metaUid":"96363bbd-58"},"96363bbd-61":{"renderedLength":15737,"gzipLength":5561,"brotliLength":0,"metaUid":"96363bbd-60"},"96363bbd-63":{"renderedLength":2694,"gzipLength":1257,"brotliLength":0,"metaUid":"96363bbd-62"},"96363bbd-65":{"renderedLength":43367,"gzipLength":17192,"brotliLength":0,"metaUid":"96363bbd-64"},"96363bbd-67":{"renderedLength":11179,"gzipLength":3599,"brotliLength":0,"metaUid":"96363bbd-66"},"96363bbd-69":{"renderedLength":40941,"gzipLength":16436,"brotliLength":0,"metaUid":"96363bbd-68"},"96363bbd-71":{"renderedLength":1550,"gzipLength":788,"brotliLength":0,"metaUid":"96363bbd-70"},"96363bbd-73":{"renderedLength":81010,"gzipLength":31199,"brotliLength":0,"metaUid":"96363bbd-72"},"96363bbd-75":{"renderedLength":12490,"gzipLength":3908,"brotliLength":0,"metaUid":"96363bbd-74"},"96363bbd-77":{"renderedLength":66310,"gzipLength":17756,"brotliLength":0,"metaUid":"96363bbd-76"},"96363bbd-79":{"renderedLength":17438,"gzipLength":5526,"brotliLength":0,"metaUid":"96363bbd-78"}},"nodeMetas":{"96363bbd-0":{"id":"\u0000rolldown/runtime.js","moduleParts":{"index.js":"96363bbd-1"},"imported":[],"importedBy":[]},"96363bbd-2":{"id":"/home/runner/work/pyreon/pyreon/packages/core/core/lib/jsx-runtime.js","moduleParts":{"index.js":"96363bbd-3"},"imported":[],"importedBy":[{"uid":"96363bbd-4"},{"uid":"96363bbd-10"},{"uid":"96363bbd-12"}]},"96363bbd-4":{"id":"/src/components/code-editor.tsx","moduleParts":{"index.js":"96363bbd-5"},"imported":[{"uid":"96363bbd-2"}],"importedBy":[{"uid":"96363bbd-18"},{"uid":"96363bbd-12"}]},"96363bbd-6":{"id":"/src/languages.ts","moduleParts":{"index.js":"96363bbd-7"},"imported":[{"uid":"96363bbd-74","dynamic":true},{"uid":"96363bbd-30","dynamic":true},{"uid":"96363bbd-48","dynamic":true},{"uid":"96363bbd-26","dynamic":true},{"uid":"96363bbd-78","dynamic":true},{"uid":"96363bbd-66","dynamic":true},{"uid":"96363bbd-38","dynamic":true},{"uid":"96363bbd-50","dynamic":true},{"uid":"96363bbd-54","dynamic":true},{"uid":"96363bbd-62","dynamic":true},{"uid":"96363bbd-34","dynamic":true},{"uid":"96363bbd-70","dynamic":true},{"uid":"96363bbd-22","dynamic":true},{"uid":"96363bbd-58","dynamic":true}],"importedBy":[{"uid":"96363bbd-18"},{"uid":"96363bbd-10"},{"uid":"96363bbd-16"}]},"96363bbd-8":{"id":"/src/themes.ts","moduleParts":{"index.js":"96363bbd-9"},"imported":[{"uid":"96363bbd-83"}],"importedBy":[{"uid":"96363bbd-18"},{"uid":"96363bbd-10"},{"uid":"96363bbd-16"}]},"96363bbd-10":{"id":"/src/components/diff-editor.tsx","moduleParts":{"index.js":"96363bbd-11"},"imported":[{"uid":"96363bbd-80"},{"uid":"96363bbd-81"},{"uid":"96363bbd-82"},{"uid":"96363bbd-83"},{"uid":"96363bbd-6"},{"uid":"96363bbd-8"},{"uid":"96363bbd-2"}],"importedBy":[{"uid":"96363bbd-18"}]},"96363bbd-12":{"id":"/src/components/tabbed-editor.tsx","moduleParts":{"index.js":"96363bbd-13"},"imported":[{"uid":"96363bbd-4"},{"uid":"96363bbd-2"}],"importedBy":[{"uid":"96363bbd-18"}]},"96363bbd-14":{"id":"/src/minimap.ts","moduleParts":{"index.js":"96363bbd-15"},"imported":[{"uid":"96363bbd-83"}],"importedBy":[{"uid":"96363bbd-18"},{"uid":"96363bbd-16"}]},"96363bbd-16":{"id":"/src/editor.ts","moduleParts":{"index.js":"96363bbd-17"},"imported":[{"uid":"96363bbd-84"},{"uid":"96363bbd-85"},{"uid":"96363bbd-80"},{"uid":"96363bbd-86"},{"uid":"96363bbd-87"},{"uid":"96363bbd-82"},{"uid":"96363bbd-83"},{"uid":"96363bbd-88"},{"uid":"96363bbd-6"},{"uid":"96363bbd-14"},{"uid":"96363bbd-8"}],"importedBy":[{"uid":"96363bbd-18"}]},"96363bbd-18":{"id":"/src/index.ts","moduleParts":{"index.js":"96363bbd-19"},"imported":[{"uid":"96363bbd-4"},{"uid":"96363bbd-10"},{"uid":"96363bbd-12"},{"uid":"96363bbd-16"},{"uid":"96363bbd-6"},{"uid":"96363bbd-14"},{"uid":"96363bbd-8"}],"importedBy":[],"isEntry":true},"96363bbd-20":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+go@1.0.1/node_modules/@lezer/go/dist/index.js","moduleParts":{"dist-5FA-omYL.js":"96363bbd-21"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-22"}]},"96363bbd-22":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-go@6.0.1/node_modules/@codemirror/lang-go/dist/index.js","moduleParts":{"dist-5FA-omYL.js":"96363bbd-23"},"imported":[{"uid":"96363bbd-20"},{"uid":"96363bbd-80"},{"uid":"96363bbd-84"},{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-24":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js","moduleParts":{"dist-BisvZuec.js":"96363bbd-25"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-26"}]},"96363bbd-26":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js","moduleParts":{"dist-BisvZuec.js":"96363bbd-27"},"imported":[{"uid":"96363bbd-24"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-28":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js","moduleParts":{"dist-BrE8YJpx.js":"96363bbd-29"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"},{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-30"}]},"96363bbd-30":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js","moduleParts":{"dist-BrE8YJpx.js":"96363bbd-31"},"imported":[{"uid":"96363bbd-28"},{"uid":"96363bbd-48"},{"uid":"96363bbd-74"},{"uid":"96363bbd-83"},{"uid":"96363bbd-82"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"},{"uid":"96363bbd-78"},{"uid":"96363bbd-58"}]},"96363bbd-32":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+cpp@1.1.5/node_modules/@lezer/cpp/dist/index.js","moduleParts":{"dist-BxzbGcJt.js":"96363bbd-33"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-34"}]},"96363bbd-34":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-cpp@6.0.3/node_modules/@codemirror/lang-cpp/dist/index.js","moduleParts":{"dist-BxzbGcJt.js":"96363bbd-35"},"imported":[{"uid":"96363bbd-32"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-36":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+rust@1.0.2/node_modules/@lezer/rust/dist/index.js","moduleParts":{"dist-CXUY-Nzh.js":"96363bbd-37"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-38"}]},"96363bbd-38":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-rust@6.0.2/node_modules/@codemirror/lang-rust/dist/index.js","moduleParts":{"dist-CXUY-Nzh.js":"96363bbd-39"},"imported":[{"uid":"96363bbd-36"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-40":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+common@1.5.1/node_modules/@lezer/common/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"96363bbd-41"},"imported":[],"importedBy":[{"uid":"96363bbd-74"},{"uid":"96363bbd-48"},{"uid":"96363bbd-78"},{"uid":"96363bbd-66"},{"uid":"96363bbd-62"},{"uid":"96363bbd-22"},{"uid":"96363bbd-58"},{"uid":"96363bbd-28"},{"uid":"96363bbd-76"},{"uid":"96363bbd-44"},{"uid":"96363bbd-42"}]},"96363bbd-42":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+lr@1.4.8/node_modules/@lezer/lr/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"96363bbd-43"},"imported":[{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-50"},{"uid":"96363bbd-62"},{"uid":"96363bbd-72"},{"uid":"96363bbd-28"},{"uid":"96363bbd-46"},{"uid":"96363bbd-24"},{"uid":"96363bbd-64"},{"uid":"96363bbd-36"},{"uid":"96363bbd-52"},{"uid":"96363bbd-60"},{"uid":"96363bbd-32"},{"uid":"96363bbd-68"},{"uid":"96363bbd-20"},{"uid":"96363bbd-56"}]},"96363bbd-44":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"96363bbd-45"},"imported":[{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-50"},{"uid":"96363bbd-62"},{"uid":"96363bbd-72"},{"uid":"96363bbd-28"},{"uid":"96363bbd-46"},{"uid":"96363bbd-24"},{"uid":"96363bbd-76"},{"uid":"96363bbd-64"},{"uid":"96363bbd-36"},{"uid":"96363bbd-52"},{"uid":"96363bbd-60"},{"uid":"96363bbd-32"},{"uid":"96363bbd-68"},{"uid":"96363bbd-20"},{"uid":"96363bbd-56"}]},"96363bbd-46":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+css@1.3.3/node_modules/@lezer/css/dist/index.js","moduleParts":{"dist-CkzBqhDP.js":"96363bbd-47"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-48"}]},"96363bbd-48":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js","moduleParts":{"dist-CkzBqhDP.js":"96363bbd-49"},"imported":[{"uid":"96363bbd-46"},{"uid":"96363bbd-80"},{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-6"},{"uid":"96363bbd-30"}]},"96363bbd-50":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js","moduleParts":{"dist-DGt-lmGy.js":"96363bbd-51"},"imported":[{"uid":"96363bbd-80"},{"uid":"96363bbd-44"},{"uid":"96363bbd-42"},{"uid":"96363bbd-84"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-52":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+xml@1.0.6/node_modules/@lezer/xml/dist/index.js","moduleParts":{"dist-DqTrMnaP.js":"96363bbd-53"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-54"}]},"96363bbd-54":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-xml@6.1.0/node_modules/@codemirror/lang-xml/dist/index.js","moduleParts":{"dist-DqTrMnaP.js":"96363bbd-55"},"imported":[{"uid":"96363bbd-52"},{"uid":"96363bbd-80"},{"uid":"96363bbd-82"},{"uid":"96363bbd-83"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-56":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+php@1.0.5/node_modules/@lezer/php/dist/index.js","moduleParts":{"dist-DwKx52QE.js":"96363bbd-57"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-58"}]},"96363bbd-58":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-php@6.0.2/node_modules/@codemirror/lang-php/dist/index.js","moduleParts":{"dist-DwKx52QE.js":"96363bbd-59"},"imported":[{"uid":"96363bbd-56"},{"uid":"96363bbd-40"},{"uid":"96363bbd-30"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-60":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+yaml@1.0.4/node_modules/@lezer/yaml/dist/index.js","moduleParts":{"dist-Oei2Buyd.js":"96363bbd-61"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-62"}]},"96363bbd-62":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-yaml@6.1.3/node_modules/@codemirror/lang-yaml/dist/index.js","moduleParts":{"dist-Oei2Buyd.js":"96363bbd-63"},"imported":[{"uid":"96363bbd-60"},{"uid":"96363bbd-80"},{"uid":"96363bbd-40"},{"uid":"96363bbd-44"},{"uid":"96363bbd-42"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-64":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+python@1.1.18/node_modules/@lezer/python/dist/index.js","moduleParts":{"dist-TrbJHyZy.js":"96363bbd-65"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-66"}]},"96363bbd-66":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js","moduleParts":{"dist-TrbJHyZy.js":"96363bbd-67"},"imported":[{"uid":"96363bbd-64"},{"uid":"96363bbd-80"},{"uid":"96363bbd-40"},{"uid":"96363bbd-84"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-68":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+java@1.1.3/node_modules/@lezer/java/dist/index.js","moduleParts":{"dist-jF2joTkO.js":"96363bbd-69"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-70"}]},"96363bbd-70":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js","moduleParts":{"dist-jF2joTkO.js":"96363bbd-71"},"imported":[{"uid":"96363bbd-68"},{"uid":"96363bbd-80"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-72":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js","moduleParts":{"dist-pDxtX_z4.js":"96363bbd-73"},"imported":[{"uid":"96363bbd-42"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-74"}]},"96363bbd-74":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js","moduleParts":{"dist-pDxtX_z4.js":"96363bbd-75"},"imported":[{"uid":"96363bbd-72"},{"uid":"96363bbd-80"},{"uid":"96363bbd-82"},{"uid":"96363bbd-83"},{"uid":"96363bbd-84"},{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-6"},{"uid":"96363bbd-30"}]},"96363bbd-76":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js","moduleParts":{"dist-sGMMCnKq.js":"96363bbd-77"},"imported":[{"uid":"96363bbd-40"},{"uid":"96363bbd-44"}],"importedBy":[{"uid":"96363bbd-78"}]},"96363bbd-78":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js","moduleParts":{"dist-sGMMCnKq.js":"96363bbd-79"},"imported":[{"uid":"96363bbd-82"},{"uid":"96363bbd-83"},{"uid":"96363bbd-80"},{"uid":"96363bbd-84"},{"uid":"96363bbd-76"},{"uid":"96363bbd-30"},{"uid":"96363bbd-40"}],"importedBy":[{"uid":"96363bbd-6"}]},"96363bbd-80":{"id":"@codemirror/language","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-10"},{"uid":"96363bbd-16"},{"uid":"96363bbd-74"},{"uid":"96363bbd-30"},{"uid":"96363bbd-48"},{"uid":"96363bbd-26"},{"uid":"96363bbd-78"},{"uid":"96363bbd-66"},{"uid":"96363bbd-38"},{"uid":"96363bbd-50"},{"uid":"96363bbd-54"},{"uid":"96363bbd-62"},{"uid":"96363bbd-34"},{"uid":"96363bbd-70"},{"uid":"96363bbd-22"},{"uid":"96363bbd-58"}]},"96363bbd-81":{"id":"@codemirror/merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-10"}]},"96363bbd-82":{"id":"@codemirror/state","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-10"},{"uid":"96363bbd-16"},{"uid":"96363bbd-74"},{"uid":"96363bbd-30"},{"uid":"96363bbd-78"},{"uid":"96363bbd-54"}]},"96363bbd-83":{"id":"@codemirror/view","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-10"},{"uid":"96363bbd-16"},{"uid":"96363bbd-14"},{"uid":"96363bbd-8"},{"uid":"96363bbd-74"},{"uid":"96363bbd-30"},{"uid":"96363bbd-78"},{"uid":"96363bbd-54"}]},"96363bbd-84":{"id":"@codemirror/autocomplete","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-16"},{"uid":"96363bbd-74"},{"uid":"96363bbd-78"},{"uid":"96363bbd-66"},{"uid":"96363bbd-50"},{"uid":"96363bbd-22"}]},"96363bbd-85":{"id":"@codemirror/commands","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-16"}]},"96363bbd-86":{"id":"@codemirror/lint","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-16"}]},"96363bbd-87":{"id":"@codemirror/search","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-16"}]},"96363bbd-88":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"96363bbd-16"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"\u0000rolldown/runtime.js","uid":"328803c4-1"},{"name":"home/runner/work/pyreon/pyreon/packages/core/core/lib/jsx-runtime.js","uid":"328803c4-3"},{"name":"src","children":[{"name":"components","children":[{"uid":"328803c4-5","name":"code-editor.tsx"},{"uid":"328803c4-11","name":"diff-editor.tsx"},{"uid":"328803c4-13","name":"tabbed-editor.tsx"}]},{"uid":"328803c4-7","name":"languages.ts"},{"uid":"328803c4-9","name":"themes.ts"},{"uid":"328803c4-15","name":"minimap.ts"},{"uid":"328803c4-17","name":"editor.ts"},{"uid":"328803c4-19","name":"index.ts"}]}]},{"name":"dist-5FA-omYL.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+go@1.0.1/node_modules/@lezer/go/dist/index.js","uid":"328803c4-21"},{"name":"@codemirror+lang-go@6.0.1/node_modules/@codemirror/lang-go/dist/index.js","uid":"328803c4-23"}]}]},{"name":"dist-BisvZuec.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js","uid":"328803c4-25"},{"name":"@codemirror+lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js","uid":"328803c4-27"}]}]},{"name":"dist-BrE8YJpx.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js","uid":"328803c4-29"},{"name":"@codemirror+lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js","uid":"328803c4-31"}]}]},{"name":"dist-BxzbGcJt.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+cpp@1.1.5/node_modules/@lezer/cpp/dist/index.js","uid":"328803c4-33"},{"name":"@codemirror+lang-cpp@6.0.3/node_modules/@codemirror/lang-cpp/dist/index.js","uid":"328803c4-35"}]}]},{"name":"dist-CXUY-Nzh.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+rust@1.0.2/node_modules/@lezer/rust/dist/index.js","uid":"328803c4-37"},{"name":"@codemirror+lang-rust@6.0.2/node_modules/@codemirror/lang-rust/dist/index.js","uid":"328803c4-39"}]}]},{"name":"dist-CfapY6Xm.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+common@1.5.1/node_modules/@lezer/common/dist/index.js","uid":"328803c4-41"},{"name":"@lezer+lr@1.4.8/node_modules/@lezer/lr/dist/index.js","uid":"328803c4-43"},{"name":"@lezer+highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js","uid":"328803c4-45"}]}]},{"name":"dist-CkzBqhDP.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+css@1.3.3/node_modules/@lezer/css/dist/index.js","uid":"328803c4-47"},{"name":"@codemirror+lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js","uid":"328803c4-49"}]}]},{"name":"dist-DGt-lmGy.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js","uid":"328803c4-51"}]},{"name":"dist-DqTrMnaP.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+xml@1.0.6/node_modules/@lezer/xml/dist/index.js","uid":"328803c4-53"},{"name":"@codemirror+lang-xml@6.1.0/node_modules/@codemirror/lang-xml/dist/index.js","uid":"328803c4-55"}]}]},{"name":"dist-DwKx52QE.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+php@1.0.5/node_modules/@lezer/php/dist/index.js","uid":"328803c4-57"},{"name":"@codemirror+lang-php@6.0.2/node_modules/@codemirror/lang-php/dist/index.js","uid":"328803c4-59"}]}]},{"name":"dist-Oei2Buyd.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+yaml@1.0.4/node_modules/@lezer/yaml/dist/index.js","uid":"328803c4-61"},{"name":"@codemirror+lang-yaml@6.1.3/node_modules/@codemirror/lang-yaml/dist/index.js","uid":"328803c4-63"}]}]},{"name":"dist-TrbJHyZy.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+python@1.1.18/node_modules/@lezer/python/dist/index.js","uid":"328803c4-65"},{"name":"@codemirror+lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js","uid":"328803c4-67"}]}]},{"name":"dist-jF2joTkO.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+java@1.1.3/node_modules/@lezer/java/dist/index.js","uid":"328803c4-69"},{"name":"@codemirror+lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js","uid":"328803c4-71"}]}]},{"name":"dist-pDxtX_z4.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js","uid":"328803c4-73"},{"name":"@codemirror+lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js","uid":"328803c4-75"}]}]},{"name":"dist-sGMMCnKq.js","children":[{"name":"home/runner/work/pyreon/pyreon/node_modules/.bun","children":[{"name":"@lezer+markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js","uid":"328803c4-77"},{"name":"@codemirror+lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js","uid":"328803c4-79"}]}]}],"isRoot":true},"nodeParts":{"328803c4-1":{"renderedLength":848,"gzipLength":487,"brotliLength":0,"metaUid":"328803c4-0"},"328803c4-3":{"renderedLength":1599,"gzipLength":807,"brotliLength":0,"metaUid":"328803c4-2"},"328803c4-5":{"renderedLength":731,"gzipLength":441,"brotliLength":0,"metaUid":"328803c4-4"},"328803c4-7":{"renderedLength":2245,"gzipLength":736,"brotliLength":0,"metaUid":"328803c4-6"},"328803c4-9":{"renderedLength":1544,"gzipLength":554,"brotliLength":0,"metaUid":"328803c4-8"},"328803c4-11":{"renderedLength":2290,"gzipLength":1017,"brotliLength":0,"metaUid":"328803c4-10"},"328803c4-13":{"renderedLength":2681,"gzipLength":1174,"brotliLength":0,"metaUid":"328803c4-12"},"328803c4-15":{"renderedLength":3907,"gzipLength":1561,"brotliLength":0,"metaUid":"328803c4-14"},"328803c4-17":{"renderedLength":11849,"gzipLength":3501,"brotliLength":0,"metaUid":"328803c4-16"},"328803c4-19":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"328803c4-18"},"328803c4-21":{"renderedLength":28601,"gzipLength":11397,"brotliLength":0,"metaUid":"328803c4-20"},"328803c4-23":{"renderedLength":6785,"gzipLength":2297,"brotliLength":0,"metaUid":"328803c4-22"},"328803c4-25":{"renderedLength":1938,"gzipLength":1154,"brotliLength":0,"metaUid":"328803c4-24"},"328803c4-27":{"renderedLength":756,"gzipLength":427,"brotliLength":0,"metaUid":"328803c4-26"},"328803c4-29":{"renderedLength":20067,"gzipLength":7172,"brotliLength":0,"metaUid":"328803c4-28"},"328803c4-31":{"renderedLength":22646,"gzipLength":6816,"brotliLength":0,"metaUid":"328803c4-30"},"328803c4-33":{"renderedLength":102369,"gzipLength":33579,"brotliLength":0,"metaUid":"328803c4-32"},"328803c4-35":{"renderedLength":1473,"gzipLength":734,"brotliLength":0,"metaUid":"328803c4-34"},"328803c4-37":{"renderedLength":72535,"gzipLength":25860,"brotliLength":0,"metaUid":"328803c4-36"},"328803c4-39":{"renderedLength":1193,"gzipLength":672,"brotliLength":0,"metaUid":"328803c4-38"},"328803c4-41":{"renderedLength":63580,"gzipLength":17558,"brotliLength":0,"metaUid":"328803c4-40"},"328803c4-43":{"renderedLength":48118,"gzipLength":13327,"brotliLength":0,"metaUid":"328803c4-42"},"328803c4-45":{"renderedLength":14883,"gzipLength":5154,"brotliLength":0,"metaUid":"328803c4-44"},"328803c4-47":{"renderedLength":18528,"gzipLength":8035,"brotliLength":0,"metaUid":"328803c4-46"},"328803c4-49":{"renderedLength":15651,"gzipLength":5292,"brotliLength":0,"metaUid":"328803c4-48"},"328803c4-51":{"renderedLength":44478,"gzipLength":14909,"brotliLength":0,"metaUid":"328803c4-50"},"328803c4-53":{"renderedLength":10378,"gzipLength":4022,"brotliLength":0,"metaUid":"328803c4-52"},"328803c4-55":{"renderedLength":11204,"gzipLength":3380,"brotliLength":0,"metaUid":"328803c4-54"},"328803c4-57":{"renderedLength":100189,"gzipLength":28339,"brotliLength":0,"metaUid":"328803c4-56"},"328803c4-59":{"renderedLength":2340,"gzipLength":1091,"brotliLength":0,"metaUid":"328803c4-58"},"328803c4-61":{"renderedLength":15737,"gzipLength":5561,"brotliLength":0,"metaUid":"328803c4-60"},"328803c4-63":{"renderedLength":2694,"gzipLength":1257,"brotliLength":0,"metaUid":"328803c4-62"},"328803c4-65":{"renderedLength":43367,"gzipLength":17192,"brotliLength":0,"metaUid":"328803c4-64"},"328803c4-67":{"renderedLength":11179,"gzipLength":3599,"brotliLength":0,"metaUid":"328803c4-66"},"328803c4-69":{"renderedLength":40941,"gzipLength":16436,"brotliLength":0,"metaUid":"328803c4-68"},"328803c4-71":{"renderedLength":1550,"gzipLength":788,"brotliLength":0,"metaUid":"328803c4-70"},"328803c4-73":{"renderedLength":81010,"gzipLength":31199,"brotliLength":0,"metaUid":"328803c4-72"},"328803c4-75":{"renderedLength":12490,"gzipLength":3908,"brotliLength":0,"metaUid":"328803c4-74"},"328803c4-77":{"renderedLength":66310,"gzipLength":17756,"brotliLength":0,"metaUid":"328803c4-76"},"328803c4-79":{"renderedLength":17438,"gzipLength":5526,"brotliLength":0,"metaUid":"328803c4-78"}},"nodeMetas":{"328803c4-0":{"id":"\u0000rolldown/runtime.js","moduleParts":{"index.js":"328803c4-1"},"imported":[],"importedBy":[]},"328803c4-2":{"id":"/home/runner/work/pyreon/pyreon/packages/core/core/lib/jsx-runtime.js","moduleParts":{"index.js":"328803c4-3"},"imported":[],"importedBy":[{"uid":"328803c4-4"},{"uid":"328803c4-10"},{"uid":"328803c4-12"}]},"328803c4-4":{"id":"/src/components/code-editor.tsx","moduleParts":{"index.js":"328803c4-5"},"imported":[{"uid":"328803c4-2"}],"importedBy":[{"uid":"328803c4-18"},{"uid":"328803c4-12"}]},"328803c4-6":{"id":"/src/languages.ts","moduleParts":{"index.js":"328803c4-7"},"imported":[{"uid":"328803c4-74","dynamic":true},{"uid":"328803c4-30","dynamic":true},{"uid":"328803c4-48","dynamic":true},{"uid":"328803c4-26","dynamic":true},{"uid":"328803c4-78","dynamic":true},{"uid":"328803c4-66","dynamic":true},{"uid":"328803c4-38","dynamic":true},{"uid":"328803c4-50","dynamic":true},{"uid":"328803c4-54","dynamic":true},{"uid":"328803c4-62","dynamic":true},{"uid":"328803c4-34","dynamic":true},{"uid":"328803c4-70","dynamic":true},{"uid":"328803c4-22","dynamic":true},{"uid":"328803c4-58","dynamic":true}],"importedBy":[{"uid":"328803c4-18"},{"uid":"328803c4-10"},{"uid":"328803c4-16"}]},"328803c4-8":{"id":"/src/themes.ts","moduleParts":{"index.js":"328803c4-9"},"imported":[{"uid":"328803c4-83"}],"importedBy":[{"uid":"328803c4-18"},{"uid":"328803c4-10"},{"uid":"328803c4-16"}]},"328803c4-10":{"id":"/src/components/diff-editor.tsx","moduleParts":{"index.js":"328803c4-11"},"imported":[{"uid":"328803c4-80"},{"uid":"328803c4-81"},{"uid":"328803c4-82"},{"uid":"328803c4-83"},{"uid":"328803c4-84"},{"uid":"328803c4-85"},{"uid":"328803c4-6"},{"uid":"328803c4-8"},{"uid":"328803c4-2"}],"importedBy":[{"uid":"328803c4-18"}]},"328803c4-12":{"id":"/src/components/tabbed-editor.tsx","moduleParts":{"index.js":"328803c4-13"},"imported":[{"uid":"328803c4-4"},{"uid":"328803c4-2"}],"importedBy":[{"uid":"328803c4-18"}]},"328803c4-14":{"id":"/src/minimap.ts","moduleParts":{"index.js":"328803c4-15"},"imported":[{"uid":"328803c4-83"}],"importedBy":[{"uid":"328803c4-18"},{"uid":"328803c4-16"}]},"328803c4-16":{"id":"/src/editor.ts","moduleParts":{"index.js":"328803c4-17"},"imported":[{"uid":"328803c4-86"},{"uid":"328803c4-87"},{"uid":"328803c4-80"},{"uid":"328803c4-88"},{"uid":"328803c4-89"},{"uid":"328803c4-82"},{"uid":"328803c4-83"},{"uid":"328803c4-85"},{"uid":"328803c4-6"},{"uid":"328803c4-14"},{"uid":"328803c4-8"}],"importedBy":[{"uid":"328803c4-18"}]},"328803c4-18":{"id":"/src/index.ts","moduleParts":{"index.js":"328803c4-19"},"imported":[{"uid":"328803c4-4"},{"uid":"328803c4-10"},{"uid":"328803c4-12"},{"uid":"328803c4-16"},{"uid":"328803c4-6"},{"uid":"328803c4-14"},{"uid":"328803c4-8"}],"importedBy":[],"isEntry":true},"328803c4-20":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+go@1.0.1/node_modules/@lezer/go/dist/index.js","moduleParts":{"dist-5FA-omYL.js":"328803c4-21"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-22"}]},"328803c4-22":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-go@6.0.1/node_modules/@codemirror/lang-go/dist/index.js","moduleParts":{"dist-5FA-omYL.js":"328803c4-23"},"imported":[{"uid":"328803c4-20"},{"uid":"328803c4-80"},{"uid":"328803c4-86"},{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-24":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+json@1.0.3/node_modules/@lezer/json/dist/index.js","moduleParts":{"dist-BisvZuec.js":"328803c4-25"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-26"}]},"328803c4-26":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js","moduleParts":{"dist-BisvZuec.js":"328803c4-27"},"imported":[{"uid":"328803c4-24"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-28":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+html@1.3.13/node_modules/@lezer/html/dist/index.js","moduleParts":{"dist-BrE8YJpx.js":"328803c4-29"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"},{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-30"}]},"328803c4-30":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-html@6.4.11/node_modules/@codemirror/lang-html/dist/index.js","moduleParts":{"dist-BrE8YJpx.js":"328803c4-31"},"imported":[{"uid":"328803c4-28"},{"uid":"328803c4-48"},{"uid":"328803c4-74"},{"uid":"328803c4-83"},{"uid":"328803c4-82"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"},{"uid":"328803c4-78"},{"uid":"328803c4-58"}]},"328803c4-32":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+cpp@1.1.5/node_modules/@lezer/cpp/dist/index.js","moduleParts":{"dist-BxzbGcJt.js":"328803c4-33"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-34"}]},"328803c4-34":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-cpp@6.0.3/node_modules/@codemirror/lang-cpp/dist/index.js","moduleParts":{"dist-BxzbGcJt.js":"328803c4-35"},"imported":[{"uid":"328803c4-32"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-36":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+rust@1.0.2/node_modules/@lezer/rust/dist/index.js","moduleParts":{"dist-CXUY-Nzh.js":"328803c4-37"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-38"}]},"328803c4-38":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-rust@6.0.2/node_modules/@codemirror/lang-rust/dist/index.js","moduleParts":{"dist-CXUY-Nzh.js":"328803c4-39"},"imported":[{"uid":"328803c4-36"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-40":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+common@1.5.1/node_modules/@lezer/common/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"328803c4-41"},"imported":[],"importedBy":[{"uid":"328803c4-74"},{"uid":"328803c4-48"},{"uid":"328803c4-78"},{"uid":"328803c4-66"},{"uid":"328803c4-62"},{"uid":"328803c4-22"},{"uid":"328803c4-58"},{"uid":"328803c4-28"},{"uid":"328803c4-76"},{"uid":"328803c4-44"},{"uid":"328803c4-42"}]},"328803c4-42":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+lr@1.4.8/node_modules/@lezer/lr/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"328803c4-43"},"imported":[{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-50"},{"uid":"328803c4-62"},{"uid":"328803c4-72"},{"uid":"328803c4-28"},{"uid":"328803c4-46"},{"uid":"328803c4-24"},{"uid":"328803c4-64"},{"uid":"328803c4-36"},{"uid":"328803c4-52"},{"uid":"328803c4-60"},{"uid":"328803c4-32"},{"uid":"328803c4-68"},{"uid":"328803c4-20"},{"uid":"328803c4-56"}]},"328803c4-44":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+highlight@1.2.3/node_modules/@lezer/highlight/dist/index.js","moduleParts":{"dist-CfapY6Xm.js":"328803c4-45"},"imported":[{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-50"},{"uid":"328803c4-62"},{"uid":"328803c4-72"},{"uid":"328803c4-28"},{"uid":"328803c4-46"},{"uid":"328803c4-24"},{"uid":"328803c4-76"},{"uid":"328803c4-64"},{"uid":"328803c4-36"},{"uid":"328803c4-52"},{"uid":"328803c4-60"},{"uid":"328803c4-32"},{"uid":"328803c4-68"},{"uid":"328803c4-20"},{"uid":"328803c4-56"}]},"328803c4-46":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+css@1.3.3/node_modules/@lezer/css/dist/index.js","moduleParts":{"dist-CkzBqhDP.js":"328803c4-47"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-48"}]},"328803c4-48":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js","moduleParts":{"dist-CkzBqhDP.js":"328803c4-49"},"imported":[{"uid":"328803c4-46"},{"uid":"328803c4-80"},{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-6"},{"uid":"328803c4-30"}]},"328803c4-50":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js","moduleParts":{"dist-DGt-lmGy.js":"328803c4-51"},"imported":[{"uid":"328803c4-80"},{"uid":"328803c4-44"},{"uid":"328803c4-42"},{"uid":"328803c4-86"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-52":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+xml@1.0.6/node_modules/@lezer/xml/dist/index.js","moduleParts":{"dist-DqTrMnaP.js":"328803c4-53"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-54"}]},"328803c4-54":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-xml@6.1.0/node_modules/@codemirror/lang-xml/dist/index.js","moduleParts":{"dist-DqTrMnaP.js":"328803c4-55"},"imported":[{"uid":"328803c4-52"},{"uid":"328803c4-80"},{"uid":"328803c4-82"},{"uid":"328803c4-83"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-56":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+php@1.0.5/node_modules/@lezer/php/dist/index.js","moduleParts":{"dist-DwKx52QE.js":"328803c4-57"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-58"}]},"328803c4-58":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-php@6.0.2/node_modules/@codemirror/lang-php/dist/index.js","moduleParts":{"dist-DwKx52QE.js":"328803c4-59"},"imported":[{"uid":"328803c4-56"},{"uid":"328803c4-40"},{"uid":"328803c4-30"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-60":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+yaml@1.0.4/node_modules/@lezer/yaml/dist/index.js","moduleParts":{"dist-Oei2Buyd.js":"328803c4-61"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-62"}]},"328803c4-62":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-yaml@6.1.3/node_modules/@codemirror/lang-yaml/dist/index.js","moduleParts":{"dist-Oei2Buyd.js":"328803c4-63"},"imported":[{"uid":"328803c4-60"},{"uid":"328803c4-80"},{"uid":"328803c4-40"},{"uid":"328803c4-44"},{"uid":"328803c4-42"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-64":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+python@1.1.18/node_modules/@lezer/python/dist/index.js","moduleParts":{"dist-TrbJHyZy.js":"328803c4-65"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-66"}]},"328803c4-66":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-python@6.2.1/node_modules/@codemirror/lang-python/dist/index.js","moduleParts":{"dist-TrbJHyZy.js":"328803c4-67"},"imported":[{"uid":"328803c4-64"},{"uid":"328803c4-80"},{"uid":"328803c4-40"},{"uid":"328803c4-86"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-68":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+java@1.1.3/node_modules/@lezer/java/dist/index.js","moduleParts":{"dist-jF2joTkO.js":"328803c4-69"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-70"}]},"328803c4-70":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js","moduleParts":{"dist-jF2joTkO.js":"328803c4-71"},"imported":[{"uid":"328803c4-68"},{"uid":"328803c4-80"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-72":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+javascript@1.5.4/node_modules/@lezer/javascript/dist/index.js","moduleParts":{"dist-pDxtX_z4.js":"328803c4-73"},"imported":[{"uid":"328803c4-42"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-74"}]},"328803c4-74":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js","moduleParts":{"dist-pDxtX_z4.js":"328803c4-75"},"imported":[{"uid":"328803c4-72"},{"uid":"328803c4-80"},{"uid":"328803c4-82"},{"uid":"328803c4-83"},{"uid":"328803c4-86"},{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-6"},{"uid":"328803c4-30"}]},"328803c4-76":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@lezer+markdown@1.6.3/node_modules/@lezer/markdown/dist/index.js","moduleParts":{"dist-sGMMCnKq.js":"328803c4-77"},"imported":[{"uid":"328803c4-40"},{"uid":"328803c4-44"}],"importedBy":[{"uid":"328803c4-78"}]},"328803c4-78":{"id":"/home/runner/work/pyreon/pyreon/node_modules/.bun/@codemirror+lang-markdown@6.5.0/node_modules/@codemirror/lang-markdown/dist/index.js","moduleParts":{"dist-sGMMCnKq.js":"328803c4-79"},"imported":[{"uid":"328803c4-82"},{"uid":"328803c4-83"},{"uid":"328803c4-80"},{"uid":"328803c4-86"},{"uid":"328803c4-76"},{"uid":"328803c4-30"},{"uid":"328803c4-40"}],"importedBy":[{"uid":"328803c4-6"}]},"328803c4-80":{"id":"@codemirror/language","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"},{"uid":"328803c4-16"},{"uid":"328803c4-74"},{"uid":"328803c4-30"},{"uid":"328803c4-48"},{"uid":"328803c4-26"},{"uid":"328803c4-78"},{"uid":"328803c4-66"},{"uid":"328803c4-38"},{"uid":"328803c4-50"},{"uid":"328803c4-54"},{"uid":"328803c4-62"},{"uid":"328803c4-34"},{"uid":"328803c4-70"},{"uid":"328803c4-22"},{"uid":"328803c4-58"}]},"328803c4-81":{"id":"@codemirror/merge","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"}]},"328803c4-82":{"id":"@codemirror/state","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"},{"uid":"328803c4-16"},{"uid":"328803c4-74"},{"uid":"328803c4-30"},{"uid":"328803c4-78"},{"uid":"328803c4-54"}]},"328803c4-83":{"id":"@codemirror/view","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"},{"uid":"328803c4-16"},{"uid":"328803c4-14"},{"uid":"328803c4-8"},{"uid":"328803c4-74"},{"uid":"328803c4-30"},{"uid":"328803c4-78"},{"uid":"328803c4-54"}]},"328803c4-84":{"id":"@pyreon/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"}]},"328803c4-85":{"id":"@pyreon/reactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-10"},{"uid":"328803c4-16"}]},"328803c4-86":{"id":"@codemirror/autocomplete","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-16"},{"uid":"328803c4-74"},{"uid":"328803c4-78"},{"uid":"328803c4-66"},{"uid":"328803c4-50"},{"uid":"328803c4-22"}]},"328803c4-87":{"id":"@codemirror/commands","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-16"}]},"328803c4-88":{"id":"@codemirror/lint","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-16"}]},"328803c4-89":{"id":"@codemirror/search","moduleParts":{},"imported":[],"importedBy":[{"uid":"328803c4-16"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|
package/lib/index.js
CHANGED
|
@@ -2,11 +2,12 @@ import { bracketMatching, defaultHighlightStyle, foldGutter, foldKeymap, indentO
|
|
|
2
2
|
import { MergeView } from "@codemirror/merge";
|
|
3
3
|
import { Compartment, EditorState } from "@codemirror/state";
|
|
4
4
|
import { Decoration, EditorView, GutterMarker, ViewPlugin, crosshairCursor, drawSelection, dropCursor, gutter, highlightActiveLine, highlightActiveLineGutter, keymap, lineNumbers, placeholder, rectangularSelection } from "@codemirror/view";
|
|
5
|
+
import { onUnmount } from "@pyreon/core";
|
|
6
|
+
import { computed, effect, signal, watch } from "@pyreon/reactivity";
|
|
5
7
|
import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap } from "@codemirror/autocomplete";
|
|
6
8
|
import { defaultKeymap, history, historyKeymap, indentWithTab, redo, undo } from "@codemirror/commands";
|
|
7
9
|
import { lintKeymap, setDiagnostics } from "@codemirror/lint";
|
|
8
10
|
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
|
9
|
-
import { computed, effect, signal } from "@pyreon/reactivity";
|
|
10
11
|
|
|
11
12
|
//#region \0rolldown/runtime.js
|
|
12
13
|
var __defProp = Object.defineProperty;
|
|
@@ -233,9 +234,14 @@ function resolveTheme(theme) {
|
|
|
233
234
|
|
|
234
235
|
//#endregion
|
|
235
236
|
//#region src/components/diff-editor.tsx
|
|
237
|
+
const readText = (value) => typeof value === "string" ? value : value();
|
|
238
|
+
const isSignal = (value) => typeof value === "function";
|
|
236
239
|
/**
|
|
237
240
|
* Side-by-side or inline diff editor using @codemirror/merge.
|
|
238
241
|
*
|
|
242
|
+
* Supports reactive `original` and `modified` props — pass a Signal<string>
|
|
243
|
+
* and the diff view updates automatically when the signal changes.
|
|
244
|
+
*
|
|
239
245
|
* @example
|
|
240
246
|
* ```tsx
|
|
241
247
|
* <DiffEditor
|
|
@@ -248,7 +254,9 @@ function resolveTheme(theme) {
|
|
|
248
254
|
* ```
|
|
249
255
|
*/
|
|
250
256
|
function DiffEditor(props) {
|
|
251
|
-
const { original, modified, language = "plain", theme = "light", readOnly = true
|
|
257
|
+
const { original, modified, language = "plain", theme = "light", readOnly = true } = props;
|
|
258
|
+
let mergeView = null;
|
|
259
|
+
const cleanups = [];
|
|
252
260
|
const containerRef = async (el) => {
|
|
253
261
|
if (!el) return;
|
|
254
262
|
const langExt = await loadLanguage(language);
|
|
@@ -260,25 +268,10 @@ function DiffEditor(props) {
|
|
|
260
268
|
EditorView.editable.of(!readOnly),
|
|
261
269
|
EditorState.readOnly.of(readOnly)
|
|
262
270
|
];
|
|
263
|
-
const originalText =
|
|
264
|
-
const modifiedText =
|
|
271
|
+
const originalText = readText(original);
|
|
272
|
+
const modifiedText = readText(modified);
|
|
265
273
|
el.innerHTML = "";
|
|
266
|
-
|
|
267
|
-
a: {
|
|
268
|
-
doc: originalText,
|
|
269
|
-
extensions
|
|
270
|
-
},
|
|
271
|
-
b: {
|
|
272
|
-
doc: modifiedText,
|
|
273
|
-
extensions
|
|
274
|
-
},
|
|
275
|
-
parent: el,
|
|
276
|
-
collapseUnchanged: {
|
|
277
|
-
margin: 3,
|
|
278
|
-
minSize: 4
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
else new MergeView({
|
|
274
|
+
mergeView = new MergeView({
|
|
282
275
|
a: {
|
|
283
276
|
doc: originalText,
|
|
284
277
|
extensions
|
|
@@ -293,7 +286,36 @@ function DiffEditor(props) {
|
|
|
293
286
|
minSize: 4
|
|
294
287
|
}
|
|
295
288
|
});
|
|
289
|
+
if (isSignal(original)) {
|
|
290
|
+
const stop = watch(original, (text) => {
|
|
291
|
+
if (!mergeView) return;
|
|
292
|
+
const editor = mergeView.a;
|
|
293
|
+
editor.dispatch({ changes: {
|
|
294
|
+
from: 0,
|
|
295
|
+
to: editor.state.doc.length,
|
|
296
|
+
insert: text
|
|
297
|
+
} });
|
|
298
|
+
});
|
|
299
|
+
cleanups.push(stop);
|
|
300
|
+
}
|
|
301
|
+
if (isSignal(modified)) {
|
|
302
|
+
const stop = watch(modified, (text) => {
|
|
303
|
+
if (!mergeView) return;
|
|
304
|
+
const editor = mergeView.b;
|
|
305
|
+
editor.dispatch({ changes: {
|
|
306
|
+
from: 0,
|
|
307
|
+
to: editor.state.doc.length,
|
|
308
|
+
insert: text
|
|
309
|
+
} });
|
|
310
|
+
});
|
|
311
|
+
cleanups.push(stop);
|
|
312
|
+
}
|
|
296
313
|
};
|
|
314
|
+
onUnmount(() => {
|
|
315
|
+
for (const cleanup of cleanups) cleanup();
|
|
316
|
+
mergeView?.destroy();
|
|
317
|
+
mergeView = null;
|
|
318
|
+
});
|
|
297
319
|
const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? ""}`;
|
|
298
320
|
return /* @__PURE__ */ jsx("div", {
|
|
299
321
|
ref: containerRef,
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CMGutterMarker","placeholderExt","undo","redo","setDiagnostics","cmSetDiagnostics"],"sources":["../../../core/core/lib/jsx-runtime.js","../src/components/code-editor.tsx","../src/languages.ts","../src/themes.ts","../src/components/diff-editor.tsx","../src/components/tabbed-editor.tsx","../src/minimap.ts","../src/editor.ts"],"sourcesContent":["//#region src/h.ts\n/** Marker for fragment nodes — renders children without a wrapper element */\nconst Fragment = Symbol(\"Pyreon.Fragment\");\n/**\n* Hyperscript function — the compiled output of JSX.\n* `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n*\n* Generic on P so TypeScript validates props match the component's signature\n* at the call site, then stores the result in the loosely-typed VNode.\n*/\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nconst EMPTY_PROPS = {};\nfunction h(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: props ?? EMPTY_PROPS,\n\t\tchildren: normalizeChildren(children),\n\t\tkey: props?.key ?? null\n\t};\n}\nfunction normalizeChildren(children) {\n\tfor (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);\n\treturn children;\n}\nfunction flattenChildren(children) {\n\tconst result = [];\n\tfor (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));\n\telse result.push(child);\n\treturn result;\n}\n\n//#endregion\n//#region src/jsx-runtime.ts\n/**\n* JSX automatic runtime.\n*\n* When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n* rewrites JSX to imports from this file automatically:\n* <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n*/\nfunction jsx(type, props, key) {\n\tconst { children, ...rest } = props;\n\tconst propsWithKey = key != null ? {\n\t\t...rest,\n\t\tkey\n\t} : rest;\n\tif (typeof type === \"function\") return h(type, children !== void 0 ? {\n\t\t...propsWithKey,\n\t\tchildren\n\t} : propsWithKey);\n\treturn h(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);\n}\nconst jsxs = jsx;\n\n//#endregion\nexport { Fragment, jsx, jsxs };\n//# sourceMappingURL=jsx-runtime.js.map","import type { VNodeChild } from \"@pyreon/core\"\nimport type { CodeEditorProps, EditorInstance } from \"../types\"\n\n/**\n * Code editor component — mounts a CodeMirror 6 instance.\n *\n * @example\n * ```tsx\n * const editor = createEditor({\n * value: 'const x = 1',\n * language: 'typescript',\n * theme: 'dark',\n * })\n *\n * <CodeEditor instance={editor} style=\"height: 400px\" />\n * ```\n */\nexport function CodeEditor(props: CodeEditorProps): VNodeChild {\n const { instance } = props\n\n const containerRef = (el: Element | null) => {\n if (!el) return\n\n // Mount the editor into the container\n const mountable = instance as EditorInstance & {\n _mount?: (parent: HTMLElement) => Promise<void>\n }\n if (mountable._mount) {\n mountable._mount(el as HTMLElement)\n }\n }\n\n const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? \"\"}`\n\n return (\n <div ref={containerRef} class={`pyreon-code-editor ${props.class ?? \"\"}`} style={baseStyle} />\n )\n}\n","import type { Extension } from \"@codemirror/state\"\nimport type { EditorLanguage } from \"./types\"\n\n/**\n * Language extension loaders — lazy-loaded on demand.\n * Only the requested language is imported, keeping the initial bundle small.\n */\nconst languageLoaders: Record<EditorLanguage, () => Promise<Extension>> = {\n javascript: () => import(\"@codemirror/lang-javascript\").then((m) => m.javascript()),\n typescript: () =>\n import(\"@codemirror/lang-javascript\").then((m) => m.javascript({ typescript: true })),\n jsx: () => import(\"@codemirror/lang-javascript\").then((m) => m.javascript({ jsx: true })),\n tsx: () =>\n import(\"@codemirror/lang-javascript\").then((m) =>\n m.javascript({ typescript: true, jsx: true }),\n ),\n html: () => import(\"@codemirror/lang-html\").then((m) => m.html()),\n css: () => import(\"@codemirror/lang-css\").then((m) => m.css()),\n json: () => import(\"@codemirror/lang-json\").then((m) => m.json()),\n markdown: () => import(\"@codemirror/lang-markdown\").then((m) => m.markdown()),\n python: () => import(\"@codemirror/lang-python\").then((m) => m.python()),\n rust: () => import(\"@codemirror/lang-rust\").then((m) => m.rust()),\n sql: () => import(\"@codemirror/lang-sql\").then((m) => m.sql()),\n xml: () => import(\"@codemirror/lang-xml\").then((m) => m.xml()),\n yaml: () => import(\"@codemirror/lang-yaml\").then((m) => m.yaml()),\n cpp: () => import(\"@codemirror/lang-cpp\").then((m) => m.cpp()),\n java: () => import(\"@codemirror/lang-java\").then((m) => m.java()),\n go: () => import(\"@codemirror/lang-go\").then((m) => m.go()),\n php: () => import(\"@codemirror/lang-php\").then((m) => m.php()),\n ruby: () => Promise.resolve([]),\n shell: () => Promise.resolve([]),\n plain: () => Promise.resolve([]),\n}\n\n// Cache loaded language extensions\nconst loaded = new Map<EditorLanguage, Extension>()\n\n/**\n * Load a language extension. Returns cached if already loaded.\n * Language grammars are lazy-imported — zero cost until used.\n *\n * @example\n * ```ts\n * const ext = await loadLanguage('typescript')\n * ```\n */\nexport async function loadLanguage(language: EditorLanguage): Promise<Extension> {\n const cached = loaded.get(language)\n if (cached) return cached\n\n const loader = languageLoaders[language]\n if (!loader) return []\n\n try {\n const ext = await loader()\n loaded.set(language, ext)\n return ext\n } catch {\n // Language package not installed — return empty extension\n return []\n }\n}\n\n/**\n * Get available languages.\n */\nexport function getAvailableLanguages(): EditorLanguage[] {\n return Object.keys(languageLoaders) as EditorLanguage[]\n}\n","import type { Extension } from \"@codemirror/state\"\nimport { EditorView } from \"@codemirror/view\"\nimport type { EditorTheme } from \"./types\"\n\n/**\n * Light theme — clean, minimal.\n */\nexport const lightTheme: Extension = EditorView.theme({\n \"&\": {\n backgroundColor: \"#ffffff\",\n color: \"#1e293b\",\n },\n \".cm-content\": {\n caretColor: \"#1e293b\",\n },\n \".cm-cursor\": {\n borderLeftColor: \"#1e293b\",\n },\n \"&.cm-focused .cm-selectionBackground, .cm-selectionBackground\": {\n backgroundColor: \"#dbeafe\",\n },\n \".cm-gutters\": {\n backgroundColor: \"#f8fafc\",\n color: \"#94a3b8\",\n borderRight: \"1px solid #e2e8f0\",\n },\n \".cm-activeLineGutter\": {\n backgroundColor: \"#f1f5f9\",\n color: \"#475569\",\n },\n \".cm-activeLine\": {\n backgroundColor: \"#f8fafc\",\n },\n \".cm-foldGutter\": {\n color: \"#94a3b8\",\n },\n})\n\n/**\n * Dark theme — VS Code inspired.\n */\nexport const darkTheme: Extension = EditorView.theme(\n {\n \"&\": {\n backgroundColor: \"#1e1e2e\",\n color: \"#cdd6f4\",\n },\n \".cm-content\": {\n caretColor: \"#f5e0dc\",\n },\n \".cm-cursor\": {\n borderLeftColor: \"#f5e0dc\",\n },\n \"&.cm-focused .cm-selectionBackground, .cm-selectionBackground\": {\n backgroundColor: \"#45475a\",\n },\n \".cm-gutters\": {\n backgroundColor: \"#181825\",\n color: \"#585b70\",\n borderRight: \"1px solid #313244\",\n },\n \".cm-activeLineGutter\": {\n backgroundColor: \"#1e1e2e\",\n color: \"#a6adc8\",\n },\n \".cm-activeLine\": {\n backgroundColor: \"#1e1e2e80\",\n },\n \".cm-foldGutter\": {\n color: \"#585b70\",\n },\n \".cm-matchingBracket\": {\n backgroundColor: \"#45475a\",\n color: \"#f5e0dc\",\n },\n },\n { dark: true },\n)\n\n/**\n * Resolve a theme value to a CodeMirror extension.\n */\nexport function resolveTheme(theme: EditorTheme): Extension {\n if (theme === \"light\") return lightTheme\n if (theme === \"dark\") return darkTheme\n return theme // custom Extension\n}\n","import { defaultHighlightStyle, syntaxHighlighting } from \"@codemirror/language\"\nimport { MergeView } from \"@codemirror/merge\"\nimport { EditorState, type Extension } from \"@codemirror/state\"\nimport { EditorView } from \"@codemirror/view\"\nimport type { VNodeChild } from \"@pyreon/core\"\nimport type { Signal } from \"@pyreon/reactivity\"\nimport { loadLanguage } from \"../languages\"\nimport { resolveTheme } from \"../themes\"\nimport type { DiffEditorProps } from \"../types\"\n\n/**\n * Side-by-side or inline diff editor using @codemirror/merge.\n *\n * @example\n * ```tsx\n * <DiffEditor\n * original=\"const x = 1\"\n * modified=\"const x = 2\"\n * language=\"typescript\"\n * theme=\"dark\"\n * style=\"height: 400px\"\n * />\n * ```\n */\nexport function DiffEditor(props: DiffEditorProps): VNodeChild {\n const {\n original,\n modified,\n language = \"plain\",\n theme = \"light\",\n readOnly = true,\n inline = false,\n } = props\n\n const containerRef = async (el: Element | null) => {\n if (!el) return\n\n const langExt = await loadLanguage(language)\n const themeExt = resolveTheme(theme)\n\n const extensions: Extension[] = [\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n langExt,\n themeExt,\n EditorView.editable.of(!readOnly),\n EditorState.readOnly.of(readOnly),\n ]\n\n const originalText = typeof original === \"string\" ? original : (original as Signal<string>)()\n const modifiedText = typeof modified === \"string\" ? modified : (modified as Signal<string>)()\n\n // Clear previous content\n ;(el as HTMLElement).innerHTML = \"\"\n\n if (inline) {\n // Unified/inline diff view\n new MergeView({\n a: {\n doc: originalText,\n extensions,\n },\n b: {\n doc: modifiedText,\n extensions,\n },\n parent: el as HTMLElement,\n collapseUnchanged: { margin: 3, minSize: 4 },\n })\n } else {\n // Side-by-side diff\n new MergeView({\n a: {\n doc: originalText,\n extensions,\n },\n b: {\n doc: modifiedText,\n extensions,\n },\n parent: el as HTMLElement,\n collapseUnchanged: { margin: 3, minSize: 4 },\n })\n }\n }\n\n const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? \"\"}`\n\n return (\n <div ref={containerRef} class={`pyreon-diff-editor ${props.class ?? \"\"}`} style={baseStyle} />\n )\n}\n","import type { VNodeChild } from \"@pyreon/core\"\nimport type { TabbedEditorProps } from \"../types\"\nimport { CodeEditor } from \"./code-editor\"\n\n/**\n * Tabbed code editor component — renders tab bar + editor.\n * Headless styling — the tab bar is a plain div with button tabs.\n * Consumers can style via CSS classes.\n *\n * @example\n * ```tsx\n * const editor = createTabbedEditor({\n * tabs: [\n * { name: 'index.ts', language: 'typescript', value: 'const x = 1' },\n * { name: 'style.css', language: 'css', value: '.app { }' },\n * ],\n * theme: 'dark',\n * })\n *\n * <TabbedEditor instance={editor} style=\"height: 500px\" />\n * ```\n */\nexport function TabbedEditor(props: TabbedEditorProps): VNodeChild {\n const { instance } = props\n\n const containerStyle = `display: flex; flex-direction: column; width: 100%; height: 100%; ${props.style ?? \"\"}`\n\n const tabBarStyle =\n \"display: flex; overflow-x: auto; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; min-height: 34px; flex-shrink: 0;\"\n\n return (\n <div class={`pyreon-tabbed-editor ${props.class ?? \"\"}`} style={containerStyle}>\n {() => {\n const tabs = instance.tabs()\n const activeId = instance.activeTabId()\n\n return (\n <div class=\"pyreon-tabbed-editor-tabs\" style={tabBarStyle}>\n {tabs.map((tab) => {\n const id = tab.id ?? tab.name\n const isActive = id === activeId\n\n const tabStyle = `display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: none; background: ${isActive ? \"white\" : \"transparent\"}; border-bottom: ${isActive ? \"2px solid #3b82f6\" : \"2px solid transparent\"}; cursor: pointer; font-size: 13px; color: ${isActive ? \"#1e293b\" : \"#64748b\"}; white-space: nowrap; position: relative; font-family: inherit;`\n\n return (\n <button\n type=\"button\"\n key={id}\n class={`pyreon-tab ${isActive ? \"active\" : \"\"} ${tab.modified ? \"modified\" : \"\"}`}\n style={tabStyle}\n onClick={() => instance.switchTab(id)}\n >\n <span>{tab.name}</span>\n {tab.modified && (\n <span\n style=\"width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; flex-shrink: 0;\"\n title=\"Modified\"\n />\n )}\n {tab.closable !== false && (\n <span\n style=\"font-size: 14px; line-height: 1; opacity: 0.5; cursor: pointer; padding: 0 2px; margin-left: 2px;\"\n title=\"Close\"\n onClick={(e: MouseEvent) => {\n e.stopPropagation()\n instance.closeTab(id)\n }}\n >\n ×\n </span>\n )}\n </button>\n )\n })}\n </div>\n )\n }}\n <div style=\"flex: 1; min-height: 0;\">\n <CodeEditor instance={instance.editor} />\n </div>\n </div>\n )\n}\n","import type { Extension } from \"@codemirror/state\"\nimport { EditorView, ViewPlugin, type ViewUpdate } from \"@codemirror/view\"\n\n/**\n * Canvas-based minimap extension for CodeMirror 6.\n * Renders a scaled-down overview of the document on the right side.\n */\n\nconst MINIMAP_WIDTH = 80\nconst CHAR_WIDTH = 1.2\nconst LINE_HEIGHT = 2.5\nconst MINIMAP_BG = \"#1e1e2e\"\nconst MINIMAP_BG_LIGHT = \"#f8fafc\"\nconst TEXT_COLOR = \"#585b70\"\nconst TEXT_COLOR_LIGHT = \"#94a3b8\"\nconst VIEWPORT_COLOR = \"rgba(59, 130, 246, 0.15)\"\nconst VIEWPORT_BORDER = \"rgba(59, 130, 246, 0.4)\"\n\nfunction createMinimapCanvas(): HTMLCanvasElement {\n const canvas = document.createElement(\"canvas\")\n canvas.style.cssText = `position: absolute; right: 0; top: 0; width: ${MINIMAP_WIDTH}px; height: 100%; cursor: pointer; z-index: 5;`\n canvas.width = MINIMAP_WIDTH * 2 // retina\n return canvas\n}\n\nfunction renderMinimap(canvas: HTMLCanvasElement, view: EditorView): void {\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n const doc = view.state.doc\n const totalLines = doc.lines\n const height = canvas.clientHeight\n canvas.height = height * 2 // retina\n\n const isDark = view.dom.classList.contains(\"cm-dark\")\n const bg = isDark ? MINIMAP_BG : MINIMAP_BG_LIGHT\n const textColor = isDark ? TEXT_COLOR : TEXT_COLOR_LIGHT\n\n const scale = 2 // retina\n ctx.setTransform(scale, 0, 0, scale, 0, 0)\n\n // Background\n ctx.fillStyle = bg\n ctx.fillRect(0, 0, MINIMAP_WIDTH, height)\n\n // Calculate visible range in minimap\n const contentHeight = totalLines * LINE_HEIGHT\n const scrollFraction =\n contentHeight > height\n ? view.scrollDOM.scrollTop / (view.scrollDOM.scrollHeight - view.scrollDOM.clientHeight || 1)\n : 0\n const offset = contentHeight > height ? scrollFraction * (contentHeight - height) : 0\n\n // Render text lines\n ctx.fillStyle = textColor\n const startLine = Math.max(1, Math.floor(offset / LINE_HEIGHT))\n const endLine = Math.min(totalLines, startLine + Math.ceil(height / LINE_HEIGHT) + 1)\n\n for (let i = startLine; i <= endLine; i++) {\n const line = doc.line(i)\n const y = (i - 1) * LINE_HEIGHT - offset\n if (y < -LINE_HEIGHT || y > height) continue\n\n const text = line.text\n let x = 4\n for (let j = 0; j < Math.min(text.length, 60); j++) {\n if (text[j] !== \" \" && text[j] !== \"\\t\") {\n ctx.fillRect(x, y, CHAR_WIDTH, 1.5)\n }\n x += CHAR_WIDTH\n }\n }\n\n // Viewport indicator\n const viewportTop = view.scrollDOM.scrollTop\n const viewportHeight = view.scrollDOM.clientHeight\n const docHeight = view.scrollDOM.scrollHeight || 1\n\n const vpY = (viewportTop / docHeight) * Math.min(contentHeight, height)\n const vpH = (viewportHeight / docHeight) * Math.min(contentHeight, height)\n\n ctx.fillStyle = VIEWPORT_COLOR\n ctx.fillRect(0, vpY, MINIMAP_WIDTH, vpH)\n ctx.strokeStyle = VIEWPORT_BORDER\n ctx.lineWidth = 1\n ctx.strokeRect(0.5, vpY + 0.5, MINIMAP_WIDTH - 1, vpH - 1)\n}\n\n/**\n * CodeMirror 6 minimap extension.\n * Renders a canvas-based code overview on the right side of the editor.\n *\n * @example\n * ```ts\n * import { minimapExtension } from '@pyreon/code'\n * // Add to editor extensions\n * ```\n */\nexport function minimapExtension(): Extension {\n return [\n ViewPlugin.fromClass(\n class {\n canvas: HTMLCanvasElement\n view: EditorView\n animFrame: number | null = null\n\n constructor(view: EditorView) {\n this.view = view\n this.canvas = createMinimapCanvas()\n view.dom.style.position = \"relative\"\n view.dom.appendChild(this.canvas)\n\n // Click to scroll\n this.canvas.addEventListener(\"click\", (e) => {\n const rect = this.canvas.getBoundingClientRect()\n const clickY = e.clientY - rect.top\n const fraction = clickY / rect.height\n const scrollTarget =\n fraction * (view.scrollDOM.scrollHeight - view.scrollDOM.clientHeight)\n view.scrollDOM.scrollTo({ top: scrollTarget, behavior: \"smooth\" })\n })\n\n this.render()\n }\n\n render() {\n renderMinimap(this.canvas, this.view)\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged || update.geometryChanged) {\n if (this.animFrame) cancelAnimationFrame(this.animFrame)\n this.animFrame = requestAnimationFrame(() => this.render())\n }\n }\n\n destroy() {\n if (this.animFrame) cancelAnimationFrame(this.animFrame)\n this.canvas.remove()\n }\n },\n ),\n // Add padding on the right for the minimap\n EditorView.theme({\n \".cm-scroller\": {\n paddingRight: `${MINIMAP_WIDTH + 8}px`,\n },\n }),\n ]\n}\n","import {\n autocompletion,\n closeBrackets,\n closeBracketsKeymap,\n completionKeymap,\n} from \"@codemirror/autocomplete\"\nimport {\n redo as cmRedo,\n undo as cmUndo,\n defaultKeymap,\n history,\n historyKeymap,\n indentWithTab,\n} from \"@codemirror/commands\"\nimport {\n bracketMatching,\n defaultHighlightStyle,\n foldGutter,\n foldKeymap,\n indentOnInput,\n indentUnit,\n syntaxHighlighting,\n} from \"@codemirror/language\"\nimport { setDiagnostics as cmSetDiagnostics, lintKeymap } from \"@codemirror/lint\"\nimport { highlightSelectionMatches, searchKeymap } from \"@codemirror/search\"\nimport { Compartment, EditorState, type Extension } from \"@codemirror/state\"\nimport {\n GutterMarker as CMGutterMarker,\n crosshairCursor,\n Decoration,\n type DecorationSet,\n drawSelection,\n dropCursor,\n EditorView,\n gutter,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n placeholder as placeholderExt,\n rectangularSelection,\n ViewPlugin,\n type ViewUpdate,\n} from \"@codemirror/view\"\nimport { computed, effect, signal } from \"@pyreon/reactivity\"\nimport { loadLanguage } from \"./languages\"\nimport { minimapExtension } from \"./minimap\"\nimport { resolveTheme } from \"./themes\"\nimport type { EditorConfig, EditorInstance, EditorLanguage, EditorTheme } from \"./types\"\n\n/**\n * Create a reactive code editor instance.\n *\n * The editor state (value, language, theme, cursor, selection) is backed\n * by signals. The CodeMirror EditorView is created when mounted via\n * the `<CodeEditor>` component.\n *\n * @param config - Editor configuration\n * @returns A reactive EditorInstance\n *\n * @example\n * ```tsx\n * const editor = createEditor({\n * value: 'const x = 1',\n * language: 'typescript',\n * theme: 'dark',\n * })\n *\n * editor.value() // reactive\n * editor.value.set('new') // updates editor\n *\n * <CodeEditor instance={editor} />\n * ```\n */\nexport function createEditor(config: EditorConfig = {}): EditorInstance {\n const {\n value: initialValue = \"\",\n language: initialLanguage = \"plain\",\n theme: initialTheme = \"light\",\n lineNumbers: showLineNumbers = true,\n readOnly: initialReadOnly = false,\n foldGutter: showFoldGutter = true,\n bracketMatching: enableBracketMatching = true,\n autocomplete: enableAutocomplete = true,\n search: _enableSearch = true,\n highlightIndentGuides: enableIndentGuides = true,\n vim: enableVim = false,\n emacs: enableEmacs = false,\n tabSize: configTabSize = 2,\n lineWrapping: enableLineWrapping = false,\n placeholder: placeholderText,\n minimap: enableMinimap = false,\n extensions: userExtensions = [],\n onChange,\n } = config\n\n // ── Reactive state ───────────────────────────────────────────────────\n\n const value = signal(initialValue)\n const language = signal<EditorLanguage>(initialLanguage)\n const theme = signal<EditorTheme>(initialTheme)\n const readOnly = signal(initialReadOnly)\n const focused = signal(false)\n const view = signal<EditorView | null>(null)\n\n // Internal version tracker for cursor/selection reactivity\n const docVersion = signal(0)\n\n // ── Compartments (for dynamic reconfiguration) ─────────────────────\n\n const languageCompartment = new Compartment()\n const themeCompartment = new Compartment()\n const readOnlyCompartment = new Compartment()\n const extraKeymapCompartment = new Compartment()\n const keyModeCompartment = new Compartment()\n\n // ── Computed ─────────────────────────────────────────────────────────\n\n const cursor = computed(() => {\n docVersion() // subscribe to changes\n const v = view.peek()\n if (!v) return { line: 1, col: 1 }\n const pos = v.state.selection.main.head\n const line = v.state.doc.lineAt(pos)\n return { line: line.number, col: pos - line.from + 1 }\n })\n\n const selection = computed(() => {\n docVersion()\n const v = view.peek()\n if (!v) return { from: 0, to: 0, text: \"\" }\n const sel = v.state.selection.main\n return {\n from: sel.from,\n to: sel.to,\n text: v.state.sliceDoc(sel.from, sel.to),\n }\n })\n\n const lineCount = computed(() => {\n docVersion()\n const v = view.peek()\n return v ? v.state.doc.lines : initialValue.split(\"\\n\").length\n })\n\n // ── Line highlight support ──────────────────────────────────────────\n\n const lineHighlights = new Map<number, string>()\n\n const lineHighlightField = ViewPlugin.fromClass(\n class {\n decorations: DecorationSet\n\n constructor(editorView: EditorView) {\n this.decorations = this.buildDecos(editorView)\n }\n\n buildDecos(editorView: EditorView): DecorationSet {\n const ranges: Array<{ from: number; deco: any }> = []\n for (const [lineNum, cls] of lineHighlights) {\n if (lineNum >= 1 && lineNum <= editorView.state.doc.lines) {\n const lineInfo = editorView.state.doc.line(lineNum)\n ranges.push({\n from: lineInfo.from,\n deco: Decoration.line({ class: cls }),\n })\n }\n }\n return Decoration.set(\n ranges.sort((a, b) => a.from - b.from).map((d) => d.deco.range(d.from)),\n )\n }\n\n update(upd: ViewUpdate) {\n if (upd.docChanged || upd.viewportChanged) {\n this.decorations = this.buildDecos(upd.view)\n }\n }\n },\n { decorations: (plugin) => plugin.decorations },\n )\n\n // ── Gutter marker support ──────────────────────────────────────────\n\n const gutterMarkers = new Map<number, { class?: string; text?: string; title?: string }>()\n\n class CustomGutterMarker extends CMGutterMarker {\n markerText: string\n markerTitle: string\n markerClass: string\n\n constructor(opts: { class?: string; text?: string; title?: string }) {\n super()\n this.markerText = opts.text ?? \"\"\n this.markerTitle = opts.title ?? \"\"\n this.markerClass = opts.class ?? \"\"\n }\n\n override toDOM() {\n const el = document.createElement(\"span\")\n el.textContent = this.markerText\n el.title = this.markerTitle\n if (this.markerClass) el.className = this.markerClass\n el.style.cssText = \"cursor: pointer; display: inline-block; width: 100%; text-align: center;\"\n return el\n }\n }\n\n const gutterMarkerExtension = gutter({\n class: \"pyreon-code-gutter-markers\",\n lineMarker: (gutterView, line) => {\n const lineNo = gutterView.state.doc.lineAt(line.from).number\n const marker = gutterMarkers.get(lineNo)\n if (!marker) return null\n return new CustomGutterMarker(marker)\n },\n initialSpacer: () => new CustomGutterMarker({ text: \" \" }),\n })\n\n // ── Build extensions ─────────────────────────────────────────────────\n\n function buildExtensions(langExt: Extension): Extension[] {\n const exts: Extension[] = [\n // Core\n history(),\n drawSelection(),\n dropCursor(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightActiveLineGutter(),\n highlightSelectionMatches(),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n indentUnit.of(\" \".repeat(configTabSize)),\n\n // Keymaps\n keymap.of([\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap,\n ...lintKeymap,\n indentWithTab,\n ]),\n\n // Dynamic compartments\n languageCompartment.of(langExt),\n themeCompartment.of(resolveTheme(initialTheme)),\n readOnlyCompartment.of(EditorState.readOnly.of(initialReadOnly)),\n extraKeymapCompartment.of([]),\n keyModeCompartment.of([]),\n\n // Update listener — sync CM changes to signal\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n const newValue = update.state.doc.toString()\n // Avoid infinite loop: only set if different\n if (newValue !== value.peek()) {\n value.set(newValue)\n onChange?.(newValue)\n }\n docVersion.update((v) => v + 1)\n }\n if (update.selectionSet) {\n docVersion.update((v) => v + 1)\n }\n if (update.focusChanged) {\n focused.set(update.view.hasFocus)\n }\n }),\n ]\n\n // Optional features\n if (showLineNumbers) exts.push(lineNumbers())\n if (showFoldGutter) exts.push(foldGutter())\n if (enableBracketMatching) exts.push(bracketMatching(), closeBrackets())\n if (enableAutocomplete) exts.push(autocompletion())\n if (enableLineWrapping) exts.push(EditorView.lineWrapping)\n // Indent guides via theme (CM6 doesn't have a built-in extension for this)\n if (enableIndentGuides) {\n exts.push(\n EditorView.theme({\n \".cm-line\": {\n backgroundImage: \"linear-gradient(to right, #e5e7eb 1px, transparent 1px)\",\n backgroundSize: `${configTabSize}ch 100%`,\n backgroundPosition: \"0 0\",\n },\n }),\n )\n }\n if (placeholderText) exts.push(placeholderExt(placeholderText))\n if (enableMinimap) exts.push(minimapExtension())\n\n // Line highlight decoration support\n exts.push(lineHighlightField)\n // Gutter marker support\n exts.push(gutterMarkerExtension)\n\n // User extensions\n exts.push(...userExtensions)\n\n return exts\n }\n\n // ── Mount helper — called by CodeEditor component ────────────────────\n\n let mounted = false\n\n async function mount(parent: HTMLElement): Promise<void> {\n if (mounted) return\n\n const langExt = await loadLanguage(language.peek())\n const extensions = buildExtensions(langExt)\n\n const state = EditorState.create({\n doc: value.peek(),\n extensions,\n })\n\n const editorView = new EditorView({\n state,\n parent,\n })\n\n view.set(editorView)\n mounted = true\n\n // Sync signal → editor for value changes from outside\n effect(() => {\n const val = value()\n const v = view.peek()\n if (!v) return\n const current = v.state.doc.toString()\n if (val !== current) {\n v.dispatch({\n changes: { from: 0, to: current.length, insert: val },\n })\n }\n })\n\n // Sync language changes\n effect(() => {\n const lang = language()\n const v = view.peek()\n if (!v) return\n loadLanguage(lang).then((ext) => {\n v.dispatch({ effects: languageCompartment.reconfigure(ext) })\n })\n })\n\n // Sync theme changes\n effect(() => {\n const t = theme()\n const v = view.peek()\n if (!v) return\n v.dispatch({ effects: themeCompartment.reconfigure(resolveTheme(t)) })\n })\n\n // Sync readOnly changes\n effect(() => {\n const ro = readOnly()\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(ro)),\n })\n })\n }\n\n // ── Actions ──────────────────────────────────────────────────────────\n\n function focus(): void {\n view.peek()?.focus()\n }\n\n function insert(text: string): void {\n const v = view.peek()\n if (!v) return\n const pos = v.state.selection.main.head\n v.dispatch({ changes: { from: pos, insert: text } })\n }\n\n function replaceSelection(text: string): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(v.state.replaceSelection(text))\n }\n\n function select(from: number, to: number): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({ selection: { anchor: from, head: to } })\n }\n\n function selectAll(): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({ selection: { anchor: 0, head: v.state.doc.length } })\n }\n\n function goToLine(line: number): void {\n const v = view.peek()\n if (!v) return\n const lineInfo = v.state.doc.line(Math.min(Math.max(1, line), v.state.doc.lines))\n v.dispatch({\n selection: { anchor: lineInfo.from },\n scrollIntoView: true,\n })\n v.focus()\n }\n\n function undo(): void {\n const v = view.peek()\n if (v) cmUndo(v)\n }\n\n function redo(): void {\n const v = view.peek()\n if (v) cmRedo(v)\n }\n\n function foldAll(): void {\n const v = view.peek()\n if (!v) return\n const { foldAll: foldAllCmd } = require(\"@codemirror/language\")\n foldAllCmd(v)\n }\n\n function unfoldAll(): void {\n const v = view.peek()\n if (!v) return\n const { unfoldAll: unfoldAllCmd } = require(\"@codemirror/language\")\n unfoldAllCmd(v)\n }\n\n // ── Diagnostics ────────────────────────────────────────────────────\n\n function setDiagnostics(diagnostics: import(\"./types\").Diagnostic[]): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(\n cmSetDiagnostics(\n v.state,\n diagnostics.map((d) => ({\n from: d.from,\n to: d.to,\n severity: d.severity === \"hint\" ? \"info\" : d.severity,\n message: d.message,\n ...(d.source != null ? { source: d.source } : {}),\n })),\n ),\n )\n }\n\n function clearDiagnostics(): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(cmSetDiagnostics(v.state, []))\n }\n\n // ── Line highlights ────────────────────────────────────────────────\n\n function highlightLine(line: number, className: string): void {\n lineHighlights.set(line, className)\n // Force re-render of decorations\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n function clearLineHighlights(): void {\n lineHighlights.clear()\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n // ── Gutter markers ────────────────────────────────────────────────\n\n function setGutterMarker(line: number, marker: import(\"./types\").GutterMarker): void {\n gutterMarkers.set(line, marker)\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n function clearGutterMarkers(): void {\n gutterMarkers.clear()\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n // ── Custom keybindings ─────────────────────────────────────────────\n\n const customKeybindings: Array<{ key: string; run: () => boolean }> = []\n\n function addKeybinding(key: string, handler: () => boolean | undefined): void {\n customKeybindings.push({\n key,\n run: () => {\n handler()\n return true\n },\n })\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: extraKeymapCompartment.reconfigure(keymap.of(customKeybindings)),\n })\n }\n\n // ── Text queries ───────────────────────────────────────────────────\n\n function getLine(line: number): string {\n const v = view.peek()\n if (!v) return \"\"\n const clamped = Math.min(Math.max(1, line), v.state.doc.lines)\n return v.state.doc.line(clamped).text\n }\n\n function getWordAtCursor(): string {\n const v = view.peek()\n if (!v) return \"\"\n const pos = v.state.selection.main.head\n const line = v.state.doc.lineAt(pos)\n const col = pos - line.from\n const text = line.text\n\n // Find word boundaries\n let start = col\n let end = col\n while (start > 0 && /\\w/.test(text.charAt(start - 1))) start--\n while (end < text.length && /\\w/.test(text.charAt(end))) end++\n\n return text.slice(start, end)\n }\n\n function scrollTo(pos: number): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: EditorView.scrollIntoView(pos, { y: \"center\" }),\n })\n }\n\n // ── Vim / Emacs mode loading ───────────────────────────────────────\n\n async function loadKeyMode(): Promise<void> {\n const v = view.peek()\n if (!v) return\n\n // Use string concat to prevent Vite from statically analyzing these optional imports\n const vimPkg = \"@replit/codemirror-\" + \"vim\"\n const emacsPkg = \"@replit/codemirror-\" + \"emacs\"\n\n if (enableVim) {\n try {\n const mod = await import(/* @vite-ignore */ vimPkg)\n v.dispatch({\n effects: keyModeCompartment.reconfigure(mod.vim()),\n })\n } catch {\n /* @replit/codemirror-vim not installed */\n }\n }\n\n if (enableEmacs) {\n try {\n const mod = await import(/* @vite-ignore */ emacsPkg)\n v.dispatch({\n effects: keyModeCompartment.reconfigure(mod.emacs()),\n })\n } catch {\n /* @replit/codemirror-emacs not installed */\n }\n }\n }\n\n function dispose(): void {\n const v = view.peek()\n if (v) {\n v.destroy()\n view.set(null)\n mounted = false\n }\n }\n\n // ── Expose mount for component ─────────────────────────────────────\n\n const instance: EditorInstance & { _mount: typeof mount } = {\n value,\n language,\n theme,\n readOnly,\n cursor,\n selection,\n lineCount,\n focused,\n view,\n focus,\n insert,\n replaceSelection,\n select,\n selectAll,\n goToLine,\n undo,\n redo,\n foldAll,\n unfoldAll,\n setDiagnostics,\n clearDiagnostics,\n highlightLine,\n clearLineHighlights,\n setGutterMarker,\n clearGutterMarkers,\n addKeybinding,\n getLine,\n getWordAtCursor,\n scrollTo,\n config,\n dispose,\n _mount: async (parent: HTMLElement) => {\n await mount(parent)\n await loadKeyMode()\n },\n }\n\n return instance\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,cAAc,EAAE;AACtB,SAAS,EAAE,MAAM,OAAO,GAAG,U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ACT,SAAS,WAAW,eAAe,KAAK,EAAE,GAAG,UAAU,CAAC,EACzD,CAAC;;CAKJ,eAAe,cAA6B;EAC1C,MAAM,IAAI,KAAK,MAAM;AACrB,MAAI,CAAC,EAAG;EAGR,MAAM,SAAS;EACf,MAAM,WAAW;AAEjB,MAAI,UACF,KAAI;GACF,MAAM,MAAM,MAAM;;IAA0B;;AAC5C,KAAE,SAAS,EACT,SAAS,mBAAmB,YAAY,IAAI,KAAK,CAAC,EACnD,CAAC;UACI;AAKV,MAAI,YACF,KAAI;GACF,MAAM,MAAM,MAAM;;IAA0B;;AAC5C,KAAE,SAAS,EACT,SAAS,mBAAmB,YAAY,IAAI,OAAO,CAAC,EACrD,CAAC;UACI;;CAMZ,SAAS,UAAgB;EACvB,MAAM,IAAI,KAAK,MAAM;AACrB,MAAI,GAAG;AACL,KAAE,SAAS;AACX,QAAK,IAAI,KAAK;AACd,aAAU;;;AA4Cd,QAtC4D;EAC1D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ,OAAO,WAAwB;AACrC,SAAM,MAAM,OAAO;AACnB,SAAM,aAAa;;EAEtB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["CMGutterMarker","placeholderExt","undo","redo","setDiagnostics","cmSetDiagnostics"],"sources":["../../../core/core/lib/jsx-runtime.js","../src/components/code-editor.tsx","../src/languages.ts","../src/themes.ts","../src/components/diff-editor.tsx","../src/components/tabbed-editor.tsx","../src/minimap.ts","../src/editor.ts"],"sourcesContent":["//#region src/h.ts\n/** Marker for fragment nodes — renders children without a wrapper element */\nconst Fragment = Symbol(\"Pyreon.Fragment\");\n/**\n* Hyperscript function — the compiled output of JSX.\n* `<div class=\"x\">hello</div>` → `h(\"div\", { class: \"x\" }, \"hello\")`\n*\n* Generic on P so TypeScript validates props match the component's signature\n* at the call site, then stores the result in the loosely-typed VNode.\n*/\n/** Shared empty props sentinel — identity-checked in mountElement to skip applyProps. */\nconst EMPTY_PROPS = {};\nfunction h(type, props, ...children) {\n\treturn {\n\t\ttype,\n\t\tprops: props ?? EMPTY_PROPS,\n\t\tchildren: normalizeChildren(children),\n\t\tkey: props?.key ?? null\n\t};\n}\nfunction normalizeChildren(children) {\n\tfor (let i = 0; i < children.length; i++) if (Array.isArray(children[i])) return flattenChildren(children);\n\treturn children;\n}\nfunction flattenChildren(children) {\n\tconst result = [];\n\tfor (const child of children) if (Array.isArray(child)) result.push(...flattenChildren(child));\n\telse result.push(child);\n\treturn result;\n}\n\n//#endregion\n//#region src/jsx-runtime.ts\n/**\n* JSX automatic runtime.\n*\n* When tsconfig has `\"jsxImportSource\": \"@pyreon/core\"`, the TS/bundler compiler\n* rewrites JSX to imports from this file automatically:\n* <div class=\"x\" /> → jsx(\"div\", { class: \"x\" })\n*/\nfunction jsx(type, props, key) {\n\tconst { children, ...rest } = props;\n\tconst propsWithKey = key != null ? {\n\t\t...rest,\n\t\tkey\n\t} : rest;\n\tif (typeof type === \"function\") return h(type, children !== void 0 ? {\n\t\t...propsWithKey,\n\t\tchildren\n\t} : propsWithKey);\n\treturn h(type, propsWithKey, ...children === void 0 ? [] : Array.isArray(children) ? children : [children]);\n}\nconst jsxs = jsx;\n\n//#endregion\nexport { Fragment, jsx, jsxs };\n//# sourceMappingURL=jsx-runtime.js.map","import type { VNodeChild } from \"@pyreon/core\"\nimport type { CodeEditorProps, EditorInstance } from \"../types\"\n\n/**\n * Code editor component — mounts a CodeMirror 6 instance.\n *\n * @example\n * ```tsx\n * const editor = createEditor({\n * value: 'const x = 1',\n * language: 'typescript',\n * theme: 'dark',\n * })\n *\n * <CodeEditor instance={editor} style=\"height: 400px\" />\n * ```\n */\nexport function CodeEditor(props: CodeEditorProps): VNodeChild {\n const { instance } = props\n\n const containerRef = (el: Element | null) => {\n if (!el) return\n\n // Mount the editor into the container\n const mountable = instance as EditorInstance & {\n _mount?: (parent: HTMLElement) => Promise<void>\n }\n if (mountable._mount) {\n mountable._mount(el as HTMLElement)\n }\n }\n\n const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? \"\"}`\n\n return (\n <div ref={containerRef} class={`pyreon-code-editor ${props.class ?? \"\"}`} style={baseStyle} />\n )\n}\n","import type { Extension } from \"@codemirror/state\"\nimport type { EditorLanguage } from \"./types\"\n\n/**\n * Language extension loaders — lazy-loaded on demand.\n * Only the requested language is imported, keeping the initial bundle small.\n */\nconst languageLoaders: Record<EditorLanguage, () => Promise<Extension>> = {\n javascript: () => import(\"@codemirror/lang-javascript\").then((m) => m.javascript()),\n typescript: () =>\n import(\"@codemirror/lang-javascript\").then((m) => m.javascript({ typescript: true })),\n jsx: () => import(\"@codemirror/lang-javascript\").then((m) => m.javascript({ jsx: true })),\n tsx: () =>\n import(\"@codemirror/lang-javascript\").then((m) =>\n m.javascript({ typescript: true, jsx: true }),\n ),\n html: () => import(\"@codemirror/lang-html\").then((m) => m.html()),\n css: () => import(\"@codemirror/lang-css\").then((m) => m.css()),\n json: () => import(\"@codemirror/lang-json\").then((m) => m.json()),\n markdown: () => import(\"@codemirror/lang-markdown\").then((m) => m.markdown()),\n python: () => import(\"@codemirror/lang-python\").then((m) => m.python()),\n rust: () => import(\"@codemirror/lang-rust\").then((m) => m.rust()),\n sql: () => import(\"@codemirror/lang-sql\").then((m) => m.sql()),\n xml: () => import(\"@codemirror/lang-xml\").then((m) => m.xml()),\n yaml: () => import(\"@codemirror/lang-yaml\").then((m) => m.yaml()),\n cpp: () => import(\"@codemirror/lang-cpp\").then((m) => m.cpp()),\n java: () => import(\"@codemirror/lang-java\").then((m) => m.java()),\n go: () => import(\"@codemirror/lang-go\").then((m) => m.go()),\n php: () => import(\"@codemirror/lang-php\").then((m) => m.php()),\n ruby: () => Promise.resolve([]),\n shell: () => Promise.resolve([]),\n plain: () => Promise.resolve([]),\n}\n\n// Cache loaded language extensions\nconst loaded = new Map<EditorLanguage, Extension>()\n\n/**\n * Load a language extension. Returns cached if already loaded.\n * Language grammars are lazy-imported — zero cost until used.\n *\n * @example\n * ```ts\n * const ext = await loadLanguage('typescript')\n * ```\n */\nexport async function loadLanguage(language: EditorLanguage): Promise<Extension> {\n const cached = loaded.get(language)\n if (cached) return cached\n\n const loader = languageLoaders[language]\n if (!loader) return []\n\n try {\n const ext = await loader()\n loaded.set(language, ext)\n return ext\n } catch {\n // Language package not installed — return empty extension\n return []\n }\n}\n\n/**\n * Get available languages.\n */\nexport function getAvailableLanguages(): EditorLanguage[] {\n return Object.keys(languageLoaders) as EditorLanguage[]\n}\n","import type { Extension } from \"@codemirror/state\"\nimport { EditorView } from \"@codemirror/view\"\nimport type { EditorTheme } from \"./types\"\n\n/**\n * Light theme — clean, minimal.\n */\nexport const lightTheme: Extension = EditorView.theme({\n \"&\": {\n backgroundColor: \"#ffffff\",\n color: \"#1e293b\",\n },\n \".cm-content\": {\n caretColor: \"#1e293b\",\n },\n \".cm-cursor\": {\n borderLeftColor: \"#1e293b\",\n },\n \"&.cm-focused .cm-selectionBackground, .cm-selectionBackground\": {\n backgroundColor: \"#dbeafe\",\n },\n \".cm-gutters\": {\n backgroundColor: \"#f8fafc\",\n color: \"#94a3b8\",\n borderRight: \"1px solid #e2e8f0\",\n },\n \".cm-activeLineGutter\": {\n backgroundColor: \"#f1f5f9\",\n color: \"#475569\",\n },\n \".cm-activeLine\": {\n backgroundColor: \"#f8fafc\",\n },\n \".cm-foldGutter\": {\n color: \"#94a3b8\",\n },\n})\n\n/**\n * Dark theme — VS Code inspired.\n */\nexport const darkTheme: Extension = EditorView.theme(\n {\n \"&\": {\n backgroundColor: \"#1e1e2e\",\n color: \"#cdd6f4\",\n },\n \".cm-content\": {\n caretColor: \"#f5e0dc\",\n },\n \".cm-cursor\": {\n borderLeftColor: \"#f5e0dc\",\n },\n \"&.cm-focused .cm-selectionBackground, .cm-selectionBackground\": {\n backgroundColor: \"#45475a\",\n },\n \".cm-gutters\": {\n backgroundColor: \"#181825\",\n color: \"#585b70\",\n borderRight: \"1px solid #313244\",\n },\n \".cm-activeLineGutter\": {\n backgroundColor: \"#1e1e2e\",\n color: \"#a6adc8\",\n },\n \".cm-activeLine\": {\n backgroundColor: \"#1e1e2e80\",\n },\n \".cm-foldGutter\": {\n color: \"#585b70\",\n },\n \".cm-matchingBracket\": {\n backgroundColor: \"#45475a\",\n color: \"#f5e0dc\",\n },\n },\n { dark: true },\n)\n\n/**\n * Resolve a theme value to a CodeMirror extension.\n */\nexport function resolveTheme(theme: EditorTheme): Extension {\n if (theme === \"light\") return lightTheme\n if (theme === \"dark\") return darkTheme\n return theme // custom Extension\n}\n","import { defaultHighlightStyle, syntaxHighlighting } from \"@codemirror/language\"\nimport { MergeView } from \"@codemirror/merge\"\nimport { EditorState, type Extension } from \"@codemirror/state\"\nimport { EditorView } from \"@codemirror/view\"\nimport type { VNodeChild } from \"@pyreon/core\"\nimport { onUnmount } from \"@pyreon/core\"\nimport type { Signal } from \"@pyreon/reactivity\"\nimport { watch } from \"@pyreon/reactivity\"\nimport { loadLanguage } from \"../languages\"\nimport { resolveTheme } from \"../themes\"\nimport type { DiffEditorProps } from \"../types\"\n\nconst readText = (value: string | Signal<string>): string =>\n typeof value === \"string\" ? value : value()\n\nconst isSignal = (value: string | Signal<string>): value is Signal<string> =>\n typeof value === \"function\"\n\n/**\n * Side-by-side or inline diff editor using @codemirror/merge.\n *\n * Supports reactive `original` and `modified` props — pass a Signal<string>\n * and the diff view updates automatically when the signal changes.\n *\n * @example\n * ```tsx\n * <DiffEditor\n * original=\"const x = 1\"\n * modified=\"const x = 2\"\n * language=\"typescript\"\n * theme=\"dark\"\n * style=\"height: 400px\"\n * />\n * ```\n */\nexport function DiffEditor(props: DiffEditorProps): VNodeChild {\n const { original, modified, language = \"plain\", theme = \"light\", readOnly = true } = props\n\n let mergeView: MergeView | null = null\n const cleanups: (() => void)[] = []\n\n const containerRef = async (el: Element | null) => {\n if (!el) return\n\n const langExt = await loadLanguage(language)\n const themeExt = resolveTheme(theme)\n\n const extensions: Extension[] = [\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n langExt,\n themeExt,\n EditorView.editable.of(!readOnly),\n EditorState.readOnly.of(readOnly),\n ]\n\n const originalText = readText(original)\n const modifiedText = readText(modified)\n\n // Clear previous content\n ;(el as HTMLElement).innerHTML = \"\"\n\n mergeView = new MergeView({\n a: { doc: originalText, extensions },\n b: { doc: modifiedText, extensions },\n parent: el as HTMLElement,\n collapseUnchanged: { margin: 3, minSize: 4 },\n })\n\n // Track signal changes and update MergeView editors reactively\n if (isSignal(original)) {\n const stop = watch(original, (text) => {\n if (!mergeView) return\n const editor = mergeView.a\n editor.dispatch({\n changes: { from: 0, to: editor.state.doc.length, insert: text },\n })\n })\n cleanups.push(stop)\n }\n\n if (isSignal(modified)) {\n const stop = watch(modified, (text) => {\n if (!mergeView) return\n const editor = mergeView.b\n editor.dispatch({\n changes: { from: 0, to: editor.state.doc.length, insert: text },\n })\n })\n cleanups.push(stop)\n }\n }\n\n onUnmount(() => {\n for (const cleanup of cleanups) cleanup()\n mergeView?.destroy()\n mergeView = null\n })\n\n const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? \"\"}`\n\n return (\n <div ref={containerRef} class={`pyreon-diff-editor ${props.class ?? \"\"}`} style={baseStyle} />\n )\n}\n","import type { VNodeChild } from \"@pyreon/core\"\nimport type { TabbedEditorProps } from \"../types\"\nimport { CodeEditor } from \"./code-editor\"\n\n/**\n * Tabbed code editor component — renders tab bar + editor.\n * Headless styling — the tab bar is a plain div with button tabs.\n * Consumers can style via CSS classes.\n *\n * @example\n * ```tsx\n * const editor = createTabbedEditor({\n * tabs: [\n * { name: 'index.ts', language: 'typescript', value: 'const x = 1' },\n * { name: 'style.css', language: 'css', value: '.app { }' },\n * ],\n * theme: 'dark',\n * })\n *\n * <TabbedEditor instance={editor} style=\"height: 500px\" />\n * ```\n */\nexport function TabbedEditor(props: TabbedEditorProps): VNodeChild {\n const { instance } = props\n\n const containerStyle = `display: flex; flex-direction: column; width: 100%; height: 100%; ${props.style ?? \"\"}`\n\n const tabBarStyle =\n \"display: flex; overflow-x: auto; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; min-height: 34px; flex-shrink: 0;\"\n\n return (\n <div class={`pyreon-tabbed-editor ${props.class ?? \"\"}`} style={containerStyle}>\n {() => {\n const tabs = instance.tabs()\n const activeId = instance.activeTabId()\n\n return (\n <div class=\"pyreon-tabbed-editor-tabs\" style={tabBarStyle}>\n {tabs.map((tab) => {\n const id = tab.id ?? tab.name\n const isActive = id === activeId\n\n const tabStyle = `display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: none; background: ${isActive ? \"white\" : \"transparent\"}; border-bottom: ${isActive ? \"2px solid #3b82f6\" : \"2px solid transparent\"}; cursor: pointer; font-size: 13px; color: ${isActive ? \"#1e293b\" : \"#64748b\"}; white-space: nowrap; position: relative; font-family: inherit;`\n\n return (\n <button\n type=\"button\"\n key={id}\n class={`pyreon-tab ${isActive ? \"active\" : \"\"} ${tab.modified ? \"modified\" : \"\"}`}\n style={tabStyle}\n onClick={() => instance.switchTab(id)}\n >\n <span>{tab.name}</span>\n {tab.modified && (\n <span\n style=\"width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; flex-shrink: 0;\"\n title=\"Modified\"\n />\n )}\n {tab.closable !== false && (\n <span\n style=\"font-size: 14px; line-height: 1; opacity: 0.5; cursor: pointer; padding: 0 2px; margin-left: 2px;\"\n title=\"Close\"\n onClick={(e: MouseEvent) => {\n e.stopPropagation()\n instance.closeTab(id)\n }}\n >\n ×\n </span>\n )}\n </button>\n )\n })}\n </div>\n )\n }}\n <div style=\"flex: 1; min-height: 0;\">\n <CodeEditor instance={instance.editor} />\n </div>\n </div>\n )\n}\n","import type { Extension } from \"@codemirror/state\"\nimport { EditorView, ViewPlugin, type ViewUpdate } from \"@codemirror/view\"\n\n/**\n * Canvas-based minimap extension for CodeMirror 6.\n * Renders a scaled-down overview of the document on the right side.\n */\n\nconst MINIMAP_WIDTH = 80\nconst CHAR_WIDTH = 1.2\nconst LINE_HEIGHT = 2.5\nconst MINIMAP_BG = \"#1e1e2e\"\nconst MINIMAP_BG_LIGHT = \"#f8fafc\"\nconst TEXT_COLOR = \"#585b70\"\nconst TEXT_COLOR_LIGHT = \"#94a3b8\"\nconst VIEWPORT_COLOR = \"rgba(59, 130, 246, 0.15)\"\nconst VIEWPORT_BORDER = \"rgba(59, 130, 246, 0.4)\"\n\nfunction createMinimapCanvas(): HTMLCanvasElement {\n const canvas = document.createElement(\"canvas\")\n canvas.style.cssText = `position: absolute; right: 0; top: 0; width: ${MINIMAP_WIDTH}px; height: 100%; cursor: pointer; z-index: 5;`\n canvas.width = MINIMAP_WIDTH * 2 // retina\n return canvas\n}\n\nfunction renderMinimap(canvas: HTMLCanvasElement, view: EditorView): void {\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n const doc = view.state.doc\n const totalLines = doc.lines\n const height = canvas.clientHeight\n canvas.height = height * 2 // retina\n\n const isDark = view.dom.classList.contains(\"cm-dark\")\n const bg = isDark ? MINIMAP_BG : MINIMAP_BG_LIGHT\n const textColor = isDark ? TEXT_COLOR : TEXT_COLOR_LIGHT\n\n const scale = 2 // retina\n ctx.setTransform(scale, 0, 0, scale, 0, 0)\n\n // Background\n ctx.fillStyle = bg\n ctx.fillRect(0, 0, MINIMAP_WIDTH, height)\n\n // Calculate visible range in minimap\n const contentHeight = totalLines * LINE_HEIGHT\n const scrollFraction =\n contentHeight > height\n ? view.scrollDOM.scrollTop / (view.scrollDOM.scrollHeight - view.scrollDOM.clientHeight || 1)\n : 0\n const offset = contentHeight > height ? scrollFraction * (contentHeight - height) : 0\n\n // Render text lines\n ctx.fillStyle = textColor\n const startLine = Math.max(1, Math.floor(offset / LINE_HEIGHT))\n const endLine = Math.min(totalLines, startLine + Math.ceil(height / LINE_HEIGHT) + 1)\n\n for (let i = startLine; i <= endLine; i++) {\n const line = doc.line(i)\n const y = (i - 1) * LINE_HEIGHT - offset\n if (y < -LINE_HEIGHT || y > height) continue\n\n const text = line.text\n let x = 4\n for (let j = 0; j < Math.min(text.length, 60); j++) {\n if (text[j] !== \" \" && text[j] !== \"\\t\") {\n ctx.fillRect(x, y, CHAR_WIDTH, 1.5)\n }\n x += CHAR_WIDTH\n }\n }\n\n // Viewport indicator\n const viewportTop = view.scrollDOM.scrollTop\n const viewportHeight = view.scrollDOM.clientHeight\n const docHeight = view.scrollDOM.scrollHeight || 1\n\n const vpY = (viewportTop / docHeight) * Math.min(contentHeight, height)\n const vpH = (viewportHeight / docHeight) * Math.min(contentHeight, height)\n\n ctx.fillStyle = VIEWPORT_COLOR\n ctx.fillRect(0, vpY, MINIMAP_WIDTH, vpH)\n ctx.strokeStyle = VIEWPORT_BORDER\n ctx.lineWidth = 1\n ctx.strokeRect(0.5, vpY + 0.5, MINIMAP_WIDTH - 1, vpH - 1)\n}\n\n/**\n * CodeMirror 6 minimap extension.\n * Renders a canvas-based code overview on the right side of the editor.\n *\n * @example\n * ```ts\n * import { minimapExtension } from '@pyreon/code'\n * // Add to editor extensions\n * ```\n */\nexport function minimapExtension(): Extension {\n return [\n ViewPlugin.fromClass(\n class {\n canvas: HTMLCanvasElement\n view: EditorView\n animFrame: number | null = null\n\n constructor(view: EditorView) {\n this.view = view\n this.canvas = createMinimapCanvas()\n view.dom.style.position = \"relative\"\n view.dom.appendChild(this.canvas)\n\n // Click to scroll\n this.canvas.addEventListener(\"click\", (e) => {\n const rect = this.canvas.getBoundingClientRect()\n const clickY = e.clientY - rect.top\n const fraction = clickY / rect.height\n const scrollTarget =\n fraction * (view.scrollDOM.scrollHeight - view.scrollDOM.clientHeight)\n view.scrollDOM.scrollTo({ top: scrollTarget, behavior: \"smooth\" })\n })\n\n this.render()\n }\n\n render() {\n renderMinimap(this.canvas, this.view)\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged || update.viewportChanged || update.geometryChanged) {\n if (this.animFrame) cancelAnimationFrame(this.animFrame)\n this.animFrame = requestAnimationFrame(() => this.render())\n }\n }\n\n destroy() {\n if (this.animFrame) cancelAnimationFrame(this.animFrame)\n this.canvas.remove()\n }\n },\n ),\n // Add padding on the right for the minimap\n EditorView.theme({\n \".cm-scroller\": {\n paddingRight: `${MINIMAP_WIDTH + 8}px`,\n },\n }),\n ]\n}\n","import {\n autocompletion,\n closeBrackets,\n closeBracketsKeymap,\n completionKeymap,\n} from \"@codemirror/autocomplete\"\nimport {\n redo as cmRedo,\n undo as cmUndo,\n defaultKeymap,\n history,\n historyKeymap,\n indentWithTab,\n} from \"@codemirror/commands\"\nimport {\n bracketMatching,\n defaultHighlightStyle,\n foldGutter,\n foldKeymap,\n indentOnInput,\n indentUnit,\n syntaxHighlighting,\n} from \"@codemirror/language\"\nimport { setDiagnostics as cmSetDiagnostics, lintKeymap } from \"@codemirror/lint\"\nimport { highlightSelectionMatches, searchKeymap } from \"@codemirror/search\"\nimport { Compartment, EditorState, type Extension } from \"@codemirror/state\"\nimport {\n GutterMarker as CMGutterMarker,\n crosshairCursor,\n Decoration,\n type DecorationSet,\n drawSelection,\n dropCursor,\n EditorView,\n gutter,\n highlightActiveLine,\n highlightActiveLineGutter,\n keymap,\n lineNumbers,\n placeholder as placeholderExt,\n rectangularSelection,\n ViewPlugin,\n type ViewUpdate,\n} from \"@codemirror/view\"\nimport { computed, effect, signal } from \"@pyreon/reactivity\"\nimport { loadLanguage } from \"./languages\"\nimport { minimapExtension } from \"./minimap\"\nimport { resolveTheme } from \"./themes\"\nimport type { EditorConfig, EditorInstance, EditorLanguage, EditorTheme } from \"./types\"\n\n/**\n * Create a reactive code editor instance.\n *\n * The editor state (value, language, theme, cursor, selection) is backed\n * by signals. The CodeMirror EditorView is created when mounted via\n * the `<CodeEditor>` component.\n *\n * @param config - Editor configuration\n * @returns A reactive EditorInstance\n *\n * @example\n * ```tsx\n * const editor = createEditor({\n * value: 'const x = 1',\n * language: 'typescript',\n * theme: 'dark',\n * })\n *\n * editor.value() // reactive\n * editor.value.set('new') // updates editor\n *\n * <CodeEditor instance={editor} />\n * ```\n */\nexport function createEditor(config: EditorConfig = {}): EditorInstance {\n const {\n value: initialValue = \"\",\n language: initialLanguage = \"plain\",\n theme: initialTheme = \"light\",\n lineNumbers: showLineNumbers = true,\n readOnly: initialReadOnly = false,\n foldGutter: showFoldGutter = true,\n bracketMatching: enableBracketMatching = true,\n autocomplete: enableAutocomplete = true,\n search: _enableSearch = true,\n highlightIndentGuides: enableIndentGuides = true,\n vim: enableVim = false,\n emacs: enableEmacs = false,\n tabSize: configTabSize = 2,\n lineWrapping: enableLineWrapping = false,\n placeholder: placeholderText,\n minimap: enableMinimap = false,\n extensions: userExtensions = [],\n onChange,\n } = config\n\n // ── Reactive state ───────────────────────────────────────────────────\n\n const value = signal(initialValue)\n const language = signal<EditorLanguage>(initialLanguage)\n const theme = signal<EditorTheme>(initialTheme)\n const readOnly = signal(initialReadOnly)\n const focused = signal(false)\n const view = signal<EditorView | null>(null)\n\n // Internal version tracker for cursor/selection reactivity\n const docVersion = signal(0)\n\n // ── Compartments (for dynamic reconfiguration) ─────────────────────\n\n const languageCompartment = new Compartment()\n const themeCompartment = new Compartment()\n const readOnlyCompartment = new Compartment()\n const extraKeymapCompartment = new Compartment()\n const keyModeCompartment = new Compartment()\n\n // ── Computed ─────────────────────────────────────────────────────────\n\n const cursor = computed(() => {\n docVersion() // subscribe to changes\n const v = view.peek()\n if (!v) return { line: 1, col: 1 }\n const pos = v.state.selection.main.head\n const line = v.state.doc.lineAt(pos)\n return { line: line.number, col: pos - line.from + 1 }\n })\n\n const selection = computed(() => {\n docVersion()\n const v = view.peek()\n if (!v) return { from: 0, to: 0, text: \"\" }\n const sel = v.state.selection.main\n return {\n from: sel.from,\n to: sel.to,\n text: v.state.sliceDoc(sel.from, sel.to),\n }\n })\n\n const lineCount = computed(() => {\n docVersion()\n const v = view.peek()\n return v ? v.state.doc.lines : initialValue.split(\"\\n\").length\n })\n\n // ── Line highlight support ──────────────────────────────────────────\n\n const lineHighlights = new Map<number, string>()\n\n const lineHighlightField = ViewPlugin.fromClass(\n class {\n decorations: DecorationSet\n\n constructor(editorView: EditorView) {\n this.decorations = this.buildDecos(editorView)\n }\n\n buildDecos(editorView: EditorView): DecorationSet {\n const ranges: Array<{ from: number; deco: any }> = []\n for (const [lineNum, cls] of lineHighlights) {\n if (lineNum >= 1 && lineNum <= editorView.state.doc.lines) {\n const lineInfo = editorView.state.doc.line(lineNum)\n ranges.push({\n from: lineInfo.from,\n deco: Decoration.line({ class: cls }),\n })\n }\n }\n return Decoration.set(\n ranges.sort((a, b) => a.from - b.from).map((d) => d.deco.range(d.from)),\n )\n }\n\n update(upd: ViewUpdate) {\n if (upd.docChanged || upd.viewportChanged) {\n this.decorations = this.buildDecos(upd.view)\n }\n }\n },\n { decorations: (plugin) => plugin.decorations },\n )\n\n // ── Gutter marker support ──────────────────────────────────────────\n\n const gutterMarkers = new Map<number, { class?: string; text?: string; title?: string }>()\n\n class CustomGutterMarker extends CMGutterMarker {\n markerText: string\n markerTitle: string\n markerClass: string\n\n constructor(opts: { class?: string; text?: string; title?: string }) {\n super()\n this.markerText = opts.text ?? \"\"\n this.markerTitle = opts.title ?? \"\"\n this.markerClass = opts.class ?? \"\"\n }\n\n override toDOM() {\n const el = document.createElement(\"span\")\n el.textContent = this.markerText\n el.title = this.markerTitle\n if (this.markerClass) el.className = this.markerClass\n el.style.cssText = \"cursor: pointer; display: inline-block; width: 100%; text-align: center;\"\n return el\n }\n }\n\n const gutterMarkerExtension = gutter({\n class: \"pyreon-code-gutter-markers\",\n lineMarker: (gutterView, line) => {\n const lineNo = gutterView.state.doc.lineAt(line.from).number\n const marker = gutterMarkers.get(lineNo)\n if (!marker) return null\n return new CustomGutterMarker(marker)\n },\n initialSpacer: () => new CustomGutterMarker({ text: \" \" }),\n })\n\n // ── Build extensions ─────────────────────────────────────────────────\n\n function buildExtensions(langExt: Extension): Extension[] {\n const exts: Extension[] = [\n // Core\n history(),\n drawSelection(),\n dropCursor(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightActiveLineGutter(),\n highlightSelectionMatches(),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n indentUnit.of(\" \".repeat(configTabSize)),\n\n // Keymaps\n keymap.of([\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap,\n ...lintKeymap,\n indentWithTab,\n ]),\n\n // Dynamic compartments\n languageCompartment.of(langExt),\n themeCompartment.of(resolveTheme(initialTheme)),\n readOnlyCompartment.of(EditorState.readOnly.of(initialReadOnly)),\n extraKeymapCompartment.of([]),\n keyModeCompartment.of([]),\n\n // Update listener — sync CM changes to signal\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n const newValue = update.state.doc.toString()\n // Avoid infinite loop: only set if different\n if (newValue !== value.peek()) {\n value.set(newValue)\n onChange?.(newValue)\n }\n docVersion.update((v) => v + 1)\n }\n if (update.selectionSet) {\n docVersion.update((v) => v + 1)\n }\n if (update.focusChanged) {\n focused.set(update.view.hasFocus)\n }\n }),\n ]\n\n // Optional features\n if (showLineNumbers) exts.push(lineNumbers())\n if (showFoldGutter) exts.push(foldGutter())\n if (enableBracketMatching) exts.push(bracketMatching(), closeBrackets())\n if (enableAutocomplete) exts.push(autocompletion())\n if (enableLineWrapping) exts.push(EditorView.lineWrapping)\n // Indent guides via theme (CM6 doesn't have a built-in extension for this)\n if (enableIndentGuides) {\n exts.push(\n EditorView.theme({\n \".cm-line\": {\n backgroundImage: \"linear-gradient(to right, #e5e7eb 1px, transparent 1px)\",\n backgroundSize: `${configTabSize}ch 100%`,\n backgroundPosition: \"0 0\",\n },\n }),\n )\n }\n if (placeholderText) exts.push(placeholderExt(placeholderText))\n if (enableMinimap) exts.push(minimapExtension())\n\n // Line highlight decoration support\n exts.push(lineHighlightField)\n // Gutter marker support\n exts.push(gutterMarkerExtension)\n\n // User extensions\n exts.push(...userExtensions)\n\n return exts\n }\n\n // ── Mount helper — called by CodeEditor component ────────────────────\n\n let mounted = false\n\n async function mount(parent: HTMLElement): Promise<void> {\n if (mounted) return\n\n const langExt = await loadLanguage(language.peek())\n const extensions = buildExtensions(langExt)\n\n const state = EditorState.create({\n doc: value.peek(),\n extensions,\n })\n\n const editorView = new EditorView({\n state,\n parent,\n })\n\n view.set(editorView)\n mounted = true\n\n // Sync signal → editor for value changes from outside\n effect(() => {\n const val = value()\n const v = view.peek()\n if (!v) return\n const current = v.state.doc.toString()\n if (val !== current) {\n v.dispatch({\n changes: { from: 0, to: current.length, insert: val },\n })\n }\n })\n\n // Sync language changes\n effect(() => {\n const lang = language()\n const v = view.peek()\n if (!v) return\n loadLanguage(lang).then((ext) => {\n v.dispatch({ effects: languageCompartment.reconfigure(ext) })\n })\n })\n\n // Sync theme changes\n effect(() => {\n const t = theme()\n const v = view.peek()\n if (!v) return\n v.dispatch({ effects: themeCompartment.reconfigure(resolveTheme(t)) })\n })\n\n // Sync readOnly changes\n effect(() => {\n const ro = readOnly()\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(ro)),\n })\n })\n }\n\n // ── Actions ──────────────────────────────────────────────────────────\n\n function focus(): void {\n view.peek()?.focus()\n }\n\n function insert(text: string): void {\n const v = view.peek()\n if (!v) return\n const pos = v.state.selection.main.head\n v.dispatch({ changes: { from: pos, insert: text } })\n }\n\n function replaceSelection(text: string): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(v.state.replaceSelection(text))\n }\n\n function select(from: number, to: number): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({ selection: { anchor: from, head: to } })\n }\n\n function selectAll(): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({ selection: { anchor: 0, head: v.state.doc.length } })\n }\n\n function goToLine(line: number): void {\n const v = view.peek()\n if (!v) return\n const lineInfo = v.state.doc.line(Math.min(Math.max(1, line), v.state.doc.lines))\n v.dispatch({\n selection: { anchor: lineInfo.from },\n scrollIntoView: true,\n })\n v.focus()\n }\n\n function undo(): void {\n const v = view.peek()\n if (v) cmUndo(v)\n }\n\n function redo(): void {\n const v = view.peek()\n if (v) cmRedo(v)\n }\n\n function foldAll(): void {\n const v = view.peek()\n if (!v) return\n const { foldAll: foldAllCmd } = require(\"@codemirror/language\")\n foldAllCmd(v)\n }\n\n function unfoldAll(): void {\n const v = view.peek()\n if (!v) return\n const { unfoldAll: unfoldAllCmd } = require(\"@codemirror/language\")\n unfoldAllCmd(v)\n }\n\n // ── Diagnostics ────────────────────────────────────────────────────\n\n function setDiagnostics(diagnostics: import(\"./types\").Diagnostic[]): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(\n cmSetDiagnostics(\n v.state,\n diagnostics.map((d) => ({\n from: d.from,\n to: d.to,\n severity: d.severity === \"hint\" ? \"info\" : d.severity,\n message: d.message,\n ...(d.source != null ? { source: d.source } : {}),\n })),\n ),\n )\n }\n\n function clearDiagnostics(): void {\n const v = view.peek()\n if (!v) return\n v.dispatch(cmSetDiagnostics(v.state, []))\n }\n\n // ── Line highlights ────────────────────────────────────────────────\n\n function highlightLine(line: number, className: string): void {\n lineHighlights.set(line, className)\n // Force re-render of decorations\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n function clearLineHighlights(): void {\n lineHighlights.clear()\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n // ── Gutter markers ────────────────────────────────────────────────\n\n function setGutterMarker(line: number, marker: import(\"./types\").GutterMarker): void {\n gutterMarkers.set(line, marker)\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n function clearGutterMarkers(): void {\n gutterMarkers.clear()\n const v = view.peek()\n if (v) v.dispatch({ effects: [] })\n }\n\n // ── Custom keybindings ─────────────────────────────────────────────\n\n const customKeybindings: Array<{ key: string; run: () => boolean }> = []\n\n function addKeybinding(key: string, handler: () => boolean | undefined): void {\n customKeybindings.push({\n key,\n run: () => {\n handler()\n return true\n },\n })\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: extraKeymapCompartment.reconfigure(keymap.of(customKeybindings)),\n })\n }\n\n // ── Text queries ───────────────────────────────────────────────────\n\n function getLine(line: number): string {\n const v = view.peek()\n if (!v) return \"\"\n const clamped = Math.min(Math.max(1, line), v.state.doc.lines)\n return v.state.doc.line(clamped).text\n }\n\n function getWordAtCursor(): string {\n const v = view.peek()\n if (!v) return \"\"\n const pos = v.state.selection.main.head\n const line = v.state.doc.lineAt(pos)\n const col = pos - line.from\n const text = line.text\n\n // Find word boundaries\n let start = col\n let end = col\n while (start > 0 && /\\w/.test(text.charAt(start - 1))) start--\n while (end < text.length && /\\w/.test(text.charAt(end))) end++\n\n return text.slice(start, end)\n }\n\n function scrollTo(pos: number): void {\n const v = view.peek()\n if (!v) return\n v.dispatch({\n effects: EditorView.scrollIntoView(pos, { y: \"center\" }),\n })\n }\n\n // ── Vim / Emacs mode loading ───────────────────────────────────────\n\n async function loadKeyMode(): Promise<void> {\n const v = view.peek()\n if (!v) return\n\n // Use string concat to prevent Vite from statically analyzing these optional imports\n const vimPkg = \"@replit/codemirror-\" + \"vim\"\n const emacsPkg = \"@replit/codemirror-\" + \"emacs\"\n\n if (enableVim) {\n try {\n const mod = await import(/* @vite-ignore */ vimPkg)\n v.dispatch({\n effects: keyModeCompartment.reconfigure(mod.vim()),\n })\n } catch {\n /* @replit/codemirror-vim not installed */\n }\n }\n\n if (enableEmacs) {\n try {\n const mod = await import(/* @vite-ignore */ emacsPkg)\n v.dispatch({\n effects: keyModeCompartment.reconfigure(mod.emacs()),\n })\n } catch {\n /* @replit/codemirror-emacs not installed */\n }\n }\n }\n\n function dispose(): void {\n const v = view.peek()\n if (v) {\n v.destroy()\n view.set(null)\n mounted = false\n }\n }\n\n // ── Expose mount for component ─────────────────────────────────────\n\n const instance: EditorInstance & { _mount: typeof mount } = {\n value,\n language,\n theme,\n readOnly,\n cursor,\n selection,\n lineCount,\n focused,\n view,\n focus,\n insert,\n replaceSelection,\n select,\n selectAll,\n goToLine,\n undo,\n redo,\n foldAll,\n unfoldAll,\n setDiagnostics,\n clearDiagnostics,\n highlightLine,\n clearLineHighlights,\n setGutterMarker,\n clearGutterMarkers,\n addKeybinding,\n getLine,\n getWordAtCursor,\n scrollTo,\n config,\n dispose,\n _mount: async (parent: HTMLElement) => {\n await mount(parent)\n await loadKeyMode()\n },\n }\n\n return instance\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,cAAc,EAAE;AACtB,SAAS,EAAE,MAAM,OAAO,GAAG,UAAU;AACpC,QAAO;EACN;EACA,OAAO,SAAS;EAChB,UAAU,kBAAkB,SAAS;EACrC,KAAK,OAAO,OAAO;EACnB;;AAEF,SAAS,kBAAkB,UAAU;AACpC,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,IAAK,KAAI,MAAM,QAAQ,SAAS,GAAG,CAAE,QAAO,gBAAgB,SAAS;AAC1G,QAAO;;AAER,SAAS,gBAAgB,UAAU;CAClC,MAAM,SAAS,EAAE;AACjB,MAAK,MAAM,SAAS,SAAU,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,KAAK,GAAG,gBAAgB,MAAM,CAAC;KACzF,QAAO,KAAK,MAAM;AACvB,QAAO;;;;;;;;;AAYR,SAAS,IAAI,MAAM,OAAO,KAAK;CAC9B,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,MAAM,eAAe,OAAO,OAAO;EAClC,GAAG;EACH;EACA,GAAG;AACJ,KAAI,OAAO,SAAS,WAAY,QAAO,EAAE,MAAM,aAAa,KAAK,IAAI;EACpE,GAAG;EACH;EACA,GAAG,aAAa;AACjB,QAAO,EAAE,MAAM,cAAc,GAAG,aAAa,KAAK,IAAI,EAAE,GAAG,MAAM,QAAQ,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;;AAE5G,MAAM,OAAO;;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,KAAK,CAAC,EACnD,CAAC;UACI;AAKV,MAAI,YACF,KAAI;GACF,MAAM,MAAM,MAAM;;IAA0B;;AAC5C,KAAE,SAAS,EACT,SAAS,mBAAmB,YAAY,IAAI,OAAO,CAAC,EACrD,CAAC;UACI;;CAMZ,SAAS,UAAgB;EACvB,MAAM,IAAI,KAAK,MAAM;AACrB,MAAI,GAAG;AACL,KAAE,SAAS;AACX,QAAK,IAAI,KAAK;AACd,aAAU;;;AA4Cd,QAtC4D;EAC1D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ,OAAO,WAAwB;AACrC,SAAM,MAAM,OAAO;AACnB,SAAM,aAAa;;EAEtB"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -239,6 +239,9 @@ declare function CodeEditor(props: CodeEditorProps): VNodeChild;
|
|
|
239
239
|
/**
|
|
240
240
|
* Side-by-side or inline diff editor using @codemirror/merge.
|
|
241
241
|
*
|
|
242
|
+
* Supports reactive `original` and `modified` props — pass a Signal<string>
|
|
243
|
+
* and the diff view updates automatically when the signal changes.
|
|
244
|
+
*
|
|
242
245
|
* @example
|
|
243
246
|
* ```tsx
|
|
244
247
|
* <DiffEditor
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/components/code-editor.tsx","../../../src/components/diff-editor.tsx","../../../src/components/tabbed-editor.tsx","../../../src/editor.ts","../../../src/languages.ts","../../../src/minimap.ts","../../../src/themes.ts"],"mappings":";;;;;;KAMY,cAAA;AAAA,KAsBA,WAAA,sBAAiC,SAAA;AAAA,UAE5B,YAAA;EAxBL;EA0BV,KAAA;;EAEA,QAAA,GAAW,cAAA;EA5Ba;EA8BxB,KAAA,GAAQ,WAAA;EARa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CX;EAoCA,SAAA,GAAY,EAAA;EAhCZ;EAkCA,SAAA,GAAY,EAAA,UAAY,IAAA;EAhCxB;EAkCA,WAAA,GAAc,EAAA,UAAY,QAAA;EA9B1B;EAgCA,OAAA,GAAU,SAAA,UAAmB,OAAA;EAhCrB;EAkCR,MAAA,GAAS,EAAA,aAAe,GAAA;EA/BS;EAiCjC,QAAA;EA/BO;EAiCP,WAAA,GAAc,EAAA;EA7BM;EA+BpB,OAAA;AAAA;AAAA,UAGe,iBAAA;EACf,QAAA,EAAU,oBAAA;EACV,KAAA;EACA,KAAA;AAAA;;;;;;;AArPF;;;;;AAsBA;;;;;iBCXgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAkB,UAAA;;;;;;;ADXpD;;;;;AAsBA;;;;;
|
|
1
|
+
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/types.ts","../../../src/components/code-editor.tsx","../../../src/components/diff-editor.tsx","../../../src/components/tabbed-editor.tsx","../../../src/editor.ts","../../../src/languages.ts","../../../src/minimap.ts","../../../src/themes.ts"],"mappings":";;;;;;KAMY,cAAA;AAAA,KAsBA,WAAA,sBAAiC,SAAA;AAAA,UAE5B,YAAA;EAxBL;EA0BV,KAAA;;EAEA,QAAA,GAAW,cAAA;EA5Ba;EA8BxB,KAAA,GAAQ,WAAA;EARa;EAUrB,WAAA;EAV2C;EAY3C,QAAA;EAVe;EAYf,UAAA;;EAEA,eAAA;EARQ;EAUR,YAAA;EAsBsB;EApBtB,MAAA;EAhBA;EAkBA,IAAA;EAhBW;EAkBX,qBAAA;EAhBQ;EAkBR,GAAA;EAdA;EAgBA,KAAA;EAZA;EAcA,OAAA;EAVA;EAYA,YAAA;EARA;EAUA,YAAA;EANA;EAQA,WAAA;EAJA;EAMA,OAAA;EAFA;EAIA,UAAA,GAAa,SAAA;EAAb;EAEA,QAAA,IAAY,KAAA;AAAA;AAAA,UAKG,cAAA;EALU;EAOzB,KAAA,EAAO,MAAA;EAFQ;EAIf,QAAA,EAA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W,KAAA,EAAO,eAAA,GAAkB,UAAA;;;;;;;ADXpD;;;;;AAsBA;;;;;AAEA;;;iBEKgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAkB,UAAA;;;;;;;AF7BpD;;;;;AAsBA;;;;;AAEA;;;;iBGRgB,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAoB,UAAA;;;;;;;;AHhBxD;;;;;AAsBA;;;;;AAEA;;;;;;;;;iBI4CgB,YAAA,CAAa,MAAA,GAAQ,YAAA,GAAoB,cAAA;;;;;;;AJpEzD;;;;;iBKwCsB,YAAA,CAAa,QAAA,EAAU,cAAA,GAAiB,OAAA,CAAQ,SAAA;;;;iBAoBtD,qBAAA,CAAA,GAAyB,cAAA;;;;;;;;AL5DzC;;;;;iBM4FgB,gBAAA,CAAA,GAAoB,SAAA;;;;;;cC3FvB,UAAA,EAAY,SAAA;APDzB;;;AAAA,cOmCa,SAAA,EAAW,SAAA;;APbxB;;iBOsDgB,YAAA,CAAa,KAAA,EAAO,WAAA,GAAc,SAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/code",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"description": "Reactive code editor for Pyreon — CodeMirror 6 with signals, minimap, diff editor, lazy-loaded languages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -68,13 +68,13 @@
|
|
|
68
68
|
"@codemirror/lang-php": "^6.0.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@pyreon/core": "^0.11.
|
|
72
|
-
"@pyreon/reactivity": "^0.11.
|
|
71
|
+
"@pyreon/core": "^0.11.5",
|
|
72
|
+
"@pyreon/reactivity": "^0.11.5"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@happy-dom/global-registrator": "^20.8.3",
|
|
76
|
-
"@pyreon/core": "^0.11.
|
|
77
|
-
"@pyreon/reactivity": "^0.11.
|
|
76
|
+
"@pyreon/core": "^0.11.5",
|
|
77
|
+
"@pyreon/reactivity": "^0.11.5",
|
|
78
78
|
"@vitus-labs/tools-lint": "^1.11.0"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -3,14 +3,25 @@ import { MergeView } from "@codemirror/merge"
|
|
|
3
3
|
import { EditorState, type Extension } from "@codemirror/state"
|
|
4
4
|
import { EditorView } from "@codemirror/view"
|
|
5
5
|
import type { VNodeChild } from "@pyreon/core"
|
|
6
|
+
import { onUnmount } from "@pyreon/core"
|
|
6
7
|
import type { Signal } from "@pyreon/reactivity"
|
|
8
|
+
import { watch } from "@pyreon/reactivity"
|
|
7
9
|
import { loadLanguage } from "../languages"
|
|
8
10
|
import { resolveTheme } from "../themes"
|
|
9
11
|
import type { DiffEditorProps } from "../types"
|
|
10
12
|
|
|
13
|
+
const readText = (value: string | Signal<string>): string =>
|
|
14
|
+
typeof value === "string" ? value : value()
|
|
15
|
+
|
|
16
|
+
const isSignal = (value: string | Signal<string>): value is Signal<string> =>
|
|
17
|
+
typeof value === "function"
|
|
18
|
+
|
|
11
19
|
/**
|
|
12
20
|
* Side-by-side or inline diff editor using @codemirror/merge.
|
|
13
21
|
*
|
|
22
|
+
* Supports reactive `original` and `modified` props — pass a Signal<string>
|
|
23
|
+
* and the diff view updates automatically when the signal changes.
|
|
24
|
+
*
|
|
14
25
|
* @example
|
|
15
26
|
* ```tsx
|
|
16
27
|
* <DiffEditor
|
|
@@ -23,14 +34,10 @@ import type { DiffEditorProps } from "../types"
|
|
|
23
34
|
* ```
|
|
24
35
|
*/
|
|
25
36
|
export function DiffEditor(props: DiffEditorProps): VNodeChild {
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
theme = "light",
|
|
31
|
-
readOnly = true,
|
|
32
|
-
inline = false,
|
|
33
|
-
} = props
|
|
37
|
+
const { original, modified, language = "plain", theme = "light", readOnly = true } = props
|
|
38
|
+
|
|
39
|
+
let mergeView: MergeView | null = null
|
|
40
|
+
const cleanups: (() => void)[] = []
|
|
34
41
|
|
|
35
42
|
const containerRef = async (el: Element | null) => {
|
|
36
43
|
if (!el) return
|
|
@@ -46,43 +53,49 @@ export function DiffEditor(props: DiffEditorProps): VNodeChild {
|
|
|
46
53
|
EditorState.readOnly.of(readOnly),
|
|
47
54
|
]
|
|
48
55
|
|
|
49
|
-
const originalText =
|
|
50
|
-
const modifiedText =
|
|
56
|
+
const originalText = readText(original)
|
|
57
|
+
const modifiedText = readText(modified)
|
|
51
58
|
|
|
52
59
|
// Clear previous content
|
|
53
60
|
;(el as HTMLElement).innerHTML = ""
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
mergeView = new MergeView({
|
|
63
|
+
a: { doc: originalText, extensions },
|
|
64
|
+
b: { doc: modifiedText, extensions },
|
|
65
|
+
parent: el as HTMLElement,
|
|
66
|
+
collapseUnchanged: { margin: 3, minSize: 4 },
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Track signal changes and update MergeView editors reactively
|
|
70
|
+
if (isSignal(original)) {
|
|
71
|
+
const stop = watch(original, (text) => {
|
|
72
|
+
if (!mergeView) return
|
|
73
|
+
const editor = mergeView.a
|
|
74
|
+
editor.dispatch({
|
|
75
|
+
changes: { from: 0, to: editor.state.doc.length, insert: text },
|
|
76
|
+
})
|
|
68
77
|
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
doc:
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
parent: el as HTMLElement,
|
|
81
|
-
collapseUnchanged: { margin: 3, minSize: 4 },
|
|
78
|
+
cleanups.push(stop)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (isSignal(modified)) {
|
|
82
|
+
const stop = watch(modified, (text) => {
|
|
83
|
+
if (!mergeView) return
|
|
84
|
+
const editor = mergeView.b
|
|
85
|
+
editor.dispatch({
|
|
86
|
+
changes: { from: 0, to: editor.state.doc.length, insert: text },
|
|
87
|
+
})
|
|
82
88
|
})
|
|
89
|
+
cleanups.push(stop)
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
onUnmount(() => {
|
|
94
|
+
for (const cleanup of cleanups) cleanup()
|
|
95
|
+
mergeView?.destroy()
|
|
96
|
+
mergeView = null
|
|
97
|
+
})
|
|
98
|
+
|
|
86
99
|
const baseStyle = `width: 100%; height: 100%; overflow: hidden; ${props.style ?? ""}`
|
|
87
100
|
|
|
88
101
|
return (
|