@eventcatalog/core 5.6.1 → 5.7.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.
Files changed (29) 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 +3 -3
  5. package/dist/{chunk-LVOGLB6C.js → chunk-22KZ4TJF.js} +1 -1
  6. package/dist/{chunk-2NALBBWH.js → chunk-4CV7VC4K.js} +1 -1
  7. package/dist/{chunk-QJXVAM76.js → chunk-BE5PTWNC.js} +1 -1
  8. package/dist/{chunk-N7LDFUEB.js → chunk-FMWQ2YYN.js} +1 -1
  9. package/dist/{chunk-L63ED43X.js → chunk-MOPKQMQP.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +5 -5
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +7 -2
  19. package/eventcatalog/src/components/MDX/NodeGraph/AstroNodeGraph.tsx +21 -1
  20. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +2 -1
  21. package/eventcatalog/src/features/mcp/apps/generated/canvas.html +73 -73
  22. package/eventcatalog/src/features/mcp/apps/generated/viewer.html +73 -73
  23. package/eventcatalog/src/features/studio/components/NodeDetails.tsx +4 -0
  24. package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +74 -8
  25. package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +9 -4
  26. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +4 -0
  27. package/eventcatalog/src/utils/node-graphs/compact-visualiser-graph.ts +14 -0
  28. package/eventcatalog/src/utils/node-graphs/node-resource.ts +26 -0
  29. package/package.json +7 -7
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(analytics_exports);
36
36
  var import_os = __toESM(require("os"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.6.1";
39
+ var version = "5.7.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-2NALBBWH.js";
3
+ } from "../chunk-4CV7VC4K.js";
4
4
  import "../chunk-CPW6G62V.js";
5
- import "../chunk-L63ED43X.js";
5
+ import "../chunk-MOPKQMQP.js";
6
6
  export {
7
7
  raiseEvent
8
8
  };
@@ -169,7 +169,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
169
169
  var import_os = __toESM(require("os"), 1);
170
170
 
171
171
  // package.json
172
- var version = "5.6.1";
172
+ var version = "5.7.0";
173
173
 
174
174
  // src/constants.ts
175
175
  var VERSION = version;
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-LVOGLB6C.js";
3
+ } from "../chunk-22KZ4TJF.js";
4
4
  import "../chunk-AD7CL772.js";
5
- import "../chunk-2NALBBWH.js";
5
+ import "../chunk-4CV7VC4K.js";
6
6
  import "../chunk-YRZK7HKX.js";
7
7
  import "../chunk-CA6WCQ2T.js";
8
8
  import "../chunk-CPW6G62V.js";
9
- import "../chunk-L63ED43X.js";
9
+ import "../chunk-MOPKQMQP.js";
10
10
  import "../chunk-4G7FSRPN.js";
11
11
  export {
12
12
  log_build_default as default
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AD7CL772.js";
4
4
  import {
5
5
  raiseEvent
6
- } from "./chunk-2NALBBWH.js";
6
+ } from "./chunk-4CV7VC4K.js";
7
7
  import {
8
8
  countResources,
9
9
  hashCatalogContent,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CPW6G62V.js";
5
5
  import {
6
6
  VERSION
7
- } from "./chunk-L63ED43X.js";
7
+ } from "./chunk-MOPKQMQP.js";
8
8
 
9
9
  // src/analytics/analytics.js
10
10
  import os from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-L63ED43X.js";
3
+ } from "./chunk-MOPKQMQP.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-QJXVAM76.js";
3
+ } from "./chunk-BE5PTWNC.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "5.6.1";
2
+ var version = "5.7.0";
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 = "5.6.1";
28
+ var version = "5.7.0";
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-L63ED43X.js";
3
+ } from "./chunk-MOPKQMQP.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -174,7 +174,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
174
174
  var import_picocolors = __toESM(require("picocolors"), 1);
175
175
 
176
176
  // package.json
