@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/index.umd.js CHANGED
@@ -8268,6 +8268,7 @@
8268
8268
  function piMod(angle) {
8269
8269
  return (angle + Math.PI * 2) % (Math.PI * 2);
8270
8270
  }
8271
+
8271
8272
  var line = {
8272
8273
  /**
8273
8274
  * 计算线段的包围盒
@@ -8362,6 +8363,7 @@
8362
8363
  return Math.atan2(y2 - y1, x2 - x1);
8363
8364
  }
8364
8365
  };
8366
+
8365
8367
  var EPSILON$1 = 0.0001;
8366
8368
  /**
8367
8369
  * 使用牛顿切割法求最近的点
@@ -8531,6 +8533,7 @@
8531
8533
  return piMod(angle);
8532
8534
  }
8533
8535
  };
8536
+
8534
8537
  function cubicAt(p0, p1, p2, p3, t) {
8535
8538
  var onet = 1 - t; // t * t * t 的性能大概是 Math.pow(t, 3) 的三倍
8536
8539
  return onet * onet * onet * p0 + 3 * p1 * t * onet * onet + 3 * p2 * t * t * onet + p3 * t * t * t;
@@ -8962,6 +8965,7 @@
8962
8965
  return piMod(Math.atan2(dy, dx));
8963
8966
  }
8964
8967
  };
8968
+
8965
8969
  function analyzePoints(points) {
8966
8970
  // 计算每段的长度和总的长度
8967
8971
  var totalLength = 0;
@@ -9074,6 +9078,7 @@
9074
9078
  }
9075
9079
  return minDistance;
9076
9080
  }
9081
+
9077
9082
  var polyline = {
9078
9083
  /**
9079
9084
  * 计算多折线的包围盒
@@ -9878,916 +9883,145 @@
9878
9883
  return [hasFill, hasStroke];
9879
9884
  }
9880
9885
 
9881
- // @ts-nocheck
9882
- // interface HookInterceptor<T, R, AdditionalOptions = UnsetAdditionalOptions> {
9883
- // name?: string;
9884
- // tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
9885
- // call?: (...args: any[]) => void;
9886
- // loop?: (...args: any[]) => void;
9887
- // error?: (err: Error) => void;
9888
- // result?: (result: R) => void;
9889
- // done?: () => void;
9890
- // register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
9891
- // }
9892
- // type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
9893
- // export declare class AsyncHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<
9894
- // T,
9895
- // R,
9896
- // AdditionalOptions
9897
- // > {
9898
- // tapAsync(
9899
- // options: string | (Tap & IfSet<AdditionalOptions>),
9900
- // fn: (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void,
9901
- // ): void;
9902
- // tapPromise(
9903
- // options: string | (Tap & IfSet<AdditionalOptions>),
9904
- // fn: (...args: AsArray<T>) => Promise<R>,
9905
- // ): void;
9906
- // }
9907
- var CALL_DELEGATE = function CALL_DELEGATE() {
9908
- this.call = this._createCall('sync');
9909
- return this.call.apply(this, arguments);
9910
- };
9911
- var CALL_ASYNC_DELEGATE = function CALL_ASYNC_DELEGATE() {
9912
- this.callAsync = this._createCall('async');
9913
- return this.callAsync.apply(this, arguments);
9914
- };
9915
- var PROMISE_DELEGATE = function PROMISE_DELEGATE() {
9916
- this.promise = this._createCall('promise');
9917
- return this.promise.apply(this, arguments);
9918
- };
9919
- var Hook = /*#__PURE__*/function () {
9920
- function Hook(args, name) {
9921
- if (args === void 0) {
9922
- args = [];
9923
- }
9924
- if (name === void 0) {
9925
- name = undefined;
9926
- }
9927
- this.name = void 0;
9928
- this.taps = void 0;
9929
- this.promise = void 0;
9930
- this._promise = void 0;
9931
- this._args = args;
9932
- this.name = name;
9933
- this.taps = [];
9934
- this.interceptors = [];
9935
- this._call = CALL_DELEGATE;
9936
- this.call = CALL_DELEGATE;
9937
- this._callAsync = CALL_ASYNC_DELEGATE;
9938
- this.callAsync = CALL_ASYNC_DELEGATE;
9939
- this._promise = PROMISE_DELEGATE;
9940
- this.promise = PROMISE_DELEGATE;
9941
- this._x = undefined;
9942
- // this.compile = this.compile;
9943
- // this.tap = this.tap;
9944
- // this.tapAsync = this.tapAsync;
9945
- // this.tapPromise = this.tapPromise;
9946
- }
9947
- var _proto = Hook.prototype;
9948
- _proto.compile = function compile(options) {
9949
- throw new Error('Abstract: should be overridden');
9950
- };
9951
- _proto._createCall = function _createCall(type) {
9952
- return this.compile({
9953
- taps: this.taps,
9954
- interceptors: this.interceptors,
9955
- args: this._args,
9956
- type: type
9957
- });
9958
- };
9959
- _proto._tap = function _tap(type, options, fn) {
9960
- if (typeof options === 'string') {
9961
- options = {
9962
- name: options.trim()
9963
- };
9964
- } else if (typeof options !== 'object' || options === null) {
9965
- throw new Error('Invalid tap options');
9966
- }
9967
- if (typeof options.name !== 'string' || options.name === '') {
9968
- throw new Error('Missing name for tap');
9969
- }
9970
- // if (typeof options.context !== "undefined") {
9971
- // deprecateContext();
9972
- // }
9973
- options = Object.assign({
9974
- type: type,
9975
- fn: fn
9976
- }, options);
9977
- options = this._runRegisterInterceptors(options);
9978
- this._insert(options);
9979
- };
9980
- _proto.tap = function tap(options, fn) {
9981
- this._tap('sync', options, fn);
9982
- };
9983
- _proto.tapAsync = function tapAsync(options, fn) {
9984
- this._tap('async', options, fn);
9985
- };
9986
- _proto.tapPromise = function tapPromise(options, fn) {
9987
- this._tap('promise', options, fn);
9988
- };
9989
- _proto._runRegisterInterceptors = function _runRegisterInterceptors(options) {
9990
- for (var _iterator = _createForOfIteratorHelperLoose(this.interceptors), _step; !(_step = _iterator()).done;) {
9991
- var interceptor = _step.value;
9992
- if (interceptor.register) {
9993
- var newOptions = interceptor.register(options);
9994
- if (newOptions !== undefined) {
9995
- options = newOptions;
9996
- }
9997
- }
9998
- }
9999
- return options;
10000
- };
10001
- _proto.withOptions = function withOptions(options) {
10002
- var _this = this;
10003
- var mergeOptions = function mergeOptions(opt) {
10004
- return Object.assign({}, options, typeof opt === 'string' ? {
10005
- name: opt
10006
- } : opt);
10007
- };
10008
- return {
10009
- name: this.name,
10010
- tap: function tap(opt, fn) {
10011
- return _this.tap(mergeOptions(opt), fn);
10012
- },
10013
- tapAsync: function tapAsync(opt, fn) {
10014
- return _this.tapAsync(mergeOptions(opt), fn);
10015
- },
10016
- tapPromise: function tapPromise(opt, fn) {
10017
- return _this.tapPromise(mergeOptions(opt), fn);
10018
- },
10019
- // intercept: (interceptor) => this.intercept(interceptor),
10020
- isUsed: function isUsed() {
10021
- return _this.isUsed();
10022
- },
10023
- withOptions: function withOptions(opt) {
10024
- return _this.withOptions(mergeOptions(opt));
10025
- }
10026
- };
10027
- };
10028
- _proto.isUsed = function isUsed() {
10029
- return this.taps.length > 0 || this.interceptors.length > 0;
9886
+ var AsyncParallelHook = /*#__PURE__*/function () {
9887
+ function AsyncParallelHook() {
9888
+ this.callbacks = [];
10030
9889
  }
10031
- // intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>) {
10032
- // this._resetCompilation();
10033
- // this.interceptors.push(Object.assign({}, interceptor));
10034
- // if (interceptor.register) {
10035
- // for (let i = 0; i < this.taps.length; i++) {
10036
- // this.taps[i] = interceptor.register(this.taps[i]);
10037
- // }
10038
- // }
10039
- // }
10040
- ;
10041
- _proto._resetCompilation = function _resetCompilation() {
10042
- this.call = this._call;
10043
- this.callAsync = this._callAsync;
10044
- this.promise = this._promise;
10045
- };
10046
- _proto._insert = function _insert(item) {
10047
- this._resetCompilation();
10048
- var before;
10049
- if (typeof item.before === 'string') {
10050
- before = new Set([item.before]);
10051
- } else if (Array.isArray(item.before)) {
10052
- before = new Set(item.before);
10053
- }
10054
- var stage = 0;
10055
- if (typeof item.stage === 'number') {
10056
- stage = item.stage;
10057
- }
10058
- var i = this.taps.length;
10059
- while (i > 0) {
10060
- i--;
10061
- var x = this.taps[i];
10062
- this.taps[i + 1] = x;
10063
- var xStage = x.stage || 0;
10064
- if (before) {
10065
- if (before.has(x.name)) {
10066
- before.delete(x.name);
10067
- continue;
10068
- }
10069
- if (before.size > 0) {
10070
- continue;
9890
+ var _proto = AsyncParallelHook.prototype;
9891
+ _proto.tapPromise = function tapPromise(options, fn) {
9892
+ this.callbacks.push(fn);
9893
+ };
9894
+ _proto.promise = /*#__PURE__*/function () {
9895
+ var _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9896
+ var _len,
9897
+ args,
9898
+ _key,
9899
+ _args = arguments;
9900
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9901
+ while (1) switch (_context.prev = _context.next) {
9902
+ case 0:
9903
+ for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9904
+ args[_key] = _args[_key];
9905
+ }
9906
+ _context.next = 3;
9907
+ return Promise.all(this.callbacks.map(function (callback) {
9908
+ return callback.apply(void 0, args);
9909
+ }));
9910
+ case 3:
9911
+ case "end":
9912
+ return _context.stop();
10071
9913
  }
10072
- }
10073
- if (xStage > stage) {
10074
- continue;
10075
- }
10076
- i++;
10077
- break;
9914
+ }, _callee, this);
9915
+ }));
9916
+ function promise() {
9917
+ return _promise.apply(this, arguments);
10078
9918
  }
10079
- this.taps[i] = item;
10080
- };
10081
- return Hook;
9919
+ return promise;
9920
+ }();
9921
+ return AsyncParallelHook;
10082
9922
  }();
