@eventcatalog/core 3.15.3 → 3.15.5

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 (27) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-7QZA7SNX.js → chunk-5UYAVUK5.js} +1 -1
  6. package/dist/{chunk-UMQ25VGC.js → chunk-FQ6YAAP5.js} +1 -1
  7. package/dist/{chunk-J4ZZS52N.js → chunk-POPPIA45.js} +1 -1
  8. package/dist/{chunk-RT62GNSH.js → chunk-UEW5NL62.js} +1 -1
  9. package/dist/{chunk-6OV5C75V.js → chunk-V4O7URWJ.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.js +5 -5
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +69 -20
  19. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/components/NestedItem.tsx +8 -33
  20. package/eventcatalog/src/enterprise/custom-documentation/components/CustomDocsNav/index.tsx +87 -93
  21. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +9 -6
  22. package/eventcatalog/src/enterprise/custom-documentation/utils/badge-styles.ts +51 -0
  23. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +16 -0
  24. package/eventcatalog/src/pages/docs/custom/feature.astro +15 -15
  25. package/eventcatalog/src/pages/visualiser/domain-integrations/index.astro +0 -5
  26. package/eventcatalog/src/remark-plugins/resource-ref.ts +18 -4
  27. package/package.json +3 -3
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "3.15.3";
40
+ var version = "3.15.5";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-J4ZZS52N.js";
4
- import "../chunk-RT62GNSH.js";
3
+ } from "../chunk-POPPIA45.js";
4
+ import "../chunk-UEW5NL62.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.15.3";
114
+ var version = "3.15.5";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-UMQ25VGC.js";
4
- import "../chunk-J4ZZS52N.js";
3
+ } from "../chunk-FQ6YAAP5.js";
4
+ import "../chunk-POPPIA45.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-RT62GNSH.js";
6
+ import "../chunk-UEW5NL62.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-6OV5C75V.js";
3
+ } from "./chunk-V4O7URWJ.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-J4ZZS52N.js";
3
+ } from "./chunk-POPPIA45.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-RT62GNSH.js";
3
+ } from "./chunk-UEW5NL62.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.15.3";
2
+ var version = "3.15.5";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-RT62GNSH.js";
3
+ } from "./chunk-UEW5NL62.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.15.3";
28
+ var version = "3.15.5";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-RT62GNSH.js";
3
+ } from "./chunk-UEW5NL62.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -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.15.3";
117
+ var version = "3.15.5";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-UMQ25VGC.js";
10
- import "./chunk-J4ZZS52N.js";
9
+ } from "./chunk-FQ6YAAP5.js";
10
+ import "./chunk-POPPIA45.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-3KXCGYET.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-7QZA7SNX.js";
25
+ } from "./chunk-5UYAVUK5.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-6OV5C75V.js";
28
+ } from "./chunk-V4O7URWJ.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-RT62GNSH.js";
31
+ } from "./chunk-UEW5NL62.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.15.3";
81
+ var version = "3.15.5";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-7QZA7SNX.js";
4
- import "./chunk-6OV5C75V.js";
5
- import "./chunk-RT62GNSH.js";
3
+ } from "./chunk-5UYAVUK5.js";
4
+ import "./chunk-V4O7URWJ.js";
5
+ import "./chunk-UEW5NL62.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.15.3";
39
+ var version = "3.15.5";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-6OV5C75V.js";
4
- import "../chunk-RT62GNSH.js";
3
+ } from "../chunk-V4O7URWJ.js";
4
+ import "../chunk-UEW5NL62.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -28,7 +28,8 @@ interface Props {
28
28
  | 'diagram'
29
29
  | 'container'
30
30
  | 'user'
31
- | 'team';
31
+ | 'team'
32
+ | 'doc';
32
33
  version?: string;
33
34
  }
34
35
 
@@ -38,6 +39,20 @@ const { type = 'entity', version } = Astro.props;
38
39
  const slotContent = await Astro.slots.render('default');
39
40
  const resourceId = slotContent.trim();
40
41
 