177
- var version = "5.6.1";
177
+ var version = "5.7.0";
178
178
 
179
179
  // src/constants.ts
180
180
  var VERSION = version;
@@ -7,12 +7,12 @@ import {
7
7
  import "./chunk-CA4U2JP7.js";
8
8
  import {
9
9
  log_build_default
10
- } from "./chunk-LVOGLB6C.js";
10
+ } from "./chunk-22KZ4TJF.js";
11
11
  import {
12
12
  getLicenseStatus,
13
13
  printLicenseStatus
14
14
  } from "./chunk-AD7CL772.js";
15
- import "./chunk-2NALBBWH.js";
15
+ import "./chunk-4CV7VC4K.js";
16
16
  import "./chunk-YRZK7HKX.js";
17
17
  import "./chunk-CA6WCQ2T.js";
18
18
  import "./chunk-CPW6G62V.js";
@@ -39,10 +39,10 @@ import {
39
39
  } from "./chunk-NKNOXQ62.js";
40
40
  import {
41
41
  generate
42
- } from "./chunk-N7LDFUEB.js";
42
+ } from "./chunk-FMWQ2YYN.js";
43
43
  import {
44
44
  logger
45
- } from "./chunk-QJXVAM76.js";
45
+ } from "./chunk-BE5PTWNC.js";
46
46
  import {
47
47
  resolve_catalog_dependencies_default
48
48
  } from "./chunk-PD7KTSYN.js";
@@ -79,7 +79,7 @@ import {
79
79
  } from "./chunk-LFQJXLHG.js";
80
80
  import {
81
81
  VERSION
82
- } from "./chunk-L63ED43X.js";
82
+ } from "./chunk-MOPKQMQP.js";
83
83
  import {
84
84
  getEventCatalogConfigFile,
85
85
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -105,7 +105,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
105
105
  var import_picocolors = __toESM(require("picocolors"), 1);
106
106
 
107
107
  // package.json
108
- var version = "5.6.1";
108
+ var version = "5.7.0";
109
109
 
110
110
  // src/constants.ts
111
111
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-N7LDFUEB.js";
4
- import "./chunk-QJXVAM76.js";
5
- import "./chunk-L63ED43X.js";
3
+ } from "./chunk-FMWQ2YYN.js";
4
+ import "./chunk-BE5PTWNC.js";
5
+ import "./chunk-MOPKQMQP.js";
6
6
  import "./chunk-4G7FSRPN.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "5.6.1";
39
+ var version = "5.7.0";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-QJXVAM76.js";
4
- import "../chunk-L63ED43X.js";
3
+ } from "../chunk-BE5PTWNC.js";
4
+ import "../chunk-MOPKQMQP.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -619,9 +619,14 @@ const ChatPanel = ({ isOpen, onClose, configured = false }: ChatPanelProps) => {
619
619
  }
620
620
  }, [configured, isOpen, tools.length, chatApiUrl]);
621
621
 
622
- // Get current URL (pathname + search) on mount and when panel opens
622
+ // Follow the current URL (pathname + search): the panel lives in the persisted header, so it stays mounted while
623
+ // ClientRouter swaps pages underneath it. Reading the URL again after each swap keeps the suggested questions and
624
+ // the "Based on" context on the page the person is actually looking at, not the one they opened the panel from.
623
625
  useEffect(() => {
624
- setPathname(window.location.pathname + window.location.search);
626
+ const updatePathname = () => setPathname(window.location.pathname + window.location.search);
627
+ updatePathname();
628
+ document.addEventListener('astro:after-swap', updatePathname);
629
+ return () => document.removeEventListener('astro:after-swap', updatePathname);
625
630
  }, [isOpen]);
626
631
 
627
632
  // Memoize suggested questions to avoid recalculating on every render
@@ -17,6 +17,7 @@ import { createPortal } from 'react-dom';
17
17
  import type { Node, Edge } from '@xyflow/react';
