@marimo-team/islands 0.16.4 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedDataExplorerComponent-CCjhPKMy.js → ConnectedDataExplorerComponent-DJEUH6Bb.js} +78 -100
- package/dist/{_baseIsEqual-oN7pRNcM.js → _baseIsEqual-CN4oFUZ4.js} +20 -20
- package/dist/{_basePickBy-CYvzhRjy.js → _basePickBy-CzSvE_-f.js} +3 -3
- package/dist/{_baseProperty-DGUdIBuu.js → _baseProperty-DbbUiyUD.js} +5 -5
- package/dist/{_baseUniq-B5gfSl8S.js → _baseUniq-DwoC-LVO.js} +4 -4
- package/dist/any-language-editor-CEXn1vFs.js +156 -0
- package/dist/apl-DuVfHsPc.js +4 -0
- package/dist/architecture-O4VJ6CD3-lp-opOaL.js +21 -0
- package/dist/{architectureDiagram-W76B3OCA-DkEhipkW.js → architectureDiagram-W76B3OCA-CoBORy6u.js} +34 -34
- package/dist/asciiarmor-qIVWsi4F.js +4 -0
- package/dist/asn1-BjPqARr7.js +4 -0
- package/dist/assets/__vite-browser-external-lX-sn9m2.js +1 -0
- package/dist/assets/worker-vPn7gxWj.js +54 -0
- package/dist/{blockDiagram-QIGZ2CNN-DZOqLMYa.js → blockDiagram-QIGZ2CNN-0yzoLIar.js} +75 -86
- package/dist/brainfuck-DPGTVfkE.js +4 -0
- package/dist/{button-CEcjneWG.js → button-DcnBVpVa.js} +11 -14
- package/dist/{c4Diagram-FPNF74CW-DVaR7c9q.js → c4Diagram-FPNF74CW-CKsIA_DD.js} +27 -51
- package/dist/{channel-Uh0KpgGW.js → channel-3LVvQZcD.js} +1 -1
- package/dist/{check-BK9zDfQk.js → check-D7ifz5op.js} +1 -1
- package/dist/{chunk-3AY6CYHV-Dk2R2-S1.js → chunk-3AY6CYHV-B2C-aVc3.js} +35 -35
- package/dist/{chunk-4BX2VUAB-CqO6zUIz.js → chunk-4BX2VUAB-DEd4VI9L.js} +1 -1
- package/dist/{chunk-4KMFLZZN-CloTfTwP.js → chunk-4KMFLZZN-DnvP3O4K.js} +216 -325
- package/dist/{chunk-55IACEB6-I0rmqTua.js → chunk-55IACEB6-BcCzwOOl.js} +1 -1
- package/dist/{chunk-6OXUPJBA-BuROSTmo.js → chunk-6OXUPJBA-eNAAfJ3Q.js} +7 -7
- package/dist/{chunk-7GE3RBXV-B1-tsIPP.js → chunk-7GE3RBXV-CSAeQvLz.js} +1 -1
- package/dist/{chunk-ABZYJK2D-CLlso8tj.js → chunk-ABZYJK2D-CZcb_1iM.js} +16 -20
- package/dist/{chunk-BN7GFLIU-Db2-FjLn.js → chunk-BN7GFLIU-pBc5O5Rh.js} +1 -1
- package/dist/{chunk-CVBHYZKI-BONeiloK.js → chunk-CVBHYZKI-CivHZg9P.js} +3 -3
- package/dist/{chunk-CXMOBAN2-U9GJSP1d.js → chunk-CXMOBAN2-Dd0E6qb0.js} +46 -54
- package/dist/chunk-EXTU4WIE-GQ2ZWfJo.js +10 -0
- package/dist/{chunk-FMBD7UC4-DyV3BR_I.js → chunk-FMBD7UC4-C6YcisV6.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-C9A1076P.js → chunk-JA3XYJ7Z-DYeQaT57.js} +21 -25
- package/dist/{chunk-JEIROHC2-BGnFkSVq.js → chunk-JEIROHC2-B-EZMP4V.js} +1 -1
- package/dist/{chunk-K7UQS3LO-033LOsjK.js → chunk-K7UQS3LO-DENzlS-M.js} +7 -7
- package/dist/{chunk-KMC2YHZD-DT4Sq4Ld.js → chunk-KMC2YHZD-SckhHdEh.js} +1 -1
- package/dist/{chunk-QN33PNHL-gs44MZla.js → chunk-QN33PNHL-Cjq5b604.js} +2 -2
- package/dist/{chunk-QYVHNE3D-B8BO1AnT.js → chunk-QYVHNE3D-CNUuivie.js} +3 -4
- package/dist/{chunk-QZHKN3VN-CeN_GkU6.js → chunk-QZHKN3VN-DugEU_bA.js} +1 -1
- package/dist/chunk-S3R3BYOJ-itCT6Vif.js +380 -0
- package/dist/{chunk-T44TD3VJ-BwzD6YE0.js → chunk-T44TD3VJ-BLdfTX8J.js} +1 -1
- package/dist/{chunk-TVAH2DTR-Bi6jpQJQ.js → chunk-TVAH2DTR-BOnwF9d8.js} +7 -8
- package/dist/{chunk-TZMSLE5B-D8klz2H_.js → chunk-TZMSLE5B-DGs66AlL.js} +4 -5
- package/dist/{chunk-WFRQ32O7-CzSwSlN0.js → chunk-WFRQ32O7-CPsipkmJ.js} +1 -1
- package/dist/{chunk-WFWHJNB7-DN_cavM6.js → chunk-WFWHJNB7-Cmed18Pk.js} +1 -1
- package/dist/{chunk-XRWGC2XP-Bb5eGNM2.js → chunk-XRWGC2XP-DH5GDaY8.js} +1 -1
- package/dist/{chunk-ZPAFE4SF-S5UYNb0V.js → chunk-ZPAFE4SF-DPDwaqZm.js} +22 -22
- package/dist/classDiagram-KNZD7YFC-azuS_99k.js +39 -0
- package/dist/classDiagram-v2-RKCZMP56-CQpyQQOR.js +39 -0
- package/dist/{click-outside-container-DE4e7p1p.js → click-outside-container-CL_FkgGY.js} +7 -12
- package/dist/{clike-CxAz4p9E.js → clike-DYfRWWXk.js} +1 -1
- package/dist/{clike-Cg_DBrJ0.js → clike-bzZTreP4.js} +1 -1
- package/dist/clojure-ATksAecl.js +4 -0
- package/dist/{clone-Dk4FkKH0.js → clone-Msbhmn2a.js} +1 -1
- package/dist/cmake-CWylaz2C.js +4 -0
- package/dist/cobol-BiLLCZIQ.js +4 -0
- package/dist/coffeescript-Ca4jipi8.js +4 -0
- package/dist/commonlisp-BwFjyEC7.js +4 -0
- package/dist/{constants-Cjd_3kwd.js → constants-BCOEQoEQ.js} +3 -3
- package/dist/{copy-C5RFg7ok.js → copy-BkZ8PkBM.js} +6 -2
- package/dist/{cose-bilkent-S5V4N54A-B3iOTGu5.js → cose-bilkent-S5V4N54A-BZnbwyVD.js} +20 -20
- package/dist/crystal-BhUsQHbh.js +4 -0
- package/dist/css-Cf4wlIyV.js +5 -0
- package/dist/cypher-Dj8Hzgxa.js +4 -0
- package/dist/{cytoscape.esm-DTDV0Nbj.js → cytoscape.esm-BTpRoPd2.js} +586 -661
- package/dist/d-DZI7tbTy.js +4 -0
- package/dist/{dagre-5GWH7T2D-KM4Z11yT.js → dagre-5GWH7T2D-BGaiSZZO.js} +32 -37
- package/dist/{dagre-B0u1urxE.js → dagre-pyfDIOWJ.js} +57 -76
- package/dist/data-grid-overlay-editor-867aBz0Y.js +133 -0
- package/dist/{diagram-N5W7TBWH-CtO7az4G.js → diagram-N5W7TBWH-CzLE0jZB.js} +35 -51
- package/dist/diagram-QEK2KX5R-AGS60xEZ.js +245 -0
- package/dist/{diagram-S2PKOQOG-CiXElLNQ.js → diagram-S2PKOQOG-BxRoG6yW.js} +28 -28
- package/dist/diff-WQISUHG5.js +4 -0
- package/dist/{dist-CdE2C2In.js → dist-2Ne-33Xy.js} +15 -20
- package/dist/{dist-DKFaZRVk.js → dist-B0YD1aXi.js} +2 -2
- package/dist/{dist-DBhzmFyH.js → dist-B1Dv8Sdk.js} +3 -3
- package/dist/{dist-CGIZPq3J.js → dist-BFkr6kAQ.js} +2 -2
- package/dist/{dist-DL_ci7Yc.js → dist-BL2DSY0P.js} +1 -1
- package/dist/dist-BawZu0ix.js +10 -0
- package/dist/{dist-Bar1QnNM.js → dist-BhVFggab.js} +3 -3
- package/dist/{textile-Cy55fYGC.js → dist-BiOF7987.js} +4 -2
- package/dist/{dist-BQmQQqFH.js → dist-BpzZrRd6.js} +1 -1
- package/dist/{dist-CxD5E6Sh.js → dist-C7zhQ7K0.js} +24 -22
- package/dist/{dist-BqgkUnEN.js → dist-CBhnQKQ4.js} +3 -3
- package/dist/{dist-Dzk1C8l5.js → dist-CId4IPXu.js} +10 -13
- package/dist/{dist-CUnh_3Ii.js → dist-CYhQCVru.js} +2 -2
- package/dist/{dist-BBlFk9ki.js → dist-CZq5-ZyD.js} +1 -1
- package/dist/{dist-elblfNXO.js → dist-Cacac5HV.js} +2 -2
- package/dist/{dist-CChOkSUg.js → dist-CfQHSIQC.js} +3 -3
- package/dist/{dist-JCAky9ND.js → dist-CkvGMBAS.js} +17 -22
- package/dist/dist-Cs3McXEj.js +6 -0
- package/dist/{dist-o7fhJC7U.js → dist-CvyfRaIr.js} +3 -3
- package/dist/{dist-CZfRM7pE.js → dist-D-3fICwh.js} +2 -2
- package/dist/dist-D3aaithT.js +6 -0
- package/dist/{dist-CutXTm8t.js → dist-DBhEu3-F.js} +1 -1
- package/dist/dist-DELcMSpJ.js +6 -0
- package/dist/{dist-C7ASiFxI.js → dist-DMxl6Qbu.js} +273 -263
- package/dist/{dist-CLvpViod.js → dist-DS6nuHYK.js} +2 -3
- package/dist/dist-Dgts3WXd.js +6 -0
- package/dist/{dist--I6Htnlv.js → dist-DlHkZUnY.js} +5 -5
- package/dist/dist-Doiq_KIP.js +15 -0
- package/dist/dist-DtpUiDG_.js +6 -0
- package/dist/{dist-DzOpMdwb.js → dist-NUdHX0XE.js} +4 -4
- package/dist/{dist-C3WYsf4K.js → dist-PGgOcwbF.js} +4 -10
- package/dist/{dist-DNnYAdRE.js → dist-RdxOJbBw.js} +2 -2
- package/dist/{dist-BEvIw5Nh.js → dist-RwqAqkpG.js} +1 -1
- package/dist/dist-ZjnJq_jD.js +10 -0
- package/dist/{dist-CbRkrKrP.js → dist-biZ846D9.js} +5 -5
- package/dist/{dist-DW9er3Zq.js → dist-d5NxvX2s.js} +44 -23
- package/dist/{dist-C3QUag__.js → dist-ivwkJchV.js} +3 -3
- package/dist/dist-mof3iuBu.js +12 -0
- package/dist/{dist-Cib4sGDA.js → dist-reo2kYlN.js} +2 -2
- package/dist/{dist-BZBitvuL.js → dist-wHVprCkn.js} +1 -1
- package/dist/{dist-C5zMs_n5.js → dist-y8uoXYaE.js} +3 -3
- package/dist/{dist-DPF5TTUg.js → dist-z_iuDES7.js} +126 -115
- package/dist/{dockerfile-Dum_1b-5.js → dockerfile-sZMPcXVY.js} +1 -1
- package/dist/dtd-B2M8dhfC.js +4 -0
- package/dist/dylan-CU3Vt8SC.js +4 -0
- package/dist/ecl-B8ESAVq4.js +4 -0
- package/dist/eiffel-DDfMIKeA.js +4 -0
- package/dist/elm-Bj6rj8jf.js +4 -0
- package/dist/{erDiagram-AWTI2OKA-ZTIl9iQO.js → erDiagram-AWTI2OKA-CTxzb-U8.js} +20 -20
- package/dist/erlang-BxyshZUq.js +4 -0
- package/dist/{error-banner-OQIGTqFR.js → error-banner-npbEfanI.js} +13 -13
- package/dist/{esm-DxFkg7a6.js → esm-BdiY4QsX.js} +1528 -1492
- package/dist/{esm-d0g2RsOH.js → esm-CAWW9sum.js} +6 -8
- package/dist/{esm-1_Mp6VD2.js → esm-YY5zh7KV.js} +324 -395
- package/dist/{esm-BO9n_s6u.js → esm-svAVli9f.js} +5 -5
- package/dist/{factor-CdgiDGiu.js → factor-CRFTmP_a.js} +1 -1
- package/dist/factor-CYk6XT8r.js +5 -0
- package/dist/{flowDiagram-PVAE7QVJ-DsbofOzu.js → flowDiagram-PVAE7QVJ-Dck2hiJe.js} +22 -22
- package/dist/{formats-D5C6JAJf.js → formats-BnqXUb1V.js} +13 -17
- package/dist/forth-fcoJkd-f.js +4 -0
- package/dist/fortran-IxZHu4wc.js +4 -0
- package/dist/{fullscreen-D1yTiBlu.js → fullscreen-blsKUrtN.js} +741 -744
- package/dist/{ganttDiagram-OWAHRB6G-FnCH1Yj3.js → ganttDiagram-OWAHRB6G-AWzfzpup.js} +9 -9
- package/dist/gas-B8rmKcim.js +4 -0
- package/dist/gherkin-BTm-jIdJ.js +4 -0
- package/dist/gitGraph-ZV4HHKMB-DFg_OLQb.js +21 -0
- package/dist/{gitGraphDiagram-NY62KEGX-B0wvMNqU.js → gitGraphDiagram-NY62KEGX-GyNboWSV.js} +31 -34
- package/dist/{glide-data-editor-CYfKmSNp.js → glide-data-editor-DHuN8kQ8.js} +1701 -1771
- package/dist/{graphlib-BGmr7CYF.js → graphlib-hb3zmtVD.js} +5 -5
- package/dist/groovy-01kRHFMD.js +4 -0
- package/dist/haskell-B3PhE05w.js +4 -0
- package/dist/haxe-DEoAm8oA.js +5 -0
- package/dist/{hotkeys-yFrUwyJK.js → hotkeys-Ct2T3e9O.js} +4 -7
- package/dist/idl-DsDJU9cV.js +4 -0
- package/dist/info-63CPKGFF-D3DZmDBa.js +21 -0
- package/dist/infoDiagram-STP46IZ2-ec08vi_U.js +44 -0
- package/dist/{isArrayLikeObject-DiDsNamC.js → isArrayLikeObject-BlvK28do.js} +3 -5
- package/dist/{isEmpty-BBG-u1GM.js → isEmpty--odfYjh1.js} +2 -2
- package/dist/{isSymbol-BxF-_8BA.js → isSymbol-Cb1f2HgO.js} +1 -1
- package/dist/{javascript-Dfq1qI35.js → javascript-BfCTmOnk.js} +2 -2
- package/dist/javascript-gwczVhuU.js +5 -0
- package/dist/jinja2-AkZRdFk3.js +4 -0
- package/dist/{journeyDiagram-BIP6EPQ6-B3PotfAW.js → journeyDiagram-BIP6EPQ6-TmXYCUbT.js} +23 -24
- package/dist/julia-_s6qe3bf.js +4 -0
- package/dist/{kanban-definition-6OIFK2YF-BTrQZ3LN.js → kanban-definition-6OIFK2YF-B6ozleHo.js} +15 -15
- package/dist/{katex-dN__NFdn.js → katex-mPzRsXEy.js} +1 -1
- package/dist/{katex-BE4xflfm.js → katex-mkWmhPUh.js} +149 -173
- package/dist/{label-BinTsX-u.js → label-VVRKZmrP.js} +21 -24
- package/dist/{linear-DyTdUIqX.js → linear-iebAbJVD.js} +1 -1
- package/dist/livescript-CwPHQdv5.js +4 -0
- package/dist/{loader-Dijti3y4.js → loader-CM0VALo9.js} +19 -26
- package/dist/lua-s7nRxkCP.js +4 -0
- package/dist/main.js +8234 -8633
- package/dist/{marked.esm-3RjvXPoO.js → marked.esm-DJM8la36.js} +5 -5
- package/dist/mathematica-Ci36yd1q.js +4 -0
- package/dist/mbox-DbOYMNCO.js +4 -0
- package/dist/{memoize-Dq87l1O_.js → memoize-DYoRBSLn.js} +1 -1
- package/dist/{merge-BPDCIm8P.js → merge-BjuR6j_w.js} +1 -1
- package/dist/{mermaid-BlJDcO4M.js → mermaid-YPPMBmhk.js} +58 -76
- package/dist/{mermaid-parser.core-CSFx6MQ7.js → mermaid-parser.core-BLkyTSZj.js} +8 -8
- package/dist/{mhchem-DZ68WS0G.js → mhchem-Dw7wvXtr.js} +1 -1
- package/dist/{min-BzhKOmZo.js → min-B_i2ahn4.js} +7 -7
- package/dist/{mindmap-definition-Q6HEUPPD-9hhnrO1k.js → mindmap-definition-Q6HEUPPD-F6-JnXwq.js} +17 -17
- package/dist/mirc-VmNe8AwF.js +4 -0
- package/dist/mllike-BdD7SJEa.js +6 -0
- package/dist/modelica-BA4VqzC3.js +4 -0
- package/dist/mscgen-DF-5WHJm.js +6 -0
- package/dist/mumps-c_Uia_QN.js +4 -0
- package/dist/{node-sql-parser-13oju30e.js → node-sql-parser-BqKV-TpL.js} +14343 -14351
- package/dist/{now-DVBcRCoE.js → now-CwRqw0nS.js} +1 -1
- package/dist/nsis-BAANGODV.js +5 -0
- package/dist/{nsis-BW6_XagK.js → nsis-BWJEeUyS.js} +1 -1
- package/dist/ntriples-Bslqh2Ki.js +4 -0
- package/dist/{number-overlay-editor-D1YdiOrm.js → number-overlay-editor-CeyruAX4.js} +17 -23
- package/dist/octave-DYn5ltia.js +4 -0
- package/dist/oz-B_N-StZq.js +4 -0
- package/dist/packet-HUATNLJX-CkqjFdAv.js +21 -0
- package/dist/pascal-DU4CtAUu.js +4 -0
- package/dist/perl-Bae6k32u.js +4 -0
- package/dist/pie-WTHONI2E-D0rWwX5P.js +21 -0
- package/dist/{pieDiagram-ADFJNKIX-CSBC0ZgF.js → pieDiagram-ADFJNKIX-C5dSQVCn.js} +28 -28
- package/dist/pig-DSIxUEgX.js +4 -0
- package/dist/powershell-31lcPgIF.js +4 -0
- package/dist/powershell-BZx53Ujw.js +236 -0
- package/dist/properties-lmYbntDG.js +4 -0
- package/dist/protobuf-BTYoCEpV.js +4 -0
- package/dist/pug-DMFM7zzO.js +5 -0
- package/dist/{pug-Bmups_z0.js → pug-PJh82u1M.js} +1 -1
- package/dist/puppet-B0ub07d-.js +4 -0
- package/dist/python-C4jT87Nt.js +5 -0
- package/dist/{q-BzWcnVri.js → q-CMoUHJ5Q.js} +3 -2
- package/dist/q-YbPYlqRI.js +4 -0
- package/dist/{quadrantDiagram-LMRXKWRM-h7nHf8xG.js → quadrantDiagram-LMRXKWRM-DlahxNiy.js} +7 -7
- package/dist/r-OfNu6HAI.js +4 -0
- package/dist/radar-NJJJXTRR-Bxqv4O5a.js +21 -0
- package/dist/{range-CgK0-PEw.js → range-DxfkexCE.js} +3 -3
- package/dist/{react-plotly-BZakcxdv.js → react-plotly-D_IAfR8f.js} +4364 -4705
- package/dist/{requirementDiagram-4UW4RH46-BGEurQYq.js → requirementDiagram-4UW4RH46-DTkinyvU.js} +17 -17
- package/dist/rpm-D_3b5peD.js +5 -0
- package/dist/ruby-CehsJy_T.js +4 -0
- package/dist/{sankeyDiagram-GR3RE2ED-CxeJ_jfl.js → sankeyDiagram-GR3RE2ED-CsLnEnnq.js} +3 -3
- package/dist/sas-DwQHzPoF.js +4 -0
- package/dist/scheme-B6ArxiQu.js +4 -0
- package/dist/{sequenceDiagram-C3RYC4MD-CbFxwyr_.js → sequenceDiagram-C3RYC4MD-BdEOR6SC.js} +20 -30
- package/dist/shell-AHmQgDfc.js +4 -0
- package/dist/sieve-CgodKOcx.js +4 -0
- package/dist/{simple-mode-Cgyya8F-.js → simple-mode-BP3Jd4vf.js} +1 -1
- package/dist/{slides-component-BEyG25AH.js → slides-component-2bbal1YJ.js} +24 -46
- package/dist/smalltalk-BeFzDkbo.js +4 -0
- package/dist/sparql-BWxq-Lnx.js +4 -0
- package/dist/{src-BNNJRxz3.js → src-DZkaBUmt.js} +6 -6
- package/dist/{stateDiagram-KXAO66HF-A61bMf29.js → stateDiagram-KXAO66HF-DQLH2jhP.js} +39 -41
- package/dist/stateDiagram-v2-UMBNRL4Z-D9v8fKjF.js +38 -0
- package/dist/stex-Dvaq0qsm.js +5 -0
- package/dist/style.css +1 -1
- package/dist/stylus-Ge0ofWlZ.js +4 -0
- package/dist/swift-CjQfbVxV.js +4 -0
- package/dist/tcl-CAGDF11K.js +4 -0
- package/dist/textile-CrXreJtf.js +4 -0
- package/dist/{time-D3tzCqJ6.js → time-CFkXkVrt.js} +1 -1
- package/dist/{timeline-definition-XQNQX7LJ-BwdsB7CR.js → timeline-definition-XQNQX7LJ-bToVq14i.js} +4 -5
- package/dist/{timer-D3Zlu9ow.js → timer-CzOhIJuk.js} +2 -2
- package/dist/{toNumber-efKT08hh.js → toNumber-EFF1Z9T1.js} +2 -2
- package/dist/{toString-BvCd3yJc.js → toString-C2mCkasT.js} +2 -2
- package/dist/toml-AdLXKwEi.js +4 -0
- package/dist/{toml-CIUkU1CP.js → toml-eSl4PUAH.js} +6 -2
- package/dist/treemap-75Q7IDZK-Da9Jv6a_.js +21 -0
- package/dist/troff-C-LaM2ex.js +4 -0
- package/dist/ttcn-DTclUi6T.js +4 -0
- package/dist/ttcn-cfg-BtBPbmLX.js +4 -0
- package/dist/turtle-BODDDg5O.js +4 -0
- package/dist/{types-Dcb1hf55.js → types-CRXV0KD5.js} +385 -252
- package/dist/{useAsyncData-DAtPzJzP.js → useAsyncData-uMVTsDI9.js} +1 -1
- package/dist/{useDateFormatter-CiUlIu7v.js → useDateFormatter-Dcz7jstn.js} +6 -6
- package/dist/{useTheme-CmsvrO5o.js → useTheme-NbEx-ZNV.js} +14 -10
- package/dist/vb-Cb1HQHii.js +4 -0
- package/dist/vbscript-CpXOP4wZ.js +4 -0
- package/dist/{vega-component-B3LA6qbm.js → vega-component-hegVmfuS.js} +21 -21
- package/dist/{vega-loader.browser.module-Bi3ttvdj.js → vega-loader.browser.module-DcW8jnKp.js} +1 -2
- package/dist/velocity-Dz0rBQIk.js +4 -0
- package/dist/verilog-6Di9aLKw.js +4 -0
- package/dist/vhdl-BRNesXYc.js +4 -0
- package/dist/webidl-BpRNYIYn.js +4 -0
- package/dist/xquery-DXWcJ7b6.js +4 -0
- package/dist/{xychartDiagram-6GGTOJPD-BJRRi5HC.js → xychartDiagram-6GGTOJPD-C7Bhm_yt.js} +12 -13
- package/dist/yacas-DbSARPz4.js +4 -0
- package/dist/z80-DzslPj_l.js +4 -0
- package/dist/{zod-UPQf9SGn.js → zod-ChY6miG5.js} +71 -81
- package/package.json +12 -12
- package/src/__mocks__/requests.ts +2 -0
- package/src/__tests__/chat-history.test.ts +123 -0
- package/src/components/app-config/ai-config.tsx +23 -0
- package/src/components/app-config/mcp-config.tsx +42 -2
- package/src/components/app-config/user-config-form.tsx +29 -49
- package/src/components/chat/acp/__tests__/context-utils.test.ts +1 -1
- package/src/components/chat/acp/agent-panel.tsx +1 -1
- package/src/components/chat/acp/blocks.tsx +46 -53
- package/src/components/chat/acp/common.tsx +1 -1
- package/src/components/chat/acp/context-utils.ts +1 -1
- package/src/components/chat/acp/session-tabs.tsx +1 -1
- package/src/components/chat/chat-history-popover.tsx +125 -0
- package/src/components/chat/chat-history-utils.ts +69 -0
- package/src/components/chat/chat-panel.tsx +9 -57
- package/src/components/chat/chat-utils.ts +11 -4
- package/src/components/data-table/__tests__/header-items.test.tsx +117 -0
- package/src/components/data-table/column-header.tsx +4 -2
- package/src/components/data-table/columns.tsx +2 -1
- package/src/components/data-table/data-table.tsx +7 -2
- package/src/components/data-table/header-items.tsx +63 -10
- package/src/components/dependency-graph/custom-node.tsx +11 -11
- package/src/components/dependency-graph/elements.ts +9 -4
- package/src/components/dependency-graph/panels.tsx +6 -4
- package/src/components/editor/Output.tsx +6 -1
- package/src/components/editor/__tests__/data-attributes.test.tsx +1 -1
- package/src/components/editor/actions/useNotebookActions.tsx +2 -4
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +23 -31
- package/src/components/editor/ai/ai-completion-editor.tsx +135 -5
- package/src/components/editor/ai/completion-handlers.tsx +106 -22
- package/src/components/editor/cell/CreateCellButton.tsx +14 -2
- package/src/components/editor/cell/code/cell-editor.tsx +6 -0
- package/src/components/editor/chrome/panels/cache-panel.tsx +216 -0
- package/src/components/editor/chrome/panels/empty-state.tsx +3 -1
- package/src/components/editor/chrome/types.ts +66 -22
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +2 -0
- package/src/components/editor/database/schemas.ts +2 -10
- package/src/components/editor/errors/auto-fix.tsx +138 -32
- package/src/components/editor/errors/fix-mode.ts +15 -0
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +0 -5
- package/src/components/editor/navigation/clipboard.ts +2 -1
- package/src/components/editor/{Cell.tsx → notebook-cell.tsx} +25 -8
- package/src/components/editor/output/ConsoleOutput.tsx +27 -33
- package/src/components/editor/output/JsonOutput.tsx +9 -0
- package/src/components/editor/output/MarimoErrorOutput.tsx +4 -34
- package/src/components/editor/output/MarimoTracebackOutput.tsx +10 -7
- package/src/components/editor/output/__tests__/json-output.test.ts +43 -0
- package/src/components/editor/package-alert.tsx +3 -0
- package/src/components/editor/renderers/{CellArray.tsx → cell-array.tsx} +1 -1
- package/src/components/forms/__tests__/form-utils.test.ts +6 -4
- package/src/components/icons/copy-icon.tsx +11 -5
- package/src/components/mcp/hooks.ts +48 -0
- package/src/components/mcp/mcp-status-indicator.tsx +144 -0
- package/src/components/shortcuts/renderShortcut.tsx +3 -1
- package/src/components/ui/button.tsx +2 -0
- package/src/components/ui/confirmation-button.tsx +85 -0
- package/src/components/ui/number-field.tsx +4 -1
- package/src/components/ui/switch.tsx +2 -0
- package/src/core/ai/context/providers/__tests__/__snapshots__/tables.test.ts.snap +13 -19
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +0 -1
- package/src/core/ai/context/providers/__tests__/datasource.test.ts +14 -7
- package/src/core/ai/context/providers/__tests__/error.test.ts +24 -15
- package/src/core/ai/context/providers/cell-output.ts +5 -5
- package/src/core/ai/context/providers/common.ts +13 -4
- package/src/core/ai/context/providers/datasource.ts +56 -21
- package/src/core/ai/context/providers/error.ts +3 -4
- package/src/core/ai/context/providers/file.ts +2 -2
- package/src/core/ai/context/providers/tables.ts +36 -8
- package/src/core/ai/context/providers/variable.ts +2 -3
- package/src/core/ai/state.ts +6 -3
- package/src/core/ai/tools/__tests__/registry.test.ts +33 -8
- package/src/core/ai/tools/base.ts +81 -1
- package/src/core/ai/tools/registry.ts +36 -10
- package/src/core/ai/tools/sample-tool.ts +44 -8
- package/src/core/cache/requests.ts +5 -0
- package/src/core/cells/__tests__/cells.test.ts +6 -6
- package/src/core/cells/cells.ts +13 -14
- package/src/core/cells/scrollCellIntoView.ts +1 -1
- package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +2 -0
- package/src/core/codemirror/__tests__/replace-editor-content.test.ts +336 -0
- package/src/core/codemirror/__tests__/setup.test.ts +1 -0
- package/src/core/codemirror/cm.ts +3 -2
- package/src/core/codemirror/find-replace/navigate.ts +2 -2
- package/src/core/codemirror/format.ts +2 -9
- package/src/core/codemirror/language/__tests__/sql.test.ts +24 -6
- package/src/core/codemirror/language/languages/python.ts +1 -3
- package/src/core/codemirror/language/languages/sql/sql.ts +23 -13
- package/src/core/codemirror/language/panel/panel.tsx +1 -6
- package/src/core/codemirror/language/utils.ts +3 -8
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +21 -14
- package/src/core/codemirror/lsp/federated-lsp.ts +20 -9
- package/src/core/codemirror/lsp/notebook-lsp.ts +35 -29
- package/src/core/codemirror/lsp/types.ts +0 -13
- package/src/core/codemirror/replace-editor-content.ts +87 -0
- package/src/core/config/__tests__/config-schema.test.ts +5 -0
- package/src/core/config/config-schema.ts +10 -0
- package/src/core/config/feature-flag.tsx +2 -6
- package/src/core/edit-app.tsx +1 -1
- package/src/core/errors/__tests__/errors.test.ts +1 -0
- package/src/core/errors/errors.ts +20 -6
- package/src/core/islands/bridge.ts +2 -0
- package/src/core/islands/main.ts +4 -0
- package/src/core/kernel/messages.ts +1 -0
- package/src/core/network/CachingRequestRegistry.ts +2 -2
- package/src/core/network/requests-network.ts +14 -0
- package/src/core/network/requests-static.ts +2 -0
- package/src/core/network/requests-toasting.ts +2 -0
- package/src/core/network/types.ts +5 -0
- package/src/core/saving/save-component.tsx +43 -36
- package/src/core/wasm/bridge.ts +2 -0
- package/src/core/websocket/useMarimoWebSocket.tsx +8 -0
- package/src/css/app/codemirror-completions.css +1 -1
- package/src/custom.d.ts +2 -0
- package/src/plugins/core/registerReactComponent.tsx +5 -1
- package/src/plugins/impl/DataTablePlugin.tsx +19 -19
- package/src/plugins/impl/__tests__/DateTimePickerPlugin.test.tsx +32 -0
- package/src/plugins/impl/chat/ChatPlugin.tsx +1 -1
- package/src/plugins/impl/chat/chat-ui.tsx +17 -2
- package/src/plugins/impl/chat/types.ts +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +7 -2
- package/src/plugins/impl/plotly/__tests__/parse-from-template.test.ts +17 -0
- package/src/plugins/impl/plotly/parse-from-template.ts +2 -1
- package/src/stories/cell.stories.tsx +1 -1
- package/src/stories/layout/vertical/one-column.stories.tsx +1 -1
- package/src/utils/__tests__/formatting.test.ts +107 -0
- package/src/utils/__tests__/json-parser.test.ts +13 -0
- package/src/utils/copy.ts +6 -0
- package/src/utils/formatting.ts +51 -0
- package/src/utils/json/json-parser.ts +28 -3
- package/src/utils/numbers.ts +24 -1
- package/dist/any-language-editor-CVFQlioK.js +0 -156
- package/dist/apl-ChlaBfxB.js +0 -4
- package/dist/architecture-O4VJ6CD3-BVeaxUcM.js +0 -21
- package/dist/asciiarmor-CcJmm3l_.js +0 -4
- package/dist/asn1-ThRYxoBE.js +0 -4
- package/dist/assets/__vite-browser-external-BeNtI_tJ.js +0 -1
- package/dist/assets/worker-DnuXpGWN.js +0 -54
- package/dist/brainfuck-CEM0JgDn.js +0 -4
- package/dist/chunk-EXTU4WIE-DECT9AAK.js +0 -14
- package/dist/chunk-S3R3BYOJ-DMQ1yeyq.js +0 -386
- package/dist/classDiagram-KNZD7YFC-BG53O6Jt.js +0 -39
- package/dist/classDiagram-v2-RKCZMP56-BmKILsGU.js +0 -39
- package/dist/clojure-B7RHyE9t.js +0 -4
- package/dist/cmake-TeTMP4I5.js +0 -4
- package/dist/cobol-DI-mxUER.js +0 -4
- package/dist/coffeescript-DHUFLqWp.js +0 -4
- package/dist/commonlisp-SLiUrh1m.js +0 -4
- package/dist/crystal-B4fY1ZfJ.js +0 -4
- package/dist/css-Bdoq3TzK.js +0 -5
- package/dist/cypher-CBU182fp.js +0 -4
- package/dist/d-D8myDZeH.js +0 -4
- package/dist/data-grid-overlay-editor-qNmJk2x0.js +0 -135
- package/dist/diagram-QEK2KX5R-fu8Noi3H.js +0 -245
- package/dist/diff-DJF_UB7H.js +0 -4
- package/dist/dist-52-_pKoy.js +0 -6
- package/dist/dist-6DOMStFn.js +0 -6
- package/dist/dist-B334aW7p.js +0 -10
- package/dist/dist-BOI9lUz-.js +0 -12
- package/dist/dist-C06uhBzF.js +0 -6
- package/dist/dist-CGkpguCB.js +0 -6
- package/dist/dist-CrApzUED.js +0 -6
- package/dist/dist-Dp2GLdCl.js +0 -14
- package/dist/dist-WHFsbMDr.js +0 -6
- package/dist/dist-hyKcTPG9.js +0 -10
- package/dist/dtd-DY8q65lC.js +0 -4
- package/dist/dylan-CBLcjWCi.js +0 -4
- package/dist/ecl-BSXPNfOw.js +0 -4
- package/dist/eiffel-BJf0PQX-.js +0 -4
- package/dist/elm-DWQwPCZS.js +0 -4
- package/dist/erlang-BWBaGZ5e.js +0 -4
- package/dist/factor-DT1-MBPl.js +0 -5
- package/dist/forth-D9GDt3FB.js +0 -4
- package/dist/fortran-DHkRhDWw.js +0 -4
- package/dist/gas-7lQEOM0H.js +0 -4
- package/dist/gherkin-BLLyroYi.js +0 -4
- package/dist/gitGraph-ZV4HHKMB-z2v_cInC.js +0 -21
- package/dist/groovy-C-wabwj0.js +0 -4
- package/dist/haskell-DaxVQ_d1.js +0 -4
- package/dist/haxe-C2yLoC7h.js +0 -5
- package/dist/idl-DQBP8i7k.js +0 -4
- package/dist/info-63CPKGFF-GS4w6pCB.js +0 -21
- package/dist/infoDiagram-STP46IZ2-DE9YYPFg.js +0 -44
- package/dist/javascript-DRwFV9r5.js +0 -5
- package/dist/jinja2-CNoIpVmN.js +0 -4
- package/dist/julia-DXDf-GhP.js +0 -4
- package/dist/livescript-S2uhJQx7.js +0 -4
- package/dist/lua-Bvgs0y2G.js +0 -4
- package/dist/mathematica-D2zqfwIg.js +0 -4
- package/dist/mbox-SBcPaDuZ.js +0 -4
- package/dist/mirc-hkQc7sVF.js +0 -4
- package/dist/mllike-DRWPBlr9.js +0 -6
- package/dist/modelica-CO2ROGlP.js +0 -4
- package/dist/mscgen-BpX61bO6.js +0 -6
- package/dist/mumps-BCnFeIn6.js +0 -4
- package/dist/nsis-BaTOxlD1.js +0 -5
- package/dist/ntriples-zEo5BWjr.js +0 -4
- package/dist/octave-BE0RnCM9.js +0 -4
- package/dist/oz-C4_2Ttul.js +0 -4
- package/dist/packet-HUATNLJX-CjHqJIqk.js +0 -21
- package/dist/pascal-Q3jJucpw.js +0 -4
- package/dist/perl-DkXZIWHF.js +0 -4
- package/dist/pie-WTHONI2E-D67gLWtR.js +0 -21
- package/dist/pig-DCgEHdsu.js +0 -4
- package/dist/powershell-3rK_nRRJ.js +0 -236
- package/dist/powershell-Eo2-7MoM.js +0 -4
- package/dist/properties-C0IOX8WR.js +0 -4
- package/dist/protobuf--lGQUSRO.js +0 -4
- package/dist/pug-Cf8AQHMJ.js +0 -5
- package/dist/puppet-D7Z3dTJn.js +0 -4
- package/dist/python-FHIx_i8Y.js +0 -5
- package/dist/q-B7UA1feM.js +0 -4
- package/dist/r-Cc9R2A7N.js +0 -4
- package/dist/radar-NJJJXTRR-C-AZP_Te.js +0 -21
- package/dist/rpm-vhJNlrQ6.js +0 -5
- package/dist/ruby-CVluPY0M.js +0 -4
- package/dist/sas-A8DL8oy3.js +0 -4
- package/dist/scheme-6xHHcSXC.js +0 -4
- package/dist/shell-DHN-e5rf.js +0 -4
- package/dist/sieve-BuQwLY02.js +0 -4
- package/dist/smalltalk-BA4HPg2H.js +0 -4
- package/dist/sparql-Bf4yCuy3.js +0 -4
- package/dist/stateDiagram-v2-UMBNRL4Z-C_0FUzzk.js +0 -38
- package/dist/stex-D-I1cYeE.js +0 -5
- package/dist/stylus-BMeped2l.js +0 -4
- package/dist/swift-lwEdlZoC.js +0 -4
- package/dist/tcl-B03ipeqv.js +0 -4
- package/dist/toml-BLgrVtfu.js +0 -4
- package/dist/treemap-75Q7IDZK-DTvwfpWt.js +0 -21
- package/dist/troff-g6EjN2O2.js +0 -4
- package/dist/ttcn-Dzvba8jK.js +0 -4
- package/dist/ttcn-cfg-CadG0p1K.js +0 -4
- package/dist/turtle-DkXAMWo9.js +0 -4
- package/dist/vb-C5dCiel8.js +0 -4
- package/dist/vbscript-I4bDEQln.js +0 -4
- package/dist/velocity-mt0fDwFH.js +0 -4
- package/dist/verilog-Dxq3KJkc.js +0 -4
- package/dist/vhdl-Km0QUlV-.js +0 -4
- package/dist/webidl-B3lJ2MRL.js +0 -4
- package/dist/xquery-CcIxNPEe.js +0 -4
- package/dist/yacas-oMa-f-tN.js +0 -4
- package/dist/z80-D03Nvn6l.js +0 -4
- /package/dist/{apl-DZqo8Elt.js → apl-CEHentF4.js} +0 -0
- /package/dist/{asciiarmor-DTzHAIeX.js → asciiarmor-DURYiCS0.js} +0 -0
- /package/dist/{asn1-DrAXKsZH.js → asn1-ETAiEoXY.js} +0 -0
- /package/dist/{asterisk-oF4U3h48.js → asterisk-DTpbbXPb.js} +0 -0
- /package/dist/{brainfuck-BYgLey30.js → brainfuck-BWQep-SA.js} +0 -0
- /package/dist/{clojure-Bs2M3OUY.js → clojure-BzFapDkA.js} +0 -0
- /package/dist/{cmake-DpI8vxJN.js → cmake-DvlbIC8x.js} +0 -0
- /package/dist/{cobol-BQyrWo72.js → cobol-BrEI4cPR.js} +0 -0
- /package/dist/{coffeescript-9ke9UHmw.js → coffeescript-B6cvu8mO.js} +0 -0
- /package/dist/{common-keywords-BzgeAvH1.js → common-keywords-WqQm7W8t.js} +0 -0
- /package/dist/{commonlisp-DghUdrUH.js → commonlisp-BIT8PQqi.js} +0 -0
- /package/dist/{crystal-DEf_SInh.js → crystal-B_UcPArT.js} +0 -0
- /package/dist/{css-BzTU9lNO.js → css-dHbnt_zl.js} +0 -0
- /package/dist/{cypher-a2v0c11S.js → cypher-Dh3FOpL7.js} +0 -0
- /package/dist/{d-SAswny-M.js → d-CQD1IHee.js} +0 -0
- /package/dist/{diff-OJ-xLXcG.js → diff-CpF_IDx0.js} +0 -0
- /package/dist/{dtd-BsUf-rer.js → dtd-DYoNpy6c.js} +0 -0
- /package/dist/{duckdb-keywords-B0NOra5o.js → duckdb-keywords-CdIsl9L0.js} +0 -0
- /package/dist/{dylan-C0ZYngjn.js → dylan-Bc_2G1E-.js} +0 -0
- /package/dist/{ebnf-DF1xx0b_.js → ebnf-jGVT_YpN.js} +0 -0
- /package/dist/{ecl-Bsuvoouq.js → ecl-UIU-P-Ar.js} +0 -0
- /package/dist/{eiffel-DgfSpLi-.js → eiffel-C90Oyuix.js} +0 -0
- /package/dist/{elm-GNxDj-5E.js → elm-B9fWSySj.js} +0 -0
- /package/dist/{erlang-Ds3uY1kL.js → erlang-Ccff0UAn.js} +0 -0
- /package/dist/{fcl-CqBgSioc.js → fcl-CGR8NxAg.js} +0 -0
- /package/dist/{forth-JCaLysGk.js → forth-U1ROGcBY.js} +0 -0
- /package/dist/{fortran-Dc2AoKAl.js → fortran-3nOkjDmc.js} +0 -0
- /package/dist/{gas-Q4Uz82YW.js → gas-B_4H5FzV.js} +0 -0
- /package/dist/{gherkin-Dpxe49sQ.js → gherkin-B0eru5Uz.js} +0 -0
- /package/dist/{groovy-D8mTRCu6.js → groovy-dqjtZUVf.js} +0 -0
- /package/dist/{haskell-2_8cC4wY.js → haskell-DFzCCQzo.js} +0 -0
- /package/dist/{haxe-Bl9zkZlz.js → haxe-Da8Pj5RT.js} +0 -0
- /package/dist/{http-DKCqY6yS.js → http-1HACL_9s.js} +0 -0
- /package/dist/{idl-Dn-HNfGW.js → idl-D3NXs5iM.js} +0 -0
- /package/dist/{jinja2-JjFiAGKk.js → jinja2-gBHAxUdF.js} +0 -0
- /package/dist/{julia-R5wne8eu.js → julia-bG-6nJ-_.js} +0 -0
- /package/dist/{livescript-DSwokrYj.js → livescript-BlsRC8UJ.js} +0 -0
- /package/dist/{lua-CgXfrp2-.js → lua-BbDC0_5w.js} +0 -0
- /package/dist/{mathematica-BVli92MR.js → mathematica-YZTe3-PF.js} +0 -0
- /package/dist/{mbox-CMFlocdS.js → mbox-CY5idp08.js} +0 -0
- /package/dist/{mirc-BkW04Zpc.js → mirc-CbQuFZKk.js} +0 -0
- /package/dist/{mllike-DEjvHvNV.js → mllike-DsbHMX-5.js} +0 -0
- /package/dist/{modelica-CxDn-oje.js → modelica-CQuvsOQk.js} +0 -0
- /package/dist/{mscgen-D78wmE-w.js → mscgen-LIpBP9VR.js} +0 -0
- /package/dist/{mumps-Bi0IvPOV.js → mumps-Ct5NXoaG.js} +0 -0
- /package/dist/{nginx-DErPZFhX.js → nginx-Dvc62C8z.js} +0 -0
- /package/dist/{ntriples-Btyp6wRL.js → ntriples-jVkxWUuv.js} +0 -0
- /package/dist/{octave-CZA6-2F8.js → octave-jGOImUB0.js} +0 -0
- /package/dist/{oz-Bm6LSNfE.js → oz-Y0FKDMS2.js} +0 -0
- /package/dist/{pascal-B4J6a9BH.js → pascal-BaLtPWWB.js} +0 -0
- /package/dist/{perl-CzVqxS08.js → perl-CjfE0JLo.js} +0 -0
- /package/dist/{pig-Clh03cnn.js → pig-DE4epV99.js} +0 -0
- /package/dist/{properties-D7ch1Wyb.js → properties-CLyCG5C-.js} +0 -0
- /package/dist/{protobuf-DrkdrMPK.js → protobuf-BjBBs_V4.js} +0 -0
- /package/dist/{puppet-BtZG8zdO.js → puppet-ZImLuomA.js} +0 -0
- /package/dist/{python-B6FKOVIv.js → python-C9YN71pR.js} +0 -0
- /package/dist/{r-Dnvo5-96.js → r-DILmKWWW.js} +0 -0
- /package/dist/{rpm-B1DrgfnX.js → rpm-fpIsm1Kr.js} +0 -0
- /package/dist/{ruby-CelfUg17.js → ruby-BuiQI41h.js} +0 -0
- /package/dist/{sas-DfSQFMWG.js → sas-C76sJ1zF.js} +0 -0
- /package/dist/{scheme-BplhaWuO.js → scheme-DHjM-txv.js} +0 -0
- /package/dist/{shell-DqU5OS2c.js → shell--7NmGJ9p.js} +0 -0
- /package/dist/{sieve-BE4_IyGa.js → sieve-DaPvBv1M.js} +0 -0
- /package/dist/{smalltalk-B_WPL8Nx.js → smalltalk-KPvwrjCs.js} +0 -0
- /package/dist/{solr-DlJFg7H5.js → solr-PvZUtEDb.js} +0 -0
- /package/dist/{sparql-7XIlcOgW.js → sparql-CXSUIQer.js} +0 -0
- /package/dist/{spreadsheet-BdZSVwVp.js → spreadsheet-DPJdGPkx.js} +0 -0
- /package/dist/{sql-CCrq7lfJ.js → sql-Dp4ZLSIa.js} +0 -0
- /package/dist/{stex-BiFc8QAu.js → stex-CeXW4zzk.js} +0 -0
- /package/dist/{stylus-DlSH9xpH.js → stylus-BXcmrg9w.js} +0 -0
- /package/dist/{swift-e3tMTZgJ.js → swift-DD8I7hKP.js} +0 -0
- /package/dist/{tcl-DfZMC20G.js → tcl-B9Lp4GtA.js} +0 -0
- /package/dist/{textile-DaSeca5U.js → textile-qdiY0teq.js} +0 -0
- /package/dist/{tiddlywiki-dfoiz8pS.js → tiddlywiki-t32lkubq.js} +0 -0
- /package/dist/{tiki-yJbQzhma.js → tiki-B0qKrSMl.js} +0 -0
- /package/dist/{troff-FN_FrCXR.js → troff-105XJOEu.js} +0 -0
- /package/dist/{ttcn-7_i4HlyB.js → ttcn-1_BxDcM8.js} +0 -0
- /package/dist/{ttcn-cfg-B46AlBUV.js → ttcn-cfg-Cn_XgXiw.js} +0 -0
- /package/dist/{turtle-QQfeFveR.js → turtle-BI6LyfEu.js} +0 -0
- /package/dist/{vb-DToPVnLa.js → vb-BecoBfmr.js} +0 -0
- /package/dist/{vbscript-CtsNaTz4.js → vbscript-De-zpA4i.js} +0 -0
- /package/dist/{velocity-CAoNe6ns.js → velocity-DhlYJTrD.js} +0 -0
- /package/dist/{verilog-DrDOMiJq.js → verilog-BDZgxDOW.js} +0 -0
- /package/dist/{vhdl-DnO0OEPh.js → vhdl-CV0OKTbp.js} +0 -0
- /package/dist/{webidl-Or6d1ZfA.js → webidl-BOM1Fs0O.js} +0 -0
- /package/dist/{xquery-CEp_Mcpr.js → xquery-CltP_CGh.js} +0 -0
- /package/dist/{yacas-DgnYrSlp.js → yacas-Dch4E2Dg.js} +0 -0
- /package/dist/{z80-DlG_kyeB.js → z80-B5Yly27o.js} +0 -0
|
@@ -1,268 +1,267 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-DgPTj83v.js";
|
|
2
2
|
import { t as require_react } from "./react-DHL_F5hS.js";
|
|
3
3
|
import { n as require_compiler_runtime, t as require_jsx_runtime } from "./jsx-runtime-DZyWJV5b.js";
|
|
4
|
-
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-
|
|
5
|
-
import { t as Check } from "./check-
|
|
6
|
-
import { d as cn, u as Events } from "./button-
|
|
7
|
-
import { c as Tooltip } from "./error-banner-
|
|
8
|
-
import { $ as ViewPlugin, A as indentString, At as RangeSet, B as tags, Bt as countColumn, C as foldKeymap, Ct as CharCategory, D as getIndentation, Dt as Facet, E as getIndentUnit, Et as EditorState, F as syntaxHighlighting, Ft as Text, H as NodeProp, Ht as fromCodePoint, I as syntaxTree, It as Transaction, J as parseMixed, Lt as codePointAt, N as matchBrackets, Nt as StateEffect, O as indentNodeProp, Pt as StateField, R as Tag, Rt as codePointSize, S as foldInside, St as ChangeSet, Tt as EditorSelection, Vt as findClusterBreak, X as Direction, Y as Decoration, Z as EditorView, _t as showPanel, a as HighlightStyle, bt as Annotation, ct as highlightActiveLineGutter, dt as keymap, et as WidgetType, f as StreamLanguage, ft as lineNumbers, g as defaultHighlightStyle, gt as runScopeHandlers, h as continuedIndent, ht as rectangularSelection, it as getPanel, j as indentUnit, jt as RangeSetBuilder, k as indentOnInput, kt as Prec, lt as highlightSpecialChars, mt as placeholder, n as ExternalTokenizer, nt as drawSelection, o as IndentContext, p as bracketMatching, pt as logException, r as LRParser, rt as dropCursor, s as LRLanguage, st as highlightActiveLine, t as ContextTracker, tt as crosshairCursor, u as LanguageSupport, ut as hoverTooltip, v as delimitedIndent, w as foldNodeProp, x as foldGutter, xt as ChangeDesc, yt as crelt, z as styleTags, zt as combineConfig } from "./dist-
|
|
9
|
-
import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-
|
|
10
|
-
import { i as markdown } from "./dist-
|
|
11
|
-
import { n as html, r as htmlCompletionSource } from "./dist-
|
|
12
|
-
import { r as cssLanguage, t as css } from "./dist-
|
|
13
|
-
import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-
|
|
14
|
-
import { r as python } from "./dist-
|
|
15
|
-
import { t as stex } from "./stex-
|
|
16
|
-
import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-
|
|
17
|
-
import { t as cpp } from "./dist-
|
|
18
|
-
import { t as go } from "./dist-
|
|
19
|
-
import { t as java } from "./dist-
|
|
20
|
-
import { t as json } from "./dist-
|
|
21
|
-
import { t as less } from "./dist-
|
|
22
|
-
import { n as liquid } from "./dist-
|
|
23
|
-
import { t as php } from "./dist-
|
|
24
|
-
import { t as rust } from "./dist-
|
|
25
|
-
import { t as sass } from "./dist-
|
|
26
|
-
import { t as wast } from "./dist-
|
|
27
|
-
import { r as xml } from "./dist-
|
|
28
|
-
import { t as yaml } from "./dist-
|
|
29
|
-
import { t as apl } from "./apl-
|
|
30
|
-
import { t as asciiArmor } from "./asciiarmor-
|
|
31
|
-
import { t as asn1 } from "./asn1-
|
|
32
|
-
import { t as brainfuck } from "./brainfuck-
|
|
33
|
-
import { t as cobol } from "./cobol-
|
|
34
|
-
import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-
|
|
35
|
-
import { t as clojure } from "./clojure-
|
|
36
|
-
import { t as gss } from "./css-
|
|
37
|
-
import { t as cmake } from "./cmake-
|
|
38
|
-
import { t as coffeeScript } from "./coffeescript-
|
|
39
|
-
import { t as commonLisp } from "./commonlisp-
|
|
40
|
-
import { t as cypher } from "./cypher-
|
|
41
|
-
import { t as cython } from "./python-
|
|
42
|
-
import { t as crystal } from "./crystal-
|
|
43
|
-
import { t as d } from "./d-
|
|
44
|
-
import { t as diff } from "./diff-
|
|
45
|
-
import { t as dtd } from "./dtd-
|
|
46
|
-
import { t as dylan } from "./dylan-
|
|
47
|
-
import { t as ecl } from "./ecl-
|
|
48
|
-
import { t as eiffel } from "./eiffel-
|
|
49
|
-
import { t as elm } from "./elm-
|
|
50
|
-
import { t as erlang } from "./erlang-
|
|
51
|
-
import { t as factor } from "./factor-
|
|
52
|
-
import { t as forth } from "./forth-
|
|
53
|
-
import { t as fortran } from "./fortran-
|
|
54
|
-
import { n as oCaml, r as sml, t as fSharp } from "./mllike-
|
|
55
|
-
import { t as gas } from "./gas-
|
|
56
|
-
import { t as gherkin } from "./gherkin-
|
|
57
|
-
import { t as groovy } from "./groovy-
|
|
58
|
-
import { t as haskell } from "./haskell-
|
|
59
|
-
import { n as hxml, t as haxe } from "./haxe-
|
|
60
|
-
import { t as idl } from "./idl-
|
|
61
|
-
import { n as jsonld } from "./javascript-
|
|
62
|
-
import { t as jinja2 } from "./jinja2-
|
|
63
|
-
import { t as julia } from "./julia-
|
|
64
|
-
import { t as liveScript } from "./livescript-
|
|
65
|
-
import { t as lua } from "./lua-
|
|
66
|
-
import { t as mirc } from "./mirc-
|
|
67
|
-
import { t as mathematica } from "./mathematica-
|
|
68
|
-
import { t as modelica } from "./modelica-
|
|
69
|
-
import { t as mumps } from "./mumps-
|
|
70
|
-
import { t as mbox } from "./mbox-
|
|
71
|
-
import { t as nsis } from "./nsis-
|
|
72
|
-
import { t as ntriples } from "./ntriples-
|
|
73
|
-
import { t as octave } from "./octave-
|
|
74
|
-
import { t as oz } from "./oz-
|
|
75
|
-
import { t as pascal } from "./pascal-
|
|
76
|
-
import { t as perl } from "./perl-
|
|
77
|
-
import { t as pig } from "./pig-
|
|
78
|
-
import { t as powerShell } from "./powershell-
|
|
79
|
-
import { t as properties } from "./properties-
|
|
80
|
-
import { t as protobuf } from "./protobuf-
|
|
81
|
-
import { t as pug } from "./pug-
|
|
82
|
-
import { t as puppet } from "./puppet-
|
|
83
|
-
import { t as q } from "./q-
|
|
84
|
-
import { t as r } from "./r-
|
|
85
|
-
import { n as rpmSpec } from "./rpm-
|
|
86
|
-
import { t as ruby } from "./ruby-
|
|
87
|
-
import { t as sas } from "./sas-
|
|
88
|
-
import { t as scheme } from "./scheme-
|
|
89
|
-
import { t as shell } from "./shell
|
|
90
|
-
import { t as sieve } from "./sieve-
|
|
91
|
-
import { t as smalltalk } from "./smalltalk-
|
|
92
|
-
import { t as sparql } from "./sparql-
|
|
93
|
-
import { t as stylus } from "./stylus-
|
|
94
|
-
import { t as swift } from "./swift-
|
|
95
|
-
import { t as verilog } from "./verilog-
|
|
96
|
-
import { t as tcl } from "./tcl-
|
|
97
|
-
import { t as textile } from "./textile-
|
|
98
|
-
import { t as toml } from "./toml-
|
|
99
|
-
import { t as troff } from "./troff-
|
|
100
|
-
import { t as ttcn } from "./ttcn-
|
|
101
|
-
import { t as ttcnCfg } from "./ttcn-cfg-
|
|
102
|
-
import { t as turtle } from "./turtle-
|
|
103
|
-
import { t as webIDL } from "./webidl-
|
|
104
|
-
import { t as vb } from "./vb-
|
|
105
|
-
import { t as vbScript } from "./vbscript-
|
|
106
|
-
import { t as velocity } from "./velocity-
|
|
107
|
-
import { t as vhdl } from "./vhdl-
|
|
108
|
-
import { t as xQuery } from "./xquery-
|
|
109
|
-
import { t as yacas } from "./yacas-
|
|
110
|
-
import { t as z80 } from "./z80-
|
|
111
|
-
import { n as msgenny, r as xu, t as mscgen } from "./mscgen-
|
|
112
|
-
import { t as vue } from "./dist-
|
|
4
|
+
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BkZ8PkBM.js";
|
|
5
|
+
import { t as Check } from "./check-D7ifz5op.js";
|
|
6
|
+
import { d as cn, u as Events } from "./button-DcnBVpVa.js";
|
|
7
|
+
import { c as Tooltip } from "./error-banner-npbEfanI.js";
|
|
8
|
+
import { $ as ViewPlugin, A as indentString, At as RangeSet, B as tags, Bt as countColumn, C as foldKeymap, Ct as CharCategory, D as getIndentation, Dt as Facet, E as getIndentUnit, Et as EditorState, F as syntaxHighlighting, Ft as Text, H as NodeProp, Ht as fromCodePoint, I as syntaxTree, It as Transaction, J as parseMixed, Lt as codePointAt, N as matchBrackets, Nt as StateEffect, O as indentNodeProp, Pt as StateField, R as Tag, Rt as codePointSize, S as foldInside, St as ChangeSet, Tt as EditorSelection, Vt as findClusterBreak, X as Direction, Y as Decoration, Z as EditorView, _t as showPanel, a as HighlightStyle, bt as Annotation, ct as highlightActiveLineGutter, dt as keymap, et as WidgetType, f as StreamLanguage, ft as lineNumbers, g as defaultHighlightStyle, gt as runScopeHandlers, h as continuedIndent, ht as rectangularSelection, it as getPanel, j as indentUnit, jt as RangeSetBuilder, k as indentOnInput, kt as Prec, lt as highlightSpecialChars, mt as placeholder, n as ExternalTokenizer, nt as drawSelection, o as IndentContext, p as bracketMatching, pt as logException, r as LRParser, rt as dropCursor, s as LRLanguage, st as highlightActiveLine, t as ContextTracker, tt as crosshairCursor, u as LanguageSupport, ut as hoverTooltip, v as delimitedIndent, w as foldNodeProp, x as foldGutter, xt as ChangeDesc, yt as crelt, z as styleTags, zt as combineConfig } from "./dist-z_iuDES7.js";
|
|
9
|
+
import { a as closeBracketsKeymap, c as completionKeymap, f as snippetCompletion, i as closeBrackets, l as ifNotIn, r as autocompletion, s as completeFromList } from "./dist-C7zhQ7K0.js";
|
|
10
|
+
import { i as markdown } from "./dist-d5NxvX2s.js";
|
|
11
|
+
import { n as html, r as htmlCompletionSource } from "./dist-2Ne-33Xy.js";
|
|
12
|
+
import { r as cssLanguage, t as css } from "./dist-RwqAqkpG.js";
|
|
13
|
+
import { c as typescriptLanguage, n as javascript, r as javascriptLanguage, u as parser$1 } from "./dist-CYhQCVru.js";
|
|
14
|
+
import { r as python } from "./dist-PGgOcwbF.js";
|
|
15
|
+
import { t as stex } from "./stex-CeXW4zzk.js";
|
|
16
|
+
import { a as PLSQL, f as sql, l as StandardSQL, t as Cassandra } from "./dist-DMxl6Qbu.js";
|
|
17
|
+
import { t as cpp } from "./dist-BpzZrRd6.js";
|
|
18
|
+
import { t as go } from "./dist-reo2kYlN.js";
|
|
19
|
+
import { t as java } from "./dist-CZq5-ZyD.js";
|
|
20
|
+
import { t as json } from "./dist-DBhEu3-F.js";
|
|
21
|
+
import { t as less } from "./dist-Cacac5HV.js";
|
|
22
|
+
import { n as liquid } from "./dist-BFkr6kAQ.js";
|
|
23
|
+
import { t as php } from "./dist-RdxOJbBw.js";
|
|
24
|
+
import { t as rust } from "./dist-BL2DSY0P.js";
|
|
25
|
+
import { t as sass } from "./dist-NUdHX0XE.js";
|
|
26
|
+
import { t as wast } from "./dist-wHVprCkn.js";
|
|
27
|
+
import { r as xml } from "./dist-CkvGMBAS.js";
|
|
28
|
+
import { t as yaml } from "./dist-DS6nuHYK.js";
|
|
29
|
+
import { t as apl } from "./apl-CEHentF4.js";
|
|
30
|
+
import { t as asciiArmor } from "./asciiarmor-DURYiCS0.js";
|
|
31
|
+
import { t as asn1 } from "./asn1-ETAiEoXY.js";
|
|
32
|
+
import { t as brainfuck } from "./brainfuck-BWQep-SA.js";
|
|
33
|
+
import { t as cobol } from "./cobol-BrEI4cPR.js";
|
|
34
|
+
import { c as squirrel, i as kotlin, n as csharp, o as objectiveCpp, r as dart, s as scala } from "./clike-bzZTreP4.js";
|
|
35
|
+
import { t as clojure } from "./clojure-BzFapDkA.js";
|
|
36
|
+
import { t as gss } from "./css-dHbnt_zl.js";
|
|
37
|
+
import { t as cmake } from "./cmake-DvlbIC8x.js";
|
|
38
|
+
import { t as coffeeScript } from "./coffeescript-B6cvu8mO.js";
|
|
39
|
+
import { t as commonLisp } from "./commonlisp-BIT8PQqi.js";
|
|
40
|
+
import { t as cypher } from "./cypher-Dh3FOpL7.js";
|
|
41
|
+
import { t as cython } from "./python-C9YN71pR.js";
|
|
42
|
+
import { t as crystal } from "./crystal-B_UcPArT.js";
|
|
43
|
+
import { t as d } from "./d-CQD1IHee.js";
|
|
44
|
+
import { t as diff } from "./diff-CpF_IDx0.js";
|
|
45
|
+
import { t as dtd } from "./dtd-DYoNpy6c.js";
|
|
46
|
+
import { t as dylan } from "./dylan-Bc_2G1E-.js";
|
|
47
|
+
import { t as ecl } from "./ecl-UIU-P-Ar.js";
|
|
48
|
+
import { t as eiffel } from "./eiffel-C90Oyuix.js";
|
|
49
|
+
import { t as elm } from "./elm-B9fWSySj.js";
|
|
50
|
+
import { t as erlang } from "./erlang-Ccff0UAn.js";
|
|
51
|
+
import { t as factor } from "./factor-CRFTmP_a.js";
|
|
52
|
+
import { t as forth } from "./forth-U1ROGcBY.js";
|
|
53
|
+
import { t as fortran } from "./fortran-3nOkjDmc.js";
|
|
54
|
+
import { n as oCaml, r as sml, t as fSharp } from "./mllike-DsbHMX-5.js";
|
|
55
|
+
import { t as gas } from "./gas-B_4H5FzV.js";
|
|
56
|
+
import { t as gherkin } from "./gherkin-B0eru5Uz.js";
|
|
57
|
+
import { t as groovy } from "./groovy-dqjtZUVf.js";
|
|
58
|
+
import { t as haskell } from "./haskell-DFzCCQzo.js";
|
|
59
|
+
import { n as hxml, t as haxe } from "./haxe-Da8Pj5RT.js";
|
|
60
|
+
import { t as idl } from "./idl-D3NXs5iM.js";
|
|
61
|
+
import { n as jsonld } from "./javascript-BfCTmOnk.js";
|
|
62
|
+
import { t as jinja2 } from "./jinja2-gBHAxUdF.js";
|
|
63
|
+
import { t as julia } from "./julia-bG-6nJ-_.js";
|
|
64
|
+
import { t as liveScript } from "./livescript-BlsRC8UJ.js";
|
|
65
|
+
import { t as lua } from "./lua-BbDC0_5w.js";
|
|
66
|
+
import { t as mirc } from "./mirc-CbQuFZKk.js";
|
|
67
|
+
import { t as mathematica } from "./mathematica-YZTe3-PF.js";
|
|
68
|
+
import { t as modelica } from "./modelica-CQuvsOQk.js";
|
|
69
|
+
import { t as mumps } from "./mumps-Ct5NXoaG.js";
|
|
70
|
+
import { t as mbox } from "./mbox-CY5idp08.js";
|
|
71
|
+
import { t as nsis } from "./nsis-BWJEeUyS.js";
|
|
72
|
+
import { t as ntriples } from "./ntriples-jVkxWUuv.js";
|
|
73
|
+
import { t as octave } from "./octave-jGOImUB0.js";
|
|
74
|
+
import { t as oz } from "./oz-Y0FKDMS2.js";
|
|
75
|
+
import { t as pascal } from "./pascal-BaLtPWWB.js";
|
|
76
|
+
import { t as perl } from "./perl-CjfE0JLo.js";
|
|
77
|
+
import { t as pig } from "./pig-DE4epV99.js";
|
|
78
|
+
import { t as powerShell } from "./powershell-BZx53Ujw.js";
|
|
79
|
+
import { t as properties } from "./properties-CLyCG5C-.js";
|
|
80
|
+
import { t as protobuf } from "./protobuf-BjBBs_V4.js";
|
|
81
|
+
import { t as pug } from "./pug-PJh82u1M.js";
|
|
82
|
+
import { t as puppet } from "./puppet-ZImLuomA.js";
|
|
83
|
+
import { t as q } from "./q-CMoUHJ5Q.js";
|
|
84
|
+
import { t as r } from "./r-DILmKWWW.js";
|
|
85
|
+
import { n as rpmSpec } from "./rpm-fpIsm1Kr.js";
|
|
86
|
+
import { t as ruby } from "./ruby-BuiQI41h.js";
|
|
87
|
+
import { t as sas } from "./sas-C76sJ1zF.js";
|
|
88
|
+
import { t as scheme } from "./scheme-DHjM-txv.js";
|
|
89
|
+
import { t as shell } from "./shell--7NmGJ9p.js";
|
|
90
|
+
import { t as sieve } from "./sieve-DaPvBv1M.js";
|
|
91
|
+
import { t as smalltalk } from "./smalltalk-KPvwrjCs.js";
|
|
92
|
+
import { t as sparql } from "./sparql-CXSUIQer.js";
|
|
93
|
+
import { t as stylus } from "./stylus-BXcmrg9w.js";
|
|
94
|
+
import { t as swift } from "./swift-DD8I7hKP.js";
|
|
95
|
+
import { t as verilog } from "./verilog-BDZgxDOW.js";
|
|
96
|
+
import { t as tcl } from "./tcl-B9Lp4GtA.js";
|
|
97
|
+
import { t as textile } from "./textile-qdiY0teq.js";
|
|
98
|
+
import { t as toml } from "./toml-eSl4PUAH.js";
|
|
99
|
+
import { t as troff } from "./troff-105XJOEu.js";
|
|
100
|
+
import { t as ttcn } from "./ttcn-1_BxDcM8.js";
|
|
101
|
+
import { t as ttcnCfg } from "./ttcn-cfg-Cn_XgXiw.js";
|
|
102
|
+
import { t as turtle } from "./turtle-BI6LyfEu.js";
|
|
103
|
+
import { t as webIDL } from "./webidl-BOM1Fs0O.js";
|
|
104
|
+
import { t as vb } from "./vb-BecoBfmr.js";
|
|
105
|
+
import { t as vbScript } from "./vbscript-De-zpA4i.js";
|
|
106
|
+
import { t as velocity } from "./velocity-DhlYJTrD.js";
|
|
107
|
+
import { t as vhdl } from "./vhdl-CV0OKTbp.js";
|
|
108
|
+
import { t as xQuery } from "./xquery-CltP_CGh.js";
|
|
109
|
+
import { t as yacas } from "./yacas-Dch4E2Dg.js";
|
|
110
|
+
import { t as z80 } from "./z80-B5Yly27o.js";
|
|
111
|
+
import { n as msgenny, r as xu, t as mscgen } from "./mscgen-LIpBP9VR.js";
|
|
112
|
+
import { t as vue } from "./dist-BhVFggab.js";
|
|
113
113
|
var import_compiler_runtime = /* @__PURE__ */ __toESM(require_compiler_runtime()), import_react = /* @__PURE__ */ __toESM(require_react()), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
|
|
114
114
|
const CopyClipboardIcon = (e6) => {
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
A(true), setTimeout(() => A(false), 2e3), O && toast({ title: O });
|
|
115
|
+
let y = (0, import_compiler_runtime.c)(13), { value: b, className: x, tooltip: k, toastTitle: A, ariaLabel: j } = e6, [M, N] = (0, import_react.useState)(false), P;
|
|
116
|
+
y[0] !== A || y[1] !== b ? (P = Events.stopPropagation(async (e7) => {
|
|
117
|
+
await copyToClipboard(typeof b == "function" ? b(e7) : b).then(() => {
|
|
118
|
+
N(true), setTimeout(() => N(false), 2e3), A && toast({ title: A });
|
|
120
119
|
});
|
|
121
|
-
}),
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
let
|
|
125
|
-
|
|
120
|
+
}), y[0] = A, y[1] = b, y[2] = P) : P = y[2];
|
|
121
|
+
let F = P, I = j ?? "Copy to clipboard", L;
|
|
122
|
+
y[3] !== x || y[4] !== M ? (L = M ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(x, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: x }), y[3] = x, y[4] = M, y[5] = L) : L = y[5];
|
|
123
|
+
let R;
|
|
124
|
+
y[6] !== F || y[7] !== I || y[8] !== L ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
126
125
|
type: "button",
|
|
127
|
-
onClick:
|
|
128
|
-
"aria-label":
|
|
129
|
-
children:
|
|
130
|
-
}),
|
|
131
|
-
let
|
|
132
|
-
if (
|
|
133
|
-
let
|
|
134
|
-
return
|
|
135
|
-
content:
|
|
126
|
+
onClick: F,
|
|
127
|
+
"aria-label": I,
|
|
128
|
+
children: L
|
|
129
|
+
}), y[6] = F, y[7] = I, y[8] = L, y[9] = R) : R = y[9];
|
|
130
|
+
let z = R;
|
|
131
|
+
if (k === false) return z;
|
|
132
|
+
let B = M ? "Copied!" : k ?? "Copy to clipboard", V;
|
|
133
|
+
return y[10] !== z || y[11] !== B ? (V = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
134
|
+
content: B,
|
|
136
135
|
delayDuration: 400,
|
|
137
|
-
children:
|
|
138
|
-
}),
|
|
136
|
+
children: z
|
|
137
|
+
}), y[10] = z, y[11] = B, y[12] = V) : V = y[12], V;
|
|
139
138
|
};
|
|
140
139
|
var toggleComment = (e6) => {
|
|
141
|
-
let { state:
|
|
142
|
-
return
|
|
140
|
+
let { state: y } = e6, b = y.doc.lineAt(y.selection.main.from), x = getConfig(e6.state, b.from);
|
|
141
|
+
return x.line ? toggleLineComment(e6) : x.block ? toggleBlockCommentByLine(e6) : false;
|
|
143
142
|
};
|
|
144
|
-
function command(e6,
|
|
145
|
-
return ({ state:
|
|
146
|
-
if (
|
|
147
|
-
let
|
|
148
|
-
return
|
|
143
|
+
function command(e6, y) {
|
|
144
|
+
return ({ state: b, dispatch: x }) => {
|
|
145
|
+
if (b.readOnly) return false;
|
|
146
|
+
let S = e6(y, b);
|
|
147
|
+
return S ? (x(b.update(S)), true) : false;
|
|
149
148
|
};
|
|
150
149
|
}
|
|
151
|
-
var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6,
|
|
152
|
-
function getConfig(e6,
|
|
153
|
-
let
|
|
154
|
-
return
|
|
150
|
+
var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e6, y) => changeBlockComment(e6, y, selectedLineRanges(y)), 0);
|
|
151
|
+
function getConfig(e6, y) {
|
|
152
|
+
let b = e6.languageDataAt("commentTokens", y, 1);
|
|
153
|
+
return b.length ? b[0] : {};
|
|
155
154
|
}
|
|
156
155
|
var SearchMargin = 50;
|
|
157
|
-
function findBlockComment(e6, { open:
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
156
|
+
function findBlockComment(e6, { open: y, close: b }, x, S) {
|
|
157
|
+
let C = e6.sliceDoc(x - SearchMargin, x), w = e6.sliceDoc(S, S + SearchMargin), T = /\s*$/.exec(C)[0].length, E = /^\s*/.exec(w)[0].length, D = C.length - T;
|
|
158
|
+
if (C.slice(D - y.length, D) == y && w.slice(E, E + b.length) == b) return {
|
|
160
159
|
open: {
|
|
161
|
-
pos:
|
|
162
|
-
margin:
|
|
160
|
+
pos: x - T,
|
|
161
|
+
margin: T && 1
|
|
163
162
|
},
|
|
164
163
|
close: {
|
|
165
|
-
pos:
|
|
166
|
-
margin:
|
|
164
|
+
pos: S + E,
|
|
165
|
+
margin: E && 1
|
|
167
166
|
}
|
|
168
167
|
};
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
let
|
|
172
|
-
return
|
|
168
|
+
let O, k;
|
|
169
|
+
S - x <= 2 * SearchMargin ? O = k = e6.sliceDoc(x, S) : (O = e6.sliceDoc(x, x + SearchMargin), k = e6.sliceDoc(S - SearchMargin, S));
|
|
170
|
+
let A = /^\s*/.exec(O)[0].length, j = /\s*$/.exec(k)[0].length, M = k.length - j - b.length;
|
|
171
|
+
return O.slice(A, A + y.length) == y && k.slice(M, M + b.length) == b ? {
|
|
173
172
|
open: {
|
|
174
|
-
pos:
|
|
175
|
-
margin: /\s/.test(
|
|
173
|
+
pos: x + A + y.length,
|
|
174
|
+
margin: /\s/.test(O.charAt(A + y.length)) ? 1 : 0
|
|
176
175
|
},
|
|
177
176
|
close: {
|
|
178
|
-
pos:
|
|
179
|
-
margin: /\s/.test(
|
|
177
|
+
pos: S - j - b.length,
|
|
178
|
+
margin: /\s/.test(k.charAt(M - 1)) ? 1 : 0
|
|
180
179
|
}
|
|
181
180
|
} : null;
|
|
182
181
|
}
|
|
183
182
|
function selectedLineRanges(e6) {
|
|
184
|
-
let
|
|
185
|
-
for (let
|
|
186
|
-
let
|
|
187
|
-
|
|
188
|
-
let
|
|
189
|
-
|
|
190
|
-
from:
|
|
191
|
-
to:
|
|
183
|
+
let y = [];
|
|
184
|
+
for (let b of e6.selection.ranges) {
|
|
185
|
+
let x = e6.doc.lineAt(b.from), S = b.to <= x.to ? x : e6.doc.lineAt(b.to);
|
|
186
|
+
S.from > x.from && S.from == b.to && (S = b.to == x.to + 1 ? x : e6.doc.lineAt(b.to - 1));
|
|
187
|
+
let C = y.length - 1;
|
|
188
|
+
C >= 0 && y[C].to > x.from ? y[C].to = S.to : y.push({
|
|
189
|
+
from: x.from + /^\s*/.exec(x.text)[0].length,
|
|
190
|
+
to: S.to
|
|
192
191
|
});
|
|
193
192
|
}
|
|
194
|
-
return
|
|
193
|
+
return y;
|
|
195
194
|
}
|
|
196
|
-
function changeBlockComment(e6,
|
|
197
|
-
let
|
|
198
|
-
if (!
|
|
199
|
-
let
|
|
200
|
-
if (e6 != 2 && !
|
|
195
|
+
function changeBlockComment(e6, y, b = y.selection.ranges) {
|
|
196
|
+
let x = b.map((e7) => getConfig(y, e7.from).block);
|
|
197
|
+
if (!x.every((e7) => e7)) return null;
|
|
198
|
+
let S = b.map((e7, b2) => findBlockComment(y, x[b2], e7.from, e7.to));
|
|
199
|
+
if (e6 != 2 && !S.every((e7) => e7)) return { changes: y.changes(b.map((e7, y2) => S[y2] ? [] : [{
|
|
201
200
|
from: e7.from,
|
|
202
|
-
insert:
|
|
201
|
+
insert: x[y2].open + " "
|
|
203
202
|
}, {
|
|
204
203
|
from: e7.to,
|
|
205
|
-
insert: " " +
|
|
204
|
+
insert: " " + x[y2].close
|
|
206
205
|
}])) };
|
|
207
|
-
if (e6 != 1 &&
|
|
206
|
+
if (e6 != 1 && S.some((e7) => e7)) {
|
|
208
207
|
let e7 = [];
|
|
209
|
-
for (let
|
|
210
|
-
let
|
|
208
|
+
for (let y2 = 0, b2; y2 < S.length; y2++) if (b2 = S[y2]) {
|
|
209
|
+
let S2 = x[y2], { open: C, close: w } = b2;
|
|
211
210
|
e7.push({
|
|
212
|
-
from:
|
|
213
|
-
to:
|
|
211
|
+
from: C.pos - S2.open.length,
|
|
212
|
+
to: C.pos + C.margin
|
|
214
213
|
}, {
|
|
215
|
-
from:
|
|
216
|
-
to:
|
|
214
|
+
from: w.pos - w.margin,
|
|
215
|
+
to: w.pos + S2.close.length
|
|
217
216
|
});
|
|
218
217
|
}
|
|
219
218
|
return { changes: e7 };
|
|
220
219
|
}
|
|
221
220
|
return null;
|
|
222
221
|
}
|
|
223
|
-
function changeLineComment(e6,
|
|
224
|
-
let
|
|
225
|
-
for (let { from: e7, to:
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
228
|
-
for (let
|
|
229
|
-
let
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
let e8 = /^\s*/.exec(
|
|
233
|
-
e8 <
|
|
234
|
-
line:
|
|
235
|
-
comment:
|
|
236
|
-
token:
|
|
222
|
+
function changeLineComment(e6, y, b = y.selection.ranges) {
|
|
223
|
+
let x = [], S = -1;
|
|
224
|
+
for (let { from: e7, to: C } of b) {
|
|
225
|
+
let b2 = x.length, w = 1e9, T = getConfig(y, e7).line;
|
|
226
|
+
if (T) {
|
|
227
|
+
for (let b3 = e7; b3 <= C; ) {
|
|
228
|
+
let E = y.doc.lineAt(b3);
|
|
229
|
+
if (E.from > S && (e7 == C || C > E.from)) {
|
|
230
|
+
S = E.from;
|
|
231
|
+
let e8 = /^\s*/.exec(E.text)[0].length, y2 = e8 == E.length, b4 = E.text.slice(e8, e8 + T.length) == T ? e8 : -1;
|
|
232
|
+
e8 < E.text.length && e8 < w && (w = e8), x.push({
|
|
233
|
+
line: E,
|
|
234
|
+
comment: b4,
|
|
235
|
+
token: T,
|
|
237
236
|
indent: e8,
|
|
238
|
-
empty:
|
|
237
|
+
empty: y2,
|
|
239
238
|
single: false
|
|
240
239
|
});
|
|
241
240
|
}
|
|
242
|
-
|
|
241
|
+
b3 = E.to + 1;
|
|
243
242
|
}
|
|
244
|
-
if (
|
|
245
|
-
|
|
243
|
+
if (w < 1e9) for (let e8 = b2; e8 < x.length; e8++) x[e8].indent < x[e8].line.text.length && (x[e8].indent = w);
|
|
244
|
+
x.length == b2 + 1 && (x[b2].single = true);
|
|
246
245
|
}
|
|
247
246
|
}
|
|
248
|
-
if (e6 != 2 &&
|
|
247
|
+
if (e6 != 2 && x.some((e7) => e7.comment < 0 && (!e7.empty || e7.single))) {
|
|
249
248
|
let e7 = [];
|
|
250
|
-
for (let { line:
|
|
251
|
-
from:
|
|
252
|
-
insert:
|
|
249
|
+
for (let { line: y2, token: b3, indent: S2, empty: C, single: w } of x) (w || !C) && e7.push({
|
|
250
|
+
from: y2.from + S2,
|
|
251
|
+
insert: b3 + " "
|
|
253
252
|
});
|
|
254
|
-
let
|
|
253
|
+
let b2 = y.changes(e7);
|
|
255
254
|
return {
|
|
256
|
-
changes:
|
|
257
|
-
selection:
|
|
255
|
+
changes: b2,
|
|
256
|
+
selection: y.selection.map(b2, 1)
|
|
258
257
|
};
|
|
259
|
-
} else if (e6 != 1 &&
|
|
258
|
+
} else if (e6 != 1 && x.some((e7) => e7.comment >= 0)) {
|
|
260
259
|
let e7 = [];
|
|
261
|
-
for (let { line:
|
|
262
|
-
let
|
|
263
|
-
|
|
264
|
-
from:
|
|
265
|
-
to:
|
|
260
|
+
for (let { line: y2, comment: b2, token: S2 } of x) if (b2 >= 0) {
|
|
261
|
+
let x2 = y2.from + b2, C = x2 + S2.length;
|
|
262
|
+
y2.text[C - y2.from] == " " && C++, e7.push({
|
|
263
|
+
from: x2,
|
|
264
|
+
to: C
|
|
266
265
|
});
|
|
267
266
|
}
|
|
268
267
|
return { changes: e7 };
|
|
@@ -273,26 +272,26 @@ var fromHistory = /* @__PURE__ */ Annotation.define(), isolateHistory = /* @__PU
|
|
|
273
272
|
return combineConfig(e6, {
|
|
274
273
|
minDepth: 100,
|
|
275
274
|
newGroupDelay: 500,
|
|
276
|
-
joinToEvent: (e7,
|
|
275
|
+
joinToEvent: (e7, y) => y
|
|
277
276
|
}, {
|
|
278
277
|
minDepth: Math.max,
|
|
279
278
|
newGroupDelay: Math.min,
|
|
280
|
-
joinToEvent: (e7,
|
|
279
|
+
joinToEvent: (e7, y) => (b, x) => e7(b, x) || y(b, x)
|
|
281
280
|
});
|
|
282
281
|
} }), historyField_ = /* @__PURE__ */ StateField.define({
|
|
283
282
|
create() {
|
|
284
283
|
return HistoryState.empty;
|
|
285
284
|
},
|
|
286
|
-
update(e6,
|
|
287
|
-
let
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
return
|
|
285
|
+
update(e6, y) {
|
|
286
|
+
let b = y.state.facet(historyConfig), x = y.annotation(fromHistory);
|
|
287
|
+
if (x) {
|
|
288
|
+
let S2 = HistEvent.fromTransaction(y, x.selection), C2 = x.side, w2 = C2 == 0 ? e6.undone : e6.done;
|
|
289
|
+
return w2 = S2 ? updateBranch(w2, w2.length, b.minDepth, S2) : addSelection(w2, y.startState.selection), new HistoryState(C2 == 0 ? x.rest : w2, C2 == 0 ? w2 : x.rest);
|
|
291
290
|
}
|
|
292
|
-
let
|
|
293
|
-
if ((
|
|
294
|
-
let
|
|
295
|
-
return
|
|
291
|
+
let S = y.annotation(isolateHistory);
|
|
292
|
+
if ((S == "full" || S == "before") && (e6 = e6.isolate()), y.annotation(Transaction.addToHistory) === false) return y.changes.empty ? e6 : e6.addMapping(y.changes.desc);
|
|
293
|
+
let C = HistEvent.fromTransaction(y), w = y.annotation(Transaction.time), T = y.annotation(Transaction.userEvent);
|
|
294
|
+
return C ? e6 = e6.addChanges(C, w, T, b, y) : y.selection && (e6 = e6.addSelection(y.startState.selection, w, T, b.newGroupDelay)), (S == "full" || S == "after") && (e6 = e6.isolate()), e6;
|
|
296
295
|
},
|
|
297
296
|
toJSON(e6) {
|
|
298
297
|
return {
|
|
@@ -308,28 +307,28 @@ function history(e6 = {}) {
|
|
|
308
307
|
return [
|
|
309
308
|
historyField_,
|
|
310
309
|
historyConfig.of(e6),
|
|
311
|
-
EditorView.domEventHandlers({ beforeinput(e7,
|
|
312
|
-
let
|
|
313
|
-
return
|
|
310
|
+
EditorView.domEventHandlers({ beforeinput(e7, y) {
|
|
311
|
+
let b = e7.inputType == "historyUndo" ? undo : e7.inputType == "historyRedo" ? redo : null;
|
|
312
|
+
return b ? (e7.preventDefault(), b(y)) : false;
|
|
314
313
|
} })
|
|
315
314
|
];
|
|
316
315
|
}
|
|
317
316
|
var historyField = historyField_;
|
|
318
|
-
function cmd(e6,
|
|
319
|
-
return function({ state:
|
|
320
|
-
if (!
|
|
321
|
-
let
|
|
322
|
-
if (!
|
|
323
|
-
let
|
|
324
|
-
return
|
|
317
|
+
function cmd(e6, y) {
|
|
318
|
+
return function({ state: b, dispatch: x }) {
|
|
319
|
+
if (!y && b.readOnly) return false;
|
|
320
|
+
let S = b.field(historyField_, false);
|
|
321
|
+
if (!S) return false;
|
|
322
|
+
let C = S.pop(e6, b, y);
|
|
323
|
+
return C ? (x(C), true) : false;
|
|
325
324
|
};
|
|
326
325
|
}
|
|
327
326
|
var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false), undoSelection = /* @__PURE__ */ cmd(0, true), redoSelection = /* @__PURE__ */ cmd(1, true), HistEvent = class e {
|
|
328
|
-
constructor(e6,
|
|
329
|
-
this.changes = e6, this.effects =
|
|
327
|
+
constructor(e6, y, b, x, S) {
|
|
328
|
+
this.changes = e6, this.effects = y, this.mapped = b, this.startSelection = x, this.selectionsAfter = S;
|
|
330
329
|
}
|
|
331
|
-
setSelAfter(
|
|
332
|
-
return new e(this.changes, this.effects, this.mapped, this.startSelection,
|
|
330
|
+
setSelAfter(y) {
|
|
331
|
+
return new e(this.changes, this.effects, this.mapped, this.startSelection, y);
|
|
333
332
|
}
|
|
334
333
|
toJSON() {
|
|
335
334
|
var _a, _b, _c;
|
|
@@ -340,111 +339,111 @@ var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false),
|
|
|
340
339
|
selectionsAfter: this.selectionsAfter.map((e6) => e6.toJSON())
|
|
341
340
|
};
|
|
342
341
|
}
|
|
343
|
-
static fromJSON(
|
|
344
|
-
return new e(
|
|
342
|
+
static fromJSON(y) {
|
|
343
|
+
return new e(y.changes && ChangeSet.fromJSON(y.changes), [], y.mapped && ChangeDesc.fromJSON(y.mapped), y.startSelection && EditorSelection.fromJSON(y.startSelection), y.selectionsAfter.map(EditorSelection.fromJSON));
|
|
345
344
|
}
|
|
346
|
-
static fromTransaction(
|
|
347
|
-
let
|
|
348
|
-
for (let e6 of
|
|
349
|
-
let
|
|
350
|
-
|
|
345
|
+
static fromTransaction(y, b) {
|
|
346
|
+
let x = none;
|
|
347
|
+
for (let e6 of y.startState.facet(invertedEffects)) {
|
|
348
|
+
let b2 = e6(y);
|
|
349
|
+
b2.length && (x = x.concat(b2));
|
|
351
350
|
}
|
|
352
|
-
return !
|
|
351
|
+
return !x.length && y.changes.empty ? null : new e(y.changes.invert(y.startState.doc), x, void 0, b || y.startState.selection, none);
|
|
353
352
|
}
|
|
354
|
-
static selection(
|
|
355
|
-
return new e(void 0, none, void 0, void 0,
|
|
353
|
+
static selection(y) {
|
|
354
|
+
return new e(void 0, none, void 0, void 0, y);
|
|
356
355
|
}
|
|
357
356
|
};
|
|
358
|
-
function updateBranch(e6,
|
|
359
|
-
let
|
|
360
|
-
return
|
|
357
|
+
function updateBranch(e6, y, b, x) {
|
|
358
|
+
let S = y + 1 > b + 20 ? y - b - 1 : 0, C = e6.slice(S, y);
|
|
359
|
+
return C.push(x), C;
|
|
361
360
|
}
|
|
362
|
-
function isAdjacent(e6,
|
|
363
|
-
let
|
|
364
|
-
return e6.iterChangedRanges((e7,
|
|
365
|
-
for (let e8 = 0; e8 <
|
|
366
|
-
let
|
|
367
|
-
|
|
361
|
+
function isAdjacent(e6, y) {
|
|
362
|
+
let b = [], x = false;
|
|
363
|
+
return e6.iterChangedRanges((e7, y2) => b.push(e7, y2)), y.iterChangedRanges((e7, y2, S, C) => {
|
|
364
|
+
for (let e8 = 0; e8 < b.length; ) {
|
|
365
|
+
let y3 = b[e8++], w = b[e8++];
|
|
366
|
+
C >= y3 && S <= w && (x = true);
|
|
368
367
|
}
|
|
369
|
-
}),
|
|
368
|
+
}), x;
|
|
370
369
|
}
|
|
371
|
-
function eqSelectionShape(e6,
|
|
372
|
-
return e6.ranges.length ==
|
|
370
|
+
function eqSelectionShape(e6, y) {
|
|
371
|
+
return e6.ranges.length == y.ranges.length && e6.ranges.filter((e7, b) => e7.empty != y.ranges[b].empty).length === 0;
|
|
373
372
|
}
|
|
374
|
-
function conc(e6,
|
|
375
|
-
return e6.length ?
|
|
373
|
+
function conc(e6, y) {
|
|
374
|
+
return e6.length ? y.length ? e6.concat(y) : e6 : y;
|
|
376
375
|
}
|
|
377
376
|
var none = [], MaxSelectionsPerEvent = 200;
|
|
378
|
-
function addSelection(e6,
|
|
377
|
+
function addSelection(e6, y) {
|
|
379
378
|
if (e6.length) {
|
|
380
|
-
let
|
|
381
|
-
return
|
|
382
|
-
} else return [HistEvent.selection([
|
|
379
|
+
let b = e6[e6.length - 1], x = b.selectionsAfter.slice(Math.max(0, b.selectionsAfter.length - MaxSelectionsPerEvent));
|
|
380
|
+
return x.length && x[x.length - 1].eq(y) ? e6 : (x.push(y), updateBranch(e6, e6.length - 1, 1e9, b.setSelAfter(x)));
|
|
381
|
+
} else return [HistEvent.selection([y])];
|
|
383
382
|
}
|
|
384
383
|
function popSelection(e6) {
|
|
385
|
-
let
|
|
386
|
-
return
|
|
384
|
+
let y = e6[e6.length - 1], b = e6.slice();
|
|
385
|
+
return b[e6.length - 1] = y.setSelAfter(y.selectionsAfter.slice(0, y.selectionsAfter.length - 1)), b;
|
|
387
386
|
}
|
|
388
|
-
function addMappingToBranch(e6,
|
|
387
|
+
function addMappingToBranch(e6, y) {
|
|
389
388
|
if (!e6.length) return e6;
|
|
390
|
-
let
|
|
391
|
-
for (;
|
|
392
|
-
let
|
|
393
|
-
if (
|
|
394
|
-
let
|
|
395
|
-
return
|
|
396
|
-
} else
|
|
397
|
-
}
|
|
398
|
-
return
|
|
389
|
+
let b = e6.length, x = none;
|
|
390
|
+
for (; b; ) {
|
|
391
|
+
let S = mapEvent(e6[b - 1], y, x);
|
|
392
|
+
if (S.changes && !S.changes.empty || S.effects.length) {
|
|
393
|
+
let y2 = e6.slice(0, b);
|
|
394
|
+
return y2[b - 1] = S, y2;
|
|
395
|
+
} else y = S.mapped, b--, x = S.selectionsAfter;
|
|
396
|
+
}
|
|
397
|
+
return x.length ? [HistEvent.selection(x)] : none;
|
|
399
398
|
}
|
|
400
|
-
function mapEvent(e6,
|
|
401
|
-
let
|
|
402
|
-
if (!e6.changes) return HistEvent.selection(
|
|
403
|
-
let
|
|
404
|
-
return new HistEvent(
|
|
399
|
+
function mapEvent(e6, y, b) {
|
|
400
|
+
let x = conc(e6.selectionsAfter.length ? e6.selectionsAfter.map((e7) => e7.map(y)) : none, b);
|
|
401
|
+
if (!e6.changes) return HistEvent.selection(x);
|
|
402
|
+
let S = e6.changes.map(y), C = y.mapDesc(e6.changes, true), w = e6.mapped ? e6.mapped.composeDesc(C) : C;
|
|
403
|
+
return new HistEvent(S, StateEffect.mapEffects(e6.effects, y), w, e6.startSelection.map(C), x);
|
|
405
404
|
}
|
|
406
405
|
var joinableUserEvent = /^(input\.type|delete)($|\.)/, HistoryState = class e2 {
|
|
407
|
-
constructor(e6,
|
|
408
|
-
this.done = e6, this.undone =
|
|
406
|
+
constructor(e6, y, b = 0, x = void 0) {
|
|
407
|
+
this.done = e6, this.undone = y, this.prevTime = b, this.prevUserEvent = x;
|
|
409
408
|
}
|
|
410
409
|
isolate() {
|
|
411
410
|
return this.prevTime ? new e2(this.done, this.undone) : this;
|
|
412
411
|
}
|
|
413
|
-
addChanges(
|
|
414
|
-
let
|
|
415
|
-
return
|
|
412
|
+
addChanges(y, b, x, S, C) {
|
|
413
|
+
let w = this.done, T = w[w.length - 1];
|
|
414
|
+
return w = T && T.changes && !T.changes.empty && y.changes && (!x || joinableUserEvent.test(x)) && (!T.selectionsAfter.length && b - this.prevTime < S.newGroupDelay && S.joinToEvent(C, isAdjacent(T.changes, y.changes)) || x == "input.type.compose") ? updateBranch(w, w.length - 1, S.minDepth, new HistEvent(y.changes.compose(T.changes), conc(StateEffect.mapEffects(y.effects, T.changes), T.effects), T.mapped, T.startSelection, none)) : updateBranch(w, w.length, S.minDepth, y), new e2(w, none, b, x);
|
|
416
415
|
}
|
|
417
|
-
addSelection(
|
|
418
|
-
let
|
|
419
|
-
return
|
|
416
|
+
addSelection(y, b, x, S) {
|
|
417
|
+
let C = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
|
|
418
|
+
return C.length > 0 && b - this.prevTime < S && x == this.prevUserEvent && x && /^select($|\.)/.test(x) && eqSelectionShape(C[C.length - 1], y) ? this : new e2(addSelection(this.done, y), this.undone, b, x);
|
|
420
419
|
}
|
|
421
|
-
addMapping(
|
|
422
|
-
return new e2(addMappingToBranch(this.done,
|
|
420
|
+
addMapping(y) {
|
|
421
|
+
return new e2(addMappingToBranch(this.done, y), addMappingToBranch(this.undone, y), this.prevTime, this.prevUserEvent);
|
|
423
422
|
}
|
|
424
|
-
pop(e6,
|
|
425
|
-
let
|
|
426
|
-
if (
|
|
427
|
-
let
|
|
428
|
-
if (
|
|
429
|
-
selection:
|
|
423
|
+
pop(e6, y, b) {
|
|
424
|
+
let x = e6 == 0 ? this.done : this.undone;
|
|
425
|
+
if (x.length == 0) return null;
|
|
426
|
+
let S = x[x.length - 1], C = S.selectionsAfter[0] || y.selection;
|
|
427
|
+
if (b && S.selectionsAfter.length) return y.update({
|
|
428
|
+
selection: S.selectionsAfter[S.selectionsAfter.length - 1],
|
|
430
429
|
annotations: fromHistory.of({
|
|
431
430
|
side: e6,
|
|
432
|
-
rest: popSelection(
|
|
433
|
-
selection:
|
|
431
|
+
rest: popSelection(x),
|
|
432
|
+
selection: C
|
|
434
433
|
}),
|
|
435
434
|
userEvent: e6 == 0 ? "select.undo" : "select.redo",
|
|
436
435
|
scrollIntoView: true
|
|
437
436
|
});
|
|
438
|
-
if (
|
|
439
|
-
let
|
|
440
|
-
return
|
|
441
|
-
changes:
|
|
442
|
-
selection:
|
|
443
|
-
effects:
|
|
437
|
+
if (S.changes) {
|
|
438
|
+
let b2 = x.length == 1 ? none : x.slice(0, x.length - 1);
|
|
439
|
+
return S.mapped && (b2 = addMappingToBranch(b2, S.mapped)), y.update({
|
|
440
|
+
changes: S.changes,
|
|
441
|
+
selection: S.startSelection,
|
|
442
|
+
effects: S.effects,
|
|
444
443
|
annotations: fromHistory.of({
|
|
445
444
|
side: e6,
|
|
446
|
-
rest:
|
|
447
|
-
selection:
|
|
445
|
+
rest: b2,
|
|
446
|
+
selection: C
|
|
448
447
|
}),
|
|
449
448
|
filter: false,
|
|
450
449
|
userEvent: e6 == 0 ? "undo" : "redo",
|
|
@@ -483,228 +482,244 @@ var historyKeymap = [
|
|
|
483
482
|
preventDefault: true
|
|
484
483
|
}
|
|
485
484
|
];
|
|
486
|
-
function updateSel(e6,
|
|
487
|
-
return EditorSelection.create(e6.ranges.map(
|
|
485
|
+
function updateSel(e6, y) {
|
|
486
|
+
return EditorSelection.create(e6.ranges.map(y), e6.mainIndex);
|
|
488
487
|
}
|
|
489
|
-
function setSel(e6,
|
|
488
|
+
function setSel(e6, y) {
|
|
490
489
|
return e6.update({
|
|
491
|
-
selection:
|
|
490
|
+
selection: y,
|
|
492
491
|
scrollIntoView: true,
|
|
493
492
|
userEvent: "select"
|
|
494
493
|
});
|
|
495
494
|
}
|
|
496
|
-
function moveSel({ state: e6, dispatch:
|
|
497
|
-
let
|
|
498
|
-
return
|
|
495
|
+
function moveSel({ state: e6, dispatch: y }, b) {
|
|
496
|
+
let x = updateSel(e6.selection, b);
|
|
497
|
+
return x.eq(e6.selection, true) ? false : (y(setSel(e6, x)), true);
|
|
499
498
|
}
|
|
500
|
-
function rangeEnd(e6,
|
|
501
|
-
return EditorSelection.cursor(
|
|
499
|
+
function rangeEnd(e6, y) {
|
|
500
|
+
return EditorSelection.cursor(y ? e6.to : e6.from);
|
|
502
501
|
}
|
|
503
|
-
function cursorByChar(e6,
|
|
504
|
-
return moveSel(e6, (
|
|
502
|
+
function cursorByChar(e6, y) {
|
|
503
|
+
return moveSel(e6, (b) => b.empty ? e6.moveByChar(b, y) : rangeEnd(b, y));
|
|
505
504
|
}
|
|
506
505
|
function ltrAtCursor(e6) {
|
|
507
506
|
return e6.textDirectionAt(e6.state.selection.main.head) == Direction.LTR;
|
|
508
507
|
}
|
|
509
508
|
var cursorCharLeft = (e6) => cursorByChar(e6, !ltrAtCursor(e6)), cursorCharRight = (e6) => cursorByChar(e6, ltrAtCursor(e6));
|
|
510
|
-
function cursorByGroup(e6,
|
|
511
|
-
return moveSel(e6, (
|
|
509
|
+
function cursorByGroup(e6, y) {
|
|
510
|
+
return moveSel(e6, (b) => b.empty ? e6.moveByGroup(b, y) : rangeEnd(b, y));
|
|
512
511
|
}
|
|
513
512
|
var cursorGroupLeft = (e6) => cursorByGroup(e6, !ltrAtCursor(e6)), cursorGroupRight = (e6) => cursorByGroup(e6, ltrAtCursor(e6));
|
|
514
513
|
typeof Intl < "u" && Intl.Segmenter;
|
|
515
|
-
function interestingNode(e6,
|
|
516
|
-
if (
|
|
517
|
-
let
|
|
518
|
-
return
|
|
514
|
+
function interestingNode(e6, y, b) {
|
|
515
|
+
if (y.type.prop(b)) return true;
|
|
516
|
+
let x = y.to - y.from;
|
|
517
|
+
return x && (x > 2 || /[^\s,.;:]/.test(e6.sliceDoc(y.from, y.to))) || y.firstChild;
|
|
519
518
|
}
|
|
520
|
-
function moveBySyntax(e6,
|
|
521
|
-
let
|
|
522
|
-
for (let
|
|
523
|
-
let
|
|
524
|
-
if (!
|
|
525
|
-
interestingNode(e6,
|
|
526
|
-
}
|
|
527
|
-
let
|
|
528
|
-
return
|
|
519
|
+
function moveBySyntax(e6, y, b) {
|
|
520
|
+
let x = syntaxTree(e6).resolveInner(y.head), S = b ? NodeProp.closedBy : NodeProp.openedBy;
|
|
521
|
+
for (let C2 = y.head; ; ) {
|
|
522
|
+
let y2 = b ? x.childAfter(C2) : x.childBefore(C2);
|
|
523
|
+
if (!y2) break;
|
|
524
|
+
interestingNode(e6, y2, S) ? x = y2 : C2 = b ? y2.to : y2.from;
|
|
525
|
+
}
|
|
526
|
+
let C = x.type.prop(S), w, T;
|
|
527
|
+
return T = C && (w = b ? matchBrackets(e6, x.from, 1) : matchBrackets(e6, x.to, -1)) && w.matched ? b ? w.end.to : w.end.from : b ? x.to : x.from, EditorSelection.cursor(T, b ? -1 : 1);
|
|
529
528
|
}
|
|
530
|
-
var cursorSyntaxLeft = (e6) => moveSel(e6, (
|
|
531
|
-
function cursorByLine(e6,
|
|
532
|
-
return moveSel(e6, (
|
|
533
|
-
if (!
|
|
534
|
-
let
|
|
535
|
-
return
|
|
529
|
+
var cursorSyntaxLeft = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, !ltrAtCursor(e6))), cursorSyntaxRight = (e6) => moveSel(e6, (y) => moveBySyntax(e6.state, y, ltrAtCursor(e6)));
|
|
530
|
+
function cursorByLine(e6, y) {
|
|
531
|
+
return moveSel(e6, (b) => {
|
|
532
|
+
if (!b.empty) return rangeEnd(b, y);
|
|
533
|
+
let x = e6.moveVertically(b, y);
|
|
534
|
+
return x.head == b.head ? e6.moveToLineBoundary(b, y) : x;
|
|
536
535
|
});
|
|
537
536
|
}
|
|
538
537
|
var cursorLineUp = (e6) => cursorByLine(e6, false), cursorLineDown = (e6) => cursorByLine(e6, true);
|
|
539
538
|
function pageInfo(e6) {
|
|
540
|
-
let
|
|
541
|
-
if (
|
|
542
|
-
for (let
|
|
543
|
-
let
|
|
544
|
-
(
|
|
539
|
+
let y = e6.scrollDOM.clientHeight < e6.scrollDOM.scrollHeight - 2, b = 0, x = 0, S;
|
|
540
|
+
if (y) {
|
|
541
|
+
for (let y2 of e6.state.facet(EditorView.scrollMargins)) {
|
|
542
|
+
let S2 = y2(e6);
|
|
543
|
+
(S2 == null ? void 0 : S2.top) && (b = Math.max(S2 == null ? void 0 : S2.top, b)), (S2 == null ? void 0 : S2.bottom) && (x = Math.max(S2 == null ? void 0 : S2.bottom, x));
|
|
545
544
|
}
|
|
546
|
-
|
|
547
|
-
} else
|
|
545
|
+
S = e6.scrollDOM.clientHeight - b - x;
|
|
546
|
+
} else S = (e6.dom.ownerDocument.defaultView || window).innerHeight;
|
|
548
547
|
return {
|
|
549
|
-
marginTop:
|
|
550
|
-
marginBottom:
|
|
551
|
-
selfScroll:
|
|
552
|
-
height: Math.max(e6.defaultLineHeight,
|
|
548
|
+
marginTop: b,
|
|
549
|
+
marginBottom: x,
|
|
550
|
+
selfScroll: y,
|
|
551
|
+
height: Math.max(e6.defaultLineHeight, S - 5)
|
|
553
552
|
};
|
|
554
553
|
}
|
|
555
|
-
function cursorByPage(e6,
|
|
556
|
-
let
|
|
557
|
-
if (
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
let
|
|
561
|
-
|
|
554
|
+
function cursorByPage(e6, y) {
|
|
555
|
+
let b = pageInfo(e6), { state: x } = e6, S = updateSel(x.selection, (x2) => x2.empty ? e6.moveVertically(x2, y, b.height) : rangeEnd(x2, y));
|
|
556
|
+
if (S.eq(x.selection)) return false;
|
|
557
|
+
let C;
|
|
558
|
+
if (b.selfScroll) {
|
|
559
|
+
let y2 = e6.coordsAtPos(x.selection.main.head), w = e6.scrollDOM.getBoundingClientRect(), T = w.top + b.marginTop, E = w.bottom - b.marginBottom;
|
|
560
|
+
y2 && y2.top > T && y2.bottom < E && (C = EditorView.scrollIntoView(S.main.head, {
|
|
562
561
|
y: "start",
|
|
563
|
-
yMargin:
|
|
562
|
+
yMargin: y2.top - T
|
|
564
563
|
}));
|
|
565
564
|
}
|
|
566
|
-
return e6.dispatch(setSel(
|
|
565
|
+
return e6.dispatch(setSel(x, S), { effects: C }), true;
|
|
567
566
|
}
|
|
568
567
|
var cursorPageUp = (e6) => cursorByPage(e6, false), cursorPageDown = (e6) => cursorByPage(e6, true);
|
|
569
|
-
function moveByLineBoundary(e6,
|
|
570
|
-
let
|
|
571
|
-
if (
|
|
572
|
-
let
|
|
573
|
-
|
|
568
|
+
function moveByLineBoundary(e6, y, b) {
|
|
569
|
+
let x = e6.lineBlockAt(y.head), S = e6.moveToLineBoundary(y, b);
|
|
570
|
+
if (S.head == y.head && S.head != (b ? x.to : x.from) && (S = e6.moveToLineBoundary(y, b, false)), !b && S.head == x.from && x.length) {
|
|
571
|
+
let b2 = /^\s*/.exec(e6.state.sliceDoc(x.from, Math.min(x.from + 100, x.to)))[0].length;
|
|
572
|
+
b2 && y.head != x.from + b2 && (S = EditorSelection.cursor(x.from + b2));
|
|
574
573
|
}
|
|
575
|
-
return
|
|
574
|
+
return S;
|
|
576
575
|
}
|
|
577
|
-
var cursorLineBoundaryForward = (e6) => moveSel(e6, (
|
|
578
|
-
function toMatchingBracket(e6,
|
|
579
|
-
let
|
|
580
|
-
let
|
|
581
|
-
if (!
|
|
582
|
-
|
|
583
|
-
let
|
|
584
|
-
return
|
|
576
|
+
var cursorLineBoundaryForward = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, true)), cursorLineBoundaryBackward = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, false)), cursorLineBoundaryLeft = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, !ltrAtCursor(e6))), cursorLineBoundaryRight = (e6) => moveSel(e6, (y) => moveByLineBoundary(e6, y, ltrAtCursor(e6))), cursorLineStart = (e6) => moveSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).from, 1)), cursorLineEnd = (e6) => moveSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).to, -1));
|
|
577
|
+
function toMatchingBracket(e6, y, b) {
|
|
578
|
+
let x = false, S = updateSel(e6.selection, (y2) => {
|
|
579
|
+
let S2 = matchBrackets(e6, y2.head, -1) || matchBrackets(e6, y2.head, 1) || y2.head > 0 && matchBrackets(e6, y2.head - 1, 1) || y2.head < e6.doc.length && matchBrackets(e6, y2.head + 1, -1);
|
|
580
|
+
if (!S2 || !S2.end) return y2;
|
|
581
|
+
x = true;
|
|
582
|
+
let C = S2.start.from == y2.head ? S2.end.to : S2.end.from;
|
|
583
|
+
return b ? EditorSelection.range(y2.anchor, C) : EditorSelection.cursor(C);
|
|
585
584
|
});
|
|
586
|
-
return
|
|
585
|
+
return x ? (y(setSel(e6, S)), true) : false;
|
|
587
586
|
}
|
|
588
|
-
var cursorMatchingBracket = ({ state: e6, dispatch:
|
|
589
|
-
function extendSel(e6,
|
|
590
|
-
let
|
|
591
|
-
let
|
|
592
|
-
return EditorSelection.range(e7.anchor,
|
|
587
|
+
var cursorMatchingBracket = ({ state: e6, dispatch: y }) => toMatchingBracket(e6, y, false);
|
|
588
|
+
function extendSel(e6, y) {
|
|
589
|
+
let b = updateSel(e6.state.selection, (e7) => {
|
|
590
|
+
let b2 = y(e7);
|
|
591
|
+
return EditorSelection.range(e7.anchor, b2.head, b2.goalColumn, b2.bidiLevel || void 0);
|
|
593
592
|
});
|
|
594
|
-
return
|
|
593
|
+
return b.eq(e6.state.selection) ? false : (e6.dispatch(setSel(e6.state, b)), true);
|
|
595
594
|
}
|
|
596
|
-
function selectByChar(e6,
|
|
597
|
-
return extendSel(e6, (
|
|
595
|
+
function selectByChar(e6, y) {
|
|
596
|
+
return extendSel(e6, (b) => e6.moveByChar(b, y));
|
|
598
597
|
}
|
|
599
598
|
var selectCharLeft = (e6) => selectByChar(e6, !ltrAtCursor(e6)), selectCharRight = (e6) => selectByChar(e6, ltrAtCursor(e6));
|
|
600
|
-
function selectByGroup(e6,
|
|
601
|
-
return extendSel(e6, (
|
|
599
|
+
function selectByGroup(e6, y) {
|
|
600
|
+
return extendSel(e6, (b) => e6.moveByGroup(b, y));
|
|
602
601
|
}
|
|
603
|
-
var selectGroupLeft = (e6) => selectByGroup(e6, !ltrAtCursor(e6)), selectGroupRight = (e6) => selectByGroup(e6, ltrAtCursor(e6)), selectSyntaxLeft = (e6) => extendSel(e6, (
|
|
604
|
-
function selectByLine(e6,
|
|
605
|
-
return extendSel(e6, (
|
|
602
|
+
var selectGroupLeft = (e6) => selectByGroup(e6, !ltrAtCursor(e6)), selectGroupRight = (e6) => selectByGroup(e6, ltrAtCursor(e6)), selectSyntaxLeft = (e6) => extendSel(e6, (y) => moveBySyntax(e6.state, y, !ltrAtCursor(e6))), selectSyntaxRight = (e6) => extendSel(e6, (y) => moveBySyntax(e6.state, y, ltrAtCursor(e6)));
|
|
603
|
+
function selectByLine(e6, y) {
|
|
604
|
+
return extendSel(e6, (b) => e6.moveVertically(b, y));
|
|
606
605
|
}
|
|
607
606
|
var selectLineUp = (e6) => selectByLine(e6, false), selectLineDown = (e6) => selectByLine(e6, true);
|
|
608
|
-
function selectByPage(e6,
|
|
609
|
-
return extendSel(e6, (
|
|
607
|
+
function selectByPage(e6, y) {
|
|
608
|
+
return extendSel(e6, (b) => e6.moveVertically(b, y, pageInfo(e6).height));
|
|
610
609
|
}
|
|
611
|
-
var selectPageUp = (e6) => selectByPage(e6, false), selectPageDown = (e6) => selectByPage(e6, true), selectLineBoundaryForward = (e6) => extendSel(e6, (
|
|
610
|
+
var selectPageUp = (e6) => selectByPage(e6, false), selectPageDown = (e6) => selectByPage(e6, true), selectLineBoundaryForward = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, true)), selectLineBoundaryBackward = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, false)), selectLineBoundaryLeft = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, !ltrAtCursor(e6))), selectLineBoundaryRight = (e6) => extendSel(e6, (y) => moveByLineBoundary(e6, y, ltrAtCursor(e6))), selectLineStart = (e6) => extendSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).from)), selectLineEnd = (e6) => extendSel(e6, (y) => EditorSelection.cursor(e6.lineBlockAt(y.head).to)), cursorDocStart = ({ state: e6, dispatch: y }) => (y(setSel(e6, { anchor: 0 })), true), cursorDocEnd = ({ state: e6, dispatch: y }) => (y(setSel(e6, { anchor: e6.doc.length })), true), selectDocStart = ({ state: e6, dispatch: y }) => (y(setSel(e6, {
|
|
612
611
|
anchor: e6.selection.main.anchor,
|
|
613
612
|
head: 0
|
|
614
|
-
})), true), selectDocEnd = ({ state: e6, dispatch:
|
|
613
|
+
})), true), selectDocEnd = ({ state: e6, dispatch: y }) => (y(setSel(e6, {
|
|
615
614
|
anchor: e6.selection.main.anchor,
|
|
616
615
|
head: e6.doc.length
|
|
617
|
-
})), true), selectAll = ({ state: e6, dispatch:
|
|
616
|
+
})), true), selectAll = ({ state: e6, dispatch: y }) => (y(e6.update({
|
|
618
617
|
selection: {
|
|
619
618
|
anchor: 0,
|
|
620
619
|
head: e6.doc.length
|
|
621
620
|
},
|
|
622
621
|
userEvent: "select"
|
|
623
|
-
})), true), selectLine = ({ state: e6, dispatch:
|
|
624
|
-
let
|
|
625
|
-
return
|
|
626
|
-
selection: EditorSelection.create(
|
|
622
|
+
})), true), selectLine = ({ state: e6, dispatch: y }) => {
|
|
623
|
+
let b = selectedLineBlocks(e6).map(({ from: y2, to: b2 }) => EditorSelection.range(y2, Math.min(b2 + 1, e6.doc.length)));
|
|
624
|
+
return y(e6.update({
|
|
625
|
+
selection: EditorSelection.create(b),
|
|
627
626
|
userEvent: "select"
|
|
628
627
|
})), true;
|
|
629
|
-
}, selectParentSyntax = ({ state: e6, dispatch:
|
|
630
|
-
let
|
|
631
|
-
let
|
|
632
|
-
if (
|
|
633
|
-
let e7 =
|
|
634
|
-
e7.node.from >=
|
|
628
|
+
}, selectParentSyntax = ({ state: e6, dispatch: y }) => {
|
|
629
|
+
let b = updateSel(e6.selection, (y2) => {
|
|
630
|
+
let b2 = syntaxTree(e6), x = b2.resolveStack(y2.from, 1);
|
|
631
|
+
if (y2.empty) {
|
|
632
|
+
let e7 = b2.resolveStack(y2.from, -1);
|
|
633
|
+
e7.node.from >= x.node.from && e7.node.to <= x.node.to && (x = e7);
|
|
635
634
|
}
|
|
636
|
-
for (let e7 =
|
|
637
|
-
let { node:
|
|
638
|
-
if ((
|
|
635
|
+
for (let e7 = x; e7; e7 = e7.next) {
|
|
636
|
+
let { node: b3 } = e7;
|
|
637
|
+
if ((b3.from < y2.from && b3.to >= y2.to || b3.to > y2.to && b3.from <= y2.from) && e7.next) return EditorSelection.range(b3.to, b3.from);
|
|
639
638
|
}
|
|
640
|
-
return
|
|
639
|
+
return y2;
|
|
641
640
|
});
|
|
642
|
-
return
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
641
|
+
return b.eq(e6.selection) ? false : (y(setSel(e6, b)), true);
|
|
642
|
+
};
|
|
643
|
+
function addCursorVertically(e6, y) {
|
|
644
|
+
let { state: b } = e6, x = b.selection, S = b.selection.ranges.slice();
|
|
645
|
+
for (let x2 of b.selection.ranges) {
|
|
646
|
+
let C = b.doc.lineAt(x2.head);
|
|
647
|
+
if (y ? C.to < e6.state.doc.length : C.from > 0) for (let b2 = x2; ; ) {
|
|
648
|
+
let x3 = e6.moveVertically(b2, y);
|
|
649
|
+
if (x3.head < C.from || x3.head > C.to) {
|
|
650
|
+
S.some((e7) => e7.head == x3.head) || S.push(x3);
|
|
651
|
+
break;
|
|
652
|
+
} else if (x3.head == b2.head) break;
|
|
653
|
+
else b2 = x3;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
return S.length == x.ranges.length ? false : (e6.dispatch(setSel(b, EditorSelection.create(S, S.length - 1))), true);
|
|
657
|
+
}
|
|
658
|
+
var addCursorAbove = (e6) => addCursorVertically(e6, false), addCursorBelow = (e6) => addCursorVertically(e6, true), simplifySelection = ({ state: e6, dispatch: y }) => {
|
|
659
|
+
let b = e6.selection, x = null;
|
|
660
|
+
return b.ranges.length > 1 ? x = EditorSelection.create([b.main]) : b.main.empty || (x = EditorSelection.create([EditorSelection.cursor(b.main.head)])), x ? (y(setSel(e6, x)), true) : false;
|
|
646
661
|
};
|
|
647
|
-
function deleteBy(e6,
|
|
662
|
+
function deleteBy(e6, y) {
|
|
648
663
|
if (e6.state.readOnly) return false;
|
|
649
|
-
let
|
|
650
|
-
let { from:
|
|
651
|
-
if (
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
} else
|
|
655
|
-
return
|
|
664
|
+
let b = "delete.selection", { state: x } = e6, S = x.changeByRange((x2) => {
|
|
665
|
+
let { from: S2, to: C } = x2;
|
|
666
|
+
if (S2 == C) {
|
|
667
|
+
let w = y(x2);
|
|
668
|
+
w < S2 ? (b = "delete.backward", w = skipAtomic(e6, w, false)) : w > S2 && (b = "delete.forward", w = skipAtomic(e6, w, true)), S2 = Math.min(S2, w), C = Math.max(C, w);
|
|
669
|
+
} else S2 = skipAtomic(e6, S2, false), C = skipAtomic(e6, C, true);
|
|
670
|
+
return S2 == C ? { range: x2 } : {
|
|
656
671
|
changes: {
|
|
657
|
-
from:
|
|
658
|
-
to:
|
|
672
|
+
from: S2,
|
|
673
|
+
to: C
|
|
659
674
|
},
|
|
660
|
-
range: EditorSelection.cursor(
|
|
675
|
+
range: EditorSelection.cursor(S2, S2 < x2.head ? -1 : 1)
|
|
661
676
|
};
|
|
662
677
|
});
|
|
663
|
-
return
|
|
678
|
+
return S.changes.empty ? false : (e6.dispatch(x.update(S, {
|
|
664
679
|
scrollIntoView: true,
|
|
665
|
-
userEvent:
|
|
666
|
-
effects:
|
|
680
|
+
userEvent: b,
|
|
681
|
+
effects: b == "delete.selection" ? EditorView.announce.of(x.phrase("Selection deleted")) : void 0
|
|
667
682
|
})), true);
|
|
668
683
|
}
|
|
669
|
-
function skipAtomic(e6,
|
|
670
|
-
if (e6 instanceof EditorView) for (let
|
|
671
|
-
e7 <
|
|
684
|
+
function skipAtomic(e6, y, b) {
|
|
685
|
+
if (e6 instanceof EditorView) for (let x of e6.state.facet(EditorView.atomicRanges).map((y2) => y2(e6))) x.between(y, y, (e7, x2) => {
|
|
686
|
+
e7 < y && x2 > y && (y = b ? x2 : e7);
|
|
672
687
|
});
|
|
673
|
-
return
|
|
688
|
+
return y;
|
|
674
689
|
}
|
|
675
|
-
var deleteByChar = (e6,
|
|
676
|
-
let
|
|
677
|
-
if (
|
|
678
|
-
if (
|
|
679
|
-
let e7 = countColumn(
|
|
680
|
-
for (let
|
|
681
|
-
|
|
682
|
-
} else
|
|
683
|
-
return
|
|
684
|
-
}), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6,
|
|
685
|
-
let
|
|
690
|
+
var deleteByChar = (e6, y, b) => deleteBy(e6, (x) => {
|
|
691
|
+
let S = x.from, { state: C } = e6, w = C.doc.lineAt(S), T, E;
|
|
692
|
+
if (b && !y && S > w.from && S < w.from + 200 && !/[^ \t]/.test(T = w.text.slice(0, S - w.from))) {
|
|
693
|
+
if (T[T.length - 1] == " ") return S - 1;
|
|
694
|
+
let e7 = countColumn(T, C.tabSize) % getIndentUnit(C) || getIndentUnit(C);
|
|
695
|
+
for (let y2 = 0; y2 < e7 && T[T.length - 1 - y2] == " "; y2++) S--;
|
|
696
|
+
E = S;
|
|
697
|
+
} else E = findClusterBreak(w.text, S - w.from, y, y) + w.from, E == S && w.number != (y ? C.doc.lines : 1) ? E += y ? 1 : -1 : !y && /[\ufe00-\ufe0f]/.test(w.text.slice(E - w.from, S - w.from)) && (E = findClusterBreak(w.text, E - w.from, false, false) + w.from);
|
|
698
|
+
return E;
|
|
699
|
+
}), deleteCharBackward = (e6) => deleteByChar(e6, false, true), deleteCharForward = (e6) => deleteByChar(e6, true, false), deleteByGroup = (e6, y) => deleteBy(e6, (b) => {
|
|
700
|
+
let x = b.head, { state: S } = e6, C = S.doc.lineAt(x), w = S.charCategorizer(x);
|
|
686
701
|
for (let e7 = null; ; ) {
|
|
687
|
-
if (
|
|
688
|
-
|
|
702
|
+
if (x == (y ? C.to : C.from)) {
|
|
703
|
+
x == b.head && C.number != (y ? S.doc.lines : 1) && (x += y ? 1 : -1);
|
|
689
704
|
break;
|
|
690
705
|
}
|
|
691
|
-
let
|
|
692
|
-
if (e7 != null &&
|
|
693
|
-
(
|
|
694
|
-
}
|
|
695
|
-
return
|
|
696
|
-
}), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (
|
|
697
|
-
let
|
|
698
|
-
return
|
|
699
|
-
}), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (
|
|
700
|
-
let
|
|
701
|
-
return
|
|
702
|
-
}), deleteLineBoundaryForward = (e6) => deleteBy(e6, (
|
|
703
|
-
let
|
|
704
|
-
return
|
|
705
|
-
}), splitLine = ({ state: e6, dispatch:
|
|
706
|
+
let T = findClusterBreak(C.text, x - C.from, y) + C.from, E = C.text.slice(Math.min(x, T) - C.from, Math.max(x, T) - C.from), D = w(E);
|
|
707
|
+
if (e7 != null && D != e7) break;
|
|
708
|
+
(E != " " || x != b.head) && (e7 = D), x = T;
|
|
709
|
+
}
|
|
710
|
+
return x;
|
|
711
|
+
}), deleteGroupBackward = (e6) => deleteByGroup(e6, false), deleteGroupForward = (e6) => deleteByGroup(e6, true), deleteToLineEnd = (e6) => deleteBy(e6, (y) => {
|
|
712
|
+
let b = e6.lineBlockAt(y.head).to;
|
|
713
|
+
return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
|
|
714
|
+
}), deleteLineBoundaryBackward = (e6) => deleteBy(e6, (y) => {
|
|
715
|
+
let b = e6.moveToLineBoundary(y, false).head;
|
|
716
|
+
return y.head > b ? b : Math.max(0, y.head - 1);
|
|
717
|
+
}), deleteLineBoundaryForward = (e6) => deleteBy(e6, (y) => {
|
|
718
|
+
let b = e6.moveToLineBoundary(y, true).head;
|
|
719
|
+
return y.head < b ? b : Math.min(e6.state.doc.length, y.head + 1);
|
|
720
|
+
}), splitLine = ({ state: e6, dispatch: y }) => {
|
|
706
721
|
if (e6.readOnly) return false;
|
|
707
|
-
let
|
|
722
|
+
let b = e6.changeByRange((e7) => ({
|
|
708
723
|
changes: {
|
|
709
724
|
from: e7.from,
|
|
710
725
|
to: e7.to,
|
|
@@ -712,203 +727,203 @@ var deleteByChar = (e6, _, v) => deleteBy(e6, (y) => {
|
|
|
712
727
|
},
|
|
713
728
|
range: EditorSelection.cursor(e7.from)
|
|
714
729
|
}));
|
|
715
|
-
return
|
|
730
|
+
return y(e6.update(b, {
|
|
716
731
|
scrollIntoView: true,
|
|
717
732
|
userEvent: "input"
|
|
718
733
|
})), true;
|
|
719
|
-
}, transposeChars = ({ state: e6, dispatch:
|
|
734
|
+
}, transposeChars = ({ state: e6, dispatch: y }) => {
|
|
720
735
|
if (e6.readOnly) return false;
|
|
721
|
-
let
|
|
722
|
-
if (!
|
|
723
|
-
let
|
|
736
|
+
let b = e6.changeByRange((y2) => {
|
|
737
|
+
if (!y2.empty || y2.from == 0 || y2.from == e6.doc.length) return { range: y2 };
|
|
738
|
+
let b2 = y2.from, x = e6.doc.lineAt(b2), S = b2 == x.from ? b2 - 1 : findClusterBreak(x.text, b2 - x.from, false) + x.from, C = b2 == x.to ? b2 + 1 : findClusterBreak(x.text, b2 - x.from, true) + x.from;
|
|
724
739
|
return {
|
|
725
740
|
changes: {
|
|
726
|
-
from:
|
|
727
|
-
to:
|
|
728
|
-
insert: e6.doc.slice(
|
|
741
|
+
from: S,
|
|
742
|
+
to: C,
|
|
743
|
+
insert: e6.doc.slice(b2, C).append(e6.doc.slice(S, b2))
|
|
729
744
|
},
|
|
730
|
-
range: EditorSelection.cursor(
|
|
745
|
+
range: EditorSelection.cursor(C)
|
|
731
746
|
};
|
|
732
747
|
});
|
|
733
|
-
return
|
|
748
|
+
return b.changes.empty ? false : (y(e6.update(b, {
|
|
734
749
|
scrollIntoView: true,
|
|
735
750
|
userEvent: "move.character"
|
|
736
751
|
})), true);
|
|
737
752
|
};
|
|
738
753
|
function selectedLineBlocks(e6) {
|
|
739
|
-
let
|
|
740
|
-
for (let
|
|
741
|
-
let
|
|
742
|
-
if (!
|
|
743
|
-
let e7 =
|
|
744
|
-
e7.to =
|
|
745
|
-
} else
|
|
746
|
-
from:
|
|
747
|
-
to:
|
|
748
|
-
ranges: [
|
|
754
|
+
let y = [], b = -1;
|
|
755
|
+
for (let x of e6.selection.ranges) {
|
|
756
|
+
let S = e6.doc.lineAt(x.from), C = e6.doc.lineAt(x.to);
|
|
757
|
+
if (!x.empty && x.to == C.from && (C = e6.doc.lineAt(x.to - 1)), b >= S.number) {
|
|
758
|
+
let e7 = y[y.length - 1];
|
|
759
|
+
e7.to = C.to, e7.ranges.push(x);
|
|
760
|
+
} else y.push({
|
|
761
|
+
from: S.from,
|
|
762
|
+
to: C.to,
|
|
763
|
+
ranges: [x]
|
|
749
764
|
});
|
|
750
|
-
|
|
765
|
+
b = C.number + 1;
|
|
751
766
|
}
|
|
752
|
-
return
|
|
767
|
+
return y;
|
|
753
768
|
}
|
|
754
|
-
function moveLine(e6,
|
|
769
|
+
function moveLine(e6, y, b) {
|
|
755
770
|
if (e6.readOnly) return false;
|
|
756
|
-
let
|
|
757
|
-
for (let
|
|
758
|
-
if (
|
|
759
|
-
let
|
|
760
|
-
if (
|
|
761
|
-
|
|
762
|
-
from:
|
|
763
|
-
to:
|
|
771
|
+
let x = [], S = [];
|
|
772
|
+
for (let y2 of selectedLineBlocks(e6)) {
|
|
773
|
+
if (b ? y2.to == e6.doc.length : y2.from == 0) continue;
|
|
774
|
+
let C = e6.doc.lineAt(b ? y2.to + 1 : y2.from - 1), w = C.length + 1;
|
|
775
|
+
if (b) {
|
|
776
|
+
x.push({
|
|
777
|
+
from: y2.to,
|
|
778
|
+
to: C.to
|
|
764
779
|
}, {
|
|
765
|
-
from:
|
|
766
|
-
insert:
|
|
780
|
+
from: y2.from,
|
|
781
|
+
insert: C.text + e6.lineBreak
|
|
767
782
|
});
|
|
768
|
-
for (let
|
|
783
|
+
for (let b2 of y2.ranges) S.push(EditorSelection.range(Math.min(e6.doc.length, b2.anchor + w), Math.min(e6.doc.length, b2.head + w)));
|
|
769
784
|
} else {
|
|
770
|
-
|
|
771
|
-
from:
|
|
772
|
-
to:
|
|
785
|
+
x.push({
|
|
786
|
+
from: C.from,
|
|
787
|
+
to: y2.from
|
|
773
788
|
}, {
|
|
774
|
-
from:
|
|
775
|
-
insert: e6.lineBreak +
|
|
789
|
+
from: y2.to,
|
|
790
|
+
insert: e6.lineBreak + C.text
|
|
776
791
|
});
|
|
777
|
-
for (let e7 of
|
|
792
|
+
for (let e7 of y2.ranges) S.push(EditorSelection.range(e7.anchor - w, e7.head - w));
|
|
778
793
|
}
|
|
779
794
|
}
|
|
780
|
-
return
|
|
781
|
-
changes:
|
|
795
|
+
return x.length ? (y(e6.update({
|
|
796
|
+
changes: x,
|
|
782
797
|
scrollIntoView: true,
|
|
783
|
-
selection: EditorSelection.create(
|
|
798
|
+
selection: EditorSelection.create(S, e6.selection.mainIndex),
|
|
784
799
|
userEvent: "move.line"
|
|
785
800
|
})), true) : false;
|
|
786
801
|
}
|
|
787
|
-
var moveLineUp = ({ state: e6, dispatch:
|
|
788
|
-
function copyLine(e6,
|
|
802
|
+
var moveLineUp = ({ state: e6, dispatch: y }) => moveLine(e6, y, false), moveLineDown = ({ state: e6, dispatch: y }) => moveLine(e6, y, true);
|
|
803
|
+
function copyLine(e6, y, b) {
|
|
789
804
|
if (e6.readOnly) return false;
|
|
790
|
-
let
|
|
791
|
-
for (let
|
|
792
|
-
from:
|
|
793
|
-
insert: e6.doc.slice(
|
|
794
|
-
}) :
|
|
795
|
-
from:
|
|
796
|
-
insert: e6.lineBreak + e6.doc.slice(
|
|
805
|
+
let x = [];
|
|
806
|
+
for (let y2 of selectedLineBlocks(e6)) b ? x.push({
|
|
807
|
+
from: y2.from,
|
|
808
|
+
insert: e6.doc.slice(y2.from, y2.to) + e6.lineBreak
|
|
809
|
+
}) : x.push({
|
|
810
|
+
from: y2.to,
|
|
811
|
+
insert: e6.lineBreak + e6.doc.slice(y2.from, y2.to)
|
|
797
812
|
});
|
|
798
|
-
return
|
|
799
|
-
changes:
|
|
813
|
+
return y(e6.update({
|
|
814
|
+
changes: x,
|
|
800
815
|
scrollIntoView: true,
|
|
801
816
|
userEvent: "input.copyline"
|
|
802
817
|
})), true;
|
|
803
818
|
}
|
|
804
|
-
var copyLineUp = ({ state: e6, dispatch:
|
|
819
|
+
var copyLineUp = ({ state: e6, dispatch: y }) => copyLine(e6, y, false), copyLineDown = ({ state: e6, dispatch: y }) => copyLine(e6, y, true), deleteLine = (e6) => {
|
|
805
820
|
if (e6.state.readOnly) return false;
|
|
806
|
-
let { state:
|
|
821
|
+
let { state: y } = e6, b = y.changes(selectedLineBlocks(y).map(({ from: e7, to: b2 }) => (e7 > 0 ? e7-- : b2 < y.doc.length && b2++, {
|
|
807
822
|
from: e7,
|
|
808
|
-
to:
|
|
809
|
-
}))),
|
|
810
|
-
let
|
|
823
|
+
to: b2
|
|
824
|
+
}))), x = updateSel(y.selection, (y2) => {
|
|
825
|
+
let b2;
|
|
811
826
|
if (e6.lineWrapping) {
|
|
812
|
-
let
|
|
813
|
-
|
|
827
|
+
let x2 = e6.lineBlockAt(y2.head), S = e6.coordsAtPos(y2.head, y2.assoc || 1);
|
|
828
|
+
S && (b2 = x2.bottom + e6.documentTop - S.bottom + e6.defaultLineHeight / 2);
|
|
814
829
|
}
|
|
815
|
-
return e6.moveVertically(
|
|
816
|
-
}).map(
|
|
830
|
+
return e6.moveVertically(y2, true, b2);
|
|
831
|
+
}).map(b);
|
|
817
832
|
return e6.dispatch({
|
|
818
|
-
changes:
|
|
819
|
-
selection:
|
|
833
|
+
changes: b,
|
|
834
|
+
selection: x,
|
|
820
835
|
scrollIntoView: true,
|
|
821
836
|
userEvent: "delete.line"
|
|
822
837
|
}), true;
|
|
823
838
|
};
|
|
824
|
-
function isBetweenBrackets(e6,
|
|
825
|
-
if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(
|
|
826
|
-
from:
|
|
827
|
-
to:
|
|
839
|
+
function isBetweenBrackets(e6, y) {
|
|
840
|
+
if (/\(\)|\[\]|\{\}/.test(e6.sliceDoc(y - 1, y + 1))) return {
|
|
841
|
+
from: y,
|
|
842
|
+
to: y
|
|
828
843
|
};
|
|
829
|
-
let
|
|
830
|
-
return
|
|
831
|
-
from:
|
|
832
|
-
to:
|
|
844
|
+
let b = syntaxTree(e6).resolveInner(y), x = b.childBefore(y), S = b.childAfter(y), C;
|
|
845
|
+
return x && S && x.to <= y && S.from >= y && (C = x.type.prop(NodeProp.closedBy)) && C.indexOf(S.name) > -1 && e6.doc.lineAt(x.to).from == e6.doc.lineAt(S.from).from && !/\S/.test(e6.sliceDoc(x.to, S.from)) ? {
|
|
846
|
+
from: x.to,
|
|
847
|
+
to: S.from
|
|
833
848
|
} : null;
|
|
834
849
|
}
|
|
835
850
|
var insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false), insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
|
|
836
851
|
function newlineAndIndent(e6) {
|
|
837
|
-
return ({ state:
|
|
838
|
-
if (
|
|
839
|
-
let
|
|
840
|
-
let { from:
|
|
841
|
-
e6 && (
|
|
842
|
-
let
|
|
843
|
-
simulateBreak:
|
|
844
|
-
simulateDoubleBreak: !!
|
|
845
|
-
}),
|
|
846
|
-
for (
|
|
847
|
-
|
|
848
|
-
let
|
|
849
|
-
return
|
|
852
|
+
return ({ state: y, dispatch: b }) => {
|
|
853
|
+
if (y.readOnly) return false;
|
|
854
|
+
let x = y.changeByRange((b2) => {
|
|
855
|
+
let { from: x2, to: S } = b2, C = y.doc.lineAt(x2), w = !e6 && x2 == S && isBetweenBrackets(y, x2);
|
|
856
|
+
e6 && (x2 = S = (S <= C.to ? C : y.doc.lineAt(S)).to);
|
|
857
|
+
let T = new IndentContext(y, {
|
|
858
|
+
simulateBreak: x2,
|
|
859
|
+
simulateDoubleBreak: !!w
|
|
860
|
+
}), E = getIndentation(T, x2);
|
|
861
|
+
for (E ?? (E = countColumn(/^\s*/.exec(y.doc.lineAt(x2).text)[0], y.tabSize)); S < C.to && /\s/.test(C.text[S - C.from]); ) S++;
|
|
862
|
+
w ? { from: x2, to: S } = w : x2 > C.from && x2 < C.from + 100 && !/\S/.test(C.text.slice(0, x2)) && (x2 = C.from);
|
|
863
|
+
let D = ["", indentString(y, E)];
|
|
864
|
+
return w && D.push(indentString(y, T.lineIndent(C.from, -1))), {
|
|
850
865
|
changes: {
|
|
851
|
-
from:
|
|
852
|
-
to:
|
|
853
|
-
insert: Text.of(
|
|
866
|
+
from: x2,
|
|
867
|
+
to: S,
|
|
868
|
+
insert: Text.of(D)
|
|
854
869
|
},
|
|
855
|
-
range: EditorSelection.cursor(
|
|
870
|
+
range: EditorSelection.cursor(x2 + 1 + D[1].length)
|
|
856
871
|
};
|
|
857
872
|
});
|
|
858
|
-
return
|
|
873
|
+
return b(y.update(x, {
|
|
859
874
|
scrollIntoView: true,
|
|
860
875
|
userEvent: "input"
|
|
861
876
|
})), true;
|
|
862
877
|
};
|
|
863
878
|
}
|
|
864
|
-
function changeBySelectedLine(e6,
|
|
865
|
-
let
|
|
866
|
-
return e6.changeByRange((
|
|
867
|
-
let
|
|
868
|
-
for (let
|
|
869
|
-
let
|
|
870
|
-
|
|
879
|
+
function changeBySelectedLine(e6, y) {
|
|
880
|
+
let b = -1;
|
|
881
|
+
return e6.changeByRange((x) => {
|
|
882
|
+
let S = [];
|
|
883
|
+
for (let C2 = x.from; C2 <= x.to; ) {
|
|
884
|
+
let w = e6.doc.lineAt(C2);
|
|
885
|
+
w.number > b && (x.empty || x.to > w.from) && (y(w, S, x), b = w.number), C2 = w.to + 1;
|
|
871
886
|
}
|
|
872
|
-
let
|
|
887
|
+
let C = e6.changes(S);
|
|
873
888
|
return {
|
|
874
|
-
changes:
|
|
875
|
-
range: EditorSelection.range(
|
|
889
|
+
changes: S,
|
|
890
|
+
range: EditorSelection.range(C.mapPos(x.anchor, 1), C.mapPos(x.head, 1))
|
|
876
891
|
};
|
|
877
892
|
});
|
|
878
893
|
}
|
|
879
|
-
var indentSelection = ({ state: e6, dispatch:
|
|
894
|
+
var indentSelection = ({ state: e6, dispatch: y }) => {
|
|
880
895
|
if (e6.readOnly) return false;
|
|
881
|
-
let
|
|
882
|
-
let
|
|
883
|
-
if (
|
|
884
|
-
/\S/.test(
|
|
885
|
-
let
|
|
886
|
-
(
|
|
887
|
-
from:
|
|
888
|
-
to:
|
|
889
|
-
insert:
|
|
896
|
+
let b = /* @__PURE__ */ Object.create(null), x = new IndentContext(e6, { overrideIndentation: (e7) => b[e7] ?? -1 }), S = changeBySelectedLine(e6, (y2, S2, C) => {
|
|
897
|
+
let w = getIndentation(x, y2.from);
|
|
898
|
+
if (w == null) return;
|
|
899
|
+
/\S/.test(y2.text) || (w = 0);
|
|
900
|
+
let T = /^\s*/.exec(y2.text)[0], E = indentString(e6, w);
|
|
901
|
+
(T != E || C.from < y2.from + T.length) && (b[y2.from] = w, S2.push({
|
|
902
|
+
from: y2.from,
|
|
903
|
+
to: y2.from + T.length,
|
|
904
|
+
insert: E
|
|
890
905
|
}));
|
|
891
906
|
});
|
|
892
|
-
return
|
|
893
|
-
}, indentMore = ({ state: e6, dispatch:
|
|
894
|
-
|
|
895
|
-
from:
|
|
907
|
+
return S.changes.empty || y(e6.update(S, { userEvent: "indent" })), true;
|
|
908
|
+
}, indentMore = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
|
|
909
|
+
b.push({
|
|
910
|
+
from: y2.from,
|
|
896
911
|
insert: e6.facet(indentUnit)
|
|
897
912
|
});
|
|
898
|
-
}), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch:
|
|
899
|
-
let
|
|
900
|
-
if (!
|
|
901
|
-
let
|
|
902
|
-
for (;
|
|
903
|
-
|
|
904
|
-
from:
|
|
905
|
-
to:
|
|
906
|
-
insert:
|
|
913
|
+
}), { userEvent: "input.indent" })), true), indentLess = ({ state: e6, dispatch: y }) => e6.readOnly ? false : (y(e6.update(changeBySelectedLine(e6, (y2, b) => {
|
|
914
|
+
let x = /^\s*/.exec(y2.text)[0];
|
|
915
|
+
if (!x) return;
|
|
916
|
+
let S = countColumn(x, e6.tabSize), C = 0, w = indentString(e6, Math.max(0, S - getIndentUnit(e6)));
|
|
917
|
+
for (; C < x.length && C < w.length && x.charCodeAt(C) == w.charCodeAt(C); ) C++;
|
|
918
|
+
b.push({
|
|
919
|
+
from: y2.from + C,
|
|
920
|
+
to: y2.from + x.length,
|
|
921
|
+
insert: w.slice(C)
|
|
907
922
|
});
|
|
908
|
-
}), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch:
|
|
923
|
+
}), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e6) => (e6.setTabFocusMode(), true), insertTab = ({ state: e6, dispatch: y }) => e6.selection.ranges.some((e7) => !e7.empty) ? indentMore({
|
|
909
924
|
state: e6,
|
|
910
|
-
dispatch:
|
|
911
|
-
}) : (
|
|
925
|
+
dispatch: y
|
|
926
|
+
}) : (y(e6.update(e6.replaceSelection(" "), {
|
|
912
927
|
scrollIntoView: true,
|
|
913
928
|
userEvent: "input"
|
|
914
929
|
})), true), emacsStyleKeymap = [
|
|
@@ -1086,29 +1101,35 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
|
|
|
1086
1101
|
{
|
|
1087
1102
|
key: "Backspace",
|
|
1088
1103
|
run: deleteCharBackward,
|
|
1089
|
-
shift: deleteCharBackward
|
|
1104
|
+
shift: deleteCharBackward,
|
|
1105
|
+
preventDefault: true
|
|
1090
1106
|
},
|
|
1091
1107
|
{
|
|
1092
1108
|
key: "Delete",
|
|
1093
|
-
run: deleteCharForward
|
|
1109
|
+
run: deleteCharForward,
|
|
1110
|
+
preventDefault: true
|
|
1094
1111
|
},
|
|
1095
1112
|
{
|
|
1096
1113
|
key: "Mod-Backspace",
|
|
1097
1114
|
mac: "Alt-Backspace",
|
|
1098
|
-
run: deleteGroupBackward
|
|
1115
|
+
run: deleteGroupBackward,
|
|
1116
|
+
preventDefault: true
|
|
1099
1117
|
},
|
|
1100
1118
|
{
|
|
1101
1119
|
key: "Mod-Delete",
|
|
1102
1120
|
mac: "Alt-Delete",
|
|
1103
|
-
run: deleteGroupForward
|
|
1121
|
+
run: deleteGroupForward,
|
|
1122
|
+
preventDefault: true
|
|
1104
1123
|
},
|
|
1105
1124
|
{
|
|
1106
1125
|
mac: "Mod-Backspace",
|
|
1107
|
-
run: deleteLineBoundaryBackward
|
|
1126
|
+
run: deleteLineBoundaryBackward,
|
|
1127
|
+
preventDefault: true
|
|
1108
1128
|
},
|
|
1109
1129
|
{
|
|
1110
1130
|
mac: "Mod-Delete",
|
|
1111
|
-
run: deleteLineBoundaryForward
|
|
1131
|
+
run: deleteLineBoundaryForward,
|
|
1132
|
+
preventDefault: true
|
|
1112
1133
|
}
|
|
1113
1134
|
].concat(/* @__PURE__ */ emacsStyleKeymap.map((e6) => ({
|
|
1114
1135
|
mac: e6.key,
|
|
@@ -1143,6 +1164,14 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
|
|
|
1143
1164
|
key: "Shift-Alt-ArrowDown",
|
|
1144
1165
|
run: copyLineDown
|
|
1145
1166
|
},
|
|
1167
|
+
{
|
|
1168
|
+
key: "Mod-Alt-ArrowUp",
|
|
1169
|
+
run: addCursorAbove
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
key: "Mod-Alt-ArrowDown",
|
|
1173
|
+
run: addCursorBelow
|
|
1174
|
+
},
|
|
1146
1175
|
{
|
|
1147
1176
|
key: "Escape",
|
|
1148
1177
|
run: simplifySelection
|
|
@@ -1199,11 +1228,11 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
|
|
|
1199
1228
|
run: indentMore,
|
|
1200
1229
|
shift: indentLess
|
|
1201
1230
|
}, basicNormalize = typeof String.prototype.normalize == "function" ? (e6) => e6.normalize("NFKD") : (e6) => e6, SearchCursor = class {
|
|
1202
|
-
constructor(e6,
|
|
1203
|
-
this.test =
|
|
1231
|
+
constructor(e6, y, b = 0, x = e6.length, S, C) {
|
|
1232
|
+
this.test = C, this.value = {
|
|
1204
1233
|
from: 0,
|
|
1205
1234
|
to: 0
|
|
1206
|
-
}, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e6.iterRange(
|
|
1235
|
+
}, this.done = false, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e6.iterRange(b, x), this.bufferStart = b, this.normalize = S ? (e7) => S(basicNormalize(e7)) : basicNormalize, this.query = this.normalize(y);
|
|
1207
1236
|
}
|
|
1208
1237
|
peek() {
|
|
1209
1238
|
if (this.bufferPos == this.buffer.length) {
|
|
@@ -1220,32 +1249,32 @@ var indentSelection = ({ state: e6, dispatch: _ }) => {
|
|
|
1220
1249
|
for (; ; ) {
|
|
1221
1250
|
let e6 = this.peek();
|
|
1222
1251
|
if (e6 < 0) return this.done = true, this;
|
|
1223
|
-
let
|
|
1252
|
+
let y = fromCodePoint(e6), b = this.bufferStart + this.bufferPos;
|
|
1224
1253
|
this.bufferPos += codePointSize(e6);
|
|
1225
|
-
let
|
|
1226
|
-
if (
|
|
1227
|
-
let
|
|
1228
|
-
if (e7 ==
|
|
1229
|
-
if (
|
|
1254
|
+
let x = this.normalize(y);
|
|
1255
|
+
if (x.length) for (let e7 = 0, S = b; ; e7++) {
|
|
1256
|
+
let C = x.charCodeAt(e7), w = this.match(C, S, this.bufferPos + this.bufferStart);
|
|
1257
|
+
if (e7 == x.length - 1) {
|
|
1258
|
+
if (w) return this.value = w, this;
|
|
1230
1259
|
break;
|
|
1231
1260
|
}
|
|
1232
|
-
|
|
1261
|
+
S == b && e7 < y.length && y.charCodeAt(e7) == C && S++;
|
|
1233
1262
|
}
|
|
1234
1263
|
}
|
|
1235
1264
|
}
|
|
1236
|
-
match(e6,
|
|
1237
|
-
let
|
|
1238
|
-
for (let
|
|
1239
|
-
let
|
|
1240
|
-
this.query.charCodeAt(
|
|
1241
|
-
from: this.matches[
|
|
1242
|
-
to:
|
|
1243
|
-
} : (this.matches[
|
|
1265
|
+
match(e6, y, b) {
|
|
1266
|
+
let x = null;
|
|
1267
|
+
for (let y2 = 0; y2 < this.matches.length; y2 += 2) {
|
|
1268
|
+
let S = this.matches[y2], C = false;
|
|
1269
|
+
this.query.charCodeAt(S) == e6 && (S == this.query.length - 1 ? x = {
|
|
1270
|
+
from: this.matches[y2 + 1],
|
|
1271
|
+
to: b
|
|
1272
|
+
} : (this.matches[y2]++, C = true)), C || (this.matches.splice(y2, 2), y2 -= 2);
|
|
1244
1273
|
}
|
|
1245
|
-
return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ?
|
|
1246
|
-
from:
|
|
1247
|
-
to:
|
|
1248
|
-
} : this.matches.push(1,
|
|
1274
|
+
return this.query.charCodeAt(0) == e6 && (this.query.length == 1 ? x = {
|
|
1275
|
+
from: y,
|
|
1276
|
+
to: b
|
|
1277
|
+
} : this.matches.push(1, y)), x && this.test && !this.test(x.from, x.to, this.buffer, this.bufferStart) && (x = null), x;
|
|
1249
1278
|
}
|
|
1250
1279
|
};
|
|
1251
1280
|
typeof Symbol < "u" && (SearchCursor.prototype[Symbol.iterator] = function() {
|
|
@@ -1256,9 +1285,9 @@ var empty = {
|
|
|
1256
1285
|
to: -1,
|
|
1257
1286
|
match: /* @__PURE__ */ /.*/.exec("")
|
|
1258
1287
|
}, baseFlags = "gm" + (/x/.unicode == null ? "" : "u"), RegExpCursor = class {
|
|
1259
|
-
constructor(e6,
|
|
1260
|
-
if (this.text = e6, this.to =
|
|
1261
|
-
this.re = new RegExp(
|
|
1288
|
+
constructor(e6, y, b, x = 0, S = e6.length) {
|
|
1289
|
+
if (this.text = e6, this.to = S, this.curLine = "", this.done = false, this.value = empty, /\\[sWDnr]|\n|\r|\[\^/.test(y)) return new MultilineRegExpCursor(e6, y, b, x, S);
|
|
1290
|
+
this.re = new RegExp(y, baseFlags + ((b == null ? void 0 : b.ignoreCase) ? "i" : "")), this.test = b == null ? void 0 : b.test, this.iter = e6.iter(), this.curLineStart = e6.lineAt(x).from, this.matchPos = toCharEnd(e6, x), this.getLine(this.curLineStart);
|
|
1262
1291
|
}
|
|
1263
1292
|
getLine(e6) {
|
|
1264
1293
|
this.iter.next(e6), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
|
|
@@ -1269,13 +1298,13 @@ var empty = {
|
|
|
1269
1298
|
next() {
|
|
1270
1299
|
for (let e6 = this.matchPos - this.curLineStart; ; ) {
|
|
1271
1300
|
this.re.lastIndex = e6;
|
|
1272
|
-
let
|
|
1273
|
-
if (
|
|
1274
|
-
let
|
|
1275
|
-
if (this.matchPos = toCharEnd(this.text,
|
|
1276
|
-
from:
|
|
1277
|
-
to:
|
|
1278
|
-
match:
|
|
1301
|
+
let y = this.matchPos <= this.to && this.re.exec(this.curLine);
|
|
1302
|
+
if (y) {
|
|
1303
|
+
let b = this.curLineStart + y.index, x = b + y[0].length;
|
|
1304
|
+
if (this.matchPos = toCharEnd(this.text, x + (b == x ? 1 : 0)), b == this.curLineStart + this.curLine.length && this.nextLine(), (b < x || b > this.value.to) && (!this.test || this.test(b, x, y))) return this.value = {
|
|
1305
|
+
from: b,
|
|
1306
|
+
to: x,
|
|
1307
|
+
match: y
|
|
1279
1308
|
}, this;
|
|
1280
1309
|
e6 = this.matchPos - this.curLineStart;
|
|
1281
1310
|
} else if (this.curLineStart + this.curLine.length < this.to) this.nextLine(), e6 = 0;
|
|
@@ -1283,39 +1312,39 @@ var empty = {
|
|
|
1283
1312
|
}
|
|
1284
1313
|
}
|
|
1285
1314
|
}, flattened = /* @__PURE__ */ new WeakMap(), FlattenedDoc = class e3 {
|
|
1286
|
-
constructor(e6,
|
|
1287
|
-
this.from = e6, this.text =
|
|
1315
|
+
constructor(e6, y) {
|
|
1316
|
+
this.from = e6, this.text = y;
|
|
1288
1317
|
}
|
|
1289
1318
|
get to() {
|
|
1290
1319
|
return this.from + this.text.length;
|
|
1291
1320
|
}
|
|
1292
|
-
static get(
|
|
1293
|
-
let
|
|
1294
|
-
if (!
|
|
1295
|
-
let
|
|
1296
|
-
return flattened.set(
|
|
1321
|
+
static get(y, b, x) {
|
|
1322
|
+
let S = flattened.get(y);
|
|
1323
|
+
if (!S || S.from >= x || S.to <= b) {
|
|
1324
|
+
let S2 = new e3(b, y.sliceString(b, x));
|
|
1325
|
+
return flattened.set(y, S2), S2;
|
|
1297
1326
|
}
|
|
1298
|
-
if (
|
|
1299
|
-
let { text:
|
|
1300
|
-
return
|
|
1327
|
+
if (S.from == b && S.to == x) return S;
|
|
1328
|
+
let { text: C, from: w } = S;
|
|
1329
|
+
return w > b && (C = y.sliceString(b, w) + C, w = b), S.to < x && (C += y.sliceString(S.to, x)), flattened.set(y, new e3(w, C)), new e3(b, C.slice(b - w, x - w));
|
|
1301
1330
|
}
|
|
1302
1331
|
}, MultilineRegExpCursor = class {
|
|
1303
|
-
constructor(e6,
|
|
1304
|
-
this.text = e6, this.to =
|
|
1332
|
+
constructor(e6, y, b, x, S) {
|
|
1333
|
+
this.text = e6, this.to = S, this.done = false, this.value = empty, this.matchPos = toCharEnd(e6, x), this.re = new RegExp(y, baseFlags + ((b == null ? void 0 : b.ignoreCase) ? "i" : "")), this.test = b == null ? void 0 : b.test, this.flat = FlattenedDoc.get(e6, x, this.chunkEnd(x + 5e3));
|
|
1305
1334
|
}
|
|
1306
1335
|
chunkEnd(e6) {
|
|
1307
1336
|
return e6 >= this.to ? this.to : this.text.lineAt(e6).to;
|
|
1308
1337
|
}
|
|
1309
1338
|
next() {
|
|
1310
1339
|
for (; ; ) {
|
|
1311
|
-
let e6 = this.re.lastIndex = this.matchPos - this.flat.from,
|
|
1312
|
-
if (
|
|
1313
|
-
let e7 = this.flat.from +
|
|
1314
|
-
if ((this.flat.to >= this.to ||
|
|
1340
|
+
let e6 = this.re.lastIndex = this.matchPos - this.flat.from, y = this.re.exec(this.flat.text);
|
|
1341
|
+
if (y && !y[0] && y.index == e6 && (this.re.lastIndex = e6 + 1, y = this.re.exec(this.flat.text)), y) {
|
|
1342
|
+
let e7 = this.flat.from + y.index, b = e7 + y[0].length;
|
|
1343
|
+
if ((this.flat.to >= this.to || y.index + y[0].length <= this.flat.text.length - 10) && (!this.test || this.test(e7, b, y))) return this.value = {
|
|
1315
1344
|
from: e7,
|
|
1316
|
-
to:
|
|
1317
|
-
match:
|
|
1318
|
-
}, this.matchPos = toCharEnd(this.text,
|
|
1345
|
+
to: b,
|
|
1346
|
+
match: y
|
|
1347
|
+
}, this.matchPos = toCharEnd(this.text, b + (e7 == b ? 1 : 0)), this;
|
|
1319
1348
|
}
|
|
1320
1349
|
if (this.flat.to == this.to) return this.done = true, this;
|
|
1321
1350
|
this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
|
|
@@ -1332,26 +1361,26 @@ function validRegExp(e6) {
|
|
|
1332
1361
|
return false;
|
|
1333
1362
|
}
|
|
1334
1363
|
}
|
|
1335
|
-
function toCharEnd(e6,
|
|
1336
|
-
if (
|
|
1337
|
-
let
|
|
1338
|
-
for (;
|
|
1339
|
-
return
|
|
1364
|
+
function toCharEnd(e6, y) {
|
|
1365
|
+
if (y >= e6.length) return y;
|
|
1366
|
+
let b = e6.lineAt(y), x;
|
|
1367
|
+
for (; y < b.to && (x = b.text.charCodeAt(y - b.from)) >= 56320 && x < 57344; ) y++;
|
|
1368
|
+
return y;
|
|
1340
1369
|
}
|
|
1341
1370
|
function createLineDialog(e6) {
|
|
1342
|
-
let
|
|
1371
|
+
let y = crelt("input", {
|
|
1343
1372
|
class: "cm-textfield",
|
|
1344
1373
|
name: "line",
|
|
1345
|
-
value:
|
|
1346
|
-
}),
|
|
1374
|
+
value: String(e6.state.doc.lineAt(e6.state.selection.main.head).number)
|
|
1375
|
+
}), b = crelt("form", {
|
|
1347
1376
|
class: "cm-gotoLine",
|
|
1348
|
-
onkeydown: (
|
|
1349
|
-
|
|
1377
|
+
onkeydown: (y2) => {
|
|
1378
|
+
y2.keyCode == 27 ? (y2.preventDefault(), e6.dispatch({ effects: dialogEffect.of(false) }), e6.focus()) : y2.keyCode == 13 && (y2.preventDefault(), x());
|
|
1350
1379
|
},
|
|
1351
1380
|
onsubmit: (e7) => {
|
|
1352
|
-
e7.preventDefault(),
|
|
1381
|
+
e7.preventDefault(), x();
|
|
1353
1382
|
}
|
|
1354
|
-
}, crelt("label", e6.state.phrase("Go to line"), ": ",
|
|
1383
|
+
}, crelt("label", e6.state.phrase("Go to line"), ": ", y), " ", crelt("button", {
|
|
1355
1384
|
class: "cm-button",
|
|
1356
1385
|
type: "submit"
|
|
1357
1386
|
}, e6.state.phrase("go")), crelt("button", {
|
|
@@ -1362,38 +1391,38 @@ function createLineDialog(e6) {
|
|
|
1362
1391
|
"aria-label": e6.state.phrase("close"),
|
|
1363
1392
|
type: "button"
|
|
1364
1393
|
}, ["\xD7"]));
|
|
1365
|
-
function
|
|
1366
|
-
let
|
|
1367
|
-
if (!
|
|
1368
|
-
let { state:
|
|
1369
|
-
if (
|
|
1370
|
-
let e7 =
|
|
1371
|
-
|
|
1372
|
-
} else
|
|
1373
|
-
let
|
|
1394
|
+
function x() {
|
|
1395
|
+
let b2 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(y.value);
|
|
1396
|
+
if (!b2) return;
|
|
1397
|
+
let { state: x2 } = e6, S = x2.doc.lineAt(x2.selection.main.head), [, C, w, T, E] = b2, D = T ? +T.slice(1) : 0, O = w ? +w : S.number;
|
|
1398
|
+
if (w && E) {
|
|
1399
|
+
let e7 = O / 100;
|
|
1400
|
+
C && (e7 = e7 * (C == "-" ? -1 : 1) + S.number / x2.doc.lines), O = Math.round(x2.doc.lines * e7);
|
|
1401
|
+
} else w && C && (O = O * (C == "-" ? -1 : 1) + S.number);
|
|
1402
|
+
let k = x2.doc.line(Math.max(1, Math.min(x2.doc.lines, O))), A = EditorSelection.cursor(k.from + Math.max(0, Math.min(D, k.length)));
|
|
1374
1403
|
e6.dispatch({
|
|
1375
|
-
effects: [dialogEffect.of(false), EditorView.scrollIntoView(
|
|
1376
|
-
selection:
|
|
1404
|
+
effects: [dialogEffect.of(false), EditorView.scrollIntoView(A.from, { y: "center" })],
|
|
1405
|
+
selection: A
|
|
1377
1406
|
}), e6.focus();
|
|
1378
1407
|
}
|
|
1379
|
-
return { dom:
|
|
1408
|
+
return { dom: b };
|
|
1380
1409
|
}
|
|
1381
1410
|
var dialogEffect = /* @__PURE__ */ StateEffect.define(), dialogField = /* @__PURE__ */ StateField.define({
|
|
1382
1411
|
create() {
|
|
1383
1412
|
return true;
|
|
1384
1413
|
},
|
|
1385
|
-
update(e6,
|
|
1386
|
-
for (let
|
|
1414
|
+
update(e6, y) {
|
|
1415
|
+
for (let b of y.effects) b.is(dialogEffect) && (e6 = b.value);
|
|
1387
1416
|
return e6;
|
|
1388
1417
|
},
|
|
1389
1418
|
provide: (e6) => showPanel.from(e6, (e7) => e7 ? createLineDialog : null)
|
|
1390
1419
|
}), gotoLine = (e6) => {
|
|
1391
|
-
let
|
|
1392
|
-
if (!
|
|
1393
|
-
let
|
|
1394
|
-
e6.state.field(dialogField, false) ??
|
|
1420
|
+
let y = getPanel(e6, createLineDialog);
|
|
1421
|
+
if (!y) {
|
|
1422
|
+
let b = [dialogEffect.of(true)];
|
|
1423
|
+
e6.state.field(dialogField, false) ?? b.push(StateEffect.appendConfig.of([dialogField, baseTheme$1])), e6.dispatch({ effects: b }), y = getPanel(e6, createLineDialog);
|
|
1395
1424
|
}
|
|
1396
|
-
return
|
|
1425
|
+
return y && y.dom.querySelector("input").select(), true;
|
|
1397
1426
|
}, baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({ ".cm-panel.cm-gotoLine": {
|
|
1398
1427
|
padding: "2px 6px 4px",
|
|
1399
1428
|
position: "relative",
|
|
@@ -1415,21 +1444,21 @@ var dialogEffect = /* @__PURE__ */ StateEffect.define(), dialogField = /* @__PUR
|
|
|
1415
1444
|
wholeWords: false
|
|
1416
1445
|
}, highlightConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
|
|
1417
1446
|
return combineConfig(e6, defaultHighlightOptions, {
|
|
1418
|
-
highlightWordAroundCursor: (e7,
|
|
1447
|
+
highlightWordAroundCursor: (e7, y) => e7 || y,
|
|
1419
1448
|
minSelectionLength: Math.min,
|
|
1420
1449
|
maxMatches: Math.min
|
|
1421
1450
|
});
|
|
1422
1451
|
} });
|
|
1423
1452
|
function highlightSelectionMatches(e6) {
|
|
1424
|
-
let
|
|
1425
|
-
return e6 &&
|
|
1453
|
+
let y = [defaultTheme, matchHighlighter];
|
|
1454
|
+
return e6 && y.push(highlightConfig.of(e6)), y;
|
|
1426
1455
|
}
|
|
1427
1456
|
var matchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch" }), mainMatchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
|
|
1428
|
-
function insideWordBoundaries(e6,
|
|
1429
|
-
return (
|
|
1457
|
+
function insideWordBoundaries(e6, y, b, x) {
|
|
1458
|
+
return (b == 0 || e6(y.sliceDoc(b - 1, b)) != CharCategory.Word) && (x == y.doc.length || e6(y.sliceDoc(x, x + 1)) != CharCategory.Word);
|
|
1430
1459
|
}
|
|
1431
|
-
function insideWord(e6,
|
|
1432
|
-
return e6(
|
|
1460
|
+
function insideWord(e6, y, b, x) {
|
|
1461
|
+
return e6(y.sliceDoc(b, b + 1)) == CharCategory.Word && e6(y.sliceDoc(x - 1, x)) == CharCategory.Word;
|
|
1433
1462
|
}
|
|
1434
1463
|
var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
1435
1464
|
constructor(e6) {
|
|
@@ -1439,64 +1468,64 @@ var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
|
1439
1468
|
(e6.selectionSet || e6.docChanged || e6.viewportChanged) && (this.decorations = this.getDeco(e6.view));
|
|
1440
1469
|
}
|
|
1441
1470
|
getDeco(e6) {
|
|
1442
|
-
let
|
|
1443
|
-
if (
|
|
1444
|
-
let
|
|
1445
|
-
if (
|
|
1446
|
-
if (!
|
|
1447
|
-
let e7 =
|
|
1471
|
+
let y = e6.state.facet(highlightConfig), { state: b } = e6, x = b.selection;
|
|
1472
|
+
if (x.ranges.length > 1) return Decoration.none;
|
|
1473
|
+
let S = x.main, C, w = null;
|
|
1474
|
+
if (S.empty) {
|
|
1475
|
+
if (!y.highlightWordAroundCursor) return Decoration.none;
|
|
1476
|
+
let e7 = b.wordAt(S.head);
|
|
1448
1477
|
if (!e7) return Decoration.none;
|
|
1449
|
-
|
|
1478
|
+
w = b.charCategorizer(S.head), C = b.sliceDoc(e7.from, e7.to);
|
|
1450
1479
|
} else {
|
|
1451
|
-
let e7 =
|
|
1452
|
-
if (e7 <
|
|
1453
|
-
if (
|
|
1454
|
-
if (
|
|
1455
|
-
} else if (
|
|
1480
|
+
let e7 = S.to - S.from;
|
|
1481
|
+
if (e7 < y.minSelectionLength || e7 > 200) return Decoration.none;
|
|
1482
|
+
if (y.wholeWords) {
|
|
1483
|
+
if (C = b.sliceDoc(S.from, S.to), w = b.charCategorizer(S.head), !(insideWordBoundaries(w, b, S.from, S.to) && insideWord(w, b, S.from, S.to))) return Decoration.none;
|
|
1484
|
+
} else if (C = b.sliceDoc(S.from, S.to), !C) return Decoration.none;
|
|
1456
1485
|
}
|
|
1457
|
-
let
|
|
1458
|
-
for (let
|
|
1459
|
-
let e7 = new SearchCursor(
|
|
1486
|
+
let T = [];
|
|
1487
|
+
for (let x2 of e6.visibleRanges) {
|
|
1488
|
+
let e7 = new SearchCursor(b.doc, C, x2.from, x2.to);
|
|
1460
1489
|
for (; !e7.next().done; ) {
|
|
1461
|
-
let { from:
|
|
1462
|
-
if ((!
|
|
1490
|
+
let { from: x3, to: C2 } = e7.value;
|
|
1491
|
+
if ((!w || insideWordBoundaries(w, b, x3, C2)) && (S.empty && x3 <= S.from && C2 >= S.to ? T.push(mainMatchDeco.range(x3, C2)) : (x3 >= S.to || C2 <= S.from) && T.push(matchDeco.range(x3, C2)), T.length > y.maxMatches)) return Decoration.none;
|
|
1463
1492
|
}
|
|
1464
1493
|
}
|
|
1465
|
-
return Decoration.set(
|
|
1494
|
+
return Decoration.set(T);
|
|
1466
1495
|
}
|
|
1467
1496
|
}, { decorations: (e6) => e6.decorations }), defaultTheme = /* @__PURE__ */ EditorView.baseTheme({
|
|
1468
1497
|
".cm-selectionMatch": { backgroundColor: "#99ff7780" },
|
|
1469
1498
|
".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
|
|
1470
|
-
}), selectWord = ({ state: e6, dispatch:
|
|
1471
|
-
let { selection:
|
|
1472
|
-
return
|
|
1499
|
+
}), selectWord = ({ state: e6, dispatch: y }) => {
|
|
1500
|
+
let { selection: b } = e6, x = EditorSelection.create(b.ranges.map((y2) => e6.wordAt(y2.head) || EditorSelection.cursor(y2.head)), b.mainIndex);
|
|
1501
|
+
return x.eq(b) ? false : (y(e6.update({ selection: x })), true);
|
|
1473
1502
|
};
|
|
1474
|
-
function findNextOccurrence(e6,
|
|
1475
|
-
let { main:
|
|
1476
|
-
for (let
|
|
1477
|
-
if (
|
|
1478
|
-
|
|
1503
|
+
function findNextOccurrence(e6, y) {
|
|
1504
|
+
let { main: b, ranges: x } = e6.selection, S = e6.wordAt(b.head), C = S && S.from == b.from && S.to == b.to;
|
|
1505
|
+
for (let b2 = false, S2 = new SearchCursor(e6.doc, y, x[x.length - 1].to); ; ) if (S2.next(), S2.done) {
|
|
1506
|
+
if (b2) return null;
|
|
1507
|
+
S2 = new SearchCursor(e6.doc, y, 0, Math.max(0, x[x.length - 1].from - 1)), b2 = true;
|
|
1479
1508
|
} else {
|
|
1480
|
-
if (
|
|
1481
|
-
if (
|
|
1482
|
-
let
|
|
1483
|
-
if (!
|
|
1509
|
+
if (b2 && x.some((e7) => e7.from == S2.value.from)) continue;
|
|
1510
|
+
if (C) {
|
|
1511
|
+
let y2 = e6.wordAt(S2.value.from);
|
|
1512
|
+
if (!y2 || y2.from != S2.value.from || y2.to != S2.value.to) continue;
|
|
1484
1513
|
}
|
|
1485
|
-
return
|
|
1514
|
+
return S2.value;
|
|
1486
1515
|
}
|
|
1487
1516
|
}
|
|
1488
|
-
var selectNextOccurrence = ({ state: e6, dispatch:
|
|
1489
|
-
let { ranges:
|
|
1490
|
-
if (
|
|
1517
|
+
var selectNextOccurrence = ({ state: e6, dispatch: y }) => {
|
|
1518
|
+
let { ranges: b } = e6.selection;
|
|
1519
|
+
if (b.some((e7) => e7.from === e7.to)) return selectWord({
|
|
1491
1520
|
state: e6,
|
|
1492
|
-
dispatch:
|
|
1521
|
+
dispatch: y
|
|
1493
1522
|
});
|
|
1494
|
-
let
|
|
1495
|
-
if (e6.selection.ranges.some((
|
|
1496
|
-
let
|
|
1497
|
-
return
|
|
1498
|
-
selection: e6.selection.addRange(EditorSelection.range(
|
|
1499
|
-
effects: EditorView.scrollIntoView(
|
|
1523
|
+
let x = e6.sliceDoc(b[0].from, b[0].to);
|
|
1524
|
+
if (e6.selection.ranges.some((y2) => e6.sliceDoc(y2.from, y2.to) != x)) return false;
|
|
1525
|
+
let S = findNextOccurrence(e6, x);
|
|
1526
|
+
return S ? (y(e6.update({
|
|
1527
|
+
selection: e6.selection.addRange(EditorSelection.range(S.from, S.to), false),
|
|
1528
|
+
effects: EditorView.scrollIntoView(S.to)
|
|
1500
1529
|
})), true) : false;
|
|
1501
1530
|
}, searchConfigFacet = /* @__PURE__ */ Facet.define({ combine(e6) {
|
|
1502
1531
|
return combineConfig(e6, {
|
|
@@ -1513,7 +1542,7 @@ var selectNextOccurrence = ({ state: e6, dispatch: _ }) => {
|
|
|
1513
1542
|
this.search = e6.search, this.caseSensitive = !!e6.caseSensitive, this.literal = !!e6.literal, this.regexp = !!e6.regexp, this.replace = e6.replace || "", this.valid = !!this.search && (!this.regexp || validRegExp(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e6.wholeWord;
|
|
1514
1543
|
}
|
|
1515
1544
|
unquote(e6) {
|
|
1516
|
-
return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7,
|
|
1545
|
+
return this.literal ? e6 : e6.replace(/\\([nrt\\])/g, (e7, y) => y == "n" ? "\n" : y == "r" ? "\r" : y == "t" ? " " : "\\");
|
|
1517
1546
|
}
|
|
1518
1547
|
eq(e6) {
|
|
1519
1548
|
return this.search == e6.search && this.replace == e6.replace && this.caseSensitive == e6.caseSensitive && this.regexp == e6.regexp && this.wholeWord == e6.wholeWord;
|
|
@@ -1521,267 +1550,267 @@ var selectNextOccurrence = ({ state: e6, dispatch: _ }) => {
|
|
|
1521
1550
|
create() {
|
|
1522
1551
|
return this.regexp ? new RegExpQuery(this) : new StringQuery(this);
|
|
1523
1552
|
}
|
|
1524
|
-
getCursor(e6,
|
|
1525
|
-
let
|
|
1526
|
-
return
|
|
1553
|
+
getCursor(e6, y = 0, b) {
|
|
1554
|
+
let x = e6.doc ? e6 : EditorState.create({ doc: e6 });
|
|
1555
|
+
return b ?? (b = x.doc.length), this.regexp ? regexpCursor(this, x, y, b) : stringCursor(this, x, y, b);
|
|
1527
1556
|
}
|
|
1528
1557
|
}, QueryType = class {
|
|
1529
1558
|
constructor(e6) {
|
|
1530
1559
|
this.spec = e6;
|
|
1531
1560
|
}
|
|
1532
1561
|
};
|
|
1533
|
-
function stringCursor(e6,
|
|
1534
|
-
return new SearchCursor(
|
|
1562
|
+
function stringCursor(e6, y, b, x) {
|
|
1563
|
+
return new SearchCursor(y.doc, e6.unquoted, b, x, e6.caseSensitive ? void 0 : (e7) => e7.toLowerCase(), e6.wholeWord ? stringWordTest(y.doc, y.charCategorizer(y.selection.main.head)) : void 0);
|
|
1535
1564
|
}
|
|
1536
|
-
function stringWordTest(e6,
|
|
1537
|
-
return (
|
|
1565
|
+
function stringWordTest(e6, y) {
|
|
1566
|
+
return (b, x, S, C) => ((C > b || C + S.length < x) && (C = Math.max(0, b - 2), S = e6.sliceString(C, Math.min(e6.length, x + 2))), (y(charBefore(S, b - C)) != CharCategory.Word || y(charAfter(S, b - C)) != CharCategory.Word) && (y(charAfter(S, x - C)) != CharCategory.Word || y(charBefore(S, x - C)) != CharCategory.Word));
|
|
1538
1567
|
}
|
|
1539
1568
|
var StringQuery = class extends QueryType {
|
|
1540
1569
|
constructor(e6) {
|
|
1541
1570
|
super(e6);
|
|
1542
1571
|
}
|
|
1543
|
-
nextMatch(e6,
|
|
1544
|
-
let
|
|
1545
|
-
if (
|
|
1546
|
-
let
|
|
1547
|
-
|
|
1572
|
+
nextMatch(e6, y, b) {
|
|
1573
|
+
let x = stringCursor(this.spec, e6, b, e6.doc.length).nextOverlapping();
|
|
1574
|
+
if (x.done) {
|
|
1575
|
+
let b2 = Math.min(e6.doc.length, y + this.spec.unquoted.length);
|
|
1576
|
+
x = stringCursor(this.spec, e6, 0, b2).nextOverlapping();
|
|
1548
1577
|
}
|
|
1549
|
-
return
|
|
1550
|
-
}
|
|
1551
|
-
prevMatchInRange(e6,
|
|
1552
|
-
for (let
|
|
1553
|
-
let
|
|
1554
|
-
for (; !
|
|
1555
|
-
if (
|
|
1556
|
-
if (
|
|
1557
|
-
|
|
1578
|
+
return x.done || x.value.from == y && x.value.to == b ? null : x.value;
|
|
1579
|
+
}
|
|
1580
|
+
prevMatchInRange(e6, y, b) {
|
|
1581
|
+
for (let x = b; ; ) {
|
|
1582
|
+
let b2 = Math.max(y, x - 1e4 - this.spec.unquoted.length), S = stringCursor(this.spec, e6, b2, x), C = null;
|
|
1583
|
+
for (; !S.nextOverlapping().done; ) C = S.value;
|
|
1584
|
+
if (C) return C;
|
|
1585
|
+
if (b2 == y) return null;
|
|
1586
|
+
x -= 1e4;
|
|
1558
1587
|
}
|
|
1559
1588
|
}
|
|
1560
|
-
prevMatch(e6,
|
|
1561
|
-
let
|
|
1562
|
-
return
|
|
1589
|
+
prevMatch(e6, y, b) {
|
|
1590
|
+
let x = this.prevMatchInRange(e6, 0, y);
|
|
1591
|
+
return x || (x = this.prevMatchInRange(e6, Math.max(0, b - this.spec.unquoted.length), e6.doc.length)), x && (x.from != y || x.to != b) ? x : null;
|
|
1563
1592
|
}
|
|
1564
1593
|
getReplacement(e6) {
|
|
1565
1594
|
return this.spec.unquote(this.spec.replace);
|
|
1566
1595
|
}
|
|
1567
|
-
matchAll(e6,
|
|
1568
|
-
let
|
|
1569
|
-
for (; !
|
|
1570
|
-
if (
|
|
1571
|
-
|
|
1596
|
+
matchAll(e6, y) {
|
|
1597
|
+
let b = stringCursor(this.spec, e6, 0, e6.doc.length), x = [];
|
|
1598
|
+
for (; !b.next().done; ) {
|
|
1599
|
+
if (x.length >= y) return null;
|
|
1600
|
+
x.push(b.value);
|
|
1572
1601
|
}
|
|
1573
|
-
return
|
|
1602
|
+
return x;
|
|
1574
1603
|
}
|
|
1575
|
-
highlight(e6,
|
|
1576
|
-
let
|
|
1577
|
-
for (; !
|
|
1604
|
+
highlight(e6, y, b, x) {
|
|
1605
|
+
let S = stringCursor(this.spec, e6, Math.max(0, y - this.spec.unquoted.length), Math.min(b + this.spec.unquoted.length, e6.doc.length));
|
|
1606
|
+
for (; !S.next().done; ) x(S.value.from, S.value.to);
|
|
1578
1607
|
}
|
|
1579
1608
|
};
|
|
1580
|
-
function regexpCursor(e6,
|
|
1581
|
-
return new RegExpCursor(
|
|
1609
|
+
function regexpCursor(e6, y, b, x) {
|
|
1610
|
+
return new RegExpCursor(y.doc, e6.search, {
|
|
1582
1611
|
ignoreCase: !e6.caseSensitive,
|
|
1583
|
-
test: e6.wholeWord ? regexpWordTest(
|
|
1584
|
-
},
|
|
1612
|
+
test: e6.wholeWord ? regexpWordTest(y.charCategorizer(y.selection.main.head)) : void 0
|
|
1613
|
+
}, b, x);
|
|
1585
1614
|
}
|
|
1586
|
-
function charBefore(e6,
|
|
1587
|
-
return e6.slice(findClusterBreak(e6,
|
|
1615
|
+
function charBefore(e6, y) {
|
|
1616
|
+
return e6.slice(findClusterBreak(e6, y, false), y);
|
|
1588
1617
|
}
|
|
1589
|
-
function charAfter(e6,
|
|
1590
|
-
return e6.slice(
|
|
1618
|
+
function charAfter(e6, y) {
|
|
1619
|
+
return e6.slice(y, findClusterBreak(e6, y));
|
|
1591
1620
|
}
|
|
1592
1621
|
function regexpWordTest(e6) {
|
|
1593
|
-
return (
|
|
1622
|
+
return (y, b, x) => !x[0].length || (e6(charBefore(x.input, x.index)) != CharCategory.Word || e6(charAfter(x.input, x.index)) != CharCategory.Word) && (e6(charAfter(x.input, x.index + x[0].length)) != CharCategory.Word || e6(charBefore(x.input, x.index + x[0].length)) != CharCategory.Word);
|
|
1594
1623
|
}
|
|
1595
1624
|
var RegExpQuery = class extends QueryType {
|
|
1596
|
-
nextMatch(e6,
|
|
1597
|
-
let
|
|
1598
|
-
return
|
|
1599
|
-
}
|
|
1600
|
-
prevMatchInRange(e6,
|
|
1601
|
-
for (let
|
|
1602
|
-
let
|
|
1603
|
-
for (; !
|
|
1604
|
-
if (
|
|
1605
|
-
if (
|
|
1625
|
+
nextMatch(e6, y, b) {
|
|
1626
|
+
let x = regexpCursor(this.spec, e6, b, e6.doc.length).next();
|
|
1627
|
+
return x.done && (x = regexpCursor(this.spec, e6, 0, y).next()), x.done ? null : x.value;
|
|
1628
|
+
}
|
|
1629
|
+
prevMatchInRange(e6, y, b) {
|
|
1630
|
+
for (let x = 1; ; x++) {
|
|
1631
|
+
let S = Math.max(y, b - x * 1e4), C = regexpCursor(this.spec, e6, S, b), w = null;
|
|
1632
|
+
for (; !C.next().done; ) w = C.value;
|
|
1633
|
+
if (w && (S == y || w.from > S + 10)) return w;
|
|
1634
|
+
if (S == y) return null;
|
|
1606
1635
|
}
|
|
1607
1636
|
}
|
|
1608
|
-
prevMatch(e6,
|
|
1609
|
-
return this.prevMatchInRange(e6, 0,
|
|
1637
|
+
prevMatch(e6, y, b) {
|
|
1638
|
+
return this.prevMatchInRange(e6, 0, y) || this.prevMatchInRange(e6, b, e6.doc.length);
|
|
1610
1639
|
}
|
|
1611
1640
|
getReplacement(e6) {
|
|
1612
|
-
return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (
|
|
1613
|
-
if (
|
|
1614
|
-
if (
|
|
1615
|
-
for (let
|
|
1616
|
-
let
|
|
1617
|
-
if (
|
|
1641
|
+
return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (y, b) => {
|
|
1642
|
+
if (b == "&") return e6.match[0];
|
|
1643
|
+
if (b == "$") return "$";
|
|
1644
|
+
for (let y2 = b.length; y2 > 0; y2--) {
|
|
1645
|
+
let x = +b.slice(0, y2);
|
|
1646
|
+
if (x > 0 && x < e6.match.length) return e6.match[x] + b.slice(y2);
|
|
1618
1647
|
}
|
|
1619
|
-
return
|
|
1648
|
+
return y;
|
|
1620
1649
|
});
|
|
1621
1650
|
}
|
|
1622
|
-
matchAll(e6,
|
|
1623
|
-
let
|
|
1624
|
-
for (; !
|
|
1625
|
-
if (
|
|
1626
|
-
|
|
1651
|
+
matchAll(e6, y) {
|
|
1652
|
+
let b = regexpCursor(this.spec, e6, 0, e6.doc.length), x = [];
|
|
1653
|
+
for (; !b.next().done; ) {
|
|
1654
|
+
if (x.length >= y) return null;
|
|
1655
|
+
x.push(b.value);
|
|
1627
1656
|
}
|
|
1628
|
-
return
|
|
1657
|
+
return x;
|
|
1629
1658
|
}
|
|
1630
|
-
highlight(e6,
|
|
1631
|
-
let
|
|
1632
|
-
for (; !
|
|
1659
|
+
highlight(e6, y, b, x) {
|
|
1660
|
+
let S = regexpCursor(this.spec, e6, Math.max(0, y - 250), Math.min(b + 250, e6.doc.length));
|
|
1661
|
+
for (; !S.next().done; ) x(S.value.from, S.value.to);
|
|
1633
1662
|
}
|
|
1634
1663
|
}, setSearchQuery = /* @__PURE__ */ StateEffect.define(), togglePanel$1 = /* @__PURE__ */ StateEffect.define(), searchState = /* @__PURE__ */ StateField.define({
|
|
1635
1664
|
create(e6) {
|
|
1636
1665
|
return new SearchState(defaultQuery(e6).create(), null);
|
|
1637
1666
|
},
|
|
1638
|
-
update(e6,
|
|
1639
|
-
for (let
|
|
1667
|
+
update(e6, y) {
|
|
1668
|
+
for (let b of y.effects) b.is(setSearchQuery) ? e6 = new SearchState(b.value.create(), e6.panel) : b.is(togglePanel$1) && (e6 = new SearchState(e6.query, b.value ? createSearchPanel : null));
|
|
1640
1669
|
return e6;
|
|
1641
1670
|
},
|
|
1642
1671
|
provide: (e6) => showPanel.from(e6, (e7) => e7.panel)
|
|
1643
1672
|
}), SearchState = class {
|
|
1644
|
-
constructor(e6,
|
|
1645
|
-
this.query = e6, this.panel =
|
|
1673
|
+
constructor(e6, y) {
|
|
1674
|
+
this.query = e6, this.panel = y;
|
|
1646
1675
|
}
|
|
1647
1676
|
}, matchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch" }), selectedMatchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
1648
1677
|
constructor(e6) {
|
|
1649
1678
|
this.view = e6, this.decorations = this.highlight(e6.state.field(searchState));
|
|
1650
1679
|
}
|
|
1651
1680
|
update(e6) {
|
|
1652
|
-
let
|
|
1653
|
-
(
|
|
1654
|
-
}
|
|
1655
|
-
highlight({ query: e6, panel:
|
|
1656
|
-
if (!
|
|
1657
|
-
let { view:
|
|
1658
|
-
for (let
|
|
1659
|
-
let { from:
|
|
1660
|
-
for (;
|
|
1661
|
-
e6.highlight(
|
|
1662
|
-
let
|
|
1663
|
-
|
|
1681
|
+
let y = e6.state.field(searchState);
|
|
1682
|
+
(y != e6.startState.field(searchState) || e6.docChanged || e6.selectionSet || e6.viewportChanged) && (this.decorations = this.highlight(y));
|
|
1683
|
+
}
|
|
1684
|
+
highlight({ query: e6, panel: y }) {
|
|
1685
|
+
if (!y || !e6.spec.valid) return Decoration.none;
|
|
1686
|
+
let { view: b } = this, x = new RangeSetBuilder();
|
|
1687
|
+
for (let y2 = 0, S = b.visibleRanges, C = S.length; y2 < C; y2++) {
|
|
1688
|
+
let { from: w, to: T } = S[y2];
|
|
1689
|
+
for (; y2 < C - 1 && T > S[y2 + 1].from - 500; ) T = S[++y2].to;
|
|
1690
|
+
e6.highlight(b.state, w, T, (e7, y3) => {
|
|
1691
|
+
let S2 = b.state.selection.ranges.some((b2) => b2.from == e7 && b2.to == y3);
|
|
1692
|
+
x.add(e7, y3, S2 ? selectedMatchMark : matchMark);
|
|
1664
1693
|
});
|
|
1665
1694
|
}
|
|
1666
|
-
return
|
|
1695
|
+
return x.finish();
|
|
1667
1696
|
}
|
|
1668
1697
|
}, { decorations: (e6) => e6.decorations });
|
|
1669
1698
|
function searchCommand(e6) {
|
|
1670
|
-
return (
|
|
1671
|
-
let
|
|
1672
|
-
return
|
|
1699
|
+
return (y) => {
|
|
1700
|
+
let b = y.state.field(searchState, false);
|
|
1701
|
+
return b && b.query.spec.valid ? e6(y, b) : openSearchPanel(y);
|
|
1673
1702
|
};
|
|
1674
1703
|
}
|
|
1675
|
-
var findNext = /* @__PURE__ */ searchCommand((e6, { query:
|
|
1676
|
-
let { to:
|
|
1677
|
-
if (!
|
|
1678
|
-
let
|
|
1704
|
+
var findNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
|
|
1705
|
+
let { to: b } = e6.state.selection.main, x = y.nextMatch(e6.state, b, b);
|
|
1706
|
+
if (!x) return false;
|
|
1707
|
+
let S = EditorSelection.single(x.from, x.to), C = e6.state.facet(searchConfigFacet);
|
|
1679
1708
|
return e6.dispatch({
|
|
1680
|
-
selection:
|
|
1681
|
-
effects: [announceMatch(e6,
|
|
1709
|
+
selection: S,
|
|
1710
|
+
effects: [announceMatch(e6, x), C.scrollToMatch(S.main, e6)],
|
|
1682
1711
|
userEvent: "select.search"
|
|
1683
1712
|
}), selectSearchInput(e6), true;
|
|
1684
|
-
}), findPrevious = /* @__PURE__ */ searchCommand((e6, { query:
|
|
1685
|
-
let { state:
|
|
1686
|
-
if (!
|
|
1687
|
-
let
|
|
1713
|
+
}), findPrevious = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
|
|
1714
|
+
let { state: b } = e6, { from: x } = b.selection.main, S = y.prevMatch(b, x, x);
|
|
1715
|
+
if (!S) return false;
|
|
1716
|
+
let C = EditorSelection.single(S.from, S.to), w = e6.state.facet(searchConfigFacet);
|
|
1688
1717
|
return e6.dispatch({
|
|
1689
|
-
selection:
|
|
1690
|
-
effects: [announceMatch(e6,
|
|
1718
|
+
selection: C,
|
|
1719
|
+
effects: [announceMatch(e6, S), w.scrollToMatch(C.main, e6)],
|
|
1691
1720
|
userEvent: "select.search"
|
|
1692
1721
|
}), selectSearchInput(e6), true;
|
|
1693
|
-
}), selectMatches = /* @__PURE__ */ searchCommand((e6, { query:
|
|
1694
|
-
let
|
|
1695
|
-
return !
|
|
1696
|
-
selection: EditorSelection.create(
|
|
1722
|
+
}), selectMatches = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
|
|
1723
|
+
let b = y.matchAll(e6.state, 1e3);
|
|
1724
|
+
return !b || !b.length ? false : (e6.dispatch({
|
|
1725
|
+
selection: EditorSelection.create(b.map((e7) => EditorSelection.range(e7.from, e7.to))),
|
|
1697
1726
|
userEvent: "select.search.matches"
|
|
1698
1727
|
}), true);
|
|
1699
|
-
}), selectSelectionMatches = ({ state: e6, dispatch:
|
|
1700
|
-
let
|
|
1701
|
-
if (
|
|
1702
|
-
let { from:
|
|
1703
|
-
for (let
|
|
1704
|
-
if (
|
|
1705
|
-
|
|
1706
|
-
}
|
|
1707
|
-
return
|
|
1708
|
-
selection: EditorSelection.create(
|
|
1728
|
+
}), selectSelectionMatches = ({ state: e6, dispatch: y }) => {
|
|
1729
|
+
let b = e6.selection;
|
|
1730
|
+
if (b.ranges.length > 1 || b.main.empty) return false;
|
|
1731
|
+
let { from: x, to: S } = b.main, C = [], w = 0;
|
|
1732
|
+
for (let y2 = new SearchCursor(e6.doc, e6.sliceDoc(x, S)); !y2.next().done; ) {
|
|
1733
|
+
if (C.length > 1e3) return false;
|
|
1734
|
+
y2.value.from == x && (w = C.length), C.push(EditorSelection.range(y2.value.from, y2.value.to));
|
|
1735
|
+
}
|
|
1736
|
+
return y(e6.update({
|
|
1737
|
+
selection: EditorSelection.create(C, w),
|
|
1709
1738
|
userEvent: "select.search.matches"
|
|
1710
1739
|
})), true;
|
|
1711
|
-
}, replaceNext = /* @__PURE__ */ searchCommand((e6, { query:
|
|
1712
|
-
let { state:
|
|
1713
|
-
if (
|
|
1714
|
-
let
|
|
1715
|
-
if (!
|
|
1716
|
-
let
|
|
1717
|
-
|
|
1718
|
-
from:
|
|
1719
|
-
to:
|
|
1720
|
-
insert:
|
|
1721
|
-
}),
|
|
1722
|
-
let
|
|
1723
|
-
return
|
|
1724
|
-
changes:
|
|
1725
|
-
selection:
|
|
1726
|
-
effects:
|
|
1740
|
+
}, replaceNext = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
|
|
1741
|
+
let { state: b } = e6, { from: x, to: S } = b.selection.main;
|
|
1742
|
+
if (b.readOnly) return false;
|
|
1743
|
+
let C = y.nextMatch(b, x, x);
|
|
1744
|
+
if (!C) return false;
|
|
1745
|
+
let w = C, T = [], E, D, O = [];
|
|
1746
|
+
w.from == x && w.to == S && (D = b.toText(y.getReplacement(w)), T.push({
|
|
1747
|
+
from: w.from,
|
|
1748
|
+
to: w.to,
|
|
1749
|
+
insert: D
|
|
1750
|
+
}), w = y.nextMatch(b, w.from, w.to), O.push(EditorView.announce.of(b.phrase("replaced match on line $", b.doc.lineAt(x).number) + ".")));
|
|
1751
|
+
let k = e6.state.changes(T);
|
|
1752
|
+
return w && (E = EditorSelection.single(w.from, w.to).map(k), O.push(announceMatch(e6, w)), O.push(b.facet(searchConfigFacet).scrollToMatch(E.main, e6))), e6.dispatch({
|
|
1753
|
+
changes: k,
|
|
1754
|
+
selection: E,
|
|
1755
|
+
effects: O,
|
|
1727
1756
|
userEvent: "input.replace"
|
|
1728
1757
|
}), true;
|
|
1729
|
-
}), replaceAll = /* @__PURE__ */ searchCommand((e6, { query:
|
|
1758
|
+
}), replaceAll = /* @__PURE__ */ searchCommand((e6, { query: y }) => {
|
|
1730
1759
|
if (e6.state.readOnly) return false;
|
|
1731
|
-
let
|
|
1732
|
-
let { from:
|
|
1760
|
+
let b = y.matchAll(e6.state, 1e9).map((e7) => {
|
|
1761
|
+
let { from: b2, to: x2 } = e7;
|
|
1733
1762
|
return {
|
|
1734
|
-
from:
|
|
1735
|
-
to:
|
|
1736
|
-
insert:
|
|
1763
|
+
from: b2,
|
|
1764
|
+
to: x2,
|
|
1765
|
+
insert: y.getReplacement(e7)
|
|
1737
1766
|
};
|
|
1738
1767
|
});
|
|
1739
|
-
if (!
|
|
1740
|
-
let
|
|
1768
|
+
if (!b.length) return false;
|
|
1769
|
+
let x = e6.state.phrase("replaced $ matches", b.length) + ".";
|
|
1741
1770
|
return e6.dispatch({
|
|
1742
|
-
changes:
|
|
1743
|
-
effects: EditorView.announce.of(
|
|
1771
|
+
changes: b,
|
|
1772
|
+
effects: EditorView.announce.of(x),
|
|
1744
1773
|
userEvent: "input.replace.all"
|
|
1745
1774
|
}), true;
|
|
1746
1775
|
});
|
|
1747
1776
|
function createSearchPanel(e6) {
|
|
1748
1777
|
return e6.state.facet(searchConfigFacet).createPanel(e6);
|
|
1749
1778
|
}
|
|
1750
|
-
function defaultQuery(e6,
|
|
1751
|
-
let
|
|
1752
|
-
if (
|
|
1753
|
-
let
|
|
1779
|
+
function defaultQuery(e6, y) {
|
|
1780
|
+
let b = e6.selection.main, x = b.empty || b.to > b.from + 100 ? "" : e6.sliceDoc(b.from, b.to);
|
|
1781
|
+
if (y && !x) return y;
|
|
1782
|
+
let S = e6.facet(searchConfigFacet);
|
|
1754
1783
|
return new SearchQuery({
|
|
1755
|
-
search: (
|
|
1756
|
-
caseSensitive: (
|
|
1757
|
-
literal: (
|
|
1758
|
-
regexp: (
|
|
1759
|
-
wholeWord: (
|
|
1784
|
+
search: (y == null ? void 0 : y.literal) ?? S.literal ? x : x.replace(/\n/g, "\\n"),
|
|
1785
|
+
caseSensitive: (y == null ? void 0 : y.caseSensitive) ?? S.caseSensitive,
|
|
1786
|
+
literal: (y == null ? void 0 : y.literal) ?? S.literal,
|
|
1787
|
+
regexp: (y == null ? void 0 : y.regexp) ?? S.regexp,
|
|
1788
|
+
wholeWord: (y == null ? void 0 : y.wholeWord) ?? S.wholeWord
|
|
1760
1789
|
});
|
|
1761
1790
|
}
|
|
1762
1791
|
function getSearchInput(e6) {
|
|
1763
|
-
let
|
|
1764
|
-
return
|
|
1792
|
+
let y = getPanel(e6, createSearchPanel);
|
|
1793
|
+
return y && y.dom.querySelector("[main-field]");
|
|
1765
1794
|
}
|
|
1766
1795
|
function selectSearchInput(e6) {
|
|
1767
|
-
let
|
|
1768
|
-
|
|
1796
|
+
let y = getSearchInput(e6);
|
|
1797
|
+
y && y == e6.root.activeElement && y.select();
|
|
1769
1798
|
}
|
|
1770
1799
|
var openSearchPanel = (e6) => {
|
|
1771
|
-
let
|
|
1772
|
-
if (
|
|
1773
|
-
let
|
|
1774
|
-
if (
|
|
1775
|
-
let
|
|
1776
|
-
|
|
1800
|
+
let y = e6.state.field(searchState, false);
|
|
1801
|
+
if (y && y.panel) {
|
|
1802
|
+
let b = getSearchInput(e6);
|
|
1803
|
+
if (b && b != e6.root.activeElement) {
|
|
1804
|
+
let x = defaultQuery(e6.state, y.query.spec);
|
|
1805
|
+
x.valid && e6.dispatch({ effects: setSearchQuery.of(x) }), b.focus(), b.select();
|
|
1777
1806
|
}
|
|
1778
|
-
} else e6.dispatch({ effects: [togglePanel$1.of(true),
|
|
1807
|
+
} else e6.dispatch({ effects: [togglePanel$1.of(true), y ? setSearchQuery.of(defaultQuery(e6.state, y.query.spec)) : StateEffect.appendConfig.of(searchExtensions)] });
|
|
1779
1808
|
return true;
|
|
1780
1809
|
}, closeSearchPanel = (e6) => {
|
|
1781
|
-
let
|
|
1782
|
-
if (!
|
|
1783
|
-
let
|
|
1784
|
-
return
|
|
1810
|
+
let y = e6.state.field(searchState, false);
|
|
1811
|
+
if (!y || !y.panel) return false;
|
|
1812
|
+
let b = getPanel(e6, createSearchPanel);
|
|
1813
|
+
return b && b.dom.contains(e6.root.activeElement) && e6.focus(), e6.dispatch({ effects: togglePanel$1.of(false) }), true;
|
|
1785
1814
|
}, searchKeymap = [
|
|
1786
1815
|
{
|
|
1787
1816
|
key: "Mod-f",
|
|
@@ -1823,9 +1852,9 @@ var openSearchPanel = (e6) => {
|
|
|
1823
1852
|
], SearchPanel = class {
|
|
1824
1853
|
constructor(e6) {
|
|
1825
1854
|
this.view = e6;
|
|
1826
|
-
let
|
|
1855
|
+
let y = this.query = e6.state.field(searchState).query.spec;
|
|
1827
1856
|
this.commit = this.commit.bind(this), this.searchField = crelt("input", {
|
|
1828
|
-
value:
|
|
1857
|
+
value: y.search,
|
|
1829
1858
|
placeholder: phrase(e6, "Find"),
|
|
1830
1859
|
"aria-label": phrase(e6, "Find"),
|
|
1831
1860
|
class: "cm-textfield",
|
|
@@ -1835,7 +1864,7 @@ var openSearchPanel = (e6) => {
|
|
|
1835
1864
|
onchange: this.commit,
|
|
1836
1865
|
onkeyup: this.commit
|
|
1837
1866
|
}), this.replaceField = crelt("input", {
|
|
1838
|
-
value:
|
|
1867
|
+
value: y.replace,
|
|
1839
1868
|
placeholder: phrase(e6, "Replace"),
|
|
1840
1869
|
"aria-label": phrase(e6, "Replace"),
|
|
1841
1870
|
class: "cm-textfield",
|
|
@@ -1847,45 +1876,45 @@ var openSearchPanel = (e6) => {
|
|
|
1847
1876
|
type: "checkbox",
|
|
1848
1877
|
name: "case",
|
|
1849
1878
|
form: "",
|
|
1850
|
-
checked:
|
|
1879
|
+
checked: y.caseSensitive,
|
|
1851
1880
|
onchange: this.commit
|
|
1852
1881
|
}), this.reField = crelt("input", {
|
|
1853
1882
|
type: "checkbox",
|
|
1854
1883
|
name: "re",
|
|
1855
1884
|
form: "",
|
|
1856
|
-
checked:
|
|
1885
|
+
checked: y.regexp,
|
|
1857
1886
|
onchange: this.commit
|
|
1858
1887
|
}), this.wordField = crelt("input", {
|
|
1859
1888
|
type: "checkbox",
|
|
1860
1889
|
name: "word",
|
|
1861
1890
|
form: "",
|
|
1862
|
-
checked:
|
|
1891
|
+
checked: y.wholeWord,
|
|
1863
1892
|
onchange: this.commit
|
|
1864
1893
|
});
|
|
1865
|
-
function
|
|
1894
|
+
function b(e7, y2, b2) {
|
|
1866
1895
|
return crelt("button", {
|
|
1867
1896
|
class: "cm-button",
|
|
1868
1897
|
name: e7,
|
|
1869
|
-
onclick:
|
|
1898
|
+
onclick: y2,
|
|
1870
1899
|
type: "button"
|
|
1871
|
-
},
|
|
1900
|
+
}, b2);
|
|
1872
1901
|
}
|
|
1873
1902
|
this.dom = crelt("div", {
|
|
1874
1903
|
onkeydown: (e7) => this.keydown(e7),
|
|
1875
1904
|
class: "cm-search"
|
|
1876
1905
|
}, [
|
|
1877
1906
|
this.searchField,
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1907
|
+
b("next", () => findNext(e6), [phrase(e6, "next")]),
|
|
1908
|
+
b("prev", () => findPrevious(e6), [phrase(e6, "previous")]),
|
|
1909
|
+
b("select", () => selectMatches(e6), [phrase(e6, "all")]),
|
|
1881
1910
|
crelt("label", null, [this.caseField, phrase(e6, "match case")]),
|
|
1882
1911
|
crelt("label", null, [this.reField, phrase(e6, "regexp")]),
|
|
1883
1912
|
crelt("label", null, [this.wordField, phrase(e6, "by word")]),
|
|
1884
1913
|
...e6.state.readOnly ? [] : [
|
|
1885
1914
|
crelt("br"),
|
|
1886
1915
|
this.replaceField,
|
|
1887
|
-
|
|
1888
|
-
|
|
1916
|
+
b("replace", () => replaceNext(e6), [phrase(e6, "replace")]),
|
|
1917
|
+
b("replaceAll", () => replaceAll(e6), [phrase(e6, "replace all")])
|
|
1889
1918
|
],
|
|
1890
1919
|
crelt("button", {
|
|
1891
1920
|
name: "close",
|
|
@@ -1909,7 +1938,7 @@ var openSearchPanel = (e6) => {
|
|
|
1909
1938
|
runScopeHandlers(this.view, e6, "search-panel") ? e6.preventDefault() : e6.keyCode == 13 && e6.target == this.searchField ? (e6.preventDefault(), (e6.shiftKey ? findPrevious : findNext)(this.view)) : e6.keyCode == 13 && e6.target == this.replaceField && (e6.preventDefault(), replaceNext(this.view));
|
|
1910
1939
|
}
|
|
1911
1940
|
update(e6) {
|
|
1912
|
-
for (let
|
|
1941
|
+
for (let y of e6.transactions) for (let e7 of y.effects) e7.is(setSearchQuery) && !e7.value.eq(this.query) && this.setQuery(e7.value);
|
|
1913
1942
|
}
|
|
1914
1943
|
setQuery(e6) {
|
|
1915
1944
|
this.query = e6, this.searchField.value = e6.search, this.replaceField.value = e6.replace, this.caseField.checked = e6.caseSensitive, this.reField.checked = e6.regexp, this.wordField.checked = e6.wholeWord;
|
|
@@ -1924,25 +1953,25 @@ var openSearchPanel = (e6) => {
|
|
|
1924
1953
|
return this.view.state.facet(searchConfigFacet).top;
|
|
1925
1954
|
}
|
|
1926
1955
|
};
|
|
1927
|
-
function phrase(e6,
|
|
1928
|
-
return e6.state.phrase(
|
|
1956
|
+
function phrase(e6, y) {
|
|
1957
|
+
return e6.state.phrase(y);
|
|
1929
1958
|
}
|
|
1930
1959
|
var AnnounceMargin = 30, Break = /[\s\.,:;?!]/;
|
|
1931
|
-
function announceMatch(e6, { from:
|
|
1932
|
-
let
|
|
1933
|
-
if (
|
|
1934
|
-
for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(
|
|
1935
|
-
|
|
1960
|
+
function announceMatch(e6, { from: y, to: b }) {
|
|
1961
|
+
let x = e6.state.doc.lineAt(y), S = e6.state.doc.lineAt(b).to, C = Math.max(x.from, y - AnnounceMargin), w = Math.min(S, b + AnnounceMargin), T = e6.state.sliceDoc(C, w);
|
|
1962
|
+
if (C != x.from) {
|
|
1963
|
+
for (let e7 = 0; e7 < AnnounceMargin; e7++) if (!Break.test(T[e7 + 1]) && Break.test(T[e7])) {
|
|
1964
|
+
T = T.slice(e7);
|
|
1936
1965
|
break;
|
|
1937
1966
|
}
|
|
1938
1967
|
}
|
|
1939
|
-
if (
|
|
1940
|
-
for (let e7 =
|
|
1941
|
-
|
|
1968
|
+
if (w != S) {
|
|
1969
|
+
for (let e7 = T.length - 1; e7 > T.length - AnnounceMargin; e7--) if (!Break.test(T[e7 - 1]) && Break.test(T[e7])) {
|
|
1970
|
+
T = T.slice(0, e7);
|
|
1942
1971
|
break;
|
|
1943
1972
|
}
|
|
1944
1973
|
}
|
|
1945
|
-
return EditorView.announce.of(`${e6.state.phrase("current match")}. ${
|
|
1974
|
+
return EditorView.announce.of(`${e6.state.phrase("current match")}. ${T} ${e6.state.phrase("on line")} ${x.number}.`);
|
|
1946
1975
|
}
|
|
1947
1976
|
var baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
|
|
1948
1977
|
".cm-panel.cm-search": {
|
|
@@ -1974,116 +2003,116 @@ var baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
|
|
|
1974
2003
|
/* @__PURE__ */ Prec.low(searchHighlighter),
|
|
1975
2004
|
baseTheme$2
|
|
1976
2005
|
], SelectedDiagnostic = class {
|
|
1977
|
-
constructor(e6,
|
|
1978
|
-
this.from = e6, this.to =
|
|
2006
|
+
constructor(e6, y, b) {
|
|
2007
|
+
this.from = e6, this.to = y, this.diagnostic = b;
|
|
1979
2008
|
}
|
|
1980
2009
|
}, LintState = class e4 {
|
|
1981
|
-
constructor(e6,
|
|
1982
|
-
this.diagnostics = e6, this.panel =
|
|
2010
|
+
constructor(e6, y, b) {
|
|
2011
|
+
this.diagnostics = e6, this.panel = y, this.selected = b;
|
|
1983
2012
|
}
|
|
1984
|
-
static init(
|
|
1985
|
-
let
|
|
1986
|
-
|
|
1987
|
-
let
|
|
2013
|
+
static init(y, b, x) {
|
|
2014
|
+
let S = x.facet(lintConfig).markerFilter;
|
|
2015
|
+
S && (y = S(y, x));
|
|
2016
|
+
let C = y.slice().sort((e6, y2) => e6.from - y2.from || e6.to - y2.to), w = new RangeSetBuilder(), T = [], E = 0;
|
|
1988
2017
|
for (let e6 = 0; ; ) {
|
|
1989
|
-
let
|
|
1990
|
-
if (!
|
|
1991
|
-
let
|
|
1992
|
-
for (
|
|
1993
|
-
let
|
|
1994
|
-
if (
|
|
2018
|
+
let y2 = e6 == C.length ? null : C[e6];
|
|
2019
|
+
if (!y2 && !T.length) break;
|
|
2020
|
+
let b2, S2;
|
|
2021
|
+
for (T.length ? (b2 = E, S2 = T.reduce((e7, y3) => Math.min(e7, y3.to), y2 && y2.from > b2 ? y2.from : 1e8)) : (b2 = y2.from, S2 = y2.to, T.push(y2), e6++); e6 < C.length; ) {
|
|
2022
|
+
let y3 = C[e6];
|
|
2023
|
+
if (y3.from == b2 && (y3.to > y3.from || y3.to == b2)) T.push(y3), e6++, S2 = Math.min(y3.to, S2);
|
|
1995
2024
|
else {
|
|
1996
|
-
|
|
2025
|
+
S2 = Math.min(y3.from, S2);
|
|
1997
2026
|
break;
|
|
1998
2027
|
}
|
|
1999
2028
|
}
|
|
2000
|
-
let
|
|
2001
|
-
if (
|
|
2002
|
-
widget: new DiagnosticWidget(
|
|
2003
|
-
diagnostics:
|
|
2029
|
+
let D2 = maxSeverity(T);
|
|
2030
|
+
if (T.some((e7) => e7.from == e7.to || e7.from == e7.to - 1 && x.doc.lineAt(e7.from).to == e7.from)) w.add(b2, b2, Decoration.widget({
|
|
2031
|
+
widget: new DiagnosticWidget(D2),
|
|
2032
|
+
diagnostics: T.slice()
|
|
2004
2033
|
}));
|
|
2005
2034
|
else {
|
|
2006
|
-
let e7 =
|
|
2007
|
-
|
|
2008
|
-
class: "cm-lintRange cm-lintRange-" +
|
|
2009
|
-
diagnostics:
|
|
2010
|
-
inclusiveEnd:
|
|
2035
|
+
let e7 = T.reduce((e8, y3) => y3.markClass ? e8 + " " + y3.markClass : e8, "");
|
|
2036
|
+
w.add(b2, S2, Decoration.mark({
|
|
2037
|
+
class: "cm-lintRange cm-lintRange-" + D2 + e7,
|
|
2038
|
+
diagnostics: T.slice(),
|
|
2039
|
+
inclusiveEnd: T.some((e8) => e8.to > S2)
|
|
2011
2040
|
}));
|
|
2012
2041
|
}
|
|
2013
|
-
|
|
2014
|
-
for (let e7 = 0; e7 <
|
|
2042
|
+
E = S2;
|
|
2043
|
+
for (let e7 = 0; e7 < T.length; e7++) T[e7].to <= E && T.splice(e7--, 1);
|
|
2015
2044
|
}
|
|
2016
|
-
let
|
|
2017
|
-
return new e4(
|
|
2045
|
+
let D = w.finish();
|
|
2046
|
+
return new e4(D, b, findDiagnostic(D));
|
|
2018
2047
|
}
|
|
2019
2048
|
};
|
|
2020
|
-
function findDiagnostic(e6,
|
|
2021
|
-
let
|
|
2022
|
-
return e6.between(
|
|
2023
|
-
if (!(
|
|
2024
|
-
else if (
|
|
2025
|
-
else
|
|
2026
|
-
}),
|
|
2049
|
+
function findDiagnostic(e6, y = null, b = 0) {
|
|
2050
|
+
let x = null;
|
|
2051
|
+
return e6.between(b, 1e9, (e7, b2, { spec: S }) => {
|
|
2052
|
+
if (!(y && S.diagnostics.indexOf(y) < 0)) if (!x) x = new SelectedDiagnostic(e7, b2, y || S.diagnostics[0]);
|
|
2053
|
+
else if (S.diagnostics.indexOf(x.diagnostic) < 0) return false;
|
|
2054
|
+
else x = new SelectedDiagnostic(x.from, b2, x.diagnostic);
|
|
2055
|
+
}), x;
|
|
2027
2056
|
}
|
|
2028
|
-
function hideTooltip(e6,
|
|
2029
|
-
let
|
|
2030
|
-
if (
|
|
2031
|
-
let
|
|
2032
|
-
return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(
|
|
2057
|
+
function hideTooltip(e6, y) {
|
|
2058
|
+
let b = y.pos, x = y.end || b, S = e6.state.facet(lintConfig).hideOn(e6, b, x);
|
|
2059
|
+
if (S != null) return S;
|
|
2060
|
+
let C = e6.startState.doc.lineAt(y.pos);
|
|
2061
|
+
return !!(e6.effects.some((e7) => e7.is(setDiagnosticsEffect)) || e6.changes.touchesRange(C.from, Math.max(C.to, x)));
|
|
2033
2062
|
}
|
|
2034
|
-
function maybeEnableLint(e6,
|
|
2035
|
-
return e6.field(lintState, false) ?
|
|
2063
|
+
function maybeEnableLint(e6, y) {
|
|
2064
|
+
return e6.field(lintState, false) ? y : y.concat(StateEffect.appendConfig.of(lintExtensions));
|
|
2036
2065
|
}
|
|
2037
|
-
function setDiagnostics(e6,
|
|
2038
|
-
return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(
|
|
2066
|
+
function setDiagnostics(e6, y) {
|
|
2067
|
+
return { effects: maybeEnableLint(e6, [setDiagnosticsEffect.of(y)]) };
|
|
2039
2068
|
}
|
|
2040
2069
|
var setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define(), togglePanel = /* @__PURE__ */ StateEffect.define(), movePanelSelection = /* @__PURE__ */ StateEffect.define(), lintState = /* @__PURE__ */ StateField.define({
|
|
2041
2070
|
create() {
|
|
2042
2071
|
return new LintState(Decoration.none, null, null);
|
|
2043
2072
|
},
|
|
2044
|
-
update(e6,
|
|
2045
|
-
if (
|
|
2046
|
-
let
|
|
2073
|
+
update(e6, y) {
|
|
2074
|
+
if (y.docChanged && e6.diagnostics.size) {
|
|
2075
|
+
let b = e6.diagnostics.map(y.changes), x = null, S = e6.panel;
|
|
2047
2076
|
if (e6.selected) {
|
|
2048
|
-
let
|
|
2049
|
-
|
|
2077
|
+
let S2 = y.changes.mapPos(e6.selected.from, 1);
|
|
2078
|
+
x = findDiagnostic(b, e6.selected.diagnostic, S2) || findDiagnostic(b, null, S2);
|
|
2050
2079
|
}
|
|
2051
|
-
!
|
|
2080
|
+
!b.size && S && y.state.facet(lintConfig).autoPanel && (S = null), e6 = new LintState(b, S, x);
|
|
2052
2081
|
}
|
|
2053
|
-
for (let
|
|
2054
|
-
let
|
|
2055
|
-
e6 = LintState.init(
|
|
2056
|
-
} else
|
|
2082
|
+
for (let b of y.effects) if (b.is(setDiagnosticsEffect)) {
|
|
2083
|
+
let x = y.state.facet(lintConfig).autoPanel ? b.value.length ? LintPanel.open : null : e6.panel;
|
|
2084
|
+
e6 = LintState.init(b.value, x, y.state);
|
|
2085
|
+
} else b.is(togglePanel) ? e6 = new LintState(e6.diagnostics, b.value ? LintPanel.open : null, e6.selected) : b.is(movePanelSelection) && (e6 = new LintState(e6.diagnostics, e6.panel, b.value));
|
|
2057
2086
|
return e6;
|
|
2058
2087
|
},
|
|
2059
2088
|
provide: (e6) => [showPanel.from(e6, (e7) => e7.panel), EditorView.decorations.from(e6, (e7) => e7.diagnostics)]
|
|
2060
2089
|
}), activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
2061
|
-
function lintTooltip(e6,
|
|
2062
|
-
let { diagnostics:
|
|
2063
|
-
|
|
2064
|
-
if (
|
|
2090
|
+
function lintTooltip(e6, y, b) {
|
|
2091
|
+
let { diagnostics: x } = e6.state.field(lintState), S, C = -1, w = -1;
|
|
2092
|
+
x.between(y - (b < 0 ? 1 : 0), y + (b > 0 ? 1 : 0), (e7, x2, { spec: T2 }) => {
|
|
2093
|
+
if (y >= e7 && y <= x2 && (e7 == x2 || (y > e7 || b > 0) && (y < x2 || b < 0))) return S = T2.diagnostics, C = e7, w = x2, false;
|
|
2065
2094
|
});
|
|
2066
|
-
let
|
|
2067
|
-
return
|
|
2068
|
-
pos:
|
|
2069
|
-
end:
|
|
2070
|
-
above: e6.state.doc.lineAt(
|
|
2095
|
+
let T = e6.state.facet(lintConfig).tooltipFilter;
|
|
2096
|
+
return S && T && (S = T(S, e6.state)), S ? {
|
|
2097
|
+
pos: C,
|
|
2098
|
+
end: w,
|
|
2099
|
+
above: e6.state.doc.lineAt(C).to < w,
|
|
2071
2100
|
create() {
|
|
2072
|
-
return { dom: diagnosticsTooltip(e6,
|
|
2101
|
+
return { dom: diagnosticsTooltip(e6, S) };
|
|
2073
2102
|
}
|
|
2074
2103
|
} : null;
|
|
2075
2104
|
}
|
|
2076
|
-
function diagnosticsTooltip(e6,
|
|
2077
|
-
return crelt("ul", { class: "cm-tooltip-lint" },
|
|
2105
|
+
function diagnosticsTooltip(e6, y) {
|
|
2106
|
+
return crelt("ul", { class: "cm-tooltip-lint" }, y.map((y2) => renderDiagnostic(e6, y2, false)));
|
|
2078
2107
|
}
|
|
2079
2108
|
var openLintPanel = (e6) => {
|
|
2080
|
-
let
|
|
2081
|
-
(!
|
|
2082
|
-
let
|
|
2083
|
-
return
|
|
2109
|
+
let y = e6.state.field(lintState, false);
|
|
2110
|
+
(!y || !y.panel) && e6.dispatch({ effects: maybeEnableLint(e6.state, [togglePanel.of(true)]) });
|
|
2111
|
+
let b = getPanel(e6, LintPanel.open);
|
|
2112
|
+
return b && b.dom.querySelector(".cm-panel-lint ul").focus(), true;
|
|
2084
2113
|
}, closeLintPanel = (e6) => {
|
|
2085
|
-
let
|
|
2086
|
-
return !
|
|
2114
|
+
let y = e6.state.field(lintState, false);
|
|
2115
|
+
return !y || !y.panel ? false : (e6.dispatch({ effects: togglePanel.of(false) }), true);
|
|
2087
2116
|
}, lintKeymap = [{
|
|
2088
2117
|
key: "Mod-Shift-m",
|
|
2089
2118
|
run: openLintPanel,
|
|
@@ -2091,13 +2120,13 @@ var openLintPanel = (e6) => {
|
|
|
2091
2120
|
}, {
|
|
2092
2121
|
key: "F8",
|
|
2093
2122
|
run: (e6) => {
|
|
2094
|
-
let
|
|
2095
|
-
if (!
|
|
2096
|
-
let
|
|
2097
|
-
return !
|
|
2123
|
+
let y = e6.state.field(lintState, false);
|
|
2124
|
+
if (!y) return false;
|
|
2125
|
+
let b = e6.state.selection.main, x = y.diagnostics.iter(b.to + 1);
|
|
2126
|
+
return !x.value && (x = y.diagnostics.iter(0), !x.value || x.from == b.from && x.to == b.to) ? false : (e6.dispatch({
|
|
2098
2127
|
selection: {
|
|
2099
|
-
anchor:
|
|
2100
|
-
head:
|
|
2128
|
+
anchor: x.from,
|
|
2129
|
+
head: x.to
|
|
2101
2130
|
},
|
|
2102
2131
|
scrollIntoView: true
|
|
2103
2132
|
}), true);
|
|
@@ -2105,8 +2134,8 @@ var openLintPanel = (e6) => {
|
|
|
2105
2134
|
}], lintPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
|
|
2106
2135
|
constructor(e6) {
|
|
2107
2136
|
this.view = e6, this.timeout = -1, this.set = true;
|
|
2108
|
-
let { delay:
|
|
2109
|
-
this.lintTime = Date.now() +
|
|
2137
|
+
let { delay: y } = e6.state.facet(lintConfig);
|
|
2138
|
+
this.lintTime = Date.now() + y, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, y);
|
|
2110
2139
|
}
|
|
2111
2140
|
run() {
|
|
2112
2141
|
clearTimeout(this.timeout);
|
|
@@ -2114,17 +2143,17 @@ var openLintPanel = (e6) => {
|
|
|
2114
2143
|
if (e6 < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e6);
|
|
2115
2144
|
else {
|
|
2116
2145
|
this.set = false;
|
|
2117
|
-
let { state: e7 } = this.view, { sources:
|
|
2118
|
-
|
|
2119
|
-
this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state,
|
|
2146
|
+
let { state: e7 } = this.view, { sources: y } = e7.facet(lintConfig);
|
|
2147
|
+
y.length && batchResults(y.map((e8) => Promise.resolve(e8(this.view))), (y2) => {
|
|
2148
|
+
this.view.state.doc == e7.doc && this.view.dispatch(setDiagnostics(this.view.state, y2.reduce((e8, y3) => e8.concat(y3))));
|
|
2120
2149
|
}, (e8) => {
|
|
2121
2150
|
logException(this.view.state, e8);
|
|
2122
2151
|
});
|
|
2123
2152
|
}
|
|
2124
2153
|
}
|
|
2125
2154
|
update(e6) {
|
|
2126
|
-
let
|
|
2127
|
-
(e6.docChanged ||
|
|
2155
|
+
let y = e6.state.facet(lintConfig);
|
|
2156
|
+
(e6.docChanged || y != e6.startState.facet(lintConfig) || y.needsRefresh && y.needsRefresh(e6)) && (this.lintTime = Date.now() + y.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, y.delay)));
|
|
2128
2157
|
}
|
|
2129
2158
|
force() {
|
|
2130
2159
|
this.set && (this.lintTime = Date.now(), this.run());
|
|
@@ -2133,67 +2162,80 @@ var openLintPanel = (e6) => {
|
|
|
2133
2162
|
clearTimeout(this.timeout);
|
|
2134
2163
|
}
|
|
2135
2164
|
});
|
|
2136
|
-
function batchResults(e6,
|
|
2137
|
-
let
|
|
2138
|
-
for (let
|
|
2139
|
-
|
|
2140
|
-
},
|
|
2165
|
+
function batchResults(e6, y, b) {
|
|
2166
|
+
let x = [], S = -1;
|
|
2167
|
+
for (let C of e6) C.then((b2) => {
|
|
2168
|
+
x.push(b2), clearTimeout(S), x.length == e6.length ? y(x) : S = setTimeout(() => y(x), 200);
|
|
2169
|
+
}, b);
|
|
2141
2170
|
}
|
|
2142
2171
|
var lintConfig = /* @__PURE__ */ Facet.define({ combine(e6) {
|
|
2143
|
-
return
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2172
|
+
return {
|
|
2173
|
+
sources: e6.map((e7) => e7.source).filter((e7) => e7 != null),
|
|
2174
|
+
...combineConfig(e6.map((e7) => e7.config), {
|
|
2175
|
+
delay: 750,
|
|
2176
|
+
markerFilter: null,
|
|
2177
|
+
tooltipFilter: null,
|
|
2178
|
+
needsRefresh: null,
|
|
2179
|
+
hideOn: () => null
|
|
2180
|
+
}, {
|
|
2181
|
+
delay: Math.max,
|
|
2182
|
+
markerFilter: combineFilter,
|
|
2183
|
+
tooltipFilter: combineFilter,
|
|
2184
|
+
needsRefresh: (e7, y) => e7 ? y ? (b) => e7(b) || y(b) : e7 : y,
|
|
2185
|
+
hideOn: (e7, y) => e7 ? y ? (b, x, S) => e7(b, x, S) || y(b, x, S) : e7 : y,
|
|
2186
|
+
autoPanel: (e7, y) => e7 || y
|
|
2187
|
+
})
|
|
2188
|
+
};
|
|
2150
2189
|
} });
|
|
2151
|
-
function
|
|
2190
|
+
function combineFilter(e6, y) {
|
|
2191
|
+
return e6 ? y ? (b, x) => y(e6(b, x), x) : e6 : y;
|
|
2192
|
+
}
|
|
2193
|
+
function linter(e6, y = {}) {
|
|
2152
2194
|
return [
|
|
2153
2195
|
lintConfig.of({
|
|
2154
2196
|
source: e6,
|
|
2155
|
-
config:
|
|
2197
|
+
config: y
|
|
2156
2198
|
}),
|
|
2157
2199
|
lintPlugin,
|
|
2158
2200
|
lintExtensions
|
|
2159
2201
|
];
|
|
2160
2202
|
}
|
|
2161
2203
|
function assignKeys(e6) {
|
|
2162
|
-
let
|
|
2163
|
-
if (e6) actions: for (let { name:
|
|
2164
|
-
for (let e7 = 0; e7 <
|
|
2165
|
-
let
|
|
2166
|
-
if (/[a-zA-Z]/.test(
|
|
2167
|
-
|
|
2204
|
+
let y = [];
|
|
2205
|
+
if (e6) actions: for (let { name: b } of e6) {
|
|
2206
|
+
for (let e7 = 0; e7 < b.length; e7++) {
|
|
2207
|
+
let x = b[e7];
|
|
2208
|
+
if (/[a-zA-Z]/.test(x) && !y.some((e8) => e8.toLowerCase() == x.toLowerCase())) {
|
|
2209
|
+
y.push(x);
|
|
2168
2210
|
continue actions;
|
|
2169
2211
|
}
|
|
2170
2212
|
}
|
|
2171
|
-
|
|
2213
|
+
y.push("");
|
|
2172
2214
|
}
|
|
2173
|
-
return
|
|
2215
|
+
return y;
|
|
2174
2216
|
}
|
|
2175
|
-
function renderDiagnostic(e6,
|
|
2217
|
+
function renderDiagnostic(e6, y, b) {
|
|
2176
2218
|
var _a;
|
|
2177
|
-
let
|
|
2178
|
-
return crelt("li", { class: "cm-diagnostic cm-diagnostic-" +
|
|
2179
|
-
let
|
|
2180
|
-
if (
|
|
2181
|
-
|
|
2182
|
-
let
|
|
2183
|
-
|
|
2184
|
-
}, { name:
|
|
2185
|
-
|
|
2186
|
-
crelt("u",
|
|
2187
|
-
|
|
2219
|
+
let x = b ? assignKeys(y.actions) : [];
|
|
2220
|
+
return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + y.severity }, crelt("span", { class: "cm-diagnosticText" }, y.renderMessage ? y.renderMessage(e6) : y.message), (_a = y.actions) == null ? void 0 : _a.map((b2, S) => {
|
|
2221
|
+
let C = false, w = (x2) => {
|
|
2222
|
+
if (x2.preventDefault(), C) return;
|
|
2223
|
+
C = true;
|
|
2224
|
+
let S2 = findDiagnostic(e6.state.field(lintState).diagnostics, y);
|
|
2225
|
+
S2 && b2.apply(e6, S2.from, S2.to);
|
|
2226
|
+
}, { name: T } = b2, E = x[S] ? T.indexOf(x[S]) : -1, D = E < 0 ? T : [
|
|
2227
|
+
T.slice(0, E),
|
|
2228
|
+
crelt("u", T.slice(E, E + 1)),
|
|
2229
|
+
T.slice(E + 1)
|
|
2188
2230
|
];
|
|
2189
2231
|
return crelt("button", {
|
|
2190
2232
|
type: "button",
|
|
2191
|
-
class: "cm-diagnosticAction",
|
|
2192
|
-
onclick:
|
|
2193
|
-
onmousedown:
|
|
2194
|
-
"aria-label": ` Action: ${
|
|
2195
|
-
},
|
|
2196
|
-
}),
|
|
2233
|
+
class: "cm-diagnosticAction" + (b2.markClass ? " " + b2.markClass : ""),
|
|
2234
|
+
onclick: w,
|
|
2235
|
+
onmousedown: w,
|
|
2236
|
+
"aria-label": ` Action: ${T}${E < 0 ? "" : ` (access key "${x[S]})"`}.`
|
|
2237
|
+
}, D);
|
|
2238
|
+
}), y.source && crelt("div", { class: "cm-diagnosticSource" }, y.source));
|
|
2197
2239
|
}
|
|
2198
2240
|
var DiagnosticWidget = class extends WidgetType {
|
|
2199
2241
|
constructor(e6) {
|
|
@@ -2206,36 +2248,36 @@ var DiagnosticWidget = class extends WidgetType {
|
|
|
2206
2248
|
return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
|
|
2207
2249
|
}
|
|
2208
2250
|
}, PanelItem = class {
|
|
2209
|
-
constructor(e6,
|
|
2210
|
-
this.diagnostic =
|
|
2251
|
+
constructor(e6, y) {
|
|
2252
|
+
this.diagnostic = y, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = renderDiagnostic(e6, y, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
|
|
2211
2253
|
}
|
|
2212
2254
|
}, LintPanel = class e5 {
|
|
2213
2255
|
constructor(e6) {
|
|
2214
2256
|
this.view = e6, this.items = [];
|
|
2215
|
-
let
|
|
2216
|
-
if (
|
|
2217
|
-
else if (
|
|
2218
|
-
else if (
|
|
2219
|
-
else if (
|
|
2220
|
-
else if (
|
|
2221
|
-
else if (
|
|
2222
|
-
else if (
|
|
2223
|
-
let { diagnostic:
|
|
2224
|
-
for (let
|
|
2225
|
-
let
|
|
2226
|
-
|
|
2257
|
+
let y = (y2) => {
|
|
2258
|
+
if (y2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
|
|
2259
|
+
else if (y2.keyCode == 38 || y2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
|
|
2260
|
+
else if (y2.keyCode == 40 || y2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
|
|
2261
|
+
else if (y2.keyCode == 36) this.moveSelection(0);
|
|
2262
|
+
else if (y2.keyCode == 35) this.moveSelection(this.items.length - 1);
|
|
2263
|
+
else if (y2.keyCode == 13) this.view.focus();
|
|
2264
|
+
else if (y2.keyCode >= 65 && y2.keyCode <= 90 && this.selectedIndex >= 0) {
|
|
2265
|
+
let { diagnostic: b2 } = this.items[this.selectedIndex], x = assignKeys(b2.actions);
|
|
2266
|
+
for (let S = 0; S < x.length; S++) if (x[S].toUpperCase().charCodeAt(0) == y2.keyCode) {
|
|
2267
|
+
let y3 = findDiagnostic(this.view.state.field(lintState).diagnostics, b2);
|
|
2268
|
+
y3 && b2.actions[S].apply(e6, y3.from, y3.to);
|
|
2227
2269
|
}
|
|
2228
2270
|
} else return;
|
|
2229
|
-
|
|
2230
|
-
},
|
|
2231
|
-
for (let
|
|
2271
|
+
y2.preventDefault();
|
|
2272
|
+
}, b = (e7) => {
|
|
2273
|
+
for (let y2 = 0; y2 < this.items.length; y2++) this.items[y2].dom.contains(e7.target) && this.moveSelection(y2);
|
|
2232
2274
|
};
|
|
2233
2275
|
this.list = crelt("ul", {
|
|
2234
2276
|
tabIndex: 0,
|
|
2235
2277
|
role: "listbox",
|
|
2236
2278
|
"aria-label": this.view.state.phrase("Diagnostics"),
|
|
2237
|
-
onkeydown:
|
|
2238
|
-
onclick:
|
|
2279
|
+
onkeydown: y,
|
|
2280
|
+
onclick: b
|
|
2239
2281
|
}), this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
|
|
2240
2282
|
type: "button",
|
|
2241
2283
|
name: "close",
|
|
@@ -2246,70 +2288,70 @@ var DiagnosticWidget = class extends WidgetType {
|
|
|
2246
2288
|
get selectedIndex() {
|
|
2247
2289
|
let e6 = this.view.state.field(lintState).selected;
|
|
2248
2290
|
if (!e6) return -1;
|
|
2249
|
-
for (let
|
|
2291
|
+
for (let y = 0; y < this.items.length; y++) if (this.items[y].diagnostic == e6.diagnostic) return y;
|
|
2250
2292
|
return -1;
|
|
2251
2293
|
}
|
|
2252
2294
|
update() {
|
|
2253
|
-
let { diagnostics: e6, selected:
|
|
2254
|
-
for (e6.between(0, this.view.state.doc.length, (e7,
|
|
2255
|
-
for (let e8 of
|
|
2256
|
-
if (
|
|
2257
|
-
|
|
2258
|
-
let
|
|
2259
|
-
for (let
|
|
2260
|
-
|
|
2295
|
+
let { diagnostics: e6, selected: y } = this.view.state.field(lintState), b = 0, x = false, S = null, C = /* @__PURE__ */ new Set();
|
|
2296
|
+
for (e6.between(0, this.view.state.doc.length, (e7, w, { spec: T }) => {
|
|
2297
|
+
for (let e8 of T.diagnostics) {
|
|
2298
|
+
if (C.has(e8)) continue;
|
|
2299
|
+
C.add(e8);
|
|
2300
|
+
let w2 = -1, T2;
|
|
2301
|
+
for (let y2 = b; y2 < this.items.length; y2++) if (this.items[y2].diagnostic == e8) {
|
|
2302
|
+
w2 = y2;
|
|
2261
2303
|
break;
|
|
2262
2304
|
}
|
|
2263
|
-
|
|
2305
|
+
w2 < 0 ? (T2 = new PanelItem(this.view, e8), this.items.splice(b, 0, T2), x = true) : (T2 = this.items[w2], w2 > b && (this.items.splice(b, w2 - b), x = true)), y && T2.diagnostic == y.diagnostic ? T2.dom.hasAttribute("aria-selected") || (T2.dom.setAttribute("aria-selected", "true"), S = T2) : T2.dom.hasAttribute("aria-selected") && T2.dom.removeAttribute("aria-selected"), b++;
|
|
2264
2306
|
}
|
|
2265
|
-
});
|
|
2307
|
+
}); b < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) x = true, this.items.pop();
|
|
2266
2308
|
this.items.length == 0 && (this.items.push(new PanelItem(this.view, {
|
|
2267
2309
|
from: -1,
|
|
2268
2310
|
to: -1,
|
|
2269
2311
|
severity: "info",
|
|
2270
2312
|
message: this.view.state.phrase("No diagnostics")
|
|
2271
|
-
})),
|
|
2313
|
+
})), x = true), S ? (this.list.setAttribute("aria-activedescendant", S.id), this.view.requestMeasure({
|
|
2272
2314
|
key: this,
|
|
2273
2315
|
read: () => ({
|
|
2274
|
-
sel:
|
|
2316
|
+
sel: S.dom.getBoundingClientRect(),
|
|
2275
2317
|
panel: this.list.getBoundingClientRect()
|
|
2276
2318
|
}),
|
|
2277
|
-
write: ({ sel: e7, panel:
|
|
2278
|
-
let
|
|
2279
|
-
e7.top <
|
|
2319
|
+
write: ({ sel: e7, panel: y2 }) => {
|
|
2320
|
+
let b2 = y2.height / this.list.offsetHeight;
|
|
2321
|
+
e7.top < y2.top ? this.list.scrollTop -= (y2.top - e7.top) / b2 : e7.bottom > y2.bottom && (this.list.scrollTop += (e7.bottom - y2.bottom) / b2);
|
|
2280
2322
|
}
|
|
2281
|
-
})) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"),
|
|
2323
|
+
})) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), x && this.sync();
|
|
2282
2324
|
}
|
|
2283
2325
|
sync() {
|
|
2284
2326
|
let e6 = this.list.firstChild;
|
|
2285
|
-
function
|
|
2286
|
-
let
|
|
2287
|
-
e6 =
|
|
2327
|
+
function y() {
|
|
2328
|
+
let y2 = e6;
|
|
2329
|
+
e6 = y2.nextSibling, y2.remove();
|
|
2288
2330
|
}
|
|
2289
|
-
for (let
|
|
2290
|
-
for (; e6 !=
|
|
2291
|
-
e6 =
|
|
2292
|
-
} else this.list.insertBefore(
|
|
2293
|
-
for (; e6; )
|
|
2331
|
+
for (let b of this.items) if (b.dom.parentNode == this.list) {
|
|
2332
|
+
for (; e6 != b.dom; ) y();
|
|
2333
|
+
e6 = b.dom.nextSibling;
|
|
2334
|
+
} else this.list.insertBefore(b.dom, e6);
|
|
2335
|
+
for (; e6; ) y();
|
|
2294
2336
|
}
|
|
2295
2337
|
moveSelection(e6) {
|
|
2296
2338
|
if (this.selectedIndex < 0) return;
|
|
2297
|
-
let
|
|
2298
|
-
|
|
2339
|
+
let y = findDiagnostic(this.view.state.field(lintState).diagnostics, this.items[e6].diagnostic);
|
|
2340
|
+
y && this.view.dispatch({
|
|
2299
2341
|
selection: {
|
|
2300
|
-
anchor:
|
|
2301
|
-
head:
|
|
2342
|
+
anchor: y.from,
|
|
2343
|
+
head: y.to
|
|
2302
2344
|
},
|
|
2303
2345
|
scrollIntoView: true,
|
|
2304
|
-
effects: movePanelSelection.of(
|
|
2346
|
+
effects: movePanelSelection.of(y)
|
|
2305
2347
|
});
|
|
2306
2348
|
}
|
|
2307
|
-
static open(
|
|
2308
|
-
return new e5(
|
|
2349
|
+
static open(y) {
|
|
2350
|
+
return new e5(y);
|
|
2309
2351
|
}
|
|
2310
2352
|
};
|
|
2311
|
-
function svg(e6,
|
|
2312
|
-
return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${
|
|
2353
|
+
function svg(e6, y = 'viewBox="0 0 40 40"') {
|
|
2354
|
+
return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${y}>${encodeURIComponent(e6)}</svg>')`;
|
|
2313
2355
|
}
|
|
2314
2356
|
function underline(e6) {
|
|
2315
2357
|
return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e6}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
|
|
@@ -2403,65 +2445,65 @@ function severityWeight(e6) {
|
|
|
2403
2445
|
return e6 == "error" ? 4 : e6 == "warning" ? 3 : e6 == "info" ? 2 : 1;
|
|
2404
2446
|
}
|
|
2405
2447
|
function maxSeverity(e6) {
|
|
2406
|
-
let
|
|
2407
|
-
for (let
|
|
2408
|
-
let e7 = severityWeight(
|
|
2409
|
-
e7 >
|
|
2448
|
+
let y = "hint", b = 1;
|
|
2449
|
+
for (let x of e6) {
|
|
2450
|
+
let e7 = severityWeight(x.severity);
|
|
2451
|
+
e7 > b && (b = e7, y = x.severity);
|
|
2410
2452
|
}
|
|
2411
|
-
return
|
|
2453
|
+
return y;
|
|
2412
2454
|
}
|
|
2413
2455
|
var lintExtensions = [
|
|
2414
2456
|
lintState,
|
|
2415
2457
|
/* @__PURE__ */ EditorView.decorations.compute([lintState], (e6) => {
|
|
2416
|
-
let { selected:
|
|
2417
|
-
return !
|
|
2458
|
+
let { selected: y, panel: b } = e6.field(lintState);
|
|
2459
|
+
return !y || !b || y.from == y.to ? Decoration.none : Decoration.set([activeMark.range(y.from, y.to)]);
|
|
2418
2460
|
}),
|
|
2419
2461
|
/* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
|
|
2420
2462
|
baseTheme
|
|
2421
2463
|
];
|
|
2422
|
-
function forEachDiagnostic(e6,
|
|
2423
|
-
let
|
|
2424
|
-
if (
|
|
2425
|
-
let e7 = [],
|
|
2426
|
-
for (let
|
|
2427
|
-
for (let
|
|
2428
|
-
if (!
|
|
2429
|
-
for (let
|
|
2430
|
-
|
|
2464
|
+
function forEachDiagnostic(e6, y) {
|
|
2465
|
+
let b = e6.field(lintState, false);
|
|
2466
|
+
if (b && b.diagnostics.size) {
|
|
2467
|
+
let e7 = [], x = [], S = -1;
|
|
2468
|
+
for (let C = RangeSet.iter([b.diagnostics]); ; C.next()) {
|
|
2469
|
+
for (let b2 = 0; b2 < e7.length; b2++) (!C.value || C.value.spec.diagnostics.indexOf(e7[b2]) < 0) && (y(e7[b2], x[b2], S), e7.splice(b2, 1), x.splice(b2--, 1));
|
|
2470
|
+
if (!C.value) break;
|
|
2471
|
+
for (let y2 of C.value.spec.diagnostics) e7.indexOf(y2) < 0 && (e7.push(y2), x.push(C.from));
|
|
2472
|
+
S = C.to;
|
|
2431
2473
|
}
|
|
2432
2474
|
}
|
|
2433
2475
|
}
|
|
2434
2476
|
function _extends() {
|
|
2435
2477
|
return _extends = Object.assign ? Object.assign.bind() : function(e6) {
|
|
2436
|
-
for (var
|
|
2437
|
-
var
|
|
2438
|
-
for (var
|
|
2478
|
+
for (var y = 1; y < arguments.length; y++) {
|
|
2479
|
+
var b = arguments[y];
|
|
2480
|
+
for (var x in b) ({}).hasOwnProperty.call(b, x) && (e6[x] = b[x]);
|
|
2439
2481
|
}
|
|
2440
2482
|
return e6;
|
|
2441
2483
|
}, _extends.apply(null, arguments);
|
|
2442
2484
|
}
|
|
2443
|
-
function _objectWithoutPropertiesLoose(e6,
|
|
2485
|
+
function _objectWithoutPropertiesLoose(e6, y) {
|
|
2444
2486
|
if (e6 == null) return {};
|
|
2445
|
-
var
|
|
2446
|
-
for (var
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2487
|
+
var b = {};
|
|
2488
|
+
for (var x in e6) if ({}.hasOwnProperty.call(e6, x)) {
|
|
2489
|
+
if (y.indexOf(x) !== -1) continue;
|
|
2490
|
+
b[x] = e6[x];
|
|
2449
2491
|
}
|
|
2450
|
-
return
|
|
2492
|
+
return b;
|
|
2451
2493
|
}
|
|
2452
2494
|
var basicSetup = function(e6) {
|
|
2453
2495
|
e6 === void 0 && (e6 = {});
|
|
2454
|
-
var { crosshairCursor:
|
|
2455
|
-
e6.closeBracketsKeymap !== false && (
|
|
2456
|
-
var
|
|
2457
|
-
return e6.lineNumbers !== false &&
|
|
2496
|
+
var { crosshairCursor: y = false } = e6, b = [];
|
|
2497
|
+
e6.closeBracketsKeymap !== false && (b = b.concat(closeBracketsKeymap)), e6.defaultKeymap !== false && (b = b.concat(defaultKeymap)), e6.searchKeymap !== false && (b = b.concat(searchKeymap)), e6.historyKeymap !== false && (b = b.concat(historyKeymap)), e6.foldKeymap !== false && (b = b.concat(foldKeymap)), e6.completionKeymap !== false && (b = b.concat(completionKeymap)), e6.lintKeymap !== false && (b = b.concat(lintKeymap));
|
|
2498
|
+
var x = [];
|
|
2499
|
+
return e6.lineNumbers !== false && x.push(lineNumbers()), e6.highlightActiveLineGutter !== false && x.push(highlightActiveLineGutter()), e6.highlightSpecialChars !== false && x.push(highlightSpecialChars()), e6.history !== false && x.push(history()), e6.foldGutter !== false && x.push(foldGutter()), e6.drawSelection !== false && x.push(drawSelection()), e6.dropCursor !== false && x.push(dropCursor()), e6.allowMultipleSelections !== false && x.push(EditorState.allowMultipleSelections.of(true)), e6.indentOnInput !== false && x.push(indentOnInput()), e6.syntaxHighlighting !== false && x.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), e6.bracketMatching !== false && x.push(bracketMatching()), e6.closeBrackets !== false && x.push(closeBrackets()), e6.autocompletion !== false && x.push(autocompletion()), e6.rectangularSelection !== false && x.push(rectangularSelection()), y !== false && x.push(crosshairCursor()), e6.highlightActiveLine !== false && x.push(highlightActiveLine()), e6.highlightSelectionMatches !== false && x.push(highlightSelectionMatches()), e6.tabSize && typeof e6.tabSize == "number" && x.push(indentUnit.of(" ".repeat(e6.tabSize))), x.concat([keymap.of(b.flat())]).filter(Boolean);
|
|
2458
2500
|
}, minimalSetup = function(e6) {
|
|
2459
2501
|
e6 === void 0 && (e6 = {});
|
|
2460
|
-
var
|
|
2461
|
-
e6.defaultKeymap !== false && (
|
|
2462
|
-
var
|
|
2463
|
-
return e6.highlightSpecialChars !== false &&
|
|
2464
|
-
}, chalky = "#e5c07b", coral = "#e06c75", cyan = "#56b6c2", invalid = "#ffffff", ivory = "#abb2bf", stone = "#7d8799", malibu = "#61afef", sage = "#98c379", whiskey = "#d19a66", violet = "#c678dd", darkBackground = "#21252b", highlightBackground = "#2c313a", background = "#282c34", tooltipBackground = "#353a42", selection = "#3E4451", cursor = "#528bff",
|
|
2502
|
+
var y = [];
|
|
2503
|
+
e6.defaultKeymap !== false && (y = y.concat(defaultKeymap)), e6.historyKeymap !== false && (y = y.concat(historyKeymap));
|
|
2504
|
+
var b = [];
|
|
2505
|
+
return e6.highlightSpecialChars !== false && b.push(highlightSpecialChars()), e6.history !== false && b.push(history()), e6.drawSelection !== false && b.push(drawSelection()), e6.syntaxHighlighting !== false && b.push(syntaxHighlighting(defaultHighlightStyle, { fallback: true })), b.concat([keymap.of(y.flat())]).filter(Boolean);
|
|
2506
|
+
}, chalky = "#e5c07b", coral = "#e06c75", cyan = "#56b6c2", invalid = "#ffffff", ivory = "#abb2bf", stone = "#7d8799", malibu = "#61afef", sage = "#98c379", whiskey = "#d19a66", violet = "#c678dd", darkBackground = "#21252b", highlightBackground = "#2c313a", background = "#282c34", tooltipBackground = "#353a42", selection = "#3E4451", cursor = "#528bff", oneDark = [/* @__PURE__ */ EditorView.theme({
|
|
2465
2507
|
"&": {
|
|
2466
2508
|
color: ivory,
|
|
2467
2509
|
backgroundColor: background
|
|
@@ -2510,7 +2552,7 @@ var basicSetup = function(e6) {
|
|
|
2510
2552
|
backgroundColor: highlightBackground,
|
|
2511
2553
|
color: ivory
|
|
2512
2554
|
} }
|
|
2513
|
-
}, { dark: true }),
|
|
2555
|
+
}, { dark: true }), /* @__PURE__ */ syntaxHighlighting(/* @__PURE__ */ HighlightStyle.define([
|
|
2514
2556
|
{
|
|
2515
2557
|
tag: tags.keyword,
|
|
2516
2558
|
color: violet
|
|
@@ -2612,23 +2654,23 @@ var basicSetup = function(e6) {
|
|
|
2612
2654
|
tag: tags.invalid,
|
|
2613
2655
|
color: invalid
|
|
2614
2656
|
}
|
|
2615
|
-
])
|
|
2657
|
+
]))], defaultLightThemeOption = EditorView.theme({ "&": { backgroundColor: "#fff" } }, { dark: false }), getDefaultExtensions = function(e6) {
|
|
2616
2658
|
e6 === void 0 && (e6 = {});
|
|
2617
|
-
var { indentWithTab:
|
|
2618
|
-
switch (
|
|
2659
|
+
var { indentWithTab: y = true, editable: b = true, readOnly: x = false, theme: S = "light", placeholder: C = "", basicSetup: w = true } = e6, T = [];
|
|
2660
|
+
switch (y && T.unshift(keymap.of([indentWithTab])), w && (typeof w == "boolean" ? T.unshift(basicSetup()) : T.unshift(basicSetup(w))), C && T.unshift(placeholder(C)), S) {
|
|
2619
2661
|
case "light":
|
|
2620
|
-
|
|
2662
|
+
T.push(defaultLightThemeOption);
|
|
2621
2663
|
break;
|
|
2622
2664
|
case "dark":
|
|
2623
|
-
|
|
2665
|
+
T.push(oneDark);
|
|
2624
2666
|
break;
|
|
2625
2667
|
case "none":
|
|
2626
2668
|
break;
|
|
2627
2669
|
default:
|
|
2628
|
-
|
|
2670
|
+
T.push(S);
|
|
2629
2671
|
break;
|
|
2630
2672
|
}
|
|
2631
|
-
return
|
|
2673
|
+
return b === false && T.push(EditorView.editable.of(false)), x && T.push(EditorState.readOnly.of(true)), [...T];
|
|
2632
2674
|
}, getStatistics = (e6) => ({
|
|
2633
2675
|
line: e6.state.doc.lineAt(e6.state.selection.main.from),
|
|
2634
2676
|
lineCount: e6.state.doc.lines,
|
|
@@ -2640,11 +2682,11 @@ var basicSetup = function(e6) {
|
|
|
2640
2682
|
selectionAsSingle: e6.state.selection.asSingle().main,
|
|
2641
2683
|
ranges: e6.state.selection.ranges,
|
|
2642
2684
|
selectionCode: e6.state.sliceDoc(e6.state.selection.main.from, e6.state.selection.main.to),
|
|
2643
|
-
selections: e6.state.selection.ranges.map((
|
|
2685
|
+
selections: e6.state.selection.ranges.map((y) => e6.state.sliceDoc(y.from, y.to)),
|
|
2644
2686
|
selectedText: e6.state.selection.ranges.some((e7) => !e7.empty)
|
|
2645
2687
|
}), TimeoutLatch = class {
|
|
2646
|
-
constructor(e6,
|
|
2647
|
-
this.timeLeftMS = void 0, this.timeoutMS = void 0, this.isCancelled = false, this.isTimeExhausted = false, this.callbacks = [], this.timeLeftMS =
|
|
2688
|
+
constructor(e6, y) {
|
|
2689
|
+
this.timeLeftMS = void 0, this.timeoutMS = void 0, this.isCancelled = false, this.isTimeExhausted = false, this.callbacks = [], this.timeLeftMS = y, this.timeoutMS = y, this.callbacks.push(e6);
|
|
2648
2690
|
}
|
|
2649
2691
|
tick() {
|
|
2650
2692
|
if (!this.isCancelled && !this.isTimeExhausted && (this.timeLeftMS--, this.timeLeftMS <= 0)) {
|
|
@@ -2690,73 +2732,66 @@ var basicSetup = function(e6) {
|
|
|
2690
2732
|
}
|
|
2691
2733
|
}, globalScheduler = null, getScheduler = () => typeof window > "u" ? new Scheduler() : (globalScheduler || (globalScheduler = new Scheduler()), globalScheduler), ExternalChange = Annotation.define(), TYPING_TIMOUT = 200, emptyExtensions = [];
|
|
2692
2734
|
function useCodeMirror(e6) {
|
|
2693
|
-
var { value:
|
|
2735
|
+
var { value: y, selection: b, onChange: x, onStatistics: S, onCreateEditor: C, onUpdate: w, extensions: T = emptyExtensions, autoFocus: E, theme: D = "light", height: O = null, minHeight: k = null, maxHeight: A = null, width: j = null, minWidth: M = null, maxWidth: N = null, placeholder: P = "", editable: F = true, readOnly: I = false, indentWithTab: L = true, basicSetup: R = true, root: B, initialState: V } = e6, [H, U] = (0, import_react.useState)(), [W, G] = (0, import_react.useState)(), [K, J] = (0, import_react.useState)(), Y = (0, import_react.useState)(() => ({ current: null }))[0], Z = (0, import_react.useState)(() => ({ current: null }))[0], Q = EditorView.theme({
|
|
2694
2736
|
"&": {
|
|
2695
|
-
height:
|
|
2696
|
-
minHeight:
|
|
2697
|
-
maxHeight:
|
|
2698
|
-
width:
|
|
2699
|
-
minWidth:
|
|
2700
|
-
maxWidth:
|
|
2737
|
+
height: O,
|
|
2738
|
+
minHeight: k,
|
|
2739
|
+
maxHeight: A,
|
|
2740
|
+
width: j,
|
|
2741
|
+
minWidth: M,
|
|
2742
|
+
maxWidth: N
|
|
2701
2743
|
},
|
|
2702
2744
|
"& .cm-scroller": { height: "100% !important" }
|
|
2703
|
-
}), Z = EditorView.updateListener.of((e7) => {
|
|
2704
|
-
if (e7.docChanged && typeof y == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange))) {
|
|
2705
|
-
K.current ? K.current.reset() : (K.current = new TimeoutLatch(() => {
|
|
2706
|
-
if (Y.current) {
|
|
2707
|
-
var e8 = Y.current;
|
|
2708
|
-
Y.current = null, e8();
|
|
2709
|
-
}
|
|
2710
|
-
K.current = null;
|
|
2711
|
-
}, TYPING_TIMOUT), getScheduler().add(K.current));
|
|
2712
|
-
var _2 = e7.state.doc.toString();
|
|
2713
|
-
y(_2, e7);
|
|
2714
|
-
}
|
|
2715
|
-
b && b(getStatistics(e7));
|
|
2716
|
-
}), Q = getDefaultExtensions({
|
|
2717
|
-
theme: T,
|
|
2718
|
-
editable: N,
|
|
2719
|
-
readOnly: P,
|
|
2720
|
-
placeholder: M,
|
|
2721
|
-
indentWithTab: F,
|
|
2722
|
-
basicSetup: I
|
|
2723
2745
|
}), $ = [
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2746
|
+
EditorView.updateListener.of((e7) => {
|
|
2747
|
+
e7.docChanged && typeof x == "function" && !e7.transactions.some((e8) => e8.annotation(ExternalChange)) && (Y.current ? Y.current.reset() : (Y.current = new TimeoutLatch(() => {
|
|
2748
|
+
if (Z.current) {
|
|
2749
|
+
var e8 = Z.current;
|
|
2750
|
+
Z.current = null, e8();
|
|
2751
|
+
}
|
|
2752
|
+
Y.current = null;
|
|
2753
|
+
}, TYPING_TIMOUT), getScheduler().add(Y.current)), x(e7.state.doc.toString(), e7)), S && S(getStatistics(e7));
|
|
2754
|
+
}),
|
|
2755
|
+
Q,
|
|
2756
|
+
...getDefaultExtensions({
|
|
2757
|
+
theme: D,
|
|
2758
|
+
editable: F,
|
|
2759
|
+
readOnly: I,
|
|
2760
|
+
placeholder: P,
|
|
2761
|
+
indentWithTab: L,
|
|
2762
|
+
basicSetup: R
|
|
2763
|
+
})
|
|
2727
2764
|
];
|
|
2728
|
-
return
|
|
2729
|
-
if (
|
|
2765
|
+
return w && typeof w == "function" && $.push(EditorView.updateListener.of(w)), $ = $.concat(T), (0, import_react.useLayoutEffect)(() => {
|
|
2766
|
+
if (H && !K) {
|
|
2730
2767
|
var e7 = {
|
|
2731
|
-
doc:
|
|
2732
|
-
selection:
|
|
2768
|
+
doc: y,
|
|
2769
|
+
selection: b,
|
|
2733
2770
|
extensions: $
|
|
2734
|
-
},
|
|
2735
|
-
if (
|
|
2736
|
-
var
|
|
2737
|
-
state:
|
|
2738
|
-
parent:
|
|
2739
|
-
root:
|
|
2771
|
+
}, x2 = V ? EditorState.fromJSON(V.json, e7, V.fields) : EditorState.create(e7);
|
|
2772
|
+
if (J(x2), !W) {
|
|
2773
|
+
var S2 = new EditorView({
|
|
2774
|
+
state: x2,
|
|
2775
|
+
parent: H,
|
|
2776
|
+
root: B
|
|
2740
2777
|
});
|
|
2741
|
-
|
|
2778
|
+
G(S2), C && C(S2, x2);
|
|
2742
2779
|
}
|
|
2743
2780
|
}
|
|
2744
2781
|
return () => {
|
|
2745
|
-
|
|
2782
|
+
W && (J(void 0), G(void 0));
|
|
2746
2783
|
};
|
|
2747
|
-
}, [
|
|
2748
|
-
e6.container &&
|
|
2784
|
+
}, [H, K]), (0, import_react.useEffect)(() => {
|
|
2785
|
+
e6.container && U(e6.container);
|
|
2749
2786
|
}, [e6.container]), (0, import_react.useEffect)(() => () => {
|
|
2750
|
-
|
|
2751
|
-
}, [
|
|
2752
|
-
|
|
2753
|
-
}, [
|
|
2754
|
-
|
|
2787
|
+
W && (W.destroy(), G(void 0)), Y.current && (Y.current = (Y.current.cancel(), null));
|
|
2788
|
+
}, [W]), (0, import_react.useEffect)(() => {
|
|
2789
|
+
E && W && W.focus();
|
|
2790
|
+
}, [E, W]), (0, import_react.useEffect)(() => {
|
|
2791
|
+
W && W.dispatch({ effects: StateEffect.reconfigure.of($) });
|
|
2755
2792
|
}, [
|
|
2756
|
-
T,
|
|
2757
|
-
C,
|
|
2758
|
-
E,
|
|
2759
2793
|
D,
|
|
2794
|
+
T,
|
|
2760
2795
|
O,
|
|
2761
2796
|
k,
|
|
2762
2797
|
A,
|
|
@@ -2766,32 +2801,34 @@ function useCodeMirror(e6) {
|
|
|
2766
2801
|
P,
|
|
2767
2802
|
F,
|
|
2768
2803
|
I,
|
|
2769
|
-
|
|
2770
|
-
|
|
2804
|
+
L,
|
|
2805
|
+
R,
|
|
2806
|
+
x,
|
|
2807
|
+
w
|
|
2771
2808
|
]), (0, import_react.useEffect)(() => {
|
|
2772
|
-
if (
|
|
2773
|
-
var e7 =
|
|
2774
|
-
if (
|
|
2775
|
-
var
|
|
2776
|
-
|
|
2809
|
+
if (y !== void 0) {
|
|
2810
|
+
var e7 = W ? W.state.doc.toString() : "";
|
|
2811
|
+
if (W && y !== e7) {
|
|
2812
|
+
var b2 = Y.current && !Y.current.isDone, x2 = () => {
|
|
2813
|
+
W && y !== W.state.doc.toString() && W.dispatch({
|
|
2777
2814
|
changes: {
|
|
2778
2815
|
from: 0,
|
|
2779
|
-
to:
|
|
2780
|
-
insert:
|
|
2816
|
+
to: W.state.doc.toString().length,
|
|
2817
|
+
insert: y || ""
|
|
2781
2818
|
},
|
|
2782
2819
|
annotations: [ExternalChange.of(true)]
|
|
2783
2820
|
});
|
|
2784
2821
|
};
|
|
2785
|
-
|
|
2822
|
+
b2 ? Z.current = x2 : x2();
|
|
2786
2823
|
}
|
|
2787
2824
|
}
|
|
2788
|
-
}, [
|
|
2789
|
-
state:
|
|
2790
|
-
setState:
|
|
2791
|
-
view:
|
|
2792
|
-
setView:
|
|
2793
|
-
container:
|
|
2794
|
-
setContainer:
|
|
2825
|
+
}, [y, W]), {
|
|
2826
|
+
state: K,
|
|
2827
|
+
setState: J,
|
|
2828
|
+
view: W,
|
|
2829
|
+
setView: G,
|
|
2830
|
+
container: H,
|
|
2831
|
+
setContainer: U
|
|
2795
2832
|
};
|
|
2796
2833
|
}
|
|
2797
2834
|
var _excluded = [
|
|
@@ -2818,81 +2855,80 @@ var _excluded = [
|
|
|
2818
2855
|
"readOnly",
|
|
2819
2856
|
"root",
|
|
2820
2857
|
"initialState"
|
|
2821
|
-
], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6,
|
|
2822
|
-
var { className:
|
|
2823
|
-
root:
|
|
2824
|
-
value:
|
|
2825
|
-
autoFocus:
|
|
2826
|
-
theme:
|
|
2827
|
-
height:
|
|
2828
|
-
minHeight:
|
|
2829
|
-
maxHeight:
|
|
2830
|
-
width:
|
|
2831
|
-
minWidth:
|
|
2832
|
-
maxWidth:
|
|
2833
|
-
basicSetup:
|
|
2834
|
-
placeholder:
|
|
2835
|
-
indentWithTab:
|
|
2836
|
-
editable:
|
|
2837
|
-
readOnly:
|
|
2838
|
-
selection:
|
|
2839
|
-
onChange:
|
|
2840
|
-
onStatistics:
|
|
2841
|
-
onCreateEditor:
|
|
2842
|
-
onUpdate:
|
|
2843
|
-
extensions:
|
|
2844
|
-
initialState:
|
|
2858
|
+
], ReactCodeMirror = /* @__PURE__ */ (0, import_react.forwardRef)((e6, y) => {
|
|
2859
|
+
var { className: b, value: x = "", selection: S, extensions: C = [], onChange: w, onStatistics: T, onCreateEditor: E, onUpdate: D, autoFocus: O, theme: k = "light", height: A, minHeight: j, maxHeight: M, width: N, minWidth: P, maxWidth: F, basicSetup: I, placeholder: L, indentWithTab: R, editable: z, readOnly: B, root: V, initialState: H } = e6, U = _objectWithoutPropertiesLoose(e6, _excluded), W = (0, import_react.useRef)(null), { state: G, view: K, container: J, setContainer: Y } = useCodeMirror({
|
|
2860
|
+
root: V,
|
|
2861
|
+
value: x,
|
|
2862
|
+
autoFocus: O,
|
|
2863
|
+
theme: k,
|
|
2864
|
+
height: A,
|
|
2865
|
+
minHeight: j,
|
|
2866
|
+
maxHeight: M,
|
|
2867
|
+
width: N,
|
|
2868
|
+
minWidth: P,
|
|
2869
|
+
maxWidth: F,
|
|
2870
|
+
basicSetup: I,
|
|
2871
|
+
placeholder: L,
|
|
2872
|
+
indentWithTab: R,
|
|
2873
|
+
editable: z,
|
|
2874
|
+
readOnly: B,
|
|
2875
|
+
selection: S,
|
|
2876
|
+
onChange: w,
|
|
2877
|
+
onStatistics: T,
|
|
2878
|
+
onCreateEditor: E,
|
|
2879
|
+
onUpdate: D,
|
|
2880
|
+
extensions: C,
|
|
2881
|
+
initialState: H
|
|
2845
2882
|
});
|
|
2846
|
-
(0, import_react.useImperativeHandle)(
|
|
2847
|
-
editor:
|
|
2848
|
-
state:
|
|
2849
|
-
view:
|
|
2883
|
+
(0, import_react.useImperativeHandle)(y, () => ({
|
|
2884
|
+
editor: W.current,
|
|
2885
|
+
state: G,
|
|
2886
|
+
view: K
|
|
2850
2887
|
}), [
|
|
2851
|
-
|
|
2888
|
+
W,
|
|
2889
|
+
J,
|
|
2852
2890
|
G,
|
|
2853
|
-
|
|
2854
|
-
W
|
|
2891
|
+
K
|
|
2855
2892
|
]);
|
|
2856
|
-
var
|
|
2857
|
-
|
|
2858
|
-
}, [
|
|
2859
|
-
if (typeof
|
|
2860
|
-
var Y = typeof D == "string" ? "cm-theme-" + D : "cm-theme";
|
|
2893
|
+
var X = (0, import_react.useCallback)((e7) => {
|
|
2894
|
+
W.current = e7, Y(e7);
|
|
2895
|
+
}, [Y]);
|
|
2896
|
+
if (typeof x != "string") throw Error("value must be typeof string but got " + typeof x);
|
|
2861
2897
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", _extends({
|
|
2862
|
-
ref:
|
|
2863
|
-
className: "" +
|
|
2864
|
-
},
|
|
2898
|
+
ref: X,
|
|
2899
|
+
className: (typeof k == "string" ? "cm-theme-" + k : "cm-theme") + (b ? " " + b : "")
|
|
2900
|
+
}, U));
|
|
2865
2901
|
});
|
|
2866
2902
|
ReactCodeMirror.displayName = "CodeMirror";
|
|
2867
2903
|
var esm_default = ReactCodeMirror, strContent = 63, strDollarBrace = 64, strEnd = 65, escapeSequence = 66, indStrContent = 67, indStrDollarBrace = 68, indStrEnd = 69, indEscapeSequence = 70, quote = 34, backslack = 92, braceL = 123, dollar = 36, apostrophe = 39, scanString = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
2868
|
-
for (let
|
|
2869
|
-
let { next:
|
|
2870
|
-
if (
|
|
2871
|
-
|
|
2904
|
+
for (let y = false, b = 0; ; b++) {
|
|
2905
|
+
let { next: x } = e6;
|
|
2906
|
+
if (x < 0) {
|
|
2907
|
+
b > 0 && e6.acceptToken(strContent);
|
|
2872
2908
|
break;
|
|
2873
|
-
} else if (
|
|
2874
|
-
|
|
2909
|
+
} else if (x === quote) {
|
|
2910
|
+
b > 0 ? e6.acceptToken(strContent) : e6.acceptToken(strEnd, 1);
|
|
2875
2911
|
break;
|
|
2876
|
-
} else if (
|
|
2877
|
-
|
|
2912
|
+
} else if (x === braceL && y) {
|
|
2913
|
+
b == 1 ? e6.acceptToken(strDollarBrace, 1) : e6.acceptToken(strContent, -1);
|
|
2878
2914
|
break;
|
|
2879
|
-
} else
|
|
2880
|
-
|
|
2915
|
+
} else x === backslack && (e6.advance(), e6.acceptToken(escapeSequence, 1));
|
|
2916
|
+
y = x === dollar, e6.advance();
|
|
2881
2917
|
}
|
|
2882
2918
|
}), scanIndString = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
2883
|
-
for (let
|
|
2884
|
-
let { next:
|
|
2885
|
-
if (
|
|
2886
|
-
|
|
2919
|
+
for (let y = false, b = false, x = 0; ; x++) {
|
|
2920
|
+
let { next: S } = e6;
|
|
2921
|
+
if (S < 0) {
|
|
2922
|
+
x > 0 && e6.acceptToken(indStrContent);
|
|
2887
2923
|
break;
|
|
2888
|
-
} else if (
|
|
2889
|
-
|
|
2924
|
+
} else if (S === apostrophe && b) {
|
|
2925
|
+
x > 1 ? e6.acceptToken(indStrContent, -1) : e6.acceptToken(indStrEnd, 1);
|
|
2890
2926
|
break;
|
|
2891
|
-
} else if (
|
|
2892
|
-
|
|
2927
|
+
} else if (S === braceL && y) {
|
|
2928
|
+
x == 1 ? e6.acceptToken(indStrDollarBrace, 1) : e6.acceptToken(indStrContent, -1);
|
|
2893
2929
|
break;
|
|
2894
|
-
} else
|
|
2895
|
-
|
|
2930
|
+
} else S === backslack && (e6.advance(), e6.acceptToken(indEscapeSequence, 1));
|
|
2931
|
+
y = S === dollar, b = S === apostrophe, e6.advance();
|
|
2896
2932
|
}
|
|
2897
2933
|
}), spec_Identifier = {
|
|
2898
2934
|
__proto__: null,
|
|
@@ -2967,10 +3003,10 @@ var esm_default = ReactCodeMirror, strContent = 63, strDollarBrace = 64, strEnd
|
|
|
2967
3003
|
AttrSet: foldInside,
|
|
2968
3004
|
List: foldInside,
|
|
2969
3005
|
Let(e6) {
|
|
2970
|
-
let
|
|
2971
|
-
return !
|
|
2972
|
-
from:
|
|
2973
|
-
to:
|
|
3006
|
+
let y = e6.getChild("let"), b = e6.getChild("in");
|
|
3007
|
+
return !y || !b ? null : {
|
|
3008
|
+
from: y.to,
|
|
3009
|
+
to: b.from
|
|
2974
3010
|
};
|
|
2975
3011
|
}
|
|
2976
3012
|
}),
|
|
@@ -3138,19 +3174,19 @@ function isSpace(e6) {
|
|
|
3138
3174
|
return e6 == 9 || e6 == 10 || e6 == 13 || e6 == 32;
|
|
3139
3175
|
}
|
|
3140
3176
|
var cachedName = null, cachedInput = null, cachedPos = 0;
|
|
3141
|
-
function tagNameAfter(e6,
|
|
3142
|
-
let
|
|
3143
|
-
if (cachedPos ==
|
|
3144
|
-
let
|
|
3145
|
-
for (; isSpace(
|
|
3146
|
-
let
|
|
3147
|
-
for (; nameChar(
|
|
3148
|
-
return cachedInput = e6, cachedPos =
|
|
3177
|
+
function tagNameAfter(e6, y) {
|
|
3178
|
+
let b = e6.pos + y;
|
|
3179
|
+
if (cachedPos == b && cachedInput == e6) return cachedName;
|
|
3180
|
+
let x = e6.peek(y);
|
|
3181
|
+
for (; isSpace(x); ) x = e6.peek(++y);
|
|
3182
|
+
let S = "";
|
|
3183
|
+
for (; nameChar(x); ) S += String.fromCharCode(x), x = e6.peek(++y);
|
|
3184
|
+
return cachedInput = e6, cachedPos = b, cachedName = S ? S.toLowerCase() : x == question || x == bang ? void 0 : null;
|
|
3149
3185
|
}
|
|
3150
3186
|
var lessThan = 60, greaterThan$1 = 62, slash$1 = 47, question = 63, bang = 33;
|
|
3151
|
-
function ElementContext(e6,
|
|
3152
|
-
this.name = e6, this.parent =
|
|
3153
|
-
for (let
|
|
3187
|
+
function ElementContext(e6, y) {
|
|
3188
|
+
this.name = e6, this.parent = y, this.hash = y ? y.hash : 0;
|
|
3189
|
+
for (let y2 = 0; y2 < e6.length; y2++) this.hash += (this.hash << 4) + e6.charCodeAt(y2) + (e6.charCodeAt(y2) << 8);
|
|
3154
3190
|
}
|
|
3155
3191
|
var startTagTerms = [
|
|
3156
3192
|
StartTag,
|
|
@@ -3160,63 +3196,63 @@ var startTagTerms = [
|
|
|
3160
3196
|
StartTextareaTag
|
|
3161
3197
|
], elementContext = /* @__PURE__ */ new ContextTracker({
|
|
3162
3198
|
start: null,
|
|
3163
|
-
shift(e6,
|
|
3164
|
-
return startTagTerms.indexOf(
|
|
3199
|
+
shift(e6, y, b, x) {
|
|
3200
|
+
return startTagTerms.indexOf(y) > -1 ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
|
|
3165
3201
|
},
|
|
3166
|
-
reduce(e6,
|
|
3167
|
-
return
|
|
3202
|
+
reduce(e6, y) {
|
|
3203
|
+
return y == Element && e6 ? e6.parent : e6;
|
|
3168
3204
|
},
|
|
3169
|
-
reuse(e6,
|
|
3170
|
-
let
|
|
3171
|
-
return
|
|
3205
|
+
reuse(e6, y, b, x) {
|
|
3206
|
+
let S = y.type.id;
|
|
3207
|
+
return S == StartTag || S == OpenTag ? new ElementContext(tagNameAfter(x, 1) || "", e6) : e6;
|
|
3172
3208
|
},
|
|
3173
3209
|
hash(e6) {
|
|
3174
3210
|
return e6 ? e6.hash : 0;
|
|
3175
3211
|
},
|
|
3176
3212
|
strict: false
|
|
3177
|
-
}), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6,
|
|
3213
|
+
}), tagStart = /* @__PURE__ */ new ExternalTokenizer((e6, y) => {
|
|
3178
3214
|
if (e6.next != lessThan) {
|
|
3179
|
-
e6.next < 0 &&
|
|
3215
|
+
e6.next < 0 && y.context && e6.acceptToken(missingCloseTag);
|
|
3180
3216
|
return;
|
|
3181
3217
|
}
|
|
3182
3218
|
e6.advance();
|
|
3183
|
-
let
|
|
3184
|
-
|
|
3185
|
-
let
|
|
3186
|
-
if (
|
|
3187
|
-
if (!
|
|
3188
|
-
let
|
|
3189
|
-
if (
|
|
3190
|
-
if (
|
|
3191
|
-
if (
|
|
3192
|
-
for (let e7 =
|
|
3219
|
+
let b = e6.next == slash$1;
|
|
3220
|
+
b && e6.advance();
|
|
3221
|
+
let x = tagNameAfter(e6, 0);
|
|
3222
|
+
if (x === void 0) return;
|
|
3223
|
+
if (!x) return e6.acceptToken(b ? IncompleteCloseTag : StartTag);
|
|
3224
|
+
let S = y.context ? y.context.name : null;
|
|
3225
|
+
if (b) {
|
|
3226
|
+
if (x == S) return e6.acceptToken(StartCloseTag);
|
|
3227
|
+
if (S && implicitlyClosed[S]) return e6.acceptToken(missingCloseTag, -2);
|
|
3228
|
+
for (let e7 = y.context; e7; e7 = e7.parent) if (e7.name == x) return;
|
|
3193
3229
|
e6.acceptToken(MismatchedStartCloseTag);
|
|
3194
3230
|
} else {
|
|
3195
|
-
if (
|
|
3196
|
-
if (
|
|
3197
|
-
if (
|
|
3198
|
-
if (selfClosers.hasOwnProperty(
|
|
3199
|
-
|
|
3231
|
+
if (x == "script") return e6.acceptToken(StartScriptTag);
|
|
3232
|
+
if (x == "style") return e6.acceptToken(StartStyleTag);
|
|
3233
|
+
if (x == "textarea") return e6.acceptToken(StartTextareaTag);
|
|
3234
|
+
if (selfClosers.hasOwnProperty(x)) return e6.acceptToken(StartSelfClosingTag);
|
|
3235
|
+
S && closeOnOpen[S] && closeOnOpen[S][x] ? e6.acceptToken(missingCloseTag, -1) : e6.acceptToken(StartTag);
|
|
3200
3236
|
}
|
|
3201
3237
|
}, { contextual: true });
|
|
3202
|
-
function contentTokenizer(e6,
|
|
3203
|
-
let
|
|
3204
|
-
return new ExternalTokenizer((
|
|
3205
|
-
for (let
|
|
3206
|
-
if (
|
|
3207
|
-
|
|
3238
|
+
function contentTokenizer(e6, y, b) {
|
|
3239
|
+
let x = 2 + e6.length;
|
|
3240
|
+
return new ExternalTokenizer((S) => {
|
|
3241
|
+
for (let C = 0, w = 0, T = 0; ; T++) {
|
|
3242
|
+
if (S.next < 0) {
|
|
3243
|
+
T && S.acceptToken(y);
|
|
3208
3244
|
break;
|
|
3209
3245
|
}
|
|
3210
|
-
if (
|
|
3211
|
-
else if ((
|
|
3212
|
-
else if (
|
|
3213
|
-
|
|
3246
|
+
if (C == 0 && S.next == lessThan || C == 1 && S.next == slash$1 || C >= 2 && C < x && S.next == e6.charCodeAt(C - 2)) C++, w++;
|
|
3247
|
+
else if ((C == 2 || C == x) && isSpace(S.next)) w++;
|
|
3248
|
+
else if (C == x && S.next == greaterThan$1) {
|
|
3249
|
+
T > w ? S.acceptToken(y, -w) : S.acceptToken(b, -(w - 2));
|
|
3214
3250
|
break;
|
|
3215
|
-
} else if ((
|
|
3216
|
-
|
|
3251
|
+
} else if ((S.next == 10 || S.next == 13) && T) {
|
|
3252
|
+
S.acceptToken(y, 1);
|
|
3217
3253
|
break;
|
|
3218
|
-
} else
|
|
3219
|
-
|
|
3254
|
+
} else C = w = 0;
|
|
3255
|
+
S.advance();
|
|
3220
3256
|
}
|
|
3221
3257
|
});
|
|
3222
3258
|
}
|
|
@@ -3252,108 +3288,108 @@ var scriptTokens = /* @__PURE__ */ contentTokenizer("script", scriptText, StartC
|
|
|
3252
3288
|
at,
|
|
3253
3289
|
slash
|
|
3254
3290
|
], commentContent = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
3255
|
-
for (let
|
|
3291
|
+
for (let y = 0, b = 0; ; b++) {
|
|
3256
3292
|
if (e6.next < 0) {
|
|
3257
|
-
|
|
3293
|
+
b && e6.acceptToken(commentContent$1);
|
|
3258
3294
|
break;
|
|
3259
3295
|
}
|
|
3260
|
-
if (e6.next == dash)
|
|
3261
|
-
else if (e6.next == greaterThan &&
|
|
3262
|
-
|
|
3296
|
+
if (e6.next == dash) y++;
|
|
3297
|
+
else if (e6.next == greaterThan && y >= 2) {
|
|
3298
|
+
b > 3 && e6.acceptToken(commentContent$1, -2);
|
|
3263
3299
|
break;
|
|
3264
|
-
} else
|
|
3300
|
+
} else y = 0;
|
|
3265
3301
|
e6.advance();
|
|
3266
3302
|
}
|
|
3267
3303
|
});
|
|
3268
3304
|
function createStringHandler(e6) {
|
|
3269
|
-
let
|
|
3270
|
-
return () =>
|
|
3305
|
+
let y = false, b = null, x = false;
|
|
3306
|
+
return () => y ? x ? (x = false, true) : e6.next === backslash ? (x = true, true) : b === "double" && e6.next === quoteDouble || b === "single" && e6.next === quoteSingle || b === "template" && e6.next === tick ? (y = false, b = null, true) : true : e6.next === quoteDouble ? (y = true, b = "double", true) : e6.next === quoteSingle ? (y = true, b = "single", true) : e6.next === tick ? (y = true, b = "template", true) : false;
|
|
3271
3307
|
}
|
|
3272
3308
|
function createCommentHandler(e6) {
|
|
3273
|
-
let
|
|
3274
|
-
return () =>
|
|
3309
|
+
let y = false, b = false;
|
|
3310
|
+
return () => y ? (e6.next === newline && (y = false), true) : b ? (e6.next === asterisk && e6.peek(1) === slash && (b = false), true) : e6.next === slash && e6.peek(1) === slash ? (y = true, true) : e6.next === slash && e6.peek(1) === asterisk ? (b = true, true) : false;
|
|
3275
3311
|
}
|
|
3276
3312
|
var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
3277
3313
|
if (prefixes.includes(e6.next)) return;
|
|
3278
|
-
let
|
|
3279
|
-
let
|
|
3280
|
-
if (
|
|
3314
|
+
let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
|
|
3315
|
+
let y2 = x.lastIndexOf(e7);
|
|
3316
|
+
if (y2 !== -1) for (; x.length > y2; ) x.pop();
|
|
3281
3317
|
};
|
|
3282
|
-
for (let
|
|
3318
|
+
for (let C = 0; ; C++) {
|
|
3283
3319
|
if (e6.next < 0) {
|
|
3284
|
-
|
|
3320
|
+
C > 0 && e6.acceptToken(LongExpression);
|
|
3285
3321
|
break;
|
|
3286
3322
|
}
|
|
3287
|
-
if (
|
|
3323
|
+
if (y() || b()) {
|
|
3288
3324
|
e6.advance();
|
|
3289
3325
|
continue;
|
|
3290
3326
|
}
|
|
3291
|
-
if (
|
|
3327
|
+
if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose)) {
|
|
3292
3328
|
e6.acceptToken(LongExpression);
|
|
3293
3329
|
break;
|
|
3294
3330
|
}
|
|
3295
3331
|
switch (e6.next) {
|
|
3296
3332
|
case parenOpen:
|
|
3297
|
-
|
|
3333
|
+
x.push("(");
|
|
3298
3334
|
break;
|
|
3299
3335
|
case parenClose:
|
|
3300
|
-
|
|
3336
|
+
S("(");
|
|
3301
3337
|
break;
|
|
3302
3338
|
case squareOpen:
|
|
3303
|
-
|
|
3339
|
+
x.push("[");
|
|
3304
3340
|
break;
|
|
3305
3341
|
case squareClose:
|
|
3306
|
-
|
|
3342
|
+
S("[");
|
|
3307
3343
|
break;
|
|
3308
3344
|
case curlyOpen:
|
|
3309
|
-
|
|
3345
|
+
x.push("{");
|
|
3310
3346
|
break;
|
|
3311
3347
|
case curlyClose:
|
|
3312
|
-
|
|
3348
|
+
S("{");
|
|
3313
3349
|
break;
|
|
3314
3350
|
}
|
|
3315
3351
|
e6.advance();
|
|
3316
3352
|
}
|
|
3317
3353
|
}), shortExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
3318
3354
|
if (prefixes.includes(e6.peek(0))) return;
|
|
3319
|
-
let
|
|
3320
|
-
let
|
|
3321
|
-
if (
|
|
3355
|
+
let y = createCommentHandler(e6), b = createStringHandler(e6), x = [], S = (e7) => {
|
|
3356
|
+
let y2 = x.lastIndexOf(e7);
|
|
3357
|
+
if (y2 !== -1) for (; x.length > y2; ) x.pop();
|
|
3322
3358
|
};
|
|
3323
|
-
for (let
|
|
3359
|
+
for (let C = 0; ; C++) {
|
|
3324
3360
|
if (e6.next < 0) {
|
|
3325
|
-
|
|
3361
|
+
C > 0 && e6.acceptToken(ShortExpression);
|
|
3326
3362
|
break;
|
|
3327
3363
|
}
|
|
3328
|
-
if (
|
|
3364
|
+
if (y() || b()) {
|
|
3329
3365
|
e6.advance();
|
|
3330
3366
|
continue;
|
|
3331
3367
|
}
|
|
3332
|
-
if (
|
|
3368
|
+
if (x.length === 0 && (e6.next === curlyClose || e6.next === parenClose || e6.next === squareClose || e6.next === comma)) {
|
|
3333
3369
|
e6.acceptToken(ShortExpression);
|
|
3334
3370
|
break;
|
|
3335
3371
|
}
|
|
3336
3372
|
switch (e6.next) {
|
|
3337
3373
|
case parenOpen:
|
|
3338
|
-
|
|
3374
|
+
x.push("(");
|
|
3339
3375
|
break;
|
|
3340
3376
|
case parenClose:
|
|
3341
|
-
|
|
3377
|
+
S("(");
|
|
3342
3378
|
break;
|
|
3343
3379
|
case squareOpen:
|
|
3344
|
-
|
|
3380
|
+
x.push("[");
|
|
3345
3381
|
break;
|
|
3346
3382
|
case squareClose:
|
|
3347
|
-
|
|
3383
|
+
S("[");
|
|
3348
3384
|
break;
|
|
3349
3385
|
case curlyOpen:
|
|
3350
|
-
|
|
3386
|
+
x.push("{");
|
|
3351
3387
|
break;
|
|
3352
3388
|
case curlyClose:
|
|
3353
|
-
|
|
3389
|
+
S("{");
|
|
3354
3390
|
break;
|
|
3355
3391
|
}
|
|
3356
|
-
if (
|
|
3392
|
+
if (C !== 0 && x.length === 0 && space.includes(e6.next)) {
|
|
3357
3393
|
e6.acceptToken(ShortExpression);
|
|
3358
3394
|
break;
|
|
3359
3395
|
}
|
|
@@ -3629,30 +3665,30 @@ var longExpression = /* @__PURE__ */ new ExternalTokenizer((e6) => {
|
|
|
3629
3665
|
],
|
|
3630
3666
|
tokenPrec: 1571
|
|
3631
3667
|
});
|
|
3632
|
-
function getAttrs(e6,
|
|
3633
|
-
let
|
|
3634
|
-
for (let
|
|
3635
|
-
let e7 =
|
|
3636
|
-
e7 && (
|
|
3668
|
+
function getAttrs(e6, y) {
|
|
3669
|
+
let b = /* @__PURE__ */ Object.create(null);
|
|
3670
|
+
for (let x of e6.firstChild.getChildren("Attribute")) {
|
|
3671
|
+
let e7 = x.getChild("AttributeName"), S = x.getChild("AttributeValue") || x.getChild("UnquotedAttributeValue");
|
|
3672
|
+
e7 && (b[y.read(e7.from, e7.to)] = S ? S.name == "AttributeValue" ? y.read(S.from + 1, S.to - 1) : y.read(S.from, S.to) : "");
|
|
3637
3673
|
}
|
|
3638
|
-
return
|
|
3674
|
+
return b;
|
|
3639
3675
|
}
|
|
3640
|
-
function maybeNest(e6,
|
|
3641
|
-
let
|
|
3642
|
-
for (let
|
|
3676
|
+
function maybeNest(e6, y, b) {
|
|
3677
|
+
let x;
|
|
3678
|
+
for (let S of b) if (!S.attrs || S.attrs(x || (x = getAttrs(e6.node.parent, y)))) return { parser: S.parser };
|
|
3643
3679
|
return null;
|
|
3644
3680
|
}
|
|
3645
3681
|
var expressionParser = /* @__PURE__ */ parser$1.configure({ top: "SingleExpression" });
|
|
3646
3682
|
function configureNesting(e6) {
|
|
3647
|
-
let
|
|
3648
|
-
for (let
|
|
3649
|
-
let e7 =
|
|
3683
|
+
let y = [], b = [], x = [];
|
|
3684
|
+
for (let S of e6) {
|
|
3685
|
+
let e7 = S.tag == "script" ? y : S.tag == "style" ? b : S.tag == "textarea" ? x : null;
|
|
3650
3686
|
if (!e7) throw RangeError("Only script, style, and textarea tags can host nested parsers");
|
|
3651
|
-
e7.push(
|
|
3687
|
+
e7.push(S);
|
|
3652
3688
|
}
|
|
3653
|
-
return parseMixed((e7,
|
|
3654
|
-
let
|
|
3655
|
-
return
|
|
3689
|
+
return parseMixed((e7, S) => {
|
|
3690
|
+
let C = e7.type.id;
|
|
3691
|
+
return C === LongExpression || C === ShortExpression ? { parser: expressionParser } : C === ScriptText ? maybeNest(e7, S, y) : C === StyleText ? maybeNest(e7, S, b) : C === TextareaText ? maybeNest(e7, S, x) : null;
|
|
3656
3692
|
});
|
|
3657
3693
|
}
|
|
3658
3694
|
var defaultNesting = [
|
|
@@ -3680,46 +3716,46 @@ var defaultNesting = [
|
|
|
3680
3716
|
wrap: /* @__PURE__ */ configureNesting(defaultNesting),
|
|
3681
3717
|
props: [/* @__PURE__ */ indentNodeProp.add({
|
|
3682
3718
|
Element: (e6) => {
|
|
3683
|
-
let
|
|
3684
|
-
return e6.node.to <= e6.pos +
|
|
3719
|
+
let y = /^(\s*)(<\/)?/.exec(e6.textAfter);
|
|
3720
|
+
return e6.node.to <= e6.pos + y[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (y[2] ? 0 : e6.unit);
|
|
3685
3721
|
},
|
|
3686
3722
|
Block: (e6) => {
|
|
3687
|
-
let
|
|
3688
|
-
if (
|
|
3689
|
-
let
|
|
3690
|
-
return
|
|
3723
|
+
let y = e6.node, b = e6.textAfter.trim();
|
|
3724
|
+
if (b.startsWith("{/")) {
|
|
3725
|
+
let x2 = y.name;
|
|
3726
|
+
return x2 === "IfBlock" && b.startsWith("{/if") || x2 === "EachBlock" && b.startsWith("{/each") || x2 === "AwaitBlock" && b.startsWith("{/await") || x2 === "KeyBlock" && b.startsWith("{/key") ? e6.lineIndent(e6.node.from) : null;
|
|
3691
3727
|
}
|
|
3692
|
-
if (
|
|
3693
|
-
if (
|
|
3694
|
-
} else if (
|
|
3695
|
-
let
|
|
3696
|
-
return e6.node.to <= e6.pos +
|
|
3728
|
+
if (y.name === "IfBlock" || y.name === "EachBlock") {
|
|
3729
|
+
if (b.startsWith("{:else")) return e6.lineIndent(y.from);
|
|
3730
|
+
} else if (y.name === "AwaitBlock" && (b.startsWith("{:then") || b.startsWith("{:catch"))) return e6.lineIndent(y.from);
|
|
3731
|
+
let x = /^(\s*)(<\/)?/.exec(e6.textAfter);
|
|
3732
|
+
return e6.node.to <= e6.pos + x[0].length ? e6.continue() : e6.lineIndent(e6.node.from) + (x[2] ? 0 : e6.unit);
|
|
3697
3733
|
},
|
|
3698
3734
|
"BlockOpen BlockClose BlockInline": (e6) => e6.column(e6.node.from) + e6.unit,
|
|
3699
3735
|
"OpenTag CloseTag SelfClosingTag": (e6) => e6.column(e6.node.from) + e6.unit,
|
|
3700
3736
|
Document: (e6) => {
|
|
3701
3737
|
if (e6.pos + /\s*/.exec(e6.textAfter)[0].length < e6.node.to) return e6.continue();
|
|
3702
|
-
let
|
|
3703
|
-
for (let
|
|
3704
|
-
let e7 =
|
|
3705
|
-
if (!e7 || e7.name != "Element" || e7.to !=
|
|
3706
|
-
|
|
3738
|
+
let y = null, b;
|
|
3739
|
+
for (let b2 = e6.node; ; ) {
|
|
3740
|
+
let e7 = b2.lastChild;
|
|
3741
|
+
if (!e7 || e7.name != "Element" || e7.to != b2.to) break;
|
|
3742
|
+
y = b2 = e7;
|
|
3707
3743
|
}
|
|
3708
|
-
return
|
|
3744
|
+
return y && !((b = y.lastChild) && (b.name === "CloseTag" || b.name === "SelfClosingTag")) ? e6.lineIndent(y.from) + e6.unit : null;
|
|
3709
3745
|
}
|
|
3710
3746
|
}), /* @__PURE__ */ foldNodeProp.add({
|
|
3711
3747
|
Block: (e6) => {
|
|
3712
|
-
let
|
|
3713
|
-
return !
|
|
3714
|
-
from:
|
|
3715
|
-
to: (
|
|
3748
|
+
let y = `${e6.name}Open`, b = `${e6.name}Close`, x = e6.firstChild, S = e6.lastChild;
|
|
3749
|
+
return !x || x.name !== y ? null : {
|
|
3750
|
+
from: x.to,
|
|
3751
|
+
to: (S == null ? void 0 : S.name) === b ? S.from : e6.to
|
|
3716
3752
|
};
|
|
3717
3753
|
},
|
|
3718
3754
|
Element: (e6) => {
|
|
3719
|
-
let
|
|
3720
|
-
return !
|
|
3721
|
-
from:
|
|
3722
|
-
to:
|
|
3755
|
+
let y = e6.firstChild, b = e6.lastChild;
|
|
3756
|
+
return !y || y.name != "OpenTag" ? null : {
|
|
3757
|
+
from: y.to,
|
|
3758
|
+
to: b.name === "CloseTag" ? b.from : e6.to
|
|
3723
3759
|
};
|
|
3724
3760
|
}
|
|
3725
3761
|
})]
|
|
@@ -3741,43 +3777,43 @@ function svelte() {
|
|
|
3741
3777
|
autoCloseTags
|
|
3742
3778
|
]);
|
|
3743
3779
|
}
|
|
3744
|
-
function elementName(e6,
|
|
3745
|
-
if (!
|
|
3746
|
-
let
|
|
3747
|
-
return
|
|
3780
|
+
function elementName(e6, y, b = e6.length) {
|
|
3781
|
+
if (!y) return "";
|
|
3782
|
+
let x = y.firstChild, S = x && (x.getChild("TagName") || x.getChild("ComponentName") || x.getChild("SvelteElementName"));
|
|
3783
|
+
return S ? e6.sliceString(S.from, Math.min(S.to, b)) : "";
|
|
3748
3784
|
}
|
|
3749
|
-
var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6,
|
|
3750
|
-
if (e6.composing || e6.state.readOnly ||
|
|
3751
|
-
let { state:
|
|
3785
|
+
var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, y, b, x) => {
|
|
3786
|
+
if (e6.composing || e6.state.readOnly || y != b || x != ">" && x != "/" || !svelteLanguage.isActiveAt(e6.state, y, -1)) return false;
|
|
3787
|
+
let { state: S } = e6, C = S.changeByRange((y2) => {
|
|
3752
3788
|
var _a, _b, _c;
|
|
3753
|
-
let { head:
|
|
3754
|
-
if ((
|
|
3755
|
-
if (((_b = (_a =
|
|
3756
|
-
let
|
|
3789
|
+
let { head: b2 } = y2, C2 = syntaxTree(S).resolveInner(b2, -1), w;
|
|
3790
|
+
if ((C2.name === "TagName" || C2.name === "ComponentName" || C2.name === "SvelteElementName" || C2.name === "StartTag") && (C2 = C2.parent), x === ">" && C2.name === "OpenTag") {
|
|
3791
|
+
if (((_b = (_a = C2.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (w = elementName(S.doc, C2.parent, b2))) {
|
|
3792
|
+
let y3 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x2 = `${y3 ? "" : ">"}</${w}>`;
|
|
3757
3793
|
return {
|
|
3758
|
-
range: EditorSelection.cursor(
|
|
3794
|
+
range: EditorSelection.cursor(b2 + 1),
|
|
3759
3795
|
changes: {
|
|
3760
|
-
from:
|
|
3761
|
-
insert:
|
|
3796
|
+
from: b2 + (y3 ? 1 : 0),
|
|
3797
|
+
insert: x2
|
|
3762
3798
|
}
|
|
3763
3799
|
};
|
|
3764
3800
|
}
|
|
3765
|
-
} else if (
|
|
3766
|
-
let
|
|
3767
|
-
if (
|
|
3768
|
-
let
|
|
3801
|
+
} else if (x === "/" && C2.name === "OpenTag") {
|
|
3802
|
+
let y3 = C2.parent, x2 = y3 == null ? void 0 : y3.parent;
|
|
3803
|
+
if (y3.from == b2 - 1 && ((_c = x2.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (w = elementName(S.doc, x2, b2))) {
|
|
3804
|
+
let y4 = e6.state.doc.sliceString(b2, b2 + 1) === ">", x3 = `/${w}${y4 ? "" : ">"}`, S2 = b2 + x3.length + (y4 ? 1 : 0);
|
|
3769
3805
|
return {
|
|
3770
|
-
range: EditorSelection.cursor(
|
|
3806
|
+
range: EditorSelection.cursor(S2),
|
|
3771
3807
|
changes: {
|
|
3772
|
-
from:
|
|
3773
|
-
insert:
|
|
3808
|
+
from: b2,
|
|
3809
|
+
insert: x3
|
|
3774
3810
|
}
|
|
3775
3811
|
};
|
|
3776
3812
|
}
|
|
3777
3813
|
}
|
|
3778
|
-
return { range:
|
|
3814
|
+
return { range: y2 };
|
|
3779
3815
|
});
|
|
3780
|
-
return
|
|
3816
|
+
return C.changes.empty ? false : (e6.dispatch(C, {
|
|
3781
3817
|
userEvent: "input.type",
|
|
3782
3818
|
scrollIntoView: true
|
|
3783
3819
|
}), true);
|
|
@@ -3945,123 +3981,123 @@ var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((e6, _, v, y) =>
|
|
|
3945
3981
|
true: true,
|
|
3946
3982
|
false: true
|
|
3947
3983
|
}, isOperatorChar = /[+\-*&^%:=<>!|/~]/, isNegativeChar = /[-]/, curPunc;
|
|
3948
|
-
function tokenBase(e6,
|
|
3949
|
-
let
|
|
3950
|
-
if (
|
|
3951
|
-
if (isVersion(e6,
|
|
3952
|
-
if (
|
|
3953
|
-
return e6.match(`${
|
|
3984
|
+
function tokenBase(e6, y) {
|
|
3985
|
+
let b = e6.next();
|
|
3986
|
+
if (b === '"' || b === "'" || b === "`") return y.tokenize = tokenString(b), y.tokenize(e6, y);
|
|
3987
|
+
if (isVersion(e6, y)) return "version";
|
|
3988
|
+
if (b === "." && keywordsMembersOfAddressType.some(function(y2) {
|
|
3989
|
+
return e6.match(`${y2}`);
|
|
3954
3990
|
})) return "addressFunction";
|
|
3955
|
-
if (typeof
|
|
3956
|
-
if (typeof
|
|
3957
|
-
if (
|
|
3958
|
-
if (e6.eat("*")) return
|
|
3991
|
+
if (typeof b == "string" && isNumber(b, e6)) return "number";
|
|
3992
|
+
if (typeof b == "string" && /[[\]{}(),;:.]/.test(b)) return updateGarmmer(b, y);
|
|
3993
|
+
if (b === "/") {
|
|
3994
|
+
if (e6.eat("*")) return y.tokenize = tokenComment, tokenComment(e6, y);
|
|
3959
3995
|
if (e6.match(/\/{2}/)) {
|
|
3960
|
-
for (
|
|
3961
|
-
if (
|
|
3962
|
-
e6.backUp(1),
|
|
3996
|
+
for (b = e6.next(); b; ) {
|
|
3997
|
+
if (b === "@") {
|
|
3998
|
+
e6.backUp(1), y.grammar = "doc";
|
|
3963
3999
|
break;
|
|
3964
4000
|
}
|
|
3965
|
-
|
|
4001
|
+
b = e6.next();
|
|
3966
4002
|
}
|
|
3967
4003
|
return "doc";
|
|
3968
4004
|
}
|
|
3969
4005
|
if (e6.eat("/")) return e6.skipToEnd(), "comment";
|
|
3970
4006
|
}
|
|
3971
|
-
if (typeof
|
|
3972
|
-
let
|
|
3973
|
-
return typeof
|
|
4007
|
+
if (typeof b == "string" && isNegativeChar.test(b)) {
|
|
4008
|
+
let y2 = e6.peek();
|
|
4009
|
+
return typeof y2 == "string" && isNumber(y2, e6) ? "number" : "operator";
|
|
3974
4010
|
}
|
|
3975
|
-
if (typeof
|
|
4011
|
+
if (typeof b == "string" && isOperatorChar.test(b)) return e6.eatWhile(isOperatorChar), "operator";
|
|
3976
4012
|
e6.eatWhile(/[\w$_\xa1-\uffff]/);
|
|
3977
|
-
let
|
|
3978
|
-
return
|
|
3979
|
-
return
|
|
3980
|
-
}) ? "docReserve" : "doc" : (
|
|
3981
|
-
return e6.match(`.${
|
|
3982
|
-
}) ? "variable-2" :
|
|
3983
|
-
return e6.match(`.${
|
|
3984
|
-
}) ? "abi" : updateHexLiterals(
|
|
4013
|
+
let x = e6.current();
|
|
4014
|
+
return y.grammar === "doc" ? natSpecTags.some(function(e7) {
|
|
4015
|
+
return x === `@${e7}`;
|
|
4016
|
+
}) ? "docReserve" : "doc" : (x === "solidity" && y.lastToken === "pragma" && (y.lastToken = y.lastToken + " " + x), Object.prototype.propertyIsEnumerable.call(keywords, x) ? ((x === "case" || x === "default") && (curPunc = "case"), Object.prototype.propertyIsEnumerable.call(keywordsSpecial, x) && (y.lastToken = x), "keyword") : Object.prototype.propertyIsEnumerable.call(keywordsEtherUnit, x) ? "etherUnit" : Object.prototype.propertyIsEnumerable.call(keywordsContractRelated, x) ? "contractRelated" : Object.prototype.propertyIsEnumerable.call(keywordsControlStructures, x) || Object.prototype.propertyIsEnumerable.call(keywordsTypeInformation, x) || Object.prototype.propertyIsEnumerable.call(keywordsV0505NewReserve, x) ? "keyword" : Object.prototype.propertyIsEnumerable.call(keywordsValueTypes, x) || Object.prototype.propertyIsEnumerable.call(keywordsTimeUnit, x) || isValidInteger(x) || isValidBytes(x) || isValidFixed(x) ? (y.lastToken += "variable", "keyword") : Object.prototype.propertyIsEnumerable.call(atoms, x) ? "atom" : Object.prototype.propertyIsEnumerable.call(keywordsErrorHandling, x) ? "errorHandling" : Object.prototype.propertyIsEnumerable.call(keywordsMathematicalAndCryptographicFuctions, x) ? "mathematicalAndCryptographic" : Object.prototype.propertyIsEnumerable.call(keywordsMoreBlockAndTransactionProperties, x) || Object.prototype.propertyIsEnumerable.call(keywordsBlockAndTransactionProperties, x) && keywordsBlockAndTransactionProperties[x].some(function(y2) {
|
|
4017
|
+
return e6.match(`.${y2}`);
|
|
4018
|
+
}) ? "variable-2" : x === "abi" && keywordsAbiEncodeDecodeFunctions[x].some(function(y2) {
|
|
4019
|
+
return e6.match(`.${y2}`);
|
|
4020
|
+
}) ? "abi" : updateHexLiterals(x, e6) ?? ((y.lastToken === "functionName(" || y.lastToken === "returns(") && Object.prototype.propertyIsEnumerable.call(keywordsContractList, x) ? (y.lastToken += "variable", "variable") : y.lastToken === "function" ? (y.lastToken = "functionName", y.para ?? (y.para = (y.grammar = "function", "")), y.para += "functionName", "functionName") : y.lastToken === "functionName(variable" ? (y.lastToken = "functionName(", "parameterValue") : y.lastToken === "returns(variable" ? (y.lastToken = "returns(", "parameterValue") : (y.lastToken === "address" && x === "payable" && (y.lastToken = "address payable"), (y.lastToken === "contract" || y.lastToken === "struct") && (keywordsContractList[x] = true, y.lastToken = null), y.grammar === "function" ? "parameterValue" : "variable")));
|
|
3985
4021
|
}
|
|
3986
4022
|
function tokenString(e6) {
|
|
3987
|
-
return function(
|
|
3988
|
-
let
|
|
3989
|
-
for (
|
|
3990
|
-
if (
|
|
3991
|
-
|
|
4023
|
+
return function(y, b) {
|
|
4024
|
+
let x = false, S, C = false;
|
|
4025
|
+
for (S = y.next(); S != null; ) {
|
|
4026
|
+
if (S === e6 && !x) {
|
|
4027
|
+
C = true;
|
|
3992
4028
|
break;
|
|
3993
4029
|
}
|
|
3994
|
-
|
|
4030
|
+
x = !x && e6 !== "`" && S === "\\", S = y.next();
|
|
3995
4031
|
}
|
|
3996
|
-
return (
|
|
4032
|
+
return (C || !(x || e6 === "`")) && (b.tokenize = tokenBase), "string";
|
|
3997
4033
|
};
|
|
3998
4034
|
}
|
|
3999
|
-
function tokenComment(e6,
|
|
4000
|
-
let
|
|
4001
|
-
for (;
|
|
4002
|
-
if (
|
|
4003
|
-
|
|
4035
|
+
function tokenComment(e6, y) {
|
|
4036
|
+
let b = false, x = e6.next();
|
|
4037
|
+
for (; x; ) {
|
|
4038
|
+
if (x === "/" && b) {
|
|
4039
|
+
y.tokenize = tokenBase;
|
|
4004
4040
|
break;
|
|
4005
4041
|
}
|
|
4006
|
-
|
|
4042
|
+
b = x === "*", x = e6.next();
|
|
4007
4043
|
}
|
|
4008
4044
|
return "comment";
|
|
4009
4045
|
}
|
|
4010
|
-
function isVersion(e6,
|
|
4011
|
-
if (
|
|
4046
|
+
function isVersion(e6, y) {
|
|
4047
|
+
if (y.lastToken === "pragma solidity") return y.lastToken = null, !y.startOfLine && (e6.match(/[\^{0}][0-9.]+/) || e6.match(/[>=]+?[\s]*[0-9.]+[\s]*[<]?[\s]*[0-9.]+/));
|
|
4012
4048
|
}
|
|
4013
|
-
function isNumber(e6,
|
|
4014
|
-
if (/[\d.]/.test(e6)) return e6 === "." ?
|
|
4049
|
+
function isNumber(e6, y) {
|
|
4050
|
+
if (/[\d.]/.test(e6)) return e6 === "." ? y.match(/^[0-9]+([eE][-+]?[0-9]+)?/) : e6 === "0" ? y.match(/^[xX][0-9a-fA-F]+/) || y.match(/^0[0-7]+/) : y.match(/^[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?/), true;
|
|
4015
4051
|
}
|
|
4016
4052
|
function isValidInteger(e6) {
|
|
4017
4053
|
if (e6.match(/^[u]?int/)) {
|
|
4018
4054
|
if (e6.indexOf("t") + 1 === e6.length) return true;
|
|
4019
|
-
let
|
|
4020
|
-
return
|
|
4055
|
+
let y = Number(e6.substr(e6.indexOf("t") + 1, e6.length));
|
|
4056
|
+
return y % 8 == 0 && y <= 256;
|
|
4021
4057
|
}
|
|
4022
4058
|
}
|
|
4023
4059
|
function isValidBytes(e6) {
|
|
4024
4060
|
if (e6.match(/^bytes/)) {
|
|
4025
4061
|
if (e6.indexOf("s") + 1 === e6.length) return true;
|
|
4026
|
-
let
|
|
4027
|
-
return Number(
|
|
4062
|
+
let y = e6.substr(e6.indexOf("s") + 1, e6.length);
|
|
4063
|
+
return Number(y) <= 32;
|
|
4028
4064
|
}
|
|
4029
4065
|
}
|
|
4030
4066
|
function isValidFixed(e6) {
|
|
4031
4067
|
if (e6.match(/^[u]?fixed([0-9]+x[0-9]+)?/)) {
|
|
4032
4068
|
if (e6.indexOf("d") + 1 === e6.length) return true;
|
|
4033
|
-
let
|
|
4034
|
-
return
|
|
4069
|
+
let y = e6.substr(e6.indexOf("d") + 1, e6.length).split("x").map(Number);
|
|
4070
|
+
return y[0] % 8 == 0 && y[0] <= 256 && y[1] <= 80;
|
|
4035
4071
|
}
|
|
4036
4072
|
}
|
|
4037
|
-
function updateHexLiterals(e6,
|
|
4038
|
-
if (e6.match(/^hex/) &&
|
|
4039
|
-
let e7 = false,
|
|
4040
|
-
for (
|
|
4041
|
-
if (
|
|
4042
|
-
if (
|
|
4043
|
-
|
|
4073
|
+
function updateHexLiterals(e6, y) {
|
|
4074
|
+
if (e6.match(/^hex/) && y.peek() === '"') {
|
|
4075
|
+
let e7 = false, b, x = "", S = "";
|
|
4076
|
+
for (b = y.next(); b; ) {
|
|
4077
|
+
if (S += b, b === '"' && e7) {
|
|
4078
|
+
if (x = S.substring(1, S.length - 1), x.match(/^[0-9a-fA-F]+$/)) return "number";
|
|
4079
|
+
y.backUp(S.length);
|
|
4044
4080
|
break;
|
|
4045
4081
|
}
|
|
4046
|
-
e7 || (e7 =
|
|
4082
|
+
e7 || (e7 = b === '"'), b = y.next();
|
|
4047
4083
|
}
|
|
4048
4084
|
}
|
|
4049
4085
|
}
|
|
4050
|
-
function updateGarmmer(e6,
|
|
4051
|
-
return e6 === "," &&
|
|
4086
|
+
function updateGarmmer(e6, y) {
|
|
4087
|
+
return e6 === "," && y.para === "functionName(variable" && (y.para = "functionName("), y.para != null && y.para.startsWith("functionName") && (e6 === ")" ? y.para.endsWith("(") && (y.para = y.para.substr(0, y.para.length - 1), y.para === "functionName" && (y.grammar = "")) : e6 === "(" && (y.para += e6)), e6 === "(" && y.lastToken === "functionName" ? y.lastToken += e6 : e6 === ")" && y.lastToken === "functionName(" ? y.lastToken = null : e6 === "(" && y.lastToken === "returns" ? y.lastToken += e6 : e6 === ")" && (y.lastToken === "returns(" || y.lastToken === "returns(variable") && (y.lastToken = null), e6 === "(" && y.lastToken === "address" && (y.lastToken += e6), curPunc = e6, null;
|
|
4052
4088
|
}
|
|
4053
4089
|
var Context = class {
|
|
4054
|
-
constructor(e6,
|
|
4055
|
-
this.indented = e6, this.column =
|
|
4090
|
+
constructor(e6, y, b, x, S) {
|
|
4091
|
+
this.indented = e6, this.column = y, this.type = b, this.align = x, this.prev = S;
|
|
4056
4092
|
}
|
|
4057
4093
|
};
|
|
4058
|
-
function pushContext(e6,
|
|
4059
|
-
return e6.context = new Context(e6.indented,
|
|
4094
|
+
function pushContext(e6, y, b) {
|
|
4095
|
+
return e6.context = new Context(e6.indented, y, b, null, e6.context), e6.context;
|
|
4060
4096
|
}
|
|
4061
4097
|
function popContext(e6) {
|
|
4062
4098
|
if (!e6.context.prev) return;
|
|
4063
|
-
let
|
|
4064
|
-
return (
|
|
4099
|
+
let y = e6.context.type;
|
|
4100
|
+
return (y === ")" || y === "]" || y === "}") && (e6.indented = e6.context.indented), e6.context = e6.context.prev;
|
|
4065
4101
|
}
|
|
4066
4102
|
var parser = {
|
|
4067
4103
|
startState(e6) {
|
|
@@ -4075,19 +4111,19 @@ var parser = {
|
|
|
4075
4111
|
para: null
|
|
4076
4112
|
};
|
|
4077
4113
|
},
|
|
4078
|
-
token(e6,
|
|
4079
|
-
let
|
|
4080
|
-
if (e6.sol() && (
|
|
4114
|
+
token(e6, y) {
|
|
4115
|
+
let b = y.context;
|
|
4116
|
+
if (e6.sol() && (b.align ?? (b.align = false), y.indented = e6.indentation(), y.startOfLine = true, b.type === "case" && (b.type = "}"), y.grammar === "doc" && (y.grammar = null)), e6.eatSpace()) return null;
|
|
4081
4117
|
curPunc = null;
|
|
4082
|
-
let
|
|
4083
|
-
return
|
|
4118
|
+
let x = (y.tokenize || tokenBase)(e6, y);
|
|
4119
|
+
return x === "comment" ? x : (b.align ?? (b.align = true), curPunc === "{" ? pushContext(y, e6.column(), "}") : curPunc === "[" ? pushContext(y, e6.column(), "]") : curPunc === "(" ? pushContext(y, e6.column(), ")") : curPunc === "case" ? b.type = "case" : (curPunc === "}" && b.type === "}" || curPunc === b.type) && popContext(y), y.startOfLine = false, x);
|
|
4084
4120
|
},
|
|
4085
|
-
indent(e6,
|
|
4121
|
+
indent(e6, y, b) {
|
|
4086
4122
|
if (e6.tokenize !== tokenBase && e6.tokenize != null) return null;
|
|
4087
|
-
let
|
|
4088
|
-
if (
|
|
4089
|
-
let
|
|
4090
|
-
return
|
|
4123
|
+
let x = e6.context, S = y && y.charAt(0);
|
|
4124
|
+
if (x.type === "case" && /^(?:case|default)\b/.test(y)) return e6.context.type = "}", x.indented;
|
|
4125
|
+
let C = S === x.type;
|
|
4126
|
+
return x.align ? x.column + (C ? 0 : 1) : x.indented + (C ? 0 : b.unit);
|
|
4091
4127
|
},
|
|
4092
4128
|
electricChars: "{}):",
|
|
4093
4129
|
closeBrackets: "()[]{}''\"\"``",
|