Merge pull request #814 from zanllp/feat/enable-tiktok-view

add toggle to switch between classic and TikTok-style viewers. Enable all past experimental features by default
pull/815/head v1.3.0
zanllp 2025-06-02 21:25:48 +08:00 committed by GitHub
commit 5c239d5f27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
47 changed files with 867 additions and 290 deletions

View File

@ -13,8 +13,8 @@ Promise.resolve().then(async () => {
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infinite Image Browsing</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-66b6399d.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-15ce0f1b.css">
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-411a6464.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-8b98f7af.css">
</head>
<body>

View File

@ -280,13 +280,26 @@ class Image:
step = max(1, total_count // size)
start_indices = [random.randint(i * step, min((i + 1) * step - 1, total_count - 1)) for i in range(size)]
placeholders = ",".join("?" * len(start_indices))
cur.execute(f"SELECT * FROM image WHERE id IN ({placeholders})", start_indices)
rows = cur.fetchall()
curr_images = [cls.from_row(row) for row in rows if os.path.exists(row[1])]
images.extend(curr_images)
images = unique_by(images, lambda x: x.path)
start_indices = []
for i in range(size):
min_val = i * step
max_val = min((i + 1) * step - 1, total_count - 1)
# 确保 max_val 不小于 min_val
if max_val < min_val:
max_val = min_val
# 确保索引在有效范围内 (1 到 total_count)
min_val = max(1, min(min_val, total_count))
max_val = max(1, min(max_val, total_count))
if min_val <= max_val:
start_indices.append(random.randint(min_val, max_val))
if start_indices:
placeholders = ",".join("?" * len(start_indices))
cur.execute(f"SELECT * FROM image WHERE id IN ({placeholders})", start_indices)
rows = cur.fetchall()
curr_images = [cls.from_row(row) for row in rows if os.path.exists(row[1])]
images.extend(curr_images)
images = unique_by(images, lambda x: x.path)
return images

View File

@ -1 +1 @@
import{d as E,bB as $,r as f,m as M,_ as T,a as c,an as W,h as m,c as v,P as z}from"./index-66b6399d.js";var G=["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"],H={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:z.any,required:Boolean};const L=E({compatConfig:{MODE:3},name:"Checkbox",inheritAttrs:!1,props:$(H,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(a,d){var t=d.attrs,h=d.emit,g=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();M(function(){return a.checked},function(){o.value=a.checked}),g({focus:function(){var e;(e=i.value)===null||e===void 0||e.focus()},blur:function(){var e;(e=i.value)===null||e===void 0||e.blur()}});var l=f(),x=function(e){if(!a.disabled){a.checked===void 0&&(o.value=e.target.checked),e.shiftKey=l.value;var r={target:c(c({},a),{},{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e};a.checked!==void 0&&(i.value.checked=!!a.checked),h("change",r),l.value=!1}},C=function(e){h("click",e),l.value=e.shiftKey};return function(){var n,e=a.prefixCls,r=a.name,s=a.id,p=a.type,b=a.disabled,K=a.readonly,P=a.tabindex,B=a.autofocus,S=a.value,N=a.required,_=T(a,G),q=t.class,D=t.onFocus,j=t.onBlur,w=t.onKeydown,A=t.onKeypress,F=t.onKeyup,y=c(c({},_),t),O=Object.keys(y).reduce(function(k,u){return(u.substr(0,5)==="aria-"||u.substr(0,5)==="data-"||u==="role")&&(k[u]=y[u]),k},{}),R=W(e,q,(n={},m(n,"".concat(e,"-checked"),o.value),m(n,"".concat(e,"-disabled"),b),n)),V=c(c({name:r,id:s,type:p,readonly:K,disabled:b,tabindex:P,class:"".concat(e,"-input"),checked:!!o.value,autofocus:B,value:S},O),{},{onChange:x,onClick:C,onFocus:D,onBlur:j,onKeydown:w,onKeypress:A,onKeyup:F,required:N});return v("span",{class:R},[v("input",c({ref:i},V),null),v("span",{class:"".concat(e,"-inner")},null)])}}});export{L as V};
import{d as E,bB as $,r as f,m as M,_ as T,a as c,an as W,h as m,c as v,P as z}from"./index-411a6464.js";var G=["prefixCls","name","id","type","disabled","readonly","tabindex","autofocus","value","required"],H={prefixCls:String,name:String,id:String,type:String,defaultChecked:{type:[Boolean,Number],default:void 0},checked:{type:[Boolean,Number],default:void 0},disabled:Boolean,tabindex:{type:[Number,String]},readonly:Boolean,autofocus:Boolean,value:z.any,required:Boolean};const L=E({compatConfig:{MODE:3},name:"Checkbox",inheritAttrs:!1,props:$(H,{prefixCls:"rc-checkbox",type:"checkbox",defaultChecked:!1}),emits:["click","change"],setup:function(a,d){var t=d.attrs,h=d.emit,g=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();M(function(){return a.checked},function(){o.value=a.checked}),g({focus:function(){var e;(e=i.value)===null||e===void 0||e.focus()},blur:function(){var e;(e=i.value)===null||e===void 0||e.blur()}});var l=f(),x=function(e){if(!a.disabled){a.checked===void 0&&(o.value=e.target.checked),e.shiftKey=l.value;var r={target:c(c({},a),{},{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e};a.checked!==void 0&&(i.value.checked=!!a.checked),h("change",r),l.value=!1}},C=function(e){h("click",e),l.value=e.shiftKey};return function(){var n,e=a.prefixCls,r=a.name,s=a.id,p=a.type,b=a.disabled,K=a.readonly,P=a.tabindex,B=a.autofocus,S=a.value,N=a.required,_=T(a,G),q=t.class,D=t.onFocus,j=t.onBlur,w=t.onKeydown,A=t.onKeypress,F=t.onKeyup,y=c(c({},_),t),O=Object.keys(y).reduce(function(k,u){return(u.substr(0,5)==="aria-"||u.substr(0,5)==="data-"||u==="role")&&(k[u]=y[u]),k},{}),R=W(e,q,(n={},m(n,"".concat(e,"-checked"),o.value),m(n,"".concat(e,"-disabled"),b),n)),V=c(c({name:r,id:s,type:p,readonly:K,disabled:b,tabindex:P,class:"".concat(e,"-input"),checked:!!o.value,autofocus:B,value:S},O),{},{onChange:x,onClick:C,onFocus:D,onBlur:j,onKeydown:w,onKeypress:A,onKeyup:F,required:N});return v("span",{class:R},[v("input",c({ref:i},V),null),v("span",{class:"".concat(e,"-inner")},null)])}}});export{L as V};

File diff suppressed because one or more lines are too long

3
vue/dist/assets/FileItem-8a2b9b92.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as a,U as t,V as s,c as n,cB as _,a0 as o}from"./index-66b6399d.js";const c={class:"img-sli-container"},i=a({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(l){return(e,r)=>(t(),s("div",c,[n(_,{left:e.left,right:e.right},null,8,["left","right"])]))}});const d=o(i,[["__scopeId","data-v-ae3fb9a8"]]);export{d as default};
import{d as a,U as t,V as s,c as n,cB as _,a0 as o}from"./index-411a6464.js";const c={class:"img-sli-container"},i=a({__name:"ImgSliPagePane",props:{paneIdx:{},tabIdx:{},left:{},right:{}},setup(l){return(e,r)=>(t(),s("div",c,[n(_,{left:e.left,right:e.right},null,8,["left","right"])]))}});const d=o(i,[["__scopeId","data-v-ae3fb9a8"]]);export{d as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{bT as i,b0 as t,dY as f,bK as n}from"./index-66b6399d.js";function u(e,s,r){if(!i(r))return!1;var a=typeof s;return(a=="number"?t(r)&&f(s,r.length):a=="string"&&s in r)?n(r[s],e):!1}export{u as i};
import{bT as i,b0 as t,dY as f,bK as n}from"./index-411a6464.js";function u(e,s,r){if(!i(r))return!1;var a=typeof s;return(a=="number"?t(r)&&f(s,r.length):a=="string"&&s in r)?n(r[s],e):!1}export{u as i};

View File

@ -1 +1 @@
import{d as F,a1 as B,cC as $,ca as S,U as _,V as w,W as f,c as l,a3 as d,X as p,Y as c,a4 as s,a2 as A,af as E,cD as R,cE as y,z as V,B as x,ak as T,a0 as U}from"./index-66b6399d.js";import{_ as N}from"./index-056afc6a.js";import{u as L,a as H,f as O,F as W,d as j}from"./FileItem-09b081e1.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-f1eb3728.js";/* empty css */import"./_isIterateeCall-c55d2ac4.js";import"./index-66d21078.js";const q={class:"actions-panel actions"},G={class:"item"},P={key:0,class:"file-list"},Q={class:"hint"},X=F({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(Y){const{stackViewEl:D}=L().toRefs(),{itemSize:h,gridItems:b,cellWidth:g}=H(),i=B(),m=O(),{selectdFiles:o}=$(m),r=S(),v=async e=>{const t=R(e);t&&m.addFiles(t.nodes)},C=async()=>{r.pushAction(async()=>{const e=await y.value.post("/zip",{paths:o.value.map(u=>u.fullpath),compress:i.batchDownloadCompress,pack_only:!1},{responseType:"blob"}),t=window.URL.createObjectURL(new Blob([e.data])),a=document.createElement("a");a.href=t,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},I=async()=>{r.pushAction(async()=>{await y.value.post("/zip",{paths:o.value.map(e=>e.fullpath),compress:i.batchDownloadCompress,pack_only:!0},{responseType:"blob"}),V.success(x("success"))})},z=e=>{o.value.splice(e,1)};return(e,t)=>{const a=T,u=N;return _(),w("div",{class:"container",ref_key:"stackViewEl",ref:D,onDrop:v},[f("div",q,[l(a,{onClick:t[0]||(t[0]=n=>s(m).selectdFiles=[])},{default:d(()=>[p(c(e.$t("clear")),1)]),_:1}),f("div",G,[p(c(e.$t("compressFile"))+": ",1),l(u,{checked:s(i).batchDownloadCompress,"onUpdate:checked":t[1]||(t[1]=n=>s(i).batchDownloadCompress=n)},null,8,["checked"])]),l(a,{onClick:I,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("packOnlyNotDownload")),1)]),_:1},8,["loading"]),l(a,{onClick:C,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("zipDownload")),1)]),_:1},8,["loading"])]),s(o).length?(_(),A(s(j),{key:1,ref:"scroller",class:"file-list",items:s(o).slice(),"item-size":s(h).first,"key-field":"fullpath","item-secondary-size":s(h).second,gridItems:s(b)},{default:d(({item:n,index:k})=>[l(W,{idx:k,file:n,"cell-width":s(g),"enable-close-icon":"",onCloseIconClick:J=>z(k),"full-screen-preview-image-url":s(E)(n),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(_(),w("div",P,[f("p",Q,c(e.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const oe=U(X,[["__scopeId","data-v-a2642a17"]]);export{oe as default};
import{d as F,a1 as B,cC as $,ca as S,U as _,V as w,W as f,c as l,a3 as d,X as p,Y as c,a4 as s,a2 as A,af as E,cD as R,cE as y,z as V,B as x,ak as T,a0 as U}from"./index-411a6464.js";import{_ as N}from"./index-9122e675.js";import{u as L,a as H,f as O,F as W,d as j}from"./FileItem-8a2b9b92.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-a6102596.js";/* empty css */import"./_isIterateeCall-bb47e76e.js";import"./index-c61f4123.js";const q={class:"actions-panel actions"},G={class:"item"},P={key:0,class:"file-list"},Q={class:"hint"},X=F({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(Y){const{stackViewEl:D}=L().toRefs(),{itemSize:h,gridItems:b,cellWidth:g}=H(),i=B(),m=O(),{selectdFiles:o}=$(m),r=S(),v=async e=>{const t=R(e);t&&m.addFiles(t.nodes)},C=async()=>{r.pushAction(async()=>{const e=await y.value.post("/zip",{paths:o.value.map(u=>u.fullpath),compress:i.batchDownloadCompress,pack_only:!1},{responseType:"blob"}),t=window.URL.createObjectURL(new Blob([e.data])),a=document.createElement("a");a.href=t,a.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(a),a.click()})},I=async()=>{r.pushAction(async()=>{await y.value.post("/zip",{paths:o.value.map(e=>e.fullpath),compress:i.batchDownloadCompress,pack_only:!0},{responseType:"blob"}),V.success(x("success"))})},z=e=>{o.value.splice(e,1)};return(e,t)=>{const a=T,u=N;return _(),w("div",{class:"container",ref_key:"stackViewEl",ref:D,onDrop:v},[f("div",q,[l(a,{onClick:t[0]||(t[0]=n=>s(m).selectdFiles=[])},{default:d(()=>[p(c(e.$t("clear")),1)]),_:1}),f("div",G,[p(c(e.$t("compressFile"))+": ",1),l(u,{checked:s(i).batchDownloadCompress,"onUpdate:checked":t[1]||(t[1]=n=>s(i).batchDownloadCompress=n)},null,8,["checked"])]),l(a,{onClick:I,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("packOnlyNotDownload")),1)]),_:1},8,["loading"]),l(a,{onClick:C,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("zipDownload")),1)]),_:1},8,["loading"])]),s(o).length?(_(),A(s(j),{key:1,ref:"scroller",class:"file-list",items:s(o).slice(),"item-size":s(h).first,"key-field":"fullpath","item-secondary-size":s(h).second,gridItems:s(b)},{default:d(({item:n,index:k})=>[l(W,{idx:k,file:n,"cell-width":s(g),"enable-close-icon":"",onCloseIconClick:J=>z(k),"full-screen-preview-image-url":s(E)(n),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","onCloseIconClick","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):(_(),w("div",P,[f("p",Q,c(e.$t("batchDownloaDDragAndDropHint")),1)]))],544)}}});const oe=U(X,[["__scopeId","data-v-a2642a17"]]);export{oe as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{u as w,a as k,F as y,d as x}from"./FileItem-09b081e1.js";import{d as F,a1 as D,c7 as b,r as h,bg as I,bk as C,U as V,V as E,c,a3 as z,a4 as e,af as S,cD as B,cF as R,a0 as A}from"./index-66b6399d.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-f1eb3728.js";/* empty css */import"./_isIterateeCall-c55d2ac4.js";import"./index-66d21078.js";const K=F({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=D(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=k(),g=b(),a=h(o.files??[]),_=async s=>{const l=B(s);o.allowDragAndDrop&&l&&(a.value=R([...a.value,...l.nodes]))},v=s=>{a.value.splice(s,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(a.value),setFiles:s=>a.value=s})}),(s,l)=>(V(),E("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[c(e(x),{ref:"scroller",class:"file-list",items:a.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:z(({item:t,index:r})=>{var n;return[c(y,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:T=>v(r),"full-screen-preview-image-url":e(S)(t),"extra-tags":(n=t==null?void 0:t.tags)==null?void 0:n.map(e(g).tagConvert),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","enable-close-icon","onCloseIconClick","full-screen-preview-image-url","extra-tags"])]}),_:1},8,["items","item-size","item-secondary-size","gridItems"])],544))}});const N=A(K,[["__scopeId","data-v-f35f4802"]]);export{N as default};
import{u as w,a as k,F as y,d as x}from"./FileItem-8a2b9b92.js";import{d as F,a1 as D,c7 as b,r as h,bg as I,bk as C,U as V,V as E,c,a3 as z,a4 as e,af as S,cD as B,cF as R,a0 as A}from"./index-411a6464.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-a6102596.js";/* empty css */import"./_isIterateeCall-bb47e76e.js";import"./index-c61f4123.js";const K=F({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=D(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=k(),g=b(),a=h(o.files??[]),_=async s=>{const l=B(s);o.allowDragAndDrop&&l&&(a.value=R([...a.value,...l.nodes]))},v=s=>{a.value.splice(s,1)};return I(()=>{d.pageFuncExportMap.set(o.paneKey,{getFiles:()=>C(a.value),setFiles:s=>a.value=s})}),(s,l)=>(V(),E("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[c(e(x),{ref:"scroller",class:"file-list",items:a.value.slice(),"item-size":e(i).first,"key-field":"fullpath","item-secondary-size":e(i).second,gridItems:e(u)},{default:z(({item:t,index:r})=>{var n;return[c(y,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:T=>v(r),"full-screen-preview-image-url":e(S)(t),"extra-tags":(n=t==null?void 0:t.tags)==null?void 0:n.map(e(g).tagConvert),"enable-right-click-menu":!1},null,8,["idx","file","cell-width","enable-close-icon","onCloseIconClick","full-screen-preview-image-url","extra-tags"])]}),_:1},8,["items","item-size","item-secondary-size","gridItems"])],544))}});const N=A(K,[["__scopeId","data-v-f35f4802"]]);export{N as default};

View File

@ -1 +1 @@
import{am as F,r as g,l as P,k as A,O as b,G as R,ca as q,cl as O,cp as z}from"./index-66b6399d.js";import{u as L,a as Q,b as j,e as H}from"./FileItem-09b081e1.js";import{a as T,b as U,c as W}from"./MultiSelectKeep-c3d6d976.js";import{u as B}from"./useGenInfoDiff-46e61a5d.js";let K=0;const V=()=>++K,X=(n,i,{dataUpdateStrategy:l="replace"}={})=>{const o=F([""]),c=g(!1),t=g(),a=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(b((Array.isArray(t.value)||typeof t.value>"u")&&Array.isArray(e),"数据更新策略为合并时仅可用于值为数组的情况"),t.value=[...(s=t==null?void 0:t.value)!==null&&s!==void 0?s:[],...e])},d=e=>A(void 0,void 0,void 0,function*(){if(a.value||c.value&&typeof e>"u")return!1;a.value=!0;const s=V();f.value=s;try{let r;if(typeof e=="number"){if(r=o[e],typeof r!="string")return!1}else r=o[o.length-1];const h=yield n(r);if(v.has(s))return v.delete(s),!1;w(i(h));const u=h.cursor;if((e===o.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const m=u.next_cursor||u.next;b(typeof m=="string"),o.push(m)}}finally{f.value===s&&(a.value=!1)}return!0}),y=()=>{v.add(f.value),a.value=!1},x=(e=!1)=>A(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&y(),b(!a.value),o.splice(0,o.length,""),a.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),I=()=>({next:()=>A(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return P({abort:y,load:c,next:d,res:t,loading:a,cursorStack:o,reset:x,[Symbol.asyncIterator]:I,iter:{[Symbol.asyncIterator]:I}})},se=n=>F(X(n,i=>i.files,{dataUpdateStrategy:"merge"})),ne=n=>{const i=F(new Set),l=R(()=>(n.res??[]).filter(p=>!i.has(p.fullpath))),o=q(),{stackViewEl:c,multiSelectedIdxs:t,stack:a,scroller:f,props:v}=L({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:y,onScroll:x}=Q({fetchNext:()=>n.next()}),{showMenuIdx:I}=j(),{onFileDragStart:e,onFileDragEnd:s}=T(),{showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:m,onFileItemClick:C}=U({openNext:O}),{previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:D,canPreview:G}=W({loadNext:()=>n.next()}),J=async(p,S,N)=>{a.value=[{curr:"",files:l.value}],await m(p,S,N)};H("removeFiles",async({paths:p})=>{p.forEach(S=>i.add(S))});const k=()=>{z(l.value)};return{images:l,scroller:f,queue:o,iter:n,onContextMenuClickU:J,stackViewEl:c,previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:D,canPreview:G,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:m,onFileItemClick:C,showMenuIdx:I,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:y,onScroll:x,saveLoadedFileAsJson:k,saveAllFileAsJson:async()=>{for(;!n.load;)await n.next();k()},props:v,...B()}};export{se as c,ne as u};
import{am as F,r as g,l as P,k as A,O as b,G as R,ca as q,cl as O,cp as z}from"./index-411a6464.js";import{u as L,a as Q,b as j,e as H}from"./FileItem-8a2b9b92.js";import{a as T,b as U,c as W}from"./MultiSelectKeep-4f3a6585.js";import{u as B}from"./useGenInfoDiff-cad0d1cb.js";let K=0;const V=()=>++K,X=(n,i,{dataUpdateStrategy:l="replace"}={})=>{const o=F([""]),c=g(!1),t=g(),a=g(!1);let f=g(-1);const v=new Set,w=e=>{var s;l==="replace"?t.value=e:l==="merge"&&(b((Array.isArray(t.value)||typeof t.value>"u")&&Array.isArray(e),"数据更新策略为合并时仅可用于值为数组的情况"),t.value=[...(s=t==null?void 0:t.value)!==null&&s!==void 0?s:[],...e])},d=e=>A(void 0,void 0,void 0,function*(){if(a.value||c.value&&typeof e>"u")return!1;a.value=!0;const s=V();f.value=s;try{let r;if(typeof e=="number"){if(r=o[e],typeof r!="string")return!1}else r=o[o.length-1];const h=yield n(r);if(v.has(s))return v.delete(s),!1;w(i(h));const u=h.cursor;if((e===o.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const m=u.next_cursor||u.next;b(typeof m=="string"),o.push(m)}}finally{f.value===s&&(a.value=!1)}return!0}),y=()=>{v.add(f.value),a.value=!1},x=(e=!1)=>A(void 0,void 0,void 0,function*(){const{refetch:s,force:r}=typeof e=="object"?e:{refetch:e};r&&y(),b(!a.value),o.splice(0,o.length,""),a.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),I=()=>({next:()=>A(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return P({abort:y,load:c,next:d,res:t,loading:a,cursorStack:o,reset:x,[Symbol.asyncIterator]:I,iter:{[Symbol.asyncIterator]:I}})},se=n=>F(X(n,i=>i.files,{dataUpdateStrategy:"merge"})),ne=n=>{const i=F(new Set),l=R(()=>(n.res??[]).filter(p=>!i.has(p.fullpath))),o=q(),{stackViewEl:c,multiSelectedIdxs:t,stack:a,scroller:f,props:v}=L({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:y,onScroll:x}=Q({fetchNext:()=>n.next()}),{showMenuIdx:I}=j(),{onFileDragStart:e,onFileDragEnd:s}=T(),{showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:m,onFileItemClick:C}=U({openNext:O}),{previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:D,canPreview:G}=W({loadNext:()=>n.next()}),J=async(p,S,N)=>{a.value=[{curr:"",files:l.value}],await m(p,S,N)};H("removeFiles",async({paths:p})=>{p.forEach(S=>i.add(S))});const k=()=>{z(l.value)};return{images:l,scroller:f,queue:o,iter:n,onContextMenuClickU:J,stackViewEl:c,previewIdx:_,previewing:E,onPreviewVisibleChange:M,previewImgMove:D,canPreview:G,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:h,q:u,onContextMenuClick:m,onFileItemClick:C,showMenuIdx:I,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:y,onScroll:x,saveLoadedFileAsJson:k,saveAllFileAsJson:async()=>{for(;!n.load;)await n.next();k()},props:v,...B()}};export{se as c,ne as u};

View File

@ -1 +0,0 @@
import{cj as e,ck as i,cl as r,cm as n,b0 as a}from"./index-66b6399d.js";function o(s,t){return e(i(s,t,r),s+"")}function b(s){return n(s)&&a(s)}export{o as b,b as i};

View File

@ -1 +1 @@
import{d as w,bB as A,av as D,cx as j,az as k,n as B,cy as V,cz as y,e as $,c as a,_ as T,h as r,a as P,cA as M,P as b}from"./index-66b6399d.js";var O=["class","style"],W=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:b.any,delay:Number,indicator:b.any}},p=null;function q(t,n){return!!t&&!!n&&!isNaN(Number(n))}function G(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const H=w({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:A(W(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:D("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=q(n,e);return{sSpinning:n&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var n=this;k(function(){n.debouncifyUpdateSpinning(),n.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(n){var e=n||this.$props,i=e.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=B(this.originalUpdateSpinning,i))},updateSpinning:function(){var n=this.spinning,e=this.sSpinning;e!==n&&(this.sSpinning=n)},cancelExistingSpin:function(){var n=this.updateSpinning;n&&n.cancel&&n.cancel()},renderIndicator:function(n){var e="".concat(n,"-dot"),i=V(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),y(i)?$(i,{class:e}):p&&y(p())?$(p(),{class:e}):a("span",{class:"".concat(e," ").concat(n,"-dot-spin")},[a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null)]))}},render:function(){var n,e,i,o=this.$props,f=o.size,x=o.prefixCls,h=o.tip,d=h===void 0?(n=(e=this.$slots).tip)===null||n===void 0?void 0:n.call(e):h,N=o.wrapperClassName,l=this.$attrs,v=l.class,_=l.style,C=T(l,O),S=this.configProvider,U=S.getPrefixCls,z=S.direction,s=U("spin",x),u=this.sSpinning,E=(i={},r(i,s,!0),r(i,"".concat(s,"-sm"),f==="small"),r(i,"".concat(s,"-lg"),f==="large"),r(i,"".concat(s,"-spinning"),u),r(i,"".concat(s,"-show-text"),!!d),r(i,"".concat(s,"-rtl"),z==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:_,class:E}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=M(this);if(g&&g.length){var c,I=(c={},r(c,"".concat(s,"-container"),!0),r(c,"".concat(s,"-blur"),u),c);return a("div",{class:["".concat(s,"-nested-loading"),N]},[u&&a("div",{key:"loading"},[m]),a("div",{class:I,key:"container"},[g])])}return m}});export{H as S,G as s};
import{d as w,bB as A,av as D,cx as j,az as k,n as B,cy as V,cz as y,e as $,c as a,_ as T,h as r,a as P,cA as M,P as b}from"./index-411a6464.js";var O=["class","style"],W=function(){return{prefixCls:String,spinning:{type:Boolean,default:void 0},size:String,wrapperClassName:String,tip:b.any,delay:Number,indicator:b.any}},p=null;function q(t,n){return!!t&&!!n&&!isNaN(Number(n))}function G(t){var n=t.indicator;p=typeof n=="function"?n:function(){return a(n,null,null)}}const H=w({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:A(W(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:D("configProvider",j)}},data:function(){var n=this.spinning,e=this.delay,i=q(n,e);return{sSpinning:n&&!i}},created:function(){this.originalUpdateSpinning=this.updateSpinning,this.debouncifyUpdateSpinning(this.$props)},mounted:function(){this.updateSpinning()},updated:function(){var n=this;k(function(){n.debouncifyUpdateSpinning(),n.updateSpinning()})},beforeUnmount:function(){this.cancelExistingSpin()},methods:{debouncifyUpdateSpinning:function(n){var e=n||this.$props,i=e.delay;i&&(this.cancelExistingSpin(),this.updateSpinning=B(this.originalUpdateSpinning,i))},updateSpinning:function(){var n=this.spinning,e=this.sSpinning;e!==n&&(this.sSpinning=n)},cancelExistingSpin:function(){var n=this.updateSpinning;n&&n.cancel&&n.cancel()},renderIndicator:function(n){var e="".concat(n,"-dot"),i=V(this,"indicator");return i===null?null:(Array.isArray(i)&&(i=i.length===1?i[0]:i),y(i)?$(i,{class:e}):p&&y(p())?$(p(),{class:e}):a("span",{class:"".concat(e," ").concat(n,"-dot-spin")},[a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null),a("i",{class:"".concat(n,"-dot-item")},null)]))}},render:function(){var n,e,i,o=this.$props,f=o.size,x=o.prefixCls,h=o.tip,d=h===void 0?(n=(e=this.$slots).tip)===null||n===void 0?void 0:n.call(e):h,N=o.wrapperClassName,l=this.$attrs,v=l.class,_=l.style,C=T(l,O),S=this.configProvider,U=S.getPrefixCls,z=S.direction,s=U("spin",x),u=this.sSpinning,E=(i={},r(i,s,!0),r(i,"".concat(s,"-sm"),f==="small"),r(i,"".concat(s,"-lg"),f==="large"),r(i,"".concat(s,"-spinning"),u),r(i,"".concat(s,"-show-text"),!!d),r(i,"".concat(s,"-rtl"),z==="rtl"),r(i,v,!!v),i),m=a("div",P(P({},C),{},{style:_,class:E}),[this.renderIndicator(s),d?a("div",{class:"".concat(s,"-text")},[d]):null]),g=M(this);if(g&&g.length){var c,I=(c={},r(c,"".concat(s,"-container"),!0),r(c,"".concat(s,"-blur"),u),c);return a("div",{class:["".concat(s,"-nested-loading"),N]},[u&&a("div",{key:"loading"},[m]),a("div",{class:I,key:"container"},[g])])}return m}});export{H as S,G as s};

218
vue/dist/assets/index-411a6464.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
vue/dist/assets/index-7a9a2ccc.js vendored Normal file
View File

@ -0,0 +1 @@
import{cj as e,ck as i,cl as r,cm as n,b0 as a}from"./index-411a6464.js";function o(s,t){return e(i(s,t,r),s+"")}function b(s){return n(s)&&a(s)}export{o as b,b as i};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{r as F,o as P,cu as K,av as L,G as i,ax as T,ay as I,d as $,u as B,cv as _,b as y,bj as V,cw as A,an as E,h as c,c as M,a as G}from"./index-66b6399d.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),U=function(r){T(D,r)},k=function(){return L(D,{gutter:i(function(){}),wrap:i(function(){}),supportFlexGap:i(function(){})})};I("top","middle","bottom","stretch");I("start","end","center","space-around","space-between");var q=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},H=$({compatConfig:{MODE:3},name:"ARow",props:q(),setup:function(r,N){var m=N.slots,v=B("row",r),d=v.prefixCls,h=v.direction,j,x=F({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),w=W();P(function(){j=_.subscribe(function(e){var t=r.gutter||0;(!Array.isArray(t)&&y(t)==="object"||Array.isArray(t)&&(y(t[0])==="object"||y(t[1])==="object"))&&(x.value=e)})}),V(function(){_.unsubscribe(j)});var S=i(function(){var e=[0,0],t=r.gutter,n=t===void 0?0:t,s=Array.isArray(n)?n:[n,0];return s.forEach(function(l,b){if(y(l)==="object")for(var a=0;a<A.length;a++){var p=A[a];if(x.value[p]&&l[p]!==void 0){e[b]=l[p];break}}else e[b]=l||0}),e});U({gutter:S,supportFlexGap:w,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return E(d.value,(e={},c(e,"".concat(d.value,"-no-wrap"),r.wrap===!1),c(e,"".concat(d.value,"-").concat(r.justify),r.justify),c(e,"".concat(d.value,"-").concat(r.align),r.align),c(e,"".concat(d.value,"-rtl"),h.value==="rtl"),e))}),O=i(function(){var e=S.value,t={},n=e[0]>0?"".concat(e[0]/-2,"px"):void 0,s=e[1]>0?"".concat(e[1]/-2,"px"):void 0;return n&&(t.marginLeft=n,t.marginRight=n),w.value?t.rowGap="".concat(e[1],"px"):s&&(t.marginTop=s,t.marginBottom=s),t});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});const Y=H;function J(o){return typeof o=="number"?"".concat(o," ").concat(o," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(o)?"0 0 ".concat(o):o}var Q=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const Z=$({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=k(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=B("col",r),w=x.prefixCls,S=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=w.value,p={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(g){var f,u={},C=r[g];typeof C=="number"?u.span=C:y(C)==="object"&&(u=C||{}),p=G(G({},p),{},(f={},c(f,"".concat(a,"-").concat(g,"-").concat(u.span),u.span!==void 0),c(f,"".concat(a,"-").concat(g,"-order-").concat(u.order),u.order||u.order===0),c(f,"".concat(a,"-").concat(g,"-offset-").concat(u.offset),u.offset||u.offset===0),c(f,"".concat(a,"-").concat(g,"-push-").concat(u.push),u.push||u.push===0),c(f,"".concat(a,"-").concat(g,"-pull-").concat(u.pull),u.pull||u.pull===0),c(f,"".concat(a,"-rtl"),S.value==="rtl"),f))}),E(a,(e={},c(e,"".concat(a,"-").concat(t),t!==void 0),c(e,"".concat(a,"-order-").concat(n),n),c(e,"".concat(a,"-offset-").concat(s),s),c(e,"".concat(a,"-push-").concat(l),l),c(e,"".concat(a,"-pull-").concat(b),b),e),p)}),O=i(function(){var e=r.flex,t=d.value,n={};if(t&&t[0]>0){var s="".concat(t[0]/2,"px");n.paddingLeft=s,n.paddingRight=s}if(t&&t[1]>0&&!h.value){var l="".concat(t[1]/2,"px");n.paddingTop=l,n.paddingBottom=l}return e&&(n.flex=J(e),j.value===!1&&!n.minWidth&&(n.minWidth=0)),n});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});export{Z as C,Y as R};
import{r as F,o as P,cu as K,av as L,G as i,ax as T,ay as I,d as $,u as B,cv as _,b as y,bj as V,cw as A,an as E,h as c,c as M,a as G}from"./index-411a6464.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),U=function(r){T(D,r)},k=function(){return L(D,{gutter:i(function(){}),wrap:i(function(){}),supportFlexGap:i(function(){})})};I("top","middle","bottom","stretch");I("start","end","center","space-around","space-between");var q=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},H=$({compatConfig:{MODE:3},name:"ARow",props:q(),setup:function(r,N){var m=N.slots,v=B("row",r),d=v.prefixCls,h=v.direction,j,x=F({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0,xxxl:!0}),w=W();P(function(){j=_.subscribe(function(e){var t=r.gutter||0;(!Array.isArray(t)&&y(t)==="object"||Array.isArray(t)&&(y(t[0])==="object"||y(t[1])==="object"))&&(x.value=e)})}),V(function(){_.unsubscribe(j)});var S=i(function(){var e=[0,0],t=r.gutter,n=t===void 0?0:t,s=Array.isArray(n)?n:[n,0];return s.forEach(function(l,b){if(y(l)==="object")for(var a=0;a<A.length;a++){var p=A[a];if(x.value[p]&&l[p]!==void 0){e[b]=l[p];break}}else e[b]=l||0}),e});U({gutter:S,supportFlexGap:w,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return E(d.value,(e={},c(e,"".concat(d.value,"-no-wrap"),r.wrap===!1),c(e,"".concat(d.value,"-").concat(r.justify),r.justify),c(e,"".concat(d.value,"-").concat(r.align),r.align),c(e,"".concat(d.value,"-rtl"),h.value==="rtl"),e))}),O=i(function(){var e=S.value,t={},n=e[0]>0?"".concat(e[0]/-2,"px"):void 0,s=e[1]>0?"".concat(e[1]/-2,"px"):void 0;return n&&(t.marginLeft=n,t.marginRight=n),w.value?t.rowGap="".concat(e[1],"px"):s&&(t.marginTop=s,t.marginBottom=s),t});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});const Y=H;function J(o){return typeof o=="number"?"".concat(o," ").concat(o," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(o)?"0 0 ".concat(o):o}var Q=function(){return{span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},xxxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}};const Z=$({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=k(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=B("col",r),w=x.prefixCls,S=x.direction,R=i(function(){var e,t=r.span,n=r.order,s=r.offset,l=r.push,b=r.pull,a=w.value,p={};return["xs","sm","md","lg","xl","xxl","xxxl"].forEach(function(g){var f,u={},C=r[g];typeof C=="number"?u.span=C:y(C)==="object"&&(u=C||{}),p=G(G({},p),{},(f={},c(f,"".concat(a,"-").concat(g,"-").concat(u.span),u.span!==void 0),c(f,"".concat(a,"-").concat(g,"-order-").concat(u.order),u.order||u.order===0),c(f,"".concat(a,"-").concat(g,"-offset-").concat(u.offset),u.offset||u.offset===0),c(f,"".concat(a,"-").concat(g,"-push-").concat(u.push),u.push||u.push===0),c(f,"".concat(a,"-").concat(g,"-pull-").concat(u.pull),u.pull||u.pull===0),c(f,"".concat(a,"-rtl"),S.value==="rtl"),f))}),E(a,(e={},c(e,"".concat(a,"-").concat(t),t!==void 0),c(e,"".concat(a,"-order-").concat(n),n),c(e,"".concat(a,"-offset-").concat(s),s),c(e,"".concat(a,"-push-").concat(l),l),c(e,"".concat(a,"-pull-").concat(b),b),e),p)}),O=i(function(){var e=r.flex,t=d.value,n={};if(t&&t[0]>0){var s="".concat(t[0]/2,"px");n.paddingLeft=s,n.paddingRight=s}if(t&&t[1]>0&&!h.value){var l="".concat(t[1]/2,"px");n.paddingTop=l,n.paddingBottom=l}return e&&(n.flex=J(e),j.value===!1&&!n.minWidth&&(n.minWidth=0)),n});return function(){var e;return M("div",{class:R.value,style:O.value},[(e=m.default)===null||e===void 0?void 0:e.call(m)])}}});export{Z as C,Y as R};

View File

@ -1 +1 @@
import{ct as j,ay as z,d as K,j as U,df as $,w,r as b,G as S,m as A,u as D,o as E,az as G,h as d,c as s,a as C,aw as H,be as L,g as _,dg as W,P as c,dh as x}from"./index-66b6399d.js";var R=z("small","default"),q=function(){return{id:String,prefixCls:String,size:c.oneOf(R),disabled:{type:Boolean,default:void 0},checkedChildren:c.any,unCheckedChildren:c.any,tabindex:c.oneOfType([c.string,c.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:c.oneOfType([c.string,c.number,c.looseBool]),checkedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!0),unCheckedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}},J=K({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:q(),slots:["checkedChildren","unCheckedChildren"],setup:function(n,r){var o=r.attrs,y=r.slots,B=r.expose,l=r.emit,m=U();$(function(){w(!("defaultChecked"in o),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),w(!("value"in o),"Switch","`value` is not validate prop, do you mean `checked`?")});var h=b(n.checked!==void 0?n.checked:o.defaultChecked),f=S(function(){return h.value===n.checkedValue});A(function(){return n.checked},function(){h.value=n.checked});var v=D("switch",n),u=v.prefixCls,F=v.direction,T=v.size,i=b(),g=function(){var e;(e=i.value)===null||e===void 0||e.focus()},V=function(){var e;(e=i.value)===null||e===void 0||e.blur()};B({focus:g,blur:V}),E(function(){G(function(){n.autofocus&&!n.disabled&&i.value.focus()})});var k=function(e,t){n.disabled||(l("update:checked",e),l("change",e,t),m.onFieldChange())},I=function(e){l("blur",e)},N=function(e){g();var t=f.value?n.unCheckedValue:n.checkedValue;k(t,e),l("click",t,e)},M=function(e){e.keyCode===x.LEFT?k(n.unCheckedValue,e):e.keyCode===x.RIGHT&&k(n.checkedValue,e),l("keydown",e)},O=function(e){var t;(t=i.value)===null||t===void 0||t.blur(),l("mouseup",e)},P=S(function(){var a;return a={},d(a,"".concat(u.value,"-small"),T.value==="small"),d(a,"".concat(u.value,"-loading"),n.loading),d(a,"".concat(u.value,"-checked"),f.value),d(a,"".concat(u.value,"-disabled"),n.disabled),d(a,u.value,!0),d(a,"".concat(u.value,"-rtl"),F.value==="rtl"),a});return function(){var a;return s(W,{insertExtraNode:!0},{default:function(){return[s("button",C(C(C({},H(n,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),o),{},{id:(a=n.id)!==null&&a!==void 0?a:m.id.value,onKeydown:M,onClick:N,onBlur:I,onMouseup:O,type:"button",role:"switch","aria-checked":h.value,disabled:n.disabled||n.loading,class:[o.class,P.value],ref:i}),[s("div",{class:"".concat(u.value,"-handle")},[n.loading?s(L,{class:"".concat(u.value,"-loading-icon")},null):null]),s("span",{class:"".concat(u.value,"-inner")},[f.value?_(y,n,"checkedChildren"):_(y,n,"unCheckedChildren")])])]}})}}});const X=j(J);export{X as _};
import{ct as j,ay as z,d as K,j as U,df as $,w,r as b,G as S,m as A,u as D,o as E,az as G,h as d,c as s,a as C,aw as H,be as L,g as _,dg as W,P as c,dh as x}from"./index-411a6464.js";var R=z("small","default"),q=function(){return{id:String,prefixCls:String,size:c.oneOf(R),disabled:{type:Boolean,default:void 0},checkedChildren:c.any,unCheckedChildren:c.any,tabindex:c.oneOfType([c.string,c.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:c.oneOfType([c.string,c.number,c.looseBool]),checkedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!0),unCheckedValue:c.oneOfType([c.string,c.number,c.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function}},J=K({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:q(),slots:["checkedChildren","unCheckedChildren"],setup:function(n,r){var o=r.attrs,y=r.slots,B=r.expose,l=r.emit,m=U();$(function(){w(!("defaultChecked"in o),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),w(!("value"in o),"Switch","`value` is not validate prop, do you mean `checked`?")});var h=b(n.checked!==void 0?n.checked:o.defaultChecked),f=S(function(){return h.value===n.checkedValue});A(function(){return n.checked},function(){h.value=n.checked});var v=D("switch",n),u=v.prefixCls,F=v.direction,T=v.size,i=b(),g=function(){var e;(e=i.value)===null||e===void 0||e.focus()},V=function(){var e;(e=i.value)===null||e===void 0||e.blur()};B({focus:g,blur:V}),E(function(){G(function(){n.autofocus&&!n.disabled&&i.value.focus()})});var k=function(e,t){n.disabled||(l("update:checked",e),l("change",e,t),m.onFieldChange())},I=function(e){l("blur",e)},N=function(e){g();var t=f.value?n.unCheckedValue:n.checkedValue;k(t,e),l("click",t,e)},M=function(e){e.keyCode===x.LEFT?k(n.unCheckedValue,e):e.keyCode===x.RIGHT&&k(n.checkedValue,e),l("keydown",e)},O=function(e){var t;(t=i.value)===null||t===void 0||t.blur(),l("mouseup",e)},P=S(function(){var a;return a={},d(a,"".concat(u.value,"-small"),T.value==="small"),d(a,"".concat(u.value,"-loading"),n.loading),d(a,"".concat(u.value,"-checked"),f.value),d(a,"".concat(u.value,"-disabled"),n.disabled),d(a,u.value,!0),d(a,"".concat(u.value,"-rtl"),F.value==="rtl"),a});return function(){var a;return s(W,{insertExtraNode:!0},{default:function(){return[s("button",C(C(C({},H(n,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),o),{},{id:(a=n.id)!==null&&a!==void 0?a:m.id.value,onKeydown:M,onClick:N,onBlur:I,onMouseup:O,type:"button",role:"switch","aria-checked":h.value,disabled:n.disabled||n.loading,class:[o.class,P.value],ref:i}),[s("div",{class:"".concat(u.value,"-handle")},[n.loading?s(L,{class:"".concat(u.value,"-loading-icon")},null):null]),s("span",{class:"".concat(u.value,"-inner")},[f.value?_(y,n,"checkedChildren"):_(y,n,"unCheckedChildren")])])]}})}}});const X=j(J);export{X as _};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as x,a1 as $,aK as g,cG as b,r as w,U as p,V as i,W as a,c as r,a3 as d,X as u,Y as n,Z as B,a8 as I,a4 as m,y as V,z as _,B as v,aj as W,ak as D,cH as N,a0 as R}from"./index-66b6399d.js";/* empty css */const F={class:"container"},G={class:"actions"},K={class:"uni-desc"},L={class:"snapshot"},U=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(j){const h=$(),t=g(),f=e=>{h.tabList=V(e.tabs)},k=b(async e=>{await N(`workspace_snapshot_${e.id}`),t.snapshots=t.snapshots.filter(c=>c.id!==e.id),_.success(v("deleteSuccess"))}),o=w(""),y=async()=>{if(!o.value){_.error(v("nameRequired"));return}const e=t.createSnapshot(o.value);await t.addSnapshot(e),_.success(v("saveCompleted"))};return(e,c)=>{const C=W,l=D;return p(),i("div",F,[a("div",G,[r(C,{value:o.value,"onUpdate:value":c[0]||(c[0]=s=>o.value=s),placeholder:e.$t("name"),style:{"max-width":"300px"}},null,8,["value","placeholder"]),r(l,{type:"primary",onClick:y},{default:d(()=>[u(n(e.$t("saveWorkspaceSnapshot")),1)]),_:1})]),a("p",K,n(e.$t("WorkspaceSnapshotDesc")),1),a("ul",L,[(p(!0),i(B,null,I(m(t).snapshots,s=>(p(),i("li",{key:s.id},[a("div",null,[a("span",null,n(s.name),1)]),a("div",null,[r(l,{onClick:S=>f(s)},{default:d(()=>[u(n(e.$t("restore")),1)]),_:2},1032,["onClick"]),r(l,{onClick:S=>m(k)(s)},{default:d(()=>[u(n(e.$t("remove")),1)]),_:2},1032,["onClick"])])]))),128))])])}}});const A=R(U,[["__scopeId","data-v-2c44013c"]]);export{A as default};
import{d as x,a1 as $,aK as g,cG as b,r as w,U as p,V as i,W as a,c as r,a3 as d,X as u,Y as n,Z as B,a8 as I,a4 as m,y as V,z as _,B as v,aj as W,ak as D,cH as N,a0 as R}from"./index-411a6464.js";/* empty css */const F={class:"container"},G={class:"actions"},K={class:"uni-desc"},L={class:"snapshot"},U=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(j){const h=$(),t=g(),f=e=>{h.tabList=V(e.tabs)},k=b(async e=>{await N(`workspace_snapshot_${e.id}`),t.snapshots=t.snapshots.filter(c=>c.id!==e.id),_.success(v("deleteSuccess"))}),o=w(""),y=async()=>{if(!o.value){_.error(v("nameRequired"));return}const e=t.createSnapshot(o.value);await t.addSnapshot(e),_.success(v("saveCompleted"))};return(e,c)=>{const C=W,l=D;return p(),i("div",F,[a("div",G,[r(C,{value:o.value,"onUpdate:value":c[0]||(c[0]=s=>o.value=s),placeholder:e.$t("name"),style:{"max-width":"300px"}},null,8,["value","placeholder"]),r(l,{type:"primary",onClick:y},{default:d(()=>[u(n(e.$t("saveWorkspaceSnapshot")),1)]),_:1})]),a("p",K,n(e.$t("WorkspaceSnapshotDesc")),1),a("ul",L,[(p(!0),i(B,null,I(m(t).snapshots,s=>(p(),i("li",{key:s.id},[a("div",null,[a("span",null,n(s.name),1)]),a("div",null,[r(l,{onClick:S=>f(s)},{default:d(()=>[u(n(e.$t("restore")),1)]),_:2},1032,["onClick"]),r(l,{onClick:S=>m(k)(s)},{default:d(()=>[u(n(e.$t("remove")),1)]),_:2},1032,["onClick"])])]))),128))])])}}});const A=R(U,[["__scopeId","data-v-2c44013c"]]);export{A as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{d as Y,a1 as j,r as M,o as Z,U as v,V as T,c as s,a4 as e,W as k,a3 as n,X as g,Y as u,a5 as F,L as ee,a6 as te,af as le,ag as A,$ as R,a2 as se,cI as ie,z as $,cJ as ae,ak as oe,ai as ne,T as re,a0 as ce}from"./index-66b6399d.js";import{u as de,c as ue,a as me,F as pe,d as fe}from"./FileItem-09b081e1.js";import{a as ve,b as ke,c as ge,M as we,o as z,L as he,R as Ce,f as _e}from"./MultiSelectKeep-c3d6d976.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-f1eb3728.js";/* empty css */import"./_isIterateeCall-c55d2ac4.js";import"./index-66d21078.js";import"./shortcut-8ba6dd67.js";import"./Checkbox-c079cc59.js";import"./index-056afc6a.js";const Ie={class:"refresh-button"},Se={class:"hint"},be={key:0,class:"preview-switch"},ye=Y({__name:"randomImage",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(xe){const N=j(),m=M(!1),l=M([]),r=l,p=async()=>{try{m.value=!0;const i=await ie();i.length===0&&$.warn("No data, please generate index in image search page first"),l.value=i}finally{m.value=!1,C()}},w=()=>{if(l.value.length===0){$.warn("没有图片可以浏览");return}z(l.value,o.value||0)};Z(p);const{stackViewEl:B,multiSelectedIdxs:f,stack:P,scroller:U}=de({images:l}).toRefs(),{onClearAllSelected:D,onSelectAll:E,onReverseSelect:G}=ue();ve();const{itemSize:h,gridItems:K,cellWidth:L,onScroll:C}=me(),{showGenInfo:c,imageGenInfo:_,q:O,onContextMenuClick:W,onFileItemClick:q}=ke({openNext:ae}),{previewIdx:o,previewing:I,onPreviewVisibleChange:H,previewImgMove:S,canPreview:b}=ge(),y=async(i,t,d)=>{P.value=[{curr:"",files:l.value}],await W(i,t,d)};return(i,t)=>{var x;const d=oe,J=ne,Q=re;return v(),T("div",{class:"container",ref_key:"stackViewEl",ref:B},[s(we,{show:!!e(f).length||e(N).keepMultiSelect,onClearAllSelected:e(D),onSelectAll:e(E),onReverseSelect:e(G)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),k("div",Ie,[s(d,{onClick:p,onTouchstart:F(p,["prevent"]),type:"primary",loading:m.value,shape:"round"},{default:n(()=>[g(u(i.$t("shuffle")),1)]),_:1},8,["onTouchstart","loading"]),s(d,{onClick:w,onTouchstart:F(w,["prevent"]),type:"default",disabled:!((x=l.value)!=null&&x.length),shape:"round"},{default:n(()=>[g(u(i.$t("tiktokView")),1)]),_:1},8,["onTouchstart","disabled"])]),s(Q,{visible:e(c),"onUpdate:visible":t[1]||(t[1]=a=>te(c)?c.value=a:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=a=>c.value=!1)},{cancelText:n(()=>[]),default:n(()=>[s(J,{active:"",loading:!e(O).isIdle},{default:n(()=>[k("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[0]||(t[0]=a=>e(ee)(e(_)))},[k("div",Se,u(i.$t("doubleClickToCopy")),1),g(" "+u(e(_)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),s(e(fe),{ref_key:"scroller",ref:U,class:"file-list",items:l.value.slice(),"item-size":e(h).first,"key-field":"fullpath","item-secondary-size":e(h).second,gridItems:e(K),onScroll:e(C)},{default:n(({item:a,index:V})=>[s(pe,{idx:V,file:a,"cell-width":e(L),"full-screen-preview-image-url":e(r)[e(o)]?e(le)(e(r)[e(o)]):"",onContextMenuClick:y,onPreviewVisibleChange:e(H),"is-selected-mutil-files":e(f).length>1,selected:e(f).includes(V),onFileItemClick:e(q),onTiktokView:(Ve,X)=>e(z)(l.value,X)},null,8,["idx","file","cell-width","full-screen-preview-image-url","onPreviewVisibleChange","is-selected-mutil-files","selected","onFileItemClick","onTiktokView"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"]),e(I)?(v(),T("div",be,[s(e(he),{onClick:t[3]||(t[3]=a=>e(S)("prev")),class:A({disable:!e(b)("prev")})},null,8,["class"]),s(e(Ce),{onClick:t[4]||(t[4]=a=>e(S)("next")),class:A({disable:!e(b)("next")})},null,8,["class"])])):R("",!0),e(I)&&e(r)&&e(r)[e(o)]?(v(),se(_e,{key:1,file:e(r)[e(o)],idx:e(o),onContextMenuClick:y},null,8,["file","idx"])):R("",!0)],512)}}});const Ue=ce(ye,[["__scopeId","data-v-5b0001fc"]]);export{Ue as default};
import{d as Y,a1 as j,r as M,o as Z,U as v,V as T,c as s,a4 as e,W as k,a3 as n,X as g,Y as u,a5 as F,L as ee,a6 as te,af as le,ag as A,$ as R,a2 as se,cI as ie,z as $,cJ as ae,ak as oe,ai as ne,T as re,a0 as ce}from"./index-411a6464.js";import{u as de,c as ue,a as me,F as pe,d as fe}from"./FileItem-8a2b9b92.js";import{a as ve,b as ke,c as ge,M as we,o as z,L as he,R as Ce,f as _e}from"./MultiSelectKeep-4f3a6585.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-a6102596.js";/* empty css */import"./_isIterateeCall-bb47e76e.js";import"./index-c61f4123.js";import"./shortcut-0b043df4.js";import"./Checkbox-93a79203.js";import"./index-9122e675.js";const Ie={class:"refresh-button"},Se={class:"hint"},be={key:0,class:"preview-switch"},ye=Y({__name:"randomImage",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(xe){const N=j(),m=M(!1),l=M([]),r=l,p=async()=>{try{m.value=!0;const i=await ie();i.length===0&&$.warn("No data, please generate index in image search page first"),l.value=i}finally{m.value=!1,C()}},w=()=>{if(l.value.length===0){$.warn("没有图片可以浏览");return}z(l.value,o.value||0)};Z(p);const{stackViewEl:B,multiSelectedIdxs:f,stack:P,scroller:U}=de({images:l}).toRefs(),{onClearAllSelected:D,onSelectAll:E,onReverseSelect:G}=ue();ve();const{itemSize:h,gridItems:K,cellWidth:L,onScroll:C}=me(),{showGenInfo:c,imageGenInfo:_,q:O,onContextMenuClick:W,onFileItemClick:q}=ke({openNext:ae}),{previewIdx:o,previewing:I,onPreviewVisibleChange:H,previewImgMove:S,canPreview:b}=ge(),y=async(i,t,d)=>{P.value=[{curr:"",files:l.value}],await W(i,t,d)};return(i,t)=>{var x;const d=oe,J=ne,Q=re;return v(),T("div",{class:"container",ref_key:"stackViewEl",ref:B},[s(we,{show:!!e(f).length||e(N).keepMultiSelect,onClearAllSelected:e(D),onSelectAll:e(E),onReverseSelect:e(G)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),k("div",Ie,[s(d,{onClick:p,onTouchstart:F(p,["prevent"]),type:"primary",loading:m.value,shape:"round"},{default:n(()=>[g(u(i.$t("shuffle")),1)]),_:1},8,["onTouchstart","loading"]),s(d,{onClick:w,onTouchstart:F(w,["prevent"]),type:"default",disabled:!((x=l.value)!=null&&x.length),shape:"round"},{default:n(()=>[g(u(i.$t("tiktokView")),1)]),_:1},8,["onTouchstart","disabled"])]),s(Q,{visible:e(c),"onUpdate:visible":t[1]||(t[1]=a=>te(c)?c.value=a:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=a=>c.value=!1)},{cancelText:n(()=>[]),default:n(()=>[s(J,{active:"",loading:!e(O).isIdle},{default:n(()=>[k("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[0]||(t[0]=a=>e(ee)(e(_)))},[k("div",Se,u(i.$t("doubleClickToCopy")),1),g(" "+u(e(_)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),s(e(fe),{ref_key:"scroller",ref:U,class:"file-list",items:l.value.slice(),"item-size":e(h).first,"key-field":"fullpath","item-secondary-size":e(h).second,gridItems:e(K),onScroll:e(C)},{default:n(({item:a,index:V})=>[s(pe,{idx:V,file:a,"cell-width":e(L),"full-screen-preview-image-url":e(r)[e(o)]?e(le)(e(r)[e(o)]):"",onContextMenuClick:y,onPreviewVisibleChange:e(H),"is-selected-mutil-files":e(f).length>1,selected:e(f).includes(V),onFileItemClick:e(q),onTiktokView:(Ve,X)=>e(z)(l.value,X)},null,8,["idx","file","cell-width","full-screen-preview-image-url","onPreviewVisibleChange","is-selected-mutil-files","selected","onFileItemClick","onTiktokView"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"]),e(I)?(v(),T("div",be,[s(e(he),{onClick:t[3]||(t[3]=a=>e(S)("prev")),class:A({disable:!e(b)("prev")})},null,8,["class"]),s(e(Ce),{onClick:t[4]||(t[4]=a=>e(S)("next")),class:A({disable:!e(b)("next")})},null,8,["class"])])):R("",!0),e(I)&&e(r)&&e(r)[e(o)]?(v(),se(_e,{key:1,file:e(r)[e(o)],idx:e(o),onContextMenuClick:y},null,8,["file","idx"])):R("",!0)],512)}}});const Ue=ce(ye,[["__scopeId","data-v-5b0001fc"]]);export{Ue as default};

View File

@ -1 +1 @@
import{R as y,C as v}from"./index-caf74d0d.js";import{ct as f,c as d,A as P,d as w,U as o,V as c,W as r,Z as S,a8 as V,aG as O,a3 as R,X as u,Y as p,a4 as b,ak as $,a0 as x,R as H,J as _,K as m}from"./index-66b6399d.js";const A=f(y),E=f(v);var L={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"};const C=L;function h(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),n.forEach(function(i){N(t,i,s[i])})}return t}function N(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var l=function(e,s){var n=h({},e,s.attrs);return d(P,h({},n,{icon:C}),null)};l.displayName="PushpinFilled";l.inheritAttrs=!1;const z=l,F={class:"record-container"},k={style:{flex:"1"}},I={class:"rec-actions"},B=["onClick"],J=w({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=$;return o(),c("div",null,[r("ul",F,[(o(!0),c(S,null,V(e.records.getRecords(),i=>(o(),c("li",{key:i.id,class:"record"},[r("div",k,[O(e.$slots,"default",{record:i},void 0,!0)]),r("div",I,[d(n,{onClick:g=>e.$emit("reuseRecord",i),type:"primary"},{default:R(()=>[u(p(e.$t("restore")),1)]),_:2},1032,["onClick"]),r("div",{class:"pin",onClick:g=>e.records.switchPin(i)},[d(b(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const q=x(J,[["__scopeId","data-v-834a248f"]]);class a{constructor(e=128,s=[],n=[]){this.maxLength=e,this.records=s,this.pinnedValues=n}isPinned(e){return this.pinnedValues.some(s=>s.id===e.id)}add(e){this.records.length>=this.maxLength&&this.records.pop(),this.records.unshift({...e,id:H()+Date.now(),time:new Date().toLocaleString()})}pin(e){const s=this.records.findIndex(n=>n.id===e.id);s!==-1&&this.records.splice(s,1),this.pinnedValues.push(e)}unpin(e){const s=this.pinnedValues.findIndex(n=>n.id===e.id);s!==-1&&this.pinnedValues.splice(s,1),this.records.unshift(e)}switchPin(e){this.isPinned(e)?this.unpin(e):this.pin(e)}getRecords(){return[...this.pinnedValues,...this.records]}getPinnedValues(){return this.pinnedValues}}const G=_(`${m}fuzzy-search-HistoryRecord`,new a,{serializer:{read:t=>{const e=JSON.parse(t);return new a(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}}),M=_(`${m}tag-search-HistoryRecord`,new a,{serializer:{read:t=>{const e=JSON.parse(t);return new a(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}});export{q as H,E as _,A as a,G as f,M as t};
import{R as y,C as v}from"./index-8f4c024b.js";import{ct as f,c as d,A as P,d as w,U as o,V as c,W as r,Z as S,a8 as V,aG as O,a3 as R,X as u,Y as p,a4 as b,ak as $,a0 as x,R as H,J as _,K as m}from"./index-411a6464.js";const A=f(y),E=f(v);var L={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z"}}]},name:"pushpin",theme:"filled"};const C=L;function h(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),n.forEach(function(i){N(t,i,s[i])})}return t}function N(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var l=function(e,s){var n=h({},e,s.attrs);return d(P,h({},n,{icon:C}),null)};l.displayName="PushpinFilled";l.inheritAttrs=!1;const z=l,F={class:"record-container"},k={style:{flex:"1"}},I={class:"rec-actions"},B=["onClick"],J=w({__name:"HistoryRecord",props:{records:{}},emits:["reuseRecord"],setup(t){return(e,s)=>{const n=$;return o(),c("div",null,[r("ul",F,[(o(!0),c(S,null,V(e.records.getRecords(),i=>(o(),c("li",{key:i.id,class:"record"},[r("div",k,[O(e.$slots,"default",{record:i},void 0,!0)]),r("div",I,[d(n,{onClick:g=>e.$emit("reuseRecord",i),type:"primary"},{default:R(()=>[u(p(e.$t("restore")),1)]),_:2},1032,["onClick"]),r("div",{class:"pin",onClick:g=>e.records.switchPin(i)},[d(b(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const q=x(J,[["__scopeId","data-v-834a248f"]]);class a{constructor(e=128,s=[],n=[]){this.maxLength=e,this.records=s,this.pinnedValues=n}isPinned(e){return this.pinnedValues.some(s=>s.id===e.id)}add(e){this.records.length>=this.maxLength&&this.records.pop(),this.records.unshift({...e,id:H()+Date.now(),time:new Date().toLocaleString()})}pin(e){const s=this.records.findIndex(n=>n.id===e.id);s!==-1&&this.records.splice(s,1),this.pinnedValues.push(e)}unpin(e){const s=this.pinnedValues.findIndex(n=>n.id===e.id);s!==-1&&this.pinnedValues.splice(s,1),this.records.unshift(e)}switchPin(e){this.isPinned(e)?this.unpin(e):this.pin(e)}getRecords(){return[...this.pinnedValues,...this.records]}getPinnedValues(){return this.pinnedValues}}const G=_(`${m}fuzzy-search-HistoryRecord`,new a,{serializer:{read:t=>{const e=JSON.parse(t);return new a(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}}),M=_(`${m}tag-search-HistoryRecord`,new a,{serializer:{read:t=>{const e=JSON.parse(t);return new a(e.maxLength,e.records,e.pinnedValues)},write:JSON.stringify}});export{q as H,E as _,A as a,G as f,M as t};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
vue/dist/assets/stackView-8372dc19.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{u as G,g as d}from"./FileItem-09b081e1.js";import{r as b,t as j,cq as m,cr as y,cs as D}from"./index-66b6399d.js";const r=new Map,A=()=>{const{useEventListen:k,sortedFiles:s,getViewableAreaFiles:w}=G().toRefs(),c=b(d.defaultChangeIndchecked),u=b(d.defaultSeedChangeChecked),g=async()=>{if(await j(100),!c.value)return;const o=w.value().filter(e=>m(e.fullpath)&&!e.gen_info_obj);if(!o.length)return;const t=await y(o.map(e=>e.fullpath).filter(e=>!r.has(e)));o.forEach(e=>{const i=t[e.fullpath]||r.get(e.fullpath)||"";r.set(e.fullpath,i),e.gen_info_obj=D(i),e.gen_info_raw=i})};k.value("viewableAreaFilesChange",g);const F=o=>{const t=s.value;return[o,u.value,t[o-1],t[o],t[o+1]]};function I(o,t,e,i){const a={diff:{},empty:!0,ownFile:"",otherFile:""};if(t+e<0||t+e>=s.value.length||s.value[t]==null||!("gen_info_obj"in s.value[t])||!("gen_info_obj"in s.value[t+e]))return a;const l=o,f=s.value[t+e].gen_info_obj;if(f==null)return a;const h=["hashes","resources"];a.diff={},a.ownFile=i.name,a.otherFile=s.value[t+e].name,a.empty=!1,u.value||h.push("seed");for(const n in l)if(!h.includes(n)){if(!(n in f)){a.diff[n]="+";continue}if(l[n]!=f[n])if(n.includes("rompt")&&l[n]!=""&&f[n]!=""){const p=l[n].split(","),C=f[n].split(",");let _=0;for(const v in p)p[v]!=C[v]&&_++;a.diff[n]=_}else a.diff[n]=[l[n],f[n]]}return a}return{getGenDiff:I,changeIndchecked:c,seedChangeChecked:u,getRawGenParams:()=>g(),getGenDiffWatchDep:F}};export{A as u};
import{u as G,g as d}from"./FileItem-8a2b9b92.js";import{r as b,t as j,cq as m,cr as y,cs as D}from"./index-411a6464.js";const r=new Map,A=()=>{const{useEventListen:k,sortedFiles:s,getViewableAreaFiles:w}=G().toRefs(),c=b(d.defaultChangeIndchecked),u=b(d.defaultSeedChangeChecked),g=async()=>{if(await j(100),!c.value)return;const o=w.value().filter(e=>m(e.fullpath)&&!e.gen_info_obj);if(!o.length)return;const t=await y(o.map(e=>e.fullpath).filter(e=>!r.has(e)));o.forEach(e=>{const i=t[e.fullpath]||r.get(e.fullpath)||"";r.set(e.fullpath,i),e.gen_info_obj=D(i),e.gen_info_raw=i})};k.value("viewableAreaFilesChange",g);const F=o=>{const t=s.value;return[o,u.value,t[o-1],t[o],t[o+1]]};function I(o,t,e,i){const a={diff:{},empty:!0,ownFile:"",otherFile:""};if(t+e<0||t+e>=s.value.length||s.value[t]==null||!("gen_info_obj"in s.value[t])||!("gen_info_obj"in s.value[t+e]))return a;const l=o,f=s.value[t+e].gen_info_obj;if(f==null)return a;const h=["hashes","resources"];a.diff={},a.ownFile=i.name,a.otherFile=s.value[t+e].name,a.empty=!1,u.value||h.push("seed");for(const n in l)if(!h.includes(n)){if(!(n in f)){a.diff[n]="+";continue}if(l[n]!=f[n])if(n.includes("rompt")&&l[n]!=""&&f[n]!=""){const p=l[n].split(","),C=f[n].split(",");let _=0;for(const v in p)p[v]!=C[v]&&_++;a.diff[n]=_}else a.diff[n]=[l[n],f[n]]}return a}return{getGenDiff:I,changeIndchecked:c,seedChangeChecked:u,getRawGenParams:()=>g(),getGenDiffWatchDep:F}};export{A as u};

4
vue/dist/index.html vendored
View File

@ -7,8 +7,8 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Infinite Image Browsing</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-66b6399d.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-15ce0f1b.css">
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-411a6464.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-8b98f7af.css">
</head>
<body>

View File

@ -19,6 +19,8 @@ import { Top4MediaInfo } from '@/api'
import { watch } from 'vue'
import { debounce } from 'lodash-es'
import { closeImageFullscreenPreview } from '@/util/imagePreviewOperation'
const global = useGlobalStore()
const tagStore = useTagStore()
@ -93,6 +95,36 @@ const taggleLikeTag = () => {
}
const minShowDetailWidth = 160
//
const handleFileClick = (event: MouseEvent) => {
// magic switch
if (global.magicSwitchTiktokView && props.file.type === 'file' && isImageFile(props.file.name)) {
// TikTok
emit('tiktokView', props.file, props.idx)
setTimeout(() => {
closeImageFullscreenPreview()
}, 500);
} else {
//
emit('fileItemClick', event, props.file, props.idx)
}
}
//
const handleVideoClick = () => {
if (global.magicSwitchTiktokView) {
// TikTok
emit('tiktokView', props.file, props.idx)
} else {
//
openVideoModal(
props.file,
(id) => emit('contextMenuClick', { key: `toggle-tag-${id}` } as any, props.file, props.idx),
() => emit('tiktokView', props.file, props.idx)
)
}
}
</script>
<template>
<a-dropdown :trigger="['contextmenu']" :visible="!global.longPressOpenContextMenu ? undefined : typeof idx === 'number' && showMenuIdx === idx
@ -101,7 +133,7 @@ const minShowDetailWidth = 160
clickable: file.type === 'dir',
selected
}" :data-idx="idx" :key="file.name" draggable="true" @dragstart="emit('dragstart', $event, idx)"
@dragend="emit('dragend', $event, idx)" @click.capture="emit('fileItemClick', $event, file, idx)">
@dragend="emit('dragend', $event, idx)" @click.capture="handleFileClick($event)">
<div>
<div class="close-icon" v-if="enableCloseIcon" @click="emit('close-icon-click')">
@ -153,11 +185,7 @@ const minShowDetailWidth = 160
</div>
<div :class="`idx-${idx} item-content video`" :url="toVideoCoverUrl(file)"
:style="{ 'background-image': `url('${file.cover_url ?? toVideoCoverUrl(file)}')` }" v-else-if="isVideoFile(file.name)"
@click="openVideoModal(
file,
(id) => emit('contextMenuClick', { key: `toggle-tag-${id}` } as any, file, idx),
() => emit('tiktokView', file, idx)
)">
@click="handleVideoClick">
<div class="play-icon">
<img :src="play" style="width: 40px;height: 40px;">

View File

@ -129,5 +129,10 @@ export const de: Partial<IIBI18nMap> = {
'TikTok View': 'TikTok-Ansicht',
rebuildImageIndex: 'Bildindex neu erstellen',
tagSearchNoResultsMessage: 'Es scheint, als wären keine Ergebnisse gefunden worden. Versuchen Sie, den Index neu zu erstellen, um unbenutzte Tags zu entfernen?',
tiktokView: 'TikTok-Ansicht'
tiktokView: 'TikTok-Ansicht',
magicSwitchTiktokView: 'TikTok-Ansichtsmodus',
magicSwitchTiktokViewDesc: 'Wenn aktiviert, führt das Klicken auf Bild-/Videodateien direkt in den TikTok-Ansichtsmodus',
magicSwitchEnabled: '🎬 EIN - Klicken Sie auf Mediendateien, um die TikTok-Ansicht zu öffnen',
magicSwitchDisabled: '📁 AUS - Klicken Sie auf Mediendateien, um sie normal zu öffnen',
magicSwitchDetailDesc: 'Klicken Sie auf Bilder und Videos, um direkt in die TikTok-ähnliche Browsing-Erfahrung einzusteigen'
}

View File

@ -319,5 +319,30 @@ You can specify which snapshot to restore to when starting IIB in the global set
rebuildComplete: 'Rebuild complete',
tagSearchNoResultsMessage: 'It looks like no results were matched, try rebuilding the index to remove useless tags?',
'TikTok View': 'TikTok View',
tiktokView: 'TikTok View'
tiktokView: 'TikTok View',
magicSwitchTiktokView: 'TikTok View Mode',
magicSwitchTiktokViewDesc: 'When enabled, clicking image/video files will directly enter TikTok-style viewing mode',
magicSwitchEnabled: '🎬 ON - Click media files to enter TikTok View',
magicSwitchDisabled: '📁 OFF - Click media files to open normally',
magicSwitchDetailDesc: 'Click images and videos to directly enter TikTok-style browsing experience',
// Auto play related
autoPlay: 'Auto Play',
autoPlayOff: 'Off',
autoPlay5s: '5s',
autoPlay10s: '10s',
autoPlay20s: '20s',
autoPlayTooltip: 'Auto Play: {mode} (A to toggle)',
autoPlayStatus: 'Auto Play: {mode}',
// TikTok viewer controls
exitFullscreen: 'Exit Fullscreen',
fullscreen: 'Fullscreen',
soundOn: 'Sound On',
soundOff: 'Sound Off',
like: 'Like',
unlike: 'Unlike',
tags: 'Tags',
tag: 'Tag',
tagOperationFailed: 'Tag operation failed'
}

View File

@ -298,5 +298,30 @@ export const zhHans = {
rebuildImageIndex: '重新构建图像索引',
tagSearchNoResultsMessage: '看起来没匹配到任何结果尝试通过重新构建索引来去掉无用的tag',
'TikTok View': '抖音式浏览',
tiktokView: '抖音式浏览'
tiktokView: '抖音式浏览',
magicSwitchTiktokView: 'TikTok 观看模式',
magicSwitchTiktokViewDesc: '开启后,点击图片/视频文件将直接进入TikTok式观看模式',
magicSwitchEnabled: '🎬 开启 - 点击媒体文件直接进入 TikTok 观看',
magicSwitchDisabled: '📁 关闭 - 点击媒体文件正常打开',
magicSwitchDetailDesc: '点击图片和视频文件时直接进入 TikTok 式浏览体验',
// 自动轮播相关
autoPlay: '自动轮播',
autoPlayOff: '关闭',
autoPlay5s: '5秒',
autoPlay10s: '10秒',
autoPlay20s: '20秒',
autoPlayTooltip: '自动轮播: {mode} (A键切换)',
autoPlayStatus: '自动轮播:{mode}',
// TikTok 查看器控制
exitFullscreen: '退出全屏',
fullscreen: '全屏',
soundOn: '开启声音',
soundOff: '关闭声音',
like: '喜欢',
unlike: '取消喜欢',
tags: '标签',
tag: '标签',
tagOperationFailed: '标签操作失败'
}

View File

@ -303,5 +303,30 @@ export const zhHant: Partial<IIBI18nMap> = {
rebuildComplete: '重新構建完成',
tagSearchNoResultsMessage: '看起來沒有匹配到任何結果,嘗試通過重新構建索引來去除無用的標籤?',
'TikTok View': '抖音式瀏覽',
tiktokView: '抖音式觀看'
tiktokView: '抖音式觀看',
magicSwitchTiktokView: 'TikTok 觀看模式',
magicSwitchTiktokViewDesc: '開啟後,點擊圖片/視頻文件將直接進入TikTok式觀看模式',
magicSwitchEnabled: '🎬 開啟 - 點擊媒體文件直接進入 TikTok 觀看',
magicSwitchDisabled: '📁 關閉 - 點擊媒體文件正常打開',
magicSwitchDetailDesc: '點擊圖片和視頻文件時直接進入 TikTok 式瀏覽體驗',
// 自動輪播相關
autoPlay: '自動輪播',
autoPlayOff: '關閉',
autoPlay5s: '5秒',
autoPlay10s: '10秒',
autoPlay20s: '20秒',
autoPlayTooltip: '自動輪播: {mode} (A鍵切換)',
autoPlayStatus: '自動輪播:{mode}',
// TikTok 查看器控制
exitFullscreen: '退出全螢幕',
fullscreen: '全螢幕',
soundOn: '開啟聲音',
soundOff: '關閉聲音',
like: '喜歡',
unlike: '取消喜歡',
tags: '標籤',
tag: '標籤',
tagOperationFailed: '標籤操作失敗'
}

View File

@ -18,7 +18,8 @@ import {
SoundOutlined,
SoundFilled,
HeartOutlined,
HeartFilled
HeartFilled,
PlayCircleOutlined
} from '@/icon'
import { t } from '@/i18n'
import type { StyleValue } from 'vue'
@ -32,6 +33,30 @@ const global = useGlobalStore()
// 使 @vueuse
const isMuted = useLocalStorage('tiktok-viewer-muted', true) //
//
type AutoPlayMode = 'off' | '5s' | '10s' | '20s'
const autoPlayMode = ref('off' as AutoPlayMode) // useLocalStorage<AutoPlayMode>('iib://tiktok-viewer-autoplay', 'off')
const autoPlayTimer = ref<number | null>(null)
//
const autoPlayOptions: AutoPlayMode[] = ['off', '5s', '10s', '20s']
const autoPlayLabels = computed(() => ({
off: t('autoPlayOff'),
'5s': t('autoPlay5s'),
'10s': t('autoPlay10s'),
'20s': t('autoPlay20s')
}))
//
const getAutoPlayDelay = (mode: AutoPlayMode): number => {
switch (mode) {
case '5s': return 5000
case '10s': return 10000
case '20s': return 20000
default: return 0
}
}
//
const isMac = computed(() => {
return /Mac|iPhone|iPad|iPod/.test(navigator.userAgent) ||
@ -84,6 +109,56 @@ const getItemStyle = (index: number): StyleValue => {
}
}
//
const clearAutoPlayTimer = () => {
if (autoPlayTimer.value) {
clearTimeout(autoPlayTimer.value)
autoPlayTimer.value = null
}
}
//
const startAutoPlayTimer = () => {
clearAutoPlayTimer()
if (autoPlayMode.value === 'off') return
const currentItem = bufferItems.value[1]
if (!currentItem) return
//
if (isVideoFile(currentItem.url)) return
const delay = getAutoPlayDelay(autoPlayMode.value)
if (delay > 0) {
autoPlayTimer.value = window.setTimeout(() => {
if (!isAnimating.value && !isDragging.value) {
if (tiktokStore.hasNext) {
goToNext()
} else {
//
goToFirst()
}
}
}, delay)
}
}
//
const handleVideoEnded = (index: number) => {
// index === 1
if (index === 1 && autoPlayMode.value !== 'off' && !isAnimating.value) {
setTimeout(() => {
if (tiktokStore.hasNext) {
goToNext()
} else {
//
goToFirst()
}
}, 500) // 500ms
}
}
//
const controlVideoPlayback = async () => {
await delay(30)
@ -96,11 +171,16 @@ const controlVideoPlayback = async () => {
//
video.currentTime = 0 //
video.muted = isMuted.value //
//
video.onended = () => handleVideoEnded(index)
await video.play()
} else {
//
video.pause()
video.currentTime = 0
video.onended = null //
}
} catch (err) {
console.warn(`视频播放控制失败 (index: ${index}):`, err)
@ -122,6 +202,7 @@ const updateBuffer = () => {
// DOM
nextTick(() => {
controlVideoPlayback()
startAutoPlayTimer() //
})
}
@ -161,13 +242,13 @@ const onTagClick = async (tagId: string | number) => {
img_path: fullpath
})
const tag = global.conf?.all_custom_tags.find((v) => v.id === tagId)?.name || '标签'
const tag = global.conf?.all_custom_tags.find((v) => v.id === tagId)?.name || t('tag')
await tagStore.refreshTags([fullpath])
message.success(t(is_remove ? 'removedTagFromImage' : 'addedTagToImage', { tag }))
} catch (error) {
console.error('Toggle tag error:', error)
message.error('标签操作失败')
message.error(t('tagOperationFailed'))
}
}
@ -183,10 +264,25 @@ const tagBaseStyle: StyleValue = {
fontSize: '14px'
}
//
const toggleAutoPlay = () => {
const currentIndex = autoPlayOptions.indexOf(autoPlayMode.value)
const nextIndex = (currentIndex + 1) % autoPlayOptions.length
autoPlayMode.value = autoPlayOptions[nextIndex]
//
startAutoPlayTimer()
message.success(t('autoPlayStatus', { mode: autoPlayLabels.value[autoPlayMode.value] }))
}
//
const goToPrev = (isTriggerByTouch: boolean = false) => {
if (isAnimating.value || !tiktokStore.hasPrev) return
//
clearAutoPlayTimer()
isAnimating.value = true
//
@ -210,6 +306,9 @@ const goToPrev = (isTriggerByTouch: boolean = false) => {
const goToNext = (isTriggerByTouch: boolean = false) => {
if (isAnimating.value || !tiktokStore.hasNext) return
//
clearAutoPlayTimer()
isAnimating.value = true
//
@ -229,11 +328,39 @@ const goToNext = (isTriggerByTouch: boolean = false) => {
}, 200) //
}
//
const goToFirst = (isTriggerByTouch: boolean = false) => {
if (isAnimating.value) return
//
clearAutoPlayTimer()
isAnimating.value = true
//
dragOffset.value = 0
bufferTransform.value = 100 //
setTimeout(() => {
//
tiktokStore.currentIndex = 0
updateBuffer()
bufferTransform.value = 0
setTimeout(() => {
isAnimating.value = false
}, getAnimationDelay(isTriggerByTouch))
}, 200) //
}
//
const handleTouchStart = (e: TouchEvent) => {
if (isAnimating.value) return
//
clearAutoPlayTimer()
touchStartY.value = e.touches[0].clientY
touchCurrentY.value = e.touches[0].clientY
isDragging.value = true
@ -314,6 +441,8 @@ const resetToCenter = () => {
setTimeout(() => {
isAnimating.value = false
//
startAutoPlayTimer()
}, 300) // CSS
}
@ -343,6 +472,9 @@ const handleWheel = throttle((e: WheelEvent) => {
e.preventDefault()
//
clearAutoPlayTimer()
if (e.deltaY > 0 && tiktokStore.hasNext) {
goToNext()
} else if (e.deltaY < 0 && tiktokStore.hasPrev) {
@ -377,6 +509,11 @@ const handleKeydown = (e: KeyboardEvent) => {
e.preventDefault()
if (likeTag.value) toggleLike()
break
case 'a':
case 'A':
e.preventDefault()
toggleAutoPlay()
break
}
}
@ -452,6 +589,7 @@ watch(() => tiktokStore.visible ===false || tiktokStore.mediaList.length === 0,
videoPreloadList.value.forEach(recVideo)
videoPreloadList.value = []
autoPlayMode.value = 'off' //
}, { immediate: true })
//
const preloadMedia = () => {
@ -493,6 +631,9 @@ onUnmounted(() => {
document.removeEventListener('keydown', handleKeydown)
document.removeEventListener('fullscreenchange', handleFullscreenChange)
//
clearAutoPlayTimer()
//
videoRefs.value.forEach(video => {
recVideo(video!)
@ -523,6 +664,9 @@ watch(() => tiktokStore.visible, (visible) => {
}
})
//
clearAutoPlayTimer()
// 退
if (document.fullscreenElement) {
exitFullscreen()
@ -543,6 +687,11 @@ watch(() => isMuted.value, (muted) => {
}
})
})
//
watch(() => autoPlayMode.value, () => {
startAutoPlayTimer()
})
</script>
<template>
@ -576,7 +725,7 @@ watch(() => isMuted.value, (muted) => {
class="tiktok-media"
:src="item.url"
:controls="index === 1"
:loop="index === 1"
:loop="index === 1 && autoPlayMode === 'off'"
playsinline
preload="metadata"
:key="item.url"
@ -618,7 +767,7 @@ watch(() => isMuted.value, (muted) => {
<button
class="control-btn sound-btn"
@click="toggleMute"
:title="isMuted ? '开启声音' : '关闭声音'"
:title="isMuted ? $t('soundOn') : $t('soundOff')"
>
<SoundFilled v-if="!isMuted" />
<SoundOutlined v-else />
@ -630,12 +779,23 @@ watch(() => isMuted.value, (muted) => {
class="control-btn like-btn"
:class="{ 'like-active': isLiked }"
@click="toggleLike"
:title="isLiked ? '取消喜欢' : '喜欢'"
:title="isLiked ? $t('unlike') : $t('like')"
>
<HeartFilled v-if="isLiked" />
<HeartOutlined v-else />
</button>
<!-- 自动轮播按钮 -->
<button
class="control-btn autoplay-btn"
:class="{ 'autoplay-active': autoPlayMode !== 'off' }"
@click="toggleAutoPlay"
:title="$t('autoPlayTooltip', { mode: autoPlayLabels[autoPlayMode] })"
>
<PlayCircleOutlined />
<span class="autoplay-label">{{ autoPlayLabels[autoPlayMode] }}</span>
</button>
<!-- TAG 按钮 -->
<button
class="control-btn tags-btn"
@ -801,8 +961,8 @@ watch(() => isMuted.value, (muted) => {
}
.control-btn {
width: 48px;
height: 48px;
width: 44px;
height: 44px;
border: none;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
@ -811,7 +971,7 @@ watch(() => isMuted.value, (muted) => {
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
font-size: 18px;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
@ -839,11 +999,56 @@ watch(() => isMuted.value, (muted) => {
color: #ff69b4; //
}
}
&.autoplay-btn {
width: 48px;
height: 48px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
.autoplay-label {
position: absolute;
bottom: -2px;
right: -2px;
font-size: 10px;
font-weight: bold;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 2px 4px;
border-radius: 8px;
line-height: 1;
min-width: 20px;
text-align: center;
backdrop-filter: blur(5px);
}
&.autoplay-active {
background: rgba(76, 175, 80, 0.3); // 绿
color: #4caf50; // 绿
.autoplay-label {
background: rgba(76, 175, 80, 0.9);
color: white;
}
&:hover {
background: rgba(76, 175, 80, 0.5);
transform: scale(1.1);
}
}
&:not(.autoplay-active):hover {
color: #81c784; // 绿
}
}
}
.tiktok-navigation {
position: absolute;
right: 20px;
right: 90px;
top: 50%;
transform: translateY(-50%);
display: flex;
@ -983,10 +1188,22 @@ watch(() => isMuted.value, (muted) => {
width: 44px;
height: 44px;
font-size: 18px;
&.autoplay-btn {
width: 44px;
height: 44px;
.autoplay-label {
font-size: 8px;
padding: 1px 3px;
border-radius: 6px;
min-width: 16px;
}
}
}
.tiktok-navigation {
right: 15px;
right: 80px;
}
.nav-indicator {

View File

@ -153,7 +153,33 @@ const modes = computed(() => {
<template>
<div class="container">
<div class="header">
<h1>{{ $t('welcome') }}</h1>
<div class="header-left">
<h1>{{ $t('welcome') }}</h1>
<!-- Compact Magic Switch with Welcome -->
<div class="magic-switch-compact">
<a-tooltip>
<template #title>
<div class="switch-tooltip">
<div class="tooltip-title">{{ $t('magicSwitchTiktokView') }}</div>
<div class="tooltip-status">{{ global.magicSwitchTiktokView ? $t('magicSwitchEnabled') : $t('magicSwitchDisabled') }}</div>
<div class="tooltip-desc">{{ $t('magicSwitchDetailDesc') }}</div>
</div>
</template>
<div class="ultra-cool-switch" :class="{ active: global.magicSwitchTiktokView }" @click="global.magicSwitchTiktokView = !global.magicSwitchTiktokView">
<div class="switch-bg">
<div class="switch-track"></div>
<div class="switch-thumb" :class="{ active: global.magicSwitchTiktokView }">
<span class="switch-icon">{{ global.magicSwitchTiktokView ? '🎬' : '📁' }}</span>
</div>
<div class="switch-glow"></div>
</div>
<span class="switch-label">TikTok 视图</span>
</div>
</a-tooltip>
</div>
</div>
<div v-if="global.conf?.enable_access_control && global.dontShowAgain"
style="margin-left: 16px;font-size: 1.5em;">
<LockOutlined title="Access Control mode" style="vertical-align: text-bottom;" />
@ -237,7 +263,7 @@ const modes = computed(() => {
<div class="feature-item" v-if="global.quickMovePaths.length">
<h2>{{ $t('launchFromNormalAndFixed') }}</h2>
<ul>
<li @click="addToExtraPath('scanned')" class="item">
<li @click="addToExtraPath('scanned-fixed')" class="item">
<span class="text line-clamp-1">
<PlusOutlined /> {{ $t('add') }}
</span>
@ -299,6 +325,7 @@ const modes = computed(() => {
</ul>
</div>
</div>
<div class="ver-info" @dblclick="message.info('Ciallo(∠・ω< )⌒☆')">
<div v-if="modes">
Mode: {{ modes }}
@ -315,7 +342,6 @@ const modes = computed(() => {
<div v-if="latestCommit">
Latest Commit: {{ latestCommit.sha }} (Updated at {{ latestCommit.commit.author?.date }})
</div>
</div>
</div>
</template>
@ -466,4 +492,214 @@ const modes = computed(() => {
flex-wrap: wrap;
font-size: 0.9em;
}
/* Compact Magic Switch Styles */
.header-left {
display: flex;
align-items: center;
gap: 16px;
}
.magic-switch-compact {
flex-shrink: 0;
}
.ultra-cool-switch {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
background: var(--zp-primary-background);
border: 1px solid transparent;
border-radius: 25px;
cursor: pointer;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 12px;
white-space: nowrap;
position: relative;
overflow: hidden;
&::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.5s;
}
&:hover {
background: var(--zp-secondary-background);
border-color: var(--primary-color);
transform: translateY(-2px) scale(1.02);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
&::before {
left: 100%;
}
}
&.active {
background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 50%, #ff4757 100%);
border-color: #ff8c42;
color: white;
box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4), 0 4px 15px rgba(255, 140, 66, 0.3);
&::before {
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}
.switch-label {
color: white;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
}
}
.switch-bg {
position: relative;
width: 44px;
height: 22px;
border-radius: 11px;
overflow: hidden;
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.switch-track {
position: absolute;
top: 1px;
left: 1px;
width: 42px;
height: 20px;
background: linear-gradient(45deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.08));
border-radius: 10px;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.ultra-cool-switch.active .switch-track {
background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
box-shadow: 0 0 10px rgba(255, 140, 66, 0.5);
}
.switch-thumb {
position: absolute;
top: 1px;
left: 1px;
width: 20px;
height: 20px;
background: linear-gradient(145deg, #ffffff, #f0f0f0);
border-radius: 50%;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
&.active {
transform: translateX(22px) rotate(360deg);
background: linear-gradient(145deg, #fff, #ffeaa6);
box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4), 0 2px 6px rgba(255, 107, 53, 0.3);
}
}
.switch-icon {
font-size: 10px;
transition: all 0.3s ease;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.switch-label {
color: var(--zp-primary);
font-weight: 600;
transition: all 0.3s ease;
letter-spacing: 0.5px;
}
.switch-glow {
position: absolute;
top: -1px;
left: -1px;
width: calc(100% + 2px);
height: calc(100% + 2px);
background: linear-gradient(45deg, transparent, rgba(255, 140, 66, 0.2), transparent);
border-radius: 12px;
opacity: 0;
transition: all 0.4s ease;
}
.ultra-cool-switch.active .switch-glow {
opacity: 1;
animation: glowPulse 2s ease-in-out infinite;
}
@keyframes glowPulse {
0%, 100% {
opacity: 0.3;
transform: scale(1);
}
50% {
opacity: 0.6;
transform: scale(1.05);
}
}
.switch-tooltip {
max-width: 240px;
line-height: 1.5;
}
.tooltip-title {
font-weight: 600;
margin-bottom: 4px;
color: var(--primary-color);
}
.tooltip-status {
margin-bottom: 6px;
font-size: 13px;
}
.tooltip-desc {
font-size: 12px;
opacity: 0.8;
line-height: 1.4;
}
@media (max-width: 768px) {
.header-left {
gap: 12px;
}
.ultra-cool-switch {
padding: 6px 10px;
gap: 8px;
font-size: 11px;
}
.switch-bg {
width: 36px;
height: 18px;
}
.switch-track {
width: 34px;
height: 16px;
}
.switch-thumb {
width: 16px;
height: 16px;
&.active {
transform: translateX(18px) rotate(360deg);
}
}
.switch-icon {
font-size: 8px;
}
}
</style>

View File

@ -311,7 +311,7 @@ export function useLocation () {
key: Date.now() + uniqueId(),
popAddPathModal: {
path: currLocation.value,
type: 'scanned'
type: 'scanned-fixed'
}
}
tab.panes.push(pane)

View File

@ -190,7 +190,8 @@ export const presistKeys = [
'autoRefreshNormalFixedMode',
'showCommaInInfoPanel',
'batchDownloadCompress',
'batchDownloadPackOnly'
'batchDownloadPackOnly',
'magicSwitchTiktokView'
]
function cellWidthMap(x: number): number {
@ -341,6 +342,7 @@ export const useGlobalStore = defineStore(
}
}
const previewBgOpacity = ref(0.6)
const magicSwitchTiktokView = ref(false)
return {
computedTheme,
darkModeControl,
@ -379,7 +381,8 @@ export const useGlobalStore = defineStore(
autoRefreshNormalFixedMode: ref(true),
showCommaInInfoPanel: ref(false),
batchDownloadCompress: ref(false),
batchDownloadPackOnly: ref(false)
batchDownloadPackOnly: ref(false),
magicSwitchTiktokView
}
},
{

View File

@ -12,7 +12,7 @@ let lastState: LayoutConf | null = null
export const useFullscreenLayout = () => {
const g = useGlobalStore()
// 只存储和提供给state的值
const storageState = useLocalStorage(prefix + 'fullscreen_layout', { enable: false, panelWidth: 384, alwaysOn: true })
const storageState = useLocalStorage(prefix + 'fullscreen_layout', { enable: true, panelWidth: 384, alwaysOn: true })
const state = reactive<LayoutConf>(lastState ?? g.conf?.app_fe_setting?.fullscreen_layout ?? cloneDeep(storageState.value))
const panelwidtrhStyleVarName = '--iib-lr-layout-info-panel-width'