Commit Graph

1804 Commits

Author SHA1 Message Date
Sidharth Vinod 509a580f9d
Merge pull request #4396 from gjtorikian/patch-2
Fix a typo
2023-07-25 18:54:56 +05:30
Sidharth Vinod 91ae9a2901
Merge branch 'master' into pr/Incognito/4660
* master:
  update latest news section
2023-07-25 18:41:26 +05:30
Sidharth Vinod 27d98728a6
chore: Rename C4C to C4 2023-07-25 17:42:12 +05:30
Steph 28bb0df6c8 update latest news section 2023-07-24 22:15:22 -07:00
Ibrahim Wassouf 20cd685ae3 Allow escaped quotations in strings 2023-07-24 22:43:55 -03:00
Ibrahim Wassouf 47c100809b Add unit tests for all cases of TEXT and STR combinations 2023-07-24 21:46:28 -03:00
Ibrahim Wassouf 651274bc6f Only allow quotes to wrap entire string 2023-07-24 21:23:21 -03:00
Ibrahim Wassouf 4cfbd0d380 Remove unused definitions 2023-07-24 21:05:17 -03:00
Ibrahim Wassouf 45d92769aa Change rest of grammar statements to use variable name instead of position 2023-07-24 21:04:36 -03:00
kgilbert78 3e3e784fd9 added Typora to integrations list 2023-07-24 13:24:33 -04:00
Ibrahim Wassouf 474e0b9c82 Refactor vertex grammars to use name values instead of position in production 2023-07-23 21:54:42 -03:00
Ibrahim Wassouf 087738df78 Refactor statement grammars to use name values instead of positions in production 2023-07-23 21:39:21 -03:00
Ibrahim Wassouf fa8e02721a Refactor directive grammar to use name instead of position in production 2023-07-23 21:32:52 -03:00
Ibrahim Wassouf 4b9773a272 Refactor token precedence that concern vertex text states 2023-07-23 21:25:19 -03:00
renovate[bot] e4699ef02a
chore(deps): update all patch dependencies 2023-07-24 00:18:49 +00:00
Brian Graham 60cf043c3d
Corrects name of C4 link 2023-07-23 08:27:54 +02:00
Ibrahim Wassouf fd88b424b4 Add unit test for vertex and edge having both strings and text 2023-07-22 15:09:24 -03:00
Ibrahim Wassouf 3ab0e9998d Remove href state and give call higher precedence
Similar to what was done in the class diagram parser,
this will allow string tokens to appear in any state.
This is especially helpful, because it will simplify the
code and any future refactoring
2023-07-22 14:39:45 -03:00
Ibrahim Wassouf f48a9c8696 Merge branch 'develop' into bug/4645_graph_node_containing_keyword 2023-07-21 21:12:16 -03:00
Ibrahim Wassouf eea0ea5e07 Add unit tests for node id strings with keywords 2023-07-21 21:10:37 -03:00
Ibrahim Wassouf 20011c6882 Add unit tests for edge text 2023-07-21 20:44:37 -03:00
Ibrahim Wassouf 0cc8f89115 Add edgeText states 2023-07-21 19:40:04 -03:00
Ibrahim Wassouf 8ff06e88ce Correct expected error message in unit test 2023-07-21 18:27:20 -03:00
Ibrahim Wassouf 3fa3ed7b18 Remove grammar and unit test that expects HEX token
This was never really used and had many things wrong with it.
I believe that if a hex was provided in the diagram specification,
the alphanum grammar would break it up into a BRKT and NUM token
and use the first line with the addVertex() function.

Second, the styleLink grammar provides the exact same functionality
with the linkStyle keyword.

Third, updateLink() expects an array of nums, not a hex digit.

Fourth, no documentation is provided on this grammar statement existing.
Fifth, the unit test does not work in version 10.2.4
2023-07-21 18:15:43 -03:00
Ibrahim Wassouf 0a4e5f5f6b Slightly alter unit test node idString 2023-07-21 18:15:27 -03:00
Ibrahim Wassouf 0d7cc748b8 Replace alphanum with idString where appropriate 2023-07-21 17:33:33 -03:00
Ibrahim Wassouf 69c91ae5ed Add unit test for edge case with lean_right/left vertices 2023-07-21 00:06:18 -03:00
Ibrahim Wassouf 7adb1bccb3 Replace alphanum with NODE_STRING for most usecases
What this allows is for idStrings that are separated by
dashes or underscores to be considered one whole string
rather than a bunch of tokens mixed together.

This is necessary for examples such as a-node-graph[text].
Now, the last part of the idString 'graph' will be read as
part of the NODE_STRING token rather than attempting to add
a GRAPH token to the idString.
2023-07-20 23:49:43 -03:00
Ibrahim Wassouf 5b987dee93 Put parser in stable state 2023-07-20 13:05:18 -03:00
Sibin Thomas 114f918417
Merge branch 'develop' into feature/4451-vertical-branches-in-gitgraph 2023-07-20 21:29:56 +05:30
Sibin Thomas 346a7fe8b2 Merge branch 'feature/4451-vertical-branches-in-gitgraph' of https://github.com/mastersibin/mermaid into feature/4451-vertical-branches-in-gitgraph 2023-07-20 21:28:21 +05:30
Sibin Thomas 8ae35c1382 updated documentation for vertical branches 2023-07-20 21:27:34 +05:30
Sidharth Vinod 4795204719
Merge branch 'develop' into sidv/docsVersion
* develop:
  build(docs): handle YAML edgecases in markdown
  run pnpm lint:fix
  Update cypress/helpers/util.ts
  change deprecated `btoa` into `Buffer.from`
  allow ts extension imports in cypress ts files
  build(docs): allow using custom `editLink`
  build(docs): add `editLink: ` to MD frontmatter
  build(docs): run remark plugins on MermaidConfig
  Fix import file extension
  Batch by commit
  resolve lint issues for `no-inferrable-types`
  fix wrong config paramater in some cypress spec
  convert cypress/helpers/util.js into ts
  convert file from js into ts
