Socket
Socket
Sign inDemoInstall

mermaid

Package Overview
Dependencies
Maintainers
4
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mermaid - npm Package Compare versions

Comparing version 10.2.4 to 10.3.0-rc.1

dist/arc-3e2a1ac6.js

18

dist/accessibility.d.ts
/**
* Accessibility (a11y) functions, types, helpers
* Accessibility (a11y) functions, types, helpers.
*
* @see https://www.w3.org/WAI/
* @see https://www.w3.org/TR/wai-aria-1.1/
* @see https://www.w3.org/TR/svg-aam-1.0/
*
*/
import { D3Element } from './mermaidAPI.js';
import type { D3Element } from './mermaidAPI.js';
/**
* Add role and aria-roledescription to the svg element
* Add role and aria-roledescription to the svg element.
*

@@ -15,3 +15,3 @@ * @param svg - d3 object that contains the SVG HTML element

*/
export declare function setA11yDiagramInfo(svg: D3Element, diagramType: string | null | undefined): void;
export declare function setA11yDiagramInfo(svg: D3Element, diagramType: string): void;
/**

@@ -21,9 +21,9 @@ * Add an accessible title and/or description element to a chart.

*
* The following charts display their title as a visual and accessibility element: gantt
* The following charts display their title as a visual and accessibility element: gantt.
*
* @param svg - d3 node to insert the a11y title and desc info
* @param a11yTitle - a11y title. null and undefined are meaningful: means to skip it
* @param a11yDesc - a11y description. null and undefined are meaningful: means to skip it
* @param a11yTitle - a11y title. undefined or empty strings mean to skip them
* @param a11yDesc - a11y description. undefined or empty strings mean to skip them
* @param baseId - id used to construct the a11y title and description id
*/
export declare function addSVGa11yTitleDescription(svg: D3Element, a11yTitle: string | null | undefined, a11yDesc: string | null | undefined, baseId: string): void;
export declare function addSVGa11yTitleDescription(svg: D3Element, a11yTitle: string | undefined, a11yDesc: string | undefined, baseId: string): void;

@@ -1,17 +0,124 @@

import DOMPurify from 'dompurify';
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Configuration options to pass to the `dompurify` library.
*/
export type DOMPurifyConfiguration = import("dompurify").Config;
/**
* JavaScript function that returns a `FontConfig`.
*
* By default, these return the appropriate `*FontSize`, `*FontFamily`, `*FontWeight`
* values.
*
* For example, the font calculator called `boundaryFont` might be defined as:
*
* ```javascript
* boundaryFont: function () {
* return {
* fontFamily: this.boundaryFontFamily,
* fontSize: this.boundaryFontSize,
* fontWeight: this.boundaryFontWeight,
* };
* }
* ```
*
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "FontCalculator".
*/
export type FontCalculator = () => Partial<FontConfig>;
/**
* Picks the color of the sankey diagram links, using the colors of the source and/or target of the links.
*
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "SankeyLinkColor".
*/
export type SankeyLinkColor = "source" | "target" | "gradient";
/**
* Controls the alignment of the Sankey diagrams.
*
* See <https://github.com/d3/d3-sankey#alignments>.
*
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "SankeyNodeAlignment".
*/
export type SankeyNodeAlignment = "left" | "right" | "center" | "justify";
/**
* The font size to use
*/
export type CSSFontSize = string | number;
export interface MermaidConfig {
theme?: string;
/**
* Theme, the CSS style sheet.
* You may also use `themeCSS` to override this value.
*
*/
theme?: string | "default" | "forest" | "dark" | "neutral" | "null";
themeVariables?: any;
themeCSS?: string;
/**
* The maximum allowed size of the users text diagram
*/
maxTextSize?: number;
darkMode?: boolean;
htmlLabels?: boolean;
/**
* Specifies the font to be used in the rendered diagrams.
* Can be any possible CSS `font-family`.
* See https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
*
*/
fontFamily?: string;
altFontFamily?: string;
logLevel?: number;
securityLevel?: string;
/**
* This option decides the amount of logging to be used by mermaid.
*
*/
logLevel?: number | string | 0 | 2 | 1 | "trace" | "debug" | "info" | "warn" | "error" | "fatal" | 3 | 4 | 5 | undefined;
/**
* Level of trust for parsed diagram
*/
securityLevel?: string | "strict" | "loose" | "antiscript" | "sandbox" | undefined;
/**
* Dictates whether mermaid starts on Page load
*/
startOnLoad?: boolean;
/**
* Controls whether or arrow markers in html code are absolute paths or anchors.
* This matters if you are using base tag settings.
*
*/
arrowMarkerAbsolute?: boolean;
/**
* 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.
*
*/
secure?: string[];
/**
* This option controls if the generated ids of nodes in the SVG are
* generated randomly or based on a seed.
* If set to `false`, the IDs are generated based on the current date and
* thus are not deterministic. This is the default behavior.
*
* This matters if your files are checked into source control e.g. git and
* should not change unless content is changed.
*
*/
deterministicIds?: boolean;
/**
* This option is the optional seed for deterministic ids.
* If set to `undefined` but deterministicIds is `true`, a simple number iterator is used.
* You can set this attribute to base the seed on a static string.
*
*/
deterministicIDSeed?: string;

@@ -32,88 +139,338 @@ flowchart?: FlowchartDiagramConfig;

c4?: C4DiagramConfig;
dompurifyConfig?: DOMPurify.Config;
sankey?: SankeyDiagramConfig;
dompurifyConfig?: DOMPurifyConfiguration;
wrap?: boolean;
fontSize?: number;
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "BaseDiagramConfig".
*/
export interface BaseDiagramConfig {
useWidth?: number;
/**
* When this flag is set to `true`, the height and width is set to 100%
* and is then scaled with the available space.
* If set to `false`, the absolute space required is used.
*
*/
useMaxWidth?: boolean;
}
/**
* The object containing configurations specific for c4 diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "C4DiagramConfig".
*/
export interface C4DiagramConfig extends BaseDiagramConfig {
/**
* Margin to the right and left of the c4 diagram, must be a positive value.
*
*/
diagramMarginX?: number;
/**
* Margin to the over and under the c4 diagram, must be a positive value.
*
*/
diagramMarginY?: number;
/**
* Margin between shapes
*/
c4ShapeMargin?: number;
/**
* Padding between shapes
*/
c4ShapePadding?: number;
/**
* Width of person boxes
*/
width?: number;
/**
* Height of person boxes
*/
height?: number;
/**
* Margin around boxes
*/
boxMargin?: number;
/**
* How many shapes to place in each row.
*/
c4ShapeInRow?: number;
nextLinePaddingX?: number;
/**
* How many boundaries to place in each row.
*/
c4BoundaryInRow?: number;
/**
* This sets the font size of Person shape for the diagram
*/
personFontSize?: string | number;
/**
* This sets the font weight of Person shape for the diagram
*/
personFontFamily?: string;
/**
* This sets the font weight of Person shape for the diagram
*/
personFontWeight?: string | number;
/**
* This sets the font size of External Person shape for the diagram
*/
external_personFontSize?: string | number;
/**
* This sets the font family of External Person shape for the diagram
*/
external_personFontFamily?: string;
/**
* This sets the font weight of External Person shape for the diagram
*/
external_personFontWeight?: string | number;
/**
* This sets the font size of System shape for the diagram
*/
systemFontSize?: string | number;
/**
* This sets the font family of System shape for the diagram
*/
systemFontFamily?: string;
/**
* This sets the font weight of System shape for the diagram
*/
systemFontWeight?: string | number;
/**
* This sets the font size of External System shape for the diagram
*/
external_systemFontSize?: string | number;
/**
* This sets the font family of External System shape for the diagram
*/
external_systemFontFamily?: string;
/**
* This sets the font weight of External System shape for the diagram
*/
external_systemFontWeight?: string | number;
/**
* This sets the font size of System DB shape for the diagram
*/
system_dbFontSize?: string | number;
/**
* This sets the font family of System DB shape for the diagram
*/
system_dbFontFamily?: string;
/**
* This sets the font weight of System DB shape for the diagram
*/
system_dbFontWeight?: string | number;
/**
* This sets the font size of External System DB shape for the diagram
*/
external_system_dbFontSize?: string | number;
/**
* This sets the font family of External System DB shape for the diagram
*/
external_system_dbFontFamily?: string;
/**
* This sets the font weight of External System DB shape for the diagram
*/
external_system_dbFontWeight?: string | number;
/**
* This sets the font size of System Queue shape for the diagram
*/
system_queueFontSize?: string | number;
/**
* This sets the font family of System Queue shape for the diagram
*/
system_queueFontFamily?: string;
/**
* This sets the font weight of System Queue shape for the diagram
*/
system_queueFontWeight?: string | number;
/**
* This sets the font size of External System Queue shape for the diagram
*/
external_system_queueFontSize?: string | number;
/**
* This sets the font family of External System Queue shape for the diagram
*/
external_system_queueFontFamily?: string;
/**
* This sets the font weight of External System Queue shape for the diagram
*/
external_system_queueFontWeight?: string | number;
/**
* This sets the font size of Boundary shape for the diagram
*/
boundaryFontSize?: string | number;
/**
* This sets the font family of Boundary shape for the diagram
*/
boundaryFontFamily?: string;
/**
* This sets the font weight of Boundary shape for the diagram
*/
boundaryFontWeight?: string | number;
/**
* This sets the font size of Message shape for the diagram
*/
messageFontSize?: string | number;
/**
* This sets the font family of Message shape for the diagram
*/
messageFontFamily?: string;
/**
* This sets the font weight of Message shape for the diagram
*/
messageFontWeight?: string | number;
/**
* This sets the font size of Container shape for the diagram
*/
containerFontSize?: string | number;
/**
* This sets the font family of Container shape for the diagram
*/
containerFontFamily?: string;
/**
* This sets the font weight of Container shape for the diagram
*/
containerFontWeight?: string | number;
/**
* This sets the font size of External Container shape for the diagram
*/
external_containerFontSize?: string | number;
/**
* This sets the font family of External Container shape for the diagram
*/
external_containerFontFamily?: string;
/**
* This sets the font weight of External Container shape for the diagram
*/
external_containerFontWeight?: string | number;
/**
* This sets the font size of Container DB shape for the diagram
*/
container_dbFontSize?: string | number;
/**
* This sets the font family of Container DB shape for the diagram
*/
container_dbFontFamily?: string;
/**
* This sets the font weight of Container DB shape for the diagram
*/
container_dbFontWeight?: string | number;
/**
* This sets the font size of External Container DB shape for the diagram
*/
external_container_dbFontSize?: string | number;
/**
* This sets the font family of External Container DB shape for the diagram
*/
external_container_dbFontFamily?: string;
/**
* This sets the font weight of External Container DB shape for the diagram
*/
external_container_dbFontWeight?: string | number;
/**
* This sets the font size of Container Queue shape for the diagram
*/
container_queueFontSize?: string | number;
/**
* This sets the font family of Container Queue shape for the diagram
*/
container_queueFontFamily?: string;
/**
* This sets the font weight of Container Queue shape for the diagram
*/
container_queueFontWeight?: string | number;
/**
* This sets the font size of External Container Queue shape for the diagram
*/
external_container_queueFontSize?: string | number;
/**
* This sets the font family of External Container Queue shape for the diagram
*/
external_container_queueFontFamily?: string;
/**
* This sets the font weight of External Container Queue shape for the diagram
*/
external_container_queueFontWeight?: string | number;
/**
* This sets the font size of Component shape for the diagram
*/
componentFontSize?: string | number;
/**
* This sets the font family of Component shape for the diagram
*/
componentFontFamily?: string;
/**
* This sets the font weight of Component shape for the diagram
*/
componentFontWeight?: string | number;
/**
* This sets the font size of External Component shape for the diagram
*/
external_componentFontSize?: string | number;
/**
* This sets the font family of External Component shape for the diagram
*/
external_componentFontFamily?: string;
/**
* This sets the font weight of External Component shape for the diagram
*/
external_componentFontWeight?: string | number;
/**
* This sets the font size of Component DB shape for the diagram
*/
component_dbFontSize?: string | number;
/**
* This sets the font family of Component DB shape for the diagram
*/
component_dbFontFamily?: string;
/**
* This sets the font weight of Component DB shape for the diagram
*/
component_dbFontWeight?: string | number;
/**
* This sets the font size of External Component DB shape for the diagram
*/
external_component_dbFontSize?: string | number;
/**
* This sets the font family of External Component DB shape for the diagram
*/
external_component_dbFontFamily?: string;
/**
* This sets the font weight of External Component DB shape for the diagram
*/
external_component_dbFontWeight?: string | number;
/**
* This sets the font size of Component Queue shape for the diagram
*/
component_queueFontSize?: string | number;
/**
* This sets the font family of Component Queue shape for the diagram
*/
component_queueFontFamily?: string;
/**
* This sets the font weight of Component Queue shape for the diagram
*/
component_queueFontWeight?: string | number;
/**
* This sets the font size of External Component Queue shape for the diagram
*/
external_component_queueFontSize?: string | number;
/**
* This sets the font family of External Component Queue shape for the diagram
*/
external_component_queueFontFamily?: string;
/**
* This sets the font weight of External Component Queue shape for the diagram
*/
external_component_queueFontWeight?: string | number;
/**
* This sets the auto-wrap state for the diagram
*/
wrap?: boolean;
/**
* This sets the auto-wrap padding for the diagram (sides only)
*/
wrapPadding?: number;

@@ -183,3 +540,10 @@ person_bg_color?: string;

}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "GitGraphDiagramConfig".
*/
export interface GitGraphDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;

@@ -193,4 +557,13 @@ diagramPadding?: number;

rotateCommitLabel?: boolean;
/**
* Controls whether or arrow markers in html code are absolute paths or anchors.
* This matters if you are using base tag settings.
*
*/
arrowMarkerAbsolute?: boolean;
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "NodeLabel".
*/
export interface NodeLabel {

@@ -202,2 +575,8 @@ width?: number;

}
/**
* The object containing configurations specific for req diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "RequirementDiagramConfig".
*/
export interface RequirementDiagramConfig extends BaseDiagramConfig {

@@ -214,42 +593,159 @@ rect_fill?: string;

}
/**
* The object containing configurations specific for mindmap diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "MindmapDiagramConfig".
*/
export interface MindmapDiagramConfig extends BaseDiagramConfig {
useMaxWidth: boolean;
padding: number;
maxNodeWidth: number;
padding?: number;
maxNodeWidth?: number;
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "PieDiagramConfig".
*/
export interface PieDiagramConfig extends BaseDiagramConfig {
/**
* Axial position of slice's label from zero at the center to 1 at the outside edges.
*
*/
textPosition?: number;
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "QuadrantChartConfig".
*/
export interface QuadrantChartConfig extends BaseDiagramConfig {
chartWidth: number;
chartHeight: number;
titleFontSize: number;
titlePadding: number;
quadrantPadding: number;
xAxisLabelPadding: number;
yAxisLabelPadding: number;
xAxisLabelFontSize: number;
yAxisLabelFontSize: number;
quadrantLabelFontSize: number;
quadrantTextTopPadding: number;
pointTextPadding: number;
pointLabelFontSize: number;
pointRadius: number;
xAxisPosition: 'top' | 'bottom';
yAxisPosition: 'left' | 'right';
quadrantInternalBorderStrokeWidth: number;
quadrantExternalBorderStrokeWidth: number;
/**
* Width of the chart
*/
chartWidth?: number;
/**
* Height of the chart
*/
chartHeight?: number;
/**
* Chart title top and bottom padding
*/
titleFontSize?: number;
/**
* Padding around the quadrant square
*/
titlePadding?: number;
/**
* quadrant title padding from top if the quadrant is rendered on top
*/
quadrantPadding?: number;
/**
* Padding around x-axis labels
*/
xAxisLabelPadding?: number;
/**
* Padding around y-axis labels
*/
yAxisLabelPadding?: number;
/**
* x-axis label font size
*/
xAxisLabelFontSize?: number;
/**
* y-axis label font size
*/
yAxisLabelFontSize?: number;
/**
* quadrant title font size
*/
quadrantLabelFontSize?: number;
/**
* quadrant title padding from top if the quadrant is rendered on top
*/
quadrantTextTopPadding?: number;
/**
* padding between point and point label
*/
pointTextPadding?: number;
/**
* point title font size
*/
pointLabelFontSize?: number;
/**
* radius of the point to be drawn
*/
pointRadius?: number;
/**
* position of x-axis labels
*/
xAxisPosition?: "top" | "bottom";
/**
* position of y-axis labels
*/
yAxisPosition?: "left" | "right";
/**
* stroke width of edges of the box that are inside the quadrant
*/
quadrantInternalBorderStrokeWidth?: number;
/**
* stroke width of edges of the box that are outside the quadrant
*/
quadrantExternalBorderStrokeWidth?: number;
}
/**
* The object containing configurations specific for entity relationship diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "ErDiagramConfig".
*/
export interface ErDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;
/**
* The amount of padding around the diagram as a whole so that embedded
* diagrams have margins, expressed in pixels.
*
*/
diagramPadding?: number;
layoutDirection?: string;
/**
* Directional bias for layout of entities
*/
layoutDirection?: string | "TB" | "BT" | "LR" | "RL";
/**
* The minimum width of an entity box. Expressed in pixels.
*/
minEntityWidth?: number;
/**
* The minimum height of an entity box. Expressed in pixels.
*/
minEntityHeight?: number;
/**
* The minimum internal padding between text in an entity box and the enclosing box borders.
* Expressed in pixels.
*
*/
entityPadding?: number;
/**
* Stroke color of box edges and lines.
*/
stroke?: string;
/**
* Fill color of entity boxes
*/
fill?: string;
/**
* Font size (expressed as an integer representing a number of pixels)
*/
fontSize?: number;
}
/**
* The object containing configurations specific for entity relationship diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "StateDiagramConfig".
*/
export interface StateDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;

@@ -266,2 +762,8 @@ arrowMarkerAbsolute?: boolean;

miniPadding?: number;
/**
* Font size factor, this is used to guess the width of the edges labels
* before rendering by dagre layout.
* This might need updating if/when switching font
*
*/
fontSizeFactor?: number;

@@ -273,6 +775,22 @@ fontSize?: number;

radius?: number;
defaultRenderer?: string;
/**
* Decides which rendering engine that is to be used for the rendering.
*
*/
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "ClassDiagramConfig".
*/
export interface ClassDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;
/**
* Controls whether or arrow markers in html code are absolute paths or anchors.
* This matters if you are using base tag settings.
*
*/
arrowMarkerAbsolute?: boolean;

@@ -282,20 +800,81 @@ dividerMargin?: number;

textHeight?: number;
defaultRenderer?: string;
/**
* Decides which rendering engine that is to be used for the rendering.
*
*/
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
nodeSpacing?: number;
rankSpacing?: number;
/**
* The amount of padding around the diagram as a whole so that embedded
* diagrams have margins, expressed in pixels.
*
*/
diagramPadding?: number;
htmlLabels?: boolean;
}
/**
* The object containing configurations specific for journey diagrams
*
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "JourneyDiagramConfig".
*/
export interface JourneyDiagramConfig extends BaseDiagramConfig {
/**
* Margin to the right and left of the c4 diagram, must be a positive value.
*
*/
diagramMarginX?: number;
/**
* Margin to the over and under the c4 diagram, must be a positive value.
*
*/
diagramMarginY?: number;
/**
* Margin between actors
*/
leftMargin?: number;
/**
* Width of actor boxes
*/
width?: number;
/**
* Height of actor boxes
*/
height?: number;
/**
* Margin around loop boxes
*/
boxMargin?: number;
/**
* Margin around the text in loop/alt/opt boxes
*/
boxTextMargin?: number;
/**
* Margin around notes
*/
noteMargin?: number;
/**
* Space between messages.
*/
messageMargin?: number;
messageAlign?: string;
/**
* Multiline message alignment
*/
messageAlign?: string | "left" | "center" | "right";
/**
* Prolongs the edge of the diagram downwards.
*
* Depending on css styling this might need adjustment.
*
*/
bottomMarginAdj?: number;
/**
* Curved Arrows become Right Angles
*
* This will display arrows that start and begin at the same node as
* right angles, rather than as curves.
*
*/
rightAngles?: boolean;

@@ -305,3 +884,10 @@ taskFontSize?: string | number;

taskMargin?: number;
/**
* Width of activation box
*/
activationWidth?: number;
/**
* text placement as: tspan | fo | old only text as before
*
*/
textPlacement?: string;

@@ -312,15 +898,64 @@ actorColours?: string[];

}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "TimelineDiagramConfig".
*/
export interface TimelineDiagramConfig extends BaseDiagramConfig {
/**
* Margin to the right and left of the c4 diagram, must be a positive value.
*
*/
diagramMarginX?: number;
/**
* Margin to the over and under the c4 diagram, must be a positive value.
*
*/
diagramMarginY?: number;
/**
* Margin between actors
*/
leftMargin?: number;
/**
* Width of actor boxes
*/
width?: number;
/**
* Height of actor boxes
*/
height?: number;
padding?: number;
/**
* Margin around loop boxes
*/
boxMargin?: number;
/**
* Margin around the text in loop/alt/opt boxes
*/
boxTextMargin?: number;
/**
* Margin around notes
*/
noteMargin?: number;
/**
* Space between messages.
*/
messageMargin?: number;
messageAlign?: string;
/**
* Multiline message alignment
*/
messageAlign?: string | "left" | "center" | "right";
/**
* Prolongs the edge of the diagram downwards.
*
* Depending on css styling this might need adjustment.
*
*/
bottomMarginAdj?: number;
/**
* Curved Arrows become Right Angles
*
* This will display arrows that start and begin at the same node as
* right angles, rather than as curves.
*
*/
rightAngles?: boolean;

@@ -330,3 +965,10 @@ taskFontSize?: string | number;

taskMargin?: number;
/**
* Width of activation box
*/
activationWidth?: number;
/**
* text placement as: tspan | fo | old only text as before
*
*/
textPlacement?: string;

@@ -337,52 +979,225 @@ actorColours?: string[];

disableMulticolor?: boolean;
useMaxWidth?: boolean;
}
/**
* The object containing configurations specific for gantt diagrams
*
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "GanttDiagramConfig".
*/
export interface GanttDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;
/**
* The height of the bars in the graph
*/
barHeight?: number;
/**
* The margin between the different activities in the gantt diagram
*/
barGap?: number;
/**
* Margin between title and gantt diagram and between axis and gantt diagram.
*
*/
topPadding?: number;
/**
* The space allocated for the section name to the right of the activities
*
*/
rightPadding?: number;
/**
* The space allocated for the section name to the left of the activities
*
*/
leftPadding?: number;
/**
* Vertical starting position of the grid lines
*/
gridLineStartPadding?: number;
/**
* Font size
*/
fontSize?: number;
/**
* Font size for sections
*/
sectionFontSize?: string | number;
/**
* The number of alternating section styles
*/
numberSectionStyles?: number;
/**
* Date/time format of the axis
*
* This might need adjustment to match your locale and preferences.
*
*/
axisFormat?: string;
/**
* axis ticks
*
* Pattern is:
*
* ```javascript
* /^([1-9][0-9]*)(minute|hour|day|week|month)$/
* ```
*
*/
tickInterval?: string;
/**
* When this flag is set, date labels will be added to the top of the chart
*
*/
topAxis?: boolean;
displayMode?: string;
/**
* Controls the display mode.
*
*/
displayMode?: string | "compact";
/**
* On which day a week-based interval should start
*
*/
weekday?: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
}
/**
* The object containing configurations specific for sequence diagrams
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "SequenceDiagramConfig".
*/
export interface SequenceDiagramConfig extends BaseDiagramConfig {
arrowMarkerAbsolute?: boolean;
hideUnusedParticipants?: boolean;
/**
* Width of the activation rect
*/
activationWidth?: number;
/**
* Margin to the right and left of the sequence diagram
*/
diagramMarginX?: number;
/**
* Margin to the over and under the sequence diagram
*/
diagramMarginY?: number;
/**
* Margin between actors
*/
actorMargin?: number;
/**
* Width of actor boxes
*/
width?: number;
/**
* Height of actor boxes
*/
height?: number;
/**
* Margin around loop boxes
*/
boxMargin?: number;
/**
* Margin around the text in loop/alt/opt boxes
*/
boxTextMargin?: number;
/**
* Margin around notes
*/
noteMargin?: number;
/**
* Space between messages.
*/
messageMargin?: number;
messageAlign?: string;
/**
* Multiline message alignment
*/
messageAlign?: string | "left" | "center" | "right";
/**
* Mirror actors under diagram
*
*/
mirrorActors?: boolean;
/**
* forces actor popup menus to always be visible (to support E2E testing).
*
*/
forceMenus?: boolean;
/**
* Prolongs the edge of the diagram downwards.
*
* Depending on css styling this might need adjustment.
*
*/
bottomMarginAdj?: number;
/**
* Curved Arrows become Right Angles
*
* This will display arrows that start and begin at the same node as
* right angles, rather than as curves.
*
*/
rightAngles?: boolean;
/**
* This will show the node numbers
*/
showSequenceNumbers?: boolean;
/**
* This sets the font size of the actor's description
*/
actorFontSize?: string | number;
/**
* This sets the font family of the actor's description
*/
actorFontFamily?: string;
/**
* This sets the font weight of the actor's description
*/
actorFontWeight?: string | number;
/**
* This sets the font size of actor-attached notes
*/
noteFontSize?: string | number;
/**
* This sets the font family of actor-attached notes
*/
noteFontFamily?: string;
/**
* This sets the font weight of actor-attached notes
*/
noteFontWeight?: string | number;
noteAlign?: string;
/**
* This sets the text alignment of actor-attached notes
*/
noteAlign?: string | "left" | "center" | "right";
/**
* This sets the font size of actor messages
*/
messageFontSize?: string | number;
/**
* This sets the font family of actor messages
*/
messageFontFamily?: string;
/**
* This sets the font weight of actor messages
*/
messageFontWeight?: string | number;
/**
* This sets the auto-wrap state for the diagram
*/
wrap?: boolean;
/**
* This sets the auto-wrap padding for the diagram (sides only)
*/
wrapPadding?: number;
/**
* This sets the width of the loop-box (loop, alt, opt, par)
*/
labelBoxWidth?: number;
/**
* This sets the height of the loop-box (loop, alt, opt, par)
*/
labelBoxHeight?: number;

@@ -393,20 +1208,104 @@ messageFont?: FontCalculator;

}
/**
* The object containing configurations specific for flowcharts
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "FlowchartDiagramConfig".
*/
export interface FlowchartDiagramConfig extends BaseDiagramConfig {
/**
* Margin top for the text over the diagram
*/
titleTopMargin?: number;
arrowMarkerAbsolute?: boolean;
/**
* The amount of padding around the diagram as a whole so that embedded
* diagrams have margins, expressed in pixels.
*
*/
diagramPadding?: number;
/**
* Flag for setting whether or not a html tag should be used for rendering labels on the edges.
*
*/
htmlLabels?: boolean;
/**
* Defines the spacing between nodes on the same level
*
* Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,
* and the vertical spacing for LR as well as RL graphs.
*
*/
nodeSpacing?: number;
/**
* Defines the spacing between nodes on different levels
*
* Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs,
* and the vertical spacing for LR as well as RL graphs.
*
*/
rankSpacing?: number;
curve?: string;
/**
* Defines how mermaid renders curves for flowcharts.
*
*/
curve?: string | "basis" | "linear" | "cardinal";
/**
* Represents the padding between the labels and the shape
*
* **Only used in new experimental rendering.**
*
*/
padding?: number;
defaultRenderer?: string;
/**
* Decides which rendering engine that is to be used for the rendering.
*
*/
defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
/**
* Width of nodes where text is wrapped.
*
* When using markdown strings the text ius wrapped automatically, this
* value sets the max width of a text before it continues on a new line.
*
*/
wrappingWidth?: number;
}
/**
* The object containing configurations specific for sankey diagrams.
*
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "SankeyDiagramConfig".
*/
export interface SankeyDiagramConfig extends BaseDiagramConfig {
width?: number;
height?: number;
/**
* The color of the links in the sankey diagram.
*
*/
linkColor?: SankeyLinkColor | string;
/**
* Controls the alignment of the Sankey diagrams.
*
* See <https://github.com/d3/d3-sankey#alignments>.
*
*/
nodeAlignment?: "left" | "right" | "center" | "justify";
useMaxWidth?: boolean;
}
/**
* This interface was referenced by `MermaidConfig`'s JSON-Schema
* via the `definition` "FontConfig".
*/
export interface FontConfig {
fontSize?: string | number;
fontSize?: CSSFontSize;
/**
* The CSS [`font-family`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) to use.
*/
fontFamily?: string;
/**
* The font weight to use.
*/
fontWeight?: string | number;
}
export type FontCalculator = () => Partial<FontConfig>;
export {};

