feat: expose native visual protocols and explicit invalidation
Verify Tessera GUI / verify (push) Failing after 7m23s

This commit is contained in:
2026-10-21 02:42:16 +08:00
parent d2f167e71f
commit dc61f5e33c
13 changed files with 691 additions and 140 deletions
+1
View File
@@ -2,6 +2,7 @@
| File | Purpose |
| --- | --- |
| [visual-protocols.endor](visual-protocols.endor) | Real source calls for constrained native measurement, arrangement and managed paint-command results from live Mounts. |
| [mount-lifecycle.endor](mount-lifecycle.endor) | Source onMount/onUnmount methods, two occurrences of one object, ordered notifications and retained Mount lifetime. |
| [events.endor](events.endor) | Managed event subscriptions, source onEvent override and numbered capture/target/bubble steps from native input. |
| [native-subclasses.endor](native-subclasses.endor) | Real native TextBlock/Button/Page source subclasses, inherited fields, method overrides and shared field bindings. |
+30
View File
@@ -0,0 +1,30 @@
class VisualResults {
width: Number
height: Number
childX: Number
childY: Number
color: String
}
class ProbeRect: RectBlock {
results: VisualResults
function onMount(self: ProbeRect, mount: Mount): Unit {
measured = self.measure(mount, Constraints(0, 0, 120, 80))
self.results.width = measured.width
self.results.height = measured.height
drawing = self.paint(mount, Bounds(12, 18, 200, 60))
self.results.color = drawing.commands.at(0).color
}
}
class ProbeColumn: Column {
results: VisualResults
function onMount(self: ProbeColumn, mount: Mount): Unit {
positions = self.arrange(mount, Bounds(20, 30, 500, 300))
self.results.childX = positions.children.at(0).x
self.results.childY = positions.children.at(0).y
}
}
results = VisualResults(0, 0, 0, 0, "等待挂载")
rect = ProbeRect(200, 60, 12, "#DDEEFF", results)
root = ProbeColumn(24, 16, TextBlock("对象的原生视觉协议", 2), rect, TextBlock("约束测量宽度"), ui.textOf(results, "width"), TextBlock("绘制颜色"), ui.textOf(results, "color"), results)
page = Page()
page.render(root)