2023-07-20 20:46:53 +05:30
Sibin Thomas 99e88e4d0d
Merge branch 'develop' into feature/4451-vertical-branches-in-gitgraph 2023-07-20 16:03:19 +05:30
Sidharth Vinod 1b2340ba75
Merge pull request #4640 from aloisklink/docs/fix-edit-url
Fix the "Edit this page on GitHub" link in Vitepress documentation for the Mermaid Config pages
2023-07-20 06:59:46 +00:00
Ibrahim Wassouf 3496f275bc Re-implement markdown as its own text type 2023-07-19 22:56:53 -03:00
Ibrahim Wassouf b46c28425e Add text state and tests 2023-07-19 22:49:39 -03:00
Alois Klink 4d2d790cc8 build(docs): handle YAML edgecases in markdown
Our current method of adding a entry using `+=` is not safe in YAML,
since it's valid to make a YAML object entirely in JSON,
see https://github.com/mermaid-js/mermaid/pull/4640#discussion_r1265133463

We're already using `js-yaml` elsewhere in this file, so we may as well
use it for parsing/stringifying.

Reported-by: Remco Haszing <remcohaszing@gmail.com>
2023-07-19 23:40:46 +01:00
Sibin Thomas cba5b5a7e3 ran preetier 2023-07-19 21:55:24 +05:30
Sibin Thomas d81e4fabd5 positioned tags, tilted commit labels and fixed some bugs 2023-07-19 20:22:29 +05:30
Sibin Thomas 863d1bfd4d removed BT and added TB 2023-07-19 20:21:15 +05:30
Sibin Thomas 9c2afac319
Merge branch 'mermaid-js:develop' into feature/4451-vertical-branches-in-gitgraph 2023-07-19 20:13:53 +05:30
Sidharth Vinod 568d686d2f
Merge branch 'develop' into sidv/docsVersion 2023-07-18 22:07:42 +05:30
Sidharth Vinod 3fcb071592
Move docs.cli to scripts 2023-07-18 22:06:43 +05:30
Sidharth Vinod fff3acd064
Verify release-version on push to release or master 2023-07-18 21:55:44 +05:30
Sidharth Vinod e66135b67e
Merge pull request #4496 from moka-care/bug/4439_graph_doesnt_load_when_img_fail_to_load
Fix graph not loading when the img loads too fast or fail to load
2023-07-18 07:57:38 +00:00
Yokozuna59 072638ce9d
Merge pull request #4634 from leinelissen/develop
feat: allow specifying on which weekday a tickInterval should start
2023-07-18 07:33:08 +00:00
Sidharth Vinod 24f04bb24d
Merge branch 'develop' into bug/4592_fix_newLine_padding_class_diagram 2023-07-17 15:11:39 +05:30
Sidharth Vinod 48a49b1b4d
Merge pull request #4588 from ibrahimWassouf/enhancement/4158_Add_primary_key_beginning_with_asterisk
Allow entity diagram attribute names to start with asterisk
2023-07-17 09:26:46 +00:00
Sidharth Vinod 5e6d42cb5b
Merge pull request #4641 from aloisklink/chore/remove-unused-coveralls-devDependency
chore: remove unused `devDependency` on coveralls
2023-07-17 09:20:02 +00:00
Guilherme Gonzaga 855f6ef9bf docs: Fix checkbox syntax 2023-07-16 23:16:37 +00:00
Alois Klink a0a25ed756 chore: remove unused `devDependency` on coveralls
This `devDependency` hasn't been used for a long time.
2023-07-16 00:21:43 +01:00
Alois Klink af9b3f77cb build(docs): allow using custom `editLink`
In Vitepress, allow using a custom `editLink`, if specified in the YAML
frontmatter.
2023-07-15 23:43:24 +01:00
Alois Klink 57ee181fad build(docs): add `editLink: ` to MD frontmatter
Add a YAML front-matter entry called `editLink` to Markdown files in
Vitepress, e.g.

```markdown
---
editLink: "https://github.com/mermaid-js/mermaid/edit/develop/packages/mermaid/src/schemas/config.schema.yaml"
---

Here is my markdown file!
```