42
+ const normalizeCustomDocPath = (value: string): string => {
43
+ const normalized = value
44
+ .trim()
45
+ .replace(/^https?:\/\/[^/]+/i, '')
46
+ .replace(/\\/g, '/');
47
+ return normalized
48
+ .replace(/^\/+/, '')
49
+ .replace(/^docs\/custom\//i, '')
50
+ .replace(/^docs\//i, '')
51
+ .replace(/\/+$/, '');
52
+ };
53
+
54
+ const normalizedResourceId = normalizeCustomDocPath(resourceId).toLowerCase();
55
+
41
56
  // Map type to collection name
42
57
  const collection = resourceToCollectionMap[type as keyof typeof resourceToCollectionMap];
43
58
 
@@ -56,6 +71,7 @@ const typeStyles: Record<string, { borderColor: string; label: string }> = {
56
71
  container: { borderColor: 'var(--ec-badge-default-text)', label: 'Container' }, // gray
57
72
  user: { borderColor: 'var(--ec-badge-default-text)', label: 'User' }, // gray
58
73
  team: { borderColor: 'var(--ec-badge-default-text)', label: 'Team' }, // gray
74
+ doc: { borderColor: 'var(--ec-badge-default-text)', label: 'Doc' }, // gray
59
75
  };
60
76
 
61
77
  // SVG icons for each type (from heroicons outline)
@@ -81,6 +97,7 @@ const typeIcons: Record<string, string> = {
81
97
  '<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
82
98
  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
83
99
  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="M19.5 14.25v-8.25a2.25 2.25 0 00-2.25-2.25h-10.5A2.25 2.25 0 004.5 6v12a2.25 2.25 0 002.25 2.25h5.25M16.5 18.75h6m-3-3v6" />', // Document with plus
84
101
  };
85
102
 
86
103
  const style = typeStyles[type] || typeStyles.entity;
@@ -92,23 +109,51 @@ let hasError = false;
92
109
  let errorMessage = '';
93
110
 
94
111
  try {
95
- if (!collection) {
96
- throw new Error(`Unknown resource type: ${type}`);
97
- }
112
+ if (type === 'doc') {
113
+ const docs = (await getCollection('customPages')) as {
114
+ id: string;
115
+ data: { title?: string; summary?: string; slug?: string; owners?: any[] };
116
+ }[];
98
117
 
99
- const resourcesCollection = (await getCollection(collection as any)) as { data: { id: string; version: string } }[];
100
- const resources = getItemsFromCollectionByIdAndSemverOrLatest(resourcesCollection, resourceId, version);
118
+ const doc = docs.find((entry) => {
119
+ const normalizedId = normalizeCustomDocPath(entry.id).toLowerCase();
120
+ const normalizedSlug = normalizeCustomDocPath(entry.data.slug || '').toLowerCase();
101
121
 
102
- if (resources.length === 0) {
103
- throw new Error(`Resource not found: ${resourceId}`);
104
- }
122
+ return normalizedId === normalizedResourceId || normalizedSlug === normalizedResourceId;
123
+ });
124
+
125
+ if (!doc) {
126
+ throw new Error(`Document not found: ${resourceId}`);
127
+ }
128
+
129
+ const docSlug = normalizeCustomDocPath(doc.data.slug || doc.id);
130
+ href = buildUrl(`/docs/custom/${docSlug}`);
131
+ resource = {
132
+ ...doc,
133
+ data: {
134
+ ...doc.data,
135
+ name: doc.data.title || docSlug,
136
+ },
137
+ };
138
+ } else {
139
+ if (!collection) {
140
+ throw new Error(`Unknown resource type: ${type}`);
141
+ }
142
+
143
+ const resourcesCollection = (await getCollection(collection as any)) as { data: { id: string; version: string } }[];
144
+ const resources = getItemsFromCollectionByIdAndSemverOrLatest(resourcesCollection, resourceId, version);
105
145
 
106
- resource = resources[0];
107
- // Diagrams use /diagrams/ path, other resources use /docs/{collection}/
108
- href =
109
- type === 'diagram'
110
- ? buildUrl(`/diagrams/${resourceId}/${resource.data.version}`)
111
- : buildUrl(`/docs/${collection}/${resourceId}/${resource.data.version}`);
146
+ if (resources.length === 0) {
147
+ throw new Error(`Resource not found: ${resourceId}`);
148
+ }
149
+
150
+ resource = resources[0];
151
+ // Diagrams use /diagrams/ path, other resources use /docs/{collection}/
152
+ href =
153
+ type === 'diagram'
154
+ ? buildUrl(`/diagrams/${resourceId}/${resource.data.version}`)
155
+ : buildUrl(`/docs/${collection}/${resourceId}/${resource.data.version}`);
156
+ }
112
157
  } catch (error) {
113
158
  hasError = true;
114
159
  errorMessage = error instanceof Error ? error.message : 'Unknown error';
@@ -119,6 +164,8 @@ const maxSummaryLength = 120;
119
164
  const summary = resource?.data?.summary || '';
120
165
  const truncatedSummary = summary.length > maxSummaryLength ? summary.slice(0, maxSummaryLength) + '...' : summary;
121
166
 
167
+ const isVersionedResource = type !== 'doc';
168
+
122
169
  // Only these types have visualizers
123
170
  const hasVisualizer = ['domain', 'service', 'event', 'query', 'command', 'container'].includes(type);
124
171
 
@@ -192,7 +239,7 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
192
239
  hasError ? (
193
240
  <span
194
241
  class="text-[rgb(var(--ec-page-text-muted))] underline decoration-wavy decoration-red-400/50 underline-offset-2 cursor-help"
195
- title={`Resource not found: ${resourceId}`}
242
+ title={`Reference not found: ${resourceId}`}
196
243
  >
197
244
  {resourceId}
198
245
  </span>
@@ -240,9 +287,11 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
240
287
  </span>
241
288
  <span class="text-[0.65rem] text-[rgb(var(--ec-page-text-muted))] uppercase tracking-wide">{style.label}</span>
242
289
  </span>
243
- <span class="text-[0.7rem] font-mono text-[rgb(var(--ec-page-text-muted))] mt-0.5">
244
- v{resource?.data?.version}
245
- </span>
290
+ {isVersionedResource && (
291
+ <span class="text-[0.7rem] font-mono text-[rgb(var(--ec-page-text-muted))] mt-0.5">
292
+ v{resource?.data?.version}
293
+ </span>
294
+ )}
246
295
  </span>
247
296
  <svg
248
297
  class="w-5 h-5 flex-shrink-0"
@@ -392,7 +441,7 @@ const tooltipId = `ref-tooltip-${Math.random().toString(36).slice(2, 9)}`;
392
441
  )}
393
442
  </span>
394
443
  <a href={href} class="text-[rgb(var(--ec-accent))] hover:underline font-medium">
395
- {type === 'diagram' ? 'View diagram' : 'View docs'}
444
+ {type === 'diagram' ? 'View diagram' : type === 'doc' ? 'View doc' : 'View docs'}
396
445
  </a>
397
446
  </span>
398
447
  </span>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { buildUrl } from '@utils/url-builder';
3
3
  import type { SidebarItem } from '../types';
4
4
  import { ExternalLinkIcon } from 'lucide-react';
5
+ import { getCustomDocsSidebarBadgeClasses } from '@enterprise/custom-documentation/utils/badge-styles';
5
6
 
6
7
  interface NestedItemProps {
7
8
  item: SidebarItem;
@@ -29,6 +30,8 @@ const NestedItem: React.FC<NestedItemProps> = ({
29
30
  const folderPath = folderHasLink ? buildUrl(`/docs/custom/${item.slug}`) : undefined;
30
31
  const isFolderActive = folderPath && (currentPath === folderPath || currentPath.endsWith(`/${item.slug}`));
31
32
 
33
+ const badgeClassName = getCustomDocsSidebarBadgeClasses(item.badge?.color);
34
+
32
35
  return (
33
36
  <div className="py-1">
34
37
  <div className="flex items-center">
@@ -66,17 +69,7 @@ const NestedItem: React.FC<NestedItemProps> = ({
66
69
  data-active={isFolderActive}
67
70
  >
68
71
  <span className="truncate">{item.label}</span>
69
- {item.badge && item?.badge?.text && (
70
- <span
71
- className={
72
- item.badge.color
73
- ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
74
- : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
75
- }
76
- >
77
- {item.badge.text}
78
- </span>
79
- )}
72
+ {item.badge && item?.badge?.text && <span className={badgeClassName}>{item.badge.text}</span>}
80
73
  </a>
81
74
  ) : (
82
75
  // Folder without index file - render as toggle button
@@ -88,17 +81,7 @@ const NestedItem: React.FC<NestedItemProps> = ({
88
81
  }}
89
82
  >
90
83
  <span className="truncate">{item.label}</span>
91
- {item.badge && item?.badge?.text && (
92
- <span
93
- className={
94
- item.badge.color
95
- ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
96
- : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
97
- }
98
- >
99
- {item.badge.text}
100
- </span>
101
- )}
84
+ {item.badge && item?.badge?.text && <span className={badgeClassName}>{item.badge.text}</span>}
102
85
  </button>
103
86
  )}
104
87
  </div>
@@ -153,6 +136,8 @@ const NestedItem: React.FC<NestedItemProps> = ({
153
136
  itemPath = item.slug;
154
137
  }
155
138
 
139
+ const badgeClassName = getCustomDocsSidebarBadgeClasses(item.badge?.color);
140
+
156
141
  return (
157
142
  <a
158
143
  href={itemPath}
@@ -165,17 +150,7 @@ const NestedItem: React.FC<NestedItemProps> = ({
165
150
  {item.label}
166
151
  {isExternalLink && <ExternalLinkIcon className="w-3 -mt-0.5 h-3" />}
167
152
  </span>
168
- {item.badge && item?.badge?.text && (
169
- <span
170
- className={
171
- item.badge.color
172
- ? `text-${item.badge.color}-600 dark:text-${item.badge.color}-400 ml-2 text-[10px] font-medium bg-${item.badge.color}-50 dark:bg-${item.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
173
- : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
174
- }
175
- >
176
- {item.badge.text}
177
- </span>
178
- )}
153
+ {item.badge && item?.badge?.text && <span className={badgeClassName}>{item.badge.text}</span>}
179
154
  </a>
180
155
  );
181
156
  };
@@ -4,6 +4,7 @@ import { buildUrl } from '@utils/url-builder';
4
4
  import type { CustomDocsNavProps, SidebarSection, SidebarItem } from './types';
5
5
  import NestedItem from './components/NestedItem';
6
6
  import NoResultsFound from './components/NoResultsFound';
7
+ import { getCustomDocsSidebarBadgeClasses } from '@enterprise/custom-documentation/utils/badge-styles';
7
8
 
8
9
  const STORAGE_KEY = 'EventCatalog:customDocsSidebarCollapsedGroups';
9
10
  const DEBOUNCE_DELAY = 300; // 300ms debounce delay
@@ -225,105 +226,98 @@ const CustomDocsNav: React.FC<CustomDocsNavProps> = ({ sidebarItems }) => {
225
226
  {hasNoResults ? (
226
227
  <NoResultsFound searchTerm={debouncedSearchTerm} />
227
228
  ) : (
228
- filteredSidebarItems.map((section: SidebarSection, index: number) => (
229
- <div className="pt-2 pb-2 px-3" key={`section-${index}`}>
230
- <div className="space-y-0" data-section={`section-${index}`}>
231
- {section.items ? (
232
- <div className="flex items-center">
233
- <button
234
- className="p-1 hover:bg-[rgb(var(--ec-content-hover))] rounded-md flex-shrink-0"
235
- onClick={(e) => {
236
- e.stopPropagation();
237
- toggleGroupCollapse(`section-${index}`);
238
- }}
239
- >
240
- <div
241
- className={`transition-transform duration-150 ${collapsedGroups[`section-${index}`] ? '' : 'rotate-180'}`}
229
+ filteredSidebarItems.map((section: SidebarSection, index: number) => {
230
+ const sectionBadgeClassName = getCustomDocsSidebarBadgeClasses(section.badge?.color);
231
+ return (
232
+ <div className="pt-2 pb-2 px-3" key={`section-${index}`}>
233
+ <div className="space-y-0" data-section={`section-${index}`}>
234
+ {section.items ? (
235
+ <div className="flex items-center">
236
+ <button
237
+ className="p-1 hover:bg-[rgb(var(--ec-content-hover))] rounded-md flex-shrink-0"
238
+ onClick={(e) => {
239
+ e.stopPropagation();
240
+ toggleGroupCollapse(`section-${index}`);
241
+ }}
242
242
  >
243
- <svg
244
- xmlns="http://www.w3.org/2000/svg"
245
- fill="none"
246
- viewBox="0 0 24 24"
247
- strokeWidth="1.5"
248
- stroke="currentColor"
249
- aria-hidden="true"
250
- data-slot="icon"
251
- className="h-3 w-3 text-[rgb(var(--ec-icon-color))]"
243
+ <div
244
+ className={`transition-transform duration-150 ${collapsedGroups[`section-${index}`] ? '' : 'rotate-180'}`}
252
245
  >
253
- <path strokeLinecap="round" strokeLinejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"></path>
254
- </svg>
246
+ <svg
247
+ xmlns="http://www.w3.org/2000/svg"
248
+ fill="none"
249
+ viewBox="0 0 24 24"
250
+ strokeWidth="1.5"
251
+ stroke="currentColor"
252
+ aria-hidden="true"
253
+ data-slot="icon"
254
+ className="h-3 w-3 text-[rgb(var(--ec-icon-color))]"
255
+ >
256
+ <path strokeLinecap="round" strokeLinejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"></path>
257
+ </svg>
258
+ </div>
259
+ </button>
260
+ <button
261
+ className="flex items-center justify-between px-2 py-0.5 text-xs font-bold rounded-md hover:bg-[rgb(var(--ec-content-hover))] min-w-0 flex-1"
262
+ onClick={(e) => {
263
+ e.stopPropagation();
264
+ toggleGroupCollapse(`section-${index}`);
265
+ }}
266
+ >
267
+ <span className="truncate">{section.label}</span>
268
+ {section.badge && section?.badge?.text && (
269
+ <span className={sectionBadgeClassName}>{section.badge.text}</span>
270
+ )}
271
+ </button>
272
+ </div>
273
+ ) : (
274
+ <div className="flex items-center">
275
+ <span className="flex-grow flex items-center justify-between px-2 py-0.5 text-xs font-bold rounded-md">
276
+ <span className="truncate">{section.label}</span>
277
+ <span className={sectionBadgeClassName}>Section</span>
278
+ </span>
279
+ </div>
280
+ )}
281
+
282
+ {section.items && (
283
+ <div
284
+ className={`overflow-hidden transition-[height] duration-150 ease-out ${
285
+ collapsedGroups[`section-${index}`] ? 'h-0' : 'h-auto'
286
+ }`}
287
+ >
288
+ <div className="space-y-0.5 border-[rgb(var(--ec-page-border))] border-l pl-4 ml-[9px] mt-1">
289
+ {section.items.map((item: SidebarItem, itemIndex: number) => (
290
+ <NestedItem
291
+ key={`item-${index}-${itemIndex}`}
292
+ item={item}
293
+ currentPath={currentPath}
294
+ parentId={`${index}`}
295
+ itemIndex={itemIndex}
296
+ collapsedGroups={collapsedGroups}
297
+ toggleGroupCollapse={toggleGroupCollapse}
298
+ />
299
+ ))}
255
300
  </div>
256
- </button>
257
- <button
258
- className="flex items-center justify-between px-2 py-0.5 text-xs font-bold rounded-md hover:bg-[rgb(var(--ec-content-hover))] min-w-0 flex-1"
259
- onClick={(e) => {
260
- e.stopPropagation();
261
- toggleGroupCollapse(`section-${index}`);
262
- }}
301
+ </div>
302
+ )}
303
+
304
+ {section.slug && !section.items && (
305
+ <a
306
+ href={buildUrl(`/docs/custom/${section.slug}`)}
307
+ className={`flex items-center px-2 py-1.5 text-xs ${
308
+ currentPath.endsWith(`/${section.slug}`)
309
+ ? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-page-text))] font-semibold'
310
+ : 'text-[rgb(var(--ec-page-text-muted))] hover:bg-[rgb(var(--ec-content-hover))]'
311
+ } rounded-md ml-6`}
312
+ data-active={currentPath.endsWith(`/${section.slug}`)}
263
313
  >
264
314
  <span className="truncate">{section.label}</span>
265
- {section.badge && section?.badge?.text && (
266
- <span
267
- className={
268
- section.badge.color
269
- ? `text-${section.badge.color}-600 dark:text-${section.badge.color}-400 ml-2 text-[10px] font-medium bg-${section.badge.color}-50 dark:bg-${section.badge.color}-500/20 px-2 py-0.5 rounded uppercase`
270
- : `text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase`
271
- }
272
- >
273
- {section.badge.text}
274
- </span>
275
- )}
276
- </button>
277
- </div>
278
- ) : (
279
- <div className="flex items-center">
280
- <span className="flex-grow flex items-center justify-between px-2 py-0.5 text-xs font-bold rounded-md">
281
- <span className="truncate">{section.label}</span>
282
- <span className="text-[rgb(var(--ec-accent))] ml-2 text-[10px] font-medium bg-[rgb(var(--ec-accent-subtle))] px-2 py-0.5 rounded uppercase">
283
- Section
284
- </span>
285
- </span>
286
- </div>
287
- )}
288
-
289
- {section.items && (
290
- <div
291
- className={`overflow-hidden transition-[height] duration-150 ease-out ${
292
- collapsedGroups[`section-${index}`] ? 'h-0' : 'h-auto'
293
- }`}
294
- >
295
- <div className="space-y-0.5 border-[rgb(var(--ec-page-border))] border-l pl-4 ml-[9px] mt-1">
296
- {section.items.map((item: SidebarItem, itemIndex: number) => (
297
- <NestedItem
298
- key={`item-${index}-${itemIndex}`}
299
- item={item}
300
- currentPath={currentPath}
301
- parentId={`${index}`}
302
- itemIndex={itemIndex}
303
- collapsedGroups={collapsedGroups}
304
- toggleGroupCollapse={toggleGroupCollapse}
305
- />
306
- ))}
307
- </div>
308
- </div>
309
- )}
310
-
311
- {section.slug && !section.items && (
312
- <a
313
- href={buildUrl(`/docs/custom/${section.slug}`)}
314
- className={`flex items-center px-2 py-1.5 text-xs ${
315
- currentPath.endsWith(`/${section.slug}`)
316
- ? 'bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-page-text))] font-semibold'
317
- : 'text-[rgb(var(--ec-page-text-muted))] hover:bg-[rgb(var(--ec-content-hover))]'
318
- } rounded-md ml-6`}
319
- data-active={currentPath.endsWith(`/${section.slug}`)}
320
- >
321
- <span className="truncate">{section.label}</span>
322
- </a>
323
- )}
315
+ </a>
316
+ )}
317
+ </div>
324
318
  </div>
325
- </div>
326
- ))
319
+ );
320
+ })
327
321
  )}
328
322
  </div>
329
323
  </nav>
@@ -12,6 +12,7 @@ import { buildUrl } from '@utils/url-builder';
12
12
  import { resourceToCollectionMap } from '@utils/collections/util';
13
13
  import { getMDXComponentsByName } from '@utils/markdown';
14
14
  import { getAdjacentPages } from '@enterprise/custom-documentation/utils/custom-docs';
15
+ import { getCustomDocsContentBadgeClasses } from '@enterprise/custom-documentation/utils/badge-styles';
15
16
 
16
17
  import CustomDocsNav from '@enterprise/custom-documentation/components/CustomDocsNav/CustomDocsNav.astro';
17
18
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
@@ -78,6 +79,11 @@ const ownersList = filteredOwners.map((o) => ({
78
79
  }));
79
80
 
80
81
  const badges = doc?.badges || [];
82
+
83
+ const getCustomDocBadgeClasses = (badge: any) => {
84
+ const color = badge?.backgroundColor || badge?.textColor;
85
+ return `${getCustomDocsContentBadgeClasses(color)} ${badge?.class ? badge.class : ''}`;
86
+ };
81
87
  ---
82
88
 
83
89
  <VerticalSideBarLayout title={doc.title || 'Documentation'} showNestedSideBar={false}>
@@ -104,12 +110,9 @@ const badges = doc?.badges || [];
104
110
  {badges.map((badge: any) => {
105
111
  return (
106
112
  <a href={badge.url || '#'} class="pb-2">
107
- <span
108
- id={badge.id || ''}
109
- class={`text-sm font-light text-gray-500 px-2 py-1 rounded-md mr-2 bg-gradient-to-b from-${badge.backgroundColor}-100 to-${badge.backgroundColor}-200 space-x-1 border border-${badge.backgroundColor}-200 text-${badge.textColor}-800 flex items-center ${badge.class ? badge.class : ''} `}
110
- >
111
- {badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1 " />}
112
- {badge.iconURL && <img src={badge.iconURL} class="w-5 h-5 inline-block " />}
113
+ <span id={badge.id || ''} class={`${getCustomDocBadgeClasses(badge)} mr-2`}>
114
+ {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />}
115
+ {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
113
116
  <span>{badge.content}</span>
114
117
  </span>
115
118
  </a>
@@ -0,0 +1,51 @@
1
+ type ThemeBadgeType = 'domain' | 'service' | 'event' | 'command' | 'query' | 'design' | 'channel' | 'default';
2
+
3
+ const THEME_BADGE_CLASSES: Record<ThemeBadgeType, string> = {
4
+ domain: 'bg-[rgb(var(--ec-badge-domain-bg))] text-[rgb(var(--ec-badge-domain-text))]',
5
+ service: 'bg-[rgb(var(--ec-badge-service-bg))] text-[rgb(var(--ec-badge-service-text))]',
6
+ event: 'bg-[rgb(var(--ec-badge-event-bg))] text-[rgb(var(--ec-badge-event-text))]',
7
+ command: 'bg-[rgb(var(--ec-badge-command-bg))] text-[rgb(var(--ec-badge-command-text))]',
8
+ query: 'bg-[rgb(var(--ec-badge-query-bg))] text-[rgb(var(--ec-badge-query-text))]',
9
+ design: 'bg-[rgb(var(--ec-badge-design-bg))] text-[rgb(var(--ec-badge-design-text))]',
10
+ channel: 'bg-[rgb(var(--ec-badge-channel-bg))] text-[rgb(var(--ec-badge-channel-text))]',
11
+ default: 'bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]',
12
+ };
13
+
14
+ const COLOR_TO_THEME_BADGE: Record<string, ThemeBadgeType> = {
15
+ yellow: 'domain',
16
+ amber: 'event',
17
+ orange: 'event',
18
+ red: 'event',
19
+ rose: 'event',
20
+ pink: 'service',
21
+ fuchsia: 'service',
22
+ blue: 'command',
23
+ sky: 'command',
24
+ purple: 'query',
25
+ violet: 'query',
26
+ cyan: 'query',
27
+ teal: 'design',
28
+ green: 'design',
29
+ emerald: 'design',
30
+ lime: 'design',
31
+ indigo: 'channel',
32
+ slate: 'default',
33
+ gray: 'default',
34
+ zinc: 'default',
35
+ neutral: 'default',
36
+ stone: 'default',
37
+ };
38
+
39
+ const getThemeBadgeClasses = (color?: string) => {
40
+ if (!color) return THEME_BADGE_CLASSES.default;
41
+ const key = color.trim().toLowerCase();
42
+ return THEME_BADGE_CLASSES[COLOR_TO_THEME_BADGE[key] || 'default'];
43
+ };
44
+
45
+ export const getCustomDocsSidebarBadgeClasses = (color?: string) => {
46
+ return `ml-2 text-[10px] font-medium px-2 py-0.5 rounded uppercase border border-[rgb(var(--ec-page-border))] ${getThemeBadgeClasses(color)}`;
47
+ };
48
+
49
+ export const getCustomDocsContentBadgeClasses = (color?: string) => {
50
+ return `inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border border-[rgb(var(--ec-page-border))] ${getThemeBadgeClasses(color)}`;
51
+ };
@@ -225,6 +225,22 @@ const canPageBeEmbedded = isEmbedEnabled();
225
225
  </script>
226
226
  <SEO title={`EventCatalog | ${title}`} description={description} ogTitle={title} />
227
227
  <style is:global>
228
+ html,
229
+ body {
230
+ background-color: rgb(var(--ec-page-bg));
231
+ }
232
+
233
+ body {
234
+ min-height: 100vh;
235
+ min-height: 100dvh;
236
+ }
237
+
238
+ #eventcatalog-application {
239
+ min-height: 100vh;
240
+ min-height: 100dvh;
241
+ background-color: rgb(var(--ec-page-bg));
242
+ }
243
+
228
244
  .sidebar-transition {
229
245
  transition-property: width, transform;
230
246
  transition-duration: 300ms;
@@ -10,7 +10,7 @@ import { BookOpenIcon, FileText } from 'lucide-react';
10
10
  <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center mb-16">
11
11
  <div>
12
12
  <div
13
- class="inline-flex items-center px-4 py-2 rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300 font-medium text-sm mb-6"
13
+ class="inline-flex items-center px-4 py-2 rounded-full bg-[rgb(var(--ec-accent-subtle))] text-[rgb(var(--ec-accent))] font-medium text-sm mb-6"
14
14
  >
15
15
  <FileText className="w-4 h-4 mr-2" />
16
16
  New: Bring your documentation into EventCatalog
@@ -26,7 +26,7 @@ import { BookOpenIcon, FileText } from 'lucide-react';
26
26
  <a
27
27
  href="https://demo.eventcatalog.dev/docs/custom/guides/creating-new-microservices/01-index"
28
28
  target="_blank"
29
- class="inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors duration-150"
29
+ class="inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-lg text-[rgb(var(--ec-button-text))] bg-[rgb(var(--ec-button-bg))] hover:opacity-90 transition-colors duration-150"
30
30
  >
31
31
  View the demo
32
32
  <svg class="ml-2 w-4 h-4" viewBox="0 0 20 20" fill="currentColor">
@@ -46,7 +46,7 @@ import { BookOpenIcon, FileText } from 'lucide-react';
46
46
  </div>
47
47
  <p class="text-sm text-[rgb(var(--ec-page-text-muted))]">
48
48
  Available with EventCatalog Starter or Scale plans
49
- <a href="https://www.eventcatalog.dev/pricing" class="text-blue-600 dark:text-blue-400 font-medium block"
49
+ <a href="https://www.eventcatalog.dev/pricing" class="text-[rgb(var(--ec-accent))] font-medium block"
50
50
  >Try free for 14 days, no credit card required</a
51
51
  >
52
52
  </p>
@@ -73,8 +73,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
73
73
  {/* Features Section */}
74
74
  <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
75
75
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
76
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
77
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
76
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
77
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
78
78
  <path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"></path>
79
79
  </svg>
80
80
  </div>
@@ -85,8 +85,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
85
85
  </div>
86
86
 
87
87
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
88
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
89
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
88
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
89
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
90
90
  <path
91
91
  d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"
92
92
  ></path>
@@ -99,8 +99,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
99
99
  </div>
100
100
 
101
101
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
102
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
103
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
102
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
103
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
104
104
  <path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4z"
105
105
  ></path>
106
106
  </svg>
@@ -112,8 +112,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
112
112
  </div>
113
113
 
114
114
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
115
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
116
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
115
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
116
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
117
117
  <path
118
118
  d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
119
119
  ></path>
@@ -126,8 +126,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
126
126
  </div>
127
127
 
128
128
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
129
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
130
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
129
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
130
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
131
131
  <path d="M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z"></path>
132
132
  </svg>
133
133
  </div>
@@ -138,8 +138,8 @@ import { BookOpenIcon, FileText } from 'lucide-react';
138
138
  </div>
139
139
 
140
140
  <div class="bg-[rgb(var(--ec-card-bg))] rounded-xl p-6 shadow-sm border border-[rgb(var(--ec-page-border))]">
141
- <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4">
142
- <svg class="w-6 h-6 text-blue-600 dark:text-blue-400" viewBox="0 0 24 24" fill="currentColor">
141
+ <div class="w-12 h-12 bg-[rgb(var(--ec-accent-subtle))] rounded-lg flex items-center justify-center mb-4">
142
+ <svg class="w-6 h-6 text-[rgb(var(--ec-accent))]" viewBox="0 0 24 24" fill="currentColor">
143
143
  <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"></path>
144
144
  </svg>
145
145
  </div>
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
3
3
  import VisualiserLayout from '@layouts/VisualiserLayout.astro';
4
- import { buildUrl } from '@utils/url-builder';
5
4
  import { ClientRouter } from 'astro:transitions';
6
5
  ---
7
6
 
@@ -21,10 +20,6 @@ import { ClientRouter } from 'astro:transitions';
21
20
  linkTo="visualiser"
22
21
  version="1.0.0"
23
22
  linksToVisualiser={false}
24
- href={{
25
- label: 'View Documentation',
26
- url: buildUrl('/docs'),
27
- }}
28
23
  />
29
24
  </div>
30
25
  <ClientRouter />
@@ -7,17 +7,31 @@ import { findAndReplace } from 'mdast-util-find-and-replace';
7
7
  * - [[entity|Order]] -> <ResourceRef type="entity">Order</ResourceRef>
8
8
  * - [[service|OrderService@1.0.0]] -> <ResourceRef type="service" version="1.0.0">OrderService</ResourceRef>
9
9
  * - [[diagram|target-architecture]] -> <ResourceRef type="diagram">target-architecture</ResourceRef>
10
+ * - [[doc|runbooks/oncall]] -> <ResourceRef type="doc">runbooks/oncall</ResourceRef>
10
11
  * - [[Order]] -> <ResourceRef type="entity">Order</ResourceRef> (defaults to entity)
11
12
  * - [[Order@0.0.1]] -> <ResourceRef type="entity" version="0.0.1">Order</ResourceRef>
12
13
  */
13
14
  export function remarkResourceRef() {
14
15
  return function (tree: any) {
15
- // First pass: match [[type|Name]] or [[type|Name@version]] pattern
16
+ // First pass: match [[type|Name]], [[type|Name@version]], or nested ids like [[doc|guides/getting-started]]
16
17
  findAndReplace(tree, [
17
- /\[\[([a-z]+)\|([\w-]+)(?:@([\d.]+))?\]\]/g,
18
+ /\[\[([a-z-]+)\|([^[\]]+?)\]\]/g,
18
19
  // @ts-ignore: Types are complex but it works
19
- function (_match: string, type: string, resourceId: string, version?: string) {
20
- const attributes: any[] = [{ type: 'mdxJsxAttribute', name: 'type', value: type }];
20
+ function (_match: string, type: string, target: string) {
21
+ const normalizedType = type.trim().toLowerCase();
22
+ let resourceId = target.trim();
23
+ let version: string | undefined;
24
+
25
+ // Preserve existing @version behavior for resource refs, but keep doc targets as-is.
26
+ if (normalizedType !== 'doc') {
27
+ const versionMatch = resourceId.match(/^(.*)@([\d.]+)$/);
28
+ if (versionMatch) {
29
+ resourceId = versionMatch[1].trim();
30
+ version = versionMatch[2];
31
+ }
32
+ }
33
+
34
+ const attributes: any[] = [{ type: 'mdxJsxAttribute', name: 'type', value: normalizedType }];
21
35
  if (version) {
22
36
  attributes.push({ type: 'mdxJsxAttribute', name: 'version', value: version });
23
37
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "3.15.3",
9
+ "version": "3.15.5",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -101,8 +101,8 @@
101
101
  "update-notifier": "^7.3.1",
102
102
  "uuid": "^10.0.0",
103
103
  "zod": "^3.25.0",
104
- "@eventcatalog/linter": "1.0.5",
105
- "@eventcatalog/sdk": "2.14.1",
104
+ "@eventcatalog/linter": "1.0.6",
105
+ "@eventcatalog/sdk": "2.14.2",
106
106
  "@eventcatalog/visualiser": "^3.14.0"
107
107
  },
108
108
  "devDependencies": {