@evandu/super-pi 0.1.291 → 0.1.293

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "hash": "b452edeb654d9ceb6435e3534b75022ae4494bd60b67188b130ef3d8b604a313",
2
+ "hash": "150b118f317957cc029ead88ba22bdd14c4baff7f69bf5b4ba012810e1f56b45",
3
3
  "files": {
4
4
  "src/client/AnchoredPopover.tsx": "3d683cc9e4305678141c83987a37a36b3da30e20d7bd17ea8e48a72504475605",
5
5
  "src/client/App.tsx": "d990e5fb7a61ce926266b82cde3d9cfd6d9d36f45b35c217344c9b2b52dde8eb",
@@ -13,8 +13,8 @@
13
13
  "src/client/FileMentionMenu.tsx": "d400e7afb31008eda49d4b531eceda65a926b877177d0cffd9a8056b55161c3e",
14
14
  "src/client/FileWorkbenchChrome.tsx": "0863c988bdc50962e3dab365e918ad6de6aee7cc2d0d4d3cce049fa3529d2b6b",
15
15
  "src/client/FilesPanel.tsx": "673c13f96e21d09c12ecc8a445d9756167270e52bcb49e6321bdfc8b8144d195",
16
- "src/client/GitDiffEditor.tsx": "940339592c17b42797389c59b43ea472ea44ef4206f0fa6d6bac7d5d5da27e48",
17
- "src/client/GitPanel.tsx": "1646268de8dc6ea586061860514539bbc6a4470165ac5879ab569eeb8743e133",
16
+ "src/client/GitDiffEditor.tsx": "f0a23e5ab33dce671158ea55dc43492d6286adda540739a241fd4465a90531c3",
17
+ "src/client/GitPanel.tsx": "72d777fd4daef8f2b51748e46590b0d8c9d60ae56530da3b95408240814cd55e",
18
18
  "src/client/GroupChatPane.tsx": "437a69bee4411d2894c945d747ab016be9bdf73d1792f6ecaf86cee93f2b9ebe",
19
19
  "src/client/GroupExecutionPane.tsx": "2f593d99a5fdd5d37983a93b523c94747d4679135017d9711eed7334f8da29a9",
20
20
  "src/client/GroupModelSelect.tsx": "76af4a7744d7dbb14f337074313797739fb28523f738e756190206e7df91a848",
@@ -52,7 +52,7 @@
52
52
  "src/client/TeamHandoffCard.tsx": "925284ab81c7845c5cfdcfa1f631e124bb02d7d86b03ede8f3fbabc194c32dca",
53
53
  "src/client/TerminalPanel.tsx": "13f288575499103254597e38813ef5cf5fe2b1230e343ede767b6b55a1b035a2",
54
54
  "src/client/ToolGlyph.tsx": "a1100b61f1eee9520e7323385f667898763bfd69068f22de7dd36db2d4096c76",
55
- "src/client/TranscriptFind.tsx": "1d42a4704309ff12d2d68b74fe969fa9563d5ed0b5fb13809ac822ec52d96dbc",
55
+ "src/client/TranscriptFind.tsx": "d455995b8eedd4be6ada0e7d457f401cdbc43200206abb1d97dcc86803d78d48",
56
56
  "src/client/WorkbenchChrome.tsx": "9a7f761a547a627227302746a20d849f82e04062b40c9b60d0ecaf90c679543a",
57
57
  "src/client/WorkbenchSearch.tsx": "e29767e6596d8c29d386cd16fe43db31d565cdffe5d5a3ef972376b17b62271d",
58
58
  "src/client/WorkbenchSearchPanel.tsx": "44194765bdb4d15240fbb899a18a52bd85baec5d9ebea26762de319eab0f2341",
@@ -69,14 +69,14 @@
69
69
  "src/client/diff-layout.ts": "0ca8a64f3cfd3355ebb28542c0bb3ecb52379e3145b45c91a6ef180be2f6f805",
70
70
  "src/client/editor-blame.ts": "d680671b98c64f8ba7f639f660f6b4aab0bf112fc4695c436c9d2a505326b0b0",
71
71
  "src/client/editor-languages.ts": "d5319cfd9b9f3b07c2599ba64ec49a9038304d09fa1702302f3b2b97493d0a69",
72
- "src/client/editor-search.css": "deefc675b1348a8a0a27b7f9c16cfadb8562da2c3ee5e169a02a14c04047a542",
72
+ "src/client/editor-search.css": "cd1f23b9321c2bf6d94ce6bb53354ba9ace6aa86e2af4e60cf84834e0baf15e5",
73
73
  "src/client/editor-search.ts": "c7ccf4f958dcbf3aa64ddf8ef3d08c32fd6710c4633d2ec08a76b37f84e19a36",
74
74
  "src/client/errors.ts": "2ea215b8676cca8841b93c780563f1f2031320270d4d0865221f6a12b65c6f22",
75
75
  "src/client/file-diff-layout.css": "aee864e990d66d90380aeb991181cce39e2a29d02ea85095a4bf0c1d59c9ed50",
76
76
  "src/client/file-diff.ts": "b1fd62dd0f561c567f249d98364068c947e31758fa9f1644d27250679e0f62a4",
77
77
  "src/client/file-icons.tsx": "65e571a5378723511caef0e4bdbecdd4adba9461a46db878d65a948fc99fcb65",
78
78
  "src/client/git-diff-visual.css": "aca27e4077d16f3cc2ae51034269d6913ad9b30e48dc7d04095094023fd333d2",
79
- "src/client/git-workbench.css": "5886990487b1ac8263e18498ad7f89189dd6f38867ecebc538a6673f03815695",
79
+ "src/client/git-workbench.css": "d940545541b37d12c73c9497e917badfc24c860bb10e0fd42d3dd4554edd8259",
80
80
  "src/client/group-chat-client.ts": "23daaa55daa08819cafada4e91650d6b4be34da07f6ce1f57bf98900f56ea140",
81
81
  "src/client/group-chat-preferences.ts": "e52a3b1ff7d1436e0a35bd0d1951ba7a0d3a7490d14d2788aa6a7b404956d2a2",
82
82
  "src/client/group-chat.css": "0f31c988ea99152a0278331a4247df56d2aac01e3bb1a665506ebde7a351cc03",
@@ -102,7 +102,7 @@
102
102
  "src/client/slash-commands.ts": "daa5a8e6f90605a9a3921c977b24f69e9d9718e31a62a4b8e74a71a1faf0ce66",
103
103
  "src/client/software-update.css": "a3bb42e3bc832639d23a54a4e91216192cbb05efa1d41151e64571d883866258",
104
104
  "src/client/status-bar-menu.css": "05acaa1cc032a026ad3328d9d2c32a96e2e9e5ef335536646eacad0a33af76af",
105
- "src/client/styles.css": "ecd20554b663c6c546e3752e0485517b1c40762707284caee67825255f6548f7",
105
+ "src/client/styles.css": "c0a5b94d17e37818a95d1473df94cc9f13932659e2f7e95c68aff5cb3d11ccfc",
106
106
  "src/client/system-notifications.ts": "5c3d1b5575fd6f42a1d6176f599f918a35054c23281309f78cbb6899d8d2da21",
107
107
  "src/client/terminal-emulator.ts": "ffcc4f5fbddaf25cebcc9e03dbe5d7d0ad2c21586f5d169e57c04c82e2308b3b",
108
108
  "src/client/theme.tsx": "4f806b512d894b1f34b86f9d215af541618bc68443f96adde230fb7efb9f5a77",
@@ -111,12 +111,12 @@
111
111
  "src/client/tool-sharing.ts": "011212825dbbffe18c8f15aca721c02938ab6273fb5607b072a1e7b8b1853640",
112
112
  "src/client/tool-shortcuts.ts": "4422d29ba770af6acef18e66c6be05a9bc021f7323c7ca28bbe7668f26d4adb8",
113
113
  "src/client/tools.ts": "58fe41f0edbd490e3fab7f12f258b1dbc2163b653553b03ac61caf1543618e50",
114
- "src/client/transcript-find.css": "3cd920b9580c06065d656b41fde677703b6b29b96fed76e5056d55381bc2c594",
114
+ "src/client/transcript-find.css": "3fe2b9c8e1206ac3456a90fe9eafc2864e9a2ecb60c768f6dc580d3450c73600",
115
115
  "src/client/types.ts": "61a0639bff9cce59518ec11c36ee73359588bbea2b6dec18ee2818c4081264b9",
116
116
  "src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
117
117
  "src/client/workbench-memory.ts": "72c9b52cc28f8c8e90636c2425f0d14c4b5af1e36bff9bf8ad272d0811e60099",
118
118
  "src/client/workbench-navigation.ts": "3b229752a8ce4a45eba7aeff040eb33001413190141f1e9b8e5f38246a1761e2",
119
119
  "src/client/workbench-search-panel.css": "6978c03db4f17411e9064242b0ff786a520ee8cf58fe8a9d0ea42872ba3737f0"
120
120
  },
