@shumai-one/shumai 0.4.6 → 0.4.7

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.
Files changed (143) hide show
  1. package/bin/{chunk-1bgsphyz.js → chunk-05tnmf8h.js} +2 -2
  2. package/bin/chunk-0xsgx9ep.js +1 -0
  3. package/bin/{chunk-3d5rm1d1.js → chunk-0ygtayqf.js} +1 -1
  4. package/bin/{chunk-crja7whq.js → chunk-11c93g1m.js} +2 -2
  5. package/bin/chunk-1ajgdv26.js +1 -0
  6. package/bin/{chunk-ba33nf0q.js → chunk-1ntn42d2.js} +3 -3
  7. package/bin/chunk-2kxhdnma.js +3 -0
  8. package/bin/chunk-30dsxm8s.js +1 -0
  9. package/bin/chunk-3b6h719s.js +3 -0
  10. package/bin/{chunk-pdh9bnyj.js → chunk-3g5pyw2e.js} +2 -2
  11. package/bin/{chunk-p75f5pgq.js → chunk-3h9c5ak3.js} +2 -2
  12. package/bin/{chunk-2qjfpmcf.js → chunk-3m5kwcj7.js} +1 -1
  13. package/bin/{chunk-w1wxzqqb.js → chunk-3p1bb08a.js} +2 -2
  14. package/bin/{chunk-6vxzkrsj.js → chunk-3r5yc5wm.js} +4 -4
  15. package/bin/{chunk-sab7tjxw.js → chunk-3tyk9xgf.js} +3 -3
  16. package/bin/{chunk-h9mka9br.js → chunk-4a88wwg2.js} +1 -1
  17. package/bin/{chunk-z08bqvkc.js → chunk-4f5pnnah.js} +14 -14
  18. package/bin/{chunk-dpc11hpd.js → chunk-4jgq9m51.js} +7 -7
  19. package/bin/{chunk-d7fwggt6.js → chunk-4m8gk79m.js} +1 -1
  20. package/bin/{chunk-b9hyc0a1.js → chunk-53vtc74g.js} +2 -2
  21. package/bin/{chunk-1kt5dzjv.js → chunk-58e1a3re.js} +2 -2
  22. package/bin/{chunk-dmvvt8va.js → chunk-5qkwpy8c.js} +2 -2
  23. package/bin/{chunk-07jszkhj.js → chunk-5rk7dyx9.js} +58 -58
  24. package/bin/{chunk-ga3pahzf.js → chunk-5v4s2kp4.js} +1 -1
  25. package/bin/{chunk-v8v8vdf7.js → chunk-5wp37g6w.js} +4 -4
  26. package/bin/{chunk-hs2r9qaw.js → chunk-628k58ek.js} +2 -2
  27. package/bin/{chunk-rp4pc6kz.js → chunk-6kdf411z.js} +1 -1
  28. package/bin/chunk-6ksrrayx.css +1 -0
  29. package/bin/chunk-6rjkbwz6.js +14 -0
  30. package/bin/{chunk-md5pcq46.js → chunk-781990k7.js} +4 -4
  31. package/bin/{chunk-ey3h4sct.js → chunk-887pj9xd.js} +2 -2
  32. package/bin/{chunk-1jybg56e.js → chunk-8b1w6bj9.js} +1 -1
  33. package/bin/{chunk-0wvhahzh.js → chunk-8gna37dd.js} +1 -1
  34. package/bin/{chunk-rmzcarv9.js → chunk-8sf106rq.js} +1 -1
  35. package/bin/{chunk-2jrjwaqr.js → chunk-8ystwvdt.js} +1 -1
  36. package/bin/{chunk-3j5njrpr.js → chunk-9v6eqa3n.js} +2 -2
  37. package/bin/{chunk-rsd164d9.js → chunk-9va1mzeq.js} +1 -1
  38. package/bin/{chunk-kmbjp5kp.js → chunk-an6nsq1t.js} +1 -1
  39. package/bin/{chunk-vzj2j11x.js → chunk-ayq8dskd.js} +1 -1
  40. package/bin/{chunk-y20sbaz5.js → chunk-b0rjvx5g.js} +1 -1
  41. package/bin/chunk-bgm76rzj.js +1 -0
  42. package/bin/chunk-btmxr226.js +1 -0
  43. package/bin/chunk-camzbwqh.js +2 -0
  44. package/bin/{chunk-t350k3s1.js → chunk-ccvjwhqq.js} +1 -1
  45. package/bin/{chunk-pgj2kjnn.js → chunk-dkzyv61a.js} +2 -2
  46. package/bin/{chunk-y56yvezn.js → chunk-dyq6h9ha.js} +1 -1
  47. package/bin/{chunk-teqprbd8.js → chunk-e17daz1x.js} +1 -1
  48. package/bin/{chunk-dbw8c1jj.js → chunk-ebf1r872.js} +4 -4
  49. package/bin/{chunk-2vzzd0q6.js → chunk-ebx3bd4c.js} +1 -1
  50. package/bin/{chunk-161rxeq2.js → chunk-ee3mrvqp.js} +1 -1
  51. package/bin/chunk-fg6zf2gb.js +2 -0
  52. package/bin/{chunk-6y4xkcte.js → chunk-fhazy8f9.js} +1 -1
  53. package/bin/{chunk-gqr5hxhj.js → chunk-fk712d68.js} +1 -1
  54. package/bin/{chunk-afnzb9ne.js → chunk-fvgb6rps.js} +2 -2
  55. package/bin/chunk-g9gmht89.js +2 -0
  56. package/bin/{chunk-1t51fp6n.js → chunk-gf4n4ahk.js} +1 -1
  57. package/bin/{chunk-gcjsw9yp.js → chunk-h3wr8nnk.js} +1 -1
  58. package/bin/chunk-htpjtarr.js +2 -0
  59. package/bin/{chunk-kg8eg9z3.js → chunk-hye75kp0.js} +2 -2
  60. package/bin/{chunk-3tg39jx7.js → chunk-j41mya13.js} +2 -2
  61. package/bin/chunk-j547gtag.js +2 -0
  62. package/bin/{chunk-a4056d0r.js → chunk-jde9r5mj.js} +1 -1
  63. package/bin/chunk-jf4kcad0.js +1 -0
  64. package/bin/{chunk-tgr86ac4.js → chunk-jt04mf5s.js} +1 -1
  65. package/bin/{chunk-hnhdq2wd.js → chunk-k3qypq3x.js} +1 -1
  66. package/bin/chunk-k5hnrtrt.js +1 -0
  67. package/bin/{chunk-mtb9fpj2.js → chunk-k810fstm.js} +1 -1
  68. package/bin/{chunk-3n4224c0.js → chunk-kg2c445x.js} +1 -1
  69. package/bin/{chunk-edqd8evk.js → chunk-kq2qbwx1.js} +1 -1
  70. package/bin/{chunk-7nvk7waw.js → chunk-m2h7a172.js} +1 -1
  71. package/bin/{chunk-brwbhbmc.js → chunk-m638fg4n.js} +5 -5
  72. package/bin/{chunk-3dgahs95.js → chunk-mm1a0zja.js} +1 -1
  73. package/bin/{chunk-hxyg5q2a.js → chunk-njabdtvb.js} +2 -2
  74. package/bin/{chunk-b6q287d1.js → chunk-njqf50vw.js} +1 -1
  75. package/bin/{chunk-47tn3vtg.js → chunk-nn5hyf6f.js} +1 -1
  76. package/bin/{chunk-t7bvde99.js → chunk-nnq8g9yy.js} +3 -3
  77. package/bin/{chunk-8cn7fx40.js → chunk-ny7qjn6s.js} +1 -1
  78. package/bin/{chunk-3d9tfxp4.js → chunk-p5fwjk5c.js} +1 -1
  79. package/bin/{chunk-s05cdax2.js → chunk-pa1fmskf.js} +1 -1
  80. package/bin/{chunk-a796sgcw.js → chunk-pcspeqwq.js} +2 -2
  81. package/bin/{chunk-yfr0hzb7.js → chunk-q1d7x1cc.js} +1 -1
  82. package/bin/{chunk-y1b3ck7m.js → chunk-q45n02fs.js} +1 -1
  83. package/bin/chunk-q6jsw0rr.js +211 -0
  84. package/bin/chunk-qjzyze00.js +1 -0
  85. package/bin/{chunk-2yr5k567.js → chunk-r55htzxr.js} +1 -1
  86. package/bin/{chunk-46wfxyd7.js → chunk-r7e2fmmx.js} +2 -2
  87. package/bin/{chunk-5kvc1gp2.js → chunk-rbagbd0e.js} +1 -1
  88. package/bin/{chunk-dz076sh7.js → chunk-rdscv38p.js} +1 -1
  89. package/bin/chunk-rfhmk32e.js +1 -0
  90. package/bin/{chunk-qs7855cz.js → chunk-rkafv27g.js} +2 -2
  91. package/bin/{chunk-hd6dnnyg.js → chunk-rkqpnyzx.js} +1 -1
  92. package/bin/{chunk-z6jpt0h6.js → chunk-s30fjvzs.js} +3 -3
  93. package/bin/{chunk-dj5a6kkh.js → chunk-s41mgkse.js} +1 -1
  94. package/bin/{chunk-988casfy.js → chunk-s63vj79f.js} +1 -1
  95. package/bin/{chunk-9d0thqcy.js → chunk-t3t7dcfq.js} +1 -1
  96. package/bin/{chunk-gsfcpcye.js → chunk-twyxs4z2.js} +1 -1
  97. package/bin/{chunk-1dqsf5qj.js → chunk-typ46eqd.js} +5 -5
  98. package/bin/chunk-v1sgrg0r.js +1 -0
  99. package/bin/{chunk-j9ks8bd7.js → chunk-vdnmq163.js} +1 -1
  100. package/bin/{chunk-jg2v25d2.js → chunk-vx66rms0.js} +2 -2
  101. package/bin/{chunk-9nvymwqj.js → chunk-wvq717b5.js} +2 -2
  102. package/bin/chunk-xbge27m4.js +1 -0
  103. package/bin/{chunk-ysv80zyb.js → chunk-xca338dw.js} +3 -3
  104. package/bin/chunk-xcsz1wp7.js +1 -0
  105. package/bin/{chunk-ehpfg3km.js → chunk-xznabrt2.js} +1 -1
  106. package/bin/{chunk-pvg3msgw.js → chunk-xzyfnfck.js} +3 -3
  107. package/bin/{chunk-9trnkbtr.js → chunk-ycw3rwhx.js} +3 -3
  108. package/bin/{chunk-qbqym9m6.js → chunk-yqvhgtez.js} +2 -2
  109. package/bin/{chunk-4syt6rn0.js → chunk-yr03tf5r.js} +2 -2
  110. package/bin/{chunk-n3xjwszr.js → chunk-z9jpgxf1.js} +1 -1
  111. package/bin/chunk-zb0az2tq.js +2 -0
  112. package/bin/{chunk-pwkby9h7.js → chunk-zbt4h7n0.js} +1 -1
  113. package/bin/{chunk-kk42xhgz.js → chunk-zcdqsp1e.js} +1 -1
  114. package/bin/chunk-zej27b5c.js +2 -0
  115. package/bin/{chunk-axmd242s.js → chunk-zmjtv19e.js} +1 -1
  116. package/bin/{chunk-7e5z637e.js → chunk-zr11zfwc.js} +1 -1
  117. package/bin/{chunk-k6avge95.js → chunk-zz0522zr.js} +4 -4
  118. package/bin/shumai-app.html +1 -1
  119. package/bin/shumai-app.js +294 -293
  120. package/package.json +7 -7
  121. package/bin/chunk-0c67210c.js +0 -1
  122. package/bin/chunk-2z1pnt7h.js +0 -2
  123. package/bin/chunk-3vmapyk9.js +0 -1
  124. package/bin/chunk-886pnknh.js +0 -3
  125. package/bin/chunk-908pypkr.js +0 -1
  126. package/bin/chunk-952qwf17.js +0 -2
  127. package/bin/chunk-9a2tf0mh.js +0 -2
  128. package/bin/chunk-apfrw0wd.js +0 -3
  129. package/bin/chunk-batadmvr.js +0 -2
  130. package/bin/chunk-bvdvp192.js +0 -1
  131. package/bin/chunk-db1msmdh.js +0 -2
  132. package/bin/chunk-dkx3pmdz.js +0 -1
  133. package/bin/chunk-hacyjx1s.js +0 -1
  134. package/bin/chunk-he5nvmqw.js +0 -1
  135. package/bin/chunk-hyr1vtfp.js +0 -1
  136. package/bin/chunk-jh8q3885.js +0 -211
  137. package/bin/chunk-jzbrt2vk.js +0 -1
  138. package/bin/chunk-nqym3zbs.js +0 -1
  139. package/bin/chunk-sebbjvgv.css +0 -1
  140. package/bin/chunk-t8gv2ekj.js +0 -14
  141. package/bin/chunk-vm5tn0zm.js +0 -2
  142. package/bin/chunk-wmjp8dcm.js +0 -1
  143. package/bin/chunk-wy8dkyxj.js +0 -1
