906 Commits

Author SHA1 Message Date
Sidharth Vinod
9b01a07b9d
Fix lodash import 2022-11-21 18:13:35 +05:30
pbrolin47
32db43069d
Merge pull request #3833 from mermaid-js/3832_mindmaps_single_node
#3882 fix for issues with mindmaps  with only a single node
2022-11-21 13:39:16 +01:00
Sidharth Vinod
89488b60a4
Formatting 2022-11-21 18:06:53 +05:30
Sidharth Vinod
a686255d9e
Merge branch 'develop' into sidv/optimizeSize
* develop:
  chore(deps): update pnpm to v7.17.0
  docs: Remove warning in readme
  chore(deps): update lycheeverse/lychee-action action to v1.5.4
  chore: Add size shield in readme
  Fix example for Git diagrams
  Fix TS errors
  Add interface for DiagramDb and other minor changes
  Disallow leading whitespace before delimiter
  Add title support using YAML frontmatter
2022-11-21 18:06:30 +05:30
Knut Sveidqvist
ffb95b4fa9
Merge pull request #3823 from mermaid-js/sidv/viz
Add package visualizations
2022-11-21 13:32:19 +01:00
Knut Sveidqvist
29a02d1ab5
Merge pull request #3809 from aloisklink/use-dagre-d3-es
Replace `dagre`/`dagre-d3` with `dagre-d3-es`
2022-11-21 13:31:35 +01:00
Knut Sveidqvist
564414ecac #3882 fix for issues with mindmaps with only a single node 2022-11-21 13:23:25 +01:00
Knut Sveidqvist
050574f60f
Merge pull request #3706 from MasonM/feature/1433_title_support
feat: Title support via front matter for ER, state, class, git, and graph diagrams
2022-11-21 11:44:26 +01:00
Sidharth Vinod
ed6ad77fd9
docs: Remove warning in readme 2022-11-21 11:52:57 +05:30
Dan Fallon
1f64302ae2 Use stylis to prepend idSelector
code previously manually inserted idSelector before the generated CSS.
This could produce incorrect CSS.

Adding & in front of rules will ensure that it behaves properly.
Stylis seems permissive about the lack of nesting selector, but fails
if there is no selector at all. (e.g. "{...props...}")

We should probably do this for each diagram's style.ts files as well
2022-11-20 23:11:05 -06:00
Sidharth Vinod
de99cdfb4c
chore: Add size shield in readme
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-11-21 08:22:10 +05:30
Sidharth Vinod
de8ce77f37
fix Lint 2022-11-21 08:16:16 +05:30
Sidharth Vinod
13ef403921
chore: Update dagre-d3-es 2022-11-21 08:16:15 +05:30
Sidharth Vinod
f687abb165
chore: Use graphlib from dagre-d3-es 2022-11-21 08:16:08 +05:30
Sidharth Vinod
931661ed67
fix: Add types to memoized functions 2022-11-21 08:13:44 +05:30
Sidharth Vinod
7d3a0577d2
chore: Replace lodash with lodash-es 2022-11-21 08:13:44 +05:30
Sidharth Vinod
4890999206
Merge branch 'sidv/viz' into sidv/dagre-es-viz
* sidv/viz:
  Fix Lodash import
  fix: Viz build
  feat: Add package visualization
  Ignore stats.html
  feat: Add bundle visualization
  style(docs): use `github-dark` hightlight theme
  refactor(docs): use default vitepress highlighter
  fix: Move redirection to router
  chore: Add docs to redirect.ts
  feat: Redirect old documentation links.
  comments in states are skipped now
  Remove extra arrow and adjust cross position
2022-11-21 08:13:43 +05:30
Ashley Engelund (weedySeaDragon @ github)
a9c337302a export D3Element from mermaidAPI; use in accessibility 2022-11-20 12:27:29 -08:00
Ashley Engelund
2a98791ec9
use optional chaining check for get acc title and get acc description
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-11-20 12:17:21 -08:00
Sidharth Vinod
8a2d3a400c
Fix Lodash import 2022-11-20 19:12:52 +05:30
Sidharth Vinod
bf53a03c9d
fix: Use lodash instead of lodash-es
lodash with specific imports use lesser space than lodash-es
2022-11-20 18:30:01 +05:30
Sidharth Vinod
bc269a966d
Merge branch 'sidv/sizeCheck' into sidv/splitDiagrams
* sidv/sizeCheck:
  feat: Add size inspection plugin
