@visactor/vrender-core 0.16.18-alpha.0 → 0.16.18

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.
Files changed (77) hide show
  1. package/cjs/animate/Ticker/default-ticker.js +2 -2
  2. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  3. package/cjs/animate/animate.js +1 -1
  4. package/cjs/animate/animate.js.map +1 -1
  5. package/cjs/animate/custom-animate.d.ts +12 -3
  6. package/cjs/animate/custom-animate.js +90 -1
  7. package/cjs/animate/custom-animate.js.map +1 -1
  8. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +14 -2
  9. package/cjs/core/contributions/textMeasure/AtextMeasure.js +99 -13
  10. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  11. package/cjs/core/contributions/textMeasure/layout.d.ts +2 -2
  12. package/cjs/core/contributions/textMeasure/layout.js +4 -4
  13. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  14. package/cjs/event/event-manager.js +8 -8
  15. package/cjs/event/event-manager.js.map +1 -1
  16. package/cjs/graphic/area.js +1 -0
  17. package/cjs/graphic/area.js.map +1 -1
  18. package/cjs/graphic/config.js +3 -2
  19. package/cjs/graphic/config.js.map +1 -1
  20. package/cjs/graphic/graphic-service/graphic-service.js +2 -2
  21. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  22. package/cjs/graphic/graphic.js +1 -0
  23. package/cjs/graphic/graphic.js.map +1 -1
  24. package/cjs/graphic/line.js +1 -0
  25. package/cjs/graphic/line.js.map +1 -1
  26. package/cjs/graphic/node-tree.js +1 -1
  27. package/cjs/graphic/node-tree.js.map +1 -1
  28. package/cjs/graphic/text.js +8 -8
  29. package/cjs/graphic/text.js.map +1 -1
  30. package/cjs/graphic/theme.js +1 -1
  31. package/cjs/graphic/theme.js.map +1 -1
  32. package/cjs/interface/graphic/text.d.ts +1 -0
  33. package/cjs/interface/graphic/text.js.map +1 -1
  34. package/cjs/interface/text.d.ts +2 -2
  35. package/cjs/interface/text.js.map +1 -1
  36. package/cjs/render/contributions/render/draw-contribution.js +1 -1
  37. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  38. package/dist/index.js +303 -44
  39. package/dist/index.min.js +1 -1
  40. package/es/animate/Ticker/default-ticker.js +3 -1
  41. package/es/animate/Ticker/default-ticker.js.map +1 -1
  42. package/es/animate/animate.js +2 -2
  43. package/es/animate/animate.js.map +1 -1
  44. package/es/animate/custom-animate.d.ts +12 -3
  45. package/es/animate/custom-animate.js +94 -1
  46. package/es/animate/custom-animate.js.map +1 -1
  47. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +14 -2
  48. package/es/core/contributions/textMeasure/AtextMeasure.js +99 -13
  49. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  50. package/es/core/contributions/textMeasure/layout.d.ts +2 -2
  51. package/es/core/contributions/textMeasure/layout.js +4 -4
  52. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  53. package/es/event/event-manager.js +9 -9
  54. package/es/event/event-manager.js.map +1 -1
  55. package/es/graphic/area.js +1 -0
  56. package/es/graphic/area.js.map +1 -1
  57. package/es/graphic/config.js +4 -3
  58. package/es/graphic/config.js.map +1 -1
  59. package/es/graphic/graphic-service/graphic-service.js +2 -2
  60. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  61. package/es/graphic/graphic.js +1 -0
  62. package/es/graphic/graphic.js.map +1 -1
  63. package/es/graphic/line.js +1 -0
  64. package/es/graphic/line.js.map +1 -1
  65. package/es/graphic/node-tree.js +2 -2
  66. package/es/graphic/node-tree.js.map +1 -1
  67. package/es/graphic/text.js +8 -8
  68. package/es/graphic/text.js.map +1 -1
  69. package/es/graphic/theme.js +2 -2
  70. package/es/graphic/theme.js.map +1 -1
  71. package/es/interface/graphic/text.d.ts +1 -0
  72. package/es/interface/graphic/text.js.map +1 -1
  73. package/es/interface/text.d.ts +2 -2
  74. package/es/interface/text.js.map +1 -1
  75. package/es/render/contributions/render/draw-contribution.js +2 -2
  76. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  77. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4297,7 +4297,8 @@
4297
4297
  verticalMode: 0,
4298
4298
  whiteSpace: 'no-wrap',
4299
4299
  heightLimit: Infinity,
