@eventcatalog/core 2.30.5 → 2.30.7

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 CHANGED
@@ -34,7 +34,7 @@
34
34
  <h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
35
35
 
36
36
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
37
- [![All Contributors](https://img.shields.io/badge/all_contributors-50-orange.svg?style=flat-square)](#contributors-)
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-51-orange.svg?style=flat-square)](#contributors-)
38
38
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
39
39
 
40
40
  [Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
@@ -261,6 +261,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
261
261
  </tr>
262
262
  <tr>
263
263
  <td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/ruudwelling/"><img src="https://avatars.githubusercontent.com/u/4014179?v=4?s=100" width="100px;" alt="Ruud Welling"/><br /><sub><b>Ruud Welling</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=WellingR" title="Code">💻</a></td>
264
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/vienin"><img src="https://avatars.githubusercontent.com/u/2124283?v=4?s=100" width="100px;" alt="Kevin Pouget"/><br /><sub><b>Kevin Pouget</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=vienin" title="Code">💻</a></td>
264
265
  </tr>
265
266
  </tbody>
266
267
  </table>
@@ -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.30.5";
40
+ var version = "2.30.7";
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-K5JCIULJ.js";
4
- import "../chunk-D7PI5D2P.js";
3
+ } from "../chunk-EFSBN3ZZ.js";
4
+ import "../chunk-SUJLBNZK.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.30.5";
109
+ var version = "2.30.7";
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-GRTEQOIT.js";
4
- import "../chunk-K5JCIULJ.js";
5
- import "../chunk-D7PI5D2P.js";
3
+ } from "../chunk-HINNLTBH.js";
4
+ import "../chunk-EFSBN3ZZ.js";
5
+ import "../chunk-SUJLBNZK.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
  VERSION
3
- } from "./chunk-D7PI5D2P.js";
3
+ } from "./chunk-SUJLBNZK.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-K5JCIULJ.js";
3
+ } from "./chunk-EFSBN3ZZ.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.30.5";
2
+ var version = "2.30.7";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.30.5";
28
+ var version = "2.30.7";
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-D7PI5D2P.js";
3
+ } from "./chunk-SUJLBNZK.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.30.5";
160
+ var version = "2.30.7";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-UKJ7F5WR.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-GRTEQOIT.js";
10
- import "./chunk-K5JCIULJ.js";
9
+ } from "./chunk-HINNLTBH.js";
10
+ import "./chunk-EFSBN3ZZ.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
14
  } from "./chunk-7SI5EVOX.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-D7PI5D2P.js";
17
+ } from "./chunk-SUJLBNZK.js";
18
18
  import {
19
19
  isBackstagePluginEnabled
20
20
  } from "./chunk-XMDPVKIJ.js";
@@ -25,6 +25,7 @@ import CommandNode from './Nodes/Command';
25
25
  import ExternalSystemNode from './Nodes/ExternalSystem';
26
26
  import AnimatedMessageEdge from './Edges/AnimatedMessageEdge';
27
27
  import FlowEdge from './Edges/FlowEdge';
28
+ import CustomNode from './Nodes/Custom';
28
29
 
29
30
  import type { CollectionEntry } from 'astro:content';
30
31
  import { navigate } from 'astro:transitions/client';
@@ -69,6 +70,7 @@ const NodeGraphBuilder = ({
69
70
  step: StepNode,
70
71
  user: UserNode,
71
72
  actor: UserNode,
73
+ custom: CustomNode,
72
74
  externalSystem: ExternalSystemNode,
73
75
  }),
74
76
  []