@@ -1,31 +0,8 @@

import { MermaidConfig } from './config.type.js';
import { type MermaidConfig } from './config.type.js';
/**
* **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click
* here](8.6.0_docs.md)].**
* Default mermaid configuration options.
*
* ## **What follows are config instructions for older versions**
*
* These are the default options which can be overridden with the initialization call like so:
*
* **Example 1:**
*
* ```js
* mermaid.initialize({ flowchart:{ htmlLabels: false } });
* ```
*
* **Example 2:**
*
* ```html
* <script>
* const config = {
* startOnLoad:true,
* flowchart:{ useMaxWidth:true, htmlLabels:true, curve:'cardinal'},
* securityLevel:'loose',
* };
* mermaid.initialize(config);
* </script>
* ```
*
* A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults).
* A description of each option follows below.
* Please see the Mermaid config JSON Schema for the default JSON values.
* Non-JSON JS default values are listed in this file, e.g. functions, or
* `undefined` (explicitly set so that `configKeys` finds them).
*/

@@ -32,0 +9,0 @@ declare const config: Partial<MermaidConfig>;

@@ -26,2 +26,4 @@ export function parseDirective(statement: any, context: any, type: any): void;

export function isInvalidDate(date: any, dateFormat: any, excludes: any, includes: any): any;
export function setWeekday(txt: any): void;
export function getWeekday(): string;
export function addTask(descr: any, data: any): void;

