@visactor/vrender-core 0.22.0-vstory.1 → 0.22.0-vstory.10

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 (90) hide show
  1. package/cjs/canvas/util.js +1 -2
  2. package/cjs/color-string/store.js +2 -1
  3. package/cjs/core/global.d.ts +0 -3
  4. package/cjs/core/global.js +1 -7
  5. package/cjs/core/global.js.map +1 -1
  6. package/cjs/graphic/builtin-symbol/utils.js +1 -1
  7. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  8. package/cjs/graphic/config.js +1 -0
  9. package/cjs/graphic/config.js.map +1 -1
  10. package/cjs/graphic/graphic.d.ts +1 -1
  11. package/cjs/graphic/graphic.js +5 -5
  12. package/cjs/graphic/graphic.js.map +1 -1
  13. package/cjs/graphic/group.js +1 -1
  14. package/cjs/graphic/group.js.map +1 -1
  15. package/cjs/graphic/richtext/line.js +13 -1
  16. package/cjs/graphic/richtext/line.js.map +1 -1
  17. package/cjs/graphic/richtext/paragraph.d.ts +9 -1
  18. package/cjs/graphic/richtext/paragraph.js +50 -11
  19. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  20. package/cjs/graphic/richtext/utils.js +4 -4
  21. package/cjs/graphic/richtext/utils.js.map +1 -1
  22. package/cjs/graphic/richtext.d.ts +2 -1
  23. package/cjs/graphic/richtext.js +10 -1
  24. package/cjs/graphic/richtext.js.map +1 -1
  25. package/cjs/interface/global.d.ts +0 -1
  26. package/cjs/interface/global.js.map +1 -1
  27. package/cjs/interface/graphic/richText.d.ts +11 -0
  28. package/cjs/interface/graphic/richText.js.map +1 -1
  29. package/cjs/interface/graphic.d.ts +1 -1
  30. package/cjs/interface/graphic.js.map +1 -1
  31. package/cjs/plugins/builtin-plugin/edit-module.d.ts +2 -1
  32. package/cjs/plugins/builtin-plugin/edit-module.js +20 -15
  33. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  34. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +36 -10
  35. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +322 -132
  36. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  37. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  38. package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -2
  39. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  40. package/cjs/render/contributions/render/draw-contribution.js +3 -2
  41. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  42. package/cjs/render/contributions/render/image-render.js.map +1 -1
  43. package/cjs/resource-loader/loader.js +1 -1
  44. package/cjs/resource-loader/loader.js.map +1 -1
  45. package/dist/index.es.js +498 -110
  46. package/es/canvas/util.js +1 -2
  47. package/es/color-string/store.js +2 -1
  48. package/es/core/global.d.ts +0 -3
  49. package/es/core/global.js +1 -8
  50. package/es/core/global.js.map +1 -1
  51. package/es/graphic/builtin-symbol/utils.js +1 -1
  52. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  53. package/es/graphic/config.js +1 -0
  54. package/es/graphic/config.js.map +1 -1
  55. package/es/graphic/graphic.d.ts +1 -1
  56. package/es/graphic/graphic.js +5 -5
  57. package/es/graphic/graphic.js.map +1 -1
  58. package/es/graphic/group.js +1 -1
  59. package/es/graphic/group.js.map +1 -1
  60. package/es/graphic/richtext/line.js +13 -1
  61. package/es/graphic/richtext/line.js.map +1 -1
  62. package/es/graphic/richtext/paragraph.d.ts +9 -1
  63. package/es/graphic/richtext/paragraph.js +50 -11
  64. package/es/graphic/richtext/paragraph.js.map +1 -1
  65. package/es/graphic/richtext/utils.js +4 -4
  66. package/es/graphic/richtext/utils.js.map +1 -1
  67. package/es/graphic/richtext.d.ts +2 -1
  68. package/es/graphic/richtext.js +10 -1
  69. package/es/graphic/richtext.js.map +1 -1
  70. package/es/interface/global.d.ts +0 -1
  71. package/es/interface/global.js.map +1 -1
  72. package/es/interface/graphic/richText.d.ts +11 -0
  73. package/es/interface/graphic/richText.js.map +1 -1
  74. package/es/interface/graphic.d.ts +1 -1
  75. package/es/interface/graphic.js.map +1 -1
  76. package/es/plugins/builtin-plugin/edit-module.d.ts +2 -1
  77. package/es/plugins/builtin-plugin/edit-module.js +17 -13
  78. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  79. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +36 -10
  80. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +320 -131
  81. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  82. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  83. package/es/render/contributions/render/contributions/image-contribution-render.js +2 -2
  84. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  85. package/es/render/contributions/render/draw-contribution.js +2 -2
  86. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  87. package/es/render/contributions/render/image-render.js.map +1 -1
  88. package/es/resource-loader/loader.js +1 -1
  89. package/es/resource-loader/loader.js.map +1 -1
  90. package/package.json +3 -3
package/dist/index.es.js CHANGED
@@ -855,12 +855,6 @@ let DefaultGlobal = class DefaultGlobal {
855
855
  get env() {
856
856
  return this._env;
857
857
  }
858
- get isImageAnonymous() {
859
- return this._isImageAnonymous;
860
- }
861
- set isImageAnonymous(isImageAnonymous) {
862
- this._isImageAnonymous = isImageAnonymous;
863
- }
864
858
  get devicePixelRatio() {
865
859
  if (!this._env) {
866
860
  this.setEnv(defaultEnv);
@@ -929,7 +923,6 @@ let DefaultGlobal = class DefaultGlobal {
929
923
  }
930
924
  constructor(contributions) {
931
925
  this.contributions = contributions;
932
- this._isImageAnonymous = true;
933
926
  this.id = Generator.GenAutoIncrementId();
934
927
  this.hooks = {
935
928
  onSetEnv: new SyncHook(['lastEnv', 'env', 'global'])
@@ -3314,7 +3307,7 @@ const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute),
3314
3307
  const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), { width: 0, height: 0, x1: 0, y1: 0, cornerRadius: 0, length: 0, cornerType: 'round' });
3315
3308
  const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), { symbolType: 'circle', size: 10, keepDirIn3d: true, clipRange: 1 });
3316
3309
  const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { strokeBoundsBuffer: 0, keepDirIn3d: true });
3317
- const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { editable: false, width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], disableAutoWrapLine: false, maxHeight: undefined, maxWidth: undefined, singleLine: false });
3310
+ const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), { editable: false, editOptions: null, width: 300, height: 300, ellipsis: true, wordBreak: 'break-word', verticalDirection: 'top', textAlign: 'left', textBaseline: 'top', layoutDirection: 'horizontal', textConfig: [], disableAutoWrapLine: false, maxHeight: undefined, maxWidth: undefined, singleLine: false });
3318
3311
  const DefaultImageAttribute = Object.assign(Object.assign({ repeatX: 'no-repeat', repeatY: 'no-repeat', image: '', width: 0, height: 0 }, DefaultAttribute), { fill: true, cornerRadius: 0, cornerType: 'round' });
3319
3312
  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 });
3320
3313
 
