@eventcatalog/core 2.16.2 → 2.16.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.
Files changed (61) hide show
  1. package/README.md +4 -1
  2. package/dist/analytics/analytics.cjs +1 -1
  3. package/dist/analytics/analytics.js +2 -2
  4. package/dist/analytics/log-build.cjs +1 -1
  5. package/dist/analytics/log-build.js +3 -3
  6. package/dist/{chunk-D5BKFMHD.js → chunk-CV37NPK3.js} +1 -1
  7. package/dist/{chunk-5K2SMJL6.js → chunk-X7R2UJHK.js} +1 -1
  8. package/dist/{chunk-7V6DXP63.js → chunk-YHWKWHZA.js} +1 -1
  9. package/dist/constants.cjs +1 -1
  10. package/dist/constants.js +1 -1
  11. package/dist/eventcatalog.cjs +1 -1
  12. package/dist/eventcatalog.js +3 -3
  13. package/eventcatalog/package.json +69 -0
  14. package/eventcatalog/src/components/MDX/Accordion/Accordion.tsx +2 -2
  15. package/eventcatalog/src/components/MDX/AsyncAPI/AsyncAPI.astro +2 -2
  16. package/eventcatalog/src/components/MDX/ChannelInformation/ChannelInformation.tsx +2 -2
  17. package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -2
  18. package/eventcatalog/src/components/MDX/NodeGraph/DownloadButton.tsx +2 -2
  19. package/eventcatalog/src/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +2 -1
  20. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +12 -1
  21. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +6 -5
  22. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Channel.tsx +1 -1
  23. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Command.tsx +1 -1
  24. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Event.tsx +1 -1
  25. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/ExternalSystem.tsx +1 -1
  26. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Query.tsx +1 -1
  27. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Service.tsx +1 -1
  28. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Step.tsx +3 -3
  29. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/User.tsx +3 -3
  30. package/eventcatalog/src/components/MDX/OpenAPI/OpenAPI.astro +2 -2
  31. package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.astro +2 -2
  32. package/eventcatalog/src/components/SideBars/CatalogResourcesSideBar/index.tsx +10 -1
  33. package/eventcatalog/src/components/Tables/Table.tsx +15 -5
  34. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +4 -10
  35. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +3 -3
  36. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +5 -2
  37. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +2 -8
  38. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +44 -0
  39. package/eventcatalog/src/components/Tables/filters/custom-filters.ts +5 -0
  40. package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +12 -7
  41. package/eventcatalog/src/layouts/DiscoverLayout.astro +1 -1
  42. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +10 -1
  43. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +10 -6
  44. package/eventcatalog/src/pages/docs/[type]/[id]/language.astro +6 -6
  45. package/eventcatalog/src/pages/visualiser/context-map/index.astro +30 -0
  46. package/eventcatalog/src/utils/collections/icons.ts +3 -0
  47. package/eventcatalog/src/utils/collections/services.ts +35 -0
  48. package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +206 -3
  49. package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +2 -2
  50. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +1 -1
  51. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +1 -1
  52. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +1 -1
  53. package/package.json +2 -2
  54. package/bin/dist/eventcatalog.cjs +0 -558
  55. package/bin/dist/eventcatalog.config.cjs +0 -18
  56. package/bin/dist/eventcatalog.config.d.cts +0 -35
  57. package/bin/dist/eventcatalog.config.d.ts +0 -35
  58. package/bin/dist/eventcatalog.config.js +0 -0
  59. package/bin/dist/eventcatalog.d.cts +0 -1
  60. package/bin/dist/eventcatalog.d.ts +0 -1
  61. package/bin/dist/eventcatalog.js +0 -531
package/README.md CHANGED
@@ -24,7 +24,10 @@
24
24
 
25
25
  <!-- <hr /> -->
26
26
 
27
- <img alt="header" src="./images/example.png" />
27
+ <img width="745" alt="Screenshot 2024-12-13 at 09 56 05" src="https://github.com/user-attachments/assets/f537ec1f-54ee-4de1-996c-c6b72191be39" />
28
+
29
+
30
+
28
31
 
29
32
  <h4>Features: Documentation generator for Event Driven Architectures, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