@@ -74,2 +76,4 @@ export function findTaskById(id: any): any;

export { isInvalidDate };
export { setWeekday };
export { getWeekday };
}

@@ -76,0 +80,0 @@ export default _default;

@@ -1,2 +0,2 @@

import { QuadrantChartConfig } from '../../config.type.js';
import type { BaseDiagramConfig, QuadrantChartConfig } from '../../config.type.js';
export type TextVerticalPos = 'left' | 'center' | 'right';

@@ -57,3 +57,3 @@ export type TextHorizontalPos = 'top' | 'middle' | 'bottom';

}
export interface QuadrantBuilderConfig extends QuadrantChartConfig {
export interface QuadrantBuilderConfig extends Required<Omit<QuadrantChartConfig, keyof BaseDiagramConfig>> {
showXAxis: boolean;

@@ -60,0 +60,0 @@ showYAxis: boolean;

@@ -14,2 +14,4 @@ export function parseDirective(statement: any, context: any, type: any): void;

export function getActors(): {};
export function getCreatedActors(): {};
export function getDestroyedActors(): {};
export function getActor(id: any): any;

@@ -94,2 +96,4 @@ export function getActorKeys(): string[];

export { getActors };
export { getCreatedActors };
export { getDestroyedActors };
export { getActor };

@@ -96,0 +100,0 @@ export { getActorKeys };

@@ -90,3 +90,3 @@ import { Diagram } from '../../Diagram.js';

};
export declare const drawActors: (diagram: any, actors: any, actorKeys: any, verticalPos: any, configuration: any, messages: any, isFooter: any) => void;
export declare const drawActors: (diagram: any, actors: any, actorKeys: any, isFooter: any) => void;
export declare const drawActorsPopup: (diagram: any, actors: any, actorKeys: any, doc: any) => {

@@ -195,3 +195,3 @@ maxHeight: number;

};
drawActors: (diagram: any, actors: any, actorKeys: any, verticalPos: any, configuration: any, messages: any, isFooter: any) => void;
drawActors: (diagram: any, actors: any, actorKeys: any, isFooter: any) => void;
drawActorsPopup: (diagram: any, actors: any, actorKeys: any, doc: any) => {

@@ -198,0 +198,0 @@ maxHeight: number;

@@ -0,1 +1,2 @@

export const ACTOR_TYPE_WIDTH: number;
export function drawRect(elem: any, rectData: any): any;

@@ -10,3 +11,3 @@ export function drawPopup(elem: any, actor: any, minMenuWidth: any, textAttrs: any, forceMenus: any): {

export function drawLabel(elem: any, txtObject: any): any;
export function fixLifeLineHeights(diagram: any, bounds: any): void;
export function fixLifeLineHeights(diagram: any, actors: any, actorKeys: any, conf: any): void;
export function drawActor(elem: any, actor: any, conf: any, isFooter: any): any;

@@ -13,0 +14,0 @@ export function drawBox(elem: any, box: any, conf: any): void;

@@ -1,1 +0,9 @@

export function createText(el: any, text?: any, { style, isTitle, classes, useHtmlLabels, isNode, width, addSvgBackground, }?: any): any;
export declare const createText: (el: any, text?: string, { style, isTitle, classes, useHtmlLabels, isNode, width, addSvgBackground, }?: {
style?: string | undefined;
isTitle?: boolean | undefined;
classes?: string | undefined;
useHtmlLabels?: boolean | undefined;
isNode?: boolean | undefined;
width?: number | undefined;
addSvgBackground?: boolean | undefined;
}) => any;

@@ -0,9 +1,6 @@

import { MarkdownLine } from './types.js';
/**
* @param {string} markdown markdown to split into lines
* @param markdown - markdown to split into lines
*/
export function markdownToLines(markdown: string): never[][];
/**
* @param {string} markdown markdown to convert to HTML
* @returns {string} HTML
*/
export function markdownToHTML(markdown: string): string;
export declare function markdownToLines(markdown: string): MarkdownLine[];
export declare function markdownToHTML(markdown: string): string;

@@ -9,3 +9,3 @@ /**

export declare class MockedD3 {
attribs: Map<string, string | null>;
attribs: Map<string, string>;
id: string | undefined;

@@ -17,30 +17,31 @@ _children: MockedD3[];

listChildren(): string;
select: import("@vitest/spy/dist/index.js").Mock<any, any>;
selectAll: import("@vitest/spy/dist/index.js").Mock<any, any>;
append: import("@vitest/spy/dist/index.js").Mock<any, any>;
select: import("@vitest/spy").Mock<any, any>;
selectAll: import("@vitest/spy").Mock<any, any>;
append: import("@vitest/spy").Mock<any, any>;
insert: (type: string, beforeSelector?: string, id?: string) => MockedD3;
attr(attrName: string): null | undefined | string | number;
attr(attrName: string): undefined | string;
attr(attrName: string, attrValue: string): MockedD3;
lower(attrValue?: string): this;
style(attrValue?: string): this;
text(attrValue?: string): this;
node: import("@vitest/spy/dist/index.js").Mock<any, any>;
nodes: import("@vitest/spy/dist/index.js").Mock<any, any>;
node: import("@vitest/spy").Mock<any, any>;
nodes: import("@vitest/spy").Mock<any, any>;
getBBox: () => {
x: string | number | null | undefined;
y: string | number | null | undefined;
width: string | number | null | undefined;
height: string | number | null | undefined;
x: string | number | undefined;
y: string | number | undefined;
width: string | number | undefined;
height: string | number | undefined;
};
insertBefore: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveBasis: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveBasisClosed: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveBasisOpen: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveLinear: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveLinearClosed: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveMonotoneX: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveMonotoneY: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveNatural: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveStep: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveStepAfter: import("@vitest/spy/dist/index.js").Mock<any, any>;
curveStepBefore: import("@vitest/spy/dist/index.js").Mock<any, any>;
insertBefore: import("@vitest/spy").Mock<any, any>;
curveBasis: import("@vitest/spy").Mock<any, any>;
curveBasisClosed: import("@vitest/spy").Mock<any, any>;
curveBasisOpen: import("@vitest/spy").Mock<any, any>;
curveLinear: import("@vitest/spy").Mock<any, any>;
curveLinearClosed: import("@vitest/spy").Mock<any, any>;
curveMonotoneX: import("@vitest/spy").Mock<any, any>;
curveMonotoneY: import("@vitest/spy").Mock<any, any>;
curveNatural: import("@vitest/spy").Mock<any, any>;
curveStep: import("@vitest/spy").Mock<any, any>;
curveStepAfter: import("@vitest/spy").Mock<any, any>;
curveStepBefore: import("@vitest/spy").Mock<any, any>;
}
{
"name": "mermaid",
"version": "10.2.4",
"version": "10.3.0-rc.1",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",

@@ -25,15 +25,2 @@ "type": "module",

],
"scripts": {
"clean": "rimraf dist",
"docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup",
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts",
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify",
"docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress",
"docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm --filter ./ install --no-frozen-lockfile --ignore-scripts && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./ src/vitepress dev\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
"release": "pnpm build",
"prepublishOnly": "cpy '../../README.*' ./ --cwd=. && pnpm -w run build"
},
"repository": {

@@ -57,2 +44,4 @@ "type": "git",

"@braintree/sanitize-url": "^6.0.2",
"@types/d3-scale": "^4.0.3",
"@types/d3-scale-chromatic": "^3.0.0",
"cytoscape": "^3.23.0",

@@ -62,5 +51,6 @@ "cytoscape-cose-bilkent": "^4.1.0",

"d3": "^7.4.0",
"d3-sankey": "^0.12.3",
"dagre-d3-es": "7.0.10",
"dayjs": "^1.11.7",
"dompurify": "3.0.3",
"dompurify": "3.0.5",
"elkjs": "^0.8.2",

@@ -77,4 +67,6 @@ "khroma": "^2.0.0",

"devDependencies": {
"@adobe/jsonschema2md": "^7.1.4",
"@types/cytoscape": "^3.19.9",
"@types/d3": "^7.4.0",
"@types/d3-sankey": "^0.12.1",
"@types/d3-selection": "^3.0.5",

@@ -90,5 +82,5 @@ "@types/dompurify": "^3.0.2",

"@typescript-eslint/parser": "^5.59.0",
"ajv": "^8.11.2",
"chokidar": "^3.5.3",
"concurrently": "^8.0.1",
"coveralls": "^3.1.1",
"cpy-cli": "^4.2.0",

@@ -101,2 +93,3 @@ "cspell": "^6.31.1",

"jsdom": "^22.0.0",
"json-schema-to-typescript": "^11.0.3",
"micromatch": "^4.0.5",

@@ -114,2 +107,3 @@ "path-browserify": "^1.0.1",

"unist-util-flatmap": "^1.0.0",
"unist-util-visit": "^4.1.2",
"vitepress": "^1.0.0-alpha.72",

@@ -125,3 +119,20 @@ "vitepress-plugin-search": "^1.0.4-alpha.20"

"access": "public"
},
"scripts": {
"clean": "rimraf dist",
"docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup",
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm scripts/docs.cli.mts",
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm scripts/docs.cli.mts --verify",
"docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && ts-node-esm scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
"docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev\" \"ts-node-esm scripts/docs.cli.mts --watch --vitepress\"",
"docs:dev:docker": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev:docker\" \"ts-node-esm scripts/docs.cli.mts --watch --vitepress\"",
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
"docs:release-version": "ts-node-esm scripts/update-release-version.mts",
"docs:verify-version": "ts-node-esm scripts/update-release-version.mts --verify",
"types:build-config": "ts-node-esm --transpileOnly scripts/create-types-from-json-schema.mts",
"types:verify-config": "ts-node-esm scripts/create-types-from-json-schema.mts --verify",
"release": "pnpm build"
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc