mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 08:19:47 +00:00
Optimized plugin icons
This commit is contained in:
parent
00742e6f02
commit
ac8ebe8e35
@ -1,5 +1,11 @@
|
||||
SVG = [[<svg width="1000" height="600" viewBox="0 0 5 3">
|
||||
<rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/>
|
||||
<rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/>
|
||||
<rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/>
|
||||
SVG = [[<svg viewBox="0 0 600 600" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2">
|
||||
<path style="fill:none" d="M0 0h600v600H0z"/>
|
||||
<clipPath id="a">
|
||||
<path d="M0 0h600v600H0z"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#a)">
|
||||
<path d="M17.467 200C58.688 83.529 169.851 0 300.369 0S542.05 83.529 583.271 200c11.072 31.284 17.098 64.944 17.098 100s-6.026 68.716-17.098 100C542.05 516.471 430.887 600 300.369 600S58.688 516.471 17.467 400C6.395 368.716.369 335.056.369 300s6.026-68.716 17.098-100Z"/>
|
||||
<path d="M583.271 200c11.072 31.284 17.098 64.944 17.098 100s-6.026 68.716-17.098 100C542.05 516.471 430.887 600 300.369 600S58.688 516.471 17.467 400C6.395 368.716.369 335.056.369 300s6.026-68.716 17.098-100h565.804Z" style="fill:#d00"/>
|
||||
<path d="M583.271 400C542.05 516.471 430.887 600 300.369 600S58.688 516.471 17.467 400h565.804Z" style="fill:#ffce00"/>
|
||||
</g>
|
||||
</svg>]]
|
@ -1,25 +1,12 @@
|
||||
SVG = [[<svg width="1235" height="650" viewBox="0 0 7410 3900">
|
||||
<path d="M0,0h7410v3900H0" fill="#b31942"/>
|
||||
<path d="M0,450H7410m0,600H0m0,600H7410m0,600H0m0,600H7410m0,600H0" stroke="#FFF" stroke-width="300"/>
|
||||
<path d="M0,0h2964v2100H0" fill="#0a3161"/>
|
||||
<g fill="#FFF">
|
||||
<g id="s18">
|
||||
<g id="s9">
|
||||
<g id="s5">
|
||||
<g id="s4">
|
||||
<path id="s" d="M247,90 317.534230,307.082039 132.873218,172.917961H361.126782L176.465770,307.082039z"/>
|
||||
<use xlink:href="#s" y="420"/>
|
||||
<use xlink:href="#s" y="840"/>
|
||||
<use xlink:href="#s" y="1260"/>
|
||||
</g>
|
||||
<use xlink:href="#s" y="1680"/>
|
||||
</g>
|
||||
<use xlink:href="#s4" x="247" y="210"/>
|
||||
</g>
|
||||
<use xlink:href="#s9" x="494"/>
|
||||
</g>
|
||||
<use xlink:href="#s18" x="988"/>
|
||||
<use xlink:href="#s9" x="1976"/>
|
||||
<use xlink:href="#s5" x="2470"/>
|
||||
</g>
|
||||
SVG = [[<svg viewBox="0 0 650 650" style="fill-rule:evenodd;clip-rule:evenodd">
|
||||
<path style="fill:none" d="M0 0h650v650H0z"/>
|
||||
<clipPath id="a">
|
||||
<path d="M0 0h650v650H0z"/>
|
||||
</clipPath>
|
||||
<g clip-path="url(#a)">
|
||||
<path d="M208.018 21.723C244.323 7.694 283.77 0 325 0c44.15 0 86.256 8.823 124.649 24.8a319.796 319.796 0 0 1 9.251 4.02A324.269 324.269 0 0 1 494 47.402 326.269 326.269 0 0 1 532.582 75c33.111 27.531 60.675 61.509 80.757 100a322.631 322.631 0 0 1 32.831 100 326.842 326.842 0 0 1 3.83 50c0 17.002-1.308 33.7-3.83 50a322.631 322.631 0 0 1-32.831 100c-20.082 38.491-47.646 72.469-80.757 100-56.319 46.827-128.686 75-207.582 75-78.896 0-151.263-28.173-207.582-75-33.111-27.531-60.675-61.509-80.757-100A322.631 322.631 0 0 1 3.83 375a325.032 325.032 0 0 1-2.881-25A328.869 328.869 0 0 1 0 325c0-17.002 1.308-33.7 3.83-50a322.493 322.493 0 0 1 31.196-96.822 323.44 323.44 0 0 1 8.553-15.752C62.893 129.089 87.96 99.493 117.418 75A325.476 325.476 0 0 1 191.1 28.82a324.203 324.203 0 0 1 16.918-7.097Z" style="fill:#b31942;fill-rule:nonzero"/>
|
||||
<path d="M0 75h1235m0 100H0m0 100h1235m0 100H0m0 100h1235m0 100H0" style="fill-rule:nonzero;stroke:#fff;stroke-width:50px"/>
|
||||
<path d="M208.018 21.723C244.323 7.694 283.77 0 325 0c44.15 0 86.256 8.823 124.649 24.8a319.796 319.796 0 0 1 9.251 4.02A324.269 324.269 0 0 1 494 47.402V350H.949A328.869 328.869 0 0 1 0 325c0-17.002 1.308-33.7 3.83-50a322.493 322.493 0 0 1 31.196-96.822 323.44 323.44 0 0 1 8.553-15.752C62.893 129.089 87.96 99.493 117.418 75A325.476 325.476 0 0 1 191.1 28.82a324.203 324.203 0 0 1 16.918-7.097Z" style="fill:#0a3161;fill-rule:nonzero"/>
|
||||
<path d="M30.895 186.613A317.843 317.843 0 0 1 36.661 175a323.44 323.44 0 0 1 6.918-12.574l2.078 6.394h14.531l-11.756 8.541 4.49 13.819-11.755-8.541-11.756 8.541 1.484-4.567ZM41.167 225l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L41.167 225ZM41.167 295l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L41.167 295ZM82.333 120l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L82.333 120ZM82.333 190l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L82.333 190ZM82.333 260l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L82.333 260ZM123.5 85l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L123.5 85ZM123.5 155l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L123.5 155ZM123.5 225l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L123.5 225ZM123.5 295l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L123.5 295ZM164.667 50l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L164.667 50ZM164.667 120l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L164.667 120ZM164.667 190l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L164.667 190ZM164.667 260l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L164.667 260ZM198.568 37.361l-10.096-7.336c.874-.405 1.75-.807 2.628-1.205h10.243l1.66-5.111a334.886 334.886 0 0 1 5.015-1.986l2.306 7.097h14.53l-11.755 8.541 4.49 13.819-11.756-8.541-11.755 8.541 4.49-13.819ZM205.833 85l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L205.833 85ZM205.833 155l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L205.833 155ZM205.833 225l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L205.833 225ZM205.833 295l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L205.833 295ZM247 50l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L247 50ZM247 120l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L247 120ZM247 190l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L247 190ZM247 260l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L247 260ZM288.167 15l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L288.167 15ZM288.167 85l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L288.167 85ZM288.167 155l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L288.167 155ZM288.167 225l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L288.167 225ZM288.167 295l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L288.167 295ZM329.333 50l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L329.333 50ZM329.333 120l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L329.333 120ZM329.333 190l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L329.333 190ZM329.333 260l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L329.333 260ZM370.5 15l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L370.5 15ZM370.5 85l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L370.5 85ZM370.5 155l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L370.5 155ZM370.5 225l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L370.5 225ZM370.5 295l11.756 36.18-30.777-22.36h38.042l-30.777 22.36L370.5 295ZM411.667 50l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L411.667 50ZM411.667 120l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L411.667 120ZM411.667 190l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L411.667 190ZM411.667 260l11.755 36.18-30.776-22.36h38.042l-30.777 22.36L411.667 260ZM448.343 28.82l1.306-4.02a319.796 319.796 0 0 1 7.405 3.19l.27.83h1.576a320.481 320.481 0 0 1 7.869 3.695l-6.67 4.846 4.49 13.819-11.756-8.541-11.755 8.541 4.49-13.819-11.756-8.541h14.531ZM452.833 85l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L452.833 85ZM452.833 155l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L452.833 155ZM452.833 225l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L452.833 225ZM452.833 295l11.756 36.18-30.777-22.36h38.042l-30.776 22.36L452.833 295Z" style="fill:#fff;fill-rule:nonzero"/>
|
||||
</g>
|
||||
</svg>]]
|
45
app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs
Normal file
45
app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs
Normal file
@ -0,0 +1,45 @@
|
||||
namespace AIStudio.Tools.PluginSystem;
|
||||
|
||||
public abstract partial class PluginBase
|
||||
{
|
||||
private const string DEFAULT_ICON_SVG =
|
||||
"""
|
||||
<svg height="1.5em" width="1.5em" viewBox="0 0 24 24" fill="#1f1f1f"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 13h-2V7h-6V5c0-.28-.22-.5-.5-.5s-.5.22-.5.5v2H4l.01 2.12C5.76 9.8 7 11.51 7 13.5c0 1.99-1.25 3.7-3 4.38V20h2.12c.68-1.75 2.39-3 4.38-3 1.99 0 3.7 1.25 4.38 3H17v-6h2c.28 0 .5-.22.5-.5s-.22-.5-.5-.5z" opacity=".3"/><path d="M19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5S8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11zm0 3h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3-1.99 0-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5s.5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5z"/></svg>
|
||||
""";
|
||||
|
||||
#region Initialization-related methods
|
||||
|
||||
/// <summary>
|
||||
/// Tries to initialize the icon of the plugin.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When no icon is specified, the default icon will be used.
|
||||
/// </remarks>
|
||||
/// <param name="message">The error message, when the icon could not be read.</param>
|
||||
/// <param name="iconSVG">The read icon as SVG.</param>
|
||||
/// <returns>True, when the icon could be read successfully.</returns>
|
||||
|
||||
// ReSharper disable once OutParameterValueIsAlwaysDiscarded.Local
|
||||
// ReSharper disable once UnusedMethodReturnValue.Local
|
||||
private bool TryInitIconSVG(out string message, out string iconSVG)
|
||||
{
|
||||
if (!this.state.Environment["ICON_SVG"].TryRead(out iconSVG))
|
||||
{
|
||||
iconSVG = DEFAULT_ICON_SVG;
|
||||
message = "The field ICON_SVG does not exist or is not a valid string.";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(iconSVG))
|
||||
{
|
||||
iconSVG = DEFAULT_ICON_SVG;
|
||||
message = "The field ICON_SVG is empty. The icon must be a non-empty string.";
|
||||
return true;
|
||||
}
|
||||
|
||||
message = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
@ -6,7 +6,7 @@ namespace AIStudio.Tools.PluginSystem;
|
||||
/// <summary>
|
||||
/// Represents the base of any AI Studio plugin.
|
||||
/// </summary>
|
||||
public abstract class PluginBase : IPluginMetadata
|
||||
public abstract partial class PluginBase : IPluginMetadata
|
||||
{
|
||||
private static readonly Guid[] MANDATORY_INTERNAL_PLUGINS =
|
||||
[
|
||||
@ -448,31 +448,7 @@ public abstract class PluginBase : IPluginMetadata
|
||||
message = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to initialize the icon of the plugin.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When no icon is specified, the default icon will be used.
|
||||
/// </remarks>
|
||||
/// <param name="message">The error message, when the icon could not be read.</param>
|
||||
/// <param name="iconSVG">The read icon as SVG.</param>
|
||||
/// <returns>True, when the icon could be read successfully.</returns>
|
||||
// ReSharper disable once OutParameterValueIsAlwaysDiscarded.Local
|
||||
// ReSharper disable once UnusedMethodReturnValue.Local
|
||||
private bool TryInitIconSVG(out string message, out string iconSVG)
|
||||
{
|
||||
if (!this.state.Environment["ICON_SVG"].TryRead(out iconSVG))
|
||||
{
|
||||
iconSVG = Icons.Material.TwoTone.Extension;
|
||||
message = "The field ICON_SVG does not exist or is not a valid string.";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = string.Empty;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tries to initialize the UI text content of the plugin.
|
||||
/// </summary>
|
||||
|
@ -41,8 +41,8 @@
|
||||
}
|
||||
|
||||
.plugin-icon-container svg {
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mud-popover-open.InnerScrollingFix {
|
||||
|
Loading…
Reference in New Issue
Block a user