30
33
 
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.16.2";
40
+ var version = "2.16.4";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-7V6DXP63.js";
4
- import "../chunk-5K2SMJL6.js";
3
+ } from "../chunk-YHWKWHZA.js";
4
+ import "../chunk-X7R2UJHK.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.16.2";
109
+ var version = "2.16.4";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-D5BKFMHD.js";
4
- import "../chunk-7V6DXP63.js";
5
- import "../chunk-5K2SMJL6.js";
3
+ } from "../chunk-CV37NPK3.js";
4
+ import "../chunk-YHWKWHZA.js";
5
+ import "../chunk-X7R2UJHK.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-7V6DXP63.js";
3
+ } from "./chunk-YHWKWHZA.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.16.2";
2
+ var version = "2.16.4";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-5K2SMJL6.js";
3
+ } from "./chunk-X7R2UJHK.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.16.2";
28
+ var version = "2.16.4";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-5K2SMJL6.js";
3
+ } from "./chunk-X7R2UJHK.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.16.2";
164
+ var version = "2.16.4";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  log_build_default
3
- } from "./chunk-D5BKFMHD.js";
4
- import "./chunk-7V6DXP63.js";
3
+ } from "./chunk-CV37NPK3.js";
4
+ import "./chunk-YHWKWHZA.js";
5
5
  import {
6
6
  catalogToAstro
7
7
  } from "./chunk-55YPRY5U.js";
