@erase2d/fabric 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -74,4 +74,6 @@ https://github.com/ShaMan123/erase2d/blob/4c9657f8e2d6c20e7274f49a8f8e6d907f9e02
74
74
 
75
75
  ## Dev
76
76
 
77
- see main [`README`](../../README.md).
77
+ The build command will build [`src`](./src) and copy [`core`](../core/dist) into [`dist`](./dist).
78
+
79
+ For the rest, see the main [`README`](../../README.md).
@@ -1,2 +1,543 @@
1
- function t(t,e,n){return e=v(e),g(t,r()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(r=function(){return!!t})()}function e(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}function n(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function o(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(r){y(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function i(){i=function(){return r};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var i=r&&r.prototype instanceof g?r:g,a=Object.create(i.prototype),c=new k(n||[]);return o(a,"_invoke",{value:S(t,e,c)}),a}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=s;var y="suspendedStart",h="suspendedYield",v="executing",d="completed",b={};function g(){}function m(){}function w(){}var O={};f(O,c,(function(){return this}));var j=Object.getPrototypeOf,P=j&&j(j(I([])));P&&P!==e&&n.call(P,c)&&(O=P);var E=w.prototype=g.prototype=Object.create(O);function L(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function x(t,r){function e(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new r((function(r,o){e(t,n,r,o)}))}return i=i?i.then(o,o):o()}})}function S(r,e,n){var o=y;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(r,e,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,b;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,b):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function T(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return m.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=f(w,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===m||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},L(x.prototype),f(x.prototype,u,(function(){return this})),r.AsyncIterator=x,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new x(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(E),f(E,l,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=I,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function o(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),b},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:I(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}function a(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function c(t){var r=a(t,"string");return"symbol"==typeof r?r:String(r)}function u(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var r=this,e=arguments;return new Promise((function(n,o){var i=t.apply(r,e);function a(t){u(i,n,o,a,c,"next",t)}function c(t){u(i,n,o,a,c,"throw",t)}a(void 0)}))}}function f(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function s(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function p(t,r,e){return r&&s(t.prototype,r),e&&s(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t,r,e){return(r=c(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function h(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&d(t,r)}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function d(t,r){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},d(t,r)}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return b(t)}function m(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=v(t)););return t}function w(){return w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,r,e){var n=m(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:e):o.value}},w.apply(this,arguments)}function O(t,r){return E(t)||e(t,r)||x(t,r)||T()}function j(t){return P(t)||L(t)||x(t)||_()}function P(t){if(Array.isArray(t))return S(t)}function E(t){if(Array.isArray(t))return t}function L(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function x(t,r){if(t){if("string"==typeof t)return S(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?S(t,r):void 0}}function S(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function _(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}export{S as arrayLikeToArray,E as arrayWithHoles,P as arrayWithoutHoles,b as assertThisInitialized,l as asyncToGenerator,t as callSuper,f as classCallCheck,p as createClass,y as defineProperty,w as get,v as getPrototypeOf,h as inherits,r as isNativeReflectConstruct,L as iterableToArray,e as iterableToArrayLimit,T as nonIterableRest,_ as nonIterableSpread,o as objectSpread2,g as possibleConstructorReturn,i as regeneratorRuntime,d as setPrototypeOf,O as slicedToArray,m as superPropBase,j as toConsumableArray,a as toPrimitive,c as toPropertyKey,x as unsupportedIterableToArray};
1
+ function _callSuper(t, o, e) {
2
+ return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3
+ }
4
+ function _isNativeReflectConstruct() {
5
+ try {
6
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
7
+ } catch (t) {}
8
+ return (_isNativeReflectConstruct = function () {
9
+ return !!t;
10
+ })();
11
+ }
12
+ function _iterableToArrayLimit(r, l) {
13
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
14
+ if (null != t) {
15
+ var e,
16
+ n,
17
+ i,
18
+ u,
19
+ a = [],
20
+ f = !0,
21
+ o = !1;
22
+ try {
23
+ if (i = (t = t.call(r)).next, 0 === l) {
24
+ if (Object(t) !== t) return;
25
+ f = !1;
26
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
27
+ } catch (r) {
28
+ o = !0, n = r;
29
+ } finally {
30
+ try {
31
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
32
+ } finally {
33
+ if (o) throw n;
34
+ }
35
+ }
36
+ return a;
37
+ }
38
+ }
39
+ function ownKeys(e, r) {
40
+ var t = Object.keys(e);
41
+ if (Object.getOwnPropertySymbols) {
42
+ var o = Object.getOwnPropertySymbols(e);
43
+ r && (o = o.filter(function (r) {
44
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
45
+ })), t.push.apply(t, o);
46
+ }
47
+ return t;
48
+ }
49
+ function _objectSpread2(e) {
50
+ for (var r = 1; r < arguments.length; r++) {
51
+ var t = null != arguments[r] ? arguments[r] : {};
52
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
53
+ _defineProperty(e, r, t[r]);
54
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
55
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
56
+ });
57
+ }
58
+ return e;
59
+ }
60
+ function _regeneratorRuntime() {
61
+ _regeneratorRuntime = function () {
62
+ return e;
63
+ };
64
+ var t,
65
+ e = {},
66
+ r = Object.prototype,
67
+ n = r.hasOwnProperty,
68
+ o = Object.defineProperty || function (t, e, r) {
69
+ t[e] = r.value;
70
+ },
71
+ i = "function" == typeof Symbol ? Symbol : {},
72
+ a = i.iterator || "@@iterator",
73
+ c = i.asyncIterator || "@@asyncIterator",
74
+ u = i.toStringTag || "@@toStringTag";
75
+ function define(t, e, r) {
76
+ return Object.defineProperty(t, e, {
77
+ value: r,
78
+ enumerable: !0,
79
+ configurable: !0,
80
+ writable: !0
81
+ }), t[e];
82
+ }
83
+ try {
84
+ define({}, "");
85
+ } catch (t) {
86
+ define = function (t, e, r) {
87
+ return t[e] = r;
88
+ };
89
+ }
90
+ function wrap(t, e, r, n) {
91
+ var i = e && e.prototype instanceof Generator ? e : Generator,
92
+ a = Object.create(i.prototype),
93
+ c = new Context(n || []);
94
+ return o(a, "_invoke", {
95
+ value: makeInvokeMethod(t, r, c)
96
+ }), a;
97
+ }
98
+ function tryCatch(t, e, r) {
99
+ try {
100
+ return {
101
+ type: "normal",
102
+ arg: t.call(e, r)
103
+ };
104
+ } catch (t) {
105
+ return {
106
+ type: "throw",
107
+ arg: t
108
+ };
109
+ }
110
+ }
111
+ e.wrap = wrap;
112
+ var h = "suspendedStart",
113
+ l = "suspendedYield",
114
+ f = "executing",
115
+ s = "completed",
116
+ y = {};
117
+ function Generator() {}
118
+ function GeneratorFunction() {}
119
+ function GeneratorFunctionPrototype() {}
120
+ var p = {};
121
+ define(p, a, function () {
122
+ return this;
123
+ });
124
+ var d = Object.getPrototypeOf,
125
+ v = d && d(d(values([])));
126
+ v && v !== r && n.call(v, a) && (p = v);
127
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
128
+ function defineIteratorMethods(t) {
129
+ ["next", "throw", "return"].forEach(function (e) {
130
+ define(t, e, function (t) {
131
+ return this._invoke(e, t);
132
+ });
133
+ });
134
+ }
135
+ function AsyncIterator(t, e) {
136
+ function invoke(r, o, i, a) {
137
+ var c = tryCatch(t[r], t, o);
138
+ if ("throw" !== c.type) {
139
+ var u = c.arg,
140
+ h = u.value;
141
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
142
+ invoke("next", t, i, a);
143
+ }, function (t) {
144
+ invoke("throw", t, i, a);
145
+ }) : e.resolve(h).then(function (t) {
146
+ u.value = t, i(u);
147
+ }, function (t) {
148
+ return invoke("throw", t, i, a);
149
+ });
150
+ }
151
+ a(c.arg);
152
+ }
153
+ var r;
154
+ o(this, "_invoke", {
155
+ value: function (t, n) {
156
+ function callInvokeWithMethodAndArg() {
157
+ return new e(function (e, r) {
158
+ invoke(t, n, e, r);
159
+ });
160
+ }
161
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
162
+ }
163
+ });
164
+ }
165
+ function makeInvokeMethod(e, r, n) {
166
+ var o = h;
167
+ return function (i, a) {
168
+ if (o === f) throw new Error("Generator is already running");
169
+ if (o === s) {
170
+ if ("throw" === i) throw a;
171
+ return {
172
+ value: t,
173
+ done: !0
174
+ };
175
+ }
176
+ for (n.method = i, n.arg = a;;) {
177
+ var c = n.delegate;
178
+ if (c) {
179
+ var u = maybeInvokeDelegate(c, n);
180
+ if (u) {
181
+ if (u === y) continue;
182
+ return u;
183
+ }
184
+ }
185
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
186
+ if (o === h) throw o = s, n.arg;
187
+ n.dispatchException(n.arg);
188
+ } else "return" === n.method && n.abrupt("return", n.arg);
189
+ o = f;
190
+ var p = tryCatch(e, r, n);
191
+ if ("normal" === p.type) {
192
+ if (o = n.done ? s : l, p.arg === y) continue;
193
+ return {
194
+ value: p.arg,
195
+ done: n.done
196
+ };
197
+ }
198
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
199
+ }
200
+ };
201
+ }
202
+ function maybeInvokeDelegate(e, r) {
203
+ var n = r.method,
204
+ o = e.iterator[n];
205
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
206
+ var i = tryCatch(o, e.iterator, r.arg);
207
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
208
+ var a = i.arg;
209
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
210
+ }
211
+ function pushTryEntry(t) {
212
+ var e = {
213
+ tryLoc: t[0]
214
+ };
215
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
216
+ }
217
+ function resetTryEntry(t) {
218
+ var e = t.completion || {};
219
+ e.type = "normal", delete e.arg, t.completion = e;
220
+ }
221
+ function Context(t) {
222
+ this.tryEntries = [{
223
+ tryLoc: "root"
224
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
225
+ }
226
+ function values(e) {
227
+ if (e || "" === e) {
228
+ var r = e[a];
229
+ if (r) return r.call(e);
230
+ if ("function" == typeof e.next) return e;
231
+ if (!isNaN(e.length)) {
232
+ var o = -1,
233
+ i = function next() {
234
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
235
+ return next.value = t, next.done = !0, next;
236
+ };
237
+ return i.next = i;
238
+ }
239
+ }
240
+ throw new TypeError(typeof e + " is not iterable");
241
+ }
242
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
243
+ value: GeneratorFunctionPrototype,
244
+ configurable: !0
245
+ }), o(GeneratorFunctionPrototype, "constructor", {
246
+ value: GeneratorFunction,
247
+ configurable: !0
248
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
249
+ var e = "function" == typeof t && t.constructor;
250
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
251
+ }, e.mark = function (t) {
252
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
253
+ }, e.awrap = function (t) {
254
+ return {
255
+ __await: t
256
+ };
257
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
258
+ return this;
259
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
260
+ void 0 === i && (i = Promise);
261
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
262
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
263
+ return t.done ? t.value : a.next();
264
+ });
265
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
266
+ return this;
267
+ }), define(g, "toString", function () {
268
+ return "[object Generator]";
269
+ }), e.keys = function (t) {
270
+ var e = Object(t),
271
+ r = [];
272
+ for (var n in e) r.push(n);
273
+ return r.reverse(), function next() {
274
+ for (; r.length;) {
275
+ var t = r.pop();
276
+ if (t in e) return next.value = t, next.done = !1, next;
277
+ }
278
+ return next.done = !0, next;
279
+ };
280
+ }, e.values = values, Context.prototype = {
281
+ constructor: Context,
282
+ reset: function (e) {
283
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
284
+ },
285
+ stop: function () {
286
+ this.done = !0;
287
+ var t = this.tryEntries[0].completion;
288
+ if ("throw" === t.type) throw t.arg;
289
+ return this.rval;
290
+ },
291
+ dispatchException: function (e) {
292
+ if (this.done) throw e;
293
+ var r = this;
294
+ function handle(n, o) {
295
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
296
+ }
297
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
298
+ var i = this.tryEntries[o],
299
+ a = i.completion;
300
+ if ("root" === i.tryLoc) return handle("end");
301
+ if (i.tryLoc <= this.prev) {
302
+ var c = n.call(i, "catchLoc"),
303
+ u = n.call(i, "finallyLoc");
304
+ if (c && u) {
305
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
306
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
307
+ } else if (c) {
308
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
309
+ } else {
310
+ if (!u) throw new Error("try statement without catch or finally");
311
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
312
+ }
313
+ }
314
+ }
315
+ },
316
+ abrupt: function (t, e) {
317
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
318
+ var o = this.tryEntries[r];
319
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
320
+ var i = o;
321
+ break;
322
+ }
323
+ }
324
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
325
+ var a = i ? i.completion : {};
326
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
327
+ },
328
+ complete: function (t, e) {
329
+ if ("throw" === t.type) throw t.arg;
330
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
331
+ },
332
+ finish: function (t) {
333
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
334
+ var r = this.tryEntries[e];
335
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
336
+ }
337
+ },
338
+ catch: function (t) {
339
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
340
+ var r = this.tryEntries[e];
341
+ if (r.tryLoc === t) {
342
+ var n = r.completion;
343
+ if ("throw" === n.type) {
344
+ var o = n.arg;
345
+ resetTryEntry(r);
346
+ }
347
+ return o;
348
+ }
349
+ }
350
+ throw new Error("illegal catch attempt");
351
+ },
352
+ delegateYield: function (e, r, n) {
353
+ return this.delegate = {
354
+ iterator: values(e),
355
+ resultName: r,
356
+ nextLoc: n
357
+ }, "next" === this.method && (this.arg = t), y;
358
+ }
359
+ }, e;
360
+ }
361
+ function _toPrimitive(t, r) {
362
+ if ("object" != typeof t || !t) return t;
363
+ var e = t[Symbol.toPrimitive];
364
+ if (void 0 !== e) {
365
+ var i = e.call(t, r || "default");
366
+ if ("object" != typeof i) return i;
367
+ throw new TypeError("@@toPrimitive must return a primitive value.");
368
+ }
369
+ return ("string" === r ? String : Number)(t);
370
+ }
371
+ function _toPropertyKey(t) {
372
+ var i = _toPrimitive(t, "string");
373
+ return "symbol" == typeof i ? i : String(i);
374
+ }
375
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
376
+ try {
377
+ var info = gen[key](arg);
378
+ var value = info.value;
379
+ } catch (error) {
380
+ reject(error);
381
+ return;
382
+ }
383
+ if (info.done) {
384
+ resolve(value);
385
+ } else {
386
+ Promise.resolve(value).then(_next, _throw);
387
+ }
388
+ }
389
+ function _asyncToGenerator(fn) {
390
+ return function () {
391
+ var self = this,
392
+ args = arguments;
393
+ return new Promise(function (resolve, reject) {
394
+ var gen = fn.apply(self, args);
395
+ function _next(value) {
396
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
397
+ }
398
+ function _throw(err) {
399
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
400
+ }
401
+ _next(undefined);
402
+ });
403
+ };
404
+ }
405
+ function _classCallCheck(instance, Constructor) {
406
+ if (!(instance instanceof Constructor)) {
407
+ throw new TypeError("Cannot call a class as a function");
408
+ }
409
+ }
410
+ function _defineProperties(target, props) {
411
+ for (var i = 0; i < props.length; i++) {
412
+ var descriptor = props[i];
413
+ descriptor.enumerable = descriptor.enumerable || false;
414
+ descriptor.configurable = true;
415
+ if ("value" in descriptor) descriptor.writable = true;
416
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
417
+ }
418
+ }
419
+ function _createClass(Constructor, protoProps, staticProps) {
420
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
421
+ if (staticProps) _defineProperties(Constructor, staticProps);
422
+ Object.defineProperty(Constructor, "prototype", {
423
+ writable: false
424
+ });
425
+ return Constructor;
426
+ }
427
+ function _defineProperty(obj, key, value) {
428
+ key = _toPropertyKey(key);
429
+ if (key in obj) {
430
+ Object.defineProperty(obj, key, {
431
+ value: value,
432
+ enumerable: true,
433
+ configurable: true,
434
+ writable: true
435
+ });
436
+ } else {
437
+ obj[key] = value;
438
+ }
439
+ return obj;
440
+ }
441
+ function _inherits(subClass, superClass) {
442
+ if (typeof superClass !== "function" && superClass !== null) {
443
+ throw new TypeError("Super expression must either be null or a function");
444
+ }
445
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
446
+ constructor: {
447
+ value: subClass,
448
+ writable: true,
449
+ configurable: true
450
+ }
451
+ });
452
+ Object.defineProperty(subClass, "prototype", {
453
+ writable: false
454
+ });
455
+ if (superClass) _setPrototypeOf(subClass, superClass);
456
+ }
457
+ function _getPrototypeOf(o) {
458
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
459
+ return o.__proto__ || Object.getPrototypeOf(o);
460
+ };
461
+ return _getPrototypeOf(o);
462
+ }
463
+ function _setPrototypeOf(o, p) {
464
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
465
+ o.__proto__ = p;
466
+ return o;
467
+ };
468
+ return _setPrototypeOf(o, p);
469
+ }
470
+ function _assertThisInitialized(self) {
471
+ if (self === void 0) {
472
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
473
+ }
474
+ return self;
475
+ }
476
+ function _possibleConstructorReturn(self, call) {
477
+ if (call && (typeof call === "object" || typeof call === "function")) {
478
+ return call;
479
+ } else if (call !== void 0) {
480
+ throw new TypeError("Derived constructors may only return object or undefined");
481
+ }
482
+ return _assertThisInitialized(self);
483
+ }
484
+ function _superPropBase(object, property) {
485
+ while (!Object.prototype.hasOwnProperty.call(object, property)) {
486
+ object = _getPrototypeOf(object);
487
+ if (object === null) break;
488
+ }
489
+ return object;
490
+ }
491
+ function _get() {
492
+ if (typeof Reflect !== "undefined" && Reflect.get) {
493
+ _get = Reflect.get.bind();
494
+ } else {
495
+ _get = function _get(target, property, receiver) {
496
+ var base = _superPropBase(target, property);
497
+ if (!base) return;
498
+ var desc = Object.getOwnPropertyDescriptor(base, property);
499
+ if (desc.get) {
500
+ return desc.get.call(arguments.length < 3 ? target : receiver);
501
+ }
502
+ return desc.value;
503
+ };
504
+ }
505
+ return _get.apply(this, arguments);
506
+ }
507
+ function _slicedToArray(arr, i) {
508
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
509
+ }
510
+ function _toConsumableArray(arr) {
511
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
512
+ }
513
+ function _arrayWithoutHoles(arr) {
514
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
515
+ }
516
+ function _arrayWithHoles(arr) {
517
+ if (Array.isArray(arr)) return arr;
518
+ }
519
+ function _iterableToArray(iter) {
520
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
521
+ }
522
+ function _unsupportedIterableToArray(o, minLen) {
523
+ if (!o) return;
524
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
525
+ var n = Object.prototype.toString.call(o).slice(8, -1);
526
+ if (n === "Object" && o.constructor) n = o.constructor.name;
527
+ if (n === "Map" || n === "Set") return Array.from(o);
528
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
529
+ }
530
+ function _arrayLikeToArray(arr, len) {
531
+ if (len == null || len > arr.length) len = arr.length;
532
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
533
+ return arr2;
534
+ }
535
+ function _nonIterableSpread() {
536
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
537
+ }
538
+ function _nonIterableRest() {
539
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
540
+ }
541
+
542
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _assertThisInitialized as assertThisInitialized, _asyncToGenerator as asyncToGenerator, _callSuper as callSuper, _classCallCheck as classCallCheck, _createClass as createClass, _defineProperty as defineProperty, _get as get, _getPrototypeOf as getPrototypeOf, _inherits as inherits, _isNativeReflectConstruct as isNativeReflectConstruct, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _possibleConstructorReturn as possibleConstructorReturn, _regeneratorRuntime as regeneratorRuntime, _setPrototypeOf as setPrototypeOf, _slicedToArray as slicedToArray, _superPropBase as superPropBase, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
2
543
  //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,36 @@
