59 Commits
Author SHA1 Message Date
ydah 4f2e1abe1e Replace EBNF input syntax with IR function-call syntax
Change the railroad diagram input from EBNF grammar notation to an
explicit IR that directly describes layout primitives: sequence(),
choice(), optional(), oneOrMore(), zeroOrMore(), terminal(),
nonterminal(), and special().

This separates the concern of grammar notation parsing from diagram
layout, enabling grammar-specific front-ends (EBNF, ABNF, PEG) to
be layered on top as independent modules.
2026-05-07 17:30:45 +09:00
ydah bdd0770f5d Drop unreachable railroad alias from grammar
The detector only accepts 'railroad-diagram', making the 'railroad'
alias in the grammar unreachable through normal diagram detection.
Remove it from the grammar and update the corresponding parser test
to use 'railroad-diagram' for consistency.
2026-05-07 17:29:30 +09:00
ydah 0264cca865 Add Langium railroad parser 2026-05-07 17:28:23 +09:00
Ben 0f997349a6 Merge branch 'develop' into feature/treeview-filetree-enhancements 2026-04-20 21:13:02 +10:00
Ben Doherty 51cec1f04e Merge remote-tracking branch 'upstream/develop' into feature/treeview-filetree-enhancements 2026-04-17 09:13:50 +10:00
Yordis Prieto 32c257e423 fix(eventmodeling): avoid shipping pre-release screen terminology
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
2026-04-16 12:29:24 -04:00
Ben Doherty 74c97becbc Merge branch 'develop' of https://github.com/mermaid-js/mermaid into feature/treeview-filetree-enhancements 2026-04-15 09:52:30 +10:00
Yordis Prieto d50c42330c feat(eventmodeling): enforce Event Modeling connection invariants via Langium validator
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
2026-04-07 15:40:54 -04:00
Ben Doherty 51a829bbae test: add unit tests for treeView icons, db, and valueConverter
- icons.spec.ts: resolution priority, case sensitivity, edge cases, SVG path coverage
- db.spec.ts: tree building, stack-based nesting, config, accessibility
- treeViewValueConverter.test.ts: all structured terminal conversions

Addresses missing coverage flagged by Codecov.
2026-04-02 18:14:42 +10:30
Ben Doherty 2f384ae7da refactor(treeView): replace NODE_CONTENT with structured Langium terminals
Replace monolithic NODE_CONTENT terminal with structured terminals
(QUOTED_NAME, BARE_NAME, CLASS_ANNOTATION, ICON_ANNOTATION,
DESC_ANNOTATION) so the grammar handles parsing instead of imperative
regex in parser.ts.

- Rewrite treeView.langium with 5 structured terminals
- Update valueConverter.ts with converters for each terminal
- Simplify parser.ts by removing parseNodeContent() entirely
- Rewrite parser.spec.ts as integration tests
- Update treeView.test.ts for new AST fields

