@antv/g-webgpu 1.1.7 → 1.1.8

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