@eventcatalog/core 2.33.1 → 2.33.3
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/README.md +2 -1
- 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-IVIWGH2J.js → chunk-557OECV4.js} +1 -1
- package/dist/{chunk-VDBGM3NV.js → chunk-5QUF2S7L.js} +1 -1
- package/dist/{chunk-R3X2SCY6.js → chunk-5TXSONUY.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/Lists/PillList.tsx +2 -2
- package/eventcatalog/src/components/Lists/PillListFlat.tsx +1 -1
- package/eventcatalog/src/components/Lists/ProtocolList.tsx +2 -2
- package/eventcatalog/src/components/MDX/ResourceLink/ResourceLink.astro +34 -7
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaProperty.astro +161 -0
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.astro +37 -70
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewerPortal.tsx +1 -1
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewerRoot.astro +98 -0
- package/eventcatalog/src/icons/protocols/grpc.svg +1 -0
- package/eventcatalog/src/icons/protocols/index.ts +2 -0
- package/eventcatalog/src/icons/protocols/zmq.svg +1 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +11 -3
- package/eventcatalog/src/shared-collections.ts +1 -0
- package/eventcatalog/src/utils/badges.ts +5 -0
- package/package.json +4 -6
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.tsx +0 -62
- package/eventcatalog/src/components/MDX/SchemaViewer/css/stoplight-mosaic-styles.css +0 -29609
- package/eventcatalog/src/components/MDX/SchemaViewer/css/stoplight-mosaic-theme-default.css +0 -333
|
@@ -4,7 +4,7 @@ import Footer from '@layouts/Footer.astro';
|
|
|
4
4
|
|
|
5
5
|
import components from '@components/MDX/components';
|
|
6
6
|
import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
|
|
7
|
-
import SchemaViewer from '@components/MDX/SchemaViewer/
|
|
7
|
+
import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
|
|
8
8
|
|
|
9
9
|
// SideBars
|
|
10
10
|
import ServiceSideBar from '@components/SideBars/ServiceSideBar.astro';
|
|
@@ -23,6 +23,7 @@ import { render } from 'astro:content';
|
|
|
23
23
|
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
|
|
24
24
|
|
|
25
25
|
import config from '@config';
|
|
26
|
+
import { getIcon } from '@utils/badges';
|
|
26
27
|
|
|
27
28
|
export async function getStaticPaths() {
|
|
28
29
|
const itemTypes: PageTypes[] = ['events', 'commands', 'queries', 'services', 'domains', 'flows', 'channels'];
|
|
@@ -52,6 +53,12 @@ const { Content } = await render(props);
|
|
|
52
53
|
const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
|
|
53
54
|
const contentBadges = props.data.badges || [];
|
|
54
55
|
|
|
56
|
+
const getContentBadges = () =>
|
|
57
|
+
contentBadges.map((badge) => ({
|
|
58
|
+
...badge,
|
|
59
|
+
icon: badge.icon ? getIcon(badge.icon) : null,
|
|
60
|
+
}));
|
|
61
|
+
|
|
55
62
|
const getBadge = () => {
|
|
56
63
|
if (props.collection === 'services') {
|
|
57
64
|
return { backgroundColor: 'pink', textColor: 'pink', content: 'Service', icon: ServerIcon, class: 'text-pink-400' };
|
|
@@ -115,7 +122,7 @@ const getSpecificationBadges = () => {
|
|
|
115
122
|
return badges;
|
|
116
123
|
};
|
|
117
124
|
|
|
118
|
-
const badges = [getBadge(), ...
|
|
125
|
+
const badges = [getBadge(), ...getContentBadges(), ...getSpecificationBadges()];
|
|
119
126
|
|
|
120
127
|
// Index only the latest version
|
|
121
128
|
const pagefindAttributes =
|
|
@@ -202,7 +209,8 @@ const pagefindAttributes =
|
|
|
202
209
|
</div>
|
|
203
210
|
<div data-pagefind-ignore>
|
|
204
211
|
<!-- @ts-ignore -->
|
|
205
|
-
<SchemaViewer id={props.data.id} catalog={props.catalog} filePath={props.filePath} />
|
|
212
|
+
<!-- <SchemaViewer id={props.data.id} catalog={props.catalog} filePath={props.filePath} /> -->
|
|
213
|
+
<SchemaViewer id={props.data.id} filePath={props.filePath} />
|
|
206
214
|
<NodeGraph
|
|
207
215
|
id={props.data.id}
|
|
208
216
|
collection={props.collection}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "2.33.
|
|
9
|
+
"version": "2.33.3",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@astrojs/markdown-remark": "^6.3.1",
|
|
25
|
-
"@astrojs/mdx": "^4.2.
|
|
26
|
-
"@astrojs/react": "^4.2.
|
|
25
|
+
"@astrojs/mdx": "^4.2.3",
|
|
26
|
+
"@astrojs/react": "^4.2.3",
|
|
27
27
|
"@astrojs/rss": "^4.0.11",
|
|
28
28
|
"@astrojs/tailwind": "^6.0.2",
|
|
29
29
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
@@ -42,11 +42,10 @@
|
|
|
42
42
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
43
43
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
44
44
|
"@scalar/api-reference-react": "^0.4.37",
|
|
45
|
-
"@stoplight/json-schema-viewer": "^4.16.4",
|
|
46
45
|
"@tailwindcss/typography": "^0.5.13",
|
|
47
46
|
"@tanstack/react-table": "^8.17.3",
|
|
48
47
|
"@xyflow/react": "^12.3.6",
|
|
49
|
-
"astro": "^5.5.
|
|
48
|
+
"astro": "^5.5.6",
|
|
50
49
|
"astro-expressive-code": "^0.40.1",
|
|
51
50
|
"astro-pagefind": "^1.6.0",
|
|
52
51
|
"astro-seo": "^0.8.4",
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
"lucide-react": "^0.453.0",
|
|
70
69
|
"marked": "^15.0.6",
|
|
71
70
|
"mermaid": "^11.4.1",
|
|
72
|
-
"prismjs": "^1.29.0",
|
|
73
71
|
"react": "^18.3.1",
|
|
74
72
|
"react-dom": "^18.3.1",
|
|
75
73
|
"rehype-slug": "^6.0.0",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import 'prismjs';
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import { JsonSchemaViewer } from '@stoplight/json-schema-viewer';
|
|
6
|
-
import './css/stoplight-mosaic-styles.css';
|
|
7
|
-
import './css/stoplight-mosaic-theme-default.css';
|
|
8
|
-
|
|
9
|
-
import { createPortal } from 'react-dom';
|
|
10
|
-
|
|
11
|
-
type Props = {
|
|
12
|
-
id: string;
|
|
13
|
-
file: string;
|
|
14
|
-
renderRootTreeLines?: boolean;
|
|
15
|
-
hideExamples?: boolean;
|
|
16
|
-
defaultExpandedDepth?: number;
|
|
17
|
-
maxHeight?: string;
|
|
18
|
-
schema: any;
|
|
19
|
-
catalog: any;
|
|
20
|
-
title?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const SchemaViewer = ({
|
|
24
|
-
id,
|
|
25
|
-
maxHeight = '500',
|
|
26
|
-
renderRootTreeLines = true,
|
|
27
|
-
hideExamples = false,
|
|
28
|
-
defaultExpandedDepth = 3,
|
|
29
|
-
title,
|
|
30
|
-
schema,
|
|
31
|
-
}: Props) => {
|
|
32
|
-
const [elem, setElem] = useState(null);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
setElem(document.getElementById(`${id}-SchemaViewer-portal`));
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
if (!elem) return null;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div>
|
|
42
|
-
{createPortal(
|
|
43
|
-
<section className="not-prose space-y-2 ">
|
|
44
|
-
{title && <h2 className="text-3xl font-bold">{title}</h2>}
|
|
45
|
-
<div className="border border-gray-100 p-2 schemaViewer">
|
|
46
|
-
<JsonSchemaViewer
|
|
47
|
-
schema={schema}
|
|
48
|
-
emptyText="No schema defined"
|
|
49
|
-
maxHeight={parseInt(maxHeight, 10)}
|
|
50
|
-
defaultExpandedDepth={defaultExpandedDepth}
|
|
51
|
-
renderRootTreeLines={renderRootTreeLines}
|
|
52
|
-
hideExamples={hideExamples}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</section>,
|
|
56
|
-
elem
|
|
57
|
-
)}
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default SchemaViewer;
|