@vmz/plugin-mermaid 0.2.2 → 0.2.4

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.
@@ -1,24 +1,26 @@
1
1
  <template>
2
- <div class="mermaid-host" html={html != null ? html : fallback(source)}></div>
2
+ <div v-html="html != null ? html : fallback(source)" class="mermaid-host" />
3
3
  </template>
4
-
5
4
  <script client>
6
- import { renderMermaid, renderMermaidFallback } from '@vmz/plugin-mermaid/runtime';
5
+ import { renderMermaid, renderMermaidFallback } from "@vmz/plugin-mermaid/runtime";
7
6
 
8
7
  function fallback(source) {
9
- return renderMermaidFallback(source);
8
+ return renderMermaidFallback(source);
10
9
  }
11
10
 
12
11
  export default class Mermaid {
13
- public source: string = '';
14
- html: string | null = null;
12
+ public source: string = "";
13
+ html: string | null = null;
15
14
 
16
- async onMount() {
17
- try {
18
- this.html = await renderMermaid(this.source, 'vmz-mmd-' + Math.random().toString(36).slice(2));
19
- } catch {
20
- this.html = renderMermaidFallback(this.source);
15
+ async onMount() {
16
+ try {
17
+ this.html = await renderMermaid(
18
+ this.source,
19
+ "vmz-mmd-" + Math.random().toString(36).slice(2),
20
+ );
21
+ } catch {
22
+ this.html = renderMermaidFallback(this.source);
23
+ }
21
24
  }
22
- }
23
25
  }
24
26
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vmz/plugin-mermaid",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "description": "VMZ Mermaid diagram adapter - <Mermaid>",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@vmz/plugin": "0.2.2"
20
+ "@vmz/plugin": "0.2.4"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "mermaid": ">=11"