Skip to content

Commit 437da0f

Browse files
Finished the Pandoc integration (#487)
1 parent 5b68519 commit 437da0f

File tree

30 files changed

+1598
-347
lines changed

30 files changed

+1598
-347
lines changed

app/Build/Commands/Pdfium.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static async Task InstallAsync(RID rid, string version)
4848
//
4949
Console.Write(" deploying ...");
5050
var library = GetLibraryPath(rid);
51-
if (string.IsNullOrEmpty(library.Path))
51+
if (string.IsNullOrWhiteSpace(library.Path))
5252
{
5353
Console.WriteLine($" failed to find the library path for {rid.ToUserFriendlyName()}");
5454
return;

app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ else
154154
@if (this.dataSourcePort < 1024)
155155
{
156156
<MudText Typo="Typo.body2">
157-
@((MarkupString)T("<b>Warning:</b> Ports below 1024 are reserved for system services. Your ERI server need to run with elevated permissions (root user)."))
157+
<b>@T("Warning:")</b> @T("Ports below 1024 are reserved for system services. Your ERI server need to run with elevated permissions (root user).")
158158
</MudText>
159159
}
160160
</div>
@@ -326,7 +326,7 @@ else
326326
</MudJustifiedText>
327327

328328
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
329-
@((MarkupString)T("<b>Important:</b> The LLM may need to generate many files. This reaches the request limit of most providers. Typically, only a certain number of requests can be made per minute, and only a maximum number of tokens can be generated per minute. AI Studio automatically considers this. <b>However, generating all the files takes a certain amount of time.</b> Local or self-hosted models may work without these limitations and can generate responses faster. AI Studio dynamically adapts its behavior and always tries to achieve the fastest possible data processing."))
329+
<b>@T("Important:")</b> @T("The LLM may need to generate many files. This reaches the request limit of most providers. Typically, only a certain number of requests can be made per minute, and only a maximum number of tokens can be generated per minute. AI Studio automatically considers this.") <b>@T("However, generating all the files takes a certain amount of time.")</b> @T("Local or self-hosted models may work without these limitations and can generate responses faster. AI Studio dynamically adapts its behavior and always tries to achieve the fastest possible data processing.")
330330
</MudJustifiedText>
331331

332332
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
@@ -340,7 +340,7 @@ else
340340
</MudJustifiedText>
341341

342342
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
343-
@((MarkupString)T("When you rebuild / re-generate the ERI server code, AI Studio proceeds as follows: All files generated last time will be deleted. All other files you have created remain. Then, the AI generates the new files. <b>But beware:</b> It may happen that the AI generates a file this time that you manually created last time. In this case, your manually created file will then be overwritten. Therefore, you should always create a Git repository and commit or revert all changes before using this assistant. With a diff visualization, you can immediately see where the AI has made changes. It is best to use an IDE suitable for your selected language for this purpose."))
343+
@T("When you rebuild / re-generate the ERI server code, AI Studio proceeds as follows: All files generated last time will be deleted. All other files you have created remain. Then, the AI generates the new files.") <b>@T("But beware:")</b> @T("It may happen that the AI generates a file this time that you manually created last time. In this case, your manually created file will then be overwritten. Therefore, you should always create a Git repository and commit or revert all changes before using this assistant. With a diff visualization, you can immediately see where the AI has made changes. It is best to use an IDE suitable for your selected language for this purpose.")
344344
</MudJustifiedText>
345345

346346
<MudTextSwitch Label="@T("Should we write the generated code to the file system?")" Disabled="@this.IsNoneERIServerSelected" @bind-Value="@this.writeToFilesystem" LabelOn="@T("Yes, please write or update all generated code to the file system")" LabelOff="@T("No, just show me the code")" />

app/MindWork AI Studio/Assistants/I18N/allTexts.lua

Lines changed: 215 additions & 8 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
2-
@if (!this.IsInline)
1+
@if (!this.IsInline)
32
{
43
@if (this.ParentTabs is null)
54
{
6-
<MudPaper Class="code-block no-elevation" Style="@this.BlockPadding()">
7-
<pre><code>@this.ChildContent</code></pre>
5+
<MudPaper Class="code-block no-elevation" Style="@this.BlockPadding">
6+
<pre>
7+
<code>
8+
@this.ChildContent
9+
</code>
10+
</pre>
811
</MudPaper>
912
}
1013
}
1114
else
1215
{
13-
<span class="inline-code-block"><kbd>@this.ChildContent</kbd></span>
16+
<span class="inline-code-block">
17+
<kbd>
18+
@this.ChildContent
19+
</kbd>
20+
</span>
1421
}
1522

app/MindWork AI Studio/Components/CodeBlock.razor.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,5 @@ void BlockSelf(RenderTreeBuilder builder)
3333
}
3434
}
3535

