diff --git a/README.md b/README.md index 947d1650..fa6b919d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ We also build a systemJS version at [`master`](https://svg-edit.github.io/svgedi You may also obtain URLs for specific [releases](https://github.com/SVG-Edit/svgedit/releases). +Thanks to netlify, you can test the following versions: + +latest master build (V6): https://svgedit.netlify.app/editor/index.html + +V7 preview (under development): https://deploy-preview-465--svgedit.netlify.app/editor/index.html + ## Installation ### Quick install diff --git a/dist/editor/extensions/ext-arrows/ext-arrows.js b/dist/editor/extensions/ext-arrows/ext-arrows.js index 61fe1646..d294ee6c 100644 --- a/dist/editor/extensions/ext-arrows/ext-arrows.js +++ b/dist/editor/extensions/ext-arrows/ext-arrows.js @@ -1,4 +1,4 @@ -var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports}var check=function(t){return t&&t.Math==Math&&t},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(t){var e=o(this,t);return!!e&&e.enumerable}:n},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},a={}.toString,classofRaw=function(t){return a.call(t).slice(8,-1)},c="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?c.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},f={}.hasOwnProperty,has=function(t,e){return f.call(t,e)},l=e.document,s=isObject(l)&&isObject(l.createElement),documentCreateElement=function(t){return s?l.createElement(t):{}},p=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),h=Object.getOwnPropertyDescriptor,d={f:r?h:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),p)try{return h(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!i.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},v=Object.defineProperty,y={f:r?v:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),p)try{return v(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},g=r?function(t,e,r){return y.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,r){try{g(e,t,r)}catch(n){e[t]=r}return r},m=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof m.inspectSource&&(m.inspectSource=function(t){return b.call(t)});var w,S,x,E=m.inspectSource,_=e.WeakMap,O="function"==typeof _&&/native code/.test(E(_)),j=createCommonjsModule((function(t){(t.exports=function(t,e){return m[t]||(m[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),k=0,A=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++k+A).toString(36)},P=j("keys"),sharedKey=function(t){return P[t]||(P[t]=uid(t))},T={},I=e.WeakMap;if(O){var L=m.state||(m.state=new I),R=L.get,C=L.has,M=L.set;w=function(t,e){return e.facade=t,M.call(L,t,e),e},S=function(t){return R.call(L,t)||{}},x=function(t){return C.call(L,t)}}else{var N=sharedKey("state");T[N]=!0,w=function(t,e){return e.facade=t,g(t,N,e),e},S=function(t){return has(t,N)?t[N]:{}},x=function(t){return has(t,N)}}var G,D,U={set:w,get:S,has:x,enforce:function(t){return x(t)?S(t):w(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=S(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},z=createCommonjsModule((function(t){var r=U.get,n=U.enforce,o=String(String).split("String");(t.exports=function(t,r,i,a){var c,u=!!a&&!!a.unsafe,f=!!a&&!!a.enumerable,l=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof r||has(i,"name")||g(i,"name",r),(c=n(i)).source||(c.source=o.join("string"==typeof r?r:""))),t!==e?(u?!l&&t[r]&&(f=!0):delete t[r],f?t[r]=i:g(t,r,i)):f?t[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||E(this)}))})),W=e,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,r){return arguments.length<2?aFunction(W[t])||aFunction(e[t]):W[t]&&W[t][r]||e[t]&&e[t][r]},$=Math.ceil,B=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?B:$)(t)},V=Math.min,toLength=function(t){return t>0?V(toInteger(t),9007199254740991):0},Y=Math.max,H=Math.min,toAbsoluteIndex=function(t,e){var r=toInteger(t);return r<0?Y(r+e,0):H(r,e)},createMethod=function(t){return function(e,r,n){var o,i=toIndexedObject(e),a=toLength(i.length),c=toAbsoluteIndex(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},K={includes:createMethod(!0),indexOf:createMethod(!1)},q=K.indexOf,objectKeysInternal=function(t,e){var r,n=toIndexedObject(t),o=0,i=[];for(r in n)!has(T,r)&&has(n,r)&&i.push(r);for(;e.length>o;)has(n,r=e[o++])&&(~q(i,r)||i.push(r));return i},J=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],X=J.concat("length","prototype"),Q={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,X)}},Z={f:Object.getOwnPropertySymbols},tt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=Q.f(anObject(t)),r=Z.f;return r?e.concat(r(t)):e},copyConstructorProperties=function(t,e){for(var r=tt(e),n=y.f,o=d.f,i=0;i=74)&&(G=vt.match(/Chrome\/(\d+)/))&&(D=G[1]);var bt=D&&+D,wt=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return bt>=51||!fails((function(){var e=[];return(e.constructor={})[wt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},St=wellKnownSymbol("isConcatSpreadable"),xt=bt>=51||!fails((function(){var t=[];return t[St]=!1,t.concat()[0]!==t})),Et=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[St];return void 0!==e?!!e:ut(t)};_export({target:"Array",proto:!0,forced:!xt||!Et},{concat:function concat(t){var e,r,n,o,i,a=toObject(this),c=arraySpeciesCreate(a,0),u=0;for(e=-1,n=arguments.length;e9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(c,u++,i)}return c.length=u,c}});var _t,Ot=Object.keys||function keys(t){return objectKeysInternal(t,J)},jt=r?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var r,n=Ot(e),o=n.length,i=0;o>i;)y.f(t,r=n[i++],e[r]);return t},kt=getBuiltIn("document","documentElement"),At=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"`, */\n // mathjaxSrc = 'http://cdn.mathjax.org/mathjax/latest/MathJax.js',\n // Had been on https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG.js\n // Obtained Text-AMS-MML_SVG.js from https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.3/config/TeX-AMS-MML_SVG.js\n {uiStrings} = svgEditor;\n let\n math,\n locationX,\n locationY,\n mathjaxLoaded = false;\n\n // TODO: Implement language support. Move these uiStrings to the locale files and\n // the code to the langReady callback. Also i18nize alert and HTML below\n $.extend(uiStrings, {\n mathjax: {\n embed_svg: 'Save as mathematics',\n embed_mathml: 'Save as figure',\n svg_save_warning: 'The math will be transformed into a figure is ' +\n 'manipulatable like everything else. You will not be able to ' +\n 'manipulate the TeX-code anymore.',\n mathml_save_warning: 'Advised. The math will be saved as a figure.',\n title: 'Mathematics code editor'\n }\n });\n\n /**\n *\n * @returns {void}\n */\n function saveMath () {\n const code = $('#mathjax_code_textarea').val();\n // displaystyle to force MathJax NOT to use the inline style. Because it is\n // less fancy!\n MathJax.Hub.queue.Push(['Text', math, '\\\\displaystyle{' + code + '}']);\n\n /*\n * The MathJax library doesn't want to bloat your webpage so it creates\n * every symbol (glymph) you need only once. These are saved in a `` on\n * the top of your html document, just under the body tag. Each glymph has\n * its unique id and is saved as a `` in the `` tag of the ``\n *\n * Then when the symbols are needed in the rest of your html document they\n * are refferd to by a `` tag.\n * Because of bug 1076 we can't just grab the defs tag on the top and add it\n * to your formula's `` and copy the lot. So we have to replace each\n * `` tag by its ``.\n */\n MathJax.Hub.queue.Push(\n function () {\n const mathjaxMath = $('.MathJax_SVG');\n const svg = $(mathjaxMath.html());\n svg.find('use').each(function () {\n // TODO: find a less pragmatic and more elegant solution to this.\n const id = $(this).attr('href')\n ? $(this).attr('href').slice(1) // Works in Chrome.\n : $(this).attr('xlink:href').slice(1); // Works in Firefox.\n const glymph = $('#' + id).clone().removeAttr('id');\n const x = $(this).attr('x');\n const y = $(this).attr('y');\n const transform = $(this).attr('transform');\n if (transform && (x || y)) {\n glymph.attr('transform', transform + ' translate(' + x + ',' + y + ')');\n } else if (transform) {\n glymph.attr('transform', transform);\n } else if (x || y) {\n glymph.attr('transform', 'translate(' + x + ',' + y + ')');\n }\n $(this).replaceWith(glymph);\n });\n // Remove the style tag because it interferes with SVG-Edit.\n svg.removeAttr('style');\n svg.attr('xmlns', 'http://www.w3.org/2000/svg');\n svgCanvas.importSvgString($('
').append(svg.clone()).html(), true);\n svgCanvas.ungroupSelectedElement();\n // TODO: To undo the adding of the Formula you now have to undo twice.\n // This should only be once!\n svgCanvas.moveSelectedElements(locationX, locationY, true);\n }\n );\n }\n\n const buttons = [{\n id: 'tool_mathjax',\n type: 'mode',\n icon: 'mathjax.png',\n events: {\n async click () {\n // Set the mode.\n svgCanvas.setMode('mathjax');\n\n // Only load Mathjax when needed, we don't want to strain Svg-Edit any more.\n // From this point on it is very probable that it will be needed, so load it.\n if (mathjaxLoaded === false) {\n $(\n '
' +\n '' +\n '
' +\n '$${}$$' +\n '
' +\n '
' +\n '
' +\n '
' +\n '' +\n '' +\n '
' +\n '
' +\n 'Mathematics Editor' +\n '' +\n '' +\n '
' +\n '
' +\n '
'\n ).insertAfter('#svg_prefs').hide();\n\n // Make the MathEditor draggable.\n $('#mathjax_container').draggable({\n cancel: 'button,fieldset',\n containment: 'window'\n });\n\n // Add functionality and picture to cancel button.\n $('#tool_mathjax_cancel').prepend($.getSvgIcon('cancel', true))\n .on('click touched', function () {\n $('#mathjax').hide();\n });\n\n // Add functionality and picture to the save button.\n $('#tool_mathjax_save').prepend($.getSvgIcon('ok', true))\n .on('click touched', function () {\n saveMath();\n $('#mathjax').hide();\n });\n\n // MathJax preprocessing has to ignore most of the page.\n $('body').addClass('tex2jax_ignore');\n\n try {\n await import('./mathjax/MathJax.min.js'); // ?config=TeX-AMS-MML_SVG.js');\n // When MathJax is loaded get the div where the math will be rendered.\n MathJax.Hub.queue.Push(function () {\n math = MathJax.Hub.getAllJax('#mathjax_creator')[0];\n console.log(math); // eslint-disable-line no-console\n mathjaxLoaded = true;\n console.log('MathJax Loaded'); // eslint-disable-line no-console\n });\n } catch (e) {\n console.log('Failed loading MathJax.'); // eslint-disable-line no-console\n // eslint-disable-next-line no-alert\n alert('Failed loading MathJax. You will not be able to change the mathematics.');\n }\n }\n }\n }\n }];\n\n return {\n name: strings.name,\n svgicons: 'mathjax-icons.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n\n mouseDown () {\n if (svgCanvas.getMode() === 'mathjax') {\n return {started: true};\n }\n return undefined;\n },\n mouseUp (opts) {\n if (svgCanvas.getMode() === 'mathjax') {\n // Get the coordinates from your mouse.\n const zoom = svgCanvas.getZoom();\n // Get the actual coordinate by dividing by the zoom value\n locationX = opts.mouse_x / zoom;\n locationY = opts.mouse_y / zoom;\n\n $('#mathjax').show();\n return {started: false}; // Otherwise the last selected object dissapears.\n }\n return undefined;\n },\n callback () {\n $('').appendTo("head")),e.text(t?" #tool_topath { display: none !important; }":""),o("#polygon_panel").toggle(t)},n=(r=e).svgCanvas,o=t.$,!1,v.next=9,Yn(r.configObj.pref("lang"));case 9:return i=v.sent,h={id:"tool_polygon",click:function click(){n.setMode("polygon"),f(!0)}},y=[{type:"input",panel:"polygon_panel",id:"polySides",size:3,defval:5,events:{change:function change(){s("sides",this.value)}}}],v.abrupt("return",{name:i.name,events:h,context_tools:i.contextTools.map((function(t,e){return Object.assign(y[e],t)})),callback:function callback(){o("#polygon_panel").hide(),setTimeout((function(){o("#tool_source_save").clone().hide().attr("id","polygon_save").unbind().appendTo("#tool_source_back").click((function(){})),o("#tool_source_cancel").clone().hide().attr("id","polygon_cancel").unbind().appendTo("#tool_source_back").click((function(){}))}),3e3)},mouseDown:function mouseDown(t){if("polygon"===n.getMode()){var e=n.getColor("fill"),r=n.getColor("stroke"),o=n.getStrokeWidth();return c=!0,u=n.addSVGElementFromJson({element:"polygon",attr:{cx:t.start_x,cy:t.start_y,id:n.getNextId(),shape:"regularPoly",sides:document.getElementById("polySides").value,orient:"x",edge:0,fill:e,strokecolor:r,strokeWidth:o}}),{started:!0}}},mouseMove:function mouseMove(t){if(c&&"polygon"===n.getMode()){var e=o(u).attr(["cx","cy","sides","orient","fill","strokecolor","strokeWidth"]),r=t.mouse_x,i=t.mouse_y,a=e.cx,f=e.cy,s=e.fill,h=e.strokecolor,y=e.strokeWidth,v=e.sides,d=Math.sqrt((r-a)*(r-a)+(i-f)*(i-f))/1.5;u.setAttribute("edge",d);for(var g=d/2*l(Math.PI/v)*p(Math.PI/v),m="",b=0;v>=b;b++){var w=2*Math.PI*b/v;m+=(r=g*Math.cos(w)+a)+","+(i=g*Math.sin(w)+f)+" "}return u.setAttribute("points",m),u.setAttribute("fill",s),u.setAttribute("stroke",h),u.setAttribute("stroke-width",y),{started:!0}}},mouseUp:function mouseUp(t){if("polygon"===n.getMode())return{keep:"0"!==o(u).attr("edge").edge,element:u}},selectedChanged:function selectedChanged(t){for(var e=(a=t.elems).length;e--;){var r=a[e];r&&"regularPoly"===r.getAttribute("shape")&&t.selectedElement&&!t.multiselected?(o("#polySides").val(r.getAttribute("sides")),f(!0)):f(!1)}},elementChanged:function elementChanged(t){}});case 13:case"end":return v.stop()}}),_callee2)})))()}},Jn=Object.freeze({__proto__:null,default:{name:"polygon",buttons:[{title:"Polygon Tool"}],contextTools:[{title:"Number of Sides",label:"sides"}]}}),$n=Object.freeze({__proto__:null,default:{name:"多边形",buttons:[{title:"多边形工具"}],contextTools:[{title:"边数",label:"边数"}]}});export default Hn; +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports}var check=function(t){return t&&t.Math==Math&&t},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(t){var e=o(this,t);return!!e&&e.enumerable}:n},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},a={}.toString,classofRaw=function(t){return a.call(t).slice(8,-1)},c="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?c.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},f={}.hasOwnProperty,has=function(t,e){return f.call(t,e)},s=e.document,l=isObject(s)&&isObject(s.createElement),documentCreateElement=function(t){return l?s.createElement(t):{}},p=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),h=Object.getOwnPropertyDescriptor,y={f:r?h:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),p)try{return h(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!i.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},v=Object.defineProperty,d={f:r?v:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),p)try{return v(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},g=r?function(t,e,r){return d.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,r){try{g(e,t,r)}catch(n){e[t]=r}return r},m=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof m.inspectSource&&(m.inspectSource=function(t){return b.call(t)});var w,S,O,j=m.inspectSource,_=e.WeakMap,x="function"==typeof _&&/native code/.test(j(_)),E=createCommonjsModule((function(t){(t.exports=function(t,e){return m[t]||(m[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),P=0,T=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++P+T).toString(36)},k=E("keys"),sharedKey=function(t){return k[t]||(k[t]=uid(t))},A={},I=e.WeakMap;if(x){var L=m.state||(m.state=new I),M=L.get,C=L.has,G=L.set;w=function(t,e){return e.facade=t,G.call(L,t,e),e},S=function(t){return M.call(L,t)||{}},O=function(t){return C.call(L,t)}}else{var R=sharedKey("state");A[R]=!0,w=function(t,e){return e.facade=t,g(t,R,e),e},S=function(t){return has(t,R)?t[R]:{}},O=function(t){return has(t,R)}}var N,D={set:w,get:S,has:O,enforce:function(t){return O(t)?S(t):w(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=S(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},W=createCommonjsModule((function(t){var r=D.get,n=D.enforce,o=String(String).split("String");(t.exports=function(t,r,i,a){var c,u=!!a&&!!a.unsafe,f=!!a&&!!a.enumerable,s=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof r||has(i,"name")||g(i,"name",r),(c=n(i)).source||(c.source=o.join("string"==typeof r?r:""))),t!==e?(u?!s&&t[r]&&(f=!0):delete t[r],f?t[r]=i:g(t,r,i)):f?t[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||j(this)}))})),z=e,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,r){return arguments.length<2?aFunction(z[t])||aFunction(e[t]):z[t]&&z[t][r]||e[t]&&e[t][r]},U=Math.ceil,V=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?V:U)(t)},q=Math.min,toLength=function(t){return t>0?q(toInteger(t),9007199254740991):0},B=Math.max,Y=Math.min,toAbsoluteIndex=function(t,e){var r=toInteger(t);return r<0?B(r+e,0):Y(r,e)},createMethod=function(t){return function(e,r,n){var o,i=toIndexedObject(e),a=toLength(i.length),c=toAbsoluteIndex(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},H={includes:createMethod(!0),indexOf:createMethod(!1)}.indexOf,objectKeysInternal=function(t,e){var r,n=toIndexedObject(t),o=0,i=[];for(r in n)!has(A,r)&&has(n,r)&&i.push(r);for(;e.length>o;)has(n,r=e[o++])&&(~H(i,r)||i.push(r));return i},J=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$=J.concat("length","prototype"),K={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,$)}},Q={f:Object.getOwnPropertySymbols},X=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=K.f(anObject(t)),r=Q.f;return r?e.concat(r(t)):e},copyConstructorProperties=function(t,e){for(var r=X(e),n=d.f,o=y.f,i=0;ii;)d.f(t,r=n[i++],e[r]);return t},ht=getBuiltIn("document","documentElement"),yt=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return" + SVG-edit diff --git a/dist/editor/system/extensions/ext-arrows/ext-arrows.js b/dist/editor/system/extensions/ext-arrows/ext-arrows.js index 1618b767..d7577768 100644 --- a/dist/editor/system/extensions/ext-arrows/ext-arrows.js +++ b/dist/editor/system/extensions/ext-arrows/ext-arrows.js @@ -1,4 +1,4 @@ -System.register([],(function(t){"use strict";return{execute:function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports}var check=function(t){return t&&t.Math==Math&&t},r=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof e&&e)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},n=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a={f:i&&!o.call({1:2},1)?function propertyIsEnumerable(t){var e=i(this,t);return!!e&&e.enumerable}:o},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},c={}.toString,classofRaw=function(t){return c.call(t).slice(8,-1)},u="".split,f=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?u.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return f(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},l={}.hasOwnProperty,has=function(t,e){return l.call(t,e)},s=r.document,p=isObject(s)&&isObject(s.createElement),documentCreateElement=function(t){return p?s.createElement(t):{}},h=!n&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),d=Object.getOwnPropertyDescriptor,v={f:n?d:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),h)try{return d(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!a.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},y=Object.defineProperty,g={f:n?y:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),h)try{return y(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},m=n?function(t,e,r){return g.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,e){try{m(r,t,e)}catch(n){r[t]=e}return e},b="__core-js_shared__",w=r[b]||setGlobal(b,{}),S=Function.toString;"function"!=typeof w.inspectSource&&(w.inspectSource=function(t){return S.call(t)});var x,E,O,_=w.inspectSource,j=r.WeakMap,k="function"==typeof j&&/native code/.test(_(j)),P=createCommonjsModule((function(t){(t.exports=function(t,e){return w[t]||(w[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),A=0,T=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++A+T).toString(36)},I=P("keys"),sharedKey=function(t){return I[t]||(I[t]=uid(t))},L={},R=r.WeakMap;if(k){var C=w.state||(w.state=new R),M=C.get,N=C.has,G=C.set;x=function(t,e){return e.facade=t,G.call(C,t,e),e},E=function(t){return M.call(C,t)||{}},O=function(t){return N.call(C,t)}}else{var D=sharedKey("state");L[D]=!0,x=function(t,e){return e.facade=t,m(t,D,e),e},E=function(t){return has(t,D)?t[D]:{}},O=function(t){return has(t,D)}}var U,z,W={set:x,get:E,has:O,enforce:function(t){return O(t)?E(t):x(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=E(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},$=createCommonjsModule((function(t){var e=W.get,n=W.enforce,o=String(String).split("String");(t.exports=function(t,e,i,a){var c,u=!!a&&!!a.unsafe,f=!!a&&!!a.enumerable,l=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||has(i,"name")||m(i,"name",e),(c=n(i)).source||(c.source=o.join("string"==typeof e?e:""))),t!==r?(u?!l&&t[e]&&(f=!0):delete t[e],f?t[e]=i:m(t,e,i)):f?t[e]=i:setGlobal(e,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&e(this).source||_(this)}))})),B=r,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,e){return arguments.length<2?aFunction(B[t])||aFunction(r[t]):B[t]&&B[t][e]||r[t]&&r[t][e]},V=Math.ceil,Y=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?Y:V)(t)},H=Math.min,toLength=function(t){return t>0?H(toInteger(t),9007199254740991):0},K=Math.max,q=Math.min,toAbsoluteIndex=function(t,e){var r=toInteger(t);return r<0?K(r+e,0):q(r,e)},createMethod=function(t){return function(e,r,n){var o,i=toIndexedObject(e),a=toLength(i.length),c=toAbsoluteIndex(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},J={includes:createMethod(!0),indexOf:createMethod(!1)},X=J.indexOf,objectKeysInternal=function(t,e){var r,n=toIndexedObject(t),o=0,i=[];for(r in n)!has(L,r)&&has(n,r)&&i.push(r);for(;e.length>o;)has(n,r=e[o++])&&(~X(i,r)||i.push(r));return i},Q=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Z=Q.concat("length","prototype"),tt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Z)}},et={f:Object.getOwnPropertySymbols},rt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=tt.f(anObject(t)),r=et.f;return r?e.concat(r(t)):e},copyConstructorProperties=function(t,e){for(var r=rt(e),n=g.f,o=v.f,i=0;i=74)&&(U=gt.match(/Chrome\/(\d+)/))&&(z=U[1]);var St=z&&+z,xt=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return St>=51||!fails((function(){var e=[];return(e.constructor={})[xt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Et=wellKnownSymbol("isConcatSpreadable"),Ot=9007199254740991,_t="Maximum allowed index exceeded",jt=St>=51||!fails((function(){var t=[];return t[Et]=!1,t.concat()[0]!==t})),kt=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[Et];return void 0!==e?!!e:lt(t)};_export({target:"Array",proto:!0,forced:!jt||!kt},{concat:function concat(t){var e,r,n,o,i,a=toObject(this),c=arraySpeciesCreate(a,0),u=0;for(e=-1,n=arguments.length;eOt)throw TypeError(_t);for(r=0;r=Ot)throw TypeError(_t);createProperty(c,u++,i)}return c.length=u,c}});var Pt,At=Object.keys||function keys(t){return objectKeysInternal(t,Q)},Tt=n?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var r,n=At(e),o=n.length,i=0;o>i;)g.f(t,r=n[i++],e[r]);return t},It=getBuiltIn("document","documentElement"),Lt=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return" + SVG-edit diff --git a/dist/editor/xdomain-index.html b/dist/editor/xdomain-index.html index 6becaec0..c873bf79 100644 --- a/dist/editor/xdomain-index.html +++ b/dist/editor/xdomain-index.html @@ -12,7 +12,7 @@ - + @@ -22,7 +22,7 @@ - + SVG-edit diff --git a/netlify.toml b/netlify.toml index d8b31bde..c2604d9d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -16,12 +16,17 @@ # Production context: all deploys from the Production branch set in your site's # deploy contexts will inherit these settings. +[context."v7-preview"] + publish = "/" + +[context."release-v6.0.0"] + publish = "/" + command = "echo 'branch release-v6.0.0 already built'" + [context."release-v5.1.0"] publish = "/" command = "echo 'branch release-v5.1.0 already built'" -# Production context: all deploys from the Production branch set in your site's -# deploy contexts will inherit these settings. [context.master] publish = "/" command = "echo 'already built'" diff --git a/package-lock.json b/package-lock.json index 6f483161..a6873351 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3448,6 +3448,16 @@ } } }, + "@rollup/plugin-inject": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-4.0.2.tgz", + "integrity": "sha512-TSLMA8waJ7Dmgmoc8JfPnwUwVZgLjjIAM6MqeIFqPO2ODK36JqE0Cf2F54UTgCUuW8da93Mvoj75a6KAVWgylw==", + "requires": { + "@rollup/pluginutils": "^3.0.4", + "estree-walker": "^1.0.1", + "magic-string": "^0.25.5" + } + }, "@rollup/plugin-node-resolve": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz", @@ -3516,7 +3526,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, "requires": { "@types/estree": "0.0.39", "estree-walker": "^1.0.1", @@ -3665,8 +3674,7 @@ "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "@types/express": { "version": "4.17.9", @@ -7369,14 +7377,14 @@ } }, "core-js": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz", - "integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA==" + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.2.tgz", + "integrity": "sha512-FfApuSRgrR6G5s58casCBd9M2k+4ikuu4wbW6pJyYU7bd9zvFc9qf7vr5xmrZOhT9nn+8uwlH1oRR9jTnFoA3A==" }, "core-js-bundle": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.7.0.tgz", - "integrity": "sha512-dxWbbGslTVI8RP2wFGw6llMbw7LD+R0NJHj7WnLrdtpLiZ6YcTdn/7uNEVBIfxi1PH7q4Kt48TbB8gwwZFvrJQ==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/core-js-bundle/-/core-js-bundle-3.8.2.tgz", + "integrity": "sha512-pTwrW41+ISaAY9JbJISKdTpOCZ+vMdM9ygd6hG9yolYwbOLb8UqTLsZwpRH9/Nv14pdKgMtJXd7Tn3xDsuhRBA==", "dev": true }, "core-js-compat": { @@ -9989,8 +9997,7 @@ "estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==" }, "esutils": { "version": "2.0.3", @@ -14031,7 +14038,6 @@ "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, "requires": { "sourcemap-codec": "^1.4.4" } @@ -17074,7 +17080,7 @@ "dev": true }, "qr-manipulation": { - "version": "git+https://github.com/brettz9/qr-manipulation.git#f3dd92f4db007b2195ab1477757db74d598c3fdc", + "version": "git+https://github.com/brettz9/qr-manipulation.git#fc28c633c6b4caf3489508dc42c013dd0d8a43f8", "from": "git+https://github.com/brettz9/qr-manipulation.git", "dev": true }, @@ -18086,6 +18092,14 @@ "rollup-plugin-inject": "^3.0.0" } }, + "rollup-plugin-polyfill-node": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.4.1.tgz", + "integrity": "sha512-PxON/asmp3BuBaJPUToUQSq3RA6MpDma0zlK+NuQoBgxImMOPjVeelkdLYh0EWo9ZSJbCqDDkckAAM0wOwvysQ==", + "requires": { + "@rollup/plugin-inject": "^4.0.0" + } + }, "rollup-plugin-progress": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/rollup-plugin-progress/-/rollup-plugin-progress-1.1.2.tgz", @@ -18768,8 +18782,7 @@ "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" }, "spawn-wrap": { "version": "2.0.0", diff --git a/package.json b/package.json index 9ee6d1ba..2f349a23 100644 --- a/package.json +++ b/package.json @@ -137,10 +137,11 @@ "@babel/polyfill": "7.12.1", "@web/dev-server-rollup": "0.3.1", "canvg": "3.0.7", - "core-js": "3.7.0", + "core-js": "3.8.2", "jspdf": "2.1.1", "pathseg": "1.2.0", "regenerator-runtime": "0.13.7", + "rollup-plugin-polyfill-node": "^0.4.1", "svg2pdf.js": "2.0.0" }, "devDependencies": { @@ -163,7 +164,7 @@ "axe-core": "4.1.1", "babel-plugin-transform-object-rest-spread": "7.0.0-beta.3", "copyfiles": "2.4.0", - "core-js-bundle": "3.7.0", + "core-js-bundle": "3.8.2", "coveradge": "0.6.0", "cp-cli": "2.0.0", "cross-var": "1.1.0", diff --git a/rollup.config.js b/rollup.config.js index 241c888a..fe709ef4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -9,7 +9,7 @@ import babel from '@rollup/plugin-babel'; import copy from 'rollup-plugin-copy'; import {nodeResolve} from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; -import nodePolyfills from 'rollup-plugin-node-polyfills'; +import nodePolyfills from 'rollup-plugin-polyfill-node'; import url from '@rollup/plugin-url'; // for XML/SVG files import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; import {terser} from 'rollup-plugin-terser'; diff --git a/src/editor/index.html b/src/editor/index.html index 488ac19c..c873bf79 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -12,7 +12,7 @@ - + @@ -22,7 +22,7 @@ - + SVG-edit