(e: MouseEvent)
| 236 | return false; |
| 237 | }; |
| 238 | const handleMouseDown = (e: MouseEvent) => { |
| 239 | const timeDiff = Date.now() - windowFocusTime; |
| 240 | if (windowFocusTime != null && timeDiff < 50) { |
| 241 | e.preventDefault(); |
| 242 | e.stopPropagation(); |
| 243 | e.stopImmediatePropagation(); |
| 244 | cancelNextClick = true; |
| 245 | const blockId = getBlockIdFromTarget(e.target); |
| 246 | if (blockId != null) { |
| 247 | setTimeout(() => { |
| 248 | console.log("macos first-click, focusing block", blockId); |
| 249 | refocusNode(blockId); |
| 250 | }, 10); |
| 251 | } else if (isAIPanelTarget(e.target)) { |
| 252 | setTimeout(() => { |
| 253 | console.log("macos first-click, focusing AI panel"); |
| 254 | FocusManager.getInstance().setWaveAIFocused(true); |
| 255 | }, 10); |
| 256 | } |
| 257 | console.log("macos first-click detected, canceled", timeDiff + "ms"); |
| 258 | return; |
| 259 | } |
| 260 | cancelNextClick = false; |
| 261 | }; |
| 262 | const handleClick = (e: MouseEvent) => { |
| 263 | if (!cancelNextClick) { |
| 264 | return; |
nothing calls this directly
no test coverage detected