mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 21:51:37 +00:00
wrapped used internal components without Class and Style properties with divs to apply classes and style
This commit is contained in:
parent
6ad7aba58e
commit
9ae3fcaed9
@ -35,21 +35,21 @@
|
|||||||
case AssistantComponentType.WEB_CONTENT_READER:
|
case AssistantComponentType.WEB_CONTENT_READER:
|
||||||
if (component is AssistantWebContentReader webContent && this.webContentFields.TryGetValue(webContent.Name, out var webState))
|
if (component is AssistantWebContentReader webContent && this.webContentFields.TryGetValue(webContent.Name, out var webState))
|
||||||
{
|
{
|
||||||
|
<div class="@webContent.Class" style="@webContent.Style">
|
||||||
<ReadWebContent @bind-Content="@webState.Content"
|
<ReadWebContent @bind-Content="@webState.Content"
|
||||||
ProviderSettings="@this.providerSettings"
|
ProviderSettings="@this.providerSettings"
|
||||||
@bind-AgentIsRunning="@webState.AgentIsRunning"
|
@bind-AgentIsRunning="@webState.AgentIsRunning"
|
||||||
@bind-Preselect="@webState.Preselect"
|
@bind-Preselect="@webState.Preselect"
|
||||||
@bind-PreselectContentCleanerAgent="@webState.PreselectContentCleanerAgent"
|
@bind-PreselectContentCleanerAgent="@webState.PreselectContentCleanerAgent"/>
|
||||||
Class="@webContent.Class"
|
</div>
|
||||||
Style="@webContent.Style" />
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AssistantComponentType.FILE_CONTENT_READER:
|
case AssistantComponentType.FILE_CONTENT_READER:
|
||||||
if (component is AssistantFileContentReader fileContent && this.fileContentFields.TryGetValue(fileContent.Name, out var fileState))
|
if (component is AssistantFileContentReader fileContent && this.fileContentFields.TryGetValue(fileContent.Name, out var fileState))
|
||||||
{
|
{
|
||||||
<ReadFileContent @bind-FileContent="@fileState.Content"
|
<div class="@fileContent.Class" style="@fileContent.Style">
|
||||||
Class="@fileContent.Class"
|
<ReadFileContent @bind-FileContent="@fileState.Content" />
|
||||||
Style="@fileContent.Style" />
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -68,26 +68,24 @@
|
|||||||
case AssistantComponentType.PROVIDER_SELECTION:
|
case AssistantComponentType.PROVIDER_SELECTION:
|
||||||
if (component is AssistantProviderSelection providerSelection)
|
if (component is AssistantProviderSelection providerSelection)
|
||||||
{
|
{
|
||||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"
|
<div class="@providerSelection.Class" style="@providerSelection.Class">
|
||||||
Class="@providerSelection.Class"
|
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider" />
|
||||||
Style="@providerSelection.Style"/>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AssistantComponentType.PROFILE_SELECTION:
|
case AssistantComponentType.PROFILE_SELECTION:
|
||||||
if (component is AssistantProfileSelection profileSelection)
|
if (component is AssistantProfileSelection profileSelection)
|
||||||
{
|
{
|
||||||
var selection = profileSelection;
|
var selection = profileSelection;
|
||||||
<ProfileFormSelection Validation="@((Profile profile) => this.ValidateProfileSelection(selection, profile))" @bind-Profile="@this.currentProfile"
|
<div class="@selection.Class" style="@selection.Style">
|
||||||
Class="@selection.Class"
|
<ProfileFormSelection Validation="@((Profile profile) => this.ValidateProfileSelection(selection, profile))" @bind-Profile="@this.currentProfile" />
|
||||||
Style="@selection.Style"/>
|
</div>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AssistantComponentType.SWITCH:
|
case AssistantComponentType.SWITCH:
|
||||||
if (component is AssistantSwitch assistantSwitch)
|
if (component is AssistantSwitch assistantSwitch)
|
||||||
{
|
{
|
||||||
<MudTextSwitch Label="@assistantSwitch.Label" @bind-Value="@this.switchFields[assistantSwitch.Name]" LabelOn="@assistantSwitch.LabelOn" LabelOff="@assistantSwitch.LabelOff"
|
<MudTextSwitch Label="@assistantSwitch.Label" @bind-Value="@this.switchFields[assistantSwitch.Name]" LabelOn="@assistantSwitch.LabelOn" LabelOff="@assistantSwitch.LabelOff" />
|
||||||
Class="@assistantSwitch.Class"
|
|
||||||
Style="@this.GetOptionalStyle(assistantSwitch.Style)" />
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AssistantComponentType.HEADING:
|
case AssistantComponentType.HEADING:
|
||||||
|
|||||||
@ -44,15 +44,4 @@ internal sealed class AssistantSwitch : AssistantComponentBase
|
|||||||
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.LabelOff), value);
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.LabelOff), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Class
|
|
||||||
{
|
|
||||||
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Class));
|
|
||||||
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Class), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Style
|
|
||||||
{
|
|
||||||
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Style));
|
|
||||||
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Style), value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public static class ComponentPropSpecs
|
|||||||
),
|
),
|
||||||
[AssistantComponentType.SWITCH] = new(
|
[AssistantComponentType.SWITCH] = new(
|
||||||
required: ["Name", "Label", "LabelOn", "LabelOff", "Value"],
|
required: ["Name", "Label", "LabelOn", "LabelOff", "Value"],
|
||||||
optional: ["UserPrompt", "Class", "Style"]
|
optional: ["UserPrompt"]
|
||||||
),
|
),
|
||||||
[AssistantComponentType.HEADING] = new(
|
[AssistantComponentType.HEADING] = new(
|
||||||
required: ["Text", "Level"],
|
required: ["Text", "Level"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user