From a2fecaa8b488a4937dec6a4cdb94f68bc2730514 Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Fri, 28 Nov 2025 19:36:29 +0100 Subject: [PATCH 1/9] Revise the drag attribute --- .../Attributes/BasicAttributes.swift | 8 +- .../Abstraction/Elements/BasicElements.swift | 5 + .../Abstraction/Elements/BodyElements.swift | 388 +++++++++++++++++- .../Elements/DefinitionElements.swift | 10 + .../Abstraction/Elements/FigureElements.swift | 5 + .../Abstraction/Elements/FormElements.swift | 30 ++ .../Abstraction/Elements/HeadElements.swift | 25 ++ .../Abstraction/Elements/HtmlElements.swift | 10 + .../Abstraction/Elements/InputElements.swift | 20 + .../Abstraction/Elements/ListElements.swift | 5 + .../Abstraction/Elements/MapElements.swift | 5 + .../Abstraction/Elements/MediaElements.swift | 10 + .../Abstraction/Elements/ObjectElements.swift | 5 + .../Abstraction/Elements/RubyElements.swift | 10 + .../Abstraction/Elements/TableElements.swift | 45 ++ Tests/HTMLKitTests/AttributesTests.swift | 10 +- 16 files changed, 580 insertions(+), 11 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index 8a7b2c83..91d36a0b 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -1028,7 +1028,7 @@ extension DownloadAttribute where Self: EmptyNode { } } -/// A type that provides the `isDraggable` modifier. +/// A type that provides the `draggable` modifier. @_documentation(visibility: internal) public protocol DragAttribute: Attribute { @@ -1038,13 +1038,13 @@ public protocol DragAttribute: Attribute { /// Division { /// ... /// } - /// .isDraggable(false) + /// .draggable(false) /// ``` /// - /// - Parameter condition: Whether the element should be draggable. + /// - Parameter value: Whether the element should be draggable. /// /// - Returns: The element - func isDraggable(_ condition: Bool) -> Self + func draggable(_ value: Bool) -> Self } extension DragAttribute where Self: ContentNode { diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index b0835389..8a9f0e0c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -132,9 +132,14 @@ extension Html: GlobalAttributes, GlobalEventAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Html { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Html { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Html { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index eca74f0d..d3e337a6 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -224,9 +224,14 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Article { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Article { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Article { return mutate(enterkeyhint: value.rawValue) @@ -524,9 +529,14 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Section { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Section { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Section { return mutate(enterkeyhint: value.rawValue) @@ -826,9 +836,14 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Navigation { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Navigation { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Navigation { return mutate(enterkeyhint: value.rawValue) @@ -1124,9 +1139,14 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Aside { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Aside { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Aside { return mutate(enterkeyhint: value.rawValue) @@ -1419,10 +1439,15 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading1 { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Heading1 { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Heading1 { return mutate(enterkeyhint: value.rawValue) } @@ -1721,10 +1746,15 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading2 { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Heading2 { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Heading2 { return mutate(enterkeyhint: value.rawValue) } @@ -2022,10 +2052,15 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute public func direction(_ value: Values.Direction) -> Heading3 { return mutate(dir: value.rawValue) } - + + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading3 { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Heading3 { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Heading3 { return mutate(enterkeyhint: value.rawValue) @@ -2325,9 +2360,14 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading4 { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Heading4 { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Heading4 { return mutate(enterkeyhint: value.rawValue) @@ -2627,9 +2667,14 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading5 { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Heading5 { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Heading5 { return mutate(enterkeyhint: value.rawValue) @@ -2929,9 +2974,14 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Heading6 { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Heading6 { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Heading6 { return mutate(enterkeyhint: value.rawValue) @@ -3236,9 +3286,14 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> HeadingGroup { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> HeadingGroup { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> HeadingGroup { return mutate(enterkeyhint: value.rawValue) @@ -3532,9 +3587,14 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Header { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Header { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Header { return mutate(enterkeyhint: value.rawValue) @@ -3826,9 +3886,14 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Footer { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Footer { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Footer { return mutate(enterkeyhint: value.rawValue) @@ -4127,9 +4192,14 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Address { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Address { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Address { return mutate(enterkeyhint: value.rawValue) @@ -4422,9 +4492,14 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Paragraph { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Paragraph { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Paragraph { return mutate(enterkeyhint: value.rawValue) @@ -4721,9 +4796,14 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> HorizontalRule { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> HorizontalRule { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> HorizontalRule { return mutate(enterkeyhint: value.rawValue) @@ -5022,9 +5102,14 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> PreformattedText { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> PreformattedText { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> PreformattedText { return mutate(enterkeyhint: value.rawValue) @@ -5317,9 +5402,14 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Blockquote { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Blockquote { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Blockquote { return mutate(enterkeyhint: value.rawValue) @@ -5628,9 +5718,14 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> OrderedList { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> OrderedList { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> OrderedList { return mutate(enterkeyhint: value.rawValue) @@ -5940,9 +6035,14 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> UnorderedList { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> UnorderedList { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> UnorderedList { return mutate(enterkeyhint: value.rawValue) @@ -6246,10 +6346,15 @@ extension Menu: GlobalAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Menu { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Menu { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Menu { return mutate(enterkeyhint: value.rawValue) } @@ -6452,9 +6557,14 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> DescriptionList { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> DescriptionList { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> DescriptionList { return mutate(enterkeyhint: value.rawValue) @@ -6752,9 +6862,14 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Figure { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Figure { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Figure { return mutate(enterkeyhint: value.rawValue) @@ -7049,9 +7164,14 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Anchor { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Anchor { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Anchor { return mutate(enterkeyhint: value.rawValue) @@ -7399,9 +7519,14 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Emphasize { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Emphasize { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Emphasize { return mutate(enterkeyhint: value.rawValue) @@ -7696,9 +7821,14 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Strong { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Strong { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Strong { return mutate(enterkeyhint: value.rawValue) @@ -7992,7 +8122,12 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { public func direction(_ value: Values.Direction) -> Small { return mutate(dir: value.rawValue) } + + public func draggable(_ value: Bool = true) -> Small { + return mutate(draggable: value) + } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Small { return mutate(draggable: value) } @@ -8297,9 +8432,14 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> StrikeThrough { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> StrikeThrough { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> StrikeThrough { return mutate(enterkeyhint: value.rawValue) @@ -8533,9 +8673,14 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Main { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Main { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Main { return mutate(enterkeyhint: value.rawValue) @@ -8835,10 +8980,15 @@ extension Search: GlobalAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Search { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Search { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Search { return mutate(enterkeyhint: value.rawValue) } @@ -9034,9 +9184,14 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Division { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Division { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Division { return mutate(enterkeyhint: value.rawValue) @@ -9334,9 +9489,14 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Definition { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Definition { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Definition { return mutate(enterkeyhint: value.rawValue) @@ -9632,9 +9792,14 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Cite { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Cite { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Cite { return mutate(enterkeyhint: value.rawValue) @@ -9928,10 +10093,15 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu public func direction(_ value: Values.Direction) -> ShortQuote { return mutate(dir: value.rawValue) } - + + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> ShortQuote { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> ShortQuote { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> ShortQuote { return mutate(enterkeyhint: value.rawValue) @@ -10231,9 +10401,14 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Abbreviation { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Abbreviation { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Abbreviation { return mutate(enterkeyhint: value.rawValue) @@ -10529,10 +10704,15 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Ruby { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Ruby { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Ruby { return mutate(enterkeyhint: value.rawValue) } @@ -10829,9 +11009,14 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Data { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Data { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Data { return mutate(enterkeyhint: value.rawValue) @@ -11141,9 +11326,14 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Time { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Time { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Time { return mutate(enterkeyhint: value.rawValue) @@ -11444,9 +11634,14 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Code { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Code { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Code { return mutate(enterkeyhint: value.rawValue) @@ -11743,9 +11938,14 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Variable { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Variable { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Variable { return mutate(enterkeyhint: value.rawValue) @@ -12038,9 +12238,14 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> SampleOutput { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> SampleOutput { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> SampleOutput { return mutate(enterkeyhint: value.rawValue) @@ -12337,9 +12542,14 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> KeyboardInput { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> KeyboardInput { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> KeyboardInput { return mutate(enterkeyhint: value.rawValue) @@ -12636,9 +12846,14 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Subscript { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Subscript { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Subscript { return mutate(enterkeyhint: value.rawValue) @@ -12934,9 +13149,14 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Superscript { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Superscript { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Superscript { return mutate(enterkeyhint: value.rawValue) @@ -13233,9 +13453,14 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Italic { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Italic { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Italic { return mutate(enterkeyhint: value.rawValue) @@ -13539,9 +13764,14 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Bold { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Bold { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Bold { return mutate(enterkeyhint: value.rawValue) @@ -13845,9 +14075,14 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Underline { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Underline { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Underline { return mutate(enterkeyhint: value.rawValue) @@ -14151,9 +14386,14 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Mark { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Mark { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Mark { return mutate(enterkeyhint: value.rawValue) @@ -14450,9 +14690,14 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Bdi { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Bdi { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Bdi { return mutate(enterkeyhint: value.rawValue) @@ -14743,9 +14988,14 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Bdo { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Bdo { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Bdo { return mutate(enterkeyhint: value.rawValue) @@ -15038,9 +15288,14 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Span { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Span { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Span { return mutate(enterkeyhint: value.rawValue) @@ -15324,9 +15579,14 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> LineBreak { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> LineBreak { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> LineBreak { return mutate(enterkeyhint: value.rawValue) @@ -15614,9 +15874,14 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> WordBreak { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> WordBreak { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> WordBreak { return mutate(enterkeyhint: value.rawValue) @@ -15909,9 +16174,14 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> InsertedText { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> InsertedText { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> InsertedText { return mutate(enterkeyhint: value.rawValue) @@ -16212,9 +16482,14 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> DeletedText { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> DeletedText { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> DeletedText { return mutate(enterkeyhint: value.rawValue) @@ -16519,10 +16794,15 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { public func direction(_ value: Values.Direction) -> Picture { return mutate(dir: value.rawValue) } - + + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Picture { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Picture { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Picture { return mutate(enterkeyhint: value.rawValue) @@ -16737,9 +17017,14 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Image { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Image { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Image { return mutate(enterkeyhint: value.rawValue) @@ -17107,9 +17392,14 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> InlineFrame { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> InlineFrame { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> InlineFrame { return mutate(enterkeyhint: value.rawValue) @@ -17438,10 +17728,15 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, public func direction(_ value: Values.Direction) -> Embed { return mutate(dir: value.rawValue) } - + + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Embed { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Embed { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Embed { return mutate(enterkeyhint: value.rawValue) @@ -17755,9 +18050,14 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Object { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Object { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Object { return mutate(enterkeyhint: value.rawValue) @@ -18076,9 +18376,14 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Video { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Video { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Video { return mutate(enterkeyhint: value.rawValue) @@ -18436,9 +18741,14 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Audio { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Audio { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Audio { return mutate(enterkeyhint: value.rawValue) @@ -18777,9 +19087,14 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Map { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Map { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Map { return mutate(enterkeyhint: value.rawValue) @@ -19006,9 +19321,14 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Form { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Form { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Form { return mutate(enterkeyhint: value.rawValue) @@ -19350,9 +19670,14 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> DataList { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> DataList { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> DataList { return mutate(enterkeyhint: value.rawValue) @@ -19647,9 +19972,14 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Output { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Output { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Output { return mutate(enterkeyhint: value.rawValue) @@ -19956,9 +20286,14 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Progress { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Progress { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Progress { return mutate(enterkeyhint: value.rawValue) @@ -20272,9 +20607,14 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Meter { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Meter { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Meter { return mutate(enterkeyhint: value.rawValue) @@ -20605,9 +20945,14 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Details { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Details { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Details { return mutate(enterkeyhint: value.rawValue) @@ -20913,9 +21258,14 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Dialog { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Dialog { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Dialog { return mutate(enterkeyhint: value.rawValue) @@ -21220,9 +21570,14 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Script { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Script { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Script { return mutate(enterkeyhint: value.rawValue) @@ -21477,9 +21832,14 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> NoScript { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> NoScript { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> NoScript { return mutate(enterkeyhint: value.rawValue) @@ -21703,9 +22063,14 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Template { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Template { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Template { return mutate(enterkeyhint: value.rawValue) @@ -21922,9 +22287,14 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Canvas { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Canvas { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Canvas { return mutate(enterkeyhint: value.rawValue) @@ -22232,9 +22602,14 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Table { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Table { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Table { return mutate(enterkeyhint: value.rawValue) @@ -22675,10 +23050,15 @@ extension Slot: GlobalAttributes, NameAttribute { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Slot { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Slot { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Slot { return mutate(enterkeyhint: value.rawValue) } diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index 13c9b4bd..142543aa 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -88,9 +88,14 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TermName { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TermName { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TermName { return mutate(enterkeyhint: value.rawValue) @@ -388,9 +393,14 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TermDefinition { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TermDefinition { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TermDefinition { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index 309d6163..41caff73 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -84,9 +84,14 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> FigureCaption { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> FigureCaption { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> FigureCaption { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index 3e88f3f8..01bec35d 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -72,9 +72,14 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Input { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Input { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Input { return mutate(enterkeyhint: value.rawValue) @@ -484,9 +489,14 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Label { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Label { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Label { return mutate(enterkeyhint: value.rawValue) @@ -799,9 +809,14 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Select { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Select { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Select { return mutate(enterkeyhint: value.rawValue) @@ -1072,9 +1087,14 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TextArea { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TextArea { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TextArea { return mutate(enterkeyhint: value.rawValue) @@ -1458,9 +1478,14 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Button { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Button { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Button { return mutate(enterkeyhint: value.rawValue) @@ -1816,9 +1841,14 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Fieldset { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Fieldset { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Fieldset { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index 8be51e31..c12d040e 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -77,10 +77,15 @@ extension Title: GlobalAttributes, GlobalEventAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Title { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Title { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Title { return mutate(enterkeyhint: value.rawValue) } @@ -298,10 +303,15 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Base { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Base { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Base { return mutate(enterkeyhint: value.rawValue) } @@ -519,9 +529,14 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Meta { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Meta { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Meta { return mutate(enterkeyhint: value.rawValue) @@ -775,9 +790,14 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Style { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Style { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Style { return mutate(enterkeyhint: value.rawValue) @@ -1015,9 +1035,14 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Link { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Link { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Link { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index ca0ec2d3..7f6fd72f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -75,10 +75,15 @@ extension Head: GlobalAttributes, GlobalEventAttributes { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Head { return mutate(draggable: value) } + public func draggable(_ value: Bool = true) -> Head { + return mutate(draggable: value) + } + public func enterKeyHint(_ value: Values.Hint) -> Head { return mutate(enterkeyhint: value.rawValue) } @@ -299,9 +304,14 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Body { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Body { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Body { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index b6bd7cb7..6826c523 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -90,9 +90,14 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> OptionGroup { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> OptionGroup { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> OptionGroup { return mutate(enterkeyhint: value.rawValue) @@ -401,9 +406,14 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Option { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Option { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Option { return mutate(enterkeyhint: value.rawValue) @@ -746,9 +756,14 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Legend { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Legend { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Legend { return mutate(enterkeyhint: value.rawValue) @@ -1046,9 +1061,14 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Summary { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Summary { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Summary { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index e049198c..61270862 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -84,9 +84,14 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> ListItem { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> ListItem { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> ListItem { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index 824f2386..e656e7b2 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -79,9 +79,14 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Area { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Area { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Area { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index 99b0b7db..df277561 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -71,9 +71,14 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Source { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Source { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Source { return mutate(enterkeyhint: value.rawValue) @@ -342,9 +347,14 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Track { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Track { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Track { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index 466fd41a..ed78764c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -75,9 +75,14 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Parameter { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Parameter { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Parameter { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index 2e9f73bc..bb866a54 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -86,9 +86,14 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> RubyText { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> RubyText { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> RubyText { return mutate(enterkeyhint: value.rawValue) @@ -390,9 +395,14 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> RubyPronunciation { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> RubyPronunciation { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> RubyPronunciation { return mutate(enterkeyhint: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index 3d6dbd38..fca8f0c6 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -109,9 +109,14 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Caption { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Caption { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Caption { return mutate(enterkeyhint: value.rawValue) @@ -408,9 +413,14 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> ColumnGroup { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> ColumnGroup { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> ColumnGroup { return mutate(enterkeyhint: value.rawValue) @@ -632,9 +642,14 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> Column { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> Column { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> Column { return mutate(enterkeyhint: value.rawValue) @@ -860,9 +875,14 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TableBody { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TableBody { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TableBody { return mutate(enterkeyhint: value.rawValue) @@ -1176,9 +1196,14 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TableHead { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TableHead { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TableHead { return mutate(enterkeyhint: value.rawValue) @@ -1492,9 +1517,14 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TableFoot { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TableFoot { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TableFoot { return mutate(enterkeyhint: value.rawValue) @@ -1794,9 +1824,14 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> TableRow { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> TableRow { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> TableRow { return mutate(enterkeyhint: value.rawValue) @@ -2101,9 +2136,14 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> DataCell { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> DataCell { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> DataCell { return mutate(enterkeyhint: value.rawValue) @@ -2412,9 +2452,14 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(dir: value.rawValue) } + @available(*, deprecated, message: "Use the draggable(_:) modifier instead.") public func isDraggable(_ value: Bool) -> HeaderCell { return mutate(draggable: value) } + + public func draggable(_ value: Bool = true) -> HeaderCell { + return mutate(draggable: value) + } public func enterKeyHint(_ value: Values.Hint) -> HeaderCell { return mutate(enterkeyhint: value.rawValue) diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 2036c5a5..5f43a324 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -57,8 +57,8 @@ final class AttributesTests: XCTestCase { func direction(_ value: Values.Direction) -> Tag { return self.mutate(dir: value.rawValue) } - - func isDraggable(_ value: Bool) -> Tag { + + func draggable(_ value: Bool = true) -> Tag { return self.mutate(draggable: value) } @@ -971,11 +971,15 @@ final class AttributesTests: XCTestCase { func testDraggableAttribute() throws { let view = TestView { - Tag {}.isDraggable(true) + Tag {}.draggable() + Tag {}.draggable(false) + Tag {}.draggable(true) } XCTAssertEqual(try renderer.render(view: view), """ + \ + \ """ ) From 7568bff04a65892395e656188f621240a258f2ad Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Fri, 28 Nov 2025 21:35:24 +0100 Subject: [PATCH 2/9] Mark older deprecations as unavailable --- .../Abstraction/Elements/BasicElements.swift | 2 +- .../Abstraction/Elements/BodyElements.swift | 154 +++++++++--------- .../Elements/DefinitionElements.swift | 4 +- .../Abstraction/Elements/FigureElements.swift | 2 +- .../Abstraction/Elements/FormElements.swift | 18 +- .../Abstraction/Elements/HeadElements.swift | 10 +- .../Abstraction/Elements/HtmlElements.swift | 4 +- .../Abstraction/Elements/InputElements.swift | 8 +- .../Abstraction/Elements/ListElements.swift | 2 +- .../Abstraction/Elements/MapElements.swift | 2 +- .../Abstraction/Elements/MediaElements.swift | 4 +- .../Abstraction/Elements/ObjectElements.swift | 2 +- .../Abstraction/Elements/RubyElements.swift | 4 +- .../Abstraction/Elements/TableElements.swift | 20 +-- 14 files changed, 118 insertions(+), 118 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index 8a9f0e0c..a5da59ac 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -154,7 +154,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Html { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index d3e337a6..abf8f4fd 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -246,7 +246,7 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Article { return mutate(inputmode: value) } @@ -551,7 +551,7 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Section { return mutate(inputmode: value) } @@ -858,7 +858,7 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Navigation { return mutate(inputmode: value) } @@ -1161,7 +1161,7 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Aside { return mutate(inputmode: value) } @@ -1461,7 +1461,7 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading1 { return mutate(inputmode: value) } @@ -1768,7 +1768,7 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading2 { return mutate(inputmode: value) } @@ -2075,7 +2075,7 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading3 { return mutate(inputmode: value) } @@ -2382,7 +2382,7 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading4 { return mutate(inputmode: value) } @@ -2689,7 +2689,7 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading5 { return mutate(inputmode: value) } @@ -2996,7 +2996,7 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Heading6 { return mutate(inputmode: value) } @@ -3308,7 +3308,7 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> HeadingGroup { return mutate(inputmode: value) } @@ -3609,7 +3609,7 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Header { return mutate(inputmode: value) } @@ -3908,7 +3908,7 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Footer { return mutate(inputmode: value) } @@ -4214,7 +4214,7 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Address { return mutate(inputmode: value) } @@ -4514,7 +4514,7 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Paragraph { return mutate(inputmode: value) } @@ -4818,7 +4818,7 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> HorizontalRule { return mutate(inputmode: value) } @@ -5124,7 +5124,7 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> PreformattedText { return mutate(inputmode: value) } @@ -5424,7 +5424,7 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Blockquote { return mutate(inputmode: value) } @@ -5740,7 +5740,7 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> OrderedList { return mutate(inputmode: value) } @@ -6057,7 +6057,7 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> UnorderedList { return mutate(inputmode: value) } @@ -6368,7 +6368,7 @@ extension Menu: GlobalAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Menu { return mutate(inputmode: value) } @@ -6579,7 +6579,7 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> DescriptionList { return mutate(inputmode: value) } @@ -6884,7 +6884,7 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Figure { return mutate(inputmode: value) } @@ -7186,7 +7186,7 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Anchor { return mutate(inputmode: value) } @@ -7541,7 +7541,7 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Emphasize { return mutate(inputmode: value) } @@ -7843,7 +7843,7 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Strong { return mutate(inputmode: value) } @@ -8145,7 +8145,7 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Small { return mutate(inputmode: value) } @@ -8454,7 +8454,7 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> StrikeThrough { return mutate(inputmode: value) } @@ -8695,7 +8695,7 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Main { return mutate(inputmode: value) } @@ -9002,7 +9002,7 @@ extension Search: GlobalAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Search { return mutate(inputmode: value) } @@ -9206,7 +9206,7 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Division { return mutate(inputmode: value) } @@ -9511,7 +9511,7 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Definition { return mutate(inputmode: value) } @@ -9814,7 +9814,7 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Cite { return mutate(inputmode: value) } @@ -10116,7 +10116,7 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> ShortQuote { return mutate(inputmode: value) } @@ -10423,7 +10423,7 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Abbreviation { return mutate(inputmode: value) } @@ -10726,7 +10726,7 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Ruby { return mutate(inputmode: value) } @@ -11031,7 +11031,7 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Data { return mutate(inputmode: value) } @@ -11348,7 +11348,7 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Time { return mutate(inputmode: value) } @@ -11656,7 +11656,7 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Code { return mutate(inputmode: value) } @@ -11960,7 +11960,7 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Variable { return mutate(inputmode: value) } @@ -12260,7 +12260,7 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> SampleOutput { return mutate(inputmode: value) } @@ -12564,7 +12564,7 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> KeyboardInput { return mutate(inputmode: value) } @@ -12868,7 +12868,7 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Subscript { return mutate(inputmode: value) } @@ -13171,7 +13171,7 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Superscript { return mutate(inputmode: value) } @@ -13475,7 +13475,7 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Italic { return mutate(inputmode: value) } @@ -13786,7 +13786,7 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Bold { return mutate(inputmode: value) } @@ -14097,7 +14097,7 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Underline { return mutate(inputmode: value) } @@ -14408,7 +14408,7 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Mark { return mutate(inputmode: value) } @@ -14712,7 +14712,7 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Bdi { return mutate(inputmode: value) } @@ -15010,7 +15010,7 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Bdo { return mutate(inputmode: value) } @@ -15310,7 +15310,7 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Span { return mutate(inputmode: value) } @@ -15601,7 +15601,7 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> LineBreak { return mutate(inputmode: value) } @@ -15896,7 +15896,7 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> WordBreak { return mutate(inputmode: value) } @@ -16196,7 +16196,7 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> InsertedText { return mutate(inputmode: value) } @@ -16504,7 +16504,7 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> DeletedText { return mutate(inputmode: value) } @@ -16817,7 +16817,7 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Picture { return mutate(inputmode: value) } @@ -17039,7 +17039,7 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Image { return mutate(inputmode: value) } @@ -17414,7 +17414,7 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> InlineFrame { return mutate(inputmode: value) } @@ -17751,7 +17751,7 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Embed { return mutate(inputmode: value) } @@ -18072,7 +18072,7 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Object { return mutate(inputmode: value) } @@ -18398,7 +18398,7 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Video { return mutate(inputmode: value) } @@ -18763,7 +18763,7 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Audio { return mutate(inputmode: value) } @@ -19109,7 +19109,7 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Map { return mutate(inputmode: value) } @@ -19343,7 +19343,7 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Form { return mutate(inputmode: value) } @@ -19446,7 +19446,7 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(action: value) } - @available(*, deprecated, message: "The autocomplete attribute is actually a enum attribute. You should use autocomplete(_:) instead.") + @available(*, unavailable, message: "Use the autocomplete(_:) modifier instead.") public func hasCompletion(_ value: Bool) -> Form { if value { @@ -19692,7 +19692,7 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> DataList { return mutate(inputmode: value) } @@ -19994,7 +19994,7 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Output { return mutate(inputmode: value) } @@ -20308,7 +20308,7 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Progress { return mutate(inputmode: value) } @@ -20629,7 +20629,7 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Meter { return mutate(inputmode: value) } @@ -20967,7 +20967,7 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Details { return mutate(inputmode: value) } @@ -21280,7 +21280,7 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Dialog { return mutate(inputmode: value) } @@ -21592,7 +21592,7 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Script { return mutate(inputmode: value) } @@ -21854,7 +21854,7 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> NoScript { return mutate(inputmode: value) } @@ -22085,7 +22085,7 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Template { return mutate(inputmode: value) } @@ -22309,7 +22309,7 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Canvas { return mutate(inputmode: value) } @@ -22624,7 +22624,7 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Table { return mutate(inputmode: value) } @@ -23072,7 +23072,7 @@ extension Slot: GlobalAttributes, NameAttribute { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Slot { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index 142543aa..4450ca56 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -110,7 +110,7 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TermName { return mutate(inputmode: value) } @@ -415,7 +415,7 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TermDefinition { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index 41caff73..574d1c18 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -106,7 +106,7 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> FigureCaption { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index 01bec35d..69005420 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -94,7 +94,7 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Input { return mutate(inputmode: value) } @@ -222,7 +222,7 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return mutate(alternate: value) } - @available(*, deprecated, message: "The autocomplete attribute is actually a enum attribute. You should use autocomplete(_:) instead.") + @available(*, unavailable, message: "Use the autocomplete(_:) modifier instead.") public func hasCompletion(_ value: Bool) -> Input { if value { @@ -511,7 +511,7 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Label { return mutate(inputmode: value) } @@ -831,7 +831,7 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Select { return mutate(inputmode: value) } @@ -930,7 +930,7 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return self } - @available(*, deprecated, message: "The autocomplete attribute is actually a enum attribute. You should use autocomplete(_:) instead.") + @available(*, unavailable, message: "Use the autocomplete(_:) modifier instead.") public func hasCompletion(_ value: Bool) -> Select { if value { @@ -1109,7 +1109,7 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TextArea { return mutate(inputmode: value) } @@ -1208,7 +1208,7 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The autocomplete attribute is actually a enum attribute. You should use autocomplete(_:) instead.") + @available(*, unavailable, message: "Use the autocomplete(_:) modifier instead.") public func hasCompletion(_ value: Bool) -> TextArea { if value { @@ -1500,7 +1500,7 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Button { return mutate(inputmode: value) } @@ -1863,7 +1863,7 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Fieldset { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index c12d040e..077ce58b 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -99,7 +99,7 @@ extension Title: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Title { return mutate(inputmode: value) } @@ -325,7 +325,7 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Base { return mutate(inputmode: value) } @@ -551,7 +551,7 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Meta { return mutate(inputmode: value) } @@ -812,7 +812,7 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Style { return mutate(inputmode: value) } @@ -1057,7 +1057,7 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Link { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index 7f6fd72f..7a2c6e62 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -97,7 +97,7 @@ extension Head: GlobalAttributes, GlobalEventAttributes { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Head { return mutate(inputmode: value) } @@ -326,7 +326,7 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Body { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index 6826c523..bef94067 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -112,7 +112,7 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> OptionGroup { return mutate(inputmode: value) } @@ -428,7 +428,7 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Option { return mutate(inputmode: value) } @@ -778,7 +778,7 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Legend { return mutate(inputmode: value) } @@ -1083,7 +1083,7 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Summary { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index 61270862..8dec7217 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -106,7 +106,7 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> ListItem { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index e656e7b2..38bcb8e7 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -101,7 +101,7 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Area { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index df277561..e93f09fd 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -93,7 +93,7 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Source { return mutate(inputmode: value) } @@ -369,7 +369,7 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Track { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index ed78764c..2f1ba60c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -97,7 +97,7 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Parameter { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index bb866a54..8f1c6576 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -108,7 +108,7 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> RubyText { return mutate(inputmode: value) } @@ -417,7 +417,7 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> RubyPronunciation { return mutate(inputmode: value) } diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index fca8f0c6..6ebc2c40 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -131,7 +131,7 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Caption { return mutate(inputmode: value) } @@ -435,7 +435,7 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> ColumnGroup { return mutate(inputmode: value) } @@ -664,7 +664,7 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> Column { return mutate(inputmode: value) } @@ -897,7 +897,7 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TableBody { return mutate(inputmode: value) } @@ -1218,7 +1218,7 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TableHead { return mutate(inputmode: value) } @@ -1539,7 +1539,7 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TableFoot { return mutate(inputmode: value) } @@ -1846,7 +1846,7 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> TableRow { return mutate(inputmode: value) } @@ -2158,7 +2158,7 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> DataCell { return mutate(inputmode: value) } @@ -2474,7 +2474,7 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return self } - @available(*, deprecated, message: "The inputmode attribute is actually an enumerated attribute. Use the inputMode(_: Mode) modifier instead.") + @available(*, unavailable, message: "Use the inputMode(_:) modifier instead.") public func inputMode(_ value: String) -> HeaderCell { return mutate(inputmode: value) } @@ -2585,7 +2585,7 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(headers: value) } - @available(*, deprecated, message: "The scope attribute is actually an enumerated attribute. Use the scope(_: Scope) modifier instead.") + @available(*, unavailable, message: "Use the scope(_:) modifier instead.") public func scope(_ value: String) -> HeaderCell { return mutate(scope: value) } From 530d80b2eaa7827c5f61ee55e38fe0d6c47d5315 Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Sat, 29 Nov 2025 15:44:49 +0100 Subject: [PATCH 3/9] Revise the edit attribute --- .../Attributes/BasicAttributes.swift | 8 +- .../Abstraction/Elements/BasicElements.swift | 5 + .../Abstraction/Elements/BodyElements.swift | 382 +++++++++++++++++- .../Elements/DefinitionElements.swift | 10 + .../Abstraction/Elements/FigureElements.swift | 5 + .../Abstraction/Elements/FormElements.swift | 30 ++ .../Abstraction/Elements/HeadElements.swift | 25 ++ .../Abstraction/Elements/HtmlElements.swift | 10 + .../Abstraction/Elements/InputElements.swift | 20 + .../Abstraction/Elements/ListElements.swift | 5 + .../Abstraction/Elements/MapElements.swift | 5 + .../Abstraction/Elements/MediaElements.swift | 10 + .../Abstraction/Elements/ObjectElements.swift | 5 + .../Abstraction/Elements/RubyElements.swift | 10 + .../Abstraction/Elements/TableElements.swift | 47 ++- Tests/HTMLKitTests/AttributesTests.swift | 8 +- 16 files changed, 577 insertions(+), 8 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index 91d36a0b..d5356e4b 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -680,7 +680,7 @@ extension ContentAttribute where Self: EmptyNode { } } -/// A type that provides the `isEditable` modifier. +/// A type that provides the `editable` modifier. @_documentation(visibility: internal) public protocol EditAttribute: Attribute { @@ -690,13 +690,13 @@ public protocol EditAttribute: Attribute { /// Blockquote { /// "Lorem ipsum..." /// } - /// .isEditable(false) + /// .editable(false) /// ``` /// - /// - Parameter condition: Whether the element should be editable. + /// - Parameter value: Whether the element should be editable. /// /// - Returns: The element - func isEditable(_ condition: Bool) -> Self + func editable(_ value: Bool) -> Self } extension EditAttribute where Self: ContentNode { diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index a5da59ac..47c0c814 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -124,9 +124,14 @@ extension Html: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Html { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Html { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Html { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index abf8f4fd..2accb4ae 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -216,9 +216,14 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Article { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Article { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Article { return mutate(dir: value.rawValue) @@ -521,9 +526,14 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Section { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Section { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Section { return mutate(dir: value.rawValue) @@ -828,9 +838,14 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Navigation { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Navigation { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Navigation { return mutate(dir: value.rawValue) @@ -1131,9 +1146,14 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Aside { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Aside { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Aside { return mutate(dir: value.rawValue) @@ -1431,10 +1451,15 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading1 { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Heading1 { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Heading1 { return mutate(dir: value.rawValue) } @@ -1738,10 +1763,15 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading2 { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Heading2 { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Heading2 { return mutate(dir: value.rawValue) } @@ -2045,9 +2075,14 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading3 { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Heading3 { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Heading3 { return mutate(dir: value.rawValue) @@ -2352,9 +2387,14 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading4 { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Heading4 { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Heading4 { return mutate(dir: value.rawValue) @@ -2659,9 +2699,14 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading5 { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Heading5 { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Heading5 { return mutate(dir: value.rawValue) @@ -2966,9 +3011,14 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Heading6 { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Heading6 { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Heading6 { return mutate(dir: value.rawValue) @@ -3278,9 +3328,14 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> HeadingGroup { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> HeadingGroup { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> HeadingGroup { return mutate(dir: value.rawValue) @@ -3579,9 +3634,14 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Header { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Header { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Header { return mutate(dir: value.rawValue) @@ -3878,9 +3938,14 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Footer { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Footer { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Footer { return mutate(dir: value.rawValue) @@ -4184,9 +4249,14 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Address { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Address { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Address { return mutate(dir: value.rawValue) @@ -4484,9 +4554,14 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Paragraph { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Paragraph { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Paragraph { return mutate(dir: value.rawValue) @@ -4788,9 +4863,14 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> HorizontalRule { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> HorizontalRule { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> HorizontalRule { return mutate(dir: value.rawValue) @@ -5094,9 +5174,14 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> PreformattedText { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> PreformattedText { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> PreformattedText { return mutate(dir: value.rawValue) @@ -5394,9 +5479,14 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Blockquote { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Blockquote { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Blockquote { return mutate(dir: value.rawValue) @@ -5710,9 +5800,14 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> OrderedList { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> OrderedList { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> OrderedList { return mutate(dir: value.rawValue) @@ -6027,9 +6122,14 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> UnorderedList { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> UnorderedList { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> UnorderedList { return mutate(dir: value.rawValue) @@ -6338,10 +6438,15 @@ extension Menu: GlobalAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Menu { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Menu { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Menu { return mutate(dir: value.rawValue) } @@ -6548,10 +6653,15 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt public func `class`(_ value: String) -> DescriptionList { return mutate(class: value) } - + + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> DescriptionList { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> DescriptionList { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> DescriptionList { return mutate(dir: value.rawValue) @@ -6854,9 +6964,14 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Figure { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Figure { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Figure { return mutate(dir: value.rawValue) @@ -7156,9 +7271,14 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Anchor { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Anchor { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Anchor { return mutate(dir: value.rawValue) @@ -7511,9 +7631,14 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Emphasize { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Emphasize { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Emphasize { return mutate(dir: value.rawValue) @@ -7813,9 +7938,14 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Strong { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Strong { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Strong { return mutate(dir: value.rawValue) @@ -8115,9 +8245,14 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Small { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Small { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Small { return mutate(dir: value.rawValue) @@ -8424,9 +8559,14 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> StrikeThrough { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> StrikeThrough { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> StrikeThrough { return mutate(dir: value.rawValue) @@ -8665,9 +8805,14 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Main { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Main { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Main { return mutate(dir: value.rawValue) @@ -8972,10 +9117,15 @@ extension Search: GlobalAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Search { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Search { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Search { return mutate(dir: value.rawValue) } @@ -9176,9 +9326,14 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Division { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Division { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Division { return mutate(dir: value.rawValue) @@ -9481,9 +9636,14 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Definition { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Definition { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Definition { return mutate(dir: value.rawValue) @@ -9784,9 +9944,14 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Cite { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Cite { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Cite { return mutate(dir: value.rawValue) @@ -10086,9 +10251,14 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> ShortQuote { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> ShortQuote { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> ShortQuote { return mutate(dir: value.rawValue) @@ -10393,9 +10563,14 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Abbreviation { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Abbreviation { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Abbreviation { return mutate(dir: value.rawValue) @@ -10696,10 +10871,15 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Ruby { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Ruby { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Ruby { return mutate(dir: value.rawValue) } @@ -11001,9 +11181,14 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Data { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Data { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Data { return mutate(dir: value.rawValue) @@ -11318,9 +11503,14 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Time { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Time { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Time { return mutate(dir: value.rawValue) @@ -11626,9 +11816,14 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Code { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Code { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Code { return mutate(dir: value.rawValue) @@ -11930,9 +12125,14 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Variable { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Variable { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Variable { return mutate(dir: value.rawValue) @@ -12230,9 +12430,14 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> SampleOutput { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> SampleOutput { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> SampleOutput { return mutate(dir: value.rawValue) @@ -12534,9 +12739,14 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> KeyboardInput { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> KeyboardInput { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> KeyboardInput { return mutate(dir: value.rawValue) @@ -12838,9 +13048,14 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Subscript { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Subscript { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Subscript { return mutate(dir: value.rawValue) @@ -13141,9 +13356,14 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Superscript { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Superscript { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Superscript { return mutate(dir: value.rawValue) @@ -13445,9 +13665,14 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Italic { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Italic { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Italic { return mutate(dir: value.rawValue) @@ -13756,9 +13981,14 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Bold { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Bold { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Bold { return mutate(dir: value.rawValue) @@ -14067,10 +14297,15 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Underline { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Underline { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Underline { return mutate(dir: value.rawValue) } @@ -14378,9 +14613,14 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Mark { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Mark { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Mark { return mutate(dir: value.rawValue) @@ -14682,9 +14922,14 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Bdi { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Bdi { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Bdi { return mutate(dir: value.rawValue) @@ -14980,9 +15225,14 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Bdo { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Bdo { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Bdo { return mutate(dir: value.rawValue) @@ -15280,9 +15530,14 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Span { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Span { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Span { return mutate(dir: value.rawValue) @@ -15571,9 +15826,14 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> LineBreak { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> LineBreak { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> LineBreak { return mutate(dir: value.rawValue) @@ -15866,9 +16126,14 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> WordBreak { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> WordBreak { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> WordBreak { return mutate(dir: value.rawValue) @@ -16166,9 +16431,14 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> InsertedText { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> InsertedText { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> InsertedText { return mutate(dir: value.rawValue) @@ -16474,9 +16744,14 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> DeletedText { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> DeletedText { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> DeletedText { return mutate(dir: value.rawValue) @@ -16787,9 +17062,14 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Picture { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Picture { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Picture { return mutate(dir: value.rawValue) @@ -17009,9 +17289,14 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(crossorigin: value.rawValue) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Image { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Image { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Image { return mutate(dir: value.rawValue) @@ -17384,9 +17669,14 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> InlineFrame { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> InlineFrame { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> InlineFrame { return mutate(dir: value.rawValue) @@ -17721,9 +18011,14 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Embed { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Embed { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Embed { return mutate(dir: value.rawValue) @@ -18042,9 +18337,14 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Object { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Object { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Object { return mutate(dir: value.rawValue) @@ -18368,9 +18668,14 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Video { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Video { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Video { return mutate(dir: value.rawValue) @@ -18733,9 +19038,14 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(crossorigin: value.rawValue) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Audio { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Audio { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Audio { return mutate(dir: value.rawValue) @@ -19079,9 +19389,14 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Map { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Map { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Map { return mutate(dir: value.rawValue) @@ -19313,9 +19628,14 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Form { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Form { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Form { return mutate(dir: value.rawValue) @@ -19662,9 +19982,14 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> DataList { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> DataList { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> DataList { return mutate(dir: value.rawValue) @@ -19964,9 +20289,14 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Output { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Output { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Output { return mutate(dir: value.rawValue) @@ -20278,9 +20608,14 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Progress { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Progress { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Progress { return mutate(dir: value.rawValue) @@ -20599,9 +20934,14 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Meter { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Meter { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Meter { return mutate(dir: value.rawValue) @@ -20937,9 +21277,14 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Details { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Details { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Details { return mutate(dir: value.rawValue) @@ -21250,9 +21595,14 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Dialog { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Dialog { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Dialog { return mutate(dir: value.rawValue) @@ -21558,10 +21908,15 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return mutate(crossorigin: value.rawValue) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Script { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Script { + return mutate(contenteditable: value) + } + public func `defer`() -> Script { return mutate(defer: "defer") } @@ -21824,9 +22179,14 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> NoScript { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> NoScript { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> NoScript { return mutate(dir: value.rawValue) @@ -22055,9 +22415,14 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Template { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Template { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Template { return mutate(dir: value.rawValue) @@ -22279,9 +22644,14 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Canvas { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Canvas { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Canvas { return mutate(dir: value.rawValue) @@ -22594,9 +22964,14 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Table { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Table { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Table { return mutate(dir: value.rawValue) @@ -23042,10 +23417,15 @@ extension Slot: GlobalAttributes, NameAttribute { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Slot { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Slot { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Slot { return mutate(dir: value.rawValue) } diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index 4450ca56..3bbcb62f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -80,9 +80,14 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TermName { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TermName { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TermName { return mutate(dir: value.rawValue) @@ -385,9 +390,14 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TermDefinition { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TermDefinition { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TermDefinition { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index 574d1c18..7dbbdfb4 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -76,9 +76,14 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> FigureCaption { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> FigureCaption { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> FigureCaption { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index 69005420..f480bb8d 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -64,9 +64,14 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Input { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Input { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Input { return mutate(dir: value.rawValue) @@ -481,9 +486,14 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Label { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Label { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Label { return mutate(dir: value.rawValue) @@ -801,9 +811,14 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Select { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Select { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Select { return mutate(dir: value.rawValue) @@ -1079,9 +1094,14 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TextArea { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TextArea { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TextArea { return mutate(dir: value.rawValue) @@ -1470,9 +1490,14 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Button { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Button { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Button { return mutate(dir: value.rawValue) @@ -1833,9 +1858,14 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Fieldset { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Fieldset { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Fieldset { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index 077ce58b..28f8f29a 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -69,10 +69,15 @@ extension Title: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Title { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Title { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Title { return mutate(dir: value.rawValue) } @@ -295,10 +300,15 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Base { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Base { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Base { return mutate(dir: value.rawValue) } @@ -521,9 +531,14 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Meta { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Meta { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Meta { return mutate(dir: value.rawValue) @@ -782,9 +797,14 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Style { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Style { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Style { return mutate(dir: value.rawValue) @@ -1027,9 +1047,14 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref return mutate(crossorigin: value.rawValue) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Link { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Link { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Link { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index 7a2c6e62..f4bf90fb 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -67,10 +67,15 @@ extension Head: GlobalAttributes, GlobalEventAttributes { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Head { return mutate(contenteditable: value) } + public func editable(_ value: Bool = true) -> Head { + return mutate(contenteditable: value) + } + public func direction(_ value: Values.Direction) -> Head { return mutate(dir: value.rawValue) } @@ -296,9 +301,14 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Body { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Body { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Body { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index bef94067..6e66874c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -82,9 +82,14 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> OptionGroup { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> OptionGroup { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> OptionGroup { return mutate(dir: value.rawValue) @@ -398,9 +403,14 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Option { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Option { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Option { return mutate(dir: value.rawValue) @@ -748,9 +758,14 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Legend { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Legend { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Legend { return mutate(dir: value.rawValue) @@ -1053,9 +1068,14 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Summary { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Summary { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Summary { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index 8dec7217..11ee6b9b 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -76,9 +76,14 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> ListItem { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> ListItem { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> ListItem { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index 38bcb8e7..4b1f1001 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -71,9 +71,14 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Area { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Area { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Area { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index e93f09fd..38ce5c0f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -63,9 +63,14 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Source { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Source { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Source { return mutate(dir: value.rawValue) @@ -339,9 +344,14 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Track { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Track { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Track { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index 2f1ba60c..d110f90b 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -67,9 +67,14 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Parameter { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Parameter { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Parameter { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index 8f1c6576..d4c2fc10 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -78,9 +78,14 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> RubyText { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> RubyText { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> RubyText { return mutate(dir: value.rawValue) @@ -387,9 +392,14 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> RubyPronunciation { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> RubyPronunciation { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> RubyPronunciation { return mutate(dir: value.rawValue) diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index 6ebc2c40..45cdd7ab 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -101,9 +101,14 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Caption { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Caption { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Caption { return mutate(dir: value.rawValue) @@ -404,10 +409,15 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { public func `class`(_ value: String) -> ColumnGroup { return mutate(class: value) } - + + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> ColumnGroup { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> ColumnGroup { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> ColumnGroup { return mutate(dir: value.rawValue) @@ -634,9 +644,14 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> Column { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> Column { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> Column { return mutate(dir: value.rawValue) @@ -867,9 +882,14 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TableBody { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TableBody { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TableBody { return mutate(dir: value.rawValue) @@ -1188,9 +1208,14 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TableHead { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TableHead { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TableHead { return mutate(dir: value.rawValue) @@ -1509,9 +1534,14 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TableFoot { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TableFoot { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TableFoot { return mutate(dir: value.rawValue) @@ -1816,9 +1846,14 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> TableRow { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> TableRow { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> TableRow { return mutate(dir: value.rawValue) @@ -2128,9 +2163,14 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> DataCell { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> DataCell { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> DataCell { return mutate(dir: value.rawValue) @@ -2444,9 +2484,14 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(class: value) } + @available(*, deprecated, message: "Use the editable(_:) modifier instead.") public func isEditable(_ value: Bool) -> HeaderCell { return mutate(contenteditable: value) } + + public func editable(_ value: Bool = true) -> HeaderCell { + return mutate(contenteditable: value) + } public func direction(_ value: Values.Direction) -> HeaderCell { return mutate(dir: value.rawValue) diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 5f43a324..9d899a0a 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -62,7 +62,7 @@ final class AttributesTests: XCTestCase { return self.mutate(draggable: value) } - func isEditable(_ value: Bool) -> Tag { + func editable(_ value: Bool = true) -> Tag { return self.mutate(contenteditable: value) } @@ -988,11 +988,15 @@ final class AttributesTests: XCTestCase { func testEditableAttribute() throws { let view = TestView { - Tag {}.isEditable(true) + Tag {}.editable() + Tag {}.editable(false) + Tag {}.editable(true) } XCTAssertEqual(try renderer.render(view: view), """ + \ + \ """ ) From e7872b0d3f768939384cfc05ba17692b311335aa Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Sun, 30 Nov 2025 12:18:57 +0100 Subject: [PATCH 4/9] Revise the spellcheck attribute --- .../Attributes/BasicAttributes.swift | 8 +- .../Abstraction/Elements/BasicElements.swift | 5 + .../Abstraction/Elements/BodyElements.swift | 386 +++++++++++++++++- .../Elements/DefinitionElements.swift | 10 + .../Abstraction/Elements/FigureElements.swift | 5 + .../Abstraction/Elements/FormElements.swift | 30 ++ .../Abstraction/Elements/HeadElements.swift | 25 ++ .../Abstraction/Elements/HtmlElements.swift | 10 + .../Abstraction/Elements/InputElements.swift | 20 + .../Abstraction/Elements/ListElements.swift | 5 + .../Abstraction/Elements/MapElements.swift | 5 + .../Abstraction/Elements/MediaElements.swift | 10 + .../Abstraction/Elements/ObjectElements.swift | 5 + .../Abstraction/Elements/RubyElements.swift | 11 + .../Abstraction/Elements/TableElements.swift | 47 ++- Tests/HTMLKitTests/AttributesTests.swift | 8 +- 16 files changed, 580 insertions(+), 10 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index d5356e4b..770d7d22 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -3298,7 +3298,7 @@ extension SpanAttribute where Self: EmptyNode { } } -/// A type that provides the `hasSpellCheck` modifier. +/// A type that provides the `spellcheck` modifier. @_documentation(visibility: internal) public protocol SpellCheckAttribute: Attribute { @@ -3306,13 +3306,13 @@ public protocol SpellCheckAttribute: Attribute { /// /// ```swift /// Input() - /// .hasSpellCheck(false) + /// .spellcheck(false) /// ``` /// - /// - Parameter condition: Whether to spellcheck the content. + /// - Parameter value: Whether to spellcheck the content. /// /// - Returns: The element - func hasSpellCheck(_ condition: Bool) -> Self + func spellcheck(_ value: Bool) -> Self } extension SpellCheckAttribute where Self: ContentNode { diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index 47c0c814..54a106a5 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -220,9 +220,14 @@ extension Html: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Html { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Html { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Html { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index 2accb4ae..fa851960 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -312,9 +312,14 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Article { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Article { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Article { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -622,9 +627,14 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Section { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Section { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Section { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -934,9 +944,14 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Navigation { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Navigation { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Navigation { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1242,9 +1257,14 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Aside { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Aside { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Aside { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1547,10 +1567,15 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading1 { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Heading1 { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Heading1 { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -1859,10 +1884,15 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading2 { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Heading2 { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Heading2 { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -2171,9 +2201,14 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading3 { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Heading3 { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Heading3 { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -2483,9 +2518,14 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading4 { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Heading4 { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Heading4 { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -2795,9 +2835,14 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading5 { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Heading5 { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Heading5 { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -3107,9 +3152,14 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Heading6 { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Heading6 { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Heading6 { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -3424,9 +3474,14 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> HeadingGroup { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> HeadingGroup { + return mutate(spellcheck: value) + } public func style(_ value: String) -> HeadingGroup { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -3730,9 +3785,14 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Header { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Header { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Header { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -4034,9 +4094,14 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Footer { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Footer { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Footer { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -4345,9 +4410,14 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Address { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Address { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Address { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -4649,10 +4719,15 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut public func role(_ value: Values.Role) -> Paragraph { return mutate(role: value.rawValue) } - + + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Paragraph { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Paragraph { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Paragraph { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -4959,9 +5034,14 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> HorizontalRule { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> HorizontalRule { + return mutate(spellcheck: value) + } public func style(_ value: String) -> HorizontalRule { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -5270,9 +5350,14 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> PreformattedText { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> PreformattedText { + return mutate(spellcheck: value) + } public func style(_ value: String) -> PreformattedText { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -5575,9 +5660,14 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Blockquote { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Blockquote { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Blockquote { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -5896,9 +5986,14 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> OrderedList { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> OrderedList { + return mutate(spellcheck: value) + } public func style(_ value: String) -> OrderedList { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -6218,9 +6313,14 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> UnorderedList { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> UnorderedList { + return mutate(spellcheck: value) + } public func style(_ value: String) -> UnorderedList { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -6534,10 +6634,15 @@ extension Menu: GlobalAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Menu { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Menu { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Menu { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -6750,9 +6855,14 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> DescriptionList { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> DescriptionList { + return mutate(spellcheck: value) + } public func style(_ value: String) -> DescriptionList { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -7060,9 +7170,14 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Figure { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Figure { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Figure { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -7367,9 +7482,14 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Anchor { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Anchor { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Anchor { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -7727,9 +7847,14 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Emphasize { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Emphasize { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Emphasize { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -8034,9 +8159,14 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Strong { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Strong { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Strong { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -8341,9 +8471,14 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Small { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Small { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Small { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -8655,9 +8790,14 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> StrikeThrough { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> StrikeThrough { + return mutate(spellcheck: value) + } public func style(_ value: String) -> StrikeThrough { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -8901,9 +9041,14 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Main { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Main { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Main { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -9213,10 +9358,15 @@ extension Search: GlobalAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Search { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Search { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Search { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -9422,9 +9572,14 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Division { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Division { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Division { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -9732,9 +9887,14 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Definition { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Definition { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Definition { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -10040,9 +10200,14 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Cite { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Cite { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Cite { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -10347,9 +10512,14 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> ShortQuote { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> ShortQuote { + return mutate(spellcheck: value) + } public func style(_ value: String) -> ShortQuote { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -10659,9 +10829,14 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Abbreviation { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Abbreviation { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Abbreviation { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -10967,10 +11142,15 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Ruby { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Ruby { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Ruby { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -11277,9 +11457,14 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Data { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Data { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Data { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -11598,10 +11783,15 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D public func role(_ value: Values.Role) -> Time { return mutate(role: value.rawValue) } - + + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Time { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Time { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Time { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -11912,9 +12102,14 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Code { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Code { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Code { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -12221,9 +12416,14 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Variable { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Variable { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Variable { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -12526,9 +12726,14 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> SampleOutput { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> SampleOutput { + return mutate(spellcheck: value) + } public func style(_ value: String) -> SampleOutput { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -12835,9 +13040,14 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> KeyboardInput { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> KeyboardInput { + return mutate(spellcheck: value) + } public func style(_ value: String) -> KeyboardInput { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -13143,9 +13353,14 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Subscript { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Subscript { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Subscript { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -13452,9 +13667,14 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Superscript { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Superscript { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Superscript { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -13761,9 +13981,14 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Italic { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Italic { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Italic { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -14077,9 +14302,14 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Bold { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Bold { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Bold { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -14393,9 +14623,14 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Underline { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Underline { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Underline { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -14709,9 +14944,14 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Mark { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Mark { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Mark { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -15018,9 +15258,14 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Bdi { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Bdi { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Bdi { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -15321,9 +15566,14 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Bdo { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Bdo { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Bdo { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -15626,9 +15876,14 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Span { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Span { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Span { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -15922,9 +16177,14 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> LineBreak { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> LineBreak { + return mutate(spellcheck: value) + } public func style(_ value: String) -> LineBreak { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -16222,9 +16482,14 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> WordBreak { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> WordBreak { + return mutate(spellcheck: value) + } public func style(_ value: String) -> WordBreak { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -16527,9 +16792,14 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> InsertedText { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> InsertedText { + return mutate(spellcheck: value) + } public func style(_ value: String) -> InsertedText { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -16840,9 +17110,14 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> DeletedText { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> DeletedText { + return mutate(spellcheck: value) + } public func style(_ value: String) -> DeletedText { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -17158,9 +17433,14 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Picture { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Picture { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Picture { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -17389,9 +17669,14 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Image { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Image { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Image { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -17765,9 +18050,14 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> InlineFrame { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> InlineFrame { + return mutate(spellcheck: value) + } public func style(_ value: String) -> InlineFrame { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -18107,9 +18397,14 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Embed { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Embed { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Embed { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -18433,9 +18728,14 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Object { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Object { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Object { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -18764,9 +19064,14 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Video { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Video { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Video { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -19134,9 +19439,14 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Audio { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Audio { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Audio { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -19485,9 +19795,14 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Map { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Map { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Map { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -19724,9 +20039,14 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Form { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Form { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Form { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -20078,9 +20398,14 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> DataList { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> DataList { + return mutate(spellcheck: value) + } public func style(_ value: String) -> DataList { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -20385,9 +20710,14 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Output { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Output { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Output { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -20704,9 +21034,14 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Progress { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Progress { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Progress { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -21029,10 +21364,15 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, public func role(_ value: Values.Role) -> Meter { return mutate(role: value.rawValue) } - + + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Meter { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Meter { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Meter { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -21373,9 +21713,14 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Details { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Details { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Details { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -21691,9 +22036,14 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Dialog { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Dialog { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Dialog { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -22016,9 +22366,14 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Script { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Script { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Script { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -22275,9 +22630,14 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> NoScript { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> NoScript { + return mutate(spellcheck: value) + } public func style(_ value: String) -> NoScript { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -22511,9 +22871,14 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Template { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Template { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Template { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -22740,9 +23105,14 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Canvas { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Canvas { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Canvas { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -23060,9 +23430,14 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Table { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Table { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Table { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -23513,10 +23888,15 @@ extension Slot: GlobalAttributes, NameAttribute { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Slot { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Slot { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Slot { return mutate(style: TaintedString(value, as: .css(.attribute))) } diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index 3bbcb62f..c546d636 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -176,9 +176,14 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TermName { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TermName { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TermName { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -486,9 +491,14 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TermDefinition { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TermDefinition { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TermDefinition { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index 7dbbdfb4..a3fbfe97 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -172,9 +172,14 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> FigureCaption { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> FigureCaption { + return mutate(spellcheck: value) + } public func style(_ value: String) -> FigureCaption { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index f480bb8d..700cb596 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -160,9 +160,14 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Input { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Input { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Input { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -582,9 +587,14 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Label { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Label { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Label { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -907,9 +917,14 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Select { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Select { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Select { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1190,9 +1205,14 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TextArea { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TextArea { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TextArea { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1586,9 +1606,14 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Button { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Button { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Button { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1954,9 +1979,14 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Fieldset { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Fieldset { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Fieldset { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index 28f8f29a..127db39d 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -165,10 +165,15 @@ extension Title: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Title { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Title { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Title { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -396,10 +401,15 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Base { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Base { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Base { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -627,9 +637,14 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Meta { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Meta { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Meta { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -893,9 +908,14 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Style { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Style { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Style { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1151,9 +1171,14 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Link { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Link { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Link { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index f4bf90fb..743f746c 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -163,10 +163,15 @@ extension Head: GlobalAttributes, GlobalEventAttributes { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Head { return mutate(spellcheck: value) } + public func spellcheck(_ value: Bool = true) -> Head { + return mutate(spellcheck: value) + } + public func style(_ value: String) -> Head { return mutate(style: TaintedString(value, as: .css(.attribute))) } @@ -397,9 +402,14 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Body { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Body { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Body { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index 6e66874c..9d9d2022 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -178,9 +178,14 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> OptionGroup { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> OptionGroup { + return mutate(spellcheck: value) + } public func style(_ value: String) -> OptionGroup { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -499,9 +504,14 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Option { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Option { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Option { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -854,9 +864,14 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Legend { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Legend { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Legend { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1164,9 +1179,14 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Summary { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Summary { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Summary { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index 11ee6b9b..87c2111e 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -172,9 +172,14 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> ListItem { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> ListItem { + return mutate(spellcheck: value) + } public func style(_ value: String) -> ListItem { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index 4b1f1001..4407430f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -167,9 +167,14 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Area { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Area { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Area { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index 38ce5c0f..6907143d 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -159,9 +159,14 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Source { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Source { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Source { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -440,9 +445,14 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Track { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Track { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Track { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index d110f90b..45c81c2a 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -163,9 +163,14 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Parameter { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Parameter { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Parameter { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index d4c2fc10..ac526d13 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -174,9 +174,14 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> RubyText { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> RubyText { + return mutate(spellcheck: value) + } public func style(_ value: String) -> RubyText { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -488,9 +493,15 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> RubyPronunciation { return mutate(spellcheck: value) } + + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") + public func spellcheck(_ value: Bool = true) -> RubyPronunciation { + return mutate(spellcheck: value) + } public func style(_ value: String) -> RubyPronunciation { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index 45cdd7ab..eccdd765 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -197,9 +197,14 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Caption { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Caption { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Caption { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -506,9 +511,14 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> ColumnGroup { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> ColumnGroup { + return mutate(spellcheck: value) + } public func style(_ value: String) -> ColumnGroup { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -740,9 +750,14 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> Column { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> Column { + return mutate(spellcheck: value) + } public func style(_ value: String) -> Column { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -978,9 +993,14 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TableBody { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TableBody { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TableBody { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1304,9 +1324,14 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TableHead { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TableHead { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TableHead { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1629,10 +1654,15 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut public func role(_ value: Values.Role) -> TableFoot { return mutate(role: value.rawValue) } - + + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TableFoot { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TableFoot { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TableFoot { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -1942,9 +1972,14 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> TableRow { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> TableRow { + return mutate(spellcheck: value) + } public func style(_ value: String) -> TableRow { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -2259,9 +2294,14 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> DataCell { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> DataCell { + return mutate(spellcheck: value) + } public func style(_ value: String) -> DataCell { return mutate(style: TaintedString(value, as: .css(.attribute))) @@ -2580,9 +2620,14 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(role: value.rawValue) } + @available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.") public func hasSpellCheck(_ value: Bool) -> HeaderCell { return mutate(spellcheck: value) } + + public func spellcheck(_ value: Bool = true) -> HeaderCell { + return mutate(spellcheck: value) + } public func style(_ value: String) -> HeaderCell { return mutate(style: TaintedString(value, as: .css(.attribute))) diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 9d899a0a..bf69b966 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -131,7 +131,7 @@ final class AttributesTests: XCTestCase { return self.mutate(role: value.rawValue) } - func hasSpellCheck(_ value: Bool) -> Tag { + func spellcheck(_ value: Bool = true) -> Tag { return self.mutate(spellcheck: value) } @@ -1090,11 +1090,15 @@ final class AttributesTests: XCTestCase { func testHasSpellCheckAttribute() throws { let view = TestView { - Tag {}.hasSpellCheck(true) + Tag {}.spellcheck() + Tag {}.spellcheck(false) + Tag {}.spellcheck(true) } XCTAssertEqual(try renderer.render(view: view), """ + \ + \ """ ) From b5e7112c0feaa47a057b55ddc00fc8bae0470740 Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Sun, 30 Nov 2025 16:16:42 +0100 Subject: [PATCH 5/9] Revise the translate attribute --- .../Attributes/BasicAttributes.swift | 4 +- .../Abstraction/Elements/BasicElements.swift | 10 + .../Abstraction/Elements/BodyElements.swift | 760 ++++++++++++++++++ .../Elements/DefinitionElements.swift | 20 + .../Abstraction/Elements/FigureElements.swift | 10 + .../Abstraction/Elements/FormElements.swift | 60 ++ .../Abstraction/Elements/HeadElements.swift | 50 ++ .../Abstraction/Elements/HtmlElements.swift | 20 + .../Abstraction/Elements/InputElements.swift | 40 + .../Abstraction/Elements/ListElements.swift | 10 + .../Abstraction/Elements/MapElements.swift | 10 + .../Abstraction/Elements/MediaElements.swift | 20 + .../Abstraction/Elements/ObjectElements.swift | 10 + .../Abstraction/Elements/RubyElements.swift | 20 + .../Abstraction/Elements/TableElements.swift | 90 +++ Tests/HTMLKitTests/AttributesTests.swift | 15 +- 16 files changed, 1144 insertions(+), 5 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index 770d7d22..49097f45 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -3708,13 +3708,13 @@ public protocol TranslateAttribute: Attribute { /// Paragraph { /// "Lorem ipsum..." /// } - /// .translate(.no) + /// .translate(true) /// ``` /// /// - Parameter value: Whether to exclude the content from translation. /// /// - Returns: The element - func translate(_ value: Values.Decision) -> Self + func translate(_ value: Bool) -> Self } extension TranslateAttribute where Self: ContentNode { diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift index 54a106a5..c3761e45 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift @@ -250,10 +250,20 @@ extension Html: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Html { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Html { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Html { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index fa851960..1cf61d77 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -342,10 +342,20 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Article { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Article { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Article { if condition { @@ -657,10 +667,20 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Section { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Section { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Section { if condition { @@ -974,10 +994,20 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Navigation { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Navigation { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Navigation { if condition { @@ -1287,10 +1317,20 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Aside { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Aside { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Aside { if condition { @@ -1597,10 +1637,20 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading1 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading1 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading1 { if condition { @@ -1914,10 +1964,20 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading2 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading2 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading2 { if condition { @@ -2231,10 +2291,20 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading3 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading3 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading3 { if condition { @@ -2548,10 +2618,20 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading4 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading4 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading4 { if condition { @@ -2865,10 +2945,20 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading5 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading5 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading5 { if condition { @@ -3182,10 +3272,20 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Heading6 { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Heading6 { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Heading6 { if condition { @@ -3504,10 +3604,20 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> HeadingGroup { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> HeadingGroup { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> HeadingGroup { if condition { @@ -3815,10 +3925,20 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Header { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Header { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Header { if condition { @@ -4124,10 +4244,20 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Footer { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Footer { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Footer { if condition { @@ -4440,10 +4570,20 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Address { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Address { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Address { if condition { @@ -4750,10 +4890,20 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Paragraph { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Paragraph { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Paragraph { if condition { @@ -5064,10 +5214,20 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> HorizontalRule { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> HorizontalRule { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> HorizontalRule { if condition { @@ -5380,10 +5540,20 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> PreformattedText { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> PreformattedText { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> PreformattedText { if condition { @@ -5690,10 +5860,20 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Blockquote { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Blockquote { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Blockquote { if condition { @@ -6016,10 +6196,20 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> OrderedList { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> OrderedList { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> OrderedList { if condition { @@ -6343,10 +6533,20 @@ extension UnorderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> UnorderedList { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> UnorderedList { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> UnorderedList { if condition { @@ -6664,10 +6864,20 @@ extension Menu: GlobalAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Menu { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Menu { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Menu { if condition { @@ -6885,10 +7095,20 @@ extension DescriptionList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAt return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> DescriptionList { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> DescriptionList { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> DescriptionList { if condition { @@ -7200,10 +7420,20 @@ extension Figure: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Figure { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Figure { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Figure { if condition { @@ -7512,10 +7742,20 @@ extension Anchor: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Anchor { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Anchor { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Anchor { if condition { @@ -7877,10 +8117,20 @@ extension Emphasize: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Emphasize { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Emphasize { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Emphasize { if condition { @@ -8189,10 +8439,20 @@ extension Strong: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Strong { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Strong { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Strong { if condition { @@ -8501,10 +8761,20 @@ extension Small: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Small { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Small { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Small { if condition { @@ -8820,10 +9090,20 @@ extension StrikeThrough: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> StrikeThrough { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> StrikeThrough { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> StrikeThrough { if condition { @@ -9071,10 +9351,20 @@ extension Main: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Main { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Main { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Main { if condition { @@ -9388,10 +9678,20 @@ extension Search: GlobalAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Search { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Search { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Search { if condition { @@ -9602,10 +9902,20 @@ extension Division: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Division { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Division { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Division { if condition { @@ -9917,10 +10227,20 @@ extension Definition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Definition { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Definition { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Definition { if condition { @@ -10230,10 +10550,20 @@ extension Cite: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Cite { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Cite { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Cite { if condition { @@ -10542,10 +10872,20 @@ extension ShortQuote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> ShortQuote { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> ShortQuote { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> ShortQuote { if condition { @@ -10859,10 +11199,20 @@ extension Abbreviation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Abbreviation { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Abbreviation { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Abbreviation { if condition { @@ -11172,10 +11522,20 @@ extension Ruby: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Ruby { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Ruby { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Ruby { if condition { @@ -11487,10 +11847,20 @@ extension Data: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, V return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Data { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Data { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Data { if condition { @@ -11814,10 +12184,20 @@ extension Time: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, D return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Time { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Time { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Time { if condition { @@ -12132,10 +12512,20 @@ extension Code: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Code { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Code { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Code { if condition { @@ -12446,10 +12836,20 @@ extension Variable: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Variable { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Variable { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Variable { if condition { @@ -12756,10 +13156,20 @@ extension SampleOutput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> SampleOutput { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> SampleOutput { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> SampleOutput { if condition { @@ -13070,10 +13480,20 @@ extension KeyboardInput: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> KeyboardInput { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> KeyboardInput { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> KeyboardInput { if condition { @@ -13383,10 +13803,20 @@ extension Subscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Subscript { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Subscript { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Subscript { if condition { @@ -13697,10 +14127,20 @@ extension Superscript: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Superscript { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Superscript { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Superscript { if condition { @@ -14011,10 +14451,20 @@ extension Italic: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Italic { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Italic { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Italic { if condition { @@ -14332,10 +14782,20 @@ extension Bold: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Bold { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Bold { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Bold { if condition { @@ -14653,10 +15113,20 @@ extension Underline: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Underline { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Underline { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Underline { if condition { @@ -14974,10 +15444,20 @@ extension Mark: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Mark { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Mark { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Mark { if condition { @@ -15288,10 +15768,20 @@ extension Bdi: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Bdi { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Bdi { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Bdi { if condition { @@ -15596,10 +16086,20 @@ extension Bdo: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Bdo { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Bdo { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Bdo { if condition { @@ -15906,10 +16406,20 @@ extension Span: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Span { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Span { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Span { if condition { @@ -16207,10 +16717,20 @@ extension LineBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> LineBreak { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> LineBreak { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> LineBreak { if condition { @@ -16512,10 +17032,20 @@ extension WordBreak: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> WordBreak { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> WordBreak { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> WordBreak { if condition { @@ -16822,10 +17352,20 @@ extension InsertedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> InsertedText { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> InsertedText { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> InsertedText { if condition { @@ -17140,10 +17680,20 @@ extension DeletedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> DeletedText { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> DeletedText { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> DeletedText { if condition { @@ -17463,10 +18013,20 @@ extension Picture: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Picture { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Picture { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Picture { if condition { @@ -17699,10 +18259,20 @@ extension Image: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Image { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Image { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Image { if condition { @@ -18080,10 +18650,20 @@ extension InlineFrame: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> InlineFrame { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> InlineFrame { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> InlineFrame { if condition { @@ -18427,10 +19007,20 @@ extension Embed: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Embed { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Embed { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Embed { if condition { @@ -18758,10 +19348,20 @@ extension Object: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Object { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Object { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Object { if condition { @@ -19094,10 +19694,20 @@ extension Video: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Video { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Video { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Video { if condition { @@ -19469,10 +20079,20 @@ extension Audio: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Audio { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Audio { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Audio { if condition { @@ -19825,10 +20445,20 @@ extension Map: GlobalAttributes, GlobalEventAttributes, NameAttribute { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Map { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Map { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Map { if condition { @@ -20069,10 +20699,20 @@ extension Form: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Form { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Form { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Form { if condition { @@ -20428,10 +21068,20 @@ extension DataList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> DataList { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> DataList { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> DataList { if condition { @@ -20740,10 +21390,20 @@ extension Output: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Output { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Output { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Output { if condition { @@ -21064,10 +21724,20 @@ extension Progress: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Progress { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Progress { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Progress { if condition { @@ -21395,10 +22065,20 @@ extension Meter: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Meter { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Meter { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Meter { if condition { @@ -21743,8 +22423,18 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Details { return mutate(translate: value.rawValue) + } + + public func translate(_ value: Bool = true) -> Details { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") } public func inert(_ condition: Bool = true) -> Details { @@ -22066,10 +22756,20 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Dialog { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Dialog { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Dialog { if condition { @@ -22396,10 +23096,20 @@ extension Script: GlobalAttributes, GlobalEventAttributes, AsynchronouslyAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Script { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Script { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Script { if condition { @@ -22660,10 +23370,20 @@ extension NoScript: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> NoScript { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> NoScript { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> NoScript { if condition { @@ -22901,10 +23621,20 @@ extension Template: GlobalAttributes, GlobalEventAttributes, ShadowRootModeAttri return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Template { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Template { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Template { if condition { @@ -23135,10 +23865,20 @@ extension Canvas: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Canvas { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Canvas { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Canvas { if condition { @@ -23460,10 +24200,20 @@ extension Table: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Table { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Table { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Table { if condition { @@ -23918,10 +24668,20 @@ extension Slot: GlobalAttributes, NameAttribute { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Slot { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Slot { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Slot { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift index c546d636..5bfeaab2 100644 --- a/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/DefinitionElements.swift @@ -206,10 +206,20 @@ extension TermName: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TermName { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TermName { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TermName { if condition { @@ -521,10 +531,20 @@ extension TermDefinition: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TermDefinition { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TermDefinition { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TermDefinition { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift index a3fbfe97..41490124 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FigureElements.swift @@ -202,10 +202,20 @@ extension FigureCaption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttr return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> FigureCaption { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> FigureCaption { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> FigureCaption { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift index 700cb596..253a8618 100644 --- a/Sources/HTMLKit/Abstraction/Elements/FormElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/FormElements.swift @@ -190,10 +190,20 @@ extension Input: GlobalAttributes, GlobalEventAttributes, AcceptAttribute, Alter return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Input { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Input { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Input { if condition { @@ -617,10 +627,20 @@ extension Label: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Label { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Label { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Label { if condition { @@ -947,10 +967,20 @@ extension Select: GlobalAttributes, GlobalEventAttributes, AutocompleteAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Select { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Select { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Select { if condition { @@ -1235,10 +1265,20 @@ extension TextArea: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TextArea { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TextArea { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TextArea { if condition { @@ -1636,10 +1676,20 @@ extension Button: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Button { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Button { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Button { if condition { @@ -2009,10 +2059,20 @@ extension Fieldset: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Fieldset { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Fieldset { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Fieldset { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift index 127db39d..ca125800 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HeadElements.swift @@ -195,10 +195,20 @@ extension Title: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Title { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Title { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Title { if condition { @@ -431,10 +441,20 @@ extension Base: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Tar return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Base { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Base { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Base { if condition { @@ -667,10 +687,20 @@ extension Meta: GlobalAttributes, GlobalEventAttributes, ContentAttribute, NameA return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Meta { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Meta { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Meta { if condition { @@ -938,10 +968,20 @@ extension Style: GlobalAttributes, GlobalEventAttributes, TypeAttribute, MediaAt return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Style { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Style { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Style { if condition { @@ -1201,10 +1241,20 @@ extension Link: GlobalAttributes, GlobalEventAttributes, ReferenceAttribute, Ref return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Link { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Link { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Link { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift index 743f746c..563f12be 100644 --- a/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/HtmlElements.swift @@ -193,10 +193,20 @@ extension Head: GlobalAttributes, GlobalEventAttributes { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Head { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Head { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Head { if condition { @@ -432,9 +442,19 @@ extension Body: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, W return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Body { return mutate(translate: value.rawValue) } + + public func translate(_ value: Bool = true) -> Body { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } public func inert(_ condition: Bool = true) -> Body { diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index 9d9d2022..50143f12 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -208,10 +208,20 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return mutate(title: LocalizedString(key: localizedKey, table: tableName)) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> OptionGroup { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> OptionGroup { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> OptionGroup { if condition { @@ -534,10 +544,20 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Option { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Option { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Option { if condition { @@ -894,10 +914,20 @@ extension Legend: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Legend { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Legend { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Legend { if condition { @@ -1209,10 +1239,20 @@ extension Summary: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Summary { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Summary { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Summary { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift index 87c2111e..3798a920 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ListElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ListElements.swift @@ -202,10 +202,20 @@ extension ListItem: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> ListItem { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> ListItem { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> ListItem { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift index 4407430f..7a6cf5db 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MapElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MapElements.swift @@ -197,10 +197,20 @@ extension Area: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, A return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Area { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Area { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Area { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index 6907143d..c4a1395f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -189,10 +189,20 @@ extension Source: GlobalAttributes, GlobalEventAttributes, TypeAttribute, Source return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Source { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Source { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Source { if condition { @@ -475,10 +485,20 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Track { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Track { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Track { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift index 45c81c2a..4628328e 100644 --- a/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/ObjectElements.swift @@ -193,10 +193,20 @@ extension Parameter: GlobalAttributes, GlobalEventAttributes, NameAttribute, Val return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Parameter { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Parameter { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Parameter { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift index ac526d13..26370d05 100644 --- a/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/RubyElements.swift @@ -204,10 +204,20 @@ extension RubyText: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> RubyText { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> RubyText { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> RubyText { if condition { @@ -524,10 +534,20 @@ extension RubyPronunciation: GlobalAttributes, GlobalEventAttributes, GlobalAria return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> RubyPronunciation { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> RubyPronunciation { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> RubyPronunciation { if condition { diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index eccdd765..927ac4ea 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -227,10 +227,20 @@ extension Caption: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Caption { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Caption { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Caption { if condition { @@ -541,10 +551,20 @@ extension ColumnGroup: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> ColumnGroup { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> ColumnGroup { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> ColumnGroup { if condition { @@ -780,10 +800,20 @@ extension Column: GlobalAttributes, GlobalEventAttributes, SpanAttribute { return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> Column { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> Column { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> Column { if condition { @@ -1023,10 +1053,20 @@ extension TableBody: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TableBody { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TableBody { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TableBody { if condition { @@ -1354,10 +1394,20 @@ extension TableHead: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TableHead { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TableHead { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TableHead { if condition { @@ -1685,10 +1735,20 @@ extension TableFoot: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TableFoot { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TableFoot { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TableFoot { if condition { @@ -2002,10 +2062,20 @@ extension TableRow: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> TableRow { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> TableRow { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> TableRow { if condition { @@ -2324,10 +2394,20 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> DataCell { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> DataCell { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> DataCell { if condition { @@ -2650,10 +2730,20 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(title: value) } + @available(*, deprecated, message: "Use the translate(_:) modifier instead.") public func translate(_ value: Values.Decision) -> HeaderCell { return mutate(translate: value.rawValue) } + public func translate(_ value: Bool = true) -> HeaderCell { + + if value { + return mutate(translate: "yes") + } + + return mutate(translate: "no") + } + public func inert(_ condition: Bool = true) -> HeaderCell { if condition { diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index bf69b966..19814d4e 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -156,8 +156,13 @@ final class AttributesTests: XCTestCase { return self.mutate(title: value) } - func translate(_ value: Values.Decision) -> Tag { - return self.mutate(translate: value.rawValue) + func translate(_ value: Bool = true) -> Tag { + + if value { + return self.mutate(translate: "yes") + } + + return self.mutate(translate: "no") } func accept(_ specifiers: [String]) -> Tag { @@ -1146,11 +1151,15 @@ final class AttributesTests: XCTestCase { func testTranslateAttribute() throws { let view = TestView { - Tag {}.translate(.yes) + Tag {}.translate() + Tag {}.translate(false) + Tag {}.translate(true) } XCTAssertEqual(try renderer.render(view: view), """ + \ + \ """ ) From b44a15426db009eaf24b51757438ffb20d3e2fe3 Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Tue, 2 Dec 2025 20:10:00 +0100 Subject: [PATCH 6/9] Make the label attribute localizable --- .../Attributes/BasicAttributes.swift | 37 +++++++++++++++++++ .../Abstraction/Elements/InputElements.swift | 18 +++++++++ .../Abstraction/Elements/MediaElements.swift | 9 +++++ Tests/HTMLKitTests/AttributesTests.swift | 9 +++++ 4 files changed, 73 insertions(+) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index 49097f45..e56b1610 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -1933,6 +1933,35 @@ public protocol LabelAttribute: Attribute { /// /// - Returns: The element func label(_ value: String) -> Self + + /// Specify a label for the element. + /// + /// ```swift + /// Track() + /// .source("...vtt") + /// .kind(.chapters) + /// .label("lorem") + /// ``` + /// + /// - Parameter localizedKey: The string key to be translated. + /// - Parameter tableName: The translation table to look in. + /// + /// - Returns: The element + func label(_ localizedKey: LocalizedStringKey, tableName: String?) -> Self + + /// Specify a label for the element without localization. + /// + /// ```swift + /// Track() + /// .source("...vtt") + /// .kind(.chapters) + /// .label(verbatim: "lorem") + /// ``` + /// + /// - Parameter value: The text to use as a label. + /// + /// - Returns: The element + func label(verbatim value: String) -> Self } extension LabelAttribute where Self: ContentNode { @@ -1940,6 +1969,10 @@ extension LabelAttribute where Self: ContentNode { internal func mutate(label value: String) -> Self { return self.mutate(key: "label", value: value) } + + internal func mutate(label value: LocalizedString) -> Self { + return self.mutate(key: "label", value: value) + } } extension LabelAttribute where Self: EmptyNode { @@ -1947,6 +1980,10 @@ extension LabelAttribute where Self: EmptyNode { internal func mutate(label value: String) -> Self { return self.mutate(key: "label", value: value) } + + internal func mutate(label value: LocalizedString) -> Self { + return self.mutate(key: "label", value: value) + } } /// A type that provides the `language` modifier. diff --git a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift index 50143f12..1d217926 100644 --- a/Sources/HTMLKit/Abstraction/Elements/InputElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/InputElements.swift @@ -240,10 +240,19 @@ extension OptionGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib return self } + @_disfavoredOverload public func label(_ value: String) -> OptionGroup { return mutate(label: value) } + public func label(_ localizedKey: LocalizedStringKey, tableName: String? = nil) -> OptionGroup { + return mutate(label: LocalizedString(key: localizedKey, table: tableName)) + } + + public func label(verbatim value: String) -> OptionGroup { + return mutate(label: value) + } + public func popover(_ value: Values.Popover.State) -> OptionGroup { return mutate(popover: value.rawValue) } @@ -576,10 +585,19 @@ extension Option: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } + @_disfavoredOverload public func label(_ value: String) -> Option { return mutate(label: value) } + public func label(_ localizedKey: LocalizedStringKey, tableName: String? = nil) -> Option { + return mutate(label: LocalizedString(key: localizedKey, table: tableName)) + } + + public func label(verbatim value: String) -> Option { + return mutate(label: value) + } + @_disfavoredOverload public func value(_ value: String) -> Option { return mutate(value: value) diff --git a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift index c4a1395f..a11d24b0 100644 --- a/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/MediaElements.swift @@ -524,10 +524,19 @@ extension Track: GlobalAttributes, GlobalEventAttributes, KindAttribute, SourceA return mutate(sourcelanguage: value.rawValue) } + @_disfavoredOverload public func label(_ value: String) -> Track { return mutate(label: value) } + public func label(_ localizedKey: LocalizedStringKey, tableName: String? = nil) -> Track { + return mutate(label: LocalizedString(key: localizedKey, table: tableName)) + } + + public func label(verbatim value: String) -> Track { + return mutate(label: value) + } + public func `default`() -> Track { return mutate(default: "default") } diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 19814d4e..a4c559f6 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -341,10 +341,19 @@ final class AttributesTests: XCTestCase { return self.mutate(kind: value.rawValue) } + @_disfavoredOverload func label(_ value: String) -> Tag { return self.mutate(label: value) } + func label(_ localizedKey: LocalizedStringKey, tableName: String? = nil) -> Tag { + return self.mutate(label: LocalizedString(key: localizedKey, table: tableName)) + } + + func label(verbatim value: String) -> Tag { + return self.mutate(label: value) + } + func list(_ value: String) -> Tag { return self.mutate(list: value) } From 1ef079c0a39264d6fe8546efd349136a3ace214e Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Tue, 2 Dec 2025 21:02:25 +0100 Subject: [PATCH 7/9] Revise the open attribute --- .../Attributes/BasicAttributes.swift | 10 ++--- .../Abstraction/Elements/BodyElements.swift | 38 +++++++++++++++++-- Tests/HTMLKitTests/AttributesTests.swift | 17 +++++++-- 3 files changed, 52 insertions(+), 13 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index e56b1610..a8d0f57d 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -2489,7 +2489,7 @@ extension NoValidateAttribute where Self: EmptyNode { } } -/// A type that provides the `isOpen` modifier. +/// A type that provides the `open` modifier. @_documentation(visibility: internal) public protocol OpenAttribute: Attribute { @@ -2504,25 +2504,25 @@ public protocol OpenAttribute: Attribute { /// "Lorem ipsum..." /// } /// } - /// .isOpen(true) + /// .open(true) /// ``` /// /// - Parameter condition: Whether the details should be open. /// /// - Returns: The element - func isOpen(_ condition: Bool) -> Self + func open(_ condition: Bool) -> Self } extension OpenAttribute where Self: ContentNode { - internal func mutate(open value: Bool) -> Self { + internal func mutate(open value: String) -> Self { return self.mutate(key: "open", value: value) } } extension OpenAttribute where Self: EmptyNode { - internal func mutate(open value: Bool) -> Self { + internal func mutate(open value: String) -> Self { return self.mutate(key: "open", value: value) } } diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift index 1cf61d77..a0b282dc 100644 --- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift @@ -22446,8 +22446,23 @@ extension Details: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes return self } - public func isOpen(_ value: Bool) -> Details { - return mutate(open: value) + @available(*, deprecated, message: "Use the open(_:) modifier instead.") + public func isOpen(_ condition: Bool = true) -> Details { + + if condition { + return mutate(open: "open") + } + + return self + } + + public func open(_ condition: Bool = true) -> Details { + + if condition { + return mutate(open: "open") + } + + return self } public func popover(_ value: Values.Popover.State) -> Details { @@ -22779,8 +22794,23 @@ extension Dialog: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, return self } - public func isOpen(_ value: Bool) -> Dialog { - return mutate(open: value) + @available(*, deprecated, message: "Use the open(_:) modifier instead.") + public func isOpen(_ condition: Bool) -> Dialog { + + if condition { + return mutate(open: "open") + } + + return self + } + + public func open(_ condition: Bool = true) -> Dialog { + + if condition { + return mutate(open: "open") + } + + return self } public func popover(_ value: Values.Popover.State) -> Dialog { diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index a4c559f6..2f4b4a59 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -419,8 +419,13 @@ final class AttributesTests: XCTestCase { return self.mutate(novalidate: "novalidate") } - func isOpen(_ value: Bool) -> Tag { - return self.mutate(open: value) + func open(_ condition: Bool = true) -> Tag { + + if condition { + return self.mutate(open: "open") + } + + return self } func optimum(_ value: Float) -> Tag { @@ -1849,12 +1854,16 @@ final class AttributesTests: XCTestCase { func testIsOpenAttribute() throws { let view = TestView { - Tag {}.isOpen(true) + Tag {}.open() + Tag {}.open(false) + Tag {}.open(true) } XCTAssertEqual(try renderer.render(view: view), """ - + \ + \ + """ ) } From a360a4d5f26268df6ff03b658ab2e8c8d5f9c6fc Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Tue, 2 Dec 2025 21:25:01 +0100 Subject: [PATCH 8/9] Revise the headers attribute --- .../Attributes/BasicAttributes.swift | 26 ++++++++++++++----- .../Abstraction/Elements/TableElements.swift | 20 +++++++++----- Tests/HTMLKitTests/AttributesTests.swift | 18 +++++++++---- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift index a8d0f57d..669b7703 100644 --- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift +++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift @@ -1245,7 +1245,7 @@ public protocol EquivalentAttribute: Attribute { func equivalent(_ value: Values.Equivalent) -> Self } -extension HeaderAttribute where Self: ContentNode { +extension EquivalentAttribute where Self: ContentNode { internal func mutate(httpequiv value: String) -> Self { return self.mutate(key: "http-equiv", value: value) @@ -1261,7 +1261,7 @@ extension EquivalentAttribute where Self: EmptyNode { /// A type that provides the `headers` modifier. @_documentation(visibility: internal) -public protocol HeaderAttribute: Attribute { +public protocol HeadersAttribute: Attribute { /// Specify the header cells for an element. /// @@ -1269,23 +1269,37 @@ public protocol HeaderAttribute: Attribute { /// DataCell { /// "Lorem ipsum..." /// } - /// .headers("ids") + /// .headers(["id", "id"]) /// ``` /// /// - Parameter ids: The identifiers of the cells to associate with. /// /// - Returns: The element - func headers(_ ids: String) -> Self + func headers(_ ids: [String]) -> Self + + /// Specify the header cells for an element. + /// + /// ```swift + /// DataCell { + /// "Lorem ipsum..." + /// } + /// .headers("id", "id") + /// ``` + /// + /// - Parameter ids: The identifiers of the cells to associate with. + /// + /// - Returns: The element + func headers(_ ids: String...) -> Self } -extension HeaderAttribute where Self: ContentNode { +extension HeadersAttribute where Self: ContentNode { internal func mutate(headers value: String) -> Self { return self.mutate(key: "headers", value: value) } } -extension HeaderAttribute where Self: EmptyNode { +extension HeadersAttribute where Self: EmptyNode { internal func mutate(headers value: String) -> Self { return self.mutate(key: "headers", value: value) diff --git a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift index 927ac4ea..f6786c0f 100644 --- a/Sources/HTMLKit/Abstraction/Elements/TableElements.swift +++ b/Sources/HTMLKit/Abstraction/Elements/TableElements.swift @@ -2250,7 +2250,7 @@ public struct DataCell: ContentNode, TableElement { } } -extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, ColumnSpanAttribute, RowSpanAttribute, HeaderAttribute { +extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, ColumnSpanAttribute, RowSpanAttribute, HeadersAttribute { public func accessKey(_ value: Character) -> DataCell { return mutate(accesskey: value) @@ -2425,8 +2425,12 @@ extension DataCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute return mutate(rowspan: size) } - public func headers(_ value: String) -> DataCell { - return mutate(headers: value) + public func headers(_ ids: [String]) -> DataCell { + return mutate(headers: ids.joined(separator: " ")) + } + + public func headers(_ ids: String...) -> DataCell { + return mutate(headers: ids.joined(separator: " ")) } public func popover(_ value: Values.Popover.State) -> DataCell { @@ -2586,7 +2590,7 @@ public struct HeaderCell: ContentNode, TableElement { } } -extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, ColumnSpanAttribute, RowSpanAttribute, HeaderAttribute, ScopeAttribute { +extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes, ColumnSpanAttribute, RowSpanAttribute, HeadersAttribute, ScopeAttribute { public func accessKey(_ value: Character) -> HeaderCell { return mutate(accesskey: value) @@ -2761,8 +2765,12 @@ extension HeaderCell: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu return mutate(rowspan: size) } - public func headers(_ value: String) -> HeaderCell { - return mutate(headers: value) + public func headers(_ ids: [String]) -> HeaderCell { + return mutate(headers: ids.joined(separator: " ")) + } + + public func headers(_ ids: String...) -> HeaderCell { + return mutate(headers: ids.joined(separator: " ")) } @available(*, unavailable, message: "Use the scope(_:) modifier instead.") diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index 2f4b4a59..c842af11 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -15,7 +15,7 @@ final class AttributesTests: XCTestCase { @ContentBuilder var body: Content } - typealias AllAttributes = AccessKeyAttribute & AcceptAttribute & ActionAttribute & AlternateAttribute & AsynchronouslyAttribute & AutocapitalizeAttribute & AutocompleteAttribute & AutofocusAttribute & AutoplayAttribute & CharsetAttribute & CheckedAttribute & CiteAttribute & ClassAttribute & ColumnsAttribute & ColumnSpanAttribute & ContentAttribute & EditAttribute & ControlsAttribute & CoordinatesAttribute & DataAttribute & DateTimeAttribute & DefaultAttribute & DeferAttribute & DirectionAttribute & DisabledAttribute & DownloadAttribute & DragAttribute & EncodingAttribute & EnterKeyHintAttribute & ForAttribute & FormAttribute & FormActionAttribute & EquivalentAttribute & HeaderAttribute & HeightAttribute & HiddenAttribute & HighAttribute & ReferenceAttribute & ReferenceLanguageAttribute & IdentifierAttribute & IsMapAttribute & InputModeAttribute & IsAttribute & ItemAttribute & ItemIdAttribute & ItemPropertyAttribute & ItemReferenceAttribute & ItemScopeAttribute & ItemTypeAttribute & KindAttribute & LabelAttribute & LanguageAttribute & ListAttribute & LoopAttribute & LowAttribute & MaximumValueAttribute & MaximumLengthAttribute & MediaAttribute & MethodAttribute & MinimumValueAttribute & MinimumLengthAttribute & MultipleAttribute & MutedAttribute & NameAttribute & NonceAttribute & NoValidateAttribute & OpenAttribute & OptimumAttribute & PatternAttribute & PartAttribute & PingAttribute & PlaceholderAttribute & PosterAttribute & PreloadAttribute & ReadOnlyAttribute & ReferrerPolicyAttribute & RelationshipAttribute & RequiredAttribute & ReversedAttribute & RoleAttribute & RowsAttribute & RowSpanAttribute & SandboxAttribute & ScopeAttribute & ShapeAttribute & SizeAttribute & SizesAttribute & SlotAttribute & SpanAttribute & SpellCheckAttribute & SourceAttribute & StartAttribute & StepAttribute & StyleAttribute & TabulatorAttribute & TargetAttribute & TitleAttribute & TranslateAttribute & TypeAttribute & ValueAttribute & WidthAttribute & WrapAttribute & PropertyAttribute & SelectedAttribute & WindowEventAttribute & FocusEventAttribute & PointerEventAttribute & MouseEventAttribute & WheelEventAttribute & InputEventAttribute & KeyboardEventAttribute & DragEventAttribute & ClipboardEventAttribute & SelectionEventAttribute & MediaEventAttribute & FormEventAttribute & DetailEventAttribute & AriaAtomicAttribute & AriaBusyAttribute & AriaControlsAttribute & AriaCurrentAttribute & AriaDescribedAttribute & AriaDetailsAttribute & AriaDisabledAttribute & AriaErrorMessageAttribute & AriaFlowToAttribute & AriaPopupAttribute & AriaHiddenAttribute & AriaInvalidAttribute & AriaShortcutsAttribute & AriaLabelAttribute & AriaLabeledAttribute & AriaLiveAttribute & AriaOwnsAttribute & AriaRelevantAttribute & AriaRoleDescriptionAttribute & DrawAttribute & FillAttribute & FillOpacityAttribute & StrokeAttribute & StrokeWidthAttribute & StrokeOpacityAttribute & StrokeLineCapAttribute & StrokeLineJoinAttribute & RadiusAttribute & PositionPointAttribute & RadiusPointAttribute & CenterPointAttribute & ViewBoxAttribute & NamespaceAttribute & PointsAttribute & ShadowRootModeAttribute & InertAttribute & FetchPriorityAttribute & LoadingAttribute & SourceSetAttribute & DecodingAttribute & BlockingAttribute & PopoverAttribute & PopoverTargetAttribute & PopoverActionAttribute & UseMapAttribute & PlaysInlineAttribute & IntegrityAttribute & AsAttribute & CrossOriginAttribute & SourceLanguageAttribute & SourceDocumentAttribute + typealias AllAttributes = AccessKeyAttribute & AcceptAttribute & ActionAttribute & AlternateAttribute & AsynchronouslyAttribute & AutocapitalizeAttribute & AutocompleteAttribute & AutofocusAttribute & AutoplayAttribute & CharsetAttribute & CheckedAttribute & CiteAttribute & ClassAttribute & ColumnsAttribute & ColumnSpanAttribute & ContentAttribute & EditAttribute & ControlsAttribute & CoordinatesAttribute & DataAttribute & DateTimeAttribute & DefaultAttribute & DeferAttribute & DirectionAttribute & DisabledAttribute & DownloadAttribute & DragAttribute & EncodingAttribute & EnterKeyHintAttribute & ForAttribute & FormAttribute & FormActionAttribute & EquivalentAttribute & HeadersAttribute & HeightAttribute & HiddenAttribute & HighAttribute & ReferenceAttribute & ReferenceLanguageAttribute & IdentifierAttribute & IsMapAttribute & InputModeAttribute & IsAttribute & ItemAttribute & ItemIdAttribute & ItemPropertyAttribute & ItemReferenceAttribute & ItemScopeAttribute & ItemTypeAttribute & KindAttribute & LabelAttribute & LanguageAttribute & ListAttribute & LoopAttribute & LowAttribute & MaximumValueAttribute & MaximumLengthAttribute & MediaAttribute & MethodAttribute & MinimumValueAttribute & MinimumLengthAttribute & MultipleAttribute & MutedAttribute & NameAttribute & NonceAttribute & NoValidateAttribute & OpenAttribute & OptimumAttribute & PatternAttribute & PartAttribute & PingAttribute & PlaceholderAttribute & PosterAttribute & PreloadAttribute & ReadOnlyAttribute & ReferrerPolicyAttribute & RelationshipAttribute & RequiredAttribute & ReversedAttribute & RoleAttribute & RowsAttribute & RowSpanAttribute & SandboxAttribute & ScopeAttribute & ShapeAttribute & SizeAttribute & SizesAttribute & SlotAttribute & SpanAttribute & SpellCheckAttribute & SourceAttribute & StartAttribute & StepAttribute & StyleAttribute & TabulatorAttribute & TargetAttribute & TitleAttribute & TranslateAttribute & TypeAttribute & ValueAttribute & WidthAttribute & WrapAttribute & PropertyAttribute & SelectedAttribute & WindowEventAttribute & FocusEventAttribute & PointerEventAttribute & MouseEventAttribute & WheelEventAttribute & InputEventAttribute & KeyboardEventAttribute & DragEventAttribute & ClipboardEventAttribute & SelectionEventAttribute & MediaEventAttribute & FormEventAttribute & DetailEventAttribute & AriaAtomicAttribute & AriaBusyAttribute & AriaControlsAttribute & AriaCurrentAttribute & AriaDescribedAttribute & AriaDetailsAttribute & AriaDisabledAttribute & AriaErrorMessageAttribute & AriaFlowToAttribute & AriaPopupAttribute & AriaHiddenAttribute & AriaInvalidAttribute & AriaShortcutsAttribute & AriaLabelAttribute & AriaLabeledAttribute & AriaLiveAttribute & AriaOwnsAttribute & AriaRelevantAttribute & AriaRoleDescriptionAttribute & DrawAttribute & FillAttribute & FillOpacityAttribute & StrokeAttribute & StrokeWidthAttribute & StrokeOpacityAttribute & StrokeLineCapAttribute & StrokeLineJoinAttribute & RadiusAttribute & PositionPointAttribute & RadiusPointAttribute & CenterPointAttribute & ViewBoxAttribute & NamespaceAttribute & PointsAttribute & ShadowRootModeAttribute & InertAttribute & FetchPriorityAttribute & LoadingAttribute & SourceSetAttribute & DecodingAttribute & BlockingAttribute & PopoverAttribute & PopoverTargetAttribute & PopoverActionAttribute & UseMapAttribute & PlaysInlineAttribute & IntegrityAttribute & AsAttribute & CrossOriginAttribute & SourceLanguageAttribute & SourceDocumentAttribute struct Tag: ContentNode, GlobalElement, AllAttributes { @@ -313,8 +313,12 @@ final class AttributesTests: XCTestCase { return self.mutate(httpequiv: value.rawValue) } - func headers(_ value: String) -> Tag { - return self.mutate(headers: value) + func headers(_ ids: [String]) -> Tag { + return self.mutate(headers: ids.joined(separator: " ")) + } + + func headers(_ ids: String...) -> Tag { + return self.mutate(headers: ids.joined(separator: " ")) } func height(_ size: Int) -> Tag { @@ -1542,12 +1546,16 @@ final class AttributesTests: XCTestCase { func testHeadersAttribute() throws { let view = TestView { - Tag {}.headers("name") + Tag {}.headers("id") + Tag {}.headers("id", "id") + Tag {}.headers(["id", "id"]) } XCTAssertEqual(try renderer.render(view: view), """ - + \ + \ + """ ) } From 070f48f68289cba82646afa3a08deddd5fe70b53 Mon Sep 17 00:00:00 2001 From: Mattes Mohr Date: Tue, 2 Dec 2025 21:33:27 +0100 Subject: [PATCH 9/9] Mark older deprecations as unavailable --- .../Abstraction/Tokens/ValueTokens.swift | 28 +++++++++---------- Tests/HTMLKitTests/AttributesTests.swift | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift b/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift index 5d8059df..a6b951cc 100644 --- a/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift +++ b/Sources/HTMLKit/Abstraction/Tokens/ValueTokens.swift @@ -860,7 +860,7 @@ public enum Values { /// Indicates a ressource preload. case preload - @available(*, deprecated, message: "It is no longer part of the web standards.") + @available(*, unavailable, message: "It is no longer part of the web standards.") case prerender /// Indicates a page pagination. @@ -875,7 +875,7 @@ public enum Values { /// Indicates a content tag. case tag - @available(*, deprecated, message: "It is no longer part of the web standards. Use 'icon' instead.") + @available(*, unavailable, message: "It is no longer part of the web standards. Use 'icon' instead.") case shortcutIcon = "shortcut icon" /// Indicates a touch icon. @@ -1222,7 +1222,7 @@ public enum Values { /// Indicates a select list. case combobox - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case command /// Indicates a text comment. @@ -1231,7 +1231,7 @@ public enum Values { /// Indicates a page aside. case complementary - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case composite /// Indicates a page footer. @@ -1243,7 +1243,7 @@ public enum Values { /// Indicates a dialog window. case dialog - @available(*, deprecated, message: "It is no longer part of the web standards. Use 'list' instead.") + @available(*, unavailable, message: "It is no longer part of the web standards. Use 'list' instead.") case directory /// Indicates a read mode. @@ -1273,10 +1273,10 @@ public enum Values { /// Indicates an image set. case img - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case input - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case landmark /// Indicates an item list. @@ -1339,13 +1339,13 @@ public enum Values { /// Indicates a radio select. case radio - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case range /// Indicates a content section. case region - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case roleType = "roletype" /// Indicates a table row. @@ -1366,10 +1366,10 @@ public enum Values { /// Indicates a search control. case searchBox = "searchbox" - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case sectionHead = "sectionhead" - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case select /// Indicates a content divider. @@ -1378,7 +1378,7 @@ public enum Values { /// Indicates a status mesage. case status - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case structure /// Indicates a content suggestion. @@ -1423,10 +1423,10 @@ public enum Values { /// Indicates a tree item. case treeItem = "treeitem" - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case widget - @available(*, deprecated, message: "It is an abstract role and should not be used.") + @available(*, unavailable, message: "It is an abstract role and should not be used.") case window } diff --git a/Tests/HTMLKitTests/AttributesTests.swift b/Tests/HTMLKitTests/AttributesTests.swift index c842af11..05e94807 100644 --- a/Tests/HTMLKitTests/AttributesTests.swift +++ b/Tests/HTMLKitTests/AttributesTests.swift @@ -1100,7 +1100,7 @@ final class AttributesTests: XCTestCase { func testRoleAttribute() throws { let view = TestView { - Tag {}.role(.range) + Tag {}.role(.alert) } XCTAssertEqual(try renderer.render(view: view),