@evandu/super-pi 0.1.296 → 0.1.299
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 +13 -13
- package/dist/client/assets/CodeMirrorEditor-C-L7B565.css +1 -0
- package/dist/client/assets/CodeMirrorEditor-CyYniLtN.js +2 -0
- package/dist/client/assets/GitDiffEditor-BuozIMBT.js +29 -0
- package/dist/client/assets/{index-RW-EQEae.js → index-BYAipWq-.js} +31 -31
- package/dist/client/assets/index-Dcs7gmUf.css +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/CodeMirrorEditor--5LzaKEZ.css +0 -1
- package/dist/client/assets/CodeMirrorEditor-h1p8ZevT.js +0 -2
- package/dist/client/assets/GitDiffEditor-wJa0EI5q.js +0 -29
- package/dist/client/assets/index-CPfz3vPM.css +0 -1
package/dist/client/index.html
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<link rel="alternate icon" href="/favicon.ico" />
|
|
9
9
|
<link rel="apple-touch-icon" href="/favicon.svg" />
|
|
10
10
|
<title>Super Pi</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-BYAipWq-.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Dcs7gmUf.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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 .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{position:relative}.workbench-shell .cm-editor .cm-panels-top{z-index:10;border:1px solid var(--border-default);width:min(420px,100% - 24px);box-shadow:0 4px 12px var(--shadow-faint);border-radius:5px;position:absolute;top:8px;left:auto;right:12px}.workbench-shell .cm-editor .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 .cm-editor .cm-search:not([data-editor-search-expanded=true]) .cm-textfield{flex-basis:120px;width:160px;min-width:80px}.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-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 .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 +0,0 @@
|
|
|
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,m as o,o as s,p as c,r as l,s as u}from"./index-RW-EQEae.js";var d=e(t(),1);function f(e,t,n){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 t=()=>{let t=e.dom.querySelector(`.cm-panel.cm-search`);if(!t||t.querySelector(`[data-editor-search-options]`))return;let n=document.createElement(`button`);n.type=`button`,n.dataset.editorSearchOptions=``,n.textContent=`选项`,n.setAttribute(`aria-label`,`展开查找选项`),n.setAttribute(`aria-expanded`,`false`),n.onclick=()=>{let e=t.dataset.editorSearchExpanded!==`true`;t.dataset.editorSearchExpanded=String(e),n.setAttribute(`aria-expanded`,String(e)),n.setAttribute(`aria-label`,e?`收起查找选项`:`展开查找选项`)},t.append(n)},n=new MutationObserver(t);return n.observe(e.dom,{childList:!0,subtree:!0}),t(),{destroy(){n.disconnect()}}}),e.Prec.highest(n.keymap.of([{key:`Mod-Shift-l`,run:t.selectSelectionMatches},{key:`Mod-h`,run:e=>(t.openSearchPanel(e),requestAnimationFrame(()=>{e.dom.querySelector(`[data-editor-search-options][aria-expanded="false"]`)?.click()}),!0)},...[`c`,`w`,`r`].map(e=>({key:`Alt-${e}`,run:n=>{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}}))])),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 p(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:()=>(u({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 m=new Map;function ee(e){let t=m.get(e);return t&&(m.delete(e),m.set(e,t)),t}function h(e,t){m.delete(e),m.set(e,t);let n=[...m.values()].reduce((e,t)=>e+t.state.doc.length,0);for(;m.size>32||n>16777216;){let e=m.keys().next().value;n-=m.get(e).state.doc.length,m.delete(e)}}var g=r(),te=262144,_=131072;function v(e){return e.split(`.`).pop()?.toLowerCase()??``}function y(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 b({path:e,value:t,onChange:n,jumpToLine:r,onSave:s,workspaceId:u,cwd:m=``,blame:b,onPosition:x,onView:S,readOnly:C=!1,languageOverride:w}){let T=(0,d.useRef)(null),E=(0,d.useRef)(null),ne=(0,d.useRef)(null),D=JSON.stringify([u,m,e]),O=(0,d.useRef)(void 0),k=(0,d.useRef)(null),A=(0,d.useRef)(null),re=(0,d.useRef)(null),j=(0,d.useRef)(null),M=(0,d.useRef)(null),N=(0,d.useRef)(null),P=(0,d.useRef)(n),F=(0,d.useRef)(s),I=(0,d.useRef)(!1),L=(0,d.useRef)(S);L.current=S,P.current=n,F.current=s;let[R,ie]=(0,d.useState)(!1),[z,B]=(0,d.useState)(!1),[V,H]=(0,d.useState)(`0,0`),[U,ae]=(0,d.useState)(0),[W,G]=(0,d.useState)(1);(0,d.useEffect)(()=>{let n=!1,r,s,c,l,u;return(async()=>{try{let d=w??v(e),m=o(d),[h,g,_,b,x,S,R,z,V]=await Promise.all([i(()=>import(`./dist-D978o95T.js`).then(e=>e.S),__vite__mapDeps([0,1])),i(()=>import(`./dist-DTIPfQj7.js`).then(e=>e.s),__vite__mapDeps([2,1,0])),i(()=>import(`./dist-S5ntGzJB.js`),__vite__mapDeps([3,0,1,2,4,5])),i(()=>import(`./dist-Qjm1p8SR.js`),__vite__mapDeps([6,0,1,2])),i(()=>import(`./dist-DP4hrTBF.js`).then(e=>e.d),__vite__mapDeps([5,1,0,2,4])),i(()=>import(`./dist-Cus6_oaF.js`).then(e=>e.n),__vite__mapDeps([4,1])),m?m().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)),i(()=>import(`./dist-BJHpSQV1.js`).then(e=>e.r),__vite__mapDeps([7,1,0,2,5,4]))]);if(n||!T.current)return;ne.current=g.EditorView,l=x,u=S,A.current=h.Annotation.define(),re.current=h.Transaction.addToHistory;let U=t.length<=te&&R!==null;s=new h.Compartment;let W=[g.lineNumbers(),g.highlightActiveLine(),g.drawSelection(),_.history(),g.keymap.of([_.indentWithTab,..._.defaultKeymap,..._.historyKeymap,...b.searchKeymap,{key:`Mod-s`,run:()=>(F.current(),!0)}]),g.EditorView.updateListener.of(e=>{e.docChanged&&!(A.current&&e.transactions.some(e=>e.annotation(A.current)===!0))&&P.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`)))}),f(h,b,g),p(h,g,x,V,_)),C&&W.push(h.EditorState.readOnly.of(!0),g.EditorView.editable.of(!1),g.EditorView.contentAttributes.of({tabindex:`0`})),z&&!C&&(c=new h.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(y(l,u))))}catch(e){console.warn(`[CodeMirror] Failed to attach syntaxHighlighting for .${d}:`,e),U=!1}let K=ee(D),q=K&&K.state.doc.toString()===t,oe=q?K.state.update({effects:h.StateEffect.reconfigure.of(W)}).state:h.EditorState.create({doc:t,extensions:W});if(r=new g.EditorView({state:oe,parent:T.current}),O.current=q?K.jump:void 0,G(r.state.selection.ranges.length),H(`${r.state.selection.main.from},${r.state.selection.main.to}`),q&&(r.scrollDOM.scrollTop=K.top,r.scrollDOM.scrollLeft=K.left,O.current=K.jump),n){r.destroy();return}E.current=r,L.current?.(r),ie(U),B(!0),j.current=z,M.current=c??null,N.current=null,ae(e=>e+1);let J=new MutationObserver(()=>{let e=E.current;if(e&&U&&s&&l&&u)try{e.dispatch({effects:s.reconfigure(l.syntaxHighlighting(y(l,u)))})}catch{}});k.current=J,J.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}catch(e){console.error(`[CodeMirror] Fatal editor initialization error:`,e),n||B(!0)}})(),()=>{n=!0,k.current?.disconnect(),k.current=null,r&&h(D,{state:r.state,top:r.scrollDOM.scrollTop,left:r.scrollDOM.scrollLeft,jump:O.current}),r?.destroy(),E.current=null,L.current?.(),B(!1),T.current&&(T.current.textContent=``)}},[D,C,w]),(0,d.useEffect)(()=>{let e=E.current;if(!e)return;let n=e.state.doc.toString();n!==t&&e.dispatch({changes:{from:0,to:n.length,insert:t},annotations:A.current?A.current.of(!0):void 0})},[t]),(0,d.useEffect)(()=>{let e=E.current;if(!e||!r||O.current===r.request)return;O.current=r.request;let t=e.state.doc.line(Math.min(Math.max(1,r.line),e.state.doc.lines)),n=Math.min(t.to,t.from+(r.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()},[r,z]);let K=!!(b&&b.state===`ready`&&b.response&&b.path===e&&b.workspaceId===u);(0,d.useEffect)(()=>{let t=E.current,n=j.current,r=M.current;if(!t||!n||!r)return;let i=b&&b.state===`ready`&&b.response&&b.path===e&&b.workspaceId===u?b.response:null,a=i?l(i):null;N.current!==a&&(N.current=a,t.dispatch({effects:[n.setBlame.of(a),r.reconfigure(a?n.gutter:[])]}))},[b?.state,b?.response,b?.path,b?.workspaceId,e,u,U]);let q=E.current?.state.doc.toString()??t,oe=q.length<=_?q:q.slice(0,_),J=w??v(e),Y=c(J),se=E.current?.state,X=se?.selection.main.head,Z=X===void 0?void 0:se?.doc.lineAt(X),Q=Z?.number,$=X!==void 0&&Z?X-Z.from+1:void 0;return(0,d.useEffect)(()=>{z&&Q!==void 0&&$!==void 0&&x?.({line:Q,column:$,language:R&&Y||`纯文本`,highlight:R?J:`plain`,navigation:I.current,selections:W})},[z,Q,$,R,Y,J,x,W]),(0,d.useEffect)(()=>()=>x?.(),[x]),(0,g.jsxs)(`div`,{className:`file-cm-wrap`,"data-file-text":e,"data-file-content":oe,"data-file-content-truncated":q.length>_?`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`)||E.current?.focus()},children:[(0,g.jsx)(`div`,{className:`file-cm`,ref:T,"aria-label":`${C?`查看`:`编辑`} ${e}`}),(!z||!x)&&(0,g.jsxs)(`div`,{className:`file-editor-status`,children:[!z&&(0,g.jsx)(`span`,{"data-file-editor-loading":`1`,children:`正在加载编辑器…`}),z&&X!==void 0&&Z&&(0,g.jsxs)(`span`,{children:[`第 `,Z.number,` 行,第 `,X-Z.from+1,` 列`]}),z&&!R&&(0,g.jsx)(`span`,{"data-file-highlight-status":`plain`,children:`纯文本`}),z&&R&&Y&&(0,g.jsx)(`span`,{"data-file-highlight-status":J,children:Y})]})]})}export{b as CodeMirrorEditor,f as n,p as t,y as themeHighlightStyle};
|