@cyber-harbour/ui 1.0.38 → 1.0.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyber-harbour/ui",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -50,6 +50,7 @@ const ButtonTextContainer = styled.div`
50
50
  text-overflow: ellipsis;
51
51
  overflow: hidden;
52
52
  white-space: nowrap;
53
+ user-select: text;
53
54
  `;
54
55
 
55
56
  const StyledIconWrapper = styled.span`
@@ -94,6 +95,7 @@ const StyledButton = styled(createComponent('button'))<{
94
95
  text-decoration: none;
95
96
  transition: all 0.2s ease;
96
97
  outline: none;
98
+ user-select: text;
97
99
 
98
100
  ${$iconPosition === 'right' ? 'flex-direction: row-reverse;' : ''}
99
101
 
@@ -126,32 +126,29 @@ export const Graph2D = ({
126
126
  setHighlightLinks(newHighlightLinks);
127
127
  };
128
128
 
129
- const handleEngineTick = useCallback(() => {
130
- if (isRendering)
131
- if (
132
- graphData &&
133
- fgRef.current &&
134
- fgRef.current.tick &&
135
- graphData.nodes.length > 0 &&
136
- graphData.nodes.length <= fgRef.current.tick
137
- ) {
138
- if (tickTimerRef.current) {
139
- clearTimeout(tickTimerRef.current);
140
- }
141
- fgRef.current.zoomToFit(0, 20);
142
- setIsRendering(false);
143
- } else {
144
- fgRef.current.tick = fgRef.current.tick ? (fgRef.current.tick = fgRef.current.tick + 1) : 1;
145
- if (tickTimerRef.current) {
146
- clearTimeout(tickTimerRef.current);
147
- }
148
- tickTimerRef.current = setTimeout(() => {
149
- //force tick check
129
+ const handleEngineTick = () => {
130
+ if (isRendering) {
131
+ if (fgRef.current && graphData) {
132
+ if (fgRef.current.tick && graphData.nodes.length > 0 && graphData.nodes.length <= fgRef.current.tick) {
133
+ if (tickTimerRef.current) {
134
+ clearTimeout(tickTimerRef.current);
135
+ }
150
136
  fgRef.current.zoomToFit(0, 20);
151
137
  setIsRendering(false);
152
- }, 1500);
138
+ } else {
139
+ fgRef.current.tick = fgRef.current.tick ? (fgRef.current.tick = fgRef.current.tick + 1) : 1;
140
+ if (tickTimerRef.current) {
141
+ clearTimeout(tickTimerRef.current);
142
+ }
143
+ tickTimerRef.current = setTimeout(() => {
144
+ //force tick check
145
+ fgRef.current.zoomToFit(0, 20);
146
+ setIsRendering(false);
147
+ }, 1500);
148
+ }
153
149
  }
154
- }, [graphData]);
150
+ }
151
+ };
155
152
 
156
153
  // Створення взаємозв'язків між вузлами
157
154
  useEffect(() => {