@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3N5OG33R.js";
|
|
4
|
+
import "../chunk-6UFDH5SD.js";
|
|
4
5
|
import "../chunk-4UVFXLPI.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-NV7DNZ3X.js";
|
|
6
|
+
import "../chunk-C24AACHY.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
raiseEvent
|
|
3
|
+
} from "./chunk-6UFDH5SD.js";
|
|
1
4
|
import {
|
|
2
5
|
countResources,
|
|
3
6
|
serializeCounts
|
|
4
7
|
} from "./chunk-4UVFXLPI.js";
|
|
5
|
-
import {
|
|
6
|
-
raiseEvent
|
|
7
|
-
} from "./chunk-HF27CRFY.js";
|
|
8
8
|
import {
|
|
9
9
|
getEventCatalogConfigFile,
|
|
10
10
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
|
@@ -36,6 +36,10 @@ This is my custom documentation page, here is a NodeGraph:
|
|
|
36
36
|
Rest of my markdown content...
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
:::note Required props
|
|
40
|
+
In custom documentation pages, `id`, `version`, and `type` are all required. A `<NodeGraph />` missing any of these props is silently ignored.
|
|
41
|
+
:::
|
|
42
|
+
|
|
39
43
|
#### NodeGraph props
|
|
40
44
|
|
|
41
45
|
| Prop | Type | Required | Description |
|
|
@@ -43,4 +47,7 @@ Rest of my markdown content...
|
|
|
43
47
|
| `id` | string | Yes | The id of the resource (domain, service, or message) |
|
|
44
48
|
| `version` | string | Yes | The version of the resource |
|
|
45
49
|
| `type` | string | Yes | The type of the resource (domain, service, command, event, query) |
|
|
50
|
+
| `search` | boolean | No | Show or hide the search bar. Accepts `true`/`false` or `"true"`/`"false"`. Defaults to `true`. |
|
|
51
|
+
| `legend` | boolean | No | Show or hide the legend. Accepts `true`/`false` or `"true"`/`"false"`. Defaults to `true`. |
|
|
52
|
+
| `mode` | string | No | `"simple"` or `"full"`. Defaults to `"simple"`. |
|
|
46
53
|
|
|
@@ -14,20 +14,29 @@ Embed flows into your pages.
|
|
|
14
14
|
**Example**
|
|
15
15
|
|
|
16
16
|
```jsx /domains/MyDomain/index.mdx
|
|
17
|
-
<Flow id="CancelSubscription" version="latest"
|
|
17
|
+
<Flow id="CancelSubscription" version="latest" legend={false} />
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
### Output
|
|
21
21
|

|
|
22
22
|
|
|
23
23
|
### Props
|
|
24
|
+
|
|
25
|
+
<AddedIn version="3.36.3" />
|
|
26
|
+
|
|
24
27
|
| Name | Type | Default | Description |
|
|
25
28
|
| ----------------------- | --------- | ----------------- | ----------------------------------------------------------------- |
|
|
26
29
|
| `id` (required) | `string` | (empty) | Flow id to render in your page |
|
|
27
|
-
| `version` (optional) | `string` | "latest" | Version of the flow to render. Supports exact version and semver versions (e.g 1.0.x, ^1.3.5, latest)|
|
|
28
|
-
| `
|
|
29
|
-
| `search` (optional) | `boolean` |
|
|
30
|
-
| `
|
|
30
|
+
| `version` (optional) | `string` | `"latest"` | Version of the flow to render. Supports exact version and semver versions (e.g 1.0.x, ^1.3.5, latest)|
|
|
31
|
+
| `legend` (optional) | `boolean` | `true` | Show or hide the diagram key. Accepts `true`/`false` or `"true"`/`"false"`. `includeKey` is still accepted as an alias. |
|
|
32
|
+
| `search` (optional) | `boolean` | `false` | Show or hide the search bar in the flow. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
33
|
+
| `walkthrough` (optional) | `boolean` | `false` | Show or hide the step walkthrough controls. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
34
|
+
| `mode` (optional) | `string` ("simple" or "full") | `"simple"` | `simple` renders the flow in a simplified view without descriptions. `full` renders descriptions and other information.|
|
|
35
|
+
|
|
36
|
+
:::tip Multiple embeds per page
|
|
37
|
+
You can embed multiple `<Flow />` components on the same page and each one renders independently.
|
|
38
|
+
:::
|
|
39
|
+
|
|
31
40
|
|
|
32
41
|
## Interactive controls
|
|
33
42
|
|
|
@@ -25,12 +25,15 @@ The `<NodeGraph/>` component is supported in domains, services, and all messages
|
|
|
25
25
|

|
|
26
26
|
|
|
27
27
|
#### Props
|
|
28
|
+
|
|
29
|
+
<AddedIn version="3.36.3" />
|
|
30
|
+
|
|
28
31
|
| Name | Type | Default | Description |
|
|
29
32
|
| ----------------------- | --------- | ----------------- | ----------------------------------------------------------------- |
|
|
30
|
-
| `maxHeight` (optional) | `string` | 30 | Max height to set the nodegraph in your document|
|
|
31
|
-
| `search` (optional) | `boolean` | true | Show or hide the search bar
|
|
32
|
-
| `legend` (optional) | `boolean` | true | Show or hide the legend
|
|
33
|
-
| `mode` (optional) | `string` ("simple" or "full") | "simple" | `simple`
|
|
33
|
+
| `maxHeight` (optional) | `string` | `30` | Max height to set the nodegraph in your document|
|
|
34
|
+
| `search` (optional) | `boolean` | `true` | Show or hide the search bar. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
35
|
+
| `legend` (optional) | `boolean` | `true` | Show or hide the legend. Accepts `true`/`false` or `"true"`/`"false"`. |
|
|
36
|
+
| `mode` (optional) | `string` ("simple" or "full") | `"simple"` | `simple` renders a simplified view without descriptions. `full` renders descriptions and other information.|
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
## Interactive controls
|
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
2
|
+
runMigrations
|
|
3
|
+
} from "./chunk-XUAF2H54.js";
|
|
4
|
+
import "./chunk-CA4U2JP7.js";
|
|
5
5
|
import {
|
|
6
6
|
resolve_catalog_dependencies_default
|
|
7
7
|
} from "./chunk-WAJIJEI3.js";
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
watch
|
|
13
13
|
} from "./chunk-K3ZVEX2Y.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
15
|
+
log_build_default
|
|
16
|
+
} from "./chunk-3N5OG33R.js";
|
|
17
|
+
import "./chunk-6UFDH5SD.js";
|
|
18
|
+
import "./chunk-4UVFXLPI.js";
|
|
19
19
|
import {
|
|
20
20
|
catalogToAstro
|
|
21
21
|
} from "./chunk-YDXB3BD2.js";
|
|
@@ -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
|
)
|