4300
- lineClamp: Infinity
4300
+ lineClamp: Infinity,
4301
+ suffixPosition: 'end'
4301
4302
  };
4302
4303
  const DefaultStyle = Object.assign(Object.assign(Object.assign({ opacity: 1, background: null, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 'no-repeat', blur: 0, cursor: null, html: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
4303
4304
  const DefaultConnectAttribute = {
@@ -4325,7 +4326,7 @@
4325
4326
  const DefaultGlyphAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: '', width: 0, height: 0, cornerRadius: 0, clip: false });
4326
4327
  const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultConnectAttribute), { points: [], segments: [], curveType: 'linear', clipRange: 1, clipRangeByDimension: 'default', closePath: false });
4327
4328
  const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), { path: new CustomPath2D(), customPath: () => {
4328
- console.warn('空函数');
4329
+ vutils.Logger.getInstance().warn('空函数');
4329
4330
  } });
4330
4331
  const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute), { points: [], cornerRadius: 0, closePath: true });
4331
4332
  const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, strokeBoundsBuffer: 0, cornerRadius: 0 });
@@ -4566,7 +4567,7 @@
4566
4567
  }
4567
4568
  }
4568
4569
  if (verticalList[i] && verticalList[i].text.length > 1) {
4569
- const clipedData = this._clipText(verticalList[i].text, options, width - length, 0, verticalList[i].text.length - 1);
4570
+ const clipedData = this._clipText(verticalList[i].text, options, width - length, 0, verticalList[i].text.length - 1, 'end', false);
4570
4571
  if (wordBreak && clipedData.str !== verticalList[i].text) {
4571
4572
  let text = '';
4572
4573
  let length = 0;
@@ -4604,7 +4605,7 @@
4604
4605
  if (length > width) {
4605
4606
  return { str: '', width: 0 };
4606
4607
  }
4607
- const data = this._clipText(text, options, width, 0, text.length - 1);
4608
+ const data = this._clipText(text, options, width, 0, text.length - 1, 'end', false);
4608
4609
  if (wordBreak && data.str !== text) {
4609
4610
  const index = testLetter(text, data.str.length);
4610
4611
  if (index !== data.str.length) {
@@ -4614,7 +4615,23 @@
4614
4615
  }
4615
4616
  return data;
4616
4617
  }
4617
- _clipText(text, options, width, leftIdx, rightIdx) {
4618
+ _clipText(text, options, width, leftIdx, rightIdx, position, suffix) {
4619
+ let data;
4620
+ if (position === 'end') {
4621
+ data = this._clipTextEnd(text, options, width, leftIdx, rightIdx);
4622
+ suffix && (data.result = data.str + suffix);
4623
+ }
4624
+ else if (position === 'start') {
4625
+ data = this._clipTextStart(text, options, width, leftIdx, rightIdx);
4626
+ suffix && (data.result = suffix + data.str);
4627
+ }
4628
+ else if (position === 'middle') {
4629
+ const d = this._clipTextMiddle(text, options, width, '', '', 0, 0, 1);
4630
+ data = { str: 'none', width: d.width, result: d.left + suffix + d.right };
4631
+ }
4632
+ return data;
4633
+ }
4634
+ _clipTextEnd(text, options, width, leftIdx, rightIdx) {
4618
4635
  const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
4619
4636
  const subText = text.substring(0, middleIdx + 1);
4620
4637
  const strWidth = this.measureTextWidth(subText, options);
@@ -4628,7 +4645,7 @@
4628
4645
  if (length <= width) {
4629
4646
  return { str, width: length };
4630
4647
  }
4631
- return this._clipText(text, options, width, leftIdx, middleIdx);
4648
+ return this._clipTextEnd(text, options, width, leftIdx, middleIdx);
4632
4649
  }
4633
4650
  else if (strWidth < width) {
4634
4651
  if (middleIdx >= text.length - 1) {
@@ -4639,11 +4656,53 @@
4639
4656
  if (length >= width) {
4640
4657
  return { str: subText, width: strWidth };
4641
4658
  }
4642
- return this._clipText(text, options, width, middleIdx, rightIdx);
4659
+ return this._clipTextEnd(text, options, width, middleIdx, rightIdx);
4643
4660
  }
4644
4661
  return { str: subText, width: strWidth };
4645
4662
  }
4646
- clipTextWithSuffixVertical(verticalList, options, width, suffix, wordBreak) {
4663
+ _clipTextStart(text, options, width, leftIdx, rightIdx) {
4664
+ const middleIdx = Math.ceil((leftIdx + rightIdx) / 2);
4665
+ const subText = text.substring(middleIdx - 1, text.length - 1);
4666
+ const strWidth = this.measureTextWidth(subText, options);
4667
+ let length;
4668
+ if (strWidth > width) {
4669
+ if (subText.length <= 1) {
4670
+ return { str: '', width: 0 };
4671
+ }
4672
+ const str = text.substring(middleIdx, text.length - 1);
4673
+ length = this.measureTextWidth(str, options);
4674
+ if (length <= width) {
4675
+ return { str, width: length };
4676
+ }
4677
+ return this._clipTextStart(text, options, width, middleIdx, text.length - 1);
4678
+ }
4679
+ else if (strWidth < width) {
4680
+ if (middleIdx <= 0) {
4681
+ return { str: text, width: this.measureTextWidth(text, options) };
4682
+ }
4683
+ const str = text.substring(middleIdx - 2, text.length - 1);
4684
+ length = this.measureTextWidth(str, options);
4685
+ if (length >= width) {
4686
+ return { str: subText, width: strWidth };
4687
+ }
4688
+ return this._clipTextStart(text, options, width, leftIdx, middleIdx);
4689
+ }
4690
+ return { str: subText, width: strWidth };
4691
+ }
4692
+ _clipTextMiddle(text, options, width, left, right, leftW, rightW, buffer) {
4693
+ const subLeftText = text.substring(0, buffer);
4694
+ const strLeftWidth = this.measureTextWidth(subLeftText, options);
4695
+ if (strLeftWidth + rightW > width) {
4696
+ return { left, right, width: leftW + rightW };
4697
+ }
4698
+ const subRightText = text.substring(text.length - buffer, text.length);
4699
+ const strRightWidth = this.measureTextWidth(subRightText, options);
4700
+ if (strLeftWidth + strRightWidth > width) {
4701
+ return { left: subLeftText, right, width: strLeftWidth + rightW };
4702
+ }
4703
+ return this._clipTextMiddle(text, options, width, subLeftText, subRightText, strLeftWidth, strRightWidth, buffer + 1);
4704
+ }
4705
+ clipTextWithSuffixVertical(verticalList, options, width, suffix, wordBreak, suffixPosition) {
4647
4706
  if (suffix === '') {
4648
4707
  return this.clipTextVertical(verticalList, options, width, wordBreak);
4649
4708
  }
@@ -4660,16 +4719,51 @@
4660
4719
  return output;
4661
4720
  }
4662
4721
  width -= suffixWidth;
4663
- const out = this.clipTextVertical(verticalList, options, width, wordBreak);
4722
+ let out;
4723
+ if (suffixPosition === 'start') {
4724
+ const nextVerticalList = this.revertVerticalList(verticalList);
4725
+ out = this.clipTextVertical(nextVerticalList, options, width, wordBreak);
4726
+ const v = this.revertVerticalList(out.verticalList);
4727
+ v.unshift({
4728
+ text: suffix,
4729
+ direction: 1,
4730
+ width: suffixWidth
4731
+ });
4732
+ out.verticalList = v;
4733
+ }
4734
+ else if (suffixPosition === 'middle') {
4735
+ const leftOut = this.clipTextVertical(verticalList, options, width / 2, wordBreak);
4736
+ const nextVerticalList = this.revertVerticalList(verticalList);
4737
+ const rightOut = this.clipTextVertical(nextVerticalList, options, width / 2, wordBreak);
4738
+ leftOut.verticalList.push({
4739
+ text: suffix,
4740
+ direction: 1,
4741
+ width: suffixWidth
4742
+ });
4743
+ this.revertVerticalList(rightOut.verticalList).forEach(v => leftOut.verticalList.push(v));
4744
+ out = {
4745
+ verticalList: leftOut.verticalList,
4746
+ width: leftOut.width + rightOut.width
4747
+ };
4748
+ }
4749
+ else {
4750
+ out = this.clipTextVertical(verticalList, options, width, wordBreak);
4751
+ out.verticalList.push({
4752
+ text: suffix,
4753
+ direction: 1,
4754
+ width: suffixWidth
4755
+ });
4756
+ }
4664
4757
  out.width += suffixWidth;
4665
- out.verticalList.push({
4666
- text: suffix,
4667
- direction: 1,
4668
- width: suffixWidth
4669
- });
4670
4758
  return out;
4671
4759
  }
4672
- clipTextWithSuffix(text, options, width, suffix, wordBreak) {
4760
+ revertVerticalList(verticalList) {
4761
+ return verticalList.reverse().map(l => {
4762
+ const t = l.text.split('').reverse().join('');
4763
+ return Object.assign(Object.assign({}, l), { text: t });
4764
+ });
4765
+ }
4766
+ clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
4673
4767
  if (suffix === '') {
4674
4768
  return this.clipText(text, options, width, wordBreak);
4675
4769
  }
@@ -4685,7 +4779,7 @@
4685
4779
  return { str: '', width: 0 };
4686
4780
  }
4687
4781
  width -= suffixWidth;
4688
- const data = this._clipText(text, options, width, 0, text.length - 1);
4782
+ const data = this._clipText(text, options, width, 0, text.length - 1, position, suffix);
4689
4783
  if (wordBreak && data.str !== text) {
4690
4784
  const index = testLetter(text, data.str.length);
4691
4785
  if (index !== data.str.length) {
@@ -4693,7 +4787,7 @@
4693
4787
  data.width = this.measureTextWidth(data.str, options);
4694
4788
  }
4695
4789
  }
4696
- data.str += suffix;
4790
+ data.str = data.result;
4697
4791
  data.width += suffixWidth;
4698
4792
  return data;
4699
4793
  }
@@ -5701,7 +5795,7 @@
5701
5795
  }
5702
5796
  else {
5703
5797
  this.combinedTheme = this._defaultTheme;
5704
- console.warn('未知错误,走到不应该走的区域里');
5798
+ vutils.Logger.getInstance().warn('未知错误,走到不应该走的区域里');
5705
5799
  }
5706
5800
  this.dirty = false;
5707
5801
  }
