@eventcatalog/core 2.54.8 → 2.55.1

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 (58) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +4 -4
  5. package/dist/catalog-to-astro-content-directory.cjs +1 -1
  6. package/dist/catalog-to-astro-content-directory.js +3 -3
  7. package/dist/{chunk-BLDONK5J.js → chunk-2C7LRK2M.js} +3 -3
  8. package/dist/{chunk-YEQVKHST.js → chunk-3W6JYTHP.js} +2 -2
  9. package/dist/{chunk-LDBRNJIL.js → chunk-55D645EH.js} +1 -1
  10. package/dist/{chunk-LK5JF3WD.js → chunk-D4MIDRVV.js} +2 -2
  11. package/dist/{chunk-MCSZBCOG.js → chunk-I23A46WZ.js} +3 -3
  12. package/dist/{chunk-XE6PFSH5.js → chunk-PLNJC7NZ.js} +2 -2
  13. package/dist/{chunk-ERICNBX2.js → chunk-Q3RTITUV.js} +1 -1
  14. package/dist/{chunk-IZMM7ZGY.js → chunk-R2BJ7MJG.js} +4 -4
  15. package/dist/{chunk-ZVJRM3VC.js → chunk-SKPKGCT7.js} +1 -1
  16. package/dist/{chunk-E7TXTI7G.js → chunk-UPONRQSN.js} +4 -4
  17. package/dist/constants.cjs +1 -1
  18. package/dist/constants.js +1 -1
  19. package/dist/eventcatalog-config-file-utils.js +1 -1
  20. package/dist/eventcatalog.cjs +2 -2
  21. package/dist/eventcatalog.js +14 -14
  22. package/dist/features.js +2 -2
  23. package/dist/generate.js +2 -2
  24. package/dist/map-catalog-to-astro.js +1 -1
  25. package/dist/resolve-catalog-dependencies.js +2 -2
  26. package/dist/watcher.js +2 -2
  27. package/eventcatalog/astro.config.mjs +2 -0
  28. package/eventcatalog/integrations/ecstudio-watcher.mjs +62 -0
  29. package/eventcatalog/src/components/Grids/ServiceGrid.tsx +2 -2
  30. package/eventcatalog/src/components/MDX/Design/Design.astro +67 -0
  31. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +39 -16
  32. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Actor.tsx +24 -0
  33. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Channel.tsx +20 -119
  34. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Command.tsx +19 -76
  35. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Data.tsx +24 -0
  36. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Event.tsx +20 -82
  37. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/ExternalSystem2.tsx +24 -0
  38. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/MessageContextMenu.tsx +9 -3
  39. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Query.tsx +19 -74
  40. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Service.tsx +19 -73
  41. package/eventcatalog/src/components/MDX/NodeGraph/Nodes/View.tsx +24 -0
  42. package/eventcatalog/src/components/MDX/components.tsx +2 -0
  43. package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +23 -0
  44. package/eventcatalog/src/components/SideNav/ListViewSideBar/types.ts +8 -0
  45. package/eventcatalog/src/components/SideNav/ListViewSideBar/utils.ts +11 -0
  46. package/eventcatalog/src/content.config.ts +35 -0
  47. package/eventcatalog/src/pages/visualiser/designs/[id]/_index.data.ts +75 -0
  48. package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +31 -0
  49. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/_index.data.ts +0 -2
  50. package/eventcatalog/src/utils/collections/designs.ts +13 -0
  51. package/eventcatalog/src/utils/collections/file-diffs.ts +1 -1
  52. package/eventcatalog/src/utils/node-graphs/domains-canvas.ts +3 -3
  53. package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +7 -7
  54. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +8 -3
  55. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +7 -6
  56. package/eventcatalog/src/utils/node-graphs/utils/utils.ts +1 -1
  57. package/eventcatalog/tailwind.config.mjs +1 -0
  58. package/package.json +2 -1
@@ -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.54.8";
40
+ var version = "2.55.1";
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-ERICNBX2.js";
4
- import "../chunk-ZVJRM3VC.js";
3
+ } from "../chunk-Q3RTITUV.js";
4
+ import "../chunk-SKPKGCT7.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.54.8";
109
+ var version = "2.55.1";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-LK5JF3WD.js";
4
- import "../chunk-ERICNBX2.js";
5
- import "../chunk-ZVJRM3VC.js";
6
- import "../chunk-E7TXTI7G.js";
3
+ } from "../chunk-D4MIDRVV.js";
4
+ import "../chunk-Q3RTITUV.js";
5
+ import "../chunk-SKPKGCT7.js";
6
+ import "../chunk-UPONRQSN.js";
7
7
  export {
8
8
  log_build_default as default
9
9
  };
