@teammy/server 0.2.2 → 0.2.3
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/main.js +8 -2
- package/dist/web/assets/{Assistant-ZM9at-n8.js → Assistant-Ceif-ARy.js} +1 -1
- package/dist/web/assets/{Computers-CV-4FaxZ.js → Computers-B_8KVFSv.js} +1 -1
- package/dist/web/assets/{Conversation-CZ8mOF1T.js → Conversation-1APTn0kq.js} +1 -1
- package/dist/web/assets/Dashboard-B-LuQT0a.js +1 -0
- package/dist/web/assets/{Files-DD-tWR-r.js → Files-BdfIlw8b.js} +1 -1
- package/dist/web/assets/{Help-DGI26Qe5.js → Help-BXvLax7h.js} +4 -4
- package/dist/web/assets/{HtmlPreview-TOlZ7wbO.js → HtmlPreview-BcspnVI6.js} +1 -1
- package/dist/web/assets/{Markdown-Drn0H2RJ.js → Markdown-Bb9dy2Sh.js} +1 -1
- package/dist/web/assets/{MessageComposer-SftlQB1e.js → MessageComposer-B6iTInqD.js} +1 -1
- package/dist/web/assets/{ResourceLibrary-RyTep8PC.js → ResourceLibrary-CXqTEv7V.js} +1 -1
- package/dist/web/assets/{WorkspaceTree-BEiahyEL.js → WorkspaceTree-D0UUUBtF.js} +1 -1
- package/dist/web/assets/{file-links-BYBi3BDP.js → file-links-B0q73ekI.js} +1 -1
- package/dist/web/assets/{index-BQicHl1a.js → index-C5-iSe99.js} +2 -2
- package/dist/web/downloads/teammy-skill.zip +0 -0
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/Dashboard-wZpQ1Qxb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,H as t,J as n,L as r,N as i,U as a,_t as o,c as s,h as c,l,s as u,u as d,y as f}from"./index-
|
|
1
|
+
import{G as e,H as t,J as n,L as r,N as i,U as a,_t as o,c as s,h as c,l,s as u,u as d,y as f}from"./index-C5-iSe99.js";var p=o(),m=new Intl.Collator(`zh-CN`,{numeric:!0,sensitivity:`base`});function h(e,t){return m.compare(e,t)||(e<t?-1:+(e>t))}var g=e();function _(e){let t=e.target.closest(`[role="treeitem"]`);if(!t)return;let n=[...e.currentTarget.querySelectorAll(`[role="treeitem"]`)].filter(e=>!e.closest(`[hidden]`)),r=n.indexOf(t),i=Number(t.getAttribute(`aria-level`)),a;switch(e.key){case`ArrowDown`:a=n[r+1];break;case`ArrowUp`:a=n[r-1];break;case`Home`:a=n[0];break;case`End`:a=n.at(-1);break;case`ArrowRight`:t.getAttribute(`aria-expanded`)===`false`?t.click():Number(n[r+1]?.getAttribute(`aria-level`))>i&&(a=n[r+1]);break;case`ArrowLeft`:t.getAttribute(`aria-expanded`)===`true`?t.click():a=n.slice(0,r).reverse().find(e=>Number(e.getAttribute(`aria-level`))<i);break;default:return}e.preventDefault(),a?.focus()}var v=(e,t)=>`${e}/${t}`,y=e=>({"--tree-level":e});function b({members:e,...t}){let[n,r]=(0,p.useState)(()=>`folder:${v(e.find(e=>e.hasFiles)?.id??`_project`,``)}`);return(0,g.jsx)(`div`,{role:`tree`,"aria-label":`工作区文件`,"data-testid":`workspace-tree`,onKeyDown:_,children:(0,g.jsx)(S,{owner:u,path:``,level:1,members:e.filter(e=>e.hasFiles),context:{...t,focused:n,onFocus:r}})})}function x({owner:e,path:t,level:n,context:r}){let a=r.expanded.has(v(e,t)),o=`folder:${v(e,t)}`;return(0,g.jsxs)(`div`,{role:`none`,children:[(0,g.jsxs)(c,{type:`button`,role:`treeitem`,className:`tree-item tree-folder`,style:y(n),"aria-label":t||e,"aria-level":n,"aria-expanded":a,"aria-selected":r.selected?.kind===`directory`&&r.selected.owner===e&&r.selected.path===t,tabIndex:r.focused===o?0:-1,"data-testid":`directory-row`,"data-owner-id":e,"data-directory-path":t,onFocus:()=>r.onFocus(o),onClick:()=>r.onToggle(e,t),leading:(0,g.jsx)(`span`,{className:`tree-chevron ${a?`expanded`:``}`,children:(0,g.jsx)(i,{name:`chevron`,size:`small`})}),children:[(0,g.jsx)(i,{name:`files`}),(0,g.jsx)(`span`,{className:`tree-name`,children:t.split(`/`).at(-1)||e})]}),a&&(0,g.jsx)(S,{owner:e,path:t,level:n+1,context:r})]})}function S({owner:e,path:o,level:u,context:m,members:_=[]}){let{api:b,projectId:S}=f(),C=(0,p.useCallback)(t=>b.tree(e,o,void 0,``,t),[e,o]),w=t(C,!1,a(S,`file-tree`,e,o)),[T,E]=(0,p.useState)(),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),j=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>j.current?.abort(),[]);let M=T?.revision===w.data?.revision?T:void 0,N=M?M.nextCursor:w.data?.nextCursor;async function P(){if(!N||!w.data||D)return;O(!0),A(``);let t=new AbortController;j.current=t;try{let n=await b.tree(e,o,w.data.revision,N,t.signal);t.signal.aborted||E({...n,entries:[...M?.entries??[],...n.entries]})}catch(e){t.signal.aborted||A(n(e))}finally{t.signal.aborted||O(!1)}}let F=[...(w.data?.entries??[]).filter(e=>!l(e.path)),...(M?.entries??[]).filter(e=>!l(e.path))],I=m.revealed;if(I?.owner===e&&!l(I.path)&&(!o||I.path.startsWith(o+`/`))){let e=o?I.path.slice(o.length+1):I.path,t=e.indexOf(`/`),n=t<0?I.path:[o,e.slice(0,t)].filter(Boolean).join(`/`);F.some(e=>e.path===n)||F.push(t<0?{...I.file,kind:`file`}:{kind:`directory`,path:n})}let L=[...F.filter(t=>e!==`_project`||!s(t.path)).map(t=>({...t,owner:e})),..._.map(e=>({kind:`directory`,path:``,owner:e.id}))].sort((e,t)=>e.kind===t.kind?h(e.path.split(`/`).at(-1)||e.owner,t.path.split(`/`).at(-1)||t.owner):e.kind===`directory`?-1:1);return(0,g.jsxs)(`div`,{role:`group`,"aria-label":v(d(e)?`teamcontext`:e,o),"aria-busy":w.loading||D,children:[w.loading&&(0,g.jsx)(`p`,{className:`tree-status`,role:`status`,children:`正在加载…`}),(0,g.jsx)(r,{error:!0,children:w.error||k}),w.error&&(0,g.jsx)(`button`,{className:`tree-action`,onClick:()=>void w.reload(),children:`重试`}),L.map(t=>t.kind===`directory`?(0,g.jsx)(x,{owner:t.owner,path:t.path,level:u,context:m},v(t.owner,t.path)):(0,g.jsxs)(c,{type:`button`,role:`treeitem`,className:`tree-item`,style:y(u),"aria-label":t.path,"aria-level":u,"aria-selected":m.selected?.kind===`file`&&m.selected.owner===e&&m.selected.path===t.path,tabIndex:m.focused===`file:${v(e,t.path)}`?0:-1,"data-testid":`file-row`,"data-owner-id":e,"data-file-path":t.path,onFocus:()=>m.onFocus(`file:${v(e,t.path)}`),onClick:()=>m.onSelect(e,t.path),leading:(0,g.jsx)(`span`,{className:`tree-chevron`}),children:[(0,g.jsx)(i,{name:`file`}),(0,g.jsx)(`span`,{className:`tree-name`,children:t.path.split(`/`).at(-1)})]},t.path)),N&&(0,g.jsx)(`button`,{className:`tree-action`,"data-testid":`files-load-more`,disabled:D,onClick:()=>void P(),children:D?`正在加载…`:`加载更多`})]})}export{h as i,v as n,_ as r,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{et as e}from"./index-
|
|
1
|
+
import{et as e}from"./index-C5-iSe99.js";function t(t,n){if(!n||/^(?:[a-z][a-z0-9+.-]*:|\/)/i.test(n))return null;try{let r=n.split(/[?#]/,1)[0],i=r?t.split(`/`).slice(0,-1):t.split(`/`);for(let e of r.split(`/`)){let t=decodeURIComponent(e);if(t&&t!==`.`){if(t===`..`){if(!i.length)return null;i.pop()}else{if(t.includes(`/`)||t.includes(`\\`))return null;i.push(t)}}}return{path:i.length?e.parse(i.join(`/`)):``,directory:r.endsWith(`/`),anchor:n.includes(`#`)?decodeURIComponent(n.slice(n.indexOf(`#`)+1)):``}}catch{return null}}export{t};
|