36-
private string BlockPadding()
37-
{
38-
return this.ParentTabs is null ? "padding: 16px !important;" : "padding: 8px !important";
39-
}
36+
private string BlockPadding => this.ParentTabs is null ? "padding: 16px !important;" : "padding: 8px !important";
4037
}

app/MindWork AI Studio/Components/CodeTabs.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<MudTabs @bind-ActivePanelIndex="selectedIndex" PanelClass="code-block" MinimumTabWidth="30px" Class="mt-2">
2-
@foreach (var block in blocks)
1+
<MudTabs ActivePanelIndex="this.SelectedIndex" ActivePanelIndexChanged="async idx => await this.TabChanged(idx)" PanelClass="code-block mt-1" MinimumTabWidth="30px" Class="mt-2">
2+
@foreach (var block in this.blocks)
33
{
44
<MudTabPanel Text="@block.Title">
55
@block.Fragment

app/MindWork AI Studio/Components/CodeTabs.razor.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ public partial class CodeTabs : ComponentBase
77
[Parameter]
88
public RenderFragment? ChildContent { get; set; }
99

10+
[Parameter]
11+
public int SelectedIndex { get; set; }
12+
13+
[Parameter]
14+
public EventCallback<int> SelectedIndexChanged { get; set; }
15+
1016
private readonly List<CodeTabItem> blocks = new();
11-
private int selectedIndex;
1217

1318
internal void RegisterBlock(string title, RenderFragment fragment)
1419
{
@@ -27,4 +32,11 @@ private class CodeTabItem
2732

2833
public RenderFragment Fragment { get; init; } = null!;
2934
}
35+
36+
private async Task TabChanged(int index)
37+
{
38+
this.SelectedIndex = index;
39+
await this.SelectedIndexChanged.InvokeAsync(index);
40+
await this.InvokeAsync(this.StateHasChanged);
41+
}
3042
}

app/MindWork AI Studio/Components/ExpansionPanel.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded">
1+
<MudExpansionPanel Class="border-solid border rounded-lg" Expanded="@this.IsExpanded" MaxHeight="@this.MaxHeight" ExpandedChanged="async s => await this.ExpandedChanged(s)">
22
<TitleContent>
33
<div class="d-flex align-center">
44
<MudIcon Icon="@this.HeaderIcon" Size="@this.IconSize" Color="@this.IconColor" class="mr-3"/>

app/MindWork AI Studio/Components/ExpansionPanel.razor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public partial class ExpansionPanel : ComponentBase
1616
[Parameter]
1717
public string HeaderText { get; set; } = "n/a";
1818

19+
[Parameter]
20+
public int? MaxHeight { get; set; }
21+
22+
[Parameter]
23+
public Func<bool, Task> ExpandedChanged { get; set; } = _ => Task.CompletedTask;
24+
1925
[Parameter]
2026
public RenderFragment? ChildContent { get; set; }
2127

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@inherits MSGComponentBase
2+
3+
<MudStack Row="false" Class="mb-3 pa-3 border-dashed border rounded-lg">
4+
<MudJustifiedText Typo="Typo.body1">
5+
@this.DetermineIntroText()
6+
</MudJustifiedText>
7+
<MudButton Color="@this.DetermineButtonColor()" Variant="Variant.Filled" OnClick="() => this.ShowPandocDialogAsync()">
8+
@this.DetermineButtonText()
9+
</MudButton>
10+
</MudStack>

0 commit comments

Comments
 (0)