@antv/g-canvas 1.1.7 → 1.1.8-alpha.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.
@@ -6,7 +6,7 @@ export declare class Canvas2DContextService implements ContextService<CanvasRend
6
6
  private dpr;
7
7
  private context;
8
8
  private canvasConfig;
9
- init(): void;
9
+ init(): Promise<void>;
10
10
  getContext(): CanvasRenderingContext2D;
11
11
  getDomElement(): CanvasLike;
12
12
  getDPR(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"Canvas2DContextService.d.ts","sourceRoot":"","sources":["../src/Canvas2DContextService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAgB,cAAc,EAAmC,MAAM,SAAS,CAAC;AAGxF,qBACa,sBAAuB,YAAW,cAAc,CAAC,wBAAwB,CAAC;IACrF,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,OAAO,CAAsE;IAGrF,OAAO,CAAC,YAAY,CAAe;IAEnC,IAAI;IAoCJ,UAAU;IAIV,aAAa;IAIb,MAAM;IAIN,qBAAqB;IAMrB,OAAO;IASP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAgBpC,gBAAgB,CAAC,MAAM,EAAE,MAAM;CAKhC"}
1
+ {"version":3,"file":"Canvas2DContextService.d.ts","sourceRoot":"","sources":["../src/Canvas2DContextService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAEL,cAAc,EAMf,MAAM,SAAS,CAAC;AAEjB,qBACa,sBAAuB,YAAW,cAAc,CAAC,wBAAwB,CAAC;IACrF,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,OAAO,CAAsE;IAGrF,OAAO,CAAC,YAAY,CAAe;IAE7B,IAAI;IAoCV,UAAU;IAIV,aAAa;IAIb,MAAM;IAIN,qBAAqB;IAMrB,OAAO;IASP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAgBpC,gBAAgB,CAAC,MAAM,EAAE,MAAM;CAKhC"}
@@ -1,5 +1,4 @@
1
- import type { Syringe } from 'mana-syringe';
2
- import type { RendererPlugin } from '@antv/g';
1
+ import type { RendererPlugin, Syringe } from '@antv/g';
3
2
  export declare class ContextRegisterPlugin implements RendererPlugin {
4
3
  name: string;
5
4
  init(container: Syringe.Container): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextRegisterPlugin.d.ts","sourceRoot":"","sources":["../src/ContextRegisterPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAU9C,qBAAa,qBAAsB,YAAW,cAAc;IAC1D,IAAI,SAA6B;IACjC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;IAGxC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;CAG5C"}
1
+ {"version":3,"file":"ContextRegisterPlugin.d.ts","sourceRoot":"","sources":["../src/ContextRegisterPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAWvD,qBAAa,qBAAsB,YAAW,cAAc;IAC1D,IAAI,SAA6B;IACjC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;IAGxC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,IAAI;CAG5C"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,5 @@
1
1
  import type { RendererConfig } from '@antv/g';
2
2
  import { AbstractRenderer } from '@antv/g';
3
- import * as DomInteraction from '@antv/g-plugin-dom-interaction';
4
- import * as CanvasRenderer from '@antv/g-plugin-canvas-renderer';
5
- import * as CanvasPicker from '@antv/g-plugin-canvas-picker';
6
- import * as HTMLRenderer from '@antv/g-plugin-html-renderer';
7
- export { DomInteraction, CanvasRenderer, CanvasPicker, HTMLRenderer };
8
3
  export declare class Renderer extends AbstractRenderer {
9
4
  constructor(config?: Partial<RendererConfig>);
10
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAEtE,qBAAa,QAAS,SAAQ,gBAAgB;gBAChC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;CAc7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAS3C,qBAAa,QAAS,SAAQ,gBAAgB;gBAChC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;CAgB7C"}
package/dist/index.esm.js CHANGED
@@ -1,19 +1,393 @@
1
- import { CanvasConfig, ContextService, isString, setDOMSize, isBrowser, AbstractRenderer } from '@antv/g';
2
- import { Plugin as Plugin$1 } from '@antv/g-plugin-dom-interaction';
3
- import * as DomInteraction from '@antv/g-plugin-dom-interaction';
4
- export { DomInteraction };
5
- import { Plugin } from '@antv/g-plugin-canvas-renderer';
6
- import * as CanvasRenderer from '@antv/g-plugin-canvas-renderer';
7
- export { CanvasRenderer };
8
- import { Plugin as Plugin$2 } from '@antv/g-plugin-canvas-picker';
9
- import * as CanvasPicker from '@antv/g-plugin-canvas-picker';
10
- export { CanvasPicker };
11
- import { Plugin as Plugin$3 } from '@antv/g-plugin-html-renderer';
12
- import * as HTMLRenderer from '@antv/g-plugin-html-renderer';
13
- export { HTMLRenderer };
14
- import { inject, singleton, Module } from 'mana-syringe';
1
+ import { inject, CanvasConfig, singleton, ContextService, setDOMSize, isString, isBrowser, Module, AbstractRenderer } from '@antv/g';
2
+ import { Plugin as Plugin$1 } from '@antv/g-plugin-canvas-path-generator';
3
+ import { Plugin as Plugin$4 } from '@antv/g-plugin-canvas-picker';
4
+ import { Plugin as Plugin$2 } from '@antv/g-plugin-canvas-renderer';
5
+ import { Plugin as Plugin$3 } from '@antv/g-plugin-dom-interaction';
6
+ import { Plugin as Plugin$5 } from '@antv/g-plugin-html-renderer';
7
+ import { Plugin } from '@antv/g-plugin-image-loader';
15
8
  import { __decorate, __metadata } from 'tslib';
16
9
 
10
+ function _regeneratorRuntime() {
11
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
12
+
13
+ _regeneratorRuntime = function () {
14
+ return exports;
15
+ };
16
+
17
+ var exports = {},
18
+ Op = Object.prototype,
19
+ hasOwn = Op.hasOwnProperty,
20
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
21
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
22
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
23
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
24
+
25
+ function define(obj, key, value) {
26
+ return Object.defineProperty(obj, key, {
27
+ value: value,
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0
31
+ }), obj[key];
32
+ }
33
+
34
+ try {
35
+ define({}, "");
36
+ } catch (err) {
37
+ define = function (obj, key, value) {
38
+ return obj[key] = value;
39
+ };
40
+ }
41
+
42
+ function wrap(innerFn, outerFn, self, tryLocsList) {
43
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
44
+ generator = Object.create(protoGenerator.prototype),
45
+ context = new Context(tryLocsList || []);
46
+ return generator._invoke = function (innerFn, self, context) {
47
+ var state = "suspendedStart";
48
+ return function (method, arg) {
49
+ if ("executing" === state) throw new Error("Generator is already running");
50
+
51
+ if ("completed" === state) {
52
+ if ("throw" === method) throw arg;
53
+ return doneResult();
54
+ }
55
+
56
+ for (context.method = method, context.arg = arg;;) {
57
+ var delegate = context.delegate;
58
+
59
+ if (delegate) {
60
+ var delegateResult = maybeInvokeDelegate(delegate, context);
61
+
62
+ if (delegateResult) {
63
+ if (delegateResult === ContinueSentinel) continue;
64
+ return delegateResult;
65
+ }
66
+ }
67
+
68
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
69
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
70
+ context.dispatchException(context.arg);
71
+ } else "return" === context.method && context.abrupt("return", context.arg);
72
+ state = "executing";
73
+ var record = tryCatch(innerFn, self, context);
74
+
75
+ if ("normal" === record.type) {
76
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
77
+ return {
78
+ value: record.arg,
79
+ done: context.done
80
+ };
81
+ }
82
+
83
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
84
+ }
85
+ };
86
+ }(innerFn, self, context), generator;
87
+ }
88
+
89
+ function tryCatch(fn, obj, arg) {
90
+ try {
91
+ return {
92
+ type: "normal",
93
+ arg: fn.call(obj, arg)
94
+ };
95
+ } catch (err) {
96
+ return {
97
+ type: "throw",
98
+ arg: err
99
+ };
100
+ }
101
+ }
102
+
103
+ exports.wrap = wrap;
104
+ var ContinueSentinel = {};
105
+
106
+ function Generator() {}
107
+
108
+ function GeneratorFunction() {}
109
+
110
+ function GeneratorFunctionPrototype() {}
111
+
112
+ var IteratorPrototype = {};
113
+ define(IteratorPrototype, iteratorSymbol, function () {
114
+ return this;
115
+ });
116
+ var getProto = Object.getPrototypeOf,
117
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
118
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
119
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
120
+
121
+ function defineIteratorMethods(prototype) {
122
+ ["next", "throw", "return"].forEach(function (method) {
123
+ define(prototype, method, function (arg) {
124
+ return this._invoke(method, arg);
125
+ });
126
+ });
127
+ }
128
+
129
+ function AsyncIterator(generator, PromiseImpl) {
130
+ function invoke(method, arg, resolve, reject) {
131
+ var record = tryCatch(generator[method], generator, arg);
132
+
133
+ if ("throw" !== record.type) {
134
+ var result = record.arg,
135
+ value = result.value;
136
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
137
+ invoke("next", value, resolve, reject);
138
+ }, function (err) {
139
+ invoke("throw", err, resolve, reject);
140
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
141
+ result.value = unwrapped, resolve(result);
142
+ }, function (error) {
143
+ return invoke("throw", error, resolve, reject);
144
+ });
145
+ }
146
+
147
+ reject(record.arg);
148
+ }
149
+
150
+ var previousPromise;
151
+
152
+ this._invoke = function (method, arg) {
153
+ function callInvokeWithMethodAndArg() {
154
+ return new PromiseImpl(function (resolve, reject) {
155
+ invoke(method, arg, resolve, reject);
156
+ });
157
+ }
158
+
159
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
160
+ };
161
+ }
162
+
163
+ function maybeInvokeDelegate(delegate, context) {
164
+ var method = delegate.iterator[context.method];
165
+
166
+ if (undefined === method) {
167
+ if (context.delegate = null, "throw" === context.method) {
168
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
169
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
170
+ }
171
+
172
+ return ContinueSentinel;
173
+ }
174
+
175
+ var record = tryCatch(method, delegate.iterator, context.arg);
176
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
177
+ var info = record.arg;
178
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
179
+ }
180
+
181
+ function pushTryEntry(locs) {
182
+ var entry = {
183
+ tryLoc: locs[0]
184
+ };
185
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
186
+ }
187
+
188
+ function resetTryEntry(entry) {
189
+ var record = entry.completion || {};
190
+ record.type = "normal", delete record.arg, entry.completion = record;
191
+ }
192
+
193
+ function Context(tryLocsList) {
194
+ this.tryEntries = [{
195
+ tryLoc: "root"
196
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
197
+ }
198
+
199
+ function values(iterable) {
200
+ if (iterable) {
201
+ var iteratorMethod = iterable[iteratorSymbol];
202
+ if (iteratorMethod) return iteratorMethod.call(iterable);
203
+ if ("function" == typeof iterable.next) return iterable;
204
+
205
+ if (!isNaN(iterable.length)) {
206
+ var i = -1,
207
+ next = function next() {
208
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
209
+
210
+ return next.value = undefined, next.done = !0, next;
211
+ };
212
+
213
+ return next.next = next;
214
+ }
215
+ }
216
+
217
+ return {
218
+ next: doneResult
219
+ };
220
+ }
221
+
222
+ function doneResult() {
223
+ return {
224
+ value: undefined,
225
+ done: !0
226
+ };
227
+ }
228
+
229
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
230
+ var ctor = "function" == typeof genFun && genFun.constructor;
231
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
232
+ }, exports.mark = function (genFun) {
233
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
234
+ }, exports.awrap = function (arg) {
235
+ return {
236
+ __await: arg
237
+ };
238
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
239
+ return this;
240
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
241
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
242
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
243
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
244
+ return result.done ? result.value : iter.next();
245
+ });
246
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
247
+ return this;
248
+ }), define(Gp, "toString", function () {
249
+ return "[object Generator]";
250
+ }), exports.keys = function (object) {
251
+ var keys = [];
252
+
253
+ for (var key in object) keys.push(key);
254
+
255
+ return keys.reverse(), function next() {
256
+ for (; keys.length;) {
257
+ var key = keys.pop();
258
+ if (key in object) return next.value = key, next.done = !1, next;
259
+ }
260
+
261
+ return next.done = !0, next;
262
+ };
263
+ }, exports.values = values, Context.prototype = {
264
+ constructor: Context,
265
+ reset: function (skipTempReset) {
266
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
267
+ },
268
+ stop: function () {
269
+ this.done = !0;
270
+ var rootRecord = this.tryEntries[0].completion;
271
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
272
+ return this.rval;
273
+ },
274
+ dispatchException: function (exception) {
275
+ if (this.done) throw exception;
276
+ var context = this;
277
+
278
+ function handle(loc, caught) {
279
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
280
+ }
281
+
282
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
283
+ var entry = this.tryEntries[i],
284
+ record = entry.completion;
285
+ if ("root" === entry.tryLoc) return handle("end");
286
+
287
+ if (entry.tryLoc <= this.prev) {
288
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
289
+ hasFinally = hasOwn.call(entry, "finallyLoc");
290
+
291
+ if (hasCatch && hasFinally) {
292
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
293
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
294
+ } else if (hasCatch) {
295
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
296
+ } else {
297
+ if (!hasFinally) throw new Error("try statement without catch or finally");
298
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
299
+ }
300
+ }
301
+ }
302
+ },
303
+ abrupt: function (type, arg) {
304
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
305
+ var entry = this.tryEntries[i];
306
+
307
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
308
+ var finallyEntry = entry;
309
+ break;
310
+ }
311
+ }
312
+
313
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
314
+ var record = finallyEntry ? finallyEntry.completion : {};
315
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
316
+ },
317
+ complete: function (record, afterLoc) {
318
+ if ("throw" === record.type) throw record.arg;
319
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
320
+ },
321
+ finish: function (finallyLoc) {
322
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
323
+ var entry = this.tryEntries[i];
324
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
325
+ }
326
+ },
327
+ catch: function (tryLoc) {
328
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
329
+ var entry = this.tryEntries[i];
330
+
331
+ if (entry.tryLoc === tryLoc) {
332
+ var record = entry.completion;
333
+
334
+ if ("throw" === record.type) {
335
+ var thrown = record.arg;
336
+ resetTryEntry(entry);
337
+ }
338
+
339
+ return thrown;
340
+ }
341
+ }
342
+
343
+ throw new Error("illegal catch attempt");
344
+ },
345
+ delegateYield: function (iterable, resultName, nextLoc) {
346
+ return this.delegate = {
347
+ iterator: values(iterable),
348
+ resultName: resultName,
349
+ nextLoc: nextLoc
350
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
351
+ }
352
+ }, exports;
353
+ }
354
+
355
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
356
+ try {
357
+ var info = gen[key](arg);
358
+ var value = info.value;
359
+ } catch (error) {
360
+ reject(error);
361
+ return;
362
+ }
363
+
364
+ if (info.done) {
365
+ resolve(value);
366
+ } else {
367
+ Promise.resolve(value).then(_next, _throw);
368
+ }
369
+ }
370
+
371
+ function _asyncToGenerator(fn) {
372
+ return function () {
373
+ var self = this,
374
+ args = arguments;
375
+ return new Promise(function (resolve, reject) {
376
+ var gen = fn.apply(self, args);
377
+
378
+ function _next(value) {
379
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
380
+ }
381
+
382
+ function _throw(err) {
383
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
384
+ }
385
+
386
+ _next(undefined);
387
+ });
388
+ };
389
+ }
390
+
17
391
  function _inheritsLoose(subClass, superClass) {
18
392
  subClass.prototype = Object.create(superClass.prototype);
19
393
  subClass.prototype.constructor = subClass;
@@ -41,45 +415,63 @@ var Canvas2DContextService = /*#__PURE__*/function () {
41
415
 
42
416
  var _proto = Canvas2DContextService.prototype;
43
417
 
44
- _proto.init = function init() {
45
- var _this$canvasConfig = this.canvasConfig,
46
- container = _this$canvasConfig.container,
47
- canvas = _this$canvasConfig.canvas,
48
- devicePixelRatio = _this$canvasConfig.devicePixelRatio;
49
-
50
- if (canvas) {
51
- this.$canvas = canvas;
52
-
53
- if (container && canvas.parentElement !== container) {
54
- container.appendChild(canvas);
55
- }
56
-
57
- this.$container = canvas.parentElement;
58
- this.canvasConfig.container = this.$container;
59
- } else if (container) {
60
- // create container
61
- this.$container = isString(container) ? document.getElementById(container) : container;
62
-
63
- if (this.$container) {
64
- // create canvas
65
- var $canvas = document.createElement('canvas');
66
- this.$container.appendChild($canvas);
67
-
68
- if (!this.$container.style.position) {
69
- this.$container.style.position = 'relative';
418
+ _proto.init = /*#__PURE__*/function () {
419
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
420
+ var _this$canvasConfig, container, canvas, devicePixelRatio, $canvas, dpr;
421
+
422
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
423
+ while (1) {
424
+ switch (_context.prev = _context.next) {
425
+ case 0:
426
+ _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, canvas = _this$canvasConfig.canvas, devicePixelRatio = _this$canvasConfig.devicePixelRatio;
427
+
428
+ if (canvas) {
429
+ this.$canvas = canvas;
430
+
431
+ if (container && canvas.parentElement !== container) {
432
+ container.appendChild(canvas);
433
+ }
434
+
435
+ this.$container = canvas.parentElement;
436
+ this.canvasConfig.container = this.$container;
437
+ } else if (container) {
438
+ // create container
439
+ this.$container = isString(container) ? document.getElementById(container) : container;
440
+
441
+ if (this.$container) {
442
+ // create canvas
443
+ $canvas = document.createElement('canvas');
444
+ this.$container.appendChild($canvas);
445
+
446
+ if (!this.$container.style.position) {
447
+ this.$container.style.position = 'relative';
448
+ }
449
+
450
+ this.$canvas = $canvas;
451
+ }
452
+ }
453
+
454
+ this.context = this.$canvas.getContext('2d'); // use user-defined dpr first
455
+
456
+ dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
457
+ dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
458
+ this.dpr = dpr;
459
+ this.resize(this.canvasConfig.width, this.canvasConfig.height);
460
+
461
+ case 7:
462
+ case "end":
463
+ return _context.stop();
464
+ }
70
465
  }
466
+ }, _callee, this);
467
+ }));
71
468
 
72
- this.$canvas = $canvas;
73
- }
469
+ function init() {
470
+ return _init.apply(this, arguments);
74
471
  }
75
472
 
76
- this.context = this.$canvas.getContext('2d'); // use user-defined dpr first
77
-
78
- var dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
79
- dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
80
- this.dpr = dpr;
81
- this.resize(this.canvasConfig.width, this.canvasConfig.height);
82
- };
473
+ return init;
474
+ }();
83
475
 
84
476
  _proto.getContext = function getContext() {
85
477
  return this.context;
@@ -169,18 +561,22 @@ var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
169
561
 
170
562
  _this = _AbstractRenderer.call(this, config) || this; // register Canvas2DContext
171
563
 
172
- _this.registerPlugin(new ContextRegisterPlugin()); // enable rendering with Canvas2D API
173
-
564
+ _this.registerPlugin(new ContextRegisterPlugin());
174
565
 
175
566
  _this.registerPlugin(new Plugin());
176
567
 
177
- _this.registerPlugin(new Plugin$1()); // enable picking with Canvas2D API
568
+ _this.registerPlugin(new Plugin$1()); // enable rendering with Canvas2D API
569
+
570
+
571
+ _this.registerPlugin(new Plugin$2());
572
+
573
+ _this.registerPlugin(new Plugin$3()); // enable picking with Canvas2D API
178
574
 
179
575
 
180
- _this.registerPlugin(new Plugin$2()); // render HTML component
576
+ _this.registerPlugin(new Plugin$4()); // render HTML component
181
577
 
182
578
 
183
- _this.registerPlugin(new Plugin$3());
579
+ _this.registerPlugin(new Plugin$5());
184
580
 
185
581
  return _this;
186
582
  }