diff --git a/Sources/LiveViewNative/Modifiers/Documents Modifiers/RenameActionModifier.swift b/Sources/LiveViewNative/Modifiers/Documents Modifiers/RenameActionModifier.swift
index 8b204235b..362b85491 100644
--- a/Sources/LiveViewNative/Modifiers/Documents Modifiers/RenameActionModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Documents Modifiers/RenameActionModifier.swift
@@ -14,7 +14,7 @@ import SwiftUI
/// ```html
///
/// ```
@@ -30,33 +30,21 @@ struct RenameActionModifier: ViewModifier, Decodable {
#if swift(>=5.8)
@_documentation(visibility: public)
#endif
- private let event: String
- /// The LiveView or LiveComponent to perform the event on.
- ///
- /// In a component, you may use the `@myself` assign to handle the event on the LiveComponent.
- #if swift(>=5.8)
- @_documentation(visibility: public)
- #endif
- private let target: Int?
- @Environment(\.coordinatorEnvironment) private var coordinatorEnvironment
+ @Event private var action: Event.EventHandler
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
- self.event = try container.decode(String.self, forKey: .event)
- self.target = try container.decode(Int?.self, forKey: .target)
+ self._action = try container.decode(Event.self, forKey: .action)
}
private enum CodingKeys: String, CodingKey {
- case event
- case target
+ case action
}
func body(content: Content) -> some View {
content
.renameAction {
- Task {
- try await coordinatorEnvironment?.pushEvent("click", event, [String:Any](), target)
- }
+ action(value: [String:String]())
}
}
}
diff --git a/Sources/LiveViewNative/Modifiers/Drawing and Graphics Modifiers/MaskModifier.swift b/Sources/LiveViewNative/Modifiers/Drawing and Graphics Modifiers/MaskModifier.swift
index f030aa263..d46d877b3 100644
--- a/Sources/LiveViewNative/Modifiers/Drawing and Graphics Modifiers/MaskModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Drawing and Graphics Modifiers/MaskModifier.swift
@@ -15,7 +15,7 @@ import SwiftUI
/// @native
/// |> foreground_color(color: :blue)
/// |> font(font: {:system, :large_title})
-/// |> mask(alignment: :center, content: :mask)
+/// |> mask(alignment: :center, mask: :mask)
/// }
/// >
/// opacity(opacity: 0.1)} />
@@ -41,7 +41,7 @@ struct MaskModifier: ViewModifier, Decodable {
#if swift(>=5.8)
@_documentation(visibility: public)
#endif
- private let content: String
+ private let mask: String
@ObservedElement private var element
@LiveContext private var context
@@ -50,17 +50,17 @@ struct MaskModifier: ViewModifier, Decodable {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.alignment = try container.decode(Alignment.self, forKey: .alignment)
- self.content = try container.decode(String.self, forKey: .content)
+ self.mask = try container.decode(String.self, forKey: .mask)
}
func body(content: Content) -> some View {
content.mask(alignment: alignment) {
- context.buildChildren(of: element, forTemplate: self.content)
+ context.buildChildren(of: element, forTemplate: self.mask)
}
}
enum CodingKeys: String, CodingKey {
case alignment
- case content
+ case mask
}
}
diff --git a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnDeleteCommandModifier.swift b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnDeleteCommandModifier.swift
index d25c940fa..a2dfbd8bc 100644
--- a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnDeleteCommandModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnDeleteCommandModifier.swift
@@ -46,24 +46,24 @@ struct OnDeleteCommandModifier: ViewModifier, Decodable {
#if swift(>=5.8)
@_documentation(visibility: public)
#endif
- @Event private var action: Event.EventHandler
+ @Event private var perform: Event.EventHandler
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
- self._action = try container.decode(Event.self, forKey: .action)
+ self._perform = try container.decode(Event.self, forKey: .perform)
}
func body(content: Content) -> some View {
content
#if os(macOS)
.onDeleteCommand {
- action()
+ perform()
}
#endif
}
enum CodingKeys: String, CodingKey {
- case action
+ case perform
}
}
diff --git a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnHoverModifier.swift b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnHoverModifier.swift
index 48a0d0c6d..5405ea4e5 100644
--- a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnHoverModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnHoverModifier.swift
@@ -44,24 +44,24 @@ struct OnHoverModifier: ViewModifier, Decodable {
#if swift(>=5.8)
@_documentation(visibility: public)
#endif
- @Event private var action: Event.EventHandler
+ @Event private var perform: Event.EventHandler
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
- self._action = try container.decode(Event.self, forKey: .action)
+ self._perform = try container.decode(Event.self, forKey: .perform)
}
func body(content: Content) -> some View {
content
#if os(iOS) || os(macOS)
.onHover { isHovering in
- action(value: isHovering)
+ perform(value: isHovering)
}
#endif
}
enum CodingKeys: String, CodingKey {
- case action
+ case perform
}
}
diff --git a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnMoveCommandModifier.swift b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnMoveCommandModifier.swift
index 857e97e61..fc3bc56ef 100644
--- a/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnMoveCommandModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Input Events Modifiers/OnMoveCommandModifier.swift
@@ -52,12 +52,12 @@ struct OnMoveCommandModifier: ViewModifier, Decodable {
#if swift(>=5.8)
@_documentation(visibility: public)
#endif
- @Event private var action: Event.EventHandler
+ @Event private var perform: Event.EventHandler
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
- self._action = try container.decode(Event.self, forKey: .action)
+ self._perform = try container.decode(Event.self, forKey: .perform)
}
func body(content: Content) -> some View {
@@ -66,21 +66,21 @@ struct OnMoveCommandModifier: ViewModifier, Decodable {
.onMoveCommand { direction in
switch direction {
case .up:
- action(value: ["direction": "up"])
+ perform(value: ["direction": "up"])
case .down:
- action(value: ["direction": "down"])
+ perform(value: ["direction": "down"])
case .left:
- action(value: ["direction": "left"])
+ perform(value: ["direction": "left"])
case .right:
- action(value: ["direction": "right"])
+ perform(value: ["direction": "right"])
@unknown default:
- action(value: ["direction": String(describing: direction)])
+ perform(value: ["direction": String(describing: direction)])
}
}
#endif
}
enum CodingKeys: String, CodingKey {
- case action
+ case perform
}
}
diff --git a/Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorVisibilityModifier.swift b/Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorModifier.swift
similarity index 84%
rename from Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorVisibilityModifier.swift
rename to Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorModifier.swift
index 44f91c8cd..80e64039e 100644
--- a/Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorVisibilityModifier.swift
+++ b/Sources/LiveViewNative/Modifiers/Menus and Commands/MenuIndicatorModifier.swift
@@ -10,7 +10,7 @@ import SwiftUI
/// Specifies whether the indicator on a ``Menu`` should be visible.
///
/// ```html
-///