research-copilot 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/app/build/icon.icns +0 -0
- package/app/build/icon.ico +0 -0
- package/app/build/icon.png +0 -0
- package/app/out/main/index.mjs +6719 -0
- package/app/out/preload/index.js +141 -0
- package/app/out/renderer/assets/Inter-Variable-Latin-8kRkwJBP.woff2 +0 -0
- package/app/out/renderer/assets/Inter-Variable-LatinExt-B_-bZUTo.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/app/out/renderer/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/app/out/renderer/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/app/out/renderer/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/app/out/renderer/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/app/out/renderer/assets/MilkdownMarkdownEditor-bLPxrCVb.js +89821 -0
- package/app/out/renderer/assets/MilkdownMarkdownEditor-tTNRIB2K.css +2555 -0
- package/app/out/renderer/assets/Tableau10-BqnYsPR6.js +9 -0
- package/app/out/renderer/assets/apl-fqmucPXA.js +140 -0
- package/app/out/renderer/assets/arc-J47ePHZ2.js +132 -0
- package/app/out/renderer/assets/array-DgktLKBx.js +6 -0
- package/app/out/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
- package/app/out/renderer/assets/asn1-BnOEsgAm.js +144 -0
- package/app/out/renderer/assets/asterisk-QAlztEwS.js +345 -0
- package/app/out/renderer/assets/blockDiagram-c4efeb88-5uRQXgQJ.js +1817 -0
- package/app/out/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
- package/app/out/renderer/assets/c4Diagram-c83219d4-C4iCTPEL.js +2464 -0
- package/app/out/renderer/assets/channel-ZAmhHE3g.js +7 -0
- package/app/out/renderer/assets/classDiagram-beda092f-7NOZxq_W.js +357 -0
- package/app/out/renderer/assets/classDiagram-v2-2358418a-5fPT-cUH.js +291 -0
- package/app/out/renderer/assets/clike-xqXYL6ge.js +805 -0
- package/app/out/renderer/assets/clojure-BhXMqnxz.js +849 -0
- package/app/out/renderer/assets/clone-CsnzsYXQ.js +8 -0
- package/app/out/renderer/assets/cmake-BGaNd9E7.js +71 -0
- package/app/out/renderer/assets/cobol-4yqQntpt.js +120 -0
- package/app/out/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
- package/app/out/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
- package/app/out/renderer/assets/createText-1719965b-Cji7KN4K.js +4904 -0
- package/app/out/renderer/assets/crystal-DyuLTqLs.js +398 -0
- package/app/out/renderer/assets/css-c-jst79C.js +1783 -0
- package/app/out/renderer/assets/cypher-Dlu_3r4V.js +121 -0
- package/app/out/renderer/assets/d-UURgV0Ux.js +179 -0
- package/app/out/renderer/assets/diff-B_Bi2Crb.js +25 -0
- package/app/out/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
- package/app/out/renderer/assets/dtd-Dy74G54E.js +114 -0
- package/app/out/renderer/assets/dylan-TSb-Nfix.js +314 -0
- package/app/out/renderer/assets/ebnf-DAomQUbD.js +139 -0
- package/app/out/renderer/assets/ecl-B59qGGVg.js +178 -0
- package/app/out/renderer/assets/edges-96097737-CD0EvAZQ.js +1844 -0
- package/app/out/renderer/assets/eiffel-Dze7nlu3.js +134 -0
- package/app/out/renderer/assets/elm-DG7jkhNZ.js +176 -0
- package/app/out/renderer/assets/erDiagram-0228fc6a-DRYXBpi7.js +1321 -0
- package/app/out/renderer/assets/erlang-BO6gOnGA.js +674 -0
- package/app/out/renderer/assets/factor-CMxFHDqz.js +65 -0
- package/app/out/renderer/assets/fcl-CDDUNjTj.js +141 -0
- package/app/out/renderer/assets/flowDb-c6c81e3f-CuoIN-Cy.js +1713 -0
- package/app/out/renderer/assets/flowDiagram-50d868cf-CPWPLOml.js +1272 -0
- package/app/out/renderer/assets/flowDiagram-v2-4f6560a1-C_R12s4S.js +33 -0
- package/app/out/renderer/assets/flowchart-elk-definition-6af322e1-BdKUSFpi.js +92921 -0
- package/app/out/renderer/assets/forth-B9D2JCeE.js +116 -0
- package/app/out/renderer/assets/fortran-CAG2BFbe.js +467 -0
- package/app/out/renderer/assets/ganttDiagram-a2739b55-ygqT5HlG.js +3399 -0
- package/app/out/renderer/assets/gas-d3KEcW3x.js +294 -0
- package/app/out/renderer/assets/gherkin-DhZlEZiy.js +115 -0
- package/app/out/renderer/assets/gitGraphDiagram-82fe8481-D97GT4iA.js +1791 -0
- package/app/out/renderer/assets/graph-DpC13d95.js +1237 -0
- package/app/out/renderer/assets/groovy-CpwJiBl7.js +223 -0
- package/app/out/renderer/assets/haskell-BlGBCCe3.js +459 -0
- package/app/out/renderer/assets/haxe-7MlzfeYV.js +514 -0
- package/app/out/renderer/assets/http-BqypyemW.js +79 -0
- package/app/out/renderer/assets/idl-4HIGJlDI.js +985 -0
- package/app/out/renderer/assets/index-4-ziknCv.js +292 -0
- package/app/out/renderer/assets/index-5325376f-Bbs7Fbqr.js +663 -0
- package/app/out/renderer/assets/index-B2jip-rk.js +2489 -0
- package/app/out/renderer/assets/index-BKTVfokE.js +312 -0
- package/app/out/renderer/assets/index-BiJbFgVG.js +118 -0
- package/app/out/renderer/assets/index-Bn433Fat.js +83 -0
- package/app/out/renderer/assets/index-BqDyyRCx.js +39679 -0
- package/app/out/renderer/assets/index-BzFMeMPn.js +158 -0
- package/app/out/renderer/assets/index-C-_uCjZJ.css +2701 -0
- package/app/out/renderer/assets/index-C1ithNW1.js +1765 -0
- package/app/out/renderer/assets/index-CAJkRYkO.js +407 -0
- package/app/out/renderer/assets/index-CleO0-yj.js +690 -0
- package/app/out/renderer/assets/index-Cq4MH3sY.js +1020 -0
- package/app/out/renderer/assets/index-CtA0Xj22.js +705 -0
- package/app/out/renderer/assets/index-CvAZkqBZ.js +83 -0
- package/app/out/renderer/assets/index-D3UDN-5c.js +152 -0
- package/app/out/renderer/assets/index-D4F9R5ao.js +179 -0
- package/app/out/renderer/assets/index-D6RguhZ5.js +328 -0
- package/app/out/renderer/assets/index-DnEowqXv.js +386 -0
- package/app/out/renderer/assets/index-K8c8Mqdy.js +98 -0
- package/app/out/renderer/assets/index-Kh14gO6K.js +62 -0
- package/app/out/renderer/assets/index-WFd2jRnA.js +333 -0
- package/app/out/renderer/assets/index-WgMfkRFp.js +313 -0
- package/app/out/renderer/assets/index-Y4lKyF6t.js +1042 -0
- package/app/out/renderer/assets/index-fx307_f1.js +643 -0
- package/app/out/renderer/assets/infoDiagram-8eee0895-ptaVSwzq.js +511 -0
- package/app/out/renderer/assets/init-ZxktEp_H.js +16 -0
- package/app/out/renderer/assets/javascript-C3MnDRiU.js +994 -0
- package/app/out/renderer/assets/journeyDiagram-c64418c1-aloEGOQp.js +1184 -0
- package/app/out/renderer/assets/julia-Bs6JJhYG.js +407 -0
- package/app/out/renderer/assets/layout-ZeuHE_aY.js +2217 -0
- package/app/out/renderer/assets/line-CAgaGl-S.js +45 -0
- package/app/out/renderer/assets/linear-DIg7lTe1.js +539 -0
- package/app/out/renderer/assets/livescript-DmzgM3Yt.js +296 -0
- package/app/out/renderer/assets/lua-8cJgIlqe.js +256 -0
- package/app/out/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
- package/app/out/renderer/assets/mbox-Ga7d4MMN.js +117 -0
- package/app/out/renderer/assets/mindmap-definition-8da855dc-B8XVoUxz.js +36054 -0
- package/app/out/renderer/assets/mirc-Dma3B8rS.js +107 -0
- package/app/out/renderer/assets/mllike-DHn7xckP.js +334 -0
- package/app/out/renderer/assets/modelica-0d55jYY0.js +147 -0
- package/app/out/renderer/assets/mscgen-DdqZYINH.js +135 -0
- package/app/out/renderer/assets/mumps-Btr8VblO.js +93 -0
- package/app/out/renderer/assets/nginx-DTDtBDVN.js +141 -0
- package/app/out/renderer/assets/nsis-3zG7tgur.js +62 -0
- package/app/out/renderer/assets/ntriples-CvgOYMpL.js +153 -0
- package/app/out/renderer/assets/octave-DYBj3-tl.js +200 -0
- package/app/out/renderer/assets/ordinal-DSZU4PqD.js +76 -0
- package/app/out/renderer/assets/oz-R_e8WMIi.js +231 -0
- package/app/out/renderer/assets/pascal-GD8iposT.js +105 -0
- package/app/out/renderer/assets/path-Cp2qmpkd.js +109 -0
- package/app/out/renderer/assets/perl-DL9mHpoi.js +1105 -0
- package/app/out/renderer/assets/pieDiagram-a8764435-DlwoeBU2.js +770 -0
- package/app/out/renderer/assets/pig-C_4T4YIV.js +101 -0
- package/app/out/renderer/assets/powershell-B0suO7Vd.js +328 -0
- package/app/out/renderer/assets/properties-BR-vP1aU.js +58 -0
- package/app/out/renderer/assets/protobuf-BxgpyhoW.js +77 -0
- package/app/out/renderer/assets/pug-By0kVCfm.js +405 -0
- package/app/out/renderer/assets/puppet-Bdao66PW.js +137 -0
- package/app/out/renderer/assets/python-CvWbmiX4.js +427 -0
- package/app/out/renderer/assets/q-CrbCVq4a.js +131 -0
- package/app/out/renderer/assets/quadrantDiagram-1e28029f-BaSi1XB4.js +1200 -0
- package/app/out/renderer/assets/r-V7nswm59.js +170 -0
- package/app/out/renderer/assets/requirementDiagram-08caed73-D3EFyegZ.js +1092 -0
- package/app/out/renderer/assets/rpm-C-DLY-If.js +109 -0
- package/app/out/renderer/assets/ruby-JDKLJNK0.js +330 -0
- package/app/out/renderer/assets/sankeyDiagram-a04cb91d-Cv44AsnM.js +1174 -0
- package/app/out/renderer/assets/sas-D2UG-yhZ.js +207 -0
- package/app/out/renderer/assets/scheme-BKzrkGJD.js +222 -0
- package/app/out/renderer/assets/sequenceDiagram-c5b8d532-CuUBu-x4.js +3337 -0
- package/app/out/renderer/assets/shell-BlsXDxCn.js +222 -0
- package/app/out/renderer/assets/sieve-CjwBwOY5.js +135 -0
- package/app/out/renderer/assets/simple-mode-DMneyfDu.js +130 -0
- package/app/out/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
- package/app/out/renderer/assets/solr-CwD7U71z.js +69 -0
- package/app/out/renderer/assets/sparql-DYskk2vE.js +249 -0
- package/app/out/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
- package/app/out/renderer/assets/sql-BSrOzCRI.js +354 -0
- package/app/out/renderer/assets/stateDiagram-1ecb1508-BOU34Zp4.js +454 -0
- package/app/out/renderer/assets/stateDiagram-v2-c2b004d7-BgRoffou.js +326 -0
- package/app/out/renderer/assets/stex-B6LNC55o.js +231 -0
- package/app/out/renderer/assets/styles-b4e223ce-BMr9TPuj.js +1483 -0
- package/app/out/renderer/assets/styles-ca3715f6-DgbNw99p.js +1363 -0
- package/app/out/renderer/assets/styles-d45a18b0-DtRYKYKf.js +574 -0
- package/app/out/renderer/assets/stylus-BkS-boTH.js +565 -0
- package/app/out/renderer/assets/svgDrawCommon-b86b1483-Bein03PD.js +100 -0
- package/app/out/renderer/assets/swift-FRZi1uvB.js +291 -0
- package/app/out/renderer/assets/tcl-CUcaCdmq.js +114 -0
- package/app/out/renderer/assets/textile-BnFpjsrl.js +414 -0
- package/app/out/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
- package/app/out/renderer/assets/tiki-B4EPSQ1G.js +265 -0
- package/app/out/renderer/assets/timeline-definition-faaaa080-BlWpLE_4.js +1212 -0
- package/app/out/renderer/assets/toml-BOuWGMcf.js +76 -0
- package/app/out/renderer/assets/troff-E1bJ0PPL.js +61 -0
- package/app/out/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
- package/app/out/renderer/assets/ttcn-tKd4HLu4.js +192 -0
- package/app/out/renderer/assets/turtle-Dq7-1WAf.js +124 -0
- package/app/out/renderer/assets/vb-Dp90gtsv.js +196 -0
- package/app/out/renderer/assets/vbscript-CI6_mxxU.js +479 -0
- package/app/out/renderer/assets/velocity-BwIZK1TH.js +149 -0
- package/app/out/renderer/assets/verilog-DDCYnHN8.js +430 -0
- package/app/out/renderer/assets/vhdl-DCkMIyT9.js +158 -0
- package/app/out/renderer/assets/webidl-BTLTThCm.js +204 -0
- package/app/out/renderer/assets/xquery-BgiOC5Ce.js +525 -0
- package/app/out/renderer/assets/xychartDiagram-f5964ef8-Bhga-YXm.js +1799 -0
- package/app/out/renderer/assets/yacas-b5lAVEIl.js +130 -0
- package/app/out/renderer/assets/z80-BZV19vqv.js +93 -0
- package/app/out/renderer/index.html +13 -0
- package/app/out/skills/community-builtin/README.md +29 -0
- package/app/out/skills/community-builtin/document-docx/SKILL.md +44 -0
- package/app/out/skills/community-builtin/document-docx/scripts/docx-to-markdown.sh +20 -0
- package/app/out/skills/community-builtin/document-docx/scripts/extract-docx-text.sh +28 -0
- package/app/out/skills/community-builtin/document-docx/scripts/init-docx-template.sh +32 -0
- package/app/out/skills/community-builtin/document-docx/scripts/setup-docx-tools.sh +10 -0
- package/app/out/skills/community-builtin/markitdown/SKILL.md +105 -0
- package/app/out/skills/community-builtin/markitdown/scripts/batch-convert.sh +40 -0
- package/app/out/skills/community-builtin/markitdown/scripts/convert-file.sh +24 -0
- package/app/out/skills/community-builtin/markitdown/scripts/setup-markitdown.sh +10 -0
- package/app/out/skills/community-builtin/repo-quick-audit/SKILL.md +27 -0
- package/app/out/skills/community-builtin/repo-quick-audit/scripts/audit-basics.sh +19 -0
- package/app/out/skills/research-pilot-default-project-skills/README.md +23 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/SKILL.md +39 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/doi-to-bibtex.sh +25 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/normalize-bibtex-keys.sh +51 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/setup-citation-tools.sh +10 -0
- package/app/out/skills/research-pilot-default-project-skills/citation-management/scripts/validate-bib.sh +31 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/SKILL.md +34 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/api_reference.md +412 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/common_issues.md +563 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/plot_types.md +476 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/styling_guide.md +589 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/references/subagent_quickstart.md +30 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/plot_template.py +401 -0
- package/app/out/skills/research-pilot-default-project-skills/matplotlib/scripts/style_configurator.py +409 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/SKILL.md +38 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/check-grant-compliance.sh +40 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/grant-summary-card.sh +32 -0
- package/app/out/skills/research-pilot-default-project-skills/research-grants/scripts/init-grant-structure.sh +70 -0
- package/app/package.json +77 -0
- package/bin/cli.mjs +56 -0
- package/lib/README.md +145 -0
- package/lib/skills/_generated.ts +13 -0
- package/lib/skills/builtin/brainstorming-research-ideas/SKILL.md +280 -0
- package/lib/skills/builtin/coding/SKILL.md +114 -0
- package/lib/skills/builtin/creative-thinking-for-research/SKILL.md +273 -0
- package/lib/skills/builtin/matplotlib/SKILL.md +361 -0
- package/lib/skills/builtin/matplotlib/references/api_reference.md +412 -0
- package/lib/skills/builtin/matplotlib/references/common_issues.md +563 -0
- package/lib/skills/builtin/matplotlib/references/plot_types.md +476 -0
- package/lib/skills/builtin/matplotlib/references/styling_guide.md +589 -0
- package/lib/skills/builtin/matplotlib/scripts/plot_template.py +401 -0
- package/lib/skills/builtin/matplotlib/scripts/style_configurator.py +409 -0
- package/lib/skills/builtin/paper-writing/SKILL.md +554 -0
- package/lib/skills/builtin/paper-writing/references/checklists.md +524 -0
- package/lib/skills/builtin/paper-writing/references/citation-workflow.md +562 -0
- package/lib/skills/builtin/paper-writing/references/reviewer-guidelines.md +462 -0
- package/lib/skills/builtin/paper-writing/references/sources.md +189 -0
- package/lib/skills/builtin/paper-writing/references/systems-conferences.md +260 -0
- package/lib/skills/builtin/paper-writing/references/writing-guide.md +476 -0
- package/lib/skills/builtin/paper-writing/templates/README.md +408 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/README.md +534 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/lib/skills/builtin/paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/lib/skills/builtin/paper-writing/templates/acl/README.md +50 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl.sty +312 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_latex.tex +377 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/lib/skills/builtin/paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/lib/skills/builtin/paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/lib/skills/builtin/paper-writing/templates/acl/custom.bib +70 -0
- package/lib/skills/builtin/paper-writing/templates/acl/formatting.md +326 -0
- package/lib/skills/builtin/paper-writing/templates/asplos2027/main.tex +459 -0
- package/lib/skills/builtin/paper-writing/templates/asplos2027/references.bib +135 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/README.md +3 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/lib/skills/builtin/paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/lib/skills/builtin/paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/lib/skills/builtin/paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/Makefile +36 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/main.tex +38 -0
- package/lib/skills/builtin/paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/main.tex +426 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/references.bib +151 -0
- package/lib/skills/builtin/paper-writing/templates/nsdi2027/usenix-2020-09.sty +83 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/main.tex +429 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/references.bib +150 -0
- package/lib/skills/builtin/paper-writing/templates/osdi2026/usenix-2020-09.sty +83 -0
- package/lib/skills/builtin/paper-writing/templates/sosp2026/main.tex +532 -0
- package/lib/skills/builtin/paper-writing/templates/sosp2026/references.bib +148 -0
- package/lib/skills/builtin/research-grants/SKILL.md +958 -0
- package/lib/skills/builtin/research-grants/assets/budget_justification_template.md +453 -0
- package/lib/skills/builtin/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/lib/skills/builtin/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/lib/skills/builtin/research-grants/references/README.md +285 -0
- package/lib/skills/builtin/research-grants/references/broader_impacts.md +392 -0
- package/lib/skills/builtin/research-grants/references/darpa_guidelines.md +636 -0
- package/lib/skills/builtin/research-grants/references/doe_guidelines.md +586 -0
- package/lib/skills/builtin/research-grants/references/nih_guidelines.md +851 -0
- package/lib/skills/builtin/research-grants/references/nsf_guidelines.md +570 -0
- package/lib/skills/builtin/research-grants/references/nstc_guidelines.md +733 -0
- package/lib/skills/builtin/research-grants/references/specific_aims_guide.md +458 -0
- package/lib/skills/builtin/rewrite-humanize/SKILL.md +116 -0
- package/lib/skills/builtin/rewrite-humanize/references/cs-venue-tone.md +57 -0
- package/lib/skills/builtin/rewrite-humanize/references/lexicon.md +50 -0
- package/lib/skills/builtin/scholar-evaluation/SKILL.md +300 -0
- package/lib/skills/builtin/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/lib/skills/builtin/scholar-evaluation/scripts/calculate_scores.py +379 -0
- package/lib/skills/builtin/scientific-schematics/SKILL.md +603 -0
- package/lib/skills/builtin/scientific-schematics/references/QUICK_REFERENCE.md +182 -0
- package/lib/skills/builtin/scientific-schematics/references/README.md +292 -0
- package/lib/skills/builtin/scientific-schematics/references/best_practices.md +560 -0
- package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic.cpython-312.pyc +0 -0
- package/lib/skills/builtin/scientific-schematics/scripts/__pycache__/generate_schematic_ai.cpython-312.pyc +0 -0
- package/lib/skills/builtin/scientific-schematics/scripts/example_usage.sh +85 -0
- package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic.py +141 -0
- package/lib/skills/builtin/scientific-schematics/scripts/generate_schematic_ai.py +910 -0
- package/lib/skills/builtin/scientific-visualization/SKILL.md +749 -0
- package/lib/skills/builtin/scientific-visualization/assets/color_palettes.py +197 -0
- package/lib/skills/builtin/scientific-visualization/assets/nature.mplstyle +63 -0
- package/lib/skills/builtin/scientific-visualization/assets/presentation.mplstyle +61 -0
- package/lib/skills/builtin/scientific-visualization/assets/publication.mplstyle +68 -0
- package/lib/skills/builtin/scientific-visualization/references/color_palettes.md +348 -0
- package/lib/skills/builtin/scientific-visualization/references/journal_requirements.md +320 -0
- package/lib/skills/builtin/scientific-visualization/references/matplotlib_examples.md +620 -0
- package/lib/skills/builtin/scientific-visualization/references/publication_guidelines.md +205 -0
- package/lib/skills/builtin/scientific-visualization/scripts/figure_export.py +343 -0
- package/lib/skills/builtin/scientific-visualization/scripts/style_presets.py +416 -0
- package/lib/skills/builtin/scientific-writing/SKILL.md +745 -0
- package/lib/skills/builtin/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/lib/skills/builtin/scientific-writing/assets/scientific_report.sty +606 -0
- package/lib/skills/builtin/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/lib/skills/builtin/scientific-writing/references/citation_styles.md +720 -0
- package/lib/skills/builtin/scientific-writing/references/figures_tables.md +806 -0
- package/lib/skills/builtin/scientific-writing/references/imrad_structure.md +686 -0
- package/lib/skills/builtin/scientific-writing/references/professional_report_formatting.md +664 -0
- package/lib/skills/builtin/scientific-writing/references/reporting_guidelines.md +748 -0
- package/lib/skills/builtin/scientific-writing/references/writing_principles.md +824 -0
- package/lib/skills/builtin/seaborn/SKILL.md +674 -0
- package/lib/skills/builtin/seaborn/references/examples.md +822 -0
- package/lib/skills/builtin/seaborn/references/function_reference.md +770 -0
- package/lib/skills/builtin/seaborn/references/objects_interface.md +964 -0
- package/lib/skills/data-analysis/SKILL.md +285 -0
- package/lib/skills/generate-skill-content.mjs +58 -0
- package/lib/skills/index.ts +34 -0
- package/lib/skills/loader.ts +452 -0
- package/package.json +62 -0
|
@@ -0,0 +1,1042 @@
|
|
|
1
|
+
import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-C1ithNW1.js";
|
|
2
|
+
import { p as parseMixed, s as styleTags, t as tags, E as EditorView, e as syntaxTree, g as EditorSelection, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, f as foldNodeProp, aK as bracketMatchingHandle } from "./MilkdownMarkdownEditor-bLPxrCVb.js";
|
|
3
|
+
import { cssLanguage, css } from "./index-Cq4MH3sY.js";
|
|
4
|
+
import { typescriptLanguage, jsxLanguage, tsxLanguage, javascriptLanguage, javascript } from "./index-fx307_f1.js";
|
|
5
|
+
import "./index-BqDyyRCx.js";
|
|
6
|
+
const scriptText = 55, StartCloseScriptTag = 1, styleText = 56, StartCloseStyleTag = 2, textareaText = 57, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 58, IncompleteTag = 14, IncompleteCloseTag = 15, commentContent$1 = 59, Element = 21, TagName = 23, Attribute = 24, AttributeName = 25, AttributeValue = 27, UnquotedAttributeValue = 28, ScriptText = 29, StyleText = 32, TextareaText = 35, OpenTag = 37, CloseTag = 38, Dialect_noMatch = 0, Dialect_selfClosing = 1;
|
|
7
|
+
const selfClosers$1 = {
|
|
8
|
+
area: true,
|
|
9
|
+
base: true,
|
|
10
|
+
br: true,
|
|
11
|
+
col: true,
|
|
12
|
+
command: true,
|
|
13
|
+
embed: true,
|
|
14
|
+
frame: true,
|
|
15
|
+
hr: true,
|
|
16
|
+
img: true,
|
|
17
|
+
input: true,
|
|
18
|
+
keygen: true,
|
|
19
|
+
link: true,
|
|
20
|
+
meta: true,
|
|
21
|
+
param: true,
|
|
22
|
+
source: true,
|
|
23
|
+
track: true,
|
|
24
|
+
wbr: true,
|
|
25
|
+
menuitem: true
|
|
26
|
+
};
|
|
27
|
+
const implicitlyClosed = {
|
|
28
|
+
dd: true,
|
|
29
|
+
li: true,
|
|
30
|
+
optgroup: true,
|
|
31
|
+
option: true,
|
|
32
|
+
p: true,
|
|
33
|
+
rp: true,
|
|
34
|
+
rt: true,
|
|
35
|
+
tbody: true,
|
|
36
|
+
td: true,
|
|
37
|
+
tfoot: true,
|
|
38
|
+
th: true,
|
|
39
|
+
tr: true
|
|
40
|
+
};
|
|
41
|
+
const closeOnOpen = {
|
|
42
|
+
dd: { dd: true, dt: true },
|
|
43
|
+
dt: { dd: true, dt: true },
|
|
44
|
+
li: { li: true },
|
|
45
|
+
option: { option: true, optgroup: true },
|
|
46
|
+
optgroup: { optgroup: true },
|
|
47
|
+
p: {
|
|
48
|
+
address: true,
|
|
49
|
+
article: true,
|
|
50
|
+
aside: true,
|
|
51
|
+
blockquote: true,
|
|
52
|
+
dir: true,
|
|
53
|
+
div: true,
|
|
54
|
+
dl: true,
|
|
55
|
+
fieldset: true,
|
|
56
|
+
footer: true,
|
|
57
|
+
form: true,
|
|
58
|
+
h1: true,
|
|
59
|
+
h2: true,
|
|
60
|
+
h3: true,
|
|
61
|
+
h4: true,
|
|
62
|
+
h5: true,
|
|
63
|
+
h6: true,
|
|
64
|
+
header: true,
|
|
65
|
+
hgroup: true,
|
|
66
|
+
hr: true,
|
|
67
|
+
menu: true,
|
|
68
|
+
nav: true,
|
|
69
|
+
ol: true,
|
|
70
|
+
p: true,
|
|
71
|
+
pre: true,
|
|
72
|
+
section: true,
|
|
73
|
+
table: true,
|
|
74
|
+
ul: true
|
|
75
|
+
},
|
|
76
|
+
rp: { rp: true, rt: true },
|
|
77
|
+
rt: { rp: true, rt: true },
|
|
78
|
+
tbody: { tbody: true, tfoot: true },
|
|
79
|
+
td: { td: true, th: true },
|
|
80
|
+
tfoot: { tbody: true },
|
|
81
|
+
th: { td: true, th: true },
|
|
82
|
+
thead: { tbody: true, tfoot: true },
|
|
83
|
+
tr: { tr: true }
|
|
84
|
+
};
|
|
85
|
+
function nameChar(ch) {
|
|
86
|
+
return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161;
|
|
87
|
+
}
|
|
88
|
+
let cachedName = null, cachedInput = null, cachedPos = 0;
|
|
89
|
+
function tagNameAfter(input, offset) {
|
|
90
|
+
let pos = input.pos + offset;
|
|
91
|
+
if (cachedPos == pos && cachedInput == input) return cachedName;
|
|
92
|
+
let next = input.peek(offset), name = "";
|
|
93
|
+
for (; ; ) {
|
|
94
|
+
if (!nameChar(next)) break;
|
|
95
|
+
name += String.fromCharCode(next);
|
|
96
|
+
next = input.peek(++offset);
|
|
97
|
+
}
|
|
98
|
+
cachedInput = input;
|
|
99
|
+
cachedPos = pos;
|
|
100
|
+
return cachedName = name ? name.toLowerCase() : next == question || next == bang ? void 0 : null;
|
|
101
|
+
}
|
|
102
|
+
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45;
|
|
103
|
+
function ElementContext(name, parent) {
|
|
104
|
+
this.name = name;
|
|
105
|
+
this.parent = parent;
|
|
106
|
+
}
|
|
107
|
+
const startTagTerms = [StartTag, StartSelfClosingTag, StartScriptTag, StartStyleTag, StartTextareaTag];
|
|
108
|
+
const elementContext = new ContextTracker({
|
|
109
|
+
start: null,
|
|
110
|
+
shift(context, term, stack, input) {
|
|
111
|
+
return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
|
|
112
|
+
},
|
|
113
|
+
reduce(context, term) {
|
|
114
|
+
return term == Element && context ? context.parent : context;
|
|
115
|
+
},
|
|
116
|
+
reuse(context, node, stack, input) {
|
|
117
|
+
let type = node.type.id;
|
|
118
|
+
return type == StartTag || type == OpenTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
|
|
119
|
+
},
|
|
120
|
+
strict: false
|
|
121
|
+
});
|
|
122
|
+
const tagStart = new ExternalTokenizer((input, stack) => {
|
|
123
|
+
if (input.next != lessThan) {
|
|
124
|
+
if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
input.advance();
|
|
128
|
+
let close = input.next == slash;
|
|
129
|
+
if (close) input.advance();
|
|
130
|
+
let name = tagNameAfter(input, 0);
|
|
131
|
+
if (name === void 0) return;
|
|
132
|
+
if (!name) return input.acceptToken(close ? IncompleteCloseTag : IncompleteTag);
|
|
133
|
+
let parent = stack.context ? stack.context.name : null;
|
|
134
|
+
if (close) {
|
|
135
|
+
if (name == parent) return input.acceptToken(StartCloseTag);
|
|
136
|
+
if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2);
|
|
137
|
+
if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag);
|
|
138
|
+
for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return;
|
|
139
|
+
input.acceptToken(MismatchedStartCloseTag);
|
|
140
|
+
} else {
|
|
141
|
+
if (name == "script") return input.acceptToken(StartScriptTag);
|
|
142
|
+
if (name == "style") return input.acceptToken(StartStyleTag);
|
|
143
|
+
if (name == "textarea") return input.acceptToken(StartTextareaTag);
|
|
144
|
+
if (selfClosers$1.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag);
|
|
145
|
+
if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);
|
|
146
|
+
else input.acceptToken(StartTag);
|
|
147
|
+
}
|
|
148
|
+
}, { contextual: true });
|
|
149
|
+
const commentContent = new ExternalTokenizer((input) => {
|
|
150
|
+
for (let dashes = 0, i = 0; ; i++) {
|
|
151
|
+
if (input.next < 0) {
|
|
152
|
+
if (i) input.acceptToken(commentContent$1);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (input.next == dash) {
|
|
156
|
+
dashes++;
|
|
157
|
+
} else if (input.next == greaterThan && dashes >= 2) {
|
|
158
|
+
if (i >= 3) input.acceptToken(commentContent$1, -2);
|
|
159
|
+
break;
|
|
160
|
+
} else {
|
|
161
|
+
dashes = 0;
|
|
162
|
+
}
|
|
163
|
+
input.advance();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
function inForeignElement(context) {
|
|
167
|
+
for (; context; context = context.parent)
|
|
168
|
+
if (context.name == "svg" || context.name == "math") return true;
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const endTag = new ExternalTokenizer((input, stack) => {
|
|
172
|
+
if (input.next == slash && input.peek(1) == greaterThan) {
|
|
173
|
+
let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);
|
|
174
|
+
input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);
|
|
175
|
+
} else if (input.next == greaterThan) {
|
|
176
|
+
input.acceptToken(EndTag, 1);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
function contentTokenizer(tag, textToken, endToken) {
|
|
180
|
+
let lastState = 2 + tag.length;
|
|
181
|
+
return new ExternalTokenizer((input) => {
|
|
182
|
+
for (let state = 0, matchedLen = 0, i = 0; ; i++) {
|
|
183
|
+
if (input.next < 0) {
|
|
184
|
+
if (i) input.acceptToken(textToken);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
if (state == 0 && input.next == lessThan || state == 1 && input.next == slash || state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {
|
|
188
|
+
state++;
|
|
189
|
+
matchedLen++;
|
|
190
|
+
} else if (state == lastState && input.next == greaterThan) {
|
|
191
|
+
if (i > matchedLen)
|
|
192
|
+
input.acceptToken(textToken, -matchedLen);
|
|
193
|
+
else
|
|
194
|
+
input.acceptToken(endToken, -(matchedLen - 2));
|
|
195
|
+
break;
|
|
196
|
+
} else if ((input.next == 10 || input.next == 13) && i) {
|
|
197
|
+
input.acceptToken(textToken, 1);
|
|
198
|
+
break;
|
|
199
|
+
} else {
|
|
200
|
+
state = matchedLen = 0;
|
|
201
|
+
}
|
|
202
|
+
input.advance();
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const scriptTokens = contentTokenizer("script", scriptText, StartCloseScriptTag);
|
|
207
|
+
const styleTokens = contentTokenizer("style", styleText, StartCloseStyleTag);
|
|
208
|
+
const textareaTokens = contentTokenizer("textarea", textareaText, StartCloseTextareaTag);
|
|
209
|
+
const htmlHighlighting = styleTags({
|
|
210
|
+
"Text RawText IncompleteTag IncompleteCloseTag": tags.content,
|
|
211
|
+
"StartTag StartCloseTag SelfClosingEndTag EndTag": tags.angleBracket,
|
|
212
|
+
TagName: tags.tagName,
|
|
213
|
+
"MismatchedCloseTag/TagName": [tags.tagName, tags.invalid],
|
|
214
|
+
AttributeName: tags.attributeName,
|
|
215
|
+
"AttributeValue UnquotedAttributeValue": tags.attributeValue,
|
|
216
|
+
Is: tags.definitionOperator,
|
|
217
|
+
"EntityReference CharacterReference": tags.character,
|
|
218
|
+
Comment: tags.blockComment,
|
|
219
|
+
ProcessingInst: tags.processingInstruction,
|
|
220
|
+
DoctypeDecl: tags.documentMeta
|
|
221
|
+
});
|
|
222
|
+
const parser = LRParser.deserialize({
|
|
223
|
+
version: 14,
|
|
224
|
+
states: ",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/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!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",
|
|
227
|
+
nodeNames: "⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",
|
|
228
|
+
maxTerm: 68,
|
|
229
|
+
context: elementContext,
|
|
230
|
+
nodeProps: [
|
|
231
|
+
["closedBy", -10, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, "EndTag", 6, "EndTag SelfClosingEndTag", -4, 22, 31, 34, 37, "CloseTag"],
|
|
232
|
+
["openedBy", 4, "StartTag StartCloseTag", 5, "StartTag", -4, 30, 33, 36, 38, "OpenTag"],
|
|
233
|
+
["group", -10, 14, 15, 18, 19, 20, 21, 40, 41, 42, 43, "Entity", 17, "Entity TextContent", -3, 29, 32, 35, "TextContent Entity"],
|
|
234
|
+
["isolate", -11, 22, 30, 31, 33, 34, 36, 37, 38, 39, 42, 43, "ltr", -3, 27, 28, 40, ""]
|
|
235
|
+
],
|
|
236
|
+
propSources: [htmlHighlighting],
|
|
237
|
+
skippedNodes: [0],
|
|
238
|
+
repeatNodeCount: 9,
|
|
239
|
+
tokenData: "!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_v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!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",
|
|
240
|
+
tokenizers: [scriptTokens, styleTokens, textareaTokens, endTag, tagStart, commentContent, 0, 1, 2, 3, 4, 5],
|
|
241
|
+
topRules: { "Document": [0, 16] },
|
|
242
|
+
dialects: { noMatch: 0, selfClosing: 515 },
|
|
243
|
+
tokenPrec: 517
|
|
244
|
+
});
|
|
245
|
+
function getAttrs(openTag, input) {
|
|
246
|
+
let attrs = /* @__PURE__ */ Object.create(null);
|
|
247
|
+
for (let att of openTag.getChildren(Attribute)) {
|
|
248
|
+
let name = att.getChild(AttributeName), value = att.getChild(AttributeValue) || att.getChild(UnquotedAttributeValue);
|
|
249
|
+
if (name) attrs[input.read(name.from, name.to)] = !value ? "" : value.type.id == AttributeValue ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to);
|
|
250
|
+
}
|
|
251
|
+
return attrs;
|
|
252
|
+
}
|
|
253
|
+
function findTagName(openTag, input) {
|
|
254
|
+
let tagNameNode = openTag.getChild(TagName);
|
|
255
|
+
return tagNameNode ? input.read(tagNameNode.from, tagNameNode.to) : " ";
|
|
256
|
+
}
|
|
257
|
+
function maybeNest(node, input, tags2) {
|
|
258
|
+
let attrs;
|
|
259
|
+
for (let tag of tags2) {
|
|
260
|
+
if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent.firstChild, input))))
|
|
261
|
+
return { parser: tag.parser, bracketed: true };
|
|
262
|
+
}
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
function configureNesting(tags2 = [], attributes = []) {
|
|
266
|
+
let script = [], style = [], textarea = [], other = [];
|
|
267
|
+
for (let tag of tags2) {
|
|
268
|
+
let array = tag.tag == "script" ? script : tag.tag == "style" ? style : tag.tag == "textarea" ? textarea : other;
|
|
269
|
+
array.push(tag);
|
|
270
|
+
}
|
|
271
|
+
let attrs = attributes.length ? /* @__PURE__ */ Object.create(null) : null;
|
|
272
|
+
for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);
|
|
273
|
+
return parseMixed((node, input) => {
|
|
274
|
+
let id = node.type.id;
|
|
275
|
+
if (id == ScriptText) return maybeNest(node, input, script);
|
|
276
|
+
if (id == StyleText) return maybeNest(node, input, style);
|
|
277
|
+
if (id == TextareaText) return maybeNest(node, input, textarea);
|
|
278
|
+
if (id == Element && other.length) {
|
|
279
|
+
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs2;
|
|
280
|
+
if (tagName) for (let tag of other) {
|
|
281
|
+
if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs2 || (attrs2 = getAttrs(open, input))))) {
|
|
282
|
+
let close = n.lastChild;
|
|
283
|
+
let to = close.type.id == CloseTag ? close.from : n.to;
|
|
284
|
+
if (to > open.to)
|
|
285
|
+
return { parser: tag.parser, overlay: [{ from: open.to, to }] };
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (attrs && id == Attribute) {
|
|
290
|
+
let n = node.node, nameNode;
|
|
291
|
+
if (nameNode = n.firstChild) {
|
|
292
|
+
let matches = attrs[input.read(nameNode.from, nameNode.to)];
|
|
293
|
+
if (matches) for (let attr of matches) {
|
|
294
|
+
if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue;
|
|
295
|
+
let value = n.lastChild;
|
|
296
|
+
if (value.type.id == AttributeValue) {
|
|
297
|
+
let from = value.from + 1;
|
|
298
|
+
let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);
|
|
299
|
+
if (to > from) return { parser: attr.parser, overlay: [{ from, to }], bracketed: true };
|
|
300
|
+
} else if (value.type.id == UnquotedAttributeValue) {
|
|
301
|
+
return { parser: attr.parser, overlay: [{ from: value.from, to: value.to }] };
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return null;
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const Targets = ["_blank", "_self", "_top", "_parent"];
|
|
310
|
+
const Charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
|
|
311
|
+
const Methods = ["get", "post", "put", "delete"];
|
|
312
|
+
const Encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
|
313
|
+
const Bool = ["true", "false"];
|
|
314
|
+
const S = {};
|
|
315
|
+
const Tags = {
|
|
316
|
+
a: {
|
|
317
|
+
attrs: {
|
|
318
|
+
href: null,
|
|
319
|
+
ping: null,
|
|
320
|
+
type: null,
|
|
321
|
+
media: null,
|
|
322
|
+
target: Targets,
|
|
323
|
+
hreflang: null
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
abbr: S,
|
|
327
|
+
address: S,
|
|
328
|
+
area: {
|
|
329
|
+
attrs: {
|
|
330
|
+
alt: null,
|
|
331
|
+
coords: null,
|
|
332
|
+
href: null,
|
|
333
|
+
target: null,
|
|
334
|
+
ping: null,
|
|
335
|
+
media: null,
|
|
336
|
+
hreflang: null,
|
|
337
|
+
type: null,
|
|
338
|
+
shape: ["default", "rect", "circle", "poly"]
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
article: S,
|
|
342
|
+
aside: S,
|
|
343
|
+
audio: {
|
|
344
|
+
attrs: {
|
|
345
|
+
src: null,
|
|
346
|
+
mediagroup: null,
|
|
347
|
+
crossorigin: ["anonymous", "use-credentials"],
|
|
348
|
+
preload: ["none", "metadata", "auto"],
|
|
349
|
+
autoplay: ["autoplay"],
|
|
350
|
+
loop: ["loop"],
|
|
351
|
+
controls: ["controls"]
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
b: S,
|
|
355
|
+
base: { attrs: { href: null, target: Targets } },
|
|
356
|
+
bdi: S,
|
|
357
|
+
bdo: S,
|
|
358
|
+
blockquote: { attrs: { cite: null } },
|
|
359
|
+
body: S,
|
|
360
|
+
br: S,
|
|
361
|
+
button: {
|
|
362
|
+
attrs: {
|
|
363
|
+
form: null,
|
|
364
|
+
formaction: null,
|
|
365
|
+
name: null,
|
|
366
|
+
value: null,
|
|
367
|
+
autofocus: ["autofocus"],
|
|
368
|
+
disabled: ["autofocus"],
|
|
369
|
+
formenctype: Encs,
|
|
370
|
+
formmethod: Methods,
|
|
371
|
+
formnovalidate: ["novalidate"],
|
|
372
|
+
formtarget: Targets,
|
|
373
|
+
type: ["submit", "reset", "button"]
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
canvas: { attrs: { width: null, height: null } },
|
|
377
|
+
caption: S,
|
|
378
|
+
center: S,
|
|
379
|
+
cite: S,
|
|
380
|
+
code: S,
|
|
381
|
+
col: { attrs: { span: null } },
|
|
382
|
+
colgroup: { attrs: { span: null } },
|
|
383
|
+
command: {
|
|
384
|
+
attrs: {
|
|
385
|
+
type: ["command", "checkbox", "radio"],
|
|
386
|
+
label: null,
|
|
387
|
+
icon: null,
|
|
388
|
+
radiogroup: null,
|
|
389
|
+
command: null,
|
|
390
|
+
title: null,
|
|
391
|
+
disabled: ["disabled"],
|
|
392
|
+
checked: ["checked"]
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
data: { attrs: { value: null } },
|
|
396
|
+
datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
|
|
397
|
+
datalist: { attrs: { data: null } },
|
|
398
|
+
dd: S,
|
|
399
|
+
del: { attrs: { cite: null, datetime: null } },
|
|
400
|
+
details: { attrs: { open: ["open"] } },
|
|
401
|
+
dfn: S,
|
|
402
|
+
div: S,
|
|
403
|
+
dl: S,
|
|
404
|
+
dt: S,
|
|
405
|
+
em: S,
|
|
406
|
+
embed: { attrs: { src: null, type: null, width: null, height: null } },
|
|
407
|
+
eventsource: { attrs: { src: null } },
|
|
408
|
+
fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
|
|
409
|
+
figcaption: S,
|
|
410
|
+
figure: S,
|
|
411
|
+
footer: S,
|
|
412
|
+
form: {
|
|
413
|
+
attrs: {
|
|
414
|
+
action: null,
|
|
415
|
+
name: null,
|
|
416
|
+
"accept-charset": Charsets,
|
|
417
|
+
autocomplete: ["on", "off"],
|
|
418
|
+
enctype: Encs,
|
|
419
|
+
method: Methods,
|
|
420
|
+
novalidate: ["novalidate"],
|
|
421
|
+
target: Targets
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
h1: S,
|
|
425
|
+
h2: S,
|
|
426
|
+
h3: S,
|
|
427
|
+
h4: S,
|
|
428
|
+
h5: S,
|
|
429
|
+
h6: S,
|
|
430
|
+
head: {
|
|
431
|
+
children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
|
|
432
|
+
},
|
|
433
|
+
header: S,
|
|
434
|
+
hgroup: S,
|
|
435
|
+
hr: S,
|
|
436
|
+
html: {
|
|
437
|
+
attrs: { manifest: null }
|
|
438
|
+
},
|
|
439
|
+
i: S,
|
|
440
|
+
iframe: {
|
|
441
|
+
attrs: {
|
|
442
|
+
src: null,
|
|
443
|
+
srcdoc: null,
|
|
444
|
+
name: null,
|
|
445
|
+
width: null,
|
|
446
|
+
height: null,
|
|
447
|
+
sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
|
|
448
|
+
seamless: ["seamless"]
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
img: {
|
|
452
|
+
attrs: {
|
|
453
|
+
alt: null,
|
|
454
|
+
src: null,
|
|
455
|
+
ismap: null,
|
|
456
|
+
usemap: null,
|
|
457
|
+
width: null,
|
|
458
|
+
height: null,
|
|
459
|
+
crossorigin: ["anonymous", "use-credentials"]
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
input: {
|
|
463
|
+
attrs: {
|
|
464
|
+
alt: null,
|
|
465
|
+
dirname: null,
|
|
466
|
+
form: null,
|
|
467
|
+
formaction: null,
|
|
468
|
+
height: null,
|
|
469
|
+
list: null,
|
|
470
|
+
max: null,
|
|
471
|
+
maxlength: null,
|
|
472
|
+
min: null,
|
|
473
|
+
name: null,
|
|
474
|
+
pattern: null,
|
|
475
|
+
placeholder: null,
|
|
476
|
+
size: null,
|
|
477
|
+
src: null,
|
|
478
|
+
step: null,
|
|
479
|
+
value: null,
|
|
480
|
+
width: null,
|
|
481
|
+
accept: ["audio/*", "video/*", "image/*"],
|
|
482
|
+
autocomplete: ["on", "off"],
|
|
483
|
+
autofocus: ["autofocus"],
|
|
484
|
+
checked: ["checked"],
|
|
485
|
+
disabled: ["disabled"],
|
|
486
|
+
formenctype: Encs,
|
|
487
|
+
formmethod: Methods,
|
|
488
|
+
formnovalidate: ["novalidate"],
|
|
489
|
+
formtarget: Targets,
|
|
490
|
+
multiple: ["multiple"],
|
|
491
|
+
readonly: ["readonly"],
|
|
492
|
+
required: ["required"],
|
|
493
|
+
type: [
|
|
494
|
+
"hidden",
|
|
495
|
+
"text",
|
|
496
|
+
"search",
|
|
497
|
+
"tel",
|
|
498
|
+
"url",
|
|
499
|
+
"email",
|
|
500
|
+
"password",
|
|
501
|
+
"datetime",
|
|
502
|
+
"date",
|
|
503
|
+
"month",
|
|
504
|
+
"week",
|
|
505
|
+
"time",
|
|
506
|
+
"datetime-local",
|
|
507
|
+
"number",
|
|
508
|
+
"range",
|
|
509
|
+
"color",
|
|
510
|
+
"checkbox",
|
|
511
|
+
"radio",
|
|
512
|
+
"file",
|
|
513
|
+
"submit",
|
|
514
|
+
"image",
|
|
515
|
+
"reset",
|
|
516
|
+
"button"
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
ins: { attrs: { cite: null, datetime: null } },
|
|
521
|
+
kbd: S,
|
|
522
|
+
keygen: {
|
|
523
|
+
attrs: {
|
|
524
|
+
challenge: null,
|
|
525
|
+
form: null,
|
|
526
|
+
name: null,
|
|
527
|
+
autofocus: ["autofocus"],
|
|
528
|
+
disabled: ["disabled"],
|
|
529
|
+
keytype: ["RSA"]
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
label: { attrs: { for: null, form: null } },
|
|
533
|
+
legend: S,
|
|
534
|
+
li: { attrs: { value: null } },
|
|
535
|
+
link: {
|
|
536
|
+
attrs: {
|
|
537
|
+
href: null,
|
|
538
|
+
type: null,
|
|
539
|
+
hreflang: null,
|
|
540
|
+
media: null,
|
|
541
|
+
sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
map: { attrs: { name: null } },
|
|
545
|
+
mark: S,
|
|
546
|
+
menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
|
|
547
|
+
meta: {
|
|
548
|
+
attrs: {
|
|
549
|
+
content: null,
|
|
550
|
+
charset: Charsets,
|
|
551
|
+
name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
|
|
552
|
+
"http-equiv": ["content-language", "content-type", "default-style", "refresh"]
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
|
|
556
|
+
nav: S,
|
|
557
|
+
noscript: S,
|
|
558
|
+
object: {
|
|
559
|
+
attrs: {
|
|
560
|
+
data: null,
|
|
561
|
+
type: null,
|
|
562
|
+
name: null,
|
|
563
|
+
usemap: null,
|
|
564
|
+
form: null,
|
|
565
|
+
width: null,
|
|
566
|
+
height: null,
|
|
567
|
+
typemustmatch: ["typemustmatch"]
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
ol: {
|
|
571
|
+
attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
|
|
572
|
+
children: ["li", "script", "template", "ul", "ol"]
|
|
573
|
+
},
|
|
574
|
+
optgroup: { attrs: { disabled: ["disabled"], label: null } },
|
|
575
|
+
option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
|
|
576
|
+
output: { attrs: { for: null, form: null, name: null } },
|
|
577
|
+
p: S,
|
|
578
|
+
param: { attrs: { name: null, value: null } },
|
|
579
|
+
pre: S,
|
|
580
|
+
progress: { attrs: { value: null, max: null } },
|
|
581
|
+
q: { attrs: { cite: null } },
|
|
582
|
+
rp: S,
|
|
583
|
+
rt: S,
|
|
584
|
+
ruby: S,
|
|
585
|
+
samp: S,
|
|
586
|
+
script: {
|
|
587
|
+
attrs: {
|
|
588
|
+
type: ["text/javascript"],
|
|
589
|
+
src: null,
|
|
590
|
+
async: ["async"],
|
|
591
|
+
defer: ["defer"],
|
|
592
|
+
charset: Charsets
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
section: S,
|
|
596
|
+
select: {
|
|
597
|
+
attrs: {
|
|
598
|
+
form: null,
|
|
599
|
+
name: null,
|
|
600
|
+
size: null,
|
|
601
|
+
autofocus: ["autofocus"],
|
|
602
|
+
disabled: ["disabled"],
|
|
603
|
+
multiple: ["multiple"]
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
slot: { attrs: { name: null } },
|
|
607
|
+
small: S,
|
|
608
|
+
source: { attrs: { src: null, type: null, media: null } },
|
|
609
|
+
span: S,
|
|
610
|
+
strong: S,
|
|
611
|
+
style: {
|
|
612
|
+
attrs: {
|
|
613
|
+
type: ["text/css"],
|
|
614
|
+
media: null,
|
|
615
|
+
scoped: null
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
sub: S,
|
|
619
|
+
summary: S,
|
|
620
|
+
sup: S,
|
|
621
|
+
table: S,
|
|
622
|
+
tbody: S,
|
|
623
|
+
td: { attrs: { colspan: null, rowspan: null, headers: null } },
|
|
624
|
+
template: S,
|
|
625
|
+
textarea: {
|
|
626
|
+
attrs: {
|
|
627
|
+
dirname: null,
|
|
628
|
+
form: null,
|
|
629
|
+
maxlength: null,
|
|
630
|
+
name: null,
|
|
631
|
+
placeholder: null,
|
|
632
|
+
rows: null,
|
|
633
|
+
cols: null,
|
|
634
|
+
autofocus: ["autofocus"],
|
|
635
|
+
disabled: ["disabled"],
|
|
636
|
+
readonly: ["readonly"],
|
|
637
|
+
required: ["required"],
|
|
638
|
+
wrap: ["soft", "hard"]
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
tfoot: S,
|
|
642
|
+
th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
|
|
643
|
+
thead: S,
|
|
644
|
+
time: { attrs: { datetime: null } },
|
|
645
|
+
title: S,
|
|
646
|
+
tr: S,
|
|
647
|
+
track: {
|
|
648
|
+
attrs: {
|
|
649
|
+
src: null,
|
|
650
|
+
label: null,
|
|
651
|
+
default: null,
|
|
652
|
+
kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
|
|
653
|
+
srclang: null
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
ul: { children: ["li", "script", "template", "ul", "ol"] },
|
|
657
|
+
var: S,
|
|
658
|
+
video: {
|
|
659
|
+
attrs: {
|
|
660
|
+
src: null,
|
|
661
|
+
poster: null,
|
|
662
|
+
width: null,
|
|
663
|
+
height: null,
|
|
664
|
+
crossorigin: ["anonymous", "use-credentials"],
|
|
665
|
+
preload: ["auto", "metadata", "none"],
|
|
666
|
+
autoplay: ["autoplay"],
|
|
667
|
+
mediagroup: ["movie"],
|
|
668
|
+
muted: ["muted"],
|
|
669
|
+
controls: ["controls"]
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
wbr: S
|
|
673
|
+
};
|
|
674
|
+
const GlobalAttrs = {
|
|
675
|
+
accesskey: null,
|
|
676
|
+
class: null,
|
|
677
|
+
contenteditable: Bool,
|
|
678
|
+
contextmenu: null,
|
|
679
|
+
dir: ["ltr", "rtl", "auto"],
|
|
680
|
+
draggable: ["true", "false", "auto"],
|
|
681
|
+
dropzone: ["copy", "move", "link", "string:", "file:"],
|
|
682
|
+
hidden: ["hidden"],
|
|
683
|
+
id: null,
|
|
684
|
+
inert: ["inert"],
|
|
685
|
+
itemid: null,
|
|
686
|
+
itemprop: null,
|
|
687
|
+
itemref: null,
|
|
688
|
+
itemscope: ["itemscope"],
|
|
689
|
+
itemtype: null,
|
|
690
|
+
lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
|
|
691
|
+
spellcheck: Bool,
|
|
692
|
+
autocorrect: Bool,
|
|
693
|
+
autocapitalize: Bool,
|
|
694
|
+
style: null,
|
|
695
|
+
tabindex: null,
|
|
696
|
+
title: null,
|
|
697
|
+
translate: ["yes", "no"],
|
|
698
|
+
rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
|
|
699
|
+
role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
|
|
700
|
+
"aria-activedescendant": null,
|
|
701
|
+
"aria-atomic": Bool,
|
|
702
|
+
"aria-autocomplete": ["inline", "list", "both", "none"],
|
|
703
|
+
"aria-busy": Bool,
|
|
704
|
+
"aria-checked": ["true", "false", "mixed", "undefined"],
|
|
705
|
+
"aria-controls": null,
|
|
706
|
+
"aria-describedby": null,
|
|
707
|
+
"aria-disabled": Bool,
|
|
708
|
+
"aria-dropeffect": null,
|
|
709
|
+
"aria-expanded": ["true", "false", "undefined"],
|
|
710
|
+
"aria-flowto": null,
|
|
711
|
+
"aria-grabbed": ["true", "false", "undefined"],
|
|
712
|
+
"aria-haspopup": Bool,
|
|
713
|
+
"aria-hidden": Bool,
|
|
714
|
+
"aria-invalid": ["true", "false", "grammar", "spelling"],
|
|
715
|
+
"aria-label": null,
|
|
716
|
+
"aria-labelledby": null,
|
|
717
|
+
"aria-level": null,
|
|
718
|
+
"aria-live": ["off", "polite", "assertive"],
|
|
719
|
+
"aria-multiline": Bool,
|
|
720
|
+
"aria-multiselectable": Bool,
|
|
721
|
+
"aria-owns": null,
|
|
722
|
+
"aria-posinset": null,
|
|
723
|
+
"aria-pressed": ["true", "false", "mixed", "undefined"],
|
|
724
|
+
"aria-readonly": Bool,
|
|
725
|
+
"aria-relevant": null,
|
|
726
|
+
"aria-required": Bool,
|
|
727
|
+
"aria-selected": ["true", "false", "undefined"],
|
|
728
|
+
"aria-setsize": null,
|
|
729
|
+
"aria-sort": ["ascending", "descending", "none", "other"],
|
|
730
|
+
"aria-valuemax": null,
|
|
731
|
+
"aria-valuemin": null,
|
|
732
|
+
"aria-valuenow": null,
|
|
733
|
+
"aria-valuetext": null
|
|
734
|
+
};
|
|
735
|
+
const eventAttributes = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((n) => "on" + n);
|
|
736
|
+
for (let a of eventAttributes)
|
|
737
|
+
GlobalAttrs[a] = null;
|
|
738
|
+
class Schema {
|
|
739
|
+
constructor(extraTags, extraAttrs) {
|
|
740
|
+
this.tags = { ...Tags, ...extraTags };
|
|
741
|
+
this.globalAttrs = { ...GlobalAttrs, ...extraAttrs };
|
|
742
|
+
this.allTags = Object.keys(this.tags);
|
|
743
|
+
this.globalAttrNames = Object.keys(this.globalAttrs);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
Schema.default = /* @__PURE__ */ new Schema();
|
|
747
|
+
function elementName(doc, tree, max = doc.length) {
|
|
748
|
+
if (!tree)
|
|
749
|
+
return "";
|
|
750
|
+
let tag = tree.firstChild;
|
|
751
|
+
let name = tag && tag.getChild("TagName");
|
|
752
|
+
return name ? doc.sliceString(name.from, Math.min(name.to, max)) : "";
|
|
753
|
+
}
|
|
754
|
+
function findParentElement(tree, skip = false) {
|
|
755
|
+
for (; tree; tree = tree.parent)
|
|
756
|
+
if (tree.name == "Element") {
|
|
757
|
+
if (skip)
|
|
758
|
+
skip = false;
|
|
759
|
+
else
|
|
760
|
+
return tree;
|
|
761
|
+
}
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
function allowedChildren(doc, tree, schema) {
|
|
765
|
+
let parentInfo = schema.tags[elementName(doc, findParentElement(tree))];
|
|
766
|
+
return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;
|
|
767
|
+
}
|
|
768
|
+
function openTags(doc, tree) {
|
|
769
|
+
let open = [];
|
|
770
|
+
for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {
|
|
771
|
+
let tagName = elementName(doc, parent);
|
|
772
|
+
if (tagName && parent.lastChild.name == "CloseTag")
|
|
773
|
+
break;
|
|
774
|
+
if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to))
|
|
775
|
+
open.push(tagName);
|
|
776
|
+
}
|
|
777
|
+
return open;
|
|
778
|
+
}
|
|
779
|
+
const identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
|
|
780
|
+
function completeTag(state, schema, tree, from, to) {
|
|
781
|
+
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
|
782
|
+
let parent = findParentElement(tree, tree.name == "StartTag" || tree.name == "TagName");
|
|
783
|
+
return {
|
|
784
|
+
from,
|
|
785
|
+
to,
|
|
786
|
+
options: allowedChildren(state.doc, parent, schema).map((tagName) => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({
|
|
787
|
+
label: "/" + tag,
|
|
788
|
+
apply: "/" + tag + end,
|
|
789
|
+
type: "type",
|
|
790
|
+
boost: 99 - i
|
|
791
|
+
}))),
|
|
792
|
+
validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
function completeCloseTag(state, tree, from, to) {
|
|
796
|
+
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
|
797
|
+
return {
|
|
798
|
+
from,
|
|
799
|
+
to,
|
|
800
|
+
options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })),
|
|
801
|
+
validFor: identifier
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
function completeStartTag(state, schema, tree, pos) {
|
|
805
|
+
let options = [], level = 0;
|
|
806
|
+
for (let tagName of allowedChildren(state.doc, tree, schema))
|
|
807
|
+
options.push({ label: "<" + tagName, type: "type" });
|
|
808
|
+
for (let open of openTags(state.doc, tree))
|
|
809
|
+
options.push({ label: "</" + open + ">", type: "type", boost: 99 - level++ });
|
|
810
|
+
return { from: pos, to: pos, options, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
|
|
811
|
+
}
|
|
812
|
+
function completeAttrName(state, schema, tree, from, to) {
|
|
813
|
+
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
|
814
|
+
let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];
|
|
815
|
+
let names = info && info.globalAttrs === false ? localAttrs : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;
|
|
816
|
+
return {
|
|
817
|
+
from,
|
|
818
|
+
to,
|
|
819
|
+
options: names.map((attrName) => ({ label: attrName, type: "property" })),
|
|
820
|
+
validFor: identifier
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function completeAttrValue(state, schema, tree, from, to) {
|
|
824
|
+
var _a;
|
|
825
|
+
let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild("AttributeName");
|
|
826
|
+
let options = [], token = void 0;
|
|
827
|
+
if (nameNode) {
|
|
828
|
+
let attrName = state.sliceDoc(nameNode.from, nameNode.to);
|
|
829
|
+
let attrs = schema.globalAttrs[attrName];
|
|
830
|
+
if (!attrs) {
|
|
831
|
+
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
|
832
|
+
attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];
|
|
833
|
+
}
|
|
834
|
+
if (attrs) {
|
|
835
|
+
let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '"', quoteEnd = '"';
|
|
836
|
+
if (/^['"]/.test(base)) {
|
|
837
|
+
token = base[0] == '"' ? /^[^"]*$/ : /^[^']*$/;
|
|
838
|
+
quoteStart = "";
|
|
839
|
+
quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? "" : base[0];
|
|
840
|
+
base = base.slice(1);
|
|
841
|
+
from++;
|
|
842
|
+
} else {
|
|
843
|
+
token = /^[^\s<>='"]*$/;
|
|
844
|
+
}
|
|
845
|
+
for (let value of attrs)
|
|
846
|
+
options.push({ label: value, apply: quoteStart + value + quoteEnd, type: "constant" });
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return { from, to, options, validFor: token };
|
|
850
|
+
}
|
|
851
|
+
function htmlCompletionFor(schema, context) {
|
|
852
|
+
let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);
|
|
853
|
+
for (let scan = pos, before; around == tree && (before = tree.childBefore(scan)); ) {
|
|
854
|
+
let last = before.lastChild;
|
|
855
|
+
if (!last || !last.type.isError || last.from < last.to)
|
|
856
|
+
break;
|
|
857
|
+
around = tree = before;
|
|
858
|
+
scan = last.from;
|
|
859
|
+
}
|
|
860
|
+
if (tree.name == "TagName") {
|
|
861
|
+
return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos) : completeTag(state, schema, tree, tree.from, pos);
|
|
862
|
+
} else if (tree.name == "StartTag" || tree.name == "IncompleteTag") {
|
|
863
|
+
return completeTag(state, schema, tree, pos, pos);
|
|
864
|
+
} else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") {
|
|
865
|
+
return completeCloseTag(state, tree, pos, pos);
|
|
866
|
+
} else if (tree.name == "OpenTag" || tree.name == "SelfClosingTag" || tree.name == "AttributeName") {
|
|
867
|
+
return completeAttrName(state, schema, tree, tree.name == "AttributeName" ? tree.from : pos, pos);
|
|
868
|
+
} else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") {
|
|
869
|
+
return completeAttrValue(state, schema, tree, tree.name == "Is" ? pos : tree.from, pos);
|
|
870
|
+
} else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) {
|
|
871
|
+
return completeStartTag(state, schema, tree, pos);
|
|
872
|
+
} else {
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function htmlCompletionSource(context) {
|
|
877
|
+
return htmlCompletionFor(Schema.default, context);
|
|
878
|
+
}
|
|
879
|
+
function htmlCompletionSourceWith(config) {
|
|
880
|
+
let { extraTags, extraGlobalAttributes: extraAttrs } = config;
|
|
881
|
+
let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;
|
|
882
|
+
return (context) => htmlCompletionFor(schema, context);
|
|
883
|
+
}
|
|
884
|
+
const jsonParser = /* @__PURE__ */ javascriptLanguage.parser.configure({ top: "SingleExpression" });
|
|
885
|
+
const defaultNesting = [
|
|
886
|
+
{
|
|
887
|
+
tag: "script",
|
|
888
|
+
attrs: (attrs) => attrs.type == "text/typescript" || attrs.lang == "ts",
|
|
889
|
+
parser: typescriptLanguage.parser
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
tag: "script",
|
|
893
|
+
attrs: (attrs) => attrs.type == "text/babel" || attrs.type == "text/jsx",
|
|
894
|
+
parser: jsxLanguage.parser
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
tag: "script",
|
|
898
|
+
attrs: (attrs) => attrs.type == "text/typescript-jsx",
|
|
899
|
+
parser: tsxLanguage.parser
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
tag: "script",
|
|
903
|
+
attrs(attrs) {
|
|
904
|
+
return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(attrs.type);
|
|
905
|
+
},
|
|
906
|
+
parser: jsonParser
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
tag: "script",
|
|
910
|
+
attrs(attrs) {
|
|
911
|
+
return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);
|
|
912
|
+
},
|
|
913
|
+
parser: javascriptLanguage.parser
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
tag: "style",
|
|
917
|
+
attrs(attrs) {
|
|
918
|
+
return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));
|
|
919
|
+
},
|
|
920
|
+
parser: cssLanguage.parser
|
|
921
|
+
}
|
|
922
|
+
];
|
|
923
|
+
const defaultAttrs = /* @__PURE__ */ [
|
|
924
|
+
{
|
|
925
|
+
name: "style",
|
|
926
|
+
parser: /* @__PURE__ */ cssLanguage.parser.configure({ top: "Styles" })
|
|
927
|
+
}
|
|
928
|
+
].concat(/* @__PURE__ */ eventAttributes.map((name) => ({ name, parser: javascriptLanguage.parser })));
|
|
929
|
+
const htmlPlain = /* @__PURE__ */ LRLanguage.define({
|
|
930
|
+
name: "html",
|
|
931
|
+
parser: /* @__PURE__ */ parser.configure({
|
|
932
|
+
props: [
|
|
933
|
+
/* @__PURE__ */ indentNodeProp.add({
|
|
934
|
+
Element(context) {
|
|
935
|
+
let after = /^(\s*)(<\/)?/.exec(context.textAfter);
|
|
936
|
+
if (context.node.to <= context.pos + after[0].length)
|
|
937
|
+
return context.continue();
|
|
938
|
+
return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);
|
|
939
|
+
},
|
|
940
|
+
"OpenTag CloseTag SelfClosingTag"(context) {
|
|
941
|
+
return context.column(context.node.from) + context.unit;
|
|
942
|
+
},
|
|
943
|
+
Document(context) {
|
|
944
|
+
if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to)
|
|
945
|
+
return context.continue();
|
|
946
|
+
let endElt = null, close;
|
|
947
|
+
for (let cur = context.node; ; ) {
|
|
948
|
+
let last = cur.lastChild;
|
|
949
|
+
if (!last || last.name != "Element" || last.to != cur.to)
|
|
950
|
+
break;
|
|
951
|
+
endElt = cur = last;
|
|
952
|
+
}
|
|
953
|
+
if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag")))
|
|
954
|
+
return context.lineIndent(endElt.from) + context.unit;
|
|
955
|
+
return null;
|
|
956
|
+
}
|
|
957
|
+
}),
|
|
958
|
+
/* @__PURE__ */ foldNodeProp.add({
|
|
959
|
+
Element(node) {
|
|
960
|
+
let first = node.firstChild, last = node.lastChild;
|
|
961
|
+
if (!first || first.name != "OpenTag")
|
|
962
|
+
return null;
|
|
963
|
+
return { from: first.to, to: last.name == "CloseTag" ? last.from : node.to };
|
|
964
|
+
}
|
|
965
|
+
}),
|
|
966
|
+
/* @__PURE__ */ bracketMatchingHandle.add({
|
|
967
|
+
"OpenTag CloseTag": (node) => node.getChild("TagName")
|
|
968
|
+
})
|
|
969
|
+
]
|
|
970
|
+
}),
|
|
971
|
+
languageData: {
|
|
972
|
+
commentTokens: { block: { open: "<!--", close: "-->" } },
|
|
973
|
+
indentOnInput: /^\s*<\/\w+\W$/,
|
|
974
|
+
wordChars: "-_"
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
const htmlLanguage = /* @__PURE__ */ htmlPlain.configure({
|
|
978
|
+
wrap: /* @__PURE__ */ configureNesting(defaultNesting, defaultAttrs)
|
|
979
|
+
});
|
|
980
|
+
function html(config = {}) {
|
|
981
|
+
let dialect = "", wrap;
|
|
982
|
+
if (config.matchClosingTags === false)
|
|
983
|
+
dialect = "noMatch";
|
|
984
|
+
if (config.selfClosingTags === true)
|
|
985
|
+
dialect = (dialect ? dialect + " " : "") + "selfClosing";
|
|
986
|
+
if (config.nestedLanguages && config.nestedLanguages.length || config.nestedAttributes && config.nestedAttributes.length)
|
|
987
|
+
wrap = configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));
|
|
988
|
+
let lang = wrap ? htmlPlain.configure({ wrap, dialect }) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage;
|
|
989
|
+
return new LanguageSupport(lang, [
|
|
990
|
+
htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),
|
|
991
|
+
config.autoCloseTags !== false ? autoCloseTags : [],
|
|
992
|
+
javascript().support,
|
|
993
|
+
css().support
|
|
994
|
+
]);
|
|
995
|
+
}
|
|
996
|
+
const selfClosers = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
|
|
997
|
+
const autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {
|
|
998
|
+
if (view.composing || view.state.readOnly || from != to || text != ">" && text != "/" || !htmlLanguage.isActiveAt(view.state, from, -1))
|
|
999
|
+
return false;
|
|
1000
|
+
let base = insertTransaction(), { state } = base;
|
|
1001
|
+
let closeTags = state.changeByRange((range) => {
|
|
1002
|
+
var _a, _b, _c;
|
|
1003
|
+
let didType = state.doc.sliceString(range.from - 1, range.to) == text;
|
|
1004
|
+
let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name;
|
|
1005
|
+
if (didType && text == ">" && after.name == "EndTag") {
|
|
1006
|
+
let tag = after.parent;
|
|
1007
|
+
if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && (name = elementName(state.doc, tag.parent, head)) && !selfClosers.has(name)) {
|
|
1008
|
+
let to2 = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
|
1009
|
+
let insert = `</${name}>`;
|
|
1010
|
+
return { range, changes: { from: head, to: to2, insert } };
|
|
1011
|
+
}
|
|
1012
|
+
} else if (didType && text == "/" && after.name == "IncompleteCloseTag") {
|
|
1013
|
+
let tag = after.parent;
|
|
1014
|
+
if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name = elementName(state.doc, tag, head)) && !selfClosers.has(name)) {
|
|
1015
|
+
let to2 = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
|
1016
|
+
let insert = `${name}>`;
|
|
1017
|
+
return {
|
|
1018
|
+
range: EditorSelection.cursor(head + insert.length, -1),
|
|
1019
|
+
changes: { from: head, to: to2, insert }
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
return { range };
|
|
1024
|
+
});
|
|
1025
|
+
if (closeTags.changes.empty)
|
|
1026
|
+
return false;
|
|
1027
|
+
view.dispatch([
|
|
1028
|
+
base,
|
|
1029
|
+
state.update(closeTags, {
|
|
1030
|
+
userEvent: "input.complete",
|
|
1031
|
+
scrollIntoView: true
|
|
1032
|
+
})
|
|
1033
|
+
]);
|
|
1034
|
+
return true;
|
|
1035
|
+
});
|
|
1036
|
+
export {
|
|
1037
|
+
autoCloseTags,
|
|
1038
|
+
html,
|
|
1039
|
+
htmlCompletionSource,
|
|
1040
|
+
htmlCompletionSourceWith,
|
|
1041
|
+
htmlLanguage
|
|
1042
|
+
};
|