@evandu/super-pi 0.1.300 → 0.1.301
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/client/.super-pi-client-sources.json +14 -11
- package/dist/client/assets/CodeMirrorEditor-C8sidScW.css +1 -0
- package/dist/client/assets/CodeMirrorEditor-Y2IIf7Zj.js +2 -0
- package/dist/client/assets/{GitDiffEditor-BuozIMBT.js → GitDiffEditor-DtcBKTbz.js} +4 -4
- package/dist/client/assets/{index-BYAipWq-.js → index-BJds5OrY.js} +34 -34
- package/dist/client/assets/index-BV-OeWsY.css +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/CodeMirrorEditor-C-L7B565.css +0 -1
- package/dist/client/assets/CodeMirrorEditor-CyYniLtN.js +0 -2
- package/dist/client/assets/index-Dcs7gmUf.css +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "7e75e2d7a920147a0b28ff138ba19b50406138c520b243ad5f96eb48e68bf3ad",
|
|
3
3
|
"files": {
|
|
4
4
|
"src/client/AnchoredPopover.tsx": "3d683cc9e4305678141c83987a37a36b3da30e20d7bd17ea8e48a72504475605",
|
|
5
5
|
"src/client/App.tsx": "34e1afd60c192923ca8731b43076a0de17c09dd657b2302b4c6fbadbf975aa29",
|
|
6
6
|
"src/client/BackgroundReturnBatch.tsx": "70c4ffb2f93fa4a55e9527c652942c67cea60a4a1b603576603751bcb8be9116",
|
|
7
7
|
"src/client/CacheWarmingSettings.tsx": "cce26c4547634b76c08c681a4b9605f884d8502f554f12ff8c30cbd2fd0bd9c0",
|
|
8
|
-
"src/client/CodeMirrorEditor.tsx": "
|
|
8
|
+
"src/client/CodeMirrorEditor.tsx": "e2de9f6901a9506900ca53633995897e8fb06a73a86dd89aedc2983ac4104643",
|
|
9
9
|
"src/client/ContextMeter.tsx": "439384a25fead8d10e9d1f2fcc1b7a3228b9c804a033b9e0b5d2dbc68ba9d959",
|
|
10
10
|
"src/client/DesktopPanel.tsx": "1011e9409418afa64cd7c84d8131223b3099bd0842c24ebbda86e38b45f37e1c",
|
|
11
11
|
"src/client/EditorActions.tsx": "64b529d8a5e0c18d82bd5863992efc3764a1635043b01ffe713baa0dbfab2f4f",
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
"src/client/FeishuPanel.tsx": "3b3257da36bf863e004a33a4c1d721db364b4449fb23f0805cb74b973a2ed2da",
|
|
15
15
|
"src/client/FileMentionMenu.tsx": "d400e7afb31008eda49d4b531eceda65a926b877177d0cffd9a8056b55161c3e",
|
|
16
16
|
"src/client/FileWorkbenchChrome.tsx": "0863c988bdc50962e3dab365e918ad6de6aee7cc2d0d4d3cce049fa3529d2b6b",
|
|
17
|
-
"src/client/FilesPanel.tsx": "
|
|
18
|
-
"src/client/
|
|
17
|
+
"src/client/FilesPanel.tsx": "2bb31b05987501c5e984bca8b96668807d15d841d12d0872f296106601536499",
|
|
18
|
+
"src/client/FindControls.tsx": "d98c14e74e1d026c48a487d112974cc70f73889de6daf3446b501fd66b01e4db",
|
|
19
|
+
"src/client/GitDiffEditor.tsx": "854451ad639833e465e4dc553731663fbafc0994d8d183f0491d1ca6e7fdd550",
|
|
19
20
|
"src/client/GitPanel.tsx": "64670de36385d34f48967d3b969e045ebf7f67125b2727871710188e672cd35b",
|
|
20
21
|
"src/client/GroupChatPane.tsx": "8a9b433fb31ba0ec0ec3e6b9a5930aa89646821873214e1a5a305e8193619633",
|
|
21
22
|
"src/client/GroupExecutionPane.tsx": "2f593d99a5fdd5d37983a93b523c94747d4679135017d9711eed7334f8da29a9",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"src/client/TeamHandoffCard.tsx": "925284ab81c7845c5cfdcfa1f631e124bb02d7d86b03ede8f3fbabc194c32dca",
|
|
56
57
|
"src/client/TerminalPanel.tsx": "13f288575499103254597e38813ef5cf5fe2b1230e343ede767b6b55a1b035a2",
|
|
57
58
|
"src/client/ToolGlyph.tsx": "a1100b61f1eee9520e7323385f667898763bfd69068f22de7dd36db2d4096c76",
|
|
58
|
-
"src/client/TranscriptFind.tsx": "
|
|
59
|
+
"src/client/TranscriptFind.tsx": "d9c7f699ac55f27966d55822ca61092332595067c7dfd88e37f73cc2e9c1eb34",
|
|
59
60
|
"src/client/WorkbenchCards.tsx": "b79b49207066e53dfecffc60f709bf98c20c2f66fd76aa0e79e71783ec26d4c2",
|
|
60
61
|
"src/client/WorkbenchChrome.tsx": "77527984dd5570fbe0f8d92464a87b70460ce5dcf5bd017c2c3516bc04ffae9c",
|
|
61
62
|
"src/client/WorkbenchSearch.tsx": "cd0d85a54de775fd4af1da3c75c7465b1bc81e42d3947ea015f72b85089ad19a",
|
|
@@ -76,14 +77,16 @@
|
|
|
76
77
|
"src/client/editor-languages.ts": "d5319cfd9b9f3b07c2599ba64ec49a9038304d09fa1702302f3b2b97493d0a69",
|
|
77
78
|
"src/client/editor-models.ts": "c566e295effc5fee898b5249d26f5bd42983181e623d5e7d44998f133d3fb0e8",
|
|
78
79
|
"src/client/editor-preferences.ts": "c8dd6630d085de66fe0c4ed846f85975ba9bc7c388ad88cd0b945d78df528357",
|
|
79
|
-
"src/client/editor-search.css": "
|
|
80
|
-
"src/client/editor-search.ts": "
|
|
80
|
+
"src/client/editor-search.css": "fae370a26281d83b7cb5df9077cf0733541cc79447ebf90f76e5bda2021549f5",
|
|
81
|
+
"src/client/editor-search.ts": "522397ca39d3b08bc8117ffad91c027e4d113641358b6f57901ccbf6555ed153",
|
|
81
82
|
"src/client/editor-workbench.css": "51050b9a48402c86801afa10e95467f94200cd11e202084257ff631071c27ff9",
|
|
82
83
|
"src/client/editor-workbench.ts": "99a9bcf92ce36ee9cdb26ae982345a6c95aecfbe9f32d55ce52a08b5c8afa43a",
|
|
83
84
|
"src/client/errors.ts": "2ea215b8676cca8841b93c780563f1f2031320270d4d0865221f6a12b65c6f22",
|
|
84
85
|
"src/client/file-diff-layout.css": "aee864e990d66d90380aeb991181cce39e2a29d02ea85095a4bf0c1d59c9ed50",
|
|
85
86
|
"src/client/file-diff.ts": "b1fd62dd0f561c567f249d98364068c947e31758fa9f1644d27250679e0f62a4",
|
|
86
87
|
"src/client/file-icons.tsx": "65e571a5378723511caef0e4bdbecdd4adba9461a46db878d65a948fc99fcb65",
|
|
88
|
+
"src/client/find-controls.css": "d173162f4c4c13f279ddbeca1c4a7b6fde63e5751e3403141a87cd0f7992b007",
|
|
89
|
+
"src/client/find-controls.ts": "517ea11ffd61ffecefda431fe1108800ee9ddce6cf16f410452874d102387531",
|
|
87
90
|
"src/client/git-diff-visual.css": "da7d897e2fdb170cdd7e73493190a1c04cad2f9e2eb5e5bc6599c14bd6d030e2",
|
|
88
91
|
"src/client/git-panel-memory.ts": "3c441cb5e7be34d81900671df585f66317d59a3b795615f7273e764cb27d47f1",
|
|
89
92
|
"src/client/git-workbench.css": "adc9725e880304904cb5785412785f3d0e56332cd454c7ef0ce2d20681049881",
|
|
@@ -112,7 +115,7 @@
|
|
|
112
115
|
"src/client/slash-commands.ts": "daa5a8e6f90605a9a3921c977b24f69e9d9718e31a62a4b8e74a71a1faf0ce66",
|
|
113
116
|
"src/client/software-update.css": "a3bb42e3bc832639d23a54a4e91216192cbb05efa1d41151e64571d883866258",
|
|
114
117
|
"src/client/status-bar-menu.css": "05acaa1cc032a026ad3328d9d2c32a96e2e9e5ef335536646eacad0a33af76af",
|
|
115
|
-
"src/client/styles.css": "
|
|
118
|
+
"src/client/styles.css": "aa3ab7caf0bf451f561994a3e05760cb2d074018bb8e0812a1370f14c59aeb3c",
|
|
116
119
|
"src/client/system-notifications.ts": "5c3d1b5575fd6f42a1d6176f599f918a35054c23281309f78cbb6899d8d2da21",
|
|
117
120
|
"src/client/terminal-emulator.ts": "ffcc4f5fbddaf25cebcc9e03dbe5d7d0ad2c21586f5d169e57c04c82e2308b3b",
|
|
118
121
|
"src/client/theme.tsx": "4f806b512d894b1f34b86f9d215af541618bc68443f96adde230fb7efb9f5a77",
|
|
@@ -121,13 +124,13 @@
|
|
|
121
124
|
"src/client/tool-sharing.ts": "011212825dbbffe18c8f15aca721c02938ab6273fb5607b072a1e7b8b1853640",
|
|
122
125
|
"src/client/tool-shortcuts.ts": "4422d29ba770af6acef18e66c6be05a9bc021f7323c7ca28bbe7668f26d4adb8",
|
|
123
126
|
"src/client/tools.ts": "58fe41f0edbd490e3fab7f12f258b1dbc2163b653553b03ac61caf1543618e50",
|
|
124
|
-
"src/client/transcript-find.css": "
|
|
127
|
+
"src/client/transcript-find.css": "75d82b4f08dd5e919753cc111462ea551c816adcfb17d3e4f49e472abb541b25",
|
|
125
128
|
"src/client/types.ts": "80b0794c902091acd2d9368b489d672a83bf7568933b4e013fd7fa56fd1119ef",
|
|
126
129
|
"src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
|
|
127
130
|
"src/client/workbench-cards.css": "ffabb0d8f68189a61ee2730bcfb035eda5454915e3aa2e77b17ae63c5b62c3ab",
|
|
128
131
|
"src/client/workbench-memory.ts": "72c9b52cc28f8c8e90636c2425f0d14c4b5af1e36bff9bf8ad272d0811e60099",
|
|
129
132
|
"src/client/workbench-navigation.ts": "fff6e8546b2fb19a5db474764628bd10e147779dc26512aa6de9e3a0145a1de5",
|
|
130
|
-
"src/client/workbench-search-panel.css": "
|
|
133
|
+
"src/client/workbench-search-panel.css": "06705c7fb52e38ecbac24db3c422f9fdf93b696e50414f7652395abbd91a9bcb"
|
|
131
134
|
},
|
|
132
|
-
"recordedAt": "2026-11-
|
|
135
|
+
"recordedAt": "2026-11-26T06:25:07.596Z"
|
|
133
136
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.workbench-shell .cm-editor .cm-workbench-selectedText,.workbench-shell .cm-editor .cm-workbench-selectedText *{background:var(--selected)!important;color:var(--bg-app)!important}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-panels{background:var(--bg-panel);color:var(--text-primary)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-panels-top{border-bottom:1px solid var(--border-default)}.workbench-shell .workbench-editor-search{z-index:10;pointer-events:none;width:min(420px,100% - 24px);height:auto;min-height:0;max-height:calc(100% - 16px);top:8px;left:auto;right:12px;overflow:auto;position:absolute!important}.workbench-shell .workbench-editor-search:has(.cm-panels){pointer-events:auto}.workbench-shell .workbench-editor-search .cm-panels-top{border:1px solid var(--border-default);width:100%;box-shadow:0 4px 12px var(--shadow-faint);pointer-events:auto;border-radius:5px;max-height:100%;position:relative;overflow:auto}.git-diff-merge-wrap[data-git-diff-layout=split] .workbench-editor-search{width:min(420px,50% - 24px)}.git-diff-merge-wrap[data-git-diff-layout=split] [data-editor-find-host=original]{right:calc(50% + 12px)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search label{display:none!important}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search .find-controls{display:contents}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search .find-controls button{background:0 0;border-color:#0000;width:30px;min-width:30px;padding:0}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search .find-controls button[aria-pressed=true]{background:var(--selected-bg);border-color:var(--selected-border)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search [data-find-option=expanded]{order:-2}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search input[name=search]{order:-1}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search :is(button[name=next],button[name=prev]){width:30px;padding:0}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search [data-find-error]{color:var(--danger);flex-basis:100%}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search:not([data-editor-search-expanded=true]) :is(label,br,input[name=replace],button[name=replace],button[name=replaceAll],button[name=select]){display:none}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search:not([data-editor-search-expanded=true]) .cm-textfield{flex-basis:120px;width:160px;min-width:80px}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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 4px;padding:10px 46px 10px 12px;display:flex;position:relative}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search :is(input,button,label){font:inherit;margin:0}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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 :is(.cm-editor,.workbench-editor-search) .cm-search .cm-textfield::placeholder{color:var(--text-muted)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-panel.cm-search input[name=search]{flex:80px;width:120px;min-width:80px;max-width:none}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search :is(input[name=replace],button[name=replace],button[name=replaceAll]){order:2}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search button[name=select]{order:3}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search br{order:1;width:100%;display:block}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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 :is(.cm-editor,.workbench-editor-search) .cm-search button:hover{background:var(--bg-hover)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search label{white-space:nowrap;min-height:32px;color:var(--text-secondary);align-items:center;gap:5px;display:inline-flex}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search br{flex-basis:100%;height:0}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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 :is(.cm-editor,.workbench-editor-search) .cm-search button[name=close]:hover{background:var(--bg-hover)}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search :is(input,button):focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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-selectionMatch{background-color:var(--editor-find-bg);color:var(--editor-find-fg);box-shadow:inset 0 0 0 1px var(--editor-find-border)}.workbench-shell .cm-editor .cm-selectionMatch span{color:inherit;background-color:#0000}.workbench-shell :is(.cm-editor,.workbench-editor-search) .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 :is(.cm-editor,.workbench-editor-search) .cm-searchMatch span{color:inherit;background-color:#0000}@media (width<=700px){.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-panel.cm-search{padding-right:60px}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search :is(button,label){min-height:44px}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search .cm-textfield{height:44px}.workbench-shell :is(.cm-editor,.workbench-editor-search) .cm-search button[name=close]{width:44px;height:44px}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-D978o95T.js","assets/rolldown-runtime-XKyaHtl9.js","assets/dist-DTIPfQj7.js","assets/dist-S5ntGzJB.js","assets/dist-Cus6_oaF.js","assets/dist-DP4hrTBF.js","assets/dist-Qjm1p8SR.js","assets/dist-BJHpSQV1.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{_ as t,c as n,g as r,h as i,i as a,l as o,o as s,r as c,s as l,u,v as d,y as f}from"./index-BJds5OrY.js";var p=e(f(),1);function m(e,t,n,r){return[n.EditorView.decorations.compute([`selection`,`doc`],e=>n.Decoration.set(e.selection.ranges.filter(e=>!e.empty).map(e=>n.Decoration.mark({class:`cm-workbench-selectedText`}).range(e.from,e.to)),!0)),n.ViewPlugin.define(e=>{let n=null,i,a=!1,s=e=>{n&&(e===`expanded`?(a=!a,l()):n.querySelector(`input[name="${e===`caseSensitive`?`case`:e===`wholeWord`?`word`:`re`}"]`)?.click())},c=e=>{let t=o(e);t&&(e.preventDefault(),e.stopPropagation(),s(t))},l=()=>{if(!n||!i)return;let r=t.getSearchQuery(e.state);if(n.dataset.editorSearchExpanded=String(a),i.update({caseSensitive:r.caseSensitive,wholeWord:r.wholeWord,regexp:r.regexp,expanded:a}),n.querySelector(`[data-find-error]`)?.remove(),r.search&&!r.valid){let e=document.createElement(`output`);e.dataset.findError=``,e.setAttribute(`role`,`alert`),e.textContent=`正则表达式无效`,n.append(e)}},d=()=>{let o=r.querySelector(`.cm-panel.cm-search`);if(o===n)return;if(n?.removeEventListener(`keydown`,c,!0),i?.destroy(),n=o,!n){i=void 0;return}for(let[e,t,r]of[[`next`,`↓`,`下一处`],[`prev`,`↑`,`上一处`]]){let i=n.querySelector(`button[name="${e}"]`);i&&(i.textContent=t,i.setAttribute(`aria-label`,r),i.title=r)}let d=document.createElement(`span`);d.dataset.findControls=``,n.prepend(d);let f=t.getSearchQuery(e.state);a=!1,i=u(d,{...f,expanded:a},s),n.addEventListener(`keydown`,c,!0),l()},f=new MutationObserver(d);return f.observe(r,{childList:!0,subtree:!0}),d(),{update(){l()},destroy(){f.disconnect(),n?.removeEventListener(`keydown`,c,!0),i?.destroy()}}}),e.Prec.highest(n.keymap.of([{key:`Mod-Shift-l`,run:t.selectSelectionMatches},{key:`Mod-h`,scope:`editor search-panel`,run:e=>(t.searchPanelOpen(e.state)||t.openSearchPanel(e),requestAnimationFrame(()=>{e.dom.isConnected&&r.querySelector(`[data-editor-search-options][aria-expanded="false"]`)?.click()}),!0)},...[`c`,`w`,`r`].map(e=>({key:`Alt-${e}`,run:n=>{t.searchPanelOpen(n.state)||t.openSearchPanel(n);let r=t.getSearchQuery(n.state);return n.dispatch({effects:t.setSearchQuery.of(new t.SearchQuery({...r,...e===`c`?{caseSensitive:!r.caseSensitive}:e===`w`?{wholeWord:!r.wholeWord}:{regexp:!r.regexp}}))}),!0}}))])),n.panels({topContainer:r}),n.EditorView.scrollMargins.of(()=>({top:r.querySelector(`.cm-search`)?Math.min(r.getBoundingClientRect().height+8,Math.max(0,(r.parentElement?.clientHeight??0)-32)):0})),t.highlightSelectionMatches({wholeWords:!0,minSelectionLength:1,maxMatches:1e3}),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":`所在行`})]}function h(e,t,r,i,a){let o=new e.Compartment,c=()=>{let n=s();return[e.EditorState.tabSize.of(n.tabSize),r.indentUnit.of(n.indent===`tabs`?` `:` `.repeat(n.tabSize)),n.wrap?t.EditorView.lineWrapping:[],n.whitespace?[t.highlightWhitespace(),t.highlightTrailingWhitespace()]:[]]};return[e.EditorState.allowMultipleSelections.of(!0),t.rectangularSelection(),t.crosshairCursor({key:`Alt`}),e.EditorState.phrases.of({"folded code":`已折叠代码`,unfold:`展开代码`,"Fold line":`折叠代码`,"Unfold line":`展开代码`}),t.highlightActiveLineGutter(),t.highlightSpecialChars(),t.dropCursor(),r.bracketMatching(),r.indentOnInput(),r.foldGutter(),i.closeBrackets(),e.Prec.highest(t.keymap.of([...i.closeBracketsKeymap,...r.foldKeymap,{key:`Alt-z`,run:()=>(l({wrap:!s().wrap}),!0)},{key:`Mod-Shift-z`,run:a.redo},{key:`Mod-y`,run:a.redo}])),o.of(c()),t.ViewPlugin.define(e=>({destroy:n(()=>{e.dispatch({effects:o.reconfigure(c())})})}))]}var g=new Map;function ee(e){let t=g.get(e);return t&&(g.delete(e),g.set(e,t)),t}function _(e,t){g.delete(e),g.set(e,t);let n=[...g.values()].reduce((e,t)=>e+t.state.doc.length,0);for(;g.size>32||n>16777216;){let e=g.keys().next().value;n-=g.get(e).state.doc.length,g.delete(e)}}var v=d(),te=262144,y=131072;function b(e){return e.split(`.`).pop()?.toLowerCase()??``}function x(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 S({path:e,value:n,onChange:o,jumpToLine:s,onSave:l,workspaceId:u,cwd:d=``,blame:f,onPosition:g,onView:S,readOnly:C=!1,languageOverride:w}){let T=(0,p.useRef)(null),E=(0,p.useRef)(null),D=(0,p.useRef)(null),ne=(0,p.useRef)(null),O=JSON.stringify([u,d,e]),k=(0,p.useRef)(void 0),A=(0,p.useRef)(null),j=(0,p.useRef)(null),re=(0,p.useRef)(null),M=(0,p.useRef)(null),N=(0,p.useRef)(null),P=(0,p.useRef)(null),F=(0,p.useRef)(o),ie=(0,p.useRef)(l),I=(0,p.useRef)(!1),L=(0,p.useRef)(S);L.current=S,F.current=o,ie.current=l;let[R,ae]=(0,p.useState)(!1),[z,B]=(0,p.useState)(!1),[V,H]=(0,p.useState)(`0,0`),[U,oe]=(0,p.useState)(0),[W,G]=(0,p.useState)(1);(0,p.useEffect)(()=>{let i=!1,o,s,c,l,u;return(async()=>{try{let d=w??b(e),f=r(d),[p,g,_,v,y,S,R,z,V]=await Promise.all([t(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),t(()=>import(`./dist-DTIPfQj7.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),t(()=>import(`./dist-S5ntGzJB.js`),__vite__mapDeps([3,0,1,2,4,5])),t(()=>import(`./dist-Qjm1p8SR.js`),__vite__mapDeps([6,0,1,2])),t(()=>import(`./dist-DP4hrTBF.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])),f?f().catch(e=>(console.warn(`[CodeMirror] Failed to load language for .${d}:`,e),null)):Promise.resolve(null),a().catch(e=>(console.warn(`[CodeMirror] Failed to build the blame extension:`,e),null)),t(()=>import(`./dist-BJHpSQV1.js`).then(e=>e.r),__vite__mapDeps([7,1,0,2,5,4]))]);if(i||!T.current||!E.current)return;ne.current=g.EditorView,l=y,u=S,j.current=p.Annotation.define(),re.current=p.Transaction.addToHistory;let U=n.length<=te&&R!==null;s=new p.Compartment;let W=[g.lineNumbers(),g.highlightActiveLine(),g.drawSelection(),_.history(),g.keymap.of([_.indentWithTab,..._.defaultKeymap,..._.historyKeymap,...v.searchKeymap,{key:`Mod-s`,run:()=>(ie.current(),!0)}]),g.EditorView.updateListener.of(e=>{e.docChanged&&!(j.current&&e.transactions.some(e=>e.annotation(j.current)===!0))&&F.current(e.state.doc.toString()),e.selectionSet&&H(`${e.state.selection.main.from},${e.state.selection.main.to}`)}),g.EditorView.domEventHandlers({mousedown:(e,t)=>(t.focus(),!1)})];if(W.push(g.EditorView.updateListener.of(e=>{e.selectionSet&&G(e.state.selection.ranges.length),e.docChanged?I.current=!1:e.selectionSet&&(I.current=e.transactions.some(e=>e.isUserEvent(`select.search`)||e.isUserEvent(`select.pointer`)))}),m(p,v,g,E.current),h(p,g,y,V,_)),C&&W.push(p.EditorState.readOnly.of(!0),g.EditorView.editable.of(!1),g.EditorView.contentAttributes.of({tabindex:`0`})),z&&!C&&(c=new p.Compartment,W.splice(1,0,c.of([])),W.push(z.base)),R)try{W.push(R)}catch(e){console.warn(`[CodeMirror] Failed to apply language extension for .${d}:`,e),U=!1}if(U&&s&&l&&u)try{W.push(s.of(l.syntaxHighlighting(x(l,u))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${d}:`,e),U=!1}let K=ee(O),q=K&&K.state.doc.toString()===n,J=q?K.state.update({effects:p.StateEffect.reconfigure.of(W)}).state:p.EditorState.create({doc:n,extensions:W});if(o=new g.EditorView({state:J,parent:T.current}),k.current=q?K.jump:void 0,G(o.state.selection.ranges.length),H(`${o.state.selection.main.from},${o.state.selection.main.to}`),q&&(o.scrollDOM.scrollTop=K.top,o.scrollDOM.scrollLeft=K.left,k.current=K.jump),i){o.destroy();return}D.current=o,L.current?.(o),ae(U),B(!0),M.current=z,N.current=c??null,P.current=null,oe(e=>e+1);let Y=new MutationObserver(()=>{let e=D.current;if(e&&U&&s&&l&&u)try{e.dispatch({effects:s.reconfigure(l.syntaxHighlighting(x(l,u)))})}catch{}});A.current=Y,Y.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),i||B(!0)}})(),()=>{i=!0,A.current?.disconnect(),A.current=null,o&&_(O,{state:o.state,top:o.scrollDOM.scrollTop,left:o.scrollDOM.scrollLeft,jump:k.current}),o?.destroy(),D.current=null,L.current?.(),B(!1),T.current&&(T.current.textContent=``)}},[O,C,w]),(0,p.useEffect)(()=>{let e=D.current;if(!e)return;let t=e.state.doc.toString();t!==n&&e.dispatch({changes:{from:0,to:t.length,insert:n},annotations:j.current?j.current.of(!0):void 0})},[n]),(0,p.useEffect)(()=>{let e=D.current;if(!e||!s||k.current===s.request)return;k.current=s.request;let t=e.state.doc.line(Math.min(Math.max(1,s.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(s.column??1)-1);e.dispatch({selection:{anchor:t.to,head:n},effects:ne.current?.scrollIntoView(n,{y:`start`,yMargin:Math.round(e.scrollDOM.clientHeight/3)})}),e.focus()},[s,z]);let K=!!(f&&f.state===`ready`&&f.response&&f.path===e&&f.workspaceId===u);(0,p.useEffect)(()=>{let t=D.current,n=M.current,r=N.current;if(!t||!n||!r)return;let i=f&&f.state===`ready`&&f.response&&f.path===e&&f.workspaceId===u?f.response:null,a=i?c(i):null;P.current!==a&&(P.current=a,t.dispatch({effects:[n.setBlame.of(a),r.reconfigure(a?n.gutter:[])]}))},[f?.state,f?.response,f?.path,f?.workspaceId,e,u,U]);let q=D.current?.state.doc.toString()??n,J=q.length<=y?q:q.slice(0,y),Y=w??b(e),X=i(Y),Z=D.current?.state,Q=Z?.selection.main.head,$=Q===void 0?void 0:Z?.doc.lineAt(Q),se=$?.number,ce=Q!==void 0&&$?Q-$.from+1:void 0;return(0,p.useEffect)(()=>{let e=D.current;if(z&&e&&(!s||k.current===s.request)){let t=e.state.selection.main.head,n=e.state.doc.lineAt(t);g?.({line:n.number,column:t-n.from+1,language:R&&X||`纯文本`,highlight:R?Y:`plain`,navigation:I.current,selections:e.state.selection.ranges.length})}},[z,se,ce,R,X,Y,g,W,s?.request]),(0,p.useEffect)(()=>()=>g?.(),[g]),(0,v.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":J,"data-file-content-truncated":q.length>y?`1`:`0`,"data-file-selection":V,"data-editor-selection-count":W,"data-file-editor-ready":z?`1`:`0`,"data-file-blame-gutter":K?`1`:void 0,onMouseDown:e=>{e.target.closest(`.cm-panels`)||D.current?.focus()},children:[(0,v.jsx)(`div`,{className:`file-cm`,ref:T,"aria-label":`${C?`查看`:`编辑`} ${e}`}),(0,v.jsx)(`div`,{className:`workbench-editor-search`,ref:E,"data-editor-find-host":`file`}),(!z||!g)&&(0,v.jsxs)(`div`,{className:`file-editor-status`,children:[!z&&(0,v.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),z&&Q!==void 0&&$&&(0,v.jsxs)(`span`,{children:[`第 `,$.number,` 行,第 `,Q-$.from+1,` 列`]}),z&&!R&&(0,v.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),z&&R&&X&&(0,v.jsx)(`span`,{"data-file-highlight-status":Y,children:X})]})]})}export{S as CodeMirrorEditor,m as n,h as t,x as themeHighlightStyle};
|