@visactor/vrender 0.15.2 → 0.15.3-alpha.0

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 (121) hide show
  1. package/cjs/canvas/contributions/browser/context.d.ts +1 -0
  2. package/cjs/core/stage.d.ts +2 -5
  3. package/cjs/core/stage.js.map +1 -1
  4. package/cjs/graphic/config.d.ts +2 -1
  5. package/cjs/graphic/config.js +9 -5
  6. package/cjs/graphic/config.js.map +1 -1
  7. package/cjs/graphic/graphic-service/graphic-service.d.ts +2 -0
  8. package/cjs/graphic/graphic-service/graphic-service.js +4 -0
  9. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  10. package/cjs/graphic/graphic.js +1 -1
  11. package/cjs/graphic/graphic.js.map +1 -1
  12. package/cjs/graphic/node-tree.d.ts +1 -1
  13. package/cjs/graphic/node-tree.js +2 -2
  14. package/cjs/graphic/node-tree.js.map +1 -1
  15. package/cjs/graphic/text.d.ts +12 -0
  16. package/cjs/graphic/text.js +31 -5
  17. package/cjs/graphic/text.js.map +1 -1
  18. package/cjs/index.d.ts +1 -1
  19. package/cjs/index.js +1 -1
  20. package/cjs/index.js.map +1 -1
  21. package/cjs/interface/graphic/text.d.ts +3 -0
  22. package/cjs/interface/graphic/text.js.map +1 -1
  23. package/cjs/interface/graphic-service.d.ts +2 -0
  24. package/cjs/interface/graphic-service.js.map +1 -1
  25. package/cjs/interface/graphic.d.ts +4 -1
  26. package/cjs/interface/graphic.js.map +1 -1
  27. package/cjs/interface/picker.d.ts +5 -5
  28. package/cjs/interface/picker.js.map +1 -1
  29. package/cjs/interface/stage.d.ts +2 -7
  30. package/cjs/interface/stage.js.map +1 -1
  31. package/cjs/picker/canvas-picker-service.d.ts +2 -2
  32. package/cjs/picker/canvas-picker-service.js +6 -4
  33. package/cjs/picker/canvas-picker-service.js.map +1 -1
  34. package/cjs/picker/contributions/canvas-picker/rect-picker.js +2 -2
  35. package/cjs/picker/contributions/canvas-picker/rect-picker.js.map +1 -1
  36. package/cjs/picker/global-picker-service.d.ts +1 -1
  37. package/cjs/picker/global-picker-service.js +14 -4
  38. package/cjs/picker/global-picker-service.js.map +1 -1
  39. package/cjs/picker/math-picker-service.d.ts +2 -2
  40. package/cjs/picker/math-picker-service.js +5 -1
  41. package/cjs/picker/math-picker-service.js.map +1 -1
  42. package/cjs/picker/pick-interceptor.d.ts +3 -3
  43. package/cjs/picker/pick-interceptor.js +4 -4
  44. package/cjs/picker/pick-interceptor.js.map +1 -1
  45. package/cjs/picker/picker-service.d.ts +1 -1
  46. package/cjs/picker/picker-service.js +5 -4
  47. package/cjs/picker/picker-service.js.map +1 -1
  48. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  49. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +7 -0
  50. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  51. package/cjs/render/contributions/render/draw-interceptor.d.ts +6 -0
  52. package/cjs/render/contributions/render/draw-interceptor.js +27 -1
  53. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  54. package/cjs/render/contributions/render/module.js +2 -0
  55. package/cjs/render/contributions/render/module.js.map +1 -1
  56. package/cjs/render/contributions/render/text-render.js +9 -2
  57. package/cjs/render/contributions/render/text-render.js.map +1 -1
  58. package/cjs/render/contributions/render/utils.js +1 -1
  59. package/cjs/render/contributions/render/utils.js.map +1 -1
  60. package/dist/index.js +148 -31
  61. package/dist/index.min.js +1 -1
  62. package/es/canvas/contributions/browser/context.d.ts +1 -0
  63. package/es/core/stage.d.ts +2 -5
  64. package/es/core/stage.js.map +1 -1
  65. package/es/graphic/config.d.ts +2 -1
  66. package/es/graphic/config.js +8 -3
  67. package/es/graphic/config.js.map +1 -1
  68. package/es/graphic/graphic-service/graphic-service.d.ts +2 -0
  69. package/es/graphic/graphic-service/graphic-service.js +4 -0
  70. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  71. package/es/graphic/graphic.js +1 -1
  72. package/es/graphic/graphic.js.map +1 -1
  73. package/es/graphic/node-tree.d.ts +1 -1
  74. package/es/graphic/node-tree.js +2 -2
  75. package/es/graphic/node-tree.js.map +1 -1
  76. package/es/graphic/text.d.ts +12 -0
  77. package/es/graphic/text.js +31 -5
  78. package/es/graphic/text.js.map +1 -1
  79. package/es/index.d.ts +1 -1
  80. package/es/index.js +1 -1
  81. package/es/index.js.map +1 -1
  82. package/es/interface/graphic/text.d.ts +3 -0
  83. package/es/interface/graphic/text.js.map +1 -1
  84. package/es/interface/graphic-service.d.ts +2 -0
  85. package/es/interface/graphic-service.js.map +1 -1
  86. package/es/interface/graphic.d.ts +4 -1
  87. package/es/interface/graphic.js.map +1 -1
  88. package/es/interface/picker.d.ts +5 -5
  89. package/es/interface/picker.js.map +1 -1
  90. package/es/interface/stage.d.ts +2 -7
  91. package/es/interface/stage.js.map +1 -1
  92. package/es/picker/canvas-picker-service.d.ts +2 -2
  93. package/es/picker/canvas-picker-service.js +6 -4
  94. package/es/picker/canvas-picker-service.js.map +1 -1
  95. package/es/picker/contributions/canvas-picker/rect-picker.js +2 -2
  96. package/es/picker/contributions/canvas-picker/rect-picker.js.map +1 -1
  97. package/es/picker/global-picker-service.d.ts +1 -1
  98. package/es/picker/global-picker-service.js +14 -4
  99. package/es/picker/global-picker-service.js.map +1 -1
  100. package/es/picker/math-picker-service.d.ts +2 -2
  101. package/es/picker/math-picker-service.js +5 -1
  102. package/es/picker/math-picker-service.js.map +1 -1
  103. package/es/picker/pick-interceptor.d.ts +3 -3
  104. package/es/picker/pick-interceptor.js +4 -4
  105. package/es/picker/pick-interceptor.js.map +1 -1
  106. package/es/picker/picker-service.d.ts +1 -1
  107. package/es/picker/picker-service.js +4 -4
  108. package/es/picker/picker-service.js.map +1 -1
  109. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +1 -0
  110. package/es/plugins/builtin-plugin/html-attribute-plugin.js +7 -0
  111. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  112. package/es/render/contributions/render/draw-interceptor.d.ts +6 -0
  113. package/es/render/contributions/render/draw-interceptor.js +27 -0
  114. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  115. package/es/render/contributions/render/module.js +2 -1
  116. package/es/render/contributions/render/module.js.map +1 -1
  117. package/es/render/contributions/render/text-render.js +9 -2
  118. package/es/render/contributions/render/text-render.js.map +1 -1
  119. package/es/render/contributions/render/utils.js +1 -1
  120. package/es/render/contributions/render/utils.js.map +1 -1
  121. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -9371,7 +9371,8 @@
