-1,b=v.isContentEditable;if(m||b){if(c||p===v)return!1;if(p&&b&&p.isContentEditable&&p.contains(v))return!1}else if((l||"touchstart"===e.type)&&p){var w=p.tagName;(p.isContentEditable||g.indexOf(w)>-1)&&p.blur()}if(r.clientStores=[new h(u(e))],r.flag=!0,r.isDrag=!1,r.datas={},A&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(i.N)()-r.prevTime<200,!1===r.emit("dragStart",s({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&l&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(i.q)(o,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=u(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",s({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.P)(o,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),A=Object(i.N)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:A,r.emit("dragEnd",s({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=s({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,A=a.container,l=a.events,c=a.checkWindowBlur;if(r.isTouch=l.indexOf("touch")>-1,r.isMouse=l.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.q)(e,"mousedown",r.onDragStart)})),Object(i.q)(A,"mousemove",r.onDrag),Object(i.q)(A,"mouseup",r.onDragEnd),Object(i.q)(A,"contextmenu",r.onDragEnd)),c&&Object(i.q)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.q)(e,"touchstart",r.onDragStart,f)})),Object(i.q)(A,"touchmove",r.onDrag,f),Object(i.q)(A,"touchend",r.onDragEnd,f),Object(i.q)(A,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.P)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.P)(t,"mousedown",e.onDragStart)})),Object(i.P)(n,"mousemove",this.onDrag),Object(i.P)(n,"mouseup",this.onDragEnd),Object(i.P)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.P)(t,"touchstart",e.onDragStart)})),Object(i.P)(n,"touchstart",this.onDragStart),Object(i.P)(n,"touchmove",this.onDrag),Object(i.P)(n,"touchend",this.onDragEnd),Object(i.P)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new h(u(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",s({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",s({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",s({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,s({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(a);var B=n(28),m=n(15),b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e){var t=e.container;return[t.scrollLeft,t.scrollTop]}var E=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.startRect=null,t.startPos=[],t.prevTime=0,t.timer=0,t}!function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.dragStart=function(e,t){var n=t.container.getBoundingClientRect(),r=n.top,i=n.left,o=n.width,a=n.height;this.startPos=[e.clientX,e.clientY],this.startRect={top:r,left:i,width:o,height:a}},n.drag=function(e,t){var n=this,r=e.clientX,o=e.clientY,a=t.container,A=t.threshold,s=void 0===A?0:A,l=t.throttleTime,u=void 0===l?0:l,c=t.getScrollPosition,f=void 0===c?w:c,d=this.startRect,p=this.startPos,h=Object(i.N)(),g=Math.max(u+this.prevTime-h,0),v=[0,0];if(d.top>o-s?(p[1]>d.top||op[1])&&(v[1]=1),d.left>r-s?(p[0]>d.left||r
p[0])&&(v[0]=1),clearTimeout(this.timer),!v[0]&&!v[1])return!1;if(g>0)return this.timer=window.setTimeout((function(){n.drag(e,t)}),g),!1;this.prevTime=h;var B=f({container:a,direction:v});this.trigger("scroll",{container:a,direction:v,inputEvent:e});var m=f({container:a,direction:v}),b=m[0]-B[0],E=m[1]-B[1];return!(!b&&!E)&&(this.trigger("move",{offsetX:v[0]?b:0,offsetY:v[1]?E:0,inputEvent:e}),u&&(this.timer=window.setTimeout((function(){n.drag(e,t)}),u)),!0)},n.dragEnd=function(){clearTimeout(this.timer)},t}(m.a),y=n(25),C=n(16),Q=n(24),x=function(e,t){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function F(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var U=function(){return(U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0){var f=Math.sqrt((a*a+s*s)/(1+t*t));a=(a>=0?1:-1)*(t*f),s=(s>=0?1:-1)*f}var d=Math.abs(a),p=Math.abs(s),h=a<0?u-n.left:n.right-u,g=s<0?c-n.top:n.bottom-c;a=(a>=0?1:-1)*(d=(r=Object(i.t)([d,p],[0,0],[h,g],!!t))[0]),s=(s>=0?1:-1)*(p=r[1]);var v=u+Math.min(0,a),B=c+Math.min(0,s);return{left:v,top:B,right:v+d,bottom:B+p,width:d,height:p}}function T(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,i=t.width,o=t.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function N(e,t){var n=Object(B.b)(e,t),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map((function(e){return r[e]})).concat(a.map((function(e){return i[e]})))}var _=Object(Q.a)("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n"),M="selecto-selection "+_.className,R=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside"],D=function(){for(var e=0,t=0,n=arguments.length;t-1);)m=m.parentElement;B=m?[m]:[]}var b=B.length>0,w=!u&&b;if(w&&!c)return e.stop(),!1;var E=A.type,y="mousedown"===E||"touchstart"===E;if(!(!(!e.isClick&&y)||n.trigger("dragStart",U({},e))))return e.stop(),!1;if(l?(B=N(n.selectedTargets,B),r.startPassedTargets=n.selectedTargets):r.startPassedTargets=[],n.select(n.selectedTargets,B,v,A,!0),r.startX=o,r.startY=a,r.selectFlag=!1,r.preventDragFromInside=!1,r.boundsArea=n.target.style.cssText+="left:0px;top:0px;transform: translate("+o+"px, "+a+"px)",w&&c)A.preventDefault(),p&&(n.selectEnd(r.startSelectedTargets,r.startPassedTargets,v,e),r.preventDragFromInside=!0);else{r.selectFlag=!0,"touchstart"===E&&A.preventDefault();var C=n.options.scrollOptions;C&&C.container&&n.dragScroll.dragStart(e,C)}return!0},n.onDrag=function(e){if(e.datas.selectFlag){var t=n.options.scrollOptions;if(t&&t.container&&n.dragScroll.drag(e,t))return}n.check(e)},n.onDragEnd=function(e){var t=e.datas,r=e.inputEvent,i=H(e,n.options.ratio),o=t.selectFlag;r&&!e.isClick&&n.trigger("dragEnd",U(U({isDouble:!!e.isDouble,isDrag:!1,isSelect:o},e),{rect:i})),n.target.style.cssText+="display: none;",o&&(t.selectFlag=!1,n.dragScroll.dragEnd()),t.preventDragFromInside||n.selectEnd(t.startSelectedTargets,t.startPassedTargets,i,e)},n.onKeyDown=function(e){n.sameCombiKey(e)&&(n.continueSelect=!0,n.trigger("keydown",{}))},n.onKeyUp=function(e){n.sameCombiKey(e,!0)&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onBlur=function(){n.toggleContinueSelect&&n.continueSelect&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onDocumentSelectStart=function(e){if(n.gesto.isFlag()){var t=n.dragContainer;t===window&&(t=document.documentElement);var r=t instanceof Element?[t]:[].slice.call(t),i=e.target;r.some((function(t){if(t===i||t.contains(i))return e.preventDefault(),!0}))}},n.target=t.target,n.container=t.container||document.body,n.options=U({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,getElementRect:T,cspNonce:"",ratio:0},t),n.initElement(),n.initDragScroll(),n.setKeyController(),n}F(t,e);var n,r,o=t.prototype;return o.setSelectedTargets=function(e){return this.selectedTargets=e,this},o.getSelectedTargets=function(){return this.selectedTargets},o.setKeyContainer=function(e){var t=this,n=this.options;O(n.keyContainer,e,(function(){n.keyContainer=e,t.setKeyController()}))},o.setToggleContinueSelect=function(e){var t=this,n=this.options;O(n.toggleContinueSelect,e,(function(){n.toggleContinueSelect=e,t.setKeyEvent()}))},o.setPreventDefault=function(e){this.gesto.options.preventDefault=e},o.setCheckInput=function(e){this.gesto.options.checkInput=e},o.triggerDragStart=function(e){return this.gesto.triggerDragStart(e),this},o.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),Object(i.P)(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},o.getElementPoints=function(e){var t=this.getElementRect,n=t(e),r=[n.pos1,n.pos2,n.pos4,n.pos3];if(t!==T){var i=e.getBoundingClientRect();return Object(C.a)(r,i)}return r},o.findSelectableTargets=function(e){var t=this;void 0===e&&(e=this.gesto.getEventDatas());var n=this.getSelectableTargets(),r=n.map((function(e){return t.getElementPoints(e)}));e.selectableTargets=n,e.selectablePoints=r},o.clickTarget=function(e,t){var n=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}}return{clientX:e.clientX,clientY:e.clientY}}(e),r={datas:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:e,isClick:!0,stop:function(){return!1}};return this.onDragStart(r,t)&&this.onDragEnd(r),this},o.setKeyController=function(){var e=this.options,t=e.keyContainer,n=e.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new y.a(t||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},o.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},o.initElement=function(){this.target=function e(t,n,r){var o=t.tag,a=t.children,A=t.attributes,s=t.className,l=t.style,u=n||document.createElement(o);for(var c in A)u.setAttribute(c,A[c]);var f=u.children;if(a.forEach((function(t,n){e(t,f[n],u)})),s&&s.split(" ").forEach((function(e){Object(i.G)(u,e)||Object(i.p)(u,e)})),l){var d=u.style;for(var c in l)d[c]=l[c]}return!n&&r&&r.appendChild(u),u}(function(e,t){for(var n=[],r=2;r=Math.min(100,A)}))},o.initDragScroll=function(){var e=this;this.dragScroll.on("scroll",(function(t){var n=t.container,r=t.direction;e.trigger("scroll",{container:n,direction:r})})).on("move",(function(t){var n=t.offsetX,r=t.offsetY,i=t.inputEvent,o=i.datas;o.startX-=n,o.startY-=r,o.selectablePoints.forEach((function(e){e.forEach((function(e){e[0]-=n,e[1]-=r}))})),e.gesto.scrollBy(n,r,i.inputEvent,!1),i.distX+=n,i.distY+=r,e.check(i)}))},o.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach((function(t){Object(i.K)(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach((function(t){e.push(t)}))})),e},o.select=function(e,t,n,r,i){var o=Object(B.b)(e,t),a=o.added,A=o.removed,s=o.prevList,l=o.list;this.selectedTargets=t,i&&this.trigger("selectStart",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r}),(a.length||A.length)&&this.trigger("select",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r})},o.selectEnd=function(e,t,n,r){var i=r.inputEvent,o=r.isDouble,a=Object(B.b)(e,this.selectedTargets),A=a.added,s=a.removed,l=a.prevList,u=a.list,c=Object(B.b)(t,this.selectedTargets),f=c.added,d=c.removed,p=c.prevList,h=c.list,g=i&&i.type,v="mousedown"===g||"touchstart"===g;this.trigger("selectEnd",{selected:this.selectedTargets,added:A.map((function(e){return u[e]})),removed:s.map((function(e){return l[e]})),afterAdded:f.map((function(e){return h[e]})),afterRemoved:d.map((function(e){return p[e]})),isDragStart:v,isDouble:!!o,rect:n,inputEvent:i})},o.check=function(e,t){void 0===t&&(t=H(e,this.options.ratio));var n=e.datas,r=e.inputEvent,i=t.top,o=t.left,a=t.width,A=t.height,s=n.selectFlag,l=[],u=[];if(s){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+o+"px, "+i+"px);width:"+a+"px;height:"+A+"px;";var c=this.hitTest(t,n.startX,n.startY,n.selectableTargets,n.selectablePoints);l=this.selectedTargets,u=N(n.startPassedTargets,c),this.selectedTargets=u}this.trigger("drag",U(U({},e),{isSelect:s,rect:t})),s&&this.select(l,u,t,r)},o.sameCombiKey=function(e,t){var n=[].concat(this.options.toggleContinueSelect),r=Object(y.b)(e.inputEvent,e.key),o=Object(i.H)(n[0])?n:[n];if(t){var a=e.key;return o.some((function(e){return e.some((function(e){return e===a}))}))}return o.some((function(e){return e.every((function(e){return r.indexOf(e)>-1}))}))},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(n=R,r=function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(i.u)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)},function(e){var t=e.prototype;n.forEach((function(e){r(t,e)}))})],t)}(a)),K=n(10),L=function(e,t){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var z=function(){return(z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(K.e)(k)],t.prototype,"selecto",void 0),t}(r.PureComponent);t.a=X},function(e,t,n){"use strict";var r=n(1),i=n(15),o=n(0),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function l(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((u||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||h.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new p(l(e))],r.flag=!0,r.isDrag=!1,r.datas={},s&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(o.N)()-r.prevTime<200,!1===r.emit("dragStart",A({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&u&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(o.q)(i,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(o.P)(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=l(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",A({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&Object(o.P)(i,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),s=Object(o.N)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:s,r.emit("dragEnd",A({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=A({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r.isTouch=u.indexOf("touch")>-1,r.isMouse=u.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){Object(o.q)(e,"mousedown",r.onDragStart)})),Object(o.q)(s,"mousemove",r.onDrag),Object(o.q)(s,"mouseup",r.onDragEnd),Object(o.q)(s,"contextmenu",r.onDragEnd)),c&&Object(o.q)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};i.forEach((function(e){Object(o.q)(e,"touchstart",r.onDragStart,f)})),Object(o.q)(s,"touchmove",r.onDrag,f),Object(o.q)(s,"touchend",r.onDragEnd,f),Object(o.q)(s,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(o.P)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(o.P)(t,"mousedown",e.onDragStart)})),Object(o.P)(n,"mousemove",this.onDrag),Object(o.P)(n,"mouseup",this.onDragEnd),Object(o.P)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(o.P)(t,"touchstart",e.onDragStart)})),Object(o.P)(n,"touchstart",this.onDragStart),Object(o.P)(n,"touchmove",this.onDrag),Object(o.P)(n,"touchend",this.onDragEnd),Object(o.P)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new p(l(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",A({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",A({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",A({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,A({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(i.a);var v=n(24),B=n(34),m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function b(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var w=function(){return(w=Object.assign||function(e){for(var t,n=1,r=arguments.length;nn?"block":"none",o=this.isHorizontal?["X","width"]:["Y","height"],a=o[0],A=o[1];this.barElement.style.cssText="display: "+i+";",this.thumbElement.style.cssText+=A+": "+n*n/r+"px;transform: translate"+a+"("+t/r*n+"px)"},n.destroy=function(){Object(o.P)(this.barElement,"wheel",this.onWheel),this.gesto.off(),this.off()},t}(i.a),R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return b(t,e),t}(function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i.containerElement=t,i.viewportElement=n,i.offsetX=0,i.offsetY=0,i.containerWidth=0,i.containerHeight=0,i.viewportWidth=0,i.viewportHeight=0,i.scrollLeft=0,i.scrollTop=0,i.timer=0,i.tempScale=1,i.dragFlag=!1,i.isLoop=!1,i.resize=function(){var e=i.containerElement,t=e.offsetWidth,n=e.offsetHeight,r=i.viewportElement,o=r.offsetWidth,a=r.offsetHeight;i.containerWidth=t,i.containerHeight=n,i.viewportWidth=o,i.viewportHeight=a},i.onScroll=function(){var e=i.wrapperElement,t=e.scrollLeft,n=e.scrollTop,r=i.zoom,o=void 0===r?x.zoom:r,a=t-i.scrollLeft,A=n-i.scrollTop,s=i.getScrollLeft(),l=i.getScrollTop();i.isLoop&&(i.isLoop=!1),i.scrollLeft=t,i.scrollTop=n,i.scrollTo(s+a/o,l+A/o)},i.onWheel=function(e){var t=i.options;if(e.ctrlKey){var n=-e.deltaY,r=Math.max(1+n*(t.wheelScale||.01),1e-6);i.trigger("pinch",{distance:n,scale:r,rotation:0,zoom:i.zoom*r,inputEvent:e})}else{if(!y&&!t.useForceWheel)return;var o=i.zoom,a=e.deltaX,A=e.deltaY;e.shiftKey&&!a&&(a=A,A=0),i.scrollBy(a/o,A/o)}e.preventDefault()},i.onGestureStart=function(e){i.tempScale=i.zoom,e.preventDefault()},i.onGestureChange=function(e){if(e.preventDefault(),!i.gesto.isFlag()&&i.tempScale){var t=e.scale;i.trigger("pinch",{distance:0,scale:t,rotation:e.rotation,zoom:i.tempScale*t,inputEvent:e})}else i.tempScale=0},i.options=w(w({},x),r),i.init(),i}b(t,e);var n,r,i=t.prototype;return i.getContainer=function(){return this.containerElement},i.getViewport=function(){return this.viewportElement},i.getWrapper=function(){return this.wrapperElement},i.destroy=function(){this.off(),this.gesto.unset(),this.verticalScrollbar.destroy(),this.horizontalScrollbar.destroy(),this.injectResult.destroy();var e=this.containerElement;Object(o.P)(window,"resize",this.resize),Object(o.P)(this.wrapperElement,"scroll",this.onScroll),Object(o.P)(e,"wheel",this.onWheel),Object(o.P)(e,"tgesturestart",this.onGestureStart),Object(o.P)(e,"gesturechange",this.onGestureChange),this.gesto=null,this.injectResult=null,this.containerElement=null,this.viewportElement=null,this.options=null},i.getScrollTop=function(e){return this.scrollTop/this.zoom+this.offsetY+(e?N(this.getRangeY()[0]):0)},i.getScrollLeft=function(e){return this.scrollLeft/this.zoom+this.offsetX+(e?N(this.getRangeX()[0]):0)},i.getScrollWidth=function(e){var t=this.getRangeX(e);return this.containerWidth+N(t[0])+N(t[1])},i.getScrollHeight=function(e){var t=this.getRangeY(e);return this.containerHeight+N(t[0])+N(t[1])},i.scrollCenter=function(){this.resize();var e=this.zoom,t=-(this.containerWidth/e-this.viewportWidth)/2,n=-(this.containerHeight/e-this.viewportHeight)/2;return this.scrollTo(t,n)},i.scrollBy=function(e,t){return this.scrollTo(this.getScrollLeft()+e,this.getScrollTop()+t)},i.scrollTo=function(e,t){var n=this,r=this,i=r.zoom,o=void 0===i?x.zoom:i,a=r.margin,A=void 0===a?x.margin:a,s=r.threshold,l=void 0===s?x.threshold:s,u=r.scrollLeft,c=r.scrollTop,f=this.getRangeX(!0,!0),d=f[0],p=f[1],h=this.getRangeY(!0,!0),g=h[0],v=h[1],B=u,m=c,b=this.getScrollAreaWidth(),w=this.getScrollAreaHeight(),E=e*o,y=t*o;if(E-l<=d){var C=Math.max(0,E-d);B=C,e=(d+C)/o}else if(E+l>=p){var Q=Math.max(0,p-E);B=b-Q,e=(p-Q)/o}else Bb-l&&(B-=A);if(y-l<=g){C=Math.max(0,y-g);m=C,t=(g+C)/o}else if(y+l>=v){Q=Math.max(0,v-y);m=w-Q,t=(v-Q)/o}else mw-l&&(m-=A);B=Math.round(B),m=Math.round(m),this.scrollLeft=B,this.scrollTop=m,this.offsetX=e-B/o,this.offsetY=t-m/o,this.render();var F=this.getScrollLeft(),U=this.getScrollTop();return this.trigger("scroll",{scrollLeft:F,scrollTop:U}),u===B&&c===m||(this.isLoop=!0,this.move(B,m),requestAnimationFrame((function(){if(n.isLoop){n.isLoop=!1;var e=n.wrapperElement,t=e.scrollLeft,r=e.scrollTop;n.scrollLeft=t,n.scrollTop=r,B===t&&m===r||n.scrollTo(F,U)}})),!1)},i.setZoom=function(e){var t=this,n=t.containerWidth,r=t.containerHeight,i=t.zoomOffsetX,a=void 0===i?x.zoomOffsetX:i,A=t.zoomOffsetY,s=void 0===A?x.zoomOffsetY:A,l=t.zoom,u=this.getScrollLeft(),c=this.getScrollTop();this.options.zoom=e;var f=this.getScrollLeft(),d=this.getScrollTop(),p=Object(o.w)(""+a,n),h=Object(o.w)(""+s,r),g=u+p/l,v=c+h/l,B=f+p/e,m=d+h/e;this.scrollBy(g-B,v-m),this.render()},i.getRangeX=function(e,t){var n=this.rangeX,r=void 0===n?x.rangeX:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollLeft(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportWidth*A-this.containerWidth,l[1]*A)]:l},i.getRangeY=function(e,t){var n=this.rangeY,r=void 0===n?x.rangeY:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollTop(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportHeight*A-this.containerHeight,l[1]*A)]:l},i.init=function(){var e=this,t=this.containerElement,n=this.options;Object(o.p)(t,F);var r=n.wrapperElement||t.querySelector(".infinite-viewer-wrapper"),i=n.scrollAreaElement||t.querySelector(".infinite-viewer-scroll-area"),a=n.horizontalScrollElement||t.querySelector(".infinite-viewer-horizontal-scroll-bar"),A=n.verticalScrollElement||t.querySelector(".infinite-viewer-vertical-scroll-bar");r||(r=document.createElement("div"),Object(o.p)(r,"infinite-viewer-wrapper"),r.insertBefore(this.viewportElement,null),t.insertBefore(r,null)),this.wrapperElement=r,i||(i=document.createElement("div"),Object(o.p)(i,"infinite-viewer-scroll-area"),r.insertBefore(i,r.firstChild)),this.scrollAreaElement=i,this.horizontalScrollbar=new M("horizontal",a),this.verticalScrollbar=new M("vertical",A),this.horizontalScrollbar.on("scroll",(function(t){e.scrollBy(t.delta/e.zoom,0)})),this.verticalScrollbar.on("scroll",(function(t){e.scrollBy(0,t.delta/e.zoom)})),this.horizontalScrollbar.isAppend&&t.insertBefore(this.horizontalScrollbar.barElement,null),this.verticalScrollbar.isAppend&&t.insertBefore(this.verticalScrollbar.barElement,null),Object(o.p)(t,F),this.injectResult=Q.inject(t,{nonce:this.options.cspNonce}),this.gesto=new g(t,{container:document.body,events:["touch"]}).on("dragStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;e.pauseAnimation(),e.dragFlag=!1,!1!==e.trigger("dragStart",{inputEvent:n})?(n.preventDefault(),r.startEvent=n):i()})).on("drag",(function(t){if(!e.options.usePinch||t.isPinch){e.trigger("drag",{inputEvent:t.inputEvent}),function(e){var t=e.deltaX,n=e.deltaY,r=e.datas,i=Date.now(),o=r.speed;if(!o)return r.speed=[0,0],void(r.time=i);var a=i-r.time;r.speed=[o[0]/2+t/a,o[1]/2+n/a]}(t);var r=e.zoom;e.scrollBy(-t.deltaX/r,-t.deltaY/r)}else!e.dragFlag&&t.movement>n.pinchThreshold&&(e.dragFlag=!0,e.trigger("abortPinch",{inputEvent:t.datas.startEvent||t.inputEvent}))})).on("dragEnd",(function(t){e.trigger("dragEnd",{isDrag:t.isDrag,isDouble:t.isDouble,inputEvent:t.inputEvent}),e.startAnimation(t.datas.speed)})).on("pinchStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;n.preventDefault(),e.pauseAnimation(),r.startZoom=e.zoom,!1===e.trigger("pinchStart",{inputEvent:n})&&i()})).on("pinch",(function(t){e.trigger("pinch",{rotation:t.rotation,distance:t.distance,scale:t.scale,zoom:t.datas.startZoom*t.scale,inputEvent:t.inputEvent})})),Object(o.q)(r,"scroll",this.onScroll),Object(o.q)(window,"resize",this.resize),Object(o.q)(t,"wheel",this.onWheel,{passive:!1}),Object(o.q)(t,"gesturestart",this.onGestureStart,{passive:!1}),Object(o.q)(t,"gesturechange",this.onGestureChange,{passive:!1}),this.resize(),this.render(),this.scrollTo(0,0)},i.render=function(){var e=this.offsetX,t=this.offsetY,n=this.zoom,r=void 0===n?x.zoom:n,i=this.translateZ,o=void 0===i?0:i,a=-e*r,A=-t*r;this.scrollAreaElement.style.cssText="width:calc(100% + "+this.getScrollAreaWidth()+"px);height:calc(100% + "+this.getScrollAreaHeight()+"px);",this.viewportElement.style.cssText+="transform-origin: 0 0;transform:translate3d("+a+"px, "+A+"px, "+o+"px) scale("+r+");",this.renderScroll()},i.renderScroll=function(){var e=this.containerWidth,t=this.containerHeight,n=this.zoom,r=this.getScrollLeft(!0)*n,i=this.getScrollTop(!0)*n,o=this.getScrollWidth(!0),a=this.getScrollHeight(!0);this.horizontalScrollbar.render(this.displayHorizontalScroll,r,e,o),this.verticalScrollbar.render(this.displayVerticalScroll,i,t,a)},i.move=function(e,t){var n=this.wrapperElement;n.scrollLeft=e,n.scrollTop=t},i.startAnimation=function(e){var t=this;if(e&&(e[0]||e[1])){var n=-6e-4,r=function(e){return 1-Math.pow(1-e,3)},i=T(e,n),o=function(e,t){var n=T(e,t);return[e[0]/2*n,e[1]/2*n]}(e,n),a=Date.now(),A=a;this.timer=requestAnimationFrame((function e(){var n=Date.now(),s=n-a;i=i||(t.timer=requestAnimationFrame(e))}))}},i.pauseAnimation=function(){cancelAnimationFrame(this.timer)},i.getScrollAreaWidth=function(){var e=this.getRangeX(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},i.getScrollAreaHeight=function(){var e=this.getRangeY(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([(n=U,r=function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(o.u)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)},function(e){var t=e.prototype;n.forEach((function(e){r(t,e)}))})],t)}(i.a)),D=n(10),P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(D.e)(H)],t.prototype,"infiniteViewer",void 0),t}(r.PureComponent);t.a=K},function(e,t,n){"use strict";var r=n(0),i=n(15),o=function(){function e(e){this.separator=e,this.orderMap={}}var t=e.prototype;return t.getFullName=function(e){return e.join(this.separator)},t.get=function(e){return this.orderMap[this.getFullName(e)]},t.gets=function(e,t){void 0===t&&(t=!0);var n=[],r=this;return function e(t,i){var o=r.get(t);if(o)return o.forEach((function(r){var o=i.concat([r]),a=e(t.concat([r]),o);a&&a.length||n.push(i.concat([r]))})),o}(e,t?e:[]),n},t.set=function(e,t){var n=this;return e.forEach((function(t,r){n.addName(e.slice(0,r),t)})),this.orderMap[this.getFullName(e)]=t,t},t.add=function(e){var t=e.length;return t?this.addName(e.slice(0,-1),e[t-1]):[]},t.addName=function(e,t){var n=this.get(e)||this.set(e,[]);return-1===n.indexOf(t)&&n.push(t),n},t.findIndex=function(e,t){var n=this.orderMap[this.getFullName(e)];return n?n.indexOf(t):-1},t.remove=function(e){var t=this.getFullName(e),n=this.orderMap;for(var r in n)0===r.indexOf(t)&&delete n[r];var i=e.length;if(i){var o=e.slice(0,-1),a=e[i-1];this.splice(o,this.findIndex(o,a),1)}return this},t.filter=function(t,n,r){void 0===r&&(r=!0);var i=this.gets(t,r).filter(n),o=new e(this.separator),a=r?[]:t;return i.forEach((function(e){o.add(a.concat(e))})),o},t.splice=function(e,t,n){for(var r=[],i=3;i.001;){if(i=l(e,t,r)-n,Math.abs(i)<.001)return r;r-=i/2}return r}(e,n,Object(r.s)(o,0,1));return l(t,i,a)};return o.easingName="cubic-bezier("+e+","+t+","+n+","+i+")",o}function c(e,t){var n=function(n){var r=1/e;return n>=1?1:("start"===t?r:0)+Math.floor(n/r)*r};return n.easingName="steps("+e+", "+t+")",n}var f,d=c(1,"start"),p=c(1,"end"),h=u(0,0,1,1),g=u(.25,.1,.25,1),v=u(.42,0,1,1),B=u(0,0,.58,1),m=u(.42,0,.58,1),b="animation-timing-function",w={transform:{},filter:{},attribute:{},html:!0},E={easing:[b]},y=((f={})[b]=!0,f.contents=!0,f.html=!0,f),C="delay",Q={linear:h,ease:g,"ease-in":v,"ease-out":B,"ease-in-out":m,"step-start":d,"step-end":p},x=["duration","fillMode","direction","iterationCount",C,"easing","playSpeed"],F=function(){function e(e,t){this.prefix="",this.suffix="",this.model="",this.type="",this.separator=",",t&&this.setOptions(t),this.value=Object(r.L)(e)?e.split(this.separator):e}var t=e.prototype;return t.setOptions=function(e){for(var t in e)this[t]=e[t];return this},t.size=function(){return this.value.length},t.get=function(e){return this.value[e]},t.set=function(e,t){return this.value[e]=t,this},t.clone=function(){var t=this,n=t.separator,r=t.prefix,i=t.suffix,o=t.model,a=t.type;return new e(this.value.map((function(t){return t instanceof e?t.clone():t})),{separator:n,prefix:r,suffix:i,model:o,type:a})},t.toValue=function(){return this.prefix+this.join()+this.suffix},t.join=function(){return this.value.map((function(t){return t instanceof e?t.toValue():t})).join(this.separator)},t.forEach=function(e){return this.value.forEach(e),this},e}();function U(e){for(var t=Object(r.V)(e,";"),n={},i=t.length,o=i,a=0;a1?O(n.map((function(e){return H(e)})),","):(n=Object(r.U)(e)).length>1?O(n.map((function(e){return H(e)}))," "):(n=/^(['"])([^'"]*)(['"])$/g.exec(e))&&n[1]===n[3]?new F([H(n[2])],{prefix:n[1],suffix:n[1]}):-1!==e.indexOf("(")?function(e){var t=Object(r.S)(e),n=t.prefix,i=t.value,o=t.suffix;if("undefined"===typeof i)return e;if(r.d.indexOf(n)>-1)return S(Object(r.X)(e));var a=H(i,n),A=[i],s=",",l=n+"(",u=")"+o;return a instanceof F&&(s=a.separator,A=a.value,l+=a.prefix,u=a.suffix+u),new F(A,{separator:s,model:n,prefix:l,suffix:u})}(e):"#"===e.charAt(0)&&"url"!==t?function(e){var t=Object(r.X)(e);return t?S(t):e}(e):e}function T(e,t){void 0===t&&(t={});var n=e.model;if(n){e.setOptions({model:"",suffix:"",prefix:""});var r=e.size()>1?e:e.get(0);t[n]=r}else e.forEach((function(e){T(e,t)}));return t}function N(e){return e instanceof F}function _(e){var t=typeof e;if(t===r.j){if(Object(r.H)(e))return r.c;if(N(e))return r.k}else if(t===r.m||t===r.i)return"value";return t}function M(e){return Object(r.K)(e)&&e.constructor===Object}function R(e,t){var n=[];if(M(e))for(var r in e)t.push(r),n=n.concat(R(e[r],t)),t.pop();else n.push(t.slice());return n}function D(e){return Math.round(1e6*e)/1e6}function P(e,t,n){void 0===n&&(n=e.length);for(var i=t,o=0;o=1?"alternate-reverse":"alternate"):n===(e%2>=1?"alternate":"alternate-reverse"))}var j=["id","iterationCount",C,"fillMode","direction","playSpeed","duration","playSpeed","iterationTime","playState"],X=s(j,["easing","easingName"]);i.a;function G(e,t){if(void 0===t&&(t=[]),!e)return"";var n=[],i=Object(r.D)(e);return Object(r.R)(i,t),i.forEach((function(t){n.push(t.replace(/\d$/g,"")+"("+e[t]+")")})),n.join(" ")}function V(e,t){return void 0===t&&(t=!1),Y({},e,t)}function Y(e,t,n){for(var i in void 0===n&&(n=!1),t){var o=t[i],a=_(o);a===r.k?e[i]=n?o.toValue():o.clone():a===r.f?e[i]=n?J([i],o):o:a===r.c?e[i]=o.slice():a===r.j?Object(r.K)(e[i])&&!N(e[i])?Y(e[i],o,n):e[i]=V(o,n):e[i]=t[i]}return e}function W(e){return e[0]in E?E[e[0]]:e}function J(e,t){var n=_(t);if(n===r.k)return t.toValue();if(n===r.f){if(e[0]!==b)return J(e,t())}else if(n===r.j)return V(t,!0);return t}var q=function(){function e(e){void 0===e&&(e={}),this.properties={},this.orderMap=new o("_///_"),this.properties={},this.set(e)}var t=e.prototype;return t.get=function(){for(var e=[],t=0;tO.length&&O.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var A=typeof t;"undefined"!==A&&"boolean"!==A||(t=null);var s=!1;if(null===t)s=!0;else switch(A){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return r(i,t,""===n?"."+_(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;lt}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!z.call(X,e)||!z.call(j,e)&&(L.test(e)?X[e]=!0:(j[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}J.hasOwnProperty("ReactCurrentDispatcher")||(J.ReactCurrentDispatcher={current:null}),J.hasOwnProperty("ReactCurrentBatchConfig")||(J.ReactCurrentBatchConfig={suspense:null});var Z=/^(.*)[\\\/]/,$="function"===typeof Symbol&&Symbol.for,ee=$?Symbol.for("react.element"):60103,te=$?Symbol.for("react.portal"):60106,ne=$?Symbol.for("react.fragment"):60107,re=$?Symbol.for("react.strict_mode"):60108,ie=$?Symbol.for("react.profiler"):60114,oe=$?Symbol.for("react.provider"):60109,ae=$?Symbol.for("react.context"):60110,Ae=$?Symbol.for("react.concurrent_mode"):60111,se=$?Symbol.for("react.forward_ref"):60112,le=$?Symbol.for("react.suspense"):60113,ue=$?Symbol.for("react.suspense_list"):60120,ce=$?Symbol.for("react.memo"):60115,fe=$?Symbol.for("react.lazy"):60116,de=$?Symbol.for("react.block"):60121,pe="function"===typeof Symbol&&Symbol.iterator;function he(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=pe&&e[pe]||e["@@iterator"])?e:null}function ge(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case ie:return"Profiler";case re:return"StrictMode";case le:return"Suspense";case ue:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case ae:return"Context.Consumer";case oe:return"Context.Provider";case se:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case ce:return ge(e.type);case de:return ge(e.render);case fe:if(e=1===e._status?e._result:null)return ge(e)}return null}function ve(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,i=e._debugSource,o=ge(e.type);n=null,r&&(n=ge(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(Z,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n in "+(r||"Unknown")+o}t+=n,e=e.return}while(e);return t}function Be(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function be(e){e._valueTracker||(e._valueTracker=function(e){var t=me(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function we(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=me(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Ee(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ye(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Be(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ce(e,t){null!=(t=t.checked)&&q(e,"checked",t,!1)}function Qe(e,t){Ce(e,t);var n=Be(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Fe(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fe(e,t.type,Be(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function xe(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Fe(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Ue(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Se(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Be(n)}}function Te(e,t){var n=Be(t.value),r=Be(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ne(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var _e="http://www.w3.org/1999/xhtml",Me="http://www.w3.org/2000/svg";function Re(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function De(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Re(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Pe,ke=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Me||"innerHTML"in e)e.innerHTML=t;else{for((Pe=Pe||document.createElement("div")).innerHTML=""+t.valueOf().toString()+" ",t=Pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Ke(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Le={animationend:Ke("Animation","AnimationEnd"),animationiteration:Ke("Animation","AnimationIteration"),animationstart:Ke("Animation","AnimationStart"),transitionend:Ke("Transition","TransitionEnd")},ze={},je={};function Xe(e){if(ze[e])return ze[e];if(!Le[e])return e;var t,n=Le[e];for(t in n)if(n.hasOwnProperty(t)&&t in je)return ze[e]=n[t];return e}F&&(je=document.createElement("div").style,"AnimationEvent"in window||(delete Le.animationend.animation,delete Le.animationiteration.animation,delete Le.animationstart.animation),"TransitionEvent"in window||delete Le.transitionend.transition);var Ge=Xe("animationend"),Ve=Xe("animationiteration"),Ye=Xe("animationstart"),We=Xe("transitionend"),Je="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qe=new("function"===typeof WeakMap?WeakMap:Map);function Ze(e){var t=qe.get(e);return void 0===t&&(t=new Map,qe.set(e,t)),t}function $e(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if($e(e)!==e)throw Error(a(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=$e(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return tt(i),e;if(o===r)return tt(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var A=!1,s=i.child;s;){if(s===n){A=!0,n=i,r=o;break}if(s===r){A=!0,r=i,n=o;break}s=s.sibling}if(!A){for(s=o.child;s;){if(s===n){A=!0,n=o,r=i;break}if(s===r){A=!0,r=o,n=i;break}s=s.sibling}if(!A)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(a(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function it(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var ot=null;function at(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;rut.length&&ut.push(e)}function ft(e,t,n,r){if(ut.length){var i=ut.pop();return i.topLevelType=e,i.eventSystemFlags=r,i.nativeEvent=t,i.targetInst=n,i}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function dt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=Fn(r)}while(n);for(n=0;n=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cn(r)}}function dn(){for(var e=window,t=un();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=un((e=t.contentWindow).document)}return t}function pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var hn=null,gn=null;function vn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Bn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var mn="function"===typeof setTimeout?setTimeout:void 0,bn="function"===typeof clearTimeout?clearTimeout:void 0;function wn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function En(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var yn=Math.random().toString(36).slice(2),Cn="__reactInternalInstance$"+yn,Qn="__reactEventHandlers$"+yn,xn="__reactContainere$"+yn;function Fn(e){var t=e[Cn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xn]||n[Cn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=En(e);null!==e;){if(n=e[Cn])return n;e=En(e)}return t}n=(e=n).parentNode}return null}function Un(e){return!(e=e[Cn]||e[xn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Sn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function On(e){return e[Qn]||null}function Hn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Tn(e,t){var n=e.stateNode;if(!n)return null;var r=p(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}function Nn(e,t,n){(t=Tn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function _n(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=Hn(t);for(t=n.length;0this.eventPool.length&&this.eventPool.push(e)}function Vn(e){e.eventPool=[],e.getPooled=Xn,e.release=Gn}i(jn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){this.isPersistent=Ln},isPersistent:zn,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=zn,this._dispatchInstances=this._dispatchListeners=null}}),jn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},jn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,Vn(n),n},Vn(jn);var Yn=jn.extend({data:null}),Wn=jn.extend({data:null}),Jn=[9,13,27,32],qn=F&&"CompositionEvent"in window,Zn=null;F&&"documentMode"in document&&(Zn=document.documentMode);var $n=F&&"TextEvent"in window&&!Zn,er=F&&(!qn||Zn&&8=Zn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function ir(e,t){switch(e){case"keyup":return-1!==Jn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function or(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var ar=!1;var Ar={eventTypes:nr,extractEvents:function(e,t,n,r){var i;if(qn)e:{switch(e){case"compositionstart":var o=nr.compositionStart;break e;case"compositionend":o=nr.compositionEnd;break e;case"compositionupdate":o=nr.compositionUpdate;break e}o=void 0}else ar?ir(e,n)&&(o=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=nr.compositionStart);return o?(er&&"ko"!==n.locale&&(ar||o!==nr.compositionStart?o===nr.compositionEnd&&ar&&(i=Kn()):(kn="value"in(Pn=r)?Pn.value:Pn.textContent,ar=!0)),o=Yn.getPooled(o,t,n,r),i?o.data=i:null!==(i=or(n))&&(o.data=i),Dn(o),i=o):i=null,(e=$n?function(e,t){switch(e){case"compositionend":return or(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(ar)return"compositionend"===e||!qn&&ir(e,t)?(e=Kn(),In=kn=Pn=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,Kr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Lr=null,zr=null,jr=null,Xr=!1;function Gr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Xr||null==Lr||Lr!==un(n)?null:("selectionStart"in(n=Lr)&&pn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},jr&&kr(jr,n)?null:(jr=n,(e=jn.getPooled(Kr.select,zr,e,t)).type="select",e.target=Lr,Dn(e),e))}var Vr={eventTypes:Kr,extractEvents:function(e,t,n,r,i,o){if(!(o=!(i=o||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{i=Ze(i),o=Q.onSelect;for(var a=0;aAi||(e.current=ai[Ai],ai[Ai]=null,Ai--)}function li(e,t){Ai++,ai[Ai]=e.current,e.current=t}var ui={},ci={current:ui},fi={current:!1},di=ui;function pi(e,t){var n=e.type.contextTypes;if(!n)return ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function gi(){si(fi),si(ci)}function vi(e,t,n){if(ci.current!==ui)throw Error(a(168));li(ci,t),li(fi,n)}function Bi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,ge(t)||"Unknown",o));return i({},n,{},r)}function mi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ui,di=ci.current,li(ci,e),li(fi,fi.current),!0}function bi(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Bi(e,t,di),r.__reactInternalMemoizedMergedChildContext=e,si(fi),si(ci),li(ci,e)):si(fi),li(fi,n)}var wi=o.unstable_runWithPriority,Ei=o.unstable_scheduleCallback,yi=o.unstable_cancelCallback,Ci=o.unstable_requestPaint,Qi=o.unstable_now,xi=o.unstable_getCurrentPriorityLevel,Fi=o.unstable_ImmediatePriority,Ui=o.unstable_UserBlockingPriority,Si=o.unstable_NormalPriority,Oi=o.unstable_LowPriority,Hi=o.unstable_IdlePriority,Ti={},Ni=o.unstable_shouldYield,_i=void 0!==Ci?Ci:function(){},Mi=null,Ri=null,Di=!1,Pi=Qi(),ki=1e4>Pi?Qi:function(){return Qi()-Pi};function Ii(){switch(xi()){case Fi:return 99;case Ui:return 98;case Si:return 97;case Oi:return 96;case Hi:return 95;default:throw Error(a(332))}}function Ki(e){switch(e){case 99:return Fi;case 98:return Ui;case 97:return Si;case 96:return Oi;case 95:return Hi;default:throw Error(a(332))}}function Li(e,t){return e=Ki(e),wi(e,t)}function zi(e,t,n){return e=Ki(e),Ei(e,t,n)}function ji(e){return null===Mi?(Mi=[e],Ri=Ei(Fi,Gi)):Mi.push(e),Ti}function Xi(){if(null!==Ri){var e=Ri;Ri=null,yi(e)}Gi()}function Gi(){if(!Di&&null!==Mi){Di=!0;var e=0;try{var t=Mi;Li(99,(function(){for(;e=t&&(Oa=!0),e.firstContext=null)}function ro(e,t){if(Zi!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Zi=e,t=1073741823),t={context:e,observedBits:t,next:null},null===qi){if(null===Ji)throw Error(a(308));qi=t,Ji.dependencies={expirationTime:0,firstContext:t,responders:null}}else qi=qi.next=t;return e._currentValue}var io=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Ao(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function so(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function lo(e,t){var n=e.alternate;null!==n&&ao(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function uo(e,t,n,r){var o=e.updateQueue;io=!1;var a=o.baseQueue,A=o.shared.pending;if(null!==A){if(null!==a){var s=a.next;a.next=A.next,A.next=s}a=A,o.shared.pending=null,null!==(s=e.alternate)&&(null!==(s=s.updateQueue)&&(s.baseQueue=A))}if(null!==a){s=a.next;var l=o.baseState,u=0,c=null,f=null,d=null;if(null!==s)for(var p=s;;){if((A=p.expirationTime)u&&(u=A)}else{null!==d&&(d=d.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),os(A,p.suspenseConfig);e:{var g=e,v=p;switch(A=t,h=n,v.tag){case 1:if("function"===typeof(g=v.payload)){l=g.call(h,l,A);break e}l=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null===(A="function"===typeof(g=v.payload)?g.call(h,l,A):g)||void 0===A)break e;l=i({},l,A);break e;case 2:io=!0}}null!==p.callback&&(e.effectTag|=32,null===(A=o.effects)?o.effects=[p]:A.push(p))}if(null===(p=p.next)||p===s){if(null===(A=o.shared.pending))break;p=a.next=A.next,A.next=s,o.baseQueue=a=A,o.shared.pending=null}}null===d?c=l:d.next=f,o.baseState=c,o.baseQueue=d,as(u),e.expirationTime=u,e.memoizedState=l}}function co(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;th?(g=c,c=null):g=c.sibling;var v=d(i,c,A[h],s);if(null===v){null===c&&(c=g);break}e&&c&&null===v.alternate&&t(i,c),a=o(v,a,h),null===u?l=v:u.sibling=v,u=v,c=g}if(h===A.length)return n(i,c),l;if(null===c){for(;hg?(v=h,h=null):v=h.sibling;var m=d(i,h,B.value,l);if(null===m){null===h&&(h=v);break}e&&h&&null===m.alternate&&t(i,h),A=o(m,A,g),null===c?u=m:c.sibling=m,c=m,h=v}if(B.done)return n(i,h),u;if(null===h){for(;!B.done;g++,B=s.next())null!==(B=f(i,B.value,l))&&(A=o(B,A,g),null===c?u=B:c.sibling=B,c=B);return u}for(h=r(i,h);!B.done;g++,B=s.next())null!==(B=p(h,i,g,B.value,l))&&(e&&null!==B.alternate&&h.delete(null===B.key?g:B.key),A=o(B,A,g),null===c?u=B:c.sibling=B,c=B);return e&&h.forEach((function(e){return t(i,e)})),u}return function(e,r,o,s){var l="object"===typeof o&&null!==o&&o.type===ne&&null===o.key;l&&(o=o.props.children);var u="object"===typeof o&&null!==o;if(u)switch(o.$$typeof){case ee:e:{for(u=o.key,l=r;null!==l;){if(l.key===u){switch(l.tag){case 7:if(o.type===ne){n(e,l.sibling),(r=i(l,o.props.children)).return=e,e=r;break e}break;default:if(l.elementType===o.type){n(e,l.sibling),(r=i(l,o.props)).ref=Eo(e,l,o),r.return=e,e=r;break e}}n(e,l);break}t(e,l),l=l.sibling}o.type===ne?((r=Us(o.props.children,e.mode,s,o.key)).return=e,e=r):((s=Fs(o.type,o.key,o.props,null,e.mode,s)).ref=Eo(e,r,o),s.return=e,e=s)}return A(e);case te:e:{for(l=o.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Os(o,e.mode,s)).return=e,e=r}return A(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Ss(o,e.mode,s)).return=e,e=r),A(e);if(wo(o))return h(e,r,o,s);if(he(o))return g(e,r,o,s);if(u&&yo(e,o),"undefined"===typeof o&&!l)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Qo=Co(!0),xo=Co(!1),Fo={},Uo={current:Fo},So={current:Fo},Oo={current:Fo};function Ho(e){if(e===Fo)throw Error(a(174));return e}function To(e,t){switch(li(Oo,t),li(So,e),li(Uo,Fo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:De(null,"");break;default:t=De(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}si(Uo),li(Uo,t)}function No(){si(Uo),si(So),si(Oo)}function _o(e){Ho(Oo.current);var t=Ho(Uo.current),n=De(t,e.type);t!==n&&(li(So,e),li(Uo,n))}function Mo(e){So.current===e&&(si(Uo),si(So))}var Ro={current:0};function Do(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Po(e,t){return{responder:e,props:t}}var ko=J.ReactCurrentDispatcher,Io=J.ReactCurrentBatchConfig,Ko=0,Lo=null,zo=null,jo=null,Xo=!1;function Go(){throw Error(a(321))}function Vo(e,t){if(null===t)return!1;for(var n=0;no))throw Error(a(301));o+=1,jo=zo=null,t.updateQueue=null,ko.current=ma,e=n(r,i)}while(t.expirationTime===Ko)}if(ko.current=ga,t=null!==zo&&null!==zo.next,Ko=0,jo=zo=Lo=null,Xo=!1,t)throw Error(a(300));return e}function Wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===jo?Lo.memoizedState=jo=e:jo=jo.next=e,jo}function Jo(){if(null===zo){var e=Lo.alternate;e=null!==e?e.memoizedState:null}else e=zo.next;var t=null===jo?Lo.memoizedState:jo.next;if(null!==t)jo=t,zo=e;else{if(null===e)throw Error(a(310));e={memoizedState:(zo=e).memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},null===jo?Lo.memoizedState=jo=e:jo=jo.next=e}return jo}function qo(e,t){return"function"===typeof t?t(e):t}function Zo(e){var t=Jo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=zo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var A=i.next;i.next=o.next,o.next=A}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var s=A=o=null,l=i;do{var u=l.expirationTime;if(uLo.expirationTime&&(Lo.expirationTime=u,as(u))}else null!==s&&(s=s.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),os(u,l.suspenseConfig),r=l.eagerReducer===e?l.eagerState:e(r,l.action);l=l.next}while(null!==l&&l!==i);null===s?o=r:s.next=A,Dr(r,t.memoizedState)||(Oa=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function $o(e){var t=Jo(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var A=i=i.next;do{o=e(o,A.action),A=A.next}while(A!==i);Dr(o,t.memoizedState)||(Oa=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ea(e){var t=Wo();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:qo,lastRenderedState:e}).dispatch=ha.bind(null,Lo,e),[t.memoizedState,e]}function ta(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Lo.updateQueue)?(t={lastEffect:null},Lo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function na(){return Jo().memoizedState}function ra(e,t,n,r){var i=Wo();Lo.effectTag|=e,i.memoizedState=ta(1|t,n,void 0,void 0===r?null:r)}function ia(e,t,n,r){var i=Jo();r=void 0===r?null:r;var o=void 0;if(null!==zo){var a=zo.memoizedState;if(o=a.destroy,null!==r&&Vo(r,a.deps))return void ta(t,n,o,r)}Lo.effectTag|=e,i.memoizedState=ta(1|t,n,o,r)}function oa(e,t){return ra(516,4,e,t)}function aa(e,t){return ia(516,4,e,t)}function Aa(e,t){return ia(4,2,e,t)}function sa(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function la(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ia(4,2,sa.bind(null,t,e),n)}function ua(){}function ca(e,t){return Wo().memoizedState=[e,void 0===t?null:t],e}function fa(e,t){var n=Jo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function da(e,t){var n=Jo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Vo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function pa(e,t,n){var r=Ii();Li(98>r?98:r,(function(){e(!0)})),Li(97<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=s.createElement(o,{is:r.is}):(e=s.createElement(o),"select"===o&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,o),e[Cn]=t,e[Qn]=r,Ia(e,t),t.stateNode=e,s=an(o,r),o){case"iframe":case"object":case"embed":Vt("load",e),l=r;break;case"video":case"audio":for(l=0;lr.tailExpiration&&1t)&&LA.set(e,t))}}function WA(e,t){e.expirationTime=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function qA(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=ji($A.bind(null,e));else{var t=JA(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=GA();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==Ti&&yi(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?ji($A.bind(null,e)):zi(r,ZA.bind(null,e),{timeout:10*(1073741821-t)-ki()}),e.callbackNode=t}}}function ZA(e,t){if(XA=0,t)return Ms(e,t=GA()),qA(e),null;var n=JA(e);if(0!==n){if(t=e.callbackNode,0!==(48&yA))throw Error(a(327));if(hs(),e===CA&&n===xA||ns(e,n),null!==QA){var r=yA;yA|=16;for(var i=is();;)try{ss();break}catch(s){rs(e,s)}if($i(),yA=r,BA.current=i,1===FA)throw t=UA,ns(e,n),Ns(e,n),qA(e),t;if(null===QA)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=FA,CA=null,r){case bA:case 1:throw Error(a(345));case 2:Ms(e,2=n){e.lastPingedTime=n,ns(e,n);break}}if(0!==(o=JA(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=mn(fs.bind(null,e),i);break}fs(e);break;case EA:if(Ns(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=cs(i)),NA&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,ns(e,n);break}if(0!==(i=JA(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==OA?r=10*(1073741821-OA)-ki():1073741823===SA?r=0:(r=10*(1073741821-SA)-5e3,0>(r=(i=ki())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vA(r/1960))-r)&&(r=n)),10=(r=0|A.busyMinDurationMs)?r=0:(i=0|A.busyDelayMs,r=(o=ki()-(10*(1073741821-o)-(0|A.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+ve(a))}5!==FA&&(FA=2),A=Za(A,a),c=o;do{switch(c.tag){case 3:s=A,c.effectTag|=4096,c.expirationTime=t,lo(c,pA(c,s,t));break e;case 1:s=A;var b=c.type,w=c.stateNode;if(0===(64&c.effectTag)&&("function"===typeof b.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===PA||!PA.has(w)))){c.effectTag|=4096,c.expirationTime=t,lo(c,hA(c,s,t));break e}}c=c.return}while(null!==c)}QA=us(QA)}catch(E){t=E;continue}break}}function is(){var e=BA.current;return BA.current=ga,null===e?ga:e}function os(e,t){eTA&&(TA=e)}function As(){for(;null!==QA;)QA=ls(QA)}function ss(){for(;null!==QA&&!Ni();)QA=ls(QA)}function ls(e){var t=gA(e.alternate,e,xA);return e.memoizedProps=e.pendingProps,null===t&&(t=us(e)),mA.current=null,t}function us(e){QA=e;do{var t=QA.alternate;if(e=QA.return,0===(2048&QA.effectTag)){if(t=Ja(t,QA,xA),1===xA||1!==QA.childExpirationTime){for(var n=0,r=QA.child;null!==r;){var i=r.expirationTime,o=r.childExpirationTime;i>n&&(n=i),o>n&&(n=o),r=r.sibling}QA.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=QA.firstEffect),null!==QA.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=QA.firstEffect),e.lastEffect=QA.lastEffect),1(e=e.childExpirationTime)?t:e}function fs(e){var t=Ii();return Li(99,ds.bind(null,e,t)),null}function ds(e,t){do{hs()}while(null!==IA);if(0!==(48&yA))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=cs(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===CA&&(QA=CA=null,xA=0),1s&&(u=s,s=A,A=u),u=fn(b,A),c=fn(b,s),u&&c&&(1!==E.rangeCount||E.anchorNode!==u.node||E.anchorOffset!==u.offset||E.focusNode!==c.node||E.focusOffset!==c.offset)&&((w=w.createRange()).setStart(u.node,u.offset),E.removeAllRanges(),A>s?(E.addRange(w),E.extend(c.node,c.offset)):(w.setEnd(c.node,c.offset),E.addRange(w))))),w=[];for(E=b;E=E.parentNode;)1===E.nodeType&&w.push({element:E,left:E.scrollLeft,top:E.scrollTop});for("function"===typeof b.focus&&b.focus(),b=0;b=n?ja(e,t,n):(li(Ro,1&Ro.current),null!==(t=Ya(e,t,n))?t.sibling:null);li(Ro,1&Ro.current);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return Va(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),li(Ro,Ro.current),!r)return null}return Ya(e,t,n)}Oa=!1}}else Oa=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=pi(t,ci.current),no(t,n),i=Yo(null,t,r,e,i,n),t.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,hi(r)){var o=!0;mi(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,oo(t);var A=r.getDerivedStateFromProps;"function"===typeof A&&ho(t,r,A,e),i.updater=go,t.stateNode=i,i._reactInternalFiber=t,bo(t,r,e,n),t=Pa(null,t,r,!0,o,n)}else t.tag=0,Ha(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"===typeof e)return Qs(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===se)return 11;if(e===ce)return 14}return 2}(i),e=Yi(i,e),o){case 0:t=Ra(null,t,i,e,n);break e;case 1:t=Da(null,t,i,e,n);break e;case 11:t=Ta(null,t,i,e,n);break e;case 14:t=Na(null,t,i,Yi(i.type,e),r,n);break e}throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ra(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Da(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 3:if(ka(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ao(e,t),uo(t,r,null,n),(r=t.memoizedState.element)===i)Ua(),t=Ya(e,t,n);else{if((i=t.stateNode.hydrate)&&(wa=wn(t.stateNode.containerInfo.firstChild),ba=t,i=Ea=!0),i)for(n=xo(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else Ha(e,t,r,n),Ua();t=t.child}return t;case 5:return _o(t),null===e&&Qa(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,A=i.children,Bn(r,i)?A=null:null!==o&&Bn(r,o)&&(t.effectTag|=16),Ma(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Ha(e,t,A,n),t=t.child),t;case 6:return null===e&&Qa(t),null;case 13:return ja(e,t,n);case 4:return To(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Qo(t,null,r,n):Ha(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Ta(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 7:return Ha(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ha(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,A=t.memoizedProps,o=i.value;var s=t.type._context;if(li(Wi,s._currentValue),s._currentValue=o,null!==A)if(s=A.value,0===(o=Dr(s,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(s,o):1073741823))){if(A.children===i.children&&!fi.current){t=Ya(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var l=s.dependencies;if(null!==l){A=s.child;for(var u=l.firstContext;null!==u;){if(u.context===r&&0!==(u.observedBits&o)){1===s.tag&&((u=Ao(n,null)).tag=2,so(s,u)),s.expirationTime=t&&e<=t}function Ns(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function _s(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Ms(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Rs(e,t,n,r){var i=t.current,o=GA(),A=fo.suspense;o=VA(o,i,A);e:if(n){t:{if($e(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(a(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(hi(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(a(171))}if(1===n.tag){var l=n.type;if(hi(l)){n=Bi(n,l,s);break e}}n=s}else n=ui;return null===t.context?t.context=n:t.pendingContext=n,(t=Ao(o,A)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),so(i,t),YA(i,o),o}function Ds(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Ps(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime=E},A=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0U(a,n))void 0!==s&&0>U(s,a)?(e[r]=s,e[A]=n,r=A):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==s&&0>U(s,n)))break e;e[r]=s,e[A]=n,r=A}}}return t}return null}function U(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var S=[],O=[],H=1,T=null,N=3,_=!1,M=!1,R=!1;function D(e){for(var t=x(O);null!==t;){if(null===t.callback)F(O);else{if(!(t.startTime<=e))break;F(O),t.sortIndex=t.expirationTime,Q(S,t)}t=x(O)}}function P(e){if(R=!1,D(e),!M)if(null!==x(S))M=!0,r(k);else{var t=x(O);null!==t&&i(P,t.startTime-e)}}function k(e,n){M=!1,R&&(R=!1,o()),_=!0;var r=N;try{for(D(n),T=x(S);null!==T&&(!(T.expirationTime>n)||e&&!a());){var A=T.callback;if(null!==A){T.callback=null,N=T.priorityLevel;var s=A(T.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?T.callback=s:T===x(S)&&F(S),D(n)}else F(S);T=x(S)}if(null!==T)var l=!0;else{var u=x(O);null!==u&&i(P,u.startTime-n),l=!1}return l}finally{T=null,N=r,_=!1}}function I(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var K=A;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){M||_||(M=!0,r(k))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return x(S)},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=K,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_scheduleCallback=function(e,n,a){var A=t.unstable_now();if("object"===typeof a&&null!==a){var s=a.delay;s="number"===typeof s&&0A?(e.sortIndex=s,Q(O,e),null===x(S)&&e===x(O)&&(R?o():R=!0,i(P,s-A))):(e.sortIndex=a,Q(S,e),M||_||(M=!0,r(k))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();D(e);var n=x(S);return n!==T&&null!==T&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var A=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(A&&s){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlphaPicker=void 0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,a.default)(t,(function(t){Array.isArray(t)?e(t).map((function(e){return n.push(e)})):(0,o.default)(t)?(0,i.default)(t,(function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)})):(0,r.default)(t)&&n.push(t)})),n};t.default=s},function(e,t,n){var r=n(29),i=n(17),o=n(22);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(36),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,A=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,A),n=e[A];try{e[A]=void 0;var r=!0}catch(s){}var i=a.call(e);return r&&(t?e[A]=n:delete e[A]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),A=a.length;A--;){var s=a[e?A:++i];if(!1===n(o[s],s,o))break}return t}}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n-1}},function(e,t,n){var r=n(49);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(48);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(48),i=n(69),o=n(70);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(67),i=n(155),o=n(20),a=n(87),A=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,u=s.toString,c=l.hasOwnProperty,f=RegExp("^"+u.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?f:A).test(a(e))}},function(e,t,n){var r=n(156),i=function(){var e=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(21)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(159),i=n(48),o=n(69);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(160),i=n(161),o=n(162),a=n(163),A=n(164);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,i.default)(e.default)||{};return t.map((function(t){var i=e[t];return i&&(0,r.default)(i,(function(e,t){n[t]||(n[t]={}),n[t]=o({},n[t],i[t])})),t})),n};t.default=A},function(e,t,n){var r=n(203);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(47),i=n(100),o=n(101),a=n(204),A=n(205),s=n(103),l=n(104),u=n(208),c=n(209),f=n(91),d=n(210),p=n(52),h=n(211),g=n(212),v=n(107),B=n(17),m=n(45),b=n(217),w=n(20),E=n(219),y=n(37),C=n(40),Q={};Q["[object Arguments]"]=Q["[object Array]"]=Q["[object ArrayBuffer]"]=Q["[object DataView]"]=Q["[object Boolean]"]=Q["[object Date]"]=Q["[object Float32Array]"]=Q["[object Float64Array]"]=Q["[object Int8Array]"]=Q["[object Int16Array]"]=Q["[object Int32Array]"]=Q["[object Map]"]=Q["[object Number]"]=Q["[object Object]"]=Q["[object RegExp]"]=Q["[object Set]"]=Q["[object String]"]=Q["[object Symbol]"]=Q["[object Uint8Array]"]=Q["[object Uint8ClampedArray]"]=Q["[object Uint16Array]"]=Q["[object Uint32Array]"]=!0,Q["[object Error]"]=Q["[object Function]"]=Q["[object WeakMap]"]=!1,e.exports=function e(t,n,x,F,U,S){var O,H=1&n,T=2&n,N=4&n;if(x&&(O=U?x(t,F,U,S):x(t)),void 0!==O)return O;if(!w(t))return t;var _=B(t);if(_){if(O=h(t),!H)return l(t,O)}else{var M=p(t),R="[object Function]"==M||"[object GeneratorFunction]"==M;if(m(t))return s(t,H);if("[object Object]"==M||"[object Arguments]"==M||R&&!U){if(O=T||R?{}:v(t),!H)return T?c(t,A(O,t)):u(t,a(O,t))}else{if(!Q[M])return U?t:{};O=g(t,M,H)}}S||(S=new r);var D=S.get(t);if(D)return D;S.set(t,O),E(t)?t.forEach((function(r){O.add(e(r,n,x,r,t,S))})):b(t)&&t.forEach((function(r,i){O.set(i,e(r,n,x,i,t,S))}));var P=_?void 0:(N?T?d:f:T?C:y)(t);return i(P||t,(function(r,i){P&&(r=t[i=r]),o(O,i,e(r,n,x,i,t,S))})),O}},function(e,t,n){var r=n(39),i=n(37);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(39),i=n(40);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(20),i=n(66),o=n(207),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var A in e)("constructor"!=A||!t&&a.call(e,A))&&n.push(A);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(39),i=n(71);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(39),i=n(105);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(92),i=n(105),o=n(40);e.exports=function(e){return r(e,o,i)}},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(74),i=n(213),o=n(214),a=n(215),A=n(106);e.exports=function(e,t,n){var s=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return A(e,n);case"[object Map]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return o(e);case"[object Set]":return new s;case"[object Symbol]":return a(e)}}},function(e,t,n){var r=n(74);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(36),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},function(e,t,n){var r=n(20),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(218),i=n(64),o=n(65),a=o&&o.isMap,A=a?i(a):r;e.exports=A},function(e,t,n){var r=n(52),i=n(22);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(220),i=n(64),o=n(65),a=o&&o.isSet,A=a?i(a):r;e.exports=A},function(e,t,n){var r=n(52),i=n(22);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autoprefix=void 0;var r,i=n(58),o=(r=i)&&r.__esModule?r:{default:r},a=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,l;A(this,r);for(var u=arguments.length,c=Array(u),f=0;f1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var n,o,l;A(this,r);for(var u=arguments.length,c=Array(u),f=0;f1&&void 0!==arguments[1])||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2===0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Alpha=void 0;var r=Object.assign||function(e){for(var t=1;ta?1:Math.round(100*u/a)/100,t.a!==c)return{h:t.h,s:t.s,l:t.l,a:c,source:"rgb"}}else{var f=void 0;if(r!==(f=l<0?0:l>o?1:Math.round(100*l/o)/100))return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={},i=t.render=function(e,t,n,r){if("undefined"===typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null};t.get=function(e,t,n,o){var a=e+"-"+t+"-"+n+(o?"-server":"");if(r[a])return r[a];var A=i(e,t,n,o);return r[a]=A,A}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditableInput=void 0;var r=function(){function e(e,t){for(var n=0;n-1)){var i=n.getArrowOffset(),o=38===e.keyCode?r+i:r-i;n.setUpdatedValue(o,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value===this.state.value||e.value===this.props.value&&t.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,a.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return o.default.createElement("div",{style:t.wrap},o.default.createElement("input",{style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?o.default.createElement("span",{style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(i.PureComponent||i.Component);t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hue=void 0;var r=function(){function e(e,t){for(var n=0;no)u=0;else{u=360*(-100*l/o+100)/100}if(n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var c=void 0;if(s<0)c=0;else if(s>i)c=359;else{c=360*(100*s/i)/100}if(n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Raised=void 0;var r=A(n(1)),i=A(n(18)),o=A(n(7)),a=A(n(19));function A(e){return e&&e.__esModule?e:{default:e}}var s=t.Raised=function(e){var t=e.zDepth,n=e.radius,i=e.background,A=e.children,s=e.styles,l=void 0===s?{}:s,u=(0,o.default)((0,a.default)({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:n,background:i}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},l),{"zDepth-1":1===t});return r.default.createElement("div",{style:u.wrap},r.default.createElement("div",{style:u.bg}),r.default.createElement("div",{style:u.content},A))};s.propTypes={background:i.default.string,zDepth:i.default.oneOf([0,1,2,3,4,5]),radius:i.default.number,styles:i.default.object},s.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}},t.default=s},function(e,t,n){"use strict";var r=n(233);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r=n(47),i=n(108),o=n(81),a=n(235),A=n(20),s=n(40),l=n(109);e.exports=function e(t,n,u,c,f){t!==n&&o(n,(function(o,s){if(f||(f=new r),A(o))a(t,n,s,u,e,c,f);else{var d=c?c(l(t,s),o,s+"",t,n,f):void 0;void 0===d&&(d=o),i(t,s,d)}}),s)}},function(e,t,n){var r=n(108),i=n(103),o=n(106),a=n(104),A=n(107),s=n(59),l=n(17),u=n(236),c=n(45),f=n(67),d=n(20),p=n(85),h=n(62),g=n(109),v=n(237);e.exports=function(e,t,n,B,m,b,w){var E=g(e,n),y=g(t,n),C=w.get(y);if(C)r(e,n,C);else{var Q=b?b(E,y,n+"",e,t,w):void 0,x=void 0===Q;if(x){var F=l(y),U=!F&&c(y),S=!F&&!U&&h(y);Q=y,F||U||S?l(E)?Q=E:u(E)?Q=a(E):U?(x=!1,Q=i(y,!0)):S?(x=!1,Q=o(y,!0)):Q=[]:p(y)||s(y)?(Q=E,s(E)?Q=v(E):d(E)&&!f(E)||(Q=A(y))):x=!1}x&&(w.set(y,Q),m(Q,y,B,b,w),w.delete(y)),r(e,n,Q)}}},function(e,t,n){var r=n(32),i=n(22);e.exports=function(e){return i(e)&&r(e)}},function(e,t,n){var r=n(39),i=n(40);e.exports=function(e){return r(e,i(e))}},function(e,t,n){var r=n(239),i=n(246);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,A=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,A&&i(n[0],n[1],A)&&(a=o<3?void 0:a,o=1),t=Object(t);++r0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(38),i=n(32),o=n(61),a=n(20);e.exports=function(e,t,n){if(!a(n))return!1;var A=typeof t;return!!("number"==A?i(n)&&o(t,n.length):"string"==A&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Saturation=void 0;var r=function(){function e(e,t){for(var n=0;ni&&(s=i),l<0?l=0:l>o&&(l=o);var u=s/i,c=1-l/o;return{h:t.h,s:u,v:c,a:t.a,source:"hsv"}}},function(e,t,n){e.exports=n(253)},function(e,t,n){var r=n(100),i=n(99),o=n(84),a=n(17);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},function(e,t,n){var r;!function(i){var o=/^\s+/,a=/\s+$/,A=0,s=i.round,l=i.min,u=i.max,c=i.random;function f(e,t){if(t=t||{},(e=e||"")instanceof f)return e;if(!(this instanceof f))return new f(e,t);var n=function(e){var t={r:0,g:0,b:0},n=1,r=null,A=null,s=null,c=!1,f=!1;"string"==typeof e&&(e=function(e){e=e.replace(o,"").replace(a,"").toLowerCase();var t,n=!1;if(O[e])e=O[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=I.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=I.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=I.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=I.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=I.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=I.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=I.hex8.exec(e))return{r:M(t[1]),g:M(t[2]),b:M(t[3]),a:k(t[4]),format:n?"name":"hex8"};if(t=I.hex6.exec(e))return{r:M(t[1]),g:M(t[2]),b:M(t[3]),format:n?"name":"hex"};if(t=I.hex4.exec(e))return{r:M(t[1]+""+t[1]),g:M(t[2]+""+t[2]),b:M(t[3]+""+t[3]),a:k(t[4]+""+t[4]),format:n?"name":"hex8"};if(t=I.hex3.exec(e))return{r:M(t[1]+""+t[1]),g:M(t[2]+""+t[2]),b:M(t[3]+""+t[3]),format:n?"name":"hex"};return!1}(e));"object"==typeof e&&(K(e.r)&&K(e.g)&&K(e.b)?(d=e.r,p=e.g,h=e.b,t={r:255*N(d,255),g:255*N(p,255),b:255*N(h,255)},c=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):K(e.h)&&K(e.s)&&K(e.v)?(r=D(e.s),A=D(e.v),t=function(e,t,n){e=6*N(e,360),t=N(t,100),n=N(n,100);var r=i.floor(e),o=e-r,a=n*(1-t),A=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6;return{r:255*[n,A,a,a,s,n][l],g:255*[s,n,n,A,a,a][l],b:255*[a,a,s,n,n,A][l]}}(e.h,r,A),c=!0,f="hsv"):K(e.h)&&K(e.s)&&K(e.l)&&(r=D(e.s),s=D(e.l),t=function(e,t,n){var r,i,o;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=N(e,360),t=N(t,100),n=N(n,100),0===t)r=i=o=n;else{var A=n<.5?n*(1+t):n+t-n*t,s=2*n-A;r=a(s,A,e+1/3),i=a(s,A,e),o=a(s,A,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,s),c=!0,f="hsl"),e.hasOwnProperty("a")&&(n=e.a));var d,p,h;return n=T(n),{ok:c,format:e.format||f,r:l(255,u(t.r,0)),g:l(255,u(t.g,0)),b:l(255,u(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=s(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=s(this._r)),this._g<1&&(this._g=s(this._g)),this._b<1&&(this._b=s(this._b)),this._ok=n.ok,this._tc_id=A++}function d(e,t,n){e=N(e,255),t=N(t,255),n=N(n,255);var r,i,o=u(e,t,n),a=l(e,t,n),A=(o+a)/2;if(o==a)r=i=0;else{var s=o-a;switch(i=A>.5?s/(2-o-a):s/(o+a),o){case e:r=(t-n)/s+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(f(r));return o}function S(e,t){t=t||6;for(var n=f(e).toHsv(),r=n.h,i=n.s,o=n.v,a=[],A=1/t;t--;)a.push(f({h:r,s:i,v:o})),o=(o+A)%1;return a}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=T(e),this._roundA=s(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=d(this._r,this._g,this._b),t=s(360*e.h),n=s(100*e.s),r=s(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var o=[R(s(e).toString(16)),R(s(t).toString(16)),R(s(n).toString(16)),R(P(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:s(this._r),g:s(this._g),b:s(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+s(this._r)+", "+s(this._g)+", "+s(this._b)+")":"rgba("+s(this._r)+", "+s(this._g)+", "+s(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:s(100*N(this._r,255))+"%",g:s(100*N(this._g,255))+"%",b:s(100*N(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+s(100*N(this._r,255))+"%, "+s(100*N(this._g,255))+"%, "+s(100*N(this._b,255))+"%)":"rgba("+s(100*N(this._r,255))+"%, "+s(100*N(this._g,255))+"%, "+s(100*N(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(H[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+g(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=f(e);n="#"+g(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(v,arguments)},saturate:function(){return this._applyModification(B,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(U,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(F,arguments)},triad:function(){return this._applyCombination(Q,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},f.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:D(e[r]));e=n}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:c(),g:c(),b:c()})},f.mix=function(e,t,n){n=0===n?0:n||50;var r=f(e).toRgb(),i=f(t).toRgb(),o=n/100;return f({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},f.readability=function(e,t){var n=f(e),r=f(t);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(e,t,n){var r,i,o=f.readability(e,t);switch(i=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},f.mostReadable=function(e,t,n){var r,i,o,a,A=null,s=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var l=0;ls&&(s=r,A=f(t[l]));return f.isReadable(e,A,{level:o,size:a})||!i?A:(n.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],n))};var O=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},H=f.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(O);function T(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function N(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=l(t,u(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function _(e){return l(1,u(0,e))}function M(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function D(e){return e<=1&&(e=100*e+"%"),e}function P(e){return i.round(255*parseFloat(e)).toString(16)}function k(e){return M(e)/255}var I=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function K(e){return!!I.CSS_UNIT.exec(e)}e.exports?e.exports=f:void 0===(r=function(){return f}.call(t,n,t,e))||(e.exports=r)}(Math)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Swatch=void 0;var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){var e,t,n;s(this,r);for(var i=arguments.length,o=Array(i),a=0;a1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"===typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"===typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number((0,A.default)(e.s)?n.props.hsl.s:e.s),l:Number((0,A.default)(e.l)?n.props.hsl.l:e.l),source:"hsl"},t))},n.showHighlight=function(e){e.currentTarget.style.background="#eee"},n.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?n.state={view:"rgb"}:n.state={view:e.view},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){var e=this,t=(0,o.default)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return"hex"===this.state.view?n=i.default.createElement("div",{style:t.fields,className:"flexbox-fix"},i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?n=i.default.createElement("div",{style:t.fields,className:"flexbox-fix"},i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),i.default.createElement("div",{style:t.alpha},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(n=i.default.createElement("div",{style:t.fields,className:"flexbox-fix"},i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),i.default.createElement("div",{style:t.field},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),i.default.createElement("div",{style:t.alpha},i.default.createElement(s.EditableInput,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),i.default.createElement("div",{style:t.wrap,className:"flexbox-fix"},n,i.default.createElement("div",{style:t.toggle},i.default.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},i.default.createElement(l.default,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(i.default.Component);c.defaultProps={view:"hex"},t.default=c},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["fill","width","height","style"]);return a.default.createElement("svg",i({viewBox:"0 0 24 24",style:i({fill:n,width:o,height:s},u)},c),a.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChromePointer=void 0;var r=o(n(1)),i=o(n(7));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.ChromePointer=function(){var e=(0,i.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return r.default.createElement("div",{style:e.picker})};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChromePointerCircle=void 0;var r=o(n(1)),i=o(n(7));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.ChromePointerCircle=function(){var e=(0,i.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return r.default.createElement("div",{style:e.picker})};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Compact=void 0;var r=f(n(1)),i=f(n(18)),o=f(n(7)),a=f(n(26)),A=f(n(19)),s=f(n(23)),l=n(12),u=f(n(269)),c=f(n(270));function f(e){return e&&e.__esModule?e:{default:e}}var d=t.Compact=function(e){var t=e.onChange,n=e.onSwatchHover,i=e.colors,f=e.hex,d=e.rgb,p=e.styles,h=void 0===p?{}:p,g=e.className,v=void 0===g?"":g,B=(0,o.default)((0,A.default)({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},h)),m=function(e,n){e.hex?s.default.isValidHex(e.hex)&&t({hex:e.hex,source:"hex"},n):t(e,n)};return r.default.createElement(l.Raised,{style:B.Compact,styles:h},r.default.createElement("div",{style:B.compact,className:"compact-picker "+v},r.default.createElement("div",null,(0,a.default)(i,(function(e){return r.default.createElement(u.default,{key:e,color:e,active:e.toLowerCase()===f,onClick:m,onSwatchHover:n})})),r.default.createElement("div",{style:B.clear})),r.default.createElement(c.default,{hex:f,rgb:d,onChange:m})))};d.propTypes={colors:i.default.arrayOf(i.default.string),styles:i.default.object},d.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}},t.default=(0,l.ColorWrap)(d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactColor=void 0;var r=A(n(1)),i=A(n(7)),o=A(n(23)),a=n(12);function A(e){return e&&e.__esModule?e:{default:e}}var s=t.CompactColor=function(e){var t=e.color,n=e.onClick,A=void 0===n?function(){}:n,s=e.onSwatchHover,l=e.active,u=(0,i.default)({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:o.default.getContrastingColor(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:l,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return r.default.createElement(a.Swatch,{style:u.color,color:t,onClick:A,onHover:s,focusStyle:{boxShadow:"0 0 4px "+t}},r.default.createElement("div",{style:u.dot}))};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompactFields=void 0;var r=a(n(1)),i=a(n(7)),o=n(12);function a(e){return e&&e.__esModule?e:{default:e}}var A=t.CompactFields=function(e){var t=e.hex,n=e.rgb,a=e.onChange,A=(0,i.default)({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(e,t){e.r||e.g||e.b?a({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},t):a({hex:e.hex,source:"hex"},t)};return r.default.createElement("div",{style:A.fields,className:"flexbox-fix"},r.default.createElement("div",{style:A.active}),r.default.createElement(o.EditableInput,{style:{wrap:A.HEXwrap,input:A.HEXinput,label:A.HEXlabel},label:"hex",value:t,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"r",value:n.r,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"g",value:n.g,onChange:s}),r.default.createElement(o.EditableInput,{style:{wrap:A.RGBwrap,input:A.RGBinput,label:A.RGBlabel},label:"b",value:n.b,onChange:s}))};t.default=A},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Github=void 0;var r=u(n(1)),i=u(n(18)),o=u(n(7)),a=u(n(26)),A=u(n(19)),s=n(12),l=u(n(272));function u(e){return e&&e.__esModule?e:{default:e}}var c=t.Github=function(e){var t=e.width,n=e.colors,i=e.onChange,s=e.onSwatchHover,u=e.triangle,c=e.styles,f=void 0===c?{}:c,d=e.className,p=void 0===d?"":d,h=(0,o.default)((0,A.default)({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},f),{"hide-triangle":"hide"===u,"top-left-triangle":"top-left"===u,"top-right-triangle":"top-right"===u,"bottom-left-triangle":"bottom-left"===u,"bottom-right-triangle":"bottom-right"===u}),g=function(e,t){return i({hex:e,source:"hex"},t)};return r.default.createElement("div",{style:h.card,className:"github-picker "+p},r.default.createElement("div",{style:h.triangleShadow}),r.default.createElement("div",{style:h.triangle}),(0,a.default)(n,(function(e){return r.default.createElement(l.default,{color:e,key:e,onClick:g,onSwatchHover:s})})))};c.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),colors:i.default.arrayOf(i.default.string),triangle:i.default.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:i.default.object},c.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}},t.default=(0,s.ColorWrap)(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GithubSwatch=void 0;var r=A(n(1)),i=n(7),o=A(i),a=n(12);function A(e){return e&&e.__esModule?e:{default:e}}var s=t.GithubSwatch=function(e){var t=e.hover,n=e.color,i=e.onClick,A=e.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},l=(0,o.default)({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:t});return r.default.createElement("div",{style:l.swatch},r.default.createElement(a.Swatch,{color:n,onClick:i,onHover:A,focusStyle:s}))};t.default=(0,i.handleHover)(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HuePicker=void 0;var r=Object.assign||function(e){for(var t=1;t.5});return r.default.createElement("div",{style:n.picker})};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhotoshopPointerCircle=void 0;var r=o(n(1)),i=o(n(7));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.PhotoshopPointerCircle=function(){var e=(0,i.default)({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return r.default.createElement("div",{style:e.pointer},r.default.createElement("div",{style:e.left},r.default.createElement("div",{style:e.leftInside})),r.default.createElement("div",{style:e.right},r.default.createElement("div",{style:e.rightInside})))};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhotoshopButton=void 0;var r=o(n(1)),i=o(n(7));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.PhotoshopButton=function(e){var t=e.onClick,n=e.label,o=e.children,a=e.active,A=(0,i.default)({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:a});return r.default.createElement("div",{style:A.button,onClick:t},n||o)};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PhotoshopPreviews=void 0;var r=o(n(1)),i=o(n(7));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.PhotoshopPreviews=function(e){var t=e.rgb,n=e.currentColor,o=(0,i.default)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return r.default.createElement("div",null,r.default.createElement("div",{style:o.label},"new"),r.default.createElement("div",{style:o.swatches},r.default.createElement("div",{style:o.new}),r.default.createElement("div",{style:o.current})),r.default.createElement("div",{style:o.label},"current"))};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sketch=void 0;var r=Object.assign||function(e){for(var t=1;t100&&(e.a=100),e.a/=100,t({h:A.h,s:A.s,l:A.l,a:e.a,source:"rgb"},r))};return r.default.createElement("div",{style:u.fields,className:"flexbox-fix"},r.default.createElement("div",{style:u.double},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"hex",value:s.replace("#",""),onChange:c})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"r",value:n.r,onChange:c,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"g",value:n.g,onChange:c,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.single},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"b",value:n.b,onChange:c,dragLabel:"true",dragMax:"255"})),r.default.createElement("div",{style:u.alpha},r.default.createElement(a.EditableInput,{style:{input:u.input,label:u.label},label:"a",value:Math.round(100*n.a),onChange:c,dragLabel:"true",dragMax:"100"})))};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SketchPresetColors=void 0;var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["fill","width","height","style"]);return a.default.createElement("svg",i({viewBox:"0 0 24 24",style:i({fill:n,width:o,height:s},u)},c),a.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Twitter=void 0;var r=u(n(1)),i=u(n(18)),o=u(n(7)),a=u(n(26)),A=u(n(19)),s=u(n(23)),l=n(12);function u(e){return e&&e.__esModule?e:{default:e}}var c=t.Twitter=function(e){var t=e.onChange,n=e.onSwatchHover,i=e.hex,u=e.colors,c=e.width,f=e.triangle,d=e.styles,p=void 0===d?{}:d,h=e.className,g=void 0===h?"":h,v=(0,o.default)((0,A.default)({default:{card:{width:c,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},p),{"hide-triangle":"hide"===f,"top-left-triangle":"top-left"===f,"top-right-triangle":"top-right"===f}),B=function(e,n){s.default.isValidHex(e)&&t({hex:e,source:"hex"},n)};return r.default.createElement("div",{style:v.card,className:"twitter-picker "+g},r.default.createElement("div",{style:v.triangleShadow}),r.default.createElement("div",{style:v.triangle}),r.default.createElement("div",{style:v.body},(0,a.default)(u,(function(e,t){return r.default.createElement(l.Swatch,{key:t,color:e,hex:e,style:v.swatch,onClick:B,onHover:n,focusStyle:{boxShadow:"0 0 4px "+e}})})),r.default.createElement("div",{style:v.hash},"#"),r.default.createElement(l.EditableInput,{label:null,style:{input:v.input},value:i.replace("#",""),onChange:B}),r.default.createElement("div",{style:v.clear})))};c.propTypes={width:i.default.oneOfType([i.default.string,i.default.number]),triangle:i.default.oneOf(["hide","top-left","top-right"]),colors:i.default.arrayOf(i.default.string),styles:i.default.object},c.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}},t.default=(0,l.ColorWrap)(c)}]]);
//# sourceMappingURL=2.8e0d6703.chunk.js.map
================================================
FILE: demo/static/js/2.8e0d6703.chunk.js.LICENSE.txt
================================================
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* Programatically add the following
*/
/*!
* html2canvas 1.0.0-rc.7
* Copyright (c) 2020 Niklas von Hertzen
* Released under MIT License
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/** @license React v0.19.1
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
================================================
FILE: demo/static/js/main.4efc5ba5.chunk.js
================================================
(this["webpackJsonp@scena/react-editor"]=this["webpackJsonp@scena/react-editor"]||[]).push([[0],{11:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"f",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return l}));var r=n(1),a=["memory","eventBus","keyManager","moveableData","moveableManager","historyManager","console","getViewport","getSelecto","getEditorElement","getSelectedTargets","selectMenu","getSelectedFrames"],o="scena-",i="data-scena-element-id",c="application/x-scena-layers",s='\n@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600&display=swap");\n\n{\n position: relative;\n width: 100%;\n height: 100%;\n font-family: sans-serif;\n --mainColor: #4af;\n --back1: #1a1a1a;\n --back2: #2a2a2a;\n --back3: #333;\n --back4: #444;\n --back5: #555;\n --back6: #666;\n transform-style: preserve-3d;\n\n --menu: 45px;\n\n --tabs: 40px;\n --tab: 200px;\n}\n\n[class*="scena-"] {\n font-family: "Open Sans", sans-serif;\n}\n\n.scena-viewer {\n position: absolute !important;\n left: calc(30px + var(--menu));\n top: 30px;\n width: calc(100% - 30px - var(--menu) - var(--tabs));\n height: calc(100% - 30px);\n}\n\n.scena-viewport-container {\n position: relative;\n}\n.scena-viewport {\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n}\n.scena-viewport:before {\n content: "";\n position: absolute;\n border: 1px solid #eee;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.scena-guides {\n position: absolute !important;\n top: 0;\n left: 0;\n transform: translateZ(1px);\n}\n\n.scena-guides.scena-horizontal {\n left: calc(var(--menu) + 30px);\n width: calc(100% - 30px - var(--menu) - var(--tabs));\n height: 30px !important;\n}\n\n.scena-guides.scena-vertical {\n top: 30px;\n left: var(--menu);\n height: calc(100% - 30px);\n width: 30px !important;\n}\n\n.scena-reset {\n position: absolute !important;\n background: var(--back3);\n width: 30px;\n height: 30px;\n z-index: 1;\n border-right: 1px solid var(--back4);\n border-bottom: 1px solid var(--back4);\n box-sizing: border-box;\n cursor: pointer;\n left: var(--menu);\n top: 0px;\n}\n\n.scena-overlay {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n background: rgba(0, 0, 0, 0.2);\n}\n.moveable-dimension {\n position: absolute;\n background: var(--mainColor);\n border-radius: 2px;\n padding: 1px 3px;\n color: white;\n font-size: 13px;\n white-space: nowrap;\n font-weight: bold;\n will-change: transform;\n transform: translate(-50%) translateZ(0px);\n}\n.scena-frame-tab {\n overflow: auto;\n max-height: 300px;\n}\n\n.scena-overlay {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 100;\n transform-style: preserve-3d;\n transform: translateZ(15px);\n background: rgba(0, 0, 0, 0.2);\n}\n\n.scena-popup {\n position: absolute;\n max-width: 600px;\n width: 80%;\n max-height: 1000px;\n padding: 30px;\n height: 80%;\n overflow: auto;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n font-size: 14px;\n background: var(--back3);\n box-sizing: border-box;\n color: #fff;\n}\n.scena-popup h2 {\n padding: 0;\n margin: 0;\n padding: 4px;\n}\n.scena-popup .scena-close {\n position: absolute;\n top: 30px;\n right: 30px;\n width: 40px;\n height: 40px;\n cursor: pointer;\n}\n.scena-popup .scena-close:before, .scena-popup .scena-close:after {\n content: "";\n position: absolute;\n width: 30px;\n height: 1px;\n background: #ddd;\n top: 50%;\n left: 50%;\n}\n.scena-popup .scena-close:hover:before, .scena-popup .scena-close:hover:after {\n height: 2px;\n background: #fff;\n border-radius: 1px;\n}\n.scena-popup .scena-close:before {\n transform: translate(-50%, -50%) rotate(45deg);\n}\n.scena-popup .scena-close:after {\n transform: translate(-50%, -50%) rotate(-45deg);\n}\n.scena-popup ul {\n list-style: none;\n padding: 0;\n}\n.scena-popup li {\n padding: 4px 10px;\n border-bottom: 1px solid var(--back2);\n font-weight: bold;;\n}\n.scena-popup li:hover {\n background: #fff;\n color: var(--back2);\n}\n.scena-popup p {\n position: relative;\n padding: 2px 0px;\n}\n.scena-popup strong {\n position: absolute;\n right: 0;\n text-transform: uppercase;\n}\n.scena-popup strong span {\n display: inline-block;\n padding: 2px 4px;\n border: 1px solid #fff;\n vertical-align: top;\n margin: 0px 5px;\n}\n\n.scena-align {\n position: relative;\n width: 25px;\n height: 25px;\n /* background: #f55; */\n display: inline-block;\n margin-right: 5px;\n}\n.scena-align:hover {\n cursor: pointer;\n}\n.scena-align:hover * {\n background: white;\n}\n.scena-align-line,\n.scena-align-element1,\n.scena-align-element2 {\n position: absolute;\n left: 50%;\n top: 50%;\n background: var(--back6);\n transform: translate(-50%, -50%);\n}\n.scena-align-vertical .scena-align-line {\n width: 1px;\n height: 18px;\n}\n.scena-align-vertical .scena-align-element1 {\n width: 10px;\n height: 5px;\n margin-top: -3.5px;\n}\n.scena-align-vertical .scena-align-element2 {\n width: 14px;\n height: 5px;\n margin-top: 3.5px;\n}\n.scena-align-vertical.scena-align-start .scena-align-line {\n margin-left: -7px;\n}\n.scena-align-vertical.scena-align-start .scena-align-element1 {\n margin-left: -2px;\n}\n\n.scena-align-vertical.scena-align-end .scena-align-line {\n margin-left: 7px;\n}\n.scena-align-vertical.scena-align-end .scena-align-element1 {\n margin-left: 2px;\n}\n\n\n\n.scena-align-horizontal .scena-align-line {\n height: 1px;\n width: 18px;\n}\n.scena-align-horizontal .scena-align-element1 {\n height: 10px;\n width: 5px;\n margin-left: -3.5px;\n}\n.scena-align-horizontal .scena-align-element2 {\n height: 14px;\n width: 5px;\n margin-left: 3.5px;\n}\n.scena-align-horizontal.scena-align-start .scena-align-line {\n margin-top: -7px;\n}\n.scena-align-horizontal.scena-align-start .scena-align-element1 {\n margin-top: -2px;\n}\n\n.scena-align-horizontal.scena-align-end .scena-align-line {\n margin-top: 7px;\n}\n.scena-align-horizontal.scena-align-end .scena-align-element1 {\n margin-top: 2px;\n}\n',l=Object(r.createContext)(null)},113:function(e,t){},116:function(e,t,n){"use strict";n.d(t,"a",(function(){return Et}));var r=n(27),a=n.n(r),o=n(42),i=n(3),c=n(4),s=n(41),l=n(6),u=n(5),p=n(14),d=n(1),f=n(118),h=n(77),g=n(117),v=n(9),m=n(2),b=n(0),y=n(11);var k,x,O,j,E,w=(k=y.d,x=y.c,function(e){var t=e.prototype;e.contextType=k,x.forEach((function(e){Object.defineProperty(t,e,{get:function(){return this.context[e]},set:function(){this.context[e](e)}})}))}),C=w((E=j=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;osvg path,\n.scena-icon.scena-selected>svg ellipse,\n.scena-sub-icon.scena-selected path,\n.scena-sub-icon.scena-selected ellipse {\n fill: #fff;\n stroke: #fff;\n}\n\n.scena-icon .scena-extends-icon {\n position: absolute;\n right: 2px;\n bottom: 2px;\n border-bottom: 5px solid #eee;\n border-right: 0;\n border-left: 5px solid transparent;\n}\n\n.scena-extends-container {\n position: absolute;\n left: 110%;\n top: -30px;\n background: var(--back2);\n /* width: 200px;\n height: 200px; */\n border-radius: 5px;\n z-index: 1;\n transform: translate(10px) translateZ(2px);\n box-shadow: 1px 1px 2px var(--back1);\n display: none;\n}\n\n.scena-sub-icon {\n white-space: nowrap;\n padding: 0px 7px;\n margin: 7px 10px;\n}\n\n.scena-sub-icon .scena-icon {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n width: 25px;\n height: 25px;\n margin: 0;\n}\n\n.scena-sub-icon-label {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n color: white;\n font-size: 14px;\n font-weight: bold;\n padding: 0;\n margin: 0;\n margin-left: 5px;\n}\n\n\n.scena-keyboard {\n background: #fff;\n border-radius: 3px;\n width: 90%;\n height: 15px;\n margin: 3px 0px 7px;\n text-align: center;\n box-sizing: border-box;\n padding: 2px;\n}\n\n.scena-key {\n display: inline-block;\n width: 2px;\n height: 2px;\n background: var(--back2);\n margin: 1px;\n}\n.scena-space {\n display: inline-block;\n width: 12px;\n height: 2px;\n background: var(--back2);\n margin: 1px;\n border-radius: 1px;\n}\n"),K=[S,I,D,T,z,M],X=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o0&&void 0!==arguments[0]?arguments[0]:this.ids;;){var t="scena".concat(Math.floor(1e8*Math.random()));if(!e[t])return t}}},{key:"setInfo",value:function(e,t){this.ids[e]=t}},{key:"getInfo",value:function(e){return this.ids[e]}},{key:"getLastChildInfo",value:function(e){var t=this.getInfo(e).children;return t[t.length-1]}},{key:"getNextInfo",value:function(e){var t=this.getInfo(e),n=this.getInfo(t.scopeId).children,r=n.indexOf(t);return n[r+1]}},{key:"getPrevInfo",value:function(e){var t=this.getInfo(e),n=this.getInfo(t.scopeId).children,r=n.indexOf(t);return n[r-1]}},{key:"getInfoByElement",value:function(e){return this.ids[Object(m.e)(e)]}},{key:"getInfoByIndexes",value:function(e){return e.reduce((function(e,t){return e.children[t]}),this.viewport)}},{key:"getElement",value:function(e){var t=this.getInfo(e);return t?t.el:null}},{key:"getViewportInfos",value:function(){return this.viewport.children}},{key:"getIndexes",value:function(e){var t=Object(b.L)(e)?this.getInfo(e):this.getInfoByElement(e);if(!t.scopeId)return[];var n=this.getInfo(t.scopeId);return[].concat(Object(J.a)(this.getIndexes(t.scopeId)),[n.children.indexOf(t)])}},{key:"registerChildren",value:function(e,t){var n=this;return e.map((function(e){var r=e.id||n.makeId(),a=e.jsx,o=e.children||[],i=t||e.scopeId||"viewport",c="";Object(m.j)(a)&&(c=n.makeId(n.jsxs),n.jsxs[c]=a);var s=Object(p.a)(Object(p.a)({},e),{},{jsx:a,children:n.registerChildren(o,r),scopeId:i,componentId:"",jsxId:c,frame:e.frame||{},el:null,id:r});return n.setInfo(r,s),s}))}},{key:"appendJSXs",value:function(e,t,n){var r=this,a=this.registerChildren(e,n);return a.forEach((function(e,a){var o=r.getInfo(n||e.scopeId).children;t>-1?(o.splice(t+a,0,e),e.index=t+a):Object(b.J)(e.index)?o.splice(e.index,0,e):(e.index=o.length,o.push(e))})),new Promise((function(e){r.forceUpdate((function(){e({added:Object(m.p)(a)})}))}))}},{key:"getIndex",value:function(e){var t=this.getIndexes(e),n=t.length;return n?t[n-1]:-1}},{key:"getElements",value:function(e){var t=this;return e.map((function(e){return t.getElement(e)})).filter((function(e){return e}))}},{key:"unregisterChildren",value:function(e,t){var n=this,r=this.ids;return e.slice(0).map((function(e){var a=e.el,o="",i="";if(e.attrs.contenteditable?o=a.innerText:i=a.innerHTML,!t){var c=n.getInfo(e.scopeId),s=c.children.indexOf(e);c.children.splice(s,1)}var l=n.unregisterChildren(e.children,!0);return delete r[e.id],delete e.el,Object(p.a)(Object(p.a)({},e),{},{innerText:o,innerHTML:i,attrs:Object(m.i)(a),children:l})}))}},{key:"removeTargets",value:function(e){var t=this,n=this.getSortedTargets(e).map((function(e){return t.getInfoByElement(e)})).filter((function(e){return e})),r=n.map((function(e){return t.getIndex(e.id)})),a=this.unregisterChildren(n);return a.forEach((function(e,t){e.index=r[t]})),new Promise((function(e){t.forceUpdate((function(){e({removed:a})}))}))}},{key:"getSortedIndexesList",value:function(e){var t=this,n=e.map((function(e){return Array.isArray(e)?e:t.getIndexes(e)}));return n.sort((function(e,t){for(var n=e.length,r=t.length,a=Math.min(n,r),o=0;o-1?c.splice(s,1):c.push(n):c=[n],o(c)}else o([n])},e.onDragStart=function(t){if(Object(b.G)(t.inputEvent.target,Object(m.n)("fold-icon")))return t.stop(),!1;var n=e.folderRef.current.getElement().getBoundingClientRect(),r=t.datas,a=t.clientX-n.left;r.offsetX=a,r.folderRect=n,r.folderLine=n.left+n.width-10,r.objMap=e.flatMap(),t.inputEvent.preventDefault(),t.inputEvent.stopPropagation()},e.onDrag=function(t){var n=e.folderRef.current.getElement(),r=t.clientX,a=t.clientY,o=t.datas;e.clearPointers(),o.prevInfo=null,o.isTop=!1;var i=e.props.selected,c=o.objMap;if(!o.dragFirst){o.dragFirst=!0;var s=fe(t.inputEvent.target);if(s&&-1===i.indexOf(s.getAttribute("data-file-key")))return void e.onClick({currentTarget:s})}if(i&&i.length){var l=i.map((function(e){return c[e]}));if(e.state.shadows.length){e.updateShadowPosition(o.folderRect,t);var u=fe(document.elementFromPoint(o.folderLine,t.clientY));if(u){var p=e.flatChildren(),d=u.getBoundingClientRect(),f=d.top+d.height/2>a,h=u.getAttribute("data-file-key"),g=Object(b.A)(p,(function(e){return e.fullId===h})),v=p[g],y=p[g-1];if(y&&f){if(v=p[--g],y=p[g-1],h=v.fullId,!(u=n.querySelector('[data-file-key="'.concat(h,'"]'))))return;d=u.getBoundingClientRect(),f=!1}var k=p[g+1],x=v.depth,O=k?k.depth:0,j=[Math.min(O,x)-x,Math.max(x+1,O)-x],E=r-d.left,w=f?0:Object(m.a)(Math.round((E>0?.2*E:E)/10),j[0],j[1]);if(!(k&&!f&&i.indexOf(k.fullId)>-1&&x+w===O)&&!e.contains(i,h)&&!(i.indexOf(h)>-1&&w>=0)){var C=e.props,S=C.isMoveChildren,I=C.checkMove;if(S){var M=v.scope,T=[].concat(Object(J.a)(v.scope),[v.id]);if(l.every((function(e){return e.scope.every((function(e,t){return e===M[t]}))})))w=0;else{if(!l.every((function(e){return e.scope.every((function(e,t){return e===T[t]}))})))return;w=1}}else w>0&&!I(v)&&(w=0);u.style.setProperty("--pointer-depth","".concat(w)),u.classList.add(Object(m.n)(f?"top-pointer":"bottom-pointer")),o.depth=w,o.isTop=f,o.prevInfo=v}}}else e.setState({shadows:l},(function(){e.updateShadowPosition(o.folderRect,t)}))}},e.onDragEnd=function(t){if(e.clearPointers(),t.isDrag){var n,r=t.datas,a=r.depth,o=r.prevInfo,i=r.isTop,c=e.props.onMove,s=r.objMap,l=(e.props.selected||[]).map((function(e){return s[e]}));if(o)if(a<=0){for(var u=Math.abs(a),p=0;p-1}},{key:"render",value:function(){var e=this.props,t=e.scope,n=e.name,r=e.getFullId,a=t.length?r(t[t.length-1],t.slice(0,-1)):"";return d.createElement(de,{className:Object(m.n)("folder"),ref:this.folderRef},n&&d.createElement("div",{className:Object(m.n)("file",this.isSelected(a)?"selected":""),"data-file-key":a,onClick:this.onClick},d.createElement("div",{className:Object(m.n)("fold-icon",this.state.fold?"fold":""),onClick:this.onClickFold}),d.createElement("h3",null,n)),d.createElement("div",{className:Object(m.n)("properties")},this.renderProperties()),this.renderShadows())}},{key:"componentDidMount",value:function(){if(this.props.isMove){var e=this.folderRef.current.getElement();this.moveGesto=new pe.a(e,{container:window,checkInput:!0}).on("dragStart",this.onDragStart).on("drag",this.onDrag).on("dragEnd",this.onDragEnd)}}},{key:"componentWillUnmount",value:function(){this.moveGesto&&this.moveGesto.unset()}},{key:"renderProperties",value:function(){var e=this,t=this.props,r=t.scope,a=t.properties,o=t.selected,i=t.multiselect,c=t.onSelect,s=t.getFullId,l=t.FileComponent,u=t.isMove,p=t.getId,f=t.getName,h=t.getChildren;if(!this.state.fold)return Object.keys(a).map((function(t){var g=a[t],v=f(g,t),y=r.slice(),k=p(g,t),x=s(k,y);y.push(k);var O=h(g,t,r);return O&&(Object(b.H)(O)?O.length:Object(b.K)(O))?d.createElement(n,{key:x,name:v,scope:y,properties:O,multiselect:i,getId:p,getName:f,getFullId:s,getChildren:h,selected:o,onSelect:u?void 0:c,FileComponent:l}):d.createElement("div",{key:x,className:Object(m.n)("file",e.isSelected(x)?"selected":""),"data-file-key":x,onClick:u?void 0:e.onClick},d.createElement(l,{scope:y,name:v,value:g,fullId:x}))}))}},{key:"renderShadows",value:function(){var e=this.props,t=e.FileComponent,n=e.getName;if(!e.scope.length)return d.createElement("div",{className:Object(m.n)("shadows"),ref:this.shadowRef},this.state.shadows.map((function(e){var r=e.scope,a=e.value,o=e.fullId,i=e.id,c=n(a,i);return d.createElement("div",{key:o,className:Object(m.n)("file","selected","shadow")},d.createElement(t,{scope:r,name:c,value:a,fullId:o}))})))}},{key:"updateShadowPosition",value:function(e,t){var n=this.shadowRef.current;if(n&&this.state.shadows.length){var r=t.datas;n.style.cssText="display: block; transform: translate(".concat(t.clientX-e.left-r.offsetX,"px, ").concat(t.clientY-e.top,"px) translateY(-50%)")}}},{key:"contains",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.flatMap(),r=n[t],a=r.parentId;return!!a&&(e.indexOf(a)>-1||this.contains(e,a,n))}},{key:"flatMap",value:function(){var e=this.flatChildren(),t={};return e.forEach((function(e){t[e.fullId]=e})),t}},{key:"flatChildren",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.properties,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Object.keys(t),i=this.props,c=i.getFullId,s=i.getId,l=i.getChildren,u=r.length;return o.forEach((function(o){var i=t[o],p=r.slice(),d=s(i,o),f=c(d,p);p.push(d);var h=l(i,o,r);a.push({id:d,fullId:f,parentId:n,depth:u,scope:r,value:i}),h&&(Object(b.H)(h)?h.length:Object(b.K)(h))&&e.flatChildren(h,f,p,a)})),a}},{key:"clearPointers",value:function(){[].slice.call(document.querySelectorAll(".scena-top-pointer, .scena-bottom-pointer")).forEach((function(e){var t=e.classList;t.remove(Object(m.n)("top-pointer")),t.remove(Object(m.n)("bottom-pointer"))}))}}]),n}(d.PureComponent);he.defaultProps={selected:[],onMove:function(){},checkMove:function(){return!0},onSelect:function(){},getFullId:function(e,t){return[].concat(Object(J.a)(t),[e]).join("///")},getId:function(e,t,n){return t},getName:function(e,t){return t},getChildren:function(e){return e}};var ge=Object(v.a)("div","\n{\n position: relative;\n box-sizing: border-box;\n padding: 2px;\n display: inline-block;\n vertical-align: top;\n}\nh3 {\n color: white;\n margin: 0;\n padding: 7px 5px;\n font-size: 12px;\n font-weight: bold;\n display: inline-block;\n}\n:host.scena-full {\n width: 100%;\n}\n:host.scena-half {\n width: 50%;\n}\n:host.scena-third {\n width: 33%;\n}\n:host.scena-twothird {\n width: 66%;\n}\n:host.scena-half:nth-child(2n + 1) {\n padding-right: 5px;\n}\n:host.scena-half:nth-child(2n + 2) {\n padding-left: 5px;\n}\n"),ve=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.type;return d.createElement(ge,{className:Object(m.n)("label",n)},d.createElement("h3",null,t))}}]),n}(d.PureComponent),me=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return n}(d.PureComponent),be=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},r=this.eventMap;cancelAnimationFrame(r[e]||0),r[e]=requestAnimationFrame((function(){t.trigger(e,n)}))}}]),n}(n(15).a),Ye=function(){function e(){Object(i.a)(this,e),this.map=new Map}return Object(c.a)(e,[{key:"get",value:function(e){return this.map.get(e)}},{key:"set",value:function(e,t){return this.map.set(e,t)}},{key:"clear",value:function(){this.map.clear()}}]),e}(),_e=n(31),Qe=n(44),$e={name:"dimensionViewable",props:{dimensionViewable:Boolean},events:{},render:function(e){var t=e.props.zoom,n=e.getRect();return d.createElement("div",{key:"dimension-viewer",className:"moveable-dimension",style:{left:"".concat(n.width/2,"px"),top:"".concat(n.height,"px"),transform:"translate(-50%, ".concat(20*t,"px) scale(").concat(t,")")}},Math.round(n.offsetWidth)," x ",Math.round(n.offsetHeight))}},et={name:"deleteButtonViewable",props:{deleteButtonViewable:Boolean},events:{},render:function(e,t){var n=e.getRect(),r=e.state.pos2,a=e.useCSS("div",'\n {\n position: absolute;\n left: 0px;\n top: 0px;\n will-change: transform;\n transform-origin: 0px 0px;\n width: 24px;\n height: 24px;\n background: #4af;\n background: var(--moveable-color);\n opacity: 0.9;\n border-radius: 4px;\n }\n :host:before, :host:after {\n content: "";\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) rotate(45deg);\n width: 16px;\n height: 2px;\n background: #fff;\n border-radius: 1px;\n cursor: pointer;\n }\n :host:after {\n transform: translate(-50%, -50%) rotate(-45deg);\n }\n ');return t.createElement(y.d.Consumer,{key:"delete-button-viewer"},(function(e){return t.createElement(a,{className:"moveable-delete-button",onClick:function(){e.removeElements(e.getSelectedTargets())},style:{transform:"translate(".concat(r[0],"px, ").concat(r[1],"px) rotate(").concat(n.rotation,"deg) translate(10px)")}})}))}};function tt(e,t,n,r,a){var o=a.viewport.current.getElement(e);if(!o)return console.error("No Element"),!1;var i=a.moveableData,c=i.getFrame(o);c.clear(),c.set(t),c.setOrderObject(r);var s=Object(Qe.b)(Object.keys(n),Object.keys(t)),l=s.removed,u=s.prevList;return l.forEach((function(e){o.style.removeProperty(u[e])})),i.render(o),!0}function nt(e,t){tt(e.id,e.prev,e.next,e.prevOrders,t)&&(t.moveableManager.current.updateRect(),t.eventBus.trigger("render"))}function rt(e,t){var n=e.id,r=e.prev;tt(n,e.next,r,e.nextOrders,t)&&(t.moveableManager.current.updateRect(),t.eventBus.trigger("render"))}function at(e,t){e.infos.forEach((function(e){tt(e.id,e.prev,e.next,e.prevOrders,t)})),t.moveableManager.current.updateRect(),t.eventBus.trigger("render")}function ot(e,t){e.infos.forEach((function(e){tt(e.id,e.next,e.prev,e.nextOrders,t)})),t.moveableManager.current.updateRect(),t.eventBus.trigger("render")}var it=w(We=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o1||u,rotatable:!0,snappable:!0,snapCenter:!0,snapGap:!1,isDisplayInnerSnapDigit:!0,roundable:!0,verticalGuidelines:n,horizontalGuidelines:r,elementGuidelines:l,clipArea:!0,clipVerticalGuidelines:[0,"50%","100%"],clipHorizontalGuidelines:[0,"50%","100%"],clipTargetBounds:!0,onBeforeRenderStart:c.onBeforeRenderStart,onBeforeRenderGroupStart:c.onBeforeRenderGroupStart,onDragStart:c.onDragStart,onDrag:c.onDrag,onDragGroupStart:c.onDragGroupStart,onDragGroup:c.onDragGroup,onScaleStart:c.onScaleStart,onScale:c.onScale,onScaleGroupStart:c.onScaleGroupStart,onScaleGroup:c.onScaleGroup,onResizeStart:c.onResizeStart,onResize:c.onResize,onResizeGroupStart:c.onResizeGroupStart,onResizeGroup:c.onResizeGroup,onRotateStart:c.onRotateStart,onRotate:c.onRotate,onRotateGroupStart:c.onRotateGroupStart,onRotateGroup:c.onRotateGroup,defaultClipPath:s.get("crop")||"inset",onClip:c.onClip,onDragOriginStart:c.onDragOriginStart,onDragOrigin:function(e){c.onDragOrigin(e)},onRound:c.onRound,onClick:function(t){var n=t.inputTarget;if(t.isDouble&&n.isContentEditable){e.selectMenu("Text");var r=Object(m.d)(n);r&&r.focus()}else e.getSelecto().clickTarget(t.inputEvent,t.inputTarget)},onClickGroup:function(t){e.getSelecto().clickTarget(t.inputEvent,t.inputTarget)},onRenderStart:function(e){e.datas.prevData=c.getFrame(e.target).get()},onRender:function(t){t.datas.isRender=!0,e.eventBus.requestTrigger("render")},onRenderEnd:function(t){e.eventBus.requestTrigger("render"),t.datas.isRender&&e.historyManager.addAction("render",{id:Object(m.e)(t.target),prev:t.datas.prevData,next:c.getFrame(t.target).get()})},onRenderGroupStart:function(e){e.datas.prevDatas=e.targets.map((function(e){return c.getFrame(e).get()}))},onRenderGroup:function(t){e.eventBus.requestTrigger("renderGroup",t),t.datas.isRender=!0},onRenderGroupEnd:function(t){if(e.eventBus.requestTrigger("renderGroup",t),t.datas.isRender){var n=t.datas.prevDatas,r=t.targets.map((function(e,t){return{id:Object(m.e)(e),prev:n[t],next:c.getFrame(e).get()}}));e.historyManager.addAction("renders",{infos:r})}}})}},{key:"renderViewportMoveable",value:function(){var e=this.moveableData,t=this.getViewport(),n=t?t.viewportRef.current:null;return d.createElement(_e.a,{ref:this.moveable,target:n,origin:!1,onRotateStart:e.onRotateStart,onRotate:e.onRotate})}},{key:"componentDidMount",value:function(){var e=this;this.historyManager.registerType("render",nt,rt),this.historyManager.registerType("renders",at,ot),this.keyManager.keydown(["shift"],(function(){e.forceUpdate()})),this.keyManager.keyup(["shift"],(function(){e.forceUpdate()}))}},{key:"updateRect",value:function(){this.getMoveable().updateRect()}}]),n}(d.PureComponent))||We,ct=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,{createAuto:!0,useBeforeRender:!0})).memory=e,r.selectedTargets=[],r}return Object(c.a)(n,[{key:"setSelectedTargets",value:function(e){this.selectedTargets=e}},{key:"getSelectedTargets",value:function(){return this.selectedTargets}},{key:"getSelectedFrames",value:function(){var e=this;return this.getSelectedTargets().map((function(t){return e.getFrame(t)}))}},{key:"renderFrames",value:function(){var e=this;this.getSelectedTargets().forEach((function(t){e.render(t)}))}},{key:"setOrders",value:function(e,t){return this.setValue((function(n){n.setOrders(e,t)}))}},{key:"setProperty",value:function(e,t){return this.setValue((function(n){n.set.apply(n,Object(J.a)(e).concat([t]))}))}},{key:"removeProperties",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t.moveable.moveables:[];return new Promise((function(a){Promise.all(e.map((function(e){return pt()(e)}))).then((function(e){var o;if(n>1){var i=t.getRect(),c=document.createElement("canvas");c.width=i.width,c.height=i.height;var s=c.getContext("2d");r.map((function(e){return e.getRect()})).forEach((function(t,n){s.drawImage(e[n],t.left-i.left,t.top-i.top)})),o=c}else o=e[0];o.toBlob((function(e){navigator.clipboard.write([new window.ClipboardItem({"image/png":e})]),a()}))}))}))}},{key:"readDataTransfter",value:function(e){if(e.types.indexOf(y.f)>-1){var t=JSON.parse(e.getData(y.f));return this.editor.console.log("paste scena data",t),this.editor.loadDatas(t),!0}return!1}},{key:"read",value:function(){var e=Object(o.a)(a.a.mark((function e(t){var n,r,o,i=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.readDataTransfter(t)){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,navigator.clipboard.read();case 4:if(n=e.sent,r=!1,n.filter((function(e){var t=e.types,n=t.indexOf("image/png")>-1;return r=r||t.indexOf("text/plain")>-1,!!n&&(e.getType("image/png").then((function(e){i.editor.appendBlob(e)})),!0)})).length>0||!r){e.next=12;break}return e.next=10,navigator.clipboard.readText();case 10:o=e.sent,this.editor.appendJSXs([{jsx:d.createElement("div",{contentEditable:"true"}),name:"(Text)",innerText:o}]);case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),ft=n(34),ht=n(8),gt=Object(v.a)("div",y.b);function vt(e,t){var n=e.infos,r=e.prevSelected,a=t.removeByIds(n.map((function(e){return e.id})),!0);r&&a.then((function(){t.setSelectedTargets(t.getViewport().getElements(r),!0)}))}function mt(e,t){var n=e.infos;t.appendJSXs(n.map((function(e){return Object(p.a)({},e)})),!0)}function bt(e,t){var n=e.prevs;e.nexts;t.setSelectedTargets(t.viewport.current.getElements(n),!0)}function yt(e,t){e.prevs;var n=e.nexts;t.setSelectedTargets(t.viewport.current.getElements(n),!0)}function kt(e,t){var n=e.prev,r=(e.next,e.id),a=t.getViewport().getInfo(r);a.innerText=n,a.el.innerText=n}function xt(e,t){e.prev;var n=e.next,r=e.id,a=t.getViewport().getInfo(r);a.innerText=n,a.el.innerText=n}function Ot(e,t){var n=e.prevInfos;t.moves(n,!0)}function jt(e,t){var n=e.nextInfos;t.moves(n,!0)}var Et=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,a=new Array(r),o=0;o-1){var r=e.get("transform",n[0]),o=Object(c.H)(r)?r:Object(c.T)(r).map((function(e){return parseFloat(e)}));e.set("transform",n[0],Object(l.d)(t,o))}else if(e.has("transform","matrix3d")){for(var i=1;e.has("transform","matrix3d".concat(++i)););e.set("transform","matrix3d".concat(i),Object(a.a)(t)),e.setOrders(["transform"],["matrix3d".concat(i)].concat(Object(a.a)(n)))}else e.set("transform","matrix3d",Object(a.a)(t)),e.setOrders(["transform"],["matrix3d"].concat(Object(a.a)(n)))}function E(e,t){var n=Object(s.b)(e,t),r=n.targetOrigin,a=Object(l.b)([r[0],r[1],r[2]||0],4);return Object(l.d)(n.offsetMatrix,a)}function w(e){return e.map((function e(t){var n=t.id,a=document.querySelector("[".concat(i.a,'="').concat(n,'"]')),o=t.attrs||{};for(var c in t.el=a,o)a.setAttribute(c,o[c]);t.attrs=y(a);var s=t.children||[];return s.length?s.forEach(e):t.attrs.contenteditable?"innerText"in t?a.innerText=t.innerText||"":t.innerText=a.innerText||"":t.componentId||("innerHTML"in t?a.innerHTML=t.innerHTML||"":t.innerHTML=a.innerHTML||""),Object(r.a)({},t)}))}},294:function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),o=n(55),i=n.n(o),c=(n(125),n(3)),s=n(4),l=n(6),u=n(5),p=(n(126),n(76)),d=Object(p.makeScenaFunctionComponent)("Badge",(function(e){return r.createElement("p",{className:"badges","data-scena-element-id":e.scenaElementId},r.createElement("a",{href:"https://www.npmjs.com/package/moveable",target:"_blank"},r.createElement("img",{src:"https://img.shields.io/npm/v/moveable.svg?style=flat-square&color=007acc&label=version",alt:"npm version"})),r.createElement("a",{href:"https://github.com/daybrush/moveable",target:"_blank"},r.createElement("img",{src:"https://img.shields.io/github/stars/daybrush/moveable.svg?color=42b883&style=flat-square"})),r.createElement("a",{href:"https://github.com/daybrush/moveable",target:"_blank"},r.createElement("img",{src:"https://img.shields.io/badge/language-typescript-blue.svg?style=flat-square"})),r.createElement("br",null),r.createElement("a",{href:"https://github.com/daybrush/moveable/tree/master/packages/react-moveable",target:"_blank"},r.createElement("img",{alt:"React",src:"https://img.shields.io/static/v1.svg?label=&message=React&style=flat-square&color=61daeb"})),r.createElement("a",{href:"https://github.com/daybrush/moveable/tree/master/packages/preact-moveable",target:"_blank"},r.createElement("img",{alt:"Preact",src:"https://img.shields.io/static/v1.svg?label=&message=Preact&style=flat-square&color=673ab8"})),r.createElement("a",{href:"https://github.com/daybrush/moveable/tree/master/packages/ngx-moveable",target:"_blank"},r.createElement("img",{alt:"Angular",src:"https://img.shields.io/static/v1.svg?label=&message=Angular&style=flat-square&color=C82B38"})),r.createElement("a",{href:"https://github.com/daybrush/moveable/blob/master/packages/vue-moveable",target:"_blank"},r.createElement("img",{alt:"Vue",src:"https://img.shields.io/static/v1.svg?label=&message=Vue&style=flat-square&color=3fb984"})),r.createElement("a",{href:"https://github.com/daybrush/moveable/tree/master/packages/svelte-moveable",target:"_blank"},r.createElement("img",{alt:"Svelte",src:"https://img.shields.io/static/v1.svg?label=&message=Svelte&style=flat-square&color=C82B38"})))})),f=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;Object(c.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i {
console.log("onDragGroupStart", targets);
}).on("dragGroup", ({ targets, events }) => {
console.log("onDragGroup", targets);
events.forEach(ev => {
// drag event
console.log("onDrag left, top", ev.left, ev.top);
// ev.target!.style.left = `${ev.left}px`;
// ev.target!.style.top = `${ev.top}px`;
console.log("onDrag translate", ev.dist);
ev.target!.style.transform = ev.transform;)
});
}).on("dragGroupEnd", ({ targets, isDrag, clientX, clientY }) => {
console.log("onDragGroupEnd", targets, isDrag);
});
/* resizable */
moveable.on("resizeGroupStart", ({ target, clientX, clientY }) => {
console.log("onResizeGroupStart", target);
}).on("resizeGroup", ({ targets, events, direction }) => {
console.log("onResizeGroup", targets);
events.forEach(ev => {
const offset = [
direction[0] < 0 ? -ev.delta[0] : 0,
direction[1] < 0 ? -ev.delta[1] : 0,
];
// ev.drag is a drag event that occurs when the group resize.
const left = offset[0] + ev.drag.beforeDist[0];
const top = offset[1] + ev.drag.beforeDist[1];
const width = ev.width;
const top = ev.top;
});
}).on("resizeGroupEnd", ({ targets, isDrag, clientX, clientY }) => {
console.log("onResizeGroupEnd", targets, isDrag);
});
/* scalable */
moveable.on("scaleGroupStart", ({ targets, clientX, clientY }) => {
console.log("onScaleGroupStart", targets);
}).on("scaleGroup", (({ targets, events }) => {
console.log("onScaleGroup", targets);
events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group scale.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const scaleX = ev.scale[0];
const scaleY = ev.scale[1];
});
}).on("scaleGroupEnd", ({ targets, isDrag, clientX, clientY }) => {
console.log("onScaleGroupEnd", targets, isDrag);
});
/* rotatable */
moveable.on("rotateGroupStart", ({ targets, clientX, clientY }) => {
console.log("onRotateGroupStart", targets);
}).on("rotateGroup", ({
targets,
events
delta, dist,
}) => {
e.events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group rotate.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const deg = ev.beforeDist;
});
}).on("rotateGroupEnd", ({ targets, isDrag, clientX, clientY }) => {
console.log("onRotateGroupEnd", targets, isDrag);
});
/* pinchable */
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
moveable.on("pinchGroupStart", ({ targets, clientX, clientY }) => {
// pinchGroupStart event occur before dragGroupStart, rotateGroupStart, scaleGroupStart, resizeGroupStart
console.log("onPinchGroupStart", targets);
}).on("pinchGroup", ({ targets, clientX, clientY, datas }) => {
// pinchGroup event occur before dragGroup, rotateGroup, scaleGroup, resizeGroup
console.log("onPinchGroup", targets);
}).on("pinchGroupEnd", ({ isDrag, targets, clientX, clientY, datas }) => {
// pinchGroupEnd event occur before dragGroupEnd, rotateGroupEnd, scaleGroupEnd, resizeGroupEnd
console.log("onPinchGroupEnd", targets);
});
```
================================================
FILE: handbook/handbook.md
================================================
# Moveable Handbook
This document explains how to use [moveable](https://github.com/daybrush/moveable).
# Table of Contents
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
* [Introduction](#toc-introduction)
* [Basic Support](#toc-support)
* [Events](#toc-events)
* [Ables](#toc-ables)
* [How to use Group](#toc-group)
* [When the event starts while changing the target](#toc-change-target)
* [How to use custom css](#toc-custom-css)
* [Show Partial ControlBox](#toc-directions)
* [Set className](#toc-classname)
* [Use important](#toc-important)
* [Moveable's Default CSS](#toc-defaultcss)
# Introduction
Moveable
Moveable makes the target draggable, resizable, scalable, warpable, rotatable, pinchable and snappable.
The reason for creating a moveable is to create an editor. Main Project is **[scenejs-editor](https://github.com/daybrush/scena)**.
Another reason for this is the [transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform).
If the transform overlaps from the root element to the parent element, the distance it moves is not equal to the amount actually moved. So I made it to calculate the distance actually moved.
# Basic Support
* Support Major Browsers
* Support SVG Elements (Not Support Resizable, Use scaleable instead of resizable.)
* Support 3d Transform
* [Support Group](#toc-group)
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
# Events
Able events are divided into `dragStart`, `drag`, and `dragEnd` types.
1. If you start to press the mouse (or touch), `dragStart`type events occur.
2. If you drag with the mouse (or touch), `drag`type events occur.
3. If dragging is stopped and the mouse (or touch) is released, `dragEnd` type events occur.
The first in the sequence of events is the event with the `beforeRender` prefix.
The last in the sequence of events is the event with the `render` prefix.
After the `render` event is over, all values such as the target's size, position, and css are updated.
### Event Sequences (ex: Draggable)
* dragStart: beforeRenderStart => **dragStart** => renderStart
* drag: beforeRender => **drag** => render
* dragEnd: beforeRenderEnd => **dragEnd** => renderEnd
## Group Events
In Moveable, events that can be targeted individually and events that can be targeted as a group are divided.
Events of a group are appended with group as a suffix. (ex: `dragGroupStart`, `dragGroup`, `dragGroupEnd`)
### Single Moveable Sequences (ex: Resizable)
* dragStart: beforeRenderStart => **resizeStart** => renderStart
* drag: beforeRender => **beforeResize** => **resize** => render
* dragEnd: beforeRenderEnd => **resizeEnd** => renderEnd
### Group Moveable Sequences (ex: Resizable)
* start: beforeRenderGroupStart => **resizeGroupStart** => renderGroupStart
* move: beforeRenderGroup => **beforeResizeGroup** => **resizeGroup** => renderGroup
* end: beforeRenderGroupEnd => **resizeGroupEnd** => renderGroupEnd
## Event Parameter
All events in moveable have the following properties by default:
See: https://daybrush.com/moveable/release/latest/doc/Moveable.html#.OnEvent
* **currentTarget**: An instance of Moveable that occur an event.
* **target**: The target of the event where the MouseEvent or TouchEvent occurred.
* **clientX**: The x coordinate where the MouseEvent or TouchEvent occurred.
* **clientY**: The y coordinate where the MouseEvent or TouchEvent occurred.
* **datas**: Information can be shared between the same event. (ex: `dragStart`, `drag`, `dragEnd`)
* **inputEvent**: MouseEvent or TouchEvent source where the event occurred.
# Ables
You can Drag, Resize, Scale, Rotate, Warp, Pinch, Snap, etc.
See all Able APIs: https://daybrush.com/moveable/release/latest/doc/index.html
See all able demos: https://daybrush.com/moveable/storybook
# How to use Group
**Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
If you want to use a group, set multiple targets(type: Array).
When using group, event name changes. (ex: dragStart => dragGroupStart, pinchStart => pinchGroupStart)
The drag event always occurs with the group event.(Resizable, Scalable, Rotatable)
In a group, Pinchable and Snappable are the same as they used to be. But warpable is not available.
# When the event starts while changing the target
### methods
* [dragStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#dragStart): You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)
* [setState](https://daybrush.com/moveable/release/latest/doc/Moveable.html#setState): You can change options or properties dynamically.
### Vanilla Exmaple
```js
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
target: document.querySelector(".target1")
});
window.addEventListener("mousedown", e => {
moveable.setState({
target: e.target,
}, () => {
moveable.dragStart(e);
});
});
```
### React, Preact Example
```tsx
import Moveable from "react-moveable"; // preact-moveable
{ this.moveable = e; }} target={this.state.target} />
onMouseDown(e) {
// Use nativeEvent if you are using react event handling
const nativeEvent = e.nativeEvent
this.setState({
target: nativeEvent.target,
}, () => {
this.moveable.dragStart(nativeEvent);
});
}
```
### Angular Example
```tsx
@Component({
selector: 'AppComponent',
template: `
`,
})
export class AppComponent {
targert = null;
@ViewChild('moveable', { static: false }) moveable;
onMouseDown(e) {
this.target = e.target;
setTimeout(() => {
this.moveable.ngDragStart(e);
});
}
}
```
### Svelte Example
```html
```
```jsx
Target1
Target2
Target3
```
# ✨ How to use custom CSS
## Show Partial Control Box
### Options
* [renderDirections](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:renderDirections) : Set directions to show the control box. (default: ["n", "nw", "ne", "s", "se", "sw", "e", "w"])
### Vanilla Example
```ts
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
});
moveable.renderDirections = ["nw", "ne", "sw", "se"];
```
## Set className
### Options
* [className](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:className) : You can specify the className of the moveable controlbox. (default: "")
### Vanilla Example
```ts
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
className: "moveable1",
});
moveable.classname = "moveable2";
```
## Use important
* If you want to custom CSS, use **`!important`**.
```css
.moveable-control {
width: 20px!important;
height: 20px!important;
margin-top: -10px!important;
margin-left: -10px!important;
}
```
## Moveable's Default CSS
### moveable-line
```css
.moveable-line {
position: absolute;
width: 1px;
height: 1px;
background: #4af;
transform-origin: 0px 0.5px;
}
```

```css
.moveable-line.moveable-rotation-line {
height: 40px;
width: 1px;
transform-origin: 0.5px 39.5px;
}
```
### moveable-control
```css
.moveable-control {
position: absolute;
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid #fff;
box-sizing: border-box;
background: #4af;
margin-top: -7px;
margin-left: -7px;
z-index: 10;
}
```

### moveable-rotataion
```css
/* moveable-rotation */
.moveable-line.moveable-rotation-line .moveable-control {
border-color: #4af;
background:#fff;
cursor: alias;
}
```
### moveable-origin
```css
.moveable-control.moveable-origin {
border-color: #f55;
background: #fff;
width: 12px;
height: 12px;
margin-top: -6px;
margin-left: -6px;
pointer-events: none;
}
```
### moveable-direction
```css
.moveable-direction.moveable-e, .moveable-direction.moveable-w {
cursor: ew-resize;
}
.moveable-direction.moveable-s, .moveable-direction.moveable-n {
cursor: ns-resize;
}
.moveable-direction.moveable-nw, .moveable-direction.moveable-se, .moveable-reverse .moveable-direction.moveable-ne, .moveable-reverse .moveable-direction.moveable-sw {
cursor: nwse-resize;
}
.moveable-direction.moveable-ne, .moveable-direction.moveable-sw, .rCSckyn7i.moveable-reverse .moveable-direction.moveable-nw, moveable-reverse .moveable-direction.moveable-se {
cursor: nesw-resize;
}
```
### Default CSS
* `rCS4nn8ek` is The hash value of the class name, which can be changed at any time.
* All classes have a prefix of `moveable-`.
```css
.rCS4nn8ek {
position: fixed;
width: 0;
height: 0;
left: 0;
top: 0;
z-index: 3000;
}
.rCS4nn8ek .moveable-control-box{
z-index: 0;
}
.rCS4nn8ek .moveable-line, .rCS4nn8ek .moveable-control{
left: 0;
top: 0;
will-change: transform;
}
.rCS4nn8ek .moveable-control{
position: absolute;
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid #fff;
box-sizing: border-box;
background: #4af;
margin-top: -7px;
margin-left: -7px;
z-index: 10;
}
.rCS4nn8ek .moveable-line{
position: absolute;
width: 1px;
height: 1px;
background: #4af;
transform-origin: 0px 0.5px;
}
.rCS4nn8ek .moveable-line.moveable-dashed{
box-sizing: border-box;
background: transparent;
}
.rCS4nn8ek .moveable-line.moveable-dashed.moveable-horizontal{
border-top: 1px dashed #4af;
}
.rCS4nn8ek .moveable-line.moveable-dashed.moveable-vertical{
border-left: 1px dashed #4af;
}
.rCS4nn8ek .moveable-line.moveable-dashed:before{
position: absolute;
content: attr(data-size);
color: #4af;
font-size: 12px;
font-weight: bold;
}
.rCS4nn8ek .moveable-line.moveable-dashed.moveable-horizontal:before{
left: 50%;
transform: translateX(-50%);
bottom: 5px;
}
.rCS4nn8ek .moveable-line.moveable-dashed.moveable-vertical:before{
top: 50%;
transform: translateY(-50%);
left: 5px;
}
.rCS4nn8ek .moveable-line.moveable-rotation-line{
height: 40px;
width: 1px;
transform-origin: 0.5px 39.5px;
top: -40px;
}
.rCS4nn8ek .moveable-line.moveable-rotation-line .moveable-control{
border-color: #4af;
background:#fff;
cursor: alias;
}
.rCS4nn8ek .moveable-line.moveable-vertical{
transform: translateX(-50%);
}
.rCS4nn8ek .moveable-line.moveable-horizontal{
transform: translateY(-50%);
}
.rCS4nn8ek .moveable-line.moveable-vertical.moveable-bold{
width: 2px;
}
.rCS4nn8ek .moveable-line.moveable-horizontal.moveable-bold{
height: 2px;
}
.rCS4nn8ek .moveable-control.moveable-origin{
border-color: #f55;
background: #fff;
width: 12px;
height: 12px;
margin-top: -6px;
margin-left: -6px;
pointer-events: none;
}
.rCS4nn8ek .moveable-group{
z-index: -1;
}
.rCS4nn8ek .moveable-area{
position: absolute;
}
.rCS4nn8ek .moveable-area-pieces{
position: absolute;
top: 0;
left: 0;
display: none;
}
.rCS4nn8ek .moveable-area.moveable-avoid{
pointer-events: none;
}
.rCS4nn8ek .moveable-area.moveable-avoid+.moveable-area-pieces{
display: block;
}
.rCS4nn8ek .moveable-area-piece{
position: absolute;
}
```
================================================
FILE: jsdoc.json
================================================
{
"plugins": [
"node_modules/daybrush-jsdoc-template/plugins/croffle",
"node_modules/daybrush-jsdoc-template/plugins/story"
],
"recurseDepth": 10,
"opts": {
"template": "./node_modules/daybrush-jsdoc-template",
"destination": "./doc/"
},
"source": {
"include": [
"README.md",
"packages/moveable/src",
"packages/react-moveable/src/InitialMoveable.tsx",
"packages/react-moveable/src/MoveableGroup.tsx",
"packages/react-moveable/src/ables",
"packages/react-moveable/src/MoveableManager.tsx",
"packages/react-moveable/src/types.ts",
"node_modules/@scena/event-emitter/src"
],
"includePattern": "(.+\\.js(doc|x)?|.+\\.ts(doc|x)?)$",
"excludePattern": "(^|\\/|\\\\)_"
},
"sourceType": "module",
"tags": {
"allowUnknownTags": true,
"dictionaries": [
"jsdoc",
"closure"
]
},
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
"default": {
"staticFiles": {
"include": [
"./static"
]
}
}
},
"linkMap": {
"IObject": "http://daybrush.com/utils/release/latest/doc/global.html#ObjectInterface",
"DragScrollOptions": "https://daybrush.com/dragscroll/release/latest/doc/global.html#DragScrollOptions"
},
"storybookUrl": "https://daybrush.com/moveable/storybook",
"docdash": {
"repo": "daybrush/moveable",
"menu": {
"Github repo": {
"href": "https://github.com/daybrush/moveable",
"target": "_blank",
"class": "menu-item",
"id": "repository"
}
}
}
}
================================================
FILE: lerna.json
================================================
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*",
"packages/ngx-moveable/projects/ngx-moveable"
],
"version": "independent",
"lernaHelperOptions": {
"deployFileMap": [
{
"basePath": "packages/moveable/dist",
"dists": [
"demo/release/{{version}}/dist",
"demo/release/latest/dist"
]
},
{
"basePath": "packages/helper/dist",
"dists": [
"demo/helper/release/{{version}}/dist",
"demo/helper/release/latest/dist"
]
},
{
"basePath": "doc",
"dists": [
"demo/release/{{version}}/doc",
"demo/release/latest/doc"
]
}
],
"beforeReleaseScripts": [
"npm run packages:build",
"npm run demo:build",
"npm run deploy"
]
}
}
================================================
FILE: package.json
================================================
{
"name": "moveable-root",
"version": "0.30.0",
"private": true,
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"groupable",
"movable",
"warpable",
"pinchable",
"snappable",
"clippable",
"roundable",
"border",
"origin",
"dom",
"resize",
"scale",
"drag",
"move",
"warp",
"rotate",
"react",
"preact",
"throttle",
"group",
"pinchi",
"snap"
],
"repository": {
"type": "git",
"url": "git+https://github.com/daybrush/moveable.git"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable/",
"scripts": {
"bootstrap": "lerna bootstrap",
"storybook": "npm run storybook --prefix ./packages/react-moveable",
"bake": "npm run bake --prefix ./packages/react-moveable",
"build": "npm run build --prefix ./packages/react-moveable",
"packages:update": "lerna-helper version && yarn && npm run update-type-consts",
"update-type-consts": "node ./config/update-type-consts.js",
"packages:build": "npm run build --prefix packages/react-moveable && npm run update-type-consts && lerna run build --ignore ngx-moveable --ignore moveable-storybook --ignore snappable --ignore react-moveable",
"packages:publish": "lerna-helper publish --ignore ngx-moveable,@moveable/helper --commit 'chore: publish packages'",
"changelog": "lerna-helper changelog --type all --base moveable",
"doc": "rm -rf ./doc && jsdoc -c jsdoc.json",
"build:storybook": "npm run build:storybook --prefix ./packages/react-moveable",
"demo:build": "npm run packages:build && npm run doc && npm run build:storybook",
"demo:deploy": "gh-pages -d ./demo --dest=./ --add --remote origin",
"deploy": "lerna-helper deploy --base moveable",
"release": "lerna-helper release --base moveable"
},
"dependencies": {
"tslib": "^2.3.1"
},
"devDependencies": {
"@daybrush/jsdoc": "^0.4.7",
"@daybrush/release": "^0.7.1",
"cpx": "1.5.0",
"daybrush-jsdoc-template": "^1.10.0",
"gh-pages": "^2.0.1",
"intercept-stdout": "0.1.2",
"lerna": "^4.0.0",
"lerna-changelog": "2.2.0",
"typescript": "^4.8 <4.9"
},
"workspaces": {
"packages": [
"packages/*",
"packages/ngx-moveable/projects/ngx-moveable"
],
"nohoist": [
"**/vue-tsc",
"**/vue-tsc/**",
"**/@vue/*",
"**/@vue/*/**",
"**/vue",
"**/vue/**",
"**/rollup-plugin-vue",
"**/rollup-plugin-vue/**",
"**/jest",
"**/jest/**",
"**/jest-util",
"**/jest-util/**",
"**/ts-jest",
"**/ts-jest/**"
]
},
"resolutions": {
"@daybrush/utils": "^1.13.0",
"@types/react": "^16.9.17",
"typescript": "^4.8 <4.9",
"@storybook/react": "^6.4.22",
"@storybook/addon-actions": "^6.4.22",
"@storybook/addon-controls": "^6.4.22",
"@storybook/addon-docs": "^6.4.22",
"@storybook/addon-links": "^6.4.22",
"@storybook/addon-viewport": "^6.4.22",
"@storybook/addons": "^6.4.22",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@egjs/list-differ": "^1.0.0",
"@scena/dragscroll": "^1.4.0",
"@scena/matrix": "^1.1.1",
"css-to-mat": "^1.1.1",
"framework-utils": "^1.1.0",
"gesto": "^1.19.3",
"overlap-area": "^1.1.0",
"croact-css-styled": "^1.1.9",
"react-css-styled": "^1.1.9",
"tslib": "^2.3.1"
}
}
================================================
FILE: packages/croact-moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.9.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.8.0...croact-moveable@0.9.0) (2023-12-03)
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
* update gesto version ([4d12e48](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/4d12e484ea08bc1630c6a301b86c34a5d7a023c2))
## [0.8.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.7.2...croact-moveable@0.8.0) (2023-10-28)
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.7.2](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.7.1...croact-moveable@0.7.2) (2023-09-19)
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.7.1](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.7.0...croact-moveable@0.7.1) (2023-07-11)
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.7.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.6.2...croact-moveable@0.7.0) (2023-07-09)
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.6.2](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.6.1...croact-moveable@0.6.2) (2023-07-04)
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.6.1](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.5.1...croact-moveable@0.6.1) (2023-07-02)
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.5.1](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.5.0...croact-moveable@0.5.1) (2023-06-28)
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.5.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.4.0...croact-moveable@0.5.0) (2023-06-25)
### :bug: Bug Fix
* fix croact peerDependencies #937 ([6554cc7](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/6554cc7828a5ed5f883d0f9bc35ecd913795dd84))
### :mega: Other
* publish packages ([f893cca](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.4.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.3.8...croact-moveable@0.4.0) (2023-06-04)
### :rocket: New Features
* support drag api #920 ([8f1a839](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/8f1a8396c429cf108da5417bc36cccd3ef46013c))
### :bug: Bug Fix
* fix ownerDocument css #932 ([76a852a](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/76a852ade3ffb41a1b246649945994f50e52b1f0))
* support iframe #932 ([15abedb](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/15abedb5f5770b8380d0b6ebedbc4ab7834cb9e8))
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
## [0.3.8](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.3.7...croact-moveable@0.3.8) (2023-05-16)
### :bug: Bug Fix
* fix css-styled version #916 ([875fc19](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/875fc19fa7fac50cbbb3166dfaa512b18f7c790d))
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.3.7](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.3.6...croact-moveable@0.3.7) (2023-05-15)
### :bug: Bug Fix
* update croact, css-styled version #916 ([b517b64](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/b517b6498a612c072eadc9354d6383363771ea6d))
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.3.6](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.3.5...croact-moveable@0.3.6) (2023-05-09)
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.3.5](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.3.0...croact-moveable@0.3.5) (2023-05-08)
### :rocket: New Features
* update croact version #902 ([e328e21](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/e328e2170438fe27f60f307ae976183fbfb5e96e))
### :bug: Bug Fix
* fix dragFocusedInput #896 ([94cb92d](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/94cb92d239846ef7a45c0ea2f4ceec0ec2e3b4ac))
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.3.0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.2.1...croact-moveable@0.3.0) (2023-05-01)
### :rocket: New Features
* add dragFocusedInput prop #896 ([a29c9de](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/a29c9de3d9371a3cd7406432dcdd437168d42fdb))
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
* update croact 1.0.1 #902 ([34433f3](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/34433f3ab1266fff29f1f74bf6a5176d238348b6))
## [0.2.1](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/compare/croact-moveable@0.2.0...croact-moveable@0.2.1) (2023-04-16)
### :bug: Bug Fix
* fix pinchable's operation #892 ([f4d8df3](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/f4d8df3f81f69f0c00e2b865e6f3368ee9795b01))
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## 0.2.0 (2023-04-13)
### :rocket: New Features
* add croact ([b94c41c](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/b94c41c50cdf37da0136bd4d04f2237529253f45))
* add croact compat ([233c6d0](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/233c6d0a905953b51c3fd5df1f7c58e7b1d03432))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/blob/master/packages/croact-moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.33.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.32.4...react-compat-moveable@0.33.0) (2023-03-26)
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.32.4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.32.3...react-compat-moveable@0.32.4) (2023-03-21)
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.32.3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.32.2...react-compat-moveable@0.32.3) (2023-03-14)
### :mega: Other
* update packages ([5b03d09](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.32.2](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.32.0...react-compat-moveable@0.32.2) (2023-03-10)
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
* update packages #856 #847 ([a78c8e3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/a78c8e3c7ff8c3eb347a7617ddc76c807b57633e))
## [0.32.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.31.1...react-compat-moveable@0.32.0) (2023-03-08)
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
## [0.31.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.30.2...react-compat-moveable@0.31.1) (2023-01-29)
### :rocket: New Features
* add isTrusted event property ([256c40c](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/256c40cf2a51277af5414a9bab07be321a586157))
* add scrollOptions #841 ([a6dfc21](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/a6dfc2152ef9a06c6714c219b3ea057f0b6b8504))
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.30.2](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.30.1...react-compat-moveable@0.30.2) (2022-12-16)
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.30.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.29.1...react-compat-moveable@0.30.1) (2022-12-10)
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.29.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.29.0...react-compat-moveable@0.29.1) (2022-12-05)
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.29.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.28.1...react-compat-moveable@0.29.0) (2022-12-03)
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.28.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.28.0...react-compat-moveable@0.28.1) (2022-11-28)
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
## [0.28.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.27.0...react-compat-moveable@0.28.0) (2022-11-27)
### :rocket: New Features
* add isFirstDrag property on drag event #796 ([7ade6a2](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/7ade6a23e9003d9ed4119a035ccad01b01c13ed7))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
## [0.27.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.26.1...react-compat-moveable@0.27.0) (2022-11-13)
### :bug: Bug Fix
* update gesto, dragscroll dependencies ([0f33358](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/0f333589574f509d1e3058b77ec9df6b18d7fee6))
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.26.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.26.0...react-compat-moveable@0.26.1) (2022-11-06)
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.26.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.25.0...react-compat-moveable@0.26.0) (2022-11-04)
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
* update packages #760 ([5c77cf3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/5c77cf3986fa319a170d8bd90b6cd720601b5172))
## [0.25.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.24.4...react-compat-moveable@0.25.0) (2022-10-17)
### :rocket: New Features
* add `viewContainer` prop #753 ([352073c](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/352073c5c5c765aca707236abdff9dded7988343))
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
* update packages ([61730d5](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/61730d5c143d4027c55a714c764efe77bbebe5bf))
## [0.24.4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.24.1...react-compat-moveable@0.24.4) (2022-10-10)
### :bug: Bug Fix
* fix click event #746 ([41809c1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/41809c10646b91586f74332b74ad2f83ab9a4b2d))
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.24.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.24.0...react-compat-moveable@0.24.1) (2022-09-19)
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.24.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.23.4...react-compat-moveable@0.24.0) (2022-09-15)
### :bug: Bug Fix
* fix shadow dom css #729 ([7581afc](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/7581afc13a7c5f9f749b22d7bd3160de0972d112))
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.23.4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.23.3...react-compat-moveable@0.23.4) (2022-08-24)
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.23.3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.23.1...react-compat-moveable@0.23.3) (2022-08-23)
### :mega: Other
* fix cjs configs ([ce8cbb1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/ce8cbb18563e34234f7e9d83a0b3f024870314a8))
* publish packages ([3597bc5](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.23.1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.23.0...react-compat-moveable@0.23.1) (2022-08-12)
### :bug: Bug Fix
* export event-emitter ([937d83e](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/937d83e221d7080abdb699bc088eff9ca89caaa4))
* fix click event for mobile #720 ([ce6bced](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/ce6bced55ca6e32981215ebd91a57fe04a789f4e))
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.23.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.22.3...react-compat-moveable@0.23.0) (2022-08-06)
### :bug: Bug Fix
* prevent click when drag & click control #713 ([2071c0d](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/2071c0dd68503d920fe9c26e53ec8c17627bee2b))
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.22.3](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.22.2...react-compat-moveable@0.22.3) (2022-08-03)
### :bug: Bug Fix
* fix click event by gesto update #713 ([3a3c762](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/3a3c762fc20cf682c3d8fda21f28244a3ecf36bd))
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.22.2](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.21.0...react-compat-moveable@0.22.2) (2022-08-01)
### :rocket: New Features
* add preventClickEventOnDrag prop ([281b2b7](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/281b2b7aa5dba3bdc4c3f478e115a0de8fd2359e))
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.21.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.20.0...react-compat-moveable@0.21.0) (2022-07-25)
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
* update dragscroll module version ([e9b5864](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/e9b5864c83853578c4190e792543019e30b017eb))
## [0.20.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.19.2...react-compat-moveable@0.20.0) (2022-07-21)
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
* update `react-compat-moveable` ([712ae6f](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/712ae6fb49dec3f4e40a3cd664f63625d7cd5669))
## [0.19.2](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.19.0...react-compat-moveable@0.19.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.19.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.18.0...react-compat-moveable@0.19.0) (2022-07-17)
### :bug: Bug Fix
* fix floating point for min limit size ([766561c](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/766561c0e785098720c5a0ae6d9da1e2d9d7b879))
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
* update overlap-area ([be8c4dc](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/be8c4dc19dbd6d6d7f782c73272cb9878ca21982))
## [0.18.0](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.9...react-compat-moveable@0.18.0) (2022-06-09)
### :bug: Bug Fix
* prevent wheel drag #674 ([e9bea04](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/e9bea04aec00bd3a2a06918b539c9b02b2a589d5))
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.17.9](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.8...react-compat-moveable@0.17.9) (2022-06-07)
### :bug: Bug Fix
* fix minSize for zero size ([c34f298](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/c34f29803a487098f36f45991ea6dff03bd2750a))
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* publish packages ([3530f05](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
## [0.17.8](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.6...react-compat-moveable@0.17.8) (2022-05-01)
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.17.6](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.5...react-compat-moveable@0.17.6) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.17.5](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.4...react-compat-moveable@0.17.5) (2022-04-27)
### :bug: Bug Fix
* fix rollup config #650 ([72c9f99](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/72c9f99a2d82ebdbc9de6a99ea6ede817a2c1773))
* fix rollup config #650 ([b8d1bc7](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/b8d1bc79ff484e57fcdec43f25c043d8d9b7e7df))
### :mega: Other
* update packages versions ([5cd2398](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/5cd2398dbb4dbbda24032641fe5bf111780b75fc))
## [0.17.4](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/compare/react-compat-moveable@0.17.3...react-compat-moveable@0.17.4) (2022-04-26)
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
* upgrade storybook and typescript ([eff23fd](https://github.com/daybrush/moveable/blob/master/packages/react-compat-moveable/commit/eff23fd7340964ed0e3e6f5930e56558c4d91d18))
================================================
FILE: packages/croact-moveable/LICENSE
================================================
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: packages/croact-moveable/README.md
================================================
================================================
FILE: packages/croact-moveable/package.json
================================================
{
"name": "croact-moveable",
"version": "0.9.0",
"description": "A React Compat Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Pinchable, Groupable, Snappable.",
"main": "./dist/moveable.cjs.js",
"module": "./dist/moveable.esm.js",
"sideEffects": false,
"types": "declaration/index.d.ts",
"scripts": {
"start": "open ./demo/index.html && rollup -c rollup.config.demo.js -w",
"build": "rollup -c && npm run declaration && print-sizes ./dist ",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json",
"packages:update": "pvu --path=../../ --update=./",
"packages:dist": "npm run build && pvu --path=./ --distUpdate=../../ --distPaths=declaration,dist"
},
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"groupable",
"movable",
"warpable",
"pinchable",
"snappable",
"throttle",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"warp",
"react",
"pinch",
"snap",
"compat"
],
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/croact-moveable"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"devDependencies": {
"@daybrush/builder": "^0.2.4",
"@types/react": "^16.9.17",
"croact": "^1.0.4",
"keycon": "^0.3.0",
"print-sizes": "^0.2.0",
"pvu": "^0.6.1",
"rollup-plugin-css-bundle": "^1.0.4",
"rollup-plugin-react-compat": "^0.1.1",
"typescript": "^4.8 <4.9"
},
"peerDependencies": {
"croact": "^1.0.4"
},
"dependencies": {
"@daybrush/utils": "^1.13.0",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@egjs/list-differ": "^1.0.0",
"@scena/dragscroll": "^1.4.0",
"@scena/event-emitter": "^1.0.5",
"@scena/matrix": "^1.1.1",
"croact-css-styled": "^1.1.9",
"css-to-mat": "^1.1.1",
"framework-utils": "^1.1.0",
"gesto": "^1.19.3",
"overlap-area": "^1.1.0",
"react-css-styled": "^1.1.9",
"react-moveable": "~0.56.0"
}
}
================================================
FILE: packages/croact-moveable/rollup.config.js
================================================
const builder = require("@daybrush/builder");
const reactCompat = require("rollup-plugin-react-compat");
const external = {
"croact": "croact",
"croact-ruler": "croact-ruler",
"croact-css-styled": "croact-css-styled",
"@daybrush/utils": "utils",
"css-styled": "css-styled",
"framework-utils": "framework-utils",
"gesto": "Gesto",
"@scena/event-emitter": "@scena/event-emitter",
"@egjs/agent": "eg.Agent",
"@egjs/children-differ": "eg.ChildrenDiffer",
"@moveable/matrix": "@moveable/matrix",
"@scena/dragscroll": "@scena/dragscroll",
"css-to-mat": "css-to-mat",
"overlap-area": "overlap-area",
"@scena/matrix": "@scena/matrix",
"@egjs/list-differ": "eg.ListDiffer",
};
const reactPlugin = reactCompat({
useCroact: true,
aliasModules: {
"@scena/react-ruler": "croact-ruler",
"react-css-styled": "croact-css-styled",
}
})
module.exports = builder([
{
sourcemap: false,
input: "src/index.ts",
output: "./dist/moveable.esm.js",
exports: "named",
format: "es",
plugins: [reactPlugin],
external,
typescript2: true,
},
{
sourcemap: false,
input: "src/index.umd.ts",
output: "./dist/moveable.cjs.js",
exports: "named",
plugins: [reactPlugin],
format: "cjs",
external,
typescript2: true,
},
]);
================================================
FILE: packages/croact-moveable/src/index.ts
================================================
import Moveable from "react-moveable";
export default Moveable;
export * from "react-moveable";
================================================
FILE: packages/croact-moveable/src/index.umd.ts
================================================
import Moveable, * as modules from "./index";
for (const name in modules) {
(Moveable as any)[name] = (modules as any)[name];
}
module.exports = Moveable;
export * from "./index";
export default Moveable;
================================================
FILE: packages/croact-moveable/tsconfig.declaration.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"removeComments": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "declaration"
}
}
================================================
FILE: packages/croact-moveable/tsconfig.json
================================================
{
"compilerOptions": {
"outDir": "./outjs/",
"esModuleInterop": false,
"sourceMap": true,
"module": "es2015",
"target": "es5",
"experimentalDecorators": true,
"skipLibCheck": true,
"moduleResolution": "node",
"lib": [
"es2015",
"dom"
],
},
"include": [
"./src/**/*.ts"
]
}
================================================
FILE: packages/croact-moveable/tslint.json
================================================
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"rules": {
"typedef": [true, "parameter"],
"jsdoc-format": false,
"forin": false,
"no-console": false,
"no-any": false,
"interface-name": false,
"indent": [
true,
"spaces",
4
],
"ordered-imports": false,
"object-literal-sort-keys": false,
"no-unused-expression": false,
"arrow-parens": [
true,
"ban-single-arg-parens"
],
"max-line-length": [
true,
{
"limit": 120,
"ignore-pattern": "(\\* @)|//"
}
],
"trailing-comma": [
true,
{
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "always",
"typeLiterals": "ignore"
},
"esSpecCompliant": true
}
]
}
}
================================================
FILE: packages/helper/.eslintignore
================================================
node_modules
dist
*.js
================================================
FILE: packages/helper/.eslintrc
================================================
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"rules": {
"no-console": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"import/no-webpack-loader-syntax": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": false
}
],
"@typescript-eslint/no-unused-vars": [
"error"
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/indent": [
"error",
4
],
"@typescript-eslint/adjacent-overload-signatures": "off",
"max-len": [
"error",
{
"code": 120,
"comments": 400,
"ignoreTemplateLiterals": true,
"ignorePattern": "^\\s*type\\s.+=\\s*"
}
],
"arrow-parens": "off",
"no-empty-interface": "off",
"comma-dangle": [
"error",
"always-multiline"
],
"semi": [
"error",
"always"
]
}
}
================================================
FILE: packages/helper/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: packages/helper/.npmignore
================================================
node_modules/
*.DS_Store
.DS_Store
doc/
template/
example/
karma.conf.js
test/
mocha.opts
Gruntfile.js
webpack.*.js
.travis.yml
packages
release/
demo/
coverage/
dist/report.html
rollup-plugin-visualizer/
outjs/
.scene_cache
*.mp3
*.mp4
storybook/
src/
public/
groupable.md
test/
src/
public/
stories/
.storybook
================================================
FILE: packages/helper/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-12-03)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-10-28)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-09-19)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-07-11)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-07-09)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-07-04)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.3...@moveable/helper@0.1.3) (2023-07-02)
**Note:** Version bump only for package @moveable/helper
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.3) (2023-06-28)
### :rocket: New Features
* add group, ungroup in helper ([8434ed1](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/8434ed19853a158739b3e9b936d63825c6824c96))
### :bug: Bug Fix
* fix helper rollup config ([c8ee6a7](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/c8ee6a7b78f7bbb4606b997d1fdae2ebc2d8ff21))
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* Release 0.49.0 ([9300af7](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/9300af7b4297f6dfe9160aee87a1b810490c2753))
## [0.1.3](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.3) (2023-06-25)
### :rocket: New Features
* add group, ungroup in helper ([8434ed1](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/8434ed19853a158739b3e9b936d63825c6824c96))
### :bug: Bug Fix
* fix helper rollup config ([c8ee6a7](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/c8ee6a7b78f7bbb4606b997d1fdae2ebc2d8ff21))
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-06-04)
### :bug: Bug Fix
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-05-16)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-05-15)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-05-09)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-05-08)
### :bug: Bug Fix
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-05-01)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-04-16)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-04-13)
### :bug: Bug Fix
* fix warpSelf ([8c86a3f](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/8c86a3f95e5d0b8832b1d9b65bf72f598eb8d0cb))
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-03-26)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-03-21)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-03-14)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-03-10)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.2...@moveable/helper@0.1.2) (2023-03-08)
**Note:** Version bump only for package @moveable/helper
## [0.1.2](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.1.0...@moveable/helper@0.1.2) (2023-01-29)
### :bug: Bug Fix
* fix selectCompletedChilds ([1274030](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/127403091afe221411dd8c2fa4ba072638bf0688))
* fix TargetList ([008116c](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/008116cd0b6624b95c179a6eeed3e897de6e488c))
## [0.1.0](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.1.0) (2022-12-16)
### :bug: Bug Fix
* fix helper's methods ([4bc6ef5](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/4bc6ef511f7652966e1a87cd7d0a53e6687a1707))
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-12-10)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-12-05)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-12-03)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-11-28)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-11-27)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-11-13)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-11-06)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-11-04)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-10-17)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-10-10)
**Note:** Version bump only for package @moveable/helper
## [0.0.4](https://github.com/daybrush/moveable/blob/master/packages/helper/compare/@moveable/helper@0.0.4...@moveable/helper@0.0.4) (2022-09-19)
**Note:** Version bump only for package @moveable/helper
## 0.0.4 (2022-09-15)
### :rocket: New Features
* add helper package ([0ade16e](https://github.com/daybrush/moveable/blob/master/packages/helper/commit/0ade16e9f0dd3adfe41a0ea92d2eb4a81d5aaade))
================================================
FILE: packages/helper/global.d.ts
================================================
declare module "!!raw-loader!*" {
const content: string;
export default content;
}
declare module "*.svg" {
const content: string;
export default content;
}
================================================
FILE: packages/helper/jest.config.js
================================================
module.exports = {
"roots": [
"",
],
"transform": {
"^.+\\.tsx?$": "ts-jest",
},
"testMatch": ["/test/**/*.spec.ts"],
// "testRegex": "spec\\.ts$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node",
],
};
================================================
FILE: packages/helper/package.json
================================================
{
"name": "@moveable/helper",
"version": "0.1.3",
"description": "Helper for demo of Moveable",
"main": "./dist/helper.cjs.js",
"module": "./dist/helper.esm.js",
"sideEffects": false,
"types": "declaration/index.d.ts",
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*"
],
"scripts": {
"lint": "eslint ./src/ --ext .ts,.tsx",
"start": "rollup -c -w",
"build": "npm run lint && rollup -c && npm run declaration && print-sizes ./dist ",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json",
"test": "jest --watchAll"
},
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"warpable",
"pinchable",
"groupable",
"snappable",
"scrollable",
"movable",
"throttle",
"scroll",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"react",
"warp",
"snap",
"pinch"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/helper"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"devDependencies": {
"@babel/core": "^7.7.2",
"@daybrush/builder": "^0.2.4",
"@daybrush/tester": "^0.1.3",
"@types/node": "^14.6.0",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"babel-loader": "^8.0.6",
"css-loader": "^5.0.1",
"gh-pages": "^2.1.1",
"jest": "^24.8.0",
"ts-jest": "^24.0.2",
"keycon": "^1.0.0",
"print-sizes": "^0.2.0",
"pvu": "^0.6.1",
"raw-loader": "^4.0.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"tslib": "^2.3.1",
"typescript": "^4.8 <4.9"
},
"dependencies": {
"@daybrush/utils": "^1.13.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
================================================
FILE: packages/helper/rollup.config.js
================================================
const builder = require("@daybrush/builder");
const defaultOptions = {
typescript2: true,
tsconfig: "tsconfig.build.json",
};
module.exports = builder([
{
...defaultOptions,
input: "src/index.ts",
output: "./dist/helper.esm.js",
visualizer: true,
format: "es",
exports: "named",
},
{
...defaultOptions,
input: "src/index.cjs.ts",
output: "./dist/helper.cjs.js",
format: "cjs",
exports: "named",
},
{
...defaultOptions,
input: "src/index.umd.ts",
output: "./dist/helper.js",
format: "umd",
exports: "default",
resolve: true,
name: "MoveableHelper",
},
{
...defaultOptions,
input: "src/index.umd.ts",
output: "./dist/helper.min.js",
format: "umd",
exports: "default",
resolve: true,
uglify: true,
name: "MoveableHelper",
},
]);
================================================
FILE: packages/helper/src/GroupManager.ts
================================================
/* eslint-disable no-cond-assign */
import { deepFlat, isArray } from "@daybrush/utils";
import { ArrayChild, SingleChild } from "./groups";
import { GroupChild, TargetGroupsObject, TargetGroupsType, TargetList } from "./types";
export function toTargetList(raw: GroupChild[]): TargetList {
function targets(childs: GroupChild[] = []) {
const arr: TargetGroupsType = [];
childs.forEach((child) => {
if (child.type === "single") {
arr.push(child.value);
} else {
arr.push(targets(child.value));
}
});
return arr;
}
return {
raw: () => raw,
targets() {
return targets(this.raw());
},
flatten() {
return deepFlat(this.targets());
},
};
}
export class GroupManager extends ArrayChild {
public type = "root" as const;
private _targets: Array = [];
constructor(
targetGroups: TargetGroupsType,
targets?: Array,
) {
super();
this.set(targetGroups, targets);
}
public set(
targetGroups: TargetGroupsObject,
targets: Array = [],
) {
this.map = new Map();
this.value = [];
const map = this.map;
const value = this.value;
this.add(targetGroups);
targets.forEach(target => {
if (map.has(target)) {
return;
}
const single = new SingleChild(this, target);
single.depth = 1;
value.push(single);
map.set(target, single);
});
this._targets = targets;
}
public selectSubChilds(targets: TargetGroupsType, target: HTMLElement | SVGElement) {
const root = this;
const nextChild = root.findNextChild(target, targets, false);
const targetChild = root.map.get(target);
let nextChilds: GroupChild[] = [];
if (nextChild) {
nextChilds = [nextChild];
} else if (targetChild) {
nextChilds = [targetChild];
} else {
nextChilds = [];
}
return toTargetList(nextChilds);
}
public selectSingleChilds(
targets: TargetGroupsType,
added: Array,
removed: Array,
) {
const nextTargets = [...targets];
// group can't be added, removed.
removed.forEach(element => {
const index = nextTargets.indexOf(element);
if (index > -1) {
nextTargets.splice(index, 1);
}
});
// Targets can be added one by one
added.forEach(element => {
nextTargets.push(element);
});
return toTargetList(this.toChilds(nextTargets));
}
public selectCompletedChilds(
targets: TargetGroupsType,
added: Array,
removed: Array,
continueSelect?: boolean,
) {
const nextTargets = [...targets];
const startSelected = deepFlat(nextTargets);
// group can be added, removed.
removed.forEach(element => {
// Single Target
const index = nextTargets.indexOf(element);
if (index > -1) {
// single target or group
nextTargets.splice(index, 1);
return;
}
// Group Target
const removedChild = continueSelect
// Finds the nearest child for element and nextTargets.
? this.findNextChild(element, nextTargets)
// Find the nearest exact child for element, all removed and nextTargets.
: this.findNextExactChild(element, removed, nextTargets);
if (removedChild) {
const groupIndex = nextTargets.findIndex(target => {
return isArray(target) && removedChild.compare(target);
});
if (groupIndex > -1) {
nextTargets.splice(groupIndex, 1);
}
}
});
added.forEach(element => {
const parentGroup = this._findParentGroup(element, startSelected);
const nextChild = parentGroup.findContainedChild(element);
if (nextChild?.type === "group") {
const singleChild = nextChild.getSingleChild();
if (singleChild) {
nextTargets.push(singleChild.value);
} else {
nextTargets.push(nextChild.toTargetGroups());
}
return;
}
nextTargets.push(element);
});
return toTargetList(this.toChilds(nextTargets));
}
public selectSameDepthChilds(
targets: TargetGroupsType,
added: Array,
removed: Array,
continueSelect?: boolean,
) {
const nextTargets = [...targets];
const commonParent = this.findCommonParent(nextTargets);
removed.forEach(element => {
// Single Target
const index = nextTargets.indexOf(element);
if (index > -1) {
// single target or group
nextTargets.splice(index, 1);
return;
}
const removedChild = continueSelect
// Find the nearest exact child for element, all removed and nextTargets.
? commonParent.findNextExactChild(element, removed, nextTargets)
// Finds the nearest child for element and nextTargets.
: commonParent.findNextChild(element, nextTargets, true);
if (removedChild) {
const groupIndex = nextTargets.findIndex(target => {
return isArray(target) && removedChild.compare(target);
});
if (groupIndex > -1) {
nextTargets.splice(groupIndex, 1);
}
}
});
const addedChildren = commonParent.groupByPerfect(added);
addedChildren.forEach(child => {
if (child.type === "single") {
nextTargets.push(child.value);
} else {
const groupIndex = nextTargets.findIndex(target => {
return isArray(target) && child.compare(target, 1);
});
if (groupIndex > -1) {
nextTargets.splice(groupIndex, 1);
}
nextTargets.push(child.toTargetGroups());
}
});
return toTargetList(this.toChilds(nextTargets));
}
public toChilds(targets: TargetGroupsType): GroupChild[] {
const childs: GroupChild[] = [];
targets.forEach(target => {
if (isArray(target)) {
const arrayChild = this.findArrayChild(target);
if (arrayChild) {
const singleChild = arrayChild.getSingleChild();
if (singleChild) {
return singleChild;
}
childs.push(arrayChild);
}
} else {
const single = this.map.get(target);
if (single) {
childs.push(single);
} else {
childs.push(new SingleChild(this, target));
}
}
});
return childs;
}
public findChild(element: HTMLElement | SVGElement, isAuto: true): SingleChild | ArrayChild;
public findChild(
element: HTMLElement | SVGElement,
isAuto?: boolean,
): SingleChild | ArrayChild | undefined;
public findChild(
element: HTMLElement | SVGElement,
isAuto?: boolean,
): SingleChild | ArrayChild | undefined {
const value = this.map.get(element);
if (isAuto) {
return value || new SingleChild(this, element);
}
return value;
}
public findArrayChildById(id: string): ArrayChild | null {
let value: ArrayChild | null = null;
this.value.some(function find(child: GroupChild) {
if (child.type !== "single") {
if (child.id === id) {
value = child;
return true;
} else {
return child.value.some(find);
}
}
});
return value;
}
public group(targets: TargetGroupsType, flatten?: boolean): TargetGroupsType | null {
const commonParent = this.findCommonParent(targets);
const groupChilds = targets.map(target => {
if (isArray(target)) {
return this.findArrayChild(target);
}
return this.findChild(target);
});
const isGroupable = groupChilds.every(child => child?.parent === commonParent);
if (!isGroupable) {
return null;
}
const group = new ArrayChild(commonParent);
const nextChilds = commonParent.value.filter(target => groupChilds.indexOf(target) === -1);
if (!nextChilds.length) {
return null;
}
nextChilds.unshift(group);
group.add(flatten ? deepFlat(targets) : targets);
commonParent.value = nextChilds;
this.set(this.toTargetGroups(), this._targets);
return group.toTargetGroups();
}
public ungroup(targets: TargetGroupsType) {
if (targets.length === 1 && isArray(targets[0])) {
targets = targets[0];
}
const commonParent = this.findCommonParent(targets);
const groupChilds = targets.map(target => {
if (isArray(target)) {
return this.findArrayChild(target);
}
return this.findChild(target);
});
if (commonParent.groupElement) {
return null;
}
// all children is targets
const isGroupable = commonParent.value.every(child => groupChilds.indexOf(child) > -1);
if (!isGroupable || commonParent === this) {
// has no group
return null;
}
const parent = commonParent.parent;
if (!parent) {
return null;
}
const nextChilds = parent.value.filter(target => target !== commonParent);
nextChilds.push(...commonParent.value);
parent.value = nextChilds;
this.set(this.toTargetGroups(), this._targets);
return commonParent.toTargetGroups();
}
protected _findParentGroup(
element: HTMLElement | SVGElement,
range: Array,
) {
if (!range.length) {
return this;
}
const single = this.map.get(element);
if (!single) {
return this;
}
let parent: ArrayChild | undefined = single.parent;
while (parent) {
if (range.some(element => parent!.contains(element))) {
return parent;
}
parent = parent.parent;
}
return this;
}
}
================================================
FILE: packages/helper/src/groups.ts
================================================
import { isArray, deepFlat, find } from "@daybrush/utils";
import { GroupChild, TargetGroupsObject, TargetGroupsType } from "./types";
export class Child {
public type: "group" | "root" | "single" = "single";
public depth = 0;
protected _scope: string[] = [];
constructor(public parent?: ArrayChild) {
if (parent) {
this.depth = parent.depth + 1;
}
}
public get scope(): string[] {
const parent = this.parent;
if (!parent || parent.type === "root") {
return [];
}
return [...parent.scope, parent.id];
}
}
export class SingleChild extends Child {
public type = "single" as const;
public isGroupElement = false;
constructor(parent: ArrayChild, public value: HTMLElement | SVGElement) {
super(parent);
}
}
export class ArrayChild extends Child {
public type: "group" | "root" = "group";
public value: GroupChild[] = [];
public id = "";
public groupElement?: HTMLElement | SVGElement | null = null;
public map: Map = new Map();
public compare(groups: TargetGroupsType, checker: -1 | 0 | 1 = 0) {
const elements = deepFlat(groups);
const map = this.map;
const elementsLength = elements.length;
const mapSize = map.size;
const sizeDiff = mapSize - elementsLength;
// 1 this > groups
// 0 this = groups
// -1 this < groups
const count = elements.filter(element => map.has(element)).length;
if ((checker > 0 && sizeDiff >= 0) || (checker === 0 && sizeDiff === 0)) {
return elementsLength === count;
} else if (checker < 0 && sizeDiff <= 0) {
return mapSize === count;
}
return false;
}
public has(target: HTMLElement | SVGElement) {
return this.map.has(target);
}
public contains(element: HTMLElement | SVGElement): boolean {
if (this.has(element)) {
return true;
}
return this.value.some(child => {
if (child.type === "group") {
return child.contains(element);
} else {
return false;
}
});
}
public findContainedChild(element: HTMLElement | SVGElement) {
return find(this.value, child => {
if (child.type === "single") {
return child.value === element;
} else {
return child.contains(element);
}
});
}
/**
* Exact group containing targets
*/
public findExactChild(target: TargetGroupsType[0]): GroupChild | undefined {
const map = this.map;
if (!isArray(target)) {
return map.get(target);
}
const flatted = deepFlat(target);
const length = flatted.length;
const single = map.get(flatted[0]);
if (!single) {
return;
}
let parent: ArrayChild | undefined = single.parent;
while (parent) {
if (parent.map.size >= length) {
return parent;
}
parent = parent.parent;
}
return;
}
public findCommonParent(targets: TargetGroupsType): ArrayChild {
let depth = Infinity;
let childs = targets.map(target => this.findExactChild(target));
childs.forEach(child => {
if (!child) {
return;
}
depth = Math.min(child.depth, depth);
});
while (depth) {
--depth;
childs = childs.map(child => {
let parent: GroupChild | undefined = child;
while (parent && parent.depth !== depth) {
parent = parent.parent;
}
return parent;
});
const firstChild = childs.find(child => child);
if (!firstChild) {
return this;
}
if (childs.every(child => !child || child === firstChild)) {
break;
}
}
const commonParent = childs.find(child => child) as ArrayChild;
return commonParent || this;
}
public findNextChild(
target: HTMLElement | SVGElement,
range: TargetGroupsType = this.toTargetGroups(),
isExact = true,
): ArrayChild | null {
let nextChild: ArrayChild | null = null;
const length = range.length;
range.some(child => {
if (!isExact && length === 1 && isArray(child)) {
nextChild = this.findNextChild(target, child);
return nextChild;
}
const nextGroupChild = this.findExactChild(child);
if (!nextGroupChild) {
return;
}
if ("map" in nextGroupChild) {
if (nextGroupChild.map.has(target)) {
nextChild = nextGroupChild;
return true;
}
}
});
return nextChild;
}
public findNextExactChild(
target: HTMLElement | SVGElement,
selected: Array,
range: TargetGroupsType = this.toTargetGroups(),
): ArrayChild | null {
// [[1, 2]] => group([1, 2]) exact
// [[[1, 2], 3]] => group([1, 2])
const nextChild = this.findNextChild(target, range, true);
if (!nextChild) {
return null;
}
if (nextChild.compare(selected, -1)) {
return nextChild;
}
return null;
}
/**
* Finds a group that does not overlap within the range and includes the target.
*/
public findPureChild(
target: HTMLElement | SVGElement,
range: Array,
): ArrayChild | null {
let nextGroupChild: ArrayChild | null = null;
const childSelected = range.filter(element => this.has(element));
if (!childSelected.length) {
return this;
}
this.value.some(nextChild => {
if (nextChild.type !== "single" && nextChild.has(target)) {
nextGroupChild = nextChild.findPureChild(target, childSelected);
if (nextGroupChild) {
return true;
}
}
});
return nextGroupChild;
}
public findNextPureChild(
target: HTMLElement | SVGElement,
range: Array,
): ArrayChild | null {
const nextChild = this.findNextChild(target);
if (nextChild) {
return nextChild.findPureChild(target, range);
}
return null;
}
public getSingleChild(): SingleChild | null {
const groupElement = this.groupElement;
if (groupElement) {
const singleChild = this.parent?.value.find(t => t.value === groupElement);
if (singleChild) {
return singleChild as SingleChild;
}
}
return null;
}
public toTargetGroups(): TargetGroupsType {
return this.value.map(child => {
if (child.type === "single") {
return child.value;
} else {
return child.toTargetGroups();
}
});
}
public findArrayChild(targets: TargetGroupsType): ArrayChild | null {
const {
value,
} = this;
let result = false;
if (this.type !== "root") {
result = value.every(child => {
if (child.type === "single") {
return targets.some(target => child.value === target);
} else {
return targets.some(target => {
return isArray(target) && child.findArrayChild(target);
});
}
});
// result = targets.every(target => {
// if (isArray(target)) {
// return value.some(child => {
// return child.type === "group" && child.findArrayChild(target);
// });
// } else {
// return map.get(target);
// }
// });
}
if (result && targets.length === value.length) {
return this;
} else {
let childResult: ArrayChild | null = null;
value.some(child => {
if (child.type === "group") {
childResult = child.findArrayChild(targets);
return childResult;
}
});
return childResult;
}
}
public groupByPerfect(selected: Array) {
return this.value.filter(child => {
if (child.type !== "single") {
return child.compare(selected, -1);
}
return selected.indexOf(child.value) > -1;
}).map(child => {
if (child.type !== "single") {
const singleChild = child.getSingleChild();
if (singleChild) {
return singleChild;
}
}
return child;
});
}
public add(targets: TargetGroupsObject) {
const {
value,
map,
} = this;
targets.forEach(child => {
if ("groupId" in child) {
const group = new ArrayChild(this);
group.id = child.groupId;
value.push(group);
group.add(child.children);
} else if (isArray(child)) {
const group = new ArrayChild(this);
value.push(group);
group.add(child);
} else {
const element = "current" in child ? child.current : child;
const single = new SingleChild(this, element!);
value.push(single);
map.set(element!, single);
}
});
value.forEach(child => {
if (child.type === "single") {
map.set(child.value, child);
} else {
child.map.forEach((nextChild, element) => {
map.set(element, nextChild);
});
}
});
value.forEach(child => {
if (child.type !== "single") {
return;
}
// single
const singleElement = child.value;
const groupChild = value.find(child2 => {
if (child2.type === "single") {
return;
}
const firstElement = [...child2.map.keys()][0];
if (!firstElement) {
return;
}
return singleElement.contains(firstElement);
});
(child as SingleChild).isGroupElement = !!groupChild;
if (groupChild) {
(groupChild as ArrayChild).groupElement = child.value;
}
});
return parent;
}
}
================================================
FILE: packages/helper/src/index.cjs.ts
================================================
import * as modules from "./index";
module.exports = modules;
export * from "./index";
export default modules;
================================================
FILE: packages/helper/src/index.ts
================================================
export * from "./groups";
export * from "./GroupManager";
export * from "./types";
================================================
FILE: packages/helper/src/index.umd.ts
================================================
import * as modules from "./index";
export default modules;
================================================
FILE: packages/helper/src/types.ts
================================================
import { ArrayChild, SingleChild } from "./groups";
export type TargetGroupWithId = { groupId: string; children: TargetGroupsObject };
export type TargetRef = { current: HTMLElement | SVGElement | null };
export type TargetGroupsObject
= Array;
export type TargetGroupsType = Array;
export type GroupChild = SingleChild | ArrayChild;
export interface TargetList {
raw(): GroupChild[];
flatten(): Array;
targets(): TargetGroupsType;
}
================================================
FILE: packages/helper/test/unit/GroupManager.spec.ts
================================================
import { createElements } from "./utils";
import { GroupManager } from "../../src/";
describe("test GroupManager", () => {
describe("test groups [[0, 1], 2], 3", () => {
const elements = createElements(4);
const manager = new GroupManager([
[[elements[0], elements[1]], elements[2]],
], elements);
it("selectCompletedChilds [0, 1]", () => {
const list = manager.selectCompletedChilds([], [elements[1]], []);
expect(list.flatten()).toStrictEqual([elements[0], elements[1], elements[2]]);
});
it("selectCompletedChilds 2 => [0, 1]", () => {
// element[2]가 선택된 상태에서 elements[0]을 선택
const list = manager.selectCompletedChilds([elements[2]], [elements[0]], [elements[2]]);
expect(list.flatten()).toStrictEqual([elements[0], elements[1]]);
});
});
});
================================================
FILE: packages/helper/test/unit/utils.ts
================================================
export function createElements(count: number) {
const elements: HTMLElement[] = [];
for (let i = 0; i < count; ++i) {
const div = document.createElement("div");
div.innerHTML = `${i}`;
(div as any).eid = i;
elements.push(div);
}
return elements;
}
================================================
FILE: packages/helper/tsconfig.build.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"jsx": "react"
},
}
================================================
FILE: packages/helper/tsconfig.declaration.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"allowJs": false,
"noEmit": false,
"isolatedModules": false,
"removeComments": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "declaration"
},
"include": [
"./src/**/*"
]
}
================================================
FILE: packages/helper/tsconfig.json
================================================
{
"compilerOptions": {
"outDir": "./outjs/",
"esModuleInterop": false,
"sourceMap": true,
"module": "esnext",
"target": "es5",
"downlevelIteration": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"moduleResolution": "node",
"jsx": "preserve",
"lib": [
"es2019",
"es2015",
"dom"
],
"allowJs": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": false,
"noEmit": true,
"baseUrl": "."
},
"include": [
"./src/**/*.ts",
"./src/**/*.tsx"
]
}
================================================
FILE: packages/lit-moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.30.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.29.0...lit-moveable@0.30.0) (2023-12-03)
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
## [0.29.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.28.2...lit-moveable@0.29.0) (2023-10-28)
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.28.2](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.28.1...lit-moveable@0.28.2) (2023-09-19)
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.28.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.28.0...lit-moveable@0.28.1) (2023-07-11)
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.28.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.27.2...lit-moveable@0.28.0) (2023-07-09)
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.27.2](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.27.1...lit-moveable@0.27.2) (2023-07-04)
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.27.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.26.1...lit-moveable@0.27.1) (2023-07-02)
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.26.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.26.0...lit-moveable@0.26.1) (2023-06-28)
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.26.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.25.0...lit-moveable@0.26.0) (2023-06-25)
### :mega: Other
* publish packages ([f893cca](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.25.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.24.9...lit-moveable@0.25.0) (2023-06-04)
### :bug: Bug Fix
* support iframe #932 ([15abedb](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/15abedb5f5770b8380d0b6ebedbc4ab7834cb9e8))
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
## [0.24.9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.24.8...lit-moveable@0.24.9) (2023-05-16)
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.24.8](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.24.7...lit-moveable@0.24.8) (2023-05-15)
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.24.7](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.24.6...lit-moveable@0.24.7) (2023-05-09)
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.24.6](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.24.0...lit-moveable@0.24.6) (2023-05-08)
### :rocket: New Features
* update croact version #902 ([e328e21](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/e328e2170438fe27f60f307ae976183fbfb5e96e))
### :bug: Bug Fix
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.24.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.23.1...lit-moveable@0.24.0) (2023-05-01)
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
## [0.23.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.23.0...lit-moveable@0.23.1) (2023-04-16)
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## [0.23.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.22.0...lit-moveable@0.23.0) (2023-04-13)
### :bug: Bug Fix
* fix warpSelf ([8c86a3f](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/8c86a3f95e5d0b8832b1d9b65bf72f598eb8d0cb))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.22.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.21.4...lit-moveable@0.22.0) (2023-03-26)
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.21.4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.21.3...lit-moveable@0.21.4) (2023-03-21)
### :bug: Bug Fix
* update lit version ([32db849](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/32db8497e3548daa4226aa56aae4e051ab2884b3))
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.21.3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.21.2...lit-moveable@0.21.3) (2023-03-14)
### :mega: Other
* update packages ([5b03d09](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.21.2](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.21.0...lit-moveable@0.21.2) (2023-03-10)
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
* update packages #856 #847 ([a78c8e3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/a78c8e3c7ff8c3eb347a7617ddc76c807b57633e))
## [0.21.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.20.1...lit-moveable@0.21.0) (2023-03-08)
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
## [0.20.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.19.1...lit-moveable@0.20.1) (2023-01-29)
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.19.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.19.0...lit-moveable@0.19.1) (2022-12-16)
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.19.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.18.1...lit-moveable@0.19.0) (2022-12-10)
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.18.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.18.0...lit-moveable@0.18.1) (2022-12-05)
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.18.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.17.1...lit-moveable@0.18.0) (2022-12-03)
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.17.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.17.0...lit-moveable@0.17.1) (2022-11-28)
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
## [0.17.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.16.0...lit-moveable@0.17.0) (2022-11-27)
### :memo: Documentation
* fix README ([3a153c8](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/3a153c849b7279ec5fd603167117c88f25a7149c))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
## [0.16.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.15.1...lit-moveable@0.16.0) (2022-11-13)
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.15.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.15.0...lit-moveable@0.15.1) (2022-11-06)
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.15.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.14.0...lit-moveable@0.15.0) (2022-11-04)
### :bug: Bug Fix
* fix changing snapContainer #773 ([c3ee847](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/c3ee8473765ee6bbb8a27e4865372edac7b3b6fe))
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
* update packages ([1ba698e](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/1ba698e996efe9c7c487823fe513ef43592cd6e9))
## [0.14.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.13.4...lit-moveable@0.14.0) (2022-10-17)
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
## [0.13.4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.13.1...lit-moveable@0.13.4) (2022-10-10)
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.13.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.13.0...lit-moveable@0.13.1) (2022-09-19)
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.13.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.12.4...lit-moveable@0.13.0) (2022-09-15)
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.12.4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.12.3...lit-moveable@0.12.4) (2022-08-24)
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.12.3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.12.1...lit-moveable@0.12.3) (2022-08-23)
### :mega: Other
* publish packages ([3597bc5](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.12.1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.12.0...lit-moveable@0.12.1) (2022-08-12)
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.12.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.11.3...lit-moveable@0.12.0) (2022-08-06)
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.11.3](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.11.2...lit-moveable@0.11.3) (2022-08-03)
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.11.2](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.10.0...lit-moveable@0.11.2) (2022-08-01)
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.10.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.9.0...lit-moveable@0.10.0) (2022-07-25)
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
## [0.9.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.8.2...lit-moveable@0.9.0) (2022-07-21)
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
## [0.8.2](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.8.0...lit-moveable@0.8.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.8.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.7.0...lit-moveable@0.8.0) (2022-07-17)
### :bug: Bug Fix
* fix floating point for min limit size ([766561c](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/766561c0e785098720c5a0ae6d9da1e2d9d7b879))
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
## [0.7.0](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.9...lit-moveable@0.7.0) (2022-06-09)
### :rocket: New Features
* add snap direction foramt (#669) ([52406cc](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/52406cc8c2a77dc2446dc935681aa9885661b77b))
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.6.9](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.8...lit-moveable@0.6.9) (2022-06-07)
### :bug: Bug Fix
* fix minSize for zero size ([c34f298](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/c34f29803a487098f36f45991ea6dff03bd2750a))
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* publish packages ([3530f05](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
## [0.6.8](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.6...lit-moveable@0.6.8) (2022-05-01)
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.6.6](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.5...lit-moveable@0.6.6) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.6.5](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.4...lit-moveable@0.6.5) (2022-04-27)
### :mega: Other
* update packages versions ([5cd2398](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/5cd2398dbb4dbbda24032641fe5bf111780b75fc))
## [0.6.4](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/compare/lit-moveable@0.6.3...lit-moveable@0.6.4) (2022-04-26)
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
* upgrade storybook and typescript ([eff23fd](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable/commit/eff23fd7340964ed0e3e6f5930e56558c4d91d18))
================================================
FILE: packages/lit-moveable/LICENSE
================================================
MIT License
Copyright (c) 2021 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: packages/lit-moveable/README.md
================================================
Lit Moveable
Lit Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.
Demo /
API /
Main Project
## ⚙️ Installation
### npm
```bash
$ npm install lit-moveable
```
## 🚀 How to use
* The event name is prefixed with **lit** (`litDragStart`, `litDrag`).
* `draggable` property is prefixed with **lit** (`litMoveable`).
* `dragStart` method name is prefixed with **lite** (`litDragStart`)
```js
import "lit-moveable";
import { render } from "lit-html":
render(html`
Target
{
e.set(translate);
}}
@litDrag=${({ detail: e }) => {
e.target.style.transform = `translate(${e.beforeTranslate[0]}px, ${e.beforeTranslate[1]}px)`;
translate = e.beforeTranslate;
}}
@litResizeStart=${({ detail: e }) => {
e.dragStart && e.dragStart.set(translate);
}}
@litResize=${({ detail: e }) => {
const beforeTranslate = e.drag.beforeTranslate;
e.target.style.width = `${e.width}px`;
e.target.style.height = `${e.height}px`;
e.target.style.transform = `translate(${beforeTranslate[0]}px, ${beforeTranslate[1]}px)`;
translate = beforeTranslate;
}}
/>
`);
```
## ⚙️ Developments
### `npm run start`
Open ./demo/index.html
## ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
## 👏 Contributing
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/daybrush/moveable/blob/master/CONTRIBUTING.md)].
## 🐞 Bug Report
If you find a bug, please report to us opening a new [Issue](https://github.com/daybrush/moveable/issues) on GitHub.
## Sponsors
## 📝 License
This project is [MIT](https://github.com/daybrush/moveable/blob/master/LICENSE) licensed.
```
MIT License
Copyright (c) 2021 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: packages/lit-moveable/demo/index.html
================================================
================================================
FILE: packages/lit-moveable/demo/index.ts
================================================
import { html } from "lit-element";
import { render } from "lit-html";
import "../src/LitMoveable";
let target: HTMLElement;
let translate = [0, 0];
render(html`
Target
{
e.set(translate);
}}
@litDrag=${({ detail: e }) => {
e.target.style.transform = `translate(${e.beforeTranslate[0]}px, ${e.beforeTranslate[1]}px)`;
translate = e.beforeTranslate;
}}
@litResizeStart=${({ detail: e }) => {
e.dragStart && e.dragStart.set(translate);
}}
@litResize=${({ detail: e }) => {
const beforeTranslate = e.drag.beforeTranslate;
e.target.style.width = `${e.width}px`;
e.target.style.height = `${e.height}px`;
e.target.style.transform = `translate(${beforeTranslate[0]}px, ${beforeTranslate[1]}px)`;
translate = beforeTranslate;
}}
/>
`, document.body);
================================================
FILE: packages/lit-moveable/package.json
================================================
{
"name": "lit-moveable",
"version": "0.30.0",
"description": "A Lit Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.",
"types": "declaration/index.d.ts",
"main": "dist/moveable.cjs.js",
"module": "dist/moveable.esm.js",
"sideEffects": false,
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"warpable",
"pinchable",
"groupable",
"snappable",
"scrollable",
"movable",
"throttle",
"scroll",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"react",
"warp",
"snap",
"pinch",
"lit",
"lit-html",
"lit-element"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/lit-moveable"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*"
],
"scripts": {
"start": "rollup -c rollup.demo.config.js -w",
"build": "rollup -c && npm run declaration",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json"
},
"devDependencies": {
"@daybrush/builder": "^0.2.4",
"lit": "^2.0",
"typescript": "^4.8 <4.9"
},
"dependencies": {
"@daybrush/utils": "^1.13.0",
"framework-utils": "^1.1.0",
"moveable": "~0.53.0"
}
}
================================================
FILE: packages/lit-moveable/rollup.config.js
================================================
const buildHelper = require("@daybrush/builder");
const defaultOptions = {
input: "./src/index.ts",
tsconfig: "tsconfig.build.json",
sourcemap: true,
};
module.exports = buildHelper([
{
...defaultOptions,
format: "es",
output: "./dist/moveable.esm.js",
exports: "named",
},
{
...defaultOptions,
format: "cjs",
output: "./dist/moveable.cjs.js",
exports: "named",
},
{
...defaultOptions,
format: "umd",
name: "UMD",
output: "./dist/moveable.umd.js",
exports: "named",
resolve: true,
},
]);
================================================
FILE: packages/lit-moveable/rollup.demo.config.js
================================================
const buildHelper = require("@daybrush/builder");
const defaultOptions = {
input: "./demo/index.ts",
tsconfig: "tsconfig.build.json",
sourcemap: true,
};
module.exports = buildHelper([
{
...defaultOptions,
format: "iife",
output: "./demo/dist/index.js",
resolve: true,
exports: "named",
},
]);
================================================
FILE: packages/lit-moveable/src/LitMoveable.ts
================================================
import { LitElement, html } from "lit";
import { customElement, property } from "lit/decorators.js";
import VanillaMoveable, {
PROPERTIES,
EVENTS,
METHODS,
MoveableOptions,
MoveableInterface,
} from "moveable";
import { Properties, withMethods, MethodInterface } from "framework-utils";
import { camelize, isUndefined } from "@daybrush/utils";
import { LitMoveableOptions } from "./types";
@Properties(PROPERTIES as any, (prototype, name) => {
if (name === "draggable") {
property()(prototype, "mvDraggable");
property()(prototype, "litDraggable");
} else {
property()(prototype, name);
}
})
@customElement("lit-moveable")
export class LitMoveable extends LitElement {
@withMethods(METHODS as any)
private moveable!: VanillaMoveable;
public dragStartMoveable(e: MouseEvent | TouchEvent) {
return this.moveable.dragStart(e);
}
public litDragStart(e: MouseEvent | TouchEvent) {
return this.moveable.dragStart(e);
}
public firstUpdated() {
const options: Partial = {};
PROPERTIES.forEach(name => {
let value: any;
if (name === "draggable") {
value = this.mvDraggable ?? this.litDraggable;
} else {
value = this[name];
}
if (!isUndefined(value)) {
options[name as any] = value;
}
});
this.moveable = new VanillaMoveable(this, {
warpSelf: true,
...options,
});
const moveable = this.moveable;
EVENTS.forEach((name, i) => {
moveable.on(name as any, e => {
const result = this.dispatchEvent(new CustomEvent(camelize(`lit ${name}`), {
detail: { ...e },
}));
if (result === false) {
(e as any).stop();
}
});
});
}
public render() {
return html` `;
}
public updated(changedProperties) {
const moveable = this.moveable;
changedProperties.forEach((oldValue, propName) => {
const litName = propName === "mvDraggable" || propName === "litMoveable"
? "draggable"
: propName;
if (PROPERTIES.indexOf(litName) > -1) {
moveable[litName] = this[propName];
}
});
}
public disconnectedCallback() {
super.disconnectedCallback();
this.moveable.destroy();
}
}
export interface LitMoveable extends LitMoveableOptions, MethodInterface { }
declare global {
interface HTMLElementTagNameMap {
"lit-moveable": LitMoveable;
}
}
================================================
FILE: packages/lit-moveable/src/index.ts
================================================
export * from "./LitMoveable";
export * from "moveable";
================================================
FILE: packages/lit-moveable/src/types.ts
================================================
import { MoveableOptions } from "moveable";
export interface LitMoveableOptions extends Pick> {
/**
* @deprecated
* use `litDraggable` prop
*/
mvDraggable?: boolean;
litDraggable?: boolean;
}
================================================
FILE: packages/lit-moveable/tsconfig.build.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"target": "es2015",
}
}
================================================
FILE: packages/lit-moveable/tsconfig.declaration.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"allowJs": false,
"noEmit": false,
"isolatedModules": false,
"removeComments": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "declaration"
},
"include": [
"./src/**/*"
]
}
================================================
FILE: packages/lit-moveable/tsconfig.json
================================================
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "es2015",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": [
"src"
]
}
================================================
FILE: packages/moveable/.npmignore
================================================
node_modules/
*.DS_Store
.DS_Store
doc/
template/
example/
karma.conf.js
test/
mocha.opts
Gruntfile.js
webpack.*.js
.travis.yml
packages
release/
demo/
coverage/
dist/report.html
rollup-plugin-visualizer/
outjs/
.scene_cache
*.mp3
*.mp4
storybook/
================================================
FILE: packages/moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.53.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.52.0...moveable@0.53.0) (2023-12-03)
### :house: Code Refactoring
* let the target be passed into dragStart (#1050) ([786fc0c](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/786fc0cd4cb3f3f67719740aa953231b7d410815))
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
## [0.52.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.51.2...moveable@0.52.0) (2023-10-28)
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.51.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.51.1...moveable@0.51.2) (2023-09-19)
### :bug: Bug Fix
* fix roundable shadow condition ([adb09b7](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/adb09b7396271e7de7031c1d621d1232f3751a9b))
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.51.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.51.0...moveable@0.51.1) (2023-07-11)
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.51.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.50.2...moveable@0.51.0) (2023-07-09)
### :rocket: New Features
* add `onBound` event #970 ([c9db51f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/c9db51f8ef5f7a0d262323e381ec25ad5bfc391d))
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.50.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.50.1...moveable@0.50.2) (2023-07-04)
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.50.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.49.1...moveable@0.50.1) (2023-07-02)
### :bug: Bug Fix
* fix choppy reisze #961 ([c8f9637](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/c8f9637ae319870cc6d4e9bf68eb98820f27f25e))
* fix group's dragTargetRef #953 ([85d17d7](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/85d17d77751d474db88b7238dd39baccd6b7a78d))
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.49.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.49.0...moveable@0.49.1) (2023-06-28)
### :bug: Bug Fix
* fix dragTarget's unset #960 ([8e60b38](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/8e60b385b8931a3aab953b315618ec15f9360611))
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.49.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.48.0...moveable@0.49.0) (2023-06-25)
### :mega: Other
* publish packages ([f893cca](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.48.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.47.9...moveable@0.48.0) (2023-06-04)
### :rocket: New Features
* support drag api #920 ([8f1a839](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/8f1a8396c429cf108da5417bc36cccd3ef46013c))
### :bug: Bug Fix
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
## [0.47.9](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.47.8...moveable@0.47.9) (2023-05-16)
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.47.8](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.47.7...moveable@0.47.8) (2023-05-15)
### :bug: Bug Fix
* update croact, css-styled version #916 ([b517b64](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/b517b6498a612c072eadc9354d6383363771ea6d))
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.47.7](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.47.6...moveable@0.47.7) (2023-05-09)
### :bug: Bug Fix
* fix missing type #911 ([0f26c75](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/0f26c75261fe8996f8b1317ec2da473a9feb57d0))
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.47.6](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.47.0...moveable@0.47.6) (2023-05-08)
### :rocket: New Features
* update croact version #902 ([e328e21](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/e328e2170438fe27f60f307ae976183fbfb5e96e))
### :bug: Bug Fix
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.47.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.46.1...moveable@0.47.0) (2023-05-01)
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
* update croact 1.0.1 #902 ([34433f3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/34433f3ab1266fff29f1f74bf6a5176d238348b6))
## [0.46.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.46.0...moveable@0.46.1) (2023-04-16)
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## [0.46.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.45.0...moveable@0.46.0) (2023-04-13)
### :rocket: New Features
* add croact ([b94c41c](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/b94c41c50cdf37da0136bd4d04f2237529253f45))
* add croact compat ([233c6d0](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/233c6d0a905953b51c3fd5df1f7c58e7b1d03432))
### :bug: Bug Fix
* fix warpSelf ([8c86a3f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/8c86a3f95e5d0b8832b1d9b65bf72f598eb8d0cb))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.45.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.44.4...moveable@0.45.0) (2023-03-26)
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.44.4](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.44.3...moveable@0.44.4) (2023-03-21)
### :memo: Documentation
* fix README ([7426492](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/7426492de210ab6f38d411d96e6d843d7423f555))
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.44.3](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.44.2...moveable@0.44.3) (2023-03-14)
### :memo: Documentation
* fix story url ([8977306](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/897730620480d8e830c4b53401a28d03b42b9a5f))
### :mega: Other
* update packages ([5b03d09](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.44.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.44.0...moveable@0.44.2) (2023-03-10)
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
* update packages #856 #847 ([a78c8e3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/a78c8e3c7ff8c3eb347a7617ddc76c807b57633e))
## [0.44.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.43.1...moveable@0.44.0) (2023-03-08)
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
## [0.43.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.42.2...moveable@0.43.1) (2023-01-29)
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.42.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.42.1...moveable@0.42.2) (2022-12-16)
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.42.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.41.1...moveable@0.42.1) (2022-12-10)
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.41.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.41.0...moveable@0.41.1) (2022-12-05)
### :bug: Bug Fix
* move react-moveable path ([ec8e162](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ec8e1620e05f1d5a1a45ecccec7481c2ea8a4f57))
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.41.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.40.1...moveable@0.41.0) (2022-12-03)
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.40.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.40.0...moveable@0.40.1) (2022-11-28)
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
* update jsdoc, template ([11408ca](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/11408caea15925a42165aa2080a7327e77a22ea8))
## [0.40.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.39.0...moveable@0.40.0) (2022-11-27)
### :memo: Documentation
* fix README ([3a153c8](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/3a153c849b7279ec5fd603167117c88f25a7149c))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
## [0.39.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.38.1...moveable@0.39.0) (2022-11-13)
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.38.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.38.0...moveable@0.38.1) (2022-11-06)
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.38.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.37.0...moveable@0.38.0) (2022-11-04)
### :bug: Bug Fix
* fix no relative snapContainer's size #773 ([1db881f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/1db881f4d63fe59ffa22b00428419cfb0e4e2827))
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
* update packages #760 ([5c77cf3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5c77cf3986fa319a170d8bd90b6cd720601b5172))
## [0.37.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.36.4...moveable@0.37.0) (2022-10-17)
### :bug: Bug Fix
* fix flash of single, group toggling #760 ([5578030](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/557803012e21d2e78e3c0577aa9a238d9ee3a8dd))
* support cache for group #760 ([4661320](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/46613207e47279e72bdfc656ae35548a3f07474d))
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
* update packages ([61730d5](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/61730d5c143d4027c55a714c764efe77bbebe5bf))
## [0.36.4](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.36.1...moveable@0.36.4) (2022-10-10)
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.36.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.36.0...moveable@0.36.1) (2022-09-19)
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.36.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.35.4...moveable@0.36.0) (2022-09-15)
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.35.4](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.35.3...moveable@0.35.4) (2022-08-24)
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.35.3](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.35.1...moveable@0.35.3) (2022-08-23)
### :mega: Other
* fix cjs configs ([ce8cbb1](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ce8cbb18563e34234f7e9d83a0b3f024870314a8))
* publish packages ([3597bc5](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.35.1](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.35.0...moveable@0.35.1) (2022-08-12)
### :bug: Bug Fix
* fix that dragStart method cannot fire #718 ([5ea9fc3](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5ea9fc362534e8a56976ad87053700ee06a14e0d))
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.35.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.34.3...moveable@0.35.0) (2022-08-06)
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.34.3](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.34.2...moveable@0.34.3) (2022-08-03)
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.34.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.33.0...moveable@0.34.2) (2022-08-01)
### :memo: Documentation
* fix README ([5ded1c1](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5ded1c19b77fe2c3974bcf1f1ac1356d2924991d))
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.33.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.32.0...moveable@0.33.0) (2022-07-25)
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
## [0.32.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.31.2...moveable@0.32.0) (2022-07-21)
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
* update `react-compat-moveable` ([712ae6f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/712ae6fb49dec3f4e40a3cd664f63625d7cd5669))
## [0.31.2](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.31.0...moveable@0.31.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.31.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.30.0...moveable@0.31.0) (2022-07-17)
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
## [0.30.0](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.9...moveable@0.30.0) (2022-06-09)
### :bug: Bug Fix
* prevent wheel drag #674 ([e9bea04](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/e9bea04aec00bd3a2a06918b539c9b02b2a589d5))
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.29.9](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.8...moveable@0.29.9) (2022-06-07)
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* publish packages ([3530f05](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
* update demo configuration ([917123c](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/917123cdea2830e8e8f4a8d7b2a99654f16682ef))
* update dependencies ([9ad9efa](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/9ad9efa2a180c087cd68c1491f19a6226610567b))
## [0.29.8](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.6...moveable@0.29.8) (2022-05-01)
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.29.6](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.5...moveable@0.29.6) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.29.5](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.4...moveable@0.29.5) (2022-04-27)
### :mega: Other
* update packages versions ([5cd2398](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/5cd2398dbb4dbbda24032641fe5bf111780b75fc))
## [0.29.4](https://github.com/daybrush/moveable/blob/master/packages/moveable/compare/moveable@0.29.3...moveable@0.29.4) (2022-04-26)
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/blob/master/packages/moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
================================================
FILE: packages/moveable/LICENSE
================================================
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: packages/moveable/README.md
================================================
Moveable
Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable
Demo /
Storybook /
API /
Main Project
## 🔥 Features
* **Draggable** refers to the ability to drag and move targets.
* **Resizable** indicates whether the target's width and height can be increased or decreased.
* **Scalable** indicates whether the target's x and y can be scale of transform.
* **Rotatable** indicates whether the target can be rotated.
* **Warpable** indicates whether the target can be warped (distorted, bented).
* **Pinchable** indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* **Snappable** indicates whether to snap to the guideline.
* **OriginDraggable*** indicates Whether to drag origin.
* **Clippable** indicates Whether to clip the target.
* **Roundable** indicates Whether to show and drag or double click border-radius.
* Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
* Support Major Browsers
* Support 3d Transform
## ⚙️ Installation
### npm
```sh
$ npm i moveable
```
### scripts
```html
```
## 📄 Documents
* [**Moveable Handbook**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md)
* [**How to use Group**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-group)
* [**How to use custom CSS**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-custom-css)
* [**How to make custom able**](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/src/ables/README.md)
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
## 🚀 How to use
```ts
import Moveable from "moveable";
const moveable = new Moveable(document.body, {
target: document.querySelector(".target"),
// If the container is null, the position is fixed. (default: parentElement(document.body))
container: document.body,
draggable: true,
resizable: true,
scalable: true,
rotatable: true,
warpable: true,
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
pinchable: true, // ["resizable", "scalable", "rotatable"]
origin: true,
keepRatio: true,
// Resize, Scale Events at edges.
edge: false,
throttleDrag: 0,
throttleResize: 0,
throttleScale: 0,
throttleRotate: 0,
});
/* draggable */
moveable.on("dragStart", ({ target, clientX, clientY }) => {
console.log("onDragStart", target);
}).on("drag", ({
target, transform,
left, top, right, bottom,
beforeDelta, beforeDist, delta, dist,
clientX, clientY,
}) => {
console.log("onDrag left, top", left, top);
target!.style.left = `${left}px`;
target!.style.top = `${top}px`;
// console.log("onDrag translate", dist);
// target!.style.transform = transform;
}).on("dragEnd", ({ target, isDrag, clientX, clientY }) => {
console.log("onDragEnd", target, isDrag);
});
/* resizable */
moveable.on("resizeStart", ({ target, clientX, clientY }) => {
console.log("onResizeStart", target);
}).on("resize", ({ target, width, height, dist, delta, clientX, clientY }) => {
console.log("onResize", target);
delta[0] && (target!.style.width = `${width}px`);
delta[1] && (target!.style.height = `${height}px`);
}).on("resizeEnd", ({ target, isDrag, clientX, clientY }) => {
console.log("onResizeEnd", target, isDrag);
});
/* scalable */
moveable.on("scaleStart", ({ target, clientX, clientY }) => {
console.log("onScaleStart", target);
}).on("scale", ({
target, scale, dist, delta, transform, clientX, clientY,
}: OnScale) => {
console.log("onScale scale", scale);
target!.style.transform = transform;
}).on("scaleEnd", ({ target, isDrag, clientX, clientY }) => {
console.log("onScaleEnd", target, isDrag);
});
/* rotatable */
moveable.on("rotateStart", ({ target, clientX, clientY }) => {
console.log("onRotateStart", target);
}).on("rotate", ({ target, beforeDelta, delta, dist, transform, clientX, clientY }) => {
console.log("onRotate", dist);
target!.style.transform = transform;
}).on("rotateEnd", ({ target, isDrag, clientX, clientY }) => {
console.log("onRotateEnd", target, isDrag);
});
/* warpable */
this.matrix = [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
];
moveable.on("warpStart", ({ target, clientX, clientY }) => {
console.log("onWarpStart", target);
}).on("warp", ({
target,
clientX,
clientY,
delta,
dist,
multiply,
transform,
}) => {
console.log("onWarp", target);
// target.style.transform = transform;
this.matrix = multiply(this.matrix, delta);
target.style.transform = `matrix3d(${this.matrix.join(",")})`;
}).on("warpEnd", ({ target, isDrag, clientX, clientY }) => {
console.log("onWarpEnd", target, isDrag);
});
/* pinchable */
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
moveable.on("pinchStart", ({ target, clientX, clientY }) => {
// pinchStart event occur before dragStart, rotateStart, scaleStart, resizeStart
console.log("onPinchStart");
}).on("pinch", ({ target, clientX, clientY, datas }) => {
// pinch event occur before drag, rotate, scale, resize
console.log("onPinch");
}).on("pinchEnd", ({ isDrag, target, clientX, clientY, datas }) => {
// pinchEnd event occur before dragEnd, rotateEnd, scaleEnd, resizeEnd
console.log("onPinchEnd");
});
```
## 📦 Packages
* [**moveable**](https://github.com/daybrush/moveable/blob/master/packages/moveable): A Vanilla Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**react-moveable**](https://github.com/daybrush/moveable/blob/master/packages/react-moveable): A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**preact-moveable**](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable): A Preact Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**ngx-moveable**](https://github.com/daybrush/moveable/blob/master/packages/ngx-moveable): An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**svelte-moveable**](https://github.com/daybrush/moveable/blob/master/packages/svelte-moveable): A Svelte Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**lit-moveable**](https://github.com/daybrush/moveable/blob/master/packages/lit-moveable): A Lit Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**vue-moveable**](https://github.com/daybrush/moveable/blob/master/packages/vue-moveable): A Vue Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
* [**vue3-moveable**](https://github.com/daybrush/moveable/blob/master/packages/vue-moveable): A Vue 3 Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable.
## ⚙️ Developments
The `moveable` repo is managed as a [monorepo](https://github.com/lerna/lerna) with `yarn`.
The main project was made with `react` and I used [`croact`](https://github.com/daybrush/croact) to make it lighter with umd.
For development and testing, check in [packages/react-moveable](https://github.com/daybrush/moveable/blob/master/packages/react-moveable).
### `npm run storybook`
```
$ yarn install
$ npm run bootstrap
$ npm run storybook
```
Runs the app in the development mode.
Open [http://localhost:6006](http://localhost:6006) to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
## ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
## 👏 Contributing
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/daybrush/moveable/blob/master/CONTRIBUTING.md)].
## 🐞 Bug Report
If you find a bug, please report to us opening a new [Issue](https://github.com/daybrush/moveable/issues) on GitHub.
## Sponsors
## 📝 License
This project is [MIT](https://github.com/daybrush/moveable/blob/master/LICENSE) licensed.
```
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: packages/moveable/package.json
================================================
{
"name": "moveable",
"version": "0.53.0",
"description": "Moveable is Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.",
"main": "./dist/moveable.cjs.js",
"module": "./dist/moveable.esm.js",
"sideEffects": false,
"types": "declaration/index.d.ts",
"scripts": {
"start": "rollup -c -w",
"build": "rollup -c && npm run declaration && print-sizes ./dist",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json",
"doc": "rm -rf ./doc && jsdoc -c jsdoc.json",
"storybook": "cd storybook && npm run build && cd ../",
"prerelease": "npm run doc && npm run build&& prerelease --dirs=dist,doc",
"release:before": "npm run build && npm run doc && npm run storybook",
"release": "npm run release:before && release --dirs=dist,doc",
"release:init": "npm run release:before && release -i --dirs=dist,doc",
"deploy": "gh-pages -d ./demo --dest=./ --add --remote origin"
},
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"groupable",
"movable",
"warpable",
"pinchable",
"snappable",
"clippable",
"roundable",
"border",
"origin",
"dom",
"resize",
"scale",
"drag",
"move",
"warp",
"rotate",
"react",
"preact",
"throttle",
"group",
"pinchi",
"snap"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/moveable"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable/",
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*"
],
"dependencies": {
"@daybrush/utils": "^1.13.0",
"@scena/event-emitter": "^1.0.5",
"croact": "^1.0.4",
"croact-moveable": "~0.9.0",
"react-moveable": "~0.56.0"
},
"devDependencies": {
"@daybrush/builder": "^0.2.4",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"gh-pages": "^2.0.1",
"print-sizes": "^0.2.0",
"pvu": "^0.6.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rollup-plugin-css-bundle": "^1.0.4",
"rollup-plugin-react-compat": "^0.1.1",
"tslib": "^2.3.1",
"typescript": "^4.8 <4.9"
}
}
================================================
FILE: packages/moveable/rollup.config.js
================================================
const builder = require("@daybrush/builder");
const compat = require("rollup-plugin-react-compat");
const compatPlugin = compat({
useCroact: true,
aliasModules: {
"react-moveable": "croact-moveable"
}
});
const resolveCompatPlugin = compat({
useCroact: true,
resolveCompat: true,
});
/*
"demo:start": "rollup -c rollup.config.demo.js -w",
"demo:build": "rm -rf ./demo/dist && rollup -c rollup.config.demo.js",
"prerelease": "npm run doc && npm run build && npm run demo:build && prerelease --dirs=dist,doc",
"release:before": "npm run build && npm run doc && npm run demo:build && npm run storybook",
*/
const external = {
"croact": "croact",
"croact-ruler": "croact-ruler",
"croact-moveable": "croact-moveable",
"croact-css-styled": "croact-css-styled",
"@daybrush/utils": "utils",
"css-styled": "css-styled",
"framework-utils": "framework-utils",
"gesto": "Gesto",
"@scena/event-emitter": "@scena/event-emitter",
"@egjs/agent": "eg.Agent",
"@egjs/children-differ": "eg.ChildrenDiffer",
"@moveable/matrix": "@moveable/matrix",
"@scena/dragscroll": "@scena/dragscroll",
"css-to-mat": "css-to-mat",
"overlap-area": "overlap-area",
"@scena/matrix": "@scena/matrix",
"@egjs/list-differ": "eg.ListDiffer",
};
module.exports = builder([
{
name: "Moveable",
input: "src/index.umd.ts",
output: "./dist/moveable.js",
exports: "default",
format: "umd",
minifyPrototype: true,
plugins: [resolveCompatPlugin],
typescript2: true,
},
{
name: "Moveable",
input: "src/index.umd.ts",
output: "./dist/moveable.min.js",
exports: "default",
format: "umd",
minifyPrototype: true,
plugins: [resolveCompatPlugin],
uglify: true,
typescript2: true,
},
{
input: "src/index.ts",
output: "./dist/moveable.esm.js",
exports: "named",
format: "es",
minifyPrototype: true,
plugins: [compatPlugin],
external,
typescript2: true,
},
{
input: "src/index.cjs.ts",
output: "./dist/moveable.cjs.js",
exports: "named",
format: "cjs",
minifyPrototype: true,
plugins: [compatPlugin],
external,
},
]);
================================================
FILE: packages/moveable/src/InnerMoveable.tsx
================================================
import * as React from "react";
import Moveable from "react-moveable";
import { ref } from "framework-utils";
export default class InnerMoveable extends React.Component {
public state: any = {};
public moveable!: Moveable;
constructor(props: any) {
super(props);
this.state = this.props;
}
public render(): React.ReactNode {
return ;
}
}
================================================
FILE: packages/moveable/src/Moveable.tsx
================================================
import MoveableManager from "./MoveableManager";
export default class Moveable extends MoveableManager {}
================================================
FILE: packages/moveable/src/MoveableManager.tsx
================================================
import { ref, Properties } from "framework-utils";
import * as React from "react";
import { renderSelf, ContainerProvider } from "croact";
import InnerMoveable from "./InnerMoveable";
import {
MoveableInterface,
MoveableOptions, MoveableProperties,
} from "react-moveable/types";
import { camelize, getDocument, isArray } from "@daybrush/utils";
import { MoveableEventsParameters } from "./types";
import { PROPERTIES, EVENTS, METHODS } from "./consts";
import EventEmitter from "@scena/event-emitter";
/**
* Moveable is Draggable! Resizable! Scalable! Rotatable!
* @sort 1
* @alias Moveable
* @extends EventEmitter
*/
@Properties(METHODS, (prototype, property) => {
if (prototype[property]) {
return;
}
prototype[property] = function(...args: any[]) {
const self = this.getMoveable();
if (!self || !self[property]) {
return;
}
return self[property](...args);
};
})
@Properties(PROPERTIES, (prototype, property) => {
Object.defineProperty(prototype, property, {
get() {
return this.getMoveable().props[property];
},
set(value) {
this.setState({
[property]: value,
});
},
enumerable: true,
configurable: true,
});
})
class MoveableManager extends EventEmitter {
private innerMoveable!: InnerMoveable | null;
private containerProvider: ContainerProvider | null = null;
private selfElement: HTMLElement | null = null;
private _warp = false;
/**
*
*/
constructor(parentElement: HTMLElement, options: MoveableOptions = {}) {
super();
const nextOptions = { ...options };
const events: any = {};
EVENTS.forEach(name => {
events[camelize(`on ${name}`)] = (e: any) => this.trigger(name, e);
});
let selfElement!: HTMLElement;
if (options.warpSelf) {
delete options.warpSelf;
this._warp = true;
selfElement = parentElement;
} else {
selfElement = getDocument(parentElement).createElement("div");
parentElement.appendChild(selfElement);
}
this.containerProvider = renderSelf(
as any,
selfElement,
);
this.selfElement = selfElement;
const target = nextOptions.target!;
if (isArray(target) && target.length > 1) {
this.updateRect();
}
}
public setState(state: Partial, callback?: () => any) {
this.innerMoveable!.setState(state, callback);
}
public forceUpdate(callback?: () => any) {
this.innerMoveable!.forceUpdate(callback);
}
public dragStart(e: MouseEvent | TouchEvent, target: EventTarget | null = e.target) {
const innerMoveable = this.innerMoveable;
if ((innerMoveable as any).$_timer) {
this.forceUpdate();
}
this.getMoveable().dragStart(e, target);
}
public destroy() {
const selfElement = this.selfElement!;
renderSelf(
null,
selfElement!,
this.containerProvider,
);
if (!this._warp) {
selfElement?.parentElement?.removeChild(selfElement);
}
this.containerProvider = null;
this.off();
this.selfElement = null;
this.innerMoveable = null;
}
private getMoveable() {
return this.innerMoveable!.moveable;
}
}
interface MoveableManager extends MoveableInterface, MoveableProperties {
}
export default MoveableManager;
================================================
FILE: packages/moveable/src/consts.ts
================================================
import {
MOVEABLE_PROPS,
MOVEABLE_METHODS,
MOVEABLE_EVENTS,
} from "react-moveable";
export const PROPERTIES: string[] = MOVEABLE_PROPS;
export const METHODS: string[] = MOVEABLE_METHODS;
export const EVENTS: string[] = MOVEABLE_EVENTS;
================================================
FILE: packages/moveable/src/index.cjs.ts
================================================
import Moveable, * as modules from "./index";
for (const name in modules) {
(Moveable as any)[name] = (modules as any)[name];
}
module.exports = Moveable;
export * from "./index";
export default Moveable;
================================================
FILE: packages/moveable/src/index.ts
================================================
import Moveable from "./Moveable";
export * from "./types";
export * from "./consts";
export * from "./utils";
export default Moveable;
================================================
FILE: packages/moveable/src/index.umd.ts
================================================
import Moveable, * as modules from "./index";
for (const name in modules) {
(Moveable as any)[name] = (modules as any)[name];
}
export default Moveable;
================================================
FILE: packages/moveable/src/types.ts
================================================
import {
MoveableEvents,
} from "react-moveable/types";
export interface WithEventStop {
stop: () => any;
}
export type MoveableEventsParameters = {
[key in keyof MoveableEvents]: MoveableEvents[key] & WithEventStop;
};
export * from "react-moveable/types";
================================================
FILE: packages/moveable/src/utils.ts
================================================
import { Able, DefaultProps } from "react-moveable/types";
import { getElementInfo as getElementInfoFunction, makeAble as makeAbleFunction } from "react-moveable";
export function getElementInfo(
target: SVGElement | HTMLElement,
container?: SVGElement | HTMLElement | null,
rootContainer?: SVGElement | HTMLElement | null | undefined,
) {
return getElementInfoFunction(target, container, rootContainer);
};
export function makeAble<
Name extends string,
AbleObject extends Partial>,
>(name: Name, able: AbleObject) {
return makeAbleFunction(name, able);
}
================================================
FILE: packages/moveable/test/manual/css.html
================================================
aa
================================================
FILE: packages/moveable/test/manual/custom/changeTarget.html
================================================
================================================
FILE: packages/moveable/test/manual/custom/custom-child.js
================================================
class CustomChildren extends HTMLElement {
styleText = `
.container {
width: 100%;
height: 100%;
}
`;
constructor() {
super();
this.shadow = this.attachShadow({ mode: 'open' });
const style = document.createElement('style');
const div = document.createElement('div');
div.classList.add('container');
style.textContent = this.styleText;
this.shadow.appendChild(style);
this.shadow.appendChild(div);
}
}
customElements.define('custom-children', CustomChildren);
================================================
FILE: packages/moveable/test/manual/custom/custom-parent.js
================================================
class CustomParent extends HTMLElement {
styleText = `
.card {
width: 100%;
height: 100%;
}
.card-header {
width:100%;
height: 80px;
background-color: #3794FF;
}
.card-content {
width: 100%;
height: calc(100% - 80px);
background-color: #EDF0F3;
position: relative;
}
`;
constructor() {
super();
this.shadow = this.attachShadow({ mode: 'open' });
const style = document.createElement('style');
const div = document.createElement('div');
div.classList.add('card');
div.innerHTML = `
`;
style.textContent = this.styleText;
this.shadow.appendChild(style);
this.shadow.appendChild(div);
}
}
customElements.define('custom-parent', CustomParent);
================================================
FILE: packages/moveable/test/manual/dragapi.html
================================================
================================================
FILE: packages/moveable/test/manual/fixed.html
================================================
================================================
FILE: packages/moveable/test/manual/fixedgroup.html
================================================
================================================
FILE: packages/moveable/test/manual/groupDragTarget.html
================================================
CodePen - Moveable: Draggable with dragTarget
Lorem ipsum dolor sit amet.
================================================
FILE: packages/moveable/test/manual/groupandsnappable.html
================================================
CodePen - Editor
================================================
FILE: packages/moveable/test/manual/iframe.html
================================================
================================================
FILE: packages/moveable/test/manual/input.html
================================================
================================================
FILE: packages/moveable/test/manual/resizable.html
================================================
aa
================================================
FILE: packages/moveable/test/manual/selecto.html
================================================
================================================
FILE: packages/moveable/test/manual/snappable.html
================================================
================================================
FILE: packages/moveable/test/manual/text.html
================================================
aa
================================================
FILE: packages/moveable/test/manual/updateSelecgtors.html
================================================
aa
================================================
FILE: packages/moveable/test/manual/updateSelecgtors2.html
================================================
selectFirst
selectSecond
clearSelect
================================================
FILE: packages/moveable/tsconfig.declaration.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"allowJs": false,
"noEmit": false,
"isolatedModules": false,
"removeComments": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "declaration"
},
"include": [
"./src/**/*"
],
}
================================================
FILE: packages/moveable/tsconfig.json
================================================
{
"compilerOptions": {
"outDir": "./outjs/",
"esModuleInterop": false,
"sourceMap": true,
"module": "es2015",
"target": "es5",
"experimentalDecorators": true,
"skipLibCheck": true,
"moduleResolution": "node",
"jsx": "react",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"baseUrl": ".",
"importHelpers": true,
"lib": [
"es2015",
"dom"
],
},
"include": [
"./src/**/*.ts",
"./src/**/*.tsx"
]
}
================================================
FILE: packages/ngx-moveable/.browserslistrc
================================================
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
================================================
FILE: packages/ngx-moveable/.editorconfig
================================================
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
================================================
FILE: packages/ngx-moveable/.gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events.json
speed-measure-plugin.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
.angular
================================================
FILE: packages/ngx-moveable/.npmignore
================================================
node_modules/
*.DS_Store
.DS_Store
doc/
template/
example/
karma.conf.js
test/
mocha.opts
Gruntfile.js
webpack.*.js
.travis.yml
packages
release/
demo/
coverage/
dist/report.html
rollup-plugin-visualizer/
outjs/
.scene_cache
*.mp3
*.mp4
================================================
FILE: packages/ngx-moveable/.prettierrc
================================================
{
"singleQuote": true
}
================================================
FILE: packages/ngx-moveable/README.md
================================================
# ngx-moveable
See [readme](./projects/ngx-moveable/README.md) for more info.
================================================
FILE: packages/ngx-moveable/angular.json
================================================
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ngx-moveable-app": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ngx-moveable-app",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"development": {
"browserTarget": "ngx-moveable-app:build:development"
},
"production": {
"browserTarget": "ngx-moveable-app:build:production"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ngx-moveable-app:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ngx-moveable-app:serve"
},
"configurations": {
"production": {
"devServerTarget": "ngx-moveable-app:serve:production"
}
}
}
}
},
"ngx-moveable": {
"projectType": "library",
"root": "projects/ngx-moveable",
"sourceRoot": "projects/ngx-moveable/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/ngx-moveable/tsconfig.lib.json",
"project": "projects/ngx-moveable/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ngx-moveable/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ngx-moveable/src/test.ts",
"tsConfig": "projects/ngx-moveable/tsconfig.spec.json",
"karmaConfig": "projects/ngx-moveable/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/ngx-moveable/tsconfig.lib.json",
"projects/ngx-moveable/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
}
},
"defaultProject": "ngx-moveable-app"
}
================================================
FILE: packages/ngx-moveable/karma.conf.js
================================================
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/ngx-moveable-app'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
================================================
FILE: packages/ngx-moveable/package.json
================================================
{
"name": "ngx-moveable-app",
"version": "0.0.0",
"scripts": {
"postinstall": "ngcc --tsconfig ./tsconfig.base.json",
"ng": "ng",
"start": "ng serve",
"start:aot": "ng serve",
"start:prod": "ng serve",
"build": "ng build ngx-moveable --configuration production",
"build:app": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"lernaHelperPublishPath": "./dist/ngx-moveable",
"dependencies": {
"moveable": "~0.53.0",
"rxjs": "~7.4.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~15.0.4",
"@angular/animations": "~15.0.4",
"@angular/cdk": "^15.0.4",
"@angular/cli": "~15.0.4",
"@angular/common": "~15.0.4",
"@angular/compiler": "~15.0.4",
"@angular/compiler-cli": "~15.0.4",
"@angular/core": "~15.0.4",
"@angular/forms": "~15.0.4",
"@angular/material": "^15.0.4",
"@angular/platform-browser": "~15.0.4",
"@angular/platform-browser-dynamic": "~15.0.4",
"@angular/router": "~15.0.4",
"@types/jasmine": "~3.5.12",
"@types/node": "~14.0.27",
"codelyzer": "^6.0.0",
"framework-utils": "^1.1.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.2",
"karma": "~5.1.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~3.3.1",
"karma-jasmine-html-reporter": "^1.5.4",
"ng-packagr": "~15.0.3",
"protractor": "~7.0.0",
"ts-node": "~8.10.2",
"tslib": "^2.3.1",
"typescript": "^4.8 <4.9"
}
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.50.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.49.0...ngx-moveable@0.50.0) (2023-12-03)
### :rocket: New Features
* expose gesto preventRightClick and preventWheelClick props (#1040) ([9f4c9f4](https://github.com/daybrush/moveable/commit/9f4c9f452470026ecea3f7a0b1aff91c22444868))
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
## [0.49.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.48.2...ngx-moveable@0.49.0) (2023-10-28)
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.48.2](https://github.com/daybrush/moveable/compare/ngx-moveable@0.48.1...ngx-moveable@0.48.2) (2023-09-19)
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.48.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.48.0...ngx-moveable@0.48.1) (2023-07-11)
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.48.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.47.2...ngx-moveable@0.48.0) (2023-07-09)
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.47.2](https://github.com/daybrush/moveable/compare/ngx-moveable@0.47.1...ngx-moveable@0.47.2) (2023-07-04)
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.47.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.46.1...ngx-moveable@0.47.1) (2023-07-02)
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.46.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.46.0...ngx-moveable@0.46.1) (2023-06-28)
### :house: Code Refactoring
* update angular 15 version, use standalone ([226ea64](https://github.com/daybrush/moveable/commit/226ea643cb5c12315fc96e334a4bfa920f78d8aa))
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.46.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.45.0...ngx-moveable@0.46.0) (2023-06-25)
### :bug: Bug Fix
* fix props and event types missing #941 ([bd91b08](https://github.com/daybrush/moveable/commit/bd91b08ba04a50644e3d1ed91729563260b5a01b))
* fix typo (degress => degrees) #928 ([835be5b](https://github.com/daybrush/moveable/commit/835be5be701c8b3740ff9dfc16101a9b9ed60cbb))
* **ngx-moveable:** reduce change detection cycles (#939) ([b8ff60c](https://github.com/daybrush/moveable/commit/b8ff60cfda90aac4a5420c3620f798a8a184cdb9))
### :mega: Other
* publish packages ([f893cca](https://github.com/daybrush/moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.45.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.44.9...ngx-moveable@0.45.0) (2023-06-04)
### :rocket: New Features
* add useDefaultGroupRotate prop #929 ([5846e50](https://github.com/daybrush/moveable/commit/5846e50c18dc2e1aa628e41a8d235ee4851325db))
### :bug: Bug Fix
* support angular 16 ([d41af9c](https://github.com/daybrush/moveable/commit/d41af9c141785c272eb4148270feb8dc11e5d46c))
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
* update packages ([9e137aa](https://github.com/daybrush/moveable/commit/9e137aa7455fdf85766ca1ff77dd3d8ea2a4c1c9))
## [0.44.9](https://github.com/daybrush/moveable/compare/ngx-moveable@0.44.8...ngx-moveable@0.44.9) (2023-05-16)
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.44.8](https://github.com/daybrush/moveable/compare/ngx-moveable@0.44.7...ngx-moveable@0.44.8) (2023-05-15)
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.44.7](https://github.com/daybrush/moveable/compare/ngx-moveable@0.44.6...ngx-moveable@0.44.7) (2023-05-09)
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.44.6](https://github.com/daybrush/moveable/compare/ngx-moveable@0.44.0...ngx-moveable@0.44.6) (2023-05-08)
### :rocket: New Features
* update croact version #902 ([e328e21](https://github.com/daybrush/moveable/commit/e328e2170438fe27f60f307ae976183fbfb5e96e))
### :bug: Bug Fix
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.44.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.43.1...ngx-moveable@0.44.0) (2023-05-01)
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
## [0.43.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.43.0...ngx-moveable@0.43.1) (2023-04-16)
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## [0.43.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.42.0...ngx-moveable@0.43.0) (2023-04-13)
### :bug: Bug Fix
* fix warpSelf ([8c86a3f](https://github.com/daybrush/moveable/commit/8c86a3f95e5d0b8832b1d9b65bf72f598eb8d0cb))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.42.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.41.4...ngx-moveable@0.42.0) (2023-03-26)
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.41.4](https://github.com/daybrush/moveable/compare/ngx-moveable@0.41.3...ngx-moveable@0.41.4) (2023-03-21)
### :memo: Documentation
* fix README ([7426492](https://github.com/daybrush/moveable/commit/7426492de210ab6f38d411d96e6d843d7423f555))
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.41.3](https://github.com/daybrush/moveable/compare/ngx-moveable@0.41.2...ngx-moveable@0.41.3) (2023-03-14)
### :memo: Documentation
* fix story url ([8977306](https://github.com/daybrush/moveable/commit/897730620480d8e830c4b53401a28d03b42b9a5f))
### :mega: Other
* update packages ([5b03d09](https://github.com/daybrush/moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.41.2](https://github.com/daybrush/moveable/compare/ngx-moveable@0.41.0...ngx-moveable@0.41.2) (2023-03-10)
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
* update packages #856 #847 ([a78c8e3](https://github.com/daybrush/moveable/commit/a78c8e3c7ff8c3eb347a7617ddc76c807b57633e))
## [0.41.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.40.1...ngx-moveable@0.41.0) (2023-03-08)
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
## [0.40.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.39.1...ngx-moveable@0.40.1) (2023-01-29)
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.39.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.39.0...ngx-moveable@0.39.1) (2022-12-16)
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.39.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.38.1...ngx-moveable@0.39.0) (2022-12-10)
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.38.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.38.0...ngx-moveable@0.38.1) (2022-12-05)
### :bug: Bug Fix
* move react-moveable path ([ec8e162](https://github.com/daybrush/moveable/commit/ec8e1620e05f1d5a1a45ecccec7481c2ea8a4f57))
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.38.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.37.1...ngx-moveable@0.38.0) (2022-12-03)
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.37.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.37.0...ngx-moveable@0.37.1) (2022-11-28)
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
## [0.37.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.36.0...ngx-moveable@0.37.0) (2022-11-27)
### :memo: Documentation
* fix README ([3a153c8](https://github.com/daybrush/moveable/commit/3a153c849b7279ec5fd603167117c88f25a7149c))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
## [0.36.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.35.1...ngx-moveable@0.36.0) (2022-11-13)
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.35.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.35.0...ngx-moveable@0.35.1) (2022-11-06)
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.35.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.34.0...ngx-moveable@0.35.0) (2022-11-04)
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
* update packages ([1ba698e](https://github.com/daybrush/moveable/commit/1ba698e996efe9c7c487823fe513ef43592cd6e9))
## [0.34.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.33.4...ngx-moveable@0.34.0) (2022-10-17)
### :bug: Bug Fix
* fix flash of single, group toggling #760 ([5578030](https://github.com/daybrush/moveable/commit/557803012e21d2e78e3c0577aa9a238d9ee3a8dd))
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
## [0.33.4](https://github.com/daybrush/moveable/compare/ngx-moveable@0.33.1...ngx-moveable@0.33.4) (2022-10-10)
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.33.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.33.0...ngx-moveable@0.33.1) (2022-09-19)
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.33.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.32.4...ngx-moveable@0.33.0) (2022-09-15)
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.32.4](https://github.com/daybrush/moveable/compare/ngx-moveable@0.32.3...ngx-moveable@0.32.4) (2022-08-24)
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.32.3](https://github.com/daybrush/moveable/compare/ngx-moveable@0.32.1...ngx-moveable@0.32.3) (2022-08-23)
### :mega: Other
* publish packages ([3597bc5](https://github.com/daybrush/moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.32.1](https://github.com/daybrush/moveable/compare/ngx-moveable@0.32.0...ngx-moveable@0.32.1) (2022-08-12)
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.32.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.31.3...ngx-moveable@0.32.0) (2022-08-06)
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.31.3](https://github.com/daybrush/moveable/compare/ngx-moveable@0.31.2...ngx-moveable@0.31.3) (2022-08-03)
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.31.2](https://github.com/daybrush/moveable/compare/ngx-moveable@0.30.0...ngx-moveable@0.31.2) (2022-08-01)
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.30.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.29.0...ngx-moveable@0.30.0) (2022-07-25)
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
## [0.29.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.28.2...ngx-moveable@0.29.0) (2022-07-21)
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
## [0.28.2](https://github.com/daybrush/moveable/compare/ngx-moveable@0.28.0...ngx-moveable@0.28.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.28.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.27.0...ngx-moveable@0.28.0) (2022-07-17)
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
## [0.27.0](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.9...ngx-moveable@0.27.0) (2022-06-09)
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.26.9](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.8...ngx-moveable@0.26.9) (2022-06-07)
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* publish packages ([3530f05](https://github.com/daybrush/moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
* update demo configuration ([917123c](https://github.com/daybrush/moveable/commit/917123cdea2830e8e8f4a8d7b2a99654f16682ef))
## [0.26.8](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.6...ngx-moveable@0.26.8) (2022-05-01)
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.26.6](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.5...ngx-moveable@0.26.6) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.26.5](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.4...ngx-moveable@0.26.5) (2022-04-27)
### :mega: Other
* update packages versions ([5cd2398](https://github.com/daybrush/moveable/commit/5cd2398dbb4dbbda24032641fe5bf111780b75fc))
## [0.26.4](https://github.com/daybrush/moveable/compare/ngx-moveable@0.26.3...ngx-moveable@0.26.4) (2022-04-26)
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/README.md
================================================
Angular Moveable
An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.
Demo /
Storybook /
API /
Main Project
## 🔥 Features
* **Draggable** refers to the ability to drag and move targets.
* **Resizable** indicates whether the target's width and height can be increased or decreased.
* **Scalable** indicates whether the target's x and y can be scale of transform.
* **Rotatable** indicates whether the target can be rotated.
* **Warpable** indicates whether the target can be warped(distorted, bented).
* **Pinchable** indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* **Snappable** indicates whether to snap to the guideline.
* **OriginDraggable*** indicates Whether to drag origin.
* **Clippable** indicates Whether to clip the target.
* **Roundable** indicates Whether to show and drag or double click border-radius.
* Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
* Support Major Browsers
* Support 3d Transform
## ⚙️ Installation
```sh
$ npm i ngx-moveable
```
## 📄 Documents
* [**Moveable Handbook**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md)
* [**How to use Group**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-group)
* [**How to use custom CSS**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-custom-css)
* [**How to make custom able**](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/src/ables/README.md)
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
## 🚀 How to use
```js
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxMoveableModule, NgxMoveableComponent } from '../ngx-moveable';
@NgModule({
declarations: [
AppComponent,
NgxMoveableComponent,
],
imports: [
BrowserModule,
// NgxMoveableModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
### Template
```html
```
## ⚙️ Development
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.0.1.
## Development server
Run `npm run start(ng serve)` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
## 👏 Contributing
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/daybrush/moveable/blob/master/CONTRIBUTING.md)].
## 🐞 Bug Report
If you find a bug, please report to us opening a new [Issue](https://github.com/daybrush/moveable/issues) on GitHub.
## Sponsors
## 📝 License
This project is [MIT](https://github.com/daybrush/moveable/blob/master/LICENSE) licensed.
```
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/karma.conf.js
================================================
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/ngx-moveable'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/ng-package.json
================================================
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/ngx-moveable",
"lib": {
"entryFile": "src/public-api.ts"
},
"allowedNonPeerDependencies": [
"framework-utils",
"moveable",
"react-moveable"
]
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/package.json
================================================
{
"name": "ngx-moveable",
"version": "0.50.0",
"description": "An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.",
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/tree/master/packages/ngx-moveable"
},
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"warpable",
"pinchable",
"groupable",
"movable",
"snappable",
"throttle",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"warp",
"pinch",
"snap",
"angular",
"ngx",
"ng"
],
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"peerDependencies": {
"@angular/common": ">=8",
"@angular/core": ">=8"
},
"devDependencies": {
"tslib": "^2.3.1"
},
"dependencies": {
"framework-utils": "^1.1.0",
"moveable": "~0.53.0"
}
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/consts.ts
================================================
// auto
// eslint-disable-next-line max-len
export const ANGULAR_MOVEABLE_INPUTS: ["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","preventRightClick","preventWheelClick","requestStyles","snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll","snapRotationThreshold","snapRotationDegrees","snapHorizontalThreshold","snapVerticalThreshold","horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance","pinchable","draggable","throttleDrag","throttleDragRotate","hideThrottleDragRotateLine","startDragRotate","edgeDraggable","resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError","scalable","throttleScale","warpable","rotatable","rotationPosition","throttleRotate","rotationTarget","rotateAroundControls","resolveAblesWithRotatable","scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions","padding","origin","svgOrigin","originDraggable","originRelative","clippable","defaultClipPath","customClipPath","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold","roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls","defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines","individualGroupable","individualGroupableProps","clickable","dragArea","passDragArea"] = ["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","preventRightClick","preventWheelClick","requestStyles","snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll","snapRotationThreshold","snapRotationDegrees","snapHorizontalThreshold","snapVerticalThreshold","horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance","pinchable","draggable","throttleDrag","throttleDragRotate","hideThrottleDragRotateLine","startDragRotate","edgeDraggable","resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError","scalable","throttleScale","warpable","rotatable","rotationPosition","throttleRotate","rotationTarget","rotateAroundControls","resolveAblesWithRotatable","scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions","padding","origin","svgOrigin","originDraggable","originRelative","clippable","defaultClipPath","customClipPath","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold","roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls","defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines","individualGroupable","individualGroupableProps","clickable","dragArea","passDragArea"];
export const ANGULAR_MOVEABLE_OUTPUTS: ["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd","changeTargets","snap","bound","pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd","dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd","resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd","scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd","warpStart","warp","warpEnd","rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd","scroll","scrollGroup","dragOriginStart","dragOrigin","dragOriginEnd","clipStart","clip","clipEnd","roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd","click","clickGroup","renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"] = ["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd","changeTargets","snap","bound","pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd","dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd","resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd","scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd","warpStart","warp","warpEnd","rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd","scroll","scrollGroup","dragOriginStart","dragOrigin","dragOriginEnd","clipStart","clip","clipEnd","roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd","click","clickGroup","renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"];
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/ngx-moveable.component.ts
================================================
import {
Component,
OnDestroy,
OnInit,
OnChanges,
SimpleChanges,
EventEmitter,
ElementRef,
NgZone,
Inject,
} from '@angular/core';
import Moveable, { PROPERTIES, EVENTS, MoveableOptions } from 'moveable';
import { IObject } from '@daybrush/utils';
import { NgxMoveableInterface } from './ngx-moveable.interface';
import { ANGULAR_MOVEABLE_INPUTS, ANGULAR_MOVEABLE_OUTPUTS } from './consts';
@Component({
standalone: true,
selector: 'ngx-moveable',
template: '',
inputs: ANGULAR_MOVEABLE_INPUTS,
outputs: ANGULAR_MOVEABLE_OUTPUTS,
})
export class NgxMoveableComponent
extends NgxMoveableInterface
implements OnDestroy, OnInit, OnChanges
{
constructor(
@Inject(NgZone)
private _ngZone: NgZone,
@Inject(ElementRef)
private _elementRef: ElementRef,
) {
super();
EVENTS.forEach((name) => {
// @ts-expect-error
this[name] = new EventEmitter();
});
}
ngOnInit(): void {
const options: MoveableOptions = {};
const events: IObject = {};
PROPERTIES.forEach(name => {
// @ts-expect-error
(options as any)[name] = this[name];
});
EVENTS.forEach(name => {
events[name] = (event: any) => {
// @ts-expect-error
const emitter = this[name];
if (emitter && (emitter.observed || emitter.observers.length > 0)) {
this._ngZone.run(() => emitter.emit(event));
}
};
});
const container = this._elementRef.nativeElement;
this.moveable = this._ngZone.runOutsideAngular(() => new Moveable(container, {
...options,
warpSelf: true,
}));
this.moveable.on(events);
}
ngOnChanges(changes: SimpleChanges): void {
const moveable = this.moveable;
if (!moveable) {
return;
}
for (const name in changes) {
const { previousValue, currentValue } = changes[name];
if (previousValue === currentValue) {
continue;
}
// @ts-expect-error
moveable[name] = currentValue;
}
}
ngOnDestroy() {
this.moveable.destroy();
}
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/ngx-moveable.interface.ts
================================================
import Moveable, {
MoveableInterface,
METHODS,
MoveableProperties,
} from 'moveable';
import { MethodInterface, withMethods } from 'framework-utils';
import { NgxMoveableEvents } from './types';
export class NgxMoveableInterface {
@withMethods(METHODS, { dragStart: 'ngDragStart' })
protected moveable!: Moveable;
}
export interface NgxMoveableInterface
extends NgxMoveableEvents,
MoveableProperties,
MethodInterface<
MoveableInterface,
Moveable,
NgxMoveableInterface,
{
dragStart: 'ngDragStart';
}
> {}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/ngx-moveable.legacy.component.ts
================================================
import {
Component,
OnDestroy,
OnInit,
OnChanges,
SimpleChanges,
EventEmitter,
ElementRef,
NgZone,
Inject,
} from '@angular/core';
import Moveable, { PROPERTIES, EVENTS, MoveableOptions } from 'moveable';
import { IObject } from '@daybrush/utils';
import { NgxMoveableInterface } from './ngx-moveable.interface';
import { ANGULAR_MOVEABLE_INPUTS, ANGULAR_MOVEABLE_OUTPUTS } from './consts';
@Component({
selector: 'ngx-moveable',
template: '',
inputs: ANGULAR_MOVEABLE_INPUTS,
outputs: ANGULAR_MOVEABLE_OUTPUTS,
})
export class NgxLegacyMoveableComponent
extends NgxMoveableInterface
implements OnDestroy, OnInit, OnChanges
{
constructor(
@Inject(NgZone)
private _ngZone: NgZone,
@Inject(ElementRef)
private _elementRef: ElementRef,
) {
super();
EVENTS.forEach((name) => {
// @ts-expect-error
this[name] = new EventEmitter();
});
}
ngOnInit(): void {
const options: MoveableOptions = {};
const events: IObject = {};
PROPERTIES.forEach(name => {
// @ts-expect-error
(options as any)[name] = this[name];
});
EVENTS.forEach(name => {
events[name] = (event: any) => {
// @ts-expect-error
const emitter = this[name];
if (emitter && (emitter.observed || emitter.observers.length > 0)) {
this._ngZone.run(() => emitter.emit(event));
}
};
});
const container = this._elementRef.nativeElement;
this.moveable = this._ngZone.runOutsideAngular(() => new Moveable(container, {
...options,
warpSelf: true,
}));
this.moveable.on(events);
}
ngOnChanges(changes: SimpleChanges): void {
const moveable = this.moveable;
if (!moveable) {
return;
}
for (const name in changes) {
const { previousValue, currentValue } = changes[name];
if (previousValue === currentValue) {
continue;
}
// @ts-expect-error
moveable[name] = currentValue;
}
}
ngOnDestroy() {
this.moveable.destroy();
}
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/ngx-moveable.module.ts
================================================
import { NgModule } from '@angular/core';
import { NgxLegacyMoveableComponent } from './ngx-moveable.legacy.component';
@NgModule({
declarations: [NgxLegacyMoveableComponent],
exports: [NgxLegacyMoveableComponent],
})
export class NgxMoveableModule {}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/public-api.ts
================================================
/*
* Public API Surface of ngx-moveable
*/
export * from './ngx-moveable.component';
export * from './ngx-moveable.legacy.component';
export * from './ngx-moveable.module';
export * from 'moveable';
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/test.ts
================================================
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/src/types.ts
================================================
import { MoveableEventsParameters, MoveableOptions } from 'moveable';
import { EventEmitter } from '@angular/core';
export type RequiredMoveableOptions = Required;
export type NgxMoveableEvents = {
[key in keyof MoveableEventsParameters]: EventEmitter;
};
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/tsconfig.lib.json
================================================
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/tsconfig.lib.prod.json
================================================
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/tsconfig.spec.json
================================================
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}
================================================
FILE: packages/ngx-moveable/projects/ngx-moveable/tslint.json
================================================
{
"extends": "../../tslint.json",
"rules": {
"forin": false,
"no-output-native": false,
"directive-selector": [
true,
"attribute",
"",
"camelCase"
],
"component-selector": [
true,
"element",
"",
"kebab-case"
]
}
}
================================================
FILE: packages/ngx-moveable/src/app/app.component.css
================================================
================================================
FILE: packages/ngx-moveable/src/app/app.component.html
================================================
Moveable
An Angular Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable,
Pinchable.
About Moveable /
API /
Main Project
================================================
FILE: packages/ngx-moveable/src/app/app.component.spec.ts
================================================
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'ngx-moveable-app'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('ngx-moveable-app');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to ngx-moveable-app!');
});
});
================================================
FILE: packages/ngx-moveable/src/app/app.component.ts
================================================
import { Component, ViewChild, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { Frame } from 'scenejs';
import { NgxMoveableComponent } from 'projects/ngx-moveable/src/public-api';
import type { OnPinch, OnDrag, OnScale, OnRotate, OnResize, OnWarp } from 'moveable';
// import { NgxMoveableComponent } from 'src/ngx-moveable';
@Component({
// tslint:disable-next-line: component-selector
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit, OnDestroy {
@ViewChild('target', { static: false }) target!: ElementRef;
@ViewChild('label', { static: false }) label!: ElementRef;
@ViewChild('moveable', { static: false }) moveable!: NgxMoveableComponent;
scalable = true;
resizable = false;
warpable = false;
frame = new Frame({
width: '250px',
height: '200px',
left: '0px',
top: '0px',
transform: {
rotate: '0deg',
scaleX: 1,
scaleY: 1,
matrix3d: [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
],
},
});
ngOnInit(): void {
window.addEventListener('resize', this.onWindowReisze);
}
ngOnDestroy(): void {
window.removeEventListener('resize', this.onWindowReisze);
}
onWindowReisze = () => {
console.log(this.moveable.ngDragStart);
this.moveable.updateRect();
}
clickScalable() {
this.scalable = true;
this.resizable = false;
this.warpable = false;
}
clickResizable() {
this.scalable = false;
this.resizable = true;
this.warpable = false;
}
clickWarpable() {
this.scalable = false;
this.resizable = false;
this.warpable = true;
}
setTransform(target: HTMLElement | SVGElement) {
target.style.cssText = this.frame.toCSS();
}
setLabel(clientX: number, clientY: number, text: string) {
this.label.nativeElement.style.cssText = `
display: block; transform: translate(${clientX}px, ${clientY - 10}px) translate(-100%, -100%) translateZ(-100px);`;
this.label.nativeElement.innerHTML = text;
}
onPinch({ target, clientX, clientY }: OnPinch) {
setTimeout(() => {
this.setLabel(clientX, clientY, `X: ${this.frame.get('left')}
Y: ${this.frame.get('top')}
W: ${this.frame.get('width')}
H: ${this.frame.get('height')}
S: ${this.frame.get('transform', 'scaleX').toFixed(2)}, ${this.frame.get('transform', 'scaleY').toFixed(2)}
R: ${parseFloat(this.frame.get('transform', 'rotate')).toFixed(1)}deg
`);
});
}
onDrag({ target, clientX, clientY, top, left, isPinch }: OnDrag) {
this.frame.set('left', `${left}px`);
this.frame.set('top', `${top}px`);
this.setTransform(target);
if (!isPinch) {
this.setLabel(clientX, clientY, `X: ${left}px Y: ${top}px`);
}
}
onScale({ target, delta, clientX, clientY, isPinch }: OnScale) {
const scaleX = this.frame.get('transform', 'scaleX') * delta[0];
const scaleY = this.frame.get('transform', 'scaleY') * delta[1];
this.frame.set('transform', 'scaleX', scaleX);
this.frame.set('transform', 'scaleY', scaleY);
this.setTransform(target);
if (!isPinch) {
this.setLabel(clientX, clientY, `S: ${scaleX.toFixed(2)}, ${scaleY.toFixed(2)}`);
}
}
onRotate({ target, clientX, clientY, beforeDelta, isPinch }: OnRotate) {
const deg = parseFloat(this.frame.get('transform', 'rotate')) + beforeDelta;
this.frame.set('transform', 'rotate', `${deg}deg`);
this.setTransform(target);
if (!isPinch) {
this.setLabel(clientX, clientY, `R: ${deg.toFixed(1)}`);
}
}
onResize({ target, clientX, clientY, width, height, isPinch }: OnResize) {
this.frame.set('width', `${width}px`);
this.frame.set('height', `${height}px`);
this.setTransform(target);
if (!isPinch) {
this.setLabel(clientX, clientY, `W: ${width}px H: ${height}px`);
}
}
onWarp({ target, clientX, clientY, delta, multiply }: OnWarp) {
this.frame.set('transform', 'matrix3d', multiply(this.frame.get('transform', 'matrix3d'), delta));
this.setTransform(target);
this.setLabel(clientX, clientY, `X: ${clientX}px Y: ${clientY}px`);
}
onEnd() {
this.label.nativeElement.style.display = 'none';
}
}
================================================
FILE: packages/ngx-moveable/src/app/app.module.ts
================================================
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxMoveableModule } from '../../projects/ngx-moveable/src/ngx-moveable.module';
// import { NgxMoveableModule } from 'ngx-moveable';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
NgxMoveableModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
================================================
FILE: packages/ngx-moveable/src/environments/environment.prod.ts
================================================
export const environment = {
production: true
};
================================================
FILE: packages/ngx-moveable/src/environments/environment.ts
================================================
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
================================================
FILE: packages/ngx-moveable/src/index.html
================================================
ngx-moveable-app
================================================
FILE: packages/ngx-moveable/src/main.ts
================================================
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
================================================
FILE: packages/ngx-moveable/src/polyfills.ts
================================================
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
================================================
FILE: packages/ngx-moveable/src/styles.css
================================================
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,600&display=swap");
@import url("https://fonts.googleapis.com/css?family=Roboto:100&display=swap");
html,
body {
font-family: "Open Sans", sans-serif;
position: relative;
margin: 0;
padding: 0;
height: 100%;
color: #333;
letter-spacing: 1px;
background: #f5f5f5;
font-weight: 300;
}
a {
text-decoration: none;
color: #333;
}
.page {
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.page:nth-child(2n) {
background: #f0f0f0;
}
.container {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.moveable {
font-family: "Roboto", sans-serif;
position: relative;
width: 250px;
height: 200px;
text-align: center;
font-size: 40px;
margin: 0px auto;
font-weight: 100;
letter-spacing: 1px;
}
.moveable span {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
white-space: nowrap;
}
.description {
text-align: center;
}
.badges {
padding: 10px;
text-align: center;
}
.badges img {
height: 20px;
}
.buttons.able a {
min-width: auto;
padding: 8px 20px;
}
.buttons {
text-align: center;
margin: 0;
padding: 10px;
}
.buttons a {
margin: 0;
position: relative;
text-decoration: none;
color: #333;
border: 1px solid #333;
padding: 12px 30px;
min-width: 140px;
text-align: center;
/* font-weight: 400; */
display: inline-block;
box-sizing: border-box;
margin: 5px;
transition: all ease 0.5s;
}
.buttons a:hover,
.buttons a.selected {
background: #333;
color: #fff;
}
.page.main {
z-index: 1;
min-height: 700px;
}
.label {
position: fixed;
top: 0;
left: 0;
padding: 5px;
border-radius: 5px;
background: #333;
z-index: 10;
color: #fff;
font-weight: bold;
font-size: 12px;
display: none;
transform: translate(-100%, -100%);
z-index: 3001;
}
.page.feature,
.page.footer {
height: auto;
text-align: left;
padding: 60px 20px;
}
.page.feature .container,
.page.footer .container {
top: 0;
left: 0;
padding: 60px 0px;
margin: auto;
transform: none;
width: auto;
max-width: 800px;
}
.page.feature .container {
display: flex;
}
.page.footer .container {
padding: 0px;
}
.page.feature h2.container {
padding: 10px 0px;
font-weight: 300;
font-size: 40px;
}
.feature .container .left {
position: relative;
width: 300px;
height: 205px;
display: inline-block;
vertical-align: top;
z-index: 2000;
margin-bottom: 20px;
}
.feature .container .right {
position: relative;
display: inline-block;
vertical-align: top;
flex: 1;
}
.feature .right .description {
text-align: left;
margin: 0px 0px 10px;
}
.feature .right .description strong {
font-weight: 600;
}
.draggable,
.resizable,
.scalable,
.rotatable,
.origin,
.warpable,
.pinchable {
position: absolute;
left: 0;
}
.origin {
transform-origin: 30% 50%;
}
pre {
position: relative;
border: 1px solid #ccc;
box-sizing: border-box;
padding: 10px;
max-width: 500px;
}
code.hljs {
padding: 0;
}
.tab {
padding: 10px 12px;
appearance: none;
-webkit-appearance: none;
background: transparent;
border: 1px solid #ccc;
box-shadow: none;
font-weight: bold;
margin: 0;
cursor: pointer;
outline: none;
}
.tab.selected {
background: #333;
color: #fff;
border: 1px solid #333;
}
.panel {
display: none;
}
.panel.selected {
display: block;
}
.page.footer {
font-weight: 400;
}
.page.footer a {
text-decoration: underline;
}
.page.footer span:first-child:before {
content: "";
}
.page.footer span:before {
content: "/";
}
@media screen and (max-width: 750px) {
.page.feature .container {
display: block;
}
.page.feature .container {
text-align: center;
}
.page.feature .left,
.page.feature .right {
display: block;
margin: 0px auto 20px;
}
.page.feature .right {
text-align: left;
}
}
================================================
FILE: packages/ngx-moveable/src/test.ts
================================================
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
================================================
FILE: packages/ngx-moveable/tsconfig.app.json
================================================
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"include": [
"src/**/*.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}
================================================
FILE: packages/ngx-moveable/tsconfig.base.json
================================================
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"strict": true,
"declaration": false,
"module": "es2020",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": false,
"target": "es2015",
"lib": ["esnext", "dom"],
"paths": {
"ngx-moveable": ["projects/ngx-moveable/src/public-api.ts"]
}
},
"angularCompilerOptions": {
"strictTemplates": false,
"strictInjectionParameters": true,
"fullTemplateTypeCheck": true
}
}
================================================
FILE: packages/ngx-moveable/tsconfig.json
================================================
// This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
// It is not intended to be used to perform a compilation.
{
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./projects/ngx-moveable/tsconfig.lib.json"
},
{
"path": "./projects/ngx-moveable/tsconfig.spec.json"
}
]
}
================================================
FILE: packages/ngx-moveable/tsconfig.spec.json
================================================
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
================================================
FILE: packages/ngx-moveable/tslint.json
================================================
{
"extends": "tslint:recommended",
"rules": {
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warn"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"",
"camelCase"
],
"component-selector": [
true,
"element",
"",
"kebab-case"
],
"import-blacklist": [
true,
"rxjs/Rx"
],
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-use-before-declare": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [
true,
"single"
],
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
"rulesDirectory": [
"codelyzer"
]
}
================================================
FILE: packages/preact-moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.55.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.54.0...preact-moveable@0.55.0) (2023-12-03)
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
## [0.54.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.53.2...preact-moveable@0.54.0) (2023-10-28)
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.53.2](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.53.1...preact-moveable@0.53.2) (2023-09-19)
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.53.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.53.0...preact-moveable@0.53.1) (2023-07-11)
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.53.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.52.2...preact-moveable@0.53.0) (2023-07-09)
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.52.2](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.52.1...preact-moveable@0.52.2) (2023-07-04)
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.52.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.51.1...preact-moveable@0.52.1) (2023-07-02)
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.51.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.51.0...preact-moveable@0.51.1) (2023-06-28)
### :house: Code Refactoring
* change rollup to vite ([213f346](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/213f346257289eaec6f3f6f618e8fba33859c384))
### :mega: Other
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.51.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.50.0...preact-moveable@0.51.0) (2023-06-25)
### :mega: Other
* publish packages ([f893cca](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.50.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.49.7...preact-moveable@0.50.0) (2023-06-04)
### :bug: Bug Fix
* fix ownerDocument css #932 ([76a852a](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/76a852ade3ffb41a1b246649945994f50e52b1f0))
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
## [0.49.7](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.49.6...preact-moveable@0.49.7) (2023-05-16)
### :bug: Bug Fix
* fix css-styled version #916 ([875fc19](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/875fc19fa7fac50cbbb3166dfaa512b18f7c790d))
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.49.6](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.49.5...preact-moveable@0.49.6) (2023-05-15)
### :bug: Bug Fix
* update croact, css-styled version #916 ([b517b64](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/b517b6498a612c072eadc9354d6383363771ea6d))
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.49.5](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.49.4...preact-moveable@0.49.5) (2023-05-09)
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.49.4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.49.0...preact-moveable@0.49.4) (2023-05-08)
### :bug: Bug Fix
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.49.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.48.1...preact-moveable@0.49.0) (2023-05-01)
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
## [0.48.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.48.0...preact-moveable@0.48.1) (2023-04-16)
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## [0.48.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.47.0...preact-moveable@0.48.0) (2023-04-13)
### :rocket: New Features
* add croact ([b94c41c](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/b94c41c50cdf37da0136bd4d04f2237529253f45))
* add croact compat ([233c6d0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/233c6d0a905953b51c3fd5df1f7c58e7b1d03432))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.47.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.46.3...preact-moveable@0.47.0) (2023-03-26)
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.46.3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.46.2...preact-moveable@0.46.3) (2023-03-21)
### :memo: Documentation
* fix README ([7426492](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/7426492de210ab6f38d411d96e6d843d7423f555))
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.46.2](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.46.1...preact-moveable@0.46.2) (2023-03-14)
### :memo: Documentation
* fix story url ([8977306](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/897730620480d8e830c4b53401a28d03b42b9a5f))
### :mega: Other
* update packages ([5b03d09](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.46.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.46.0...preact-moveable@0.46.1) (2023-03-10)
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
## [0.46.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.45.1...preact-moveable@0.46.0) (2023-03-08)
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
## [0.45.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.44.1...preact-moveable@0.45.1) (2023-01-29)
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.44.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.44.0...preact-moveable@0.44.1) (2022-12-16)
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.44.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.43.1...preact-moveable@0.44.0) (2022-12-10)
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.43.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.43.0...preact-moveable@0.43.1) (2022-12-05)
### :bug: Bug Fix
* move react-moveable path ([ec8e162](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/ec8e1620e05f1d5a1a45ecccec7481c2ea8a4f57))
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.43.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.42.1...preact-moveable@0.43.0) (2022-12-03)
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.42.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.42.0...preact-moveable@0.42.1) (2022-11-28)
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
## [0.42.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.41.0...preact-moveable@0.42.0) (2022-11-27)
### :memo: Documentation
* fix README ([3a153c8](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/3a153c849b7279ec5fd603167117c88f25a7149c))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
## [0.41.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.40.1...preact-moveable@0.41.0) (2022-11-13)
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.40.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.40.0...preact-moveable@0.40.1) (2022-11-06)
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.40.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.39.0...preact-moveable@0.40.0) (2022-11-04)
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
* update packages #760 ([5c77cf3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5c77cf3986fa319a170d8bd90b6cd720601b5172))
## [0.39.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.38.4...preact-moveable@0.39.0) (2022-10-17)
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
* update packages ([61730d5](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/61730d5c143d4027c55a714c764efe77bbebe5bf))
## [0.38.4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.38.1...preact-moveable@0.38.4) (2022-10-10)
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.38.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.38.0...preact-moveable@0.38.1) (2022-09-19)
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.38.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.37.4...preact-moveable@0.38.0) (2022-09-15)
### :bug: Bug Fix
* fix shadow dom css #729 ([7581afc](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/7581afc13a7c5f9f749b22d7bd3160de0972d112))
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.37.4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.37.3...preact-moveable@0.37.4) (2022-08-24)
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.37.3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.37.1...preact-moveable@0.37.3) (2022-08-23)
### :mega: Other
* publish packages ([3597bc5](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.37.1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.37.0...preact-moveable@0.37.1) (2022-08-12)
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.37.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.36.3...preact-moveable@0.37.0) (2022-08-06)
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.36.3](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.36.2...preact-moveable@0.36.3) (2022-08-03)
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.36.2](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.35.0...preact-moveable@0.36.2) (2022-08-01)
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.35.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.34.0...preact-moveable@0.35.0) (2022-07-25)
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
## [0.34.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.33.2...preact-moveable@0.34.0) (2022-07-21)
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
## [0.33.2](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.33.0...preact-moveable@0.33.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.33.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.32.0...preact-moveable@0.33.0) (2022-07-17)
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
## [0.32.0](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.9...preact-moveable@0.32.0) (2022-06-09)
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.31.9](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.8...preact-moveable@0.31.9) (2022-06-07)
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* publish packages ([3530f05](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
* update demo configuration ([917123c](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/917123cdea2830e8e8f4a8d7b2a99654f16682ef))
## [0.31.8](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.6...preact-moveable@0.31.8) (2022-05-01)
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.31.6](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.5...preact-moveable@0.31.6) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.31.5](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.4...preact-moveable@0.31.5) (2022-04-27)
### :mega: Other
* update packages versions ([5cd2398](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/5cd2398dbb4dbbda24032641fe5bf111780b75fc))
## [0.31.4](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/compare/preact-moveable@0.31.3...preact-moveable@0.31.4) (2022-04-26)
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
* upgrade storybook and typescript ([eff23fd](https://github.com/daybrush/moveable/blob/master/packages/preact-moveable/commit/eff23fd7340964ed0e3e6f5930e56558c4d91d18))
================================================
FILE: packages/preact-moveable/LICENSE
================================================
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: packages/preact-moveable/README.md
================================================
Preact Moveable
A Preact Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
Demo /
Storybook /
API /
Main Project
## 🔥 Features
* **Draggable** refers to the ability to drag and move targets.
* **Resizable** indicates whether the target's width and height can be increased or decreased.
* **Scalable** indicates whether the target's x and y can be scale of transform.
* **Rotatable** indicates whether the target can be rotated.
* **Warpable** indicates whether the target can be warped(distorted, bented).
* **Pinchable** indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* **Snappable** indicates whether to snap to the guideline.
* **OriginDraggable*** indicates Whether to drag origin.
* **Clippable** indicates Whether to clip the target.
* **Roundable** indicates Whether to show and drag or double click border-radius.
* Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
* Support Major Browsers
* Support 3d Transform
## ⚙️ Installation
```sh
$ npm i preact-moveable
```
## 📄 Documents
* [**Moveable Handbook**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md)
* [**How to use Group**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-group)
* [**How to use custom CSS**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-custom-css)
* [**How to make custom able**](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/src/ables/README.md)
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
## 🚀 How to use
```tsx
import Moveable from "preact-moveable";
render() {
return (
{
console.log("onDragStart", target);
}}
onDrag={({
target,
beforeDelta, beforeDist,
left, top,
right, bottom,
delta, dist,
transform,
clientX, clientY,
}: OnDrag) => {
console.log("onDrag left, top", left, top);
// target!.style.left = `${left}px`;
// target!.style.top = `${top}px`;
console.log("onDrag translate", dist);
target!.style.transform = transform;
}}
onDragEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onDragEnd", target, isDrag);
}}
/* When resize or scale, keeps a ratio of the width, height. */
keepRatio={true}
/* resizable*/
/* Only one of resizable, scalable, warpable can be used. */
resizable={true}
throttleResize={0}
onResizeStart={({ target , clientX, clientY}) => {
console.log("onResizeStart", target);
}}
onResize={({
target, width, height,
dist, delta,
clientX, clientY,
}: OnResize) => {
console.log("onResize", target);
delta[0] && (target!.style.width = `${width}px`);
delta[1] && (target!.style.height = `${height}px`);
}}
onResizeEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onResizeEnd", target, isDrag);
}}
/* scalable */
/* Only one of resizable, scalable, warpable can be used. */
scalable={true}
throttleScale={0}
onScaleStart={({ target, clientX, clientY }) => {
console.log("onScaleStart", target);
}}
onScale={({
target, scale, dist, delta, transform,
clientX, clientY,
}: OnScale) => {
console.log("onScale scale", scale);
target!.style.transform = transform;
}}
onScaleEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onScaleEnd", target, isDrag);
}}
/* rotatable */
rotatable={true}
throttleRotate={0}
onRotateStart={({ target, clientX, clientY }) => {
console.log("onRotateStart", target);
}}
onRotate={({
target,
delta, dist,
transform,
clientX, clientY,
}: onRotate) => {
console.log("onRotate", dist);
target!.style.transform = transform;
}}
onRotateEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onRotateEnd", target, isDrag);
}}
/* warpable */
/* Only one of resizable, scalable, warpable can be used. */
/*
this.matrix = [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
]
*/
warpable={true}
onWarpStart={({ target, clientX, clientY }) => {
console.log("onWarpStart", target);
}}
onWarp={({
target,
clientX,
clientY,
delta,
dist,
multiply,
transform,
}) => {
console.log("onWarp", target);
// target.style.transform = transform;
this.matrix = multiply(this.matrix, delta);
target.style.transform = `matrix3d(${this.matrix.join(",")})`;
}}
onWarpEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onWarpEnd", target, isDrag);
}}
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
pinchable={true}
onPinchStart={({ target, clientX, clientY, datas }) => {
// pinchStart event occur before dragStart, rotateStart, scaleStart, resizeStart
console.log("onPinchStart");
}}
onPinch={({ target, clientX, clientY, datas }) => {
// pinch event occur before drag, rotate, scale, resize
console.log("onPinch");
}}
onPinchEnd={({ isDrag, target, clientX, clientY, datas }) => {
// pinchEnd event occur before dragEnd, rotateEnd, scaleEnd, resizeEnd
console.log("onPinchEnd");
}}
/>
)
}
```
## ⚙️ Developments
### `npm start`
Runs the app in the development mode.
Open `demo/index.html` file.
## ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
## 👏 Contributing
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/daybrush/moveable/blob/master/CONTRIBUTING.md)].
## 🐞 Bug Report
If you find a bug, please report to us opening a new [Issue](https://github.com/daybrush/moveable/issues) on GitHub.
## Sponsors
## 📝 License
This project is [MIT](https://github.com/daybrush/moveable/blob/master/LICENSE) licensed.
```
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: packages/preact-moveable/demo/index.html
================================================
Preact App
You need to enable JavaScript to run this app.
================================================
FILE: packages/preact-moveable/groupable.md
================================================
## 🚀 How to use Groupable
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
* **draggable**
* [onDragGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroupStart)
* [onDragGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroup)
* [onDragGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroupEnd)
* **resizable**
* [onResizeGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroupStart)
* [onResizeGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroup)
* [onResizeGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroupEnd)
* **scalable**
* [onScaleGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:scaleGroupStart)
* [onScaleGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:scaleGroup)
* [onScaleGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rscaleGroupEnd)
* **rotatable**
* [onRotateGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroupStart)
* [onRotateGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroup)
* [onRotateGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroupEnd)
* **pinchable**
* [onPinchGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroupStart)
* [onPinchGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroup)
* [onPinchGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroupEnd)
```tsx
import Moveable from "preact-moveable";
render() {
return (
{
console.log("onDragGroupStart", targets);
}}
onDragGroup={({ targets, events }) => {
console.log("onDragGroup", targets);
events.forEach(ev => {
// drag event
console.log("onDrag left, top", ev.left, ev.top);
// ev.target!.style.left = `${ev.left}px`;
// ev.target!.style.top = `${ev.top}px`;
console.log("onDrag translate", ev.dist);
ev.target!.style.transform = ev.transform;)
});
}}
onDragGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onDragGroupEnd", target, isDrag);
}}
/* When resize or scale, keeps a ratio of the width, height. */
keepRatio={true}
/* resizable*/
/* Only one of resizable, scalable, warpable can be used. */
resizable={true}
throttleResize={0}
onResizeGroupStart={({ targets, clientX, clientY }) => {
console.log("onResizeGroupStart", targets);
}}
onResizeGroup={({ targets, direction }) => {
console.log("onResizeGroup", targets);
e.events.forEach(ev => {
const offset = [
direction[0] < 0 ? -ev.delta[0] : 0,
direction[1] < 0 ? -ev.delta[1] : 0,
];
// ev.drag is a drag event that occurs when the group resize.
const left = offset[0] + ev.drag.beforeDist[0];
const top = offset[1] + ev.drag.beforeDist[1];
const width = ev.width;
const top = ev.top;
});
}}
onResizeGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onResizeGroupEnd", targets, isDrag);
}}
/* scalable */
/* Only one of resizable, scalable, warpable can be used. */
scalable={true}
throttleScale={0}
onScaleGroupStart={({ targets, clientX, clientY }) => {
console.log("onScaleGroupStart", targets);
}}
onScale={({
targets,
events,
}) => {
console.log("onScaleGroup", targets);
events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group scale.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const scaleX = ev.scale[0];
const scaleY = ev.scale[1];
});
target!.style.transform = transform;
}}
onScaleEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onScaleGroupEnd", target, isDrag);
}}
/* rotatable */
rotatable={true}
throttleRotate={0}
onRotateGroupStart={({ targets, clientX, clientY }) => {
console.log("onRotateGroupStart", targets);
}}
onRotateGroup={({
targets,
events
delta, dist,
}) => {
e.events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group rotate.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const deg = ev.beforeDist;
});
}}
onRotateGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onRotateGroupEnd", targets, isDrag);
}}
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
pinchable={true}
onPinchGroupStart={({ targets, clientX, clientY, datas }) => {
// pinchGroupStart event occur before dragGroupStart, rotateGroupStart, scaleGroupStart, resizeGroupStart
console.log("onPinchGroupStart");
}}
onPinchGroup={({ targets, clientX, clientY, datas }) => {
// pinchGroup event occur before dragGroup, rotateGroup, scaleGroup, resizeGroup
console.log("onPinchGroup");
}}
onPinchGroupEnd={({ isDrag, targets, clientX, clientY, datas }) => {
// pinchGroupEnd event occur before dragGroupEnd, rotateGroupEnd, scaleGroupEnd, resizeGroupEnd
console.log("onPinchGroupEnd");
}}
/>
);
}
```
================================================
FILE: packages/preact-moveable/package.json
================================================
{
"name": "preact-moveable",
"version": "0.55.0",
"description": "A Preact Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Pinchable, Groupable, Snappable.",
"main": "./dist/moveable.cjs.js",
"module": "./dist/moveable.esm.js",
"sideEffects": false,
"types": "declaration/index.d.ts",
"scripts": {
"start": "open ./demo/index.html && rollup -c rollup.config.demo.js -w",
"build": "rollup -c && npm run declaration && print-sizes ./dist ",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json"
},
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*"
],
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"groupable",
"movable",
"warpable",
"pinchable",
"snappable",
"throttle",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"warp",
"preact",
"pinch",
"snap"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/preact-moveable"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"devDependencies": {
"@daybrush/builder": "^0.2.4",
"keycon": "^0.3.0",
"preact": "^10.0.0",
"print-sizes": "^0.2.0",
"pvu": "^0.3.1",
"rollup-plugin-css-bundle": "^1.0.4",
"rollup-plugin-preact": "^0.5.2",
"typescript": "^4.8 <4.9"
},
"dependencies": {
"preact-css-styled": "^1.1.9",
"react-moveable": "~0.56.0"
}
}
================================================
FILE: packages/preact-moveable/rollup.config.demo.js
================================================
const builder = require("@daybrush/builder");
const css = require("rollup-plugin-css-bundle");
const preact = require("rollup-plugin-preact");
modulex.exports = builder({
input: "./src/demo/index.tsx",
tsconfig: "./tsconfig.build.json",
sourcemap: false,
format: "umd",
output: "./demo/dist/index.js",
name: "app",
exports: "named",
plugins: [
css({ output: "./demo/dist/index.css" }),
preact({
noPropTypes: true,
noEnv: true,
noReactIs: true,
resolvePreactCompat: true,
// usePreactX: true,
}),
],
});
================================================
FILE: packages/preact-moveable/rollup.config.js
================================================
const builder = require("@daybrush/builder");
const preact = require("rollup-plugin-preact");
const defaultOptions = {
sourcemap: false,
tsconfig: "tsconfig.build.json",
typescript2: true,
external: {
"@daybrush/utils": "utils",
"gesto": "Gesto",
"preact": "preact",
"preact/compat": "preact/compat",
"preact-compat": "preact-compat",
"framework-utils": "framework-utils",
"preact-css-styled": "preact-css-styled",
"@egjs/agent": "eg.Agent",
"@egjs/children-differ": "eg.ChildrenDiffer",
"@egjs/list-differ": "eg.ListDiffer",
"@moveable/matrix": "@moveable/matrix",
"@scena/dragscroll": "@scena/dragscroll",
"css-to-mat": "css-to-mat",
"overlap-area": "overlap-area",
"@scena/matrix": "@scena/matrix",
},
exports: "named",
plugins: [
preact({
noPropTypes: false,
noEnv: false,
noReactIs: false,
usePreactX: true,
// resolvePreactCompat: true,
aliasModules: {
"react-css-styled": "preact-css-styled",
},
}),
],
};
module.exports = builder([
{
...defaultOptions,
input: "src/preact-moveable/Moveable.ts",
output: "./dist/moveable.esm.js",
format: "es",
},
{
...defaultOptions,
input: "src/preact-moveable/Moveable.ts",
output: "./dist/moveable.cjs.js",
format: "cjs",
exports: "default",
},
]);
================================================
FILE: packages/preact-moveable/src/demo/App.css
================================================
.App {
text-align: center;
transform-origin: 30% 50%;
transform: scaleX(-0.8) translateY(30px);
}
.App * {
position: relative;
}
.App-logo {
position: relative;
/* animation: App-logo-spin infinite 20s linear; */
transform: rotate(18deg);
width: 300px;
height: 200px;
}
.App code {
display: inline-block;
}
img {
background: #f55;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
transform: rotate(-9deg);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
================================================
FILE: packages/preact-moveable/src/demo/App.tsx
================================================
import { h, Component } from "preact";
import Moveable, { MoveableInterface } from "../preact-moveable";
import "./App.css";
import { ref } from "framework-utils";
import KeyController from "keycon";
class App extends Component {
public moveable: MoveableInterface;
public state = {
target: null,
isResizable: true,
};
public deg = 18;
public render() {
const selectedTarget = this.state.target;
const isResizable = this.state.isResizable;
return (
{
target!.style.transform = transform;
}}
onDrag={({ target, transform }) => {
// target!.style.left = `${left}px`;
// target!.style.top = `${top}px`;
target!.style.transform = transform;
}}
onScale={({ target, transform }) => {
target!.style.transform = transform;
}}
onResize={({ target, width, height, delta }) => {
delta[0] && (target!.style.width = `${width}px`);
delta[1] && (target!.style.height = `${height}px`);
}}
/>
);
}
public onClick = (e: any) => {
console.log("?", e.target.className);
e.preventDefault();
const keycon = new KeyController(window);
keycon.keydown("shift", () => {
this.setState({ isResizable: false });
}).keyup("shift", () => {
this.setState({ isResizable: true });
})
if (!this.moveable.isMoveableElement(e.target)) {
if (this.state.target === e.target) {
this.moveable.updateRect();
} else {
this.setState({
target: e.target,
});
}
}
}
}
export default App;
================================================
FILE: packages/preact-moveable/src/demo/index.tsx
================================================
import { render, h } from "preact";
import App from "./App";
render( , document.getElementById("root")!);
================================================
FILE: packages/preact-moveable/src/preact-moveable/Moveable.ts
================================================
import Moveable from "react-moveable";
import Preact from "preact";
import { PreactMoveableInterface } from "./types";
export default Moveable as any as new (...args: any[]) => PreactMoveableInterface;
================================================
FILE: packages/preact-moveable/src/preact-moveable/index.ts
================================================
import Moveable from "./Moveable";
export * from "react-moveable/types";
export * from "./types";
export default Moveable;
================================================
FILE: packages/preact-moveable/src/preact-moveable/types.ts
================================================
import { MoveableProps, MoveableState, MoveableInterface } from "react-moveable/types";
import { Component } from "preact";
export type PreactMoveableInterface = {
[key in Exclude]: MoveableInterface[key]
} & Component;
================================================
FILE: packages/preact-moveable/tsconfig.build.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"jsx": "react",
"jsxFactory": "h",
},
}
================================================
FILE: packages/preact-moveable/tsconfig.declaration.json
================================================
{
"extends": "./tsconfig",
"compilerOptions": {
"allowJs": false,
"noEmit": false,
"isolatedModules": false,
"removeComments": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "declaration"
},
"include": [
"./src/preact-moveable/**/*"
]
}
================================================
FILE: packages/preact-moveable/tsconfig.json
================================================
{
"compilerOptions": {
"outDir": "./outjs/",
"esModuleInterop": false,
"sourceMap": true,
"module": "esnext",
"target": "es5",
"experimentalDecorators": true,
"skipLibCheck": true,
"moduleResolution": "node",
"jsx": "preserve",
"lib": [
"es2015",
"dom"
],
"allowJs": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": [
"./src/**/*.ts"
]
}
================================================
FILE: packages/preact-moveable/tslint.json
================================================
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"rules": {
"typedef": [true, "parameter"],
"jsdoc-format": false,
"forin": false,
"no-console": false,
"no-any": false,
"interface-name": false,
"indent": [
true,
"spaces",
4
],
"ordered-imports": false,
"object-literal-sort-keys": false,
"no-unused-expression": false,
"arrow-parens": [
true,
"ban-single-arg-parens"
],
"max-line-length": [
true,
{
"limit": 120,
"ignore-pattern": "(\\* @)|//"
}
],
"trailing-comma": [
true,
{
"multiline": {
"objects": "always",
"arrays": "always",
"functions": "always",
"typeLiterals": "ignore"
},
"esSpecCompliant": true
}
]
}
}
================================================
FILE: packages/react-moveable/.eslintignore
================================================
node_modules
dist
*.js
================================================
FILE: packages/react-moveable/.eslintrc
================================================
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
],
"rules": {
"no-console": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"import/no-webpack-loader-syntax": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true,
"ignoreProperties": false
}
],
"@typescript-eslint/no-unused-vars": [
"error"
],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/indent": [
"error",
4
],
"@typescript-eslint/adjacent-overload-signatures": "off",
"max-len": [
"error",
{
"code": 120,
"comments": 400,
"ignoreTemplateLiterals": true,
"ignorePattern": "^\\s*type\\s.+=\\s*"
}
],
"arrow-parens": "off",
"no-empty-interface": "off",
"comma-dangle": [
"error",
"always-multiline"
],
"semi": [
"error",
"always"
]
}
}
================================================
FILE: packages/react-moveable/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
stories/**/vue3/
stories/**/vue2/
stories/**/svelte/
stories/**/script/
stories/**/lit/
stories/**/angular/
.nyc_output
test-static
__snapshots__
*.stories.mdx
================================================
FILE: packages/react-moveable/.npmignore
================================================
node_modules/
*.DS_Store
.DS_Store
doc/
template/
example/
karma.conf.js
test/
mocha.opts
Gruntfile.js
webpack.*.js
.travis.yml
packages
release/
demo/
coverage/
dist/report.html
rollup-plugin-visualizer/
outjs/
.scene_cache
*.mp3
*.mp4
storybook/
src/
public/
groupable.md
test/
src/
public/
stories/
.storybook
================================================
FILE: packages/react-moveable/.storybook/main.js
================================================
require("./readme");
const { DefinePlugin } = require("webpack");
const path = require("path");
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
features: {
interactionsDebugger: true,
previewMdx2: true, // 👈 MDX 2 enabled here
},
typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
webpackFinal: (config) => {
const definePlugin = new DefinePlugin({
SKIP_TEST: process.env.SKIP_TEST,
EXEC_TEST: process.env.EXEC_TEST,
});
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: 'ts-loader',
options: {
// disable type checker - we will use it in fork plugin
transpileOnly: true
},
});
config.plugins.push(definePlugin);
config.plugins.push(new ForkTsCheckerWebpackPlugin());
config.resolve.alias["@/stories"] = path.resolve(__dirname, "../stories");
config.resolve.alias["@/react-moveable"] = path.resolve(__dirname, "../src");
config.resolve.alias["@/helper"] = path.resolve(__dirname, "../../helper/src");
config.resolve.alias["@moveable/helper"] = path.resolve(__dirname, "../../helper/src");
return config;
},
stories: [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
addons: [
"@storybook/addon-google-analytics",
{
name: '@storybook/addon-docs',
options: { configureJSX: true },
},
"storybook-addon-preview/register",
"@storybook/addon-controls/register",
"@storybook/addon-viewport/register",
"storybook-dark-mode/register",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
// {
// name: "@storybook/addon-coverage",
// options: {
// exclude: [
// "**/stories/**",
// "stories/**",
// "*{App}.tsx",
// ],
// },
// },
],
"framework": "@storybook/react",
};
================================================
FILE: packages/react-moveable/.storybook/manager.js
================================================
import { addons } from "@storybook/addons";
addons.setConfig({
// showRoots: false,
panelPosition: "right",
});
window.STORYBOOK_GA_ID = "G-TRBNXHQ0ZF"
window.STORYBOOK_REACT_GA_OPTIONS = {}
================================================
FILE: packages/react-moveable/.storybook/preview-head.html
================================================
================================================
FILE: packages/react-moveable/.storybook/preview.jsx
================================================
import * as React from "react";
import { themes } from "@storybook/theming";
import {
INITIAL_VIEWPORTS,
// or MINIMAL_VIEWPORTS,
} from "@storybook/addon-viewport";
import {
Title,
Primary,
PRIMARY_STORY,
ArgsTable,
DocsContainer,
DocsContext,
} from "@storybook/addon-docs";
// or global addParameters
export const parameters = {
options: {
storySort: (a, b) => {
return a[1].kind === b[1].kind
? 0
: a[2].fileName.localeCompare(b[2].fileName, undefined, { numeric: true });
},
},
docs: {
container: DocsContainer,
page: () => {
const context = React.useContext(DocsContext);
return <>
{context.name}
>;
},
},
controls: {
passArgsFirst: true,
expanded: true,
hideNoControlsWarning: true,
},
viewport: {
viewports: {
...INITIAL_VIEWPORTS,
},
},
darkMode: {
stylePreview: true,
// Override the default light theme
light: { ...themes.normal },
// Override the default dark theme
dark: { ...themes.dark },
},
};
================================================
FILE: packages/react-moveable/.storybook/readme.js
================================================
const path = require("path");
const fs = require("fs");
const readmeText = fs.readFileSync(path.resolve(__dirname, "../../../README.md"), {
encoding: "utf-8",
});
fs.mkdirSync(path.resolve(__dirname, "../stories/0-Introduction"), {
recursive: true,
});
fs.writeFileSync(path.resolve(__dirname, "../stories/0-Introduction/readme.stories.mdx"), `
import { Meta } from "@storybook/addon-docs";
${readmeText}`, {
encoding: "utf-8",
});
================================================
FILE: packages/react-moveable/.storybook/test-runner.js
================================================
const customSnapshotsDir = `${process.cwd()}/__snapshots__`;
module.exports = {
async postRender(page, context) {
if (!process.env.SKIP_TEST) {
return;
}
// If you want to take screenshot of multiple browsers, use
// page.context().browser().browserType().name() to get the browser name to prefix the file name
await page.screenshot({ path: `${customSnapshotsDir}/${context.id}.png` });
},
};
================================================
FILE: packages/react-moveable/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.56.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.55.0...react-moveable@0.56.0) (2023-12-03)
### :rocket: New Features
* add snapHorizontalThreshold, snapVerticalThreshold #1044 ([6cd5114](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6cd51145ec81b3294c0ba9968d6530748ae46beb))
* expose gesto preventRightClick and preventWheelClick props (#1040) ([9f4c9f4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9f4c9f452470026ecea3f7a0b1aff91c22444868))
### :bug: Bug Fix
* fix dragTarget in control box #1054 ([f4e3232](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f4e3232c787f50f9a9947c45307870e5ad5c87ef))
* fix names ([7722add](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7722addf758da09480808f1e03c5b9e3061f855b))
* fix svg origin for viewbox and foreignbox #1048 ([6c27742](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6c2774205077fa982bf140a413fdef1b6f2f8a7a))
* updateSelector's update #1055 ([fc9da03](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/fc9da032daa1c721cf47e3c97434f698849137ad))
### :house: Code Refactoring
* let the target be passed into dragStart (#1050) ([786fc0c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/786fc0cd4cb3f3f67719740aa953231b7d410815))
### :mega: Other
* publish packages ([f9a0eed](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f9a0eed9db93c1fa3522138e9c7604287f0ce21f))
* update gesto version ([4d12e48](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4d12e484ea08bc1630c6a301b86c34a5d7a023c2))
## [0.55.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.54.2...react-moveable@0.55.0) (2023-10-28)
### :rocket: New Features
* add snapGridAll prop #990 ([7ecd0d0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7ecd0d04595b72b882a1a69a4676dc140bb9eb21))
### :bug: Bug Fix
* fix line break #1001 ([5f68143](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5f68143289bd25c505d40684662a071b39417727))
* fix nested svg #1011 ([33366b5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/33366b53c4871b1b7676c234168d1ef0cb0ba3c3))
* fix throttleDrag for group ([5f6d392](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5f6d392f4731a4728b7e04e856d4a4805f7ac89b))
* fix width scale for keepRatio #1020 ([8dd5c36](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8dd5c3613faac796021a6057d4a54ce660eac329))
* remove console.log ([56f99ea](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/56f99ea6652f23becfd88596d84194fcbaec2277))
### :mega: Other
* publish packages ([1a65454](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1a654540f1390648d7e4db910d0673acff190007))
## [0.54.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.54.1...react-moveable@0.54.2) (2023-09-19)
### :bug: Bug Fix
* fix roundable shadow condition ([adb09b7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/adb09b7396271e7de7031c1d621d1232f3751a9b))
* fix scrollable infinite loop #1015 ([b725981](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b725981982ceed7914b14be8e5ee7908d5ab6e22))
* support transform-box: fill-box (#1012) ([7a0ed4d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7a0ed4d8dd5463a85298860d6924b3bd132be8a6))
### :mega: Other
* publish packages ([ecf15ab](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ecf15ab399bb4d9f6752cb84b0d6b06d15e5c426))
## [0.54.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.54.0...react-moveable@0.54.1) (2023-07-11)
### :bug: Bug Fix
* fix individual transforms for 2d #969 ([7e205f4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7e205f47c239993029de250d7848fc198261a5e3))
### :mega: Other
* publish packages ([27bda8e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/27bda8ea3d9751847fc073519a832b3464242d3c))
## [0.54.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.53.2...react-moveable@0.54.0) (2023-07-09)
### :rocket: New Features
* add `onBound` event #970 ([c9db51f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c9db51f8ef5f7a0d262323e381ec25ad5bfc391d))
* add dragTargetSelf prop #972 ([4537dfe](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4537dfea5ba1652188b026b6bffead4737c36572))
* add elementDirection property in guideline #949 ([1073ebc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1073ebcf1302259ce3c54ee744a76b1e85c88f1f))
### :bug: Bug Fix
* fix watchValue ([644f19c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/644f19cb640415ee11072cfecbea4811ff2de327))
### :mega: Other
* publish packages ([25cae7f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/25cae7f46aa28dcb948a8690fd6062b7e15d72ff))
## [0.53.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.53.1...react-moveable@0.53.2) (2023-07-04)
### :bug: Bug Fix
* support individual transform #969 ([1b58541](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1b585412ea1c909bfbdcf094ecdde21024d895a0))
* support react18 strict mode #962 ([710f019](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/710f0190bd072804a224e715e353ff55e3427095))
### :mega: Other
* publish packages ([9467cf4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9467cf45fd2871573df8886eb134c67a8b0f916d))
## [0.53.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.52.1...react-moveable@0.53.1) (2023-07-02)
### :rocket: New Features
* add `getMoveables` with request #940 ([b926985](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b92698522e1b6f20e40ba7d82560d00d3c6a6a97))
* support dragStart with individualGroupable #967 ([d470f64](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d470f64a45362a8183d2f1ab572a50bc4d9f2b5e))
### :bug: Bug Fix
* fix choppy reisze #961 ([c8f9637](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c8f9637ae319870cc6d4e9bf68eb98820f27f25e))
* fix group's dragTargetRef #953 ([85d17d7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/85d17d77751d474db88b7238dd39baccd6b7a78d))
* fix translate(-50%, -50%) #963 ([6577ee9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6577ee9707246eb0f59e1bb685d96277f8feaa6d))
* individualGroupable request #967 ([daf6008](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/daf60087a82858d18ee260645e96ebb363b073de))
### :mega: Other
* publish packages ([5697e80](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5697e8050f486a83ea409b856d1f670759ba6910))
* publish packages ([5e76998](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5e76998ba0a90efcbb0c2e4fe8030ca47a1842d4))
## [0.52.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.52.0...react-moveable@0.52.1) (2023-06-28)
### :bug: Bug Fix
* fix dragTarget's unset #960 ([8e60b38](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8e60b385b8931a3aab953b315618ec15f9360611))
* fix helper alias ([ee5bf0b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ee5bf0b958a49694e4eed111755d1ef5ba5c6dc9))
### :house: Code Refactoring
* change rollup to vite ([213f346](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/213f346257289eaec6f3f6f618e8fba33859c384))
### :mega: Other
* fix ts-loader version ([429ae5f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/429ae5faa48fa9bedfc2463c1aaaebc58575bf80))
* fix update modules ([bb608dc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/bb608dc0d1d9eb13e538d1026c05809d89757b1d))
* publish packages ([510d7cd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/510d7cdf76eef4a17cc75d95634ebcb6d9688f8e))
## [0.52.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.51.0...react-moveable@0.52.0) (2023-06-25)
### :rocket: New Features
* add direciton on snap event #949 ([69312fd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/69312fd6eb0c3ca48f446bcc680f91abab189dfd))
* export matrixes in getElementInfo ([c1aad6a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c1aad6a0aa19c9f5060fe9d9c3277c95a0ad2c5f))
* setMin, setMax scale size in onScaleStart ([ea4cd95](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ea4cd9527cd599fec9f211f0713dbccb9e2ec343))
* support multiple dragTarget type #953 ([4a347d2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4a347d2b7f36570ba882cfe7894207210650d3ec))
* support snappable in request #954 ([863ad42](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/863ad42876e08c0e1cea6324e241dba0d6842946))
### :bug: Bug Fix
* bump react-selecto version ([c3eb9c7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c3eb9c7e52e7144f7accdd8298cd44e00b092d0f))
* fix isRequest naming ([fb90fbd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/fb90fbddc94698cf9c88b1e9d8b54a8182f03d88))
* fix max scale size ([9cd9761](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9cd9761ad109bd941ef474d7af940dbc086251a2))
* fix padding for scalized target #951 ([70d938f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/70d938fe3255ae5f4cc875c9213412ad5ad09740))
* fix props and event types missing #941 ([bd91b08](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/bd91b08ba04a50644e3d1ed91729563260b5a01b))
* fix ResizeObserver, MutationObserver contexts ([71152cb](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/71152cbb055b0148ebf501d9156b9af6a542fc69))
* fix scalable group's negative scale dist #950 ([f4bb504](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f4bb504d7f7f537d63f44f74a90f0cbe59886a16))
* fix typo (degress => degrees) #928 ([835be5b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/835be5be701c8b3740ff9dfc16101a9b9ed60cbb))
* support useMutationObserver in Group ([def4db3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/def4db354db052379789cfc7e342d36f7b781699))
### :mega: Other
* bump croffle version ([0a0cb93](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0a0cb931bff2d4cdb7809351212f83cd59fd047c))
* publish packages ([f893cca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f893ccaa176d31ef9ddb241d2cd4a1fb098cdae0))
## [0.51.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.50.7...react-moveable@0.51.0) (2023-06-04)
### :rocket: New Features
* add hideThrottleDragRotateLine prop #923 ([e091d39](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e091d396f2436ef0ad8d8dfa8922dcd86ec08bfd))
* add isDisplayGridGuidelines prop #935 ([589bb9d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/589bb9d888b99768be153a8c0a8dc89ec3fe238a))
* add snapRotationThreshold, snapRotationDegress #928 ([d63283c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d63283c604d3aea9e4f60f8c72f64c2fa2cde0e9))
* add transformObject property in render events #933 ([317ddde](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/317ddde1e65a2104b0c05ec331d5f468a85fb0b8))
* add useDefaultGroupRotate prop #929 ([5846e50](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5846e50c18dc2e1aa628e41a8d235ee4851325db))
* support drag api #920 ([8f1a839](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8f1a8396c429cf108da5417bc36cccd3ef46013c))
### :bug: Bug Fix
* add defense code for `.stopDrag` #930 ([be743bc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/be743bcb1ab211a647da4d53f7d34570e25ac4be))
* fix bounds keepRatio sign #924 ([8ccc8fd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8ccc8fdfbf71079417194f1b1dbef9a797726788))
* fix keepRatio for zero scale #927 ([7b936ac](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7b936ac77eb8e48d1f736e2a4dd0141946d3d968))
* fix ownerDocument css #932 ([76a852a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/76a852ade3ffb41a1b246649945994f50e52b1f0))
* support iframe #932 ([15abedb](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/15abedb5f5770b8380d0b6ebedbc4ab7834cb9e8))
* support iframe #932 ([7b4cbad](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7b4cbad8548e717f6ec31c14f939cbdfaffb650c))
* support iframe context #932 ([3e87cc7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3e87cc7fed43160ca342630fed2f413876f8a518))
### :mega: Other
* update packages ([8d65572](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8d65572384ae0fdff288fe78fbeb5d249b070eb7))
## [0.50.7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.50.6...react-moveable@0.50.7) (2023-05-16)
### :bug: Bug Fix
* fix css-styled version #916 ([875fc19](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/875fc19fa7fac50cbbb3166dfaa512b18f7c790d))
* occur unset for idle state #917 ([a9d1de8](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a9d1de80fd7f48957fd730d577105d64c5a54fe3))
### :mega: Other
* publish packages ([5bd22bb](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5bd22bb009e10a4f8032f35c2ae3b490f4d94e5b))
## [0.50.6](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.50.5...react-moveable@0.50.6) (2023-05-15)
### :rocket: New Features
* add drag api demo ([7c46df1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7c46df1c3026b5d836bc082e5e1dc2cdd093b77c))
### :bug: Bug Fix
* add defense logic for added element on dragStart #917 ([ef37c3b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ef37c3b6775fdfc8baa365bc793fe264c5a79764))
* fix controlPadding #918 ([685c459](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/685c4598deff805e0e952a1095ab3305a39a22c8))
* fix initial gestos ([84afabb](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/84afabb1af183a231b6b70b5b6a2904cd981706e))
* fix line, control padding appearing #919 ([63b9ecd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/63b9ecd6fc83314216f1d29c57c22ded27d8098e))
* fix not initialized target #917 ([f291bf3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f291bf3f615e6daedb5da01ff16a42f43a39d441))
* unset gesto when target changed #917 ([9d6c0d7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9d6c0d7c7f4b24b936d3ea9fa996dc536c84f816))
* update croact, css-styled version #916 ([b517b64](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b517b6498a612c072eadc9354d6383363771ea6d))
### :mega: Other
* publish packages ([91aa8bc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/91aa8bc1bdefc65cde8c032f1c7ba13ca54ad2fa))
## [0.50.5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.50.4...react-moveable@0.50.5) (2023-05-09)
### :bug: Bug Fix
* fix missing type #911 ([0f26c75](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0f26c75261fe8996f8b1317ec2da473a9feb57d0))
* fix svg group #914 ([9be5170](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9be5170b14215bf76e29830136046cb358461f17))
### :memo: Documentation
* fix README #913 ([337e36a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/337e36a422fa1e2d5f96c0426957f6be401e8248))
### :mega: Other
* publish packages ([40dd902](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/40dd9022c41244ab009d621861ddc2ac63768748))
## [0.50.4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.50.0...react-moveable@0.50.4) (2023-05-08)
### :bug: Bug Fix
* add dragFcousedInput prop ([e96f9fc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e96f9fc80493696fdbb94047e9375a8d991da05b))
* fix dragFocusedInput #896 ([94cb92d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/94cb92d239846ef7a45c0ea2f4ceec0ec2e3b4ac))
* fix files filed #910 #909 #907 ([a4995ab](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a4995ab1acb3a34974e1d5a20d17fb2ee17ddc0c))
### :memo: Documentation
* fix dragFcousedInput story ([2b78a4e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2b78a4e276000ab017396a94d1502a4c94b8ef70))
### :mega: Other
* publish packages ([d0f0532](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d0f0532bfb42fe98ee95748839a639fddbe4b9d6))
* publish packages ([e1e86a9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e1e86a95ebff9d18ad7a5ebede3bd5bd66465b5d))
* publish packages ([60a747e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/60a747ee3c373f83fb759a8482e2365e77dcb5e8))
## [0.50.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.49.2...react-moveable@0.50.0) (2023-05-01)
### :rocket: New Features
* add dragFocusedInput prop #896 ([a29c9de](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a29c9de3d9371a3cd7406432dcdd437168d42fdb))
* add svgOrigin prop #894 ([619d57d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/619d57dc00c96c50fba77709526e6d3f48c0654a))
### :bug: Bug Fix
* fix element guidelines for group #900 ([d42c032](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d42c0325d78150f18d07b33b6a20c02d98ee4b97))
* fix fixedOffset ([a00ab2a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a00ab2ae05b802aeb8850b4b9a87e6600f17b8fb))
* fix invidualGroup's mount code #905 ([d2388e5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d2388e54e75ae3e2de5896b8f7018b4e2a5a0963))
* fix snapGrid's offset #897 ([97d89de](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/97d89de0ee14ecc7d4f9b8d1c750fbb5db91730e))
* prevent multitouch for target and control #898 ([0b4d328](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0b4d3287de5da268132fdcd0bf0781a3f8d0902f))
### :mega: Other
* publish packages ([24934e3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/24934e317de2e5ff622bd9ab0dec8d75a7c05c48))
## [0.49.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.49.0...react-moveable@0.49.2) (2023-04-16)
### :bug: Bug Fix
* fix 0.2 guideline offset delta #888 ([d85c041](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d85c0414d55e08b3669e3f88bb10c301cc99c59c))
* fix pinchable's operation #892 ([f4d8df3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f4d8df3f81f69f0c00e2b865e6f3368ee9795b01))
### :mega: Other
* publish packages ([a623eda](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a623eda2702067397159742dd0c6ed16b99bbe22))
## [0.49.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.48.0...react-moveable@0.49.0) (2023-04-13)
### :rocket: New Features
* add croact ([b94c41c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b94c41c50cdf37da0136bd4d04f2237529253f45))
* add croact compat ([233c6d0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/233c6d0a905953b51c3fd5df1f7c58e7b1d03432))
* add string guideline pos #884 ([2036328](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/20363284f0ab6b7a38c042283cd55e7cbc528809))
* support scale css property #891 ([28c4226](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/28c4226e9566067c14399a59d728babf692fcfc8))
### :bug: Bug Fix
* fix delta offset for element guidelines #888 ([526bec1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/526bec100ab5b45a61a88a50fa2931cf7c2841a2))
* fix github workflow ([0fd81b8](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0fd81b8e43dca21086c9f00a5c3a9ac13eabf410))
* fix Scalable's keepRatio calculation #887 ([680c161](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/680c16181791b4764e7c31a14684c83575f8ab6b))
* fix vertical guidelines ([1abcc37](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1abcc3785caf0db184649508eb63f14bde7291c4))
* resolve transform matrix ([090e1b2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/090e1b26c1e2d9ff742c50f9e8e901378e5969f9))
### :mega: Other
* publish packages ([1177427](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/11774277bafd9c60e9cef3c9a6fa38a3e1c4077d))
## [0.48.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.47.3...react-moveable@0.48.0) (2023-03-26)
### :rocket: New Features
* add useMutationObserver prop #869 ([f3a9ee4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f3a9ee46144bfe0e0be37b7c8a086d70a9ffb5db))
### :bug: Bug Fix
* fix individualGroupable #867 ([6d98f76](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6d98f76bdb3bdc94ce99495c5729ebb706038e6c))
### :memo: Documentation
* fix container docs ([295d905](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/295d905cac0db04b6fa9301573c99ce1366a16ae))
### :mega: Other
* publish packages ([7580d27](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7580d272fe857aadfbdbc9df264e0a413dd56588))
## [0.47.3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.47.2...react-moveable@0.47.3) (2023-03-21)
### :bug: Bug Fix
* fix infinite loop (#873) ([179f950](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/179f95047d1aeae8d7bb2275ea0ab980feded486))
### :memo: Documentation
* fix README ([7426492](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7426492de210ab6f38d411d96e6d843d7423f555))
### :mega: Other
* publish packages ([ae54ef4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ae54ef4c660ae789867e4286990f234cc808a379))
## [0.47.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.47.1...react-moveable@0.47.2) (2023-03-14)
### :bug: Bug Fix
* fix chromium agent (#864) ([04ffe64](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/04ffe641c5383e2c992c06196d454967bdbd1e8a))
* fix groupable moveables' calculation ([cd9970e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/cd9970e9a9bf3d942bc76182e40121399346894e))
### :memo: Documentation
* fix story url ([8977306](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/897730620480d8e830c4b53401a28d03b42b9a5f))
### :mega: Other
* fix ga id ([b034af5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b034af5f04d45c9ff3035451265773cac1334222))
* fix test runner config ([6f6e585](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6f6e5856773bccfb681dade0a2297e59338b8787))
* update packages ([5b03d09](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5b03d09a0cd298d47597fc8c8c9c6fdd4cd5a267))
## [0.47.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.47.0...react-moveable@0.47.1) (2023-03-10)
### :bug: Bug Fix
* fix chromium agent #847 ([f6a703b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f6a703b8286b25ec88e397f3363db6c69777fd72))
### :mega: Other
* publish packages ([5589402](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/55894029a463f96a1f42827330b092be3fb63bf2))
## [0.47.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.46.1...react-moveable@0.47.0) (2023-03-08)
### :rocket: New Features
* add `preventDefault` prop #821 ([b599e32](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b599e32aee6f3dfe10fec348c200bb1b4a0983d2))
* add displayAroundControls, controlPadding #837 ([9ee0c72](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9ee0c7251daae929e5ec71a9cd5c61a473c44496))
* add individualGroupableProps props #848 ([079e752](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/079e75261de5cf8163ced482e1f7171ae8705823))
### :bug: Bug Fix
* custom element offset with chrome 109 or higher #847 ([af20f7e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/af20f7e04a692e192bb6b27e4478c9d0cb0cfd29))
* fix requestStyle #856 ([88c9ec2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/88c9ec2ce2b06e592f6548af2221989b7109456d))
* fix zoomed font size #855 ([172f6d4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/172f6d448e9c855e8aaeefb0b83516548d127e83))
### :memo: Documentation
* fix story tag ([706c41c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/706c41c9bd44378e4c3571661d4a90d4b12ab3af))
### :mega: Other
* publish packages ([645e290](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/645e290a53b477b468042e05447e2f8f8aea6ed0))
* update croffle ([9017260](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/901726035ba4122e048cdd1d0a0d3806c3c4809a))
## [0.46.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.45.1...react-moveable@0.46.1) (2023-01-29)
### :rocket: New Features
* add `linePadding` prop #837 ([af818ab](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/af818abc467608e76f8bb15175b184fa440fddfb))
* add isTrusted event property ([256c40c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/256c40cf2a51277af5414a9bab07be321a586157))
* add scrollOptions #841 ([a6dfc21](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a6dfc2152ef9a06c6714c219b3ea057f0b6b8504))
### :bug: Bug Fix
* fix changed defaultGroupOrigin ([8d0ed9b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8d0ed9b85c44091f65e1f4f233ce56ea91dbf10f))
* fix TargetList ([008116c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/008116cd0b6624b95c179a6eeed3e897de6e488c))
* support able requester types ([c26e5a9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c26e5a94ca27b6b1739d3e6bf5d2882d22e06e3a))
### :mega: Other
* publish packages ([24c9567](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/24c9567e2ec00392d2d445298031c39de0331eae))
* publish packages ([0e0a03d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0e0a03dd6c234ded050db8206e585c5fa2da1848))
## [0.45.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.45.0...react-moveable@0.45.1) (2022-12-16)
### :bug: Bug Fix
* fix helper's methods ([4bc6ef5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4bc6ef511f7652966e1a87cd7d0a53e6687a1707))
* fix snap rendering for first drag #810 ([170eaec](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/170eaeccb43ce051f34661a337fb7870e3e8b5d9))
* fix targetGroups' compare condition ([21622f2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/21622f2f25d912f69b70ba5193b909bf7244db80))
* fix targetGroups' compare condition ([959a9f0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/959a9f0abd3fa592aa7645096efc3df95477494a))
### :mega: Other
* publish packages ([d088ad9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d088ad9ed64889f4fd6143b89410f5d5e372105f))
## [0.45.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.44.1...react-moveable@0.45.0) (2022-12-10)
### :rocket: New Features
* add `checkResizableError` prop #808 ([cb70b3b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/cb70b3b99f5da269a19ded412ac7cd0366cb7996))
* add `stopAble` property ([c05ba1f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c05ba1feed36c8a4bc6107a713fb11208e685777))
* add OrginDraggable, Warpable css object #807 ([32ba0ce](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/32ba0cee2a44bfcdc91cf3748282cccdfca37512))
* add useAccuratePosition prop #164 ([5c3898f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5c3898fc88704c5638133a35111767cd27a77808))
### :bug: Bug Fix
* fix request with bounds #809 ([43e08d1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/43e08d102827ba0f4437ce1d8883282566f3f86b))
* fix useAccuratePosition for group ([e1b3ae7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e1b3ae78cb1d137ea85cf17afd51aa816e65aa87))
### :mega: Other
* publish packages ([ab42598](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ab42598cb7a6175450125c5e55093cf891a33692))
## [0.44.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.44.0...react-moveable@0.44.1) (2022-12-05)
### :bug: Bug Fix
* fix tangent's tiny x value #806 ([e45b92a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e45b92a5880475d27c2318d2e1489996ad465e1c))
* move react-moveable path ([ec8e162](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ec8e1620e05f1d5a1a45ecccec7481c2ea8a4f57))
### :mega: Other
* publish packages ([9ee9bc9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9ee9bc9c76f6c4b317548470b5b4894c6a462be1))
## [0.44.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.43.1...react-moveable@0.44.0) (2022-12-03)
### :rocket: New Features
* add borderRadius style state #804 ([57bae32](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/57bae3227dc77667314d900631765836b77a66cc))
* add groupableProp #798 ([58d9d22](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/58d9d2231954c52821b4ec666e14703506c0840a))
* add scrollThrottleTime prop ([b53924e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b53924ecbb6be2805bd3da368822a41638bbcea5))
* Support roundable group #798 ([90a9c1a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/90a9c1a062661906d0b1777839db794dbc2ad370))
### :bug: Bug Fix
* fix first render for individual groupable ([74dc11a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/74dc11a4dec363746457046ecbde52f0b53955f3))
* fix position relative with zoom #800 ([2efdc35](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2efdc353465974acec59e59c2a3d8fcf29284eac))
### :mega: Other
* publish packages ([4739df4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4739df488cdf3c32cb4ca4e024063c5c44fbaf0c))
## [0.43.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.43.0...react-moveable@0.43.1) (2022-11-28)
### :bug: Bug Fix
* fix body rect #800 ([8976985](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8976985422fd30cd9e6e85e41ba73473dca05d41))
* fix TRS order ([aff4b28](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/aff4b281e697bd9a550d21d1f26739fb0c5e4903))
* fix zero line height #801 ([99547ca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/99547cace2be52de99eceb021cc7a75f54bc16da))
### :mega: Other
* publish packages ([746c40b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/746c40b2a2f31f2f371f9110018c89e64c08a525))
* update jsdoc, template ([11408ca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/11408caea15925a42165aa2080a7327e77a22ea8))
## [0.43.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.42.0...react-moveable@0.43.0) (2022-11-27)
### :rocket: New Features
* add isFirstDrag property on drag event #796 ([7ade6a2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7ade6a23e9003d9ed4119a035ccad01b01c13ed7))
### :bug: Bug Fix
* fix snap size for position fixed #791 ([b02c82b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b02c82ba5012fdfdf534a6dad1dcc1aea76e420e))
* support css zoom #800 ([fa3de6b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/fa3de6bd52de2509bf76b1d4a001b31f4a6b6ed4))
### :memo: Documentation
* fix README ([3a153c8](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3a153c849b7279ec5fd603167117c88f25a7149c))
### :mega: Other
* publish packages ([3d5ac5a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3d5ac5ad855d98a2f555174cc46ec09c148d6a20))
* publish packages ([92eb72d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/92eb72df6110eb40a66b4726740240acb43e9745))
* update croffle ([5714b2e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5714b2ecc219ec06ebc008c3ab1c9cad219a95e6))
## [0.42.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.41.1...react-moveable@0.42.0) (2022-11-13)
### :rocket: New Features
* add `stopDrag` method #787 ([1c1d54d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1c1d54d7b6c3baff62bac34b439244c20a18c3c0))
* add cssText on clip event ([90e5397](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/90e539751a5e505257702dba6a09c96cd71d3f50))
* support group persist #780 ([40a23db](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/40a23dbc31d08ac22a85e5dc807ccb16e0604b4c))
### :bug: Bug Fix
* fix edgeDraggable #695 ([9ebfae5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9ebfae559c978d5354ba5244ada6e22d20cdc83a))
* fix persist group ([d1c9e2c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d1c9e2cab1183b89f346daac5c02dbf531bb53e8))
* fix snap bug for rotated group #786 ([3ac47da](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3ac47da798cb655d37903ea9a8574ae62d1a7844))
* fix snap for fixed position #791 ([05f6f22](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/05f6f221fbdc971ca21b7bf27b24c91b1e722057))
* fix throttleDrag #789 ([8f4659e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8f4659e2531d9cdba9593509c87f0c2915a28ae9))
* update gesto, dragscroll dependencies ([0f33358](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0f333589574f509d1e3058b77ec9df6b18d7fee6))
### :mega: Other
* publish packages ([0780d7a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0780d7a204e5f1fa13070d4fa3ca657dfe3ee4af))
## [0.41.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.41.0...react-moveable@0.41.1) (2022-11-06)
### :bug: Bug Fix
* fix group rotation delta ([ef0c591](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ef0c591d7b0c86aed6847c476f17a82f6b80c8fc))
### :mega: Other
* publish packages ([64e846b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/64e846bb0e606756bc0b87c92b2b1052b458b9f7))
## [0.41.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.40.0...react-moveable@0.41.0) (2022-11-04)
### :rocket: New Features
* add ableName-view-dragging in viewContainer #751 ([90c5c34](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/90c5c34960615f57807d7c8d9895fc04231951e0))
* add persistData prop for restore data #780 #777 ([599df9b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/599df9bfe1249665c4d76f44f3b771d347284d5a))
* add snapThreshold prop #774 ([1bf05b3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1bf05b3bf5221e8ee1a1ffadbcae93a885630819))
* support rotationPosition array type #783 ([80653c3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/80653c3235ecaef5112414f8b859bedeba196dda))
* support stopDrag on drag #775 ([d950472](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d95047250708d7d2e08988c3e6e4b66b99f53cc7))
### :bug: Bug Fix
* fix changing snapContainer #773 ([c3ee847](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c3ee8473765ee6bbb8a27e4865372edac7b3b6fe))
* fix document element #782 ([b9194d7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b9194d72869c50f96976354ec0dd2cbb24788533))
* fix no relative snapContainer's size #773 ([1db881f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1db881f4d63fe59ffa22b00428419cfb0e4e2827))
* fix rotate dist #778 ([7ac47ca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7ac47ca99402e811faef0f6cdfeede18e14c9ae2))
### :memo: Documentation
* fix hitTest doc ([d4b7648](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d4b764899bf4e9044028399f28991e1003195d9c))
### :mega: Other
* publish packages ([b6896b3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b6896b340dd1f78777bd63c48e8545895df9aa5e))
## [0.40.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.39.4...react-moveable@0.40.0) (2022-10-17)
### :rocket: New Features
* add `viewContainer` prop #753 ([352073c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/352073c5c5c765aca707236abdff9dded7988343))
* add getTargets method #751 ([16f1061](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/16f1061ac616081c1d9dd40e00105e8a2a93e1d2))
* add roundPadding, isDisplayShadowRoundControls #761 #762 ([68be2e8](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/68be2e879cc5dbba6d4566cf96d343216710e0c9))
### :bug: Bug Fix
* fix border radius for line #761 ([803f0b6](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/803f0b6c2210653a7cdb17f51a828c4e3f6db641))
* fix cache condition #760 ([03e2789](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/03e2789db951f95087f918d32fa32cdd70fba533))
* fix first visibility #760 ([38ba047](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/38ba04792925b0c32e85258046f5285133f92dc1))
* fix flash of single, group toggling #760 ([5578030](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/557803012e21d2e78e3c0577aa9a238d9ee3a8dd))
* fix max-width percentage #763 ([f1ad4af](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f1ad4affba14d86f3d0145f08e08c647bd0b4f08))
* fix roundable control index #762 ([1b29ecd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1b29ecdfb0d1d4df6c348e78852d1325aa727aaf))
* Fixing bad type causing type conflict (#767) ([c63c1d3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c63c1d30067e52b4115f09c6a78639177b443226))
* support cache for group #760 ([4661320](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/46613207e47279e72bdfc656ae35548a3f07474d))
### :mega: Other
* publish packages ([75db134](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/75db1345ab1119dd9a5270c7c11de455888c2627))
* publish packages ([47f5335](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/47f53351792bf5264c6d66745088e0571cedc3aa))
* update packages ([61730d5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/61730d5c143d4027c55a714c764efe77bbebe5bf))
## [0.39.4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.39.1...react-moveable@0.39.4) (2022-10-10)
### :bug: Bug Fix
* enhance updateSelectors #760 ([e72b119](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e72b119fd7d413df1af231607db2aeee1f20e467))
* fix click event #746 ([41809c1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/41809c10646b91586f74332b74ad2f83ab9a4b2d))
* fix drag start edge #745 ([105bb1c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/105bb1ce073e349c77f6a0c4dd8d3d259a03aabe))
* fix index attr for roundable ([92932d7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/92932d7c35f58d365d2b2294d4735fced9416214))
* fix onScaleGroupEnd param #755 ([ce7d855](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ce7d855da4fe4042163c7fdca59b87b3060cfd88))
* fix roundable line index #756 ([83d5232](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/83d523288757e0276a1ffe9a6f4903fc86a7f19a))
### :mega: Other
* publish packages ([9e3ee2f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9e3ee2ff44dea473e7aa73e4d501c2d23062f40d))
* publish packages ([16b2516](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/16b251618307faad8f8f3fc5433b27ed1466311c))
## [0.39.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.39.0...react-moveable@0.39.1) (2022-09-19)
### :bug: Bug Fix
* fix updateSelectors method #740 ([f9abb0f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/f9abb0f32212222bccadc3459f4d721977032aba))
### :mega: Other
* publish packages ([2954e37](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2954e37b9a4e2100a8a55c0d49d279e7f994fd94))
## [0.39.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.38.4...react-moveable@0.39.0) (2022-09-15)
### :rocket: New Features
* add `moveableTarget` property in click event ([ee3d9f2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ee3d9f2153ad70f86548f73412fad9d255d80760))
* add `updateSelectors` method ([90f40e2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/90f40e2b500bce6564f878294e1a0aaf27dd5b69))
* support multiple group #566 #731 ([0bb7977](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0bb79772fc956f5f38ed540f4de9382d8e5567fd))
### :bug: Bug Fix
* fix defaultGroupRotate action ([1f6709a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1f6709a9ddbdd5fe8cc6381cc7c0dac68ab42a70))
* fix dragtarget #468 ([c662cca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c662cca73f6f64a6df38936ce97d756e5197d55e))
* fix multiple group ([20af5c1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/20af5c113fb6b250be27dd427c3fa6a4146bf958))
* fix overflow auto target #730 ([1e0ae91](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1e0ae91df7baed8a7ae11e96c29a3f3f4cb9b8c6))
* fix rotatable throttling ([b18f16a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b18f16a93d853621f3883da16bfc3e6d0cd6db94))
* fix rotate group origin #733 ([3e9e8e5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3e9e8e5f59ca65584e3c709544c1d43734086d82))
* fix shadow dom css #729 ([7581afc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7581afc13a7c5f9f749b22d7bd3160de0972d112))
### :mega: Other
* update packages ([e5774a9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e5774a9becd500d154e8d354017dcbd80505ba13))
## [0.38.4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.38.3...react-moveable@0.38.4) (2022-08-24)
### :bug: Bug Fix
* ignore document for firefox ([db0c730](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/db0c730be90c00d8d187445db26e0e42a08cedb2))
### :mega: Other
* publish packages ([d57ebb1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d57ebb130006c47e3a687d2b417fe3fe7f30149a))
## [0.38.3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.38.1...react-moveable@0.38.3) (2022-08-23)
### :bug: Bug Fix
* fix custom element offsetPos for firefox ([6e05812](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6e05812c649098c6330678289cd83d9abaa6df1d))
* fix svg group's offset pos #722 ([167d277](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/167d277abe7f58d0b203867eb8df25addba2172a))
* fix waitToChangeTarget method #714 ([fc9847b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/fc9847b4d2fa78eb057259bb5d4a2a187a663bf1))
* stop event if no use ables #724 ([2a90842](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2a90842e4ff937af6b39bbc4e147a7a7acbb0acf))
### :mega: Other
* fix cjs configs ([ce8cbb1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ce8cbb18563e34234f7e9d83a0b3f024870314a8))
* publish packages ([3597bc5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3597bc5fd58cdec56fd4ff8916380a6f3709f7f5))
## [0.38.1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.38.0...react-moveable@0.38.1) (2022-08-12)
### :bug: Bug Fix
* export event-emitter ([937d83e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/937d83e221d7080abdb699bc088eff9ca89caaa4))
* fix click event for mobile #720 ([ce6bced](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ce6bced55ca6e32981215ebd91a57fe04a789f4e))
* fix that dragStart method cannot fire #718 ([5ea9fc3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5ea9fc362534e8a56976ad87053700ee06a14e0d))
### :mega: Other
* publish packages ([6be7e81](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/6be7e8122b8edd2e323a039cdbb73381de74e14f))
## [0.38.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.37.3...react-moveable@0.38.0) (2022-08-06)
### :rocket: New Features
* add maxSnapElementGapDistance prop #707 ([5f71c30](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5f71c304192764cd8c9261daec56f1594f13e3df))
* add stopDrag event property #665 ([70f49ee](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/70f49ee4dabade6366e37fa3408421ee7d1d4931))
* add waitToChangeTarget method #714 ([8e6c534](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8e6c534010689c0c0a2a821f8ab7e3d6cf63f240))
### :bug: Bug Fix
* prevent click when drag & click control #713 ([2071c0d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2071c0dd68503d920fe9c26e53ec8c17627bee2b))
* render only shortest gap guidelines #707 ([176c1b3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/176c1b31b6c8cc3359d44474225a35014fba42d4))
### :mega: Other
* publish packages ([80005ba](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/80005bada5651afd0c5487a193ab321b22ab1b55))
## [0.37.3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.37.2...react-moveable@0.37.3) (2022-08-03)
### :bug: Bug Fix
* fix click event by gesto update #713 ([3a3c762](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3a3c762fc20cf682c3d8fda21f28244a3ecf36bd))
* fix offsetParent with willChange #711 ([cd1de86](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/cd1de864191fc39b04065ada89d6e600f02ad0a1))
### :mega: Other
* publish packages ([5468ff7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5468ff763bfa3f30e637ce8f504af09152b22c5c))
## [0.37.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.36.0...react-moveable@0.37.2) (2022-08-01)
### :rocket: New Features
* add CSSObject on render ([e2f462a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e2f462aecd10d076ef874a6ba2af97a2e59841d1))
* add maxSnapElementGuidelineDistance #707 ([171b027](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/171b02708e6343656655cf403744e1a0fbfa2324))
* add preventClickEventOnDrag prop ([281b2b7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/281b2b7aa5dba3bdc4c3f478e115a0de8fd2359e))
* add startFixedDirection property on before event ([c838c9c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c838c9cc13305eb10ba85b75bcfcd7daa52047f1))
* add stopPropagation prop ([3ce54e0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3ce54e09972962f69f2b697dc52e0b507b2aad9a))
### :bug: Bug Fix
* fix cssText, style on drag ([aed807e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/aed807ef7a04b25101cef8fbad38d94a1e7482ff))
* fix drag undefined on Rotate Group #710 ([db80e7d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/db80e7d92bee3be684c74a9cb20bc62680f4e0a4))
* fix getElementInfo's NaN type value #709 ([e99d94f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e99d94f5c3302fd3c851aa942e99daa75346479c))
* fix rotate position #710 ([d269d1f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d269d1f3c095a0930359597d894d3cdb631b3ee2))
### :memo: Documentation
* fix README ([5ded1c1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5ded1c19b77fe2c3974bcf1f1ac1356d2924991d))
### :mega: Other
* publish packages ([0076577](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/00765776ba92b5ca691c1aefd1c20687952373d9))
* publish packages ([ffa0c18](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/ffa0c18bb6970d6f8d88a49db23b11620e704618))
* publish packages ([958ebac](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/958ebace6032eafb17f1ce366394b440671b45b3))
## [0.36.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.35.0...react-moveable@0.36.0) (2022-07-25)
### :rocket: New Features
* add `cssText`, `style` property on events ([7a9012e](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/7a9012e4fcdc9a37bb2096bcf37e8e4d25310a8b))
* add `rotateAroundControls` prop ([d473ffa](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/d473ffa76a5c390945c320ee8ee8b6f671a0fbed))
* add style, cssText, afterTransform properties ([68b4a92](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/68b4a925b75f599924628425b4da5cfd5424ad71))
* support pos guideline info #707 ([1cd1b81](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1cd1b8134419df88b16ffb9aaa412ebb9048b379))
* Support rotate and resize together #467 ([24482a6](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/24482a68ac2611507e2fa9e6673f969bc1c65cff))
* use edge at the same tiem #706 ([c273703](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c273703e5b62ea41ec9df441158a77cb0bf835c1))
### :bug: Bug Fix
* remove wrong react types #703 ([25dced4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/25dced4f1531cc46d77601f71674031aa58fdf0b))
### :mega: Other
* publish packages ([63e03d1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/63e03d1d5f69e56c7df6d357c58d7acd06932e80))
* update dragscroll module version ([e9b5864](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e9b5864c83853578c4190e792543019e30b017eb))
## [0.35.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.34.2...react-moveable@0.35.0) (2022-07-21)
### :rocket: New Features
* add `keepRatioFinally` prop #698 ([bf29635](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/bf29635ab8a160c9e938213b2477cfec73e8401d))
* add move cursor style with edgeDraggable #703 ([9901deb](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9901deb3dd51f449edcd75e4f147b9fa671d951e))
* support object self type #701 ([99967c2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/99967c28f9f0f09ef1891ea1ece4b16a6c10ef43))
### :bug: Bug Fix
* calculate size more accurately #698 ([4dd4038](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/4dd4038c82c9dff272226e3911549249743dff50))
* enhance bounds accuracy #699 ([9aee6bd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9aee6bdf0cd9105ef3ef653e18363e21ad4c4b3f))
* support shadow root #684 ([8502d07](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/8502d0795c903e7894d0fad9a6a130cbc543f301))
### :mega: Other
* publish packages ([da24696](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/da24696977c24b6ea54a433192d15bb7ecbc62e9))
* update `react-compat-moveable` ([712ae6f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/712ae6fb49dec3f4e40a3cd664f63625d7cd5669))
## [0.34.2](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.34.0...react-moveable@0.34.2) (2022-07-17)
### :bug: Bug Fix
* fix files field in package.json #700 ([48ce548](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/48ce548438dd0a7da9f544730b2fc3ab65073775))
### :mega: Other
* publish packages ([5d89af5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5d89af521d1a288d4d9ca7923e0e9654e8f97d53))
## [0.34.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.33.0...react-moveable@0.34.0) (2022-07-17)
### :rocket: New Features
* add hideChildMoveableDefaultLines prop #692 ([c691403](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c6914031e75712eef6a574d6aaf04645535f59d3))
* add setFixedDirection on rotateStart #670 ([093d0b1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/093d0b1303c9742a79f73071470ec73306ff2de6))
* support edge prop's object type #695 ([699997d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/699997d7426110cb199094cd7ac56682723d1cae))
### :bug: Bug Fix
* fix floating point for min limit size ([766561c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/766561c0e785098720c5a0ae6d9da1e2d9d7b879))
* fix guidelines for edgeDraggable #694 ([80f2b44](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/80f2b44643a0d804df6a65f72583c4d7f6d8ddf7))
* fix safari 15 consts ([a140e5b](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a140e5b77f623973cf6d27d0ff8ab12e63901004))
* fix transform behavior in safari 15 #696 ([eb0a71c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/eb0a71cb8aa11c100a3cf2f85e007d6fdb45a2d7))
* stop propagation for click control #690 ([1a8f697](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/1a8f6978ba267632282049b61753bc062d69266f))
### :memo: Documentation
* add hideChildMoveableDefaultLines docs ([9e02faa](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/9e02faa5cbd4f5e529a1a58647afd519b0672d3b))
* fix typo #685 ([c591b1d](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c591b1d8a410a3fa6115fcec51ae21d4027aeaa7))
### :mega: Other
* publish packages ([2a4940f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/2a4940f74997fae24c7d77c553a6bc6be1301d40))
* update overlap-area ([be8c4dc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/be8c4dc19dbd6d6d7f782c73272cb9878ca21982))
## [0.33.0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.9...react-moveable@0.33.0) (2022-06-09)
### :rocket: New Features
* add `preventClickDefault` option #671 ([17da69f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/17da69ff71c6abe4788603dc729b6bc9dd8f27bc))
* add flushSync prop #668 ([068c174](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/068c174706338f3eedfa3c93beb967b7399e6daa))
* add snap direction foramt (#669) ([52406cc](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/52406cc8c2a77dc2446dc935681aa9885661b77b))
### :bug: Bug Fix
* fix groups' setMin, setMax and ratio ([0e2abf1](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0e2abf1ae8504334a7118b9e2b6e9cab9c90c91b))
* prevent wheel drag #674 ([e9bea04](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/e9bea04aec00bd3a2a06918b539c9b02b2a589d5))
* remove peerDependencies ([0aa9869](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/0aa986952e096cd75def5e0afe9c9b1ac9d4216e))
### :mega: Other
* publish packages ([b432247](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b4322470bcd3bb05fc67d2c89eedd737f8b4b67a))
## [0.32.9](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.7...react-moveable@0.32.9) (2022-06-07)
### :rocket: New Features
* add clippable keepRatio ([37da849](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/37da849e81454ea17be4510a81beeef852cfda9f))
### :bug: Bug Fix
* fix [1, 1] direction's bounds #624 ([5108bc3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5108bc33cf9e098cd051e4b7d63b2ac3dc06bf09))
* fix changed target getos #657 ([54ef5a0](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/54ef5a03a781e706293699d1ae25141e215044c9))
* fix clippable bounds #659 ([b3986de](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b3986de338b2d38e42288c9d2cafe2a2a7da7705))
* fix group drag condition ([35c194a](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/35c194a8fb2aa5051e7f46092418c35821e61890))
* fix group gestos for strict mode #656 ([311c931](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/311c93137f9b8aa53b040cda05e94bbae08e313b))
* fix innerBounds for no width, height ([42fe6f3](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/42fe6f3d45662c2e46280d4d5a6eed0cc9a05e66))
* fix minSize for zero size ([c34f298](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/c34f29803a487098f36f45991ea6dff03bd2750a))
* fix svg matrixes #643 ([525ad70](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/525ad70e2593500188e2a81d2759e726d4277049))
* support keepRatio for Clippable ([a934512](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a934512d2fc38e4a2fee6b6c5834df1b4f6e503e))
### :house: Code Refactoring
* use yarn workspace ([73da295](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/73da295064845a3791782c1777a9c555272a0af0))
### :mega: Other
* fix types dependencies ([b4a3ee6](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b4a3ee6486a81ca14a7c23284818628471369fe0))
* publish packages ([3530f05](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/3530f0526081b0c010e6c964265b466713f0212e))
* update demo configuration ([917123c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/917123cdea2830e8e8f4a8d7b2a99654f16682ef))
## [0.32.7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.5...react-moveable@0.32.7) (2022-05-01)
### :bug: Bug Fix
* fix coordinate for position: fixed #653 ([87ba56c](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/87ba56c5728203b6f4bf2cf0f4f004aee009a625))
* skip beforeEvent set to lastEvent #654 ([5ab31c7](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/5ab31c749c8a331b40a564b365c75223be0736c2))
### :mega: Other
* update packages versions ([169c484](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/169c48417bb4bc07c59e227c545e379dbf43d15b))
## [0.32.5](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.4...react-moveable@0.32.5) (2022-04-27)
### :mega: Other
* update packages versions ([585094f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/585094f76ec6e1556159ac357d6ac83ebab953ae))
## [0.32.4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.4...react-moveable@0.32.4) (2022-04-27)
### :bug: Bug Fix
* fix clip bug with draggable, snappable ([b5477ee](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/b5477ee6a05067a3506bfefac30c36839b264c83))
## [0.32.4](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/compare/react-moveable@0.32.3...react-moveable@0.32.4) (2022-04-26)
### :bug: Bug Fix
* fix svg transform #643 ([82233ca](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/82233ca351c4600dea58c6558ccfeaca6a1e8295))
### :mega: Other
* update packages versions ([a62ee58](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a62ee58b9bc32f06edc95d55ea28b60c20881ac4))
* update typescript version ([a63ee9f](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/a63ee9f575d701f24748d48ac92484f6c259577f))
* upgrade storybook and typescript ([eff23fd](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/commit/eff23fd7340964ed0e3e6f5930e56558c4d91d18))
================================================
FILE: packages/react-moveable/LICENSE
================================================
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: packages/react-moveable/README.md
================================================
React Moveable
A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable, Snappable.
Demo /
Storybook /
API /
Main Project
## 🔥 Features
* **Draggable** refers to the ability to drag and move targets.
* **Resizable** indicates whether the target's width and height can be increased or decreased.
* **Scalable** indicates whether the target's x and y can be scale of transform.
* **Rotatable** indicates whether the target can be rotated.
* **Warpable** indicates whether the target can be warped(distorted, bented).
* **Pinchable** indicates whether the target can be pinched with draggable, resizable, scalable, rotatable.
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* **Snappable** indicates whether to snap to the guideline.
* **OriginDraggable*** indicates Whether to drag origin.
* **Clippable** indicates Whether to clip the target.
* **Roundable** indicates Whether to show and drag or double click border-radius.
* Support SVG Elements (svg, path, line, ellipse, g, rect, ...etc)
* Support Major Browsers
* Support 3d Transform
## ⚙️ Installation
```sh
$ npm i react-moveable
```
## 📄 Documents
* [**Moveable Handbook**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md)
* [**How to use Group**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-group)
* [**How to use custom CSS**](https://github.com/daybrush/moveable/blob/master/handbook/handbook.md#toc-custom-css)
* [**How to make custom able**](https://github.com/daybrush/moveable/blob/master/packages/react-moveable/src/ables/README.md)
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
## 🚀 How to use
```tsx
import Moveable from "react-moveable";
render() {
return (
{
console.log("onDragStart", target);
}}
onDrag={({
target,
beforeDelta, beforeDist,
left, top,
right, bottom,
delta, dist,
transform,
clientX, clientY,
}: OnDrag) => {
console.log("onDrag left, top", left, top);
// target!.style.left = `${left}px`;
// target!.style.top = `${top}px`;
console.log("onDrag translate", dist);
target!.style.transform = transform;
}}
onDragEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onDragEnd", target, isDrag);
}}
/* When resize or scale, keeps a ratio of the width, height. */
keepRatio={true}
/* resizable*/
/* Only one of resizable, scalable, warpable can be used. */
resizable={true}
throttleResize={0}
onResizeStart={({ target , clientX, clientY}) => {
console.log("onResizeStart", target);
}}
onResize={({
target, width, height,
dist, delta, direction,
clientX, clientY,
}: OnResize) => {
console.log("onResize", target);
delta[0] && (target!.style.width = `${width}px`);
delta[1] && (target!.style.height = `${height}px`);
}}
onResizeEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onResizeEnd", target, isDrag);
}}
/* scalable */
/* Only one of resizable, scalable, warpable can be used. */
scalable={true}
throttleScale={0}
onScaleStart={({ target, clientX, clientY }) => {
console.log("onScaleStart", target);
}}
onScale={({
target, scale, dist, delta, transform,
clientX, clientY,
}: OnScale) => {
console.log("onScale scale", scale);
target!.style.transform = transform;
}}
onScaleEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onScaleEnd", target, isDrag);
}}
/* rotatable */
rotatable={true}
throttleRotate={0}
onRotateStart={({ target, clientX, clientY }) => {
console.log("onRotateStart", target);
}}
onRotate={({
target,
delta, dist,
transform,
clientX, clientY,
}: onRotate) => {
console.log("onRotate", dist);
target!.style.transform = transform;
}}
onRotateEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onRotateEnd", target, isDrag);
}}
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
pinchable={true}
onPinchStart={({ target, clientX, clientY, datas }) => {
// pinchStart event occur before dragStart, rotateStart, scaleStart, resizeStart
console.log("onPinchStart");
}}
onPinch={({ target, clientX, clientY, datas }) => {
// pinch event occur before drag, rotate, scale, resize
console.log("onPinch");
}}
onPinchEnd={({ isDrag, target, clientX, clientY, datas }) => {
// pinchEnd event occur before dragEnd, rotateEnd, scaleEnd, resizeEnd
console.log("onPinchEnd");
}}
/>
);
}
```
### React 18 concurrent mode
If you are using React 18's concurrent mode, use `flushSync` for UI sync.
```tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import { flushSync } from "react-dom";
import Moveable from "react-moveable";
function App() {
return
}
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
);
```
## ⚙️ Developments
### `npm start`
The main project was made with `react` and I used [`croact`](https://github.com/daybrush/croact) to make it lighter with umd.
For development and testing, check in [packages/react-moveable](https://github.com/daybrush/moveable/blob/master/packages/react-moveable).
```
$ yarn
$ npm run packages:build
$ npm run storybook
```
Runs the app in the development mode.
Open [http://localhost:6006](http://localhost:6006) to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
## ⭐️ Show Your Support
Please give a ⭐️ if this project helped you!
## 👏 Contributing
If you have any questions or requests or want to contribute to `moveable` or other packages, please write the [issue](https://github.com/daybrush/moveable/issues) or give me a Pull Request freely.
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/daybrush/moveable/blob/master/CONTRIBUTING.md)].
## 🐞 Bug Report
If you find a bug, please report to us opening a new [Issue](https://github.com/daybrush/moveable/issues) on GitHub.
## Sponsors
## 📝 License
This project is [MIT](https://github.com/daybrush/moveable/blob/master/LICENSE) licensed.
```
MIT License
Copyright (c) 2019 Daybrush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
================================================
FILE: packages/react-moveable/croffle.config.js
================================================
const {
ReactCroissant,
VueWaffle,
DefaultModulePrefixSirup,
ModuleSirupFactory,
TemplateSirupFactory,
SvelteWaffle,
ScriptWaffle,
ScriptComponentSirupFactory,
createInlineNewExpression,
factory,
AngularWaffle,
LitWaffle,
transform,
copyJsxAttribute,
copyJsxElement,
} = require("croffle");
const {
cleanPaths,
} = require("@croffle/bakery");
const {
decamelize,
} = require("@daybrush/utils");
const ts = require("typescript");
cleanPaths("stories/**/+([0-9A-Za-z])-*/{script,vue2,vue3,svelte,angular,lit}/");
const scriptMoveableScriptComponentSirup = ScriptComponentSirupFactory({
path: ["moveable", "default"],
isContainerInstance: true,
});
const scriptSelectoComponentSirup = ScriptComponentSirupFactory({
path: ["selecto", "default"],
instance(node) {
const args = node.arguments;
const elementNode = args[0];
const optionsNode = args[1];
return createInlineNewExpression(
node.expression,
[factory.createObjectLiteralExpression([
factory.createPropertyAssignment("container", elementNode),
...optionsNode.properties,
])],
);
},
});
const ngxModuleSirup = ModuleSirupFactory(
{
module: /ngx-/g,
name: "default",
},
{
module: module => module,
name: (_, binding) => `Ngx${binding}Component`,
},
);
const ngxTemplateSirup = TemplateSirupFactory(
/^Ngx(.+)Component$/g,
text => decamelize(text.replace(/^Ngx/g, "ngx").replace(/Component$/g, ""), "-"),
);
function vueKeyconSirup(sirup) {
sirup.requestId({
path: [/vue[3]?-keycon/g, "useKeycon"],
named: ["isKeydown"],
}, node => {
// use ref
return sirup.utils.createInlinePropertyAccess(node, "value");
});
}
function svelteKeyconSirup(sirup){
sirup.requestId({
path: [/svelte-keycon/g, "useKeycon"],
named: ["isKeydown"],
}, node => {
// use writable
return sirup.ts.factory.createIdentifier(`$${node.name.escapedText}`);
});
}
const litTemplateAttributeSirup = sirup => {
sirup.requestTemplate({
module: /lit-moveable|lit-selecto/g,
name: "default",
}, info => {
const nextOpeningElement = transform(info.openingElement, node => {
if (!ts.isJsxAttribute(node)) {
return;
}
const attrName = node.name.escapedText;
if (attrName.match(/^on[A-Z]/g)) {
return copyJsxAttribute(node, {
name: factory.createIdentifier(attrName.replace("on", "onLit")),
});
} else if (attrName === "draggable") {
return copyJsxAttribute(node, {
name: factory.createIdentifier("litDraggable"),
});
}
});
const node = info.node;
if (ts.isJsxElement(node)) {
return copyJsxElement(node, {
openingElement: nextOpeningElement,
});
} else {
return nextOpeningElement;
}
});
};
const litTemplateSirup = TemplateSirupFactory(
{ module: /lit-/g, name: "default" },
tagName => `lit-${decamelize(tagName).toLowerCase()}`,
);
/**
* @param {import("croffle").Sirup} sirup
*/
function PreviewPropsSirup(sirup) {
sirup.requestProps((node, { data }) => {
if (!data.props) {
data.props = [];
}
node.members.forEach(member => {
const propName = member.name.escapedText;
data.props.push(propName);
});
return sirup.utils.copyInterfaceDeclaration(node, { members: [] });
});
sirup.requestLifeCycle("created", (node, { data }) => {
if (!data.props || !data.props.length) {
return;
}
const statements = data.props.map(name => {
return sirup.utils.createInlineCroffleAssignment(
name,
"Any",
sirup.factory.createStringLiteral(`$preview_${name}`),
);
});
const body = node.body;
return sirup.utils.copyFunctionDeclaration(
node,
{
body: sirup.factory.updateBlock(body, [
...statements,
...body.statements,
]),
},
);
});
}
/**
* @type {import("@croffle/bakery").CroffleConfig[]}
*/
const config = [
{
targets: "stories/**/+([0-9A-Za-z])-*/React*App.tsx",
// targets: "stories/1-Basic/**/React*App.tsx",
croissant: () => {
const croissant = new ReactCroissant();
croissant.addSirup(PreviewPropsSirup);
croissant.addSirup(sirup => {
sirup.convertImport("@/react-moveable", "react-moveable");
sirup.convertImport("@/helper", "@moveable/helper");
});
croissant.addSirup(DefaultModulePrefixSirup);
return croissant;
},
defrosted: (defrosted, croissant) => {
const app = defrosted.app;
const results = croissant.findUsedSpecifiers(app, "react-dom", "createPortal");
return !results.length;
},
waffle: [
// Vanilla
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
if (hasKeycon) {
return;
}
const waffle = new ScriptWaffle();
waffle.addSirup(
scriptMoveableScriptComponentSirup,
scriptSelectoComponentSirup,
);
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
// Vue 3
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
const waffle = new VueWaffle();
if (hasKeycon) {
waffle.addSirup(
sirup => {
sirup.convertImport("vue3-keycon", "vue-keycon");
},
vueKeyconSirup,
);
}
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
// Vue 2
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
const waffle = new VueWaffle({
useVue2: true,
useOptionsAPI: !hasKeycon,
});
if (hasKeycon) {
waffle.addSirup(
sirup => {
sirup.convertImport("vue-keycon", "vue2-keycon");
},
vueKeyconSirup,
);
}
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
// Svelte
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
const waffle = new SvelteWaffle();
if (hasKeycon) {
waffle.addSirup(svelteKeyconSirup);
}
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
// Angular
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
if (hasKeycon) {
return;
}
const waffle = new AngularWaffle({
useTemplateUrl: true,
});
waffle.addSirup(
ngxModuleSirup,
ngxTemplateSirup,
);
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
// Lit
(defrosted) => {
const hasKeycon = !!defrosted.allRequires["react-keycon"];
if (hasKeycon) {
return;
}
const waffle = new LitWaffle();
waffle.addSirup(
litTemplateAttributeSirup,
litTemplateSirup,
);
return {
dist: `./{type}/{name}/App{ext}`,
waffle,
};
},
],
},
];
module.exports = config;
================================================
FILE: packages/react-moveable/global.d.ts
================================================
declare module "!!raw-loader!*" {
const content: string;
export default content;
}
declare module "*.svg" {
const content: string;
export default content;
}
================================================
FILE: packages/react-moveable/groupable.md
================================================
## 🚀 How to use Groupable
* **Groupable** indicates Whether the targets can be moved in group with draggable, resizable, scalable, rotatable.
* [API Documentation](https://daybrush.com/moveable/release/latest/doc/)
* **draggable**
* [onDragGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroupStart)
* [onDragGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroup)
* [onDragGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:dragGroupEnd)
* **resizable**
* [onResizeGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroupStart)
* [onResizeGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroup)
* [onResizeGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:resizeGroupEnd)
* **scalable**
* [onScaleGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:scaleGroupStart)
* [onScaleGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:scaleGroup)
* [onScaleGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rscaleGroupEnd)
* **rotatable**
* [onRotateGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroupStart)
* [onRotateGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroup)
* [onRotateGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:rotateGroupEnd)
* **pinchable**
* [onPinchGroupStart](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroupStart)
* [onPinchGroup](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroup)
* [onPinchGroupEnd](https://daybrush.com/moveable/release/latest/doc/Moveable.html#.event:pinchGroupEnd)
```tsx
import Moveable from "react-moveable";
render() {
return (
{
console.log("onDragGroupStart", targets);
}}
onDragGroup={({ targets, events }) => {
console.log("onDragGroup", targets);
events.forEach(ev => {
// drag event
console.log("onDrag left, top", ev.left, ev.top);
// ev.target!.style.left = `${ev.left}px`;
// ev.target!.style.top = `${ev.top}px`;
console.log("onDrag translate", ev.dist);
ev.target!.style.transform = ev.transform;)
});
}}
onDragGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onDragGroupEnd", target, isDrag);
}}
/* When resize or scale, keeps a ratio of the width, height. */
keepRatio={true}
/* resizable*/
/* Only one of resizable, scalable, warpable can be used. */
resizable={true}
throttleResize={0}
onResizeGroupStart={({ targets, clientX, clientY }) => {
console.log("onResizeGroupStart", targets);
}}
onResizeGroup={({ events, targets, direction }) => {
console.log("onResizeGroup", targets);
events.forEach(ev => {
const offset = [
direction[0] < 0 ? -ev.delta[0] : 0,
direction[1] < 0 ? -ev.delta[1] : 0,
];
// ev.drag is a drag event that occurs when the group resize.
const left = offset[0] + ev.drag.beforeDist[0];
const top = offset[1] + ev.drag.beforeDist[1];
const width = ev.width;
const top = ev.top;
});
}}
onResizeGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onResizeGroupEnd", targets, isDrag);
}}
/* scalable */
/* Only one of resizable, scalable, warpable can be used. */
scalable={true}
throttleScale={0}
onScaleGroupStart={({ targets, clientX, clientY }) => {
console.log("onScaleGroupStart", targets);
}}
onScale={({
targets,
events,
}) => {
console.log("onScaleGroup", targets);
events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group scale.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const scaleX = ev.scale[0];
const scaleY = ev.scale[1];
});
}}
onScaleEnd={({ target, isDrag, clientX, clientY }) => {
console.log("onScaleGroupEnd", target, isDrag);
}}
/* rotatable */
rotatable={true}
throttleRotate={0}
onRotateGroupStart={({ targets, clientX, clientY }) => {
console.log("onRotateGroupStart", targets);
}}
onRotateGroup={({
targets,
events
delta, dist,
}) => {
e.events.forEach(ev => {
const target = ev.target;
// ev.drag is a drag event that occurs when the group rotate.
const left = ev.drag.beforeDist[0];
const top = ev.drag.beforeDist[1];
const deg = ev.beforeDist;
});
}}
onRotateGroupEnd={({ targets, isDrag, clientX, clientY }) => {
console.log("onRotateGroupEnd", targets, isDrag);
}}
// Enabling pinchable lets you use events that
// can be used in draggable, resizable, scalable, and rotateable.
pinchable={true}
onPinchGroupStart={({ targets, clientX, clientY, datas }) => {
// pinchGroupStart event occur before dragGroupStart, rotateGroupStart, scaleGroupStart, resizeGroupStart
console.log("onPinchGroupStart");
}}
onPinchGroup={({ targets, clientX, clientY, datas }) => {
// pinchGroup event occur before dragGroup, rotateGroup, scaleGroup, resizeGroup
console.log("onPinchGroup");
}}
onPinchGroupEnd={({ isDrag, targets, clientX, clientY, datas }) => {
// pinchGroupEnd event occur before dragGroupEnd, rotateGroupEnd, scaleGroupEnd, resizeGroupEnd
console.log("onPinchGroupEnd");
}}
/>
);
}
```
================================================
FILE: packages/react-moveable/karma.conf.js
================================================
const tester = require("@daybrush/tester");
tester.setFiles([
"./src/**/*.ts",
"./src/**/*.tsx",
"./test/**/*.ts",
"./test/**/*.tsx",
]);
module.exports = tester.karmaConfig;
================================================
FILE: packages/react-moveable/mocha.opts
================================================
--timeout 10000
================================================
FILE: packages/react-moveable/package.json
================================================
{
"name": "react-moveable",
"version": "0.56.0",
"description": "A React Component that create Moveable, Draggable, Resizable, Scalable, Rotatable, Warpable, Pinchable, Groupable.",
"main": "./dist/moveable.cjs.js",
"module": "./dist/moveable.esm.js",
"sideEffects": false,
"types": "declaration/index.d.ts",
"files": [
"./*",
"src/*",
"dist/*",
"declaration/*",
"types/*"
],
"scripts": {
"lint": "eslint ./src/ --ext .ts,.tsx",
"storybook": "rm -rf node_modules/.cache && start-storybook -p 6006",
"bake": "bake",
"test": "test-storybook",
"test:build": "EXEC_TEST=true build-storybook -o ./test-static",
"test:ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"yarn test:build --quiet && npx http-server ./test-static --port 6006 --silent\" \"wait-on tcp:6006 && yarn test\"",
"test:fail": "SKIP_TEST=true test-storybook",
"test:fail-build": "SKIP_TEST=true build-storybook -o ./test-static",
"test:fail-ci": "concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"yarn test:fail-build --quiet && npx http-server ./test-static --port 6006 --silent\" \"wait-on tcp:6006 && yarn test:fail\"",
"test:type": "tsc -p tsconfig.test.json",
"coverage": "test-storybook --maxWorkers=2 --coverage",
"build": "npm run lint && npm run test:type && rollup -c && npm run declaration && print-sizes ./dist",
"build:storybook": "SKIP_TEST=true build-storybook -o ../../demo/storybook",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json"
},
"keywords": [
"moveable",
"resizable",
"scalable",
"draggable",
"rotatable",
"warpable",
"pinchable",
"groupable",
"snappable",
"scrollable",
"movable",
"throttle",
"scroll",
"ratio",
"dom",
"resize",
"scale",
"drag",
"move",
"rotate",
"react",
"warp",
"snap",
"pinch",
"react"
],
"repository": {
"type": "git",
"url": "https://github.com/daybrush/moveable/blob/master/packages/react-moveable"
},
"author": "Daybrush",
"license": "MIT",
"bugs": {
"url": "https://github.com/daybrush/moveable/issues"
},
"homepage": "https://daybrush.com/moveable",
"devDependencies": {
"@babel/core": "^7.7.2",
"@croffle/bakery": "^0.0.25",
"@daybrush/builder": "^0.2.4",
"@daybrush/tester": "^0.1.3",
"@scena/react-guides": "^0.17.1",
"@storybook/addon-actions": "6.5.16",
"@storybook/addon-controls": "6.5.16",
"@storybook/addon-coverage": "^0.0.8",
"@storybook/addon-docs": "6.5.16",
"@storybook/addon-google-analytics": "^6.2.9",
"@storybook/addon-interactions": "6.5.16",
"@storybook/addon-links": "6.5.16",
"@storybook/addon-storyshots": "6.5.16",
"@storybook/addon-viewport": "6.5.16",
"@storybook/addons": "6.5.16",
"@storybook/jest": "^0.0.10",
"@storybook/mdx2-csf": "^0.0.4",
"@storybook/react": "6.5.16",
"@storybook/test-runner": "^0.9.4",
"@storybook/testing-library": "^0.0.13",
"@types/node": "^18.11.3",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"babel-loader": "^8.0.6",
"concurrently": "^7.6.0",
"croffle": "^0.0.21",
"css-loader": "^5.0.1",
"eslint": "^7.7.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-react": "^7.22.0",
"gh-pages": "^2.1.1",
"http-server": "^14.1.1",
"jest": "^29.0.3",
"jest-image-snapshot": "^6.1.0",
"keycon": "^1.0.0",
"print-sizes": "^0.2.0",
"pvu": "^0.6.1",
"raw-loader": "^4.0.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-infinite-viewer": "^0.19.1",
"react-keycon": "^0.1.2",
"react-selecto": "^1.24.0",
"storybook-addon-preview": "^2.3.0",
"storybook-dark-mode": "^1.0.9",
"ts-loader": "^8.1.0",
"tslib": "^2.3.1",
"typescript": "^4.8 <4.9",
"wait-on": "^7.0.1"
},
"dependencies": {
"@daybrush/utils": "^1.13.0",
"@egjs/agent": "^2.2.1",
"@egjs/children-differ": "^1.0.1",
"@egjs/list-differ": "^1.0.0",
"@scena/dragscroll": "^1.4.0",
"@scena/event-emitter": "^1.0.5",
"@scena/matrix": "^1.1.1",
"css-to-mat": "^1.1.1",
"framework-utils": "^1.1.0",
"gesto": "^1.19.3",
"overlap-area": "^1.1.0",
"react-css-styled": "^1.1.9",
"react-selecto": "^1.25.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
================================================
FILE: packages/react-moveable/rollup.config.js
================================================
const builder = require("@daybrush/builder");
const defaultOptions = {
tsconfig: "tsconfig.build.json",
typescript2: true,
};
module.exports = builder([
{
...defaultOptions,
input: "src/index.ts",
output: "./dist/moveable.esm.js",
visualizer: true,
format: "es",
exports: "named",
},
{
...defaultOptions,
input: "src/index.umd.ts",
output: "./dist/moveable.cjs.js",
format: "cjs",
exports: "named",
},
]);
================================================
FILE: packages/react-moveable/src/EventManager.ts
================================================
import { Able, MoveableManagerInterface } from "./types";
export default class EventManager {
private ables: Able[] = [];
constructor(
private target: HTMLElement | SVGElement | null,
private moveable: MoveableManagerInterface | null,
private eventName: string,
) {
target!.addEventListener(eventName.toLowerCase(), this._onEvent);
}
public setAbles(ables: Able[]) {
this.ables = ables;
}
public destroy() {
this.target!.removeEventListener(this.eventName.toLowerCase(), this._onEvent);
this.target = null;
this.moveable = null;
}
private _onEvent = (e: Event) => {
const eventName = this.eventName;
const moveable = this.moveable!;
if (moveable.state.disableNativeEvent) {
return;
}
this.ables.forEach(able => {
(able as any)[eventName](moveable, {
inputEvent: e,
});
});
}
}
================================================
FILE: packages/react-moveable/src/InitialMoveable.tsx
================================================
import * as React from "react";
import {
Able, MoveableInterface, GroupableProps, MoveableDefaultProps,
IndividualGroupableProps, MoveableManagerInterface, MoveableRefTargetsResultType,
MoveableTargetGroupsType, BeforeRenderableProps, RenderableProps, MoveableManagerState,
} from "./types";
import MoveableManager from "./MoveableManager";
import MoveableGroup from "./MoveableGroup";
import { ref, withMethods, prefixCSS } from "framework-utils";
import { find, getKeys, IObject, isArray, isString } from "@daybrush/utils";
import { MOVEABLE_METHODS, PREFIX, MOVEABLE_CSS } from "./consts";
import Default from "./ables/Default";
import Groupable from "./ables/Groupable";
import DragArea from "./ables/DragArea";
import { styled } from "react-css-styled";
import { getRefTargets } from "./utils";
import IndividualGroupable from "./ables/IndividualGroupable";
import MoveableIndividualGroup from "./MoveableIndividualGroup";
import ChildrenDiffer from "@egjs/children-differ";
function getElementTargets(
refTargets: MoveableRefTargetsResultType,
selectorMap: IObject>,
): Array {
const elementTargets: Array = [];
refTargets.forEach(target => {
if (!target) {
return;
}
if (isString(target)) {
if (selectorMap[target]) {
elementTargets.push(...selectorMap[target]);
}
return;
}
if (isArray(target)) {
elementTargets.push(...getElementTargets(target, selectorMap));
} else {
elementTargets.push(target);
}
});
return elementTargets;
}
function getTargetGroups(
refTargets: MoveableRefTargetsResultType,
selectorMap: IObject>,
) {
const targetGroups: MoveableTargetGroupsType = [];
refTargets.forEach(target => {
if (!target) {
return;
}
if (isString(target)) {
if (selectorMap[target]) {
targetGroups.push(...selectorMap[target]);
}
return;
}
if (isArray(target)) {
targetGroups.push(getTargetGroups(target, selectorMap));
} else {
targetGroups.push(target);
}
});
return targetGroups;
}
function compareRefTargets(
prevRefTargets: MoveableRefTargetsResultType,
nextRefTargets: MoveableRefTargetsResultType,
): boolean {
return (prevRefTargets.length !== nextRefTargets.length) || prevRefTargets.some((target, i) => {
const nextTarget = nextRefTargets[i];
if (!target && !nextTarget) {
return false;
} else if (target != nextTarget) {
if (isArray(target) && isArray(nextTarget)) {
return compareRefTargets(target, nextTarget);
}
return true;
}
return false;
});
}
type DefaultAbles = GroupableProps & IndividualGroupableProps & BeforeRenderableProps & RenderableProps;
export class InitialMoveable
extends React.PureComponent {
public static defaultAbles: readonly Able[] = [];
public static customStyledMap: Record = {};
public static defaultStyled: any = null;
public static makeStyled() {
const cssMap: IObject = {};
const ables = this.getTotalAbles();
ables.forEach(({ css }: Able) => {
if (!css) {
return;
}
css.forEach(text => {
cssMap[text] = true;
});
});
const style = getKeys(cssMap).join("\n");
this.defaultStyled = styled("div", prefixCSS(PREFIX, MOVEABLE_CSS + style));
}
public static getTotalAbles(): Able[] {
return [Default, Groupable, IndividualGroupable, DragArea, ...this.defaultAbles];
}
@withMethods(MOVEABLE_METHODS)
public moveable!: MoveableManager | MoveableGroup | MoveableIndividualGroup;
public refTargets: MoveableRefTargetsResultType = [];
public selectorMap: IObject> = {};
private _differ: ChildrenDiffer = new ChildrenDiffer();
private _elementTargets: Array = [];
private _tmpRefTargets: MoveableRefTargetsResultType = [];
private _tmpSelectorMap: IObject> = {};
private _onChangeTargets: (() => void) | null = null;
public render() {
const moveableContructor = (this.constructor as typeof InitialMoveable);
if (!moveableContructor.defaultStyled) {
moveableContructor.makeStyled();
}
const {
ables: userAbles,
props: userProps,
...props
} = this.props;
const [
refTargets,
nextSelectorMap,
] = this._updateRefs(true);
const elementTargets = getElementTargets(refTargets, nextSelectorMap);
let isGroup = elementTargets.length > 1;
const totalAbles = moveableContructor.getTotalAbles();
const ables = [
...totalAbles,
...(userAbles as any || []),
];
const nextProps = {
...props,
...(userProps || {}),
ables,
cssStyled: moveableContructor.defaultStyled,
customStyledMap: moveableContructor.customStyledMap,
};
this._elementTargets = elementTargets;
let firstRenderState: MoveableManagerState | null = null;
const prevMoveable = this.moveable;
const persistData = props.persistData;
if (persistData?.children) {
isGroup = true;
}
// Even one child is treated as a group if individualGroupable is enabled. #867
if (props.individualGroupable) {
return ;
}
if (isGroup) {
const targetGroups = getTargetGroups(refTargets, nextSelectorMap);
// manager
if (prevMoveable && !prevMoveable.props.groupable && !(prevMoveable.props as any).individualGroupable) {
const target = prevMoveable.props.target!;
if (target && elementTargets.indexOf(target) > -1) {
firstRenderState = { ...prevMoveable.state };
}
}
return ;
} else {
const target = elementTargets[0];
// manager
if (prevMoveable && (prevMoveable.props.groupable || (prevMoveable.props as any).individualGroupable)) {
const moveables = (prevMoveable as MoveableGroup | MoveableIndividualGroup).moveables || [];
const prevTargetMoveable = find(moveables, mv => mv.props.target === target);
if (prevTargetMoveable) {
firstRenderState = { ...prevTargetMoveable.state };
}
}
return key="single" ref={ref(this, "moveable")}
{...nextProps}
target={target}
firstRenderState={firstRenderState} />;
}
}
public componentDidMount() {
this._checkChangeTargets();
}
public componentDidUpdate() {
this._checkChangeTargets();
}
public componentWillUnmount() {
this.selectorMap = {};
this.refTargets = [];
}
/**
* Get targets set in moveable through target or targets of props.
* @method Moveable#getTargets
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [targetRef, ".target", document.querySelectorAll(".target")],
* });
*
* console.log(moveable.getTargets());
*/
public getTargets() {
return this.moveable?.getTargets() ?? [];
}
/**
* If the element list corresponding to the selector among the targets is changed, it is updated.
* @method Moveable#updateSelectors
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: ".target",
* });
*
* moveable.updateSelectors();
*/
public updateSelectors() {
this.selectorMap = {};
this._updateRefs();
this.forceUpdate();
}
/**
* User changes target and waits for target to change.
* @method Moveable#waitToChangeTarget
* @story combination-with-other-components--components-selecto
* @example
* document.querySelector(".target").addEventListener("mousedown", e => {
* moveable.waitToChangeTarget().then(() => {
* moveable.dragStart(e, e.currentTarget);
* });
* moveable.target = e.currentTarget;
* });
*/
public waitToChangeTarget(): Promise {
// let resolvePromise: (e: OnChangeTarget) => void;
// this._onChangeTargets = () => {
// this._onChangeTargets = null;
// resolvePromise({
// moveable: this.getManager(),
// targets: this._elementTargets,
// });
// };
// return new Promise(resolve => {
// resolvePromise = resolve;
// });
let resolvePromise: () => void;
this._onChangeTargets = () => {
this._onChangeTargets = null;
resolvePromise();
};
return new Promise(resolve => {
resolvePromise = resolve;
});
}
public waitToChangeTargets(): Promise {
return this.waitToChangeTarget();
}
public getManager(): MoveableManagerInterface {
return this.moveable;
}
public getMoveables(): MoveableManagerInterface[] {
return this.moveable.getMoveables();
}
public getDragElement(): HTMLElement | SVGElement | null | undefined {
return this.moveable.getDragElement();
}
private _updateRefs(isRender?: boolean) {
const prevRefTargets = this.refTargets;
const nextRefTargets = getRefTargets((this.props.target || this.props.targets) as any);
const isBrowser = typeof document !== "undefined";
let isUpdate = compareRefTargets(prevRefTargets, nextRefTargets);
const selectorMap = this.selectorMap;
const nextSelectorMap: IObject> = {};
this.refTargets.forEach(function updateSelectorMap(target) {
if (isString(target)) {
const selectorTarget = selectorMap[target];
if (selectorTarget) {
nextSelectorMap[target] = selectorMap[target];
} else if (isBrowser) {
isUpdate = true;
nextSelectorMap[target] = [].slice.call(document.querySelectorAll(target));
}
} else if (isArray(target)) {
target.forEach(updateSelectorMap);
}
});
this._tmpRefTargets = nextRefTargets;
this._tmpSelectorMap = nextSelectorMap;
return [
nextRefTargets,
nextSelectorMap,
!isRender && isUpdate,
] as const;
}
private _checkChangeTargets() {
this.refTargets = this._tmpRefTargets;
this.selectorMap = this._tmpSelectorMap;
const { added, removed } = this._differ.update(this._elementTargets);
const isTargetChanged = added.length || removed.length;
if (isTargetChanged) {
this.props.onChangeTargets?.({
moveable: this.moveable,
targets: this._elementTargets,
});
this._onChangeTargets?.();
}
const [
refTargets,
selectorMap,
isUpdate,
] = this._updateRefs();
this.refTargets = refTargets;
this.selectorMap = selectorMap;
if (isUpdate) {
this.forceUpdate();
}
}
}
export interface InitialMoveable
extends React.PureComponent,
MoveableInterface {
setState(state: any, callback?: () => any): any;
forceUpdate(callback?: () => any): any;
}
================================================
FILE: packages/react-moveable/src/Moveable.tsx
================================================
import { MoveableProps, Able } from "./types";
import { MOVEABLE_ABLES } from "./ables/consts";
import { InitialMoveable } from "./InitialMoveable";
export default class Moveable extends InitialMoveable {
public static defaultAbles: Able[] = MOVEABLE_ABLES as any;
}
================================================
FILE: packages/react-moveable/src/MoveableGroup.tsx
================================================
import MoveableManager from "./MoveableManager";
import { GroupableProps, GroupRect, MoveableManagerInterface, MoveableTargetGroupsType, RectInfo } from "./types";
import ChildrenDiffer from "@egjs/children-differ";
import { getControlAbleGesto, getTargetAbleGesto } from "./gesto/getAbleGesto";
import Groupable from "./ables/Groupable";
import { MIN_NUM, MAX_NUM, TINY_NUM } from "./consts";
import {
getAbsolutePosesByState, equals, unsetGesto, rotatePosesInfo,
convertTransformOriginArray,
isDeepArrayEquals,
sign,
getRefTarget,
} from "./utils";
import { minus, plus } from "@scena/matrix";
import { getIntersectionPointsByConstants, getMinMaxs } from "overlap-area";
import { find, isArray, throttle } from "@daybrush/utils";
import { getMoveableTargetInfo } from "./utils/getMoveableTargetInfo";
import { solveC, solveConstantsDistance } from "./Snappable/utils";
import { setStoreCache } from "./store/Store";
function getMaxPos(poses: number[][][], index: number) {
return Math.max(...poses.map(([pos1, pos2, pos3, pos4]) => {
return Math.max(pos1[index], pos2[index], pos3[index], pos4[index]);
}));
}
function getMinPos(poses: number[][][], index: number) {
return Math.min(...poses.map(([pos1, pos2, pos3, pos4]) => {
return Math.min(pos1[index], pos2[index], pos3[index], pos4[index]);
}));
}
function getGroupRect(parentPoses: number[][][], rotation: number): GroupRect {
let pos1 = [0, 0];
let pos2 = [0, 0];
let pos3 = [0, 0];
let pos4 = [0, 0];
let width = 0;
let height = 0;
if (!parentPoses.length) {
return {
pos1,
pos2,
pos3,
pos4,
minX: 0,
minY: 0,
maxX: 0,
maxY: 0,
width,
height,
rotation,
};
}
const fixedRotation = throttle(rotation, TINY_NUM);
if (fixedRotation % 90) {
const rad = fixedRotation / 180 * Math.PI;
const a1 = Math.tan(rad);
const a2 = -1 / a1;
// ax = y // -ax + y = 0 // 0 => 1
// -ax = y // ax + y = 0 // 0 => 3
const a1MinMax = [MAX_NUM, MIN_NUM];
const a1MinMaxPos = [[0, 0], [0, 0]];
const a2MinMax = [MAX_NUM, MIN_NUM];
const a2MinMaxPos = [[0, 0], [0, 0]];
parentPoses.forEach(poses => {
poses.forEach(pos => {
// const b1 = pos[1] - a1 * pos[0];
// const b2 = pos[1] - a2 * pos[0];
const a1Dist = solveConstantsDistance([-a1, 1, 0], pos);
const a2Dist = solveConstantsDistance([-a2, 1, 0], pos);
if (a1MinMax[0] > a1Dist) {
a1MinMaxPos[0] = pos;
a1MinMax[0] = a1Dist;
}
if (a1MinMax[1] < a1Dist) {
a1MinMaxPos[1] = pos;
a1MinMax[1] = a1Dist;
}
if (a2MinMax[0] > a2Dist) {
a2MinMaxPos[0] = pos;
a2MinMax[0] = a2Dist;
}
if (a2MinMax[1] < a2Dist) {
a2MinMaxPos[1] = pos;
a2MinMax[1] = a2Dist;
}
});
});
const [a1MinPos, a1MaxPos] = a1MinMaxPos;
const [a2MinPos, a2MaxPos] = a2MinMaxPos;
const minHorizontalLine = [-a1, 1, solveC([-a1, 1], a1MinPos)];
const maxHorizontalLine = [-a1, 1, solveC([-a1, 1], a1MaxPos)];
const minVerticalLine = [-a2, 1, solveC([-a2, 1], a2MinPos)];
const maxVerticalLine = [-a2, 1, solveC([-a2, 1], a2MaxPos)];
[pos1, pos2, pos3, pos4] = [
[minHorizontalLine, minVerticalLine],
[minHorizontalLine, maxVerticalLine],
[maxHorizontalLine, minVerticalLine],
[maxHorizontalLine, maxVerticalLine],
].map(([line1, line2]) => getIntersectionPointsByConstants(line1, line2)[0]);
width = a2MinMax[1] - a2MinMax[0];
height = a1MinMax[1] - a1MinMax[0];
} else {
const minX = getMinPos(parentPoses, 0);
const minY = getMinPos(parentPoses, 1);
const maxX = getMaxPos(parentPoses, 0);
const maxY = getMaxPos(parentPoses, 1);
pos1 = [minX, minY];
pos2 = [maxX, minY];
pos3 = [minX, maxY];
pos4 = [maxX, maxY];
width = maxX - minX;
height = maxY - minY;
if (fixedRotation % 180) {
// 0
// 1 2
// 3 4
// 90
// 3 1
// 4 2
// 180
// 4 3
// 2 1
// 270
// 2 4
// 1 3
// 1, 2, 3,4 = 3 1 4 2
const changedX = [pos3, pos1, pos4, pos2];
[pos1, pos2, pos3, pos4] = changedX;
width = maxY - minY;
height = maxX - minX;
}
}
if (fixedRotation % 360 > 180) {
// 1 2 4 3
// 3 4 2 1
const changedX = [pos4, pos3, pos2, pos1];
[pos1, pos2, pos3, pos4] = changedX;
}
const { minX, minY, maxX, maxY } = getMinMaxs([pos1, pos2, pos3, pos4]);
return {
pos1,
pos2,
pos3,
pos4,
width,
height,
minX,
minY,
maxX,
maxY,
rotation,
};
}
type SelfGroup = Array;
type CheckedMoveableManager = { finded: boolean; manager: MoveableManager };
function findMoveableGroups(
moveables: CheckedMoveableManager[],
childTargetGroups: MoveableTargetGroupsType,
): SelfGroup {
const groups = childTargetGroups.map(targetGroup => {
if (isArray(targetGroup)) {
const childMoveableGroups = findMoveableGroups(moveables, targetGroup);
const length = childMoveableGroups.length;
if (length > 1) {
return childMoveableGroups;
} else if (length === 1) {
return childMoveableGroups[0];
} else {
return null;
}
} else {
const checked = find(moveables, ({ manager }) => manager.props.target === targetGroup)!;
if (checked) {
checked.finded = true;
return checked.manager;
}
return null;
}
}).filter(Boolean);
if (groups.length === 1 && isArray(groups[0])) {
return groups[0];
}
return groups;
}
/**
* @namespace Moveable.Group
* @description You can make targets moveable.
*/
class MoveableGroup extends MoveableManager {
public static defaultProps = {
...MoveableManager.defaultProps,
transformOrigin: ["50%", "50%"],
groupable: true,
dragArea: true,
keepRatio: true,
targets: [],
defaultGroupRotate: 0,
defaultGroupOrigin: "50% 50%",
};
public differ: ChildrenDiffer = new ChildrenDiffer();
public moveables: MoveableManager[] = [];
public transformOrigin = "50% 50%";
public renderGroupRects: GroupRect[] = [];
private _targetGroups: MoveableTargetGroupsType = [];
private _hasFirstTargets = false;
public componentDidMount() {
super.componentDidMount();
}
public checkUpdate() {
this._isPropTargetChanged = false;
this.updateAbles();
}
public getTargets() {
return this.props.targets!;
}
public updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState = true) {
const state = this.state;
if (!this.controlBox || state.isPersisted) {
return;
}
setStoreCache(true);
this.moveables.forEach(moveable => {
moveable.updateRect(type, false, false);
});
const props = this.props;
const moveables = this.moveables;
const target = state.target! || props.target!;
const checkeds = moveables.map(moveable => ({ finded: false, manager: moveable }));
const targetGroups = this.props.targetGroups || [];
const moveableGroups = findMoveableGroups(
checkeds,
targetGroups,
);
const useDefaultGroupRotate = props.useDefaultGroupRotate;
moveableGroups.push(...checkeds.filter(({ finded }) => !finded).map(({ manager }) => manager));
const renderGroupRects: GroupRect[] = [];
const isReset = !isTarget || (type !== "" && props.updateGroup);
let defaultGroupRotate = props.defaultGroupRotate || 0;
if (!this._hasFirstTargets) {
const persistedRoatation = props.persistData?.rotation;
if (persistedRoatation != null) {
defaultGroupRotate = persistedRoatation;
}
}
function getMoveableGroupRect(group: SelfGroup, parentRotation: number, isRoot?: boolean): GroupRect {
const posesRotations = group.map(moveable => {
if (isArray(moveable)) {
const rect = getMoveableGroupRect(moveable, parentRotation);
const poses = [rect.pos1, rect.pos2, rect.pos3, rect.pos4];
renderGroupRects.push(rect);
return { poses, rotation: rect.rotation };
} else {
return {
poses: getAbsolutePosesByState(moveable!.state),
rotation: moveable!.getRotation(),
};
}
});
const rotations = posesRotations.map(({ rotation }) => rotation);
let groupRotation = 0;
const firstRotation = rotations[0];
const isSameRotation = rotations.every(nextRotation => {
return Math.abs(firstRotation - nextRotation) < 0.1;
});
if (isReset) {
groupRotation = !useDefaultGroupRotate && isSameRotation ? firstRotation : defaultGroupRotate;
} else {
groupRotation = !useDefaultGroupRotate && !isRoot && isSameRotation ? firstRotation : parentRotation;
}
const groupPoses = posesRotations.map(({ poses }) => poses);
const groupRect = getGroupRect(
groupPoses,
groupRotation,
);
return groupRect;
}
const rootGroupRect = getMoveableGroupRect(moveableGroups, this.rotation, true);
if (isReset) {
// reset rotataion
this.rotation = rootGroupRect.rotation;
this.transformOrigin = props.defaultGroupOrigin || "50% 50%";
this.scale = [1, 1];
}
this._targetGroups = targetGroups;
this.renderGroupRects = renderGroupRects;
const transformOrigin = this.transformOrigin;
const rotation = this.rotation;
const scale = this.scale;
const { width, height, minX, minY } = rootGroupRect;
const posesInfo = rotatePosesInfo(
[
[0, 0],
[width, 0],
[0, height],
[width, height],
],
convertTransformOriginArray(transformOrigin, width, height),
this.rotation / 180 * Math.PI,
);
const { minX: deltaX, minY: deltaY } = getMinMaxs(posesInfo.result);
const rotateScale = ` rotate(${rotation}deg)`
+ ` scale(${sign(scale[0])}, ${sign(scale[1])})`;
const transform = `translate(${-deltaX}px, ${-deltaY}px)${rotateScale}`;
this.controlBox.style.transform
= `translate3d(${minX}px, ${minY}px, ${this.props.translateZ || 0})`;
target.style.cssText += `left:0px;top:0px;`
+ `transform-origin:${transformOrigin};`
+ `width:${width}px;height:${height}px;`
+ `transform: ${transform}`;
state.width = width;
state.height = height;
const container = this.getContainer();
const info = getMoveableTargetInfo(
this.controlBox,
target,
this.controlBox,
this.getContainer(),
this._rootContainer || container,
[],
);
const pos = [info.left!, info.top!];
const [
pos1,
pos2,
pos3,
pos4,
] = getAbsolutePosesByState(info); // info.left + info.pos(1 ~ 4)
const minPos = getMinMaxs([pos1, pos2, pos3, pos4]);
const delta = [minPos.minX, minPos.minY];
const direction = sign(scale[0] * scale[1]);
info.pos1 = minus(pos1, delta);
info.pos2 = minus(pos2, delta);
info.pos3 = minus(pos3, delta);
info.pos4 = minus(pos4, delta);
// info.left = info.left + delta[0];
// info.top = info.top + delta[1];
info.left = minX - info.left! + delta[0];
info.top = minY - info.top! + delta[1];
info.origin = minus(plus(pos, info.origin!), delta);
info.beforeOrigin = minus(plus(pos, info.beforeOrigin!), delta);
info.originalBeforeOrigin = plus(pos, info.originalBeforeOrigin!);
info.transformOrigin = minus(plus(pos, info.transformOrigin!), delta);
target.style.transform
= `translate(${-deltaX - delta[0]}px, ${-deltaY - delta[1]}px)`
+ rotateScale;
setStoreCache();
this.updateState(
{
...info,
posDelta: delta,
direction,
beforeDirection: direction,
},
isSetState,
);
}
public getRect(): RectInfo {
return {
...super.getRect(),
children: this.moveables.map(child => child.getRect()),
};
}
public triggerEvent(name: string, e: any, isManager?: boolean): any {
if (isManager || name.indexOf("Group") > -1) {
return super.triggerEvent(name as any, e);
} else {
this._emitter.trigger(name, e);
}
}
public getRequestChildStyles() {
const styleNames = this.getEnabledAbles().reduce((names, able) => {
const ableStyleNames = (able.requestChildStyle?.() ?? []) as Array;
return [...names, ...ableStyleNames];
}, [] as Array);
return styleNames;
}
public getMoveables(): MoveableManagerInterface[] {
return [...this.moveables];
}
protected updateAbles() {
super.updateAbles([...this.props.ables!, Groupable], "Group");
}
protected _updateTargets() {
super._updateTargets();
this._originalDragTarget = this.props.dragTarget || this.areaElement;
this._dragTarget = getRefTarget(this._originalDragTarget, true);
}
protected _updateEvents() {
const state = this.state;
const props = this.props;
const prevTarget = this._prevDragTarget;
const nextTarget = props.dragTarget || this.areaElement;
const targets = props.targets!;
const { added, changed, removed } = this.differ.update(targets);
const isTargetChanged = added.length || removed.length;
if (isTargetChanged || this._prevOriginalDragTarget !== this._originalDragTarget) {
unsetGesto(this, false);
unsetGesto(this, true);
this.updateState({ gestos: {} });
}
if (prevTarget !== nextTarget) {
state.target = null;
}
if (!state.target) {
state.target = this.areaElement;
this.controlBox.style.display = "block";
}
if (state.target) {
if (!this.targetGesto) {
this.targetGesto = getTargetAbleGesto(this, this._dragTarget!, "Group");
}
if (!this.controlGesto) {
this.controlGesto = getControlAbleGesto(this, "GroupControl");
}
}
const isContainerChanged = !equals(state.container, props.container);
if (isContainerChanged) {
state.container = props.container;
}
if (
isContainerChanged
|| isTargetChanged
|| this.transformOrigin !== (props.defaultGroupOrigin || "50% 50%")
|| changed.length
|| targets.length && !isDeepArrayEquals(this._targetGroups, props.targetGroups || [])
) {
this.updateRect();
this._hasFirstTargets = true;
}
this._isPropTargetChanged = !!isTargetChanged;
}
protected _updateObserver() { }
}
/**
* Sets the initial rotation of the group.
* @name Moveable.Group#defaultGroupRotate
* @default 0
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* defaultGroupRotate: 0,
* });
*
* moveable.defaultGroupRotate = 40;
*/
/**
* Sets the initial origin of the group.
* @name Moveable.Group#defaultGroupOrigin
* @default 0
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* defaultGroupOrigin: "50% 50%",
* });
*
* moveable.defaultGroupOrigin = "20% 40%";
*/
/**
* Whether to hide the line in child moveable for group corresponding to the rect of the target.
* @name Moveable.Group#hideChildMoveableDefaultLines
* @default false
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* hideChildMoveableDefaultLines: false,
* });
*
* moveable.hideChildMoveableDefaultLines = true;
*/
export default MoveableGroup;
================================================
FILE: packages/react-moveable/src/MoveableIndividualGroup.tsx
================================================
import { ref, refs } from "framework-utils";
import * as React from "react";
import MoveableManager from "./MoveableManager";
import { GroupableProps, IndividualGroupableProps, MoveableManagerInterface, RectInfo, Requester } from "./types";
import { prefix } from "./utils";
import { setStoreCache } from "./store/Store";
import { find } from "@daybrush/utils";
/**
* @namespace Moveable.IndividualGroup
* @description Create targets individually, not as a group.Create targets individually, not as a group.
*/
class MoveableIndividualGroup extends MoveableManager {
public moveables: MoveableManager[] = [];
public render() {
const props = this.props;
const {
cspNonce,
cssStyled: ControlBoxElement,
persistData,
} = props;
let targets: Array = props.targets || [];
const length = targets.length;
const canPersist = this.isUnmounted || !length;
let persistDatChildren = persistData?.children ?? [];
if (canPersist && !length && persistDatChildren.length) {
targets = persistDatChildren.map(() => null);
} else if (!canPersist) {
persistDatChildren = [];
}
return
{targets!.map((target, i) => {
const individualProps = props.individualGroupableProps?.(target, i) ?? {};
return ;
})}
;
}
public componentDidMount() {}
public componentDidUpdate() {}
public getTargets() {
return this.props.targets!;
}
public updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState: boolean = true) {
setStoreCache(true);
this.moveables.forEach(moveable => {
moveable.updateRect(type, isTarget, isSetState);
});
setStoreCache();
}
public getRect(): RectInfo {
return {
...super.getRect(),
children: this.moveables.map(child => child.getRect()),
};
}
public request(
ableName: string,
param: Record = {},
isInstant?: boolean,
): Requester {
const results = this.moveables.map(m => m.request(ableName, {...param, isInstant: false }, false));
const requestInstant = isInstant || param.isInstant;
const requester: Requester = {
request(ableParam: Record) {
results.forEach(r => r.request(ableParam));
return this;
},
requestEnd() {
results.forEach(r => r.requestEnd());
return this;
},
};
return requestInstant ? requester.request(param).requestEnd() : requester;
}
public dragStart(e: MouseEvent | TouchEvent, target: EventTarget | null = e.target) {
const inputTarget = target as HTMLElement;
const childMoveable = find(this.moveables, child => {
const target = child.getTargets()[0];
const controlBoxElement = child.getControlBoxElement();
const dragElement = child.getDragElement();
if (!target || !dragElement) {
return false;
}
return dragElement === inputTarget || dragElement.contains(inputTarget)
|| (dragElement !== target && target === inputTarget || target.contains(inputTarget))
|| controlBoxElement === inputTarget || controlBoxElement.contains(inputTarget);
});
if (childMoveable) {
childMoveable.dragStart(e, target);
}
return this;
}
public hitTest() {
return 0;
}
public isInside() {
return false;
}
public isDragging() {
return false;
}
public getDragElement() {
return null;
}
public getMoveables(): MoveableManagerInterface[] {
return [...this.moveables];
}
public updateRenderPoses() { }
public checkUpdate() { }
public triggerEvent() { }
protected updateAbles() { }
protected _updateEvents() { }
protected _updateObserver() {}
}
/**
* Create targets individually, not as a group.
* @name Moveable.IndividualGroup#individualGroupable
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* individualGroupable: true,
* });
*/
export default MoveableIndividualGroup;
================================================
FILE: packages/react-moveable/src/MoveableManager.tsx
================================================
import * as React from "react";
import { createElement } from "react";
import { PREFIX } from "./consts";
import {
prefix,
unsetGesto,
getAbsolutePosesByState,
getRect,
filterAbles,
equals,
flat,
groupByMap,
calculatePadding,
getAbsoluteRotation,
defaultSync,
getRefTarget,
groupBy,
unsetAbles,
getPaddingBox,
} from "./utils";
import Gesto from "gesto";
import { ref } from "framework-utils";
import {
MoveableManagerProps, MoveableManagerState, Able,
RectInfo, Requester, HitRect, MoveableManagerInterface,
MoveableDefaultOptions,
GroupableProps,
MoveableRefType,
} from "./types";
import {
triggerAble, getTargetAbleGesto,
checkMoveableTarget, getControlAbleGesto,
} from "./gesto/getAbleGesto";
import { createOriginMatrix, multiplies, plus } from "@scena/matrix";
import {
addClass, cancelAnimationFrame, find,
getKeys, getWindow, IObject, isNode, removeClass, requestAnimationFrame,
} from "@daybrush/utils";
import { renderLine } from "./renderDirections";
import { fitPoints, getAreaSize, getOverlapSize, isInside } from "overlap-area";
import EventManager from "./EventManager";
import { styled } from "react-css-styled";
import EventEmitter from "@scena/event-emitter";
import { getMoveableTargetInfo } from "./utils/getMoveableTargetInfo";
import { VIEW_DRAGGING } from "./classNames";
import { diff } from "@egjs/list-differ";
import { getPersistState } from "./utils/persist";
import { setStoreCache } from "./store/Store";
export default class MoveableManager
extends React.PureComponent, MoveableManagerState> {
public static defaultProps: Required = {
dragTargetSelf: false,
target: null,
dragTarget: null,
container: null,
rootContainer: null,
origin: true,
parentMoveable: null,
wrapperMoveable: null,
isWrapperMounted: false,
parentPosition: null,
warpSelf: false,
svgOrigin: "",
dragContainer: null,
useResizeObserver: false,
useMutationObserver: false,
preventDefault: true,
preventRightClick: true,
preventWheelClick: true,
linePadding: 0,
controlPadding: 0,
ables: [],
pinchThreshold: 20,
dragArea: false,
passDragArea: false,
transformOrigin: "",
className: "",
zoom: 1,
triggerAblesSimultaneously: false,
padding: {},
pinchOutside: true,
checkInput: false,
dragFocusedInput: false,
groupable: false,
hideDefaultLines: false,
cspNonce: "",
translateZ: 0,
cssStyled: null,
customStyledMap: {},
props: {},
stopPropagation: false,
preventClickDefault: false,
preventClickEventOnDrag: true,
flushSync: defaultSync,
firstRenderState: null,
persistData: null,
viewContainer: null,
requestStyles: [],
useAccuratePosition: false,
};
public state: MoveableManagerState = {
container: null,
gestos: {},
renderLines: [
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
],
renderPoses: [[0, 0], [0, 0], [0, 0], [0, 0]],
disableNativeEvent: false,
posDelta: [0, 0],
...getMoveableTargetInfo(null),
};
public renderState: Record = {};
public enabledAbles: Able[] = [];
public targetAbles: Able[] = [];
public controlAbles: Able[] = [];
public controlBox!: HTMLElement;
public areaElement!: HTMLElement;
public targetGesto!: Gesto;
public controlGesto!: Gesto;
public rotation = 0;
public scale: number[] = [1, 1];
public isMoveableMounted = false;
public isUnmounted = false;
public events: Record = {
"mouseEnter": null,
"mouseLeave": null,
};
protected _emitter: EventEmitter = new EventEmitter();
protected _prevOriginalDragTarget: MoveableRefType | null = null;
protected _originalDragTarget: MoveableRefType | null = null;
protected _prevDragTarget: HTMLElement | SVGElement | null | undefined = null;
protected _dragTarget: HTMLElement | SVGElement | null | undefined = null;
protected _prevPropTarget: HTMLElement | SVGElement | null | undefined = null;
protected _propTarget: HTMLElement | SVGElement | null | undefined = null;
protected _prevDragArea = false;
protected _isPropTargetChanged = false;
protected _hasFirstTarget = false;
private _reiszeObserver: ResizeObserver | null = null;
private _observerId = 0;
private _mutationObserver: MutationObserver | null = null;
public _rootContainer: HTMLElement | null | undefined = null;
private _viewContainer: HTMLElement | null | undefined = null;
private _viewClassNames: string[] = [];
private _store: Record = {};
public render() {
const props = this.props;
const state = this.getState();
const {
parentPosition,
className,
target: propsTarget,
zoom, cspNonce,
translateZ,
cssStyled: ControlBoxElement,
groupable,
linePadding,
controlPadding,
} = props;
this._checkUpdateRootContainer();
this.checkUpdate();
this.updateRenderPoses();
const [parentLeft, parentTop] = parentPosition as number[] || [0, 0];
const {
left,
top,
target: stateTarget,
direction,
hasFixed,
offsetDelta,
} = state;
const groupTargets = (props as any).targets;
const isDragging = this.isDragging();
const ableAttributes: IObject = {};
this.getEnabledAbles().forEach(able => {
ableAttributes[`data-able-${able.name.toLowerCase()}`] = true;
});
const ableClassName = this._getAbleClassName();
const isDisplay
= (groupTargets && groupTargets.length && (stateTarget || groupable))
|| propsTarget
|| (!this._hasFirstTarget && this.state.isPersisted);
const isVisible = this.controlBox || this.props.firstRenderState || this.props.persistData;
const translate = [left - parentLeft, top - parentTop];
if (!groupable && props.useAccuratePosition) {
translate[0] += offsetDelta[0];
translate[1] += offsetDelta[1];
}
const style: Record = {
"position": hasFixed ? "fixed" : "absolute",
"display": isDisplay ? "block" : "none",
"visibility": isVisible ? "visible" : "hidden",
"transform": `translate3d(${translate[0]}px, ${translate[1]}px, ${translateZ})`,
"--zoom": zoom,
"--zoompx": `${zoom}px`,
};
if (linePadding) {
style["--moveable-line-padding"] = linePadding;
}
if (controlPadding) {
style["--moveable-control-padding"] = controlPadding;
}
return (
{this.renderAbles()}
{this._renderLines()}
);
}
public componentDidMount() {
this.isMoveableMounted = true;
this.isUnmounted = false;
const props = this.props;
const { parentMoveable, container } = props;
this._checkUpdateRootContainer();
this._checkUpdateViewContainer();
this._updateTargets();
this._updateNativeEvents();
this._updateEvents();
this.updateCheckInput();
this._updateObserver(this.props);
if (!container && !parentMoveable && !this.state.isPersisted) {
this.updateRect("", false, false);
this.forceUpdate();
}
}
public componentDidUpdate(prevProps: any) {
this._checkUpdateRootContainer();
this._checkUpdateViewContainer();
this._updateNativeEvents();
this._updateTargets();
this._updateEvents();
this.updateCheckInput();
this._updateObserver(prevProps);
}
public componentWillUnmount() {
this.isMoveableMounted = false;
this.isUnmounted = true;
this._emitter.off();
this._reiszeObserver?.disconnect();
this._mutationObserver?.disconnect();
const viewContainer = this._viewContainer;
if (viewContainer) {
this._changeAbleViewClassNames([]);
}
unsetGesto(this, false);
unsetGesto(this, true);
const events = this.events;
for (const name in events) {
const manager = events[name];
manager && manager.destroy();
}
}
public getTargets(): Array {
const target = this.props.target;
return target ? [target] : [];
}
/**
* Get the able used in MoveableManager.
* @method Moveable#getAble
* @param - able name
*/
public getAble(ableName: string): T | undefined {
const ables: Able[] = this.props.ables || [];
return find(ables, able => able.name === ableName) as T;
}
public getContainer(): HTMLElement | SVGElement {
const { parentMoveable, wrapperMoveable, container } = this.props;
return container!
|| (wrapperMoveable && wrapperMoveable.getContainer())
|| (parentMoveable && parentMoveable.getContainer())
|| this.controlBox.parentElement!;
}
/**
* Returns the element of the control box.
* @method Moveable#getControlBoxElement
*/
public getControlBoxElement(): HTMLElement {
return this.controlBox;
}
/**
* Target element to be dragged in moveable
* @method Moveable#getDragElement
*/
public getDragElement(): HTMLElement | SVGElement | null | undefined {
return this._dragTarget;
}
/**
* Check if the target is an element included in the moveable.
* @method Moveable#isMoveableElement
* @param - the target
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* window.addEventListener("click", e => {
* if (!moveable.isMoveableElement(e.target)) {
* moveable.target = e.target;
* }
* });
*/
public isMoveableElement(target: Element) {
return target && (target.getAttribute?.("class") || "").indexOf(PREFIX) > -1;
}
/**
* You can drag start the Moveable through the external `MouseEvent`or `TouchEvent`. (Angular: ngDragStart)
* @method Moveable#dragStart
* @param - external `MouseEvent`or `TouchEvent`
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* document.body.addEventListener("mousedown", e => {
* if (!moveable.isMoveableElement(e.target)) {
* moveable.dragStart(e);
* }
* });
*/
public dragStart(e: MouseEvent | TouchEvent, target: EventTarget | null = e.target) {
const targetGesto = this.targetGesto;
const controlGesto = this.controlGesto;
if (targetGesto && checkMoveableTarget(this)({ inputEvent: e }, target)) {
if (!targetGesto.isFlag()) {
targetGesto.triggerDragStart(e);
}
} else if (controlGesto && this.isMoveableElement(target as Element)) {
if (!controlGesto.isFlag()) {
controlGesto.triggerDragStart(e);
}
}
return this;
}
/**
* Hit test an element or rect on a moveable target.
* (100% = 100)
* @method Moveable#hitTest
* @param - element or rect to test
* @return - Get hit test rate (rate > 0 is hitted)
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* document.body.addEventListener("mousedown", e => {
* if (moveable.hitTest(e.target) > 0) {
* console.log("hiited");
* }
* });
*/
public hitTest(el: Element | HitRect): number {
const { target, pos1, pos2, pos3, pos4, targetClientRect } = this.state;
if (!target) {
return 0;
}
let rect: Required;
if (isNode(el)) {
const clientRect = el.getBoundingClientRect();
rect = {
left: clientRect.left,
top: clientRect.top,
width: clientRect.width,
height: clientRect.height,
};
} else {
rect = { width: 0, height: 0, ...el };
}
const {
left: rectLeft,
top: rectTop,
width: rectWidth,
height: rectHeight,
} = rect;
const points = fitPoints([pos1, pos2, pos4, pos3], targetClientRect);
const size = getOverlapSize(points, [
[rectLeft, rectTop],
[rectLeft + rectWidth, rectTop],
[rectLeft + rectWidth, rectTop + rectHeight],
[rectLeft, rectTop + rectHeight],
]);
const totalSize = getAreaSize(points);
if (!size || !totalSize) {
return 0;
}
return Math.min(100, size / totalSize * 100);
}
/**
* Whether the coordinates are inside Moveable
* @method Moveable#isInside
* @param - x coordinate
* @param - y coordinate
* @return - True if the coordinate is in moveable or false
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* document.body.addEventListener("mousedown", e => {
* if (moveable.isInside(e.clientX, e.clientY)) {
* console.log("inside");
* }
* });
*/
public isInside(clientX: number, clientY: number) {
const { target, pos1, pos2, pos3, pos4, targetClientRect } = this.state;
if (!target) {
return false;
}
return isInside([clientX, clientY], fitPoints([pos1, pos2, pos4, pos3], targetClientRect));
}
/**
* If the width, height, left, and top of all elements change, update the shape of the moveable.
* @method Moveable#updateRect
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* window.addEventListener("resize", e => {
* moveable.updateRect();
* });
*/
public updateRect(type?: "Start" | "" | "End", isTarget?: boolean, isSetState: boolean = true) {
const props = this.props;
const isSingle = !props.parentPosition && !props.wrapperMoveable;
if (isSingle) {
setStoreCache(true);
}
const parentMoveable = props.parentMoveable;
const state = this.state;
const target = (state.target || props.target) as HTMLElement | SVGElement;
const container = this.getContainer();
const rootContainer = parentMoveable
? (parentMoveable as any)._rootContainer
: this._rootContainer;
const nextState = getMoveableTargetInfo(
this.controlBox,
target,
container,
container,
rootContainer || container,
this._getRequestStyles(),
);
if (!target && this._hasFirstTarget && props.persistData) {
const persistState = getPersistState(props.persistData);
for (const name in persistState) {
(nextState as any)[name] = (persistState as any)[name];
}
}
if (isSingle) {
setStoreCache();
}
this.updateState(
nextState,
parentMoveable ? false : isSetState,
);
}
/**
* Check if the moveable state is being dragged.
* @method Moveable#isDragging
* @param - If you want to check if able is dragging, specify ableName.
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* // false
* console.log(moveable.isDragging());
*
* moveable.on("drag", () => {
* // true
* console.log(moveable.isDragging());
* });
*/
public isDragging(ableName?: string) {
const targetGesto = this.targetGesto;
const controlGesto = this.controlGesto;
if (targetGesto?.isFlag()) {
if (!ableName) {
return true;
}
const data = targetGesto.getEventData();
return !!data[ableName]?.isEventStart;
}
if (controlGesto?.isFlag()) {
if (!ableName) {
return true;
}
const data = controlGesto.getEventData();
return !!data[ableName]?.isEventStart;
}
return false;
}
/**
* If the width, height, left, and top of the only target change, update the shape of the moveable.
* Use `.updateRect()` method
* @method Moveable#updateTarget
* @deprecated
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* moveable.updateTarget();
*/
public updateTarget(type?: "Start" | "" | "End") {
this.updateRect(type, true);
}
/**
* You can get the vertex information, position and offset size information of the target based on the container.
* @method Moveable#getRect
* @return - The Rect Info
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* const rectInfo = moveable.getRect();
*/
public getRect(): RectInfo {
const state = this.state;
const poses = getAbsolutePosesByState(this.state);
const [pos1, pos2, pos3, pos4] = poses;
const rect = getRect(poses);
const {
width: offsetWidth,
height: offsetHeight,
} = state;
const {
width,
height,
left,
top,
} = rect;
const statePos = [state.left, state.top];
const origin = plus(statePos, state.origin);
const beforeOrigin = plus(statePos, state.beforeOrigin);
const transformOrigin = state.transformOrigin;
return {
width,
height,
left,
top,
pos1,
pos2,
pos3,
pos4,
offsetWidth,
offsetHeight,
beforeOrigin,
origin,
transformOrigin,
rotation: this.getRotation(),
};
}
/**
* Get a manager that manages the moveable's state and props.
* @method Moveable#getManager
* @return - The Rect Info
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* const manager = moveable.getManager(); // real moveable class instance
*/
public getManager(): MoveableManagerInterface {
return this as any;
}
/**
* You can stop the dragging currently in progress through a method from outside.
* @method Moveable#stopDrag
* @return - The Rect Info
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* moveable.stopDrag();
*/
public stopDrag(type?: "target" | "control"): void {
if (!type || type === "target") {
const gesto = this.targetGesto;
if (gesto?.isIdle() === false) {
unsetAbles(this, false);
}
gesto?.stop();
}
if (!type || type === "control") {
const gesto = this.controlGesto;
if (gesto?.isIdle() === false) {
unsetAbles(this, true);
}
gesto?.stop();
}
}
public getRotation() {
const {
pos1,
pos2,
direction,
} = this.state;
return getAbsoluteRotation(pos1, pos2, direction);
}
/**
* Request able through a method rather than an event.
* At the moment of execution, requestStart is executed,
* and then request and requestEnd can be executed through Requester.
* @method Moveable#request
* @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Draggable.html#request|Draggable Requester}
* @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Resizable.html#request|Resizable Requester}
* @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Scalable.html#request|Scalable Requester}
* @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.Rotatable.html#request|Rotatable Requester}
* @see {@link https://daybrush.com/moveable/release/latest/doc/Moveable.OriginDraggable.html#request|OriginDraggable Requester}
* @param - ableName
* @param - request to be able params.
* @param - If isInstant is true, request and requestEnd are executed immediately.
* @return - Able Requester. If there is no request in able, nothing will work.
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* // Instantly Request (requestStart - request - requestEnd)
* moveable.request("draggable", { deltaX: 10, deltaY: 10 }, true);
*
* // Start move
* const requester = moveable.request("draggable");
* requester.request({ deltaX: 10, deltaY: 10 });
* requester.request({ deltaX: 10, deltaY: 10 });
* requester.request({ deltaX: 10, deltaY: 10 });
* requester.requestEnd();
*/
public request(
ableName: string,
param: IObject = {},
isInstant?: boolean,
): Requester {
const self = this;
const props = self.props;
const manager = props.parentMoveable || props.wrapperMoveable || self;
const allAbles = manager.props.ables!;
const groupable = props.groupable;
const requsetAble = find(allAbles, (able: Able) => able.name === ableName);
if (this.isDragging() || !requsetAble || !requsetAble.request) {
return {
request() {
return this;
},
requestEnd() {
return this;
},
};
}
const ableRequester = requsetAble.request(self);
const requestInstant = isInstant || param.isInstant;
const ableType = ableRequester.isControl ? "controlAbles" : "targetAbles";
const eventAffix = `${(groupable ? "Group" : "")}${ableRequester.isControl ? "Control" : ""}`;
const moveableAbles: Able[] = [...manager[ableType]];
const requester = {
request(ableParam: IObject) {
triggerAble(self, moveableAbles, ["drag"], eventAffix, "", {
...ableRequester.request(ableParam),
requestAble: ableName,
isRequest: true,
}, requestInstant);
return requester;
},
requestEnd() {
triggerAble(self, moveableAbles, ["drag"], eventAffix, "End", {
...ableRequester.requestEnd(),
requestAble: ableName,
isRequest: true,
}, requestInstant);
return requester;
},
};
triggerAble(self, moveableAbles, ["drag"], eventAffix, "Start", {
...ableRequester.requestStart(param),
requestAble: ableName,
isRequest: true,
}, requestInstant);
return requestInstant ? requester.request(param).requestEnd() : requester;
}
/**
* moveable is the top level that manages targets
* `Single`: MoveableManager instance
* `Group`: MoveableGroup instance
* `IndividualGroup`: MoveableIndividaulGroup instance
* Returns leaf target MoveableManagers.
*/
public getMoveables(): MoveableManagerInterface[] {
return [this];
}
/**
* Remove the Moveable object and the events.
* @method Moveable#destroy
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
*
* moveable.destroy();
*/
public destroy(): void {
this.componentWillUnmount();
}
public updateRenderPoses() {
const state = this.getState();
const props = this.props;
const padding = props.padding;
const {
originalBeforeOrigin,
transformOrigin,
allMatrix, is3d,
pos1, pos2, pos3, pos4,
left: stateLeft,
top: stateTop,
isPersisted,
} = state;
const zoom = props.zoom || 1;
if (!padding && zoom <= 1) {
state.renderPoses = [
pos1,
pos2,
pos3,
pos4,
];
state.renderLines = [
[pos1, pos2],
[pos2, pos4],
[pos4, pos3],
[pos3, pos1],
];
return;
}
const {
left,
top,
bottom,
right,
} = getPaddingBox(padding || {});
const n = is3d ? 4 : 3;
// const clipPathInfo = getClipPath(
// props.target,
// offsetWidth,
// offsetHeight,
// );
// if (clipPathInfo) {
// left -= Math.max(0, clipPathInfo.left);
// top -= Math.max(0, clipPathInfo.top);
// bottom -= Math.max(0, offsetHeight - clipPathInfo.bottom);
// right -= Math.max(0, offsetWidth - clipPathInfo.right);
// }
let absoluteOrigin: number[] = [];
if (isPersisted) {
absoluteOrigin = transformOrigin;
} else if (this.controlBox && props.groupable) {
absoluteOrigin = originalBeforeOrigin;
} else {
absoluteOrigin = plus(originalBeforeOrigin, [stateLeft, stateTop]);
}
const nextMatrix = multiplies(
n,
createOriginMatrix(absoluteOrigin.map(v => -v), n),
allMatrix,
createOriginMatrix(transformOrigin, n),
);
const renderPos1 = calculatePadding(nextMatrix, pos1, [-left, -top], n);
const renderPos2 = calculatePadding(nextMatrix, pos2, [right, -top], n);
const renderPos3 = calculatePadding(nextMatrix, pos3, [-left, bottom], n);
const renderPos4 = calculatePadding(nextMatrix, pos4, [right, bottom], n);
state.renderPoses = [
renderPos1,
renderPos2,
renderPos3,
renderPos4,
];
state.renderLines = [
[renderPos1, renderPos2],
[renderPos2, renderPos4],
[renderPos4, renderPos3],
[renderPos3, renderPos1],
];
if (zoom) {
const zoomOffset = zoom / 2;
state.renderLines = [
[
calculatePadding(nextMatrix, pos1, [-left - zoomOffset, -top], n),
calculatePadding(nextMatrix, pos2, [right + zoomOffset, -top], n),
],
[
calculatePadding(nextMatrix, pos2, [right, -top - zoomOffset], n),
calculatePadding(nextMatrix, pos4, [right, bottom + zoomOffset], n),
],
[
calculatePadding(nextMatrix, pos4, [right + zoomOffset, bottom], n),
calculatePadding(nextMatrix, pos3, [-left - zoomOffset, bottom], n),
],
[
calculatePadding(nextMatrix, pos3, [-left, bottom + zoomOffset], n),
calculatePadding(nextMatrix, pos1, [-left, -top - zoomOffset], n),
],
];
}
}
public checkUpdate() {
this._isPropTargetChanged = false;
const { target, container, parentMoveable } = this.props;
const {
target: stateTarget,
container: stateContainer,
} = this.state;
if (!stateTarget && !target) {
return;
}
this.updateAbles();
const isTargetChanged = !equals(stateTarget, target);
const isChanged = isTargetChanged || !equals(stateContainer, container);
if (!isChanged) {
return;
}
const moveableContainer = container || this.controlBox;
if (moveableContainer) {
this.unsetAbles();
}
this.updateState({ target, container });
if (!parentMoveable && moveableContainer) {
this.updateRect("End", false, false);
}
this._isPropTargetChanged = isTargetChanged;
}
public waitToChangeTarget(): Promise {
return new Promise(() => { });
}
public triggerEvent(
name: string,
e: any,
): any {
const props = this.props;
this._emitter.trigger(name, e);
if (props.parentMoveable && e.isRequest && !e.isRequestChild) {
return props.parentMoveable.triggerEvent(name, e, true);
}
const callback = (props as any)[name];
return callback && callback(e);
}
public useCSS(tag: string, css: string) {
const customStyleMap = this.props.customStyledMap as Record;
const key = tag + css;
if (!customStyleMap[key]) {
customStyleMap[key] = styled(tag, css);
}
return customStyleMap[key];
}
public checkUpdateRect = () => {
if (this.isDragging()) {
return;
}
const parentMoveable = this.props.parentMoveable;
if (parentMoveable) {
(parentMoveable as any).checkUpdateRect();
return;
}
cancelAnimationFrame(this._observerId);
this._observerId = requestAnimationFrame(() => {
if (this.isDragging()) {
return;
}
this.updateRect();
});
}
public getState(): MoveableManagerState {
const props = this.props;
if (props.target || (props as any).targets?.length) {
this._hasFirstTarget = true;
}
const hasControlBox = this.controlBox;
const persistData = props.persistData;
const firstRenderState = props.firstRenderState;
if (firstRenderState && !hasControlBox) {
return firstRenderState;
}
if (!this._hasFirstTarget && persistData) {
const persistState = getPersistState(persistData);
if (persistState) {
this.updateState(persistState, false);
return this.state;
}
}
(this.state as any).isPersisted = false;
return this.state;
}
public updateSelectors() { }
protected unsetAbles() {
this.targetAbles.forEach(able => {
if (able.unset) {
able.unset(this);
}
});
}
protected updateAbles(
ables: Able[] = this.props.ables!,
eventAffix: string = "",
) {
const props = this.props as any;
const triggerAblesSimultaneously = props.triggerAblesSimultaneously;
const enabledAbles = this.getEnabledAbles(ables);
const dragStart = `drag${eventAffix}Start` as "dragStart";
const pinchStart = `pinch${eventAffix}Start` as "pinchStart";
const dragControlStart = `drag${eventAffix}ControlStart` as "dragControlStart";
const targetAbles = filterAbles(enabledAbles, [dragStart, pinchStart], triggerAblesSimultaneously);
const controlAbles = filterAbles(enabledAbles, [dragControlStart], triggerAblesSimultaneously);
this.enabledAbles = enabledAbles;
this.targetAbles = targetAbles;
this.controlAbles = controlAbles;
}
protected updateState(nextState: any, isSetState?: boolean) {
if (isSetState) {
if (this.isUnmounted) {
return;
}
this.setState(nextState);
} else {
const state = this.state;
for (const name in nextState) {
(state as any)[name] = nextState[name];
}
}
}
protected getEnabledAbles(ables: Able[] = this.props.ables!) {
const props = this.props as any;
return ables.filter(able => able && (
(able.always && props[able.name] !== false)
|| props[able.name]));
}
protected renderAbles() {
const props = this.props as any;
const triggerAblesSimultaneously = props.triggerAblesSimultaneously;
const Renderer = {
createElement,
};
this.renderState = {};
return groupByMap(flat(
filterAbles(this.getEnabledAbles(), ["render"], triggerAblesSimultaneously).map(({ render }) => {
return render!(this, Renderer) || [];
})).filter(el => el), ({ key }) => key).map(group => group[0]);
}
protected updateCheckInput() {
this.targetGesto && (this.targetGesto.options.checkInput = this.props.checkInput);
}
protected _getRequestStyles() {
const styleNames = this.getEnabledAbles().reduce((names, able) => {
const ableStyleNames = (able.requestStyle?.() ?? []) as Array;
return [...names, ...ableStyleNames];
}, [...(this.props.requestStyles || [])] as Array);
return styleNames;
}
protected _updateObserver(prevProps: MoveableDefaultOptions) {
this._updateResizeObserver(prevProps);
this._updateMutationObserver(prevProps);
}
protected _updateEvents() {
const hasTargetAble = this.targetAbles.length;
const hasControlAble = this.controlAbles.length;
const target = this._dragTarget;
const isUnset = (!hasTargetAble && this.targetGesto)
|| this._isTargetChanged(true);
if (isUnset) {
unsetGesto(this, false);
this.updateState({ gestos: {} });
}
if (!hasControlAble) {
unsetGesto(this, true);
}
if (target && hasTargetAble && !this.targetGesto) {
this.targetGesto = getTargetAbleGesto(this, target!, "");
}
if (!this.controlGesto && hasControlAble) {
this.controlGesto = getControlAbleGesto(this, "Control");
}
}
protected _updateTargets() {
const props = this.props;
this._prevPropTarget = this._propTarget;
this._prevDragTarget = this._dragTarget;
this._prevOriginalDragTarget = this._originalDragTarget;
this._prevDragArea = props.dragArea!;
this._propTarget = props.target;
this._originalDragTarget = props.dragTarget || props.target;
this._dragTarget = getRefTarget(this._originalDragTarget, true);
}
private _renderLines() {
const props = this.props;
const {
zoom,
hideDefaultLines,
hideChildMoveableDefaultLines,
parentMoveable,
} = props as MoveableManagerProps;
if (hideDefaultLines || (parentMoveable && hideChildMoveableDefaultLines)) {
return [];
}
const state = this.getState();
const Renderer = {
createElement,
};
return state.renderLines.map((line, i) => {
return renderLine(Renderer, "", line[0], line[1], zoom!, `render-line-${i}`);
});
}
private _onPreventClick = (e: any) => {
e.stopPropagation();
e.preventDefault();
// removeEvent(window, "click", this._onPreventClick, true);
}
private _isTargetChanged(useDragArea?: boolean) {
const props = this.props;
const nextTarget = props.dragTarget || props.target;
const prevTarget = this._prevOriginalDragTarget;
const prevDragArea = this._prevDragArea;
const dragArea = props.dragArea;
// check target without dragArea
const isDragTargetChanged = !dragArea && prevTarget !== nextTarget;
const isDragAreaChanged = (useDragArea || dragArea) && prevDragArea !== dragArea;
return isDragTargetChanged || isDragAreaChanged || this._prevPropTarget != this._propTarget;
}
private _updateNativeEvents() {
const props = this.props;
const target = props.dragArea ? this.areaElement : this.state.target;
const events = this.events;
const eventKeys = getKeys(events);
if (this._isTargetChanged()) {
for (const eventName in events) {
const manager = events[eventName];
manager && manager.destroy();
events[eventName] = null;
}
}
if (!target) {
return;
}
const enabledAbles = this.enabledAbles;
eventKeys.forEach(eventName => {
const ables = filterAbles(enabledAbles, [eventName] as any);
const hasAbles = ables.length > 0;
let manager = events[eventName];
if (!hasAbles) {
if (manager) {
manager.destroy();
events[eventName] = null;
}
return;
}
if (!manager) {
manager = new EventManager(target, this, eventName);
events[eventName] = manager;
}
manager.setAbles(ables);
});
}
private _checkUpdateRootContainer() {
const rootContainer = this.props.rootContainer;
if (!this._rootContainer && rootContainer) {
this._rootContainer = getRefTarget(rootContainer, true);
}
}
private _checkUpdateViewContainer() {
const viewContainerOption = this.props.viewContainer;
if (!this._viewContainer && viewContainerOption) {
this._viewContainer = getRefTarget(viewContainerOption, true);
}
const viewContainer = this._viewContainer;
if (viewContainer) {
this._changeAbleViewClassNames([
...this._getAbleViewClassNames(),
this.isDragging() ? VIEW_DRAGGING : "",
]);
}
}
private _changeAbleViewClassNames(classNames: string[]) {
const viewContainer = this._viewContainer!;
const nextClassNames = groupBy(
classNames.filter(Boolean),
el => el,
).map(([className]) => className);
const prevClassNames = this._viewClassNames;
const {
removed,
added,
} = diff(prevClassNames, nextClassNames);
removed.forEach(index => {
removeClass(viewContainer, prevClassNames[index]);
});
added.forEach(index => {
addClass(viewContainer, nextClassNames[index]);
});
this._viewClassNames = nextClassNames;
}
private _getAbleViewClassNames() {
return (this.getEnabledAbles().map(able => {
return (able.viewClassName?.(this) || "");
}).join(" ") + ` ${this._getAbleClassName("-view")}`).split(/\s+/g);
}
private _getAbleClassName(classPrefix = "") {
const ables = this.getEnabledAbles();
const targetGesto = this.targetGesto;
const controlGesto = this.controlGesto;
const targetGestoData: Record = targetGesto?.isFlag()
? targetGesto.getEventData() : {};
const controlGestoData: Record = controlGesto?.isFlag()
? controlGesto.getEventData() : {};
return ables.map(able => {
const name = able.name;
let className = able.className?.(this) || "";
if (
targetGestoData[name]?.isEventStart
|| controlGestoData[name]?.isEventStart
) {
className += ` ${prefix(`${name}${classPrefix}-dragging`)}`;
}
return className.trim();
}).filter(Boolean).join(" ");
}
private _updateResizeObserver(prevProps: MoveableDefaultOptions) {
const props = this.props;
const target = props.target;
const win = getWindow(this.getControlBoxElement());
if (!win.ResizeObserver || !target || !props.useResizeObserver) {
this._reiszeObserver?.disconnect();
return;
}
if (prevProps.target === target && this._reiszeObserver) {
return;
}
const observer = new win.ResizeObserver(this.checkUpdateRect);
observer.observe(target!, {
box: "border-box",
});
this._reiszeObserver = observer;
}
private _updateMutationObserver(prevProps: MoveableDefaultOptions) {
const props = this.props;
const target = props.target;
const win = getWindow(this.getControlBoxElement());
if (!win.MutationObserver || !target || !props.useMutationObserver) {
this._mutationObserver?.disconnect();
return;
}
if (prevProps.target === target && this._mutationObserver) {
return;
}
const observer = new win.MutationObserver(records => {
for (const mutation of records) {
if (mutation.type === "attributes" && mutation.attributeName === "style") {
this.checkUpdateRect();
}
}
});
observer.observe(target!, {
attributes: true,
});
this._mutationObserver = observer;
}
}
/**
* The target to indicate Moveable Control Box.
* @name Moveable#target
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
* moveable.target = document.querySelector(".target");
*/
/**
* Zooms in the elements of a moveable.
* @name Moveable#zoom
* @default 1
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
* moveable.zoom = 2;
*/
/**
* Whether the target size is detected and updated whenever it changes.
* @name Moveable#useResizeObserver
* @default false
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
* moveable.useResizeObserver = true;
*/
/**
* Resize, Scale Events at edges
* @name Moveable#edge
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
* moveable.edge = true;
*/
/**
* You can specify the className of the moveable controlbox.
* @name Moveable#className
* @default ""
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* className: "",
* });
*
* moveable.className = "moveable1";
*/
/**
* The target(s) to drag Moveable target(s)
* @name Moveable#dragTarget
* @default target
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body);
* moveable.target = document.querySelector(".target");
* moveable.dragTarget = document.querySelector(".dragTarget");
*/
/**
* `renderStart` event occurs at the first start of all events.
* @memberof Moveable
* @event renderStart
* @param {Moveable.OnRenderStart} - Parameters for the `renderStart` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: document.querySelector(".target"),
* });
* moveable.on("renderStart", ({ target }) => {
* console.log("onRenderStart", target);
* });
*/
/**
* `render` event occurs before the target is drawn on the screen.
* @memberof Moveable
* @event render
* @param {Moveable.OnRender} - Parameters for the `render` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: document.querySelector(".target"),
* });
* moveable.on("render", ({ target }) => {
* console.log("onRender", target);
* });
*/
/**
* `renderEnd` event occurs at the end of all events.
* @memberof Moveable
* @event renderEnd
* @param {Moveable.OnRenderEnd} - Parameters for the `renderEnd` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: document.querySelector(".target"),
* });
* moveable.on("renderEnd", ({ target }) => {
* console.log("onRenderEnd", target);
* });
*/
/**
* `renderGroupStart` event occurs at the first start of all events in group.
* @memberof Moveable
* @event renderGroupStart
* @param {Moveable.OnRenderGroupStart} - Parameters for the `renderGroupStart` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* });
* moveable.on("renderGroupStart", ({ targets }) => {
* console.log("onRenderGroupStart", targets);
* });
*/
/**
* `renderGroup` event occurs before the target is drawn on the screen in group.
* @memberof Moveable
* @event renderGroup
* @param {Moveable.OnRenderGroup} - Parameters for the `renderGroup` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* });
* moveable.on("renderGroup", ({ targets }) => {
* console.log("onRenderGroup", targets);
* });
*/
/**
* `renderGroupEnd` event occurs at the end of all events in group.
* @memberof Moveable
* @event renderGroupEnd
* @param {Moveable.OnRenderGroupEnd} - Parameters for the `renderGroupEnd` event
* @example
* import Moveable from "moveable";
*
* const moveable = new Moveable(document.body, {
* target: [].slice.call(document.querySelectorAll(".target")),
* });
* moveable.on("renderGroupEnd", ({ targets }) => {
* console.log("onRenderGroupEnd", targets);
* });
*/
================================================
FILE: packages/react-moveable/src/Snappable/utils.ts
================================================
export function solveConstantsDistance(
[a, b, c]: [number, number, number],
pos: number[],
) {
return (a * pos[0] + b * pos[1] + c) / Math.sqrt(a * a + b * b);
}
export function solveC(
[a, b]: [number, number],
pos: number[],
) {
// ax + by + c = 0
// -ax -by;
return -a * pos[0] - b * pos[1];
}
================================================
FILE: packages/react-moveable/src/ables/AbleManager.ts
================================================
import { Able } from "../types";
export function makeAble<
Name extends string,
AbleObject extends Partial>,
>(name: Name, able: AbleObject) {
return {
events: [] as AbleObject["events"] extends readonly any[] ? AbleObject["events"] : readonly [],
props: [] as AbleObject["props"] extends readonly any[] ? AbleObject["props"] : readonly [],
name,
...able,
} as const;
}
================================================
FILE: packages/react-moveable/src/ables/BeforeRenderable.ts
================================================
import {
MoveableManagerInterface, BeforeRenderableProps,
OnBeforeRenderStart, OnBeforeRender, OnBeforeRenderEnd,
MoveableGroupInterface, OnBeforeRenderGroupStart,
OnBeforeRenderGroup, OnBeforeRenderGroupEnd,
} from "../types";
import { fillParams, triggerEvent } from "../utils";
import { convertMatrixtoCSS, createIdentityMatrix } from "@scena/matrix";
import { isArray, splitSpace } from "@daybrush/utils";
import { fillChildEvents } from "../groupUtils";
function isIdentityMatrix(matrix: string, is3d?: boolean) {
const n = is3d ? 4 : 3;
const identityMatrix = createIdentityMatrix(n);
const value = `matrix${is3d ? "3d" : ""}(${identityMatrix.join(",")})`;
return matrix === value || matrix === `matrix(1,0,0,1,0,0)`;
}
export default {
isPinch: true,
name: "beforeRenderable",
props: [] as const,
events: [
"beforeRenderStart",
"beforeRender",
"beforeRenderEnd",
"beforeRenderGroupStart",
"beforeRenderGroup",
"beforeRenderGroupEnd",
] as const,
dragRelation: "weak",
setTransform(moveable: MoveableManagerInterface, e: any) {
const {
is3d,
targetMatrix,
inlineTransform,
} = moveable.state;
const cssMatrix = is3d
? `matrix3d(${targetMatrix.join(",")})`
: `matrix(${convertMatrixtoCSS(targetMatrix, true)})`;
const startTransform = !inlineTransform || inlineTransform === "none" ? cssMatrix : inlineTransform;
e.datas.startTransforms = isIdentityMatrix(startTransform, is3d) ? [] : splitSpace(startTransform);
},
resetStyle(e: any) {
const datas = e.datas;
datas.nextStyle = {};
datas.nextTransforms = e.datas.startTransforms;
datas.nextTransformAppendedIndexes = [];
},
fillDragStartParams(moveable: MoveableManagerInterface