2022-11-20 12:09:42 +05:30
Sidharth Vinod
d39606cb47
fix: Mindmap link 2022-11-20 12:04:28 +05:30
Sidharth Vinod
b04517b146
chore: Cleanup 2022-11-20 12:00:34 +05:30
Sidharth Vinod
024ee4213f
Merge branch 'develop' into sidv/splitDiagrams
* develop: (233 commits)
  style(docs): use `github-dark` hightlight theme
  refactor(docs): use default vitepress highlighter
  fix: Move redirection to router
  ci(renovate): disable pinning dependencies
  Revert "chore(deps): pin dependencies"
  change shiki getHighlighter import
  create separate spec for stateRenderer-v2
  diagramStates should not be global; pass it into functions; minor comment fixes
  diagramClasses no longer needs to be cached; mermaidAPI no longer calls it repeatedly
  (minor) import expectTypeOf in spec
  (minor) fix JSdoc tag
  + spec stateRenderer-v2.js getClasses() to verify it returns a {}
  (minor) fix JSdoc types in comments
  (minor) add comments, remove duplicated line
  chore: Add master to link checker
  chore: Add docs to redirect.ts
  stateDB classes must be a {} not []
  feat: Redirect old documentation links.
  add stateDiagram-v2 to list of graphs with classDefs
  fix(docs): ClassDiagram table
  ...
2022-11-20 11:58:55 +05:30
Sidharth Vinod
e861fbb517
feat: unbundle styles 2022-11-20 11:09:08 +05:30
Mason Malone
bdf8b01185 Fix example for Git diagrams 2022-11-19 13:20:12 -08:00
Mason Malone
1b201bf462 Fix TS errors 2022-11-19 13:01:21 -08:00
Mason Malone
3316aa5f4f Add interface for DiagramDb and other minor changes 2022-11-19 12:52:49 -08:00
Mason Malone
a11ab3d5ea Disallow leading whitespace before delimiter 2022-11-19 12:52:49 -08:00
Sidharth Vinod
2e028ce36d
chore: Unify registerLazyLoadedDiagrams 2022-11-20 00:38:35 +05:30
Doug Finke
2a0f6d4cc9
Integrations added - Visual Studio Code [Polyglot Interactive Notebooks] 2022-11-19 11:20:13 -05:00
endolith
e3b9dbdf13 Fix typos 2022-11-19 09:33:01 -05:00
Mason Malone
70f024735b Add title support using YAML frontmatter 2022-11-18 20:42:54 -08:00
Alois Klink
fd76e0e270 chore: replace dagre/dagre-d3 with dagre-d3-es
Replace the dagre and dagre-d3 libraries with dagre-d3-es.

Both dagre and dagre-d3 are deprecated and unmaintained,
and haven't been updated for more than 3 years.

Since dagre-d3 still requires an old version of d3, this causes
a bunch of security warnings,
e.g. https://github.com/advisories/GHSA-36jr-mh4h-2g58

The [dagre-d3-es](https://github.com/tbo47/dagre-es) package is a fork
that contains support for `"d3": "^7.6.1"`. Also, it's ESM, so we will
hopefully get smaller bundle sizes too. The only issue is that this
fork isn't very well used (only has 3000 weekly downloads),
compared to `dagre-d3`'s 250,000 weekly downloads.

(although to be fair, a large proportion of dagre-d3's downloads
 probably come from mermaid)

Since it's is a less popular package,
**I've pinned `dagre-d3-es` to `"7.0.2"` instead of `"^7.0.2"`**.
This does mean if there is a bug in `dagre-d3-es`, we will have to
manually bump it ourselves, but it also means we won't accidentally
be sending a buggy version of `dagre-d3-es` out to users in cases
something changes (it might be worth disabling renovate for this
if we're feeling paranoid!)
2022-11-18 18:33:05 +00:00
Sidharth Vinod
09ed41b7d2
Merge pull request #3807 from aloisklink/docs/update-code-highlighting-theme
Use `github-dark` to highlight fence blocks in vitepress docs
2022-11-18 23:09:59 +05:30
Sidharth Vinod
7306b5ac45
feat: Add size inspection plugin 2022-11-18 17:52:55 +05:30
Sidharth Vinod
0854bab124
fix: Remove diagram dependency from mermaidAPI 2022-11-18 16:51:50 +05:30
Sidharth Vinod
fa51121f29
chore(split): Error 2022-11-18 16:30:54 +05:30
Sidharth Vinod
0b4c6f6477
chore(split): Journey 2022-11-18 16:22:38 +05:30
Sidharth Vinod
e5768454f1
chore(split): State Diagram 2022-11-18 16:19:38 +05:30
Sidharth Vinod
89b5eb56f2
chore(split): Orchestration 2022-11-18 16:11:19 +05:30
Sidharth Vinod
616c969a03
chore(split): Flow type 2022-11-18 16:11:03 +05:30
Sidharth Vinod
4fd826ac8c
chore(split): Sequence 2022-11-18 16:10:51 +05:30
Sidharth Vinod
6d5a6ad0c8
chore(split): Requirement 2022-11-18 16:10:42 +05:30
Sidharth Vinod
e0cd76e6fd
chore(split): Pie 2022-11-18 16:10:25 +05:30
Sidharth Vinod
f03364f328
chore(split): Info 2022-11-18 16:10:15 +05:30
Sidharth Vinod
25bc381361
chore(split): gitGraph 2022-11-18 16:10:06 +05:30
Sidharth Vinod
38e5c3a81e
chore(split): Gantt 2022-11-18 16:09:56 +05:30
Sidharth Vinod
43aa831dd2
chore(split): ER 2022-11-18 16:09:45 +05:30