@eventcatalog/core 2.50.2 → 2.50.3

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.
@@ -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.50.2";
40
+ var version = "2.50.3";
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-PRZAFM4L.js";
4
- import "../chunk-L3RINLLN.js";
3
+ } from "../chunk-JCCZIMIQ.js";
4
+ import "../chunk-RGWI2XAA.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.50.2";
109
+ var version = "2.50.3";
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-6DT6JYDR.js";
4
- import "../chunk-PRZAFM4L.js";
5
- import "../chunk-L3RINLLN.js";
3
+ } from "../chunk-ZTETQ7PD.js";
4
+ import "../chunk-JCCZIMIQ.js";
5
+ import "../chunk-RGWI2XAA.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-L3RINLLN.js";
3
+ } from "./chunk-RGWI2XAA.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.50.2";
2
+ var version = "2.50.3";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-PRZAFM4L.js";
3
+ } from "./chunk-JCCZIMIQ.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.50.2";
28
+ var version = "2.50.3";
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-L3RINLLN.js";
3
+ } from "./chunk-RGWI2XAA.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.50.2";
160
+ var version = "2.50.3";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-XE6PFSH5.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-6DT6JYDR.js";
10
- import "./chunk-PRZAFM4L.js";
9
+ } from "./chunk-ZTETQ7PD.js";
10
+ import "./chunk-JCCZIMIQ.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
@@ -15,7 +15,7 @@ import {
15
15
  import "./chunk-LDBRNJIL.js";
16
16
  import {
17
17
  VERSION
18
- } from "./chunk-L3RINLLN.js";
18
+ } from "./chunk-RGWI2XAA.js";
19
19
  import {
20
20
  isAuthEnabled,
21
21
  isBackstagePluginEnabled,
@@ -1,28 +1,51 @@
1
1
  import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/react';
2
2
  import { MinusIcon } from '@heroicons/react/16/solid';
3
3
  import { PlusIcon } from '@heroicons/react/24/outline';
4
+ import { useEffect } from 'react';
5
+
6
+ declare global {
7
+ interface Window {
8
+ renderDiagrams?: (graphs: HTMLCollectionOf<Element>) => void;
9
+ renderPlantUML?: (graphs: HTMLCollectionOf<Element>) => void;
10
+ }
11
+ }
4
12
 
5
13
  export default function Example({ title, children }: any) {
6
14
  return (
7
15
  <div className="border border-gray-200 rounded-md px-4 shadow-sm py-2 accordion">
8
16
  <Disclosure as="div" key={title} className="">
9
- {({ open }) => (
10
- <div>
11
- <DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
12
- <span className="text-base font-semibold leading-7">{title}</span>
13
- <span className="ml-6 flex h-7 items-center">
14
- {open ? (
15
- <MinusIcon className="h-6 w-6" aria-hidden="true" />
16
- ) : (
17
- <PlusIcon className="h-6 w-6" aria-hidden="true" />
18
- )}
19
- </span>
20
- </DisclosureButton>
21
- <DisclosurePanel as="dd" className="pr-12 not-prose py-4">
22
- <p className="text-base leading-7 text-gray-600">{children}</p>
23
- </DisclosurePanel>
24
- </div>
25
- )}
17
+ {({ open }) => {
18
+ useEffect(() => {
19
+ if (open) {
20
+ const graphs = document.getElementsByClassName('mermaid');
21
+ const plantUML = document.getElementsByClassName('plantuml');
22
+ if (graphs.length > 0 && window.renderDiagrams) {
23
+ window.renderDiagrams(graphs);
24
+ }
25
+ if (plantUML.length > 0 && window.renderPlantUML) {
26
+ window.renderPlantUML(plantUML);
27
+ }
28
+ }
29
+ }, [open]);
30
+
31
+ return (
32
+ <div>
33
+ <DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
34
+ <span className="text-base font-semibold leading-7">{title}</span>
35
+ <span className="ml-6 flex h-7 items-center">
36
+ {open ? (
37
+ <MinusIcon className="h-6 w-6" aria-hidden="true" />
38
+ ) : (
39
+ <PlusIcon className="h-6 w-6" aria-hidden="true" />
40
+ )}
41
+ </span>
42
+ </DisclosureButton>
43
+ <DisclosurePanel as="dd" className="pr-12 py-4 prose prose-sm max-w-none">
44
+ <div className="text-base leading-7 text-gray-600">{children}</div>
45
+ </DisclosurePanel>
46
+ </div>
47
+ );
48
+ }}
26
49
  </Disclosure>
27
50
  </div>
28
51
  );
@@ -5,7 +5,7 @@ import Admonition from '@components/MDX/Admonition';
5
5
  import NodeGraph from '../NodeGraph/NodeGraph';
6
6
  import { getVersionFromCollection } from '@utils/collections/versions';
7
7
 
8
- const { id, version = 'latest', maxHeight, includeKey = true } = Astro.props;
8
+ const { id, version = 'latest', maxHeight, includeKey = true, mode = 'simple', walkthrough = true, search = true } = Astro.props;
9
9
 
10
10
  // Find the flow for the given id and version
11
11
  const flows = await getFlows();
@@ -17,6 +17,7 @@ const flow = flowCollection[0];
17
17
  const { nodes, edges } = await getNodesAndEdges({
18
18
  id: id,
19
19
  version: flow.data.version,
20
+ mode: mode,
20
21
  });
21
22
  ---
22
23
 
@@ -53,6 +54,8 @@ const { nodes, edges } = await getNodesAndEdges({
53
54
  includeKey={includeKey}
54
55
  footerLabel=`Flow diagram - ${flow.data.name} - v(${flow.data.version})`
55
56
  client:only="react"
57
+ showFlowWalkthrough={walkthrough}
58
+ showSearch={search}
56
59
  />
57
60
  </div>
58
61
 
@@ -30,9 +30,22 @@ interface Props {
30
30
  url: string;
31
31
  };
32
32
  linksToVisualiser?: boolean;
33
+ showSearch?: boolean;
34
+ showLegend?: boolean;
33
35
  }
34
36
 
35
- const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href, linksToVisualiser } = Astro.props;
37
+ const {
38
+ id,
39
+ collection,
40
+ title,
41
+ mode = 'simple',
42
+ linkTo = 'docs',
43
+ version,
44
+ href,
45
+ linksToVisualiser,
46
+ showSearch = true,
47
+ showLegend = true,
48
+ } = Astro.props;
36
49
 
37
50
  let nodes = [],
38
51
  edges = [];
@@ -121,6 +134,8 @@ if (collection === 'domains-entities') {
121
134
  linksToVisualiser={linksToVisualiser}
122
135
  links={links}
123
136
  mode={mode}
137
+ showSearch={showSearch}
138
+ includeKey={showLegend}
124
139
  />
125
140
  </div>
126
141
 
@@ -55,6 +55,8 @@ interface Props {
55
55
  linksToVisualiser?: boolean;
56
56
  links?: { label: string; url: string }[];
57
57
  mode?: 'full' | 'simple';
58
+ showFlowWalkthrough?: boolean;
59
+ showSearch?: boolean;
58
60
  }
59
61
 
60
62
  const getVisualiserUrlForCollection = (collectionItem: CollectionEntry<CollectionTypes>) => {
@@ -71,6 +73,8 @@ const NodeGraphBuilder = ({
71
73
  linksToVisualiser = false,
72
74
  links = [],
73
75
  mode = 'full',
76
+ showFlowWalkthrough = true,
77
+ showSearch = true,
74
78
  }: Props) => {
75
79
  const nodeTypes = useMemo(
76
80
  () => ({
@@ -492,7 +496,7 @@ const NodeGraphBuilder = ({
492
496
  </span>
493
497
  )}
494
498
  </div>
495
- {mode === 'full' && (
499
+ {mode === 'full' && showSearch && (
496
500
  <div className="flex justify-end space-x-2 w-96">
497
501
  <VisualiserSearch ref={searchRef} nodes={nodes} onNodeSelect={handleNodeSelect} onClear={handleSearchClear} />
498
502
  </div>
@@ -588,7 +592,7 @@ const NodeGraphBuilder = ({
588
592
  )}
589
593
  {includeBackground && <Background color="#bbb" gap={16} />}
590
594
  {includeBackground && <Controls />}
591
- {isFlowVisualization && (
595
+ {isFlowVisualization && showFlowWalkthrough && (
592
596
  <Panel position="bottom-left">
593
597
  <StepWalkthrough
594
598
  nodes={nodes}
@@ -637,6 +641,8 @@ interface NodeGraphProps {
637
641
  links?: { label: string; url: string }[];
638
642
  mode?: 'full' | 'simple';
639
643
  portalId?: string;
644
+ showFlowWalkthrough?: boolean;
645
+ showSearch?: boolean;
640
646
  }
641
647
 
642
648
  const NodeGraph = ({
@@ -653,6 +659,8 @@ const NodeGraph = ({
653
659
  links = [],
654
660
  mode = 'full',
655
661
  portalId,
662
+ showFlowWalkthrough = true,
663
+ showSearch = true,
656
664
  }: NodeGraphProps) => {
657
665
  const [elem, setElem] = useState(null);
658
666
  const [showFooter, setShowFooter] = useState(true);
@@ -687,6 +695,8 @@ const NodeGraph = ({
687
695
  linksToVisualiser={linksToVisualiser}
688
696
  links={links}
689
697
  mode={mode}
698
+ showFlowWalkthrough={showFlowWalkthrough}
699
+ showSearch={showSearch}
690
700
  />
691
701
 
692
702
  {showFooter && (
@@ -410,6 +410,9 @@ const badges = doc?.badges || [];
410
410
  renderDiagrams(graphs);
411
411
  }
412
412
 
413
+ // Make renderDiagrams available globally for accordion component
414
+ window.renderDiagrams = renderDiagrams;
415
+
413
416
  document.addEventListener('astro:page-load', setupObserver);
414
417
  </script>
415
418
 
@@ -467,5 +470,9 @@ const badges = doc?.badges || [];
467
470
  if (document.getElementsByClassName('plantuml').length > 0) {
468
471
  renderPlantUML(graphs, deflate);
469
472
  }
473
+
474
+ window.renderPlantUML = (graphs: any) => {
475
+ renderPlantUML(graphs, deflate);
476
+ };
470
477
  });
471
478
  </script>
@@ -191,10 +191,17 @@ const generatePromptForResource = (props: any) => {
191
191
  // Handle node graphs in the markdown
192
192
  let nodeGraphs = getMDXComponentsByName(props.body || '', 'NodeGraph') || [];
193
193
 
194
+ // Get props for the node graph (when no id is passed, we assume its the current page)
195
+ const nodeGraphPropsForPage = nodeGraphs.find((nodeGraph: any) => nodeGraph.id === undefined) || ({} as any);
196
+
197
+ // This will render the graph for this page
194
198
  nodeGraphs.push({
195
199
  id: props.data.id,
196
200
  version: props.data.version,
197
201
  type: collectionToResourceMap[props.collection as keyof typeof collectionToResourceMap],
202
+ ...nodeGraphPropsForPage,
203
+ search: nodeGraphPropsForPage?.search ? nodeGraphPropsForPage.search === 'true' : true,
204
+ legend: nodeGraphPropsForPage?.legend ? nodeGraphPropsForPage.legend === 'true' : true,
198
205
  });
199
206
  ---
200
207
 
@@ -350,8 +357,10 @@ nodeGraphs.push({
350
357
  version={nodeGraph.version}
351
358
  collection={collection}
352
359
  title={nodeGraph.title}
353
- mode="simple"
360
+ mode={nodeGraph.mode || 'simple'}
354
361
  linksToVisualiser={true}
362
+ showSearch={nodeGraph.search ?? true}
363
+ showLegend={nodeGraph.legend ?? true}
355
364
  href={{
356
365
  label: 'Open in Visualiser',
357
366
  url: buildUrl(`/visualiser/${collection}/${nodeGraph.id}/${nodeGraph.version}`),
@@ -485,6 +494,9 @@ nodeGraphs.push({
485
494
  if (document.getElementsByClassName('mermaid').length > 0) {
486
495
  renderDiagrams(graphs);
487
496
  }
497
+
498
+ // Make renderDiagrams available globally for accordion component
499
+ window.renderDiagrams = renderDiagrams;
488
500
  </script>
489
501
 
490
502
  <script>
@@ -542,6 +554,10 @@ nodeGraphs.push({
542
554
  if (document.getElementsByClassName('plantuml').length > 0) {
543
555
  renderPlantUML(graphs, deflate);
544
556
  }
557
+
558
+ window.renderPlantUML = (graphs: any) => {
559
+ renderPlantUML(graphs, deflate);
560
+ };
545
561
  });
546
562
  </script>
547
563
  </VerticalSideBarLayout>
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.50.2",
9
+ "version": "2.50.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },