Skip to content

Commit 4afd1ee

Browse files
author
UniqueIdGenerator Author
committed
Update Praefixum package and related files
1 parent 14276dc commit 4afd1ee

File tree

16 files changed

+611
-597
lines changed

16 files changed

+611
-597
lines changed

Abies.Benchmarks/Abies.Benchmarks.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net10.0</TargetFramework>
55
<OutputType>Exe</OutputType>
6+
<InterceptorsNamespaces>$(InterceptorsNamespaces);Praefixum</InterceptorsNamespaces>
67
</PropertyGroup>
78

89
<ItemGroup>

Abies.Conduit/Abies.Conduit.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
88
<!-- Prevent duplicate TargetFrameworkAttribute -->
99
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
10+
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
11+
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>
12+
<InterceptorsNamespaces>$(InterceptorsNamespaces);Praefixum</InterceptorsNamespaces>
1013
</PropertyGroup>
1114
<ItemGroup>
1215
<ProjectReference Include="..\Abies\Abies.csproj" />

Abies.Conduit/Page/Article.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -102,43 +102,43 @@ model with
102102
};
103103

104104
private static Node ArticleMeta(Conduit.Page.Home.Article article, bool showEditDelete = false) =>
105-
div([@class("article-meta")], [ a([href($"/profile/{article.Author.Username}")], [
105+
div([class_("article-meta")], [ a([href($"/profile/{article.Author.Username}")], [
106106
img([src(article.Author.Image)])
107-
]), div([@class("info")], [
107+
]), div([class_("info")], [
108108
a([href($"/profile/{article.Author.Username}")], [
109109
text(article.Author.Username)
110110
]),
111-
span([@class("date")], [text(article.CreatedAt)])
111+
span([class_("date")], [text(article.CreatedAt)])
112112
]),
113113
showEditDelete
114-
? div([], [ a([@class("btn btn-outline-secondary btn-sm"),
114+
? div([], [ a([class_("btn btn-outline-secondary btn-sm"),
115115
href($"/editor/{article.Slug}")],
116116
[
117-
i([@class("ion-edit")], []),
117+
i([class_("ion-edit")], []),
118118
text(" Edit Article")
119-
]), button([@class("btn btn-outline-danger btn-sm"),
119+
]), button([class_("btn btn-outline-danger btn-sm"),
120120
onclick(new Message.DeleteArticle())],
121121
[
122-
i([@class("ion-trash-a")], []),
122+
i([class_("ion-trash-a")], []),
123123
text(" Delete Article")
124124
])
125125
])
126-
: div([], [ button([@class(article.Author.Following
126+
: div([], [ button([class_(article.Author.Following
127127
? "btn btn-sm btn-secondary"
128128
: "btn btn-sm btn-outline-secondary"),
129129
onclick(new Message.ToggleFollow())],
130130
[
131-
i([@class("ion-plus-round")], []),
131+
i([class_("ion-plus-round")], []),
132132
text(article.Author.Following
133133
? $" Unfollow {article.Author.Username}"
134134
: $" Follow {article.Author.Username}")
135135
]),
136-
text(" "), button([@class(article.Favorited
136+
text(" "), button([class_(article.Favorited
137137
? "btn btn-sm btn-primary"
138138
: "btn btn-sm btn-outline-primary"),
139139
onclick(new Message.ToggleFavorite())],
140140
[
141-
i([@class("ion-heart")], []),
141+
i([class_("ion-heart")], []),
142142
text(article.Favorited
143143
? $" Unfavorite Article ({article.FavoritesCount})"
144144
: $" Favorite Article ({article.FavoritesCount})")
@@ -147,75 +147,75 @@ private static Node ArticleMeta(Conduit.Page.Home.Article article, bool showEdit
147147
]);
148148

149149
private static Node ArticleBanner(Conduit.Page.Home.Article article, bool isAuthor) =>
150-
div([@class("banner")], [
151-
div([@class("container")], [
150+
div([class_("banner")], [
151+
div([class_("container")], [
152152
h1([], [text(article.Title)]),
153153
ArticleMeta(article, isAuthor)
154154
])
155155
]);
156156

157157
private static Node ArticleContent(Conduit.Page.Home.Article article) =>
158-
div([@class("row article-content")], [
159-
div([@class("col-md-12")], [
160-
p([], [text(article.Body)]), ul([@class("tag-list")],
158+
div([class_("row article-content")], [
159+
div([class_("col-md-12")], [
160+
p([], [text(article.Body)]), ul([class_("tag-list")],
161161
article.TagList.ConvertAll(tag =>
162-
li([@class("tag-default tag-pill tag-outline")], [text(tag)])
162+
li([class_("tag-default tag-pill tag-outline")], [text(tag)])
163163
).ToArray()
164164
)
165165
])
166166
]);
167167

168168
private static Node CommentForm(Model model, User? currentUser) =>
169169
currentUser == null
170-
? div([@class("row")], [
171-
div([@class("col-xs-12 col-md-8 offset-md-2")], [
170+
? div([class_("row")], [
171+
div([class_("col-xs-12 col-md-8 offset-md-2")], [
172172
p([], [ a([href("/login")], [text("Sign in")]),
173173
text(" or "),
174174
a([href("/register")], [text("sign up")]),
175175
text(" to add comments on this article.")
176176
])
177177
])
178178
])
179-
: form([@class("card comment-form")], [
180-
div([@class("card-block")], [ textarea([@class("form-control"),
179+
: form([class_("card comment-form")], [
180+
div([class_("card-block")], [ textarea([class_("form-control"),
181181
placeholder("Write a comment..."),
182182
rows("3"),
183183
value(model.CommentInput),
184184
oninput(new Message.CommentInputChanged(model.CommentInput))],
185185
[]
186186
)
187187
]),
188-
div([@class("card-footer")], [ img([@class("comment-author-img"), src("")]), button([@class("btn btn-sm btn-primary"),
188+
div([class_("card-footer")], [ img([class_("comment-author-img"), src("")]), button([class_("btn btn-sm btn-primary"),
189189
disabled((string.IsNullOrWhiteSpace(model.CommentInput) || model.SubmittingComment).ToString()),
190190
onclick(new Message.SubmitComment())],
191191
[text("Post Comment")])
192192
])
193193
]);
194194

195195
private static Node CommentCard(Comment comment, User? currentUser) =>
196-
div([@class("card")], [
197-
div([@class("card-block")], [
198-
p([@class("card-text")], [text(comment.Body)])
196+
div([class_("card")], [
197+
div([class_("card-block")], [
198+
p([class_("card-text")], [text(comment.Body)])
199199
]),
200-
div([@class("card-footer")], [ a([@class("comment-author"), href($"/profile/{comment.Author.Username}")], [
201-
img([@class("comment-author-img"), src(comment.Author.Image)])
200+
div([class_("card-footer")], [ a([class_("comment-author"), href($"/profile/{comment.Author.Username}")], [
201+
img([class_("comment-author-img"), src(comment.Author.Image)])
202202
]),
203203
text(" "),
204-
a([@class("comment-author"), href($"/profile/{comment.Author.Username}")], [
204+
a([class_("comment-author"), href($"/profile/{comment.Author.Username}")], [
205205
text(comment.Author.Username)
206206
]),
207-
span([@class("date-posted")], [text(comment.CreatedAt)]),
207+
span([class_("date-posted")], [text(comment.CreatedAt)]),
208208
comment.Author.Username == (currentUser?.Username.Value ?? "")
209-
? span([@class("mod-options")], [ i([@class("ion-trash-a"),
209+
? span([class_("mod-options")], [ i([class_("ion-trash-a"),
210210
onclick(new Message.DeleteComment(comment.Id))], [])
211211
])
212212
: text("")
213213
])
214214
]);
215215

216216
private static Node CommentSection(Model model, User? currentUser) =>
217-
div([@class("row")], [
218-
div([@class("col-xs-12 col-md-8 offset-md-2")], [
217+
div([class_("row")], [
218+
div([class_("col-xs-12 col-md-8 offset-md-2")], [
219219
CommentForm(model, currentUser),
220220
..(model.Comments?.ConvertAll(c => CommentCard(c, currentUser)) ??
221221
new List<Node> { text("Loading comments...") })
@@ -224,19 +224,19 @@ private static Node CommentSection(Model model, User? currentUser) =>
224224

225225
public static Node View(Model model) =>
226226
model.IsLoading || model.Article == null
227-
? div([@class("article-page")], [
228-
div([@class("container")], [
229-
div([@class("row")], [
230-
div([@class("col-md-10 offset-md-1")], [
227+
? div([class_("article-page")], [
228+
div([class_("container")], [
229+
div([class_("row")], [
230+
div([class_("col-md-10 offset-md-1")], [
231231
text("Loading article...")
232232
])
233233
])
234234
])
235235
])
236-
: div([@class("article-page")], [
237-
ArticleBanner(model.Article, false), div([@class("container page")], [ div([], [ArticleContent(model.Article)]),
238-
hr([@class("hr")]),
239-
div([@class("article-actions")], [
236+
: div([class_("article-page")], [
237+
ArticleBanner(model.Article, false), div([class_("container page")], [ div([], [ArticleContent(model.Article)]),
238+
hr([class_("hr")]),
239+
div([class_("article-actions")], [
240240
ArticleMeta(model.Article, false)
241241
]),
242242
CommentSection(model, null)

Abies.Conduit/Page/Editor.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,72 +111,72 @@ model with
111111
private static Node ErrorList(Dictionary<string, string[]>? errors) =>
112112
errors == null
113113
? text("")
114-
: ul([@class("error-messages")],
114+
: ul([class_("error-messages")],
115115
[.. errors.SelectMany(e => e.Value.Select(msg =>
116116
li([], [text($"{e.Key} {msg}")])
117117
))]
118118
);
119119

120120
private static Node TagInputSection(Model model) =>
121-
div([@class("tag-list")], [
121+
div([class_("tag-list")], [
122122
..model.TagList?.Select(static tag =>
123-
div([@class("tag-pill tag-default")], [
124-
i([@class("ion-close-round"),
123+
div([class_("tag-pill tag-default")], [
124+
i([class_("ion-close-round"),
125125
onclick(new Message.RemoveTag(tag))],
126126
[]),
127127
text($" {tag}")
128128
])) ?? []
129129
]);
130130

131131
public static Node View(Model model) =>
132-
div([@class("editor-page")], [
133-
div([@class("container page")], [
134-
div([@class("row")], [
135-
div([@class("col-md-10 offset-md-1 col-xs-12")], [
132+
div([class_("editor-page")], [
133+
div([class_("container page")], [
134+
div([class_("row")], [
135+
div([class_("col-md-10 offset-md-1 col-xs-12")], [
136136
ErrorList(model.Errors),
137137
form([], [
138138
fieldset([], [
139-
fieldset([@class("form-group")], [
140-
input([@class("form-control form-control-lg"),
139+
fieldset([class_("form-group")], [
140+
input([class_("form-control form-control-lg"),
141141
type("text"),
142142
placeholder("Article Title"),
143143
value(model.Title),
144144
oninput(new Message.TitleChanged(model.Title)),
145145
disabled(model.IsSubmitting.ToString())]
146146
)
147147
]),
148-
fieldset([@class("form-group")], [
149-
input([@class("form-control"),
148+
fieldset([class_("form-group")], [
149+
input([class_("form-control"),
150150
type("text"),
151151
placeholder("What's this article about?"),
152152
value(model.Description),
153153
oninput(new Message.DescriptionChanged(model.Description)),
154154
disabled(model.IsSubmitting.ToString())]
155155
)
156156
]),
157-
fieldset([@class("form-group")], [
158-
textarea([@class("form-control"),
157+
fieldset([class_("form-group")], [
158+
textarea([class_("form-control"),
159159
rows("8"),
160160
placeholder("Write your article (in markdown)"),
161161
value(model.Body),
162162
oninput(new Message.BodyChanged(model.Body)),
163163
disabled(model.IsSubmitting.ToString())],[]
164164
)
165165
]),
166-
fieldset([@class("form-group")], [
167-
input([@class("form-control"),
166+
fieldset([class_("form-group")], [
167+
input([class_("form-control"),
168168
type("text"),
169169
placeholder("Enter tags"),
170170
value(model.TagInput),
171171
oninput(new Message.TagInputChanged(model.TagInput)),
172172
onkeypress(new Message.AddTag()),
173173
disabled(model.IsSubmitting.ToString())]
174174
),
175-
div([@class("tag-list")], [
175+
div([class_("tag-list")], [
176176
TagInputSection(model)
177177
])
178178
]),
179-
button([@class("btn btn-lg pull-xs-right btn-primary"),
179+
button([class_("btn btn-lg pull-xs-right btn-primary"),
180180
type("button"),
181181
disabled((model.IsSubmitting ||
182182
string.IsNullOrWhiteSpace(model.Title) ||

0 commit comments

Comments
 (0)