refactor: replace canvas.show with canvas.present

This commit is contained in:
Peter Steinberger
2025-12-19 03:35:33 +01:00
parent 74cdc1cf3e
commit beefda7f60
19 changed files with 96 additions and 45 deletions

View File

@@ -8,6 +8,30 @@ public struct ClawdisCanvasNavigateParams: Codable, Sendable, Equatable {
}
}
public struct ClawdisCanvasPlacement: Codable, Sendable, Equatable {
public var x: Double?
public var y: Double?
public var width: Double?
public var height: Double?
public init(x: Double? = nil, y: Double? = nil, width: Double? = nil, height: Double? = nil) {
self.x = x
self.y = y
self.width = width
self.height = height
}
}
public struct ClawdisCanvasPresentParams: Codable, Sendable, Equatable {
public var url: String?
public var placement: ClawdisCanvasPlacement?
public init(url: String? = nil, placement: ClawdisCanvasPlacement? = nil) {
self.url = url
self.placement = placement
}
}
public struct ClawdisCanvasEvalParams: Codable, Sendable, Equatable {
public var javaScript: String

View File

@@ -1,7 +1,7 @@
import Foundation
public enum ClawdisCanvasCommand: String, Codable, Sendable {
case show = "canvas.show"
case present = "canvas.present"
case hide = "canvas.hide"
case navigate = "canvas.navigate"
case evalJS = "canvas.eval"