@gkd-kit/inspect 0.0.1734266056335 → 0.0.1734793860473
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-C4GDiKVM.js → ActionCard.vue_vue_type_script_setup_true_lang-b0ZCYNBH.js} +2 -2
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-C4GDiKVM.js.map → ActionCard.vue_vue_type_script_setup_true_lang-b0ZCYNBH.js.map} +1 -1
- package/dist/assets/{DevicePage-BIwpMgjL.js → DevicePage-BDcVmU76.js} +2 -2
- package/dist/assets/{DevicePage-BIwpMgjL.js.map → DevicePage-BDcVmU76.js.map} +1 -1
- package/dist/assets/{HomePage-6pbbXVox.js → HomePage-BqsT3goJ.js} +2 -2
- package/dist/assets/{HomePage-6pbbXVox.js.map → HomePage-BqsT3goJ.js.map} +1 -1
- package/dist/assets/{ImportPage-pprILn6B.js → ImportPage-DSatpRU1.js} +2 -2
- package/dist/assets/{ImportPage-pprILn6B.js.map → ImportPage-DSatpRU1.js.map} +1 -1
- package/dist/assets/{SelectorPage-ftaQbixd.js → SelectorPage-B15WSmHh.js} +2 -2
- package/dist/assets/{SelectorPage-ftaQbixd.js.map → SelectorPage-B15WSmHh.js.map} +1 -1
- package/dist/assets/{SnapshotPage-BpCWU2Lq.js → SnapshotPage-h7peY3S9.js} +13 -13
- package/dist/assets/SnapshotPage-h7peY3S9.js.map +1 -0
- package/dist/assets/{TrackGraph-pCILQKep.js → TrackGraph-DpD4rstl.js} +2 -2
- package/dist/assets/{TrackGraph-pCILQKep.js.map → TrackGraph-DpD4rstl.js.map} +1 -1
- package/dist/assets/{_404Page-CtIlnfyk.js → _404Page-47TXA9Ma.js} +2 -2
- package/dist/assets/{_404Page-CtIlnfyk.js.map → _404Page-47TXA9Ma.js.map} +1 -1
- package/dist/assets/chunk-BR_VZk-b.js +3 -0
- package/dist/assets/{chunk-B7h9CrOT.js.map → chunk-BR_VZk-b.js.map} +1 -1
- package/dist/assets/{dayjs.min-NDdrP0U0.js → dayjs.min-Bc9tXN5I.js} +2 -2
- package/dist/assets/{dayjs.min-NDdrP0U0.js.map → dayjs.min-Bc9tXN5I.js.map} +1 -1
- package/dist/assets/{error-BuWiIPq5.js → error-DpEaP8W1.js} +2 -2
- package/dist/assets/{error-BuWiIPq5.js.map → error-DpEaP8W1.js.map} +1 -1
- package/dist/assets/{import-iYDGuobE.js → import-nlZS8goj.js} +2 -2
- package/dist/assets/{import-iYDGuobE.js.map → import-nlZS8goj.js.map} +1 -1
- package/dist/assets/{index-D3bLDlEa.js → index-D4mO3wpj.js} +36 -34
- package/dist/assets/index-D4mO3wpj.js.map +1 -0
- package/dist/assets/{jszip.min-5Im3j6i9.js → jszip.min--7PMUu4r.js} +2 -2
- package/dist/assets/{jszip.min-5Im3j6i9.js.map → jszip.min--7PMUu4r.js.map} +1 -1
- package/dist/assets/{snapshot-B6z6pf3s.js → snapshot-Ur5vjcGF.js} +2 -2
- package/dist/assets/{snapshot-B6z6pf3s.js.map → snapshot-Ur5vjcGF.js.map} +1 -1
- package/dist/assets/{table-CileF2fI.js → table-CkbxQbRY.js} +2 -2
- package/dist/assets/{table-CileF2fI.js.map → table-CkbxQbRY.js.map} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/SnapshotPage-BpCWU2Lq.js.map +0 -1
- package/dist/assets/chunk-B7h9CrOT.js +0 -3
- package/dist/assets/index-D3bLDlEa.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ag as gt,d as wt,aX as yt,a3 as bt,h as K,j as Ke,aa as xt,m as $,q as kt,t as Re,aq as Oe,v as C,w as Bt,aY as Et,X as le,ad as Pt,aZ as Ct,a as Ue,b as ae,e as ze,u as Ye,r as St,$ as Tt,a_ as At,a$ as Ft,y as Ie,V as Qe,K as w,aR as q,z as et,Q as P,Y as _t,b0 as M,aM as jt,aU as ue,aF as Y,b1 as Rt,b2 as Ot,at as Ut,aE as zt,H as T,I as Le,M as x,L as g,J as E,S as N,av as _,aT as It,W as De}from"./index-
|
|
1
|
+
import{ag as gt,d as wt,aX as yt,a3 as bt,h as K,j as Ke,aa as xt,m as $,q as kt,t as Re,aq as Oe,v as C,w as Bt,aY as Et,X as le,ad as Pt,aZ as Ct,a as Ue,b as ae,e as ze,u as Ye,r as St,$ as Tt,a_ as At,a$ as Ft,y as Ie,V as Qe,K as w,aR as q,z as et,Q as P,Y as _t,b0 as M,aM as jt,aU as ue,aF as Y,b1 as Rt,b2 as Ot,at as Ut,aE as zt,H as T,I as Le,M as x,L as g,J as E,S as N,av as _,aT as It,W as De}from"./index-D4mO3wpj.js";import{y as Lt,z as Me,A as Dt,c as tt,_ as Mt,u as H,N as Nt,b as Ht,n as Wt}from"./dayjs.min-Bc9tXN5I.js";import{e as $t,p as nt,b as it,a as Vt}from"./snapshot-Ur5vjcGF.js";import{J as pe}from"./chunk-BR_VZk-b.js";const Gt={iconSize:"22px"};function Zt(t){const{fontSize:e,warningColor:i}=t;return Object.assign(Object.assign({},Gt),{fontSize:e,iconColor:i})}const qt=gt({name:"Popconfirm",common:wt,peers:{Button:yt,Popover:Lt},self:Zt}),at=bt("n-popconfirm"),ot={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Ne=Et(ot),Xt=K({name:"NPopconfirmPanel",props:ot,setup(t){const{localeRef:e}=Me("Popconfirm"),{inlineThemeDisabled:i}=Ke(),{mergedClsPrefixRef:n,mergedThemeRef:o,props:r}=xt(at),f=$(()=>{const{common:{cubicBezierEaseInOut:l},self:{fontSize:a,iconSize:s,iconColor:h}}=o.value;return{"--n-bezier":l,"--n-font-size":a,"--n-icon-size":s,"--n-icon-color":h}}),p=i?kt("popconfirm-panel",void 0,f,r):void 0;return Object.assign(Object.assign({},Me("Popconfirm")),{mergedClsPrefix:n,cssVars:i?void 0:f,localizedPositiveText:$(()=>t.positiveText||e.value.positiveText),localizedNegativeText:$(()=>t.negativeText||e.value.negativeText),positiveButtonProps:Re(r,"positiveButtonProps"),negativeButtonProps:Re(r,"negativeButtonProps"),handlePositiveClick(l){t.onPositiveClick(l)},handleNegativeClick(l){t.onNegativeClick(l)},themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var t;const{mergedClsPrefix:e,showIcon:i,$slots:n}=this,o=Oe(n.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&C(le,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&C(le,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(t=this.onRender)===null||t===void 0||t.call(this),C("div",{class:[`${e}-popconfirm__panel`,this.themeClass],style:this.cssVars},Bt(n.default,r=>i||r?C("div",{class:`${e}-popconfirm__body`},i?C("div",{class:`${e}-popconfirm__icon`},Oe(n.icon,()=>[C(Pt,{clsPrefix:e},{default:()=>C(Ct,null)})])):null,r):null),o?C("div",{class:[`${e}-popconfirm__action`]},o):null)}}),Jt=Ue("popconfirm",[ae("body",`
|
|
2
2
|
font-size: var(--n-font-size);
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
@@ -22,4 +22,4 @@ import{ag as gt,d as wt,aX as yt,a3 as bt,h as K,j as Ke,aa as xt,m as $,q as kt
|
|
|
22
22
|
*
|
|
23
23
|
* Date: 2023-02-28T14:09:41.732Z
|
|
24
24
|
*/function Ve(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),i.push.apply(i,n)}return i}function W(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Ve(Object(i),!0).forEach(function(n){pn(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ve(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ge(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,st(n.key),n)}}function un(t,e,i){return e&&Ge(t.prototype,e),i&&Ge(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function pn(t,e,i){return e=st(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function X(){return X=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},X.apply(this,arguments)}function fn(t,e){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var n=i.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function st(t){var e=fn(t,"string");return typeof e=="symbol"?e:String(e)}var lt={exports:{}};(function(t){typeof window>"u"||function(e){var i=e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype,n=e.Blob&&function(){try{return!!new Blob}catch{return!1}}(),o=n&&e.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),r=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,f=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,p=(n||r)&&e.atob&&e.ArrayBuffer&&e.Uint8Array&&function(l){var a,s,h,c,u,d,v,m,B;if(a=l.match(f),!a)throw new Error("invalid data URI");for(s=a[2]?a[1]:"text/plain"+(a[3]||";charset=US-ASCII"),h=!!a[4],c=l.slice(a[0].length),h?u=atob(c):u=decodeURIComponent(c),d=new ArrayBuffer(u.length),v=new Uint8Array(d),m=0;m<u.length;m+=1)v[m]=u.charCodeAt(m);return n?new Blob([o?v:d],{type:s}):(B=new r,B.append(d),B.getBlob(s))};e.HTMLCanvasElement&&!i.toBlob&&(i.mozGetAsFile?i.toBlob=function(l,a,s){var h=this;setTimeout(function(){s&&i.toDataURL&&p?l(p(h.toDataURL(a,s))):l(h.mozGetAsFile("blob",a))})}:i.toDataURL&&p&&(i.msToBlob?i.toBlob=function(l,a,s){var h=this;setTimeout(function(){(a&&a!=="image/png"||s)&&i.toDataURL&&p?l(p(h.toDataURL(a,s))):l(h.msToBlob(a))})}:i.toBlob=function(l,a,s){var h=this;setTimeout(function(){l(p(h.toDataURL(a,s)))})})),t.exports?t.exports=p:e.dataURLtoBlob=p}(window)})(lt);var Ze=lt.exports,dn=function(e){return typeof Blob>"u"?!1:e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]"},qe={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},hn=typeof window<"u"&&typeof window.document<"u",A=hn?window:{},J=function(e){return e>0&&e<1/0},vn=Array.prototype.slice;function fe(t){return Array.from?Array.from(t):vn.call(t)}var mn=/^image\/.+$/;function ce(t){return mn.test(t)}function gn(t){var e=ce(t)?t.substr(6):"";return e==="jpeg"&&(e="jpg"),".".concat(e)}var ct=String.fromCharCode;function wn(t,e,i){var n="",o;for(i+=e,o=e;o<i;o+=1)n+=ct(t.getUint8(o));return n}var yn=A.btoa;function Xe(t,e){for(var i=[],n=8192,o=new Uint8Array(t);o.length>0;)i.push(ct.apply(null,fe(o.subarray(0,n)))),o=o.subarray(n);return"data:".concat(e,";base64,").concat(yn(i.join("")))}function bn(t){var e=new DataView(t),i;try{var n,o,r;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var f=e.byteLength,p=2;p+1<f;){if(e.getUint8(p)===255&&e.getUint8(p+1)===225){o=p;break}p+=1}if(o){var l=o+4,a=o+10;if(wn(e,l,4)==="Exif"){var s=e.getUint16(a);if(n=s===18761,(n||s===19789)&&e.getUint16(a+2,n)===42){var h=e.getUint32(a+4,n);h>=8&&(r=a+h)}}}if(r){var c=e.getUint16(r,n),u,d;for(d=0;d<c;d+=1)if(u=r+d*12+2,e.getUint16(u,n)===274){u+=8,i=e.getUint16(u,n),e.setUint16(u,1,n);break}}}catch{i=1}return i}function xn(t){var e=0,i=1,n=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:n=-1;break;case 5:e=90,n=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:i,scaleY:n}}var kn=/\.\d*(?:0|9){12}\d*$/;function Je(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return kn.test(t)?Math.round(t*e)/e:t}function D(t){var e=t.aspectRatio,i=t.height,n=t.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",r=J(n),f=J(i);if(r&&f){var p=i*e;(o==="contain"||o==="none")&&p>n||o==="cover"&&p<n?i=n/e:n=i*e}else r?i=n/e:f&&(n=i*e);return{width:n,height:i}}function Bn(t){for(var e=fe(new Uint8Array(t)),i=e.length,n=[],o=0;o+3<i;){var r=e[o],f=e[o+1];if(r===255&&f===218)break;if(r===255&&f===216)o+=2;else{var p=e[o+2]*256+e[o+3],l=o+p+2,a=e.slice(o,l);n.push(a),o=l}}return n.reduce(function(s,h){return h[0]===255&&h[1]===225?s.concat(h):s},[])}function En(t,e){var i=fe(new Uint8Array(t));if(i[2]!==255||i[3]!==224)return t;var n=i[4]*256+i[5],o=[255,216].concat(e,i.slice(4+n));return new Uint8Array(o)}var Pn=A.ArrayBuffer,se=A.FileReader,j=A.URL||A.webkitURL,Cn=/\.\w+$/,Sn=A.Compressor,Tn=function(){function t(e,i){cn(this,t),this.file=e,this.exif=[],this.image=new Image,this.options=W(W({},qe),i),this.aborted=!1,this.result=null,this.init()}return un(t,[{key:"init",value:function(){var i=this,n=this.file,o=this.options;if(!dn(n)){this.fail(new Error("The first argument must be a File or Blob object."));return}var r=n.type;if(!ce(r)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!j||!se){this.fail(new Error("The current browser does not support image compression."));return}Pn||(o.checkOrientation=!1,o.retainExif=!1);var f=r==="image/jpeg",p=f&&o.checkOrientation,l=f&&o.retainExif;if(j&&!p&&!l)this.load({url:j.createObjectURL(n)});else{var a=new se;this.reader=a,a.onload=function(s){var h=s.target,c=h.result,u={},d=1;p&&(d=bn(c),d>1&&X(u,xn(d))),l&&(i.exif=Bn(c)),p||l?!j||d>1?u.url=Xe(c,r):u.url=j.createObjectURL(n):u.url=c,i.load(u)},a.onabort=function(){i.fail(new Error("Aborted to read the image with FileReader."))},a.onerror=function(){i.fail(new Error("Failed to read the image with FileReader."))},a.onloadend=function(){i.reader=null},p||l?a.readAsArrayBuffer(n):a.readAsDataURL(n)}}},{key:"load",value:function(i){var n=this,o=this.file,r=this.image;r.onload=function(){n.draw(W(W({},i),{},{naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight}))},r.onabort=function(){n.fail(new Error("Aborted to load the image."))},r.onerror=function(){n.fail(new Error("Failed to load the image."))},A.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(A.navigator.userAgent)&&(r.crossOrigin="anonymous"),r.alt=o.name,r.src=i.url}},{key:"draw",value:function(i){var n=this,o=i.naturalWidth,r=i.naturalHeight,f=i.rotate,p=f===void 0?0:f,l=i.scaleX,a=l===void 0?1:l,s=i.scaleY,h=s===void 0?1:s,c=this.file,u=this.image,d=this.options,v=document.createElement("canvas"),m=v.getContext("2d"),B=Math.abs(p)%180===90,S=(d.resize==="contain"||d.resize==="cover")&&J(d.width)&&J(d.height),k=Math.max(d.maxWidth,0)||1/0,F=Math.max(d.maxHeight,0)||1/0,U=Math.max(d.minWidth,0)||0,z=Math.max(d.minHeight,0)||0,R=o/r,y=d.width,b=d.height;if(B){var ve=[F,k];k=ve[0],F=ve[1];var me=[z,U];U=me[0],z=me[1];var ge=[b,y];y=ge[0],b=ge[1]}S&&(R=y/b);var we=D({aspectRatio:R,width:k,height:F},"contain");k=we.width,F=we.height;var ye=D({aspectRatio:R,width:U,height:z},"cover");if(U=ye.width,z=ye.height,S){var be=D({aspectRatio:R,width:y,height:b},d.resize);y=be.width,b=be.height}else{var xe=D({aspectRatio:R,width:y,height:b}),ke=xe.width;y=ke===void 0?o:ke;var Be=xe.height;b=Be===void 0?r:Be}y=Math.floor(Je(Math.min(Math.max(y,U),k))),b=Math.floor(Je(Math.min(Math.max(b,z),F)));var dt=-y/2,ht=-b/2,vt=y,mt=b,ee=[];if(S){var Ee=0,Pe=0,te=o,ne=r,Ce=D({aspectRatio:R,width:o,height:r},{contain:"cover",cover:"contain"}[d.resize]);te=Ce.width,ne=Ce.height,Ee=(o-te)/2,Pe=(r-ne)/2,ee.push(Ee,Pe,te,ne)}if(ee.push(dt,ht,vt,mt),B){var Se=[b,y];y=Se[0],b=Se[1]}v.width=y,v.height=b,ce(d.mimeType)||(d.mimeType=c.type);var Te="transparent";c.size>d.convertSize&&d.convertTypes.indexOf(d.mimeType)>=0&&(d.mimeType="image/jpeg");var Ae=d.mimeType==="image/jpeg";if(Ae&&(Te="#fff"),m.fillStyle=Te,m.fillRect(0,0,y,b),d.beforeDraw&&d.beforeDraw.call(this,m,v),!this.aborted&&(m.save(),m.translate(y/2,b/2),m.rotate(p*Math.PI/180),m.scale(a,h),m.drawImage.apply(m,[u].concat(ee)),m.restore(),d.drew&&d.drew.call(this,m,v),!this.aborted)){var Fe=function(I){if(!n.aborted){var _e=function(L){return n.done({naturalWidth:o,naturalHeight:r,result:L})};if(I&&Ae&&d.retainExif&&n.exif&&n.exif.length>0){var je=function(L){return _e(Ze(Xe(En(L,n.exif),d.mimeType)))};if(I.arrayBuffer)I.arrayBuffer().then(je).catch(function(){n.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var O=new se;n.reader=O,O.onload=function(ie){var L=ie.target;je(L.result)},O.onabort=function(){n.fail(new Error("Aborted to read the compressed image with FileReader."))},O.onerror=function(){n.fail(new Error("Failed to read the compressed image with FileReader."))},O.onloadend=function(){n.reader=null},O.readAsArrayBuffer(I)}}else _e(I)}};v.toBlob?v.toBlob(Fe,d.mimeType,d.quality):Fe(Ze(v.toDataURL(d.mimeType,d.quality)))}}},{key:"done",value:function(i){var n=i.naturalWidth,o=i.naturalHeight,r=i.result,f=this.file,p=this.image,l=this.options;if(j&&p.src.indexOf("blob:")===0&&j.revokeObjectURL(p.src),r)if(l.strict&&!l.retainExif&&r.size>f.size&&l.mimeType===f.type&&!(l.width>n||l.height>o||l.minWidth>n||l.minHeight>o||l.maxWidth<n||l.maxHeight<o))r=f;else{var a=new Date;r.lastModified=a.getTime(),r.lastModifiedDate=a,r.name=f.name,r.name&&r.type!==f.type&&(r.name=r.name.replace(Cn,gn(r.type)))}else r=f;this.result=r,l.success&&l.success.call(this,r)}},{key:"fail",value:function(i){var n=this.options;if(n.error)n.error.call(this,i);else throw i}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=Sn,t}},{key:"setDefaults",value:function(i){X(qe,i)}}]),t}();const de=async t=>{const e=new(await pe);return e.file("snapshot.json",JSON.stringify(t)).file("screenshot.png",await it.getItem(t.id)),await e.generateAsync({type:"blob",compression:"STORE"})},An=async t=>{const e=`snapshot-${t.id}.zip`;Q.saveAs(await de(t),e)},he=async t=>{const e=await it.getItem(t.id),i=await new Promise((o,r)=>{new Tn(new Blob([e],{type:"image/png"}),{quality:.75,convertSize:2e5,success(f){o(f)},error(f){r(f)}})});return new Blob([i],{type:"image/jpeg"})},Fn=async t=>{const e=`snapshot-${t.id}.jpg`;Q.saveAs(await he(t),e)},Ln=async t=>{const e=new(await pe);for(const n of t)await ue(),e.file(n.id+".jpg",he(n));const i=await e.generateAsync({type:"blob",compression:"STORE"});Q.saveAs(i,`batch-png-${t.length}.zip`)},Dn=async t=>{const e=new(await pe);for(const n of t)await ue(),e.file(n.id+".zip",await de(n));const i=await e.generateAsync({type:"blob",compression:"STORE"});Q.saveAs(i,`batch-zip-${t.length}.zip`)},ut=async t=>{var i;const{snapshotImageId:e}=Y();return(i=e[t.id])!=null?i:rt(await he(t).then(n=>n.arrayBuffer()),"file.jpg").then(n=>{const o=Rt(n.href);if(!o)throw new Error("imageId not found");return e[t.id]=o,o})},pt=async t=>{const{snapshotImportId:e,importSnapshotId:i}=Y();return e[t.id]||rt(await de(t).then(n=>n.arrayBuffer()),"file.zip").then(n=>(e[t.id]=n.id,i[n.id]=t.id,ft(t.id,n.id),n.id))},Mn=async t=>{const e=nt(3);return(await Promise.allSettled(t.map(i=>e(()=>ut(i))))).reduce((i,n)=>(n.status=="fulfilled"&&i.push(n.value),i),[])},Nn=async t=>{const e=nt(3);return(await Promise.allSettled(t.map(i=>e(()=>pt(i))))).reduce((i,n)=>(n.status=="fulfilled"&&i.push(n.value),i),[])},ft=async(t,e)=>fetch("https://detect.gkd.li/api/detectSnapshot?"+Ot({id:t,importId:e}).toString()),Hn=async(t,e)=>{if(!e||!Number.isSafeInteger(+e))return;const{importSnapshotId:i,waitInit:n}=Y();await n(),!i[e]&&await ft(t,e)},_n={flex:"","gap-16px":""},jn=["href"],Wn=K({__name:"ActionCard",props:{snapshot:{},onDelete:{type:Function,default:Ut},showPreview:{type:Boolean,default:!0},showExport:{type:Boolean,default:!0},showDelete:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0}},setup(t){const e=t,i=zt(),{snapshotImportId:n,snapshotImageId:o}=Y(),r=H(async()=>Fn(e.snapshot)),f=H(async()=>An(e.snapshot)),p=$(()=>i.resolve({name:"snapshot",params:{snapshotId:e.snapshot.id}}).href),l=H(async()=>{await We();const c=await ut(e.snapshot);He({title:"分享链接",content:De(c)})}),a=H(async()=>{await We();const c=await pt(e.snapshot);He({title:"分享链接",content:location.origin+`/i/${c}`})}),s=async()=>{await Vt.removeItem(e.snapshot.id),await ue(500),e.onDelete()},h=async c=>navigator.clipboard.writeText(c).then(()=>{q.success("复制成功")}).catch(()=>{q.success("复制失败")});return(c,u)=>{const d=Nt,v=le,m=Ht,B=tt,S=Wt,k=Yt;return T(),Le("div",_n,[c.showPreview?(T(),Le("a",{key:0,flex:"",target:"_blank",href:x(p)},[w(v,{text:"",title:"查看"},{icon:g(()=>[w(d,{size:""},{default:g(()=>u[2]||(u[2]=[E("svg",{viewBox:"0 0 1024 1024"},[E("path",{d:"M549.973333 128 633.6 145.066667 474.026667 896 390.4 878.933333 549.973333 128M835.84 512 682.666667 358.826667 682.666667 238.08 956.586667 512 682.666667 785.493333 682.666667 664.746667 835.84 512M67.413333 512 341.333333 238.08 341.333333 358.826667 188.16 512 341.333333 664.746667 341.333333 785.493333 67.413333 512Z"})],-1)])),_:1})]),_:1})],8,jn)):N("",!0),c.showExport?(T(),_(B,{key:1},{trigger:g(()=>[w(v,{text:""},{icon:g(()=>[w(d,null,{default:g(()=>u[3]||(u[3]=[E("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[E("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[E("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),E("path",{d:"M7 11l5 5l5-5"}),E("path",{d:"M12 4v12"})])],-1)])),_:1})]),_:1})]),default:g(()=>[w(m,{vertical:""},{default:g(()=>[w(v,{onClick:x(f).invoke,loading:x(f).loading},{default:g(()=>u[4]||(u[4]=[P(" 下载-快照 ")])),_:1},8,["onClick","loading"]),w(v,{onClick:x(r).invoke,loading:x(r).loading},{default:g(()=>u[5]||(u[5]=[P(" 下载-图片 ")])),_:1},8,["onClick","loading"])]),_:1})]),_:1})):N("",!0),c.showShare?(T(),_(B,{key:2},{trigger:g(()=>[w(v,{text:""},{icon:g(()=>[w(d,null,{default:g(()=>u[6]||(u[6]=[E("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[E("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81c1.66 0 3-1.34 3-3s-1.34-3-3-3s-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65c0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",fill:"currentColor"})],-1)])),_:1})]),_:1})]),default:g(()=>[w(m,{vertical:""},{default:g(()=>[x(n)[c.snapshot.id]?(T(),_(v,{key:0,onClick:u[0]||(u[0]=F=>h(x(It)(x(n)[c.snapshot.id])))},{default:g(()=>u[7]||(u[7]=[P(" 复制链接-快照 ")])),_:1})):(T(),_(v,{key:1,onClick:x(a).invoke,loading:x(a).loading},{default:g(()=>u[8]||(u[8]=[P(" 生成链接-快照 ")])),_:1},8,["onClick","loading"])),x(o)[c.snapshot.id]?(T(),_(v,{key:2,onClick:u[1]||(u[1]=F=>h(x(De)(x(o)[c.snapshot.id])))},{default:g(()=>u[9]||(u[9]=[P(" 复制链接-图片 ")])),_:1})):(T(),_(v,{key:3,onClick:x(l).invoke,loading:x(l).loading},{default:g(()=>u[10]||(u[10]=[P(" 生成链接-图片 ")])),_:1},8,["onClick","loading"]))]),_:1})]),_:1})):N("",!0),c.showDelete?(T(),_(k,{key:3,onPositiveClick:s},{trigger:g(()=>[w(S,null,{trigger:g(()=>[w(v,{text:""},{icon:g(()=>[w(d,null,{default:g(()=>u[11]||(u[11]=[E("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},[E("g",{fill:"none"},[E("path",{d:"M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5zM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25z",fill:"currentColor"})])],-1)])),_:1})]),_:1})]),default:g(()=>[u[12]||(u[12]=P(" 删除快照 "))]),_:1})]),default:g(()=>[u[13]||(u[13]=P(" 是否删除快照? "))]),_:1})):N("",!0)])}}});export{Wn as _,Dn as a,Ln as b,Mn as c,Nn as d,ut as e,pt as f,Hn as g,He as s,We as w};
|
|
25
|
-
//# sourceMappingURL=ActionCard.vue_vue_type_script_setup_true_lang-
|
|
25
|
+
//# sourceMappingURL=ActionCard.vue_vue_type_script_setup_true_lang-b0ZCYNBH.js.map
|