@zenuml/core 3.47.9 → 3.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/cloud-icons-eHuugVSv.js.map +1 -0
  2. package/dist/zenuml.esm.mjs +2153 -2156
  3. package/dist/zenuml.esm.mjs.map +1 -0
  4. package/dist/zenuml.js +82 -82
  5. package/dist/zenuml.js.map +1 -0
  6. package/package.json +11 -1
  7. package/src/cli/zenuml.ts +1164 -0
  8. package/.agents/skills/babysit-pr/SKILL.md +0 -223
  9. package/.agents/skills/babysit-pr/agents/openai.yaml +0 -7
  10. package/.agents/skills/dia-scoring/SKILL.md +0 -139
  11. package/.agents/skills/dia-scoring/agents/openai.yaml +0 -7
  12. package/.agents/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  13. package/.agents/skills/land-pr/SKILL.md +0 -120
  14. package/.agents/skills/propagate-core-release/SKILL.md +0 -205
  15. package/.agents/skills/propagate-core-release/agents/openai.yaml +0 -7
  16. package/.agents/skills/propagate-core-release/references/downstreams.md +0 -42
  17. package/.agents/skills/ship-branch/SKILL.md +0 -105
  18. package/.agents/skills/submit-branch/SKILL.md +0 -76
  19. package/.agents/skills/validate-branch/SKILL.md +0 -72
  20. package/.claude/commands/README.md +0 -162
  21. package/.claude/commands/analyze.md +0 -101
  22. package/.claude/commands/clarify.md +0 -158
  23. package/.claude/commands/code-review.md +0 -322
  24. package/.claude/commands/constitution.md +0 -73
  25. package/.claude/commands/create-docs.md +0 -309
  26. package/.claude/commands/full-context.md +0 -121
  27. package/.claude/commands/gemini-consult.md +0 -164
  28. package/.claude/commands/handoff.md +0 -146
  29. package/.claude/commands/implement.md +0 -56
  30. package/.claude/commands/plan.md +0 -43
  31. package/.claude/commands/refactor.md +0 -188
  32. package/.claude/commands/specify.md +0 -21
  33. package/.claude/commands/tasks.md +0 -62
  34. package/.claude/commands/update-docs.md +0 -314
  35. package/.claude/hooks/README.md +0 -270
  36. package/.claude/hooks/config/sensitive-patterns.json +0 -86
  37. package/.claude/hooks/gemini-context-injector.sh +0 -129
  38. package/.claude/hooks/mcp-security-scan.sh +0 -147
  39. package/.claude/hooks/notify.sh +0 -103
  40. package/.claude/hooks/setup/hook-setup.md +0 -96
  41. package/.claude/hooks/setup/settings.json.template +0 -63
  42. package/.claude/hooks/sounds/complete.wav +0 -0
  43. package/.claude/hooks/sounds/input-needed.wav +0 -0
  44. package/.claude/hooks/subagent-context-injector.sh +0 -65
  45. package/.claude/skills/babysit-pr/SKILL.md +0 -223
  46. package/.claude/skills/babysit-pr/agents/openai.yaml +0 -7
  47. package/.claude/skills/dia-scoring/SKILL.md +0 -139
  48. package/.claude/skills/dia-scoring/agents/openai.yaml +0 -7
  49. package/.claude/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  50. package/.claude/skills/emoji-eval/SKILL.md +0 -187
  51. package/.claude/skills/land-pr/SKILL.md +0 -120
  52. package/.claude/skills/propagate-core-release/SKILL.md +0 -205
  53. package/.claude/skills/propagate-core-release/agents/openai.yaml +0 -7
  54. package/.claude/skills/propagate-core-release/references/downstreams.md +0 -42
  55. package/.claude/skills/ship-branch/SKILL.md +0 -105
  56. package/.claude/skills/submit-branch/SKILL.md +0 -76
  57. package/.claude/skills/validate-branch/SKILL.md +0 -72
  58. package/.claude/skills/zenuml-ux-research/SKILL.md +0 -183
  59. package/.claude/skills/zenuml-ux-research/references/assertion-catalog.md +0 -261
  60. package/.claude/skills/zenuml-ux-research/references/best-practices-overview.md +0 -56
  61. package/.claude/skills/zenuml-ux-research/references/report-template.md +0 -89
  62. package/.claude/skills/zenuml-ux-research/references/scenarios/edit-message-label.md +0 -37
  63. package/.claude/skills/zenuml-ux-research/references/scenarios/insert-message.md +0 -36
  64. package/.claude/skills/zenuml-ux-research/references/scenarios/insert-participant.md +0 -31
  65. package/.claude/skills/zenuml-ux-research/references/scenarios/rename-participant.md +0 -33
  66. package/.claude/skills/zenuml-ux-research/references/scenarios/undo-insert.md +0 -35
  67. package/.devcontainer/devcontainer.json +0 -21
  68. package/.dockerignore +0 -19
  69. package/.eslintrc.js +0 -39
  70. package/.git-blame-ignore-revs +0 -6
  71. package/.kiro/hooks/README.md +0 -38
  72. package/.kiro/hooks/session-sound-notification.js +0 -44
  73. package/.kiro/hooks/session-sound-notification.json +0 -23
  74. package/.mcp.json.example +0 -17
  75. package/.nvmrc +0 -1
  76. package/.prettierignore +0 -4
  77. package/.prettierrc +0 -1
  78. package/.specify/memory/constitution.md +0 -33
  79. package/.specify/scripts/bash/check-prerequisites.sh +0 -166
  80. package/.specify/scripts/bash/common.sh +0 -113
  81. package/.specify/scripts/bash/create-new-feature.sh +0 -97
  82. package/.specify/scripts/bash/setup-plan.sh +0 -60
  83. package/.specify/scripts/bash/update-agent-context.sh +0 -728
  84. package/.specify/templates/agent-file-template.md +0 -23
  85. package/.specify/templates/plan-template.md +0 -219
  86. package/.specify/templates/spec-template.md +0 -116
  87. package/.specify/templates/tasks-template.md +0 -127
  88. package/.storybook/main.ts +0 -25
  89. package/.storybook/preview.ts +0 -29
  90. package/.watchmanconfig +0 -3
  91. package/AGENTS.md +0 -26
  92. package/CLAUDE.md +0 -124
  93. package/DEPLOYMENT.md +0 -62
  94. package/Dockerfile +0 -36
  95. package/IMPLEMENTATION_PLAN.md +0 -163
  96. package/Integration/vanilla-js/index.html +0 -42
  97. package/MCP-ASSISTANT-RULES.md +0 -85
  98. package/README_CN.md +0 -15
  99. package/TUTORIAL.md +0 -116
  100. package/antlr/antlr-4.11.1-complete.jar +0 -0
  101. package/bun.lock +0 -1544
  102. package/bunfig.toml +0 -52
  103. package/docs/UNICODE_SUPPORT.md +0 -179
  104. package/docs/ai-context/deployment-infrastructure.md +0 -21
  105. package/docs/ai-context/docs-overview.md +0 -89
  106. package/docs/ai-context/handoff.md +0 -174
  107. package/docs/ai-context/project-structure.md +0 -160
  108. package/docs/ai-context/system-integration.md +0 -21
  109. package/docs/asciidoc/contributor.adoc +0 -54
  110. package/docs/asciidoc/create-my-own-theme.adoc +0 -149
  111. package/docs/asciidoc/images/creation-component.png +0 -0
  112. package/docs/asciidoc/images/creation-rtl.png +0 -0
  113. package/docs/asciidoc/images/message-arrow-rtl.png +0 -0
  114. package/docs/asciidoc/images/occurrence.png +0 -0
  115. package/docs/asciidoc/images/return-message-conflict.png +0 -0
  116. package/docs/asciidoc/images/shift-up-half-the-height.png +0 -0
  117. package/docs/asciidoc/images/three-layer-info-arch.png +0 -0
  118. package/docs/asciidoc/images/vertical-alignment.svg +0 -1
  119. package/docs/asciidoc/images/vertically-aligning.png +0 -0
  120. package/docs/asciidoc/index.adoc +0 -277
  121. package/docs/asciidoc/theme-debug-web-app.png +0 -0
  122. package/docs/asciidoc/tutorial.adoc +0 -22
  123. package/docs/asciidoc/user-css.png +0 -0
  124. package/docs/async-vs-sync-parser-rules.md +0 -81
  125. package/docs/divider-parser-allow-spaces.md +0 -38
  126. package/docs/highlighting-messages.md +0 -52
  127. package/docs/images/editor-sample.png +0 -0
  128. package/docs/inherited-vs-provided-from.md +0 -64
  129. package/docs/parser/Assignment.md +0 -8
  130. package/docs/parser/PARSER_IMPROVEMENTS_CC.md +0 -425
  131. package/docs/parser/grammar_review_gemini.md +0 -116
  132. package/docs/participants-function.md +0 -25
  133. package/docs/responsive-participant-margin.md +0 -52
  134. package/docs/starter.md +0 -9
  135. package/docs/superpowers/plans/2026-03-27-e2e-test-reorg.md +0 -698
  136. package/docs/superpowers/plans/2026-03-30-emoji-support.md +0 -1220
  137. package/docs/superpowers/plans/2026-03-30-self-correcting-scoring.md +0 -206
  138. package/docs/superpowers/plans/2026-04-15-keyboard-editing-on-diagram.md +0 -1992
  139. package/docs/superpowers/plans/2026-04-15-zenuml-ux-research-skill.md +0 -1452
  140. package/docs/ux-research/.gitkeep +0 -0
  141. package/docs/ux-research/2026-04-15-rename-participant.md +0 -156
  142. package/docs/ux-research/2026-04-18-insert-participant.md +0 -151
  143. package/docs/width-translate-and-offsets.md +0 -62
  144. package/docs/xss.md +0 -59
  145. package/e2e/data/compare-cases.js +0 -1090
  146. package/e2e/data/diff-algorithm.js +0 -199
  147. package/e2e/fixtures/create-message.html +0 -26
  148. package/e2e/fixtures/editable-label.html +0 -35
  149. package/e2e/fixtures/editable-span.html +0 -122
  150. package/e2e/fixtures/empty-diagram.html +0 -23
  151. package/e2e/fixtures/fixture.html +0 -31
  152. package/e2e/fixtures/insert-participant.html +0 -23
  153. package/e2e/fixtures/reorder-cross-fragment.html +0 -31
  154. package/e2e/fixtures/reorder-fragment.html +0 -29
  155. package/e2e/fixtures/reorder-message.html +0 -27
  156. package/e2e/fixtures/svg-test.html +0 -21
  157. package/e2e/fixtures/type-switch.html +0 -29
  158. package/e2e/tools/canonical-history.html +0 -908
  159. package/e2e/tools/compare-case.html +0 -371
  160. package/e2e/tools/compare.html +0 -35
  161. package/e2e/tools/native-diff-ext/background.js +0 -60
  162. package/e2e/tools/native-diff-ext/bridge.js +0 -26
  163. package/e2e/tools/native-diff-ext/content.js +0 -194
  164. package/e2e/tools/svg-preview.html +0 -56
  165. package/embed.html +0 -193
  166. package/eslint.config.mjs +0 -35
  167. package/firebase-debug.log +0 -108
  168. package/iframe-container-demo/diagram.html +0 -124
  169. package/iframe-container-demo/host.html +0 -817
  170. package/index.html +0 -771
  171. package/mermaid-zenuml-async-spa-auth.png +0 -0
  172. package/mermaid-zenuml-async-spa-auth.snapshot.md +0 -96
  173. package/newsletter/unicode-support-announcement.md +0 -134
  174. package/playground/creation.html +0 -53
  175. package/playground/message.html +0 -63
  176. package/playwright.config.ts +0 -40
  177. package/renderer.html +0 -366
  178. package/scripts/analyze-compare-case/collect-data.mjs +0 -1134
  179. package/scripts/analyze-compare-case/config.mjs +0 -102
  180. package/scripts/analyze-compare-case/geometry.mjs +0 -101
  181. package/scripts/analyze-compare-case/native-diff.mjs +0 -224
  182. package/scripts/analyze-compare-case/output.mjs +0 -74
  183. package/scripts/analyze-compare-case/panel-diff.mjs +0 -114
  184. package/scripts/analyze-compare-case/report.mjs +0 -162
  185. package/scripts/analyze-compare-case/residual-scopes.mjs +0 -347
  186. package/scripts/analyze-compare-case/scoring.mjs +0 -829
  187. package/scripts/analyze-compare-case.mjs +0 -149
  188. package/scripts/bump-version.js +0 -117
  189. package/scripts/snapshot-dual.js +0 -173
  190. package/scripts/update-snapshots.js +0 -70
  191. package/skills/dia-scoring/SKILL.md +0 -129
  192. package/skills/dia-scoring/agents/openai.yaml +0 -7
  193. package/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  194. package/tailwind.config.js +0 -126
  195. package/test-compression.html +0 -274
  196. package/test-mermaid-zenuml.html +0 -57
  197. package/test-setup.ts +0 -124
  198. package/test-url-params.html +0 -192
  199. package/tsconfig.app.json +0 -31
  200. package/tsconfig.node.json +0 -24
  201. package/tsconfig.test.json +0 -9
  202. package/vite.config.lib.ts +0 -93
  203. package/vite.config.ts +0 -84
  204. package/wrangler.toml +0 -18
@@ -1,1090 +0,0 @@
1
- // Single source of truth for all comparison test cases.
2
- // Used by both compare.html (homepage) and compare-case.html (diff viewer).
3
-
4
- export const CASES = {
5
- // --- Basics ---
6
- "empty": ``,
7
- "single-participant": `A`,
8
- "sync-call": `A.m`,
9
- "simple-messages": `A -> B: hello
10
- B -> C: process
11
- C -> B: result
12
- B -> A: done`,
13
- "named-params": `title Named Parameters Test
14
- // Testing named parameter syntax (param=value)
15
- A.method(userId=123, name="John")
16
- B.create(type="User", active=true)
17
- C.mixedCall(1, name="Mixed", enabled=false)
18
- D.oldStyle(1, 2, 3)
19
- E.complex(first="value1", second=42, third=true, fourth="final")`,
20
-
21
- // --- Sync calls & self-calls ---
22
- "nested-sync": `A.method() {
23
- B.method
24
- }`,
25
- "self-sync": `selfSync() {
26
- A.method {
27
- B.method
28
- }
29
- }`,
30
- "demo5-self-named": `A.methodA() { A.methodA1() }`,
31
- "nested-occurrence": `title Order Service
32
- A.method1{
33
- B.method2 {
34
- A->B.method3
35
- }
36
- }`,
37
- "interaction": `if(x) {
38
- A.method() {
39
- B.method() {
40
- BSelfMethod00000000000
41
- A.method()
42
- }
43
- ASelf {
44
- B->A.method
45
- }
46
- }
47
- }`,
48
- "nested-fragment": `title Nested Interaction with Fragment and Self-Invocation
49
- A.Read() {
50
- B.Submit() {
51
- Process() {
52
- if (true) {
53
- ProcessCallback() {
54
- A.method
55
- }
56
- }
57
- }
58
- }
59
- }`,
60
- "nested-outbound": `title Nested Interaction with Outbound Message and Fragment
61
- A.Read() {
62
- B.Submit() {
63
- C->B.method {
64
- if (true) {
65
- ProcessCallback() {
66
- A.method
67
- }
68
- }
69
- }
70
- }
71
- }`,
72
- "if-then-continue": `A.m {
73
- if(x) {
74
- B.m
75
- }
76
- C.m
77
- }`,
78
- "participant-width": `LongParticipantName.method`,
79
-
80
- // --- Async messages ---
81
- "async-1": `A->A: async
82
- A->B: async
83
- A->C: async
84
- B->B: async
85
- B->C: async
86
- B->A: async
87
- C->C: async
88
- C->B: async
89
- C->A: async`,
90
- "async-2": `A.method {
91
- A->A: async
92
- A->B: async
93
- A->C: async
94
- B->B: async
95
- B->C: async
96
- B->A: async
97
- C->C: async
98
- C->B: async
99
- C->A: async
100
- B.method {
101
- A->A: async
102
- A->B: async
103
- A->C: async
104
- B->B: async
105
- B->C: async
106
- B->A: async
107
- C->C: async
108
- C->B: async
109
- C->A: async
110
- }
111
- }`,
112
- "async-3": `A B C
113
- C.method {
114
- A->C: async
115
- C->A: async
116
- C->B: async
117
- B->C: async
118
- B.method {
119
- A->A: async
120
- A->B: async
121
- A->C: async
122
- B->B: async
123
- B->C: async
124
- B->A: async
125
- C->C: async
126
- C->B: async
127
- C->A: async
128
- }
129
- }`,
130
- "async-self": `A->A: selfAsync`,
131
- "async-self-nested": `A.method {
132
- A->A: async
133
- }`,
134
- "demo6-async-styled": `A->A:: Hello
135
- A->B:: Hello B
136
- B->A: So what`,
137
-
138
- // --- Fragments ---
139
- "repro-alt-simple": `if(cond) {
140
- A -> B: inIf
141
- } else {
142
- A -> B: inElse
143
- }`,
144
- "repro-alt-branches": `if(cond) {
145
- A -> B: msg1
146
- } else if(cond2) {
147
- A -> B: elseIfMsg
148
- } else {
149
- A -> B: elseMsg
150
- }`,
151
- "repro-alt-tcf-only": `if(cond) {
152
- A -> B: msg1
153
- try {
154
- B -> C: tryMsg
155
- } catch(e) {
156
- C -> B: catchMsg
157
- } finally {
158
- B -> A: finallyMsg
159
- }
160
- }`,
161
- "repro-alt-nested-tcf": `if(cond) {
162
- A -> B: msg1
163
- try {
164
- B -> C: tryMsg
165
- } catch(e) {
166
- C -> B: catchMsg
167
- } finally {
168
- B -> A: finallyMsg
169
- }
170
- } else if(cond2) {
171
- A -> B: elseIfMsg
172
- } else {
173
- A -> B: elseMsg
174
- }`,
175
- "if-fragment": `title Issue 232 - wrong layout for if-fragment
176
- Client -> Server:SendRequest
177
-
178
- if(true){
179
- Server -> Server: processRequest
180
- }`,
181
- "fragment-loop": `A -> B: request
182
- loop(condition) {
183
- B -> C: process
184
- }`,
185
- "fragment-tcf": `A.method {
186
- try {
187
- B.process
188
- } catch(error) {
189
- C.handle
190
- } finally {
191
- D.cleanup
192
- }
193
- }`,
194
- "fragment": `A
195
- B
196
- C #FF0000 // we style it to make it more important in image comparison
197
- if(x) {
198
- loop(y) {
199
- try {
200
- par {
201
- A.m();
202
- B.m();
203
- }
204
- } catch(e) {
205
- opt {
206
- new C
207
- }
208
- } finally {
209
- C.m
210
- }
211
- }
212
- }`,
213
- "fragments-return": `A.method {
214
- if(x) {
215
- return x
216
- } else {
217
- return y
218
- }
219
- try {
220
- return 1
221
- } catch {
222
- return 2
223
- } finally {
224
- return 3
225
- }
226
- }`,
227
- "fragment-issue": `// This sample is carefully crafted. It shows a known issues: fragment stretched to
228
- // svc (should not), because parser thinks the return statement returns to svc.
229
- group Backend {@VPC svc @RDS rep}
230
- group { Client }
231
- Client->SGW."Get order by id" {
232
- svc.Get(id) {
233
- rep."load order" {
234
- if(order == null) {
235
- @return
236
- SGW->Client:401
237
- }
238
- }
239
- }
240
- }`,
241
- "nested-fragment-indent": `A.m {
242
- try {
243
- loop(x) {
244
- B.m
245
- }
246
- } catch(e) {
247
- B.m
248
- }
249
- }`,
250
-
251
- // --- Creation ---
252
- "creation": `title Title 1
253
- A.m {
254
- new B(1,2,3,4)
255
- }`,
256
- "creation-return": `A.method() {
257
- b = new B()
258
- }`,
259
- "creation-rtl": `"b:B"
260
- a1 = A.method() {
261
- // abcde
262
- b = new B()
263
- }`,
264
- "creation-long-name": `new AHasAVeryLongNameLongNameLongNameLongName()`,
265
- "comment-creation": `A.method() {
266
- // abcde
267
- new B()
268
- }`,
269
- "defect-406": `title Title 1
270
- A.m1 {
271
- new B(1,2,3,4) {
272
- if(x) {
273
- C.m2
274
- }
275
- while(y) {
276
- D.m3
277
- }
278
- par {
279
- E.m4
280
- F.m5
281
- }
282
- opt {
283
- G.m6
284
- }
285
- }
286
- }`,
287
-
288
- // --- Return ---
289
- "return": `A B C D
290
-
291
- A->B.method() {
292
- ret0_assign_rtl =C.method_long_to_give_space {
293
- @return C->D: ret1_annotation_ltr
294
- ret5_assign_ltr = B.method
295
- B.method2 {
296
- return ret2_return_ltr
297
- }
298
- }
299
-
300
- return ret2_return_rtl
301
- @return B->A: ret4_annotation_rtl
302
- }`,
303
- "return-in-nested-if": `A.m {
304
- if (condition) {
305
- return ret
306
- if(x) {
307
- new B
308
- }
309
- }
310
- }`,
311
- // Minimal return isolation cases
312
- "return-single-explicit": `A B
313
- A->B.method() {
314
- return ret1
315
- }`,
316
- "return-two-explicit": `A B
317
- A->B.method() {
318
- B.inner
319
- return ret1
320
- @return B->A: ret2
321
- }`,
322
- "return-nested-then-direct": `A B C
323
- A->B.method() {
324
- B->C.nested() {
325
- return nested_ret
326
- }
327
- return direct_ret
328
- }`,
329
- "return-only-two": `A B
330
- A->B.method() {
331
- return ret1
332
- @return B->A: ret2
333
- }`,
334
- "return-assign-rtl": `A B C
335
- A->B.method() {
336
- ret0 = C.inner {
337
- B.work
338
- }
339
- }`,
340
- "return-assign-ltr": `A B C
341
- A->B.method() {
342
- ret0 = B.inner
343
- }`,
344
- "return-keyword-ltr": `A B C
345
- A->B.method() {
346
- B->C.work {
347
- return ret1
348
- }
349
- }`,
350
- "repro-return-after-creation": `new B() {
351
- return from_creation
352
- }
353
- return "back to caller"`,
354
-
355
- // --- Vertical layout (comments & creation) ---
356
- "vertical-1": `// red
357
- // green
358
- a = A.m111
359
- new E`,
360
- "vertical-2": `// [red]
361
- new B`,
362
- "vertical-3": `if(x) {
363
- // comment
364
- new A
365
- } else {
366
- new B
367
- }
368
-
369
- new C
370
- try {
371
- new D
372
- } catch {
373
- par {
374
- new E
375
- new F
376
- }
377
- }`,
378
- "vertical-4": `if(x) {
379
- // comment
380
- new A
381
- } else {
382
- new B
383
- }
384
-
385
- new C
386
- try {
387
- new D
388
- } catch {
389
- par {
390
- new E
391
- new F
392
- if(x) {
393
- new X
394
- } else {
395
- new Y
396
- }
397
- }
398
- }`,
399
- "vertical-5": `par {
400
- new F
401
- if(x) {
402
- new X
403
- } else {
404
- try {
405
- new Y
406
- } catch {
407
- par {
408
- new G
409
- if(x) {
410
- new H
411
- } else {
412
- new I
413
- }
414
- }
415
- }
416
- }
417
- }`,
418
- "vertical-6": `new a
419
- if(x) {
420
- \tnew b
421
- } else {
422
- \tnew c
423
- \tnew e
424
- }
425
- new D`,
426
- "vertical-7": `A.method
427
- section(){
428
- new B
429
- }`,
430
- "vertical-8": `new Creation() {
431
- return from_creation
432
- }
433
- return "from if to original source"
434
- try {
435
- new AHasAVeryLongNameLongNameLongNameLongName() {
436
- new CreatWithinCreat()
437
- }
438
- }`,
439
- "vertical-9": `A0->A0: self
440
- new A`,
441
- "vertical-10": `new E
442
- E.messageA()
443
- new A {
444
- if (x) {
445
- new D
446
- }
447
- new B {
448
- new C
449
- }
450
- }`,
451
- "vertical-11": `A.call {
452
- // pre creation
453
- A->B: prep
454
- a = new A()
455
- a->B: post
456
- }`,
457
-
458
- // --- Complex demos ---
459
- "smoke": `title ABCD Title
460
- // Generating Sequence Diagrams from Java code is experimental.
461
- // Please report errors to https://github.com/ZenUml/jetbrains-zenuml/discussions
462
- MarkdownJavaFxHtmlPanel
463
- MarkdownJavaFxHtmlPanel.readFromInputStream(inputStream) {
464
- StringBuilder resultStringBuilder = new StringBuilder();
465
- try {
466
- // String line;
467
- while((line = br.readLine()) != null) {
468
- resultStringBuilder.append(line);
469
- }
470
- }
471
- catch(IOException) {
472
- return "";
473
- }
474
- return "resultStringBuilder.toString()";
475
- }`,
476
- "demo1-smoke": `// comments at the beginning should be ignored
477
- title This is a title
478
- @Lambda <<stereotype>> ParticipantName
479
- group "B C" {@EC2 B @ECS C}
480
- "bg color" #FF0000
481
- @Starter("OptionalStarter")
482
- new B
483
- ReturnType ret = ParticipantName.methodA(a, b) {
484
- critical("This is a critical message") {
485
- // Customised style for RESTFul API - \`POST /order\`
486
- ReturnType ret2 = selfCall() {
487
- B.syncCallWithinSelfCall() {
488
- ParticipantName.rightToLeftCall()
489
- return B
490
- }
491
- "space in name"->"bg color".syncMethod(from, to)
492
- }
493
- }
494
- // A comment for alt
495
- if (condition) {
496
- // A comment for creation
497
- ret = new CreatAndAssign()
498
- "ret:CreatAndAssign".method(create, and, assign)
499
- // A comment for async self
500
- B->B: Self Async
501
- // A comment for async message
502
- B->C: Async Message within fragment
503
- new Creation() {
504
- return from_creation
505
- }
506
- return "from if to original source"
507
- try {
508
- new AHasAVeryLongNameLongNameLongNameLongName() {
509
- new CreatWithinCreat()
510
- C.rightToLeftFromCreation() {
511
- B.FurtherRightToLeftFromCreation()
512
- }
513
- }
514
- } catch (Exception) {
515
- self {
516
- return C
517
- }
518
- } finally {
519
- C: async call from implied source
520
- }
521
- =====divider can be anywhere=====
522
- } else if ("another condition") {
523
- par {
524
- B.method
525
- C.method
526
- }
527
- } else {
528
- // A comment for loop
529
- forEach(Z) {
530
- Z.method() {
531
- return Z
532
- }
533
- }
534
- }
535
- }`,
536
- "demo3-nested-fragments": `ret = A.methodA() {
537
- if (x) {
538
- B.methodB()
539
- if (y) {
540
- C.methodC()
541
- }
542
- }
543
- while (x) {
544
- B.methodB()
545
- while (y) {
546
- C.methodC()
547
- }
548
- }
549
- if (x) {
550
- method()
551
- if (y) {
552
- method2()
553
- }
554
- }
555
- while (x) {
556
- method()
557
- while (y) {
558
- method2()
559
- }
560
- }
561
- while (x) {
562
- method()
563
- if (y) {
564
- method2()
565
- }
566
- }
567
- if (x) {
568
- method()
569
- while (y) {
570
- method2()
571
- }
572
- }
573
- }`,
574
- "demo4-fragment-span": `ret = A.methodA() {
575
- B.method() {
576
- if (X) {
577
- C.methodC() {
578
- a = A.methodA() {
579
- D.method()
580
- }
581
- }
582
- }
583
- while (Y) {
584
- C.methodC() {
585
- A.methodA()
586
- }
587
- }
588
- }
589
- }`,
590
-
591
- // --- Repro cases ---
592
- "repro-participant-y": `A -> B: hello`,
593
- "repro-occ-basics": `A.method()`,
594
- "repro-occ-height": `A.B {
595
- B.C {
596
- C.D
597
- }
598
- B.E
599
- }`,
600
- "repro-creation-width": `A.m {
601
- b = new LongParticipantName()
602
- }`,
603
- "repro-comment": `A.method {
604
- try {
605
- // String line;
606
- B.process
607
- } catch(e) {
608
- C.handle
609
- }
610
- }`,
611
- "repro-msg-y": `A -> B: msg`,
612
- "repro-occ-depth2": `A.method() {
613
- selfCall() {
614
- B.call() {
615
- A.rtl()
616
- }
617
- }
618
- }`,
619
- "repro-comment-async-self": `A.method() {
620
- // A comment
621
- A->A: Self Async
622
- }`,
623
- "repro-debt-drift": `A.method() {
624
- selfCall() {
625
- B.call() {
626
- A.rtl()
627
- return B
628
- }
629
- }
630
- B.syncMethod(from,to)
631
- }`,
632
- "repro-fragment-section-debt": `A.method() {
633
- if(x) {
634
- B.call() {
635
- return result
636
- }
637
- } else {
638
- B.afterSection()
639
- }
640
- }`,
641
- "repro-creation-in-try": `A.method() {
642
- try {
643
- b = new B() {
644
- B.inner()
645
- }
646
- A.afterCreation()
647
- } catch(Exception) {
648
- A.inCatch()
649
- } finally {
650
- A.inFinally()
651
- }
652
- }`,
653
-
654
- // --- Occurrence bar length ---
655
- "occ-bar-length": `A->B.method {
656
- B->C.inner {
657
- @return C->B: ret1
658
- B->C.call2 {
659
- return ret2
660
- }
661
- }
662
- return ret3
663
- }`,
664
-
665
- // --- Return Y after inner block ---
666
- "return-after-block": `A->B.method {
667
- B->C.inner {
668
- @return C->B: ret_inside
669
- C->B.call2
670
- B->C.call3 {
671
- return ret_nested
672
- }
673
- }
674
- return ret_after
675
- @return B->A: ret_annot
676
- }`,
677
-
678
- // --- Assignment return: block with inner return ---
679
- "repro-assign-return": `A->B.method {
680
- ret0 = B->C.inner {
681
- @return C->B: ret_inside
682
- }
683
- }`,
684
- // --- Occurrence height: empty block (no children) ---
685
- "repro-occ-empty": `A->B.method {
686
- B->C.inner {
687
- }
688
- }`,
689
- // --- Occurrence height: block with one sync message ---
690
- "repro-occ-sync": `A->B.method {
691
- B->C.inner {
692
- C->B.call
693
- }
694
- }`,
695
- // --- Occurrence height: block with one non-self return ---
696
- "repro-occ-return": `A->B.method {
697
- B->C.inner {
698
- @return C->B: ret
699
- }
700
- }`,
701
- // --- Occurrence height: block with sync + return ---
702
- "repro-occ-mixed": `A->B.method {
703
- B->C.inner {
704
- C->B.call
705
- @return C->B: ret
706
- }
707
- }`,
708
- // --- Occurrence height: sync + `return` keyword ---
709
- "repro-occ-mixed-keyword": `A->B.method {
710
- B->C.inner {
711
- C->B.call
712
- return ret_kw
713
- }
714
- }`,
715
- // --- Occurrence height: sync + two @returns ---
716
- "repro-occ-mixed-2ret": `A->B.method {
717
- B->C.inner {
718
- C->B.call
719
- @return C->B: ret1
720
- @return C->B: ret2
721
- }
722
- }`,
723
- // --- Occurrence height: two syncs + one @return between them ---
724
- "repro-occ-mixed-mid": `A->B.method {
725
- B->C.inner {
726
- C->B.call1
727
- @return C->B: ret
728
- C->B.call2
729
- }
730
- }`,
731
- // --- Creation with params ---
732
- "repro-creation-params": `new B(1)`,
733
- // --- Just participant B (no creation) ---
734
- "repro-just-B": `B`,
735
- // --- Starter + B with message ---
736
- "repro-starter-B": `B.m`,
737
- // --- Starter + B with long method name ---
738
- "repro-starter-B-long": `B.aVeryLongMethodThatShouldPushTheParticipant`,
739
- // --- Participant colors on supported icons ---
740
- "repro-color-boundary": `@Actor Client #FFEBE6
741
- @Boundary OrderController #0747A6
742
- Client->OrderController: post`,
743
- // --- Stereotype + color + EC2 icon header layout ---
744
- "repro-ec2-stereotype-color": `@EC2 <<BFF>> OrderService #E3FCEF
745
- OrderService.create(payload)`,
746
- // --- Cloud service icons without group geometry ---
747
- "repro-service-icons": `@Lambda PurchaseService
748
- @AzureFunction InvoiceService
749
- PurchaseService->InvoiceService: createInvoice(order)`,
750
- // --- Group container without unsupported icon noise ---
751
- "repro-group-container": `group BusinessService {
752
- @Actor Client
753
- @Boundary OrderController
754
- }
755
- Client->OrderController: post`,
756
-
757
- // --- Order Service (comments + nested fragments) ---
758
- "order-service": `title Order Service
759
- @Actor Client #FFEBE6
760
- @Boundary OrderController #0747A6
761
- @EC2 <<BFF>> OrderService #E3FCEF
762
- group BusinessService {
763
- @Lambda PurchaseService
764
- @AzureFunction InvoiceService
765
- }
766
- @Starter(Client)
767
- // \`POST /orders\`
768
- OrderController.post(payload) {
769
- // comment to
770
- OrderService.create(payload) {
771
- // comment3
772
- order = new Order(payload)
773
- // comment 4
774
- if(order != null) {
775
- par {
776
- PurchaseService.createPO(order)
777
- InvoiceService.createInvoice(order)
778
- }
779
- }
780
- }
781
- }`,
782
-
783
- // --- Repro: order-service issue groups ---
784
-
785
- // Group 1: message label dy=-0.5 (backtick comment triggers it)
786
- "repro-label-dy": `@Starter(Client)
787
- // \`POST /orders\`
788
- A.post(payload) {
789
- B.create(payload) {
790
- c = new C(payload)
791
- }
792
- }`,
793
-
794
- // Group 2: creation-return arrow geometry (ambiguous return arrows)
795
- "repro-creation-return-arrow": `A.method() {
796
- b = new B(payload)
797
- return b
798
- }`,
799
-
800
- // Group 3: comment positioning (comments above messages and fragments)
801
- "repro-comment-pos": `// comment above message
802
- A -> B: doWork
803
- // comment above fragment
804
- if(cond) {
805
- B -> C: inner
806
- }`,
807
-
808
- // Group 4: fragment body geometry (nested alt+par with comments)
809
- "repro-nested-fragment": `A.call() {
810
- B.process() {
811
- // comment before if
812
- if(x) {
813
- par {
814
- C.task1()
815
- D.task2()
816
- }
817
- }
818
- }
819
- }`,
820
-
821
- // Group 5: icon + stereotype + color + group (with occurrences)
822
- "repro-icon-stereo-group": `@EC2 <<BFF>> OrderService #E3FCEF
823
- group BusinessService {
824
- @Lambda PurchaseService
825
- @AzureFunction InvoiceService
826
- }
827
- OrderService.handle() {
828
- PurchaseService.create()
829
- InvoiceService.invoice()
830
- }`,
831
-
832
- // Group 6: par fragment divider (missing in SVG)
833
- "repro-par-divider": `A.call() {
834
- par {
835
- B.task1()
836
- C.task2()
837
- }
838
- }`,
839
-
840
- // --- Divider ---
841
- "divider": `A -> B: request
842
- ==Phase 2==
843
- B -> C: forward
844
- ==Done==`,
845
-
846
- // --- Emoji ---
847
- "emoji-participant": `[rocket] Production
848
- Production.deploy()`,
849
- "emoji-multi-participants": `[rocket] Production
850
- [lock] Auth
851
- [fire] Cache
852
- Production->Auth: validate
853
- Auth->Cache: lookup`,
854
- "emoji-with-type": `@Database [fire] HotDB
855
- @Actor [eyes] Reviewer
856
- Reviewer->HotDB: query`,
857
- "emoji-with-stereotype": `<<service>> [lock] Auth
858
- <<gateway>> [rocket] API
859
- API->Auth: authenticate`,
860
- "emoji-no-emoji-baseline": `Production
861
- Auth
862
- Cache
863
- Production->Auth: validate
864
- Auth->Cache: lookup`,
865
- "emoji-async-message": `A
866
- B
867
- A->B: [rocket] launching`,
868
- "emoji-alt-condition": `A
869
- B
870
- A->B: [check] start
871
- if(success) {
872
- A->B: [rocket] proceed
873
- }`,
874
- "emoji-comment": `A
875
- B
876
- // [eyes] review this
877
- A->B: process`,
878
-
879
- // --- Icons ---
880
- "icons": `@Actor User
881
- @Database DB
882
- @sqs MQ
883
- @sns Topic
884
-
885
- User.login() {
886
- DB.verify()
887
- MQ.enqueue()
888
- Topic.publish()
889
- }`,
890
-
891
- // --- Emoji parity cases ---
892
- "emoji-sync-call": `[rocket]A.method() {
893
- [database]B.query()
894
- }`,
895
- "emoji-nested-calls": `[globe]API.handle() {
896
- [lock]Auth.validate() {
897
- [database]DB.lookup()
898
- }
899
- }`,
900
- "emoji-async-return": `[globe]API->[lock]Auth: validate
901
- Auth->[database]DB: lookup
902
- DB-->Auth: [check] found
903
- Auth-->API: [check] authorized`,
904
- "emoji-with-fragment": `[rocket]Client->[lock]Server.request()
905
- if(authorized) {
906
- Server->[database]DB.query()
907
- DB-->Server: [check] result
908
- } else {
909
- Server-->Client: [x] denied
910
- }`,
911
- "emoji-divider-case": `[rocket]A->[lock]B.start()
912
- == [fire] Deploy Phase ==
913
- B->[database]C.migrate()`,
914
- "emoji-group-case": `group Backend {[database]DB [cache]Redis}
915
- [globe]Gateway->DB.query()
916
- Gateway->Redis.get()`,
917
- "emoji-group-case-2groups": `group Backend {[database]DB [cache]Redis}
918
- group Frontend {[globe]Gateway}
919
- Gateway->DB.query()
920
- Gateway->Redis.get()`,
921
- "group-minimal": `group x {a}`,
922
- "group-single-participant": `group Frontend {[globe]Gateway}
923
- group Backend {[database]DB}
924
- Gateway->DB.query()`,
925
- "emoji-comment-styled": `// [eyes] monitoring
926
- [rocket]A->[lock]B.deploy()
927
- // [rocket, red] critical path
928
- B->[database]C.write()`,
929
- "emoji-colon-override": `[:red:] Alert
930
- [rocket] Normal
931
- Alert->Normal.notify()`,
932
- "emoji-icon-combo": `@Actor [star] Admin
933
- @Database [fire] HotDB
934
- Admin->HotDB.query()`,
935
- "emoji-long-names": `[rocket]ProductionServer->[lock]AuthService.validate()
936
- AuthService->[database]UserDB.find()
937
- UserDB-->AuthService: [check] found`,
938
- "emoji-simple-async": `[rocket]A->[lock]B: hello
939
- B-->A: [check] done`,
940
- "emoji-self-call": `[gear]Processor.init() {
941
- Processor.validate()
942
- }`,
943
- "emoji-title": `title [rocket] Deploy Pipeline
944
- [lock]A->[database]B.save()`,
945
- // emoji variants of existing patterns
946
- "emoji-nested-sync-deep": `[rocket]A.methodA() {
947
- [lock]B.methodB() {
948
- [database]C.methodC() {
949
- [fire]D.process()
950
- }
951
- }
952
- }`,
953
- "emoji-async-many": `[rocket]A [lock]B [database]C
954
- A->B: [check] msg1
955
- B->C: [fire] msg2
956
- C->B: [check] result
957
- B->A: [check] done`,
958
- "emoji-if-else": `[rocket]Client->[lock]Server.request()
959
- if(valid) {
960
- Server->[database]DB.query()
961
- } else {
962
- Server-->Client: [x] denied
963
- }`,
964
- "emoji-tcf": `[globe]A.process() {
965
- try {
966
- [database]B.save()
967
- } catch(e) {
968
- [warning]C.handle()
969
- } finally {
970
- [gear]D.cleanup()
971
- }
972
- }`,
973
- "emoji-loop": `[rocket]A->[lock]B.fetch()
974
- loop(retries < 3) {
975
- B->[database]C.query()
976
- C-->B: [check] ok
977
- }`,
978
- "emoji-par": `[rocket]Orchestrator.run() {
979
- par {
980
- [database]DB.write()
981
- [cache]Redis.flush()
982
- }
983
- }`,
984
- "emoji-return-chain": `[globe]API->[lock]Auth.check() {
985
- Auth->[database]DB.query() {
986
- DB-->Auth: [check] found
987
- }
988
- Auth-->API: [check] valid
989
- }`,
990
- "emoji-creation-simple": `[rocket]A.init() {
991
- new B()
992
- }`,
993
- "emoji-color": `[rocket] Prod #FF6600
994
- [lock] Auth #0747A6
995
- Prod->Auth.validate()`,
996
- "emoji-stereotype-only": `<<service>> [lock] Auth
997
- <<gateway>> [globe] API
998
- API->Auth.check()`,
999
- "emoji-method-name": `A.[rocket]deploy()
1000
- A.[lock]validate()
1001
- A->[database]B.[fire]save()`,
1002
- "emoji-condition-label": `[rocket]Client->[lock]Server.request()
1003
- if(authorized) {
1004
- Server->[database]DB.query()
1005
- DB-->Server: [check] result
1006
- } else {
1007
- Server-->Client: [x] denied
1008
- }`,
1009
- "emoji-in-conditions": `if([check] authorized) {
1010
- A.proceed()
1011
- } else if([warning] rate limited) {
1012
- A.wait()
1013
- } else {
1014
- A.deny()
1015
- }`,
1016
- "emoji-tcf-labels": `A.process() {
1017
- try {
1018
- B.save()
1019
- } catch(DatabaseError) {
1020
- C.rollback()
1021
- } finally {
1022
- D.cleanup()
1023
- }
1024
- }`,
1025
- "emoji-loop-condition": `while([rocket] deploying) {
1026
- A->[database]B.check()
1027
- B-->A: [check] status
1028
- }`,
1029
- "emoji-opt-critical": `[rocket]A->[lock]B.request()
1030
- opt {
1031
- B.[gear]process()
1032
- }
1033
- critical([warning] important) {
1034
- B->[database]C.save()
1035
- }`,
1036
- "emoji-nested-mixed": `[globe]Client->[lock]Server.handle() {
1037
- if([check] cached) {
1038
- Server->[cache]Redis.[rocket]get()
1039
- } else {
1040
- Server->[database]DB.[fire]query() {
1041
- try {
1042
- DB.[gear]process()
1043
- } catch(timeout) {
1044
- DB-->Server: [warning] retry
1045
- }
1046
- }
1047
- }
1048
- }`,
1049
- "emoji-all-features": `title [rocket] System Overview
1050
- @Actor [star] Admin
1051
- @Database [fire] DB
1052
- <<service>> [lock] Auth
1053
- [globe] API
1054
-
1055
- // [eyes] authentication flow
1056
- Admin->API.[key]login(credentials)
1057
- API->Auth.[lock]validate(token) {
1058
- if([check] valid) {
1059
- Auth->DB.[fire]query(userId)
1060
- DB-->Auth: [check] found
1061
- } else {
1062
- Auth-->API: [x] denied
1063
- }
1064
- }
1065
- == [rocket] deploy phase ==
1066
- API->[gear]Worker: [rocket] process`,
1067
- "emoji-chained-calls": `[rocket]A.[lock]auth().[fire]process().[check]save()`,
1068
- "emoji-assign-return": `[globe]API->[lock]Auth.check() {
1069
- result = [database]DB.query()
1070
- return [check] authorized
1071
- }`,
1072
- "emoji-multi-async": `[rocket]A->[lock]B: [fire] step 1
1073
- B->[database]C: [gear] step 2
1074
- C->[globe]D: [check] step 3
1075
- D-->A: [check] all done`,
1076
- "emoji-named-params": `[rocket]A.[lock]method(userId=123, name="John")
1077
- [database]B.[fire]create(type="User", active=true)`,
1078
- "emoji-self-sync": `[gear]selfSync() {
1079
- [rocket]A.[lock]method() {
1080
- [database]B.save()
1081
- }
1082
- }`,
1083
- "emoji-fragments-return": `[rocket]A.[lock]method() {
1084
- if([check] x) {
1085
- return [check] success
1086
- } else {
1087
- return [x] failure
1088
- }
1089
- }`,
1090
- };