@evandu/super-pi 0.1.126 → 0.1.127
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/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +7 -7
- package/dist/client/assets/{CodeMirrorEditor-B0lBmhx0.js → CodeMirrorEditor-DpbDVB1W.js} +2 -2
- package/dist/client/assets/{dist-pUnfiqui.js → dist-3JbohZwT.js} +1 -1
- package/dist/client/assets/{dist-BzqfS4cF.js → dist-BTxdkV1I.js} +1 -1
- package/dist/client/assets/{dist-CoiRxusA.js → dist-C30Mvvko.js} +1 -1
- package/dist/client/assets/{dist-BYtrk8af.js → dist-CBqTq6Rd.js} +1 -1
- package/dist/client/assets/{dist-BZ7PyaBp.js → dist-CKY9oRoB.js} +1 -1
- package/dist/client/assets/{dist-GF4SWnU-.js → dist-CZ_MzICk.js} +1 -1
- package/dist/client/assets/{dist-rONoVhdP.js → dist-CbkhMDE7.js} +1 -1
- package/dist/client/assets/{dist-Bi1EIIwj.js → dist-Cv9yhljh.js} +1 -1
- package/dist/client/assets/{dist-CL6353ch.js → dist-DL2rVK6z.js} +1 -1
- package/dist/client/assets/{dist-CuTxPpgb.js → dist-DhVx85Hi.js} +1 -1
- package/dist/client/assets/{dist-XPppcWa2.js → dist-DkWOTrCe.js} +1 -1
- package/dist/client/assets/{dist-BSZCQuEt.js → dist-Dx5uAXkp.js} +1 -1
- package/dist/client/assets/{dist-x58QSOcp.js → dist-H1xOj1sR.js} +1 -1
- package/dist/client/assets/{dist-DAujCIzu.js → dist-NOyudbxD.js} +1 -1
- package/dist/client/assets/{dist-BCUV3ivx.js → dist-NukDmwGc.js} +1 -1
- package/dist/client/assets/{dist-CjS579f2.js → dist-Uvt7BHub.js} +1 -1
- package/dist/client/assets/{dist-BNQkX4KY.js → dist-XSLGDk_-.js} +1 -1
- package/dist/client/assets/{dist-BW_rg1Bj.js → dist-ik9WKwIy.js} +1 -1
- package/dist/client/assets/{dist-SzL6z89P.js → dist-j9nf5NbD.js} +1 -1
- package/dist/client/assets/{dist-eerDlQWM.js → dist-kPkvm0f9.js} +1 -1
- package/dist/client/assets/{dist-BFm82vnX.js → dist-qTKaDyIl.js} +1 -1
- package/dist/client/assets/{dist-DawI143o.js → dist-zedNmYPO.js} +1 -1
- package/dist/client/assets/{index-09I_ABgJ.css → index-BAaymrG2.css} +1 -1
- package/dist/client/assets/{index-Dp0610g1.js → index-DvxaTOG8.js} +9 -9
- package/dist/client/index.html +2 -2
- package/dist/server/application/catalog-service.d.ts +4 -1
- package/dist/server/application/catalog-service.js +21 -0
- package/dist/server/command-handler.js +6 -0
- package/dist/server/pi-session.d.ts +22 -0
- package/dist/server/pi-session.js +20 -10
- package/dist/server/types.d.ts +21 -0
- package/package.json +5 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "8c0811265d4bfc2d39ab2dc15d7abc93c4c3af26bc41fc0e8394da9ca4839a99",
|
|
3
3
|
"files": {
|
|
4
|
-
"src/client/App.tsx": "
|
|
4
|
+
"src/client/App.tsx": "e7e805f3b0cf3d190e1e1b732b3c7260d8dd044f489c3e16d7f0cc8df5bc442e",
|
|
5
5
|
"src/client/CodeMirrorEditor.tsx": "682248deb6d965b5417b8809763622cc48af0f7c06e8a5bfc4b1bc9698bf55f7",
|
|
6
6
|
"src/client/ErrorBoundary.tsx": "d16376f9f6c7cc1fab8590c65a66438127642f7d6bb8023cec53d8a6cc9f3964",
|
|
7
7
|
"src/client/FilesPanel.tsx": "d6975c9e249220c60efde1a1acf394e0575ca4469f36b3990742d91a5bbea0a6",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"src/client/KnowledgePanel.tsx": "4f7230cfe610cd86d63aa143c82f6195b3c4208ef0bea703f92104ef27237704",
|
|
12
12
|
"src/client/MarkdownView.tsx": "4f04a8f3c9381946e5d2f957ac4fb74a6b16272e90375fb4dc6bd3a43d7c744d",
|
|
13
13
|
"src/client/MemoryPanel.tsx": "2cc1f4ee709f6d56ede8b0ceced228ea4c935cfd1cc803275558dbbd5f5244fb",
|
|
14
|
-
"src/client/SlashCommandMenu.tsx": "
|
|
14
|
+
"src/client/SlashCommandMenu.tsx": "69cd0a9d5e35f41f703e91a845e5bd750c952d2957be03b5528e156e60bf6ecb",
|
|
15
15
|
"src/client/Tabs.tsx": "6e48f318b1fe4678f438c6e2a41eeb49e89ee9c67b981f7d6154cd7060a048ab",
|
|
16
16
|
"src/client/TerminalPanel.tsx": "6a8dbb0e0806ccfef6fd67ae16f580177dca9a7a8943fd5b801da555e424ad72",
|
|
17
17
|
"src/client/WorkflowCard.tsx": "451e22b492e12ad3d7040c4a1af67477bb974137c18a6873574644fefcebdefe",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"src/client/main.tsx": "d6325cec79ebc225e4972c33ad9b4266fa1eab5f962fec36ed4c539124a8fcab",
|
|
23
23
|
"src/client/markdown.ts": "1499893ea5ce29d49f26c193cc0e6001ffa8a31d039ccee343ba407cd2cdbf1b",
|
|
24
24
|
"src/client/pending-operations.ts": "8a5f9e9711c0f875c8ed194196c218162de5270298dad4091351d41294c859d7",
|
|
25
|
-
"src/client/slash-commands.ts": "
|
|
26
|
-
"src/client/styles.css": "
|
|
25
|
+
"src/client/slash-commands.ts": "b792018fb67bd9e6f777397b0720b8b3aa565a4d8f7a76f94fec097ddf749480",
|
|
26
|
+
"src/client/styles.css": "0559b4c7c4263e7771cc7c3916d2656c8ec4aa90c1374c4de4f3d45f3ce49817",
|
|
27
27
|
"src/client/terminal-emulator.ts": "ffcc4f5fbddaf25cebcc9e03dbe5d7d0ad2c21586f5d169e57c04c82e2308b3b",
|
|
28
28
|
"src/client/theme.tsx": "a63a532cb8373dee207e5967bd221414aab4982f4de0524e42d61601db5a99a4",
|
|
29
29
|
"src/client/tool-sharing.ts": "679c97f6d40be466964f2f1076aa7ea55f4a585c3deff8214675070220921059",
|
|
30
30
|
"src/client/tools.ts": "58fe41f0edbd490e3fab7f12f258b1dbc2163b653553b03ac61caf1543618e50",
|
|
31
|
-
"src/client/types.ts": "
|
|
31
|
+
"src/client/types.ts": "7a99145ea7099ebf63a9009d855fbc1d432522b17e640a89c9596db40533dbd7",
|
|
32
32
|
"src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
|
|
33
33
|
},
|
|
34
|
-
"recordedAt": "2026-10-23T14:
|
|
34
|
+
"recordedAt": "2026-10-23T14:59:05.079Z"
|
|
35
35
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-
|
|
2
|
-
import{a as e,n as t,r as n,t as r}from"./index-Dp0610g1.js";var i=e(n(),1);async function a(e,t){let[{StreamLanguage:n},i]=await Promise.all([r(()=>import(`./dist-BNQkX4KY.js`),__vite__mapDeps([0,1,2,3,4,5])),e()]),a=i[t]??i.default??i;return n.define(a)}var o={cpp:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cc:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cxx:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hpp:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hh:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hxx:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),c:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),h:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cu:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cuh:()=>r(()=>import(`./dist-BYtrk8af.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),js:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),jsx:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mjs:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cjs:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),ts:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),tsx:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0,jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mts:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cts:()=>r(()=>import(`./dist-BzqfS4cF.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),py:()=>r(()=>import(`./dist-DawI143o.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),pyi:()=>r(()=>import(`./dist-DawI143o.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),java:()=>r(()=>import(`./dist-x58QSOcp.js`).then(e=>e.java()),__vite__mapDeps([11,5,2,3,0,1,4,7])),php:()=>r(()=>import(`./dist-DAujCIzu.js`).then(e=>e.php()),__vite__mapDeps([12,5,2,3,0,1,4,7,13,14,8,9])),sql:()=>r(()=>import(`./dist-CoiRxusA.js`).then(e=>e.sql()),__vite__mapDeps([15,5,2,3,0,1,4,7,9])),yaml:()=>r(()=>import(`./dist-SzL6z89P.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),yml:()=>r(()=>import(`./dist-SzL6z89P.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),xml:()=>r(()=>import(`./dist-pUnfiqui.js`).then(e=>e.xml()),__vite__mapDeps([17,1,2,3,4,5,0,7])),json:()=>r(()=>import(`./dist-XPppcWa2.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),jsonc:()=>r(()=>import(`./dist-XPppcWa2.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),json5:()=>r(()=>import(`./dist-XPppcWa2.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),html:()=>r(()=>import(`./dist-BZ7PyaBp.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),htm:()=>r(()=>import(`./dist-BZ7PyaBp.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),vue:()=>r(()=>import(`./dist-BZ7PyaBp.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),svelte:()=>r(()=>import(`./dist-BZ7PyaBp.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),css:()=>r(()=>import(`./dist-CjS579f2.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([14,2,3,5,0,1,4,7])),md:()=>r(()=>import(`./dist-BFm82vnX.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),markdown:()=>r(()=>import(`./dist-BFm82vnX.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),mdx:()=>r(()=>import(`./dist-BFm82vnX.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),rs:()=>r(()=>import(`./dist-Bi1EIIwj.js`).then(e=>e.rust()),__vite__mapDeps([20,5,2,3,0,1,4,7])),go:()=>r(()=>import(`./dist-GF4SWnU-.js`).then(e=>e.go()),__vite__mapDeps([21,5,2,3,0,1,4,7,9])),sh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),bash:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),zsh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),fish:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),ps1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),psm1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),rb:()=>a(()=>r(()=>import(`./ruby-ChfNwlCY.js`),[]),`ruby`),swift:()=>a(()=>r(()=>import(`./swift-DKB6_1j6.js`),[]),`swift`),toml:()=>a(()=>r(()=>import(`./toml-BPTmHmyx.js`),[]),`toml`),ini:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),cfg:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),conf:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),properties:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),dockerfile:()=>a(()=>r(()=>import(`./dockerfile-BDePf5PZ.js`),[]),`dockerfile`),diff:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`),patch:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`)},s={cpp:`C++`,cc:`C++`,cxx:`C++`,hpp:`C++`,hh:`C++`,hxx:`C++`,cu:`CUDA C++`,cuh:`CUDA C++`,c:`C`,h:`C/C++ Header`,js:`JavaScript`,jsx:`JSX`,mjs:`JavaScript`,cjs:`JavaScript`,ts:`TypeScript`,tsx:`TSX`,mts:`TypeScript`,cts:`TypeScript`,py:`Python`,pyi:`Python Stub`,java:`Java`,php:`PHP`,sql:`SQL`,yaml:`YAML`,yml:`YAML`,xml:`XML`,json:`JSON`,jsonc:`JSON with Comments`,json5:`JSON5`,css:`CSS`,md:`Markdown`,markdown:`Markdown`,mdx:`MDX`,rs:`Rust`,go:`Go`,html:`HTML`,htm:`HTML`,vue:`Vue`,svelte:`Svelte`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,fish:`Fish`,ps1:`PowerShell`,psm1:`PowerShell`,rb:`Ruby`,swift:`Swift`,toml:`TOML`,ini:`INI`,cfg:`Config`,conf:`Config`,properties:`Properties`,dockerfile:`Dockerfile`,diff:`Diff`,patch:`Patch`};function c(e){return o[e.toLowerCase()]}function l(e){return s[e.toLowerCase()]}var u=t(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function h(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:m(`--cm-keyword`)},{tag:t.tags.string,color:m(`--cm-string`)},{tag:t.tags.number,color:m(`--cm-number`)},{tag:t.tags.comment,color:m(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:m(`--cm-function`)},{tag:t.tags.typeName,color:m(`--cm-type`)},{tag:t.tags.className,color:m(`--cm-type`)},{tag:t.tags.propertyName,color:m(`--cm-property`)},{tag:t.tags.operator,color:m(`--cm-operator`)},{tag:t.tags.variableName,color:m(`--cm-variable`)}])}function g({path:e,value:t,onChange:n,jumpToLine:a,onSave:o}){let s=(0,i.useRef)(null),m=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useRef)(n),b=(0,i.useRef)(o);y.current=n,b.current=o;let[x,S]=(0,i.useState)(!1),[C,w]=(0,i.useState)(!1),[T,E]=(0,i.useState)(`0,0`);(0,i.useEffect)(()=>{let n=!1,i,a,o,l;return(async()=>{try{let u=p(e),f=c(u),[x,C,T,D,O,k,A]=await Promise.all([r(()=>import(`./dist-rONoVhdP.js`).then(e=>e.x),__vite__mapDeps([1,2,3])),r(()=>import(`./dist-CL6353ch.js`).then(e=>e.s),__vite__mapDeps([4,2,3,1])),r(()=>import(`./dist-BSZCQuEt.js`),__vite__mapDeps([22,1,2,3,4,5,0])),r(()=>import(`./dist-CuTxPpgb.js`),__vite__mapDeps([23,1,2,3,4])),r(()=>import(`./dist-BNQkX4KY.js`),__vite__mapDeps([0,1,2,3,4,5])),r(()=>import(`./dist-eerDlQWM.js`).then(e=>e.n),__vite__mapDeps([5,2,3])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${u}:`,e),null)):Promise.resolve(null)]);if(n||!s.current)return;o=O,l=k,_.current=x.Annotation.define(),v.current=x.Transaction.addToHistory;let j=t.length<=d&&A!==null;a=new x.Compartment;let M=[C.lineNumbers(),C.highlightActiveLine(),C.drawSelection(),T.history(),C.keymap.of([T.indentWithTab,...T.defaultKeymap,...T.historyKeymap,...D.searchKeymap,{key:`Mod-s`,run:()=>(b.current(),!0)}]),C.EditorView.updateListener.of(e=>{e.docChanged&&!(_.current&&e.transactions.some(e=>e.annotation(_.current)===!0))&&y.current(e.state.doc.toString()),e.selectionSet&&E(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),C.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(A)try{M.push(A)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${u}:`,e),j=!1}if(j&&a&&o&&l)try{M.push(a.of(o.syntaxHighlighting(h(o,l))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${u}:`,e),j=!1}if(i=new C.EditorView({state:x.EditorState.create({doc:t,extensions:M}),parent:s.current}),n){i.destroy();return}m.current=i,S(j),w(!0);let N=new MutationObserver(()=>{let e=m.current;if(e&&j&&a&&o&&l)try{e.dispatch({effects:a.reconfigure(o.syntaxHighlighting(h(o,l)))})}catch{}});g.current=N,N.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||w(!0)}})(),()=>{n=!0,g.current?.disconnect(),g.current=null,i?.destroy(),m.current=null,w(!1),s.current&&(s.current.textContent=``)}},[e]),(0,i.useEffect)(()=>{let e=m.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:_.current?_.current.of(!0):void 0})},[t]),(0,i.useEffect)(()=>{let e=m.current;if(!e||!a)return;let t=e.state.doc.line(Math.min(Math.max(1,a.line),e.state.doc.lines));e.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0}),e.focus()},[a,C]);let D=m.current?.state.doc.toString()??t,O=D.length<=f?D:D.slice(0,f),k=p(e),A=l(k);return(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":O,"data-file-content-truncated":D.length>f?`1`:`0`,"data-file-selection":T,"data-file-editor-ready":C?`1`:`0`,onMouseDown:()=>m.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:s,"aria-label":`编辑 ${e}`}),!C&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-editor-loading":`1`,children:`⌛ 正在加载编辑器…`}),C&&!x&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-highlight-status":`plain`,children:`纯文本`}),C&&x&&A&&(0,u.jsx)(`span`,{className:`file-cm-status file-cm-status-lang`,"data-file-highlight-status":k,children:A})]})}export{g as CodeMirrorEditor};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-XSLGDk_-.js","assets/dist-CbkhMDE7.js","assets/index-DvxaTOG8.js","assets/index-BAaymrG2.css","assets/dist-DL2rVK6z.js","assets/dist-kPkvm0f9.js","assets/dist-CBqTq6Rd.js","assets/dist-NukDmwGc.js","assets/dist-BTxdkV1I.js","assets/dist-ik9WKwIy.js","assets/dist-zedNmYPO.js","assets/dist-H1xOj1sR.js","assets/dist-NOyudbxD.js","assets/dist-CKY9oRoB.js","assets/dist-Uvt7BHub.js","assets/dist-C30Mvvko.js","assets/dist-j9nf5NbD.js","assets/dist-3JbohZwT.js","assets/dist-DkWOTrCe.js","assets/dist-qTKaDyIl.js","assets/dist-Cv9yhljh.js","assets/dist-CZ_MzICk.js","assets/dist-Dx5uAXkp.js","assets/dist-DhVx85Hi.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,n as t,r as n,t as r}from"./index-DvxaTOG8.js";var i=e(n(),1);async function a(e,t){let[{StreamLanguage:n},i]=await Promise.all([r(()=>import(`./dist-XSLGDk_-.js`),__vite__mapDeps([0,1,2,3,4,5])),e()]),a=i[t]??i.default??i;return n.define(a)}var o={cpp:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cc:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cxx:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hpp:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hh:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),hxx:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),c:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),h:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cu:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),cuh:()=>r(()=>import(`./dist-CBqTq6Rd.js`).then(e=>e.cpp()),__vite__mapDeps([6,5,2,3,0,1,4,7])),js:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),jsx:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mjs:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cjs:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),ts:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),tsx:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0,jsx:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),mts:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),cts:()=>r(()=>import(`./dist-BTxdkV1I.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,2,3,1,4,5,0,7,9])),py:()=>r(()=>import(`./dist-zedNmYPO.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),pyi:()=>r(()=>import(`./dist-zedNmYPO.js`).then(e=>e.python()),__vite__mapDeps([10,5,2,3,0,1,4,7,9])),java:()=>r(()=>import(`./dist-H1xOj1sR.js`).then(e=>e.java()),__vite__mapDeps([11,5,2,3,0,1,4,7])),php:()=>r(()=>import(`./dist-NOyudbxD.js`).then(e=>e.php()),__vite__mapDeps([12,5,2,3,0,1,4,7,13,14,8,9])),sql:()=>r(()=>import(`./dist-C30Mvvko.js`).then(e=>e.sql()),__vite__mapDeps([15,5,2,3,0,1,4,7,9])),yaml:()=>r(()=>import(`./dist-j9nf5NbD.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),yml:()=>r(()=>import(`./dist-j9nf5NbD.js`).then(e=>e.yaml()),__vite__mapDeps([16,5,2,3,0,1,4,7])),xml:()=>r(()=>import(`./dist-3JbohZwT.js`).then(e=>e.xml()),__vite__mapDeps([17,1,2,3,4,5,0,7])),json:()=>r(()=>import(`./dist-DkWOTrCe.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),jsonc:()=>r(()=>import(`./dist-DkWOTrCe.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),json5:()=>r(()=>import(`./dist-DkWOTrCe.js`).then(e=>e.json()),__vite__mapDeps([18,5,2,3,0,1,4,7])),html:()=>r(()=>import(`./dist-CKY9oRoB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),htm:()=>r(()=>import(`./dist-CKY9oRoB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),vue:()=>r(()=>import(`./dist-CKY9oRoB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),svelte:()=>r(()=>import(`./dist-CKY9oRoB.js`).then(e=>e.html()),__vite__mapDeps([13,1,2,3,4,5,0,7,14,8,9])),css:()=>r(()=>import(`./dist-Uvt7BHub.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([14,2,3,5,0,1,4,7])),md:()=>r(()=>import(`./dist-qTKaDyIl.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),markdown:()=>r(()=>import(`./dist-qTKaDyIl.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),mdx:()=>r(()=>import(`./dist-qTKaDyIl.js`).then(e=>e.markdown()),__vite__mapDeps([19,1,2,3,4,5,0,9,13,7,14,8])),rs:()=>r(()=>import(`./dist-Cv9yhljh.js`).then(e=>e.rust()),__vite__mapDeps([20,5,2,3,0,1,4,7])),go:()=>r(()=>import(`./dist-CZ_MzICk.js`).then(e=>e.go()),__vite__mapDeps([21,5,2,3,0,1,4,7,9])),sh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),bash:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),zsh:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),fish:()=>a(()=>r(()=>import(`./shell-DwuoZtxw.js`),[]),`shell`),ps1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),psm1:()=>a(()=>r(()=>import(`./powershell-D8WpQPaX.js`),[]),`powershell`),rb:()=>a(()=>r(()=>import(`./ruby-ChfNwlCY.js`),[]),`ruby`),swift:()=>a(()=>r(()=>import(`./swift-DKB6_1j6.js`),[]),`swift`),toml:()=>a(()=>r(()=>import(`./toml-BPTmHmyx.js`),[]),`toml`),ini:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),cfg:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),conf:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),properties:()=>a(()=>r(()=>import(`./properties-C357ku5U.js`),[]),`properties`),dockerfile:()=>a(()=>r(()=>import(`./dockerfile-BDePf5PZ.js`),[]),`dockerfile`),diff:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`),patch:()=>a(()=>r(()=>import(`./diff-ChtP43wD.js`),[]),`diff`)},s={cpp:`C++`,cc:`C++`,cxx:`C++`,hpp:`C++`,hh:`C++`,hxx:`C++`,cu:`CUDA C++`,cuh:`CUDA C++`,c:`C`,h:`C/C++ Header`,js:`JavaScript`,jsx:`JSX`,mjs:`JavaScript`,cjs:`JavaScript`,ts:`TypeScript`,tsx:`TSX`,mts:`TypeScript`,cts:`TypeScript`,py:`Python`,pyi:`Python Stub`,java:`Java`,php:`PHP`,sql:`SQL`,yaml:`YAML`,yml:`YAML`,xml:`XML`,json:`JSON`,jsonc:`JSON with Comments`,json5:`JSON5`,css:`CSS`,md:`Markdown`,markdown:`Markdown`,mdx:`MDX`,rs:`Rust`,go:`Go`,html:`HTML`,htm:`HTML`,vue:`Vue`,svelte:`Svelte`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,fish:`Fish`,ps1:`PowerShell`,psm1:`PowerShell`,rb:`Ruby`,swift:`Swift`,toml:`TOML`,ini:`INI`,cfg:`Config`,conf:`Config`,properties:`Properties`,dockerfile:`Dockerfile`,diff:`Diff`,patch:`Patch`};function c(e){return o[e.toLowerCase()]}function l(e){return s[e.toLowerCase()]}var u=t(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}function h(e,t){return e.HighlightStyle.define([{tag:t.tags.keyword,color:m(`--cm-keyword`)},{tag:t.tags.string,color:m(`--cm-string`)},{tag:t.tags.number,color:m(`--cm-number`)},{tag:t.tags.comment,color:m(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:m(`--cm-function`)},{tag:t.tags.typeName,color:m(`--cm-type`)},{tag:t.tags.className,color:m(`--cm-type`)},{tag:t.tags.propertyName,color:m(`--cm-property`)},{tag:t.tags.operator,color:m(`--cm-operator`)},{tag:t.tags.variableName,color:m(`--cm-variable`)}])}function g({path:e,value:t,onChange:n,jumpToLine:a,onSave:o}){let s=(0,i.useRef)(null),m=(0,i.useRef)(null),g=(0,i.useRef)(null),_=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useRef)(n),b=(0,i.useRef)(o);y.current=n,b.current=o;let[x,S]=(0,i.useState)(!1),[C,w]=(0,i.useState)(!1),[T,E]=(0,i.useState)(`0,0`);(0,i.useEffect)(()=>{let n=!1,i,a,o,l;return(async()=>{try{let u=p(e),f=c(u),[x,C,T,D,O,k,A]=await Promise.all([r(()=>import(`./dist-CbkhMDE7.js`).then(e=>e.x),__vite__mapDeps([1,2,3])),r(()=>import(`./dist-DL2rVK6z.js`).then(e=>e.s),__vite__mapDeps([4,2,3,1])),r(()=>import(`./dist-Dx5uAXkp.js`),__vite__mapDeps([22,1,2,3,4,5,0])),r(()=>import(`./dist-DhVx85Hi.js`),__vite__mapDeps([23,1,2,3,4])),r(()=>import(`./dist-XSLGDk_-.js`),__vite__mapDeps([0,1,2,3,4,5])),r(()=>import(`./dist-kPkvm0f9.js`).then(e=>e.n),__vite__mapDeps([5,2,3])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${u}:`,e),null)):Promise.resolve(null)]);if(n||!s.current)return;o=O,l=k,_.current=x.Annotation.define(),v.current=x.Transaction.addToHistory;let j=t.length<=d&&A!==null;a=new x.Compartment;let M=[C.lineNumbers(),C.highlightActiveLine(),C.drawSelection(),T.history(),C.keymap.of([T.indentWithTab,...T.defaultKeymap,...T.historyKeymap,...D.searchKeymap,{key:`Mod-s`,run:()=>(b.current(),!0)}]),C.EditorView.updateListener.of(e=>{e.docChanged&&!(_.current&&e.transactions.some(e=>e.annotation(_.current)===!0))&&y.current(e.state.doc.toString()),e.selectionSet&&E(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),C.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(A)try{M.push(A)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${u}:`,e),j=!1}if(j&&a&&o&&l)try{M.push(a.of(o.syntaxHighlighting(h(o,l))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${u}:`,e),j=!1}if(i=new C.EditorView({state:x.EditorState.create({doc:t,extensions:M}),parent:s.current}),n){i.destroy();return}m.current=i,S(j),w(!0);let N=new MutationObserver(()=>{let e=m.current;if(e&&j&&a&&o&&l)try{e.dispatch({effects:a.reconfigure(o.syntaxHighlighting(h(o,l)))})}catch{}});g.current=N,N.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||w(!0)}})(),()=>{n=!0,g.current?.disconnect(),g.current=null,i?.destroy(),m.current=null,w(!1),s.current&&(s.current.textContent=``)}},[e]),(0,i.useEffect)(()=>{let e=m.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:_.current?_.current.of(!0):void 0})},[t]),(0,i.useEffect)(()=>{let e=m.current;if(!e||!a)return;let t=e.state.doc.line(Math.min(Math.max(1,a.line),e.state.doc.lines));e.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0}),e.focus()},[a,C]);let D=m.current?.state.doc.toString()??t,O=D.length<=f?D:D.slice(0,f),k=p(e),A=l(k);return(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":O,"data-file-content-truncated":D.length>f?`1`:`0`,"data-file-selection":T,"data-file-editor-ready":C?`1`:`0`,onMouseDown:()=>m.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:s,"aria-label":`编辑 ${e}`}),!C&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-editor-loading":`1`,children:`⌛ 正在加载编辑器…`}),C&&!x&&(0,u.jsx)(`span`,{className:`file-cm-status`,"data-file-highlight-status":`plain`,children:`纯文本`}),C&&x&&A&&(0,u.jsx)(`span`,{className:`file-cm-status file-cm-status-lang`,"data-file-highlight-status":k,children:A})]})}export{g as CodeMirrorEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./dist-rONoVhdP.js";import{r as t}from"./dist-CL6353ch.js";import{i as n,o as r}from"./dist-eerDlQWM.js";import{LRLanguage as i,LanguageSupport as a,bracketMatchingHandle as o,foldNodeProp as s,indentNodeProp as c,syntaxTree as l}from"./dist-BNQkX4KY.js";import{n as u,r as d,t as f}from"./dist-BCUV3ivx.js";var p=1,m=2,h=3,g=4,_=5,v=36,y=37,b=38,x=11,S=13;function C(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function w(e){return e==9||e==10||e==13||e==32}var T=null,E=null,D=0;function O(e,t){let n=e.pos+t;if(E==e&&D==n)return T;for(;w(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!C(n))break;r+=String.fromCharCode(n),t++}return E=e,D=n,T=r||null}function k(e,t){this.name=e,this.parent=t}var A=new f({start:null,shift(e,t,n,r){return t==p?new k(O(r,1)||``,e):e},reduce(e,t){return t==x&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==p||i==S?new k(O(r,1)||``,e):e},strict:!1}),j=new u((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=O(e,0);if(!n)return e.acceptToken(_);if(t.context&&n==t.context.name)return e.acceptToken(m);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(h,-2);e.acceptToken(g)}else if(e.next!=33&&e.next!=63)return e.acceptToken(p)}},{contextual:!0});function M(e,t){return new u(n=>{let r=0,i=t.charCodeAt(0);scan:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue scan;break}r&&n.acceptToken(e)})}var N=M(v,`-->`),P=M(y,`?>`),F=M(b,`]]>`),I=n({Text:r.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":r.angleBracket,TagName:r.tagName,"MismatchedCloseTag/TagName":[r.tagName,r.invalid],AttributeName:r.attributeName,AttributeValue:r.attributeValue,Is:r.definitionOperator,"EntityReference CharacterReference":r.character,Comment:r.blockComment,ProcessingInst:r.processingInstruction,DoctypeDecl:r.documentMeta,Cdata:r.special(r.string)}),L=d.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:A,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],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wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[j,N,P,F,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function R(e,t){let n=t&&t.getChild(`TagName`);return n?e.sliceString(n.from,n.to):``}function z(e,t){let n=t&&t.firstChild;return!n||n.name!=`OpenTag`?``:R(e,n)}function B(e,t,n){let r=t&&t.getChildren(`Attribute`).find(e=>e.from<=n&&e.to>=n),i=r&&r.getChild(`AttributeName`);return i?e.sliceString(i.from,i.to):``}function V(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name==`Element`)return t;return null}function H(e,t){let n=l(e).resolveInner(t,-1),r=null;for(let e=n;!r&&e.parent;e=e.parent)(e.name==`OpenTag`||e.name==`CloseTag`||e.name==`SelfClosingTag`||e.name==`MismatchedCloseTag`)&&(r=e);if(r&&(r.to>t||r.lastChild.type.isError)){let e=r.parent;if(n.name==`TagName`)return r.name==`CloseTag`||r.name==`MismatchedCloseTag`?{type:`closeTag`,from:n.from,context:e}:{type:`openTag`,from:n.from,context:V(e)};if(n.name==`AttributeName`)return{type:`attrName`,from:n.from,context:r};if(n.name==`AttributeValue`)return{type:`attrValue`,from:n.from,context:r};let i=n==r||n.name==`Attribute`?n.childBefore(t):n;return i?.name==`StartTag`?{type:`openTag`,from:t,context:V(e)}:i?.name==`StartCloseTag`&&i.to<=t?{type:`closeTag`,from:t,context:e}:i?.name==`Is`?{type:`attrValue`,from:t,context:r}:i?{type:`attrName`,from:t,context:r}:null}if(n.name==`StartCloseTag`)return{type:`closeTag`,from:t,context:n.parent};for(;n.parent&&n.to==t&&!n.lastChild?.type.isError;)n=n.parent;return n.name==`Element`||n.name==`Text`||n.name==`Document`?{type:`tag`,from:t,context:n.name==`Element`?n:V(n)}:null}var U=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:`type`},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:`<`+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:`</`+this.name+`>`,boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+`>`}),this.text=e.textContent?e.textContent.map(e=>({label:e,type:`text`})):[]}},W=/^[:\-\.\w\u00b7-\uffff]*$/;function G(e){return Object.assign(Object.assign({type:`property`},e.completion||{}),{label:e.name})}function K(e){return typeof e==`string`?{label:`"${e}"`,type:`constant`}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function q(e,t){let n=[],r=[],i=Object.create(null);for(let e of t){let t=G(e);n.push(t),e.global&&r.push(t),e.values&&(i[e.name]=e.values.map(K))}let a=[],o=[],s=Object.create(null);for(let t of e){let e=r,c=i;t.attributes&&(e=e.concat(t.attributes.map(e=>typeof e==`string`?n.find(t=>t.label==e)||{label:e,type:`property`}:(e.values&&(c==i&&(c=Object.create(c)),c[e.name]=e.values.map(K)),G(e)))));let l=new U(t,e,c);s[l.name]=l,a.push(l),t.top&&o.push(l)}o.length||(o=a);for(let t=0;t<a.length;t++){let n=e[t],r=a[t];if(n.children)for(let e of n.children)s[e]&&r.children.push(s[e]);else r.children=a}return e=>{let{doc:t}=e.state,n=H(e.state,e.pos);if(!n||n.type==`tag`&&!e.explicit)return null;let{type:c,from:l,context:u}=n;if(c==`openTag`){let e=o,n=z(t,u);return n&&(e=s[n]?.children||a),{from:l,options:e.map(e=>e.completion),validFor:W}}if(c==`closeTag`){let n=z(t,u);return n?{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`>`),options:[s[n]?.closeNameCompletion||{label:n+`>`,type:`type`}],validFor:W}:null}if(c==`attrName`)return{from:l,options:s[R(t,u)]?.attrs||r,validFor:W};if(c==`attrValue`){let n=B(t,u,l);if(!n)return null;let r=(s[R(t,u)]?.attrValues||i)[n];return!r||!r.length?null:{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`"`),options:r,validFor:/^"[^"]*"?$/}}if(c==`tag`){let n=z(t,u),r=s[n],i=[],c=u&&u.lastChild;n&&(!c||c.name!=`CloseTag`||R(t,c)!=n)&&i.push(r?r.closeCompletion:{label:`</`+n+`>`,type:`type`,boost:2});let d=i.concat((r?.children||(u?a:o)).map(e=>e.openCompletion));if(u&&r?.text.length){let t=u.firstChild;t.to>e.pos-20&&!/\S/.test(e.state.sliceDoc(t.to,e.pos))&&(d=d.concat(r.text))}return{from:l,options:d,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}var J=i.define({name:`xml`,parser:L.configure({props:[c.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),s.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),o.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/$/}});function Y(e={}){let t=[J.data.of({autocomplete:q(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Z),new a(J,t)}function X(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}var Z=t.inputHandler.of((t,n,r,i,a)=>{if(t.composing||t.state.readOnly||n!=r||i!=`>`&&i!=`/`||!J.isActiveAt(t.state,n,-1))return!1;let o=a(),{state:s}=o,c=s.changeByRange(t=>{let{head:n}=t,r=s.doc.sliceString(n-1,n)==i,a=l(s).resolveInner(n,-1),o;if(r&&i==`>`&&a.name==`EndTag`){let e=a.parent;if(e.parent?.lastChild?.name!=`CloseTag`&&(o=X(s.doc,e.parent,n)))return{range:t,changes:{from:n,to:n+ +(s.doc.sliceString(n,n+1)===`>`),insert:`</${o}>`}}}else if(r&&i==`/`&&a.name==`StartCloseTag`){let t=a.parent;if(a.from==n-2&&t.lastChild?.name!=`CloseTag`&&(o=X(s.doc,t,n))){let t=n+ +(s.doc.sliceString(n,n+1)===`>`),r=`${o}>`;return{range:e.cursor(n+r.length,-1),changes:{from:n,to:t,insert:r}}}}return{range:t}});return!c.changes.empty&&(t.dispatch([o,s.update(c,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)});export{Y as xml};
|
|
1
|
+
import{a as e}from"./dist-CbkhMDE7.js";import{r as t}from"./dist-DL2rVK6z.js";import{i as n,o as r}from"./dist-kPkvm0f9.js";import{LRLanguage as i,LanguageSupport as a,bracketMatchingHandle as o,foldNodeProp as s,indentNodeProp as c,syntaxTree as l}from"./dist-XSLGDk_-.js";import{n as u,r as d,t as f}from"./dist-NukDmwGc.js";var p=1,m=2,h=3,g=4,_=5,v=36,y=37,b=38,x=11,S=13;function C(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function w(e){return e==9||e==10||e==13||e==32}var T=null,E=null,D=0;function O(e,t){let n=e.pos+t;if(E==e&&D==n)return T;for(;w(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!C(n))break;r+=String.fromCharCode(n),t++}return E=e,D=n,T=r||null}function k(e,t){this.name=e,this.parent=t}var A=new f({start:null,shift(e,t,n,r){return t==p?new k(O(r,1)||``,e):e},reduce(e,t){return t==x&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==p||i==S?new k(O(r,1)||``,e):e},strict:!1}),j=new u((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=O(e,0);if(!n)return e.acceptToken(_);if(t.context&&n==t.context.name)return e.acceptToken(m);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(h,-2);e.acceptToken(g)}else if(e.next!=33&&e.next!=63)return e.acceptToken(p)}},{contextual:!0});function M(e,t){return new u(n=>{let r=0,i=t.charCodeAt(0);scan:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue scan;break}r&&n.acceptToken(e)})}var N=M(v,`-->`),P=M(y,`?>`),F=M(b,`]]>`),I=n({Text:r.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":r.angleBracket,TagName:r.tagName,"MismatchedCloseTag/TagName":[r.tagName,r.invalid],AttributeName:r.attributeName,AttributeValue:r.attributeValue,Is:r.definitionOperator,"EntityReference CharacterReference":r.character,Comment:r.blockComment,ProcessingInst:r.processingInstruction,DoctypeDecl:r.documentMeta,Cdata:r.special(r.string)}),L=d.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G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!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:A,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],[`openedBy`,12,`StartTag StartCloseTag`,19,`OpenTag`,20,`StartTag`],[`isolate`,-6,13,18,19,21,22,24,``]],propSources:[I],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?M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(e,t){let n=t&&t.getChild(`TagName`);return n?e.sliceString(n.from,n.to):``}function z(e,t){let n=t&&t.firstChild;return!n||n.name!=`OpenTag`?``:R(e,n)}function B(e,t,n){let r=t&&t.getChildren(`Attribute`).find(e=>e.from<=n&&e.to>=n),i=r&&r.getChild(`AttributeName`);return i?e.sliceString(i.from,i.to):``}function V(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name==`Element`)return t;return null}function H(e,t){let n=l(e).resolveInner(t,-1),r=null;for(let e=n;!r&&e.parent;e=e.parent)(e.name==`OpenTag`||e.name==`CloseTag`||e.name==`SelfClosingTag`||e.name==`MismatchedCloseTag`)&&(r=e);if(r&&(r.to>t||r.lastChild.type.isError)){let e=r.parent;if(n.name==`TagName`)return r.name==`CloseTag`||r.name==`MismatchedCloseTag`?{type:`closeTag`,from:n.from,context:e}:{type:`openTag`,from:n.from,context:V(e)};if(n.name==`AttributeName`)return{type:`attrName`,from:n.from,context:r};if(n.name==`AttributeValue`)return{type:`attrValue`,from:n.from,context:r};let i=n==r||n.name==`Attribute`?n.childBefore(t):n;return i?.name==`StartTag`?{type:`openTag`,from:t,context:V(e)}:i?.name==`StartCloseTag`&&i.to<=t?{type:`closeTag`,from:t,context:e}:i?.name==`Is`?{type:`attrValue`,from:t,context:r}:i?{type:`attrName`,from:t,context:r}:null}if(n.name==`StartCloseTag`)return{type:`closeTag`,from:t,context:n.parent};for(;n.parent&&n.to==t&&!n.lastChild?.type.isError;)n=n.parent;return n.name==`Element`||n.name==`Text`||n.name==`Document`?{type:`tag`,from:t,context:n.name==`Element`?n:V(n)}:null}var U=class{constructor(e,t,n){this.attrs=t,this.attrValues=n,this.children=[],this.name=e.name,this.completion=Object.assign(Object.assign({type:`type`},e.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:`<`+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:`</`+this.name+`>`,boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+`>`}),this.text=e.textContent?e.textContent.map(e=>({label:e,type:`text`})):[]}},W=/^[:\-\.\w\u00b7-\uffff]*$/;function G(e){return Object.assign(Object.assign({type:`property`},e.completion||{}),{label:e.name})}function K(e){return typeof e==`string`?{label:`"${e}"`,type:`constant`}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function q(e,t){let n=[],r=[],i=Object.create(null);for(let e of t){let t=G(e);n.push(t),e.global&&r.push(t),e.values&&(i[e.name]=e.values.map(K))}let a=[],o=[],s=Object.create(null);for(let t of e){let e=r,c=i;t.attributes&&(e=e.concat(t.attributes.map(e=>typeof e==`string`?n.find(t=>t.label==e)||{label:e,type:`property`}:(e.values&&(c==i&&(c=Object.create(c)),c[e.name]=e.values.map(K)),G(e)))));let l=new U(t,e,c);s[l.name]=l,a.push(l),t.top&&o.push(l)}o.length||(o=a);for(let t=0;t<a.length;t++){let n=e[t],r=a[t];if(n.children)for(let e of n.children)s[e]&&r.children.push(s[e]);else r.children=a}return e=>{let{doc:t}=e.state,n=H(e.state,e.pos);if(!n||n.type==`tag`&&!e.explicit)return null;let{type:c,from:l,context:u}=n;if(c==`openTag`){let e=o,n=z(t,u);return n&&(e=s[n]?.children||a),{from:l,options:e.map(e=>e.completion),validFor:W}}if(c==`closeTag`){let n=z(t,u);return n?{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`>`),options:[s[n]?.closeNameCompletion||{label:n+`>`,type:`type`}],validFor:W}:null}if(c==`attrName`)return{from:l,options:s[R(t,u)]?.attrs||r,validFor:W};if(c==`attrValue`){let n=B(t,u,l);if(!n)return null;let r=(s[R(t,u)]?.attrValues||i)[n];return!r||!r.length?null:{from:l,to:e.pos+ +(t.sliceString(e.pos,e.pos+1)==`"`),options:r,validFor:/^"[^"]*"?$/}}if(c==`tag`){let n=z(t,u),r=s[n],i=[],c=u&&u.lastChild;n&&(!c||c.name!=`CloseTag`||R(t,c)!=n)&&i.push(r?r.closeCompletion:{label:`</`+n+`>`,type:`type`,boost:2});let d=i.concat((r?.children||(u?a:o)).map(e=>e.openCompletion));if(u&&r?.text.length){let t=u.firstChild;t.to>e.pos-20&&!/\S/.test(e.state.sliceDoc(t.to,e.pos))&&(d=d.concat(r.text))}return{from:l,options:d,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}return null}}var J=i.define({name:`xml`,parser:L.configure({props:[c.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),s.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),o.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/$/}});function Y(e={}){let t=[J.data.of({autocomplete:q(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(Z),new a(J,t)}function X(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}var Z=t.inputHandler.of((t,n,r,i,a)=>{if(t.composing||t.state.readOnly||n!=r||i!=`>`&&i!=`/`||!J.isActiveAt(t.state,n,-1))return!1;let o=a(),{state:s}=o,c=s.changeByRange(t=>{let{head:n}=t,r=s.doc.sliceString(n-1,n)==i,a=l(s).resolveInner(n,-1),o;if(r&&i==`>`&&a.name==`EndTag`){let e=a.parent;if(e.parent?.lastChild?.name!=`CloseTag`&&(o=X(s.doc,e.parent,n)))return{range:t,changes:{from:n,to:n+ +(s.doc.sliceString(n,n+1)===`>`),insert:`</${o}>`}}}else if(r&&i==`/`&&a.name==`StartCloseTag`){let t=a.parent;if(a.from==n-2&&t.lastChild?.name!=`CloseTag`&&(o=X(s.doc,t,n))){let t=n+ +(s.doc.sliceString(n,n+1)===`>`),r=`${o}>`;return{range:e.cursor(n+r.length,-1),changes:{from:n,to:t,insert:r}}}}return{range:t}});return!c.changes.empty&&(t.dispatch([o,s.update(c,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)});export{Y as xml};
|