@eventcatalog/core 2.56.3 → 2.56.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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-OHDQ4LG4.js → chunk-HHPUSHCO.js} +1 -1
- package/dist/{chunk-RB5C7AID.js → chunk-KASHKMSG.js} +1 -1
- package/dist/{chunk-TBYGYYON.js → chunk-QS3LKU6Y.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/MDX/MermaidFileLoader/MermaidFileLoader.astro +56 -0
- package/eventcatalog/src/components/MDX/components.tsx +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-QS3LKU6Y.js";
|
|
4
|
+
import "../chunk-KASHKMSG.js";
|
|
5
|
+
import "../chunk-HHPUSHCO.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-QS3LKU6Y.js";
|
|
10
|
+
import "./chunk-KASHKMSG.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-55D645EH.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HHPUSHCO.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { getAbsoluteFilePathForAstroFile } from '@utils/files';
|
|
4
|
+
import Admonition from '@components/MDX/Admonition';
|
|
5
|
+
|
|
6
|
+
const { file: mermaidFile, filePath } = Astro.props;
|
|
7
|
+
|
|
8
|
+
// const escapeHtml = (str: string) => str.replace(/[&<>"']/g, (c) => escapeMap[c]);
|
|
9
|
+
let isValidMermaidFile = mermaidFile.endsWith('.mmd') || mermaidFile.endsWith('.mermaid');
|
|
10
|
+
let mermaidFileContent = '';
|
|
11
|
+
|
|
12
|
+
if (isValidMermaidFile) {
|
|
13
|
+
try {
|
|
14
|
+
const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, mermaidFile);
|
|
15
|
+
mermaidFileContent = fs.readFileSync(pathToSpec, 'utf8');
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(`Error reading design file: ${error}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
!mermaidFileContent && (
|
|
24
|
+
<Admonition type="warning">
|
|
25
|
+
<div>
|
|
26
|
+
<span class="block font-bold">{`<MermaidFileLoader/>`} failed to load</span>
|
|
27
|
+
<span class="block">
|
|
28
|
+
Tried to load mermaid file: {mermaidFile}. Make sure you have this mermaid file defined in your project.
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
</Admonition>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
!isValidMermaidFile && (
|
|
37
|
+
<Admonition type="warning">
|
|
38
|
+
<div>
|
|
39
|
+
<span class="block font-bold">{`<MermaidFileLoader/>`} failed to load</span>
|
|
40
|
+
<span class="block">
|
|
41
|
+
Tried to load mermaid file: {mermaidFile}. Make sure the file extension is either .mmd or .mermaid.
|
|
42
|
+
</span>
|
|
43
|
+
</div>
|
|
44
|
+
</Admonition>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
mermaidFileContent && isValidMermaidFile && (
|
|
50
|
+
<div class="mermaid-block pb-4">
|
|
51
|
+
<div class="mermaid border border-gray-200 rounded-lg p-1" data-content={mermaidFileContent}>
|
|
52
|
+
<p>Loading graph...</p>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -25,6 +25,7 @@ import Lucid from '@components/MDX/Lucid/Lucid.astro';
|
|
|
25
25
|
import DrawIO from '@components/MDX/DrawIO/DrawIO.astro';
|
|
26
26
|
import FigJam from '@components/MDX/FigJam/FigJam.astro';
|
|
27
27
|
import Design from '@components/MDX/Design/Design.astro';
|
|
28
|
+
import MermaidFileLoader from '@components/MDX/MermaidFileLoader/MermaidFileLoader.astro';
|
|
28
29
|
// Portals: required for server/client components
|
|
29
30
|
import NodeGraphPortal from '@components/MDX/NodeGraph/NodeGraphPortal';
|
|
30
31
|
import SchemaViewerPortal from '@components/MDX/SchemaViewer/SchemaViewerPortal';
|
|
@@ -62,6 +63,7 @@ const components = (props: any) => {
|
|
|
62
63
|
Lucid: (mdxProp: any) => jsx(Lucid, { ...props, ...mdxProp }),
|
|
63
64
|
DrawIO: (mdxProp: any) => jsx(DrawIO, { ...props, ...mdxProp }),
|
|
64
65
|
FigJam: (mdxProp: any) => jsx(FigJam, { ...props, ...mdxProp }),
|
|
66
|
+
MermaidFileLoader: (mdxProp: any) => jsx(MermaidFileLoader, { ...props, ...mdxProp }),
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
69
|
|