@@ -1,2 +1,2 @@
1
- import{h,D,b,u,S,Z,t,o,K,L,B,ft,Me,A,C,wg,xg,aC,Pt,gs,Nr,An,$n,Gc,yr,on,Ur,$t,ir,hr,Lo}from"./chunk-jh8q3885.js";import{Or}from"./chunk-07jszkhj.js";import{wa}from"./chunk-t8gv2ekj.js";import{va}from"./chunk-qs7855cz.js";import{ai,Zl}from"./chunk-2yr5k567.js";import{Bl}from"./chunk-h9mka9br.js";import{xa}from"./chunk-ysv80zyb.js";import{Er}from"./chunk-ehpfg3km.js";S();function ke(i,s,P,r,c,f){let O=i.type==="folder",y=s.type==="folder";if(O!==y)return null;let w=y?r:c,k=w.findIndex((a)=>a.id===P),v=w.findIndex((a)=>a.id===s.id);if(k===-1||v===-1)return null;let W=Math.min(k,v),U=Math.max(k,v),N=w.slice(W,U+1),l=new Set(f);return N.forEach((a)=>{if(a.id)l.add(a.id)}),l}function Gn({teamId:i,projectId:s,projectName:P,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:O}){let y=Me(),w=K(),{canEdit:k}=Pt(s),{setFields:v}=Or(),W=A.api.files[":fileId"].metadata.$patch,{mutate:U}=B({mutationFn:async(e)=>{if(!(await W(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:N}=L({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(N)v(N,s)},[N,s,v]);let l=r==="recently-deleted",a=r==="recents",[_,M]=u(null),[p,z]=u(new Set),[H,E]=u(null),[Ne,Ae]=u(240),[ze,Le]=u(360),{isChatbotOpen:V}=ir(),{members:Re,fetchMembers:oe}=Ur(),{metadata:ae,fetchMetadata:re,setMetadata:je}=hr(),ie=Boolean(ae["appearance.hideAgent"]);h(()=>{if(i)oe(i),re(i)},[i,oe,re]);let X=D(()=>f?.filter?.searchFilter?.conditions||[],[f]),[R,G]=u(X);h(()=>{G(X)},[X]);let le=`project:${s}:sort`,j=ae[le]||{field:"custom",order:"asc"},De=(e)=>{if(e)je(i,le,e)},x=!!f,Q=R.length>0||x,{fileListLeftSidebarCollapsed:de,setFileListLeftSidebarCollapsed:$e,fileListRightSidebarCollapsed:ce,setFileListRightSidebarCollapsed:Te,viewModes:qe}=$t(),fe=qe[s]??"card",Ee=b(null),{data:T}=l||a?{data:void 0}:L({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:pe,clearProjectState:ue}=on();h(()=>(pe({teamId:i,projectId:s,projectName:P,rootFolderId:c,ancestorFolders:T?.ancestorFolders??[],currentAsset:l?{name:wg(),type:"folder"}:a?{name:xg(),type:"folder"}:x?{id:f.id,name:f.name,type:"folder"}:{id:T?.id||r,name:T?.name,type:"folder"},isRootFolder:!l&&!a&&!x&&r===c,onFolderClick:(e)=>{y({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ue()),[i,s,P,T,l,a,r,c,pe,ue,y]);let{data:J,fetchNextPage:ge,hasNextPage:he,isFetchingNextPage:me,isLoading:Ke}=ft({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",R,j,x],queryFn:async({pageParam:e})=>{if(l||x||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(Q)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:j,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!Q&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:Y,fetchNextPage:ye,hasNextPage:xe,isFetchingNextPage:Se,isLoading:Qe}=ft({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",R,j,x],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:Q||x,conditions:R,sort:j}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),I=J?.pages.flatMap((e)=>e.data??[])??[],g=Y?.pages.flatMap((e)=>e.data??[])??[],Fe=(!Q&&!a?Ke:!1)||Qe,we=J?.pages[0]?.pageInfo?.total,be=Y?.pages[0]?.pageInfo?.total,ve=J?.pages[0]?.pageInfo?.totalSize,Ie=Y?.pages[0]?.pageInfo?.totalSize,ee=()=>{z(new Set),M(null),E(null)},{dragState:q,handleDragStart:Oe,handleDragEnd:We}=Zl({teamId:i,projectId:s,assetId:r,folders:I,files:g,selectedIds:p,onClearSelection:ee}),te=D(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return g.find((d)=>d.id===e)||null},[p,g]),Ce=(e)=>{if(l)return;if(e.type==="folder")G([]),y({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else y({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},Pe=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&H){let ne=[...I,...g].find((m)=>m.id===H);if(ne){let m=ke(ne,e,H,I,g,p);if(m){z(m),M(e);return}}}if(d){let F=new Set(p);if(F.has(e.id)){if(F.delete(e.id),z(F),_?.id===e.id){let m=[...I,...g].find((Ue)=>F.has(Ue.id));M(m||null),E(m?m.id:null)}}else F.add(e.id),z(F),E(e.id),M(e);return}z(new Set([e.id])),E(e.id),M(e)},se=(e,n,d)=>{U({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{w.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),w.invalidateQueries({queryKey:["search",i,r]})}})};if(Lo())return t(Bl,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,rootFolderId:c});return o($n,{modifiers:[ai.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===gs)return gs.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===gs)return gs.configure({dropAnimation:null});return n}),sensors:l||a||!k?[]:[An.configure({activationConstraints:[new Nr.Distance({value:10})]})],onDragStart:Oe,onDragEnd:We,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:Ee,className:"flex flex-1 overflow-hidden relative",children:[!de&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>$e(!0)}),(!ce||V)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{Te(!0),ir.getState().setIsChatbotOpen(!1)}}),!de&&o(Z,{children:[t("div",{className:"bg-background",style:{width:Ne},children:t(yr,{teamId:i,projectId:s,projectName:P,rootFolderId:c,dragState:q,ancestorFolders:T?.ancestorFolders??[]})}),t(Er,{onResize:(e)=>{Ae((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(wa,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,displayStyle:fe,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,filterConditions:R,onFilterChange:G,sort:j,onSortChange:De,dragState:q,collection:f,onUpdateCollection:O,rootFolderId:c}),(!ce||V&&!ie)&&o(Z,{children:[t(Er,{onResize:(e)=>{Le((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:ze},className:"bg-background flex flex-col flex-shrink-0",children:V&&!ie?t(va,{projectId:s,contextAssetId:r}):te?t(xa,{teamId:i,projectId:s,file:te,onSaveField:(e,n)=>se(te.id,e,n),members:Re,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:aC()})})]})]})}),t(Gc,{children:q?.isActive?t("div",{className:C("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",fe==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",q.itemCount," item",q.itemCount!==1?"s":""]})}):null})]})}
1
+ import{h,D,b,u,S,L,t,o,K,Z,B,ft,Me,A,C,Cg,Ig,hC,Pt,As,Nr,An,$n,Vc,yr,on,Ur,$t,lr,gr,Lo}from"./chunk-q6jsw0rr.js";import{Or}from"./chunk-5rk7dyx9.js";import{xa}from"./chunk-6rjkbwz6.js";import{wa}from"./chunk-rkafv27g.js";import{ai,Zl}from"./chunk-r55htzxr.js";import{Bl}from"./chunk-4a88wwg2.js";import{Sa}from"./chunk-xca338dw.js";import{Er}from"./chunk-xznabrt2.js";S();function ke(i,s,P,r,c,f){let O=i.type==="folder",y=s.type==="folder";if(O!==y)return null;let w=y?r:c,k=w.findIndex((a)=>a.id===P),v=w.findIndex((a)=>a.id===s.id);if(k===-1||v===-1)return null;let W=Math.min(k,v),U=Math.max(k,v),N=w.slice(W,U+1),l=new Set(f);return N.forEach((a)=>{if(a.id)l.add(a.id)}),l}function Gn({teamId:i,projectId:s,projectName:P,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:O}){let y=Me(),w=K(),{canEdit:k}=Pt(s),{setFields:v}=Or(),W=A.api.files[":fileId"].metadata.$patch,{mutate:U}=B({mutationFn:async(e)=>{if(!(await W(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:N}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(N)v(N,s)},[N,s,v]);let l=r==="recently-deleted",a=r==="recents",[_,M]=u(null),[p,z]=u(new Set),[H,E]=u(null),[Ne,Ae]=u(240),[ze,Le]=u(360),{isChatbotOpen:V}=lr(),{members:Re,fetchMembers:oe}=Ur(),{metadata:ae,fetchMetadata:re,setMetadata:je}=gr(),ie=Boolean(ae["appearance.hideAgent"]);h(()=>{if(i)oe(i),re(i)},[i,oe,re]);let X=D(()=>f?.filter?.searchFilter?.conditions||[],[f]),[R,G]=u(X);h(()=>{G(X)},[X]);let le=`project:${s}:sort`,j=ae[le]||{field:"custom",order:"asc"},De=(e)=>{if(e)je(i,le,e)},x=!!f,Q=R.length>0||x,{fileListLeftSidebarCollapsed:de,setFileListLeftSidebarCollapsed:$e,fileListRightSidebarCollapsed:ce,setFileListRightSidebarCollapsed:Te,viewModes:qe}=$t(),fe=qe[s]??"card",Ee=b(null),{data:T}=l||a?{data:void 0}:Z({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:pe,clearProjectState:ue}=on();h(()=>(pe({teamId:i,projectId:s,projectName:P,rootFolderId:c,ancestorFolders:T?.ancestorFolders??[],currentAsset:l?{name:Cg(),type:"folder"}:a?{name:Ig(),type:"folder"}:x?{id:f.id,name:f.name,type:"folder"}:{id:T?.id||r,name:T?.name,type:"folder"},isRootFolder:!l&&!a&&!x&&r===c,onFolderClick:(e)=>{y({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ue()),[i,s,P,T,l,a,r,c,pe,ue,y]);let{data:J,fetchNextPage:ge,hasNextPage:he,isFetchingNextPage:me,isLoading:Ke}=ft({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",R,j,x],queryFn:async({pageParam:e})=>{if(l||x||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(Q)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:j,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!Q&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:Y,fetchNextPage:ye,hasNextPage:xe,isFetchingNextPage:Se,isLoading:Qe}=ft({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",R,j,x],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:Q||x,conditions:R,sort:j}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),I=J?.pages.flatMap((e)=>e.data??[])??[],g=Y?.pages.flatMap((e)=>e.data??[])??[],Fe=(!Q&&!a?Ke:!1)||Qe,we=J?.pages[0]?.pageInfo?.total,be=Y?.pages[0]?.pageInfo?.total,ve=J?.pages[0]?.pageInfo?.totalSize,Ie=Y?.pages[0]?.pageInfo?.totalSize,ee=()=>{z(new Set),M(null),E(null)},{dragState:q,handleDragStart:Oe,handleDragEnd:We}=Zl({teamId:i,projectId:s,assetId:r,folders:I,files:g,selectedIds:p,onClearSelection:ee}),te=D(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return g.find((d)=>d.id===e)||null},[p,g]),Ce=(e)=>{if(l)return;if(e.type==="folder")G([]),y({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else y({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},Pe=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&H){let ne=[...I,...g].find((m)=>m.id===H);if(ne){let m=ke(ne,e,H,I,g,p);if(m){z(m),M(e);return}}}if(d){let F=new Set(p);if(F.has(e.id)){if(F.delete(e.id),z(F),_?.id===e.id){let m=[...I,...g].find((Ue)=>F.has(Ue.id));M(m||null),E(m?m.id:null)}}else F.add(e.id),z(F),E(e.id),M(e);return}z(new Set([e.id])),E(e.id),M(e)},se=(e,n,d)=>{U({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{w.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),w.invalidateQueries({queryKey:["search",i,r]})}})};if(Lo())return t(Bl,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,rootFolderId:c});return o($n,{modifiers:[ai.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===As)return As.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===As)return As.configure({dropAnimation:null});return n}),sensors:l||a||!k?[]:[An.configure({activationConstraints:[new Nr.Distance({value:10})]})],onDragStart:Oe,onDragEnd:We,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:Ee,className:"flex flex-1 overflow-hidden relative",children:[!de&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>$e(!0)}),(!ce||V)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{Te(!0),lr.getState().setIsChatbotOpen(!1)}}),!de&&o(L,{children:[t("div",{className:"bg-background",style:{width:Ne},children:t(yr,{teamId:i,projectId:s,projectName:P,rootFolderId:c,dragState:q,ancestorFolders:T?.ancestorFolders??[]})}),t(Er,{onResize:(e)=>{Ae((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(xa,{teamId:i,projectId:s,assetId:r,folders:I,files:g,totalFolders:we,totalFiles:be,totalFoldersSize:ve,totalFilesSize:Ie,selectedItem:_,selectedIds:p,onItemSelect:Pe,onItemDoubleClick:Ce,onSaveField:se,displayStyle:fe,onClearSelection:ee,fetchNextFoldersPage:ge,hasNextFoldersPage:he||!1,isFetchingNextFoldersPage:me,fetchNextFilesPage:ye,hasNextFilesPage:xe||!1,isFetchingNextFilesPage:Se,isRecentlyDeleted:l,isRecents:a,isLoading:Fe,filterConditions:R,onFilterChange:G,sort:j,onSortChange:De,dragState:q,collection:f,onUpdateCollection:O,rootFolderId:c}),(!ce||V&&!ie)&&o(L,{children:[t(Er,{onResize:(e)=>{Le((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:ze},className:"bg-background flex flex-col flex-shrink-0",children:V&&!ie?t(wa,{projectId:s,contextAssetId:r}):te?t(Sa,{teamId:i,projectId:s,file:te,onSaveField:(e,n)=>se(te.id,e,n),members:Re,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:hC()})})]})]})}),t(Vc,{children:q?.isActive?t("div",{className:C("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",fe==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",q.itemCount," item",q.itemCount!==1?"s":""]})}):null})]})}
2
2
  export{Gn};
@@ -1 +1 @@
1
- import{h,D,u,S,Z,t,o,ft,Me,Ue,A,F,Ya,jn,to,Ce,Ie,Te,S0,x_,Cf,Oc,hx,gn,lt,Nt,yr,$t,wt,Wp}from"./chunk-jh8q3885.js";import{Er}from"./chunk-ehpfg3km.js";import{tr}from"./chunk-2z1pnt7h.js";import{Rn,Nn,Dn,br,xt,_t}from"./chunk-b6q287d1.js";S();var k=(a)=>{if(!a)return"??";return a.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()};function T(){let{projectId:a}=j.useParams(),{teamId:r,ensureTeamIdForProject:n}=lt(),g=Me();h(()=>{n(a)},[a,n]);let{data:i}=tr(Wp(a)),d=i?.rootFolder,[v,N]=u(240),{fileListLeftSidebarCollapsed:m,setFileListLeftSidebarCollapsed:y}=$t(),{data:c,isLoading:w,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:l}=ft({queryKey:["collections",a],queryFn:async({pageParam:e})=>{let s=await A.api.projects[":projectId"].collections.$get({param:{projectId:a},query:{first:"20",after:e}});if(!s.ok)throw Error("Failed to fetch collections");return await s.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:I,inView:b}=Nt();h(()=>{if(b&&p&&!l)f()},[b,p,l,f]);let x=D(()=>c?.pages.flatMap((e)=>e.data)||[],[c]);if(!r||!d||!i)return t(wt,{});return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!m&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>y(!0)}),!m&&o(Z,{children:[t("div",{className:"bg-background",style:{width:v},children:t(yr,{teamId:r,projectId:a,projectName:i.name??"",rootFolderId:d})}),t(Er,{onResize:(e)=>{N((s)=>Math.max(180,Math.min(400,s+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:S0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:w?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):x.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(to,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:hx()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Rn,{children:[t(Nn,{children:o(br,{className:"hover:bg-transparent bg-muted/20",children:[t(xt,{className:"font-semibold px-4 py-3",children:x_()}),t(xt,{className:"font-semibold px-4 py-3",children:Oc()}),t(xt,{className:"font-semibold px-4 py-3 w-[200px]",children:Cf()})]})}),t(Dn,{children:x.map((e)=>o(br,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>g({to:"/projects/$projectId/collections/$collectionId",params:{projectId:a,collectionId:e.id}}),children:[t(_t,{className:"font-medium px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-4 w-4 text-primary shrink-0"}),t("span",{className:"text-foreground font-semibold hover:underline",children:e.name})]})}),t(_t,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:k(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:e.creator?.name||gn()})]})}),t(_t,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})})]},e.id))})]}),t("div",{ref:I,className:"h-10 w-full flex items-center justify-center",children:l&&t(F,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var j=Ue("/projects/$projectId/collections/")({component:T});export{j as Route};
1
+ import{h,D,u,S,L,t,o,ft,Me,Ue,A,F,Ya,jn,to,Ce,Ie,Te,M0,T_,Tf,Oc,xx,gn,lt,Nt,yr,$t,wt,Yp}from"./chunk-q6jsw0rr.js";import{Er}from"./chunk-xznabrt2.js";import{rr}from"./chunk-zej27b5c.js";import{Rn,Nn,Dn,br,xt,_t}from"./chunk-njqf50vw.js";S();var k=(a)=>{if(!a)return"??";return a.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()};function T(){let{projectId:a}=j.useParams(),{teamId:r,ensureTeamIdForProject:n}=lt(),g=Me();h(()=>{n(a)},[a,n]);let{data:i}=rr(Yp(a)),d=i?.rootFolder,[v,N]=u(240),{fileListLeftSidebarCollapsed:m,setFileListLeftSidebarCollapsed:y}=$t(),{data:c,isLoading:w,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:l}=ft({queryKey:["collections",a],queryFn:async({pageParam:e})=>{let s=await A.api.projects[":projectId"].collections.$get({param:{projectId:a},query:{first:"20",after:e}});if(!s.ok)throw Error("Failed to fetch collections");return await s.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:I,inView:b}=Nt();h(()=>{if(b&&p&&!l)f()},[b,p,l,f]);let x=D(()=>c?.pages.flatMap((e)=>e.data)||[],[c]);if(!r||!d||!i)return t(wt,{});return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!m&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>y(!0)}),!m&&o(L,{children:[t("div",{className:"bg-background",style:{width:v},children:t(yr,{teamId:r,projectId:a,projectName:i.name??"",rootFolderId:d})}),t(Er,{onResize:(e)=>{N((s)=>Math.max(180,Math.min(400,s+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:M0()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:w?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):x.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(to,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:xx()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(Rn,{children:[t(Nn,{children:o(br,{className:"hover:bg-transparent bg-muted/20",children:[t(xt,{className:"font-semibold px-4 py-3",children:T_()}),t(xt,{className:"font-semibold px-4 py-3",children:Oc()}),t(xt,{className:"font-semibold px-4 py-3 w-[200px]",children:Tf()})]})}),t(Dn,{children:x.map((e)=>o(br,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>g({to:"/projects/$projectId/collections/$collectionId",params:{projectId:a,collectionId:e.id}}),children:[t(_t,{className:"font-medium px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[t(Ya,{className:"h-4 w-4 text-primary shrink-0"}),t("span",{className:"text-foreground font-semibold hover:underline",children:e.name})]})}),t(_t,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:k(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:e.creator?.name||gn()})]})}),t(_t,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(jn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})})]},e.id))})]}),t("div",{ref:I,className:"h-10 w-full flex items-center justify-center",children:l&&t(F,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var j=Ue("/projects/$projectId/collections/")({component:T});export{j as Route};