@@ -6005,7 +6099,7 @@
6005
6099
  }
6006
6100
  insertInto(newNode, idx) {
6007
6101
  if (!this._ignoreWarn && this._nodeList) {
6008
- console.warn('insertIntoKeepIdx和insertInto混用可能会存在错误');
6102
+ vutils.Logger.getInstance().warn('insertIntoKeepIdx和insertInto混用可能会存在错误');
6009
6103
  }
6010
6104
  if (idx >= this.childrenCount) {
6011
6105
  return this.appendChild(newNode);
@@ -6618,7 +6712,7 @@
6618
6712
  this.eventPool = new Map();
6619
6713
  this.onPointerDown = (from, target) => {
6620
6714
  if (!(from instanceof FederatedPointerEvent)) {
6621
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6715
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6622
6716
  return;
6623
6717
  }
6624
6718
  const e = this.createPointerEvent(from, from.type, target);
@@ -6637,7 +6731,7 @@
6637
6731
  this.onPointerMove = (from, target) => {
6638
6732
  var _a, _b;
6639
6733
  if (!(from instanceof FederatedPointerEvent)) {
6640
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6734
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6641
6735
  return;
6642
6736
  }
6643
6737
  const e = this.createPointerEvent(from, from.type, target);
@@ -6711,7 +6805,7 @@
6711
6805
  this.onPointerOver = (from, target) => {
6712
6806
  var _a, _b;
6713
6807
  if (!(from instanceof FederatedPointerEvent)) {
6714
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6808
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6715
6809
  return;
6716
6810
  }
6717
6811
  const trackingData = this.trackingData(from.pointerId);
@@ -6740,7 +6834,7 @@
6740
6834
  };
6741
6835
  this.onPointerOut = (from, target) => {
6742
6836
  if (!(from instanceof FederatedPointerEvent)) {
6743
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6837
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6744
6838
  return;
6745
6839
  }
6746
6840
  const trackingData = this.trackingData(from.pointerId);
@@ -6771,7 +6865,7 @@
6771
6865
  this.onPointerUp = (from, target) => {
6772
6866
  var _a;
6773
6867
  if (!(from instanceof FederatedPointerEvent)) {
6774
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6868
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6775
6869
  return;
6776
6870
  }
6777
6871
  const now = clock.now();
@@ -6842,7 +6936,7 @@
6842
6936
  };
6843
6937
  this.onPointerUpOutside = (from, target) => {
6844
6938
  if (!(from instanceof FederatedPointerEvent)) {
6845
- console.warn('EventManager cannot map a non-pointer event as a pointer event');
6939
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-pointer event as a pointer event');
6846
6940
  return;
6847
6941
  }
6848
6942
  const trackingData = this.trackingData(from.pointerId);
@@ -6867,7 +6961,7 @@
6867
6961
  };
6868
6962
  this.onWheel = (from, target) => {
6869
6963
  if (!(from instanceof FederatedWheelEvent)) {
6870
- console.warn('EventManager cannot map a non-wheel event as a wheel event');
6964
+ vutils.Logger.getInstance().warn('EventManager cannot map a non-wheel event as a wheel event');
6871
6965
  return;
6872
6966
  }
6873
6967
  const wheelEvent = this.createWheelEvent(from, target);
@@ -6931,7 +7025,7 @@
6931
7025
  }
6932
7026
  }
6933
7027
  else {
6934
- console.warn(`[EventManager]: Event mapping not defined for ${e.type}`);
7028
+ vutils.Logger.getInstance().warn(`[EventManager]: Event mapping not defined for ${e.type}`);
6935
7029
  }
6936
7030
  }
6937
7031
  propagate(e, type) {
@@ -7772,7 +7866,7 @@
7772
7866
  handler = new ManualTickHandler();
7773
7867
  break;
7774
7868
  default:
7775
- console.warn('非法的计时器模式');
7869
+ vutils.Logger.getInstance().warn('非法的计时器模式');
7776
7870
  handler = new RAFTickHandler();
7777
7871
  break;
7778
7872
  }
@@ -8773,7 +8867,7 @@
8773
8867
  }
8774
8868
  lastStep = lastStep.prev;
8775
8869
  }
8776
- console.warn('未知错误,step中找不到属性');
8870
+ vutils.Logger.getInstance().warn('未知错误,step中找不到属性');
8777
8871
  return step.props[name];
8778
8872
  }