Although Vitepress doesn't officially support adding a URL as a
`editLink:` YAML front-matter, we can add a custom `editLink` function
to our Vitepress config that does allow it.
2023-07-15 23:43:24 +01:00
Yokozuna59 39ccad8e5e
Merge branch 'develop' into develop 2023-07-15 15:44:19 +02:00
Lei Nelissen 7e39c13836
chore: narrow down tstype 2023-07-15 15:38:21 +02:00
Lei Nelissen 85515bcf8d
chore: leave the newLine out of the jison spec 2023-07-15 15:28:48 +02:00
Sibin Thomas 383bbefa9e Added code for Vertical branches for GitGraph and Added TB option in the parser file. 2023-07-15 18:27:42 +05:30
Ibrahim Wassouf 9b9671b57c
Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-15 08:50:01 -04:00
Ibrahim Wassouf d6c88ab589
Merge branch 'develop' into bug/4592_fix_newLine_padding_class_diagram 2023-07-15 08:49:38 -04:00
Sidharth Vinod 840609af63
Merge pull request #4577 from kislerdm/bug/4576-c4-support-for-ContainerQueue_Ext
Fixes support of the macro `ContainerQueue_Ext` for C4 diagrams definition.
2023-07-15 07:35:05 +00:00
Lei Nelissen eff9f7e5db
chore: re-generate config 2023-07-15 00:24:02 +02:00
Lei Nelissen 803cd826ed
chore: replace switch-case with map 2023-07-15 00:17:10 +02:00
Lei Nelissen 90c68f5069
chore: add tsType for weekday config 2023-07-15 00:17:09 +02:00
Lei Nelissen 103321bf72
chore: return after scanning weekday in jison 2023-07-15 00:17:09 +02:00
Lei Nelissen d0afc3bffe feat: validate individual values of weekdays 2023-07-14 14:13:18 +02:00
Lei Nelissen 11f2e31ff1 fix: also set weekday value to sunday in clear 2023-07-14 14:13:18 +02:00
Lei Nelissen d9c15b1e7a chore: move spec test to it.each 2023-07-14 14:13:18 +02:00
Lei Nelissen 4e8eeda30e chore: also apply weekday to topXAxis 2023-07-14 14:13:18 +02:00
Lei Nelissen ebf639377b chore: generate typescript config type 2023-07-14 14:13:18 +02:00
Lei Nelissen 37adc23ae2 chore: also default to sundat in ganttDb 2023-07-14 14:13:18 +02:00
Lei Nelissen 5f7212c769 chore: move default value to config.schema.yaml 2023-07-14 14:13:18 +02:00
Lei Nelissen cd92c46f31 chore: format example more correctly 2023-07-14 14:13:18 +02:00
Lei Nelissen df10ab501a chore: add tests for all days 2023-07-14 14:13:18 +02:00
Lei Nelissen e360e90f88 chore: move documentation to source file 2023-07-14 14:13:18 +02:00
Lei Nelissen 03ce2810b5 feat: allow specifying on which weekday a tickInterval should start 2023-07-14 14:13:18 +02:00
Lei Nelissen 5631a218d1 fix: make gantt chart interval weeks start on monday instead of sunday 2023-07-14 14:13:18 +02:00
Alois Klink 7cb009cd38 build(docs): run remark plugins on MermaidConfig
We use the `unified.stringify()` function on our remark plugins to
stringify the Markdown AST for our MermaidConfig documentation.
However, [`.stringify()`][1] only runs the stringify phase in unified,
not the "run" phase. If we want to run our plugins on the Markdown AST,
we need to also use the [`.run()`][2] function.

[1]: https://github.com/unifiedjs/unified#processorstringifytree-file
[2]: https://github.com/unifiedjs/unified#processorruntree-file-done
2023-07-13 23:59:27 +01:00
Ibrahim Wassouf 081d1b1144 Merge branch 'develop' into bug/4592_fix_newLine_padding_class_diagram 2023-07-13 16:38:47 -03:00
Ibrahim Wassouf e9f032cceb
Update packages/mermaid/src/dagre-wrapper/nodes.js
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-07-13 15:57:58 -03:00
Ibrahim Wassouf aeba7a1d0e
Update packages/mermaid/src/dagre-wrapper/nodes.js
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-07-13 15:57:28 -03:00
Dmitry Kisler 584b51d7c5
Merge branch 'develop' into bug/4576-c4-support-for-ContainerQueue_Ext 2023-07-13 12:07:46 +02:00
Ibrahim Wassouf d47c9d754a Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-11 20:04:20 -03:00
Ibrahim Wassouf d2ab132a18 Change class member height to use own BBox 2023-07-11 19:39:39 -03:00
renovate[bot] d46ef4cc91
chore(deps): update all patch dependencies 2023-07-11 17:19:31 +00:00
Nikolay Rozhkov 3664ff4463 Removed unused code in state diagrams 2023-07-11 18:12:27 +03:00
Pierrick Wauquier 9e5ccbe13f
Merge branch 'develop' into bug/4439_graph_doesnt_load_when_img_fail_to_load 2023-07-11 17:10:19 +02:00
Ibrahim Wassouf e127b146e9 Add more test cases 2023-07-08 17:46:28 -03:00
Ibrahim Wassouf c59fee8de2 Split tests to have one parse statement in each test 2023-07-08 17:20:56 -03:00
Ibrahim Wassouf 00bb2a1f68 Revert back to single quotes for generic grammar 2023-07-08 14:45:06 -03:00
Ibrahim Wassouf 007724a7c7
Merge branch 'develop' into bug/4590_allow_notes_identical_to_keywords 2023-07-08 13:34:28 -04:00
Ibrahim Wassouf f82407a2f0 Make unit test regex unit test more accurate 2023-07-08 14:33:57 -03:00
Ibrahim Wassouf 4bec3188de Reformat code 2023-07-08 14:12:45 -03:00
Ibrahim Wassouf fbb6eb849e Give call higher precedence than STR 2023-07-08 14:07:46 -03:00
Ibrahim Wassouf 6a40f4b955 Decouple HREF token from STR and correct grammar 2023-07-08 13:34:51 -03:00
Ibrahim Wassouf 58b2b0993a Give STR token higher precedence 2023-07-08 13:29:48 -03:00
Ibrahim Wassouf d05d249080 Undo state changes 2023-07-08 13:28:45 -03:00
Ibrahim Wassouf 1e781c0c90 Refactor unit tests 2023-07-08 13:23:46 -03:00
Sidharth Vinod eca2efa46d
Update packages/mermaid/src/rendering-util/splitText.spec.ts
Co-authored-by: Alois Klink <alois@aloisklink.com>
2023-07-08 19:01:45 +05:30
Ibrahim Wassouf 23f27d151a Remove redundancy in unit tests 2023-07-07 22:44:34 -03:00
Ibrahim Wassouf cf0a9c3016
Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-07 14:31:45 -04:00
Sidharth Vinod 88856a721f
Support MERMAID_RELEASE_VERSION in docs 2023-07-07 11:28:04 +05:30
Sidharth Vinod 28406fc9c4
Add comments 2023-07-07 10:05:05 +05:30
Sidharth Vinod d58c41dbc0
Add tests without Intl.Segmenter 2023-07-07 10:02:04 +05:30
Ibrahim Wassouf 5d76c033f0
Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-06 21:18:38 -04:00
Ibrahim Wassouf fad11bce95 Correct one unit test and add another 2023-07-06 22:17:33 -03:00
Alois Klink 8167f8c1df Revert "test(config): add temp test for defaultConfig"
This reverts commit 063cb124cd.

This file was originally added to test whether the new implementation
of the default config in
`packages/mermaid/src/schemas/config.schema.yaml` matched the old
existing default config in `packages/mermaid/src/oldDefaultConfig.ts`,
and this test is no longer needed.
2023-07-07 02:05:43 +01:00
Alois Klink 2b53e02153 test: fix 'new default config' test
This test was accidentally removed by a bad merge commit, see
29291c89 (Merge branch 'develop' into pr/aloisklink/4112, 2023-07-06).

This test checks whether the default config defined in the
`config.schema.yaml` file matches the old default config defined in
`oldDefaultConfig.ts`.

Fixes: 29291c8901
2023-07-07 02:01:03 +01:00
Ibrahim Wassouf 4af2fca339 Add documentation for feature 2023-07-06 19:40:54 -03:00
Sidharth Vinod b14bcda12a
Merge branch 'develop' into sidv/splitUnicode 2023-07-06 22:08:51 +05:30
Sidharth Vinod 7d996c3d33
Cleanup 2023-07-06 21:48:18 +05:30
Sidharth Vinod bcffff3b7b
Terminate build in CI if download fails 2023-07-06 21:36:10 +05:30
Sidharth Vinod d4281d365d
Add Yokozuna59 & nirname 2023-07-06 21:29:40 +05:30
Sidharth Vinod 5ac70bbc00
Fix flowchart failure 2023-07-06 21:22:28 +05:30
Sidharth Vinod 60a93f7377
Handle proper formatting for markdown strings 2023-07-06 20:34:17 +05:30
Sidharth Vinod f5484636aa
createText to TS 2023-07-06 16:12:09 +05:30
Sidharth Vinod b0a104e3da
Merge branch 'develop' into sidv/splitUnicode
* develop: (293 commits)
  chore: Remove lint warnings in example-diagram
  chore: Reduce codecov pushes
  Turn off codecov project status check
  build(docs): fix links to `config.schema.json`
  ci(lint): check if MermaidConfig types are in sync
  docs: add link to mermaid config docs in sidebar
  test(config): add temp test for defaultConfig
  build(types): create types from config JSON Schema
  build(types): add script to generate Config types
  build(docs): build JSON Schema docs
  build: use vite to get default mermaid config
  feat: add Mermaid Config in JSON Schema format
  docs: add support for ```regexp``` code blocks
  test: test partial QuadrantChartConfig options
  test: fix types in `config.spec.ts`
  style: fix lint issues in src/config.spec.ts
  test: rename src/config.spec.js to config.spec.ts
  fix(quadrant): make quadrant options optional
  fix lint
  update homepage community link
  ...
2023-07-06 16:00:11 +05:30
Sidharth Vinod 48050333a0
Merge branch 'develop' into sidv/optimiseDocs 2023-07-06 15:57:01 +05:30
Sidharth Vinod c17dc15c57
chore: Rename to teamMembers 2023-07-06 15:54:27 +05:30
Sidharth Vinod 2b5da79cdf
Merge pull request #4112 from aloisklink/add-jsonschema-schema-for-config
Use JSON Schema to define and document `MermaidConfig`
2023-07-06 10:03:55 +00:00
Sidharth Vinod aaec16ed6c
chore: Remove lint warnings in example-diagram 2023-07-06 11:58:55 +05:30
Sidharth Vinod a3d95ceec4
Bump zenuml package version 2023-07-06 11:36:16 +05:30
Sidharth Vinod d2e62022f1
Avoid downloading avtars everytime on docs:dev 2023-07-06 11:09:09 +05:30
Sidharth Vinod 29291c8901
Merge branch 'develop' into pr/aloisklink/4112
* develop:
  test: test partial QuadrantChartConfig options
  test: fix types in `config.spec.ts`
  style: fix lint issues in src/config.spec.ts
  test: rename src/config.spec.js to config.spec.ts
  fix lint
  update homepage community link
  docs(flowchart): add documentation on multiple nodes style
  Add docker-specific command, leave commonly used command intact
  Support docs:dev in docker
  Fix lint.
  Update docs
  add ChatGPT plugin blog post
  Fix flowchart tooltip typing
2023-07-06 10:42:13 +05:30
Sidharth Vinod 1a4e5d9c5a
Merge pull request #4562 from lishid/patch-3
Fix flowchart tooltip typing bug
2023-07-06 04:19:08 +00:00
Sidharth Vinod e80e281a66
Merge pull request #4600 from tomperr/docs/4558-multiple-vertices-with-style
docs(flowchart): add documentation on multiple nodes style
2023-07-06 04:10:43 +00:00
Nikolay Rozhkov 04597d29c0
Merge pull request #4599 from nirname/fix/support-docs-dev-in-docker
Support docs:dev in docker
2023-07-06 04:04:18 +00:00
Sidharth Vinod 43df84a4d5
Merge branch 'master' into develop
* master:
  fix lint
  update homepage community link
  Update docs
  add ChatGPT plugin blog post
