Skip to content

Commit 57372a9

Browse files
committed
Mark older deprecations as unavailable
1 parent 7dfb8e3 commit 57372a9

18 files changed

Lines changed: 663 additions & 854 deletions

Sources/HTMLKit/Abstraction/Attributes/BasicAttributes.swift

Lines changed: 12 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -754,38 +754,6 @@ extension ControlsAttribute where Self: EmptyNode {
754754
}
755755
}
756756

757-
/// A type that provides the `coordinates` modifier.
758-
@_documentation(visibility: internal)
759-
public protocol CoordinatesAttribute: Attribute {
760-
761-
/// Use coordinates to define the area.
762-
///
763-
/// ```swift
764-
/// Area()
765-
/// .shape(.rect)
766-
/// .coordinates("0, 0, 200, 100")
767-
/// ```
768-
///
769-
/// - Parameter value: The coordinates on which to base the shape.
770-
///
771-
/// - Returns: The element
772-
func coordinates(_ value: String) -> Self
773-
}
774-
775-
extension CoordinatesAttribute where Self: ContentNode {
776-
777-
internal func mutate(coords value: AttributeData) -> Self {
778-
return self.mutate(key: "coords", value: value)
779-
}
780-
}
781-
782-
extension CoordinatesAttribute where Self: EmptyNode {
783-
784-
internal func mutate(coords value: AttributeData) -> Self {
785-
return self.mutate(key: "coords", value: value)
786-
}
787-
}
788-
789757
/// A type that provides the `crossOrigin` modifier
790758
@_documentation(visibility: internal)
791759
public protocol CrossOriginAttribute: Attribute {
@@ -3061,13 +3029,21 @@ extension ShapeAttribute where Self: ContentNode {
30613029
internal func mutate(shape value: AttributeData) -> Self {
30623030
return self.mutate(key: "shape", value: value)
30633031
}
3032+
3033+
internal func mutate(coords value: AttributeData) -> Self {
3034+
return self.mutate(key: "coords", value: value)
3035+
}
30643036
}
30653037

30663038
extension ShapeAttribute where Self: EmptyNode {
30673039

30683040
internal func mutate(shape value: AttributeData) -> Self {
30693041
return self.mutate(key: "shape", value: value)
30703042
}
3043+
3044+
internal func mutate(coords value: AttributeData) -> Self {
3045+
return self.mutate(key: "coords", value: value)
3046+
}
30713047
}
30723048

30733049
/// A type that provides the `size` modifier.
@@ -4167,43 +4143,17 @@ extension PopoverTargetAttribute where Self: ContentNode {
41674143
internal func mutate(popovertarget value: AttributeData) -> Self {
41684144
return self.mutate(key: "popovertarget", value: value)
41694145
}
4146+
4147+
internal func mutate(popoveraction value: AttributeData) -> Self {
4148+
return self.mutate(key: "popovertargetaction", value: value)
4149+
}
41704150
}
41714151

41724152
extension PopoverTargetAttribute where Self: EmptyNode {
41734153

41744154
internal func mutate(popovertarget value: AttributeData) -> Self {
41754155
return self.mutate(key: "popovertarget", value: value)
41764156
}
4177-
}
4178-
4179-
/// A type that provides the `popoverAction` modifier
4180-
@_documentation(visibility: internal)
4181-
public protocol PopoverActionAttribute: Attribute {
4182-
4183-
/// Specify the action for the popover.
4184-
///
4185-
/// ```swift
4186-
/// Button {
4187-
/// "Lorem ipsum"
4188-
/// }
4189-
/// .popoverTarget("id")
4190-
/// .popoverAction(.hide)
4191-
/// ```
4192-
///
4193-
/// - Parameter action: The action to perform when triggered.
4194-
///
4195-
/// - Returns: The element
4196-
func popoverAction(_ action: Values.Popover.Action) -> Self
4197-
}
4198-
4199-
extension PopoverActionAttribute where Self: ContentNode {
4200-
4201-
internal func mutate(popoveraction value: AttributeData) -> Self {
4202-
return self.mutate(key: "popovertargetaction", value: value)
4203-
}
4204-
}
4205-
4206-
extension PopoverActionAttribute where Self: EmptyNode {
42074157

42084158
internal func mutate(popoveraction value: AttributeData) -> Self {
42094159
return self.mutate(key: "popovertargetaction", value: value)

Sources/HTMLKit/Abstraction/Attributes/VectorAttributes.swift

Lines changed: 1 addition & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import OrderedCollections
22

33
/// The alias combines the global attributes of the vector attributes.
44
@_documentation(visibility: internal)
5-
public typealias GlobalVectorAttributes = IdentifierAttribute & TabulatorAttribute & ClassAttribute & StyleAttribute & FillAttribute & FillOpacityAttribute & StrokeAttribute & StrokeWidthAttribute & StrokeOpacityAttribute & StrokeLineCapAttribute & StrokeLineJoinAttribute
5+
public typealias GlobalVectorAttributes = IdentifierAttribute & TabulatorAttribute & ClassAttribute & StyleAttribute & FillAttribute & StrokeAttribute
66

77
/// A type that provides the `draw` modifier.
88
@_documentation(visibility: internal)
@@ -56,29 +56,6 @@ extension FillAttribute where Self: ContentNode {
5656
internal func mutate(fill value: AttributeData) -> Self {
5757
return self.mutate(key: "fill", value: value)
5858
}
59-
}
60-
61-
/// A type that provides the `fillOpacity` modifier.
62-
@_documentation(visibility: internal)
63-
public protocol FillOpacityAttribute: Attribute {
64-
65-
/// Define the opacity of the filling.
66-
///
67-
/// ```swift
68-
/// Vector {
69-
/// Circle {
70-
/// }
71-
/// .fillOpacity(0.5)
72-
/// }
73-
/// ```
74-
///
75-
/// - Parameter value: The opacity to apply.
76-
///
77-
/// - Returns: The element
78-
func fillOpacity(_ value: Double) -> Self
79-
}
80-
81-
extension FillOpacityAttribute where Self: ContentNode {
8259

8360
internal func mutate(fillopacity value: AttributeData) -> Self {
8461
return self.mutate(key: "fill-opacity", value: value)
@@ -132,87 +109,6 @@ extension StrokeAttribute where Self: ContentNode {
132109
}
133110
}
134111

135-
/// A type that provides the `strokeWidth` modifier.
136-
@_documentation(visibility: internal)
137-
public protocol StrokeWidthAttribute: Attribute {
138-
139-
/// Set the thickness of the stroke.
140-
///
141-
/// ```swift
142-
/// Vector {
143-
/// Circle {
144-
/// }
145-
/// .strokeWidth(3)
146-
/// }
147-
/// ```
148-
///
149-
/// - Parameter size: The thickness to apply to the stroke.
150-
///
151-
/// - Returns: The element
152-
func strokeWidth(_ size: Int) -> Self
153-
}
154-
155-
/// A type that provides the `strokeOpacity` modifier.
156-
@_documentation(visibility: internal)
157-
public protocol StrokeOpacityAttribute: Attribute {
158-
159-
/// Set the opacity for the stroke.
160-
///
161-
/// ```swift
162-
/// Vector {
163-
/// Line {
164-
/// }
165-
/// .strokeOpacity(0.8)
166-
/// }
167-
/// ```
168-
///
169-
/// - Parameter value: The level to apply to the stroke.
170-
///
171-
/// - Returns: The element
172-
func strokeOpacity(_ value: Double) -> Self
173-
}
174-
175-
/// A type that provides the `strokeLineCap` modifier.
176-
@_documentation(visibility: internal)
177-
public protocol StrokeLineCapAttribute: Attribute {
178-
179-
/// Set the shape of the stroke end.
180-
///
181-
/// ```swift
182-
/// Vector {
183-
/// Line {
184-
/// }
185-
/// .strokeLineCap(.butt)
186-
/// }
187-
/// ```
188-
///
189-
/// - Parameter value: The shape to end the stroke.
190-
///
191-
/// - Returns: The element
192-
func strokeLineCap(_ value: Values.Linecap) -> Self
193-
}
194-
195-
/// A type that provides the `strokeLineJoin` modifier.
196-
@_documentation(visibility: internal)
197-
public protocol StrokeLineJoinAttribute: Attribute {
198-
199-
/// Set the shape of the stroke join.
200-
///
201-
/// ```swift
202-
/// Vector {
203-
/// Line {
204-
/// }
205-
/// .strokeLineJoin(.miter)
206-
/// }
207-
/// ```
208-
///
209-
/// - Parameter value: The shape when two lines meet.
210-
///
211-
/// - Returns: The element
212-
func strokeLineJoin(_ value: Values.Linejoin) -> Self
213-
}
214-
215-
216112
/// A type that provides the `radius` modifier.
217113
@_documentation(visibility: internal)
218114
public protocol RadiusAttribute: Attribute {

Sources/HTMLKit/Abstraction/Elements/BasicElements.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
155155
return mutate(class: .init(EnumeratedList(values: names, separator: " "), context: .tainted(.html)))
156156
}
157157

158-
@available(*, deprecated, message: "Use the editable(_:) modifier instead.")
158+
@available(*, unavailable, message: "Use the editable(_:) modifier instead.")
159159
public func isEditable(_ value: Bool) -> Html {
160160
return mutate(contenteditable: .init(value, context: .trusted))
161161
}
@@ -168,7 +168,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
168168
return mutate(dir: .init(value.rawValue, context: .trusted))
169169
}
170170

171-
@available(*, deprecated, message: "Use the draggable(_:) modifier instead.")
171+
@available(*, unavailable, message: "Use the draggable(_:) modifier instead.")
172172
public func isDraggable(_ value: Bool) -> Html {
173173
return mutate(draggable: .init(value, context: .trusted))
174174
}
@@ -177,7 +177,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
177177
return mutate(draggable: .init(value, context: .trusted))
178178
}
179179

180-
@available(*, deprecated, message: "Use the enterKey(_:) modifier instead.")
180+
@available(*, unavailable, message: "Use the enterKey(_:) modifier instead.")
181181
public func enterKeyHint(_ value: Values.Hint) -> Html {
182182
return mutate(enterkeyhint: .init(value.rawValue, context: .trusted))
183183
}
@@ -263,7 +263,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
263263
return mutate(role: .init(value.rawValue, context: .trusted))
264264
}
265265

266-
@available(*, deprecated, message: "Use the spellcheck(_:) modifier instead.")
266+
@available(*, unavailable, message: "Use the spellcheck(_:) modifier instead.")
267267
public func hasSpellCheck(_ value: Bool) -> Html {
268268
return mutate(spellcheck: .init(value, context: .trusted))
269269
}
@@ -293,7 +293,7 @@ extension Html: GlobalAttributes, GlobalEventAttributes {
293293
return mutate(title: .init(value, context: .tainted(.html)))
294294
}
295295

296-
@available(*, deprecated, message: "Use the translate(_:) modifier instead.")
296+
@available(*, unavailable, message: "Use the translate(_:) modifier instead.")
297297
public func translate(_ value: Values.Decision) -> Html {
298298
return mutate(translate: .init(value.rawValue, context: .trusted))
299299
}

0 commit comments

Comments
 (0)