8779
8873
  updateTarget(step, ratio, end) {
@@ -9287,6 +9381,28 @@
9287
9381
  return {};
9288
9382
  }
9289
9383
  onStart() {
9384
+ if (!this.target) {
9385
+ return;
9386
+ }
9387
+ if (this.target.type === 'rect') {
9388
+ this.onStartRect();
9389
+ }
9390
+ else if (this.target.type === 'line') {
9391
+ this.onStartLineOrArea('line');
9392
+ }
9393
+ else if (this.target.type === 'area') {
9394
+ this.onStartLineOrArea('area');
9395
+ }
9396
+ }
9397
+ onStartLineOrArea(type) {
9398
+ var _a;
9399
+ const root = this.target.attachShadow();
9400
+ const line = application.graphicService.creator[type](Object.assign({}, (_a = this.params) === null || _a === void 0 ? void 0 : _a.attribute));
9401
+ this[type] = line;
9402
+ line.pathProxy = new CustomPath2D();
9403
+ root.add(line);
9404
+ }
9405
+ onStartRect() {
9290
9406
  var _a;
9291
9407
  const root = this.target.attachShadow();
9292
9408
  const height = this.target.AABBBounds.height();
@@ -9301,6 +9417,14 @@
9301
9417
  this.target.detachShadow();
9302
9418
  }
