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

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 (72) hide show
  1. package/cjs/core/global.d.ts +0 -3
  2. package/cjs/core/global.js +1 -7
  3. package/cjs/core/global.js.map +1 -1
  4. package/cjs/graphic/config.js +1 -0
  5. package/cjs/graphic/config.js.map +1 -1
  6. package/cjs/graphic/graphic.d.ts +1 -1
  7. package/cjs/graphic/graphic.js +5 -5
  8. package/cjs/graphic/graphic.js.map +1 -1
  9. package/cjs/graphic/richtext/line.js +3 -1
  10. package/cjs/graphic/richtext/line.js.map +1 -1
  11. package/cjs/graphic/richtext/paragraph.d.ts +2 -1
  12. package/cjs/graphic/richtext/paragraph.js +61 -10
  13. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  14. package/cjs/graphic/richtext.js +4 -1
  15. package/cjs/graphic/richtext.js.map +1 -1
  16. package/cjs/interface/global.d.ts +0 -1
  17. package/cjs/interface/global.js.map +1 -1
  18. package/cjs/interface/graphic/richText.d.ts +10 -0
  19. package/cjs/interface/graphic/richText.js.map +1 -1
  20. package/cjs/interface/graphic.d.ts +1 -1
  21. package/cjs/interface/graphic.js.map +1 -1
  22. package/cjs/plugins/builtin-plugin/edit-module.d.ts +2 -1
  23. package/cjs/plugins/builtin-plugin/edit-module.js +18 -13
  24. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  25. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +30 -6
  26. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +248 -74
  27. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  28. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  29. package/cjs/render/contributions/render/contributions/image-contribution-render.js +2 -2
  30. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  31. package/cjs/render/contributions/render/draw-contribution.js +2 -1
  32. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  33. package/cjs/render/contributions/render/image-render.js.map +1 -1
  34. package/cjs/resource-loader/loader.js +1 -1
  35. package/cjs/resource-loader/loader.js.map +1 -1
  36. package/dist/index.es.js +439 -91
  37. package/es/core/global.d.ts +0 -3
  38. package/es/core/global.js +1 -8
  39. package/es/core/global.js.map +1 -1
  40. package/es/graphic/config.js +1 -0
  41. package/es/graphic/config.js.map +1 -1
  42. package/es/graphic/graphic.d.ts +1 -1
  43. package/es/graphic/graphic.js +5 -5
  44. package/es/graphic/graphic.js.map +1 -1
  45. package/es/graphic/richtext/line.js +3 -1
  46. package/es/graphic/richtext/line.js.map +1 -1
  47. package/es/graphic/richtext/paragraph.d.ts +2 -1
  48. package/es/graphic/richtext/paragraph.js +61 -10
  49. package/es/graphic/richtext/paragraph.js.map +1 -1
  50. package/es/graphic/richtext.js +4 -1
  51. package/es/graphic/richtext.js.map +1 -1
  52. package/es/interface/global.d.ts +0 -1
  53. package/es/interface/global.js.map +1 -1
  54. package/es/interface/graphic/richText.d.ts +10 -0
  55. package/es/interface/graphic/richText.js.map +1 -1
  56. package/es/interface/graphic.d.ts +1 -1
  57. package/es/interface/graphic.js.map +1 -1
  58. package/es/plugins/builtin-plugin/edit-module.d.ts +2 -1
  59. package/es/plugins/builtin-plugin/edit-module.js +15 -11
  60. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  61. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +30 -6
  62. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +248 -73
  63. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  64. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  65. package/es/render/contributions/render/contributions/image-contribution-render.js +2 -2
  66. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  67. package/es/render/contributions/render/draw-contribution.js +1 -1
  68. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  69. package/es/render/contributions/render/image-render.js.map +1 -1
  70. package/es/resource-loader/loader.js +1 -1
  71. package/es/resource-loader/loader.js.map +1 -1
  72. package/package.json +1 -1
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
 