10083
- // Object.setPrototypeOf(Hook.prototype, null);
10084
-
10085
- // @ts-nocheck
10086
- var HookCodeFactory = /*#__PURE__*/function () {
10087
- function HookCodeFactory(config) {
10088
- this.config = config;
10089
- this.options = undefined;
10090
- this._args = undefined;
10091
- }
10092
- var _proto = HookCodeFactory.prototype;
10093
- _proto.create = function create(options) {
10094
- this.init(options);
10095
- var fn;
10096
- switch (this.options.type) {
10097
- case 'sync':
10098
- fn = new Function(this.args(), '"use strict";\n' + this.header() + this.contentWithInterceptors({
10099
- onError: function onError(err) {
10100
- return "throw " + err + ";\n";
10101
- },
10102
- onResult: function onResult(result) {
10103
- return "return " + result + ";\n";
10104
- },
10105
- resultReturns: true,
10106
- onDone: function onDone() {
10107
- return '';
10108
- },
10109
- rethrowIfPossible: true
10110
- }));
10111
- break;
10112
- case 'async':
10113
- fn = new Function(this.args({
10114
- after: '_callback'
10115
- }), '"use strict";\n' + this.header() + this.contentWithInterceptors({
10116
- onError: function onError(err) {
10117
- return "_callback(" + err + ");\n";
10118
- },
10119
- onResult: function onResult(result) {
10120
- return "_callback(null, " + result + ");\n";
10121
- },
10122
- onDone: function onDone() {
10123
- return '_callback();\n';
10124
- }
10125
- }));
10126
- break;
10127
- case 'promise':
10128
- var errorHelperUsed = false;
10129
- var content = this.contentWithInterceptors({
10130
- onError: function onError(err) {
10131
- errorHelperUsed = true;
10132
- return "_error(" + err + ");\n";
10133
- },
10134
- onResult: function onResult(result) {
10135
- return "_resolve(" + result + ");\n";
10136
- },
10137
- onDone: function onDone() {
10138
- return '_resolve();\n';
10139
- }
10140
- });
10141
- var code = '';
10142
- code += '"use strict";\n';
10143
- code += this.header();
10144
- code += 'return new Promise((function(_resolve, _reject) {\n';
10145
- if (errorHelperUsed) {
10146
- code += 'var _sync = true;\n';
10147
- code += 'function _error(_err) {\n';
10148
- code += 'if(_sync)\n';
10149
- code += '_resolve(Promise.resolve().then((function() { throw _err; })));\n';
10150
- code += 'else\n';
10151
- code += '_reject(_err);\n';
10152
- code += '};\n';
10153
- }
10154
- code += content;
10155
- if (errorHelperUsed) {
10156
- code += '_sync = false;\n';
10157
- }
10158
- code += '}));\n';
10159
- fn = new Function(this.args(), code);
10160
- break;
10161
- }
10162
- this.deinit();
10163
- return fn;
10164
- };
10165
- _proto.setup = function setup(instance, options) {
10166
- instance._x = options.taps.map(function (t) {
10167
- return t.fn;
10168
- });
9923
+
9924
+ var AsyncSeriesWaterfallHook = /*#__PURE__*/function () {
9925
+ function AsyncSeriesWaterfallHook() {
9926
+ this.callbacks = [];
10169
9927
  }
10170
- /**
10171
- * @param {{ type: "sync" | "promise" | "async", taps: Array<Tap>, interceptors: Array<Interceptor> }} options
10172
- */;
10173
- _proto.init = function init(options) {
10174
- this.options = options;
10175
- this._args = options.args.slice();
10176
- };
10177
- _proto.deinit = function deinit() {
10178
- this.options = undefined;
10179
- this._args = undefined;
10180
- };
10181
- _proto.contentWithInterceptors = function contentWithInterceptors(options) {
10182
- var _this = this;
10183
- if (this.options.interceptors.length > 0) {
10184
- var onError = options.onError;
10185
- var onResult = options.onResult;
10186
- var onDone = options.onDone;
10187
- var code = '';
10188
- for (var i = 0; i < this.options.interceptors.length; i++) {
10189
- var interceptor = this.options.interceptors[i];
10190
- if (interceptor.call) {
10191
- code += this.getInterceptor(i) + ".call(" + this.args({
10192
- before: interceptor.context ? '_context' : undefined
10193
- }) + ");\n";
10194
- }
10195
- }
10196
- code += this.content(Object.assign(options, {
10197
- onError: onError && function (err) {
10198
- var code = '';
10199
- for (var _i = 0; _i < _this.options.interceptors.length; _i++) {
10200
- var _interceptor = _this.options.interceptors[_i];
10201
- if (_interceptor.error) {
10202
- code += _this.getInterceptor(_i) + ".error(" + err + ");\n";
10203
- }
10204
- }
10205
- code += onError(err);
10206
- return code;
10207
- },
10208
- onResult: onResult && function (result) {
10209
- var code = '';
10210
- for (var _i2 = 0; _i2 < _this.options.interceptors.length; _i2++) {
10211
- var _interceptor2 = _this.options.interceptors[_i2];
10212
- if (_interceptor2.result) {
10213
- code += _this.getInterceptor(_i2) + ".result(" + result + ");\n";
9928
+ var _proto = AsyncSeriesWaterfallHook.prototype;
9929
+ _proto.tapPromise = function tapPromise(options, fn) {
9930
+ this.callbacks.push(fn);
9931
+ };
9932
+ _proto.promise = /*#__PURE__*/function () {
9933
+ var _promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9934
+ var _this$callbacks,
9935
+ result,
9936
+ i,
9937
+ callback,
9938
+ _args = arguments;
9939
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9940
+ while (1) switch (_context.prev = _context.next) {
9941
+ case 0:
9942
+ if (!this.callbacks.length) {
9943
+ _context.next = 14;
9944
+ break;
10214
9945
  }
10215
- }
10216
- code += onResult(result);
10217
- return code;
10218
- },
10219
- onDone: onDone && function () {
10220
- var code = '';
10221
- for (var _i3 = 0; _i3 < _this.options.interceptors.length; _i3++) {
10222
- var _interceptor3 = _this.options.interceptors[_i3];
10223
- if (_interceptor3.done) {
10224
- code += _this.getInterceptor(_i3) + ".done();\n";
9946
+ _context.next = 3;
9947
+ return (_this$callbacks = this.callbacks)[0].apply(_this$callbacks, _args);
9948
+ case 3:
9949
+ result = _context.sent;
9950
+ i = 0;
9951
+ case 5:
9952
+ if (!(i < this.callbacks.length - 1)) {
9953
+ _context.next = 13;
9954
+ break;
10225
9955
  }
10226
- }
10227
- code += onDone();
10228
- return code;
10229
- }
10230
- }));
10231
- return code;
10232
- } else {
10233
- return this.content(options);
10234
- }
10235
- };
10236
- _proto.header = function header() {
10237
- var code = '';
10238
- if (this.needContext()) {
10239
- code += 'var _context = {};\n';
10240
- } else {
10241
- code += 'var _context;\n';
10242
- }
10243
- code += 'var _x = this._x;\n';
10244
- if (this.options.interceptors.length > 0) {
10245
- code += 'var _taps = this.taps;\n';
10246
- code += 'var _interceptors = this.interceptors;\n';
10247
- }
10248
- return code;
10249
- };
10250
- _proto.needContext = function needContext() {
10251
- for (var _iterator = _createForOfIteratorHelperLoose(this.options.taps), _step; !(_step = _iterator()).done;) {
10252
- var tap = _step.value;
10253
- if (tap.context) return true;
10254
- }
10255
- return false;
10256
- };
10257
- _proto.callTap = function callTap(tapIndex, _ref) {
10258
- var onError = _ref.onError,
10259
- onResult = _ref.onResult,
10260
- onDone = _ref.onDone,
10261
- rethrowIfPossible = _ref.rethrowIfPossible;
10262
- var code = '';
10263
- var hasTapCached = false;
10264
- for (var i = 0; i < this.options.interceptors.length; i++) {
10265
- var interceptor = this.options.interceptors[i];
10266
- if (interceptor.tap) {
10267
- if (!hasTapCached) {
10268
- code += "var _tap" + tapIndex + " = " + this.getTap(tapIndex) + ";\n";
10269
- hasTapCached = true;
10270
- }
10271
- code += this.getInterceptor(i) + ".tap(" + (interceptor.context ? '_context, ' : '') + "_tap" + tapIndex + ");\n";
10272
- }
10273
- }
10274
- code += "var _fn" + tapIndex + " = " + this.getTapFn(tapIndex) + ";\n";
10275
- var tap = this.options.taps[tapIndex];
10276
- switch (tap.type) {
10277
- case 'sync':
10278
- if (!rethrowIfPossible) {
10279
- code += "var _hasError" + tapIndex + " = false;\n";
10280
- code += 'try {\n';
10281
- }
10282
- if (onResult) {
10283
- code += "var _result" + tapIndex + " = _fn" + tapIndex + "(" + this.args({
10284
- before: tap.context ? '_context' : undefined
10285
- }) + ");\n";
10286
- } else {
10287
- code += "_fn" + tapIndex + "(" + this.args({
10288
- before: tap.context ? '_context' : undefined
10289
- }) + ");\n";
10290
- }
10291
- if (!rethrowIfPossible) {
10292
- code += '} catch(_err) {\n';
10293
- code += "_hasError" + tapIndex + " = true;\n";
10294
- code += onError('_err');
10295
- code += '}\n';
10296
- code += "if(!_hasError" + tapIndex + ") {\n";
10297
- }
10298
- if (onResult) {
10299
- code += onResult("_result" + tapIndex);
10300
- }
10301
- if (onDone) {
10302
- code += onDone();
10303
- }
10304
- if (!rethrowIfPossible) {
10305
- code += '}\n';
10306
- }
10307
- break;
10308
- case 'async':
10309
- var cbCode = '';
10310
- if (onResult) cbCode += "(function(_err" + tapIndex + ", _result" + tapIndex + ") {\n";else cbCode += "(function(_err" + tapIndex + ") {\n";
10311
- cbCode += "if(_err" + tapIndex + ") {\n";
10312
- cbCode += onError("_err" + tapIndex);
10313
- cbCode += '} else {\n';
10314
- if (onResult) {
10315
- cbCode += onResult("_result" + tapIndex);
10316
- }
10317
- if (onDone) {
10318
- cbCode += onDone();
10319
- }
10320
- cbCode += '}\n';
10321
- cbCode += '})';
10322
- code += "_fn" + tapIndex + "(" + this.args({
10323
- before: tap.context ? '_context' : undefined,
10324
- after: cbCode
10325
- }) + ");\n";
10326
- break;
10327
- case 'promise':
10328
- code += "var _hasResult" + tapIndex + " = false;\n";
10329
- code += "var _promise" + tapIndex + " = _fn" + tapIndex + "(" + this.args({
10330
- before: tap.context ? '_context' : undefined
10331
- }) + ");\n";
10332
- code += "if (!_promise" + tapIndex + " || !_promise" + tapIndex + ".then)\n";
10333
- code += " throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise" + tapIndex + " + ')');\n";
10334
- code += "_promise" + tapIndex + ".then((function(_result" + tapIndex + ") {\n";
10335
- code += "_hasResult" + tapIndex + " = true;\n";
10336
- if (onResult) {
10337
- code += onResult("_result" + tapIndex);
10338
- }
10339
- if (onDone) {
10340
- code += onDone();
9956
+ callback = this.callbacks[i]; // @ts-ignore
9957
+ _context.next = 9;
9958
+ return callback(result);
9959
+ case 9:
9960
+ result = _context.sent;
9961
+ case 10:
9962
+ i++;
9963
+ _context.next = 5;
9964
+ break;
9965
+ case 13:
9966
+ return _context.abrupt("return", result);
9967
+ case 14:
9968
+ return _context.abrupt("return", null);
9969
+ case 15:
9970
+ case "end":
9971
+ return _context.stop();
10341
9972
  }
10342
- code += "}), function(_err" + tapIndex + ") {\n";
10343
- code += "if(_hasResult" + tapIndex + ") throw _err" + tapIndex + ";\n";
10344
- code += onError("_err" + tapIndex);
10345
- code += '});\n';
10346
- break;
10347
- }
10348
- return code;
10349
- };
10350
- _proto.callTapsSeries = function callTapsSeries(_ref2) {
10351
- var _this2 = this;
10352
- var _onError = _ref2.onError,
10353
- onResult = _ref2.onResult,
10354
- resultReturns = _ref2.resultReturns,
10355
- onDone = _ref2.onDone,
10356
- doneReturns = _ref2.doneReturns,
10357
- rethrowIfPossible = _ref2.rethrowIfPossible;
10358
- if (this.options.taps.length === 0) return onDone();
10359
- var firstAsync = this.options.taps.findIndex(function (t) {
10360
- return t.type !== 'sync';
10361
- });
10362
- var somethingReturns = resultReturns || doneReturns;
10363
- var code = '';
10364
- var current = onDone;
10365
- var unrollCounter = 0;
10366
- var _loop = function _loop() {
10367
- var i = j;
10368
- var unroll = current !== onDone && (_this2.options.taps[i].type !== 'sync' || unrollCounter++ > 20);
10369
- if (unroll) {
10370
- unrollCounter = 0;
10371
- code += "function _next" + i + "() {\n";
10372
- code += current();
10373
- code += "}\n";
10374
- current = function current() {
10375
- return (somethingReturns ? 'return ' : '') + "_next" + i + "();\n";
10376
- };
10377
- }
10378
- var done = current;
10379
- var doneBreak = function doneBreak(skipDone) {
10380
- if (skipDone) return '';
10381
- return onDone();
10382
- };
10383
- var content = _this2.callTap(i, {
10384
- onError: function onError(error) {
10385
- return _onError(i, error, done, doneBreak);
10386
- },
10387
- onResult: onResult && function (result) {
10388
- return onResult(i, result, done, doneBreak);
10389
- },
10390
- onDone: !onResult && done,
10391
- rethrowIfPossible: rethrowIfPossible && (firstAsync < 0 || i < firstAsync)
10392
- });
10393
- current = function current() {
10394
- return content;
10395
- };
10396
- };
10397
- for (var j = this.options.taps.length - 1; j >= 0; j--) {
10398
- _loop();
10399
- }
10400
- code += current();
10401
- return code;
10402
- };
10403
- _proto.callTapsLooping = function callTapsLooping(_ref3) {
10404
- var onError = _ref3.onError,
10405
- onDone = _ref3.onDone,
10406
- rethrowIfPossible = _ref3.rethrowIfPossible;
10407
- if (this.options.taps.length === 0) return onDone();
10408
- var syncOnly = this.options.taps.every(function (t) {
10409
- return t.type === 'sync';
10410
- });
10411
- var code = '';
10412
- if (!syncOnly) {
10413
- code += 'var _looper = (function() {\n';
10414
- code += 'var _loopAsync = false;\n';
10415
- }
10416
- code += 'var _loop;\n';
10417
- code += 'do {\n';
10418
- code += '_loop = false;\n';
10419
- for (var i = 0; i < this.options.interceptors.length; i++) {
10420
- var interceptor = this.options.interceptors[i];
10421
- if (interceptor.loop) {
10422
- code += this.getInterceptor(i) + ".loop(" + this.args({
10423
- before: interceptor.context ? '_context' : undefined
10424
- }) + ");\n";
10425
- }
10426
- }
10427
- code += this.callTapsSeries({
10428
- onError: onError,
10429
- onResult: function onResult(i, result, next, doneBreak) {
10430
- var code = '';
10431
- code += "if(" + result + " !== undefined) {\n";
10432
- code += '_loop = true;\n';
10433
- if (!syncOnly) code += 'if(_loopAsync) _looper();\n';
10434
- code += doneBreak(true);
10435
- code += "} else {\n";
10436
- code += next();
10437
- code += "}\n";
10438
- return code;
10439
- },
10440
- onDone: onDone && function () {
10441
- var code = '';
10442
- code += 'if(!_loop) {\n';
10443
- code += onDone();
10444
- code += '}\n';
10445
- return code;
10446
- },
10447
- rethrowIfPossible: rethrowIfPossible && syncOnly
10448
- });
10449
- code += '} while(_loop);\n';
10450
- if (!syncOnly) {
10451
- code += '_loopAsync = true;\n';
10452
- code += '});\n';
10453
- code += '_looper();\n';
10454
- }
10455
- return code;
10456
- };
10457
- _proto.callTapsParallel = function callTapsParallel(_ref4) {
10458
- var _this3 = this;
10459
- var _onError2 = _ref4.onError,
10460
- onResult = _ref4.onResult,
10461
- onDone = _ref4.onDone,
10462
- rethrowIfPossible = _ref4.rethrowIfPossible,
10463
- _ref4$onTap = _ref4.onTap,
10464
- onTap = _ref4$onTap === void 0 ? function (i, run) {
10465
- return run();
10466
- } : _ref4$onTap;
10467
- if (this.options.taps.length <= 1) {
10468
- return this.callTapsSeries({
10469
- onError: _onError2,
10470
- onResult: onResult,
10471
- onDone: onDone,
10472
- rethrowIfPossible: rethrowIfPossible
10473
- });
10474
- }
10475
- var code = '';
10476
- code += 'do {\n';
10477
- code += "var _counter = " + this.options.taps.length + ";\n";
10478
- if (onDone) {
10479
- code += 'var _done = (function() {\n';
10480
- code += onDone();
10481
- code += '});\n';
10482
- }
10483
- var _loop2 = function _loop2(i) {
10484
- var done = function done() {
10485
- if (onDone) return 'if(--_counter === 0) _done();\n';else return '--_counter;';
10486
- };
10487
- var doneBreak = function doneBreak(skipDone) {
10488
- if (skipDone || !onDone) return '_counter = 0;\n';else return '_counter = 0;\n_done();\n';
10489
- };
10490
- code += 'if(_counter <= 0) break;\n';
10491
- code += onTap(i, function () {
10492
- return _this3.callTap(i, {
10493
- onError: function onError(error) {
10494
- var code = '';
10495
- code += 'if(_counter > 0) {\n';
10496
- code += _onError2(i, error, done, doneBreak);
10497
- code += '}\n';
10498
- return code;
10499
- },
10500
- onResult: onResult && function (result) {
10501
- var code = '';
10502
- code += 'if(_counter > 0) {\n';
10503
- code += onResult(i, result, done, doneBreak);
10504
- code += '}\n';
10505
- return code;
10506
- },
10507
- onDone: !onResult && function () {
10508
- return done();
10509
- },
10510
- rethrowIfPossible: rethrowIfPossible
10511
- });
10512
- }, done, doneBreak);
10513
- };
10514
- for (var i = 0; i < this.options.taps.length; i++) {
10515
- _loop2(i);
10516
- }
10517
- code += '} while(false);\n';
10518
- return code;
10519
- };
10520
- _proto.args = function args(_temp) {
10521
- var _ref5 = _temp === void 0 ? {} : _temp,
10522
- before = _ref5.before,
10523
- after = _ref5.after;
10524
- var allArgs = this._args;
10525
- if (before) allArgs = [before].concat(allArgs);
10526
- if (after) allArgs = allArgs.concat(after);
10527
- if (allArgs.length === 0) {
10528
- return '';
10529
- } else {
10530
- return allArgs.join(', ');
9973
+ }, _callee, this);
9974
+ }));
9975
+ function promise() {
9976
+ return _promise.apply(this, arguments);
10531
9977
  }
10532
- };
10533
- _proto.getTapFn = function getTapFn(idx) {
10534
- return "_x[" + idx + "]";
10535
- };
10536
- _proto.getTap = function getTap(idx) {
10537
- return "_taps[" + idx + "]";
10538
- };
10539
- _proto.getInterceptor = function getInterceptor(idx) {
10540
- return "_interceptors[" + idx + "]";
10541
- };
10542
- return HookCodeFactory;
9978
+ return promise;
9979
+ }();
9980
+ return AsyncSeriesWaterfallHook;
10543
9981
  }();
10544
9982
 
10545
- var AsyncParallelHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
10546
- _inheritsLoose(AsyncParallelHookCodeFactory, _HookCodeFactory);
10547
- function AsyncParallelHookCodeFactory() {
10548
- return _HookCodeFactory.apply(this, arguments) || this;
10549
- }
10550
- var _proto = AsyncParallelHookCodeFactory.prototype;
10551
- _proto.content = function content(_ref) {
10552
- var _onError = _ref.onError,
10553
- onDone = _ref.onDone;
10554
- return this.callTapsParallel({
10555
- onError: function onError(i, err, done, doneBreak) {
10556
- return _onError(err) + doneBreak(true);
10557
- },
10558
- onDone: onDone
10559
- });
10560
- };
10561
- return AsyncParallelHookCodeFactory;
10562
- }(HookCodeFactory);
10563
- var factory = new AsyncParallelHookCodeFactory();
10564
- var COMPILE = function COMPILE(options) {
10565
- factory.setup(this, options);
10566
- return factory.create(options);
10567
- };
10568
- var AsyncParallelHook = /*#__PURE__*/function (_Hook) {
10569
- _inheritsLoose(AsyncParallelHook, _Hook);
10570
- function AsyncParallelHook(args, name) {
10571
- var _this;
10572
- if (args === void 0) {
10573
- args = [];
10574
- }
10575
- if (name === void 0) {
10576
- name = undefined;
10577
- }
10578
- _this = _Hook.call(this, args, name) || this;
10579
- _this.compile = COMPILE;
10580
- _this._call = undefined;
10581
- _this.call = undefined;
10582
- return _this;
9983
+ var SyncHook = /*#__PURE__*/function () {
9984
+ function SyncHook() {
9985
+ this.callbacks = [];
10583
9986
  }
10584
- return AsyncParallelHook;
10585
- }(Hook);
10586
- // export function AsyncParallelHook(args = [], name = undefined) {
10587
- // const hook = new Hook(args, name);
10588
- // hook.constructor = AsyncParallelHook;
10589
- // hook.compile = COMPILE;
10590
- // hook._call = undefined;
10591
- // hook.call = undefined;
10592
- // return hook;
10593
- // }
10594
- // AsyncParallelHook.prototype = null;
10595
-
10596
- var AsyncSeriesWaterfallHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
10597
- _inheritsLoose(AsyncSeriesWaterfallHookCodeFactory, _HookCodeFactory);
10598
- function AsyncSeriesWaterfallHookCodeFactory() {
10599
- return _HookCodeFactory.apply(this, arguments) || this;
10600
- }
10601
- var _proto = AsyncSeriesWaterfallHookCodeFactory.prototype;
10602
- _proto.content = function content(_ref) {
10603
- var _this = this;
10604
- var _onError = _ref.onError,
10605
- onResult = _ref.onResult,
10606
- onDone = _ref.onDone;
10607
- return this.callTapsSeries({
10608
- onError: function onError(i, err, next, doneBreak) {
10609
- return _onError(err) + doneBreak(true);
10610
- },
10611
- onResult: function onResult(i, result, next) {
10612
- var code = '';
10613
- code += "if(" + result + " !== undefined) {\n";
10614
- code += _this._args[0] + " = " + result + ";\n";
10615
- code += "}\n";
10616
- code += next();
10617
- return code;
10618
- },
10619
- onDone: function onDone() {
10620
- return onResult(_this._args[0]);
10621
- }
10622
- });
9987
+ var _proto = SyncHook.prototype;
9988
+ _proto.tap = function tap(options, fn) {
9989
+ this.callbacks.push(fn);
10623
9990
  };
10624
- return AsyncSeriesWaterfallHookCodeFactory;
10625
- }(HookCodeFactory);
10626
- var factory$1 = new AsyncSeriesWaterfallHookCodeFactory();
10627
- var COMPILE$1 = function COMPILE(options) {
10628
- factory$1.setup(this, options);
10629
- return factory$1.create(options);
10630
- };
10631
- // export function AsyncSeriesWaterfallHook(args = [], name = undefined) {
10632
- // if (args.length < 1) throw new Error('Waterfall hooks must have at least one argument');
10633
- // const hook = new Hook(args, name);
10634
- // hook.constructor = AsyncSeriesWaterfallHook;
10635
- // hook.compile = COMPILE;
10636
- // hook._call = undefined;
10637
- // hook.call = undefined;
10638
- // return hook;
10639
- // }
10640
- // AsyncSeriesWaterfallHook.prototype = null;
10641
- var AsyncSeriesWaterfallHook = /*#__PURE__*/function (_Hook) {
10642
- _inheritsLoose(AsyncSeriesWaterfallHook, _Hook);
10643
- function AsyncSeriesWaterfallHook(args, name) {
10644
- var _this2;
10645
- if (args === void 0) {
10646
- args = [];
10647
- }
10648
- if (name === void 0) {
10649
- name = undefined;
10650
- }
10651
- _this2 = _Hook.call(this, args, name) || this;
10652
- _this2.compile = COMPILE$1;
10653
- _this2._call = undefined;
10654
- _this2.call = undefined;
10655
- return _this2;
10656
- }
10657
- return AsyncSeriesWaterfallHook;
10658
- }(Hook);
10659
-
10660
- var SyncHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
10661
- _inheritsLoose(SyncHookCodeFactory, _HookCodeFactory);
10662
- function SyncHookCodeFactory() {
10663
- return _HookCodeFactory.apply(this, arguments) || this;
10664
- }
10665
- var _proto = SyncHookCodeFactory.prototype;
10666
- _proto.content = function content(_ref) {
10667
- var _onError = _ref.onError,
10668
- onDone = _ref.onDone,
10669
- rethrowIfPossible = _ref.rethrowIfPossible;
10670
- return this.callTapsSeries({
10671
- onError: function onError(i, err) {
10672
- return _onError(err);
10673
- },
10674
- onDone: onDone,
10675
- rethrowIfPossible: rethrowIfPossible
9991
+ _proto.call = function call() {
9992
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9993
+ args[_key] = arguments[_key];
9994
+ }
9995
+ this.callbacks.forEach(function (callback) {
9996
+ callback.apply(void 0, args);
10676
9997
  });
10677
9998
  };
10678
- return SyncHookCodeFactory;
10679
- }(HookCodeFactory);
10680
- var factory$2 = new SyncHookCodeFactory();
10681
- var TAP_ASYNC = function TAP_ASYNC() {
10682
- throw new Error('tapAsync is not supported on a SyncHook');
10683
- };
10684
- var TAP_PROMISE = function TAP_PROMISE() {
10685
- throw new Error('tapPromise is not supported on a SyncHook');
10686
- };
10687
- var COMPILE$2 = function COMPILE(options) {
10688
- factory$2.setup(this, options);
10689
- return factory$2.create(options);
10690
- };
10691
- var SyncHook = /*#__PURE__*/function (_Hook) {
10692
- _inheritsLoose(SyncHook, _Hook);
10693
- function SyncHook(args, name) {
10694
- var _this;
10695
- if (args === void 0) {
10696
- args = [];
10697
- }
10698
- if (name === void 0) {
10699
- name = undefined;
10700
- }
10701
- _this = _Hook.call(this, args, name) || this;
10702
- _this.tapAsync = TAP_ASYNC;
10703
- _this.tapPromise = TAP_PROMISE;
10704
- _this.compile = COMPILE$2;
10705
- return _this;
10706
- }
10707
9999
  return SyncHook;
10708
- }(Hook);
10709
- // export function SyncHook(args = [], name = undefined) {
10710
- // const hook = new Hook(args, name);
10711
- // hook.constructor = SyncHook;
10712
- // hook.tapAsync = TAP_ASYNC;
10713
- // hook.tapPromise = TAP_PROMISE;
10714
- // hook.compile = COMPILE;
10715
- // return hook;
10716
- // }
10717
- // SyncHook.prototype = null;
10000
+ }();
10718
10001
 
10719
- var SyncWaterfallHookCodeFactory = /*#__PURE__*/function (_HookCodeFactory) {
10720
- _inheritsLoose(SyncWaterfallHookCodeFactory, _HookCodeFactory);
10721
- function SyncWaterfallHookCodeFactory() {
10722
- return _HookCodeFactory.apply(this, arguments) || this;
10002
+ var SyncWaterfallHook = /*#__PURE__*/function () {
10003
+ function SyncWaterfallHook() {
10004
+ this.callbacks = [];
10723
10005
  }
10724
- var _proto = SyncWaterfallHookCodeFactory.prototype;
10725
- _proto.content = function content(_ref) {
10726
- var _this = this;
10727
- var _onError = _ref.onError,
10728
- onResult = _ref.onResult,
10729
- resultReturns = _ref.resultReturns,
10730
- rethrowIfPossible = _ref.rethrowIfPossible;
10731
- return this.callTapsSeries({
10732
- onError: function onError(i, err) {
10733
- return _onError(err);
10734
- },
10735
- onResult: function onResult(i, result, next) {
10736
- var code = '';
10737
- code += "if(" + result + " !== undefined) {\n";
10738
- code += _this._args[0] + " = " + result + ";\n";
10739
- code += "}\n";
10740
- code += next();
10741
- return code;
10742
- },
10743
- onDone: function onDone() {
10744
- return onResult(_this._args[0]);
10745
- },
10746
- doneReturns: resultReturns,
10747
- rethrowIfPossible: rethrowIfPossible
10748
- });
10006
+ var _proto = SyncWaterfallHook.prototype;
10007
+ _proto.tap = function tap(options, fn) {
10008
+ this.callbacks.push(fn);
10009
+ };
10010
+ _proto.call = function call() {
10011
+ if (this.callbacks.length) {
10012
+ var _this$callbacks;
10013
+ var result = (_this$callbacks = this.callbacks)[0].apply(_this$callbacks, arguments);
10014
+ for (var i = 0; i < this.callbacks.length - 1; i++) {
10015
+ var callback = this.callbacks[i];
10016
+ // @ts-ignore
10017
+ result = callback(result);
10018
+ }
10019
+ return result;
10020
+ }
10021
+ return null;
10749
10022
  };
10750
- return SyncWaterfallHookCodeFactory;
10751
- }(HookCodeFactory);
10752
- var factory$3 = new SyncWaterfallHookCodeFactory();
10753
- var TAP_ASYNC$1 = function TAP_ASYNC() {
10754
- throw new Error('tapAsync is not supported on a SyncWaterfallHook');
10755
- };
10756
- var TAP_PROMISE$1 = function TAP_PROMISE() {
10757
- throw new Error('tapPromise is not supported on a SyncWaterfallHook');
10758
- };
10759
- var COMPILE$3 = function COMPILE(options) {
10760
- factory$3.setup(this, options);
10761
- return factory$3.create(options);
10762
- };
10763
- var SyncWaterfallHook = /*#__PURE__*/function (_SyncHook) {
10764
- _inheritsLoose(SyncWaterfallHook, _SyncHook);
10765
- function SyncWaterfallHook(args, name) {
10766
- var _this2;
10767
- if (args === void 0) {
10768
- args = [];
10769
- }
10770
- if (name === void 0) {
10771
- name = undefined;
10772
- }
10773
- _this2 = _SyncHook.call(this, args, name) || this;
10774
- _this2.tapAsync = TAP_ASYNC$1;
10775
- _this2.tapPromise = TAP_PROMISE$1;
10776
- _this2.compile = COMPILE$3;
10777
- return _this2;
10778
- }
10779
10023
  return SyncWaterfallHook;
10780
- }(SyncHook);
10781
- // export function SyncWaterfallHook(args = [], name = undefined) {
10782
- // if (args.length < 1) throw new Error('Waterfall hooks must have at least one argument');
10783
- // const hook = new Hook(args, name);
10784
- // hook.constructor = SyncWaterfallHook;
10785
- // hook.tapAsync = TAP_ASYNC;
10786
- // hook.tapPromise = TAP_PROMISE;
10787
- // hook.compile = COMPILE;
10788
- // return hook;
10789
- // }
10790
- // SyncWaterfallHook.prototype = null;
10024
+ }();
10791
10025
 
10792
10026
  var genericFontFamilies = ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui'];
10793
10027
  var stringRegExp = /([\"\'])[^\'\"]+\1/;
@@ -12765,13 +11999,12 @@
12765
11999
  }();
12766
12000
 
12767
12001
  var Plane = /*#__PURE__*/function () {
12768
- /**
12769
- * lookup table for p-vertex & n-vertex when doing frustum culling
12770
- */
12771
-
12772
12002
  function Plane(distance, normal) {
12773
12003
  this.distance = void 0;
12774
12004
  this.normal = void 0;
12005
+ /**
12006
+ * lookup table for p-vertex & n-vertex when doing frustum culling
12007
+ */
12775
12008
  this.pnVertexFlag = void 0;
12776
12009
  this.distance = distance || 0;
12777
12010
  this.normal = normal || fromValues$2(0, 1, 0);
@@ -15530,32 +14763,29 @@
15530
14763
  */
15531
14764
  var DisplayObject = /*#__PURE__*/function (_Element) {
15532
14765
  _inheritsLoose(DisplayObject, _Element);
15533
- /**
15534
- * contains style props in constructor's params, eg. fill, stroke...
15535
- */
15536
-
15537
- /**
15538
- * push to active animations after calling `animate()`
15539
- */
15540
-
15541
- /**
15542
- * Use data-* attribute.
15543
- * @see https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
15544
- * @example
15545
- * group.dataset.prop1 = 1;
15546
- * group.getAttribute('data-prop1'); // 1
15547
- */
15548
-
15549
14766
  function DisplayObject(config) {
15550
14767
  var _this$config$capture;
15551
14768
  var _this;
15552
14769
  _this = _Element.call(this) || this;
15553
14770
  // assign name, id to config
15554
14771
  // eg. group.get('name')
14772
+ /**
14773
+ * contains style props in constructor's params, eg. fill, stroke...
14774
+ */
15555
14775
  _this.config = void 0;
15556
14776
  _this.isCustomElement = false;
15557
14777
  _this.isMutationObserved = false;
14778
+ /**
14779
+ * push to active animations after calling `animate()`
14780
+ */
15558
14781
  _this.activeAnimations = [];
14782
+ /**
14783
+ * Use data-* attribute.
14784
+ * @see https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
14785
+ * @example
14786
+ * group.dataset.prop1 = 1;
14787
+ * group.getAttribute('data-prop1'); // 1
14788
+ */
15559
14789
  _this.dataset = void 0;
15560
14790
  /**
15561
14791
  * Use `this.style.clipPath` instead.
@@ -15711,7 +14941,12 @@
15711
14941
  options.usedAttributes = INHERITABLE_STYLE_PROPS;
15712
14942
  }
15713
14943
  // account for FCP, process properties as less as possible
15714
- runtime.styleValueRegistry.processProperties(this, attributes, options);
14944
+ var formattedAttributes = {};
14945
+ for (var name in attributes) {
14946
+ var attributeName = formatAttributeName(name);
14947
+ formattedAttributes[attributeName] = attributes[name];
14948
+ }
14949
+ runtime.styleValueRegistry.processProperties(this, formattedAttributes, options);
15715
14950
  // redraw at next frame
15716
14951
  renderable.dirty = true;
15717
14952
  };
@@ -16291,10 +15526,6 @@
16291
15526
  */
16292
15527
  var CustomElement = /*#__PURE__*/function (_DisplayObject) {
16293
15528
  _inheritsLoose(CustomElement, _DisplayObject);
16294
- // static get observedAttributes(): string[] {
16295
- // return [];
16296
- // }
16297
-
16298
15529
  // private shadowNodes: DisplayObject[] = [];
16299
15530
  function CustomElement(_temp) {
16300
15531
  var _this;
@@ -16307,6 +15538,9 @@
16307
15538
  y: ''
16308
15539
  }, style) : _extends({}, style)
16309
15540
  }, rest)) || this;
15541
+ // static get observedAttributes(): string[] {
15542
+ // return [];
15543
+ // }
16310
15544
  _this.isCustomElement = true;
16311
15545
  return _this;
16312
15546
  }
@@ -16630,10 +15864,6 @@
16630
15864
  };
16631
15865
  var Path = /*#__PURE__*/function (_DisplayObject) {
16632
15866
  _inheritsLoose(Path, _DisplayObject);
16633
- /**
16634
- * markers placed at the mid
16635
- */
16636
-
16637
15867
  function Path(_temp) {
16638
15868
  var _this;
16639
15869
  var _ref = _temp === void 0 ? {} : _temp,
@@ -16652,6 +15882,9 @@
16652
15882
  }, rest)) || this;
16653
15883
  _this.markerStartAngle = 0;
16654
15884
  _this.markerEndAngle = 0;
15885
+ /**
15886
+ * markers placed at the mid
15887
+ */
16655
15888
  _this.markerMidList = [];
16656
15889
  var _this$parsedStyle = _this.parsedStyle,
16657
15890
  markerStart = _this$parsedStyle.markerStart,
@@ -16858,10 +16091,6 @@
16858
16091
  var _excluded$8 = ["style"];
16859
16092
  var Polygon = /*#__PURE__*/function (_DisplayObject) {
16860
16093
  _inheritsLoose(Polygon, _DisplayObject);
16861
- /**
16862
- * markers placed at the mid
16863
- */
16864
-
16865
16094
  function Polygon(_temp) {
16866
16095
  var _this;
16867
16096
  var _ref = _temp === void 0 ? {} : _temp,
@@ -16886,6 +16115,9 @@
16886
16115
  }, rest)) || this;
16887
16116
  _this.markerStartAngle = 0;
16888
16117
  _this.markerEndAngle = 0;
16118
+ /**
16119
+ * markers placed at the mid
16120
+ */
16889
16121
  _this.markerMidList = [];
16890
16122
  var _this$parsedStyle = _this.parsedStyle,
16891
16123
  markerStart = _this$parsedStyle.markerStart,
@@ -17288,7 +16520,11 @@
17288
16520
  int: true,
17289
16521
  k: ['none'],
17290
16522
  d: 'none',
17291
- syntax: exports.PropertySyntax.PAINT
16523
+ syntax: exports.PropertySyntax.PAINT,
16524
+ /**
16525
+ * Stroke 'none' won't affect geometry but others will.
16526
+ */
16527
+ l: true
17292
16528
  }, {
17293
16529
  n: 'shadowType',
17294
16530
  k: ['inner', 'outer', 'both'],
@@ -17779,28 +17015,6 @@
17779
17015
  };
17780
17016
  }