@@ -35,7 +35,7 @@ __export(catalog_to_astro_content_directory_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(catalog_to_astro_content_directory_exports);
37
37
 
38
- // node_modules/.pnpm/tsup@8.3.6_jiti@1.21.7_postcss@8.5.1_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
38
+ // node_modules/.pnpm/tsup@8.5.0_jiti@1.21.7_postcss@8.5.6_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
39
39
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
40
40
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
41
 
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  catalogToAstro,
3
3
  checkAndConvertMdToMdx
4
- } from "./chunk-IZMM7ZGY.js";
5
- import "./chunk-LDBRNJIL.js";
6
- import "./chunk-E7TXTI7G.js";
4
+ } from "./chunk-R2BJ7MJG.js";
5
+ import "./chunk-55D645EH.js";
6
+ import "./chunk-UPONRQSN.js";
7
7
  export {
8
8
  catalogToAstro,
9
9
  checkAndConvertMdToMdx
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getEventCatalogConfigFile
3
- } from "./chunk-E7TXTI7G.js";
3
+ } from "./chunk-UPONRQSN.js";
4
4
 
5
5
  // src/resolve-catalog-dependencies.js
6
- import path from "node:path";
7
- import fs from "node:fs";
6
+ import path from "path";
7
+ import fs from "fs";
8
8
  import matter from "gray-matter";
9
9
  var resolve_catalog_dependencies_default = async (catalogDir, core) => {
10
10
  const catalogConfig = await getEventCatalogConfigFile(catalogDir);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  cleanup,
3
3
  getEventCatalogConfigFile
4
- } from "./chunk-E7TXTI7G.js";
4
+ } from "./chunk-UPONRQSN.js";
5
5
 
6
6
  // src/generate.js
7
- import path from "node:path";
7
+ import path from "path";
8
8
  function getDefaultExport(importedModule) {
9
9
  if (importedModule === null || typeof importedModule !== "object") {
10
10
  throw new Error("Invalid module");
@@ -1,5 +1,5 @@
1
1
  // src/map-catalog-to-astro.js
2
- import path from "node:path";
2
+ import path from "path";
3
3
  var COLLECTION_KEYS = [
4
4
  "events",
5
5
  "commands",
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-ERICNBX2.js";
3
+ } from "./chunk-Q3RTITUV.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
7
- } from "./chunk-E7TXTI7G.js";
7
+ } from "./chunk-UPONRQSN.js";
8
8
 
9
9
  // src/analytics/log-build.js
10
10
  var getFeatures = async (configFile) => {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getEventCatalogConfigFile
3
- } from "./chunk-E7TXTI7G.js";
3
+ } from "./chunk-UPONRQSN.js";
4
4
 
5
5
  // src/features.ts
6
6
  import boxen from "boxen";
7
- import { join } from "node:path";
8
- import fs from "node:fs";
7
+ import { join } from "path";
8
+ import fs from "fs";
9
9
  var getProjectOutDir = async () => {
10
10
  const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
11
11
  return config?.outDir || "dist";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  mapCatalogToAstro
3
- } from "./chunk-LDBRNJIL.js";
3
+ } from "./chunk-55D645EH.js";
4
4
 
5
5
  // src/watcher.js
6
6
  import watcher from "@parcel/watcher";
7
- import fs from "node:fs";
7
+ import fs from "fs";
8
8
  import { rimrafSync } from "rimraf";
9
9
  async function watch(projectDirectory, catalogDirectory, callback = void 0) {
10
10
  const subscription = await watcher.subscribe(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-ZVJRM3VC.js";
3
+ } from "./chunk-SKPKGCT7.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  mapCatalogToAstro
3
- } from "./chunk-LDBRNJIL.js";
3
+ } from "./chunk-55D645EH.js";
4
4
  import {
5
5
  verifyRequiredFieldsAreInCatalogConfigFile
6
- } from "./chunk-E7TXTI7G.js";
6
+ } from "./chunk-UPONRQSN.js";
7
7
 
