@visactor/vrender 0.14.1 → 0.14.3-alpha.1

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.js CHANGED
@@ -3649,7 +3649,7 @@
3649
3649
  return Array.isArray(object) && object.some(isPromise);
3650
3650
  }
3651
3651
 
3652
- var __awaiter$3 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3652
+ var __awaiter$4 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3653
3653
  function adopt(value) {
3654
3654
  return value instanceof P ? value : new P(function (resolve) {
3655
3655
  resolve(value);
@@ -3794,7 +3794,7 @@
3794
3794
  }
3795
3795
  };
3796
3796
  var _saveAsyncResultToSingletonScope = function _saveAsyncResultToSingletonScope(binding, asyncResult) {
3797
- return __awaiter$3(void 0, void 0, void 0, function () {
3797
+ return __awaiter$4(void 0, void 0, void 0, function () {
3798
3798
  var result, ex_1;
3799
3799
  return __generator$3(this, function (_a) {
3800
3800
  switch (_a.label) {
@@ -3882,7 +3882,7 @@
3882
3882
  };
3883
3883
  return __assign$1.apply(this, arguments);
3884
3884
  };
3885
- var __awaiter$2 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3885
+ var __awaiter$3 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
3886
3886
  function adopt(value) {
3887
3887
  return value instanceof P ? value : new P(function (resolve) {
3888
3888
  resolve(value);
@@ -4055,7 +4055,7 @@
4055
4055
  return instance;
4056
4056
  }
4057
4057
  function createInstanceWithInjectionsAsync(args) {
4058
- return __awaiter$2(this, void 0, void 0, function () {
4058
+ return __awaiter$3(this, void 0, void 0, function () {
4059
4059
  var constructorInjections, propertyInjections;
4060
4060
  return __generator$2(this, function (_a) {
4061
4061
  switch (_a.label) {
@@ -4075,7 +4075,7 @@
4075
4075
  });
4076
4076
  }
4077
4077
  function possiblyWaitInjections(possiblePromiseinjections) {
4078
- return __awaiter$2(this, void 0, void 0, function () {
4078
+ return __awaiter$3(this, void 0, void 0, function () {
4079
4079
  var injections, _i, possiblePromiseinjections_1, injection;
4080
4080
  return __generator$2(this, function (_a) {
4081
4081
  injections = [];
@@ -4138,7 +4138,7 @@
4138
4138
  }
4139
4139
  }
4140
4140
 
4141
- var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4141
+ var __awaiter$2 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4142
4142
  function adopt(value) {
4143
4143
  return value instanceof P ? value : new P(function (resolve) {
4144
4144
  resolve(value);
@@ -4364,7 +4364,7 @@
4364
4364
  return result;
4365
4365
  };
4366
4366
  var _activateContainerAsync = function _activateContainerAsync(activationsIterator, context, resultPromise) {
4367
- return __awaiter$1(void 0, void 0, void 0, function () {
4367
+ return __awaiter$2(void 0, void 0, void 0, function () {
4368
4368
  var result, activation;
4369
4369
  return __generator$1(this, function (_a) {
4370
4370
  switch (_a.label) {
@@ -4978,7 +4978,7 @@
4978
4978
  };
4979
4979
  return __assign.apply(this, arguments);
4980
4980
  };
4981
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4981
+ var __awaiter$1 = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
4982
4982
  function adopt(value) {
4983
4983
  return value instanceof P ? value : new P(function (resolve) {
4984
4984
  resolve(value);
@@ -5177,7 +5177,7 @@
5177
5177
  for (var _i = 0; _i < arguments.length; _i++) {
5178
5178
  modules[_i] = arguments[_i];
5179
5179
  }
5180
- return __awaiter(this, void 0, void 0, function () {
5180
+ return __awaiter$1(this, void 0, void 0, function () {
5181
5181
  var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
5182
5182
  return __generator(this, function (_b) {
5183
5183
  switch (_b.label) {
@@ -5219,7 +5219,7 @@
5219
5219
  for (var _i = 0; _i < arguments.length; _i++) {
5220
5220
  modules[_i] = arguments[_i];
5221
5221
  }
5222
- return __awaiter(this, void 0, void 0, function () {
5222
+ return __awaiter$1(this, void 0, void 0, function () {
5223
5223
  var _a, modules_3, module_1, deactivations;
5224
5224
  return __generator(this, function (_b) {
5225
5225
  switch (_b.label) {
@@ -5255,7 +5255,7 @@
5255
5255
  return this.bind(serviceIdentifier);
5256
5256
  };
5257
5257
  Container.prototype.rebindAsync = function (serviceIdentifier) {
5258
- return __awaiter(this, void 0, void 0, function () {
5258
+ return __awaiter$1(this, void 0, void 0, function () {
5259
5259
  return __generator(this, function (_a) {
5260
5260
  switch (_a.label) {
5261
5261
  case 0:
@@ -5275,7 +5275,7 @@
5275
5275
  this._removeServiceFromDictionary(serviceIdentifier);
5276
5276
  };
5277
5277
  Container.prototype.unbindAsync = function (serviceIdentifier) {
5278
- return __awaiter(this, void 0, void 0, function () {
5278
+ return __awaiter$1(this, void 0, void 0, function () {
5279
5279
  var bindings;
5280
5280
  return __generator(this, function (_a) {
5281
5281
  switch (_a.label) {
@@ -5301,7 +5301,7 @@
5301
5301
  this._bindingDictionary = new Lookup();
5302
5302
  };
5303
5303
  Container.prototype.unbindAllAsync = function () {
5304
- return __awaiter(this, void 0, void 0, function () {
5304
+ return __awaiter$1(this, void 0, void 0, function () {
5305
5305
  var promises;
5306
5306
  var _this = this;
5307
5307
  return __generator(this, function (_a) {
@@ -5390,7 +5390,7 @@
5390
5390
  return this._getButThrowIfAsync(getArgs);
5391
5391
  };
5392
5392
  Container.prototype.getAsync = function (serviceIdentifier) {
5393
- return __awaiter(this, void 0, void 0, function () {
5393
+ return __awaiter$1(this, void 0, void 0, function () {
5394
5394
  var getArgs;
5395
5395
  return __generator(this, function (_a) {
5396
5396
  getArgs = this._getNotAllArgs(serviceIdentifier, false);
@@ -5403,7 +5403,7 @@
5403
5403
  return this._getButThrowIfAsync(getArgs);
5404
5404
  };
5405
5405
  Container.prototype.getTaggedAsync = function (serviceIdentifier, key, value) {
5406
- return __awaiter(this, void 0, void 0, function () {
5406
+ return __awaiter$1(this, void 0, void 0, function () {
5407
5407
  var getArgs;
5408
5408
  return __generator(this, function (_a) {
5409
5409
  getArgs = this._getNotAllArgs(serviceIdentifier, false, key, value);
@@ -5487,7 +5487,7 @@
5487
5487
  }
5488
5488
  };
5489
5489
  Container.prototype._handleDeactivationError = function (asyncResult, constructor) {
5490
- return __awaiter(this, void 0, void 0, function () {
5490
+ return __awaiter$1(this, void 0, void 0, function () {
5491
5491
  var ex_1;
5492
5492
  return __generator(this, function (_a) {
5493
5493
  switch (_a.label) {
@@ -5520,7 +5520,7 @@
5520
5520
  }
5521
5521
  };
5522
5522
  Container.prototype._deactivateContainerAsync = function (instance, deactivationsIterator) {
5523
- return __awaiter(this, void 0, void 0, function () {
5523
+ return __awaiter$1(this, void 0, void 0, function () {
5524
5524
  var deactivation;
5525
5525
  return __generator(this, function (_a) {
5526
5526
  switch (_a.label) {
@@ -5673,7 +5673,7 @@
5673
5673
  }
5674
5674
  };
5675
5675
  Container.prototype._deactivateSingletonsAsync = function (bindings) {
5676
- return __awaiter(this, void 0, void 0, function () {
5676
+ return __awaiter$1(this, void 0, void 0, function () {
5677
5677
  var _this = this;
5678
5678
  return __generator(this, function (_a) {
5679
5679
  switch (_a.label) {
@@ -5696,7 +5696,7 @@
5696
5696
  }
5697
5697
  };
5698
5698
  Container.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync = function (binding, instance, constructor) {
5699
- return __awaiter(this, void 0, void 0, function () {
5699
+ return __awaiter$1(this, void 0, void 0, function () {
5700
5700
  return __generator(this, function (_a) {
5701
5701
  switch (_a.label) {
5702
5702
  case 0:
@@ -5736,7 +5736,7 @@
5736
5736
  return this._preDestroy(constructor, instance);
5737
5737
  };
5738
5738
  Container.prototype._bindingDeactivationAndPreDestroyAsync = function (binding, instance, constructor) {
5739
- return __awaiter(this, void 0, void 0, function () {
5739
+ return __awaiter$1(this, void 0, void 0, function () {
5740
5740
  return __generator(this, function (_a) {
5741
5741
  switch (_a.label) {
5742
5742
  case 0:
@@ -5907,6 +5907,33 @@
5907
5907
  function __metadata(metadataKey, metadataValue) {
5908
5908
  if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5909
5909
  }
5910
+ function __awaiter(thisArg, _arguments, P, generator) {
5911
+ function adopt(value) {
5912
+ return value instanceof P ? value : new P(function (resolve) {
5913
+ resolve(value);
5914
+ });
5915
+ }
5916
+ return new (P || (P = Promise))(function (resolve, reject) {
5917
+ function fulfilled(value) {
5918
+ try {
5919
+ step(generator.next(value));
5920
+ } catch (e) {
5921
+ reject(e);
5922
+ }
5923
+ }
5924
+ function rejected(value) {
5925
+ try {
5926
+ step(generator["throw"](value));
5927
+ } catch (e) {
5928
+ reject(e);
5929
+ }
5930
+ }
5931
+ function step(result) {
5932
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
5933
+ }
5934
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5935
+ });
5936
+ }
5910
5937
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
5911
5938
  var e = new Error(message);
5912
5939
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -9206,11 +9233,7 @@
9206
9233
  strokeBoundsBuffer: 2,
9207
9234
  stroke: false
9208
9235
  };
9209
- const DefaultStrokeStyle = {
9210
- outerBorder: { ...commonStroke, distance: 0 },
9211
- innerBorder: { ...commonStroke, distance: 0 },
9212
- ...commonStroke
9213
- };
9236
+ const DefaultStrokeStyle = Object.assign({ outerBorder: Object.assign(Object.assign({}, commonStroke), { distance: 0 }), innerBorder: Object.assign(Object.assign({}, commonStroke), { distance: 0 }) }, commonStroke);
9214
9237
  const DefaultTextStyle = {
9215
9238
  text: '',
9216
9239
  maxLineWidth: Infinity,
@@ -9230,41 +9253,14 @@
9230
9253
  direction: 'horizontal',
9231
9254
  wordBreak: 'break-all'
9232
9255
  };
9233
- const DefaultStyle = {
9234
- opacity: 1,
9235
- background: null,
9236
- texture: null,
9237
- textureColor: 'black',
9238
- textureSize: 10,
9239
- texturePadding: 2,
9240
- backgroundMode: 0,
9241
- blur: 0,
9242
- cursor: null,
9243
- ...DefaultFillStyle,
9244
- ...DefaultStrokeStyle,
9245
- ...DefaultLayout
9246
- };
9256
+ const DefaultStyle = Object.assign(Object.assign(Object.assign({ opacity: 1, background: null, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 0, blur: 0, cursor: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
9247
9257
  const DefaultConnectAttribute = {
9248
9258
  connectedType: 'none',
9249
9259
  connectedStyle: {},
9250
9260
  connectedX: NaN,
9251
9261
  connectedY: NaN
9252
9262
  };
9253
- const DefaultAttribute = {
9254
- strokeSeg: null,
9255
- pickable: true,
9256
- childrenPickable: true,
9257
- visible: true,
9258
- zIndex: 0,
9259
- layout: null,
9260
- boundsPadding: 0,
9261
- pickMode: 'accurate',
9262
- customPickShape: null,
9263
- boundsMode: 'accurate',
9264
- keepDirIn3d: true,
9265
- ...DefaultStyle,
9266
- ...DefaultTransform
9267
- };
9263
+ const DefaultAttribute = Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true }, DefaultStyle), DefaultTransform);
9268
9264
  function addAttributeToPrototype(obj, c, keys) {
9269
9265
  keys.forEach(key => {
9270
9266
  c.prototype[key] = obj[key];
@@ -9273,145 +9269,23 @@
9273
9269
  function rewriteProto(obj, c) {
9274
9270
  Object.setPrototypeOf(obj, c);
9275
9271
  }
9276
- const DefaultArcAttribute = {
9277
- ...DefaultAttribute,
9278
- startAngle: 0,
9279
- endAngle: pi2,
9280
- innerRadius: 0,
9281
- outerRadius: 1,
9282
- cornerRadius: 0,
9283
- padRadius: 0,
9284
- padAngle: 0,
9285
- cap: false,
9286
- forceShowCap: false
9287
- };
9288
- const DefaultAreaAttribute = {
9289
- ...DefaultAttribute,
9290
- ...DefaultConnectAttribute,
9291
- points: [],
9292
- segments: [],
9293
- curveType: 'linear',
9294
- clipRange: 1
9295
- };
9296
- const DefaultCircleAttribute = {
9297
- ...DefaultAttribute,
9298
- radius: 1,
9299
- startAngle: 0,
9300
- endAngle: pi2
9301
- };
9302
- const DefaultGroupAttribute = {
9303
- ...DefaultAttribute,
9304
- width: 0,
9305
- height: 0,
9306
- cornerRadius: 0,
9307
- path: [],
9308
- clip: false,
9309
- visibleAll: true,
9310
- display: 'relative',
9311
- flexDirection: 'row',
9312
- flexWrap: 'wrap',
9313
- justifyContent: 'flex-start',
9314
- alignItems: 'flex-start',
9315
- alignContent: 'flex-start'
9316
- };
9317
- const DefaultGlyphAttribute = {
9318
- ...DefaultAttribute,
9319
- path: '',
9320
- width: 0,
9321
- height: 0,
9322
- cornerRadius: 0,
9323
- clip: false
9324
- };
9325
- const DefaultLineAttribute = {
9326
- ...DefaultAttribute,
9327
- ...DefaultConnectAttribute,
9328
- points: [],
9329
- segments: [],
9330
- curveType: 'linear',
9331
- clipRange: 1,
9332
- clipRangeByDimension: 'default'
9333
- };
9334
- const DefaultPathAttribute = {
9335
- ...DefaultAttribute,
9336
- path: new CustomPath2D(),
9337
- customPath: () => {
9272
+ const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), { startAngle: 0, endAngle: pi2, innerRadius: 0, outerRadius: 1, cornerRadius: 0, padRadius: 0, padAngle: 0, cap: false, forceShowCap: false });
9273
+ const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1 });
9274
+ const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), { radius: 1, startAngle: 0, endAngle: pi2 });
9275
+ const DefaultGroupAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, path: [], clip: false, visibleAll: true, display: 'relative', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', alignItems: 'flex-start', alignContent: 'flex-start' });
9276
+ const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
9277
+ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default' });
9278
+ const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), customPath: () => {
9338
9279
  console.warn('空函数');
9339
- }
9340
- };
9341
- const DefaultPolygonAttribute = {
9342
- ...DefaultAttribute,
9343
- points: [],
9344
- cornerRadius: 0
9345
- };
9346
- const DefaultRectAttribute = {
9347
- ...DefaultAttribute,
9348
- width: 0,
9349
- height: 0,
9350
- strokeBoundsBuffer: 0,
9351
- cornerRadius: 0
9352
- };
9353
- const DefaultRect3dAttribute = {
9354
- ...DefaultAttribute,
9355
- width: 0,
9356
- height: 0,
9357
- cornerRadius: 0,
9358
- length: 0
9359
- };
9360
- const DefaultSymbolAttribute = {
9361
- ...DefaultAttribute,
9362
- symbolType: 'circle',
9363
- size: 10,
9364
- keepDirIn3d: true
9365
- };
9366
- const DefaultTextAttribute = {
9367
- ...DefaultAttribute,
9368
- ...DefaultTextStyle,
9369
- strokeBoundsBuffer: 0,
9370
- keepDirIn3d: true
9371
- };
9372
- const DefaultRichTextAttribute = {
9373
- ...DefaultAttribute,
9374
- width: 300,
9375
- height: 300,
9376
- ellipsis: true,
9377
- wordBreak: 'break-word',
9378
- verticalDirection: 'top',
9379
- textAlign: 'left',
9380
- textBaseline: 'top',
9381
- layoutDirection: 'horizontal',
9382
- textConfig: [],
9383
- maxHeight: undefined,
9384
- maxWidth: undefined,
9385
- singleLine: false
9386
- };
9387
- const DefaultImageAttribute = {
9388
- repeatX: 'no-repeat',
9389
- repeatY: 'no-repeat',
9390
- image: '',
9391
- width: 0,
9392
- height: 0,
9393
- ...DefaultAttribute,
9394
- fill: true
9395
- };
9396
- const DefaultRichTextIconAttribute = {
9397
- ...DefaultImageAttribute,
9398
- backgroundShowMode: 'never',
9399
- backgroundWidth: 0,
9400
- backgroundHeight: 0,
9401
- textAlign: 'left',
9402
- textBaseline: 'middle',
9403
- direction: 'horizontal',
9404
- margin: 0,
9405
- id: '',
9406
- width: 20,
9407
- height: 20,
9408
- backgroundFill: 'rgba(101, 117, 168, 0.1)',
9409
- backgroundFillOpacity: 1,
9410
- backgroundStroke: false,
9411
- backgroundStrokeOpacity: 1,
9412
- backgroundRadius: 4,
9413
- opacity: 1
9414
- };
9280
+ } });
9281
+ const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0 });
9282
+ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, strokeBoundsBuffer: 0, cornerRadius: 0 });
9283
+ const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, cornerRadius: 0, length: 0 });
9284
+ const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true });
9285
+ const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
9286
+ const DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], maxHeight: undefined, maxWidth: undefined, singleLine: false });
9287
+ const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true });
9288
+ const DefaultRichTextIconAttribute = Object.assign(Object.assign({}, DefaultImageAttribute), { backgroundShowMode: 'never', backgroundWidth: 0, backgroundHeight: 0, textAlign: 'left', textBaseline: 'middle', direction: 'horizontal', margin: 0, id: '', width: 20, height: 20, backgroundFill: 'rgba(101, 117, 168, 0.1)', backgroundFillOpacity: 1, backgroundStroke: false, backgroundStrokeOpacity: 1, backgroundRadius: 4, opacity: 1 });
9415
9289
 
9416
9290
  class Application {
9417
9291
  }
@@ -9661,7 +9535,7 @@
9661
9535
  clipedData.width = this.measureTextWidth(clipedData.str, options);
9662
9536
  }
9663
9537
  }
9664
- out.push({ ...verticalList[i], text: clipedData.str, width: clipedData.width });
9538
+ out.push(Object.assign(Object.assign({}, verticalList[i]), { text: clipedData.str, width: clipedData.width }));
9665
9539
  length += clipedData.width;
9666
9540
  }
9667
9541
  return {
@@ -10546,16 +10420,10 @@
10546
10420
  }
10547
10421
  createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
10548
10422
  this.configure(this.global, this.global.env);
10549
- return new TextMeasure({
10550
- defaultFontParams: {
10423
+ return new TextMeasure(Object.assign({ defaultFontParams: {
10551
10424
  fontFamily: DefaultTextStyle.fontFamily,
10552
10425
  fontSize: DefaultTextStyle.fontSize
10553
- },
10554
- getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
10555
- getTextBounds: undefined,
10556
- specialCharSet: '-/: .,@%\'"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase(),
10557
- ...(option !== null && option !== void 0 ? option : {})
10558
- }, textSpec);
10426
+ }, getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas), getTextBounds: undefined, specialCharSet: '-/: .,@%\'"~' + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), textSpec);
10559
10427
  }
10560
10428
  };
10561
10429
  exports.DefaultGraphicUtil = __decorate([
@@ -10932,35 +10800,37 @@
10932
10800
  }
10933
10801
  }
10934
10802
  }
10935
- async forEachChildrenAsync(cb, reverse = false) {
10936
- if (reverse) {
10937
- let child = this._lastChild;
10938
- let i = 0;
10939
- while (child) {
10940
- let breakTag = cb(child, i++);
10941
- if (breakTag.then) {
10942
- breakTag = await breakTag;
10943
- }
10944
- if (breakTag) {
10945
- return;
10803
+ forEachChildrenAsync(cb, reverse = false) {
10804
+ return __awaiter(this, void 0, void 0, function* () {
10805
+ if (reverse) {
10806
+ let child = this._lastChild;
10807
+ let i = 0;
10808
+ while (child) {
10809
+ let breakTag = cb(child, i++);
10810
+ if (breakTag.then) {
10811
+ breakTag = yield breakTag;
10812
+ }
10813
+ if (breakTag) {
10814
+ return;
10815
+ }
10816
+ child = child._prev;
10946
10817
  }
10947
- child = child._prev;
10948
10818
  }
10949
- }
10950
- else {
10951
- let child = this._firstChild;
10952
- let i = 0;
10953
- while (child) {
10954
- let breakTag = cb(child, i++);
10955
- if (breakTag.then) {
10956
- breakTag = await breakTag;
10957
- }
10958
- if (breakTag) {
10959
- return;
10819
+ else {
10820
+ let child = this._firstChild;
10821
+ let i = 0;
10822
+ while (child) {
10823
+ let breakTag = cb(child, i++);
10824
+ if (breakTag.then) {
10825
+ breakTag = yield breakTag;
10826
+ }
10827
+ if (breakTag) {
10828
+ return;
10829
+ }
10830
+ child = child._next;
10960
10831
  }
10961
- child = child._next;
10962
10832
  }
10963
- }
10833
+ });
10964
10834
  }
10965
10835
  forEach(cb) {
10966
10836
  return this.forEachChildren(cb);
@@ -14651,16 +14521,7 @@
14651
14521
  var _a;
14652
14522
  const root = this.target.attachShadow();
14653
14523
  const height = this.target.AABBBounds.height();
14654
- const rect = application.graphicService.creator.rect({
14655
- height: height,
14656
- fill: '#bcdeff',
14657
- shadowBlur: 30,
14658
- shadowColor: '#bcdeff',
14659
- ...(_a = this.params) === null || _a === void 0 ? void 0 : _a.attribute,
14660
- x: 0,
14661
- y: 0,
14662
- width: 0
14663
- });
14524
+ const rect = application.graphicService.creator.rect(Object.assign(Object.assign({ height: height, fill: '#bcdeff', shadowBlur: 30, shadowColor: '#bcdeff' }, (_a = this.params) === null || _a === void 0 ? void 0 : _a.attribute), { x: 0, y: 0, width: 0 }));
14664
14525
  this.rect = rect;
14665
14526
  root.add(rect);
14666
14527
  }
@@ -16423,10 +16284,7 @@
16423
16284
  if (fromGradient !== toGradient) {
16424
16285
  const gradient = (fromGradient ? from : to);
16425
16286
  const pure = (fromGradient ? to : from);
16426
- const gradientFromPure = {
16427
- ...gradient,
16428
- stops: gradient.stops.map(v => ({ ...v, color: colorArrayToString(pure) }))
16429
- };
16287
+ const gradientFromPure = Object.assign(Object.assign({}, gradient), { stops: gradient.stops.map(v => (Object.assign(Object.assign({}, v), { color: colorArrayToString(pure) }))) });
16430
16288
  return fromGradient
16431
16289
  ? interpolateColor(gradient, gradientFromPure, ratio, alphaChannel, cb)
16432
16290
  : interpolateColor(gradientFromPure, gradient, ratio, alphaChannel, cb);
@@ -18012,31 +17870,33 @@
18012
17870
  function incrementalAddTo(group, graphic) {
18013
17871
  group.incrementalAppendChild(graphic);
18014
17872
  }
18015
- async function waitForAllSubLayers(stage) {
18016
- const promiseList = [];
18017
- const layers = stage.getChildren();
18018
- await new Promise(resolve => {
18019
- application.global.getRequestAnimationFrame()(() => {
18020
- resolve(null);
17873
+ function waitForAllSubLayers(stage) {
17874
+ return __awaiter(this, void 0, void 0, function* () {
17875
+ const promiseList = [];
17876
+ const layers = stage.getChildren();
17877
+ yield new Promise(resolve => {
17878
+ application.global.getRequestAnimationFrame()(() => {
17879
+ resolve(null);
17880
+ });
18021
17881
  });
18022
- });
18023
- layers.forEach(l => {
18024
- if (l.subLayers.size) {
18025
- l.subLayers.forEach(sl => {
18026
- if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {
18027
- promiseList.push(new Promise(resolve => {
18028
- sl.drawContribution.hooks.completeDraw.tap('outWait', () => {
18029
- sl.drawContribution.hooks.completeDraw.taps = sl.drawContribution.hooks.completeDraw.taps.filter(i => {
18030
- return i.name !== 'outWait';
17882
+ layers.forEach(l => {
17883
+ if (l.subLayers.size) {
17884
+ l.subLayers.forEach(sl => {
17885
+ if (sl.drawContribution && sl.drawContribution.hooks && sl.drawContribution.rendering) {
17886
+ promiseList.push(new Promise(resolve => {
17887
+ sl.drawContribution.hooks.completeDraw.tap('outWait', () => {
17888
+ sl.drawContribution.hooks.completeDraw.taps = sl.drawContribution.hooks.completeDraw.taps.filter(i => {
17889
+ return i.name !== 'outWait';
17890
+ });
17891
+ resolve(null);
18031
17892
  });
18032
- resolve(null);
18033
- });
18034
- }));
18035
- }
18036
- });
18037
- }
17893
+ }));
17894
+ }
17895
+ });
17896
+ }
17897
+ });
17898
+ yield Promise.all(promiseList);
18038
17899
  });
18039
- await Promise.all(promiseList);
18040
17900
  }
18041
17901
  function boundStroke(bounds, halfW, miter, pad = 0) {
18042
17902
  bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0)));
@@ -18380,7 +18240,7 @@
18380
18240
  return graphic;
18381
18241
  }
18382
18242
  clone() {
18383
- return new Group({ ...this.attribute });
18243
+ return new Group(Object.assign({}, this.attribute));
18384
18244
  }
18385
18245
  }
18386
18246
 
@@ -18510,17 +18370,7 @@
18510
18370
  combineTo(target, params) {
18511
18371
  var _a;
18512
18372
  if (this.offscreen) {
18513
- this.layerHandler.drawTo(target, [this], {
18514
- background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background,
18515
- renderService: params.renderService,
18516
- x: this.stage.x,
18517
- y: this.stage.y,
18518
- width: this.viewWidth,
18519
- height: this.viewHeight,
18520
- stage: this.stage,
18521
- layer: this,
18522
- ...params
18523
- });
18373
+ this.layerHandler.drawTo(target, [this], Object.assign({ background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background, renderService: params.renderService, x: this.stage.x, y: this.stage.y, width: this.viewWidth, height: this.viewHeight, stage: this.stage, layer: this }, params));
18524
18374
  this.afterDrawCbs.forEach(c => c(this));
18525
18375
  }
18526
18376
  }
@@ -18535,17 +18385,7 @@
18535
18385
  }
18536
18386
  drawTo(target, params) {
18537
18387
  var _a;
18538
- this.layerHandler.drawTo(target, [this], {
18539
- background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background,
18540
- renderService: params.renderService,
18541
- x: this.stage.x,
18542
- y: this.stage.y,
18543
- width: this.viewWidth,
18544
- height: this.viewHeight,
18545
- stage: this.stage,
18546
- layer: this,
18547
- ...params
18548
- });
18388
+ this.layerHandler.drawTo(target, [this], Object.assign({ background: (_a = params.background) !== null && _a !== void 0 ? _a : this.background, renderService: params.renderService, x: this.stage.x, y: this.stage.y, width: this.viewWidth, height: this.viewHeight, stage: this.stage, layer: this }, params));
18549
18389
  this.afterDrawCbs.forEach(c => c(this));
18550
18390
  }
18551
18391
  }
@@ -18567,10 +18407,7 @@
18567
18407
  }
18568
18408
  createLayer(stage, options = { main: false }) {
18569
18409
  this.tryInit();
18570
- const layer = new Layer(stage, this.global, stage.window, {
18571
- ...options,
18572
- virtual: this.staticLayerCountInEnv === 0
18573
- });
18410
+ const layer = new Layer(stage, this.global, stage.window, Object.assign(Object.assign({}, options), { virtual: this.staticLayerCountInEnv === 0 }));
18574
18411
  const stageLayers = this.layerMap.get(stage) || [];
18575
18412
  stageLayers.push(layer);
18576
18413
  this.layerMap.set(stage, stageLayers);
@@ -19339,6 +19176,16 @@
19339
19176
  return;
19340
19177
  }
19341
19178
  const { outerRadius = arcAttribute.outerRadius, innerRadius = arcAttribute.innerRadius, cap = arcAttribute.cap, forceShowCap = arcAttribute.forceShowCap } = arc.attribute;
19179
+ let conicalOffset = 0;
19180
+ const tempChangeConicalColor = ((isBoolean(cap) && cap) || cap[0]) && fill.gradient === 'conical';
19181
+ if (tempChangeConicalColor) {
19182
+ const { sc, startAngle, endAngle } = arc.getParsedAngle();
19183
+ if (abs(endAngle - startAngle) < pi2 - epsilon) {
19184
+ conicalOffset = sc || 0;
19185
+ fill.startAngle -= conicalOffset;
19186
+ fill.endAngle -= conicalOffset;
19187
+ }
19188
+ }
19342
19189
  let beforeRenderContribitionsRuned = false;
19343
19190
  const { isFullStroke, stroke: arrayStroke } = parseStroke(stroke);
19344
19191
  if (doFill || isFullStroke) {
@@ -19413,7 +19260,7 @@
19413
19260
  context.stroke();
19414
19261
  }
19415
19262
  }
19416
- if (cap && forceShowCap) {
19263
+ if (((isBoolean(cap) && cap) || cap[1]) && forceShowCap) {
19417
19264
  const { startAngle: sa, endAngle: ea } = arc.getParsedAngle();
19418
19265
  const deltaAngle = abs(ea - sa);
19419
19266
  if (deltaAngle >= pi2 - epsilon) {
@@ -19467,6 +19314,10 @@
19467
19314
  this._arcAfterRenderContribitions.forEach(c => {
19468
19315
  c.drawShape(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
19469
19316
  });
19317
+ if (tempChangeConicalColor) {
19318
+ fill.startAngle += conicalOffset;
19319
+ fill.endAngle += conicalOffset;
19320
+ }
19470
19321
  }
19471
19322
  draw(arc, renderService, drawContext, params) {
19472
19323
  const { context } = drawContext;
@@ -19659,7 +19510,7 @@
19659
19510
  return path;
19660
19511
  }
19661
19512
  clone() {
19662
- return new Circle({ ...this.attribute });
19513
+ return new Circle(Object.assign({}, this.attribute));
19663
19514
  }
19664
19515
  }
19665
19516
 
@@ -20184,7 +20035,7 @@
20184
20035
  return false;
20185
20036
  }
20186
20037
  clone() {
20187
- return new Text({ ...this.attribute });
20038
+ return new Text(Object.assign({}, this.attribute));
20188
20039
  }
20189
20040
  }
20190
20041
 
@@ -20947,7 +20798,7 @@
20947
20798
  : new CustomPath2D().fromString(symbolInstance.pathStr, x, y, formattedSize[0], formattedSize[1]);
20948
20799
  }
20949
20800
  clone() {
20950
- return new Symbol({ ...this.attribute });
20801
+ return new Symbol(Object.assign({}, this.attribute));
20951
20802
  }
20952
20803
  };
20953
20804
  Symbol$1.userSymbolMap = {};
@@ -21053,7 +20904,7 @@
21053
20904
  return path;
21054
20905
  }
21055
20906
  clone() {
21056
- return new Line({ ...this.attribute });
20907
+ return new Line(Object.assign({}, this.attribute));
21057
20908
  }
21058
20909
  };
21059
20910
 
@@ -21121,7 +20972,7 @@
21121
20972
  return path;
21122
20973
  }
21123
20974
  clone() {
21124
- return new Rect({ ...this.attribute });
20975
+ return new Rect(Object.assign({}, this.attribute));
21125
20976
  }
21126
20977
  }
21127
20978
 
@@ -21333,7 +21184,7 @@
21333
21184
  this.currentStates = [];
21334
21185
  }
21335
21186
  clone() {
21336
- const glyph = new Glyph({ ...this.attribute });
21187
+ const glyph = new Glyph(Object.assign({}, this.attribute));
21337
21188
  glyph.setSubGraphic(this.subGraphic.map(g => g.clone()));
21338
21189
  return glyph;
21339
21190
  }
@@ -21887,7 +21738,7 @@
21887
21738
  return false;
21888
21739
  }
21889
21740
  clone() {
21890
- return new Image({ ...this.attribute });
21741
+ return new Image(Object.assign({}, this.attribute));
21891
21742
  }
21892
21743
  }
21893
21744
 
@@ -22445,7 +22296,7 @@
22445
22296
  this._frameCache = frame;
22446
22297
  }
22447
22298
  clone() {
22448
- return new RichText({ ...this.attribute });
22299
+ return new RichText(Object.assign({}, this.attribute));
22449
22300
  }
22450
22301
  setStage(stage, layer) {
22451
22302
  super.setStage(stage, layer);
@@ -22589,7 +22440,7 @@
22589
22440
  return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);
22590
22441
  }
22591
22442
  clone() {
22592
- return new Path({ ...this.attribute });
22443
+ return new Path(Object.assign({}, this.attribute));
22593
22444
  }
22594
22445
  }
22595
22446
 
@@ -22703,7 +22554,7 @@
22703
22554
  return path;
22704
22555
  }
22705
22556
  clone() {
22706
- return new Area({ ...this.attribute });
22557
+ return new Area(Object.assign({}, this.attribute));
22707
22558
  }
22708
22559
  }
22709
22560
 
@@ -22766,7 +22617,9 @@
22766
22617
  if (capWidth > epsilon && outerRadius > epsilon) {
22767
22618
  return {
22768
22619
  startAngle: startAngle - sign * capAngle * startCap,
22769
- endAngle: endAngle + sign * capAngle * endCap
22620
+ endAngle: endAngle + sign * capAngle * endCap,
22621
+ sc: sign * capAngle * startCap,
22622
+ ec: sign * capAngle * endCap
22770
22623
  };
22771
22624
  }
22772
22625
  }
@@ -22905,7 +22758,7 @@
22905
22758
  return path;
22906
22759
  }
22907
22760
  clone() {
22908
- return new Arc({ ...this.attribute });
22761
+ return new Arc(Object.assign({}, this.attribute));
22909
22762
  }
22910
22763
  }
22911
22764
 
@@ -23002,7 +22855,7 @@
23002
22855
  return path;
23003
22856
  }
23004
22857
  clone() {
23005
- return new Polygon({ ...this.attribute });
22858
+ return new Polygon(Object.assign({}, this.attribute));
23006
22859
  }
23007
22860
  }
23008
22861
 
@@ -24301,6 +24154,7 @@
24301
24154
  if (maxLineWidth > 0) {
24302
24155
  for (let i = 0; i < lines.length; i++) {
24303
24156
  const str = lines[i];
24157
+ let needCut = true;
24304
24158
  if (i === lineCountLimit - 1) {
24305
24159
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis);
24306
24160
  linesLayout.push({
@@ -24320,13 +24174,14 @@
24320
24174
  clip.str = '';
24321
24175
  clip.width = 0;
24322
24176
  }
24177
+ needCut = false;
24323
24178
  }
24324
24179
  linesLayout.push({
24325
24180
  str: clip.str,
24326
24181
  width: clip.width
24327
24182
  });
24328
24183
  if (clip.str.length === str.length) ;
24329
- else {
24184
+ else if (needCut) {
24330
24185
  const newStr = str.substring(clip.str.length);
24331
24186
  lines.splice(i + 1, 0, newStr);
24332
24187
  }
@@ -26711,10 +26566,7 @@
26711
26566
  }
26712
26567
  allocate(data) {
26713
26568
  if (!this.pools.length) {
26714
- return wrapCanvas({
26715
- nativeCanvas: application.global.createCanvas(data),
26716
- ...data
26717
- });
26569
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26718
26570
  }
26719
26571
  const m = this.pools.pop();
26720
26572
  m.resize(data.width, data.height);
@@ -26728,10 +26580,7 @@
26728
26580
  height: canvas.height / canvas.dpr,
26729
26581
  dpr: canvas.dpr
26730
26582
  };
26731
- return wrapCanvas({
26732
- nativeCanvas: application.global.createCanvas(data),
26733
- ...data
26734
- });
26583
+ return wrapCanvas(Object.assign({ nativeCanvas: application.global.createCanvas(data) }, data));
26735
26584
  }
26736
26585
  const m = this.pools.pop();
26737
26586
  m.width = canvas.width;
@@ -27437,7 +27286,7 @@
27437
27286
  return;
27438
27287
  }
27439
27288
  draw(params) {
27440
- this.drawContribution.draw(this, { ...this.drawParams });
27289
+ this.drawContribution.draw(this, Object.assign({}, this.drawParams));
27441
27290
  }
27442
27291
  afterDraw(params) {
27443
27292
  return;
@@ -27522,8 +27371,10 @@
27522
27371
  graphic.forEachChildren(cb, reverse);
27523
27372
  }
27524
27373
  }
27525
- async function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27526
- await graphic.forEachChildrenAsync(cb, reverse);
27374
+ function foreachAsync(graphic, defaultZIndex, cb, reverse = false) {
27375
+ return __awaiter(this, void 0, void 0, function* () {
27376
+ yield graphic.forEachChildrenAsync(cb, reverse);
27377
+ });
27527
27378
  }
27528
27379
  function findNextGraphic(graphic, id, defaultZIndex, reverse = false) {
27529
27380
  const childMap = {};
@@ -28131,12 +27982,12 @@
28131
27982
  }
28132
27983
  class OrthoCamera {
28133
27984
  set params(params) {
28134
- this._params = { ...params };
27985
+ this._params = Object.assign({}, params);
28135
27986
  this._projectionMatrixCached = this.forceGetProjectionMatrix();
28136
27987
  this._viewMatrixCached = this.forceGetViewMatrix();
28137
27988
  }
28138
27989
  get params() {
28139
- return { ...this._params };
27990
+ return Object.assign({}, this._params);
28140
27991
  }
28141
27992
  constructor(params) {
28142
27993
  this.params = params;
@@ -28350,9 +28201,9 @@
28350
28201
  }
28351
28202
  }
28352
28203
  constructor(canvas, dpr) {
28353
- this.fillAttributes = { ...DefaultFillStyle, opacity: 1 };
28354
- this.strokeAttributes = { ...DefaultStrokeStyle, opacity: 1 };
28355
- this.textAttributes = { ...DefaultTextStyle, opacity: 1 };
28204
+ this.fillAttributes = Object.assign(Object.assign({}, DefaultFillStyle), { opacity: 1 });
28205
+ this.strokeAttributes = Object.assign(Object.assign({}, DefaultStrokeStyle), { opacity: 1 });
28206
+ this.textAttributes = Object.assign(Object.assign({}, DefaultTextStyle), { opacity: 1 });
28356
28207
  this._clearShadowStyle = false;
28357
28208
  this._clearFilterStyle = false;
28358
28209
  const context = canvas.nativeCanvas.getContext('2d');
@@ -30483,28 +30334,30 @@
30483
30334
  injectable()
30484
30335
  ], NodeEnvContribution);
30485
30336
 
30486
- async function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30487
- const dpr = wx.getSystemInfoSync().pixelRatio;
30488
- for (let i = 0; i < canvasIdLists.length; i++) {
30489
- const id = canvasIdLists[i];
30490
- await new Promise(resolve => {
30491
- wx.createSelectorQuery()
30492
- .select(`#${id}`)
30493
- .fields({ node: true, size: true })
30494
- .exec((res) => {
30495
- const canvas = res[0].node;
30496
- const width = res[0].width;
30497
- const height = res[0].height;
30498
- canvas.width = width * dpr;
30499
- canvas.height = height * dpr;
30500
- canvasMap.set(id, canvas);
30501
- if (i >= freeCanvasIdx) {
30502
- freeCanvasList.push(canvas);
30503
- }
30504
- resolve(null);
30337
+ function makeUpCanvas(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCanvasList) {
30338
+ return __awaiter(this, void 0, void 0, function* () {
30339
+ const dpr = wx.getSystemInfoSync().pixelRatio;
30340
+ for (let i = 0; i < canvasIdLists.length; i++) {
30341
+ const id = canvasIdLists[i];
30342
+ yield new Promise(resolve => {
30343
+ wx.createSelectorQuery()
30344
+ .select(`#${id}`)
30345
+ .fields({ node: true, size: true })
30346
+ .exec((res) => {
30347
+ const canvas = res[0].node;
30348
+ const width = res[0].width;
30349
+ const height = res[0].height;
30350
+ canvas.width = width * dpr;
30351
+ canvas.height = height * dpr;
30352
+ canvasMap.set(id, canvas);
30353
+ if (i >= freeCanvasIdx) {
30354
+ freeCanvasList.push(canvas);
30355
+ }
30356
+ resolve(null);
30357
+ });
30505
30358
  });
30506
- });
30507
- }
30359
+ }
30360
+ });
30508
30361
  }
30509
30362
  let WxEnvContribution = class WxEnvContribution extends exports.BaseEnvContribution {
30510
30363
  constructor() {
@@ -31500,22 +31353,14 @@
31500
31353
  }
31501
31354
  if (event.changedTouches.length > 0) {
31502
31355
  event.changedTouches.forEach((d, i) => {
31503
- event.changedTouches[i] = {
31504
- ...event.changedTouches[i],
31505
- offsetX: d.x,
31506
- offsetY: d.y
31507
- };
31356
+ event.changedTouches[i] = Object.assign(Object.assign({}, event.changedTouches[i]), { offsetX: d.x, offsetY: d.y });
31508
31357
  });
31509
31358
  event.offsetX = event.changedTouches[0].offsetX;
31510
31359
  event.offsetY = event.changedTouches[0].offsetY;
31511
31360
  }
31512
31361
  if (event.touches.length > 0) {
31513
31362
  event.touches.forEach((d, i) => {
31514
- event.touches[i] = {
31515
- ...event.touches[i],
31516
- offsetX: d.x,
31517
- offsetY: d.y
31518
- };
31363
+ event.touches[i] = Object.assign(Object.assign({}, event.touches[i]), { offsetX: d.x, offsetY: d.y });
31519
31364
  });
31520
31365
  }
31521
31366
  event.preventDefault = () => {
@@ -32609,12 +32454,7 @@
32609
32454
  this.canvas.applyPosition();
32610
32455
  }
32611
32456
  }
32612
- params.renderService.render(group, {
32613
- context: this.context,
32614
- clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff',
32615
- ...params,
32616
- ...userParams
32617
- });
32457
+ params.renderService.render(group, Object.assign(Object.assign({ context: this.context, clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff' }, params), userParams));
32618
32458
  }
32619
32459
  merge(layerHandlers) {
32620
32460
  layerHandlers.forEach(l => {
@@ -32629,11 +32469,7 @@
32629
32469
  drawTo(target, group, params) {
32630
32470
  var _a;
32631
32471
  const context = target.getContext();
32632
- params.renderService.render(group, {
32633
- context,
32634
- ...params,
32635
- clear: params.clear ? (_a = params.background) !== null && _a !== void 0 ? _a : '#fff' : undefined
32636
- });
32472
+ params.renderService.render(group, Object.assign(Object.assign({ context }, params), { clear: params.clear ? (_a = params.background) !== null && _a !== void 0 ? _a : '#fff' : undefined }));
32637
32473
  return;
32638
32474
  }
32639
32475
  getContext() {
@@ -32681,13 +32517,7 @@
32681
32517
  }
32682
32518
  render(group, params) {
32683
32519
  var _a;
32684
- params.renderService.render(group, {
32685
- context: this.context,
32686
- ...params,
32687
- x: 0,
32688
- y: 0,
32689
- clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff'
32690
- });
32520
+ params.renderService.render(group, Object.assign(Object.assign({ context: this.context }, params), { x: 0, y: 0, clear: (_a = params.background) !== null && _a !== void 0 ? _a : '#ffffff' }));
32691
32521
  }
32692
32522
  prepare(dirtyBounds, params) {
32693
32523
  return;
@@ -33058,15 +32888,7 @@
33058
32888
  const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);
33059
32889
  idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
33060
32890
  idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);
33061
- idc.draw(this.currentRenderService, {
33062
- ...drawContext,
33063
- drawContribution: idc,
33064
- clear: 'transparent',
33065
- layer: incrementalLayer.layer,
33066
- context: incrementalContext,
33067
- startAtId: group._uid,
33068
- break: false
33069
- });
32891
+ idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: incrementalLayer.layer, context: incrementalContext, startAtId: group._uid, break: false }));
33070
32892
  incrementalLayer.drawContribution = idc;
33071
32893
  const nextGraphic = this._findNextGraphic(group);
33072
32894
  if (nextGraphic) {
@@ -33083,15 +32905,7 @@
33083
32905
  subLayers.set(nextGraphic._uid, afterLayer);
33084
32906
  }
33085
32907
  const afterContext = afterLayer.layer.getNativeHandler().getContext();
33086
- this.draw(this.currentRenderService, {
33087
- ...drawContext,
33088
- drawContribution: idc,
33089
- clear: 'transparent',
33090
- layer: afterLayer.layer,
33091
- context: afterContext,
33092
- startAtId: nextGraphic._uid,
33093
- break: false
33094
- });
32908
+ this.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), { drawContribution: idc, clear: 'transparent', layer: afterLayer.layer, context: afterContext, startAtId: nextGraphic._uid, break: false }));
33095
32909
  }
33096
32910
  }
33097
32911
  }
@@ -33486,164 +33300,178 @@
33486
33300
  this.defaultRenderMap.set(this.lineRender.numberType, this.lineRender);
33487
33301
  this.defaultRenderMap.set(this.areaRender.numberType, this.areaRender);
33488
33302
  }
33489
- async draw(renderService, drawContext) {
33490
- if (this.checkingForDrawPromise) {
33491
- return;
33492
- }
33493
- this.lastRenderService = renderService;
33494
- this.lastDrawContext = drawContext;
33495
- this.checkingForDrawPromise = this.checkForDraw(drawContext);
33496
- const skipDraw = await this.checkingForDrawPromise;
33497
- this.checkingForDrawPromise = null;
33498
- if (skipDraw) {
33499
- return;
33500
- }
33501
- this.currentRenderService = renderService;
33502
- const { context, x = 0, y = 0 } = drawContext;
33503
- if (!context) {
33504
- return;
33505
- }
33506
- context.inuse = true;
33507
- context.clearMatrix();
33508
- context.setTransformForCurrent(true);
33509
- context.save();
33510
- drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext);
33511
- context.translate(x, y, true);
33512
- context.save();
33513
- renderService.renderTreeRoots
33514
- .sort((a, b) => {
33515
- var _a, _b;
33516
- return ((_a = a.attribute.zIndex) !== null && _a !== void 0 ? _a : DefaultAttribute.zIndex) - ((_b = b.attribute.zIndex) !== null && _b !== void 0 ? _b : DefaultAttribute.zIndex);
33517
- })
33518
- .forEach(group => {
33519
- this.renderGroup(group, drawContext);
33520
- });
33521
- this.hooks.completeDraw.tap('top-draw', () => {
33522
- context.restore();
33523
- context.restore();
33524
- context.draw();
33525
- context.inuse = false;
33526
- this.rendering = false;
33303
+ draw(renderService, drawContext) {
33304
+ return __awaiter(this, void 0, void 0, function* () {
33305
+ if (this.checkingForDrawPromise) {
33306
+ return;
33307
+ }
33308
+ this.lastRenderService = renderService;
33309
+ this.lastDrawContext = drawContext;
33310
+ this.checkingForDrawPromise = this.checkForDraw(drawContext);
33311
+ const skipDraw = yield this.checkingForDrawPromise;
33312
+ this.checkingForDrawPromise = null;
33313
+ if (skipDraw) {
33314
+ return;
33315
+ }
33316
+ this.currentRenderService = renderService;
33317
+ const { context, x = 0, y = 0 } = drawContext;
33318
+ if (!context) {
33319
+ return;
33320
+ }
33321
+ context.inuse = true;
33322
+ context.clearMatrix();
33323
+ context.setTransformForCurrent(true);
33324
+ context.save();
33325
+ drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext);
33326
+ context.translate(x, y, true);
33327
+ context.save();
33328
+ renderService.renderTreeRoots
33329
+ .sort((a, b) => {
33330
+ var _a, _b;
33331
+ return ((_a = a.attribute.zIndex) !== null && _a !== void 0 ? _a : DefaultAttribute.zIndex) - ((_b = b.attribute.zIndex) !== null && _b !== void 0 ? _b : DefaultAttribute.zIndex);
33332
+ })
33333
+ .forEach(group => {
33334
+ this.renderGroup(group, drawContext);
33335
+ });
33336
+ this.hooks.completeDraw.tap('top-draw', () => {
33337
+ context.restore();
33338
+ context.restore();
33339
+ context.draw();
33340
+ context.inuse = false;
33341
+ this.rendering = false;
33342
+ });
33527
33343
  });
33528
33344
  }
33529
- async _increaseRender(group, drawContext) {
33530
- this.rendering = true;
33531
- await this._renderIncrementalGroup(group, drawContext);
33532
- return;
33345
+ _increaseRender(group, drawContext) {
33346
+ return __awaiter(this, void 0, void 0, function* () {
33347
+ this.rendering = true;
33348
+ yield this._renderIncrementalGroup(group, drawContext);
33349
+ return;
33350
+ });
33533
33351
  }
33534
- async _renderIncrementalGroup(group, drawContext) {
33535
- this.count = group.count;
33536
- await new Promise(resolve => {
33537
- this.renderItem(group, drawContext, {
33538
- drawingCb: async () => {
33539
- if (group.count === 2) {
33540
- const graphic = group.getChildAt(0);
33541
- if (graphic.incremental && graphic.attribute.segments) {
33542
- if (!graphic.incrementalAt) {
33543
- graphic.incrementalAt = 0;
33352
+ _renderIncrementalGroup(group, drawContext) {
33353
+ return __awaiter(this, void 0, void 0, function* () {
33354
+ this.count = group.count;
33355
+ yield new Promise(resolve => {
33356
+ this.renderItem(group, drawContext, {
33357
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33358
+ if (group.count === 2) {
33359
+ const graphic = group.getChildAt(0);
33360
+ if (graphic.incremental && graphic.attribute.segments) {
33361
+ if (!graphic.incrementalAt) {
33362
+ graphic.incrementalAt = 0;
33363
+ }
33364
+ while (graphic.incrementalAt < graphic.attribute.segments.length) {
33365
+ drawContext.multiGraphicOptions = {
33366
+ startAtIdx: graphic.incrementalAt,
33367
+ length: graphic.incremental
33368
+ };
33369
+ this.renderItem(graphic, drawContext);
33370
+ graphic.incrementalAt += graphic.incremental;
33371
+ yield this.waitToNextFrame();
33372
+ }
33544
33373
  }
33545
- while (graphic.incrementalAt < graphic.attribute.segments.length) {
33546
- drawContext.multiGraphicOptions = {
33547
- startAtIdx: graphic.incrementalAt,
33548
- length: graphic.incremental
33549
- };
33374
+ else {
33550
33375
  this.renderItem(graphic, drawContext);
33551
- graphic.incrementalAt += graphic.incremental;
33552
- await this.waitToNextFrame();
33553
33376
  }
33377
+ resolve(false);
33378
+ return;
33554
33379
  }
33555
- else {
33556
- this.renderItem(graphic, drawContext);
33557
- }
33558
- resolve(false);
33559
- return;
33560
- }
33561
- await foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
33562
- if (this.status === STATUS.STOP) {
33563
- return true;
33564
- }
33565
- if (item.isContainer) {
33566
- return false;
33567
- }
33568
- if (i < this.currentIdx) {
33380
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item, i) => {
33381
+ if (this.status === STATUS.STOP) {
33382
+ return true;
33383
+ }
33384
+ if (item.isContainer) {
33385
+ return false;
33386
+ }
33387
+ if (i < this.currentIdx) {
33388
+ return false;
33389
+ }
33390
+ const frameTail = this.currFrameStartAt + group.incremental;
33391
+ if (i < frameTail) {
33392
+ this.currentIdx = i + 1;
33393
+ this.renderItem(item, drawContext);
33394
+ }
33395
+ if (i === frameTail - 1) {
33396
+ this.currFrameStartAt = this.currentIdx;
33397
+ return this.waitToNextFrame();
33398
+ }
33569
33399
  return false;
33570
- }
33571
- const frameTail = this.currFrameStartAt + group.incremental;
33572
- if (i < frameTail) {
33573
- this.currentIdx = i + 1;
33574
- this.renderItem(item, drawContext);
33575
- }
33576
- if (i === frameTail - 1) {
33577
- this.currFrameStartAt = this.currentIdx;
33578
- return this.waitToNextFrame();
33579
- }
33580
- return false;
33581
- });
33582
- resolve(false);
33583
- }
33400
+ });
33401
+ resolve(false);
33402
+ })
33403
+ });
33584
33404
  });
33405
+ this.hooks.completeDraw.call();
33585
33406
  });
33586
- this.hooks.completeDraw.call();
33587
33407
  }
33588
- async waitToNextFrame() {
33589
- return new Promise(resolve => {
33590
- this.global.getRequestAnimationFrame()(() => {
33591
- resolve(false);
33408
+ waitToNextFrame() {
33409
+ return __awaiter(this, void 0, void 0, function* () {
33410
+ return new Promise(resolve => {
33411
+ this.global.getRequestAnimationFrame()(() => {
33412
+ resolve(false);
33413
+ });
33592
33414
  });
33593
33415
  });
33594
33416
  }
33595
- async checkForDraw(drawContext) {
33596
- let skip = this.rendering;
33597
- if (drawContext.restartIncremental) {
33598
- skip = false;
33599
- await this.forceStop();
33600
- this.resetToInit();
33601
- }
33602
- return skip;
33417
+ checkForDraw(drawContext) {
33418
+ return __awaiter(this, void 0, void 0, function* () {
33419
+ let skip = this.rendering;
33420
+ if (drawContext.restartIncremental) {
33421
+ skip = false;
33422
+ yield this.forceStop();
33423
+ this.resetToInit();
33424
+ }
33425
+ return skip;
33426
+ });
33603
33427
  }
33604
- async forceStop() {
33605
- if (this.rendering) {
33606
- this.status = STATUS.STOP;
33607
- await new Promise(resolve => {
33608
- this.hooks.completeDraw.tap('stopCb', () => {
33609
- this.status = STATUS.NORMAL;
33610
- this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => {
33611
- return item.name !== 'stopCb';
33428
+ forceStop() {
33429
+ return __awaiter(this, void 0, void 0, function* () {
33430
+ if (this.rendering) {
33431
+ this.status = STATUS.STOP;
33432
+ yield new Promise(resolve => {
33433
+ this.hooks.completeDraw.tap('stopCb', () => {
33434
+ this.status = STATUS.NORMAL;
33435
+ this.hooks.completeDraw.taps = this.hooks.completeDraw.taps.filter(item => {
33436
+ return item.name !== 'stopCb';
33437
+ });
33438
+ resolve(false);
33612
33439
  });
33613
- resolve(false);
33614
33440
  });
33615
- });
33616
- }
33441
+ }
33442
+ });
33617
33443
  }
33618
33444
  resetToInit() {
33619
33445
  this.currFrameStartAt = 0;
33620
33446
  this.currentIdx = 0;
33621
33447
  }
33622
- async renderGroup(group, drawContext) {
33623
- if (drawContext.break || group.attribute.visibleAll === false) {
33624
- return;
33625
- }
33626
- if (group.incremental && drawContext.startAtId === group._uid) {
33627
- await this._increaseRender(group, drawContext);
33628
- drawContext.break = true;
33629
- return;
33630
- }
33631
- await new Promise(resolve => {
33632
- this.renderItem(group, drawContext, {
33633
- drawingCb: async () => {
33634
- await foreachAsync(group, DefaultAttribute.zIndex, async (item) => {
33635
- if (drawContext.break) {
33636
- return;
33637
- }
33638
- if (item.isContainer) {
33639
- await this.renderGroup(item, drawContext);
33640
- }
33641
- else {
33642
- return;
33643
- }
33644
- });
33645
- resolve(false);
33646
- }
33448
+ renderGroup(group, drawContext) {
33449
+ return __awaiter(this, void 0, void 0, function* () {
33450
+ if (drawContext.break || group.attribute.visibleAll === false) {
33451
+ return;
33452
+ }
33453
+ if (group.incremental && drawContext.startAtId === group._uid) {
33454
+ yield this._increaseRender(group, drawContext);
33455
+ drawContext.break = true;
33456
+ return;
33457
+ }
33458
+ yield new Promise(resolve => {
33459
+ this.renderItem(group, drawContext, {
33460
+ drawingCb: () => __awaiter(this, void 0, void 0, function* () {
33461
+ yield foreachAsync(group, DefaultAttribute.zIndex, (item) => __awaiter(this, void 0, void 0, function* () {
33462
+ if (drawContext.break) {
33463
+ return;
33464
+ }
33465
+ if (item.isContainer) {
33466
+ yield this.renderGroup(item, drawContext);
33467
+ }
33468
+ else {
33469
+ return;
33470
+ }
33471
+ }));
33472
+ resolve(false);
33473
+ })
33474
+ });
33647
33475
  });
33648
33476
  });
33649
33477
  }
@@ -36186,20 +36014,8 @@
36186
36014
  if (!subLayer || !subLayer.drawContribution) {
36187
36015
  return;
36188
36016
  }
36189
- subLayer.drawContribution.draw(stage.renderService, {
36190
- x: stage.x,
36191
- y: stage.y,
36192
- width: layer.viewWidth,
36193
- height: layer.viewHeight,
36194
- stage,
36195
- layer,
36196
- clear: 'transparent',
36197
- renderService: stage.renderService,
36198
- updateBounds: false,
36199
- startAtId: group._uid,
36200
- context: subLayer.layer.getNativeHandler().getContext(),
36201
- ...this.nextUserParams
36202
- });
36017
+ subLayer.drawContribution.draw(stage.renderService, Object.assign({ x: stage.x, y: stage.y, width: layer.viewWidth, height: layer.viewHeight, stage,
36018
+ layer, clear: 'transparent', renderService: stage.renderService, updateBounds: false, startAtId: group._uid, context: subLayer.layer.getNativeHandler().getContext() }, this.nextUserParams));
36203
36019
  });
36204
36020
  this.nextUserParams = {};
36205
36021
  this.nextFrameRenderGroupSet.clear();
@@ -36512,8 +36328,8 @@
36512
36328
 
36513
36329
  const defaultTicker = new DefaultTicker();
36514
36330
  defaultTicker.addTimeline(defaultTimeline);
36515
- const DEFAULT_TICKER_FPS = 60;
36516
- defaultTicker.setFPS(DEFAULT_TICKER_FPS);
36331
+ const TICKER_FPS = 60;
36332
+ defaultTicker.setFPS(TICKER_FPS);
36517
36333
 
36518
36334
  class DirectionalLight {
36519
36335
  constructor(dir, color, ambient = 0.8) {
@@ -36697,16 +36513,13 @@
36697
36513
  }
36698
36514
  get3dOptions(options) {
36699
36515
  const { center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 }, light = {}, alpha = 0, beta = 0, camera, fieldRatio = 1, fieldDepth } = options;
36700
- return {
36701
- ...options,
36702
- center,
36516
+ return Object.assign(Object.assign({}, options), { center,
36703
36517
  light,
36704
36518
  alpha,
36705
36519
  beta,
36706
36520
  camera,
36707
36521
  fieldRatio,
36708
- fieldDepth
36709
- };
36522
+ fieldDepth });
36710
36523
  }
36711
36524
  set3dOptions(options) {
36712
36525
  var _a, _b, _c, _d, _e, _f;
@@ -36893,7 +36706,7 @@
36893
36706
  renderService: this.renderService,
36894
36707
  background: layer === this.defaultLayer ? this.background : undefined,
36895
36708
  updateBounds: !!this.dirtyBounds
36896
- }, { renderStyle: this.renderStyle, ...params });
36709
+ }, Object.assign({ renderStyle: this.renderStyle }, params));
36897
36710
  });
36898
36711
  this.combineLayersToWindow();
36899
36712
  this.nextFrameRenderLayerSet.clear();
@@ -36936,7 +36749,7 @@
36936
36749
  renderService: this.renderService,
36937
36750
  background: layer === this.defaultLayer ? this.background : undefined,
36938
36751
  updateBounds: !!this.dirtyBounds
36939
- }, { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) });
36752
+ }, Object.assign({ renderStyle: this.renderStyle }, (this.lastRenderparams || {})));
36940
36753
  }
36941
36754
  });
36942
36755
  this.combineLayersToWindow();
@@ -36964,7 +36777,7 @@
36964
36777
  this.forEachChildren(c => {
36965
36778
  c.resizeView(w, h);
36966
36779
  });
36967
- this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });
36780
+ this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), { right: this.width, bottom: this.height }));
36968
36781
  rerender && this.render();
36969
36782
  }
36970
36783
  setViewBox(x, y, w, h, rerender) {
@@ -37040,13 +36853,7 @@
37040
36853
  }
37041
36854
  renderTo(window, params) {
37042
36855
  this.forEachChildren((layer, i) => {
37043
- layer.drawTo(window, {
37044
- ...params,
37045
- renderService: this.renderService,
37046
- background: layer === this.defaultLayer ? this.background : undefined,
37047
- clear: i === 0,
37048
- updateBounds: !!this.dirtyBounds
37049
- });
36856
+ layer.drawTo(window, Object.assign(Object.assign({}, params), { renderService: this.renderService, background: layer === this.defaultLayer ? this.background : undefined, clear: i === 0, updateBounds: !!this.dirtyBounds }));
37050
36857
  });
37051
36858
  }
37052
36859
  renderToNewWindow(fullImage = true) {
@@ -37119,7 +36926,7 @@
37119
36926
  'rect'
37120
36927
  ];
37121
36928
 
37122
- const version = "0.14.1";
36929
+ const version = "0.14.3-alpha.1";
37123
36930
 
37124
36931
  exports.ACustomAnimate = ACustomAnimate;
37125
36932
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;