@eventcatalog/core 3.36.5 → 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-J3ZV5QI5.js → chunk-3N5OG33R.js} +1 -1
- package/dist/{chunk-VDTDZ4XR.js → chunk-6UFDH5SD.js} +1 -1
- package/dist/{chunk-TGSOUKM7.js → chunk-C24AACHY.js} +1 -1
- package/dist/{chunk-2WL2AHTJ.js → chunk-G6DWKVUO.js} +1 -1
- package/dist/{chunk-CZV4WMQ2.js → chunk-R6AVEQA4.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- 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/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 +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-3N5OG33R.js";
|
|
4
|
+
import "../chunk-6UFDH5SD.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-C24AACHY.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
114
114
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
115
115
|
|
|
116
116
|
// package.json
|
|
117
|
-
var version = "3.
|
|
117
|
+
var version = "3.37.0";
|
|
118
118
|
|
|
119
119
|
// src/constants.ts
|
|
120
120
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from "./chunk-K3ZVEX2Y.js";
|
|
14
14
|
import {
|
|
15
15
|
log_build_default
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-3N5OG33R.js";
|
|
17
|
+
import "./chunk-6UFDH5SD.js";
|
|
18
18
|
import "./chunk-4UVFXLPI.js";
|
|
19
19
|
import {
|
|
20
20
|
catalogToAstro
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
} from "./chunk-ULZYHF3V.js";
|
|
29
29
|
import {
|
|
30
30
|
generate
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-R6AVEQA4.js";
|
|
32
32
|
import {
|
|
33
33
|
logger
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-G6DWKVUO.js";
|
|
35
35
|
import {
|
|
36
36
|
VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-C24AACHY.js";
|
|
38
38
|
import {
|
|
39
39
|
getEventCatalogConfigFile,
|
|
40
40
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-R6AVEQA4.js";
|
|
4
|
+
import "./chunk-G6DWKVUO.js";
|
|
5
|
+
import "./chunk-C24AACHY.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -2,6 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { SearchX, Copy, Check, AlertTriangle } from 'lucide-react';
|
|
3
3
|
import { BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/solid';
|
|
4
4
|
import { buildUrl } from '@utils/url-builder';
|
|
5
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
5
6
|
|
|
6
7
|
export interface FieldResult {
|
|
7
8
|
path: string;
|
|
@@ -28,13 +29,6 @@ export interface FieldsTableProps {
|
|
|
28
29
|
isScaleEnabled?: boolean;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const colorClasses: Record<string, string> = {
|
|
32
|
-
orange: 'text-orange-500',
|
|
33
|
-
blue: 'text-blue-500',
|
|
34
|
-
green: 'text-green-500',
|
|
35
|
-
gray: 'text-gray-500',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
32
|
const getColorAndIconForMessageType = (type: string) => {
|
|
39
33
|
switch (type) {
|
|
40
34
|
case 'event':
|
|
@@ -58,7 +52,7 @@ function MessageBadge({ id, name, version, type }: { id: string; name?: string;
|
|
|
58
52
|
onClick={(e) => e.stopPropagation()}
|
|
59
53
|
className="group/msg inline-flex items-center gap-1.5 text-[0.8rem] text-[rgb(var(--ec-page-text-muted))] hover:text-[rgb(var(--ec-accent))] transition-colors"
|
|
60
54
|
>
|
|
61
|
-
<Icon className={`h-3.5 w-3.5 ${
|
|
55
|
+
<Icon className={`h-3.5 w-3.5 ${getCollectionTextColorClass(color)} flex-shrink-0`} />
|
|
62
56
|
<span className="truncate max-w-[160px] text-[rgb(var(--ec-page-text-muted))] group-hover/msg:text-[rgb(var(--ec-accent))]">
|
|
63
57
|
{name || id}
|
|
64
58
|
</span>
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type AdmonitionType = 'danger' | 'alert' | 'warning' | 'info' | 'note';
|
|
1
|
+
type AdmonitionType = 'danger' | 'alert' | 'warning' | 'info' | 'note' | 'tip';
|
|
4
2
|
|
|
5
3
|
interface AdmonitionConfig {
|
|
6
|
-
|
|
4
|
+
iconPath: string;
|
|
7
5
|
title: string;
|
|
8
6
|
containerClasses: string;
|
|
9
|
-
|
|
10
|
-
titleClasses: string;
|
|
11
|
-
contentClasses: string;
|
|
7
|
+
accentClasses: string;
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
const getConfigurationByType = (type: string): AdmonitionConfig => {
|
|
@@ -16,39 +12,38 @@ const getConfigurationByType = (type: string): AdmonitionConfig => {
|
|
|
16
12
|
case 'danger':
|
|
17
13
|
case 'alert':
|
|
18
14
|
return {
|
|
19
|
-
|
|
15
|
+
iconPath: 'M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86L7.86 2z M12 8v4 M12 16h.01',
|
|
20
16
|
title: type === 'danger' ? 'Danger' : 'Alert',
|
|
21
|
-
containerClasses: 'bg-red-50 dark:bg-red-950/
|
|
22
|
-
|
|
23
|
-
titleClasses: 'text-red-600 dark:text-red-300',
|
|
24
|
-
contentClasses: 'text-red-700 dark:text-red-200',
|
|
17
|
+
containerClasses: 'bg-red-50/60 dark:bg-red-950/30 border border-red-200/70 dark:border-red-900/60',
|
|
18
|
+
accentClasses: 'text-red-700 dark:text-red-300',
|
|
25
19
|
};
|
|
26
20
|
case 'warning':
|
|
27
21
|
return {
|
|
28
|
-
|
|
22
|
+
iconPath: 'M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4 M12 17h.01',
|
|
29
23
|
title: 'Warning',
|
|
30
|
-
containerClasses: 'bg-
|
|
31
|
-
|
|
32
|
-
titleClasses: 'text-yellow-600 dark:text-yellow-300',
|
|
33
|
-
contentClasses: 'text-yellow-700 dark:text-yellow-200',
|
|
24
|
+
containerClasses: 'bg-amber-50/60 dark:bg-amber-950/30 border border-amber-200/70 dark:border-amber-900/60',
|
|
25
|
+
accentClasses: 'text-amber-700 dark:text-amber-300',
|
|
34
26
|
};
|
|
35
27
|
case 'note':
|
|
36
28
|
return {
|
|
37
|
-
|
|
29
|
+
iconPath: 'M12 20h9 M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4 12.5-12.5z',
|
|
38
30
|
title: 'Note',
|
|
39
|
-
containerClasses: 'bg-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
containerClasses: 'bg-slate-50/70 dark:bg-slate-900/40 border border-slate-200/70 dark:border-slate-700/60',
|
|
32
|
+
accentClasses: 'text-slate-600 dark:text-slate-300',
|
|
33
|
+
};
|
|
34
|
+
case 'tip':
|
|
35
|
+
return {
|
|
36
|
+
iconPath: 'M9 18h6 M10 22h4 M12 2a7 7 0 0 0-4 12.74V17h8v-2.26A7 7 0 0 0 12 2z',
|
|
37
|
+
title: 'Tip',
|
|
38
|
+
containerClasses: 'bg-emerald-50/60 dark:bg-emerald-900/40 border border-emerald-200/70 dark:border-emerald-700/80',
|
|
39
|
+
accentClasses: 'text-emerald-700 dark:text-emerald-300',
|
|
43
40
|
};
|
|
44
41
|
default:
|
|
45
42
|
return {
|
|
46
|
-
|
|
43
|
+
iconPath: 'M12 2a10 10 0 100 20 10 10 0 000-20zM12 8h.01M11 12h1v4h1',
|
|
47
44
|
title: 'Info',
|
|
48
|
-
containerClasses: 'bg-
|
|
49
|
-
|
|
50
|
-
titleClasses: 'text-indigo-600 dark:text-indigo-300',
|
|
51
|
-
contentClasses: 'text-indigo-700 dark:text-indigo-200',
|
|
45
|
+
containerClasses: 'bg-blue-50/60 dark:bg-blue-950/30 border border-blue-200/70 dark:border-blue-900/60',
|
|
46
|
+
accentClasses: 'text-blue-700 dark:text-blue-300',
|
|
52
47
|
};
|
|
53
48
|
}
|
|
54
49
|
};
|
|
@@ -62,16 +57,31 @@ interface AdmonitionProps {
|
|
|
62
57
|
|
|
63
58
|
export default function Admonition({ children, type = 'info', className = '', title }: AdmonitionProps) {
|
|
64
59
|
const config = getConfigurationByType(type);
|
|
65
|
-
const Icon = config.icon;
|
|
66
60
|
|
|
67
61
|
return (
|
|
68
|
-
<div
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
<div
|
|
63
|
+
className={`ec-admonition ${config.containerClasses} rounded-md px-3 py-2.5 my-4 text-[0.85rem] leading-relaxed not-prose ${className}`}
|
|
64
|
+
>
|
|
65
|
+
<div className={`flex items-center gap-1.5 mb-1 ${config.accentClasses}`}>
|
|
66
|
+
<svg
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
68
|
+
width="14"
|
|
69
|
+
height="14"
|
|
70
|
+
viewBox="0 0 24 24"
|
|
71
|
+
fill="none"
|
|
72
|
+
stroke="currentColor"
|
|
73
|
+
strokeWidth="2.25"
|
|
74
|
+
strokeLinecap="round"
|
|
75
|
+
strokeLinejoin="round"
|
|
76
|
+
className="lucide shrink-0"
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
>
|
|
79
|
+
<path d={config.iconPath} />
|
|
80
|
+
</svg>
|
|
81
|
+
<span className="text-[0.7rem] font-semibold uppercase tracking-wider">{title || config.title}</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="prose prose-sm dark:prose-invert w-full max-w-none! prose-p:my-0.5 prose-p:text-inherit prose-p:text-[0.85rem] prose-p:leading-relaxed prose-code:text-[0.8rem]">
|
|
84
|
+
{children}
|
|
75
85
|
</div>
|
|
76
86
|
</div>
|
|
77
87
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
2
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
2
3
|
import { buildUrl } from '@utils/url-builder';
|
|
3
4
|
import { useState, useMemo, useCallback, memo } from 'react';
|
|
4
5
|
|
|
@@ -37,7 +38,7 @@ const MessageRow = memo(
|
|
|
37
38
|
<td className="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-[rgb(var(--ec-page-text))] sm:pl-6 relative">
|
|
38
39
|
<a href={url} className="absolute inset-0 z-10" aria-label={`View details for ${message.name}`} />
|
|
39
40
|
<div className="flex items-center gap-2 relative">
|
|
40
|
-
<Icon className={`h-5 w-5
|
|
41
|
+
<Icon className={`h-5 w-5 ${getCollectionTextColorClass(color)}`} />
|
|
41
42
|
<span className="group-hover:text-blue-600 break-all">{message.name}</span>
|
|
42
43
|
</div>
|
|
43
44
|
</td>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getColorAndIconForCollection } from '@utils/collections/icons';
|
|
2
|
+
import { getCollectionTextColorClass } from '@utils/collection-colors';
|
|
2
3
|
import { buildUrl } from '@utils/url-builder';
|
|
3
4
|
import { useState, useMemo, useCallback, memo } from 'react';
|
|
4
5
|
|
|
@@ -41,7 +42,7 @@ const ResourceRow = memo(
|
|
|
41
42
|
<td className="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-[rgb(var(--ec-page-text))] sm:pl-6 relative">
|
|
42
43
|
<a href={url} className="absolute inset-0 z-10" aria-label={`View details for ${resource.name}`} />
|
|
43
44
|
<div className="flex items-center gap-2 relative">
|
|
44
|
-
<Icon className={`h-5 w-5
|
|
45
|
+
<Icon className={`h-5 w-5 ${getCollectionTextColorClass(color)}`} />
|
|
45
46
|
<span className="group-hover:text-[rgb(var(--ec-accent))] break-all">{resource.name}</span>
|
|
46
47
|
</div>
|
|
47
48
|
</td>
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import { buildUrl } from '@utils/url-builder';
|
|
3
3
|
import { getItemsFromCollectionByIdAndSemverOrLatest, resourceToCollectionMap } from '@utils/collections/util';
|
|
4
4
|
import { getCollection } from 'astro:content';
|
|
5
|
+
import { getResourceReferenceStyle } from '@utils/resource-reference-colors';
|
|
5
6
|
|
|
6
7
|
const { id, version, type } = Astro.props;
|
|
7
8
|
const collection = resourceToCollectionMap[type as keyof typeof resourceToCollectionMap];
|
|
9
|
+
const resourceReferenceStyle = getResourceReferenceStyle(type);
|
|
8
10
|
|
|
9
11
|
let slotHTML = await Astro.slots.render('default');
|
|
10
12
|
let href = '#';
|
|
@@ -43,7 +45,11 @@ try {
|
|
|
43
45
|
|
|
44
46
|
{
|
|
45
47
|
!linkHasError && (
|
|
46
|
-
<a
|
|
48
|
+
<a
|
|
49
|
+
href={href}
|
|
50
|
+
class="rounded px-1 -mx-1 text-[var(--ec-resource-ref-color)] hover:bg-[var(--ec-resource-ref-bg)] transition-colors"
|
|
51
|
+
style={resourceReferenceStyle}
|
|
52
|
+
>
|
|
47
53
|
{slotHTML}
|
|
48
54
|
</a>
|
|
49
55
|
)
|
|
@@ -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))]';
|