8
8
  import {
9
9
  VERSION
10
- } from "./chunk-5K2SMJL6.js";
10
+ } from "./chunk-X7R2UJHK.js";
11
11
  import {
12
12
  generate
13
13
  } from "./chunk-YEQVKHST.js";
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "eventcatalog",
3
+ "homepage": "https://github.com/event-catalog/eventcatalog",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/event-catalog/eventcatalog.git",
7
+ "directory": "eventcatalog/"
8
+ },
9
+ "type": "module",
10
+ "version": "0.1.0",
11
+ "private": true,
12
+ "scripts": {
13
+ "astro": "astro",
14
+ "build": "astro build",
15
+ "dev": "astro dev",
16
+ "preview": "astro preview",
17
+ "start": "astro dev"
18
+ },
19
+ "dependencies": {
20
+ "@astrojs/markdown-remark": "^5.3.0",
21
+ "@astrojs/mdx": "^3.1.8",
22
+ "@astrojs/react": "^3.6.2",
23
+ "@astrojs/tailwind": "^5.1.2",
24
+ "@asyncapi/avro-schema-parser": "^3.0.24",
25
+ "@asyncapi/parser": "^3.4.0",
26
+ "@asyncapi/react-component": "^2.4.3",
27
+ "@headlessui/react": "^2.0.3",
28
+ "@heroicons/react": "^2.1.3",
29
+ "@stoplight/json-schema-viewer": "^4.7.0",
30
+ "@stoplight/mosaic": "^1.53.2",
31
+ "@tailwindcss/typography": "^0.5.13",
32
+ "@tanstack/react-table": "^8.17.3",
33
+ "@xyflow/react": "^12.3.6",
34
+ "astro": "^4.16.5",
35
+ "astro-expressive-code": "^0.36.1",
36
+ "astro-pagefind": "^1.6.0",
37
+ "astro-seo": "^0.8.4",
38
+ "dagre": "^0.8.5",
39
+ "diff": "^7.0.0",
40
+ "diff2html": "^3.4.48",
41
+ "html-to-image": "^1.11.11",
42
+ "js-yaml": "^4.1.0",
43
+ "lodash.debounce": "^4.0.8",
44
+ "lodash.merge": "4.6.2",
45
+ "lucide-react": "^0.453.0",
46
+ "mermaid": "^10.9.1",
47
+ "prismjs": "^1.29.0",
48
+ "rapidoc": "^9.3.4",
49
+ "react": "^18.3.1",
50
+ "react-dom": "^18.3.1",
51
+ "rehype-slug": "^6.0.0",
52
+ "remark-gfm": "^3.0.1",
53
+ "semver": "7.6.3",
54
+ "tailwindcss": "^3.4.3",
55
+ "unist-util-visit": "^5.0.0"
56
+ },
57
+ "devDependencies": {
58
+ "@types/dagre": "^0.7.52",
59
+ "@types/diff": "^5.2.2",
60
+ "@types/js-yaml": "^4.0.9",
61
+ "@types/lodash.debounce": "^4.0.9",
62
+ "@types/lodash.merge": "4.6.9",
63
+ "@types/node": "^20.14.2",
64
+ "@types/react": "^18.3.3",
65
+ "@types/react-dom": "^18.3.0",
66
+ "@types/semver": "^7.5.8",
67
+ "typescript": "^5.4.5"
68
+ }
69
+ }
@@ -7,7 +7,7 @@ export default function Example({ title, children }: any) {
7
7
  <div className="border border-gray-200 rounded-md px-4 shadow-sm py-2 accordion">
8
8
  <Disclosure as="div" key={title} className="">
9
9
  {({ open }) => (
10
- <>
10
+ <div>
11
11
  <DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
12
12
  <span className="text-base font-semibold leading-7">{title}</span>
13
13
  <span className="ml-6 flex h-7 items-center">
@@ -21,7 +21,7 @@ export default function Example({ title, children }: any) {
21
21
  <DisclosurePanel as="dd" className="pr-12 not-prose py-4">
22
22
  <p className="text-base leading-7 text-gray-600">{children}</p>
23
23
  </DisclosurePanel>
24
- </>
24
+ </div>
25
25
  )}
26
26
  </Disclosure>
27
27
  </div>
@@ -4,13 +4,13 @@ import Admonition from '../Admonition';
4
4
 
5
5
  <div class="mb-4">
6
6
  <Admonition type="warning">
7
- <>
7
+ <div>
8
8
  <span class="block font-bold">{`<AsyncAPI/>`} component now deprecated</span>
9
9
  <span class="block"
10
10
  >Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
11
11
  >Read more here.</a
12
12
  ></span
13
13
  >
14
- </>
14
+ </div>
15
15
  </Admonition>
16
16
  </div>
@@ -25,9 +25,9 @@ const ChannelParameters = (data: CollectionEntry<'channels'>['data']) => {
25
25
  <div>
26
26
  <p className="text-md">
27
27
  {data.address && (
28
- <>
28
+ <div>
29
29
  <span className="font-semibold">Address:</span> <code className="bg-gray-100 p-1 rounded">{data.address}</code>
30
- </>
30
+ </div>
31
31
  )}
32
32
  {data.protocols && data.protocols.length > 0 && (
33
33
  <div className="mt-2 flex items-center space-x-1">
@@ -23,12 +23,12 @@ const { nodes, edges } = await getNodesAndEdges({
23
23
  {
24
24
  !flow && (
25
25
  <Admonition type="warning">
26
- <>
26
+ <div>
27
27
  <span class="block font-bold">{`<Flow/>`} failed to load</span>
28
28
  <span class="block">
29
29
  Tried to load flow id: {id} with version {version}. Make sure you have this flow defined in your project.
30
30
  </span>
31
- </>
31
+ </div>
32
32
  </Admonition>
33
33
  )
34
34
  }
@@ -1,4 +1,4 @@
1
- import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from 'reactflow';
1
+ import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from '@xyflow/react';
2
2
  import { toPng } from 'html-to-image';
3
3
  import { DocumentArrowDownIcon } from '@heroicons/react/24/outline';
4
4
 
@@ -19,7 +19,7 @@ function DownloadButton({ filename, addPadding = true }: { filename?: string; ad
19
19
  const nodesBounds = getNodesBounds(getNodes());
20
20
  const width = imageWidth > nodesBounds.width ? imageWidth : nodesBounds.width;
21
21
  const height = imageHeight > nodesBounds.height ? imageHeight : nodesBounds.height;
22
- const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2);
22
+ const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2, 0);
23
23
 
24
24
  // Hide the button
25
25
  // @ts-ignore
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { BaseEdge, getBezierPath } from 'reactflow';
2
+ import { BaseEdge, getBezierPath } from '@xyflow/react';
3
3
 
4
4
  const AnimatedMessageEdge = ({
5
5
  id,
@@ -44,6 +44,7 @@ const AnimatedMessageEdge = ({
44
44
  const randomDelay = useMemo(() => Math.random() * 1, []);
45
45
 
46
46
  return (
47
+ // @ts-ignore
47
48
  <>
48
49
  <BaseEdge id={id} path={edgePath} markerEnd={markerEnd} />
49
50
  {/* Circle Icon */}
@@ -6,7 +6,10 @@ import {
6
6
  getNodesAndEdgesForEvents,
7
7
  getNodesAndEdgesForQueries,
8
8
  } from '@utils/node-graphs/message-node-graph';
9
- import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/node-graphs/domains-node-graph';
9
+ import {
10
+ getNodesAndEdges as getNodesAndEdgesForDomain,
11
+ getNodesAndEdgesForDomainContextMap,
12
+ } from '@utils/node-graphs/domains-node-graph';
10
13
  import { getNodesAndEdges as getNodesAndEdgesForFlows } from '@utils/node-graphs/flows-node-graph';
11
14
 
12
15
  interface Props {
@@ -24,8 +27,10 @@ interface Props {
24
27
  }
25
28
 
26
29
  const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href, linksToVisualiser } = Astro.props;
30
+
27
31
  let nodes = [],
28
32
  edges = [];
33
+
29
34
  const getNodesAndEdgesFunctions = {
30
35
  services: getNodesAndEdgesForService,
31
36
  events: getNodesAndEdgesForEvents,
@@ -47,6 +52,12 @@ if (collection in getNodesAndEdgesFunctions) {
47
52
  nodes = fetchedNodes;
48
53
  edges = fetchedEdges;
49
54
  }
55
+
56
+ if (collection === 'domain-context-map') {
57
+ const { nodes: fetchedNodes, edges: fetchedEdges } = await getNodesAndEdgesForDomainContextMap({});
58
+ nodes = fetchedNodes;
59
+ edges = fetchedEdges;
60
+ }
50
61
  ---
51
62
 
52
63
  <div>
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
- import ReactFlow, {
3
+ import {
4
+ ReactFlow,
4
5
  Background,
5
6
  ConnectionLineType,
6
7
  Controls,
@@ -11,8 +12,8 @@ import ReactFlow, {
11
12
  type Edge,
12
13
  type Node,
13
14
  useReactFlow,
14
- } from 'reactflow';
15
- import 'reactflow/dist/style.css';
15
+ } from '@xyflow/react';
16
+ import '@xyflow/react/dist/style.css';
16
17
 
17
18
  // Nodes and edges
18
19
  import ServiceNode from './Nodes/Service';
@@ -105,10 +106,10 @@ const NodeGraphBuilder = ({
105
106
  (_: any, node: Node) => {
106
107
  if (linksToVisualiser) {
107
108
  if (node.type === 'events' || node.type === 'commands') {
108
- navigate(getVisualiserUrlForCollection(node.data.message));
109
+ navigate(getVisualiserUrlForCollection(node.data.message as CollectionEntry<CollectionTypes>));
109
110
  }
110
111
  if (node.type === 'services') {
111
- navigate(getVisualiserUrlForCollection(node.data.service));
112
+ navigate(getVisualiserUrlForCollection(node.data.service as CollectionEntry<'services'>));
112
113
  }
113
114
  return;
114
115
  }
@@ -2,7 +2,7 @@ import { BoltIcon } from '@heroicons/react/16/solid';
2
2
  import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
3
3
  import type { CollectionMessageTypes, CollectionTypes } from '@types';
4
4
  import type { CollectionEntry } from 'astro:content';
5
- import { Handle } from 'reactflow';
5
+ import { Handle } from '@xyflow/react';
6
6
 
7
7
  interface Data {
8
8
  title: string;
@@ -1,6 +1,6 @@
1
1
  import { ChatBubbleLeftIcon } from '@heroicons/react/16/solid';
2
2
  import type { CollectionEntry } from 'astro:content';
3
- import { Handle } from 'reactflow';
3
+ import { Handle } from '@xyflow/react';
4
4
 
5
5
  interface Data {
6
6
  title: string;
@@ -1,6 +1,6 @@
1
1
  import { BoltIcon } from '@heroicons/react/16/solid';
2
2
  import type { CollectionEntry } from 'astro:content';
3
- import { Handle } from 'reactflow';
3
+ import { Handle } from '@xyflow/react';
4
4
 
5
5
  interface Data {
6
6
  title: string;
@@ -1,7 +1,7 @@
1
1
  import { ServerIcon } from '@heroicons/react/16/solid';
2
2
  import { GlobeAmericasIcon } from '@heroicons/react/20/solid';
3
3
  import type { CollectionEntry } from 'astro:content';
4
- import { Handle } from 'reactflow';
4
+ import { Handle } from '@xyflow/react';
5
5
 
6
6
  interface Data {
7
7
  label: string;
@@ -1,6 +1,6 @@
1
1
  import { MagnifyingGlassIcon } from '@heroicons/react/16/solid';
2
2
  import type { CollectionEntry } from 'astro:content';
3
- import { Handle } from 'reactflow';
3
+ import { Handle } from '@xyflow/react';
4
4
 
5
5
  interface Data {
6
6
  title: string;
@@ -1,6 +1,6 @@
1
1
  import { ServerIcon } from '@heroicons/react/16/solid';
2
2
  import type { CollectionEntry } from 'astro:content';
3
- import { Handle } from 'reactflow';
3
+ import { Handle } from '@xyflow/react';
4
4
 
5
5
  interface Data {
6
6
  label: string;
@@ -1,4 +1,4 @@
1
- import { Handle } from 'reactflow';
1
+ import { Handle } from '@xyflow/react';
2
2
 
3
3
  interface Data {
4
4
  title: string;
@@ -45,7 +45,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
45
45
  )}
46
46
 
47
47
  {summary && (
48
- <>
48
+ <div>
49
49
  <div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
50
50
  <span className="text-xs font-bold block pb-0.5">{title}</span>
51
51
  </div>
@@ -56,7 +56,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
56
56
  </div>
57
57
  </div>
58
58
  )}
59
- </>
59
+ </div>
60
60
  )}
61
61
  </div>
62
62
  </div>
@@ -1,5 +1,5 @@
1
1
  import { UserIcon } from '@heroicons/react/20/solid';
2
- import { Handle } from 'reactflow';
2
+ import { Handle } from '@xyflow/react';
3
3
 
4
4
  interface Data {
5
5
  title: string;
@@ -57,7 +57,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
57
57
  )}
58
58
 
59
59
  {summary && mode === 'full' && (
60
- <>
60
+ <div>
61
61
  <div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
62
62
  <span className="text-xs font-bold block pb-0.5">{name}</span>
63
63
  </div>
@@ -68,7 +68,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
68
68
  </div>
69
69
  </div>
70
70
  )}
71
- </>
71
+ </div>
72
72
  )}
73
73
  </div>
74
74
  </div>
@@ -4,13 +4,13 @@ import Admonition from '../Admonition';
4
4
 
5
5
  <div class="mb-4">
6
6
  <Admonition type="warning">
7
- <>
7
+ <div>
8
8
  <span class="block font-bold">{`<OpenAPI/>`} component now deprecated</span>
9
9
  <span class="block"
10
10
  >Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
11
11
  >Read more here.</a
12
12
  ></span
13
13
  >
14
- </>
14
+ </div>
15
15
  </Admonition>
16
16
  </div>
@@ -82,10 +82,10 @@ try {
82
82
  {/* User has tried to load the schema, but it was not found on file system */}
83
83
  {!schema.exists && (
84
84
  <Admonition type="warning">
85
- <>
85
+ <div>
86
86
  <span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
87
87
  <span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
88
- </>
88
+ </div>
89
89
  </Admonition>
90
90
  )}
91
91
  </div>
@@ -6,7 +6,16 @@ import { getIconForCollection as getIconForCollectionOriginal } from '@utils/col
6
6
 
7
7
  const STORAGE_KEY = 'EventCatalog:catalogSidebarCollapsedGroups';
8
8
 
9
- const CatalogResourcesSideBar = ({ resources, currentPath }: any) => {
9
+ interface CatalogResourcesSideBarProps {
10
+ resources: any;
11
+ currentPath: string;
12
+ }
13
+
14
+ const CatalogResourcesSideBar: React.FC<CatalogResourcesSideBarProps> = ({ resources, currentPath }) => {
15
+ if (typeof window === 'undefined') {
16
+ return null;
17
+ }
18
+
10
19
  const [data, setData] = useState(resources);
11
20
  const [searchQuery, setSearchQuery] = useState('');
12
21
  const [isInitialized, setIsInitialized] = useState(false);
@@ -21,7 +21,7 @@ import type { CollectionTypes } from '@types';
21
21
  declare module '@tanstack/react-table' {
22
22
  // @ts-ignore
23
23
  interface ColumnMeta<TData extends RowData, TValue> {
24
- filterVariant?: 'collection' | 'name';
24
+ filterVariant?: 'collection' | 'name' | 'badges';
25
25
  collectionFilterKey?: string;
26
26
  showFilter?: boolean;
27
27
  className?: string;
@@ -67,7 +67,7 @@ export const Table = ({
67
67
  });
68
68
 
69
69
  return (
70
- <>
70
+ <div>
71
71
  {/* <div className='text-right text-gray-400'>{table.getPrePaginationRowModel().rows.length} results</div> */}
72
72
  <div className=" bg-gray-100/20 rounded-md border-2 border-gray-200 shadow-sm ">
73
73
  <table className="min-w-full divide-y divide-gray-200 rounded-md ">
@@ -171,7 +171,7 @@ export const Table = ({
171
171
  </select>
172
172
  </div>
173
173
  </div>
174
- </>
174
+ </div>
175
175
  );
176
176
  };
177
177
 
@@ -211,11 +211,21 @@ function Filter({ column }: { column: Column<any, unknown> }) {
211
211
 
212
212
  return uniqueItemsInList.sort().slice(0, 2000);
213
213
  }
214
+ if (filterVariant === 'badges') {
215
+ const allBadges = column.getFacetedUniqueValues().keys();
216
+ // join all badges into a single array
217
+ const allBadgesArray = Array.from(allBadges)
218
+ .flat()
219
+ .filter((b) => !!b);
220
+ const allBadgesString = allBadgesArray.map((badge) => badge.content);
221
+ const uniqueBadges = Array.from(new Set(allBadgesString));
222
+ return uniqueBadges.sort().slice(0, 2000);
223
+ }
214
224
  return Array.from(column.getFacetedUniqueValues().keys()).sort().slice(0, 2000);
215
225
  }, [column.getFacetedUniqueValues(), filterVariant]);
216
226
 
217
227
  return (
218
- <>
228
+ <div>
219
229
  {/* Autocomplete suggestions from faceted values feature */}
220
230
  <datalist id={column.id + 'list'}>
221
231
  {sortedUniqueValues.map((value: any, index) => (
@@ -231,6 +241,6 @@ function Filter({ column }: { column: Column<any, unknown> }) {
231
241
  list={column.id + 'list'}
232
242
  />
233
243
  <div className="h-1" />
234
- </>
244
+ </div>
235
245
  );
236
246
  }
@@ -2,8 +2,10 @@ import { ServerIcon } from '@heroicons/react/20/solid';
2
2
  import { RectangleGroupIcon } from '@heroicons/react/20/solid';
3
3
  import { createColumnHelper } from '@tanstack/react-table';
4
4
  import type { CollectionEntry } from 'astro:content';
5
- import { filterByName, filterCollectionByName } from '../filters/custom-filters';
5
+ import { filterByBadge, filterByName, filterCollectionByName } from '../filters/custom-filters';
6
6
  import { buildUrl } from '@utils/url-builder';
7
+ import { Tag } from 'lucide-react';
8
+ import { createBadgesColumn } from './SharedColumns';
7
9
 
8
10
  const columnHelper = createColumnHelper<CollectionEntry<'domains'>>();
9
11
 
@@ -40,14 +42,6 @@ export const columns = () => [
40
42
  },
41
43
  filterFn: filterByName,
42
44
  }),
43
- // columnHelper.accessor('data.version', {
44
- // header: () => <span>Version</span>,
45
- // cell: (info) => {
46
- // const service = info.row.original;
47
- // return <div className="text-left font-light">{`v${info.getValue()} ${service.data.latestVersion === service.data.version ? '(latest)': ''}`}</div>
48
- // },
49
- // footer: (info) => info.column.id,
50
- // }),
51
45
  columnHelper.accessor('data.summary', {
52
46
  id: 'summary',
53
47
  header: () => 'Summary',
@@ -96,9 +90,9 @@ export const columns = () => [
96
90
  </ul>
97
91
  );
98
92
  },
99
- // footer: (info) => info.column.id,
100
93
  filterFn: filterCollectionByName('services'),
101
94
  }),
95
+ createBadgesColumn(columnHelper),
102
96
  columnHelper.accessor('data.name', {
103
97
  header: () => <span />,
104
98
  cell: (info) => {
@@ -1,10 +1,9 @@
1
- import { ServerIcon } from '@heroicons/react/20/solid';
2
- import { RectangleGroupIcon } from '@heroicons/react/20/solid';
3
1
  import { createColumnHelper } from '@tanstack/react-table';
4
2
  import type { CollectionEntry } from 'astro:content';
5
- import { filterByName, filterCollectionByName } from '../filters/custom-filters';
3
+ import { filterByName } from '../filters/custom-filters';
6
4
  import { buildUrl } from '@utils/url-builder';
7
5
  import { QueueListIcon } from '@heroicons/react/24/solid';
6
+ import { createBadgesColumn } from './SharedColumns';
8
7
 
9
8
  const columnHelper = createColumnHelper<CollectionEntry<'flows'>>();
10
9
 
@@ -61,6 +60,7 @@ export const columns = () => [
61
60
  className: 'max-w-md',
62
61
  },
63
62
  }),
63
+ createBadgesColumn(columnHelper),
64
64
  columnHelper.accessor('data.name', {
65
65
  header: () => <span />,
66
66
  cell: (info) => {