@capillarytech/blaze-ui 5.2.4 → 5.2.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.
@@ -1,5 +1,4 @@
1
1
  import { ToolsView } from '@antv/x6';
2
- import { Root } from 'react-dom/client';
3
2
  /**
4
3
  * Custom tooltip tool for x6 graph edges
5
4
  * Extends ToolsView.ToolItem to provide tooltip functionality on edge hover
@@ -8,16 +7,10 @@ import { Root } from 'react-dom/client';
8
7
  * definitions may not fully expose all ToolItem properties.
9
8
  */
10
9
  declare class TooltipTool extends ToolsView.ToolItem {
11
- /** DOM element for tooltip rendering */
12
- knob: HTMLElement;
13
- /** Delay in milliseconds before showing/hiding tooltip */
14
10
  delay: number;
15
- /** Current tooltip visibility state */
16
- tooltipVisible: boolean;
17
- /** Timer reference for delayed tooltip operations */
11
+ knob: HTMLElement;
12
+ tooltipVisible?: boolean;
18
13
  timer?: number;
19
- /** React root instance for rendering tooltip */
20
- root?: Root;
21
14
  constructor(props: Record<string, unknown>);
22
15
  render(): this;
23
16
  toggleTooltip(visible: boolean): void;
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../components/CapLevelGraphRenderer/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAc,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAMpD;;;;;;GAMG;AACH,cAAM,WAAY,SAAQ,SAAS,CAAC,QAAQ;IAC1C,wCAAwC;IACxC,IAAI,EAAG,WAAW,CAAC;IAEnB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IAEd,uCAAuC;IACvC,cAAc,EAAE,OAAO,CAAC;IAExB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gDAAgD;IAChD,IAAI,CAAC,EAAE,IAAI,CAAC;gBAEA,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAM1C,MAAM,IAAI,IAAI;IAWd,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAkBrC,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAepC,YAAY,IAAI,IAAI;IAWpB,WAAW,GAAI,GAAG,UAAU,KAAG,IAAI,CAWjC;IAEF,cAAc,IAAI,IAAI;IAMtB,QAAQ,IAAI,IAAI;CAWjB;AAcD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../components/CapLevelGraphRenderer/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQrC;;;;;;GAMG;AACH,cAAM,WAAY,SAAQ,SAAS,CAAC,QAAQ;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAG,WAAW,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;gBAEH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAK1C,MAAM,IAAI,IAAI;IAWd,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAarC,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAepC,YAAY,IAAI,IAAI;IASpB,WAAW,GAAI,GAAG,UAAU,KAAG,IAAI,CAWjC;IAEF,cAAc,IAAI,IAAI;IAMtB,QAAQ,IAAI,IAAI;CAKjB;AAOD,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapLevelGraphRenderer/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,OAAO,KAAK,EACV,0BAA0B,EAK3B,MAAM,SAAS,CAAC;AAYjB,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA0b/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/CapLevelGraphRenderer/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,OAAO,KAAK,EACV,0BAA0B,EAK3B,MAAM,SAAS,CAAC;AAajB,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA2b/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -4982,16 +4982,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
4982
4982
  * definitions may not fully expose all ToolItem properties.
4983
4983
  */
4984
4984
  class TooltipTool extends _x.ToolsView.ToolItem {
4985
- /** DOM element for tooltip rendering */
4986
-
4987
- /** Delay in milliseconds before showing/hiding tooltip */
4988
-
4989
- /** Current tooltip visibility state */
4990
-
4991
- /** Timer reference for delayed tooltip operations */
4992
-
4993
- /** React root instance for rendering tooltip */
4994
-
4995
4985
  constructor(props) {
4996
4986
  super(props);
4997
4987
  this.onMouseMove = e => {
@@ -5007,7 +4997,6 @@ class TooltipTool extends _x.ToolsView.ToolItem {
5007
4997
  }, this.delay);
5008
4998
  };
5009
4999
  this.delay = 100;
5010
- this.tooltipVisible = false;
5011
5000
  }
5012
5001
  render() {
5013
5002
  super.render();
@@ -5020,18 +5009,14 @@ class TooltipTool extends _x.ToolsView.ToolItem {
5020
5009
  return this;
5021
5010
  }
5022
5011
  toggleTooltip(visible) {
5023
- if (!this.root) {
5024
- this.root = (0, _client.createRoot)(this.knob);
5025
- }
5012
+ const root = (0, _client.createRoot)(this.knob);
5026
5013
  if (visible) {
5027
5014
  const tooltipText = this.options.tooltip;
5028
- this.root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
5015
+ root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
5029
5016
  title: tooltipText,
5030
- open: true,
5017
+ visible: true,
5031
5018
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {})
5032
5019
  }));
5033
- } else {
5034
- this.root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {}));
5035
5020
  }
5036
5021
  this.tooltipVisible = visible;
5037
5022
  }
@@ -5056,9 +5041,7 @@ class TooltipTool extends _x.ToolsView.ToolItem {
5056
5041
  if (this.timer) {
5057
5042
  window.clearTimeout(this.timer);
5058
5043
  }
5059
- this.timer = window.setTimeout(() => {
5060
- this.toggleTooltip(false);
5061
- }, this.delay);
5044
+ window.setTimeout(() => this.toggleTooltip(false), this.delay);
5062
5045
  document.removeEventListener('mousemove', this.onMouseMove);
5063
5046
  }
5064
5047
  delegateEvents() {
@@ -5068,21 +5051,10 @@ class TooltipTool extends _x.ToolsView.ToolItem {
5068
5051
  }
5069
5052
  onRemove() {
5070
5053
  const cellView = this.cellView;
5071
- cellView.off('cell:mouseleave', this.onMouseLeave);
5072
- if (this.timer) {
5073
- window.clearTimeout(this.timer);
5074
- }
5075
- if (this.root) {
5076
- this.root.unmount();
5077
- }
5078
- document.removeEventListener('mousemove', this.onMouseMove);
5054
+ // @ts-expect-error - x6's off method signature may vary
5055
+ cellView.off('cell:mouseleave', this.onMouseLeave, this);
5079
5056
  }
5080
5057
  }
5081
-
5082
- /**
5083
- * Type for TooltipTool config method
5084
- */
5085
-
5086
5058
  TooltipTool.config({
5087
5059
  tagName: 'div',
5088
5060
  isSVGElement: false
@@ -18351,7 +18323,8 @@ const CapLevelGraphRenderer = _ref => {
18351
18323
  const targetToolTip = (0, _get.default)(nodePostionObj, [targetId, 'toolTip']);
18352
18324
  if (sourceToolTip && targetToolTip) {
18353
18325
  // Type assertion needed because @antv/x6 Edge type may not expose addTools in TypeScript definitions
18354
- edge.addTools == null || edge.addTools([{
18326
+ const edgeWithTools = edge;
18327
+ edgeWithTools.addTools == null || edgeWithTools.addTools([{
18355
18328
  name: 'tooltip',
18356
18329
  args: {
18357
18330
  tooltip: sourceToolTip + " - " + targetToolTip