@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
@@ -23,20 +23,27 @@ const repositoryUrl = catalog?.repositoryUrl || 'https://github.com/event-catalo
23
23
 
24
24
  <nav
25
25
  id="eventcatalog-header"
26
- class="fixed top-0 left-0 right-0 h-header bg-white border-b border-gray-100 py-3 font-bold text-xl bg-opacity-20 backdrop-blur-sm z-10"
26
+ class="fixed top-0 left-0 right-0 h-header bg-white/95 border-b border-gray-200 py-3 font-bold text-xl backdrop-blur-md z-10"
27
27
  >
28
28
  <div class="px-4 sm:px-4 lg:px-4">
29
29
  <div class="flex justify-between items-center">
30
30
  <div class="flex-shrink-0 flex items-center w-3/12">
31
- <a href={buildUrl(catalog.landingPage || '/')} class="flex space-x-2 items-center">
32
- {logo.src && <img alt={logo.alt} src={buildUrl(logo.src, true)} class="w-8 h-8" />}
33
- {logo.text && <span class="hidden sm:inline-block text-[1em]">{logo.text}</span>}
31
+ <a href={buildUrl(catalog.landingPage || '/')} class="flex space-x-2 items-center group">
32
+ {
33
+ logo.src && (
34
+ <img alt={logo.alt} src={buildUrl(logo.src, true)} class="w-8 h-8 transition-transform group-hover:scale-105" />
35
+ )
36
+ }
37
+ {
38
+ logo.text && (
39
+ <span class="hidden sm:inline-block text-[1em] transition-colors group-hover:text-gray-600">{logo.text}</span>
40
+ )
41
+ }
34
42
  </a>
35
43
  </div>
36
44
 
37
45
  <div class="hidden lg:block flex-grow w-6/12 px-10">
38
- <!-- Page find only works on static builds, disable for SSR builds for now -->
39
- {!isSSR() && <Search />}
46
+ <Search />
40
47
  </div>
41
48
 
42
49
  <div class="hidden md:block w-3/12">
@@ -50,7 +57,7 @@ const repositoryUrl = catalog?.repositoryUrl || 'https://github.com/event-catalo
50
57
  <button
51
58
  id="profile-menu-button"
52
59
  type="button"
53
- class="flex items-center focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded-full"
60
+ class="flex items-center focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-400 rounded-full"
54
61
  aria-expanded="false"
55
62
  aria-haspopup="true"
56
63
  >
@@ -58,10 +65,10 @@ const repositoryUrl = catalog?.repositoryUrl || 'https://github.com/event-catalo
58
65
  <img
59
66
  src={session.user.image}
60
67
  alt={session.user?.name || 'User'}
61
- class="h-8 w-8 rounded-full border-2 border-gray-200 hover:border-gray-300 transition-colors"
68
+ class="h-9 w-9 rounded-full border-2 border-gray-200 hover:border-gray-400 transition-all shadow-sm"
62
69
  />