@@ -11737,10 +11730,10 @@ class ResourceLoader {
11737
11730
  static GetFile(url, type) {
11738
11731
  let data = ResourceLoader.cache.get(url);
11739
11732
  if (data) {
11740
- if (data.loadState === 'fail') {
11733
+ if (data.loadState === 'init' || data.loadState === 'fail') {
11741
11734
  return Promise.reject();
11742
11735
  }
11743
- else if (data.loadState === 'init' || data.loadState === 'loading') {
11736
+ else if (data.loadState === 'loading') {
11744
11737
  return data.dataPromise.then(data => data.data);
11745
11738
  }
11746
11739
  return Promise.resolve(data.data);
@@ -11909,7 +11902,7 @@ class Graphic extends Node {
11909
11902
  }
11910
11903
  }
11911
11904
  get AABBBounds() {
11912
- return this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
11905
+ return this.tryUpdateAABBBounds();
11913
11906
  }
11914
11907
  get OBBBounds() {
11915
11908
  return this.tryUpdateOBBBounds();
@@ -11964,7 +11957,8 @@ class Graphic extends Node {
11964
11957
  onAnimateBind(animate) {
11965
11958
  this._emitCustomEvent('animate-bind', animate);
11966
11959
  }
11967
- tryUpdateAABBBounds(full) {
11960
+ tryUpdateAABBBounds() {
11961
+ const full = this.attribute.boundsMode === 'imprecise';
11968
11962
  if (!this.shouldUpdateAABBBounds()) {
11969
11963
  return this._AABBBounds;
11970
11964
  }
@@ -11975,6 +11969,9 @@ class Graphic extends Node {
11975
11969
  application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);
11976
11970
  const bounds = this.doUpdateAABBBounds(full);
11977
11971
  application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);
11972
+ if (this.attribute.boundsMode === 'empty') {
11973
+ bounds.clear();
11974
+ }
11978
11975
  return bounds;
11979
11976
  }
11980
11977
  tryUpdateOBBBounds() {
@@ -12402,11 +12399,11 @@ class Graphic extends Node {
12402
12399
  }
12403
12400
  update(d) {
12404
12401
  if (d) {
12405
- d.bounds && this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
12402
+ d.bounds && this.tryUpdateAABBBounds();
12406
12403
  d.trans && this.tryUpdateLocalTransMatrix();
12407
12404
  }
12408
12405
  else {
12409
- this.tryUpdateAABBBounds(this.attribute.boundsMode === 'imprecise');
12406
+ this.tryUpdateAABBBounds();
12410
12407
  this.tryUpdateLocalTransMatrix();
12411
12408
  }
12412
12409
  }
@@ -17839,6 +17836,22 @@ class Frame {
17839
17836
  }
17840
17837
  }
17841
17838
 
17839
+ function getFixedLRTB(left, right, top, bottom) {
17840
+ const leftInt = Math.round(left);
17841
+ const topInt = Math.round(top);
17842
+ const rightInt = Math.round(right);
17843
+ const bottomInt = Math.round(bottom);
17844
+ const _left = left > leftInt ? leftInt : leftInt - 0.5;
17845
+ const _top = top > topInt ? topInt : topInt - 0.5;
17846
+ const _right = rightInt > right ? rightInt : rightInt + 0.5;
17847
+ const _bottom = bottomInt > bottom ? bottomInt : bottomInt + 0.5;
17848
+ return {
17849
+ left: _left,
17850
+ top: _top,
17851
+ right: _right,
17852
+ bottom: _bottom
17853
+ };
17854
+ }
17842
17855
  class Paragraph {
17843
17856
  constructor(text, newLine, character) {
17844
17857
  this.fontSize = character.fontSize || 16;
@@ -17905,7 +17918,10 @@ class Paragraph {
17905
17918
  this.height = this.widthOrigin;
17906
17919
  }
17907
17920
  }
17908
- draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign) {
17921
+ drawBackground(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
17922
+ if (!(this.character.background && (!this.character.backgroundOpacity || this.character.backgroundOpacity > 0))) {
17923
+ return;
17924
+ }
17909
17925
  let baseline = top + ascent;
17910
17926
  let text = this.text;
17911
17927
  let left = this.left + deltaLeft;
@@ -17953,19 +17969,67 @@ class Paragraph {
17953
17969
  left = 0;
17954
17970
  baseline = 0;
17955
17971
  }
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;
17972
+ const fillStyle = ctx.fillStyle;
17973
+ const globalAlpha = ctx.globalAlpha;
17974
+ ctx.fillStyle = this.character.background;
17975
+ if (this.character.backgroundOpacity !== void 0) {
17976
+ ctx.globalAlpha = this.character.backgroundOpacity;
17977
+ }
17978
+ const right = left + (this.widthOrigin || this.width);
17979
+ const bottom = top + lineHeight;
17980
+ const lrtb = getFixedLRTB(left, right, top, bottom);
17981
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17982
+ ctx.fillStyle = fillStyle;
17983
+ ctx.globalAlpha = globalAlpha;
17984
+ }
17985
+ draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
17986
+ let baseline = top + ascent;
17987
+ let text = this.text;
17988
+ let left = this.left + deltaLeft;
17989
+ baseline += this.top;
17990
+ let direction = this.direction;
17991
+ if (this.verticalEllipsis) {
17992
+ text = this.ellipsisStr;
17993
+ direction = 'vertical';
17994
+ baseline -= this.ellipsisWidth / 2;
17995
+ }
17996
+ else if (this.ellipsis === 'hide') {
17997
+ return;
17998
+ }
17999
+ else if (this.ellipsis === 'add') {
18000
+ text += this.ellipsisStr;
18001
+ if (textAlign === 'right' || textAlign === 'end') {
18002
+ left -= this.ellipsisWidth;
18003
+ }
18004
+ }
18005
+ else if (this.ellipsis === 'replace') {
18006
+ const index = getStrByWithCanvas(text, (direction === 'vertical' ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
18007
+ text = text.slice(0, index);
18008
+ text += this.ellipsisStr;
18009
+ if (textAlign === 'right' || textAlign === 'end') {
18010
+ const { width } = measureTextCanvas(this.text.slice(index), this.character);
18011
+ if (direction === 'vertical') ;
18012
+ else {
18013
+ left -= this.ellipsisWidth - width;
17963
18014
  }
17964
- ctx.fillRect(left, top, this.widthOrigin || this.width, this.lineHeight);
17965
- ctx.fillStyle = fillStyle;
17966
- ctx.globalAlpha = globalAlpha;
17967
18015
  }
17968
18016
  }
18017
+ switch (this.character.script) {
18018
+ case 'super':
18019
+ baseline -= this.ascent * (1 / 3);
18020
+ break;
18021
+ case 'sub':
18022
+ baseline += this.descent / 2;
18023
+ break;
18024
+ }
18025
+ if (direction === 'vertical') {
18026
+ ctx.save();
18027
+ ctx.rotateAbout(Math.PI / 2, left, baseline);
18028
+ ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2);
18029
+ ctx.translate(left, baseline);
18030
+ left = 0;
18031
+ baseline = 0;
18032
+ }
17969
18033
  const { lineWidth = 1 } = this.character;
17970
18034
  if (this.character.stroke && lineWidth) {
17971
18035
  ctx.strokeText(text, left, baseline);
@@ -17974,19 +18038,35 @@ class Paragraph {
17974
18038
  ctx.fillText(text, left, baseline);
17975
18039
  }
17976
18040
  if (this.character.fill) {
17977
- if (typeof this.character.lineThrough === 'boolean' || typeof this.character.underline === 'boolean') {
18041
+ if (this.character.lineThrough || this.character.underline) {
17978
18042
  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);
18043
+ const top = 1 + baseline;
18044
+ const right = left + (this.widthOrigin || this.width);
18045
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18046
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18047
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17980
18048
  }
17981
18049
  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);
18050
+ const top = 1 + baseline - this.ascent / 2;
18051
+ const right = left + (this.widthOrigin || this.width);
18052
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18053
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18054
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17983
18055
  }
17984
18056
  }
17985
18057
  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);
18058
+ const top = 1 + baseline;
18059
+ const right = left + (this.widthOrigin || this.width);
18060
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18061
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18062
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17987
18063
  }
17988
18064
  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);
18065
+ const top = 1 + baseline - this.ascent / 2;
18066
+ const right = left + (this.widthOrigin || this.width);
18067
+ const bottom = top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
18068
+ const lrtb = getFixedLRTB(left, right, top, bottom);
18069
+ ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top);
17990
18070
  }
17991
18071
  }
17992
18072
  if (direction === 'vertical') {
@@ -18325,6 +18405,12 @@ class Line {
18325
18405
  }
18326
18406
  }
18327
18407
  }