2023-07-06 09:34:26 +05:30
Sidharth Vinod a753b1f18b
Merge branch 'develop' into fix/support-docs-dev-in-docker 2023-07-06 09:29:51 +05:30
Alois Klink c29088af01 build(docs): fix links to `config.schema.json`
Fix the link in some Mermaid Config markdown documentation,
which previously pointed to `src/schemas/config.schema.yaml`,
which went nowhere.

Now, these links point to:
  - config.schema.json (i.e. the generated JSON file, not YAML)
  - links are relative to the markdown documentation

We also needed to store the `schema.json` file in the Vitepress
`public/` folder, as Vitepress otherwise doesn't bundle `.json` files
properly, when running `vitepress build src/vitepress`.
2023-07-06 03:53:40 +01:00
Alois Klink 70a5a13273 docs: add link to mermaid config docs in sidebar 2023-07-06 03:53:40 +01:00
Alois Klink 063cb124cd test(config): add temp test for defaultConfig
Adds a temporary test to ensure that the new defaultConfig,
generated by Vite automatically from the `MermaidConfig` JSON Schema,
has the same values as the old defaultConfig
(taken from
38013de711/packages/mermaid/src/defaultConfig.ts)

The only minor difference seems to be that:
  - `gitGraph` now has a default `useMaxWidth: false` option
    (previously used to be `undefined`),
  - `class` now has a `htmlLabels` value of `false` instead of `undefined`.
2023-07-06 03:53:40 +01:00
Alois Klink eb5d65fabc build(types): create types from config JSON Schema
Runs `pnpm --filter mermaid run types:build-config` to automatically
generate typescript types for `MermaidConfig` from the
JSON Schema file.
2023-07-06 03:53:40 +01:00
Alois Klink 7c3a73d4a8 build(types): add script to generate Config types
Add script `packages/mermaid/scripts/create-types-from-json-schema.mts`
to automatically generate the TypeScript definition for `MermaidConfig`
from the `MermaidConfig` JSON Schema at
`packages/mermaid/src/schemas/config.schema.yaml`.

To do this, we are using this library
[`json-schema-to-typescript`][1], which is also used by Webpack to
generate their types from their JSON Schema.

In order to make sure that this isn't a breaking change, the script
makes all fields **optional**, as that is what the original typescript
file has.

Additionally, I've put in some custom logic into the script, so that
the exact same order is used for the TypeScript file, to make the
`git diff` easier to review. In the future, we can remove this custom
logic, once we no longer need to worry about `git merge` conflicts.

[1]: https://github.com/bcherny/json-schema-to-typescript
2023-07-06 03:53:40 +01:00
Alois Klink 0230722d36 build(docs): build JSON Schema docs
Automatically build documentation for JSON Schema.

This is only built when running with `--vitepress`,
as it currently produces loads of markdown files, which I feel like
we shouldn't be committing.

This currently manually uses some internal `jsonschema2md` functions
so that we can manually control the Markdown output.
2023-07-06 03:53:40 +01:00
Alois Klink 52a1243da5 build: use vite to get default mermaid config
Adds a vitepress JsonSchema plugin that automatically loads
the Mermaid Config JSON Schema from a .schema.yaml file and
gets the default values from it.
2023-07-06 03:53:40 +01:00
Alois Klink 58b43976ff feat: add Mermaid Config in JSON Schema format
Add a JSON Schema file (in YAML) for the MermaidConfig.

This JSON Schema file follows [JSON Schema 2019-09][1], with some slight
modifications to work with:

- [json-schema-to-typescript][2]
  The `tsType` keyword is used to override the generated TypeScript
  type, when it doesn't match the JSON Schema type.

  This is used in two cases:
    - when the current type cannot be represented in JSON Schema
      (e.g. `FontCalculator`, which is a function)
    - when the JSON Schema type is narrower than the TypeScript type.
      Currently, many enums types are listed as `string` in TypeScript,
      but json-schema-to-typescript converts them to `"val1" | "val2"`.
      I've manually set them to `string | "val1" | "val2"` to avoid
      causing a breaking change in the TypeScript types. We should
      remove these in a future major version of TypeScript.
- [@adobe/jsonschema2md][3]
  The `meta:enum` keyword is used to add documentation for specific enum
  values.

[1]: https://json-schema.org/draft/2019-09/release-notes.html
[2]: https://www.npmjs.com/package/json-schema-to-typescript
[3]: https://www.npmjs.com/package/@adobe/jsonschema2md
2023-07-06 03:53:35 +01:00
Alois Klink 4372a54dba docs: add support for ```regexp``` code blocks
Currently, shiki doesn't support code-blocks that use the regexp
language, which means vitepress throws an error on them:

```regexp
^([1-9][0-9]*)(minute|hour|day|week|month)$
```

As a hack until shiki supports them, I've just modified them to get
converted into JavaScript RegEx literal code-blocks, e.g.:

```javascript
/^([1-9][0-9]*)(minute|hour|day|week|month)$/
```
2023-07-06 03:04:08 +01:00
Alois Klink a862565a24 test: test partial QuadrantChartConfig options 2023-07-06 01:35:11 +01:00
Alois Klink 6ceee7f253 test: fix types in `config.spec.ts`
The `foo`, `bar`, and `foobar` options don't exist in MermaidConfig.

