Skip to content

Commit d1be5b1

Browse files
authored
Merge pull request #154 from liveviewnative/naming-convention
Consistent naming convention
2 parents f1f9985 + 17d9ef1 commit d1be5b1

28 files changed

+67
-67
lines changed

Sources/LiveViewNative/BuiltinRegistry.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,43 @@ struct BuiltinRegistry {
1414
@ViewBuilder
1515
static func lookup<R: CustomRegistry>(_ name: String, _ element: ElementNode, context: LiveContext<R>) -> some View {
1616
switch name {
17-
case "textfield":
17+
case "text-field":
1818
TextField<R>(element: element, context: context)
19-
case "securefield":
19+
case "secure-field":
2020
SecureField<R>(element: element, context: context)
2121
case "text":
2222
Text(context: context)
23-
case "hstack":
23+
case "h-stack", "hstack":
2424
HStack<R>(element: element, context: context)
25-
case "vstack":
25+
case "v-stack", "vstack":
2626
VStack<R>(element: element, context: context)
27-
case "zstack":
27+
case "z-stack", "zstack":
2828
ZStack<R>(element: element, context: context)
2929
case "button":
3030
Button<R>(element: element, context: context, action: nil)
3131
case "image":
3232
Image(element: element, context: context)
33-
case "asyncimage":
33+
case "async-image":
3434
AsyncImage(element: element, context: context)
35-
case "scrollview":
35+
case "scroll-view":
3636
ScrollView<R>(element: element, context: context)
3737
case "spacer":
3838
Spacer(element: element, context: context)
39-
case "navigationlink":
39+
case "navigation-link":
4040
NavigationLink(element: element, context: context)
4141
case "list":
4242
List<R>(element: element, context: context)
4343
case "rectangle":
4444
Shape(element: element, context: context, shape: Rectangle())
45-
case "roundedrectangle":
45+
case "rounded-rectangle":
4646
Shape(element: element, context: context, shape: RoundedRectangle(from: element))
4747
case "circle":
4848
Shape(element: element, context: context, shape: Circle())
4949
case "ellipse":
5050
Shape(element: element, context: context, shape: Ellipse())
5151
case "capsule":
5252
Shape(element: element, context: context, shape: Capsule(from: element))
53-
case "containerrelativeshape":
53+
case "container-relative-shape":
5454
Shape(element: element, context: context, shape: ContainerRelativeShape())
5555
case "lvn-link":
5656
Link(element: element, context: context)

Sources/LiveViewNative/LiveViewNative.docc/Elements/AsyncImage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AsyncImage
22

3-
`<asyncimage>`, displays images loaded from a remote URL.
3+
`<async-image>`, displays images loaded from a remote URL.
44

55
## Attributes
66

Sources/LiveViewNative/LiveViewNative.docc/Elements/HStack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HStack
22

3-
`<hstack>`, lays out children in a horizontal line.
3+
`<h-stack>`, lays out children in a horizontal line.
44

55
## Attributes
66

Sources/LiveViewNative/LiveViewNative.docc/Elements/NavigationLink.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NavigationLink
22

3-
`<navigationlink>`, links to another live view page.
3+
`<navigation-link>`, links to another live view page.
44

55
## Attributes
66

Sources/LiveViewNative/LiveViewNative.docc/Elements/RoundedRectangle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RoundedRectangle
22

3-
`<roundedrectangle>`, a rectangle shape with rounded corners.
3+
`<rounded-rectangle>`, a rectangle shape with rounded corners.
44

55
## Attributes
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ScrollView
22

3-
`<scrollview>`, allows its content to be scrolled if it's larger than the available space.
3+
`<scroll-view>`, allows its content to be scrolled if it's larger than the available space.
44

55
## Attributes

Sources/LiveViewNative/LiveViewNative.docc/Elements/TextField.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TextField
22

3-
`<textfield>`, a text field form element.
3+
`<text-field>`, a text field form element.
44

55
## Overview
66

Sources/LiveViewNative/LiveViewNative.docc/Elements/VStack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VStack
22

3-
`<vstack>`, lays out children in a vertical line
3+
`<v-stack>`, lays out children in a vertical line
44

55
## Attributes
66

Sources/LiveViewNative/LiveViewNative.docc/Elements/ZStack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ZStack
22

3-
`<zstack>`, lays out children on top of each other, from back to front.
3+
`<z-stack>`, lays out children on top of each other, from back to front.
44

55
## Attributes
66

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<list>
22
<%= for name <- @cats do %>
3-
<hstack id={name}>
4-
<asyncimage src={"/images/cats/#{name}.jpg"} modifiers='[{"type": "frame", "width": 100, "height": 100}]' />
3+
<h-stack id={name}>
4+
<async-image src={"/images/cats/#{name}.jpg"} modifiers='[{"type": "frame", "width": 100, "height": 100}]' />
55
<text><%= name %></text>
6-
</hstack>
6+
</h-stack>
77
<% end %>
88
</list>
99

0 commit comments

Comments
 (0)