@industry-theme/file-editing-panels 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/panels.bundle.js +1656 -27
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
- package/dist/apl-fqmucPXA.js +0 -141
- package/dist/apl-fqmucPXA.js.map +0 -1
- package/dist/asciiarmor-DucZyvP0.js +0 -57
- package/dist/asciiarmor-DucZyvP0.js.map +0 -1
- package/dist/asn1-BnOEsgAm.js +0 -145
- package/dist/asn1-BnOEsgAm.js.map +0 -1
- package/dist/asterisk-QAlztEwS.js +0 -346
- package/dist/asterisk-QAlztEwS.js.map +0 -1
- package/dist/brainfuck-DZVCuF_t.js +0 -54
- package/dist/brainfuck-DZVCuF_t.js.map +0 -1
- package/dist/clike-CTYGlS6x.js +0 -800
- package/dist/clike-CTYGlS6x.js.map +0 -1
- package/dist/clojure-BhXMqnxz.js +0 -850
- package/dist/clojure-BhXMqnxz.js.map +0 -1
- package/dist/cmake-BGaNd9E7.js +0 -72
- package/dist/cmake-BGaNd9E7.js.map +0 -1
- package/dist/cobol-4yqQntpt.js +0 -121
- package/dist/cobol-4yqQntpt.js.map +0 -1
- package/dist/coffeescript-D2dXvhEc.js +0 -309
- package/dist/coffeescript-D2dXvhEc.js.map +0 -1
- package/dist/commonlisp-CF_VNHQR.js +0 -131
- package/dist/commonlisp-CF_VNHQR.js.map +0 -1
- package/dist/crystal-DyuLTqLs.js +0 -399
- package/dist/crystal-DyuLTqLs.js.map +0 -1
- package/dist/css-DkSyTW67.js +0 -1773
- package/dist/css-DkSyTW67.js.map +0 -1
- package/dist/cypher-Dlu_3r4V.js +0 -122
- package/dist/cypher-Dlu_3r4V.js.map +0 -1
- package/dist/d-UURgV0Ux.js +0 -180
- package/dist/d-UURgV0Ux.js.map +0 -1
- package/dist/diff-B_Bi2Crb.js +0 -26
- package/dist/diff-B_Bi2Crb.js.map +0 -1
- package/dist/dockerfile-Bvk733Ga.js +0 -202
- package/dist/dockerfile-Bvk733Ga.js.map +0 -1
- package/dist/dtd-Dy74G54E.js +0 -115
- package/dist/dtd-Dy74G54E.js.map +0 -1
- package/dist/dylan-TSb-Nfix.js +0 -315
- package/dist/dylan-TSb-Nfix.js.map +0 -1
- package/dist/ebnf-4fKAGW3a.js +0 -141
- package/dist/ebnf-4fKAGW3a.js.map +0 -1
- package/dist/ecl-B59qGGVg.js +0 -179
- package/dist/ecl-B59qGGVg.js.map +0 -1
- package/dist/eiffel-Dze7nlu3.js +0 -135
- package/dist/eiffel-Dze7nlu3.js.map +0 -1
- package/dist/elm-DG7jkhNZ.js +0 -177
- package/dist/elm-DG7jkhNZ.js.map +0 -1
- package/dist/erlang-BO6gOnGA.js +0 -675
- package/dist/erlang-BO6gOnGA.js.map +0 -1
- package/dist/factor-CMxFHDqz.js +0 -66
- package/dist/factor-CMxFHDqz.js.map +0 -1
- package/dist/fcl-CDDUNjTj.js +0 -142
- package/dist/fcl-CDDUNjTj.js.map +0 -1
- package/dist/forth-B9D2JCeE.js +0 -117
- package/dist/forth-B9D2JCeE.js.map +0 -1
- package/dist/fortran-CAG2BFbe.js +0 -468
- package/dist/fortran-CAG2BFbe.js.map +0 -1
- package/dist/gas-0Aw8zDr5.js +0 -294
- package/dist/gas-0Aw8zDr5.js.map +0 -1
- package/dist/gherkin-DhZlEZiy.js +0 -116
- package/dist/gherkin-DhZlEZiy.js.map +0 -1
- package/dist/groovy-CpwJiBl7.js +0 -224
- package/dist/groovy-CpwJiBl7.js.map +0 -1
- package/dist/haskell-ySd-OUo8.js +0 -460
- package/dist/haskell-ySd-OUo8.js.map +0 -1
- package/dist/haxe-7MlzfeYV.js +0 -515
- package/dist/haxe-7MlzfeYV.js.map +0 -1
- package/dist/http-BqypyemW.js +0 -80
- package/dist/http-BqypyemW.js.map +0 -1
- package/dist/idl-4HIGJlDI.js +0 -986
- package/dist/idl-4HIGJlDI.js.map +0 -1
- package/dist/index--9b13vPe.js +0 -82
- package/dist/index--9b13vPe.js.map +0 -1
- package/dist/index-4yNOU-ld.js +0 -704
- package/dist/index-4yNOU-ld.js.map +0 -1
- package/dist/index-B934ET9W.js +0 -150
- package/dist/index-B934ET9W.js.map +0 -1
- package/dist/index-BJfihVcY.js +0 -114
- package/dist/index-BJfihVcY.js.map +0 -1
- package/dist/index-BcgIVFR8.js +0 -329
- package/dist/index-BcgIVFR8.js.map +0 -1
- package/dist/index-BizMynkX.js +0 -61
- package/dist/index-BizMynkX.js.map +0 -1
- package/dist/index-Bkr7ogvq.js +0 -689
- package/dist/index-Bkr7ogvq.js.map +0 -1
- package/dist/index-BpctbcxL.js +0 -326
- package/dist/index-BpctbcxL.js.map +0 -1
- package/dist/index-Bx5x59O2.js +0 -157
- package/dist/index-Bx5x59O2.js.map +0 -1
- package/dist/index-CFEWOruQ.js +0 -79
- package/dist/index-CFEWOruQ.js.map +0 -1
- package/dist/index-CHB2roG6.js +0 -288
- package/dist/index-CHB2roG6.js.map +0 -1
- package/dist/index-CLsgJ3nG.js +0 -76162
- package/dist/index-CLsgJ3nG.js.map +0 -1
- package/dist/index-CPsgj-jw.js +0 -301
- package/dist/index-CPsgj-jw.js.map +0 -1
- package/dist/index-CTHSHU5h.js +0 -385
- package/dist/index-CTHSHU5h.js.map +0 -1
- package/dist/index-CXmFIu8k.js +0 -178
- package/dist/index-CXmFIu8k.js.map +0 -1
- package/dist/index-CnfO532w.js +0 -406
- package/dist/index-CnfO532w.js.map +0 -1
- package/dist/index-DcEPQcqT.js +0 -97
- package/dist/index-DcEPQcqT.js.map +0 -1
- package/dist/index-PHeueb7Z.js +0 -312
- package/dist/index-PHeueb7Z.js.map +0 -1
- package/dist/javascript-Bt8B7yTi.js +0 -993
- package/dist/javascript-Bt8B7yTi.js.map +0 -1
- package/dist/julia-Bs6JJhYG.js +0 -408
- package/dist/julia-Bs6JJhYG.js.map +0 -1
- package/dist/livescript-DmzgM3Yt.js +0 -297
- package/dist/livescript-DmzgM3Yt.js.map +0 -1
- package/dist/lua-8cJgIlqe.js +0 -257
- package/dist/lua-8cJgIlqe.js.map +0 -1
- package/dist/mathematica-DNLOL9PQ.js +0 -111
- package/dist/mathematica-DNLOL9PQ.js.map +0 -1
- package/dist/mbox-Ga7d4MMN.js +0 -118
- package/dist/mbox-Ga7d4MMN.js.map +0 -1
- package/dist/mirc-Dma3B8rS.js +0 -108
- package/dist/mirc-Dma3B8rS.js.map +0 -1
- package/dist/mllike-DHn7xckP.js +0 -335
- package/dist/mllike-DHn7xckP.js.map +0 -1
- package/dist/modelica-0d55jYY0.js +0 -148
- package/dist/modelica-0d55jYY0.js.map +0 -1
- package/dist/mscgen-DdqZYINH.js +0 -136
- package/dist/mscgen-DdqZYINH.js.map +0 -1
- package/dist/mumps-Btr8VblO.js +0 -94
- package/dist/mumps-Btr8VblO.js.map +0 -1
- package/dist/nginx-DTDtBDVN.js +0 -142
- package/dist/nginx-DTDtBDVN.js.map +0 -1
- package/dist/nsis-3zG7tgur.js +0 -63
- package/dist/nsis-3zG7tgur.js.map +0 -1
- package/dist/ntriples-CvgOYMpL.js +0 -154
- package/dist/ntriples-CvgOYMpL.js.map +0 -1
- package/dist/octave-DYBj3-tl.js +0 -201
- package/dist/octave-DYBj3-tl.js.map +0 -1
- package/dist/oz-R_e8WMIi.js +0 -232
- package/dist/oz-R_e8WMIi.js.map +0 -1
- package/dist/pascal-GD8iposT.js +0 -106
- package/dist/pascal-GD8iposT.js.map +0 -1
- package/dist/perl-DL9mHpoi.js +0 -1106
- package/dist/perl-DL9mHpoi.js.map +0 -1
- package/dist/pig-C_4T4YIV.js +0 -102
- package/dist/pig-C_4T4YIV.js.map +0 -1
- package/dist/powershell-B0suO7Vd.js +0 -329
- package/dist/powershell-B0suO7Vd.js.map +0 -1
- package/dist/properties-BR-vP1aU.js +0 -59
- package/dist/properties-BR-vP1aU.js.map +0 -1
- package/dist/protobuf-BxgpyhoW.js +0 -78
- package/dist/protobuf-BxgpyhoW.js.map +0 -1
- package/dist/pug-vHnWR0UE.js +0 -406
- package/dist/pug-vHnWR0UE.js.map +0 -1
- package/dist/puppet-Bdao66PW.js +0 -138
- package/dist/puppet-Bdao66PW.js.map +0 -1
- package/dist/python-BFGRmuZ9.js +0 -427
- package/dist/python-BFGRmuZ9.js.map +0 -1
- package/dist/q-CrbCVq4a.js +0 -132
- package/dist/q-CrbCVq4a.js.map +0 -1
- package/dist/r-V7nswm59.js +0 -171
- package/dist/r-V7nswm59.js.map +0 -1
- package/dist/rpm-C-DLY-If.js +0 -110
- package/dist/rpm-C-DLY-If.js.map +0 -1
- package/dist/ruby-JDKLJNK0.js +0 -331
- package/dist/ruby-JDKLJNK0.js.map +0 -1
- package/dist/sas-D2UG-yhZ.js +0 -208
- package/dist/sas-D2UG-yhZ.js.map +0 -1
- package/dist/scheme-BKzrkGJD.js +0 -223
- package/dist/scheme-BKzrkGJD.js.map +0 -1
- package/dist/shell-BlsXDxCn.js +0 -223
- package/dist/shell-BlsXDxCn.js.map +0 -1
- package/dist/sieve-CjwBwOY5.js +0 -136
- package/dist/sieve-CjwBwOY5.js.map +0 -1
- package/dist/simple-mode-DMneyfDu.js +0 -131
- package/dist/simple-mode-DMneyfDu.js.map +0 -1
- package/dist/smalltalk-BOIGQuhN.js +0 -122
- package/dist/smalltalk-BOIGQuhN.js.map +0 -1
- package/dist/solr-CwD7U71z.js +0 -70
- package/dist/solr-CwD7U71z.js.map +0 -1
- package/dist/sparql-DYskk2vE.js +0 -250
- package/dist/sparql-DYskk2vE.js.map +0 -1
- package/dist/spreadsheet-Bgtt3oLP.js +0 -88
- package/dist/spreadsheet-Bgtt3oLP.js.map +0 -1
- package/dist/sql-Cei9CMfk.js +0 -343
- package/dist/sql-Cei9CMfk.js.map +0 -1
- package/dist/stex-C1nZSzAw.js +0 -231
- package/dist/stex-C1nZSzAw.js.map +0 -1
- package/dist/stylus-BkS-boTH.js +0 -566
- package/dist/stylus-BkS-boTH.js.map +0 -1
- package/dist/swift-FRZi1uvB.js +0 -292
- package/dist/swift-FRZi1uvB.js.map +0 -1
- package/dist/tcl-CUcaCdmq.js +0 -115
- package/dist/tcl-CUcaCdmq.js.map +0 -1
- package/dist/textile-BnFpjsrl.js +0 -415
- package/dist/textile-BnFpjsrl.js.map +0 -1
- package/dist/tiddlywiki-CjprD-Qp.js +0 -219
- package/dist/tiddlywiki-CjprD-Qp.js.map +0 -1
- package/dist/tiki-DK9DOeWn.js +0 -269
- package/dist/tiki-DK9DOeWn.js.map +0 -1
- package/dist/toml-BOuWGMcf.js +0 -77
- package/dist/toml-BOuWGMcf.js.map +0 -1
- package/dist/troff-E1bJ0PPL.js +0 -62
- package/dist/troff-E1bJ0PPL.js.map +0 -1
- package/dist/ttcn-cfg-Dc39-fIP.js +0 -134
- package/dist/ttcn-cfg-Dc39-fIP.js.map +0 -1
- package/dist/ttcn-tKd4HLu4.js +0 -193
- package/dist/ttcn-tKd4HLu4.js.map +0 -1
- package/dist/turtle-Dq7-1WAf.js +0 -125
- package/dist/turtle-Dq7-1WAf.js.map +0 -1
- package/dist/vb-Dp90gtsv.js +0 -197
- package/dist/vb-Dp90gtsv.js.map +0 -1
- package/dist/vbscript-Bfn8O8I7.js +0 -479
- package/dist/vbscript-Bfn8O8I7.js.map +0 -1
- package/dist/velocity-BwIZK1TH.js +0 -150
- package/dist/velocity-BwIZK1TH.js.map +0 -1
- package/dist/verilog-CnT9bMk0.js +0 -430
- package/dist/verilog-CnT9bMk0.js.map +0 -1
- package/dist/vhdl-DCkMIyT9.js +0 -159
- package/dist/vhdl-DCkMIyT9.js.map +0 -1
- package/dist/webidl-BTLTThCm.js +0 -205
- package/dist/webidl-BTLTThCm.js.map +0 -1
- package/dist/xquery-BrBUuxMR.js +0 -526
- package/dist/xquery-BrBUuxMR.js.map +0 -1
- package/dist/yacas-b5lAVEIl.js +0 -131
- package/dist/yacas-b5lAVEIl.js.map +0 -1
- package/dist/z80-ClgwfNdB.js +0 -93
- package/dist/z80-ClgwfNdB.js.map +0 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -1,30 +1,1659 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
elementStyle.appendChild(document.createTextNode(".mdxeditor {\n /** Code mirror */\n & .cm-editor {\n --sp-font-mono: var(--font-mono);\n --sp-font-body: var(--font-body);\n padding: var(--sp-space-4) 0;\n }\n\n & .sp-editor .cm-editor {\n padding-bottom: 0;\n }\n\n & .cm-scroller {\n padding: 0 !important;\n }\n\n & .cm-focused {\n outline: none;\n }\n\n & .sp-wrapper {\n overflow: hidden;\n }\n\n & .sp-layout {\n border: none;\n }\n\n & .sp-cm {\n & pre {\n white-space: break-spaces;\n word-break: break-word;\n overflow-wrap: anywhere;\n flex-shrink: 1;\n }\n }\n\n /** Diff viewer */\n & .cm-mergeView .cm-scroller {\n font-family: var(--font-mono);\n line-height: 1.3rem;\n font-size: var(--text-xs);\n }\n\n /** Diff viewer */\n & .cm-sourceView .cm-scroller {\n font-family: var(--font-mono);\n line-height: 1.3rem;\n font-size: var(--text-xs);\n }\n\n & .cm-gutters {\n background: transparent;\n font-size: var(--text-xxs);\n }\n\n & .cm-activeLine {\n background: transparent;\n }\n\n & .cm-tooltip-autocomplete {\n background: var(--baseBgSubtle);\n }\n\n\n hr[data-lexical-decorator=true].selected {\n outline: 2px solid highlight;\n }\n}\n:root, .light, .light-theme {\n --blue-1: #fbfdff;\n --blue-2: #f4faff;\n --blue-3: #e6f4fe;\n --blue-4: #d5efff;\n --blue-5: #c2e5ff;\n --blue-6: #acd8fc;\n --blue-7: #8ec8f6;\n --blue-8: #5eb1ef;\n --blue-9: #0090ff;\n --blue-10: #0588f0;\n --blue-11: #0d74ce;\n --blue-12: #113264;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --blue-1: color(display-p3 0.986 0.992 0.999);\n --blue-2: color(display-p3 0.96 0.979 0.998);\n --blue-3: color(display-p3 0.912 0.956 0.991);\n --blue-4: color(display-p3 0.853 0.932 1);\n --blue-5: color(display-p3 0.788 0.894 0.998);\n --blue-6: color(display-p3 0.709 0.843 0.976);\n --blue-7: color(display-p3 0.606 0.777 0.947);\n --blue-8: color(display-p3 0.451 0.688 0.917);\n --blue-9: color(display-p3 0.247 0.556 0.969);\n --blue-10: color(display-p3 0.234 0.523 0.912);\n --blue-11: color(display-p3 0.15 0.44 0.84);\n --blue-12: color(display-p3 0.102 0.193 0.379);\n }\n }\n}.dark, .dark-theme {\n --blue-1: #0d1520;\n --blue-2: #111927;\n --blue-3: #0d2847;\n --blue-4: #003362;\n --blue-5: #004074;\n --blue-6: #104d87;\n --blue-7: #205d9e;\n --blue-8: #2870bd;\n --blue-9: #0090ff;\n --blue-10: #3b9eff;\n --blue-11: #70b8ff;\n --blue-12: #c2e6ff;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n .dark, .dark-theme {\n --blue-1: color(display-p3 0.057 0.081 0.122);\n --blue-2: color(display-p3 0.072 0.098 0.147);\n --blue-3: color(display-p3 0.078 0.154 0.27);\n --blue-4: color(display-p3 0.033 0.197 0.37);\n --blue-5: color(display-p3 0.08 0.245 0.441);\n --blue-6: color(display-p3 0.14 0.298 0.511);\n --blue-7: color(display-p3 0.195 0.361 0.6);\n --blue-8: color(display-p3 0.239 0.434 0.72);\n --blue-9: color(display-p3 0.247 0.556 0.969);\n --blue-10: color(display-p3 0.344 0.612 0.973);\n --blue-11: color(display-p3 0.49 0.72 1);\n --blue-12: color(display-p3 0.788 0.898 0.99);\n }\n }\n}:root, .light, .light-theme {\n --slate-1: #fcfcfd;\n --slate-2: #f9f9fb;\n --slate-3: #f0f0f3;\n --slate-4: #e8e8ec;\n --slate-5: #e0e1e6;\n --slate-6: #d9d9e0;\n --slate-7: #cdced6;\n --slate-8: #b9bbc6;\n --slate-9: #8b8d98;\n --slate-10: #80838d;\n --slate-11: #60646c;\n --slate-12: #1c2024;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --slate-1: color(display-p3 0.988 0.988 0.992);\n --slate-2: color(display-p3 0.976 0.976 0.984);\n --slate-3: color(display-p3 0.94 0.941 0.953);\n --slate-4: color(display-p3 0.908 0.909 0.925);\n --slate-5: color(display-p3 0.88 0.881 0.901);\n --slate-6: color(display-p3 0.85 0.852 0.876);\n --slate-7: color(display-p3 0.805 0.808 0.838);\n --slate-8: color(display-p3 0.727 0.733 0.773);\n --slate-9: color(display-p3 0.547 0.553 0.592);\n --slate-10: color(display-p3 0.503 0.512 0.549);\n --slate-11: color(display-p3 0.379 0.392 0.421);\n --slate-12: color(display-p3 0.113 0.125 0.14);\n }\n }\n}.dark, .dark-theme {\n --slate-1: #111113;\n --slate-2: #18191b;\n --slate-3: #212225;\n --slate-4: #272a2d;\n --slate-5: #2e3135;\n --slate-6: #363a3f;\n --slate-7: #43484e;\n --slate-8: #5a6169;\n --slate-9: #696e77;\n --slate-10: #777b84;\n --slate-11: #b0b4ba;\n --slate-12: #edeef0;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n .dark, .dark-theme {\n --slate-1: color(display-p3 0.067 0.067 0.074);\n --slate-2: color(display-p3 0.095 0.098 0.105);\n --slate-3: color(display-p3 0.13 0.135 0.145);\n --slate-4: color(display-p3 0.156 0.163 0.176);\n --slate-5: color(display-p3 0.183 0.191 0.206);\n --slate-6: color(display-p3 0.215 0.226 0.244);\n --slate-7: color(display-p3 0.265 0.28 0.302);\n --slate-8: color(display-p3 0.357 0.381 0.409);\n --slate-9: color(display-p3 0.415 0.431 0.463);\n --slate-10: color(display-p3 0.469 0.483 0.514);\n --slate-11: color(display-p3 0.692 0.704 0.728);\n --slate-12: color(display-p3 0.93 0.933 0.94);\n }\n }\n}:root, .light, .light-theme {\n --grass-1: #fbfefb;\n --grass-2: #f5fbf5;\n --grass-3: #e9f6e9;\n --grass-4: #daf1db;\n --grass-5: #c9e8ca;\n --grass-6: #b2ddb5;\n --grass-7: #94ce9a;\n --grass-8: #65ba74;\n --grass-9: #46a758;\n --grass-10: #3e9b4f;\n --grass-11: #2a7e3b;\n --grass-12: #203c25;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --grass-1: color(display-p3 0.986 0.996 0.985);\n --grass-2: color(display-p3 0.966 0.983 0.964);\n --grass-3: color(display-p3 0.923 0.965 0.917);\n --grass-4: color(display-p3 0.872 0.94 0.865);\n --grass-5: color(display-p3 0.811 0.908 0.802);\n --grass-6: color(display-p3 0.733 0.864 0.724);\n --grass-7: color(display-p3 0.628 0.803 0.622);\n --grass-8: color(display-p3 0.477 0.72 0.482);\n --grass-9: color(display-p3 0.38 0.647 0.378);\n --grass-10: color(display-p3 0.344 0.598 0.342);\n --grass-11: color(display-p3 0.263 0.488 0.261);\n --grass-12: color(display-p3 0.151 0.233 0.153);\n }\n }\n}:root, .light, .light-theme {\n --cyan-1: #fafdfe;\n --cyan-2: #f2fafb;\n --cyan-3: #def7f9;\n --cyan-4: #caf1f6;\n --cyan-5: #b5e9f0;\n --cyan-6: #9ddde7;\n --cyan-7: #7dcedc;\n --cyan-8: #3db9cf;\n --cyan-9: #00a2c7;\n --cyan-10: #0797b9;\n --cyan-11: #107d98;\n --cyan-12: #0d3c48;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --cyan-1: color(display-p3 0.982 0.992 0.996);\n --cyan-2: color(display-p3 0.955 0.981 0.984);\n --cyan-3: color(display-p3 0.888 0.965 0.975);\n --cyan-4: color(display-p3 0.821 0.941 0.959);\n --cyan-5: color(display-p3 0.751 0.907 0.935);\n --cyan-6: color(display-p3 0.671 0.862 0.9);\n --cyan-7: color(display-p3 0.564 0.8 0.854);\n --cyan-8: color(display-p3 0.388 0.715 0.798);\n --cyan-9: color(display-p3 0.282 0.627 0.765);\n --cyan-10: color(display-p3 0.264 0.583 0.71);\n --cyan-11: color(display-p3 0.08 0.48 0.63);\n --cyan-12: color(display-p3 0.108 0.232 0.277);\n }\n }\n}:root, .light, .light-theme {\n --amber-1: #fefdfb;\n --amber-2: #fefbe9;\n --amber-3: #fff7c2;\n --amber-4: #ffee9c;\n --amber-5: #fbe577;\n --amber-6: #f3d673;\n --amber-7: #e9c162;\n --amber-8: #e2a336;\n --amber-9: #ffc53d;\n --amber-10: #ffba18;\n --amber-11: #ab6400;\n --amber-12: #4f3422;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --amber-1: color(display-p3 0.995 0.992 0.985);\n --amber-2: color(display-p3 0.994 0.986 0.921);\n --amber-3: color(display-p3 0.994 0.969 0.782);\n --amber-4: color(display-p3 0.989 0.937 0.65);\n --amber-5: color(display-p3 0.97 0.902 0.527);\n --amber-6: color(display-p3 0.936 0.844 0.506);\n --amber-7: color(display-p3 0.89 0.762 0.443);\n --amber-8: color(display-p3 0.85 0.65 0.3);\n --amber-9: color(display-p3 1 0.77 0.26);\n --amber-10: color(display-p3 0.959 0.741 0.274);\n --amber-11: color(display-p3 0.64 0.4 0);\n --amber-12: color(display-p3 0.294 0.208 0.145);\n }\n }\n}:root, .light, .light-theme {\n --red-1: #fffcfc;\n --red-2: #fff7f7;\n --red-3: #feebec;\n --red-4: #ffdbdc;\n --red-5: #ffcdce;\n --red-6: #fdbdbe;\n --red-7: #f4a9aa;\n --red-8: #eb8e90;\n --red-9: #e5484d;\n --red-10: #dc3e42;\n --red-11: #ce2c31;\n --red-12: #641723;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .light, .light-theme {\n --red-1: color(display-p3 0.998 0.989 0.988);\n --red-2: color(display-p3 0.995 0.971 0.971);\n --red-3: color(display-p3 0.985 0.925 0.925);\n --red-4: color(display-p3 0.999 0.866 0.866);\n --red-5: color(display-p3 0.984 0.812 0.811);\n --red-6: color(display-p3 0.955 0.751 0.749);\n --red-7: color(display-p3 0.915 0.675 0.672);\n --red-8: color(display-p3 0.872 0.575 0.572);\n --red-9: color(display-p3 0.83 0.329 0.324);\n --red-10: color(display-p3 0.798 0.294 0.285);\n --red-11: color(display-p3 0.744 0.234 0.222);\n --red-12: color(display-p3 0.36 0.115 0.143);\n }\n }\n}.ui-module_editorRoot_3d63c {\n --accentBase: var(--blue-1);\n --accentBgSubtle: var(--blue-2);\n --accentBg: var(--blue-3);\n --accentBgHover: var(--blue-4);\n --accentBgActive: var(--blue-5);\n --accentLine: var(--blue-6);\n --accentBorder: var(--blue-7);\n --accentBorderHover: var(--blue-8);\n --accentSolid: var(--blue-9);\n --accentSolidHover: var(--blue-10);\n --accentText: var(--blue-11);\n --accentTextContrast: var(--blue-12);\n\n --basePageBg: white;\n --baseBase: var(--slate-1);\n --baseBgSubtle: var(--slate-2);\n --baseBg: var(--slate-3);\n --baseBgHover: var(--slate-4);\n --baseBgActive: var(--slate-5);\n --baseLine: var(--slate-6);\n --baseBorder: var(--slate-7);\n --baseBorderHover: var(--slate-8);\n --baseSolid: var(--slate-9);\n --baseSolidHover: var(--slate-10);\n --baseText: var(--slate-11);\n --baseTextContrast: var(--slate-12);\n\n --admonitionTipBg: var(--cyan-4);\n --admonitionTipBorder: var(--cyan-8);\n\n --admonitionInfoBg: var(--grass-4);\n --admonitionInfoBorder: var(--grass-8);\n\n --admonitionCautionBg: var(--amber-4);\n --admonitionCautionBorder: var(--amber-8);\n\n --admonitionDangerBg: var(--red-4);\n --admonitionDangerBorder: var(--red-8);\n\n --admonitionNoteBg: var(--slate-4);\n --admonitionNoteBorder: var(--slate-8);\n\n --error-color: var(--red-10);\n\n --spacing-0: 0px;\n --spacing-px: 1px;\n --spacing-0_5: 0.125rem;\n --spacing-1: 0.25rem;\n --spacing-1_5: 0.375rem;\n --spacing-2: 0.5rem;\n --spacing-2_5: 0.625rem;\n --spacing-3: 0.75rem;\n --spacing-3_5: 0.875rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-7: 1.75rem;\n --spacing-8: 2rem;\n --spacing-9: 2.25rem;\n --spacing-10: 2.5rem;\n --spacing-11: 2.75rem;\n --spacing-12: 3rem;\n --spacing-14: 3.5rem;\n --spacing-16: 4rem;\n --spacing-20: 5rem;\n --spacing-24: 6rem;\n --spacing-28: 7rem;\n --spacing-32: 8rem;\n --spacing-36: 9rem;\n --spacing-40: 10rem;\n --spacing-44: 11rem;\n --spacing-48: 12rem;\n --spacing-52: 13rem;\n --spacing-56: 14rem;\n --spacing-60: 15rem;\n --spacing-64: 16rem;\n --spacing-72: 18rem;\n --spacing-80: 20rem;\n --spacing-96: 24rem;\n\n --radius-none: 0px;\n --radius-small: var(--spacing-0_5);\n --radius-base: var(--spacing-1);\n --radius-medium: var(--spacing-1_5);\n --radius-large: var(--spacing-2);\n --radius-extra-large: var(--spacing-3);\n --radius-full: 9999px;\n\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\n --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',\n sans-serif;\n\n --text-base: 1rem;\n --text-sm: 0.875rem;\n --text-xs: 0.75rem;\n --text-xxs: 0.6rem;\n\n font-family: var(--font-body);\n color: var(--baseText);\n}\n\n.ui-module_editorWrapper_nPW0c {\n}\n\n.ui-module_nestedListItem_-OMpV {\n list-style: none;\n}\n\n.ui-module_toolbarRoot_QA6-G {\n z-index: 2;\n display: flex;\n flex-direction: row;\n gap: var(--spacing-1);\n border-radius: var(--radius-medium);\n padding: var(--spacing-1_5);\n align-items: center;\n overflow-x: auto;\n position: sticky;\n top: 0;\n background-color: var(--baseBg);\n width: inherit;\n\n & div[role='separator'] {\n margin: var(--spacing-2) var(--spacing-1);\n border-left: 1px solid var(--baseBorder);\n border-right: 1px solid var(--baseBase);\n height: var(--spacing-4);\n }\n\n & svg {\n color: var(--baseTextContrast);\n display: block;\n }\n}\n\n.ui-module_readOnlyToolbarRoot_zZzZ0 {\n pointer-events: none;\n background: var(--baseBase);\n\n & > div {\n opacity: 0.5;\n }\n}\n\n.ui-module_toolbarModeSwitch_TiGNq {\n opacity: 1 !important;\n margin-left: auto;\n align-self: stretch;\n align-items: stretch;\n display: flex;\n border: 1px solid var(--baseBg);\n border-radius: var(--radius-medium);\n font-size: var(--text-xs);\n\n .ui-module_toolbarToggleItem_2BQQ2 {\n padding-inline-end: var(--spacing-4);\n padding-inline-start: var(--spacing-4);\n\n &:active,\n &[data-state='on'] {\n background-color: var(--baseBorder);\n }\n }\n}\n\n.ui-module_toolbarGroupOfGroups_-7ePU {\n display: flex;\n margin: 0 var(--spacing-1);\n}\n\n.ui-module_toolbarToggleSingleGroup_O8hn8:first-of-type .ui-module_toolbarToggleItem_2BQQ2:only-child,\n.ui-module_toolbarToggleSingleGroup_O8hn8:only-child .ui-module_toolbarToggleItem_2BQQ2:first-child,\n.ui-module_toolbarModeSwitch_TiGNq .ui-module_toolbarToggleItem_2BQQ2:first-child {\n border-top-left-radius: var(--radius-base);\n border-bottom-left-radius: var(--radius-base);\n}\n\n.ui-module_toolbarToggleSingleGroup_O8hn8:last-of-type .ui-module_toolbarToggleItem_2BQQ2:only-child,\n.ui-module_toolbarToggleSingleGroup_O8hn8:only-child .ui-module_toolbarToggleItem_2BQQ2:last-child,\n.ui-module_toolbarModeSwitch_TiGNq .ui-module_toolbarToggleItem_2BQQ2:last-child {\n border-top-right-radius: var(--radius-base);\n border-bottom-right-radius: var(--radius-base);\n}\n\n.ui-module_toolbarToggleItem_2BQQ2,\n.ui-module_toolbarButton_nedIw {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-0_5);\n\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBgActive);\n }\n }\n\n &:active svg {\n transform: translate(1px, 1px);\n }\n\n &[data-state='on'],\n &:active {\n color: var(--baseTextContrast);\n background-color: var(--baseBgActive);\n }\n\n &[data-disabled] {\n pointer-events: none;\n & svg {\n color: var(--baseBorderHover);\n }\n }\n}\n\n.ui-module_toolbarButton_nedIw {\n border-radius: var(--radius-base);\n}\n\n.ui-module_toolbarButton_nedIw + .ui-module_toolbarButton_nedIw {\n margin-left: var(--spacing-1);\n}\n\n.ui-module_activeToolbarButton_TqEHl {\n color: var(--accentText);\n}\n\n.ui-module_toolbarToggleSingleGroup_O8hn8 {\n display: flex;\n align-items: center;\n white-space: nowrap;\n}\n\n.ui-module_toolbarNodeKindSelectContainer_xzct9,\n.ui-module_toolbarButtonDropdownContainer_oweZ4,\n.ui-module_toolbarCodeBlockLanguageSelectContent_qC11c,\n.ui-module_selectContainer_zEOzj {\n filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));\n z-index: 3;\n width: var(--spacing-36);\n border-bottom-left-radius: var(--radius-base);\n border-bottom-right-radius: var(--radius-base);\n background-color: var(--basePageBg);\n font-size: var(--text-sm);\n}\n\n.ui-module_toolbarButtonDropdownContainer_oweZ4 {\n border-top-right-radius: var(--radius-base);\n\n & .ui-module_selectItem_-0ITo:first-child {\n border-top-right-radius: var(--radius-base);\n }\n}\n\n.ui-module_toolbarNodeKindSelectTrigger_NhAa4,\n.ui-module_toolbarButtonSelectTrigger_qc9aS,\n.ui-module_selectTrigger_QvY-l {\n border: 0;\n background-color: transparent;\n display: flex;\n color: inherit;\n align-items: center;\n width: var(--spacing-36);\n padding: var(--spacing-0_5) var(--spacing-1);\n padding-inline-start: var(--spacing-2);\n border-radius: var(--radius-medium);\n white-space: nowrap;\n flex-wrap: nowrap;\n font-size: var(--text-sm);\n background-color: var(--basePageBg);\n margin: 0 var(--spacing-1);\n\n &[data-state='open'] {\n filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));\n border-bottom-right-radius: var(--radius-none);\n border-bottom-left-radius: var(--radius-none);\n }\n}\n\n.ui-module_selectTrigger_QvY-l[data-placeholder] > span:first-child {\n color: var(--baseBorderHover);\n}\n\n/** used in the sandpack */\n\n.ui-module_toolbarButtonSelectTrigger_qc9aS {\n width: auto;\n padding-inline-start: var(--spacing-2);\n padding-inline-end: var(--spacing-1);\n padding-block: var(--spacing-0_5);\n}\n\n.ui-module_toolbarCodeBlockLanguageSelectTrigger_zqKns,\n.ui-module_toolbarCodeBlockLanguageSelectContent_qC11c {\n width: var(--spacing-48);\n}\n\n.ui-module_toolbarNodeKindSelectItem_EL2xh,\n.ui-module_selectItem_-0ITo {\n cursor: default;\n display: flex;\n padding: var(--spacing-2);\n\n &[data-highlighted] {\n background-color: var(--baseBg);\n }\n\n &[data-state='checked'] {\n color: var(--baseTextContrast);\n background-color: var(--baseBg);\n }\n\n &[data-highlighted] {\n outline: none;\n }\n\n &:last-child {\n border-bottom-left-radius: var(--radius-base);\n border-bottom-right-radius: var(--radius-base);\n }\n}\n\n.ui-module_toolbarNodeKindSelectDropdownArrow_zdl-w,\n.ui-module_selectDropdownArrow_9sZWz {\n margin-left: auto;\n display: flex;\n align-items: center;\n}\n\n.ui-module_contentEditable_Neszj {\n box-sizing: border-box;\n width: 100%;\n color: var(--baseTextContrast);\n\n &:focus {\n outline: none;\n }\n\n padding: var(--spacing-3);\n}\n\n.ui-module_codeMirrorWrapper_WzR1U {\n margin-bottom: var(--spacing-5);\n border: 1px solid var(--baseLine);\n border-radius: var(--radius-medium);\n overflow: hidden;\n padding: 0.8rem;\n position: relative;\n}\n\n.ui-module_sandPackWrapper_NEHwo {\n margin-bottom: var(--spacing-5);\n border: 1px solid var(--baseLine);\n border-radius: var(--radius-medium);\n overflow: hidden;\n position: relative;\n}\n\n.ui-module_codeMirrorToolbar_4LDML {\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n gap: var(--spacing-1);\n padding: var(--spacing-1);\n z-index: 1;\n background-color: var(--baseBase);\n border-bottom-left-radius: var(--radius-base);\n}\n\n.ui-module_frontmatterWrapper_yywSY {\n border-radius: var(--radius-medium);\n padding: var(--spacing-3);\n background-color: var(--baseBgSubtle);\n\n &[data-expanded='true'] {\n margin-bottom: var(--spacing-10);\n }\n}\n\n.ui-module_frontmatterToggleButton_7ZBOE {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n display: flex;\n align-items: center;\n gap: var(--spacing-1);\n font-size: var(--text-sm);\n}\n\n.ui-module_propertyPanelTitle_wudSB {\n font-size: var(--text-xs);\n font-weight: 400;\n margin: 0;\n padding-top: var(--spacing-2);\n padding-left: var(--spacing-2);\n}\n\n.ui-module_propertyEditorTable_fYpKY {\n table-layout: fixed;\n border-spacing: var(--spacing-2);\n\n & th {\n text-align: left;\n font-size: var(--text-sm);\n padding: var(--spacing-2) var(--spacing-3);\n }\n\n & col:nth-child(1) {\n width: 30%;\n }\n\n & col:nth-child(2) {\n width: 70%;\n }\n\n & td:last-child .ui-module_iconButton_b94iY {\n margin-left: var(--spacing-4);\n margin-right: var(--spacing-4);\n }\n\n & .ui-module_readOnlyColumnCell_tCgPb {\n padding-left: 0;\n }\n}\n\n.ui-module_propertyEditorLabelCell_Z2hv7 {\n font-weight: 400;\n}\n\n.ui-module_readOnlyColumnCell_tCgPb {\n padding-left: 0;\n}\n\n.ui-module_buttonsFooter_Juqi3 {\n display: flex;\n justify-content: flex-end;\n gap: var(--spacing-2);\n}\n\n.ui-module_propertyEditorInput_PXpSX {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n width: 100%;\n padding: var(--spacing-2) var(--spacing-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--baseBorder);\n background-color: var(--baseBase);\n font-size: var(--text-sm);\n}\n\n.ui-module_iconButton_b94iY {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n color: var(--baseText);\n\n @media (hover: hover) {\n &:hover {\n color: var(--baseTextContrast);\n }\n }\n\n &:disabled,\n &:disabled:hover {\n color: var(--baseLine);\n }\n}\n\n.ui-module_primaryButton_SztyP,\n.ui-module_secondaryButton_9rAaf {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-2) var(--spacing-3);\n border: 1px solid var(--accentBorder);\n background-color: var(--accentSolidHover);\n color: var(--baseBase);\n font-size: var(--text-xs);\n border-radius: var(--radius-medium);\n\n &:disabled {\n background: var(--accentLine);\n border-color: var(--accentBg);\n }\n}\n\n.ui-module_smallButton_ME9Rg {\n font-size: var(--text-xs);\n padding: var(--spacing-1) var(--spacing-2);\n border-radius: var(--radius-base);\n}\n\n.ui-module_secondaryButton_9rAaf {\n border: 1px solid var(--baseBorder);\n background-color: var(--baseSolidHover);\n color: var(--baseBase);\n}\n\n.ui-module_dialogForm_fym3H {\n display: flex;\n flex-direction: row;\n gap: var(--spacing-2);\n}\n\n.ui-module_linkDialogEditForm_Qc-E2 {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: var(--spacing-2);\n padding: 0;\n}\n\n.ui-module_linkDialogInputContainer_UMMwL {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n.ui-module_linkDialogInputWrapper_aWNFC {\n display: flex;\n align-items: center;\n background-color: var(--baseBase);\n\n border-radius: var(--radius-base);\n border: 1px solid var(--baseBorder);\n\n &[data-visible-dropdown='true'] {\n border-bottom-left-radius: var(--radius-none);\n border-bottom-right-radius: var(--radius-none);\n border-bottom-width: 0;\n }\n\n & > button {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding-right: var(--spacing-2);\n }\n}\n\n.ui-module_linkDialogInput_wW3Qq,\n.ui-module_dialogInput_0XU4W {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n width: 20rem;\n padding: var(--spacing-2) var(--spacing-3);\n font-size: var(--text-sm);\n\n &::placeholder {\n color: var(--baseBorder);\n }\n}\n\n.ui-module_linkDialogAnchor_UVham {\n position: fixed;\n background-color: highlight;\n z-index: -1;\n\n &[data-visible='true'] {\n visibility: visible;\n }\n\n &[data-visible='false'] {\n visibility: hidden;\n }\n}\n\n.ui-module_linkDialogPopoverContent_-aAXR,\n.ui-module_tableColumnEditorPopoverContent_qiZ8k,\n.ui-module_dialogContent_IRmgH {\n filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));\n display: flex;\n align-items: center;\n gap: var(--spacing-0_5);\n border-radius: var(--radius-medium);\n border: 1px solid var(--baseBg);\n background-color: var(--basePageBg);\n padding: var(--spacing-1) var(--spacing-1);\n font-size: var(--text-sm);\n}\n\n.ui-module_largeDialogContent_GvvAH {\n filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));\n gap: var(--spacing-0_5);\n border-radius: var(--radius-medium);\n border: 1px solid var(--baseBorder);\n background-color: var(--baseBgSubtle);\n padding: var(--spacing-4);\n font-size: var(--text-sm);\n}\n\n.ui-module_dialogTitle_XDJ1h {\n font-size: var(--text-base);\n font-weight: 600;\n padding-left: var(--spacing-2);\n}\n\n.ui-module_dialogCloseButton_P-p41 {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n position: absolute;\n top: 10px;\n right: 10px;\n}\n\n.ui-module_popoverContent_mouz8 {\n filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.2));\n display: flex;\n align-items: center;\n gap: var(--spacing-0_5);\n border-radius: var(--radius-medium);\n background-color: var(--baseBgSubtle);\n padding: var(--spacing-2) var(--spacing-2);\n font-size: var(--text-sm);\n z-index: 1;\n}\n\n.ui-module_popoverArrow_Mq8HP {\n fill: var(--basePageBg);\n}\n\n.ui-module_linkDialogPreviewAnchor_orTS8 {\n margin-right: var(--spacing-1);\n display: flex;\n align-items: center;\n color: var(--accentText);\n text-decoration: none;\n\n @media (hover: hover) {\n &:hover {\n color: var(--accentSolidHover);\n }\n }\n\n border: 1px solid transparent;\n\n & span {\n max-width: 14rem;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n\n.ui-module_tooltipTrigger_uoOTp {\n align-self: center;\n}\n\n.ui-module_tooltipContent_GpCAE {\n z-index: 2;\n position: relative;\n border-radius: var(--radius-medium);\n padding: var(--spacing-1) var(--spacing-2);\n font-size: var(--text-xs);\n background-color: var(--baseText);\n color: var(--baseBase);\n\n & svg {\n fill: var(--baseText);\n }\n}\n\n.ui-module_actionButton_miZ0c {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-1);\n color: var(--baseTextContrast);\n & svg {\n display: block;\n }\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBg);\n }\n }\n &:active svg {\n transform: translate(1px, 1px);\n }\n &[data-state='on'],\n &:active {\n background-color: var(--baseBg);\n color: var(--baseTextContrast);\n }\n padding: var(--spacing-1) var(--spacing-1);\n border-radius: var(--radius-medium);\n color: var(--baseTextContrast);\n}\n\n.ui-module_primaryActionButton_tWgQF {\n background-color: var(--accentSolid);\n color: var(--baseBase);\n\n @media (hover: hover) {\n &:hover {\n background-color: var(--accentSolidHover);\n color: var(--baseBase);\n }\n }\n}\n\n.ui-module_tableEditor_Bz6zN {\n table-layout: fixed;\n width: 100%;\n height: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n & thead > tr > th {\n text-align: right;\n }\n\n & > tbody > tr > td:not(.ui-module_toolCell_0AstW),\n & > tbody > tr > th:not(.ui-module_toolCell_0AstW):not([data-tool-cell='true']) {\n border: 1px solid var(--baseBgActive);\n padding: var(--spacing-1) var(--spacing-2);\n white-space: normal;\n\n & > div {\n outline: none;\n\n & > p {\n margin: 0;\n }\n }\n\n &[data-active='true'] {\n outline: solid 1px var(--baseSolid);\n }\n }\n\n .ui-module_tableColumnEditorTrigger_pxT4B,\n .ui-module_tableRowEditorTrigger_Fnk5y,\n .ui-module_addRowButton_OnB8h,\n .ui-module_addColumnButton_i7qS0,\n .ui-module_iconButton_b94iY {\n opacity: 0.15;\n }\n\n @media (hover: hover) {\n &:hover {\n .ui-module_tableColumnEditorTrigger_pxT4B,\n .ui-module_tableRowEditorTrigger_Fnk5y,\n .ui-module_addRowButton_OnB8h,\n .ui-module_addColumnButton_i7qS0,\n .ui-module_iconButton_b94iY {\n opacity: 0.3;\n\n &:hover {\n opacity: 1;\n }\n }\n }\n }\n}\n\n.ui-module_toolCell_0AstW {\n text-align: right;\n\n & button {\n margin: auto;\n display: block;\n }\n}\n\n.ui-module_tableColumnEditorTrigger_pxT4B {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-1);\n color: var(--baseTextContrast);\n & svg {\n display: block;\n }\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBg);\n }\n }\n &:active svg {\n transform: translate(1px, 1px);\n }\n &[data-state='on'],\n &:active {\n background-color: var(--baseBg);\n color: var(--baseTextContrast);\n }\n padding: var(--spacing-1);\n border-radius: var(--radius-full);\n opacity: 0.2;\n\n &[data-active='true'] {\n opacity: 1 !important;\n }\n}\n\n.ui-module_tableColumnEditorToolbar_h5qAi {\n display: flex;\n\n & > button {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-1);\n color: var(--baseTextContrast);\n & svg {\n display: block;\n }\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBg);\n }\n }\n &:active svg {\n transform: translate(1px, 1px);\n }\n &[data-state='on'],\n &:active {\n background-color: var(--baseBg);\n color: var(--baseTextContrast);\n }\n }\n\n & [role='separator'] {\n margin-left: var(--spacing-1);\n margin-right: var(--spacing-1);\n }\n}\n\n.ui-module_toggleGroupRoot_09l0I {\n display: inline-flex;\n\n & button {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-1);\n color: var(--baseTextContrast);\n & svg {\n display: block;\n }\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBg);\n }\n }\n &:active svg {\n transform: translate(1px, 1px);\n }\n &[data-state='on'],\n &:active {\n background-color: var(--baseBg);\n color: var(--baseTextContrast);\n }\n\n &:first-child {\n border-top-left-radius: var(--radius-base);\n border-bottom-left-radius: var(--radius-base);\n }\n\n &:last-child {\n border-top-right-radius: var(--radius-base);\n border-bottom-right-radius: var(--radius-base);\n }\n }\n}\n\n.ui-module_tableToolsColumn_OeGBn {\n width: 2rem;\n\n & button {\n margin: auto;\n display: block;\n }\n}\n\n.ui-module_leftAlignedCell_AOE-0 {\n text-align: left;\n}\n\n.ui-module_rightAlignedCell_VeNXT {\n text-align: right;\n}\n\n.ui-module_centeredCell_6nOM2 {\n text-align: center;\n}\n\n.ui-module_addColumnButton_i7qS0,\n.ui-module_addRowButton_OnB8h {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding: var(--spacing-1);\n color: var(--baseTextContrast);\n & svg {\n display: block;\n }\n @media (hover: hover) {\n &:hover {\n background-color: var(--baseBg);\n }\n }\n &:active svg {\n transform: translate(1px, 1px);\n }\n &[data-state='on'],\n &:active {\n background-color: var(--baseBg);\n color: var(--baseTextContrast);\n }\n background-color: var(--baseBase);\n\n & svg {\n margin: auto;\n }\n\n display: flex;\n align-items: center;\n}\n\n.ui-module_addRowButton_OnB8h {\n width: 100%;\n margin-top: var(--spacing-px);\n box-sizing: border-box;\n border-bottom-right-radius: var(--radius-medium);\n border-bottom-left-radius: var(--radius-medium);\n}\n\n.ui-module_addColumnButton_i7qS0 {\n margin-left: var(--spacing-px);\n height: 100%;\n border-top-right-radius: var(--radius-medium);\n border-bottom-right-radius: var(--radius-medium);\n}\n\n/** Dialog */\n\n.ui-module_dialogOverlay_UNZ-- {\n position: fixed;\n inset: 0;\n animation: ui-module_overlayShow_l5JqT 150ms cubic-bezier(0.16, 1, 0.3, 1);\n background-color: var(--baseBase);\n z-index: 51;\n opacity: 0.5;\n}\n\n.ui-module_dialogContent_IRmgH,\n.ui-module_largeDialogContent_GvvAH {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n animation: ui-module_contentShow_1UlWE 150ms cubic-bezier(0.16, 1, 0.3, 1);\n z-index: 52;\n}\n\n.ui-module_dialogContent_IRmgH:focus,\n.ui-module_largeDialogContent_GvvAH:focus {\n outline: none;\n}\n\n@keyframes ui-module_overlayShow_l5JqT {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 0.5;\n }\n}\n\n@keyframes ui-module_contentShow_1UlWE {\n from {\n opacity: 0;\n transform: translate(-50%, -48%) scale(0.96);\n }\n\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ui-module_focusedImage_-XGsD {\n outline: highlight solid 2px;\n}\n\n.ui-module_imageWrapper_asuzE {\n display: inline-block;\n position: relative;\n}\n\n.ui-module_imageWrapper_asuzE[draggable='true'] {\n cursor: move;\n /* fallback if grab cursor is unsupported */\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n.ui-module_editImageToolbar_kLkPH {\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n gap: var(--spacing-1);\n padding: var(--spacing-1);\n z-index: 1;\n background-color: var(--baseBase);\n border-bottom-left-radius: var(--radius-base);\n}\n\n.ui-module_editImageButton_HwGdI {\n & svg {\n display: block;\n }\n}\n\n.ui-module_inlineEditor_chmlT {\n display: inline-flex;\n border-radius: var(--radius-medium);\n padding: var(--spacing-1);\n gap: var(--spacing-2);\n align-items: center;\n background: var(--baseBg);\n}\n\n.ui-module_blockEditor_hqEug {\n display: flex;\n justify-content: stretch;\n border-radius: var(--radius-medium);\n padding: var(--spacing-2);\n gap: var(--spacing-2);\n align-items: center;\n background: var(--baseBg);\n\n & .ui-module_nestedEditor_SnebQ {\n flex-grow: 1;\n }\n}\n\n.ui-module_nestedEditor_SnebQ {\n background: var(--basePageBg);\n padding: var(--spacing-1) var(--spacing-2);\n border-radius: var(--radius-medium);\n\n & > p {\n margin: 0;\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.ui-module_genericComponentName_7NrVP {\n font-size: var(--text-sm);\n color: var(--baseText);\n padding-right: var(--spacing-2);\n}\n\n.ui-module_diffSourceToggleWrapper_OKN4p {\n margin-left: auto;\n pointer-events: auto;\n opacity: 1;\n position: sticky;\n right: 0;\n}\n\n.ui-module_ggDiffSourceToggle_kEzrx {\n}\n\n.ui-module_diffSourceToggle_b80Me {\n border-radius: var(--radius-medium);\n background-color: var(--baseBase);\n display: flex;\n\n .ui-module_toolbarToggleItem_2BQQ2 {\n padding: 0;\n\n & > span {\n display: block;\n padding: var(--spacing-1) var(--spacing-1);\n }\n }\n}\n\n.ui-module_selectWithLabel_ghMtH {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n margin-left: var(--spacing-2);\n\n & > label {\n font-size: var(--text-sm);\n }\n\n .ui-module_selectTrigger_QvY-l {\n border: 1px solid var(--baseBorder);\n }\n}\n\n.ui-module_toolbarTitleMode_m5TQr {\n font-size: var(--text-sm);\n margin-left: var(--spacing-2);\n}\n\n.ui-module_imageControlWrapperResizing_CaK3A {\n touch-action: none;\n}\n\n.ui-module_imageResizer_kLRMX {\n display: block;\n width: 7px;\n height: 7px;\n position: absolute;\n background-color: var(--accentText);\n border: 1px solid var(--baseBg);\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerN_EbaZ- {\n top: -6px;\n left: 48%;\n cursor: n-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerNe_omQKd {\n top: -6px;\n right: -6px;\n cursor: ne-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerE_PbuNB {\n bottom: 48%;\n right: -6px;\n cursor: e-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerSe_3JFP9 {\n bottom: -2px;\n right: -6px;\n cursor: nwse-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerS_jL4ed {\n bottom: -2px;\n left: 48%;\n cursor: s-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerSw_Ylpu9 {\n bottom: -2px;\n left: -6px;\n cursor: sw-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerW_Qq-qg {\n bottom: 48%;\n left: -6px;\n cursor: w-resize;\n}\n\n.ui-module_imageResizer_kLRMX.ui-module_imageResizerNw_DsHzu {\n top: -6px;\n left: -6px;\n cursor: nw-resize;\n}\n\n.ui-module_imagePlaceholder_334Il {\n border: 2px dashed;\n padding: 48px;\n margin: 12px;\n width: fit-content;\n height: fit-content;\n}\n\n.ui-module_imageDimensionsContainer_Z1mie {\n display: flex;\n gap: var(--spacing-4);\n}\n\n.ui-module_placeholder_SFgVt {\n color: var(--baseSolid);\n overflow: hidden;\n position: absolute;\n top: 0;\n padding: var(--spacing-3);\n text-overflow: ellipsis;\n user-select: none;\n white-space: nowrap;\n display: inline-block;\n pointer-events: none;\n}\n\n.ui-module_rootContentEditableWrapper_dJxz1 {\n position: relative;\n}\n\n.ui-module_downshiftContainer_DQwPw {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n.ui-module_downshiftInputWrapper_nTVWG {\n display: flex;\n align-items: center;\n background-color: var(--baseBase);\n\n border-radius: var(--radius-base);\n border: 1px solid var(--baseBorder);\n\n &[data-visible-dropdown='true'] {\n border-bottom-left-radius: var(--radius-none);\n border-bottom-right-radius: var(--radius-none);\n border-bottom-width: 0;\n }\n\n & > button {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n padding-right: var(--spacing-2);\n }\n}\n\n.ui-module_downshiftInput_gwUym {\n border: 0;\n background-color: transparent;\n font-size: inherit;\n appearance: none;\n all: unset;\n box-sizing: border-box;\n cursor: default;\n width: 20rem;\n padding: var(--spacing-2) var(--spacing-3);\n font-size: var(--text-sm);\n\n &::placeholder {\n color: var(--baseBorder);\n }\n}\n\n.ui-module_downshiftAutocompleteContainer_4py0Z {\n position: relative;\n\n & ul {\n all: unset;\n box-sizing: border-box;\n position: absolute;\n font-size: var(--text-sm);\n width: 100%;\n display: none;\n border-bottom-left-radius: var(--radius-medium);\n border-bottom-right-radius: var(--radius-medium);\n max-height: var(--spacing-48);\n overflow-x: hidden;\n overflow-y: auto;\n border: 1px solid var(--baseBorder);\n border-top-width: 0;\n background-color: var(--baseBase);\n\n &[data-visible='true'] {\n display: block;\n }\n\n & li {\n padding: var(--spacing-2) var(--spacing-3);\n white-space: nowrap;\n margin-bottom: var(--spacing-1);\n overflow-x: hidden;\n text-overflow: ellipsis;\n\n &[data-selected='true'] {\n background-color: var(--baseBgSubtle);\n }\n\n &[data-highlighted='true'] {\n background-color: var(--baseBgHover);\n }\n\n &:last-of-type {\n border-bottom-left-radius: var(--radius-medium);\n border-bottom-right-radius: var(--radius-medium);\n }\n }\n }\n}\n\n.ui-module_textInput_WkP9R {\n all: unset;\n border-radius: var(--radius-base);\n border: 1px solid var(--baseBorder);\n background-color: var(--baseBase);\n padding: var(--spacing-2) var(--spacing-3);\n}\n\nform.ui-module_multiFieldForm_81Blh {\n display: flex;\n flex-direction: column;\n padding: var(--spacing-2);\n gap: var(--spacing-2);\n\n .ui-module_formField_YL3zT {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-2);\n\n & label {\n font-size: var(--text-xs);\n }\n }\n}\n\n.ui-module_markdownParseError_24XbG {\n border-radius: var(--radius-base);\n border: 1px solid var(--error-color);\n padding: var(--spacing-2);\n margin-block: var(--spacing-2);\n color: var(--error-color);\n font-size: var(--text-xs);\n}\n\n.ui-module_popupContainer_c-ODE {\n position: relative;\n z-index: 2;\n}\n\n.ui-module_inputSizer_XK71G {\n display: inline-grid;\n vertical-align: baseline;\n align-items: center;\n position: relative;\n\n &::after,\n & input {\n width: auto;\n min-width: 1rem;\n grid-area: 1 / 2;\n font: inherit;\n margin: 0;\n padding: 0 2px;\n resize: none;\n background: none;\n appearance: none;\n border: none;\n color: inherit;\n }\n\n span {\n padding: 0.25em;\n }\n\n &::after {\n content: attr(data-value);\n white-space: pre-wrap;\n }\n}\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --blue-1: #fbfdff;\n --blue-2: #f4faff;\n --blue-3: #e6f4fe;\n --blue-4: #d5efff;\n --blue-5: #c2e5ff;\n --blue-6: #acd8fc;\n --blue-7: #8ec8f6;\n --blue-8: #5eb1ef;\n --blue-9: #0090ff;\n --blue-10: #0588f0;\n --blue-11: #0d74ce;\n --blue-12: #113264;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --blue-1: color(display-p3 0.986 0.992 0.999);\n --blue-2: color(display-p3 0.96 0.979 0.998);\n --blue-3: color(display-p3 0.912 0.956 0.991);\n --blue-4: color(display-p3 0.853 0.932 1);\n --blue-5: color(display-p3 0.788 0.894 0.998);\n --blue-6: color(display-p3 0.709 0.843 0.976);\n --blue-7: color(display-p3 0.606 0.777 0.947);\n --blue-8: color(display-p3 0.451 0.688 0.917);\n --blue-9: color(display-p3 0.247 0.556 0.969);\n --blue-10: color(display-p3 0.234 0.523 0.912);\n --blue-11: color(display-p3 0.15 0.44 0.84);\n --blue-12: color(display-p3 0.102 0.193 0.379);\n }\n }\n}\n\n.lexical-theme-module_dark_ALXQz, .lexical-theme-module_dark-theme_ZjZQK {\n --blue-1: #0d1520;\n --blue-2: #111927;\n --blue-3: #0d2847;\n --blue-4: #003362;\n --blue-5: #004074;\n --blue-6: #104d87;\n --blue-7: #205d9e;\n --blue-8: #2870bd;\n --blue-9: #0090ff;\n --blue-10: #3b9eff;\n --blue-11: #70b8ff;\n --blue-12: #c2e6ff;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n .lexical-theme-module_dark_ALXQz, .lexical-theme-module_dark-theme_ZjZQK {\n --blue-1: color(display-p3 0.057 0.081 0.122);\n --blue-2: color(display-p3 0.072 0.098 0.147);\n --blue-3: color(display-p3 0.078 0.154 0.27);\n --blue-4: color(display-p3 0.033 0.197 0.37);\n --blue-5: color(display-p3 0.08 0.245 0.441);\n --blue-6: color(display-p3 0.14 0.298 0.511);\n --blue-7: color(display-p3 0.195 0.361 0.6);\n --blue-8: color(display-p3 0.239 0.434 0.72);\n --blue-9: color(display-p3 0.247 0.556 0.969);\n --blue-10: color(display-p3 0.344 0.612 0.973);\n --blue-11: color(display-p3 0.49 0.72 1);\n --blue-12: color(display-p3 0.788 0.898 0.99);\n }\n }\n}\n\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --slate-1: #fcfcfd;\n --slate-2: #f9f9fb;\n --slate-3: #f0f0f3;\n --slate-4: #e8e8ec;\n --slate-5: #e0e1e6;\n --slate-6: #d9d9e0;\n --slate-7: #cdced6;\n --slate-8: #b9bbc6;\n --slate-9: #8b8d98;\n --slate-10: #80838d;\n --slate-11: #60646c;\n --slate-12: #1c2024;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --slate-1: color(display-p3 0.988 0.988 0.992);\n --slate-2: color(display-p3 0.976 0.976 0.984);\n --slate-3: color(display-p3 0.94 0.941 0.953);\n --slate-4: color(display-p3 0.908 0.909 0.925);\n --slate-5: color(display-p3 0.88 0.881 0.901);\n --slate-6: color(display-p3 0.85 0.852 0.876);\n --slate-7: color(display-p3 0.805 0.808 0.838);\n --slate-8: color(display-p3 0.727 0.733 0.773);\n --slate-9: color(display-p3 0.547 0.553 0.592);\n --slate-10: color(display-p3 0.503 0.512 0.549);\n --slate-11: color(display-p3 0.379 0.392 0.421);\n --slate-12: color(display-p3 0.113 0.125 0.14);\n }\n }\n}\n\n.lexical-theme-module_dark_ALXQz, .lexical-theme-module_dark-theme_ZjZQK {\n --slate-1: #111113;\n --slate-2: #18191b;\n --slate-3: #212225;\n --slate-4: #272a2d;\n --slate-5: #2e3135;\n --slate-6: #363a3f;\n --slate-7: #43484e;\n --slate-8: #5a6169;\n --slate-9: #696e77;\n --slate-10: #777b84;\n --slate-11: #b0b4ba;\n --slate-12: #edeef0;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n .lexical-theme-module_dark_ALXQz, .lexical-theme-module_dark-theme_ZjZQK {\n --slate-1: color(display-p3 0.067 0.067 0.074);\n --slate-2: color(display-p3 0.095 0.098 0.105);\n --slate-3: color(display-p3 0.13 0.135 0.145);\n --slate-4: color(display-p3 0.156 0.163 0.176);\n --slate-5: color(display-p3 0.183 0.191 0.206);\n --slate-6: color(display-p3 0.215 0.226 0.244);\n --slate-7: color(display-p3 0.265 0.28 0.302);\n --slate-8: color(display-p3 0.357 0.381 0.409);\n --slate-9: color(display-p3 0.415 0.431 0.463);\n --slate-10: color(display-p3 0.469 0.483 0.514);\n --slate-11: color(display-p3 0.692 0.704 0.728);\n --slate-12: color(display-p3 0.93 0.933 0.94);\n }\n }\n}\n\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --grass-1: #fbfefb;\n --grass-2: #f5fbf5;\n --grass-3: #e9f6e9;\n --grass-4: #daf1db;\n --grass-5: #c9e8ca;\n --grass-6: #b2ddb5;\n --grass-7: #94ce9a;\n --grass-8: #65ba74;\n --grass-9: #46a758;\n --grass-10: #3e9b4f;\n --grass-11: #2a7e3b;\n --grass-12: #203c25;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --grass-1: color(display-p3 0.986 0.996 0.985);\n --grass-2: color(display-p3 0.966 0.983 0.964);\n --grass-3: color(display-p3 0.923 0.965 0.917);\n --grass-4: color(display-p3 0.872 0.94 0.865);\n --grass-5: color(display-p3 0.811 0.908 0.802);\n --grass-6: color(display-p3 0.733 0.864 0.724);\n --grass-7: color(display-p3 0.628 0.803 0.622);\n --grass-8: color(display-p3 0.477 0.72 0.482);\n --grass-9: color(display-p3 0.38 0.647 0.378);\n --grass-10: color(display-p3 0.344 0.598 0.342);\n --grass-11: color(display-p3 0.263 0.488 0.261);\n --grass-12: color(display-p3 0.151 0.233 0.153);\n }\n }\n}\n\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --cyan-1: #fafdfe;\n --cyan-2: #f2fafb;\n --cyan-3: #def7f9;\n --cyan-4: #caf1f6;\n --cyan-5: #b5e9f0;\n --cyan-6: #9ddde7;\n --cyan-7: #7dcedc;\n --cyan-8: #3db9cf;\n --cyan-9: #00a2c7;\n --cyan-10: #0797b9;\n --cyan-11: #107d98;\n --cyan-12: #0d3c48;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --cyan-1: color(display-p3 0.982 0.992 0.996);\n --cyan-2: color(display-p3 0.955 0.981 0.984);\n --cyan-3: color(display-p3 0.888 0.965 0.975);\n --cyan-4: color(display-p3 0.821 0.941 0.959);\n --cyan-5: color(display-p3 0.751 0.907 0.935);\n --cyan-6: color(display-p3 0.671 0.862 0.9);\n --cyan-7: color(display-p3 0.564 0.8 0.854);\n --cyan-8: color(display-p3 0.388 0.715 0.798);\n --cyan-9: color(display-p3 0.282 0.627 0.765);\n --cyan-10: color(display-p3 0.264 0.583 0.71);\n --cyan-11: color(display-p3 0.08 0.48 0.63);\n --cyan-12: color(display-p3 0.108 0.232 0.277);\n }\n }\n}\n\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --amber-1: #fefdfb;\n --amber-2: #fefbe9;\n --amber-3: #fff7c2;\n --amber-4: #ffee9c;\n --amber-5: #fbe577;\n --amber-6: #f3d673;\n --amber-7: #e9c162;\n --amber-8: #e2a336;\n --amber-9: #ffc53d;\n --amber-10: #ffba18;\n --amber-11: #ab6400;\n --amber-12: #4f3422;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --amber-1: color(display-p3 0.995 0.992 0.985);\n --amber-2: color(display-p3 0.994 0.986 0.921);\n --amber-3: color(display-p3 0.994 0.969 0.782);\n --amber-4: color(display-p3 0.989 0.937 0.65);\n --amber-5: color(display-p3 0.97 0.902 0.527);\n --amber-6: color(display-p3 0.936 0.844 0.506);\n --amber-7: color(display-p3 0.89 0.762 0.443);\n --amber-8: color(display-p3 0.85 0.65 0.3);\n --amber-9: color(display-p3 1 0.77 0.26);\n --amber-10: color(display-p3 0.959 0.741 0.274);\n --amber-11: color(display-p3 0.64 0.4 0);\n --amber-12: color(display-p3 0.294 0.208 0.145);\n }\n }\n}\n\n:root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --red-1: #fffcfc;\n --red-2: #fff7f7;\n --red-3: #feebec;\n --red-4: #ffdbdc;\n --red-5: #ffcdce;\n --red-6: #fdbdbe;\n --red-7: #f4a9aa;\n --red-8: #eb8e90;\n --red-9: #e5484d;\n --red-10: #dc3e42;\n --red-11: #ce2c31;\n --red-12: #641723;\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n :root, .lexical-theme-module_light_TXmQm, .lexical-theme-module_light-theme_6YE-f {\n --red-1: color(display-p3 0.998 0.989 0.988);\n --red-2: color(display-p3 0.995 0.971 0.971);\n --red-3: color(display-p3 0.985 0.925 0.925);\n --red-4: color(display-p3 0.999 0.866 0.866);\n --red-5: color(display-p3 0.984 0.812 0.811);\n --red-6: color(display-p3 0.955 0.751 0.749);\n --red-7: color(display-p3 0.915 0.675 0.672);\n --red-8: color(display-p3 0.872 0.575 0.572);\n --red-9: color(display-p3 0.83 0.329 0.324);\n --red-10: color(display-p3 0.798 0.294 0.285);\n --red-11: color(display-p3 0.744 0.234 0.222);\n --red-12: color(display-p3 0.36 0.115 0.143);\n }\n }\n}\n\n.lexical-theme-module_bold_aiWbg {\n font-weight: bold;\n}\n\n.lexical-theme-module_italic_fbxIe {\n font-style: italic;\n}\n\n.lexical-theme-module_underline_Fl7gX {\n text-decoration: underline;\n}\n\n.lexical-theme-module_bold_aiWbg {\n font-weight: 700;\n}\n\n.lexical-theme-module_italic_fbxIe {\n font-style: italic;\n}\n\n.lexical-theme-module_underline_Fl7gX {\n text-decoration: underline\n}\n\n.lexical-theme-module_strikethrough_ZPg1J {\n text-decoration: line-through\n}\n\n.lexical-theme-module_underlineStrikethrough_g359y {\n text-decoration: underline line-through\n}\n\n.lexical-theme-module_subscript_hdZ01 {\n font-size: .8em;\n vertical-align: sub !important\n}\n\n.lexical-theme-module_superscript_fotk0 {\n font-size: .8em;\n vertical-align: super\n}\n\n.lexical-theme-module_code_XUTW4 {\n background-color: var(--baseBg);\n padding: 1px .25rem;\n font-family: var(--font-mono);\n font-size: 94%\n}\n\n.lexical-theme-module_nestedListItem_LEP2f {\n list-style: none;\n list-style-type: none;\n}\n\n.lexical-theme-module_nestedListItem_LEP2f:before,\n.lexical-theme-module_nestedListItem_LEP2f:after {\n display: none;\n}\n\n.lexical-theme-module_listitem_5mMAE {\n margin: var(--spacing-2) 0;\n}\n\n.lexical-theme-module_listItemChecked_kISPU,\n.lexical-theme-module_listItemUnchecked_GM3vI {\n position: relative;\n margin-left: 0;\n margin-right: 0;\n margin-inline-start: -1rem;\n padding-left: var(--spacing-6);\n padding-right: var(--spacing-6);\n list-style-type: none;\n outline: none;\n}\n\n.lexical-theme-module_listItemChecked_kISPU {\n text-decoration: line-through;\n}\n\n.lexical-theme-module_listItemUnchecked_GM3vI:before,\n.lexical-theme-module_listItemChecked_kISPU:before {\n content: '';\n width: var(--spacing-4);\n height: var(--spacing-4);\n top: 0;\n left: 0;\n cursor: pointer;\n display: block;\n background-size: cover;\n position: absolute;\n}\n\n.lexical-theme-module_listItemUnchecked_GM3vI[dir='rtl']:before,\n.lexical-theme-module_listItemChecked_kISPU[dir='rtl']:before {\n left: auto;\n right: 0;\n}\n\n.lexical-theme-module_listItemUnchecked_GM3vI:focus:before,\n.lexical-theme-module_listItemChecked_kISPU:focus:before {\n box-shadow: 0 0 0 2px var(--accentBgActive);\n border-radius: var(--radius-small);\n}\n\n.lexical-theme-module_listItemUnchecked_GM3vI:before {\n border: 1px solid var(--baseBorder);\n border-radius: var(--radius-small);\n}\n\n.lexical-theme-module_listItemChecked_kISPU:before {\n border: 1px solid var(--accentBorder);\n border-radius: var(--radius-small);\n background-color: var(--accentSolid);\n background-repeat: no-repeat;\n}\n\n.lexical-theme-module_listItemChecked_kISPU:after {\n content: '';\n cursor: pointer;\n border-color: var(--baseBase);\n border-style: solid;\n position: absolute;\n display: block;\n top: var(--spacing-0_5);\n width: var(--spacing-1);\n left: var(--spacing-1_5);\n right: var(--spacing-1_5);\n height: var(--spacing-2);\n transform: rotate(45deg);\n border-width: 0 var(--spacing-0_5) var(--spacing-0_5) 0;\n}\n\n.lexical-theme-module_nestedListItem_LEP2f {\n list-style-type: none;\n}\n\n.lexical-theme-module_nestedListItem_LEP2f:before,\n.lexical-theme-module_nestedListItem_LEP2f:after {\n display: none;\n}\n\n.lexical-theme-module_admonitionDanger_odODu,\n.lexical-theme-module_admonitionInfo_hhpuA,\n.lexical-theme-module_admonitionNote_ipt6L,\n.lexical-theme-module_admonitionTip_Nso9F,\n.lexical-theme-module_admonitionCaution_SoaPW {\n padding: var(--spacing-2);\n margin-top: var(--spacing-2);\n margin-bottom: var(--spacing-2);\n border-left: 3px solid var(--admonitionBorder);\n background-color: var(--admonitionBg);\n}\n\n.lexical-theme-module_admonitionInfo_hhpuA {\n --admonitionBorder: var(--admonitionInfoBorder);\n --admonitionBg: var(--admonitionInfoBg);\n}\n\n.lexical-theme-module_admonitionTip_Nso9F {\n --admonitionBorder: var(--admonitionTipBorder);\n --admonitionBg: var(--admonitionTipBg);\n}\n\n.lexical-theme-module_admonitionCaution_SoaPW {\n --admonitionBorder: var(--admonitionCautionBorder);\n --admonitionBg: var(--admonitionCautionBg);\n}\n\n.lexical-theme-module_admonitionDanger_odODu {\n --admonitionBorder: var(--admonitionDangerBorder);\n --admonitionBg: var(--admonitionDangerBg);\n}\n\n.lexical-theme-module_admonitionNote_ipt6L {\n --admonitionBorder: var(--admonitionNoteBorder);\n --admonitionBg: var(--admonitionNoteBg);\n}\n\n.lexical-theme-module_mdxExpression_uhhzT {\n font-family: var(--font-mono);\n font-size: 84%;\n color: var(--accentText);\n\n & input:focus-visible {\n outline: none;\n }\n}"));
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, forwardRef, createElement, useState, useRef, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import { ThemedMonacoWithProvider, ThemedMonacoDiffEditor } from "@principal-ade/industry-themed-monaco-editor";
|
|
4
|
+
import { headingsPlugin, listsPlugin, quotePlugin, thematicBreakPlugin, markdownShortcutPlugin, linkPlugin, linkDialogPlugin, imagePlugin, tablePlugin, codeBlockPlugin, codeMirrorPlugin, frontmatterPlugin, diffSourcePlugin, toolbarPlugin, DiffSourceToggleWrapper, UndoRedo, BlockTypeSelect, BoldItalicUnderlineToggles, CodeToggle, CreateLink, InsertImage, InsertTable, InsertThematicBreak, ListsToggle, MDXEditor } from "@principal-ai/mdx-editor";
|
|
5
|
+
import "@principal-ai/mdx-editor/style.css";
|
|
6
|
+
var ThemeContext;
|
|
7
|
+
var getThemeContext = () => {
|
|
8
|
+
if (typeof window !== "undefined") {
|
|
9
|
+
const globalWindow = window;
|
|
10
|
+
if (!globalWindow.__principlemd_theme_context__) {
|
|
11
|
+
globalWindow.__principlemd_theme_context__ = createContext(void 0);
|
|
12
|
+
}
|
|
13
|
+
return globalWindow.__principlemd_theme_context__;
|
|
14
|
+
} else {
|
|
15
|
+
if (!ThemeContext) {
|
|
16
|
+
ThemeContext = createContext(void 0);
|
|
17
|
+
}
|
|
18
|
+
return ThemeContext;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var ThemeContextSingleton = getThemeContext();
|
|
22
|
+
var useTheme = () => {
|
|
23
|
+
const context = useContext(ThemeContextSingleton);
|
|
24
|
+
if (!context) {
|
|
25
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
26
|
+
}
|
|
27
|
+
return context;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @license lucide-react v0.552.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/
|
|
35
|
+
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
36
|
+
const toCamelCase = (string) => string.replace(
|
|
37
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
38
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
39
|
+
);
|
|
40
|
+
const toPascalCase = (string) => {
|
|
41
|
+
const camelCase = toCamelCase(string);
|
|
42
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
43
|
+
};
|
|
44
|
+
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
45
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
46
|
+
}).join(" ").trim();
|
|
47
|
+
const hasA11yProp = (props) => {
|
|
48
|
+
for (const prop in props) {
|
|
49
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* @license lucide-react v0.552.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/
|
|
60
|
+
var defaultAttributes = {
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
62
|
+
width: 24,
|
|
63
|
+
height: 24,
|
|
64
|
+
viewBox: "0 0 24 24",
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: "currentColor",
|
|
67
|
+
strokeWidth: 2,
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @license lucide-react v0.552.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/
|
|
77
|
+
const Icon = forwardRef(
|
|
78
|
+
({
|
|
79
|
+
color = "currentColor",
|
|
80
|
+
size = 24,
|
|
81
|
+
strokeWidth = 2,
|
|
82
|
+
absoluteStrokeWidth,
|
|
83
|
+
className = "",
|
|
84
|
+
children,
|
|
85
|
+
iconNode,
|
|
86
|
+
...rest
|
|
87
|
+
}, ref) => createElement(
|
|
88
|
+
"svg",
|
|
89
|
+
{
|
|
90
|
+
ref,
|
|
91
|
+
...defaultAttributes,
|
|
92
|
+
width: size,
|
|
93
|
+
height: size,
|
|
94
|
+
stroke: color,
|
|
95
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
96
|
+
className: mergeClasses("lucide", className),
|
|
97
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
98
|
+
...rest
|
|
99
|
+
},
|
|
100
|
+
[
|
|
101
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
102
|
+
...Array.isArray(children) ? children : [children]
|
|
103
|
+
]
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
/**
|
|
107
|
+
* @license lucide-react v0.552.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/
|
|
112
|
+
const createLucideIcon = (iconName, iconNode) => {
|
|
113
|
+
const Component = forwardRef(
|
|
114
|
+
({ className, ...props }, ref) => createElement(Icon, {
|
|
115
|
+
ref,
|
|
116
|
+
iconNode,
|
|
117
|
+
className: mergeClasses(
|
|
118
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
119
|
+
`lucide-${iconName}`,
|
|
120
|
+
className
|
|
121
|
+
),
|
|
122
|
+
...props
|
|
123
|
+
})
|
|
124
|
+
);
|
|
125
|
+
Component.displayName = toPascalCase(iconName);
|
|
126
|
+
return Component;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* @license lucide-react v0.552.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/
|
|
134
|
+
const __iconNode$2 = [
|
|
135
|
+
[
|
|
136
|
+
"path",
|
|
137
|
+
{
|
|
138
|
+
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
139
|
+
key: "1oefj6"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
|
|
143
|
+
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
144
|
+
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
145
|
+
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
146
|
+
];
|
|
147
|
+
const FileText = createLucideIcon("file-text", __iconNode$2);
|
|
148
|
+
/**
|
|
149
|
+
* @license lucide-react v0.552.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/
|
|
154
|
+
const __iconNode$1 = [
|
|
155
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
156
|
+
["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
|
|
157
|
+
["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
|
|
158
|
+
];
|
|
159
|
+
const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$1);
|
|
160
|
+
/**
|
|
161
|
+
* @license lucide-react v0.552.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/
|
|
166
|
+
const __iconNode = [
|
|
167
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
168
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
169
|
+
];
|
|
170
|
+
const X = createLucideIcon("x", __iconNode);
|
|
171
|
+
const getLanguage = (path) => {
|
|
172
|
+
var _a;
|
|
173
|
+
const ext = ((_a = path.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
|
|
174
|
+
const languageMap = {
|
|
175
|
+
js: "javascript",
|
|
176
|
+
jsx: "javascript",
|
|
177
|
+
ts: "typescript",
|
|
178
|
+
tsx: "typescript",
|
|
179
|
+
py: "python",
|
|
180
|
+
java: "java",
|
|
181
|
+
c: "c",
|
|
182
|
+
cpp: "cpp",
|
|
183
|
+
cs: "csharp",
|
|
184
|
+
php: "php",
|
|
185
|
+
rb: "ruby",
|
|
186
|
+
go: "go",
|
|
187
|
+
rs: "rust",
|
|
188
|
+
kt: "kotlin",
|
|
189
|
+
swift: "swift",
|
|
190
|
+
json: "json",
|
|
191
|
+
xml: "xml",
|
|
192
|
+
html: "html",
|
|
193
|
+
css: "css",
|
|
194
|
+
scss: "scss",
|
|
195
|
+
sass: "sass",
|
|
196
|
+
less: "less",
|
|
197
|
+
sql: "sql",
|
|
198
|
+
sh: "bash",
|
|
199
|
+
bash: "bash",
|
|
200
|
+
zsh: "bash",
|
|
201
|
+
yaml: "yaml",
|
|
202
|
+
yml: "yaml",
|
|
203
|
+
toml: "toml",
|
|
204
|
+
ini: "ini",
|
|
205
|
+
cfg: "ini",
|
|
206
|
+
conf: "ini",
|
|
207
|
+
md: "markdown",
|
|
208
|
+
mdx: "markdown"
|
|
209
|
+
};
|
|
210
|
+
return languageMap[ext] || "plaintext";
|
|
211
|
+
};
|
|
212
|
+
const FileEditorPanelContent = ({
|
|
213
|
+
context,
|
|
214
|
+
actions: _actions,
|
|
215
|
+
events,
|
|
216
|
+
filePath: filePathProp,
|
|
217
|
+
showCloseButton = true
|
|
218
|
+
}) => {
|
|
219
|
+
var _a, _b, _c;
|
|
220
|
+
const { theme } = useTheme();
|
|
221
|
+
const [filePath, setFilePath] = useState(null);
|
|
222
|
+
const [fileContent, setFileContent] = useState("");
|
|
223
|
+
const [editorContent, setEditorContent] = useState("");
|
|
224
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
225
|
+
const [error, setError] = useState(null);
|
|
226
|
+
const [isDirty, setIsDirty] = useState(false);
|
|
227
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
228
|
+
const [saveError, setSaveError] = useState(null);
|
|
229
|
+
const latestFilePathRef = useRef(null);
|
|
230
|
+
const isSavingRef = useRef(false);
|
|
231
|
+
const isDirtyRef = useRef(false);
|
|
232
|
+
const fileSystem = (_a = context.adapters) == null ? void 0 : _a.fileSystem;
|
|
233
|
+
const isEditable = Boolean(fileSystem == null ? void 0 : fileSystem.writeFile);
|
|
234
|
+
const activeFileSlice = context.getSlice("active-file");
|
|
235
|
+
const preferencesSlice = context.getSlice("preferences");
|
|
236
|
+
const vimMode = ((_b = preferencesSlice == null ? void 0 : preferencesSlice.data) == null ? void 0 : _b.vimMode) ?? false;
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
isDirtyRef.current = isDirty;
|
|
239
|
+
}, [isDirty]);
|
|
240
|
+
useEffect(() => {
|
|
241
|
+
isDirtyRef.current = false;
|
|
242
|
+
setIsDirty(false);
|
|
243
|
+
setIsSaving(false);
|
|
244
|
+
isSavingRef.current = false;
|
|
245
|
+
setSaveError(null);
|
|
246
|
+
}, [filePath]);
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
if (filePathProp) {
|
|
249
|
+
console.log("[FileEditorPanel] Using prop-controlled file path:", filePathProp);
|
|
250
|
+
setFilePath(filePathProp);
|
|
251
|
+
}
|
|
252
|
+
}, [filePathProp]);
|
|
253
|
+
useEffect(() => {
|
|
254
|
+
var _a2;
|
|
255
|
+
if (!filePathProp && ((_a2 = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _a2.path)) {
|
|
256
|
+
setFilePath(activeFileSlice.data.path);
|
|
257
|
+
}
|
|
258
|
+
}, [filePathProp, (_c = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _c.path]);
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
if (filePathProp) {
|
|
261
|
+
return void 0;
|
|
262
|
+
}
|
|
263
|
+
const unsubscribe = events.on("file:open", (event) => {
|
|
264
|
+
const payload = event.payload;
|
|
265
|
+
if (payload == null ? void 0 : payload.path) {
|
|
266
|
+
setFilePath(payload.path);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
return unsubscribe;
|
|
270
|
+
}, [events, filePathProp]);
|
|
271
|
+
const loadFile = useCallback(async () => {
|
|
272
|
+
if (!filePath || !(fileSystem == null ? void 0 : fileSystem.readFile)) {
|
|
273
|
+
latestFilePathRef.current = null;
|
|
274
|
+
setFileContent("");
|
|
275
|
+
setEditorContent("");
|
|
276
|
+
setIsDirty(false);
|
|
277
|
+
setIsSaving(false);
|
|
278
|
+
setSaveError(null);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
latestFilePathRef.current = filePath;
|
|
282
|
+
setIsLoading(true);
|
|
283
|
+
setError(null);
|
|
284
|
+
try {
|
|
285
|
+
const content = await fileSystem.readFile(filePath);
|
|
286
|
+
if (latestFilePathRef.current !== filePath) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (content !== null) {
|
|
290
|
+
setFileContent(content);
|
|
291
|
+
setSaveError(null);
|
|
292
|
+
if (!isDirtyRef.current) {
|
|
293
|
+
setEditorContent(content);
|
|
294
|
+
setIsDirty(false);
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
throw new Error("Failed to read file");
|
|
298
|
+
}
|
|
299
|
+
} catch (err) {
|
|
300
|
+
console.error("Error loading file:", err);
|
|
301
|
+
if (latestFilePathRef.current === filePath) {
|
|
302
|
+
setError(err instanceof Error ? err.message : "Failed to load file");
|
|
303
|
+
setFileContent("");
|
|
304
|
+
}
|
|
305
|
+
} finally {
|
|
306
|
+
if (latestFilePathRef.current === filePath) {
|
|
307
|
+
setIsLoading(false);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}, [filePath, fileSystem]);
|
|
311
|
+
useEffect(() => {
|
|
312
|
+
loadFile();
|
|
313
|
+
}, [loadFile]);
|
|
314
|
+
const handleEditorChange = useCallback(
|
|
315
|
+
(value) => {
|
|
316
|
+
const nextValue = value ?? "";
|
|
317
|
+
setEditorContent(nextValue);
|
|
318
|
+
setIsDirty(nextValue !== fileContent);
|
|
319
|
+
if (saveError) {
|
|
320
|
+
setSaveError(null);
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
[fileContent, saveError]
|
|
324
|
+
);
|
|
325
|
+
const handleEditorSave = useCallback(
|
|
326
|
+
async (value) => {
|
|
327
|
+
if (!filePath || !(fileSystem == null ? void 0 : fileSystem.writeFile)) {
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
const contentToSave = value ?? editorContent;
|
|
331
|
+
if (!isDirty && contentToSave === fileContent) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
isSavingRef.current = true;
|
|
335
|
+
setIsSaving(true);
|
|
336
|
+
setSaveError(null);
|
|
337
|
+
try {
|
|
338
|
+
await fileSystem.writeFile(filePath, contentToSave);
|
|
339
|
+
if (latestFilePathRef.current === filePath) {
|
|
340
|
+
setFileContent(contentToSave);
|
|
341
|
+
setEditorContent(contentToSave);
|
|
342
|
+
setIsDirty(false);
|
|
343
|
+
events.emit({
|
|
344
|
+
type: "file:save",
|
|
345
|
+
source: "industry-theme.file-editor",
|
|
346
|
+
timestamp: Date.now(),
|
|
347
|
+
payload: { path: filePath }
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
} catch (err) {
|
|
351
|
+
if (latestFilePathRef.current === filePath) {
|
|
352
|
+
setSaveError(
|
|
353
|
+
err instanceof Error ? err.message : "Failed to save file"
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
} finally {
|
|
357
|
+
if (latestFilePathRef.current === filePath) {
|
|
358
|
+
setIsSaving(false);
|
|
359
|
+
}
|
|
360
|
+
isSavingRef.current = false;
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
[editorContent, fileContent, filePath, isDirty, fileSystem, events]
|
|
364
|
+
);
|
|
365
|
+
const handleClose = useCallback(() => {
|
|
366
|
+
events.emit({
|
|
367
|
+
type: "file:close",
|
|
368
|
+
source: "industry-theme.file-editor",
|
|
369
|
+
timestamp: Date.now(),
|
|
370
|
+
payload: { path: filePath }
|
|
371
|
+
});
|
|
372
|
+
setFilePath(null);
|
|
373
|
+
}, [events, filePath]);
|
|
374
|
+
const fileName = (filePath == null ? void 0 : filePath.split("/").pop()) || filePath || "";
|
|
375
|
+
const language = filePath ? getLanguage(filePath) : "plaintext";
|
|
376
|
+
if (!filePath) {
|
|
377
|
+
return /* @__PURE__ */ jsxs(
|
|
378
|
+
"div",
|
|
379
|
+
{
|
|
380
|
+
style: {
|
|
381
|
+
height: "100%",
|
|
382
|
+
display: "flex",
|
|
383
|
+
alignItems: "center",
|
|
384
|
+
justifyContent: "center",
|
|
385
|
+
flexDirection: "column",
|
|
386
|
+
color: theme.colors.textSecondary,
|
|
387
|
+
padding: "20px",
|
|
388
|
+
textAlign: "center",
|
|
389
|
+
fontFamily: theme.fonts.body
|
|
390
|
+
},
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ jsx(FileText, { size: 48, style: { marginBottom: "16px", opacity: 0.5 } }),
|
|
393
|
+
/* @__PURE__ */ jsx(
|
|
394
|
+
"div",
|
|
395
|
+
{
|
|
396
|
+
style: {
|
|
397
|
+
fontSize: theme.fontSizes[3],
|
|
398
|
+
fontWeight: 600,
|
|
399
|
+
marginBottom: "12px",
|
|
400
|
+
color: theme.colors.text
|
|
401
|
+
},
|
|
402
|
+
children: "File Editor"
|
|
403
|
+
}
|
|
404
|
+
),
|
|
405
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: theme.fontSizes[1] }, children: "Select a file to view or edit" })
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
return /* @__PURE__ */ jsxs(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
style: {
|
|
414
|
+
height: "100%",
|
|
415
|
+
display: "flex",
|
|
416
|
+
flexDirection: "column",
|
|
417
|
+
backgroundColor: theme.colors.background
|
|
418
|
+
},
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsxs(
|
|
421
|
+
"div",
|
|
422
|
+
{
|
|
423
|
+
style: {
|
|
424
|
+
height: "40px",
|
|
425
|
+
padding: "0 12px",
|
|
426
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
427
|
+
display: "flex",
|
|
428
|
+
alignItems: "center",
|
|
429
|
+
justifyContent: "space-between",
|
|
430
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
431
|
+
fontFamily: theme.fonts.body,
|
|
432
|
+
flexShrink: 0,
|
|
433
|
+
boxSizing: "border-box"
|
|
434
|
+
},
|
|
435
|
+
children: [
|
|
436
|
+
/* @__PURE__ */ jsxs(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
style: {
|
|
440
|
+
display: "flex",
|
|
441
|
+
alignItems: "center",
|
|
442
|
+
gap: "8px",
|
|
443
|
+
flex: 1,
|
|
444
|
+
minWidth: 0
|
|
445
|
+
},
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ jsx(
|
|
448
|
+
FileText,
|
|
449
|
+
{
|
|
450
|
+
size: 16,
|
|
451
|
+
style: { color: theme.colors.primary, flexShrink: 0 }
|
|
452
|
+
}
|
|
453
|
+
),
|
|
454
|
+
/* @__PURE__ */ jsx(
|
|
455
|
+
"div",
|
|
456
|
+
{
|
|
457
|
+
style: {
|
|
458
|
+
fontSize: theme.fontSizes[2],
|
|
459
|
+
fontWeight: 600,
|
|
460
|
+
color: theme.colors.text,
|
|
461
|
+
whiteSpace: "nowrap",
|
|
462
|
+
overflow: "hidden",
|
|
463
|
+
textOverflow: "ellipsis"
|
|
464
|
+
},
|
|
465
|
+
title: filePath,
|
|
466
|
+
children: fileName
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
/* @__PURE__ */ jsxs(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
style: {
|
|
476
|
+
display: "flex",
|
|
477
|
+
alignItems: "center",
|
|
478
|
+
gap: "12px"
|
|
479
|
+
},
|
|
480
|
+
children: [
|
|
481
|
+
isEditable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
482
|
+
saveError ? /* @__PURE__ */ jsxs(
|
|
483
|
+
"span",
|
|
484
|
+
{
|
|
485
|
+
style: {
|
|
486
|
+
color: theme.colors.error,
|
|
487
|
+
fontSize: theme.fontSizes[0]
|
|
488
|
+
},
|
|
489
|
+
children: [
|
|
490
|
+
"Save failed: ",
|
|
491
|
+
saveError
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
) : isSaving ? /* @__PURE__ */ jsx(
|
|
495
|
+
"span",
|
|
496
|
+
{
|
|
497
|
+
style: {
|
|
498
|
+
color: theme.colors.textSecondary,
|
|
499
|
+
fontSize: theme.fontSizes[0]
|
|
500
|
+
},
|
|
501
|
+
children: "Saving..."
|
|
502
|
+
}
|
|
503
|
+
) : isDirty ? /* @__PURE__ */ jsx(
|
|
504
|
+
"span",
|
|
505
|
+
{
|
|
506
|
+
style: {
|
|
507
|
+
color: theme.colors.primary,
|
|
508
|
+
fontSize: theme.fontSizes[0]
|
|
509
|
+
},
|
|
510
|
+
children: "Unsaved changes"
|
|
511
|
+
}
|
|
512
|
+
) : /* @__PURE__ */ jsx(
|
|
513
|
+
"span",
|
|
514
|
+
{
|
|
515
|
+
style: {
|
|
516
|
+
color: theme.colors.textSecondary,
|
|
517
|
+
fontSize: theme.fontSizes[0]
|
|
518
|
+
},
|
|
519
|
+
children: "Saved"
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ jsx(
|
|
523
|
+
"button",
|
|
524
|
+
{
|
|
525
|
+
onClick: () => void handleEditorSave(),
|
|
526
|
+
disabled: !isDirty || isSaving,
|
|
527
|
+
style: {
|
|
528
|
+
backgroundColor: theme.colors.primary,
|
|
529
|
+
color: theme.colors.background,
|
|
530
|
+
border: "none",
|
|
531
|
+
borderRadius: "4px",
|
|
532
|
+
padding: "6px 10px",
|
|
533
|
+
fontSize: theme.fontSizes[0],
|
|
534
|
+
cursor: !isDirty || isSaving ? "not-allowed" : "pointer",
|
|
535
|
+
opacity: !isDirty || isSaving ? 0.6 : 1,
|
|
536
|
+
transition: "opacity 0.2s ease"
|
|
537
|
+
},
|
|
538
|
+
children: "Save"
|
|
539
|
+
}
|
|
540
|
+
)
|
|
541
|
+
] }),
|
|
542
|
+
filePath && showCloseButton && /* @__PURE__ */ jsx(
|
|
543
|
+
"button",
|
|
544
|
+
{
|
|
545
|
+
onClick: handleClose,
|
|
546
|
+
style: {
|
|
547
|
+
background: "none",
|
|
548
|
+
border: "none",
|
|
549
|
+
padding: "4px",
|
|
550
|
+
cursor: "pointer",
|
|
551
|
+
color: theme.colors.textSecondary,
|
|
552
|
+
display: "flex",
|
|
553
|
+
alignItems: "center",
|
|
554
|
+
justifyContent: "center",
|
|
555
|
+
borderRadius: "4px",
|
|
556
|
+
transition: "background-color 0.2s"
|
|
557
|
+
},
|
|
558
|
+
onMouseEnter: (e) => {
|
|
559
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundSecondary;
|
|
560
|
+
},
|
|
561
|
+
onMouseLeave: (e) => {
|
|
562
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
563
|
+
},
|
|
564
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
]
|
|
568
|
+
}
|
|
569
|
+
)
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0 }, children: isLoading ? /* @__PURE__ */ jsx(
|
|
574
|
+
"div",
|
|
575
|
+
{
|
|
576
|
+
style: {
|
|
577
|
+
height: "100%",
|
|
578
|
+
display: "flex",
|
|
579
|
+
alignItems: "center",
|
|
580
|
+
justifyContent: "center",
|
|
581
|
+
color: theme.colors.textSecondary,
|
|
582
|
+
fontFamily: theme.fonts.body
|
|
583
|
+
},
|
|
584
|
+
children: "Loading file..."
|
|
585
|
+
}
|
|
586
|
+
) : error ? /* @__PURE__ */ jsxs(
|
|
587
|
+
"div",
|
|
588
|
+
{
|
|
589
|
+
style: {
|
|
590
|
+
height: "100%",
|
|
591
|
+
display: "flex",
|
|
592
|
+
alignItems: "center",
|
|
593
|
+
justifyContent: "center",
|
|
594
|
+
color: theme.colors.error,
|
|
595
|
+
padding: "20px",
|
|
596
|
+
textAlign: "center",
|
|
597
|
+
fontFamily: theme.fonts.body
|
|
598
|
+
},
|
|
599
|
+
children: [
|
|
600
|
+
"Error: ",
|
|
601
|
+
error
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
) : /* @__PURE__ */ jsx(
|
|
605
|
+
ThemedMonacoWithProvider,
|
|
606
|
+
{
|
|
607
|
+
value: editorContent,
|
|
608
|
+
language,
|
|
609
|
+
vimMode: isEditable ? vimMode : false,
|
|
610
|
+
options: {
|
|
611
|
+
readOnly: !isEditable,
|
|
612
|
+
minimap: { enabled: false },
|
|
613
|
+
lineNumbers: "on",
|
|
614
|
+
scrollBeyondLastLine: false,
|
|
615
|
+
wordWrap: "on",
|
|
616
|
+
fontSize: theme.fontSizes[2],
|
|
617
|
+
automaticLayout: true,
|
|
618
|
+
folding: true,
|
|
619
|
+
renderWhitespace: "selection",
|
|
620
|
+
scrollbar: {
|
|
621
|
+
vertical: "auto",
|
|
622
|
+
horizontal: "auto",
|
|
623
|
+
useShadows: false,
|
|
624
|
+
verticalScrollbarSize: 10,
|
|
625
|
+
horizontalScrollbarSize: 10
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
height: "100%",
|
|
629
|
+
onChange: isEditable ? handleEditorChange : void 0,
|
|
630
|
+
onSave: isEditable ? handleEditorSave : void 0
|
|
631
|
+
}
|
|
632
|
+
) })
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
};
|
|
637
|
+
const FileEditorPanel = (props) => {
|
|
638
|
+
return /* @__PURE__ */ jsx(FileEditorPanelContent, { ...props });
|
|
639
|
+
};
|
|
640
|
+
const FileEditorPanelPreview = () => {
|
|
641
|
+
const { theme } = useTheme();
|
|
642
|
+
return /* @__PURE__ */ jsxs(
|
|
643
|
+
"div",
|
|
644
|
+
{
|
|
645
|
+
style: {
|
|
646
|
+
padding: "12px",
|
|
647
|
+
fontSize: theme.fontSizes[0],
|
|
648
|
+
color: theme.colors.text,
|
|
649
|
+
display: "flex",
|
|
650
|
+
flexDirection: "column",
|
|
651
|
+
gap: "4px",
|
|
652
|
+
fontFamily: theme.fonts.monospace
|
|
653
|
+
},
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
656
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#c678dd" }, children: "export" }),
|
|
657
|
+
" ",
|
|
658
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#61afef" }, children: "function" }),
|
|
659
|
+
" ",
|
|
660
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#e5c07b" }, children: "hello" }),
|
|
661
|
+
"() ",
|
|
662
|
+
"{"
|
|
663
|
+
] }),
|
|
664
|
+
/* @__PURE__ */ jsxs("div", { style: { paddingLeft: "12px" }, children: [
|
|
665
|
+
"console.",
|
|
666
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#61afef" }, children: "log" }),
|
|
667
|
+
"(",
|
|
668
|
+
/* @__PURE__ */ jsx("span", { style: { color: "#98c379" }, children: "'Hello'" }),
|
|
669
|
+
");"
|
|
670
|
+
] }),
|
|
671
|
+
/* @__PURE__ */ jsx("div", { children: "}" })
|
|
672
|
+
]
|
|
673
|
+
}
|
|
674
|
+
);
|
|
675
|
+
};
|
|
676
|
+
const statusMeta = {
|
|
677
|
+
staged: {
|
|
678
|
+
label: "Staged change",
|
|
679
|
+
description: "Comparing staged changes against the last commit"
|
|
680
|
+
},
|
|
681
|
+
unstaged: {
|
|
682
|
+
label: "Unstaged change",
|
|
683
|
+
description: "Comparing working tree changes against the last commit"
|
|
684
|
+
},
|
|
685
|
+
untracked: {
|
|
686
|
+
label: "Untracked file",
|
|
687
|
+
description: "New file compared against an empty baseline"
|
|
688
|
+
},
|
|
689
|
+
deleted: {
|
|
690
|
+
label: "Deleted file",
|
|
691
|
+
description: "Showing the last committed contents of the deleted file"
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
const languageFromPath = (filePath) => {
|
|
695
|
+
var _a;
|
|
696
|
+
if (!filePath) {
|
|
697
|
+
return "plaintext";
|
|
698
|
+
}
|
|
699
|
+
const ext = ((_a = filePath.split(".").pop()) == null ? void 0 : _a.toLowerCase()) ?? "";
|
|
700
|
+
const languageMap = {
|
|
701
|
+
js: "javascript",
|
|
702
|
+
jsx: "javascript",
|
|
703
|
+
ts: "typescript",
|
|
704
|
+
tsx: "typescript",
|
|
705
|
+
py: "python",
|
|
706
|
+
java: "java",
|
|
707
|
+
c: "c",
|
|
708
|
+
cpp: "cpp",
|
|
709
|
+
h: "c",
|
|
710
|
+
hpp: "cpp",
|
|
711
|
+
cs: "csharp",
|
|
712
|
+
go: "go",
|
|
713
|
+
rs: "rust",
|
|
714
|
+
php: "php",
|
|
715
|
+
rb: "ruby",
|
|
716
|
+
swift: "swift",
|
|
717
|
+
kt: "kotlin",
|
|
718
|
+
json: "json",
|
|
719
|
+
yaml: "yaml",
|
|
720
|
+
yml: "yaml",
|
|
721
|
+
toml: "toml",
|
|
722
|
+
ini: "ini",
|
|
723
|
+
cfg: "ini",
|
|
724
|
+
conf: "ini",
|
|
725
|
+
xml: "xml",
|
|
726
|
+
html: "html",
|
|
727
|
+
css: "css",
|
|
728
|
+
scss: "scss",
|
|
729
|
+
sass: "sass",
|
|
730
|
+
less: "less",
|
|
731
|
+
sh: "bash",
|
|
732
|
+
bash: "bash",
|
|
733
|
+
zsh: "bash",
|
|
734
|
+
md: "markdown",
|
|
735
|
+
mdx: "markdown",
|
|
736
|
+
sql: "sql"
|
|
737
|
+
};
|
|
738
|
+
return languageMap[ext] ?? "plaintext";
|
|
739
|
+
};
|
|
740
|
+
const GitDiffPanelContent = ({
|
|
741
|
+
context,
|
|
742
|
+
actions: _actions,
|
|
743
|
+
events,
|
|
744
|
+
filePath: filePathProp,
|
|
745
|
+
gitStatus: gitStatusProp,
|
|
746
|
+
showCloseButton = true
|
|
747
|
+
}) => {
|
|
748
|
+
var _a;
|
|
749
|
+
const { theme } = useTheme();
|
|
750
|
+
const [filePath, setFilePath] = useState(null);
|
|
751
|
+
const [status, setStatus] = useState("unstaged");
|
|
752
|
+
const [originalContent, setOriginalContent] = useState("");
|
|
753
|
+
const [modifiedContent, setModifiedContent] = useState("");
|
|
754
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
755
|
+
const [error, setError] = useState(null);
|
|
756
|
+
const language = useMemo(() => languageFromPath(filePath), [filePath]);
|
|
757
|
+
const fileSystem = (_a = context.adapters) == null ? void 0 : _a.fileSystem;
|
|
758
|
+
useEffect(() => {
|
|
759
|
+
if (filePathProp) {
|
|
760
|
+
console.log("[GitDiffPanel] Using prop-controlled file path:", filePathProp);
|
|
761
|
+
setFilePath(filePathProp);
|
|
762
|
+
setStatus(gitStatusProp || "unstaged");
|
|
763
|
+
}
|
|
764
|
+
}, [filePathProp, gitStatusProp]);
|
|
765
|
+
useEffect(() => {
|
|
766
|
+
if (filePathProp) {
|
|
767
|
+
return void 0;
|
|
768
|
+
}
|
|
769
|
+
const unsubscribe = events.on("git:diff", (event) => {
|
|
770
|
+
const payload = event.payload;
|
|
771
|
+
if (payload == null ? void 0 : payload.path) {
|
|
772
|
+
setFilePath(payload.path);
|
|
773
|
+
setStatus(payload.status || "unstaged");
|
|
774
|
+
if (payload.original !== void 0 || payload.modified !== void 0) {
|
|
775
|
+
setOriginalContent(payload.original ?? "");
|
|
776
|
+
setModifiedContent(payload.modified ?? "");
|
|
777
|
+
setIsLoading(false);
|
|
778
|
+
setError(null);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
return unsubscribe;
|
|
783
|
+
}, [events, filePathProp]);
|
|
784
|
+
useEffect(() => {
|
|
785
|
+
let isActive = true;
|
|
786
|
+
const loadDiff = async () => {
|
|
787
|
+
if (!filePath) {
|
|
788
|
+
setOriginalContent("");
|
|
789
|
+
setModifiedContent("");
|
|
790
|
+
setIsLoading(false);
|
|
791
|
+
setError(null);
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
if (!(fileSystem == null ? void 0 : fileSystem.readFile)) {
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
setIsLoading(true);
|
|
798
|
+
setError(null);
|
|
799
|
+
try {
|
|
800
|
+
const modified = await fileSystem.readFile(filePath);
|
|
801
|
+
if (!isActive) return;
|
|
802
|
+
setModifiedContent(modified ?? "");
|
|
803
|
+
if (status === "untracked") {
|
|
804
|
+
setOriginalContent("");
|
|
805
|
+
}
|
|
806
|
+
} catch (err) {
|
|
807
|
+
if (!isActive) return;
|
|
808
|
+
console.error("Failed to load git diff:", err);
|
|
809
|
+
setError(
|
|
810
|
+
err instanceof Error ? `Failed to load diff: ${err.message}` : "Failed to load diff"
|
|
811
|
+
);
|
|
812
|
+
setOriginalContent("");
|
|
813
|
+
setModifiedContent("");
|
|
814
|
+
} finally {
|
|
815
|
+
if (isActive) {
|
|
816
|
+
setIsLoading(false);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
void loadDiff();
|
|
821
|
+
return () => {
|
|
822
|
+
isActive = false;
|
|
823
|
+
};
|
|
824
|
+
}, [filePath, status, fileSystem]);
|
|
825
|
+
const handleClose = () => {
|
|
826
|
+
events.emit({
|
|
827
|
+
type: "git:diff:close",
|
|
828
|
+
source: "industry-theme.git-diff",
|
|
829
|
+
timestamp: Date.now(),
|
|
830
|
+
payload: { path: filePath }
|
|
831
|
+
});
|
|
832
|
+
setFilePath(null);
|
|
833
|
+
};
|
|
834
|
+
const statusInfo = status ? statusMeta[status] : null;
|
|
835
|
+
const statusColor = useMemo(() => {
|
|
836
|
+
if (!status) return theme.colors.textSecondary;
|
|
837
|
+
switch (status) {
|
|
838
|
+
case "staged":
|
|
839
|
+
return theme.colors.success || "#10b981";
|
|
840
|
+
case "unstaged":
|
|
841
|
+
return theme.colors.warning || "#f59e0b";
|
|
842
|
+
case "untracked":
|
|
843
|
+
return theme.colors.info || theme.colors.primary || "#3b82f6";
|
|
844
|
+
case "deleted":
|
|
845
|
+
return theme.colors.error || "#ef4444";
|
|
846
|
+
default:
|
|
847
|
+
return theme.colors.textSecondary;
|
|
848
|
+
}
|
|
849
|
+
}, [status, theme.colors]);
|
|
850
|
+
if (!filePath) {
|
|
851
|
+
return /* @__PURE__ */ jsx(
|
|
852
|
+
"div",
|
|
853
|
+
{
|
|
854
|
+
style: {
|
|
855
|
+
height: "100%",
|
|
856
|
+
display: "flex",
|
|
857
|
+
alignItems: "center",
|
|
858
|
+
justifyContent: "center",
|
|
859
|
+
color: theme.colors.textSecondary,
|
|
860
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
861
|
+
fontFamily: theme.fonts.body
|
|
862
|
+
},
|
|
863
|
+
children: "Select a file from Git Changes to view its diff."
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
return /* @__PURE__ */ jsxs(
|
|
868
|
+
"div",
|
|
869
|
+
{
|
|
870
|
+
style: {
|
|
871
|
+
height: "100%",
|
|
872
|
+
display: "flex",
|
|
873
|
+
flexDirection: "column",
|
|
874
|
+
backgroundColor: theme.colors.background
|
|
875
|
+
},
|
|
876
|
+
children: [
|
|
877
|
+
/* @__PURE__ */ jsxs(
|
|
878
|
+
"div",
|
|
879
|
+
{
|
|
880
|
+
style: {
|
|
881
|
+
height: "40px",
|
|
882
|
+
padding: "0 12px",
|
|
883
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
884
|
+
display: "flex",
|
|
885
|
+
justifyContent: "space-between",
|
|
886
|
+
alignItems: "center",
|
|
887
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
888
|
+
fontFamily: theme.fonts.body,
|
|
889
|
+
flexShrink: 0,
|
|
890
|
+
boxSizing: "border-box"
|
|
891
|
+
},
|
|
892
|
+
children: [
|
|
893
|
+
/* @__PURE__ */ jsxs(
|
|
894
|
+
"div",
|
|
895
|
+
{
|
|
896
|
+
style: {
|
|
897
|
+
display: "flex",
|
|
898
|
+
alignItems: "center",
|
|
899
|
+
gap: "8px",
|
|
900
|
+
flex: 1,
|
|
901
|
+
minWidth: 0
|
|
902
|
+
},
|
|
903
|
+
children: [
|
|
904
|
+
/* @__PURE__ */ jsx(
|
|
905
|
+
GitCommitHorizontal,
|
|
906
|
+
{
|
|
907
|
+
size: 16,
|
|
908
|
+
style: { color: theme.colors.primary, flexShrink: 0 }
|
|
909
|
+
}
|
|
910
|
+
),
|
|
911
|
+
/* @__PURE__ */ jsx(
|
|
912
|
+
"div",
|
|
913
|
+
{
|
|
914
|
+
style: {
|
|
915
|
+
fontSize: theme.fontSizes[2],
|
|
916
|
+
fontWeight: 600,
|
|
917
|
+
color: theme.colors.text,
|
|
918
|
+
whiteSpace: "nowrap",
|
|
919
|
+
overflow: "hidden",
|
|
920
|
+
textOverflow: "ellipsis"
|
|
921
|
+
},
|
|
922
|
+
title: filePath,
|
|
923
|
+
children: (filePath == null ? void 0 : filePath.split("/").pop()) || filePath
|
|
924
|
+
}
|
|
925
|
+
),
|
|
926
|
+
statusInfo && /* @__PURE__ */ jsx(
|
|
927
|
+
"span",
|
|
928
|
+
{
|
|
929
|
+
style: {
|
|
930
|
+
display: "inline-flex",
|
|
931
|
+
alignItems: "center",
|
|
932
|
+
fontSize: theme.fontSizes[0],
|
|
933
|
+
padding: "2px 8px",
|
|
934
|
+
borderRadius: "999px",
|
|
935
|
+
backgroundColor: `${statusColor}20`,
|
|
936
|
+
color: statusColor,
|
|
937
|
+
border: `1px solid ${statusColor}60`,
|
|
938
|
+
whiteSpace: "nowrap",
|
|
939
|
+
flexShrink: 0
|
|
940
|
+
},
|
|
941
|
+
children: statusInfo.label
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
]
|
|
945
|
+
}
|
|
946
|
+
),
|
|
947
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
948
|
+
"button",
|
|
949
|
+
{
|
|
950
|
+
onClick: handleClose,
|
|
951
|
+
style: {
|
|
952
|
+
background: "none",
|
|
953
|
+
border: "none",
|
|
954
|
+
padding: "4px",
|
|
955
|
+
cursor: "pointer",
|
|
956
|
+
color: theme.colors.textSecondary,
|
|
957
|
+
display: "flex",
|
|
958
|
+
alignItems: "center",
|
|
959
|
+
justifyContent: "center",
|
|
960
|
+
borderRadius: "4px",
|
|
961
|
+
transition: "background-color 0.2s",
|
|
962
|
+
flexShrink: 0
|
|
963
|
+
},
|
|
964
|
+
onMouseEnter: (e) => {
|
|
965
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
966
|
+
},
|
|
967
|
+
onMouseLeave: (e) => {
|
|
968
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
969
|
+
},
|
|
970
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
]
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0 }, children: isLoading ? /* @__PURE__ */ jsx(
|
|
977
|
+
"div",
|
|
978
|
+
{
|
|
979
|
+
style: {
|
|
980
|
+
height: "100%",
|
|
981
|
+
display: "flex",
|
|
982
|
+
alignItems: "center",
|
|
983
|
+
justifyContent: "center",
|
|
984
|
+
color: theme.colors.textSecondary,
|
|
985
|
+
fontFamily: theme.fonts.body
|
|
986
|
+
},
|
|
987
|
+
children: "Loading diff..."
|
|
988
|
+
}
|
|
989
|
+
) : error ? /* @__PURE__ */ jsx(
|
|
990
|
+
"div",
|
|
991
|
+
{
|
|
992
|
+
style: {
|
|
993
|
+
height: "100%",
|
|
994
|
+
display: "flex",
|
|
995
|
+
alignItems: "center",
|
|
996
|
+
justifyContent: "center",
|
|
997
|
+
color: theme.colors.error,
|
|
998
|
+
padding: "20px",
|
|
999
|
+
textAlign: "center",
|
|
1000
|
+
fontFamily: theme.fonts.body
|
|
1001
|
+
},
|
|
1002
|
+
children: error
|
|
1003
|
+
}
|
|
1004
|
+
) : /* @__PURE__ */ jsx(
|
|
1005
|
+
ThemedMonacoDiffEditor,
|
|
1006
|
+
{
|
|
1007
|
+
theme,
|
|
1008
|
+
original: originalContent,
|
|
1009
|
+
modified: modifiedContent,
|
|
1010
|
+
language,
|
|
1011
|
+
height: "100%",
|
|
1012
|
+
options: {
|
|
1013
|
+
renderSideBySide: true,
|
|
1014
|
+
readOnly: true,
|
|
1015
|
+
minimap: { enabled: false },
|
|
1016
|
+
automaticLayout: true,
|
|
1017
|
+
renderIndicators: true,
|
|
1018
|
+
renderMarginRevertIcon: true,
|
|
1019
|
+
ignoreTrimWhitespace: false,
|
|
1020
|
+
diffAlgorithm: "advanced",
|
|
1021
|
+
scrollbar: {
|
|
1022
|
+
useShadows: false,
|
|
1023
|
+
vertical: "auto",
|
|
1024
|
+
horizontal: "auto"
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
loadingComponent: /* @__PURE__ */ jsx(
|
|
1028
|
+
"div",
|
|
1029
|
+
{
|
|
1030
|
+
style: {
|
|
1031
|
+
height: "100%",
|
|
1032
|
+
display: "flex",
|
|
1033
|
+
alignItems: "center",
|
|
1034
|
+
justifyContent: "center",
|
|
1035
|
+
color: theme.colors.textSecondary
|
|
1036
|
+
},
|
|
1037
|
+
children: "Preparing diff editor..."
|
|
1038
|
+
}
|
|
1039
|
+
)
|
|
1040
|
+
}
|
|
1041
|
+
) })
|
|
1042
|
+
]
|
|
1043
|
+
}
|
|
1044
|
+
);
|
|
1045
|
+
};
|
|
1046
|
+
const GitDiffPanel = (props) => {
|
|
1047
|
+
return /* @__PURE__ */ jsx(GitDiffPanelContent, { ...props });
|
|
1048
|
+
};
|
|
1049
|
+
const GitDiffPanelPreview = () => {
|
|
1050
|
+
const { theme } = useTheme();
|
|
1051
|
+
return /* @__PURE__ */ jsxs(
|
|
1052
|
+
"div",
|
|
1053
|
+
{
|
|
1054
|
+
style: {
|
|
1055
|
+
padding: "12px",
|
|
1056
|
+
fontSize: theme.fontSizes[0],
|
|
1057
|
+
color: theme.colors.text,
|
|
1058
|
+
display: "flex",
|
|
1059
|
+
flexDirection: "column",
|
|
1060
|
+
gap: "4px",
|
|
1061
|
+
fontFamily: theme.fonts.monospace
|
|
1062
|
+
},
|
|
1063
|
+
children: [
|
|
1064
|
+
/* @__PURE__ */ jsx(
|
|
1065
|
+
"div",
|
|
1066
|
+
{
|
|
1067
|
+
style: {
|
|
1068
|
+
display: "flex",
|
|
1069
|
+
gap: "8px"
|
|
1070
|
+
},
|
|
1071
|
+
children: /* @__PURE__ */ jsx("span", { style: { color: theme.colors.textSecondary }, children: "@@ 12,5 @@" })
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
/* @__PURE__ */ jsx("div", { style: { color: "#ef4444" }, children: "- const count = oldValue;" }),
|
|
1075
|
+
/* @__PURE__ */ jsx("div", { style: { color: "#22c55e" }, children: "+ const count = newValue;" }),
|
|
1076
|
+
/* @__PURE__ */ jsx("div", { style: { color: theme.colors.textSecondary }, children: " return count;" })
|
|
1077
|
+
]
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
};
|
|
1081
|
+
const MDXEditorPanelContent = ({
|
|
1082
|
+
context,
|
|
1083
|
+
actions: _actions,
|
|
1084
|
+
events,
|
|
1085
|
+
filePath: filePathProp,
|
|
1086
|
+
showCloseButton = true
|
|
1087
|
+
}) => {
|
|
1088
|
+
var _a, _b;
|
|
1089
|
+
const { theme } = useTheme();
|
|
1090
|
+
const [filePath, setFilePath] = useState(null);
|
|
1091
|
+
const [markdown, setMarkdown] = useState("");
|
|
1092
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
1093
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
1094
|
+
const [loadError, setLoadError] = useState(null);
|
|
1095
|
+
const [parseError, setParseError] = useState(null);
|
|
1096
|
+
const [_isDirty, setIsDirty] = useState(false);
|
|
1097
|
+
const fileSystem = (_a = context.adapters) == null ? void 0 : _a.fileSystem;
|
|
1098
|
+
const isEditable = Boolean(fileSystem == null ? void 0 : fileSystem.writeFile);
|
|
1099
|
+
const activeFileSlice = context.getSlice("active-file");
|
|
1100
|
+
const plugins = useMemo(
|
|
1101
|
+
() => [
|
|
1102
|
+
headingsPlugin(),
|
|
1103
|
+
listsPlugin(),
|
|
1104
|
+
quotePlugin(),
|
|
1105
|
+
thematicBreakPlugin(),
|
|
1106
|
+
markdownShortcutPlugin(),
|
|
1107
|
+
linkPlugin(),
|
|
1108
|
+
linkDialogPlugin(),
|
|
1109
|
+
imagePlugin({
|
|
1110
|
+
imageUploadHandler: async (file) => {
|
|
1111
|
+
console.warn("Image upload not configured:", file.name);
|
|
1112
|
+
return "/placeholder-image.png";
|
|
1113
|
+
}
|
|
1114
|
+
}),
|
|
1115
|
+
tablePlugin(),
|
|
1116
|
+
codeBlockPlugin({ defaultCodeBlockLanguage: "javascript" }),
|
|
1117
|
+
codeMirrorPlugin({
|
|
1118
|
+
codeBlockLanguages: {
|
|
1119
|
+
javascript: "JavaScript",
|
|
1120
|
+
typescript: "TypeScript",
|
|
1121
|
+
tsx: "TypeScript (JSX)",
|
|
1122
|
+
jsx: "JavaScript (JSX)",
|
|
1123
|
+
python: "Python",
|
|
1124
|
+
java: "Java",
|
|
1125
|
+
go: "Go",
|
|
1126
|
+
rust: "Rust",
|
|
1127
|
+
cpp: "C++",
|
|
1128
|
+
c: "C",
|
|
1129
|
+
css: "CSS",
|
|
1130
|
+
html: "HTML",
|
|
1131
|
+
json: "JSON",
|
|
1132
|
+
yaml: "YAML",
|
|
1133
|
+
markdown: "Markdown",
|
|
1134
|
+
bash: "Bash",
|
|
1135
|
+
shell: "Shell",
|
|
1136
|
+
sql: "SQL"
|
|
1137
|
+
}
|
|
1138
|
+
}),
|
|
1139
|
+
frontmatterPlugin(),
|
|
1140
|
+
diffSourcePlugin({
|
|
1141
|
+
viewMode: parseError ? "source" : "rich-text"
|
|
1142
|
+
}),
|
|
1143
|
+
toolbarPlugin({
|
|
1144
|
+
toolbarContents: () => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(DiffSourceToggleWrapper, { children: [
|
|
1145
|
+
/* @__PURE__ */ jsx(UndoRedo, {}),
|
|
1146
|
+
/* @__PURE__ */ jsx(BlockTypeSelect, {}),
|
|
1147
|
+
/* @__PURE__ */ jsx(BoldItalicUnderlineToggles, {}),
|
|
1148
|
+
/* @__PURE__ */ jsx(CodeToggle, {}),
|
|
1149
|
+
/* @__PURE__ */ jsx(CreateLink, {}),
|
|
1150
|
+
/* @__PURE__ */ jsx(InsertImage, {}),
|
|
1151
|
+
/* @__PURE__ */ jsx(InsertTable, {}),
|
|
1152
|
+
/* @__PURE__ */ jsx(InsertThematicBreak, {}),
|
|
1153
|
+
/* @__PURE__ */ jsx(ListsToggle, {})
|
|
1154
|
+
] }) })
|
|
1155
|
+
})
|
|
1156
|
+
],
|
|
1157
|
+
[parseError]
|
|
1158
|
+
);
|
|
1159
|
+
useEffect(() => {
|
|
1160
|
+
setIsMounted(true);
|
|
1161
|
+
}, []);
|
|
1162
|
+
useEffect(() => {
|
|
1163
|
+
if (filePathProp) {
|
|
1164
|
+
console.log("[MDXEditorPanel] Using prop-controlled file path:", filePathProp);
|
|
1165
|
+
setFilePath(filePathProp);
|
|
1166
|
+
}
|
|
1167
|
+
}, [filePathProp]);
|
|
1168
|
+
useEffect(() => {
|
|
1169
|
+
var _a2;
|
|
1170
|
+
if (!filePathProp) {
|
|
1171
|
+
const path = (_a2 = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _a2.path;
|
|
1172
|
+
if (path && (path.endsWith(".md") || path.endsWith(".mdx"))) {
|
|
1173
|
+
setFilePath(path);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}, [filePathProp, (_b = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _b.path]);
|
|
1177
|
+
useEffect(() => {
|
|
1178
|
+
if (filePathProp) {
|
|
1179
|
+
return void 0;
|
|
1180
|
+
}
|
|
1181
|
+
const unsubscribe = events.on("file:open", (event) => {
|
|
1182
|
+
const payload = event.payload;
|
|
1183
|
+
if (payload == null ? void 0 : payload.path) {
|
|
1184
|
+
const path = payload.path;
|
|
1185
|
+
if (path.endsWith(".md") || path.endsWith(".mdx")) {
|
|
1186
|
+
setFilePath(path);
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
return unsubscribe;
|
|
1191
|
+
}, [filePathProp, events]);
|
|
1192
|
+
const handleChange = useCallback((value) => {
|
|
1193
|
+
setMarkdown(value);
|
|
1194
|
+
setIsDirty(true);
|
|
1195
|
+
setParseError(null);
|
|
1196
|
+
}, []);
|
|
1197
|
+
const handleSave = useCallback(
|
|
1198
|
+
async (content) => {
|
|
1199
|
+
const contentToSave = content || markdown;
|
|
1200
|
+
if (filePath && (fileSystem == null ? void 0 : fileSystem.writeFile)) {
|
|
1201
|
+
try {
|
|
1202
|
+
await fileSystem.writeFile(filePath, contentToSave);
|
|
1203
|
+
setIsDirty(false);
|
|
1204
|
+
events.emit({
|
|
1205
|
+
type: "file:save",
|
|
1206
|
+
source: "industry-theme.mdx-editor",
|
|
1207
|
+
timestamp: Date.now(),
|
|
1208
|
+
payload: { path: filePath }
|
|
1209
|
+
});
|
|
1210
|
+
} catch (error) {
|
|
1211
|
+
console.error("Error saving file:", error);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
[markdown, filePath, fileSystem, events]
|
|
1216
|
+
);
|
|
1217
|
+
useEffect(() => {
|
|
1218
|
+
const loadFileContent = async () => {
|
|
1219
|
+
if (!filePath || !(fileSystem == null ? void 0 : fileSystem.readFile)) {
|
|
1220
|
+
setMarkdown("");
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
setIsLoading(true);
|
|
1224
|
+
setLoadError(null);
|
|
1225
|
+
try {
|
|
1226
|
+
const content = await fileSystem.readFile(filePath);
|
|
1227
|
+
if (content !== null) {
|
|
1228
|
+
setMarkdown(content);
|
|
1229
|
+
setParseError(null);
|
|
1230
|
+
setIsDirty(false);
|
|
1231
|
+
} else {
|
|
1232
|
+
throw new Error("Failed to read file");
|
|
1233
|
+
}
|
|
1234
|
+
} catch (error) {
|
|
1235
|
+
console.error("Error loading file:", error);
|
|
1236
|
+
setLoadError(`Failed to load file: ${filePath}`);
|
|
1237
|
+
setMarkdown("");
|
|
1238
|
+
setParseError(null);
|
|
1239
|
+
} finally {
|
|
1240
|
+
setIsLoading(false);
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
loadFileContent();
|
|
1244
|
+
}, [filePath, fileSystem]);
|
|
1245
|
+
useEffect(() => {
|
|
1246
|
+
if (!isEditable) return;
|
|
1247
|
+
const handleKeyDown = (e) => {
|
|
1248
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "s") {
|
|
1249
|
+
e.preventDefault();
|
|
1250
|
+
handleSave();
|
|
1251
|
+
}
|
|
1252
|
+
};
|
|
1253
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
1254
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1255
|
+
}, [isEditable, handleSave]);
|
|
1256
|
+
if (!isMounted) {
|
|
1257
|
+
return /* @__PURE__ */ jsx(
|
|
1258
|
+
"div",
|
|
1259
|
+
{
|
|
1260
|
+
style: {
|
|
1261
|
+
display: "flex",
|
|
1262
|
+
alignItems: "center",
|
|
1263
|
+
justifyContent: "center",
|
|
1264
|
+
height: "100%",
|
|
1265
|
+
color: theme.colors.text,
|
|
1266
|
+
fontFamily: theme.fonts.body
|
|
1267
|
+
},
|
|
1268
|
+
children: "Loading editor..."
|
|
1269
|
+
}
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
if (isLoading) {
|
|
1273
|
+
return /* @__PURE__ */ jsx(
|
|
1274
|
+
"div",
|
|
1275
|
+
{
|
|
1276
|
+
style: {
|
|
1277
|
+
display: "flex",
|
|
1278
|
+
alignItems: "center",
|
|
1279
|
+
justifyContent: "center",
|
|
1280
|
+
height: "100%",
|
|
1281
|
+
color: theme.colors.text,
|
|
1282
|
+
fontFamily: theme.fonts.body
|
|
1283
|
+
},
|
|
1284
|
+
children: "Loading file..."
|
|
1285
|
+
}
|
|
1286
|
+
);
|
|
1287
|
+
}
|
|
1288
|
+
if (loadError) {
|
|
1289
|
+
return /* @__PURE__ */ jsxs(
|
|
1290
|
+
"div",
|
|
1291
|
+
{
|
|
1292
|
+
style: {
|
|
1293
|
+
display: "flex",
|
|
1294
|
+
flexDirection: "column",
|
|
1295
|
+
alignItems: "center",
|
|
1296
|
+
justifyContent: "center",
|
|
1297
|
+
height: "100%",
|
|
1298
|
+
color: theme.colors.error,
|
|
1299
|
+
padding: "20px",
|
|
1300
|
+
textAlign: "center",
|
|
1301
|
+
fontFamily: theme.fonts.body
|
|
1302
|
+
},
|
|
1303
|
+
children: [
|
|
1304
|
+
/* @__PURE__ */ jsx("div", { style: { marginBottom: "10px" }, children: "Warning" }),
|
|
1305
|
+
/* @__PURE__ */ jsx("div", { children: loadError })
|
|
1306
|
+
]
|
|
1307
|
+
}
|
|
1308
|
+
);
|
|
1309
|
+
}
|
|
1310
|
+
if (!filePath) {
|
|
1311
|
+
return /* @__PURE__ */ jsxs(
|
|
1312
|
+
"div",
|
|
1313
|
+
{
|
|
1314
|
+
style: {
|
|
1315
|
+
display: "flex",
|
|
1316
|
+
flexDirection: "column",
|
|
1317
|
+
alignItems: "center",
|
|
1318
|
+
justifyContent: "center",
|
|
1319
|
+
height: "100%",
|
|
1320
|
+
color: theme.colors.textSecondary,
|
|
1321
|
+
padding: "40px",
|
|
1322
|
+
textAlign: "center",
|
|
1323
|
+
fontFamily: theme.fonts.body
|
|
1324
|
+
},
|
|
1325
|
+
children: [
|
|
1326
|
+
/* @__PURE__ */ jsx(FileText, { size: 48, style: { marginBottom: "16px", opacity: 0.5 } }),
|
|
1327
|
+
/* @__PURE__ */ jsx(
|
|
1328
|
+
"h3",
|
|
1329
|
+
{
|
|
1330
|
+
style: {
|
|
1331
|
+
margin: "0 0 8px 0",
|
|
1332
|
+
fontSize: theme.fontSizes[3],
|
|
1333
|
+
fontWeight: 600,
|
|
1334
|
+
color: theme.colors.text
|
|
1335
|
+
},
|
|
1336
|
+
children: "No File Selected"
|
|
1337
|
+
}
|
|
1338
|
+
),
|
|
1339
|
+
/* @__PURE__ */ jsx(
|
|
1340
|
+
"p",
|
|
1341
|
+
{
|
|
1342
|
+
style: {
|
|
1343
|
+
margin: 0,
|
|
1344
|
+
fontSize: theme.fontSizes[2],
|
|
1345
|
+
maxWidth: "400px"
|
|
1346
|
+
},
|
|
1347
|
+
children: "Select a markdown file (.md or .mdx) to start editing"
|
|
1348
|
+
}
|
|
1349
|
+
)
|
|
1350
|
+
]
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
const safeMarkdown = typeof markdown === "string" ? markdown : String(markdown || "");
|
|
1355
|
+
const editorContent = /* @__PURE__ */ jsx(
|
|
1356
|
+
"div",
|
|
1357
|
+
{
|
|
1358
|
+
style: {
|
|
1359
|
+
height: "100%",
|
|
1360
|
+
width: "100%"
|
|
1361
|
+
},
|
|
1362
|
+
children: /* @__PURE__ */ jsx(
|
|
1363
|
+
MDXEditor,
|
|
1364
|
+
{
|
|
1365
|
+
markdown: safeMarkdown,
|
|
1366
|
+
onChange: handleChange,
|
|
1367
|
+
readOnly: !isEditable,
|
|
1368
|
+
contentEditableClassName: "prose",
|
|
1369
|
+
plugins
|
|
1370
|
+
},
|
|
1371
|
+
filePath || "default"
|
|
1372
|
+
)
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
if (parseError) {
|
|
1376
|
+
return /* @__PURE__ */ jsxs(
|
|
1377
|
+
"div",
|
|
1378
|
+
{
|
|
1379
|
+
style: {
|
|
1380
|
+
display: "flex",
|
|
1381
|
+
flexDirection: "column",
|
|
1382
|
+
height: "100%"
|
|
1383
|
+
},
|
|
1384
|
+
children: [
|
|
1385
|
+
/* @__PURE__ */ jsxs(
|
|
1386
|
+
"div",
|
|
1387
|
+
{
|
|
1388
|
+
style: {
|
|
1389
|
+
padding: "12px 16px",
|
|
1390
|
+
backgroundColor: theme.colors.warning || "#f59e0b",
|
|
1391
|
+
color: theme.colors.background,
|
|
1392
|
+
fontSize: theme.fontSizes[2],
|
|
1393
|
+
display: "flex",
|
|
1394
|
+
alignItems: "center",
|
|
1395
|
+
gap: "8px"
|
|
1396
|
+
},
|
|
1397
|
+
children: [
|
|
1398
|
+
/* @__PURE__ */ jsx("span", { children: "Warning" }),
|
|
1399
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
1400
|
+
parseError,
|
|
1401
|
+
" - Switch to source mode using the toolbar button to edit the raw markdown."
|
|
1402
|
+
] })
|
|
1403
|
+
]
|
|
1404
|
+
}
|
|
1405
|
+
),
|
|
1406
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: editorContent })
|
|
1407
|
+
]
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
return editorContent;
|
|
1412
|
+
};
|
|
1413
|
+
const MDXEditorPanel = (props) => {
|
|
1414
|
+
return /* @__PURE__ */ jsx(MDXEditorPanelContent, { ...props });
|
|
1415
|
+
};
|
|
1416
|
+
const MDXEditorPanelPreview = () => {
|
|
1417
|
+
const { theme } = useTheme();
|
|
1418
|
+
return /* @__PURE__ */ jsxs(
|
|
1419
|
+
"div",
|
|
1420
|
+
{
|
|
1421
|
+
style: {
|
|
1422
|
+
width: "100%",
|
|
1423
|
+
height: "100%",
|
|
1424
|
+
display: "flex",
|
|
1425
|
+
flexDirection: "column",
|
|
1426
|
+
alignItems: "center",
|
|
1427
|
+
justifyContent: "center",
|
|
1428
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1429
|
+
borderRadius: "4px",
|
|
1430
|
+
padding: "20px"
|
|
1431
|
+
},
|
|
1432
|
+
children: [
|
|
1433
|
+
/* @__PURE__ */ jsx(FileText, { size: 32, style: { marginBottom: "12px", opacity: 0.6 } }),
|
|
1434
|
+
/* @__PURE__ */ jsx(
|
|
1435
|
+
"div",
|
|
1436
|
+
{
|
|
1437
|
+
style: {
|
|
1438
|
+
fontSize: theme.fontSizes[2],
|
|
1439
|
+
fontWeight: 600,
|
|
1440
|
+
color: theme.colors.text,
|
|
1441
|
+
marginBottom: "4px"
|
|
1442
|
+
},
|
|
1443
|
+
children: "MDX Editor"
|
|
1444
|
+
}
|
|
1445
|
+
),
|
|
1446
|
+
/* @__PURE__ */ jsx(
|
|
1447
|
+
"div",
|
|
1448
|
+
{
|
|
1449
|
+
style: {
|
|
1450
|
+
fontSize: theme.fontSizes[1],
|
|
1451
|
+
color: theme.colors.textSecondary,
|
|
1452
|
+
textAlign: "center"
|
|
1453
|
+
},
|
|
1454
|
+
children: "Rich markdown editor with live preview"
|
|
1455
|
+
}
|
|
1456
|
+
)
|
|
1457
|
+
]
|
|
1458
|
+
}
|
|
1459
|
+
);
|
|
1460
|
+
};
|
|
1461
|
+
const openFileTool = {
|
|
1462
|
+
name: "open_file",
|
|
1463
|
+
description: "Opens a file in the file editor panel",
|
|
1464
|
+
inputs: {
|
|
1465
|
+
type: "object",
|
|
1466
|
+
properties: {
|
|
1467
|
+
filePath: {
|
|
1468
|
+
type: "string",
|
|
1469
|
+
description: "Path to the file to open"
|
|
1470
|
+
},
|
|
1471
|
+
readOnly: {
|
|
1472
|
+
type: "boolean",
|
|
1473
|
+
description: "Whether to open the file in read-only mode"
|
|
1474
|
+
}
|
|
1475
|
+
},
|
|
1476
|
+
required: ["filePath"]
|
|
1477
|
+
},
|
|
1478
|
+
outputs: {
|
|
1479
|
+
type: "object",
|
|
1480
|
+
properties: {
|
|
1481
|
+
success: { type: "boolean" },
|
|
1482
|
+
filePath: { type: "string" }
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
tags: ["file", "editor", "open"],
|
|
1486
|
+
tool_call_template: {
|
|
1487
|
+
call_template_type: "panel_event",
|
|
1488
|
+
event_type: "file-editing-panels:open-file"
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
const viewDiffTool = {
|
|
1492
|
+
name: "view_diff",
|
|
1493
|
+
description: "Opens a file in the git diff panel to view changes",
|
|
1494
|
+
inputs: {
|
|
1495
|
+
type: "object",
|
|
1496
|
+
properties: {
|
|
1497
|
+
filePath: {
|
|
1498
|
+
type: "string",
|
|
1499
|
+
description: "Path to the file to diff"
|
|
1500
|
+
},
|
|
1501
|
+
status: {
|
|
1502
|
+
type: "string",
|
|
1503
|
+
enum: ["staged", "unstaged", "untracked", "deleted"],
|
|
1504
|
+
description: "The git status of the file"
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
required: ["filePath"]
|
|
1508
|
+
},
|
|
1509
|
+
outputs: {
|
|
1510
|
+
type: "object",
|
|
1511
|
+
properties: {
|
|
1512
|
+
success: { type: "boolean" },
|
|
1513
|
+
filePath: { type: "string" }
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
tags: ["git", "diff", "view"],
|
|
1517
|
+
tool_call_template: {
|
|
1518
|
+
call_template_type: "panel_event",
|
|
1519
|
+
event_type: "file-editing-panels:view-diff"
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
const openMarkdownTool = {
|
|
1523
|
+
name: "open_markdown",
|
|
1524
|
+
description: "Opens a markdown file in the MDX editor panel",
|
|
1525
|
+
inputs: {
|
|
1526
|
+
type: "object",
|
|
1527
|
+
properties: {
|
|
1528
|
+
filePath: {
|
|
1529
|
+
type: "string",
|
|
1530
|
+
description: "Path to the markdown file to open"
|
|
1531
|
+
},
|
|
1532
|
+
readOnly: {
|
|
1533
|
+
type: "boolean",
|
|
1534
|
+
description: "Whether to open the file in read-only mode"
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
required: ["filePath"]
|
|
1538
|
+
},
|
|
1539
|
+
outputs: {
|
|
1540
|
+
type: "object",
|
|
1541
|
+
properties: {
|
|
1542
|
+
success: { type: "boolean" },
|
|
1543
|
+
filePath: { type: "string" }
|
|
1544
|
+
}
|
|
1545
|
+
},
|
|
1546
|
+
tags: ["markdown", "mdx", "editor"],
|
|
1547
|
+
tool_call_template: {
|
|
1548
|
+
call_template_type: "panel_event",
|
|
1549
|
+
event_type: "file-editing-panels:open-markdown"
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
const fileEditingPanelTools = [
|
|
1553
|
+
openFileTool,
|
|
1554
|
+
viewDiffTool,
|
|
1555
|
+
openMarkdownTool
|
|
1556
|
+
];
|
|
1557
|
+
const fileEditingPanelToolsMetadata = {
|
|
1558
|
+
id: "industry-theme.file-editing-panels",
|
|
1559
|
+
name: "File Editing Panels",
|
|
1560
|
+
description: "Tools for file editing, git diff viewing, and markdown editing",
|
|
1561
|
+
tools: fileEditingPanelTools
|
|
1562
|
+
};
|
|
1563
|
+
const panels = [
|
|
1564
|
+
{
|
|
1565
|
+
metadata: {
|
|
1566
|
+
id: "industry-theme.file-editor",
|
|
1567
|
+
name: "File Editor",
|
|
1568
|
+
icon: "📝",
|
|
1569
|
+
version: "0.1.0",
|
|
1570
|
+
author: "Industry Theme",
|
|
1571
|
+
description: "Monaco-based code editor with syntax highlighting",
|
|
1572
|
+
slices: ["active-file", "fileTree"],
|
|
1573
|
+
tools: [fileEditingPanelTools[0]]
|
|
1574
|
+
// openFileTool
|
|
1575
|
+
},
|
|
1576
|
+
component: FileEditorPanel,
|
|
1577
|
+
onMount: async (context) => {
|
|
1578
|
+
var _a;
|
|
1579
|
+
console.log(
|
|
1580
|
+
"File Editor Panel mounted",
|
|
1581
|
+
(_a = context.currentScope.repository) == null ? void 0 : _a.path
|
|
1582
|
+
);
|
|
1583
|
+
},
|
|
1584
|
+
onUnmount: async (_context) => {
|
|
1585
|
+
console.log("File Editor Panel unmounting");
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
metadata: {
|
|
1590
|
+
id: "industry-theme.git-diff",
|
|
1591
|
+
name: "Git Diff",
|
|
1592
|
+
icon: "🔀",
|
|
1593
|
+
version: "0.1.0",
|
|
1594
|
+
author: "Industry Theme",
|
|
1595
|
+
description: "Side-by-side git diff viewer",
|
|
1596
|
+
slices: ["git", "fileTree"],
|
|
1597
|
+
tools: [fileEditingPanelTools[1]]
|
|
1598
|
+
// viewDiffTool
|
|
1599
|
+
},
|
|
1600
|
+
component: GitDiffPanel,
|
|
1601
|
+
onMount: async (context) => {
|
|
1602
|
+
var _a;
|
|
1603
|
+
console.log(
|
|
1604
|
+
"Git Diff Panel mounted",
|
|
1605
|
+
(_a = context.currentScope.repository) == null ? void 0 : _a.path
|
|
1606
|
+
);
|
|
1607
|
+
},
|
|
1608
|
+
onUnmount: async (_context) => {
|
|
1609
|
+
console.log("Git Diff Panel unmounting");
|
|
1610
|
+
}
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
metadata: {
|
|
1614
|
+
id: "industry-theme.mdx-editor",
|
|
1615
|
+
name: "MDX Editor",
|
|
1616
|
+
icon: "📄",
|
|
1617
|
+
version: "0.1.0",
|
|
1618
|
+
author: "Industry Theme",
|
|
1619
|
+
description: "Rich markdown/MDX editor with live preview",
|
|
1620
|
+
slices: ["active-file", "fileTree"],
|
|
1621
|
+
tools: [fileEditingPanelTools[2]]
|
|
1622
|
+
// openMarkdownTool
|
|
1623
|
+
},
|
|
1624
|
+
component: MDXEditorPanel,
|
|
1625
|
+
onMount: async (context) => {
|
|
1626
|
+
var _a;
|
|
1627
|
+
console.log(
|
|
1628
|
+
"MDX Editor Panel mounted",
|
|
1629
|
+
(_a = context.currentScope.repository) == null ? void 0 : _a.path
|
|
1630
|
+
);
|
|
1631
|
+
},
|
|
1632
|
+
onUnmount: async (_context) => {
|
|
1633
|
+
console.log("MDX Editor Panel unmounting");
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
];
|
|
1637
|
+
const onPackageLoad = async () => {
|
|
1638
|
+
console.log("Panel package loaded - File Editing Panels");
|
|
1639
|
+
};
|
|
1640
|
+
const onPackageUnload = async () => {
|
|
1641
|
+
console.log("Panel package unloading - File Editing Panels");
|
|
1642
|
+
};
|
|
14
1643
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1644
|
+
FileEditorPanel,
|
|
1645
|
+
FileEditorPanelPreview,
|
|
1646
|
+
GitDiffPanel,
|
|
1647
|
+
GitDiffPanelPreview,
|
|
1648
|
+
MDXEditorPanel,
|
|
1649
|
+
MDXEditorPanelPreview,
|
|
1650
|
+
fileEditingPanelTools,
|
|
1651
|
+
fileEditingPanelToolsMetadata,
|
|
1652
|
+
onPackageLoad,
|
|
1653
|
+
onPackageUnload,
|
|
1654
|
+
openFileTool,
|
|
1655
|
+
openMarkdownTool,
|
|
1656
|
+
panels,
|
|
1657
|
+
viewDiffTool
|
|
29
1658
|
};
|
|
30
1659
|
//# sourceMappingURL=panels.bundle.js.map
|