Instead, I've replaced them with:
  - `foo` -> `fontFamily`
  - `bar` -> `fontSize`
  - `foobar` -> `altfontFamily`
2023-07-06 01:27:24 +01:00
Alois Klink f731853e01 style: fix lint issues in src/config.spec.ts
It looks like our linter automatically converts `let` to `const` in
TypeScript files, but not in JavaScript files.
2023-07-06 01:20:24 +01:00
Alois Klink 5885f5f82a test: rename src/config.spec.js to config.spec.ts 2023-07-06 01:19:34 +01:00
Alois Klink 38013de711 fix(quadrant): make quadrant options optional
Make the types of the options in QuadrantChartConfig in the
MermaidConfig optional. All of these (except for the values in
`BaseDiagramConfig`) will be automatically set to their
default values, so they're optional from a user perspective.
2023-07-06 01:06:01 +01:00
Steph 9251e520ab fix lint 2023-07-05 13:50:33 -07:00
Steph 5e7e3e21c8 update homepage community link 2023-07-05 13:42:42 -07:00
Tom PERRILLAT-COLLOMB fcb25aee7c docs(flowchart): add documentation on multiple nodes style 2023-07-05 21:09:44 +02:00
Nikolay Rozhkov 95d62367e9 Add docker-specific command, leave commonly used command intact 2023-07-05 19:39:05 +03:00
Ibrahim Wassouf 1d5f3bb64d
Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-05 11:19:08 -04:00
Ibrahim Wassouf bd772e1bf4
Merge branch 'develop' into bug/4590_allow_notes_identical_to_keywords 2023-07-05 11:00:00 -04:00
Nikolay Rozhkov 34b2b5ba35 Support docs:dev in docker 2023-07-05 17:25:07 +03:00
Nikolay Rozhkov c742ac71a4
Merge pull request #4598 from mermaid-js/sidv/fixDocsDev
Fix docs:dev
2023-07-05 14:05:27 +00:00
Sidharth Vinod 382026ed33
Fix docs:dev 2023-07-05 12:20:56 +05:30
Ibrahim Wassouf 34e89098f5 Refactor code smells in unit tests 2023-07-04 21:34:14 -03:00
Ibrahim Wassouf e3c90ac084 Apply formatting to file 2023-07-04 21:16:14 -03:00
Ibrahim Wassouf 099f85f014 Add unit tests with keywords in notes 2023-07-04 21:07:46 -03:00
Ibrahim Wassouf 49747b314d Modify wildcard state of tokens in lexer 2023-07-04 20:44:22 -03:00
Nikolay Rozhkov 9f5f0a6e66 Reduce sankey width 2023-07-05 01:49:58 +03:00
Nikolay Rozhkov 8449a44607 Sankey: Remove duplicated examples 2023-07-05 01:15:22 +03:00
Lishid 12fe6ff26e
Fix lint. 2023-07-03 18:56:00 -07:00
Ibrahim Wassouf 451b6b687e
Merge branch 'develop' into enhancement/4158_Add_primary_key_beginning_with_asterisk 2023-07-03 19:54:26 -04:00
Ibrahim Wassouf 5a94256e4f Allow entity diagram attribute names to start with asterisk 2023-07-03 15:11:02 -03:00
Nikolay Rozhkov d5021cab1d Remove double parsing 2023-07-03 18:57:26 +03:00
Sidharth Vinod 1b190b2892
Merge pull request #4551 from Yokozuna59/refactor-accessibility
refactor accessibility
2023-07-03 15:07:21 +00:00
Sidharth Vinod 6d7cd2b41f
Merge pull request #4580 from aloisklink/refactor/replace-enums
Remove all TypeScript enums and forbid them in ESLint
2023-07-03 07:26:39 +00:00
renovate[bot] d6731a07db
Update all patch dependencies 2023-07-03 05:18:01 +00:00
Alois Klink fbf79ffcc0 refactor: replace TypeScript enum with JS obj
[`const` assertions where added in TypeScript 3.4][1] and can be used
to create enum-like objects in plain JavaScript, that act like
TypeScript enums, but has none of the downsides of TypeScript enums.

[1]: https://devblogs.microsoft.com/typescript/announcing-typescript-3-4/#const-assertions
2023-07-02 23:56:42 +01:00
Alois Klink b989ff5362 fix: change sankey config types to be unions
Replace the TypeScript `enum {a = "a", b = "b"}` types with
TypeScript's literal types (e.g. `"a" | "b"`).

This is because TypeScript enums are
[_not_ a type-level addition to JavaScript][1], and even the official
TypeScript docs say to be careful when using.

[1]: https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#enums
2023-07-02 23:44:19 +01:00
Dmitry Kisler 592e9c959b
fix(diagrams/c4/parser): fixes support of the macro ContainerQueue_Ext for C4 diagrams. 2023-07-02 17:10:06 +02:00
Yokozuna59 406df57f81
Merge branch 'develop' into refactor-accessibility 2023-07-02 10:24:21 +02:00
Sidharth Vinod dfc466514d
Merge branch 'develop' into feature/1838_actor_creation_destruction 2023-07-02 13:36:04 +05:30
Sidharth Vinod 2a1759aab4
Merge branch 'develop' into refactor-accessibility 2023-07-02 13:04:09 +05:30
renovate[bot] b55a9328f4
Update all patch dependencies 2023-07-02 05:07:56 +00:00
Sidharth Vinod 19325777e5
Merge branch 'develop' into feature/1838_actor_creation_destruction 2023-07-02 10:32:59 +05:30
Sidharth Vinod afb979f32b
Merge branch 'develop' into feature/4492_sankey-diagrams 2023-07-02 09:55:45 +05:30
Nikolay Rozhkov abb7bb23d6 More detailed sankey docs 2023-07-02 02:34:22 +03:00
Nikolay Rozhkov 084b765e9f Added tests for colors and fully setup cypress in Docker 2023-07-02 01:10:06 +03:00
Ibrahim Wassouf 4570f824f7 Fix relative link to theme variables list 2023-07-01 15:45:48 -03:00
Nikolay Rozhkov a62719826a Docker+Cypress, better run, removed unused syntax
Added cypress container (from their official image),
may be reconsidered later to choose our own
The only minor problem is node JS version mistmatch
package.json 18.16.0
docker-compose mermaid 18.16.1
docker-compose cypress 18.16.0