18408
+ this.paragraphs.forEach((paragraph, index) => {
18409
+ if (paragraph instanceof RichTextIcon) {
18410
+ return;
18411
+ }
18412
+ paragraph.drawBackground(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
18413
+ });
18328
18414
  this.paragraphs.forEach((paragraph, index) => {
18329
18415
  if (paragraph instanceof RichTextIcon) {
18330
18416
  paragraph.setAttributes({
@@ -18342,7 +18428,7 @@ class Line {
18342
18428
  };
18343
18429
  applyStrokeStyle(ctx, paragraph.character);
18344
18430
  applyFillStyle(ctx, paragraph.character, b);
18345
- paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign);
18431
+ paragraph.draw(ctx, y, this.ascent, x, index === 0, this.textAlign, this.height);
18346
18432
  });
18347
18433
  }
18348
18434
  getWidthWithEllips(ellipsis) {
@@ -18692,7 +18778,8 @@ class RichText extends Graphic {
18692
18778
  return tc;
18693
18779
  }
18694
18780
  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;
18781
+ var _a, _b;
18782
+ const { width = richtextTheme.width, height = richtextTheme.height, maxWidth = richtextTheme.maxWidth, maxHeight = richtextTheme.maxHeight, textAlign = richtextTheme.textAlign, textBaseline = richtextTheme.textBaseline, editOptions } = attribute;
18696
18783
  if (width > 0 && height > 0) {
18697
18784
  aabbBounds.set(0, 0, width, height);
18698
18785
  }
@@ -18705,6 +18792,10 @@ class RichText extends Graphic {
18705
18792
  contentWidth = typeof maxWidth === 'number' && contentWidth > maxWidth ? maxWidth : contentWidth || 0;
18706
18793
  aabbBounds.set(0, 0, contentWidth, contentHeight);
18707
18794
  }
18795
+ if (editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !((_a = attribute.textConfig) === null || _a === void 0 ? void 0 : _a.length)) {
18796
+ aabbBounds.y2 = aabbBounds.y1 + ((_b = attribute.fontSize) !== null && _b !== void 0 ? _b : 12);
18797
+ aabbBounds.x2 = aabbBounds.x1 + 2;
18798
+ }
18708
18799
  let deltaY = 0;
18709
18800
  switch (textBaseline) {
18710
18801
  case 'top':
@@ -20726,8 +20817,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
20726
20817
  this.useStyle = true;
20727
20818
  this.order = 0;
20728
20819
  }
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);
20820
+ drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
20821
+ return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
20731
20822
  }
20732
20823
  }
20733
20824
  const defaultImageRenderContribution = new DefaultImageRenderContribution();
@@ -24445,7 +24536,9 @@ let DefaultDrawContribution = class DefaultDrawContribution {
24445
24536
  tempBounds = this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix);
24446
24537
  }