@@ -0,0 +1,161 @@
1
+ import { Handle } from '@xyflow/react';
2
+ import * as Icons from '@heroicons/react/24/solid';
3
+ import type { ComponentType } from 'react';
4
+ import * as ContextMenu from '@radix-ui/react-context-menu';
5
+ import * as Tooltip from '@radix-ui/react-tooltip';
6
+
7
+ type MenuItem = {
8
+ label: string;
9
+ url?: string;
10
+ };
11
+
12
+ interface Data {
13
+ title: string;
14
+ label: string;
15
+ bgColor: string;
16
+ color: string;
17
+ mode: 'simple' | 'full';
18
+ step: { id: string; title: string; summary: string; name: string; actor: { name: string } };
19
+ showTarget?: boolean;
20
+ showSource?: boolean;
21
+ custom: {
22
+ icon?: string;
23
+ type?: string;
24
+ title?: string;
25
+ summary?: string;
26
+ url?: string;
27
+ color?: string;
28
+ properties?: Record<string, string>;
29
+ menu?: MenuItem[];
30
+ height?: number;
31
+ };
32
+ }
33
+
34
+ function classNames(...classes: any) {
35
+ return classes.filter(Boolean).join(' ');
36
+ }
37
+
38
+ export default function UserNode({ data, sourcePosition, targetPosition }: any) {
39
+ const { mode, step, custom: customProps } = data as Data;
40
+
41
+ console.log('step', customProps);
42
+
43
+ const {
44
+ color = 'blue',
45
+ title = 'Custom',
46
+ icon = 'UserIcon',
47
+ type = 'custom',
48
+ summary = '',
49
+ url = '',
50
+ properties = {},
51
+ menu = [],
52
+ height = 5,
53
+ } = customProps;
54
+
55
+ const IconComponent: ComponentType<{ className?: string }> | undefined = Icons[icon as keyof typeof Icons];
56
+
57
+ const { actor: { name } = {} } = step;
58
+
59
+ const isLongType = type && type.length > 10;
60
+ const displayType = isLongType ? `${type.substring(0, 10)}...` : type;
61
+
62
+ return (
63
+ <ContextMenu.Root>
64
+ <ContextMenu.Trigger>
65
+ <div
66
+ className={classNames(`w-full rounded-md border flex justify-start bg-white text-black border-${color}-400`)}
67
+ style={{ minHeight: mode === 'full' ? `${height}em` : '2em' }}
68
+ >
69
+ <div
70
+ className={classNames(
71
+ `bg-gradient-to-b from-${color}-400 to-${color}-600 relative flex items-center w-5 justify-center rounded-l-sm text-orange-100-500`,
72
+ `border-r-[1px] border-${color}`
73
+ )}
74
+ >
75
+ <IconComponent className="w-4 h-4 opacity-90 text-white absolute top-1 " />
76
+ {mode === 'full' && (
77
+ <Tooltip.Provider>
78
+ <Tooltip.Root>
79
+ <Tooltip.Trigger asChild>
80
+ <span className="rotate -rotate-90 w-1/2 text-center absolute bottom-1 text-[9px] text-white font-bold uppercase tracking-[3px] ">
81
+ {displayType}
82
+ </span>
83
+ </Tooltip.Trigger>
84
+ {isLongType && (
85
+ <Tooltip.Portal>
86
+ <Tooltip.Content
87
+ className="bg-slate-800 text-white rounded px-2 py-1 text-xs shadow-md z-50"
88
+ side="right"
89
+ sideOffset={5}
90
+ >
91
+ {type}
92
+ <Tooltip.Arrow className="fill-slate-800" />
93
+ </Tooltip.Content>
94
+ </Tooltip.Portal>
95
+ )}
96
+ </Tooltip.Root>
97
+ </Tooltip.Provider>
98
+ )}
99
+ </div>
100
+ <div className="p-1 min-w-60 max-w-[min-content]">
101
+ {targetPosition && <Handle type="target" position={targetPosition} />}
102
+ {sourcePosition && <Handle type="source" position={sourcePosition} />}
103
+
104
+ {(!summary || mode !== 'full') && (
105
+ <div className="h-full ">
106
+ <span className="text-sm font-bold block pb-0.5 block w-full">{title}</span>
107
+ </div>
108
+ )}
109
+
110
+ {summary && mode === 'full' && (
111
+ <div>
112
+ <div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
113
+ <span className="text-xs font-bold block pb-0.5">{title}</span>
114
+ </div>
115
+ {mode === 'full' && (
116
+ <div className="divide-y divide-gray-200 ">
117
+ <div className="leading-3 py-1">
118
+ <span className="text-[8px] font-light">{summary}</span>
119
+ </div>
120
+ {properties && (
121
+ <div className="grid grid-cols-2 gap-x-4 py-1">
122
+ {Object.entries(properties).map(([key, value]) => (
123
+ <span key={key} className="text-xs" style={{ fontSize: '0.2em' }}>
124
+ {key}:{' '}
125
+ {typeof value === 'string' && value.startsWith('http') ? (
126
+ <a href={value} target="_blank" rel="noopener noreferrer" className="text-blue-500 underline">
127
+ {value}
128
+ </a>
129
+ ) : (
130
+ value
131
+ )}
132
+ </span>
133
+ ))}
134
+ </div>
135
+ )}
136
+ </div>
137
+ )}
138
+ </div>
139
+ )}
140
+ </div>
141
+ </div>
142
+ </ContextMenu.Trigger>
143
+ {menu?.length > 0 && (
144
+ <ContextMenu.Portal>
145
+ <ContextMenu.Content className="min-w-[220px] bg-white rounded-md p-1 shadow-md border border-gray-200">
146
+ {menu?.map((item) => {
147
+ return (
148
+ <ContextMenu.Item
149
+ asChild
150
+ className="text-sm px-2 py-1.5 outline-none cursor-pointer hover:bg-orange-100 rounded-sm flex items-center"
151
+ >
152
+ <a href={item.url}>{item.label}</a>
153
+ </ContextMenu.Item>
154
+ );
155
+ })}
156
+ </ContextMenu.Content>
157
+ </ContextMenu.Portal>
158
+ )}
159
+ </ContextMenu.Root>
160
+ );
161
+ }
@@ -159,6 +159,26 @@ const flows = defineCollection({
159
159
  name: z.string(),
160
160
  })
