@zenuml/core 3.47.9 → 3.48.1
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.
- package/dist/cli/zenuml.mjs +13529 -0
- package/dist/cli/zenuml.mjs.map +1 -0
- package/dist/cloud-icons-eHuugVSv.js.map +1 -0
- package/dist/zenuml.esm.mjs +2153 -2156
- package/dist/zenuml.esm.mjs.map +1 -0
- package/dist/zenuml.js +82 -82
- package/dist/zenuml.js.map +1 -0
- package/package.json +18 -5
- package/.agents/skills/babysit-pr/SKILL.md +0 -223
- package/.agents/skills/babysit-pr/agents/openai.yaml +0 -7
- package/.agents/skills/dia-scoring/SKILL.md +0 -139
- package/.agents/skills/dia-scoring/agents/openai.yaml +0 -7
- package/.agents/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/.agents/skills/land-pr/SKILL.md +0 -120
- package/.agents/skills/propagate-core-release/SKILL.md +0 -205
- package/.agents/skills/propagate-core-release/agents/openai.yaml +0 -7
- package/.agents/skills/propagate-core-release/references/downstreams.md +0 -42
- package/.agents/skills/ship-branch/SKILL.md +0 -105
- package/.agents/skills/submit-branch/SKILL.md +0 -76
- package/.agents/skills/validate-branch/SKILL.md +0 -72
- package/.claude/commands/README.md +0 -162
- package/.claude/commands/analyze.md +0 -101
- package/.claude/commands/clarify.md +0 -158
- package/.claude/commands/code-review.md +0 -322
- package/.claude/commands/constitution.md +0 -73
- package/.claude/commands/create-docs.md +0 -309
- package/.claude/commands/full-context.md +0 -121
- package/.claude/commands/gemini-consult.md +0 -164
- package/.claude/commands/handoff.md +0 -146
- package/.claude/commands/implement.md +0 -56
- package/.claude/commands/plan.md +0 -43
- package/.claude/commands/refactor.md +0 -188
- package/.claude/commands/specify.md +0 -21
- package/.claude/commands/tasks.md +0 -62
- package/.claude/commands/update-docs.md +0 -314
- package/.claude/hooks/README.md +0 -270
- package/.claude/hooks/config/sensitive-patterns.json +0 -86
- package/.claude/hooks/gemini-context-injector.sh +0 -129
- package/.claude/hooks/mcp-security-scan.sh +0 -147
- package/.claude/hooks/notify.sh +0 -103
- package/.claude/hooks/setup/hook-setup.md +0 -96
- package/.claude/hooks/setup/settings.json.template +0 -63
- package/.claude/hooks/sounds/complete.wav +0 -0
- package/.claude/hooks/sounds/input-needed.wav +0 -0
- package/.claude/hooks/subagent-context-injector.sh +0 -65
- package/.claude/skills/babysit-pr/SKILL.md +0 -223
- package/.claude/skills/babysit-pr/agents/openai.yaml +0 -7
- package/.claude/skills/dia-scoring/SKILL.md +0 -139
- package/.claude/skills/dia-scoring/agents/openai.yaml +0 -7
- package/.claude/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/.claude/skills/emoji-eval/SKILL.md +0 -187
- package/.claude/skills/land-pr/SKILL.md +0 -120
- package/.claude/skills/propagate-core-release/SKILL.md +0 -205
- package/.claude/skills/propagate-core-release/agents/openai.yaml +0 -7
- package/.claude/skills/propagate-core-release/references/downstreams.md +0 -42
- package/.claude/skills/ship-branch/SKILL.md +0 -105
- package/.claude/skills/submit-branch/SKILL.md +0 -76
- package/.claude/skills/validate-branch/SKILL.md +0 -72
- package/.claude/skills/zenuml-ux-research/SKILL.md +0 -183
- package/.claude/skills/zenuml-ux-research/references/assertion-catalog.md +0 -261
- package/.claude/skills/zenuml-ux-research/references/best-practices-overview.md +0 -56
- package/.claude/skills/zenuml-ux-research/references/report-template.md +0 -89
- package/.claude/skills/zenuml-ux-research/references/scenarios/edit-message-label.md +0 -37
- package/.claude/skills/zenuml-ux-research/references/scenarios/insert-message.md +0 -36
- package/.claude/skills/zenuml-ux-research/references/scenarios/insert-participant.md +0 -31
- package/.claude/skills/zenuml-ux-research/references/scenarios/rename-participant.md +0 -33
- package/.claude/skills/zenuml-ux-research/references/scenarios/undo-insert.md +0 -35
- package/.devcontainer/devcontainer.json +0 -21
- package/.dockerignore +0 -19
- package/.eslintrc.js +0 -39
- package/.git-blame-ignore-revs +0 -6
- package/.kiro/hooks/README.md +0 -38
- package/.kiro/hooks/session-sound-notification.js +0 -44
- package/.kiro/hooks/session-sound-notification.json +0 -23
- package/.mcp.json.example +0 -17
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc +0 -1
- package/.specify/memory/constitution.md +0 -33
- package/.specify/scripts/bash/check-prerequisites.sh +0 -166
- package/.specify/scripts/bash/common.sh +0 -113
- package/.specify/scripts/bash/create-new-feature.sh +0 -97
- package/.specify/scripts/bash/setup-plan.sh +0 -60
- package/.specify/scripts/bash/update-agent-context.sh +0 -728
- package/.specify/templates/agent-file-template.md +0 -23
- package/.specify/templates/plan-template.md +0 -219
- package/.specify/templates/spec-template.md +0 -116
- package/.specify/templates/tasks-template.md +0 -127
- package/.storybook/main.ts +0 -25
- package/.storybook/preview.ts +0 -29
- package/.watchmanconfig +0 -3
- package/AGENTS.md +0 -26
- package/CLAUDE.md +0 -124
- package/DEPLOYMENT.md +0 -62
- package/Dockerfile +0 -36
- package/IMPLEMENTATION_PLAN.md +0 -163
- package/Integration/vanilla-js/index.html +0 -42
- package/MCP-ASSISTANT-RULES.md +0 -85
- package/README_CN.md +0 -15
- package/TUTORIAL.md +0 -116
- package/antlr/antlr-4.11.1-complete.jar +0 -0
- package/bun.lock +0 -1544
- package/bunfig.toml +0 -52
- package/docs/UNICODE_SUPPORT.md +0 -179
- package/docs/ai-context/deployment-infrastructure.md +0 -21
- package/docs/ai-context/docs-overview.md +0 -89
- package/docs/ai-context/handoff.md +0 -174
- package/docs/ai-context/project-structure.md +0 -160
- package/docs/ai-context/system-integration.md +0 -21
- package/docs/asciidoc/contributor.adoc +0 -54
- package/docs/asciidoc/create-my-own-theme.adoc +0 -149
- package/docs/asciidoc/images/creation-component.png +0 -0
- package/docs/asciidoc/images/creation-rtl.png +0 -0
- package/docs/asciidoc/images/message-arrow-rtl.png +0 -0
- package/docs/asciidoc/images/occurrence.png +0 -0
- package/docs/asciidoc/images/return-message-conflict.png +0 -0
- package/docs/asciidoc/images/shift-up-half-the-height.png +0 -0
- package/docs/asciidoc/images/three-layer-info-arch.png +0 -0
- package/docs/asciidoc/images/vertical-alignment.svg +0 -1
- package/docs/asciidoc/images/vertically-aligning.png +0 -0
- package/docs/asciidoc/index.adoc +0 -277
- package/docs/asciidoc/theme-debug-web-app.png +0 -0
- package/docs/asciidoc/tutorial.adoc +0 -22
- package/docs/asciidoc/user-css.png +0 -0
- package/docs/async-vs-sync-parser-rules.md +0 -81
- package/docs/divider-parser-allow-spaces.md +0 -38
- package/docs/highlighting-messages.md +0 -52
- package/docs/images/editor-sample.png +0 -0
- package/docs/inherited-vs-provided-from.md +0 -64
- package/docs/parser/Assignment.md +0 -8
- package/docs/parser/PARSER_IMPROVEMENTS_CC.md +0 -425
- package/docs/parser/grammar_review_gemini.md +0 -116
- package/docs/participants-function.md +0 -25
- package/docs/responsive-participant-margin.md +0 -52
- package/docs/starter.md +0 -9
- package/docs/superpowers/plans/2026-03-27-e2e-test-reorg.md +0 -698
- package/docs/superpowers/plans/2026-03-30-emoji-support.md +0 -1220
- package/docs/superpowers/plans/2026-03-30-self-correcting-scoring.md +0 -206
- package/docs/superpowers/plans/2026-04-15-keyboard-editing-on-diagram.md +0 -1992
- package/docs/superpowers/plans/2026-04-15-zenuml-ux-research-skill.md +0 -1452
- package/docs/ux-research/.gitkeep +0 -0
- package/docs/ux-research/2026-04-15-rename-participant.md +0 -156
- package/docs/ux-research/2026-04-18-insert-participant.md +0 -151
- package/docs/width-translate-and-offsets.md +0 -62
- package/docs/xss.md +0 -59
- package/e2e/data/compare-cases.js +0 -1090
- package/e2e/data/diff-algorithm.js +0 -199
- package/e2e/fixtures/create-message.html +0 -26
- package/e2e/fixtures/editable-label.html +0 -35
- package/e2e/fixtures/editable-span.html +0 -122
- package/e2e/fixtures/empty-diagram.html +0 -23
- package/e2e/fixtures/fixture.html +0 -31
- package/e2e/fixtures/insert-participant.html +0 -23
- package/e2e/fixtures/reorder-cross-fragment.html +0 -31
- package/e2e/fixtures/reorder-fragment.html +0 -29
- package/e2e/fixtures/reorder-message.html +0 -27
- package/e2e/fixtures/svg-test.html +0 -21
- package/e2e/fixtures/type-switch.html +0 -29
- package/e2e/tools/canonical-history.html +0 -908
- package/e2e/tools/compare-case.html +0 -371
- package/e2e/tools/compare.html +0 -35
- package/e2e/tools/native-diff-ext/background.js +0 -60
- package/e2e/tools/native-diff-ext/bridge.js +0 -26
- package/e2e/tools/native-diff-ext/content.js +0 -194
- package/e2e/tools/svg-preview.html +0 -56
- package/embed.html +0 -193
- package/eslint.config.mjs +0 -35
- package/firebase-debug.log +0 -108
- package/iframe-container-demo/diagram.html +0 -124
- package/iframe-container-demo/host.html +0 -817
- package/index.html +0 -771
- package/mermaid-zenuml-async-spa-auth.png +0 -0
- package/mermaid-zenuml-async-spa-auth.snapshot.md +0 -96
- package/newsletter/unicode-support-announcement.md +0 -134
- package/playground/creation.html +0 -53
- package/playground/message.html +0 -63
- package/playwright.config.ts +0 -40
- package/renderer.html +0 -366
- package/scripts/analyze-compare-case/collect-data.mjs +0 -1134
- package/scripts/analyze-compare-case/config.mjs +0 -102
- package/scripts/analyze-compare-case/geometry.mjs +0 -101
- package/scripts/analyze-compare-case/native-diff.mjs +0 -224
- package/scripts/analyze-compare-case/output.mjs +0 -74
- package/scripts/analyze-compare-case/panel-diff.mjs +0 -114
- package/scripts/analyze-compare-case/report.mjs +0 -162
- package/scripts/analyze-compare-case/residual-scopes.mjs +0 -347
- package/scripts/analyze-compare-case/scoring.mjs +0 -829
- package/scripts/analyze-compare-case.mjs +0 -149
- package/scripts/bump-version.js +0 -117
- package/scripts/snapshot-dual.js +0 -173
- package/scripts/update-snapshots.js +0 -70
- package/skills/dia-scoring/SKILL.md +0 -129
- package/skills/dia-scoring/agents/openai.yaml +0 -7
- package/skills/dia-scoring/references/selectors-and-keys.md +0 -253
- package/tailwind.config.js +0 -126
- package/test-compression.html +0 -274
- package/test-mermaid-zenuml.html +0 -57
- package/test-setup.ts +0 -124
- package/test-url-params.html +0 -192
- package/tsconfig.app.json +0 -31
- package/tsconfig.node.json +0 -24
- package/tsconfig.test.json +0 -9
- package/vite.config.lib.ts +0 -93
- package/vite.config.ts +0 -84
- package/wrangler.toml +0 -18
package/renderer.html
DELETED
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" style="height: 100%; width: 100%">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
7
|
-
<title>ZenUML Web Renderer</title>
|
|
8
|
-
<meta name="description" content="ZenUML Web Renderer - Render sequence diagrams from URL parameters" />
|
|
9
|
-
<meta name="keywords" content="zenuml, sequence diagram, uml, renderer, web" />
|
|
10
|
-
|
|
11
|
-
<!-- Favicon -->
|
|
12
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
13
|
-
|
|
14
|
-
<!-- Fonts -->
|
|
15
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
16
|
-
<link
|
|
17
|
-
rel="preload stylesheet"
|
|
18
|
-
as="style"
|
|
19
|
-
href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@300;400;500;700&display=swap"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
<!-- Basic styles for the renderer -->
|
|
23
|
-
<style>
|
|
24
|
-
* {
|
|
25
|
-
box-sizing: border-box;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
body {
|
|
29
|
-
margin: 0;
|
|
30
|
-
padding: 0;
|
|
31
|
-
font-family: 'Roboto Slab', serif, system-ui, -apple-system, sans-serif;
|
|
32
|
-
background-color: white;
|
|
33
|
-
height: 100vh;
|
|
34
|
-
width: 100vw;
|
|
35
|
-
overflow: auto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.zenuml {
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
margin: 0;
|
|
42
|
-
padding: 0;
|
|
43
|
-
overflow: auto;
|
|
44
|
-
text-align: center;
|
|
45
|
-
}
|
|
46
|
-
</style>
|
|
47
|
-
</head>
|
|
48
|
-
<body>
|
|
49
|
-
<!-- ZenUML diagram container -->
|
|
50
|
-
<pre class="zenuml" id="zenuml-diagram"></pre>
|
|
51
|
-
|
|
52
|
-
<!-- Initialize the renderer -->
|
|
53
|
-
<script type="module">
|
|
54
|
-
import pako from 'pako';
|
|
55
|
-
// ZenUML Web Renderer initialization
|
|
56
|
-
console.log('ZenUML Web Renderer initializing...');
|
|
57
|
-
|
|
58
|
-
// Default empty ZenUML code to display when no URL parameters are provided
|
|
59
|
-
const DEFAULT_ZENUML_CODE = `title ZenUML Web Renderer
|
|
60
|
-
A.method() {
|
|
61
|
-
B.process()
|
|
62
|
-
return result
|
|
63
|
-
}`;
|
|
64
|
-
|
|
65
|
-
// URL parameter extraction functionality
|
|
66
|
-
function extractCodeFromURL() {
|
|
67
|
-
try {
|
|
68
|
-
console.log('Extracting code parameter from URL...');
|
|
69
|
-
|
|
70
|
-
// Get current URL
|
|
71
|
-
const currentUrl = new URL(window.location.href);
|
|
72
|
-
console.log('Current URL:', currentUrl.href);
|
|
73
|
-
|
|
74
|
-
// Extract the 'code' parameter
|
|
75
|
-
const codeParam = currentUrl.searchParams.get('code');
|
|
76
|
-
|
|
77
|
-
if (codeParam) {
|
|
78
|
-
console.log('Code parameter found:', codeParam.substring(0, 50) + '...');
|
|
79
|
-
return codeParam;
|
|
80
|
-
} else {
|
|
81
|
-
console.log('No code parameter found in URL');
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
} catch (error) {
|
|
85
|
-
console.error('Error extracting code from URL:', error);
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Check if URL parameter exists
|
|
91
|
-
function hasCodeParameter() {
|
|
92
|
-
try {
|
|
93
|
-
const currentUrl = new URL(window.location.href);
|
|
94
|
-
return currentUrl.searchParams.has('code');
|
|
95
|
-
} catch (error) {
|
|
96
|
-
console.error('Error checking for code parameter:', error);
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Base64 decoding functionality
|
|
102
|
-
function decodeBase64(encodedString) {
|
|
103
|
-
try {
|
|
104
|
-
console.log('Attempting to decode Base64 string...');
|
|
105
|
-
|
|
106
|
-
// Check if the string is valid Base64
|
|
107
|
-
if (!encodedString || typeof encodedString !== 'string') {
|
|
108
|
-
throw new Error('Invalid input: string is null, undefined, or not a string');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Remove any whitespace
|
|
112
|
-
const cleanedString = encodedString.trim();
|
|
113
|
-
|
|
114
|
-
// Check if string looks like Base64 (basic validation)
|
|
115
|
-
const base64Regex = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
116
|
-
if (!base64Regex.test(cleanedString)) {
|
|
117
|
-
throw new Error('Invalid Base64 format');
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Attempt to decode
|
|
121
|
-
const decodedString = atob(cleanedString);
|
|
122
|
-
console.log('Base64 decoding successful');
|
|
123
|
-
|
|
124
|
-
return decodedString;
|
|
125
|
-
} catch (error) {
|
|
126
|
-
console.error('Base64 decoding failed:', error);
|
|
127
|
-
throw new Error(`Base64 decoding failed: ${error.message}`);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Gzip decompression functionality
|
|
132
|
-
function decompressGzip(compressedData) {
|
|
133
|
-
try {
|
|
134
|
-
console.log('Attempting to decompress gzip data...');
|
|
135
|
-
|
|
136
|
-
// Convert base64 decoded string to Uint8Array
|
|
137
|
-
const binaryString = compressedData;
|
|
138
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
139
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
140
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Decompress using pako
|
|
144
|
-
const decompressed = pako.ungzip(bytes, { to: 'string' });
|
|
145
|
-
console.log('Gzip decompression successful');
|
|
146
|
-
|
|
147
|
-
return decompressed;
|
|
148
|
-
} catch (error) {
|
|
149
|
-
console.error('Gzip decompression failed:', error);
|
|
150
|
-
throw new Error(`Gzip decompression failed: ${error.message}`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Process URL code parameter with Base64 decoding and optional gzip decompression
|
|
155
|
-
function processURLCodeParameter(encodedCode) {
|
|
156
|
-
try {
|
|
157
|
-
console.log('Processing URL code parameter...');
|
|
158
|
-
|
|
159
|
-
if (!encodedCode) {
|
|
160
|
-
console.log('No encoded code provided');
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
let processedCode = encodedCode;
|
|
165
|
-
|
|
166
|
-
// Step 1: Try to decode as Base64
|
|
167
|
-
try {
|
|
168
|
-
const base64Decoded = decodeBase64(encodedCode);
|
|
169
|
-
console.log('Base64 decoding successful');
|
|
170
|
-
processedCode = base64Decoded;
|
|
171
|
-
|
|
172
|
-
// Step 2: Check if the decoded data is gzipped and decompress if needed
|
|
173
|
-
// Gzip files start with magic numbers: 1f 8b
|
|
174
|
-
if (processedCode.length >= 2 &&
|
|
175
|
-
processedCode.charCodeAt(0) === 0x1f &&
|
|
176
|
-
processedCode.charCodeAt(1) === 0x8b) {
|
|
177
|
-
console.log('Gzip signature detected, attempting decompression...');
|
|
178
|
-
processedCode = decompressGzip(processedCode);
|
|
179
|
-
console.log('Successfully decompressed gzipped data');
|
|
180
|
-
} else {
|
|
181
|
-
console.log('No gzip signature found, using Base64 decoded data');
|
|
182
|
-
}
|
|
183
|
-
} catch (base64Error) {
|
|
184
|
-
console.warn('Base64 decoding failed, trying direct gzip decompression:', base64Error);
|
|
185
|
-
|
|
186
|
-
// If Base64 fails, maybe it's already raw text or needs different handling
|
|
187
|
-
// Try to see if it's URL encoded
|
|
188
|
-
try {
|
|
189
|
-
const urlDecoded = decodeURIComponent(encodedCode);
|
|
190
|
-
if (urlDecoded !== encodedCode) {
|
|
191
|
-
console.log('URL decoding applied');
|
|
192
|
-
processedCode = urlDecoded;
|
|
193
|
-
}
|
|
194
|
-
} catch (urlError) {
|
|
195
|
-
console.warn('URL decoding failed:', urlError);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return processedCode;
|
|
200
|
-
} catch (error) {
|
|
201
|
-
console.error('Failed to process URL code parameter:', error);
|
|
202
|
-
|
|
203
|
-
// Return the original code as fallback (might be plain text)
|
|
204
|
-
console.log('All decoding attempts failed, using raw parameter value');
|
|
205
|
-
return encodedCode;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Initialize the renderer
|
|
210
|
-
async function initRenderer() {
|
|
211
|
-
try {
|
|
212
|
-
console.log('Waiting for ZenUML core to load...');
|
|
213
|
-
|
|
214
|
-
// Wait for ZenUML to be available
|
|
215
|
-
await waitForZenUML();
|
|
216
|
-
|
|
217
|
-
console.log('ZenUML core loaded successfully');
|
|
218
|
-
|
|
219
|
-
// Get the ZenUML instance that was created by main.ts
|
|
220
|
-
const zenUmlInstance = window.zenUml;
|
|
221
|
-
|
|
222
|
-
if (!zenUmlInstance) {
|
|
223
|
-
throw new Error('ZenUML instance not found');
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Verify ZenUML version
|
|
227
|
-
console.log('ZenUML Version:', window.ZENUML_VERSION);
|
|
228
|
-
|
|
229
|
-
// Extract and process code from URL parameters
|
|
230
|
-
const urlCodeParam = extractCodeFromURL();
|
|
231
|
-
let codeToRender = DEFAULT_ZENUML_CODE;
|
|
232
|
-
|
|
233
|
-
if (urlCodeParam) {
|
|
234
|
-
console.log('URL code parameter detected, processing...');
|
|
235
|
-
|
|
236
|
-
try {
|
|
237
|
-
// Process the URL code parameter (includes Base64 decoding)
|
|
238
|
-
const processedCode = processURLCodeParameter(urlCodeParam);
|
|
239
|
-
|
|
240
|
-
if (processedCode) {
|
|
241
|
-
codeToRender = processedCode;
|
|
242
|
-
addStatusIndicator('success', 'Code decoded and ready to render');
|
|
243
|
-
} else {
|
|
244
|
-
console.log('Processed code is empty, using default diagram');
|
|
245
|
-
addStatusIndicator('warning', 'Empty code parameter, using default');
|
|
246
|
-
}
|
|
247
|
-
} catch (error) {
|
|
248
|
-
console.error('Failed to process URL code parameter:', error);
|
|
249
|
-
addStatusIndicator('error', 'Failed to decode code parameter');
|
|
250
|
-
// Keep using default code
|
|
251
|
-
}
|
|
252
|
-
} else {
|
|
253
|
-
console.log('No URL code parameter, using default diagram');
|
|
254
|
-
addStatusIndicator('info', 'Using default diagram');
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Render the diagram
|
|
258
|
-
console.log('Rendering diagram...');
|
|
259
|
-
await zenUmlInstance.render(codeToRender);
|
|
260
|
-
|
|
261
|
-
console.log('Diagram rendered successfully');
|
|
262
|
-
|
|
263
|
-
console.log('ZenUML Web Renderer initialized successfully');
|
|
264
|
-
|
|
265
|
-
// Add success indicator to the page
|
|
266
|
-
addStatusIndicator('success', 'ZenUML Web Renderer Ready');
|
|
267
|
-
|
|
268
|
-
} catch (error) {
|
|
269
|
-
console.error('Failed to initialize renderer:', error);
|
|
270
|
-
addStatusIndicator('error', `Initialization failed: ${error.message}`);
|
|
271
|
-
|
|
272
|
-
// Show error in the diagram container
|
|
273
|
-
const diagramContainer = document.getElementById('zenuml-diagram');
|
|
274
|
-
if (diagramContainer) {
|
|
275
|
-
diagramContainer.innerHTML = `
|
|
276
|
-
<div style="padding: 20px; color: #dc2626; text-align: center;">
|
|
277
|
-
<h3>ZenUML Renderer Error</h3>
|
|
278
|
-
<p>Failed to initialize: ${error.message}</p>
|
|
279
|
-
<button onclick="location.reload()" style="margin-top: 10px; padding: 8px 16px; background: #dc2626; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
280
|
-
Retry
|
|
281
|
-
</button>
|
|
282
|
-
</div>
|
|
283
|
-
`;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// Wait for ZenUML to be available with timeout
|
|
289
|
-
function waitForZenUML(timeout = 10000) {
|
|
290
|
-
return new Promise((resolve, reject) => {
|
|
291
|
-
const startTime = Date.now();
|
|
292
|
-
|
|
293
|
-
const checkZenUml = () => {
|
|
294
|
-
if (typeof window.zenUml !== 'undefined') {
|
|
295
|
-
resolve();
|
|
296
|
-
} else if (Date.now() - startTime > timeout) {
|
|
297
|
-
reject(new Error('ZenUML loading timeout'));
|
|
298
|
-
} else {
|
|
299
|
-
setTimeout(checkZenUml, 100);
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
checkZenUml();
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Add status indicator to show initialization status
|
|
308
|
-
function addStatusIndicator(type, message) {
|
|
309
|
-
const indicator = document.createElement('div');
|
|
310
|
-
indicator.id = 'status-indicator';
|
|
311
|
-
|
|
312
|
-
let backgroundColor;
|
|
313
|
-
switch (type) {
|
|
314
|
-
case 'success':
|
|
315
|
-
backgroundColor = '#10b981';
|
|
316
|
-
break;
|
|
317
|
-
case 'error':
|
|
318
|
-
backgroundColor = '#dc2626';
|
|
319
|
-
break;
|
|
320
|
-
case 'info':
|
|
321
|
-
backgroundColor = '#3b82f6';
|
|
322
|
-
break;
|
|
323
|
-
case 'warning':
|
|
324
|
-
backgroundColor = '#f59e0b';
|
|
325
|
-
break;
|
|
326
|
-
default:
|
|
327
|
-
backgroundColor = '#6b7280';
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
indicator.style.cssText = `
|
|
331
|
-
position: fixed;
|
|
332
|
-
top: 10px;
|
|
333
|
-
right: 10px;
|
|
334
|
-
padding: 8px 12px;
|
|
335
|
-
border-radius: 4px;
|
|
336
|
-
font-size: 12px;
|
|
337
|
-
font-weight: 500;
|
|
338
|
-
z-index: 1000;
|
|
339
|
-
background: ${backgroundColor};
|
|
340
|
-
color: white;
|
|
341
|
-
`;
|
|
342
|
-
indicator.textContent = message;
|
|
343
|
-
document.body.appendChild(indicator);
|
|
344
|
-
|
|
345
|
-
// Auto-hide success and info messages after 3 seconds
|
|
346
|
-
if (type === 'success' || type === 'info') {
|
|
347
|
-
setTimeout(() => {
|
|
348
|
-
if (indicator.parentNode) {
|
|
349
|
-
indicator.parentNode.removeChild(indicator);
|
|
350
|
-
}
|
|
351
|
-
}, 3000);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// Start initialization when DOM is ready
|
|
356
|
-
if (document.readyState === 'loading') {
|
|
357
|
-
document.addEventListener('DOMContentLoaded', initRenderer);
|
|
358
|
-
} else {
|
|
359
|
-
initRenderer();
|
|
360
|
-
}
|
|
361
|
-
</script>
|
|
362
|
-
|
|
363
|
-
<!-- Load ZenUML core -->
|
|
364
|
-
<script type="module" src="/src/main.ts"></script>
|
|
365
|
-
</body>
|
|
366
|
-
</html>
|