{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/submodule-canvas/1.0.0',['pandav:/npm/react/17.0.2','pandav:/com/submodule-canvas/1.0.0/UI/Box','pandav:/com/submodule-canvas/1.0.0/UI/UIElement','pandav:/com/submodule-canvas/1.0.0/BaseCanvas','pandav:/com/submodule-canvas/1.0.0/UI/Label','pandav:/com/submodule-canvas/1.0.0/UI/Layout'],function(a,b,c){function d(a,b){if(b)for(var c,d=Object.keys(b),e=0;e=b.length)){e=Object.assign({dash:[]},e),d(a,c),a.setLineDash(e.dash),a.beginPath();for(var f,g=0;g=l-1-h?i=l-1-h:h=l-1-i,e>=m-1-g?e=m-1-g:g=m-1-e);var z=h-i+1,A=g-e+1;1==z%2&&(z+=1),1==A%2&&(A+=1),a.width=a.width,f(a,z,A),k.putImageData(n,-i,-e,i,e,z,A)}},getFontSize:function(b){if(b){var c=b.split(' '),a=c[c.length-2];if(a&&(a=a.split('/')[0],a)){var d=parseInt(a);if(!isNaN(d))return d}}return 10},getCanvasFont:e,setCanvasSize:f,setBorderRadiusRectPath:function(a,b,c,d,e){var f=Math.min,g=5h&&(g=h),0>g&&(g=0);var i=[b,c],j=[b+d,c],k=[b+d,c+e],l=[b,c+e],m=[i[0],i[1]+g],n=[i[0]+g,i[1]],o=[j[0]-g,j[1]],p=[j[0],j[1]+g],q=[k[0],k[1]-g],r=[k[0]-g,k[1]],s=[l[0]+g,l[1]],t=[l[0],l[1]-g];a.beginPath(),a.moveTo(m[0],m[1]),a.arcTo(i[0],i[1],n[0],n[1],g),a.lineTo(o[0],o[1]),a.arcTo(j[0],j[1],p[0],p[1],g),a.lineTo(q[0],q[1]),a.arcTo(k[0],k[1],r[0],r[1],g),a.lineTo(s[0],s[1]),a.arcTo(l[0],l[1],t[0],t[1],g),a.closePath()},Box:i,UIElement:k,BaseCanvas:m,Label:o,Layout:q},a.exports});", "requires": [ "pandav:/UI/Box.js", "pandav:/UI/UIElement.js", "pandav:/BaseCanvas.js", "pandav:/UI/Label.js", "pandav:/UI/Layout.js" ], "buildLevel": 1, "outputDir": "/com/submodule-canvas/1.0.0", "outputPath": "/com/submodule-canvas/1.0.0/index.js", "fileName": "/index.js" }, "pandav:/AdativeCanvas.js": { "cubeCode": "Cube('pandav:/com/submodule-canvas/1.0.0/AdativeCanvas',['pandav:/com/submodule-canvas/1.0.0'],function(a,b,c){function d(a){\"@babel/helpers - typeof\";return d='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&'function'==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?'symbol':typeof a},d(a)}function e(a,b){return k(a)||j(a,b)||g(a,b)||f()}function f(){throw new TypeError('Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')}function g(a,b){if(a){if('string'==typeof a)return h(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return'Object'===c&&a.constructor&&(c=a.constructor.name),'Map'===c||'Set'===c?Array.from(a):'Arguments'===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?h(a,b):void 0}}function h(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);carguments.length?a:c):f.value}},v.apply(this,arguments)}function w(a,b){for(;!Object.prototype.hasOwnProperty.call(a,b)&&(a=x(a),null!==a););return a}function x(a){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},x(a)}function y(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&z(a,b)}function z(a,b){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},z(a,b)}var A=c('pandav:/com/submodule-canvas/1.0.0'),B=A.BaseCanvas,C=A.getTextBox,D={Rect:0,Image:1,Text:2},E={Preset:0,UI:1,Custom:2},F=function(a){function b(){var a;return l(this,b),a=q(this,b,[300,150]),a.offset=[0,0],a.boxList=[],a.cmdList=[],a.background=void 0,a.box=[0,0,0,0],a}return y(b,a),n(b,[{key:'clear',value:function a(){v(x(b.prototype),'clear',this).call(this),this.boxList=[],this.cmdList=[]}},{key:'draw',value:function a(){var c=e(this.box,2),d=c[0],f=c[1];this.background&&(this.fillStyle=this.background,this.fillRect(0,0,d,f));for(var g=this.cmdList,h=0,j=g.length;hf)&&(f=a[0]+a[2]),(null==c||a[1]d)&&(d=a[1]+a[3])}),this.box=[b,c,f-b,d-c]}},{key:'drawText',value:function d(a,b,c){var f=3=e.length)return d;var f=e.pop();if(d.fontFamily=f,f=e.pop(),d.fontSize=parseFloat(f),isNaN(d.fontSize)&&(d.fontSize=10),0>=e.length)return d;for(var g=0;ga.length)&&(b=a.length);for(var c=0,d=Array(b);carguments.length?a:c):f.value}},o.apply(this,arguments)}function p(a,b){for(;!Object.prototype.hasOwnProperty.call(a,b)&&(a=q(a),null!==a););return a}function q(a){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},q(a)}function r(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&s(a,b)}function s(a,b){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},s(a,b)}var t=c('pandav:/com/submodule-canvas/1.0.0/UI/UIElement'),u=t.UIElement,v=function(a){function b(a){var c,d=1d)a.localX=h,a.localY=j,a.height>k&&(k=a.height),h+=a.width,h>l&&(l=h),n();else{if(h+a.width>d)return n(),void b(a);a.localX=h,a.localY=j,g=!1,h+=a.width,a.height>k&&(k=a.height),h>l&&(l=h)}};for(b=0;bd)a.localX=j,a.localY=h,a.width>k&&(k=a.width),h+=a.height,h>m&&(m=h),n();else{if(h+a.height>d)return n(),void b(a);a.localX=j,a.localY=h,g=!1,h+=a.height,a.width>k&&(k=a.width),h>m&&(m=h)}};for(b=0;ba.length)&&(b=a.length);for(var c=0,d=Array(b);ci&&(i=a[2]),a[3]>j&&(j=a[3])});var k=this._box,l=k.x,m=k.y,n=k.width,o=k.height;return{x:l+g,y:m+h,width:n+i-g,height:o+j-h}}},{key:'draw',value:function d(a,b,c){this.drawBack(a,b,c);var e,f,g=this.children,h=g.length;for(e=0;ee&&(e=b.width),b.height>f&&(f=b.height);var j=this.validateSelfSize(),k=d(j,2),l=k[0],m=k[1];return l>e&&(e=l),m>f&&(f=m),[e,f]}},{key:'parent',get:function a(){return this._parent},set:function b(a){this._parent===a||(this._parent=a,a?a.add(this):this._parent.remove(this))}},{key:'anchorX',get:function a(){return this._anchorX},set:function b(a){this._anchorX===a||(this._anchorX=a)}},{key:'anchorY',get:function a(){return this._anchorY},set:function b(a){this._anchorY===a||(this._anchorY=a)}},{key:'x',get:function a(){return this._box.x},set:function b(a){this._box.x=a}},{key:'y',get:function a(){return this._box.y},set:function b(a){this._box.y=a}},{key:'localX',get:function a(){return this._box.localX},set:function b(a){this._box.localX===a||(this._box.localX=a)}},{key:'localY',get:function a(){return this._box.localY},set:function b(a){this._box.localY===a||(this._box.localY=a)}},{key:'drawBox',value:function d(a,b,c){for(var e=this.children,f=0,g=e.length;fa.length)&&(b=a.length);for(var c=0,d=Array(b);carguments.length?a:c):f.value}},v.apply(this,arguments)}function w(a,b){for(;!Object.prototype.hasOwnProperty.call(a,b)&&(a=x(a),null!==a););return a}function x(a){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function b(a){return a.__proto__||Object.getPrototypeOf(a)},x(a)}function y(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function');a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,'prototype',{writable:!1}),b&&z(a,b)}function z(a,b){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function c(a,b){return a.__proto__=b,a},z(a,b)}var A=c('pandav:/com/submodule-canvas/1.0.0'),B=A.drawText,C=A.getFontSize,D=A.getTextBox,E=c('pandav:/com/submodule-canvas/1.0.0/UI/VisualElement'),F=E.VisualElement,G=function(a){function b(a,c){var d;return l(this,b),d=q(this,b,[c]),d._textBox=[0,0,0,0],d._lineHeight=0,d._text='',d.useFontHeight=!1,d.align='left',d.baseLine='top',d._text=a,d}return y(b,a),n(b,[{key:'text',get:function a(){return this._text},set:function b(a){this._text=a,this.validateDir=!0}},{key:'validate',value:function a(){this.updateTextBox(),v(x(b.prototype),'validate',this).call(this)}},{key:'updateTextBox',value:function a(){var b=D(this._text,this._setting,'left','top');this._lineHeight=b.lineHeight,this._textBox=b.box}},{key:'validateSelfSize',value:function a(){return this.useFontHeight?[this._textBox[2],this._lineHeight]:[this._textBox[2],this._textBox[3]]}},{key:'drawSelf',value:function d(a,b,c){var f=e(this._textBox,4),g=f[0],h=f[1],i=f[2],j=f[3],k=0;switch(this.align){default:k=this.contentBox.x;break;case'center':k=this.contentBox.x+this.contentBox.width/2-i/2;break;case'right':k=this.contentBox.x+this.contentBox.width-i}var l=0;switch(this.baseLine){default:l=this.contentBox.y;break;case'middle':l=this.contentBox.y+this.contentBox.height/2-j/2;break;case'bottom':l=this.contentBox.y+this.contentBox.height-j}var m=k-g+b,n=l-h+c;a.textAlign='left',a.textBaseline='top',B(a,this._text,m,n,this._setting)}}],[{key:'measureContext',get:function a(){if(!b._measureContext){var c=document.createElement('canvas');b._measureContext=c.getContext('2d')}return b._measureContext}}]),b}(F);return a.exports={Label:G},a.exports});", "requires": [ "pandav:/index.js", "pandav:/UI/VisualElement.js" ], "buildLevel": 5, "outputDir": "/com/submodule-canvas/1.0.0/UI", "outputPath": "/com/submodule-canvas/1.0.0/UI/Label.js", "fileName": "/UI/Label.js" } }