add support for full-screen preview and context menu in image search.

pull/66/head
zanllp 2023-05-02 21:04:27 +08:00
parent 25582f027d
commit 9507316b89
34 changed files with 116 additions and 97 deletions

View File

@ -8,7 +8,7 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-8a9c3393.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-9cc5a0e4.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-19e73083.css">
</head>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{d as E,r as S,aW as L,x as H,o as c,l as T,c as a,m as o,n as e,p as V,q as z,t as F,A as Q,y as A,I as f,H as R,aL as j,K,O as W}from"./index-9cc5a0e4.js";import{u as J,b as X,f as Y,c as Z,d as ee,e as se,h as le,j as te,k as ie,t as ae,L as ne,R as oe,l as re,S as ce}from"./fullScreenContextMenu-083c9ced.js";import{g as de,M as ue}from"./db-81af9a8b.js";import"./index-235fc08e.js";import"./_baseIteratee-2a992630.js";import"./button-8e78b0cf.js";const me={class:"hint"},pe={key:1,class:"preview-switch"},ve=E({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup($){const d=$,l=S(),k=L();H(()=>d.selectedTagIds,async()=>{var s;const{res:i}=k.pushAction(()=>de(d.selectedTagIds));l.value=await i,(s=u.value)==null||s.scrollToItem(0)},{immediate:!0});const u=S(),g={tabIdx:-1,target:"local",paneIdx:-1,walkMode:!1},{stackViewEl:B,multiSelectedIdxs:I,stack:G}=J().toRefs(),{itemSize:w,gridItems:N}=X(g),{showMenuIdx:m}=Y();Z();const{showGenInfo:r,imageGenInfo:x,q:O,onContextMenuClick:P,onFileItemClick:U}=ee(g,{openNext:j}),{previewIdx:n,previewing:C,onPreviewVisibleChange:q,previewImgMove:b,canPreview:_}=se(d,{scroller:u,files:l}),y=async(i,s,p)=>{G.value=[{curr:"",files:l.value}];const v=I.value;await P(i,s,p),i.key==="deleteFiles"&&(l.value=l.value.filter((h,t)=>!v.includes(t)))};return(i,s)=>{const p=K,v=ue,h=ce;return c(),T("div",{class:"container",ref_key:"stackViewEl",ref:B},[a(h,{size:"large",spinning:!e(k).isIdle},{default:o(()=>[a(v,{visible:e(r),"onUpdate:visible":s[1]||(s[1]=t=>V(r)?r.value=t:null),width:"70vw","mask-closable":"",onOk:s[2]||(s[2]=t=>r.value=!1)},{cancelText:o(()=>[]),default:o(()=>[a(p,{active:"",loading:!e(O).isIdle},{default:o(()=>[z("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:s[0]||(s[0]=t=>e(le)(e(x),"copied"))},[z("div",me,F(i.$t("doubleClickToCopy")),1),Q(" "+F(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l.value?(c(),A(e(te),{key:0,ref_key:"scroller",ref:u,class:"file-list",items:l.value,"item-size":e(w).first,"key-field":"fullpath","item-secondary-size":e(w).second,gridItems:e(N)},{default:o(({item:t,index:M})=>[a(ie,{idx:M,file:t,"show-menu-idx":e(m),"onUpdate:showMenuIdx":s[3]||(s[3]=D=>V(m)?m.value=D:null),onFileItemClick:e(U),"full-screen-preview-image-url":l.value[e(n)]?e(ae)(l.value[e(n)]):"",selected:e(I).includes(M),onContextMenuClick:y,onPreviewVisibleChange:e(q)},null,8,["idx","file","show-menu-idx","onFileItemClick","full-screen-preview-image-url","selected","onPreviewVisibleChange"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])):f("",!0),e(C)?(c(),T("div",pe,[a(e(ne),{onClick:s[4]||(s[4]=t=>e(b)("prev")),class:R({disable:!e(_)("prev")})},null,8,["class"]),a(e(oe),{onClick:s[5]||(s[5]=t=>e(b)("next")),class:R({disable:!e(_)("next")})},null,8,["class"])])):f("",!0)]),_:1},8,["spinning"]),e(C)&&l.value&&l.value[e(n)]?(c(),A(re,{key:0,file:l.value[e(n)],idx:e(n),onContextMenuClick:y},null,8,["file","idx"])):f("",!0)],512)}}});const Ce=W(ve,[["__scopeId","data-v-2be2bafb"]]);export{Ce as default};

View File

@ -0,0 +1 @@
.preview-switch[data-v-2be2bafb]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-2be2bafb]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-2be2bafb]{opacity:0;pointer-events:none;cursor:none}.container[data-v-2be2bafb]{background:var(--zp-secondary-background)}.container .file-list[data-v-2be2bafb]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%}

View File

@ -1 +0,0 @@
import{d as A,r as k,C as G,y as B,o as F,l as N,c as l,m as o,n as s,p as x,q as w,t as y,J as R,aQ as U,a0 as $,V as q}from"./index-8a9c3393.js";import{u as D,e as E,i as Q,g as O,c as H,l as J,m as j,t as K,S as L}from"./FileItem-245900ce.js";import{a as P,M as W}from"./db-260d1be5.js";import"./index-072fd5b2.js";import"./_baseIteratee-75bdf25b.js";import"./button-c8ca57b0.js";const X={class:"hint"},Y=A({__name:"MatchedImageGrid",props:{tabIdx:null,paneIdx:null,selectedTagIds:null,id:null},setup(b){const u=b,n=k(),m=G();B(()=>u.selectedTagIds,async()=>{var e;const{res:a}=m.pushAction(()=>P(u.selectedTagIds));n.value=await a,(e=p.value)==null||e.scrollToItem(0)},{immediate:!0});const p=k(),f={tabIdx:-1,target:"local",paneIdx:-1},{stackViewEl:h,multiSelectedIdxs:v}=D().toRefs(),{itemSize:g,gridItems:M}=E(f),{showMenuIdx:d}=Q(),{showGenInfo:c,imageGenInfo:I,q:C,onContextMenuClick:S}=O(f,{openNext:U}),T=async(a,e,i)=>{if(await S(a,e,i),a.key==="deleteFiles"){const r=v.value.includes(i)?v.value:[i];n.value=n.value.filter((_,t)=>!r.includes(t))}};return(a,e)=>{const i=$,r=W,_=L;return F(),N("div",{class:"container",ref_key:"stackViewEl",ref:h},[l(_,{size:"large",spinning:!s(m).isIdle},{default:o(()=>[l(r,{visible:s(c),"onUpdate:visible":e[1]||(e[1]=t=>x(c)?c.value=t:null),width:"70vw","mask-closable":"",onOk:e[2]||(e[2]=t=>c.value=!1)},{cancelText:o(()=>[]),default:o(()=>[l(i,{active:"",loading:!s(C).isIdle},{default:o(()=>[w("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:e[0]||(e[0]=t=>s(H)(s(I),"copied"))},[w("div",X,y(a.$t("doubleClickToCopy")),1),R(" "+y(s(I)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),l(s(J),{ref_key:"scroller",ref:p,class:"file-list",items:n.value||[],"item-size":s(g).first,"key-field":"fullpath","item-secondary-size":s(g).second,gridItems:s(M)},{default:o(({item:t,index:z})=>[l(j,{idx:z,file:t,"show-menu-idx":s(d),"onUpdate:showMenuIdx":e[3]||(e[3]=V=>x(d)?d.value=V:null),"full-screen-preview-image-url":s(K)(t),onContextMenuClick:T},null,8,["idx","file","show-menu-idx","full-screen-preview-image-url"])]),_:1},8,["items","item-size","item-secondary-size","gridItems"])]),_:1},8,["spinning"])],512)}}});const le=q(Y,[["__scopeId","data-v-c3a6ecb6"]]);export{le as default};

View File

@ -1 +0,0 @@
.container[data-v-c3a6ecb6]{background:var(--zp-secondary-background)}.container .file-list[data-v-c3a6ecb6]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%}

View File

@ -1 +0,0 @@
import{at as J,as as K,c0 as Y,bP as W,d as X,z as Z,C as ee,B as N,r as $,a2 as ae,v as te,o as c,l as g,N as b,s as B,q as S,c as C,n as d,Y as se,I as T,m as O,J as I,t as _,K as V,O as ne,c4 as oe,Q as z,b7 as re,c5 as le,bp as D,L as P,V as ie}from"./index-8a9c3393.js";import{I as ue,_ as ce}from"./index-e1fa1836.js";import"./index-6dfc4e18.js";import{c as E,u as de,e as pe,M as me,r as ge}from"./db-260d1be5.js";import{b as ve}from"./_baseIteratee-75bdf25b.js";import{B as F}from"./button-c8ca57b0.js";function fe(s,n,t,l){for(var u=-1,a=s==null?0:s.length;++u<a;){var o=s[u];n(l,o,t(o),s)}return l}function _e(s){return function(n,t,l){for(var u=-1,a=Object(n),o=l(n),v=o.length;v--;){var k=o[s?v:++u];if(t(a[k],k,a)===!1)break}return n}}var ye=_e();const he=ye;function be(s,n){return s&&he(s,n,J)}function ke(s,n){return function(t,l){if(t==null)return t;if(!K(t))return s(t,l);for(var u=t.length,a=n?u:-1,o=Object(t);(n?a--:++a<u)&&l(o[a],a,o)!==!1;);return t}}var Ce=ke(be);const Ie=Ce;function we(s,n,t,l){return Ie(s,function(u,a,o){n(l,u,t(u),o)}),l}function xe(s,n){return function(t,l){var u=Y(t)?fe:we,a=n?n():{};return u(t,s,ve(l),a)}}var $e=Object.prototype,Be=$e.hasOwnProperty,Se=xe(function(s,n,t){Be.call(s,t)?s[t].push(n):W(s,t,[n])});const Te=Se,Oe={class:"container"},Ae={class:"search-bar"},Ne={key:0,class:"generate-idx-hint"},Pe={class:"list-container"},Me={class:"cat-name"},Ve=["onClick"],ze=["onClickCapture"],De=X({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,t=Z(),l=ee(),u=N(()=>!l.isIdle),a=$(),o=$(new Set),v=N(()=>a.value?a.value.tags.slice().sort((e,r)=>r.count-e.count):[]),k=["custom","Model","lora","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((e,r,m)=>(e[r]=m,e),{}),q=N(()=>Object.entries(Te(v.value,e=>e.type)).sort((e,r)=>k[e[0]]-k[r[0]])),U=ae();te(async()=>{a.value=await E(),a.value.img_count&&a.value.expired&&M()});const M=async()=>{l.pushAction(async()=>{await de(),a.value=await E()})},G=()=>{t.openTagSearchMatchedImageGridInRight(n.tabIdx,U,Array.from(o.value))},A=(e,r=!1)=>(r?`[${e.type}] `:"")+(e.display_name?`${e.display_name} : ${e.name}`:e.name),w=$(!1),y=$(""),L=async()=>{var r,m,f;if(!y.value){w.value=!1;return}const e=await l.pushAction(()=>pe({tag_name:y.value})).res;e.type!=="custom"&&D.error(P("existInOtherType")),(r=a.value)!=null&&r.tags.find(h=>h.id===e.id)?D.error(P("alreadyExists")):((m=a.value)==null||m.tags.push(e),(f=t.conf)==null||f.all_custom_tags.push(e)),y.value="",w.value=!1},j=e=>{me.confirm({title:P("confirmDelete"),async onOk(){var m,f,h,x;await ge({tag_id:e});const r=((m=a.value)==null?void 0:m.tags.findIndex(i=>i.id===e))??-1;(f=a.value)==null||f.tags.splice(r,1),(x=t.conf)==null||x.all_custom_tags.splice((h=t.conf)==null?void 0:h.all_custom_tags.findIndex(i=>i.id===e),1)}})};return(e,r)=>{const m=F,f=ue,h=F,x=ce;return c(),g("div",Oe,[b("",!0),a.value?(c(),g(B,{key:1},[S("div",null,[S("div",Ae,[C(d(se),{conv:{value:i=>i.id,text:A,optionText:i=>A(i,!0)},mode:"multiple",style:{width:"100%"},options:d(v),value:Array.from(o.value),disabled:!d(v).length,placeholder:"Select tags to match images","onUpdate:value":r[0]||(r[0]=i=>o.value=new Set(i))},null,8,["conv","options","value","disabled"]),a.value.expired||!a.value.img_count?(c(),T(m,{key:0,onClick:M,loading:!d(l).isIdle,type:"primary"},{default:O(()=>[I(_(a.value.img_count===0?e.$t("generateIndexHint"):e.$t("UpdateIndex")),1)]),_:1},8,["loading"])):(c(),T(m,{key:1,type:"primary",onClick:G,loading:!d(l).isIdle,disabled:!o.value.size},{default:O(()=>[I(_(e.$t("search")),1)]),_:1},8,["loading","disabled"]))])]),d(v).filter(i=>i.type!=="custom").length?b("",!0):(c(),g("p",Ne,_(e.$t("needGenerateIdx")),1)),S("div",Pe,[(c(!0),g(B,null,V(d(q),([i,Q])=>(c(),g("ul",{class:"tag-list",key:i},[S("h3",Me,_(e.$t(i)),1),(c(!0),g(B,null,V(Q,(p,R)=>(c(),g("li",{key:p.id,class:ne(["tag",{selected:o.value.has(p.id)}]),onClick:H=>o.value.has(p.id)?o.value.delete(p.id):o.value.add(p.id)},[o.value.has(p.id)?(c(),T(d(oe),{key:0})):b("",!0),I(" "+_(A(p))+" ",1),i==="custom"&&R!==0?(c(),g("span",{key:1,class:"remove",onClickCapture:z(H=>j(p.id),["stop"])},[C(d(re))],40,ze)):b("",!0)],10,Ve))),128)),i==="custom"?(c(),g("li",{key:0,class:"tag",onClick:r[2]||(r[2]=p=>w.value=!0)},[w.value?(c(),T(x,{key:0,compact:""},{default:O(()=>[C(f,{value:y.value,"onUpdate:value":r[1]||(r[1]=p=>y.value=p),style:{width:"128px"},loading:d(u),"allow-clear":"",size:"small"},null,8,["value","loading"]),C(h,{size:"small",type:"primary",onClickCapture:z(L,["stop"]),loading:d(u)},{default:O(()=>[I(_(y.value?e.$t("submit"):e.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(c(),g(B,{key:1},[C(d(le)),I(" "+_(e.$t("add")),1)],64))])):b("",!0)]))),128))])],64)):b("",!0)])}}});const je=ie(De,[["__scopeId","data-v-c4b1e490"]]);export{je as default};

1
vue/dist/assets/TagSearch-93a5f6d8.js vendored Normal file
View File

@ -0,0 +1 @@
import{ao as W,an as J,c0 as K,bP as X,d as Y,v as Z,aW as ee,T as P,r as $,U as ae,ab as te,o as c,l as g,I as b,s as B,q as S,c as C,n as d,S as se,y as T,m as A,A as I,t as _,B as z,H as ne,c4 as oe,z as D,b4 as re,c5 as le,bm as E,R as M,O as ie}from"./index-9cc5a0e4.js";import{I as ue,_ as ce}from"./index-1fbc5628.js";import"./index-8aac401f.js";import{c as F,u as de,e as pe,M as me,r as ge}from"./db-81af9a8b.js";import{b as ve}from"./_baseIteratee-2a992630.js";import{B as U}from"./button-8e78b0cf.js";function fe(s,n,t,l){for(var u=-1,a=s==null?0:s.length;++u<a;){var o=s[u];n(l,o,t(o),s)}return l}function _e(s){return function(n,t,l){for(var u=-1,a=Object(n),o=l(n),v=o.length;v--;){var k=o[s?v:++u];if(t(a[k],k,a)===!1)break}return n}}var ye=_e();const he=ye;function be(s,n){return s&&he(s,n,W)}function ke(s,n){return function(t,l){if(t==null)return t;if(!J(t))return s(t,l);for(var u=t.length,a=n?u:-1,o=Object(t);(n?a--:++a<u)&&l(o[a],a,o)!==!1;);return t}}var Ce=ke(be);const Ie=Ce;function we(s,n,t,l){return Ie(s,function(u,a,o){n(l,u,t(u),o)}),l}function xe(s,n){return function(t,l){var u=K(t)?fe:we,a=n?n():{};return u(t,s,ve(l),a)}}var $e=Object.prototype,Be=$e.hasOwnProperty,Se=xe(function(s,n,t){Be.call(s,t)?s[t].push(n):X(s,t,[n])});const Te=Se,Ae={class:"container"},Oe={class:"search-bar"},Pe={key:0,class:"generate-idx-hint"},Me={class:"list-container"},Ne={class:"cat-name"},ze=["onClick"],De=["onClickCapture"],Ee=Y({__name:"TagSearch",props:{tabIdx:null,paneIdx:null},setup(s){const n=s,t=Z(),l=ee(),u=P(()=>!l.isIdle),a=$(),o=$(new Set),v=P(()=>a.value?a.value.tags.slice().sort((e,r)=>r.count-e.count):[]),k=["custom","Model","lora","pos","size","Postprocess upscaler","Postprocess upscale by","Sampler"].reduce((e,r,m)=>(e[r]=m,e),{}),V=P(()=>Object.entries(Te(v.value,e=>e.type)).sort((e,r)=>k[e[0]]-k[r[0]])),q=ae();te(async()=>{a.value=await F(),a.value.img_count&&a.value.expired&&N()});const N=async()=>{l.pushAction(async()=>{await de(),a.value=await F()})},G=()=>{t.openTagSearchMatchedImageGridInRight(n.tabIdx,q,Array.from(o.value))},O=(e,r=!1)=>(r?`[${e.type}] `:"")+(e.display_name?`${e.display_name} : ${e.name}`:e.name),w=$(!1),y=$(""),R=async()=>{var r,m,f;if(!y.value){w.value=!1;return}const e=await l.pushAction(()=>pe({tag_name:y.value})).res;e.type!=="custom"&&E.error(M("existInOtherType")),(r=a.value)!=null&&r.tags.find(h=>h.id===e.id)?E.error(M("alreadyExists")):((m=a.value)==null||m.tags.push(e),(f=t.conf)==null||f.all_custom_tags.push(e)),y.value="",w.value=!1},j=e=>{me.confirm({title:M("confirmDelete"),async onOk(){var m,f,h,x;await ge({tag_id:e});const r=((m=a.value)==null?void 0:m.tags.findIndex(i=>i.id===e))??-1;(f=a.value)==null||f.tags.splice(r,1),(x=t.conf)==null||x.all_custom_tags.splice((h=t.conf)==null?void 0:h.all_custom_tags.findIndex(i=>i.id===e),1)}})};return(e,r)=>{const m=U,f=ue,h=U,x=ce;return c(),g("div",Ae,[b("",!0),a.value?(c(),g(B,{key:1},[S("div",null,[S("div",Oe,[C(d(se),{conv:{value:i=>i.id,text:O,optionText:i=>O(i,!0)},mode:"multiple",style:{width:"100%"},options:d(v),value:Array.from(o.value),disabled:!d(v).length,placeholder:"Select tags to match images","onUpdate:value":r[0]||(r[0]=i=>o.value=new Set(i))},null,8,["conv","options","value","disabled"]),a.value.expired||!a.value.img_count?(c(),T(m,{key:0,onClick:N,loading:!d(l).isIdle,type:"primary"},{default:A(()=>[I(_(a.value.img_count===0?e.$t("generateIndexHint"):e.$t("UpdateIndex")),1)]),_:1},8,["loading"])):(c(),T(m,{key:1,type:"primary",onClick:G,loading:!d(l).isIdle,disabled:!o.value.size},{default:A(()=>[I(_(e.$t("search")),1)]),_:1},8,["loading","disabled"]))])]),d(v).filter(i=>i.type!=="custom").length?b("",!0):(c(),g("p",Pe,_(e.$t("needGenerateIdx")),1)),S("div",Me,[(c(!0),g(B,null,z(d(V),([i,H])=>(c(),g("ul",{class:"tag-list",key:i},[S("h3",Ne,_(e.$t(i)),1),(c(!0),g(B,null,z(H,(p,L)=>(c(),g("li",{key:p.id,class:ne(["tag",{selected:o.value.has(p.id)}]),onClick:Q=>o.value.has(p.id)?o.value.delete(p.id):o.value.add(p.id)},[o.value.has(p.id)?(c(),T(d(oe),{key:0})):b("",!0),I(" "+_(O(p))+" ",1),i==="custom"&&L!==0?(c(),g("span",{key:1,class:"remove",onClickCapture:D(Q=>j(p.id),["stop"])},[C(d(re))],40,De)):b("",!0)],10,ze))),128)),i==="custom"?(c(),g("li",{key:0,class:"tag",onClick:r[2]||(r[2]=p=>w.value=!0)},[w.value?(c(),T(x,{key:0,compact:""},{default:A(()=>[C(f,{value:y.value,"onUpdate:value":r[1]||(r[1]=p=>y.value=p),style:{width:"128px"},loading:d(u),"allow-clear":"",size:"small"},null,8,["value","loading"]),C(h,{size:"small",type:"primary",onClickCapture:D(R,["stop"]),loading:d(u)},{default:A(()=>[I(_(y.value?e.$t("submit"):e.$t("cancel")),1)]),_:1},8,["onClickCapture","loading"])]),_:1})):(c(),g(B,{key:1},[C(d(le)),I(" "+_(e.$t("add")),1)],64))])):b("",!0)]))),128))])],64)):b("",!0)])}}});const je=ie(Ee,[["__scopeId","data-v-c4b1e490"]]);export{je as default};

View File

@ -0,0 +1 @@
import{cj as A,ck as O,cc as _,c2 as b,cl as m,bi as C,ao as w,aN as h,cm as E,aP as g,cn as R,aL as x,c0 as D}from"./index-9cc5a0e4.js";var G=A(Object.getPrototypeOf,Object);const J=G;function y(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,O(t.key),t)}}function Q(e,n,r){return n&&y(e.prototype,n),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e){return function(n){return n==null?void 0:n[e]}}var L=function(){return _()&&window.document.documentElement},a,X=function(){if(!L())return!1;if(a!==void 0)return a;var n=document.createElement("div");return n.style.display="flex",n.style.flexDirection="column",n.style.rowGap="1px",n.appendChild(document.createElement("div")),n.appendChild(document.createElement("div")),document.body.appendChild(n),a=n.scrollHeight===1,document.body.removeChild(n),a},F=1,I=2;function S(e,n,r,t){var i=r.length,o=i,s=!t;if(e==null)return!o;for(e=Object(e);i--;){var f=r[i];if(s&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<o;){f=r[i];var u=f[0],l=e[u],c=f[1];if(s&&f[2]){if(l===void 0&&!(u in e))return!1}else{var d=new b;if(t)var p=t(l,c,u,e,n,d);if(!(p===void 0?m(c,l,F|I,t,d):p))return!1}}return!0}function P(e){return e===e&&!C(e)}function U(e){for(var n=w(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,P(i)]}return n}function v(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function K(e){var n=U(e);return n.length==1&&n[0][2]?v(n[0][0],n[0][1]):function(r){return r===e||S(r,e,n)}}function N(e,n,r){var t=e==null?void 0:h(e,n);return t===void 0?r:t}var T=1,$=2;function q(e,n){return E(e)&&P(n)?v(g(e),n):function(r){var t=N(r,e);return t===void 0&&t===n?R(r,e):m(n,t,T|$)}}function H(e){return function(n){return h(n,e)}}function k(e){return E(e)?M(g(e)):H(e)}function Y(e){return typeof e=="function"?e:e==null?x:typeof e=="object"?D(e)?q(e[0],e[1]):K(e):k(e)}export{Q as _,W as a,Y as b,L as c,X as d,J as g};

View File

@ -1 +0,0 @@
import{cj as O,ck as P,cc as _,c2 as b,cl as m,bl as C,at as w,aS as h,cm as E,aU as g,cn as R,aQ as x,c0 as D}from"./index-8a9c3393.js";var G=O(Object.getPrototypeOf,Object);const B=G;function y(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,P(t.key),t)}}function J(e,n,r){return n&&y(e.prototype,n),r&&y(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function W(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function M(e){return function(n){return n==null?void 0:n[e]}}var S=function(){return _()&&window.document.documentElement},a,X=function(){if(!S())return!1;if(a!==void 0)return a;var n=document.createElement("div");return n.style.display="flex",n.style.flexDirection="column",n.style.rowGap="1px",n.appendChild(document.createElement("div")),n.appendChild(document.createElement("div")),document.body.appendChild(n),a=n.scrollHeight===1,document.body.removeChild(n),a},F=1,I=2;function L(e,n,r,t){var i=r.length,o=i,s=!t;if(e==null)return!o;for(e=Object(e);i--;){var f=r[i];if(s&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++i<o;){f=r[i];var u=f[0],l=e[u],c=f[1];if(s&&f[2]){if(l===void 0&&!(u in e))return!1}else{var d=new b;if(t)var p=t(l,c,u,e,n,d);if(!(p===void 0?m(c,l,F|I,t,d):p))return!1}}return!0}function v(e){return e===e&&!C(e)}function U(e){for(var n=w(e),r=n.length;r--;){var t=n[r],i=e[t];n[r]=[t,i,v(i)]}return n}function A(e,n){return function(r){return r==null?!1:r[e]===n&&(n!==void 0||e in Object(r))}}function K(e){var n=U(e);return n.length==1&&n[0][2]?A(n[0][0],n[0][1]):function(r){return r===e||L(r,e,n)}}function T(e,n,r){var t=e==null?void 0:h(e,n);return t===void 0?r:t}var $=1,N=2;function q(e,n){return E(e)&&v(n)?A(g(e),n):function(r){var t=T(r,e);return t===void 0&&t===n?R(r,e):m(n,t,$|N)}}function H(e){return function(n){return h(n,e)}}function Q(e){return E(e)?M(g(e)):H(e)}function Y(e){return typeof e=="function"?e:e==null?x:typeof e=="object"?D(e)?q(e[0],e[1]):K(e):Q(e)}export{J as _,W as a,Y as b,S as c,X as d,B as g};

4
vue/dist/assets/button-8e78b0cf.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

File diff suppressed because one or more lines are too long

1
vue/dist/assets/db-81af9a8b.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{c as w,Q as z,d as L,v as B,R as y,T as I,o,l,q as n,t as r,I as h,n as d,z as v,s as k,B as g,m as F,A as M,U as D,V as N,W as V,X as j,Y as H,O as P}from"./index-9cc5a0e4.js";import{B as R}from"./button-8e78b0cf.js";var A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const E=A;function S(a){for(var c=1;c<arguments.length;c++){var t=arguments[c]!=null?Object(arguments[c]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable}))),i.forEach(function(u){T(a,u,t[u])})}return a}function T(a,c,t){return c in a?Object.defineProperty(a,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[c]=t,a}var C=function(c,t){var i=S({},c,t.attrs);return w(z,S({},i,{icon:E}),null)};C.displayName="FileDoneOutlined";C.inheritAttrs=!1;const W=C,Q=a=>(j("data-v-e015a41c"),a=a(),H(),a),G={class:"container"},U={class:"header"},X=Q(()=>n("div",{"flex-placeholder":""},null,-1)),Y={class:"last-record"},J=["onClick"],Z={class:"content"},K={key:0,class:"quick-start"},ee={key:1,class:"quick-start"},te=["onClick"],se={class:"quick-start__text line-clamp-1"},ne={class:"quick-start"},ae=["onClick"],oe={class:"quick-start__text line-clamp-1"},le={key:2,class:"quick-start"},ce=["onClick"],re={class:"quick-start__text line-clamp-1"},ie=L({__name:"emptyStartup",props:{tabIdx:null,paneIdx:null},setup(a){const c=a,t=B(),i={local:y("local"),"tag-search":y("imgSearch"),"global-setting":y("globalSettings")},u=(e,p,f=!1)=>{let _;switch(e){case"tag-search-matched-image-grid":return;case"global-setting":case"tag-search":case"empty":_={type:e,name:i[e],key:Date.now()+D()};break;case"local":_={type:e,name:i[e],key:Date.now()+D(),path:p,walkMode:f}}const s=t.tabList[c.tabIdx];s.panes.splice(c.paneIdx,1,_),s.key=_.key},m=I(()=>{var e;return(e=t.lastTabListRecord)==null?void 0:e[1]});console.log(m.value);const O=I(()=>t.autoCompletedDirList.filter(({key:e})=>e==="outdir_txt2img_samples"||e==="outdir_img2img_samples"||e==="outdir_extras_samples"||e==="outdir_save"||e==="outdir_samples")),q=window.parent!==window,$=()=>window.parent.open("/infinite_image_browsing"),x=()=>{N(m.value),t.tabList=m.value.tabs.map(e=>V(e,!0)),t.tabList.forEach(e=>{e.panes.forEach(p=>{typeof p.name!="string"&&(p.name="")})})};return(e,p)=>{var _;const f=R;return o(),l("div",G,[n("div",U,[n("h1",null,r(e.$t("welcome")),1),X,q?(o(),l("div",{key:0,class:"last-record",onClick:$},[n("a",null,r(e.$t("openInNewWindow")),1)])):h("",!0),n("div",Y,[(_=d(m))!=null&&_.tabs.length?(o(),l("a",{key:0,onClick:v(x,["prevent"])},r(e.$t("restoreLastRecord")),9,J)):h("",!0)])]),n("div",Z,[d(O).length?(o(),l("div",K,[n("h2",null,r(e.$t("walkMode")),1),n("ul",null,[(o(!0),l(k,null,g(d(O),s=>(o(),l("li",{key:s.dir,class:"quick-start__item"},[w(f,{onClick:b=>u("local",s.dir,!0),ghost:"",type:"primary",block:""},{default:F(()=>[M(r(s.zh),1)]),_:2},1032,["onClick"])]))),128))])])):h("",!0),d(t).autoCompletedDirList.length?(o(),l("div",ee,[n("h2",null,r(e.$t("launchFromQuickMove")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).autoCompletedDirList,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.dir),["prevent"])},[n("span",se,r(s.zh),1)],8,te))),128))])])):h("",!0),n("div",ne,[n("h2",null,r(e.$t("launch")),1),n("ul",null,[(o(!0),l(k,null,g(Object.keys(i),s=>(o(),l("li",{key:s,class:"quick-start__item",onClick:v(b=>u(s),["prevent"])},[n("span",oe,r(i[s]),1)],8,ae))),128))])]),d(t).recent.length?(o(),l("div",le,[n("h2",null,r(e.$t("recent")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).recent,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.path),["prevent"])},[w(d(W),{class:"quick-start__icon"}),n("span",re,r(s.path),1)],8,ce))),128))])])):h("",!0)])])}}});const _e=P(ie,[["__scopeId","data-v-e015a41c"]]);export{_e as default};

View File

@ -1 +0,0 @@
import{c as w,A as L,d as z,z as N,L as y,B as D,o,l,q as n,t as r,N as h,n as d,Q as v,s as k,K as g,m as B,J as F,a2 as I,a3 as M,a4 as V,T as j,U as H,V as P}from"./index-8a9c3393.js";import{B as A}from"./button-c8ca57b0.js";var E={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm376 116c-119.3 0-216 96.7-216 216s96.7 216 216 216 216-96.7 216-216-96.7-216-216-216zm107.5 323.5C750.8 868.2 712.6 884 672 884s-78.8-15.8-107.5-44.5C535.8 810.8 520 772.6 520 732s15.8-78.8 44.5-107.5C593.2 595.8 631.4 580 672 580s78.8 15.8 107.5 44.5C808.2 653.2 824 691.4 824 732s-15.8 78.8-44.5 107.5zM761 656h-44.3c-2.6 0-5 1.2-6.5 3.3l-63.5 87.8-23.1-31.9a7.92 7.92 0 00-6.5-3.3H573c-6.5 0-10.3 7.4-6.5 12.7l73.8 102.1c3.2 4.4 9.7 4.4 12.9 0l114.2-158c3.9-5.3.1-12.7-6.4-12.7zM440 852H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"file-done",theme:"outlined"};const R=E;function S(a){for(var c=1;c<arguments.length;c++){var t=arguments[c]!=null?Object(arguments[c]):{},i=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(t).filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable}))),i.forEach(function(u){T(a,u,t[u])})}return a}function T(a,c,t){return c in a?Object.defineProperty(a,c,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[c]=t,a}var C=function(c,t){var i=S({},c,t.attrs);return w(L,S({},i,{icon:R}),null)};C.displayName="FileDoneOutlined";C.inheritAttrs=!1;const W=C,Q=a=>(j("data-v-e015a41c"),a=a(),H(),a),G={class:"container"},J={class:"header"},U=Q(()=>n("div",{"flex-placeholder":""},null,-1)),X={class:"last-record"},Y=["onClick"],Z={class:"content"},K={key:0,class:"quick-start"},ee={key:1,class:"quick-start"},te=["onClick"],se={class:"quick-start__text line-clamp-1"},ne={class:"quick-start"},ae=["onClick"],oe={class:"quick-start__text line-clamp-1"},le={key:2,class:"quick-start"},ce=["onClick"],re={class:"quick-start__text line-clamp-1"},ie=z({__name:"emptyStartup",props:{tabIdx:null,paneIdx:null},setup(a){const c=a,t=N(),i={local:y("local"),"tag-search":y("imgSearch"),"global-setting":y("globalSettings")},u=(e,p,f=!1)=>{let _;switch(e){case"tag-search-matched-image-grid":return;case"global-setting":case"tag-search":case"empty":_={type:e,name:i[e],key:Date.now()+I()};break;case"local":_={type:e,name:i[e],key:Date.now()+I(),path:p,walkMode:f}}const s=t.tabList[c.tabIdx];s.panes.splice(c.paneIdx,1,_),s.key=_.key},m=D(()=>{var e;return(e=t.lastTabListRecord)==null?void 0:e[1]});console.log(m.value);const O=D(()=>t.autoCompletedDirList.filter(({key:e})=>e==="outdir_txt2img_samples"||e==="outdir_img2img_samples"||e==="outdir_extras_samples"||e==="outdir_save"||e==="outdir_samples")),q=window.parent!==window,$=()=>window.parent.open("/infinite_image_browsing"),x=()=>{M(m.value),t.tabList=m.value.tabs.map(e=>V(e,!0)),t.tabList.forEach(e=>{e.panes.forEach(p=>{typeof p.name!="string"&&(p.name="")})})};return(e,p)=>{var _;const f=A;return o(),l("div",G,[n("div",J,[n("h1",null,r(e.$t("welcome")),1),U,q?(o(),l("div",{key:0,class:"last-record",onClick:$},[n("a",null,r(e.$t("openInNewWindow")),1)])):h("",!0),n("div",X,[(_=d(m))!=null&&_.tabs.length?(o(),l("a",{key:0,onClick:v(x,["prevent"])},r(e.$t("restoreLastRecord")),9,Y)):h("",!0)])]),n("div",Z,[d(O).length?(o(),l("div",K,[n("h2",null,r(e.$t("walkMode")),1),n("ul",null,[(o(!0),l(k,null,g(d(O),s=>(o(),l("li",{key:s.dir,class:"quick-start__item"},[w(f,{onClick:b=>u("local",s.dir,!0),ghost:"",type:"primary",block:""},{default:B(()=>[F(r(s.zh),1)]),_:2},1032,["onClick"])]))),128))])])):h("",!0),d(t).autoCompletedDirList.length?(o(),l("div",ee,[n("h2",null,r(e.$t("launchFromQuickMove")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).autoCompletedDirList,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.dir),["prevent"])},[n("span",se,r(s.zh),1)],8,te))),128))])])):h("",!0),n("div",ne,[n("h2",null,r(e.$t("launch")),1),n("ul",null,[(o(!0),l(k,null,g(Object.keys(i),s=>(o(),l("li",{key:s,class:"quick-start__item",onClick:v(b=>u(s),["prevent"])},[n("span",oe,r(i[s]),1)],8,ae))),128))])]),d(t).recent.length?(o(),l("div",le,[n("h2",null,r(e.$t("recent")),1),n("ul",null,[(o(!0),l(k,null,g(d(t).recent,s=>(o(),l("li",{key:s.key,class:"quick-start__item",onClick:v(b=>u("local",s.path),["prevent"])},[w(d(W),{class:"quick-start__icon"}),n("span",re,r(s.path),1)],8,ce))),128))])])):h("",!0)])])}}});const _e=P(ie,[["__scopeId","data-v-e015a41c"]]);export{_e 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

File diff suppressed because one or more lines are too long

11
vue/dist/assets/index-1fbc5628.js vendored Normal file

File diff suppressed because one or more lines are too long

1
vue/dist/assets/index-235fc08e.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{aR as n,c9 as c}from"./index-8a9c3393.js";import{g as a}from"./_baseIteratee-75bdf25b.js";var i="[object Object]",s=Function.prototype,p=Object.prototype,e=s.toString,f=p.hasOwnProperty,b=e.call(Object);function l(o){if(!n(o)||c(o)!=i)return!1;var r=a(o);if(r===null)return!0;var t=f.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&e.call(t)==b}export{l as i};
import{aM as n,c9 as c}from"./index-9cc5a0e4.js";import{g as a}from"./_baseIteratee-2a992630.js";var i="[object Object]",s=Function.prototype,p=Object.prototype,e=s.toString,f=p.hasOwnProperty,b=e.call(Object);function l(o){if(!n(o)||c(o)!=i)return!1;var r=a(o);if(r===null)return!0;var t=f.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&e.call(t)==b}export{l as i};

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-10b9c930.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.ant-breadcrumb{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";color:#00000073;font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:#00000073;transition:color .3s}.ant-breadcrumb a:hover{color:#de632f}.ant-breadcrumb>span:last-child{color:#000000d9}.ant-breadcrumb>span:last-child a{color:#000000d9}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:#00000073}.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-link>.anticon+a{margin-left:4px}.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{display:table;content:""}.ant-breadcrumb-rtl:after{display:table;clear:both;content:""}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+a{margin-right:4px;margin-left:0}.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-right:4px;margin-left:0}.nprogress{pointer-events:none}.nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}.nprogress .peg{display:block;position:absolute;right:0px;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}.nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}.nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent .nprogress .spinner,.nprogress-custom-parent .nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.full-screen-menu[data-v-1c71d760]{position:fixed;z-index:99999;background:var(--zp-primary-background);padding:16px;box-shadow:0 0 4px var(--zp-secondary);border-radius:4px}.full-screen-menu .container[data-v-1c71d760]{height:100%;display:flex;flex-direction:column}.full-screen-menu .gen-info[data-v-1c71d760]{padding-top:8px;flex:1;word-break:break-all;white-space:pre-line;overflow:auto;z-index:1;position:relative}.full-screen-menu.unset-size[data-v-1c71d760]{width:unset!important;height:unset!important}.full-screen-menu .mouse-sensor[data-v-1c71d760]{position:absolute;bottom:0;right:0;width:10px;height:10px;background-color:var(--zp-secondary);cursor:se-resize}.full-screen-menu .actoion-bar[data-v-1c71d760]{display:flex;align-items:center}.full-screen-menu .actoion-bar .icon[data-v-1c71d760]{font-size:1.5em}.full-screen-menu .actoion-bar>*[data-v-1c71d760]{margin-right:8px}.uninstalled-hint[data-v-a683ea61]{margin:256px auto;display:flex;flex-flow:column;justify-content:center;align-items:center}.uninstalled-hint>*[data-v-a683ea61]{margin:16px;text-align:center}.preview-switch[data-v-a683ea61]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-a683ea61]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-a683ea61]{opacity:0;pointer-events:none;cursor:none}.container[data-v-a683ea61]{height:100%;background:var(--zp-secondary-background)}.location-bar[data-v-a683ea61]{padding:4px 16px;background:var(--zp-primary-background);border-bottom:1px solid var(--zp-border);display:flex;align-items:center;justify-content:space-between}.location-bar .actions[data-v-a683ea61]{display:flex;align-items:center;flex-shrink:0}.location-bar a.opt[data-v-a683ea61]{margin-left:8px}.view[data-v-a683ea61]{padding:8px;height:calc(100vh - 96px)}.view .file-list[data-v-a683ea61]{list-style:none;padding:8px;height:100%;overflow:auto}.hint[data-v-a683ea61]{padding:4px;border:4px;background:var(--zp-secondary-background);border:1px solid var(--zp-border)}
.ant-breadcrumb{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";color:#00000073;font-size:14px}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb a{color:#00000073;transition:color .3s}.ant-breadcrumb a:hover{color:#de632f}.ant-breadcrumb>span:last-child{color:#000000d9}.ant-breadcrumb>span:last-child a{color:#000000d9}.ant-breadcrumb>span:last-child .ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{margin:0 8px;color:#00000073}.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-link>.anticon+a{margin-left:4px}.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{display:table;content:""}.ant-breadcrumb-rtl:after{display:table;clear:both;content:""}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+a{margin-right:4px;margin-left:0}.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-right:4px;margin-left:0}.nprogress{pointer-events:none}.nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}.nprogress .peg{display:block;position:absolute;right:0px;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}.nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}.nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent .nprogress .spinner,.nprogress-custom-parent .nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.preview-switch[data-v-77c6e69b]{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;z-index:11111;pointer-events:none}.preview-switch>*[data-v-77c6e69b]{color:#fff;margin:16px;font-size:4em;pointer-events:all;cursor:pointer}.preview-switch>*.disable[data-v-77c6e69b]{opacity:0;pointer-events:none;cursor:none}.container[data-v-77c6e69b]{height:100%;background:var(--zp-secondary-background)}.location-bar[data-v-77c6e69b]{padding:4px 16px;background:var(--zp-primary-background);border-bottom:1px solid var(--zp-border);display:flex;align-items:center;justify-content:space-between}.location-bar .actions[data-v-77c6e69b]{display:flex;align-items:center;flex-shrink:0}.location-bar a.opt[data-v-77c6e69b]{margin-left:8px}.view[data-v-77c6e69b]{padding:8px;height:calc(100vh - 96px)}.view .file-list[data-v-77c6e69b]{list-style:none;padding:8px;height:100%;overflow:auto}.hint[data-v-77c6e69b]{padding:4px;border:4px;background:var(--zp-secondary-background);border:1px solid var(--zp-border)}

File diff suppressed because one or more lines are too long

2
vue/dist/index.html vendored
View File

@ -7,7 +7,7 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-8a9c3393.js"></script>
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-9cc5a0e4.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-19e73083.css">
</head>

View File

@ -12,12 +12,16 @@ import {
useHookShareState,
useMobileOptimization,
useFileItemActions,
toRawFileUrl
toRawFileUrl,
usePreview,
useFileTransfer
} from '@/page/fileTransfer/hook'
import { identity } from 'lodash-es'
import { getImagesByTags } from '@/api/db'
import { watch } from 'vue'
import { createReactiveQueue } from '@/util'
import fullScreenContextMenu from '@/page/fileTransfer/fullScreenContextMenu.vue'
import { LeftCircleOutlined, RightCircleOutlined } from '@/icon'
const images = ref<FileNodeInfo[]>()
@ -42,24 +46,29 @@ watch(
const scroller = ref<Scroller>()
const propsMock = { tabIdx: -1, target: 'local', paneIdx: -1 } as const
const { stackViewEl, multiSelectedIdxs } = useHookShareState().toRefs()
const propsMock = { tabIdx: -1, target: 'local', paneIdx: -1, walkMode: false } as const
const { stackViewEl, multiSelectedIdxs, stack } = useHookShareState().toRefs()
const { itemSize, gridItems } = useFilesDisplay(propsMock)
const { showMenuIdx } = useMobileOptimization()
useFileTransfer() // for reset selected
const {
showGenInfo,
imageGenInfo,
q: genInfoQueue,
onContextMenuClick
onContextMenuClick,
onFileItemClick
} = useFileItemActions(propsMock, { openNext: identity })
const { previewIdx, previewing, onPreviewVisibleChange, previewImgMove, canPreview } = usePreview(props, { scroller, files: images })
const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
stack.value = [{ curr: '', files: images.value! }] // hackfor delete multi files
const idxs = multiSelectedIdxs.value // when click confirm ok button, idxs will be reset
await onContextMenuClick(e, file, idx)
if (e.key === 'deleteFiles') {
const idxs = multiSelectedIdxs.value.includes(idx) ? multiSelectedIdxs.value : [idx]
images.value = images.value!.filter((_, idx) => !idxs.includes(idx))
}
}
</script>
<template>
<div class="container" ref="stackViewEl">
@ -67,45 +76,65 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
<AModal v-model:visible="showGenInfo" width="70vw" mask-closable @ok="showGenInfo = false">
<template #cancelText />
<ASkeleton active :loading="!genInfoQueue.isIdle">
<div
style="
width: 100%;
word-break: break-all;
white-space: pre-line;
max-height: 70vh;
overflow: auto;
"
@dblclick="copy2clipboard(imageGenInfo, 'copied')"
>
<div style="
width: 100%;
word-break: break-all;
white-space: pre-line;
max-height: 70vh;
overflow: auto;
" @dblclick="copy2clipboard(imageGenInfo, 'copied')">
<div class="hint">{{ $t('doubleClickToCopy') }}</div>
{{ imageGenInfo }}
</div>
</ASkeleton>
</AModal>
<RecycleScroller
ref="scroller"
class="file-list"
:items="images || []"
:item-size="itemSize.first"
key-field="fullpath"
:item-secondary-size="itemSize.second"
:gridItems="gridItems"
>
<RecycleScroller ref="scroller" class="file-list" v-if="images" :items="images" :item-size="itemSize.first"
key-field="fullpath" :item-secondary-size="itemSize.second" :gridItems="gridItems">
<template v-slot="{ item: file, index: idx }">
<!-- idx 和file有可能丢失 -->
<file-item-cell
:idx="idx"
:file="file"
v-model:show-menu-idx="showMenuIdx"
:full-screen-preview-image-url="toRawFileUrl(file)"
@context-menu-click="onContextMenuClickU"
/>
<file-item-cell :idx="idx" :file="file" v-model:show-menu-idx="showMenuIdx" @file-item-click="onFileItemClick"
:full-screen-preview-image-url="images[previewIdx] ? toRawFileUrl(images[previewIdx]) : ''"
:selected="multiSelectedIdxs.includes(idx)" @context-menu-click="onContextMenuClickU"
@preview-visible-change="onPreviewVisibleChange" />
</template>
</RecycleScroller>
<div v-if="previewing" class="preview-switch">
<LeftCircleOutlined @click="previewImgMove('prev')" :class="{ disable: !canPreview('prev') }" />
<RightCircleOutlined @click="previewImgMove('next')" :class="{ disable: !canPreview('next') }" />
</div>
</ASpin>
<fullScreenContextMenu v-if="previewing && images && images[previewIdx]" :file="images[previewIdx]" :idx="previewIdx"
@context-menu-click="onContextMenuClickU" />
</div>
</template>
<style scoped lang="scss">
.preview-switch {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 11111;
pointer-events: none;
&>* {
color: white;
margin: 16px;
font-size: 4em;
pointer-events: all;
cursor: pointer;
&.disable {
opacity: 0;
pointer-events: none;
cursor: none;
}
}
}
.container {
background: var(--zp-secondary-background);

View File

@ -24,7 +24,7 @@ const props = withDefaults(
const emit = defineEmits<{
(type: 'update:showMenuIdx', v: number): void
(type: 'fileItemClick', event: MouseEvent, file: FileNodeInfo): void
(type: 'fileItemClick', event: MouseEvent, file: FileNodeInfo, idx: number): void
(type: 'dragstart', event: DragEvent, idx: number): void
(type: 'previewVisibleChange', value: boolean, last: boolean): void
(type: 'contextMenuClick', e: MenuInfo, file: FileNodeInfo, idx: number): void
@ -70,7 +70,7 @@ const thumbnailSize = computed(() =>
draggable="true"
@dragstart="emit('dragstart', $event, idx)"
@contextmenu="onRightClick"
@click.capture="emit('fileItemClick', $event, file)"
@click.capture="emit('fileItemClick', $event, file, idx)"
>
<div v-if="viewMode !== 'line'">
<a-image

View File

@ -1,6 +1,6 @@
import { useGlobalStore, type FileTransferTabPane } from '@/store/useGlobalStore'
import { onLongPress, useElementSize } from '@vueuse/core'
import { ref, computed, watch, onMounted, h } from 'vue'
import { ref, computed, watch, onMounted, h, type Ref } from 'vue'
import { genInfoCompleted, getImageGenerationInfo, setImgPath } from '@/api'
import {
@ -129,9 +129,11 @@ export interface Page {
* @param props
* @returns
*/
export function usePreview (props: Props) {
const { scroller, sortedFiles, previewIdx, eventEmitter, canLoadNext } =
useHookShareState().toRefs()
export function usePreview (props: Props, custom?: { files: Ref<FileNodeInfo[] | undefined>, scroller: Ref<Scroller | undefined> }) {
const { previewIdx, eventEmitter, canLoadNext } = useHookShareState().toRefs()
const { state } = useHookShareState()
const files = computed(() => custom?.files.value ?? state.sortedFiles)
const scroller = computed(() => custom?.scroller.value ?? state.scroller)
const previewing = ref(false)
let waitScrollTo = null as number | null
const onPreviewVisibleChange = (v: boolean, lv: boolean) => {
@ -157,16 +159,16 @@ export function usePreview (props: Props) {
let next = previewIdx.value
if (['ArrowDown', 'ArrowRight'].includes(e.key)) {
next++
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next++
}
} else if (['ArrowUp', 'ArrowLeft'].includes(e.key)) {
next--
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next--
}
}
if (isImageFile(sortedFiles.value[next]?.name) ?? '') {
if (isImageFile(files.value[next]?.name) ?? '') {
previewIdx.value = next
const s = scroller.value
if (s && !(next >= s.$_startIndex && next <= s.$_endIndex)) {
@ -180,16 +182,16 @@ export function usePreview (props: Props) {
let next = previewIdx.value
if (type === 'next') {
next++
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next++
}
} else if (type === 'prev') {
next--
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next--
}
}
if (isImageFile(sortedFiles.value[next]?.name) ?? '') {
if (isImageFile(files.value[next]?.name) ?? '') {
previewIdx.value = next
const s = scroller.value
if (s && !(next >= s.$_startIndex && next <= s.$_endIndex)) {
@ -202,16 +204,16 @@ export function usePreview (props: Props) {
let next = previewIdx.value
if (type === 'next') {
next++
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next++
}
} else if (type === 'prev') {
next--
while (sortedFiles.value[next] && !isImageFile(sortedFiles.value[next].name)) {
while (files.value[next] && !isImageFile(files.value[next].name)) {
next--
}
}
return isImageFile(sortedFiles.value[next]?.name) ?? ''
return isImageFile(files.value[next]?.name) ?? ''
}
return {
@ -637,9 +639,7 @@ export function useFileItemActions (
})
const q = createReactiveQueue()
const onFileItemClick = async (e: MouseEvent, file: FileNodeInfo) => {
const files = sortedFiles.value
const idx = files.findIndex((v) => v.name === file.name)
const onFileItemClick = async (e: MouseEvent, file: FileNodeInfo, idx: number) => {
previewIdx.value = idx
const idxInSelected = multiSelectedIdxs.value.indexOf(idx)
if (e.shiftKey) {
@ -818,6 +818,9 @@ export function useFileItemActions (
})
message.success(is_remove ? t('removedTagFromImage') : t('addedTagToImage'))
}
return {
}
}
return {
onFileItemClick,

View File

@ -204,19 +204,6 @@ watch(
</ASpin>
</template>
<style lang="scss" scoped>
.uninstalled-hint {
margin: 256px auto;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
&>* {
margin: 16px;
text-align: center;
}
}
.preview-switch {
position: fixed;
top: 0;