8
8
  // src/catalog-to-astro-content-directory.js
9
9
  import { glob } from "glob";
10
- import * as path from "node:path";
10
+ import * as path from "path";
11
11
  import fs from "fs";
12
12
  import { fileURLToPath } from "url";
13
- import os from "node:os";
13
+ import os from "os";
14
14
  var __filename = fileURLToPath(import.meta.url);
15
15
  var rootPkg = path.resolve(path.dirname(__filename), "../");
16
16
  var copyFiles = async (source, target) => {
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.54.8";
2
+ var version = "2.55.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  // src/eventcatalog-config-file-utils.js
2
- import { readFile, writeFile, rm } from "node:fs/promises";
3
- import { existsSync } from "node:fs";
4
- import { copyFile } from "node:fs/promises";
5
- import path from "node:path";
2
+ import { readFile, writeFile, rm } from "fs/promises";
3
+ import { existsSync } from "fs";
4
+ import { copyFile } from "fs/promises";
5
+ import path from "path";
6
6
  import { v4 as uuidV4 } from "uuid";
7
7
  import { pathToFileURL } from "url";
8
8
  import matter from "gray-matter";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.54.8";
28
+ var version = "2.55.1";
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-ZVJRM3VC.js";
3
+ } from "./chunk-SKPKGCT7.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -4,7 +4,7 @@ import {
4
4
  getEventCatalogConfigFile,
5
5
  verifyRequiredFieldsAreInCatalogConfigFile,
6
6
  writeEventCatalogConfigFile
7
- } from "./chunk-E7TXTI7G.js";
7
+ } from "./chunk-UPONRQSN.js";
8
8
  export {
9
9
  addPropertyToFrontMatter,
10
10
  cleanup,
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
 
25
- // node_modules/.pnpm/tsup@8.3.6_jiti@1.21.7_postcss@8.5.1_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
25
+ // node_modules/.pnpm/tsup@8.5.0_jiti@1.21.7_postcss@8.5.6_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
26
26
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
27
27
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
28
28
 
@@ -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.54.8";
160
+ var version = "2.55.1";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  resolve_catalog_dependencies_default
3
- } from "./chunk-BLDONK5J.js";
3
+ } from "./chunk-2C7LRK2M.js";
4
4
  import {
5
5
  watch
6
- } from "./chunk-XE6PFSH5.js";
6
+ } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-LK5JF3WD.js";
10
- import "./chunk-ERICNBX2.js";
9
+ } from "./chunk-D4MIDRVV.js";
10
+ import "./chunk-Q3RTITUV.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
- } from "./chunk-IZMM7ZGY.js";
15
- import "./chunk-LDBRNJIL.js";
14
+ } from "./chunk-R2BJ7MJG.js";
15
+ import "./chunk-55D645EH.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-ZVJRM3VC.js";
18
+ } from "./chunk-SKPKGCT7.js";
19
19
  import {
20
20
  getProjectOutDir,
21
21
  isAuthEnabled,
@@ -23,19 +23,19 @@ import {
23
23
  isEventCatalogScaleEnabled,
24
24
  isEventCatalogStarterEnabled,
25
25
  isOutputServer
26
- } from "./chunk-MCSZBCOG.js";
26
+ } from "./chunk-I23A46WZ.js";
27
27
  import {
28
28
  generate
29
- } from "./chunk-YEQVKHST.js";
30
- import "./chunk-E7TXTI7G.js";
29
+ } from "./chunk-3W6JYTHP.js";
30
+ import "./chunk-UPONRQSN.js";
31
31
 
32
32
  // src/eventcatalog.ts
33
33
  import { Command } from "commander";
34
- import { execSync } from "node:child_process";
35
- import { join } from "node:path";
34
+ import { execSync } from "child_process";
35
+ import { join } from "path";
36
36
  import fs from "fs";
37
- import path from "node:path";
38
- import { fileURLToPath } from "node:url";
37
+ import path from "path";
38
+ import { fileURLToPath } from "url";
39
39
  import concurrently from "concurrently";
40
40
  import boxen from "boxen";
41
41
  import updateNotifier from "update-notifier";
package/dist/features.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  isEventCatalogScaleEnabled,
6
6
  isEventCatalogStarterEnabled,
