@shumai-one/shumai 0.4.3 → 0.4.5
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-xp59apdb.js → chunk-0z8tgn67.js} +1 -1
- package/bin/{chunk-87zxtf66.js → chunk-18qzk2mm.js} +2 -2
- package/bin/{chunk-rbj4fad9.js → chunk-1b7gg0nx.js} +13 -13
- package/bin/{chunk-rpywcvg1.js → chunk-1hnpvtvf.js} +2 -2
- package/bin/chunk-1n1h09e9.js +2 -0
- package/bin/{chunk-q2bvyv39.js → chunk-1yv06e0q.js} +2 -2
- package/bin/chunk-20ee2pqp.js +4 -0
- package/bin/chunk-20yset6k.js +1 -0
- package/bin/{chunk-zqv0zhfb.js → chunk-21e4gjvw.js} +2 -2
- package/bin/{chunk-v9b3w8q5.js → chunk-23bg4h8n.js} +2 -2
- package/bin/chunk-2swjkvxv.js +211 -0
- package/bin/chunk-2y6teq4s.js +11 -0
- package/bin/chunk-3115qtvj.js +2 -0
- package/bin/{chunk-f15qyp41.js → chunk-3c0tcbga.js} +1 -1
- package/bin/{chunk-v9w25rp2.js → chunk-3mfdp2nh.js} +2 -2
- package/bin/chunk-3rwx54z7.js +2 -0
- package/bin/chunk-3x3sf7rp.js +3 -0
- package/bin/{chunk-4v5n0ayb.js → chunk-3x80f4jk.js} +1 -1
- package/bin/chunk-42ygnm34.js +2 -0
- package/bin/{chunk-wfzqnpc1.js → chunk-46wfxyd7.js} +2 -2
- package/bin/{chunk-b235azv4.js → chunk-48rbc18e.js} +13 -13
- package/bin/{chunk-4r81ghg8.js → chunk-4k2bej3c.js} +2 -2
- package/bin/{chunk-0e4wawpq.js → chunk-5trfc3xh.js} +1 -1
- package/bin/chunk-5xcjnbm9.js +1 -0
- package/bin/chunk-685gzbdg.js +14 -0
- package/bin/chunk-6kzm51c7.js +2 -0
- package/bin/{chunk-cak32x57.js → chunk-73evafrq.js} +1 -1
- package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
- package/bin/{chunk-av1a8fqp.js → chunk-7sc73pfr.js} +2 -2
- package/bin/{chunk-qwqvt9v6.js → chunk-7t1r3sj3.js} +2 -2
- package/bin/{chunk-vgn5zcpv.js → chunk-7v7mypc6.js} +2 -2
- package/bin/chunk-813885jm.js +1 -0
- package/bin/{chunk-bay038pj.js → chunk-8yg9zy53.js} +2 -2
- package/bin/chunk-923agf2d.js +1 -0
- package/bin/chunk-942ksfnj.js +2 -0
- package/bin/chunk-99yzvkq5.js +2 -0
- package/bin/chunk-9by727gr.js +2 -0
- package/bin/chunk-9sr1z8kv.js +42 -0
- package/bin/chunk-a0fggks8.js +2 -0
- package/bin/{chunk-cqb415s6.js → chunk-a3j3hyx2.js} +2 -2
- package/bin/chunk-a8x0dmec.js +2 -0
- package/bin/{chunk-tf28796q.js → chunk-af1mcn9p.js} +1 -1
- package/bin/{chunk-ea79xnn3.js → chunk-azafjrm4.js} +2 -2
- package/bin/{chunk-qf24e71w.js → chunk-b5a77dzv.js} +1 -1
- package/bin/chunk-b80fgsdf.js +1 -0
- package/bin/{chunk-n1jwdb0a.js → chunk-bg6kp843.js} +1 -1
- package/bin/chunk-brxwrh0b.js +11 -0
- package/bin/{chunk-zmv8cg4s.js → chunk-c51tvhra.js} +3 -3
- package/bin/chunk-c5dr9m1d.js +2 -0
- package/bin/{chunk-8fmy5jtp.js → chunk-cbpgrg5j.js} +1 -1
- package/bin/{chunk-m7m9d4fb.js → chunk-cwfjvynz.js} +2 -2
- package/bin/{chunk-66hsjnw6.js → chunk-da2w7c80.js} +2 -2
- package/bin/{chunk-1yacmegc.js → chunk-dchtr0ap.js} +2 -2
- package/bin/chunk-dqxh6dwz.js +16 -0
- package/bin/chunk-e1s1zgv0.js +2 -0
- package/bin/chunk-erharpzt.js +2 -0
- package/bin/{chunk-f3ehv01n.js → chunk-f3pb9mh9.js} +26 -26
- package/bin/chunk-fp8x63vs.js +2 -0
- package/bin/chunk-ft11rrhz.js +1 -0
- package/bin/chunk-fyszcddw.js +2 -0
- package/bin/chunk-g6hq18q1.js +1 -0
- package/bin/{chunk-wry2hvrq.js → chunk-g6xgghnq.js} +4 -4
- package/bin/{chunk-hfh0c082.js → chunk-gdg0tkbk.js} +1 -1
- package/bin/{chunk-3cyrcgm5.js → chunk-gjp851vj.js} +9 -9
- package/bin/{chunk-ehc9adfz.js → chunk-gy68h3x5.js} +2 -2
- package/bin/chunk-h4s1fgf1.js +2 -0
- package/bin/chunk-hsv4v7na.js +1 -0
- package/bin/chunk-j3kjscfj.js +2 -0
- package/bin/chunk-jbt3e1ac.js +7 -0
- package/bin/chunk-jrf90z42.js +3 -0
- package/bin/chunk-k2aqztk1.js +2 -0
- package/bin/{chunk-3a13dcs1.js → chunk-kfpfqxb3.js} +1 -1
- package/bin/chunk-kyxramkk.js +1 -0
- package/bin/chunk-m5z5mzan.js +2 -0
- package/bin/chunk-n48548fs.js +4 -0
- package/bin/chunk-ncnr223m.js +2 -0
- package/bin/chunk-ncp007yb.js +12 -0
- package/bin/{chunk-2291ehh5.js → chunk-ncqhp76x.js} +2 -2
- package/bin/chunk-njswnpaq.js +3 -0
- package/bin/{chunk-pb1zf0vb.js → chunk-nkmr6gqc.js} +2 -2
- package/bin/chunk-nngp6fhe.js +1 -0
- package/bin/chunk-nzggcbgk.js +20 -0
- package/bin/chunk-p1nb8wk8.js +3 -0
- package/bin/{chunk-6gg1ymer.js → chunk-p4yrnr37.js} +2 -2
- package/bin/chunk-pc2dnpkh.js +2 -0
- package/bin/{chunk-sfx2588q.js → chunk-pdrmbxrt.js} +2 -2
- package/bin/chunk-pmj9b8qt.js +3 -0
- package/bin/{chunk-h3tbf521.js → chunk-psk38vp4.js} +1 -1
- package/bin/{chunk-abt0azmv.js → chunk-pve3zpta.js} +2 -2
- package/bin/chunk-q3q0brsn.js +2 -0
- package/bin/{chunk-jy006gcv.js → chunk-qg1f1z3t.js} +4 -4
- package/bin/chunk-qk7me5ra.js +2 -0
- package/bin/{chunk-zehyn6vd.js → chunk-qqqarj5v.js} +2 -2
- package/bin/chunk-qysf4mpk.js +299 -0
- package/bin/chunk-r0j962y1.js +1 -0
- package/bin/chunk-r5dxd4sx.js +1 -0
- package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
- package/bin/chunk-s0caa0zm.js +5 -0
- package/bin/chunk-sa6k5ye7.js +1 -0
- package/bin/{chunk-83e12sjg.js → chunk-ss0mcgbd.js} +2 -2
- package/bin/chunk-sz6cnm4q.css +1 -0
- package/bin/{chunk-ck8azecb.js → chunk-tgee88jq.js} +5 -5
- package/bin/{chunk-ag6p3mbf.js → chunk-ty71fdw9.js} +2 -2
- package/bin/chunk-v0201sn5.js +3 -0
- package/bin/chunk-v2xt5p3x.js +10 -0
- package/bin/{chunk-2yxj593j.js → chunk-w3jmahea.js} +2 -2
- package/bin/chunk-w88h5wtf.js +1 -0
- package/bin/chunk-w9160hxz.js +5 -0
- package/bin/{chunk-k7hss0bd.js → chunk-wmkbkad1.js} +3 -3
- package/bin/{chunk-9t1ne8xr.js → chunk-wnpjz2kw.js} +2 -2
- package/bin/{chunk-8zqgaxvv.js → chunk-wrbas9cg.js} +1 -1
- package/bin/{chunk-j8fxp8ej.js → chunk-xcwjsav0.js} +1 -1
- package/bin/{chunk-jje8nj8h.js → chunk-xgy6ppww.js} +2 -2
- package/bin/{chunk-cnxwmycy.js → chunk-y13s3641.js} +3 -3
- package/bin/chunk-y78v01te.js +2 -0
- package/bin/{chunk-twdxayky.js → chunk-y8a3hans.js} +2 -2
- package/bin/chunk-z422yh6b.js +3 -0
- package/bin/chunk-z5t4yxzb.js +2 -0
- package/bin/chunk-zcfehv0w.js +18 -0
- package/bin/chunk-zg7a107s.js +3 -0
- package/bin/{chunk-e99dv20z.js → chunk-zp1sv030.js} +2 -2
- package/bin/{chunk-32pcmaqm.js → chunk-zrxe6p0q.js} +2 -2
- package/bin/chunk-zwenq5zy.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +987 -776
- package/package.json +7 -7
- package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
- package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
- package/prisma/schema.prisma +2 -0
- package/bin/chunk-185qefn1.js +0 -2
- package/bin/chunk-1kw2mbqb.js +0 -1
- package/bin/chunk-1wm6ptdx.js +0 -1
- package/bin/chunk-2520aq8j.js +0 -2
- package/bin/chunk-29zdp63z.js +0 -3
- package/bin/chunk-3swpwb9v.js +0 -1
- package/bin/chunk-3wmcx2bv.js +0 -2
- package/bin/chunk-5a8nt4me.js +0 -1
- package/bin/chunk-6bhn1p8v.js +0 -211
- package/bin/chunk-70c3xrgd.js +0 -2
- package/bin/chunk-7esm0hqb.js +0 -2
- package/bin/chunk-7fst8kdw.js +0 -12
- package/bin/chunk-a3dmtt2j.js +0 -1
- package/bin/chunk-aqbrzx9z.js +0 -1
- package/bin/chunk-awfwk64v.js +0 -2
- package/bin/chunk-b9yrw9et.js +0 -10
- package/bin/chunk-c007p0t8.js +0 -299
- package/bin/chunk-ce8m4zeg.js +0 -3
- package/bin/chunk-e2mvmq2m.js +0 -1
- package/bin/chunk-e7mqtkzn.js +0 -2
- package/bin/chunk-ejbvfj4r.js +0 -1
- package/bin/chunk-ekfem7kf.js +0 -1
- package/bin/chunk-etwkk0xh.js +0 -1
- package/bin/chunk-evrdd32b.js +0 -2
- package/bin/chunk-fm6p03ad.js +0 -2
- package/bin/chunk-fyha3r13.js +0 -2
- package/bin/chunk-g0vs7k2x.js +0 -1
- package/bin/chunk-g84z2w7v.js +0 -16
- package/bin/chunk-gk3eqd50.js +0 -2
- package/bin/chunk-h837fyed.js +0 -2
- package/bin/chunk-j20e0qsw.js +0 -7
- package/bin/chunk-p5gf1zdm.js +0 -4
- package/bin/chunk-pfgxggaj.js +0 -11
- package/bin/chunk-q16490pv.js +0 -2
- package/bin/chunk-qh81zhg1.js +0 -1
- package/bin/chunk-qwp3kwbz.js +0 -2
- package/bin/chunk-qydeqgyj.js +0 -5
- package/bin/chunk-r7dty1tg.js +0 -2
- package/bin/chunk-rhdxwebf.js +0 -2
- package/bin/chunk-rhh716z0.js +0 -42
- package/bin/chunk-rza4ae5z.js +0 -3
- package/bin/chunk-sk4e6rb1.js +0 -1
- package/bin/chunk-t2n1dbgx.js +0 -4
- package/bin/chunk-x8f4defx.js +0 -3
- package/bin/chunk-xtf3c29c.css +0 -1
- package/bin/chunk-z3gkt8w1.js +0 -3
- package/bin/chunk-zh6fqq44.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{N,h,O,w,u,C,B,t,o,W,Z,U,ut,A,T,wr,L,ko,Re,we,Xr,ht,gt,Xt,ve,ke,E,S,he,Wa,ge,Ae,K,Gr,Qt,cs,us,ds,mf,Pe,od,at,Nc,Oc,fr,id,sb,vb,Ti,Zf,Hf,Bh,Uh,bl,Xh,np,No,Oo,kd,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,$e,le,H,ce,Pt,Mt,R,wo,vo,Qr,In,be,Ur,Hd}from"./chunk-2swjkvxv.js";import{va,xa,Or,ou,su,Yo,Jo,As,_s}from"./chunk-qysf4mpk.js";import{Zi,ru}from"./chunk-fyszcddw.js";import{zs}from"./chunk-v2xt5p3x.js";var ct=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qe=T("pencil",ct);C();C();function Ge({teamId:d,projectId:s,file:r,onSaveField:l,members:P,onCommentSelect:f,hideAnnotationControl:F=!1,readOnly:v=!1,publicFields:y,isPublic:m=!1,shareId:k,currentTime:q,onTyping:te,selectedCommentId:p,heightPercent:V,onHeightPercentChange:Q}){let{canEdit:_}=Pt(s),{fields:c,setFields:J}=Or(),se=W(),{ref:re,inView:fe}=Mt(),[a,I]=u(null),[j,ne]=u(!1),[Ne,ze]=u(null),G=w(!1),Ve=w(0),Y=w(V),je=(e)=>{G.current=!0,Ve.current=e.clientY,Y.current=V,e.target.setPointerCapture?.(e.pointerId)},Ie=N((e)=>{if(!G.current)return;let b=(Ve.current-e.clientY)/window.innerHeight*100,oe=Math.min(85,Math.max(10,Y.current+b));Q(oe)},[Q]),Te=(e)=>{G.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:ee}=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&&!y}),D=Yo(r);h(()=>{if(y)J(y,s);else if(ee)J(ee,s)},[ee,y,s,J]);let{data:xe,fetchNextPage:X,hasNextPage:De}=ut({queryKey:m?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(m){let i=localStorage.getItem(`share_pwd_${k}`)||"",b=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:k,fileId:r.id},query:{after:e}},{headers:{"x-share-password":i}});if(!b.ok)throw Error("Failed to fetch comments");return await b.json()}else{let i=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!i.ok)throw Error("Failed to fetch comments");return await i.json()}},enabled:!!r?.id&&(!m||!!k),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Me}=U({mutationFn:async({text:e,attachmentIds:i,annotations:b,replyToId:oe,guestUserId:ye,second:Ce})=>{if(m){let de=localStorage.getItem(`share_pwd_${k}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:k,fileId:r.id},json:{message:e,attachmentIds:i,replyToId:oe??void 0,annotations:b,second:Ce??void 0}},{headers:{"x-share-password":de,...ye?{"x-guest-user-id":ye}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let de=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:i,replyToId:oe??void 0,annotations:b,second:Ce??void 0}});if(!de.ok)throw Error("Failed to create comment");return await de.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:m?["shares",k,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{R.error(vb?.()||"Failed to post comment")}}),Se=xe?.pages?.[0]?.pageInfo?.total??xe?.pages.reduce((e,i)=>e+(i.data?.length||0),0)??0;h(()=>{if(fe&&De)X()},[fe,X,De]);let z=O(()=>(r?.fieldValues||[]).reduce((e,i)=>(e[i.fieldId]=i,e),{}),[r?.fieldValues]),ae=O(()=>[...c].sort((e,i)=>{let b=e.config?.name?.toLowerCase()||"",oe=i.config?.name?.toLowerCase()||"";if(b<oe)return-1;if(b>oe)return 1;return 0}),[c]),Ee=xe?.pages.flatMap((e)=>e.data??[])??[],_e=(e,i,b=[],oe,ye)=>{if(!e.trim()&&i.length===0&&b.length===0)return;let Ce=oe||a?.id||null;if(m){let de=localStorage.getItem(`guest_user_id_${k}`);if(!de)ze({text:e,attachmentIds:i,annotations:b,replyToId:Ce,second:ye}),ne(!0);else Me({text:e,attachmentIds:i,annotations:b,replyToId:Ce,guestUserId:de,second:ye})}else Me({text:e,attachmentIds:i,annotations:b,replyToId:Ce,second:ye});I(null)},Oe=(e)=>{if(Ne)Me({...Ne,guestUserId:e}),ze(null),I(null)},Fe=(e)=>{let i=P.find((b)=>b.id===e);if(i)return i;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=V<=15;return o("div",{style:{height:`${V}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:Ie,onPointerUp:Te,onPointerCancel:Te,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(wo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(vo,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Qr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[od()," ",Se>0&&`(${Se})`]}),t(Qr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Ti()})]}),o(In,{value:"comments",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[mf?.()||"All comments",Se>0?` (${Se})`:""]})}),t(ce,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Ee.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Uh()}):o("div",{className:"space-y-3",children:[Ee.map((e)=>o("div",{children:[t(Zi,{teamId:d,message:e,getUser:Fe,onReply:I,hasReplies:!!e.replies?.length,formatTimestamp:D?.commentsConfig?.formatTimestamp,frameRate:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:p===e.id,onSelect:()=>{f?.(e)}}),e.replies?.map((i,b)=>t("div",{children:t(Zi,{teamId:d,isReply:!0,message:i,getUser:Fe,onReply:I,hasReplies:!1,isLastReply:b===(e.replies?.length??0)-1,formatTimestamp:D?.commentsConfig?.formatTimestamp,frameRate:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:p===i.id,onSelect:()=>{f?.(i)}})},i.id))]},e.id)),t("div",{ref:re})]})}),(!v||m)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(ru,{isOpen:j,onClose:()=>ne(!1),onSuccess:Oe,children:t(zs,{projectId:s,onSendMessage:_e,replyingTo:a,onCancelReply:()=>I(null),hideAnnotationControl:F,disableMentions:m,currentTime:D?.commentsConfig?.hasTimestamp?q:void 0,formatTimestamp:D?.commentsConfig?.formatTimestamp,frameRate:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:D?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:te})})})]}),t(In,{value:"fields",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:t(ce,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:ae&&ae.length>0?t("div",{className:"space-y-4 pb-6",children:ae.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(_s,{fieldId:e.id,config:e.config,value:z[e.id]?.value,onSave:_?(i)=>l(e.id,i):void 0,readOnly:v||e.readOnly||!_})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function Ye({fileName:d,folderName:s,version:r,versions:l,activeFileId:P,isPublic:f=!1,shareId:F,allowDownload:v=!0,downloadInfo:y,canEdit:m=!1,onBack:k,onPrevFile:q,onNextFile:te,hasPrevFile:p=!1,hasNextFile:V=!1,onSelectVersion:Q,onRename:_,onDelete:c,onLinkedTasks:J,linkedTaskCount:se=0}){let re=async(a)=>{try{let I=f&&F?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:F,fileId:P},json:{key:a}}):await A.api.files["download-url"].$post({json:{key:a,assetId:P}});if(!I.ok)return;let{url:j}=await I.json(),ne=document.createElement("a");ne.href=j,ne.download="",document.body.appendChild(ne),ne.click(),document.body.removeChild(ne)}catch{}},fe=(y?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(S,{variant:"ghost",size:"icon",onClick:k,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":np(),children:t(Xr,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[s&&o(B,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:s}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),l&&l.length>1?o(he,{modal:!1,children:[t(ge,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:d}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(we,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(Ae,{align:"center",className:"w-48 z-40",children:[t(Gr,{className:"text-xs",children:kd()}),l.map((a)=>o(K,{onClick:()=>Q?.(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===P?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:a.name||d})]},a.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:d}),r!==void 0&&o(be,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(p||V)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(S,{variant:"ghost",size:"icon",disabled:!p,onClick:q,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Xh(),"aria-label":Xh(),children:t(Xr,{className:"h-3.5 w-3.5"})}),t(S,{variant:"ghost",size:"icon",disabled:!V,onClick:te,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Bh(),"aria-label":Bh(),children:t(ht,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":Hf(),children:t(wr,{className:"h-4 w-4"})})}),o(Ae,{align:"end",className:"w-52 z-40",children:[v&&(fe?o(cs,{children:[o(us,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(gt,{className:"h-3.5 w-3.5"}),t("span",{children:fr()})]}),t(Wa,{children:o(ds,{className:"w-48 z-50",children:[t(Gr,{className:"text-xs",children:fr()}),y?.videoTranscodes?.map((a)=>{let I=Math.max(a.width,a.height),j=`${a.height}p`;if(I>=3840)j="2160p";else if(I>=1920)j="1080p";else if(I>=1280)j="720p";else if(I>=960)j="540p";else if(I>=640)j="360p";else if(I>=320)j="180p";return o(K,{onClick:()=>re(a.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:j}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},j)}),y?.originalKey&&o(B,{children:[t(Qt,{}),o(K,{onClick:()=>re(y.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:bl?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:d.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(K,{onClick:()=>y?.originalKey&&re(y.originalKey),disabled:!y?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(gt,{className:"h-3.5 w-3.5"}),t("span",{children:fr()})]})),l&&l.length>1&&Q&&o(cs,{children:[t(us,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:kd?.()||"Switch version"})}),t(Wa,{children:o(ds,{className:"w-48 z-50",children:[t(Gr,{className:"text-xs",children:kd?.()||"Switch version"}),l.map((a)=>o(K,{onClick:()=>Q(a.id),className:E("flex items-center justify-between text-xs cursor-pointer",a.id===P?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",a.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:a.name||d})]},a.id))]})})]}),J&&o(K,{onClick:J,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(ko,{className:"h-3.5 w-3.5"}),t("span",{children:Zf?.()||"Linked Tasks"})]}),se>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:se})]}),m&&_&&o(K,{onClick:_,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Qe,{className:"h-3.5 w-3.5"}),t("span",{children:No()})]}),m&&c&&o(B,{children:[t(Qt,{}),o(K,{onClick:c,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(ve,{className:"h-3.5 w-3.5"}),t("span",{children:at()})]})]})]})]})})]})}function Nl({projectId:d,teamId:s="",fileId:r,file:l,projectInfo:P,ancestorFolders:f=[],versions:F,activeFileId:v,startTime:y,isPublic:m=!1,shareId:k,allowDownload:q=!0,publicFields:te,siblingFiles:p=[],onNavigateToFile:V,onNavigateBack:Q,onRenameFile:_,onDeleteFile:c,onSaveField:J,onSelectVersion:se}){let{canEdit:re}=Pt(d),{members:fe}=Ur(),a=w(null),[I,j]=u(50),[ne,Ne]=u([]),[ze,G]=u(0),[Ve,Y]=u(null),[je,Ie]=u(!1),[Te,ee]=u(""),D=w(null),[xe,X]=u(!1),[De,Me]=u(!1),[Se,z]=u(!1),[ae,Ee]=u(!1),{data:_e}=Z({queryKey:["teams",s,"kanban","assets",v,"tasks"],queryFn:async()=>{if(!s||!v||m)return{data:[],total:0};let x=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:s,assetId:v}});if(!x.ok)return{data:[],total:0};return await x.json()},enabled:!!s&&!!v&&!m}),Oe=_e?.total??_e?.data?.length??0,{prevFile:Fe,nextFile:Le}=O(()=>{if(!p||p.length===0)return{prevFile:null,nextFile:null};let x=p.findIndex((pe)=>pe.id===r||pe.id===v);if(x===-1)return{prevFile:null,nextFile:null};return{prevFile:x>0?p[x-1]:null,nextFile:x<p.length-1?p[x+1]:null}},[p,r,v]),e=f.length>0?f[0]?.name:P?.name,b=F?.find((x)=>x.id===v)?.version??(F&&F.length>0?F.length:void 0),oe=O(()=>({originalKey:l.media?.original?.key,videoTranscodes:l.media?.videoTranscodes?.map((x)=>({key:x.key,width:x.width,height:x.height}))}),[l.media]),ye=()=>{Ne([]),Y(null)},Ce=(x)=>{Y(x.id||null);let pe=x.annotations;if(pe&&pe.length>0)Ne(pe);else Ne([]);if(x.second!==null&&x.second!==void 0)a.current?.seekTo(x.second),a.current?.pause();else if(pe&&pe.length>0)a.current?.pause()},de=async(x)=>{if(x?.preventDefault(),!Te.trim()||!_)return;try{Me(!0),await _(Te.trim()),Ie(!1)}finally{Me(!1)}},Be=async()=>{if(!c)return;try{X(!0),await c(),z(!1)}finally{X(!1)}};return h(()=>{G(0),Y(null),Ne([])},[l?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(Ye,{fileName:l.name,folderName:e,version:b,versions:F,activeFileId:v,isPublic:m,shareId:k,allowDownload:q,downloadInfo:oe,canEdit:re,onBack:Q,hasPrevFile:!!Fe,hasNextFile:!!Le,onPrevFile:()=>Fe&&V(Fe.id),onNextFile:()=>Le&&V(Le.id),onSelectVersion:se,onRename:()=>{ee(l.name),Ie(!0)},onDelete:()=>z(!0),onLinkedTasks:!m?()=>Ee(!0):void 0,linkedTaskCount:Oe}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(Jo,{file:l,mediaControllerRef:a,onPlay:ye,onTimeUpdate:G,annotations:ne,startTime:y,shareId:k,allowDownload:q})}),t(Ge,{teamId:s,projectId:d,file:l,onSaveField:J,members:fe,onCommentSelect:Ce,hideAnnotationControl:l.proxyType==="audio",readOnly:m||!re,publicFields:te,isPublic:m,shareId:k,currentTime:ze,onTyping:()=>a.current?.pause(),selectedCommentId:Ve,heightPercent:I,onHeightPercentChange:j}),!m&&ae&&t(Hd,{teamId:s,assetId:v,assetName:l.name,isOpen:ae,onClose:()=>Ee(!1)}),!m&&t(ue,{open:je,onOpenChange:Ie,children:t(ie,{children:o("form",{onSubmit:de,children:[t(me,{children:t(le,{children:No()})}),t("div",{className:"py-4",children:t(H,{ref:D,value:Te,onChange:(x)=>ee(x.target.value),placeholder:id?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(D.current)As(D.current)},0)},autoFocus:!0})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>Ie(!1),children:Pe()}),o(S,{type:"submit",disabled:De||!Te.trim(),children:[De&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),Oo()]})]})]})})}),!m&&t(Je,{open:Se,onOpenChange:z,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc?.()||"Delete Asset?"}),t(nt,{children:Nc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:Pe()}),o(ot,{onClick:Be,disabled:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[xe&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),at()]})]})]})})]})}C();function We({activeState:d,activeAsset:s,previewUrl:r,isFullScreen:l,onTogglePlay:P,onToggleLoop:f,onSeek:F,onVolumeChange:v,onToggleMute:y,onChangePlaybackRate:m,onChangeResolution:k,onZoomIn:q,onZoomOut:te,onFit:p,onDownload:V,onToggleFullScreen:Q,allowDownload:_=!0}){if(d?.kind==="video"&&d.video&&s){let c=d.video,J=c.totalFrames/c.frameRate,se=c.currentFrame/c.frameRate,re={isPlaying:c.isPlaying,progress:J>0?se/J*100:0,currentTime:se,duration:J,volume:c.volume,isMuted:c.isMuted,isLooping:c.isLooping,playbackRate:c.playbackRate,isFullScreen:l,showFrames:!1,currentResolution:c.currentResolution},fe=r&&!s.media?.videoPreview?{...s,media:{...s.media,videoPreview:{url:r}}}:s;return t(ou,{state:re,zoom:d.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:c.buffered,data:fe,resolutions:c.resolutions,togglePlay:P,toggleLoop:f,toggleMute:y,handleVolumeChange:v,changePlaybackRate:m,changeResolution:(a)=>k(a.resolution),handleDownload:(a)=>V(a),toggleFullScreen:Q,onZoomChange:(a)=>a>=d.zoom?q():te(),onZoomReset:p,frameRate:c.frameRate,totalFrames:c.totalFrames,currentFrame:c.currentFrame,seekToFrame:F,allowDownload:_})}if(d?.kind==="image")return t(su,{zoom:d.zoom,onZoomIn:q,onZoomOut:te,onFit:p,onDownload:()=>V(),canDownload:!!s?.media?.original?.key,fullscreen:{isFullScreen:l,onToggle:Q},allowDownload:_});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:Q,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:l?t(xa,{className:"h-5 w-5"}):t(va,{className:"h-5 w-5"})})})}function Ke({side:d,fileName:s,version:r,activeVersionId:l,versions:P,isActive:f,onActivate:F,onSwitchVersion:v,onExit:y}){let m=E("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",f?"text-foreground":"text-muted-foreground hover:text-foreground"),k=t("button",{onClick:y,title:sb(),className:m,children:t(ke,{className:"h-4 w-4"})}),q=o("button",{onClick:F,className:E("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",f?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:s}),r!==void 0&&o("span",{className:E("flex-shrink-0 rounded border px-1 py-0 text-xs",f?"border-foreground/40":"border-border"),children:["v",r]})]}),te=o(he,{children:[t(ge,{onClick:F,title:kd(),className:m,children:t(we,{className:"h-4 w-4"})}),t(Ae,{align:d==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:P.map((p)=>{let V=p.id===l;return o(K,{onClick:()=>v(p.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",p.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.previewUrl?t("img",{src:p.previewUrl,alt:p.name||void 0,className:"h-full w-full object-cover"}):t(Xt,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:p.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:p.creator?.name||"Unknown"})]}),V&&t(Re,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},p.id)})})})]});return t("div",{onMouseDown:F,className:E("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",f?"border-b-2 border-primary":"border-border"),children:d==="left"?o(B,{children:[k,q,te]}):o(B,{children:[q,te,t("div",{className:"ml-auto"}),k]})})}function it(d,s,r){return Z({queryKey:s?["public-share-file",r,d,localStorage.getItem(`share_pwd_${r}`)||""]:["files",d],queryFn:async()=>{if(s){let P=localStorage.getItem(`share_pwd_${r}`)||"",f=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:d}},{headers:{"x-share-password":P}});if(!f.ok)throw Error("Failed to fetch version asset");return await f.json()}let l=await A.api.files[":fileId"].$get({param:{fileId:d}});if(!l.ok)throw Error("Failed to fetch version asset");return await l.json()},enabled:!!d&&(!s||!!r)})}function Ol({isPublic:d=!1,shareId:s,versions:r,leftId:l,rightId:P,activeSide:f,annotations:F,seekRequest:v,onActiveSideChange:y,onSwitchVersion:m,onExit:k,onActiveAssetChange:q,onPlay:te,onTimeUpdate:p,allowDownload:V=!0}){let Q=w(null),_=w(null),c=w(null),[J,se]=u(null),[re,fe]=u(null),[a,I]=u(1),[j,ne]=u(!1),[Ne,ze]=u(!1),{data:G,isLoading:Ve}=it(l,d,s),{data:Y,isLoading:je}=it(P,d,s),Ie=Yo(G),Te=Yo(Y),ee=!!G&&!!Y&&Ie.id===Te.id,D=f==="left"?G:Y,xe=f==="left"?J:re,X=N(()=>f==="left"?_.current:c.current,[f]),De=N(()=>f==="left"?c.current:_.current,[f]);h(()=>{q(D??null)},[D,q]),h(()=>{if(!v)return;let n=X();if(n?.seekToSecond(v.second),n?.pause(),ee){let g=De();g?.seekToSecond(v.second),g?.pause()}},[v?.nonce]),h(()=>{let n=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Me=N((n)=>se(n),[]),Se=N((n)=>fe(n),[]),z=N((n)=>{let g=X();if(g)n(g);if(ee){let M=De();if(M)n(M)}},[X,De,ee]),ae=N(()=>{let n=!xe?.video?.isPlaying;z((g)=>n?g.play():g.pause())},[xe?.video?.isPlaying,z]);h(()=>{let n=(g)=>{let M=document.activeElement;if(M&&(M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M instanceof HTMLElement&&M.isContentEditable))return;let He=g.key===" ",Ue=M&&(M.tagName==="BUTTON"||M.tagName==="A"||M.tagName==="SELECT"||M.tagName==="OPTION"||M.getAttribute("role")==="button"||M.getAttribute("role")==="link"||M.getAttribute("role")==="checkbox"||M.getAttribute("role")==="radio"||M.getAttribute("role")==="menuitem");if(He&&Ue)return;if(g.key===" "||g.key.toLowerCase()==="k")g.preventDefault(),ae()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[ae]);let Ee=N((n)=>z((g)=>g.seekToFrame(n)),[z]),_e=N(()=>X()?.toggleLoop(),[X]),Oe=N((n)=>{I(n),ne(n===0)},[]),Fe=N(()=>ne((n)=>!n),[]),Le=N((n)=>z((g)=>g.setPlaybackRate(n)),[z]),e=N((n)=>X()?.changeResolution(n),[X]),i=N(()=>z((n)=>n.zoomBy(1.2)),[z]),b=N(()=>z((n)=>n.zoomBy(0.8)),[z]),oe=N(()=>z((n)=>n.fit()),[z]),ye=N((n)=>{X()?.download(n)},[X]),Ce=N(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),de=N((n,g)=>{if(ee)c.current?.panBy(n,g)},[ee]),Be=N((n,g)=>{if(ee)_.current?.panBy(n,g)},[ee]),x=N(()=>ae(),[ae]),pe=N((n)=>r.find((g)=>g.id===n)?.version,[r]),lt=O(()=>D?.media?.videoPreview?.url,[D?.media?.videoPreview?.url]),Ze=(n,g)=>{let He=Yo(g)?.comparePane;if(!He)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Ue=f===n;return t(He,{ref:n==="left"?_:c,file:g,shareId:s,isActive:Ue,annotations:Ue?F:[],onStateChange:n==="left"?Me:Se,onUserPan:n==="left"?de:Be,onActivate:()=>y(n),muted:Ue?j:!0,volume:a,onPlay:te,onTimeUpdate:p,onRequestTogglePlay:x},g.id)},dt=!!G&&!!Y,mt=Ve||je;return o("div",{ref:Q,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[G&&t(Ke,{side:"left",fileName:G.name,version:pe(l),activeVersionId:l,versions:r,isActive:f==="left",onActivate:()=>y("left"),onSwitchVersion:(n)=>m("left",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:G?Ze("left",G):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[Y&&t(Ke,{side:"right",fileName:Y.name,version:pe(P),activeVersionId:P,versions:r,isActive:f==="right",onActivate:()=>y("right"),onSwitchVersion:(n)=>m("right",n),onExit:k}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Ze("right",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),mt&&!dt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(L,{className:"h-8 w-8 animate-spin text-foreground"})}),t(We,{activeState:xe,activeAsset:D??null,previewUrl:lt,isFullScreen:Ne,onTogglePlay:ae,onToggleLoop:_e,onSeek:Ee,onVolumeChange:Oe,onToggleMute:Fe,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:i,onZoomOut:b,onFit:oe,onDownload:ye,onToggleFullScreen:Ce,allowDownload:V})]})}
|
|
2
|
+
export{Nl,Ol};
|
package/bin/shumai-app.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<meta name="theme-color" content="#ffffff" />
|
|
26
26
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
27
27
|
<title>Shumai</title>
|
|
28
|
-
<link rel="stylesheet" crossorigin href="./chunk-
|
|
28
|
+
<link rel="stylesheet" crossorigin href="./chunk-sz6cnm4q.css"><script type="module" crossorigin src="./chunk-2swjkvxv.js"></script></head>
|
|
29
29
|
<body>
|
|
30
30
|
<div id="root"></div>
|
|
31
31
|
|