63
70
  ) : (
64
- <div class="h-8 w-8 rounded-full border-2 border-gray-200 hover:border-gray-300 transition-colors bg-gray-100 flex items-center justify-center text-sm font-medium text-gray-600">
71
+ <div class="h-9 w-9 rounded-full border-2 border-gray-200 hover:border-gray-400 transition-all bg-gray-100 hover:bg-gray-200 flex items-center justify-center text-sm font-medium text-gray-600 shadow-sm">
65
72
  {session.user?.name
66
73
  ? session.user.name
67
74
  .split(' ')
@@ -75,15 +82,15 @@ const repositoryUrl = catalog?.repositoryUrl || 'https://github.com/event-catalo
75
82
  </button>
76
83
  <div
77
84
  id="profile-dropdown"
78
- class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 border border-gray-100 overflow-hidden"
85
+ class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-md py-1 z-50 border-2 border-gray-200 overflow-hidden"
79
86
  >
80
- <div class="px-4 py-2 text-sm text-gray-700 border-b border-gray-100">
81
- <div class="font-medium">{session.user?.name || 'User'}</div>
82
- {session.user?.email && <div class="text-gray-500">{session.user.email}</div>}
87
+ <div class="px-4 py-2 text-sm text-gray-700 border-b border-gray-200">
88
+ <div class="font-semibold">{session.user?.name || 'User'}</div>
89
+ {session.user?.email && <div class="text-gray-500 text-xs mt-0.5">{session.user.email}</div>}
83
90
  </div>
84
91
  <button
85
92
  id="signout-btn"
86
- class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition-colors"
93
+ class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors font-medium"
87
94
  >
88
95
  Sign out
89
96
  </button>
@@ -99,30 +106,48 @@ const repositoryUrl = catalog?.repositoryUrl || 'https://github.com/event-catalo
99
106
  {isAuthEnabled() && (
100
107
  <button
101
108
  id="okta-signin-btn"
102
- class="bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium px-4 py-2 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
109
+ class="bg-gray-900 hover:bg-gray-800 text-white text-sm font-medium px-4 py-2 rounded-lg transition-all shadow-sm hover:shadow focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
103
110
  >
104
111
  Sign In
105
112
  </button>
106
113
  )}
107
114
  {showEventCatalogBranding() && (
108
- <ul class="flex space-x-8">
115
+ <ul class="flex space-x-4">
109
116
  <li>
110
- <a href="https://discord.com/invite/3rjaZMmrAm">
111
- <img src={buildUrl('/icons/discord.svg', true)} class="h-7 w-7" />
117
+ <a
118
+ href="https://discord.com/invite/3rjaZMmrAm"
119
+ class="block p-1.5 rounded-lg hover:bg-gray-100 transition-colors"
120
+ >
121
+ <img
122
+ src={buildUrl('/icons/discord.svg', true)}
123
+ class="h-6 w-6 opacity-70 hover:opacity-100 transition-opacity"
124
+ />
112
125
  </a>
113
126
  </li>
114
127
  <li>
115
- <a href="https://github.com/event-catalog/eventcatalog">
116
- <img src={buildUrl('/icons/github.svg', true)} class="h-7 w-7" />
128
+ <a
129
+ href="https://github.com/event-catalog/eventcatalog"
130
+ class="block p-1.5 rounded-lg hover:bg-gray-100 transition-colors"
131
+ >
132
+ <img
133
+ src={buildUrl('/icons/github.svg', true)}
134
+ class="h-6 w-6 opacity-70 hover:opacity-100 transition-opacity"
135
+ />
117
136
  </a>
118
137
  </li>
119
138
  </ul>
120
139
  )}
121
140
  {showCustomBranding() && !showEventCatalogBranding() && (
122
- <ul class="flex space-x-8">
141
+ <ul class="flex space-x-4">
123
142
  <li>
124
- <a href={repositoryUrl} class="text-gray-500 hover:text-gray-600 focus:outline-none focus:text-gray-600">
125
- <img src={buildUrl('/icons/github.svg', true)} class="h-7 w-7" />
143
+ <a
144
+ href={repositoryUrl}
145
+ class="block p-1.5 rounded-lg hover:bg-gray-100 transition-colors focus:outline-none"
146
+ >
147
+ <img
148
+ src={buildUrl('/icons/github.svg', true)}
149
+ class="h-6 w-6 opacity-70 hover:opacity-100 transition-opacity"
150
+ />
126
151
  </a>
127
152
  </li>
128
153
  </ul>
@@ -15,7 +15,7 @@ const currentPath = Astro.url.pathname;
15
15
  ---
16
16
 
17
17
  <div class="space-y-2 pb-4">
18
- <span class="text-sm text-black font-semibold group-data-[hover]:text-black/80 capitalize">
18
+ <span class="text-xs text-black font-semibold group-data-[hover]:text-black/80 capitalize">
19
19
  {title || `Versions (${collectionItem.data.versions?.length})`}
20
20
  </span>
21
21
  <ul role="list" class="space-y-2">
@@ -30,7 +30,7 @@ const currentPath = Astro.url.pathname;
30
30
  >
31
31
  {/* {Icon && <Icon class={`h-4 w-4`} />} */}
32
32
  <HistoryIcon className="h-4 w-4 text-gray-800 group-hover:text-white" strokeWidth={1} />
33
- <span class={`font-light text-sm ${isCurrent ? 'underline ' : ''}`}>
33
+ <span class={`font-light text-xs ${isCurrent ? 'underline ' : ''}`}>
34
34
  {version === collectionItem.data.latestVersion ? `v${version} (latest)` : `v${version}`}
35
35
  </span>
36
36
  </a>
@@ -5,6 +5,8 @@ import { getAbsoluteFilePathForAstroFile } from '@utils/files';
5
5
  import Admonition from '@components/MDX/Admonition';
6
6
  import NodeGraph from '../NodeGraph/NodeGraph';
7
7
 
8
+ import { isVisualiserEnabled } from '@utils/feature';
9
+
8
10
  let design: any;
9
11
  let id = 'design';
10
12
  let maxHeight = 30;
@@ -49,7 +51,8 @@ try {
49
51
  title={title ?? design.name}
50
52
  nodes={design.nodes || []}
51
53
  edges={design.edges || []}
52
- hrefLabel={'View in visualizer'}
54
+ hrefLabel={isVisualiserEnabled() ? 'View in visualizer' : undefined}
55
+ href={isVisualiserEnabled() ? `/visualiser/designs/${design.id}` : undefined}
53
56
  linkTo={'visualiser'}
54
57
  designId={design.id || id}
55
58
  client:only="react"
@@ -4,6 +4,7 @@ import { getNodesAndEdges } from '@utils/node-graphs/flows-node-graph';
4
4
  import Admonition from '@components/MDX/Admonition';
5
5
  import NodeGraph from '../NodeGraph/NodeGraph';
6
6
  import { getVersionFromCollection } from '@utils/collections/versions';
7
+ import { isVisualiserEnabled } from '@utils/feature';
7
8
 
8
9
  const { id, version = 'latest', maxHeight, includeKey = true, mode = 'simple', walkthrough = true, search = true } = Astro.props;
9
10
 
@@ -49,7 +50,7 @@ const { nodes, edges } = await getNodesAndEdges({
49
50
  nodes={nodes}
50
51
  edges={edges}
51
52
  hrefLabel={'View in visualizer'}
52
- href={`/visualiser/flows/${id}/${version}`}
53
+ href={isVisualiserEnabled() ? `/visualiser/flows/${id}/${version}` : undefined}
53
54
  linkTo={'visualiser'}
54
55
  includeKey={includeKey}
55
56
  footerLabel=`Flow diagram - ${flow.data.name} - v(${flow.data.version})`
@@ -26,7 +26,7 @@ interface Props {
26
26
  version: string;
27
27
  mode: 'full' | 'simple';
28
28
  linkTo?: 'docs' | 'visualiser';
29
- href: {
29
+ href?: {
30
30
  label: string;
31
31
  url: string;
32
32
  };
@@ -142,8 +142,8 @@ if (collection === 'services-containers') {
142
142
  nodes={nodes}
143
143
  edges={edges}
144
144
  title={title}
145
- hrefLabel={href.label}
146
- href={href.url}
145
+ hrefLabel={href?.label}
146
+ href={href?.url}
147
147
  linkTo={linkTo}
148
148
  client:only="react"
149
149
  linksToVisualiser={linksToVisualiser}
@@ -20,6 +20,8 @@ interface SchemaDetailsPanelProps {
20
20
  selectedVersion: string | null;
21
21
  onVersionChange: (version: string) => void;
22
22
  apiAccessEnabled?: boolean;
23
+ showOwners?: boolean;
24
+ showProducersConsumers?: boolean;
23
25
  }
24
26
 
25
27
  export default function SchemaDetailsPanel({
@@ -28,6 +30,8 @@ export default function SchemaDetailsPanel({
28
30
  selectedVersion,
29
31
  onVersionChange,
30
32
  apiAccessEnabled = false,
33
+ showOwners = true,
34
+ showProducersConsumers = true,
31
35
  }: SchemaDetailsPanelProps) {
32
36
  const [copiedId, setCopiedId] = useState<string | null>(null);
33
37
  const [schemaViewMode, setSchemaViewMode] = useState<'code' | 'schema' | 'diff'>('code');
@@ -167,7 +171,7 @@ export default function SchemaDetailsPanel({
167
171
  />
168
172
 
169
173
  {/* Producers and Consumers Section - Only show for messages (not services) */}
170
- {message.collection !== 'services' && (
174
+ {message.collection !== 'services' && showProducersConsumers && (
171
175
  <ProducersConsumersSection
172
176
  message={message}
173
177
  isExpanded={producersConsumersExpanded}
@@ -176,7 +180,9 @@ export default function SchemaDetailsPanel({
176
180
  )}
177
181
 
178
182
  {/* Owners Section */}
179
- <OwnersSection message={message} isExpanded={ownersExpanded} onToggle={() => setOwnersExpanded(!ownersExpanded)} />
183
+ {showOwners && (
184
+ <OwnersSection message={message} isExpanded={ownersExpanded} onToggle={() => setOwnersExpanded(!ownersExpanded)} />
185
+ )}
180
186
 
181
187
  {/* Schema Content - Takes full remaining height */}
182
188
  <div className="flex-1 overflow-hidden">
@@ -0,0 +1,37 @@
1
+ import SchemaDetailsPanel from './SchemaDetailsPanel';
2
+ import type { SchemaItem } from './types';
3
+
4
+ interface SchemaPageViewerProps {
5
+ message: SchemaItem;
6
+ availableVersions: SchemaItem[];
7
+ apiAccessEnabled?: boolean;
8
+ showOwners?: boolean;
9
+ showProducersConsumers?: boolean;
10
+ }
11
+
12
+ export default function SchemaPageViewer({
13
+ message,
14
+ availableVersions,
15
+ apiAccessEnabled = false,
16
+ showOwners = true,
17
+ showProducersConsumers = true,
18
+ }: SchemaPageViewerProps) {
19
+ const handleVersionChange = (version: string) => {
20
+ // Construct new URL
21
+ // URL: /schemas/[collection]/[id]/[version]
22
+ const url = `/schemas/${message.collection}/${message.data.id}/${version}`;
23
+ window.location.href = url;
24
+ };
25
+
26
+ return (
27
+ <SchemaDetailsPanel
28
+ message={message}
29
+ availableVersions={availableVersions}
30
+ selectedVersion={message.data.version}
31
+ onVersionChange={handleVersionChange}
32
+ apiAccessEnabled={apiAccessEnabled}
33
+ showOwners={showOwners}
34
+ showProducersConsumers={showProducersConsumers}
35
+ />
36
+ );
37
+ }
@@ -1,24 +1,8 @@
1
1
  ---
2
2
  import MagnifyingGlassIcon from '@heroicons/react/24/outline/MagnifyingGlassIcon';
3
3
  import SearchModal from './SearchModal.tsx';
4
- import { buildUrl } from '@utils/url-builder.ts';
5
-
6
- const pagefindJsUrl = buildUrl('/pagefind/pagefind.js', true);
7
- const pagefindCssUrl = buildUrl('/pagefind/pagefind-ui.css', true);
8
4
  ---
9
5
 
10
- <link href={pagefindCssUrl} rel="stylesheet" />
11
- <script type="module" define:vars={{ pagefindJsUrl }}>
12
- // Load Pagefind and expose it globally
13
- try {
14
- const pagefind = await import(pagefindJsUrl);
15
- window.pagefind = pagefind;
16
- window.dispatchEvent(new CustomEvent('pagefindLoaded'));
17
- } catch (error) {
18
- console.error('Failed to load pagefind:', error);
19
- }
20
- </script>
21
-
22
6
  <div>
23
7
  <div class="relative flex items-center">
24
8
  <input
@@ -26,6 +10,7 @@ const pagefindCssUrl = buildUrl('/pagefind/pagefind-ui.css', true);
26
10
  type="text"
27
11
  name="search"
28
12
  placeholder="Search EventCatalog"
13
+ autocomplete="off"
29
14
  class="block w-full rounded-md caret-transparent border-0 py-1.5 pr-14 pl-10 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 font-light sm:text-sm sm:leading-6 px-4"
30
15
  />
31
16
  <MagnifyingGlassIcon className="absolute inset-y-0 -left-1 h-9 w-8 flex items-center pl-4 text-gray-400" />
@@ -35,19 +20,32 @@ const pagefindCssUrl = buildUrl('/pagefind/pagefind-ui.css', true);
35
20
  </div>
36
21
  </div>
37
22
 
38
- <SearchModal client:only />
23
+ <SearchModal client:only="react" />
39
24
 
40
25
  <script>
41
26
  // Create a global state for the search modal
42
27
  (window as any).searchModalState = {
43
28
  isOpen: false,
29
+ isClosing: false,
30
+ open: function () {
31
+ if (this.isClosing) return;
32
+ this.isOpen = true;
33
+ this.render();
34
+ },
44
35
  toggle: function () {
36
+ if (this.isClosing) return;
45
37
  this.isOpen = !this.isOpen;
46
38
  this.render();
47
39
  },
48
40
  close: function () {
49
41
  this.isOpen = false;
42
+ this.isClosing = true;
50
43
  this.render();
44
+ // Reset isClosing after a short delay to prevent immediate reopening by focus restoration
45
+ // waiting for transition (200ms) + buffer
46
+ setTimeout(() => {
47
+ this.isClosing = false;
48
+ }, 500);
51
49
  },
52
50
  render: function () {
53
51
  // This will be handled by React component
@@ -58,26 +56,42 @@ const pagefindCssUrl = buildUrl('/pagefind/pagefind-ui.css', true);
58
56
  },
59
57
  };
60
58
 
61
- const dummyInput = document.getElementById('search-dummy-input');
62
- const header = document.getElementById('eventcatalog-header');
63
- const verticalNav = document.getElementById('eventcatalog-vertical-nav');
59
+ // Setup function to initialize event listeners
60
+ function setupSearchListeners() {
61
+ const dummyInput = document.getElementById('search-dummy-input');
62
+
63
+ // Remove existing listeners if any to prevent duplicates
64
+ if (dummyInput) {
65
+ const newInput = dummyInput.cloneNode(true) as HTMLElement;
66
+ dummyInput.parentNode?.replaceChild(newInput, dummyInput);
67
+ const refreshedInput = document.getElementById('search-dummy-input');
68
+
69
+ refreshedInput?.addEventListener('click', function (e) {
70
+ e.preventDefault();
71
+ this.blur();
72
+ (window as any).searchModalState.open();
73
+ });
64
74
 
65
- // Event listeners
75
+ refreshedInput?.addEventListener('focus', function (e) {
76
+ e.preventDefault();
77
+ this.blur();
78
+ (window as any).searchModalState.open();
79
+ });
80
+ }
81
+ }
82
+
83
+ // Setup keyboard shortcut (only needs to be done once)
66
84
  window.addEventListener('keydown', (event) => {
67
85
  if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
68
86
  event.preventDefault();
69
- dummyInput?.click();
87
+ (window as any).searchModalState.open();
70
88
  }
71
89
  });
72
90
 
73
- dummyInput?.addEventListener('click', function (e) {
74
- e.preventDefault();
75
- this.blur();
76
- (window as any).searchModalState.toggle();
77
- });
78
-
79
91
  // Listen for modal state changes to update page elements
80
92
  window.addEventListener('searchModalToggle', (event) => {
93
+ const header = document.getElementById('eventcatalog-header');
94
+ const verticalNav = document.getElementById('eventcatalog-vertical-nav');
81
95
  // Handle custom docs sidebars
82
96
  const customDocsSidebars = document.querySelectorAll('aside[class*="fixed"][class*="z-10"]');
83
97
 
@@ -97,6 +111,12 @@ const pagefindCssUrl = buildUrl('/pagefind/pagefind-ui.css', true);
97
111
  });
98
112
  }
99
113
  });
114
+
115
+ // Setup listeners on initial load
116
+ setupSearchListeners();
117
+
118
+ // Re-setup listeners after client-side navigation
119
+ document.addEventListener('astro:page-load', setupSearchListeners);
100
120
  </script>
101
121
 
102
122
  <style>