I'm working on a feature that allows shadow blocks to be infinitely generated each time they are dragged. I've encountered some limitations while trying to use the Blockly API for this purpose. Previously, I managed to implement a similar functionality by customizing the Connection class in my own fork of Blockly (version 7.20211209.4), but I'm exploring ways to achieve this without directly modifying core Blockly files.
Here's the context of my question:
I'm aiming to replicate a feature I implemented in a previous version of Blockly, where shadow blocks could be infinitely generated upon dragging. This was achieved by forking Blockly and modifying the Connection class, specifically the createShadowBlock_ function. Given the potential issues with forking and modifying Blockly directly, I'm looking for advice or alternative approaches within the Blockly API that could allow me to implement this feature. Could anyone provide insights or suggestions on how to achieve infinite shadow block generation using the current Blockly API or through other recommended practices? Any examples or guidance would be greatly appreciated.
Thank you for your help!

I've been working on customizing Blockly's ConnectionChecker to modify the connection logic for my project. However, I'm stuck and can't seem to find a way forward. Below is the code snippet I've been experimenting with:
import { Connection, ConnectionChecker } from 'blockly';
export default class CustomConnectionChecker extends ConnectionChecker {
canConnectWithReason(
a: Connection | null,
b: Connection | null,
isDragging: boolean,
optDistance?: number,
): number {
if (
a?.getShadowState()
&& !isDragging
) {
console.log('CustomConnectionChecker', a, b, isDragging, optDistance);
}
return super.canConnectWithReason(a, b, isDragging, optDistance);
}
}