9303
9419
  onUpdate(end, ratio, out) {
9420
+ if (this.rect) {
9421
+ return this.onUpdateRect(end, ratio, out);
9422
+ }
9423
+ else if (this.line || this.area) {
9424
+ return this.onUpdateLineOrArea(end, ratio, out);
9425
+ }
9426
+ }
9427
+ onUpdateRect(end, ratio, out) {
9304
9428
  var _a, _b, _c, _d, _e, _f;
9305
9429
  const parentWidth = (_a = this.target.attribute.width) !== null && _a !== void 0 ? _a : 250;
9306
9430
  const streamLength = (_c = (_b = this.params) === null || _b === void 0 ? void 0 : _b.streamLength) !== null && _c !== void 0 ? _c : parentWidth;
@@ -9321,6 +9445,130 @@
9321
9445
  }
9322
9446
  });
9323
9447
  }
9448
+ onUpdateLineOrArea(end, ratio, out) {
9449
+ const target = this.line || this.area;
9450
+ if (!target) {
9451
+ return;
9452
+ }
9453
+ const customPath = target.pathProxy;
9454
+ const targetLine = this.target;
9455
+ if (targetLine.cache || targetLine.cacheArea) {
9456
+ this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out);
9457
+ }
9458
+ else {
9459
+ this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);
9460
+ }
9461
+ const targetAttrs = targetLine.attribute;
9462
+ target.setAttributes(Object.assign({ stroke: targetAttrs.stroke }, target.attribute));
9463
+ target.addUpdateBoundTag();
9464
+ }
9465
+ _onUpdateLineOrAreaWithCache(customPath, g, end, ratio, out) {
9466
+ customPath.clear();
9467
+ if (g.type === 'line') {
9468
+ let cache = g.cache;
9469
+ if (!Array.isArray(cache)) {
9470
+ cache = [cache];
9471
+ }
9472
+ const totalLen = cache.reduce((l, c) => l + c.getLength(), 0);
9473
+ const curves = [];
9474
+ cache.forEach((c) => {
9475
+ c.curves.forEach((ci) => curves.push(ci));
9476
+ });
9477
+ return this._updateCurves(customPath, curves, totalLen, ratio);
9478
+ }
9479
+ else if (g.type === 'area') {
9480
+ const cache = g.cacheArea;
9481
+ const totalLen = cache.top.curves.reduce((a, b) => a + b.getLength(), 0);
9482
+ return this._updateCurves(customPath, cache.top.curves, totalLen, ratio);
9483
+ }
9484
+ }
9485
+ _updateCurves(customPath, curves, totalLen, ratio) {
9486
+ var _a, _b;
9487
+ const startLen = totalLen * ratio;
9488
+ const endLen = Math.min((_b = startLen + ((_a = this.params) === null || _a === void 0 ? void 0 : _a.streamLength)) !== null && _b !== void 0 ? _b : 10, totalLen);
9489
+ let lastLen = 0;
9490
+ let start = false;
9491
+ for (let i = 0; i < curves.length; i++) {
9492
+ const curveItem = curves[i];
9493
+ const len = curveItem.getLength();
9494
+ const startPercent = 1 - (lastLen + len - startLen) / len;
9495
+ let endPercent = 1 - (lastLen + len - endLen) / len;
9496
+ let curveForStart;
9497
+ if (lastLen < startLen && lastLen + len > startLen) {
9498
+ start = true;
9499
+ if (curveItem.p2 && curveItem.p3) {
9500
+ const [_, curve2] = divideCubic(curveItem, startPercent);
9501
+ customPath.moveTo(curve2.p0.x, curve2.p0.y);
9502
+ curveForStart = curve2;
9503
+ }
9504
+ else {
9505
+ const p = curveItem.getPointAt(startPercent);
9506
+ customPath.moveTo(p.x, p.y);
9507
+ }
9508
+ }
9509
+ if (lastLen < endLen && lastLen + len > endLen) {
9510
+ if (curveItem.p2 && curveItem.p3) {
9511
+ if (curveForStart) {
9512
+ endPercent = (endLen - startLen) / curveForStart.getLength();
9513
+ }
9514
+ const [curve1] = divideCubic(curveForStart || curveItem, endPercent);
9515
+ customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);
9516
+ }
9517
+ else {
9518
+ const p = curveItem.getPointAt(endPercent);
9519
+ customPath.lineTo(p.x, p.y);
9520
+ }
9521
+ break;
9522
+ }
9523
+ else if (start) {
9524
+ if (curveItem.p2 && curveItem.p3) {
9525
+ const curve = curveForStart || curveItem;
9526
+ customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);
9527
+ }
9528
+ else {
9529
+ customPath.lineTo(curveItem.p1.x, curveItem.p1.y);
9530
+ }
9531
+ }
9532
+ lastLen += len;
9533
+ }
9534
+ }
9535
+ _onUpdateLineWithoutCache(customPath, line, end, ratio, out) {
9536
+ var _a, _b;
9537
+ const { points, curveType } = line.attribute;
9538
+ if (!points || points.length < 2 || curveType !== 'linear') {
9539
+ return;
9540
+ }
9541
+ let totalLen = 0;
9542
+ for (let i = 1; i < points.length; i++) {
9543
+ totalLen += vutils.PointService.distancePP(points[i], points[i - 1]);
9544
+ }
9545
+ const startLen = totalLen * ratio;
9546
+ const endLen = Math.min((_b = startLen + ((_a = this.params) === null || _a === void 0 ? void 0 : _a.streamLength)) !== null && _b !== void 0 ? _b : 10, totalLen);
9547
+ const nextPoints = [];
9548
+ let lastLen = 0;
9549
+ for (let i = 1; i < points.length; i++) {
9550
+ const len = vutils.PointService.distancePP(points[i], points[i - 1]);
9551
+ if (lastLen < startLen && lastLen + len > startLen) {
9552
+ nextPoints.push(vutils.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - startLen) / len));
9553
+ }
9554
+ if (lastLen < endLen && lastLen + len > endLen) {
9555
+ nextPoints.push(vutils.PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - endLen) / len));
9556
+ break;
9557
+ }
9558
+ else if (nextPoints.length) {
9559
+ nextPoints.push(points[i]);
9560
+ }
9561
+ lastLen += len;
9562
+ }
9563
+ if (!nextPoints.length || nextPoints.length < 2) {
9564
+ return;
9565
+ }
9566
+ customPath.clear();
9567
+ customPath.moveTo(nextPoints[0].x, nextPoints[0].y);
9568
+ for (let i = 1; i < nextPoints.length; i++) {
9569
+ customPath.lineTo(nextPoints[i].x, nextPoints[i].y);
9570
+ }
9571
+ }
9324
9572
  }
