canvas-ui icon indicating copy to clipboard operation
canvas-ui copied to clipboard

Injectable bindings and bridge

Open myers opened this issue 2 months ago • 0 comments

Hello! 您好

This builds on my work in https://github.com/alibaba/canvas-ui/pull/31, I suggest you will want to look at the last commit to understand this PR. When that other PR is merged I will update this PR and remove the draft designation.

This commit adds support for injecting custom event bindings into RenderCanvas and introduces BridgeEventBinding for programmatic event injection.

Changes:

  • Add binding parameter to RenderCanvas constructor (defaults to DOMEventBinding)
  • Add binding parameter to createElement factory function
  • Implement BridgeEventBinding for programmatic event injection
  • Add NativeEventBinding.el property for element binding
  • Add comprehensive test suite for BridgeEventBinding (12 tests)

Benefits:

  • Enables WebXR controller event injection
  • Clean interface using property setter pattern

myers avatar Oct 12 '25 22:10 myers