UNPKG

site

Version:

Site Engine is the world's first all-in-one engine to build a modern web site, game, or blog. No HTML or CSS knowledge required.

1 lines 3.54 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Circle=exports.Rectangle=exports.Line=exports.Svg=void 0;var e,t,s,r,i,n,a,o,u,l,h,p,m,c,v=require("./shared.manifest"),g=require("./client.ui.element"),y=(e=g)&&e.__esModule?e:{default:e},x=require("./client.ui.measure");exports.Svg=(n=Symbol(),a=Symbol(),(o=class extends y.default{constructor(){(()=>{var e=arguments;(()=>{var t;super('<svg xmlns="http://www.w3.org/2000/svg"\nclass="svg-705357537593286848 svg-pe-inherited-auto-705357537593286848"\nversion="1.1" width="100%" height="100%">'+(t=y.default.analyseArguments(e)).main[0]+"</svg>",!0,t.options),this.initProperty(t.options.viewBox,this.setViewBox,this.constructor.DEFAULT_VIEW_BOX),this.initProperty(t.options.preserveAspectRatio,this.setPreserveAspectRatio,this.constructor.DEFAULT_PRESERVE_ASPECT_RATIO)})()})()}setPointerArea(e){return(e=>(()=>(super.setPointerArea(e),"auto"===e?(()=>(this.raw.classList.remove("svg-pe-none-705357537593286848"),this.raw.classList.add("svg-pe-auto-705357537593286848")))():(()=>"none"===e?(()=>(this.raw.classList.remove("svg-pe-auto-705357537593286848"),this.raw.classList.add("svg-pe-none-705357537593286848")))():(()=>(this.raw.classList.remove("svg-pe-auto-705357537593286848"),this.raw.classList.remove("svg-pe-none-705357537593286848")))())(),this))())(e)}setViewBox(e){return(e=>(()=>((0,v.assert)("string"==typeof e),this[n]=e,this.raw.setAttribute("viewBox",e),this))())(e)}getViewBox(){return(()=>{return(()=>this[n])()})()}setPreserveAspectRatio(e){return(e=>(()=>((0,v.assert)("string"==typeof e),this[a]=e,this.raw.setAttribute("preserveAspectRatio",e),this))())(e)}getPreserveAspectRatio(){return(()=>{return(()=>this[a])()})()}}).DEFAULT_SIZE=new x.LayoutXY(1,1),o.DEFAULT_VIEW_BOX="0 0 1 1",o.DEFAULT_PRESERVE_ASPECT_RATIO="xMidYMid meet",t=o),exports.Line=(u=Symbol(),l=Symbol(),s=class extends t{constructor(){(()=>{var e=arguments;(()=>{var t,s,r;t=y.default.analyseArguments(e),[s,r]=(()=>{var e=t.main.length;return 4===e?(()=>[new x.LayoutXY(t.main[0],t.main[1]),new x.LayoutXY(t.main[2],t.main[3])])():2===e?(()=>[t.main[0],t.main[1]])():(()=>[new x.LayoutXY(0,0),new x.LayoutXY(1,1)])()})(),super('<line x1="'+s.x+'" y1="'+s.y+'" x2="'+r.x+'" y2="'+r.y+'" />',t.options),this[u]=s,this[l]=r})()})()}getStart(){return(()=>(()=>this[u])())()}getEnd(){return(()=>(()=>this[l])())()}}),exports.Rectangle=(h=Symbol(),p=Symbol(),r=class extends t{constructor(){(()=>{var e=arguments;(()=>{var t,s,r;t=y.default.analyseArguments(e),[s,r]=(()=>{var e=t.main.length;return 4===e?(()=>[new x.LayoutXY(t.main[0],t.main[1]),new x.LayoutXY(t.main[2],t.main[3])])():2===e?(()=>[t.main[0],t.main[1]])():(()=>[new x.LayoutXY(0,0),new x.LayoutXY(1,1)])()})(),super('<rect x="'+s.x+'" y="'+s.y+'" width="'+r.x+'" height="'+r.y+'" />',t.options),this[h]=s,this[p]=r})()})()}getTopLeft(){return(()=>(()=>this[h])())()}getInternalSize(){return(()=>(()=>this[p])())()}}),exports.Circle=(m=Symbol(),c=Symbol(),i=class extends t{constructor(){(()=>{var e=arguments;(()=>{var t,s,r;t=y.default.analyseArguments(e),[s,r]=(()=>{var e=t.main.length;return 3===e?(()=>[new x.LayoutXY(t.main[0],t.main[1]),x.Length.from(t.main[2])])():2===e?(()=>[t.main[0],t.main[1]])():(()=>[new x.LayoutXY(.5,.5),x.Length.from(.5)])()})(),super('<circle cx="'+s.x+'" cy="'+s.y+'" r="'+r+'" />',t.options),this[m]=s,this[c]=r})()})()}getCenter(){return(()=>(()=>this[m])())()}getRadius(){return(()=>(()=>this[c])())()}}),exports.Svg=t,exports.Line=s,exports.Rectangle=r,exports.Circle=i;