mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-18 07:49:26 +02:00
Compare commits
606 Commits
layout-v3
...
sidv/webpa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
166dca4924 | ||
![]() |
75d276e19e | ||
![]() |
2243af1871 | ||
![]() |
41dbf0fa96 | ||
![]() |
1a5e7315c0 | ||
![]() |
da6bb9498a | ||
![]() |
1e417833f4 | ||
![]() |
97a7f1fd71 | ||
![]() |
c86d46eb8a | ||
![]() |
361dd6a96e | ||
![]() |
17adec38af | ||
![]() |
638b9d9aae | ||
![]() |
c8f6994895 | ||
![]() |
1117a80500 | ||
![]() |
5d83ec6fa2 | ||
![]() |
bab5937426 | ||
![]() |
099a26977a | ||
![]() |
0b834485a8 | ||
![]() |
41f21d4f72 | ||
![]() |
312e5f3d96 | ||
![]() |
6ef3e7f536 | ||
![]() |
4f5228aec4 | ||
![]() |
b9daa35558 | ||
![]() |
21304a9677 | ||
![]() |
3f6613ea9f | ||
![]() |
c8635c0b9b | ||
![]() |
e78ac9b92a | ||
![]() |
7a47fcfcbc | ||
![]() |
d4c19ffa59 | ||
![]() |
120940f9f4 | ||
![]() |
48b1f489fc | ||
![]() |
e62dd255bc | ||
![]() |
13110c4ed9 | ||
![]() |
327fcbf902 | ||
![]() |
81924f72c8 | ||
![]() |
5d048ce21e | ||
![]() |
1a0309fb87 | ||
![]() |
e793aae0ec | ||
![]() |
3a2669e634 | ||
![]() |
895a5eb78a | ||
![]() |
4601c90904 | ||
![]() |
8ad8d39fe4 | ||
![]() |
56a8068a7f | ||
![]() |
d17aa6ecdd | ||
![]() |
6f27363862 | ||
![]() |
5192608f7c | ||
![]() |
77f5e0d5f3 | ||
![]() |
4c311ea4b1 | ||
![]() |
bbb3712284 | ||
![]() |
1388e201e5 | ||
![]() |
125312c114 | ||
![]() |
ea314cd24a | ||
![]() |
8230c8f8b4 | ||
![]() |
d115fbc6da | ||
![]() |
2ae8bf2987 | ||
![]() |
e86d7894f5 | ||
![]() |
752a6b2cb0 | ||
![]() |
97a842e651 | ||
![]() |
c83e29c6e3 | ||
![]() |
a4af3704ba | ||
![]() |
775fb80c43 | ||
![]() |
aec1d80966 | ||
![]() |
58a53c0fa8 | ||
![]() |
b486177ca7 | ||
![]() |
957e64fe8a | ||
![]() |
7881d1e457 | ||
![]() |
16be835c9b | ||
![]() |
59cf085af5 | ||
![]() |
fc8db95597 | ||
![]() |
cc10e62ebd | ||
![]() |
bed95c77a9 | ||
![]() |
d348f2847c | ||
![]() |
4d46ea9801 | ||
![]() |
eec97d10af | ||
![]() |
ebef4a1416 | ||
![]() |
24605784f2 | ||
![]() |
3240f8ae56 | ||
![]() |
50f44c5cb0 | ||
![]() |
cc2f4f779a | ||
![]() |
00ce0fc034 | ||
![]() |
551b37f969 | ||
![]() |
bc5ef5fb7d | ||
![]() |
c20b8a0664 | ||
![]() |
9660b0e9fb | ||
![]() |
23e590e09b | ||
![]() |
60e4585e20 | ||
![]() |
ba436cc37a | ||
![]() |
960ea450e9 | ||
![]() |
8ffa7e6334 | ||
![]() |
2fb1876023 | ||
![]() |
f5692e742b | ||
![]() |
d7e7498fea | ||
![]() |
8ea1a1a077 | ||
![]() |
7cd281eea8 | ||
![]() |
1570eb7b73 | ||
![]() |
5060c9f390 | ||
![]() |
1fea43e125 | ||
![]() |
ef47cc5b6f | ||
![]() |
e876c35ef9 | ||
![]() |
800cb65706 | ||
![]() |
25ff005dd7 | ||
![]() |
72c266b242 | ||
![]() |
828f69f011 | ||
![]() |
ad4b079d63 | ||
![]() |
5d4d7c5fbf | ||
![]() |
238b15df9d | ||
![]() |
6e2deb1fa7 | ||
![]() |
1255c0064b | ||
![]() |
d2300d375b | ||
![]() |
235797a97c | ||
![]() |
508fbccdb4 | ||
![]() |
ad0cb7ff3c | ||
![]() |
bc258793ac | ||
![]() |
10d2e0a62f | ||
![]() |
738abc8946 | ||
![]() |
de5ad8644e | ||
![]() |
97b39bca95 | ||
![]() |
3698b30809 | ||
![]() |
069437842b | ||
![]() |
ee13c7666d | ||
![]() |
a23a7edd26 | ||
![]() |
e21da2ec7f | ||
![]() |
2b40bc0a48 | ||
![]() |
7e1006db26 | ||
![]() |
44f463c4f4 | ||
![]() |
6029bdeee9 | ||
![]() |
0261e7464a | ||
![]() |
a22158b2e2 | ||
![]() |
8a3bd5bcb8 | ||
![]() |
514d12d48c | ||
![]() |
01fac85cde | ||
![]() |
18283bc48f | ||
![]() |
f31db315b8 | ||
![]() |
8a2aea219e | ||
![]() |
034fe80411 | ||
![]() |
6d9b695ada | ||
![]() |
9c1da3bca1 | ||
![]() |
0e61395aa9 | ||
![]() |
8215c7d98e | ||
![]() |
ee45ab2e6c | ||
![]() |
b1f3e21d28 | ||
![]() |
a4b0e6b87b | ||
![]() |
9fe7152d98 | ||
![]() |
0859f28a14 | ||
![]() |
56b9aab5ce | ||
![]() |
aacc40e525 | ||
![]() |
b0ed5e9be2 | ||
![]() |
3777ccb305 | ||
![]() |
6b736f0bb0 | ||
![]() |
2e72c0bf6e | ||
![]() |
a1757ba217 | ||
![]() |
5390c409d0 | ||
![]() |
4f91c9a8de | ||
![]() |
8cf4efc190 | ||
![]() |
405df09e43 | ||
![]() |
86adf96021 | ||
![]() |
a0c3de568b | ||
![]() |
c10eb5af79 | ||
![]() |
3c4acd2184 | ||
![]() |
ab1573053e | ||
![]() |
c404f6fe34 | ||
![]() |
d24256e1c2 | ||
![]() |
e494e2dc56 | ||
![]() |
ab2e727db9 | ||
![]() |
b9fcb66d28 | ||
![]() |
12e4819c49 | ||
![]() |
0b54366705 | ||
![]() |
c99fd2baa9 | ||
![]() |
646f76d343 | ||
![]() |
868cb529aa | ||
![]() |
2d01548d02 | ||
![]() |
047e15951a | ||
![]() |
6fb92f6f3c | ||
![]() |
f4a5b80eff | ||
![]() |
802407c8ae | ||
![]() |
74c7a8585d | ||
![]() |
439274c5ae | ||
![]() |
8c1046169f | ||
![]() |
2389f4a285 | ||
![]() |
24fb2337d7 | ||
![]() |
cc55a82b64 | ||
![]() |
931120f73c | ||
![]() |
1f8fb56409 | ||
![]() |
5865c890b5 | ||
![]() |
1fb671c561 | ||
![]() |
acd9a8aefb | ||
![]() |
66bc844cc9 | ||
![]() |
3e3de72093 | ||
![]() |
00053b8e97 | ||
![]() |
883d0d5039 | ||
![]() |
e49825b7a3 | ||
![]() |
9f286b46ff | ||
![]() |
803ea863fd | ||
![]() |
1615c6d9f9 | ||
![]() |
d59f878020 | ||
![]() |
646a96e5f0 | ||
![]() |
77a1aea7b9 | ||
![]() |
f3f4672816 | ||
![]() |
b68a38443c | ||
![]() |
c919bef70e | ||
![]() |
b1540d1491 | ||
![]() |
8ff40c152b | ||
![]() |
51803f00fb | ||
![]() |
fb4aefeae7 | ||
![]() |
7d987e5877 | ||
![]() |
816b6276a6 | ||
![]() |
836a026f63 | ||
![]() |
dc9ddc77ea | ||
![]() |
fdbd38ed5f | ||
![]() |
1f39fde230 | ||
![]() |
c420224080 | ||
![]() |
b1f13cbb9a | ||
![]() |
0f2e0c2ab4 | ||
![]() |
d8af97c152 | ||
![]() |
43f3784c83 | ||
![]() |
528ebd8f12 | ||
![]() |
c05c98c082 | ||
![]() |
d8c7557ae5 | ||
![]() |
f9753fc621 | ||
![]() |
42b59a9e35 | ||
![]() |
74bd576ebc | ||
![]() |
a017ffc3c9 | ||
![]() |
d3a81f025a | ||
![]() |
750f647b0d | ||
![]() |
2a9e56439e | ||
![]() |
e4bca33d00 | ||
![]() |
1528c03f85 | ||
![]() |
c73c68532a | ||
![]() |
989c8969cb | ||
![]() |
ff2ff22d27 | ||
![]() |
5ef7bad1ce | ||
![]() |
5e0c321510 | ||
![]() |
f19fac97d1 | ||
![]() |
d04f73af7e | ||
![]() |
6ef3915fcc | ||
![]() |
87257153b9 | ||
![]() |
02207087e4 | ||
![]() |
b4417d47f1 | ||
![]() |
04e3674355 | ||
![]() |
dbf8af06a4 | ||
![]() |
0bcdaa395f | ||
![]() |
7788d26ed4 | ||
![]() |
b3002be08a | ||
![]() |
813ceb0d96 | ||
![]() |
c39c3be39f | ||
![]() |
9eb17c6e13 | ||
![]() |
a6e26ce5bb | ||
![]() |
b735a7911a | ||
![]() |
2e342dace2 | ||
![]() |
14369d3143 | ||
![]() |
b6b5202923 | ||
![]() |
808152211c | ||
![]() |
408e852018 | ||
![]() |
ef91b4fa0e | ||
![]() |
46d924ffc9 | ||
![]() |
f965f5643a | ||
![]() |
85f0f7d241 | ||
![]() |
9468bffcbb | ||
![]() |
bd44957302 | ||
![]() |
7e3d57fc28 | ||
![]() |
4f5c707b56 | ||
![]() |
2a37023a8d | ||
![]() |
9901a73a2a | ||
![]() |
40a319fc5b | ||
![]() |
8ee321fd7b | ||
![]() |
05a594a492 | ||
![]() |
0a2804c641 | ||
![]() |
5079fa93b4 | ||
![]() |
eaf75fa149 | ||
![]() |
a6093e847e | ||
![]() |
0a6c7781c4 | ||
![]() |
0871f5c012 | ||
![]() |
6f27c36186 | ||
![]() |
383cbcf3a0 | ||
![]() |
56add0756f | ||
![]() |
02a0f87562 | ||
![]() |
feb1d34c1a | ||
![]() |
fdb81be0a0 | ||
![]() |
a4d1d86d7b | ||
![]() |
ffe956e27b | ||
![]() |
03190c1dec | ||
![]() |
92f1f2ffb6 | ||
![]() |
4d8d74a50d | ||
![]() |
0dc0de8f1d | ||
![]() |
f5dc4d991f | ||
![]() |
1f3a02559c | ||
![]() |
70f94c3e44 | ||
![]() |
b8eab08119 | ||
![]() |
794b714fac | ||
![]() |
2f4b4ba13b | ||
![]() |
1cdb0ff72c | ||
![]() |
9513e0e2d5 | ||
![]() |
6ebfbb2f9e | ||
![]() |
320e105ffe | ||
![]() |
96cde8a15a | ||
![]() |
972d025578 | ||
![]() |
09bc7e0acd | ||
![]() |
6191bb5f1b | ||
![]() |
d858cd677e | ||
![]() |
2376d38e0e | ||
![]() |
693616b00d | ||
![]() |
30f6550e61 | ||
![]() |
5cfbc9102e | ||
![]() |
766bdde46b | ||
![]() |
f46f8752ca | ||
![]() |
bed9b1bb99 | ||
![]() |
053a20bd33 | ||
![]() |
be34e6145f | ||
![]() |
f60c7fff65 | ||
![]() |
6292bebcd3 | ||
![]() |
80c68d847c | ||
![]() |
fed00be430 | ||
![]() |
ef527cb0fa | ||
![]() |
e1c63139b2 | ||
![]() |
edb30c9feb | ||
![]() |
66809ed972 | ||
![]() |
c66d5cb890 | ||
![]() |
fe8df78322 | ||
![]() |
7da6c0e867 | ||
![]() |
0a0b6d51ba | ||
![]() |
7ed3c21a6d | ||
![]() |
3d0214d453 | ||
![]() |
d0e9de2744 | ||
![]() |
99264fab8a | ||
![]() |
d4519bb730 | ||
![]() |
6468c8e857 | ||
![]() |
982c1b4979 | ||
![]() |
503cbedc96 | ||
![]() |
a448409750 | ||
![]() |
a928120bec | ||
![]() |
b3ca701b8d | ||
![]() |
62e127f1b8 | ||
![]() |
ebdec77c88 | ||
![]() |
98ddc95648 | ||
![]() |
9566f51ca8 | ||
![]() |
696164c9a6 | ||
![]() |
493aac6885 | ||
![]() |
56e1411d37 | ||
![]() |
e0805b8272 | ||
![]() |
e72059ba87 | ||
![]() |
24d46fb936 | ||
![]() |
29c52ec4d4 | ||
![]() |
77831c424c | ||
![]() |
d633ec62df | ||
![]() |
69c13a6ecf | ||
![]() |
69d05c454d | ||
![]() |
97637da9e0 | ||
![]() |
535f555b13 | ||
![]() |
d8ee2bb850 | ||
![]() |
609d28c6ee | ||
![]() |
eeafa8f5aa | ||
![]() |
ddc35fa9ce | ||
![]() |
908f5afe0f | ||
![]() |
5daa130857 | ||
![]() |
c202b94a9a | ||
![]() |
ed0f22b037 | ||
![]() |
eb1c6894f5 | ||
![]() |
91091c614f | ||
![]() |
481b5cde0f | ||
![]() |
d328879329 | ||
![]() |
3c1bad1792 | ||
![]() |
5e4bcbdfa0 | ||
![]() |
87911f4a56 | ||
![]() |
9ec935f109 | ||
![]() |
4bedc49b4d | ||
![]() |
af2b1945a3 | ||
![]() |
c32e76a870 | ||
![]() |
8dcbe83b0b | ||
![]() |
9fac7866f5 | ||
![]() |
53bbf444e5 | ||
![]() |
1a46582e1e | ||
![]() |
913468a7b5 | ||
![]() |
1e71798467 | ||
![]() |
8c63d002e7 | ||
![]() |
67b1e8dbe9 | ||
![]() |
bc0be28f08 | ||
![]() |
eaa1602b1a | ||
![]() |
2a86ced835 | ||
![]() |
ad49564ab5 | ||
![]() |
e8cef4aa81 | ||
![]() |
56954067ab | ||
![]() |
338ba704ba | ||
![]() |
bf25be7cf0 | ||
![]() |
404b718677 | ||
![]() |
8a489176c3 | ||
![]() |
f40f2a0b44 | ||
![]() |
d9406585c8 | ||
![]() |
9e35bf6e6f | ||
![]() |
0d0de49231 | ||
![]() |
dc53b2fde3 | ||
![]() |
98d214fd60 | ||
![]() |
adadc9ee26 | ||
![]() |
777f888892 | ||
![]() |
84dfc8ee4b | ||
![]() |
6f86047a8e | ||
![]() |
2d7a289105 | ||
![]() |
353b62aa0a | ||
![]() |
826cd67cc8 | ||
![]() |
9cb7054ff9 | ||
![]() |
6309300eb6 | ||
![]() |
0dce8f4104 | ||
![]() |
1c4eeb2d53 | ||
![]() |
d6245fdbda | ||
![]() |
aeb31fe1ae | ||
![]() |
0e0a6c0f69 | ||
![]() |
cccbb6939c | ||
![]() |
db31f61368 | ||
![]() |
a96c5ed83a | ||
![]() |
ffbae081ff | ||
![]() |
395cc29701 | ||
![]() |
c93c7c75c9 | ||
![]() |
9b0d4a28ea | ||
![]() |
8dd82839cb | ||
![]() |
24ef5f9fe4 | ||
![]() |
d08882d043 | ||
![]() |
eea31a1046 | ||
![]() |
5d085fd3f6 | ||
![]() |
30e2b08028 | ||
![]() |
533da47516 | ||
![]() |
146c2e2dd9 | ||
![]() |
065756a90d | ||
![]() |
6819fc05da | ||
![]() |
bc14d56568 | ||
![]() |
01ca1cc8c7 | ||
![]() |
f69ead5e08 | ||
![]() |
f29974628b | ||
![]() |
ad2d098b52 | ||
![]() |
247061919b | ||
![]() |
0c308134a9 | ||
![]() |
3982d19e57 | ||
![]() |
55d706323d | ||
![]() |
51df0a68cc | ||
![]() |
ca053e0a11 | ||
![]() |
c260f7c20b | ||
![]() |
9f0137a34d | ||
![]() |
7bd7bcf4b8 | ||
![]() |
36ad4a847e | ||
![]() |
5791fc9a4d | ||
![]() |
d7093c4891 | ||
![]() |
506e427d56 | ||
![]() |
59f8f5f65e | ||
![]() |
3b30232e88 | ||
![]() |
e0aae3e31f | ||
![]() |
c21c026749 | ||
![]() |
b9cb7e9898 | ||
![]() |
1ea546a0a5 | ||
![]() |
ffdf268ba2 | ||
![]() |
f34008b71a | ||
![]() |
8f009ed815 | ||
![]() |
71d252f706 | ||
![]() |
135f2cc2fd | ||
![]() |
b83f18327a | ||
![]() |
d5fc319d4e | ||
![]() |
c343e4a1e3 | ||
![]() |
b72dad9c5b | ||
![]() |
2ada935842 | ||
![]() |
dab43da202 | ||
![]() |
0a944a5de1 | ||
![]() |
bb824f1147 | ||
![]() |
817a89df70 | ||
![]() |
827b3d47b7 | ||
![]() |
00c1732b9b | ||
![]() |
a266a9c539 | ||
![]() |
48d94568ce | ||
![]() |
95d92999bb | ||
![]() |
51a94e6904 | ||
![]() |
43954b9500 | ||
![]() |
636ff1c868 | ||
![]() |
7bf877d820 | ||
![]() |
8e3f9868eb | ||
![]() |
e83c79a169 | ||
![]() |
a6b83c9742 | ||
![]() |
7635db4c1e | ||
![]() |
183fc35fea | ||
![]() |
9cbacb0159 | ||
![]() |
f37ac53118 | ||
![]() |
4e4b5ccf8d | ||
![]() |
4f96116c43 | ||
![]() |
aba458b832 | ||
![]() |
c39a6f27d4 | ||
![]() |
ae920eaa93 | ||
![]() |
5c8fda3891 | ||
![]() |
e1f399a06a | ||
![]() |
a481968ec1 | ||
![]() |
c7ec44da09 | ||
![]() |
22dbe49945 | ||
![]() |
25ed9063f2 | ||
![]() |
e8eb2ab03f | ||
![]() |
48fb5b3f28 | ||
![]() |
27e40248ff | ||
![]() |
98506d888c | ||
![]() |
be7ab54a09 | ||
![]() |
5a2ca03fff | ||
![]() |
37eb0454fd | ||
![]() |
bb413d555e | ||
![]() |
2579bf1ad9 | ||
![]() |
0605bce887 | ||
![]() |
6452ccc220 | ||
![]() |
2693c9b024 | ||
![]() |
38d9795191 | ||
![]() |
9c88c785cb | ||
![]() |
2f41013740 | ||
![]() |
2d9f25b163 | ||
![]() |
4c5d813e58 | ||
![]() |
10d9b88965 | ||
![]() |
207235ea83 | ||
![]() |
97ab62514c | ||
![]() |
790922b938 | ||
![]() |
08af10d439 | ||
![]() |
73d02b2582 | ||
![]() |
5c2a45cd4d | ||
![]() |
064c3134e5 | ||
![]() |
6340c157e8 | ||
![]() |
e9239f83e9 | ||
![]() |
59c69600e8 | ||
![]() |
0ec7e006ec | ||
![]() |
811f838a2d | ||
![]() |
9acdc0bc2e | ||
![]() |
ac788a7e7d | ||
![]() |
b4af820ed1 | ||
![]() |
ac629c91d6 | ||
![]() |
bb413e0022 | ||
![]() |
a7fa40ecda | ||
![]() |
d83c9f5a70 | ||
![]() |
539ee49594 | ||
![]() |
3dff5a90f1 | ||
![]() |
20d22a6468 | ||
![]() |
c5033b92b4 | ||
![]() |
625ec813b9 | ||
![]() |
595f7680e9 | ||
![]() |
6e7037bafd | ||
![]() |
a25c9a30d0 | ||
![]() |
05b8a6e77f | ||
![]() |
f05c790248 | ||
![]() |
c5d859e52e | ||
![]() |
0c0468123f | ||
![]() |
50da58afe0 | ||
![]() |
8c4808a681 | ||
![]() |
d60ce53e05 | ||
![]() |
4fc4d71350 | ||
![]() |
b5dcb4f345 | ||
![]() |
a7f0b2ba21 | ||
![]() |
c5bba0b153 | ||
![]() |
94868e48cb | ||
![]() |
e7ac2368c3 | ||
![]() |
bbaf2c2f20 | ||
![]() |
ecd175dd38 | ||
![]() |
5434cfc89d | ||
![]() |
a87abc00c6 | ||
![]() |
d8735060dc | ||
![]() |
681f4bb803 | ||
![]() |
e740325d84 | ||
![]() |
a3bda3c559 | ||
![]() |
3f76eb0ac2 | ||
![]() |
0e504f30b9 | ||
![]() |
5554725f63 | ||
![]() |
37aaca0090 | ||
![]() |
48a899f7a9 | ||
![]() |
5148acb20f | ||
![]() |
c8d3c3ac4f | ||
![]() |
1029ce4527 | ||
![]() |
0f56c9a85d | ||
![]() |
ffcb73ad5f | ||
![]() |
d2e7b1e56f | ||
![]() |
b1770d3d06 | ||
![]() |
8e2287a86d | ||
![]() |
5aae45dc97 | ||
![]() |
1c6328cc1b | ||
![]() |
8a476f882d | ||
![]() |
056d5200c6 | ||
![]() |
86cbf85358 | ||
![]() |
407927c8ec | ||
![]() |
5905787bea | ||
![]() |
a61d95a005 | ||
![]() |
18201d326c | ||
![]() |
c7ba253e7c | ||
![]() |
f27dff2186 | ||
![]() |
0ee0862fae | ||
![]() |
d2df7173e3 | ||
![]() |
a61c17c1a9 | ||
![]() |
853b676d48 | ||
![]() |
51dbdb933c | ||
![]() |
766e111ac1 | ||
![]() |
004ea9872b | ||
![]() |
bf4607cf08 | ||
![]() |
3a179170bb | ||
![]() |
a0fa8df0f1 | ||
![]() |
f9bf53551f | ||
![]() |
e5212c25f5 | ||
![]() |
5584fef1b0 | ||
![]() |
98f37d64ea | ||
![]() |
99923fcd0f | ||
![]() |
e06a7587ac | ||
![]() |
04f18630f3 | ||
![]() |
f1fa91a51c | ||
![]() |
53fe35e37e | ||
![]() |
6be05e9948 | ||
![]() |
84bf79f72b | ||
![]() |
904eccc4fa | ||
![]() |
01562528b7 | ||
![]() |
fe3bb0b6c0 | ||
![]() |
7aeb60f42a | ||
![]() |
d67e2723c6 | ||
![]() |
1206ec43ac | ||
![]() |
965df4fdf4 | ||
![]() |
4f0e18b088 |
@@ -3,3 +3,4 @@ dist/**
|
|||||||
docs/Setup.md
|
docs/Setup.md
|
||||||
cypress.config.js
|
cypress.config.js
|
||||||
cypress/plugins/index.js
|
cypress/plugins/index.js
|
||||||
|
coverage
|
@@ -52,16 +52,24 @@
|
|||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": "./**/*.html",
|
"files": ["cypress/**", "demos/**"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-undef": "off",
|
"no-console": "off"
|
||||||
"jsdoc/require-jsdoc": "off"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["./cypress/**", "./demos/**"],
|
"files": ["*.spec.{ts,js}", "cypress/**", "demos/**", "**/docs/**"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-console": "off"
|
"jsdoc/require-jsdoc": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.html", "*.md", "**/*.md/*"],
|
||||||
|
"rules": {
|
||||||
|
"no-var": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,43 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: 'Status: Triage, Type: Bug / Error'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Code Sample**
|
|
||||||
If applicable, add the code sample or a link to the [live editor](https://mermaid.live).
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
69
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
69
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: Create a report to help us improve
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Bug / Error'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Security vulnerabilities
|
||||||
|
Please refer our [Security Policy](https://github.com/mermaid-js/.github/blob/main/SECURITY.md) and report to keep vulnerabilities confidential so we can release fixes first.
|
||||||
|
|
||||||
|
## Before you submit...
|
||||||
|
We like to help you, but in order to do that should you make a few things first:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Give a clear and concise description of what the bug is.
|
||||||
|
placeholder: When I do ... does ... happen.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Give a step-by-step example on how to reproduce the bug.
|
||||||
|
placeholder: |-
|
||||||
|
1. Do this
|
||||||
|
2. Do that
|
||||||
|
3. ...
|
||||||
|
4. Bug!
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to help explain your issue.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Code Sample
|
||||||
|
description: |-
|
||||||
|
If applicable, add the code sample or a link to the [Live Editor](https://mermaid.live).
|
||||||
|
Any text pasted here will be rendered as a Code block.
|
||||||
|
render: text
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Setup
|
||||||
|
description: |-
|
||||||
|
Please fill out the below info.
|
||||||
|
Note that you only need to fill out one and not both sections.
|
||||||
|
value: |-
|
||||||
|
**Desktop**
|
||||||
|
|
||||||
|
- OS and Version: [Windows, Linux, Mac, ...]
|
||||||
|
- Browser and Version: [Chrome, Edge, Firefox]
|
||||||
|
|
||||||
|
**Smartphone**
|
||||||
|
|
||||||
|
- Device: [Samsung, iPhone, ...]
|
||||||
|
- OS and Version: [Android, iOS, ...]
|
||||||
|
- Browser and Version: [Chrome, Safari, ...]
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional Context
|
||||||
|
description: Anything else to add?
|
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
17
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: GitHub Discussions
|
||||||
|
url: https://github.com/mermaid-js/mermaid/discussions
|
||||||
|
about: Ask the Community questions or share your own graphs in our discussions.
|
||||||
|
- name: Security Vulnerability
|
||||||
|
url: https://github.com/mermaid-js/.github/blob/main/SECURITY.md
|
||||||
|
about: Report security issues confidentially.
|
||||||
|
- name: Slack
|
||||||
|
url: https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE
|
||||||
|
about: Join our Community on Slack for Help and a casual chat.
|
||||||
|
- name: Documentation
|
||||||
|
url: https://mermaid-js.github.io
|
||||||
|
about: Read our documentation for all that Mermaid.js can offer.
|
||||||
|
- name: Live Editor
|
||||||
|
url: https://mermaid.live
|
||||||
|
about: Try the live editor to preview graphs in no time.
|
42
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/diagram_proposal.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Diagram Proposal
|
||||||
|
description: Suggest a new Diagram Type to add to Mermaid.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Diagram to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Use Cases
|
||||||
|
description: If applicable, give some use cases for where this diagram would be useful.
|
||||||
|
placeholder: The Diagram could be used for ...
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Code Sample
|
||||||
|
description: |-
|
||||||
|
If applicable, add a code sample for how to implement this new diagram.
|
||||||
|
The text will automatically be rendered as JavaScript code.
|
||||||
|
render: javascript
|
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: 'Status: Triage, Type: Enhancement'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
16
.github/ISSUE_TEMPLATE/question.md
vendored
16
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
name: Question
|
|
||||||
about: Get some help from the community.
|
|
||||||
title: ''
|
|
||||||
labels: 'Help wanted!, Type: Other'
|
|
||||||
assignees: ''
|
|
||||||
---
|
|
||||||
|
|
||||||
## Help us help you!
|
|
||||||
|
|
||||||
You want an answer. Here are some ways to get it quicker:
|
|
||||||
|
|
||||||
- Use a clear and concise title.
|
|
||||||
- Try to pose a clear and concise question.
|
|
||||||
- Include as much, or as little, code as necessary.
|
|
||||||
- Don't be shy to give us some screenshots, if it helps!
|
|
34
.github/ISSUE_TEMPLATE/syntax_proposal.yml
vendored
Normal file
34
.github/ISSUE_TEMPLATE/syntax_proposal.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Syntax Proposal
|
||||||
|
description: Suggest a new Syntax to add to Mermaid.js.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Syntax to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible. Examples are always welcome.
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what Syntax should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Example
|
||||||
|
description: If applicable, provide an example of the new Syntax.
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the theme may look like.
|
42
.github/ISSUE_TEMPLATE/theme_proposal.yml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/theme_proposal.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Theme Proposal
|
||||||
|
description: Suggest a new theme to add to Mermaid.js.
|
||||||
|
labels:
|
||||||
|
- 'Status: Triage'
|
||||||
|
- 'Type: Enhancement'
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |-
|
||||||
|
## Before you submit...
|
||||||
|
First of all, thank you for proposing a new Theme to us.
|
||||||
|
We are always happy about new ideas to improve Mermaid.js wherever possible.
|
||||||
|
|
||||||
|
To get the fastest and best response possible, make sure you do the following:
|
||||||
|
|
||||||
|
- Use a clear and concise title
|
||||||
|
- Fill out the text fields with as much detail as possible. Examples are always welcome!
|
||||||
|
- Never be shy to give us screenshots and/or code samples. It will help!
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Proposal
|
||||||
|
description: A clear and concise description of what theme should be added to Mermaid.js.
|
||||||
|
placeholder: Mermaid.js should add ... because ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Colors
|
||||||
|
description: |-
|
||||||
|
A detailed list of the different colour values to use.
|
||||||
|
A list of currently used variable names can be found [here](https://mermaid-js.github.io/mermaid/#/theming?id=theme-variables-reference-table)
|
||||||
|
placeholder: |-
|
||||||
|
- background: #f4f4f4
|
||||||
|
- primaryColor: #fff4dd
|
||||||
|
- ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Screenshots
|
||||||
|
description: If applicable, add screenshots to show possible examples of how the theme may look like.
|
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@@ -16,30 +16,36 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
run: yarn build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Upload Build as Artifact
|
- name: Upload Mermaid Build as Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: mermaid-build
|
||||||
path: dist
|
path: packages/mermaid/dist
|
||||||
|
|
||||||
|
- name: Upload Mermaid Mindmap Build as Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: mermaid-mindmap-build
|
||||||
|
path: packages/mermaid-mindmap/dist
|
||||||
|
28
.github/workflows/docs.yml
vendored
Normal file
28
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Documentation Checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
paths:
|
||||||
|
- 'packages/mermaid/src/docs/**/*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
paths:
|
||||||
|
- 'packages/mermaid/src/docs/**/*'
|
||||||
|
jobs:
|
||||||
|
spellcheck:
|
||||||
|
name: 'Docs: Spellcheck'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
name: Check out the code
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
name: Setup node
|
||||||
|
with:
|
||||||
|
node-version: '16'
|
||||||
|
- run: npm install -g cspell
|
||||||
|
name: Install cSpell
|
||||||
|
- run: cspell --config ./cSpell.json "packages/mermaid/src/docs/**/*.md" --no-progress
|
||||||
|
name: Run cSpell
|
44
.github/workflows/e2e
vendored
44
.github/workflows/e2e
vendored
@@ -1,44 +0,0 @@
|
|||||||
name: E2E
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
cache: yarn
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
|
||||||
run: |
|
|
||||||
yarn install --frozen-lockfile
|
|
||||||
env:
|
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
|
||||||
|
|
||||||
- name: Run Build
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Run E2E Tests
|
|
||||||
run: yarn e2e
|
|
||||||
env:
|
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
|
||||||
|
|
||||||
- name: Upload Coverage to Coveralls
|
|
||||||
uses: coverallsapp/github-action@master
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
flag-name: e2e
|
|
72
.github/workflows/e2e-applitools.yml
vendored
Normal file
72
.github/workflows/e2e-applitools.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
name: E2E (Applitools)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
# Because we want to limit Applitools usage, so we only want to start this
|
||||||
|
# workflow on rare occasions/manually.
|
||||||
|
inputs:
|
||||||
|
parent_branch:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: master
|
||||||
|
description: 'Parent branch to use for PRs'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
# on PRs from forks, this secret will always be empty, for security reasons
|
||||||
|
USE_APPLI: ${{ secrets.APPLITOOLS_API_KEY && 'true' || '' }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [18.x]
|
||||||
|
steps:
|
||||||
|
- if: ${{ ! env.USE_APPLI }}
|
||||||
|
name: Warn if not using Applitools
|
||||||
|
run: |
|
||||||
|
echo "::error,title=Not using Applitols::APPLITOOLS_API_KEY is empty, disabling Applitools for this run."
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: pnpm
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Install Packages
|
||||||
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
env:
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
|
- if: ${{ env.USE_APPLI }}
|
||||||
|
name: Notify applitools of new batch
|
||||||
|
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
|
||||||
|
run: curl -L -d '' -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH"
|
||||||
|
env:
|
||||||
|
# e.g. mermaid-js/mermaid/my-branch
|
||||||
|
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
||||||
|
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
|
||||||
|
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
||||||
|
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
||||||
|
|
||||||
|
- name: Run E2E Tests
|
||||||
|
run: pnpm run e2e
|
||||||
|
env:
|
||||||
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
# Mermaid applitools.config.js uses this to pick batch name.
|
||||||
|
APPLI_BRANCH: ${{ github.ref_name }}
|
||||||
|
APPLITOOLS_BATCH_ID: ${{ github.sha }}
|
||||||
|
# e.g. mermaid-js/mermaid/my-branch
|
||||||
|
APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }}
|
||||||
|
APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }}
|
||||||
|
APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }}
|
||||||
|
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
46
.github/workflows/e2e.yml
vendored
Normal file
46
.github/workflows/e2e.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: E2E
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node-version: [18.x]
|
||||||
|
containers: [1, 2, 3, 4]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
# Need to skip setup if Cypress run is skipped, otherwise an error
|
||||||
|
# is thrown since the pnpm cache step fails
|
||||||
|
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
||||||
|
with:
|
||||||
|
cache: pnpm
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
# Install NPM dependencies, cache them correctly
|
||||||
|
# and run all Cypress tests
|
||||||
|
- name: Cypress run
|
||||||
|
uses: cypress-io/github-action@v4
|
||||||
|
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
|
||||||
|
# Otherwise (e.g. if running from fork), we run on a single container only
|
||||||
|
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
|
||||||
|
with:
|
||||||
|
start: pnpm run dev
|
||||||
|
wait-on: 'http://localhost:9000'
|
||||||
|
# Disable recording if we don't have an API key
|
||||||
|
# e.g. if this action was run from a fork
|
||||||
|
record: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
||||||
|
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
|
||||||
|
env:
|
||||||
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
31
.github/workflows/lint.yml
vendored
31
.github/workflows/lint.yml
vendored
@@ -16,42 +16,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Linting
|
- name: Run Linting
|
||||||
run: yarn lint
|
run: pnpm run lint
|
||||||
|
|
||||||
- name: Verify Docs
|
- name: Verify Docs
|
||||||
run: yarn docs:verify
|
run: pnpm run docs:verify
|
||||||
|
|
||||||
- name: Check no `console.log()` in .jison files
|
|
||||||
# ESLint can't parse .jison files directly
|
|
||||||
# In the future, it might be worth making a `eslint-plugin-jison`, so
|
|
||||||
# that this will be built into the `yarn lint` command.
|
|
||||||
run: |
|
|
||||||
shopt -s globstar
|
|
||||||
mkdir -p tmp/
|
|
||||||
for jison_file in src/**/*.jison; do
|
|
||||||
outfile="tmp/$(basename -- "$jison_file" .jison)-jison.js"
|
|
||||||
echo "Converting $jison_file to $outfile"
|
|
||||||
# default module-type (CJS) always adds a console.log()
|
|
||||||
yarn jison "$jison_file" --outfile "$outfile" --module-type "amd"
|
|
||||||
done
|
|
||||||
yarn eslint --no-eslintrc --rule no-console:error --parser "@babel/eslint-parser" "./tmp/*-jison.js"
|
|
||||||
|
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 18.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
run: npm i yarn --global
|
run: npm i yarn --global
|
||||||
|
|
||||||
|
2
.github/workflows/release-publish.yml
vendored
2
.github/workflows/release-publish.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 18.x
|
||||||
- name: Install Yarn
|
- name: Install Yarn
|
||||||
run: npm i yarn --global
|
run: npm i yarn --global
|
||||||
|
|
||||||
|
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -10,28 +10,28 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [18.x]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Unit Tests
|
- name: Run Unit Tests
|
||||||
run: |
|
run: |
|
||||||
yarn ci --coverage
|
pnpm run ci --coverage
|
||||||
|
|
||||||
- name: Upload Coverage to Coveralls
|
- name: Upload Coverage to Coveralls
|
||||||
# it feels a bit weird to use @master, but that's what the docs use
|
# it feels a bit weird to use @master, but that's what the docs use
|
||||||
|
11
.gitignore
vendored
11
.gitignore
vendored
@@ -12,7 +12,11 @@ token
|
|||||||
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
.vscode/
|
# ignore files in /.vscode/ except for launch.json and extensions.json
|
||||||
|
/.vscode/**
|
||||||
|
!/.vscode/launch.json
|
||||||
|
!/.vscode/extensions.json
|
||||||
|
|
||||||
cypress/platform/current.html
|
cypress/platform/current.html
|
||||||
cypress/platform/experimental.html
|
cypress/platform/experimental.html
|
||||||
local/
|
local/
|
||||||
@@ -26,3 +30,8 @@ cypress/snapshots/
|
|||||||
|
|
||||||
# eslint --cache file
|
# eslint --cache file
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
.tsbuildinfo
|
||||||
|
tsconfig.tsbuildinfo
|
||||||
|
knsv*.html
|
||||||
|
|
||||||
|
local*.html
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
yarn pre-commit
|
pnpm run pre-commit
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"src/docs/**": ["yarn docs:build --git"],
|
"packages/mermaid/src/docs/**": ["pnpm run docs:build --git"],
|
||||||
"src/docs.mts": ["yarn docs:build --git"],
|
"packages/mermaid/src/docs.mts": ["pnpm run docs:build --git"],
|
||||||
"*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"]
|
"*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"],
|
||||||
|
"*.jison": ["pnpm run lint:jison"]
|
||||||
}
|
}
|
||||||
|
2
.npmrc
Normal file
2
.npmrc
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
auto-install-peers=true
|
||||||
|
strict-peer-dependencies=false
|
@@ -1,3 +1,6 @@
|
|||||||
dist
|
dist
|
||||||
cypress/platform/xss3.html
|
cypress/platform/xss3.html
|
||||||
.cache
|
.cache
|
||||||
|
coverage
|
||||||
|
# Autogenerated by PNPM
|
||||||
|
pnpm-lock.yaml
|
148
.vite/build.ts
Normal file
148
.vite/build.ts
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
import { build, InlineConfig } from 'vite';
|
||||||
|
import { resolve } from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
|
import pkg from '../package.json' assert { type: 'json' };
|
||||||
|
|
||||||
|
const { dependencies } = pkg;
|
||||||
|
const watch = process.argv.includes('--watch');
|
||||||
|
const mermaidOnly = process.argv.includes('--mermaid');
|
||||||
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
|
|
||||||
|
type OutputOptions = Exclude<
|
||||||
|
Exclude<InlineConfig['build'], undefined>['rollupOptions'],
|
||||||
|
undefined
|
||||||
|
>['output'];
|
||||||
|
|
||||||
|
const packageOptions = {
|
||||||
|
mermaid: {
|
||||||
|
name: 'mermaid',
|
||||||
|
packageName: 'mermaid',
|
||||||
|
file: 'mermaid.ts',
|
||||||
|
},
|
||||||
|
'mermaid-mindmap': {
|
||||||
|
name: 'mermaid-mindmap',
|
||||||
|
packageName: 'mermaid-mindmap',
|
||||||
|
file: 'diagram-definition.ts',
|
||||||
|
},
|
||||||
|
'mermaid-mindmap-detector': {
|
||||||
|
name: 'mermaid-mindmap-detector',
|
||||||
|
packageName: 'mermaid-mindmap',
|
||||||
|
file: 'detector.ts',
|
||||||
|
},
|
||||||
|
'mermaid-example-diagram': {
|
||||||
|
name: 'mermaid-example-diagram',
|
||||||
|
packageName: 'mermaid-example-diagram',
|
||||||
|
file: 'diagram-definition.ts',
|
||||||
|
},
|
||||||
|
'mermaid-example-diagram-detector': {
|
||||||
|
name: 'mermaid-example-diagram-detector',
|
||||||
|
packageName: 'mermaid-example-diagram',
|
||||||
|
file: 'detector.ts',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
interface BuildOptions {
|
||||||
|
minify: boolean | 'esbuild';
|
||||||
|
core?: boolean;
|
||||||
|
watch?: boolean;
|
||||||
|
entryName: keyof typeof packageOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
||||||
|
const external = ['require', 'fs', 'path'];
|
||||||
|
console.log(entryName, packageOptions[entryName]);
|
||||||
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
|
let output: OutputOptions = [
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
format: 'esm',
|
||||||
|
sourcemap: true,
|
||||||
|
entryFileNames: `${name}.esm${minify ? '.min' : ''}.mjs`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
format: 'umd',
|
||||||
|
sourcemap: true,
|
||||||
|
entryFileNames: `${name}${minify ? '.min' : ''}.js`,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
if (core) {
|
||||||
|
// Core build is used to generate file without bundled dependencies.
|
||||||
|
// This is used by downstream projects to bundle dependencies themselves.
|
||||||
|
external.push(...Object.keys(dependencies));
|
||||||
|
// This needs to be an array. Otherwise vite will build esm & umd with same name and overwrite esm with umd.
|
||||||
|
output = [
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
format: 'esm',
|
||||||
|
sourcemap: true,
|
||||||
|
entryFileNames: `${name}.core.mjs`,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
const config: InlineConfig = {
|
||||||
|
configFile: false,
|
||||||
|
build: {
|
||||||
|
emptyOutDir: false,
|
||||||
|
outDir: resolve(__dirname, `../packages/${packageName}/dist`),
|
||||||
|
lib: {
|
||||||
|
entry: resolve(__dirname, `../packages/${packageName}/src/${file}`),
|
||||||
|
name,
|
||||||
|
// the proper extensions will be added
|
||||||
|
fileName: name,
|
||||||
|
},
|
||||||
|
minify,
|
||||||
|
rollupOptions: {
|
||||||
|
external,
|
||||||
|
output,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.jison', '.js', '.ts', '.json'],
|
||||||
|
},
|
||||||
|
plugins: [jisonPlugin()],
|
||||||
|
};
|
||||||
|
|
||||||
|
if (watch && config.build) {
|
||||||
|
config.build.watch = {
|
||||||
|
include: [
|
||||||
|
'packages/mermaid-mindmap/src/**',
|
||||||
|
'packages/mermaid/src/**',
|
||||||
|
'packages/mermaid-example-diagram/src/**',
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
||||||
|
return Promise.allSettled([
|
||||||
|
build(getBuildConfig({ minify: false, entryName })),
|
||||||
|
build(getBuildConfig({ minify: 'esbuild', entryName })),
|
||||||
|
build(getBuildConfig({ minify: false, core: true, entryName })),
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[];
|
||||||
|
for (const pkg of packageNames) {
|
||||||
|
if (mermaidOnly && pkg !== 'mermaid') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
await buildPackage(pkg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (watch) {
|
||||||
|
build(getBuildConfig({ minify: false, watch, core: true, entryName: 'mermaid' }));
|
||||||
|
if (!mermaidOnly) {
|
||||||
|
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' }));
|
||||||
|
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
void main();
|
||||||
|
}
|
17
.vite/jisonPlugin.ts
Normal file
17
.vite/jisonPlugin.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { transformJison } from './jisonTransformer.js';
|
||||||
|
const fileRegex = /\.(jison)$/;
|
||||||
|
|
||||||
|
export default function jison() {
|
||||||
|
return {
|
||||||
|
name: 'jison',
|
||||||
|
|
||||||
|
transform(src: string, id: string) {
|
||||||
|
if (fileRegex.test(id)) {
|
||||||
|
return {
|
||||||
|
code: transformJison(src),
|
||||||
|
map: null, // provide source map if available
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
17
.vite/jisonTransformer.ts
Normal file
17
.vite/jisonTransformer.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// @ts-ignore No typings for jison
|
||||||
|
import jison from 'jison';
|
||||||
|
|
||||||
|
export const transformJison = (src: string): string => {
|
||||||
|
// @ts-ignore No typings for jison
|
||||||
|
const parser = new jison.Generator(src, {
|
||||||
|
moduleType: 'js',
|
||||||
|
'token-stack': true,
|
||||||
|
});
|
||||||
|
const source = parser.generate({ moduleMain: '() => {}' });
|
||||||
|
const exporter = `
|
||||||
|
parser.parser = parser;
|
||||||
|
export { parser };
|
||||||
|
export default parser;
|
||||||
|
`;
|
||||||
|
return `${source} ${exporter}`;
|
||||||
|
};
|
37
.vite/server.ts
Normal file
37
.vite/server.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import express, { NextFunction, Request, Response } from 'express';
|
||||||
|
import { createServer as createViteServer } from 'vite';
|
||||||
|
// import { getBuildConfig } from './build';
|
||||||
|
|
||||||
|
const cors = (req: Request, res: Response, next: NextFunction) => {
|
||||||
|
res.header('Access-Control-Allow-Origin', '*');
|
||||||
|
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
||||||
|
res.header('Access-Control-Allow-Headers', 'Content-Type');
|
||||||
|
|
||||||
|
next();
|
||||||
|
};
|
||||||
|
|
||||||
|
async function createServer() {
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
// Create Vite server in middleware mode
|
||||||
|
const vite = await createViteServer({
|
||||||
|
configFile: './vite.config.ts',
|
||||||
|
server: { middlewareMode: true },
|
||||||
|
appType: 'custom', // don't include Vite's default HTML handling middlewares
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use(cors);
|
||||||
|
app.use(express.static('./packages/mermaid/dist'));
|
||||||
|
app.use(express.static('./packages/mermaid-example-diagram/dist'));
|
||||||
|
app.use(express.static('./packages/mermaid-mindmap/dist'));
|
||||||
|
app.use(vite.middlewares);
|
||||||
|
app.use(express.static('demos'));
|
||||||
|
app.use(express.static('cypress/platform'));
|
||||||
|
|
||||||
|
app.listen(9000, () => {
|
||||||
|
console.log(`Listening on http://localhost:9000`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// build(getBuildConfig({ minify: false, watch: true }));
|
||||||
|
createServer();
|
6
.vite/tsconfig.json
Normal file
6
.vite/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "ES2022"
|
||||||
|
}
|
||||||
|
}
|
8
.vscode/extensions.json
vendored
Normal file
8
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"zixuanchen.vitest-explorer",
|
||||||
|
"luniclynx.bison"
|
||||||
|
]
|
||||||
|
}
|
17
.vscode/launch.json
vendored
Normal file
17
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug Current Test File",
|
||||||
|
"autoAttachChildProcesses": true,
|
||||||
|
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
|
||||||
|
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
|
||||||
|
"args": ["run", "${relativeFile}"],
|
||||||
|
"smartStep": true,
|
||||||
|
"console": "integratedTerminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -1,25 +0,0 @@
|
|||||||
const { Generator } = require('jison');
|
|
||||||
const validate = require('schema-utils');
|
|
||||||
|
|
||||||
const schema = {
|
|
||||||
title: 'Jison Parser options',
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
'token-stack': {
|
|
||||||
type: 'boolean',
|
|
||||||
},
|
|
||||||
debug: {
|
|
||||||
type: 'boolean',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
additionalProperties: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = function jisonLoader(source) {
|
|
||||||
const options = this.getOptions();
|
|
||||||
(validate.validate || validate)(schema, options, {
|
|
||||||
name: 'Jison Loader',
|
|
||||||
baseDataPath: 'options',
|
|
||||||
});
|
|
||||||
return new Generator(source, options).generate();
|
|
||||||
};
|
|
@@ -1,45 +0,0 @@
|
|||||||
import { merge, mergeWithCustomize, customizeObject } from 'webpack-merge';
|
|
||||||
import nodeExternals from 'webpack-node-externals';
|
|
||||||
import baseConfig from './webpack.config.base';
|
|
||||||
|
|
||||||
export default (_env, args) => {
|
|
||||||
switch (args.mode) {
|
|
||||||
case 'development':
|
|
||||||
return [
|
|
||||||
baseConfig,
|
|
||||||
merge(baseConfig, {
|
|
||||||
externals: [nodeExternals()],
|
|
||||||
output: {
|
|
||||||
filename: '[name].core.js',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
case 'production':
|
|
||||||
return [
|
|
||||||
// umd
|
|
||||||
merge(baseConfig, {
|
|
||||||
output: {
|
|
||||||
filename: '[name].min.js',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
// esm
|
|
||||||
mergeWithCustomize({
|
|
||||||
customizeObject: customizeObject({
|
|
||||||
'output.library': 'replace',
|
|
||||||
}),
|
|
||||||
})(baseConfig, {
|
|
||||||
experiments: {
|
|
||||||
outputModule: true,
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
library: {
|
|
||||||
type: 'module',
|
|
||||||
},
|
|
||||||
filename: '[name].esm.min.mjs',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
default:
|
|
||||||
throw new Error('No matching configuration was found!');
|
|
||||||
}
|
|
||||||
};
|
|
@@ -1,58 +0,0 @@
|
|||||||
import path from 'path';
|
|
||||||
export const resolveRoot = (...relativePath) => path.resolve(__dirname, '..', ...relativePath);
|
|
||||||
|
|
||||||
export default {
|
|
||||||
amd: false, // https://github.com/lodash/lodash/issues/3052
|
|
||||||
target: 'web',
|
|
||||||
entry: {
|
|
||||||
mermaid: './src/mermaid',
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.wasm', '.mjs', '.js', '.ts', '.json', '.jison'],
|
|
||||||
fallback: {
|
|
||||||
fs: false, // jison generated code requires 'fs'
|
|
||||||
path: require.resolve('path-browserify'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: resolveRoot('./dist'),
|
|
||||||
filename: '[name].js',
|
|
||||||
library: {
|
|
||||||
name: 'mermaid',
|
|
||||||
type: 'umd',
|
|
||||||
export: 'default',
|
|
||||||
},
|
|
||||||
globalObject: 'typeof self !== "undefined" ? self : this',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.ts$/,
|
|
||||||
use: 'ts-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
include: [resolveRoot('./src'), resolveRoot('./node_modules/dagre-d3-renderer/lib')],
|
|
||||||
use: {
|
|
||||||
loader: 'babel-loader',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// load scss to string
|
|
||||||
test: /\.scss$/,
|
|
||||||
use: ['css-to-string-loader', 'css-loader', 'sass-loader'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.jison$/,
|
|
||||||
use: {
|
|
||||||
loader: path.resolve(__dirname, './loaders/jison.js'),
|
|
||||||
options: {
|
|
||||||
'token-stack': true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
devtool: 'source-map',
|
|
||||||
};
|
|
@@ -1,37 +0,0 @@
|
|||||||
import baseConfig, { resolveRoot } from './webpack.config.base';
|
|
||||||
import { merge } from 'webpack-merge';
|
|
||||||
|
|
||||||
export default merge(baseConfig, {
|
|
||||||
mode: 'development',
|
|
||||||
entry: {
|
|
||||||
mermaid: './src/mermaid',
|
|
||||||
e2e: './cypress/platform/viewer.js',
|
|
||||||
'bundle-test': './cypress/platform/bundle-test.js',
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
globalObject: 'window',
|
|
||||||
},
|
|
||||||
devServer: {
|
|
||||||
compress: true,
|
|
||||||
port: 9000,
|
|
||||||
static: [
|
|
||||||
{ directory: resolveRoot('cypress', 'platform') },
|
|
||||||
{ directory: resolveRoot('dist') },
|
|
||||||
{ directory: resolveRoot('demos') },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
externals: {
|
|
||||||
mermaid: 'mermaid',
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
exclude: /node_modules/,
|
|
||||||
use: {
|
|
||||||
loader: 'babel-loader',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
|
128
CODE_OF_CONDUCT.md
Normal file
128
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
- Demonstrating empathy and kindness toward other people
|
||||||
|
- Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
- Giving and gracefully accepting constructive feedback
|
||||||
|
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
- Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
- The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
- Public or private harassment
|
||||||
|
- Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at security@mermaid.live
|
||||||
|
.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
@@ -6,13 +6,24 @@ So you want to help? That's great!
|
|||||||
|
|
||||||
Here are a few things to know to get you started on the right path.
|
Here are a few things to know to get you started on the right path.
|
||||||
|
|
||||||
|
Below link will help you making a copy of the repository in your local system.
|
||||||
|
|
||||||
|
https://docs.github.com/en/get-started/quickstart/fork-a-repo
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [volta](https://volta.sh/) to manage node versions.
|
||||||
|
- [Node.js](https://nodejs.org/en/). `volta install node`
|
||||||
|
- [pnpm](https://pnpm.io/) package manager. `volta install pnpm`
|
||||||
|
|
||||||
## Development Installation
|
## Development Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:mermaid-js/mermaid.git
|
git clone git@github.com:mermaid-js/mermaid.git
|
||||||
cd mermaid
|
cd mermaid
|
||||||
yarn
|
# npx is required for first install as volta support for pnpm is not added yet.
|
||||||
yarn test
|
npx pnpm install
|
||||||
|
pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Committing code
|
## Committing code
|
||||||
@@ -39,16 +50,16 @@ Less strict here, it is OK to commit directly in the `develop` branch if you are
|
|||||||
|
|
||||||
The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
|
The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
|
||||||
|
|
||||||
### Documentation source files are in /src/docs
|
### Documentation source files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)
|
||||||
|
|
||||||
The source files for the project documentation are located in the `/src/docs` directory. This is where you should make changes.
|
The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
|
||||||
The files under `/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
|
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
classDef default fill:#fff,color:black,stroke:black
|
classDef default fill:#fff,color:black,stroke:black
|
||||||
|
|
||||||
source["files in /src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
|
source["files in /packages/mermaid/src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -103,7 +114,7 @@ This is important so that, if someone else does a change to the grammar that doe
|
|||||||
|
|
||||||
This tests the rendering and visual appearance of the diagram. This ensures that the rendering of that feature in the e2e will be reviewed in the release process going forward. Less chance that it breaks!
|
This tests the rendering and visual appearance of the diagram. This ensures that the rendering of that feature in the e2e will be reviewed in the release process going forward. Less chance that it breaks!
|
||||||
|
|
||||||
To start working with the e2e tests, run `yarn dev` to start the dev server, after that start cypress by running `cypress open` in the mermaid folder. (Make sure you have path to cypress in order, the binary is located in node_modules/.bin).
|
To start working with the e2e tests, run `pnpm run dev` to start the dev server, after that start cypress by running `pnpm exec cypress open` in the mermaid folder.
|
||||||
|
|
||||||
The rendering tests are very straightforward to create. There is a function imgSnapshotTest. This function takes a diagram in text form, the mermaid options and renders that diagram in cypress.
|
The rendering tests are very straightforward to create. There is a function imgSnapshotTest. This function takes a diagram in text form, the mermaid options and renders that diagram in cypress.
|
||||||
|
|
||||||
@@ -137,7 +148,7 @@ it('should render forks and joins', () => {
|
|||||||
|
|
||||||
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
|
Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?
|
||||||
|
|
||||||
The source files for documentation are in `/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
|
The source files for documentation are in `/packages/mermaid/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
|
||||||
|
|
||||||
#### Adding to or changing the documentation organization
|
#### Adding to or changing the documentation organization
|
||||||
|
|
||||||
|
21
README.md
21
README.md
@@ -1,4 +1,23 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
# mermaid
|
||||||
|
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
|
# Whoa, what's going on here?
|
||||||
|
|
||||||
|
We are transforming the Mermaid repository to a so called mono-repo. This is a part of the effort to decouple the diagrams from the core of mermaid. This will:
|
||||||
|
|
||||||
|
- Make it possible to select which diagrams to include on your site
|
||||||
|
- Open up for lazy loading
|
||||||
|
- Make it possible to add diagrams from outside of the Mermaid repository
|
||||||
|
- Separate the release flow between different diagrams and the Mermaid core
|
||||||
|
|
||||||
|
As such be aware of some changes..
|
||||||
|
|
||||||
|
# We use pnpm now
|
||||||
|
|
||||||
|
# The source code has moved
|
||||||
|
|
||||||
|
It is now located in the src folder for each respective package located as subfolders in packages.
|
||||||
|
|
||||||
English | [简体中文](./README.zh-CN.md)
|
English | [简体中文](./README.zh-CN.md)
|
||||||
|
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
# mermaid [](https://travis-ci.org/mermaid-js/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
|
# mermaid
|
||||||
|
|
||||||
|
[](https://github.com/mermaid-js/mermaid/actions/workflows/build.yml) [](https://www.npmjs.com/package/mermaid) [](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [](https://www.jsdelivr.com/package/npm/mermaid) [](https://www.npmjs.com/package/mermaid) [](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [](https://twitter.com/mermaidjs_)
|
||||||
|
|
||||||
[English](./README.md) | 简体中文
|
[English](./README.md) | 简体中文
|
||||||
|
|
||||||
|
5
V10-BreakingChanges.md
Normal file
5
V10-BreakingChanges.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# A collection of updates that change the behaviour
|
||||||
|
|
||||||
|
## Lazy loading and asynchronisity
|
||||||
|
|
||||||
|
- Invalid dates are rendered as syntax error instead of returning best guess or the current date
|
@@ -1,3 +0,0 @@
|
|||||||
export const curveBasis = 'basis';
|
|
||||||
export const curveLinear = 'linear';
|
|
||||||
export const curveCardinal = 'cardinal';
|
|
@@ -1,4 +1,7 @@
|
|||||||
let NewD3 = function () {
|
// @ts-nocheck TODO: Fix TS
|
||||||
|
import { vi } from 'vitest';
|
||||||
|
|
||||||
|
const NewD3 = function () {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -56,9 +59,9 @@ export const MockD3 = (name, parent) => {
|
|||||||
children.push(mockElem);
|
children.push(mockElem);
|
||||||
return mockElem;
|
return mockElem;
|
||||||
};
|
};
|
||||||
elem.lower = jest.fn(() => elem);
|
elem.lower = vi.fn(() => elem);
|
||||||
elem.attr = jest.fn(() => elem);
|
elem.attr = vi.fn(() => elem);
|
||||||
elem.text = jest.fn(() => elem);
|
elem.text = vi.fn(() => elem);
|
||||||
elem.style = jest.fn(() => elem);
|
elem.style = vi.fn(() => elem);
|
||||||
return elem;
|
return elem;
|
||||||
};
|
};
|
1
__mocks__/dagre-d3.ts
Normal file
1
__mocks__/dagre-d3.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// DO NOT delete this file. It is used by vitest to mock the dagre-d3 module.
|
3
__mocks__/entity-decode/browser.ts
Normal file
3
__mocks__/entity-decode/browser.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = function (txt: string) {
|
||||||
|
return txt;
|
||||||
|
};
|
@@ -1,16 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
testConcurrency: 1,
|
|
||||||
// browser: [
|
|
||||||
// // Add browsers with different viewports
|
|
||||||
// { width: 800, height: 600, name: 'chrome' },
|
|
||||||
// { width: 700, height: 500, name: 'firefox' },
|
|
||||||
// { width: 1600, height: 1200, name: 'ie11' },
|
|
||||||
// { width: 1024, height: 768, name: 'edgechromium' },
|
|
||||||
// { width: 800, height: 600, name: 'safari' },
|
|
||||||
// // Add mobile emulation devices in Portrait mode
|
|
||||||
// { deviceName: 'iPhone X', screenOrientation: 'portrait' },
|
|
||||||
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
|
||||||
// ],
|
|
||||||
// // set batch name to the configuration
|
|
||||||
// batchName: 'Ultrafast Batch',
|
|
||||||
};
|
|
19
applitools.config.js
Normal file
19
applitools.config.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const { defineConfig } = require('cypress');
|
||||||
|
|
||||||
|
module.exports = defineConfig({
|
||||||
|
testConcurrency: 1,
|
||||||
|
browser: [
|
||||||
|
// Add browsers with different viewports
|
||||||
|
// { width: 800, height: 600, name: 'chrome' },
|
||||||
|
// { width: 700, height: 500, name: 'firefox' },
|
||||||
|
// { width: 1600, height: 1200, name: 'ie11' },
|
||||||
|
// { width: 1024, height: 768, name: 'edgechromium' },
|
||||||
|
// { width: 800, height: 600, name: 'safari' },
|
||||||
|
// // Add mobile emulation devices in Portrait mode
|
||||||
|
// { deviceName: 'iPhone X', screenOrientation: 'portrait' },
|
||||||
|
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
||||||
|
],
|
||||||
|
// set batch name to the configuration
|
||||||
|
batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
||||||
|
});
|
@@ -1,10 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@babel/preset-env',
|
|
||||||
{
|
|
||||||
targets: 'defaults, ie >= 11, current node',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
};
|
|
95
cSpell.json
Normal file
95
cSpell.json
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2",
|
||||||
|
"language": "en",
|
||||||
|
"words": [
|
||||||
|
"customizability",
|
||||||
|
"Gantt",
|
||||||
|
"jison",
|
||||||
|
"knsv",
|
||||||
|
"Knut",
|
||||||
|
"mindmap",
|
||||||
|
"Mindmaps",
|
||||||
|
"mitigations",
|
||||||
|
"sandboxed",
|
||||||
|
"Sveidqvist",
|
||||||
|
"verdana",
|
||||||
|
"Visio"
|
||||||
|
],
|
||||||
|
"ignoreWords": [
|
||||||
|
"Adamiecki",
|
||||||
|
"applitools",
|
||||||
|
"Asciidoctor",
|
||||||
|
"Astah",
|
||||||
|
"Bisheng",
|
||||||
|
"codedoc",
|
||||||
|
"Docsy",
|
||||||
|
"Doku",
|
||||||
|
"Gitea",
|
||||||
|
"Gitgraph",
|
||||||
|
"Grav",
|
||||||
|
"Inkdrop",
|
||||||
|
"Jaoude",
|
||||||
|
"mdbook",
|
||||||
|
"mermerd",
|
||||||
|
"mkdocs",
|
||||||
|
"phpbb",
|
||||||
|
"Plantuml",
|
||||||
|
"Playfair's",
|
||||||
|
"Podlite",
|
||||||
|
"redmine",
|
||||||
|
"sphinxcontrib",
|
||||||
|
"Tuleap"
|
||||||
|
],
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"name": "Markdown links",
|
||||||
|
"pattern": "\\((.*)\\)",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown code blocks",
|
||||||
|
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
|
||||||
|
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Inline code blocks",
|
||||||
|
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
|
||||||
|
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Link contents",
|
||||||
|
"pattern": "\\<a(.*)\\>",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Snippet references",
|
||||||
|
"pattern": "-- snippet:(.*)",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Snippet references 2",
|
||||||
|
"pattern": "\\<\\[sample:(.*)",
|
||||||
|
"description": "another kind of snippet reference"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Multi-line code blocks",
|
||||||
|
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "HTML Tags",
|
||||||
|
"pattern": "<[^>]*>",
|
||||||
|
"description": "Reference: https://stackoverflow.com/questions/11229831/regular-expression-to-remove-html-tags-from-a-string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ignoreRegExpList": [
|
||||||
|
"Markdown links",
|
||||||
|
"Markdown code blocks",
|
||||||
|
"Inline code blocks",
|
||||||
|
"Link contents",
|
||||||
|
"Snippet references",
|
||||||
|
"Snippet references 2",
|
||||||
|
"Multi-line code blocks",
|
||||||
|
"HTML Tags"
|
||||||
|
],
|
||||||
|
"ignorePaths": ["packages/mermaid/src/docs/CHANGELOG.md"]
|
||||||
|
}
|
@@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
const { defineConfig } = require('cypress');
|
const { defineConfig } = require('cypress');
|
||||||
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
||||||
require('@applitools/eyes-cypress')(module);
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
|
projectId: 'n2sma2',
|
||||||
e2e: {
|
e2e: {
|
||||||
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
|
specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}',
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
addMatchImageSnapshotPlugin(on, config);
|
addMatchImageSnapshotPlugin(on, config);
|
||||||
// copy any needed variables from process.env to config.env
|
// copy any needed variables from process.env to config.env
|
||||||
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
||||||
config.env.codeBranch = process.env.APPLI_BRANCH;
|
|
||||||
|
|
||||||
// do not forget to return the changed config object!
|
// do not forget to return the changed config object!
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
supportFile: 'cypress/support/index.js',
|
|
||||||
},
|
},
|
||||||
video: false,
|
video: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
require('@applitools/eyes-cypress')(module);
|
@@ -1 +0,0 @@
|
|||||||
Cr24
|
|
@@ -1,4 +1,6 @@
|
|||||||
import { Base64 } from 'js-base64';
|
const utf8ToB64 = (str) => {
|
||||||
|
return window.btoa(unescape(encodeURIComponent(str)));
|
||||||
|
};
|
||||||
|
|
||||||
export const mermaidUrl = (graphStr, options, api) => {
|
export const mermaidUrl = (graphStr, options, api) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
@@ -6,7 +8,7 @@ export const mermaidUrl = (graphStr, options, api) => {
|
|||||||
mermaid: options,
|
mermaid: options,
|
||||||
};
|
};
|
||||||
const objStr = JSON.stringify(obj);
|
const objStr = JSON.stringify(obj);
|
||||||
let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr);
|
let url = 'http://localhost:9000/e2e.html?graph=' + utf8ToB64(objStr);
|
||||||
if (api) {
|
if (api) {
|
||||||
url = 'http://localhost:9000/xss.html?graph=' + graphStr;
|
url = 'http://localhost:9000/xss.html?graph=' + graphStr;
|
||||||
}
|
}
|
||||||
@@ -44,15 +46,13 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
}
|
}
|
||||||
const useAppli = Cypress.env('useAppli');
|
const useAppli = Cypress.env('useAppli');
|
||||||
//const useAppli = false;
|
//const useAppli = false;
|
||||||
const branch = Cypress.env('codeBranch');
|
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
cy.eyesOpen({
|
cy.eyesOpen({
|
||||||
appName: 'Mermaid-' + branch,
|
appName: 'Mermaid',
|
||||||
testName: name,
|
testName: name,
|
||||||
batchName: branch,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,15 +96,13 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
|||||||
options.fontSize = '16px';
|
options.fontSize = '16px';
|
||||||
}
|
}
|
||||||
const useAppli = Cypress.env('useAppli');
|
const useAppli = Cypress.env('useAppli');
|
||||||
const branch = Cypress.env('codeBranch');
|
|
||||||
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
cy.log('Hello ' + useAppli ? 'Appli' : 'image-snapshot');
|
||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
cy.eyesOpen({
|
cy.eyesOpen({
|
||||||
appName: 'Mermaid-' + branch,
|
appName: 'Mermaid',
|
||||||
testName: name,
|
testName: name,
|
||||||
batchName: branch,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,11 +15,13 @@ describe('Configuration', () => {
|
|||||||
|
|
||||||
// Check the marker-end property to make sure it is properly set to
|
// Check the marker-end property to make sure it is properly set to
|
||||||
// start with #
|
// start with #
|
||||||
cy.get('.edgePath path')
|
cy.get('.edgePaths').within(() => {
|
||||||
.first()
|
cy.get('path')
|
||||||
.should('have.attr', 'marker-end')
|
.first()
|
||||||
.should('exist')
|
.should('have.attr', 'marker-end')
|
||||||
.and('include', 'url(#');
|
.should('exist')
|
||||||
|
.and('include', 'url(#');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should handle default value false of arrowMarkerAbsolute', () => {
|
it('should handle default value false of arrowMarkerAbsolute', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
@@ -35,11 +37,13 @@ describe('Configuration', () => {
|
|||||||
|
|
||||||
// Check the marker-end property to make sure it is properly set to
|
// Check the marker-end property to make sure it is properly set to
|
||||||
// start with #
|
// start with #
|
||||||
cy.get('.edgePath path')
|
cy.get('.edgePaths').within(() => {
|
||||||
.first()
|
cy.get('path')
|
||||||
.should('have.attr', 'marker-end')
|
.first()
|
||||||
.should('exist')
|
.should('have.attr', 'marker-end')
|
||||||
.and('include', 'url(#');
|
.should('exist')
|
||||||
|
.and('include', 'url(#');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should handle arrowMarkerAbsolute explicitly set to false', () => {
|
it('should handle arrowMarkerAbsolute explicitly set to false', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
@@ -57,11 +61,13 @@ describe('Configuration', () => {
|
|||||||
|
|
||||||
// Check the marker-end property to make sure it is properly set to
|
// Check the marker-end property to make sure it is properly set to
|
||||||
// start with #
|
// start with #
|
||||||
cy.get('.edgePath path')
|
cy.get('.edgePaths').within(() => {
|
||||||
.first()
|
cy.get('path')
|
||||||
.should('have.attr', 'marker-end')
|
.first()
|
||||||
.should('exist')
|
.should('have.attr', 'marker-end')
|
||||||
.and('include', 'url(#');
|
.should('exist')
|
||||||
|
.and('include', 'url(#');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => {
|
it('should handle arrowMarkerAbsolute explicitly set to "false" as false', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
@@ -79,15 +85,17 @@ describe('Configuration', () => {
|
|||||||
|
|
||||||
// Check the marker-end property to make sure it is properly set to
|
// Check the marker-end property to make sure it is properly set to
|
||||||
// start with #
|
// start with #
|
||||||
cy.get('.edgePath path')
|
cy.get('.edgePaths').within(() => {
|
||||||
.first()
|
cy.get('path')
|
||||||
.should('have.attr', 'marker-end')
|
.first()
|
||||||
.should('exist')
|
.should('have.attr', 'marker-end')
|
||||||
.and('include', 'url(#');
|
.should('exist')
|
||||||
|
.and('include', 'url(#');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should handle arrowMarkerAbsolute set to true', () => {
|
it('should handle arrowMarkerAbsolute set to true', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`graph TD
|
`flowchart TD
|
||||||
A[Christmas] -->|Get money| B(Go shopping)
|
A[Christmas] -->|Get money| B(Go shopping)
|
||||||
B --> C{Let me think}
|
B --> C{Let me think}
|
||||||
C -->|One| D[Laptop]
|
C -->|One| D[Laptop]
|
||||||
@@ -99,11 +107,13 @@ describe('Configuration', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
cy.get('.edgePath path')
|
cy.get('.edgePaths').within(() => {
|
||||||
.first()
|
cy.get('path')
|
||||||
.should('have.attr', 'marker-end')
|
.first()
|
||||||
.should('exist')
|
.should('have.attr', 'marker-end')
|
||||||
.and('include', 'url(http://localhost');
|
.should('exist')
|
||||||
|
.and('include', 'url(http://localhost');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should not taint the initial configuration when using multiple directives', () => {
|
it('should not taint the initial configuration when using multiple directives', () => {
|
||||||
const url = 'http://localhost:9000/regression/issue-1874.html';
|
const url = 'http://localhost:9000/regression/issue-1874.html';
|
||||||
|
@@ -1,266 +1,180 @@
|
|||||||
describe('Interaction', () => {
|
describe('Interaction', () => {
|
||||||
describe('Interaction - security level loose', () => {
|
describe('Security level loose', () => {
|
||||||
it('Graph: should handle a click on a node with a bound function', () => {
|
beforeEach(() => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.visit('http://localhost:9000/click_security_loose.html');
|
||||||
cy.viewport(1440, 1024);
|
});
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
|
it('Graph: should handle a click on a node with a bound function', () => {
|
||||||
|
cy.contains('FunctionTest1').parents('.node').click();
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Graph: should handle a click on a node with a bound function with args', () => {
|
it('Graph: should handle a click on a node with a bound function with args', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('FunctionArgTest2').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-FunctionArg-28').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart: should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('Flowchart: should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('2FunctionArg').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-FunctionArg-34"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
cy.get('.created-by-click-2').should('have.text', 'Clicked By Flow: ARGUMENT');
|
||||||
});
|
});
|
||||||
it('Graph: should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Graph: should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
// When there is a URL, cy.contains selects the a tag instead of the span. The .node is a child of a, so we have to use find instead of parent.
|
||||||
|
cy.contains('URLTest1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-11"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Graph: should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('2URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
|
it('Flowchart-v2: should handle a click on a node with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('FunctionTest2').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-16').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('Flowchart-v2: should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.contains('10Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-22"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
cy.get('.created-by-click').should('have.text', 'Clicked By Flow');
|
||||||
});
|
});
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('#flowchart-URL-17').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Flowchart-v2: should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URLTest2').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-23"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('Flowchart-v2: should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('20URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('rect#cl1').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('rect#cl1').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('text#cl1-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('text#cl1-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function without args', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function without args', () => {
|
||||||
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function with args', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl3').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function with args', () => {
|
||||||
|
cy.get('rect#cl3').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound function without args', () => {
|
it('should handle a click on a task with a bound function without args', () => {
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant cl2');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function with args ', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_loose.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl3-text').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function with args ', () => {
|
||||||
|
cy.get('text#cl3-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
cy.get('.created-by-gant-click').should('have.text', 'Clicked By Gant test1 test2 test3');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Interaction - security level tight', () => {
|
describe('Interaction - security level tight', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('http://localhost:9000/click_security_strict.html');
|
||||||
|
});
|
||||||
it('should handle a click on a node without a bound function', () => {
|
it('should handle a click on a node without a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.contains('Function1').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.contains('1Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-10"]').click();
|
|
||||||
|
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URL1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url where the node starts with a number', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-2URL-11"]').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url where the node starts with a number', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('2URL').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
it('should handle a click on a task with a bound URL clicking on the rect', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.get('rect#cl1').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('rect#cl1').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
it('should handle a click on a task with a bound URL clicking on the text', () => {
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
cy.get('text#cl1-text').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
cy.location().should(({ href }) => {
|
||||||
cy.visit(url);
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
cy.get('body').find('text#cl1-text').click({ force: true });
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
// cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_strict.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
// cy.get('.created-by-gant-click').should('not.have.text', 'Clicked By Gant cl2');
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Interaction - security level other, missspelling', () => {
|
describe('Interaction - security level other, missspelling', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('http://localhost:9000/click_security_other.html');
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function', () => {
|
it('should handle a click on a node with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.contains('Function1').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-Function-4').click();
|
|
||||||
|
|
||||||
// cy.get('.created-by-click').should('not.have.text', 'Clicked By Flow');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
it('should handle a click on a node with a bound function where the node starts with a number', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.contains('1Function').parents('.node').click();
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g[id="flowchart-1Function-10"]').click();
|
|
||||||
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
|
||||||
cy.get('.created-by-click').should('not.exist');
|
cy.get('.created-by-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a node with a bound url', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('g#flowchart-URL-5').click();
|
|
||||||
|
|
||||||
cy.location().should((location) => {
|
it('should handle a click on a node with a bound url', () => {
|
||||||
expect(location.href).to.eq('http://localhost:9000/webpackUsage.html');
|
cy.contains('URL1').find('.node').click();
|
||||||
|
cy.location().should(({ href }) => {
|
||||||
|
expect(href).to.eq('http://localhost:9000/empty.html');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle a click on a task with a bound function', () => {
|
it('should handle a click on a task with a bound function', () => {
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
cy.get('rect#cl2').click({ force: true });
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('rect#cl2').click({ force: true });
|
|
||||||
|
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should handle a click on a task with a bound function', () => {
|
|
||||||
const url = 'http://localhost:9000/click_security_other.html';
|
|
||||||
cy.viewport(1440, 1024);
|
|
||||||
cy.visit(url);
|
|
||||||
cy.get('body').find('text#cl2-text').click({ force: true });
|
|
||||||
|
|
||||||
|
it('should handle a click on a task with a bound function', () => {
|
||||||
|
cy.get('text#cl2-text').click({ force: true });
|
||||||
cy.get('.created-by-gant-click').should('not.exist');
|
cy.get('.created-by-gant-click').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -15,7 +15,7 @@ describe('XSS', () => {
|
|||||||
|
|
||||||
it('should not allow tags in the css', () => {
|
it('should not allow tags in the css', () => {
|
||||||
const str =
|
const str =
|
||||||
'eyJjb2RlIjoiJSV7aW5pdDogeyAnZm9udEZhbWlseSc6ICdcXFwiPjwvc3R5bGU-PGltZyBzcmM9eCBvbmVycm9yPXhzc0F0dGFjaygpPid9IH0lJVxuZ3JhcGggTFJcbiAgICAgQSAtLT4gQiIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0IiwiZmxvd2NoYXJ0Ijp7Imh0bWxMYWJlbHMiOmZhbHNlfX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9';
|
'eyJjb2RlIjoiJSV7aW5pdDogeyAnZm9udEZhbWlseSc6ICdcXFwiPjwvc3R5bGU+PGltZyBzcmM9eCBvbmVycm9yPXhzc0F0dGFjaygpPid9IH0lJVxuZ3JhcGggTFJcbiAgICAgQSAtLT4gQiIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0IiwiZmxvd2NoYXJ0Ijp7Imh0bWxMYWJlbHMiOmZhbHNlfX0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9';
|
||||||
|
|
||||||
const url = mermaidUrl(
|
const url = mermaidUrl(
|
||||||
str,
|
str,
|
||||||
@@ -81,6 +81,9 @@ describe('XSS', () => {
|
|||||||
cy.get('#the-malware').should('not.exist');
|
cy.get('#the-malware').should('not.exist');
|
||||||
});
|
});
|
||||||
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
it('should not allow manipulating antiscript to run javascript using onerror in state diagrams with dagre d3', () => {
|
||||||
|
cy.on('uncaught:exception', (_err, _runnable) => {
|
||||||
|
return false; // continue rendering even if there if mermaid throws an error
|
||||||
|
});
|
||||||
cy.visit('http://localhost:9000/xss9.html');
|
cy.visit('http://localhost:9000/xss9.html');
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.get('#the-malware').should('not.exist');
|
cy.get('#the-malware').should('not.exist');
|
||||||
|
@@ -745,13 +745,13 @@ describe('Graph', () => {
|
|||||||
cy.get('svg').should((svg) => {
|
cy.get('svg').should((svg) => {
|
||||||
expect(svg).to.have.attr('width', '100%');
|
expect(svg).to.have.attr('width', '100%');
|
||||||
// expect(svg).to.have.attr('height');
|
// expect(svg).to.have.attr('height');
|
||||||
// use within because the absolute value can be slightly different depending on the environment ±5%
|
// use within because the absolute value can be slightly different depending on the environment ±10%
|
||||||
// const height = parseFloat(svg.attr('height'));
|
// const height = parseFloat(svg.attr('height'));
|
||||||
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
||||||
const style = svg.attr('style');
|
const style = svg.attr('style');
|
||||||
expect(style).to.match(/^max-width: [\d.]+px;$/);
|
expect(style).to.match(/^max-width: [\d.]+px;$/);
|
||||||
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
|
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
|
||||||
expect(maxWidthValue).to.be.within(300 * 0.95, 300 * 1.05);
|
expect(maxWidthValue).to.be.within(300 * 0.9, 300 * 1.1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('39: should render a flowchart when useMaxWidth is false', () => {
|
it('39: should render a flowchart when useMaxWidth is false', () => {
|
||||||
@@ -768,9 +768,9 @@ describe('Graph', () => {
|
|||||||
cy.get('svg').should((svg) => {
|
cy.get('svg').should((svg) => {
|
||||||
// const height = parseFloat(svg.attr('height'));
|
// const height = parseFloat(svg.attr('height'));
|
||||||
const width = parseFloat(svg.attr('width'));
|
const width = parseFloat(svg.attr('width'));
|
||||||
// use within because the absolute value can be slightly different depending on the environment ±5%
|
// use within because the absolute value can be slightly different depending on the environment ±10%
|
||||||
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
// expect(height).to.be.within(446 * 0.95, 446 * 1.05);
|
||||||
expect(width).to.be.within(300 * 0.95, 300 * 1.05);
|
expect(width).to.be.within(300 * 0.9, 300 * 1.1);
|
||||||
expect(svg).to.not.have.attr('style');
|
expect(svg).to.not.have.attr('style');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -92,7 +92,7 @@ describe('Gantt diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('should render a gantt chart for issue #1060', () => {
|
it('should FAIL redering a gantt chart for issue #1060 with invalid date', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
gantt
|
gantt
|
||||||
|
@@ -180,7 +180,48 @@ describe('Git Graph diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('11: should render a gitgraph with cherry pick commit with custom tag', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gitGraph
|
||||||
|
commit id: "ZERO"
|
||||||
|
branch develop
|
||||||
|
commit id:"A"
|
||||||
|
checkout main
|
||||||
|
commit id:"ONE"
|
||||||
|
checkout develop
|
||||||
|
commit id:"B"
|
||||||
|
checkout main
|
||||||
|
commit id:"TWO"
|
||||||
|
cherry-pick id:"A" tag: "snapshot"
|
||||||
|
commit id:"THREE"
|
||||||
|
checkout develop
|
||||||
|
commit id:"C"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('11: should render a gitgraph with cherry pick commit with no tag', () => {
|
||||||
|
imgSnapshotTest(
|
||||||
|
`
|
||||||
|
gitGraph
|
||||||
|
commit id: "ZERO"
|
||||||
|
branch develop
|
||||||
|
commit id:"A"
|
||||||
|
checkout main
|
||||||
|
commit id:"ONE"
|
||||||
|
checkout develop
|
||||||
|
commit id:"B"
|
||||||
|
checkout main
|
||||||
|
commit id:"TWO"
|
||||||
|
cherry-pick id:"A" tag: ""
|
||||||
|
commit id:"THREE"
|
||||||
|
checkout develop
|
||||||
|
commit id:"C"
|
||||||
|
`,
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
});
|
||||||
it('11: should render a simple gitgraph with two cherry pick commit', () => {
|
it('11: should render a simple gitgraph with two cherry pick commit', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@@ -207,48 +248,48 @@ describe('Git Graph diagram', () => {
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('12: should render commits for more than 8 branches', () => {
|
it('12: should render commits for more than 8 branches', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
gitGraph
|
gitGraph
|
||||||
checkout main
|
checkout main
|
||||||
commit
|
%% Make sure to manually set the ID of all commits, for consistent visual tests
|
||||||
|
commit id: "1-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
branch branch1
|
branch branch1
|
||||||
commit
|
commit id: "2-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch1
|
merge branch1
|
||||||
branch branch2
|
branch branch2
|
||||||
commit
|
commit id: "3-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch2
|
merge branch2
|
||||||
branch branch3
|
branch branch3
|
||||||
commit
|
commit id: "4-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch3
|
merge branch3
|
||||||
branch branch4
|
branch branch4
|
||||||
commit
|
commit id: "5-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch4
|
merge branch4
|
||||||
branch branch5
|
branch branch5
|
||||||
commit
|
commit id: "6-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch5
|
merge branch5
|
||||||
branch branch6
|
branch branch6
|
||||||
commit
|
commit id: "7-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch6
|
merge branch6
|
||||||
branch branch7
|
branch branch7
|
||||||
commit
|
commit id: "8-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch7
|
merge branch7
|
||||||
branch branch8
|
branch branch8
|
||||||
commit
|
commit id: "9-abcdefg"
|
||||||
checkout main
|
checkout main
|
||||||
merge branch8
|
merge branch8
|
||||||
branch branch9
|
branch branch9
|
||||||
commit
|
commit id: "10-abcdefg"
|
||||||
`,
|
`,
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import mermaid from '../../dist/mermaid.core';
|
import mermaid from '../../packages/mermaid/src/mermaid';
|
||||||
|
|
||||||
let code = `flowchart LR
|
let code = `flowchart LR
|
||||||
Power_Supply --> Transmitter_A
|
Power_Supply --> Transmitter_A
|
||||||
|
@@ -13,42 +13,42 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
FunctionTest1-->URLTest1
|
||||||
click Function clickByFlow "Add a div"
|
click FunctionTest1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URLTest1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
Function-->URL
|
FunctionTest2-->URLTest2
|
||||||
click Function clickByFlow "Add a div"
|
click FunctionTest2 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click URLTest2 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
1Function--->2URL
|
10Function--->20URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 10Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click 20URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
@@ -95,31 +95,31 @@
|
|||||||
Add another diagram to demo page : 48h
|
Add another diagram to demo page : 48h
|
||||||
</pre>
|
</pre>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
FunctionArg-->URL
|
FunctionArgTest2-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArgTest2 call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
FunctionArg-->URL
|
2FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click 2FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
@@ -9,15 +9,15 @@
|
|||||||
<body>
|
<body>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function1-->URL1
|
||||||
click Function clickByFlow "Add a div"
|
click Function1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function-->2URL
|
1Function-->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
Visit mermaidjs :active, cl1, 2014-01-07,2014-01-10
|
||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt("test", test, test)
|
click cl2 call clickByGantt("test", test, test)
|
||||||
|
|
||||||
section Last section
|
section Last section
|
||||||
|
@@ -17,38 +17,38 @@
|
|||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function-->URL
|
||||||
click Function clickByFlow "Add a div"
|
click Function clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
Function-->URL
|
Function-->URL
|
||||||
click Function clickByFlow "Add a div"
|
click Function clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
1Function--->2URL
|
1Function--->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>" _self
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>" _self
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
callback ShapeCallback2 "clickByClass" "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
@@ -99,19 +99,19 @@
|
|||||||
graph TB
|
graph TB
|
||||||
FunctionArg-->URL
|
FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
flowchart TB
|
flowchart TB
|
||||||
FunctionArg-->URL
|
FunctionArg-->URL
|
||||||
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
click FunctionArg call clickByFlowArg(ARGUMENT) "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
class ShapeLink
|
class ShapeLink
|
||||||
link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback
|
class ShapeCallback
|
||||||
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
classDiagram-v2
|
classDiagram-v2
|
||||||
class ShapeLink2
|
class ShapeLink2
|
||||||
link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link"
|
link ShapeLink2 "http://localhost:9000/empty.html" "This is a tooltip for a link"
|
||||||
class ShapeCallback2
|
class ShapeCallback2
|
||||||
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
click ShapeCallback2 call clickByClass(123) "This is a tooltip for a callback"
|
||||||
</pre>
|
</pre>
|
||||||
|
@@ -9,15 +9,15 @@
|
|||||||
<body>
|
<body>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
Function-->URL
|
Function1-->URL1
|
||||||
click Function clickByFlow "Add a div"
|
click Function1 clickByFlow "Add a div"
|
||||||
click URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click URL1 "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="FirstLine" class="mermaid">
|
<pre id="FirstLine" class="mermaid">
|
||||||
graph TB
|
graph TB
|
||||||
1Function-->2URL
|
1Function-->2URL
|
||||||
click 1Function clickByFlow "Add a div"
|
click 1Function clickByFlow "Add a div"
|
||||||
click 2URL "http://localhost:9000/webpackUsage.html" "Visit <strong>mermaid docs</strong>"
|
click 2URL "http://localhost:9000/empty.html" "Visit <strong>mermaid docs</strong>"
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
Calling a Callback (look at the console log) :cl2, after cl1, 3d
|
||||||
Calling a Callback with args :cl3, after cl1, 3d
|
Calling a Callback with args :cl3, after cl1, 3d
|
||||||
|
|
||||||
click cl1 href "http://localhost:9000/webpackUsage.html"
|
click cl1 href "http://localhost:9000/empty.html"
|
||||||
click cl2 call clickByGantt()
|
click cl2 call clickByGantt()
|
||||||
click cl3 call clickByGantt("test1", test2, test3)
|
click cl3 call clickByGantt("test1", test2, test3)
|
||||||
|
|
||||||
|
@@ -1,92 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
|
||||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
|
||||||
/>
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
/* background: rgb(221, 208, 208); */
|
|
||||||
/* background:#333; */
|
|
||||||
font-family: 'Arial';
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
width: 100%;
|
|
||||||
/* display: flex; */
|
|
||||||
/* flex-direction: column; */
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
.mermaid2,
|
|
||||||
.mermaid3 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.mermaid {
|
|
||||||
}
|
|
||||||
.mermaid svg {
|
|
||||||
border: 1px solid purple;
|
|
||||||
/* font-size: 18px !important; */
|
|
||||||
/* fontfamily: 'courier'; */
|
|
||||||
}
|
|
||||||
#cy {
|
|
||||||
width: 300px;
|
|
||||||
height: 300px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="cy"></div>
|
|
||||||
<pre class="mermaid" style="width: 50%">
|
|
||||||
flowchart TD
|
|
||||||
id1 --> id2--> id3[I am number 3 and I<br/>am a gigantic node<br/>am a gigantic node<br/>am a gigantic node<br/>am a gigantic node<br/>am a gigantic node]--> id4--> id5 --> id1
|
|
||||||
id5 --> id4
|
|
||||||
id5 --> id4
|
|
||||||
</pre>
|
|
||||||
<pre class="mermaid2" style="width: 50%">
|
|
||||||
flowchart TD
|
|
||||||
id1 --> id2--> id3
|
|
||||||
id2 --> id1
|
|
||||||
</pre>
|
|
||||||
<script src="./mermaid.js"></script>
|
|
||||||
<script>
|
|
||||||
mermaid.parseError = function (err, hash) {
|
|
||||||
// console.error('Mermaid error: ', err);
|
|
||||||
};
|
|
||||||
mermaid.initialize({
|
|
||||||
maxTextSize: 900000,
|
|
||||||
startOnLoad: true,
|
|
||||||
securityLevel: 'loose',
|
|
||||||
logLevel: 0,
|
|
||||||
fontFamily: 'courier',
|
|
||||||
flowchart: {
|
|
||||||
// curve: 'curveLinear',
|
|
||||||
useMaxWidth: true,
|
|
||||||
htmlLabels: false,
|
|
||||||
fontFamily: 'courier',
|
|
||||||
defaultRenderer: 'cytoscape',
|
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
function callback() {
|
|
||||||
alert('It worked');
|
|
||||||
}
|
|
||||||
|
|
||||||
function clickByFlow(elemName) {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
div.className = 'created-by-click';
|
|
||||||
div.style = 'padding: 20px; background: green; color: white;';
|
|
||||||
div.innerText = 'Clicked By Flow';
|
|
||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<!-- <meta charset="iso-8859-15"/> -->
|
<!-- <meta charset="iso-8859-15"/> -->
|
||||||
<script src="/e2e.js"></script>
|
<script src="./viewer.js" type="module"></script>
|
||||||
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="./mermaid.js"></script>
|
<!-- <script src="./mermaid.js"></script> -->
|
||||||
<script>
|
<script>
|
||||||
// Notice startOnLoad=false
|
// Notice startOnLoad=false
|
||||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
// This prevents default handling in mermaid from render before the e2e logic is applied
|
||||||
|
10
cypress/platform/empty.html
Normal file
10
cypress/platform/empty.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Empty</title>
|
||||||
|
</head>
|
||||||
|
<body></body>
|
||||||
|
</html>
|
@@ -30,7 +30,31 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>info below</h1>
|
<h1>info below</h1>
|
||||||
|
|
||||||
<pre class="mermaid" style="width: 100%; height: 20%">
|
<pre class="mermaid" style="width: 100%; height: 20%">
|
||||||
|
%%{init: { "logLevel": "debug", "theme": "default" , "gitGraph" : {"showBranches":"false","rotateCommitLabel":"true"},"themeVariables": {
|
||||||
|
"gitBranchLabel0": "#ff0000",
|
||||||
|
"gitBranchLabel1": "#00ff00",
|
||||||
|
"gitBranchLabel2": "#0000ff",
|
||||||
|
"git0": "#550055"
|
||||||
|
} } }%%
|
||||||
|
gitGraph
|
||||||
|
commit
|
||||||
|
branch develop
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
branch release/1.0.0
|
||||||
|
checkout release/1.0.0
|
||||||
|
commit tag:"1.0.0-beta1"
|
||||||
|
checkout develop
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
commit
|
||||||
|
checkout release/1.0.0
|
||||||
|
merge develop tag: "1.0.0-beta2"
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid2" style="width: 100%; height: 20%">
|
||||||
%%{init: { "logLevel": "debug", "theme": "default" , "gitGraph" : {"showBranches":"false"},"themeVariables": {
|
%%{init: { "logLevel": "debug", "theme": "default" , "gitGraph" : {"showBranches":"false"},"themeVariables": {
|
||||||
"gitBranchLabel0": "#ff0000",
|
"gitBranchLabel0": "#ff0000",
|
||||||
"gitBranchLabel1": "#00ff00",
|
"gitBranchLabel1": "#00ff00",
|
||||||
@@ -131,6 +155,7 @@
|
|||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 1,
|
logLevel: 1,
|
||||||
|
gitGraph: { rotateCommitLabel: false },
|
||||||
flowchart: { curve: 'linear', htmlLabels: true },
|
flowchart: { curve: 'linear', htmlLabels: true },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
|
@@ -6,6 +6,10 @@
|
|||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
/>
|
/>
|
||||||
|
<link
|
||||||
|
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
@@ -39,6 +43,18 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid2" style="width: 50%">
|
||||||
|
flowchart LR
|
||||||
|
subgraph one
|
||||||
|
direction LR
|
||||||
|
A[myClass1] --> B[default]
|
||||||
|
subgraph two
|
||||||
|
direction BT
|
||||||
|
C[myClass2] --> D[default]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
<pre class="mermaid2" style="width: 50%">
|
||||||
flowchart LR
|
flowchart LR
|
||||||
classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px;
|
classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px;
|
||||||
classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px;
|
classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px;
|
||||||
@@ -71,12 +87,34 @@ flowchart TD
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
</pre>
|
</pre>
|
||||||
--> id2 --> id3(I have a long text) --> id4 --> id5 --> id1
|
<pre class="mermaid2" style="width: 50%">
|
||||||
<pre class="mermaid" style="width: 50%">
|
|
||||||
flowchart TD
|
flowchart TD
|
||||||
id1
|
|
||||||
|
release-branch[Create Release Branch]:::relClass
|
||||||
|
develop-branch[Update Develop Branch]:::relClass
|
||||||
|
github-release-draft[GitHub Release Draft]:::relClass
|
||||||
|
trigger-pipeline[Trigger Jenkins pipeline]:::fixClass
|
||||||
|
github-release[GitHub Release]:::postClass
|
||||||
|
|
||||||
|
build-ready --> release-branch
|
||||||
|
build-ready --> develop-branch
|
||||||
|
release-branch --> jenkins-release-build
|
||||||
|
jenkins-release-build --> github-release-draft
|
||||||
|
jenkins-release-build --> install-release
|
||||||
|
install-release --> verify-release
|
||||||
|
jenkins-release-build --> announce
|
||||||
|
github-release-draft --> github-release
|
||||||
|
verify-release --> verify-check
|
||||||
|
verify-check -- Yes --> github-release
|
||||||
|
verify-check -- No --> release-fix
|
||||||
|
release-fix --> release-branch-pr
|
||||||
|
verify-check -- No --> delete-artifacts
|
||||||
|
release-branch-pr --> trigger-pipeline
|
||||||
|
delete-artifacts --> trigger-pipeline
|
||||||
|
trigger-pipeline --> jenkins-release-build
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="cy" style="width: 50%"></pre>
|
|
||||||
<pre class="mermaid2" style="width: 50%">
|
<pre class="mermaid2" style="width: 50%">
|
||||||
flowchart LR
|
flowchart LR
|
||||||
a["<strong>Haiya</strong>"]===>b
|
a["<strong>Haiya</strong>"]===>b
|
||||||
@@ -329,6 +367,7 @@ flowchart TD
|
|||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<!-- <script src="./mermaid.js"></script> -->
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
@@ -345,9 +384,8 @@ flowchart TD
|
|||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
htmlLabels: false,
|
htmlLabels: false,
|
||||||
fontFamily: 'courier',
|
fontFamily: 'courier',
|
||||||
defaultRenderer: 'cytoscape',
|
|
||||||
// defaultRenderer: 'dagre-wrapper',
|
|
||||||
},
|
},
|
||||||
|
lazyLoadedDiagrams: ['./mermaid-mindmap-detector.js'],
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
@@ -361,6 +399,11 @@ flowchart TD
|
|||||||
|
|
||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -6,6 +6,10 @@
|
|||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
/>
|
/>
|
||||||
|
<link
|
||||||
|
href="https://cdn.jsdelivr.net/npm/@mdi/font@6.9.96/css/materialdesignicons.min.css"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
@@ -25,6 +29,12 @@
|
|||||||
}
|
}
|
||||||
.mermaid svg {
|
.mermaid svg {
|
||||||
/* font-size: 18px !important; */
|
/* font-size: 18px !important; */
|
||||||
|
background-color: #eee;
|
||||||
|
background-image: radial-gradient(#fff 1%, transparent 11%),
|
||||||
|
radial-gradient(#fff 1%, transparent 11%);
|
||||||
|
background-size: 20px 20px;
|
||||||
|
background-position: 0 0, 10px 10px;
|
||||||
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
.malware {
|
.malware {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -45,32 +55,72 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>Security check</div>
|
<div>Security check</div>
|
||||||
<div class="flex">
|
<pre id="diagram" class="mermaid">
|
||||||
<pre id="diagram" class="mermaid">
|
classDiagram
|
||||||
sequenceDiagram
|
direction LR
|
||||||
Nothing:Valid;
|
class Student {
|
||||||
</pre>
|
-idCard : IdCard
|
||||||
<div id="res" class=""></div>
|
}
|
||||||
</div>
|
class IdCard{
|
||||||
|
-id : int
|
||||||
|
-name : string
|
||||||
|
}
|
||||||
|
class Bike{
|
||||||
|
-id : int
|
||||||
|
-name : string
|
||||||
|
}
|
||||||
|
Student "1" --o "1" IdCard : carries
|
||||||
|
Student "1" --o "1" Bike : rides
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
root
|
||||||
|
child1((Circle))
|
||||||
|
grandchild 1
|
||||||
|
grandchild 2
|
||||||
|
child2(Round rectangle)
|
||||||
|
grandchild 3
|
||||||
|
grandchild 4
|
||||||
|
child3[Square]
|
||||||
|
grandchild 5
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
gc6((grand<br/>child 6))
|
||||||
|
::icon(mdi mdi-fire)
|
||||||
|
gc7((grand<br/>grand<br/>child 8))
|
||||||
|
</pre>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
example-diagram
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<!-- <div id="cy"></div> -->
|
||||||
|
<!-- <script src="http://localhost:9000/packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script> -->
|
||||||
|
<!-- <script src="./mermaid-example-diagram-detector.js"></script> -->
|
||||||
|
<!-- <script src="//cdn.jsdelivr.net/npm/mermaid@9.1.7/dist/mermaid.min.js"></script> -->
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
mermaid.parseError = function (err, hash) {
|
mermaid.parseError = function (err, hash) {
|
||||||
// console.error('Mermaid error: ', err);
|
// console.error('Mermaid error: ', err);
|
||||||
};
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
startOnLoad: false,
|
theme: 'forest',
|
||||||
// themeVariables: {relationLabelColor: 'red'}
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
// basePath: './packages/',
|
||||||
|
// themeVariables: { darkMode: true },
|
||||||
|
lazyLoadedDiagrams: [
|
||||||
|
'./mermaid-mindmap-detector.esm.mjs',
|
||||||
|
'./mermaid-example-diagram-detector.esm.mjs',
|
||||||
|
],
|
||||||
|
// lazyLoadedDiagrams: ['../../mermaid-mindmap/registry.ts'],
|
||||||
});
|
});
|
||||||
function callback() {
|
function callback() {
|
||||||
alert('It worked');
|
alert('It worked');
|
||||||
}
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
// document.querySelector('#diagram').innerHTML = diagram;
|
console.error('In parse error:');
|
||||||
try {
|
console.error(err);
|
||||||
mermaid.initThrowsErrors(undefined, '#diagram');
|
};
|
||||||
} catch (err) {
|
|
||||||
console.log('Caught error:', err);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
82
cypress/platform/per.html
Normal file
82
cypress/platform/per.html
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||||
|
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
/* background: rgb(221, 208, 208); */
|
||||||
|
/* background:#333; */
|
||||||
|
font-family: 'Arial';
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
.mermaid2 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.mermaid svg {
|
||||||
|
/* font-size: 18px !important; */
|
||||||
|
}
|
||||||
|
.malware {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 150px;
|
||||||
|
background: red;
|
||||||
|
color: black;
|
||||||
|
display: flex;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 72px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>Security check</div>
|
||||||
|
<pre id="diagram" class="mermaid">
|
||||||
|
flowchart LR
|
||||||
|
A-->B
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<pre id="diagram" class="mermaid2">
|
||||||
|
mindmap
|
||||||
|
root
|
||||||
|
ch1
|
||||||
|
ch2
|
||||||
|
</pre
|
||||||
|
>
|
||||||
|
<script src="./packages/mermaid-mindmap/dist/mermaid-mindmap-detector.js"></script>
|
||||||
|
<script src="./packages/mermaid-mindmap/dist/mermaid-example-diagram-detector.js"></script>
|
||||||
|
<script src="./packages/mermaid/dist/mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
|
mermaid.initialize({
|
||||||
|
startOnLoad: true,
|
||||||
|
logLevel: 0,
|
||||||
|
basePath: './packages/',
|
||||||
|
// themeVariables: {relationLabelColor: 'red'}
|
||||||
|
});
|
||||||
|
function callback() {
|
||||||
|
alert('It worked');
|
||||||
|
}
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
console.error('In parse error:');
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -14,7 +14,6 @@
|
|||||||
mermaid.init({ startOnLoad: false });
|
mermaid.init({ startOnLoad: false });
|
||||||
|
|
||||||
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
mermaid.mermaidAPI.initialize({ securityLevel: 'strict' });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('rendering');
|
console.log('rendering');
|
||||||
mermaid.mermaidAPI.render('graphDiv', `>`);
|
mermaid.mermaidAPI.render('graphDiv', `>`);
|
||||||
|
@@ -17,9 +17,9 @@
|
|||||||
rerender('XMas');
|
rerender('XMas');
|
||||||
|
|
||||||
function rerender(text) {
|
function rerender(text) {
|
||||||
var graphText = `graph TD
|
const graphText = `graph TD
|
||||||
A[${text}] -->|Get money| B(Go shopping)`;
|
A[${text}] -->|Get money| B(Go shopping)`;
|
||||||
var graph = mermaid.mermaidAPI.render('id', graphText);
|
const graph = mermaid.mermaidAPI.render('id', graphText);
|
||||||
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
console.log('\x1b[35m%s\x1b[0m', '>> graph', graph);
|
||||||
document.getElementById('graph').innerHTML = graph;
|
document.getElementById('graph').innerHTML = graph;
|
||||||
}
|
}
|
||||||
|
14
cypress/platform/sidv.html
Normal file
14
cypress/platform/sidv.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<pre class="mermaid">
|
||||||
|
none
|
||||||
|
hello world
|
||||||
|
</pre>
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
mermaid.initialize({
|
||||||
|
logLevel: 1,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1,16 +1,20 @@
|
|||||||
import { Base64 } from 'js-base64';
|
import mermaid2 from '../../packages/mermaid/src/mermaid';
|
||||||
import mermaid2 from '../../src/mermaid';
|
|
||||||
|
function b64ToUtf8(str) {
|
||||||
|
return decodeURIComponent(escape(window.atob(str)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
* ##contentLoaded Callback function that is called when page is loaded. This functions fetches
|
||||||
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the page.
|
* configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the
|
||||||
|
* page.
|
||||||
*/
|
*/
|
||||||
const contentLoaded = function () {
|
const contentLoaded = function () {
|
||||||
let pos = document.location.href.indexOf('?graph=');
|
let pos = document.location.href.indexOf('?graph=');
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
pos = pos + 7;
|
pos = pos + 7;
|
||||||
const graphBase64 = document.location.href.substr(pos);
|
const graphBase64 = document.location.href.substr(pos);
|
||||||
const graphObj = JSON.parse(Base64.decode(graphBase64));
|
const graphObj = JSON.parse(b64ToUtf8(graphBase64));
|
||||||
if (graphObj.mermaid && graphObj.mermaid.theme === 'dark') {
|
if (graphObj.mermaid && graphObj.mermaid.theme === 'dark') {
|
||||||
document.body.style.background = '#3f3f3f';
|
document.body.style.background = '#3f3f3f';
|
||||||
}
|
}
|
||||||
@@ -32,8 +36,10 @@ const contentLoaded = function () {
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
global.mermaid.initialize(graphObj.mermaid);
|
graphObj.mermaid.lazyLoadedDiagrams = ['/mermaid-mindmap-detector.esm.mjs'];
|
||||||
global.mermaid.init();
|
|
||||||
|
mermaid2.initialize(graphObj.mermaid);
|
||||||
|
mermaid2.init();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,7 +72,7 @@ const contentLoadedApi = function () {
|
|||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
pos = pos + 7;
|
pos = pos + 7;
|
||||||
const graphBase64 = document.location.href.substr(pos);
|
const graphBase64 = document.location.href.substr(pos);
|
||||||
const graphObj = JSON.parse(Base64.decode(graphBase64));
|
const graphObj = JSON.parse(b64ToUtf8(graphBase64));
|
||||||
// const graph = 'hello'
|
// const graph = 'hello'
|
||||||
if (Array.isArray(graphObj.code)) {
|
if (Array.isArray(graphObj.code)) {
|
||||||
const numCodes = graphObj.code.length;
|
const numCodes = graphObj.code.length;
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="graph-to-be"></div>
|
<div id="graph-to-be"></div>
|
||||||
<script src="./bundle-test.js" charset="utf-8"></script>
|
<script type="module" charset="utf-8">
|
||||||
|
import './bundle-test.js';
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="/e2e.js"></script>
|
<script src="./viewer.js" type="module"></script>
|
||||||
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
||||||
<style>
|
<style>
|
||||||
.malware {
|
.malware {
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'classDiagram\n';
|
let diagram = 'classDiagram\n';
|
||||||
diagram += 'class Square~<img/src';
|
diagram += 'class Square~<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>~{\n";
|
diagram += "='1'/onerror=xssAttack()>~{\n";
|
||||||
diagram += 'id A\n';
|
diagram += 'id A\n';
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 's2 : This is a state description<img/src';
|
diagram += 's2 : This is a state description<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 's2 : A<img/src';
|
diagram += 's2 : A<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += 'if_state --> False: if n < 0<img/src';
|
diagram += 'if_state --> False: if n < 0<img/src';
|
||||||
diagram += "='1'/onerror=xssAttack()>";
|
diagram += "='1'/onerror=xssAttack()>";
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'classDiagram\n';
|
let diagram = 'classDiagram\n';
|
||||||
diagram += 'classA <-- classB : <ifr';
|
diagram += 'classA <-- classB : <ifr';
|
||||||
diagram += "ame/srcdoc='<scr";
|
diagram += "ame/srcdoc='<scr";
|
||||||
diagram += 'ipt>parent.xssAttack(`XSS`)</';
|
diagram += 'ipt>parent.xssAttack(`XSS`)</';
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `sequenceDiagram
|
let diagram = `sequenceDiagram
|
||||||
participant John
|
participant John
|
||||||
links John: {"XSS": "javas`;
|
links John: {"XSS": "javas`;
|
||||||
diagram += `cript:alert('AudioParam')"}`;
|
diagram += `cript:alert('AudioParam')"}`;
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `sequenceDiagram
|
let diagram = `sequenceDiagram
|
||||||
participant Alice
|
participant Alice
|
||||||
links Alice: { "Click me!" : "javasjavascript:cript:alert('goose')" }`;
|
links Alice: { "Click me!" : "javasjavascript:cript:alert('goose')" }`;
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `sequenceDiagram
|
let diagram = `sequenceDiagram
|
||||||
participant Alice
|
participant Alice
|
||||||
link Alice: Click Me!@javasjavascript:cript:alert("goose")`;
|
link Alice: Click Me!@javasjavascript:cript:alert("goose")`;
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `classDiagram
|
let diagram = `classDiagram
|
||||||
Class "<img/src='x'/onerror=xssAttack(1)>" <--> "<img/src='x'/onerror=xssAttack(2)>" C2: Cool label`;
|
Class "<img/src='x'/onerror=xssAttack(1)>" <--> "<img/src='x'/onerror=xssAttack(2)>" C2: Cool label`;
|
||||||
|
|
||||||
// // var diagram = "stateDiagram-v2\n";
|
// // var diagram = "stateDiagram-v2\n";
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = `classDiagram
|
let diagram = `classDiagram
|
||||||
class Shape{
|
class Shape{
|
||||||
<<<img/src='1'/`;
|
<<<img/src='1'/`;
|
||||||
|
|
||||||
|
@@ -54,9 +54,9 @@
|
|||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
});
|
});
|
||||||
var cnt = 0;
|
let cnt = 0;
|
||||||
var a;
|
let a;
|
||||||
var handler = setInterval(() => {
|
const handler = setInterval(() => {
|
||||||
cnt++;
|
cnt++;
|
||||||
a = {};
|
a = {};
|
||||||
if (typeof a.polluted !== 'undefined') {
|
if (typeof a.polluted !== 'undefined') {
|
||||||
|
@@ -96,7 +96,7 @@
|
|||||||
// var diagram = ` graph TD
|
// var diagram = ` graph TD
|
||||||
// A --> B["<a href='javasc`;
|
// A --> B["<a href='javasc`;
|
||||||
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
||||||
var diagram = ` graph TD
|
let diagram = ` graph TD
|
||||||
A --> B["<a href='javasc`;
|
A --> B["<a href='javasc`;
|
||||||
diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
@@ -96,7 +96,7 @@
|
|||||||
// var diagram = ` graph TD
|
// var diagram = ` graph TD
|
||||||
// A --> B["<a href='javasc`;
|
// A --> B["<a href='javasc`;
|
||||||
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
// diagram += `ript#colon;xssAttack()'>AAA</a>"]`;
|
||||||
var diagram = ` graph TD
|
let diagram = ` graph TD
|
||||||
A --> B["<a href='javasc`;
|
A --> B["<a href='javasc`;
|
||||||
diagram += `ript#9;t#colon;xssAttack()'>AAA</a>"]`;
|
diagram += `ript#9;t#colon;xssAttack()'>AAA</a>"]`;
|
||||||
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
// diagram += '//via.placeholder.com/64\' width=64 />"]';
|
||||||
|
@@ -42,9 +42,9 @@
|
|||||||
startOnLoad: true,
|
startOnLoad: true,
|
||||||
useMaxWidth: true,
|
useMaxWidth: true,
|
||||||
});
|
});
|
||||||
var cnt = 0;
|
let cnt = 0;
|
||||||
var a;
|
let a;
|
||||||
var handler = setInterval(() => {
|
const handler = setInterval(() => {
|
||||||
cnt++;
|
cnt++;
|
||||||
a = {};
|
a = {};
|
||||||
if (typeof a.polluted !== 'undefined') {
|
if (typeof a.polluted !== 'undefined') {
|
||||||
|
@@ -85,7 +85,7 @@
|
|||||||
alert('It worked');
|
alert('It worked');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = '%%{init: {"flowchart": {"htmlLabels": "true"}} }%%\n';
|
let diagram = '%%{init: {"flowchart": {"htmlLabels": "true"}} }%%\n';
|
||||||
diagram += 'flowchart\n';
|
diagram += 'flowchart\n';
|
||||||
diagram += 'A["<ifra';
|
diagram += 'A["<ifra';
|
||||||
diagram += "me srcdoc='<scrip";
|
diagram += "me srcdoc='<scrip";
|
||||||
|
@@ -92,7 +92,7 @@
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
var diagram = 'graph LR\n';
|
let diagram = 'graph LR\n';
|
||||||
diagram += 'B-->D("<img onerror=location=`java';
|
diagram += 'B-->D("<img onerror=location=`java';
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
diagram += 'script\x3a;xssAttack\u0028\u0029` src=x>");\n';
|
diagram += 'script\x3a;xssAttack\u0028\u0029` src=x>");\n';
|
||||||
|
@@ -92,7 +92,7 @@
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
var diagram = 'graph LR\n';
|
let diagram = 'graph LR\n';
|
||||||
diagram += 'A(<img/src/onerror=xssAttack`1`>)';
|
diagram += 'A(<img/src/onerror=xssAttack`1`>)';
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
|
@@ -92,7 +92,7 @@
|
|||||||
document.getElementsByTagName('body')[0].appendChild(div);
|
document.getElementsByTagName('body')[0].appendChild(div);
|
||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
var diagram = 'graph LR\n';
|
let diagram = 'graph LR\n';
|
||||||
diagram += " B(<a href='<";
|
diagram += " B(<a href='<";
|
||||||
diagram += 'script></';
|
diagram += 'script></';
|
||||||
diagram += "script>Javascript:xssAttack`1`'>Click)";
|
diagram += "script>Javascript:xssAttack`1`'>Click)";
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
|
@@ -93,7 +93,7 @@
|
|||||||
throw new Error('XSS Succeeded');
|
throw new Error('XSS Succeeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var diagram = 'stateDiagram-v2\n';
|
let diagram = 'stateDiagram-v2\n';
|
||||||
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
diagram += "<img/src='1'/onerror=xssAttack()> --> B";
|
||||||
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
// diagram += "script\u003aalert\u0028document.domain\u0029\` src=x>\"\);\n";
|
||||||
console.log(diagram);
|
console.log(diagram);
|
||||||
|
@@ -1,33 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
// ***********************************************************
|
|
||||||
// This example plugins/index.js can be used to load plugins
|
|
||||||
//
|
|
||||||
// You can change the location of this file or turn off loading
|
|
||||||
// the plugins file with the 'pluginsFile' configuration option.
|
|
||||||
//
|
|
||||||
// You can read more here:
|
|
||||||
// https://on.cypress.io/plugins-guide
|
|
||||||
// ***********************************************************
|
|
||||||
|
|
||||||
// This function is called when a project is opened or re-opened (e.g. due to
|
|
||||||
// the project's config changing)
|
|
||||||
|
|
||||||
// module.exports = (on, config) => {
|
|
||||||
// // `on` is used to hook into various events Cypress emits
|
|
||||||
// // `config` is the resolved Cypress config
|
|
||||||
// }
|
|
||||||
|
|
||||||
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
|
||||||
require('@applitools/eyes-cypress')(module);
|
|
||||||
|
|
||||||
module.exports = (on, config) => {
|
|
||||||
addMatchImageSnapshotPlugin(on, config);
|
|
||||||
// copy any needed variables from process.env to config.env
|
|
||||||
config.env.useAppli = process.env.USE_APPLI ? true : false;
|
|
||||||
config.env.codeBranch = process.env.APPLI_BRANCH;
|
|
||||||
|
|
||||||
// do not forget to return the changed config object!
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
|
|
||||||
require('@applitools/eyes-cypress')(module);
|
|
@@ -17,8 +17,6 @@ import '@applitools/eyes-cypress/commands';
|
|||||||
|
|
||||||
// Import commands.js using ES2015 syntax:
|
// Import commands.js using ES2015 syntax:
|
||||||
import './commands';
|
import './commands';
|
||||||
// import '@percy/cypress';
|
|
||||||
import '@applitools/eyes-cypress/commands';
|
|
||||||
|
|
||||||
// Alternatively you can use CommonJS syntax:
|
// Alternatively you can use CommonJS syntax:
|
||||||
// require('./commands')
|
// require('./commands')
|
303
demos/c4context.html
Normal file
303
demos/c4context.html
Normal file
@@ -0,0 +1,303 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<title>C4 Mermaid Quick Test Page</title>
|
||||||
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
|
<style>
|
||||||
|
div.mermaid {
|
||||||
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
||||||
|
/*font-family: 'Courier New', Courier, monospace !important;*/
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>C4 context diagram demos</h1>
|
||||||
|
<pre class="mermaid">
|
||||||
|
C4Context
|
||||||
|
accTitle: C4 context demo
|
||||||
|
accDescr: Many large C4 diagrams
|
||||||
|
|
||||||
|
title System Context diagram for Internet Banking System
|
||||||
|
|
||||||
|
Enterprise_Boundary(b0, "BankBoundary0") {
|
||||||
|
Person(customerA, "Banking Customer A", "A customer of the bank, with personal bank accounts.")
|
||||||
|
Person(customerB, "Banking Customer B")
|
||||||
|
Person_Ext(customerC, "Banking Customer C", "desc")
|
||||||
|
|
||||||
|
Person(customerD, "Banking Customer D", "A customer of the bank, <br/> with personal bank accounts.")
|
||||||
|
|
||||||
|
System(SystemAA, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")
|
||||||
|
|
||||||
|
Enterprise_Boundary(b1, "BankBoundary") {
|
||||||
|
|
||||||
|
SystemDb_Ext(SystemE, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||||
|
|
||||||
|
System_Boundary(b2, "BankBoundary2") {
|
||||||
|
System(SystemA, "Banking System A")
|
||||||
|
System(SystemB, "Banking System B", "A system of the bank, with personal bank accounts. next line.")
|
||||||
|
}
|
||||||
|
|
||||||
|
System_Ext(SystemC, "E-mail system", "The internal Microsoft Exchange e-mail system.")
|
||||||
|
SystemDb(SystemD, "Banking System D Database", "A system of the bank, with personal bank accounts.")
|
||||||
|
|
||||||
|
Boundary(b3, "BankBoundary3", "boundary") {
|
||||||
|
SystemQueue(SystemF, "Banking System F Queue", "A system of the bank.")
|
||||||
|
SystemQueue_Ext(SystemG, "Banking System G Queue", "A system of the bank, with personal bank accounts.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BiRel(customerA, SystemAA, "Uses")
|
||||||
|
BiRel(SystemAA, SystemE, "Uses")
|
||||||
|
Rel(SystemAA, SystemC, "Sends e-mails", "SMTP")
|
||||||
|
Rel(SystemC, customerA, "Sends e-mails to")
|
||||||
|
|
||||||
|
UpdateElementStyle(customerA, $fontColor="red", $bgColor="grey", $borderColor="red")
|
||||||
|
UpdateRelStyle(customerA, SystemAA, $textColor="blue", $lineColor="blue", $offsetX="5")
|
||||||
|
UpdateRelStyle(SystemAA, SystemE, $textColor="blue", $lineColor="blue", $offsetY="-10")
|
||||||
|
UpdateRelStyle(SystemAA, SystemC, $textColor="blue", $lineColor="blue", $offsetY="-40", $offsetX="-50")
|
||||||
|
UpdateRelStyle(SystemC, customerA, $textColor="red", $lineColor="red", $offsetX="-50", $offsetY="20")
|
||||||
|
|
||||||
|
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
C4Container
|
||||||
|
title Container diagram for Internet Banking System
|
||||||
|
|
||||||
|
System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system", $tags="v1.0")
|
||||||
|
Person(customer, Customer, "A customer of the bank, with personal bank accounts", $tags="v1.0")
|
||||||
|
|
||||||
|
Container_Boundary(c1, "Internet Banking") {
|
||||||
|
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser")
|
||||||
|
Container_Ext(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device")
|
||||||
|
Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA")
|
||||||
|
ContainerDb(database, "Database", "SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.")
|
||||||
|
ContainerDb_Ext(backend_api, "API Application", "Java, Docker Container", "Provides Internet banking functionality via API")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
System_Ext(banking_system, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||||
|
|
||||||
|
Rel(customer, web_app, "Uses", "HTTPS")
|
||||||
|
UpdateRelStyle(customer, web_app, $offsetY="60", $offsetX="90")
|
||||||
|
Rel(customer, spa, "Uses", "HTTPS")
|
||||||
|
UpdateRelStyle(customer, spa, $offsetY="-40")
|
||||||
|
Rel(customer, mobile_app, "Uses")
|
||||||
|
UpdateRelStyle(customer, mobile_app, $offsetY="-30")
|
||||||
|
|
||||||
|
Rel(web_app, spa, "Delivers")
|
||||||
|
UpdateRelStyle(web_app, spa, $offsetX="130")
|
||||||
|
Rel(spa, backend_api, "Uses", "async, JSON/HTTPS")
|
||||||
|
Rel(mobile_app, backend_api, "Uses", "async, JSON/HTTPS")
|
||||||
|
Rel_Back(database, backend_api, "Reads from and writes to", "sync, JDBC")
|
||||||
|
|
||||||
|
Rel(email_system, customer, "Sends e-mails to")
|
||||||
|
UpdateRelStyle(email_system, customer, $offsetX="-45")
|
||||||
|
Rel(backend_api, email_system, "Sends e-mails using", "sync, SMTP")
|
||||||
|
UpdateRelStyle(backend_api, email_system, $offsetY="-60")
|
||||||
|
Rel(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS")
|
||||||
|
UpdateRelStyle(backend_api, banking_system, $offsetY="-50", $offsetX="-140")
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
C4Component
|
||||||
|
title Component diagram for Internet Banking System - API Application
|
||||||
|
|
||||||
|
Container(spa, "Single Page Application", "javascript and angular", "Provides all the internet banking functionality to customers via their web browser.")
|
||||||
|
Container(ma, "Mobile App", "Xamarin", "Provides a limited subset ot the internet banking functionality to customers via their mobile mobile device.")
|
||||||
|
ContainerDb(db, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
|
||||||
|
System_Ext(mbs, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
|
||||||
|
|
||||||
|
Container_Boundary(api, "API Application") {
|
||||||
|
Component(sign, "Sign In Controller", "MVC Rest Controller", "Allows users to sign in to the internet banking system")
|
||||||
|
Component(accounts, "Accounts Summary Controller", "MVC Rest Controller", "Provides customers with a summary of their bank accounts")
|
||||||
|
Component(security, "Security Component", "Spring Bean", "Provides functionality related to singing in, changing passwords, etc.")
|
||||||
|
Component(mbsfacade, "Mainframe Banking System Facade", "Spring Bean", "A facade onto the mainframe banking system.")
|
||||||
|
|
||||||
|
Rel(sign, security, "Uses")
|
||||||
|
Rel(accounts, mbsfacade, "Uses")
|
||||||
|
Rel(security, db, "Read & write to", "JDBC")
|
||||||
|
Rel(mbsfacade, mbs, "Uses", "XML/HTTPS")
|
||||||
|
}
|
||||||
|
|
||||||
|
Rel_Back(spa, sign, "Uses", "JSON/HTTPS")
|
||||||
|
Rel(spa, accounts, "Uses", "JSON/HTTPS")
|
||||||
|
|
||||||
|
Rel(ma, sign, "Uses", "JSON/HTTPS")
|
||||||
|
Rel(ma, accounts, "Uses", "JSON/HTTPS")
|
||||||
|
|
||||||
|
UpdateRelStyle(spa, sign, $offsetY="-40")
|
||||||
|
UpdateRelStyle(spa, accounts, $offsetX="40", $offsetY="40")
|
||||||
|
|
||||||
|
UpdateRelStyle(ma, sign, $offsetX="-90", $offsetY="40")
|
||||||
|
UpdateRelStyle(ma, accounts, $offsetY="-40")
|
||||||
|
|
||||||
|
UpdateRelStyle(sign, security, $offsetX="-160", $offsetY="10")
|
||||||
|
UpdateRelStyle(accounts, mbsfacade, $offsetX="140", $offsetY="10")
|
||||||
|
UpdateRelStyle(security, db, $offsetY="-40")
|
||||||
|
UpdateRelStyle(mbsfacade, mbs, $offsetY="-40")
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
C4Dynamic
|
||||||
|
title Dynamic diagram for Internet Banking System - API Application
|
||||||
|
|
||||||
|
ContainerDb(c4, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
|
||||||
|
Container(c1, "Single-Page Application", "JavaScript and Angular", "Provides all of the Internet banking functionality to customers via their web browser.")
|
||||||
|
Container_Boundary(b, "API Application") {
|
||||||
|
Component(c3, "Security Component", "Spring Bean", "Provides functionality Related to signing in, changing passwords, etc.")
|
||||||
|
Component(c2, "Sign In Controller", "Spring MVC Rest Controller", "Allows users to sign in to the Internet Banking System.")
|
||||||
|
}
|
||||||
|
Rel(c1, c2, "Submits credentials to", "JSON/HTTPS")
|
||||||
|
Rel(c2, c3, "Calls isAuthenticated() on")
|
||||||
|
Rel(c3, c4, "select * from users where username = ?", "JDBC")
|
||||||
|
|
||||||
|
UpdateRelStyle(c1, c2, $textColor="red", $offsetY="-40")
|
||||||
|
UpdateRelStyle(c2, c3, $textColor="red", $offsetX="-40", $offsetY="60")
|
||||||
|
UpdateRelStyle(c3, c4, $textColor="red", $offsetY="-40", $offsetX="10")
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
C4Deployment
|
||||||
|
title Deployment Diagram for Internet Banking System - Live
|
||||||
|
|
||||||
|
Deployment_Node(mob, "Customer's mobile device", "Apple IOS or Android"){
|
||||||
|
Container(mobile, "Mobile App", "Xamarin", "Provides a limited subset of the Internet Banking functionality to customers via their mobile device.")
|
||||||
|
}
|
||||||
|
|
||||||
|
Deployment_Node(comp, "Customer's computer", "Mircosoft Windows or Apple macOS"){
|
||||||
|
Deployment_Node(browser, "Web Browser", "Google Chrome, Mozilla Firefox,<br/> Apple Safari or Microsoft Edge"){
|
||||||
|
Container(spa, "Single Page Application", "JavaScript and Angular", "Provides all of the Internet Banking functionality to customers via their web browser.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Deployment_Node(plc, "Big Bank plc", "Big Bank plc data center"){
|
||||||
|
Deployment_Node(dn, "bigbank-api*** x8", "Ubuntu 16.04 LTS"){
|
||||||
|
Deployment_Node(apache, "Apache Tomcat", "Apache Tomcat 8.x"){
|
||||||
|
Container(api, "API Application", "Java and Spring MVC", "Provides Internet Banking functionality via a JSON/HTTPS API.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Deployment_Node(bb2, "bigbank-web*** x4", "Ubuntu 16.04 LTS"){
|
||||||
|
Deployment_Node(apache2, "Apache Tomcat", "Apache Tomcat 8.x"){
|
||||||
|
Container(web, "Web Application", "Java and Spring MVC", "Delivers the static content and the Internet Banking single page application.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Deployment_Node(bigbankdb01, "bigbank-db01", "Ubuntu 16.04 LTS"){
|
||||||
|
Deployment_Node(oracle, "Oracle - Primary", "Oracle 12c"){
|
||||||
|
ContainerDb(db, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Deployment_Node(bigbankdb02, "bigbank-db02", "Ubuntu 16.04 LTS") {
|
||||||
|
Deployment_Node(oracle2, "Oracle - Secondary", "Oracle 12c") {
|
||||||
|
ContainerDb(db2, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rel(mobile, api, "Makes API calls to", "json/HTTPS")
|
||||||
|
Rel(spa, api, "Makes API calls to", "json/HTTPS")
|
||||||
|
Rel_U(web, spa, "Delivers to the customer's web browser")
|
||||||
|
Rel(api, db, "Reads from and writes to", "JDBC")
|
||||||
|
Rel(api, db2, "Reads from and writes to", "JDBC")
|
||||||
|
Rel_R(db, db2, "Replicates data to")
|
||||||
|
|
||||||
|
UpdateRelStyle(spa, api, $offsetY="-40")
|
||||||
|
UpdateRelStyle(web, spa, $offsetY="-40")
|
||||||
|
UpdateRelStyle(api, db, $offsetY="-20", $offsetX="5")
|
||||||
|
UpdateRelStyle(api, db2, $offsetX="-40", $offsetY="-20")
|
||||||
|
UpdateRelStyle(db, db2, $offsetY="-10")
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<script src="./mermaid.js"></script>
|
||||||
|
<script>
|
||||||
|
const ALLOWED_TAGS = [
|
||||||
|
'a',
|
||||||
|
'b',
|
||||||
|
'blockquote',
|
||||||
|
'br',
|
||||||
|
'dd',
|
||||||
|
'div',
|
||||||
|
'dl',
|
||||||
|
'dt',
|
||||||
|
'em',
|
||||||
|
'foreignObject',
|
||||||
|
'h1',
|
||||||
|
'h2',
|
||||||
|
'h3',
|
||||||
|
'h4',
|
||||||
|
'h5',
|
||||||
|
'h6',
|
||||||
|
'h7',
|
||||||
|
'h8',
|
||||||
|
'hr',
|
||||||
|
'i',
|
||||||
|
'li',
|
||||||
|
'ul',
|
||||||
|
'ol',
|
||||||
|
'p',
|
||||||
|
'pre',
|
||||||
|
'span',
|
||||||
|
'strike',
|
||||||
|
'strong',
|
||||||
|
'table',
|
||||||
|
'tbody',
|
||||||
|
'td',
|
||||||
|
'tfoot',
|
||||||
|
'th',
|
||||||
|
'thead',
|
||||||
|
'tr',
|
||||||
|
];
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: 'forest',
|
||||||
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
|
logLevel: 3,
|
||||||
|
securityLevel: 'loose',
|
||||||
|
flowchart: { curve: 'basis' },
|
||||||
|
gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
|
sequence: { actorMargin: 50 },
|
||||||
|
dompurifyConfig: {
|
||||||
|
USE_PROFILES: {
|
||||||
|
svg: true,
|
||||||
|
},
|
||||||
|
ADD_TAGS: ALLOWED_TAGS,
|
||||||
|
ADD_ATTR: ['transform-origin'],
|
||||||
|
},
|
||||||
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
function testClick(nodeId) {
|
||||||
|
console.log('clicked', nodeId);
|
||||||
|
let originalBgColor = document.querySelector('body').style.backgroundColor;
|
||||||
|
document.querySelector('body').style.backgroundColor = 'yellow';
|
||||||
|
setTimeout(function () {
|
||||||
|
document.querySelector('body').style.backgroundColor = originalBgColor;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
const testLineEndings = (test, input) => {
|
||||||
|
try {
|
||||||
|
mermaid.render(test, input, () => {
|
||||||
|
//no-op
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error in %s:\n\n%s', test, err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
testLineEndings('CR', 'graph LR\rsubgraph CR\rA --> B\rend');
|
||||||
|
testLineEndings('LF', 'graph LR\nsubgraph LF\nA --> B\nend');
|
||||||
|
testLineEndings('CRLF', 'graph LR\r\nsubgraph CRLF\r\nA --> B\r\nend');
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<title>Mermaid Quick Test Page</title>
|
<title>Class diagrams Mermaid Quick Test Page</title>
|
||||||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
<style>
|
<style>
|
||||||
div.mermaid {
|
div.mermaid {
|
||||||
@@ -14,36 +14,134 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<h1>Class diagram demos</h1>
|
||||||
|
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
classDiagram
|
classDiagram
|
||||||
title Animal Diagram
|
accTitle: Demo Class Diagram
|
||||||
accDescription The animal class diagram
|
accDescr: This class diagram show the abstract Animal class, and 3 classes that inherit from it: Duck, Fish, and Zebra.
|
||||||
Animal <|-- Duck
|
|
||||||
Animal <|-- Fish
|
Animal <|-- Duck
|
||||||
Animal <|-- Zebra
|
Animal <|-- Fish
|
||||||
Animal : +int age
|
Animal <|-- Zebra
|
||||||
Animal : +String gender
|
Animal : +int age
|
||||||
Animal: +isMammal()
|
Animal : +String gender
|
||||||
Animal: +mate()
|
Animal: +isMammal()
|
||||||
class Duck{
|
Animal: +mate()
|
||||||
+String beakColor
|
|
||||||
+swim()
|
class Duck{
|
||||||
+quack()
|
+String beakColor
|
||||||
}
|
+swim()
|
||||||
class Fish{
|
+quack()
|
||||||
-int sizeInFeet
|
}
|
||||||
-canEat()
|
class Fish{
|
||||||
}
|
-int sizeInFeet
|
||||||
class Zebra{
|
-canEat()
|
||||||
+bool is_wild
|
}
|
||||||
+run()
|
class Zebra{
|
||||||
}
|
+bool is_wild
|
||||||
|
+run()
|
||||||
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
Class01 <|-- AveryLongClass : Cool
|
||||||
|
|
||||||
|
<<interface>> Class01
|
||||||
|
Class03 "0" *-- "0..n" Class04
|
||||||
|
Class05 "1" o-- "many" Class06
|
||||||
|
Class07 .. Class08
|
||||||
|
Class09 "many" --> "1" C2 : Where am i?
|
||||||
|
Class09 "0" --* "1..n" C3
|
||||||
|
Class09 --|> Class07
|
||||||
|
Class07 : equals()
|
||||||
|
Class07 : Object[] elementData
|
||||||
|
Class01 : #size()
|
||||||
|
Class01 : -int chimp
|
||||||
|
Class01 : +int gorilla
|
||||||
|
Class08 <--> C2: Cool label
|
||||||
|
class Class10 {
|
||||||
|
<<service>>
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
class Class01~T~
|
||||||
|
Class01 : #size()
|
||||||
|
Class01 : -int chimp
|
||||||
|
Class01 : +int gorilla
|
||||||
|
class Class10~T~ {
|
||||||
|
<<service>>
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
Class01~T~ <|-- AveryLongClass : Cool
|
||||||
|
<<interface>> Class01
|
||||||
|
Class03~T~ "0" *-- "0..n" Class04
|
||||||
|
Class05 "1" o-- "many" Class06
|
||||||
|
Class07~T~ .. Class08
|
||||||
|
Class09 "many" --> "1" C2 : Where am i?
|
||||||
|
Class09 "0" --* "1..n" C3
|
||||||
|
Class09 --|> Class07
|
||||||
|
Class07 : equals()
|
||||||
|
Class07 : Object[] elementData
|
||||||
|
Class01 : #size()
|
||||||
|
Class01 : -int chimp
|
||||||
|
Class01 : +int gorilla
|
||||||
|
Class08 <--> C2: Cool label
|
||||||
|
class Class10 {
|
||||||
|
<<service>>
|
||||||
|
int id
|
||||||
|
size()
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
Interface1 ()-- Interface1Impl
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
direction LR
|
||||||
|
Animal ()-- Dog
|
||||||
|
Dog : bark()
|
||||||
|
Dog : species()
|
||||||
|
</pre>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<pre class="mermaid">
|
||||||
|
classDiagram
|
||||||
|
direction RL
|
||||||
|
Fruit ()-- Apple
|
||||||
|
Apple : color()
|
||||||
|
Apple : -int leafCount()
|
||||||
|
Fruit ()-- Pineapple
|
||||||
|
Pineapple : color()
|
||||||
|
Pineapple : -int leafCount()
|
||||||
|
Pineapple : -int spikeCount()
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'forest',
|
theme: 'default',
|
||||||
// themeCSS: '.node rect { fill: red; }',
|
// themeCSS: '.node rect { fill: red; }',
|
||||||
logLevel: 3,
|
logLevel: 3,
|
||||||
securityLevel: 'loose',
|
securityLevel: 'loose',
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<title>Mermaid Quick Test Page</title>
|
<title>Data Flow Mermaid Quick Test Page</title>
|
||||||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
<style>
|
<style>
|
||||||
div.mermaid {
|
div.mermaid {
|
||||||
@@ -13,12 +13,16 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h2>Data Flow Diagram Example</h2>
|
<h1>Data Flow Diagram demos</h1>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart LR
|
flowchart LR
|
||||||
|
accTitle: A simple linear flowchart.
|
||||||
|
accDescr: A Database has input to a circle System has output to a square Customer.
|
||||||
DataStore[|borders:tb|Database] -->|input| Process((System)) -->|output| Entity[Customer];
|
DataStore[|borders:tb|Database] -->|input| Process((System)) -->|output| Entity[Customer];
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<h2>Borders Example</h2>
|
<h2>Borders Example</h2>
|
||||||
<pre class="mermaid">
|
<pre class="mermaid">
|
||||||
flowchart TD
|
flowchart TD
|
||||||
@@ -42,7 +46,7 @@
|
|||||||
<script>
|
<script>
|
||||||
function testClick(nodeId) {
|
function testClick(nodeId) {
|
||||||
console.log('clicked', nodeId);
|
console.log('clicked', nodeId);
|
||||||
var originalBgColor = document.querySelector('body').style.backgroundColor;
|
let originalBgColor = document.querySelector('body').style.backgroundColor;
|
||||||
document.querySelector('body').style.backgroundColor = 'yellow';
|
document.querySelector('body').style.backgroundColor = 'yellow';
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
document.querySelector('body').style.backgroundColor = originalBgColor;
|
document.querySelector('body').style.backgroundColor = originalBgColor;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user