@hienlh/ppm 0.13.70 → 0.13.72
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/CHANGELOG.md +10 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/bun.lock +2170 -0
- package/bunfig.toml +2 -0
- package/dist/web/assets/{ai-settings-section-BH2UOQH-.js → ai-settings-section-D0VMZ4aE.js} +1 -1
- package/dist/web/assets/{api-settings-uQKmeGkl.js → api-settings-Byph7lae.js} +1 -1
- package/dist/web/assets/architecture-PBZL5I3N-CudoLvK2.js +1 -0
- package/dist/web/assets/{audio-preview-CZhDQAY0.js → audio-preview-BSxUhOcE.js} +1 -1
- package/dist/web/assets/chat-tab-C7cQFuCE.js +16 -0
- package/dist/web/assets/code-DiNmA3eR.js +1 -0
- package/dist/web/assets/code-editor-CgOXGuFE.js +8 -0
- package/dist/web/assets/{conflict-editor-BNH2zCNB.js → conflict-editor-C5zdbpR6.js} +1 -1
- package/dist/web/assets/{csv-preview-DgArUJhd.js → csv-preview-CwEbP_iZ.js} +1 -1
- package/dist/web/assets/{data-grid-overlay-editor-CmduzuPM.js → data-grid-overlay-editor-C36FRqE8.js} +1 -1
- package/dist/web/assets/database-viewer-LxK8iNza.js +1 -0
- package/dist/web/assets/{diff-viewer-BIXVrSim.js → diff-viewer-BjkXOjl9.js} +1 -1
- package/dist/web/assets/{docx-preview-DSjXBECZ.js → docx-preview-DP6RSIBZ.js} +1 -1
- package/dist/web/assets/{esm-JPvheKDJ.js → esm-DH3rpl0I.js} +1 -1
- package/dist/web/assets/{extension-webview-D9HNUtCJ.js → extension-webview-CBtARJbA.js} +1 -1
- package/dist/web/assets/{git-log-panel-DOflA1M9.js → git-log-panel-BCGywZjD.js} +1 -1
- package/dist/web/assets/gitGraph-HDMCJU4V-D7fSBcfv.js +1 -0
- package/dist/web/assets/{glide-data-grid-BqVQTCnJ.js → glide-data-grid-P39hoLVJ.js} +4 -4
- package/dist/web/assets/{image-preview-Ci6M6elH.js → image-preview-BXnw19Ss.js} +1 -1
- package/dist/web/assets/{index-BzTlE_8m.js → index-D39gAvQS.js} +4 -4
- package/dist/web/assets/info-3K5VOQVL-cJ74TVOK.js +1 -0
- package/dist/web/assets/{input-B78ol0hV.js → input-DSELw5zU.js} +1 -1
- package/dist/web/assets/keybindings-store-NVJWQgzX.js +1 -0
- package/dist/web/assets/{markdown-renderer-CHiMGpPo.js → markdown-renderer-DIZ9ZEgA.js} +3 -3
- package/dist/web/assets/notification-store-C0UtpgVR.js +1 -0
- package/dist/web/assets/{number-overlay-editor-DS-qf63L.js → number-overlay-editor-JsUdft7z.js} +1 -1
- package/dist/web/assets/packet-RMMSAZCW-D8_TXtXE.js +1 -0
- package/dist/web/assets/{panel-store-B1pOXkyS.js → panel-store-DlvwzOll.js} +1 -1
- package/dist/web/assets/{pdf-preview-BPFxxV3O.js → pdf-preview-wn5Y1nWN.js} +1 -1
- package/dist/web/assets/pie-UPGHQEXC-DFY10Y1l.js +1 -0
- package/dist/web/assets/{port-forwarding-tab-DmEAAZK8.js → port-forwarding-tab-Dw95F7ed.js} +1 -1
- package/dist/web/assets/{postgres-viewer-DaZ6CJEn.js → postgres-viewer-CYu65424.js} +3 -3
- package/dist/web/assets/{project-store-BnvrVKBw.js → project-store-CpC02pIv.js} +1 -1
- package/dist/web/assets/radar-KQ55EAFF-C_KtX0ok.js +1 -0
- package/dist/web/assets/{settings-store-CSDOihqv.js → settings-store-DRbccx1s.js} +2 -2
- package/dist/web/assets/settings-tab-D3WPn1-j.js +1 -0
- package/dist/web/assets/shield-check-DeIMQtEj.js +1 -0
- package/dist/web/assets/shield-off-D4jBmG5E.js +1 -0
- package/dist/web/assets/{sql-query-editor-CskpXyPa.js → sql-query-editor-Ca3oVRX_.js} +1 -1
- package/dist/web/assets/{sqlite-viewer-B3UnoI6b.js → sqlite-viewer-B_LiamyO.js} +1 -1
- package/dist/web/assets/{system-monitor-tab-Bs3NIc-o.js → system-monitor-tab-BGGwcAnr.js} +1 -1
- package/dist/web/assets/{tab-store-DzftzxTL.js → tab-store-Bdw8DIbZ.js} +1 -1
- package/dist/web/assets/{terminal-tab-18ftzRyX.js → terminal-tab-Ykn8Q01b.js} +1 -1
- package/dist/web/assets/treemap-KZPCXAKY-CR0-H3Pq.js +1 -0
- package/dist/web/assets/{use-blob-url-DCUIEzjB.js → use-blob-url-CBi0HMq5.js} +1 -1
- package/dist/web/assets/{use-monaco-theme-qx6SfVRk.js → use-monaco-theme-CKmBga-e.js} +1 -1
- package/dist/web/assets/{vendor-mermaid-DCie7hiR.js → vendor-mermaid-CsBwn--q.js} +2 -2
- package/dist/web/assets/{video-preview-bjVF9KXp.js → video-preview-BSyVoRAz.js} +1 -1
- package/dist/web/index.html +13 -13
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -0
- package/src/services/db.service.ts +13 -4
- package/src/web/components/chat/message-input.tsx +3 -34
- package/src/web/components/database/database-viewer.tsx +18 -1
- package/dist/web/assets/architecture-PBZL5I3N-DLKD1Xjj.js +0 -1
- package/dist/web/assets/chat-tab-DSFUgdUb.js +0 -16
- package/dist/web/assets/code-editor-CTtkcsbX.js +0 -8
- package/dist/web/assets/database-viewer-B7F0P1Qs.js +0 -1
- package/dist/web/assets/gitGraph-HDMCJU4V-2a0r4GHr.js +0 -1
- package/dist/web/assets/info-3K5VOQVL-CWKw4e0V.js +0 -1
- package/dist/web/assets/keybindings-store-DH2mWJAH.js +0 -1
- package/dist/web/assets/notification-store-XYWnYwM3.js +0 -1
- package/dist/web/assets/packet-RMMSAZCW-Ar00Wbhd.js +0 -1
- package/dist/web/assets/pie-UPGHQEXC-Q4ssDdib.js +0 -1
- package/dist/web/assets/radar-KQ55EAFF-kq5v4OKX.js +0 -1
- package/dist/web/assets/settings-tab-DD_xM8We.js +0 -1
- package/dist/web/assets/shield-off-BThd3p75.js +0 -1
- package/dist/web/assets/treemap-KZPCXAKY-DChODgHt.js +0 -1
- /package/dist/web/assets/{api-client-DiZgVOok.js → api-client-DG9qwosT.js} +0 -0
- /package/dist/web/assets/{csv-parser-D8VHWVA6.js → csv-parser-B_TuHmnd.js} +0 -0
- /package/dist/web/assets/{data-grid-types-C29KDkZJ.js → data-grid-types-CO_3iSwd.js} +0 -0
- /package/dist/web/assets/{dist-DeY41KFi.js → dist-C1jciI67.js} +0 -0
- /package/dist/web/assets/{dist-PPUhQONj.js → dist-D4dFaZkK.js} +0 -0
- /package/dist/web/assets/{katex-DUj5OG1J.js → katex-DveWxdWJ.js} +0 -0
- /package/dist/web/assets/{lib-DrypSCq8.js → lib-D4YDpYv4.js} +0 -0
- /package/dist/web/assets/{react-CfveccaI.js → react-BXxixfbh.js} +0 -0
- /package/dist/web/assets/{sparkles-KCOEy7QI.js → sparkles-DyeiGE7Q.js} +0 -0
- /package/dist/web/assets/{table-2wDtM4_B.js → table-DCYlHUNQ.js} +0 -0
- /package/dist/web/assets/{text-wrap-AZErifCu.js → text-wrap-B3mYv9Yo.js} +0 -0
- /package/dist/web/assets/{utils-E0yyGxXt.js → utils-Bs_TFEQf.js} +0 -0
- /package/dist/web/assets/{vendor-xterm-msgiskDb.js → vendor-xterm-BHJtSw6L.js} +0 -0
- /package/dist/web/assets/{wifi-LJEyIdXf.js → wifi-DifNnmbA.js} +0 -0
- /package/dist/web/assets/{x-DfF6D5Js.js → x-WwAMX3EB.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{i as r,r as i}from"./glide-data-grid-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import{i as r,r as i}from"./glide-data-grid-P39hoLVJ.js";import{n as a,t as o}from"./use-monaco-theme-CKmBga-e.js";var s=e(n(),1),c=t();function l(e,t){let n=e.split(`
|
|
2
2
|
`),r=0;for(let e=0;e<n.length;e++){let i=n[e].trim();e<t-1&&i.endsWith(`;`)&&(r=e+1)}let i=n.length-1;for(let e=t-1;e<n.length;e++)if(n[e].trim().endsWith(`;`)){i=e;break}for(;r<=i;){let e=n[r].trim();if(e&&!e.startsWith(`--`))break;r++}return n.slice(r,i+1).join(`
|
|
3
3
|
`).trim()}function u({onExecute:e,loading:t,defaultValue:n=`SELECT * FROM `,schemaInfo:u,onSqlChange:d,persistedSql:f}){let[p,m]=(0,s.useState)(()=>f??n),h=(0,s.useRef)(!!f),g=(0,s.useRef)(null),_=(0,s.useRef)(null),v=(0,s.useRef)(null),y=(0,s.useRef)(e);y.current=e;let b=o();(0,s.useEffect)(()=>{if(!(!_.current||!u))return v.current?.dispose(),i(),v.current=_.current.languages.registerCompletionItemProvider(`sql`,r(_.current,u)),()=>{v.current?.dispose()}},[u]);let x=(0,s.useCallback)((e,t)=>{g.current=e,_.current=t,e.addAction({id:`run-query-at-cursor`,label:`Run Statement at Cursor`,keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.Enter],run:e=>{let t=e.getPosition();if(!t)return;let n=l(e.getValue(),t.lineNumber);n&&y.current(n)}}),u&&(v.current?.dispose(),v.current=t.languages.registerCompletionItemProvider(`sql`,r(t,u)))},[u]);return(0,s.useEffect)(()=>{h.current||m(n)},[n]),(0,c.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,c.jsx)(a,{height:`100%`,language:`sql`,theme:b,value:p,onChange:e=>{let t=e??``;m(t),h.current=!0,d?.(t)},onMount:x,options:{minimap:{enabled:!1},lineNumbers:`off`,scrollBeyondLastLine:!1,wordWrap:`on`,fontSize:12,tabSize:2,renderLineHighlight:`none`,overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{vertical:`auto`,horizontal:`auto`,verticalScrollbarSize:6,horizontalScrollbarSize:6},padding:{top:4,bottom:4},lineDecorationsWidth:4,lineNumbersMinChars:0,glyphMargin:!1,folding:!1,fixedOverflowWidgets:!0}})})}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import{t as r}from"./database-Dc8mr-dP.js";import{t as i}from"./glide-data-grid-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import{t as r}from"./database-Dc8mr-dP.js";import{t as i}from"./glide-data-grid-P39hoLVJ.js";import{t as a}from"./refresh-cw-CRD2qr4U.js";import{t as o}from"./table-DCYlHUNQ.js";import{i as s,t as c}from"./api-client-DG9qwosT.js";import"./settings-store-DRbccx1s.js";import"./vendor-mermaid-CsBwn--q.js";import"./panel-store-DlvwzOll.js";import"./tab-store-Bdw8DIbZ.js";import{et as l,mt as u}from"./index-D39gAvQS.js";import"./data-grid-types-CO_3iSwd.js";import"./use-monaco-theme-CKmBga-e.js";import{t as d}from"./sql-query-editor-Ca3oVRX_.js";var f=e(n(),1);function p(e,t,n){let[r,i]=(0,f.useState)([]),[a,o]=(0,f.useState)(null),[l,u]=(0,f.useState)(null),[d,p]=(0,f.useState)([]),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(1),[b,x]=(0,f.useState)(null),[S,C]=(0,f.useState)(null),[w,T]=(0,f.useState)(!1),E=n?`/api/db/connections/${n}`:null,D=E??`${s(e)}/sqlite`,O=E?``:`path=${encodeURIComponent(t)}`,k=(0,f.useCallback)(async()=>{h(!0),_(null);try{let e=E?`?cached=1`:O?`?${O}`:``,t=await c.get(`${D}/tables${e}`);i(t),!E&&t.length>0&&!a&&o(t[0].name)}catch(e){_(e.message)}finally{h(!1)}},[D,O,E]);(0,f.useEffect)(()=>{k()},[k]);let A=(0,f.useCallback)(async()=>{if(a){h(!0);try{let e=O?`${O}&`:``,[t,n]=await Promise.all([c.get(`${D}/data?${e}table=${encodeURIComponent(a)}&page=${v}&limit=100`),c.get(`${D}/schema?${e}table=${encodeURIComponent(a)}`)]);u(t),p(n)}catch(e){_(e.message)}finally{h(!1)}}},[D,O,a,v]);return(0,f.useEffect)(()=>{A()},[A]),{tables:r,selectedTable:a,selectTable:(0,f.useCallback)(e=>{o(e),y(1),x(null)},[]),tableData:l,schema:d,loading:m,error:g,page:v,setPage:y,queryResult:b,queryError:S,queryLoading:w,executeQuery:(0,f.useCallback)(async e=>{T(!0),C(null);try{let n=E?{sql:e}:{path:t,sql:e},r=await c.post(`${D}/query`,n);x(r),r.changeType===`modify`&&A()}catch(e){C(e.message)}finally{T(!1)}},[D,E,t,A]),updateCell:(0,f.useCallback)(async(e,n,r)=>{if(a)try{E?await c.put(`${D}/cell`,{table:a,pkColumn:`rowid`,pkValue:e,column:n,value:r}):await c.put(`${D}/cell`,{path:t,table:a,rowid:e,column:n,value:r}),A()}catch(e){_(e.message)}},[D,E,t,a,A]),deleteRow:(0,f.useCallback)(async e=>{if(a)try{E?await c.del(`${D}/row`,{table:a,pkColumn:`rowid`,pkValue:e}):await c.del(`${D}/row`,{path:t,table:a,rowid:e}),A(),k()}catch(e){_(e.message)}},[D,E,t,a,A,k]),refreshTables:k,refreshData:A}}var m=t();function h({tables:e,selectedTable:t,onSelect:n,onRefresh:r}){return(0,m.jsxs)(`div`,{className:`w-48 shrink-0 flex flex-col bg-background overflow-hidden`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,m.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Tables`}),(0,m.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground transition-colors`,title:`Refresh tables`,children:(0,m.jsx)(a,{className:`size-3`})})]}),(0,m.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[e.map(e=>(0,m.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${t===e.name?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[(0,m.jsx)(o,{className:`size-3 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,m.jsx)(`span`,{className:`text-[10px] opacity-60`,children:e.rowCount})]},e.name)),e.length===0&&(0,m.jsx)(`p`,{className:`px-3 py-4 text-xs text-muted-foreground text-center`,children:`No tables found`})]})]})}function g({onExecute:e,loading:t}){return(0,m.jsx)(d,{onExecute:e,loading:t})}function _({metadata:e}){let t=e?.filePath,n=e?.projectName,i=e?.connectionId,a=e?.tableName,[o,s]=(0,f.useState)(!1);return i?(0,m.jsx)(v,{projectName:``,dbPath:``,connectionId:i,connectionName:e?.connectionName,initialTable:a,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e),hideTableList:!0}):!t||!n?(0,m.jsxs)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:[(0,m.jsx)(r,{className:`size-5 mr-2`}),` No database file selected.`]}):(0,m.jsx)(v,{projectName:n,dbPath:t,queryPanelOpen:o,onToggleQueryPanel:()=>s(e=>!e)})}function v({projectName:e,dbPath:t,connectionId:n,connectionName:a,initialTable:o,queryPanelOpen:s,onToggleQueryPanel:c,hideTableList:d}){let _=p(e,t,n),v=(0,f.useRef)(!1);return(0,f.useEffect)(()=>{o&&!v.current&&_.tables.length>0&&(v.current=!0,_.selectTable(o))},[o,_.tables]),_.error&&_.tables.length===0?(0,m.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,m.jsx)(u,{className:`size-10 text-destructive`}),(0,m.jsx)(`p`,{className:`text-sm`,children:_.error})]}):_.loading&&_.tables.length===0?(0,m.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,m.jsx)(l,{className:`size-5 animate-spin`}),(0,m.jsx)(`span`,{className:`text-sm`,children:`Loading database...`})]}):(0,m.jsxs)(`div`,{className:`flex h-full w-full overflow-hidden`,children:[!d&&(0,m.jsx)(h,{tables:_.tables,selectedTable:_.selectedTable,onSelect:_.selectTable,onRefresh:_.refreshTables}),(0,m.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden ${d?``:`border-l border-border`}`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,m.jsx)(r,{className:`size-3.5 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:a??t}),(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_.selectedTable&&`/ ${_.selectedTable}`}),(0,m.jsx)(`div`,{className:`ml-auto`,children:(0,m.jsx)(`button`,{type:`button`,onClick:c,className:`px-2 py-1 rounded text-xs transition-colors ${s?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})})]}),(0,m.jsx)(`div`,{className:`flex-1 overflow-hidden ${s?`max-h-[60%]`:``}`,children:_.tableData?(0,m.jsx)(i,{columns:_.tableData.columns,rows:_.tableData.rows,total:_.tableData.total,limit:_.tableData.limit,schema:_.schema.map(e=>({name:e.name,type:e.type,nullable:!e.notnull,pk:!!e.pk,defaultValue:e.dflt_value,fk:e.fk??null})),loading:_.loading,page:_.page,onPageChange:_.setPage,onCellUpdate:(e,t,n,r)=>_.updateCell(t,n,r),onRowDelete:(e,t)=>_.deleteRow(t)}):(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:_.loading?(0,m.jsx)(l,{className:`size-4 animate-spin`}):`Select a table`})}),s&&(0,m.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,m.jsx)(g,{onExecute:_.executeQuery,loading:_.queryLoading})})]})]})}export{_ as SqliteViewer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import{t as r}from"./createLucideIcon-BjHrJDVb.js";import{t as i}from"./arrow-down-D825m4vm.js";import{t as a}from"./arrow-up-Rcw6_KKu.js";import{n as o,t as s}from"./chevron-down-BMo4cBth.js";import{t as c}from"./chevron-right-CD8e6Aj4.js";import{t as l}from"./wifi-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import{t as r}from"./createLucideIcon-BjHrJDVb.js";import{t as i}from"./arrow-down-D825m4vm.js";import{t as a}from"./arrow-up-Rcw6_KKu.js";import{n as o,t as s}from"./chevron-down-BMo4cBth.js";import{t as c}from"./chevron-right-CD8e6Aj4.js";import{t as l}from"./wifi-DifNnmbA.js";import{t as u}from"./x-WwAMX3EB.js";import{t as d}from"./api-client-DG9qwosT.js";import{n as f}from"./utils-Bs_TFEQf.js";import{B as p,J as m,R as h,Z as g,a as _,g as v}from"./index-D39gAvQS.js";var y=r(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),b=r(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),x=e(n(),1),S=t(),C=(0,x.memo)(function({data:e,width:t=120,height:n=24,color:r=`#3b82f6`}){let i=(0,x.useRef)(null),a=(0,x.useRef)(0);return(0,x.useEffect)(()=>{let o=Date.now();if(o-a.current<1e3)return;a.current=o;let s=i.current;if(!s||e.length<2)return;let c=s.getContext(`2d`);if(!c)return;let l=window.devicePixelRatio||1;s.width=t*l,s.height=n*l,c.scale(l,l),c.clearRect(0,0,t,n);let u=Math.max(...e,1),d=t/(e.length-1),f=n-4;c.beginPath(),c.strokeStyle=r,c.lineWidth=1.5,c.lineJoin=`round`;for(let t=0;t<e.length;t++){let n=t*d,r=2+f-e[t]/u*f;t===0?c.moveTo(n,r):c.lineTo(n,r)}c.stroke()},[e,t,n,r]),(0,S.jsx)(`canvas`,{ref:i,style:{width:t,height:n},className:`inline-block`})});function w(e){return e>80?`text-red-500`:e>50?`text-yellow-500`:`text-green-500`}function T(e){return e<1024?`${e.toFixed(0)} MB`:`${(e/1024).toFixed(1)} GB`}function E(e){if(!e)return``;let t=Math.round((Date.now()-e)/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}var D=(0,x.memo)(function({group:e,Icon:t,isExpanded:n,sparkData:r,isMobile:i,sortKey:a,sortDir:o,onToggle:l,onKill:d}){let p=n?s:c,m=(0,x.useMemo)(()=>a?[...e.processes].sort((e,t)=>{let n=a===`cpu`?e.cpu:e.ramMB,r=a===`cpu`?t.cpu:t.ramMB;return o===`asc`?n-r:r-n}):e.processes,[e.processes,a,o]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`tr`,{className:`hover:bg-surface-hover cursor-pointer transition-colors`,onClick:l,children:[(0,S.jsx)(`td`,{className:`py-1.5 px-3`,children:(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(p,{className:`size-3 text-text-subtle shrink-0`}),(0,S.jsx)(t,{className:`size-3.5 text-text-secondary shrink-0`}),(0,S.jsx)(`span`,{className:`truncate`,children:e.label}),(0,S.jsxs)(`span`,{className:`text-text-subtle`,children:[`(`,e.processes.length,`)`]})]})}),(0,S.jsxs)(`td`,{className:f(`text-right py-1.5 px-2`,w(e.cpu)),children:[e.cpu.toFixed(1),`%`]}),(0,S.jsx)(`td`,{className:`text-right py-1.5 px-2 text-text-secondary`,children:T(e.ramMB)}),!i&&(0,S.jsx)(`td`,{className:`py-1.5 px-2`,children:r.length>1&&(0,S.jsx)(C,{data:r,width:120,height:20})})]}),n&&m.map(e=>(0,S.jsxs)(`tr`,{className:`text-text-subtle group/proc hover:bg-surface-hover transition-colors`,children:[(0,S.jsx)(`td`,{className:`py-1 px-3 pl-10`,children:(0,S.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,S.jsx)(`span`,{className:`text-text-subtle shrink-0`,children:e.pid}),(0,S.jsx)(`span`,{className:`break-all text-text-secondary`,title:e.command,children:e.command})]})}),(0,S.jsxs)(`td`,{className:`text-right py-1 px-2 align-top`,children:[e.cpu.toFixed(1),`%`]}),(0,S.jsx)(`td`,{className:`text-right py-1 px-2 align-top`,children:T(e.ramMB)}),!i&&(0,S.jsx)(`td`,{className:`align-top py-1 px-2`,children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-1`,children:[(0,S.jsx)(`span`,{className:`text-text-subtle`,title:e.startedAt?new Date(e.startedAt).toLocaleString():``,children:E(e.startedAt)}),(0,S.jsx)(`button`,{onClick:t=>{t.stopPropagation(),d(e.pid)},className:`opacity-0 group-hover/proc:opacity-100 p-0.5 rounded hover:bg-red-500/20 hover:text-red-500 transition-all`,title:`End process ${e.pid}`,children:(0,S.jsx)(u,{className:`size-3`})})]})})]},e.pid))]})});function O({label:e,field:t,activeKey:n,activeDir:r,onClick:o,className:s}){let c=n===t,l=c?r===`asc`?a:i:null;return(0,S.jsx)(`th`,{className:f(`text-right py-1.5 px-2 font-medium cursor-pointer select-none hover:text-text-primary transition-colors`,c&&`text-text-primary`,s),onClick:()=>o(t),children:(0,S.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,S.jsx)(`span`,{children:e}),l&&(0,S.jsx)(l,{className:`size-3`})]})})}var k={server:m,terminal:g,"ai-tool":o,build:b,unknown:y},A=200;function j(e,t,n){return e===n?t===`desc`?[n,`asc`]:[null,`desc`]:[n,`desc`]}function M(e,t,n){return t?[...e].sort((e,r)=>{let i=t===`cpu`?e.cpu:e.ramMB,a=t===`cpu`?r.cpu:r.ramMB;return n===`asc`?i-a:a-i}):e}var N=(0,x.memo)(function(){let{latest:e,history:t,isConnected:n}=_(),[r,i]=(0,x.useState)(()=>new Set([`server`])),[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(`desc`),u=v(),m=(0,x.useMemo)(()=>{let e=new Map,n=t.slice(-A);for(let t of n)for(let n of t.groups){let t=`${n.type}:${n.label}`,r=e.get(t)??[];r.push(n.cpu),e.set(t,r)}return e},[t]),g=(0,x.useMemo)(()=>e?M(e.groups,a,s):[],[e,a,s]),b=(0,x.useCallback)(async e=>{try{await d.post(`/api/system/resources/kill/${e}`),h.success(`Sent SIGTERM to PID ${e}`)}catch(t){h.error(t.message||`Failed to kill PID ${e}`)}},[]),C=e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},E=e=>{let[t,n]=j(a,s,e);o(t),c(n)};if(!e)return(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full text-text-subtle text-sm`,children:n?`Waiting for data...`:`Connecting to resource monitor...`});let N=Math.round((Date.now()-e.timestamp)/1e3);return(0,S.jsxs)(`div`,{className:`h-full flex flex-col overflow-hidden`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border shrink-0`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-medium`,children:`System Monitor`}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-text-subtle`,children:[n?(0,S.jsx)(l,{className:`size-3 text-green-500`}):(0,S.jsx)(p,{className:`size-3 text-red-500`}),(0,S.jsx)(`span`,{children:n?`Updated ${N}s ago`:`Disconnected`})]})]}),(0,S.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,S.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`text-text-subtle border-b border-border`,children:[(0,S.jsx)(`th`,{className:`text-left py-1.5 px-3 font-medium`,children:`Process`}),(0,S.jsx)(O,{label:`CPU`,field:`cpu`,activeKey:a,activeDir:s,onClick:E,className:`w-16`}),(0,S.jsx)(O,{label:`RAM`,field:`ram`,activeKey:a,activeDir:s,onClick:E,className:`w-20`}),!u&&(0,S.jsx)(`th`,{className:`py-1.5 px-2 font-medium w-[130px]`,children:`Trend / Age`})]})}),(0,S.jsx)(`tbody`,{children:g.map(e=>{let t=`${e.type}:${e.label}`;return(0,S.jsx)(D,{group:e,Icon:k[e.type]??y,isExpanded:r.has(t),sparkData:m.get(t)??[],isMobile:u,sortKey:a,sortDir:s,onToggle:()=>C(t),onKill:b},t)})}),(0,S.jsx)(`tfoot`,{children:(0,S.jsxs)(`tr`,{className:`border-t border-border font-medium`,children:[(0,S.jsxs)(`td`,{className:`py-1.5 px-3`,children:[`Total (`,e.total.processCount,` processes)`]}),(0,S.jsxs)(`td`,{className:f(`text-right py-1.5 px-2`,w(e.total.cpu)),children:[e.total.cpu.toFixed(1),`%`]}),(0,S.jsx)(`td`,{className:`text-right py-1.5 px-2 text-text-secondary`,children:T(e.total.ramMB)}),!u&&(0,S.jsx)(`td`,{})]})})]})})]})});export{N as SystemMonitorTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-
|
|
1
|
+
import{t as e}from"./react-BXxixfbh.js";import{a as t,t as n}from"./panel-store-DlvwzOll.js";var r=e()(()=>({tabs:[],activeTabId:null,tabHistory:[],currentProject:null,switchProject:e=>{n.getState().switchProject(e),i()},openTab:e=>{let t=n.getState().openTab(e);return i(),t},closeTab:e=>{n.getState().closeTab(e),i()},setActiveTab:e=>{n.getState().setActiveTab(e),i()},updateTab:(e,t)=>{n.getState().updateTab(e,t),i()},openNewFile:()=>{let e=n.getState(),r=t(e.panels),a=e.openTab({type:`editor`,title:`Untitled-${r}`,projectId:null,metadata:{isUntitled:!0,untitledNumber:r},closable:!0});return i(),a}}));function i(){let e=n.getState(),t=e.panels[e.focusedPanelId];r.setState({tabs:t?.tabs??[],activeTabId:t?.activeTabId??null,tabHistory:t?.tabHistory??[],currentProject:e.currentProject})}n.subscribe(()=>i());export{r as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import"./api-client-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{b as t,x as n}from"./vendor-markdown-0Mxgxy0L.js";import"./vendor-ui-UXCWAcmi.js";import"./api-client-DG9qwosT.js";import{n as r}from"./settings-store-DRbccx1s.js";import"./vendor-mermaid-CsBwn--q.js";import{n as i}from"./utils-Bs_TFEQf.js";import{t as a}from"./panel-store-DlvwzOll.js";import{$ as o,R as s,Y as c,ft as l,ut as u}from"./index-D39gAvQS.js";import{n as d,r as f,t as p}from"./vendor-xterm-BHJtSw6L.js";var m=e(n(),1),h={background:`#0f1419`,foreground:`#e5e7eb`,cursor:`#e5e7eb`,selectionBackground:`#3b82f640`,black:`#1a1f2e`,red:`#ef4444`,green:`#10b981`,yellow:`#f59e0b`,blue:`#3b82f6`,magenta:`#a855f7`,cyan:`#06b6d4`,white:`#e5e7eb`,brightBlack:`#6b7280`,brightRed:`#f87171`,brightGreen:`#34d399`,brightYellow:`#fbbf24`,brightBlue:`#60a5fa`,brightMagenta:`#c084fc`,brightCyan:`#22d3ee`,brightWhite:`#f9fafb`},g={background:`#ffffff`,foreground:`#1a1f2e`,cursor:`#1a1f2e`,selectionBackground:`#2563eb30`,black:`#1a1f2e`,red:`#dc2626`,green:`#059669`,yellow:`#d97706`,blue:`#2563eb`,magenta:`#9333ea`,cyan:`#0891b2`,white:`#f8fafc`,brightBlack:`#64748b`,brightRed:`#ef4444`,brightGreen:`#10b981`,brightYellow:`#f59e0b`,brightBlue:`#3b82f6`,brightMagenta:`#a855f7`,brightCyan:`#06b6d4`,brightWhite:`#ffffff`};function _(e){return e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?h:g:e===`light`?g:h}var v=`RESIZE:`;function y(e){let{sessionId:t,containerRef:n}=e,i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)(null),c=(0,m.useRef)(0),[l,u]=(0,m.useState)(!1),[h,g]=(0,m.useState)(!1),[y,b]=(0,m.useState)(!1),x=e.tabId?`ppm:terminal-session:${e.tabId}`:null,S=(0,m.useRef)((()=>{if(x)try{return localStorage.getItem(x)??t}catch{}return t})()),C=(0,m.useRef)(0),w=(0,m.useCallback)(e=>{let t=o.current;t?.readyState===WebSocket.OPEN&&t.send(e)},[]),T=(0,m.useCallback)(()=>i.current?.getSelection()??``,[]),E=(0,m.useCallback)(()=>{let e=i.current;if(!e)return``;let t=e.buffer.active,n=C.current,r=t.baseY+t.cursorY,a=[];for(let e=n;e<=r;e++){let n=t.getLine(e);n&&a.push(n.translateToString(!0))}for(;a.length>0&&a[a.length-1].trim()===``;)a.pop();return a.join(`
|
|
2
2
|
`)},[]),D=(0,m.useCallback)(()=>{let e=i.current,t=o.current;e&&t?.readyState===WebSocket.OPEN&&t.send(`${v}${e.cols},${e.rows}`)},[]),O=(0,m.useCallback)(()=>{if(s.current&&clearTimeout(s.current),o.current?.close(),o.current=null,S.current=`new`,x)try{localStorage.removeItem(x)}catch{}c.current=0,b(!1),u(!1),g(!1),setTimeout(()=>k(),0)},[]),k=(0,m.useCallback)(()=>{s.current&&=(clearTimeout(s.current),null),o.current&&=(o.current.onclose=null,o.current.close(),null);let t=i.current;if(!t)return;let n=window.location.protocol===`https:`?`wss:`:`ws:`,r=e.projectName??``,a=S.current,l=`/ws/project/${encodeURIComponent(r)}/terminal/${a}`,d=`${n}//${window.location.host}${l}`,f=new WebSocket(d);o.current=f,f.onopen=()=>{u(!0),g(!1),c.current=0,D()},f.onmessage=e=>{if(typeof e.data==`string`){if(e.data.startsWith(`{`))try{let n=JSON.parse(e.data);if(n.type){if(n.type===`session`&&n.id&&(S.current=n.id,x))try{localStorage.setItem(x,n.id)}catch{}n.type===`error`&&t.write(`\r\n\x1b[31mError: ${n.message}\x1b[0m\r\n`),n.type===`exited`&&b(!0);return}}catch{}t.write(e.data)}},f.onclose=()=>{u(!1),A()},f.onerror=()=>{f.close()}},[D]);function A(){let e=Math.min(1e3*2**c.current,3e4);c.current++,g(!0),s.current=setTimeout(()=>{k()},e)}return(0,m.useEffect)(()=>{let e=n.current;if(!e)return;let t=new f({cursorBlink:!0,fontSize:13,fontFamily:`var(--font-mono)`,theme:_(r.getState().theme)}),c=new d,l=new p;t.loadAddon(c),t.loadAddon(l),t.open(e),c.fit(),i.current=t,a.current=c,t.onData(e=>{if(e.includes(`\r`)||e.includes(`
|
|
3
3
|
`)){let e=t.buffer.active;C.current=e.baseY+e.cursorY+1}let n=o.current;n?.readyState===WebSocket.OPEN&&n.send(e)}),k();let u=new ResizeObserver(()=>{try{c.fit(),D()}catch{}});u.observe(e);let m=r.getState().theme,h=r.subscribe(e=>{e.theme!==m&&(m=e.theme,t.options.theme=_(e.theme))});return()=>{h(),u.disconnect(),s.current&&clearTimeout(s.current),o.current?.close(),o.current=null,t.dispose(),i.current=null,a.current=null}},[]),{connected:l,reconnecting:h,exited:y,sendData:w,getSelection:T,getLastCommandOutput:E,restart:O}}var b=t(),x=[{label:`Tab`,value:` `},{label:`Esc`,value:`\x1B`},{label:`Ctrl`,value:null,isModifier:!0},{label:`↑`,value:`\x1B[A`},{label:`↓`,value:`\x1B[B`},{label:`←`,value:`\x1B[D`},{label:`→`,value:`\x1B[C`}],S=(0,m.memo)(function({metadata:e,tabId:t}){let n=e?.sessionId??`new`,r=e?.projectName,d=(0,m.useRef)(null),{connected:f,reconnecting:p,exited:h,sendData:g,getSelection:_,getLastCommandOutput:v,restart:S}=y({sessionId:n,projectName:r,containerRef:d,tabId:t}),[C,w]=(0,m.useState)(!1),[T,E]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=window.visualViewport;if(!e)return;function t(){e&&E(e.height)}return e.addEventListener(`resize`,t),()=>e.removeEventListener(`resize`,t)},[]);let D=(0,m.useCallback)(()=>{(d.current?.querySelector(`.xterm-helper-textarea`))?.focus()},[]),O=(0,m.useCallback)(e=>{if(D(),C&&e.length===1){let t=e.toLowerCase().charCodeAt(0)-96;t>=1&&t<=26&&g(String.fromCharCode(t)),w(!1);return}g(e)},[C,g,D]),k=(0,m.useCallback)(async()=>{let e=_();e&&await navigator.clipboard.writeText(e)},[_]),A=(0,m.useCallback)(async()=>{try{let e=await navigator.clipboard.readText();e&&(g(e),D())}catch{}},[g,D]),j=(0,m.useCallback)(()=>{let e=_(),t=e||v();if(!t.trim())return;let n="```bash\n"+t+"\n```",i=e?`Terminal selection`:`Terminal output`,o=!1,c=()=>{o=!0};window.addEventListener(`ppm:send-to-chat:ack`,c,{once:!0}),window.dispatchEvent(new CustomEvent(`ppm:send-to-chat`,{detail:{text:n,label:i,projectName:r}})),window.removeEventListener(`ppm:send-to-chat:ack`,c),o?s.success(`Sent to chat`,{duration:1500}):a.getState().openTab({type:`chat`,title:`Chat`,projectId:null,metadata:{projectName:r,pendingMessage:n},closable:!0})},[_,v,r]),M=typeof window<`u`&&`ontouchstart`in window;return(0,b.jsxs)(`div`,{className:`flex flex-col h-full`,style:T?{maxHeight:`${T}px`}:void 0,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1 bg-surface border-b border-border text-xs`,children:[(0,b.jsx)(`span`,{className:i(`size-2 rounded-full`,h?`bg-error`:f?`bg-success`:p?`bg-warning`:`bg-error`)}),(0,b.jsx)(`span`,{className:`text-text-secondary`,children:h?`Process exited`:f?`Connected`:p?`Reconnecting...`:`Disconnected`}),h&&(0,b.jsxs)(`button`,{onClick:S,className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs bg-surface-elevated text-text-primary hover:bg-primary hover:text-primary-foreground active:bg-primary active:text-primary-foreground transition-colors`,children:[(0,b.jsx)(c,{size:10}),`Restart`]}),(0,b.jsxs)(`button`,{onClick:j,title:`Send to Chat`,className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs bg-surface-elevated text-text-primary hover:bg-primary hover:text-primary-foreground active:bg-primary active:text-primary-foreground transition-colors ml-auto`,children:[(0,b.jsx)(o,{size:10}),`Chat`]}),(0,b.jsx)(`span`,{className:`text-text-subtle font-mono`,children:n})]}),(0,b.jsx)(`div`,{ref:d,className:`flex-1 min-h-0 bg-background p-1`}),M&&(0,b.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1.5 bg-surface border-t border-border overflow-x-auto`,children:[(0,b.jsx)(`button`,{onClick:k,className:`px-2 py-1.5 rounded text-xs min-w-[36px] min-h-[32px] bg-surface-elevated text-text-primary active:bg-primary active:text-primary-foreground transition-colors select-none`,children:(0,b.jsx)(u,{size:14})}),(0,b.jsx)(`button`,{onClick:A,className:`px-2 py-1.5 rounded text-xs min-w-[36px] min-h-[32px] bg-surface-elevated text-text-primary active:bg-primary active:text-primary-foreground transition-colors select-none`,children:(0,b.jsx)(l,{size:14})}),(0,b.jsx)(`button`,{onClick:j,className:`px-2 py-1.5 rounded text-xs min-w-[36px] min-h-[32px] bg-surface-elevated text-text-primary active:bg-primary active:text-primary-foreground transition-colors select-none`,"aria-label":`Send to Chat`,children:(0,b.jsx)(o,{size:14})}),(0,b.jsx)(`div`,{className:`w-px h-5 bg-border mx-0.5`}),x.map(e=>(0,b.jsx)(`button`,{onClick:()=>{e.label===`Ctrl`?w(!C):e.value&&O(e.value)},className:i(`px-3 py-1.5 rounded text-xs font-mono min-w-[36px] min-h-[32px]`,`bg-surface-elevated text-text-primary active:bg-primary active:text-primary-foreground`,`transition-colors select-none`,e.label===`Ctrl`&&C&&`bg-primary text-primary-foreground`),children:e.label},e.label))]})]})});export{S as TerminalTab};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e}from"./vendor-mermaid-CsBwn--q.js";export{e as createTreemapServices};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{x as t}from"./vendor-markdown-0Mxgxy0L.js";import{i as n,r}from"./api-client-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{x as t}from"./vendor-markdown-0Mxgxy0L.js";import{i as n,r}from"./api-client-DG9qwosT.js";var i=e(t(),1);function a(e,t,a,o=0){let[s,c]=(0,i.useState)(null),[l,u]=(0,i.useState)(!1),d=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let i=!1,o=/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/raw?path=${encodeURIComponent(e)}`:`${n(t)}/files/raw?path=${encodeURIComponent(e)}`,s=r();return fetch(o,{headers:s?{Authorization:`Bearer ${s}`}:{}}).then(e=>{if(!e.ok)throw Error(`Failed`);return e.blob()}).then(e=>{if(i)return;let t=a?new Blob([e],{type:a}):e,n=URL.createObjectURL(t);d.current&&URL.revokeObjectURL(d.current),d.current=n,c(n)}).catch(()=>{i||u(!0)}),()=>{i=!0}},[e,t,a,o]),(0,i.useEffect)(()=>()=>{d.current&&URL.revokeObjectURL(d.current)},[]),{blobUrl:s,error:l}}export{a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{x as t}from"./vendor-markdown-0Mxgxy0L.js";import{n}from"./settings-store-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{x as t}from"./vendor-markdown-0Mxgxy0L.js";import{n}from"./settings-store-DRbccx1s.js";function r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e){if(Array.isArray(e))return e}function a(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){if(e==null)return{};var n,r,i=d(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function f(e,t){return i(e)||o(e,t)||h(e,t)||s()}function p(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=p(e,`string`);return typeof t==`symbol`?t:t+``}function h(e,t){if(e){if(typeof e==`string`)return r(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function b(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function x(e){return{}.toString.call(e).includes(`Object`)}function S(e){return!Object.keys(e).length}function C(e){return typeof e==`function`}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e,t){return x(t)||A(`changeType`),Object.keys(t).some(function(t){return!w(e,t)})&&A(`changeField`),t}function E(e){C(e)||A(`selectorType`)}function D(e){C(e)||x(e)||A(`handlerType`),x(e)&&Object.values(e).some(function(e){return!C(e)})&&A(`handlersType`)}function O(e){e||A(`initialIsRequired`),x(e)||A(`initialType`),S(e)&&A(`initialContent`)}function k(e,t){throw Error(e[t]||e.default)}var A=b(k)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),j={changes:T,selector:E,handler:D,initial:O};function ee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j.initial(e),j.handler(t);var n={current:e},r=b(P)(n,t),i=b(N)(n),a=b(j.changes)(e),o=b(M)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return j.selector(e),e(n.current)}function c(e){y(r,i,a,o)(e)}return[s,c]}function M(e,t){return C(t)?t(e.current):t}function N(e,t){return e.current=v(v({},e.current),t),t}function P(e,t,n){return C(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var F={create:ee},te={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function ne(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function re(e){return{}.toString.call(e).includes(`Object`)}function ie(e){return e||L(`configIsRequired`),re(e)||L(`configType`),e.urls?(ae(),{paths:{vs:e.urls.monacoBase}}):e}function ae(){console.warn(I.deprecation)}function oe(e,t){throw Error(e[t]||e.default)}var I={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|