@shumai-one/shumai 0.4.7 → 0.4.9
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/bin/chunk-01v2xh5b.js +1 -0
- package/bin/{chunk-4m8gk79m.js → chunk-09367z2r.js} +2 -2
- package/bin/{chunk-781990k7.js → chunk-0g7ayjb5.js} +4 -4
- package/bin/{chunk-5wp37g6w.js → chunk-0mv8jp7h.js} +6 -6
- package/bin/{chunk-11c93g1m.js → chunk-0w3388vp.js} +2 -2
- package/bin/chunk-15n1v8mm.js +1 -0
- package/bin/chunk-17k9a427.js +211 -0
- package/bin/{chunk-dyq6h9ha.js → chunk-1kr1jsrt.js} +1 -1
- package/bin/{chunk-njabdtvb.js → chunk-1v11geh0.js} +2 -2
- package/bin/chunk-258tjpym.js +1 -0
- package/bin/chunk-2ar64j3z.js +2 -0
- package/bin/{chunk-ebf1r872.js → chunk-2j31y48k.js} +5 -5
- package/bin/{chunk-z9jpgxf1.js → chunk-2txahdj8.js} +2 -2
- package/bin/{chunk-gc6m7agb.js → chunk-315w58w6.js} +2 -2
- package/bin/{chunk-0ygtayqf.js → chunk-41fbx9mc.js} +1 -1
- package/bin/{chunk-zz0522zr.js → chunk-46brm12f.js} +4 -4
- package/bin/{chunk-q1d7x1cc.js → chunk-46hmh2ag.js} +1 -1
- package/bin/{chunk-zbt4h7n0.js → chunk-4cj3pz27.js} +1 -1
- package/bin/{chunk-camzbwqh.js → chunk-4sqbjvjt.js} +1 -1
- package/bin/{chunk-jde9r5mj.js → chunk-5e4de0a1.js} +1 -1
- package/bin/{chunk-b3aqmcps.js → chunk-5w7yxz6p.js} +2 -2
- package/bin/{chunk-ebx3bd4c.js → chunk-6m44n3ms.js} +1 -1
- package/bin/{chunk-hye75kp0.js → chunk-6mnj9adr.js} +2 -2
- package/bin/{chunk-twyxs4z2.js → chunk-6snwrej9.js} +1 -1
- package/bin/{chunk-mm1a0zja.js → chunk-6vqga3ma.js} +1 -1
- package/bin/{chunk-t3t7dcfq.js → chunk-6yayg55q.js} +1 -1
- package/bin/{chunk-9va1mzeq.js → chunk-7hmt2gs5.js} +2 -2
- package/bin/{chunk-3h9c5ak3.js → chunk-7zfyrt40.js} +1 -1
- package/bin/{chunk-fvgb6rps.js → chunk-82cg5497.js} +2 -2
- package/bin/{chunk-628k58ek.js → chunk-8mhj6r2q.js} +2 -2
- package/bin/{chunk-radcwage.js → chunk-8mjb093y.js} +2 -2
- package/bin/{chunk-h3wr8nnk.js → chunk-8r9q7xcv.js} +1 -1
- package/bin/{chunk-wvq717b5.js → chunk-9fe75ns9.js} +2 -2
- package/bin/{chunk-05tnmf8h.js → chunk-aant41bd.js} +2 -2
- package/bin/{chunk-v1sgrg0r.js → chunk-anky1dmg.js} +1 -1
- package/bin/{chunk-k810fstm.js → chunk-bg2vgnzt.js} +1 -1
- package/bin/{chunk-3tyk9xgf.js → chunk-c0wqfya9.js} +2 -2
- package/bin/{chunk-8b1w6bj9.js → chunk-c3010erf.js} +1 -1
- package/bin/{chunk-vdnmq163.js → chunk-c7hr2jga.js} +2 -2
- package/bin/chunk-c8aw8dye.js +2 -0
- package/bin/{chunk-zr11zfwc.js → chunk-ckd5hnd0.js} +2 -2
- package/bin/{chunk-dkzyv61a.js → chunk-cphwmdq5.js} +2 -2
- package/bin/{chunk-typ46eqd.js → chunk-d70acjwn.js} +5 -5
- package/bin/{chunk-xznabrt2.js → chunk-dzj91k6v.js} +1 -1
- package/bin/chunk-e2724ggn.js +2 -0
- package/bin/chunk-e2j3vwcv.js +2 -0
- package/bin/{chunk-k3qypq3x.js → chunk-e2qn4d57.js} +1 -1
- package/bin/{chunk-kg2c445x.js → chunk-eedhf8eb.js} +1 -1
- package/bin/chunk-ef3av8ay.js +1 -0
- package/bin/{chunk-j41mya13.js → chunk-f3f6cary.js} +3 -3
- package/bin/chunk-fjvbgahx.css +1 -0
- package/bin/chunk-fw0f45qw.js +2 -0
- package/bin/{chunk-s30fjvzs.js → chunk-fw5xzcnf.js} +4 -4
- package/bin/{chunk-8sf106rq.js → chunk-g6rw4jj5.js} +1 -1
- package/bin/{chunk-dscq4a4k.js → chunk-g7qejgap.js} +2 -2
- package/bin/{chunk-4jgq9m51.js → chunk-gj0yxtqz.js} +7 -7
- package/bin/{chunk-m2h7a172.js → chunk-gvbajsje.js} +1 -1
- package/bin/{chunk-s63vj79f.js → chunk-h29rwayb.js} +1 -1
- package/bin/chunk-h37zfvmp.js +3 -0
- package/bin/{chunk-m638fg4n.js → chunk-ht4chp45.js} +5 -5
- package/bin/{chunk-3g5pyw2e.js → chunk-jpjc44j6.js} +2 -2
- package/bin/{chunk-9v6eqa3n.js → chunk-jraqe5z0.js} +2 -2
- package/bin/{chunk-yqvhgtez.js → chunk-jxfz4h24.js} +2 -2
- package/bin/chunk-jy8by162.js +1 -0
- package/bin/{chunk-53vtc74g.js → chunk-jyg525f5.js} +2 -2
- package/bin/chunk-jz9mcrj6.js +1 -0
- package/bin/chunk-k4n9rdq3.js +1 -0
- package/bin/{chunk-e17daz1x.js → chunk-kemfwmyq.js} +2 -2
- package/bin/{chunk-6rjkbwz6.js → chunk-kmx350y5.js} +9 -9
- package/bin/{chunk-887pj9xd.js → chunk-kn82bccp.js} +2 -2
- package/bin/chunk-kx0qbs28.js +1 -0
- package/bin/{chunk-nnq8g9yy.js → chunk-m0xbfmf0.js} +3 -3
- package/bin/{chunk-rbagbd0e.js → chunk-n6sny5c8.js} +1 -1
- package/bin/{chunk-ayq8dskd.js → chunk-nhfbnqdr.js} +2 -2
- package/bin/{chunk-5qkwpy8c.js → chunk-nr80mrry.js} +2 -2
- package/bin/{chunk-4f5pnnah.js → chunk-ns8whqp6.js} +30 -30
- package/bin/{chunk-p5fwjk5c.js → chunk-nz16584e.js} +1 -1
- package/bin/{chunk-yr03tf5r.js → chunk-p46em0kf.js} +3 -3
- package/bin/{chunk-gf4n4ahk.js → chunk-p4nbgn3v.js} +1 -1
- package/bin/chunk-p7j6zgdg.js +2 -0
- package/bin/chunk-pbyp1xnb.js +2 -0
- package/bin/{chunk-r55htzxr.js → chunk-pw81eh3g.js} +2 -2
- package/bin/{chunk-rkafv27g.js → chunk-q6k1ctph.js} +2 -2
- package/bin/{chunk-fhazy8f9.js → chunk-qa7pphr5.js} +1 -1
- package/bin/chunk-qah2r4xa.js +2 -0
- package/bin/chunk-r4w1e3bd.js +2 -0
- package/bin/{chunk-6kdf411z.js → chunk-rbh4w2v2.js} +1 -1
- package/bin/{chunk-3p1bb08a.js → chunk-rd5ek2sk.js} +2 -2
- package/bin/{chunk-8ystwvdt.js → chunk-rv15x8aw.js} +2 -2
- package/bin/{chunk-b0rjvx5g.js → chunk-ryvq9pbw.js} +2 -2
- package/bin/{chunk-4a88wwg2.js → chunk-s9whhdb3.js} +2 -2
- package/bin/{chunk-ycw3rwhx.js → chunk-sby10fz6.js} +3 -3
- package/bin/{chunk-q45n02fs.js → chunk-sedbz4km.js} +1 -1
- package/bin/{chunk-ccvjwhqq.js → chunk-sfwmwrq3.js} +1 -1
- package/bin/{chunk-zmjtv19e.js → chunk-sg8hjkyg.js} +1 -1
- package/bin/{chunk-3r5yc5wm.js → chunk-snedd3at.js} +6 -6
- package/bin/{chunk-an6nsq1t.js → chunk-spm13ndr.js} +2 -2
- package/bin/chunk-ss1jchgx.js +1 -0
- package/bin/{chunk-rdscv38p.js → chunk-szjkmkwc.js} +1 -1
- package/bin/chunk-t0nktwrm.js +1 -0
- package/bin/{chunk-1ntn42d2.js → chunk-t9eb2mdq.js} +3 -3
- package/bin/{chunk-njqf50vw.js → chunk-tcyp8qtg.js} +2 -2
- package/bin/{chunk-nn5hyf6f.js → chunk-tefct00a.js} +1 -1
- package/bin/{chunk-xca338dw.js → chunk-thzf89fp.js} +3 -3
- package/bin/{chunk-pcspeqwq.js → chunk-tnv4ggx2.js} +4 -4
- package/bin/chunk-tptgxbqa.js +2 -0
- package/bin/{chunk-xzyfnfck.js → chunk-v2901ff5.js} +8 -8
- package/bin/{chunk-vx66rms0.js → chunk-v2vdm22x.js} +1 -1
- package/bin/{chunk-5rk7dyx9.js → chunk-v8ngtwzx.js} +53 -53
- package/bin/chunk-xex9v0rn.js +2 -0
- package/bin/chunk-xs2w45vp.js +1 -0
- package/bin/{chunk-s41mgkse.js → chunk-xw7jea6g.js} +1 -1
- package/bin/chunk-xza8wate.js +2 -0
- package/bin/{chunk-pa1fmskf.js → chunk-yet4fnab.js} +1 -1
- package/bin/{chunk-ny7qjn6s.js → chunk-yfjyjjpz.js} +1 -1
- package/bin/{chunk-5vvvgjvz.js → chunk-ytffpk7c.js} +2 -2
- package/bin/{chunk-kq2qbwx1.js → chunk-yyj21k15.js} +1 -1
- package/bin/{chunk-5v4s2kp4.js → chunk-zhtc1j3r.js} +1 -1
- package/bin/{chunk-8gna37dd.js → chunk-zpk482rb.js} +2 -2
- package/bin/{chunk-zcdqsp1e.js → chunk-zy32pf0s.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +562 -317
- package/package.json +7 -7
- package/prisma/migrations/20260927092537_add_notification_email_status/migration.sql +11 -0
- package/prisma/schema.prisma +10 -0
- package/bin/chunk-0xsgx9ep.js +0 -1
- package/bin/chunk-1ajgdv26.js +0 -1
- package/bin/chunk-30dsxm8s.js +0 -1
- package/bin/chunk-3b6h719s.js +0 -3
- package/bin/chunk-3m5kwcj7.js +0 -2
- package/bin/chunk-58e1a3re.js +0 -2
- package/bin/chunk-6ksrrayx.css +0 -1
- package/bin/chunk-bgm76rzj.js +0 -1
- package/bin/chunk-btmxr226.js +0 -1
- package/bin/chunk-ee3mrvqp.js +0 -2
- package/bin/chunk-fg6zf2gb.js +0 -2
- package/bin/chunk-fk712d68.js +0 -2
- package/bin/chunk-g9gmht89.js +0 -2
- package/bin/chunk-htpjtarr.js +0 -2
- package/bin/chunk-j547gtag.js +0 -2
- package/bin/chunk-jf4kcad0.js +0 -1
- package/bin/chunk-jt04mf5s.js +0 -2
- package/bin/chunk-k5hnrtrt.js +0 -1
- package/bin/chunk-q6jsw0rr.js +0 -211
- package/bin/chunk-qjzyze00.js +0 -1
- package/bin/chunk-rfhmk32e.js +0 -1
- package/bin/chunk-rkqpnyzx.js +0 -2
- package/bin/chunk-xbge27m4.js +0 -1
- package/bin/chunk-xcsz1wp7.js +0 -1
- package/bin/chunk-zb0az2tq.js +0 -2
- package/bin/chunk-zej27b5c.js +0 -2
package/bin/chunk-qjzyze00.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,Ue,A,lt,wt,tm}from"./chunk-q6jsw0rr.js";import"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import"./chunk-rkafv27g.js";import"./chunk-xznabrt2.js";import{Zi}from"./chunk-4f5pnnah.js";import"./chunk-an6nsq1t.js";import"./chunk-b0rjvx5g.js";import{rr}from"./chunk-zej27b5c.js";import"./chunk-4m8gk79m.js";import"./chunk-fk712d68.js";import"./chunk-9va1mzeq.js";import"./chunk-8sf106rq.js";S();function p(){let{projectId:e,folderId:d}=s.useParams(),{teamId:r,ensureTeamIdForProject:i}=lt();h(()=>{i(e)},[e,i]);let{data:a}=rr(tm(e)),o=a?.rootFolder,{data:l}=Z({queryKey:["folders",o],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!l)return t(wt,{});return t(Zi,{teamId:r,projectId:e,projectName:a.name??"",assetId:d,rootFolderId:o,isRoot:!1})}var s=Ue("/projects/$projectId/folders/$folderId_/agentsmd")({component:p});export{s as Route};
|
package/bin/chunk-rfhmk32e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,B,Ue,A,Nh,lt,em,_A}from"./chunk-q6jsw0rr.js";import"./chunk-5rk7dyx9.js";import"./chunk-6rjkbwz6.js";import"./chunk-camzbwqh.js";import"./chunk-3p1bb08a.js";import"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import"./chunk-rkafv27g.js";import"./chunk-r55htzxr.js";import"./chunk-ayq8dskd.js";import"./chunk-4a88wwg2.js";import"./chunk-j41mya13.js";import"./chunk-xca338dw.js";import"./chunk-xznabrt2.js";import{Gn}from"./chunk-kq2qbwx1.js";import{rr}from"./chunk-zej27b5c.js";import"./chunk-4m8gk79m.js";import"./chunk-9va1mzeq.js";import"./chunk-jt04mf5s.js";import"./chunk-8ystwvdt.js";import"./chunk-8sf106rq.js";import"./chunk-q1d7x1cc.js";import"./chunk-fhazy8f9.js";import"./chunk-0ygtayqf.js";S();function u(){let{projectId:o,collectionId:r}=y.useParams(),{teamId:s,ensureTeamIdForProject:i}=lt();h(()=>{i(o)},[o,i]);let{data:l}=rr(em(o)),{data:a,refetch:d}=Z({..._A(r)}),{mutate:p}=B({mutationFn:async(n)=>{let c=await A.api.collections[":collectionId"].$patch({param:{collectionId:r},json:n});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{d()}}),e=l?.rootFolder,{data:f}=Z({queryKey:["folders",e],queryFn:async()=>{let n=await A.api.folders[":folderId"].$get({param:{folderId:e}});if(!n.ok)throw Error("Failed to fetch folder");return await n.json()},enabled:!!e});if(!s||!e||!f||!a)return t("div",{children:Nh()});let m=a.filter.sourceFolderId||e;return t(Gn,{teamId:s,projectId:o,projectName:l.name??"",assetId:m,rootFolderId:e,collection:a,onUpdateCollection:p})}var y=Ue("/projects/$projectId/collections/$collectionId")({component:u});export{y as Route};
|
package/bin/chunk-rkqpnyzx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Dt}from"./chunk-s30fjvzs.js";import{$e}from"./chunk-781990k7.js";import{z}from"./chunk-yqvhgtez.js";var _=z(Dt()),N=z($e()),wc="AWS_ACCESS_KEY_ID",xc="AWS_SECRET_ACCESS_KEY",S="AWS_SESSION_TOKEN",C="AWS_CREDENTIAL_EXPIRATION",A="AWS_CREDENTIAL_SCOPE",p="AWS_ACCOUNT_ID",Fu=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[wc],E=process.env[xc],r=process.env[S],n=process.env[C],s=process.env[A],t=process.env[p];if(o&&E){let c={accessKeyId:o,secretAccessKey:E,...r&&{sessionToken:r},...n&&{expiration:new Date(n)},...s&&{credentialScope:s},...t&&{accountId:t}};return _.setCredentialFeature(c,"CREDENTIALS_ENV_VARS","g"),c}throw new N.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{wc,xc,Fu};
|
package/bin/chunk-xbge27m4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,b,u,S,L,t,o,K,Si,Z,B,Me,Un,Ue,A,F,er,C,E,Ne,it,Fc,Lc,zy,dd,ki,Lb,wh,Oo,HE,Fo,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,H,lt,Nt,k,on,Ur,$t,lr,gr,Lo,hA}from"./chunk-q6jsw0rr.js";import"./chunk-camzbwqh.js";import"./chunk-3p1bb08a.js";import{Wr}from"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import{wa}from"./chunk-rkafv27g.js";import{Xo,Ul,ts,ys}from"./chunk-5rk7dyx9.js";import{Fl,Ll}from"./chunk-ee3mrvqp.js";import"./chunk-j41mya13.js";import{Sa}from"./chunk-xca338dw.js";import{Er}from"./chunk-xznabrt2.js";import"./chunk-9va1mzeq.js";import"./chunk-jt04mf5s.js";import"./chunk-8ystwvdt.js";import"./chunk-fhazy8f9.js";import"./chunk-0ygtayqf.js";S();var kt=({item:n})=>{if(n.preview?.thumbnailUrl)return t("img",{src:n.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(n.preview?.proxyType==="audio"||n.proxyType==="audio")return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(Xo,{className:"w-5 h-5 text-muted-foreground"})});return t("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:t(er,{className:"w-5 h-5 text-muted-foreground"})})},Te=({projectId:n,currentAssetId:s,parentFolderId:w,initialFiles:d,initialNextCursor:D})=>{let{ref:a,inView:N}=Nt({threshold:0,rootMargin:"200px"}),x=b(null),V=b(!0),[c,p]=u(d),[f,U]=u(D),[W,Y]=u(!!D),[q,g]=u(!1);return h(()=>{p(d),U(D),Y(!!D),V.current=!0},[d,D]),h(()=>{(async()=>{if(!f||q||!N||!W)return;g(!0);try{let y=await A.api.folders[":folderId"].search.$post({param:{folderId:w},json:{assetType:"file",after:f,first:200,recursively:!1,conditions:[]}});if(!y.ok)throw Error("Failed to fetch next page");let P=await y.json(),X=P.data||[];p((G)=>[...G,...X]),U(P.pageInfo?.cursor||void 0),Y(!!P.pageInfo?.cursor&&X.length>0)}catch(y){console.error("Error fetching next page:",y)}finally{g(!1)}})()},[N,f,W,q,w]),h(()=>{if(c.some((y)=>y?.id===s)&&x.current)if(V.current)x.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),V.current=!1;else x.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,s]),t("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:o("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[c.map((m)=>{if(!m)return null;let y=m.id===s;return t("div",{ref:m.id===s?x:null,className:"flex-shrink-0",children:o(Un,{to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:m.id},search:{version:void 0},className:C("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block relative",y?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:[t(kt,{item:m}),m.agent&&t("span",{className:"absolute top-1 right-1 z-10 pointer-events-none select-none rounded bg-black/60 px-1 py-0.5 text-[10px] font-medium leading-none text-white",title:m.agent.name,"data-testid":"carousel-agent-badge",children:"AI"})]})},m.id)}),W&&t("div",{ref:a,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:q&&t(F,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};S();function At(){let{projectId:n,fileId:s}=$e.useParams(),w=$e.useSearch(),{version:d,start:D}=w,a=d||s,{cmpLeft:N,cmpRight:x}=w,V=w.cmpActive??"left",c=!!w.compare&&!!N&&!!x,p=b(null),{teamId:f,ensureTeamIdForProject:U}=lt(),[W,Y]=u(360),[q,g]=u([]),{fileViewRightSidebarCollapsed:m}=$t(),{isChatbotOpen:y}=lr(),P=gr((e)=>Boolean(e.metadata["appearance.hideAgent"])),[X,G]=u(0),[he,z]=u(null),[ge,Le]=u(null),[Ee,ye]=u(void 0),[_,ne]=u({show:!1,files:[],nextCursor:void 0,folderId:void 0}),Ve=A.api.files[":fileId"].metadata.$patch,{mutate:qe}=B({mutationFn:async(e)=>{let r=await Ve(e);if(!r.ok)throw Error("Failed to patch metadata");return await r.json()}}),J=K(),{members:Pe,fetchProjectMembers:Ie}=Ur(),ze=Lo();h(()=>{U(n)},[n,U]),h(()=>{if(n)Ie(n,!0)},[n,Ie]),h(()=>{if(n&&s)A.api.projects[":projectId"].recents.view.$post({param:{projectId:n},json:{assetId:s}}).catch(()=>{})},[n,s]);let{data:ve,isLoading:_e,isError:Ke,isFetching:Oe}=Z({queryKey:["files",s],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:s}});if(!e.ok)throw Error("Failed to fetch stack");return await e.json()},enabled:!!f,placeholderData:Si}),{data:He,isLoading:Qe,isError:Be,isFetching:We}=Z({queryKey:["files",d],queryFn:async()=>{let e=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!e.ok)throw Error("Failed to fetch version");return await e.json()},enabled:!!f&&!!d,placeholderData:Si}),{data:Ye}=Z({queryKey:["version_stacks",s,"versions"],queryFn:async()=>{let e=await A.api.version_stacks[":stackId"].versions.$get({param:{stackId:s}});if(!e.ok)throw Error("Failed to fetch versions");return await e.json()},enabled:!!n&&!!s&&(!!d||c)}),{data:R}=Z({queryKey:["projects",n],queryFn:async()=>{let e=await A.api.projects[":projectId"].$get({param:{projectId:n}});if(!e.ok)throw Error("Failed to fetch project");return await e.json()}}),I=Me(),{setProjectState:we,clearProjectState:xe}=on(),Ze=_e||!!d&&Qe,at=Ke||!!d&&Be,ct=Oe||!!d&&We,i=He||ve,j=d?Ye:ve?.versionStack?.versions,l=i?.ancestorFolders?.[0]?.id??R?.rootFolder??"",[re,ee]=u(!1),[te,be]=u(""),se=b(null),ae=b(!1),[dt,ce]=u(!1),ft=A.api.files[":fileId"].$put,{mutate:pt,mutateAsync:ut,isPending:Fe}=B({mutationFn:async(e)=>{let r=await ft(e);if(!r.ok)throw Error("Failed to rename file");return await r.json()},onSuccess:()=>{J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),k.success(HE?.()||"Renamed successfully"),ee(!1)},onError:()=>{k.error(Lb?.()||"Failed to rename")}}),mt=A.api.files.$delete,{mutate:ht,mutateAsync:gt,isPending:ke}=B({mutationFn:async(e)=>{if(!(await mt(e)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(J.invalidateQueries({queryKey:["files"]}),J.invalidateQueries({queryKey:["version_stacks"]}),k.success(zy?.()||"Deleted"),ce(!1),l&&l!==R?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onError:()=>{k.error(ki?.()||"Failed to delete")}}),yt=(e)=>{if(e?.preventDefault(),!te.trim()||!a)return;pt({param:{fileId:a},json:{name:te.trim()}})},It=()=>{if(!a)return;ht({json:{ids:[a]}})};h(()=>{if(i&&R&&f)we({teamId:f,projectId:n,projectName:R.name??"",ancestorFolders:i.ancestorFolders??[],currentAsset:{id:a||s,name:i.name,type:"file",version:j?j.find((e)=>e.id===a)?.version??j.length:void 0,proxyType:i.proxyType},isRootFolder:!1,fileId:s,downloadInfo:{originalKey:i.media?.original?.key,videoTranscodes:i.media?.videoTranscodes?.map((e)=>({key:e.key,width:e.width,height:e.height}))},versions:j,compareMode:c,canCompareVersions:(j?.length??0)>=2,onCompareVersions:()=>{let e=Ul(j);if(!e)return;I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:void 0,compare:!0,cmpLeft:e.left.id,cmpRight:e.right.id,cmpActive:"left"})})},onFolderClick:(e)=>{I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:e}})},onRename:()=>{ae.current=!1,be(i?.name??""),ee(!0)},onDelete:()=>{ce(!0)}});return()=>xe()},[f,n,R,i,j,a,s,c,we,xe,I]),h(()=>{if(!re)return;let e=setTimeout(()=>{ae.current=!0},1000);return()=>clearTimeout(e)},[re]);let vt=()=>{if(ae.current)return;setTimeout(()=>{if(se.current)ys(se.current)},0)};if(h(()=>{if(!l||!a)return;if(_.folderId===l)return;let e=!0;return(async()=>{try{let v="",T=!1,M=[],fe=void 0;for(let De=0;De<5;De++){let Se=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:v,first:200,recursively:!1,conditions:[]}});if(!Se.ok)throw Error("Failed to search parent folder for carousel");let Q=await Se.json(),pe=Q.data||[];if(M.push(...pe),pe.some((oe)=>oe.id===a)){if(T=!0,fe=Q.pageInfo?.cursor||void 0,Q.pageInfo?.cursor)try{let oe=await A.api.folders[":folderId"].search.$post({param:{folderId:l},json:{assetType:"file",after:Q.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(oe.ok){let Re=await oe.json(),Ft=Re.data||[];M.push(...Ft),fe=Re.pageInfo?.cursor||void 0}}catch{}break}if(!Q.pageInfo?.cursor||pe.length<200)break;v=Q.pageInfo.cursor}if(e)if(T)ne({show:!0,files:M,nextCursor:fe,folderId:l});else ne({show:!1,files:[],nextCursor:void 0,folderId:l})}catch(v){if(console.error(v),e)ne({show:!1,files:[],nextCursor:void 0,folderId:l})}})(),()=>{e=!1}},[l,a,_.folderId]),h(()=>{G(0),z(null),g([])},[i?.id]),h(()=>{z(null),g([])},[ge?.id]),h(()=>{Wr.getState().reset(),Wr.getState().setIsDrawing(!1),g([]),z(null)},[a]),Ze&&!i)return t(hA,{});if(at||!i||!R||!f)return t("div",{children:wh()});let O=c?ge:i,Ae=O?.id??a,je=(e,r)=>{if(!f)return;qe({param:{fileId:Ae},json:[{key:e,value:r}]},{onSuccess:()=>{J.invalidateQueries({queryKey:["files",Ae]})}})},de=(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,...e})})},wt=()=>{de({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:V==="left"?N:x})},xt=(e)=>{z(e.id||null);let r=e.annotations;if(r&&r.length>0)g(r);else g([]);if(c){if(e.second!==null&&e.second!==void 0)ye({second:e.second,nonce:Date.now()});return}if(e.second!==null&&e.second!==void 0)p.current?.seekTo(e.second),p.current?.pause();else if(r&&r.length>0)p.current?.pause()},bt=(e)=>{z(e.id||null);let v=e.details,T=v?.annotations;if(T&&T.length>0)g(T);else g([]);let M=v?.position?.type==="time"?v.position.seconds:v?.position?.type==="page"?v.position.page:void 0;if(c){if(M!==void 0)ye({second:M,nonce:Date.now()});return}if(M!==void 0)p.current?.seekTo(M),p.current?.pause();else if(T&&T.length>0)p.current?.pause()},Ce=()=>{g([]),z(null)};if(ze&&!c)return t(Fl,{projectId:n,teamId:f,fileId:s,file:i,projectInfo:R,ancestorFolders:i.ancestorFolders??[],parentFolderId:l,versions:j,activeFileId:a,startTime:D,siblingFiles:_.files,onNavigateToFile:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:e}})},onNavigateBack:()=>{if(l&&l!==R?.rootFolder)I({to:"/projects/$projectId/folders/$folderId",params:{projectId:n,folderId:l}});else I({to:"/projects/$projectId",params:{projectId:n}})},onSelectVersion:(e)=>{I({to:"/projects/$projectId/files/$fileId",params:{projectId:n,fileId:s},search:(r)=>({...r,version:e})})},onRenameFile:async(e)=>{await ut({param:{fileId:a},json:{name:e}})},onDeleteFile:async()=>{await gt({json:{ids:[a]}})},onSaveField:je});return o("div",{className:"h-full flex flex-1 flex-col bg-background",children:[o("div",{className:"h-full flex flex-1 overflow-hidden",children:[o("div",{className:"flex-1 relative",children:[ct&&!c&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:t(F,{className:"h-8 w-8 animate-spin text-foreground"})}),c&&N&&x?t(Ll,{versions:j??[],leftId:N,rightId:x,activeSide:V,annotations:q,seekRequest:Ee,onActiveSideChange:(e)=>de({cmpActive:e}),onSwitchVersion:(e,r)=>de(e==="left"?{cmpLeft:r}:{cmpRight:r}),onExit:wt,onActiveAssetChange:Le,onPlay:Ce,onTimeUpdate:G}):t(ts,{file:i,mediaControllerRef:p,onPlay:Ce,onTimeUpdate:G,annotations:q,startTime:D,children:_.show&&t(Te,{projectId:n,currentAssetId:a,parentFolderId:l,initialFiles:_.files,initialNextCursor:_.nextCursor})})]}),(!m||y&&!P)&&o(L,{children:[t(Er,{onResize:(e)=>{Y((r)=>Math.max(300,Math.min(600,r-e)))},className:"hidden md:block"}),t("div",{style:{width:W},className:"flex-shrink-0 bg-background flex flex-col",children:y&&!P?t(wa,{projectId:n,contextAssetId:a,file:O,currentTime:X,frameRate:O?.media?.metadata?.frameRate||30,startTimecode:O?.media?.metadata?.startTimecode,onTyping:()=>{if(c)return;p.current?.pause()},onSelectMessage:bt,selectedMessageId:he}):t(Sa,{teamId:f,projectId:n,file:O,onSaveField:je,members:Pe,onCommentSelect:xt,currentTime:X,onTyping:()=>{if(c)return;p.current?.pause()},selectedCommentId:he,hideAnnotationControl:O?.proxyType==="audio"})})]})]}),t(ue,{open:re,onOpenChange:ee,children:t(ie,{children:o("form",{onSubmit:yt,children:[t(me,{children:t(le,{children:Oo()})}),t("div",{className:"py-4",children:t(H,{ref:se,value:te,onChange:(e)=>be(e.target.value),placeholder:dd?.()||"Enter new name",onFocus:vt,autoFocus:!0})}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:()=>ee(!1),children:Ne()}),o(E,{type:"submit",disabled:Fe||!te.trim(),children:[Fe&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),Fo()]})]})]})})}),t(Je,{open:dt,onOpenChange:ce,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Lc?.()||"Delete Asset?"}),t(nt,{children:Fc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:Ne()}),o(ot,{onClick:It,disabled:ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[ke&&t(F,{className:"mr-2 h-4 w-4 animate-spin"}),it()]})]})]})})]})}var $e=Ue("/projects/$projectId/files/$fileId")({component:At});export{$e as Route};
|
package/bin/chunk-xcsz1wp7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h,S,t,Z,Ue,A,lt,wt,Qp}from"./chunk-q6jsw0rr.js";import"./chunk-5rk7dyx9.js";import"./chunk-6rjkbwz6.js";import"./chunk-camzbwqh.js";import"./chunk-3p1bb08a.js";import"./chunk-887pj9xd.js";import"./chunk-zz0522zr.js";import"./chunk-rkafv27g.js";import"./chunk-r55htzxr.js";import"./chunk-ayq8dskd.js";import"./chunk-4a88wwg2.js";import"./chunk-j41mya13.js";import"./chunk-xca338dw.js";import"./chunk-xznabrt2.js";import{Gn}from"./chunk-kq2qbwx1.js";import{rr}from"./chunk-zej27b5c.js";import"./chunk-4m8gk79m.js";import"./chunk-9va1mzeq.js";import"./chunk-jt04mf5s.js";import"./chunk-8ystwvdt.js";import"./chunk-8sf106rq.js";import"./chunk-q1d7x1cc.js";import"./chunk-fhazy8f9.js";import"./chunk-0ygtayqf.js";S();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=lt();h(()=>{a(o)},[o,a]);let{data:n}=rr(Qp(o)),e=n?.rootFolder,{data:s}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!s)return t(wt,{});return t(Gn,{teamId:r,projectId:o,projectName:n.name??"",assetId:"recently-deleted",rootFolderId:e})}var l=Ue("/projects/$projectId/recently-deleted")({component:i});export{l as Route};
|
package/bin/chunk-zb0az2tq.js
DELETED
package/bin/chunk-zej27b5c.js
DELETED