@antv/g-lite 1.0.51 → 1.0.53
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/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/index.esm.js +209 -1012
- package/dist/index.js +210 -1013
- package/dist/index.umd.js +215 -1013
- package/dist/index.umd.min.js +1 -1
- package/dist/services/RenderingService.d.ts +17 -17
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/utils/tapable/AsyncParallelHook.d.ts +4 -4
- package/dist/utils/tapable/AsyncParallelHook.d.ts.map +1 -1
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts +5 -4
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -1
- package/dist/utils/tapable/Hook.d.ts +0 -50
- package/dist/utils/tapable/Hook.d.ts.map +1 -1
- package/dist/utils/tapable/SyncHook.d.ts +5 -4
- package/dist/utils/tapable/SyncHook.d.ts.map +1 -1
- package/dist/utils/tapable/SyncWaterfallHook.d.ts +5 -4
- package/dist/utils/tapable/SyncWaterfallHook.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/utils/tapable/HookCodeFactory.d.ts +0 -47
- package/dist/utils/tapable/HookCodeFactory.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -3239,916 +3239,145 @@ function isFillOrStrokeAffected(pointerEvents, fill, stroke) {
|
|
|
3239
3239
|
return [hasFill, hasStroke];
|
|
3240
3240
|
}
|
|
3241
3241
|
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
// tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
|
|
3246
|
-
// call?: (...args: any[]) => void;
|
|
3247
|
-
// loop?: (...args: any[]) => void;
|
|
3248
|
-
// error?: (err: Error) => void;
|
|
3249
|
-
// result?: (result: R) => void;
|
|
3250
|
-
// done?: () => void;
|
|
3251
|
-
// register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
|
|
3252
|
-
// }
|
|
3253
|
-
// type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
|
|
3254
|
-
// export declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<
|
|
3255
|
-
// T,
|
|
3256
|
-
// R,
|
|
3257
|
-
// AdditionalOptions
|
|
3258
|
-
// > {
|
|
3259
|
-
// tapAsync(
|
|
3260
|
-
// options: string | (Tap & IfSet<AdditionalOptions>),
|
|
3261
|
-
// fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void,
|
|
3262
|
-
// ): void;
|
|
3263
|
-
// tapPromise(
|
|
3264
|
-
// options: string | (Tap & IfSet<AdditionalOptions>),
|
|
3265
|
-
// fn: (...args: AsArray<T>) => Promise<R>,
|
|
3266
|
-
// ): void;
|
|
3267
|
-
// }
|
|
3268
|
-
var CALL_DELEGATE = function CALL_DELEGATE() {
|
|
3269
|
-
this.call = this._createCall('sync');
|
|
3270
|
-
return this.call.apply(this, arguments);
|
|
3271
|
-
};
|
|
3272
|
-
var CALL_ASYNC_DELEGATE = function CALL_ASYNC_DELEGATE() {
|
|
3273
|
-
this.callAsync = this._createCall('async');
|
|
3274
|
-
return this.callAsync.apply(this, arguments);
|
|
3275
|
-
};
|
|
3276
|
-
var PROMISE_DELEGATE = function PROMISE_DELEGATE() {
|
|
3277
|
-
this.promise = this._createCall('promise');
|
|
3278
|
-
return this.promise.apply(this, arguments);
|
|
3279
|
-
};
|
|
3280
|
-
var Hook = /*#__PURE__*/function () {
|
|
3281
|
-
function Hook(args, name) {
|
|
3282
|
-
if (args === void 0) {
|
|
3283
|
-
args = [];
|
|
3284
|
-
}
|
|
3285
|
-
if (name === void 0) {
|
|
3286
|
-
name = undefined;
|
|
3287
|
-
}
|
|
3288
|
-
this.name = void 0;
|
|
3289
|
-
this.taps = void 0;
|
|
3290
|
-
this.promise = void 0;
|
|
3291
|
-
this._promise = void 0;
|
|
3292
|
-
this._args = args;
|
|
3293
|
-
this.name = name;
|
|
3294
|
-
this.taps = [];
|
|
3295
|
-
this.interceptors = [];
|
|
3296
|
-
this._call = CALL_DELEGATE;
|
|
3297
|
-
this.call = CALL_DELEGATE;
|
|
3298
|
-
this._callAsync = CALL_ASYNC_DELEGATE;
|
|
3299
|
-
this.callAsync = CALL_ASYNC_DELEGATE;
|
|
3300
|
-
this._promise = PROMISE_DELEGATE;
|
|
3301
|
-
this.promise = PROMISE_DELEGATE;
|
|
3302
|
-
this._x = undefined;
|
|
3303
|
-
// this.compile = this.compile;
|
|
3304
|
-
// this.tap = this.tap;
|
|
3305
|
-
// this.tapAsync = this.tapAsync;
|
|
3306
|
-
// this.tapPromise = this.tapPromise;
|
|
3307
|
-
}
|
|
3308
|
-
var _proto = Hook.prototype;
|
|
3309
|
-
_proto.compile = function compile(options) {
|
|
3310
|
-
throw new Error('Abstract: should be overridden');
|
|
3311
|
-
};
|
|
3312
|
-
_proto._createCall = function _createCall(type) {
|
|
3313
|
-
return this.compile({
|
|
3314
|
-
taps: this.taps,
|
|
3315
|
-
interceptors: this.interceptors,
|
|
3316
|
-
args: this._args,
|
|
3317
|
-
type: type
|
|
3318
|
-
});
|
|
3319
|
-
};
|
|
3320
|
-
_proto._tap = function _tap(type, options, fn) {
|
|
3321
|
-
if (typeof options === 'string') {
|
|
3322
|
-
options = {
|
|
3323
|
-
name: options.trim()
|
|
3324
|
-
};
|
|
3325
|
-
} else if (typeof options !== 'object' || options === null) {
|
|
3326
|
-
throw new Error('Invalid tap options');
|
|
3327
|
-
}
|
|
3328
|
-
if (typeof options.name !== 'string' || options.name === '') {
|
|
3329
|
-
throw new Error('Missing name for tap');
|
|
3330
|
-
}
|
|
3331
|
-
// if (typeof options.context !== "undefined") {
|
|
3332
|
-
// deprecateContext();
|
|
3333
|
-
// }
|
|
3334
|
-
options = Object.assign({
|
|
3335
|
-
type: type,
|
|
3336
|
-
fn: fn
|
|
3337
|
-
}, options);
|
|
3338
|
-
options = this._runRegisterInterceptors(options);
|
|
3339
|
-
this._insert(options);
|
|
3340
|
-
};
|
|
3341
|
-
_proto.tap = function tap(options, fn) {
|
|
3342
|
-
this._tap('sync', options, fn);
|
|
3343
|
-
};
|
|
3344
|
-
_proto.tapAsync = function tapAsync(options, fn) {
|
|
3345
|
-
this._tap('async', options, fn);
|
|
3346
|
-
};
|
|
3347
|
-
_proto.tapPromise = function tapPromise(options, fn) {
|
|
3348
|
-
this._tap('promise', options, fn);
|
|
3349
|
-
};
|
|
3350
|
-
_proto._runRegisterInterceptors = function _runRegisterInterceptors(options) {
|
|
3351
|
-
for (var _iterator = _createForOfIteratorHelperLoose(this.interceptors), _step; !(_step = _iterator()).done;) {
|
|
3352
|
-
var interceptor = _step.value;
|
|
3353
|
-
if (interceptor.register) {
|
|
3354
|
-
var newOptions = interceptor.register(options);
|
|
3355
|
-
if (newOptions !== undefined) {
|
|
3356
|
-
options = newOptions;
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
}
|
|
3360
|
-
return options;
|
|
3361
|
-
};
|
|
3362
|
-
_proto.withOptions = function withOptions(options) {
|
|
3363
|
-
var _this = this;
|
|
3364
|
-
var mergeOptions = function mergeOptions(opt) {
|
|
3365
|
-
return Object.assign({}, options, typeof opt === 'string' ? {
|
|
3366
|
-
name: opt
|
|
3367
|
-
} : opt);
|
|
3368
|
-
};
|
|
3369
|
-
return {
|
|
3370
|
-
name: this.name,
|
|
3371
|
-
tap: function tap(opt, fn) {
|
|
3372
|
-
return _this.tap(mergeOptions(opt), fn);
|
|
3373
|
-
},
|
|
3374
|
-
tapAsync: function tapAsync(opt, fn) {
|
|
3375
|
-
return _this.tapAsync(mergeOptions(opt), fn);
|
|
3376
|
-
},
|
|
3377
|
-
tapPromise: function tapPromise(opt, fn) {
|
|
3378
|
-
return _this.tapPromise(mergeOptions(opt), fn);
|
|
3379
|
-
},
|
|
3380
|
-
// intercept: (interceptor) => this.intercept(interceptor),
|
|
3381
|
-
isUsed: function isUsed() {
|
|
3382
|
-
return _this.isUsed();
|
|
3383
|
-
},
|
|
3384
|
-
withOptions: function withOptions(opt) {
|
|
3385
|
-
return _this.withOptions(mergeOptions(opt));
|
|
3386
|
-
}
|
|
3387
|
-
};
|
|
3388
|
-
};
|
|
3389
|
-
_proto.isUsed = function isUsed() {
|
|
3390
|
-
return this.taps.length > 0 || this.interceptors.length > 0;
|
|
3242
|
+
var AsyncParallelHook = /*#__PURE__*/function () {
|
|
3243
|
+
function AsyncParallelHook() {
|
|
3244
|
+
this.callbacks = [];
|
|
3391
3245
|
}
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
var stage = 0;
|
|
3416
|
-
if (typeof item.stage === 'number') {
|
|
3417
|
-
stage = item.stage;
|
|
3418
|
-
}
|
|
3419
|
-
var i = this.taps.length;
|
|
3420
|
-
while (i > 0) {
|
|
3421
|
-
i--;
|
|
3422
|
-
var x = this.taps[i];
|
|
3423
|
-
this.taps[i + 1] = x;
|
|
3424
|
-
var xStage = x.stage || 0;
|
|
3425
|
-
if (before) {
|
|
3426
|
-
if (before.has(x.name)) {
|
|
3427
|
-
before.delete(x.name);
|
|
3428
|
-
continue;
|
|
3429
|
-
}
|
|
3430
|
-
if (before.size > 0) {
|
|
3431
|
-
continue;
|
|
3246
|
+
var _proto = AsyncParallelHook.prototype;
|
|
3247
|
+
_proto.tapPromise = function tapPromise(options, fn) {
|
|
3248
|
+
this.callbacks.push(fn);
|
|
3249
|
+
};
|
|
3250
|
+
_proto.promise = /*#__PURE__*/function () {
|
|
3251
|
+
var _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3252
|
+
var _len,
|
|
3253
|
+
args,
|
|
3254
|
+
_key,
|
|
3255
|
+
_args = arguments;
|
|
3256
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3257
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3258
|
+
case 0:
|
|
3259
|
+
for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3260
|
+
args[_key] = _args[_key];
|
|
3261
|
+
}
|
|
3262
|
+
_context.next = 3;
|
|
3263
|
+
return Promise.all(this.callbacks.map(function (callback) {
|
|
3264
|
+
return callback.apply(void 0, args);
|
|
3265
|
+
}));
|
|
3266
|
+
case 3:
|
|
3267
|
+
case "end":
|
|
3268
|
+
return _context.stop();
|
|
3432
3269
|
}
|
|
3433
|
-
}
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
i++;
|
|
3438
|
-
break;
|
|
3270
|
+
}, _callee, this);
|
|
3271
|
+
}));
|
|
3272
|
+
function promise() {
|
|
3273
|
+
return _promise.apply(this, arguments);
|
|
3439
3274
|
}
|
|
3440
|
-
|
|
3441
|
-
};
|
|
3442
|
-
return
|
|
3275
|
+
return promise;
|
|
3276
|
+
}();
|
|
3277
|
+
return AsyncParallelHook;
|
|
3443
3278
|
}();
|
|
3444
|
-
// Object.setPrototypeOf(Hook.prototype, null);
|
|
3445
3279
|
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
this.config = config;
|
|
3450
|
-
this.options = undefined;
|
|
3451
|
-
this._args = undefined;
|
|
3452
|
-
}
|
|
3453
|
-
var _proto = HookCodeFactory.prototype;
|
|
3454
|
-
_proto.create = function create(options) {
|
|
3455
|
-
this.init(options);
|
|
3456
|
-
var fn;
|
|
3457
|
-
switch (this.options.type) {
|
|
3458
|
-
case 'sync':
|
|
3459
|
-
fn = new Function(this.args(), '"use strict";\n' + this.header() + this.contentWithInterceptors({
|
|
3460
|
-
onError: function onError(err) {
|
|
3461
|
-
return "throw " + err + ";\n";
|
|
3462
|
-
},
|
|
3463
|
-
onResult: function onResult(result) {
|
|
3464
|
-
return "return " + result + ";\n";
|
|
3465
|
-
},
|
|
3466
|
-
resultReturns: true,
|
|
3467
|
-
onDone: function onDone() {
|
|
3468
|
-
return '';
|
|
3469
|
-
},
|
|
3470
|
-
rethrowIfPossible: true
|
|
3471
|
-
}));
|
|
3472
|
-
break;
|
|
3473
|
-
case 'async':
|
|
3474
|
-
fn = new Function(this.args({
|
|
3475
|
-
after: '_callback'
|
|
3476
|
-
}), '"use strict";\n' + this.header() + this.contentWithInterceptors({
|
|
3477
|
-
onError: function onError(err) {
|
|
3478
|
-
return "_callback(" + err + ");\n";
|
|
3479
|
-
},
|
|
3480
|
-
onResult: function onResult(result) {
|
|
3481
|
-
return "_callback(null, " + result + ");\n";
|
|
3482
|
-
},
|
|
3483
|
-
onDone: function onDone() {
|
|
3484
|
-
return '_callback();\n';
|
|
3485
|
-
}
|
|
3486
|
-
}));
|
|
3487
|
-
break;
|
|
3488
|
-
case 'promise':
|
|
3489
|
-
var errorHelperUsed = false;
|
|
3490
|
-
var content = this.contentWithInterceptors({
|
|
3491
|
-
onError: function onError(err) {
|
|
3492
|
-
errorHelperUsed = true;
|
|
3493
|
-
return "_error(" + err + ");\n";
|
|
3494
|
-
},
|
|
3495
|
-
onResult: function onResult(result) {
|
|
3496
|
-
return "_resolve(" + result + ");\n";
|
|
3497
|
-
},
|
|
3498
|
-
onDone: function onDone() {
|
|
3499
|
-
return '_resolve();\n';
|
|
3500
|
-
}
|
|
3501
|
-
});
|
|
3502
|
-
var code = '';
|
|
3503
|
-
code += '"use strict";\n';
|
|
3504
|
-
code += this.header();
|
|
3505
|
-
code += 'return new Promise((function(_resolve, _reject) {\n';
|
|
3506
|
-
if (errorHelperUsed) {
|
|
3507
|
-
code += 'var _sync = true;\n';
|
|
3508
|
-
code += 'function _error(_err) {\n';
|
|
3509
|
-
code += 'if(_sync)\n';
|
|
3510
|
-
code += '_resolve(Promise.resolve().then((function() { throw _err; })));\n';
|
|
3511
|
-
code += 'else\n';
|
|
3512
|
-
code += '_reject(_err);\n';
|
|
3513
|
-
code += '};\n';
|
|
3514
|
-
}
|
|
3515
|
-
code += content;
|
|
3516
|
-
if (errorHelperUsed) {
|
|
3517
|
-
code += '_sync = false;\n';
|
|
3518
|
-
}
|
|
3519
|
-
code += '}));\n';
|
|
3520
|
-
fn = new Function(this.args(), code);
|
|
3521
|
-
break;
|
|
3522
|
-
}
|
|
3523
|
-
this.deinit();
|
|
3524
|
-
return fn;
|
|
3525
|
-
};
|
|
3526
|
-
_proto.setup = function setup(instance, options) {
|
|
3527
|
-
instance._x = options.taps.map(function (t) {
|
|
3528
|
-
return t.fn;
|
|
3529
|
-
});
|
|
3280
|
+
var AsyncSeriesWaterfallHook = /*#__PURE__*/function () {
|
|
3281
|
+
function AsyncSeriesWaterfallHook() {
|
|
3282
|
+
this.callbacks = [];
|
|
3530
3283
|
}
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
var code = '';
|
|
3549
|
-
for (var i = 0; i < this.options.interceptors.length; i++) {
|
|
3550
|
-
var interceptor = this.options.interceptors[i];
|
|
3551
|
-
if (interceptor.call) {
|
|
3552
|
-
code += this.getInterceptor(i) + ".call(" + this.args({
|
|
3553
|
-
before: interceptor.context ? '_context' : undefined
|
|
3554
|
-
}) + ");\n";
|
|
3555
|
-
}
|
|
3556
|
-
}
|
|
3557
|
-
code += this.content(Object.assign(options, {
|
|
3558
|
-
onError: onError && function (err) {
|
|
3559
|
-
var code = '';
|
|
3560
|
-
for (var _i = 0; _i < _this.options.interceptors.length; _i++) {
|
|
3561
|
-
var _interceptor = _this.options.interceptors[_i];
|
|
3562
|
-
if (_interceptor.error) {
|
|
3563
|
-
code += _this.getInterceptor(_i) + ".error(" + err + ");\n";
|
|
3564
|
-
}
|
|
3565
|
-
}
|
|
3566
|
-
code += onError(err);
|
|
3567
|
-
return code;
|
|
3568
|
-
},
|
|
3569
|
-
onResult: onResult && function (result) {
|
|
3570
|
-
var code = '';
|
|
3571
|
-
for (var _i2 = 0; _i2 < _this.options.interceptors.length; _i2++) {
|
|
3572
|
-
var _interceptor2 = _this.options.interceptors[_i2];
|
|
3573
|
-
if (_interceptor2.result) {
|
|
3574
|
-
code += _this.getInterceptor(_i2) + ".result(" + result + ");\n";
|
|
3284
|
+
var _proto = AsyncSeriesWaterfallHook.prototype;
|
|
3285
|
+
_proto.tapPromise = function tapPromise(options, fn) {
|
|
3286
|
+
this.callbacks.push(fn);
|
|
3287
|
+
};
|
|
3288
|
+
_proto.promise = /*#__PURE__*/function () {
|
|
3289
|
+
var _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3290
|
+
var _this$callbacks,
|
|
3291
|
+
result,
|
|
3292
|
+
i,
|
|
3293
|
+
callback,
|
|
3294
|
+
_args = arguments;
|
|
3295
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3296
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3297
|
+
case 0:
|
|
3298
|
+
if (!this.callbacks.length) {
|
|
3299
|
+
_context.next = 14;
|
|
3300
|
+
break;
|
|
3575
3301
|
}
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
code += _this.getInterceptor(_i3) + ".done();\n";
|
|
3302
|
+
_context.next = 3;
|
|
3303
|
+
return (_this$callbacks = this.callbacks)[0].apply(_this$callbacks, _args);
|
|
3304
|
+
case 3:
|
|
3305
|
+
result = _context.sent;
|
|
3306
|
+
i = 0;
|
|
3307
|
+
case 5:
|
|
3308
|
+
if (!(i < this.callbacks.length - 1)) {
|
|
3309
|
+
_context.next = 13;
|
|
3310
|
+
break;
|
|
3586
3311
|
}
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
}
|
|
3604
|
-
code += 'var _x = this._x;\n';
|
|
3605
|
-
if (this.options.interceptors.length > 0) {
|
|
3606
|
-
code += 'var _taps = this.taps;\n';
|
|
3607
|
-
code += 'var _interceptors = this.interceptors;\n';
|
|
3608
|
-
}
|
|
3609
|
-
return code;
|
|
3610
|
-
};
|
|
3611
|
-
_proto.needContext = function needContext() {
|
|
3612
|
-
for (var _iterator = _createForOfIteratorHelperLoose(this.options.taps), _step; !(_step = _iterator()).done;) {
|
|
3613
|
-
var tap = _step.value;
|
|
3614
|
-
if (tap.context) return true;
|
|
3615
|
-
}
|
|
3616
|
-
return false;
|
|
3617
|
-
};
|
|
3618
|
-
_proto.callTap = function callTap(tapIndex, _ref) {
|
|
3619
|
-
var onError = _ref.onError,
|
|
3620
|
-
onResult = _ref.onResult,
|
|
3621
|
-
onDone = _ref.onDone,
|
|
3622
|
-
rethrowIfPossible = _ref.rethrowIfPossible;
|
|
3623
|
-
var code = '';
|
|
3624
|
-
var hasTapCached = false;
|
|
3625
|
-
for (var i = 0; i < this.options.interceptors.length; i++) {
|
|
3626
|
-
var interceptor = this.options.interceptors[i];
|
|
3627
|
-
if (interceptor.tap) {
|
|
3628
|
-
if (!hasTapCached) {
|
|
3629
|
-
code += "var _tap" + tapIndex + " = " + this.getTap(tapIndex) + ";\n";
|
|
3630
|
-
hasTapCached = true;
|
|
3631
|
-
}
|
|
3632
|
-
code += this.getInterceptor(i) + ".tap(" + (interceptor.context ? '_context, ' : '') + "_tap" + tapIndex + ");\n";
|
|
3633
|
-
}
|
|
3634
|
-
}
|
|
3635
|
-
code += "var _fn" + tapIndex + " = " + this.getTapFn(tapIndex) + ";\n";
|
|
3636
|
-
var tap = this.options.taps[tapIndex];
|
|
3637
|
-
switch (tap.type) {
|
|
3638
|
-
case 'sync':
|
|
3639
|
-
if (!rethrowIfPossible) {
|
|
3640
|
-
code += "var _hasError" + tapIndex + " = false;\n";
|
|
3641
|
-
code += 'try {\n';
|
|
3642
|
-
}
|
|
3643
|
-
if (onResult) {
|
|
3644
|
-
code += "var _result" + tapIndex + " = _fn" + tapIndex + "(" + this.args({
|
|
3645
|
-
before: tap.context ? '_context' : undefined
|
|
3646
|
-
}) + ");\n";
|
|
3647
|
-
} else {
|
|
3648
|
-
code += "_fn" + tapIndex + "(" + this.args({
|
|
3649
|
-
before: tap.context ? '_context' : undefined
|
|
3650
|
-
}) + ");\n";
|
|
3651
|
-
}
|
|
3652
|
-
if (!rethrowIfPossible) {
|
|
3653
|
-
code += '} catch(_err) {\n';
|
|
3654
|
-
code += "_hasError" + tapIndex + " = true;\n";
|
|
3655
|
-
code += onError('_err');
|
|
3656
|
-
code += '}\n';
|
|
3657
|
-
code += "if(!_hasError" + tapIndex + ") {\n";
|
|
3658
|
-
}
|
|
3659
|
-
if (onResult) {
|
|
3660
|
-
code += onResult("_result" + tapIndex);
|
|
3661
|
-
}
|
|
3662
|
-
if (onDone) {
|
|
3663
|
-
code += onDone();
|
|
3664
|
-
}
|
|
3665
|
-
if (!rethrowIfPossible) {
|
|
3666
|
-
code += '}\n';
|
|
3667
|
-
}
|
|
3668
|
-
break;
|
|
3669
|
-
case 'async':
|
|
3670
|
-
var cbCode = '';
|
|
3671
|
-
if (onResult) cbCode += "(function(_err" + tapIndex + ", _result" + tapIndex + ") {\n";else cbCode += "(function(_err" + tapIndex + ") {\n";
|
|
3672
|
-
cbCode += "if(_err" + tapIndex + ") {\n";
|
|
3673
|
-
cbCode += onError("_err" + tapIndex);
|
|
3674
|
-
cbCode += '} else {\n';
|
|
3675
|
-
if (onResult) {
|
|
3676
|
-
cbCode += onResult("_result" + tapIndex);
|
|
3677
|
-
}
|
|
3678
|
-
if (onDone) {
|
|
3679
|
-
cbCode += onDone();
|
|
3680
|
-
}
|
|
3681
|
-
cbCode += '}\n';
|
|
3682
|
-
cbCode += '})';
|
|
3683
|
-
code += "_fn" + tapIndex + "(" + this.args({
|
|
3684
|
-
before: tap.context ? '_context' : undefined,
|
|
3685
|
-
after: cbCode
|
|
3686
|
-
}) + ");\n";
|
|
3687
|
-
break;
|
|
3688
|
-
case 'promise':
|
|
3689
|
-
code += "var _hasResult" + tapIndex + " = false;\n";
|
|
3690
|
-
code += "var _promise" + tapIndex + " = _fn" + tapIndex + "(" + this.args({
|
|
3691
|
-
before: tap.context ? '_context' : undefined
|
|
3692
|
-
}) + ");\n";
|
|
3693
|
-
code += "if (!_promise" + tapIndex + " || !_promise" + tapIndex + ".then)\n";
|
|
3694
|
-
code += " throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise" + tapIndex + " + ')');\n";
|
|
3695
|
-
code += "_promise" + tapIndex + ".then((function(_result" + tapIndex + ") {\n";
|
|
3696
|
-
code += "_hasResult" + tapIndex + " = true;\n";
|
|
3697
|
-
if (onResult) {
|
|
3698
|
-
code += onResult("_result" + tapIndex);
|
|
3699
|
-
}
|
|
3700
|
-
if (onDone) {
|
|
3701
|
-
code += onDone();
|
|
3312
|
+
callback = this.callbacks[i]; // @ts-ignore
|
|
3313
|
+
_context.next = 9;
|
|
3314
|
+
return callback(result);
|
|
3315
|
+
case 9:
|
|
3316
|
+
result = _context.sent;
|
|
3317
|
+
case 10:
|
|
3318
|
+
i++;
|
|
3319
|
+
_context.next = 5;
|
|
3320
|
+
break;
|
|
3321
|
+
case 13:
|
|
3322
|
+
return _context.abrupt("return", result);
|
|
3323
|
+
case 14:
|
|
3324
|
+
return _context.abrupt("return", null);
|
|
3325
|
+
case 15:
|
|
3326
|
+
case "end":
|
|
3327
|
+
return _context.stop();
|
|
3702
3328
|
}
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
break;
|
|
3708
|
-
}
|
|
3709
|
-
return code;
|
|
3710
|
-
};
|
|
3711
|
-
_proto.callTapsSeries = function callTapsSeries(_ref2) {
|
|
3712
|
-
var _this2 = this;
|
|
3713
|
-
var _onError = _ref2.onError,
|
|
3714
|
-
onResult = _ref2.onResult,
|
|
3715
|
-
resultReturns = _ref2.resultReturns,
|
|
3716
|
-
onDone = _ref2.onDone,
|
|
3717
|
-
doneReturns = _ref2.doneReturns,
|
|
3718
|
-
rethrowIfPossible = _ref2.rethrowIfPossible;
|
|
3719
|
-
if (this.options.taps.length === 0) return onDone();
|
|
3720
|
-
var firstAsync = this.options.taps.findIndex(function (t) {
|
|
3721
|
-
return t.type !== 'sync';
|
|
3722
|
-
});
|
|
3723
|
-
var somethingReturns = resultReturns || doneReturns;
|
|
3724
|
-
var code = '';
|
|
3725
|
-
var current = onDone;
|
|
3726
|
-
var unrollCounter = 0;
|
|
3727
|
-
var _loop = function _loop() {
|
|
3728
|
-
var i = j;
|
|
3729
|
-
var unroll = current !== onDone && (_this2.options.taps[i].type !== 'sync' || unrollCounter++ > 20);
|
|
3730
|
-
if (unroll) {
|
|
3731
|
-
unrollCounter = 0;
|
|
3732
|
-
code += "function _next" + i + "() {\n";
|
|
3733
|
-
code += current();
|
|
3734
|
-
code += "}\n";
|
|
3735
|
-
current = function current() {
|
|
3736
|
-
return (somethingReturns ? 'return ' : '') + "_next" + i + "();\n";
|
|
3737
|
-
};
|
|
3738
|
-
}
|
|
3739
|
-
var done = current;
|
|
3740
|
-
var doneBreak = function doneBreak(skipDone) {
|
|
3741
|
-
if (skipDone) return '';
|
|
3742
|
-
return onDone();
|
|
3743
|
-
};
|
|
3744
|
-
var content = _this2.callTap(i, {
|
|
3745
|
-
onError: function onError(error) {
|
|
3746
|
-
return _onError(i, error, done, doneBreak);
|
|
3747
|
-
},
|
|
3748
|
-
onResult: onResult && function (result) {
|
|
3749
|
-
return onResult(i, result, done, doneBreak);
|
|
3750
|
-
},
|
|
3751
|
-
onDone: !onResult && done,
|
|
3752
|
-
rethrowIfPossible: rethrowIfPossible && (firstAsync < 0 || i < firstAsync)
|
|
3753
|
-
});
|
|
3754
|
-
current = function current() {
|
|
3755
|
-
return content;
|
|
3756
|
-
};
|
|
3757
|
-
};
|
|
3758
|
-
for (var j = this.options.taps.length - 1; j >= 0; j--) {
|
|
3759
|
-
_loop();
|
|
3760
|
-
}
|
|
3761
|
-
code += current();
|
|
3762
|
-
return code;
|
|
3763
|
-
};
|
|
3764
|
-
_proto.callTapsLooping = function callTapsLooping(_ref3) {
|
|
3765
|
-
var onError = _ref3.onError,
|
|
3766
|
-
onDone = _ref3.onDone,
|
|
3767
|
-
rethrowIfPossible = _ref3.rethrowIfPossible;
|
|
3768
|
-
if (this.options.taps.length === 0) return onDone();
|
|
3769
|
-
var syncOnly = this.options.taps.every(function (t) {
|
|
3770
|
-
return t.type === 'sync';
|
|
3771
|
-
});
|
|
3772
|
-
var code = '';
|
|
3773
|
-
if (!syncOnly) {
|
|
3774
|
-
code += 'var _looper = (function() {\n';
|
|
3775
|
-
code += 'var _loopAsync = false;\n';
|
|
3776
|
-
}
|
|
3777
|
-
code += 'var _loop;\n';
|
|
3778
|
-
code += 'do {\n';
|
|
3779
|
-
code += '_loop = false;\n';
|
|
3780
|
-
for (var i = 0; i < this.options.interceptors.length; i++) {
|
|
3781
|
-
var interceptor = this.options.interceptors[i];
|
|
3782
|
-
if (interceptor.loop) {
|
|
3783
|
-
code += this.getInterceptor(i) + ".loop(" + this.args({
|
|
3784
|
-
before: interceptor.context ? '_context' : undefined
|
|
3785
|
-
}) + ");\n";
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
code += this.callTapsSeries({
|
|
3789
|
-
onError: onError,
|
|
3790
|
-
onResult: function onResult(i, result, next, doneBreak) {
|
|
3791
|
-
var code = '';
|
|
3792
|
-
code += "if(" + result + " !== undefined) {\n";
|
|
3793
|
-
code += '_loop = true;\n';
|
|
3794
|
-
if (!syncOnly) code += 'if(_loopAsync) _looper();\n';
|
|
3795
|
-
code += doneBreak(true);
|
|
3796
|
-
code += "} else {\n";
|
|
3797
|
-
code += next();
|
|
3798
|
-
code += "}\n";
|
|
3799
|
-
return code;
|
|
3800
|
-
},
|
|
3801
|
-
onDone: onDone && function () {
|
|
3802
|
-
var code = '';
|
|
3803
|
-
code += 'if(!_loop) {\n';
|
|
3804
|
-
code += onDone();
|
|
3805
|
-
code += '}\n';
|
|
3806
|
-
return code;
|
|
3807
|
-
},
|
|
3808
|
-
rethrowIfPossible: rethrowIfPossible && syncOnly
|
|
3809
|
-
});
|
|
3810
|
-
code += '} while(_loop);\n';
|
|
3811
|
-
if (!syncOnly) {
|
|
3812
|
-
code += '_loopAsync = true;\n';
|
|
3813
|
-
code += '});\n';
|
|
3814
|
-
code += '_looper();\n';
|
|
3815
|
-
}
|
|
3816
|
-
return code;
|
|
3817
|
-
};
|
|
3818
|
-
_proto.callTapsParallel = function callTapsParallel(_ref4) {
|
|
3819
|
-
var _this3 = this;
|
|
3820
|
-
var _onError2 = _ref4.onError,
|
|
3821
|
-
onResult = _ref4.onResult,
|
|
3822
|
-
onDone = _ref4.onDone,
|
|
3823
|
-
rethrowIfPossible = _ref4.rethrowIfPossible,
|
|
3824
|
-
_ref4$onTap = _ref4.onTap,
|
|
3825
|
-
onTap = _ref4$onTap === void 0 ? function (i, run) {
|
|
3826
|
-
return run();
|
|
3827
|
-
} : _ref4$onTap;
|
|
3828
|
-
if (this.options.taps.length <= 1) {
|
|
3829
|
-
return this.callTapsSeries({
|
|
3830
|
-
onError: _onError2,
|
|
3831
|
-
onResult: onResult,
|
|
3832
|
-
onDone: onDone,
|
|
3833
|
-
rethrowIfPossible: rethrowIfPossible
|
|
3834
|
-
});
|
|
3835
|
-
}
|
|
3836
|
-
var code = '';
|
|
3837
|
-
code += 'do {\n';
|
|
3838
|
-
code += "var _counter = " + this.options.taps.length + ";\n";
|
|
3839
|
-
if (onDone) {
|
|
3840
|
-
code += 'var _done = (function() {\n';
|
|
3841
|
-
code += onDone();
|
|
3842
|
-
code += '});\n';
|
|
3843
|
-
}
|
|
3844
|
-
var _loop2 = function _loop2(i) {
|
|
3845
|
-
var done = function done() {
|
|
3846
|
-
if (onDone) return 'if(--_counter === 0) _done();\n';else return '--_counter;';
|
|
3847
|
-
};
|
|
3848
|
-
var doneBreak = function doneBreak(skipDone) {
|
|
3849
|
-
if (skipDone || !onDone) return '_counter = 0;\n';else return '_counter = 0;\n_done();\n';
|
|
3850
|
-
};
|
|
3851
|
-
code += 'if(_counter <= 0) break;\n';
|
|
3852
|
-
code += onTap(i, function () {
|
|
3853
|
-
return _this3.callTap(i, {
|
|
3854
|
-
onError: function onError(error) {
|
|
3855
|
-
var code = '';
|
|
3856
|
-
code += 'if(_counter > 0) {\n';
|
|
3857
|
-
code += _onError2(i, error, done, doneBreak);
|
|
3858
|
-
code += '}\n';
|
|
3859
|
-
return code;
|
|
3860
|
-
},
|
|
3861
|
-
onResult: onResult && function (result) {
|
|
3862
|
-
var code = '';
|
|
3863
|
-
code += 'if(_counter > 0) {\n';
|
|
3864
|
-
code += onResult(i, result, done, doneBreak);
|
|
3865
|
-
code += '}\n';
|
|
3866
|
-
return code;
|
|
3867
|
-
},
|
|
3868
|
-
onDone: !onResult && function () {
|
|
3869
|
-
return done();
|
|
3870
|
-
},
|
|
3871
|
-
rethrowIfPossible: rethrowIfPossible
|
|
3872
|
-
});
|
|
3873
|
-
}, done, doneBreak);
|
|
3874
|
-
};
|
|
3875
|
-
for (var i = 0; i < this.options.taps.length; i++) {
|
|
3876
|
-
_loop2(i);
|
|
3877
|
-
}
|
|
3878
|
-
code += '} while(false);\n';
|
|
3879
|
-
return code;
|
|
3880
|
-
};
|
|
3881
|
-
_proto.args = function args(_temp) {
|
|
3882
|
-
var _ref5 = _temp === void 0 ? {} : _temp,
|
|
3883
|
-
before = _ref5.before,
|
|
3884
|
-
after = _ref5.after;
|
|
3885
|
-
var allArgs = this._args;
|
|
3886
|
-
if (before) allArgs = [before].concat(allArgs);
|
|
3887
|
-
if (after) allArgs = allArgs.concat(after);
|
|
3888
|
-
if (allArgs.length === 0) {
|
|
3889
|
-
return '';
|
|
3890
|
-
} else {
|
|
3891
|
-
return allArgs.join(', ');
|
|
3329
|
+
}, _callee, this);
|
|
3330
|
+
}));
|
|
3331
|
+
function promise() {
|
|
3332
|
+
return _promise.apply(this, arguments);
|
|
3892
3333
|
}
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
};
|
|
3897
|
-
_proto.getTap = function getTap(idx) {
|
|
3898
|
-
return "_taps[" + idx + "]";
|
|
3899
|
-
};
|
|
3900
|
-
_proto.getInterceptor = function getInterceptor(idx) {
|
|
3901
|
-
return "_interceptors[" + idx + "]";
|
|
3902
|
-
};
|
|
3903
|
-
return HookCodeFactory;
|
|
3334
|
+
return promise;
|
|
3335
|
+
}();
|
|
3336
|
+
return AsyncSeriesWaterfallHook;
|
|
3904
3337
|
}();
|
|
3905
3338
|
|
|
3906
|
-
var
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
return _HookCodeFactory.apply(this, arguments) || this;
|
|
3910
|
-
}
|
|
3911
|
-
var _proto = AsyncParallelHookCodeFactory.prototype;
|
|
3912
|
-
_proto.content = function content(_ref) {
|
|
3913
|
-
var _onError = _ref.onError,
|
|
3914
|
-
onDone = _ref.onDone;
|
|
3915
|
-
return this.callTapsParallel({
|
|
3916
|
-
onError: function onError(i, err, done, doneBreak) {
|
|
3917
|
-
return _onError(err) + doneBreak(true);
|
|
3918
|
-
},
|
|
3919
|
-
onDone: onDone
|
|
3920
|
-
});
|
|
3921
|
-
};
|
|
3922
|
-
return AsyncParallelHookCodeFactory;
|
|
3923
|
-
}(HookCodeFactory);
|
|
3924
|
-
var factory = new AsyncParallelHookCodeFactory();
|
|
3925
|
-
var COMPILE = function COMPILE(options) {
|
|
3926
|
-
factory.setup(this, options);
|
|
3927
|
-
return factory.create(options);
|
|
3928
|
-
};
|
|
3929
|
-
var AsyncParallelHook = /*#__PURE__*/function (_Hook) {
|
|
3930
|
-
_inheritsLoose(AsyncParallelHook, _Hook);
|
|
3931
|
-
function AsyncParallelHook(args, name) {
|
|
3932
|
-
var _this;
|
|
3933
|
-
if (args === void 0) {
|
|
3934
|
-
args = [];
|
|
3935
|
-
}
|
|
3936
|
-
if (name === void 0) {
|
|
3937
|
-
name = undefined;
|
|
3938
|
-
}
|
|
3939
|
-
_this = _Hook.call(this, args, name) || this;
|
|
3940
|
-
_this.compile = COMPILE;
|
|
3941
|
-
_this._call = undefined;
|
|
3942
|
-
_this.call = undefined;
|
|
3943
|
-
return _this;
|
|
3944
|
-
}
|
|
3945
|
-
return AsyncParallelHook;
|
|
3946
|
-
}(Hook);
|
|
3947
|
-
// export function AsyncParallelHook(args = [], name = undefined) {
|
|
3948
|
-
// const hook = new Hook(args, name);
|
|
3949
|
-
// hook.constructor = AsyncParallelHook;
|
|
3950
|
-
// hook.compile = COMPILE;
|
|
3951
|
-
// hook._call = undefined;
|
|
3952
|
-
// hook.call = undefined;
|
|
3953
|
-
// return hook;
|
|
3954
|
-
// }
|
|
3955
|
-
// AsyncParallelHook.prototype = null;
|
|
3956
|
-
|
|
3957
|
-
var AsyncSeriesWaterfallHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
|
|
3958
|
-
_inheritsLoose(AsyncSeriesWaterfallHookCodeFactory, _HookCodeFactory);
|
|
3959
|
-
function AsyncSeriesWaterfallHookCodeFactory() {
|
|
3960
|
-
return _HookCodeFactory.apply(this, arguments) || this;
|
|
3339
|
+
var SyncHook = /*#__PURE__*/function () {
|
|
3340
|
+
function SyncHook() {
|
|
3341
|
+
this.callbacks = [];
|
|
3961
3342
|
}
|
|
3962
|
-
var _proto =
|
|
3963
|
-
_proto.
|
|
3964
|
-
|
|
3965
|
-
var _onError = _ref.onError,
|
|
3966
|
-
onResult = _ref.onResult,
|
|
3967
|
-
onDone = _ref.onDone;
|
|
3968
|
-
return this.callTapsSeries({
|
|
3969
|
-
onError: function onError(i, err, next, doneBreak) {
|
|
3970
|
-
return _onError(err) + doneBreak(true);
|
|
3971
|
-
},
|
|
3972
|
-
onResult: function onResult(i, result, next) {
|
|
3973
|
-
var code = '';
|
|
3974
|
-
code += "if(" + result + " !== undefined) {\n";
|
|
3975
|
-
code += _this._args[0] + " = " + result + ";\n";
|
|
3976
|
-
code += "}\n";
|
|
3977
|
-
code += next();
|
|
3978
|
-
return code;
|
|
3979
|
-
},
|
|
3980
|
-
onDone: function onDone() {
|
|
3981
|
-
return onResult(_this._args[0]);
|
|
3982
|
-
}
|
|
3983
|
-
});
|
|
3343
|
+
var _proto = SyncHook.prototype;
|
|
3344
|
+
_proto.tap = function tap(options, fn) {
|
|
3345
|
+
this.callbacks.push(fn);
|
|
3984
3346
|
};
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
};
|
|
3992
|
-
// export function AsyncSeriesWaterfallHook(args = [], name = undefined) {
|
|
3993
|
-
// if (args.length < 1) throw new Error('Waterfall hooks must have at least one argument');
|
|
3994
|
-
// const hook = new Hook(args, name);
|
|
3995
|
-
// hook.constructor = AsyncSeriesWaterfallHook;
|
|
3996
|
-
// hook.compile = COMPILE;
|
|
3997
|
-
// hook._call = undefined;
|
|
3998
|
-
// hook.call = undefined;
|
|
3999
|
-
// return hook;
|
|
4000
|
-
// }
|
|
4001
|
-
// AsyncSeriesWaterfallHook.prototype = null;
|
|
4002
|
-
var AsyncSeriesWaterfallHook = /*#__PURE__*/function (_Hook) {
|
|
4003
|
-
_inheritsLoose(AsyncSeriesWaterfallHook, _Hook);
|
|
4004
|
-
function AsyncSeriesWaterfallHook(args, name) {
|
|
4005
|
-
var _this2;
|
|
4006
|
-
if (args === void 0) {
|
|
4007
|
-
args = [];
|
|
4008
|
-
}
|
|
4009
|
-
if (name === void 0) {
|
|
4010
|
-
name = undefined;
|
|
4011
|
-
}
|
|
4012
|
-
_this2 = _Hook.call(this, args, name) || this;
|
|
4013
|
-
_this2.compile = COMPILE$1;
|
|
4014
|
-
_this2._call = undefined;
|
|
4015
|
-
_this2.call = undefined;
|
|
4016
|
-
return _this2;
|
|
4017
|
-
}
|
|
4018
|
-
return AsyncSeriesWaterfallHook;
|
|
4019
|
-
}(Hook);
|
|
4020
|
-
|
|
4021
|
-
var SyncHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
|
|
4022
|
-
_inheritsLoose(SyncHookCodeFactory, _HookCodeFactory);
|
|
4023
|
-
function SyncHookCodeFactory() {
|
|
4024
|
-
return _HookCodeFactory.apply(this, arguments) || this;
|
|
4025
|
-
}
|
|
4026
|
-
var _proto = SyncHookCodeFactory.prototype;
|
|
4027
|
-
_proto.content = function content(_ref) {
|
|
4028
|
-
var _onError = _ref.onError,
|
|
4029
|
-
onDone = _ref.onDone,
|
|
4030
|
-
rethrowIfPossible = _ref.rethrowIfPossible;
|
|
4031
|
-
return this.callTapsSeries({
|
|
4032
|
-
onError: function onError(i, err) {
|
|
4033
|
-
return _onError(err);
|
|
4034
|
-
},
|
|
4035
|
-
onDone: onDone,
|
|
4036
|
-
rethrowIfPossible: rethrowIfPossible
|
|
3347
|
+
_proto.call = function call() {
|
|
3348
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3349
|
+
args[_key] = arguments[_key];
|
|
3350
|
+
}
|
|
3351
|
+
this.callbacks.forEach(function (callback) {
|
|
3352
|
+
callback.apply(void 0, args);
|
|
4037
3353
|
});
|
|
4038
3354
|
};
|
|
4039
|
-
return SyncHookCodeFactory;
|
|
4040
|
-
}(HookCodeFactory);
|
|
4041
|
-
var factory$2 = new SyncHookCodeFactory();
|
|
4042
|
-
var TAP_ASYNC = function TAP_ASYNC() {
|
|
4043
|
-
throw new Error('tapAsync is not supported on a SyncHook');
|
|
4044
|
-
};
|
|
4045
|
-
var TAP_PROMISE = function TAP_PROMISE() {
|
|
4046
|
-
throw new Error('tapPromise is not supported on a SyncHook');
|
|
4047
|
-
};
|
|
4048
|
-
var COMPILE$2 = function COMPILE(options) {
|
|
4049
|
-
factory$2.setup(this, options);
|
|
4050
|
-
return factory$2.create(options);
|
|
4051
|
-
};
|
|
4052
|
-
var SyncHook = /*#__PURE__*/function (_Hook) {
|
|
4053
|
-
_inheritsLoose(SyncHook, _Hook);
|
|
4054
|
-
function SyncHook(args, name) {
|
|
4055
|
-
var _this;
|
|
4056
|
-
if (args === void 0) {
|
|
4057
|
-
args = [];
|
|
4058
|
-
}
|
|
4059
|
-
if (name === void 0) {
|
|
4060
|
-
name = undefined;
|
|
4061
|
-
}
|
|
4062
|
-
_this = _Hook.call(this, args, name) || this;
|
|
4063
|
-
_this.tapAsync = TAP_ASYNC;
|
|
4064
|
-
_this.tapPromise = TAP_PROMISE;
|
|
4065
|
-
_this.compile = COMPILE$2;
|
|
4066
|
-
return _this;
|
|
4067
|
-
}
|
|
4068
3355
|
return SyncHook;
|
|
4069
|
-
}(
|
|
4070
|
-
// export function SyncHook(args = [], name = undefined) {
|
|
4071
|
-
// const hook = new Hook(args, name);
|
|
4072
|
-
// hook.constructor = SyncHook;
|
|
4073
|
-
// hook.tapAsync = TAP_ASYNC;
|
|
4074
|
-
// hook.tapPromise = TAP_PROMISE;
|
|
4075
|
-
// hook.compile = COMPILE;
|
|
4076
|
-
// return hook;
|
|
4077
|
-
// }
|
|
4078
|
-
// SyncHook.prototype = null;
|
|
3356
|
+
}();
|
|
4079
3357
|
|
|
4080
|
-
var
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
return _HookCodeFactory.apply(this, arguments) || this;
|
|
3358
|
+
var SyncWaterfallHook = /*#__PURE__*/function () {
|
|
3359
|
+
function SyncWaterfallHook() {
|
|
3360
|
+
this.callbacks = [];
|
|
4084
3361
|
}
|
|
4085
|
-
var _proto =
|
|
4086
|
-
_proto.
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
code += next();
|
|
4102
|
-
return code;
|
|
4103
|
-
},
|
|
4104
|
-
onDone: function onDone() {
|
|
4105
|
-
return onResult(_this._args[0]);
|
|
4106
|
-
},
|
|
4107
|
-
doneReturns: resultReturns,
|
|
4108
|
-
rethrowIfPossible: rethrowIfPossible
|
|
4109
|
-
});
|
|
3362
|
+
var _proto = SyncWaterfallHook.prototype;
|
|
3363
|
+
_proto.tap = function tap(options, fn) {
|
|
3364
|
+
this.callbacks.push(fn);
|
|
3365
|
+
};
|
|
3366
|
+
_proto.call = function call() {
|
|
3367
|
+
if (this.callbacks.length) {
|
|
3368
|
+
var _this$callbacks;
|
|
3369
|
+
var result = (_this$callbacks = this.callbacks)[0].apply(_this$callbacks, arguments);
|
|
3370
|
+
for (var i = 0; i < this.callbacks.length - 1; i++) {
|
|
3371
|
+
var callback = this.callbacks[i];
|
|
3372
|
+
// @ts-ignore
|
|
3373
|
+
result = callback(result);
|
|
3374
|
+
}
|
|
3375
|
+
return result;
|
|
3376
|
+
}
|
|
3377
|
+
return null;
|
|
4110
3378
|
};
|
|
4111
|
-
return SyncWaterfallHookCodeFactory;
|
|
4112
|
-
}(HookCodeFactory);
|
|
4113
|
-
var factory$3 = new SyncWaterfallHookCodeFactory();
|
|
4114
|
-
var TAP_ASYNC$1 = function TAP_ASYNC() {
|
|
4115
|
-
throw new Error('tapAsync is not supported on a SyncWaterfallHook');
|
|
4116
|
-
};
|
|
4117
|
-
var TAP_PROMISE$1 = function TAP_PROMISE() {
|
|
4118
|
-
throw new Error('tapPromise is not supported on a SyncWaterfallHook');
|
|
4119
|
-
};
|
|
4120
|
-
var COMPILE$3 = function COMPILE(options) {
|
|
4121
|
-
factory$3.setup(this, options);
|
|
4122
|
-
return factory$3.create(options);
|
|
4123
|
-
};
|
|
4124
|
-
var SyncWaterfallHook = /*#__PURE__*/function (_SyncHook) {
|
|
4125
|
-
_inheritsLoose(SyncWaterfallHook, _SyncHook);
|
|
4126
|
-
function SyncWaterfallHook(args, name) {
|
|
4127
|
-
var _this2;
|
|
4128
|
-
if (args === void 0) {
|
|
4129
|
-
args = [];
|
|
4130
|
-
}
|
|
4131
|
-
if (name === void 0) {
|
|
4132
|
-
name = undefined;
|
|
4133
|
-
}
|
|
4134
|
-
_this2 = _SyncHook.call(this, args, name) || this;
|
|
4135
|
-
_this2.tapAsync = TAP_ASYNC$1;
|
|
4136
|
-
_this2.tapPromise = TAP_PROMISE$1;
|
|
4137
|
-
_this2.compile = COMPILE$3;
|
|
4138
|
-
return _this2;
|
|
4139
|
-
}
|
|
4140
3379
|
return SyncWaterfallHook;
|
|
4141
|
-
}(
|
|
4142
|
-
// export function SyncWaterfallHook(args = [], name = undefined) {
|
|
4143
|
-
// if (args.length < 1) throw new Error('Waterfall hooks must have at least one argument');
|
|
4144
|
-
// const hook = new Hook(args, name);
|
|
4145
|
-
// hook.constructor = SyncWaterfallHook;
|
|
4146
|
-
// hook.tapAsync = TAP_ASYNC;
|
|
4147
|
-
// hook.tapPromise = TAP_PROMISE;
|
|
4148
|
-
// hook.compile = COMPILE;
|
|
4149
|
-
// return hook;
|
|
4150
|
-
// }
|
|
4151
|
-
// SyncWaterfallHook.prototype = null;
|
|
3380
|
+
}();
|
|
4152
3381
|
|
|
4153
3382
|
var genericFontFamilies = ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui'];
|
|
4154
3383
|
var stringRegExp = /([\"\'])[^\'\"]+\1/;
|
|
@@ -6126,13 +5355,12 @@ var AABB = /*#__PURE__*/function () {
|
|
|
6126
5355
|
}();
|
|
6127
5356
|
|
|
6128
5357
|
var Plane = /*#__PURE__*/function () {
|
|
6129
|
-
/**
|
|
6130
|
-
* lookup table for p-vertex & n-vertex when doing frustum culling
|
|
6131
|
-
*/
|
|
6132
|
-
|
|
6133
5358
|
function Plane(distance, normal) {
|
|
6134
5359
|
this.distance = void 0;
|
|
6135
5360
|
this.normal = void 0;
|
|
5361
|
+
/**
|
|
5362
|
+
* lookup table for p-vertex & n-vertex when doing frustum culling
|
|
5363
|
+
*/
|
|
6136
5364
|
this.pnVertexFlag = void 0;
|
|
6137
5365
|
this.distance = distance || 0;
|
|
6138
5366
|
this.normal = normal || vec3.fromValues(0, 1, 0);
|
|
@@ -8556,32 +7784,29 @@ var DATASET_PREFIX = 'data-';
|
|
|
8556
7784
|
*/
|
|
8557
7785
|
var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
8558
7786
|
_inheritsLoose(DisplayObject, _Element);
|
|
8559
|
-
/**
|
|
8560
|
-
* contains style props in constructor's params, eg. fill, stroke...
|
|
8561
|
-
*/
|
|
8562
|
-
|
|
8563
|
-
/**
|
|
8564
|
-
* push to active animations after calling `animate()`
|
|
8565
|
-
*/
|
|
8566
|
-
|
|
8567
|
-
/**
|
|
8568
|
-
* Use data-* attribute.
|
|
8569
|
-
* @see https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
|
|
8570
|
-
* @example
|
|
8571
|
-
* group.dataset.prop1 = 1;
|
|
8572
|
-
* group.getAttribute('data-prop1'); // 1
|
|
8573
|
-
*/
|
|
8574
|
-
|
|
8575
7787
|
function DisplayObject(config) {
|
|
8576
7788
|
var _this$config$capture;
|
|
8577
7789
|
var _this;
|
|
8578
7790
|
_this = _Element.call(this) || this;
|
|
8579
7791
|
// assign name, id to config
|
|
8580
7792
|
// eg. group.get('name')
|
|
7793
|
+
/**
|
|
7794
|
+
* contains style props in constructor's params, eg. fill, stroke...
|
|
7795
|
+
*/
|
|
8581
7796
|
_this.config = void 0;
|
|
8582
7797
|
_this.isCustomElement = false;
|
|
8583
7798
|
_this.isMutationObserved = false;
|
|
7799
|
+
/**
|
|
7800
|
+
* push to active animations after calling `animate()`
|
|
7801
|
+
*/
|
|
8584
7802
|
_this.activeAnimations = [];
|
|
7803
|
+
/**
|
|
7804
|
+
* Use data-* attribute.
|
|
7805
|
+
* @see https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
|
|
7806
|
+
* @example
|
|
7807
|
+
* group.dataset.prop1 = 1;
|
|
7808
|
+
* group.getAttribute('data-prop1'); // 1
|
|
7809
|
+
*/
|
|
8585
7810
|
_this.dataset = void 0;
|
|
8586
7811
|
/**
|
|
8587
7812
|
* Use `this.style.clipPath` instead.
|
|
@@ -8737,7 +7962,12 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
|
|
|
8737
7962
|
options.usedAttributes = INHERITABLE_STYLE_PROPS;
|
|
8738
7963
|
}
|
|
8739
7964
|
// account for FCP, process properties as less as possible
|
|
8740
|
-
|
|
7965
|
+
var formattedAttributes = {};
|
|
7966
|
+
for (var name in attributes) {
|
|
7967
|
+
var attributeName = formatAttributeName(name);
|
|
7968
|
+
formattedAttributes[attributeName] = attributes[name];
|
|
7969
|
+
}
|
|
7970
|
+
runtime.styleValueRegistry.processProperties(this, formattedAttributes, options);
|
|
8741
7971
|
// redraw at next frame
|
|
8742
7972
|
renderable.dirty = true;
|
|
8743
7973
|
};
|
|
@@ -9317,10 +8547,6 @@ var _excluded$1 = ["style"];
|
|
|
9317
8547
|
*/
|
|
9318
8548
|
var CustomElement = /*#__PURE__*/function (_DisplayObject) {
|
|
9319
8549
|
_inheritsLoose(CustomElement, _DisplayObject);
|
|
9320
|
-
// static get observedAttributes(): string[] {
|
|
9321
|
-
// return [];
|
|
9322
|
-
// }
|
|
9323
|
-
|
|
9324
8550
|
// private shadowNodes: DisplayObject[] = [];
|
|
9325
8551
|
function CustomElement(_temp) {
|
|
9326
8552
|
var _this;
|
|
@@ -9333,6 +8559,9 @@ var CustomElement = /*#__PURE__*/function (_DisplayObject) {
|
|
|
9333
8559
|
y: ''
|
|
9334
8560
|
}, style) : _extends({}, style)
|
|
9335
8561
|
}, rest)) || this;
|
|
8562
|
+
// static get observedAttributes(): string[] {
|
|
8563
|
+
// return [];
|
|
8564
|
+
// }
|
|
9336
8565
|
_this.isCustomElement = true;
|
|
9337
8566
|
return _this;
|
|
9338
8567
|
}
|
|
@@ -9656,10 +8885,6 @@ var EMPTY_PARSED_PATH = {
|
|
|
9656
8885
|
};
|
|
9657
8886
|
var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
9658
8887
|
_inheritsLoose(Path, _DisplayObject);
|
|
9659
|
-
/**
|
|
9660
|
-
* markers placed at the mid
|
|
9661
|
-
*/
|
|
9662
|
-
|
|
9663
8888
|
function Path(_temp) {
|
|
9664
8889
|
var _this;
|
|
9665
8890
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
@@ -9678,6 +8903,9 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
|
9678
8903
|
}, rest)) || this;
|
|
9679
8904
|
_this.markerStartAngle = 0;
|
|
9680
8905
|
_this.markerEndAngle = 0;
|
|
8906
|
+
/**
|
|
8907
|
+
* markers placed at the mid
|
|
8908
|
+
*/
|
|
9681
8909
|
_this.markerMidList = [];
|
|
9682
8910
|
var _this$parsedStyle = _this.parsedStyle,
|
|
9683
8911
|
markerStart = _this$parsedStyle.markerStart,
|
|
@@ -9884,10 +9112,6 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
|
|
|
9884
9112
|
var _excluded$8 = ["style"];
|
|
9885
9113
|
var Polygon = /*#__PURE__*/function (_DisplayObject) {
|
|
9886
9114
|
_inheritsLoose(Polygon, _DisplayObject);
|
|
9887
|
-
/**
|
|
9888
|
-
* markers placed at the mid
|
|
9889
|
-
*/
|
|
9890
|
-
|
|
9891
9115
|
function Polygon(_temp) {
|
|
9892
9116
|
var _this;
|
|
9893
9117
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
@@ -9912,6 +9136,9 @@ var Polygon = /*#__PURE__*/function (_DisplayObject) {
|
|
|
9912
9136
|
}, rest)) || this;
|
|
9913
9137
|
_this.markerStartAngle = 0;
|
|
9914
9138
|
_this.markerEndAngle = 0;
|
|
9139
|
+
/**
|
|
9140
|
+
* markers placed at the mid
|
|
9141
|
+
*/
|
|
9915
9142
|
_this.markerMidList = [];
|
|
9916
9143
|
var _this$parsedStyle = _this.parsedStyle,
|
|
9917
9144
|
markerStart = _this$parsedStyle.markerStart,
|
|
@@ -10314,7 +9541,11 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
10314
9541
|
int: true,
|
|
10315
9542
|
k: ['none'],
|
|
10316
9543
|
d: 'none',
|
|
10317
|
-
syntax: PropertySyntax.PAINT
|
|
9544
|
+
syntax: PropertySyntax.PAINT,
|
|
9545
|
+
/**
|
|
9546
|
+
* Stroke 'none' won't affect geometry but others will.
|
|
9547
|
+
*/
|
|
9548
|
+
l: true
|
|
10318
9549
|
}, {
|
|
10319
9550
|
n: 'shadowType',
|
|
10320
9551
|
k: ['inner', 'outer', 'both'],
|
|
@@ -10805,28 +10036,6 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
10805
10036
|
};
|
|
10806
10037
|
}
|
|
10807
10038
|
if (!runtime.enableCSSParsing) {
|
|
10808
|
-
// alias
|
|
10809
|
-
// @ts-ignore
|
|
10810
|
-
if (attributes.src) {
|
|
10811
|
-
// @ts-ignore
|
|
10812
|
-
attributes.img = attributes.src;
|
|
10813
|
-
}
|
|
10814
|
-
// @ts-ignore
|
|
10815
|
-
if (attributes.d) {
|
|
10816
|
-
// @ts-ignore
|
|
10817
|
-
attributes.path = attributes.d;
|
|
10818
|
-
}
|
|
10819
|
-
if (attributes.strokeDasharray) {
|
|
10820
|
-
attributes.lineDash = attributes.strokeDasharray;
|
|
10821
|
-
}
|
|
10822
|
-
if (attributes.strokeWidth) {
|
|
10823
|
-
attributes.lineWidth = attributes.strokeWidth;
|
|
10824
|
-
}
|
|
10825
|
-
// @ts-ignore
|
|
10826
|
-
if (attributes.textAnchor) {
|
|
10827
|
-
// @ts-ignore
|
|
10828
|
-
attributes.textAlign = attributes.textAnchor;
|
|
10829
|
-
}
|
|
10830
10039
|
Object.assign(object.attributes, attributes);
|
|
10831
10040
|
var _attributeNames = Object.keys(attributes);
|
|
10832
10041
|
// clipPath
|
|
@@ -10993,11 +10202,10 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
|
|
|
10993
10202
|
var attributeNames = Object.keys(attributes);
|
|
10994
10203
|
attributeNames.forEach(function (attributeName) {
|
|
10995
10204
|
var _propertyMetadataCach;
|
|
10996
|
-
var name = formatAttributeName(attributeName);
|
|
10997
10205
|
if (!skipUpdateAttribute) {
|
|
10998
|
-
object.attributes[
|
|
10206
|
+
object.attributes[attributeName] = attributes[attributeName];
|
|
10999
10207
|
}
|
|
11000
|
-
if (!needUpdateGeometry && ((_propertyMetadataCach = propertyMetadataCache[
|
|
10208
|
+
if (!needUpdateGeometry && ((_propertyMetadataCach = propertyMetadataCache[attributeName]) === null || _propertyMetadataCach === void 0 ? void 0 : _propertyMetadataCach.l)) {
|
|
11001
10209
|
needUpdateGeometry = true;
|
|
11002
10210
|
}
|
|
11003
10211
|
});
|
|
@@ -13129,48 +12337,48 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
13129
12337
|
/**
|
|
13130
12338
|
* only dirty object which has sth changed will be rendered
|
|
13131
12339
|
*/
|
|
13132
|
-
dirtycheck: new SyncWaterfallHook(
|
|
12340
|
+
dirtycheck: new SyncWaterfallHook(),
|
|
13133
12341
|
/**
|
|
13134
12342
|
* do culling
|
|
13135
12343
|
*/
|
|
13136
|
-
cull: new SyncWaterfallHook(
|
|
12344
|
+
cull: new SyncWaterfallHook(),
|
|
13137
12345
|
/**
|
|
13138
12346
|
* called at beginning of each frame, won't get called if nothing to re-render
|
|
13139
12347
|
*/
|
|
13140
|
-
beginFrame: new SyncHook(
|
|
12348
|
+
beginFrame: new SyncHook(),
|
|
13141
12349
|
/**
|
|
13142
12350
|
* called before every dirty object get rendered
|
|
13143
12351
|
*/
|
|
13144
|
-
beforeRender: new SyncHook(
|
|
12352
|
+
beforeRender: new SyncHook(),
|
|
13145
12353
|
/**
|
|
13146
12354
|
* called when every dirty object rendering even it's culled
|
|
13147
12355
|
*/
|
|
13148
|
-
render: new SyncHook(
|
|
12356
|
+
render: new SyncHook(),
|
|
13149
12357
|
/**
|
|
13150
12358
|
* called after every dirty object get rendered
|
|
13151
12359
|
*/
|
|
13152
|
-
afterRender: new SyncHook(
|
|
13153
|
-
endFrame: new SyncHook(
|
|
13154
|
-
destroy: new SyncHook(
|
|
12360
|
+
afterRender: new SyncHook(),
|
|
12361
|
+
endFrame: new SyncHook(),
|
|
12362
|
+
destroy: new SyncHook(),
|
|
13155
12363
|
/**
|
|
13156
12364
|
* use async but faster method such as GPU-based picking in `g-plugin-device-renderer`
|
|
13157
12365
|
*/
|
|
13158
|
-
pick: new AsyncSeriesWaterfallHook(
|
|
12366
|
+
pick: new AsyncSeriesWaterfallHook(),
|
|
13159
12367
|
/**
|
|
13160
12368
|
* Unsafe but sync version of pick.
|
|
13161
12369
|
*/
|
|
13162
|
-
pickSync: new SyncWaterfallHook(
|
|
12370
|
+
pickSync: new SyncWaterfallHook(),
|
|
13163
12371
|
/**
|
|
13164
12372
|
* used in event system
|
|
13165
12373
|
*/
|
|
13166
|
-
pointerDown: new SyncHook(
|
|
13167
|
-
pointerUp: new SyncHook(
|
|
13168
|
-
pointerMove: new SyncHook(
|
|
13169
|
-
pointerOut: new SyncHook(
|
|
13170
|
-
pointerOver: new SyncHook(
|
|
13171
|
-
pointerWheel: new SyncHook(
|
|
13172
|
-
pointerCancel: new SyncHook(
|
|
13173
|
-
click: new SyncHook(
|
|
12374
|
+
pointerDown: new SyncHook(),
|
|
12375
|
+
pointerUp: new SyncHook(),
|
|
12376
|
+
pointerMove: new SyncHook(),
|
|
12377
|
+
pointerOut: new SyncHook(),
|
|
12378
|
+
pointerOver: new SyncHook(),
|
|
12379
|
+
pointerWheel: new SyncHook(),
|
|
12380
|
+
pointerCancel: new SyncHook(),
|
|
12381
|
+
click: new SyncHook()
|
|
13174
12382
|
};
|
|
13175
12383
|
this.globalRuntime = globalRuntime;
|
|
13176
12384
|
this.context = context;
|
|
@@ -15289,66 +14497,55 @@ var afterRenderEvent = new CustomEvent(CanvasEvent.AFTER_RENDER);
|
|
|
15289
14497
|
*/
|
|
15290
14498
|
var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
15291
14499
|
_inheritsLoose(Canvas, _EventTarget);
|
|
15292
|
-
/**
|
|
15293
|
-
* window.document
|
|
15294
|
-
*/
|
|
15295
|
-
|
|
15296
|
-
/**
|
|
15297
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
15298
|
-
*/
|
|
15299
|
-
|
|
15300
|
-
/**
|
|
15301
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
15302
|
-
*/
|
|
15303
|
-
|
|
15304
|
-
/**
|
|
15305
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
|
|
15306
|
-
*/
|
|
15307
|
-
|
|
15308
|
-
/**
|
|
15309
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
|
|
15310
|
-
*/
|
|
15311
|
-
|
|
15312
|
-
/**
|
|
15313
|
-
* whether the runtime supports PointerEvent?
|
|
15314
|
-
* if not, the event system won't trigger pointer events like `pointerdown`
|
|
15315
|
-
*/
|
|
15316
|
-
|
|
15317
|
-
/**
|
|
15318
|
-
* whether the runtime supports TouchEvent?
|
|
15319
|
-
* if not, the event system won't trigger touch events like `touchstart`
|
|
15320
|
-
*/
|
|
15321
|
-
|
|
15322
|
-
/**
|
|
15323
|
-
* is this native event a TouchEvent?
|
|
15324
|
-
*/
|
|
15325
|
-
|
|
15326
|
-
/**
|
|
15327
|
-
* is this native event a MouseEvent?
|
|
15328
|
-
*/
|
|
15329
|
-
|
|
15330
|
-
/**
|
|
15331
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
15332
|
-
*/
|
|
15333
|
-
|
|
15334
|
-
/**
|
|
15335
|
-
* rAF in auto rendering
|
|
15336
|
-
*/
|
|
15337
|
-
|
|
15338
14500
|
function Canvas(config) {
|
|
15339
14501
|
var _this;
|
|
15340
14502
|
_this = _EventTarget.call(this) || this;
|
|
15341
14503
|
// create document
|
|
14504
|
+
/**
|
|
14505
|
+
* window.document
|
|
14506
|
+
*/
|
|
15342
14507
|
_this.document = void 0;
|
|
14508
|
+
/**
|
|
14509
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
|
|
14510
|
+
*/
|
|
15343
14511
|
_this.customElements = void 0;
|
|
14512
|
+
/**
|
|
14513
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
|
|
14514
|
+
*/
|
|
15344
14515
|
_this.requestAnimationFrame = void 0;
|
|
14516
|
+
/**
|
|
14517
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
|
|
14518
|
+
*/
|
|
15345
14519
|
_this.cancelAnimationFrame = void 0;
|
|
14520
|
+
/**
|
|
14521
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
|
|
14522
|
+
*/
|
|
15346
14523
|
_this.devicePixelRatio = void 0;
|
|
14524
|
+
/**
|
|
14525
|
+
* whether the runtime supports PointerEvent?
|
|
14526
|
+
* if not, the event system won't trigger pointer events like `pointerdown`
|
|
14527
|
+
*/
|
|
15347
14528
|
_this.supportsPointerEvents = void 0;
|
|
14529
|
+
/**
|
|
14530
|
+
* whether the runtime supports TouchEvent?
|
|
14531
|
+
* if not, the event system won't trigger touch events like `touchstart`
|
|
14532
|
+
*/
|
|
15348
14533
|
_this.supportsTouchEvents = void 0;
|
|
14534
|
+
/**
|
|
14535
|
+
* is this native event a TouchEvent?
|
|
14536
|
+
*/
|
|
15349
14537
|
_this.isTouchEvent = void 0;
|
|
14538
|
+
/**
|
|
14539
|
+
* is this native event a MouseEvent?
|
|
14540
|
+
*/
|
|
15350
14541
|
_this.isMouseEvent = void 0;
|
|
14542
|
+
/**
|
|
14543
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element
|
|
14544
|
+
*/
|
|
15351
14545
|
_this.Element = DisplayObject;
|
|
14546
|
+
/**
|
|
14547
|
+
* rAF in auto rendering
|
|
14548
|
+
*/
|
|
15352
14549
|
_this.frameId = void 0;
|
|
15353
14550
|
_this.inited = false;
|
|
15354
14551
|
_this.readyPromise = void 0;
|