2026-02-10 15:12:59 +00:00
|
|
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
|
|
|
|
|
2026-02-24 16:21:50 +00:00
|
|
|
internal sealed class AssistantHeading : AssistantComponentBase
|
2026-02-10 15:12:59 +00:00
|
|
|
{
|
2026-02-24 10:39:17 +00:00
|
|
|
public override AssistantComponentType Type => AssistantComponentType.HEADING;
|
2026-02-10 15:12:59 +00:00
|
|
|
public Dictionary<string, object> Props { get; set; } = new();
|
|
|
|
|
public List<IAssistantComponent> Children { get; set; } = new();
|
2026-02-24 16:21:50 +00:00
|
|
|
|
2026-02-10 15:12:59 +00:00
|
|
|
public string Text
|
|
|
|
|
{
|
2026-02-24 16:21:50 +00:00
|
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Text));
|
|
|
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Text), value);
|
2026-02-10 15:12:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Level
|
|
|
|
|
{
|
|
|
|
|
get => this.Props.TryGetValue(nameof(this.Level), out var v)
|
|
|
|
|
&& int.TryParse(v.ToString(), out var i)
|
|
|
|
|
? i
|
2026-02-24 16:21:50 +00:00
|
|
|
: 2;
|
2026-02-10 15:12:59 +00:00
|
|
|
set => this.Props[nameof(this.Level)] = value;
|
|
|
|
|
}
|
2026-02-24 16:21:50 +00:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|