PageSourceSearch

https://wodeapp.ai/assets/AuthorPage-DnHuMTtU.js

js wodeapp.ai collected 2026-09-24 14:08:02 UTC 13,323 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./react-vendor-BxoUhqX6.js";import{I as J,j as M,d as q,J as T}from"./index-CR94Sc3y.js";import{A as H}from"./arrow-left-tmmVnOsc.js";import{E as A}from"./external-link-BN1OQuTi.js";import{F as I}from"./film-DP3UBQVf.js";import{I as S}from"./image-B37tbJ4L.js";import{L as E}from"./layers-CfVMtdnX.js";import{P as $}from"./play-CxZVoru_.js";import{R as P}from"./refresh-cw-CphtCQ59.js";import{createProject as Q}from"./jsonSchemaService-BM0WPB8Y.js";import{o as Z}from"./galleryQuickApply-8tqYVpwX.js";import"./clsx-B-dksMZM.js";import"./i18n-vendor-Coo-X0AG.js";import"./projectSiteUrl-BbCyNoMb.js";const D=20;function k({onLoadMore:s,loading:i,hasMore:r}){const d=a.useRef(null);return a.useEffect(()=>{if(!r||i)return;const o=d.current;if(!o)return;const c=new IntersectionObserver(([l])=>{l.isIntersecting&&s()},{rootMargin:"400px"});return c.observe(o),()=>c.disconnect()},[r,i,s]),r?e.jsx("div",{ref:d,className:"col-span-full flex items-center justify-center py-8",children:i&&e.jsx(P,{className:"w-5 h-5 animate-spin text-gray-400"})}):null}function _({item:s,onApply:i,applyingId:r}){const d=M();let o=[];try{o=typeof s.tags=="string"?JSON.parse(s.tags):s.tags||[]}catch{}return e.jsxs("div",{className:"break-inside-avoid mb-5 w-full bg-white rounded-2xl overflow-hidden border border-gray-100 shadow-sm hover:shadow-lg hover:-translate-y-0.5 transition-all duration-300",children:[s.thumbnail?e.jsx("div",{className:"aspect-video bg-gray-100 overflow-hidden",children:e.jsx("img",{src:s.thumbnail,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"})}):e.jsx("div",{className:"aspect-video bg-gradient-to-br from-indigo-50 to-purple-50 flex items-center justify-center",children:e.jsx(E,{className:"w-10 h-10 text-indigo-300"})}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-1.5 line-clamp-1",children:s.name}),s.description&&e.jsx("p",{className:"text-[12px] text-gray-500 leading-relaxed line-clamp-2 mb-3",children:s.description}),o.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:o.slice(0,4).map((c,l)=>e.jsx("span",{className:"px-2 py-0.5 text-[10px] font-medium bg-indigo-50 text-indigo-500 rounded-full",children:c},l))}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-400 pt-3 border-t border-gray-50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.useCount>0&&e.jsxs("span",{children:["已用 ",s.useCount," 次"]}),e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString("zh-CN").replace(/\//g,"-")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.sourceProjectId&&e.jsxs("button",{onClick:()=>d(`/json-builder/${s.sourceProjectId}`),className:"inline-flex items-center gap-1 text-indigo-400 hover:text-indigo-600 font-medium",children:["查看 ",e.jsx(A,{className:"w-3 h-3"})]}),i&&e.jsxs("button",{onClick:()=>i(s.id,s.id),disabled:r===s.id,className:"inline-flex items-center gap-1 text-emerald-500 hover:text-emerald-600 font-medium disabled:opacity-50",children:[r===s.id?e.jsx(P,{className:"w-3 h-3 animate-spin"}):e.jsx($,{className:"w-3 h-3"}),"一键使用"]})]})]})]})]})}function me(){const{userId:s}=J(),i=M(),[r,d]=a.useState("video"),[o,c]=a.useState(null),[l,p]=a.useState(null),[n,m]=a.useState([]),[u,h]=a.useState(!0),[f,L]=a.useState(!0),[y,v]=a.useState(null),[z,R]=a.useState(null),N=a.useRef(!1),U=q(t=>t.user),j=a.useCallback(async(t,g=!1)=>{if(!(!s||N.current)){N.current=!0,L(!0),v(null);try{const b=g?0:n.length,x=await T(s,t,b,D);if(x.success&&x.data){x.data.author&&c(x.data.author),x.data.stats&&p(x.data.stats);const C=x.data.items||[];m(V=>g?C:[...V,...C]),h(x.data.hasMore??C.length>=D)}else throw new Error(x.error||"加载失败")}catch(b){v(b.message||"未知错误")}finally{L(!1),N.current=!1}}},[s,n.length]);a.useEffect(()=>{m([]),h(!0),j("video",!0)},[s]);const F=t=>{t!==r&&(d(t),m([]),h(!0),v(null),j(t,!0))},w=a.useCallback(()=>j(r),[j,r]),G=async(t,g)=>{if(!U){alert("请先登录即可应用同款配置");return}try{R(g);
1const b=await Q(U.id,`同款生成 - ${new Date().toLocaleString("zh-CN",{hour12:!1}).replace(/\//g,"-")}`,"从作者主页中复用的配置",{sourceTemplateId:t});Z(b)}catch(b){alert(b.message||"应用失败")}finally{R(null)}},O=[{key:"video",label:"视频",icon:e.jsx(I,{className:"w-4 h-4"}),count:l?.videoCount},{key:"image",label:"图片",icon:e.jsx(S,{className:"w-4 h-4"}),count:l?.imageCount},{key:"template",label:"工作流",icon:e.jsx(E,{className:"w-4 h-4"}),count:l?.templateCount}];return e.jsx("div",{className:"block min-h-full bg-gray-50/50 p-4 md:p-6 lg:p-8",children:e.jsxs("div",{className:"w-full max-w-6xl mx-auto",children:[e.jsxs("button",{onClick:()=>i(-1),className:"inline-flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-800 mb-6 transition-colors",children:[e.jsx(H,{className:"w-4 h-4"}),"返回"]}),o&&e.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[o.avatar?e.jsx("img",{src:o.avatar,alt:o.name,className:"w-16 h-16 md:w-20 md:h-20 rounded-2xl object-cover border-2 border-white shadow-lg"}):e.jsx("div",{className:"w-16 h-16 md:w-20 md:h-20 rounded-2xl bg-gradient-to-br from-indigo-400 via-purple-500 to-pink-500 flex items-center justify-center border-2 border-white shadow-lg",children:e.jsx("span",{className:"text-2xl md:text-3xl text-white font-bold",children:o.name?.[0]||"?"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl md:text-2xl font-bold text-gray-900",children:o.name}),l&&e.jsxs("p",{className:"mt-1.5 text-sm text-gray-400 flex items-center gap-3",children:[l.videoCount>0&&e.jsxs("span",{children:[l.videoCount," 个视频"]}),l.imageCount>0&&e.jsxs("span",{children:[l.imageCount," 张图片"]}),l.templateCount>0&&e.jsxs("span",{children:[l.templateCount," 个工作流"]})]})]})]}),e.jsx("div",{className:"flex items-center gap-1 mb-6 bg-gray-100 rounded-xl p-1 w-fit",children:O.map(t=>e.jsxs("button",{onClick:()=>F(t.key),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-all ${r===t.key?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:[t.icon,t.label,t.count!=null&&t.count>0&&e.jsx("span",{className:"text-[10px] bg-gray-200/80 text-gray-500 px-1.5 py-0.5 rounded-full min-w-[20px] text-center",children:t.count})]},t.key))}),y&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 border-l-4 border-red-500 rounded-r-lg text-sm text-red-700",children:y}),f&&n.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-gray-400",children:[e.jsx(P,{className:"w-8 h-8 animate-spin mb-4 text-indigo-400"}),e.jsx("p",{children:"正在加载..."})]}),!f&&n.length===0&&!y&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 bg-white rounded-xl border border-gray-200 border-dashed",children:[r==="video"&&e.jsx(I,{className:"w-12 h-12 text-gray-300 mb-4"}),r==="image"&&e.jsx(S,{className:"w-12 h-12 text-gray-300 mb-4"}),r==="template"&&e.jsx(E,{className:"w-12 h-12 text-gray-300 mb-4"}),e.jsxs("p",{className:"text-gray-500 font-medium",children:["暂无",r==="video"?"视频":r==="image"?"图片":"工作流","作品"]})]}),n.length>0&&e.jsxs(e.Fragment,{children:[r==="video"&&e.jsxs("div",{style:{columnGap:"1.25rem"},className:"[column-count:1] sm:[column-count:2] lg:[column-count:3] xl:[column-count:4]",children:[n.map(t=>e.jsx(B,{item:t,onNavigate:g=>i(`/json-builder/${g}`)},t.id)),e.jsx(k,{onLoadMore:w,loading:f,hasMore:u})]}),r==="image"&&e.jsxs("div",{style:{columnGap:"1.25rem"},className:"[column-count:1] sm:[column-count:2] md:[column-count:3] lg:[column-count:4] xl:[column-count:5]",children:[n.map(t=>e.jsx(K,{item:t,onNavigate:g=>i(`/json-builder/${g}`)},t.id)),e.jsx(k,{onLoadMore:w,loading:f,hasMore:u})]}),r==="template"&&e.jsxs("div",{style:{columnGap:"1.25rem"},className:"[column-count:1] sm:[column-count:2] lg:[column-count:3]",children:[n.map(t=>e.jsx(_,{item:t,onApply:G,applyingId:z},t.id)),e.jsx(k,{onLoadMore:w,loading:f,hasMore:u})]})]})]})})}function B({item:s,onNavigate:i}){const r=a.useRef(null),d=a.useRef(null),[o,c]=a.useState(!1),[l,p]=a.use
1State(!1),[n,m]=a.useState(!1);return a.useEffect(()=>{const u=r.current;if(!u)return;const h=new IntersectionObserver(([f])=>{f.isIntersecting&&(c(!0),h.disconnect())},{rootMargin:"200px"});return h.observe(u),()=>h.disconnect()},[]),e.jsxs("div",{className:"break-inside-avoid mb-5 w-full bg-white rounded-2xl overflow-hidden border border-gray-100 shadow-sm hover:shadow-lg hover:-translate-y-0.5 transition-all duration-300",children:[e.jsx("div",{ref:r,className:"relative bg-black",children:l?e.jsx("video",{ref:d,className:"w-full object-contain",controls:!0,autoPlay:!0,preload:"auto",src:s.videoUrl}):o?e.jsxs("div",{className:"relative cursor-pointer",onClick:()=>{p(!0),requestAnimationFrame(()=>d.current?.play().catch(()=>{}))},children:[e.jsx("video",{className:"w-full object-contain pointer-events-none",preload:"metadata",src:s.videoUrl+"#t=0.1",muted:!0,playsInline:!0}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 hover:bg-black/20 transition-colors",children:e.jsx("div",{className:"w-14 h-14 rounded-full bg-white/90 flex items-center justify-center shadow-lg hover:scale-110 transition-transform",children:e.jsx($,{className:"w-6 h-6 text-gray-800 ml-0.5",fill:"currentColor"})})})]}):e.jsx("div",{className:"aspect-video bg-gradient-to-br from-gray-800 to-gray-900 flex items-center justify-center",children:e.jsx(I,{className:"w-8 h-8 text-gray-600"})})}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[e.jsx("span",{className:"px-2.5 py-0.5 text-[11px] font-semibold bg-indigo-50 text-indigo-600 rounded-full border border-indigo-100/80",children:s.provider}),e.jsx("span",{className:"px-2.5 py-0.5 text-[11px] font-semibold bg-gray-50 text-gray-500 rounded-full border border-gray-100/80",children:s.taskType})]}),e.jsxs("div",{className:"relative",children:[e.jsx("p",{className:`text-[13px] text-gray-700 leading-relaxed ${n?"":"line-clamp-2"}`,children:s.prompt||"暂无提示词"}),s.prompt&&s.prompt.length>50&&e.jsx("button",{onClick:()=>m(!n),className:"text-[11px] text-indigo-500 hover:text-indigo-700 mt-1 font-medium",children:n?"收起":"展开"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-50 text-[11px] text-gray-400 flex items-center justify-between",children:[e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString("zh-CN").replace(/\//g,"-")}),s.projectId&&i&&e.jsxs("button",{onClick:()=>i(s.projectId),className:"inline-flex items-center gap-1 text-indigo-400 hover:text-indigo-600 font-medium",children:["查看工作流 ",e.jsx(A,{className:"w-3 h-3"})]})]})]})]})}function K({item:s,onNavigate:i}){const r=a.useRef(null),[d,o]=a.useState(!1),[c,l]=a.useState(!1);a.useEffect(()=>{const n=r.current;if(!n)return;const m=new IntersectionObserver(([u])=>{u.isIntersecting&&(o(!0),m.disconnect())},{rootMargin:"200px"});return m.observe(n),()=>m.disconnect()},[]);let p=[s.imageUrl];if(s.imageUrls)try{const n=typeof s.imageUrls=="string"?JSON.parse(s.imageUrls):s.imageUrls;Array.isArray(n)&&n.length>0&&(p=n)}catch{}return e.jsxs("div",{className:"break-inside-avoid mb-5 w-full bg-white rounded-2xl overflow-hidden border border-gray-100 shadow-sm hover:shadow-lg hover:-translate-y-0.5 transition-all duration-300 group",children:[e.jsx("div",{ref:r,className:"relative bg-gray-100",children:d?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:s.imageUrl,alt:s.prompt||"图片",className:"w-full object-cover",loading:"lazy"}),p.length>1&&e.jsxs("div",{className:"absolute top-2 right-2 px-2 py-0.5 text-[11px] font-semibold bg-black/60 text-white rounded-full",children:[p.length," 张"]})]}):e.jsx("div",{className:"aspect-square bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center",children:e.jsx(S,{className:"w-8 h-8 text-gray-300"})})}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[s.model&&e.jsx("span",{className:"px-2.5 py-0.5 text-[11px] font-semibold bg-emerald-50 text-emerald-600 rounded-full border border-emerald-100/80",children:s.model}),e.jsx("span",{className:"px-2.5 py-0.5 text-[11px] font-semibold bg-gray-50 text-gray-500 rounded-full border border-gray-100/80",children:s.action==="process"?"图片编辑":"文生图"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("p",{className:`text-[13px] text-gray-700 leading-relaxed ${c?"":"line-clamp-2"}`,children:s.prompt||"暂无提示词"}),s.prompt&&s.prompt.length>50&&e.jsx("button",{onClick:()=>l(!c),className:"text-[11px] text-indigo-500 hover:text-indigo-700 mt-1 font-medium",children:c?"收起":"展开"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-50 text-[11px] text-gray-400 flex items-center justify-between",children:[e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString("zh-CN").replace(/\//g,"-")}),s.projectId&&i&&e.jsxs("button",{onClick:()=>i(s.projectId),className:"inline-flex items-center gap-1 text-indigo-400 hover:text-indigo-600 font-medium",children:["查看工作流 ",e.jsx(A,{className:"w-3 h-3"})]})]})]})]})}export{me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.