-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Ability to Set Initialization Options (#8)
- Loading branch information
1 parent
5e5b80f
commit a8a7b20
Showing
6 changed files
with
130 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace MermaidJS.Blazor | ||
{ | ||
/// <summary> | ||
/// Acceptable values for the logLevel initialization option. | ||
/// </summary> | ||
public static class MermaidLogLevels | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public const int Debug = 1; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public const int Info = 2; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public const int Warn = 3; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public const int Error = 4; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public const int Fatal = 5; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace MermaidJS.Blazor | ||
{ | ||
/// <summary> | ||
/// Options used when initializing MermaidJS. | ||
/// </summary> | ||
public class MermaidOptions | ||
{ | ||
/// <summary> | ||
/// Controls whether or arrow markers in html code are absolute paths or anchors. | ||
/// </summary> | ||
public bool ArrowMarkerAbsolute { get; set; } | ||
|
||
/// <summary> | ||
/// Specifies the font to be used in the rendered diagrams. | ||
/// </summary> | ||
public string FontFamily { get; set; } = "'trebuchet ms', verdana, arial, sans-serif;"; | ||
|
||
/// <summary> | ||
/// This option decides the amount of logging to be used. | ||
/// </summary> | ||
public int LogLevel { get; set; } = 5; | ||
|
||
/// <summary> | ||
/// The maximum number of characters allowed in a diagram definition. | ||
/// </summary> | ||
public int MaxTextSize { get; set; } = 50000; | ||
|
||
/// <summary> | ||
/// This option controls which currentConfig keys are considered secure and can only be changed via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the secure keys in the current currentConfig. This prevents malicious graph directives from overriding a site's default security. | ||
/// </summary> | ||
public List<string> Secure { get; set; } = new string[] { "secure", "securityLevel", "startOnLoad", "maxTextSize" }.ToList(); | ||
|
||
/// <summary> | ||
/// Level of trust for parsed diagram. | ||
/// </summary> | ||
public string SecurityLevel { get; set; } = "strict"; | ||
|
||
/// <summary> | ||
/// Dictates whether mermaind starts on Page load. | ||
/// </summary> | ||
public bool StartOnLoad { get; set; } = true; | ||
|
||
/// <summary> | ||
/// Name of a pre-defined MermaidJS theme. | ||
/// </summary> | ||
public string? Theme { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace MermaidJS.Blazor | ||
{ | ||
/// <summary> | ||
/// Acceptable values for the securityLevel initialization option. | ||
/// </summary> | ||
public static class MermaidSecurityLevels | ||
{ | ||
/// <summary> | ||
/// HTML tags in text are allowed, (only script element is removed), click functionality is enabled. | ||
/// </summary> | ||
public const string AntiScript = "antiscript"; | ||
|
||
/// <summary> | ||
/// Tags in text are allowed, click functionality is enabled. | ||
/// </summary> | ||
public const string Loose = "loose"; | ||
|
||
/// <summary> | ||
/// Default. Tags in text are encoded, click functionality is disabled. | ||
/// </summary> | ||
public const string Strict = "strict"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters