@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,199 +0,0 @@
1
- /*
2
- * Shared pixel-diff algorithm used by:
3
- * - compare-case.html (via window.diffFromImages)
4
- * - native-diff-ext/content.js (extension)
5
- * - analyze-compare-case.mjs (CLI, via window.diffFromImages on the page)
6
- *
7
- * Single source of truth for parameters and pixel classification.
8
- */
9
-
10
- // Default parameters — callers may override via `opts`
11
- export const DEFAULTS = {
12
- LUMA_THRESHOLD: 240,
13
- CHANNEL_TOLERANCE: 12,
14
- POSITION_TOLERANCE: 0,
15
- };
16
-
17
- // Diff output colors (RGBA)
18
- export const COLORS = {
19
- background: [240, 240, 240, 255],
20
- match: [0, 100, 0, 255],
21
- htmlOnly: [255, 0, 0, 255],
22
- svgOnly: [0, 0, 255, 255],
23
- colorDiff: [255, 0, 255, 255],
24
- };
25
-
26
- function luma(r, g, b) {
27
- return 0.3 * r + 0.59 * g + 0.11 * b;
28
- }
29
-
30
- function getPixel(data, stride, x, y) {
31
- const i = (y * stride + x) * 4;
32
- return [data[i], data[i + 1], data[i + 2]];
33
- }
34
-
35
- /**
36
- * Run pixel diff on two same-sized RGBA pixel arrays.
37
- *
38
- * @param {Uint8ClampedArray} data1 - HTML screenshot pixel data
39
- * @param {Uint8ClampedArray} data2 - SVG screenshot pixel data
40
- * @param {number} w - width of both images (use max if sizes differ)
41
- * @param {number} h - height of both images
42
- * @param {number} stride1 - row stride for data1 (usually same as w)
43
- * @param {number} stride2 - row stride for data2
44
- * @param {object} [opts] - optional parameter overrides
45
- * @returns {{ diff: Uint8ClampedArray, stats: object }}
46
- */
47
- export function pixelDiff(data1, data2, w, h, stride1, stride2, opts) {
48
- const LUMA_THRESHOLD = opts?.LUMA_THRESHOLD ?? DEFAULTS.LUMA_THRESHOLD;
49
- const CHANNEL_TOLERANCE = opts?.CHANNEL_TOLERANCE ?? DEFAULTS.CHANNEL_TOLERANCE;
50
- const POSITION_TOLERANCE = opts?.POSITION_TOLERANCE ?? DEFAULTS.POSITION_TOLERANCE;
51
-
52
- const diff = new Uint8ClampedArray(w * h * 4);
53
- let total = 0, matched = 0, htmlOnly = 0, svgOnly = 0, colorDiff = 0;
54
-
55
- function pixelsClose(a, b) {
56
- return Math.abs(a[0] - b[0]) <= CHANNEL_TOLERANCE &&
57
- Math.abs(a[1] - b[1]) <= CHANNEL_TOLERANCE &&
58
- Math.abs(a[2] - b[2]) <= CHANNEL_TOLERANCE;
59
- }
60
-
61
- function hasNearbyMatch(srcData, srcStride, dstData, dstStride, x, y) {
62
- const p1 = getPixel(srcData, srcStride, x, y);
63
- for (let dy = -POSITION_TOLERANCE; dy <= POSITION_TOLERANCE; dy++) {
64
- for (let dx = -POSITION_TOLERANCE; dx <= POSITION_TOLERANCE; dx++) {
65
- const nx = x + dx, ny = y + dy;
66
- if (nx < 0 || nx >= w || ny < 0 || ny >= h) continue;
67
- const p2 = getPixel(dstData, dstStride, nx, ny);
68
- if (luma(...p2) < LUMA_THRESHOLD && pixelsClose(p1, p2)) return true;
69
- }
70
- }
71
- return false;
72
- }
73
-
74
- for (let y = 0; y < h; y++) {
75
- for (let x = 0; x < w; x++) {
76
- const pA = getPixel(data1, stride1, x, y);
77
- const pB = getPixel(data2, stride2, x, y);
78
- const isA = luma(...pA) < LUMA_THRESHOLD;
79
- const isB = luma(...pB) < LUMA_THRESHOLD;
80
- const di = (y * w + x) * 4;
81
-
82
- if (!isA && !isB) {
83
- diff[di] = COLORS.background[0];
84
- diff[di + 1] = COLORS.background[1];
85
- diff[di + 2] = COLORS.background[2];
86
- diff[di + 3] = COLORS.background[3];
87
- continue;
88
- }
89
-
90
- total++;
91
- const matchAB = hasNearbyMatch(data1, stride1, data2, stride2, x, y);
92
- const matchBA = hasNearbyMatch(data2, stride2, data1, stride1, x, y);
93
-
94
- let color;
95
- if (isA && isB) {
96
- if (matchAB || matchBA) {
97
- matched++;
98
- color = COLORS.match;
99
- } else {
100
- colorDiff++;
101
- color = COLORS.colorDiff;
102
- }
103
- } else if (isA) {
104
- if (matchAB) {
105
- matched++;
106
- color = COLORS.match;
107
- } else {
108
- htmlOnly++;
109
- color = COLORS.htmlOnly;
110
- }
111
- } else {
112
- if (matchBA) {
113
- matched++;
114
- color = COLORS.match;
115
- } else {
116
- svgOnly++;
117
- color = COLORS.svgOnly;
118
- }
119
- }
120
-
121
- diff[di] = color[0];
122
- diff[di + 1] = color[1];
123
- diff[di + 2] = color[2];
124
- diff[di + 3] = color[3];
125
- }
126
- }
127
-
128
- const posMatched = matched + colorDiff;
129
- const pixelPct = total > 0 ? parseFloat((matched / total * 100).toFixed(1)) : 0.0;
130
- const posPct = total > 0 ? parseFloat((posMatched / total * 100).toFixed(1)) : 0.0;
131
-
132
- return {
133
- diff,
134
- stats: { matched, posMatched, total, htmlOnly, svgOnly, colorDiff, pixelPct, posPct },
135
- };
136
- }
137
-
138
- /**
139
- * Load an image from a data URL into an ImageData-compatible object.
140
- * Works in any browser context (page or extension content script).
141
- */
142
- export function loadImage(dataUrl) {
143
- return new Promise((resolve, reject) => {
144
- const img = new Image();
145
- img.onload = () => resolve(img);
146
- img.onerror = () => reject(new Error("Failed to load image"));
147
- img.src = dataUrl;
148
- });
149
- }
150
-
151
- /**
152
- * Draw an image onto a white-filled canvas and return its pixel data.
153
- */
154
- export function getImageData(img, w, h) {
155
- const canvas = document.createElement("canvas");
156
- canvas.width = w;
157
- canvas.height = h;
158
- const ctx = canvas.getContext("2d");
159
- ctx.fillStyle = "white";
160
- ctx.fillRect(0, 0, w, h);
161
- ctx.drawImage(img, 0, 0);
162
- return ctx.getImageData(0, 0, w, h).data;
163
- }
164
-
165
- /**
166
- * High-level: load two data-URL images, run diff, render to a canvas.
167
- * Returns { canvas, stats, badgeHtml }.
168
- */
169
- export async function diffImages(htmlDataUrl, svgDataUrl, opts) {
170
- const [htmlImg, svgImg] = await Promise.all([
171
- loadImage(htmlDataUrl),
172
- loadImage(svgDataUrl),
173
- ]);
174
-
175
- const w = Math.max(htmlImg.width, svgImg.width);
176
- const h = Math.max(htmlImg.height, svgImg.height);
177
-
178
- const data1 = getImageData(htmlImg, w, h);
179
- const data2 = getImageData(svgImg, w, h);
180
-
181
- const { diff, stats } = pixelDiff(data1, data2, w, h, w, w, opts);
182
-
183
- const canvas = document.createElement("canvas");
184
- canvas.width = w;
185
- canvas.height = h;
186
- const ctx = canvas.getContext("2d");
187
- const imageData = ctx.createImageData(w, h);
188
- imageData.data.set(diff);
189
- ctx.putImageData(imageData, 0, 0);
190
-
191
- const badgeHtml =
192
- `<b>${stats.pixelPct}%</b> native pixel match / <b>${stats.posPct}%</b> pos-only (${stats.matched}/${stats.total} px) ` +
193
- `<span style="color:#006400">\u25a0</span> match ` +
194
- `<span style="color:#ff0000">\u25a0</span> HTML-only (${stats.htmlOnly}) ` +
195
- `<span style="color:#0000ff">\u25a0</span> SVG-only (${stats.svgOnly}) ` +
196
- `<span style="color:#ff00ff">\u25a0</span> color diff (${stats.colorDiff})`;
197
-
198
- return { canvas, stats, badgeHtml };
199
- }
@@ -1,26 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>create message</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <div id="diagram" class="diagram">
17
- <pre class="zenuml" style="margin: 0">
18
- A
19
- B
20
- C
21
- A->B.hello()
22
- </pre>
23
- </div>
24
- <script type="module" src="/src/main-e2e.ts"></script>
25
- </body>
26
- </html>
@@ -1,35 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>vue-sequence editable label</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- /* mostly for demo on mobile */
12
- }
13
- </style>
14
- </head>
15
-
16
- <body>
17
- <div id="diagram" class="diagram">
18
- <pre class="zenuml" style="margin: 0">
19
- title Editable label
20
- A.method(){
21
- SelfMessage
22
- new B(create)
23
- return x;
24
- }
25
- C->D: Hello Alice
26
- D->C: Hello Bob
27
- D-->C: Response payload
28
- C->D: Good to see you
29
- </pre
30
- >
31
- </div>
32
- <!-- built files will be auto injected -->
33
- <script type="module" src="/src/main-e2e.ts"></script>
34
- </body>
35
- </html>
@@ -1,122 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>EditableSpan Test Page</title>
8
- <style>
9
- body {
10
- margin: 20px;
11
- font-family: Arial, sans-serif;
12
- }
13
- .test-container {
14
- margin: 20px 0;
15
- padding: 20px;
16
- border: 1px solid #ccc;
17
- border-radius: 4px;
18
- }
19
- .label {
20
- font-weight: bold;
21
- margin-bottom: 10px;
22
- }
23
- .log {
24
- margin-top: 10px;
25
- padding: 10px;
26
- background: #f5f5f5;
27
- border-radius: 4px;
28
- font-family: monospace;
29
- font-size: 12px;
30
- max-height: 200px;
31
- overflow-y: auto;
32
- }
33
- .log-entry {
34
- margin: 2px 0;
35
- }
36
- .log-save {
37
- color: green;
38
- }
39
- </style>
40
- </head>
41
-
42
- <body>
43
- <h1>EditableSpan Test Page</h1>
44
-
45
- <div class="test-container">
46
- <div class="label">Test 1: Basic ESC Cancel</div>
47
- <div>
48
- Text: <span id="test1-span" data-testid="test1-span"></span>
49
- </div>
50
- <div class="log" id="test1-log" data-testid="test1-log"></div>
51
- </div>
52
-
53
- <div class="test-container">
54
- <div class="label">Test 2: Enter Save</div>
55
- <div>
56
- Text: <span id="test2-span" data-testid="test2-span"></span>
57
- </div>
58
- <div class="log" id="test2-log" data-testid="test2-log"></div>
59
- </div>
60
-
61
- <div class="test-container">
62
- <div class="label">Test 3: Blur Save</div>
63
- <div>
64
- Text: <span id="test3-span" data-testid="test3-span"></span>
65
- </div>
66
- <div class="log" id="test3-log" data-testid="test3-log"></div>
67
- <button id="blur-target" data-testid="blur-target">Click here to blur</button>
68
- </div>
69
-
70
- <script type="module">
71
- import { createRoot } from 'react-dom/client';
72
- import { createElement } from 'react';
73
- import { EditableSpan } from '../../src/components/common/EditableSpan/EditableSpan';
74
-
75
- function createLogger(logId) {
76
- const logEl = document.getElementById(logId);
77
- return {
78
- log: (message, type = 'info') => {
79
- const entry = document.createElement('div');
80
- entry.className = `log-entry log-${type}`;
81
- entry.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
82
- logEl.appendChild(entry);
83
- logEl.scrollTop = logEl.scrollHeight;
84
- }
85
- };
86
- }
87
-
88
- function createReactiveSpan(rootEl, logger, initialValue) {
89
- let value = initialValue;
90
- const render = () => {
91
- rootEl.render(createElement(EditableSpan, {
92
- text: value,
93
- onSave: (newText) => {
94
- value = newText;
95
- logger.log(`onSave called: "${newText}"`, 'save');
96
- render();
97
- }
98
- }));
99
- };
100
- render();
101
- }
102
-
103
- // Test 1: ESC Cancel - should NOT call onSave when ESC is pressed
104
- const logger1 = createLogger('test1-log');
105
- const root1 = createRoot(document.getElementById('test1-span'));
106
- createReactiveSpan(root1, logger1, 'Original Text');
107
-
108
- // Test 2: Enter Save
109
- const logger2 = createLogger('test2-log');
110
- const root2 = createRoot(document.getElementById('test2-span'));
111
- createReactiveSpan(root2, logger2, 'Press Enter');
112
-
113
- // Test 3: Blur Save
114
- const logger3 = createLogger('test3-log');
115
- const root3 = createRoot(document.getElementById('test3-span'));
116
- createReactiveSpan(root3, logger3, 'Click Outside');
117
-
118
- // Make loggers available for testing
119
- window.testLoggers = { logger1, logger2, logger3 };
120
- </script>
121
- </body>
122
- </html>
@@ -1,23 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>vue-sequence empty diagram</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- /* mostly for demo on mobile */
12
- }
13
- </style>
14
- </head>
15
-
16
- <body>
17
- <div id="diagram" class="diagram">
18
- <pre class="zenuml" style="margin: 0"></pre>
19
- </div>
20
- <!-- built files will be auto injected -->
21
- <script type="module" src="/src/main-e2e.ts"></script>
22
- </body>
23
- </html>
@@ -1,31 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>ZenUML Test Fixture</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
- <body>
15
- <div id="diagram" class="diagram">
16
- <pre class="zenuml" style="margin: 0" id="zenuml-code"></pre>
17
- </div>
18
- <script type="module">
19
- import { CASES } from "../data/compare-cases.js";
20
- const params = new URLSearchParams(window.location.search);
21
- const caseName = params.get("case");
22
- if (caseName && CASES[caseName]) {
23
- document.getElementById("zenuml-code").textContent = CASES[caseName];
24
- } else {
25
- document.getElementById("zenuml-code").textContent =
26
- "// Case not found: " + caseName;
27
- }
28
- </script>
29
- <script type="module" src="/src/main-e2e.ts"></script>
30
- </body>
31
- </html>
@@ -1,23 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>insert participant</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <div id="diagram" class="diagram">
17
- <pre class="zenuml" style="margin: 0">
18
- A->C: Ping
19
- </pre>
20
- </div>
21
- <script type="module" src="/src/main-e2e.ts"></script>
22
- </body>
23
- </html>
@@ -1,31 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>reorder cross fragment</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <div id="diagram" class="diagram">
17
- <pre class="zenuml" style="margin: 0">
18
- A
19
- B
20
- C
21
- B->A.outside()
22
- if(ready) {
23
- A->B.alpha()
24
- A->C.beta()
25
- }
26
- C->A.omega()
27
- </pre>
28
- </div>
29
- <script type="module" src="/src/main-e2e.ts"></script>
30
- </body>
31
- </html>
@@ -1,29 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>reorder fragment</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <div id="diagram" class="diagram">
17
- <pre class="zenuml" style="margin: 0">
18
- A
19
- B
20
- C
21
- if(ready) {
22
- A->B: alpha
23
- A->C: beta
24
- }
25
- </pre>
26
- </div>
27
- <script type="module" src="/src/main-e2e.ts"></script>
28
- </body>
29
- </html>
@@ -1,27 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>reorder message</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <div id="diagram" class="diagram">
17
- <pre class="zenuml" style="margin: 0">
18
- A
19
- B
20
- C
21
- A->B: first
22
- A->C: second
23
- </pre>
24
- </div>
25
- <script type="module" src="/src/main-e2e.ts"></script>
26
- </body>
27
- </html>
@@ -1,21 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
6
- <title>SVG Parity Test</title>
7
- <style>
8
- body { margin: 0; background: white; }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="svg-output"></div>
13
- <script type="module">
14
- import { renderToSvg } from "/src/svg/renderToSvg.ts";
15
- window.__renderSvg = (code) => {
16
- const result = renderToSvg(code);
17
- document.getElementById("svg-output").innerHTML = result.svg;
18
- };
19
- </script>
20
- </body>
21
- </html>
@@ -1,29 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
- <title>vue-sequence type switch</title>
8
- <style>
9
- body {
10
- margin: 0;
11
- /* mostly for demo on mobile */
12
- }
13
- </style>
14
- </head>
15
-
16
- <body>
17
- <div id="diagram" class="diagram">
18
- <pre class="zenuml" style="margin: 0">
19
- title Type Switch
20
- A->B.login()
21
- B->C: validate
22
- B-->A: token
23
- </pre
24
- >
25
- </div>
26
- <!-- built files will be auto injected -->
27
- <script type="module" src="/src/main-e2e.ts"></script>
28
- </body>
29
- </html>