18
18
  import type { FlowGroupBy, OpenInStudioRequest } from '@eventcatalog/visualiser';
19
19
  import { buildUrl } from '@utils/url-builder';
20
+ import { getNodeDiagramPath } from '@utils/node-graphs/node-resource';
20
21
  import { createCanvasThroughApi } from '@features/studio/api/client';
21
22
  import { getStoredName } from '@features/studio/identity';
22
23
 
@@ -84,9 +85,27 @@ interface AstroNodeGraphProps {
84
85
  swimlanes?: FlowGroupBy;
85
86
  // The Studio API's address, when Studio is on: the menu can then start a canvas from the diagram
86
87
  studioApiUrl?: string;
88
+ // Clicking a node opens its diagram (when the catalog has the visualiser's pages)
89
+ opensDiagrams?: boolean;
87
90
  }
88
91
 
89
- const AstroNodeGraph = ({ isDevMode = false, resourceKey, studioApiUrl, ...otherProps }: AstroNodeGraphProps) => {
92
+ const withoutTrailingSlash = (path: string) => path.replace(/\/+$/, '');
93
+
94
+ /** The diagram page a node opens, unless it's the page this is (e.g. the service on its own diagram) */
95
+ const getNodeDiagramUrl = (node: Node) => {
96
+ const path = getNodeDiagramPath(node);
97
+ if (!path) return undefined;
98
+ const url = buildUrl(path);
99
+ return withoutTrailingSlash(url) === withoutTrailingSlash(window.location.pathname) ? undefined : url;
100
+ };
101
+
102
+ const AstroNodeGraph = ({
103
+ isDevMode = false,
104
+ resourceKey,
105
+ studioApiUrl,
106
+ opensDiagrams = false,
107
+ ...otherProps
108
+ }: AstroNodeGraphProps) => {
90
109
  // Astro-specific navigation handler
91
110
  const handleNavigate = useCallback((url: string) => {
92
111
  // Use window.location for navigation since we can't import astro:transitions/client in a React component
@@ -167,6 +186,7 @@ const AstroNodeGraph = ({ isDevMode = false, resourceKey, studioApiUrl, ...other
167
186
  isDevMode={isDevMode}
168
187
  onNavigate={handleNavigate}
169
188
  onBuildUrl={handleBuildUrl}
189
+ getNodeDiagramUrl={opensDiagrams ? getNodeDiagramUrl : undefined}
170
190
  onSaveLayout={handleSaveLayout}
171
191
  onResetLayout={handleResetLayout}
172
192
  onOpenInStudio={studioApiUrl ? setToOpen : undefined}
@@ -31,7 +31,7 @@ import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
31
31
  import { getNodesAndEdges as getNodesAndEdgesForContainer } from '@utils/node-graphs/container-node-graph';
32
32
  import { getNodesAndEdges as getNodesAndEdgesForChannel } from '@utils/node-graphs/channel-node-graph';
33
33
  import config from '@config';
34
- import { isEventCatalogChatVisible, isDevMode, isCanvasEnabled } from '@utils/feature';
34
+ import { isEventCatalogChatVisible, isDevMode, isCanvasEnabled, isVisualiserEnabled } from '@utils/feature';
35
35
  import { CANVASES_API_PATH } from '@features/studio/api/canvases-api';
36
36
  import { loadSavedLayout, applyLayoutToNodes, buildResourceKey } from '@utils/node-graphs/layout-persistence';
37
37
  import { compactVisualiserGraph } from '@utils/node-graphs/compact-visualiser-graph';
@@ -268,6 +268,7 @@ if (overview && levelsOverview) {
268
268
  swimlanes={lanes}
269
269
  studioApiUrl={studioApiUrl}
270
270
  syncRenderModeWithUrl={syncRenderModeWithUrl}
271
+ opensDiagrams={isVisualiserEnabled()}
271
272
  />
272
273
  </div>
273
274