-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize sequence definitions #4795
base: develop
Are you sure you want to change the base?
Standardize sequence definitions #4795
Conversation
❌ Deploy Preview for mermaid-js failed.
|
@@ -1087,7 +1087,7 @@ export interface SequenceDiagramConfig extends BaseDiagramConfig { | |||
*/ | |||
diagramMarginX?: number; | |||
/** | |||
* Margin to the over and under the sequence diagram | |||
* Margin to the top and bottom of the sequence diagram |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a generated file, please modify the original one: packages/mermaid/src/schemas/config.schema.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oop rookie mistake
This allows for a conceptual and type splitting between texts which appear in many places in the diagram (messages, notes, actor descriptions, etc) and messages between participants. I believe it makes more sense to call parseText rather than parseMessage when used in context of working with other components in the diagram which will help with developer experience. A notable change when implementing this is changing all wrap fields in relevant interfaces to optional. This is done so that if left undefined, we will resolt to an autoWrap function which references the diagram config. This will allow for an implementation of a diagram wide default of either wrap or nowrap that's left to the user to decide, instead of a hard-coded default.
// JSON.parse the text | ||
try { | ||
let sanitizedText = sanitizeText(text.text, commonGetConfig()); | ||
sanitizedText = sanitizedText.replace(/&/g, '&'); |
Check failure
Code scanning / CodeQL
Double escaping or unescaping High
here
const links: Record<string, string> = {}; | ||
let sanitizedText = sanitizeText(text.text, commonGetConfig()); | ||
const sep = sanitizedText.indexOf('@'); | ||
sanitizedText = sanitizedText.replace(/&/g, '&'); |
Check failure
Code scanning / CodeQL
Double escaping or unescaping High
📑 Summary
Migrates the Sequence Diagram to Typescript
Resolves #
📏 Design Decisions
Will follow the the guidelines and design choices made in #4501, #4486, and #4499 to maintain cohesiveness across the codebase as much as possible. I will attempt to refactor the code without changing functionality as much as possible. In a scenario where that may not be possible, I will maintain the old code and leave refactoring/optimizing to another issue/ticket.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.develop
branch