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

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 (39) hide show
  1. package/cjs/color-string/store.js +4 -4
  2. package/cjs/color-string/store.js.map +1 -1
  3. package/cjs/core/stage.js +6 -6
  4. package/cjs/core/stage.js.map +1 -1
  5. package/cjs/graphic/config.js +2 -1
  6. package/cjs/graphic/config.js.map +1 -1
  7. package/cjs/graphic/text.d.ts +1 -0
  8. package/cjs/graphic/text.js +7 -4
  9. package/cjs/graphic/text.js.map +1 -1
  10. package/cjs/interface/graphic/text.d.ts +2 -0
  11. package/cjs/interface/graphic/text.js.map +1 -1
  12. package/cjs/interface/plugin.d.ts +1 -0
  13. package/cjs/interface/plugin.js.map +1 -1
  14. package/cjs/plugins/plugin-service.d.ts +1 -0
  15. package/cjs/plugins/plugin-service.js +4 -0
  16. package/cjs/plugins/plugin-service.js.map +1 -1
  17. package/cjs/render/contributions/render/text-render.js +2 -2
  18. package/cjs/render/contributions/render/text-render.js.map +1 -1
  19. package/dist/index.js +30 -18
  20. package/dist/index.min.js +1 -1
  21. package/es/color-string/store.js +1 -3
  22. package/es/color-string/store.js.map +1 -1
  23. package/es/core/stage.js +6 -6
  24. package/es/core/stage.js.map +1 -1
  25. package/es/graphic/config.js +2 -1
  26. package/es/graphic/config.js.map +1 -1
  27. package/es/graphic/text.d.ts +1 -0
  28. package/es/graphic/text.js +7 -4
  29. package/es/graphic/text.js.map +1 -1
  30. package/es/interface/graphic/text.d.ts +2 -0
  31. package/es/interface/graphic/text.js.map +1 -1
  32. package/es/interface/plugin.d.ts +1 -0
  33. package/es/interface/plugin.js.map +1 -1
  34. package/es/plugins/plugin-service.d.ts +1 -0
  35. package/es/plugins/plugin-service.js +4 -0
  36. package/es/plugins/plugin-service.js.map +1 -1
  37. package/es/render/contributions/render/text-render.js +2 -2
  38. package/es/render/contributions/render/text-render.js.map +1 -1
  39. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3158,7 +3158,8 @@
3158
3158
  whiteSpace: 'no-wrap',
3159
3159
  heightLimit: Infinity,
3160
3160
  lineClamp: Infinity,
3161
- suffixPosition: 'end'
3161
+ suffixPosition: 'end',
3162
+ disableAutoClipedPoptip: undefined
3162
3163
  };
3163
3164
  const DefaultPickStyle = {
3164
3165
  pickStrokeBuffer: 0
@@ -9763,10 +9764,9 @@
9763
9764
  return res;
9764
9765
  };
9765
9766
 
9766
- const { Color } = vutils.ColorUtil;
9767
9767
  function colorEqual(color1, color2) {
9768
- const c1 = Color.parseColorString(color1);
9769
- const c2 = Color.parseColorString(color2);
9768
+ const c1 = vutils.Color.parseColorString(color1);
9769
+ const c2 = vutils.Color.parseColorString(color2);
9770
9770
  return c1 && c2 ? c1.r === c2.r && c1.g === c2.g && c1.b === c2.b && c1.opacity === c2.opacity : false;
9771
9771
  }
9772
9772
  exports.ColorType = void 0;
@@ -9785,7 +9785,7 @@
9785
9785
  arr[3] = color[3];
9786
9786
  return arr;
9787
9787
  }
9788
- const c = Color.parseColorString(str);
9788
+ const c = vutils.Color.parseColorString(str);
9789
9789
  if (c) {
9790
9790
  const data = [c.r / 255, c.g / 255, c.b / 255, c.opacity];
9791
9791
  ColorStore.store1[str] = data;
@@ -9805,7 +9805,7 @@
9805
9805
  arr[3] = color[3];
9806
9806
  return arr;
9807
9807
  }