Addresses reviewer feedback from @lee-treehouse on PR #7527.
2026-03-27 16:27:24 +11:00
Ben Doherty b4d0442dd1 feat(treeView): add file tree enhancements icons, bare labels, annotations, highlights
Extends treeView-beta (PR #7396 by @lee-treehouse and @Vikrantpalle) with
file-tree-specific features:

- Bare (unquoted) labels: src/, index.js, .gitignore
- 30+ auto-detected file-type icons (JS, TS, Python, Docker, etc.)
- :::class annotations (e.g. :::highlight for yellow background)
- icon(name) overrides for custom icons
- ## inline descriptions, column-aligned across all nodes
- Directory auto-detection via trailing slash
- Folder names with spaces (unquoted)
- Two-pass rendering for description column alignment
- Diagram-scoped icon symbol IDs (no duplicates on multi-diagram pages)
- Side-by-side demo page showing input syntax next to rendered output
- 26 new parseNodeContent unit tests + 8 new Langium parser tests
- 5 new Cypress E2E tests
- Comprehensive docs rewrite with all new features

Grammar: NODE_CONTENT terminal captures rest-of-line; detailed annotation
parsing (:::class, icon(), ##) delegated to TypeScript parseNodeContent().

Closes #7516
2026-03-25 11:13:35 +11:00
Ladislav Gazo 9bc9eb2a35 Merge branch 'develop' into feature/event-modeling-diagram 2026-03-22 17:35:54 +01:00
leentaylor f57ac0d29e update parser to require spaces around content 2026-03-07 14:32:22 +11:00
leentaylor ec4cc570f2 try this again in pipeline 2026-02-17 13:44:54 +11:00
leentaylor c11c2ebb38 Revert "Revert "possible option is to return indent length instead of actual indent (speculative since indent works locally, but not in pipeline)""
This reverts commit 209d2623b5.
2026-02-17 13:33:22 +11:00
leentaylor 209d2623b5 Revert "possible option is to return indent length instead of actual indent (speculative since indent works locally, but not in pipeline)"
This reverts commit b85199f38a.
2026-02-17 12:48:33 +11:00
leentaylor b85199f38a possible option is to return indent length instead of actual indent (speculative since indent works locally, but not in pipeline) 2026-02-17 12:43:40 +11:00
leentaylor 0cfe0d3213 indent tests behave differently locally to pipeline. comment out to check review branch 2026-02-17 11:43:01 +11:00
leentaylor a5255387b3 adjust indent test (affected by whitespace handling?) 2026-02-17 11:36:00 +11:00
leentaylor fa86fa685d add indent tests 2026-02-17 11:24:40 +11:00
Lee Taylor 4aa705f6f7 Merge branch 'develop' into 2645_add_tree_view_diagram_update 2026-02-17 10:57:00 +11:00
leentaylor adf46fbbad parser WIP 2026-02-17 10:55:26 +11:00
leentaylor 613e1d3abb wip understanding parser 2026-02-16 21:11:58 +11:00
leentaylor 781da8cae8 add failing parser tests for treeview 2026-02-16 14:16:54 +11:00
Alois Klink 2b12b9354d Merge remote-tracking branch 'origin/develop' into chore/upgrade-to-langium-v4-develop
Fixes a semantic merge conflict in
`packages/parser/tests/architecture.test.ts` due to the Langium v4
changing the `Architecture` value to `Architecture.$type`.

Conflicts:
	package.json
	pnpm-lock.yaml
2026-02-13 20:54:48 +09:00
Alois Klink 72433401a8 chore(parser)!: upgrade parser to Langium v4
Updates the `@mermaid-js/parser` to Langium v4.

There were a couple of breaking changes we had to fix to do this
upgrade:

- Rename all the grammers from Abc to AbcGrammar, as rules
  within grammars cannot have the same name as the grammar.
- Update the tests, since the generated type names from `ast.ts` have
  been moved from `<typeName>` to `<typeName>.$type`.
- Turn the EOL fragment into a rule, as in Langium v4, it's no longer
  allowed and throws an error.

As this is a **BREAKING CHANGE** for users, I've made a new major
release in the changeset (and it means we can finally get a v1.0.0 of
`@mermaid-js/parser`).
2026-02-13 20:40:20 +09:00
Ashish Jain 09d06501c3 Merge pull request #7310 from mermaid-js/fix/architecture-string-labels
7156:Support quoted string labels in architecture diagrams
2026-01-23 14:58:14 +00:00
omkarht ec7702071c 7162: add line and column numbers to parse error messages
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
2026-01-21 15:15:15 +05:30
darshanr0107 3d3868a2bf fix: enhance architecture value converter to preserve quotes and apostrophes in titles
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
2026-01-14 16:58:56 +05:30
darshanr0107 a9e4c72ed1 fix: support quoted string labels in architecture-beta diagrams
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
2026-01-12 15:57:19 +05:30
Ladislav Gazo cbeaed476d fix(eventmodeling): compact and relaxed notation + aligned reference token
Support for both compact and relaxed notation implemented. It is interchangeable.
Time Frame reference token uses Sequence diagram convention as suggested in PR.
Documentation updated as well.
2025-09-12 22:18:08 +02:00
Ladislav Gazo 0ca68a15c6 Merge branch 'develop' into feature/event-modeling-diagram 2025-07-26 19:56:08 +02:00
Sidharth Vinod ca2eca58c9 Merge branch 'develop' into sidv/packet-release
* develop: (266 commits)
  chore: update E2E timings
  docs: Update changeset
  fix: Add useful error message to test
  chore: Add treemap example
  chore: Add treemap example
  chore: Add peerDependency to @mermaid-js/examples
  Version Packages
  docs: Update changeset
  update in changeset
  updated validaor and tests to use treemap
  Updated parser to use treemap
  chore: Fail build in CI on type errors
  fix text going outside node
  Version Packages
  Updated phpbb url  to support 403 in lychee
  Updated lychee for working url phpbb.com
  resolve PR comment
  resolve PR comments
  chore: update E2E timings
  add changeset
  ...
2025-07-10 00:38:41 +05:30
shubham-mermaid 35b84761a9 updated validaor and tests to use treemap 2025-07-07 18:54:38 +05:30
Knut Sveidqvist 41108358f6 Adding support for title and accessibilities 2025-05-15 10:44:46 +02:00
Knut Sveidqvist 2746bccef3 Added rendering and documentation for treemap - linting 2025-05-12 15:54:06 +02:00
Knut Sveidqvist 680d65114c Added class suppoort to the grammar 2025-05-09 13:47:45 +02:00
Knut Sveidqvist 40eb0cc240 Passing tests 2025-05-07 16:15:14 +02:00
Sidharth Vinod 19884294bc chore: Move packet diagram out of beta 2025-04-20 14:09:27 +05:30
Thomas Di Cizerone 04d68e7f9a ⚗️ Add parser tests for architecture and other edge cases encountered 2025-04-02 18:50:20 +02:00
Ladislav Gazo 1ff60a2cf1 feat(eventmodeling): multiple source frames relation rendering
* support to reset the relation inference with `rf` (EmResetFrame) type
2025-03-28 18:15:41 +01:00
Ladislav Gazo 19af01fe7d refactor(eventmodeling): namespacing the event modeling language
* changed also the source frame identifier from >t to >tf to be consistent
2025-03-25 21:31:56 +01:00
Ladislav Gazo f551bb91a6 Merge branch 'develop' into feature/event-modeling-diagram 2025-03-23 15:43:10 +01:00
Thomas Di Cizerone d80cc38bb2 🖋️ Add grammar for Radar chart 2025-03-16 18:00:50 +01:00
Ladislav Gazo c44b578d1f feat(eventmodeling): first version of Event Modeling DSL
This initial version contain working parser for the Event Modeling text DSL.
It has also trivial renderer that lays out entities in three fixed
swimlanes. There are no edges yet. It is to prove the whole lifecycle and
get familiar with all the places when implementing new diagram type.
2025-02-26 20:39:32 +01:00
Austin Fulbright 0d4c3e5f72 added unit tests for gitGraph parser 2024-07-27 03:51:28 -04:00
Austin Fulbright d0eadebb99 added parser 2024-07-25 05:25:19 -04:00
Austin Fulbright 6f7c291512 Added gitGraphAst as typescript added gitGraphTypes and gitGraphParser 2024-07-22 04:10:36 -04:00
Austin Fulbright 1d0e98dd62 Added the langium module for gitGraph 2024-07-21 19:50:59 -04:00
Sidharth Vinod 1659ace65d Fix spelling 2024-03-06 14:16:32 +05:30