161
161
  .optional(),
162
+ custom: z
163
+ .object({
164
+ title: z.string(),
165
+ icon: z.string().optional(),
166
+ type: z.string().optional(),
167
+ summary: z.string().optional(),
168
+ url: z.string().url().optional(),
169
+ color: z.string().optional(),
170
+ properties: z.record(z.union([z.string(), z.number()])).optional(),
171
+ height: z.number().optional(),
172
+ menu: z
173
+ .array(
174
+ z.object({
175
+ label: z.string(),
176
+ url: z.string().url().optional(),
177
+ })
178
+ )
179
+ .optional(),
180
+ })
181
+ .optional(),
162
182
  externalSystem: z
163
183
  .object({
164
184
  name: z.string(),
@@ -10,8 +10,10 @@ export const getChangeLogs = async (item: CollectionEntry<CollectionTypes>): Pro
10
10
  // Get all logs for collection type and filter by given collection
11
11
  const logs = await getCollection('changelogs', (log) => {
12
12
  const collectionDirectory = path.dirname(item?.filePath || '');
13
- const isRootChangeLog = path.join(collectionDirectory, 'changelog.md') === log.filePath;
14
- const isVersionedChangeLog = log.filePath?.includes(path.join(collectionDirectory, 'versioned'));
13
+ const isRootChangeLog = path.join(collectionDirectory, 'changelog.mdx') === log.filePath;
14
+ // Ensure the path follows <collectionDirectory>/versioned/<version>/changelog.mdx
15
+ const versionedPathPattern = new RegExp(`${collectionDirectory}/versioned/[^/]+/changelog\\.mdx$`);
16
+ const isVersionedChangeLog = versionedPathPattern.test(log.filePath!);
15
17
  return log.id.includes(`${collection}/`) && (isRootChangeLog || isVersionedChangeLog);
16
18
  });
17
19
 
@@ -19,7 +21,7 @@ export const getChangeLogs = async (item: CollectionEntry<CollectionTypes>): Pro
19
21
  // Check if there is a version in the url
20
22
  const isVersioned = log.id.includes('versioned');
21
23
 
22
- const parts = log.id.split('/');
24
+ const parts = log.filePath!.split('/');
23
25
  // hack to get the version of the id (url)
24
26
  const version = parts[parts.length - 2];
25
27
  return {
@@ -65,6 +65,7 @@ export const getNodesAndEdges = async ({ id, defaultFlow, version, mode = 'simpl
65
65
  if (step.service) return getServiceNode(step, services);
66
66
  if (step.message) return getMessageNode(step, messages);
67
67
  if (step.actor) return { ...step, type: 'actor', actor: step.actor };
68
+ if (step.custom) return { ...step, type: 'custom', custom: step.custom };
68
69
  if (step.externalSystem) return { ...step, type: 'externalSystem', externalSystem: step.externalSystem };
69
70
  return { ...step, type: 'step' };
70
71
  });
@@ -89,7 +90,7 @@ export const getNodesAndEdges = async ({ id, defaultFlow, version, mode = 'simpl
89
90
  if (step.message) node.data.message = step.message;
90
91
  if (step.actor) node.data.actor = step.actor;
91
92
  if (step.externalSystem) node.data.externalSystem = step.externalSystem;
92
-
93
+ if (step.custom) node.data.custom = step.custom;
93
94
  nodes.push(node);
94
95
  });
95
96
 
@@ -38,8 +38,8 @@ export default {
38
38
  safelist: [
39
39
  { pattern: /border-.*-(200|400|500)/ },
40
40
  { pattern: /bg-.*-(100|200|400|500)/ },
41
- { pattern: /from-.*-(100|200|300|400|500|700)/ },
42
- { pattern: /to-.*-(100|200|300|400|500|700)/ },
41
+ { pattern: /from-.*-(100|200|300|400|500|600|700)/ },
42
+ { pattern: /to-.*-(100|200|300|400|500|600|700)/ },
43
43
  { pattern: /text-.*-(400|500|800)/ },
44
44
  'border-blue-200',
45
45
  'border-green-300',
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.30.5",
9
+ "version": "2.30.7",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -40,6 +40,7 @@
40
40
  "@parcel/watcher": "^2.4.1",
41
41
  "@radix-ui/react-context-menu": "^2.2.6",
42
42
  "@radix-ui/react-dialog": "^1.1.6",
43
+ "@radix-ui/react-tooltip": "^1.1.8",
43
44
  "@scalar/api-reference-react": "^0.4.37",
44
45
  "@stoplight/json-schema-viewer": "^4.16.4",
45
46
  "@tailwindcss/typography": "^0.5.13",