@eventcatalog/core 2.65.0 → 3.0.0-beta.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 (130) hide show
  1. package/README.md +1 -26
  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-NK6OYMRD.js → chunk-JB4YT5JY.js} +1 -1
  7. package/dist/{chunk-BMDTX5IN.js → chunk-TQ4HZREX.js} +1 -1
  8. package/dist/{chunk-IJRFYF4B.js → chunk-X4W4YC3U.js} +1 -1
  9. package/dist/constants.cjs +1 -1
  10. package/dist/constants.js +1 -1
  11. package/dist/eventcatalog.cjs +1 -21
  12. package/dist/eventcatalog.config.d.cts +10 -0
  13. package/dist/eventcatalog.config.d.ts +10 -0
  14. package/dist/eventcatalog.js +3 -20
  15. package/eventcatalog/src/components/CopyAsMarkdown.tsx +19 -1
  16. package/eventcatalog/src/components/FavoriteButton.tsx +54 -0
  17. package/eventcatalog/src/components/Grids/DomainGrid.tsx +386 -362
  18. package/eventcatalog/src/components/Grids/MessageGrid.tsx +166 -518
  19. package/eventcatalog/src/components/Header.astro +48 -23
  20. package/eventcatalog/src/components/Lists/VersionList.astro +2 -2
  21. package/eventcatalog/src/components/MDX/Design/Design.astro +4 -1
  22. package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -1
  23. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +3 -3
  24. package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +8 -2
  25. package/eventcatalog/src/components/SchemaExplorer/SchemaPageViewer.tsx +37 -0
  26. package/eventcatalog/src/components/Search/Search.astro +48 -28
  27. package/eventcatalog/src/components/Search/SearchModal.tsx +393 -702
  28. package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +298 -0
  29. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/container.ts +66 -0
  30. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/domain.ts +101 -0
  31. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/flow.ts +29 -0
  32. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/message.ts +84 -0
  33. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/service.ts +147 -0
  34. package/eventcatalog/src/components/SideNav/NestedSideBar/builders/shared.ts +146 -0
  35. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +1073 -0
  36. package/eventcatalog/src/components/SideNav/NestedSideBar/sidebar-builder.ts +365 -0
  37. package/eventcatalog/src/components/SideNav/NestedSideBar/storage.ts +90 -0
  38. package/eventcatalog/src/components/SideNav/SideNav.astro +18 -28
  39. package/eventcatalog/src/content.config.ts +2 -0
  40. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +10 -4
  41. package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +3 -3
  42. package/eventcatalog/src/layouts/DirectoryLayout.astro +2 -2
  43. package/eventcatalog/src/layouts/DiscoverLayout.astro +3 -3
  44. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +85 -63
  45. package/eventcatalog/src/layouts/VisualiserLayout.astro +3 -3
  46. package/eventcatalog/src/pages/_index.astro +530 -110
  47. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/_index.data.ts +64 -0
  48. package/eventcatalog/src/pages/architecture/[type]/[id]/[version]/index.astro +29 -0
  49. package/eventcatalog/src/pages/directory/[type]/_index.data.ts +4 -4
  50. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/_index.data.ts +1 -4
  51. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/_index.data.ts +3 -3
  52. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +1 -5
  53. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +362 -190
  54. package/eventcatalog/src/pages/docs/[type]/[id]/[version].md.ts +1 -1
  55. package/eventcatalog/src/pages/docs/[type]/[id]/index.astro +4 -4
  56. package/eventcatalog/src/pages/docs/[type]/[id]/language/_index.data.ts +1 -4
  57. package/eventcatalog/src/pages/docs/[type]/[id]/language/index.astro +3 -27
  58. package/eventcatalog/src/pages/docs/teams/[id]/_index.data.ts +2 -2
  59. package/eventcatalog/src/pages/docs/users/[id]/_index.data.ts +2 -2
  60. package/eventcatalog/src/pages/index.astro +14 -5
  61. package/eventcatalog/src/pages/nav-index.json.ts +30 -0
  62. package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/_index.data.ts +77 -0
  63. package/eventcatalog/src/pages/schemas/[type]/[id]/[version]/index.astro +90 -0
  64. package/eventcatalog/src/pages/schemas/{index.astro → explorer/index.astro} +3 -3
  65. package/eventcatalog/src/pages/studio.astro +3 -3
  66. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +4 -3
  67. package/eventcatalog/src/pages/visualiser/[type]/[id]/index.astro +2 -2
  68. package/eventcatalog/src/pages/visualiser/domains/[id]/[version]/entity-map/_index.data.ts +4 -3
  69. package/eventcatalog/src/stores/favorites-store.ts +83 -0
  70. package/eventcatalog/src/stores/sidebar-store.ts +8 -0
  71. package/eventcatalog/src/utils/collections/changelogs.ts +7 -4
  72. package/eventcatalog/src/utils/{channels.ts → collections/channels.ts} +81 -31
  73. package/eventcatalog/src/utils/collections/commands.ts +134 -0
  74. package/eventcatalog/src/utils/collections/containers.ts +44 -33
  75. package/eventcatalog/src/utils/collections/domains.ts +204 -62
  76. package/eventcatalog/src/utils/{entities.ts → collections/entities.ts} +44 -24
  77. package/eventcatalog/src/utils/collections/events.ts +136 -0
  78. package/eventcatalog/src/utils/collections/flows.ts +59 -25
  79. package/eventcatalog/src/utils/{messages.ts → collections/messages.ts} +13 -4
  80. package/eventcatalog/src/utils/{queries.ts → collections/queries.ts} +49 -28
  81. package/eventcatalog/src/utils/collections/services.ts +100 -68
  82. package/eventcatalog/src/utils/collections/teams.ts +94 -0
  83. package/eventcatalog/src/utils/collections/users.ts +122 -0
  84. package/eventcatalog/src/utils/collections/util.ts +57 -1
  85. package/eventcatalog/src/utils/feature.ts +3 -1
  86. package/eventcatalog/src/utils/{collections/file-diffs.ts → file-diffs.ts} +1 -1
  87. package/eventcatalog/src/utils/node-graphs/container-node-graph.ts +2 -0
  88. package/eventcatalog/src/utils/node-graphs/domain-entity-map.ts +16 -6
  89. package/eventcatalog/src/utils/node-graphs/domains-canvas.ts +14 -10
  90. package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +36 -64
  91. package/eventcatalog/src/utils/node-graphs/flows-node-graph.ts +23 -19
  92. package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +36 -49
  93. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +22 -18
  94. package/eventcatalog/src/utils/page-loaders/page-data-loader.ts +4 -4
  95. package/eventcatalog/tailwind.config.mjs +14 -0
  96. package/eventcatalog/tsconfig.json +2 -1
  97. package/package.json +7 -4
  98. package/eventcatalog/public/logo_old.png +0 -0
  99. package/eventcatalog/src/components/DiscoverInsight.astro +0 -61
  100. package/eventcatalog/src/components/Grids/ServiceGrid.tsx +0 -534
  101. package/eventcatalog/src/components/Lists/CustomSideBarSectionList.astro +0 -55
  102. package/eventcatalog/src/components/Lists/ProtocolList.tsx +0 -74
  103. package/eventcatalog/src/components/Lists/RepositoryList.astro +0 -37
  104. package/eventcatalog/src/components/Lists/SpecificationsList.astro +0 -67
  105. package/eventcatalog/src/components/SideBars/ChannelSideBar.astro +0 -204
  106. package/eventcatalog/src/components/SideBars/ContainerSideBar.astro +0 -180
  107. package/eventcatalog/src/components/SideBars/DomainSideBar.astro +0 -273
  108. package/eventcatalog/src/components/SideBars/EntitySideBar.astro +0 -139
  109. package/eventcatalog/src/components/SideBars/FlowSideBar.astro +0 -128
  110. package/eventcatalog/src/components/SideBars/MessageSideBar.astro +0 -248
  111. package/eventcatalog/src/components/SideBars/ServiceSideBar.astro +0 -294
  112. package/eventcatalog/src/components/SideNav/ListViewSideBar/components/CollapsibleGroup.tsx +0 -46
  113. package/eventcatalog/src/components/SideNav/ListViewSideBar/components/MessageList.tsx +0 -78
  114. package/eventcatalog/src/components/SideNav/ListViewSideBar/components/SpecificationList.tsx +0 -83
  115. package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +0 -1250
  116. package/eventcatalog/src/components/SideNav/ListViewSideBar/types.ts +0 -91
  117. package/eventcatalog/src/components/SideNav/ListViewSideBar/utils.ts +0 -201
  118. package/eventcatalog/src/components/SideNav/TreeView/getTreeView.ts +0 -190
  119. package/eventcatalog/src/components/SideNav/TreeView/index.tsx +0 -94
  120. package/eventcatalog/src/components/TreeView/index.tsx +0 -328
  121. package/eventcatalog/src/components/TreeView/styles.module.css +0 -264
  122. package/eventcatalog/src/components/TreeView/useSlots.ts +0 -95
  123. package/eventcatalog/src/pages/architecture/[type]/index.astro +0 -14
  124. package/eventcatalog/src/pages/architecture/architecture.astro +0 -101
  125. package/eventcatalog/src/pages/architecture/docs/[type]/index.astro +0 -14
  126. package/eventcatalog/src/utils/commands.ts +0 -112
  127. package/eventcatalog/src/utils/events.ts +0 -108
  128. package/eventcatalog/src/utils/generators/index.ts +0 -10
  129. package/eventcatalog/src/utils/teams.ts +0 -72
  130. package/eventcatalog/src/utils/users.ts +0 -72