1
+ var drawImage = function drawImage(destination, source) {
2
+ var globalCompositeOperation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'source-over';
3
+ destination.save();
4
+ destination.imageSmoothingEnabled = true;
5
+ destination.imageSmoothingQuality = 'high';
6
+ destination.globalCompositeOperation = globalCompositeOperation;
7
+ destination.resetTransform();
8
+ destination.drawImage(source.canvas, 0, 0);
9
+ destination.restore();
10
+ };
11
+
12
+ /**
13
+ *
14
+ * @param destination context to erase
15
+ * @param source context on which the path is drawn upon
16
+ * @param erasingEffect effect to apply to {@link source} after clipping {@link destination}:
17
+ * - drawing all non erasable visuals to achieve a selective erasing effect.
18
+ * - drawing all erasable visuals without their erasers to achieve an undo erasing effect.
19
+ */
20
+ var erase = function erase(destination, source, erasingEffect) {
21
+ // clip destination
22
+ drawImage(destination, source, 'destination-out');
23
+
24
+ // draw erasing effect
25
+ if (erasingEffect) {
26
+ drawImage(source, erasingEffect, 'source-in');
27
+ } else {
28
+ source.save();
29
+ source.resetTransform();
30
+ source.clearRect(0, 0, source.canvas.width, source.canvas.height);
31
+ source.restore();
32
+ }
33
+ };
34
+
35
+ export { drawImage, erase };
36
+ //# sourceMappingURL=erase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erase.js","sources":["../../../../../core/dist/src/erase.js"],"sourcesContent":["var drawImage = function drawImage(destination, source) {\n var globalCompositeOperation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'source-over';\n destination.save();\n destination.imageSmoothingEnabled = true;\n destination.imageSmoothingQuality = 'high';\n destination.globalCompositeOperation = globalCompositeOperation;\n destination.resetTransform();\n destination.drawImage(source.canvas, 0, 0);\n destination.restore();\n};\n\n/**\n *\n * @param destination context to erase\n * @param source context on which the path is drawn upon\n * @param erasingEffect effect to apply to {@link source} after clipping {@link destination}:\n * - drawing all non erasable visuals to achieve a selective erasing effect.\n * - drawing all erasable visuals without their erasers to achieve an undo erasing effect.\n */\nvar erase = function erase(destination, source, erasingEffect) {\n // clip destination\n drawImage(destination, source, 'destination-out');\n\n // draw erasing effect\n if (erasingEffect) {\n drawImage(source, erasingEffect, 'source-in');\n } else {\n source.save();\n source.resetTransform();\n source.clearRect(0, 0, source.canvas.width, source.canvas.height);\n source.restore();\n }\n};\n\nexport { drawImage, erase };\n//# sourceMappingURL=erase.js.map\n"],"names":["drawImage","destination","source","globalCompositeOperation","arguments","length","undefined","save","imageSmoothingEnabled","imageSmoothingQuality","resetTransform","canvas","restore","erase","erasingEffect","clearRect","width","height"],"mappings":"AAAaA,IAAAA,SAAS,GAAG,SAAZA,SAASA,CACpBC,WAAqC,EACrCC,MAAgC,EAE7B;AAAA,EAAA,IADHC,wBAAkD,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,aAAa,CAAA;EAElEH,WAAW,CAACM,IAAI,EAAE,CAAA;EAClBN,WAAW,CAACO,qBAAqB,GAAG,IAAI,CAAA;EACxCP,WAAW,CAACQ,qBAAqB,GAAG,MAAM,CAAA;EAC1CR,WAAW,CAACE,wBAAwB,GAAGA,wBAAwB,CAAA;EAC/DF,WAAW,CAACS,cAAc,EAAE,CAAA;EAC5BT,WAAW,CAACD,SAAS,CAACE,MAAM,CAACS,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;EAC1CV,WAAW,CAACW,OAAO,EAAE,CAAA;AACvB,EAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACaC,IAAAA,KAAK,GAAG,SAARA,KAAKA,CAChBZ,WAAqC,EACrCC,MAAgC,EAChCY,aAAwC,EACrC;AACH;AACAd,EAAAA,SAAS,CAACC,WAAW,EAAEC,MAAM,EAAE,iBAAiB,CAAC,CAAA;;AAEjD;AACA,EAAA,IAAIY,aAAa,EAAE;AACjBd,IAAAA,SAAS,CAACE,MAAM,EAAEY,aAAa,EAAE,WAAW,CAAC,CAAA;AAC/C,GAAC,MAAM;IACLZ,MAAM,CAACK,IAAI,EAAE,CAAA;IACbL,MAAM,CAACQ,cAAc,EAAE,CAAA;AACvBR,IAAAA,MAAM,CAACa,SAAS,CAAC,CAAC,EAAE,CAAC,EAAEb,MAAM,CAACS,MAAM,CAACK,KAAK,EAAEd,MAAM,CAACS,MAAM,CAACM,MAAM,CAAC,CAAA;IACjEf,MAAM,CAACU,OAAO,EAAE,CAAA;AAClB,GAAA;AACF;;;;"}
@@ -0,0 +1,4 @@
1
+ export { ClippingGroup } from './src/ClippingGroup.js';
2
+ export { EraserBrush, eraseCanvasDrawable, eraseObject } from './src/EraserBrush.js';
3
+ export { isTransparent } from './src/isTransparent.js';
4
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}