9325
9573
  class Meteor extends ACustomAnimate {
9326
9574
  get lastPos() {
@@ -12232,6 +12480,10 @@
12232
12480
  }
12233
12481
  const nextStepVal = nextProps[key];
12234
12482
  const lastStepVal = (_a = (lastProps && lastProps[key])) !== null && _a !== void 0 ? _a : subAnimate.getLastPropByName(key, step);
12483
+ if (nextStepVal == null || lastStepVal == null) {
12484
+ nextAttributes[key] = nextStepVal;
12485
+ return;
12486
+ }
12235
12487
  let match;
12236
12488
  match =
12237
12489
  animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes);
@@ -14243,12 +14495,12 @@
14243
14495
  }
14244
14496
  return bbox;
14245
14497
  }
14246
- GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, miniApp) {
14498
+ GetLayout(str, width, height, textAlign, textBaseline, lineHeight, suffix, wordBreak, suffixPosition) {
14247
14499
  const linesLayout = [];
14248
14500
  const bboxWH = [width, height];
14249
14501
  const bboxOffset = [0, 0];
14250
14502
  while (str.length > 0) {
14251
- const { str: clipText } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak);
14503
+ const { str: clipText } = this.textMeasure.clipTextWithSuffix(str, this.textOptions, width, suffix, wordBreak, suffixPosition);
14252
14504
  linesLayout.push({
14253
14505
  str: clipText,
14254
14506
  width: this.textMeasure.measureTextWidth(clipText, this.textOptions)
@@ -14277,7 +14529,7 @@
14277
14529
  };
14278
14530
  return this.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
14279
14531
  }
14280
- GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, lineWidth) {
14532
+ GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = '', wordBreak, lineWidth, suffixPosition = 'end') {
14281
14533
  lines = lines.map(l => l.toString());
14282
14534
  const linesLayout = [];
14283
14535
  const bboxWH = [0, 0];
@@ -14286,7 +14538,7 @@
14286
14538
  for (let i = 0, len = lines.length; i < len; i++) {
14287
14539
  width = Math.min(this.textMeasure.measureTextWidth(lines[i], this.textOptions), lineWidth);
14288
14540
  linesLayout.push({
14289
- str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak).str,
14541
+ str: this.textMeasure.clipTextWithSuffix(lines[i], this.textOptions, width, suffix, wordBreak, suffixPosition).str,
14290
14542
  width
14291
14543
  });
14292
14544
  }
@@ -14572,7 +14824,7 @@
14572
14824
  let width;
14573
14825
  let str;
14574
14826
  const attribute = this.attribute;
14575
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak, ignoreBuf = textTheme.ignoreBuf, whiteSpace = textTheme.whiteSpace } = attribute;
14827
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, ignoreBuf = textTheme.ignoreBuf, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
14576
14828
  if (whiteSpace === 'normal') {
14577
14829
  return this.updateWrapAABBBounds(text);
14578
14830
  }