Host option in cypress docker container must be removed
in favor of possible configuration option.
http://localhost:9000 are currently hard-coded, that is bad

Updated ./run script with better documentation
and added some styles too it as well

Started sankey.spec.js as an example
2023-07-01 16:17:25 +03:00
Nikolay Rozhkov cd7fce4e4d Merge branch 'develop' into feature/4492_sankey-diagrams 2023-06-30 22:58:56 +03:00
Sidharth Vinod 1645bf0479
Merge branch 'develop' into pr/Valentine14th/4466
* develop:
  Add threshold
  Updated mermaid version to 10.2.4
  update latest news section
2023-07-01 00:29:43 +05:30
Sidharth Vinod 4217bfc15d
Merge branch 'develop' into update-latest-news-section
* develop:
  Add threshold
  Fix Typo
2023-07-01 00:29:06 +05:30
Steph efa3ba6397 add ChatGPT plugin blog post 2023-06-30 11:08:42 -07:00
Knut Sveidqvist 02d4be23cf Merge remote-tracking branch 'origin/develop' into develop 2023-06-30 13:25:32 +02:00
Knut Sveidqvist 04b11d1ba6 Merge branch 'release/10.2.4' 2023-06-30 13:24:43 +02:00
Knut Sveidqvist 453b337e6e Updated mermaid version to 10.2.4 2023-06-30 13:10:22 +02:00
Sidharth Vinod 3fe0c8b13d
Merge branch 'develop' into feature/1838_actor_creation_destruction 2023-06-30 16:00:24 +05:30
Pascal Knecht a1dfc3dac9
Fix Typo 2023-06-30 11:59:40 +02:00
Lishid 0cab66c9d8
Fix flowchart tooltip typing
Tooltip is an object that gets reset to an array. It is then looked up for properties without guard, causing array functions like "length" and "constructor" to run into undefined behvaior.
2023-06-29 15:33:35 -04:00
Nikolay Rozhkov b2f6858ff7 Prettier 2023-06-29 20:23:10 +03:00
Nikolay Rozhkov 06cb0c3be9 Fixed package json 2023-06-29 20:22:06 +03:00
Nikolay Rozhkov 9177350a39 Fixed double quotes, docs, demo and added more examples to run script 2023-06-29 20:16:25 +03:00
Nikolay Rozhkov e24dce10a2 Added sankey documentation 2023-06-29 19:51:46 +03:00
Nikolay Rozhkov e7ad294283 Merge branch 'develop' into feature/4492_sankey-diagrams 2023-06-29 16:50:38 +03:00
Nikolay Rozhkov 95a436595e Let it be as it was in dev branch 2023-06-29 16:44:33 +03:00
Nikolay Rozhkov 8e3f8b1a57 Fixes after review 2023-06-29 15:39:50 +03:00
Nikolay Rozhkov 408c32781e Contributors fetching failure must not hinder docs development 2023-06-29 15:24:14 +03:00
Nikolay Rozhkov a712e61888 Loading avatars in parallel & started sankey documentation 2023-06-29 15:24:14 +03:00
Sidharth Vinod 562910e831
Merge pull request #4532 from tomperr/fix/4519-namespace-lose-members
fix(class): keep members in namespace classes
2023-06-29 11:57:22 +05:30
Sidharth Vinod 47db1a3c9f
Cleanup 2023-06-29 10:36:21 +05:30
Alex Mooney 491f8c1259
Clean up some spacing in examples 2023-06-28 15:14:28 -07:00
Alex Mooney 83bda9febd
Correct the Gantt milestones example 2023-06-28 14:37:08 -07:00
Sidharth Vinod 6aae7450aa
Merge pull request #4557 from nienow/patch-1
Add Standard Notes extension in integrations page
2023-06-28 13:05:22 +05:30
Sidharth Vinod c042c4a5ef
Merge pull request #4553 from tomperr/fix/4550-chaining-style
fix(flowchart): allow multiple vertices with style
2023-06-28 13:02:55 +05:30
Random Bits 777f6d9749
Add Standard Notes extension in integrations page 2023-06-27 21:28:36 -05:00
Yokozuna59 191309a79d run lint:fix 2023-06-28 03:34:28 +03:00
Yokozuna59 38ba45f735 run lint:fix 2023-06-28 01:35:27 +03:00
Yokozuna59 925e76e283
Merge branch 'develop' into resolve-info-html-assignment 2023-06-28 01:29:14 +03:00
Tom PERRILLAT-COLLOMB 9e024fd5f5 allow multiple vertices with style 2023-06-27 20:04:47 +02:00
Yokozuna59 226960ef46
refactor mermaidAPI accessibilities 2023-06-27 20:07:50 +03:00
Yokozuna59 228bafa909 refactor accessibility
- remove @ts-ignore comments
- rename vitest test and describe title
- remove unnecessary types, e.i, `null` and `number`
- clean `addSVGa11yTitleDescription` and `setA11yDiagramInfo` functions
2023-06-27 20:04:41 +03:00
Nikolay Rozhkov 8b111760b1 Updates after review 2023-06-27 17:50:51 +03:00
Sidharth Vinod d9db2edf5a
Merge pull request #4539 from ellenealds/patch-1
Update Tutorials.md
2023-06-27 19:16:31 +05:30
Nikolay Rozhkov e1c9aec775 Merge remote-tracking branch 'nirname/develop' into feature/4492_sankey-diagrams 2023-06-27 16:25:18 +03:00
Nikolay Rozhkov f0231ad9b1 Lint 2023-06-27 16:22:12 +03:00
Nikolay Rozhkov 0bbf0555d3 Fix linters 2023-06-27 16:17:55 +03:00
Nikolay Rozhkov d4d7ce5a4b Fixed majority of ts errors for sankey 2023-06-27 16:12:44 +03:00
Nikolay Rozhkov bbba643288 Rmoved unnecessary imports in tests 2023-06-27 15:30:53 +03:00
Nikolay Rozhkov 830319e3db Removed unnecessary TODO 2023-06-27 15:21:36 +03:00
Nikolay Rozhkov 32c8524317 Put d3-sankey under mermaid package 2023-06-27 15:15:34 +03:00
Nikolay Rozhkov 616c5e6914 Move UID to separate file, refine run sh 2023-06-27 15:05:25 +03:00
Sidharth Vinod f27015fcf8
Merge pull request #4547 from mermaid-js/renovate/major-workbox-monorepo
chore(deps): update dependency workbox-window to v7
2023-06-27 17:23:44 +05:30
Sidharth Vinod d2ff3a63e8
Merge pull request #4524 from mcbeelen/docs/label-color-timelines
docs: Howto on foreground color on timelines
2023-06-27 17:23:24 +05:30
Nikolay Rozhkov 605e8d4a92 Sankey refactoring 2023-06-27 14:11:06 +03:00
Marco Beelen e2f21a2d98
Lint fix 2023-06-27 13:03:31 +02:00
Marco Beelen f606ad2d9d
docs: Howto on foreground color on timelines 2023-06-27 11:23:54 +02:00
renovate[bot] 1730a229a5
chore(deps): update dependency workbox-window to v7 2023-06-27 09:21:55 +00:00
renovate[bot] f48652322d
chore(deps): update dependency jsdom to v22 2023-06-27 07:13:43 +00:00
Sidharth Vinod 2bec82707f
Merge pull request #4528 from Yokozuna59/bug/4527_fix-optional-style-issue
fix not rendered style when style is optional
2023-06-27 11:30:15 +05:30
Yokozuna59 760548335c
Merge branch 'develop' into standardized-pie-definitions 2023-06-27 01:45:35 +03:00
Tom PERRILLAT-COLLOMB 5a96bd1b9f fix(flowchart): apply style on doublecircle 2023-06-27 00:22:59 +02:00
Yokozuna59 64a28be5e3 rename `getDiagramStyles` type into `DiagramStylesProvider` 2023-06-26 20:34:21 +03:00
Yokozuna59 8b67200717 change `options` paramter to any instead of `unknown` 2023-06-26 19:31:53 +03:00
Yokozuna59 3106ddbd1e add `getDiagramStyles` type and use it in `style.ts` 2023-06-26 19:28:22 +03:00
Yokozuna59 f020f4a292
remove `diagramTheme` arrow function return
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
2023-06-26 19:12:04 +03:00
Yokozuna59 0a6fc1b582
Merge branch 'mermaid-js:develop' into resolve-info-html-assignment 2023-06-26 19:06:19 +03:00
Yokozuna59 c439424511
Merge branch 'mermaid-js:develop' into bug/4527_fix-optional-style-issue 2023-06-26 19:06:08 +03:00
Sidharth Vinod 2fe5750be1
Merge pull request #4531 from Yokozuna59/fix-cspell-issue-in-md-files
fix cspell issues in *.md files
2023-06-26 21:32:44 +05:30
Nikolay Rozhkov b0825ebb35 Import at the top 2023-06-26 18:37:41 +03:00
Yokozuna59 20eb28e1a4 fix cspell issues in *.md files 2023-06-26 18:21:09 +03:00
Yokozuna59 f2c40271b2 change `diagramTheme` and `themes` to return `string` 2023-06-26 18:06:48 +03:00
renovate[bot] f90a7dc784 fix(deps): update all patch dependencies 2023-06-26 03:12:45 +00:00
Nikolay Rozhkov a38733346f Removed unnecessary configs and extra code 2023-06-25 21:56:14 +03:00
Tom PERRILLAT-COLLOMB 61e5dbeaa6 fix(class): keep members in namespace classes 2023-06-25 00:15:35 +02:00
Nikolay Rozhkov 6a893a758b Styles are optional 2023-06-25 01:07:11 +03:00
Nikolay Rozhkov 1d6074dbfa Sankey: Use [] instead of Array 2023-06-25 00:42:12 +03:00
Nikolay Rozhkov b23e86aea3 Added options for coloring 2023-06-25 00:22:36 +03:00
Nikolay Rozhkov 1674f12b62 Renamed sankey to sankey-beta 2023-06-24 23:11:54 +03:00
Yokozuna59 07f6358a80
fix not rendered style when style is optional 2023-06-24 22:18:00 +03:00
Nikolay Rozhkov 2f281ba228 Improvements for sankey diagram after review 2023-06-24 22:02:18 +03:00
Yokozuna59 30a66533bc use backtick for cleaner variable string and the DOM document for default values 2023-06-23 23:26:45 +03:00