@eventcatalog/core 4.0.0-beta.1 → 4.0.0-beta.2

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 (43) hide show
  1. package/bin/eventcatalog.config.d.ts +1 -1
  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-U5OTNDVQ.js → chunk-24K6JJV5.js} +1 -1
  7. package/dist/{chunk-MBVTS76Q.js → chunk-7NOXTLJP.js} +1 -1
  8. package/dist/{chunk-M2ZRT7KQ.js → chunk-FLLYUYF2.js} +1 -1
  9. package/dist/{chunk-JTZT2SDF.js → chunk-IK6AW6IC.js} +1 -1
  10. package/dist/{chunk-TZTPGQGL.js → chunk-JRCXVY3E.js} +1 -1
  11. package/dist/constants.cjs +1 -1
  12. package/dist/constants.js +1 -1
  13. package/dist/eventcatalog.cjs +1 -1
  14. package/dist/eventcatalog.config.d.cts +40 -7
  15. package/dist/eventcatalog.config.d.ts +40 -7
  16. package/dist/eventcatalog.js +5 -5
  17. package/dist/generate.cjs +1 -1
  18. package/dist/generate.js +3 -3
  19. package/dist/utils/cli-logger.cjs +1 -1
  20. package/dist/utils/cli-logger.js +2 -2
  21. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +16 -2
  22. package/eventcatalog/src/components/CopyAsMarkdown.tsx +6 -57
  23. package/eventcatalog/src/enterprise/ai/chat-api.ts +4 -2
  24. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +26 -7
  25. package/eventcatalog/src/enterprise/feature.ts +0 -4
  26. package/eventcatalog/src/enterprise/integrations/eventcatalog-features.ts +0 -9
  27. package/eventcatalog/src/enterprise/tools/catalog-tools.ts +6 -1
  28. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +343 -282
  29. package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +6 -81
  30. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +0 -8
  31. package/eventcatalog/src/stores/sidebar-store/state.ts +4 -4
  32. package/eventcatalog/src/utils/feature.ts +0 -2
  33. package/package.json +3 -3
  34. package/eventcatalog/src/enterprise/print/_message.data.ts +0 -63
  35. package/eventcatalog/src/enterprise/print/components/PrintHeader.astro +0 -183
  36. package/eventcatalog/src/enterprise/print/components/PrintLayout.astro +0 -271
  37. package/eventcatalog/src/enterprise/print/components/PrintParticipantsTable.astro +0 -64
  38. package/eventcatalog/src/enterprise/print/components/PrintSchemaPropertiesTable.astro +0 -65
  39. package/eventcatalog/src/enterprise/print/components/PrintSchemaViewer.tsx +0 -55
  40. package/eventcatalog/src/enterprise/print/components/PrintSection.astro +0 -17
  41. package/eventcatalog/src/enterprise/print/message.astro +0 -353
  42. package/eventcatalog/src/enterprise/print/utils.ts +0 -58
  43. package/eventcatalog/src/utils/sidebar-visibility.ts +0 -41