9371
9371
  scaleIn3d: false,
9372
9372
  direction: 'horizontal',
9373
9373
  wordBreak: 'break-all',
9374
- ignoreBuf: false
9374
+ ignoreBuf: false,
9375
+ verticalMode: 0
9375
9376
  };
9376
9377
  const DefaultStyle = Object.assign(Object.assign(Object.assign({ opacity: 1, background: null, texture: null, textureColor: 'black', textureSize: 10, texturePadding: 2, backgroundMode: 0, blur: 0, cursor: null, html: null }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout);
9377
9378
  const DefaultConnectAttribute = {
@@ -9380,7 +9381,10 @@
9380
9381
  connectedX: NaN,
9381
9382
  connectedY: NaN
9382
9383
  };
9383
- const DefaultAttribute = Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1 }, DefaultStyle), DefaultTransform);
9384
+ const DefaultDebugAttribute = {
9385
+ _debug_bounds: false
9386
+ };
9387
+ const DefaultAttribute = Object.assign(Object.assign(Object.assign({ strokeSeg: null, pickable: true, childrenPickable: true, visible: true, zIndex: 0, layout: null, boundsPadding: 0, pickMode: 'accurate', customPickShape: null, boundsMode: 'accurate', keepDirIn3d: true, shadowRootIdx: 1 }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
9384
9388
  function addAttributeToPrototype(obj, c, keys) {
9385
9389
  keys.forEach(key => {
9386
9390
  c.prototype[key] = obj[key];
@@ -10980,11 +10984,11 @@
10980
10984
  forEach(cb) {
10981
10985
  return this.forEachChildren(cb);
10982
10986
  }
10983
- appendChild(node) {
10987
+ appendChild(node, highPerformance = true) {
10984
10988
  if (this._uid === node._uid) {
10985
10989
  return null;
10986
10990
  }
10987
- if (node.isAncestorsOf(this)) {
10991
+ if (!highPerformance && node.isAncestorsOf(this)) {
10988
10992
  throw new Error('【Node::appendChild】不能将父辈元素append为子元素');
10989
10993
  }
10990
10994
  node.parent && node.parent.removeChild(node);
@@ -18087,6 +18091,7 @@
18087
18091
  }
18088
18092
  release() {
18089
18093
  this.releaseStatus = 'released';
18094
+ application.graphicService.onRelease(this);
18090
18095
  }
18091
18096
  _emitCustomEvent(type, context) {
18092
18097
  var _a, _b;
@@ -21006,7 +21011,7 @@
21006
21011
  context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise);
21007
21012
  }
21008
21013
  else {
21009
- context.moveTo(cx + outerRadius * cos(outerEndAngle), cy + (yore !== null && yore !== void 0 ? yore : 0));
21014
+ context.moveTo(cx + outerRadius * cos(outerEndAngle), cy + outerRadius * sin(outerEndAngle));
21010
21015
  }
21011
21016
  }
21012
21017
  if (!(innerRadius > epsilon) || innerDeltaAngle < 0.001) {
@@ -22089,15 +22094,27 @@
22089
22094
  }
22090
22095
  return this._AABBBounds;
22091
22096
  }
22097
+ getBaselineMapAlign() {
22098
+ return Text.baselineMapAlign;
22099
+ }
22100
+ getAlignMapBaseline() {
22101
+ return Text.alignMapBaseline;
22102
+ }
22092
22103
  updateVerticalSinglelineAABBBounds(text) {
22093
- var _a;
22104
+ var _a, _b, _c;
22094
22105
  const textTheme = getTheme(this).text;
22095
22106
  const textMeasure = application.graphicUtil.textMeasure;
22096
22107
  let width;
22097
22108
  const attribute = this.attribute;
22098
22109
  const { ignoreBuf = textTheme.ignoreBuf } = attribute;
22099
22110
  const buf = ignoreBuf ? 0 : 2;
22100
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineHeight = (_a = attribute.lineHeight) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak } = attribute;
22111
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, fontFamily = textTheme.fontFamily, stroke = textTheme.stroke, lineHeight = (_a = attribute.lineHeight) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode } = attribute;
22112
+ let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
22113
+ if (!verticalMode) {
22114
+ const t = textAlign;
22115
+ textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
22116
+ textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
22117
+ }
22101
22118
  if (!this.shouldUpdateShape() && this.cache) {
22102
22119
  width = this.cache.clipedWidth;
22103
22120
  const dx = textDrawOffsetX(textAlign, width);
@@ -22173,14 +22190,20 @@
22173
22190
  return this._AABBBounds;
22174
22191
  }
22175
22192
  updateVerticalMultilineAABBBounds(text) {
22176
- var _a;
22193
+ var _a, _b, _c;
22177
22194
  const textTheme = getTheme(this).text;
22178
22195
  const textMeasure = application.graphicUtil.textMeasure;
22179
22196
  let width;
22180
22197
  const attribute = this.attribute;
22181
22198
  const { ignoreBuf = textTheme.ignoreBuf } = attribute;
22182
22199
  const buf = ignoreBuf ? 0 : 2;
22183
- const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineHeight = (_a = attribute.lineHeight) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf, lineWidth = textTheme.lineWidth, wordBreak = textTheme.wordBreak } = attribute;
22200
+ const { maxLineWidth = textTheme.maxLineWidth, ellipsis = textTheme.ellipsis, fontFamily = textTheme.fontFamily, fontSize = textTheme.fontSize, fontWeight = textTheme.fontWeight, stroke = textTheme.stroke, lineHeight = (_a = attribute.lineHeight) !== null && _a !== void 0 ? _a : (attribute.fontSize || textTheme.fontSize) + buf, lineWidth = textTheme.lineWidth, verticalMode = textTheme.verticalMode } = attribute;
22201
+ let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;
22202
+ if (!verticalMode) {
22203
+ const t = textAlign;
22204
+ textAlign = (_b = Text.baselineMapAlign[textBaseline]) !== null && _b !== void 0 ? _b : 'left';
22205
+ textBaseline = (_c = Text.alignMapBaseline[t]) !== null && _c !== void 0 ? _c : 'top';
22206
+ }
22184
22207
  width = 0;
22185
22208
  if (!this.shouldUpdateShape() && this.cache) {
22186
22209
  this.cache.verticalList.forEach(item => {
@@ -22272,6 +22295,16 @@
22272
22295
  }
22273
22296
  }
22274
22297
  Text.NOWORK_ANIMATE_ATTR = Object.assign({ ellipsis: 1, wordBreak: 1, direction: 1, textAlign: 1, textBaseline: 1, fontFamily: 1, fontWeight: 1 }, NOWORK_ANIMATE_ATTR);
22298
+ Text.baselineMapAlign = {
22299
+ top: 'left',
22300
+ bottom: 'right',
22301
+ middle: 'center'
22302
+ };
22303
+ Text.alignMapBaseline = {
22304
+ left: 'top',
22305
+ right: 'bottom',
22306
+ center: 'middle'
22307
+ };
22275
22308
 
22276
22309
  const WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp'];
22277
22310
  class WrapText extends Text {
@@ -26206,6 +26239,7 @@
26206
26239
  onAttributeUpdate: new SyncHook(['graphic']),
26207
26240
  onSetStage: new SyncHook(['graphic', 'stage']),
26208
26241
  onRemove: new SyncHook(['graphic']),
26242
+ onRelease: new SyncHook(['graphic']),
26209
26243
  onAddIncremental: new SyncHook(['graphic', 'group', 'stage']),
26210
26244
  onClearIncremental: new SyncHook(['graphic', 'group', 'stage']),
26211
26245
  beforeUpdateAABBBounds: new SyncHook([
@@ -26240,6 +26274,11 @@
26240
26274
  this.hooks.onRemove.call(graphic);
26241
26275
  }
26242
26276
  }
26277
+ onRelease(graphic) {
26278
+ if (this.hooks.onRelease.taps.length) {
26279
+ this.hooks.onRelease.call(graphic);
26280
+ }
26281
+ }
26243
26282
  onAddIncremental(graphic, group, stage) {
26244
26283
  if (this.hooks.onAddIncremental.taps.length) {
26245
26284
  this.hooks.onAddIncremental.call(graphic, group, stage);
@@ -28492,10 +28531,16 @@
28492
28531
  this.numberType = TEXT_NUMBER_TYPE;
28493
28532
  }
28494
28533
  drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
28495
- var _a;
28534
+ var _a, _b, _c;
28496
28535
  const textAttribute = getTheme(text, params === null || params === void 0 ? void 0 : params.theme).text;
28497
- const { text: str, fill = textAttribute.fill, stroke = textAttribute.stroke, fillOpacity = textAttribute.fillOpacity, strokeOpacity = textAttribute.strokeOpacity, opacity = textAttribute.opacity, lineWidth = textAttribute.lineWidth, visible = textAttribute.visible, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, keepDirIn3d = textAttribute.keepDirIn3d, direction = textAttribute.direction, fontSize = textAttribute.fontSize, textBaseline = textAttribute.textBaseline, textAlign = textAttribute.textAlign, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
28498
- const lineHeight = (_a = text.attribute.lineHeight) !== null && _a !== void 0 ? _a : fontSize;
28536
+ const { text: str, fill = textAttribute.fill, stroke = textAttribute.stroke, fillOpacity = textAttribute.fillOpacity, strokeOpacity = textAttribute.strokeOpacity, opacity = textAttribute.opacity, lineWidth = textAttribute.lineWidth, visible = textAttribute.visible, 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;
28537
+ let { textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline } = text.attribute;
28538
+ if (!verticalMode) {
28539
+ const t = textAlign;
28540
+ textAlign = (_a = text.getBaselineMapAlign()[textBaseline]) !== null && _a !== void 0 ? _a : 'left';
28541
+ textBaseline = (_b = text.getAlignMapBaseline()[t]) !== null && _b !== void 0 ? _b : 'top';
28542
+ }
28543
+ const lineHeight = (_c = text.attribute.lineHeight) !== null && _c !== void 0 ? _c : fontSize;
28499
28544
  const fVisible = fillVisible(opacity, fillOpacity, fill);
28500
28545
  const sVisible = strokeVisible(opacity, strokeOpacity);
28501
28546
  const doFill = runFill(fill);
@@ -30186,21 +30231,21 @@
30186
30231
  if (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) {
30187
30232
  return this._pickItem(graphic, pickerService, point, pickParams, params);
30188
30233
  }
30189
- return false;
30234
+ return null;
30190
30235
  }
30191
30236
  beforePickItem(graphic, pickerService, point, pickParams, params) {
30192
30237
  if (graphic.attribute.shadowRootIdx < 0) {
30193
30238
  return this._pickItem(graphic, pickerService, point, pickParams, params);
30194
30239
  }
30195
- return false;
30240
+ return null;
30196
30241
  }
30197
30242
  _pickItem(graphic, pickerService, point, pickParams, params) {
30198
30243
  if (!graphic.shadowRoot) {
30199
- return false;
30244
+ return null;
30200
30245
  }
30201
30246
  const { parentMatrix } = params || {};
30202
30247
  if (!parentMatrix) {
30203
- return false;
30248
+ return null;
30204
30249
  }
30205
30250
  const context = pickerService.pickContext;
30206
30251
  context.highPerformanceSave();
@@ -30384,7 +30429,7 @@
30384
30429
  result = this.pickGroup(graphics[i], point, parentMatrix, params);
30385
30430
  }
30386
30431
  else {
30387
- result.graphic = this.pickItem(graphics[i], point, parentMatrix, params);
30432
+ result = this.pickItem(graphics[i], point, parentMatrix, params);
30388
30433
  }
30389
30434
  if (result.graphic) {
30390
30435
  break;
@@ -30466,12 +30511,13 @@
30466
30511
  return result;
30467
30512
  }
30468
30513
  const pickedItem = this.pickItem(group, newPoint.clone(), parentMatrix, params);
30469
- if (pickedItem) {
30470
- result.graphic = pickedItem;
30514
+ if (pickedItem && pickedItem.graphic) {
30515
+ result.graphic = pickedItem.graphic;
30516
+ result.params = pickedItem.params;
30471
30517
  }
30472
30518
  const groupPicked = group.attribute.pickable !== false && insideGroup;
30473
30519
  currentGroupMatrix.multiply(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);
30474
- if (group.attribute.childrenPickable !== false && !pickedItem) {
30520
+ if (group.attribute.childrenPickable !== false && !(pickedItem && pickedItem.graphic)) {
30475
30521
  foreach(group, DefaultAttribute.zIndex, (graphic) => {
30476
30522
  if (graphic.isContainer) {
30477
30523
  const newPoint = new Point(point.x, point.y);
@@ -30489,7 +30535,10 @@
30489
30535
  newPoint.x -= scrollX;
30490
30536
  newPoint.y -= scrollY;
30491
30537
  const pickedItem = this.pickItem(graphic, newPoint, parentMatrix, params);
30492
- result.graphic = pickedItem;
30538
+ if (pickedItem && pickedItem.graphic) {
30539
+ result.graphic = pickedItem.graphic;
30540
+ result.params = pickedItem.params;
30541
+ }
30493
30542
  }
30494
30543
  return !!result.graphic || !!result.group;
30495
30544
  }, true, !!context.camera);
@@ -30544,7 +30593,11 @@
30544
30593
  result = this.pickGroup(graphics[i], point, parentMatrix, params);
30545
30594
  }
30546
30595
  else {
30547
- result.graphic = this.pickItem(graphics[i], point, parentMatrix, params);
30596
+ const data = this.pickItem(graphics[i], point, parentMatrix, params);
30597
+ if (data) {
30598
+ result.graphic = data.graphic;
30599
+ result.params = data.params;
30600
+ }
30548
30601
  }
30549
30602
  if (result.graphic) {
30550
30603
  break;
@@ -30598,7 +30651,11 @@
30598
30651
  else {
30599
30652
  const newPoint = new Point(point.x, point.y);
30600
30653
  parentMatrix.transformPoint(newPoint, newPoint);
30601
- result.graphic = this.pickItem(graphic, newPoint, parentMatrix, params);
30654
+ const data = this.pickItem(graphic, newPoint, parentMatrix, params);
30655
+ if (data) {
30656
+ result.graphic = data.graphic;
30657
+ result.params = data.params;
30658
+ }
30602
30659
  }
30603
30660
  return !!result.graphic || !!result.group;
30604
30661
  });
@@ -30613,7 +30670,9 @@
30613
30670
  return null;
30614
30671
  }
30615
30672
  if (graphic.AABBBounds.containsPoint(point)) {
30616
- return graphic;
30673
+ return {
30674
+ graphic: graphic
30675
+ };
30617
30676
  }
30618
30677
  return null;
30619
30678
  }
@@ -31898,7 +31957,7 @@
31898
31957
  if (drawContribution.beforePickItem) {
31899
31958
  const ret = drawContribution.beforePickItem(graphic, this, point, params, { parentMatrix });
31900
31959
  if (ret) {
31901
- return ret === true ? graphic : ret.graphic;
31960
+ return ret;
31902
31961
  }
31903
31962
  }
31904
31963
  }
@@ -31907,8 +31966,11 @@
31907
31966
  if (!picker) {
31908
31967
  return null;
31909
31968
  }
31910
- const data = picker.contains(graphic, point, params) ? graphic : null;
31911
- if (data) {
31969
+ const g = picker.contains(graphic, point, params) ? graphic : null;
31970
+ const data = {
31971
+ graphic: g
31972
+ };
31973
+ if (g) {
31912
31974
  return data;
31913
31975
  }
31914
31976
  if (this.InterceptorContributions.length) {
@@ -31917,7 +31979,7 @@
31917
31979
  if (drawContribution.afterPickItem) {
31918
31980
  const ret = drawContribution.afterPickItem(graphic, this, point, params, { parentMatrix });
31919
31981
  if (ret) {
31920
- return ret === true ? graphic : ret.graphic;
31982
+ return ret;
31921
31983
  }
31922
31984
  }
31923
31985
  }
@@ -32235,7 +32297,13 @@
32235
32297
  if (!picker) {
32236
32298
  return null;
32237
32299
  }
32238
- return picker.contains(graphic, point, params) ? graphic : null;
32300
+ const g = picker.contains(graphic, point, params) ? graphic : null;
32301
+ if (g) {
32302
+ return {
32303
+ graphic: g
32304
+ };
32305
+ }
32306
+ return null;
32239
32307
  }
32240
32308
  };
32241
32309
  __decorate([
@@ -35617,6 +35685,40 @@
35617
35685
  ShadowRootDrawItemInterceptorContribution = __decorate([
35618
35686
  injectable()
35619
35687
  ], ShadowRootDrawItemInterceptorContribution);
35688
+ let CommonDrawItemInterceptorContribution = class CommonDrawItemInterceptorContribution {
35689
+ constructor() {
35690
+ this.order = 1;
35691
+ }
35692
+ afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
35693
+ if (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) {
35694
+ this.drawItem(graphic, renderService, drawContext, drawContribution, params);
35695
+ }
35696
+ return false;
35697
+ }
35698
+ beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
35699
+ if (graphic.attribute.shadowRootIdx < 0) {
35700
+ this.drawItem(graphic, renderService, drawContext, drawContribution, params);
35701
+ }
35702
+ return false;
35703
+ }
35704
+ drawItem(graphic, renderService, drawContext, drawContribution, params) {
35705
+ if (!graphic.attribute._debug_bounds) {
35706
+ return false;
35707
+ }
35708
+ const { context } = drawContext;
35709
+ context.highPerformanceSave();
35710
+ const b = graphic.AABBBounds;
35711
+ if (graphic.attribute._debug_bounds !== true) {
35712
+ graphic.attribute._debug_bounds(context, graphic);
35713
+ }
35714
+ context.strokeRect(b.x1, b.y1, b.width(), b.height());
35715
+ context.highPerformanceRestore();
35716
+ return true;
35717
+ }
35718
+ };
35719
+ CommonDrawItemInterceptorContribution = __decorate([
35720
+ injectable()
35721
+ ], CommonDrawItemInterceptorContribution);
35620
35722
  let Canvas3DDrawItemInterceptor = class Canvas3DDrawItemInterceptor {
35621
35723
  constructor() {
35622
35724
  this.order = 1;
@@ -37379,6 +37481,8 @@
37379
37481
  bindContributionProvider(bind, GraphicRender);
37380
37482
  bind(ShadowRootDrawItemInterceptorContribution).toSelf().inSingletonScope();
37381
37483
  bind(DrawItemInterceptor).toService(ShadowRootDrawItemInterceptorContribution);
37484
+ bind(CommonDrawItemInterceptorContribution).toSelf().inSingletonScope();
37485
+ bind(DrawItemInterceptor).toService(CommonDrawItemInterceptorContribution);
37382
37486
  bind(Canvas3DDrawItemInterceptor).toSelf().inSingletonScope();
37383
37487
  bind(DrawItemInterceptor).toService(Canvas3DDrawItemInterceptor);
37384
37488
  bindContributionProvider(bind, DrawItemInterceptor);
@@ -37482,6 +37586,7 @@
37482
37586
  }
37483
37587
  let picked = true;
37484
37588
  if (!onlyTranslate ||
37589
+ rect.shadowRoot ||
37485
37590
  (isNumber$2(cornerRadius, true) && cornerRadius !== 0) ||
37486
37591
  (isArray$1(cornerRadius) && cornerRadius.some(num => num !== 0))) {
37487
37592
  picked = false;
@@ -37501,7 +37606,7 @@
37501
37606
  return picked;
37502
37607
  });
37503
37608
  }
37504
- else if (picked) {
37609
+ else {
37505
37610
  const { fill = rectAttribute.fill, stroke = rectAttribute.stroke, lineWidth = rectAttribute.lineWidth } = rect.attribute;
37506
37611
  if (fill) {
37507
37612
  picked = true;
@@ -39088,6 +39193,9 @@
39088
39193
  }
39089
39194
  this.drawHTML(context.stage.renderService);
39090
39195
  });
39196
+ application.graphicService.hooks.onRelease.tap(this.key, graphic => {
39197
+ this.removeDom(graphic);
39198
+ });
39091
39199
  }
39092
39200
  deactivate(context) {
39093
39201
  context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => {
@@ -39117,6 +39225,14 @@
39117
39225
  }
39118
39226
  });
39119
39227
  }
39228
+ removeDom(graphic) {
39229
+ if (graphic.bindDom && graphic.bindDom.size) {
39230
+ graphic.bindDom.forEach(item => {
39231
+ item.dom && item.dom.parentElement.removeChild(item.dom);
39232
+ });
39233
+ graphic.bindDom.clear();
39234
+ }
39235
+ }
39120
39236
  renderGraphicHTML(graphic) {
39121
39237
  const { html } = graphic.attribute;
39122
39238
  if (!html) {
@@ -40381,7 +40497,7 @@
40381
40497
  }
40382
40498
  const Fragment = Group;
40383
40499
 
40384
- const version = "0.15.2";
40500
+ const version = "0.15.3-alpha.0";
40385
40501
 
40386
40502
  exports.ACustomAnimate = ACustomAnimate;
40387
40503
  exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;
@@ -40427,6 +40543,7 @@
40427
40543
  exports.DefaultAttribute = DefaultAttribute;
40428
40544
  exports.DefaultCircleAttribute = DefaultCircleAttribute;
40429
40545
  exports.DefaultConnectAttribute = DefaultConnectAttribute;
40546
+ exports.DefaultDebugAttribute = DefaultDebugAttribute;
40430
40547
  exports.DefaultFillStyle = DefaultFillStyle;
40431
40548
  exports.DefaultGlyphAttribute = DefaultGlyphAttribute;
40432
40549
  exports.DefaultGroupAttribute = DefaultGroupAttribute;