7
7
  isOutputServer
8
- } from "./chunk-MCSZBCOG.js";
9
- import "./chunk-E7TXTI7G.js";
8
+ } from "./chunk-I23A46WZ.js";
9
+ import "./chunk-UPONRQSN.js";
10
10
  export {
11
11
  getProjectOutDir,
12
12
  isAuthEnabled,
package/dist/generate.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-YEQVKHST.js";
4
- import "./chunk-E7TXTI7G.js";
3
+ } from "./chunk-3W6JYTHP.js";
4
+ import "./chunk-UPONRQSN.js";
5
5
  export {
6
6
  generate
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mapCatalogToAstro
3
- } from "./chunk-LDBRNJIL.js";
3
+ } from "./chunk-55D645EH.js";
4
4
  export {
5
5
  mapCatalogToAstro
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolve_catalog_dependencies_default
3
- } from "./chunk-BLDONK5J.js";
4
- import "./chunk-E7TXTI7G.js";
3
+ } from "./chunk-2C7LRK2M.js";
4
+ import "./chunk-UPONRQSN.js";
5
5
  export {
6
6
  resolve_catalog_dependencies_default as default
7
7
  };
package/dist/watcher.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  watch
3
- } from "./chunk-XE6PFSH5.js";
4
- import "./chunk-LDBRNJIL.js";
3
+ } from "./chunk-PLNJC7NZ.js";
4
+ import "./chunk-55D645EH.js";
5
5
  export {
6
6
  watch
7
7
  };
@@ -15,6 +15,7 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
15
15
  /** @type {import('bin/eventcatalog.config').Config} */
16
16
  import config from './eventcatalog.config';
17
17
  import expressiveCode from 'astro-expressive-code';
18
+ import ecstudioWatcher from './integrations/ecstudio-watcher.mjs';
18
19
 
19
20
  const projectDirectory = process.env.PROJECT_DIR || process.cwd();
20
21
  const base = config.base || '/';
@@ -79,6 +80,7 @@ export default defineConfig({
79
80
  Logger: 0,
80
81
  CSS: false,
81
82
  }),
83
+ ecstudioWatcher(),
82
84
  ].filter(Boolean),
