mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge remote-tracking branch 'upstream/develop' into standardized-pie-definitions
This commit is contained in:
commit
c4113541e1
@ -18,6 +18,7 @@ import { promisify } from 'node:util';
|
|||||||
|
|
||||||
import { load, JSON_SCHEMA } from 'js-yaml';
|
import { load, JSON_SCHEMA } from 'js-yaml';
|
||||||
import { compile, type JSONSchema } from 'json-schema-to-typescript';
|
import { compile, type JSONSchema } from 'json-schema-to-typescript';
|
||||||
|
import prettier from 'prettier';
|
||||||
|
|
||||||
import _Ajv2019, { type JSONSchemaType } from 'ajv/dist/2019.js';
|
import _Ajv2019, { type JSONSchemaType } from 'ajv/dist/2019.js';
|
||||||
|
|
||||||
@ -207,6 +208,7 @@ async function generateTypescript(mermaidConfigSchema: JSONSchemaType<MermaidCon
|
|||||||
{
|
{
|
||||||
additionalProperties: false, // in JSON Schema 2019-09, these are called `unevaluatedProperties`
|
additionalProperties: false, // in JSON Schema 2019-09, these are called `unevaluatedProperties`
|
||||||
unreachableDefinitions: true, // definition for FontConfig is unreachable
|
unreachableDefinitions: true, // definition for FontConfig is unreachable
|
||||||
|
style: (await prettier.resolveConfig('.')) ?? {},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
/**
|
/**
|
||||||
* Configuration options to pass to the `dompurify` library.
|
* Configuration options to pass to the `dompurify` library.
|
||||||
*/
|
*/
|
||||||
export type DOMPurifyConfiguration = import("dompurify").Config;
|
export type DOMPurifyConfiguration = import('dompurify').Config;
|
||||||
/**
|
/**
|
||||||
* JavaScript function that returns a `FontConfig`.
|
* JavaScript function that returns a `FontConfig`.
|
||||||
*
|
*
|
||||||
@ -39,7 +39,7 @@ export type FontCalculator = () => Partial<FontConfig>;
|
|||||||
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
||||||
* via the `definition` "SankeyLinkColor".
|
* via the `definition` "SankeyLinkColor".
|
||||||
*/
|
*/
|
||||||
export type SankeyLinkColor = "source" | "target" | "gradient";
|
export type SankeyLinkColor = 'source' | 'target' | 'gradient';
|
||||||
/**
|
/**
|
||||||
* Controls the alignment of the Sankey diagrams.
|
* Controls the alignment of the Sankey diagrams.
|
||||||
*
|
*
|
||||||
@ -49,7 +49,7 @@ export type SankeyLinkColor = "source" | "target" | "gradient";
|
|||||||
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
||||||
* via the `definition` "SankeyNodeAlignment".
|
* via the `definition` "SankeyNodeAlignment".
|
||||||
*/
|
*/
|
||||||
export type SankeyNodeAlignment = "left" | "right" | "center" | "justify";
|
export type SankeyNodeAlignment = 'left' | 'right' | 'center' | 'justify';
|
||||||
/**
|
/**
|
||||||
* The font size to use
|
* The font size to use
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@ export interface MermaidConfig {
|
|||||||
* You may also use `themeCSS` to override this value.
|
* You may also use `themeCSS` to override this value.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
theme?: string | "default" | "forest" | "dark" | "neutral" | "null";
|
theme?: string | 'default' | 'forest' | 'dark' | 'neutral' | 'null';
|
||||||
themeVariables?: any;
|
themeVariables?: any;
|
||||||
themeCSS?: string;
|
themeCSS?: string;
|
||||||
/**
|
/**
|
||||||
@ -88,12 +88,12 @@ export interface MermaidConfig {
|
|||||||
| 0
|
| 0
|
||||||
| 2
|
| 2
|
||||||
| 1
|
| 1
|
||||||
| "trace"
|
| 'trace'
|
||||||
| "debug"
|
| 'debug'
|
||||||
| "info"
|
| 'info'
|
||||||
| "warn"
|
| 'warn'
|
||||||
| "error"
|
| 'error'
|
||||||
| "fatal"
|
| 'fatal'
|
||||||
| 3
|
| 3
|
||||||
| 4
|
| 4
|
||||||
| 5
|
| 5
|
||||||
@ -101,7 +101,7 @@ export interface MermaidConfig {
|
|||||||
/**
|
/**
|
||||||
* Level of trust for parsed diagram
|
* Level of trust for parsed diagram
|
||||||
*/
|
*/
|
||||||
securityLevel?: string | "strict" | "loose" | "antiscript" | "sandbox" | undefined;
|
securityLevel?: string | 'strict' | 'loose' | 'antiscript' | 'sandbox' | undefined;
|
||||||
/**
|
/**
|
||||||
* Dictates whether mermaid starts on Page load
|
* Dictates whether mermaid starts on Page load
|
||||||
*/
|
*/
|
||||||
@ -689,11 +689,11 @@ export interface QuadrantChartConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* position of x-axis labels
|
* position of x-axis labels
|
||||||
*/
|
*/
|
||||||
xAxisPosition?: "top" | "bottom";
|
xAxisPosition?: 'top' | 'bottom';
|
||||||
/**
|
/**
|
||||||
* position of y-axis labels
|
* position of y-axis labels
|
||||||
*/
|
*/
|
||||||
yAxisPosition?: "left" | "right";
|
yAxisPosition?: 'left' | 'right';
|
||||||
/**
|
/**
|
||||||
* stroke width of edges of the box that are inside the quadrant
|
* stroke width of edges of the box that are inside the quadrant
|
||||||
*/
|
*/
|
||||||
@ -723,7 +723,7 @@ export interface ErDiagramConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* Directional bias for layout of entities
|
* Directional bias for layout of entities
|
||||||
*/
|
*/
|
||||||
layoutDirection?: string | "TB" | "BT" | "LR" | "RL";
|
layoutDirection?: string | 'TB' | 'BT' | 'LR' | 'RL';
|
||||||
/**
|
/**
|
||||||
* The minimum width of an entity box. Expressed in pixels.
|
* The minimum width of an entity box. Expressed in pixels.
|
||||||
*/
|
*/
|
||||||
@ -788,7 +788,7 @@ export interface StateDiagramConfig extends BaseDiagramConfig {
|
|||||||
* Decides which rendering engine that is to be used for the rendering.
|
* Decides which rendering engine that is to be used for the rendering.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
|
defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
||||||
@ -812,7 +812,7 @@ export interface ClassDiagramConfig extends BaseDiagramConfig {
|
|||||||
* Decides which rendering engine that is to be used for the rendering.
|
* Decides which rendering engine that is to be used for the rendering.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
|
defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
|
||||||
nodeSpacing?: number;
|
nodeSpacing?: number;
|
||||||
rankSpacing?: number;
|
rankSpacing?: number;
|
||||||
/**
|
/**
|
||||||
@ -872,7 +872,7 @@ export interface JourneyDiagramConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* Multiline message alignment
|
* Multiline message alignment
|
||||||
*/
|
*/
|
||||||
messageAlign?: string | "left" | "center" | "right";
|
messageAlign?: string | 'left' | 'center' | 'right';
|
||||||
/**
|
/**
|
||||||
* Prolongs the edge of the diagram downwards.
|
* Prolongs the edge of the diagram downwards.
|
||||||
*
|
*
|
||||||
@ -951,7 +951,7 @@ export interface TimelineDiagramConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* Multiline message alignment
|
* Multiline message alignment
|
||||||
*/
|
*/
|
||||||
messageAlign?: string | "left" | "center" | "right";
|
messageAlign?: string | 'left' | 'center' | 'right';
|
||||||
/**
|
/**
|
||||||
* Prolongs the edge of the diagram downwards.
|
* Prolongs the edge of the diagram downwards.
|
||||||
*
|
*
|
||||||
@ -1062,12 +1062,12 @@ export interface GanttDiagramConfig extends BaseDiagramConfig {
|
|||||||
* Controls the display mode.
|
* Controls the display mode.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
displayMode?: string | "compact";
|
displayMode?: string | 'compact';
|
||||||
/**
|
/**
|
||||||
* On which day a week-based interval should start
|
* On which day a week-based interval should start
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
weekday?: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
|
weekday?: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* The object containing configurations specific for sequence diagrams
|
* The object containing configurations specific for sequence diagrams
|
||||||
@ -1121,7 +1121,7 @@ export interface SequenceDiagramConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* Multiline message alignment
|
* Multiline message alignment
|
||||||
*/
|
*/
|
||||||
messageAlign?: string | "left" | "center" | "right";
|
messageAlign?: string | 'left' | 'center' | 'right';
|
||||||
/**
|
/**
|
||||||
* Mirror actors under diagram
|
* Mirror actors under diagram
|
||||||
*
|
*
|
||||||
@ -1178,7 +1178,7 @@ export interface SequenceDiagramConfig extends BaseDiagramConfig {
|
|||||||
/**
|
/**
|
||||||
* This sets the text alignment of actor-attached notes
|
* This sets the text alignment of actor-attached notes
|
||||||
*/
|
*/
|
||||||
noteAlign?: string | "left" | "center" | "right";
|
noteAlign?: string | 'left' | 'center' | 'right';
|
||||||
/**
|
/**
|
||||||
* This sets the font size of actor messages
|
* This sets the font size of actor messages
|
||||||
*/
|
*/
|
||||||
@ -1254,7 +1254,7 @@ export interface FlowchartDiagramConfig extends BaseDiagramConfig {
|
|||||||
* Defines how mermaid renders curves for flowcharts.
|
* Defines how mermaid renders curves for flowcharts.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
curve?: string | "basis" | "linear" | "cardinal";
|
curve?: string | 'basis' | 'linear' | 'cardinal';
|
||||||
/**
|
/**
|
||||||
* Represents the padding between the labels and the shape
|
* Represents the padding between the labels and the shape
|
||||||
*
|
*
|
||||||
@ -1266,7 +1266,7 @@ export interface FlowchartDiagramConfig extends BaseDiagramConfig {
|
|||||||
* Decides which rendering engine that is to be used for the rendering.
|
* Decides which rendering engine that is to be used for the rendering.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
|
defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
|
||||||
/**
|
/**
|
||||||
* Width of nodes where text is wrapped.
|
* Width of nodes where text is wrapped.
|
||||||
*
|
*
|
||||||
@ -1296,7 +1296,7 @@ export interface SankeyDiagramConfig extends BaseDiagramConfig {
|
|||||||
* See <https://github.com/d3/d3-sankey#alignments>.
|
* See <https://github.com/d3/d3-sankey#alignments>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
nodeAlignment?: "left" | "right" | "center" | "justify";
|
nodeAlignment?: 'left' | 'right' | 'center' | 'justify';
|
||||||
useMaxWidth?: boolean;
|
useMaxWidth?: boolean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user