121
- "recordedAt": "2026-11-25T05:41:25.504Z"
121
+ "recordedAt": "2026-11-25T06:26:20.916Z"
122
122
  }
@@ -1 +1 @@
1
- .workbench-shell .cm-editor .cm-panels{background:var(--bg-panel);color:var(--text-primary)}.workbench-shell .cm-editor .cm-panels-top{border-bottom:1px solid var(--border-default)}.workbench-shell .cm-editor .cm-panel.cm-search{min-width:0;font-family:Manrope,system-ui,sans-serif;font-size:var(--type-control);line-height:var(--type-control-line);background:var(--bg-panel);color:var(--text-primary);flex-wrap:wrap;align-items:center;gap:6px 8px;padding:10px 46px 10px 12px;display:flex;position:relative}.workbench-shell .cm-editor .cm-search :is(input,button,label){font:inherit;margin:0}.workbench-shell .cm-editor .cm-search .cm-textfield{border:1px solid var(--border-default);width:220px;min-width:100px;max-width:340px;height:32px;color:var(--text-primary);background:var(--bg-input);box-shadow:none;border-radius:4px;flex:180px;padding:5px 8px}.workbench-shell .cm-editor .cm-search .cm-textfield::placeholder{color:var(--text-muted)}.workbench-shell .cm-editor .cm-search button{border:1px solid var(--border-default);min-height:32px;color:var(--text-primary);background:var(--bg-raised);box-shadow:none;cursor:pointer;background-image:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:4px 8px;display:inline-flex}.workbench-shell .cm-editor .cm-search button:hover{background:var(--bg-hover)}.workbench-shell .cm-editor .cm-search label{white-space:nowrap;min-height:32px;color:var(--text-secondary);align-items:center;gap:5px;display:inline-flex}.workbench-shell .cm-editor .cm-search input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0}.workbench-shell .cm-editor .cm-search br{flex-basis:100%;height:0}.workbench-shell .cm-editor .cm-search button[name=close]{background:0 0;border-color:#0000;width:30px;height:32px;min-height:32px;padding:0;font-size:20px;line-height:1;position:absolute;top:10px;right:8px}.workbench-shell .cm-editor .cm-search button[name=close]:hover{background:var(--bg-hover)}.workbench-shell .cm-editor .cm-search :is(input,button):focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.workbench-shell .cm-editor .cm-searchMatch,.workbench-shell .cm-editor .cm-searchMatch span{color:var(--text-primary);background-color:color-mix(in srgb, var(--selected-bg) 50%, var(--bg-app))}.workbench-shell .cm-editor .cm-searchMatch-selected,.workbench-shell .cm-editor .cm-searchMatch-selected span{color:var(--accent-contrast);background-color:var(--accent)}@media (width<=700px){.workbench-shell .cm-editor .cm-panel.cm-search{padding-right:60px}.workbench-shell .cm-editor .cm-search :is(button,label){min-height:44px}.workbench-shell .cm-editor .cm-search .cm-textfield{height:44px}.workbench-shell .cm-editor .cm-search button[name=close]{width:44px;height:44px}}
1
+ .workbench-shell .cm-editor .cm-panels{background:var(--bg-panel);color:var(--text-primary)}.workbench-shell .cm-editor .cm-panels-top{border-bottom:1px solid var(--border-default)}.workbench-shell .cm-editor .cm-panel.cm-search{min-width:0;font-family:Manrope,system-ui,sans-serif;font-size:var(--type-control);line-height:var(--type-control-line);background:var(--bg-panel);color:var(--text-primary);flex-wrap:wrap;align-items:center;gap:6px 8px;padding:10px 46px 10px 12px;display:flex;position:relative}.workbench-shell .cm-editor .cm-search :is(input,button,label){font:inherit;margin:0}.workbench-shell .cm-editor .cm-search .cm-textfield{border:1px solid var(--border-default);width:220px;min-width:100px;max-width:340px;height:32px;color:var(--text-primary);background:var(--bg-input);box-shadow:none;border-radius:4px;flex:180px;padding:5px 8px}.workbench-shell .cm-editor .cm-search .cm-textfield::placeholder{color:var(--text-muted)}.workbench-shell .cm-editor .cm-search button{border:1px solid var(--border-default);min-height:32px;color:var(--text-primary);background:var(--bg-raised);box-shadow:none;cursor:pointer;background-image:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:4px 8px;display:inline-flex}.workbench-shell .cm-editor .cm-search button:hover{background:var(--bg-hover)}.workbench-shell .cm-editor .cm-search label{white-space:nowrap;min-height:32px;color:var(--text-secondary);align-items:center;gap:5px;display:inline-flex}.workbench-shell .cm-editor .cm-search input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0}.workbench-shell .cm-editor .cm-search br{flex-basis:100%;height:0}.workbench-shell .cm-editor .cm-search button[name=close]{background:0 0;border-color:#0000;width:30px;height:32px;min-height:32px;padding:0;font-size:20px;line-height:1;position:absolute;top:10px;right:8px}.workbench-shell .cm-editor .cm-search button[name=close]:hover{background:var(--bg-hover)}.workbench-shell .cm-editor .cm-search :is(input,button):focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.workbench-shell .cm-editor .cm-searchMatch{color:var(--editor-find-fg);background-color:var(--editor-find-bg);box-shadow:inset 0 0 0 1px var(--editor-find-border)}.workbench-shell .cm-editor .cm-searchMatch-selected{color:var(--editor-find-current-fg);background-color:var(--editor-find-current-bg);outline:1px solid var(--editor-find-current-border);box-shadow:inset 0 0 0 1px var(--editor-find-current-border)}.workbench-shell .cm-editor .cm-searchMatch span{color:inherit;background-color:#0000}@media (width<=700px){.workbench-shell .cm-editor .cm-panel.cm-search{padding-right:60px}.workbench-shell .cm-editor .cm-search :is(button,label){min-height:44px}.workbench-shell .cm-editor .cm-search .cm-textfield{height:44px}.workbench-shell .cm-editor .cm-search button[name=close]{width:44px;height:44px}}
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-D978o95T.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-B3-a6uF0.js","assets/dist-CX_Hm4GS.js","assets/dist-Cus6_oaF.js","assets/dist-J6XWqRpB.js","assets/dist-scBkrwv-.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{c as t,d as n,f as r,l as i,n as a,r as o,u as s}from"./index-Cwt3-oUx.js";var c=e(r(),1);function l(e,t){return[t.search({top:!0}),e.EditorState.phrases.of({Find:`查找`,Replace:`替换为`,next:`下一处`,previous:`上一处`,all:`全部选中`,"match case":`区分大小写`,regexp:`正则表达式`,"by word":`全词匹配`,replace:`替换`,"replace all":`全部替换`,close:`关闭查找`,"current match":`当前匹配`,"on line":`所在行`})]}var u=n(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e,t,n=!1){let r=e=>n?`var(--git-diff-${e.slice(5)}, var(${e}))`:`var(${e})`;return e.HighlightStyle.define([{tag:t.tags.keyword,color:r(`--cm-keyword`)},{tag:t.tags.string,color:r(`--cm-string`)},{tag:t.tags.number,color:r(`--cm-number`)},{tag:t.tags.comment,color:r(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:r(`--cm-function`)},{tag:t.tags.typeName,color:r(`--cm-type`)},{tag:t.tags.className,color:r(`--cm-type`)},{tag:t.tags.propertyName,color:r(`--cm-property`)},{tag:t.tags.operator,color:r(`--cm-operator`)},{tag:t.tags.variableName,color:r(`--cm-variable`)}])}function h({path:e,value:n,onChange:r,jumpToLine:h,onSave:g,workspaceId:_,blame:v,onPosition:y,readOnly:b=!1,languageOverride:x}){let S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(void 0),E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(r),N=(0,c.useRef)(g);M.current=r,N.current=g;let[P,F]=(0,c.useState)(!1),[I,L]=(0,c.useState)(!1),[R,z]=(0,c.useState)(`0,0`),[B,V]=(0,c.useState)(0);(0,c.useEffect)(()=>{let t=!1,r,a,c,u,f;return(async()=>{try{let h=x??p(e),g=i(h),[v,y,P,I,R,B,H,U]=await Promise.all([s(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),s(()=>import(`./dist-B3-a6uF0.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),s(()=>import(`./dist-CX_Hm4GS.js`),__vite__mapDeps([3,0,1,2,4,5])),s(()=>import(`./dist-scBkrwv-.js`),__vite__mapDeps([6,0,1,2])),s(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([5,1,0,2,4])),s(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),g?g().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${h}:`,e),null)):Promise.resolve(null),o().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null))]);if(t||!S.current)return;w.current=y.EditorView,u=R,f=B,D.current=v.Annotation.define(),O.current=v.Transaction.addToHistory;let W=n.length<=d&&H!==null;a=new v.Compartment;let G=[y.lineNumbers(),y.highlightActiveLine(),y.drawSelection(),P.history(),y.keymap.of([P.indentWithTab,...P.defaultKeymap,...P.historyKeymap,...I.searchKeymap,{key:`Mod-s`,run:()=>(N.current(),!0)}]),y.EditorView.updateListener.of(e=>{e.docChanged&&!(D.current&&e.transactions.some(e=>e.annotation(D.current)===!0))&&M.current(e.state.doc.toString()),e.selectionSet&&z(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),y.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(G.push(l(v,I)),b&&G.push(v.EditorState.readOnly.of(!0),y.EditorView.editable.of(!1),y.EditorView.contentAttributes.of({tabindex:`0`})),U&&!b&&(c=new v.Compartment,G.splice(1,0,c.of([])),G.push(U.base)),H)try{G.push(H)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${h}:`,e),W=!1}if(W&&a&&u&&f)try{G.push(a.of(u.syntaxHighlighting(m(u,f))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${h}:`,e),W=!1}let K=T.current,q=K?.scope===JSON.stringify([_,e])&&K.state.doc.toString()===n,J=q?K.state.update({effects:v.StateEffect.reconfigure.of(G)}).state:v.EditorState.create({doc:n,extensions:G});if(r=new y.EditorView({state:J,parent:S.current}),q&&(r.scrollDOM.scrollTop=K.top,r.scrollDOM.scrollLeft=K.left),t){r.destroy();return}C.current=r,F(W),L(!0),k.current=U,A.current=c??null,j.current=null,V(e=>e+1);let Y=new MutationObserver(()=>{let e=C.current;if(e&&W&&a&&u&&f)try{e.dispatch({effects:a.reconfigure(u.syntaxHighlighting(m(u,f)))})}catch{}});E.current=Y,Y.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),t||L(!0)}})(),()=>{t=!0,E.current?.disconnect(),E.current=null,r&&(T.current={scope:JSON.stringify([_,e]),state:r.state,top:r.scrollDOM.scrollTop,left:r.scrollDOM.scrollLeft}),r?.destroy(),C.current=null,L(!1),S.current&&(S.current.textContent=``)}},[e,b,x]),(0,c.useEffect)(()=>{let e=C.current;if(!e)return;let t=e.state.doc.toString();t!==n&&e.dispatch({changes:{from:0,to:t.length,insert:n},annotations:D.current?D.current.of(!0):void 0})},[n]),(0,c.useEffect)(()=>{let e=C.current;if(!e||!h)return;let t=e.state.doc.line(Math.min(Math.max(1,h.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(h.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},effects:w.current?.scrollIntoView(n,{y:`start`,yMargin:Math.round(e.scrollDOM.clientHeight/3)})}),e.focus()},[h,I]);let H=!!(v&&v.state===`ready`&&v.response&&v.path===e&&v.workspaceId===_);(0,c.useEffect)(()=>{let t=C.current,n=k.current,r=A.current;if(!t||!n||!r)return;let i=v&&v.state===`ready`&&v.response&&v.path===e&&v.workspaceId===_?v.response:null,o=i?a(i):null;j.current!==o&&(j.current=o,t.dispatch({effects:[n.setBlame.of(o),r.reconfigure(o?n.gutter:[])]}))},[v?.state,v?.response,v?.path,v?.workspaceId,e,_,B]);let U=C.current?.state.doc.toString()??n,W=U.length<=f?U:U.slice(0,f),G=x??p(e),K=t(G),q=C.current?.state,J=q?.selection.main.head,Y=J===void 0?void 0:q?.doc.lineAt(J),X=Y?.number,Z=J!==void 0&&Y?J-Y.from+1:void 0;return(0,c.useEffect)(()=>{I&&X!==void 0&&Z!==void 0&&y?.({line:X,column:Z,language:P&&K||`纯文本`,highlight:P?G:`plain`})},[I,X,Z,P,K,G,y]),(0,c.useEffect)(()=>()=>y?.(),[y]),(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":W,"data-file-content-truncated":U.length>f?`1`:`0`,"data-file-selection":R,"data-file-editor-ready":I?`1`:`0`,"data-file-blame-gutter":H?`1`:void 0,onMouseDown:()=>C.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:S,"aria-label":`${b?`查看`:`编辑`} ${e}`}),(!I||!y)&&(0,u.jsxs)(`div`,{className:`file-editor-status`,children:[!I&&(0,u.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),I&&J!==void 0&&Y&&(0,u.jsxs)(`span`,{children:[`第 `,Y.number,` 行,第 `,J-Y.from+1,` 列`]}),I&&!P&&(0,u.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),I&&P&&K&&(0,u.jsx)(`span`,{"data-file-highlight-status":G,children:K})]})]})}export{h as CodeMirrorEditor,l as t,m as themeHighlightStyle};
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{d as t,f as n,i as r,l as i,p as a,r as o,u as s}from"./index-MxsSEfDh.js";var c=e(a(),1);function l(e,t){return[t.search({top:!0}),e.EditorState.phrases.of({Find:`查找`,Replace:`替换为`,next:`下一处`,previous:`上一处`,all:`全部选中`,"match case":`区分大小写`,regexp:`正则表达式`,"by word":`全词匹配`,replace:`替换`,"replace all":`全部替换`,close:`关闭查找`,"current match":`当前匹配`,"on line":`所在行`})]}var u=n(),d=262144,f=131072;function p(e){return e.split(`.`).pop()?.toLowerCase()??``}function m(e,t,n=!1){let r=e=>n?`var(--git-diff-${e.slice(5)}, var(${e}))`:`var(${e})`;return e.HighlightStyle.define([{tag:t.tags.keyword,color:r(`--cm-keyword`)},{tag:t.tags.string,color:r(`--cm-string`)},{tag:t.tags.number,color:r(`--cm-number`)},{tag:t.tags.comment,color:r(`--cm-comment`),fontStyle:`italic`},{tag:t.tags.function(t.tags.variableName),color:r(`--cm-function`)},{tag:t.tags.typeName,color:r(`--cm-type`)},{tag:t.tags.className,color:r(`--cm-type`)},{tag:t.tags.propertyName,color:r(`--cm-property`)},{tag:t.tags.operator,color:r(`--cm-operator`)},{tag:t.tags.variableName,color:r(`--cm-variable`)}])}function h({path:e,value:n,onChange:a,jumpToLine:h,onSave:g,workspaceId:_,blame:v,onPosition:y,readOnly:b=!1,languageOverride:x}){let S=(0,c.useRef)(null),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(void 0),E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(null),A=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(a),N=(0,c.useRef)(g);M.current=a,N.current=g;let[P,F]=(0,c.useState)(!1),[I,L]=(0,c.useState)(!1),[R,z]=(0,c.useState)(`0,0`),[B,V]=(0,c.useState)(0);(0,c.useEffect)(()=>{let i=!1,a,o,c,u,f;return(async()=>{try{let h=x??p(e),g=s(h),[v,y,P,I,R,B,H,U]=await Promise.all([t(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),t(()=>import(`./dist-B3-a6uF0.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),t(()=>import(`./dist-CX_Hm4GS.js`),__vite__mapDeps([3,0,1,2,4,5])),t(()=>import(`./dist-scBkrwv-.js`),__vite__mapDeps([6,0,1,2])),t(()=>import(`./dist-J6XWqRpB.js`).then(e=>e.d),__vite__mapDeps([5,1,0,2,4])),t(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),g?g().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${h}:`,e),null)):Promise.resolve(null),r().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null))]);if(i||!S.current)return;w.current=y.EditorView,u=R,f=B,D.current=v.Annotation.define(),O.current=v.Transaction.addToHistory;let W=n.length<=d&&H!==null;o=new v.Compartment;let G=[y.lineNumbers(),y.highlightActiveLine(),y.drawSelection(),P.history(),y.keymap.of([P.indentWithTab,...P.defaultKeymap,...P.historyKeymap,...I.searchKeymap,{key:`Mod-s`,run:()=>(N.current(),!0)}]),y.EditorView.updateListener.of(e=>{e.docChanged&&!(D.current&&e.transactions.some(e=>e.annotation(D.current)===!0))&&M.current(e.state.doc.toString()),e.selectionSet&&z(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),y.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(G.push(l(v,I)),b&&G.push(v.EditorState.readOnly.of(!0),y.EditorView.editable.of(!1),y.EditorView.contentAttributes.of({tabindex:`0`})),U&&!b&&(c=new v.Compartment,G.splice(1,0,c.of([])),G.push(U.base)),H)try{G.push(H)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${h}:`,e),W=!1}if(W&&o&&u&&f)try{G.push(o.of(u.syntaxHighlighting(m(u,f))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${h}:`,e),W=!1}let K=T.current,q=K?.scope===JSON.stringify([_,e])&&K.state.doc.toString()===n,J=q?K.state.update({effects:v.StateEffect.reconfigure.of(G)}).state:v.EditorState.create({doc:n,extensions:G});if(a=new y.EditorView({state:J,parent:S.current}),q&&(a.scrollDOM.scrollTop=K.top,a.scrollDOM.scrollLeft=K.left),i){a.destroy();return}C.current=a,F(W),L(!0),k.current=U,A.current=c??null,j.current=null,V(e=>e+1);let Y=new MutationObserver(()=>{let e=C.current;if(e&&W&&o&&u&&f)try{e.dispatch({effects:o.reconfigure(u.syntaxHighlighting(m(u,f)))})}catch{}});E.current=Y,Y.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),i||L(!0)}})(),()=>{i=!0,E.current?.disconnect(),E.current=null,a&&(T.current={scope:JSON.stringify([_,e]),state:a.state,top:a.scrollDOM.scrollTop,left:a.scrollDOM.scrollLeft}),a?.destroy(),C.current=null,L(!1),S.current&&(S.current.textContent=``)}},[e,b,x]),(0,c.useEffect)(()=>{let e=C.current;if(!e)return;let t=e.state.doc.toString();t!==n&&e.dispatch({changes:{from:0,to:t.length,insert:n},annotations:D.current?D.current.of(!0):void 0})},[n]),(0,c.useEffect)(()=>{let e=C.current;if(!e||!h)return;let t=e.state.doc.line(Math.min(Math.max(1,h.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(h.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},effects:w.current?.scrollIntoView(n,{y:`start`,yMargin:Math.round(e.scrollDOM.clientHeight/3)})}),e.focus()},[h,I]);let H=!!(v&&v.state===`ready`&&v.response&&v.path===e&&v.workspaceId===_);(0,c.useEffect)(()=>{let t=C.current,n=k.current,r=A.current;if(!t||!n||!r)return;let i=v&&v.state===`ready`&&v.response&&v.path===e&&v.workspaceId===_?v.response:null,a=i?o(i):null;j.current!==a&&(j.current=a,t.dispatch({effects:[n.setBlame.of(a),r.reconfigure(a?n.gutter:[])]}))},[v?.state,v?.response,v?.path,v?.workspaceId,e,_,B]);let U=C.current?.state.doc.toString()??n,W=U.length<=f?U:U.slice(0,f),G=x??p(e),K=i(G),q=C.current?.state,J=q?.selection.main.head,Y=J===void 0?void 0:q?.doc.lineAt(J),X=Y?.number,Z=J!==void 0&&Y?J-Y.from+1:void 0;return(0,c.useEffect)(()=>{I&&X!==void 0&&Z!==void 0&&y?.({line:X,column:Z,language:P&&K||`纯文本`,highlight:P?G:`plain`})},[I,X,Z,P,K,G,y]),(0,c.useEffect)(()=>()=>y?.(),[y]),(0,u.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":W,"data-file-content-truncated":U.length>f?`1`:`0`,"data-file-selection":R,"data-file-editor-ready":I?`1`:`0`,"data-file-blame-gutter":H?`1`:void 0,onMouseDown:()=>C.current?.focus(),children:[(0,u.jsx)(`div`,{className:`file-cm`,ref:S,"aria-label":`${b?`查看`:`编辑`} ${e}`}),(!I||!y)&&(0,u.jsxs)(`div`,{className:`file-editor-status`,children:[!I&&(0,u.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),I&&J!==void 0&&Y&&(0,u.jsxs)(`span`,{children:[`第 `,Y.number,` 行,第 `,J-Y.from+1,` 列`]}),I&&!P&&(0,u.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),I&&P&&K&&(0,u.jsx)(`span`,{"data-file-highlight-status":G,children:K})]})]})}export{h as CodeMirrorEditor,l as t,m as themeHighlightStyle};