diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5bcddf99..b41ef696 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,7 +9,7 @@ on:
jobs:
test-pushpull:
runs-on: ubuntu-latest
- container: swift:5.6-focal
+ container: swift:5.7-focal
steps:
- uses: actions/checkout@v3
- name: Run tests
diff --git a/Package.swift b/Package.swift
index 03c2285e..d97ee005 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.6
+// swift-tools-version:5.7
import PackageDescription
diff --git a/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
index 3265f0fc..d85672c9 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/AriaAttributes.swift
@@ -9,7 +9,7 @@
public typealias GlobalAriaAttributes = AriaAtomicAttribute & AriaBusyAttribute & AriaControlsAttribute & AriaCurrentAttribute & AriaDescribedAttribute & AriaDetailsAttribute & AriaDisabledAttribute & AriaErrorMessageAttribute & AriaFlowToAttribute & AriaPopupAttribute & AriaHiddenAttribute & AriaInvalidAttribute & AriaShortcutsAttribute & AriaLabelAttribute & AriaLabeledAttribute & AriaLiveAttribute & AriaOwnsAttribute & AriaRelevantAttribute & AriaRoleDescriptionAttribute
/// The protocol provides the element with accessibility handler.
-public protocol AriaActiveDescendantAttribute: AnyAttribute {
+public protocol AriaActiveDescendantAttribute: Attribute {
/// The function represents the html-attribute 'aria-activedescendant'.
///
@@ -19,28 +19,23 @@ public protocol AriaActiveDescendantAttribute: AnyAttribute {
func aria(activeDescendant value: String) -> Self
}
-extension AriaActiveDescendantAttribute {
-
- internal var key: String { "aria-activedescendant" }
-}
-
extension AriaActiveDescendantAttribute where Self: ContentNode {
internal func mutate(ariaactivedescendant value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-activedescendant", value: value)
}
}
extension AriaActiveDescendantAttribute where Self: EmptyNode {
internal func mutate(ariaactivedescendant value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-activedescendant", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaAtomicAttribute: AnyAttribute {
+public protocol AriaAtomicAttribute: Attribute {
/// The function represents the html-attribute 'aria-atomic'.
///
@@ -50,27 +45,22 @@ public protocol AriaAtomicAttribute: AnyAttribute {
func aria(atomic value: Bool) -> Self
}
-extension AriaAtomicAttribute {
-
- internal var key: String { "aria-atomic" }
-}
-
extension AriaAtomicAttribute where Self: ContentNode {
internal func mutate(ariaatomic value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-atomic", value: value)
}
}
extension AriaAtomicAttribute where Self: EmptyNode {
internal func mutate(ariaatomic value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-atomic", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaAutoCompleteAttribute: AnyAttribute {
+public protocol AriaAutoCompleteAttribute: Attribute {
/// The function represents the html-attribute 'aria-autocomplete'.
///
@@ -80,27 +70,22 @@ public protocol AriaAutoCompleteAttribute: AnyAttribute {
func aria(autoComplete value: Values.Accessibility.Complete) -> Self
}
-extension AriaAutoCompleteAttribute {
-
- internal var key: String { "aria-autocomplete" }
-}
-
extension AriaAutoCompleteAttribute where Self: ContentNode {
internal func mutate(ariaautocomplete value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-autocomplete", value: value)
}
}
extension AriaAutoCompleteAttribute where Self: EmptyNode {
internal func mutate(ariaautocomplete value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-autocomplete", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaBusyAttribute: AnyAttribute {
+public protocol AriaBusyAttribute: Attribute {
/// The function represents the html-attribute 'aria-busy'.
///
@@ -110,27 +95,22 @@ public protocol AriaBusyAttribute: AnyAttribute {
func aria(busy value: Bool) -> Self
}
-extension AriaBusyAttribute {
-
- internal var key: String { "aria-busy" }
-}
-
extension AriaBusyAttribute where Self: ContentNode {
internal func mutate(ariabusy value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-busy", value: value)
}
}
extension AriaBusyAttribute where Self: EmptyNode {
internal func mutate(ariabusy value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-busy", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaCheckedAttribute: AnyAttribute {
+public protocol AriaCheckedAttribute: Attribute {
/// The function represents the html-attribute 'aria-checked'.
///
@@ -140,27 +120,22 @@ public protocol AriaCheckedAttribute: AnyAttribute {
func aria(checked value: Values.Accessibility.Check) -> Self
}
-extension AriaCheckedAttribute {
-
- internal var key: String { "aria-checked" }
-}
-
extension AriaCheckedAttribute where Self: ContentNode {
internal func mutate(ariachecked value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-checked", value: value)
}
}
extension AriaCheckedAttribute where Self: EmptyNode {
internal func mutate(ariachecked value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-checked", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaColumnCountAttribute: AnyAttribute {
+public protocol AriaColumnCountAttribute: Attribute {
/// The function represents the html-attribute 'aria-colcount'.
///
@@ -170,27 +145,22 @@ public protocol AriaColumnCountAttribute: AnyAttribute {
func aria(columnCount value: Int) -> Self
}
-extension AriaColumnCountAttribute {
-
- internal var key: String { "aria-colcount" }
-}
-
extension AriaColumnCountAttribute where Self: ContentNode {
internal func mutate(ariacolcount value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colcount", value: value)
}
}
extension AriaColumnCountAttribute where Self: EmptyNode {
internal func mutate(ariacolcount value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colcount", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaColumnIndexAttribute: AnyAttribute {
+public protocol AriaColumnIndexAttribute: Attribute {
/// The function represents the html-attribute 'aria-colindex'.
///
@@ -200,27 +170,22 @@ public protocol AriaColumnIndexAttribute: AnyAttribute {
func aria(columnIndex value: Int) -> Self
}
-extension AriaColumnIndexAttribute {
-
- internal var key: String { "aria-colindex" }
-}
-
extension AriaColumnIndexAttribute where Self: ContentNode {
internal func mutate(ariacolindex value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colindex", value: value)
}
}
extension AriaColumnIndexAttribute where Self: EmptyNode {
internal func mutate(ariacolindex value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colindex", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaColumnSpanAttribute: AnyAttribute {
+public protocol AriaColumnSpanAttribute: Attribute {
/// The function represents the html-attribute 'aria-colspan'.
///
@@ -230,27 +195,22 @@ public protocol AriaColumnSpanAttribute: AnyAttribute {
func aria(columnSpan value: Int) -> Self
}
-extension AriaColumnSpanAttribute {
-
- internal var key: String { "aria-colspan" }
-}
-
extension AriaColumnSpanAttribute where Self: ContentNode {
internal func mutate(ariacolspan value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colspan", value: value)
}
}
extension AriaColumnSpanAttribute where Self: EmptyNode {
internal func mutate(ariacolspan value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-colspan", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaControlsAttribute: AnyAttribute {
+public protocol AriaControlsAttribute: Attribute {
/// The function represents the html-attribute 'aria-controls'.
///
@@ -260,27 +220,22 @@ public protocol AriaControlsAttribute: AnyAttribute {
func aria(controls value: String) -> Self
}
-extension AriaControlsAttribute {
-
- internal var key: String { "aria-controls" }
-}
-
extension AriaControlsAttribute where Self: ContentNode {
internal func mutate(ariacontrols value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-controls", value: value)
}
}
extension AriaControlsAttribute where Self: EmptyNode {
internal func mutate(ariacontrols value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-controls", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaCurrentAttribute: AnyAttribute {
+public protocol AriaCurrentAttribute: Attribute {
/// The function represents the html-attribute 'aria-current'.
///
@@ -290,27 +245,22 @@ public protocol AriaCurrentAttribute: AnyAttribute {
func aria(current value: Values.Accessibility.Current) -> Self
}
-extension AriaCurrentAttribute {
-
- internal var key: String { "aria-current" }
-}
-
extension AriaCurrentAttribute where Self: ContentNode {
internal func mutate(ariacurrent value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-current", value: value)
}
}
extension AriaCurrentAttribute where Self: EmptyNode {
internal func mutate(ariacurrent value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-current", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaDescribedAttribute: AnyAttribute {
+public protocol AriaDescribedAttribute: Attribute {
/// The function represents the html-attribute 'aria-describedby'.
///
@@ -320,27 +270,22 @@ public protocol AriaDescribedAttribute: AnyAttribute {
func aria(describedBy value: String) -> Self
}
-extension AriaDescribedAttribute {
-
- internal var key: String { "aria-describedby" }
-}
-
extension AriaDescribedAttribute where Self: ContentNode {
internal func mutate(ariadescribedby value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-describedby", value: value)
}
}
extension AriaDescribedAttribute where Self: EmptyNode {
internal func mutate(ariadescribedby value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-describedby", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaDetailsAttribute: AnyAttribute {
+public protocol AriaDetailsAttribute: Attribute {
/// The function represents the html-attribute 'aria-details'.
///
@@ -350,27 +295,22 @@ public protocol AriaDetailsAttribute: AnyAttribute {
func aria(details value: String) -> Self
}
-extension AriaDetailsAttribute {
-
- internal var key: String { "aria-details" }
-}
-
extension AriaDetailsAttribute where Self: ContentNode {
internal func mutate(ariadetails value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-details", value: value)
}
}
extension AriaDetailsAttribute where Self: EmptyNode {
internal func mutate(ariadetails value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-details", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaDisabledAttribute: AnyAttribute {
+public protocol AriaDisabledAttribute: Attribute {
/// The function represents the html-attribute 'aria-disabled'.
///
@@ -380,27 +320,22 @@ public protocol AriaDisabledAttribute: AnyAttribute {
func aria(disabled value: Bool) -> Self
}
-extension AriaDisabledAttribute {
-
- internal var key: String { "aria-disabled" }
-}
-
extension AriaDisabledAttribute where Self: ContentNode {
internal func mutate(ariadisabled value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-disabled", value: value)
}
}
extension AriaDisabledAttribute where Self: EmptyNode {
internal func mutate(ariadisabled value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-disabled", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaErrorMessageAttribute: AnyAttribute {
+public protocol AriaErrorMessageAttribute: Attribute {
/// The function represents the html-attribute 'aria-errormessage'.
///
@@ -410,27 +345,22 @@ public protocol AriaErrorMessageAttribute: AnyAttribute {
func aria(errorMessage value: String) -> Self
}
-extension AriaErrorMessageAttribute {
-
- internal var key: String { "aria-errormessage" }
-}
-
extension AriaErrorMessageAttribute where Self: ContentNode {
internal func mutate(ariaerrormessage value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-errormessage", value: value)
}
}
extension AriaErrorMessageAttribute where Self: EmptyNode {
internal func mutate(ariaerrormessage value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-errormessage", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaExpandedAttribute: AnyAttribute {
+public protocol AriaExpandedAttribute: Attribute {
/// The function represents the html-attribute 'aria-expanded'.
///
@@ -440,27 +370,22 @@ public protocol AriaExpandedAttribute: AnyAttribute {
func aria(expanded value: Bool) -> Self
}
-extension AriaExpandedAttribute {
-
- internal var key: String { "aria-expanded" }
-}
-
extension AriaExpandedAttribute where Self: ContentNode {
internal func mutate(ariaexpanded value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-expanded", value: value)
}
}
extension AriaExpandedAttribute where Self: EmptyNode {
internal func mutate(ariaexpanded value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-expanded", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaFlowToAttribute: AnyAttribute {
+public protocol AriaFlowToAttribute: Attribute {
/// The function represents the html-attribute 'aria-flowto'.
///
@@ -470,27 +395,22 @@ public protocol AriaFlowToAttribute: AnyAttribute {
func aria(flowTo value: String) -> Self
}
-extension AriaFlowToAttribute {
-
- internal var key: String { "aria-flowto" }
-}
-
extension AriaFlowToAttribute where Self: ContentNode {
internal func mutate(ariaflowto value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-flowto", value: value)
}
}
extension AriaFlowToAttribute where Self: EmptyNode {
internal func mutate(ariaflowto value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-flowto", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaPopupAttribute: AnyAttribute {
+public protocol AriaPopupAttribute: Attribute {
/// The function represents the html-attribute 'aria-haspopup'.
///
@@ -500,27 +420,22 @@ public protocol AriaPopupAttribute: AnyAttribute {
func aria(hasPopup value: Values.Accessibility.Popup) -> Self
}
-extension AriaPopupAttribute {
-
- internal var key: String { "aria-haspopup" }
-}
-
extension AriaPopupAttribute where Self: ContentNode {
internal func mutate(ariahaspopup value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-haspopup", value: value)
}
}
extension AriaPopupAttribute where Self: EmptyNode {
internal func mutate(ariahaspopup value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-haspopup", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaHiddenAttribute: AnyAttribute {
+public protocol AriaHiddenAttribute: Attribute {
/// The function represents the html-attribute 'aria-hidden'.
///
@@ -530,27 +445,22 @@ public protocol AriaHiddenAttribute: AnyAttribute {
func aria(hidden value: Bool) -> Self
}
-extension AriaHiddenAttribute {
-
- internal var key: String { "aria-hidden" }
-}
-
extension AriaHiddenAttribute where Self: ContentNode {
internal func mutate(ariahidden value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-hidden", value: value)
}
}
extension AriaHiddenAttribute where Self: EmptyNode {
internal func mutate(ariahidden value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-hidden", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaInvalidAttribute: AnyAttribute {
+public protocol AriaInvalidAttribute: Attribute {
/// The function represents the html-attribute 'aria-invalid'.
///
@@ -560,27 +470,22 @@ public protocol AriaInvalidAttribute: AnyAttribute {
func aria(invalid value: Values.Accessibility.Invalid) -> Self
}
-extension AriaInvalidAttribute {
-
- internal var key: String { "aria-invalid" }
-}
-
extension AriaInvalidAttribute where Self: ContentNode {
internal func mutate(ariainvalid value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-invalid", value: value)
}
}
extension AriaInvalidAttribute where Self: EmptyNode {
internal func mutate(ariainvalid value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-invalid", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaShortcutsAttribute: AnyAttribute {
+public protocol AriaShortcutsAttribute: Attribute {
/// The function represents the html-attribute 'aria-keyshortcuts'.
///
@@ -590,27 +495,22 @@ public protocol AriaShortcutsAttribute: AnyAttribute {
func aria(keyShortcuts value: String) -> Self
}
-extension AriaShortcutsAttribute {
-
- internal var key: String { "aria-keyshortcuts" }
-}
-
extension AriaShortcutsAttribute where Self: ContentNode {
internal func mutate(ariakeyshortcuts value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-keyshortcuts", value: value)
}
}
extension AriaShortcutsAttribute where Self: EmptyNode {
internal func mutate(ariakeyshortcuts value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-keyshortcuts", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaLabelAttribute: AnyAttribute {
+public protocol AriaLabelAttribute: Attribute {
/// The function represents the html-attribute 'aria-label'.
///
@@ -620,27 +520,22 @@ public protocol AriaLabelAttribute: AnyAttribute {
func aria(label value: String) -> Self
}
-extension AriaLabelAttribute {
-
- internal var key: String { "aria-label" }
-}
-
extension AriaLabelAttribute where Self: ContentNode {
internal func mutate(arialabel value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-label", value: value)
}
}
extension AriaLabelAttribute where Self: EmptyNode {
internal func mutate(arialabel value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-label", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaLabeledAttribute: AnyAttribute {
+public protocol AriaLabeledAttribute: Attribute {
/// The function represents the html-attribute 'aria-labeledby'.
///
@@ -650,27 +545,22 @@ public protocol AriaLabeledAttribute: AnyAttribute {
func aria(labeledBy value: String) -> Self
}
-extension AriaLabeledAttribute {
-
- internal var key: String { "aria-labeledby" }
-}
-
extension AriaLabeledAttribute where Self: ContentNode {
internal func mutate(arialabeledby value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-labeledby", value: value)
}
}
extension AriaLabeledAttribute where Self: EmptyNode {
internal func mutate(arialabeledby value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-labeledby", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaLevelAttribute: AnyAttribute {
+public protocol AriaLevelAttribute: Attribute {
/// The function represents the html-attribute 'aria-level'.
///
@@ -680,27 +570,22 @@ public protocol AriaLevelAttribute: AnyAttribute {
func aria(level value: Int) -> Self
}
-extension AriaLevelAttribute {
-
- internal var key: String { "aria-level" }
-}
-
extension AriaLevelAttribute where Self: ContentNode {
internal func mutate(arialevel value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-level", value: value)
}
}
extension AriaLevelAttribute where Self: EmptyNode {
internal func mutate(arialevel value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-level", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaLiveAttribute: AnyAttribute {
+public protocol AriaLiveAttribute: Attribute {
/// The function represents the html-attribute 'aria-live'.
///
@@ -710,27 +595,22 @@ public protocol AriaLiveAttribute: AnyAttribute {
func aria(live value: Values.Accessibility.Live) -> Self
}
-extension AriaLiveAttribute {
-
- internal var key: String { "aria-live" }
-}
-
extension AriaLiveAttribute where Self: ContentNode {
internal func mutate(arialive value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-live", value: value)
}
}
extension AriaLiveAttribute where Self: EmptyNode {
internal func mutate(arialive value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-live", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaModalAttribute: AnyAttribute {
+public protocol AriaModalAttribute: Attribute {
/// The function represents the html-attribute 'aria-modal'.
///
@@ -740,27 +620,22 @@ public protocol AriaModalAttribute: AnyAttribute {
func aria(modal value: Bool) -> Self
}
-extension AriaModalAttribute {
-
- internal var key: String { "aria-modal" }
-}
-
extension AriaModalAttribute where Self: ContentNode {
internal func mutate(ariamodal value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-modal", value: value)
}
}
extension AriaModalAttribute where Self: EmptyNode {
internal func mutate(ariamodal value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-modal", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaMultilineAttribute: AnyAttribute {
+public protocol AriaMultilineAttribute: Attribute {
/// The function represents the html-attribute 'aria-multiline'.
///
@@ -770,27 +645,22 @@ public protocol AriaMultilineAttribute: AnyAttribute {
func aria(multiline value: Bool) -> Self
}
-extension AriaMultilineAttribute {
-
- internal var key: String { "aria-multiline" }
-}
-
extension AriaMultilineAttribute where Self: ContentNode {
internal func mutate(ariamultiline value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-multiline", value: value)
}
}
extension AriaMultilineAttribute where Self: EmptyNode {
internal func mutate(ariamultiline value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-multiline", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaMultiselectAttribute: AnyAttribute {
+public protocol AriaMultiselectAttribute: Attribute {
/// The function represents the html-attribute 'aria-multiselectable'.
///
@@ -800,27 +670,22 @@ public protocol AriaMultiselectAttribute: AnyAttribute {
func aria(multiselectable value: Bool) -> Self
}
-extension AriaMultiselectAttribute {
-
- internal var key: String { "aria-multiselectable" }
-}
-
extension AriaMultiselectAttribute where Self: ContentNode {
internal func mutate(ariamultiselectable value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-multiselectable", value: value)
}
}
extension AriaMultiselectAttribute where Self: EmptyNode {
internal func mutate(ariamultiselectable value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-multiselectable", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaOrientationAttribute: AnyAttribute {
+public protocol AriaOrientationAttribute: Attribute {
/// The function represents the html-attribute 'aria-orientation'.
///
@@ -830,27 +695,22 @@ public protocol AriaOrientationAttribute: AnyAttribute {
func aria(orientation value: Values.Accessibility.Orientation) -> Self
}
-extension AriaOrientationAttribute {
-
- internal var key: String { "aria-orientation" }
-}
-
extension AriaOrientationAttribute where Self: ContentNode {
internal func mutate(ariaorientation value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-orientation", value: value)
}
}
extension AriaOrientationAttribute where Self: EmptyNode {
internal func mutate(ariaorientation value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-orientation", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaOwnsAttribute: AnyAttribute {
+public protocol AriaOwnsAttribute: Attribute {
/// The function represents the html-attribute 'aria-owns'.
///
@@ -860,27 +720,22 @@ public protocol AriaOwnsAttribute: AnyAttribute {
func aria(owns value: String) -> Self
}
-extension AriaOwnsAttribute {
-
- internal var key: String { "aria-owns" }
-}
-
extension AriaOwnsAttribute where Self: ContentNode {
internal func mutate(ariaowns value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-owns", value: value)
}
}
extension AriaOwnsAttribute where Self: EmptyNode {
internal func mutate(ariaowns value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-owns", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaPlaceholderAttribute: AnyAttribute {
+public protocol AriaPlaceholderAttribute: Attribute {
/// The function represents the html-attribute 'aria-placeholder'.
///
@@ -890,27 +745,22 @@ public protocol AriaPlaceholderAttribute: AnyAttribute {
func aria(placeholder value: String) -> Self
}
-extension AriaPlaceholderAttribute {
-
- internal var key: String { "aria-placeholder" }
-}
-
extension AriaPlaceholderAttribute where Self: ContentNode {
internal func mutate(ariaplaceholder value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-placeholder", value: value)
}
}
extension AriaPlaceholderAttribute where Self: EmptyNode {
internal func mutate(ariaplaceholder value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-placeholder", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaPositionInsetAttribute: AnyAttribute {
+public protocol AriaPositionInsetAttribute: Attribute {
/// The function represents the html-attribute 'aria-posinset'.
///
@@ -920,27 +770,22 @@ public protocol AriaPositionInsetAttribute: AnyAttribute {
func aria(positionInset_ value: Int) -> Self
}
-extension AriaPositionInsetAttribute {
-
- internal var key: String { "aria-posinset" }
-}
-
extension AriaPositionInsetAttribute where Self: ContentNode {
internal func mutate(ariaposinset value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-posinset", value: value)
}
}
extension AriaPositionInsetAttribute where Self: EmptyNode {
internal func mutate(ariaposinset value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-posinset", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaPressedAttribute: AnyAttribute {
+public protocol AriaPressedAttribute: Attribute {
/// The function represents the html-attribute 'aria-pressed'.
///
@@ -950,27 +795,22 @@ public protocol AriaPressedAttribute: AnyAttribute {
func aria(presssed value: Values.Accessibility.Pressed) -> Self
}
-extension AriaPressedAttribute {
-
- internal var key: String { "aria-pressed" }
-}
-
extension AriaPressedAttribute where Self: ContentNode {
internal func mutate(ariapressed value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-pressed", value: value)
}
}
extension AriaPressedAttribute where Self: EmptyNode {
internal func mutate(ariapressed value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-pressed", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaReadonlyAttribute: AnyAttribute {
+public protocol AriaReadonlyAttribute: Attribute {
/// The function represents the html-attribute 'aria-readonly'.
///
@@ -980,27 +820,22 @@ public protocol AriaReadonlyAttribute: AnyAttribute {
func aria(readonly value: Bool) -> Self
}
-extension AriaReadonlyAttribute {
-
- internal var key: String { "aria-readonly" }
-}
-
extension AriaReadonlyAttribute where Self: ContentNode {
internal func mutate(ariareadonly value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-readonly", value: value)
}
}
extension AriaReadonlyAttribute where Self: EmptyNode {
internal func mutate(ariareadonly value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-readonly", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRelevantAttribute: AnyAttribute {
+public protocol AriaRelevantAttribute: Attribute {
/// The function represents the html-attribute 'aria-relevant'.
///
@@ -1010,27 +845,22 @@ public protocol AriaRelevantAttribute: AnyAttribute {
func aria(relevant value: Values.Accessibility.Relevant) -> Self
}
-extension AriaRelevantAttribute {
-
- internal var key: String { "aria-relevant" }
-}
-
extension AriaRelevantAttribute where Self: ContentNode {
internal func mutate(ariarelevant value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-relevant", value: value)
}
}
extension AriaRelevantAttribute where Self: EmptyNode {
internal func mutate(ariarelevant value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-relevant", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRequiredAttribute: AnyAttribute {
+public protocol AriaRequiredAttribute: Attribute {
/// The function represents the html-attribute 'aria-required'.
///
@@ -1040,27 +870,22 @@ public protocol AriaRequiredAttribute: AnyAttribute {
func aria(required value: Bool) -> Self
}
-extension AriaRequiredAttribute {
-
- internal var key: String { "aria-required" }
-}
-
extension AriaRequiredAttribute where Self: ContentNode {
internal func mutate(ariarequired value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-required", value: value)
}
}
extension AriaRequiredAttribute where Self: EmptyNode {
internal func mutate(ariarequired value: Bool) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-required", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRoleDescriptionAttribute: AnyAttribute {
+public protocol AriaRoleDescriptionAttribute: Attribute {
/// The function represents the html-attribute 'aria-roledescription'.
///
@@ -1070,27 +895,22 @@ public protocol AriaRoleDescriptionAttribute: AnyAttribute {
func aria(roleDescription value: String) -> Self
}
-extension AriaRoleDescriptionAttribute {
-
- internal var key: String { "aria-roledescription" }
-}
-
extension AriaRoleDescriptionAttribute where Self: ContentNode {
internal func mutate(ariaroledescription value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-roledescription", value: value)
}
}
extension AriaRoleDescriptionAttribute where Self: EmptyNode {
internal func mutate(ariaroledescription value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-roledescription", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRowCountAttribute: AnyAttribute {
+public protocol AriaRowCountAttribute: Attribute {
/// The function represents the html-attribute 'aria-rowcount'.
///
@@ -1100,27 +920,22 @@ public protocol AriaRowCountAttribute: AnyAttribute {
func aria(rowCount value: Int) -> Self
}
-extension AriaRowCountAttribute {
-
- internal var key: String { "aria-rowcount" }
-}
-
extension AriaRowCountAttribute where Self: ContentNode {
internal func mutate(ariarowcount value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowcount", value: value)
}
}
extension AriaRowCountAttribute where Self: EmptyNode {
internal func mutate(ariarowcount value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowcount", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRowIndexAttribute: AnyAttribute {
+public protocol AriaRowIndexAttribute: Attribute {
/// The function represents the html-attribute 'aria-rowindex'.
///
@@ -1130,27 +945,22 @@ public protocol AriaRowIndexAttribute: AnyAttribute {
func aria(rowIndex value: Int) -> Self
}
-extension AriaRowIndexAttribute {
-
- internal var key: String { "aria-rowindex" }
-}
-
extension AriaRowIndexAttribute where Self: ContentNode {
internal func mutate(ariarowindex value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowindex", value: value)
}
}
extension AriaRowIndexAttribute where Self: EmptyNode {
internal func mutate(ariarowindex value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowindex", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaRowSpanAttribute: AnyAttribute {
+public protocol AriaRowSpanAttribute: Attribute {
/// The function represents the html-attribute 'aria-rowspan'.
///
@@ -1160,27 +970,22 @@ public protocol AriaRowSpanAttribute: AnyAttribute {
func aria(rowSpan value: Int) -> Self
}
-extension AriaRowSpanAttribute {
-
- internal var key: String { "aria-rowspan" }
-}
-
extension AriaRowSpanAttribute where Self: ContentNode {
internal func mutate(ariarowspan value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowspan", value: value)
}
}
extension AriaRowSpanAttribute where Self: EmptyNode {
internal func mutate(ariarowspan value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-rowspan", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaSelectedAttribute: AnyAttribute {
+public protocol AriaSelectedAttribute: Attribute {
/// The function represents the html-attribute 'aria-selected'.
///
@@ -1190,27 +995,22 @@ public protocol AriaSelectedAttribute: AnyAttribute {
func aria(selected value: Values.Accessibility.Selected) -> Self
}
-extension AriaSelectedAttribute {
-
- internal var key: String { "aria-selected" }
-}
-
extension AriaSelectedAttribute where Self: ContentNode {
internal func mutate(ariaselected value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-selected", value: value)
}
}
extension AriaSelectedAttribute where Self: EmptyNode {
internal func mutate(ariaselected value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-selected", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaSetSizeAttribute: AnyAttribute {
+public protocol AriaSetSizeAttribute: Attribute {
/// The function represents the html-attribute 'aria-setsize'.
///
@@ -1220,27 +1020,22 @@ public protocol AriaSetSizeAttribute: AnyAttribute {
func aria(setSize value: Int) -> Self
}
-extension AriaSetSizeAttribute {
-
- internal var key: String { "aria-setsize" }
-}
-
extension AriaSetSizeAttribute where Self: ContentNode {
internal func mutate(ariasetsize value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-setsize", value: value)
}
}
extension AriaSetSizeAttribute where Self: EmptyNode {
internal func mutate(ariasetsize value: Int) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-setsize", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaSortAttribute: AnyAttribute {
+public protocol AriaSortAttribute: Attribute {
/// The function represents the html-attribute 'aria-sort'.
///
@@ -1250,27 +1045,22 @@ public protocol AriaSortAttribute: AnyAttribute {
func aria(sort value: Values.Accessibility.Sort) -> Self
}
-extension AriaSortAttribute {
-
- internal var key: String { "aria-sort" }
-}
-
extension AriaSortAttribute where Self: ContentNode {
internal func mutate(ariasort value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-sort", value: value)
}
}
extension AriaSortAttribute where Self: EmptyNode {
internal func mutate(ariasort value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-sort", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaValueMaximumAttribute: AnyAttribute {
+public protocol AriaValueMaximumAttribute: Attribute {
/// The function represents the html-attribute 'aria-valuemax'.
///
@@ -1280,27 +1070,22 @@ public protocol AriaValueMaximumAttribute: AnyAttribute {
func aria(valueMaximum value: Float) -> Self
}
-extension AriaValueMaximumAttribute {
-
- internal var key: String { "aria-valuemax" }
-}
-
extension AriaValueMaximumAttribute where Self: ContentNode {
internal func mutate(ariavaluemax value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuemax", value: value)
}
}
extension AriaValueMaximumAttribute where Self: EmptyNode {
internal func mutate(ariavaluemax value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuemax", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaValueMininumAttribute: AnyAttribute {
+public protocol AriaValueMininumAttribute: Attribute {
/// The function represents the html-attribute 'aria-valuemin'.
///
@@ -1310,27 +1095,22 @@ public protocol AriaValueMininumAttribute: AnyAttribute {
func aria(valueMinimum value: Float) -> Self
}
-extension AriaValueMininumAttribute {
-
- internal var key: String { "aria-valuemin" }
-}
-
extension AriaValueMininumAttribute where Self: ContentNode {
internal func mutate(ariavaluemin value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuemin", value: value)
}
}
extension AriaValueMininumAttribute where Self: EmptyNode {
internal func mutate(ariavaluemin value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuemin", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaValueNowAttribute: AnyAttribute {
+public protocol AriaValueNowAttribute: Attribute {
/// The function represents the html-attribute 'aria-valuenow"'.
///
@@ -1340,27 +1120,22 @@ public protocol AriaValueNowAttribute: AnyAttribute {
func aria(valueNow value: Float) -> Self
}
-extension AriaValueNowAttribute {
-
- internal var key: String { "aria-valuenow" }
-}
-
extension AriaValueNowAttribute where Self: ContentNode {
internal func mutate(ariavaluenow value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuenow", value: value)
}
}
extension AriaValueNowAttribute where Self: EmptyNode {
internal func mutate(ariavaluenow value: Float) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuenow", value: value)
}
}
/// The protocol provides the element with accessibility handler.
-public protocol AriaValueTextAttribute: AnyAttribute {
+public protocol AriaValueTextAttribute: Attribute {
/// The function represents the html-attribute 'aria-valuetext'.
///
@@ -1370,21 +1145,16 @@ public protocol AriaValueTextAttribute: AnyAttribute {
func aria(valueText value: String) -> Self
}
-extension AriaValueTextAttribute {
-
- internal var key: String { "aria-valuetext" }
-}
-
extension AriaValueTextAttribute where Self: ContentNode {
internal func mutate(ariavaluetext value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuetext", value: value)
}
}
extension AriaValueTextAttribute where Self: EmptyNode {
internal func mutate(ariavaluetext value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "aria-valuetext", value: value)
}
}
diff --git a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
index cee18181..e510aa45 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift
@@ -12,7 +12,7 @@ import OrderedCollections
public typealias GlobalAttributes = AccessKeyAttribute & AutocapitalizeAttribute & AutofocusAttribute & ClassAttribute & EditAttribute & DirectionAttribute & DragAttribute & EnterKeyHintAttribute & HiddenAttribute & InputModeAttribute & IsAttribute & ItemIdAttribute & ItemPropertyAttribute & ItemReferenceAttribute & ItemScopeAttribute & ItemTypeAttribute & IdentifierAttribute & LanguageAttribute & NonceAttribute & RoleAttribute & SpellCheckAttribute & StyleAttribute & TabulatorAttribute & TitleAttribute & TranslateAttribute
/// The protocol provides the element with the accesskey handler.
-public protocol AccessKeyAttribute: AnyAttribute {
+public protocol AccessKeyAttribute: Attribute {
/// The function represents the html-attribute 'accesskey'.
///
@@ -25,27 +25,22 @@ public protocol AccessKeyAttribute: AnyAttribute {
func accessKey(_ value: Character) -> Self
}
-extension AccessKeyAttribute {
-
- internal var key: String { "accesskey" }
-}
-
extension AccessKeyAttribute where Self: ContentNode {
internal func mutate(accesskey value: Character) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "accesskey", value: value)
}
}
extension AccessKeyAttribute where Self: EmptyNode {
internal func mutate(accesskey value: Character) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "accesskey", value: value)
}
}
/// The protocol provides the element with the accept handler.
-public protocol AcceptAttribute: AnyAttribute {
+public protocol AcceptAttribute: Attribute {
/// The function represents the html-attribute 'accept'.
///
@@ -55,27 +50,22 @@ public protocol AcceptAttribute: AnyAttribute {
func accept(_ value: String) -> Self
}
-extension AcceptAttribute {
-
- internal var key: String { "accept" }
-}
-
extension AcceptAttribute where Self: ContentNode {
internal func mutate(accept value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "accept", value: value)
}
}
extension AcceptAttribute where Self: EmptyNode {
internal func mutate(accept value: String) -> Self {
- return self.mutate(key: key, value: value)
+ return self.mutate(key: "accept", value: value)
}
}
/// The protocol provides the element with the action handler.
-public protocol ActionAttribute: AnyAttribute {
+public protocol ActionAttribute: Attribute {
/// The function represents the html-attribute 'action'.
///
@@ -85,27 +75,22 @@ public protocol ActionAttribute: AnyAttribute {
func action(_ value: String) -> Self
}
-extension ActionAttribute {
-
- internal var key: String { "action" }
-}
-
extension ActionAttribute where Self: ContentNode {
internal func mutate(action value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "action", value: value)
}
}
extension ActionAttribute where Self: EmptyNode {
internal func mutate(action value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "action", value: value)
}
}
/// The protocol provides the element with the alternate handler.
-public protocol AlternateAttribute: AnyAttribute {
+public protocol AlternateAttribute: Attribute {
/// The function represents the html-attribute 'alt'.
///
@@ -115,27 +100,22 @@ public protocol AlternateAttribute: AnyAttribute {
func alternate(_ value: String) -> Self
}
-extension AlternateAttribute {
-
- internal var key: String { "alt" }
-}
-
extension AlternateAttribute where Self: ContentNode {
internal func mutate(alternate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "alt", value: value)
}
}
extension AlternateAttribute where Self: EmptyNode {
internal func mutate(alternate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "alt", value: value)
}
}
/// The protocol provides the element with the asynchronously handler.
-public protocol AsynchronouslyAttribute: AnyAttribute {
+public protocol AsynchronouslyAttribute: Attribute {
/// The function represents the html-attribute 'async'.
///
@@ -145,27 +125,22 @@ public protocol AsynchronouslyAttribute: AnyAttribute {
func asynchronously() -> Self
}
-extension AsynchronouslyAttribute {
-
- internal var key: String { "async" }
-}
-
extension AsynchronouslyAttribute where Self: ContentNode {
internal func mutate(async value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "async", value: value)
}
}
extension AsynchronouslyAttribute where Self: EmptyNode {
internal func mutate(async value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "async", value: value)
}
}
/// The protocol provides the element with the autocapitalize handler.
-public protocol AutocapitalizeAttribute: AnyAttribute {
+public protocol AutocapitalizeAttribute: Attribute {
/// The function represents the html-attribute 'autocapitalize'.
///
@@ -175,27 +150,22 @@ public protocol AutocapitalizeAttribute: AnyAttribute {
func autocapitalize(_ value: Values.Capitalization) -> Self
}
-extension AutocapitalizeAttribute {
-
- internal var key: String { "autocapitalize" }
-}
-
extension AutocapitalizeAttribute where Self: ContentNode {
internal func mutate(autocapitalize value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autocapitalize", value: value)
}
}
extension AutocapitalizeAttribute where Self: EmptyNode {
internal func mutate(autocapitalize value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autocapitalize", value: value)
}
}
/// The protocol provides the element with the autocomplete handler.
-public protocol AutocompleteAttribute: AnyAttribute {
+public protocol AutocompleteAttribute: Attribute {
/// The function represents the html-attribute 'autocomplete'.
///
@@ -205,27 +175,22 @@ public protocol AutocompleteAttribute: AnyAttribute {
func hasCompletion(_ value: Bool) -> Self
}
-extension AutocompleteAttribute {
-
- internal var key: String { "autocomplete" }
-}
-
extension AutocompleteAttribute where Self: ContentNode {
internal func mutate(autocomplete value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autocomplete", value: value)
}
}
extension AutocompleteAttribute where Self: EmptyNode {
internal func mutate(autocomplete value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autocomplete", value: value)
}
}
/// The protocol provides the element with the autofocus handler.
-public protocol AutofocusAttribute: AnyAttribute {
+public protocol AutofocusAttribute: Attribute {
/// The function represents the html-attribute 'autofocus'.
///
@@ -235,27 +200,22 @@ public protocol AutofocusAttribute: AnyAttribute {
func autofocus() -> Self
}
-extension AutofocusAttribute {
-
- internal var key: String { "autofocus" }
-}
-
extension AutofocusAttribute where Self: ContentNode {
internal func mutate(autofocus value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autofocus", value: value)
}
}
extension AutofocusAttribute where Self: EmptyNode {
internal func mutate(autofocus value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autofocus", value: value)
}
}
/// The protocol provides the element with the autoplay handler.
-public protocol AutoplayAttribute: AnyAttribute {
+public protocol AutoplayAttribute: Attribute {
/// The function represents the html-attribute 'autoplay'.
///
@@ -265,27 +225,22 @@ public protocol AutoplayAttribute: AnyAttribute {
func autoplay() -> Self
}
-extension AutoplayAttribute {
-
- internal var key: String { "autoplay" }
-}
-
extension AutoplayAttribute where Self: ContentNode {
internal func mutate(autoplay value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autoplay", value: value)
}
}
extension AutoplayAttribute where Self: EmptyNode {
internal func mutate(autoplay value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "autoplay", value: value)
}
}
/// The protocol provides the element with the charset handler.
-public protocol CharsetAttribute: AnyAttribute {
+public protocol CharsetAttribute: Attribute {
/// The function represents the html-attribute 'charset'.
///
@@ -295,27 +250,22 @@ public protocol CharsetAttribute: AnyAttribute {
func charset(_ value: Values.Charset) -> Self
}
-extension CharsetAttribute {
-
- internal var key: String { "charset" }
-}
-
extension CharsetAttribute where Self: ContentNode {
internal func mutate(charset value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "charset", value: value)
}
}
extension CharsetAttribute where Self: EmptyNode {
internal func mutate(charset value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "charset", value: value)
}
}
/// The protocol provides the element with the checked handler.
-public protocol CheckedAttribute: AnyAttribute {
+public protocol CheckedAttribute: Attribute {
/// The function represents the html-attribute 'checked'.
///
@@ -325,27 +275,22 @@ public protocol CheckedAttribute: AnyAttribute {
func checked() -> Self
}
-extension CheckedAttribute {
-
- internal var key: String { "checked" }
-}
-
extension CheckedAttribute where Self: ContentNode {
internal func mutate(checked value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "checked", value: value)
}
}
extension CheckedAttribute where Self: EmptyNode {
internal func mutate(checked value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "checked", value: value)
}
}
/// The protocol provides the element with the cite handler.
-public protocol CiteAttribute: AnyAttribute {
+public protocol CiteAttribute: Attribute {
/// The function represents the html-attribute 'cite'.
///
@@ -355,27 +300,22 @@ public protocol CiteAttribute: AnyAttribute {
func cite(_ value: String) -> Self
}
-extension CiteAttribute {
-
- internal var key: String { "cite" }
-}
-
extension CiteAttribute where Self: ContentNode {
internal func mutate(cite value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "cite", value: value)
}
}
extension CiteAttribute where Self: EmptyNode {
internal func mutate(cite value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "cite", value: value)
}
}
/// The protocol provides the element with the class handler.
-public protocol ClassAttribute: AnyAttribute{
+public protocol ClassAttribute: Attribute{
/// The function represents the html-attribute 'class'.
///
@@ -385,27 +325,22 @@ public protocol ClassAttribute: AnyAttribute{
func `class`(_ value: String) -> Self
}
-extension ClassAttribute {
-
- internal var key: String { "class" }
-}
-
extension ClassAttribute where Self: ContentNode {
internal func mutate(class value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "class", value: value)
}
}
extension ClassAttribute where Self: EmptyNode {
internal func mutate(class value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "class", value: value)
}
}
/// The protocol provides the element with the columns handler.
-public protocol ColumnsAttribute: AnyAttribute {
+public protocol ColumnsAttribute: Attribute {
/// The function represents the html-attribute 'cols'.
///
@@ -415,27 +350,22 @@ public protocol ColumnsAttribute: AnyAttribute {
func columns(_ size: Int) -> Self
}
-extension ColumnsAttribute {
-
- internal var key: String { "cols" }
-}
-
extension ColumnsAttribute where Self: ContentNode {
internal func mutate(cols value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "cols", value: value)
}
}
extension ColumnsAttribute where Self: EmptyNode {
internal func mutate(cols value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "cols", value: value)
}
}
/// The protocol provides the element with the columnspan handler.
-public protocol ColumnSpanAttribute: AnyAttribute {
+public protocol ColumnSpanAttribute: Attribute {
/// The function represents the html-attribute 'colspan'.
///
@@ -445,27 +375,22 @@ public protocol ColumnSpanAttribute: AnyAttribute {
func columnSpan(_ size: Int) -> Self
}
-extension ColumnSpanAttribute {
-
- internal var key: String { "colspan" }
-}
-
extension ColumnSpanAttribute where Self: ContentNode {
internal func mutate(colspan value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "colspan", value: value)
}
}
extension ColumnSpanAttribute where Self: EmptyNode {
internal func mutate(colspan value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "colspan", value: value)
}
}
/// The protocol provides the element with the content handler.
-public protocol ContentAttribute: AnyAttribute {
+public protocol ContentAttribute: Attribute {
/// The function represents the html-attribute 'content'.
///
@@ -473,32 +398,24 @@ public protocol ContentAttribute: AnyAttribute {
///
/// ```
func content(_ value: String) -> Self
-
- /// The func adds
- func content(_ value: TemplateValue) -> Self
-}
-
-extension ContentAttribute {
-
- internal var key: String { "content" }
}
extension ContentAttribute where Self: ContentNode {
internal func mutate(content value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "content", value: value)
}
}
extension ContentAttribute where Self: EmptyNode {
internal func mutate(content value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "content", value: value)
}
}
/// The protocol provides the element with the iseditable handler.
-public protocol EditAttribute: AnyAttribute {
+public protocol EditAttribute: Attribute {
/// The function represents the html-attribute 'contenteditable'.
///
@@ -508,27 +425,22 @@ public protocol EditAttribute: AnyAttribute {
func isEditable(_ value: Bool) -> Self
}
-extension EditAttribute {
-
- internal var key: String { "contenteditable" }
-}
-
extension EditAttribute where Self: ContentNode {
internal func mutate(contenteditable value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "contenteditable", value: value)
}
}
extension EditAttribute where Self: EmptyNode {
internal func mutate(contenteditable value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "contenteditable", value: value)
}
}
/// The protocol provides the element with the controls handler.
-public protocol ControlsAttribute: AnyAttribute {
+public protocol ControlsAttribute: Attribute {
/// The function represents the html-attribute 'controls'.
///
@@ -538,27 +450,22 @@ public protocol ControlsAttribute: AnyAttribute {
func controls() -> Self
}
-extension ControlsAttribute {
-
- internal var key: String { "controls" }
-}
-
extension ControlsAttribute where Self: ContentNode {
internal func mutate(controls value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "controls", value: value)
}
}
extension ControlsAttribute where Self: EmptyNode {
internal func mutate(controls value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "controls", value: value)
}
}
/// The protocol provides the element with the coordinates handler.
-public protocol CoordinatesAttribute: AnyAttribute {
+public protocol CoordinatesAttribute: Attribute {
/// The function represents the html-attribute 'coordinates'.
///
@@ -568,27 +475,22 @@ public protocol CoordinatesAttribute: AnyAttribute {
func coordinates(_ value: String) -> Self
}
-extension CoordinatesAttribute {
-
- internal var key: String { "coords" }
-}
-
extension CoordinatesAttribute where Self: ContentNode {
internal func mutate(coords value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "coords", value: value)
}
}
extension CoordinatesAttribute where Self: EmptyNode {
internal func mutate(coords value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "coords", value: value)
}
}
/// The protocol provides the element with the date handler.
-public protocol DataAttribute: AnyAttribute{
+public protocol DataAttribute: Attribute{
/// The function represents the html-attribute 'data'.
///
@@ -598,27 +500,22 @@ public protocol DataAttribute: AnyAttribute{
func data(_ value: String) -> Self
}
-extension DataAttribute {
-
- internal var key: String { "data" }
-}
-
extension DataAttribute where Self: ContentNode {
internal func mutate(data value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "data", value: value)
}
}
extension DataAttribute where Self: EmptyNode {
internal func mutate(data value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "data", value: value)
}
}
/// The protocol provides the element with the datetime handler.
-public protocol DateTimeAttribute: AnyAttribute {
+public protocol DateTimeAttribute: Attribute {
/// The function represents the html-attribute 'datetime'.
///
@@ -628,27 +525,22 @@ public protocol DateTimeAttribute: AnyAttribute {
func dateTime(_ value: String) -> Self
}
-extension DateTimeAttribute {
-
- internal var key: String { "datetime" }
-}
-
extension DateTimeAttribute where Self: ContentNode {
internal func mutate(datetime value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "datetime", value: value)
}
}
extension DateTimeAttribute where Self: EmptyNode {
internal func mutate(datetime value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "datetime", value: value)
}
}
/// The protocol provides the element with the default handler.
-public protocol DefaultAttribute: AnyAttribute {
+public protocol DefaultAttribute: Attribute {
/// The function represents the html-attribute 'default'.
///
@@ -658,27 +550,22 @@ public protocol DefaultAttribute: AnyAttribute {
func `default`() -> Self
}
-extension DefaultAttribute {
-
- internal var key: String { "default" }
-}
-
extension DefaultAttribute where Self: ContentNode {
internal func mutate(default value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "default", value: value)
}
}
extension DefaultAttribute where Self: EmptyNode {
internal func mutate(default value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "default", value: value)
}
}
/// The protocol provides the element with the defer handler.
-public protocol DeferAttribute: AnyAttribute {
+public protocol DeferAttribute: Attribute {
/// The function represents the html-attribute 'defer'.
///
@@ -688,27 +575,22 @@ public protocol DeferAttribute: AnyAttribute {
func `defer`() -> Self
}
-extension DeferAttribute {
-
- internal var key: String { "defer" }
-}
-
extension DeferAttribute where Self: ContentNode {
internal func mutate(defer value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "defer", value: value)
}
}
extension DeferAttribute where Self: EmptyNode {
internal func mutate(defer value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "defer", value: value)
}
}
/// The protocol provides the element with the direction handler.
-public protocol DirectionAttribute: AnyAttribute {
+public protocol DirectionAttribute: Attribute {
/// The function represents the html-attribute 'dir'.
///
@@ -720,27 +602,22 @@ public protocol DirectionAttribute: AnyAttribute {
func direction(_ value: Values.Direction) -> Self
}
-extension DirectionAttribute {
-
- internal var key: String { "dir" }
-}
-
extension DirectionAttribute where Self: ContentNode {
internal func mutate(dir value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "dir", value: value)
}
}
extension DirectionAttribute where Self: EmptyNode {
internal func mutate(dir value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "dir", value: value)
}
}
/// The protocol provides the element with the disabled handler
-public protocol DisabledAttribute: AnyAttribute {
+public protocol DisabledAttribute: Attribute {
/// The function represents the html-attribute 'disabled'.
///
@@ -750,27 +627,22 @@ public protocol DisabledAttribute: AnyAttribute {
func disabled() -> Self
}
-extension DisabledAttribute {
-
- internal var key: String { "disabled" }
-}
-
extension DisabledAttribute where Self: ContentNode {
internal func mutate(disabled value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "disabled", value: value)
}
}
extension DisabledAttribute where Self: EmptyNode {
internal func mutate(disabled value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "disabled", value: value)
}
}
/// The protocol provides the element with the download handler.
-public protocol DownloadAttribute: AnyAttribute {
+public protocol DownloadAttribute: Attribute {
/// The function represents the html-attribute 'download'.
///
@@ -780,27 +652,22 @@ public protocol DownloadAttribute: AnyAttribute {
func download() -> Self
}
-extension DownloadAttribute {
-
- internal var key: String { "download" }
-}
-
extension DownloadAttribute where Self: ContentNode {
internal func mutate(download value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "download", value: value)
}
}
extension DownloadAttribute where Self: EmptyNode {
internal func mutate(download value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "download", value: value)
}
}
/// The protocol provides the element with the isdraggable handler.
-public protocol DragAttribute: AnyAttribute {
+public protocol DragAttribute: Attribute {
/// The function represents the html-attribute 'draggable'.
///
@@ -810,27 +677,22 @@ public protocol DragAttribute: AnyAttribute {
func isDraggable(_ value: Bool) -> Self
}
-extension DragAttribute {
-
- internal var key: String { "draggable" }
-}
-
extension DragAttribute where Self: ContentNode {
internal func mutate(draggable value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "draggable", value: value)
}
}
extension DragAttribute where Self: EmptyNode {
internal func mutate(draggable value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "draggable", value: value)
}
}
/// The protocol provides the element with the encoding handler.
-public protocol EncodingAttribute: AnyAttribute {
+public protocol EncodingAttribute: Attribute {
/// The function represents the html-attribute 'enctype'.
///
@@ -842,27 +704,22 @@ public protocol EncodingAttribute: AnyAttribute {
func encoding(_ value: Values.Encoding) -> Self
}
-extension EncodingAttribute {
-
- internal var key: String { "enctype" }
-}
-
extension EncodingAttribute where Self: ContentNode {
internal func mutate(enctype value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "enctype", value: value)
}
}
extension EncodingAttribute where Self: EmptyNode {
internal func mutate(enctype value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "enctype", value: value)
}
}
/// The protocol provides the element with the enterkeyhint handler.
-public protocol EnterKeyHintAttribute: AnyAttribute {
+public protocol EnterKeyHintAttribute: Attribute {
/// The function represents the html-attribute 'enterkeyhint'.
///
@@ -874,27 +731,22 @@ public protocol EnterKeyHintAttribute: AnyAttribute {
func enterKeyHint(_ value: Values.Hint) -> Self
}
-extension EnterKeyHintAttribute {
-
- internal var key: String { "enterkeyhint" }
-}
-
extension EnterKeyHintAttribute where Self: ContentNode {
internal func mutate(enterkeyhint value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "enterkeyhint", value: value)
}
}
extension EnterKeyHintAttribute where Self: EmptyNode {
internal func mutate(enterkeyhint value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "enterkeyhint", value: value)
}
}
/// The protocol provides the element with the for handler.
-public protocol ForAttribute: AnyAttribute {
+public protocol ForAttribute: Attribute {
/// The function represents the html-attribute 'for'.
///
@@ -906,27 +758,22 @@ public protocol ForAttribute: AnyAttribute {
func `for`(_ value: String) -> Self
}
-extension ForAttribute {
-
- internal var key: String { "for" }
-}
-
extension ForAttribute where Self: ContentNode {
internal func mutate(for value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "for", value: value)
}
}
extension ForAttribute where Self: EmptyNode {
internal func mutate(for value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "for", value: value)
}
}
/// The protocol provides the element with the form handler.
-public protocol FormAttribute: AnyAttribute {
+public protocol FormAttribute: Attribute {
/// The function represents the html-attribute 'form'.
///
@@ -936,27 +783,22 @@ public protocol FormAttribute: AnyAttribute {
func form(_ value: String) -> Self
}
-extension FormAttribute {
-
- internal var key: String { "form" }
-}
-
extension FormAttribute where Self: ContentNode {
internal func mutate(form value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "form", value: value)
}
}
extension FormAttribute where Self: EmptyNode {
internal func mutate(form value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "form", value: value)
}
}
/// The protocol provides the element with the formaction handler.
-public protocol FormActionAttribute: AnyAttribute {
+public protocol FormActionAttribute: Attribute {
/// The function represents the html-attribute 'formaction'.
///
@@ -968,27 +810,22 @@ public protocol FormActionAttribute: AnyAttribute {
func formAction(_ value: String) -> Self
}
-extension FormActionAttribute {
-
- internal var key: String { "formaction" }
-}
-
extension FormActionAttribute where Self: ContentNode {
internal func mutate(formaction value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "formaction", value: value)
}
}
extension FormActionAttribute where Self: EmptyNode {
internal func mutate(formaction value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "formaction", value: value)
}
}
/// The protocol provides the element with the http-equiv handler.
-public protocol EquivalentAttribute: AnyAttribute {
+public protocol EquivalentAttribute: Attribute {
/// The function represents the html-attribute 'http-equiv'.
///
@@ -1000,27 +837,22 @@ public protocol EquivalentAttribute: AnyAttribute {
func equivalent(_ value: Values.Equivalent) -> Self
}
-extension EquivalentAttribute {
-
- internal var key: String { "http-equiv" }
-}
-
extension HeaderAttribute where Self: ContentNode {
internal func mutate(httpequiv value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "http-equiv", value: value)
}
}
extension EquivalentAttribute where Self: EmptyNode {
internal func mutate(httpequiv value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "http-equiv", value: value)
}
}
/// The protocol provides the element with the headers handler.
-public protocol HeaderAttribute: AnyAttribute {
+public protocol HeaderAttribute: Attribute {
/// The function represents the html-attribute 'headers'.
///
@@ -1032,27 +864,22 @@ public protocol HeaderAttribute: AnyAttribute {
func headers(_ value: String) -> Self
}
-extension HeaderAttribute {
-
- internal var key: String { "headers" }
-}
-
extension HeaderAttribute where Self: ContentNode {
internal func mutate(headers value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "headers", value: value)
}
}
extension HeaderAttribute where Self: EmptyNode {
internal func mutate(headers value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "headers", value: value)
}
}
/// The protocol provides the element with the height handler.
-public protocol HeightAttribute: AnyAttribute {
+public protocol HeightAttribute: Attribute {
/// The function represents the html-attribute 'height'.
///
@@ -1064,27 +891,22 @@ public protocol HeightAttribute: AnyAttribute {
func height(_ size: Int) -> Self
}
-extension HeightAttribute {
-
- internal var key: String { "height" }
-}
-
extension HeightAttribute where Self: ContentNode {
internal func mutate(height value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "height", value: value)
}
}
extension HeightAttribute where Self: EmptyNode {
internal func mutate(height value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "height", value: value)
}
}
/// The protocol provides the element with hidden handler.
-public protocol HiddenAttribute: AnyAttribute {
+public protocol HiddenAttribute: Attribute {
/// The function represents the html-attribute 'hidden'.
///
@@ -1094,27 +916,22 @@ public protocol HiddenAttribute: AnyAttribute {
func hidden() -> Self
}
-extension HiddenAttribute {
-
- internal var key: String { "hidden" }
-}
-
extension HiddenAttribute where Self: ContentNode {
internal func mutate(hidden value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "hidden", value: value)
}
}
extension HiddenAttribute where Self: EmptyNode {
internal func mutate(hidden value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "hidden", value: value)
}
}
/// The protocol provides the element with high handler.
-public protocol HighAttribute: AnyAttribute {
+public protocol HighAttribute: Attribute {
/// The function represents the html-attribute 'high'.
///
@@ -1126,27 +943,22 @@ public protocol HighAttribute: AnyAttribute {
func high(_ value: Float) -> Self
}
-extension HighAttribute {
-
- internal var key: String { "high" }
-}
-
extension HighAttribute where Self: ContentNode {
internal func mutate(high value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "high", value: value)
}
}
extension HighAttribute where Self: EmptyNode {
internal func mutate(high value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "high", value: value)
}
}
/// The protocol provides the element with reference handler.
-public protocol ReferenceAttribute: AnyAttribute {
+public protocol ReferenceAttribute: Attribute {
/// The function represents the html-attribute 'href'.
///
@@ -1156,31 +968,24 @@ public protocol ReferenceAttribute: AnyAttribute {
///
/// ```
func reference(_ value: String) -> Self
-
- func reference(_ value: TemplateValue) -> Self
-}
-
-extension ReferenceAttribute {
-
- internal var key: String { "href" }
}
extension ReferenceAttribute where Self: ContentNode {
internal func mutate(href value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "href", value: value)
}
}
extension ReferenceAttribute where Self: EmptyNode {
internal func mutate(href value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "href", value: value)
}
}
/// The protocol provides the element with the language reference handler.
-public protocol ReferenceLanguageAttribute: AnyAttribute {
+public protocol ReferenceLanguageAttribute: Attribute {
/// The function represents the html-attribute 'hreflang'.
///
@@ -1192,27 +997,22 @@ public protocol ReferenceLanguageAttribute: AnyAttribute {
func referenceLanguage(_ value: Values.Language) -> Self
}
-extension ReferenceLanguageAttribute {
-
- internal var key: String { "hreflang" }
-}
-
extension ReferenceLanguageAttribute where Self: ContentNode {
internal func mutate(hreflang value: String) -> Self {
- self.mutate(key: key, value: value)
+ return self.mutate(key: "hreflang", value: value)
}
}
extension ReferenceLanguageAttribute where Self: EmptyNode {
internal func mutate(hreflang value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "hreflang", value: value)
}
}
/// The protocol provides the element with the id handler.
-public protocol IdentifierAttribute: AnyAttribute {
+public protocol IdentifierAttribute: Attribute {
/// The function represents the html-attribute 'id'.
///
@@ -1222,31 +1022,24 @@ public protocol IdentifierAttribute: AnyAttribute {
///
/// ```
func id(_ value: String) -> Self
-
- func id(_ value: TemplateValue) -> Self
-}
-
-extension IdentifierAttribute {
-
- internal var key: String { "id" }
}
extension IdentifierAttribute where Self: ContentNode {
internal func mutate(id value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "id", value: value)
}
}
extension IdentifierAttribute where Self: EmptyNode {
internal func mutate(id value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "id", value: value)
}
}
/// The protocol provides the element with the ismap handler.
-public protocol IsMapAttribute: AnyAttribute {
+public protocol IsMapAttribute: Attribute {
/// The function represents the html-attribute 'ismap'.
///
@@ -1256,27 +1049,22 @@ public protocol IsMapAttribute: AnyAttribute {
func isMap() -> Self
}
-extension IsMapAttribute {
-
- internal var key: String { "ismap" }
-}
-
extension IsMapAttribute where Self: ContentNode {
internal func mutate(ismap value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "ismap", value: value)
}
}
extension IsMapAttribute where Self: EmptyNode {
internal func mutate(ismap value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "ismap", value: value)
}
}
/// The protocol provides the element with the inputmode handler.
-public protocol InputModeAttribute: AnyAttribute {
+public protocol InputModeAttribute: Attribute {
/// The function represents the html-attribute 'inputmode'.
///
@@ -1286,27 +1074,22 @@ public protocol InputModeAttribute: AnyAttribute {
func inputMode(_ value: String) -> Self
}
-extension InputModeAttribute {
-
- internal var key: String { "inputmode" }
-}
-
extension InputModeAttribute where Self: ContentNode {
internal func mutate(inputmode value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "inputmode", value: value)
}
}
extension InputModeAttribute where Self: EmptyNode {
internal func mutate(inputmode value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "inputmode", value: value)
}
}
/// The protocol provides the element with the inputmode handler.
-public protocol IsAttribute: AnyAttribute {
+public protocol IsAttribute: Attribute {
/// The function represents the html-attribute 'is'.
///
@@ -1316,27 +1099,22 @@ public protocol IsAttribute: AnyAttribute {
func `is`(_ value: String) -> Self
}
-extension IsAttribute {
-
- internal var key: String { "is" }
-}
-
extension IsAttribute where Self: ContentNode {
internal func mutate(is value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "is", value: value)
}
}
extension IsAttribute where Self: EmptyNode {
internal func mutate(is value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "is", value: value)
}
}
/// The protocol provides the element with the itemid handler.
-public protocol ItemIdAttribute: AnyAttribute {
+public protocol ItemIdAttribute: Attribute {
/// The function represents the html-attribute 'itemid'.
///
@@ -1346,27 +1124,22 @@ public protocol ItemIdAttribute: AnyAttribute {
func itemId(_ value: String) -> Self
}
-extension ItemIdAttribute {
-
- internal var key: String { "itemid" }
-}
-
extension ItemIdAttribute where Self: ContentNode {
internal func mutate(itemid value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemid", value: value)
}
}
extension ItemIdAttribute where Self: EmptyNode {
internal func mutate(itemid value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemid", value: value)
}
}
/// The protocol provides the element with the itemproperty handler.
-public protocol ItemPropertyAttribute: AnyAttribute {
+public protocol ItemPropertyAttribute: Attribute {
/// The function represents the html-attribute 'itemprop'.
///
@@ -1376,27 +1149,22 @@ public protocol ItemPropertyAttribute: AnyAttribute {
func itemProperty(_ value: String) -> Self
}
-extension ItemPropertyAttribute {
-
- internal var key: String { "itemprop" }
-}
-
extension ItemPropertyAttribute where Self: ContentNode {
internal func mutate(itemprop value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemprop", value: value)
}
}
extension ItemPropertyAttribute where Self: EmptyNode {
internal func mutate(itemprop value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemprop", value: value)
}
}
/// The protocol provides the element with the itemreference handler.
-public protocol ItemReferenceAttribute: AnyAttribute {
+public protocol ItemReferenceAttribute: Attribute {
/// The function represents the html-attribute 'itemref'.
///
@@ -1406,27 +1174,22 @@ public protocol ItemReferenceAttribute: AnyAttribute {
func itemReference(_ value: String) -> Self
}
-extension ItemReferenceAttribute {
-
- internal var key: String { "itemref" }
-}
-
extension ItemReferenceAttribute where Self: ContentNode {
internal func mutate(itemref value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemref", value: value)
}
}
extension ItemReferenceAttribute where Self: EmptyNode {
internal func mutate(itemref value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemref", value: value)
}
}
/// The protocol provides the element with the itemscope handler.
-public protocol ItemScopeAttribute: AnyAttribute {
+public protocol ItemScopeAttribute: Attribute {
/// The function represents the html-attribute 'itemscope'.
///
@@ -1436,27 +1199,22 @@ public protocol ItemScopeAttribute: AnyAttribute {
func itemScope(_ value: String) -> Self
}
-extension ItemScopeAttribute {
-
- internal var key: String { "itemscope" }
-}
-
extension ItemScopeAttribute where Self: ContentNode {
internal func mutate(itemscope value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemscope", value: value)
}
}
extension ItemScopeAttribute where Self: EmptyNode {
internal func mutate(itemscope value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemscope", value: value)
}
}
/// The protocol provides the element with the itemtype handler
-public protocol ItemTypeAttribute: AnyAttribute {
+public protocol ItemTypeAttribute: Attribute {
/// The function represents the html-attribute 'itemtype'.
///
@@ -1466,27 +1224,22 @@ public protocol ItemTypeAttribute: AnyAttribute {
func itemType(_ value: String) -> Self
}
-extension ItemTypeAttribute {
-
- internal var key: String { "itemtype" }
-}
-
extension ItemTypeAttribute where Self: ContentNode {
internal func mutate(itemtype value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemtype", value: value)
}
}
extension ItemTypeAttribute where Self: EmptyNode {
internal func mutate(itemtype value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "itemtype", value: value)
}
}
/// The protocol provides the element with the kind handler.
-public protocol KindAttribute: AnyAttribute {
+public protocol KindAttribute: Attribute {
/// The function represents the html-attribute 'kind'.
///
@@ -1496,27 +1249,22 @@ public protocol KindAttribute: AnyAttribute {
func kind(_ value: Values.Kind) -> Self
}
-extension KindAttribute {
-
- internal var key: String { "kind" }
-}
-
extension KindAttribute where Self: ContentNode {
internal func mutate(kind value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "kind", value: value)
}
}
extension KindAttribute where Self: EmptyNode {
internal func mutate(kind value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "kind", value: value)
}
}
/// The protocol provides the element with the label handler.
-public protocol LabelAttribute: AnyAttribute {
+public protocol LabelAttribute: Attribute {
/// The function represents the html-attribute 'label'.
///
@@ -1526,27 +1274,22 @@ public protocol LabelAttribute: AnyAttribute {
func label(_ value: String) -> Self
}
-extension LabelAttribute {
-
- internal var key: String { "label" }
-}
-
extension LabelAttribute where Self: ContentNode {
internal func mutate(label value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "label", value: value)
}
}
extension LabelAttribute where Self: EmptyNode {
internal func mutate(label value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "label", value: value)
}
}
/// The protocol provides the element with the language handler.
-public protocol LanguageAttribute: AnyAttribute {
+public protocol LanguageAttribute: Attribute {
/// The function represents the html-attribute 'lang'.
///
@@ -1556,27 +1299,22 @@ public protocol LanguageAttribute: AnyAttribute {
func language(_ value: Values.Language) -> Self
}
-extension LanguageAttribute {
-
- internal var key: String { "lang" }
-}
-
extension LanguageAttribute where Self: ContentNode {
internal func mutate(lang value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "lang", value: value)
}
}
extension LanguageAttribute where Self: EmptyNode {
internal func mutate(lang value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "lang", value: value)
}
}
/// The protocol provides the element with the list handler.
-public protocol ListAttribute: AnyAttribute {
+public protocol ListAttribute: Attribute {
/// The function represents the html-attribute 'list'.
///
@@ -1586,27 +1324,22 @@ public protocol ListAttribute: AnyAttribute {
func list(_ value: String) -> Self
}
-extension ListAttribute {
-
- internal var key: String { "list" }
-}
-
extension ListAttribute where Self: ContentNode {
internal func mutate(list value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "list", value: value)
}
}
extension ListAttribute where Self: EmptyNode {
internal func mutate(list value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "list", value: value)
}
}
/// The protocol provides the element with the loop handler.
-public protocol LoopAttribute: AnyAttribute {
+public protocol LoopAttribute: Attribute {
/// The function represents the html-attribute 'loop'.
///
@@ -1616,27 +1349,22 @@ public protocol LoopAttribute: AnyAttribute {
func loop() -> Self
}
-extension LoopAttribute {
-
- internal var key: String { "loop" }
-}
-
extension LoopAttribute where Self: ContentNode {
internal func mutate(loop value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "loop", value: value)
}
}
extension LoopAttribute where Self: EmptyNode {
internal func mutate(loop value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "loop", value: value)
}
}
/// The protocol provides the element with the low handler.
-public protocol LowAttribute: AnyAttribute {
+public protocol LowAttribute: Attribute {
/// The function represents the html-attribute 'low'.
///
@@ -1646,27 +1374,22 @@ public protocol LowAttribute: AnyAttribute {
func low(_ value: Float) -> Self
}
-extension LowAttribute {
-
- internal var key: String { "low" }
-}
-
extension LowAttribute where Self: ContentNode {
internal func mutate(low value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "low", value: value)
}
}
extension LowAttribute where Self: EmptyNode {
internal func mutate(low value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "low", value: value)
}
}
/// The protocol provides the element with the maximumvalue handler.
-public protocol MaximumValueAttribute: AnyAttribute {
+public protocol MaximumValueAttribute: Attribute {
associatedtype MaximumValueType
@@ -1678,27 +1401,22 @@ public protocol MaximumValueAttribute: AnyAttribute {
func maximum(_ value: MaximumValueType) -> Self
}
-extension MaximumValueAttribute {
-
- internal var key: String { "max" }
-}
-
extension MaximumValueAttribute where Self: ContentNode {
internal func mutate(max value: MaximumValueType) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "max", value: value)
}
}
extension MaximumValueAttribute where Self: EmptyNode {
internal func mutate(max value: MaximumValueType) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "max", value: value)
}
}
/// The protocol provides the element with the maximumlength handler.
-public protocol MaximumLengthAttribute: AnyAttribute {
+public protocol MaximumLengthAttribute: Attribute {
/// The function represents the html-attribute 'maxlength'.
///
@@ -1708,27 +1426,22 @@ public protocol MaximumLengthAttribute: AnyAttribute {
func maximum(length value: Int) -> Self
}
-extension MaximumLengthAttribute {
-
- internal var key: String { "maxlength" }
-}
-
extension MaximumLengthAttribute where Self: ContentNode {
internal func mutate(maxlength value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "maxlength", value: value)
}
}
extension MaximumLengthAttribute where Self: EmptyNode {
internal func mutate(maxlength value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "maxlength", value: value)
}
}
/// The protocol provides the element with the media handler.
-public protocol MediaAttribute: AnyAttribute {
+public protocol MediaAttribute: Attribute {
/// The function represents the html-attribute 'media'.
///
@@ -1738,27 +1451,22 @@ public protocol MediaAttribute: AnyAttribute {
func media(_ value: String) -> Self
}
-extension MediaAttribute {
-
- internal var key: String { "media" }
-}
-
extension MediaAttribute where Self: ContentNode {
internal func mutate(media value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "media", value: value)
}
}
extension MediaAttribute where Self: EmptyNode {
internal func mutate(media value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "media", value: value)
}
}
/// The protocol provides the element with the method handler.
-public protocol MethodAttribute: AnyAttribute {
+public protocol MethodAttribute: Attribute {
/// The function represents the html-attribute 'method'.
///
@@ -1768,27 +1476,22 @@ public protocol MethodAttribute: AnyAttribute {
func method(_ value: Values.Method) -> Self
}
-extension MethodAttribute {
-
- internal var key: String { "method" }
-}
-
extension MethodAttribute where Self: ContentNode {
internal func mutate(method value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "method", value: value)
}
}
extension MethodAttribute where Self: EmptyNode {
internal func mutate(method value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "method", value: value)
}
}
/// The protocol provides the element with the minimumvalue handler.
-public protocol MinimumValueAttribute: AnyAttribute {
+public protocol MinimumValueAttribute: Attribute {
associatedtype MinimumValueType
@@ -1800,27 +1503,22 @@ public protocol MinimumValueAttribute: AnyAttribute {
func minimum(_ value: MinimumValueType) -> Self
}
-extension MinimumValueAttribute {
-
- internal var key: String { "min" }
-}
-
extension MinimumValueAttribute where Self: ContentNode {
internal func mutate(min value: MinimumValueType) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "min", value: value)
}
}
extension MinimumValueAttribute where Self: EmptyNode {
internal func mutate(min value: MinimumValueType) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "min", value: value)
}
}
/// The protocol provides the element with the minimumlength handler.
-public protocol MinimumLengthAttribute: AnyAttribute {
+public protocol MinimumLengthAttribute: Attribute {
/// The function represents the html-attribute 'minlength'.
///
@@ -1830,27 +1528,22 @@ public protocol MinimumLengthAttribute: AnyAttribute {
func minimum(length value: Int) -> Self
}
-extension MinimumLengthAttribute {
-
- internal var key: String { "minlength" }
-}
-
extension MinimumLengthAttribute where Self: ContentNode {
internal func mutate(minlength value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "minlength", value: value)
}
}
extension MinimumLengthAttribute where Self: EmptyNode {
internal func mutate(minlength value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "minlength", value: value)
}
}
/// The protocol provides the element with the multiple handler.
-public protocol MultipleAttribute: AnyAttribute {
+public protocol MultipleAttribute: Attribute {
/// The function represents the html-attribute 'multiple'.
///
@@ -1860,27 +1553,22 @@ public protocol MultipleAttribute: AnyAttribute {
func multiple() -> Self
}
-extension MultipleAttribute {
-
- internal var key: String { "multiple" }
-}
-
extension MultipleAttribute where Self: ContentNode {
internal func mutate(multiple value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "multiple", value: value)
}
}
extension MultipleAttribute where Self: EmptyNode {
internal func mutate(multiple value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "multiple", value: value)
}
}
/// The protocol provides the element with the muted handler.
-public protocol MutedAttribute: AnyAttribute {
+public protocol MutedAttribute: Attribute {
/// The function represents the html-attribute 'muted'.
///
@@ -1890,27 +1578,22 @@ public protocol MutedAttribute: AnyAttribute {
func muted() -> Self
}
-extension MutedAttribute {
-
- internal var key: String { "muted" }
-}
-
extension MutedAttribute where Self: ContentNode {
internal func mutate(muted value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "muted", value: value)
}
}
extension MutedAttribute where Self: EmptyNode {
internal func mutate(muted value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "muted", value: value)
}
}
/// The protocol provides the element with the name handler.
-public protocol NameAttribute: AnyAttribute {
+public protocol NameAttribute: Attribute {
associatedtype NameValue
@@ -1920,32 +1603,24 @@ public protocol NameAttribute: AnyAttribute {
///
/// ```
func name(_ value: NameValue) -> Self
-
- /// The func adds
- func name(_ value: TemplateValue) -> Self
-}
-
-extension NameAttribute {
-
- internal var key: String { "name" }
}
extension NameAttribute where Self: ContentNode {
internal func mutate(name value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "name", value: value)
}
}
extension NameAttribute where Self: EmptyNode {
internal func mutate(name value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "name", value: value)
}
}
/// The protocol provides the element with the nonce handler.
-public protocol NonceAttribute: AnyAttribute {
+public protocol NonceAttribute: Attribute {
/// The function represents the html-attribute 'nonce'.
///
@@ -1955,27 +1630,22 @@ public protocol NonceAttribute: AnyAttribute {
func nonce(_ value: String) -> Self
}
-extension NonceAttribute {
-
- internal var key: String { "nonce" }
-}
-
extension NonceAttribute where Self: ContentNode {
internal func mutate(nonce value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "nonce" , value: value)
}
}
extension NonceAttribute where Self: EmptyNode {
internal func mutate(nonce value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "nonce" , value: value)
}
}
/// The protocol provides the element with the novalidate handler.
-public protocol NoValidateAttribute: AnyAttribute {
+public protocol NoValidateAttribute: Attribute {
/// The function represents the html-attribute 'novalidate'.
///
@@ -1985,27 +1655,22 @@ public protocol NoValidateAttribute: AnyAttribute {
func novalidate() -> Self
}
-extension NoValidateAttribute {
-
- internal var key: String { "novalidate" }
-}
-
extension NoValidateAttribute where Self: ContentNode {
internal func mutate(novalidate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "novalidate", value: value)
}
}
extension NoValidateAttribute where Self: EmptyNode {
internal func mutate(novalidate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "novalidate", value: value)
}
}
/// The protocol provides the element with the open handler.
-public protocol OpenAttribute: AnyAttribute {
+public protocol OpenAttribute: Attribute {
/// The function represents the html-attribute 'open'.
///
@@ -2015,27 +1680,22 @@ public protocol OpenAttribute: AnyAttribute {
func isOpen(_ value: Bool) -> Self
}
-extension OpenAttribute {
-
- internal var key: String { "open" }
-}
-
extension OpenAttribute where Self: ContentNode {
internal func mutate(open value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "open", value: value)
}
}
extension OpenAttribute where Self: EmptyNode {
internal func mutate(open value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "open", value: value)
}
}
/// The protocol provides the element with the optimum handler.
-public protocol OptimumAttribute: AnyAttribute {
+public protocol OptimumAttribute: Attribute {
/// The function represents the html-attribute 'optimum'.
///
@@ -2045,27 +1705,22 @@ public protocol OptimumAttribute: AnyAttribute {
func optimum(_ value: Float) -> Self
}
-extension OptimumAttribute {
-
- internal var key: String { "optimum" }
-}
-
extension OptimumAttribute where Self: ContentNode {
internal func mutate(optimum value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "optimum", value: value)
}
}
extension OptimumAttribute where Self: EmptyNode {
internal func mutate(optimum value: Float) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "optimum", value: value)
}
}
/// The protocol provides the element with the pattern handler.
-public protocol PatternAttribute: AnyAttribute {
+public protocol PatternAttribute: Attribute {
/// The function represents the html-attribute 'pattern'.
///
@@ -2075,27 +1730,22 @@ public protocol PatternAttribute: AnyAttribute {
func pattern(_ regex: String) -> Self
}
-extension PatternAttribute {
-
- internal var key: String { "pattern" }
-}
-
extension PatternAttribute where Self: ContentNode {
internal func mutate(pattern value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "pattern", value: value)
}
}
extension PatternAttribute where Self: EmptyNode {
internal func mutate(pattern value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "pattern", value: value)
}
}
/// The protocol provides the element with the part handler.
-public protocol PartAttribute: AnyAttribute {
+public protocol PartAttribute: Attribute {
/// The function represents the html-attribute 'part'.
///
@@ -2105,27 +1755,22 @@ public protocol PartAttribute: AnyAttribute {
func part(_ value: String) -> Self
}
-extension PartAttribute {
-
- internal var key: String { "part" }
-}
-
extension PartAttribute where Self: ContentNode {
internal func mutate(part value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "part", value: value)
}
}
extension PartAttribute where Self: EmptyNode {
internal func mutate(part value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "part", value: value)
}
}
/// The protocol provides the element with the ping handler.
-public protocol PingAttribute: AnyAttribute {
+public protocol PingAttribute: Attribute {
/// The function represents the html-attribute 'ping'.
///
@@ -2135,27 +1780,22 @@ public protocol PingAttribute: AnyAttribute {
func ping(_ value: String) -> Self
}
-extension PingAttribute {
-
- internal var key: String { "ping" }
-}
-
extension PingAttribute where Self: ContentNode {
internal func mutate(ping value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "ping", value: value)
}
}
extension PingAttribute where Self: EmptyNode {
internal func mutate(ping value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "ping", value: value)
}
}
/// The protocol provides the element with the placeholder handler.
-public protocol PlaceholderAttribute: AnyAttribute {
+public protocol PlaceholderAttribute: Attribute {
/// The function represents the html-attribute 'placeholder'.
///
@@ -2163,31 +1803,24 @@ public protocol PlaceholderAttribute: AnyAttribute {
///
/// ```
func placeholder(_ value: String) -> Self
-
- func placeholder(_ value: TemplateValue) -> Self
-}
-
-extension PlaceholderAttribute {
-
- internal var key: String { "placeholder" }
}
extension PlaceholderAttribute where Self: ContentNode {
internal func mutate(placeholder value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "placeholder", value: value)
}
}
extension PlaceholderAttribute where Self: EmptyNode {
internal func mutate(placeholder value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "placeholder", value: value)
}
}
/// The protocol provides the element with the poster handler.
-public protocol PosterAttribute: AnyAttribute {
+public protocol PosterAttribute: Attribute {
/// The function represents the html-attribute 'poster'.
///
@@ -2197,27 +1830,22 @@ public protocol PosterAttribute: AnyAttribute {
func poster(_ value: String) -> Self
}
-extension PosterAttribute {
-
- internal var key: String { "poster" }
-}
-
extension PosterAttribute where Self: ContentNode {
internal func mutate(poster value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "poster", value: value)
}
}
extension PosterAttribute where Self: EmptyNode {
internal func mutate(poster value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "poster", value: value)
}
}
/// The protocol provides the element with the preload handler.
-public protocol PreloadAttribute: AnyAttribute {
+public protocol PreloadAttribute: Attribute {
/// The function represents the html-attribute 'preload'.
///
@@ -2227,27 +1855,22 @@ public protocol PreloadAttribute: AnyAttribute {
func preload(_ value: Values.Preload) -> Self
}
-extension PreloadAttribute {
-
- internal var key: String { "preload" }
-}
-
extension PreloadAttribute where Self: ContentNode {
internal func mutate(preload value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "preload", value: value)
}
}
extension PreloadAttribute where Self: EmptyNode {
internal func mutate(preload value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "preload", value: value)
}
}
/// The protocol provides the element with the readonly handler.
-public protocol ReadyOnlyAttribute: AnyAttribute {
+public protocol ReadyOnlyAttribute: Attribute {
/// The function represents the html-attribute 'readonly'.
///
@@ -2257,27 +1880,22 @@ public protocol ReadyOnlyAttribute: AnyAttribute {
func readonly() -> Self
}
-extension ReadyOnlyAttribute {
-
- internal var key: String { "readonly" }
-}
-
extension ReadyOnlyAttribute where Self: ContentNode {
internal func mutate(readonly value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "readonly", value: value)
}
}
extension ReadyOnlyAttribute where Self: EmptyNode {
internal func mutate(readonly value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "readonly", value: value)
}
}
/// The protocol provides the element with the referrerpolicy handler.
-public protocol ReferrerPolicyAttribute: AnyAttribute {
+public protocol ReferrerPolicyAttribute: Attribute {
/// The function represents the html-attribute 'referrerpolicy'.
///
@@ -2287,27 +1905,22 @@ public protocol ReferrerPolicyAttribute: AnyAttribute {
func referrerPolicy(_ value: Values.Policy) -> Self
}
-extension ReferrerPolicyAttribute {
-
- internal var key: String { "referrerpolicy" }
-}
-
extension ReferrerPolicyAttribute where Self: ContentNode {
internal func mutate(referrerpolicy value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "referrerpolicy", value: value)
}
}
extension ReferrerPolicyAttribute where Self: EmptyNode {
internal func mutate(referrerpolicy value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "referrerpolicy", value: value)
}
}
/// The protocol provides the element with the relationship handler.
-public protocol RelationshipAttribute: AnyAttribute {
+public protocol RelationshipAttribute: Attribute {
/// The function represents the html-attribute 'rel'.
///
@@ -2317,27 +1930,22 @@ public protocol RelationshipAttribute: AnyAttribute {
func relationship(_ value: Values.Relation) -> Self
}
-extension RelationshipAttribute {
-
- internal var key: String { "rel" }
-}
-
extension RelationshipAttribute where Self: ContentNode {
internal func mutate(rel value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rel", value: value)
}
}
extension RelationshipAttribute where Self: EmptyNode {
internal func mutate(rel value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rel", value: value)
}
}
/// The protocol provides the element with the required handler.
-public protocol RequiredAttribute: AnyAttribute {
+public protocol RequiredAttribute: Attribute {
/// The function represents the html-attribute 'required'.
///
@@ -2347,27 +1955,22 @@ public protocol RequiredAttribute: AnyAttribute {
func required() -> Self
}
-extension RequiredAttribute {
-
- internal var key: String { "required" }
-}
-
extension RequiredAttribute where Self: ContentNode {
internal func mutate(required value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "required", value: value)
}
}
extension RequiredAttribute where Self: EmptyNode {
internal func mutate(required value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "required", value: value)
}
}
/// The protocol provides the element with the reversed handler.
-public protocol ReversedAttribute: AnyAttribute {
+public protocol ReversedAttribute: Attribute {
/// The function represents the html-attribute 'reversed'.
///
@@ -2377,27 +1980,22 @@ public protocol ReversedAttribute: AnyAttribute {
func reversed() -> Self
}
-extension ReversedAttribute {
-
- internal var key: String { "reversed" }
-}
-
extension ReversedAttribute where Self: ContentNode {
internal func mutate(reversed value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "reversed", value: value)
}
}
extension ReversedAttribute where Self: EmptyNode {
internal func mutate(reversed value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "reversed", value: value)
}
}
/// The protocol provides the element with the role handler.
-public protocol RoleAttribute: AnyAttribute {
+public protocol RoleAttribute: Attribute {
/// The function represents the html-attribute 'role'.
///
@@ -2407,27 +2005,22 @@ public protocol RoleAttribute: AnyAttribute {
func role(_ value: Values.Role) -> Self
}
-extension RoleAttribute {
-
- internal var key: String { "role" }
-}
-
extension RoleAttribute where Self: ContentNode {
internal func mutate(role value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "role", value: value)
}
}
extension RoleAttribute where Self: EmptyNode {
internal func mutate(role value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "role", value: value)
}
}
/// The protocol provides the element with the rows handler.
-public protocol RowsAttribute: AnyAttribute {
+public protocol RowsAttribute: Attribute {
/// The function represents the html-attribute 'rows'.
///
@@ -2437,27 +2030,22 @@ public protocol RowsAttribute: AnyAttribute {
func rows(_ size: Int) -> Self
}
-extension RowsAttribute {
-
- internal var key: String { "rows" }
-}
-
extension RowsAttribute where Self: ContentNode {
internal func mutate(rows value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rows", value: value)
}
}
extension RowsAttribute where Self: EmptyNode {
internal func mutate(rows value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rows", value: value)
}
}
/// The protocol provides the element with the rowspan handler.
-public protocol RowSpanAttribute: AnyAttribute {
+public protocol RowSpanAttribute: Attribute {
/// The function represents the html-attribute 'rowspan'.
///
@@ -2467,27 +2055,22 @@ public protocol RowSpanAttribute: AnyAttribute {
func rowSpan(_ size: Int) -> Self
}
-extension RowSpanAttribute {
-
- internal var key: String { "rowspan" }
-}
-
extension RowSpanAttribute where Self: ContentNode {
internal func mutate(rowspan value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rowspan", value: value)
}
}
extension RowSpanAttribute where Self: EmptyNode {
internal func mutate(rowspan value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "rowspan", value: value)
}
}
/// The protocol provides the element with the sandbox handler.
-public protocol SandboxAttribute: AnyAttribute {
+public protocol SandboxAttribute: Attribute {
/// The function represents the html-attribute 'sandbox'.
///
@@ -2497,27 +2080,22 @@ public protocol SandboxAttribute: AnyAttribute {
func sandbox() -> Self
}
-extension SandboxAttribute {
-
- internal var key: String { "sandbox" }
-}
-
extension SandboxAttribute where Self: ContentNode {
internal func mutate(sandbox value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "sandbox", value: value)
}
}
extension SandboxAttribute where Self: EmptyNode {
internal func mutate(sandbox value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "sandbox", value: value)
}
}
/// The protocol provides the element with the scope handler.
-public protocol ScopeAttribute: AnyAttribute {
+public protocol ScopeAttribute: Attribute {
/// The function represents the html-attribute 'scope'.
///
@@ -2527,27 +2105,22 @@ public protocol ScopeAttribute: AnyAttribute {
func scope(_ value: String) -> Self
}
-extension ScopeAttribute {
-
- internal var key: String { "scope" }
-}
-
extension ScopeAttribute where Self: ContentNode {
internal func mutate(scope value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "scope", value: value)
}
}
extension ScopeAttribute where Self: EmptyNode {
internal func mutate(scope value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "scope", value: value)
}
}
/// The protocol provides the element with the shape handler.
-public protocol ShapeAttribute: AnyAttribute {
+public protocol ShapeAttribute: Attribute {
/// The function represents the html-attribute 'shape'.
///
@@ -2557,27 +2130,22 @@ public protocol ShapeAttribute: AnyAttribute {
func shape(_ value: Values.Shape) -> Self
}
-extension ShapeAttribute {
-
- internal var key: String { "shape" }
-}
-
extension ShapeAttribute where Self: ContentNode {
internal func mutate(shape value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "shape", value: value)
}
}
extension ShapeAttribute where Self: EmptyNode {
internal func mutate(shape value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "shape", value: value)
}
}
/// The protocol provides the element with the size handler.
-public protocol SizeAttribute: AnyAttribute {
+public protocol SizeAttribute: Attribute {
/// The function represents the html-attribute 'size'.
///
@@ -2587,27 +2155,22 @@ public protocol SizeAttribute: AnyAttribute {
func size(_ size: Int) -> Self
}
-extension SizeAttribute {
-
- internal var key: String { "size" }
-}
-
extension SizeAttribute where Self: ContentNode {
internal func mutate(size value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "size", value: value)
}
}
extension SizeAttribute where Self: EmptyNode {
internal func mutate(size value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "size", value: value)
}
}
/// The protocol provides the element with the sizes handler.
-public protocol SizesAttribute: AnyAttribute {
+public protocol SizesAttribute: Attribute {
/// The function represents the html-attribute 'sizes'.
///
@@ -2617,27 +2180,22 @@ public protocol SizesAttribute: AnyAttribute {
func sizes(_ size: Int) -> Self
}
-extension SizesAttribute {
-
- internal var key: String { "sizes" }
-}
-
extension SizesAttribute where Self: ContentNode {
internal func mutate(sizes value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "sizes", value: value)
}
}
extension SizesAttribute where Self: EmptyNode {
internal func mutate(sizes value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "sizes", value: value)
}
}
/// The protocol provides the element with the slot handler.
-public protocol SlotAttribute: AnyAttribute {
+public protocol SlotAttribute: Attribute {
/// The function represents the html-attribute 'slot'.
///
@@ -2647,27 +2205,22 @@ public protocol SlotAttribute: AnyAttribute {
func slot(_ value: String) -> Self
}
-extension SlotAttribute {
-
- internal var key: String { "slot" }
-}
-
extension SlotAttribute where Self: ContentNode {
internal func mutate(slot value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "slot", value: value)
}
}
extension SlotAttribute where Self: EmptyNode {
internal func mutate(slot value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "slot", value: value)
}
}
/// The protocol provides the element with the span handler.
-public protocol SpanAttribute: AnyAttribute {
+public protocol SpanAttribute: Attribute {
/// The function represents the html-attribute 'span'.
///
@@ -2677,27 +2230,22 @@ public protocol SpanAttribute: AnyAttribute {
func span(_ size: Int) -> Self
}
-extension SpanAttribute {
-
- internal var key: String { "span" }
-}
-
extension SpanAttribute where Self: ContentNode {
internal func mutate(span value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "span", value: value)
}
}
extension SpanAttribute where Self: EmptyNode {
internal func mutate(span value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "span", value: value)
}
}
/// The protocol provides the element with the hasspellcheck handler.
-public protocol SpellCheckAttribute: AnyAttribute {
+public protocol SpellCheckAttribute: Attribute {
/// The function represents the html-attribute 'spellcheck'.
///
@@ -2707,27 +2255,22 @@ public protocol SpellCheckAttribute: AnyAttribute {
func hasSpellCheck(_ value: Bool) -> Self
}
-extension SpellCheckAttribute {
-
- internal var key: String { "spellcheck" }
-}
-
extension SpellCheckAttribute where Self: ContentNode {
internal func mutate(spellcheck value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "spellcheck", value: value)
}
}
extension SpellCheckAttribute where Self: EmptyNode {
internal func mutate(spellcheck value: Bool) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "spellcheck", value: value)
}
}
/// The protocol provides the element with the source handler.
-public protocol SourceAttribute: AnyAttribute {
+public protocol SourceAttribute: Attribute {
/// The function represents the html-attribute 'src'.
///
@@ -2737,27 +2280,22 @@ public protocol SourceAttribute: AnyAttribute {
func source(_ value: String) -> Self
}
-extension SourceAttribute {
-
- internal var key: String { "src" }
-}
-
extension SourceAttribute where Self: ContentNode {
internal func mutate(source value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "src", value: value)
}
}
extension SourceAttribute where Self: EmptyNode {
internal func mutate(source value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "src", value: value)
}
}
/// The protocol provides the element with the start handler.
-public protocol StartAttribute: AnyAttribute {
+public protocol StartAttribute: Attribute {
/// The function represents the html-attribute 'start'.
///
@@ -2767,27 +2305,22 @@ public protocol StartAttribute: AnyAttribute {
func start(_ size: Int) -> Self
}
-extension StartAttribute {
-
- internal var key: String { "start" }
-}
-
extension StartAttribute where Self: ContentNode {
internal func mutate(start value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "start", value: value)
}
}
extension StartAttribute where Self: EmptyNode {
internal func mutate(start value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "start", value: value)
}
}
/// The protocol provides the element with the step handler.
-public protocol StepAttribute: AnyAttribute {
+public protocol StepAttribute: Attribute {
/// The function represents the html-attribute 'step'.
///
@@ -2797,27 +2330,22 @@ public protocol StepAttribute: AnyAttribute {
func step(_ size: Int) -> Self
}
-extension StepAttribute {
-
- internal var key: String { "step" }
-}
-
extension StepAttribute where Self: ContentNode {
internal func mutate(step value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "step", value: value)
}
}
extension StepAttribute where Self: EmptyNode {
internal func mutate(step value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "step", value: value)
}
}
/// The protocol provides the element with the style handler.
-public protocol StyleAttribute: AnyAttribute {
+public protocol StyleAttribute: Attribute {
/// The function represents the html-attribute 'style'.
///
@@ -2827,27 +2355,22 @@ public protocol StyleAttribute: AnyAttribute {
func style(_ value: String) -> Self
}
-extension StyleAttribute {
-
- internal var key: String { "style" }
-}
-
extension StyleAttribute where Self: ContentNode {
internal func mutate(style value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "style", value: value)
}
}
extension StyleAttribute where Self: EmptyNode {
internal func mutate(style value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "style", value: value)
}
}
/// The protocol provides the element with the tabindex handler.
-public protocol TabulatorAttribute: AnyAttribute {
+public protocol TabulatorAttribute: Attribute {
/// The function represents the html-attribute 'tabindex'.
///
@@ -2857,27 +2380,22 @@ public protocol TabulatorAttribute: AnyAttribute {
func tabIndex(_ value: Int) -> Self
}
-extension TabulatorAttribute {
-
- internal var key: String { "tabindex" }
-}
-
extension TabulatorAttribute where Self: ContentNode {
internal func mutate(tabindex value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "tabindex", value: value)
}
}
extension TabulatorAttribute where Self: EmptyNode {
internal func mutate(tabindex value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "tabindex", value: value)
}
}
/// The protocol provides the element with the target handler.
-public protocol TargetAttribute: AnyAttribute {
+public protocol TargetAttribute: Attribute {
/// The function represents the html-attribute 'target'.
///
@@ -2887,27 +2405,22 @@ public protocol TargetAttribute: AnyAttribute {
func target(_ value: Values.Target) -> Self
}
-extension TargetAttribute {
-
- internal var key: String { "target" }
-}
-
extension TargetAttribute where Self: ContentNode {
internal func mutate(target value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "target", value: value)
}
}
extension TargetAttribute where Self: EmptyNode {
internal func mutate(target value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "target", value: value)
}
}
/// The protocol provides the element with the title handler.
-public protocol TitleAttribute: AnyAttribute {
+public protocol TitleAttribute: Attribute {
/// The function represents the html-attribute 'title'.
///
@@ -2917,27 +2430,22 @@ public protocol TitleAttribute: AnyAttribute {
func title(_ value: String) -> Self
}
-extension TitleAttribute {
-
- internal var key: String { "title" }
-}
-
extension TitleAttribute where Self: ContentNode {
internal func mutate(title value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "title", value: value)
}
}
extension TitleAttribute where Self: EmptyNode {
internal func mutate(title value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "title", value: value)
}
}
/// The protocol provides the element with the translate handler.
-public protocol TranslateAttribute: AnyAttribute {
+public protocol TranslateAttribute: Attribute {
/// The function represents the html-attribute 'translate'.
///
@@ -2947,27 +2455,22 @@ public protocol TranslateAttribute: AnyAttribute {
func translate(_ value: Values.Decision) -> Self
}
-extension TranslateAttribute {
-
- internal var key: String { "translate" }
-}
-
extension TranslateAttribute where Self: ContentNode {
internal func mutate(translate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "translate", value: value)
}
}
extension TranslateAttribute where Self: EmptyNode {
internal func mutate(translate value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "translate", value: value)
}
}
/// The protocol provides the element with the type handler.
-public protocol TypeAttribute: AnyAttribute {
+public protocol TypeAttribute: Attribute {
associatedtype TypeValue
@@ -2979,27 +2482,22 @@ public protocol TypeAttribute: AnyAttribute {
func type(_ value: TypeValue) -> Self
}
-extension TypeAttribute {
-
- internal var key: String { "type" }
-}
-
extension TypeAttribute where Self: ContentNode {
internal func mutate(type value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "type", value: value)
}
}
extension TypeAttribute where Self: EmptyNode {
internal func mutate(type value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "type", value: value)
}
}
/// The protocol provides the element with the value handler.
-public protocol ValueAttribute: AnyAttribute {
+public protocol ValueAttribute: Attribute {
/// The function represents the html-attribute 'value'.
///
@@ -3007,31 +2505,24 @@ public protocol ValueAttribute: AnyAttribute {
///
/// ```
func value(_ value: String) -> Self
-
- func value(_ value: TemplateValue) -> Self
-}
-
-extension ValueAttribute {
-
- internal var key: String { "value" }
}
extension ValueAttribute where Self: ContentNode {
internal func mutate(value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "value", value: value)
}
}
extension ValueAttribute where Self: EmptyNode {
internal func mutate(value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "value", value: value)
}
}
/// The protocol provides the element with the width handler.
-public protocol WidthAttribute: AnyAttribute {
+public protocol WidthAttribute: Attribute {
/// The function represents the html-attribute 'width'.
///
@@ -3041,27 +2532,22 @@ public protocol WidthAttribute: AnyAttribute {
func width(_ size: Int) -> Self
}
-extension WidthAttribute {
-
- internal var key: String { "width" }
-}
-
extension WidthAttribute where Self: ContentNode {
internal func mutate(width value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "width", value: value)
}
}
extension WidthAttribute where Self: EmptyNode {
internal func mutate(width value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "width", value: value)
}
}
/// The protocol provides the element with the wrap handler.
-public protocol WrapAttribute: AnyAttribute {
+public protocol WrapAttribute: Attribute {
/// The function represents the html-attribute 'wrap'.
///
@@ -3071,27 +2557,22 @@ public protocol WrapAttribute: AnyAttribute {
func wrap(_ value: Values.Wrapping) -> Self
}
-extension WrapAttribute {
-
- internal var key: String { "wrap" }
-}
-
extension WrapAttribute where Self: ContentNode {
internal func mutate(wrap value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "wrap", value: value)
}
}
extension WrapAttribute where Self: EmptyNode {
internal func mutate(wrap value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "wrap", value: value)
}
}
/// The protocol provides the element with the property handler.
-public protocol PropertyAttribute: AnyAttribute {
+public protocol PropertyAttribute: Attribute {
/// The function represents the html-attribute 'property'.
///
@@ -3103,27 +2584,22 @@ public protocol PropertyAttribute: AnyAttribute {
func property(_ value: Values.Graph) -> Self
}
-extension PropertyAttribute {
-
- internal var key: String { "property" }
-}
-
extension PropertyAttribute where Self: ContentNode {
internal func mutate(property value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "property", value: value)
}
}
extension PropertyAttribute where Self: EmptyNode {
internal func mutate(property value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "property", value: value)
}
}
/// The protocol provides the element with the selected handler.
-public protocol SelectedAttribute: AnyAttribute {
+public protocol SelectedAttribute: Attribute {
/// The function represents the html-attribute 'selected'.
///
@@ -3133,21 +2609,16 @@ public protocol SelectedAttribute: AnyAttribute {
func selected() -> Self
}
-extension SelectedAttribute {
-
- internal var key: String { "selected" }
-}
-
extension SelectedAttribute where Self: ContentNode {
internal func mutate(selected value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "selected", value: value)
}
}
extension SelectedAttribute where Self: EmptyNode {
internal func mutate(selected value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "selected", value: value)
}
}
diff --git a/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
index cf98c2a9..2d538a91 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/EventAttributes.swift
@@ -12,7 +12,7 @@ import OrderedCollections
public typealias GlobalEventAttributes = ClipboardEventAttribute & DragEventAttribute & WheelEventAttribute & KeyboardEventAttribute & MouseEventAttribute
/// The protocol provides the element with event handler.
-public protocol WindowEventAttribute: AnyAttribute {
+public protocol WindowEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -23,7 +23,7 @@ public protocol WindowEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol FocusEventAttribute: AnyAttribute {
+public protocol FocusEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -34,7 +34,7 @@ public protocol FocusEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol PointerEventAttribute: AnyAttribute {
+public protocol PointerEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -45,7 +45,7 @@ public protocol PointerEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol MouseEventAttribute: AnyAttribute {
+public protocol MouseEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -56,7 +56,7 @@ public protocol MouseEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol WheelEventAttribute: AnyAttribute {
+public protocol WheelEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -67,7 +67,7 @@ public protocol WheelEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol InputEventAttribute: AnyAttribute {
+public protocol InputEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -78,7 +78,7 @@ public protocol InputEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol KeyboardEventAttribute: AnyAttribute {
+public protocol KeyboardEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -89,7 +89,7 @@ public protocol KeyboardEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol DragEventAttribute: AnyAttribute {
+public protocol DragEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -100,7 +100,7 @@ public protocol DragEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol ClipboardEventAttribute: AnyAttribute {
+public protocol ClipboardEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -111,7 +111,7 @@ public protocol ClipboardEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol SelectionEventAttribute: AnyAttribute {
+public protocol SelectionEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -122,7 +122,7 @@ public protocol SelectionEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.r.
-public protocol MediaEventAttribute: AnyAttribute {
+public protocol MediaEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -133,7 +133,7 @@ public protocol MediaEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol FormEventAttribute: AnyAttribute {
+public protocol FormEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
@@ -144,7 +144,7 @@ public protocol FormEventAttribute: AnyAttribute {
}
/// The protocol provides the element with event handler.
-public protocol DetailEventAttribute: AnyAttribute {
+public protocol DetailEventAttribute: Attribute {
/// The function represents the html-attribute 'on'.
///
diff --git a/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift b/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
index 903881f3..0501b911 100644
--- a/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
+++ b/Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift
@@ -12,7 +12,7 @@ import OrderedCollections
public typealias GlobalVectorAttributes = IdentifierAttribute & TabulatorAttribute & ClassAttribute & StyleAttribute & FillAttribute & FillOpacityAttribute & StrokeAttribute & StrokeWidthAttribute & StrokeOpacityAttribute & StrokeLineCapAttribute & StrokeLineJoinAttribute
/// The protocol provides the element with the draw handler.
-public protocol DrawAttribute: AnyAttribute {
+public protocol DrawAttribute: Attribute {
/// The function represents the html-attribute 'd'.
///
@@ -22,21 +22,16 @@ public protocol DrawAttribute: AnyAttribute {
func draw(_ value: String) -> Self
}
-extension DrawAttribute {
-
- internal var key: String { "d" }
-}
-
extension DrawAttribute where Self: ContentNode {
internal func mutate(draw value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "d", value: value)
}
}
/// The protocol provides the element with the fill handler.
-public protocol FillAttribute: AnyAttribute {
+public protocol FillAttribute: Attribute {
/// The function represents the html-attribute 'fill'.
///
@@ -46,20 +41,15 @@ public protocol FillAttribute: AnyAttribute {
func fill(_ value: String) -> Self
}
-extension FillAttribute {
-
- internal var key: String { "fill" }
-}
-
extension FillAttribute where Self: ContentNode {
internal func mutate(fill value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "fill", value: value)
}
}
/// The protocol provides the element with the fill-opacity handler.
-public protocol FillOpacityAttribute: AnyAttribute {
+public protocol FillOpacityAttribute: Attribute {
/// The function represents the html-attribute 'fill-opacity"'.
///
@@ -69,20 +59,15 @@ public protocol FillOpacityAttribute: AnyAttribute {
func fillOpacity(_ value: Double) -> Self
}
-extension FillOpacityAttribute {
-
- internal var key: String { "fill-opacity" }
-}
-
extension FillOpacityAttribute where Self: ContentNode {
internal func mutate(fillopacity value: Double) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "fill-opacity", value: value)
}
}
/// The protocol provides the element with the stroke handler.
-public protocol StrokeAttribute: AnyAttribute {
+public protocol StrokeAttribute: Attribute {
/// The function represents the html-attribute 'stroke'.
///
@@ -92,20 +77,15 @@ public protocol StrokeAttribute: AnyAttribute {
func stroke(_ value: String) -> Self
}
-extension StrokeAttribute {
-
- internal var key: String { "stroke" }
-}
-
extension StrokeAttribute where Self: ContentNode {
internal func mutate(stroke value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "stroke", value: value)
}
}
/// The protocol provides the element with the stroke-width handler.
-public protocol StrokeWidthAttribute: AnyAttribute {
+public protocol StrokeWidthAttribute: Attribute {
/// The function represents the html-attribute 'stroke-width'.
///
@@ -115,20 +95,15 @@ public protocol StrokeWidthAttribute: AnyAttribute {
func strokeWidth(_ size: Int) -> Self
}
-extension StrokeWidthAttribute {
-
- internal var key: String { "stroke-width" }
-}
-
extension StrokeWidthAttribute where Self: ContentNode {
internal func mutate(strokewidth value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "stroke-width", value: value)
}
}
/// The protocol provides the element with the stroke-opacity handler.
-public protocol StrokeOpacityAttribute: AnyAttribute {
+public protocol StrokeOpacityAttribute: Attribute {
/// The function represents the html-attribute 'stroke-opacity'.
///
@@ -138,20 +113,15 @@ public protocol StrokeOpacityAttribute: AnyAttribute {
func strokeOpacity(_ value: Double) -> Self
}
-extension StrokeOpacityAttribute {
-
- internal var key: String { "stroke-opacity" }
-}
-
extension StrokeOpacityAttribute where Self: ContentNode {
internal func mutate(strokeopacity value: Double) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "stroke-opacity", value: value)
}
}
/// The protocol provides the element with the stroke-linecap handler.
-public protocol StrokeLineCapAttribute: AnyAttribute {
+public protocol StrokeLineCapAttribute: Attribute {
/// The function represents the html-attribute 'stroke-linecap'.
///
@@ -161,20 +131,15 @@ public protocol StrokeLineCapAttribute: AnyAttribute {
func strokeLineCap(_ value: Values.Linecap) -> Self
}
-extension StrokeLineCapAttribute {
-
- internal var key: String { "stroke-linecap" }
-}
-
extension StrokeLineCapAttribute where Self: ContentNode {
internal func mutate(strokelinecap value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "stroke-linecap", value: value)
}
}
/// The protocol provides the element with the stroke-linejoin handler.
-public protocol StrokeLineJoinAttribute: AnyAttribute {
+public protocol StrokeLineJoinAttribute: Attribute {
/// The function represents the html-attribute 'stroke-linejoin'.
///
@@ -184,20 +149,15 @@ public protocol StrokeLineJoinAttribute: AnyAttribute {
func strokeLineJoin(_ value: Values.Linejoin) -> Self
}
-extension StrokeLineJoinAttribute {
-
- internal var key: String { "stroke-linejoin" }
-}
-
extension StrokeLineJoinAttribute where Self: ContentNode {
internal func mutate(strokelinejoin value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "stroke-linejoin", value: value)
}
}
/// The protocol provides the element with the radius handler.
-public protocol RadiusAttribute: AnyAttribute {
+public protocol RadiusAttribute: Attribute {
/// The function represents the html-attribute 'r'.
///
@@ -207,20 +167,15 @@ public protocol RadiusAttribute: AnyAttribute {
func radius(_ size: Int) -> Self
}
-extension RadiusAttribute {
-
- internal var key: String { "r" }
-}
-
extension RadiusAttribute where Self: ContentNode {
internal func mutate(radius value: Int) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "r", value: value)
}
}
/// The protocol provides the element with the radius handler.
-public protocol PositionPointAttribute: AnyAttribute {
+public protocol PositionPointAttribute: Attribute {
/// The function represents the html-attribute 'x' and 'y'.
///
@@ -251,7 +206,7 @@ extension PositionPointAttribute where Self: ContentNode {
}
/// The protocol provides the element with the radius handler.
-public protocol RadiusPointAttribute: AnyAttribute {
+public protocol RadiusPointAttribute: Attribute {
/// The function represents the html-attribute 'rx' and 'ry'.
///
@@ -282,7 +237,7 @@ extension RadiusPointAttribute where Self: ContentNode {
}
/// The protocol provides the element with the radius handler.
-public protocol CenterPointAttribute: AnyAttribute {
+public protocol CenterPointAttribute: Attribute {
/// The function represents the html-attribute 'cx' and 'cy'.
///
@@ -313,7 +268,7 @@ extension CenterPointAttribute where Self: ContentNode {
}
/// The protocol provides the element with the viewbox handler.
-public protocol ViewBoxAttribute: AnyAttribute {
+public protocol ViewBoxAttribute: Attribute {
/// The function represents the html-attribute 'viewbox'.
///
@@ -323,14 +278,9 @@ public protocol ViewBoxAttribute: AnyAttribute {
func viewBox(_ value: String) -> Self
}
-extension ViewBoxAttribute {
-
- internal var key: String { "viewbox" }
-}
-
extension ViewBoxAttribute where Self: ContentNode {
internal func mutate(viewbox value: String) -> Self {
- return self.mutate(key: self.key, value: value)
+ return self.mutate(key: "viewbox", value: value)
}
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
index 536b3b06..997614cb 100644
--- a/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/BasicElements.swift
@@ -22,17 +22,6 @@ public struct Comment: CommentNode, GlobalElement {
}
}
-extension Comment: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents the document type.
///
/// ```html
@@ -47,27 +36,6 @@ public struct Document: DocumentNode, BasicElement {
}
}
-extension Document: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
-extension Document {
-
- // MARK: Deprecations
-
- @available(*, deprecated, message: "Use Document(_ value: Values.Doctype) instead.")
- public init(type: Values.Doctype) {
- self.content = type.rawValue
- }
-}
-
/// The element represents the document's root element.
///
/// ```html
@@ -99,26 +67,13 @@ public struct Html: ContentNode, BasicElement {
return self
}
- public func modify(unwrap value: TemplateValue, element: (Html, TemplateValue) -> Html) -> Html {
+ public func modify(unwrap value: T?, element: (Html, T) -> Html) -> Html {
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -191,10 +146,6 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
public func id(_ value: String) -> Html {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Html {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Html {
return mutate(lang: value.rawValue)
@@ -204,11 +155,6 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Html {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Html {
return mutate(role: value.rawValue)
}
@@ -228,11 +174,6 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
public func title(_ value: String) -> Html {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Html {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Html {
return mutate(translate: value.rawValue)
@@ -263,13 +204,49 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
}
}
-extension Html: AnyContent {
+public struct Custom: CustomNode, GlobalElement {
+
+ public var name: String
+
+ public var attributes: OrderedDictionary?
+
+ public var content: [Content]
+
+ public init(name: String, @ContentBuilder content: () -> [Content]) {
+
+ self.name = name
+ self.content = content()
+ }
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
+ public init(name: String, attributes: OrderedDictionary?, content: [Content]) {
+
+ self.name = name
+ self.attributes = attributes
+ self.content = content
}
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
+ public func modify(if condition: Bool, element: (Custom) -> Custom) -> Custom {
+
+ if condition {
+ return self.modify(element(self))
+ }
+
+ return self
+ }
+
+ public func modify(unwrap value: T?, element: (Custom, T) -> Custom) -> Custom {
+
+ guard let value = value else {
+ return self
+ }
+
+ return self.modify(element(self, value as T))
+ }
+}
+
+extension Custom: Attribute {
+
+ public func custom(key: String, value: Any) -> Custom {
+ return mutate(key: key, value: value)
}
}
diff --git a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
index 86b0b7d5..b301a538 100644
--- a/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
+++ b/Sources/HTMLKit/Abstraction/Elements/BodyElements.swift
@@ -352,13 +352,13 @@ public struct Article: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -372,26 +372,13 @@ public struct Article: ContentNode, HtmlElement, BodyElement, FormElement, Figur
return self
}
- public func modify(unwrap value: TemplateValue, element: (Article, TemplateValue) -> Article) -> Article {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Article, T) -> Article) -> Article {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -464,10 +451,6 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func id(_ value: String) -> Article {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Article {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Article {
return mutate(lang: value.rawValue)
@@ -477,11 +460,6 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Article {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Article {
return mutate(role: value.rawValue)
}
@@ -501,11 +479,6 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func title(_ value: String) -> Article {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Article {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Article {
return mutate(translate: value.rawValue)
@@ -612,17 +585,6 @@ extension Article: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-extension Article: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a generic section of the document.
///
/// ```html
@@ -634,13 +596,13 @@ public struct Section: ContentNode, HtmlElement, BodyElement, FigureElement, For
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -654,26 +616,13 @@ public struct Section: ContentNode, HtmlElement, BodyElement, FigureElement, For
return self
}
- public func modify(unwrap value: TemplateValue, element: (Section, TemplateValue) -> Section) -> Section {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Section, T) -> Section) -> Section {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -746,10 +695,6 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func id(_ value: String) -> Section {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Section {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Section {
return mutate(lang: value.rawValue)
@@ -759,11 +704,6 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Section {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Section {
return mutate(role: value.rawValue)
}
@@ -783,11 +723,6 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func title(_ value: String) -> Section {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Section {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Section {
return mutate(translate: value.rawValue)
@@ -894,17 +829,6 @@ extension Section: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-extension Section: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a section of a page that links to other pages or parts within the page.
///
/// ```html
@@ -916,13 +840,13 @@ public struct Navigation: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -936,26 +860,13 @@ public struct Navigation: ContentNode, HtmlElement, BodyElement, FormElement, Fi
return self
}
- public func modify(unwrap value: TemplateValue, element: (Navigation, TemplateValue) -> Navigation) -> Navigation {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Navigation, T) -> Navigation) -> Navigation {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -1028,10 +939,6 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
public func id(_ value: String) -> Navigation {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Navigation {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Navigation {
return mutate(lang: value.rawValue)
@@ -1041,11 +948,6 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Navigation {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Navigation {
return mutate(role: value.rawValue)
}
@@ -1065,11 +967,6 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
public func title(_ value: String) -> Navigation {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Navigation {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Navigation {
return mutate(translate: value.rawValue)
@@ -1176,17 +1073,6 @@ extension Navigation: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
}
}
-extension Navigation: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element defines some content aside from the content it is placed in.
///
/// ```html
@@ -1198,13 +1084,13 @@ public struct Aside: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -1218,26 +1104,13 @@ public struct Aside: ContentNode, HtmlElement, BodyElement, FormElement, FigureE
return self
}
- public func modify(unwrap value: TemplateValue, element: (Aside, TemplateValue) -> Aside) -> Aside {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Aside, T) -> Aside) -> Aside {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -1310,10 +1183,6 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
public func id(_ value: String) -> Aside {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Aside {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Aside {
return mutate(lang: value.rawValue)
@@ -1323,11 +1192,6 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Aside {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Aside {
return mutate(role: value.rawValue)
}
@@ -1347,11 +1211,6 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
public func title(_ value: String) -> Aside {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Aside {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Aside {
return mutate(translate: value.rawValue)
@@ -1458,17 +1317,6 @@ extension Aside: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes {
}
}
-extension Aside: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a heading.
///
/// ```html
@@ -1480,13 +1328,13 @@ public struct Heading1: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -1500,26 +1348,13 @@ public struct Heading1: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading1, TemplateValue) -> Heading1) -> Heading1 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading1, T) -> Heading1) -> Heading1 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -1528,59 +1363,59 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func accessKey(_ value: Character) -> Heading1 {
return mutate(accesskey: value)
}
-
+
public func autocapitalize(_ value: Values.Capitalization) -> Heading1 {
return mutate(autocapitalize: value.rawValue)
}
-
+
public func autofocus() -> Heading1 {
return mutate(autofocus: "autofocus")
}
-
+
public func `class`(_ value: String) -> Heading1 {
return mutate(class: value)
}
-
+
public func isEditable(_ value: Bool) -> Heading1 {
return mutate(contenteditable: value)
}
-
+
public func direction(_ value: Values.Direction) -> Heading1 {
return mutate(dir: value.rawValue)
}
-
+
public func isDraggable(_ value: Bool) -> Heading1 {
return mutate(draggable: value)
}
-
+
public func enterKeyHint(_ value: Values.Hint) -> Heading1 {
return mutate(enterkeyhint: value.rawValue)
}
-
+
public func hidden() -> Heading1 {
return mutate(hidden: "hidden")
}
-
+
public func inputMode(_ value: String) -> Heading1 {
return mutate(inputmode: value)
}
-
+
public func `is`(_ value: String) -> Heading1 {
return mutate(is: value)
}
-
+
public func itemId(_ value: String) -> Heading1 {
return mutate(itemid: value)
}
-
+
public func itemProperty(_ value: String) -> Heading1 {
return mutate(itemprop: value)
}
-
+
public func itemReference(_ value: String) -> Heading1 {
return mutate(itemref: value)
}
-
+
public func itemScope(_ value: String) -> Heading1 {
return mutate(itemscope: value)
}
@@ -1588,52 +1423,38 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func itemType(_ value: String) -> Heading1 {
return mutate(itemtype: value)
}
-
+
public func id(_ value: String) -> Heading1 {
return mutate(id: value)
}
- public func id(_ value: TemplateValue) -> Heading1 {
- return mutate(id: value.rawValue)
- }
-
public func language(_ value: Values.Language) -> Heading1 {
return mutate(lang: value.rawValue)
}
-
+
public func nonce(_ value: String) -> Heading1 {
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading1 {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Heading1 {
return mutate(role: value.rawValue)
}
-
+
public func hasSpellCheck(_ value: Bool) -> Heading1 {
return mutate(spellcheck: value)
}
-
+
public func style(_ value: String) -> Heading1 {
return mutate(style: value)
}
-
+
public func tabIndex(_ value: Int) -> Heading1 {
return mutate(tabindex: value)
}
-
+
public func title(_ value: String) -> Heading1 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading1 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading1 {
return mutate(translate: value.rawValue)
@@ -1740,25 +1561,14 @@ extension Heading1: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading1: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading1: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -1773,13 +1583,13 @@ public struct Heading2: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -1793,26 +1603,13 @@ public struct Heading2: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading2, TemplateValue) -> Heading2) -> Heading2 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading2, T) -> Heading2) -> Heading2 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -1821,59 +1618,59 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func accessKey(_ value: Character) -> Heading2 {
return mutate(accesskey: value)
}
-
+
public func autocapitalize(_ value: Values.Capitalization) -> Heading2 {
return mutate(autocapitalize: value.rawValue)
}
-
+
public func autofocus() -> Heading2 {
return mutate(autofocus: "autofocus")
}
-
+
public func `class`(_ value: String) -> Heading2 {
return mutate(class: value)
}
-
+
public func isEditable(_ value: Bool) -> Heading2 {
return mutate(contenteditable: value)
}
-
+
public func direction(_ value: Values.Direction) -> Heading2 {
return mutate(dir: value.rawValue)
}
-
+
public func isDraggable(_ value: Bool) -> Heading2 {
return mutate(draggable: value)
}
-
+
public func enterKeyHint(_ value: Values.Hint) -> Heading2 {
return mutate(enterkeyhint: value.rawValue)
}
-
+
public func hidden() -> Heading2 {
return mutate(hidden: "hidden")
}
-
+
public func inputMode(_ value: String) -> Heading2 {
return mutate(inputmode: value)
}
-
+
public func `is`(_ value: String) -> Heading2 {
return mutate(is: value)
}
-
+
public func itemId(_ value: String) -> Heading2 {
return mutate(itemid: value)
}
-
+
public func itemProperty(_ value: String) -> Heading2 {
return mutate(itemprop: value)
}
-
+
public func itemReference(_ value: String) -> Heading2 {
return mutate(itemref: value)
}
-
+
public func itemScope(_ value: String) -> Heading2 {
return mutate(itemscope: value)
}
@@ -1881,52 +1678,38 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func itemType(_ value: String) -> Heading2 {
return mutate(itemtype: value)
}
-
+
public func id(_ value: String) -> Heading2 {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Heading2 {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Heading2 {
return mutate(lang: value.rawValue)
}
-
+
public func nonce(_ value: String) -> Heading2 {
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading2 {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> Heading2 {
return mutate(role: value.rawValue)
}
-
+
public func hasSpellCheck(_ value: Bool) -> Heading2 {
return mutate(spellcheck: value)
}
-
+
public func style(_ value: String) -> Heading2 {
return mutate(style: value)
}
-
+
public func tabIndex(_ value: Int) -> Heading2 {
return mutate(tabindex: value)
}
-
+
public func title(_ value: String) -> Heading2 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading2 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading2 {
return mutate(translate: value.rawValue)
@@ -2033,25 +1816,14 @@ extension Heading2: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading2: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading2: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -2066,13 +1838,13 @@ public struct Heading3: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -2086,26 +1858,13 @@ public struct Heading3: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading3, TemplateValue) -> Heading3) -> Heading3 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading3, T) -> Heading3) -> Heading3 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -2178,10 +1937,6 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func id(_ value: String) -> Heading3 {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Heading3 {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Heading3 {
return mutate(lang: value.rawValue)
@@ -2190,11 +1945,6 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func nonce(_ value: String) -> Heading3 {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading3 {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Heading3 {
return mutate(role: value.rawValue)
@@ -2215,11 +1965,6 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func title(_ value: String) -> Heading3 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading3 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading3 {
return mutate(translate: value.rawValue)
@@ -2326,25 +2071,14 @@ extension Heading3: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading3: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading3: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -2359,13 +2093,13 @@ public struct Heading4: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -2379,26 +2113,13 @@ public struct Heading4: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading4, TemplateValue) -> Heading4) -> Heading4 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading4, T) -> Heading4) -> Heading4 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -2471,10 +2192,6 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func id(_ value: String) -> Heading4 {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Heading4 {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Heading4 {
return mutate(lang: value.rawValue)
@@ -2483,11 +2200,6 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func nonce(_ value: String) -> Heading4 {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading4 {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Heading4 {
return mutate(role: value.rawValue)
@@ -2508,11 +2220,6 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func title(_ value: String) -> Heading4 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading4 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading4 {
return mutate(translate: value.rawValue)
@@ -2619,25 +2326,14 @@ extension Heading4: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading4: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading4: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -2652,13 +2348,13 @@ public struct Heading5: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -2672,26 +2368,13 @@ public struct Heading5: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading5, TemplateValue) -> Heading5) -> Heading5 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading5, T) -> Heading5) -> Heading5 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -2764,10 +2447,6 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func id(_ value: String) -> Heading5 {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Heading5 {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Heading5 {
return mutate(lang: value.rawValue)
@@ -2776,11 +2455,6 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func nonce(_ value: String) -> Heading5 {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading5 {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Heading5 {
return mutate(role: value.rawValue)
@@ -2801,11 +2475,6 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func title(_ value: String) -> Heading5 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading5 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading5 {
return mutate(translate: value.rawValue)
@@ -2912,25 +2581,14 @@ extension Heading5: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading5: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading5: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -2945,13 +2603,13 @@ public struct Heading6: ContentNode, HtmlElement, BodyElement, FormElement, Figu
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -2965,26 +2623,13 @@ public struct Heading6: ContentNode, HtmlElement, BodyElement, FormElement, Figu
return self
}
- public func modify(unwrap value: TemplateValue, element: (Heading6, TemplateValue) -> Heading6) -> Heading6 {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Heading6, T) -> Heading6) -> Heading6 {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -3057,10 +2702,6 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func id(_ value: String) -> Heading6 {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Heading6 {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Heading6 {
return mutate(lang: value.rawValue)
@@ -3069,11 +2710,6 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func nonce(_ value: String) -> Heading6 {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Heading6 {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Heading6 {
return mutate(role: value.rawValue)
@@ -3094,11 +2730,6 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
public func title(_ value: String) -> Heading6 {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Heading6 {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Heading6 {
return mutate(translate: value.rawValue)
@@ -3205,25 +2836,14 @@ extension Heading6: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribute
}
}
-extension Heading6: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Heading6: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -3238,13 +2858,13 @@ public struct HeadingGroup: ContentNode, HtmlElement, BodyElement, FormElement,
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -3258,26 +2878,13 @@ public struct HeadingGroup: ContentNode, HtmlElement, BodyElement, FormElement,
return self
}
- public func modify(unwrap value: TemplateValue, element: (HeadingGroup, TemplateValue) -> HeadingGroup) -> HeadingGroup {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (HeadingGroup, T) -> HeadingGroup) -> HeadingGroup {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -3350,10 +2957,6 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
public func id(_ value: String) -> HeadingGroup {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> HeadingGroup {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> HeadingGroup {
return mutate(lang: value.rawValue)
@@ -3363,11 +2966,6 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> HeadingGroup {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> HeadingGroup {
return mutate(role: value.rawValue)
}
@@ -3387,11 +2985,6 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
public func title(_ value: String) -> HeadingGroup {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> HeadingGroup {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> HeadingGroup {
return mutate(translate: value.rawValue)
@@ -3498,17 +3091,6 @@ extension HeadingGroup: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttri
}
}
-extension HeadingGroup: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a header.
///
/// ```html
@@ -3520,13 +3102,13 @@ public struct Header: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -3540,26 +3122,13 @@ public struct Header: ContentNode, HtmlElement, BodyElement, FormElement, Figure
return self
}
- public func modify(unwrap value: TemplateValue, element: (Header, TemplateValue) -> Header) -> Header {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Header, T) -> Header) -> Header {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -3632,10 +3201,6 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func id(_ value: String) -> Header {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Header {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Header {
return mutate(lang: value.rawValue)
@@ -3644,11 +3209,6 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func nonce(_ value: String) -> Header {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Header {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Header {
return mutate(role: value.rawValue)
@@ -3669,11 +3229,6 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func title(_ value: String) -> Header {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Header {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Header {
return mutate(translate: value.rawValue)
@@ -3780,17 +3335,6 @@ extension Header: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-extension Header: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a footer.
///
/// ```html
@@ -3802,13 +3346,13 @@ public struct Footer: ContentNode, HtmlElement, BodyElement, FormElement, Figure
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -3822,26 +3366,13 @@ public struct Footer: ContentNode, HtmlElement, BodyElement, FormElement, Figure
return self
}
- public func modify(unwrap value: TemplateValue, element: (Footer, TemplateValue) -> Footer) -> Footer {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Footer, T) -> Footer) -> Footer {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -3914,10 +3445,6 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func id(_ value: String) -> Footer {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Footer {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Footer {
return mutate(lang: value.rawValue)
@@ -3926,11 +3453,6 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func nonce(_ value: String) -> Footer {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Footer {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Footer {
return mutate(role: value.rawValue)
@@ -3951,11 +3473,6 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func title(_ value: String) -> Footer {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Footer {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Footer {
return mutate(translate: value.rawValue)
@@ -4062,17 +3579,6 @@ extension Footer: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-extension Footer: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents the contact information.
///
/// ```html
@@ -4084,13 +3590,13 @@ public struct Address: ContentNode, HtmlElement, BodyElement, FormElement, Figur
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -4104,26 +3610,13 @@ public struct Address: ContentNode, HtmlElement, BodyElement, FormElement, Figur
return self
}
- public func modify(unwrap value: TemplateValue, element: (Address, TemplateValue) -> Address) -> Address {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Address, T) -> Address) -> Address {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -4196,10 +3689,6 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func id(_ value: String) -> Address {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Address {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Address {
return mutate(lang: value.rawValue)
@@ -4208,11 +3697,6 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func nonce(_ value: String) -> Address {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Address {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Address {
return mutate(role: value.rawValue)
@@ -4233,11 +3717,6 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
public func title(_ value: String) -> Address {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Address {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Address {
return mutate(translate: value.rawValue)
@@ -4344,17 +3823,6 @@ extension Address: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttributes
}
}
-extension Address: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element is used to define a paragraph.
///
/// ```html
@@ -4366,13 +3834,13 @@ public struct Paragraph: ContentNode, HtmlElement, BodyElement, FormElement, Fig
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -4386,26 +3854,13 @@ public struct Paragraph: ContentNode, HtmlElement, BodyElement, FormElement, Fig
return self
}
- public func modify(unwrap value: TemplateValue, element: (Paragraph, TemplateValue) -> Paragraph) -> Paragraph {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Paragraph, T) -> Paragraph) -> Paragraph {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -4479,10 +3934,6 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
return mutate(id: value)
}
- public func id(_ value: TemplateValue) -> Paragraph {
- return mutate(id: value.rawValue)
- }
-
public func language(_ value: Values.Language) -> Paragraph {
return mutate(lang: value.rawValue)
}
@@ -4490,11 +3941,6 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
public func nonce(_ value: String) -> Paragraph {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Paragraph {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Paragraph {
return mutate(role: value.rawValue)
@@ -4515,11 +3961,6 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
public func title(_ value: String) -> Paragraph {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Paragraph {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Paragraph {
return mutate(translate: value.rawValue)
@@ -4626,25 +4067,14 @@ extension Paragraph: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribut
}
}
-extension Paragraph: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Paragraph: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -4674,26 +4104,13 @@ public struct HorizontalRule: EmptyNode, HtmlElement, BodyElement, FormElement,
return self
}
- public func modify(unwrap value: TemplateValue, element: (HorizontalRule, TemplateValue) -> HorizontalRule) -> HorizontalRule {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (HorizontalRule, T) -> HorizontalRule) -> HorizontalRule {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -4766,10 +4183,6 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt
public func id(_ value: String) -> HorizontalRule {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> HorizontalRule {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> HorizontalRule {
return mutate(lang: value.rawValue)
@@ -4779,11 +4192,6 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt
return mutate(nonce: value)
}
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> HorizontalRule {
- return mutate(role: value)
- }
-
public func role(_ value: Values.Role) -> HorizontalRule {
return mutate(role: value.rawValue)
}
@@ -4803,11 +4211,6 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt
public func title(_ value: String) -> HorizontalRule {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> HorizontalRule {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> HorizontalRule {
return mutate(translate: value.rawValue)
@@ -4914,17 +4317,6 @@ extension HorizontalRule: GlobalAttributes, GlobalEventAttributes, GlobalAriaAtt
}
}
-extension HorizontalRule: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a block of preformatted text.
///
/// ```html
@@ -4936,13 +4328,13 @@ public struct PreformattedText: ContentNode, HtmlElement, BodyElement, FormEleme
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -4956,26 +4348,13 @@ public struct PreformattedText: ContentNode, HtmlElement, BodyElement, FormEleme
return self
}
- public func modify(unwrap value: TemplateValue, element: (PreformattedText, TemplateValue) -> PreformattedText) -> PreformattedText {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (PreformattedText, T) -> PreformattedText) -> PreformattedText {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -5048,10 +4427,6 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA
public func id(_ value: String) -> PreformattedText {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> PreformattedText {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> PreformattedText {
return mutate(lang: value.rawValue)
@@ -5060,11 +4435,6 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA
public func nonce(_ value: String) -> PreformattedText {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> PreformattedText {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> PreformattedText {
return mutate(role: value.rawValue)
@@ -5085,11 +4455,6 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA
public func title(_ value: String) -> PreformattedText {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> PreformattedText {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> PreformattedText {
return mutate(translate: value.rawValue)
@@ -5196,17 +4561,6 @@ extension PreformattedText: GlobalAttributes, GlobalEventAttributes, GlobalAriaA
}
}
-extension PreformattedText: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
/// The element represents a section that is quoted from another source.
///
/// ```html
@@ -5218,13 +4572,13 @@ public struct Blockquote: ContentNode, HtmlElement, BodyElement, FormElement, Fi
internal var attributes: OrderedDictionary?
- internal var content: [AnyContent]
+ internal var content: [Content]
- public init(@ContentBuilder content: () -> [AnyContent]) {
+ public init(@ContentBuilder content: () -> [Content]) {
self.content = content()
}
- internal init(attributes: OrderedDictionary?, content: [AnyContent]) {
+ internal init(attributes: OrderedDictionary?, content: [Content]) {
self.attributes = attributes
self.content = content
}
@@ -5238,26 +4592,13 @@ public struct Blockquote: ContentNode, HtmlElement, BodyElement, FormElement, Fi
return self
}
- public func modify(unwrap value: TemplateValue, element: (Blockquote, TemplateValue) -> Blockquote) -> Blockquote {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (Blockquote, T) -> Blockquote) -> Blockquote {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -5330,10 +4671,6 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
public func id(_ value: String) -> Blockquote {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> Blockquote {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> Blockquote {
return mutate(lang: value.rawValue)
@@ -5342,11 +4679,6 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
public func nonce(_ value: String) -> Blockquote {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> Blockquote {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> Blockquote {
return mutate(role: value.rawValue)
@@ -5367,11 +4699,6 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
public func title(_ value: String) -> Blockquote {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> Blockquote {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> Blockquote {
return mutate(translate: value.rawValue)
@@ -5482,25 +4809,14 @@ extension Blockquote: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttribu
}
}
-extension Blockquote: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager) throws -> String {
- try self.build(with: manager)
- }
-}
-
extension Blockquote: Localizable {
public init(_ localizedKey: String) {
- self.content = [Localized(key: localizedKey)]
+ self.content = [LocalizedStringKey(key: localizedKey)]
}
- public init(_ localizedKey: String, with context: TemplateValue) where B : Encodable {
- self.content = [Localized(key: localizedKey, context: context)]
+ public init(_ localizedKey: String, with context: some Encodable) {
+ self.content = [LocalizedStringKey(key: localizedKey, context: context)]
}
}
@@ -5535,26 +4851,13 @@ public struct OrderedList: ContentNode, HtmlElement, BodyElement, FormElement, F
return self
}
- public func modify(unwrap value: TemplateValue, element: (OrderedList, TemplateValue) -> OrderedList) -> OrderedList {
-
- switch value {
- case .constant(let optional):
-
- guard let value = optional else {
- return self
- }
-
- return self.modify(element(self, .constant(value)))
-
- case .dynamic(let context):
-
- if context.isMasqueradingOptional {
- return self.modify(element(self, .dynamic(context.unsafeCast(to: T.self))))
-
- } else {
- return self.modify(element(self, .dynamic(context.unsafelyUnwrapped)))
- }
+ public func modify(unwrap value: T?, element: (OrderedList, T) -> OrderedList) -> OrderedList {
+
+ guard let value = value else {
+ return self
}
+
+ return self.modify(element(self, value as T))
}
}
@@ -5627,10 +4930,6 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
public func id(_ value: String) -> OrderedList {
return mutate(id: value)
}
-
- public func id(_ value: TemplateValue) -> OrderedList {
- return mutate(id: value.rawValue)
- }
public func language(_ value: Values.Language) -> OrderedList {
return mutate(lang: value.rawValue)
@@ -5639,11 +4938,6 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
public func nonce(_ value: String) -> OrderedList {
return mutate(nonce: value)
}
-
- @available(*, deprecated, message: "use role(_ value: Values.Roles) instead")
- public func role(_ value: String) -> OrderedList {
- return mutate(role: value)
- }
public func role(_ value: Values.Role) -> OrderedList {
return mutate(role: value.rawValue)
@@ -5664,11 +4958,6 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
public func title(_ value: String) -> OrderedList {
return mutate(title: value)
}
-
- @available(*, deprecated, message: "use translate(_ value: Values.Decision) instead")
- public func translate(_ value: String) -> OrderedList {
- return mutate(translate: value)
- }
public func translate(_ value: Values.Decision) -> OrderedList {
return mutate(translate: value.rawValue)
@@ -5787,17 +5076,6 @@ extension OrderedList: GlobalAttributes, GlobalEventAttributes, GlobalAriaAttrib
}
}
-extension OrderedList: AnyContent {
-
- public func prerender(_ formula: Formula) throws {
- try self.build(formula)
- }
-
- public func render(with manager: ContextManager