@@ -29,25 +29,40 @@ import '@fontsource/inter';
29
29
  import '@fontsource/inter/400.css'; // Specify weight
30
30
  import '@fontsource/inter/700.css'; // Specify weight
31
31
 
32
- import { getCommands } from '@utils/commands';
32
+ import { ClientRouter } from 'astro:transitions';
33
+
34
+ import { getCommands } from '@utils/collections/commands';
33
35
  import { getDomains } from '@utils/collections/domains';
34
- import { getEvents } from '@utils/events';
36
+ import { getEvents } from '@utils/collections/events';
35
37
  import { getServices } from '@utils/collections/services';
36
38
  import { getFlows } from '@utils/collections/flows';
37
39
  import { isCollectionVisibleInCatalog } from '@eventcatalog';
38
40
  import { buildUrl } from '@utils/url-builder';
39
- import { getQueries } from '@utils/queries';
41
+ import { getQueries } from '@utils/collections/queries';
40
42
  import { hasLandingPageForDocs } from '@utils/pages';
41
43
 
42
- const events = await getEvents({ getAllVersions: false });
43
- const commands = await getCommands({ getAllVersions: false });
44
- const queries = await getQueries({ getAllVersions: false });
45
- const services = await getServices({ getAllVersions: false });
46
- const domains = await getDomains({ getAllVersions: false });
47
- const flows = await getFlows({ getAllVersions: false });
44
+ const catalogHasDefaultLandingPageForDocs = await hasLandingPageForDocs();
48
45
  const customDocs = await getCollection('customPages');
