@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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type CollectionColor =
|
|
2
|
+
| 'orange'
|
|
3
|
+
| 'blue'
|
|
4
|
+
| 'green'
|
|
5
|
+
| 'pink'
|
|
6
|
+
| 'yellow'
|
|
7
|
+
| 'teal'
|
|
8
|
+
| 'purple'
|
|
9
|
+
| 'red'
|
|
10
|
+
| 'gray'
|
|
11
|
+
| 'cyan'
|
|
12
|
+
| 'indigo';
|
|
13
|
+
|
|
14
|
+
export const getColorForCollection = (collection: string): CollectionColor => {
|
|
15
|
+
switch (collection) {
|
|
16
|
+
case 'events':
|
|
17
|
+
return 'orange';
|
|
18
|
+
case 'commands':
|
|
19
|
+
return 'blue';
|
|
20
|
+
case 'queries':
|
|
21
|
+
return 'green';
|
|
22
|
+
case 'flows':
|
|
23
|
+
return 'teal';
|
|
24
|
+
case 'teams':
|
|
25
|
+
return 'gray';
|
|
26
|
+
case 'users':
|
|
27
|
+
return 'gray';
|
|
28
|
+
case 'channels':
|
|
29
|
+
return 'purple';
|
|
30
|
+
case 'ubiquitousLanguages':
|
|
31
|
+
return 'green';
|
|
32
|
+
case 'entities':
|
|
33
|
+
return 'purple';
|
|
34
|
+
case 'domains':
|
|
35
|
+
return 'yellow';
|
|
36
|
+
case 'services':
|
|
37
|
+
return 'pink';
|
|
38
|
+
case 'data-products':
|
|
39
|
+
return 'cyan';
|
|
40
|
+
case 'containers':
|
|
41
|
+
return 'indigo';
|
|
42
|
+
default:
|
|
43
|
+
return 'gray';
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const tailwind500RgbByColor: Record<CollectionColor, string> = {
|
|
48
|
+
orange: '249 115 22',
|
|
49
|
+
blue: '59 130 246',
|
|
50
|
+
green: '34 197 94',
|
|
51
|
+
pink: '236 72 153',
|
|
52
|
+
yellow: '234 179 8',
|
|
53
|
+
teal: '20 184 166',
|
|
54
|
+
purple: '168 85 247',
|
|
55
|
+
red: '239 68 68',
|
|
56
|
+
gray: '107 114 128',
|
|
57
|
+
cyan: '6 182 212',
|
|
58
|
+
indigo: '99 102 241',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const collectionTextColorClassByColor: Record<CollectionColor, string> = {
|
|
62
|
+
orange: 'text-orange-500',
|
|
63
|
+
blue: 'text-blue-500',
|
|
64
|
+
green: 'text-green-500',
|
|
65
|
+
pink: 'text-pink-500',
|
|
66
|
+
yellow: 'text-yellow-500',
|
|
67
|
+
teal: 'text-teal-500',
|
|
68
|
+
purple: 'text-purple-500',
|
|
69
|
+
red: 'text-red-500',
|
|
70
|
+
gray: 'text-gray-500',
|
|
71
|
+
cyan: 'text-cyan-500',
|
|
72
|
+
indigo: 'text-indigo-500',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const getCollectionTextColorClass = (color: string, fallback = 'text-gray-500'): string =>
|
|
76
|
+
collectionTextColorClassByColor[color as CollectionColor] || fallback;
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
CubeIcon,
|
|
14
14
|
} from '@heroicons/react/24/outline';
|
|
15
15
|
import { BookText, Box, DatabaseIcon } from 'lucide-react';
|
|
16
|
+
import { getColorForCollection } from '@utils/collection-colors';
|
|
16
17
|
|
|
17
18
|
export const getIconForCollection = (collection: string) => {
|
|
18
19
|
switch (collection) {
|
|
@@ -53,33 +54,5 @@ export const getIconForCollection = (collection: string) => {
|
|
|
53
54
|
|
|
54
55
|
export const getColorAndIconForCollection = (collection: string) => {
|
|
55
56
|
const icon = getIconForCollection(collection);
|
|
56
|
-
|
|
57
|
-
switch (collection) {
|
|
58
|
-
case 'events':
|
|
59
|
-
return { color: 'orange', Icon: icon };
|
|
60
|
-
case 'commands':
|
|
61
|
-
return { color: 'blue', Icon: icon };
|
|
62
|
-
case 'queries':
|
|
63
|
-
return { color: 'green', Icon: icon };
|
|
64
|
-
case 'flows':
|
|
65
|
-
return { color: 'teal', Icon: icon };
|
|
66
|
-
case 'teams':
|
|
67
|
-
return { color: 'red', Icon: icon };
|
|
68
|
-
case 'users':
|
|
69
|
-
return { color: 'gray', Icon: icon };
|
|
70
|
-
case 'channels':
|
|
71
|
-
return { color: 'purple', Icon: icon };
|
|
72
|
-
case 'ubiquitousLanguages':
|
|
73
|
-
return { color: 'green', Icon: icon };
|
|
74
|
-
case 'entities':
|
|
75
|
-
return { color: 'purple', Icon: icon };
|
|
76
|
-
case 'domains':
|
|
77
|
-
return { color: 'yellow', Icon: icon };
|
|
78
|
-
case 'services':
|
|
79
|
-
return { color: 'pink', Icon: icon };
|
|
80
|
-
case 'data-products':
|
|
81
|
-
return { color: 'cyan', Icon: icon };
|
|
82
|
-
default:
|
|
83
|
-
return { color: 'gray', Icon: icon };
|
|
84
|
-
}
|
|
57
|
+
return { color: getColorForCollection(collection), Icon: icon };
|
|
85
58
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getColorForCollection, tailwind500RgbByColor, type CollectionColor } from './collection-colors';
|
|
2
|
+
import { resourceToCollectionMap } from './collections/util';
|
|
3
|
+
|
|
4
|
+
export type ResourceReferenceType =
|
|
5
|
+
| 'entity'
|
|
6
|
+
| 'service'
|
|
7
|
+
| 'event'
|
|
8
|
+
| 'command'
|
|
9
|
+
| 'query'
|
|
10
|
+
| 'domain'
|
|
11
|
+
| 'flow'
|
|
12
|
+
| 'channel'
|
|
13
|
+
| 'diagram'
|
|
14
|
+
| 'container'
|
|
15
|
+
| 'user'
|
|
16
|
+
| 'team'
|
|
17
|
+
| 'doc'
|
|
18
|
+
| 'data-product';
|
|
19
|
+
|
|
20
|
+
const resourceTypeToCollection = {
|
|
21
|
+
...resourceToCollectionMap,
|
|
22
|
+
doc: 'customPages',
|
|
23
|
+
} as Record<ResourceReferenceType, string>;
|
|
24
|
+
|
|
25
|
+
export const getResourceReferenceColorName = (type: string): CollectionColor => {
|
|
26
|
+
const collection = resourceTypeToCollection[type as ResourceReferenceType] || '';
|
|
27
|
+
return getColorForCollection(collection);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const getResourceReferenceStyle = (type: string): string => {
|
|
31
|
+
if (type === 'doc') {
|
|
32
|
+
return [
|
|
33
|
+
'--ec-resource-ref-bg: rgb(var(--ec-accent) / 0.12)',
|
|
34
|
+
'--ec-resource-ref-color: rgb(var(--ec-accent))',
|
|
35
|
+
'color: var(--ec-resource-ref-color)',
|
|
36
|
+
'text-decoration-color: var(--ec-resource-ref-color)',
|
|
37
|
+
].join('; ');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const color = getResourceReferenceColorName(type);
|
|
41
|
+
const rgb = tailwind500RgbByColor[color];
|
|
42
|
+
|
|
43
|
+
return [
|
|
44
|
+
`--ec-resource-ref-bg: rgb(${rgb} / 0.12)`,
|
|
45
|
+
`--ec-resource-ref-color: rgb(${rgb})`,
|
|
46
|
+
'color: var(--ec-resource-ref-color)',
|
|
47
|
+
'text-decoration-color: var(--ec-resource-ref-color)',
|
|
48
|
+
].join('; ');
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.37.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"zod": "^4.3.6",
|
|
109
109
|
"@eventcatalog/linter": "1.0.23",
|
|
110
110
|
"@eventcatalog/sdk": "2.21.1",
|
|
111
|
-
"@eventcatalog/visualiser": "^3.
|
|
111
|
+
"@eventcatalog/visualiser": "^3.21.0"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@astrojs/check": "^0.9.9",
|