@@ -1,271 +0,0 @@
1
- ---
2
- interface Props {
3
- title: string;
4
- stamp?: 'draft' | 'deprecated';
5
- }
6
-
7
- const { title, stamp } = Astro.props;
8
- ---
9
-
10
- <html lang="en" data-theme="light">
11
- <head>
12
- <meta charset="utf-8" />
13
- <meta name="viewport" content="width=device-width, initial-scale=1" />
14
- <title>{title}</title>
15
- <style is:global>
16
- @import '../../../styles/tailwind.css';
17
-
18
- @media print {
19
- body {
20
- font-size: 11pt;
21
- background: #fff;
22
- -webkit-print-color-adjust: exact;
23
- print-color-adjust: exact;
24
- }
25
-
26
- .no-print {
27
- display: none !important;
28
- }
29
-
30
- /* Expand code blocks fully for print, use smaller font to fit */
31
- pre,
32
- code,
33
- .schema-viewer {
34
- max-height: none !important;
35
- overflow: visible !important;
36
- font-size: 0.65rem !important;
37
- }
38
- }
39
-
40
- /* Toggle switch – no Tailwind equivalent */
41
- .print-toggle {
42
- position: relative;
43
- width: 36px;
44
- height: 20px;
45
- appearance: none;
46
- -webkit-appearance: none;
47
- background: #cbd5e1;
48
- border-radius: 10px;
49
- outline: none;
50
- cursor: pointer;
51
- transition: background 0.2s;
52
- flex-shrink: 0;
53
- }
54
- .print-toggle:checked {
55
- background: #0f172a;
56
- }
57
- .print-toggle::before {
58
- content: '';
59
- position: absolute;
60
- top: 2px;
61
- left: 2px;
62
- width: 16px;
63
- height: 16px;
64
- background: #fff;
65
- border-radius: 50%;
66
- transition: transform 0.2s;
67
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
68
- }
69
- .print-toggle:checked::before {
70
- transform: translateX(16px);
71
- }
72
-
73
- /* Stamp watermark */
74
- .stamp-watermark {
75
- font-size: 7rem;
76
- font-weight: 900;
77
- letter-spacing: 0.15em;
78
- transform: rotate(-28deg);
79
- border: 0.45rem solid;
80
- border-radius: 1.25rem;
81
- padding: 0.5rem 2.5rem;
82
- white-space: nowrap;
83
- user-select: none;
84
- }
85
- .stamp-draft {
86
- color: rgba(217, 119, 6, 0.06);
87
- border-color: rgba(217, 119, 6, 0.06);
88
- }
89
- .stamp-deprecated {
90
- font-size: 4.5rem;
91
- color: rgba(220, 38, 38, 0.06);
92
- border-color: rgba(220, 38, 38, 0.06);
93
- }
94
-
95
- /* Section title decorative line */
96
- .print-section-title::after {
97
- content: '';
98
- flex: 1;
99
- height: 1px;
100
- background: #e2e8f0;
101
- }
102
-
103
- /* Settings panel visibility */
104
- .print-settings-panel {
105
- display: none;
106
- }
107
- .print-settings-panel.open {
108
- display: block;
109
- }
110
- </style>
111
- </head>
112
- <body class="bg-slate-50 text-slate-800 font-sans leading-relaxed print:bg-white">
113
- <!-- Settings (top-left) -->
114
- <div class="no-print fixed top-5 left-5 z-50">
115
- <button
116
- id="settings-toggle"
117
- class="inline-flex items-center gap-2 px-3 py-2.5 bg-white text-slate-700 border border-slate-200 rounded-lg text-sm font-semibold cursor-pointer shadow-sm hover:bg-slate-50 hover:shadow-md transition-all"
118
- >
119
- <svg
120
- xmlns="http://www.w3.org/2000/svg"
121
- width="15"
122
- height="15"
123
- viewBox="0 0 24 24"
124
- fill="none"
125
- stroke="currentColor"
126
- stroke-width="2"
127
- stroke-linecap="round"
128
- stroke-linejoin="round"
129
- >
130
- <path
131
- d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
132
- ></path>
133
- <circle cx="12" cy="12" r="3"></circle>
134
- </svg>
135
- Settings
136
- </button>
137
- <div
138
- class="print-settings-panel absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-xl shadow-lg py-3 min-w-[240px]"
139
- id="settings-panel"
140
- >
141
- <div
142
- class="px-4 pb-2.5 text-[0.6875rem] font-bold uppercase tracking-wider text-slate-400 border-b border-slate-100 mb-1"
143
- >
144
- Show / Hide sections
145
- </div>
146
- <div class="flex items-center justify-between px-4 py-2 cursor-pointer hover:bg-slate-50">
147
- <label for="toggle-producers-consumers" class="text-sm font-medium text-slate-700 cursor-pointer select-none"
148
- >Producers &amp; Consumers</label
149
- >
150
- <input type="checkbox" class="print-toggle" id="toggle-producers-consumers" checked />
151
- </div>
152
- <div class="flex items-center justify-between px-4 py-2 cursor-pointer hover:bg-slate-50">
153
- <label for="toggle-versions" class="text-sm font-medium text-slate-700 cursor-pointer select-none"
154
- >Version History</label
155
- >
156
- <input type="checkbox" class="print-toggle" id="toggle-versions" checked />
157
- </div>
158
- <div class="flex items-center justify-between px-4 py-2 cursor-pointer hover:bg-slate-50">
159
- <label for="toggle-documentation" class="text-sm font-medium text-slate-700 cursor-pointer select-none"
160
- >Documentation</label
161
- >
162
- <input type="checkbox" class="print-toggle" id="toggle-documentation" />
163
- </div>
164
- <div class="flex items-center justify-between px-4 py-2 cursor-pointer hover:bg-slate-50">
165
- <label for="toggle-schema" class="text-sm font-medium text-slate-700 cursor-pointer select-none">Schema</label>
166
- <input type="checkbox" class="print-toggle" id="toggle-schema" checked />
167
- </div>
168
- <div class="flex items-center justify-between px-4 py-2 cursor-pointer hover:bg-slate-50">
169
- <label for="toggle-examples" class="text-sm font-medium text-slate-700 cursor-pointer select-none">Examples</label>
170
- <input type="checkbox" class="print-toggle" id="toggle-examples" checked />
171
- </div>
172
- </div>
173
- </div>
174
-
175
- <!-- Export button (top-right) -->
176
- <div class="no-print fixed top-5 right-5 z-50 flex gap-2">
177
- <button
178
- onclick="window.print()"
179
- class="inline-flex items-center gap-2 px-4 py-2.5 bg-slate-900 text-white rounded-lg text-sm font-semibold cursor-pointer shadow-md hover:bg-slate-800 hover:-translate-y-px hover:shadow-lg transition-all"
180
- >
181
- <svg
182
- xmlns="http://www.w3.org/2000/svg"
183
- width="15"
184
- height="15"
185
- viewBox="0 0 24 24"
186
- fill="none"
187
- stroke="currentColor"
188
- stroke-width="2"
189
- stroke-linecap="round"
190
- stroke-linejoin="round"
191
- >
192
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
193
- <polyline points="7 10 12 15 17 10"></polyline>
194
- <line x1="12" y1="15" x2="12" y2="3"></line>
195
- </svg>
196
- Export PDF
197
- </button>
198
- </div>
199
-
200
- <!-- Page content -->
201
- <div
202
- class="relative max-w-[860px] mx-auto my-8 px-10 py-12 pb-16 bg-white rounded-2xl shadow-[0_1px_3px_rgba(0,0,0,0.04),0_6px_24px_rgba(0,0,0,0.06)] print:max-w-full print:m-0 print:p-0 print:shadow-none print:rounded-none overflow-hidden"
203
- >
204
- {
205
- stamp && (
206
- <div class="pointer-events-none absolute inset-0 z-10 flex items-center justify-center">
207
- <div class={`stamp-watermark ${stamp === 'draft' ? 'stamp-draft' : 'stamp-deprecated'}`} aria-hidden="true">
208
- {stamp === 'draft' ? 'DRAFT' : 'DEPRECATED'}
209
- </div>
210
- </div>
211
- )
212
- }
213
- <slot />
214
- </div>
215
-
216
- <script is:inline>
217
- const settingsToggle = document.getElementById('settings-toggle');
218
- const settingsPanel = document.getElementById('settings-panel');
219
-
220
- settingsToggle.addEventListener('click', () => {
221
- settingsPanel.classList.toggle('open');
222
- });
223
-
224
- document.addEventListener('click', (e) => {
225
- if (!settingsToggle.contains(e.target) && !settingsPanel.contains(e.target)) {
226
- settingsPanel.classList.remove('open');
227
- }
228
- });
229
-
230
- // Hide documentation by default
231
- document.querySelectorAll('[data-print-section="documentation"]').forEach((section) => {
232
- section.style.display = 'none';
233
- });
234
-
235
- document.getElementById('toggle-producers-consumers').addEventListener('change', (e) => {
236
- const sections = document.querySelectorAll('[data-print-section="producers"], [data-print-section="consumers"]');
237
- sections.forEach((section) => {
238
- section.style.display = e.target.checked ? '' : 'none';
239
- });
240
- });
241
-
242
- document.getElementById('toggle-versions').addEventListener('change', (e) => {
243
- const sections = document.querySelectorAll('[data-print-section="versions"]');
244
- sections.forEach((section) => {
245
- section.style.display = e.target.checked ? '' : 'none';
246
- });
247
- });
248
-
249
- document.getElementById('toggle-documentation').addEventListener('change', (e) => {
250
- const sections = document.querySelectorAll('[data-print-section="documentation"]');
251
- sections.forEach((section) => {
252
- section.style.display = e.target.checked ? '' : 'none';
253
- });
254
- });
255
-
256
- document.getElementById('toggle-schema').addEventListener('change', (e) => {
257
- const sections = document.querySelectorAll('[data-print-section="schema"]');
258
- sections.forEach((section) => {
259
- section.style.display = e.target.checked ? '' : 'none';
260
- });
261
- });
262
-
263
- document.getElementById('toggle-examples').addEventListener('change', (e) => {
264
- const sections = document.querySelectorAll('[data-print-section="examples"]');
265
- sections.forEach((section) => {
266
- section.style.display = e.target.checked ? '' : 'none';
267
- });
268
- });
269
- </script>
270
- </body>
271
- </html>
@@ -1,64 +0,0 @@
1
- ---
2
- import type { HydratedParticipant } from '../utils';
3
-
4
- interface Props {
5
- participants: HydratedParticipant[];
6
- dotColor: string;
7
- emptyMessage: string;
8
- }
9
-
10
- const { participants, dotColor, emptyMessage } = Astro.props;
11
- ---
12
-
13
- {
14
- participants.length > 0 ? (
15
- <table class="w-full text-sm border-separate border-spacing-0 border border-slate-200 rounded-lg overflow-hidden table-fixed">
16
- <thead>
17
- <tr>
18
- <th class="w-[50%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
19
- Resource
20
- </th>
21
- <th class="w-[20%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
22
- Message Version
23
- </th>
24
- <th class="w-[30%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
25
- Owners
26
- </th>
27
- </tr>
28
- </thead>
29
- <tbody>
30
- {participants.map((participant, i) => (
31
- <tr>
32
- <td class={`px-4 py-2.5 ${i < participants.length - 1 ? 'border-b border-slate-100' : ''}`}>
33
- <span class="flex items-center gap-2">
34
- <span class="w-1.5 h-1.5 rounded-full shrink-0 mt-0.5" style={`background: ${dotColor};`} />
35
- <span>
36
- <span class="font-medium text-slate-700">{participant.name}</span>
37
- <span class="text-slate-400 text-xs ml-1">(v{participant.resourceVersion})</span>
38
- <div class="text-slate-400 text-xs">
39
- {participant.resourceType}
40
- {participant.domain && <span> · {participant.domain} Domain</span>}
41
- </div>
42
- </span>
43
- </span>
44
- </td>
45
- <td class={`px-4 py-2.5 ${i < participants.length - 1 ? 'border-b border-slate-100' : ''}`}>
46
- {participant.isLatest ? (
47
- <span class="inline-flex items-center text-xs font-semibold text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full">
48
- Latest
49
- </span>
50
- ) : (
51
- <span class="text-slate-500">{participant.messageVersion}</span>
52
- )}
53
- </td>
54
- <td class={`px-4 py-2.5 text-slate-500 ${i < participants.length - 1 ? 'border-b border-slate-100' : ''}`}>
55
- {participant.owners.length > 0 ? participant.owners.join(', ') : '—'}
56
- </td>
57
- </tr>
58
- ))}
59
- </tbody>
60
- </table>
61
- ) : (
62
- <p class="text-sm italic text-slate-400 py-3">{emptyMessage}</p>
63
- )
64
- }
@@ -1,65 +0,0 @@
1
- ---
2
- import { extractSchemaProperties } from '@utils/schema-utils';
3
-
4
- interface Props {
5
- schema: any;
6
- isAvro: boolean;
7
- }
8
-
9
- const { schema, isAvro } = Astro.props;
10
-
11
- const schemaContent = typeof schema === 'string' ? schema : JSON.stringify(schema);
12
- const format = isAvro ? 'avro' : 'json';
13
- const properties = extractSchemaProperties(schemaContent, format);
14
- ---
15
-
16
- {
17
- properties.length > 0 && (
18
- <table class="w-full text-sm border-separate border-spacing-0 border border-slate-200 rounded-lg overflow-hidden table-fixed">
19
- <thead>
20
- <tr>
21
- <th class="w-[25%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
22
- Property
23
- </th>
24
- <th class="w-[15%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
25
- Type
26
- </th>
27
- <th class="w-[45%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
28
- Description
29
- </th>
30
- <th class="w-[15%] text-left font-semibold text-slate-500 px-4 py-2.5 bg-slate-100 border-b border-slate-200 text-[0.6875rem] uppercase tracking-wider">
31
- Required
32
- </th>
33
- </tr>
34
- </thead>
35
- <tbody>
36
- {properties.map((prop, i) => (
37
- <tr>
38
- <td
39
- class={`px-4 py-2.5 font-medium text-slate-700 font-mono text-xs ${i < properties.length - 1 ? 'border-b border-slate-100' : ''}`}
40
- >
41
- {prop.name}
42
- </td>
43
- <td
44
- class={`px-4 py-2.5 text-slate-500 font-mono text-xs ${i < properties.length - 1 ? 'border-b border-slate-100' : ''}`}
45
- >
46
- {prop.type}
47
- </td>
48
- <td class={`px-4 py-2.5 text-slate-500 ${i < properties.length - 1 ? 'border-b border-slate-100' : ''}`}>
49
- {prop.description || '—'}
50
- </td>
51
- <td class={`px-4 py-2.5 ${i < properties.length - 1 ? 'border-b border-slate-100' : ''}`}>
52
- {prop.required ? (
53
- <span class="inline-flex items-center text-xs font-semibold text-red-600 bg-red-50 border border-red-200 px-2 py-0.5 rounded-full">
54
- Required
55
- </span>
56
- ) : (
57
- <span class="text-xs text-slate-400">Optional</span>
58
- )}
59
- </td>
60
- </tr>
61
- ))}
62
- </tbody>
63
- </table>
64
- )
65
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * Licensed under the EventCatalog Commercial License.
3
- * See /packages/core/eventcatalog/src/enterprise/LICENSE
4
- */
5
-
6
- import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
7
- import { oneLight } from 'react-syntax-highlighter/dist/cjs/styles/prism';
8
- import { getLanguageForHighlight } from '@components/SchemaExplorer/utils';
9
-
10
- interface PrintSchemaViewerProps {
11
- content: string;
12
- format: string;
13
- extension: string;
14
- }
15
-
16
- export default function PrintSchemaViewer({ content, format, extension }: PrintSchemaViewerProps) {
17
- return (
18
- <div className="border border-slate-200 rounded-lg overflow-hidden">
19
- <div className="bg-slate-50 px-4 py-2 border-b border-slate-200 text-[0.6875rem] font-semibold uppercase tracking-wider text-slate-500 flex items-center gap-2">
20
- <svg
21
- xmlns="http://www.w3.org/2000/svg"
22
- width="12"
23
- height="12"
24
- viewBox="0 0 24 24"
25
- fill="none"
26
- stroke="currentColor"
27
- strokeWidth="2"
28
- strokeLinecap="round"
29
- strokeLinejoin="round"
30
- >
31
- <polyline points="16 18 22 12 16 6"></polyline>
32
- <polyline points="8 6 2 12 8 18"></polyline>
33
- </svg>
34
- {format}
35
- </div>
36
- <SyntaxHighlighter
37
- language={getLanguageForHighlight(extension)}
38
- style={oneLight}
39
- customStyle={{
40
- margin: 0,
41
- padding: '1rem 1.25rem',
42
- borderRadius: 0,
43
- fontSize: '0.8rem',
44
- lineHeight: '1.6',
45
- background: '#fafbfc',
46
- }}
47
- showLineNumbers={true}
48
- wrapLines={true}
49
- wrapLongLines={true}
50
- >
51
- {content}
52
- </SyntaxHighlighter>
53
- </div>
54
- );
55
- }
@@ -1,17 +0,0 @@
1
- ---
2
- interface Props {
3
- title: string;
4
- sectionId?: string;
5
- }
6
-
7
- const { title, sectionId } = Astro.props;
8
- ---
9
-
10
- <section class="mb-9 break-inside-avoid" {...sectionId ? { 'data-print-section': sectionId } : {}}>
11
- <h2
12
- class="print-section-title text-[0.6875rem] font-bold uppercase tracking-wider text-slate-400 mb-3.5 flex items-center gap-2"
13
- >
14
- {title}
15
- </h2>
16
- <slot />
17
- </section>