@eventcatalog/core 3.39.4 → 3.39.6

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 (71) 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-NSR4DZXS.js → chunk-4OSFLWLG.js} +1 -1
  6. package/dist/{chunk-WLUQZCIH.js → chunk-IKZ5ITXP.js} +1 -1
  7. package/dist/{chunk-PVOVC2UV.js → chunk-LEUIMTEQ.js} +1 -1
  8. package/dist/{chunk-O2CZERUN.js → chunk-MQAZ4LXP.js} +1 -1
  9. package/dist/{chunk-ONQOIF2X.js → chunk-ORVOST63.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/docs/api/03-domain-api.md +16 -0
  13. package/dist/docs/api/04-service-api.md +16 -0
  14. package/dist/docs/api/05-command-api.md +16 -0
  15. package/dist/docs/api/06-event-api.md +16 -0
  16. package/dist/docs/api/06-query-api.md +16 -0
  17. package/dist/docs/api/08-channel-api.md +16 -0
  18. package/dist/docs/api/09-flow-api.md +16 -0
  19. package/dist/docs/api/10-entity-api.md +15 -0
  20. package/dist/docs/api/12-data-product-api.md +17 -0
  21. package/dist/docs/development/01-fundamentals.md +7 -0
  22. package/dist/docs/development/01-getting-started/installation.md +8 -0
  23. package/dist/docs/development/01-getting-started/project-structure.md +2 -0
  24. package/dist/docs/development/bring-your-own-documentation/01-introduction.md +3 -1
  25. package/dist/docs/development/customization/customize-sidebars/00-application-sidebar.md +45 -5
  26. package/dist/docs/editor/00-overview.md +73 -0
  27. package/dist/docs/editor/01-first-edit.md +124 -0
  28. package/dist/docs/editor/_category_.json +12 -0
  29. package/dist/docs/editor/explanation/_category_.json +11 -0
  30. package/dist/docs/editor/explanation/beta-status-feedback.md +48 -0
  31. package/dist/docs/editor/explanation/how-it-works.md +49 -0
  32. package/dist/docs/editor/explanation/markdown-mdx-git.md +58 -0
  33. package/dist/docs/editor/how-to/_category_.json +11 -0
  34. package/dist/docs/editor/how-to/add-schemas-and-specifications.md +66 -0
  35. package/dist/docs/editor/how-to/edit-resource.md +88 -0
  36. package/dist/docs/editor/how-to/invite-editors.md +68 -0
  37. package/dist/docs/editor/how-to/open-catalog.md +44 -0
  38. package/dist/docs/editor/how-to/preview-changes.md +55 -0
  39. package/dist/docs/editor/how-to/revert-local-changes.md +43 -0
  40. package/dist/docs/editor/how-to/review-and-commit-changes.md +57 -0
  41. package/dist/docs/editor/how-to/run-locally.md +71 -0
  42. package/dist/docs/editor/how-to/use-flow-editor.md +66 -0
  43. package/dist/docs/editor/how-to/use-slash-commands.md +67 -0
  44. package/dist/docs/editor/reference/_category_.json +11 -0
  45. package/dist/docs/editor/reference/cli.md +61 -0
  46. package/dist/docs/editor/reference/supported-content.md +81 -0
  47. package/dist/docs/editor/reference/supported-resources.md +51 -0
  48. package/dist/docs/editor/reference/troubleshooting.md +76 -0
  49. package/dist/eventcatalog.cjs +1 -1
  50. package/dist/eventcatalog.js +5 -5
  51. package/dist/generate.cjs +1 -1
  52. package/dist/generate.js +3 -3
  53. package/dist/utils/cli-logger.cjs +1 -1
  54. package/dist/utils/cli-logger.js +2 -2
  55. package/eventcatalog/src/components/Badge.astro +50 -0
  56. package/eventcatalog/src/components/Tables/Discover/DiscoverTable.tsx +1 -0
  57. package/eventcatalog/src/components/Tables/Discover/columns.tsx +35 -13
  58. package/eventcatalog/src/components/Tables/Table.tsx +1 -0
  59. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +24 -11
  60. package/eventcatalog/src/content.config-shared-collections.ts +1 -0
  61. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +2 -18
  62. package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +250 -205
  63. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +2 -14
  64. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +2 -14
  65. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +3 -15
  66. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +2 -18
  67. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +2 -18
  68. package/eventcatalog/src/pages/docs/[type]/[id]/language/[dictionaryId]/index.astro +2 -11
  69. package/eventcatalog/src/utils/badge-styles.ts +31 -0
  70. package/eventcatalog/src/utils/sidebar-visibility.ts +41 -0
  71. package/package.json +4 -4
@@ -64,6 +64,7 @@ import { isCollectionVisibleInCatalog } from '@eventcatalog';
64
64
  import { buildUrl } from '@utils/url-builder';
65
65
  import { getQueries } from '@utils/collections/queries';
66
66
  import { hasLandingPageForDocs } from '@utils/pages';
67
+ import { filterSidebarItems } from '@utils/sidebar-visibility';
67
68
 
68
69
  import { isEmbedEnabled, isCustomStylesEnabled, isEventCatalogScaleEnabled, isCustomDocsEnabled, isSSR } from '@utils/feature';
69
70
 
@@ -128,66 +129,66 @@ const getDefaultUrl = (route: string, defaultValue: string) => {
128
129
 
129
130
  const userSideBarConfiguration = config.sidebar || [];
130
131
 
131
- const navigationItems = [
132
- {
133
- id: '/',
134
- label: 'Catalog',
135
- icon: BookOpen,
136
- href: buildUrl(config.landingPage || '/'),
137
- current:
138
- currentPath === '/' ||
139
- (currentPath.includes('/docs') && !currentPath.includes('/docs/custom')) ||
140
- currentPath.includes('/architecture/') ||
141
- currentPath.includes('/visualiser') ||
142
- (currentPath.includes('/schemas') &&
143
- !currentPath.includes('/schemas/explorer') &&
144
- !currentPath.includes('/schemas/fields')),
145
- },
146
- {
147
- id: '/docs/custom',
148
- label: 'Documentation',
149
- icon: FileText,
150
- href: getDefaultUrl('docs/custom', '/docs/custom'),
151
- current: currentPath.includes('/docs/custom'),
152
- isPremium: true,
153
- visible: isCustomDocsEnabled() && customDocs.length > 0,
154
- },
155
- {
156
- id: '/schemas/explorer',
157
- label: 'Schemas',
158
- icon: FileCode,
159
- href: buildUrl('/schemas/explorer'),
160
- current: currentPath.includes('/schemas/explorer') && !currentPath.includes('/schemas/fields'),
161
- },
162
- ...(isSSR()
163
- ? [
164
- {
165
- id: '/schemas/fields',
166
- label: 'Schema Insights',
167
- icon: Waypoints,
168
- href: buildUrl('/schemas/fields'),
169
- current: currentPath.includes('/schemas/fields'),
170
- },
171
- ]
172
- : []),
173
- ].filter((item) => {
174
- const userSideBarOption = userSideBarConfiguration.find((config: { id: string; visible: boolean }) => config.id === item.id);
175
- const defaultVisible = item.visible ?? true;
176
- return userSideBarOption ? userSideBarOption.visible : defaultVisible;
177
- });
178
-
179
- const studioNavigationItem = [
180
- {
181
- id: '/studio',
182
- label: 'EventCatalog Studio',
183
- icon: SquareDashedMousePointerIcon,
184
- href: buildUrl('/studio'),
185
- current: currentPath.includes('/studio'),
186
- },
187
- ].filter((item) => {
188
- const userSideBarOption = userSideBarConfiguration.find((config: { id: string; visible: boolean }) => config.id === item.id);
189
- return userSideBarOption ? userSideBarOption.visible : true;
190
- });
132
+ const navigationItems = filterSidebarItems(
133
+ [
134
+ {
135
+ id: '/',
136
+ label: 'Catalog',
137
+ icon: BookOpen,
138
+ href: buildUrl(config.landingPage || '/'),
139
+ current:
140
+ currentPath === '/' ||
141
+ (currentPath.includes('/docs') && !currentPath.includes('/docs/custom')) ||
142
+ currentPath.includes('/architecture/') ||
143
+ currentPath.includes('/visualiser') ||
144
+ (currentPath.includes('/schemas') &&
145
+ !currentPath.includes('/schemas/explorer') &&
146
+ !currentPath.includes('/schemas/fields')),
147
+ },
148
+ {
149
+ id: '/docs/custom',
150
+ aliases: ['/docs'],
151
+ label: 'Documentation',
152
+ icon: FileText,
153
+ href: getDefaultUrl('docs/custom', '/docs/custom'),
154
+ current: currentPath.includes('/docs/custom'),
155
+ isPremium: true,
156
+ visible: isCustomDocsEnabled() && customDocs.length > 0,
157
+ },
158
+ {
159
+ id: '/schemas/explorer',
160
+ label: 'Schemas',
161
+ icon: FileCode,
162
+ href: buildUrl('/schemas/explorer'),
163
+ current: currentPath.includes('/schemas/explorer') && !currentPath.includes('/schemas/fields'),
164
+ },
165
+ ...(isSSR()
166
+ ? [
167
+ {
168
+ id: '/schemas/fields',
169
+ label: 'Schema Insights',
170
+ icon: Waypoints,
171
+ href: buildUrl('/schemas/fields'),
172
+ current: currentPath.includes('/schemas/fields'),
173
+ },
174
+ ]
175
+ : []),
176
+ ],
177
+ userSideBarConfiguration
178
+ );
179
+
180
+ const studioNavigationItem = filterSidebarItems(
181
+ [
182
+ {
183
+ id: '/studio',
184
+ label: 'EventCatalog Studio',
185
+ icon: SquareDashedMousePointerIcon,
186
+ href: buildUrl('/studio'),
187
+ current: currentPath.includes('/studio'),
188
+ },
189
+ ],
190
+ userSideBarConfiguration
191
+ );
191
192
 
192
193
  const premiumFeatures: Array<{
193
194
  id: string;
@@ -198,86 +199,119 @@ const premiumFeatures: Array<{
198
199
  isPremium?: boolean;
199
200
  }> = [];
200
201
 
201
- const browseItems = [
202
- {
203
- label: 'Domains',
204
- icon: RectangleGroupIcon,
205
- href: buildUrl('/discover/domains'),
206
- current: currentPath === buildUrl('/discover/domains'),
207
- },
208
- {
209
- label: 'Services',
210
- icon: ServerIcon,
211
- href: buildUrl('/discover/services'),
212
- current: currentPath === buildUrl('/discover/services'),
213
- },
214
- {
215
- label: 'External Systems',
216
- icon: GlobeAltIcon,
217
- href: buildUrl('/discover/external-systems'),
218
- current: currentPath === buildUrl('/discover/external-systems'),
219
- },
220
- {
221
- label: 'Events',
222
- icon: BoltIcon,
223
- href: buildUrl('/discover/events'),
224
- current: currentPath === buildUrl('/discover/events'),
225
- },
226
- {
227
- label: 'Commands',
228
- icon: ChatBubbleLeftIcon,
229
- href: buildUrl('/discover/commands'),
230
- current: currentPath === buildUrl('/discover/commands'),
231
- },
232
- {
233
- label: 'Queries',
234
- icon: MagnifyingGlassIcon,
235
- href: buildUrl('/discover/queries'),
236
- current: currentPath === buildUrl('/discover/queries'),
237
- },
238
- {
239
- label: 'Flows',
240
- icon: QueueListIcon,
241
- href: buildUrl('/discover/flows'),
242
- current: currentPath === buildUrl('/discover/flows'),
243
- },
244
- {
245
- label: 'Data Stores',
246
- icon: Database,
247
- href: buildUrl('/discover/containers'),
248
- current: currentPath === buildUrl('/discover/containers'),
249
- },
250
- {
251
- label: 'Data Products',
252
- icon: CubeIcon,
253
- href: buildUrl('/discover/data-products'),
254
- current: currentPath === buildUrl('/discover/data-products'),
255
- },
256
- ];
257
-
258
- const organizationItems = [
259
- {
260
- label: 'Teams',
261
- icon: UsersRound,
262
- href: buildUrl('/directory/teams'),
263
- current: currentPath === buildUrl('/directory/teams'),
264
- },
265
- {
266
- label: 'Users',
267
- icon: UserRound,
268
- href: buildUrl('/directory/users'),
269
- current: currentPath === buildUrl('/directory/users'),
270
- },
271
- ];
272
-
273
- const settingsItems = [
274
- {
275
- label: 'Settings',
276
- icon: Settings,
277
- href: buildUrl('/settings/general'),
278
- current: currentPath.startsWith(buildUrl('/settings')),
279
- },
280
- ];
202
+ const browseItems = filterSidebarItems(
203
+ [
204
+ {
205
+ id: '/discover/domains',
206
+ aliases: ['/discover'],
207
+ label: 'Domains',
208
+ icon: RectangleGroupIcon,
209
+ href: buildUrl('/discover/domains'),
210
+ current: currentPath === buildUrl('/discover/domains'),
211
+ },
212
+ {
213
+ id: '/discover/services',
214
+ aliases: ['/discover'],
215
+ label: 'Services',
216
+ icon: ServerIcon,
217
+ href: buildUrl('/discover/services'),
218
+ current: currentPath === buildUrl('/discover/services'),
219
+ },
220
+ {
221
+ id: '/discover/external-systems',
222
+ aliases: ['/discover'],
223
+ label: 'External Systems',
224
+ icon: GlobeAltIcon,
225
+ href: buildUrl('/discover/external-systems'),
226
+ current: currentPath === buildUrl('/discover/external-systems'),
227
+ },
228
+ {
229
+ id: '/discover/events',
230
+ aliases: ['/discover'],
231
+ label: 'Events',
232
+ icon: BoltIcon,
233
+ href: buildUrl('/discover/events'),
234
+ current: currentPath === buildUrl('/discover/events'),
235
+ },
236
+ {
237
+ id: '/discover/commands',
238
+ aliases: ['/discover'],
239
+ label: 'Commands',
240
+ icon: ChatBubbleLeftIcon,
241
+ href: buildUrl('/discover/commands'),
242
+ current: currentPath === buildUrl('/discover/commands'),
243
+ },
244
+ {
245
+ id: '/discover/queries',
246
+ aliases: ['/discover'],
247
+ label: 'Queries',
248
+ icon: MagnifyingGlassIcon,
249
+ href: buildUrl('/discover/queries'),
250
+ current: currentPath === buildUrl('/discover/queries'),
251
+ },
252
+ {
253
+ id: '/discover/flows',
254
+ aliases: ['/discover'],
255
+ label: 'Flows',
256
+ icon: QueueListIcon,
257
+ href: buildUrl('/discover/flows'),
258
+ current: currentPath === buildUrl('/discover/flows'),
259
+ },
260
+ {
261
+ id: '/discover/containers',
262
+ aliases: ['/discover'],
263
+ label: 'Data Stores',
264
+ icon: Database,
265
+ href: buildUrl('/discover/containers'),
266
+ current: currentPath === buildUrl('/discover/containers'),
267
+ },
268
+ {
269
+ id: '/discover/data-products',
270
+ aliases: ['/discover'],
271
+ label: 'Data Products',
272
+ icon: CubeIcon,
273
+ href: buildUrl('/discover/data-products'),
274
+ current: currentPath === buildUrl('/discover/data-products'),
275
+ },
276
+ ],
277
+ userSideBarConfiguration
278
+ );
279
+
280
+ const organizationItems = filterSidebarItems(
281
+ [
282
+ {
283
+ id: '/directory/teams',
284
+ aliases: ['/directory'],
285
+ label: 'Teams',
286
+ icon: UsersRound,
287
+ href: buildUrl('/directory/teams'),
288
+ current: currentPath === buildUrl('/directory/teams'),
289
+ },
290
+ {
291
+ id: '/directory/users',
292
+ aliases: ['/directory'],
293
+ label: 'Users',
294
+ icon: UserRound,
295
+ href: buildUrl('/directory/users'),
296
+ current: currentPath === buildUrl('/directory/users'),
297
+ },
298
+ ],
299
+ userSideBarConfiguration
300
+ );
301
+
302
+ const settingsItems = filterSidebarItems(
303
+ [
304
+ {
305
+ id: '/settings/general',
306
+ aliases: ['/settings'],
307
+ label: 'Settings',
308
+ icon: Settings,
309
+ href: buildUrl('/settings/general'),
310
+ current: currentPath.startsWith(buildUrl('/settings')),
311
+ },
312
+ ],
313
+ userSideBarConfiguration
314
+ );
281
315
 
282
316
  const currentNavigationItem = [...navigationItems, ...studioNavigationItem, ...premiumFeatures].find((item) => item.current);
283
317
  const { title, description, showNestedSideBar = true, showHeader = true } = Astro.props;
@@ -521,58 +555,64 @@ const canPageBeEmbedded = isEmbedEnabled();
521
555
  })
522
556
  }