49
46
 
50
- import { isEventCatalogUpgradeEnabled } from '@utils/feature';
47
+ let events: any[] = [];
48
+ let commands: any[] = [];
49
+ let queries: any[] = [];
50
+ let services: any[] = [];
51
+ let domains: any[] = [];
52
+ let flows: any[] = [];
53
+
54
+ if (!catalogHasDefaultLandingPageForDocs) {
55
+ [events, commands, queries, services, domains, flows] = await Promise.all([
56
+ getEvents({ getAllVersions: false, hydrateServices: false }),
57
+ getCommands({ getAllVersions: false, hydrateServices: false }),
58
+ getQueries({ getAllVersions: false, hydrateServices: false }),
59
+ getServices({ getAllVersions: false }),
60
+ getDomains({ getAllVersions: false }),
61
+ getFlows({ getAllVersions: false }),
62
+ ]);
63
+ }
64
+
65
+ import { isEventCatalogUpgradeEnabled, isVisualiserEnabled } from '@utils/feature';
51
66
 
52
67
  // Try and load any custom styles if they exist
53
68
  try {
@@ -56,8 +71,6 @@ try {
56
71
 
57
72
  const currentPath = Astro.url.pathname;
58
73
 
59
- const catalogHasDefaultLandingPageForDocs = await hasLandingPageForDocs();
60
-
61
74
  const getDefaultUrl = (route: string, defaultValue: string) => {
62
75
  if (route === 'docs/custom') {
63
76
  return customDocs.length > 0 ? buildUrl(`/${route}/${customDocs[0].id.replace('docs', '')}`) : buildUrl(defaultValue);
@@ -88,33 +101,22 @@ const getDefaultUrl = (route: string, defaultValue: string) => {
88
101
  };
89
102
 
90
103
  const userSideBarConfiguration = config.sidebar || [];
104
+
91
105
  const navigationItems = [
92
106
  {
93
107
  id: '/',
94
108
  label: 'Home',
95
109
  icon: House,
96
- href: buildUrl('/'),
97
- current: currentPath === '/',
98
- sidebar: false,
99
- },
100
- {
101
- id: '/docs',
102
- label: 'Architecture Documentation',
103
- icon: BookOpenText,
104
- href: catalogHasDefaultLandingPageForDocs ? buildUrl('/docs') : getDefaultUrl('docs', '/docs'),
110
+ href: buildUrl(config.landingPage || '/'),
105
111
  current:
106
- (currentPath.includes('/docs') && !currentPath.includes('/docs/custom')) || currentPath.includes('/architecture/docs/'),
107
- sidebar: true,
108
- },
109
- {
110
- id: '/visualiser',
111
- label: 'Visualiser',
112
- icon: Workflow,
113
- href: getDefaultUrl('visualiser', '/visualiser'),
114
- current: currentPath.includes('/visualiser'),
112
+ currentPath === '/' ||
113
+ (currentPath.includes('/docs') && !currentPath.includes('/docs/custom')) ||
114
+ currentPath.includes('/architecture/') ||
115
+ currentPath.includes('/visualiser') ||
116
+ (currentPath.includes('/schemas') && !currentPath.includes('/schemas/explorer')),
115
117
  sidebar: true,
118
+ hidden: false,
116
119
  },
117
-
118
120
  {
119
121
  id: '/discover',
120
122
  label: 'Explore',
@@ -127,8 +129,15 @@ const navigationItems = [
127
129
  id: '/schemas',
128
130
  label: 'Schema Explorer',
129
131
  icon: FileJson,
130
- href: buildUrl('/schemas'),
131
- current: currentPath.includes('/schemas'),
132
+ sidebar: true,
133
+ hidden: true,
134
+ },
135
+ {
136
+ id: '/schemas/explorer',
137
+ label: 'Schema Explorer',
138
+ icon: FileJson,
139
+ href: buildUrl('/schemas/explorer'),
140
+ current: currentPath.includes('/schemas/explorer'),
132
141
  sidebar: false,
133
142
  },
134
143
  {
@@ -145,7 +154,7 @@ const navigationItems = [
145
154
  icon: BookUser,
146
155
  href: buildUrl('/architecture/domains'),
147
156
  current: currentPath.includes('/architecture/'),
148
- sidebar: false,
157
+ sidebar: true,
149
158
  hidden: true,
150
159
  },
151
160
  ].filter((item) => {
@@ -256,7 +265,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
256
265
  <div class="flex">
257
266
  <aside class="flex" id="eventcatalog-vertical-nav">
258
267
  <div
259
- class="fixed flex flex-col items-center w-16 h-screen py-4 bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 z-20 shadow-md justify-between"
268
+ class="fixed flex flex-col items-center w-14 h-screen py-3 bg-white bg-gradient-to-b from-white to-gray-100 border-r border-gray-200 z-20 shadow-md justify-between"
260
269
  >
261
270
  <nav class="flex flex-col h-[calc(100vh-70px)] justify-between">
262
271
  <div class="flex flex-col items-center flex-1 space-y-6">
@@ -358,11 +367,11 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
358
367
 
359
368
  <SideNav
360
369
  id="sidebar"
361
- class={`sidebar-transition h-content overflow-y-auto bg-white border-r border-gray-100 w-[22em] ml-16 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
370
+ class={`sidebar-transition h-content bg-white border-r border-gray-100 w-[320px] ml-14 ${showSideBarOnLoad ? 'block' : 'hidden'}`}
362
371
  />
363
372
  </aside>
364
373
  <main
365
- class={`sidebar-transition w-full max-h-content overflow-y-auto ${showSideBarOnLoad ? 'ml-0' : 'ml-16'}`}
374
+ class={`sidebar-transition w-full max-h-content overflow-y-auto ${showSideBarOnLoad ? 'ml-0' : 'ml-14'}`}
366
375
  id="content"
367
376
  >
368
377
  <slot />
@@ -386,6 +395,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
386
395
  </div>
387
396
  </body>
388
397
  </html>
398
+ <ClientRouter />
389
399
  <script define:vars={{ navigationItems, currentNavigationItem, showSideBarOnLoad, canPageBeEmbedded }}>
390
400
  // Listen for Astro transititions
391
401
  document.addEventListener('astro:page-load', () => {
@@ -426,47 +436,59 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
426
436
  if (element) element.style.display = 'none';
427
437
  });
428
438
 
429
- content.classList.remove('ml-16');
439
+ content.classList.remove('ml-14');
430
440
  return;
431
441
  }
432
442
 
433
443
  const sidebar = document.getElementById('sidebar');
434
- const currentPath = window.location.href;
444
+ const currentPath = window.location.pathname;
445
+
446
+ // Determine if we should show the sidebar based on current path
447
+ let shouldShowSidebar = false;
448
+
449
+ // Check each navigation item to see if it matches current path and has sidebar enabled
450
+ for (const item of navigationItems) {
451
+ if (!item.sidebar) continue; // Skip items that don't have sidebar
452
+
453
+ if (item.id === '/') {
454
+ // Home route - show sidebar for home, docs, architecture, visualiser, schemas (not explorer)
455
+ if (
456
+ currentPath === '/' ||
457
+ (currentPath.includes('/docs') && !currentPath.includes('/docs/custom')) ||
458
+ currentPath.includes('/architecture/') ||
459
+ currentPath.includes('/visualiser') ||
460
+ (currentPath.includes('/schemas') && !currentPath.includes('/schemas/explorer'))
461
+ ) {
462
+ shouldShowSidebar = true;
463
+ break;
464
+ }
465
+ } else if (currentPath.includes(item.id)) {
466
+ // Other routes - simple match
467
+ shouldShowSidebar = true;
468
+ break;
469
+ }
470
+ }
435
471
 
436
- // Hide the sidebar if the current navigation item is not a sidebar item
437
- if (!currentNavigationItem?.sidebar) {
472
+ // Show or hide sidebar based on result
473
+ if (shouldShowSidebar) {
474
+ sidebar.style.display = 'block';
475
+ content.classList.remove('ml-14');
476
+ } else {
438
477
  sidebar.style.display = 'none';
439
478
  content.style.width = '100%';
440
- content.classList.add('ml-16');
441
- } else {
442
- sidebar.style.display = 'block';
479
+ content.classList.add('ml-14');
443
480
  }
444
481
 
445
482
  const navItems = document.querySelectorAll('[data-role="nav-item"]');
446
- let isOpen = showSideBarOnLoad;
447
483
 
484
+ // Navigation items simply navigate to their href - no toggle logic
448
485
  navItems.forEach((item) => {
449
486
  item.addEventListener('click', (e) => {
450
- const currentPath = window.location.href;
451
487
  const id = item.getAttribute('id');
452
-
453
488
  const navItem = navigationItems.find((navItem) => navItem.id === id);
454
489
 
455
- if (!navItem.sidebar || !currentPath.includes(navItem.id) || currentPath.includes('/docs/custom')) {
490
+ if (navItem && navItem.href) {
456
491
  window.location.href = navItem.href;
457
- return;
458
- }
459
-
460
- // not on the target page then just go to it.
461
- if (!currentPath.includes(navItem.id)) return;
462
-
463
- if (currentPath.includes(navItem.id)) {
464
- e.preventDefault();
465
- if (isOpen) {
466
- hideSidebar();
467
- } else {
468
- showSidebar();
469
- }
470
492
  }
471
493
  });
472
494
  });
@@ -479,7 +501,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
479
501
  setTimeout(() => {
480
502
  sidebar.style.transform = 'translateX(0)';
481
503
  content.style.transform = 'translateX(0)';
482
- content.classList.remove('ml-16');
504
+ content.classList.remove('ml-14');
483
505
  content.style.width = 'calc(100% - 240px)';
484
506
  }, 10);
485
507
  }
@@ -490,7 +512,7 @@ const canPageBeEmbedded = process.env.ENABLE_EMBED === 'true';
490
512
  sidebar.style.transform = 'translateX(-100%)';
491
513
  content.style.transform = 'translateX(0px)';
492
514
  content.style.width = '100%';
493
- content.classList.add('ml-16');
515
+ content.classList.add('ml-14');
494
516
  }
495
517
 
496
518
  if (sidebar) {
@@ -1,9 +1,9 @@
1
1
  ---
2
- import { getCommands } from '@utils/commands';
2
+ import { getCommands } from '@utils/collections/commands';
3
3
  import { getDomains } from '@utils/collections/domains';
4
- import { getEvents } from '@utils/events';
4
+ import { getEvents } from '@utils/collections/events';
5
5
  import { getFlows } from '@utils/collections/flows';
6
- import { getQueries } from '@utils/queries';
6
+ import { getQueries } from '@utils/collections/queries';
7
7
  import { getServices } from '@utils/collections/services';
8
8
  import VerticalSideBarLayout from './VerticalSideBarLayout.astro';
9
9