diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index eeec4ddc..c537428e 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 51.1%Statements 51.1%Branches 40.83%Branches 40.83%Lines 51.81%Lines 51.81%Functions 58.62%Functions 58.62% +Statements 52.79%Statements 52.79%Branches 41.6%Branches 41.6%Lines 53.61%Lines 53.61%Functions 60.18%Functions 60.18% diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index e86c99c6..3636cb70 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -221,6 +221,7 @@ exports[`use various parts of svg-edit > check tool_italic #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="matrix(1 0 0 1 0 0)" > B @@ -285,6 +286,7 @@ exports[`use various parts of svg-edit > check tool_bold #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="matrix(1 0 0 1 0 0)" > B @@ -349,6 +351,7 @@ exports[`use various parts of svg-edit > check change color #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="matrix(1 0 0 1 0 0)" > B @@ -414,6 +417,7 @@ exports[`use various parts of svg-edit > check tool_start #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" + transform="matrix(1 0 0 1 0 0)" > B @@ -445,3 +449,203 @@ exports[`use various parts of svg-edit > check tool_start #0`] = ` `; + +exports[`use various parts of svg-edit > check tool_star #0`] = ` + + + Layer 1 + + + B + + + B + + + + + + +`; + +exports[`use various parts of svg-edit > check tool_polygon #0`] = ` + + + Layer 1 + + + B + + + B + + + + + + + +`; diff --git a/dist/editor/index.js b/dist/editor/index.js index 821554a4..b83468d4 100644 --- a/dist/editor/index.js +++ b/dist/editor/index.js @@ -1,5 +1,5 @@ -var Tn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(Tn,Un,Qn){return Tn(Qn={path:Un,exports:{},require:function(Tn,Un){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==Un&&Qn.path)}},Qn.exports),Qn.exports}var check=function(Tn){return Tn&&Tn.Math==Math&&Tn},Un=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof Tn&&Tn)||function(){return this}()||Function("return this")(),fails=function(Tn){try{return!!Tn()}catch(Tn){return!0}},Qn=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Dn={}.propertyIsEnumerable,Hn=Object.getOwnPropertyDescriptor,Gn={f:Hn&&!Dn.call({1:2},1)?function propertyIsEnumerable(Tn){var Un=Hn(this,Tn);return!!Un&&Un.enumerable}:Dn},createPropertyDescriptor=function(Tn,Un){return{enumerable:!(1&Tn),configurable:!(2&Tn),writable:!(4&Tn),value:Un}},Vn={}.toString,classofRaw=function(Tn){return Vn.call(Tn).slice(8,-1)},zn="".split,Kn=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(Tn){return"String"==classofRaw(Tn)?zn.call(Tn,""):Object(Tn)}:Object,requireObjectCoercible=function(Tn){if(null==Tn)throw TypeError("Can't call method on "+Tn);return Tn},toIndexedObject=function(Tn){return Kn(requireObjectCoercible(Tn))},isObject=function(Tn){return"object"==typeof Tn?null!==Tn:"function"==typeof Tn},toPrimitive=function(Tn,Un){if(!isObject(Tn))return Tn;var Qn,Dn;if(Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;if("function"==typeof(Qn=Tn.valueOf)&&!isObject(Dn=Qn.call(Tn)))return Dn;if(!Un&&"function"==typeof(Qn=Tn.toString)&&!isObject(Dn=Qn.call(Tn)))return Dn;throw TypeError("Can't convert object to primitive value")},Xn={}.hasOwnProperty,has=function(Tn,Un){return Xn.call(Tn,Un)},Wn=Un.document,Yn=isObject(Wn)&&isObject(Wn.createElement),documentCreateElement=function(Tn){return Yn?Wn.createElement(Tn):{}},Jn=!Qn&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),$n=Object.getOwnPropertyDescriptor,Zn={f:Qn?$n:function getOwnPropertyDescriptor(Tn,Un){if(Tn=toIndexedObject(Tn),Un=toPrimitive(Un,!0),Jn)try{return $n(Tn,Un)}catch(Tn){}if(has(Tn,Un))return createPropertyDescriptor(!Gn.f.call(Tn,Un),Tn[Un])}},anObject=function(Tn){if(!isObject(Tn))throw TypeError(String(Tn)+" is not an object");return Tn},er=Object.defineProperty,tr={f:Qn?er:function defineProperty(Tn,Un,Qn){if(anObject(Tn),Un=toPrimitive(Un,!0),anObject(Qn),Jn)try{return er(Tn,Un,Qn)}catch(Tn){}if("get"in Qn||"set"in Qn)throw TypeError("Accessors not supported");return"value"in Qn&&(Tn[Un]=Qn.value),Tn}},nr=Qn?function(Tn,Un,Qn){return tr.f(Tn,Un,createPropertyDescriptor(1,Qn))}:function(Tn,Un,Qn){return Tn[Un]=Qn,Tn},setGlobal=function(Tn,Qn){try{nr(Un,Tn,Qn)}catch(Dn){Un[Tn]=Qn}return Qn},rr=Un["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),ir=Function.toString;"function"!=typeof rr.inspectSource&&(rr.inspectSource=function(Tn){return ir.call(Tn)});var or,ar,sr,lr=rr.inspectSource,cr=Un.WeakMap,ur="function"==typeof cr&&/native code/.test(lr(cr)),dr=createCommonjsModule((function(Tn){(Tn.exports=function(Tn,Un){return rr[Tn]||(rr[Tn]=void 0!==Un?Un:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),hr=0,pr=Math.random(),uid=function(Tn){return"Symbol("+String(void 0===Tn?"":Tn)+")_"+(++hr+pr).toString(36)},Ar=dr("keys"),sharedKey=function(Tn){return Ar[Tn]||(Ar[Tn]=uid(Tn))},gr={},fr=Un.WeakMap;if(ur){var mr=rr.state||(rr.state=new fr),vr=mr.get,_r=mr.has,yr=mr.set;or=function(Tn,Un){return Un.facade=Tn,yr.call(mr,Tn,Un),Un},ar=function(Tn){return vr.call(mr,Tn)||{}},sr=function(Tn){return _r.call(mr,Tn)}}else{var br=sharedKey("state");gr[br]=!0,or=function(Tn,Un){return Un.facade=Tn,nr(Tn,br,Un),Un},ar=function(Tn){return has(Tn,br)?Tn[br]:{}},sr=function(Tn){return has(Tn,br)}}var wr,Sr,xr={set:or,get:ar,has:sr,enforce:function(Tn){return sr(Tn)?ar(Tn):or(Tn,{})},getterFor:function(Tn){return function(Un){var Qn;if(!isObject(Un)||(Qn=ar(Un)).type!==Tn)throw TypeError("Incompatible receiver, "+Tn+" required");return Qn}}},Cr=createCommonjsModule((function(Tn){var Qn=xr.get,Dn=xr.enforce,Hn=String(String).split("String");(Tn.exports=function(Tn,Qn,Gn,Vn){var zn,Kn=!!Vn&&!!Vn.unsafe,Xn=!!Vn&&!!Vn.enumerable,Wn=!!Vn&&!!Vn.noTargetGet;"function"==typeof Gn&&("string"!=typeof Qn||has(Gn,"name")||nr(Gn,"name",Qn),(zn=Dn(Gn)).source||(zn.source=Hn.join("string"==typeof Qn?Qn:""))),Tn!==Un?(Kn?!Wn&&Tn[Qn]&&(Xn=!0):delete Tn[Qn],Xn?Tn[Qn]=Gn:nr(Tn,Qn,Gn)):Xn?Tn[Qn]=Gn:setGlobal(Qn,Gn)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&Qn(this).source||lr(this)}))})),kr=Un,aFunction=function(Tn){return"function"==typeof Tn?Tn:void 0},getBuiltIn=function(Tn,Qn){return arguments.length<2?aFunction(kr[Tn])||aFunction(Un[Tn]):kr[Tn]&&kr[Tn][Qn]||Un[Tn]&&Un[Tn][Qn]},Br=Math.ceil,Er=Math.floor,toInteger=function(Tn){return isNaN(Tn=+Tn)?0:(Tn>0?Er:Br)(Tn)},Nr=Math.min,toLength=function(Tn){return Tn>0?Nr(toInteger(Tn),9007199254740991):0},Lr=Math.max,Tr=Math.min,toAbsoluteIndex=function(Tn,Un){var Qn=toInteger(Tn);return Qn<0?Lr(Qn+Un,0):Tr(Qn,Un)},createMethod=function(Tn){return function(Un,Qn,Dn){var Hn,Gn=toIndexedObject(Un),Vn=toLength(Gn.length),zn=toAbsoluteIndex(Dn,Vn);if(Tn&&Qn!=Qn){for(;Vn>zn;)if((Hn=Gn[zn++])!=Hn)return!0}else for(;Vn>zn;zn++)if((Tn||zn in Gn)&&Gn[zn]===Qn)return Tn||zn||0;return!Tn&&-1}},Pr={includes:createMethod(!0),indexOf:createMethod(!1)},Fr=Pr.indexOf,objectKeysInternal=function(Tn,Un){var Qn,Dn=toIndexedObject(Tn),Hn=0,Gn=[];for(Qn in Dn)!has(gr,Qn)&&has(Dn,Qn)&&Gn.push(Qn);for(;Un.length>Hn;)has(Dn,Qn=Un[Hn++])&&(~Fr(Gn,Qn)||Gn.push(Qn));return Gn},Ur=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ir=Ur.concat("length","prototype"),Rr={f:Object.getOwnPropertyNames||function getOwnPropertyNames(Tn){return objectKeysInternal(Tn,Ir)}},Mr={f:Object.getOwnPropertySymbols},Or=getBuiltIn("Reflect","ownKeys")||function ownKeys(Tn){var Un=Rr.f(anObject(Tn)),Qn=Mr.f;return Qn?Un.concat(Qn(Tn)):Un},copyConstructorProperties=function(Tn,Un){for(var Qn=Or(Un),Dn=tr.f,Hn=Zn.f,Gn=0;Gn=74)&&(wr=Zr.match(/Chrome\/(\d+)/))&&(Sr=wr[1]);var ri=Sr&&+Sr,ii=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(Tn){return ri>=51||!fails((function(){var Un=[];return(Un.constructor={})[ii]=function(){return{foo:1}},1!==Un[Tn](Boolean).foo}))},oi=wellKnownSymbol("isConcatSpreadable"),ai=ri>=51||!fails((function(){var Tn=[];return Tn[oi]=!1,Tn.concat()[0]!==Tn})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(Tn){if(!isObject(Tn))return!1;var Un=Tn[oi];return void 0!==Un?!!Un:Kr(Tn)};_export({target:"Array",proto:!0,forced:!ai||!si},{concat:function concat(Tn){var Un,Qn,Dn,Hn,Gn,Vn=toObject(this),zn=arraySpeciesCreate(Vn,0),Kn=0;for(Un=-1,Dn=arguments.length;Un9007199254740991)throw TypeError("Maximum allowed index exceeded");for(Qn=0;Qn=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(zn,Kn++,Gn)}return zn.length=Kn,zn}});var aFunction$1=function(Tn){if("function"!=typeof Tn)throw TypeError(String(Tn)+" is not a function");return Tn},functionBindContext=function(Tn,Un,Qn){if(aFunction$1(Tn),void 0===Un)return Tn;switch(Qn){case 0:return function(){return Tn.call(Un)};case 1:return function(Qn){return Tn.call(Un,Qn)};case 2:return function(Qn,Dn){return Tn.call(Un,Qn,Dn)};case 3:return function(Qn,Dn,Hn){return Tn.call(Un,Qn,Dn,Hn)}}return function(){return Tn.apply(Un,arguments)}},li=[].push,createMethod$1=function(Tn){var Un=1==Tn,Qn=2==Tn,Dn=3==Tn,Hn=4==Tn,Gn=6==Tn,Vn=5==Tn||Gn;return function(zn,Xn,Wn,Yn){for(var Jn,$n,Zn=toObject(zn),er=Kn(Zn),tr=functionBindContext(Xn,Wn,3),nr=toLength(er.length),rr=0,ir=Yn||arraySpeciesCreate,or=Un?ir(zn,nr):Qn?ir(zn,0):void 0;nr>rr;rr++)if((Vn||rr in er)&&($n=tr(Jn=er[rr],rr,Zn),Tn))if(Un)or[rr]=$n;else if($n)switch(Tn){case 3:return!0;case 5:return Jn;case 6:return rr;case 2:li.call(or,Jn)}else if(Hn)return!1;return Gn?-1:Dn||Hn?Hn:or}},ui={forEach:createMethod$1(0),map:createMethod$1(1),filter:createMethod$1(2),some:createMethod$1(3),every:createMethod$1(4),find:createMethod$1(5),findIndex:createMethod$1(6)},di=Object.defineProperty,hi={},thrower=function(Tn){throw Tn},arrayMethodUsesToLength=function(Tn,Un){if(has(hi,Tn))return hi[Tn];Un||(Un={});var Dn=[][Tn],Hn=!!has(Un,"ACCESSORS")&&Un.ACCESSORS,Gn=has(Un,0)?Un[0]:thrower,Vn=has(Un,1)?Un[1]:void 0;return hi[Tn]=!!Dn&&!fails((function(){if(Hn&&!Qn)return!0;var Tn={length:-1};Hn?di(Tn,1,{enumerable:!0,get:thrower}):Tn[1]=1,Dn.call(Tn,Gn,Vn)}))},pi=ui.filter,Ai=arrayMethodHasSpeciesSupport("filter"),gi=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!Ai||!gi},{filter:function filter(Tn){return pi(this,Tn,arguments.length>1?arguments[1]:void 0)}});var fi,mi=Object.keys||function keys(Tn){return objectKeysInternal(Tn,Ur)},vi=Qn?Object.defineProperties:function defineProperties(Tn,Un){anObject(Tn);for(var Qn,Dn=mi(Un),Hn=Dn.length,Gn=0;Hn>Gn;)tr.f(Tn,Qn=Dn[Gn++],Un[Qn]);return Tn},_i=getBuiltIn("document","documentElement"),yi=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(Tn){return"