523
557
 
524
- <hr class="rail-divider my-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
525
-
526
- <div
527
- class="rail-section-label px-3 pb-1 text-[0.65rem] font-semibold tracking-[0.18em] uppercase text-[rgb(var(--ec-sidebar-text)/0.5)]"
528
- >
529
- Browse
530
- </div>
531
-
532
558
  {
533
- browseItems.map((item) => (
534
- <a
535
- href={item.href}
536
- data-role="secondary-nav-item"
537
- aria-label={item.label}
538
- class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
539
- item.current
540
- ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
541
- : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
542
- }`}
543
- title={item.label}
544
- >
545
- <item.icon className="h-3.5 w-3.5 flex-shrink-0" aria-hidden="true" />
546
- <span class="nav-item-label">{item.label}</span>
547
- </a>
548
- ))
559
+ browseItems.length > 0 && (
560
+ <Fragment>
561
+ <hr class="rail-divider my-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
562
+
563
+ <div class="rail-section-label px-3 pb-1 text-[0.65rem] font-semibold tracking-[0.18em] uppercase text-[rgb(var(--ec-sidebar-text)/0.5)]">
564
+ Browse
565
+ </div>
566
+
567
+ {browseItems.map((item) => (
568
+ <a
569
+ id={item.id}
570
+ href={item.href}
571
+ data-role="secondary-nav-item"
572
+ aria-label={item.label}
573
+ class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
574
+ item.current
575
+ ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
576
+ : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
577
+ }`}
578
+ title={item.label}
579
+ >
580
+ <item.icon className="h-3.5 w-3.5 flex-shrink-0" aria-hidden="true" />
581
+ <span class="nav-item-label">{item.label}</span>
582
+ </a>
583
+ ))}
584
+ </Fragment>
585
+ )
549
586
  }
