@eventcatalog/core 2.7.15 → 2.8.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/.all-contributorsrc +9 -0
- package/.github/workflows/test-bin.yml +29 -0
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/bin/dist/eventcatalog.cjs +11 -3050
- package/bin/dist/eventcatalog.js +9 -3042
- package/package.json +13 -8
- package/scripts/eventcatalog-config-file-utils.js +5 -2
- package/src/components/DocsNavigation.astro +2 -2
- package/src/components/Header.astro +2 -2
- package/src/components/Lists/BasicList.tsx +2 -2
- package/src/components/Lists/OwnersList.tsx +5 -5
- package/src/components/Lists/PillList.tsx +3 -3
- package/src/components/Lists/SpecificationsList.astro +2 -2
- package/src/components/Lists/VersionList.astro +1 -1
- package/src/components/MDX/NodeGraph/DownloadButton.tsx +2 -2
- package/src/components/MDX/NodeGraph/NodeGraph.astro +3 -1
- package/src/components/MDX/NodeGraph/NodeGraph.tsx +81 -25
- package/src/components/MDX/NodeGraph/Nodes/ExternalSystem.tsx +1 -1
- package/src/components/MDX/Steps/Step.astro +1 -1
- package/src/components/MDX/Tiles/Tile.astro +2 -2
- package/src/components/MDX/page-components.tsx +1 -1
- package/src/components/SideBars/DomainSideBar.astro +2 -2
- package/src/components/SideBars/MessageSideBar.astro +2 -2
- package/src/components/SideBars/ServiceSideBar.astro +2 -2
- package/src/components/Tables/columns/DomainTableColumns.tsx +3 -3
- package/src/components/Tables/columns/FlowTableColumns.tsx +2 -2
- package/src/components/Tables/columns/MessageTableColumns.tsx +4 -4
- package/src/components/Tables/columns/ServiceTableColumns.tsx +4 -4
- package/src/layouts/CustomDocsPageLayout.astro +11 -18
- package/src/layouts/Footer.astro +4 -4
- package/src/layouts/VisualiserLayout.astro +1 -1
- package/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +1 -1
- package/src/pages/docs/[type]/[id]/[version]/index.astro +2 -1
- package/src/pages/docs/teams/[id]/index.astro +2 -2
- package/src/pages/docs/users/[id]/index.astro +2 -2
- package/src/pages/index.astro +1 -1
- package/src/pages/visualiser/[type]/[id]/[version]/index.astro +1 -0
- package/tailwind.config.mjs +18 -5
- package/bin/dist/chunk-62DEEFN2.js +0 -48
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventcatalog/core",
|
|
3
|
+
"homepage": "https://github.com/event-catalog/eventcatalog",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
|
+
},
|
|
3
8
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
9
|
+
"version": "2.8.0",
|
|
5
10
|
"publishConfig": {
|
|
6
11
|
"access": "public"
|
|
7
12
|
},
|
|
@@ -67,17 +72,17 @@
|
|
|
67
72
|
"tailwindcss": "^3.4.3",
|
|
68
73
|
"typescript": "^5.4.5",
|
|
69
74
|
"unist-util-visit": "^5.0.0",
|
|
70
|
-
"uuid": "^10.0.0"
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@parcel/watcher": "^2.4.1",
|
|
75
|
+
"uuid": "^10.0.0",
|
|
74
76
|
"@types/diff": "^5.2.2",
|
|
75
77
|
"@types/lodash.merge": "4.6.9",
|
|
76
|
-
"@
|
|
77
|
-
"@types/react-dom": "^18.3.0",
|
|
78
|
+
"@parcel/watcher": "^2.4.1",
|
|
78
79
|
"commander": "^12.1.0",
|
|
79
80
|
"concurrently": "^8.2.2",
|
|
80
|
-
"cross-env": "^7.0.3"
|
|
81
|
+
"cross-env": "^7.0.3"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@types/react": "^18.3.3",
|
|
85
|
+
"@types/react-dom": "^18.3.0",
|
|
81
86
|
"prettier": "^3.3.3",
|
|
82
87
|
"prettier-plugin-astro": "^0.14.1",
|
|
83
88
|
"rimraf": "^5.0.7",
|
|
@@ -2,8 +2,9 @@ import { readFile, writeFile, rm } from 'node:fs/promises';
|
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { v4 as uuidV4 } from 'uuid';
|
|
5
|
+
import { pathToFileURL } from 'url';
|
|
5
6
|
|
|
6
|
-
// * Very strange
|
|
7
|
+
// * Very strange behavior when importing ESM files from catalogs into core.
|
|
7
8
|
// * Core (node) does not know how to handle ESM files, so we have to try and convert them.
|
|
8
9
|
// *
|
|
9
10
|
// * This needs sorting out! Sorry if you are reading this, but it unblocked me for now!
|
|
@@ -46,7 +47,9 @@ export const getEventCatalogConfigFile = async (projectDirectory) => {
|
|
|
46
47
|
|
|
47
48
|
await writeFile(path.join(projectDirectory, 'eventcatalog.config.cjs'), configAsCommonJS);
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
+
const configFilePath = path.join(projectDirectory, 'eventcatalog.config.cjs');
|
|
51
|
+
const configFileURL = pathToFileURL(configFilePath).href;
|
|
52
|
+
const configAsCJS = await import(/* @vite-ignore */ configFileURL);
|
|
50
53
|
|
|
51
54
|
// Clean up?
|
|
52
55
|
await writeFile(path.join(projectDirectory, 'eventcatalog.config.js'), rawFile);
|
|
@@ -98,12 +98,12 @@ const currentPath = Astro.url.pathname;
|
|
|
98
98
|
return (
|
|
99
99
|
<li class="px-2 w-full text-md xl:text-lg border-l border-gray-200 space-y-2 scroll-m-20" id={item.href}>
|
|
100
100
|
<a
|
|
101
|
-
class={`flex justify-between items-center w-full px-2 rounded-md font-normal ${currentPath.includes(item.href) ? 'bg-
|
|
101
|
+
class={`flex justify-between items-center w-full px-2 rounded-md font-normal ${currentPath.includes(item.href) ? 'bg-primary/5 text-primary ' : 'font-thin'}`}
|
|
102
102
|
href={`${item.href}`}
|
|
103
103
|
>
|
|
104
104
|
<span class="block truncate !whitespace-normal">{item.label}</span>
|
|
105
105
|
{item.version && (
|
|
106
|
-
<span class="block text-sm bg-
|
|
106
|
+
<span class="block text-sm bg-primary/10 p-0.5 px-1 text-gray-600 rounded-md font-light">
|
|
107
107
|
v{item.version}
|
|
108
108
|
</span>
|
|
109
109
|
)}
|
|
@@ -50,7 +50,7 @@ const logo = {
|
|
|
50
50
|
navItems.map((item) => {
|
|
51
51
|
const isActive = currentPath.includes(item.href);
|
|
52
52
|
return (
|
|
53
|
-
<li class={`font-light text-[0.8em] ${isActive ? 'border-b-2 border-
|
|
53
|
+
<li class={`font-light hover:text-primary text-[0.8em] ${isActive ? 'border-b-2 border-primary' : ''}`}>
|
|
54
54
|
<a href={item.href}>{item.label}</a>
|
|
55
55
|
</li>
|
|
56
56
|
);
|
|
@@ -82,7 +82,7 @@ const logo = {
|
|
|
82
82
|
navItems.map((item) => {
|
|
83
83
|
const isActive = currentPath.includes(item.href);
|
|
84
84
|
return (
|
|
85
|
-
<li class={`font-light ${isActive ? 'font-bold text-
|
|
85
|
+
<li class={`font-light ${isActive ? 'font-bold text-primary' : ''}`}>
|
|
86
86
|
<a href={item.href}>{item.label}</a>
|
|
87
87
|
</li>
|
|
88
88
|
);
|
|
@@ -30,12 +30,12 @@ const BasicList = ({ title, items, emptyMessage, color = 'gray' }: Props) => {
|
|
|
30
30
|
return (
|
|
31
31
|
<li key={item.version} className="px-2 w-full text-md xl:text-lg border-l border-gray-200 py-1 ">
|
|
32
32
|
<a
|
|
33
|
-
className={`flex justify-between items-center w-full px-2 rounded-md font-normal ${item.active ? 'bg-
|
|
33
|
+
className={`flex justify-between items-center w-full px-2 rounded-md font-normal ${item.active ? 'bg-primary/10 text-primary ' : 'font-thin'}`}
|
|
34
34
|
href={item.href}
|
|
35
35
|
>
|
|
36
36
|
<span className="block truncate !whitespace-normal">{item.label}</span>
|
|
37
37
|
{item.version && (
|
|
38
|
-
<span className="block text-sm bg-
|
|
38
|
+
<span className="block text-sm bg-primary/20 p-0.5 px-1 text-gray-600 rounded-md font-light">
|
|
39
39
|
v{item.version}
|
|
40
40
|
</span>
|
|
41
41
|
)}
|
|
@@ -32,21 +32,21 @@ const OwnersList2 = ({ title, owners, emptyMessage }: Props) => {
|
|
|
32
32
|
<img
|
|
33
33
|
src={item.avatarUrl}
|
|
34
34
|
alt={item.label}
|
|
35
|
-
className="w-7 h-7 rounded-full border group-hover:border-
|
|
35
|
+
className="w-7 h-7 rounded-full border group-hover:border-primary/60"
|
|
36
36
|
/>
|
|
37
37
|
)}
|
|
38
38
|
{(item.type === 'teams' || !item.avatarUrl) && (
|
|
39
|
-
<span className="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase group-hover:bg-
|
|
39
|
+
<span className="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase group-hover:bg-primary">
|
|
40
40
|
{item.label.charAt(0)}
|
|
41
41
|
</span>
|
|
42
42
|
)}
|
|
43
43
|
{/* <span className="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase">{item.label.charAt(0)}</span> */}
|
|
44
44
|
<div>
|
|
45
|
-
<h3 className="flex-auto truncate text-sm font-semibold leading-6 text-black group-hover:underline group-hover:text-
|
|
45
|
+
<h3 className="flex-auto truncate text-sm font-semibold leading-6 text-black group-hover:underline group-hover:text-primary">
|
|
46
46
|
{item.label}
|
|
47
47
|
</h3>
|
|
48
48
|
<div className="-mt-0.5">
|
|
49
|
-
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-
|
|
49
|
+
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-primary/10">
|
|
50
50
|
{item.badge}
|
|
51
51
|
</span>
|
|
52
52
|
</div>
|
|
@@ -79,7 +79,7 @@ export default OwnersList2;
|
|
|
79
79
|
// <a class="flex items-center gap-x-3 group " href={item.href}>
|
|
80
80
|
// {item.type === 'users' && item.avatarUrl && <img src={item.avatarUrl} alt={item.label} class="w-7 h-7 rounded-full border group-hover:border-purple-300" />}
|
|
81
81
|
// {(item.type === 'teams' || !item.avatarUrl) && (
|
|
82
|
-
// <span class="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase group-hover:bg-
|
|
82
|
+
// <span class="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase group-hover:bg-primary">{item.label.charAt(0)}</span>
|
|
83
83
|
// )}
|
|
84
84
|
// {/* // <span class="w-6 rounded-full mt-1 bg-red-500 block text-center text-white uppercase">{item.label.charAt(0)}</span> */}
|
|
85
85
|
// <div>
|
|
@@ -33,15 +33,15 @@ const PillList = ({ title, pills, emptyMessage, color = 'gray' }: Props) => {
|
|
|
33
33
|
href={item.href}
|
|
34
34
|
>
|
|
35
35
|
<div className="w-full">
|
|
36
|
-
<h3 className="flex-auto truncate text-sm font-semibold leading-6 text-black group-hover:underline group-hover:text-
|
|
36
|
+
<h3 className="flex-auto truncate text-sm font-semibold leading-6 text-black group-hover:underline group-hover:text-primary">
|
|
37
37
|
{item.label}
|
|
38
38
|
</h3>
|
|
39
39
|
<div className=" flex justify-between">
|
|
40
|
-
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-
|
|
40
|
+
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-primary/20">
|
|
41
41
|
{item.tag}
|
|
42
42
|
</span>
|
|
43
43
|
{item.badge && (
|
|
44
|
-
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-
|
|
44
|
+
<span className="text-xs font-light bg-gray-100 text-gray-700 rounded-md py-0.5 group-hover:bg-primary/20 capitalize">
|
|
45
45
|
{item.badge.slice(0, -1)}
|
|
46
46
|
</span>
|
|
47
47
|
)}
|
|
@@ -19,7 +19,7 @@ const numberOfSpecifications = Object.keys(specVersions).length;
|
|
|
19
19
|
collectionItem.data.specifications?.openapiPath && (
|
|
20
20
|
<a
|
|
21
21
|
href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.version}/spec`)}
|
|
22
|
-
class="text-sm flex items-center space-x-1 hover:underline hover:text-
|
|
22
|
+
class="text-sm flex items-center space-x-1 hover:underline hover:text-primary"
|
|
23
23
|
>
|
|
24
24
|
<img src={buildUrl('/icons/openapi.svg', true)} class="h-4 w-4" />
|
|
25
25
|
<span>OpenAPI spec</span>
|
|
@@ -30,7 +30,7 @@ const numberOfSpecifications = Object.keys(specVersions).length;
|
|
|
30
30
|
collectionItem.data.specifications?.asyncapiPath && (
|
|
31
31
|
<a
|
|
32
32
|
href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.version}/asyncapi`)}
|
|
33
|
-
class="text-sm flex items-center space-x-1 hover:underline hover:text-
|
|
33
|
+
class="text-sm flex items-center space-x-1 hover:underline hover:text-primary"
|
|
34
34
|
>
|
|
35
35
|
<img src={buildUrl('/icons/asyncapi.svg', true)} class="h-4 w-4" />
|
|
36
36
|
<span>AsyncAPI spec</span>
|
|
@@ -24,7 +24,7 @@ const currentPath = Astro.url.pathname;
|
|
|
24
24
|
<option
|
|
25
25
|
selected={isCurrent}
|
|
26
26
|
value={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`)}
|
|
27
|
-
class={`inline-flex items-center rounded-md px-2 py-1 text-xs text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-
|
|
27
|
+
class={`inline-flex items-center rounded-md px-2 py-1 text-xs text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-primary underline ' : 'bg-white'}`}
|
|
28
28
|
>
|
|
29
29
|
<span>
|
|
30
30
|
v{version}
|
|
@@ -48,8 +48,8 @@ function DownloadButton({ filename, addPadding = true }: { filename?: string; ad
|
|
|
48
48
|
className={`hidden md:flex bg-white group download-btn items-center space-x-1 text-[14px] border border-gray-200 px-1 py-0.5 rounded-md hover:bg-gray-100/50 ${addPadding ? 'mt-14' : '-mt-1'}`}
|
|
49
49
|
onClick={onClick}
|
|
50
50
|
>
|
|
51
|
-
<DocumentArrowDownIcon className="w-4 h-4 group-hover:text-
|
|
52
|
-
<span className="group-hover:text-
|
|
51
|
+
<DocumentArrowDownIcon className="w-4 h-4 group-hover:text-primary" />
|
|
52
|
+
<span className="group-hover:text-primary">Download visual </span>
|
|
53
53
|
</button>
|
|
54
54
|
</Panel>
|
|
55
55
|
);
|
|
@@ -19,9 +19,10 @@ interface Props {
|
|
|
19
19
|
label: string;
|
|
20
20
|
url: string;
|
|
21
21
|
};
|
|
22
|
+
linksToVisualiser?: boolean;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href } = Astro.props;
|
|
25
|
+
const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href, linksToVisualiser } = Astro.props;
|
|
25
26
|
let nodes = [],
|
|
26
27
|
edges = [];
|
|
27
28
|
|
|
@@ -99,6 +100,7 @@ const getVisualiserUrlForCollection = () => {
|
|
|
99
100
|
linkTo={linkTo}
|
|
100
101
|
client:only="react"
|
|
101
102
|
urlHasTrailingSlash={config.trailingSlash}
|
|
103
|
+
linksToVisualiser={linksToVisualiser}
|
|
102
104
|
/>
|
|
103
105
|
</div>
|
|
104
106
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import ReactFlow, {
|
|
4
4
|
Background,
|
|
@@ -7,8 +7,10 @@ import ReactFlow, {
|
|
|
7
7
|
Panel,
|
|
8
8
|
ReactFlowProvider,
|
|
9
9
|
useNodesState,
|
|
10
|
+
useEdgesState,
|
|
10
11
|
type Edge,
|
|
11
12
|
type Node,
|
|
13
|
+
useReactFlow,
|
|
12
14
|
} from 'reactflow';
|
|
13
15
|
import 'reactflow/dist/style.css';
|
|
14
16
|
import ServiceNode from './Nodes/Service';
|
|
@@ -33,6 +35,7 @@ interface Props {
|
|
|
33
35
|
linkTo: 'docs' | 'visualiser';
|
|
34
36
|
includeKey?: boolean;
|
|
35
37
|
urlHasTrailingSlash?: boolean;
|
|
38
|
+
linksToVisualiser?: boolean;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
const getDocUrlForCollection = (collectionItem: CollectionEntry<CollectionTypes>, trailingSlash?: boolean) => {
|
|
@@ -45,15 +48,15 @@ const getVisualiserUrlForCollection = (collectionItem: CollectionEntry<Collectio
|
|
|
45
48
|
);
|
|
46
49
|
};
|
|
47
50
|
|
|
48
|
-
// const NodeGraphBuilder = ({ title, subtitle, includeBackground = true, includeControls = true }: Props) => {
|
|
49
51
|
const NodeGraphBuilder = ({
|
|
50
52
|
nodes: initialNodes,
|
|
51
|
-
edges,
|
|
53
|
+
edges: initialEdges,
|
|
52
54
|
title,
|
|
53
55
|
includeBackground = true,
|
|
54
56
|
linkTo = 'docs',
|
|
55
57
|
includeKey = true,
|
|
56
58
|
urlHasTrailingSlash,
|
|
59
|
+
linksToVisualiser = false,
|
|
57
60
|
}: Props) => {
|
|
58
61
|
const nodeTypes = useMemo(
|
|
59
62
|
() => ({
|
|
@@ -68,37 +71,87 @@ const NodeGraphBuilder = ({
|
|
|
68
71
|
[]
|
|
69
72
|
);
|
|
70
73
|
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
|
|
75
|
+
const { fitView } = useReactFlow();
|
|
76
|
+
|
|
77
|
+
const resetNodesAndEdges = useCallback(() => {
|
|
78
|
+
setNodes((nds) =>
|
|
79
|
+
nds.map((node) => {
|
|
80
|
+
node.style = { ...node.style, opacity: 1 };
|
|
81
|
+
return { ...node, animated: false };
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
setEdges((eds) =>
|
|
85
|
+
eds.map((edge) => {
|
|
86
|
+
edge.style = { ...edge.style, opacity: 1 };
|
|
87
|
+
return { ...edge, animated: false };
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
}, [setNodes, setEdges]);
|
|
91
|
+
|
|
92
|
+
const handleNodeClick = useCallback(
|
|
93
|
+
(_: any, node: Node) => {
|
|
94
|
+
if (linksToVisualiser) {
|
|
95
|
+
if (node.type === 'events' || node.type === 'commands') {
|
|
96
|
+
navigate(getVisualiserUrlForCollection(node.data.message, urlHasTrailingSlash));
|
|
97
|
+
}
|
|
98
|
+
if (node.type === 'services') {
|
|
99
|
+
navigate(getVisualiserUrlForCollection(node.data.service, urlHasTrailingSlash));
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
resetNodesAndEdges();
|
|
105
|
+
|
|
106
|
+
const connectedNodeIds = new Set<string>();
|
|
107
|
+
connectedNodeIds.add(node.id);
|
|
108
|
+
|
|
109
|
+
const updatedEdges = edges.map((edge) => {
|
|
110
|
+
if (edge.source === node.id || edge.target === node.id) {
|
|
111
|
+
connectedNodeIds.add(edge.source);
|
|
112
|
+
connectedNodeIds.add(edge.target);
|
|
113
|
+
return { ...edge, style: { ...edge.style, opacity: 1 }, animated: true };
|
|
114
|
+
}
|
|
115
|
+
return { ...edge, style: { ...edge.style, opacity: 0.1 }, animated: false };
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const updatedNodes = nodes.map((n) => {
|
|
119
|
+
if (connectedNodeIds.has(n.id)) {
|
|
120
|
+
return { ...n, style: { ...n.style, opacity: 1 } };
|
|
121
|
+
}
|
|
122
|
+
return { ...n, style: { ...n.style, opacity: 0.1 } };
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
setNodes(updatedNodes);
|
|
126
|
+
setEdges(updatedEdges);
|
|
127
|
+
|
|
128
|
+
// Fit the clicked node and its connected nodes into view
|
|
129
|
+
fitView({
|
|
130
|
+
padding: 0.2,
|
|
131
|
+
duration: 800,
|
|
132
|
+
nodes: updatedNodes.filter((n) => connectedNodeIds.has(n.id)),
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
[nodes, edges, setNodes, setEdges, resetNodesAndEdges, fitView]
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const handlePaneClick = useCallback(() => {
|
|
139
|
+
resetNodesAndEdges();
|
|
140
|
+
fitView({ duration: 800 });
|
|
141
|
+
}, [resetNodesAndEdges, fitView]);
|
|
89
142
|
|
|
90
143
|
return (
|
|
91
|
-
// @ts-ignore
|
|
92
144
|
<ReactFlow
|
|
93
145
|
nodeTypes={nodeTypes}
|
|
94
146
|
nodes={nodes}
|
|
95
147
|
edges={edges}
|
|
96
148
|
fitView
|
|
97
149
|
onNodesChange={onNodesChange}
|
|
150
|
+
onEdgesChange={onEdgesChange}
|
|
98
151
|
connectionLineType={ConnectionLineType.SmoothStep}
|
|
99
|
-
|
|
100
|
-
nodeOrigin={nodeOrigin}
|
|
152
|
+
nodeOrigin={[0.1, 0.1]}
|
|
101
153
|
onNodeClick={handleNodeClick}
|
|
154
|
+
onPaneClick={handlePaneClick}
|
|
102
155
|
>
|
|
103
156
|
{title && (
|
|
104
157
|
<Panel position="top-right">
|
|
@@ -146,6 +199,7 @@ interface NodeGraphProps {
|
|
|
146
199
|
includeKey?: boolean;
|
|
147
200
|
footerLabel?: string;
|
|
148
201
|
urlHasTrailingSlash?: boolean;
|
|
202
|
+
linksToVisualiser?: boolean;
|
|
149
203
|
}
|
|
150
204
|
|
|
151
205
|
const NodeGraph = ({
|
|
@@ -159,6 +213,7 @@ const NodeGraph = ({
|
|
|
159
213
|
includeKey = true,
|
|
160
214
|
footerLabel,
|
|
161
215
|
urlHasTrailingSlash,
|
|
216
|
+
linksToVisualiser = false,
|
|
162
217
|
}: NodeGraphProps) => {
|
|
163
218
|
const [elem, setElem] = useState(null);
|
|
164
219
|
|
|
@@ -180,6 +235,7 @@ const NodeGraph = ({
|
|
|
180
235
|
linkTo={linkTo}
|
|
181
236
|
includeKey={includeKey}
|
|
182
237
|
urlHasTrailingSlash={urlHasTrailingSlash}
|
|
238
|
+
linksToVisualiser={linksToVisualiser}
|
|
183
239
|
/>
|
|
184
240
|
|
|
185
241
|
<div className="flex justify-between">
|
|
@@ -191,7 +247,7 @@ const NodeGraph = ({
|
|
|
191
247
|
|
|
192
248
|
{href && (
|
|
193
249
|
<div className="py-2 w-full text-right">
|
|
194
|
-
<a className=" text-sm no-underline py-2 text-gray-800 hover:text-
|
|
250
|
+
<a className=" text-sm no-underline py-2 text-gray-800 hover:text-primary" href={href}>
|
|
195
251
|
{hrefLabel} →
|
|
196
252
|
</a>
|
|
197
253
|
</div>
|
|
@@ -65,7 +65,7 @@ export default function ExternalSystemNode({ data, sourcePosition, targetPositio
|
|
|
65
65
|
<div className="grid grid-cols-2 gap-x-4 py-1">
|
|
66
66
|
<span className="text-xs" style={{ fontSize: '0.2em' }}>
|
|
67
67
|
URL:{' '}
|
|
68
|
-
<a href={url} target="_blank" className="text-
|
|
68
|
+
<a href={url} target="_blank" className="text-primary underline">
|
|
69
69
|
{url}
|
|
70
70
|
</a>
|
|
71
71
|
</span>
|
|
@@ -4,7 +4,7 @@ const { title } = Astro.props;
|
|
|
4
4
|
|
|
5
5
|
<li class="mb-8 ml-6 w-full xl:max-w-[50%]">
|
|
6
6
|
<div class="flex items-center mb-4">
|
|
7
|
-
<span class="step-number absolute flex items-center justify-center w-6 h-6 bg-
|
|
7
|
+
<span class="step-number absolute flex items-center justify-center w-6 h-6 bg-primary/80 rounded-md -left-3 text-white">
|
|
8
8
|
<div></div>
|
|
9
9
|
</span>
|
|
10
10
|
<h3 class="font-semibold text-lg ml-0">{title}</h3>
|
|
@@ -19,10 +19,10 @@ const IconComponent: ComponentType<{ className?: string }> | undefined = Icons[i
|
|
|
19
19
|
<a
|
|
20
20
|
href={buildUrl(href)}
|
|
21
21
|
target={openWindow ? '_blank' : '_self'}
|
|
22
|
-
class="block bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300 ease-in-out hover:shadow-md hover:border-
|
|
22
|
+
class="block bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300 ease-in-out hover:shadow-md hover:border-primary focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-primary focus:ring-white"
|
|
23
23
|
>
|
|
24
24
|
<div class="flex flex-col h-full space-y-8">
|
|
25
|
-
{IconComponent && <IconComponent className="w-6 h-6 text-
|
|
25
|
+
{IconComponent && <IconComponent className="w-6 h-6 text-primary" />}
|
|
26
26
|
<div>
|
|
27
27
|
<h2 class="text-gray-800 text-lg font-semibold transition-colors duration-300 ease-in-out group-hover:text-gray-300">
|
|
28
28
|
{title}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const components = {
|
|
2
|
-
a: (mdxProp: any) => <a className="text-
|
|
2
|
+
a: (mdxProp: any) => <a className="text-primary" {...mdxProp} />,
|
|
3
3
|
h1: (mdxProp: any) => <h1 className="mb-4" {...mdxProp} />,
|
|
4
4
|
h3: (mdxProp: any) => <h3 className="mb-2" {...mdxProp} />,
|
|
5
5
|
p: (mdxProp: any) => <p className="my-3" {...mdxProp} />,
|
|
@@ -51,12 +51,12 @@ const ownersList = owners.map((o) => ({
|
|
|
51
51
|
<div class="space-y-2">
|
|
52
52
|
<a
|
|
53
53
|
href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
|
|
54
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
54
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
55
55
|
>View in Visualiser</a
|
|
56
56
|
>
|
|
57
57
|
<a
|
|
58
58
|
href={buildUrl(`/docs/${domain.collection}/${domain.data.id}/${domain.data.version}/changelog`)}
|
|
59
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
59
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
60
60
|
>Changelog</a
|
|
61
61
|
>
|
|
62
62
|
</div>
|
|
@@ -102,13 +102,13 @@ const schemaURL = path.join(publicPath, schemaFilePath || '');
|
|
|
102
102
|
}
|
|
103
103
|
<a
|
|
104
104
|
href={buildUrl(`/visualiser/${message.collection}/${message.data.id}/${message.data.version}`)}
|
|
105
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
105
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
106
106
|
>View in Visualiser</a
|
|
107
107
|
>
|
|
108
108
|
|
|
109
109
|
<a
|
|
110
110
|
href={buildUrl(`/docs/${message.collection}/${message.data.id}/${message.data.version}/changelog`)}
|
|
111
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
111
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
112
112
|
>Changelog</a
|
|
113
113
|
>
|
|
114
114
|
</div>
|
|
@@ -106,12 +106,12 @@ const schemaURL = join(publicPath, schemaFilePath || '');
|
|
|
106
106
|
}
|
|
107
107
|
<a
|
|
108
108
|
href={buildUrl(`/visualiser/${service.collection}/${service.data.id}/${service.data.version}`)}
|
|
109
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
109
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
110
110
|
>View in Visualiser</a
|
|
111
111
|
>
|
|
112
112
|
<a
|
|
113
113
|
href={buildUrl(`/docs/${service.collection}/${service.data.id}/${service.data.version}/changelog`)}
|
|
114
|
-
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-
|
|
114
|
+
class="block text-center rounded-md w-full bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-100/60 hover:text-primary"
|
|
115
115
|
>Changelog</a
|
|
116
116
|
>
|
|
117
117
|
</div>
|
|
@@ -25,7 +25,7 @@ export const columns = () => [
|
|
|
25
25
|
<span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
|
|
26
26
|
<RectangleGroupIcon className="h-4 w-4 text-white" />
|
|
27
27
|
</span>
|
|
28
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-
|
|
28
|
+
<span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
29
29
|
{messageRaw.data.name} (v{messageRaw.data.version})
|
|
30
30
|
</span>
|
|
31
31
|
</span>
|
|
@@ -77,7 +77,7 @@ export const columns = () => [
|
|
|
77
77
|
<li key={consumer.data.id} className="py-1 group ">
|
|
78
78
|
<a
|
|
79
79
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
80
|
-
className="group-hover:text-
|
|
80
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
81
81
|
>
|
|
82
82
|
<div className={`flex items-center border border-gray-300 rounded-md`}>
|
|
83
83
|
<span className="flex items-center">
|
|
@@ -105,7 +105,7 @@ export const columns = () => [
|
|
|
105
105
|
const domain = info.row.original;
|
|
106
106
|
return (
|
|
107
107
|
<a
|
|
108
|
-
className="hover:text-
|
|
108
|
+
className="hover:text-primary hover:underline px-4 font-light"
|
|
109
109
|
href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
|
|
110
110
|
>
|
|
111
111
|
Visualiser →
|
|
@@ -26,7 +26,7 @@ export const columns = () => [
|
|
|
26
26
|
<span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
|
|
27
27
|
<QueueListIcon className="h-4 w-4 text-white" />
|
|
28
28
|
</span>
|
|
29
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-
|
|
29
|
+
<span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
30
30
|
{flowRaw.data.name} (v{flowRaw.data.version})
|
|
31
31
|
</span>
|
|
32
32
|
</span>
|
|
@@ -67,7 +67,7 @@ export const columns = () => [
|
|
|
67
67
|
const domain = info.row.original;
|
|
68
68
|
return (
|
|
69
69
|
<a
|
|
70
|
-
className="hover:text-
|
|
70
|
+
className="hover:text-primary hover:underline px-4 font-light"
|
|
71
71
|
href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
|
|
72
72
|
>
|
|
73
73
|
Visualiser →
|
|
@@ -28,7 +28,7 @@ export const columns = () => [
|
|
|
28
28
|
<span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
|
|
29
29
|
<Icon className="h-4 w-4 text-white" />
|
|
30
30
|
</span>
|
|
31
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-
|
|
31
|
+
<span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
32
32
|
{messageRaw.data.name} (v{messageRaw.data.version})
|
|
33
33
|
</span>
|
|
34
34
|
</span>
|
|
@@ -70,7 +70,7 @@ export const columns = () => [
|
|
|
70
70
|
<li className="py-2 group flex items-center space-x-2" key={producer.data.id}>
|
|
71
71
|
<a
|
|
72
72
|
href={buildUrl(`/docs/${producer.collection}/${producer.data.id}/${producer.data.version}`)}
|
|
73
|
-
className="group-hover:text-
|
|
73
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
74
74
|
>
|
|
75
75
|
<div className="flex items-center border border-gray-300 shadow-sm rounded-md">
|
|
76
76
|
<span className="flex items-center">
|
|
@@ -110,7 +110,7 @@ export const columns = () => [
|
|
|
110
110
|
<li key={consumer.data.id} className="py-1 group font-light ">
|
|
111
111
|
<a
|
|
112
112
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
113
|
-
className="group-hover:text-
|
|
113
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
114
114
|
>
|
|
115
115
|
<div className="flex items-center border border-gray-300 shadow-sm rounded-md">
|
|
116
116
|
<span className="flex items-center">
|
|
@@ -138,7 +138,7 @@ export const columns = () => [
|
|
|
138
138
|
const domain = info.row.original;
|
|
139
139
|
return (
|
|
140
140
|
<a
|
|
141
|
-
className="hover:text-
|
|
141
|
+
className="hover:text-primary hover:underline px-4 font-light"
|
|
142
142
|
href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
|
|
143
143
|
>
|
|
144
144
|
Visualiser →
|
|
@@ -26,7 +26,7 @@ export const columns = () => [
|
|
|
26
26
|
<span className={`bg-${color}-500 group-hover:bg-${color}-600 h-full rounded-tl rounded-bl p-1`}>
|
|
27
27
|
<ServerIcon className="h-4 w-4 text-white" />
|
|
28
28
|
</span>
|
|
29
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-
|
|
29
|
+
<span className="leading-none px-2 group-hover:underline group-hover:text-primary">
|
|
30
30
|
{messageRaw.data.name} (v{messageRaw.data.version})
|
|
31
31
|
</span>
|
|
32
32
|
</span>
|
|
@@ -79,7 +79,7 @@ export const columns = () => [
|
|
|
79
79
|
<li key={consumer.data.id} className="py-1 group font-light ">
|
|
80
80
|
<a
|
|
81
81
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
82
|
-
className="group-hover:text-
|
|
82
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
83
83
|
>
|
|
84
84
|
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
85
85
|
<span className="flex items-center">
|
|
@@ -122,7 +122,7 @@ export const columns = () => [
|
|
|
122
122
|
<li key={consumer.data.id} className="py-1 group font-light">
|
|
123
123
|
<a
|
|
124
124
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
125
|
-
className="group-hover:text-
|
|
125
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
126
126
|
>
|
|
127
127
|
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
128
128
|
<span className="flex items-center">
|
|
@@ -150,7 +150,7 @@ export const columns = () => [
|
|
|
150
150
|
const domain = info.row.original;
|
|
151
151
|
return (
|
|
152
152
|
<a
|
|
153
|
-
className="hover:text-
|
|
153
|
+
className="hover:text-primary hover:underline px-4 font-light"
|
|
154
154
|
href={buildUrl(`/visualiser/${domain.collection}/${domain.data.id}/${domain.data.version}`)}
|
|
155
155
|
>
|
|
156
156
|
Visualiser →
|