@@ -14592,7 +14844,7 @@
14592
14844
  if (Number.isFinite(maxLineWidth)) {
14593
14845
  if (ellipsis) {
14594
14846
  const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
14595
- const data = textMeasure.clipTextWithSuffix(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false);
14847
+ const data = textMeasure.clipTextWithSuffix(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
14596
14848
  str = data.str;
14597
14849
  width = data.width;
14598
14850
  }
@@ -14636,7 +14888,7 @@
14636
14888
  const attribute = this.attribute;
14637
14889
  const { ignoreBuf = textTheme.ignoreBuf } = attribute;
14638
14890
  const buf = ignoreBuf ? 0 : 2;
14639
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode } = attribute;
14891
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
14640
14892
  const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
14641
14893
  let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
14642
14894
  if (!verticalMode) {
@@ -14660,7 +14912,7 @@
14660
14912
  if (Number.isFinite(maxLineWidth)) {
14661
14913
  if (ellipsis) {
14662
14914
  const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
14663
- const data = textMeasure.clipTextWithSuffixVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false);
14915
+ const data = textMeasure.clipTextWithSuffixVertical(verticalList[0], { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
14664
14916
  verticalList = [data.verticalList];
14665
14917
  width = data.width;
14666
14918
  }
@@ -14697,7 +14949,7 @@
14697
14949
  var _a, _b;
14698
14950
  const textTheme = getTheme(this).text;
14699
14951
  const attribute = this.attribute;
14700
- const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace } = attribute;
14952
+ const { fontFamily = textTheme.fontFamily, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, ellipsis = textTheme.ellipsis, maxLineWidth, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, whiteSpace = textTheme.whiteSpace, suffixPosition = textTheme.suffixPosition } = attribute;
14701
14953
  const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize);
14702
14954
  if (whiteSpace === 'normal') {
14703
14955
  return this.updateWrapAABBBounds(text);
@@ -14712,7 +14964,7 @@
14712
14964
  }
14713
14965
  const textMeasure = application.graphicUtil.textMeasure;
14714
14966
  const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);
14715
- const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, maxLineWidth);
14967
+ const layoutData = layoutObj.GetLayoutByLines(text, textAlign, textBaseline, lineHeight, ellipsis === true ? textTheme.ellipsis : ellipsis || undefined, false, maxLineWidth, suffixPosition);
14716
14968
  const { bbox } = layoutData;