9808
- const c = Color.parseColorString(str);
9808
+ const c = vutils.Color.parseColorString(str);
9809
9809
  if (c) {
9810
9810
  ColorStore.store1[str] = [c.r / 255, c.g / 255, c.b / 255, c.opacity];
9811
9811
  ColorStore.store255[str] = [c.r, c.g, c.b, c.opacity];
@@ -13550,7 +13550,7 @@
13550
13550
  var _a;
13551
13551
  const attribute = this.attribute;
13552
13552
  const textTheme = getTheme(this).text;
13553
- if (Array.isArray(attribute.text)) {
13553
+ if (this.isMultiLine) {
13554
13554
  return undefined;
13555
13555
  }
13556
13556
  const { maxLineWidth = textTheme.maxLineWidth } = attribute;
@@ -13561,7 +13561,7 @@
13561
13561
  return this.cache.clipedText;
13562
13562
  }
13563
13563
  get clipedWidth() {
13564
- if (Array.isArray(this.attribute.text)) {
13564
+ if (this.isMultiLine) {
13565
13565
  return undefined;
13566
13566
  }
13567
13567
  this.tryUpdateAABBBounds();
@@ -13570,7 +13570,7 @@
13570
13570
  get cliped() {
13571
13571
  const textTheme = getTheme(this).text;
13572
13572
  const attribute = this.attribute;
13573
- if (Array.isArray(attribute.text)) {
13573
+ if (this.isMultiLine) {
13574
13574
  return undefined;
13575
13575
  }
13576
13576
  const { maxLineWidth = textTheme.maxLineWidth } = attribute;
@@ -13581,12 +13581,15 @@
13581
13581
  return this.clipedText !== attribute.text.toString();
13582
13582
  }
13583
13583
  get multilineLayout() {
13584
- if (!Array.isArray(this.attribute.text)) {
13584
+ if (!this.isMultiLine) {
13585
13585
  return undefined;
13586
13586
  }
13587
13587
  this.tryUpdateAABBBounds();
13588
13588
  return this.cache.layoutData;
13589
13589
  }
13590
+ get isMultiLine() {
13591
+ return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';
13592
+ }
13590
13593
  constructor(params = { text: '', fontSize: 16 }) {
13591
13594
  super(params);
13592
13595
  this.type = 'text';
@@ -21284,7 +21287,7 @@
21284
21287
  drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
21285
21288
  var _a, _b, _c;
21286
21289
  const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
21287
- const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, keepDirIn3d = textAttribute.keepDirIn3d, direction = textAttribute.direction, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
21290
+ const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, keepDirIn3d = textAttribute.keepDirIn3d, direction = textAttribute.direction, whiteSpace = textAttribute.whiteSpace, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
21288
21291
  let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
21289
21292
  if (!verticalMode && direction === 'vertical') {
21290
21293
  const t = textAlign;
@@ -21338,7 +21341,7 @@
21338
21341
  context.setTransformForCurrent();
21339
21342
  }
21340
21343
  };
21341
- if (Array.isArray(str)) {
21344
+ if (text.isMultiLine) {
21342
21345
  context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
21343
21346
  if (direction === 'horizontal') {
21344
21347
  const { multilineLayout } = text;
@@ -22105,6 +22108,15 @@
22105
22108
  plugin.activate(this);
22106
22109
  }
22107
22110
  }
22111
+ unRegister(plugin) {
22112
+ if (plugin.activeEvent === 'onStartupFinished') {
22113
+ this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1);
22114
+ }
22115
+ else if (plugin.activeEvent === 'onRegister') {
22116
+ this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1);
22117
+ }
22118
+ plugin.deactivate(this);
22119
+ }
22108
22120
  release(...params) {
22109
22121
  this.onStartupFinishedPlugin.forEach(plugin => {
22110
22122
  plugin.deactivate(this);
@@ -24967,7 +24979,7 @@
24967
24979
  }
24968
24980
  this.view3dTranform = false;
24969
24981
  this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {
24970
- plugin.deactivate(this.pluginService);
24982
+ this.pluginService.unRegister(plugin);
24971
24983
  });
24972
24984
  }
24973
24985
  enableAutoRender() {
@@ -24983,7 +24995,7 @@
24983
24995
  }
24984
24996
  this.autoRender = false;
24985
24997
  this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {
24986
- plugin.deactivate(this.pluginService);
24998
+ this.pluginService.unRegister(plugin);
24987
24999
  });
24988
25000
  }
24989
25001
  enableIncrementalAutoRender() {
@@ -24999,7 +25011,7 @@
24999
25011
  }
25000
25012
  this.increaseAutoRender = false;
25001
25013
  this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {
25002
- plugin.deactivate(this.pluginService);
25014
+ this.pluginService.unRegister(plugin);
25003
25015
  });
25004
25016
  }
25005
25017
  enableDirtyBounds() {
@@ -25022,7 +25034,7 @@
25022
25034
  }
25023
25035
  this.dirtyBounds = null;
25024
25036
  this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {
25025
- plugin.deactivate(this.pluginService);
25037
+ this.pluginService.unRegister(plugin);
25026
25038
  });
25027
25039
  }
25028
25040
  enableLayout() {
@@ -25038,7 +25050,7 @@
25038
25050
  }
25039
25051
  this._enableLayout = false;
25040
25052
  this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {
25041
- plugin.deactivate(this.pluginService);
25053
+ this.pluginService.unRegister(plugin);
25042
25054
  });
25043
25055
  }
25044
25056
  enableHtmlAttribute(container) {
@@ -25054,7 +25066,7 @@
25054
25066
  }
25055
25067
  this.htmlAttribute = false;
25056
25068
  this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {
25057
- plugin.deactivate(this.pluginService);
25069
+ this.pluginService.unRegister(plugin);
25058
25070
  });
25059
25071
  }
25060
25072
  tryUpdateAABBBounds() {