@zenuml/core 3.35.2 → 3.37.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.
- package/AGENTS.md +38 -0
- package/dist/zenuml.esm.mjs +5905 -5902
- package/dist/zenuml.js +459 -459
- package/index.html +3 -2
- package/package.json +1 -1
- package/test-mermaid-zenuml.html +57 -0
package/index.html
CHANGED
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<div class="bg-gray-800 text-white px-4 py-3">
|
|
104
104
|
<h3 class="font-medium">Preview</h3>
|
|
105
105
|
</div>
|
|
106
|
-
<div style="height: calc(100% - 52px); overflow: auto;" class="p-4">
|
|
106
|
+
<div id="preview-scroll-root" style="height: calc(100% - 52px); overflow: auto;" class="p-4">
|
|
107
107
|
<pre class="zenuml" style="margin: 0"></pre>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
const updateDiagram = debounce((content) => {
|
|
128
128
|
const config = createConfig({
|
|
129
129
|
onContentChange: (code) => editor.setValue(code),
|
|
130
|
+
scrollRoot: document.getElementById('preview-scroll-root'),
|
|
130
131
|
});
|
|
131
132
|
|
|
132
133
|
window.zenUml.render(content, config).then((r) => {
|
|
@@ -209,4 +210,4 @@ WebApp --> Customer: Order confirmation`
|
|
|
209
210
|
</script>
|
|
210
211
|
<script type="module" src="/src/main.tsx"></script>
|
|
211
212
|
</body>
|
|
212
|
-
</html>
|
|
213
|
+
</html>
|
package/package.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<title>Mermaid Zenuml Test Page</title>
|
|
7
|
+
</head>
|
|
8
|
+
|
|
9
|
+
<body>
|
|
10
|
+
<h1>Zenuml demos</h1>
|
|
11
|
+
<pre class="mermaid">
|
|
12
|
+
zenuml
|
|
13
|
+
BookLibService.Borrow(id) {
|
|
14
|
+
User = Session.GetUser()
|
|
15
|
+
if(User.isActive) {
|
|
16
|
+
try {
|
|
17
|
+
BookRepository.Update(id, onLoan, User)
|
|
18
|
+
receipt = new Receipt(id, dueDate)
|
|
19
|
+
} catch (BookNotFoundException) {
|
|
20
|
+
ErrorService.onException(BookNotFoundException)
|
|
21
|
+
} finally {
|
|
22
|
+
Connection.close()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return receipt
|
|
26
|
+
}
|
|
27
|
+
</pre>
|
|
28
|
+
<pre class="mermaid">
|
|
29
|
+
zenuml
|
|
30
|
+
title Async Messages (SPA Authentication)
|
|
31
|
+
// ```
|
|
32
|
+
// GET https://${account.namespace}/authorize/?
|
|
33
|
+
// response_type=token
|
|
34
|
+
// &client_id=${account.clientId}
|
|
35
|
+
// &redirect_url=YOUR_CALLBACK_URL
|
|
36
|
+
// &state=VALUE_THAT_SURVIVES_REDIRECTS
|
|
37
|
+
// &scope=openid
|
|
38
|
+
// ```
|
|
39
|
+
Browser->Auth0: 1. initiate the authentication
|
|
40
|
+
Auth0->"Identity Provider": 2. OAuth2 / SAML, etc
|
|
41
|
+
"Identity Provider"->"Identity Provider": 3. user gets authenticated
|
|
42
|
+
Auth0->Browser: 4. redirect to ${YOUR_CALLBACK_URL}/#id_token=e68...
|
|
43
|
+
Browser->Auth0: 5. validate id_token and get user profile
|
|
44
|
+
Browser->"Your API": 6. call API sending JWT in Authorization header
|
|
45
|
+
"Your API"->"Your API": 7. validate token
|
|
46
|
+
</pre>
|
|
47
|
+
|
|
48
|
+
<script type="module">
|
|
49
|
+
import mermaid from 'https://unpkg.com/mermaid/dist/mermaid.esm.mjs';
|
|
50
|
+
import zenuml from 'https://unpkg.com/@mermaid-js/mermaid-zenuml/dist/mermaid-zenuml.esm.mjs';
|
|
51
|
+
await mermaid.registerExternalDiagrams([zenuml]);
|
|
52
|
+
mermaid.initialize({
|
|
53
|
+
logLevel: 3,
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|