550
587
 
551
- <hr class="rail-divider my-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
552
-
553
- <div
554
- class="rail-section-label px-3 pb-1 text-[0.65rem] font-semibold tracking-[0.18em] uppercase text-[rgb(var(--ec-sidebar-text)/0.5)]"
555
- >
556
- Organization
557
- </div>
558
-
559
588
  {
560
- organizationItems.map((item) => (
561
- <a
562
- href={item.href}
563
- data-role="secondary-nav-item"
564
- aria-label={item.label}
565
- class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
566
- item.current
567
- ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
568
- : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
569
- }`}
570
- title={item.label}
571
- >
572
- <item.icon className="h-3.5 w-3.5 flex-shrink-0" aria-hidden="true" />
573
- <span class="nav-item-label">{item.label}</span>
574
- </a>
575
- ))
589
+ organizationItems.length > 0 && (
590
+ <Fragment>
591
+ <hr class="rail-divider my-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
592
+
593
+ <div class="rail-section-label px-3 pb-1 text-[0.65rem] font-semibold tracking-[0.18em] uppercase text-[rgb(var(--ec-sidebar-text)/0.5)]">
594
+ Organization
595
+ </div>
596
+
597
+ {organizationItems.map((item) => (
598
+ <a
599
+ id={item.id}
600
+ href={item.href}
601
+ data-role="secondary-nav-item"
602
+ aria-label={item.label}
603
+ class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
604
+ item.current
605
+ ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
606
+ : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
607
+ }`}
608
+ title={item.label}
609
+ >
610
+ <item.icon className="h-3.5 w-3.5 flex-shrink-0" aria-hidden="true" />
611
+ <span class="nav-item-label">{item.label}</span>
612
+ </a>
613
+ ))}
614
+ </Fragment>
615
+ )
576
616
  }