@@ -3938,17 +3931,16 @@ function measureTextCanvas(text, character) {
3938
3931
  descent: 0,
3939
3932
  width: 0
3940
3933
  };
3941
- if (typeof measurement.actualBoundingBoxAscent !== 'number' ||
3942
- typeof measurement.actualBoundingBoxDescent !== 'number') {
3943
- result.width = Math.floor(measurement.width);
3934
+ if (typeof measurement.fontBoundingBoxAscent !== 'number' || typeof measurement.fontBoundingBoxDescent !== 'number') {
3935
+ result.width = measurement.width;
3944
3936
  result.height = character.fontSize || 0;
3945
3937
  result.ascent = result.height;
3946
3938
  result.descent = 0;
3947
3939
  }
3948
3940
  else {
3949
- result.width = Math.floor(measurement.width);
3950
- result.height = Math.floor(measurement.actualBoundingBoxAscent + measurement.actualBoundingBoxDescent);
3951
- result.ascent = Math.floor(measurement.actualBoundingBoxAscent);
3941
+ result.width = measurement.width;
3942
+ result.height = Math.floor(measurement.fontBoundingBoxAscent + measurement.fontBoundingBoxDescent);
3943
+ result.ascent = Math.floor(measurement.fontBoundingBoxAscent);
3952
3944
  result.descent = result.height - result.ascent;
3953
3945
  }
3954
3946
  return result;
@@ -11737,10 +11729,10 @@ class ResourceLoader {
11737
11729
  static GetFile(url, type) {
11738
11730
  let data = ResourceLoader.cache.get(url);
11739
11731
  if (data) {
11740
- if (data.loadState === 'fail') {
11732
+ if (data.loadState === 'init' || data.loadState === 'fail') {
11741
11733
  return Promise.reject();
11742
11734
  }
11743
- else if (data.loadState === 'init' || data.loadState === 'loading') {
11735
+ else if (data.loadState === 'loading') {
11744
11736
  return data.dataPromise.then(data => data.data);
11745
11737
  }
11746
11738
  return Promise.resolve(data.data);
@@ -11909,7 +11901,7 @@ class Graphic extends Node {
11909
11901
  }
11910
11902
  }
11911
11903
  get AABBBounds() {
11912
- return this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
11904
+ return this.tryUpdateAABBBounds();
11913
11905
  }
11914
11906
  get OBBBounds() {
11915
11907
  return this.tryUpdateOBBBounds();
@@ -11964,7 +11956,8 @@ class Graphic extends Node {
11964
11956
  onAnimateBind(animate) {
11965
11957
  this._emitCustomEvent('animate-bind', animate);
11966
11958
  }
11967
- tryUpdateAABBBounds(full) {
11959
+ tryUpdateAABBBounds() {
11960
+ const full = this.attribute.boundsMode === 'imprecise';
11968
11961
  if (!this.shouldUpdateAABBBounds()) {
11969
11962
  return this._AABBBounds;
11970
11963
  }
@@ -11975,6 +11968,9 @@ class Graphic extends Node {
11975
11968
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
11976
11969
  const bounds = this.doUpdateAABBBounds(full);
11977
11970
  application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);
11971
+ if (this.attribute.boundsMode === 'empty') {
11972
+ bounds.clear();
11973
+ }
11978
11974
  return bounds;
11979
11975
  }
11980
11976
  tryUpdateOBBBounds() {
@@ -12402,11 +12398,11 @@ class Graphic extends Node {
12402
12398
  }
12403
12399
  update(d) {
12404
12400
  if (d) {
12405
- d.bounds && this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
12401
+ d.bounds && this.tryUpdateAABBBounds();
12406
12402
  d.trans && this.tryUpdateLocalTransMatrix();
12407
12403
  }
12408
12404
  else {
12409
- this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
12405
+ this.tryUpdateAABBBounds();
12410
12406
  this.tryUpdateLocalTransMatrix();
12411
12407
  }
12412
12408
  }
@@ -13591,6 +13587,9 @@ class Group extends Graphic {
13591
13587
  const bounds = this.doUpdateAABBBounds();
13592
13588
  this.addUpdateLayoutTag();
13593
13589
  application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);
13590
+ if (this.attribute.boundsMode === 'empty') {
13591
+ bounds.clear();
13592
+ }
13594
13593
  return bounds;
13595
13594
  }
13596
13595
  doUpdateLocalMatrix() {
@@ -16918,6 +16917,7 @@ class CustomSymbolClass {
16918
16917
  return isNumber(size) ? size : Math.min(size[0], size[1]);
16919
16918
  }
16920
16919
  drawWithClipRange(ctx, size, x, y, clipRange, z, cb) {
16920
+ size = this.parseSize(size);
16921
16921
  if (this.isSvg) {
16922
16922
  if (!this.svgCache) {
16923
16923
  return false;
@@ -17839,6 +17839,18 @@ class Frame {
17839
17839
  }
17840
17840
  }
17841
17841
 
17842
+ function getFixedLRTB(left, right, top, bottom) {
17843
+ const leftInt = Math.round(left);
17844
+ const topInt = Math.round(top);
17845
+ const rightInt = Math.round(right);
17846
+ const bottomInt = Math.round(bottom);
17847
+ return {
17848
+ left: leftInt,
17849
+ top: topInt,
17850
+ right: rightInt,
17851
+ bottom: bottomInt
17852
+ };
17853
+ }
17842
17854
  class Paragraph {
17843
17855
  constructor(text, newLine, character) {
17844
17856
  this.fontSize = character.fontSize || 16;
@@ -17905,7 +17917,47 @@ class Paragraph {
17905
17917
  this.height = this.widthOrigin;
17906
17918
  }
17907
17919
  }
17908
- draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign) {
17920
+ drawBackground(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
17921
+ if (!(this.character.background && (!this.character.backgroundOpacity || this.character.backgroundOpacity > 0))) {
17922
+ return;
17923
+ }
17924
+ let baseline = top + ascent;
17925
+ let text = this.text;
17926
+ let left = this.left + deltaLeft;
17927
+ baseline += this.top;
17928
+ let direction = this.direction;
17929
+ if (this.verticalEllipsis) {
17930
+ text = this.ellipsisStr;
17931
+ direction = 'vertical';
17932
+ baseline -= this.ellipsisWidth / 2;
17933
+ }
17934
+ else if (this.ellipsis === 'hide') {
17935
+ return;
17936
+ }
17937
+ else if (this.ellipsis === 'add') {
17938
+ text += this.ellipsisStr;
17939
+ if (textAlign === 'right' || textAlign === 'end') {
17940
+ left -= this.ellipsisWidth;
17941
+ }
17942
+ }
17943
+ else if (this.ellipsis === 'replace') {
17944
+ const index = getStrByWithCanvas(text, (direction === 'vertical' ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
17945
+ text = text.slice(0, index);
17946
+ text += this.ellipsisStr;
17947
+ if (textAlign === 'right' || textAlign === 'end') {
17948
+ const { width } = measureTextCanvas(this.text.slice(index), this.character);
17949
+ if (direction === 'vertical') ;
17950
+ else {
17951
+ left -= this.ellipsisWidth - width;
17952
+ }
17953
+ }
17954
+ }
17955
+ const right = left + (this.widthOrigin || this.width);
17956
+ const bottom = top + lineHeight;
17957
+ const lrtb = getFixedLRTB(left, right, top, bottom);
17958
+ return Object.assign(Object.assign({}, lrtb), { fillStyle: this.character.background, globalAlpha: this.character.backgroundOpacity });
17959
+ }
17960
+ draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
17909
17961
  let baseline = top + ascent;
17910
17962
  let text = this.text;
17911
17963
  let left = this.left + deltaLeft;
@@ -17953,19 +18005,6 @@ class Paragraph {
17953
18005
  left = 0;
17954
18006
  baseline = 0;
17955
18007
  }
17956
- if (this.character.fill) {
17957
- if (this.character.background && (!this.character.backgroundOpacity || this.character.backgroundOpacity > 0)) {
17958
- const fillStyle = ctx.fillStyle;
17959
- const globalAlpha = ctx.globalAlpha;
17960
- ctx.fillStyle = this.character.background;
17961
- if (this.character.backgroundOpacity !== void 0) {
17962
- ctx.globalAlpha = this.character.backgroundOpacity;
17963
- }
17964
- ctx.fillRect(left, top, this.widthOrigin || this.width, this.lineHeight);
17965
- ctx.fillStyle = fillStyle;
17966
- ctx.globalAlpha = globalAlpha;
17967
- }
17968
- }
17969
18008
  const { lineWidth = 1 } = this.character;
17970
18009
  if (this.character.stroke && lineWidth) {
17971
18010
  ctx.strokeText(text, left, baseline);
@@ -17974,19 +18013,35 @@ class Paragraph {
17974
18013
  ctx.fillText(text, left, baseline);
17975
18014
  }
17976
18015
  if (this.character.fill) {
17977
- if (typeof this.character.lineThrough === 'boolean' || typeof this.character.underline === 'boolean') {
18016
+ if (this.character.lineThrough || this.character.underline) {
17978
18017
  if (this.character.underline) {
17979
- ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18018
+ const top = 1 + baseline;
18019
+ const right = left + (this.widthOrigin || this.width);
18020
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18021
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18022
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17980
18023
  }
17981
18024
  if (this.character.lineThrough) {
17982
- ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18025
+ const top = 1 + baseline - this.ascent / 2;
18026
+ const right = left + (this.widthOrigin || this.width);
18027
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18028
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18029
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17983
18030
  }
17984
18031
  }
17985
18032
  else if (this.character.textDecoration === 'underline') {
17986
- ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18033
+ const top = 1 + baseline;
18034
+ const right = left + (this.widthOrigin || this.width);
18035
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18036
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18037
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17987
18038
  }
17988
18039
  else if (this.character.textDecoration === 'line-through') {
17989
- ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18040
+ const top = 1 + baseline - this.ascent / 2;
18041
+ const right = left + (this.widthOrigin || this.width);
18042
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18043
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18044
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17990
18045
  }
17991
18046
  }
17992
18047
  if (direction === 'vertical') {
@@ -18325,6 +18380,36 @@ class Line {
18325
18380
  }
18326
18381
  }
18327
18382
  }
18383
+ let fillStyle = '';
18384
+ let globalAlpha = -1;
18385
+ let currBgList = [];
18386
+ const bgList = [currBgList];
18387
+ this.paragraphs.forEach((paragraph, index) => {
18388
+ if (paragraph instanceof RichTextIcon) {
18389
+ return;
18390
+ }
18391
+ const data = paragraph.drawBackground(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
18392
+ if (!data) {
18393
+ return;
18394
+ }
18395
+ if (!(fillStyle === data.fillStyle && globalAlpha === data.globalAlpha)) {
18396
+ currBgList = [];
18397
+ bgList.push(currBgList);
18398
+ fillStyle = data.fillStyle;
18399
+ globalAlpha = data.globalAlpha;
18400
+ }
18401
+ currBgList.push(data);
18402
+ });
18403
+ bgList.forEach(bg => {
18404
+ if (bg.length === 0) {
18405
+ return;
18406
+ }
18407
+ const data = bg[0];
18408
+ const end = bg[bg.length - 1];
18409
+ ctx.fillStyle = data.fillStyle;
18410
+ ctx.globalAlpha = data.globalAlpha;
18411
+ ctx.fillRect(data.left, data.top, end.right - data.left, end.bottom - data.top);
18412
+ });
18328
18413
  this.paragraphs.forEach((paragraph, index) => {
18329
18414
  if (paragraph instanceof RichTextIcon) {
18330
18415
  paragraph.setAttributes({
@@ -18342,7 +18427,7 @@ class Line {
18342
18427
  };
18343
18428
  applyStrokeStyle(ctx, paragraph.character);
18344
18429
  applyFillStyle(ctx, paragraph.character, b);
18345
- paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign);
18430
+ paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
18346
18431
  });
18347
18432
  }
18348
18433
  getWidthWithEllips(ellipsis) {
@@ -18672,7 +18757,16 @@ class RichText extends Graphic {
18672
18757
  return tc.every(item => item.isComposing ||
18673
18758
  !(item.text && isString(item.text) && RichText.splitText(item.text).length > 1));
18674
18759
  }
18760
+ static splitEmoji(text) {
18761
+ return [...new Intl.Segmenter().segment(text)].map(x => x.segment);
18762
+ }
18675
18763
  static splitText(text) {
18764
+ try {
18765
+ const arr = this.splitEmoji(text);
18766
+ return arr;
18767
+ }
18768
+ catch (e) {
18769
+ }
18676
18770
  return Array.from(text);
18677
18771
  }
18678
18772
  static TransformTextConfig2SingleCharacter(textConfig) {
@@ -18692,7 +18786,8 @@ class RichText extends Graphic {
18692
18786
  return tc;
18693
18787
  }
18694
18788
  updateAABBBounds(attribute, richtextTheme, aabbBounds) {
18695
- const { width = richtextTheme.width, height = richtextTheme.height, maxWidth = richtextTheme.maxWidth, maxHeight = richtextTheme.maxHeight, textAlign = richtextTheme.textAlign, textBaseline = richtextTheme.textBaseline } = attribute;
18789
+ var _a, _b;
18790
+ const { width = richtextTheme.width, height = richtextTheme.height, maxWidth = richtextTheme.maxWidth, maxHeight = richtextTheme.maxHeight, textAlign = richtextTheme.textAlign, textBaseline = richtextTheme.textBaseline, editOptions } = attribute;
18696
18791
  if (width > 0 && height > 0) {
18697
18792
  aabbBounds.set(0, 0, width, height);
18698
18793
  }
@@ -18705,6 +18800,10 @@ class RichText extends Graphic {
18705
18800
  contentWidth = typeof maxWidth === 'number' && contentWidth > maxWidth ? maxWidth : contentWidth || 0;
18706
18801
  aabbBounds.set(0, 0, contentWidth, contentHeight);
18707
18802
  }
18803
+ if (editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !((_a = attribute.textConfig) === null || _a === void 0 ? void 0 : _a.length)) {
18804
+ aabbBounds.y2 = aabbBounds.y1 + ((_b = attribute.fontSize) !== null && _b !== void 0 ? _b : 12);
18805
+ aabbBounds.x2 = aabbBounds.x1 + 2;
18806
+ }
18708
18807
  let deltaY = 0;
18709
18808
  switch (textBaseline) {
18710
18809
  case 'top':
@@ -20726,8 +20825,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
20726
20825
  this.useStyle = true;
20727
20826
  this.order = 0;
20728
20827
  }
20729
- drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
20730
- return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
20828
+ drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
20829
+ return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
20731
20830
  }
20732
20831
  }
20733
20832
  const defaultImageRenderContribution = new DefaultImageRenderContribution();
@@ -24323,7 +24422,9 @@ let DefaultDrawContribution = class DefaultDrawContribution {
24323
24422
  this._increaseRender(group, drawContext);
24324
24423
  return;
24325
24424
  }
24326
- if (this.useDirtyBounds && !isRectIntersect(group.AABBBounds, this.dirtyBounds, false)) {
24425
+ if (this.useDirtyBounds &&
24426
+ !isRectIntersect(group.AABBBounds, this.dirtyBounds, false) &&
24427
+ group.attribute.boundsMode !== 'empty') {
24327
24428
  return;
24328
24429
  }
24329
24430
  let nextM = parentMatrix;
@@ -24445,7 +24546,9 @@ let DefaultDrawContribution = class DefaultDrawContribution {
24445
24546
  tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix);
24446
24547
  }
24447
24548
  if (this.useDirtyBounds &&
24448
- !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, tempBounds !== null && tempBounds !== void 0 ? tempBounds : this.dirtyBounds, false))) {
24549
+ !(graphic.isContainer ||
24550
+ graphic.attribute.boundsMode === 'empty' ||
24551
+ isRectIntersect(graphic.AABBBounds, tempBounds !== null && tempBounds !== void 0 ? tempBounds : this.dirtyBounds, false))) {
24449
24552
  if (retrans && graphic.parent) {
24450
24553
  const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;
24451
24554
  this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);
@@ -26935,6 +27038,20 @@ function flatten_simplify(points, tolerance, highestQuality) {
26935
27038
  return points;
26936
27039
  }
26937
27040
 
27041
+ function getDefaultCharacterConfig(attribute) {
27042
+ const { fill = 'black', stroke = false, fontWeight = 'normal', fontFamily = 'Arial' } = attribute;
27043
+ let { fontSize = 12 } = attribute;
27044
+ if (!isFinite(fontSize)) {
27045
+ fontSize = 12;
27046
+ }
27047
+ return {
27048
+ fill,
27049
+ stroke,
27050
+ fontSize,
27051
+ fontWeight,
27052
+ fontFamily
27053
+ };
27054
+ }
26938
27055
  function findConfigIndexByCursorIdx(textConfig, cursorIndex) {
26939
27056
  if (cursorIndex < 0) {
26940
27057
  return 0;
@@ -27016,7 +27133,7 @@ class EditModule {
27016
27133
  this.composingConfigIdx = this.cursorIndex < 0 ? 0 : findConfigIndexByCursorIdx(textConfig, this.cursorIndex);
27017
27134
  if (this.cursorIndex < 0) {
27018
27135
  const config = textConfig[0];
27019
- textConfig.unshift(Object.assign(Object.assign({ fill: 'black' }, config), { text: '' }));
27136
+ textConfig.unshift(Object.assign(Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), config), { text: '' }));
27020
27137
  }
27021
27138
  else {
27022
27139
  const configIdx = this.composingConfigIdx;
@@ -27033,14 +27150,13 @@ class EditModule {
27033
27150
  });
27034
27151
  };
27035
27152
  this.handleInput = (ev) => {
27036
- var _a, _b, _c, _d;
27037
27153
  if (!this.currRt) {
27038
27154
  return;
27039
27155
  }
27040
27156
  if (ev.inputType === 'historyUndo') {
27041
27157
  return;
27042
27158
  }
27043
- const _e = this.currRt.attribute, { textConfig = [] } = _e, rest = __rest(_e, ["textConfig"]);
27159
+ const _a = this.currRt.attribute, { textConfig = [] } = _a, rest = __rest(_a, ["textConfig"]);
27044
27160
  if (ev.type === 'Backspace' && !textConfig.length) {
27045
27161
  return;
27046
27162
  }
@@ -27056,12 +27172,7 @@ class EditModule {
27056
27172
  const lastConfigIdx = this.isComposing ? this.composingConfigIdx : Math.max(startIdx - 1, 0);
27057
27173
  let lastConfig = textConfig[lastConfigIdx];
27058
27174
  if (!lastConfig) {
27059
- lastConfig = {
27060
- fill: (_a = rest.fill) !== null && _a !== void 0 ? _a : 'black',
27061
- stroke: (_b = rest.stroke) !== null && _b !== void 0 ? _b : false,
27062
- fontSize: (_c = rest.fontSize) !== null && _c !== void 0 ? _c : 12,
27063
- fontWeight: (_d = rest.fontWeight) !== null && _d !== void 0 ? _d : 'normal'
27064
- };
27175
+ lastConfig = getDefaultCharacterConfig(rest);
27065
27176
  }
27066
27177
  let nextConfig = lastConfig;
27067
27178
  if (startIdx !== endIdx) {
@@ -27157,7 +27268,7 @@ class EditModule {
27157
27268
  const text = lastConfig.text;
27158
27269
  const textList = text ? Array.from(text.toString()) : [];
27159
27270
  for (let i = 0; i < textList.length; i++) {
27160
- textConfig.splice(i + configIdx, 0, Object.assign(Object.assign({ fill: 'black' }, lastConfig), { isComposing: false, text: textList[i] }));
27271
+ textConfig.splice(i + configIdx, 0, Object.assign(Object.assign(Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), { fill: 'black' }), lastConfig), { isComposing: false, text: textList[i] }));
27161
27272
  }
27162
27273
  this.currRt.setAttributes({ textConfig });
27163
27274
  const nextConfigIdx = configIdx + textList.length;
@@ -27219,6 +27330,9 @@ class Selection {
27219
27330
  }
27220
27331
  let idx = Math.round(cursorIdx);
27221
27332
  const config = this.rt.attribute.textConfig;
27333
+ if (!config.length) {
27334
+ return null;
27335
+ }
27222
27336
  for (let i = 0; i < config.length; i++) {
27223
27337
  if (config[i].text !== '\n') {
27224
27338
  idx--;
@@ -27247,6 +27361,7 @@ class Selection {
27247
27361
  }
27248
27362
  }
27249
27363
  const FORMAT_TEXT_COMMAND = 'FORMAT_TEXT_COMMAND';
27364
+ const FORMAT_ALL_TEXT_COMMAND = 'FORMAT_ALL_TEXT_COMMAND';
27250
27365
  const FORMAT_ELEMENT_COMMAND = 'FORMAT_ELEMENT_COMMAND';
27251
27366
  class RichTextEditPlugin {
27252
27367
  static tryUpdateRichtext(richtext) {
@@ -27270,7 +27385,33 @@ class RichTextEditPlugin {
27270
27385
  this._uid = Generator.GenAutoIncrementId();
27271
27386
  this.key = this.name + this._uid;
27272
27387
  this.editing = false;
27388
+ this.focusing = false;
27273
27389
  this.pointerDown = false;
27390
+ this.formatTextCommandCb = (payload, p) => {
27391
+ const rt = p.currRt;
27392
+ if (!rt) {
27393
+ return;
27394
+ }
27395
+ const selectionData = p.getSelection();
27396
+ if (!selectionData) {
27397
+ return;
27398
+ }
27399
+ const { selectionStartCursorIdx, curCursorIdx } = selectionData;
27400
+ const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);
27401
+ const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);
27402
+ const minConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, minCursorIdx);
27403
+ const maxConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, maxCursorIdx);
27404
+ const config = rt.attribute.textConfig.slice(minConfigIdx, maxConfigIdx);
27405
+ this._formatTextCommand(payload, config, rt);
27406
+ };
27407
+ this.formatAllTextCommandCb = (payload, p) => {
27408
+ const rt = p.currRt;
27409
+ if (!rt) {
27410
+ return;
27411
+ }
27412
+ const config = rt.attribute.textConfig;
27413
+ this._formatTextCommand(payload, config, rt);
27414
+ };
27274
27415
  this.handleKeyDown = (e) => {
27275
27416
  if (!(this.currRt && this.editing)) {
27276
27417
  return;
@@ -27286,10 +27427,20 @@ class RichTextEditPlugin {
27286
27427
  }
27287
27428
  };
27288
27429
  this.handleInput = (text, isComposing, cursorIdx, rt) => {
27430
+ if (!this.currRt) {
27431
+ return;
27432
+ }
27433
+ this.tryShowShadowPlaceholder();
27434
+ this.tryShowInputBounds();
27289
27435
  this.hideSelection();
27290
27436
  this.updateCbs.forEach(cb => cb('input', this));
27291
27437
  };
27292
27438
  this.handleChange = (text, isComposing, cursorIdx, rt) => {
27439
+ if (!this.currRt) {
27440
+ return;
27441
+ }
27442
+ this.tryShowShadowPlaceholder();
27443
+ this.tryShowInputBounds();
27293
27444
  this.curCursorIdx = cursorIdx;
27294
27445
  this.selectionStartCursorIdx = cursorIdx;
27295
27446
  const p = this.computedCursorPosByCursorIdx(cursorIdx, rt);
@@ -27298,37 +27449,37 @@ class RichTextEditPlugin {
27298
27449
  this.updateCbs.forEach(cb => cb('change', this));
27299
27450
  };
27300
27451
  this.handleFocusIn = () => {
27452
+ throw new Error('不会走到这里 handleFocusIn');
27301
27453
  };
27302
27454
  this.handleFocusOut = () => {
27303
- this.editing = false;
27304
- this.deFocus();
27305
- this.pointerDown = false;
27306
- this.triggerRender();
27307
- this.updateCbs.forEach(cb => cb('defocus', this));
27455
+ throw new Error('不会走到这里 handleFocusOut');
27308
27456
  };
27309
27457
  this.handleMove = (e) => {
27310
- if (!this.isRichtext(e)) {
27458
+ if (this.currRt && !this.currRt.attribute.editable) {
27459
+ this.deFocus(true);
27460
+ }
27461
+ if (!this.isEditableRichtext(e)) {
27462
+ this.handleLeave();
27311
27463
  return;
27312
27464
  }
27313
- this.currRt = e.target;
27314
- this.handleEnter(e);
27465
+ this.handleEnter();
27315
27466
  e.target.once('pointerleave', this.handleLeave);
27316
27467
  this.tryShowSelection(e, false);
27317
27468
  };
27318
- this.handleEnter = (e) => {
27469
+ this.handleEnter = () => {
27319
27470
  this.editing = true;
27320
27471
  this.pluginService.stage.setCursor('text');
27321
27472
  };
27322
- this.handleLeave = (e) => {
27473
+ this.handleLeave = () => {
27323
27474
  this.editing = false;
27324
27475
  this.pluginService.stage.setCursor('default');
27325
27476
  };
27326
27477
  this.handlePointerDown = (e) => {
27327
- if (this.editing) {
27328
- this.onFocus(e);
27478
+ if (!this.editing || !this.isEditableRichtext(e)) {
27479
+ this.deFocus(true);
27329
27480
  }
27330
27481
  else {
27331
- this.deFocus();
27482
+ this.onFocus(e);
27332
27483
  }
27333
27484
  this.triggerRender();
27334
27485
  this.pointerDown = true;
@@ -27345,27 +27496,14 @@ class RichTextEditPlugin {
27345
27496
  };
27346
27497
  this.commandCbs = new Map();
27347
27498
  this.commandCbs.set(FORMAT_TEXT_COMMAND, [this.formatTextCommandCb]);
27499
+ this.commandCbs.set(FORMAT_ALL_TEXT_COMMAND, [this.formatAllTextCommandCb]);
27348
27500
  this.updateCbs = [];
27349
27501
  this.timeline = new DefaultTimeline();
27350
27502
  this.ticker = new DefaultTicker([this.timeline]);
27351
27503
  this.deltaX = 0;
27352
27504
  this.deltaY = 0;
27353
27505
  }
27354
- formatTextCommandCb(payload, p) {
27355
- const rt = p.currRt;
27356
- if (!rt) {
27357
- return;
27358
- }
27359
- const selectionData = p.getSelection();
27360
- if (!selectionData) {
27361
- return;
27362
- }
27363
- const { selectionStartCursorIdx, curCursorIdx } = selectionData;
27364
- const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);
27365
- const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);
27366
- const minConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, minCursorIdx);
27367
- const maxConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, maxCursorIdx);
27368
- const config = rt.attribute.textConfig.slice(minConfigIdx, maxConfigIdx);
27506
+ _formatTextCommand(payload, config, rt) {
27369
27507
  if (payload === 'bold') {
27370
27508
  config.forEach((item) => (item.fontWeight = 'bold'));
27371
27509
  }
@@ -27382,6 +27520,12 @@ class RichTextEditPlugin {
27382
27520
  config.forEach((item) => merge(item, payload));
27383
27521
  }
27384
27522
  rt.setAttributes(rt.attribute);
27523
+ const cache = rt.getFrameCache();
27524
+ if (!cache) {
27525
+ return;
27526
+ }
27527
+ this.selectionRangeByCursorIdx(this.selectionStartCursorIdx, this.curCursorIdx, cache);
27528
+ this.tryShowInputBounds();
27385
27529
  }
27386
27530
  dispatchCommand(command, payload) {
27387
27531
  const cbs = this.commandCbs.get(command);
@@ -27392,10 +27536,24 @@ class RichTextEditPlugin {
27392
27536
  const cbs = this.commandCbs.get(command) || [];
27393
27537
  cbs.push(cb);
27394
27538
  }
27539
+ removeCommand(command, cb) {
27540
+ const cbs = this.commandCbs.get(command) || [];
27541
+ const idx = cbs.indexOf(cb);
27542
+ if (idx > -1) {
27543
+ cbs.splice(idx, 1);
27544
+ }
27545
+ }
27395
27546
  registerUpdateListener(cb) {
27396
27547
  const cbs = this.updateCbs || [];
27397
27548
  cbs.push(cb);
27398
27549
  }
27550
+ removeUpdateListener(cb) {
27551
+ const cbs = this.updateCbs || [];
27552
+ const idx = cbs.indexOf(cb);
27553
+ if (idx > -1) {
27554
+ cbs.splice(idx, 1);
27555
+ }
27556
+ }
27399
27557
  activate(context) {
27400
27558
  this.pluginService = context;
27401
27559
  this.editModule = new EditModule();
@@ -27436,8 +27594,11 @@ class RichTextEditPlugin {
27436
27594
  }
27437
27595
  startIdx = Math.min(Math.max(startIdx, -0.1), totalCursorCount + 0.1);
27438
27596
  endIdx = Math.min(Math.max(endIdx, -0.1), totalCursorCount + 0.1);
27439
- this.curCursorIdx = endIdx;
27440
- this.selectionStartCursorIdx = startIdx;
27597
+ this.selectionRangeByCursorIdx(startIdx, endIdx, cache);
27598
+ }
27599
+ selectionRangeByCursorIdx(startCursorIdx, endCursorIdx, cache) {
27600
+ this.curCursorIdx = endCursorIdx;
27601
+ this.selectionStartCursorIdx = startCursorIdx;
27441
27602
  const { x, y1, y2 } = this.computedCursorPosByCursorIdx(this.selectionStartCursorIdx, this.currRt);
27442
27603
  this.startCursorPos = { x, y: (y1 + y2) / 2 };
27443
27604
  const pos = this.computedCursorPosByCursorIdx(this.curCursorIdx, this.currRt);
@@ -27456,6 +27617,12 @@ class RichTextEditPlugin {
27456
27617
  return;
27457
27618
  }
27458
27619
  const { lines } = cache;
27620
+ if (lines.length === 0) {
27621
+ return;
27622
+ }
27623
+ if (!lines[0].paragraphs || lines[0].paragraphs.length === 0) {
27624
+ return;
27625
+ }
27459
27626
  const totalCursorCount = lines.reduce((total, line) => total + line.paragraphs.length, 0) - 1;
27460
27627
  this.selectionRange(-0.1, totalCursorCount + 0.1);
27461
27628
  e.preventDefault();
@@ -27552,6 +27719,87 @@ class RichTextEditPlugin {
27552
27719
  }
27553
27720
  return true;
27554
27721
  }
27722
+ tryShowShadowPlaceholder() {
27723
+ if (!this.currRt) {
27724
+ return;
27725
+ }
27726
+ const shadowRoot = this.currRt.shadowRoot;
27727
+ if (shadowRoot) {
27728
+ const placeholder = shadowRoot.getElementsByType('richtext')[0];
27729
+ placeholder && shadowRoot.removeChild(placeholder);
27730
+ }
27731
+ const { textConfig, editOptions } = this.currRt.attribute;
27732
+ if (textConfig && textConfig.length) {
27733
+ return;
27734
+ }
27735
+ if (!(editOptions && editOptions.placeholder)) {
27736
+ return;
27737
+ }
27738
+ const { placeholder, placeholderColor = 'rgba(0, 0, 0, 0.6)', placeholderFontFamily, placeholderFontSize } = editOptions;
27739
+ const shadow = this.getShadow(this.currRt);
27740
+ const textConfigItem = Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), { text: placeholder });
27741
+ if (placeholderColor) {
27742
+ textConfigItem.fill = placeholderColor;
27743
+ }
27744
+ if (placeholderFontFamily) {
27745
+ textConfigItem.fontFamily = placeholderFontFamily;
27746
+ }
27747
+ if (placeholderFontSize) {
27748
+ textConfigItem.fontSize = placeholderFontSize;
27749
+ }
27750
+ this.shadowPlaceHolder = createRichText(Object.assign(Object.assign({}, this.currRt.attribute), { x: 0, y: 0, pickable: false, editable: false, editOptions: null, angle: 0, _debug_bounds: false, textConfig: [textConfigItem] }));
27751
+ shadow.add(this.shadowPlaceHolder);
27752
+ }
27753
+ tryShowInputBounds() {
27754
+ if (!(this.currRt && this.focusing)) {
27755
+ return;
27756
+ }
27757
+ const { editOptions = {} } = this.currRt.attribute;
27758
+ const { boundsStrokeWhenInput } = editOptions;
27759
+ if (!editOptions || !boundsStrokeWhenInput) {
27760
+ return;
27761
+ }
27762
+ const { attribute } = this.currRt;
27763
+ let b = this.currRt.AABBBounds;
27764
+ let h = b.height();
27765
+ if (!attribute.textConfig.length && this.editLine) {
27766
+ const { points } = this.editLine.attribute;
27767
+ h = points[1].y - points[0].y;
27768
+ b = getRichTextBounds(Object.assign({}, this.shadowPlaceHolder.attribute));
27769
+ }
27770
+ this.shadowBounds = this.shadowBounds || createRect({});
27771
+ this.shadowBounds.setAttributes({
27772
+ x: 0,
27773
+ y: 0,
27774
+ width: b.width(),
27775
+ height: h,
27776
+ fill: false,
27777
+ stroke: boundsStrokeWhenInput,
27778
+ lineWidth: 1,
27779
+ zIndex: -1
27780
+ });
27781
+ const shadow = this.getShadow(this.currRt);
27782
+ shadow.add(this.shadowBounds);
27783
+ this.offsetLineBgAndShadowBounds();
27784
+ }
27785
+ trySyncPlaceholderToTextConfig() {
27786
+ if (!this.currRt) {
27787
+ return;
27788
+ }
27789
+ const { textConfig, editOptions } = this.currRt.attribute;
27790
+ if (textConfig && textConfig.length) {
27791
+ return;
27792
+ }
27793
+ if (!(editOptions && editOptions.placeholder && editOptions.syncPlaceHolderToTextConfig)) {
27794
+ return;
27795
+ }
27796
+ const { placeholder } = editOptions;
27797
+ this.currRt.setAttributes({
27798
+ textConfig: [
27799
+ Object.assign({ text: placeholder }, getDefaultCharacterConfig(this.currRt.attribute))
27800
+ ]
27801
+ });
27802
+ }
27555
27803
  deactivate(context) {
27556
27804
  context.stage.off('pointermove', this.handleMove);
27557
27805
  context.stage.off('pointerdown', this.handlePointerDown);
@@ -27560,12 +27808,17 @@ class RichTextEditPlugin {
27560
27808
  context.stage.off('dblclick', this.handleDBLClick);
27561
27809
  application.global.addEventListener('keydown', this.handleKeyDown);
27562
27810
  }
27563
- onFocus(e) {
27564
- this.deFocus();
27565
- this.currRt = e.target;
27811
+ onFocus(e, data) {
27812
+ this.updateCbs && this.updateCbs.forEach(cb => cb('beforeOnfocus', this));
27813
+ this.deFocus(false);
27814
+ this.focusing = true;
27566
27815
  const target = e.target;
27816
+ if (!(target && target.type === 'richtext')) {
27817
+ return;
27818
+ }
27819
+ this.currRt = target;
27567
27820
  RichTextEditPlugin.tryUpdateRichtext(target);
27568
- const shadowRoot = target.attachShadow();
27821
+ const shadowRoot = this.getShadow(target);
27569
27822
  const cache = target.getFrameCache();
27570
27823
  if (!cache) {
27571
27824
  return;
@@ -27582,7 +27835,7 @@ class RichTextEditPlugin {
27582
27835
  shadowRoot.add(this.editLine);
27583
27836
  shadowRoot.add(this.editBg);
27584
27837
  }
27585
- const data = this.computedCursorPosByEvent(e, cache);
27838
+ data = data || this.computedCursorPosByEvent(e, cache);
27586
27839
  if (data) {
27587
27840
  const { x, y1, y2, cursorIndex } = data;
27588
27841
  this.startCursorPos = { x, y: (y1 + y2) / 2 };
@@ -27590,22 +27843,85 @@ class RichTextEditPlugin {
27590
27843
  this.selectionStartCursorIdx = cursorIndex;
27591
27844
  this.setCursorAndTextArea(x, y1, y2, target);
27592
27845
  }
27846
+ else {
27847
+ const x = 0;
27848
+ const y1 = 0;
27849
+ const y2 = getRichTextBounds(Object.assign(Object.assign({}, target.attribute), { textConfig: [{ text: 'a' }] })).height();
27850
+ this.startCursorPos = { x, y: (y1 + y2) / 2 };
27851
+ this.curCursorIdx = -0.1;
27852
+ this.selectionStartCursorIdx = -0.1;
27853
+ this.setCursorAndTextArea(x, y1, y2, target);
27854
+ }
27855
+ this.tryShowShadowPlaceholder();
27856
+ this.tryShowInputBounds();
27857
+ this.currRt.addUpdateBoundTag();
27593
27858
  }
27594
- deFocus() {
27595
- const target = this.currRt;
27596
- if (!target) {
27859
+ offsetLineBgAndShadowBounds() {
27860
+ const rt = this.currRt;
27861
+ const { textBaseline } = rt.attribute;
27862
+ let dy = 0;
27863
+ let attr = rt.attribute;
27864
+ let b;
27865
+ if (textBaseline === 'middle' || textBaseline === 'bottom') {
27866
+ if (!attr.textConfig.length) {
27867
+ attr = Object.assign(Object.assign({}, attr), { textConfig: [{ text: 'a' }] });
27868
+ }
27869
+ b = getRichTextBounds(attr);
27870
+ }
27871
+ if (textBaseline === 'middle') {
27872
+ dy = -b.height() / 2;
27873
+ }
27874
+ else if (textBaseline === 'bottom') {
27875
+ dy = -b.height();
27876
+ }
27877
+ this.editLine && this.editLine.setAttributes({ dy });
27878
+ this.editBg && this.editBg.setAttributes({ dy });
27879
+ if (this.shadowBounds) {
27880
+ this.shadowBounds.setAttributes({ dy });
27881
+ }
27882
+ }
27883
+ deFocus(trulyDeFocus = false) {
27884
+ const currRt = this.currRt;
27885
+ if (!currRt) {
27597
27886
  return;
27598
27887
  }
27599
- target.detachShadow();
27888
+ this.updateCbs && this.updateCbs.forEach(cb => cb('beforeDefocus', this, { trulyDeFocus }));
27889
+ if (trulyDeFocus) {
27890
+ this.trySyncPlaceholderToTextConfig();
27891
+ currRt.detachShadow();
27892
+ }
27600
27893
  this.currRt = null;
27601
27894
  if (this.editLine) {
27602
- this.editLine.parent.removeChild(this.editLine);
27895
+ this.editLine.parent && this.editLine.parent.removeChild(this.editLine);
27603
27896
  this.editLine.release();
27604
27897
  this.editLine = null;
27605
- this.editBg.parent.removeChild(this.editBg);
27898
+ this.editBg.parent && this.editBg.parent.removeChild(this.editBg);
27606
27899
  this.editBg.release();
27607
27900
  this.editBg = null;
27608
27901
  }
27902
+ if (trulyDeFocus) {
27903
+ if (this.shadowBounds) {
27904
+ this.shadowBounds.parent && this.shadowBounds.parent.removeChild(this.shadowBounds);
27905
+ this.shadowBounds.release();
27906
+ this.shadowBounds = null;
27907
+ }
27908
+ if (this.shadowPlaceHolder) {
27909
+ this.shadowPlaceHolder.parent && this.shadowPlaceHolder.parent.removeChild(this.shadowPlaceHolder);
27910
+ this.shadowPlaceHolder.release();
27911
+ this.shadowPlaceHolder = null;
27912
+ }
27913
+ }
27914
+ this.focusing = false;
27915
+ const textConfig = currRt.attribute.textConfig;
27916
+ let lastConfig = textConfig[textConfig.length - 1];
27917
+ let cleared = false;
27918
+ while (lastConfig && lastConfig.text === '\n') {
27919
+ textConfig.pop();
27920
+ lastConfig = textConfig[textConfig.length - 1];
27921
+ cleared = true;
27922
+ }
27923
+ cleared && currRt.setAttributes({ textConfig });
27924
+ currRt.removeEventListener('pointerleave', this.handleLeave);
27609
27925
  }
27610
27926
  addAnimateToLine(line) {
27611
27927
  line.animates &&
@@ -27613,8 +27929,9 @@ class RichTextEditPlugin {
27613
27929
  animate.stop();
27614
27930
  animate.release();
27615
27931
  });
27616
- const animate = line.animate();
27617
- animate.setTimeline(this.timeline);
27932
+ const animate = line.animate({
27933
+ timeline: this.timeline
27934
+ });
27618
27935
  animate.to({ opacity: 1 }, 10, 'linear').wait(700).to({ opacity: 0 }, 10, 'linear').wait(700).loop(Infinity);
27619
27936
  }
27620
27937
  tryShowSelection(e, dblclick) {
@@ -27665,6 +27982,9 @@ class RichTextEditPlugin {
27665
27982
  };
27666
27983
  let line0Info = this.getLineByPoint(cache, startCursorPos);
27667
27984
  let line1Info = this.getLineByPoint(cache, endCursorPos);
27985
+ if (!line0Info || !line1Info) {
27986
+ return;
27987
+ }
27668
27988
  if (startCursorPos.y > endCursorPos.y ||
27669
27989
  (startCursorPos.y === endCursorPos.y && startCursorPos.x > endCursorPos.x)) {
27670
27990
  [startCursorPos, endCursorPos] = [endCursorPos, startCursorPos];
@@ -27725,7 +28045,7 @@ class RichTextEditPlugin {
27725
28045
  y += line.height;
27726
28046
  }
27727
28047
  }
27728
- this.setCursorAndTextArea(currCursorData.x, currCursorData.y1 + 2, currCursorData.y2 - 2, this.currRt);
28048
+ this.setCursorAndTextArea(currCursorData.x, currCursorData.y1, currCursorData.y2, this.currRt);
27729
28049
  this.triggerRender();
27730
28050
  this.updateCbs.forEach(cb => cb('selection', this));
27731
28051
  }
@@ -27735,6 +28055,11 @@ class RichTextEditPlugin {
27735
28055
  this.editBg.setAttributes({ fill: 'transparent' });
27736
28056
  }
27737
28057
  }
28058
+ getShadow(rt) {
28059
+ const sr = rt.shadowRoot || rt.attachShadow();
28060
+ sr.setAttributes({ boundsMode: 'empty' });
28061
+ return sr;
28062
+ }
27738
28063
  getLineByPoint(cache, p1) {
27739
28064
  let lineInfo = cache.lines[0];
27740
28065
  for (let i = 0; i < cache.lines.length; i++) {
@@ -27793,7 +28118,10 @@ class RichTextEditPlugin {
27793
28118
  return -1;
27794
28119
  }
27795
28120
  isRichtext(e) {
27796
- return !!(e.target && e.target.type === 'richtext' && e.target.attribute.editable);
28121
+ return !!(e.target && e.target.type === 'richtext');
28122
+ }
28123
+ isEditableRichtext(e) {
28124
+ return this.isRichtext(e) && !!e.target.attribute.editable;
27797
28125
  }
27798
28126
  triggerRender() {
27799
28127
  this.pluginService.stage.renderNextFrame();
@@ -27823,6 +28151,18 @@ class RichTextEditPlugin {
27823
28151
  e.target.globalTransMatrix.transformPoint(p, p1);
27824
28152
  p1.x -= this.deltaX;
27825
28153
  p1.y -= this.deltaY;
28154
+ const rt = this.currRt;
28155
+ const { textBaseline } = rt.attribute;
28156
+ let dy = 0;
28157
+ if (textBaseline === 'middle') {
28158
+ const b = getRichTextBounds(rt.attribute);
28159
+ dy = b.height() / 2;
28160
+ }
28161
+ else if (textBaseline === 'bottom') {
28162
+ const b = getRichTextBounds(rt.attribute);
28163
+ dy = b.height();
28164
+ }
28165
+ p1.y += dy;
27826
28166
  return p1;
27827
28167
  }
27828
28168
  setCursorAndTextArea(x, y1, y2, rt) {
@@ -27838,6 +28178,7 @@ class RichTextEditPlugin {
27838
28178
  const { left, top } = this.pluginService.stage.window.getBoundingClientRect();
27839
28179
  out.x += left;
27840
28180
  out.y += top;
28181
+ this.offsetLineBgAndShadowBounds();
27841
28182
  this.editModule.moveTo(out.x, out.y, rt, this.curCursorIdx, this.selectionStartCursorIdx);
27842
28183
  }
27843
28184
  computedCursorPosByEvent(e, cache) {
@@ -27850,10 +28191,8 @@ class RichTextEditPlugin {
27850
28191
  if (!columnInfo) {
27851
28192
  return;
27852
28193
  }
27853
- let y1 = lineInfo.top;
27854
- let y2 = lineInfo.top + lineInfo.height;
27855
- y1 += 2;
27856
- y2 -= 2;
28194
+ const y1 = lineInfo.top;
28195
+ const y2 = lineInfo.top + lineInfo.height;
27857
28196
  let cursorIndex = this.getColumnIndex(cache, columnInfo);
27858
28197
  cursorIndex += delta;
27859
28198
  const x = columnInfo.left + (delta > 0 ? columnInfo.width : 0);
@@ -27874,6 +28213,14 @@ class RichTextEditPlugin {
27874
28213
  const column = this.getColumnByIndex(cache, idx);
27875
28214
  const height = (_a = rt.attribute.fontSize) !== null && _a !== void 0 ? _a : (_c = (_b = rt.attribute.textConfig) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.fontSize;
27876
28215
  if (!column) {
28216
+ if (!cache.lines.length) {
28217
+ const b = getRichTextBounds(Object.assign(Object.assign({}, rt.attribute), { textConfig: [{ text: 'a' }] }));
28218
+ return {
28219
+ x: 0,
28220
+ y1: 0,
28221
+ y2: b.height()
28222
+ };
28223
+ }
27877
28224
  return {
27878
28225
  x: 0,
27879
28226
  y1: 0,
@@ -27881,12 +28228,10 @@ class RichTextEditPlugin {
27881
28228
  };
27882
28229
  }
27883
28230
  const { lineInfo, columnInfo } = column;
27884
- let y1 = lineInfo.top;
27885
- let y2 = lineInfo.top + lineInfo.height;
28231
+ const y1 = lineInfo.top;
28232
+ const y2 = lineInfo.top + lineInfo.height;
27886
28233
  const x = columnInfo.left + (leftRight < 0 ? 0 : columnInfo.width);
27887
- y1 += 2;
27888
- y2 -= 2;
27889
- return { x, y1, y2 };
28234
+ return { x, y1, y2, lineInfo, columnInfo };
27890
28235
  }
27891
28236
  getColumnByIndex(cache, index) {
27892
28237
  for (let i = 0, inputIndex = 0; i < cache.lines.length; i++) {
@@ -27921,6 +28266,49 @@ class RichTextEditPlugin {
27921
28266
  }
27922
28267
  return null;
27923
28268
  }
28269
+ forceFocus(params) {
28270
+ const { target, e, cursorIndex } = params;
28271
+ if (!target) {
28272
+ return;
28273
+ }
28274
+ this.currRt = target;
28275
+ if (e) {
28276
+ this._forceFocusByEvent(e);
28277
+ }
28278
+ else {
28279
+ this._forceFocusByCursorIndex(cursorIndex !== null && cursorIndex !== void 0 ? cursorIndex : -0.1);
28280
+ }
28281
+ }
28282
+ _forceFocusByEvent(e) {
28283
+ this.handleEnter();
28284
+ this.handlePointerDown(e);
28285
+ this.handlePointerUp(e);
28286
+ }
28287
+ _forceFocusByCursorIndex(cursorIndex) {
28288
+ const richtext = this.currRt;
28289
+ if (!richtext) {
28290
+ return;
28291
+ }
28292
+ let x = 0;
28293
+ let y1 = 0;
28294
+ let y2 = 2;
28295
+ let lineInfo = null;
28296
+ let columnInfo = null;
28297
+ const data = this.computedCursorPosByCursorIdx(cursorIndex, richtext);
28298
+ x = data.x;
28299
+ y1 = data.y1;
28300
+ y2 = data.y2;
28301
+ lineInfo = data.lineInfo;
28302
+ columnInfo = data.columnInfo;
28303
+ this.onFocus({ target: this.currRt }, {
28304
+ x,
28305
+ y1,
28306
+ y2,
28307
+ cursorIndex,
28308
+ lineInfo,
28309
+ columnInfo
28310
+ });
28311
+ }
27924
28312
  }
27925
28313
 
27926
28314
  class DefaultGraphicAllocate {
@@ -29696,4 +30084,4 @@ function generatorPathEasingFunc(path) {
29696
30084
  };
29697
30085
  }
29698
30086
 
29699
- export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Easing, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickServiceInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, generatorPathEasingFunc, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
30087
+ export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Easing, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, MeasureModeEnum, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickServiceInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, generatorPathEasingFunc, getAttributeFromDefaultAttrList, getConicGradientAt, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlyphGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };