@eventcatalog/core 2.50.1 → 2.50.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/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-BTQCPTER.js → chunk-JCCZIMIQ.js} +1 -1
- package/dist/{chunk-SDBKZ3UM.js → chunk-RGWI2XAA.js} +1 -1
- package/dist/{chunk-UG5JRBOA.js → chunk-ZTETQ7PD.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/CopyAsMarkdown.tsx +150 -52
- package/eventcatalog/src/components/MDX/Accordion/Accordion.tsx +40 -17
- package/eventcatalog/src/components/MDX/Flow/Flow.astro +4 -1
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +16 -1
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +12 -2
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +7 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +27 -14
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ZTETQ7PD.js";
|
|
4
|
+
import "../chunk-JCCZIMIQ.js";
|
|
5
|
+
import "../chunk-RGWI2XAA.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.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-XE6PFSH5.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-ZTETQ7PD.js";
|
|
10
|
+
import "./chunk-JCCZIMIQ.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import "./chunk-LDBRNJIL.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RGWI2XAA.js";
|
|
19
19
|
import {
|
|
20
20
|
isAuthEnabled,
|
|
21
21
|
isBackstagePluginEnabled,
|
|
@@ -47,18 +47,78 @@ export function CopyPageMenu({
|
|
|
47
47
|
chatQuery,
|
|
48
48
|
chatEnabled = false,
|
|
49
49
|
editUrl,
|
|
50
|
+
markdownDownloadEnabled = false,
|
|
50
51
|
}: {
|
|
51
52
|
schemas: Schema[];
|
|
52
53
|
chatQuery?: string;
|
|
53
54
|
chatEnabled: boolean;
|
|
54
55
|
editUrl: string;
|
|
56
|
+
markdownDownloadEnabled: boolean;
|
|
55
57
|
}) {
|
|
56
|
-
|
|
58
|
+
// Define available actions
|
|
59
|
+
const availableActions = {
|
|
60
|
+
copyMarkdown: markdownDownloadEnabled,
|
|
61
|
+
editPage: !!editUrl,
|
|
62
|
+
copySchemas: schemas.length > 0,
|
|
63
|
+
viewMarkdown: markdownDownloadEnabled,
|
|
64
|
+
chat: chatEnabled,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Check if any actions are available
|
|
68
|
+
const hasAnyActions = Object.values(availableActions).some(Boolean);
|
|
69
|
+
|
|
70
|
+
// If no actions are available, return null
|
|
71
|
+
if (!hasAnyActions) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
57
74
|
|
|
58
75
|
// get the url of the current page
|
|
59
76
|
const url = window.location.href;
|
|
60
77
|
const markdownUrl = url + '.mdx';
|
|
61
78
|
|
|
79
|
+
// Determine the default action based on what's available
|
|
80
|
+
const getDefaultAction = () => {
|
|
81
|
+
if (availableActions.copyMarkdown) {
|
|
82
|
+
return {
|
|
83
|
+
type: 'copyMarkdown',
|
|
84
|
+
text: 'Copy page',
|
|
85
|
+
icon: Copy,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (availableActions.editPage) {
|
|
89
|
+
return {
|
|
90
|
+
type: 'editPage',
|
|
91
|
+
text: 'Edit page',
|
|
92
|
+
icon: PenSquareIcon,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (availableActions.copySchemas) {
|
|
96
|
+
return {
|
|
97
|
+
type: 'copySchemas',
|
|
98
|
+
text: 'Copy schema',
|
|
99
|
+
icon: FileText,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (availableActions.viewMarkdown) {
|
|
103
|
+
return {
|
|
104
|
+
type: 'viewMarkdown',
|
|
105
|
+
text: 'View Markdown',
|
|
106
|
+
icon: FileText,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (availableActions.chat) {
|
|
110
|
+
return {
|
|
111
|
+
type: 'chat',
|
|
112
|
+
text: 'Open Chat',
|
|
113
|
+
icon: MessageCircleQuestion,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const defaultAction = getDefaultAction();
|
|
120
|
+
const [buttonText, setButtonText] = useState(defaultAction?.text || 'Action');
|
|
121
|
+
|
|
62
122
|
// Fetch the markdown from the url + .mdx
|
|
63
123
|
const copyMarkdownToClipboard = async () => {
|
|
64
124
|
console.log('Copying markdown to clipboard');
|
|
@@ -70,11 +130,11 @@ export function CopyPageMenu({
|
|
|
70
130
|
}
|
|
71
131
|
const markdown = await response.text();
|
|
72
132
|
await navigator.clipboard.writeText(markdown);
|
|
73
|
-
setTimeout(() => setButtonText(
|
|
133
|
+
setTimeout(() => setButtonText(defaultAction?.text || 'Action'), 3000); // Revert after 3 seconds
|
|
74
134
|
} catch (error) {
|
|
75
135
|
console.error('Failed to copy markdown:', error);
|
|
76
136
|
setButtonText('Copy failed'); // Provide feedback on failure
|
|
77
|
-
setTimeout(() => setButtonText(
|
|
137
|
+
setTimeout(() => setButtonText(defaultAction?.text || 'Action'), 3000);
|
|
78
138
|
}
|
|
79
139
|
};
|
|
80
140
|
|
|
@@ -91,25 +151,52 @@ export function CopyPageMenu({
|
|
|
91
151
|
}
|
|
92
152
|
const schemaContent = await response.text(); // Or response.json() if it's always JSON
|
|
93
153
|
await navigator.clipboard.writeText(schemaContent);
|
|
94
|
-
setTimeout(() => setButtonText(
|
|
154
|
+
setTimeout(() => setButtonText(defaultAction?.text || 'Action'), 3000); // Revert after 3 seconds
|
|
95
155
|
} catch (error) {
|
|
96
156
|
console.error('Failed to copy schema:', error);
|
|
97
157
|
setButtonText('Copy failed'); // Provide feedback on failure
|
|
98
|
-
setTimeout(() => setButtonText(
|
|
158
|
+
setTimeout(() => setButtonText(defaultAction?.text || 'Action'), 3000);
|
|
99
159
|
}
|
|
100
160
|
};
|
|
101
161
|
|
|
162
|
+
// Handle the default action based on type
|
|
163
|
+
const handleDefaultAction = () => {
|
|
164
|
+
if (!defaultAction) return;
|
|
165
|
+
|
|
166
|
+
switch (defaultAction.type) {
|
|
167
|
+
case 'copyMarkdown':
|
|
168
|
+
copyMarkdownToClipboard();
|
|
169
|
+
break;
|
|
170
|
+
case 'editPage':
|
|
171
|
+
window.open(editUrl, '_blank');
|
|
172
|
+
break;
|
|
173
|
+
case 'copySchemas':
|
|
174
|
+
copySchemaToClipboard(schemas[0]);
|
|
175
|
+
break;
|
|
176
|
+
case 'viewMarkdown':
|
|
177
|
+
window.open(markdownUrl, '_blank');
|
|
178
|
+
break;
|
|
179
|
+
case 'chat':
|
|
180
|
+
window.open(buildUrl(`/chat?query=${chatQuery}`));
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
if (!defaultAction) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
|
|
102
189
|
return (
|
|
103
190
|
<DropdownMenu.Root>
|
|
104
191
|
{/* Container for the split button */}
|
|
105
192
|
<div className="inline-flex rounded-md shadow-sm border border-gray-300">
|
|
106
|
-
{/* Left Button:
|
|
193
|
+
{/* Left Button: Default Action */}
|
|
107
194
|
<button
|
|
108
195
|
type="button"
|
|
109
|
-
onClick={
|
|
196
|
+
onClick={handleDefaultAction}
|
|
110
197
|
className="inline-flex items-center justify-center gap-1 px-3 py-1.5 text-sm font-medium text-gray-700 bg-white rounded-l-md hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500"
|
|
111
198
|
>
|
|
112
|
-
<
|
|
199
|
+
<defaultAction.icon className="w-4 h-4" />
|
|
113
200
|
{buttonText}
|
|
114
201
|
</button>
|
|
115
202
|
{/* Right Button: Dropdown Trigger */}
|
|
@@ -130,14 +217,16 @@ export function CopyPageMenu({
|
|
|
130
217
|
sideOffset={5}
|
|
131
218
|
align="end"
|
|
132
219
|
>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
220
|
+
{availableActions.copyMarkdown && (
|
|
221
|
+
<DropdownMenu.Item
|
|
222
|
+
className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
|
|
223
|
+
onSelect={() => copyMarkdownToClipboard()}
|
|
224
|
+
>
|
|
225
|
+
<MenuItemContent icon={Copy} title="Copy page" description="Copy page as Markdown for LLMs" />
|
|
226
|
+
</DropdownMenu.Item>
|
|
227
|
+
)}
|
|
139
228
|
|
|
140
|
-
{
|
|
229
|
+
{availableActions.editPage && (
|
|
141
230
|
<DropdownMenu.Item
|
|
142
231
|
className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
|
|
143
232
|
onSelect={() => window.open(editUrl, '_blank')}
|
|
@@ -151,49 +240,58 @@ export function CopyPageMenu({
|
|
|
151
240
|
</DropdownMenu.Item>
|
|
152
241
|
)}
|
|
153
242
|
|
|
154
|
-
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
243
|
+
{availableActions.copySchemas &&
|
|
244
|
+
schemas.map((schema) => {
|
|
245
|
+
const title =
|
|
246
|
+
schema.format === 'asyncapi'
|
|
247
|
+
? 'Copy AsyncAPI specification'
|
|
248
|
+
: schema.format === 'openapi'
|
|
249
|
+
? 'Copy OpenAPI specification'
|
|
250
|
+
: 'Copy schema';
|
|
251
|
+
const type =
|
|
252
|
+
schema.format === 'asyncapi' || schema.format === 'openapi'
|
|
253
|
+
? 'specification'
|
|
254
|
+
: `${schema.format.toUpperCase()} schema`;
|
|
255
|
+
|
|
256
|
+
const Icon =
|
|
257
|
+
schema.format === 'asyncapi' ? (
|
|
258
|
+
<img src={buildUrl('/icons/asyncapi.svg', true)} className="w-4 h-4" />
|
|
259
|
+
) : schema.format === 'openapi' ? (
|
|
260
|
+
<img src={buildUrl('/icons/openapi.svg', true)} className="w-4 h-4" />
|
|
261
|
+
) : (
|
|
262
|
+
FileText
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
return (
|
|
266
|
+
<DropdownMenu.Item
|
|
267
|
+
key={schema.url}
|
|
268
|
+
className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
|
|
269
|
+
onSelect={() => copySchemaToClipboard(schema)}
|
|
270
|
+
>
|
|
271
|
+
<MenuItemContent icon={Icon} title={title} description={`Copy ${type} to clipboard`} />
|
|
272
|
+
</DropdownMenu.Item>
|
|
173
273
|
);
|
|
274
|
+
})}
|
|
174
275
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
</DropdownMenu.Item>
|
|
191
|
-
{chatEnabled && (
|
|
276
|
+
{availableActions.viewMarkdown && (
|
|
277
|
+
<DropdownMenu.Item
|
|
278
|
+
className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
|
|
279
|
+
onSelect={() => window.open(markdownUrl, '_blank')}
|
|
280
|
+
>
|
|
281
|
+
<MenuItemContent
|
|
282
|
+
icon={FileText}
|
|
283
|
+
title="View as Markdown"
|
|
284
|
+
description="View this page as plain text"
|
|
285
|
+
external={true}
|
|
286
|
+
/>
|
|
287
|
+
</DropdownMenu.Item>
|
|
288
|
+
)}
|
|
289
|
+
|
|
290
|
+
{availableActions.chat && (
|
|
192
291
|
<DropdownMenu.Item
|
|
193
292
|
className="cursor-pointer hover:bg-gray-100 focus:outline-none focus:bg-gray-100"
|
|
194
293
|
onSelect={() => window.open(buildUrl(`/chat?query=${chatQuery}`))}
|
|
195
294
|
>
|
|
196
|
-
{/* Using MessageCircleQuestion as a placeholder for Claude logo */}
|
|
197
295
|
<MenuItemContent
|
|
198
296
|
icon={MessageCircleQuestion}
|
|
199
297
|
title="Open in EventCatalog Chat"
|
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/react';
|
|
2
2
|
import { MinusIcon } from '@heroicons/react/16/solid';
|
|
3
3
|
import { PlusIcon } from '@heroicons/react/24/outline';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
renderDiagrams?: (graphs: HTMLCollectionOf<Element>) => void;
|
|
9
|
+
renderPlantUML?: (graphs: HTMLCollectionOf<Element>) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
|
|
5
13
|
export default function Example({ title, children }: any) {
|
|
6
14
|
return (
|
|
7
15
|
<div className="border border-gray-200 rounded-md px-4 shadow-sm py-2 accordion">
|
|
8
16
|
<Disclosure as="div" key={title} className="">
|
|
9
|
-
{({ open }) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
{({ open }) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (open) {
|
|
20
|
+
const graphs = document.getElementsByClassName('mermaid');
|
|
21
|
+
const plantUML = document.getElementsByClassName('plantuml');
|
|
22
|
+
if (graphs.length > 0 && window.renderDiagrams) {
|
|
23
|
+
window.renderDiagrams(graphs);
|
|
24
|
+
}
|
|
25
|
+
if (plantUML.length > 0 && window.renderPlantUML) {
|
|
26
|
+
window.renderPlantUML(plantUML);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, [open]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div>
|
|
33
|
+
<DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
|
|
34
|
+
<span className="text-base font-semibold leading-7">{title}</span>
|
|
35
|
+
<span className="ml-6 flex h-7 items-center">
|
|
36
|
+
{open ? (
|
|
37
|
+
<MinusIcon className="h-6 w-6" aria-hidden="true" />
|
|
38
|
+
) : (
|
|
39
|
+
<PlusIcon className="h-6 w-6" aria-hidden="true" />
|
|
40
|
+
)}
|
|
41
|
+
</span>
|
|
42
|
+
</DisclosureButton>
|
|
43
|
+
<DisclosurePanel as="dd" className="pr-12 py-4 prose prose-sm max-w-none">
|
|
44
|
+
<div className="text-base leading-7 text-gray-600">{children}</div>
|
|
45
|
+
</DisclosurePanel>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}}
|
|
26
49
|
</Disclosure>
|
|
27
50
|
</div>
|
|
28
51
|
);
|
|
@@ -5,7 +5,7 @@ import Admonition from '@components/MDX/Admonition';
|
|
|
5
5
|
import NodeGraph from '../NodeGraph/NodeGraph';
|
|
6
6
|
import { getVersionFromCollection } from '@utils/collections/versions';
|
|
7
7
|
|
|
8
|
-
const { id, version = 'latest', maxHeight, includeKey = true } = Astro.props;
|
|
8
|
+
const { id, version = 'latest', maxHeight, includeKey = true, mode = 'simple', walkthrough = true, search = true } = Astro.props;
|
|
9
9
|
|
|
10
10
|
// Find the flow for the given id and version
|
|
11
11
|
const flows = await getFlows();
|
|
@@ -17,6 +17,7 @@ const flow = flowCollection[0];
|
|
|
17
17
|
const { nodes, edges } = await getNodesAndEdges({
|
|
18
18
|
id: id,
|
|
19
19
|
version: flow.data.version,
|
|
20
|
+
mode: mode,
|
|
20
21
|
});
|
|
21
22
|
---
|
|
22
23
|
|
|
@@ -53,6 +54,8 @@ const { nodes, edges } = await getNodesAndEdges({
|
|
|
53
54
|
includeKey={includeKey}
|
|
54
55
|
footerLabel=`Flow diagram - ${flow.data.name} - v(${flow.data.version})`
|
|
55
56
|
client:only="react"
|
|
57
|
+
showFlowWalkthrough={walkthrough}
|
|
58
|
+
showSearch={search}
|
|
56
59
|
/>
|
|
57
60
|
</div>
|
|
58
61
|
|
|
@@ -30,9 +30,22 @@ interface Props {
|
|
|
30
30
|
url: string;
|
|
31
31
|
};
|
|
32
32
|
linksToVisualiser?: boolean;
|
|
33
|
+
showSearch?: boolean;
|
|
34
|
+
showLegend?: boolean;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
id,
|
|
39
|
+
collection,
|
|
40
|
+
title,
|
|
41
|
+
mode = 'simple',
|
|
42
|
+
linkTo = 'docs',
|
|
43
|
+
version,
|
|
44
|
+
href,
|
|
45
|
+
linksToVisualiser,
|
|
46
|
+
showSearch = true,
|
|
47
|
+
showLegend = true,
|
|
48
|
+
} = Astro.props;
|
|
36
49
|
|
|
37
50
|
let nodes = [],
|
|
38
51
|
edges = [];
|
|
@@ -121,6 +134,8 @@ if (collection === 'domains-entities') {
|
|
|
121
134
|
linksToVisualiser={linksToVisualiser}
|
|
122
135
|
links={links}
|
|
123
136
|
mode={mode}
|
|
137
|
+
showSearch={showSearch}
|
|
138
|
+
includeKey={showLegend}
|
|
124
139
|
/>
|
|
125
140
|
</div>
|
|
126
141
|
|
|
@@ -55,6 +55,8 @@ interface Props {
|
|
|
55
55
|
linksToVisualiser?: boolean;
|
|
56
56
|
links?: { label: string; url: string }[];
|
|
57
57
|
mode?: 'full' | 'simple';
|
|
58
|
+
showFlowWalkthrough?: boolean;
|
|
59
|
+
showSearch?: boolean;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
const getVisualiserUrlForCollection = (collectionItem: CollectionEntry<CollectionTypes>) => {
|
|
@@ -71,6 +73,8 @@ const NodeGraphBuilder = ({
|
|
|
71
73
|
linksToVisualiser = false,
|
|
72
74
|
links = [],
|
|
73
75
|
mode = 'full',
|
|
76
|
+
showFlowWalkthrough = true,
|
|
77
|
+
showSearch = true,
|
|
74
78
|
}: Props) => {
|
|
75
79
|
const nodeTypes = useMemo(
|
|
76
80
|
() => ({
|
|
@@ -492,7 +496,7 @@ const NodeGraphBuilder = ({
|
|
|
492
496
|
</span>
|
|
493
497
|
)}
|
|
494
498
|
</div>
|
|
495
|
-
{mode === 'full' && (
|
|
499
|
+
{mode === 'full' && showSearch && (
|
|
496
500
|
<div className="flex justify-end space-x-2 w-96">
|
|
497
501
|
<VisualiserSearch ref={searchRef} nodes={nodes} onNodeSelect={handleNodeSelect} onClear={handleSearchClear} />
|
|
498
502
|
</div>
|
|
@@ -588,7 +592,7 @@ const NodeGraphBuilder = ({
|
|
|
588
592
|
)}
|
|
589
593
|
{includeBackground && <Background color="#bbb" gap={16} />}
|
|
590
594
|
{includeBackground && <Controls />}
|
|
591
|
-
{isFlowVisualization && (
|
|
595
|
+
{isFlowVisualization && showFlowWalkthrough && (
|
|
592
596
|
<Panel position="bottom-left">
|
|
593
597
|
<StepWalkthrough
|
|
594
598
|
nodes={nodes}
|
|
@@ -637,6 +641,8 @@ interface NodeGraphProps {
|
|
|
637
641
|
links?: { label: string; url: string }[];
|
|
638
642
|
mode?: 'full' | 'simple';
|
|
639
643
|
portalId?: string;
|
|
644
|
+
showFlowWalkthrough?: boolean;
|
|
645
|
+
showSearch?: boolean;
|
|
640
646
|
}
|
|
641
647
|
|
|
642
648
|
const NodeGraph = ({
|
|
@@ -653,6 +659,8 @@ const NodeGraph = ({
|
|
|
653
659
|
links = [],
|
|
654
660
|
mode = 'full',
|
|
655
661
|
portalId,
|
|
662
|
+
showFlowWalkthrough = true,
|
|
663
|
+
showSearch = true,
|
|
656
664
|
}: NodeGraphProps) => {
|
|
657
665
|
const [elem, setElem] = useState(null);
|
|
658
666
|
const [showFooter, setShowFooter] = useState(true);
|
|
@@ -687,6 +695,8 @@ const NodeGraph = ({
|
|
|
687
695
|
linksToVisualiser={linksToVisualiser}
|
|
688
696
|
links={links}
|
|
689
697
|
mode={mode}
|
|
698
|
+
showFlowWalkthrough={showFlowWalkthrough}
|
|
699
|
+
showSearch={showSearch}
|
|
690
700
|
/>
|
|
691
701
|
|
|
692
702
|
{showFooter && (
|
|
@@ -410,6 +410,9 @@ const badges = doc?.badges || [];
|
|
|
410
410
|
renderDiagrams(graphs);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
+
// Make renderDiagrams available globally for accordion component
|
|
414
|
+
window.renderDiagrams = renderDiagrams;
|
|
415
|
+
|
|
413
416
|
document.addEventListener('astro:page-load', setupObserver);
|
|
414
417
|
</script>
|
|
415
418
|
|
|
@@ -467,5 +470,9 @@ const badges = doc?.badges || [];
|
|
|
467
470
|
if (document.getElementsByClassName('plantuml').length > 0) {
|
|
468
471
|
renderPlantUML(graphs, deflate);
|
|
469
472
|
}
|
|
473
|
+
|
|
474
|
+
window.renderPlantUML = (graphs: any) => {
|
|
475
|
+
renderPlantUML(graphs, deflate);
|
|
476
|
+
};
|
|
470
477
|
});
|
|
471
478
|
</script>
|
|
@@ -191,10 +191,17 @@ const generatePromptForResource = (props: any) => {
|
|
|
191
191
|
// Handle node graphs in the markdown
|
|
192
192
|
let nodeGraphs = getMDXComponentsByName(props.body || '', 'NodeGraph') || [];
|
|
193
193
|
|
|
194
|
+
// Get props for the node graph (when no id is passed, we assume its the current page)
|
|
195
|
+
const nodeGraphPropsForPage = nodeGraphs.find((nodeGraph: any) => nodeGraph.id === undefined) || ({} as any);
|
|
196
|
+
|
|
197
|
+
// This will render the graph for this page
|
|
194
198
|
nodeGraphs.push({
|
|
195
199
|
id: props.data.id,
|
|
196
200
|
version: props.data.version,
|
|
197
201
|
type: collectionToResourceMap[props.collection as keyof typeof collectionToResourceMap],
|
|
202
|
+
...nodeGraphPropsForPage,
|
|
203
|
+
search: nodeGraphPropsForPage?.search ? nodeGraphPropsForPage.search === 'true' : true,
|
|
204
|
+
legend: nodeGraphPropsForPage?.legend ? nodeGraphPropsForPage.legend === 'true' : true,
|
|
198
205
|
});
|
|
199
206
|
---
|
|
200
207
|
|
|
@@ -212,19 +219,16 @@ nodeGraphs.push({
|
|
|
212
219
|
{props.data.name}
|
|
213
220
|
<span class="">(v{props.data.version})</span>
|
|
214
221
|
</h2>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
</div>
|
|
226
|
-
)
|
|
227
|
-
}
|
|
222
|
+
<div class="hidden lg:block">
|
|
223
|
+
<CopyAsMarkdown
|
|
224
|
+
client:only="react"
|
|
225
|
+
schemas={schemasForResource}
|
|
226
|
+
chatQuery={generatePromptForResource(props)}
|
|
227
|
+
chatEnabled={isEventCatalogChatEnabled()}
|
|
228
|
+
markdownDownloadEnabled={isMarkdownDownloadEnabled()}
|
|
229
|
+
editUrl={editUrl}
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
228
232
|
</div>
|
|
229
233
|
{
|
|
230
234
|
isMarkedAsDeprecated && hasDeprecated && (
|
|
@@ -353,8 +357,10 @@ nodeGraphs.push({
|
|
|
353
357
|
version={nodeGraph.version}
|
|
354
358
|
collection={collection}
|
|
355
359
|
title={nodeGraph.title}
|
|
356
|
-
mode=
|
|
360
|
+
mode={nodeGraph.mode || 'simple'}
|
|
357
361
|
linksToVisualiser={true}
|
|
362
|
+
showSearch={nodeGraph.search ?? true}
|
|
363
|
+
showLegend={nodeGraph.legend ?? true}
|
|
358
364
|
href={{
|
|
359
365
|
label: 'Open in Visualiser',
|
|
360
366
|
url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
|
|
@@ -488,6 +494,9 @@ nodeGraphs.push({
|
|
|
488
494
|
if (document.getElementsByClassName('mermaid').length > 0) {
|
|
489
495
|
renderDiagrams(graphs);
|
|
490
496
|
}
|
|
497
|
+
|
|
498
|
+
// Make renderDiagrams available globally for accordion component
|
|
499
|
+
window.renderDiagrams = renderDiagrams;
|
|
491
500
|
</script>
|
|
492
501
|
|
|
493
502
|
<script>
|
|
@@ -545,6 +554,10 @@ nodeGraphs.push({
|
|
|
545
554
|
if (document.getElementsByClassName('plantuml').length > 0) {
|
|
546
555
|
renderPlantUML(graphs, deflate);
|
|
547
556
|
}
|
|
557
|
+
|
|
558
|
+
window.renderPlantUML = (graphs: any) => {
|
|
559
|
+
renderPlantUML(graphs, deflate);
|
|
560
|
+
};
|
|
548
561
|
});
|
|
549
562
|
</script>
|
|
550
563
|
</VerticalSideBarLayout>
|
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.50.
|
|
9
|
+
"version": "2.50.3",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@ai-sdk/anthropic": "^1.2.11",
|
|
25
25
|
"@ai-sdk/google": "^1.2.17",
|
|
26
26
|
"@ai-sdk/openai": "^1.3.16",
|
|
27
|
-
"@astrojs/markdown-remark": "^6.3.
|
|
28
|
-
"@astrojs/mdx": "^4.3.
|
|
29
|
-
"@astrojs/node": "^9.
|
|
27
|
+
"@astrojs/markdown-remark": "^6.3.3",
|
|
28
|
+
"@astrojs/mdx": "^4.3.1",
|
|
29
|
+
"@astrojs/node": "^9.3.0",
|
|
30
30
|
"@astrojs/react": "^4.3.0",
|
|
31
31
|
"@astrojs/rss": "^4.0.12",
|
|
32
32
|
"@astrojs/tailwind": "^6.0.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@tanstack/react-table": "^8.17.3",
|
|
57
57
|
"@xyflow/react": "^12.3.6",
|
|
58
58
|
"ai": "^4.3.9",
|
|
59
|
-
"astro": "^5.
|
|
59
|
+
"astro": "^5.12.0",
|
|
60
60
|
"astro-compress": "^2.3.8",
|
|
61
61
|
"astro-expressive-code": "^0.40.1",
|
|
62
62
|
"astro-pagefind": "^1.6.0",
|