577
617
 
578
618
  {premiumFeatures.length > 0 && <hr class="rail-divider my-2 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />}
@@ -598,24 +638,29 @@ const canPageBeEmbedded = isEmbedEnabled();
598
638
  }
599
639
 
600
640
  <div class="mt-auto pt-3">
601
- <hr class="rail-divider mb-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
602
641
  {
603
- settingsItems.map((item) => (
604
- <a
605
- href={item.href}
606
- data-role="secondary-nav-item"
607
- aria-label={item.label}
608
- class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
609
- item.current
610
- ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
611
- : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
612
- }`}
613
- title={item.label}
614
- >
615
- <item.icon className="h-4 w-4 flex-shrink-0" aria-hidden="true" />
616
- <span class="nav-item-label">{item.label}</span>
617
- </a>
618
- ))
642
+ settingsItems.length > 0 && (
643
+ <Fragment>
644
+ <hr class="rail-divider mb-3 border-t border-[rgb(var(--ec-sidebar-border)/0.7)]" />
645
+ {settingsItems.map((item) => (
646
+ <a
647
+ id={item.id}
648
+ href={item.href}
649
+ data-role="secondary-nav-item"
650
+ aria-label={item.label}
651
+ class={`nav-secondary-item flex items-center gap-3 px-3 py-2.5 rounded-xl border text-[13px] font-medium transition-all duration-150 ${
652
+ item.current
653
+ ? 'border-[rgb(var(--ec-accent)/0.2)] bg-[rgb(var(--ec-page-bg)/0.88)] text-[rgb(var(--ec-accent))] shadow-sm'
654
+ : 'border-transparent text-[rgb(var(--ec-sidebar-text))] hover:border-[rgb(var(--ec-sidebar-border)/0.65)] hover:bg-[rgb(var(--ec-page-bg)/0.78)] hover:text-[rgb(var(--ec-page-text))]'
655
+ }`}
656
+ title={item.label}
657
+ >
658
+ <item.icon className="h-4 w-4 flex-shrink-0" aria-hidden="true" />
659
+ <span class="nav-item-label">{item.label}</span>
660
+ </a>
661
+ ))}
662
+ </Fragment>
663
+ )
619
664
  }
620
665
  </div>
621
666
  </nav>
@@ -5,11 +5,11 @@ import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
5
5
  import Admonition from '@components/MDX/Admonition';
6
6
  import components from '@components/MDX/components';
7
7
  import CopyAsMarkdown from '@components/CopyAsMarkdown';
8
+ import Badge from '@components/Badge.astro';
8
9
  import { buildUrl } from '@utils/url-builder';
9
10
  import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
10
11
  import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
11
12
  import { getIcon } from '@utils/badges';
12
- import { getBadgeStyle } from '@utils/badge-styles';
13
13
  import { collectionToResourceMap } from '@utils/collections/util';
14
14
 
15
15
  import { Page } from './_index.data';
@@ -80,19 +80,7 @@ const pagefindAttributes =
80
80
  {
81
81
  badges.length > 0 && (
82
82
  <div class="flex flex-wrap gap-3 py-4">
83
- {badges.map((badge: any) => (
84
- <span
85
- class={`
86
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
87
- ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
88
- text-[rgb(var(--ec-page-text))]
89
- `}
90
- style={getBadgeStyle(badge)}
91
- >
92
- {badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
93
- <span>{badge.content}</span>
94
- </span>
95
- ))}
83
+ {badges.map((badge: any) => <Badge badge={badge} />)}
96
84
  </div>
97
85
  )
98
86
  }
@@ -5,11 +5,11 @@ import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
5
5
  import Admonition from '@components/MDX/Admonition';
6
6
  import components from '@components/MDX/components';
7
7
  import CopyAsMarkdown from '@components/CopyAsMarkdown';
8
+ import Badge from '@components/Badge.astro';
8
9
  import { buildUrl } from '@utils/url-builder';
9
10
  import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
10
11
  import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
11
12
  import { getIcon } from '@utils/badges';
12
- import { getBadgeStyle } from '@utils/badge-styles';
13
13
  import { collectionToResourceMap } from '@utils/collections/util';
14
14
 
15
15
  import { Page } from './_index.data';
@@ -73,19 +73,7 @@ const pagefindAttributes =
73
73
  {
74
74
  badges.length > 0 && (
75
75
  <div class="flex flex-wrap gap-3 py-4">
76
- {badges.map((badge: any) => (
77
- <span
78
- class={`
79
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
80
- ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
81
- text-[rgb(var(--ec-page-text))]
82
- `}
83
- style={getBadgeStyle(badge)}
84
- >
85
- {badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
86
- <span>{badge.content}</span>
87
- </span>
88
- ))}
76
+ {badges.map((badge: any) => <Badge badge={badge} />)}
89
77
  </div>
90
78
  )
91
79
  }
@@ -15,10 +15,10 @@ import mdxComponents from '@components/MDX/components';
15
15
  import 'diff2html/bundles/css/diff2html.min.css';
16
16
 
17
17
  import { buildUrl } from '@utils/url-builder';
18
- import { getBadgeStyle } from '@utils/badge-styles';
19
18
  import { getPreviousVersion } from '@utils/collections/util';
20
19
  import { getDiffsForCurrentAndPreviousVersion } from '@utils/file-diffs';
21
20
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
21
+ import Badge from '@components/Badge.astro';
22
22
  import { ClientRouter } from 'astro:transitions';
23
23
  import { isChangelogEnabled } from '@utils/feature';
24
24
 
@@ -143,13 +143,7 @@ const badges = [getBadge()];
143
143
  badges && (
144
144
  <div class="flex flex-wrap py-2 pt-4">
145
145
  {badges.map((badge: any) => (
146
- <span
147
- class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-transparent border border-[rgb(var(--ec-page-border))]"
148
- style={getBadgeStyle(badge)}
149
- >
150
- {badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
151
- <span>{badge.content}</span>
152
- </span>
146
+ <Badge badge={badge} className="mr-2 px-2 py-1 rounded-md" />
153
147
  ))}
154
148
  </div>
155
149
  )
@@ -195,13 +189,7 @@ const badges = [getBadge()];
195
189
  {log.badges && (
196
190
  <div class="flex flex-wrap">
197
191
  {log.badges.map((badge: any) => (
198
- <span
199
- class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]"
200
- style={getBadgeStyle(badge)}
201
- >
202
- {badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
203
- <span>{badge.content}</span>
204
- </span>
192
+ <Badge badge={badge} className="mr-2 px-2 py-1 rounded-md" />
205
193
  ))}
206
194
  </div>
207
195
  )}
@@ -7,8 +7,8 @@ import Footer from '@layouts/Footer.astro';
7
7
  import { Page } from './_[filename].data';
8
8
  import { getAbsoluteFilePathForAstroFile } from '@utils/files';
9
9
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
10
- import { getBadgeStyle } from '@utils/badge-styles';
11
10
  import Admonition from '@components/MDX/Admonition';
11
+ import Badge from '@components/Badge.astro';
12
12
 
13
13
  import { ServerIcon } from '@heroicons/react/24/outline';
14
14
 
@@ -83,23 +83,7 @@ const pagefindAttributes =
83
83
  badges && badges.length > 0 && (
84
84
  <div class="flex flex-wrap gap-3 py-4">
85
85
  {badges.map((badge: any) => {
86
- return (
87
- <span
88
- id={badge.id || ''}
89
- class={`
90
- inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
91
- ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
92
- text-[rgb(var(--ec-page-text))]
93
- shadow-xs
94
- ${badge.class ? badge.class : ''}
95
- `}
96
- style={getBadgeStyle(badge)}
97
- >
98
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
99
- {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
100
- <span>{badge.content}</span>
101
- </span>
102
- );
86
+ return <Badge badge={badge} />;
103
87
  })}
104
88
  </div>
105
89
  )