24447
24538
  if (this.useDirtyBounds &&
24448
- !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, tempBounds !== null && tempBounds !== void 0 ? tempBounds : this.dirtyBounds, false))) {
24539
+ !(graphic.isContainer ||
24540
+ graphic.attribute.boundsMode === 'empty' ||
24541
+ isRectIntersect(graphic.AABBBounds, tempBounds !== null && tempBounds !== void 0 ? tempBounds : this.dirtyBounds, false))) {
24449
24542
  if (retrans && graphic.parent) {
24450
24543
  const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;
24451
24544
  this.scrollMatrix && this.scrollMatrix.translate(scrollX, scrollY);
@@ -26935,6 +27028,20 @@ function flatten_simplify(points, tolerance, highestQuality) {
26935
27028
  return points;
26936
27029
  }
26937
27030
 
27031
+ function getDefaultCharacterConfig(attribute) {
27032
+ const { fill = 'black', stroke = false, fontWeight = 'normal', fontFamily = 'Arial' } = attribute;
27033
+ let { fontSize = 12 } = attribute;
27034
+ if (!isFinite(fontSize)) {
27035
+ fontSize = 12;
27036
+ }
27037
+ return {
27038
+ fill,
27039
+ stroke,
27040
+ fontSize,
27041
+ fontWeight,
27042
+ fontFamily
27043
+ };
27044
+ }
26938
27045
  function findConfigIndexByCursorIdx(textConfig, cursorIndex) {
26939
27046
  if (cursorIndex < 0) {
26940
27047
  return 0;
@@ -27016,7 +27123,7 @@ class EditModule {
27016
27123
  this.composingConfigIdx = this.cursorIndex < 0 ? 0 : findConfigIndexByCursorIdx(textConfig, this.cursorIndex);
27017
27124
  if (this.cursorIndex < 0) {
27018
27125
  const config = textConfig[0];
27019
- textConfig.unshift(Object.assign(Object.assign({ fill: 'black' }, config), { text: '' }));
27126
+ textConfig.unshift(Object.assign(Object.assign(Object.assign({}, getDefaultCharacterConfig(this.currRt.attribute)), config), { text: '' }));
27020
27127
  }
27021
27128
  else {
27022
27129
  const configIdx = this.composingConfigIdx;
@@ -27033,14 +27140,13 @@ class EditModule {
27033
27140
  });
27034
27141
  };
27035
27142
  this.handleInput = (ev) => {
27036
- var _a, _b, _c, _d;
27037
27143
  if (!this.currRt) {
27038
27144
  return;
27039
27145
  }
27040
27146
  if (ev.inputType === 'historyUndo') {
27041
27147
  return;
27042
27148
  }
27043
- const _e = this.currRt.attribute, { textConfig = [] } = _e, rest = __rest(_e, ["textConfig"]);
27149
+ const _a = this.currRt.attribute, { textConfig = [] } = _a, rest = __rest(_a, ["textConfig"]);
27044
27150
  if (ev.type === 'Backspace' && !textConfig.length) {
27045
27151
  return;
27046
27152
  }
@@ -27056,12 +27162,7 @@ class EditModule {
27056
27162
  const lastConfigIdx = this.isComposing ? this.composingConfigIdx : Math.max(startIdx - 1, 0);
27057
27163
  let lastConfig = textConfig[lastConfigIdx];
27058
27164
  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
- };
27165
+ lastConfig = getDefaultCharacterConfig(rest);
27065
27166
  }
27066
27167
  let nextConfig = lastConfig;
27067
27168
  if (startIdx !== endIdx) {
@@ -27219,6 +27320,9 @@ class Selection {
27219
27320
  }
27220
27321
  let idx = Math.round(cursorIdx);
27221
27322
  const config = this.rt.attribute.textConfig;
27323
+ if (!config.length) {
27324
+ return null;
27325
+ }
27222
27326
  for (let i = 0; i < config.length; i++) {
27223
27327
  if (config[i].text !== '\n') {
27224
27328
  idx--;
@@ -27247,6 +27351,7 @@ class Selection {
27247
27351
  }
27248
27352
  }
27249
27353
  const FORMAT_TEXT_COMMAND = 'FORMAT_TEXT_COMMAND';
27354
+ const FORMAT_ALL_TEXT_COMMAND = 'FORMAT_ALL_TEXT_COMMAND';
27250
27355
  const FORMAT_ELEMENT_COMMAND = 'FORMAT_ELEMENT_COMMAND';
27251
27356
  class RichTextEditPlugin {
27252
27357
  static tryUpdateRichtext(richtext) {
@@ -27270,7 +27375,33 @@ class RichTextEditPlugin {
27270
27375
  this._uid = Generator.GenAutoIncrementId();
27271
27376
  this.key = this.name + this._uid;
27272
27377
  this.editing = false;
27378
+ this.focusing = false;
27273
27379
  this.pointerDown = false;
27380
+ this.formatTextCommandCb = (payload, p) => {
27381
+ const rt = p.currRt;
27382
+ if (!rt) {
27383
+ return;
27384
+ }
27385
+ const selectionData = p.getSelection();
27386
+ if (!selectionData) {
27387
+ return;
27388
+ }
27389
+ const { selectionStartCursorIdx, curCursorIdx } = selectionData;
27390
+ const minCursorIdx = Math.min(selectionStartCursorIdx, curCursorIdx);
27391
+ const maxCursorIdx = Math.max(selectionStartCursorIdx, curCursorIdx);
27392
+ const minConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, minCursorIdx);
27393
+ const maxConfigIdx = findConfigIndexByCursorIdx(rt.attribute.textConfig, maxCursorIdx);
27394
+ const config = rt.attribute.textConfig.slice(minConfigIdx, maxConfigIdx);
27395
+ this._formatTextCommand(payload, config, rt);
27396
+ };
27397
+ this.formatAllTextCommandCb = (payload, p) => {
27398
+ const rt = p.currRt;
27399
+ if (!rt) {
27400
+ return;
27401
+ }
27402
+ const config = rt.attribute.textConfig;
27403
+ this._formatTextCommand(payload, config, rt);
27404
+ };
27274
27405
  this.handleKeyDown = (e) => {
27275
27406
  if (!(this.currRt && this.editing)) {
27276
27407
  return;
@@ -27286,10 +27417,20 @@ class RichTextEditPlugin {
27286
27417
  }
27287
27418
  };
27288
27419
  this.handleInput = (text, isComposing, cursorIdx, rt) => {
27420
+ if (!this.currRt) {
27421
+ return;
27422
+ }
27423
+ this.tryShowShadowPlaceholder();
27424
+ this.tryShowInputBounds();
27289
27425
  this.hideSelection();
27290
27426
  this.updateCbs.forEach(cb => cb('input', this));
27291
27427
  };
27292
27428
  this.handleChange = (text, isComposing, cursorIdx, rt) => {
27429
+ if (!this.currRt) {
27430
+ return;
27431
+ }
27432
+ this.tryShowShadowPlaceholder();
27433
+ this.tryShowInputBounds();
27293
27434
  this.curCursorIdx = cursorIdx;
27294
27435
  this.selectionStartCursorIdx = cursorIdx;
27295
27436
  const p = this.computedCursorPosByCursorIdx(cursorIdx, rt);
@@ -27298,13 +27439,10 @@ class RichTextEditPlugin {
27298
27439
  this.updateCbs.forEach(cb => cb('change', this));
27299
27440
  };
27300
27441
  this.handleFocusIn = () => {
27442
+ throw new Error('不会走到这里 handleFocusIn');
27301
27443
  };
27302
27444
  this.handleFocusOut = () => {
27303
- this.editing = false;
27304
- this.deFocus();
27305
- this.pointerDown = false;
27306
- this.triggerRender();
27307
- this.updateCbs.forEach(cb => cb('defocus', this));
27445
+ throw new Error('不会走到这里 handleFocusOut');
27308
27446
  };
27309
27447
  this.handleMove = (e) => {
27310
27448
  if (!this.isRichtext(e)) {
@@ -27328,7 +27466,7 @@ class RichTextEditPlugin {
27328
27466
  this.onFocus(e);
27329
27467
  }
27330
27468
  else {
27331
- this.deFocus();
27469
+ this.deFocus(true);
27332
27470
  }
27333
27471
  this.triggerRender();
27334
27472
  this.pointerDown = true;
@@ -27345,27 +27483,14 @@ class RichTextEditPlugin {
27345
27483
  };
27346
27484
  this.commandCbs = new Map();
27347
27485
  this.commandCbs.set(FORMAT_TEXT_COMMAND, [this.formatTextCommandCb]);
27486
+ this.commandCbs.set(FORMAT_ALL_TEXT_COMMAND, [this.formatAllTextCommandCb]);
27348
27487
  this.updateCbs = [];
27349
27488
  this.timeline = new DefaultTimeline();
27350
27489
  this.ticker = new DefaultTicker([this.timeline]);
27351
27490
  this.deltaX = 0;
27352
27491
  this.deltaY = 0;
27353
27492
  }
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);
27493
+ _formatTextCommand(payload, config, rt) {
27369
27494
  if (payload === 'bold') {
27370
27495
  config.forEach((item) => (item.fontWeight = 'bold'));
27371
27496
  }
@@ -27382,6 +27507,12 @@ class RichTextEditPlugin {
27382
27507
  config.forEach((item) => merge(item, payload));
27383
27508
  }
27384
27509
  rt.setAttributes(rt.attribute);
27510
+ const cache = rt.getFrameCache();
27511
+ if (!cache) {
27512
+ return;
27513
+ }
27514
+ this.selectionRangeByCursorIdx(this.selectionStartCursorIdx, this.curCursorIdx, cache);
27515
+ this.tryShowInputBounds();
27385
27516
  }
27386
27517
  dispatchCommand(command, payload) {
27387
27518
  const cbs = this.commandCbs.get(command);
@@ -27392,10 +27523,24 @@ class RichTextEditPlugin {
27392
27523
  const cbs = this.commandCbs.get(command) || [];
27393
27524
  cbs.push(cb);
27394
27525
  }
27526
+ removeCommand(command, cb) {
27527
+ const cbs = this.commandCbs.get(command) || [];
27528
+ const idx = cbs.indexOf(cb);
27529
+ if (idx > -1) {
27530
+ cbs.splice(idx, 1);
27531
+ }
27532
+ }
27395
27533
  registerUpdateListener(cb) {
27396
27534
  const cbs = this.updateCbs || [];
27397
27535
  cbs.push(cb);
27398
27536
  }
27537
+ removeUpdateListener(cb) {
27538
+ const cbs = this.updateCbs || [];
27539
+ const idx = cbs.indexOf(cb);
27540
+ if (idx > -1) {
27541
+ cbs.splice(idx, 1);
27542
+ }
27543
+ }
27399
27544
  activate(context) {
27400
27545
  this.pluginService = context;
27401
27546
  this.editModule = new EditModule();
@@ -27436,8 +27581,11 @@ class RichTextEditPlugin {
27436
27581
  }
27437
27582
  startIdx = Math.min(Math.max(startIdx, -0.1), totalCursorCount + 0.1);
27438
27583
  endIdx = Math.min(Math.max(endIdx, -0.1), totalCursorCount + 0.1);
27439
- this.curCursorIdx = endIdx;
27440
- this.selectionStartCursorIdx = startIdx;
27584
+ this.selectionRangeByCursorIdx(startIdx, endIdx, cache);
27585
+ }
27586
+ selectionRangeByCursorIdx(startCursorIdx, endCursorIdx, cache) {
27587
+ this.curCursorIdx = endCursorIdx;
27588
+ this.selectionStartCursorIdx = startCursorIdx;
27441
27589
  const { x, y1, y2 } = this.computedCursorPosByCursorIdx(this.selectionStartCursorIdx, this.currRt);
27442
27590
  this.startCursorPos = { x, y: (y1 + y2) / 2 };
27443
27591
  const pos = this.computedCursorPosByCursorIdx(this.curCursorIdx, this.currRt);
@@ -27552,6 +27700,79 @@ class RichTextEditPlugin {
27552
27700
  }
27553
27701
  return true;
27554
27702
  }
27703
+ tryShowShadowPlaceholder() {
27704
+ if (!this.currRt) {
27705
+ return;
27706
+ }
27707
+ const shadowRoot = this.currRt.shadowRoot;
27708
+ if (shadowRoot) {
27709
+ const placeholder = shadowRoot.getElementsByType('richtext')[0];
27710
+ placeholder && shadowRoot.removeChild(placeholder);
27711
+ }
27712
+ const { textConfig, editOptions } = this.currRt.attribute;
27713
+ if (textConfig && textConfig.length) {
27714
+ return;
27715
+ }
27716
+ if (!(editOptions && editOptions.placeholder)) {
27717
+ return;
27718
+ }
27719
+ const { placeholder, placeholderColor = 'rgba(0, 0, 0, 0.6)', placeholderFontFamily, placeholderFontSize } = editOptions;
27720
+ const shadow = this.currRt.shadowRoot || this.currRt.attachShadow();
27721
+ this.shadowPlaceHolder = createRichText(Object.assign(Object.assign({}, this.currRt.attribute), { x: 0, y: 0, angle: 0, _debug_bounds: false, textConfig: [
27722
+ { text: placeholder, fill: placeholderColor, fontFamily: placeholderFontFamily, fontSize: placeholderFontSize }
27723
+ ] }));
27724
+ shadow.add(this.shadowPlaceHolder);
27725
+ }
27726
+ tryShowInputBounds() {
27727
+ if (!(this.currRt && this.focusing)) {
27728
+ return;
27729
+ }
27730
+ const { editOptions = {} } = this.currRt.attribute;
27731
+ const { boundsStrokeWhenInput } = editOptions;
27732
+ if (!editOptions || !boundsStrokeWhenInput) {
27733
+ return;
27734
+ }
27735
+ const { attribute } = this.currRt;
27736
+ const b = this.currRt.AABBBounds;
27737
+ let h = b.height();
27738
+ if (!attribute.textConfig.length && this.editLine) {
27739
+ const { points } = this.editLine.attribute;
27740
+ h = points[1].y - points[0].y;
27741
+ }
27742
+ this.shadowBounds = this.shadowBounds || createRect({});
27743
+ this.shadowBounds.setAttributes({
27744
+ x: 0,
27745
+ y: 0,
27746
+ width: b.width(),
27747
+ height: h,
27748
+ fill: false,
27749
+ stroke: boundsStrokeWhenInput,
27750
+ lineWidth: 1,
27751
+ boundsMode: 'empty',
27752
+ zIndex: -1
27753
+ });
27754
+ const shadow = this.currRt.shadowRoot || this.currRt.attachShadow();
27755
+ shadow.add(this.shadowBounds);
27756
+ this.offsetLineBgAndShadowBounds();
27757
+ }
27758
+ trySyncPlaceholderToTextConfig() {
27759
+ if (!this.currRt) {
27760
+ return;
27761
+ }
27762
+ const { textConfig, editOptions } = this.currRt.attribute;
27763
+ if (textConfig && textConfig.length) {
27764
+ return;
27765
+ }
27766
+ if (!(editOptions && editOptions.placeholder)) {
27767
+ return;
27768
+ }
27769
+ const { placeholder } = editOptions;
27770
+ this.currRt.setAttributes({
27771
+ textConfig: [
27772
+ Object.assign({ text: placeholder }, getDefaultCharacterConfig(this.currRt.attribute))
27773
+ ]
27774
+ });
27775
+ }
27555
27776
  deactivate(context) {
27556
27777
  context.stage.off('pointermove', this.handleMove);
27557
27778
  context.stage.off('pointerdown', this.handlePointerDown);
@@ -27560,12 +27781,16 @@ class RichTextEditPlugin {
27560
27781
  context.stage.off('dblclick', this.handleDBLClick);
27561
27782
  application.global.addEventListener('keydown', this.handleKeyDown);
27562
27783
  }
27563
- onFocus(e) {
27564
- this.deFocus();
27565
- this.currRt = e.target;
27784
+ onFocus(e, data) {
27785
+ this.deFocus(false);
27786
+ this.focusing = true;
27566
27787
  const target = e.target;
27788
+ if (!(target && target.type === 'richtext')) {
27789
+ return;
27790
+ }
27791
+ this.currRt = target;
27567
27792
  RichTextEditPlugin.tryUpdateRichtext(target);
27568
- const shadowRoot = target.attachShadow();
27793
+ const shadowRoot = target.shadowRoot || target.attachShadow();
27569
27794
  const cache = target.getFrameCache();
27570
27795
  if (!cache) {
27571
27796
  return;
@@ -27573,16 +27798,16 @@ class RichTextEditPlugin {
27573
27798
  this.computeGlobalDelta(cache);
27574
27799
  shadowRoot.setAttributes({ shadowRootIdx: 1, pickable: false, x: this.deltaX, y: this.deltaY });
27575
27800
  if (!this.editLine) {
27576
- const line = createLine({ x: 0, y: 0, lineWidth: 1, stroke: 'black' });
27801
+ const line = createLine({ x: 0, y: 0, lineWidth: 1, stroke: 'black', boundsMode: 'empty' });
27577
27802
  this.addAnimateToLine(line);
27578
27803
  this.editLine = line;
27579
27804
  this.ticker.start(true);
27580
- const g = createGroup({ x: 0, y: 0, width: 0, height: 0 });
27805
+ const g = createGroup({ x: 0, y: 0, width: 0, height: 0, boundsMode: 'empty' });
27581
27806
  this.editBg = g;
27582
27807
  shadowRoot.add(this.editLine);
27583
27808
  shadowRoot.add(this.editBg);
27584
27809
  }
27585
- const data = this.computedCursorPosByEvent(e, cache);
27810
+ data = data || this.computedCursorPosByEvent(e, cache);
27586
27811
  if (data) {
27587
27812
  const { x, y1, y2, cursorIndex } = data;
27588
27813
  this.startCursorPos = { x, y: (y1 + y2) / 2 };
@@ -27590,22 +27815,84 @@ class RichTextEditPlugin {
27590
27815
  this.selectionStartCursorIdx = cursorIndex;
27591
27816
  this.setCursorAndTextArea(x, y1, y2, target);
27592
27817
  }
27818
+ else {
27819
+ const x = 0;
27820
+ const y1 = 0;
27821
+ const y2 = getRichTextBounds(Object.assign(Object.assign({}, target.attribute), { textConfig: [{ text: 'a' }] })).height();
27822
+ this.startCursorPos = { x, y: (y1 + y2) / 2 };
27823
+ this.curCursorIdx = -0.1;
27824
+ this.selectionStartCursorIdx = -0.1;
27825
+ this.setCursorAndTextArea(x, y1, y2, target);
27826
+ }
27827
+ this.tryShowShadowPlaceholder();
27828
+ this.tryShowInputBounds();
27829
+ this.currRt.addUpdateBoundTag();
27830
+ }
27831
+ offsetLineBgAndShadowBounds() {
27832
+ const rt = this.currRt;
27833
+ const { textBaseline } = rt.attribute;
27834
+ let dy = 0;
27835
+ let attr = rt.attribute;
27836
+ let b;
27837
+ if (textBaseline === 'middle' || textBaseline === 'bottom') {
27838
+ if (!attr.textConfig.length) {
27839
+ attr = Object.assign(Object.assign({}, attr), { textConfig: [{ text: 'a' }] });
27840
+ }
27841
+ b = getRichTextBounds(attr);
27842
+ }
27843
+ if (textBaseline === 'middle') {
27844
+ dy = -b.height() / 2;
27845
+ }
27846
+ else if (textBaseline === 'bottom') {
27847
+ dy = -b.height();
27848
+ }
27849
+ this.editLine && this.editLine.setAttributes({ dy });
27850
+ this.editBg && this.editBg.setAttributes({ dy });
27851
+ if (this.shadowBounds) {
27852
+ this.shadowBounds.setAttributes({ dy });
27853
+ }
27593
27854
  }
27594
- deFocus() {
27855
+ deFocus(trulyDeFocus = false) {
27595
27856
  const target = this.currRt;
27596
27857
  if (!target) {
27597
27858
  return;
27598
27859
  }
27599
- target.detachShadow();
27860
+ if (trulyDeFocus) {
27861
+ this.trySyncPlaceholderToTextConfig();
27862
+ target.detachShadow();
27863
+ }
27864
+ const currRt = this.currRt;
27600
27865
  this.currRt = null;
27601
27866
  if (this.editLine) {
27602
- this.editLine.parent.removeChild(this.editLine);
27867
+ this.editLine.parent && this.editLine.parent.removeChild(this.editLine);
27603
27868
  this.editLine.release();
27604
27869
  this.editLine = null;
27605
- this.editBg.parent.removeChild(this.editBg);
27870
+ this.editBg.parent && this.editBg.parent.removeChild(this.editBg);
27606
27871
  this.editBg.release();
27607
27872
  this.editBg = null;
27608
27873
  }
27874
+ if (trulyDeFocus) {
27875
+ if (this.shadowBounds) {
27876
+ this.shadowBounds.parent && this.shadowBounds.parent.removeChild(this.shadowBounds);
27877
+ this.shadowBounds.release();
27878
+ this.shadowBounds = null;
27879
+ }
27880
+ if (this.shadowPlaceHolder) {
27881
+ this.shadowPlaceHolder.parent && this.shadowPlaceHolder.parent.removeChild(this.shadowPlaceHolder);
27882
+ this.shadowPlaceHolder.release();
27883
+ this.shadowPlaceHolder = null;
27884
+ }
27885
+ }
27886
+ this.focusing = false;
27887
+ const textConfig = currRt.attribute.textConfig;
27888
+ let lastConfig = textConfig[textConfig.length - 1];
27889
+ let cleared = false;
27890
+ while (lastConfig && lastConfig.text === '\n') {
27891
+ textConfig.pop();
27892
+ lastConfig = textConfig[textConfig.length - 1];
27893
+ cleared = true;
27894
+ }
27895
+ cleared && currRt.setAttributes({ textConfig });
27609
27896
  }
27610
27897
  addAnimateToLine(line) {
27611
27898
  line.animates &&
@@ -27613,8 +27900,9 @@ class RichTextEditPlugin {
27613
27900
  animate.stop();
27614
27901
  animate.release();
27615
27902
  });
27616
- const animate = line.animate();
27617
- animate.setTimeline(this.timeline);
27903
+ const animate = line.animate({
27904
+ timeline: this.timeline
27905
+ });
27618
27906
  animate.to({ opacity: 1 }, 10, 'linear').wait(700).to({ opacity: 0 }, 10, 'linear').wait(700).loop(Infinity);
27619
27907
  }
27620
27908
  tryShowSelection(e, dblclick) {
@@ -27725,7 +28013,7 @@ class RichTextEditPlugin {
27725
28013
  y += line.height;
27726
28014
  }
27727
28015
  }
27728
- this.setCursorAndTextArea(currCursorData.x, currCursorData.y1 + 2, currCursorData.y2 - 2, this.currRt);
28016
+ this.setCursorAndTextArea(currCursorData.x, currCursorData.y1, currCursorData.y2, this.currRt);
27729
28017
  this.triggerRender();
27730
28018
  this.updateCbs.forEach(cb => cb('selection', this));
27731
28019
  }
@@ -27823,6 +28111,18 @@ class RichTextEditPlugin {
27823
28111
  e.target.globalTransMatrix.transformPoint(p, p1);
27824
28112
  p1.x -= this.deltaX;
27825
28113
  p1.y -= this.deltaY;
28114
+ const rt = this.currRt;
28115
+ const { textBaseline } = rt.attribute;
28116
+ let dy = 0;
28117
+ if (textBaseline === 'middle') {
28118
+ const b = getRichTextBounds(rt.attribute);
28119
+ dy = b.height() / 2;
28120
+ }
28121
+ else if (textBaseline === 'bottom') {
28122
+ const b = getRichTextBounds(rt.attribute);
28123
+ dy = b.height();
28124
+ }
28125
+ p1.y += dy;
27826
28126
  return p1;
27827
28127
  }
27828
28128
  setCursorAndTextArea(x, y1, y2, rt) {
@@ -27838,6 +28138,7 @@ class RichTextEditPlugin {
27838
28138
  const { left, top } = this.pluginService.stage.window.getBoundingClientRect();
27839
28139
  out.x += left;
27840
28140
  out.y += top;
28141
+ this.offsetLineBgAndShadowBounds();
27841
28142
  this.editModule.moveTo(out.x, out.y, rt, this.curCursorIdx, this.selectionStartCursorIdx);
27842
28143
  }
27843
28144
  computedCursorPosByEvent(e, cache) {
@@ -27850,10 +28151,8 @@ class RichTextEditPlugin {
27850
28151
  if (!columnInfo) {
27851
28152
  return;
27852
28153
  }
27853
- let y1 = lineInfo.top;
27854
- let y2 = lineInfo.top + lineInfo.height;
27855
- y1 += 2;
27856
- y2 -= 2;
28154
+ const y1 = lineInfo.top;
28155
+ const y2 = lineInfo.top + lineInfo.height;
27857
28156
  let cursorIndex = this.getColumnIndex(cache, columnInfo);
27858
28157
  cursorIndex += delta;
27859
28158
  const x = columnInfo.left + (delta > 0 ? columnInfo.width : 0);
@@ -27874,6 +28173,14 @@ class RichTextEditPlugin {
27874
28173
  const column = this.getColumnByIndex(cache, idx);
27875
28174
  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
28175
  if (!column) {
28176
+ if (!cache.lines.length) {
28177
+ const b = getRichTextBounds(Object.assign(Object.assign({}, rt.attribute), { textConfig: [{ text: 'a' }] }));
28178
+ return {
28179
+ x: 0,
28180
+ y1: 0,
28181
+ y2: b.height()
28182
+ };
28183
+ }
27877
28184
  return {
27878
28185
  x: 0,
27879
28186
  y1: 0,
@@ -27881,12 +28188,10 @@ class RichTextEditPlugin {
27881
28188
  };
27882
28189
  }
27883
28190
  const { lineInfo, columnInfo } = column;
27884
- let y1 = lineInfo.top;
27885
- let y2 = lineInfo.top + lineInfo.height;
28191
+ const y1 = lineInfo.top;
28192
+ const y2 = lineInfo.top + lineInfo.height;
27886
28193
  const x = columnInfo.left + (leftRight < 0 ? 0 : columnInfo.width);
27887
- y1 += 2;
27888
- y2 -= 2;
27889
- return { x, y1, y2 };
28194
+ return { x, y1, y2, lineInfo, columnInfo };
27890
28195
  }
27891
28196
  getColumnByIndex(cache, index) {
27892
28197
  for (let i = 0, inputIndex = 0; i < cache.lines.length; i++) {
@@ -27921,6 +28226,49 @@ class RichTextEditPlugin {
27921
28226
  }
27922
28227
  return null;
27923
28228
  }
28229
+ forceFocus(params) {
28230
+ const { target, e, cursorIndex } = params;
28231
+ if (!target) {
28232
+ return;
28233
+ }
28234
+ this.currRt = target;
28235
+ if (e) {
28236
+ this._forceFocusByEvent(e);
28237
+ }
28238
+ else {
28239
+ this._forceFocusByCursorIndex(cursorIndex !== null && cursorIndex !== void 0 ? cursorIndex : -0.1);
28240
+ }
28241
+ }
28242
+ _forceFocusByEvent(e) {
28243
+ this.handleEnter(e);
28244
+ this.handlePointerDown(e);
28245
+ this.handlePointerUp(e);
28246
+ }
28247
+ _forceFocusByCursorIndex(cursorIndex) {
28248
+ const richtext = this.currRt;
28249
+ if (!richtext) {
28250
+ return;
28251
+ }
28252
+ let x = 0;
28253
+ let y1 = 0;
28254
+ let y2 = 2;
28255
+ let lineInfo = null;
28256
+ let columnInfo = null;
28257
+ const data = this.computedCursorPosByCursorIdx(cursorIndex, richtext);
28258
+ x = data.x;
28259
+ y1 = data.y1;
28260
+ y2 = data.y2;
28261
+ lineInfo = data.lineInfo;
28262
+ columnInfo = data.columnInfo;
28263
+ this.onFocus({ target: this.currRt }, {
28264
+ x,
28265
+ y1,
28266
+ y2,
28267
+ cursorIndex,
28268
+ lineInfo,
28269
+ columnInfo
28270
+ });
28271
+ }
27924
28272
  }
27925
28273
 
27926
28274
  class DefaultGraphicAllocate {
@@ -29696,4 +30044,4 @@ function generatorPathEasingFunc(path) {
29696
30044
  };
29697
30045
  }
29698
30046
 
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 };
30047
+ 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 };