@ -1,4 +1,5 @@ |
|||
VITE_API_URL=https://wwwskillhub.popi.art |
|||
VITE_SKILLHUB_URL=https://wwwtestskillhub.popi.art |
|||
VITE_CANVAS_URL=https://wwwtestcanvas.popi.art/ |
|||
|
|||
|
|||
|
|||
@ -1,4 +1,4 @@ |
|||
VITE_API_URL=https://popi.yuanzoo.cn/ |
|||
VITE_SKILLHUB_URL=https://skillhub.popi.art |
|||
|
|||
VITE_CANVAS_URL=https://canvas.popi.art/ |
|||
|
|||
|
|||
@ -1,4 +1,5 @@ |
|||
VITE_API_URL=https://wwwtest.popi.art/ |
|||
VITE_SKILLHUB_URL=https://wwwtestskillhub.popi.art |
|||
VITE_CANVAS_URL=https://wwwtestcanvas.popi.art/ |
|||
|
|||
|
|||
|
|||
@ -1 +1,13 @@ |
|||
node_modules |
|||
|
|||
# Vite build output |
|||
dist/ |
|||
|
|||
# vite-plugin-compression (gzip / brotli) |
|||
*.gz |
|||
*.br |
|||
|
|||
# Local deploy archives (repo root) |
|||
/*.zip |
|||
/*.tar.gz |
|||
/*.tgz |
|||
|
|||
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 402 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1003 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 20 KiB |
@ -1,2 +0,0 @@ |
|||
function v(p){return String(p??"").trim()}function N(p){const f=p.currentTarget;if(!f)return null;if(f instanceof HTMLImageElement)return f.complete&&f.naturalWidth>0&&f.naturalHeight>0?f:null;const g=f.querySelector("img");return g&&g.complete&&g.naturalWidth>0&&g.naturalHeight>0?g:null}function L(p){const f=Math.max(8,Number(p?.maxCacheCount??32)),g=p?.enableCanvasWarmup??!0,W=Math.max(1,Number(p?.maxWarmupPerCall??24)),y=p?.disableCanvasPreview??!1,l=new Map,w=new Map,c=new Map,x=new Set,d=document.createElement("div");d.style.width="1px",d.style.height="1px",d.style.position="fixed",d.style.top="-9999px",d.style.left="-9999px",d.style.opacity="0",document.body.appendChild(d);const E=e=>{const t=l.get(e);t?.parentNode&&t.parentNode.removeChild(t),l.delete(e),w.delete(e)},b=e=>{const t=c.get(e);t?.parentNode&&t.parentNode.removeChild(t),c.delete(e)},k=()=>{for(;l.size>f;){const e=l.keys().next().value;if(!e)break;E(e),b(e)}},C=e=>{if(!e.complete||e.naturalWidth<=0||e.naturalHeight<=0)return null;const t=120,a=document.createElement("canvas");a.width=t,a.height=t,a.style.width=`${t}px`,a.style.height=`${t}px`,a.style.position="fixed",a.style.top="-9999px",a.style.left="-9999px";const r=a.getContext("2d");if(!r)return null;const n=e.naturalWidth,s=e.naturalHeight,m=n/s,u=1;let o=0,i=0,h=n,P=s;return m>u?(h=s*u,o=(n-h)/2):m<u&&(P=n/u,i=(s-P)/2),r.drawImage(e,o,i,h,P,0,0,t,t),a},I=e=>{const t=v(e);if(!t)return null;const a=l.get(t);if(a)return l.delete(t),l.set(t,a),a;const r=new Image;return r.src=t,r.style.width="120px",r.style.height="120px",r.style.objectFit="cover",r.decoding="async",r.loading="eager",l.set(t,r),k(),r},T=e=>{const t=v(e);if(!t)return Promise.resolve();const a=w.get(t);if(a)return a;const r=I(t);if(!r)return Promise.resolve();const n=new Promise(s=>{if(r.complete&&r.naturalWidth>0){s();return}const m=()=>{r.removeEventListener("load",m),r.removeEventListener("error",m),s()};r.addEventListener("load",m,{once:!0}),r.addEventListener("error",m,{once:!0})}).then(async()=>{try{typeof r.decode=="function"&&await r.decode()}catch{}});return w.set(t,n),n},D=e=>{const t=v(e);return!t||c.has(t)?Promise.resolve():T(t).then(()=>{if(c.has(t))return;const a=l.get(t);if(!a)return;const r=C(a);r&&(document.body.appendChild(r),c.set(t,r))})};return{ensurePreviewImage:I,warmupPreviewImages:e=>{let t=0;e.forEach(a=>{if(t>=W)return;const r=v(a);if(!r||x.has(r))return;x.add(r),t+=1;const n=()=>{T(r),g&&!y&&D(r)};"requestIdleCallback"in window?window.requestIdleCallback(n,{timeout:1200}):setTimeout(n,0)})},startImageDrag:({evt:e,dragUrl:t,previewUrl:a,preferDomDragImage:r})=>{const n=v(t);if(!n||!e.dataTransfer)return!1;if(e.dataTransfer.clearData(),e.dataTransfer.setData("text/plain",n),e.dataTransfer.setData("text/uri-list",n),e.dataTransfer.setData("text/html",`<img src="${n}" />`),r){const o=N(e);if(o){const i=C(o);if(i){document.body.appendChild(i);const h=`__dom_preview__:${n}`;return b(h),c.set(h,i),e.dataTransfer.setDragImage(i,60,60),!0}}}const s=v(a??n),m=I(s);let u=y?null:c.get(s);if(!u&&!y&&m){const o=C(m);o?(document.body.appendChild(o),c.set(s,o),u=o):D(s)}if(!u){const o=N(e);if(o){const i=C(o);i&&(document.body.appendChild(i),c.set(s,i),u=i)}}return u?e.dataTransfer.setDragImage(u,60,60):e.dataTransfer.setDragImage(d,0,0),!0},dispose:()=>{l.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),c.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),l.clear(),w.clear(),c.clear(),x.clear(),d.parentNode&&d.parentNode.removeChild(d)}}}export{L as c}; |
|||
//# sourceMappingURL=imageDragTransfer-apm0lmHd.js.map
|
|||
@ -1 +0,0 @@ |
|||
@charset "UTF-8";.createPage__myCreationsWrap{padding:0 29px;box-sizing:border-box}.createPage__myCreationsGrouped{display:flex;flex-direction:column;gap:24px}.createPage__myCreationsDaySection{margin:0;padding:0}.createPage__myCreationsDayTitle{margin:0 0 20px;padding:0;font-size:16px;font-weight:500;line-height:1.4;color:#666}.createPage__myCreationsList{display:flex;flex-wrap:wrap;gap:15px;margin:0;padding:0;list-style:none}@media (max-width: 640px){.createPage__myCreationsList{grid-template-columns:repeat(2,minmax(0,1fr))}}.createPage__myCreationsListItem{width:260px;height:260px;margin-bottom:20px;padding:0;aspect-ratio:1;border-radius:8px;overflow:hidden;background:#f5f5f5;cursor:pointer}.createPage__myCreationsListItem_video{position:relative}.createPage__myCreationsVideoHoverOverlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;background:#00000073;opacity:1;transition:opacity .18s ease;pointer-events:none}.createPage__myCreationsListItem_video:hover .createPage__myCreationsVideoHoverOverlay{opacity:0;background:transparent}.createPage__myCreationsVideoHoverIcon{width:56px;height:56px;display:block;max-width:100%;max-height:100%}@keyframes createPage__myCreationsPendingSpin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.createPage__myCreationsListItem_pending{border-radius:9px;background:linear-gradient(136deg,#f0f0f0 36.14%,#d6ceef 99.52%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.createPage__myCreationsListItem_pending .createPage__myCreationsPendingIcon{width:70px;height:70px;display:block;animation:createPage__myCreationsPendingSpin 4s linear infinite}.createPage__myCreationsListItem_pending .createPage__myCreationsPendingLabel{color:#6841ea4d;text-align:center;font-family:Source Han Sans CN;font-size:12px;font-style:normal;font-weight:500;line-height:normal}.createPage__myCreationsThumb{display:block;width:100%;height:100%;object-fit:contain;object-position:center}.createPage__myCreationsThumb_empty{width:100%;height:100%;min-height:80px;background:#ebebeb}.createPage__myCreationsSentinel{height:1px;margin-top:8px;pointer-events:none}.createPage__myCreationsLoadMore{margin-top:8px;text-align:center}@media (max-width: 520px){.createPage__myCreationsWrap{padding-left:16px;padding-right:16px}.createPage__filters{justify-content:flex-start}.createPage__batchBtn{align-self:flex-end}} |
|||
@ -1,2 +0,0 @@ |
|||
import{j as a}from"./markdown-vendor-BZI_VWzW.js";import{u as i,r as o}from"./data-vendor-BOGugMqL.js";import{e as c,O as n}from"./react-vendor-CmPQC3tV.js";const l=["myCreations","inspiration","favorite"],m={myCreations:"my-creations",inspiration:"inspiration",favorite:"favorite"};function x(){const{t:r}=i(),t=o.useId();return a.jsxs("div",{className:"createPage",children:[a.jsx("header",{className:"createPage__toolbar createPage__toolbar_primary_only",children:a.jsx("div",{className:"createPage__primaryTabs",role:"tablist","aria-label":r("pages.create.toolbarAria"),children:l.map(e=>a.jsx(c,{id:`${t}-tab-${e}`,to:m[e],end:!0,role:"tab",className:({isActive:s})=>classNames("createPage__primaryTab",s&&"createPage__primaryTab_active"),children:r(`pages.create.tabs.${e}`)},e))})}),a.jsx("div",{className:"createPage__outlet",children:a.jsx(n,{context:t})})]})}export{x as default}; |
|||
//# sourceMappingURL=index-3jBeF7Sc.js.map
|
|||
@ -1 +0,0 @@ |
|||
{"version":3,"file":"index-3jBeF7Sc.js","sources":["../../src/pages/Create/index.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, Outlet } from \"react-router-dom\";\nimport \"./index.scss\";\n\ntype PrimaryTabId = \"myCreations\" | \"inspiration\" | \"favorite\";\n\nconst PRIMARY_TAB_ORDER: PrimaryTabId[] = [\n \"myCreations\",\n \"inspiration\",\n \"favorite\",\n];\n\n/** 与 router 子 path 一致(相对 ROUTES.CREATE) */\nconst PRIMARY_TAB_PATH: Record<PrimaryTabId, string> = {\n myCreations: \"my-creations\",\n inspiration: \"inspiration\",\n favorite: \"favorite\",\n};\n\n\nexport default function Create() {\n const { t } = useTranslation();\n const tabIdPrefix = useId();\n\n return (\n <div className=\"createPage\">\n <header className=\"createPage__toolbar createPage__toolbar_primary_only\">\n <div className=\"createPage__primaryTabs\" role=\"tablist\" aria-label={t(\"pages.create.toolbarAria\")}>\n {PRIMARY_TAB_ORDER.map((id) => (\n <NavLink\n key={id}\n id={`${tabIdPrefix}-tab-${id}`}\n to={PRIMARY_TAB_PATH[id]}\n end\n role=\"tab\"\n className={({ isActive }) => classNames(\"createPage__primaryTab\", isActive && \"createPage__primaryTab_active\")}\n >\n {t(`pages.create.tabs.${id}`)}\n </NavLink>\n ))}\n </div>\n </header>\n\n <div className=\"createPage__outlet\">\n <Outlet context={tabIdPrefix} />\n </div>\n </div>\n );\n}\n"],"names":["PRIMARY_TAB_ORDER","PRIMARY_TAB_PATH","Create","t","useTranslation","tabIdPrefix","useId","jsxs","jsx","id","NavLink","isActive","Outlet"],"mappings":"6JAOA,MAAMA,EAAoC,CACxC,cACA,cACA,UACF,EAGMC,EAAiD,CACrD,YAAa,eACb,YAAa,cACb,SAAU,UACZ,EAGA,SAAwBC,GAAS,CAC/B,KAAM,CAAE,EAAAC,CAAA,EAAMC,EAAA,EACRC,EAAcC,EAAAA,MAAA,EAEpB,OACEC,EAAAA,KAAC,MAAA,CAAI,UAAU,aACb,SAAA,CAAAC,MAAC,UAAO,UAAU,uDAChB,SAAAA,MAAC,MAAA,CAAI,UAAU,0BAA0B,KAAK,UAAU,aAAYL,EAAE,0BAA0B,EAC7F,SAAAH,EAAkB,IAAKS,GACtBD,EAAAA,IAACE,EAAA,CAEC,GAAI,GAAGL,CAAW,QAAQI,CAAE,GAC5B,GAAIR,EAAiBQ,CAAE,EACvB,IAAG,GACH,KAAK,MACL,UAAW,CAAC,CAAE,SAAAE,CAAA,IAAe,WAAW,yBAA0BA,GAAY,+BAA+B,EAE5G,SAAAR,EAAE,qBAAqBM,CAAE,EAAE,CAAA,EAPvBA,CAAA,CASR,EACH,CAAA,CACF,EAEAD,EAAAA,IAAC,OAAI,UAAU,qBACb,eAACI,EAAA,CAAO,QAASP,EAAa,CAAA,CAChC,CAAA,EACF,CAEJ"} |
|||
@ -1,2 +0,0 @@ |
|||
import{j as r}from"./markdown-vendor-BZI_VWzW.js";import{u as U,r as a}from"./data-vendor-BOGugMqL.js";import{g as Y}from"./react-vendor-CmPQC3tV.js";import{T as q,U as G,o as V,e as Z}from"./index-BxSU1Bs1.js";import"./arco-vendor-gN7EHfgO.js";const h=20,M=[{title:"image",assetType:"1"},{title:"video",assetType:"2"},{title:"template",assetType:"4"},{title:"character",assetType:"5"}];function A(o){const s=o;return s?.data?.list??s?.list??[]}function B(o){let s=o?.parentElement??null;for(;s!=null;){const g=window.getComputedStyle(s).overflowY;if((g==="auto"||g==="scroll")&&s.scrollHeight>s.clientHeight)return s;s=s.parentElement}return null}function J(o){const s=o?.id??o?.assetId;return s==null||s===""?null:String(s)}function te({tabIdPrefix:o}){const{t:s}=U(),[v,g]=Y(),[l,N]=a.useState("1"),[u,p]=a.useState([]),[b,j]=a.useState(1),[f,d]=a.useState(!0),[m,F]=a.useState(!1),[P,w]=a.useState(!1),[y,C]=a.useState(null),E=a.useRef(null),S=a.useRef(!1),i=a.useRef(0),I=a.useRef(async()=>{});a.useEffect(()=>{const e=v.get("type");e!=null&&M.some(t=>t.assetType===e)&&N(e)},[v]);const L=a.useCallback(e=>({assetType:l,page:e,pageSize:h}),[l]),_=a.useCallback(e=>l==="5"?q({page:e,pageSize:h}):G(L(e)),[L,l]);a.useEffect(()=>{let e=!1;i.current+=1;const t=i.current;return j(1),d(!0),p([]),F(!0),C(null),_(1).then(n=>{if(e||i.current!==t)return;const c=A(n);p(c),d(c.length>=h)}).catch(n=>{e||i.current!==t||(C(n instanceof Error?n:new Error(String(n))),p([]),d(!1))}).finally(()=>{!e&&i.current===t&&F(!1)}),()=>{e=!0}},[_,l]);const D=a.useCallback(async()=>{if(!f||S.current||m||P)return;S.current=!0,w(!0);const e=i.current,t=b+1;try{const n=await _(t);if(i.current!==e)return;const c=A(n);c.length===0?d(!1):(p(H=>[...H,...c]),j(t),d(c.length>=h))}catch{i.current===e&&d(!1)}finally{S.current=!1,w(!1)}},[_,f,m,P,b]);I.current=D,a.useEffect(()=>{const e=E.current;if(!e||!f||m)return;const t=B(e),n=new IntersectionObserver(c=>{c[0]?.isIntersecting&&I.current()},{root:t,rootMargin:"200px",threshold:0});return n.observe(e),()=>n.disconnect()},[f,m,u.length]);const z=a.useCallback(e=>{N(e),g(t=>{const n=new URLSearchParams(t);return n.set("type",String(e)),n},{replace:!0})},[g]),x=a.useCallback(async e=>{const t=e.assetId;t!=null&&await V({assetId:t})},[]),k=a.useCallback(async e=>{Z({id:e.id})},[]),R=a.useCallback(e=>{e.currentTarget.querySelector("video")?.play()},[]),T=a.useCallback(e=>{e.currentTarget.querySelector("video")?.pause()},[]),O=a.useMemo(()=>M.map(({title:e,assetType:t})=>({assetType:t,label:s(`pages.create.filters.${e}`)})),[s]),$=a.useMemo(()=>u.map(e=>{const t=J(e)??`row-${l}`;return l=="2"?r.jsx("li",{className:"myFavoritePanel__item",onClick:()=>void x(e),onMouseEnter:R,onMouseLeave:T,children:r.jsx("video",{className:"myFavoritePanel__media",src:e.asset.video,muted:!0,playsInline:!0,loop:!0,preload:"metadata",poster:e.asset.cover,"aria-hidden":!0})},t):l=="1"||l=="4"?r.jsx("li",{className:"myFavoritePanel__item",onClick:()=>void x(e),children:r.jsx("img",{className:"myFavoritePanel__media",src:e?.asset?.images?.[0],loading:"lazy"})},t):l=="5"?r.jsx("li",{className:"myFavoritePanel__item",onClick:()=>void k(e),children:r.jsx("img",{className:"myFavoritePanel__media",src:e.avatar,loading:"lazy"})},t):r.jsx("li",{className:"myFavoritePanel__item myFavoritePanel__item_empty",children:r.jsx("span",{className:"myFavoritePanel__emptyLabel",children:s("pages.create.panels.favorite.noPreview")})},t)}),[x,k,u,R,T,l,s]);return r.jsxs("div",{className:"createPage__panelShell myFavoritePanel",children:[r.jsx("div",{className:"createPage__subRow myFavoritePanel__subRow",children:r.jsx("div",{className:"createPage__filters",role:"group","aria-label":s("pages.create.filtersAria"),"data-active-tab":l,children:O.map(({assetType:e,label:t})=>r.jsx("button",{type:"button","data-type":e,"data-selected":l===e,"aria-pressed":l===e,className:classNames("createPage__filterPill",l===e&&"createPage__filterPill_active"),onClick:()=>z(e),children:t},e))})}),r.jsxs("section",{className:"createPage__panel createPage__panelScroll createPage__panel_below_filters",id:`${o}-panel-favorite`,role:"tabpanel","aria-labelledby":`${o}-tab-favorite`,children:[m&&u.length===0?r.jsx("p",{className:"createPage__panelStatus",children:s("common.loading")}):null,y?r.jsx("p",{className:"createPage__panelStatus createPage__panelStatus_error",children:y.message}):null,!m&&!y&&u.length===0?r.jsx("p",{className:"createPage__panelPlaceholder",children:s("pages.create.panels.favorite.placeholder")}):null,u.length>0?r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"myFavoritePanel__list",role:"list",children:$}),f?r.jsx("div",{ref:E,className:"myFavoritePanel__sentinel","aria-hidden":!0}):null,P?r.jsx("p",{className:"createPage__panelStatus myFavoritePanel__loadMore",children:s("common.loading")}):null]}):null]})]})}export{te as default}; |
|||
//# sourceMappingURL=index-5rXb67Va.js.map
|
|||