83
85
  vite: {
84
86
  define: {
@@ -0,0 +1,62 @@
1
+ export default function ecstudioWatcher() {
2
+ return {
3
+ name: 'ecstudio-watcher',
4
+ hooks: {
5
+ 'astro:server:setup': ({ server, refreshContent }) => {
6
+ // Only set up dynamic watching in development mode
7
+ if (server.config.mode !== 'development') {
8
+ return;
9
+ }
10
+
11
+ // Get the project root directory - server.config.root is already a string path
12
+ const rootDir = server.config.root;
13
+ const isEcstudioFile = (path) => path.endsWith('.ecstudio') && !path.includes('public/generated') && !path.includes('public\\generated');
14
+
15
+ // Set up chokidar to watch for new .ecstudio files
16
+ server.watcher
17
+ .on('add', async (path) => {
18
+ if (isEcstudioFile(path)) {
19
+ console.log(`New .ecstudio file detected: ${path}`);
20
+
21
+ // Add the new file to the watcher and refresh content
22
+ server.watcher.add(path);
23
+
24
+ if (refreshContent) {
25
+ try {
26
+ await refreshContent();
27
+ console.log('Content refreshed after adding new .ecstudio file');
28
+ } catch (error) {
29
+ console.error('Error refreshing content:', error);
30
+ }
31
+ }
32
+ }
33
+ })
34
+ .on('unlink', async (path) => {
35
+ if (isEcstudioFile(path)) {
36
+ console.log(`Removed .ecstudio file: ${path}`);
37
+
38
+ if (refreshContent) {
39
+ try {
40
+ await refreshContent();
41
+ console.log('Content refreshed after removing .ecstudio file');
42
+ } catch (error) {
43
+ console.error('Error refreshing content:', error);
44
+ }
45
+ }
46
+ }
47
+ })
48
+ .on('change', async (path) => {
49
+ if (isEcstudioFile(path)) {
50
+ console.log(`Changed .ecstudio file: ${path}`);
51
+ await refreshContent();
52
+ }
53
+ });
54
+
55
+ // Also add the root directory to watch for new files
56
+ server.watcher.add(rootDir);
57
+
58
+ console.log('Set up dynamic .ecstudio file watcher with content refresh');
59
+ },
60
+ },
61
+ };
62
+ }
@@ -186,7 +186,7 @@ const DomainSection = memo(
186
186
  </div>
187
187
  )}
188
188
 
189
- <div className="grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1 xl:grid-cols-2 gap-6">
189
+ <div className="grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1 xl:grid-cols-1 gap-6">
190
190
  {subdomainServices.map((service) => (
191
191
  <ServiceCard
192
192
  key={service.data.id}
@@ -386,7 +386,7 @@ export default function ServiceGrid({ services, domains, embeded }: ServiceGridP
386
386
  />
387
387
  ))
388
388
  ) : (
389
- <div className={`grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1 xl:grid-cols-${embeded ? 1 : 2} gap-6`}>
389
+ <div className={`grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1 xl:grid-cols-1 gap-6`}>
390
390
  {paginatedServices.map((service) => (
391
391
  <ServiceCard key={service.data.id} service={service} urlParams={urlParams} selectedTypes={selectedTypes} />
392
392
  ))}
@@ -0,0 +1,67 @@
1
+ ---
2
+ const { file: designPath, filePath, search = true, title } = Astro.props;
3
+ import fs from 'fs';
4
+ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
5
+ import Admonition from '@components/MDX/Admonition';
6
+ import NodeGraph from '../NodeGraph/NodeGraph';
7
+
8
+ let design: any;
9
+ let id = 'design';
10
+ let maxHeight = 30;
11
+
12
+ try {
13
+ const fileName = designPath.endsWith('.ecstudio') ? designPath : `${designPath}.ecstudio`;
14
+ const pathToSpec = getAbsoluteFilePathForAstroFile(filePath, fileName);
15
+ const designFile = fs.readFileSync(pathToSpec, 'utf8');
16
+ design = JSON.parse(designFile);
17
+ } catch (error) {
18
+ console.error(`Error reading design file: ${error}`);
19
+ }
20
+ ---
21
+
22
+ {
23
+ !design && (
24
+ <Admonition type="warning">
25
+ <div>
26
+ <span class="block font-bold">{`<Design/>`} failed to load</span>
27
+ <span class="block">
28
+ Tried to load design file: {designPath}. Make sure you have this design file defined in your project.
29
+ </span>
30
+ </div>
31
+ </Admonition>
32
+ )
33
+ }
34
+
35
+ {
36
+ design && (
37
+ <div>
38
+ <div
39
+ class="h-[30em] my-6 mb-12 w-full relative border border-gray-200 rounded-md"
40
+ id={`${id}-portal`}
41
+ style={{
42
+ maxHeight: maxHeight ? `${maxHeight}em` : `30em`,
43
+ }}
44
+ />
45
+
46
+ <div>
47
+ <NodeGraph
48
+ id={id}
49
+ title={title ?? design.name}
50
+ nodes={design.nodes || []}
51
+ edges={design.edges || []}
52
+ hrefLabel={'View in visualizer'}
53
+ linkTo={'visualiser'}
54
+ designId={design.id || id}
55
+ client:only="react"
56
+ showSearch={search}
57
+ />
58
+ </div>
59
+ </div>
60
+ )
61
+ }
62
+
63
+ <style is:global>
64
+ .react-flow__attribution {
65
+ display: none;
66
+ }
67
+ </style>
@@ -14,6 +14,7 @@ import {
14
14
  useReactFlow,
15
15
  getNodesBounds,
16
16
  getViewportForBounds,
17
+ type NodeTypes,
17
18
  } from '@xyflow/react';
18
19
  import '@xyflow/react/dist/style.css';
19
20
  import { HistoryIcon } from 'lucide-react';
@@ -33,6 +34,11 @@ import DomainNode from './Nodes/Domain';
33
34
  import AnimatedMessageEdge from './Edges/AnimatedMessageEdge';
34
35
  import FlowEdge from './Edges/FlowEdge';
35
36
  import CustomNode from './Nodes/Custom';
37
+ import DataNode from './Nodes/Data';
38
+ import ViewNode from './Nodes/View';
39
+ import ActorNode from './Nodes/Actor';
40
+ import ExternalSystemNode2 from './Nodes/ExternalSystem2';
41
+ import { Note as NoteNode } from '@eventcatalog/visualizer';
36
42
 
37
43
  import type { CollectionEntry } from 'astro:content';
38
44
  import { navigate } from 'astro:transitions/client';
@@ -58,6 +64,7 @@ interface Props {
58
64
  showFlowWalkthrough?: boolean;
59
65
  showSearch?: boolean;
60
66
  zoomOnScroll?: boolean;
67
+ designId?: string;
61
68
  }
62
69
 
63
70
  const getVisualiserUrlForCollection = (collectionItem: CollectionEntry<CollectionTypes>) => {
@@ -79,21 +86,34 @@ const NodeGraphBuilder = ({
79
86
  zoomOnScroll = false,
80
87
  }: Props) => {
81
88
  const nodeTypes = useMemo(
82
- () => ({
83
- services: ServiceNode,
84
- flows: FlowNode,
85
- events: EventNode,
86
- channels: ChannelNode,
87
- queries: QueryNode,
88
- commands: CommandNode,
89
- domains: DomainNode,
90
- step: StepNode,
91
- user: UserNode,
92
- actor: UserNode,
93
- custom: CustomNode,
94
- externalSystem: ExternalSystemNode,
95
- entities: EntityNode,
96
- }),
89
+ () =>
90
+ ({
91
+ service: ServiceNode,
92
+ services: ServiceNode,
93
+ flow: FlowNode,
94
+ flows: FlowNode,
95
+ event: EventNode,
96
+ events: EventNode,
97
+ channel: ChannelNode,
98
+ channels: ChannelNode,
99
+ query: QueryNode,
100
+ queries: QueryNode,
101
+ command: CommandNode,
102
+ commands: CommandNode,
103
+ domain: DomainNode,
104
+ domains: DomainNode,
105
+ step: StepNode,
106
+ user: UserNode,
107
+ custom: CustomNode,
108
+ externalSystem: ExternalSystemNode,
109
+ 'external-system': ExternalSystemNode2,
110
+ entity: EntityNode,
111
+ entities: EntityNode,
112
+ data: DataNode,
113
+ view: ViewNode,
114
+ actor: ActorNode,
115
+ note: (props: any) => <NoteNode {...props} readOnly={true} />,
116
+ }) as unknown as NodeTypes,
97
117
  []
98
118
  );
99
119
  const edgeTypes = useMemo(
@@ -106,7 +126,6 @@ const NodeGraphBuilder = ({
106
126
  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
107
127
  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
108
128
  const [isSettingsOpen, setIsSettingsOpen] = useState(false);
109
- const [isAnimated, setIsAnimated] = useState(false);
110
129
  const [animateMessages, setAnimateMessages] = useState(false);
111
130
  const [activeStepIndex, setActiveStepIndex] = useState<number | null>(null);
112
131
 
@@ -560,6 +579,7 @@ const NodeGraphBuilder = ({
560
579
  <CogIcon className="h-5 w-5 text-gray-600" />
561
580
  </button>
562
581
  </div>
582
+
563
583
  {title && (
564
584
  <span className="block shadow-sm bg-white text-xl z-10 text-black px-4 py-1.5 border-gray-200 rounded-md border opacity-80">
565
585
  {title}
@@ -715,6 +735,7 @@ interface NodeGraphProps {
715
735
  showFlowWalkthrough?: boolean;
716
736
  showSearch?: boolean;
717
737
  zoomOnScroll?: boolean;
738
+ designId?: string;
718
739
  }
719
740
 
720
741
  const NodeGraph = ({
@@ -734,6 +755,7 @@ const NodeGraph = ({
734
755
  showFlowWalkthrough = true,
735
756
  showSearch = true,
736
757
  zoomOnScroll = false,
758
+ designId,
737
759
  }: NodeGraphProps) => {
738
760
  const [elem, setElem] = useState(null);
739
761
  const [showFooter, setShowFooter] = useState(true);
@@ -771,6 +793,7 @@ const NodeGraph = ({
771
793
  showFlowWalkthrough={showFlowWalkthrough}
772
794
  showSearch={showSearch}
773
795
  zoomOnScroll={zoomOnScroll}
796
+ designId={designId || id}
774
797
  />
775
798
 
776
799
  {showFooter && (