14717
14969
  this.cache.layoutData = layoutData;
14718
14970
  this.clearUpdateShapeTag();
@@ -14730,7 +14982,7 @@
14730
14982
  const attribute = this.attribute;
14731
14983
  const { ignoreBuf = textTheme.ignoreBuf } = attribute;
14732
14984
  const buf = ignoreBuf ? 0 : 2;
14733
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode } = attribute;
14985
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode, suffixPosition = textTheme.suffixPosition } = attribute;
14734
14986
  const lineHeight = (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
14735
14987
  let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
14736
14988
  if (!verticalMode) {
@@ -14760,7 +15012,7 @@
14760
15012
  if (Number.isFinite(maxLineWidth)) {
14761
15013
  if (ellipsis) {
14762
15014
  const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis);
14763
- const data = textMeasure.clipTextWithSuffixVertical(verticalData, { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false);
15015
+ const data = textMeasure.clipTextWithSuffixVertical(verticalData, { fontSize, fontWeight, fontFamily }, maxLineWidth, strEllipsis, false, suffixPosition);
14764
15016
  verticalLists[i] = data.verticalList;
14765
15017
  width = data.width;
14766
15018
  }
@@ -15874,6 +16126,9 @@
15874
16126
  return super.isValid() && this._isValid();
15875
16127
  }
15876
16128
  _isValid() {
16129
+ if (this.pathProxy) {
16130
+ return true;
16131
+ }
15877
16132
  const { points, segments } = this.attribute;
15878
16133
  if (segments) {
15879
16134
  if (segments.length === 0) {
@@ -17505,6 +17760,9 @@
17505
17760
  return super.isValid() && this._isValid();
17506
17761
  }
17507
17762
  _isValid() {
17763
+ if (this.pathProxy) {
17764
+ return true;
17765
+ }
17508
17766
  const { points, segments } = this.attribute;
17509
17767
  if (segments) {
17510
17768
  if (segments.length === 0) {
@@ -19118,8 +19376,9 @@
19118
19376
  tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
19119
19377
  }
19120
19378
  if (shadowBlur) {
19121
- const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
19122
- boundStroke(tb1, shadowBlurHalfWidth, miter, strokeBoundsBuffer);
19379
+ const { shadowOffsetX = theme.shadowOffsetX, shadowOffsetY = theme.shadowOffsetY } = attribute;
19380
+ const shadowBlurWidth = (shadowBlur / Math.abs(scaleX + scaleY)) * 2 + Math.max(shadowOffsetX, shadowOffsetY);
19381
+ boundStroke(tb1, shadowBlurWidth, miter, strokeBoundsBuffer + 1);
19123
19382
  aabbBounds.union(tb1);
19124
19383
  }
19125
19384
  this.combindShadowAABBBounds(aabbBounds, graphic);
@@ -23910,7 +24169,7 @@
23910
24169
  }
23911
24170
  }
23912
24171
  selectRenderByType(type) {
23913
- console.warn('未知错误,不应该走到这里');
24172
+ vutils.Logger.getInstance().warn('未知错误,不应该走到这里');
23914
24173
  return null;
23915
24174
  }
23916
24175
  selectRenderByNumberType(type) {