17781
17017
  if (!runtime.enableCSSParsing) {
17782
- // alias
17783
- // @ts-ignore
17784
- if (attributes.src) {
17785
- // @ts-ignore
17786
- attributes.img = attributes.src;
17787
- }
17788
- // @ts-ignore
17789
- if (attributes.d) {
17790
- // @ts-ignore
17791
- attributes.path = attributes.d;
17792
- }
17793
- if (attributes.strokeDasharray) {
17794
- attributes.lineDash = attributes.strokeDasharray;
17795
- }
17796
- if (attributes.strokeWidth) {
17797
- attributes.lineWidth = attributes.strokeWidth;
17798
- }
17799
- // @ts-ignore
17800
- if (attributes.textAnchor) {
17801
- // @ts-ignore
17802
- attributes.textAlign = attributes.textAnchor;
17803
- }
17804
17018
  Object.assign(object.attributes, attributes);
17805
17019
  var _attributeNames = Object.keys(attributes);
17806
17020
  // clipPath
@@ -17967,11 +17181,10 @@
17967
17181
  var attributeNames = Object.keys(attributes);
17968
17182
  attributeNames.forEach(function (attributeName) {
17969
17183
  var _propertyMetadataCach;
17970
- var name = formatAttributeName(attributeName);
17971
17184
  if (!skipUpdateAttribute) {
17972
- object.attributes[name] = attributes[attributeName];
17185
+ object.attributes[attributeName] = attributes[attributeName];
17973
17186
  }
17974
- if (!needUpdateGeometry && ((_propertyMetadataCach = propertyMetadataCache[name]) === null || _propertyMetadataCach === void 0 ? void 0 : _propertyMetadataCach.l)) {
17187
+ if (!needUpdateGeometry && ((_propertyMetadataCach = propertyMetadataCache[attributeName]) === null || _propertyMetadataCach === void 0 ? void 0 : _propertyMetadataCach.l)) {
17975
17188
  needUpdateGeometry = true;
17976
17189
  }
17977
17190
  });
@@ -20096,48 +19309,48 @@
20096
19309
  /**
20097
19310
  * only dirty object which has sth changed will be rendered
20098
19311
  */
20099
- dirtycheck: new SyncWaterfallHook(['object']),
19312
+ dirtycheck: new SyncWaterfallHook(),
20100
19313
  /**
20101
19314
  * do culling
20102
19315
  */
20103
- cull: new SyncWaterfallHook(['object', 'camera']),
19316
+ cull: new SyncWaterfallHook(),
20104
19317
  /**
20105
19318
  * called at beginning of each frame, won't get called if nothing to re-render
20106
19319
  */
20107
- beginFrame: new SyncHook([]),
19320
+ beginFrame: new SyncHook(),
20108
19321
  /**
20109
19322
  * called before every dirty object get rendered
20110
19323
  */
20111
- beforeRender: new SyncHook(['objectToRender']),
19324
+ beforeRender: new SyncHook(),
20112
19325
  /**
20113
19326
  * called when every dirty object rendering even it's culled
20114
19327
  */
20115
- render: new SyncHook(['objectToRender']),
19328
+ render: new SyncHook(),
20116
19329
  /**
20117
19330
  * called after every dirty object get rendered
20118
19331
  */
20119
- afterRender: new SyncHook(['objectToRender']),
20120
- endFrame: new SyncHook([]),
20121
- destroy: new SyncHook([]),
19332
+ afterRender: new SyncHook(),
19333
+ endFrame: new SyncHook(),
19334
+ destroy: new SyncHook(),
20122
19335
  /**
20123
19336
  * use async but faster method such as GPU-based picking in `g-plugin-device-renderer`
20124
19337
  */
20125
- pick: new AsyncSeriesWaterfallHook(['result']),
19338
+ pick: new AsyncSeriesWaterfallHook(),
20126
19339
  /**
20127
19340
  * Unsafe but sync version of pick.
20128
19341
  */
20129
- pickSync: new SyncWaterfallHook(['result']),
19342
+ pickSync: new SyncWaterfallHook(),
20130
19343
  /**
20131
19344
  * used in event system
20132
19345
  */
20133
- pointerDown: new SyncHook(['event']),
20134
- pointerUp: new SyncHook(['event']),
20135
- pointerMove: new SyncHook(['event']),
20136
- pointerOut: new SyncHook(['event']),
20137
- pointerOver: new SyncHook(['event']),
20138
- pointerWheel: new SyncHook(['event']),
20139
- pointerCancel: new SyncHook(['event']),
20140
- click: new SyncHook(['event'])
19346
+ pointerDown: new SyncHook(),
19347
+ pointerUp: new SyncHook(),
19348
+ pointerMove: new SyncHook(),
19349
+ pointerOut: new SyncHook(),
19350
+ pointerOver: new SyncHook(),
19351
+ pointerWheel: new SyncHook(),
19352
+ pointerCancel: new SyncHook(),
19353
+ click: new SyncHook()
20141
19354
  };
20142
19355
  this.globalRuntime = globalRuntime;
20143
19356
  this.context = context;
@@ -22255,66 +21468,55 @@
22255
21468
  */
22256
21469
  var Canvas = /*#__PURE__*/function (_EventTarget) {
22257
21470
  _inheritsLoose(Canvas, _EventTarget);
22258
- /**
22259
- * window.document
22260
- */
22261
-
22262
- /**
22263
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
22264
- */
22265
-
22266
- /**
22267
- * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
22268
- */
22269
-
22270
- /**
22271
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
22272
- */
22273
-
22274
- /**
22275
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
22276
- */
22277
-
22278
- /**
22279
- * whether the runtime supports PointerEvent?
22280
- * if not, the event system won't trigger pointer events like `pointerdown`
22281
- */
22282
-
22283
- /**
22284
- * whether the runtime supports TouchEvent?
22285
- * if not, the event system won't trigger touch events like `touchstart`
22286
- */
22287
-
22288
- /**
22289
- * is this native event a TouchEvent?
22290
- */
22291
-
22292
- /**
22293
- * is this native event a MouseEvent?
22294
- */
22295
-
22296
- /**
22297
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element
22298
- */
22299
-
22300
- /**
22301
- * rAF in auto rendering
22302
- */
22303
-
22304
21471
  function Canvas(config) {
22305
21472
  var _this;
22306
21473
  _this = _EventTarget.call(this) || this;
22307
21474
  // create document
21475
+ /**
21476
+ * window.document
21477
+ */
22308
21478
  _this.document = void 0;
21479
+ /**
21480
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry
21481
+ */
22309
21482
  _this.customElements = void 0;
21483
+ /**
21484
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
21485
+ */
22310
21486
  _this.requestAnimationFrame = void 0;
21487
+ /**
21488
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
21489
+ */
22311
21490
  _this.cancelAnimationFrame = void 0;
21491
+ /**
21492
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
21493
+ */
22312
21494
  _this.devicePixelRatio = void 0;
21495
+ /**
21496
+ * whether the runtime supports PointerEvent?
21497
+ * if not, the event system won't trigger pointer events like `pointerdown`
21498
+ */
22313
21499
  _this.supportsPointerEvents = void 0;
21500
+ /**
21501
+ * whether the runtime supports TouchEvent?
21502
+ * if not, the event system won't trigger touch events like `touchstart`
21503
+ */
22314
21504
  _this.supportsTouchEvents = void 0;
21505
+ /**
21506
+ * is this native event a TouchEvent?
21507
+ */
22315
21508
  _this.isTouchEvent = void 0;
21509
+ /**
21510
+ * is this native event a MouseEvent?
21511
+ */
22316
21512
  _this.isMouseEvent = void 0;
21513
+ /**
21514
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element
21515
+ */
22317
21516
  _this.Element = DisplayObject;
21517
+ /**
21518
+ * rAF in auto rendering
21519
+ */
22318
21520
  _this.frameId = void 0;
22319
21521
  _this.inited = false;
22320
21522
  _this.readyPromise = void 0;