Merge pull request #805 from zanllp/feat/add-tiktok-style-view

Feat/add tiktok style view
pull/807/head
zanllp 2025-05-25 23:20:51 +08:00 committed by GitHub
commit 2ffd270e67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
77 changed files with 1586 additions and 288 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-5b5fdd56.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-3112bec6.css">
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-19e8712c.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-bd090b89.css">
</head>
<body>

View File

@ -1 +1 @@
import{d as E,bx as $,r as f,m as M,_ as T,a as c,al as W,h as m,c as v,P as z}from"./index-5b5fdd56.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,x=d.expose,o=f(a.checked===void 0?a.defaultChecked:a.checked),i=f();M(function(){return a.checked},function(){o.value=a.checked}),x({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(),g=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:g,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-19e8712c.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};

3
vue/dist/assets/FileItem-5cc588d8.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

View File

@ -0,0 +1 @@
import{d as a,U as t,V as s,c as n,cB as _,a0 as o}from"./index-19e8712c.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};

View File

@ -1 +0,0 @@
import{d as a,S as t,T as s,c as n,cx as _,Z as o}from"./index-5b5fdd56.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};

View File

@ -1 +0,0 @@
import{d as ce,m as F,ax as re,$ as pe,S as p,T as I,c as l,a2 as e,a1 as n,a4 as R,U as d,J as me,W as o,V as u,a0 as V,ad as ue,Y as _,ae as z,ag as ge,R as fe,ai as G,aN as ve,aO as he,bz as Ie,Z as _e}from"./index-5b5fdd56.js";import{S as ke}from"./index-b9a282d1.js";import{L as Ce,R as we,f as Se,_ as be}from"./MultiSelectKeep-72e9597f.js";import{c as xe,d as ye,F as Me}from"./FileItem-b2542180.js";import{c as Ae,u as Te}from"./hook-ba2adfba.js";import{a as $e}from"./functionalCallableComp-51195a3e.js";import"./shortcut-bdce38ed.js";import"./Checkbox-5fa7cbf6.js";/* empty css */import"./index-a0e30b33.js";import"./index-b6f2a43c.js";import"./_isIterateeCall-c830f443.js";import"./useGenInfoDiff-3e61c6d2.js";const De=c=>(ve("data-v-caebce58"),c=c(),he(),c),Fe={class:"hint"},Re={class:"action-bar"},Ve=De(()=>d("div",{style:{padding:"16px 0 512px"}},null,-1)),ze={key:1},Ge={class:"no-res-hint"},Be={class:"hint"},Ne={key:2,class:"preview-switch"},Ue=ce({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(c){const g=c,f=Ae(t=>Ie(g.selectedTagIds,t)),{queue:B,images:i,onContextMenuClickU:k,stackViewEl:N,previewIdx:r,previewing:C,onPreviewVisibleChange:U,previewImgMove:w,canPreview:S,itemSize:b,gridItems:J,showGenInfo:m,imageGenInfo:x,q:E,multiSelectedIdxs:v,onFileItemClick:L,scroller:y,showMenuIdx:h,onFileDragStart:O,onFileDragEnd:P,cellWidth:W,onScroll:M,saveAllFileAsJson:q,props:K,saveLoadedFileAsJson:Q,changeIndchecked:Y,seedChangeChecked:Z,getGenDiff:j,getGenDiffWatchDep:H}=Te(f);F(()=>g.selectedTagIds,async()=>{var t;await f.reset(),await re(),(t=y.value)==null||t.scrollToItem(0),M()},{immediate:!0}),F(()=>g,async t=>{K.value=t},{deep:!0,immediate:!0});const X=pe(),{onClearAllSelected:ee,onSelectAll:te,onReverseSelect:se}=xe();return(t,s)=>{const le=be,ne=ge,ae=fe,A=G,ie=G,oe=ke;return p(),I("div",{class:"container",ref_key:"stackViewEl",ref:N},[l(le,{show:!!e(v).length||e(X).keepMultiSelect,onClearAllSelected:e(ee),onSelectAll:e(te),onReverseSelect:e(se)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),l(oe,{size:"large",spinning:!e(B).isIdle},{default:n(()=>{var T,$;return[l(ae,{visible:e(m),"onUpdate:visible":s[1]||(s[1]=a=>R(m)?m.value=a:null),width:"70vw","mask-closable":"",onOk:s[2]||(s[2]=a=>m.value=!1)},{cancelText:n(()=>[]),default:n(()=>[l(ne,{active:"",loading:!e(E).isIdle},{default:n(()=>[d("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:s[0]||(s[0]=a=>e(me)(e(x)))},[d("div",Fe,o(t.$t("doubleClickToCopy")),1),u(" "+o(e(x)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),d("div",Re,[l(A,{onClick:e(Q)},{default:n(()=>[u(o(t.$t("saveLoadedImageAsJson")),1)]),_:1},8,["onClick"]),l(A,{onClick:e(q)},{default:n(()=>[u(o(t.$t("saveAllAsJson")),1)]),_:1},8,["onClick"])]),(T=e(i))!=null&&T.length?(p(),V(e(ye),{key:0,ref_key:"scroller",ref:y,class:"file-list",items:e(i),"item-size":e(b).first,"key-field":"fullpath","item-secondary-size":e(b).second,gridItems:e(J),onScroll:e(M)},{after:n(()=>[Ve]),default:n(({item:a,index:D})=>[l(Me,{idx:D,file:a,"cell-width":e(W),"show-menu-idx":e(h),"onUpdate:showMenuIdx":s[3]||(s[3]=de=>R(h)?h.value=de:null),onDragstart:e(O),onDragend:e(P),onFileItemClick:e(L),"full-screen-preview-image-url":e(i)[e(r)]?e(ue)(e(i)[e(r)]):"",selected:e(v).includes(D),onContextMenuClick:e(k),onPreviewVisibleChange:e(U),"is-selected-mutil-files":e(v).length>1,"enable-change-indicator":e(Y),"seed-change-checked":e(Z),"get-gen-diff":e(j),"get-gen-diff-watch-dep":e(H)},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files","enable-change-indicator","seed-change-checked","get-gen-diff","get-gen-diff-watch-dep"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):e(f).load&&t.selectedTagIds.and_tags.length===1&&!(($=t.selectedTagIds.folder_paths_str)!=null&&$.trim())?(p(),I("div",ze,[d("div",Ge,[d("p",Be,o(t.$t("tagSearchNoResultsMessage")),1),l(ie,{onClick:s[4]||(s[4]=a=>e($e)()),type:"primary"},{default:n(()=>[u(o(t.$t("rebuildImageIndex")),1)]),_:1})])])):_("",!0),e(C)?(p(),I("div",Ne,[l(e(Ce),{onClick:s[5]||(s[5]=a=>e(w)("prev")),class:z({disable:!e(S)("prev")})},null,8,["class"]),l(e(we),{onClick:s[6]||(s[6]=a=>e(w)("next")),class:z({disable:!e(S)("next")})},null,8,["class"])])):_("",!0)]}),_:1},8,["spinning"]),e(C)&&e(i)&&e(i)[e(r)]?(p(),V(Se,{key:0,file:e(i)[e(r)],idx:e(r),onContextMenuClick:e(k)},null,8,["file","idx","onContextMenuClick"])):_("",!0)],512)}}});const Xe=_e(Ue,[["__scopeId","data-v-caebce58"]]);export{Xe as default};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.container[data-v-067770c7]{background:var(--zp-secondary-background);position:relative}.container .action-bar[data-v-067770c7]{display:flex;align-items:center;user-select:none;gap:4px;padding:4px}.container .action-bar>*[data-v-067770c7]{flex-wrap:wrap}.container .file-list[data-v-067770c7]{list-style:none;padding:8px;overflow:auto;height:calc(var(--pane-max-height) - 40px);width:100%}.container .no-res-hint[data-v-067770c7]{height:var(--pane-max-height);display:flex;align-items:center;flex-direction:column;justify-content:center}.container .no-res-hint .hint[data-v-067770c7]{font-size:1.6em;margin-bottom:2em;text-align:center}

View File

@ -1 +0,0 @@
.container[data-v-caebce58]{background:var(--zp-secondary-background);position:relative}.container .action-bar[data-v-caebce58]{display:flex;align-items:center;user-select:none;gap:4px;padding:4px}.container .action-bar>*[data-v-caebce58]{flex-wrap:wrap}.container .file-list[data-v-caebce58]{list-style:none;padding:8px;overflow:auto;height:calc(var(--pane-max-height) - 40px);width:100%}.container .no-res-hint[data-v-caebce58]{height:var(--pane-max-height);display:flex;align-items:center;flex-direction:column;justify-content:center}.container .no-res-hint .hint[data-v-caebce58]{font-size:1.6em;margin-bottom:2em;text-align:center}

View File

@ -1 +0,0 @@
.full-screen-menu[data-v-9ad72ee9]{position:fixed;z-index:9999;background:var(--zp-primary-background);padding:8px 16px;box-shadow:0 0 4px var(--zp-secondary);border-radius:4px}.full-screen-menu .tags-container[data-v-9ad72ee9]{margin:4px 0}.full-screen-menu .tags-container .tag[data-v-9ad72ee9]{margin-right:4px;margin-bottom:4px;padding:2px 16px;border-radius:4px;display:inline-block;cursor:pointer;font-weight:700;transition:.5s all ease;border:2px solid var(--tag-color);color:var(--tag-color);background:var(--zp-primary-background);user-select:none}.full-screen-menu .tags-container .tag.selected[data-v-9ad72ee9]{background:var(--tag-color);color:#fff}.full-screen-menu .container[data-v-9ad72ee9]{height:100%;display:flex;overflow:hidden;flex-direction:column}.full-screen-menu .gen-info[data-v-9ad72ee9]{flex:1;word-break:break-all;white-space:pre-line;overflow:auto;z-index:1;padding-top:4px;position:relative}.full-screen-menu .gen-info code[data-v-9ad72ee9]{font-size:.9em;display:block;padding:4px;background:var(--zp-primary-background);border-radius:4px;margin-right:20px;white-space:pre-wrap;word-break:break-word;line-height:1.78em}.full-screen-menu .gen-info code[data-v-9ad72ee9] .short-tag{word-break:break-all;white-space:nowrap}.full-screen-menu .gen-info code[data-v-9ad72ee9] span.tag{background:var(--zp-secondary-variant-background);color:var(--zp-primary);padding:2px 4px;border-radius:6px;margin-right:6px;margin-top:4px;line-height:1.3em;display:inline-block}.full-screen-menu .gen-info code[data-v-9ad72ee9] .has-parentheses.tag{background:rgba(255,100,100,.14)}.full-screen-menu .gen-info code[data-v-9ad72ee9] span.tag:hover{background:rgba(120,0,0,.15)}.full-screen-menu .gen-info table[data-v-9ad72ee9]{font-size:1em;border-radius:4px;border-collapse:separate;margin-bottom:3em}.full-screen-menu .gen-info table tr td[data-v-9ad72ee9]:first-child{white-space:nowrap}.full-screen-menu .gen-info table td[data-v-9ad72ee9]{padding-right:14px;padding-left:4px;border-bottom:1px solid var(--zp-secondary);border-collapse:collapse}.full-screen-menu .gen-info .info-tags .info-tag[data-v-9ad72ee9]{display:inline-block;overflow:hidden;border-radius:4px;margin-right:8px;border:2px solid var(--zp-primary)}.full-screen-menu .gen-info .info-tags .name[data-v-9ad72ee9]{background-color:var(--zp-primary);color:var(--zp-primary-background);padding:4px;border-bottom-right-radius:4px}.full-screen-menu .gen-info .info-tags .value[data-v-9ad72ee9]{padding:4px}.full-screen-menu.unset-size[data-v-9ad72ee9]{width:unset!important;height:unset!important}.full-screen-menu .mouse-sensor[data-v-9ad72ee9]{position:absolute;bottom:0;right:0;transform:rotate(90deg);cursor:se-resize;z-index:1;background:var(--zp-primary-background);border-radius:2px}.full-screen-menu .mouse-sensor>*[data-v-9ad72ee9]{font-size:18px;padding:4px}.full-screen-menu .action-bar[data-v-9ad72ee9]{display:flex;align-items:center;user-select:none;gap:4px}.full-screen-menu .action-bar .icon[data-v-9ad72ee9]{font-size:1.5em;padding:2px 4px;border-radius:4px}.full-screen-menu .action-bar .icon[data-v-9ad72ee9]:hover{background:var(--zp-secondary-variant-background)}.full-screen-menu .action-bar>*[data-v-9ad72ee9]{flex-wrap:wrap}.full-screen-menu.lr[data-v-9ad72ee9]{top:var(--d25885fc)!important;right:0!important;bottom:0!important;left:100vw!important;height:unset!important;width:var(--3bd17575)!important;transition:left ease .3s}.full-screen-menu.lr.always-on[data-v-9ad72ee9],.full-screen-menu.lr.mouse-in[data-v-9ad72ee9]{left:var(--24523279)!important}.tag-alpha-item[data-v-9ad72ee9]{display:flex;margin-top:4px}.tag-alpha-item h4[data-v-9ad72ee9]{width:32px;flex-shrink:0}.sort-tag-switch[data-v-9ad72ee9]{display:inline-block;padding-right:16px;padding-left:8px;cursor:pointer;user-select:none}.sort-tag-switch span[data-v-9ad72ee9]{transition:all ease .3s;transform:scale(1.2)}.sort-tag-switch:hover span[data-v-9ad72ee9]{transform:scale(1.3)}.lr-layout-control[data-v-9ad72ee9]{display:flex;align-items:center;gap:16px;padding:4px 8px;flex-wrap:wrap;border-radius:2px;border-left:3px solid var(--zp-luminous);background-color:var(--zp-secondary-background)}.lr-layout-control .ctrl-item[data-v-9ad72ee9]{display:flex;align-items:center;gap:4px;flex-wrap:nowrap}.select-actions[data-v-b04c3508]>:not(:last-child){margin-right:4px}.float-panel[data-v-b04c3508]{position:absolute;bottom:32px;right:32px;background:var(--zp-primary-background);border-radius:4px;z-index:1000;padding:8px;box-shadow:0 0 4px var(--zp-secondary)}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.full-screen-menu[data-v-e9780c1d]{position:fixed;z-index:9999;background:var(--zp-primary-background);padding:8px 16px;box-shadow:0 0 4px var(--zp-secondary);border-radius:4px}.full-screen-menu .tags-container[data-v-e9780c1d]{margin:4px 0}.full-screen-menu .tags-container .tag[data-v-e9780c1d]{margin-right:4px;margin-bottom:4px;padding:2px 16px;border-radius:4px;display:inline-block;cursor:pointer;font-weight:700;transition:.5s all ease;border:2px solid var(--tag-color);color:var(--tag-color);background:var(--zp-primary-background);user-select:none}.full-screen-menu .tags-container .tag.selected[data-v-e9780c1d]{background:var(--tag-color);color:#fff}.full-screen-menu .container[data-v-e9780c1d]{height:100%;display:flex;overflow:hidden;flex-direction:column}.full-screen-menu .gen-info[data-v-e9780c1d]{flex:1;word-break:break-all;white-space:pre-line;overflow:auto;z-index:1;padding-top:4px;position:relative}.full-screen-menu .gen-info code[data-v-e9780c1d]{font-size:.9em;display:block;padding:4px;background:var(--zp-primary-background);border-radius:4px;margin-right:20px;white-space:pre-wrap;word-break:break-word;line-height:1.78em}.full-screen-menu .gen-info code[data-v-e9780c1d] .short-tag{word-break:break-all;white-space:nowrap}.full-screen-menu .gen-info code[data-v-e9780c1d] span.tag{background:var(--zp-secondary-variant-background);color:var(--zp-primary);padding:2px 4px;border-radius:6px;margin-right:6px;margin-top:4px;line-height:1.3em;display:inline-block}.full-screen-menu .gen-info code[data-v-e9780c1d] .has-parentheses.tag{background:rgba(255,100,100,.14)}.full-screen-menu .gen-info code[data-v-e9780c1d] span.tag:hover{background:rgba(120,0,0,.15)}.full-screen-menu .gen-info table[data-v-e9780c1d]{font-size:1em;border-radius:4px;border-collapse:separate;margin-bottom:3em}.full-screen-menu .gen-info table tr td[data-v-e9780c1d]:first-child{white-space:nowrap}.full-screen-menu .gen-info table td[data-v-e9780c1d]{padding-right:14px;padding-left:4px;border-bottom:1px solid var(--zp-secondary);border-collapse:collapse}.full-screen-menu .gen-info .info-tags .info-tag[data-v-e9780c1d]{display:inline-block;overflow:hidden;border-radius:4px;margin-right:8px;border:2px solid var(--zp-primary)}.full-screen-menu .gen-info .info-tags .name[data-v-e9780c1d]{background-color:var(--zp-primary);color:var(--zp-primary-background);padding:4px;border-bottom-right-radius:4px}.full-screen-menu .gen-info .info-tags .value[data-v-e9780c1d]{padding:4px}.full-screen-menu.unset-size[data-v-e9780c1d]{width:unset!important;height:unset!important}.full-screen-menu .mouse-sensor[data-v-e9780c1d]{position:absolute;bottom:0;right:0;transform:rotate(90deg);cursor:se-resize;z-index:1;background:var(--zp-primary-background);border-radius:2px}.full-screen-menu .mouse-sensor>*[data-v-e9780c1d]{font-size:18px;padding:4px}.full-screen-menu .action-bar[data-v-e9780c1d]{display:flex;align-items:center;user-select:none;gap:4px}.full-screen-menu .action-bar .icon[data-v-e9780c1d]{font-size:1.5em;padding:2px 4px;border-radius:4px}.full-screen-menu .action-bar .icon[data-v-e9780c1d]:hover{background:var(--zp-secondary-variant-background)}.full-screen-menu .action-bar>*[data-v-e9780c1d]{flex-wrap:wrap}.full-screen-menu.lr[data-v-e9780c1d]{top:var(--04192c09)!important;right:0!important;bottom:0!important;left:100vw!important;height:unset!important;width:var(--6d773ebc)!important;transition:left ease .3s}.full-screen-menu.lr.always-on[data-v-e9780c1d],.full-screen-menu.lr.mouse-in[data-v-e9780c1d]{left:var(--437eb380)!important}.tag-alpha-item[data-v-e9780c1d]{display:flex;margin-top:4px}.tag-alpha-item h4[data-v-e9780c1d]{width:32px;flex-shrink:0}.sort-tag-switch[data-v-e9780c1d]{display:inline-block;padding-right:16px;padding-left:8px;cursor:pointer;user-select:none}.sort-tag-switch span[data-v-e9780c1d]{transition:all ease .3s;transform:scale(1.2)}.sort-tag-switch:hover span[data-v-e9780c1d]{transform:scale(1.3)}.lr-layout-control[data-v-e9780c1d]{display:flex;align-items:center;gap:16px;padding:4px 8px;flex-wrap:wrap;border-radius:2px;border-left:3px solid var(--zp-luminous);background-color:var(--zp-secondary-background)}.lr-layout-control .ctrl-item[data-v-e9780c1d]{display:flex;align-items:center;gap:4px;flex-wrap:nowrap}.select-actions[data-v-b04c3508]>:not(:last-child){margin-right:4px}.float-panel[data-v-b04c3508]{position:absolute;bottom:32px;right:32px;background:var(--zp-primary-background);border-radius:4px;z-index:1000;padding:8px;box-shadow:0 0 4px var(--zp-secondary)}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
[data-v-b5838ec8] .float-panel{position:fixed}.regex-icon[data-v-b5838ec8]{user-select:none;padding:4px;margin:0 4px;cursor:pointer;border:1px solid var(--zp-border);border-radius:4px}.regex-icon img[data-v-b5838ec8]{height:1.5em}.regex-icon[data-v-b5838ec8]:hover{background:var(--zp-border)}.regex-icon.selected[data-v-b5838ec8]{background:var(--primary-color-1);border:1px solid var(--primary-color)}.search-bar[data-v-b5838ec8]{padding:8px 8px 0;display:flex}.search-bar.last[data-v-b5838ec8]{padding-bottom:8px}.search-bar .form-name[data-v-b5838ec8]{flex-shrink:0;padding:4px 8px}.search-bar .actions>*[data-v-b5838ec8]{margin-right:4px}.container[data-v-b5838ec8]{background:var(--zp-secondary-background);position:relative}.container .file-list[data-v-b5838ec8]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%}

View File

@ -1 +0,0 @@
[data-v-127e6fd2] .float-panel{position:fixed}.regex-icon[data-v-127e6fd2]{user-select:none;padding:4px;margin:0 4px;cursor:pointer;border:1px solid var(--zp-border);border-radius:4px}.regex-icon img[data-v-127e6fd2]{height:1.5em}.regex-icon[data-v-127e6fd2]:hover{background:var(--zp-border)}.regex-icon.selected[data-v-127e6fd2]{background:var(--primary-color-1);border:1px solid var(--primary-color)}.search-bar[data-v-127e6fd2]{padding:8px 8px 0;display:flex}.search-bar.last[data-v-127e6fd2]{padding-bottom:8px}.search-bar .form-name[data-v-127e6fd2]{flex-shrink:0;padding:4px 8px}.search-bar .actions>*[data-v-127e6fd2]{margin-right:4px}.container[data-v-127e6fd2]{background:var(--zp-secondary-background);position:relative}.container .file-list[data-v-127e6fd2]{list-style:none;padding:8px;height:100%;overflow:auto;height:var(--pane-max-height);width:100%}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{bT as i,b0 as t,dY as f,bK as n}from"./index-19e8712c.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 +0,0 @@
import{bP as i,aY as t,dI as f,bG as n}from"./index-5b5fdd56.js";function u(e,a,r){if(!i(r))return!1;var s=typeof a;return(s=="number"?t(r)&&f(a,r.length):s=="string"&&a in r)?n(r[a],e):!1}export{u as i};

View File

@ -1 +0,0 @@
import{d as F,$,cy as S,c6 as B,S as _,T as w,U as f,c as l,a1 as d,V as p,W as c,a2 as s,a0 as A,ad as R,cz as T,cA as y,y as V,z as x,ai as E,Z as U}from"./index-5b5fdd56.js";import{_ as N}from"./index-a0e30b33.js";import{u as L,a as H,f as O,F as W,d as j}from"./FileItem-b2542180.js";import"./functionalCallableComp-51195a3e.js";/* empty css */import"./_isIterateeCall-c830f443.js";import"./index-b6f2a43c.js";const q={class:"actions-panel actions"},G={class:"item"},P={key:0,class:"file-list"},Q={class:"hint"},Z=F({__name:"batchDownload",props:{tabIdx:{},paneIdx:{},id:{}},setup(J){const{stackViewEl:D}=L().toRefs(),{itemSize:h,gridItems:b,cellWidth:g}=H(),i=$(),m=O(),{selectdFiles:a}=S(m),r=B(),v=async e=>{const t=T(e);t&&m.addFiles(t.nodes)},C=async()=>{r.pushAction(async()=>{const e=await y.value.post("/zip",{paths:a.value.map(u=>u.fullpath),compress:i.batchDownloadCompress,pack_only:!1},{responseType:"blob"}),t=window.URL.createObjectURL(new Blob([e.data])),o=document.createElement("a");o.href=t,o.setAttribute("download",`iib_${new Date().toLocaleString()}.zip`),document.body.appendChild(o),o.click()})},I=async()=>{r.pushAction(async()=>{await y.value.post("/zip",{paths:a.value.map(e=>e.fullpath),compress:i.batchDownloadCompress,pack_only:!0},{responseType:"blob"}),V.success(x("success"))})},z=e=>{a.value.splice(e,1)};return(e,t)=>{const o=E,u=N;return _(),w("div",{class:"container",ref_key:"stackViewEl",ref:D,onDrop:v},[f("div",q,[l(o,{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(o,{onClick:I,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("packOnlyNotDownload")),1)]),_:1},8,["loading"]),l(o,{onClick:C,type:"primary",loading:!s(r).isIdle},{default:d(()=>[p(c(e.$t("zipDownload")),1)]),_:1},8,["loading"])]),s(a).length?(_(),A(s(j),{key:1,ref:"scroller",class:"file-list",items:s(a).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:K=>z(k),"full-screen-preview-image-url":s(R)(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 ae=U(Z,[["__scopeId","data-v-a2642a17"]]);export{ae as default};

View File

@ -0,0 +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-19e8712c.js";import{_ as N}from"./index-a973ac67.js";import{u as L,a as H,f as O,F as W,d as j}from"./FileItem-5cc588d8.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-690bd363.js";/* empty css */import"./_isIterateeCall-3b1f5f75.js";import"./index-997ad291.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

File diff suppressed because one or more lines are too long

1
vue/dist/assets/gridView-c3498bec.js vendored Normal file
View File

@ -0,0 +1 @@
import{u as w,a as k,F as y,d as x}from"./FileItem-5cc588d8.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-19e8712c.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-690bd363.js";/* empty css */import"./_isIterateeCall-3b1f5f75.js";import"./index-997ad291.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 +0,0 @@
import{u as w,a as y,F as k,d as x}from"./FileItem-b2542180.js";import{d as F,$ as b,c3 as h,r as D,bc as I,bg as C,S as z,T as E,c as n,a1 as S,a2 as e,ad as V,cz as B,cB as R,Z as T}from"./index-5b5fdd56.js";import"./functionalCallableComp-51195a3e.js";/* empty css */import"./_isIterateeCall-c830f443.js";import"./index-b6f2a43c.js";const $=F({__name:"gridView",props:{tabIdx:{},paneIdx:{},id:{},removable:{type:Boolean},allowDragAndDrop:{type:Boolean},files:{},paneKey:{}},setup(p){const o=p,d=b(),{stackViewEl:m}=w().toRefs(),{itemSize:i,gridItems:u,cellWidth:f}=y(),g=h(),a=D(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)=>(z(),E("div",{class:"container",ref_key:"stackViewEl",ref:m,onDrop:_},[n(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:S(({item:t,index:r})=>{var c;return[n(k,{idx:r,file:t,"cell-width":e(f),"enable-close-icon":o.removable,onCloseIconClick:A=>v(r),"full-screen-preview-image-url":e(V)(t),"extra-tags":(c=t==null?void 0:t.tags)==null?void 0:c.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 U=T($,[["__scopeId","data-v-f35f4802"]]);export{U as default};

1
vue/dist/assets/hook-74ed0ff1.js vendored Normal file
View File

@ -0,0 +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-19e8712c.js";import{u as L,a as Q,b as j,e as H}from"./FileItem-5cc588d8.js";import{a as T,b as U,c as W}from"./MultiSelectKeep-8852e29c.js";import{u as B}from"./useGenInfoDiff-3dcac50a.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{ak as k,r as g,l as R,k as A,L as b,E as q,c6 as G,ch as L,cl as z}from"./index-5b5fdd56.js";import{u as O,a as Q,b as j,e as H}from"./FileItem-b2542180.js";import{a as T,b as U,c as W}from"./MultiSelectKeep-72e9597f.js";import{u as B}from"./useGenInfoDiff-3e61c6d2.js";let K=0;const V=()=>++K,X=(n,i,{dataUpdateStrategy:l="replace"}={})=>{const o=k([""]),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 I=yield n(r);if(v.has(s))return v.delete(s),!1;w(i(I));const u=I.cursor;if((e===o.length-1||typeof e!="number")&&(c.value=!u.has_next,u.has_next)){const y=u.next_cursor||u.next;b(typeof y=="string"),o.push(y)}}finally{f.value===s&&(a.value=!1)}return!0}),p=()=>{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&&p(),b(!a.value),o.splice(0,o.length,""),a.value=!1,t.value=void 0,c.value=!1,s&&(yield d())}),h=()=>({next:()=>A(void 0,void 0,void 0,function*(){if(a.value)throw new Error("不允许同时迭代");return{done:!(yield d()),value:t.value}})});return R({abort:p,load:c,next:d,res:t,loading:a,cursorStack:o,reset:x,[Symbol.asyncIterator]:h,iter:{[Symbol.asyncIterator]:h}})},se=n=>k(X(n,i=>i.files,{dataUpdateStrategy:"merge"})),ne=n=>{const i=k(new Set),l=q(()=>(n.res??[]).filter(m=>!i.has(m.fullpath))),o=G(),{stackViewEl:c,multiSelectedIdxs:t,stack:a,scroller:f,props:v}=O({images:l}).toRefs(),{itemSize:w,gridItems:d,cellWidth:p,onScroll:x}=Q({fetchNext:()=>n.next()}),{showMenuIdx:h}=j(),{onFileDragStart:e,onFileDragEnd:s}=T(),{showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C}=U({openNext:L}),{previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:D,canPreview:J}=W({loadNext:()=>n.next()}),N=async(m,S,P)=>{a.value=[{curr:"",files:l.value}],await y(m,S,P)};H("removeFiles",async({paths:m})=>{m.forEach(S=>i.add(S))});const F=()=>{z(l.value)};return{images:l,scroller:f,queue:o,iter:n,onContextMenuClickU:N,stackViewEl:c,previewIdx:E,previewing:_,onPreviewVisibleChange:M,previewImgMove:D,canPreview:J,itemSize:w,gridItems:d,showGenInfo:r,imageGenInfo:I,q:u,onContextMenuClick:y,onFileItemClick:C,showMenuIdx:h,multiSelectedIdxs:t,onFileDragStart:e,onFileDragEnd:s,cellWidth:p,onScroll:x,saveLoadedFileAsJson:F,saveAllFileAsJson:async()=>{for(;!n.load;)await n.next();F()},props:v,...B()}};export{se as c,ne as u};

View File

@ -1 +1 @@
import{d as z,bx as D,at as A,ct as j,ax as k,n as V,cu as B,cv as y,e as $,c as a,_ as T,h as r,a as P,cw as M,P as b}from"./index-5b5fdd56.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=z({compatConfig:{MODE:3},name:"ASpin",inheritAttrs:!1,props:D(W(),{size:"default",spinning:!0,wrapperClassName:""}),setup:function(){return{originalUpdateSpinning:null,configProvider:A("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=V(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=B(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,w=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"),w==="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-19e8712c.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-19e8712c.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-74c8f91b.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-19e8712c.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};

1
vue/dist/assets/index-96c81583.js vendored Normal file
View File

@ -0,0 +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-19e8712c.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 +0,0 @@
import{cp as j,aw as K,d as $,j as z,c_ as E,w,r as b,E as S,m as U,u as A,o as D,ax as H,h as o,c as s,a as C,au as L,ba as W,g as _,c$ as G,P as c,d0 as x}from"./index-5b5fdd56.js";var R=K("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=$({compatConfig:{MODE:3},name:"ASwitch",__ANT_SWITCH:!0,inheritAttrs:!1,props:q(),slots:["checkedChildren","unCheckedChildren"],setup:function(n,r){var d=r.attrs,m=r.slots,B=r.expose,l=r.emit,y=z();E(function(){w(!("defaultChecked"in d),"Switch","'defaultChecked' is deprecated, please use 'v-model:checked'"),w(!("value"in d),"Switch","`value` is not validate prop, do you mean `checked`?")});var h=b(n.checked!==void 0?n.checked:d.defaultChecked),f=S(function(){return h.value===n.checkedValue});U(function(){return n.checked},function(){h.value=n.checked});var v=A("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}),D(function(){H(function(){n.autofocus&&!n.disabled&&i.value.focus()})});var k=function(e,t){n.disabled||(l("update:checked",e),l("change",e,t),y.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={},o(a,"".concat(u.value,"-small"),T.value==="small"),o(a,"".concat(u.value,"-loading"),n.loading),o(a,"".concat(u.value,"-checked"),f.value),o(a,"".concat(u.value,"-disabled"),n.disabled),o(a,u.value,!0),o(a,"".concat(u.value,"-rtl"),F.value==="rtl"),a});return function(){var a;return s(G,{insertExtraNode:!0},{default:function(){return[s("button",C(C(C({},L(n,["prefixCls","checkedChildren","unCheckedChildren","checked","autofocus","checkedValue","unCheckedValue","id","onChange","onUpdate:checked"])),d),{},{id:(a=n.id)!==null&&a!==void 0?a:y.id.value,onKeydown:M,onClick:N,onBlur:I,onMouseup:O,type:"button",role:"switch","aria-checked":h.value,disabled:n.disabled||n.loading,class:[d.class,P.value],ref:i}),[s("div",{class:"".concat(u.value,"-handle")},[n.loading?s(W,{class:"".concat(u.value,"-loading-icon")},null):null]),s("span",{class:"".concat(u.value,"-inner")},[f.value?_(m,n,"checkedChildren"):_(m,n,"unCheckedChildren")])])]}})}}});const X=j(J);export{X as _};

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

@ -0,0 +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-19e8712c.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{r as F,o as P,cq as K,at as L,E as i,av as T,aw as I,d as E,u as $,cr as _,b as y,bf as V,cs as A,al as B,h as c,c as M,a as G}from"./index-5b5fdd56.js";const W=function(){var o=F(!1);return P(function(){o.value=K()}),o};var D=Symbol("rowContextKey"),q=function(r){T(D,r)},U=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 k=function(){return{align:String,justify:String,prefixCls:String,gutter:{type:[Number,Array,Object],default:0},wrap:{type:Boolean,default:void 0}}},H=E({compatConfig:{MODE:3},name:"ARow",props:k(),setup:function(r,N){var m=N.slots,v=$("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});q({gutter:S,supportFlexGap:w,wrap:i(function(){return r.wrap})});var R=i(function(){var e;return B(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=E({compatConfig:{MODE:3},name:"ACol",props:Q(),setup:function(r,N){var m=N.slots,v=U(),d=v.gutter,h=v.supportFlexGap,j=v.wrap,x=$("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))}),B(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-19e8712c.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 +0,0 @@
import{cf as t,cg as e,ch as r,ci as n,aY as a}from"./index-5b5fdd56.js";function o(i,s){return t(e(i,s,r),i+"")}function b(i){return n(i)&&a(i)}export{o as b,b as i};

View File

@ -1 +0,0 @@
import{d as x,$,aI as g,cC as b,r as w,S as p,T as i,U as a,c as r,a1 as d,V as u,W as n,X as I,a6 as B,a2 as m,x as D,y as _,z as v,ah as V,ai as W,cD as N,Z as R}from"./index-5b5fdd56.js";/* empty css */const F={class:"container"},L={class:"actions"},T={class:"uni-desc"},U={class:"snapshot"},q=x({__name:"index",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(z){const h=$(),t=g(),f=e=>{h.tabList=D(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=V,l=W;return p(),i("div",F,[a("div",L,[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",T,n(e.$t("WorkspaceSnapshotDesc")),1),a("ul",U,[(p(!0),i(I,null,B(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 G=R(q,[["__scopeId","data-v-2c44013c"]]);export{G as default};

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 +0,0 @@
.container[data-v-571ca593]{background:var(--zp-secondary-background);height:100%;overflow:auto;display:flex;flex-direction:column}.container .actions-panel[data-v-571ca593]{padding:8px;background-color:var(--zp-primary-background)}.container .refresh-button[data-v-571ca593]{position:absolute;top:90%;left:50%;transform:translate(-50%,-50%);z-index:99;background:white;border-radius:9999px;box-shadow:0 0 20px var(--zp-secondary)}.container .file-list[data-v-571ca593]{flex:1;list-style:none;padding:8px;height:var(--pane-max-height);width:100%}.container .file-list .hint[data-v-571ca593]{text-align:center;font-size:2em;padding:30vh 128px 0}

View File

@ -0,0 +1 @@
.container[data-v-5b0001fc]{background:var(--zp-secondary-background);height:100%;overflow:auto;display:flex;flex-direction:column}.container .actions-panel[data-v-5b0001fc]{padding:8px;background-color:var(--zp-primary-background)}.container .refresh-button[data-v-5b0001fc]{position:absolute;top:90%;left:50%;transform:translate(-50%,-50%);z-index:99;background:white;border-radius:9999px;box-shadow:0 0 20px var(--zp-secondary);padding:4px;display:flex;align-items:center;gap:8px}.container .file-list[data-v-5b0001fc]{flex:1;list-style:none;padding:8px;height:var(--pane-max-height);width:100%}.container .file-list .hint[data-v-5b0001fc]{text-align:center;font-size:2em;padding:30vh 128px 0}

View File

@ -1 +0,0 @@
import{d as q,$ as H,r as x,o as J,S as p,T as b,c as t,a2 as e,U as f,a1 as r,V as M,W as v,J as Q,a4 as Y,ad as Z,ae as F,Y as R,a0 as j,cE as X,y as ee,cF as le,ai as te,ag as se,R as ie,Z as ne}from"./index-5b5fdd56.js";import{a as ae,b as oe,c as re,L as ce,R as de,f as ue,_ as me}from"./MultiSelectKeep-72e9597f.js";import{u as pe,c as fe,a as ve,F as ge,d as _e}from"./FileItem-b2542180.js";import"./functionalCallableComp-51195a3e.js";/* empty css */import"./shortcut-bdce38ed.js";import"./Checkbox-5fa7cbf6.js";import"./index-a0e30b33.js";import"./index-b6f2a43c.js";import"./_isIterateeCall-c830f443.js";const ke={class:"refresh-button"},we={class:"hint"},Ce={key:0,class:"preview-switch"},Se=q({__name:"randomImage",props:{tabIdx:{},paneIdx:{},id:{},paneKey:{}},setup(he){const V=H(),d=x(!1),n=x([]),a=n,g=async()=>{try{d.value=!0;const s=await X();s.length===0&&ee.warn("No data, please generate index in image search page first"),n.value=s}finally{d.value=!1,k()}};J(g);const{stackViewEl:A,multiSelectedIdxs:u,stack:$,scroller:z}=pe({images:n}).toRefs(),{onClearAllSelected:N,onSelectAll:B,onReverseSelect:P}=fe();ae();const{itemSize:_,gridItems:T,cellWidth:E,onScroll:k}=ve(),{showGenInfo:c,imageGenInfo:w,q:U,onContextMenuClick:D,onFileItemClick:G}=oe({openNext:le}),{previewIdx:o,previewing:C,onPreviewVisibleChange:K,previewImgMove:S,canPreview:h}=re(),y=async(s,l,m)=>{$.value=[{curr:"",files:n.value}],await D(s,l,m)};return(s,l)=>{const m=me,O=te,L=se,W=ie;return p(),b("div",{class:"container",ref_key:"stackViewEl",ref:A},[t(m,{show:!!e(u).length||e(V).keepMultiSelect,onClearAllSelected:e(N),onSelectAll:e(B),onReverseSelect:e(P)},null,8,["show","onClearAllSelected","onSelectAll","onReverseSelect"]),f("div",ke,[t(O,{onClick:g,type:"primary",loading:d.value,shape:"round"},{default:r(()=>[M(v(s.$t("shuffle")),1)]),_:1},8,["loading"])]),t(W,{visible:e(c),"onUpdate:visible":l[1]||(l[1]=i=>Y(c)?c.value=i:null),width:"70vw","mask-closable":"",onOk:l[2]||(l[2]=i=>c.value=!1)},{cancelText:r(()=>[]),default:r(()=>[t(L,{active:"",loading:!e(U).isIdle},{default:r(()=>[f("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:l[0]||(l[0]=i=>e(Q)(e(w)))},[f("div",we,v(s.$t("doubleClickToCopy")),1),M(" "+v(e(w)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),t(e(_e),{ref_key:"scroller",ref:z,class:"file-list",items:n.value.slice(),"item-size":e(_).first,"key-field":"fullpath","item-secondary-size":e(_).second,gridItems:e(T),onScroll:e(k)},{default:r(({item:i,index:I})=>[t(ge,{idx:I,file:i,"cell-width":e(E),"full-screen-preview-image-url":e(a)[e(o)]?e(Z)(e(a)[e(o)]):"",onContextMenuClick:y,onPreviewVisibleChange:e(K),"is-selected-mutil-files":e(u).length>1,selected:e(u).includes(I),onFileItemClick:e(G)},null,8,["idx","file","cell-width","full-screen-preview-image-url","onPreviewVisibleChange","is-selected-mutil-files","selected","onFileItemClick"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"]),e(C)?(p(),b("div",Ce,[t(e(ce),{onClick:l[3]||(l[3]=i=>e(S)("prev")),class:F({disable:!e(h)("prev")})},null,8,["class"]),t(e(de),{onClick:l[4]||(l[4]=i=>e(S)("next")),class:F({disable:!e(h)("next")})},null,8,["class"])])):R("",!0),e(C)&&e(a)&&e(a)[e(o)]?(p(),j(ue,{key:1,file:e(a)[e(o)],idx:e(o),onContextMenuClick:y},null,8,["file","idx"])):R("",!0)],512)}}});const ze=ne(Se,[["__scopeId","data-v-571ca593"]]);export{ze as default};

View File

@ -0,0 +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-19e8712c.js";import{u as de,c as ue,a as me,F as pe,d as fe}from"./FileItem-5cc588d8.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-8852e29c.js";import"./numInput.vue_vue_type_style_index_0_scoped_55978858_lang-690bd363.js";/* empty css */import"./_isIterateeCall-3b1f5f75.js";import"./index-997ad291.js";import"./shortcut-b5a28c6c.js";import"./Checkbox-1ea392ea.js";import"./index-a973ac67.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 +0,0 @@
import{R as y,C as v}from"./index-2869601c.js";import{cp as f,c as d,A as P,d as w,S as o,T as c,U as r,X as S,a6 as O,aE as V,a1 as b,V as u,W as p,a2 as R,ai as $,Z as x,O as H,I as _,Q as m}from"./index-5b5fdd56.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"},I={style:{flex:"1"}},k={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,O(e.records.getRecords(),i=>(o(),c("li",{key:i.id,class:"record"},[r("div",I,[V(e.$slots,"default",{record:i},void 0,!0)]),r("div",k,[d(n,{onClick:g=>e.$emit("reuseRecord",i),type:"primary"},{default:b(()=>[u(p(e.$t("restore")),1)]),_:2},1032,["onClick"]),r("div",{class:"pin",onClick:g=>e.records.switchPin(i)},[d(R(z)),u(" "+p(e.records.isPinned(i)?e.$t("unpin"):e.$t("pin")),1)],8,B)])]))),128))])])}}});const T=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 q=_(`${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{T as H,E as _,A as a,q as f,M as t};

View File

@ -0,0 +1 @@
import{R as y,C as v}from"./index-c75a6e6e.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-19e8712c.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};

2
vue/dist/assets/shortcut-b5a28c6c.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/stackView-a7fc2bdf.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)}}.base-info[data-v-afd25667]{position:absolute;padding:4px;font-size:.8em;background:var(--zp-primary-background);color:var(--zp-primary);left:0;bottom:0;border-top-right-radius:4px}.location-act[data-v-bd9da014]{margin-left:8px}.location-act .copy[data-v-bd9da014]{margin-right:4px}@media (max-width: 768px){.location-act[data-v-bd9da014]{display:flex;flex-direction:column}.location-act>*[data-v-bd9da014],.location-act .copy[data-v-bd9da014]{margin:2px}}.breadcrumb[data-v-bd9da014]{display:flex;align-items:center}.breadcrumb>*[data-v-bd9da014]{margin-right:4px}@media (max-width: 768px){.breadcrumb[data-v-bd9da014]{width:100%}.breadcrumb .ant-breadcrumb>*[data-v-bd9da014]{display:inline-block}}.container[data-v-bd9da014]{background:var(--zp-secondary-background);height:var(--pane-max-height)}.location-bar[data-v-bd9da014]{padding:4px 16px;background:var(--zp-primary-background);border-bottom:1px solid var(--zp-border);display:flex;align-items:center;justify-content:space-between}@media (max-width: 768px){.location-bar[data-v-bd9da014]{flex-direction:column}.location-bar[data-v-bd9da014] ::-webkit-scrollbar{height:2px;background-color:var(--zp-secondary-variant-background)}.location-bar .actions[data-v-bd9da014]{padding:4px 0;width:100%;overflow:auto;display:flex;align-items:center}.location-bar .actions>*[data-v-bd9da014]{flex-shrink:0}}.location-bar .actions[data-v-bd9da014]{display:flex;align-items:center;flex-shrink:0}.location-bar a.opt[data-v-bd9da014]{margin-left:8px}.view[data-v-bd9da014]{padding:8px;height:calc(100vh - 48px)}.view .file-list[data-v-bd9da014]{list-style:none;padding:8px;height:100%;overflow:auto}.hint[data-v-bd9da014]{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)}}.base-info[data-v-afd25667]{position:absolute;padding:4px;font-size:.8em;background:var(--zp-primary-background);color:var(--zp-primary);left:0;bottom:0;border-top-right-radius:4px}.location-act[data-v-c8e26f6b]{margin-left:8px}.location-act .copy[data-v-c8e26f6b]{margin-right:4px}@media (max-width: 768px){.location-act[data-v-c8e26f6b]{display:flex;flex-direction:column}.location-act>*[data-v-c8e26f6b],.location-act .copy[data-v-c8e26f6b]{margin:2px}}.breadcrumb[data-v-c8e26f6b]{display:flex;align-items:center}.breadcrumb>*[data-v-c8e26f6b]{margin-right:4px}@media (max-width: 768px){.breadcrumb[data-v-c8e26f6b]{width:100%}.breadcrumb .ant-breadcrumb>*[data-v-c8e26f6b]{display:inline-block}}.container[data-v-c8e26f6b]{background:var(--zp-secondary-background);height:var(--pane-max-height)}.location-bar[data-v-c8e26f6b]{padding:4px 16px;background:var(--zp-primary-background);border-bottom:1px solid var(--zp-border);display:flex;align-items:center;justify-content:space-between}@media (max-width: 768px){.location-bar[data-v-c8e26f6b]{flex-direction:column}.location-bar[data-v-c8e26f6b] ::-webkit-scrollbar{height:2px;background-color:var(--zp-secondary-variant-background)}.location-bar .actions[data-v-c8e26f6b]{padding:4px 0;width:100%;overflow:auto;display:flex;align-items:center}.location-bar .actions>*[data-v-c8e26f6b]{flex-shrink:0}}.location-bar .actions[data-v-c8e26f6b]{display:flex;align-items:center;flex-shrink:0}.location-bar a.opt[data-v-c8e26f6b]{margin-left:8px}.view[data-v-c8e26f6b]{padding:8px;height:calc(100vh - 48px)}.view .file-list[data-v-c8e26f6b]{list-style:none;padding:8px;height:100%;overflow:auto}.hint[data-v-c8e26f6b]{padding:4px;border:4px;background:var(--zp-secondary-background);border:1px solid var(--zp-border)}

View File

@ -0,0 +1 @@
import{u as G,g as d}from"./FileItem-5cc588d8.js";import{r as b,t as j,cq as m,cr as y,cs as D}from"./index-19e8712c.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};

View File

@ -1 +0,0 @@
import{u as C,g as d}from"./FileItem-b2542180.js";import{r as b,q as G,cm as j,cn as y,co as D}from"./index-5b5fdd56.js";const r=new Map,A=()=>{const{useEventListen:k,sortedFiles:f,getViewableAreaFiles:w}=C().toRefs(),c=b(d.defaultChangeIndchecked),u=b(d.defaultSeedChangeChecked),g=async()=>{if(await G(100),!c.value)return;const o=w.value().filter(e=>j(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=f.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>=f.value.length||f.value[t]==null||!("gen_info_obj"in f.value[t])||!("gen_info_obj"in f.value[t+e]))return a;const l=o,s=f.value[t+e].gen_info_obj;if(s==null)return a;const h=["hashes","resources"];a.diff={},a.ownFile=i.name,a.otherFile=f.value[t+e].name,a.empty=!1,u.value||h.push("seed");for(const n in l)if(!h.includes(n)){if(!(n in s)){a.diff[n]="+";continue}if(l[n]!=s[n])if(n.includes("rompt")&&l[n]!=""&&s[n]!=""){const p=l[n].split(","),m=s[n].split(",");let _=0;for(const v in p)p[v]!=m[v]&&_++;a.diff[n]=_}else a.diff[n]=[l[n],s[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-5b5fdd56.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-3112bec6.css">
<script type="module" crossorigin src="/infinite_image_browsing/fe-static/assets/index-19e8712c.js"></script>
<link rel="stylesheet" href="/infinite_image_browsing/fe-static/assets/index-bd090b89.css">
</head>
<body>

View File

@ -36,6 +36,7 @@ const tags = computed(() => {
<template v-if="file.type === 'file'">
<template v-if="isMediaFile(file.name)">
<a-menu-item key="viewGenInfo">{{ $t('viewGenerationInfo') }}</a-menu-item>
<a-menu-item key="tiktokView">{{ $t('tiktokView') }}</a-menu-item>
<a-menu-divider />
<template v-if="global.conf?.launch_mode !== 'server'">
<a-menu-item key="send2txt2img">{{ $t('sendToTxt2img') }}</a-menu-item>

View File

@ -66,7 +66,8 @@ const emit = defineEmits<{
'dragend': [event: DragEvent, idx: number],
'previewVisibleChange': [value: boolean, last: boolean],
'contextMenuClick': [e: MenuInfo, file: FileNodeInfo, idx: number],
'close-icon-click': []
'close-icon-click': [],
'tiktokView': [file: FileNodeInfo, idx: number]
}>()
const customTags = computed(() => {
@ -152,7 +153,11 @@ 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))">
@click="openVideoModal(
file,
(id) => emit('contextMenuClick', { key: `toggle-tag-${id}` } as any, file, idx),
() => emit('tiktokView', file, idx)
)">
<div class="play-icon">
<img :src="play" style="width: 40px;height: 40px;">

View File

@ -11,6 +11,7 @@ import { addCustomTag, getDbBasicInfo, rebuildImageIndex, renameFile } from '@/a
import { useTagStore } from '@/store/useTagStore'
import { useGlobalStore } from '@/store/useGlobalStore'
import { base64ToFile, video2base64 } from '@/util/video'
import { closeImageFullscreenPreview } from '@/util/imagePreviewOperation'
export const openCreateFlodersModal = (base: string) => {
const floderName = ref('')
@ -42,7 +43,11 @@ export const MultiSelectTips = () => (
</p>
)
export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| number) => void) => {
export const openVideoModal = (
file: FileNodeInfo,
onTagClick?: (id: string| number) => void,
onTiktokView?: () => void
) => {
const tagStore = useTagStore()
const global = useGlobalStore()
const isSelected = (id: string | number) => {
@ -70,7 +75,8 @@ export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| num
transition: '.5s all ease',
'user-select': 'none',
}
Modal.confirm({
const modal = Modal.confirm({
width: '80vw',
title: file.name,
icon: null,
@ -110,6 +116,13 @@ export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| num
default: t('download')
}}
</Button>
{onTiktokView && (
<Button onClick={onTiktokViewWrapper} type="primary">
{{
default: t('tiktokView')
}}
</Button>
)}
<Button onClick={onSetCurrFrameAsVideoPoster}>
{{
default: t('setCurrFrameAsVideoPoster')
@ -121,6 +134,11 @@ export const openVideoModal = (file: FileNodeInfo, onTagClick?: (id: string| num
maskClosable: true,
wrapClassName: 'hidden-antd-btns-modal'
})
function onTiktokViewWrapper() {
onTiktokView?.()
closeImageFullscreenPreview()
modal.destroy()
}
}
export const openRebuildImageIndexModal = () => {

View File

@ -126,4 +126,8 @@ export const de: Partial<IIBI18nMap> = {
imgSearch: 'Bildsuche',
send2savedDir: 'In den gespeicherten Ordner senden',
promptcompare: 'Prompts vergleichen',
'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'
}

View File

@ -58,7 +58,7 @@ You can specify which snapshot to restore to when starting IIB in the global set
copyFilePath: 'Copy file path',
previewMaskBackgroundOpacity: 'Preview Mask Background Opacity',
experimentalLRLayout: 'Experimental Side-by-Side Layout',
experimentalLRLayout: 'Side-by-Side Layout',
width: 'Width',
alwaysOnTooltipInfo: 'If this is turned off, the info panel will be hidden until you move the mouse to the right side of the screen',
alwaysOn: 'Always On',
@ -314,9 +314,10 @@ You can specify which snapshot to restore to when starting IIB in the global set
send2savedDir: 'Send to saved folder',
regexSearchEnabledHint:
'(You can also enable regex search by clicking the regex icon on the right)',
rebuildImageIndex: 'Rebuild image index',
rebuildImageIndex: 'Rebuild Image Index',
confirmRebuildImageIndex: 'Confirm rebuilding image index?',
rebuildComplete: 'Rebuild complete',
tagSearchNoResultsMessage:
'It seems like no results were found. Try rebuilding the index to remove unused tags?'
tagSearchNoResultsMessage: 'It looks like no results were matched, try rebuilding the index to remove useless tags?',
'TikTok View': 'TikTok View',
tiktokView: 'TikTok View'
}

View File

@ -1,4 +1,3 @@
export const zhHans = {
tryMyLuck: '试试手气',
randomImage: '随机图像',
@ -55,7 +54,7 @@ export const zhHans = {
copySuccess: '复制成功',
copyFilePath: '复制文件路径',
previewMaskBackgroundOpacity: '预览遮罩背景透明度',
experimentalLRLayout: '实验性并列布局',
experimentalLRLayout: '并列布局',
width: '宽度',
alwaysOnTooltipInfo: '若关闭此项,信息面板将收起,直至鼠标移动至屏幕右侧时才打开',
alwaysOn: '常驻',
@ -198,7 +197,7 @@ export const zhHans = {
copyPrompt: '复制提示',
copyPositivePrompt: '复制正向提示',
refreshCompleted: '刷新完成',
'walk-mode-move-message': '在walk模式下仅允许使用“快速移动”移动位置',
'walk-mode-move-message': '在walk模式下仅允许使用"快速移动"移动位置',
manualExitFullScreen: '你删除了最后一张图片,也许需要你手动退出全屏查看',
copied: '已复制!',
'index.expired': '索引过期,正在自动更新',
@ -270,7 +269,7 @@ export const zhHans = {
livePreview: '实时预览',
other: '其他',
ImageBrowsingSettings: '图像浏览设置',
majorUpdateCustomCellSizeTips: '重大更新:你可以自定义网格图像的大小了,在全局设置页或者右上角的“更多”里面进行调整',
majorUpdateCustomCellSizeTips: '重大更新:你可以自定义网格图像的大小了,在全局设置页或者右上角的"更多"里面进行调整',
desktop: '桌面',
move: '移动',
inputFolderName: '输入文件夹名',
@ -278,7 +277,7 @@ export const zhHans = {
sendToThirdPartyExtension: '发送到第三方拓展',
lyco: 'LyCORIS',
batchDownloaDDragAndDropHint:
'使用拖拽或者右键菜单中的“发送到批量下载”将其他页面的图片添加到这里,支持多选',
'使用拖拽或者右键菜单中的"发送到批量下载"将其他页面的图片添加到这里,支持多选',
zipDownload: '打包成zip下载',
archive: '归档',
batchDownload: '批量下载',
@ -292,10 +291,12 @@ export const zhHans = {
dragToResizePanel: '按住并拖动来调整面板的大小',
clickToToggleMaximizeMinimize: '单击切换最大化/最小化',
dragToMovePanel: '按住并拖动来移动面板',
imageCompareTips: '拖拽文件时也会出现这个面板,可以不需要打开 “图像对比” 功能',
imageCompareTips: '拖拽文件时也会出现这个面板,可以不需要打开 "图像对比" 功能',
regexSearchEnabledHint: '(你也可以通过点击右侧的正则式图标来启用正则式搜索)',
confirmRebuildImageIndex: '确认重建图像索引?',
rebuildComplete: '重新构建完成',
rebuildImageIndex: '重新构建图像索引',
tagSearchNoResultsMessage: '看起来没匹配到任何结果尝试通过重新构建索引来去掉无用的tag'
tagSearchNoResultsMessage: '看起来没匹配到任何结果尝试通过重新构建索引来去掉无用的tag',
'TikTok View': '抖音式浏览',
tiktokView: '抖音式浏览'
}

View File

@ -58,7 +58,7 @@ export const zhHant: Partial<IIBI18nMap> = {
copyFilePath: '複製文件路徑',
previewMaskBackgroundOpacity: '預覽遮罩背景透明度',
experimentalLRLayout: '實驗性並列布局',
experimentalLRLayout: '並列布局',
width: '寬度',
alwaysOnTooltipInfo: '若關閉此項,信息面板將收起,直至滑鼠移動至屏幕右側時才打開',
alwaysOn: '常駐',
@ -204,7 +204,7 @@ export const zhHant: Partial<IIBI18nMap> = {
copyPrompt: '複製提示',
copyPositivePrompt: '複製正向提示',
refreshCompleted: '重新整理完成',
'walk-mode-move-message': '在walk模式下僅允許使用“快速移動”移動位置',
'walk-mode-move-message': '在walk模式下僅允許使用"快速移動"移動位置',
manualExitFullScreen: '你刪除了最後一張圖片,也許需要你手動退出全螢幕檢視',
copied: '已複製!',
'index.expired': '索引過期,正在自動更新',
@ -274,7 +274,7 @@ export const zhHant: Partial<IIBI18nMap> = {
ImageBrowsingSettings: '圖片瀏覽設置',
majorUpdateCustomCellSizeTips:
'重大更新:你可以自定義網格圖像的大小了,在全域設置頁或者右上角的“更多”裡面進行調整',
'重大更新:你可以自定義網格圖像的大小了,在全域設置頁或者右上角的"更多"裡面進行調整',
desktop: '桌面',
move: '移動',
inputFolderName: '輸入文件夾名稱',
@ -282,7 +282,7 @@ export const zhHant: Partial<IIBI18nMap> = {
sendToThirdPartyExtension: '發送到第三方拓展',
lyco: 'LyCORIS',
batchDownloaDDragAndDropHint:
'使用拖拽或者右鍵功能表中的“發送到批量下載”將其他頁面的圖片添加到這裡,支持多選',
'使用拖拽或者右鍵功能表中的"發送到批量下載"將其他頁面的圖片添加到這裡,支持多選',
zipDownload: '打包成zip下載',
archive: '歸檔',
batchDownload: '批量下載',
@ -296,10 +296,12 @@ export const zhHant: Partial<IIBI18nMap> = {
dragToResizePanel: '按住並拖動來調整面板的大小',
clickToToggleMaximizeMinimize: '單擊切換最大化/最小化',
dragToMovePanel: '按住並拖動來移動面板',
imageCompareTips: '拖拽文件時也會出現這個面板,可以不需要打開 “圖片對比” 功能',
imageCompareTips: '拖拽文件時也會出現這個面板,可以不需要打開 "圖片對比" 功能',
regexSearchEnabledHint: '(你也可以通過點擊右側的正則式圖標來啟用正則式搜索)',
confirmRebuildImageIndex: '確認重建圖像索引?',
rebuildImageIndex: '重新構建圖像索引',
rebuildComplete: '重新構建完成',
tagSearchNoResultsMessage: '看起來沒有匹配到任何結果,嘗試通過重新構建索引來去除無用的標籤?'
tagSearchNoResultsMessage: '看起來沒有匹配到任何結果,嘗試通過重新構建索引來去除無用的標籤?',
'TikTok View': '抖音式瀏覽',
tiktokView: '抖音式觀看'
}

View File

@ -1,5 +1,6 @@
<script setup lang="ts">
import DraggingPort from './DraggingPort.vue'
import TiktokViewer from './TiktokViewer.vue'
import { useImgSliStore } from '@/store/useImgSli'
import ImgSliSplitPane from './ImgSliComparePane.vue'
import { ref } from 'vue'
@ -20,6 +21,7 @@ const splitpane = ref<{ requestFullScreen (): void }>()
</template>
</ADrawer>
<DraggingPort />
<TiktokViewer />
</template>

View File

@ -0,0 +1,982 @@
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue'
import { useTiktokStore, type TiktokMediaItem } from '@/store/useTiktokStore'
import { useTagStore } from '@/store/useTagStore'
import { useGlobalStore } from '@/store/useGlobalStore'
import { useLocalStorage } from '@vueuse/core'
import { isVideoFile } from '@/util'
import { openAddNewTagModal } from '@/components/functionalCallableComp'
import { toggleCustomTagToImg } from '@/api/db'
import { message } from 'ant-design-vue'
import {
CloseOutlined,
FullscreenOutlined,
FullscreenExitOutlined,
UpOutlined,
DownOutlined,
TagsOutlined,
SoundOutlined,
SoundFilled,
HeartOutlined,
HeartFilled
} from '@/icon'
import { t } from '@/i18n'
import type { StyleValue } from 'vue'
import { throttle } from 'lodash-es'
import { delay } from 'vue3-ts-util'
const tiktokStore = useTiktokStore()
const tagStore = useTagStore()
const global = useGlobalStore()
// 使 @vueuse
const isMuted = useLocalStorage('tiktok-viewer-muted', true) //
//
const isMac = computed(() => {
return /Mac|iPhone|iPad|iPod/.test(navigator.userAgent) ||
navigator.platform.toUpperCase().indexOf('MAC') >= 0
})
//
const getAnimationDelay = (isTriggerByTouch: boolean) => {
return isMac.value && !isTriggerByTouch ? 700 : 300 // Mac使1000ms300ms
}
//
const containerRef = ref<HTMLElement>()
const viewportRef = ref<HTMLElement>()
const videoRefs = ref<(HTMLVideoElement | null)[]>([null, null, null]) //
// 3buffer
const bufferItems = ref<(TiktokMediaItem | null)[]>([null, null, null]) // [prev, current, next]
const bufferTransform = ref(0) //
const isAnimating = ref(false) //
const touchStartY = ref(0)
const touchCurrentY = ref(0)
const isDragging = ref(false)
const dragOffset = ref(0) //
// TAG
const showTags = ref(false)
//
const currentItem = computed(() => bufferItems.value[1]) //
const containerClass = computed(() => {
return {
'tiktok-viewer': true,
'tiktok-viewer--fullscreen': tiktokStore.isFullscreen,
'tiktok-viewer--floating': !tiktokStore.isFullscreen,
'tiktok-viewer--mobile': tiktokStore.isMobile
}
})
// buffer
const getItemStyle = (index: number): StyleValue => {
const baseTransform = (index - 1) * 100 // -100%, 0%, 100%
const currentTransform = bufferTransform.value + dragOffset.value
const totalTransform = baseTransform + currentTransform
return {
transform: `translateY(${totalTransform}%)`,
transition: isAnimating.value && !isDragging.value ? 'transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)' : 'none'
}
}
//
const controlVideoPlayback = async () => {
await delay(30)
for (let index = 0; index < videoRefs.value.length; index++) {
const video = videoRefs.value[index]
if (!video) continue
try {
if (index === 1) {
//
video.currentTime = 0 //
video.muted = isMuted.value //
await video.play()
} else {
//
video.pause()
video.currentTime = 0
}
} catch (err) {
console.warn(`视频播放控制失败 (index: ${index}):`, err)
}
}
}
// buffer
const updateBuffer = () => {
const currentIndex = tiktokStore.currentIndex
const list = tiktokStore.mediaList
bufferItems.value = [
currentIndex > 0 ? list[currentIndex - 1] : null, // prev
list[currentIndex] || null, // current
currentIndex < list.length - 1 ? list[currentIndex + 1] : null // next
]
// DOM
nextTick(() => {
controlVideoPlayback()
})
}
// TAG
const isTagSelected = (tagId: string | number) => {
const currentUrl = currentItem.value?.url
if (!currentUrl) return false
const fullpath = (currentItem.value as any)?.fullpath || currentItem.value?.id
return !!tagStore.tagMap.get(fullpath)?.some(v => v.id === tagId)
}
// Like
const likeTag = computed(() => {
return global.conf?.all_custom_tags?.find(v => v.type === 'custom' && v.name === 'like')
})
const isLiked = computed(() => {
if (!likeTag.value) return false
return isTagSelected(likeTag.value.id)
})
const toggleLike = async () => {
if (!likeTag.value) return
await onTagClick(likeTag.value.id)
}
const onTagClick = async (tagId: string | number) => {
const currentUrl = currentItem.value?.url
if (!currentUrl) return
try {
const fullpath = (currentItem.value as any)?.fullpath || currentItem.value?.id
const { is_remove } = await toggleCustomTagToImg({
tag_id: Number(tagId),
img_path: fullpath
})
const tag = global.conf?.all_custom_tags.find((v) => v.id === tagId)?.name || '标签'
await tagStore.refreshTags([fullpath])
message.success(t(is_remove ? 'removedTagFromImage' : 'addedTagToImage', { tag }))
} catch (error) {
console.error('Toggle tag error:', error)
message.error('标签操作失败')
}
}
const tagBaseStyle: StyleValue = {
margin: '4px',
padding: '8px 16px',
borderRadius: '20px',
display: 'inline-block',
cursor: 'pointer',
fontWeight: 'bold',
transition: '0.3s all ease',
userSelect: 'none',
fontSize: '14px'
}
//
const goToPrev = (isTriggerByTouch: boolean = false) => {
if (isAnimating.value || !tiktokStore.hasPrev) return
isAnimating.value = true
//
dragOffset.value = 0
bufferTransform.value = 100 //
setTimeout(() => {
tiktokStore.prev()
updateBuffer()
bufferTransform.value = 0
//
setTimeout(() => {
isAnimating.value = false
}, getAnimationDelay(isTriggerByTouch))
}, 200) //
}
//
const goToNext = (isTriggerByTouch: boolean = false) => {
if (isAnimating.value || !tiktokStore.hasNext) return
isAnimating.value = true
//
dragOffset.value = 0
bufferTransform.value = -100 //
setTimeout(() => {
tiktokStore.next()
updateBuffer()
bufferTransform.value = 0
//
setTimeout(() => {
isAnimating.value = false
}, getAnimationDelay(isTriggerByTouch))
}, 200) //
}
//
const handleTouchStart = (e: TouchEvent) => {
if (isAnimating.value) return
touchStartY.value = e.touches[0].clientY
touchCurrentY.value = e.touches[0].clientY
isDragging.value = true
dragOffset.value = 0
// transform
if (bufferTransform.value !== 0) {
bufferTransform.value = 0
}
}
const handleTouchMove = (e: TouchEvent) => {
if (!isDragging.value || isAnimating.value) return
touchCurrentY.value = e.touches[0].clientY
const deltaY = touchCurrentY.value - touchStartY.value
const maxDrag = window.innerHeight * 0.5 // 50%
//
dragOffset.value = Math.max(-maxDrag, Math.min(maxDrag, deltaY * 0.5))
//
e.preventDefault()
}
const handleTouchEnd = () => {
if (!isDragging.value) return
const deltaY = touchCurrentY.value - touchStartY.value
const threshold = 80 //
//
isDragging.value = false
if (isAnimating.value) {
//
dragOffset.value = 0
return
}
if (Math.abs(deltaY) > threshold) {
if (deltaY > 0 && tiktokStore.hasPrev) {
//
goToPrev(true)
} else if (deltaY < 0 && tiktokStore.hasNext) {
//
goToNext(true)
} else {
// -
resetToCenter()
}
} else {
// -
resetToCenter()
}
}
//
const handleTouchCancel = () => {
if (!isDragging.value) return
isDragging.value = false
if (!isAnimating.value) {
resetToCenter()
}
}
//
const resetToCenter = () => {
if (isAnimating.value) return
isAnimating.value = true
dragOffset.value = 0
// bufferTransform
bufferTransform.value = 0
setTimeout(() => {
isAnimating.value = false
}, 300) // CSS
}
// //
// const fixMisalignment = () => {
// if (isDragging.value) return
// //
// if (bufferTransform.value !== 0 || dragOffset.value !== 0) {
// //
// bufferTransform.value = 0
// dragOffset.value = 0
// // buffer
// updateBuffer()
// }
// //
// if (isAnimating.value) {
// isAnimating.value = false
// }
// }
//
const handleWheel = throttle((e: WheelEvent) => {
if (isAnimating.value) return
e.preventDefault()
if (e.deltaY > 0 && tiktokStore.hasNext) {
goToNext()
} else if (e.deltaY < 0 && tiktokStore.hasPrev) {
goToPrev()
}
}, 500)
//
const handleKeydown = (e: KeyboardEvent) => {
if (isAnimating.value) return
switch (e.key) {
case 'ArrowUp':
e.preventDefault()
if (tiktokStore.hasPrev) goToPrev()
break
case 'ArrowDown':
e.preventDefault()
if (tiktokStore.hasNext) goToNext()
break
case 'Escape':
e.preventDefault()
tiktokStore.closeView()
break
case 'F11':
e.preventDefault()
handleFullscreenToggle()
break
case 'l':
case 'L':
e.preventDefault()
if (likeTag.value) toggleLike()
break
}
}
//
const handleFullscreenToggle = async () => {
if (tiktokStore.isFullscreen) {
await exitFullscreen()
} else {
await requestFullscreen()
}
}
//
const requestFullscreen = async () => {
if (containerRef.value && !document.fullscreenElement) {
try {
await containerRef.value.requestFullscreen()
tiktokStore.isFullscreen = true
} catch (err) {
console.warn('无法进入全屏模式:', err)
}
}
}
// 退
const exitFullscreen = async () => {
if (document.fullscreenElement) {
try {
await document.exitFullscreen()
tiktokStore.isFullscreen = false
} catch (err) {
console.warn('无法退出全屏模式:', err)
}
}
}
//
const toggleMute = () => {
isMuted.value = !isMuted.value
//
const currentVideo = videoRefs.value[1]
if (currentVideo) {
currentVideo.muted = isMuted.value
}
}
//
const handleFullscreenChange = () => {
tiktokStore.isFullscreen = !!document.fullscreenElement
}
//
const preloadMedia = () => {
bufferItems.value.forEach(item => {
if (!item) return
if (isVideoFile(item.url)) {
const video = document.createElement('video')
video.preload = 'metadata'
video.src = item.url
} else {
const img = new Image()
img.src = item.url
}
})
}
//
const loadCurrentItemTags = async () => {
const currentItem = tiktokStore.currentItem
if (!currentItem) return
const fullpath = (currentItem as any)?.fullpath || currentItem.id
if (fullpath) {
await tagStore.fetchImageTags([fullpath])
}
}
//
onMounted(() => {
document.addEventListener('keydown', handleKeydown)
document.addEventListener('fullscreenchange', handleFullscreenChange)
updateBuffer()
})
onUnmounted(() => {
document.removeEventListener('keydown', handleKeydown)
document.removeEventListener('fullscreenchange', handleFullscreenChange)
//
videoRefs.value.forEach(video => {
if (video) {
video.pause()
}
})
})
//
watch(() => tiktokStore.currentIndex, () => {
updateBuffer()
nextTick(() => {
preloadMedia()
loadCurrentItemTags()
})
}, { immediate: true })
//
watch(() => tiktokStore.mediaList, () => {
updateBuffer()
}, { deep: true })
//
watch(() => tiktokStore.visible, (visible) => {
if (!visible) {
//
videoRefs.value.forEach(video => {
if (video) {
video.pause()
}
})
// 退
if (document.fullscreenElement) {
exitFullscreen()
}
} else {
//
nextTick(() => {
controlVideoPlayback()
})
}
})
//
watch(() => isMuted.value, (muted) => {
videoRefs.value.forEach(video => {
if (video) {
video.muted = muted
}
})
})
</script>
<template>
<Teleport to="body">
<div
v-if="tiktokStore.visible"
ref="containerRef"
:class="containerClass"
@touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
@touchcancel="handleTouchCancel"
@wheel="handleWheel"
>
<!-- 媒体内容区域 -->
<div ref="viewportRef" class="tiktok-viewport">
<!-- 3位buffer渲染 -->
<div
v-for="(item, index) in bufferItems"
:key="item?.id || `empty-${index}`"
class="tiktok-media-item"
:style="getItemStyle(index)"
>
<div v-if="item" class="media-content">
<!-- 视频 -->
<video
v-if="isVideoFile(item.url)"
class="tiktok-media"
:src="item.url"
:controls="index === 1"
:loop="index === 1"
playsinline
preload="metadata"
:ref="(el) => { if (el) videoRefs[index] = el as HTMLVideoElement }"
/>
<!-- 图片 -->
<img
v-else
class="tiktok-media"
:src="item.url"
/>
</div>
</div>
</div>
<!-- 控制按钮区域 -->
<div class="tiktok-controls">
<!-- 关闭按钮 -->
<button
class="control-btn close-btn"
@click="tiktokStore.closeView"
:title="$t('close')"
>
<CloseOutlined />
</button>
<!-- 全屏切换按钮 -->
<button
class="control-btn fullscreen-btn"
@click="handleFullscreenToggle"
:title="tiktokStore.isFullscreen ? $t('exitFullscreen') : $t('fullscreen')"
>
<FullscreenExitOutlined v-if="tiktokStore.isFullscreen" />
<FullscreenOutlined v-else />
</button>
<!-- 声音切换按钮 -->
<button
class="control-btn sound-btn"
@click="toggleMute"
:title="isMuted ? '开启声音' : '关闭声音'"
>
<SoundFilled v-if="!isMuted" />
<SoundOutlined v-else />
</button>
<!-- Like 按钮 -->
<button
v-if="likeTag"
class="control-btn like-btn"
:class="{ 'like-active': isLiked }"
@click="toggleLike"
:title="isLiked ? '取消喜欢' : '喜欢'"
>
<HeartFilled v-if="isLiked" />
<HeartOutlined v-else />
</button>
<!-- TAG 按钮 -->
<button
class="control-btn tags-btn"
@click="showTags = !showTags"
:title="$t('tags')"
>
<TagsOutlined />
</button>
</div>
<!-- 导航指示器 -->
<div class="tiktok-navigation">
<!-- 上一个指示器 -->
<div
v-if="tiktokStore.hasPrev"
class="nav-indicator nav-prev"
@touchstart.prevent="goToPrev(false)"
@click="goToPrev(false)"
>
<UpOutlined />
</div>
<!-- 下一个指示器 -->
<div
v-if="tiktokStore.hasNext"
class="nav-indicator nav-next"
@touchstart.prevent="goToNext(false)"
@click="goToNext(false)"
>
<DownOutlined />
</div>
</div>
<!-- 进度指示器 -->
<div class="tiktok-progress">
<div class="progress-bar">
<div
class="progress-fill"
:style="{
width: `${((tiktokStore.currentIndex + 1) / tiktokStore.mediaList.length) * 100}%`
}"
/>
</div>
<span class="progress-text">
{{ tiktokStore.currentIndex + 1 }} / {{ tiktokStore.mediaList.length }}
</span>
</div>
<!-- TAG 面板 -->
<Transition name="slide-up">
<div v-if="showTags" class="tiktok-tags-panel">
<div class="tags-header">
<h3>{{ $t('tags') }}</h3>
<button @click="showTags = false" class="close-tags">
<CloseOutlined />
</button>
</div>
<div class="tags-content">
<!-- 添加新标签 -->
<div
@click="openAddNewTagModal"
:style="{
background: 'var(--zp-primary-background)',
color: 'var(--zp-luminous)',
border: '2px solid var(--zp-luminous)',
...tagBaseStyle
}"
>
{{ $t('addNewCustomTag') }}
</div>
<!-- 现有标签 -->
<div
v-for="tag in global.conf?.all_custom_tags || []"
:key="tag.id"
@click="onTagClick(tag.id)"
:style="{
background: isTagSelected(tag.id) ? tagStore.getColor(tag) : 'var(--zp-primary-background)',
color: !isTagSelected(tag.id) ? tagStore.getColor(tag) : 'white',
border: `2px solid ${tagStore.getColor(tag)}`,
...tagBaseStyle
}"
>
{{ tag.name }}
</div>
</div>
</div>
</Transition>
</div>
</Teleport>
</template>
<style lang="scss" scoped>
.tiktok-viewer {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
background: #000;
display: flex;
flex-direction: column;
overflow: hidden;
user-select: none;
&--floating {
background: rgba(0, 0, 0, 0.95);
backdrop-filter: blur(10px);
}
&--mobile {
.tiktok-controls {
bottom: 20px;
right: 20px;
}
}
}
.tiktok-viewport {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.tiktok-media-item {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
will-change: transform;
}
.media-content {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.tiktok-media {
max-width: 100%;
max-height: 100%;
object-fit: contain;
border-radius: 0;
}
.tiktok-controls {
position: absolute;
top: 20px;
right: 20px;
display: flex;
flex-direction: column;
gap: 12px;
z-index: 10;
}
.control-btn {
width: 48px;
height: 48px;
border: none;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
&:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.1);
}
&:active {
transform: scale(0.95);
}
&.like-btn {
&.like-active {
background: rgba(255, 20, 147, 0.3); //
color: #ff1493; //
&:hover {
background: rgba(255, 20, 147, 0.5);
transform: scale(1.15); //
}
}
&:not(.like-active):hover {
color: #ff69b4; //
}
}
}
.tiktok-navigation {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 20px;
z-index: 10;
}
.nav-indicator {
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
z-index: 999;
&:hover {
background: rgba(255, 255, 255, 0.5);
transform: scale(1.1);
}
&.nav-fix {
background: rgba(255, 165, 0, 0.3); //
&:hover {
background: rgba(255, 165, 0, 0.5);
}
}
}
.tiktok-progress {
position: absolute;
bottom: 20px;
left: 20px;
right: 20px;
display: flex;
align-items: center;
gap: 12px;
z-index: 10;
}
.progress-bar {
flex: 1;
height: 4px;
background: rgba(255, 255, 255, 0.3);
border-radius: 2px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: #fff;
transition: width 0.3s ease;
}
.progress-text {
color: white;
font-size: 14px;
min-width: 60px;
text-align: right;
}
.tiktok-tags-panel {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(20px);
border-radius: 20px 20px 0 0;
padding: 20px;
max-height: 60vh;
overflow-y: auto;
z-index: 20;
}
.tags-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
color: white;
h3 {
margin: 0;
font-size: 18px;
}
.close-tags {
background: none;
border: none;
color: white;
font-size: 20px;
cursor: pointer;
padding: 4px;
}
}
.tags-content {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
//
.slide-up-enter-active,
.slide-up-leave-active {
transition: all 0.3s ease;
}
.slide-up-enter-from {
transform: translateY(100%);
opacity: 0;
}
.slide-up-leave-to {
transform: translateY(100%);
opacity: 0;
}
//
@media (max-width: 768px) {
.tiktok-controls {
top: 40px;
right: 15px;
gap: 10px;
}
.control-btn {
width: 44px;
height: 44px;
font-size: 18px;
}
.tiktok-navigation {
right: 15px;
}
.nav-indicator {
width: 36px;
height: 36px;
}
.tiktok-progress {
bottom: 80px;
left: 15px;
right: 15px;
}
.tiktok-tags-panel {
padding: 15px;
max-height: 50vh;
}
}
</style>

View File

@ -13,6 +13,7 @@ import { useImageSearch, createImageSearchIter } from './hook'
import { openRebuildImageIndexModal } from '@/components/functionalCallableComp'
import { useGlobalStore } from '@/store/useGlobalStore'
import { useKeepMultiSelect } from '../fileTransfer/hook'
import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
const props = defineProps<{
tabIdx: number
@ -78,6 +79,15 @@ watch(
const g = useGlobalStore()
const { onClearAllSelected, onSelectAll, onReverseSelect } = useKeepMultiSelect()
// TikTok View
const onTiktokViewClick = () => {
if (images.value.length === 0) {
return
}
//
openTiktokViewWithFiles(images.value, 0)
}
</script>
<template>
<div class="container" ref="stackViewEl">
@ -104,6 +114,7 @@ const { onClearAllSelected, onSelectAll, onReverseSelect } = useKeepMultiSelect(
</ASkeleton>
</AModal>
<div class="action-bar">
<a-button @click="onTiktokViewClick" type="primary" :disabled="!images?.length">{{ $t('tiktokView') }}</a-button>
<a-button @click="saveLoadedFileAsJson">{{ $t('saveLoadedImageAsJson') }}</a-button>
<a-button @click="saveAllFileAsJson">{{ $t('saveAllAsJson') }}</a-button>
@ -131,6 +142,7 @@ const { onClearAllSelected, onSelectAll, onReverseSelect } = useKeepMultiSelect(
@dragstart="onFileDragStart"
@dragend="onFileDragEnd"
@file-item-click="onFileItemClick"
@tiktok-view="(_file, idx) => openTiktokViewWithFiles(images, idx)"
:full-screen-preview-image-url="
images[previewIdx] ? toRawFileUrl(images[previewIdx]) : ''
"

View File

@ -17,6 +17,7 @@ import MultiSelectKeep from '@/components/MultiSelectKeep.vue'
import { useGlobalStore } from '@/store/useGlobalStore'
import HistoryRecord from '@/components/HistoryRecord.vue'
import { fuzzySearchHistory, FuzzySearchHistoryRecord } from '@/store/searchHistory'
import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
const props = defineProps<{ tabIdx: number; paneIdx: number, searchScope?: string }>()
const isRegex = ref(false)
@ -249,6 +250,7 @@ const { onClearAllSelected, onSelectAll, onReverseSelect } = useKeepMultiSelect(
:full-screen-preview-image-url="images[previewIdx] ? toRawFileUrl(images[previewIdx]) : ''"
:cell-width="cellWidth" :selected="multiSelectedIdxs.includes(idx)"
@context-menu-click="onContextMenuClickU" @dragstart="onFileDragStart" @dragend="onFileDragEnd"
@tiktok-view="(_file, idx) => openTiktokViewWithFiles(images, idx)"
:enable-change-indicator="changeIndchecked"
:seed-change-checked="seedChangeChecked"
:get-gen-diff="getGenDiff"

View File

@ -248,6 +248,14 @@ const tagAlphabet = computed(() => {
return res
})
//
const onTiktokViewClick = () => {
//
//
closeImageFullscreenPreview()
emit('contextMenuClick', { key: 'tiktokView' } as any, props.file, props.idx)
}
</script>
<template>
@ -314,6 +322,8 @@ const tagAlphabet = computed(() => {
<a-menu-item key="previewInNewWindow">{{ $t('previewInNewWindow') }}</a-menu-item>
<a-menu-item key="copyPreviewUrl">{{ $t('copySourceFilePreviewLink') }}</a-menu-item>
<a-menu-item key="copyFilePath">{{ $t('copyFilePath') }}</a-menu-item>
<a-menu-divider />
<a-menu-item key="tiktokView" @click="onTiktokViewClick">{{ $t('tiktokView') }}</a-menu-item>
</a-menu>
</template>
</a-dropdown>
@ -325,6 +335,13 @@ const tagAlphabet = computed(() => {
<a-button @click="copyPositivePrompt" v-if="imageGenInfo">{{
$t('copyPositivePrompt')
}}</a-button>
<a-button
@click="onTiktokViewClick"
@touchstart.prevent="onTiktokViewClick"
type="default"
>
{{ $t('tiktokView') }}
</a-button>
</div>
</div>
<div class="gen-info" v-if="showFullContent">

View File

@ -21,6 +21,7 @@ import { getShortcutStrFromEvent } from '@/util/shortcut'
import { MultiSelectTips, openAddNewTagModal, openRenameFileModal } from '@/components/functionalCallableComp'
import { batchDownload, events, imgTransferBus, stackCache, tagStore, useEventListen, useHookShareState, global } from '.'
import { closeImageFullscreenPreview, openImageFullscreenPreview } from '@/util/imagePreviewOperation'
import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
export function useFileItemActions (
@ -304,6 +305,11 @@ export function useFileItemActions (
imageGenInfo.value = await q.pushAction(() => getImageGenerationInfo(file.fullpath)).res
break
}
case 'tiktokView': {
// 打开 TikTok 式观看,从当前文件开始
openTiktokViewWithFiles(sortedFiles.value, idx)
break
}
case 'openWithLocalFileBrowser': {
await openFolder(file.fullpath)
break

View File

@ -16,6 +16,7 @@ import {
} from './hook'
import { SearchSelect } from 'vue3-ts-util'
import { toRawFileUrl } from '@/util/file'
import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
import 'multi-nprogress/nprogress.css'
// @ts-ignore
@ -78,6 +79,15 @@ const { showMenuIdx } = useMobileOptimization()
const { onClearAllSelected, onReverseSelect, onSelectAll } = useKeepMultiSelect()
const { getGenDiff, changeIndchecked, seedChangeChecked, getRawGenParams, getGenDiffWatchDep } = useGenInfoDiff()
// TikTok View
const onTiktokViewClick = () => {
if (sortedFiles.value.length === 0) {
return
}
//
openTiktokViewWithFiles(sortedFiles.value, previewIdx.value || 0)
}
watch(
() => props,
() => {
@ -135,6 +145,7 @@ watch(
</div>
</div>
<div class="actions">
<a class="opt" @click.prevent="onTiktokViewClick">{{ $t('TikTok View') }}</a>
<a class="opt" @click.prevent="refresh"> {{ $t('refresh') }} </a>
<a class="opt" @click.prevent="onPollRefreshClick"> {{ polling ? $t('stopPollRefresh') : $t('pollRefresh') }} </a>
<a-dropdown>
@ -227,6 +238,7 @@ watch(
v-model:show-menu-idx="showMenuIdx" :selected="multiSelectedIdxs.includes(idx)" :cell-width="cellWidth"
@file-item-click="onFileItemClick" @dragstart="onFileDragStart" @dragend="onFileDragEnd"
@preview-visible-change="onPreviewVisibleChange" @context-menu-click="onContextMenuClick"
@tiktok-view="(_file, idx) => openTiktokViewWithFiles(sortedFiles, idx)"
:is-selected-mutil-files="multiSelectedIdxs.length > 1"
:enable-change-indicator="changeIndchecked"
:seed-change-checked="seedChangeChecked"

View File

@ -10,6 +10,8 @@ import { GridViewFile, useGlobalStore } from '@/store/useGlobalStore'
import { getRandomImages } from '@/api/db'
import { identity } from '@vueuse/core'
import fullScreenContextMenu from '@/page/fileTransfer/fullScreenContextMenu.vue'
import { openTiktokViewWithFiles } from '@/util/tiktokHelper'
import MultiSelectKeep from '@/components/MultiSelectKeep.vue'
import { LeftCircleOutlined, RightCircleOutlined } from '@/icon'
import { copy2clipboardI18n } from '@/util'
@ -40,6 +42,17 @@ const fetch = async () => {
onScroll()
}
}
// TikTok View
const onTiktokViewClick = () => {
if (files.value.length === 0) {
message.warn('没有图片可以浏览')
return
}
//
openTiktokViewWithFiles(files.value, previewIdx.value || 0)
}
onMounted(fetch)
const { stackViewEl, multiSelectedIdxs, stack, scroller } = useHookShareState({
images: files as any
@ -67,7 +80,24 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
<MultiSelectKeep :show="!!multiSelectedIdxs.length || g.keepMultiSelect" @clear-all-selected="onClearAllSelected"
@select-all="onSelectAll" @reverse-select="onReverseSelect" />
<div class="refresh-button">
<a-button @click="fetch" type="primary" :loading="loading" shape="round">{{ $t('shuffle') }}</a-button>
<a-button
@click="fetch"
@touchstart.prevent="fetch"
type="primary"
:loading="loading"
shape="round"
>
{{ $t('shuffle') }}
</a-button>
<a-button
@click="onTiktokViewClick"
@touchstart.prevent="onTiktokViewClick"
type="default"
:disabled="!files?.length"
shape="round"
>
{{ $t('tiktokView') }}
</a-button>
</div>
<AModal v-model:visible="showGenInfo" width="70vw" mask-closable @ok="showGenInfo = false">
<template #cancelText />
@ -90,7 +120,7 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
<file-item :idx="idx" :file="file" :cell-width="cellWidth" :full-screen-preview-image-url="images[previewIdx] ? toRawFileUrl(images[previewIdx]) : ''
" @context-menu-click="onContextMenuClickU" @preview-visible-change="onPreviewVisibleChange"
:is-selected-mutil-files="multiSelectedIdxs.length > 1" :selected="multiSelectedIdxs.includes(idx)"
@file-item-click="onFileItemClick" />
@file-item-click="onFileItemClick" @tiktok-view="(_file, idx) => openTiktokViewWithFiles(files, idx)" />
</template>
</RecycleScroller>
<div v-if="previewing" class="preview-switch">
@ -124,6 +154,10 @@ const onContextMenuClickU: typeof onContextMenuClick = async (e, file, idx) => {
background: white;
border-radius: 9999px;
box-shadow: 0 0 20px var(--zp-secondary);
padding: 4px;
display: flex;
align-items: center;
gap: 8px;
}
.file-list {

View File

@ -0,0 +1,101 @@
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export interface TiktokMediaItem {
url: string
type: 'image' | 'video'
id: string
[key: string]: any // 允许额外的属性
}
export const useTiktokStore = defineStore('useTiktokStore', () => {
// 基本状态
const visible = ref(false)
const isFullscreen = ref(false)
const mediaList = ref<TiktokMediaItem[]>([])
const currentIndex = ref(0)
// 计算属性
const currentItem = computed(() => {
return mediaList.value[currentIndex.value] || null
})
const hasNext = computed(() => {
return currentIndex.value < mediaList.value.length - 1
})
const hasPrev = computed(() => {
return currentIndex.value > 0
})
// 检测是否为移动设备
const isMobile = computed(() => {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
window.innerWidth <= 768
})
// 动作
const openTiktokView = (items: TiktokMediaItem[], startIndex = 0) => {
mediaList.value = items
currentIndex.value = Math.max(0, Math.min(startIndex, items.length - 1))
visible.value = true
// 移动设备自动全屏
if (isMobile.value) {
isFullscreen.value = true
}
}
const closeView = () => {
visible.value = false
isFullscreen.value = false
mediaList.value = []
currentIndex.value = 0
}
const next = () => {
if (hasNext.value) {
currentIndex.value++
}
}
const prev = () => {
if (hasPrev.value) {
currentIndex.value--
}
}
const goToIndex = (index: number) => {
if (index >= 0 && index < mediaList.value.length) {
currentIndex.value = index
}
}
const toggleFullscreen = () => {
isFullscreen.value = !isFullscreen.value
}
return {
// 状态
visible,
isFullscreen,
mediaList,
currentIndex,
// 计算属性
currentItem,
hasNext,
hasPrev,
isMobile,
// 动作
openTiktokView,
closeView,
next,
prev,
goToIndex,
toggleFullscreen
}
})

View File

@ -0,0 +1,98 @@
import type { FileNodeInfo } from '@/api/files'
import type { TiktokMediaItem } from '@/store/useTiktokStore'
import { useTiktokStore } from '@/store/useTiktokStore'
import { isVideoFile, isImageFile } from '@/util'
import { toRawFileUrl, toStreamVideoUrl } from '@/util/file'
/**
* FileNodeInfo TiktokMediaItem
*/
export const fileToTiktokItem = (file: FileNodeInfo): TiktokMediaItem => {
const isVideo = isVideoFile(file.name)
return {
id: file.fullpath,
url: isVideo ? toStreamVideoUrl(file) : toRawFileUrl(file),
type: isVideo ? 'video' : 'image',
// 保留原始文件信息以供后续使用
originalFile: file,
name: file.name,
fullpath: file.fullpath
}
}
/**
* FileNodeInfo TiktokMediaItem
*/
export const filesToTiktokItems = (files: FileNodeInfo[]): TiktokMediaItem[] => {
return files
.filter(file => file.type === 'file' && (isImageFile(file.name) || isVideoFile(file.name)))
.map(fileToTiktokItem)
}
/**
* URL TiktokMediaItem
*/
export const urlsToTiktokItems = (urls: string[]): TiktokMediaItem[] => {
return urls.map((url) => ({
id: url,
url: url,
type: isVideoFile(url) ? 'video' : 'image'
}))
}
/**
* 便
*/
export const openTiktokViewWithFiles = (files: FileNodeInfo[], startIndex = 0) => {
startIndex = Math.min(startIndex, files.length - 1)
startIndex = Math.max(startIndex, 0)
const tiktokStore = useTiktokStore()
const items = filesToTiktokItems(files)
if (items.length === 0) {
console.warn('没有找到可以显示的媒体文件')
return
}
// 调整起始索引,确保对应正确的媒体文件
let adjustedStartIndex = 0
if (startIndex < files.length) {
const targetFile = files[startIndex]
adjustedStartIndex = items.findIndex(item => item.id === targetFile.fullpath)
if (adjustedStartIndex === -1) {
adjustedStartIndex = 0
}
}
tiktokStore.openTiktokView(items, adjustedStartIndex)
}
/**
* 便 URL
*/
export const openTiktokViewWithUrls = (urls: string[], startIndex = 0) => {
const tiktokStore = useTiktokStore()
const items = urlsToTiktokItems(urls)
if (items.length === 0) {
console.warn('没有找到可以显示的媒体URL')
return
}
tiktokStore.openTiktokView(items, startIndex)
}
/**
* 便
*/
export const openTiktokViewWithFile = (file: FileNodeInfo) => {
openTiktokViewWithFiles([file], 0)
}
/**
* 便 URL
*/
export const openTiktokViewWithUrl = (url: string) => {
openTiktokViewWithUrls([url], 0)
}