react-screenshots 0.3.1 → 0.4.3
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/electron/assets/{index.93974164.js → index.520cf8a5.js} +4 -4
- package/electron/assets/index.d7827cc0.css +1 -0
- package/electron/electron.html +2 -2
- package/lib/react-screenshots.cjs.js +2 -2
- package/lib/react-screenshots.es.js +18 -12
- package/lib/style.css +1 -1
- package/package.json +2 -2
- package/electron/assets/index.7a04e023.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Qe=Object.defineProperty,Ze=Object.defineProperties;var et=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var Be=(e,t,r)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))Ee.call(t,r)&&Be(e,r,t[r]);if(he)for(var r of he(t))je.call(t,r)&&Be(e,r,t[r]);return e},pe=(e,t)=>Ze(e,et(t));var Me=(e,t)=>{var r={};for(var o in e)Ee.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&he)for(var o of he(e))t.indexOf(o)<0&&je.call(e,o)&&(r[o]=e[o]);return r};import{R as _e,r as c,j as g,a as Ve,b as tt}from"./vendor.e3c417b2.js";const st=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const s of n.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerpolicy&&(n.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?n.credentials="include":i.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function o(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}};st();const $e={magnifier_position_label:"\u5750\u6807",operation_ok_title:"\u786E\u5B9A",operation_cancel_title:"\u53D6\u6D88",operation_save_title:"\u4FDD\u5B58",operation_redo_title:"\u91CD\u505A",operation_undo_title:"\u64A4\u9500",operation_mosaic_title:"\u9A6C\u8D5B\u514B",operation_text_title:"\u6587\u672C",operation_brush_title:"\u753B\u7B14",operation_arrow_title:"\u7BAD\u5934",operation_ellipse_title:"\u692D\u5706",operation_rectangle_title:"\u77E9\u5F62"};var ve=_e.createContext({store:{url:void 0,image:null,width:0,height:0,lang:$e,emiterRef:{current:{}},canvasContextRef:{current:null},history:{index:-1,stack:[]},bounds:null,cursor:"move",operation:void 0},dispatcher:{call:void 0,setHistory:void 0,setBounds:void 0,setCursor:void 0,setOperation:void 0}});function $(){const{store:e}=c.exports.useContext(ve);return e}function L(){const{lang:e}=$();return e}var q="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsMagnifier/index.tsx";const K=100,Q=80;function nt({x:e,y:t}){const{width:r,height:o,image:i}=$(),n=L(),[s,a]=c.exports.useState(null),x=c.exports.useRef(null),u=c.exports.useRef(null),p=c.exports.useRef(null),[l,h]=c.exports.useState("000000");return c.exports.useLayoutEffect(()=>{if(!x.current)return;const f=x.current.getBoundingClientRect();let m=e+20,y=t+20;m+f.width>r&&(m=e-f.width-20),y+f.height>o&&(y=t-f.height-20),m<0&&(m=0),y<0&&(y=0),a({x:m,y})},[r,o,e,t]),c.exports.useEffect(()=>{if(!i||!u.current){p.current=null;return}if(p.current||(p.current=u.current.getContext("2d")),!p.current)return;const f=p.current;f.clearRect(0,0,K,Q);const m=i.naturalWidth/r,y=i.naturalHeight/o;f.drawImage(i,e*m-K/2,t*y-Q/2,K,Q,0,0,K,Q);const{data:N}=f.getImageData(Math.floor(K/2),Math.floor(Q/2),1,1),w=Array.from(N.slice(0,3)).map(S=>S>=16?S.toString(16):`0${S.toString(16)}`).join("").toUpperCase();h(w)},[r,o,i,e,t]),g.exports.jsxDEV("div",{ref:x,className:"screenshots-magnifier",style:{transform:`translate(${s==null?void 0:s.x}px, ${s==null?void 0:s.y}px)`},children:[g.exports.jsxDEV("div",{className:"screenshots-magnifier-body",children:g.exports.jsxDEV("canvas",{ref:u,className:"screenshots-magnifier-body-canvas",width:K,height:Q},void 0,!1,{fileName:q,lineNumber:97,columnNumber:9},this)},void 0,!1,{fileName:q,lineNumber:96,columnNumber:7},this),g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer",children:[g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer-item",children:[n.magnifier_position_label,": (",e,",",t,")"]},void 0,!0,{fileName:q,lineNumber:105,columnNumber:9},this),g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer-item",children:["RGB: #",l]},void 0,!0,{fileName:q,lineNumber:108,columnNumber:9},this)]},void 0,!0,{fileName:q,lineNumber:104,columnNumber:7},this)]},void 0,!0,{fileName:q,lineNumber:89,columnNumber:5},this)}function rt({x:e,y:t},{x:r,y:o},i,n){return e>r&&([e,r]=[r,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0),r>i&&(r=i),t<0&&(t=0),o>n&&(o=n),{x:e,y:t,width:r-e,height:o-t}}function oe(){const{dispatcher:e}=c.exports.useContext(ve);return e}function U(){const{bounds:e}=$(),{setBounds:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t(null)},[t]);return[e,{set:r,reset:o}]}var ye="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsBackground/index.tsx";function ot(){const{url:e,width:t,height:r}=$(),[o,i]=U(),n=c.exports.useRef(null),s=c.exports.useRef(null),[a,x]=c.exports.useState(null),u=c.exports.useCallback((l,h)=>{if(!n.current)return;const{x:f,y:m}=n.current.getBoundingClientRect();i.set(rt({x:l.x-f,y:l.y-m},{x:h.x-f,y:h.y-m},t,r))},[t,r,i]),p=c.exports.useCallback(l=>{s.current||o||l.button!==0||(s.current={x:l.clientX,y:l.clientY})},[o]);return c.exports.useEffect(()=>{const l=f=>{if(n.current){const m=n.current.getBoundingClientRect();f.clientX<m.left||f.clientY<m.top||f.clientX>m.right||f.clientY>m.bottom?x(null):x({x:f.clientX-m.x,y:f.clientY-m.y})}!s.current||u(s.current,{x:f.clientX,y:f.clientY})},h=f=>{!s.current||(u(s.current,{x:f.clientX,y:f.clientY}),s.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",h),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",h)}},[u]),e?g.exports.jsxDEV("div",{ref:n,className:"screenshots-background",style:{backgroundImage:`url("${e}")`},onMouseDown:p,children:[g.exports.jsxDEV("div",{className:"screenshots-background-mask"},void 0,!1,{fileName:ye,lineNumber:112,columnNumber:7},this),a&&!o&&g.exports.jsxDEV(nt,{x:a==null?void 0:a.x,y:a==null?void 0:a.y},void 0,!1,{fileName:ye,lineNumber:113,columnNumber:31},this)]},void 0,!0,{fileName:ye,lineNumber:104,columnNumber:5},this):null}var Ke;const Le=(Ke=window.devicePixelRatio)!=null?Ke:2;var me=Le<2?2:Le;function it(e,t,r,o){const i=e.clientX-r.x,n=e.clientY-r.y;let s=o.x,a=o.y,x=o.x+o.width,u=o.y+o.height;switch(t){case"top":a+=n;break;case"top-right":x+=i,a+=n;break;case"right":x+=i;break;case"right-bottom":x+=i,u+=n;break;case"bottom":u+=n;break;case"bottom-left":s+=i,u+=n;break;case"left":s+=i;break;case"left-top":s+=i,a+=n;break;case"move":s+=i,a+=n,x+=i,u+=n;break}return[{x:s,y:a},{x,y:u}]}function ct({x:e,y:t},{x:r,y:o},i,n,s,a){return e>r&&([e,r]=[r,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0,a==="move"&&(r=i.width)),r>n&&(r=n,a==="move"&&(e=r-i.width)),t<0&&(t=0,a==="move"&&(o=i.height)),o>s&&(o=s,a==="move"&&(t=o-i.height)),{x:e,y:t,width:Math.max(r-e,1),height:Math.max(o-t,1)}}var j;(function(e){e[e.Edit=0]="Edit",e[e.Source=1]="Source"})(j||(j={}));function Z(){const{emiterRef:e}=$(),t=c.exports.useCallback((n,s)=>{const a=e.current;Array.isArray(a[n])?a[n].push(s):a[n]=[s]},[e]),r=c.exports.useCallback((n,s)=>{const a=e.current;if(Array.isArray(a[n])){const x=a[n].findIndex(u=>u===s);x!==-1&&a[n].splice(x,1)}},[e]),o=c.exports.useCallback((n,...s)=>{const a=e.current;Array.isArray(a[n])&&a[n].forEach(x=>x(...s))},[e]),i=c.exports.useCallback(()=>{e.current={}},[e]);return{on:t,off:r,emit:o,reset:i}}function H(){const{history:e}=$(),{setHistory:t}=oe(),r=c.exports.useCallback(p=>{const{index:l,stack:h}=e;h.forEach(f=>{f.type===j.Source&&(f.isSelected=!1)}),p.type===j.Source?p.isSelected=!0:p.type===j.Edit&&(p.source.isSelected=!0),h.splice(l+1),h.push(p),t==null||t({index:h.length-1,stack:h})},[e,t]),o=c.exports.useCallback(()=>{const{stack:p}=e;p.pop(),t==null||t({index:p.length-1,stack:p})},[e,t]),i=c.exports.useCallback(()=>{const{index:p,stack:l}=e,h=l[p];h&&(h.type===j.Source?h.isSelected=!1:h.type===j.Edit&&h.source.editHistory.pop()),t==null||t({index:p<=0?-1:p-1,stack:l})},[e,t]),n=c.exports.useCallback(()=>{const{index:p,stack:l}=e,h=l[p+1];h&&(h.type===j.Source?h.isSelected=!1:h.type===j.Edit&&h.source.editHistory.push(h)),t==null||t({index:p>=l.length-1?l.length-1:p+1,stack:l})},[e,t]),s=c.exports.useCallback(p=>{t==null||t(T({},p))},[t]),a=c.exports.useCallback(p=>{e.stack.forEach(l=>{l.type===j.Source&&(l===p?l.isSelected=!0:l.isSelected=!1)}),t==null||t(T({},e))},[e,t]),x=c.exports.useCallback(()=>{e.stack.forEach(p=>{p.type===j.Source&&(p.isSelected=!1)}),t==null||t(T({},e))},[e,t]),u=c.exports.useCallback(()=>{t==null||t({index:-1,stack:[]})},[t]);return[{index:e.index,stack:e.stack,top:e.stack.slice(e.index,e.index+1)[0]},{push:r,pop:o,undo:i,redo:n,set:s,select:a,clearSelect:x,reset:u}]}function G(){const{cursor:e}=$(),{setCursor:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t("move")},[t]);return[e,{set:r,reset:o}]}function A(){const{operation:e}=$(),{setOperation:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t(void 0)},[t]);return[e,{set:r,reset:o}]}function at(e,t,r,o){if(!t)return!1;const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const n=i.getContext("2d");if(!n)return!1;const{left:s,top:a}=t.getBoundingClientRect(),x=o.clientX-s,u=o.clientY-a;return[...r.stack.slice(0,r.index+1)].reverse().find(l=>{var h;return l.type!==j.Source?!1:(n.clearRect(0,0,e.width,e.height),(h=l.isHit)==null?void 0:h.call(l,n,l,{x,y:u}))})}var ie="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsCanvas/index.tsx";const ut=["top","right","bottom","left"];var P;(function(e){e.ResizeTop="top",e.ResizetopRight="top-right",e.ResizeRight="right",e.ResizeRightBottom="right-bottom",e.ResizeBottom="bottom",e.ResizeBottomLeft="bottom-left",e.ResizeLeft="left",e.ResizeLeftTop="left-top",e.Move="move"})(P||(P={}));const lt=[P.ResizeTop,P.ResizetopRight,P.ResizeRight,P.ResizeRightBottom,P.ResizeBottom,P.ResizeBottomLeft,P.ResizeLeft,P.ResizeLeftTop];var ft=c.exports.forwardRef(function(t,r){const{image:o,width:i,height:n}=$(),s=Z(),[a]=H(),[x]=G(),[u,p]=U(),[l]=A(),h=c.exports.useRef(),f=c.exports.useRef(null),m=c.exports.useRef(null),y=c.exports.useRef(null),N=c.exports.useRef(null),w=c.exports.useCallback(()=>{if(!o||!u||!N.current)return;const d=o.naturalWidth/i,b=o.naturalHeight/n,v=N.current;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.setTransform(me,0,0,me,0,0),v.clearRect(0,0,u.width,u.height),v.drawImage(o,u.x*d,u.y*b,u.width*d,u.height*b,0,0,u.width,u.height),a.stack.slice(0,a.index+1).forEach(C=>{C.type===j.Source&&C.draw(v,C)})},[o,i,n,u,N,a]),S=c.exports.useCallback((d,b)=>{if(!(d.button!==0||!u))if(!l)h.current=b,f.current={x:d.clientX,y:d.clientY},m.current={x:u.x,y:u.y,width:u.width,height:u.height};else{const v=at(u,y.current,a,d.nativeEvent);v?s.emit("drawselect",v,d.nativeEvent):s.emit("mousedown",d.nativeEvent)}},[u,l,s,a]),z=c.exports.useCallback(d=>{if(!h.current||!f.current||!m.current||!u)return;const b=it(d,h.current,f.current,m.current);p.set(ct(b[0],b[1],u,i,n,h.current))},[i,n,u,p]);return c.exports.useLayoutEffect(()=>{if(!o||!u||!y.current){N.current=null;return}N.current||(N.current=y.current.getContext("2d")),w()},[o,u,w]),c.exports.useEffect(()=>{const d=v=>{if(l)s.emit("mousemove",v);else{if(!h.current||!f.current||!m.current)return;z(v)}},b=v=>{if(l)s.emit("mouseup",v);else{if(!h.current||!f.current||!m.current)return;z(v),h.current=void 0,f.current=null,m.current=null}};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",b)}},[z,l,s]),c.exports.useImperativeHandle(r,()=>N.current),u?g.exports.jsxDEV("div",{className:"screenshots-canvas",style:{left:u.x,top:u.y,width:u.width,height:u.height},children:[g.exports.jsxDEV("canvas",{ref:y,width:u.width*me,height:u.height*me,style:{width:u.width,height:u.height}},void 0,!1,{fileName:ie,lineNumber:199,columnNumber:7},this),g.exports.jsxDEV("div",{className:"screenshots-canvas-body",style:{cursor:x},onMouseDown:d=>S(d,"move")},void 0,!1,{fileName:ie,lineNumber:208,columnNumber:7},this),ut.map(d=>g.exports.jsxDEV("div",{className:`screenshots-canvas-border-${d}`},d,!1,{fileName:ie,lineNumber:216,columnNumber:16},this)),lt.map(d=>g.exports.jsxDEV("div",{className:`screenshots-canvas-point-${d}`,onMouseDown:b=>S(b,d)},d,!1,{fileName:ie,lineNumber:220,columnNumber:11},this))]},void 0,!0,{fileName:ie,lineNumber:190,columnNumber:5},this):null});function Ne(){const e=oe();return c.exports.useCallback((r,...o)=>{var i;(i=e.call)==null||i.call(e,r,...o)},[e])}function I(){const{canvasContextRef:e}=$();return e}function Ce(){const e=Z(),[,t]=U(),[,r]=G(),[,o]=H(),[,i]=A();return c.exports.useCallback(()=>{e.reset(),o.reset(),t.reset(),r.reset(),i.reset()},[e,o,t,r,i])}var Se="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOption/index.tsx",J;(function(e){e.Bottom="bottom",e.Top="top"})(J||(J={}));function ht({open:e,content:t,children:r}){const o=c.exports.useRef(null),i=c.exports.useRef(null),n=c.exports.useRef(null),s=c.exports.useContext(Oe),[a,x]=c.exports.useState(J.Bottom),[u,p]=c.exports.useState(null),[l,h]=c.exports.useState(0),f=()=>(i.current||(i.current=document.createElement("div")),i.current);return c.exports.useEffect(()=>{const m=f();return e&&document.body.appendChild(m),()=>{m.remove()}},[e]),c.exports.useEffect(()=>{if(!e||!s||!o.current||!n.current)return;const m=o.current.getBoundingClientRect(),y=n.current.getBoundingClientRect();let N=a,w=m.left+m.width/2,S=m.top+m.height,z=l;if(w+y.width/2>s.x+s.width){const d=w;w=s.x+s.width-y.width/2,z=d-w}if(w<s.x+y.width/2){const d=w;w=s.x+y.width/2,z=d-w}S>window.innerHeight-y.height&&(N===J.Bottom&&(N=J.Top),S=m.top-y.height),S<0&&(N===J.Top&&(N=J.Bottom),S=m.top+m.height),N!==a&&x(N),((u==null?void 0:u.x)!==w||u.y!==S)&&p({x:w,y:S}),z!==l&&h(z)}),g.exports.jsxDEV(g.exports.Fragment,{children:[c.exports.cloneElement(r,{ref:o}),e&&t&&Ve.exports.createPortal(g.exports.jsxDEV("div",{ref:n,className:"screenshots-option",style:{visibility:u?"visible":"hidden",left:u==null?void 0:u.x,top:u==null?void 0:u.y},"data-placement":a,children:[g.exports.jsxDEV("div",{className:"screenshots-option-container",children:t},void 0,!1,{fileName:Se,lineNumber:121,columnNumber:13},this),g.exports.jsxDEV("div",{className:"screenshots-option-arrow",style:{marginLeft:l}},void 0,!1,{fileName:Se,lineNumber:122,columnNumber:13},this)]},void 0,!0,{fileName:Se,lineNumber:111,columnNumber:11},this),f())]},void 0,!0)}var ke="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsButton/index.tsx";function X({title:e,icon:t,checked:r,disabled:o,option:i,onClick:n}){const s=["screenshots-button"],a=c.exports.useCallback(x=>{o||!n||n(x)},[o,n]);return r&&s.push("screenshots-button-checked"),o&&s.push("screenshots-button-disabled"),g.exports.jsxDEV(ht,{open:r,content:i,children:g.exports.jsxDEV("div",{className:s.join(" "),title:e,onClick:a,children:g.exports.jsxDEV("span",{className:t},void 0,!1,{fileName:ke,lineNumber:44,columnNumber:9},this)},void 0,!1,{fileName:ke,lineNumber:43,columnNumber:7},this)},void 0,!1,{fileName:ke,lineNumber:42,columnNumber:5},this)}var pt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ok/index.tsx";function mt(){const e=L(),t=I(),[,r]=H(),o=Ne(),[i]=U(),n=Ce(),s=c.exports.useCallback(()=>{r.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(a=>{o("onOk",a,i),n()},"image/png")})},[t,r,o,i,n]);return g.exports.jsxDEV(X,{title:e.operation_ok_title,icon:"icon-ok",onClick:s},void 0,!1,{fileName:pt,lineNumber:31,columnNumber:10},this)}var dt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Cancel/index.tsx";function xt(){const e=Ne(),t=Ce(),r=L(),o=c.exports.useCallback(()=>{e("onCancel"),t()},[e,t]);return g.exports.jsxDEV(X,{title:r.operation_cancel_title,icon:"icon-cancel",onClick:o},void 0,!1,{fileName:dt,lineNumber:17,columnNumber:10},this)}var bt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Save/index.tsx";function gt(){const e=L(),t=I(),[,r]=H(),[o]=U(),i=Ne(),n=Ce(),s=c.exports.useCallback(()=>{r.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(a=>{i("onSave",a,o),n()},"image/png")})},[t,r,o,i,n]);return g.exports.jsxDEV(X,{title:e.operation_save_title,icon:"icon-save",onClick:s},void 0,!1,{fileName:bt,lineNumber:31,columnNumber:10},this)}var vt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Redo/index.tsx";function yt(){const e=L(),[t,r]=H(),o=c.exports.useCallback(()=>{r.redo()},[r]);return g.exports.jsxDEV(X,{title:e.operation_redo_title,icon:"icon-redo",disabled:!t.stack.length||t.stack.length-1===t.index,onClick:o},void 0,!1,{fileName:vt,lineNumber:15,columnNumber:5},this)}var Nt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Undo/index.tsx";function Ct(){const e=L(),[t,r]=H(),o=c.exports.useCallback(()=>{r.undo()},[r]);return g.exports.jsxDEV(X,{title:e.operation_undo_title,icon:"icon-undo",disabled:t.index===-1,onClick:o},void 0,!1,{fileName:Nt,lineNumber:15,columnNumber:5},this)}var Re="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSize/index.tsx";function He({value:e,onChange:t}){const r=[3,6,9];return g.exports.jsxDEV("div",{className:"screenshots-size",children:r.map(o=>{const i=["screenshots-size-item"];return o===e&&i.push("screenshots-size-active"),g.exports.jsxDEV("div",{className:i.join(" "),onClick:()=>t&&t(o),children:g.exports.jsxDEV("div",{className:"screenshots-size-pointer",style:{width:o*1.8,height:o*1.8}},void 0,!1,{fileName:Re,lineNumber:22,columnNumber:13},this)},o,!1,{fileName:Re,lineNumber:21,columnNumber:11},this)})},void 0,!1,{fileName:Re,lineNumber:12,columnNumber:5},this)}function ee(e){const t=Z();c.exports.useEffect(()=>(t.on("mousedown",e),()=>{t.off("mousedown",e)}),[e,t])}function te(e){const t=Z();c.exports.useEffect(()=>(t.on("mousemove",e),()=>{t.off("mousemove",e)}),[e,t])}function se(e){const t=Z();c.exports.useEffect(()=>(t.on("mouseup",e),()=>{t.off("mouseup",e)}),[e,t])}var Xe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Mosaic/index.tsx";function de(e,t,r){if(!r)return[0,0,0,0];const{data:o,width:i}=r,n=t*i*4+e*4;return Array.from(o.slice(n,n+4))}function St(e,t){const{tiles:r,size:o}=t.data;r.forEach(i=>{const n=Math.round(i.color[0]),s=Math.round(i.color[1]),a=Math.round(i.color[2]),x=i.color[3]/255;e.fillStyle=`rgba(${n}, ${s}, ${a}, ${x})`,e.fillRect(i.x-o/2,i.y-o/2,o,o)})}function kt(){const e=L(),{image:t,width:r,height:o}=$(),[i,n]=A(),s=I(),[a,x]=H(),[u]=U(),[,p]=G(),[l,h]=c.exports.useState(3),f=c.exports.useRef(null),m=c.exports.useRef(null),y=i==="Mosaic",N=c.exports.useCallback(()=>{n.set("Mosaic"),p.set("crosshair")},[n,p]),w=c.exports.useCallback(()=>{y||(N(),x.clearSelect())},[y,N,x]),S=c.exports.useCallback(b=>{if(!y||m.current||!f.current||!s.current)return;const v=s.current.canvas.getBoundingClientRect(),C=b.clientX-v.x,R=b.clientY-v.y,E=l*2;m.current={name:"Mosaic",type:j.Source,data:{size:E,tiles:[{x:C,y:R,color:de(C,R,f.current)}]},editHistory:[],draw:St}},[y,l,s]),z=c.exports.useCallback(b=>{if(!y||!m.current||!s.current||!f.current)return;const v=s.current.canvas.getBoundingClientRect(),C=b.clientX-v.x,R=b.clientY-v.y,E=m.current.data.size,D=m.current.data.tiles;let k=D[D.length-1];if(!k)D.push({x:C,y:R,color:de(C,R,f.current)});else{const O=k.x-C,B=k.y-R;let V=Math.sqrt(O**2+B**2);const be=-B/V,ge=-O/V;for(;V>E;){const ne=Math.floor(k.x+E*ge),re=Math.floor(k.y+E*be);k={x:ne,y:re,color:de(ne,re,f.current)},D.push(k),V-=E}V>E/2&&D.push({x:C,y:R,color:de(C,R,f.current)})}a.top!==m.current?x.push(m.current):x.set(a)},[y,s,a,x]),d=c.exports.useCallback(()=>{!y||(m.current=null)},[y]);return ee(S),te(z),se(d),c.exports.useEffect(()=>{if(!u||!t||!y)return;const b=document.createElement("canvas"),v=b.getContext("2d");if(!v)return;b.width=u.width,b.height=u.height;const C=t.naturalWidth/r,R=t.naturalHeight/o;v.drawImage(t,u.x*C,u.y*R,u.width*C,u.height*R,0,0,u.width,u.height),f.current=v.getImageData(0,0,u.width,u.height)},[r,o,u,t,y]),g.exports.jsxDEV(X,{title:e.operation_mosaic_title,icon:"icon-mosaic",checked:y,onClick:w,option:g.exports.jsxDEV(He,{value:l,onChange:h},void 0,!1,{fileName:Xe,lineNumber:220,columnNumber:15},this)},void 0,!1,{fileName:Xe,lineNumber:215,columnNumber:5},this)}var Fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsColor/index.tsx";function Rt({value:e,onChange:t}){const r=["#ee5126","#fceb4d","#90e746","#51c0fa","#7a7a7a","#ffffff"];return g.exports.jsxDEV("div",{className:"screenshots-color",children:r.map(o=>{const i=["screenshots-color-item"];return o===e&&i.push("screenshots-color-active"),g.exports.jsxDEV("div",{className:i.join(" "),style:{backgroundColor:o},onClick:()=>t&&t(o)},o,!1,{fileName:Fe,lineNumber:19,columnNumber:11},this)})},void 0,!1,{fileName:Fe,lineNumber:12,columnNumber:5},this)}var we="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSizeColor/index.tsx";function ce({size:e,color:t,onSizeChange:r,onColorChange:o}){return g.exports.jsxDEV("div",{className:"screenshots-sizecolor",children:[g.exports.jsxDEV(He,{value:e,onChange:r},void 0,!1,{fileName:we,lineNumber:16,columnNumber:7},this),g.exports.jsxDEV(Rt,{value:t,onChange:o},void 0,!1,{fileName:we,lineNumber:17,columnNumber:7},this)]},void 0,!0,{fileName:we,lineNumber:15,columnNumber:5},this)}const wt=`
|
|
1
|
+
var Qe=Object.defineProperty,Ze=Object.defineProperties;var et=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var Be=(e,t,r)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))Ee.call(t,r)&&Be(e,r,t[r]);if(he)for(var r of he(t))je.call(t,r)&&Be(e,r,t[r]);return e},pe=(e,t)=>Ze(e,et(t));var Me=(e,t)=>{var r={};for(var o in e)Ee.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&he)for(var o of he(e))t.indexOf(o)<0&&je.call(e,o)&&(r[o]=e[o]);return r};import{R as Ve,r as c,j as g,a as _e,b as tt}from"./vendor.e3c417b2.js";const st=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const s of n.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerpolicy&&(n.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?n.credentials="include":i.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function o(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}};st();const $e={magnifier_position_label:"\u5750\u6807",operation_ok_title:"\u786E\u5B9A",operation_cancel_title:"\u53D6\u6D88",operation_save_title:"\u4FDD\u5B58",operation_redo_title:"\u91CD\u505A",operation_undo_title:"\u64A4\u9500",operation_mosaic_title:"\u9A6C\u8D5B\u514B",operation_text_title:"\u6587\u672C",operation_brush_title:"\u753B\u7B14",operation_arrow_title:"\u7BAD\u5934",operation_ellipse_title:"\u692D\u5706",operation_rectangle_title:"\u77E9\u5F62"};var ye=Ve.createContext({store:{url:void 0,image:null,width:0,height:0,lang:$e,emiterRef:{current:{}},canvasContextRef:{current:null},history:{index:-1,stack:[]},bounds:null,cursor:"move",operation:void 0},dispatcher:{call:void 0,setHistory:void 0,setBounds:void 0,setCursor:void 0,setOperation:void 0}});function $(){const{store:e}=c.exports.useContext(ye);return e}function L(){const{lang:e}=$();return e}var q="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsMagnifier/index.tsx";const K=100,Q=80;function nt({x:e,y:t}){const{width:r,height:o,image:i}=$(),n=L(),[s,a]=c.exports.useState(null),x=c.exports.useRef(null),u=c.exports.useRef(null),p=c.exports.useRef(null),[l,h]=c.exports.useState("000000");return c.exports.useLayoutEffect(()=>{if(!x.current)return;const f=x.current.getBoundingClientRect();let m=e+20,y=t+20;m+f.width>r&&(m=e-f.width-20),y+f.height>o&&(y=t-f.height-20),m<0&&(m=0),y<0&&(y=0),a({x:m,y})},[r,o,e,t]),c.exports.useEffect(()=>{if(!i||!u.current){p.current=null;return}if(p.current||(p.current=u.current.getContext("2d")),!p.current)return;const f=p.current;f.clearRect(0,0,K,Q);const m=i.naturalWidth/r,y=i.naturalHeight/o;f.drawImage(i,e*m-K/2,t*y-Q/2,K,Q,0,0,K,Q);const{data:N}=f.getImageData(Math.floor(K/2),Math.floor(Q/2),1,1),w=Array.from(N.slice(0,3)).map(S=>S>=16?S.toString(16):`0${S.toString(16)}`).join("").toUpperCase();h(w)},[r,o,i,e,t]),g.exports.jsxDEV("div",{ref:x,className:"screenshots-magnifier",style:{transform:`translate(${s==null?void 0:s.x}px, ${s==null?void 0:s.y}px)`},children:[g.exports.jsxDEV("div",{className:"screenshots-magnifier-body",children:g.exports.jsxDEV("canvas",{ref:u,className:"screenshots-magnifier-body-canvas",width:K,height:Q},void 0,!1,{fileName:q,lineNumber:97,columnNumber:9},this)},void 0,!1,{fileName:q,lineNumber:96,columnNumber:7},this),g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer",children:[g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer-item",children:[n.magnifier_position_label,": (",e,",",t,")"]},void 0,!0,{fileName:q,lineNumber:105,columnNumber:9},this),g.exports.jsxDEV("div",{className:"screenshots-magnifier-footer-item",children:["RGB: #",l]},void 0,!0,{fileName:q,lineNumber:108,columnNumber:9},this)]},void 0,!0,{fileName:q,lineNumber:104,columnNumber:7},this)]},void 0,!0,{fileName:q,lineNumber:89,columnNumber:5},this)}function rt({x:e,y:t},{x:r,y:o},i,n){return e>r&&([e,r]=[r,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0),r>i&&(r=i),t<0&&(t=0),o>n&&(o=n),{x:e,y:t,width:r-e,height:o-t}}function oe(){const{dispatcher:e}=c.exports.useContext(ye);return e}function U(){const{bounds:e}=$(),{setBounds:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t(null)},[t]);return[e,{set:r,reset:o}]}var me="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsBackground/index.tsx";function ot(){const{url:e,width:t,height:r}=$(),[o,i]=U(),n=c.exports.useRef(null),s=c.exports.useRef(null),[a,x]=c.exports.useState(null),u=c.exports.useCallback((l,h)=>{if(!n.current)return;const{x:f,y:m}=n.current.getBoundingClientRect();i.set(rt({x:l.x-f,y:l.y-m},{x:h.x-f,y:h.y-m},t,r))},[t,r,i]),p=c.exports.useCallback(l=>{s.current||o||l.button!==0||(s.current={x:l.clientX,y:l.clientY})},[o]);return c.exports.useEffect(()=>{const l=f=>{if(n.current){const m=n.current.getBoundingClientRect();f.clientX<m.left||f.clientY<m.top||f.clientX>m.right||f.clientY>m.bottom?x(null):x({x:f.clientX-m.x,y:f.clientY-m.y})}!s.current||u(s.current,{x:f.clientX,y:f.clientY})},h=f=>{!s.current||(u(s.current,{x:f.clientX,y:f.clientY}),s.current=null)};return window.addEventListener("mousemove",l),window.addEventListener("mouseup",h),()=>{window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",h)}},[u]),e?g.exports.jsxDEV("div",{ref:n,className:"screenshots-background",onMouseDown:p,children:[g.exports.jsxDEV("img",{className:"screenshots-background-image",src:e},void 0,!1,{fileName:me,lineNumber:109,columnNumber:7},this),g.exports.jsxDEV("div",{className:"screenshots-background-mask"},void 0,!1,{fileName:me,lineNumber:110,columnNumber:7},this),a&&!o&&g.exports.jsxDEV(nt,{x:a==null?void 0:a.x,y:a==null?void 0:a.y},void 0,!1,{fileName:me,lineNumber:111,columnNumber:31},this)]},void 0,!0,{fileName:me,lineNumber:104,columnNumber:5},this):null}var Ke;const Le=(Ke=window.devicePixelRatio)!=null?Ke:2;var de=Le<2?2:Le;function it(e,t,r,o){const i=e.clientX-r.x,n=e.clientY-r.y;let s=o.x,a=o.y,x=o.x+o.width,u=o.y+o.height;switch(t){case"top":a+=n;break;case"top-right":x+=i,a+=n;break;case"right":x+=i;break;case"right-bottom":x+=i,u+=n;break;case"bottom":u+=n;break;case"bottom-left":s+=i,u+=n;break;case"left":s+=i;break;case"left-top":s+=i,a+=n;break;case"move":s+=i,a+=n,x+=i,u+=n;break}return[{x:s,y:a},{x,y:u}]}function ct({x:e,y:t},{x:r,y:o},i,n,s,a){return e>r&&([e,r]=[r,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0,a==="move"&&(r=i.width)),r>n&&(r=n,a==="move"&&(e=r-i.width)),t<0&&(t=0,a==="move"&&(o=i.height)),o>s&&(o=s,a==="move"&&(t=o-i.height)),{x:e,y:t,width:Math.max(r-e,1),height:Math.max(o-t,1)}}var j;(function(e){e[e.Edit=0]="Edit",e[e.Source=1]="Source"})(j||(j={}));function Z(){const{emiterRef:e}=$(),t=c.exports.useCallback((n,s)=>{const a=e.current;Array.isArray(a[n])?a[n].push(s):a[n]=[s]},[e]),r=c.exports.useCallback((n,s)=>{const a=e.current;if(Array.isArray(a[n])){const x=a[n].findIndex(u=>u===s);x!==-1&&a[n].splice(x,1)}},[e]),o=c.exports.useCallback((n,...s)=>{const a=e.current;Array.isArray(a[n])&&a[n].forEach(x=>x(...s))},[e]),i=c.exports.useCallback(()=>{e.current={}},[e]);return{on:t,off:r,emit:o,reset:i}}function H(){const{history:e}=$(),{setHistory:t}=oe(),r=c.exports.useCallback(p=>{const{index:l,stack:h}=e;h.forEach(f=>{f.type===j.Source&&(f.isSelected=!1)}),p.type===j.Source?p.isSelected=!0:p.type===j.Edit&&(p.source.isSelected=!0),h.splice(l+1),h.push(p),t==null||t({index:h.length-1,stack:h})},[e,t]),o=c.exports.useCallback(()=>{const{stack:p}=e;p.pop(),t==null||t({index:p.length-1,stack:p})},[e,t]),i=c.exports.useCallback(()=>{const{index:p,stack:l}=e,h=l[p];h&&(h.type===j.Source?h.isSelected=!1:h.type===j.Edit&&h.source.editHistory.pop()),t==null||t({index:p<=0?-1:p-1,stack:l})},[e,t]),n=c.exports.useCallback(()=>{const{index:p,stack:l}=e,h=l[p+1];h&&(h.type===j.Source?h.isSelected=!1:h.type===j.Edit&&h.source.editHistory.push(h)),t==null||t({index:p>=l.length-1?l.length-1:p+1,stack:l})},[e,t]),s=c.exports.useCallback(p=>{t==null||t(T({},p))},[t]),a=c.exports.useCallback(p=>{e.stack.forEach(l=>{l.type===j.Source&&(l===p?l.isSelected=!0:l.isSelected=!1)}),t==null||t(T({},e))},[e,t]),x=c.exports.useCallback(()=>{e.stack.forEach(p=>{p.type===j.Source&&(p.isSelected=!1)}),t==null||t(T({},e))},[e,t]),u=c.exports.useCallback(()=>{t==null||t({index:-1,stack:[]})},[t]);return[{index:e.index,stack:e.stack,top:e.stack.slice(e.index,e.index+1)[0]},{push:r,pop:o,undo:i,redo:n,set:s,select:a,clearSelect:x,reset:u}]}function G(){const{cursor:e}=$(),{setCursor:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t("move")},[t]);return[e,{set:r,reset:o}]}function A(){const{operation:e}=$(),{setOperation:t}=oe(),r=c.exports.useCallback(i=>{t==null||t(i)},[t]),o=c.exports.useCallback(()=>{t==null||t(void 0)},[t]);return[e,{set:r,reset:o}]}function at(e,t,r,o){if(!t)return!1;const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const n=i.getContext("2d");if(!n)return!1;const{left:s,top:a}=t.getBoundingClientRect(),x=o.clientX-s,u=o.clientY-a;return[...r.stack.slice(0,r.index+1)].reverse().find(l=>{var h;return l.type!==j.Source?!1:(n.clearRect(0,0,e.width,e.height),(h=l.isHit)==null?void 0:h.call(l,n,l,{x,y:u}))})}var ie="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsCanvas/index.tsx";const ut=["top","right","bottom","left"];var P;(function(e){e.ResizeTop="top",e.ResizetopRight="top-right",e.ResizeRight="right",e.ResizeRightBottom="right-bottom",e.ResizeBottom="bottom",e.ResizeBottomLeft="bottom-left",e.ResizeLeft="left",e.ResizeLeftTop="left-top",e.Move="move"})(P||(P={}));const lt=[P.ResizeTop,P.ResizetopRight,P.ResizeRight,P.ResizeRightBottom,P.ResizeBottom,P.ResizeBottomLeft,P.ResizeLeft,P.ResizeLeftTop];var ft=c.exports.forwardRef(function(t,r){const{image:o,width:i,height:n}=$(),s=Z(),[a]=H(),[x]=G(),[u,p]=U(),[l]=A(),h=c.exports.useRef(),f=c.exports.useRef(null),m=c.exports.useRef(null),y=c.exports.useRef(null),N=c.exports.useRef(null),w=c.exports.useCallback(()=>{if(!o||!u||!N.current)return;const d=o.naturalWidth/i,b=o.naturalHeight/n,v=N.current;v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="low",v.setTransform(de,0,0,de,0,0),v.clearRect(0,0,u.width,u.height),v.drawImage(o,u.x*d,u.y*b,u.width*d,u.height*b,0,0,u.width,u.height),a.stack.slice(0,a.index+1).forEach(C=>{C.type===j.Source&&C.draw(v,C)})},[o,i,n,u,N,a]),S=c.exports.useCallback((d,b)=>{if(!(d.button!==0||!u))if(!l)h.current=b,f.current={x:d.clientX,y:d.clientY},m.current={x:u.x,y:u.y,width:u.width,height:u.height};else{const v=at(u,y.current,a,d.nativeEvent);v?s.emit("drawselect",v,d.nativeEvent):s.emit("mousedown",d.nativeEvent)}},[u,l,s,a]),z=c.exports.useCallback(d=>{if(!h.current||!f.current||!m.current||!u)return;const b=it(d,h.current,f.current,m.current);p.set(ct(b[0],b[1],u,i,n,h.current))},[i,n,u,p]);return c.exports.useLayoutEffect(()=>{if(!o||!u||!y.current){N.current=null;return}N.current||(N.current=y.current.getContext("2d")),w()},[o,u,w]),c.exports.useEffect(()=>{const d=v=>{if(l)s.emit("mousemove",v);else{if(!h.current||!f.current||!m.current)return;z(v)}},b=v=>{if(l)s.emit("mouseup",v);else{if(!h.current||!f.current||!m.current)return;z(v),h.current=void 0,f.current=null,m.current=null}};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",b)}},[z,l,s]),c.exports.useImperativeHandle(r,()=>N.current),u?g.exports.jsxDEV("div",{className:"screenshots-canvas",style:{left:u.x,top:u.y,width:u.width,height:u.height},children:[g.exports.jsxDEV("canvas",{ref:y,width:u.width*de,height:u.height*de,style:{width:u.width,height:u.height}},void 0,!1,{fileName:ie,lineNumber:200,columnNumber:7},this),g.exports.jsxDEV("div",{className:"screenshots-canvas-body",style:{cursor:x},onMouseDown:d=>S(d,"move")},void 0,!1,{fileName:ie,lineNumber:209,columnNumber:7},this),ut.map(d=>g.exports.jsxDEV("div",{className:`screenshots-canvas-border-${d}`},d,!1,{fileName:ie,lineNumber:217,columnNumber:16},this)),lt.map(d=>g.exports.jsxDEV("div",{className:`screenshots-canvas-point-${d}`,onMouseDown:b=>S(b,d)},d,!1,{fileName:ie,lineNumber:221,columnNumber:11},this))]},void 0,!0,{fileName:ie,lineNumber:191,columnNumber:5},this):null});function Ne(){const e=oe();return c.exports.useCallback((r,...o)=>{var i;(i=e.call)==null||i.call(e,r,...o)},[e])}function I(){const{canvasContextRef:e}=$();return e}function Ce(){const e=Z(),[,t]=U(),[,r]=G(),[,o]=H(),[,i]=A();return c.exports.useCallback(()=>{e.reset(),o.reset(),t.reset(),r.reset(),i.reset()},[e,o,t,r,i])}var Se="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOption/index.tsx",J;(function(e){e.Bottom="bottom",e.Top="top"})(J||(J={}));function ht({open:e,content:t,children:r}){const o=c.exports.useRef(null),i=c.exports.useRef(null),n=c.exports.useRef(null),s=c.exports.useContext(Oe),[a,x]=c.exports.useState(J.Bottom),[u,p]=c.exports.useState(null),[l,h]=c.exports.useState(0),f=()=>(i.current||(i.current=document.createElement("div")),i.current);return c.exports.useEffect(()=>{const m=f();return e&&document.body.appendChild(m),()=>{m.remove()}},[e]),c.exports.useEffect(()=>{if(!e||!s||!o.current||!n.current)return;const m=o.current.getBoundingClientRect(),y=n.current.getBoundingClientRect();let N=a,w=m.left+m.width/2,S=m.top+m.height,z=l;if(w+y.width/2>s.x+s.width){const d=w;w=s.x+s.width-y.width/2,z=d-w}if(w<s.x+y.width/2){const d=w;w=s.x+y.width/2,z=d-w}S>window.innerHeight-y.height&&(N===J.Bottom&&(N=J.Top),S=m.top-y.height),S<0&&(N===J.Top&&(N=J.Bottom),S=m.top+m.height),N!==a&&x(N),((u==null?void 0:u.x)!==w||u.y!==S)&&p({x:w,y:S}),z!==l&&h(z)}),g.exports.jsxDEV(g.exports.Fragment,{children:[c.exports.cloneElement(r,{ref:o}),e&&t&&_e.exports.createPortal(g.exports.jsxDEV("div",{ref:n,className:"screenshots-option",style:{visibility:u?"visible":"hidden",left:u==null?void 0:u.x,top:u==null?void 0:u.y},"data-placement":a,children:[g.exports.jsxDEV("div",{className:"screenshots-option-container",children:t},void 0,!1,{fileName:Se,lineNumber:121,columnNumber:13},this),g.exports.jsxDEV("div",{className:"screenshots-option-arrow",style:{marginLeft:l}},void 0,!1,{fileName:Se,lineNumber:122,columnNumber:13},this)]},void 0,!0,{fileName:Se,lineNumber:111,columnNumber:11},this),f())]},void 0,!0)}var Re="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsButton/index.tsx";function X({title:e,icon:t,checked:r,disabled:o,option:i,onClick:n}){const s=["screenshots-button"],a=c.exports.useCallback(x=>{o||!n||n(x)},[o,n]);return r&&s.push("screenshots-button-checked"),o&&s.push("screenshots-button-disabled"),g.exports.jsxDEV(ht,{open:r,content:i,children:g.exports.jsxDEV("div",{className:s.join(" "),title:e,onClick:a,children:g.exports.jsxDEV("span",{className:t},void 0,!1,{fileName:Re,lineNumber:44,columnNumber:9},this)},void 0,!1,{fileName:Re,lineNumber:43,columnNumber:7},this)},void 0,!1,{fileName:Re,lineNumber:42,columnNumber:5},this)}var pt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ok/index.tsx";function mt(){const e=L(),t=I(),[,r]=H(),o=Ne(),[i]=U(),n=Ce(),s=c.exports.useCallback(()=>{r.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(a=>{o("onOk",a,i),n()},"image/png")})},[t,r,o,i,n]);return g.exports.jsxDEV(X,{title:e.operation_ok_title,icon:"icon-ok",onClick:s},void 0,!1,{fileName:pt,lineNumber:31,columnNumber:10},this)}var dt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Cancel/index.tsx";function xt(){const e=Ne(),t=Ce(),r=L(),o=c.exports.useCallback(()=>{e("onCancel"),t()},[e,t]);return g.exports.jsxDEV(X,{title:r.operation_cancel_title,icon:"icon-cancel",onClick:o},void 0,!1,{fileName:dt,lineNumber:17,columnNumber:10},this)}var bt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Save/index.tsx";function gt(){const e=L(),t=I(),[,r]=H(),[o]=U(),i=Ne(),n=Ce(),s=c.exports.useCallback(()=>{r.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(a=>{i("onSave",a,o),n()},"image/png")})},[t,r,o,i,n]);return g.exports.jsxDEV(X,{title:e.operation_save_title,icon:"icon-save",onClick:s},void 0,!1,{fileName:bt,lineNumber:31,columnNumber:10},this)}var vt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Redo/index.tsx";function yt(){const e=L(),[t,r]=H(),o=c.exports.useCallback(()=>{r.redo()},[r]);return g.exports.jsxDEV(X,{title:e.operation_redo_title,icon:"icon-redo",disabled:!t.stack.length||t.stack.length-1===t.index,onClick:o},void 0,!1,{fileName:vt,lineNumber:15,columnNumber:5},this)}var Nt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Undo/index.tsx";function Ct(){const e=L(),[t,r]=H(),o=c.exports.useCallback(()=>{r.undo()},[r]);return g.exports.jsxDEV(X,{title:e.operation_undo_title,icon:"icon-undo",disabled:t.index===-1,onClick:o},void 0,!1,{fileName:Nt,lineNumber:15,columnNumber:5},this)}var ke="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSize/index.tsx";function He({value:e,onChange:t}){const r=[3,6,9];return g.exports.jsxDEV("div",{className:"screenshots-size",children:r.map(o=>{const i=["screenshots-size-item"];return o===e&&i.push("screenshots-size-active"),g.exports.jsxDEV("div",{className:i.join(" "),onClick:()=>t&&t(o),children:g.exports.jsxDEV("div",{className:"screenshots-size-pointer",style:{width:o*1.8,height:o*1.8}},void 0,!1,{fileName:ke,lineNumber:22,columnNumber:13},this)},o,!1,{fileName:ke,lineNumber:21,columnNumber:11},this)})},void 0,!1,{fileName:ke,lineNumber:12,columnNumber:5},this)}function ee(e){const t=Z();c.exports.useEffect(()=>(t.on("mousedown",e),()=>{t.off("mousedown",e)}),[e,t])}function te(e){const t=Z();c.exports.useEffect(()=>(t.on("mousemove",e),()=>{t.off("mousemove",e)}),[e,t])}function se(e){const t=Z();c.exports.useEffect(()=>(t.on("mouseup",e),()=>{t.off("mouseup",e)}),[e,t])}var Xe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Mosaic/index.tsx";function xe(e,t,r){if(!r)return[0,0,0,0];const{data:o,width:i}=r,n=t*i*4+e*4;return Array.from(o.slice(n,n+4))}function St(e,t){const{tiles:r,size:o}=t.data;r.forEach(i=>{const n=Math.round(i.color[0]),s=Math.round(i.color[1]),a=Math.round(i.color[2]),x=i.color[3]/255;e.fillStyle=`rgba(${n}, ${s}, ${a}, ${x})`,e.fillRect(i.x-o/2,i.y-o/2,o,o)})}function Rt(){const e=L(),{image:t,width:r,height:o}=$(),[i,n]=A(),s=I(),[a,x]=H(),[u]=U(),[,p]=G(),[l,h]=c.exports.useState(3),f=c.exports.useRef(null),m=c.exports.useRef(null),y=i==="Mosaic",N=c.exports.useCallback(()=>{n.set("Mosaic"),p.set("crosshair")},[n,p]),w=c.exports.useCallback(()=>{y||(N(),x.clearSelect())},[y,N,x]),S=c.exports.useCallback(b=>{if(!y||m.current||!f.current||!s.current)return;const v=s.current.canvas.getBoundingClientRect(),C=b.clientX-v.x,k=b.clientY-v.y,E=l*2;m.current={name:"Mosaic",type:j.Source,data:{size:E,tiles:[{x:C,y:k,color:xe(C,k,f.current)}]},editHistory:[],draw:St}},[y,l,s]),z=c.exports.useCallback(b=>{if(!y||!m.current||!s.current||!f.current)return;const v=s.current.canvas.getBoundingClientRect(),C=b.clientX-v.x,k=b.clientY-v.y,E=m.current.data.size,D=m.current.data.tiles;let R=D[D.length-1];if(!R)D.push({x:C,y:k,color:xe(C,k,f.current)});else{const O=R.x-C,B=R.y-k;let _=Math.sqrt(O**2+B**2);const ge=-B/_,ve=-O/_;for(;_>E;){const ne=Math.floor(R.x+E*ve),re=Math.floor(R.y+E*ge);R={x:ne,y:re,color:xe(ne,re,f.current)},D.push(R),_-=E}_>E/2&&D.push({x:C,y:k,color:xe(C,k,f.current)})}a.top!==m.current?x.push(m.current):x.set(a)},[y,s,a,x]),d=c.exports.useCallback(()=>{!y||(m.current=null)},[y]);return ee(S),te(z),se(d),c.exports.useEffect(()=>{if(!u||!t||!y)return;const b=document.createElement("canvas"),v=b.getContext("2d");if(!v)return;b.width=u.width,b.height=u.height;const C=t.naturalWidth/r,k=t.naturalHeight/o;v.drawImage(t,u.x*C,u.y*k,u.width*C,u.height*k,0,0,u.width,u.height),f.current=v.getImageData(0,0,u.width,u.height)},[r,o,u,t,y]),g.exports.jsxDEV(X,{title:e.operation_mosaic_title,icon:"icon-mosaic",checked:y,onClick:w,option:g.exports.jsxDEV(He,{value:l,onChange:h},void 0,!1,{fileName:Xe,lineNumber:220,columnNumber:15},this)},void 0,!1,{fileName:Xe,lineNumber:215,columnNumber:5},this)}var Fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsColor/index.tsx";function kt({value:e,onChange:t}){const r=["#ee5126","#fceb4d","#90e746","#51c0fa","#7a7a7a","#ffffff"];return g.exports.jsxDEV("div",{className:"screenshots-color",children:r.map(o=>{const i=["screenshots-color-item"];return o===e&&i.push("screenshots-color-active"),g.exports.jsxDEV("div",{className:i.join(" "),style:{backgroundColor:o},onClick:()=>t&&t(o)},o,!1,{fileName:Fe,lineNumber:19,columnNumber:11},this)})},void 0,!1,{fileName:Fe,lineNumber:12,columnNumber:5},this)}var we="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSizeColor/index.tsx";function ce({size:e,color:t,onSizeChange:r,onColorChange:o}){return g.exports.jsxDEV("div",{className:"screenshots-sizecolor",children:[g.exports.jsxDEV(He,{value:e,onChange:r},void 0,!1,{fileName:we,lineNumber:16,columnNumber:7},this),g.exports.jsxDEV(kt,{value:t,onChange:o},void 0,!1,{fileName:we,lineNumber:17,columnNumber:7},this)]},void 0,!0,{fileName:we,lineNumber:15,columnNumber:5},this)}const wt=`
|
|
2
2
|
min-width: 0 !important;
|
|
3
3
|
width: 0 !important;
|
|
4
4
|
min-height: 0 !important;
|
|
@@ -9,6 +9,6 @@ position: absolute !important;
|
|
|
9
9
|
z-index: -1000 !important;
|
|
10
10
|
top:0 !important;
|
|
11
11
|
right:0 !important;
|
|
12
|
-
`,Dt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","text-indent","padding-left","padding-right","border-width","box-sizing","white-space","word-break"];let W;function zt(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing")||t.getPropertyValue("-moz-box-sizing")||t.getPropertyValue("-webkit-box-sizing"),o=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),i=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{sizingStyle:Dt.map(s=>`${s}:${t.getPropertyValue(s)}`).join(";"),paddingSize:o,borderSize:i,boxSizing:r}}function Et(e,t,r,o){W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),document.body.appendChild(W));const{paddingSize:i,borderSize:n,boxSizing:s,sizingStyle:a}=zt(e);W.setAttribute("style",`${a};${wt};max-width:${r}px;max-height:${o}px`),W.value=t||" ";let x=W.scrollWidth,u=W.scrollHeight;return s==="border-box"?(x+=n,u+=n):s==="content-box"&&(x-=i,u-=i),{width:Math.min(x,r),height:Math.min(u,o)}}var jt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsTextarea/index.tsx";function Bt({x:e,y:t,maxWidth:r,maxHeight:o,size:i,color:n,value:s,onChange:a,onBlur:x}){const u=c.exports.useRef(null),p=c.exports.useRef(null),[l,h]=c.exports.useState(0),[f,m]=c.exports.useState(0),y=()=>(u.current||(u.current=document.createElement("div")),u.current);return c.exports.useLayoutEffect(()=>(u.current&&(document.body.appendChild(u.current),requestAnimationFrame(()=>{var N;(N=p.current)==null||N.focus()})),()=>{var N;(N=u.current)==null||N.remove()}),[]),c.exports.useLayoutEffect(()=>{if(!p.current)return;const{width:N,height:w}=Et(p.current,s,r,o);h(N),m(w)},[s,r,o]),
|
|
13
|
-
`).forEach((u,p)=>{e.fillText(u,n+x.x,s+x.y+p*r)})}function
|
|
14
|
-
`).forEach(l=>{const h=e.measureText(l);o<h.width&&(o=h.width),i+=t.data.size});const{x:n,y:s}=t.editHistory.reduce((l,{data:h})=>({x:l.x+h.x2-h.x1,y:l.y+h.y2-h.y1}),{x:0,y:0}),a=t.data.x+n,x=t.data.y+s,u=a+o,p=x+i;return r.x>=a&&r.x<=u&&r.y>=x&&r.y<=p}function Vt(){const e=L(),[t,r]=H(),[o]=U(),[i,n]=A(),[,s]=G(),a=I(),[x,u]=c.exports.useState(3),[p,l]=c.exports.useState("#ee5126"),h=c.exports.useRef(null),f=c.exports.useRef(null),[m,y]=c.exports.useState(null),[N,w]=c.exports.useState(""),S=i==="Text",z=c.exports.useCallback(()=>{n.set("Text"),s.set("default")},[n,s]),d=c.exports.useCallback(()=>{S||(z(),r.clearSelect())},[S,z,r]),b=c.exports.useCallback(B=>{h.current&&(h.current.data.size=ze[B]),u(B)},[]),v=c.exports.useCallback(B=>{h.current&&(h.current.data.color=B),l(B)},[]),C=c.exports.useCallback(B=>{w(B),S&&h.current&&(h.current.data.text=B)},[S]),R=c.exports.useCallback(()=>{h.current&&h.current.data.text&&r.push(h.current),h.current=null,w(""),y(null)},[r]),E=c.exports.useCallback((B,V)=>{B.name==="Text"&&(z(),f.current={type:j.Edit,data:{x1:V.clientX,y1:V.clientY,x2:V.clientX,y2:V.clientY},source:B},r.select(B))},[z,r]),D=c.exports.useCallback(B=>{if(!S||!a.current||h.current||!o)return;const{left:V,top:be}=a.current.canvas.getBoundingClientRect(),ge=window.getComputedStyle(a.current.canvas).fontFamily,ne=B.clientX-V,re=B.clientY-be;h.current={name:"Text",type:j.Source,data:{size:ze[x],color:p,fontFamily:ge,x:ne,y:re,text:""},editHistory:[],draw:Mt,isHit:_t},y({x:B.clientX,y:B.clientY,maxWidth:o.width-ne,maxHeight:o.height-re})},[S,x,p,o,a]),k=c.exports.useCallback(B=>{!S||f.current&&(f.current.data.x2=B.clientX,f.current.data.y2=B.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),r.push(f.current)):r.set(t))},[S,t,r]),O=c.exports.useCallback(()=>{!S||(f.current=null)},[S]);return ae(E),ee(D),te(k),se(O),g.exports.jsxDEV(g.exports.Fragment,{children:[g.exports.jsxDEV(X,{title:e.operation_text_title,icon:"icon-text",checked:S,onClick:d,option:g.exports.jsxDEV(ce,{size:x,color:p,onSizeChange:b,onColorChange:v},void 0,!1,{fileName:De,lineNumber:261,columnNumber:11},this)},void 0,!1,{fileName:De,lineNumber:255,columnNumber:7},this),S&&m&&g.exports.jsxDEV(Bt,{x:m.x,y:m.y,maxWidth:m.maxWidth,maxHeight:m.maxHeight,size:ze[x],color:p,value:N,onChange:C,onBlur:R},void 0,!1,{fileName:De,lineNumber:265,columnNumber:9},this)]},void 0,!0)}const Ye=4;function M(e,t,r){e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.arc(t,r,Ye,0,2*Math.PI),e.fill(),e.stroke()}function xe(e,t,r){t.draw(e,t);const{data:o}=e.getImageData(r.x,r.y,1,1);return o.some(i=>i!==0)}function _(e,t,r){if(!e)return!1;const{left:o,top:i}=e.getBoundingClientRect(),n=t.clientX-o,s=t.clientY-i;return(r.x-n)**2+(r.y-s)**2<Ye**2}function $t(e,t){const{size:r,color:o,points:i}=t.data;e.lineCap="round",e.lineJoin="round",e.lineWidth=r,e.strokeStyle=o;const n=t.editHistory.reduce((s,{data:a})=>({x:s.x+a.x2-a.x1,y:s.y+a.y2-a.y1}),{x:0,y:0});e.beginPath(),i.forEach((s,a)=>{a===0?e.moveTo(s.x+n.x,s.y+n.y):e.lineTo(s.x+n.x,s.y+n.y)}),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.beginPath(),i.forEach((s,a)=>{a===0?e.moveTo(s.x+n.x,s.y+n.y):e.lineTo(s.x+n.x,s.y+n.y)}),e.stroke())}var Pe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Brush/index.tsx";function Lt(){const e=L(),[,t]=G(),[r,o]=A(),i=I(),[n,s]=H(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=r==="Brush",m=c.exports.useCallback(()=>{o.set("Brush"),t.set("default")},[o,t]),y=c.exports.useCallback(()=>{f||(m(),s.clearSelect())},[f,m,s]),N=c.exports.useCallback((d,b)=>{d.name==="Brush"&&(m(),h.current={type:j.Edit,data:{x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},s.select(d))},[m,s]),w=c.exports.useCallback(d=>{if(!f||l.current||!i.current)return;const{left:b,top:v}=i.current.canvas.getBoundingClientRect();l.current={name:"Brush",type:j.Source,data:{size:a,color:u,points:[{x:d.clientX-b,y:d.clientY-v}]},editHistory:[],draw:$t,isHit:xe}},[f,i,a,u]),S=c.exports.useCallback(d=>{if(!(!f||!i.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,n.top!==h.current?(h.current.source.editHistory.push(h.current),s.push(h.current)):s.set(n);else if(l.current){const{left:b,top:v}=i.current.canvas.getBoundingClientRect();l.current.data.points.push({x:d.clientX-b,y:d.clientY-v}),n.top!==l.current?s.push(l.current):s.set(n)}}},[f,n,i,s]),z=c.exports.useCallback(()=>{!f||(l.current&&s.clearSelect(),l.current=null,h.current=null)},[f,s]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_brush_title,icon:"icon-brush",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Pe,lineNumber:166,columnNumber:15},this)},void 0,!1,{fileName:Pe,lineNumber:161,columnNumber:5},this)}function Te(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===ue.Move?(t+=s,r+=a,o+=s,i+=a):n.type===ue.MoveStart?(t+=s,r+=a):n.type===ue.MoveEnd&&(o+=s,i+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Ht(e,t){const{size:r,color:o,x1:i,x2:n,y1:s,y2:a}=Te(t);e.lineCap="round",e.lineJoin="bevel",e.lineWidth=r,e.strokeStyle=o;const x=n-i,u=a-s,p=r*3,l=Math.atan2(u,x);e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.lineTo(n-p*Math.cos(l-Math.PI/6),a-p*Math.sin(l-Math.PI/6)),e.moveTo(n,a),e.lineTo(n-p*Math.cos(l+Math.PI/6),a-p*Math.sin(l+Math.PI/6)),e.stroke(),t.isSelected&&(M(e,i,s),M(e,n,a))}var Ue="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Arrow/index.tsx",ue;(function(e){e[e.Move=0]="Move",e[e.MoveStart=1]="MoveStart",e[e.MoveEnd=2]="MoveEnd"})(ue||(ue={}));function Xt(){const e=L(),[,t]=G(),[r,o]=A(),[i,n]=H(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=r==="Arrow",m=c.exports.useCallback(()=>{o.set("Arrow"),t.set("default")},[o,t]),y=c.exports.useCallback(()=>{f||(m(),n.clearSelect())},[f,m,n]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Arrow"||!s.current)return;const v=d;m();const{x1:C,y1:R,x2:E,y2:D}=Te(v);let k=0;_(s.current.canvas,b,{x:C,y:R})?k=1:_(s.current.canvas,b,{x:E,y:D})&&(k=2),h.current={type:j.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:v},n.select(d)},[s,m,n]),w=c.exports.useCallback(d=>{if(!f||l.current||!s.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current={name:"Arrow",type:j.Source,data:{size:a,color:u,x1:d.clientX-b,y1:d.clientY-v,x2:d.clientX-b,y2:d.clientY-v},editHistory:[],draw:Ht,isHit:xe}},[f,u,a,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,i.top!==h.current?(h.current.source.editHistory.push(h.current),n.push(h.current)):n.set(i);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current.data.x2=d.clientX-b,l.current.data.y2=d.clientY-v,i.top!==l.current?n.push(l.current):n.set(i)}}},[f,i,s,n]),z=c.exports.useCallback(()=>{!f||(l.current&&n.clearSelect(),l.current=null,h.current=null)},[f,n]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_arrow_title,icon:"icon-arrow",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Ue,lineNumber:190,columnNumber:15},this)},void 0,!1,{fileName:Ue,lineNumber:185,columnNumber:5},this)}function Ge(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===F.Move?(t+=s,r+=a,o+=s,i+=a):n.type===F.ResizeTop?r+=a:n.type===F.ResizeRightTop?(o+=s,r+=a):n.type===F.ResizeRight?o+=s:n.type===F.ResizeRightBottom?(o+=s,i+=a):n.type===F.ResizeBottom?i+=a:n.type===F.ResizeLeftBottom?(t+=s,i+=a):n.type===F.ResizeLeft?t+=s:n.type===F.ResizeLeftTop&&(t+=s,r+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Ft(e,t){const{size:r,color:o,x1:i,y1:n,x2:s,y2:a}=Ge(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=r,e.strokeStyle=o;const x=(i+s)/2,u=(n+a)/2,p=Math.abs(s-i)/2,l=Math.abs(a-n)/2,h=.5522848,f=p*h,m=l*h;e.beginPath(),e.moveTo(x-p,u),e.bezierCurveTo(x-p,u-m,x-f,u-l,x,u-l),e.bezierCurveTo(x+f,u-l,x+p,u-m,x+p,u),e.bezierCurveTo(x+p,u+m,x+f,u+l,x,u+l),e.bezierCurveTo(x-f,u+l,x-p,u+m,x-p,u),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,a),e.lineTo(i,a),e.closePath(),e.stroke(),M(e,(i+s)/2,n),M(e,s,n),M(e,s,(n+a)/2),M(e,s,a),M(e,(i+s)/2,a),M(e,i,a),M(e,i,(n+a)/2),M(e,i,n))}var Ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ellipse/index.tsx",F;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(F||(F={}));function Yt(){const e=L(),[t,r]=H(),[o,i]=A(),[,n]=G(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=o==="Ellipse",m=c.exports.useCallback(()=>{i.set("Ellipse"),n.set("crosshair")},[i,n]),y=c.exports.useCallback(()=>{f||(m(),r.clearSelect())},[f,m,r]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Ellipse"||!s.current)return;const v=d;m();const{x1:C,y1:R,x2:E,y2:D}=Ge(v);let k=0;_(s.current.canvas,b,{x:(C+E)/2,y:R})?k=1:_(s.current.canvas,b,{x:E,y:R})?k=2:_(s.current.canvas,b,{x:E,y:(R+D)/2})?k=3:_(s.current.canvas,b,{x:E,y:D})?k=4:_(s.current.canvas,b,{x:(C+E)/2,y:D})?k=5:_(s.current.canvas,b,{x:C,y:D})?k=6:_(s.current.canvas,b,{x:C,y:(R+D)/2})?k=7:_(s.current.canvas,b,{x:C,y:R})&&(k=8),h.current={type:j.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:v},r.select(d)},[s,m,r]),w=c.exports.useCallback(d=>{if(!f||!s.current||l.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=d.clientX-b,R=d.clientY-v;l.current={name:"Ellipse",type:j.Source,data:{size:a,color:u,x1:C,y1:R,x2:C,y2:R},editHistory:[],draw:Ft,isHit:xe}},[f,a,u,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,t.top!==h.current?(h.current.source.editHistory.push(h.current),r.push(h.current)):r.set(t);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current.data.x2=d.clientX-b,l.current.data.y2=d.clientY-v,t.top!==l.current?r.push(l.current):r.set(t)}}},[f,s,t,r]),z=c.exports.useCallback(()=>{!f||(l.current&&r.clearSelect(),l.current=null,h.current=null)},[f,r]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_ellipse_title,icon:"icon-ellipse",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Ae,lineNumber:242,columnNumber:15},this)},void 0,!1,{fileName:Ae,lineNumber:237,columnNumber:5},this)}function Ie(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===Y.Move?(t+=s,r+=a,o+=s,i+=a):n.type===Y.ResizeTop?r+=a:n.type===Y.ResizeRightTop?(o+=s,r+=a):n.type===Y.ResizeRight?o+=s:n.type===Y.ResizeRightBottom?(o+=s,i+=a):n.type===Y.ResizeBottom?i+=a:n.type===Y.ResizeLeftBottom?(t+=s,i+=a):n.type===Y.ResizeLeft?t+=s:n.type===Y.ResizeLeftTop&&(t+=s,r+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Pt(e,t){const{size:r,color:o,x1:i,y1:n,x2:s,y2:a}=Ie(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=r,e.strokeStyle=o,e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,a),e.lineTo(i,a),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",M(e,(i+s)/2,n),M(e,s,n),M(e,s,(n+a)/2),M(e,s,a),M(e,(i+s)/2,a),M(e,i,a),M(e,i,(n+a)/2),M(e,i,n))}var We="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Rectangle/index.tsx",Y;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(Y||(Y={}));function Tt(){const e=L(),[t,r]=H(),[o,i]=A(),[,n]=G(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=o==="Rectangle",m=c.exports.useCallback(()=>{i.set("Rectangle"),n.set("crosshair")},[i,n]),y=c.exports.useCallback(()=>{f||(m(),r.clearSelect())},[f,m,r]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Rectangle"||!s.current)return;const v=d;m();const{x1:C,y1:R,x2:E,y2:D}=Ie(v);let k=0;_(s.current.canvas,b,{x:(C+E)/2,y:R})?k=1:_(s.current.canvas,b,{x:E,y:R})?k=2:_(s.current.canvas,b,{x:E,y:(R+D)/2})?k=3:_(s.current.canvas,b,{x:E,y:D})?k=4:_(s.current.canvas,b,{x:(C+E)/2,y:D})?k=5:_(s.current.canvas,b,{x:C,y:D})?k=6:_(s.current.canvas,b,{x:C,y:(R+D)/2})?k=7:_(s.current.canvas,b,{x:C,y:R})&&(k=8),h.current={type:j.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},r.select(d)},[s,m,r]),w=c.exports.useCallback(d=>{if(!f||!s.current||l.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=d.clientX-b,R=d.clientY-v;l.current={name:"Rectangle",type:j.Source,data:{size:a,color:u,x1:C,y1:R,x2:C,y2:R},editHistory:[],draw:Pt,isHit:xe}},[f,a,u,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,t.top!==h.current?(h.current.source.editHistory.push(h.current),r.push(h.current)):r.set(t);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=l.current.data;C.x2=d.clientX-b,C.y2=d.clientY-v,t.top!==l.current?r.push(l.current):r.set(t)}}},[f,s,t,r]),z=c.exports.useCallback(()=>{!f||(l.current&&r.clearSelect(),l.current=null,h.current=null)},[f,r]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_rectangle_title,icon:"icon-rectangle",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:We,lineNumber:242,columnNumber:15},this)},void 0,!1,{fileName:We,lineNumber:237,columnNumber:5},this)}var Ut=[Tt,Yt,Xt,Lt,Vt,kt,"|",Ct,yt,"|",gt,xt,mt];var le="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOperations/index.tsx";const Oe=_e.createContext(null);function Gt(){const{width:e,height:t}=$(),[r]=U(),[o,i]=c.exports.useState(null),[n,s]=c.exports.useState(null),a=c.exports.useRef(null),x=c.exports.useCallback(p=>{p.stopPropagation()},[]),u=c.exports.useCallback(p=>{p.preventDefault(),p.stopPropagation()},[]);return c.exports.useEffect(()=>{if(!r||!a.current)return;const p=a.current.getBoundingClientRect();let l=r.x+r.width-p.width,h=r.y+r.height+10;l<0&&(l=0),l>e-p.width&&(l=e-p.width),h>t-p.height&&(h=t-p.height-10),((n==null?void 0:n.x)!==l||n.y!==h)&&s({x:l,y:h}),((o==null?void 0:o.x)!==p.x||o.y!==p.y||o.width!==p.width||o.height!==p.height)&&i({x:p.x,y:p.y,width:p.width,height:p.height})}),r?g.exports.jsxDEV(Oe.Provider,{value:o,children:g.exports.jsxDEV("div",{ref:a,className:"screenshots-operations",style:{visibility:n?"visible":"hidden",left:n==null?void 0:n.x,top:n==null?void 0:n.y},onDoubleClick:x,onContextMenu:u,children:g.exports.jsxDEV("div",{className:"screenshots-operations-buttons",children:Ut.map((p,l)=>p==="|"?g.exports.jsxDEV("div",{className:"screenshots-operations-divider"},l,!1,{fileName:le,lineNumber:91,columnNumber:22},this):g.exports.jsxDEV(p,{},l,!1,{fileName:le,lineNumber:93,columnNumber:22},this))},void 0,!1,{fileName:le,lineNumber:88,columnNumber:9},this)},void 0,!1,{fileName:le,lineNumber:77,columnNumber:7},this)},void 0,!1,{fileName:le,lineNumber:76,columnNumber:5},this):null}function At(e){const[t,r]=c.exports.useState(null);return c.exports.useEffect(()=>{if(e==null)return;const o=document.createElement("img"),i=()=>r(o),n=()=>r(null);return o.addEventListener("load",i),o.addEventListener("error",n),o.src=e,()=>{o.removeEventListener("load",i),o.removeEventListener("error",n)}},[e]),t}var fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/index.tsx";function It(s){var a=s,{url:e,width:t,height:r,lang:o,className:i}=a,n=Me(a,["url","width","height","lang","className"]);const x=At(e),u=c.exports.useRef(null),p=c.exports.useRef({}),[l,h]=c.exports.useState({index:-1,stack:[]}),[f,m]=c.exports.useState(null),[y,N]=c.exports.useState("move"),[w,S]=c.exports.useState(void 0),z={url:e,width:t,height:r,image:x,lang:T(T({},$e),o),emiterRef:p,canvasContextRef:u,history:l,bounds:f,cursor:y,operation:w},d=c.exports.useCallback((D,...k)=>{const O=n[D];typeof O=="function"&&O(...k)},[n]),b={call:d,setHistory:h,setBounds:m,setCursor:N,setOperation:S},v=["screenshots"];i&&v.push(i);const C=()=>{p.current={},h({index:-1,stack:[]}),m(null),N("move"),S(void 0)},R=c.exports.useCallback(D=>{D.button!==0||!f||!u.current||u.current.canvas.toBlob(k=>{d("onOk",k,f),C()},"image/png")},[f,d]),E=c.exports.useCallback(D=>{D.button===2&&(D.preventDefault(),d("onCancel"),C())},[d]);return g.exports.jsxDEV(ve.Provider,{value:{store:z,dispatcher:b},children:g.exports.jsxDEV("div",{className:v.join(" "),style:{width:t,height:r},onDoubleClick:R,onContextMenu:E,children:[g.exports.jsxDEV(ot,{},void 0,!1,{fileName:fe,lineNumber:118,columnNumber:9},this),g.exports.jsxDEV(ft,{ref:u},void 0,!1,{fileName:fe,lineNumber:119,columnNumber:9},this),g.exports.jsxDEV(Gt,{},void 0,!1,{fileName:fe,lineNumber:120,columnNumber:9},this)]},void 0,!0,{fileName:fe,lineNumber:112,columnNumber:7},this)},void 0,!1,{fileName:fe,lineNumber:111,columnNumber:5},this)}var Je="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/electron/app.tsx";function Wt(){const[e,t]=c.exports.useState(void 0),[r,o]=c.exports.useState(window.innerWidth),[i,n]=c.exports.useState(window.innerHeight),[s,a]=c.exports.useState(void 0),[x,u]=c.exports.useState(void 0),p=c.exports.useCallback(async(f,m)=>{!s||!f||window.screenshots.save(await f.arrayBuffer(),{bounds:m,display:s})},[s]),l=c.exports.useCallback(()=>{window.screenshots.cancel()},[]),h=c.exports.useCallback(async(f,m)=>{!s||!f||window.screenshots.ok(await f.arrayBuffer(),{bounds:m,display:s})},[s]);return c.exports.useEffect(()=>{const f=y=>{u(y)},m=async(y,N)=>{a(y),t(N)};return window.screenshots.on("setLang",f),window.screenshots.on("capture",m),window.screenshots.ready(),()=>{window.screenshots.off("capture",m),window.screenshots.off("setLang",f)}},[]),c.exports.useEffect(()=>{const f=()=>{o(window.innerWidth),n(window.innerHeight)},m=({code:y})=>{y==="Escape"&&l()};return window.addEventListener("resize",f),window.addEventListener("keyup",m),()=>{window.removeEventListener("resize",f),window.removeEventListener("keyup",m)}},[l]),g.exports.jsxDEV("div",{className:"body",children:g.exports.jsxDEV(It,{url:e,width:r,height:i,lang:x,onSave:p,onCancel:l,onOk:h},void 0,!1,{fileName:Je,lineNumber:88,columnNumber:7},this)},void 0,!1,{fileName:Je,lineNumber:87,columnNumber:5},this)}var qe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/electron/index.tsx";tt.render(g.exports.jsxDEV(c.exports.StrictMode,{children:g.exports.jsxDEV(Wt,{},void 0,!1,{fileName:qe,lineNumber:7,columnNumber:5},globalThis)},void 0,!1,{fileName:qe,lineNumber:6,columnNumber:3},globalThis),document.getElementById("app"));
|
|
12
|
+
`,Dt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","text-indent","padding-left","padding-right","border-width","box-sizing","white-space","word-break"];let W;function zt(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing")||t.getPropertyValue("-moz-box-sizing")||t.getPropertyValue("-webkit-box-sizing"),o=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),i=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{sizingStyle:Dt.map(s=>`${s}:${t.getPropertyValue(s)}`).join(";"),paddingSize:o,borderSize:i,boxSizing:r}}function Et(e,t,r,o){W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),document.body.appendChild(W));const{paddingSize:i,borderSize:n,boxSizing:s,sizingStyle:a}=zt(e);W.setAttribute("style",`${a};${wt};max-width:${r}px;max-height:${o}px`),W.value=t||" ";let x=W.scrollWidth,u=W.scrollHeight;return s==="border-box"?(x+=n,u+=n):s==="content-box"&&(x-=i,u-=i),{width:Math.min(x,r),height:Math.min(u,o)}}var jt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsTextarea/index.tsx";function Bt({x:e,y:t,maxWidth:r,maxHeight:o,size:i,color:n,value:s,onChange:a,onBlur:x}){const u=c.exports.useRef(null),p=c.exports.useRef(null),[l,h]=c.exports.useState(0),[f,m]=c.exports.useState(0),y=()=>(u.current||(u.current=document.createElement("div")),u.current);return c.exports.useLayoutEffect(()=>(u.current&&(document.body.appendChild(u.current),requestAnimationFrame(()=>{var N;(N=p.current)==null||N.focus()})),()=>{var N;(N=u.current)==null||N.remove()}),[]),c.exports.useLayoutEffect(()=>{if(!p.current)return;const{width:N,height:w}=Et(p.current,s,r,o);h(N),m(w)},[s,r,o]),_e.exports.createPortal(g.exports.jsxDEV("textarea",{ref:p,className:"screenshots-textarea",style:{left:e,top:t,color:n,width:l,height:f,maxWidth:r,maxHeight:o,fontSize:i,lineHeight:`${i}px`},value:s,onChange:N=>a&&a(N.target.value),onBlur:N=>x&&x(N)},void 0,!1,{fileName:jt,lineNumber:65,columnNumber:5},this),y())}function ae(e){const t=Z();c.exports.useEffect(()=>(t.on("drawselect",e),()=>{t.off("drawselect",e)}),[e,t])}var De="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Text/index.tsx";const ze={3:18,6:32,9:46};function Mt(e,t){const{size:r,color:o,fontFamily:i,x:n,y:s,text:a}=t.data;e.fillStyle=o,e.textAlign="left",e.textBaseline="top",e.font=`${r}px ${i}`;const x=t.editHistory.reduce((u,{data:p})=>({x:u.x+p.x2-p.x1,y:u.y+p.y2-p.y1}),{x:0,y:0});a.split(`
|
|
13
|
+
`).forEach((u,p)=>{e.fillText(u,n+x.x,s+x.y+p*r)})}function Vt(e,t,r){e.textAlign="left",e.textBaseline="top",e.font=`${t.data.size}px ${t.data.fontFamily}`;let o=0,i=0;t.data.text.split(`
|
|
14
|
+
`).forEach(l=>{const h=e.measureText(l);o<h.width&&(o=h.width),i+=t.data.size});const{x:n,y:s}=t.editHistory.reduce((l,{data:h})=>({x:l.x+h.x2-h.x1,y:l.y+h.y2-h.y1}),{x:0,y:0}),a=t.data.x+n,x=t.data.y+s,u=a+o,p=x+i;return r.x>=a&&r.x<=u&&r.y>=x&&r.y<=p}function _t(){const e=L(),[t,r]=H(),[o]=U(),[i,n]=A(),[,s]=G(),a=I(),[x,u]=c.exports.useState(3),[p,l]=c.exports.useState("#ee5126"),h=c.exports.useRef(null),f=c.exports.useRef(null),[m,y]=c.exports.useState(null),[N,w]=c.exports.useState(""),S=i==="Text",z=c.exports.useCallback(()=>{n.set("Text"),s.set("default")},[n,s]),d=c.exports.useCallback(()=>{S||(z(),r.clearSelect())},[S,z,r]),b=c.exports.useCallback(B=>{h.current&&(h.current.data.size=ze[B]),u(B)},[]),v=c.exports.useCallback(B=>{h.current&&(h.current.data.color=B),l(B)},[]),C=c.exports.useCallback(B=>{w(B),S&&h.current&&(h.current.data.text=B)},[S]),k=c.exports.useCallback(()=>{h.current&&h.current.data.text&&r.push(h.current),h.current=null,w(""),y(null)},[r]),E=c.exports.useCallback((B,_)=>{B.name==="Text"&&(z(),f.current={type:j.Edit,data:{x1:_.clientX,y1:_.clientY,x2:_.clientX,y2:_.clientY},source:B},r.select(B))},[z,r]),D=c.exports.useCallback(B=>{if(!S||!a.current||h.current||!o)return;const{left:_,top:ge}=a.current.canvas.getBoundingClientRect(),ve=window.getComputedStyle(a.current.canvas).fontFamily,ne=B.clientX-_,re=B.clientY-ge;h.current={name:"Text",type:j.Source,data:{size:ze[x],color:p,fontFamily:ve,x:ne,y:re,text:""},editHistory:[],draw:Mt,isHit:Vt},y({x:B.clientX,y:B.clientY,maxWidth:o.width-ne,maxHeight:o.height-re})},[S,x,p,o,a]),R=c.exports.useCallback(B=>{!S||f.current&&(f.current.data.x2=B.clientX,f.current.data.y2=B.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),r.push(f.current)):r.set(t))},[S,t,r]),O=c.exports.useCallback(()=>{!S||(f.current=null)},[S]);return ae(E),ee(D),te(R),se(O),g.exports.jsxDEV(g.exports.Fragment,{children:[g.exports.jsxDEV(X,{title:e.operation_text_title,icon:"icon-text",checked:S,onClick:d,option:g.exports.jsxDEV(ce,{size:x,color:p,onSizeChange:b,onColorChange:v},void 0,!1,{fileName:De,lineNumber:261,columnNumber:11},this)},void 0,!1,{fileName:De,lineNumber:255,columnNumber:7},this),S&&m&&g.exports.jsxDEV(Bt,{x:m.x,y:m.y,maxWidth:m.maxWidth,maxHeight:m.maxHeight,size:ze[x],color:p,value:N,onChange:C,onBlur:k},void 0,!1,{fileName:De,lineNumber:265,columnNumber:9},this)]},void 0,!0)}const Ye=4;function M(e,t,r){e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.arc(t,r,Ye,0,2*Math.PI),e.fill(),e.stroke()}function be(e,t,r){t.draw(e,t);const{data:o}=e.getImageData(r.x,r.y,1,1);return o.some(i=>i!==0)}function V(e,t,r){if(!e)return!1;const{left:o,top:i}=e.getBoundingClientRect(),n=t.clientX-o,s=t.clientY-i;return(r.x-n)**2+(r.y-s)**2<Ye**2}function $t(e,t){const{size:r,color:o,points:i}=t.data;e.lineCap="round",e.lineJoin="round",e.lineWidth=r,e.strokeStyle=o;const n=t.editHistory.reduce((s,{data:a})=>({x:s.x+a.x2-a.x1,y:s.y+a.y2-a.y1}),{x:0,y:0});e.beginPath(),i.forEach((s,a)=>{a===0?e.moveTo(s.x+n.x,s.y+n.y):e.lineTo(s.x+n.x,s.y+n.y)}),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.beginPath(),i.forEach((s,a)=>{a===0?e.moveTo(s.x+n.x,s.y+n.y):e.lineTo(s.x+n.x,s.y+n.y)}),e.stroke())}var Pe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Brush/index.tsx";function Lt(){const e=L(),[,t]=G(),[r,o]=A(),i=I(),[n,s]=H(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=r==="Brush",m=c.exports.useCallback(()=>{o.set("Brush"),t.set("default")},[o,t]),y=c.exports.useCallback(()=>{f||(m(),s.clearSelect())},[f,m,s]),N=c.exports.useCallback((d,b)=>{d.name==="Brush"&&(m(),h.current={type:j.Edit,data:{x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},s.select(d))},[m,s]),w=c.exports.useCallback(d=>{if(!f||l.current||!i.current)return;const{left:b,top:v}=i.current.canvas.getBoundingClientRect();l.current={name:"Brush",type:j.Source,data:{size:a,color:u,points:[{x:d.clientX-b,y:d.clientY-v}]},editHistory:[],draw:$t,isHit:be}},[f,i,a,u]),S=c.exports.useCallback(d=>{if(!(!f||!i.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,n.top!==h.current?(h.current.source.editHistory.push(h.current),s.push(h.current)):s.set(n);else if(l.current){const{left:b,top:v}=i.current.canvas.getBoundingClientRect();l.current.data.points.push({x:d.clientX-b,y:d.clientY-v}),n.top!==l.current?s.push(l.current):s.set(n)}}},[f,n,i,s]),z=c.exports.useCallback(()=>{!f||(l.current&&s.clearSelect(),l.current=null,h.current=null)},[f,s]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_brush_title,icon:"icon-brush",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Pe,lineNumber:166,columnNumber:15},this)},void 0,!1,{fileName:Pe,lineNumber:161,columnNumber:5},this)}function Te(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===ue.Move?(t+=s,r+=a,o+=s,i+=a):n.type===ue.MoveStart?(t+=s,r+=a):n.type===ue.MoveEnd&&(o+=s,i+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Ht(e,t){const{size:r,color:o,x1:i,x2:n,y1:s,y2:a}=Te(t);e.lineCap="round",e.lineJoin="bevel",e.lineWidth=r,e.strokeStyle=o;const x=n-i,u=a-s,p=r*3,l=Math.atan2(u,x);e.beginPath(),e.moveTo(i,s),e.lineTo(n,a),e.lineTo(n-p*Math.cos(l-Math.PI/6),a-p*Math.sin(l-Math.PI/6)),e.moveTo(n,a),e.lineTo(n-p*Math.cos(l+Math.PI/6),a-p*Math.sin(l+Math.PI/6)),e.stroke(),t.isSelected&&(M(e,i,s),M(e,n,a))}var Ue="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Arrow/index.tsx",ue;(function(e){e[e.Move=0]="Move",e[e.MoveStart=1]="MoveStart",e[e.MoveEnd=2]="MoveEnd"})(ue||(ue={}));function Xt(){const e=L(),[,t]=G(),[r,o]=A(),[i,n]=H(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=r==="Arrow",m=c.exports.useCallback(()=>{o.set("Arrow"),t.set("default")},[o,t]),y=c.exports.useCallback(()=>{f||(m(),n.clearSelect())},[f,m,n]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Arrow"||!s.current)return;const v=d;m();const{x1:C,y1:k,x2:E,y2:D}=Te(v);let R=0;V(s.current.canvas,b,{x:C,y:k})?R=1:V(s.current.canvas,b,{x:E,y:D})&&(R=2),h.current={type:j.Edit,data:{type:R,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:v},n.select(d)},[s,m,n]),w=c.exports.useCallback(d=>{if(!f||l.current||!s.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current={name:"Arrow",type:j.Source,data:{size:a,color:u,x1:d.clientX-b,y1:d.clientY-v,x2:d.clientX-b,y2:d.clientY-v},editHistory:[],draw:Ht,isHit:be}},[f,u,a,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,i.top!==h.current?(h.current.source.editHistory.push(h.current),n.push(h.current)):n.set(i);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current.data.x2=d.clientX-b,l.current.data.y2=d.clientY-v,i.top!==l.current?n.push(l.current):n.set(i)}}},[f,i,s,n]),z=c.exports.useCallback(()=>{!f||(l.current&&n.clearSelect(),l.current=null,h.current=null)},[f,n]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_arrow_title,icon:"icon-arrow",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Ue,lineNumber:190,columnNumber:15},this)},void 0,!1,{fileName:Ue,lineNumber:185,columnNumber:5},this)}function Ge(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===F.Move?(t+=s,r+=a,o+=s,i+=a):n.type===F.ResizeTop?r+=a:n.type===F.ResizeRightTop?(o+=s,r+=a):n.type===F.ResizeRight?o+=s:n.type===F.ResizeRightBottom?(o+=s,i+=a):n.type===F.ResizeBottom?i+=a:n.type===F.ResizeLeftBottom?(t+=s,i+=a):n.type===F.ResizeLeft?t+=s:n.type===F.ResizeLeftTop&&(t+=s,r+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Ft(e,t){const{size:r,color:o,x1:i,y1:n,x2:s,y2:a}=Ge(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=r,e.strokeStyle=o;const x=(i+s)/2,u=(n+a)/2,p=Math.abs(s-i)/2,l=Math.abs(a-n)/2,h=.5522848,f=p*h,m=l*h;e.beginPath(),e.moveTo(x-p,u),e.bezierCurveTo(x-p,u-m,x-f,u-l,x,u-l),e.bezierCurveTo(x+f,u-l,x+p,u-m,x+p,u),e.bezierCurveTo(x+p,u+m,x+f,u+l,x,u+l),e.bezierCurveTo(x-f,u+l,x-p,u+m,x-p,u),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,a),e.lineTo(i,a),e.closePath(),e.stroke(),M(e,(i+s)/2,n),M(e,s,n),M(e,s,(n+a)/2),M(e,s,a),M(e,(i+s)/2,a),M(e,i,a),M(e,i,(n+a)/2),M(e,i,n))}var Ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ellipse/index.tsx",F;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(F||(F={}));function Yt(){const e=L(),[t,r]=H(),[o,i]=A(),[,n]=G(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=o==="Ellipse",m=c.exports.useCallback(()=>{i.set("Ellipse"),n.set("crosshair")},[i,n]),y=c.exports.useCallback(()=>{f||(m(),r.clearSelect())},[f,m,r]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Ellipse"||!s.current)return;const v=d;m();const{x1:C,y1:k,x2:E,y2:D}=Ge(v);let R=0;V(s.current.canvas,b,{x:(C+E)/2,y:k})?R=1:V(s.current.canvas,b,{x:E,y:k})?R=2:V(s.current.canvas,b,{x:E,y:(k+D)/2})?R=3:V(s.current.canvas,b,{x:E,y:D})?R=4:V(s.current.canvas,b,{x:(C+E)/2,y:D})?R=5:V(s.current.canvas,b,{x:C,y:D})?R=6:V(s.current.canvas,b,{x:C,y:(k+D)/2})?R=7:V(s.current.canvas,b,{x:C,y:k})&&(R=8),h.current={type:j.Edit,data:{type:R,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:v},r.select(d)},[s,m,r]),w=c.exports.useCallback(d=>{if(!f||!s.current||l.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=d.clientX-b,k=d.clientY-v;l.current={name:"Ellipse",type:j.Source,data:{size:a,color:u,x1:C,y1:k,x2:C,y2:k},editHistory:[],draw:Ft,isHit:be}},[f,a,u,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,t.top!==h.current?(h.current.source.editHistory.push(h.current),r.push(h.current)):r.set(t);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect();l.current.data.x2=d.clientX-b,l.current.data.y2=d.clientY-v,t.top!==l.current?r.push(l.current):r.set(t)}}},[f,s,t,r]),z=c.exports.useCallback(()=>{!f||(l.current&&r.clearSelect(),l.current=null,h.current=null)},[f,r]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_ellipse_title,icon:"icon-ellipse",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:Ae,lineNumber:242,columnNumber:15},this)},void 0,!1,{fileName:Ae,lineNumber:237,columnNumber:5},this)}function Ie(e){let{x1:t,y1:r,x2:o,y2:i}=e.data;return e.editHistory.forEach(({data:n})=>{const s=n.x2-n.x1,a=n.y2-n.y1;n.type===Y.Move?(t+=s,r+=a,o+=s,i+=a):n.type===Y.ResizeTop?r+=a:n.type===Y.ResizeRightTop?(o+=s,r+=a):n.type===Y.ResizeRight?o+=s:n.type===Y.ResizeRightBottom?(o+=s,i+=a):n.type===Y.ResizeBottom?i+=a:n.type===Y.ResizeLeftBottom?(t+=s,i+=a):n.type===Y.ResizeLeft?t+=s:n.type===Y.ResizeLeftTop&&(t+=s,r+=a)}),pe(T({},e.data),{x1:t,x2:o,y1:r,y2:i})}function Pt(e,t){const{size:r,color:o,x1:i,y1:n,x2:s,y2:a}=Ie(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=r,e.strokeStyle=o,e.beginPath(),e.moveTo(i,n),e.lineTo(s,n),e.lineTo(s,a),e.lineTo(i,a),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",M(e,(i+s)/2,n),M(e,s,n),M(e,s,(n+a)/2),M(e,s,a),M(e,(i+s)/2,a),M(e,i,a),M(e,i,(n+a)/2),M(e,i,n))}var We="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Rectangle/index.tsx",Y;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(Y||(Y={}));function Tt(){const e=L(),[t,r]=H(),[o,i]=A(),[,n]=G(),s=I(),[a,x]=c.exports.useState(3),[u,p]=c.exports.useState("#ee5126"),l=c.exports.useRef(null),h=c.exports.useRef(null),f=o==="Rectangle",m=c.exports.useCallback(()=>{i.set("Rectangle"),n.set("crosshair")},[i,n]),y=c.exports.useCallback(()=>{f||(m(),r.clearSelect())},[f,m,r]),N=c.exports.useCallback((d,b)=>{if(d.name!=="Rectangle"||!s.current)return;const v=d;m();const{x1:C,y1:k,x2:E,y2:D}=Ie(v);let R=0;V(s.current.canvas,b,{x:(C+E)/2,y:k})?R=1:V(s.current.canvas,b,{x:E,y:k})?R=2:V(s.current.canvas,b,{x:E,y:(k+D)/2})?R=3:V(s.current.canvas,b,{x:E,y:D})?R=4:V(s.current.canvas,b,{x:(C+E)/2,y:D})?R=5:V(s.current.canvas,b,{x:C,y:D})?R=6:V(s.current.canvas,b,{x:C,y:(k+D)/2})?R=7:V(s.current.canvas,b,{x:C,y:k})&&(R=8),h.current={type:j.Edit,data:{type:R,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},r.select(d)},[s,m,r]),w=c.exports.useCallback(d=>{if(!f||!s.current||l.current)return;const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=d.clientX-b,k=d.clientY-v;l.current={name:"Rectangle",type:j.Source,data:{size:a,color:u,x1:C,y1:k,x2:C,y2:k},editHistory:[],draw:Pt,isHit:be}},[f,a,u,s]),S=c.exports.useCallback(d=>{if(!(!f||!s.current)){if(h.current)h.current.data.x2=d.clientX,h.current.data.y2=d.clientY,t.top!==h.current?(h.current.source.editHistory.push(h.current),r.push(h.current)):r.set(t);else if(l.current){const{left:b,top:v}=s.current.canvas.getBoundingClientRect(),C=l.current.data;C.x2=d.clientX-b,C.y2=d.clientY-v,t.top!==l.current?r.push(l.current):r.set(t)}}},[f,s,t,r]),z=c.exports.useCallback(()=>{!f||(l.current&&r.clearSelect(),l.current=null,h.current=null)},[f,r]);return ae(N),ee(w),te(S),se(z),g.exports.jsxDEV(X,{title:e.operation_rectangle_title,icon:"icon-rectangle",checked:f,onClick:y,option:g.exports.jsxDEV(ce,{size:a,color:u,onSizeChange:x,onColorChange:p},void 0,!1,{fileName:We,lineNumber:242,columnNumber:15},this)},void 0,!1,{fileName:We,lineNumber:237,columnNumber:5},this)}var Ut=[Tt,Yt,Xt,Lt,_t,Rt,"|",Ct,yt,"|",gt,xt,mt];var le="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOperations/index.tsx";const Oe=Ve.createContext(null);function Gt(){const{width:e,height:t}=$(),[r]=U(),[o,i]=c.exports.useState(null),[n,s]=c.exports.useState(null),a=c.exports.useRef(null),x=c.exports.useCallback(p=>{p.stopPropagation()},[]),u=c.exports.useCallback(p=>{p.preventDefault(),p.stopPropagation()},[]);return c.exports.useEffect(()=>{if(!r||!a.current)return;const p=a.current.getBoundingClientRect();let l=r.x+r.width-p.width,h=r.y+r.height+10;l<0&&(l=0),l>e-p.width&&(l=e-p.width),h>t-p.height&&(h=t-p.height-10),((n==null?void 0:n.x)!==l||n.y!==h)&&s({x:l,y:h}),((o==null?void 0:o.x)!==p.x||o.y!==p.y||o.width!==p.width||o.height!==p.height)&&i({x:p.x,y:p.y,width:p.width,height:p.height})}),r?g.exports.jsxDEV(Oe.Provider,{value:o,children:g.exports.jsxDEV("div",{ref:a,className:"screenshots-operations",style:{visibility:n?"visible":"hidden",left:n==null?void 0:n.x,top:n==null?void 0:n.y},onDoubleClick:x,onContextMenu:u,children:g.exports.jsxDEV("div",{className:"screenshots-operations-buttons",children:Ut.map((p,l)=>p==="|"?g.exports.jsxDEV("div",{className:"screenshots-operations-divider"},l,!1,{fileName:le,lineNumber:91,columnNumber:22},this):g.exports.jsxDEV(p,{},l,!1,{fileName:le,lineNumber:93,columnNumber:22},this))},void 0,!1,{fileName:le,lineNumber:88,columnNumber:9},this)},void 0,!1,{fileName:le,lineNumber:77,columnNumber:7},this)},void 0,!1,{fileName:le,lineNumber:76,columnNumber:5},this):null}function At(e){const[t,r]=c.exports.useState(null);return c.exports.useEffect(()=>{if(e==null)return;const o=document.createElement("img"),i=()=>r(o),n=()=>r(null);return o.addEventListener("load",i),o.addEventListener("error",n),o.src=e,()=>{o.removeEventListener("load",i),o.removeEventListener("error",n)}},[e]),t}var fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/index.tsx";function It(s){var a=s,{url:e,width:t,height:r,lang:o,className:i}=a,n=Me(a,["url","width","height","lang","className"]);const x=At(e),u=c.exports.useRef(null),p=c.exports.useRef({}),[l,h]=c.exports.useState({index:-1,stack:[]}),[f,m]=c.exports.useState(null),[y,N]=c.exports.useState("move"),[w,S]=c.exports.useState(void 0),z={url:e,width:t,height:r,image:x,lang:T(T({},$e),o),emiterRef:p,canvasContextRef:u,history:l,bounds:f,cursor:y,operation:w},d=c.exports.useCallback((D,...R)=>{const O=n[D];typeof O=="function"&&O(...R)},[n]),b={call:d,setHistory:h,setBounds:m,setCursor:N,setOperation:S},v=["screenshots"];i&&v.push(i);const C=()=>{p.current={},h({index:-1,stack:[]}),m(null),N("move"),S(void 0)},k=c.exports.useCallback(D=>{D.button!==0||!f||!u.current||u.current.canvas.toBlob(R=>{d("onOk",R,f),C()},"image/png")},[f,d]),E=c.exports.useCallback(D=>{D.button===2&&(D.preventDefault(),d("onCancel"),C())},[d]);return g.exports.jsxDEV(ye.Provider,{value:{store:z,dispatcher:b},children:g.exports.jsxDEV("div",{className:v.join(" "),style:{width:t,height:r},onDoubleClick:k,onContextMenu:E,children:[g.exports.jsxDEV(ot,{},void 0,!1,{fileName:fe,lineNumber:118,columnNumber:9},this),g.exports.jsxDEV(ft,{ref:u},void 0,!1,{fileName:fe,lineNumber:119,columnNumber:9},this),g.exports.jsxDEV(Gt,{},void 0,!1,{fileName:fe,lineNumber:120,columnNumber:9},this)]},void 0,!0,{fileName:fe,lineNumber:112,columnNumber:7},this)},void 0,!1,{fileName:fe,lineNumber:111,columnNumber:5},this)}var Je="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/electron/app.tsx";function Wt(){const[e,t]=c.exports.useState(void 0),[r,o]=c.exports.useState(window.innerWidth),[i,n]=c.exports.useState(window.innerHeight),[s,a]=c.exports.useState(void 0),[x,u]=c.exports.useState(void 0),p=c.exports.useCallback(async(f,m)=>{!s||!f||window.screenshots.save(await f.arrayBuffer(),{bounds:m,display:s})},[s]),l=c.exports.useCallback(()=>{window.screenshots.cancel()},[]),h=c.exports.useCallback(async(f,m)=>{!s||!f||window.screenshots.ok(await f.arrayBuffer(),{bounds:m,display:s})},[s]);return c.exports.useEffect(()=>{const f=N=>{u(N)},m=(N,w)=>{a(N),t(w)},y=()=>{t(void 0),a(void 0)};return window.screenshots.on("setLang",f),window.screenshots.on("capture",m),window.screenshots.on("reset",y),window.screenshots.ready(),()=>{window.screenshots.off("capture",m),window.screenshots.off("setLang",f),window.screenshots.off("reset",y)}},[]),c.exports.useEffect(()=>{const f=()=>{o(window.innerWidth),n(window.innerHeight)},m=({code:y})=>{y==="Escape"&&l()};return window.addEventListener("resize",f),window.addEventListener("keyup",m),()=>{window.removeEventListener("resize",f),window.removeEventListener("keyup",m)}},[l]),g.exports.jsxDEV("div",{className:"body",children:e&&g.exports.jsxDEV(It,{url:e,width:r,height:i,lang:x,onSave:p,onCancel:l,onOk:h},void 0,!1,{fileName:Je,lineNumber:96,columnNumber:9},this)},void 0,!1,{fileName:Je,lineNumber:94,columnNumber:5},this)}var qe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/electron/index.tsx";tt.render(g.exports.jsxDEV(c.exports.StrictMode,{children:g.exports.jsxDEV(Wt,{},void 0,!1,{fileName:qe,lineNumber:7,columnNumber:5},globalThis)},void 0,!1,{fileName:qe,lineNumber:6,columnNumber:3},globalThis),document.getElementById("app"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.screenshots-magnifier{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;left:0;top:0;width:100px;box-shadow:0 0 8px #000;z-index:9}.screenshots-magnifier,.screenshots-magnifier *{box-sizing:border-box;user-select:none}.screenshots-magnifier-body{position:relative;background-color:#fff}.screenshots-magnifier-body:before{content:"";background-color:#0a72a1;position:absolute;top:50%;left:0;width:100%;height:2px;z-index:1}.screenshots-magnifier-body:after{content:"";background-color:#0a72a1;position:absolute;top:0;left:50%;width:2px;height:100%;z-index:1}.screenshots-magnifier-body-canvas{display:block;width:100px;height:80px}.screenshots-magnifier-footer{height:40px;color:#fff;font-size:11px;background-color:#5f5e5e;padding:4px;white-space:nowrap;overflow:hidden;text-align:center}.screenshots-magnifier-footer-item{height:18px;line-height:18px}.screenshots-background{width:100%;height:100%;position:relative}.screenshots-background-image{width:100%;height:100%;display:block;border:none;outline:none;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;-webkit-font-smooting:antialiased}.screenshots-background-mask{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#ffffff1a}.screenshots-canvas{position:absolute}.screenshots-canvas-body{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.screenshots-canvas-border-top{position:absolute;left:0;top:0;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-right{position:absolute;left:100%;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-bottom{position:absolute;left:0;top:100%;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-left{position:absolute;left:0;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-point-top{width:8px;height:8px;position:absolute;left:50%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-top-right{width:8px;height:8px;position:absolute;left:100%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-right{width:8px;height:8px;position:absolute;left:100%;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-right-bottom{width:8px;height:8px;position:absolute;left:100%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-canvas-point-bottom{width:8px;height:8px;position:absolute;left:50%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-bottom-left{width:8px;height:8px;position:absolute;left:0;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-left{width:8px;height:8px;position:absolute;left:0;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-left-top{width:8px;height:8px;position:absolute;left:0;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-option{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots-option,.screenshots-option *{box-sizing:border-box;user-select:none}.screenshots-option-container{height:34px;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff}.screenshots-option-arrow{position:absolute;border:6px solid transparent}.screenshots-option[data-placement=top]{transform:translate(-50%,-11px)}.screenshots-option[data-placement=top] .screenshots-option-arrow{transform:translate(-50%,-1px);border-top-color:#fff;top:100%;left:50%}.screenshots-option[data-placement=bottom]{transform:translate(-50%,11px)}.screenshots-option[data-placement=bottom] .screenshots-option-arrow{transform:translate(-50%,1px);border-bottom-color:#fff;bottom:100%;left:50%}.screenshots-button{width:26px;height:26px;line-height:26px;color:#555;font-size:18px;text-align:center;margin:0 3px;vertical-align:middle;cursor:pointer}.screenshots-button-checked,.screenshots-button:hover{background-color:#eee;outline:1px solid #777}.screenshots-button-disabled{color:#ccc;cursor:not-allowed}.screenshots-button-disabled:hover{background-color:#fff;outline:none}.screenshots-size{height:24px;display:flex;align-items:center}.screenshots-size-item{width:24px;height:24px;position:relative;margin:0 3px;cursor:pointer}.screenshots-size-pointer{background-color:#555;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.screenshots-size-active>.screenshots-size-pointer{background-color:#39f}.screenshots-color{height:24px;display:flex;align-items:center}.screenshots-color-item{border:1px solid #777;width:24px;height:24px;cursor:pointer;position:relative;margin:0 3px}.screenshots-color-item:before{content:"";display:none;position:absolute;right:0;bottom:0;width:10px;height:10px;background-color:#333}.screenshots-color-item:after{content:"";display:none;width:8px;height:4px;position:absolute;right:5px;bottom:5px;border-bottom:2px solid #fff;border-left:2px solid #fff;transform:translate(5px,2px) rotate(-45deg) scale(.8)}.screenshots-color-active:before,.screenshots-color-active:after{display:block}.screenshots-sizecolor{height:24px;display:flex;align-items:center}.screenshots-textarea{box-sizing:border-box;position:absolute;margin:0;padding:0;background-color:transparent;border:2px solid #39f;resize:none;outline:none;white-space:nowrap;word-break:break-all;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;text-align:left}.screenshots-operations{position:absolute}.screenshots-operations-buttons{display:flex;align-items:center;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff;overflow:hidden}.screenshots-operations-divider{background-color:#ddd;width:1px;height:26px;margin:0 3px}@font-face{font-family:screenshots-icon;src:url(data:font/woff2;base64,d09GMgABAAAAAAZYAAsAAAAADKgAAAYKAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDfAqKLIhJATYCJAMwCxoABCAFhUcHgQAb6QrILjGFawcSSCzDZuiIqeA+75Tu1r4heP5fp96nLxkkOwhUmIBwakdUSggj8dSRyDmdmP3/v2e9YsjsOCtlpI68YLtQ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zAGMAcgBlAGUAbgBzAGgAbwB0AHMALQBpAGMAbwBuAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4ARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0ABWFycm93BHNhdmUGbW9zYWljBHJlZG8EdW5kbwdlbGxpcHNlCXJlY3RhbmdsZQR0ZXh0BmNhbmNlbAJvawVicnVzaAAA) format("truetype")}[class^=icon-],[class*=" icon-"]{font-family:screenshots-icon!important;font-style:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-ok:before{content:"\e001"}.icon-cancel:before{content:"\e002"}.icon-save:before{content:"\e003"}.icon-redo:before{content:"\e004"}.icon-undo:before{content:"\e005"}.icon-mosaic:before{content:"\e006"}.icon-text:before{content:"\e007"}.icon-brush:before{content:"\e008"}.icon-arrow:before{content:"\e009"}.icon-ellipse:before{content:"\e00a"}.icon-rectangle:before{content:"\e00b"}.screenshots{position:relative;transform:translateZ(0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots,.screenshots *{box-sizing:border-box;user-select:none}html,body,#app{height:100%;margin:0;padding:0;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.body{height:100%}
|
package/electron/electron.html
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>react-screenshots</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index.
|
|
7
|
+
<script type="module" crossorigin src="./assets/index.520cf8a5.js"></script>
|
|
8
8
|
<link rel="modulepreload" href="./assets/vendor.e3c417b2.js">
|
|
9
|
-
<link rel="stylesheet" href="./assets/index.
|
|
9
|
+
<link rel="stylesheet" href="./assets/index.d7827cc0.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var qe=Object.defineProperty,Je=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var De=(e,t,s)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,U=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&De(e,s,t[s]);if(he)for(var s of he(t))Be.call(t,s)&&De(e,s,t[s]);return e},me=(e,t)=>Je(e,Qe(t));var Me=(e,t)=>{var s={};for(var o in e)Ee.call(e,o)&&t.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&he)for(var o of he(e))t.indexOf(o)<0&&Be.call(e,o)&&(s[o]=e[o]);return s};var i=require("react"),$e=require("react-dom");function Ke(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var _=Ke(i);const Le={magnifier_position_label:"\u5750\u6807",operation_ok_title:"\u786E\u5B9A",operation_cancel_title:"\u53D6\u6D88",operation_save_title:"\u4FDD\u5B58",operation_redo_title:"\u91CD\u505A",operation_undo_title:"\u64A4\u9500",operation_mosaic_title:"\u9A6C\u8D5B\u514B",operation_text_title:"\u6587\u672C",operation_brush_title:"\u753B\u7B14",operation_arrow_title:"\u7BAD\u5934",operation_ellipse_title:"\u692D\u5706",operation_rectangle_title:"\u77E9\u5F62"};var ye=_.default.createContext({store:{url:void 0,image:null,width:0,height:0,lang:Le,emiterRef:{current:{}},canvasContextRef:{current:null},history:{index:-1,stack:[]},bounds:null,cursor:"move",operation:void 0},dispatcher:{call:void 0,setHistory:void 0,setBounds:void 0,setCursor:void 0,setOperation:void 0}});function H(){const{store:e}=i.useContext(ye);return e}function X(){const{lang:e}=H();return e}var J="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsMagnifier/index.tsx";const Q=100,K=80;function Ze({x:e,y:t}){const{width:s,height:o,image:c}=H(),r=X(),[n,u]=i.useState(null),p=i.useRef(null),l=i.useRef(null),h=i.useRef(null),[a,f]=i.useState("000000");return i.useLayoutEffect(()=>{if(!p.current)return;const m=p.current.getBoundingClientRect();let g=e+20,x=t+20;g+m.width>s&&(g=e-m.width-20),x+m.height>o&&(x=t-m.height-20),g<0&&(g=0),x<0&&(x=0),u({x:g,y:x})},[s,o,e,t]),i.useEffect(()=>{if(!c||!l.current){h.current=null;return}if(h.current||(h.current=l.current.getContext("2d")),!h.current)return;const m=h.current;m.clearRect(0,0,Q,K);const g=c.naturalWidth/s,x=c.naturalHeight/o;m.drawImage(c,e*g-Q/2,t*x-K/2,Q,K,0,0,Q,K);const{data:v}=m.getImageData(Math.floor(Q/2),Math.floor(K/2),1,1),S=Array.from(v.slice(0,3)).map(C=>C>=16?C.toString(16):`0${C.toString(16)}`).join("").toUpperCase();f(S)},[s,o,c,e,t]),_.default.createElement("div",{ref:p,className:"screenshots-magnifier",style:{transform:`translate(${n==null?void 0:n.x}px, ${n==null?void 0:n.y}px)`},__self:this,__source:{fileName:J,lineNumber:89,columnNumber:5}},_.default.createElement("div",{className:"screenshots-magnifier-body",__self:this,__source:{fileName:J,lineNumber:96,columnNumber:7}},_.default.createElement("canvas",{ref:l,className:"screenshots-magnifier-body-canvas",width:Q,height:K,__self:this,__source:{fileName:J,lineNumber:97,columnNumber:9}})),_.default.createElement("div",{className:"screenshots-magnifier-footer",__self:this,__source:{fileName:J,lineNumber:104,columnNumber:7}},_.default.createElement("div",{className:"screenshots-magnifier-footer-item",__self:this,__source:{fileName:J,lineNumber:105,columnNumber:9}},r.magnifier_position_label,": (",e,",",t,")"),_.default.createElement("div",{className:"screenshots-magnifier-footer-item",__self:this,__source:{fileName:J,lineNumber:108,columnNumber:9}},"RGB: #",a)))}function et({x:e,y:t},{x:s,y:o},c,r){return e>s&&([e,s]=[s,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0),s>c&&(s=c),t<0&&(t=0),o>r&&(o=r),{x:e,y:t,width:s-e,height:o-t}}function oe(){const{dispatcher:e}=i.useContext(ye);return e}function G(){const{bounds:e}=H(),{setBounds:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t(null)},[t]);return[e,{set:s,reset:o}]}var xe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsBackground/index.tsx";function tt(){const{url:e,width:t,height:s}=H(),[o,c]=G(),r=i.useRef(null),n=i.useRef(null),[u,p]=i.useState(null),l=i.useCallback((a,f)=>{if(!r.current)return;const{x:m,y:g}=r.current.getBoundingClientRect();c.set(et({x:a.x-m,y:a.y-g},{x:f.x-m,y:f.y-g},t,s))},[t,s,c]),h=i.useCallback(a=>{n.current||o||a.button!==0||(n.current={x:a.clientX,y:a.clientY})},[o]);return i.useEffect(()=>{const a=m=>{if(r.current){const g=r.current.getBoundingClientRect();m.clientX<g.left||m.clientY<g.top||m.clientX>g.right||m.clientY>g.bottom?p(null):p({x:m.clientX-g.x,y:m.clientY-g.y})}!n.current||l(n.current,{x:m.clientX,y:m.clientY})},f=m=>{!n.current||(l(n.current,{x:m.clientX,y:m.clientY}),n.current=null)};return window.addEventListener("mousemove",a),window.addEventListener("mouseup",f),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",f)}},[l]),e?_.default.createElement("div",{ref:r,className:"screenshots-background",style:{backgroundImage:`url("${e}")`},onMouseDown:h,__self:this,__source:{fileName:xe,lineNumber:104,columnNumber:5}},_.default.createElement("div",{className:"screenshots-background-mask",__self:this,__source:{fileName:xe,lineNumber:112,columnNumber:7}}),u&&!o&&_.default.createElement(Ze,{x:u==null?void 0:u.x,y:u==null?void 0:u.y,__self:this,__source:{fileName:xe,lineNumber:113,columnNumber:31}})):null}var Ve;const He=(Ve=window.devicePixelRatio)!=null?Ve:2;var de=He<2?2:He;function nt(e,t,s,o){const c=e.clientX-s.x,r=e.clientY-s.y;let n=o.x,u=o.y,p=o.x+o.width,l=o.y+o.height;switch(t){case"top":u+=r;break;case"top-right":p+=c,u+=r;break;case"right":p+=c;break;case"right-bottom":p+=c,l+=r;break;case"bottom":l+=r;break;case"bottom-left":n+=c,l+=r;break;case"left":n+=c;break;case"left-top":n+=c,u+=r;break;case"move":n+=c,u+=r,p+=c,l+=r;break}return[{x:n,y:u},{x:p,y:l}]}function st({x:e,y:t},{x:s,y:o},c,r,n,u){return e>s&&([e,s]=[s,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0,u==="move"&&(s=c.width)),s>r&&(s=r,u==="move"&&(e=s-c.width)),t<0&&(t=0,u==="move"&&(o=c.height)),o>n&&(o=n,u==="move"&&(t=o-c.height)),{x:e,y:t,width:Math.max(s-e,1),height:Math.max(o-t,1)}}var B;(function(e){e[e.Edit=0]="Edit",e[e.Source=1]="Source"})(B||(B={}));function Z(){const{emiterRef:e}=H(),t=i.useCallback((r,n)=>{const u=e.current;Array.isArray(u[r])?u[r].push(n):u[r]=[n]},[e]),s=i.useCallback((r,n)=>{const u=e.current;if(Array.isArray(u[r])){const p=u[r].findIndex(l=>l===n);p!==-1&&u[r].splice(p,1)}},[e]),o=i.useCallback((r,...n)=>{const u=e.current;Array.isArray(u[r])&&u[r].forEach(p=>p(...n))},[e]),c=i.useCallback(()=>{e.current={}},[e]);return{on:t,off:s,emit:o,reset:c}}function Y(){const{history:e}=H(),{setHistory:t}=oe(),s=i.useCallback(h=>{const{index:a,stack:f}=e;f.forEach(m=>{m.type===B.Source&&(m.isSelected=!1)}),h.type===B.Source?h.isSelected=!0:h.type===B.Edit&&(h.source.isSelected=!0),f.splice(a+1),f.push(h),t==null||t({index:f.length-1,stack:f})},[e,t]),o=i.useCallback(()=>{const{stack:h}=e;h.pop(),t==null||t({index:h.length-1,stack:h})},[e,t]),c=i.useCallback(()=>{const{index:h,stack:a}=e,f=a[h];f&&(f.type===B.Source?f.isSelected=!1:f.type===B.Edit&&f.source.editHistory.pop()),t==null||t({index:h<=0?-1:h-1,stack:a})},[e,t]),r=i.useCallback(()=>{const{index:h,stack:a}=e,f=a[h+1];f&&(f.type===B.Source?f.isSelected=!1:f.type===B.Edit&&f.source.editHistory.push(f)),t==null||t({index:h>=a.length-1?a.length-1:h+1,stack:a})},[e,t]),n=i.useCallback(h=>{t==null||t(U({},h))},[t]),u=i.useCallback(h=>{e.stack.forEach(a=>{a.type===B.Source&&(a===h?a.isSelected=!0:a.isSelected=!1)}),t==null||t(U({},e))},[e,t]),p=i.useCallback(()=>{e.stack.forEach(h=>{h.type===B.Source&&(h.isSelected=!1)}),t==null||t(U({},e))},[e,t]),l=i.useCallback(()=>{t==null||t({index:-1,stack:[]})},[t]);return[{index:e.index,stack:e.stack,top:e.stack.slice(e.index,e.index+1)[0]},{push:s,pop:o,undo:c,redo:r,set:n,select:u,clearSelect:p,reset:l}]}function A(){const{cursor:e}=H(),{setCursor:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t("move")},[t]);return[e,{set:s,reset:o}]}function I(){const{operation:e}=H(),{setOperation:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t(void 0)},[t]);return[e,{set:s,reset:o}]}function rt(e,t,s,o){if(!t)return!1;const c=document.createElement("canvas");c.width=e.width,c.height=e.height;const r=c.getContext("2d");if(!r)return!1;const{left:n,top:u}=t.getBoundingClientRect(),p=o.clientX-n,l=o.clientY-u;return[...s.stack.slice(0,s.index+1)].reverse().find(a=>{var f;return a.type!==B.Source?!1:(r.clearRect(0,0,e.width,e.height),(f=a.isHit)==null?void 0:f.call(a,r,a,{x:p,y:l}))})}var ce="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsCanvas/index.tsx";const ot=["top","right","bottom","left"];var j;(function(e){e.ResizeTop="top",e.ResizetopRight="top-right",e.ResizeRight="right",e.ResizeRightBottom="right-bottom",e.ResizeBottom="bottom",e.ResizeBottomLeft="bottom-left",e.ResizeLeft="left",e.ResizeLeftTop="left-top",e.Move="move"})(j||(j={}));const ct=[j.ResizeTop,j.ResizetopRight,j.ResizeRight,j.ResizeRightBottom,j.ResizeBottom,j.ResizeBottomLeft,j.ResizeLeft,j.ResizeLeftTop];var it=i.forwardRef(function(t,s){const{image:o,width:c,height:r}=H(),n=Z(),[u]=Y(),[p]=A(),[l,h]=G(),[a]=I(),f=i.useRef(),m=i.useRef(null),g=i.useRef(null),x=i.useRef(null),v=i.useRef(null),S=i.useCallback(()=>{if(!o||!l||!v.current)return;const d=o.naturalWidth/c,b=o.naturalHeight/r,y=v.current;y.imageSmoothingEnabled=!0,y.imageSmoothingQuality="high",y.setTransform(de,0,0,de,0,0),y.clearRect(0,0,l.width,l.height),y.drawImage(o,l.x*d,l.y*b,l.width*d,l.height*b,0,0,l.width,l.height),u.stack.slice(0,u.index+1).forEach(N=>{N.type===B.Source&&N.draw(y,N)})},[o,c,r,l,v,u]),C=i.useCallback((d,b)=>{if(!(d.button!==0||!l))if(!a)f.current=b,m.current={x:d.clientX,y:d.clientY},g.current={x:l.x,y:l.y,width:l.width,height:l.height};else{const y=rt(l,x.current,u,d.nativeEvent);y?n.emit("drawselect",y,d.nativeEvent):n.emit("mousedown",d.nativeEvent)}},[l,a,n,u]),z=i.useCallback(d=>{if(!f.current||!m.current||!g.current||!l)return;const b=nt(d,f.current,m.current,g.current);h.set(st(b[0],b[1],l,c,r,f.current))},[c,r,l,h]);return i.useLayoutEffect(()=>{if(!o||!l||!x.current){v.current=null;return}v.current||(v.current=x.current.getContext("2d")),S()},[o,l,S]),i.useEffect(()=>{const d=y=>{if(a)n.emit("mousemove",y);else{if(!f.current||!m.current||!g.current)return;z(y)}},b=y=>{if(a)n.emit("mouseup",y);else{if(!f.current||!m.current||!g.current)return;z(y),f.current=void 0,m.current=null,g.current=null}};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",b)}},[z,a,n]),i.useImperativeHandle(s,()=>v.current),l?_.default.createElement("div",{className:"screenshots-canvas",style:{left:l.x,top:l.y,width:l.width,height:l.height},__self:this,__source:{fileName:ce,lineNumber:190,columnNumber:5}},_.default.createElement("canvas",{ref:x,width:l.width*de,height:l.height*de,style:{width:l.width,height:l.height},__self:this,__source:{fileName:ce,lineNumber:199,columnNumber:7}}),_.default.createElement("div",{className:"screenshots-canvas-body",style:{cursor:p},onMouseDown:d=>C(d,"move"),__self:this,__source:{fileName:ce,lineNumber:208,columnNumber:7}}),ot.map(d=>_.default.createElement("div",{key:d,className:`screenshots-canvas-border-${d}`,__self:this,__source:{fileName:ce,lineNumber:216,columnNumber:16}})),ct.map(d=>_.default.createElement("div",{key:d,className:`screenshots-canvas-point-${d}`,onMouseDown:b=>C(b,d),__self:this,__source:{fileName:ce,lineNumber:220,columnNumber:11}}))):null});function ve(){const e=oe();return i.useCallback((s,...o)=>{var c;(c=e.call)==null||c.call(e,s,...o)},[e])}function W(){const{canvasContextRef:e}=H();return e}function Ne(){const e=Z(),[,t]=G(),[,s]=A(),[,o]=Y(),[,c]=I();return i.useCallback(()=>{e.reset(),o.reset(),t.reset(),s.reset(),c.reset()},[e,o,t,s,c])}var Ce="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOption/index.tsx",q;(function(e){e.Bottom="bottom",e.Top="top"})(q||(q={}));function ut({open:e,content:t,children:s}){const o=i.useRef(null),c=i.useRef(null),r=i.useRef(null),n=i.useContext(Oe),[u,p]=i.useState(q.Bottom),[l,h]=i.useState(null),[a,f]=i.useState(0),m=()=>(c.current||(c.current=document.createElement("div")),c.current);return i.useEffect(()=>{const g=m();return e&&document.body.appendChild(g),()=>{g.remove()}},[e]),i.useEffect(()=>{if(!e||!n||!o.current||!r.current)return;const g=o.current.getBoundingClientRect(),x=r.current.getBoundingClientRect();let v=u,S=g.left+g.width/2,C=g.top+g.height,z=a;if(S+x.width/2>n.x+n.width){const d=S;S=n.x+n.width-x.width/2,z=d-S}if(S<n.x+x.width/2){const d=S;S=n.x+x.width/2,z=d-S}C>window.innerHeight-x.height&&(v===q.Bottom&&(v=q.Top),C=g.top-x.height),C<0&&(v===q.Top&&(v=q.Bottom),C=g.top+g.height),v!==u&&p(v),((l==null?void 0:l.x)!==S||l.y!==C)&&h({x:S,y:C}),z!==a&&f(z)}),_.default.createElement(_.default.Fragment,null,i.cloneElement(s,{ref:o}),e&&t&&$e.createPortal(_.default.createElement("div",{ref:r,className:"screenshots-option",style:{visibility:l?"visible":"hidden",left:l==null?void 0:l.x,top:l==null?void 0:l.y},"data-placement":u,__self:this,__source:{fileName:Ce,lineNumber:111,columnNumber:11}},_.default.createElement("div",{className:"screenshots-option-container",__self:this,__source:{fileName:Ce,lineNumber:121,columnNumber:13}},t),_.default.createElement("div",{className:"screenshots-option-arrow",style:{marginLeft:a},__self:this,__source:{fileName:Ce,lineNumber:122,columnNumber:13}})),m()))}var ke="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsButton/index.tsx";function F({title:e,icon:t,checked:s,disabled:o,option:c,onClick:r}){const n=["screenshots-button"],u=i.useCallback(p=>{o||!r||r(p)},[o,r]);return s&&n.push("screenshots-button-checked"),o&&n.push("screenshots-button-disabled"),_.default.createElement(ut,{open:s,content:c,__self:this,__source:{fileName:ke,lineNumber:42,columnNumber:5}},_.default.createElement("div",{className:n.join(" "),title:e,onClick:u,__self:this,__source:{fileName:ke,lineNumber:43,columnNumber:7}},_.default.createElement("span",{className:t,__self:this,__source:{fileName:ke,lineNumber:44,columnNumber:9}})))}var lt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ok/index.tsx";function at(){const e=X(),t=W(),[,s]=Y(),o=ve(),[c]=G(),r=Ne(),n=i.useCallback(()=>{s.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(u=>{o("onOk",u,c),r()},"image/png")})},[t,s,o,c,r]);return _.default.createElement(F,{title:e.operation_ok_title,icon:"icon-ok",onClick:n,__self:this,__source:{fileName:lt,lineNumber:31,columnNumber:10}})}var ft="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Cancel/index.tsx";function ht(){const e=ve(),t=Ne(),s=X(),o=i.useCallback(()=>{e("onCancel"),t()},[e,t]);return _.default.createElement(F,{title:s.operation_cancel_title,icon:"icon-cancel",onClick:o,__self:this,__source:{fileName:ft,lineNumber:17,columnNumber:10}})}var mt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Save/index.tsx";function dt(){const e=X(),t=W(),[,s]=Y(),[o]=G(),c=ve(),r=Ne(),n=i.useCallback(()=>{s.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(u=>{c("onSave",u,o),r()},"image/png")})},[t,s,o,c,r]);return _.default.createElement(F,{title:e.operation_save_title,icon:"icon-save",onClick:n,__self:this,__source:{fileName:mt,lineNumber:31,columnNumber:10}})}var pt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Redo/index.tsx";function bt(){const e=X(),[t,s]=Y(),o=i.useCallback(()=>{s.redo()},[s]);return _.default.createElement(F,{title:e.operation_redo_title,icon:"icon-redo",disabled:!t.stack.length||t.stack.length-1===t.index,onClick:o,__self:this,__source:{fileName:pt,lineNumber:15,columnNumber:5}})}var gt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Undo/index.tsx";function _t(){const e=X(),[t,s]=Y(),o=i.useCallback(()=>{s.undo()},[s]);return _.default.createElement(F,{title:e.operation_undo_title,icon:"icon-undo",disabled:t.index===-1,onClick:o,__self:this,__source:{fileName:gt,lineNumber:15,columnNumber:5}})}var Re="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSize/index.tsx";function Xe({value:e,onChange:t}){const s=[3,6,9];return _.default.createElement("div",{className:"screenshots-size",__self:this,__source:{fileName:Re,lineNumber:12,columnNumber:5}},s.map(o=>{const c=["screenshots-size-item"];return o===e&&c.push("screenshots-size-active"),_.default.createElement("div",{key:o,className:c.join(" "),onClick:()=>t&&t(o),__self:this,__source:{fileName:Re,lineNumber:21,columnNumber:11}},_.default.createElement("div",{className:"screenshots-size-pointer",style:{width:o*1.8,height:o*1.8},__self:this,__source:{fileName:Re,lineNumber:22,columnNumber:13}}))}))}function ee(e){const t=Z();i.useEffect(()=>(t.on("mousedown",e),()=>{t.off("mousedown",e)}),[e,t])}function te(e){const t=Z();i.useEffect(()=>(t.on("mousemove",e),()=>{t.off("mousemove",e)}),[e,t])}function ne(e){const t=Z();i.useEffect(()=>(t.on("mouseup",e),()=>{t.off("mouseup",e)}),[e,t])}var Ye="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Mosaic/index.tsx";function pe(e,t,s){if(!s)return[0,0,0,0];const{data:o,width:c}=s,r=t*c*4+e*4;return Array.from(o.slice(r,r+4))}function yt(e,t){const{tiles:s,size:o}=t.data;s.forEach(c=>{const r=Math.round(c.color[0]),n=Math.round(c.color[1]),u=Math.round(c.color[2]),p=c.color[3]/255;e.fillStyle=`rgba(${r}, ${n}, ${u}, ${p})`,e.fillRect(c.x-o/2,c.y-o/2,o,o)})}function xt(){const e=X(),{image:t,width:s,height:o}=H(),[c,r]=I(),n=W(),[u,p]=Y(),[l]=G(),[,h]=A(),[a,f]=i.useState(3),m=i.useRef(null),g=i.useRef(null),x=c==="Mosaic",v=i.useCallback(()=>{r.set("Mosaic"),h.set("crosshair")},[r,h]),S=i.useCallback(()=>{x||(v(),p.clearSelect())},[x,v,p]),C=i.useCallback(b=>{if(!x||g.current||!m.current||!n.current)return;const y=n.current.canvas.getBoundingClientRect(),N=b.clientX-y.x,R=b.clientY-y.y,E=a*2;g.current={name:"Mosaic",type:B.Source,data:{size:E,tiles:[{x:N,y:R,color:pe(N,R,m.current)}]},editHistory:[],draw:yt}},[x,a,n]),z=i.useCallback(b=>{if(!x||!g.current||!n.current||!m.current)return;const y=n.current.canvas.getBoundingClientRect(),N=b.clientX-y.x,R=b.clientY-y.y,E=g.current.data.size,w=g.current.data.tiles;let k=w[w.length-1];if(!k)w.push({x:N,y:R,color:pe(N,R,m.current)});else{const V=k.x-N,D=k.y-R;let L=Math.sqrt(V**2+D**2);const ge=-D/L,_e=-V/L;for(;L>E;){const se=Math.floor(k.x+E*_e),re=Math.floor(k.y+E*ge);k={x:se,y:re,color:pe(se,re,m.current)},w.push(k),L-=E}L>E/2&&w.push({x:N,y:R,color:pe(N,R,m.current)})}u.top!==g.current?p.push(g.current):p.set(u)},[x,n,u,p]),d=i.useCallback(()=>{!x||(g.current=null)},[x]);return ee(C),te(z),ne(d),i.useEffect(()=>{if(!l||!t||!x)return;const b=document.createElement("canvas"),y=b.getContext("2d");if(!y)return;b.width=l.width,b.height=l.height;const N=t.naturalWidth/s,R=t.naturalHeight/o;y.drawImage(t,l.x*N,l.y*R,l.width*N,l.height*R,0,0,l.width,l.height),m.current=y.getImageData(0,0,l.width,l.height)},[s,o,l,t,x]),_.default.createElement(F,{title:e.operation_mosaic_title,icon:"icon-mosaic",checked:x,onClick:S,option:_.default.createElement(Xe,{value:a,onChange:f,__self:this,__source:{fileName:Ye,lineNumber:220,columnNumber:15}}),__self:this,__source:{fileName:Ye,lineNumber:215,columnNumber:5}})}var Fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsColor/index.tsx";function vt({value:e,onChange:t}){const s=["#ee5126","#fceb4d","#90e746","#51c0fa","#7a7a7a","#ffffff"];return _.default.createElement("div",{className:"screenshots-color",__self:this,__source:{fileName:Fe,lineNumber:12,columnNumber:5}},s.map(o=>{const c=["screenshots-color-item"];return o===e&&c.push("screenshots-color-active"),_.default.createElement("div",{key:o,className:c.join(" "),style:{backgroundColor:o},onClick:()=>t&&t(o),__self:this,__source:{fileName:Fe,lineNumber:19,columnNumber:11}})}))}var Se="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSizeColor/index.tsx";function ie({size:e,color:t,onSizeChange:s,onColorChange:o}){return _.default.createElement("div",{className:"screenshots-sizecolor",__self:this,__source:{fileName:Se,lineNumber:15,columnNumber:5}},_.default.createElement(Xe,{value:e,onChange:s,__self:this,__source:{fileName:Se,lineNumber:16,columnNumber:7}}),_.default.createElement(vt,{value:t,onChange:o,__self:this,__source:{fileName:Se,lineNumber:17,columnNumber:7}}))}const Nt=`
|
|
1
|
+
"use strict";var qe=Object.defineProperty,Je=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var Ee=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var De=(e,t,s)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,U=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&De(e,s,t[s]);if(he)for(var s of he(t))Be.call(t,s)&&De(e,s,t[s]);return e},me=(e,t)=>Je(e,Qe(t));var Me=(e,t)=>{var s={};for(var o in e)Ee.call(e,o)&&t.indexOf(o)<0&&(s[o]=e[o]);if(e!=null&&he)for(var o of he(e))t.indexOf(o)<0&&Be.call(e,o)&&(s[o]=e[o]);return s};var i=require("react"),$e=require("react-dom");function Ke(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var _=Ke(i);const Le={magnifier_position_label:"\u5750\u6807",operation_ok_title:"\u786E\u5B9A",operation_cancel_title:"\u53D6\u6D88",operation_save_title:"\u4FDD\u5B58",operation_redo_title:"\u91CD\u505A",operation_undo_title:"\u64A4\u9500",operation_mosaic_title:"\u9A6C\u8D5B\u514B",operation_text_title:"\u6587\u672C",operation_brush_title:"\u753B\u7B14",operation_arrow_title:"\u7BAD\u5934",operation_ellipse_title:"\u692D\u5706",operation_rectangle_title:"\u77E9\u5F62"};var xe=_.default.createContext({store:{url:void 0,image:null,width:0,height:0,lang:Le,emiterRef:{current:{}},canvasContextRef:{current:null},history:{index:-1,stack:[]},bounds:null,cursor:"move",operation:void 0},dispatcher:{call:void 0,setHistory:void 0,setBounds:void 0,setCursor:void 0,setOperation:void 0}});function H(){const{store:e}=i.useContext(xe);return e}function X(){const{lang:e}=H();return e}var J="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsMagnifier/index.tsx";const Q=100,K=80;function Ze({x:e,y:t}){const{width:s,height:o,image:c}=H(),r=X(),[n,u]=i.useState(null),p=i.useRef(null),l=i.useRef(null),h=i.useRef(null),[a,f]=i.useState("000000");return i.useLayoutEffect(()=>{if(!p.current)return;const m=p.current.getBoundingClientRect();let g=e+20,x=t+20;g+m.width>s&&(g=e-m.width-20),x+m.height>o&&(x=t-m.height-20),g<0&&(g=0),x<0&&(x=0),u({x:g,y:x})},[s,o,e,t]),i.useEffect(()=>{if(!c||!l.current){h.current=null;return}if(h.current||(h.current=l.current.getContext("2d")),!h.current)return;const m=h.current;m.clearRect(0,0,Q,K);const g=c.naturalWidth/s,x=c.naturalHeight/o;m.drawImage(c,e*g-Q/2,t*x-K/2,Q,K,0,0,Q,K);const{data:v}=m.getImageData(Math.floor(Q/2),Math.floor(K/2),1,1),S=Array.from(v.slice(0,3)).map(C=>C>=16?C.toString(16):`0${C.toString(16)}`).join("").toUpperCase();f(S)},[s,o,c,e,t]),_.default.createElement("div",{ref:p,className:"screenshots-magnifier",style:{transform:`translate(${n==null?void 0:n.x}px, ${n==null?void 0:n.y}px)`},__self:this,__source:{fileName:J,lineNumber:89,columnNumber:5}},_.default.createElement("div",{className:"screenshots-magnifier-body",__self:this,__source:{fileName:J,lineNumber:96,columnNumber:7}},_.default.createElement("canvas",{ref:l,className:"screenshots-magnifier-body-canvas",width:Q,height:K,__self:this,__source:{fileName:J,lineNumber:97,columnNumber:9}})),_.default.createElement("div",{className:"screenshots-magnifier-footer",__self:this,__source:{fileName:J,lineNumber:104,columnNumber:7}},_.default.createElement("div",{className:"screenshots-magnifier-footer-item",__self:this,__source:{fileName:J,lineNumber:105,columnNumber:9}},r.magnifier_position_label,": (",e,",",t,")"),_.default.createElement("div",{className:"screenshots-magnifier-footer-item",__self:this,__source:{fileName:J,lineNumber:108,columnNumber:9}},"RGB: #",a)))}function et({x:e,y:t},{x:s,y:o},c,r){return e>s&&([e,s]=[s,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0),s>c&&(s=c),t<0&&(t=0),o>r&&(o=r),{x:e,y:t,width:s-e,height:o-t}}function oe(){const{dispatcher:e}=i.useContext(xe);return e}function G(){const{bounds:e}=H(),{setBounds:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t(null)},[t]);return[e,{set:s,reset:o}]}var de="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsBackground/index.tsx";function tt(){const{url:e,width:t,height:s}=H(),[o,c]=G(),r=i.useRef(null),n=i.useRef(null),[u,p]=i.useState(null),l=i.useCallback((a,f)=>{if(!r.current)return;const{x:m,y:g}=r.current.getBoundingClientRect();c.set(et({x:a.x-m,y:a.y-g},{x:f.x-m,y:f.y-g},t,s))},[t,s,c]),h=i.useCallback(a=>{n.current||o||a.button!==0||(n.current={x:a.clientX,y:a.clientY})},[o]);return i.useEffect(()=>{const a=m=>{if(r.current){const g=r.current.getBoundingClientRect();m.clientX<g.left||m.clientY<g.top||m.clientX>g.right||m.clientY>g.bottom?p(null):p({x:m.clientX-g.x,y:m.clientY-g.y})}!n.current||l(n.current,{x:m.clientX,y:m.clientY})},f=m=>{!n.current||(l(n.current,{x:m.clientX,y:m.clientY}),n.current=null)};return window.addEventListener("mousemove",a),window.addEventListener("mouseup",f),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",f)}},[l]),e?_.default.createElement("div",{ref:r,className:"screenshots-background",onMouseDown:h,__self:this,__source:{fileName:de,lineNumber:104,columnNumber:5}},_.default.createElement("img",{className:"screenshots-background-image",src:e,__self:this,__source:{fileName:de,lineNumber:109,columnNumber:7}}),_.default.createElement("div",{className:"screenshots-background-mask",__self:this,__source:{fileName:de,lineNumber:110,columnNumber:7}}),u&&!o&&_.default.createElement(Ze,{x:u==null?void 0:u.x,y:u==null?void 0:u.y,__self:this,__source:{fileName:de,lineNumber:111,columnNumber:31}})):null}var Ve;const He=(Ve=window.devicePixelRatio)!=null?Ve:2;var pe=He<2?2:He;function nt(e,t,s,o){const c=e.clientX-s.x,r=e.clientY-s.y;let n=o.x,u=o.y,p=o.x+o.width,l=o.y+o.height;switch(t){case"top":u+=r;break;case"top-right":p+=c,u+=r;break;case"right":p+=c;break;case"right-bottom":p+=c,l+=r;break;case"bottom":l+=r;break;case"bottom-left":n+=c,l+=r;break;case"left":n+=c;break;case"left-top":n+=c,u+=r;break;case"move":n+=c,u+=r,p+=c,l+=r;break}return[{x:n,y:u},{x:p,y:l}]}function st({x:e,y:t},{x:s,y:o},c,r,n,u){return e>s&&([e,s]=[s,e]),t>o&&([t,o]=[o,t]),e<0&&(e=0,u==="move"&&(s=c.width)),s>r&&(s=r,u==="move"&&(e=s-c.width)),t<0&&(t=0,u==="move"&&(o=c.height)),o>n&&(o=n,u==="move"&&(t=o-c.height)),{x:e,y:t,width:Math.max(s-e,1),height:Math.max(o-t,1)}}var B;(function(e){e[e.Edit=0]="Edit",e[e.Source=1]="Source"})(B||(B={}));function Z(){const{emiterRef:e}=H(),t=i.useCallback((r,n)=>{const u=e.current;Array.isArray(u[r])?u[r].push(n):u[r]=[n]},[e]),s=i.useCallback((r,n)=>{const u=e.current;if(Array.isArray(u[r])){const p=u[r].findIndex(l=>l===n);p!==-1&&u[r].splice(p,1)}},[e]),o=i.useCallback((r,...n)=>{const u=e.current;Array.isArray(u[r])&&u[r].forEach(p=>p(...n))},[e]),c=i.useCallback(()=>{e.current={}},[e]);return{on:t,off:s,emit:o,reset:c}}function Y(){const{history:e}=H(),{setHistory:t}=oe(),s=i.useCallback(h=>{const{index:a,stack:f}=e;f.forEach(m=>{m.type===B.Source&&(m.isSelected=!1)}),h.type===B.Source?h.isSelected=!0:h.type===B.Edit&&(h.source.isSelected=!0),f.splice(a+1),f.push(h),t==null||t({index:f.length-1,stack:f})},[e,t]),o=i.useCallback(()=>{const{stack:h}=e;h.pop(),t==null||t({index:h.length-1,stack:h})},[e,t]),c=i.useCallback(()=>{const{index:h,stack:a}=e,f=a[h];f&&(f.type===B.Source?f.isSelected=!1:f.type===B.Edit&&f.source.editHistory.pop()),t==null||t({index:h<=0?-1:h-1,stack:a})},[e,t]),r=i.useCallback(()=>{const{index:h,stack:a}=e,f=a[h+1];f&&(f.type===B.Source?f.isSelected=!1:f.type===B.Edit&&f.source.editHistory.push(f)),t==null||t({index:h>=a.length-1?a.length-1:h+1,stack:a})},[e,t]),n=i.useCallback(h=>{t==null||t(U({},h))},[t]),u=i.useCallback(h=>{e.stack.forEach(a=>{a.type===B.Source&&(a===h?a.isSelected=!0:a.isSelected=!1)}),t==null||t(U({},e))},[e,t]),p=i.useCallback(()=>{e.stack.forEach(h=>{h.type===B.Source&&(h.isSelected=!1)}),t==null||t(U({},e))},[e,t]),l=i.useCallback(()=>{t==null||t({index:-1,stack:[]})},[t]);return[{index:e.index,stack:e.stack,top:e.stack.slice(e.index,e.index+1)[0]},{push:s,pop:o,undo:c,redo:r,set:n,select:u,clearSelect:p,reset:l}]}function A(){const{cursor:e}=H(),{setCursor:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t("move")},[t]);return[e,{set:s,reset:o}]}function I(){const{operation:e}=H(),{setOperation:t}=oe(),s=i.useCallback(c=>{t==null||t(c)},[t]),o=i.useCallback(()=>{t==null||t(void 0)},[t]);return[e,{set:s,reset:o}]}function rt(e,t,s,o){if(!t)return!1;const c=document.createElement("canvas");c.width=e.width,c.height=e.height;const r=c.getContext("2d");if(!r)return!1;const{left:n,top:u}=t.getBoundingClientRect(),p=o.clientX-n,l=o.clientY-u;return[...s.stack.slice(0,s.index+1)].reverse().find(a=>{var f;return a.type!==B.Source?!1:(r.clearRect(0,0,e.width,e.height),(f=a.isHit)==null?void 0:f.call(a,r,a,{x:p,y:l}))})}var ce="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsCanvas/index.tsx";const ot=["top","right","bottom","left"];var j;(function(e){e.ResizeTop="top",e.ResizetopRight="top-right",e.ResizeRight="right",e.ResizeRightBottom="right-bottom",e.ResizeBottom="bottom",e.ResizeBottomLeft="bottom-left",e.ResizeLeft="left",e.ResizeLeftTop="left-top",e.Move="move"})(j||(j={}));const ct=[j.ResizeTop,j.ResizetopRight,j.ResizeRight,j.ResizeRightBottom,j.ResizeBottom,j.ResizeBottomLeft,j.ResizeLeft,j.ResizeLeftTop];var it=i.forwardRef(function(t,s){const{image:o,width:c,height:r}=H(),n=Z(),[u]=Y(),[p]=A(),[l,h]=G(),[a]=I(),f=i.useRef(),m=i.useRef(null),g=i.useRef(null),x=i.useRef(null),v=i.useRef(null),S=i.useCallback(()=>{if(!o||!l||!v.current)return;const d=o.naturalWidth/c,b=o.naturalHeight/r,y=v.current;y.imageSmoothingEnabled=!0,y.imageSmoothingQuality="low",y.setTransform(pe,0,0,pe,0,0),y.clearRect(0,0,l.width,l.height),y.drawImage(o,l.x*d,l.y*b,l.width*d,l.height*b,0,0,l.width,l.height),u.stack.slice(0,u.index+1).forEach(N=>{N.type===B.Source&&N.draw(y,N)})},[o,c,r,l,v,u]),C=i.useCallback((d,b)=>{if(!(d.button!==0||!l))if(!a)f.current=b,m.current={x:d.clientX,y:d.clientY},g.current={x:l.x,y:l.y,width:l.width,height:l.height};else{const y=rt(l,x.current,u,d.nativeEvent);y?n.emit("drawselect",y,d.nativeEvent):n.emit("mousedown",d.nativeEvent)}},[l,a,n,u]),z=i.useCallback(d=>{if(!f.current||!m.current||!g.current||!l)return;const b=nt(d,f.current,m.current,g.current);h.set(st(b[0],b[1],l,c,r,f.current))},[c,r,l,h]);return i.useLayoutEffect(()=>{if(!o||!l||!x.current){v.current=null;return}v.current||(v.current=x.current.getContext("2d")),S()},[o,l,S]),i.useEffect(()=>{const d=y=>{if(a)n.emit("mousemove",y);else{if(!f.current||!m.current||!g.current)return;z(y)}},b=y=>{if(a)n.emit("mouseup",y);else{if(!f.current||!m.current||!g.current)return;z(y),f.current=void 0,m.current=null,g.current=null}};return window.addEventListener("mousemove",d),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",b)}},[z,a,n]),i.useImperativeHandle(s,()=>v.current),l?_.default.createElement("div",{className:"screenshots-canvas",style:{left:l.x,top:l.y,width:l.width,height:l.height},__self:this,__source:{fileName:ce,lineNumber:191,columnNumber:5}},_.default.createElement("canvas",{ref:x,width:l.width*pe,height:l.height*pe,style:{width:l.width,height:l.height},__self:this,__source:{fileName:ce,lineNumber:200,columnNumber:7}}),_.default.createElement("div",{className:"screenshots-canvas-body",style:{cursor:p},onMouseDown:d=>C(d,"move"),__self:this,__source:{fileName:ce,lineNumber:209,columnNumber:7}}),ot.map(d=>_.default.createElement("div",{key:d,className:`screenshots-canvas-border-${d}`,__self:this,__source:{fileName:ce,lineNumber:217,columnNumber:16}})),ct.map(d=>_.default.createElement("div",{key:d,className:`screenshots-canvas-point-${d}`,onMouseDown:b=>C(b,d),__self:this,__source:{fileName:ce,lineNumber:221,columnNumber:11}}))):null});function ve(){const e=oe();return i.useCallback((s,...o)=>{var c;(c=e.call)==null||c.call(e,s,...o)},[e])}function W(){const{canvasContextRef:e}=H();return e}function Ne(){const e=Z(),[,t]=G(),[,s]=A(),[,o]=Y(),[,c]=I();return i.useCallback(()=>{e.reset(),o.reset(),t.reset(),s.reset(),c.reset()},[e,o,t,s,c])}var Ce="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOption/index.tsx",q;(function(e){e.Bottom="bottom",e.Top="top"})(q||(q={}));function ut({open:e,content:t,children:s}){const o=i.useRef(null),c=i.useRef(null),r=i.useRef(null),n=i.useContext(Oe),[u,p]=i.useState(q.Bottom),[l,h]=i.useState(null),[a,f]=i.useState(0),m=()=>(c.current||(c.current=document.createElement("div")),c.current);return i.useEffect(()=>{const g=m();return e&&document.body.appendChild(g),()=>{g.remove()}},[e]),i.useEffect(()=>{if(!e||!n||!o.current||!r.current)return;const g=o.current.getBoundingClientRect(),x=r.current.getBoundingClientRect();let v=u,S=g.left+g.width/2,C=g.top+g.height,z=a;if(S+x.width/2>n.x+n.width){const d=S;S=n.x+n.width-x.width/2,z=d-S}if(S<n.x+x.width/2){const d=S;S=n.x+x.width/2,z=d-S}C>window.innerHeight-x.height&&(v===q.Bottom&&(v=q.Top),C=g.top-x.height),C<0&&(v===q.Top&&(v=q.Bottom),C=g.top+g.height),v!==u&&p(v),((l==null?void 0:l.x)!==S||l.y!==C)&&h({x:S,y:C}),z!==a&&f(z)}),_.default.createElement(_.default.Fragment,null,i.cloneElement(s,{ref:o}),e&&t&&$e.createPortal(_.default.createElement("div",{ref:r,className:"screenshots-option",style:{visibility:l?"visible":"hidden",left:l==null?void 0:l.x,top:l==null?void 0:l.y},"data-placement":u,__self:this,__source:{fileName:Ce,lineNumber:111,columnNumber:11}},_.default.createElement("div",{className:"screenshots-option-container",__self:this,__source:{fileName:Ce,lineNumber:121,columnNumber:13}},t),_.default.createElement("div",{className:"screenshots-option-arrow",style:{marginLeft:a},__self:this,__source:{fileName:Ce,lineNumber:122,columnNumber:13}})),m()))}var ke="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsButton/index.tsx";function F({title:e,icon:t,checked:s,disabled:o,option:c,onClick:r}){const n=["screenshots-button"],u=i.useCallback(p=>{o||!r||r(p)},[o,r]);return s&&n.push("screenshots-button-checked"),o&&n.push("screenshots-button-disabled"),_.default.createElement(ut,{open:s,content:c,__self:this,__source:{fileName:ke,lineNumber:42,columnNumber:5}},_.default.createElement("div",{className:n.join(" "),title:e,onClick:u,__self:this,__source:{fileName:ke,lineNumber:43,columnNumber:7}},_.default.createElement("span",{className:t,__self:this,__source:{fileName:ke,lineNumber:44,columnNumber:9}})))}var lt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ok/index.tsx";function at(){const e=X(),t=W(),[,s]=Y(),o=ve(),[c]=G(),r=Ne(),n=i.useCallback(()=>{s.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(u=>{o("onOk",u,c),r()},"image/png")})},[t,s,o,c,r]);return _.default.createElement(F,{title:e.operation_ok_title,icon:"icon-ok",onClick:n,__self:this,__source:{fileName:lt,lineNumber:31,columnNumber:10}})}var ft="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Cancel/index.tsx";function ht(){const e=ve(),t=Ne(),s=X(),o=i.useCallback(()=>{e("onCancel"),t()},[e,t]);return _.default.createElement(F,{title:s.operation_cancel_title,icon:"icon-cancel",onClick:o,__self:this,__source:{fileName:ft,lineNumber:17,columnNumber:10}})}var mt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Save/index.tsx";function dt(){const e=X(),t=W(),[,s]=Y(),[o]=G(),c=ve(),r=Ne(),n=i.useCallback(()=>{s.clearSelect(),setTimeout(()=>{!t.current||t.current.canvas.toBlob(u=>{c("onSave",u,o),r()},"image/png")})},[t,s,o,c,r]);return _.default.createElement(F,{title:e.operation_save_title,icon:"icon-save",onClick:n,__self:this,__source:{fileName:mt,lineNumber:31,columnNumber:10}})}var pt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Redo/index.tsx";function bt(){const e=X(),[t,s]=Y(),o=i.useCallback(()=>{s.redo()},[s]);return _.default.createElement(F,{title:e.operation_redo_title,icon:"icon-redo",disabled:!t.stack.length||t.stack.length-1===t.index,onClick:o,__self:this,__source:{fileName:pt,lineNumber:15,columnNumber:5}})}var gt="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Undo/index.tsx";function _t(){const e=X(),[t,s]=Y(),o=i.useCallback(()=>{s.undo()},[s]);return _.default.createElement(F,{title:e.operation_undo_title,icon:"icon-undo",disabled:t.index===-1,onClick:o,__self:this,__source:{fileName:gt,lineNumber:15,columnNumber:5}})}var Re="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSize/index.tsx";function Xe({value:e,onChange:t}){const s=[3,6,9];return _.default.createElement("div",{className:"screenshots-size",__self:this,__source:{fileName:Re,lineNumber:12,columnNumber:5}},s.map(o=>{const c=["screenshots-size-item"];return o===e&&c.push("screenshots-size-active"),_.default.createElement("div",{key:o,className:c.join(" "),onClick:()=>t&&t(o),__self:this,__source:{fileName:Re,lineNumber:21,columnNumber:11}},_.default.createElement("div",{className:"screenshots-size-pointer",style:{width:o*1.8,height:o*1.8},__self:this,__source:{fileName:Re,lineNumber:22,columnNumber:13}}))}))}function ee(e){const t=Z();i.useEffect(()=>(t.on("mousedown",e),()=>{t.off("mousedown",e)}),[e,t])}function te(e){const t=Z();i.useEffect(()=>(t.on("mousemove",e),()=>{t.off("mousemove",e)}),[e,t])}function ne(e){const t=Z();i.useEffect(()=>(t.on("mouseup",e),()=>{t.off("mouseup",e)}),[e,t])}var Ye="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Mosaic/index.tsx";function be(e,t,s){if(!s)return[0,0,0,0];const{data:o,width:c}=s,r=t*c*4+e*4;return Array.from(o.slice(r,r+4))}function yt(e,t){const{tiles:s,size:o}=t.data;s.forEach(c=>{const r=Math.round(c.color[0]),n=Math.round(c.color[1]),u=Math.round(c.color[2]),p=c.color[3]/255;e.fillStyle=`rgba(${r}, ${n}, ${u}, ${p})`,e.fillRect(c.x-o/2,c.y-o/2,o,o)})}function xt(){const e=X(),{image:t,width:s,height:o}=H(),[c,r]=I(),n=W(),[u,p]=Y(),[l]=G(),[,h]=A(),[a,f]=i.useState(3),m=i.useRef(null),g=i.useRef(null),x=c==="Mosaic",v=i.useCallback(()=>{r.set("Mosaic"),h.set("crosshair")},[r,h]),S=i.useCallback(()=>{x||(v(),p.clearSelect())},[x,v,p]),C=i.useCallback(b=>{if(!x||g.current||!m.current||!n.current)return;const y=n.current.canvas.getBoundingClientRect(),N=b.clientX-y.x,R=b.clientY-y.y,E=a*2;g.current={name:"Mosaic",type:B.Source,data:{size:E,tiles:[{x:N,y:R,color:be(N,R,m.current)}]},editHistory:[],draw:yt}},[x,a,n]),z=i.useCallback(b=>{if(!x||!g.current||!n.current||!m.current)return;const y=n.current.canvas.getBoundingClientRect(),N=b.clientX-y.x,R=b.clientY-y.y,E=g.current.data.size,w=g.current.data.tiles;let k=w[w.length-1];if(!k)w.push({x:N,y:R,color:be(N,R,m.current)});else{const V=k.x-N,D=k.y-R;let L=Math.sqrt(V**2+D**2);const _e=-D/L,ye=-V/L;for(;L>E;){const se=Math.floor(k.x+E*ye),re=Math.floor(k.y+E*_e);k={x:se,y:re,color:be(se,re,m.current)},w.push(k),L-=E}L>E/2&&w.push({x:N,y:R,color:be(N,R,m.current)})}u.top!==g.current?p.push(g.current):p.set(u)},[x,n,u,p]),d=i.useCallback(()=>{!x||(g.current=null)},[x]);return ee(C),te(z),ne(d),i.useEffect(()=>{if(!l||!t||!x)return;const b=document.createElement("canvas"),y=b.getContext("2d");if(!y)return;b.width=l.width,b.height=l.height;const N=t.naturalWidth/s,R=t.naturalHeight/o;y.drawImage(t,l.x*N,l.y*R,l.width*N,l.height*R,0,0,l.width,l.height),m.current=y.getImageData(0,0,l.width,l.height)},[s,o,l,t,x]),_.default.createElement(F,{title:e.operation_mosaic_title,icon:"icon-mosaic",checked:x,onClick:S,option:_.default.createElement(Xe,{value:a,onChange:f,__self:this,__source:{fileName:Ye,lineNumber:220,columnNumber:15}}),__self:this,__source:{fileName:Ye,lineNumber:215,columnNumber:5}})}var Fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsColor/index.tsx";function vt({value:e,onChange:t}){const s=["#ee5126","#fceb4d","#90e746","#51c0fa","#7a7a7a","#ffffff"];return _.default.createElement("div",{className:"screenshots-color",__self:this,__source:{fileName:Fe,lineNumber:12,columnNumber:5}},s.map(o=>{const c=["screenshots-color-item"];return o===e&&c.push("screenshots-color-active"),_.default.createElement("div",{key:o,className:c.join(" "),style:{backgroundColor:o},onClick:()=>t&&t(o),__self:this,__source:{fileName:Fe,lineNumber:19,columnNumber:11}})}))}var Se="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsSizeColor/index.tsx";function ie({size:e,color:t,onSizeChange:s,onColorChange:o}){return _.default.createElement("div",{className:"screenshots-sizecolor",__self:this,__source:{fileName:Se,lineNumber:15,columnNumber:5}},_.default.createElement(Xe,{value:e,onChange:s,__self:this,__source:{fileName:Se,lineNumber:16,columnNumber:7}}),_.default.createElement(vt,{value:t,onChange:o,__self:this,__source:{fileName:Se,lineNumber:17,columnNumber:7}}))}const Nt=`
|
|
2
2
|
min-width: 0 !important;
|
|
3
3
|
width: 0 !important;
|
|
4
4
|
min-height: 0 !important;
|
|
@@ -11,4 +11,4 @@ top:0 !important;
|
|
|
11
11
|
right:0 !important;
|
|
12
12
|
`,Ct=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","text-indent","padding-left","padding-right","border-width","box-sizing","white-space","word-break"];let O;function kt(e){const t=window.getComputedStyle(e),s=t.getPropertyValue("box-sizing")||t.getPropertyValue("-moz-box-sizing")||t.getPropertyValue("-webkit-box-sizing"),o=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),c=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{sizingStyle:Ct.map(n=>`${n}:${t.getPropertyValue(n)}`).join(";"),paddingSize:o,borderSize:c,boxSizing:s}}function Rt(e,t,s,o){O||(O=document.createElement("textarea"),O.setAttribute("tab-index","-1"),document.body.appendChild(O));const{paddingSize:c,borderSize:r,boxSizing:n,sizingStyle:u}=kt(e);O.setAttribute("style",`${u};${Nt};max-width:${s}px;max-height:${o}px`),O.value=t||" ";let p=O.scrollWidth,l=O.scrollHeight;return n==="border-box"?(p+=r,l+=r):n==="content-box"&&(p-=c,l-=c),{width:Math.min(p,s),height:Math.min(l,o)}}var St="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsTextarea/index.tsx";function wt({x:e,y:t,maxWidth:s,maxHeight:o,size:c,color:r,value:n,onChange:u,onBlur:p}){const l=i.useRef(null),h=i.useRef(null),[a,f]=i.useState(0),[m,g]=i.useState(0),x=()=>(l.current||(l.current=document.createElement("div")),l.current);return i.useLayoutEffect(()=>(l.current&&(document.body.appendChild(l.current),requestAnimationFrame(()=>{var v;(v=h.current)==null||v.focus()})),()=>{var v;(v=l.current)==null||v.remove()}),[]),i.useLayoutEffect(()=>{if(!h.current)return;const{width:v,height:S}=Rt(h.current,n,s,o);f(v),g(S)},[n,s,o]),$e.createPortal(_.default.createElement("textarea",{ref:h,className:"screenshots-textarea",style:{left:e,top:t,color:r,width:a,height:m,maxWidth:s,maxHeight:o,fontSize:c,lineHeight:`${c}px`},value:n,onChange:v=>u&&u(v.target.value),onBlur:v=>p&&p(v),__self:this,__source:{fileName:St,lineNumber:65,columnNumber:5}}),x())}function ue(e){const t=Z();i.useEffect(()=>(t.on("drawselect",e),()=>{t.off("drawselect",e)}),[e,t])}var we="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Text/index.tsx";const ze={3:18,6:32,9:46};function zt(e,t){const{size:s,color:o,fontFamily:c,x:r,y:n,text:u}=t.data;e.fillStyle=o,e.textAlign="left",e.textBaseline="top",e.font=`${s}px ${c}`;const p=t.editHistory.reduce((l,{data:h})=>({x:l.x+h.x2-h.x1,y:l.y+h.y2-h.y1}),{x:0,y:0});u.split(`
|
|
13
13
|
`).forEach((l,h)=>{e.fillText(l,r+p.x,n+p.y+h*s)})}function Et(e,t,s){e.textAlign="left",e.textBaseline="top",e.font=`${t.data.size}px ${t.data.fontFamily}`;let o=0,c=0;t.data.text.split(`
|
|
14
|
-
`).forEach(a=>{const f=e.measureText(a);o<f.width&&(o=f.width),c+=t.data.size});const{x:r,y:n}=t.editHistory.reduce((a,{data:f})=>({x:a.x+f.x2-f.x1,y:a.y+f.y2-f.y1}),{x:0,y:0}),u=t.data.x+r,p=t.data.y+n,l=u+o,h=p+c;return s.x>=u&&s.x<=l&&s.y>=p&&s.y<=h}function Bt(){const e=X(),[t,s]=Y(),[o]=G(),[c,r]=I(),[,n]=A(),u=W(),[p,l]=i.useState(3),[h,a]=i.useState("#ee5126"),f=i.useRef(null),m=i.useRef(null),[g,x]=i.useState(null),[v,S]=i.useState(""),C=c==="Text",z=i.useCallback(()=>{r.set("Text"),n.set("default")},[r,n]),d=i.useCallback(()=>{C||(z(),s.clearSelect())},[C,z,s]),b=i.useCallback(D=>{f.current&&(f.current.data.size=ze[D]),l(D)},[]),y=i.useCallback(D=>{f.current&&(f.current.data.color=D),a(D)},[]),N=i.useCallback(D=>{S(D),C&&f.current&&(f.current.data.text=D)},[C]),R=i.useCallback(()=>{f.current&&f.current.data.text&&s.push(f.current),f.current=null,S(""),x(null)},[s]),E=i.useCallback((D,L)=>{D.name==="Text"&&(z(),m.current={type:B.Edit,data:{x1:L.clientX,y1:L.clientY,x2:L.clientX,y2:L.clientY},source:D},s.select(D))},[z,s]),w=i.useCallback(D=>{if(!C||!u.current||f.current||!o)return;const{left:L,top:ge}=u.current.canvas.getBoundingClientRect(),_e=window.getComputedStyle(u.current.canvas).fontFamily,se=D.clientX-L,re=D.clientY-ge;f.current={name:"Text",type:B.Source,data:{size:ze[p],color:h,fontFamily:_e,x:se,y:re,text:""},editHistory:[],draw:zt,isHit:Et},x({x:D.clientX,y:D.clientY,maxWidth:o.width-se,maxHeight:o.height-re})},[C,p,h,o,u]),k=i.useCallback(D=>{!C||m.current&&(m.current.data.x2=D.clientX,m.current.data.y2=D.clientY,t.top!==m.current?(m.current.source.editHistory.push(m.current),s.push(m.current)):s.set(t))},[C,t,s]),V=i.useCallback(()=>{!C||(m.current=null)},[C]);return ue(E),ee(w),te(k),ne(V),_.default.createElement(_.default.Fragment,null,_.default.createElement(F,{title:e.operation_text_title,icon:"icon-text",checked:C,onClick:d,option:_.default.createElement(ie,{size:p,color:h,onSizeChange:b,onColorChange:y,__self:this,__source:{fileName:we,lineNumber:261,columnNumber:11}}),__self:this,__source:{fileName:we,lineNumber:255,columnNumber:7}}),C&&g&&_.default.createElement(wt,{x:g.x,y:g.y,maxWidth:g.maxWidth,maxHeight:g.maxHeight,size:ze[p],color:h,value:v,onChange:N,onBlur:R,__self:this,__source:{fileName:we,lineNumber:265,columnNumber:9}}))}const Pe=4;function M(e,t,s){e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.arc(t,s,Pe,0,2*Math.PI),e.fill(),e.stroke()}function be(e,t,s){t.draw(e,t);const{data:o}=e.getImageData(s.x,s.y,1,1);return o.some(c=>c!==0)}function $(e,t,s){if(!e)return!1;const{left:o,top:c}=e.getBoundingClientRect(),r=t.clientX-o,n=t.clientY-c;return(s.x-r)**2+(s.y-n)**2<Pe**2}function Dt(e,t){const{size:s,color:o,points:c}=t.data;e.lineCap="round",e.lineJoin="round",e.lineWidth=s,e.strokeStyle=o;const r=t.editHistory.reduce((n,{data:u})=>({x:n.x+u.x2-u.x1,y:n.y+u.y2-u.y1}),{x:0,y:0});e.beginPath(),c.forEach((n,u)=>{u===0?e.moveTo(n.x+r.x,n.y+r.y):e.lineTo(n.x+r.x,n.y+r.y)}),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.beginPath(),c.forEach((n,u)=>{u===0?e.moveTo(n.x+r.x,n.y+r.y):e.lineTo(n.x+r.x,n.y+r.y)}),e.stroke())}var Te="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Brush/index.tsx";function Mt(){const e=X(),[,t]=A(),[s,o]=I(),c=W(),[r,n]=Y(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=s==="Brush",g=i.useCallback(()=>{o.set("Brush"),t.set("default")},[o,t]),x=i.useCallback(()=>{m||(g(),n.clearSelect())},[m,g,n]),v=i.useCallback((d,b)=>{d.name==="Brush"&&(g(),f.current={type:B.Edit,data:{x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},n.select(d))},[g,n]),S=i.useCallback(d=>{if(!m||a.current||!c.current)return;const{left:b,top:y}=c.current.canvas.getBoundingClientRect();a.current={name:"Brush",type:B.Source,data:{size:u,color:l,points:[{x:d.clientX-b,y:d.clientY-y}]},editHistory:[],draw:Dt,isHit:be}},[m,c,u,l]),C=i.useCallback(d=>{if(!(!m||!c.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,r.top!==f.current?(f.current.source.editHistory.push(f.current),n.push(f.current)):n.set(r);else if(a.current){const{left:b,top:y}=c.current.canvas.getBoundingClientRect();a.current.data.points.push({x:d.clientX-b,y:d.clientY-y}),r.top!==a.current?n.push(a.current):n.set(r)}}},[m,r,c,n]),z=i.useCallback(()=>{!m||(a.current&&n.clearSelect(),a.current=null,f.current=null)},[m,n]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_brush_title,icon:"icon-brush",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Te,lineNumber:166,columnNumber:15}}),__self:this,__source:{fileName:Te,lineNumber:161,columnNumber:5}})}function je(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===le.Move?(t+=n,s+=u,o+=n,c+=u):r.type===le.MoveStart?(t+=n,s+=u):r.type===le.MoveEnd&&(o+=n,c+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function $t(e,t){const{size:s,color:o,x1:c,x2:r,y1:n,y2:u}=je(t);e.lineCap="round",e.lineJoin="bevel",e.lineWidth=s,e.strokeStyle=o;const p=r-c,l=u-n,h=s*3,a=Math.atan2(l,p);e.beginPath(),e.moveTo(c,n),e.lineTo(r,u),e.lineTo(r-h*Math.cos(a-Math.PI/6),u-h*Math.sin(a-Math.PI/6)),e.moveTo(r,u),e.lineTo(r-h*Math.cos(a+Math.PI/6),u-h*Math.sin(a+Math.PI/6)),e.stroke(),t.isSelected&&(M(e,c,n),M(e,r,u))}var Ue="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Arrow/index.tsx",le;(function(e){e[e.Move=0]="Move",e[e.MoveStart=1]="MoveStart",e[e.MoveEnd=2]="MoveEnd"})(le||(le={}));function Lt(){const e=X(),[,t]=A(),[s,o]=I(),[c,r]=Y(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=s==="Arrow",g=i.useCallback(()=>{o.set("Arrow"),t.set("default")},[o,t]),x=i.useCallback(()=>{m||(g(),r.clearSelect())},[m,g,r]),v=i.useCallback((d,b)=>{if(d.name!=="Arrow"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=je(y);let k=0;$(n.current.canvas,b,{x:N,y:R})?k=1:$(n.current.canvas,b,{x:E,y:w})&&(k=2),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:y},r.select(d)},[n,g,r]),S=i.useCallback(d=>{if(!m||a.current||!n.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current={name:"Arrow",type:B.Source,data:{size:u,color:l,x1:d.clientX-b,y1:d.clientY-y,x2:d.clientX-b,y2:d.clientY-y},editHistory:[],draw:$t,isHit:be}},[m,l,u,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,c.top!==f.current?(f.current.source.editHistory.push(f.current),r.push(f.current)):r.set(c);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current.data.x2=d.clientX-b,a.current.data.y2=d.clientY-y,c.top!==a.current?r.push(a.current):r.set(c)}}},[m,c,n,r]),z=i.useCallback(()=>{!m||(a.current&&r.clearSelect(),a.current=null,f.current=null)},[m,r]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_arrow_title,icon:"icon-arrow",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Ue,lineNumber:190,columnNumber:15}}),__self:this,__source:{fileName:Ue,lineNumber:185,columnNumber:5}})}function Ge(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===P.Move?(t+=n,s+=u,o+=n,c+=u):r.type===P.ResizeTop?s+=u:r.type===P.ResizeRightTop?(o+=n,s+=u):r.type===P.ResizeRight?o+=n:r.type===P.ResizeRightBottom?(o+=n,c+=u):r.type===P.ResizeBottom?c+=u:r.type===P.ResizeLeftBottom?(t+=n,c+=u):r.type===P.ResizeLeft?t+=n:r.type===P.ResizeLeftTop&&(t+=n,s+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function Ht(e,t){const{size:s,color:o,x1:c,y1:r,x2:n,y2:u}=Ge(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=s,e.strokeStyle=o;const p=(c+n)/2,l=(r+u)/2,h=Math.abs(n-c)/2,a=Math.abs(u-r)/2,f=.5522848,m=h*f,g=a*f;e.beginPath(),e.moveTo(p-h,l),e.bezierCurveTo(p-h,l-g,p-m,l-a,p,l-a),e.bezierCurveTo(p+m,l-a,p+h,l-g,p+h,l),e.bezierCurveTo(p+h,l+g,p+m,l+a,p,l+a),e.bezierCurveTo(p-m,l+a,p-h,l+g,p-h,l),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.moveTo(c,r),e.lineTo(n,r),e.lineTo(n,u),e.lineTo(c,u),e.closePath(),e.stroke(),M(e,(c+n)/2,r),M(e,n,r),M(e,n,(r+u)/2),M(e,n,u),M(e,(c+n)/2,u),M(e,c,u),M(e,c,(r+u)/2),M(e,c,r))}var Ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ellipse/index.tsx",P;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(P||(P={}));function Xt(){const e=X(),[t,s]=Y(),[o,c]=I(),[,r]=A(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=o==="Ellipse",g=i.useCallback(()=>{c.set("Ellipse"),r.set("crosshair")},[c,r]),x=i.useCallback(()=>{m||(g(),s.clearSelect())},[m,g,s]),v=i.useCallback((d,b)=>{if(d.name!=="Ellipse"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=Ge(y);let k=0;$(n.current.canvas,b,{x:(N+E)/2,y:R})?k=1:$(n.current.canvas,b,{x:E,y:R})?k=2:$(n.current.canvas,b,{x:E,y:(R+w)/2})?k=3:$(n.current.canvas,b,{x:E,y:w})?k=4:$(n.current.canvas,b,{x:(N+E)/2,y:w})?k=5:$(n.current.canvas,b,{x:N,y:w})?k=6:$(n.current.canvas,b,{x:N,y:(R+w)/2})?k=7:$(n.current.canvas,b,{x:N,y:R})&&(k=8),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:y},s.select(d)},[n,g,s]),S=i.useCallback(d=>{if(!m||!n.current||a.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=d.clientX-b,R=d.clientY-y;a.current={name:"Ellipse",type:B.Source,data:{size:u,color:l,x1:N,y1:R,x2:N,y2:R},editHistory:[],draw:Ht,isHit:be}},[m,u,l,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),s.push(f.current)):s.set(t);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current.data.x2=d.clientX-b,a.current.data.y2=d.clientY-y,t.top!==a.current?s.push(a.current):s.set(t)}}},[m,n,t,s]),z=i.useCallback(()=>{!m||(a.current&&s.clearSelect(),a.current=null,f.current=null)},[m,s]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_ellipse_title,icon:"icon-ellipse",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Ae,lineNumber:242,columnNumber:15}}),__self:this,__source:{fileName:Ae,lineNumber:237,columnNumber:5}})}function Ie(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===T.Move?(t+=n,s+=u,o+=n,c+=u):r.type===T.ResizeTop?s+=u:r.type===T.ResizeRightTop?(o+=n,s+=u):r.type===T.ResizeRight?o+=n:r.type===T.ResizeRightBottom?(o+=n,c+=u):r.type===T.ResizeBottom?c+=u:r.type===T.ResizeLeftBottom?(t+=n,c+=u):r.type===T.ResizeLeft?t+=n:r.type===T.ResizeLeftTop&&(t+=n,s+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function Yt(e,t){const{size:s,color:o,x1:c,y1:r,x2:n,y2:u}=Ie(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=s,e.strokeStyle=o,e.beginPath(),e.moveTo(c,r),e.lineTo(n,r),e.lineTo(n,u),e.lineTo(c,u),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",M(e,(c+n)/2,r),M(e,n,r),M(e,n,(r+u)/2),M(e,n,u),M(e,(c+n)/2,u),M(e,c,u),M(e,c,(r+u)/2),M(e,c,r))}var We="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Rectangle/index.tsx",T;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(T||(T={}));function Ft(){const e=X(),[t,s]=Y(),[o,c]=I(),[,r]=A(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=o==="Rectangle",g=i.useCallback(()=>{c.set("Rectangle"),r.set("crosshair")},[c,r]),x=i.useCallback(()=>{m||(g(),s.clearSelect())},[m,g,s]),v=i.useCallback((d,b)=>{if(d.name!=="Rectangle"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=Ie(y);let k=0;$(n.current.canvas,b,{x:(N+E)/2,y:R})?k=1:$(n.current.canvas,b,{x:E,y:R})?k=2:$(n.current.canvas,b,{x:E,y:(R+w)/2})?k=3:$(n.current.canvas,b,{x:E,y:w})?k=4:$(n.current.canvas,b,{x:(N+E)/2,y:w})?k=5:$(n.current.canvas,b,{x:N,y:w})?k=6:$(n.current.canvas,b,{x:N,y:(R+w)/2})?k=7:$(n.current.canvas,b,{x:N,y:R})&&(k=8),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},s.select(d)},[n,g,s]),S=i.useCallback(d=>{if(!m||!n.current||a.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=d.clientX-b,R=d.clientY-y;a.current={name:"Rectangle",type:B.Source,data:{size:u,color:l,x1:N,y1:R,x2:N,y2:R},editHistory:[],draw:Yt,isHit:be}},[m,u,l,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),s.push(f.current)):s.set(t);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=a.current.data;N.x2=d.clientX-b,N.y2=d.clientY-y,t.top!==a.current?s.push(a.current):s.set(t)}}},[m,n,t,s]),z=i.useCallback(()=>{!m||(a.current&&s.clearSelect(),a.current=null,f.current=null)},[m,s]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_rectangle_title,icon:"icon-rectangle",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:We,lineNumber:242,columnNumber:15}}),__self:this,__source:{fileName:We,lineNumber:237,columnNumber:5}})}var Pt=[Ft,Xt,Lt,Mt,Bt,xt,"|",_t,bt,"|",dt,ht,at];var ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOperations/index.tsx";const Oe=_.default.createContext(null);function Tt(){const{width:e,height:t}=H(),[s]=G(),[o,c]=i.useState(null),[r,n]=i.useState(null),u=i.useRef(null),p=i.useCallback(h=>{h.stopPropagation()},[]),l=i.useCallback(h=>{h.preventDefault(),h.stopPropagation()},[]);return i.useEffect(()=>{if(!s||!u.current)return;const h=u.current.getBoundingClientRect();let a=s.x+s.width-h.width,f=s.y+s.height+10;a<0&&(a=0),a>e-h.width&&(a=e-h.width),f>t-h.height&&(f=t-h.height-10),((r==null?void 0:r.x)!==a||r.y!==f)&&n({x:a,y:f}),((o==null?void 0:o.x)!==h.x||o.y!==h.y||o.width!==h.width||o.height!==h.height)&&c({x:h.x,y:h.y,width:h.width,height:h.height})}),s?_.default.createElement(Oe.Provider,{value:o,__self:this,__source:{fileName:ae,lineNumber:76,columnNumber:5}},_.default.createElement("div",{ref:u,className:"screenshots-operations",style:{visibility:r?"visible":"hidden",left:r==null?void 0:r.x,top:r==null?void 0:r.y},onDoubleClick:p,onContextMenu:l,__self:this,__source:{fileName:ae,lineNumber:77,columnNumber:7}},_.default.createElement("div",{className:"screenshots-operations-buttons",__self:this,__source:{fileName:ae,lineNumber:88,columnNumber:9}},Pt.map((h,a)=>h==="|"?_.default.createElement("div",{key:a,className:"screenshots-operations-divider",__self:this,__source:{fileName:ae,lineNumber:91,columnNumber:22}}):_.default.createElement(h,{key:a,__self:this,__source:{fileName:ae,lineNumber:93,columnNumber:22}}))))):null}function jt(e){const[t,s]=i.useState(null);return i.useEffect(()=>{if(e==null)return;const o=document.createElement("img"),c=()=>s(o),r=()=>s(null);return o.addEventListener("load",c),o.addEventListener("error",r),o.src=e,()=>{o.removeEventListener("load",c),o.removeEventListener("error",r)}},[e]),t}var fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/index.tsx";function Ut(n){var u=n,{url:e,width:t,height:s,lang:o,className:c}=u,r=Me(u,["url","width","height","lang","className"]);const p=jt(e),l=i.useRef(null),h=i.useRef({}),[a,f]=i.useState({index:-1,stack:[]}),[m,g]=i.useState(null),[x,v]=i.useState("move"),[S,C]=i.useState(void 0),z={url:e,width:t,height:s,image:p,lang:U(U({},Le),o),emiterRef:h,canvasContextRef:l,history:a,bounds:m,cursor:x,operation:S},d=i.useCallback((w,...k)=>{const V=r[w];typeof V=="function"&&V(...k)},[r]),b={call:d,setHistory:f,setBounds:g,setCursor:v,setOperation:C},y=["screenshots"];c&&y.push(c);const N=()=>{h.current={},f({index:-1,stack:[]}),g(null),v("move"),C(void 0)},R=i.useCallback(w=>{w.button!==0||!m||!l.current||l.current.canvas.toBlob(k=>{d("onOk",k,m),N()},"image/png")},[m,d]),E=i.useCallback(w=>{w.button===2&&(w.preventDefault(),d("onCancel"),N())},[d]);return _.default.createElement(ye.Provider,{value:{store:z,dispatcher:b},__self:this,__source:{fileName:fe,lineNumber:111,columnNumber:5}},_.default.createElement("div",{className:y.join(" "),style:{width:t,height:s},onDoubleClick:R,onContextMenu:E,__self:this,__source:{fileName:fe,lineNumber:112,columnNumber:7}},_.default.createElement(tt,{__self:this,__source:{fileName:fe,lineNumber:118,columnNumber:9}}),_.default.createElement(it,{ref:l,__self:this,__source:{fileName:fe,lineNumber:119,columnNumber:9}}),_.default.createElement(Tt,{__self:this,__source:{fileName:fe,lineNumber:120,columnNumber:9}})))}module.exports=Ut;
|
|
14
|
+
`).forEach(a=>{const f=e.measureText(a);o<f.width&&(o=f.width),c+=t.data.size});const{x:r,y:n}=t.editHistory.reduce((a,{data:f})=>({x:a.x+f.x2-f.x1,y:a.y+f.y2-f.y1}),{x:0,y:0}),u=t.data.x+r,p=t.data.y+n,l=u+o,h=p+c;return s.x>=u&&s.x<=l&&s.y>=p&&s.y<=h}function Bt(){const e=X(),[t,s]=Y(),[o]=G(),[c,r]=I(),[,n]=A(),u=W(),[p,l]=i.useState(3),[h,a]=i.useState("#ee5126"),f=i.useRef(null),m=i.useRef(null),[g,x]=i.useState(null),[v,S]=i.useState(""),C=c==="Text",z=i.useCallback(()=>{r.set("Text"),n.set("default")},[r,n]),d=i.useCallback(()=>{C||(z(),s.clearSelect())},[C,z,s]),b=i.useCallback(D=>{f.current&&(f.current.data.size=ze[D]),l(D)},[]),y=i.useCallback(D=>{f.current&&(f.current.data.color=D),a(D)},[]),N=i.useCallback(D=>{S(D),C&&f.current&&(f.current.data.text=D)},[C]),R=i.useCallback(()=>{f.current&&f.current.data.text&&s.push(f.current),f.current=null,S(""),x(null)},[s]),E=i.useCallback((D,L)=>{D.name==="Text"&&(z(),m.current={type:B.Edit,data:{x1:L.clientX,y1:L.clientY,x2:L.clientX,y2:L.clientY},source:D},s.select(D))},[z,s]),w=i.useCallback(D=>{if(!C||!u.current||f.current||!o)return;const{left:L,top:_e}=u.current.canvas.getBoundingClientRect(),ye=window.getComputedStyle(u.current.canvas).fontFamily,se=D.clientX-L,re=D.clientY-_e;f.current={name:"Text",type:B.Source,data:{size:ze[p],color:h,fontFamily:ye,x:se,y:re,text:""},editHistory:[],draw:zt,isHit:Et},x({x:D.clientX,y:D.clientY,maxWidth:o.width-se,maxHeight:o.height-re})},[C,p,h,o,u]),k=i.useCallback(D=>{!C||m.current&&(m.current.data.x2=D.clientX,m.current.data.y2=D.clientY,t.top!==m.current?(m.current.source.editHistory.push(m.current),s.push(m.current)):s.set(t))},[C,t,s]),V=i.useCallback(()=>{!C||(m.current=null)},[C]);return ue(E),ee(w),te(k),ne(V),_.default.createElement(_.default.Fragment,null,_.default.createElement(F,{title:e.operation_text_title,icon:"icon-text",checked:C,onClick:d,option:_.default.createElement(ie,{size:p,color:h,onSizeChange:b,onColorChange:y,__self:this,__source:{fileName:we,lineNumber:261,columnNumber:11}}),__self:this,__source:{fileName:we,lineNumber:255,columnNumber:7}}),C&&g&&_.default.createElement(wt,{x:g.x,y:g.y,maxWidth:g.maxWidth,maxHeight:g.maxHeight,size:ze[p],color:h,value:v,onChange:N,onBlur:R,__self:this,__source:{fileName:we,lineNumber:265,columnNumber:9}}))}const Pe=4;function M(e,t,s){e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.arc(t,s,Pe,0,2*Math.PI),e.fill(),e.stroke()}function ge(e,t,s){t.draw(e,t);const{data:o}=e.getImageData(s.x,s.y,1,1);return o.some(c=>c!==0)}function $(e,t,s){if(!e)return!1;const{left:o,top:c}=e.getBoundingClientRect(),r=t.clientX-o,n=t.clientY-c;return(s.x-r)**2+(s.y-n)**2<Pe**2}function Dt(e,t){const{size:s,color:o,points:c}=t.data;e.lineCap="round",e.lineJoin="round",e.lineWidth=s,e.strokeStyle=o;const r=t.editHistory.reduce((n,{data:u})=>({x:n.x+u.x2-u.x1,y:n.y+u.y2-u.y1}),{x:0,y:0});e.beginPath(),c.forEach((n,u)=>{u===0?e.moveTo(n.x+r.x,n.y+r.y):e.lineTo(n.x+r.x,n.y+r.y)}),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.beginPath(),c.forEach((n,u)=>{u===0?e.moveTo(n.x+r.x,n.y+r.y):e.lineTo(n.x+r.x,n.y+r.y)}),e.stroke())}var Te="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Brush/index.tsx";function Mt(){const e=X(),[,t]=A(),[s,o]=I(),c=W(),[r,n]=Y(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=s==="Brush",g=i.useCallback(()=>{o.set("Brush"),t.set("default")},[o,t]),x=i.useCallback(()=>{m||(g(),n.clearSelect())},[m,g,n]),v=i.useCallback((d,b)=>{d.name==="Brush"&&(g(),f.current={type:B.Edit,data:{x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},n.select(d))},[g,n]),S=i.useCallback(d=>{if(!m||a.current||!c.current)return;const{left:b,top:y}=c.current.canvas.getBoundingClientRect();a.current={name:"Brush",type:B.Source,data:{size:u,color:l,points:[{x:d.clientX-b,y:d.clientY-y}]},editHistory:[],draw:Dt,isHit:ge}},[m,c,u,l]),C=i.useCallback(d=>{if(!(!m||!c.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,r.top!==f.current?(f.current.source.editHistory.push(f.current),n.push(f.current)):n.set(r);else if(a.current){const{left:b,top:y}=c.current.canvas.getBoundingClientRect();a.current.data.points.push({x:d.clientX-b,y:d.clientY-y}),r.top!==a.current?n.push(a.current):n.set(r)}}},[m,r,c,n]),z=i.useCallback(()=>{!m||(a.current&&n.clearSelect(),a.current=null,f.current=null)},[m,n]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_brush_title,icon:"icon-brush",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Te,lineNumber:166,columnNumber:15}}),__self:this,__source:{fileName:Te,lineNumber:161,columnNumber:5}})}function je(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===le.Move?(t+=n,s+=u,o+=n,c+=u):r.type===le.MoveStart?(t+=n,s+=u):r.type===le.MoveEnd&&(o+=n,c+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function $t(e,t){const{size:s,color:o,x1:c,x2:r,y1:n,y2:u}=je(t);e.lineCap="round",e.lineJoin="bevel",e.lineWidth=s,e.strokeStyle=o;const p=r-c,l=u-n,h=s*3,a=Math.atan2(l,p);e.beginPath(),e.moveTo(c,n),e.lineTo(r,u),e.lineTo(r-h*Math.cos(a-Math.PI/6),u-h*Math.sin(a-Math.PI/6)),e.moveTo(r,u),e.lineTo(r-h*Math.cos(a+Math.PI/6),u-h*Math.sin(a+Math.PI/6)),e.stroke(),t.isSelected&&(M(e,c,n),M(e,r,u))}var Ue="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Arrow/index.tsx",le;(function(e){e[e.Move=0]="Move",e[e.MoveStart=1]="MoveStart",e[e.MoveEnd=2]="MoveEnd"})(le||(le={}));function Lt(){const e=X(),[,t]=A(),[s,o]=I(),[c,r]=Y(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=s==="Arrow",g=i.useCallback(()=>{o.set("Arrow"),t.set("default")},[o,t]),x=i.useCallback(()=>{m||(g(),r.clearSelect())},[m,g,r]),v=i.useCallback((d,b)=>{if(d.name!=="Arrow"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=je(y);let k=0;$(n.current.canvas,b,{x:N,y:R})?k=1:$(n.current.canvas,b,{x:E,y:w})&&(k=2),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:y},r.select(d)},[n,g,r]),S=i.useCallback(d=>{if(!m||a.current||!n.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current={name:"Arrow",type:B.Source,data:{size:u,color:l,x1:d.clientX-b,y1:d.clientY-y,x2:d.clientX-b,y2:d.clientY-y},editHistory:[],draw:$t,isHit:ge}},[m,l,u,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,c.top!==f.current?(f.current.source.editHistory.push(f.current),r.push(f.current)):r.set(c);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current.data.x2=d.clientX-b,a.current.data.y2=d.clientY-y,c.top!==a.current?r.push(a.current):r.set(c)}}},[m,c,n,r]),z=i.useCallback(()=>{!m||(a.current&&r.clearSelect(),a.current=null,f.current=null)},[m,r]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_arrow_title,icon:"icon-arrow",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Ue,lineNumber:190,columnNumber:15}}),__self:this,__source:{fileName:Ue,lineNumber:185,columnNumber:5}})}function Ge(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===P.Move?(t+=n,s+=u,o+=n,c+=u):r.type===P.ResizeTop?s+=u:r.type===P.ResizeRightTop?(o+=n,s+=u):r.type===P.ResizeRight?o+=n:r.type===P.ResizeRightBottom?(o+=n,c+=u):r.type===P.ResizeBottom?c+=u:r.type===P.ResizeLeftBottom?(t+=n,c+=u):r.type===P.ResizeLeft?t+=n:r.type===P.ResizeLeftTop&&(t+=n,s+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function Ht(e,t){const{size:s,color:o,x1:c,y1:r,x2:n,y2:u}=Ge(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=s,e.strokeStyle=o;const p=(c+n)/2,l=(r+u)/2,h=Math.abs(n-c)/2,a=Math.abs(u-r)/2,f=.5522848,m=h*f,g=a*f;e.beginPath(),e.moveTo(p-h,l),e.bezierCurveTo(p-h,l-g,p-m,l-a,p,l-a),e.bezierCurveTo(p+m,l-a,p+h,l-g,p+h,l),e.bezierCurveTo(p+h,l+g,p+m,l+a,p,l+a),e.bezierCurveTo(p-m,l+a,p-h,l+g,p-h,l),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",e.beginPath(),e.moveTo(c,r),e.lineTo(n,r),e.lineTo(n,u),e.lineTo(c,u),e.closePath(),e.stroke(),M(e,(c+n)/2,r),M(e,n,r),M(e,n,(r+u)/2),M(e,n,u),M(e,(c+n)/2,u),M(e,c,u),M(e,c,(r+u)/2),M(e,c,r))}var Ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Ellipse/index.tsx",P;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(P||(P={}));function Xt(){const e=X(),[t,s]=Y(),[o,c]=I(),[,r]=A(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=o==="Ellipse",g=i.useCallback(()=>{c.set("Ellipse"),r.set("crosshair")},[c,r]),x=i.useCallback(()=>{m||(g(),s.clearSelect())},[m,g,s]),v=i.useCallback((d,b)=>{if(d.name!=="Ellipse"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=Ge(y);let k=0;$(n.current.canvas,b,{x:(N+E)/2,y:R})?k=1:$(n.current.canvas,b,{x:E,y:R})?k=2:$(n.current.canvas,b,{x:E,y:(R+w)/2})?k=3:$(n.current.canvas,b,{x:E,y:w})?k=4:$(n.current.canvas,b,{x:(N+E)/2,y:w})?k=5:$(n.current.canvas,b,{x:N,y:w})?k=6:$(n.current.canvas,b,{x:N,y:(R+w)/2})?k=7:$(n.current.canvas,b,{x:N,y:R})&&(k=8),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:y},s.select(d)},[n,g,s]),S=i.useCallback(d=>{if(!m||!n.current||a.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=d.clientX-b,R=d.clientY-y;a.current={name:"Ellipse",type:B.Source,data:{size:u,color:l,x1:N,y1:R,x2:N,y2:R},editHistory:[],draw:Ht,isHit:ge}},[m,u,l,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),s.push(f.current)):s.set(t);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect();a.current.data.x2=d.clientX-b,a.current.data.y2=d.clientY-y,t.top!==a.current?s.push(a.current):s.set(t)}}},[m,n,t,s]),z=i.useCallback(()=>{!m||(a.current&&s.clearSelect(),a.current=null,f.current=null)},[m,s]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_ellipse_title,icon:"icon-ellipse",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:Ae,lineNumber:242,columnNumber:15}}),__self:this,__source:{fileName:Ae,lineNumber:237,columnNumber:5}})}function Ie(e){let{x1:t,y1:s,x2:o,y2:c}=e.data;return e.editHistory.forEach(({data:r})=>{const n=r.x2-r.x1,u=r.y2-r.y1;r.type===T.Move?(t+=n,s+=u,o+=n,c+=u):r.type===T.ResizeTop?s+=u:r.type===T.ResizeRightTop?(o+=n,s+=u):r.type===T.ResizeRight?o+=n:r.type===T.ResizeRightBottom?(o+=n,c+=u):r.type===T.ResizeBottom?c+=u:r.type===T.ResizeLeftBottom?(t+=n,c+=u):r.type===T.ResizeLeft?t+=n:r.type===T.ResizeLeftTop&&(t+=n,s+=u)}),me(U({},e.data),{x1:t,x2:o,y1:s,y2:c})}function Yt(e,t){const{size:s,color:o,x1:c,y1:r,x2:n,y2:u}=Ie(t);e.lineCap="butt",e.lineJoin="miter",e.lineWidth=s,e.strokeStyle=o,e.beginPath(),e.moveTo(c,r),e.lineTo(n,r),e.lineTo(n,u),e.lineTo(c,u),e.closePath(),e.stroke(),t.isSelected&&(e.lineWidth=1,e.strokeStyle="#000000",e.fillStyle="#ffffff",M(e,(c+n)/2,r),M(e,n,r),M(e,n,(r+u)/2),M(e,n,u),M(e,(c+n)/2,u),M(e,c,u),M(e,c,(r+u)/2),M(e,c,r))}var We="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/operations/Rectangle/index.tsx",T;(function(e){e[e.Move=0]="Move",e[e.ResizeTop=1]="ResizeTop",e[e.ResizeRightTop=2]="ResizeRightTop",e[e.ResizeRight=3]="ResizeRight",e[e.ResizeRightBottom=4]="ResizeRightBottom",e[e.ResizeBottom=5]="ResizeBottom",e[e.ResizeLeftBottom=6]="ResizeLeftBottom",e[e.ResizeLeft=7]="ResizeLeft",e[e.ResizeLeftTop=8]="ResizeLeftTop"})(T||(T={}));function Ft(){const e=X(),[t,s]=Y(),[o,c]=I(),[,r]=A(),n=W(),[u,p]=i.useState(3),[l,h]=i.useState("#ee5126"),a=i.useRef(null),f=i.useRef(null),m=o==="Rectangle",g=i.useCallback(()=>{c.set("Rectangle"),r.set("crosshair")},[c,r]),x=i.useCallback(()=>{m||(g(),s.clearSelect())},[m,g,s]),v=i.useCallback((d,b)=>{if(d.name!=="Rectangle"||!n.current)return;const y=d;g();const{x1:N,y1:R,x2:E,y2:w}=Ie(y);let k=0;$(n.current.canvas,b,{x:(N+E)/2,y:R})?k=1:$(n.current.canvas,b,{x:E,y:R})?k=2:$(n.current.canvas,b,{x:E,y:(R+w)/2})?k=3:$(n.current.canvas,b,{x:E,y:w})?k=4:$(n.current.canvas,b,{x:(N+E)/2,y:w})?k=5:$(n.current.canvas,b,{x:N,y:w})?k=6:$(n.current.canvas,b,{x:N,y:(R+w)/2})?k=7:$(n.current.canvas,b,{x:N,y:R})&&(k=8),f.current={type:B.Edit,data:{type:k,x1:b.clientX,y1:b.clientY,x2:b.clientX,y2:b.clientY},source:d},s.select(d)},[n,g,s]),S=i.useCallback(d=>{if(!m||!n.current||a.current)return;const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=d.clientX-b,R=d.clientY-y;a.current={name:"Rectangle",type:B.Source,data:{size:u,color:l,x1:N,y1:R,x2:N,y2:R},editHistory:[],draw:Yt,isHit:ge}},[m,u,l,n]),C=i.useCallback(d=>{if(!(!m||!n.current)){if(f.current)f.current.data.x2=d.clientX,f.current.data.y2=d.clientY,t.top!==f.current?(f.current.source.editHistory.push(f.current),s.push(f.current)):s.set(t);else if(a.current){const{left:b,top:y}=n.current.canvas.getBoundingClientRect(),N=a.current.data;N.x2=d.clientX-b,N.y2=d.clientY-y,t.top!==a.current?s.push(a.current):s.set(t)}}},[m,n,t,s]),z=i.useCallback(()=>{!m||(a.current&&s.clearSelect(),a.current=null,f.current=null)},[m,s]);return ue(v),ee(S),te(C),ne(z),_.default.createElement(F,{title:e.operation_rectangle_title,icon:"icon-rectangle",checked:m,onClick:x,option:_.default.createElement(ie,{size:u,color:l,onSizeChange:p,onColorChange:h,__self:this,__source:{fileName:We,lineNumber:242,columnNumber:15}}),__self:this,__source:{fileName:We,lineNumber:237,columnNumber:5}})}var Pt=[Ft,Xt,Lt,Mt,Bt,xt,"|",_t,bt,"|",dt,ht,at];var ae="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/ScreenshotsOperations/index.tsx";const Oe=_.default.createContext(null);function Tt(){const{width:e,height:t}=H(),[s]=G(),[o,c]=i.useState(null),[r,n]=i.useState(null),u=i.useRef(null),p=i.useCallback(h=>{h.stopPropagation()},[]),l=i.useCallback(h=>{h.preventDefault(),h.stopPropagation()},[]);return i.useEffect(()=>{if(!s||!u.current)return;const h=u.current.getBoundingClientRect();let a=s.x+s.width-h.width,f=s.y+s.height+10;a<0&&(a=0),a>e-h.width&&(a=e-h.width),f>t-h.height&&(f=t-h.height-10),((r==null?void 0:r.x)!==a||r.y!==f)&&n({x:a,y:f}),((o==null?void 0:o.x)!==h.x||o.y!==h.y||o.width!==h.width||o.height!==h.height)&&c({x:h.x,y:h.y,width:h.width,height:h.height})}),s?_.default.createElement(Oe.Provider,{value:o,__self:this,__source:{fileName:ae,lineNumber:76,columnNumber:5}},_.default.createElement("div",{ref:u,className:"screenshots-operations",style:{visibility:r?"visible":"hidden",left:r==null?void 0:r.x,top:r==null?void 0:r.y},onDoubleClick:p,onContextMenu:l,__self:this,__source:{fileName:ae,lineNumber:77,columnNumber:7}},_.default.createElement("div",{className:"screenshots-operations-buttons",__self:this,__source:{fileName:ae,lineNumber:88,columnNumber:9}},Pt.map((h,a)=>h==="|"?_.default.createElement("div",{key:a,className:"screenshots-operations-divider",__self:this,__source:{fileName:ae,lineNumber:91,columnNumber:22}}):_.default.createElement(h,{key:a,__self:this,__source:{fileName:ae,lineNumber:93,columnNumber:22}}))))):null}function jt(e){const[t,s]=i.useState(null);return i.useEffect(()=>{if(e==null)return;const o=document.createElement("img"),c=()=>s(o),r=()=>s(null);return o.addEventListener("load",c),o.addEventListener("error",r),o.src=e,()=>{o.removeEventListener("load",c),o.removeEventListener("error",r)}},[e]),t}var fe="/Users/nashaofu/Documents/GitHub/screenshots/packages/react-screenshots/src/Screenshots/index.tsx";function Ut(n){var u=n,{url:e,width:t,height:s,lang:o,className:c}=u,r=Me(u,["url","width","height","lang","className"]);const p=jt(e),l=i.useRef(null),h=i.useRef({}),[a,f]=i.useState({index:-1,stack:[]}),[m,g]=i.useState(null),[x,v]=i.useState("move"),[S,C]=i.useState(void 0),z={url:e,width:t,height:s,image:p,lang:U(U({},Le),o),emiterRef:h,canvasContextRef:l,history:a,bounds:m,cursor:x,operation:S},d=i.useCallback((w,...k)=>{const V=r[w];typeof V=="function"&&V(...k)},[r]),b={call:d,setHistory:f,setBounds:g,setCursor:v,setOperation:C},y=["screenshots"];c&&y.push(c);const N=()=>{h.current={},f({index:-1,stack:[]}),g(null),v("move"),C(void 0)},R=i.useCallback(w=>{w.button!==0||!m||!l.current||l.current.canvas.toBlob(k=>{d("onOk",k,m),N()},"image/png")},[m,d]),E=i.useCallback(w=>{w.button===2&&(w.preventDefault(),d("onCancel"),N())},[d]);return _.default.createElement(xe.Provider,{value:{store:z,dispatcher:b},__self:this,__source:{fileName:fe,lineNumber:111,columnNumber:5}},_.default.createElement("div",{className:y.join(" "),style:{width:t,height:s},onDoubleClick:R,onContextMenu:E,__self:this,__source:{fileName:fe,lineNumber:112,columnNumber:7}},_.default.createElement(tt,{__self:this,__source:{fileName:fe,lineNumber:118,columnNumber:9}}),_.default.createElement(it,{ref:l,__self:this,__source:{fileName:fe,lineNumber:119,columnNumber:9}}),_.default.createElement(Tt,{__self:this,__source:{fileName:fe,lineNumber:120,columnNumber:9}})))}module.exports=Ut;
|
|
@@ -329,9 +329,6 @@ function ScreenshotsBackground() {
|
|
|
329
329
|
return /* @__PURE__ */ React.createElement("div", {
|
|
330
330
|
ref: elRef,
|
|
331
331
|
className: "screenshots-background",
|
|
332
|
-
style: {
|
|
333
|
-
backgroundImage: `url("${url}")`
|
|
334
|
-
},
|
|
335
332
|
onMouseDown,
|
|
336
333
|
__self: this,
|
|
337
334
|
__source: {
|
|
@@ -339,12 +336,21 @@ function ScreenshotsBackground() {
|
|
|
339
336
|
lineNumber: 104,
|
|
340
337
|
columnNumber: 5
|
|
341
338
|
}
|
|
342
|
-
}, /* @__PURE__ */ React.createElement("
|
|
339
|
+
}, /* @__PURE__ */ React.createElement("img", {
|
|
340
|
+
className: "screenshots-background-image",
|
|
341
|
+
src: url,
|
|
342
|
+
__self: this,
|
|
343
|
+
__source: {
|
|
344
|
+
fileName: _jsxFileName$k,
|
|
345
|
+
lineNumber: 109,
|
|
346
|
+
columnNumber: 7
|
|
347
|
+
}
|
|
348
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
343
349
|
className: "screenshots-background-mask",
|
|
344
350
|
__self: this,
|
|
345
351
|
__source: {
|
|
346
352
|
fileName: _jsxFileName$k,
|
|
347
|
-
lineNumber:
|
|
353
|
+
lineNumber: 110,
|
|
348
354
|
columnNumber: 7
|
|
349
355
|
}
|
|
350
356
|
}), position && !bounds && /* @__PURE__ */ React.createElement(ScreenshotsMagnifier, {
|
|
@@ -353,7 +359,7 @@ function ScreenshotsBackground() {
|
|
|
353
359
|
__self: this,
|
|
354
360
|
__source: {
|
|
355
361
|
fileName: _jsxFileName$k,
|
|
356
|
-
lineNumber:
|
|
362
|
+
lineNumber: 111,
|
|
357
363
|
columnNumber: 31
|
|
358
364
|
}
|
|
359
365
|
}));
|
|
@@ -697,7 +703,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
697
703
|
const ry = image.naturalHeight / height;
|
|
698
704
|
const ctx = ctxRef.current;
|
|
699
705
|
ctx.imageSmoothingEnabled = true;
|
|
700
|
-
ctx.imageSmoothingQuality = "
|
|
706
|
+
ctx.imageSmoothingQuality = "low";
|
|
701
707
|
ctx.setTransform(dpr$1, 0, 0, dpr$1, 0, 0);
|
|
702
708
|
ctx.clearRect(0, 0, bounds.width, bounds.height);
|
|
703
709
|
ctx.drawImage(image, bounds.x * rx, bounds.y * ry, bounds.width * rx, bounds.height * ry, 0, 0, bounds.width, bounds.height);
|
|
@@ -795,7 +801,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
795
801
|
__self: this,
|
|
796
802
|
__source: {
|
|
797
803
|
fileName: _jsxFileName$j,
|
|
798
|
-
lineNumber:
|
|
804
|
+
lineNumber: 191,
|
|
799
805
|
columnNumber: 5
|
|
800
806
|
}
|
|
801
807
|
}, /* @__PURE__ */ React.createElement("canvas", {
|
|
@@ -809,7 +815,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
809
815
|
__self: this,
|
|
810
816
|
__source: {
|
|
811
817
|
fileName: _jsxFileName$j,
|
|
812
|
-
lineNumber:
|
|
818
|
+
lineNumber: 200,
|
|
813
819
|
columnNumber: 7
|
|
814
820
|
}
|
|
815
821
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
@@ -821,7 +827,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
821
827
|
__self: this,
|
|
822
828
|
__source: {
|
|
823
829
|
fileName: _jsxFileName$j,
|
|
824
|
-
lineNumber:
|
|
830
|
+
lineNumber: 209,
|
|
825
831
|
columnNumber: 7
|
|
826
832
|
}
|
|
827
833
|
}), borders.map((border) => {
|
|
@@ -831,7 +837,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
831
837
|
__self: this,
|
|
832
838
|
__source: {
|
|
833
839
|
fileName: _jsxFileName$j,
|
|
834
|
-
lineNumber:
|
|
840
|
+
lineNumber: 217,
|
|
835
841
|
columnNumber: 16
|
|
836
842
|
}
|
|
837
843
|
});
|
|
@@ -843,7 +849,7 @@ var ScreenshotsCanvas = forwardRef(function ScreenshotsCanvas2(props, ref) {
|
|
|
843
849
|
__self: this,
|
|
844
850
|
__source: {
|
|
845
851
|
fileName: _jsxFileName$j,
|
|
846
|
-
lineNumber:
|
|
852
|
+
lineNumber: 221,
|
|
847
853
|
columnNumber: 11
|
|
848
854
|
}
|
|
849
855
|
});
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.screenshots-magnifier{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;left:0;top:0;width:100px;box-shadow:0 0 8px #000;z-index:9}.screenshots-magnifier,.screenshots-magnifier *{box-sizing:border-box;user-select:none}.screenshots-magnifier-body{position:relative;background-color:#fff}.screenshots-magnifier-body:before{content:"";background-color:#0a72a1;position:absolute;top:50%;left:0;width:100%;height:2px;z-index:1}.screenshots-magnifier-body:after{content:"";background-color:#0a72a1;position:absolute;top:0;left:50%;width:2px;height:100%;z-index:1}.screenshots-magnifier-body-canvas{display:block;width:100px;height:80px}.screenshots-magnifier-footer{height:40px;color:#fff;font-size:11px;background-color:#5f5e5e;padding:4px;white-space:nowrap;overflow:hidden;text-align:center}.screenshots-magnifier-footer-item{height:18px;line-height:18px}.screenshots-background{width:100%;height:100%;position:relative;background-size:100% 100%;background-position:0 0;background-repeat:no-repeat}.screenshots-background-mask{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#ffffff1a}.screenshots-canvas{position:absolute}.screenshots-canvas-body{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.screenshots-canvas-border-top{position:absolute;left:0;top:0;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-right{position:absolute;left:100%;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-bottom{position:absolute;left:0;top:100%;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-left{position:absolute;left:0;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-point-top{width:8px;height:8px;position:absolute;left:50%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-top-right{width:8px;height:8px;position:absolute;left:100%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-right{width:8px;height:8px;position:absolute;left:100%;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-right-bottom{width:8px;height:8px;position:absolute;left:100%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-canvas-point-bottom{width:8px;height:8px;position:absolute;left:50%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-bottom-left{width:8px;height:8px;position:absolute;left:0;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-left{width:8px;height:8px;position:absolute;left:0;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-left-top{width:8px;height:8px;position:absolute;left:0;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-option{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots-option,.screenshots-option *{box-sizing:border-box;user-select:none}.screenshots-option-container{height:34px;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff}.screenshots-option-arrow{position:absolute;border:6px solid transparent}.screenshots-option[data-placement=top]{transform:translate(-50%,-11px)}.screenshots-option[data-placement=top] .screenshots-option-arrow{transform:translate(-50%,-1px);border-top-color:#fff;top:100%;left:50%}.screenshots-option[data-placement=bottom]{transform:translate(-50%,11px)}.screenshots-option[data-placement=bottom] .screenshots-option-arrow{transform:translate(-50%,1px);border-bottom-color:#fff;bottom:100%;left:50%}.screenshots-button{width:26px;height:26px;line-height:26px;color:#555;font-size:18px;text-align:center;margin:0 3px;vertical-align:middle;cursor:pointer}.screenshots-button-checked,.screenshots-button:hover{background-color:#eee;outline:1px solid #777}.screenshots-button-disabled{color:#ccc;cursor:not-allowed}.screenshots-button-disabled:hover{background-color:#fff;outline:none}.screenshots-size{height:24px;display:flex;align-items:center}.screenshots-size-item{width:24px;height:24px;position:relative;margin:0 3px;cursor:pointer}.screenshots-size-pointer{background-color:#555;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.screenshots-size-active>.screenshots-size-pointer{background-color:#39f}.screenshots-color{height:24px;display:flex;align-items:center}.screenshots-color-item{border:1px solid #777;width:24px;height:24px;cursor:pointer;position:relative;margin:0 3px}.screenshots-color-item:before{content:"";display:none;position:absolute;right:0;bottom:0;width:10px;height:10px;background-color:#333}.screenshots-color-item:after{content:"";display:none;width:8px;height:4px;position:absolute;right:5px;bottom:5px;border-bottom:2px solid #fff;border-left:2px solid #fff;transform:translate(5px,2px) rotate(-45deg) scale(.8)}.screenshots-color-active:before,.screenshots-color-active:after{display:block}.screenshots-sizecolor{height:24px;display:flex;align-items:center}.screenshots-textarea{box-sizing:border-box;position:absolute;margin:0;padding:0;background-color:transparent;border:2px solid #39f;resize:none;outline:none;white-space:nowrap;word-break:break-all;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;text-align:left}.screenshots-operations{position:absolute}.screenshots-operations-buttons{display:flex;align-items:center;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff;overflow:hidden}.screenshots-operations-divider{background-color:#ddd;width:1px;height:26px;margin:0 3px}@font-face{font-family:screenshots-icon;src:url(data:font/woff2;base64,d09GMgABAAAAAAZYAAsAAAAADKgAAAYKAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDfAqKLIhJATYCJAMwCxoABCAFhUcHgQAb6QrILjGFawcSSCzDZuiIqeA+75Tu1r4heP5fp96nLxkkOwhUmIBwakdUSggj8dSRyDmdmP3/v2e9YsjsOCtlpI68YLtQmt4kZXqSN+LXCmO2C/Fv90v4tUEmt3UrwUwiDCzhRBNKIS+VhIsbwuYpUwbcwRfO/tJ+v6reiDo8hHD/+7ZDTbM3TUTr9w71RhJrhE6IEQ3Y1a4XkvASBDApIh15W/6CFchzGo0tKBgl3FoBs6dM03M0cr5nooeECq4UR9wrdWQNBmhLtTvAavXv5Q0l4gwahoK7T68JeTp02cdnKdtvg3qKvAYBR2uAASggr2bZMim8cAwKvTEPBaZfoZIK0usI+Cz/f/CJbKn35WDiRkPHQOHCasE/nhPEAcceeG5ossAnYhJM8GlJcINPEW6pg1ClAQLSASKedCIdF2yw5C3dSEcgTRBppAUEjjpdEQUiHCTrQDPhAoaRL2jEorpr/QUVkzRNSepUlpwcEID3D4sjwt1DpnpsO4o0e8vw1tFOQoGbT9p6iXL30WON9mrXrRsQ9gbXgGWbZNK5ydUeecktcPmVx2xq2UZo2hoD01uX+a9oHpWpTYeC6zX7QKDarVI12wHVbshETJ4QzRYLAsXyMQU9ThxwwX6sOUg3k23dOo643Xa3Hx9vQ0sbc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AAoAKwBlAAEAAAAAAAsAEwCQAAMAAQQJAAAAJgCjAAMAAQQJAAEAIADJAAMAAQQJAAIADgDpAAMAAQQJAAMAIAD3AAMAAQQJAAQAIAEXAAMAAQQJAAUAFgE3AAMAAQQJAAYAIAFNAAMAAQQJAAoAVgFtAAMAAQQJAAsAJgHDQ3JlYXRlZCBieSBpY29uZm9udHNjcmVlbnNob3RzLWljb25SZWd1bGFyc2NyZWVuc2hvdHMtaWNvbnNjcmVlbnNob3RzLWljb25WZXJzaW9uIDEuMHNjcmVlbnNob3RzLWljb25HZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuaHR0cDovL2ZvbnRlbGxvLmNvbQBDAHIAZQBhAHQAZQBkACAAYgB5ACAAaQBjAG8AbgBmAG8AbgB0AHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4AUgBlAGcAdQBsAGEAcgBzAGMAcgBlAGUAbgBzAGgAbwB0AHMALQBpAGMAbwBuAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4ARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0ABWFycm93BHNhdmUGbW9zYWljBHJlZG8EdW5kbwdlbGxpcHNlCXJlY3RhbmdsZQR0ZXh0BmNhbmNlbAJvawVicnVzaAAA) format("truetype")}[class^=icon-],[class*=" icon-"]{font-family:screenshots-icon!important;font-style:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-ok:before{content:"\e001"}.icon-cancel:before{content:"\e002"}.icon-save:before{content:"\e003"}.icon-redo:before{content:"\e004"}.icon-undo:before{content:"\e005"}.icon-mosaic:before{content:"\e006"}.icon-text:before{content:"\e007"}.icon-brush:before{content:"\e008"}.icon-arrow:before{content:"\e009"}.icon-ellipse:before{content:"\e00a"}.icon-rectangle:before{content:"\e00b"}.screenshots{position:relative;transform:translateZ(0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots,.screenshots *{box-sizing:border-box;user-select:none}
|
|
1
|
+
.screenshots-magnifier{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;left:0;top:0;width:100px;box-shadow:0 0 8px #000;z-index:9}.screenshots-magnifier,.screenshots-magnifier *{box-sizing:border-box;user-select:none}.screenshots-magnifier-body{position:relative;background-color:#fff}.screenshots-magnifier-body:before{content:"";background-color:#0a72a1;position:absolute;top:50%;left:0;width:100%;height:2px;z-index:1}.screenshots-magnifier-body:after{content:"";background-color:#0a72a1;position:absolute;top:0;left:50%;width:2px;height:100%;z-index:1}.screenshots-magnifier-body-canvas{display:block;width:100px;height:80px}.screenshots-magnifier-footer{height:40px;color:#fff;font-size:11px;background-color:#5f5e5e;padding:4px;white-space:nowrap;overflow:hidden;text-align:center}.screenshots-magnifier-footer-item{height:18px;line-height:18px}.screenshots-background{width:100%;height:100%;position:relative}.screenshots-background-image{width:100%;height:100%;display:block;border:none;outline:none;image-rendering:-webkit-optimize-contrast;image-rendering:crisp-edges;-webkit-font-smooting:antialiased}.screenshots-background-mask{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#ffffff1a}.screenshots-canvas{position:absolute}.screenshots-canvas-body{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.screenshots-canvas-border-top{position:absolute;left:0;top:0;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-right{position:absolute;left:100%;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-bottom{position:absolute;left:0;top:100%;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-left{position:absolute;left:0;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-point-top{width:8px;height:8px;position:absolute;left:50%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-top-right{width:8px;height:8px;position:absolute;left:100%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-right{width:8px;height:8px;position:absolute;left:100%;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-right-bottom{width:8px;height:8px;position:absolute;left:100%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-canvas-point-bottom{width:8px;height:8px;position:absolute;left:50%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-bottom-left{width:8px;height:8px;position:absolute;left:0;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-left{width:8px;height:8px;position:absolute;left:0;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-left-top{width:8px;height:8px;position:absolute;left:0;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-option{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots-option,.screenshots-option *{box-sizing:border-box;user-select:none}.screenshots-option-container{height:34px;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff}.screenshots-option-arrow{position:absolute;border:6px solid transparent}.screenshots-option[data-placement=top]{transform:translate(-50%,-11px)}.screenshots-option[data-placement=top] .screenshots-option-arrow{transform:translate(-50%,-1px);border-top-color:#fff;top:100%;left:50%}.screenshots-option[data-placement=bottom]{transform:translate(-50%,11px)}.screenshots-option[data-placement=bottom] .screenshots-option-arrow{transform:translate(-50%,1px);border-bottom-color:#fff;bottom:100%;left:50%}.screenshots-button{width:26px;height:26px;line-height:26px;color:#555;font-size:18px;text-align:center;margin:0 3px;vertical-align:middle;cursor:pointer}.screenshots-button-checked,.screenshots-button:hover{background-color:#eee;outline:1px solid #777}.screenshots-button-disabled{color:#ccc;cursor:not-allowed}.screenshots-button-disabled:hover{background-color:#fff;outline:none}.screenshots-size{height:24px;display:flex;align-items:center}.screenshots-size-item{width:24px;height:24px;position:relative;margin:0 3px;cursor:pointer}.screenshots-size-pointer{background-color:#555;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.screenshots-size-active>.screenshots-size-pointer{background-color:#39f}.screenshots-color{height:24px;display:flex;align-items:center}.screenshots-color-item{border:1px solid #777;width:24px;height:24px;cursor:pointer;position:relative;margin:0 3px}.screenshots-color-item:before{content:"";display:none;position:absolute;right:0;bottom:0;width:10px;height:10px;background-color:#333}.screenshots-color-item:after{content:"";display:none;width:8px;height:4px;position:absolute;right:5px;bottom:5px;border-bottom:2px solid #fff;border-left:2px solid #fff;transform:translate(5px,2px) rotate(-45deg) scale(.8)}.screenshots-color-active:before,.screenshots-color-active:after{display:block}.screenshots-sizecolor{height:24px;display:flex;align-items:center}.screenshots-textarea{box-sizing:border-box;position:absolute;margin:0;padding:0;background-color:transparent;border:2px solid #39f;resize:none;outline:none;white-space:nowrap;word-break:break-all;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;text-align:left}.screenshots-operations{position:absolute}.screenshots-operations-buttons{display:flex;align-items:center;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff;overflow:hidden}.screenshots-operations-divider{background-color:#ddd;width:1px;height:26px;margin:0 3px}@font-face{font-family:screenshots-icon;src:url(data:font/woff2;base64,d09GMgABAAAAAAZYAAsAAAAADKgAAAYKAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDfAqKLIhJATYCJAMwCxoABCAFhUcHgQAb6QrILjGFawcSSCzDZuiIqeA+75Tu1r4heP5fp96nLxkkOwhUmIBwakdUSggj8dSRyDmdmP3/v2e9YsjsOCtlpI68YLtQmt4kZXqSN+LXCmO2C/Fv90v4tUEmt3UrwUwiDCzhRBNKIS+VhIsbwuYpUwbcwRfO/tJ+v6reiDo8hHD/+7ZDTbM3TUTr9w71RhJrhE6IEQ3Y1a4XkvASBDApIh15W/6CFchzGo0tKBgl3FoBs6dM03M0cr5nooeECq4UR9wrdWQNBmhLtTvAavXv5Q0l4gwahoK7T68JeTp02cdnKdtvg3qKvAYBR2uAASggr2bZMim8cAwKvTEPBaZfoZIK0usI+Cz/f/CJbKn35WDiRkPHQOHCasE/nhPEAcceeG5ossAnYhJM8GlJcINPEW6pg1ClAQLSASKedCIdF2yw5C3dSEcgTRBppAUEjjpdEQUiHCTrQDPhAoaRL2jEorpr/QUVkzRNSepUlpwcEID3D4sjwt1DpnpsO4o0e8vw1tFOQoGbT9p6iXL30WON9mrXrRsQ9gbXgGWbZNK5ydUeecktcPmVx2xq2UZo2hoD01uX+a9oHpWpTYeC6zX7QKDarVI12wHVbshETJ4QzRYLAsXyMQU9ThxwwX6sOUg3k23dOo643Xa3Hx9vQ0sbcX/gffrTcHSE4Noa10LLmF0mD/rfY5wbUSC7PwAiskYaj2311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AAQQJAAEAIADJAAMAAQQJAAIADgDpAAMAAQQJAAMAIAD3AAMAAQQJAAQAIAEXAAMAAQQJAAUAFgE3AAMAAQQJAAYAIAFNAAMAAQQJAAoAVgFtAAMAAQQJAAsAJgHDQ3JlYXRlZCBieSBpY29uZm9udHNjcmVlbnNob3RzLWljb25SZWd1bGFyc2NyZWVuc2hvdHMtaWNvbnNjcmVlbnNob3RzLWljb25WZXJzaW9uIDEuMHNjcmVlbnNob3RzLWljb25HZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuaHR0cDovL2ZvbnRlbGxvLmNvbQBDAHIAZQBhAHQAZQBkACAAYgB5ACAAaQBjAG8AbgBmAG8AbgB0AHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4AUgBlAGcAdQBsAGEAcgBzAGMAcgBlAGUAbgBzAGgAbwB0AHMALQBpAGMAbwBuAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAHMAYwByAGUAZQBuAHMAaABvAHQAcwAtAGkAYwBvAG4ARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0ABWFycm93BHNhdmUGbW9zYWljBHJlZG8EdW5kbwdlbGxpcHNlCXJlY3RhbmdsZQR0ZXh0BmNhbmNlbAJvawVicnVzaAAA) format("truetype")}[class^=icon-],[class*=" icon-"]{font-family:screenshots-icon!important;font-style:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-ok:before{content:"\e001"}.icon-cancel:before{content:"\e002"}.icon-save:before{content:"\e003"}.icon-redo:before{content:"\e004"}.icon-undo:before{content:"\e005"}.icon-mosaic:before{content:"\e006"}.icon-text:before{content:"\e007"}.icon-brush:before{content:"\e008"}.icon-arrow:before{content:"\e009"}.icon-ellipse:before{content:"\e00a"}.icon-rectangle:before{content:"\e00b"}.screenshots{position:relative;transform:translateZ(0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots,.screenshots *{box-sizing:border-box;user-select:none}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-screenshots",
|
|
3
|
-
"version": "0.3
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "a screenshot cropper tool by react",
|
|
5
5
|
"main": "./lib/react-screenshots.cjs.js",
|
|
6
6
|
"module": "./lib/react-screenshots.es.js",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"typescript": "^4.5.5",
|
|
65
65
|
"vite": "^2.7.13"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3e638210e66eb121fee66fa5dd3263cfd5245a9b"
|
|
68
68
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.screenshots-magnifier{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;left:0;top:0;width:100px;box-shadow:0 0 8px #000;z-index:9}.screenshots-magnifier,.screenshots-magnifier *{box-sizing:border-box;user-select:none}.screenshots-magnifier-body{position:relative;background-color:#fff}.screenshots-magnifier-body:before{content:"";background-color:#0a72a1;position:absolute;top:50%;left:0;width:100%;height:2px;z-index:1}.screenshots-magnifier-body:after{content:"";background-color:#0a72a1;position:absolute;top:0;left:50%;width:2px;height:100%;z-index:1}.screenshots-magnifier-body-canvas{display:block;width:100px;height:80px}.screenshots-magnifier-footer{height:40px;color:#fff;font-size:11px;background-color:#5f5e5e;padding:4px;white-space:nowrap;overflow:hidden;text-align:center}.screenshots-magnifier-footer-item{height:18px;line-height:18px}.screenshots-background{width:100%;height:100%;position:relative;background-size:100% 100%;background-position:0 0;background-repeat:no-repeat}.screenshots-background-mask{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#ffffff1a}.screenshots-canvas{position:absolute}.screenshots-canvas-body{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.screenshots-canvas-border-top{position:absolute;left:0;top:0;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-right{position:absolute;left:100%;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-bottom{position:absolute;left:0;top:100%;width:100%;height:2px;transform:translateY(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-border-left{position:absolute;left:0;top:0;width:2px;height:100%;transform:translate(-50%);background-color:#39f;pointer-events:none}.screenshots-canvas-point-top{width:8px;height:8px;position:absolute;left:50%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-top-right{width:8px;height:8px;position:absolute;left:100%;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-right{width:8px;height:8px;position:absolute;left:100%;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-right-bottom{width:8px;height:8px;position:absolute;left:100%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-canvas-point-bottom{width:8px;height:8px;position:absolute;left:50%;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ns-resize}.screenshots-canvas-point-bottom-left{width:8px;height:8px;position:absolute;left:0;top:100%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nesw-resize}.screenshots-canvas-point-left{width:8px;height:8px;position:absolute;left:0;top:50%;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:ew-resize}.screenshots-canvas-point-left-top{width:8px;height:8px;position:absolute;left:0;top:0;background-color:#39f;border-radius:50%;transform:translate(-50%,-50%);cursor:nwse-resize}.screenshots-option{position:absolute;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots-option,.screenshots-option *{box-sizing:border-box;user-select:none}.screenshots-option-container{height:34px;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff}.screenshots-option-arrow{position:absolute;border:6px solid transparent}.screenshots-option[data-placement=top]{transform:translate(-50%,-11px)}.screenshots-option[data-placement=top] .screenshots-option-arrow{transform:translate(-50%,-1px);border-top-color:#fff;top:100%;left:50%}.screenshots-option[data-placement=bottom]{transform:translate(-50%,11px)}.screenshots-option[data-placement=bottom] .screenshots-option-arrow{transform:translate(-50%,1px);border-bottom-color:#fff;bottom:100%;left:50%}.screenshots-button{width:26px;height:26px;line-height:26px;color:#555;font-size:18px;text-align:center;margin:0 3px;vertical-align:middle;cursor:pointer}.screenshots-button-checked,.screenshots-button:hover{background-color:#eee;outline:1px solid #777}.screenshots-button-disabled{color:#ccc;cursor:not-allowed}.screenshots-button-disabled:hover{background-color:#fff;outline:none}.screenshots-size{height:24px;display:flex;align-items:center}.screenshots-size-item{width:24px;height:24px;position:relative;margin:0 3px;cursor:pointer}.screenshots-size-pointer{background-color:#555;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.screenshots-size-active>.screenshots-size-pointer{background-color:#39f}.screenshots-color{height:24px;display:flex;align-items:center}.screenshots-color-item{border:1px solid #777;width:24px;height:24px;cursor:pointer;position:relative;margin:0 3px}.screenshots-color-item:before{content:"";display:none;position:absolute;right:0;bottom:0;width:10px;height:10px;background-color:#333}.screenshots-color-item:after{content:"";display:none;width:8px;height:4px;position:absolute;right:5px;bottom:5px;border-bottom:2px solid #fff;border-left:2px solid #fff;transform:translate(5px,2px) rotate(-45deg) scale(.8)}.screenshots-color-active:before,.screenshots-color-active:after{display:block}.screenshots-sizecolor{height:24px;display:flex;align-items:center}.screenshots-textarea{box-sizing:border-box;position:absolute;margin:0;padding:0;background-color:transparent;border:2px solid #39f;resize:none;outline:none;white-space:nowrap;word-break:break-all;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji;text-align:left}.screenshots-operations{position:absolute}.screenshots-operations-buttons{display:flex;align-items:center;padding:3px;border-radius:2px;border:1px solid #ddd;background-color:#fff;overflow:hidden}.screenshots-operations-divider{background-color:#ddd;width:1px;height:26px;margin:0 3px}@font-face{font-family:screenshots-icon;src:url(data:font/woff2;base64,d09GMgABAAAAAAZYAAsAAAAADKgAAAYKAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDfAqKLIhJATYCJAMwCxoABCAFhUcHgQAb6QrILjGFawcSSCzDZuiIqeA+75Tu1r4heP5fp96nLxkkOwhUmIBwakdUSggj8dSRyDmdmP3/v2e9YsjsOCtlpI68YLtQmt4kZXqSN+LXCmO2C/Fv90v4tUEmt3UrwUwiDCzhRBNKIS+VhIsbwuYpUwbcwRfO/tJ+v6reiDo8hHD/+7ZDTbM3TUTr9w71RhJrhE6IEQ3Y1a4XkvASBDApIh15W/6CFchzGo0tKBgl3FoBs6dM03M0cr5nooeECq4UR9wrdWQNBmhLtTvAavXv5Q0l4gwahoK7T68JeTp02cdnKdtvg3qKvAYBR2uAASggr2bZMim8cAwKvTEPBaZfoZIK0usI+Cz/f/CJbKn35WDiRkPHQOHCasE/nhPEAcceeG5ossAnYhJM8GlJcINPEW6pg1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AAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0ABWFycm93BHNhdmUGbW9zYWljBHJlZG8EdW5kbwdlbGxpcHNlCXJlY3RhbmdsZQR0ZXh0BmNhbmNlbAJvawVicnVzaAAA) format("truetype")}[class^=icon-],[class*=" icon-"]{font-family:screenshots-icon!important;font-style:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-ok:before{content:"\e001"}.icon-cancel:before{content:"\e002"}.icon-save:before{content:"\e003"}.icon-redo:before{content:"\e004"}.icon-undo:before{content:"\e005"}.icon-mosaic:before{content:"\e006"}.icon-text:before{content:"\e007"}.icon-brush:before{content:"\e008"}.icon-arrow:before{content:"\e009"}.icon-ellipse:before{content:"\e00a"}.icon-rectangle:before{content:"\e00b"}.screenshots{position:relative;transform:translateZ(0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,apple color emoji,segoe ui emoji,Segoe UI Symbol,noto color emoji}.screenshots,.screenshots *{box-sizing:border-box;user-select:none}html,body,#app{height:100%;margin:0;padding:0;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.body{height:100%}
|