@eventcatalog/core 3.36.4 → 3.37.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.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-7WJEUZFM.js → chunk-3N5OG33R.js} +3 -3
- package/dist/{chunk-HF27CRFY.js → chunk-6UFDH5SD.js} +1 -1
- package/dist/{chunk-NV7DNZ3X.js → chunk-C24AACHY.js} +1 -1
- package/dist/{chunk-XTJ636IF.js → chunk-G6DWKVUO.js} +1 -1
- package/dist/{chunk-6JY6QF7D.js → chunk-R6AVEQA4.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/development/bring-your-own-documentation/custom-pages/03-components.md +7 -0
- package/dist/docs/development/components/components/08-flow.md +14 -5
- package/dist/docs/development/components/components/12-nodegraph.md +7 -4
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +10 -10
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/FieldsExplorer/FieldsTable.tsx +2 -8
- package/eventcatalog/src/components/MDX/Admonition.tsx +45 -35
- package/eventcatalog/src/components/MDX/MessageTable/MessageTable.client.tsx +2 -1
- package/eventcatalog/src/components/MDX/ResourceGroupTable/ResourceGroupTable.client.tsx +2 -1
- package/eventcatalog/src/components/MDX/ResourceLink/ResourceLink.astro +7 -1
- package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +68 -47
- package/eventcatalog/src/components/SideNav/NestedSideBar/utils.ts +1 -0
- package/eventcatalog/src/components/Tables/Discover/columns.tsx +3 -16
- package/eventcatalog/src/components/Tables/columns/ContainersTableColumns.tsx +2 -2
- package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +3 -2
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +4 -14
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +4 -14
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +2 -2
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/root-index.astro +32 -28
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +9 -27
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +9 -27
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +12 -28
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +14 -33
- package/eventcatalog/src/styles/tailwind.css +44 -26
- package/eventcatalog/src/styles/theme.css +4 -0
- package/eventcatalog/src/styles/themes/forest.css +4 -0
- package/eventcatalog/src/styles/themes/ocean.css +4 -0
- package/eventcatalog/src/styles/themes/sapphire.css +4 -0
- package/eventcatalog/src/styles/themes/sunset.css +4 -0
- package/eventcatalog/src/utils/collection-colors.ts +76 -0
- package/eventcatalog/src/utils/collections/icons.ts +2 -29
- package/eventcatalog/src/utils/resource-reference-colors.ts +49 -0
- package/package.json +3 -3
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
} from '@utils/collections/util';
|
|
15
15
|
import { getCollection } from 'astro:content';
|
|
16
16
|
import { getServiceSpecifications, getSpecUrl, getSpecLabel } from '@components/Grids/specification-utils';
|
|
17
|
+
import { getResourceReferenceStyle } from '@utils/resource-reference-colors';
|
|
18
|
+
import { isIconPath, resolveIconUrl } from '@utils/icon';
|
|
17
19
|
|
|
18
20
|
interface Props {
|
|
19
21
|
type:
|
|
@@ -29,7 +31,8 @@ interface Props {
|
|
|
29
31
|
| 'container'
|
|
30
32
|
| 'user'
|
|
31
33
|
| 'team'
|
|
32
|
-
| 'doc'
|
|
34
|
+
| 'doc'
|
|
35
|
+
| 'data-product';
|
|
33
36
|
version?: string;
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -56,22 +59,21 @@ const normalizedResourceId = normalizeCustomDocPath(resourceId).toLowerCase();
|
|
|
56
59
|
// Map type to collection name
|
|
57
60
|
const collection = resourceToCollectionMap[type as keyof typeof resourceToCollectionMap];
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
doc: { borderColor: 'var(--ec-badge-default-text)', label: 'Doc' }, // gray
|
|
62
|
+
const typeLabels: Record<string, string> = {
|
|
63
|
+
entity: 'Entity',
|
|
64
|
+
service: 'Service',
|
|
65
|
+
event: 'Event',
|
|
66
|
+
command: 'Command',
|
|
67
|
+
query: 'Query',
|
|
68
|
+
domain: 'Domain',
|
|
69
|
+
flow: 'Flow',
|
|
70
|
+
channel: 'Channel',
|
|
71
|
+
diagram: 'Diagram',
|
|
72
|
+
container: 'Container',
|
|
73
|
+
user: 'User',
|
|
74
|
+
team: 'Team',
|
|
75
|
+
doc: 'Custom Doc',
|
|
76
|
+
'data-product': 'Data Product',
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
// SVG icons for each type (from heroicons outline)
|
|
@@ -97,11 +99,14 @@ const typeIcons: Record<string, string> = {
|
|
|
97
99
|
'<path stroke-linecap="round" stroke-linejoin="round" d="M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125" />', // Database
|
|
98
100
|
user: '<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" />', // User
|
|
99
101
|
team: '<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z" />', // UserGroup
|
|
100
|
-
doc: '<path stroke-linecap="round" stroke-linejoin="round" d="
|
|
102
|
+
doc: '<path stroke-linecap="round" stroke-linejoin="round" d="M14 2v4a2 2 0 002 2h4" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V7z" /><path stroke-linecap="round" stroke-linejoin="round" d="M10 9H8" /><path stroke-linecap="round" stroke-linejoin="round" d="M16 13H8" /><path stroke-linecap="round" stroke-linejoin="round" d="M16 17H8" />', // FileText
|
|
103
|
+
'data-product':
|
|
104
|
+
'<path stroke-linecap="round" stroke-linejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25M21 7.5v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />', // Cube
|
|
101
105
|
};
|
|
102
106
|
|
|
103
|
-
const
|
|
107
|
+
const label = typeLabels[type] || typeLabels.entity;
|
|
104
108
|
const iconPath = typeIcons[type] || typeIcons.entity;
|
|
109
|
+
const resourceReferenceStyle = getResourceReferenceStyle(type);
|
|
105
110
|
|
|
106
111
|
let resource: any = null;
|
|
107
112
|
let href = '#';
|
|
@@ -172,6 +177,7 @@ const hasVisualizer = ['domain', 'service', 'event', 'query', 'command', 'contai
|
|
|
172
177
|
// Check deprecation status
|
|
173
178
|
const deprecation = resource ? getDeprecatedDetails(resource) : null;
|
|
174
179
|
const isDeprecated = deprecation?.isMarkedAsDeprecated || false;
|
|
180
|
+
const resourceIconUrl = isIconPath(resource?.data?.styles?.icon) ? resolveIconUrl(resource.data.styles.icon) : null;
|
|
175
181
|
|
|
176
182
|
// Get owners (first 2)
|
|
177
183
|
const owners = resource?.data?.owners?.slice(0, 2) || [];
|
|
@@ -234,7 +240,7 @@ const hasSpecifications = specifications.length > 0;
|
|
|
234
240
|
const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
235
241
|
---
|
|
236
242
|
|
|
237
|
-
<span class="resource-ref-wrapper inline">
|
|
243
|
+
<span class="resource-ref-wrapper inline relative">
|
|
238
244
|
{
|
|
239
245
|
hasError ? (
|
|
240
246
|
<span
|
|
@@ -249,14 +255,13 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
|
249
255
|
href={href}
|
|
250
256
|
class:list={[
|
|
251
257
|
'resource-ref-trigger inline-flex items-center gap-1 px-1 -mx-1 rounded font-medium underline decoration-dotted decoration-2 underline-offset-[3px] transition-colors',
|
|
252
|
-
|
|
253
|
-
? 'text-amber-700 dark:text-amber-400 decoration-amber-500/60'
|
|
254
|
-
: 'text-[rgb(var(--ec-accent-text))] decoration-[rgb(var(--ec-primary))] hover:bg-[rgb(var(--ec-accent-subtle))]',
|
|
258
|
+
'text-[var(--ec-resource-ref-color)] decoration-[var(--ec-resource-ref-color)] hover:bg-[var(--ec-resource-ref-bg)]',
|
|
255
259
|
]}
|
|
260
|
+
style={resourceReferenceStyle}
|
|
256
261
|
data-tooltip-id={tooltipId}
|
|
257
262
|
>
|
|
258
263
|
<svg
|
|
259
|
-
class="w-3.5 h-3.5 flex-shrink-0 text-[
|
|
264
|
+
class="w-3.5 h-3.5 flex-shrink-0 text-[var(--ec-resource-ref-color)]"
|
|
260
265
|
fill="none"
|
|
261
266
|
viewBox="0 0 24 24"
|
|
262
267
|
stroke="currentColor"
|
|
@@ -271,7 +276,7 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
|
271
276
|
<span
|
|
272
277
|
id={tooltipId}
|
|
273
278
|
class="resource-ref-tooltip fixed w-80 bg-[rgb(var(--ec-card-bg))] border border-[rgb(var(--ec-page-border))] border-l-[3px] rounded-r-lg rounded-l-none shadow-lg shadow-black/8 z-[9999] text-left overflow-hidden opacity-0 pointer-events-none transition-all duration-150 scale-95 origin-top-left"
|
|
274
|
-
style={
|
|
279
|
+
style={`${resourceReferenceStyle}; border-left-color: var(--ec-resource-ref-color);`}
|
|
275
280
|
>
|
|
276
281
|
{/* Deprecation banner */}
|
|
277
282
|
{isDeprecated && (
|
|
@@ -289,29 +294,41 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
|
289
294
|
|
|
290
295
|
<span class="block p-3">
|
|
291
296
|
{/* Header: Name with icon top-right */}
|
|
292
|
-
<span class="
|
|
293
|
-
<span class="flex flex-col">
|
|
294
|
-
<span class="
|
|
295
|
-
|
|
296
|
-
{resource?.data?.name || resourceId}
|
|
297
|
-
</span>
|
|
298
|
-
<span class="text-[0.65rem] text-[rgb(var(--ec-page-text-muted))] uppercase tracking-wide">{style.label}</span>
|
|
297
|
+
<span class="grid grid-cols-[minmax(0,1fr)_1.25rem] items-start gap-3 border-b border-[rgb(var(--ec-page-border))] pb-2 mb-3">
|
|
298
|
+
<span class="flex min-w-0 flex-col">
|
|
299
|
+
<span class="font-semibold text-[rgb(var(--ec-page-text))] text-[0.95rem] leading-tight">
|
|
300
|
+
{resource?.data?.name || resourceId}
|
|
299
301
|
</span>
|
|
300
|
-
|
|
301
|
-
<span class="text-[0.
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
<span class="mt-0.5 flex items-center gap-1.5 text-[0.7rem] text-[rgb(var(--ec-page-text-muted))] uppercase tracking-wide">
|
|
303
|
+
<span class="text-[0.65rem] text-[rgb(var(--ec-page-text-muted))] uppercase tracking-wide">{label}</span>
|
|
304
|
+
{isVersionedResource && (
|
|
305
|
+
<>
|
|
306
|
+
<span aria-hidden="true">•</span>
|
|
307
|
+
<span class="font-mono normal-case">v{resource?.data?.version}</span>
|
|
308
|
+
</>
|
|
309
|
+
)}
|
|
310
|
+
</span>
|
|
311
|
+
</span>
|
|
312
|
+
<span class="flex h-[24px] w-[24px] items-start justify-end mr-4">
|
|
313
|
+
{resourceIconUrl ? (
|
|
314
|
+
<img
|
|
315
|
+
src={resourceIconUrl}
|
|
316
|
+
alt=""
|
|
317
|
+
class="not-prose m-0 block h-[24px] w-[24px] object-contain"
|
|
318
|
+
loading="lazy"
|
|
319
|
+
/>
|
|
320
|
+
) : (
|
|
321
|
+
<svg
|
|
322
|
+
class="h-5 w-5"
|
|
323
|
+
style="color: var(--ec-resource-ref-color);"
|
|
324
|
+
fill="none"
|
|
325
|
+
viewBox="0 0 24 24"
|
|
326
|
+
stroke="currentColor"
|
|
327
|
+
stroke-width="1.5"
|
|
328
|
+
set:html={iconPath}
|
|
329
|
+
/>
|
|
304
330
|
)}
|
|
305
331
|
</span>
|
|
306
|
-
<svg
|
|
307
|
-
class="w-5 h-5 flex-shrink-0"
|
|
308
|
-
style={`color: rgb(${style.borderColor});`}
|
|
309
|
-
fill="none"
|
|
310
|
-
viewBox="0 0 24 24"
|
|
311
|
-
stroke="currentColor"
|
|
312
|
-
stroke-width="1.5"
|
|
313
|
-
set:html={iconPath}
|
|
314
|
-
/>
|
|
315
332
|
</span>
|
|
316
333
|
|
|
317
334
|
{/* Summary */}
|
|
@@ -413,7 +430,7 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
|
413
430
|
) : null}
|
|
414
431
|
|
|
415
432
|
{/* Actions */}
|
|
416
|
-
<span class="flex items-center justify-between pt-
|
|
433
|
+
<span class="flex items-center justify-between pt-1 text-[0.7rem]">
|
|
417
434
|
<span class="flex items-center gap-3">
|
|
418
435
|
{type === 'flow' && (
|
|
419
436
|
<a
|
|
@@ -450,7 +467,11 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
|
450
467
|
</a>
|
|
451
468
|
)}
|
|
452
469
|
</span>
|
|
453
|
-
<a
|
|
470
|
+
<a
|
|
471
|
+
href={href}
|
|
472
|
+
class="text-[var(--ec-resource-ref-color)] hover:underline font-medium"
|
|
473
|
+
style="color: var(--ec-resource-ref-color);"
|
|
474
|
+
>
|
|
454
475
|
{type === 'diagram' ? 'View diagram' : type === 'doc' ? 'View doc' : 'View docs'}
|
|
455
476
|
</a>
|
|
456
477
|
</span>
|
|
@@ -14,6 +14,7 @@ export const getBadgeClasses = (badge: string): string => {
|
|
|
14
14
|
message: 'bg-[rgb(var(--ec-badge-message-bg))] text-[rgb(var(--ec-badge-message-text))]',
|
|
15
15
|
design: 'bg-[rgb(var(--ec-badge-design-bg))] text-[rgb(var(--ec-badge-design-text))]',
|
|
16
16
|
channel: 'bg-[rgb(var(--ec-badge-channel-bg))] text-[rgb(var(--ec-badge-channel-text))]',
|
|
17
|
+
container: 'bg-[rgb(var(--ec-badge-container-bg))] text-[rgb(var(--ec-badge-container-text))]',
|
|
17
18
|
'data product': 'bg-[rgb(var(--ec-badge-data-product-bg))] text-[rgb(var(--ec-badge-data-product-text))]',
|
|
18
19
|
};
|
|
19
20
|
return badgeColors[badge.toLowerCase()] || 'bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]';
|
|
@@ -4,26 +4,13 @@ import { DocumentTextIcon, MapIcon } from '@heroicons/react/24/solid';
|
|
|
4
4
|
import { ArrowDownIcon, ArrowUpIcon, EllipsisVerticalIcon, StarIcon } from '@heroicons/react/24/outline';
|
|
5
5
|
import { buildUrl } from '@utils/url-builder';
|
|
6
6
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
7
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
7
8
|
import { isIconPath, resolveIconUrl } from '@utils/icon';
|
|
8
9
|
import { useStore } from '@nanostores/react';
|
|
9
10
|
import { favoritesStore, toggleFavorite, type FavoriteItem } from '../../../stores/favorites-store';
|
|
10
11
|
import type { DiscoverTableData, CollectionType } from './DiscoverTable';
|
|
11
12
|
import type { TableConfiguration } from '@types';
|
|
12
13
|
|
|
13
|
-
// Color mapping to ensure Tailwind classes are included in the build
|
|
14
|
-
const colorClasses: Record<string, string> = {
|
|
15
|
-
orange: 'text-orange-500',
|
|
16
|
-
blue: 'text-blue-500',
|
|
17
|
-
green: 'text-green-500',
|
|
18
|
-
pink: 'text-pink-500',
|
|
19
|
-
yellow: 'text-yellow-500',
|
|
20
|
-
teal: 'text-teal-500',
|
|
21
|
-
purple: 'text-purple-500',
|
|
22
|
-
red: 'text-red-500',
|
|
23
|
-
gray: 'text-gray-500',
|
|
24
|
-
cyan: 'text-cyan-500',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
14
|
const columnHelper = createColumnHelper<DiscoverTableData>();
|
|
28
15
|
|
|
29
16
|
// Badge cell component (proper React component to use hooks)
|
|
@@ -80,7 +67,7 @@ const ResourceNameCell = ({ item }: { item: DiscoverTableData }) => {
|
|
|
80
67
|
{resourceIconUrl ? (
|
|
81
68
|
<img src={resourceIconUrl} alt="" className="h-5 w-5 flex-shrink-0 rounded-sm object-contain" />
|
|
82
69
|
) : (
|
|
83
|
-
<Icon className={`h-4 w-4 flex-shrink-0 ${
|
|
70
|
+
<Icon className={`h-4 w-4 flex-shrink-0 ${getCollectionTextColorClass(color, 'text-[rgb(var(--ec-icon-color))]')}`} />
|
|
84
71
|
)}
|
|
85
72
|
<span className="text-sm font-semibold text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent))]">
|
|
86
73
|
{item.data.name}
|
|
@@ -248,7 +235,7 @@ const CollectionListCell = ({
|
|
|
248
235
|
href={buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)}
|
|
249
236
|
className="group inline-flex items-center gap-1.5 text-[0.8rem] text-[rgb(var(--ec-icon-color))] hover:text-[rgb(var(--ec-accent))] transition-colors"
|
|
250
237
|
>
|
|
251
|
-
<item.Icon className={`h-3.5 w-3.5 ${
|
|
238
|
+
<item.Icon className={`h-3.5 w-3.5 ${getCollectionTextColorClass(item.color)} flex-shrink-0`} />
|
|
252
239
|
<span className="truncate max-w-[120px]" title={item.data.name}>
|
|
253
240
|
{item.data.name}
|
|
254
241
|
</span>
|
|
@@ -21,8 +21,8 @@ export const columns = (tableConfiguration: TableConfiguration) => [
|
|
|
21
21
|
href={buildUrl(`/docs/${containerRaw.collection}/${containerRaw.data.id}/${containerRaw.data.version}`)}
|
|
22
22
|
className="group inline-flex items-center"
|
|
23
23
|
>
|
|
24
|
-
<span className="inline-flex items-center rounded-md border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] hover:border-
|
|
25
|
-
<span className="flex items-center justify-center w-6 h-6 bg-
|
|
24
|
+
<span className="inline-flex items-center rounded-md border border-[rgb(var(--ec-page-border))] bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] hover:border-indigo-400 dark:hover:border-indigo-500 hover:bg-indigo-50 dark:hover:bg-indigo-500/10 transition-colors">
|
|
25
|
+
<span className="flex items-center justify-center w-6 h-6 bg-indigo-500 rounded-l-md">
|
|
26
26
|
<DatabaseIcon className="h-3 w-3 text-white" />
|
|
27
27
|
</span>
|
|
28
28
|
<span className="px-2 py-1 text-xs text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-page-text))]">
|
|
@@ -5,6 +5,7 @@ import { useMemo, useState } from 'react';
|
|
|
5
5
|
import { filterByName, filterCollectionByName } from '../filters/custom-filters';
|
|
6
6
|
import { buildUrl } from '@utils/url-builder';
|
|
7
7
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
8
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
8
9
|
import { createBadgesColumn } from './SharedColumns';
|
|
9
10
|
import FavoriteButton from '@components/FavoriteButton';
|
|
10
11
|
import type { TData } from '../Table';
|
|
@@ -95,7 +96,7 @@ export const columns = (tableConfiguration: TableConfiguration) => [
|
|
|
95
96
|
href={buildUrl(`/docs/${consumer.collection}/${consumer.data.id}/${consumer.data.version}`)}
|
|
96
97
|
className="group inline-flex items-center gap-1.5 text-xs hover:text-[rgb(var(--ec-accent))] transition-colors"
|
|
97
98
|
>
|
|
98
|
-
<consumer.Icon className={`h-3.5 w-3.5
|
|
99
|
+
<consumer.Icon className={`h-3.5 w-3.5 ${getCollectionTextColorClass(consumer.color)} flex-shrink-0`} />
|
|
99
100
|
<span className="truncate max-w-[120px]" title={consumer.data.name}>
|
|
100
101
|
{consumer.data.name}
|
|
101
102
|
</span>
|
|
@@ -154,7 +155,7 @@ export const columns = (tableConfiguration: TableConfiguration) => [
|
|
|
154
155
|
href={buildUrl(`/docs/${sender.collection}/${sender.data.id}/${sender.data.version}`)}
|
|
155
156
|
className="group inline-flex items-center gap-1.5 text-xs hover:text-[rgb(var(--ec-accent))] transition-colors"
|
|
156
157
|
>
|
|
157
|
-
<sender.Icon className={`h-3.5 w-3.5
|
|
158
|
+
<sender.Icon className={`h-3.5 w-3.5 ${getCollectionTextColorClass(sender.color)} flex-shrink-0`} />
|
|
158
159
|
<span className="truncate max-w-[120px]" title={sender.data.name}>
|
|
159
160
|
{sender.data.name}
|
|
160
161
|
</span>
|
|
@@ -6,21 +6,9 @@ import type { TData } from '../Table';
|
|
|
6
6
|
import type { CollectionUserTypes } from '@types';
|
|
7
7
|
import type { TableConfiguration } from '@types';
|
|
8
8
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
9
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
9
10
|
const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
|
|
10
11
|
|
|
11
|
-
const colorClasses: Record<string, string> = {
|
|
12
|
-
orange: 'text-orange-500',
|
|
13
|
-
blue: 'text-blue-500',
|
|
14
|
-
green: 'text-green-500',
|
|
15
|
-
pink: 'text-pink-500',
|
|
16
|
-
yellow: 'text-yellow-500',
|
|
17
|
-
teal: 'text-teal-500',
|
|
18
|
-
purple: 'text-purple-500',
|
|
19
|
-
red: 'text-red-500',
|
|
20
|
-
gray: 'text-gray-500',
|
|
21
|
-
cyan: 'text-cyan-500',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
12
|
const CollectionListCell = ({
|
|
25
13
|
items,
|
|
26
14
|
emptyText,
|
|
@@ -49,7 +37,9 @@ const CollectionListCell = ({
|
|
|
49
37
|
href={href}
|
|
50
38
|
className="group inline-flex items-center gap-1.5 text-[0.8rem] text-[rgb(var(--ec-icon-color))] transition-colors hover:text-[rgb(var(--ec-accent))]"
|
|
51
39
|
>
|
|
52
|
-
<Icon
|
|
40
|
+
<Icon
|
|
41
|
+
className={`h-3.5 w-3.5 flex-shrink-0 ${getCollectionTextColorClass(color, 'text-[rgb(var(--ec-icon-color))]')}`}
|
|
42
|
+
/>
|
|
53
43
|
<span className="max-w-[140px] truncate" title={item.data.name}>
|
|
54
44
|
{item.data.name}
|
|
55
45
|
</span>
|
|
@@ -6,21 +6,9 @@ import type { TData } from '../Table';
|
|
|
6
6
|
import type { CollectionUserTypes } from '@types';
|
|
7
7
|
import type { TableConfiguration } from '@types';
|
|
8
8
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
9
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
9
10
|
const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
|
|
10
11
|
|
|
11
|
-
const colorClasses: Record<string, string> = {
|
|
12
|
-
orange: 'text-orange-500',
|
|
13
|
-
blue: 'text-blue-500',
|
|
14
|
-
green: 'text-green-500',
|
|
15
|
-
pink: 'text-pink-500',
|
|
16
|
-
yellow: 'text-yellow-500',
|
|
17
|
-
teal: 'text-teal-500',
|
|
18
|
-
purple: 'text-purple-500',
|
|
19
|
-
red: 'text-red-500',
|
|
20
|
-
gray: 'text-gray-500',
|
|
21
|
-
cyan: 'text-cyan-500',
|
|
22
|
-
};
|
|
23
|
-
|
|
24
12
|
const CollectionListCell = ({
|
|
25
13
|
items,
|
|
26
14
|
emptyText,
|
|
@@ -52,7 +40,9 @@ const CollectionListCell = ({
|
|
|
52
40
|
href={href}
|
|
53
41
|
className="group inline-flex items-center gap-1.5 text-[0.8rem] text-[rgb(var(--ec-icon-color))] transition-colors hover:text-[rgb(var(--ec-accent))]"
|
|
54
42
|
>
|
|
55
|
-
<Icon
|
|
43
|
+
<Icon
|
|
44
|
+
className={`h-3.5 w-3.5 flex-shrink-0 ${getCollectionTextColorClass(color, 'text-[rgb(var(--ec-icon-color))]')}`}
|
|
45
|
+
/>
|
|
56
46
|
<span className="max-w-[140px] truncate" title={item.data.name}>
|
|
57
47
|
{item.data.name}
|
|
58
48
|
</span>
|
|
@@ -182,7 +182,7 @@ const editUrl =
|
|
|
182
182
|
class="group flex flex-col border border-[rgb(var(--ec-page-border))] rounded-lg p-4 hover:border-[rgb(var(--ec-content-text-muted))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors w-full sm:w-1/2"
|
|
183
183
|
>
|
|
184
184
|
<span class="text-sm text-[rgb(var(--ec-page-text-muted))] mb-1">Previous</span>
|
|
185
|
-
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-
|
|
185
|
+
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent))] transition-colors">
|
|
186
186
|
{prev.label}
|
|
187
187
|
</span>
|
|
188
188
|
</a>
|
|
@@ -198,7 +198,7 @@ const editUrl =
|
|
|
198
198
|
class="group flex flex-col items-end text-right border border-[rgb(var(--ec-page-border))] rounded-lg p-4 hover:border-[rgb(var(--ec-content-text-muted))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors w-full sm:w-1/2"
|
|
199
199
|
>
|
|
200
200
|
<span class="text-sm text-[rgb(var(--ec-page-text-muted))] mb-1">Next</span>
|
|
201
|
-
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-
|
|
201
|
+
<span class="font-medium text-[rgb(var(--ec-page-text))] group-hover:text-[rgb(var(--ec-accent))] transition-colors">
|
|
202
202
|
{next.label}
|
|
203
203
|
</span>
|
|
204
204
|
</a>
|
|
@@ -99,28 +99,28 @@ if (!isCustomDocsEnabled()) {
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
<VerticalSideBarLayout title="Custom Documentation" showNestedSideBar={false}>
|
|
102
|
-
<body class="min-h-screen font-inter">
|
|
102
|
+
<body class="min-h-screen font-inter bg-[rgb(var(--ec-page-bg))] text-[rgb(var(--ec-page-text))]">
|
|
103
103
|
<main class="container px-8 lg:px-8 mx-auto py-8 max-w-[80em]">
|
|
104
104
|
<div class="mb-12">
|
|
105
105
|
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
|
|
106
106
|
<div>
|
|
107
107
|
<div class="flex flex-wrap items-center gap-3 mb-3">
|
|
108
|
-
<h1 class="text-4xl font-semibold text-
|
|
108
|
+
<h1 class="text-4xl font-semibold text-[rgb(var(--ec-page-text))] font-inter">Custom Documentation</h1>
|
|
109
109
|
<div
|
|
110
110
|
class="inline-flex items-center px-3 py-1.5 rounded-full text-xs font-medium bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent-text))] border border-[rgb(var(--ec-accent)/0.3)] shadow-xs"
|
|
111
111
|
>
|
|
112
112
|
Pro feature
|
|
113
113
|
</div>
|
|
114
114
|
</div>
|
|
115
|
-
<p class="text-base mb-0 text-
|
|
115
|
+
<p class="text-base mb-0 text-[rgb(var(--ec-page-text-muted))] max-w-3xl">
|
|
116
116
|
Add custom documentation to EventCatalog to create a unified source of truth for your team. Document your
|
|
117
117
|
architecture decisions, patterns, and guidelines.
|
|
118
118
|
</p>
|
|
119
119
|
</div>
|
|
120
120
|
<div class="flex space-x-4 shrink-0">
|
|
121
121
|
<a
|
|
122
|
-
href="https://www.eventcatalog.dev/docs/custom-
|
|
123
|
-
class="inline-flex items-center justify-center px-5 py-2 border border-
|
|
122
|
+
href="https://www.eventcatalog.dev/docs/development/bring-your-own-documentation/custom-pages/introduction"
|
|
123
|
+
class="inline-flex items-center justify-center px-5 py-2 border border-[rgb(var(--ec-page-border))] text-sm font-medium rounded-md text-[rgb(var(--ec-page-text))] bg-[rgb(var(--ec-card-bg))] hover:bg-[rgb(var(--ec-content-hover))] transition-colors"
|
|
124
124
|
>
|
|
125
125
|
Read documentation →
|
|
126
126
|
</a>
|
|
@@ -128,7 +128,7 @@ if (!isCustomDocsEnabled()) {
|
|
|
128
128
|
!isCustomDocsEnabled() && (
|
|
129
129
|
<a
|
|
130
130
|
href="https://www.eventcatalog.dev/pro/trial"
|
|
131
|
-
class="inline-flex items-center justify-center px-5 py-2 border border-transparent text-sm font-medium rounded-md text-
|
|
131
|
+
class="inline-flex items-center justify-center px-5 py-2 border border-transparent text-sm font-medium rounded-md text-[rgb(var(--ec-button-text))] bg-gradient-to-r from-[rgb(var(--ec-accent-gradient-from))] to-[rgb(var(--ec-accent-gradient-to))] hover:opacity-90 shadow-xs"
|
|
132
132
|
>
|
|
133
133
|
Start 14-day trial
|
|
134
134
|
</a>
|
|
@@ -138,58 +138,62 @@ if (!isCustomDocsEnabled()) {
|
|
|
138
138
|
</div>
|
|
139
139
|
</div>
|
|
140
140
|
|
|
141
|
-
<h2 class="text-2xl font-semibold mb-2 text-
|
|
142
|
-
<p class="text-
|
|
141
|
+
<h2 class="text-2xl font-semibold mb-2 text-[rgb(var(--ec-page-text))]">Setup Guide</h2>
|
|
142
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-8 max-w-3xl">
|
|
143
143
|
Custom documentation let's you bring any documentation into EventCatalog. This is useful for documenting your architecture
|
|
144
144
|
decisions, patterns, and guidelines. Follow these steps to get started:
|
|
145
145
|
</p>
|
|
146
146
|
|
|
147
147
|
<div class="space-y-10 mb-12">
|
|
148
|
-
<div class="bg-
|
|
148
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
149
149
|
<div class="flex items-start gap-4">
|
|
150
150
|
<div
|
|
151
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
151
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
152
152
|
>
|
|
153
153
|
1
|
|
154
154
|
</div>
|
|
155
155
|
<div class="w-full">
|
|
156
|
-
<h3 class="text-xl font-semibold text-
|
|
157
|
-
<p class="text-
|
|
156
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Create the content structure</h3>
|
|
157
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
158
|
+
Create a folder structure in your directory to organize your documentation.
|
|
159
|
+
</p>
|
|
158
160
|
<Code code={folderStructureExample} lang="bash" frame="terminal" />
|
|
159
161
|
</div>
|
|
160
162
|
</div>
|
|
161
163
|
</div>
|
|
162
164
|
|
|
163
|
-
<div class="bg-
|
|
165
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
164
166
|
<div class="flex items-start gap-4">
|
|
165
167
|
<div
|
|
166
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
168
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
167
169
|
>
|
|
168
170
|
2
|
|
169
171
|
</div>
|
|
170
172
|
<div class="w-full">
|
|
171
|
-
<h3 class="text-xl font-semibold text-
|
|
172
|
-
<p class="text-
|
|
173
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Add MDX files</h3>
|
|
174
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">Create MDX files with frontmatter and markdown content.</p>
|
|
173
175
|
<Code code={mdxFileExample} lang="mdx" frame="terminal" />
|
|
174
176
|
</div>
|
|
175
177
|
</div>
|
|
176
178
|
</div>
|
|
177
179
|
|
|
178
|
-
<div class="bg-
|
|
180
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
179
181
|
<div class="flex items-start gap-4">
|
|
180
182
|
<div
|
|
181
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
183
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
182
184
|
>
|
|
183
185
|
3
|
|
184
186
|
</div>
|
|
185
187
|
<div class="w-full">
|
|
186
|
-
<h3 class="text-xl font-semibold text-
|
|
187
|
-
<p class="text-
|
|
188
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Update your eventcatalog.config.js file</h3>
|
|
189
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
188
190
|
Add the customDocs configuration to your eventcatalog.config.js file to define your sidebar structure.
|
|
189
191
|
</p>
|
|
190
192
|
<Code code={configExample} lang="js" frame="terminal" />
|
|
191
|
-
<p class="text-
|
|
192
|
-
|
|
193
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mt-4">
|
|
194
|
+
This configuration defines the sidebar structure for your custom documentation:
|
|
195
|
+
</p>
|
|
196
|
+
<ul class="list-disc list-inside text-[rgb(var(--ec-page-text-muted))] mt-2 ml-2 space-y-1">
|
|
193
197
|
<li>
|
|
194
198
|
<strong>label</strong>: The display name for each sidebar section
|
|
195
199
|
</li>
|
|
@@ -210,25 +214,25 @@ if (!isCustomDocsEnabled()) {
|
|
|
210
214
|
</div>
|
|
211
215
|
</div>
|
|
212
216
|
|
|
213
|
-
<div class="bg-
|
|
217
|
+
<div class="bg-[rgb(var(--ec-card-bg))] p-6 rounded-lg shadow-xs border border-[rgb(var(--ec-page-border))]">
|
|
214
218
|
<div class="flex items-start gap-4">
|
|
215
219
|
<div
|
|
216
|
-
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
220
|
+
class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] text-lg font-medium shrink-0 mt-1"
|
|
217
221
|
>
|
|
218
222
|
4
|
|
219
223
|
</div>
|
|
220
224
|
<div class="w-full">
|
|
221
|
-
<h3 class="text-xl font-semibold text-
|
|
222
|
-
<p class="text-
|
|
225
|
+
<h3 class="text-xl font-semibold text-[rgb(var(--ec-page-text))] mb-3">Restart EventCatalog</h3>
|
|
226
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
223
227
|
After configuring your documentation, restart EventCatalog to see your custom documentation.
|
|
224
228
|
</p>
|
|
225
229
|
<div class="mb-4">
|
|
226
230
|
<Code code="npm run dev" lang="bash" frame="terminal" />
|
|
227
231
|
</div>
|
|
228
|
-
<p class="text-
|
|
232
|
+
<p class="text-[rgb(var(--ec-page-text-muted))] mb-4">
|
|
229
233
|
Once restarted, you'll see your custom documentation displayed with the sidebar structure you defined:
|
|
230
234
|
</p>
|
|
231
|
-
<div class="border border-
|
|
235
|
+
<div class="border border-[rgb(var(--ec-page-border))] rounded-lg overflow-hidden">
|
|
232
236
|
<img src="/images/custom-docs-placeholder.png" alt="Example of custom documentation interface" class="w-full" />
|
|
233
237
|
</div>
|
|
234
238
|
</div>
|
|
@@ -150,7 +150,7 @@ const navigationItems = [
|
|
|
150
150
|
href: getDefaultUrl('docs/custom', '/docs/custom'),
|
|
151
151
|
current: currentPath.includes('/docs/custom'),
|
|
152
152
|
isPremium: true,
|
|
153
|
-
visible: isCustomDocsEnabled(),
|
|
153
|
+
visible: isCustomDocsEnabled() && customDocs.length > 0,
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
id: '/schemas/explorer',
|
package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { render } from 'astro:content';
|
|
3
3
|
|
|
4
4
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
5
|
+
import Admonition from '@components/MDX/Admonition';
|
|
5
6
|
import components from '@components/MDX/components';
|
|
6
7
|
import CopyAsMarkdown from '@components/CopyAsMarkdown';
|
|
7
8
|
import { buildUrl } from '@utils/url-builder';
|
|
@@ -99,33 +100,14 @@ const pagefindAttributes =
|
|
|
99
100
|
<div data-pagefind-ignore>
|
|
100
101
|
{
|
|
101
102
|
props.data.version !== props.data.latestVersion && (
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
/>
|
|
111
|
-
</svg>
|
|
112
|
-
</div>
|
|
113
|
-
<div class="ml-3">
|
|
114
|
-
<h3 class="text-sm font-medium text-[rgb(var(--ec-accent-text))]">New version found</h3>
|
|
115
|
-
<div class="mt-2 text-sm text-[rgb(var(--ec-accent-text))]">
|
|
116
|
-
<p>
|
|
117
|
-
You are looking at a previous version of the {singularResourceName} doc <strong>{title}</strong>.{' '}
|
|
118
|
-
<a
|
|
119
|
-
class="underline hover:text-primary block pt-2"
|
|
120
|
-
href={buildUrl(`${docsBasePath}/${props.data.latestVersion}`)}
|
|
121
|
-
>
|
|
122
|
-
The latest version of this doc is <span>v{props.data.latestVersion}</span> →
|
|
123
|
-
</a>
|
|
124
|
-
</p>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
103
|
+
<Admonition type="warning" title="New version found">
|
|
104
|
+
<p>
|
|
105
|
+
You are looking at a previous version of the {singularResourceName} doc <strong>{title}</strong>.{' '}
|
|
106
|
+
<a class="underline block pt-2" href={buildUrl(`${docsBasePath}/${props.data.latestVersion}`)}>
|
|
107
|
+
The latest version of this doc is <span>v{props.data.latestVersion}</span> →
|
|
108
|
+
</a>
|
|
109
|
+
</p>
|
|
110
|
+
</Admonition>
|
|
129
111
|
)
|
|
130
112
|
}
|
|
131
113
|
</div>
|